[
  {
    "path": ".bufstyle.yaml",
    "content": "version: v1\nignore:\n  PACKAGE_FILENAME:\n    - private/gen\n"
  },
  {
    "path": ".dockerignore",
    "content": "# Autogenerated by makego. DO NOT EDIT.\n.build/\n.claude/settings.local.json\n.ctrlp\n.env/\n.idea/\n.tmp/\n.vscode/\ncmd/buf/buf\ncmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver\ncmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer\ncmd/buf/internal/command/alpha/protoc/test.txt\ncmd/buf/internal/command/generate/internal/protoc-gen-top-level-type-names-yaml/protoc-gen-top-level-type-names-yaml\ncmd/buf/testdata/imports/cache/v3/modulelocks/\ncmd/buf/testdata/imports/corrupted_cache_dep/v3/modulelocks/\ncmd/buf/testdata/imports/corrupted_cache_file/v3/modulelocks/\ncmd/protoc-gen-buf-breaking/protoc-gen-buf-breaking\ncmd/protoc-gen-buf-lint/protoc-gen-buf-lint\nprivate/buf/buftesting/cache/\nprivate/buf/bufwkt/cmd/wkt-go-data/wkt-go-data\nprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category/buf-plugin-duplicate-category\nprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule/buf-plugin-duplicate-rule\nprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-panic/buf-plugin-panic\nprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/buf-plugin-protovalidate-ext\nprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext/buf-plugin-rpc-ext\nprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix/buf-plugin-suffix\nprivate/bufpkg/bufmodule/bufmoduleapi/cmd/buf-legacyfederation-go-data/buf-legacyfederation-go-data\nprivate/bufpkg/bufmodule/bufmoduletesting/cmd/buf-digest/buf-digest\nprivate/bufpkg/bufmodule/bufmoduletesting/cmd/buf-new-commit-id/buf-new-commit-id\nprivate/bufpkg/buftesting/cache/\nprivate/pkg/bandeps/cmd/bandeps/bandeps\nprivate/pkg/git/cmd/git-ls-files-unstaged/git-ls-files-unstaged\nprivate/pkg/licenseheader/cmd/license-header/license-header\nprivate/pkg/storage/cmd/ddiff/ddiff\nprivate/pkg/storage/cmd/storage-go-data/storage-go-data\nprivate/pkg/storage/storageos/tmp/\n"
  },
  {
    "path": ".envrc",
    "content": ". $(make -s direnv)\n"
  },
  {
    "path": ".gitattributes",
    "content": "# This is similar to the git option core.autocrlf but it applies to all\n# users of the repository and therefore doesn't depend on a developers\n# local configuration.\n* text=auto\n\n# Never attempt EOL conversion on files within testdata\n**/testdata/** -text -diff\n\n**/corpus/** linguist-generated=true\n**/usage.gen.go linguist-generated=true\n/private/gen/** linguist-generated=true\n"
  },
  {
    "path": ".github/CODEOWNERS",
    "content": ""
  },
  {
    "path": ".github/ISSUE_TEMPLATE/1-bug-report.yml",
    "content": "name: Bug Report\ndescription: File a bug report.\nlabels: Bug\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for helping us improve Buf by filing bugs, we really appreciate it! For us to investigate your issue efficiently, we need a minimal reproducible example. We get lots of support requests, so please help us help you. We find that the easiest way to do this is by linking to a GitHub repository with the setup of the example, as well as a set of commands for us to run on this GitHub repository to reproduce the issue. You can use an existing GitHub repository, or a temporary GitHub repository you create.\n\n        **If you do not provide a minimal reproducible example in a GitHub repository, we will likely close your issue until a reproducible example is provided. We apologize, but we have to be efficient with our support requests, and we appreciate your help.**\n\n        [This article](https://stackoverflow.com/help/minimal-reproducible-example) on minimal reproducible examples may be of use!\n  - type: input\n    id: github-repository\n    attributes:\n      label: GitHub repository with your minimal reproducible example (do not leave this field blank or fill out this field with \"github.com/bufbuild/buf\" or we will automatically close your issue, see the instructions above!)\n      description: Provide us with a link to the GitHub repository that contains the setup needed to reproduce the issue. This is a repository you create, and is required for us to investigate your issue.\n      placeholder: https://github.com/you/temp-repo-with-repro\n    validations:\n      required: true\n  - type: textarea\n    id: commands\n    attributes:\n      label: Commands\n      description: Please provide the commands to run from the root of this repository to reproduce the issue.\n      placeholder: |\n        cd ./proto\n        buf lint\n      render: shell\n    validations:\n      required: true\n  - type: textarea\n    id: actual-output\n    attributes:\n      label: Output\n      description: What is the output of running these commands?\n      placeholder: |\n        foo/bar/v1/bar.proto:37:29:Field name \"CreateTime\" should be lower_snake_case, such as \"create_time\".\n      render: shell\n    validations:\n      required: true\n  - type: textarea\n    id: expected-output\n    attributes:\n      label: Expected Output\n      description: What did you expect instead?\n      placeholder: I expected no lint failures.\n    validations:\n      required: true\n  - type: textarea\n    id: other\n    attributes:\n      label: Anything else?\n      description: Is there any other context you'd like us to have?\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/2-feature-request.yml",
    "content": "name: Feature Request\ndescription: Let us know about a feature you'd like us to add.\nlabels: Feature\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for your suggestions on how to improve Buf, we really appreciate it!\n  - type: textarea\n    id: feature\n    attributes:\n      label: Feature\n      description: Tell us what you'd like to see!\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/3-other.yml",
    "content": "name: Other\ndescription: Anything else.\nbody:\n  - type: markdown\n    attributes:\n      value: |\n        Thanks for getting in touch, we really appreciate it! If your issue isn't a bug or feature request, we'd highly recommend to talk to us on the [Buf Slack](https://buf.build/links/slack). If you think the issue is more appropriate for a GitHub issue, please file it below!\n\n        If this is a question about some behavior you are witnessing, we will need a minimal reproducible example. We get lots of support requests, so please help us help you. We find that the easiest way to do this is by linking to a GitHub repository with the setup of the example, as well as a set of commands for us to run on this GitHub repository to reproduce the issue. You can use an existing GitHub repository, or a temporary GitHub repository you create.\n\n        **If this is a question about some behavior you are witnessing, and you do not provide a minimal reproducible example in a GitHub repository, we will likely close your issue until a reproducible example is provided. We apologize, but we have to be efficient with our support requests, and we appreciate your help.**\n\n        [This article](https://stackoverflow.com/help/minimal-reproducible-example) on minimal reproducible examples may be of use!\n  - type: input\n    id: github-repository\n    attributes:\n      label: GitHub repository with your minimal reproducible example (do not leave this field blank or fill out this field with \"github.com/bufbuild/buf\" or we will automatically close your issue, see the instructions above!)\n      description: If this is a question about some behavior you are witnessing, provide us with a link to the GitHub repository that contains the setup needed to reproduce the issue. This is a repository you create, and is required for us to investigate your issue.\n      placeholder: https://github.com/you/temp-repo-with-repro\n  - type: textarea\n    id: feature\n    attributes:\n      label: What's up?\n      description: Tell us what's on your mind!\n    validations:\n      required: true\n"
  },
  {
    "path": ".github/dependabot.yml",
    "content": "version: 2\nupdates:\n  - package-ecosystem: \"docker\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n  - package-ecosystem: \"github-actions\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n  - package-ecosystem: \"gomod\"\n    directory: \"/\"\n    schedule:\n      interval: \"weekly\"\n    ignore:\n      # We manually update this from main and lock the commit in make/buf/all.mk\n      - dependency-name: \"github.com/bufbuild/protocompile\"\n      # This needs to be locked to the same version we generate with, which is\n      # controlled via dep_protoc_gen_connect_go.mk\n      - dependency-name: \"github.com/bufbuild/connect-go\"\n      # This needs to be locked to the same version we generate with, which is\n      # controlled via make/go/dep_protoc_gen_go.mk\n      - dependency-name: \"google.golang.org/protobuf\"\n"
  },
  {
    "path": ".github/workflows/add-to-project.yaml",
    "content": "name: Add issues and PRs to project\n\non:\n  issues:\n    types:\n      - opened\n      - reopened\n      - transferred\n  pull_request_target:\n    types:\n      - opened\n      - reopened\n  issue_comment:\n    types:\n      - created\n\njobs:\n  call-workflow-add-to-project:\n    name: Call workflow to add issue to project\n    uses: bufbuild/base-workflows/.github/workflows/add-to-project.yaml@main\n    secrets: inherit\n"
  },
  {
    "path": ".github/workflows/back-to-development.yaml",
    "content": "name: Go back to Development\non:\n  workflow_dispatch:\n  release:\n    types: [published]\nenv:\n  APP_ID: 251311\njobs:\n  post-release:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Get GitHub app token\n        uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0\n        id: app_token\n        with:\n          app-id: ${{ env.APP_ID }}\n          private-key: ${{ secrets.TOKEN_EXCHANGE_GH_APP_PRIVATE_KEY }}\n      - name: Checkout repository code\n        uses: actions/checkout@v6\n        with:\n          token: ${{ steps.app_token.outputs.token }}\n      - name: Set up Git name and email\n        run: |\n          git config user.name \"${{ github.actor }}\"\n          git config user.email \"${{ github.actor }}@users.noreply.github.com\"\n      - name: Create PR back to development\n        run: bash ./make/buf/scripts/gobacktodevelopment.bash\n        env:\n          GH_TOKEN: ${{ steps.app_token.outputs.token }}\n          WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_NOTIFICATION_WEBHOOK }}\n"
  },
  {
    "path": ".github/workflows/buf-binary-size.yaml",
    "content": "name: binary-size\non:\n  push:\n    branches:\n      - main\n    tags: [\"v*\"]\n  pull_request:\n# Prevent writing to the repository using the CI token.\n# Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions\npermissions: read-all\nenv:\n  MAKEFLAGS: \"-j 2\"\njobs:\n  buf-binary-size:\n    runs-on: ubuntu-latest\n    steps:\n      - name: checkout\n        uses: actions/checkout@v6\n      - name: setup-go\n        uses: actions/setup-go@v6\n        with:\n          go-version: \"1.26.x\"\n          check-latest: true\n      - name: cache\n        uses: actions/cache@v5\n        with:\n          path: |\n            ~/.cache/buf/${{ runner.os }}/x86_64/bin\n            ~/.cache/buf/${{ runner.os }}/x86_64/go/pkg/mod\n            ~/.cache/buf/${{ runner.os }}/x86_64/gocache\n            ~/.cache/buf/${{ runner.os }}/x86_64/include\n            ~/.cache/buf/${{ runner.os }}/x86_64/versions\n          key: ${{ runner.os }}-buf-${{ hashFiles('**/go.sum', 'make/**') }}\n          restore-keys: |\n            ${{ runner.os }}-buf-\n      - name: make-bufbinarysize\n        run: make bufbinarysize\n"
  },
  {
    "path": ".github/workflows/buf-ci.yaml",
    "content": "name: Buf CI\non:\n  push:\n  pull_request:\n    types: [opened, synchronize, reopened, labeled, unlabeled]\n  delete:\npermissions:\n  contents: read\n  pull-requests: write\njobs:\n  buf:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v6\n      - uses: bufbuild/buf-action@v1\n        with:\n          token: ${{ secrets.BUF_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/build-and-draft-release.yaml",
    "content": "name: Build and Draft Release\non:\n  pull_request:\n    types: [closed]\n  workflow_dispatch:\n    inputs:\n      version:\n        type: string\n        description: The released version without 'v'. For example, 1.0.0.\nenv:\n  APP_ID: 251311\njobs:\n  draft_release:\n    runs-on: ubuntu-latest\n    if: ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release')) }}\n    steps:\n      - name: Set VERSION variable\n        # The head ref looks like release/v1.0.0, and we need to trim the string up to the `/v`.\n        run: |\n          VERSION=\"${{ github.event.inputs.version || github.head_ref}}\"\n          echo \"VERSION=${VERSION##*/v}\" >> $GITHUB_ENV\n      - name: Get GitHub app token\n        uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0\n        id: app_token\n        with:\n          app-id: ${{ env.APP_ID }}\n          private-key: ${{ secrets.TOKEN_EXCHANGE_GH_APP_PRIVATE_KEY }}\n      - name: Checkout repository code\n        uses: actions/checkout@v6\n        with:\n          token: ${{ steps.app_token.outputs.token }}\n      - name: Set up Go\n        uses: actions/setup-go@v6\n        with:\n          go-version: \"1.26.x\"\n          check-latest: true\n      - name: Set up Git name and email\n        run: |\n          git config user.name \"${{ github.actor }}\"\n          git config user.email \"${{ github.actor }}@users.noreply.github.com\"\n      - name: Build assets and draft release\n        run: bash ./make/buf/scripts/draftrelease.bash\n        env:\n          GH_TOKEN: ${{ steps.app_token.outputs.token }}\n          WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_NOTIFICATION_WEBHOOK }}\n          RELEASE_MINISIGN_PRIVATE_KEY: ${{secrets.RELEASE_MINISIGN_PRIVATE_KEY}}\n          RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD: ${{secrets.RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}}\n      - name: Unset keys\n        if: ${{ always() }}\n        run: |\n          unset RELEASE_MINISIGN_PRIVATE_KEY\n          unset RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD\n"
  },
  {
    "path": ".github/workflows/ci.yaml",
    "content": "name: ci\non:\n  push:\n    branches:\n      - main\n    tags: [\"v*\"]\n  pull_request:\n# Prevent writing to the repository using the CI token.\n# Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions\npermissions: read-all\nenv:\n  MAKEFLAGS: \"-j 2\"\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n      - name: checkout\n        uses: actions/checkout@v6\n      - name: setup-go\n        uses: actions/setup-go@v6\n        with:\n          go-version: \"1.26.x\"\n          check-latest: true\n      - name: cache\n        uses: actions/cache@v5\n        with:\n          path: |\n            ~/.cache/buf/${{ runner.os }}/x86_64/bin\n            ~/.cache/buf/${{ runner.os }}/x86_64/go/pkg/mod\n            ~/.cache/buf/${{ runner.os }}/x86_64/gocache\n            ~/.cache/buf/${{ runner.os }}/x86_64/include\n            ~/.cache/buf/${{ runner.os }}/x86_64/versions\n          key: ${{ runner.os }}-buf-lint-${{ hashFiles('**/go.sum', 'make/**') }}\n          restore-keys: |\n            ${{ runner.os }}-buf-lint-\n      - name: golangci-lint-cache\n        uses: actions/cache@v5\n        with:\n          path: ~/.cache/golangci-lint\n          # https://github.com/golangci/golangci-lint-action#caching-internals includes an interval number in the cache\n          # key, however we update our go modules at least once weekly so we shouldn't need that.\n          key: ${{ runner.os }}-buf-golangci-lint-${{ hashFiles('**/go.sum') }}\n          restore-keys: |\n            ${{ runner.os }}-buf-golangci-lint-\n      - name: make-lint\n        run: make lint\n        env:\n          BUF_BREAKING_AGAINST_INPUT: \"https://github.com/bufbuild/buf.git#branch=main\"\n          BUF_INPUT_HTTPS_USERNAME: ${{ github.actor }}\n          BUF_INPUT_HTTPS_PASSWORD: ${{ github.token }}\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - name: checkout\n        uses: actions/checkout@v6\n      - name: setup-go\n        uses: actions/setup-go@v6\n        with:\n          go-version: \"1.26.x\"\n          check-latest: true\n      - name: cache\n        uses: actions/cache@v5\n        with:\n          path: |\n            ~/.cache/buf/${{ runner.os }}/x86_64/bin\n            ~/.cache/buf/${{ runner.os }}/x86_64/go/pkg/mod\n            ~/.cache/buf/${{ runner.os }}/x86_64/gocache\n            ~/.cache/buf/${{ runner.os }}/x86_64/include\n            ~/.cache/buf/${{ runner.os }}/x86_64/versions\n          key: ${{ runner.os }}-buf-test-${{ hashFiles('**/go.sum', 'make/**') }}\n          restore-keys: |\n            ${{ runner.os }}-buf-test-\n      - name: make-test\n        run: make test\n  docker:\n    runs-on: ubuntu-latest\n    needs:\n      - lint\n      - test\n    # This job only runs when\n    # 1. The previous lint and test jobs have completed successfully\n    # 2. The repository is not a fork, i.e. it will only run on the official bufbuild/buf\n    # 3. The workflow run is trigged by main branch OR a tag with v prefix\n    # See https://github.com/bufbuild/buf/pull/289/files#r596207623 for the discussion\n    if: ${{ github.repository == 'bufbuild/buf' && (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/v')) }}\n    steps:\n      # qemu is used when executing things like `apk` in the final build\n      # stage which must execute on the target platform. We currently do\n      # not have any CGO and care should be taken in the Dockerfile to ensure\n      # that go cross compilation happens on the build platform.\n      - name: setup-qemu\n        uses: docker/setup-qemu-action@v4\n        id: qemu\n        with:\n          # alpine image doesn't support linux/riscv64\n          platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x\n      - name: setup-docker-buildx\n        uses: docker/setup-buildx-action@v4\n      - name: login-docker\n        uses: docker/login-action@v4\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n      - name: docker-meta\n        id: meta\n        uses: docker/metadata-action@v6\n        with:\n          images: |\n            bufbuild/buf\n          tags: |\n            type=edge,branch=main\n            type=semver,pattern={{version}}\n            type=semver,pattern={{major}}.{{minor}}\n            type=semver,pattern={{major}}\n          flavor: |\n            latest=auto\n      - name: docker-build-push\n        uses: docker/build-push-action@v7\n        with:\n          file: Dockerfile.buf\n          platforms: ${{ steps.qemu.outputs.platforms }}\n          push: true\n          tags: ${{ steps.meta.outputs.tags }}\n          labels: ${{ steps.meta.outputs.labels }}\n"
  },
  {
    "path": ".github/workflows/codeql.yaml",
    "content": "# Broadly based on example Github action from\n# https://github.com/github/codeql-action#usage\nname: codeql\n# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions\n# https://github.com/github/codeql-action/issues/572\npermissions:\n  actions: read\n  contents: read\n  pull-requests: read\n  security-events: write\non:\n  push:\n    branches:\n      - main\njobs:\n  codeql:\n    runs-on: ubuntu-latest\n    steps:\n      - name: checkout\n        uses: actions/checkout@v6\n      - name: setup-go\n        uses: actions/setup-go@v6\n        with:\n          go-version: \"1.26.x\"\n          check-latest: true\n      - name: initialize\n        uses: github/codeql-action/init@v4\n        with:\n          # Limit analysis to Go for now.\n          # Available languages: https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#changing-the-languages-that-are-analyzed\n          languages: go\n      - name: autobuild\n        uses: github/codeql-action/autobuild@v4\n      - name: analyze\n        uses: github/codeql-action/analyze@v4\n"
  },
  {
    "path": ".github/workflows/create-release-pr.yaml",
    "content": "name: Create Release PR\non:\n  workflow_dispatch:\n    inputs:\n      version:\n        type: string\n        description: The released version without 'v'. For example, 1.0.0.\nenv:\n  APP_ID: 251311\njobs:\n  prepare:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Get GitHub app token\n        uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0\n        id: app_token\n        with:\n          app-id: ${{ env.APP_ID }}\n          private-key: ${{ secrets.TOKEN_EXCHANGE_GH_APP_PRIVATE_KEY }}\n      - name: Checkout repository code\n        uses: actions/checkout@v6\n        with:\n          token: ${{ steps.app_token.outputs.token }}\n      - name: Set up Git name and email\n        run: |\n          git config user.name \"${{ github.actor }}\"\n          git config user.email \"${{ github.actor }}@users.noreply.github.com\"\n      - name: Create release PR\n        run: bash ./make/buf/scripts/createreleasepr.bash\n        env:\n          GH_TOKEN: ${{ steps.app_token.outputs.token }}\n          VERSION: ${{ github.event.inputs.version }}\n          WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_NOTIFICATION_WEBHOOK }}\n"
  },
  {
    "path": ".github/workflows/docker-publish.yaml",
    "content": "# This job will build and push the Docker image to Docker Hub.\nname: docker-publish\non:\n  workflow_dispatch:\n    inputs:\n      version:\n        type: string\n        required: true\n        description: The release version (e.g., X.Y.Z), without the v.\n      latest:\n        type: boolean\n        description: Tag with latest\n        default: false\n      publish:\n        type: boolean\n        description: Publish the image to Docker Hub\n        default: false\npermissions: read-all\njobs:\n  docker:\n    runs-on: ubuntu-latest\n    if: github.repository == 'bufbuild/buf'\n    steps:\n      - name: Validate SemVer\n        run: |\n          VERSION=${{ github.event.inputs.version }}\n          SEMVER_REGEX='^[0-9]*\\.[0-9]*\\.[0-9]*$'\n          if [[ ! $VERSION =~ $SEMVER_REGEX ]]; then\n            echo \"Error: '$VERSION' is not a valid SemVer version\"\n            exit 1\n          else\n            echo \"Version '$VERSION' is a valid SemVer version\"\n          fi\n      - name: checkout\n        id: checkout\n        uses: actions/checkout@v6\n        with:\n          ref: refs/tags/v${{ github.event.inputs.version }}\n      - name: setup-qemu\n        uses: docker/setup-qemu-action@v4\n        id: qemu\n        with:\n          platforms: linux/386,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6,linux/ppc64le,linux/s390x\n      - name: setup-docker-buildx\n        uses: docker/setup-buildx-action@v4\n      - name: login-docker\n        uses: docker/login-action@v4\n        with:\n          username: ${{ secrets.DOCKER_USERNAME }}\n          password: ${{ secrets.DOCKER_TOKEN }}\n      - name: docker-meta\n        id: meta\n        uses: docker/metadata-action@v6\n        with:\n          images: |\n            bufbuild/buf\n          tags: |\n            type=raw,value=latest,enable=${{ github.event.inputs.latest }}\n            type=semver,pattern={{major}},value=v${{ github.event.inputs.version }}\n            type=semver,pattern={{major}}.{{minor}},value=v${{ github.event.inputs.version }}\n            type=semver,pattern={{major}}.{{minor}}.{{patch}},value=v${{ github.event.inputs.version }}\n            type=semver,pattern={{version}},value=v${{ github.event.inputs.version }}\n          labels: |\n            org.opencontainers.image.revision=${{ steps.checkout.outputs.commit }}\n            org.opencontainers.image.version=${{ github.event.inputs.version }}\n          flavor: |\n            latest=false\n      - name: docker-build\n        uses: docker/build-push-action@v7\n        with:\n          context: . # This uses the checkout context\n          file: Dockerfile.buf\n          load: true\n          push: false\n          tags: ${{ steps.meta.outputs.tags }}\n          labels: ${{ steps.meta.outputs.labels }}\n      - name: docker-test\n        run: |\n          OUTPUT=$(docker run --rm bufbuild/buf:${{ github.event.inputs.version }} --version)\n          if [ \"$OUTPUT\" == \"${{ github.event.inputs.version }}\" ]; then\n            echo \"Version matches\"\n          else\n            echo \"Version does not match: expected ${{ github.event.inputs.version }}, got $OUTPUT\"\n            exit 1\n          fi\n      - name: docker-build-publish\n        uses: docker/build-push-action@v7\n        if: ${{ github.event.inputs.publish == 'true' }}\n        with:\n          context: . # This uses the checkout context\n          file: Dockerfile.buf\n          platforms: ${{ steps.qemu.outputs.platforms }}\n          push: ${{ github.event.inputs.publish == 'true' }}\n          tags: ${{ steps.meta.outputs.tags }}\n          labels: ${{ steps.meta.outputs.labels }}\n"
  },
  {
    "path": ".github/workflows/emergency-review-bypass.yaml",
    "content": "name: Bypass review in case of emergency\non:\n  pull_request:\n    types:\n      - labeled\npermissions:\n  pull-requests: write\njobs:\n  approve:\n    if: github.event.label.name == 'Emergency Bypass Review'\n    uses: bufbuild/base-workflows/.github/workflows/emergency-review-bypass.yaml@main\n    secrets: inherit\n"
  },
  {
    "path": ".github/workflows/make-upgrade.yaml",
    "content": "name: Make upgrade\non:\n  schedule:\n    # Run every Monday at 10am UTC\n    - cron: \"0 10 * * 1\"\nenv:\n  APP_ID: 251311\njobs:\n  prepare:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Get GitHub app token\n        uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0\n        id: app_token\n        with:\n          app-id: ${{ env.APP_ID }}\n          private-key: ${{ secrets.TOKEN_EXCHANGE_GH_APP_PRIVATE_KEY }}\n      - name: Checkout repository code\n        uses: actions/checkout@v6\n        with:\n          token: ${{ steps.app_token.outputs.token }}\n      - name: setup-go\n        uses: actions/setup-go@v6\n        with:\n          go-version: \"1.26.x\"\n          check-latest: true\n          cache: false\n      - name: Set up Git name and email\n        run: |\n          git config user.name 'github-actions[bot]'\n          git config user.email 'github-actions[bot]@users.noreply.github.com'\n      - name: make-githubactionupgrade\n        run: make githubactionupgrade\n        env:\n          GH_TOKEN: ${{ steps.app_token.outputs.token }}\n"
  },
  {
    "path": ".github/workflows/notify-approval-bypass.yaml",
    "content": "name: PR Approval Bypass Notifier\non:\n  pull_request:\n    types:\n      - closed\n    branches:\n      - main\npermissions:\n  pull-requests: read\njobs:\n  approval:\n    uses: bufbuild/base-workflows/.github/workflows/notify-approval-bypass.yaml@main\n    secrets: inherit\n"
  },
  {
    "path": ".github/workflows/pr-title.yaml",
    "content": "name: Lint PR Title\n# Prevent writing to the repository using the CI token.\n# Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions\npermissions:\n  pull-requests: read\non:\n  pull_request:\n    # By default, a workflow only runs when a pull_request's activity type is opened,\n    # synchronize, or reopened. We explicity override here so that PR titles are\n    # re-linted when the PR text content is edited.\n    types:\n      - opened\n      - edited\n      - reopened\n      - synchronize\njobs:\n  lint:\n    uses: bufbuild/base-workflows/.github/workflows/pr-title.yaml@main\n"
  },
  {
    "path": ".github/workflows/previous.yaml",
    "content": "name: previous\non:\n  push:\n    branches:\n      - main\n    tags: [\"v*\"]\n  pull_request:\n# Prevent writing to the repository using the CI token.\n# Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions\npermissions: read-all\nenv:\n  MAKEFLAGS: \"-j 2\"\njobs:\n  test-previous:\n    strategy:\n      matrix:\n        go-version: [\"1.25.x\"]\n    runs-on: ubuntu-latest\n    steps:\n      - name: checkout\n        uses: actions/checkout@v6\n      - name: setup-go\n        uses: actions/setup-go@v6\n        with:\n          go-version: ${{ matrix.go-version }}\n          check-latest: true\n      - name: cache\n        uses: actions/cache@v5\n        with:\n          path: |\n            ~/.cache/buf/${{ runner.os }}/x86_64/bin\n            ~/.cache/buf/${{ runner.os }}/x86_64/go/pkg/mod\n            ~/.cache/buf/${{ runner.os }}/x86_64/gocache\n            ~/.cache/buf/${{ runner.os }}/x86_64/include\n            ~/.cache/buf/${{ runner.os }}/x86_64/versions\n          key: ${{ runner.os }}-${{ matrix.go-version }}-buf-${{ hashFiles('**/go.sum', 'make/**') }}\n          restore-keys: |\n            ${{ runner.os }}-${{ matrix.go-version }}-buf-\n      - name: make-test\n        run: make test\n"
  },
  {
    "path": ".github/workflows/verify-changelog.yaml",
    "content": "name: Verify Changelog\non:\n  pull_request:\n    types:\n      - opened\n  push:\n    branches:\n      - \"release/**\"\n      - \"next/**\"\njobs:\n  verify:\n    runs-on: ubuntu-latest\n    if: ${{ github.event_name == 'push' || startsWith(github.head_ref, 'release/') || startsWith(github.head_ref, 'next/')}}\n    steps:\n      - name: Checkout repository code\n        uses: actions/checkout@v6\n        with:\n          token: ${{ secrets.GITHUB_TOKEN }}\n          fetch-depth: 0\n      - name: Check changelog is modified\n        run: bash ./make/buf/scripts/verifychangelog.bash\n"
  },
  {
    "path": ".github/workflows/windows.yaml",
    "content": "name: windows\non:\n  push:\n    branches:\n      - main\n    tags: [\"v*\"]\n  pull_request:\n# Prevent writing to the repository using the CI token.\n# Ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions\npermissions: read-all\njobs:\n  test:\n    env:\n      DOWNLOAD_CACHE: 'd:\\downloadcache'\n      # Improve performance by using D: drive.\n      # C: seems to be really slow, especially for cache restores.\n      GOPATH: 'd:\\go\\path'\n      GOCACHE: 'd:\\go\\cache'\n      GOMODCACHE: 'd:\\go\\modcache'\n    runs-on: windows-latest\n    steps:\n      - name: support-longpaths\n        run: git config --system core.longpaths true\n      - name: checkout\n        uses: actions/checkout@v6\n      - name: setup-go\n        uses: actions/setup-go@v6\n        with:\n          go-version: \"1.26.x\"\n          check-latest: true\n          cache: true\n      - name: windows-cache\n        uses: actions/cache@v5\n        with:\n          path: |\n            ${{ env.DOWNLOAD_CACHE }}\n          key: ${{ runner.os }}-buf-windows-${{ hashFiles('windows/**') }}\n          restore-keys: |\n            ${{ runner.os }}-buf-windows-\n      - name: test\n        shell: bash\n        run: ./etc/windows/test.bash\n"
  },
  {
    "path": ".gitignore",
    "content": "# Autogenerated by makego. DO NOT EDIT.\n/.build/\n/.claude/settings.local.json\n/.ctrlp\n/.env/\n/.idea/\n/.tmp/\n/.vscode/\n/cmd/buf/buf\n/cmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver/protoc-gen-insertion-point-receiver\n/cmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/protoc-gen-insertion-point-writer\n/cmd/buf/internal/command/alpha/protoc/test.txt\n/cmd/buf/internal/command/generate/internal/protoc-gen-top-level-type-names-yaml/protoc-gen-top-level-type-names-yaml\n/cmd/buf/testdata/imports/cache/v3/modulelocks/\n/cmd/buf/testdata/imports/corrupted_cache_dep/v3/modulelocks/\n/cmd/buf/testdata/imports/corrupted_cache_file/v3/modulelocks/\n/cmd/protoc-gen-buf-breaking/protoc-gen-buf-breaking\n/cmd/protoc-gen-buf-lint/protoc-gen-buf-lint\n/private/buf/buftesting/cache/\n/private/buf/bufwkt/cmd/wkt-go-data/wkt-go-data\n/private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category/buf-plugin-duplicate-category\n/private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule/buf-plugin-duplicate-rule\n/private/bufpkg/bufcheck/internal/cmd/buf-plugin-panic/buf-plugin-panic\n/private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/buf-plugin-protovalidate-ext\n/private/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext/buf-plugin-rpc-ext\n/private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix/buf-plugin-suffix\n/private/bufpkg/bufmodule/bufmoduleapi/cmd/buf-legacyfederation-go-data/buf-legacyfederation-go-data\n/private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-digest/buf-digest\n/private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-new-commit-id/buf-new-commit-id\n/private/bufpkg/buftesting/cache/\n/private/pkg/bandeps/cmd/bandeps/bandeps\n/private/pkg/git/cmd/git-ls-files-unstaged/git-ls-files-unstaged\n/private/pkg/licenseheader/cmd/license-header/license-header\n/private/pkg/storage/cmd/ddiff/ddiff\n/private/pkg/storage/cmd/storage-go-data/storage-go-data\n/private/pkg/storage/storageos/tmp/\n"
  },
  {
    "path": ".godoclint.yaml",
    "content": "# Configuration file version.\nversion: \"1.0\"\n\n# List of regexp patterns matching files the linter should include. When\n# omitted/null, the linter includes all Go files. If assigned then only the\n# files that their relative path (with respect to the config file path) matches\n# any of the patterns will be processed.\n#\n# Note: The patterns must assume a Unix-like path (i.e., separated with forward\n# slashes, `/`), even on Windows. This is to ensure a consistent behavior across\n# different platforms.\n#\n# Example:\n#   include:\n#     - ^pkg/\n#     - _foo.go$\ninclude: null\n\n# List of regexp patterns matching files the linter should skip. When\n# omitted/null, the linter excludes no Go files. If assigned then only the\n# files that their relative path (with respect to the config file path) does not\n# match any of the patterns will be processed.\n#\n# Note: The patterns must assume a Unix-like path (i.e., separated with forward\n# slashes, `/`), even on Windows. This is to ensure a consistent behavior across\n# different platforms.\n#\n# Example:\n#   exclude:\n#     - ^internal/\n#     - _autogenerated.go$\nexclude:\n  - ^private/gen\n\n# Default set of rules to enable. Possible values are:\n# - `basic`: enables basic rules which are: `pkg-doc`, `single-pkg-doc`, `start-with-name` and `deprecated`.\n# - `all`:   all rules are enabled by default; the `disable` key can be used to disable specific rules.\n# - `none`:  no rule is enabled by default; the `enable` key can be used to enable specific rules.\ndefault: none\n\n# List of rules to enable *in addition to* the default set.\n#\n# See the linter docs for more on supported rules.\n#\n# Example:\n#   - pkg-doc\n#   - single-pkg-doc\n#   - require-pkg-doc\n#   - specific-file-pkg-doc\n#   - start-with-name\n#   - require-doc\n#   - deprecated\n#   - max-len\n#   - no-unused-link\nenable:\n  - pkg-doc\n  - single-pkg-doc\n  #- require-pkg-doc\n  - specific-file-pkg-doc\n  - start-with-name\n  - require-doc\n  - deprecated\n  #- max-len\n  - no-unused-link\n\n# List of rules to disable.\n#\n# Example:\n#   disable:\n#     - pkg-doc\n#     - single-pkg-doc\ndisable: null\n\n# A map for setting individual rule options.\n#\n# All sub-keys are optional.\noptions:\n  # Maximum line length for godocs, not including the `// `, or `/*` or `*/`\n  # tokens.\n  max-len/length: 120\n\n  # Include test files when applying the `max-len` rule.\n  max-len/include-tests: false\n\n  # Include test files when applying the `pkg-doc` rule.\n  pkg-doc/include-tests: false\n\n  # Include test files when applying the `single-pkg-doc` rule.\n  single-pkg-doc/include-tests: false\n\n  # Include test files when applying the `require-pkg-doc` rule.\n  require-pkg-doc/include-tests: false\n\n  # Include test files when applying the `specific-file-pkg-doc` rule.\n  specific-file-pkg-doc/include-tests: false\n\n  # The file pattern to indicate which file should contain the package-level godoc when\n  # applying the `specific-file-pkg-doc` rule.\n  #\n  # Valid values are:\n  #\n  #   - \"doc\": The godoc should be in a file named doc.go\n  #   - \"package-name\": The godoc should be in a file named after the package. For example, if a package\n  #     is named \"foobar\", the godoc should be in a file named \"foobar.go\".\n  specific-file-pkg-doc/file-pattern: \"package-name\"\n\n  # Include test files when applying the `require-doc` rule.\n  require-doc/include-tests: false\n\n  # Ignore exported (public) symbols when applying the `require-doc` rule.\n  require-doc/ignore-exported: false\n\n  # Ignore unexported (private) symbols when applying the `require-doc` rule.\n  require-doc/ignore-unexported: true\n\n  # Include test files when applying the `start-with-name` rule.\n  start-with-name/include-tests: false\n\n  # Include unexported (private) symbols when applying the `start-with-name` rule.\n  start-with-name/include-unexported: false\n\n  # Include test files when applying the `no-unused-link` rule.\n  no-unused-link/include-tests: false\n"
  },
  {
    "path": ".golangci.yml",
    "content": "version: \"2\"\nlinters:\n  default: none\n  enable:\n    - asciicheck\n    - bidichk\n    - bodyclose\n    - containedctx\n    - copyloopvar\n    # - contextcheck\n    - decorder\n    # - depguard\n    - dogsled\n    - errcheck\n    - exhaustruct\n    - forbidigo\n    - forcetypeassert\n    - gochecknoinits\n    - goheader\n    - gomodguard\n    - goprintffuncname\n    - gosec\n    - govet\n    - grouper\n    - importas\n    - ineffassign\n    - loggercheck\n    - makezero\n    - mirror\n    - misspell\n    - modernize\n    - nakedret\n    - nilerr\n    - nolintlint\n    - nosprintfhostport\n    - paralleltest\n    - predeclared\n    - promlinter\n    - reassign\n    - rowserrcheck\n    - staticcheck\n    - unconvert\n    - unused\n    - usetesting\n    - wastedassign\n    - whitespace\n  settings:\n    errcheck:\n      check-type-assertions: true\n    forbidigo:\n      forbid:\n        # Use private/pkg/thread.Parallelize\n        - pattern: ^errgroup\\.\n        # Use private/pkg/standard/xos/xexec\n        - pattern: ^exec\\.Cmd$\n        - pattern: ^exec\\.Command$\n        - pattern: ^exec\\.CommandContext$\n        # os.Rename does not work across filesystem boundaries\n        # See https://github.com/bufbuild/buf/issues/639\n        - pattern: ^os\\.Rename$\n        # Use private/pkg/osext.Getwd\n        - pattern: ^os\\.Getwd$\n        # Use private/pkg/osext.Chdir\n        - pattern: ^os\\.Chdir$\n        # Ban debug statements\n        - pattern: ^fmt\\.Print\n        - pattern: ^log\\.\n        - pattern: ^print$\n        - pattern: ^println$\n        # Use private/pkg/protoencoding Marshalers and Unmarshalers\n        - pattern: ^(proto|prototext|protojson|protoyaml).Marshal$\n        - pattern: ^(proto|prototext|protojson|protoyaml).Unmarshal$\n        - pattern: ^(proto|prototext|protojson|protoyaml).MarshalOptions$\n        - pattern: ^(proto|prototext|protojson|protoyaml).UnmarshalOptions$\n        - pattern: ^proto\\.Clone$\n          msg: please use proto.CloneOf\n    govet:\n      enable:\n        - nilness\n    importas:\n      alias:\n        - pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\n          alias: imagev1\n        - pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1\n          alias: modulev1\n        - pkg: github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\n          alias: registryv1alpha1\n    nolintlint:\n      require-explanation: true\n      require-specific: true\n      allow-unused: false\n    usetesting:\n      context-background: true\n      context-todo: true\n  exclusions:\n    generated: lax\n    presets:\n      - comments\n      - common-false-positives\n      - legacy\n      - std-error-handling\n    rules:\n      - linters:\n          - staticcheck\n        # No need to require embedded fields from selector expression, they could help with\n        # more expressive code.\n        text: \"QF1008\"\n      - linters:\n          - staticcheck\n        # Whether or not to apply De Morgan's law is contextual and should be handled during\n        # code review.\n        text: \"QF1001\"\n      - linters:\n          - paralleltest\n        # We use chdir in these tests.\n        path: cmd/buf/workspace_subdir_test.go\n        text: missing the call to method parallel\n      - linters:\n          - paralleltest\n        # TestWorkspaceArchiveDir, TestWorkspaceWithInvalidArchivePathFail\n        # and TestWorkspaceWithInvalidArchiveAbsolutePathFail cannot run in parallel\n        # because they all call createZipFromDir on the same path, writing to the same file.\n        path: cmd/buf/workspace_test.go\n        text: missing the call to method parallel\n      - linters:\n          - paralleltest\n        # This test shouldn't run in parallel as it needs osext.Getwd.\n        path: cmd/buf/internal/command/config/configmigrate/configmigrate_test.go\n        text: missing the call to method parallel\n      - linters:\n          - forbidigo\n        # This is a legacy usage of os.Getwd we're not bothering to port yet.\n        path: cmd/buf/internal/command/alpha/protoc/protoc_test.go\n        text: os.Getwd\n      - linters:\n          - dogsled\n        # One function call doesn't care about most of the returned destructured values. The\n        # dogsled linter complains about it. (Value of this linter is unclear...)\n        path: cmd/buf/internal/command/curl/curl.go\n      - linters:\n          - forbidigo\n        # This is a legacy usage of os.Getwd we're not bothering to port yet.\n        path: cmd/buf/internal/command/generate/generate_test.go\n        text: os.Getwd\n      - linters:\n          - exhaustruct\n        # We didn't turn on exhaustruct historically, but we really want to make sure it is turned on\n        # for this file, as we do conversion between v1beta1 and v1 registry-proto types.\n        path-except: private/bufpkg/bufmodule/bufmoduleapi/convert.go\n      - linters:\n          - gosec\n        # G101 checks for hardcoded credentials, and the variables named \"*Password*\n        # trip this off.\n        path: private/buf/bufcli/env.go\n        text: \"G101:\"\n      - linters:\n          - gosec\n        # G404 checks for use of the ordinary non-CPRNG.\n        path: private/buf/buflsp/progress.go\n        text: \"G404:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/file.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/diagnostic.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/image.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/report.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/server.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/symbol.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/semantic_tokens.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/cel.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/folding_range.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/completion.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # G115 checks for use of truncating conversions.\n        path: private/buf/buflsp/organize_imports.go\n        text: \"G115:\"\n      - linters:\n          - containedctx\n        # Type must implement an interface whose methods do not accept context. But this\n        # implementation makes RPC calls, which need a context. So we allow creator of the\n        # type to provide a context at value creation (instead of using context.Background()).\n        path: private/buf/bufcurl/reflection_resolver.go\n      - linters:\n          - gosec\n        # We verify manually so that we can emit verbose output while doing so.\n        path: private/buf/bufcurl/tls.go\n        text: \"G402:\"\n      - linters:\n          - paralleltest\n        # This test shouldn't run in parallel as it needs osext.Getwd.\n        path: private/buf/buffetch/internal/reader_test.go\n        text: missing the call to method parallel\n      - linters:\n          - paralleltest\n        # Parallelizing TestPlainPostHandlerTLS and TestPlainPostHandlerH2C\n        # makes this test flaky.\n        path: private/buf/bufstudioagent/bufstudioagent_test.go\n        text: missing the call to method parallel\n      - linters:\n          - gochecknoinits\n        # we actually want to use init here\n        path: private/bufpkg/bufconfig/module_config.go\n      - linters:\n          - gosec\n        # We don't need a cryptographically secure RNG for these tests, and a\n        # deterministic RNG is actually nice for test repeatability.\n        path: private/bufpkg/bufimage/bufimageutil/.*_test\\.go\n        text: \"G404:\"\n      - linters:\n          - paralleltest\n        # This test shouldn't run in parallel as it allocates a lot of memory.\n        path: private/bufpkg/bufimage/build_image_unix_test.go\n        text: missing the call to method parallel\n      - linters:\n          - containedctx\n        # we actually want to embed a context here\n        path: private/bufpkg/bufimage/parser_accessor_handler.go\n      - linters:\n          - containedctx\n        # we actually want to embed a context here\n        path: private/bufpkg/bufmodule/module.go\n      - linters:\n          - containedctx\n        # we actually want to embed a context here\n        path: private/bufpkg/bufmodule/module_set_builder.go\n      - linters:\n          - containedctx\n        # we actually want to embed a context here\n        path: private/pkg/standard/xos/xexec/process.go\n      - linters:\n          - gochecknoinits\n        # we actually want to use init here\n        path: private/bufpkg/bufmodule/paths.go\n      - linters:\n          - forbidigo\n        # we want to use errgroup here\n        path: private/bufpkg/bufremoteplugin/bufremoteplugindocker/docker.go\n        text: use of `errgroup\n      - linters:\n          - forbidigo\n        # this is one of two files we want to allow exec.Cmd functions in\n        path: private/pkg/standard/xos/xexec/xexec.go\n      - linters:\n          - forbidigo\n        # this is one of two files we want to allow exec.Cmd functions in\n        path: private/pkg/standard/xos/xexec/process.go\n      - linters:\n          - gosec\n        # G204 checks that exec.Command is not called with non-constants.\n        path: private/pkg/standard/xos/xexec/xexec.go\n        text: \"G204:\"\n      - linters:\n          - gosec\n        # We should be able to use net/http/cgi in a unit test, in addition the CVE mentions\n        # only versions of go < 1.6.3 are affected.\n        path: private/pkg/git/git_test.go\n        text: \"G504:\"\n      - linters:\n          - wastedassign\n        # netrc/internal is a library largely copied in from an external repository with attribution.\n        # We try to make minimal edits.\n        path: private/pkg/netrc/internal/internal.go\n      - linters:\n          - forbidigo\n        # We cache os.Getwd in osext, osext is the entrypoint.\n        path: private/pkg/osext/osext.go\n        text: os.Getwd\n      - linters:\n          - forbidigo\n        # We cache os.Getwd in osext, osext has a Chdir that clears the cache.\n        path: private/pkg/osext/osext.go\n        text: os.Chdir\n      - linters:\n          - forbidigo\n        # We're going to move xfilepath out.\n        path: private/pkg/standard/xpath/xfilepath/xfilepath.go\n        text: os.Getwd\n      - linters:\n          - gochecknoinits\n        # protoencoding calls detrand.Disable via go:linkname and and init function. See the comments\n        # in the file for more details.\n        path: private/pkg/protoencoding/detrand.go\n      - linters:\n          - errcheck\n        # headers.go has casts with values from contexts that should fail if there\n        # is no error, but it would be very unidiomatic to return an error from\n        # the functions that do these casts, and we completely control the\n        # context values within this file\n        path: private/pkg/rpc/headers.go\n      - linters:\n          - forbidigo\n        # we use os.Rename here to rename files in the same directory\n        # This is safe (we aren't traversing filesystem boundaries).\n        path: private/pkg/storage/storageos/bucket.go\n        text: os.Rename\n      - linters:\n          - containedctx\n        # connCtx is cancelled when the connection is done; the context lifetime is\n        # tied to the struct, not passed per-call.\n        path: private/buf/buflsp/buflsp.go\n      - linters:\n          - containedctx\n        # we actually want to embed a context here\n        path: private/pkg/transport/grpc/grpcclient/client_conn_provider.go\n      - linters:\n          - forbidigo\n        # we actually want to use errgroup when starting an HTTP server\n        path: private/pkg/transport/http/httpserver/httpserver.go\n      - linters:\n          - staticcheck\n        text: \"ST1005:\"\n      - linters:\n          - gochecknoinits\n        # we actually want to use this init\n        path: private/usage/usage.go\n      - linters:\n          - staticcheck\n        # We deprecated all the definitions in plugin.proto but we still implement them.\n        text: buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated\n      - linters:\n          - staticcheck\n        # We deprecated all the definitions in generate.proto but we still implement them.\n        text: buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated\n      - linters:\n          - staticcheck\n        # This greatly simplifies creation of descriptors, and it's safe enough since\n        # it's just test code.\n        text: GetDeprecatedLegacyJsonFieldConflicts is deprecated\n      - linters:\n          - forcetypeassert\n        path: private/bufpkg/bufimage/source_retention_options_test\\.go\n      - linters:\n          - paralleltest\n        # The LsModules tests call chdir and cannot be parallelized.\n        path: cmd/buf/buf_test.go\n        text: LsModules\n      - linters:\n          - gosec\n        # G101 checks for hardcoded credentials, and the variables named \"*Token*\n        # trip this off.\n        path: private/pkg/oauth2/device.go\n        text: \"G101:\"\n      # G115 checks for integer overflow from integer conversions. There are known false\n      # positives from the check (https://github.com/securego/gosec/issues/1212) that are\n      # actively being worked on. Each exemption below is a false positive or for a safe operation,\n      # such as parsing indices from descriptors and/or images.\n      - linters:\n          - gosec\n        # Loop index conversion to uint64.\n        path: private/buf/bufgen/features.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # Converting result from utf8.RuneCountInString to uint64.\n        path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/field.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # PluginReference revision is validated with a bounds check at construction time.\n        path: private/bufpkg/bufremoteplugin/bufremoteplugin.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # A bounds check has been added for int32 -> uint32 conversion this is being flagged\n        # as a false positive.\n        path: private/buf/bufcurl/reflection_resolver.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # bufprotosource converts indices to int32 to form the source path. Since it is parsing\n        # from the fileDescriptor set, the operation should be safe.\n        path: private/bufpkg/bufprotosource/paths.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # Bounds checks have been added with assertion statements to ensure safe int -> int32\n        # conversions, this is a false positive.\n        path: private/bufpkg/bufprotosource/option_extension_descriptor_test.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # This converts results from strconv.ParseInt with the bit size set to 32 to int32,\n        # so it should be a safe conversion, this is a false positive.\n        path: private/buf/bufprotopluginexec/version.go\n        text: \"G115:\"\n      - linters:\n          - gosec\n        # This checks the cel constraints from an Image, and converts loop indices to int32\n        # to set the source path for the location, this operation should be safe.\n        path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/cel.go\n        text: \"G115:\"\n      # No obvious deprecated replacement.\n      - linters:\n          - staticcheck\n        path: private/pkg/protoencoding/reparse_extensions_test.go\n        text: \"SA1019:\"\n      - linters:\n          - staticcheck\n        # We still need to strip the \"weak\" option from fields until it is fully deprecated\n        path: private/pkg/protoencoding/strip_legacy_options.go\n      # Allow marshal and unmarshal functions in protoencoding only\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: proto.Marshal\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: proto.Unmarshal\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: protojson.Marshal\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: protojson.Unmarshal\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: protoyaml.Marshal\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: protoyaml.Unmarshal\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: prototext.Marshal\n      - linters:\n          - forbidigo\n        path: private/pkg/protoencoding\n        text: prototext.Unmarshal\n      - linters:\n          - gosec\n        # This checks the cel constraints for predefined rules from an Image, and converts loop indices to int32\n        # to set the source path for the location, this operation should be safe.\n        path: private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/predefined_rules.go\n        text: \"G115:\"\n      - linters:\n          - govet\n        # We print command.Short to markdown, which is controlled and set by each command\n        # and should be considered safe.\n        path: private/bufpkg/bufcobra/markdown.go\n        text: \"printf: non-constant format string in call to p\"\n      - linters:\n          - gosec\n        # This converts slice indexes in a FileDescriptorProto to int32,\n        # which are not an actual risk of overflow.\n        path: private/bufpkg/bufimage/bufimageutil/image_filter.go\n        text: \"G115:\"\n\nissues:\n  max-same-issues: 0\nformatters:\n  enable:\n    - gci\n    - gofmt\n  exclusions:\n    generated: lax\n"
  },
  {
    "path": ".pre-commit-hooks.yaml",
    "content": "- id: buf-generate\n  name: buf generate\n  language: golang\n  language_version: 1.25.6\n  entry: buf generate\n  types: [proto]\n  pass_filenames: false\n- id: buf-build\n  name: buf build\n  language: golang\n  language_version: 1.25.6\n  entry: buf build\n  types: [proto]\n  pass_filenames: false\n- id: buf-breaking\n  name: buf breaking\n  language: golang\n  language_version: 1.25.6\n  entry: buf breaking\n  types: [proto]\n  pass_filenames: false\n- id: buf-lint\n  name: buf lint\n  language: golang\n  language_version: 1.25.6\n  entry: buf lint\n  types: [proto]\n  pass_filenames: false\n- id: buf-format\n  name: buf format\n  language: golang\n  language_version: 1.25.6\n  entry: buf format -w --exit-code\n  types: [proto]\n  pass_filenames: false\n- id: buf-dep-update\n  name: buf dep update\n  language: golang\n  language_version: 1.25.6\n  entry: buf dep update\n  files: '(buf\\.lock|buf\\.yaml)'\n  pass_filenames: false\n- id: buf-dep-prune\n  name: buf dep prune\n  language: golang\n  language_version: 1.25.6\n  entry: buf dep prune\n  files: '(buf\\.lock|buf\\.yaml)'\n  pass_filenames: false\n  # Deprecated: use buf-dep-update instead.\n- id: buf-mod-update\n  name: buf mod update\n  language: golang\n  language_version: 1.25.6\n  entry: buf mod update\n  files: '(buf\\.lock|buf\\.yaml)'\n  pass_filenames: false\n  # Deprecated: use buf-dep-prune instead.\n- id: buf-mod-prune\n  name: buf mod prune\n  language: golang\n  language_version: 1.25.6\n  entry: buf mod prune\n  files: '(buf\\.lock|buf\\.yaml)'\n  pass_filenames: false\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\n## [Unreleased]\n\n- Add support for `--rbs_out` as a `protoc_builtin` plugin (requires protoc v34.0+).\n- Add relevant links from CEL LSP hover documentation to either <celbyexample.com> or <protovalidate.com>\n\n## [v1.66.1] - 2026-03-09\n\n- Fix `exclude_types` in `buf generate` dropping transitive dependencies of import files retained for their extension fields.\n\n## [v1.66.0] - 2026-02-23\n\n- Add LSP comment ignore code action to add comment ignores for lint errors.\n- Fix buf breaking module comparison when adding new modules.\n- Add LSP hover support for protovalidate CEL expressions.\n- Fixed offset handling in CEL semantic tokens for non-ASCII content and proto escape sequences in multi-line string literal expressions.\n- Improve URI normalization for the LSP.\n\n## [v1.65.0] - 2026-02-03\n\n- Add `buf registry policy {commit,create,delete,info,label,settings}` commands to manage BSR policies.\n- Add LSP deprecate code action to add the deprecated option on types and symbols.\n- Fix import LSP document link to not include `import` keyword.\n- Update `PROTOVALIDATE` lint rule to support checking unenforceable `required` rules on `repeated.items`, `map.keys` and `map.values`.\n- Add `buf source edit deprecate` command to deprecate types by setting the `deprecate = true` option.\n\n## [v1.64.0] - 2026-01-19\n\n- Fix LSP completion for options.\n- Add LSP document highlighting support.\n- Add LSP completion for fully-qualified type references.\n- Improve LSP semantic tokens implementation (for syntax highlighting).\n- Add LSP organize imports code action to add missing imports, remove unused\n  imports, and sort imports alphabetically.\n- Add LSP document link support.\n- Add LSP folding range support.\n- Update `PROTOVALIDATE` lint rule to support checking `cel_expression` fields for valid CEL.\n\n## [v1.63.0] - 2026-01-06\n\n- Update `PROTOVALIDATE` lint rule to support field mask rules.\n- Add LSP completion for field numbers.\n\n## [v1.62.1] - 2025-12-29\n\n- Fix default behavior for `swift_prefix` to remain unset when no override is provided in\n  managed mode.\n\n## [v1.62.0] - 2025-12-29\n\n- Add `swift_prefix` to managed mode.\n- Add `textDocument/rename` and `textDocument/prepareRename` support for `buf lsp serve`.\n- Fix panic in LSP for empty option paths.\n- Fix support for multi-arch image manifests for `buf beta registry plugin push`.\n\n## [v1.61.0] - 2025-11-25\n\n- Disable format on unknown or invalid syntax.\n- Fix regression in LSP functionality for well-known types.\n- Fix browser open for `buf registry login` in WSL2.\n- Fix panic in LSP for EOF lookups.\n- Fix `--create` flag for `buf push` to avoid errors on already existing modules if create is disallowed.\n\n## [v1.60.0] - 2025-11-14\n\n- Fix LSP published diagnostics to filter to the opened file.\n- Add `textDocument/documentSymbol` support for `buf lsp serve`.\n- Fix LSP navigation for cached modules which could cause import paths to become unresolvable.\n- Update default value of `--timeout` flag to 0, which results in no timeout by default.\n- Update `PROTOVALIDATE` lint rule to allow for custom rules that do not have `id` or `message`\n  fields.\n\n## [v1.59.0] - 2025-10-20\n\n- Promote `buf beta lsp` to `buf lsp serve`. Command `buf beta lsp` is now deprecated.\n- Add `textDocument/References` support for `buf lsp serve`.\n- Add autocompletion for basic keywords, syntax, package and imports for `buf lsp serve`.\n- Add workspace symbol queries for `buf lsp serve`.\n- Fix positional encoding for diagnostics in `buf lsp serve`.\n- Fix format updates for `buf lsp serve`.\n- Fix syntax highlighting on semantic tokens for `buf lsp serve`.\n- Fix `buf format` to remove extraneous whitespace before the first header node (syntax/package\n  declarations).\n\n## [v1.58.0] - 2025-10-09\n\n- Update `PROTOVALIDATE` lint rule to check `IGNORE_IF_ZERO_VALUE` on fields that track presence.\n- Fix `buf format` on fields with missing field number tags.\n- Optimize `include` and `exclude` path handling for workspaces to avoid unnecessary file system\n  operations. This change can result in a performance improvement for large workspaces.\n- Fix buf curl for HTTP/2 services with ` --http2-prior-knowledge` flag set.\n\n## [v1.57.2] - 2025-09-16\n\n- Fix buf curl for HTTP/2 services.\n\n## [v1.57.1] - 2025-09-16\n\n- Minor bug fixes and dependency upgrades.\n\n## [v1.57.0] - 2025-08-27\n\n- Update exclude types to remove unused options reducing the size of generated code.\n- Add `gitlab-code-quality` error format to print errors in the GitLab Code Quality format\n  for `buf lint` and `buf breaking`.\n- Add `source_control_url` to `json` outputs for `buf registry {module, plugin} commit` commands.\n\n## [v1.56.0] - 2025-07-31\n\n- Add `buf export --all` flag to include non-proto source files.\n- Add s390x binaries for Linux to releases.\n- Fix ppc64le binaries for Linux released as x86_64 binaries.\n- `buf lint` will no longer warn about uses of `(buf.validate.message).disabled`, as it was\n  removed in protovalidate v0.14.0. Please update to protovalidate v0.14.0 or higher, using the\n  steps outlined in the\n  [protovalidate release notes](https://github.com/bufbuild/protovalidate/releases/tag/v0.14.0).\n- Fix `buf breaking --against-registry` to work with new modules that have no commits on the\n  default branch.\n\n## [v1.55.1] - 2025-06-17\n\n- Fix language version for pre-commit hooks.\n\n## [v1.55.0] - 2025-06-17\n\n- Promote `buf beta stats` to `buf stats`.\n- Update built-in Well-Known Types to Protobuf v31.1.\n- Add `buf registry sdk info` command.\n- Allow workspaces that are adding new module(s) with no module-specific breaking configurations\n  to run `buf breaking`, ignoring new module(s).\n\n## [v1.54.0] - 2025-05-12\n\n- Add `CSR` category to breaking rules.\n- Add support for local bufplugins for `protoc-gen-buf-breaking` and `protoc-gen-buf-lint`.\n- Add RISC-V (64-bit) binaries for Linux to releases.\n- Fix type filtering on `buf generate` for empty files, files with no declared types.\n- Fix CEL check on `buf lint` for predefined `rules` variables.\n- Fix `buf config migrate` to filter out removed rules.\n- Allow users to set examples without constraints in `PROTOVALIDATE` lint rule.\n- Add ppc64le binaries for Linux to releases.\n\n## [v1.53.0] - 2025-04-21\n\n- Fix buf breaking annotations for JSON format.\n\n## [v1.52.1] - 2025-04-08\n\n- Fix language version for pre-commit hooks.\n\n## [v1.52.0] - 2025-04-07\n\n- Fix `exclude_type` on a non imported package.\n- Fix `--exclude-type` flag for `buf generate` when an input is specified.\n- Fix type filter import filtering for options.\n- Add OS environment when invoking local buf plugins.\n- Add file path to `buf lint` and `buf breaking` output even when source code info is not\n  available. This allows `buf lint` and `buf breaking` to respect `ignore` and `ignore_only`\n  configurations when source code info is not available.\n\n## [v1.51.0] - 2025-03-28\n\n- Fix `buf convert` to allow for zero length for `binpb`, `txtpb`, and `yaml` formats.\n- Fix use of deprecated flag `--include-types` for `buf generate`.\n- Add `--against-registry` flag to `buf breaking` that runs breaking checks against the latest\n  commit on the default branch of the corresponding module in the registry.\n- Fix type filter with unused image dependencies for `buf generate`.\n- Improve type filtering for `buf generate`. Adds the ability to exclude types with the parameter\n  `exclude_types` in `buf.gen.yaml` and a flag `--exclude-types` in the CLI.\n  Type filters may now also be specified as plugin parameters in `buf.gen.yaml`.\n\n## [v1.50.1] - 2025-03-10\n\n- Minor fixes and dependency updates.\n\n## [v1.50.0] - 2025-01-17\n\n- Add input parameter `filter` for use with git inputs. This sets the filter\n  flag argument for the git fetch command.\n\n## [v1.49.0] - 2025-01-07\n\n- Fix `buf plugin push --label` to allow pushing a plugin with a label.\n- Add `--digest-changes-only` flag to `buf registry {module,plugin} commit list` to filter\n  out commits that have no digest changes.\n- Fix `buf plugin push --source-control-url` to allow pushing a plugin with the source\n  control url.\n\n## [v1.48.0] - 2024-12-19\n\n- Add `buf registry plugin {create,delete,info,update}` commands to manage BSR plugins.\n- Breaking analysis support for `buf beta lsp`.\n- Fix bug when using the `--type` flag filter for `buf build` where import ordering is not\n  deterministic.\n- Add `buf plugin push` command to push a plugin to the Buf Schema Registry.\n  Only WebAssembly check plugins are supported at this time.\n- Add `buf plugin update` and `buf plugin prune` command to manage plugins in the `buf.lock`\n  file. Only WebAssembly check plugins are supported at this time.\n- Add `buf registry plugin commit {add-label,info,list,resolve}` to manage BSR plugin commits.\n- Add `buf registry plugin label {archive,info,list,unarchive}` to manage BSR plugin commits.\n- Move `buf registry module update` to `buf registry module settings update`. Command\n  `buf registry module update` is now deprecated.\n- Support remote check plugins in `buf lint` and `buf breaking` commands.\n\n## [v1.47.2] - 2024-11-14\n\n- Update the patch version to resolve NPM packaging issues. No command updates or user changes.\n\n## [v1.47.1] - 2024-11-14\n\n- Update the patch version to resolve NPM packaging issues. No command updates or user changes.\n\n## [v1.47.0] - 2024-11-13\n\n- Move `buf registry commit` to `buf registry module commit`. Command\n  `buf registry commit` is now deprecated.\n- Move `buf registry label` to `buf registry module label`. Command\n  `buf registry label` is now deprecated.\n\n## [v1.46.0] - 2024-10-29\n\n- Add `buf registry whoami` command, which checks if you are logged in to the Buf Schema\n  Registry at a given domain.\n\n## [v1.45.0] - 2024-10-08\n\n- Update `buf registry module info --format=json` to add `default_label_name`, which provides the name\n  of the default label of a module.\n\n## [v1.44.0] - 2024-10-03\n\n- Update the `PROTOVALIDATE` lint rule to check example field options. Examples will be checked that\n  they satisfy the field constraints, and are only present if constraints are present.\n- Update the `PROTOVALIDATE` lint rule to check predefined rules. Predefined rules will be checked\n  that they compile.\n- Add support for a WebAssembly (Wasm) runtime for custom lint and breaking changes plugins. Use the\n  `.wasm` file extension to specify a path to a Wasm plugin.\n\n## [v1.43.0] - 2024-09-30\n\n- Add new experimental LSP support under `buf beta lsp`.\n\n## [v1.42.0] - 2024-09-18\n\n- Add support for custom lint and breaking change plugins. See\n  [our launch blog post](https://buf.build/blog/buf-custom-lint-breaking-change-plugins)\n  for more details!\n- Add `buf dep graph --format` flag that defaults to `dot`, and adds the option `json`, to print\n  the dependency graph in JSON format.\n- Fix bugs in `buf format` where trailing comments on commas in message literals were not properly\n  propagated to the formatted proto, empty message literals were not properly indented, and\n  compound strings in options added an extra newline before trailing commas.\n\n## [v1.41.0] - 2024-09-11\n\n- Add HTTP/3 support for gRPC with `buf curl`.\n- Fix issue where errors from protoc plugins may be overwritten when executing plugins in parallel.\n\n## [v1.40.1] - 2024-09-06\n\n- Fix issue with `buf lint` where comment ignores in the shape of `// buf:lint:ignore <RULE_ID> <extra comment>`\n  were not recognized due to the extra comment.\n\n## [v1.40.0] - 2024-09-04\n\n- Add concept of a default lint or breaking rule, which is printed out as a property when running\n  `buf config ls-{breaking,lint}-rules`. Default rules are those rules which are run if no lint\n  or breaking rules are explicitly configured in your `buf.yaml`.\n- Rename `DEFAULT` lint rule category to `STANDARD`. With the concept of default rules being introduced,\n  having a category named `DEFAULT` is confusing, as while it happens that all the rules in the `DEFAULT`\n  lint category are also default rules, the name has become overloaded. As with all `buf` changes, this\n  change is backwards-compatible: the `DEFAULT` lint category continues to work, and always will. We\n  recommend changing to `STANDARD`, however.\n\n## [v1.39.0] - 2024-08-27\n\n- Fix git input handling of relative HEAD refs without branch names.\n- Add `includes` key to module configurations in v2 `buf.yaml`, accepting a list of directories.\n  * If `includes` is specified, a proto file is considered in the module only if it is in one of the\n    directories specified.\n  * If both `includes` and `excludes` keys are specified for a module, a proto file is considered\n    part of this module if it is contained in any of the include paths and not in any of the exclude\n    paths.\n- Allow multiple module configurations in the same v2 `buf.yaml` to have the same directory path.\n\n## [v1.38.0] - 2024-08-22\n\n- Add `--http3` flag to `buf curl` which forces `buf curl` to use HTTP/3 as the transport.\n- Fix issue with directory inputs for v2 workspaces where the specified directory was not itself\n  a path to a module, but contained directories with modules, and the modules would not build.\n- Stop creating empty `buf.lock` files when `buf dep update` does not find new dependencies\n  to update and there is no existing `buf.lock`.\n- Update `buf push` to push the license file or doc file (e.g. `README.md`, `LICENSE`) in the\n  same directory as `buf.yaml` if a module does not have a license file or doc file in the\n  module's directory.\n- Fix constraints of `--path` flag for lint and breaking rules to avoid resolving all files\n  within a module. This change can result in a performance improvement for large workspaces.\n\n## [v1.37.0] - 2024-08-16\n\n- Add `STABLE_PACKAGE_NO_IMPORT_UNSTABLE` lint rule which disallows files from stable packages\n  to import files from unstable packages.\n- Fix plugin push failures when pushing an image built with containerd image store.\n\n## [v1.36.0] - 2024-08-06\n\n- Add `--list-services` and `--list-methods` flags to `buf curl`, which trigger the command to list\n  known services or methods in the RPC schema, instead of invoking an RPC method.\n- Add `clean` as a top-level option in `buf.gen.yaml`, matching the `buf generate --clean` flag. If\n  set to true, this will delete the directories, jar files, or zip files set to `out` for each\n  plugin.\n- Fix git input handling of annotated tags.\n- Update `buf registry login` to complete the login flow in the browser by default. This allows\n  users to login with their browser and have the token automatically provided to the CLI.\n- Add `buf registry organization {create, delete, info, update}` commands to manage BSR\n  organizations. Remove `buf beta registry organization` commands.\n- Add `buf registry module {create, delete, deprecate, info, undeprecate, update}` commands to\n  manage BSR modules. Remove `buf beta registry repository` commands.\n- Add `buf registry label {archive, info, list, unarchive}` commands to manage BSR module labels.\n  Remove `buf beta registry label` commands and `buf beta registry {archive, unarchive}`.\n- Add `buf registry commit {add-label, info, list, resolve}` to manage BSR module commits. Remove\n  `buf beta registry commit` commands.\n\n## [v1.35.1] - 2024-07-24\n\n- Fix the git input parameter `ref` to align with the `git` notion of a ref. This allows for the use\n  of branch names, tag names, and commit hashes.\n- Fix unexpected `buf build` errors with absolute path directory inputs without workspace and/or\n  module configurations (e.g. `buf.yaml`, `buf.work.yaml`) and proto file paths set to the `--path` flag.\n\n## [v1.35.0] - 2024-07-22\n\n- Add `buf generate --clean` flag that will delete the directories, jar files, or zip files that the\n  plugins will write to, prior to generation. Allows cleaning of existing assets without having\n  to call `rm -rf`.\n- Deprecate `--username` flag on and username prompt on `buf registry login`. A username is no longer\n  required to log in.\n\n## [v1.34.0] - 2024-06-21\n\n- Add `buf config ls-modules` command to list configured modules.\n- Fix issue where `buf generate` would succeed on missing insertion points and\n  panic on empty insertion point files.\n- Update `buf generate` to allow the use of Editions syntax when doing local code\n  generation by proxying to a `protoc` binary (for languages where code gen is\n  implemented inside of `protoc` instead of in a plugin: Java, C++, Python, etc).\n- Allow use of an array of strings for the `protoc_path` property of for `buf.gen.yaml`,\n  where the first array element is the actual path and other array elements are extra\n  arguments that are passed to `protoc` each time it is invoked.\n\n## [v1.33.0] - 2024-06-13\n\n- Allow user to override `--source-control-url` and `--create-default-label` when using\n  `--git-metadata` with `buf push`.\n- Fix `buf push --git-metadata` when local tags point to different objects than\n  the remote tags.\n- Fix issue where comment ignores were not respected for `PROTOVALIDATE` lint rule violations.\n- Add `buf beta registry label {create,get,list}` to replace `buf beta registry {draft, tag}`\n  commands.\n- Update `buf beta commit {get,list}` command outputs to display create time and stop\n  displaying associated tags.\n- Change the behavior of `buf beta commit list <buf.build/owner/repository>` when the\n  reference is empty. It now lists commits in the repository instead of listing commits\n  of the default label.\n- Update output of `buf format` to canonicalize the punctuation used in message literals\n  in option values. The output now always uses `{` and `}` instead of `<` and `>`; it\n  adds `:` separators between field names and message values if the source omitted them,\n  and it removes unnecessary separators between fields (`,` and `;` are allowed, but\n  neither is needed).\n- Update `buf format -w` so that it does not touch files whose contents don't actually\n  change. This eliminates noisy notifications to file-system-watcher tools that are\n  watching the directory that contains proto sources.\n- Update `buf generate` to work with plugins provided by protoc for versions v24.0\n  to v25.3. Editions support was experimental in these releases, and the plugins\n  advertise incomplete support for editions, which triggers `buf` to report an error.\n  With this fix, these plugins can be used again as long as none of the input files use\n  editions syntax.\n- Add `buf push --exclude-unnamed` flag to exclude unnamed modules when pushing to the BSR.\n\n## [v1.32.2] - 2024-05-28\n\n- Update `buf generate` to warn instead of error when proto3 optional is required but not\n  supported by a plugin.\n\n## [v1.32.1] - 2024-05-21\n\n- Fix archive and git inputs so that `--path` and `--exclude-path` paths are relative to\n  the `#subdir` rather than the root of the input. This fixes an unintended behavior change\n  that was introduced in `v1.32.0`.\n- Add `module` input for `protoc-gen-buf-lint` and `protoc-gen-buf-breaking` to allow\n  users to specify the module for `v2` configuration files.\n\n## [v1.32.0] - 2024-05-16\n\n- Add version `v2` for `buf.yaml` and `buf.gen.yaml` configuration files.\n- Add `buf config migrate` to migrate configuration files to the latest version (now `v2`).\n- Move `buf mod init` to `buf config init`. `buf mod init` is now deprecated.\n- Move `buf mod ls-lint-rules` to `buf config ls-lint-rules`. `buf mod ls-lint-rules` is now\n  deprecated.\n- Move `buf mod ls-breaking-rules` to `buf config ls-breaking-rules`. `buf mod ls-breaking-rules`\n  is now deprecated.\n- Move `buf mod prune` to `buf dep prune`. `buf mod prune` is now deprecated.\n- Move `buf mod update` to `buf dep update`. `buf mod update` is now deprecated.\n- Move `buf mod {clear-cache,cc}` to `buf registry cc`. `buf mod {clear-cache,cc}` is now\n  deprecated.\n- Move `buf beta graph` to stable as `buf dep graph`.\n- Change the default visibility of `buf push --create-visibility` to `private` when the `--create`\n  flag is set. Users are no longer required to set `--create-visibility` when running\n  `buf push --create`.\n- Add `buf push --label`, which allows users to set labels when pushing new commits to the BSR.\n- Add `buf push --source-control-url`, which allows users to associate commits pushed to the BSR\n  with a URL to a source code repository.\n- Add `buf push --create-default-label`, which allows users to set a default label for a repository\n  when calling `buf push --create`.\n- Add `buf push --git-metadata`, which automatically sets appropriate `--label`,\n  `--source-control-url`, and `--create-default-label` flags based on the current Git repository.\n- Add `buf convert --validate` to apply [protovalidate](https://github.com/bufbuild/protovalidate)\n  rules to incoming messages specified with `--from`.\n- Deprecate `buf mod open`.\n- Delete `buf beta migrate-v1beta1` This is now replaced with `buf config migrate`.\n- Add `buf registry sdk version` to get the version of a Generated SDK for a module and plugin.\n- Add `buf beta registry archive` and `buf beta registry unarchive` commands for archiving and\n  unarchiving labels on the BSR.\n- Add support for Protobuf Editions. This allows `buf` to be used with sources that use edition\n  2023, instead of proto2 or proto3 syntax. This also updates the `protoc-gen-buf-breaking` and\n  `protoc-gen-buf-lint` Protobuf plugins to support files that use edition 2023.\n- Update `buf breaking` rules to work with Protobuf Editions. To support Editions, some rules have\n  been deprecated and replaced with Editions-aware rules. All deprecated rules continue to work\n  for existing users.\n  * `FIELD_SAME_CTYPE` has been replaced with `FIELD_SAME_CPP_STRING_TYPE`, which considers both\n    `ctype` field options and new `(pb.cpp).string_type` features when deciding on backwards\n    compatibility.\n  * `FIELD_SAME_LABEL` has been replaced with three rules that all check \"cardinality\". The new\n    rules can distinguish between maps and other repeated fields and between implicit and explicit\n    field presence. The new rules are:\n    1. `FIELD_SAME_CARDINALITY` in the `FILE` and `PACKAGE` categories.\n    2. `FIELD_WIRE_COMPATIBLE_CARDINALITY` in the `WIRE` category.\n    3. `FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY` in the `WIRE_JSON` category.\n  * `FILE_SAME_JAVA_STRING_CHECK_UTF8` has been replaced with `FIELD_SAME_JAVA_UTF8_VALIDATION`,\n    which considers both the `java_string_check_utf8` file option and `(pb.java).utf8_validation`\n    features when deciding on backwards compatibility.\n  * Add to the existing `FILE_SAME_SYNTAX` rule with a few related rules that can catch the same\n    sort of compatibility issues, but in an Editions source file that changes feature values:\n    1. `MESSAGE_SAME_JSON_FORMAT` and `ENUM_SAME_JSON_FORMAT` catch changes to the `json_format`\n       feature, which controls whether support for the JSON format is best-effort or properly\n       supported. When supported, the compiler performs more checks relating to field name\n       collisions for the JSON format as well as for FieldMask usage.\n    2. `FIELD_SAME_UTF8_VALIDATION` catches changes to the `utf8_validation` feature, which\n       controls validation of string values.\n    3. `ENUM_SAME_TYPE` catches changes to an enum's type, open vs. closed.\n- Add support for extensions to `buf breaking`. All existing rules for fields are now applied to\n  extensions, except for `FIELD_NO_DELETE` (and its variants). There are also new\n  `EXTENSION_NO_DELETE` and `PACKAGE_EXTENSION_NO_DELETE` rules for catching deletions of an\n  extension. The new rules are not active by default in existing `v1` and `v1beta1`\n  configurations, for backwards-compatibility reasons. Migrate your config to `v2` to use them.\n- Add support for top-level extensions to `buf lint`. It previously only checked extensions that\n  were defined inside of messages.\n- Add a new `FIELD_NOT_REQUIRED` lint rule that prevents use of required in proto2 files and of\n  `features.field_presence = LEGACY_REQUIRED` in Editions files. This new rule is not active by\n  default in existing `v1` and `v1beta1` configurations, for backwards-compatibility reasons.\n  Migrate your config to `v2` to use them.\n\n## [v1.32.0-beta.1] - 2024-04-23\n\n- Add `buf convert --validate` to apply [protovalidate](https://github.com/bufbuild/protovalidate)\n  rules to incoming messages specified with `--from`.\n- Add `buf config migrate` to migrate configuration files to the latest version (now `v2`).\n- Promote `buf beta graph` to stable as `buf dep graph`.\n- Move `buf mod init` to `buf config init`. `buf mod init` is now deprecated.\n- Move `buf mod ls-lint-rules` to `buf config ls-lint-rules`. `buf mod ls-lint-rules` is now deprecated.\n- Move `buf mod ls-breaking-rules` to `buf config ls-breaking-rules`. `buf mod ls-breaking-rules` is now deprecated.\n- Move `buf mod prune` to `buf dep prune`. `buf mod prune` is now deprecated.\n- Move `buf mod update` to `buf dep update`. `buf mod update` is now deprecated.\n- Move `buf mod {clear-cache,cc}` to `buf registry cc`. `buf mod {clear-cache,cc}` is now deprecated.\n- Deprecate `buf mod open`.\n- Delete `buf beta migrate-v1beta1`.\n- Add `buf registry sdk version` to get the version of a Generated SDK for a module and plugin.\n\n## [v1.31.0] - 2024-04-23\n\n- Update dependencies.\n\n## [v1.30.1] - 2024-04-03\n\n- Fix issue where `buf lint` incorrectly reports an error for `(buf.validate.field).repeated`\n  is set for a repeated validation rule.\n\n## [v1.30.0] - 2024-03-07\n\n- Update `buf generate` so it populates the recently-added\n  [`source_file_descriptors`](https://github.com/protocolbuffers/protobuf/blob/v24.0/src/google/protobuf/compiler/plugin.proto#L96-L99)\n  field of the `CodeGeneratorRequest` message. This provides the plugin with access to options\n  that are configured to only be retained in source and not at runtime (via\n  [field option](https://github.com/protocolbuffers/protobuf/blob/v24.0/src/google/protobuf/descriptor.proto#L693-L702)).\n  Descriptors in the `proto_file` field will not include any options configured this way\n  for the files named in `file_to_generate` field.\n- Add `--exclude-source-retention-options` flag to `buf build`, which\n  causes options configured to only be retained in source to be stripped\n  from the output descriptors.\n\n## [v1.29.0] - 2024-01-24\n\n- Add support for `yaml` format. All commands that take image inputs, output images,\n  or convert between message formats, now take `yaml` as a format, in addition to\n  the existing `binpb` and `txtpb` formats. Some examples:\n  - `buf build -o image.yaml`\n  - `buf ls-files image.yaml`\n  - `buf convert --type foo.Bar --from input.binpb --to output.yaml`\n- The `yaml` and `json` formats now accept two new options: `use_proto_names` and\n  `use_enum_numbers`. This affects output serialization. Some examples:\n  - `buf convert --type foo.Bar --from input.binpb --to output.yaml#use_proto_names=true`\n  - `buf convert --type foo.Bar --from input.binpb --to -#format=yaml,use_enum_numbers=true`\n- Fix issue where `buf format` would inadvertently mangle files that used\n  the [expanded `Any` syntax](https://protobuf.com/docs/language-spec#any-messages)\n  in option values.\n\n## [v1.28.1] - 2023-11-15\n\n- The `buf curl` command has been updated to support the use of multiple schemas.\n  This allows users to specify multiple `--schema` flags and/or to use both `--schema`\n  and `--reflect` flags at the same time. The result is that additional sources can\n  be consulted to resolve an element. This can be useful when the result of an RPC\n  contains extensions or values in `google.protobuf.Any` messages that are not defined\n  in the same schema that defines the RPC service.\n- Fix issue where `buf lint` incorrectly reports error when `(buf.validate.field).required`\n  is set for an optional field in proto3.\n\n## [v1.28.0] - 2023-11-10\n\n- Add lint rules for [protovalidate](https://github.com/bufbuild/protovalidate). `buf lint`\n  will now verify that your protovalidate rules are valid. A single rule `PROTOVALIDATE` has been\n  added to the `DEFAULT` group - given that protovalidate is net new, this does not represent\n  a breaking change.\n- Update `buf beta price` with the latest pricing information.\n- Display a warning when reading a `buf.lock` with dependencies with b1 or b3 digests. b1 and b3\n  digests will be deprecated in a future version. Run `buf mod update` to update dependency digests.\n\n## [v1.27.2] - 2023-10-27\n\n- Fix issue where `buf build` and other commands may fail when handling certain\n  archives created on macOS that contain files with extended attributes.\n\n## [v1.27.1] - 2023-10-16\n\n- Fix issue in v1.27.0 where `--path` did not work with workspaces under certain scenarios.\n\n## [v1.27.0] - 2023-10-04\n\n- Fix issue where `buf generate --exclude-path` was not properly excluding paths\n  for remote modules.\n- Fix issue where `buf curl` had a user agent that did not properly place the\n  extension as a suffix.\n- Update `buf beta price` with the latest pricing information.\n\n## [v1.26.1] - 2023-08-09\n\n- Fix issue where `buf build -o` did not properly output files with the `.txtpb`\n  extension in Protobuf text format.\n\n## [v1.26.0] - 2023-08-09\n\n- Add support for the `--http2-prior-knowledge` flag when running `buf curl`\n  against secure \"https\" URLs. This can be used with gRPC servers, that only\n  support HTTP/2, when used with a network (layer 4) load balancer, that does\n  not support protocol negotiation in TLS handshake.\n\n## [v1.25.1] - 2023-08-02\n\n- Fix issue where all files were being iterated over when using the `--path` flag.\n- Fix issue where the directory `.` was incorrectly accepted as a value for the\n  `directories` key in `buf.work.yaml`.\n\n## [v1.25.0] - 2023-07-18\n\n- Add `txtpb` format to handle the Protobuf text format. and automatically recognize\n  `.txtpb` files as Protobuf text files. The `txtpb` format can now be used with\n  all `buf` commands that take images as input or output, such as `build`, `convert`,\n  and `curl`.\n\n## [v1.24.0] - 2023-07-13\n\n- Update `buf mod update` to block updates that will result in conflicting `.proto`\n  files across dependencies.\n- Replace `bin` format with `binpb` format, and support the `.binpb` file extension.\n  `.binpb` is now the canonical file extension for binary-encoded Protobuf data.\n  The `bin` format and the `.bin` file extension continue to be accepted.\n- Remove support for `go` subdomain in `.netrc`. This was used as part of the\n  remote generation alpha, which has been fully deprecated in favor of remote\n  plugins and remote packages. See https://buf.build/blog/remote-packages-remote-plugins-approaching-v1\n  for more details.\n- Update `buf beta price` with the latest pricing information.\n\n## [v1.23.1] - 2023-06-30\n\n- Fix issue where `buf beta graph` would not print modules within a workspace that\n  had no dependencies or dependents.\n- Fix issue where `buf beta graph` would print warnings for missing dependencies\n  that were actually present.\n\n## [v1.23.0] - 2023-06-29\n\n- Add `buf beta graph` to print the dependency graph for a module in DOT format.\n- Various small bug fixes.\n\n## [v1.22.0] - 2023-06-23\n\n- Change default for `--origin` flag of `buf beta studio-agent` to `https://buf.build`\n\n## [v1.21.0] - 2023-06-05\n\n- Fix issue where locally-produced images did not have module information if the corresponding\n  module was stored in the new cache.\n- Remove `buf beta registry template`.\n- Remove `buf beta registry plugin {create,deprecate,list,undeprecate,version}` and replace with\n  `buf beta registry plugin {push,delete}`.\n- Update `buf beta price` with the latest pricing information.\n\n## [v1.20.0] - 2023-05-30\n\n- Add `--emit-defaults` flag to `buf curl` to emit default values in JSON-encoded responses.\n- Indent JSON-encoded responses from `buf curl` by default.\n- Log a warning in case an import statement does not point to a file in the module, a file in a\n  direct dependency, or a well-known type file.\n\n## [v1.19.0] - 2023-05-17\n\n- Add `--create` flag to `buf push` to create a repository if it does not exist. The user\n  is also required to specify the visibility using `--create-visibility`.\n- Add `github-actions` error format to print errors in a form parseable by GitHub Actions.\n- Fix issue in `buf build` and `buf generate` where the use of type filtering (via\n  `--type` flags) would cause the resulting image to have no source code info, even\n  when `--exclude-source-info` was not specified. The main impact of the bug was that\n  generated code would be missing comments.\n- Fix issue in `buf curl` when using `--user` or `--netrc` that would cause a malformed\n  Authorization header to be sent.\n- Update the module cache to use an optimized content addressable store. The cache is\n  now self-healing and uses significantly less space. Users wishing to free unused space\n  can run `buf mod --clear-cache` once after upgrading to remove data stored in the\n  previous module cache.\n\n## [v1.18.0] - 2023-05-05\n\n- Remove `buf beta registry {plugin,template} {deprecate,undeprecate}`.\n- Add `--user` and `--netrc` flags to `buf curl`, providing the same behavior as the\n  flags of the same name in the cURL tool.\n- Include `DocumentationPath` in the module on `buf push`.\n- Support fallback paths, `README.md` and `README.markdown`, for module documentation.\n  The default source for module documentation is `buf.md`.\n  If `buf.md` is missing, `README.md` or `README.markdown` is used as fallback sources.\n\n## [v1.17.0] - 2023-04-05\n\n- Fix issue with JSON marshalling of errors where line and column fields were\n  omitted when line and column information was empty.\n- Fix issue with MSVS marshalling of errors where the column could be 0.\n- Add `buf beta stats` command to print statistics about a given source or module.\n- Update `buf beta price` with the latest pricing information.\n\n## [v1.16.0] - 2023-03-29\n\n- Add `buf beta price` command to help users of the BSR figure out how much a module\n  will cost to store on the BSR under the Teams or Pro plans.\n- Fix issue in `protoc-gen-buf-lint` that prevented it from reporting lint\n  errors for unused imports.\n- Fix issue with `buf format` where indents would be produced on certain empty lines.\n- Remove `buf alpha registry token create` command. Tokens must be created through the BSR UI.\n- Add local WASM plugin support in alpha, gated by the `BUF_ALPHA_ENABLE_WASM` environment variable.\n  This feature is under evaluation, and may change at any time. If you are interested in WASM\n  Protobuf plugins, reach out to us.\n\n## [v1.15.1] - 2023-03-08\n\n- Fix bug in `buf generate` with `v1beta1` config files.\n- Fix potential crash when using the `--type` flag with `buf build` or `buf generate`.\n\n## [v1.15.0] - 2023-02-28\n\n- Update built-in Well-Known Types to Protobuf v22.0.\n- Fix bug in `buf format` where C-style block comments in which every\n  line includes a prefix (usually \"*\") would be incorrectly indented.\n- Add `--private-network` flag to `buf beta studio-agent` to support handling CORS requests\n  from Studio on private networks that set the `Access-Control-Request-Private-Network` header.\n\n## [v1.14.0] - 2023-02-09\n\n- Replace `buf generate --include-types` with `buf generate --type` for consistency. `--include-types`\n  is now deprecated but continues to work, consistent with our compatibility guarantee.\n- Include type references in `google.protobuf.Any` messages in option values\n  when filtering on type, e.g. with `buf build --type` or `buf generate --type`.\n- Allow specifying a specific `protoc` path in `buf.gen.yaml` when using `protoc`'s built-in plugins\n  via the new `protoc_path` option.\n- Allow specifying arguments for local plugins in `buf.gen.yaml`. You can now do e.g.\n  `path: [\"go, \"run\", ./cmd/protoc-gen-foo]` in addition to `path: protoc-gen-foo`.\n- Add optional name parameter to `buf mod init`, e.g. `buf mod init buf.build/owner/foobar`.\n- Fix issue with `php_metadata_namespace` file option in [managed mode](https://docs.buf.build/generate/managed-mode).\n- Make all help documentation much clearer. If you notice any inconsistencies, let us know.\n\n## [v1.13.1] - 2023-01-27\n\n- Fix race condition with `buf generate` when remote plugins from multiple\n  BSR instances are being used at once.\n\n## [v1.13.0] - 2023-01-26\n\n- Extend the `BUF_TOKEN` environment variable to accept tokens for multiple\n  BSR instances. Both `TOKEN` and `TOKEN1@BSRHOSTNAME1,TOKEN2@BSRHOSTNAME2,...`\n  are now valid values for `BUF_TOKEN`.\n- Remove `buf beta convert` in favor of the now-stable `buf convert`.\n\n## [v1.12.0] - 2023-01-12\n- Add `buf curl` command to invoke RPCs via [Connect](https://connect-build),\n  [gRPC](https://grpc.io/), or [gRPC-Web](https://github.com/grpc/grpc-web.)\n- Introduce `objc_class_prefix` option in managed mode, allowing a `default` value\n  for `objc_class_prefix` for all files, `except` and `override`, which both behave\n  similarly to other `except` and `override` options. Specifying an empty `default`\n  value is equivalent to having managed mode on in previous versions.\n- Introduce `ruby_package` option in managed mode, allowing `except` and `override`,\n  in the same style as `objc_class_prefix`. Leaving `ruby_package` unspecified has\n  the same effect as having mananged mode enabled in previous versions.\n\n## [v1.11.0] - 2022-12-19\n- `buf generate` now batches remote plugin generation calls for improved performance.\n- Update `optimize_for` option in managed mode, allowing a `default` value for `optimize_for`\n  for all files, `except` and `override`, which both behave similarly to other `except`\n  and `override` options. Specifying an `optimize_for` value in the earlier versions is\n  equivalent to having a `optimize_for` with that value as default.\n\n## [v1.10.0] - 2022-12-07\n\n- When using managed mode, setting `enabled: false` now no longer fails `buf generate`\n  and instead prints a warning log and ignores managed mode options.\n- Add `csharp_namespace` option to managed mode, allowing `except`, which excludes\n  modules from managed mode, and `override`, which specifies `csharp_namespace` values\n  per module, overriding the default value. By default, when managed mode is enabled,\n  `csharp_namespace` is set to the package name with each package sub-name capitalized.\n- Promote `buf convert` to stable, keep `buf beta convert` aliased in the beta command.\n- Add `Types` filter to `buf generate` command to specify types (message, enum,\n  service) that should be included in the image. When specified, the resulting\n  image will only include descriptors to describe the requested types.\n\n## [v1.9.0] - 2022-10-19\n\n- New compiler that is faster and uses less memory than the outgoing one.\n  - When generating source code info, the new compiler is 20% faster, and allocates\n    13% less memory.\n  - If _not_ generating source code info, the new compiler is 50% faster and\n    allocates 35% less memory.\n  - In addition to allocating less memory through the course of a compilation, the\n    new compiler releases some memory much earlier, allowing it to be garbage\n    collected much sooner. This means that by the end of a very large compilation\n    process, less than half as much memory is live/pinned to the heap, decreasing\n    overall memory pressure.\n\n  The new compiler also addresses a few bugs where Buf would accept proto sources\n  that protoc would reject:\n  - In proto3 files, field and enum names undergo a validation that they are\n    sufficiently different so that there will be no conflicts in JSON names.\n  - Fully-qualified names of elements (like a message, enum, or service) may not\n    conflict with package names.\n  - A oneof or extend block may not contain empty statements.\n  - Package names may not be >= 512 characters in length or contain > 100 dots.\n  - Nesting depth of messages may not be > 32.\n  - Field types and method input/output types may not refer to synthetic\n    map entry messages.\n- Push lint and breaking configuration to the registry.\n- Include `LICENSE` file in the module on `buf push`.\n- Formatter better edits/preserves whitespace around inline comments.\n- Formatter correctly indents multi-line block (C-style) comments.\n- Formatter now indents trailing comments at the end of an indented block body\n  (including contents of message and array literals and elements in compact options)\n  the same as the rest of the body (instead of out one level, like the closing\n  punctuation).\n- Formatter uses a compact, single-line representation for array and message literals\n  in option values that are sufficiently simple (single scalar element or field).\n- `buf beta convert` flags have changed from `--input` to `--from` and `--output`/`-o` to `--to`\n- fully qualified type names now must be parsed to the `input` argument and `--type` flag separately\n\n## [v1.8.0] - 2022-09-14\n\n- Change default for `--origin` flag of `buf beta studio-agent` to `https://studio.buf.build`\n- Change default for `--timeout` flag of `buf beta studio-agent` to `0` (no timeout). Before it was\n  `2m` (the default for all the other `buf` commands).\n- Add support for experimental code generation with the `plugin:` key in `buf.gen.yaml`.\n- Preserve single quotes with `buf format`.\n- Support `junit` format errors with `--error-format`.\n\n## [v1.7.0] - 2022-06-27\n\n- Support protocol and encoding client options based on content-type in Studio Agent.\n- Add `--draft` flag to `buf push`.\n- Add `buf beta registry draft {list,delete}` commands.\n\n## [v1.6.0] - 2022-06-21\n\n- Fix issue where `// buf:lint:ignore` comment ignores did not work for the\n  `ENUM_FIRST_VALUE_ZERO` rule.\n- Add `buf beta studio-agent` command to support the upcoming Buf Studio.\n\n## [v1.5.0] - 2022-05-30\n\n- Upgrade to `protoc` 3.20.1 support.\n- Fix an issue where `buf` would fail if two or more roots contained\n  a file with the same name, but with different file types (i.e. a\n  regular file vs. a directory).\n- Fix check for `PACKAGE_SERVICE_NO_DELETE` to detect deleted services.\n- Remove `buf beta registry track`.\n- Remove `buf beta registry branch`.\n\n## [v1.4.0] - 2022-04-21\n\n- Fix issue where duplicate synthetic oneofs (such as with proto3 maps or\n  optional fields) did not result in a properly formed error.\n- Add `buf beta registry repository update` command which supports updating\n  repository visibility (public vs private). As with all beta commands, this\n  is likely to change in the future.\n\n## [v1.3.1] - 2022-03-30\n\n- Allow `--config` flag to be set when targeting a module within a workspace.\n- Update `buf format`'s file option order so that default file options are\n  sorted before custom options.\n- Update `buf format` to write adjacent string literals across multiple lines.\n- Fix `buf format` so that the output directory (if any) is created if and only\n  if the input is successfully formatted.\n\n## [v1.3.0] - 2022-03-25\n\n- Add `--exit-code` flag to `buf format` to exit with a non-zero exit code if\n  the files were not already formatted.\n\n## [v1.2.1] - 2022-03-24\n\n- Fix a few formatting edge cases.\n\n## [v1.2.0] - 2022-03-24\n\n- Add `buf format` command to format `.proto` files.\n- Fix build scripts to avoid using the `command-line-arguments` pseudo-package\n  when building binaries and re-introduce checking for proper usage of private\n  packages.\n\n## [v1.1.1] - 2022-03-21\n\n- Remove check for proper usage of private packages due to a breaking change made in the Golang standard library in 1.18.\n\n## [v1.1.0] - 2022-03-01\n- Add `--type` flag to the `build` command to create filtered images containing\n  only the specified types and their required dependencies.\n- Trim spaces and new lines from user-supplied token for `buf registry login`.\n- Add support for conversion between JSON and binary serialized message for `buf beta convert`.\n\n## [v1.0.0] - 2022-02-17\n\n- Check that the user provided a valid token when running `buf registry login`.\n- Add `buf mod open` that opens a module's homepage in a browser.\n- Add `buf completion` command to generate auto-completion scripts in commonly used shells.\n- Add `--disable-symlinks` flag to the `breaking, build, export, generate, lint, ls-files, push`\n  commands. By default, the CLI will follow symlinks except on Windows, and this disables following\n  symlinks.\n- Add `--include-wkt` flag to `buf generate`. When this flag is specified alongside\n  `--include-imports`, this will result in the [Well-Known Types](https://github.com/bufbuild/wellknowntypes/tree/11ea259bf71c4d386131c1986ffe103cb1edb3d6/v3.19.4/google/protobuf)\n  being generated as well. Most language runtimes have the Well-Known Types included as part\n  of the core library, making generating the Well-Known Types separately undesirable.\n- Remove `buf protoc`. This was a pre-v1.0 demonstration to show that `buf` compilation\n  produces equivalent results to mainline `protoc`, however `buf` is working on building\n  a better Protobuf future that provides easier mechanics than our former `protoc`-based\n  world. `buf protoc` itself added no benefit over mainline `protoc` beyond being considerably\n  faster and allowing parallel compilation. If `protoc` is required, move back to mainline `protoc`\n  until you can upgrade to `buf`. See [#915](https://github.com/bufbuild/buf/pull/915) for more\n  details.\n- Context modifier no longer overrides an existing token on the context. This allows `buf registry login`\n  to properly check the user provided token without the token being overridden by the CLI interceptor.\n- Removed the `buf config init` command in favor of `buf mod init`.\n- Removed the `buf config ls-breaking-rules` command in favor of `buf mod ls-breaking-rules`.\n- Removed the `buf config ls-lint-rules` command in favor of `buf mod ls-lint-rules`.\n- Removed the `buf config migrate-v1beta1` command in favor of `buf beta migrate-v1beta1`.\n- Add `buf beta decode` command to decode message with provided image source and message type.\n- Disable `--config` flag for workspaces.\n- Move default config version from `v1beta1` to `v1`.\n\n## [v1.0.0-rc12] - 2022-02-01\n\n- Add `default`, `except` and `override` to `java_package_prefix`.\n- Add dependency commits as a part of the `b3` digest.\n- Upgrade to `protoc` 3.19.4 support.\n- Remove `branch` field from `buf.lock`.\n\n## [v1.0.0-rc11] - 2022-01-18\n\n- Upgrade to `protoc` 3.19.3 support.\n- Add `PACKAGE_NO_IMPORT_CYCLE` lint rule to detect package import cycles.\n- Add `buf beta registry {plugin,template} {deprecate,undeprecate}`.\n- Add warning when using enterprise dependencies without specifying a enterprise\n  remote in the module's identity.\n- Remove `digest`, and `created_at` fields from the `buf.lock`. This will temporarily create a new commit\n  when pushing the same contents to an existing repository, since the `ModulePin` has been reduced down.\n- Add `--track` flag to `buf push`\n- Update `buf beta registry commit list` to allow a track to be specified.\n- Add `buf beta registry track {list,delete}` commands.\n- Add manpages for `buf`.\n\n## [v1.0.0-rc10] - 2021-12-16\n\n- Fix issue where remote references were not correctly cached.\n\n## [v1.0.0-rc9] - 2021-12-15\n\n- Always set `compiler_version` parameter in the `CodeGeneratorRequest` to \"(unknown)\".\n- Fix issue where `buf mod update` was unable to resolve dependencies from different remotes.\n- Display the user-provided Buf Schema Registry remote, if specified, instead of the default within the `buf login` message.\n- Fix issue where `buf generate` fails when the same plugin was specified more than once in a single invocation.\n- Update the digest algorithm so that it encodes the `name`, `lint`, and `breaking` configuration encoded in the `buf.yaml`.\n  When this change is deployed, users will observe the following:\n  - Users on `v0.43.0` or before will notice mismatched digest errors similar to the one described in https://github.com/bufbuild/buf/issues/661.\n  - Users on `v0.44.0` or after will have their module cache invalidated, but it will repair itself automatically.\n  - The `buf.lock` (across all versions) will reflect the new `b3-` digest values for new commits.\n\n## [v1.0.0-rc8] - 2021-11-10\n\n- Add new endpoints to the recommendation service to make it configurable.\n- Add `--exclude-path` flag to `buf breaking`, `buf build`, `buf export`, `buf generate`, and `buf lint` commands. This allows users to exclude specific paths when running commands.\n- Change `GetModulePackages` endpoint to return a repeated `ModulePackage` message that now includes package description with the package name.\n- Add `Oneof` to the `Message` structure for documentation.\n\n## [v1.0.0-rc7] - 2021-11-08\n\n- Upgrade to `protoc` 3.19.1 support.\n- Fix issue with `buf generate` where multiple insertion points are defined in the same file.\n\n## [v1.0.0-rc6] - 2021-10-20\n\n- Fix issue with `buf ls-files` when given an image as an input, imports were being printed,\n  even without the `--include-imports` flag.\n- Add the ability for users to provide individual protobuf files as inputs to CLI commands. This allows users to run `buf` commands against and file input based on their current working directory, for example, `buf lint foo/bar.proto`, where `foo/bar.proto` is a path to protobuf file on disk.\n\n## [v1.0.0-rc5] - 2021-10-12\n\n- Add `buf beta registry repository deprecate` and `buf beta registry repository undeprecate`.\n- Support `--include-imports` for remote plugins.\n- Fix issue where `buf config migrate-v1beta1 fails` when files cannot be renamed.\n- Fix issue where `buf registry login` panics when an existing .netrc entry exists.\n\n## [v1.0.0-rc4] - 2021-10-07\n\n- Fix issue where `buf generate` could fail when used with large numbers of plugins and files on\n  systems with low file limits.\n- Add `buf protoc --version` flag back. This was accidentally removed.\n- Upgrade to `protoc` 3.18.1 support.\n\n## [v1.0.0-rc3] - 2021-10-04\n\n- Add `--as-import-paths` flag to `ls-files` that strips local directory paths and prints file\n  paths as they are imported.\n- Fix issue where groups used in custom options did not result in the same behavior as `protoc`.\n- Fix issue where insertion points were not applied with respect to the configured output directory.\n\n## [v1.0.0-rc2] - 2021-09-23\n\n- Add `--include-imports` flag to `ls-files`.\n- Upgrade to `protoc` 3.18.0 support.\n- Fix regression with git inputs using `recurse_submodules=true`.\n\n## [v1.0.0-rc1] - 2021-09-15\n\nThis is our first v1.0 release candidate. This release largely concentrates on erroring for\nalready-deprecated commands and flags.\n\nAt Buf, we take compatibility very seriously. When we say v1.0, we mean it - we hope `buf` will be\nstable on v1 for the next decade, and if there is something we want to change, it is our responsibility to\nmake sure that we don't break you, not your responsibility to change because of us. We have learned\na lot about `buf` usage in the last two years of our beta, and have deprecated flags and commands as\nwe go, but for v1.0, we are removing the deprecated items to make sure we have a clean setup going forward.\n\nAll commands and flags have been printing warnings for a long time, and have an easy migration path.\nSimply update the command or flag, and you'll be good to go:\n\n- Removed the `buf login` command in favor of `buf registry login`.\n- Removed the `buf logout` command in favor of `buf registry logout`.\n- Removed the `buf mod init` command in favor of `buf config init`.\n- Removed the `--name` and `--dep` flags in `buf config init`.\n- Removed the `--log-level` global flag.\n- Moved the output of `--version` from stderr to stdout.\n- Moved the output of `--help` and `help` from stderr to stdout.\n- [From v0.55.0](https://github.com/bufbuild/buf/releases/tag/v0.55.0): The version key in all configuration files (`buf.yaml`, `buf.gen.yaml`, `buf.work.yaml`) is now required.\n- [From v0.45.0](https://github.com/bufbuild/buf/releases/tag/v0.45.0): Removed the `buf beta config init` command in favor of `buf config init`.\n- [From v0.45.0](https://github.com/bufbuild/buf/releases/tag/v0.45.0): Removed the `buf beta mod export` command in favor of `buf export`.\n- [From v0.45.0](https://github.com/bufbuild/buf/releases/tag/v0.45.0): Removed the `buf beta mod init` command in favor of `buf config init`.\n- [From v0.45.0](https://github.com/bufbuild/buf/releases/tag/v0.45.0): Removed the `buf beta mod update` command in favor of `buf mod update`.\n- [From v0.45.0](https://github.com/bufbuild/buf/releases/tag/v0.45.0): Removed the `buf beta mod clear-cache` command in favor of `buf mod clear-cache`.\n- [From v0.45.0](https://github.com/bufbuild/buf/releases/tag/v0.45.0): Removed the `buf beta push` command in favor of `buf push`.\n- [From v0.34.0](https://github.com/bufbuild/buf/releases/tag/v0.34.0): Removed the `buf check breaking` command in favor of `buf breaking`.\n- [From v0.34.0](https://github.com/bufbuild/buf/releases/tag/v0.34.0): Removed the `buf check lint` command in favor of `buf lint`.\n- [From v0.34.0](https://github.com/bufbuild/buf/releases/tag/v0.34.0): Removed the `buf check ls-lint-checkers` command in favor of `buf config ls-lint-rules`.\n- [From v0.34.0](https://github.com/bufbuild/buf/releases/tag/v0.34.0): Removed the `buf check ls-breaking-checkers` command in favor of `buf config ls-breaking-rules`.\n- [From v0.31.0](https://github.com/bufbuild/buf/releases/tag/v0.31.0): Removed the `--file` flag on `buf build` in favor of the `--path` flag.\n- [From v0.31.0](https://github.com/bufbuild/buf/releases/tag/v0.31.0): Removed the `--file` flag on `buf lint` in favor of the `--path` flag.\n- [From v0.31.0](https://github.com/bufbuild/buf/releases/tag/v0.31.0): Removed the `--file` flag on `buf breaking` in favor of the `--path` flag.\n- [From v0.31.0](https://github.com/bufbuild/buf/releases/tag/v0.31.0): Removed the `--file` flag on `buf generate` in favor of the `--path` flag.\n- [From v0.31.0](https://github.com/bufbuild/buf/releases/tag/v0.31.0): Removed the `--file` flag on `buf export` in favor of the `--path` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--source` flag on `buf build` in favor of the first positional parameter.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--source-config` flag on `buf build` in favor of the `--config` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input` flag on `buf lint` in favor of the first positional parameter.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input-config` flag on `buf lint` in favor of the `--config` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input` flag on `buf breaking` in favor of the first positional parameter.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input-config` flag on `buf breaking` in favor of the `--config` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--against-input` flag on `buf breaking` in favor of the `--against` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--against-input-config` flag on `buf breaking` in favor of the `--against-config` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input` flag on `buf generate` in favor of the first positional parameter.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input-config` flag on `buf generate` in favor of the `--config` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input` flag on `buf ls-files` in favor of the first positional parameter.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `--input-config` flag on `buf ls-files` in favor of the `--config` flag.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `buf image build` command in favor of `buf build`.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `buf image convert` command.\n- [From v0.29.0](https://github.com/bufbuild/buf/releases/tag/v0.29.0): Removed the `buf beta image convert` command.\n- [From v0.23.0](https://github.com/bufbuild/buf/releases/tag/v0.23.0): Removed the `buf experimental image convert` command.\n- [From v0.52.0](https://github.com/bufbuild/buf/releases/tag/v0.52.0) [and v0.34.0](https://github.com/bufbuild/buf/releases/tag/v0.34.0): Complete deletion `protoc-gen-buf-check-breaking` and `protoc-gen-buf-check-lint`, which have been moved to `protoc-gen-buf-breaking` and `protoc-gen-buf-lint`.\n\nIn January 2021 (v0.34.0), `protoc-gen-buf-check-breaking` and `protoc-gen-buf-check-lint` were deprecated and scheduled for removal for v1.0. In August 2021 (v0.52.0), we began returning error for every invocation of `protoc-gen-buf-check-breaking` and `protoc-gen-buf-check-lint`. This release completes the deletion process.\n\nThe only migration necessary is to change your installation and invocation from `protoc-gen-buf-check-breaking` to `protoc-gen-buf-breaking` and `protoc-gen-buf-check-lint` to `protoc-gen-buf-lint`. These can be installed in the exact same manner, whether from GitHub Releases, Homebrew, AUR, or direct Go installation:\n\n```\n# instead of go get github.com/bufbuild/buf/cmd/protoc-gen-buf-check-breaking\ngo get github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking\n# instead of curl -sSL https://github.com/bufbuild/buf/releases/download/v0.57.0/protoc-gen-buf-check-breaking-Linux-x86_64\ncurl -sSL https://github.com/bufbuild/buf/releases/download/v0.57.0/protoc-gen-buf-breaking-Linux-x86_64\n```\n\n## [v0.56.0] - 2021-09-08\n\n- Cascade `ENUM_ZERO_VALUE_SUFFIX` comment ignores from the enum level.\n- Fix issue where `buf generate --output` was not being respected in 0.55.0.\n\n## [v0.55.0] - 2021-09-07\n\n- Error if `version:` is not set in `buf.yaml`. This is one of the few breaking changes we must make before v1.0 to guarantee stability for the future. If you do not have a version set, simply add `version: v1beta1` to the top of your `buf.yaml`.\n- Support `BUF_TOKEN` for authentication. `buf` will now look for a token in the `BUF_TOKEN` environment variable, falling back to `.netrc` as set via `buf login`.\n- Add support for using remote plugins with local source files.\n- Add per-file overrides for managed mode.\n- Fix issue with the module cache where multiple simultaneous downloads would result in a temporarily-corrupted cache.\n- Hide verbose messaing behind the `--verbose` (`-v`) flag.\n- Add `--debug` flag to print out debug logging.\n\n## [v0.54.1] - 2021-08-30\n\n- Fix docker build.\n\n## [v0.54.0] - 2021-08-30\n\n- Add windows support.\n- Add `java_package_prefix` support to managed mode.\n- Fix issue with C# namespaces in managed mode.\n- Fix issue where `:main` was appended for errors containing references to modules.\n\n## [v0.53.0] - 2021-08-25\n\n- Fix issue where `buf generate --include-imports` would end up generating files for certain imports twice.\n- Error when both a `buf.mod` and `buf.yaml` are present. `buf.mod` was briefly used as the new default name for `buf.yaml`, but we've reverted back to `buf.yaml`.\n\n## [v0.52.0] - 2021-08-19\n\nReturn error for all invocations of `protoc-gen-buf-check-breaking` and `protoc-gen-buf-check-lint`.\n\nAs one of the few changes buf will ever make, `protoc-gen-buf-check-breaking` and `protoc-gen-buf-check-lint` were deprecated and scheduled for removal for v1.0 in January 2021. In preparation for v1.0, instead of just printing out a message notifying users of this, these commands now return an error for every invocation and will be completely removed when v1.0 is released.\n\nThe only migration necessary is to change your installation and invocation from `protoc-gen-buf-check-breaking` to `protoc-gen-buf-breaking` and `protoc-gen-buf-check-lint` to `protoc-gen-buf-lint`. These can be installed in the exact same manner, whether from GitHub Releases, Homebrew, AUR, or direct Go installation:\n\n```\n# instead of go get github.com/bufbuild/buf/cmd/protoc-gen-buf-check-breaking\ngo get github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking\n# instead of curl -sSL https://github.com/bufbuild/buf/releases/download/v0.52.0/protoc-gen-buf-check-breaking-Linux-x86_64\ncurl -sSL https://github.com/bufbuild/buf/releases/download/v0.52.0/protoc-gen-buf-breaking-Linux-x86_64\n```\n\nThere is no change in functionality.\n\n## [v0.51.1] - 2021-08-16\n\n- Fix issue with git LFS where a remote must be set for fetch.\n\n## [v0.51.0] - 2021-08-13\n\n- Accept packages of the form `v\\d+alpha` and `v\\d+beta` as packages with valid versions. These will be considered unstable packages for the purposes of linting and breaking change detection if `ignore_unstable_packages` is set.\n- Fix issue with git clones that occurred when using a previous reference of the current branch.\n\n## [v0.50.0] - 2021-08-12\n\n- Add `buf generate --include-imports` that also generates all imports except for the Well-Known Types.\n- Fix issue where a deleted file within an unstable package that contained messages, enums, or services resulted in a breaking change failure if the `PACKAGE` category was used and `ignore_unstable_packages` was set.\n\n## [v0.49.0] - 2021-08-10\n\n- Split `FIELD_SAME_TYPE` breaking change rule into `FIELD_SAME_TYPE, FIELD_WIRE_COMPATIBLE_TYPE, FIELD_WIRE_JSON_COMPATIBLE_TYPE` in `v1`. See https://github.com/bufbuild/buf/pull/400 for details.\n- Only export imported dependencies from `buf export`.\n\n## [v0.48.2] - 2021-07-30\n\n- Fix git args for http auth with git lfs.\n\n## [v0.48.1] - 2021-07-30\n\n- Fix: use `-c` on `git` parent command instead of `--config` on `git fetch`.\n- Add `ruby_package` to managed mode.\n\n## [v0.48.0] - 2021-07-29\n\n- Add `buf export`. `buf export` will export the files from the specified input (default `\".\"`) to the given directory in a manner that is buildable by `protoc` without any `-I` flags. It also has options `--exclude-imports`, which excludes imports (and won't result in a buildable set of files), and `--path`, which filters to the specific paths.\n\n## [v0.47.0] - 2021-07-29\n\n- Rewrite the git cloner to use `git init && git fetch` rather than `git clone`. `git clone` is limited to local branches on the remote, whereas `git fetch` we can fetch any references on the remote including remote branches.\n- Add `php_namespace` managed mode handling.\n- Add `java_string_check_utf8` managed mode handling.\n\n## [v0.46.0] - 2021-07-27\n\n- Add `buf login` and `buf logout` to login and logout from the Buf Schema Registry.\n- Fix cache, configuration, and data environment variables for Windows. Note that while Windows is still not officially supported, `buf` largely works on Windows.\n\n## [v0.45.0] - 2021-07-26\n\n- Revert default configuration file location back from `buf.mod` to `buf.yaml`. Note that both continue to work.\n- Move default workspace configuration file location from `buf.work` to `buf.work.yaml`. Note that both continue to work.\n- Move `buf beta push` to `buf push`. Note that `buf beta push` continues to work.\n- Move most `buf beta mod` commands to `buf mod`. Note that all `buf beta mod` commands continue to work.\n- Add `--only` flag to `buf mod update`.\n- Warn if `buf.yaml` contains dependencies that are not represented in the `buf.lock` file.\n- Add `--version` flag to `buf config ls-{breaking,lint}-rules`.\n- Add `SYNTAX_SPECIFIED` lint rule to `BASIC, DEFAULT` categories for v1 configuration.\n- Add `IMPORT_USED` lint rule to `BASIC, DEFAULT` categories for v1 configuration.\n- Bring v1 configuration out of beta.\n- Add managed mode for `objc_class_prefix`, `csharp_namespace`.\n\n## [v0.44.0] - 2021-07-08\n\n- Fix issue where C++ scoping rules were not properly enforced.\n- Add support for splitting directory paths passed to `buf protoc -I` by a directory separator.\n- Fix Windows support for builtin `protoc` plugins when using `buf generate` or `buf protoc`. Note that Windows remains officially unsupported as we have not set up testing, but largely works.\n- Upgrade to `protoc` 3.17.3 support.\n- Change the default module configuration location from `buf.yaml` to `buf.mod`. Note that `buf.yaml` continues to work.\n- Continued work on the workspaces beta, including the `v1` configuration specification.\n- Continued work on the managed mode beta, including the `v1` configuration specification.\n- Add `v1` module configuration specification in beta - please continue to use `v1beta1` until the `v1` configuration specification is rolled out.\n- Add `buf config migrate-v1beta1`.\n\n## [v0.43.2] - 2021-05-31\n\n- Fix namespace resolution diff with protoc.\n\n## [v0.43.1] - 2021-05-28\n\n- Revert `protoc` namespace resolution diff change.\n\n## [v0.43.0] - 2021-05-28\n\n- Do not count `buf:lint:ignore` directives as valid comments for the `COMMENT_.*` lint rules.\n- Upgrade to `protoc` 3.17.1 support.\n- Fix namespace resolution diff with `protoc`.\n\n## [v0.42.1] - 2021-05-20\n\n- Change the architecture suffix of the Linux ARM release assets from `arm64` to `aarch64` to match the output of `uname -m` on Linux.\n\n## [v0.42.0] - 2021-05-20\n\n- Add managed mode in beta. This is a new feature that automatically sets file option values.\n- Add workspaces in beta. This is a new feature that allows multiple modules within the same directory structure.\n- Add arm64 releases.\n\n## [v0.41.0] - 2021-04-01\n\n* Add `MESSAGE_SAME_REQUIRED_FIELDS` breaking change rule. This checks to make sure no `required` fields are added or deleted from existing messages.\n* Support multi-architecture Docker image.\n* Exit with code 100 for `FileAnnotation` errors.\n\n## [v0.40.0] - 2021-03-15\n\n* Add `buf beta registry tag {create,list}` commands.\n* Add support for creating tags in `push` via `buf beta push -t`.\n* Fix an issue where errors were unnecessarily written in `buf lint` and `buf breaking`.\n\n## [v0.39.1] - 2021-03-04\n\n- Fix issue with CLI build process in 0.39.0.\n\n## [v0.39.0] - 2021-03-04\n\n* `buf beta push` doesn't create a new commit if the content of the push is the same as the latest commit on the branch.\n* Fix an issue where no error was shown when authentication failed.\n* Fix an issue where `buf protoc` would error if a plugin returned an empty error string.\n\n## [v0.38.0] - 2021-02-25\n\n- Update the tested `protoc` version for compatibility to 3.15.2. The `--experimental_allow_proto3_optional` flag is no longer set for versions >=3.15.\n- Update the Well-Known Types to 3.15.2. The `go_package` values for the Well-Known Types now point at google.golang.org/protobuf instead of github.com/golang/protobuf.\n\n## [v0.37.1] - 2021-02-23\n\n- Fix bug where authentication headers were not threaded through for certain Buf Schema Registry commands.\n- Fix issue where empty errors would incorrectly be wrapped by the CLI interceptor.\n- Update Buf module cache location to include remote.\n\n## [v0.37.0] - 2021-02-09\n\n- Add commands for the Buf Schema Registry. Visit our website to add yourself to [the waitlist](https://buf.build/waitlist).\n\n## [v0.36.0] - 2021-01-18\n\nAllows comment ignores of the form `// buf:lint:ignore ID` to be cascaded upwards for specific rules.\n\n- For  `ENUM_VALUE_PREFIX, ENUM_VALUE_UPPER_SNAKE_CASE`, both the enum value and the enum are checked.\n- For `FIELD_LOWER_SNAKE_CASE, FIELD_NO_DESCRIPTOR`, both the field and message are checked.\n- For `ONEOF_LOWER_SNAKE_CASE`, both the oneof and message are checked.\n- For `RPC_NO_CLIENT_STREAMING, RPC_NO_SERVER_STREAMING, RPC_PASCAL_CASE, RPC_REQUEST_RESPONSE_UNIQUE`, both the method and service are checked.\n- For `RPC_REQUEST_STANDARD_NAME, RPC_RESPONSE_STANDARD_NAME`, the input/output type, method, and service are checked.\n\n## [v0.35.1] - 2021-01-08\n\n- Fix error when unmarshalling plugin configuration with no options (#236)\n\n## [v0.35.0] - 2021-01-07\n\n- Allow `opt` in `buf.gen.yaml` files to be either a single string, or a list of strings. Both of the following forms are accepted, and result in `foo=bar,baz,bat`:\n\n```yaml\nversion: v1beta1\nplugins:\n  - name: foo\n    out: out\n    opt: foo=bar,baz,bat\n```\n\n```yaml\nversion: v1beta1\nplugins:\n  - name: foo\n    out: out\n    opt:\n      - foo=bar\n      - baz\n      - bat\n```\n\n## [v0.34.0] - 2021-01-04\n\n- Move `buf check lint` to `buf lint`.\n- Move `buf check breaking` to `buf breaking`.\n- Move `buf check ls-lint-checkers` to `buf config ls-lint-rules`.\n- Move `buf check ls-breaking-checkers` to `buf config ls-breaking-rules`.\n- Move `protoc-gen-buf-check-lint` to `protoc-gen-buf-lint`.\n- Move `protoc-gen-buf-check-breaking` to `protoc-gen-buf-breaking`.\n- Add `buf beta config init`.\n\nAll previous commands continue to work in a backwards-compatible manner, and the previous `protoc-gen-buf-check-lint` and `protoc-gen-buf-check-breaking` binaries continue to be available at the same paths, however deprecation messages are printed.\n\n## [v0.33.0] - 2020-12-12\n\n- Add `strategy` option to `buf.gen.yaml` generation configuration. This allows selecting either plugin invocations with files on a per-directory basis, or plugin invocations with all files at once. See the [generation documentation](https://docs.buf.build/generate-usage) for more details.\n\n## [v0.32.1] - 2020-12-10\n\n- Fix issue where `SourceCodeInfo` for map fields within nested messages could be dropped.\n- Fix issue where deleted files would cause a panic when `breaking.ignore_unstable_packages = true`.\n\n## [v0.32.0] - 2020-11-24\n\n- Add symlink support for directory inputs. Symlinks will now be followed within your local directories when running `buf` commands.\n- Add the `breaking.ignore_unstable_packages` option to allow ignoring of unstable packages when running `buf check breaking`. See [the documentation](https://docs.buf.build/breaking-configuration#ignore_unstable_packages) for more details.\n- Enums that use the `allow_alias` option that add new aliases to a given number will no longer be considered breaking by `ENUM_VALUE_SAME_NAME`. See [the documentation](https://docs.buf.build/breaking-checkers#enum_value_same_name) for more details.\n\n## [v0.31.1] - 2020-11-17\n\n- Fix issue where `--experimental_allow_proto3_optional` was not set when proxying to `protoc` for the builtin plugins via `buf generate` or `buf protoc`. This flag is now set for `protoc` versions >= 3.12.\n\n## [v0.31.0] - 2020-11-16\n\n- Change the `--file` flag to `--path` and allow `--path` to take both files and directories, instead of just files with the old `--file`. This flag is used to filter the actual Protobuf files built under an input for most commands. You can now do for example `buf generate --path proto/foo` to only generate stubs for the files under `proto/foo`. Note that the `--file` flag continues to work, but prints a deprecation message.\n\n## [v0.30.1] - 2020-11-12\n\n- Relax validation of response file names from protoc plugins, so that when possible, plugins that are not compliant with the plugin specification are still usable with `buf generate`.\n\n## [v0.30.0] - 2020-11-03\n\n- Add `git://` protocol handling.\n\n## [v0.29.0] - 2020-10-30\n\nAs we work towards v1.0, we are cleaning up the CLI UX. As part of this, we made the following changes:\n\n- `buf image build` has been moved to `buf build` and now accepts images as inputs.\n- `buf beta image convert` has been deleted, as `buf build` now covers this functionality.\n- The `-o` flag is no longer required for `buf build`, instead defaulting to the OS equivalent of `/dev/null`.\n- The `--source` flag on `buf build` has been deprecated in favor of passing the input as the first argument.\n- The `--source-config` flag on `buf build` has been moved to `--config`.\n- The `--input` flag on `buf check lint` has been deprecated in favor of passing the input as the first argument.\n- The `--input-config` flag on `buf check lint` has been moved to `--config`.\n- The `--input` flag on `buf check breaking` has been deprecated in favor of passing the input as the first argument.\n- The `--input-config` flag on `buf check breaking` has been moved to `--config`.\n- The `--against-input` flag on `buf check breaking` has been moved to `--against`.\n- The `--against-input-config` flag on `buf check breaking` has been moved to `--against-config`.\n- The `--input` flag on `buf generate` has been deprecated in favor of passing the input as the first argument.\n- The `--input-config` flag on `buf generate` has been moved to `--config`.\n- The `--input` flag on `buf ls-files` has been deprecated in favor of passing the input as the first argument.\n- The `--input-config` flag on `buf ls-files` has been moved to `--config`.\n\nWe feel these changes make using `buf` more natural. Examples:\n\n```\n# compile the files in the current directory\nbuf build\n# equivalent to the default no-arg invocation\nbuf build .\n# build the repository at https://github.com/foo/bar.git\nbuf build https://github.com/foo/bar.git\n# lint the files in the proto directory\nbuf check lint proto\n# check the files in the current directory against the files on the master branch for breaking changes\nbuf check breaking --against .git#branch=master\n# check the files in the proto directory against the files in the proto directory on the master branch\nbuf check breaking proto --against .git#branch=master,subdir=proto\n```\n\n**Note that existing commands and flags continue to work.** While the deprecation messages will be printed, and we recommend migrating to the new invocations, your existing invocations have no change in functionality.\n\n## [v0.28.0] - 2020-10-21\n\n- Add `subdir` option for archive and git [Inputs](https://buf.build/docs/inputs). This allows placement of the `buf.yaml` configuration file in directories other than the base of your repository. You then can check against this subdirectory using, for example, `buf check breaking --against-input https://github.com/foo/bar.git#subdir=proto`.\n\n## [v0.27.1] - 2020-10-16\n\n- Fix minor typo in `buf help generate` documentation.\n\n## [v0.27.0] - 2020-10-16\n\n- Move `buf beta generate` out of beta to `buf generate`. This command now uses a template of configured plugins to generate stubs. See `buf help generate` for more details.\n\n## [v0.26.0] - 2020-10-13\n\n- Add jar and zip support to `buf protoc` and `buf beta generate`.\n\n## [v0.25.0] - 2020-10-09\n\n- Add the concept of configuration file version. The only currently-available version is `v1beta1`. See [buf.build/docs/faq](https://buf.build/docs/faq) for more details.\n\n## [v0.24.0] - 2020-09-21\n\n- Add fish completion to releases.\n- Update the `protoc` version for `buf protoc` to be `3.13.0`.\n\n## [v0.23.0] - 2020-09-11\n\n- Move the `experimental` parent command to `beta`. The command `buf experimental image convert` continues to work, but is deprecated in favor of `buf beta image convert`.\n- Add `buf beta generate`.\n\n## [v0.22.0] - 2020-09-09\n\n- Add [insertion point](https://github.com/protocolbuffers/protobuf/blob/cdf5022ada7159f0c82888bebee026cbbf4ac697/src/google/protobuf/compiler/plugin.proto#L135) support to `buf protoc`.\n\n## [v0.21.0] - 2020-09-02\n\n- Fix issue where `optional` fields in proto3 would cause the `ONEOF_LOWER_SNAKE_CASE` lint checker to fail.\n\n## [v0.20.5] - 2020-07-24\n\n- Fix issue where parser would fail on files starting with [byte order marks](https://en.wikipedia.org/wiki/Byte_order_mark#UTF-8).\n\n## [v0.20.4] - 2020-07-21\n\n- Fix issue where custom message options that had an unset map field could cause a parser failure.\n\n## [v0.20.3] - 2020-07-18\n\n- Fix issue where parameters passed with `--.*_opt` to `buf protoc` for builtin plugins were not properly propagated.\n\n## [v0.20.2] - 2020-07-17\n\n- Fix issue where roots containing non-proto files with the same path would cause an error.\n\n## [v0.20.1] - 2020-07-14\n\n- Fix issue where Zsh completion would fail due to some flags having brackets in their description.\n- Fix issue where non-builtin protoc plugin invocations would not have errors properly propagated.\n- Fix issue where multiple `--.*_opt` flags, `--.*_opt` flags with commas, or `--.*_out` flags with options that contained commas, would not be properly added.\n\n## [v0.20.0] - 2020-07-13\n\n- Add `--by-dir` flag to `buf protoc` that parallelizes generation per directory, resulting in a 25-75% reduction in the time taken to generate stubs for medium to large file sets.\n- Properly clean up temporary files and commands on interrupts.\n- Fix issue where certain files that started with invalid Protobuf would cause the parser to crash.\n\n## [v0.19.1] - 2020-07-10\n\n- Fix issue where stderr was not being propagated for protoc plugins in CLI mode.\n\n## [v0.19.0] - 2020-07-10\n\n- Add `protoc` command. This is a substitute for `protoc` that uses Buf's internal compiler.\n- Add `ENUM_FIRST_VALUE_ZERO` lint checker to the `OTHER` category.\n- Add support for the Visual Studio error format.\n\n## [v0.18.1] - 2020-06-25\n\n- Fix issue where linking errors for custom options that had a message type were not properly reported (#93)\n\n## [v0.18.0] - 2020-06-22\n\n- Handle custom options when marshalling JSON images (#87).\n- Add `buf experimental image convert` command to convert to/from binary/JSON images (#87).\n\n## [v0.17.0] - 2020-06-17\n\n- Add git ref support to allow specifying arbitrary git references as inputs (https://github.com/bufbuild/buf/issues/48). This allows you to do i.e. `buf check lint --input https://github.com/bufbuild/buf.git#ref=fa74aa9c4161304dfa83db4abc4a0effe886d253`.\n- Add `depth` input option when specifying git inputs with `ref`. This allows the user to configure the depth at which to clone the repository when looking for the `ref`. If specifying a `ref`, this defaults to 50. Otherwise, this defaults to 1.\n- Remove requirement for git branch or tag in inputs. This allows you to do i.e. `buf check lint --input https://github.com/bufbuild/buf.git` and it will automatically choose the default branch as an input.\n\n## [v0.16.0] - 2020-06-02\n\n- Add [proto3 optional](https://github.com/protocolbuffers/protobuf/blob/7cb5597013f0c4b978f02bce4330849f118aa853/docs/field_presence.md#how-to-enable-explicit-presence-in-proto3) support.\n\n## [v0.15.0] - 2020-05-31\n\n- Add opt-in comment-driven lint ignores via the `allow_comment_ignores` lint configuration option and `buf:lint:ignore ID` leading comment annotation (#73).\n\n## [v0.14.0] - 2020-05-30\n\n- Add `--file` flag to `buf image build` to only add specific files and their imports to outputted images. To exclude imports, use `--exclude-imports`.\n- Add `zip` as a source format. Buf can now read `zip` files, either locally or remotely, for image building, linting, and breaking change detection.\n- Add `zstd` as a compression format. Buf can now read and write Image files that are compressed using zstandard, and can read tarballs compressed with zstandard.\n- Deprecated: The formats `bingz, jsongz, targz` are now deprecated. Instead, use `format=bin,compression=gzip`, `format=json,compression=gzip`, or `format=tar,compression=gzip`. The formats `bingz, jsongz, targz` will continue to work forever and will not be broken, but will print a deprecation warning and we recommend updating. Automatic file extension parsing continues to work the same as well.\n\n## [v0.13.0] - 2020-05-17\n\n- Use the `git` binary instead of go-git for internal clones. This also enables using your system git credential management for git repositories cloned using https or ssh. See https://buf.build/docs/inputs#authentication for more details.\n\n## [v0.12.1] - 2020-05-11\n\n- Fix issue where roots were detected as overlapping if one root's name was a prefix of the other.\n\n## [v0.12.0] - 2020-05-11\n\n- Add netrc support for inputs.\n- Fix issue where filenames that contained `..` resulted in an error.\n- Internal: migrate to golang/protobuf v2.\n\n## [v0.11.0] - 2020-04-09\n\n- Add experimental flag `--experimental-git-clone` to use the `git` binary for git clones.\n\n## [v0.10.0] - 2020-04-06\n\n- Add `recurse_submodules` option for git inputs.\n  Example: `https://github.com/foo/bar.git#branch=master,recurse_submodules=true`\n\n## [v0.9.0] - 2020-03-25\n\n- Fix issue where the option value ordering on an outputted `Image` was non-deterministic.\n- Fix issue where the `SourceCodeInfo` for the Well-Known Types was not included on an outputted `Image` when requested.\n\n## [v0.8.0] - 2020-03-11\n\n- Update dependencies.\n\n## [v0.7.1] - 2020-03-05\n\n- Tie HTTP download timeout to the `--timeout` flag.\n\n## [v0.7.0] - 2020-01-31\n\n- Add `tag` option for git inputs.\n\n## [v0.6.0] - 2020-01-17\n\n- Add `git` to the Docker container for local filesystem clones.\n- Update the JSON error format to use `path` as the file path key instead of `filename`.\n\n## [v0.5.0] - 2020-01-01\n\n- Allow basic authentication for remote tarballs, git repositories, and image files served from HTTPS endpoints. See https://buf.build/docs/inputs#https for more details.\n- Allow public key authentication for remote git repositories served from SSH endpoints. See https://buf.build/docs/inputs#ssh for more details.\n\n## [v0.4.1] - 2019-12-30\n\n- Fix issue where comparing enum values for enums that have `allow_alias` set and duplicate enum values present resulted in a system error.\n\n## [v0.4.0] - 2019-12-05\n\n- Change the breaking change detector to compare enum values on number instead of name. This also results in the `ENUM_VALUE_SAME_NUMBER` checker being replaced with the `ENUM_VALUE_SAME_NAME` checker, except this new checker is not in the `WIRE` category.\n\n## [v0.3.0] - 2019-11-05\n\n- Fix issue where multiple timeout errors were printed.\n- Add `buf check lint --error-format=config-ignore-yaml` to print out current lint errors in a format that can be copied into a configuration file.\n\n## [v0.2.0] - 2019-10-28\n\n- Add a Docker image for the `buf` binary.\n\n## v0.1.0 - 2019-10-18\n\nInitial beta release.\n\n[Unreleased]: https://github.com/bufbuild/buf/compare/v1.66.1...HEAD\n[v1.66.1]: https://github.com/bufbuild/buf/compare/v1.66.0...v1.66.1\n[v1.66.0]: https://github.com/bufbuild/buf/compare/v1.65.0...v1.66.0\n[v1.65.0]: https://github.com/bufbuild/buf/compare/v1.64.0...v1.65.0\n[v1.64.0]: https://github.com/bufbuild/buf/compare/v1.63.0...v1.64.0\n[v1.63.0]: https://github.com/bufbuild/buf/compare/v1.62.1...v1.63.0\n[v1.62.1]: https://github.com/bufbuild/buf/compare/v1.62.0...v1.62.1\n[v1.62.0]: https://github.com/bufbuild/buf/compare/v1.61.0...v1.62.0\n[v1.61.0]: https://github.com/bufbuild/buf/compare/v1.60.0...v1.61.0\n[v1.60.0]: https://github.com/bufbuild/buf/compare/v1.59.0...v1.60.0\n[v1.59.0]: https://github.com/bufbuild/buf/compare/v1.58.0...v1.59.0\n[v1.58.0]: https://github.com/bufbuild/buf/compare/v1.57.2...v1.58.0\n[v1.57.2]: https://github.com/bufbuild/buf/compare/v1.57.1...v1.57.2\n[v1.57.1]: https://github.com/bufbuild/buf/compare/v1.57.0...v1.57.1\n[v1.57.0]: https://github.com/bufbuild/buf/compare/v1.56.0...v1.57.0\n[v1.56.0]: https://github.com/bufbuild/buf/compare/v1.55.1...v1.56.0\n[v1.55.1]: https://github.com/bufbuild/buf/compare/v1.55.0...v1.55.1\n[v1.55.0]: https://github.com/bufbuild/buf/compare/v1.54.0...v1.55.0\n[v1.54.0]: https://github.com/bufbuild/buf/compare/v1.53.0...v1.54.0\n[v1.53.0]: https://github.com/bufbuild/buf/compare/v1.52.1...v1.53.0\n[v1.52.1]: https://github.com/bufbuild/buf/compare/v1.52.0...v1.52.1\n[v1.52.0]: https://github.com/bufbuild/buf/compare/v1.51.0...v1.52.0\n[v1.51.0]: https://github.com/bufbuild/buf/compare/v1.50.1...v1.51.0\n[v1.50.1]: https://github.com/bufbuild/buf/compare/v1.50.0...v1.50.1\n[v1.50.0]: https://github.com/bufbuild/buf/compare/v1.49.0...v1.50.0\n[v1.49.0]: https://github.com/bufbuild/buf/compare/v1.48.0...v1.49.0\n[v1.48.0]: https://github.com/bufbuild/buf/compare/v1.47.2...v1.48.0\n[v1.47.2]: https://github.com/bufbuild/buf/compare/v1.47.1...v1.47.2\n[v1.47.1]: https://github.com/bufbuild/buf/compare/v1.47.0...v1.47.1\n[v1.47.0]: https://github.com/bufbuild/buf/compare/v1.46.0...v1.47.0\n[v1.46.0]: https://github.com/bufbuild/buf/compare/v1.45.0...v1.46.0\n[v1.45.0]: https://github.com/bufbuild/buf/compare/v1.44.0...v1.45.0\n[v1.44.0]: https://github.com/bufbuild/buf/compare/v1.43.0...v1.44.0\n[v1.43.0]: https://github.com/bufbuild/buf/compare/v1.42.0...v1.43.0\n[v1.42.0]: https://github.com/bufbuild/buf/compare/v1.41.0...v1.42.0\n[v1.41.0]: https://github.com/bufbuild/buf/compare/v1.40.1...v1.41.0\n[v1.40.1]: https://github.com/bufbuild/buf/compare/v1.40.0...v1.40.1\n[v1.40.0]: https://github.com/bufbuild/buf/compare/v1.39.0...v1.40.0\n[v1.39.0]: https://github.com/bufbuild/buf/compare/v1.38.0...v1.39.0\n[v1.38.0]: https://github.com/bufbuild/buf/compare/v1.37.0...v1.38.0\n[v1.37.0]: https://github.com/bufbuild/buf/compare/v1.36.0...v1.37.0\n[v1.36.0]: https://github.com/bufbuild/buf/compare/v1.35.1...v1.36.0\n[v1.35.1]: https://github.com/bufbuild/buf/compare/v1.35.0...v1.35.1\n[v1.35.0]: https://github.com/bufbuild/buf/compare/v1.34.0...v1.35.0\n[v1.34.0]: https://github.com/bufbuild/buf/compare/v1.33.0...v1.34.0\n[v1.33.0]: https://github.com/bufbuild/buf/compare/v1.32.2...v1.33.0\n[v1.32.2]: https://github.com/bufbuild/buf/compare/v1.32.1...v1.32.2\n[v1.32.1]: https://github.com/bufbuild/buf/compare/v1.32.0...v1.32.1\n[v1.32.0]: https://github.com/bufbuild/buf/compare/v1.32.0-beta.1...v1.32.0\n[v1.32.0-beta.1]: https://github.com/bufbuild/buf/compare/v1.31.0...v1.32.0-beta.1\n[v1.31.0]: https://github.com/bufbuild/buf/compare/v1.30.1...v1.31.0\n[v1.30.1]: https://github.com/bufbuild/buf/compare/v1.30.0...v1.30.1\n[v1.30.0]: https://github.com/bufbuild/buf/compare/v1.29.0...v1.30.0\n[v1.29.0]: https://github.com/bufbuild/buf/compare/v1.28.1...v1.29.0\n[v1.28.1]: https://github.com/bufbuild/buf/compare/v1.28.0...v1.28.1\n[v1.28.0]: https://github.com/bufbuild/buf/compare/v1.27.2...v1.28.0\n[v1.27.2]: https://github.com/bufbuild/buf/compare/v1.27.1...v1.27.2\n[v1.27.1]: https://github.com/bufbuild/buf/compare/v1.27.0...v1.27.1\n[v1.27.0]: https://github.com/bufbuild/buf/compare/v1.26.1...v1.27.0\n[v1.26.1]: https://github.com/bufbuild/buf/compare/v1.26.0...v1.26.1\n[v1.26.0]: https://github.com/bufbuild/buf/compare/v1.25.1...v1.26.0\n[v1.25.1]: https://github.com/bufbuild/buf/compare/v1.25.0...v1.25.1\n[v1.25.0]: https://github.com/bufbuild/buf/compare/v1.24.0...v1.25.0\n[v1.24.0]: https://github.com/bufbuild/buf/compare/v1.23.1...v1.24.0\n[v1.23.1]: https://github.com/bufbuild/buf/compare/v1.23.0...v1.23.1\n[v1.23.0]: https://github.com/bufbuild/buf/compare/v1.22.0...v1.23.0\n[v1.22.0]: https://github.com/bufbuild/buf/compare/v1.21.0...v1.22.0\n[v1.21.0]: https://github.com/bufbuild/buf/compare/v1.20.0...v1.21.0\n[v1.20.0]: https://github.com/bufbuild/buf/compare/v1.19.0...v1.20.0\n[v1.19.0]: https://github.com/bufbuild/buf/compare/v1.18.0...v1.19.0\n[v1.18.0]: https://github.com/bufbuild/buf/compare/v1.17.0...v1.18.0\n[v1.17.0]: https://github.com/bufbuild/buf/compare/v1.16.0...v1.17.0\n[v1.16.0]: https://github.com/bufbuild/buf/compare/v1.15.1...v1.16.0\n[v1.15.1]: https://github.com/bufbuild/buf/compare/v1.15.0...v1.15.1\n[v1.15.0]: https://github.com/bufbuild/buf/compare/v1.14.0...v1.15.0\n[v1.14.0]: https://github.com/bufbuild/buf/compare/v1.13.1...v1.14.0\n[v1.13.1]: https://github.com/bufbuild/buf/compare/v1.13.0...v1.13.1\n[v1.13.0]: https://github.com/bufbuild/buf/compare/v1.12.0...v1.13.0\n[v1.12.0]: https://github.com/bufbuild/buf/compare/v1.11.0...v1.12.0\n[v1.11.0]: https://github.com/bufbuild/buf/compare/v1.10.0...v1.11.0\n[v1.10.0]: https://github.com/bufbuild/buf/compare/v1.9.0...v1.10.0\n[v1.9.0]: https://github.com/bufbuild/buf/compare/v1.8.0...v1.9.0\n[v1.8.0]: https://github.com/bufbuild/buf/compare/v1.7.0...v1.8.0\n[v1.7.0]: https://github.com/bufbuild/buf/compare/v1.6.0...v1.7.0\n[v1.6.0]: https://github.com/bufbuild/buf/compare/v1.5.0...v1.6.0\n[v1.5.0]: https://github.com/bufbuild/buf/compare/v1.4.0...v1.5.0\n[v1.4.0]: https://github.com/bufbuild/buf/compare/v1.3.1...v1.4.0\n[v1.3.1]: https://github.com/bufbuild/buf/compare/v1.3.0...v1.3.1\n[v1.3.0]: https://github.com/bufbuild/buf/compare/v1.2.1...1.3.0\n[v1.2.1]: https://github.com/bufbuild/buf/compare/v1.2.0...v1.2.1\n[v1.2.0]: https://github.com/bufbuild/buf/compare/v1.1.1...v1.2.0\n[v1.1.1]: https://github.com/bufbuild/buf/compare/v1.1.0...v1.1.1\n[v1.1.0]: https://github.com/bufbuild/buf/compare/v1.0.0...v1.1.0\n[v1.0.0]: https://github.com/bufbuild/buf/compare/v1.0.0-rc12...v1.0.0\n[v1.0.0-rc12]: https://github.com/bufbuild/buf/compare/v1.0.0-rc11...v1.0.0-rc12\n[v1.0.0-rc11]: https://github.com/bufbuild/buf/compare/v1.0.0-rc10...v1.0.0-rc11\n[v1.0.0-rc10]: https://github.com/bufbuild/buf/compare/v1.0.0-rc9...v1.0.0-rc10\n[v1.0.0-rc9]: https://github.com/bufbuild/buf/compare/v1.0.0-rc8...v1.0.0-rc9\n[v1.0.0-rc8]: https://github.com/bufbuild/buf/compare/v1.0.0-rc7...v1.0.0-rc8\n[v1.0.0-rc7]: https://github.com/bufbuild/buf/compare/v1.0.0-rc6...v1.0.0-rc7\n[v1.0.0-rc6]: https://github.com/bufbuild/buf/compare/v1.0.0-rc5...v1.0.0-rc6\n[v1.0.0-rc5]: https://github.com/bufbuild/buf/compare/v1.0.0-rc4...v1.0.0-rc5\n[v1.0.0-rc4]: https://github.com/bufbuild/buf/compare/v1.0.0-rc3...v1.0.0-rc4\n[v1.0.0-rc3]: https://github.com/bufbuild/buf/compare/v1.0.0-rc2...v1.0.0-rc3\n[v1.0.0-rc2]: https://github.com/bufbuild/buf/compare/v1.0.0-rc1...v1.0.0-rc2\n[v1.0.0-rc1]: https://github.com/bufbuild/buf/compare/v0.56.0...v1.0.0-rc1\n[v0.56.0]: https://github.com/bufbuild/buf/compare/v0.55.0...v0.56.0\n[v0.55.0]: https://github.com/bufbuild/buf/compare/v0.54.1...v0.55.0\n[v0.54.1]: https://github.com/bufbuild/buf/compare/v0.54.0...v0.54.1\n[v0.54.0]: https://github.com/bufbuild/buf/compare/v0.53.0...v0.54.0\n[v0.53.0]: https://github.com/bufbuild/buf/compare/v0.52.0...v0.53.0\n[v0.52.0]: https://github.com/bufbuild/buf/compare/v0.51.1...v0.52.0\n[v0.51.1]: https://github.com/bufbuild/buf/compare/v0.51.0...v0.51.1\n[v0.51.0]: https://github.com/bufbuild/buf/compare/v0.50.0...v0.51.0\n[v0.50.0]: https://github.com/bufbuild/buf/compare/v0.49.0...v0.50.0\n[v0.49.0]: https://github.com/bufbuild/buf/compare/v0.48.2...v0.49.0\n[v0.48.2]: https://github.com/bufbuild/buf/compare/v0.48.1...v0.48.2\n[v0.48.1]: https://github.com/bufbuild/buf/compare/v0.48.0...v0.48.1\n[v0.48.0]: https://github.com/bufbuild/buf/compare/v0.47.0...v0.48.0\n[v0.47.0]: https://github.com/bufbuild/buf/compare/v0.46.0...v0.47.0\n[v0.46.0]: https://github.com/bufbuild/buf/compare/v0.45.0...v0.46.0\n[v0.45.0]: https://github.com/bufbuild/buf/compare/v0.44.0...v0.45.0\n[v0.44.0]: https://github.com/bufbuild/buf/compare/v0.43.2...v0.44.0\n[v0.43.2]: https://github.com/bufbuild/buf/compare/v0.43.1...v0.43.2\n[v0.43.1]: https://github.com/bufbuild/buf/compare/v0.43.0...v0.43.1\n[v0.43.0]: https://github.com/bufbuild/buf/compare/v0.42.1...v0.43.0\n[v0.42.1]: https://github.com/bufbuild/buf/compare/v0.42.0...v0.42.1\n[v0.42.0]: https://github.com/bufbuild/buf/compare/v0.41.0...v0.42.0\n[v0.41.0]: https://github.com/bufbuild/buf/compare/v0.40.0...v0.41.0\n[v0.40.0]: https://github.com/bufbuild/buf/compare/v0.39.1...v0.40.0\n[v0.39.1]: https://github.com/bufbuild/buf/compare/v0.39.0...v0.39.1\n[v0.39.0]: https://github.com/bufbuild/buf/compare/v0.38.0...v0.39.0\n[v0.38.0]: https://github.com/bufbuild/buf/compare/v0.37.1...v0.38.0\n[v0.37.1]: https://github.com/bufbuild/buf/compare/v0.37.0...v0.37.1\n[v0.37.0]: https://github.com/bufbuild/buf/compare/v0.36.0...v0.37.0\n[v0.36.0]: https://github.com/bufbuild/buf/compare/v0.35.1...v0.36.0\n[v0.35.1]: https://github.com/bufbuild/buf/compare/v0.35.0...v0.35.1\n[v0.35.0]: https://github.com/bufbuild/buf/compare/v0.34.0...v0.35.0\n[v0.34.0]: https://github.com/bufbuild/buf/compare/v0.33.0...v0.34.0\n[v0.33.0]: https://github.com/bufbuild/buf/compare/v0.32.1...v0.33.0\n[v0.32.1]: https://github.com/bufbuild/buf/compare/v0.32.0...v0.32.1\n[v0.32.0]: https://github.com/bufbuild/buf/compare/v0.31.1...v0.32.0\n[v0.31.1]: https://github.com/bufbuild/buf/compare/v0.31.0...v0.31.1\n[v0.31.0]: https://github.com/bufbuild/buf/compare/v0.30.1...v0.31.0\n[v0.30.1]: https://github.com/bufbuild/buf/compare/v0.30.0...v0.30.1\n[v0.30.0]: https://github.com/bufbuild/buf/compare/v0.29.0...v0.30.0\n[v0.29.0]: https://github.com/bufbuild/buf/compare/v0.28.0...v0.29.0\n[v0.28.0]: https://github.com/bufbuild/buf/compare/v0.27.1...v0.28.0\n[v0.27.1]: https://github.com/bufbuild/buf/compare/v0.27.0...v0.27.1\n[v0.27.0]: https://github.com/bufbuild/buf/compare/v0.26.0...v0.27.0\n[v0.26.0]: https://github.com/bufbuild/buf/compare/v0.25.0...v0.26.0\n[v0.25.0]: https://github.com/bufbuild/buf/compare/v0.24.0...v0.25.0\n[v0.24.0]: https://github.com/bufbuild/buf/compare/v0.23.0...v0.24.0\n[v0.23.0]: https://github.com/bufbuild/buf/compare/v0.22.0...v0.23.0\n[v0.22.0]: https://github.com/bufbuild/buf/compare/v0.21.0...v0.22.0\n[v0.21.0]: https://github.com/bufbuild/buf/compare/v0.20.5...v0.21.0\n[v0.20.5]: https://github.com/bufbuild/buf/compare/v0.20.4...v0.20.5\n[v0.20.4]: https://github.com/bufbuild/buf/compare/v0.20.3...v0.20.4\n[v0.20.3]: https://github.com/bufbuild/buf/compare/v0.20.2...v0.20.3\n[v0.20.2]: https://github.com/bufbuild/buf/compare/v0.20.1...v0.20.2\n[v0.20.1]: https://github.com/bufbuild/buf/compare/v0.20.0...v0.20.1\n[v0.20.0]: https://github.com/bufbuild/buf/compare/v0.19.1...v0.20.0\n[v0.19.1]: https://github.com/bufbuild/buf/compare/v0.19.0...v0.19.1\n[v0.19.0]: https://github.com/bufbuild/buf/compare/v0.18.1...v0.19.0\n[v0.18.1]: https://github.com/bufbuild/buf/compare/v0.18.0...v0.18.1\n[v0.18.0]: https://github.com/bufbuild/buf/compare/v0.17.0...v0.18.0\n[v0.17.0]: https://github.com/bufbuild/buf/compare/v0.16.0...v0.17.0\n[v0.16.0]: https://github.com/bufbuild/buf/compare/v0.15.0...v0.16.0\n[v0.15.0]: https://github.com/bufbuild/buf/compare/v0.14.0...v0.15.0\n[v0.14.0]: https://github.com/bufbuild/buf/compare/v0.13.0...v0.14.0\n[v0.13.0]: https://github.com/bufbuild/buf/compare/v0.12.1...v0.13.0\n[v0.12.1]: https://github.com/bufbuild/buf/compare/v0.12.0...v0.12.1\n[v0.12.0]: https://github.com/bufbuild/buf/compare/v0.11.0...v0.12.0\n[v0.11.0]: https://github.com/bufbuild/buf/compare/v0.10.0...v0.11.0\n[v0.10.0]: https://github.com/bufbuild/buf/compare/v0.9.0...v0.10.0\n[v0.9.0]: https://github.com/bufbuild/buf/compare/v0.8.0...v0.9.0\n[v0.8.0]: https://github.com/bufbuild/buf/compare/v0.7.1...v0.8.0\n[v0.7.1]: https://github.com/bufbuild/buf/compare/v0.7.0...v0.7.1\n[v0.7.0]: https://github.com/bufbuild/buf/compare/v0.6.0...v0.7.0\n[v0.6.0]: https://github.com/bufbuild/buf/compare/v0.5.0...v0.6.0\n[v0.5.0]: https://github.com/bufbuild/buf/compare/v0.4.1...v0.5.0\n[v0.4.1]: https://github.com/bufbuild/buf/compare/v0.4.0...v0.4.1\n[v0.4.0]: https://github.com/bufbuild/buf/compare/v0.3.0...v0.4.0\n[v0.3.0]: https://github.com/bufbuild/buf/compare/v0.2.0...v0.3.0\n[v0.2.0]: https://github.com/bufbuild/buf/compare/v0.1.0...v0.2.0\n"
  },
  {
    "path": "Dockerfile.buf",
    "content": "FROM --platform=${BUILDPLATFORM} golang:1.26-alpine3.23 AS builder\n\nWORKDIR /workspace\n\nCOPY go.mod go.sum /workspace/\nRUN go mod download\n\nCOPY cmd /workspace/cmd\nCOPY private /workspace/private\n\nARG TARGETOS\nARG TARGETARCH\nRUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \\\n  go build -ldflags \"-s -w\" -trimpath -buildvcs=false -o /go/bin/buf ./cmd/buf\n\nFROM alpine:3.23.3\n\nRUN apk add --update --no-cache \\\n    ca-certificates \\\n    git \\\n    openssh-client && \\\n  rm -rf /var/cache/apk/*\n\nCOPY --from=builder /go/bin/buf /usr/local/bin/buf\n\nENTRYPOINT [\"/usr/local/bin/buf\"]\n"
  },
  {
    "path": "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 2020-2026 Buf Technologies, 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       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS 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": "Makefile",
    "content": "MAKEGO := make/go\nMAKEGO_REMOTE := https://github.com/bufbuild/makego.git\nPROJECT := buf\nGO_MODULE := github.com/bufbuild/buf\nDOCKER_ORG := bufbuild\nDOCKER_PROJECT := buf\n\ninclude make/buf/all.mk\n"
  },
  {
    "path": "README.md",
    "content": "![The Buf logo](./.github/buf-logo.svg)\n\n# Buf\n\n[![License](https://img.shields.io/github/license/bufbuild/buf?color=blue)](https://github.com/bufbuild/buf/blob/main/LICENSE)\n[![Release](https://img.shields.io/github/v/release/bufbuild/buf?include_prereleases)](https://github.com/bufbuild/buf/releases)\n[![CI](https://github.com/bufbuild/buf/workflows/ci/badge.svg)](https://github.com/bufbuild/buf/actions?workflow=ci)\n[![Docker](https://img.shields.io/docker/pulls/bufbuild/buf)](https://hub.docker.com/r/bufbuild/buf)\n[![Homebrew](https://img.shields.io/homebrew/v/buf)](https://github.com/bufbuild/homebrew-buf)\n[![Slack](https://img.shields.io/badge/slack-buf-%23e01563)][badges_slack]\n\n<a name=\"features\"></a>\nThe [`buf`][buf] CLI is the best tool for working with [Protocol Buffers][protobuf]. It provides:\n\n- A [linter][lint_usage] that enforces good API design choices and structure.\n- A [breaking change detector][breaking_tutorial] that enforces compatibility at the source code or wire level.\n- A [generator][generate_usage] that invokes your plugins based on [configuration files][templates].\n- A [formatter][format_usage] that formats your Protobuf files in accordance with industry standards.\n- Integration with the [Buf Schema Registry][bsr], including full dependency management.\n\n## Installation\n\n### Homebrew\n\nYou can install `buf` using [Homebrew][brew] (macOS or Linux):\n\n```sh\nbrew install bufbuild/buf/buf\n```\n\nThis installs:\n\n- The `buf`, [`protoc-gen-buf-breaking`][breaking], and [`protoc-gen-buf-lint`][lint] binaries\n- Shell completion scripts for [Bash], [Fish], [Powershell], and [zsh]\n\n### Other methods\n\nFor other installation methods, see our [official documentation][install], which covers:\n\n- Installing `buf` via [npm]\n- Installing `buf` on [Windows]\n- Using `buf` as a [Docker image][docker]\n- Installing as a [binary], from a [tarball], and from [source] through [GitHub Releases][releases]\n- [Verifying] releases using a [minisign] public key\n\n\n## Usage\n\nBuf's help interface provides summaries for commands and flags:\n\n```sh\nbuf --help\n```\n\nFor more comprehensive usage information, consult Buf's [documentation][docs], especially these guides:\n\n* [`buf breaking`][breaking_tutorial]\n* [`buf build`][build_usage]\n* [`buf generate`][generate_usage]\n* [`buf lint`][lint_usage]\n* [`buf format`][format_usage]\n* [`buf registry`][bsr_quickstart] (for using the [BSR])\n\n## CLI breaking change policy\n\nWe will never make breaking changes within a given major version of the CLI. After `buf` reached v1.0, you can expect no breaking changes until v2.0. But as we have no plans to ever release a v2.0, we will likely never break the `buf` CLI.\n\n> This breaking change policy does _not_ apply to commands behind the `buf beta` gate, and you should expect breaking changes to commands like `buf beta registry`. The policy does go into effect, however, when those commands or flags are elevated out of beta.\n\n## Our goals for Protobuf\n\n[Buf]'s goal is to replace the current paradigm of API development, centered around REST/JSON, with a **schema-driven** paradigm. Defining APIs using an [IDL] provides numerous benefits over REST/JSON, and [Protobuf] is by far the most stable and widely adopted IDL in the industry. We've chosen to build on this widely trusted foundation rather than creating a new IDL from scratch.\n\nBut despite its technical merits, actually _using_ Protobuf has long been more challenging than it needs to be. The Buf CLI and the [BSR](#the-buf-schema-registry) are the cornerstones of our effort to change that for good and to make Protobuf reliable and easy to use for service owners and clients alike—in other words, to create a **modern Protobuf ecosystem**.\n\nWhile we intend to incrementally improve on the `buf` CLI and the [BSR](#the-buf-schema-registry), we're confident that the basic groundwork for such an ecosystem is _already_ in place.\n\n## The Buf Schema Registry\n\nThe [Buf Schema Registry][bsr] (BSR) is a SaaS platform for managing your Protobuf APIs. It provides a centralized registry and a single source of truth for all of your Protobuf assets, including not just your `.proto` files but also [remote plugins][bsr_plugins]. Although the BSR provides an intuitive browser UI, `buf` enables you to perform most BSR-related tasks from the command line, such as [pushing] Protobuf sources to the registry and managing [users] and [repositories]. \n\n> The BSR is not required to use `buf`. We've made the core [features] of the `buf` CLI available to _all_ Protobuf users.\n\n## More advanced CLI features\n\nWhile `buf`'s [core features][features] should cover most use cases, we've included some more advanced features to cover edge cases:\n\n* **Automatic file discovery**. Buf walks your file tree and builds your `.proto` files in accordance with your supplied [build configuration][build_config], which means that you no longer need to manually specify `--proto_paths`. You can still, however, specify `.proto` files manually through CLI flags in cases where file discovery needs to be disabled.\n* **Fine-grained rule configuration** for [linting][lint_rules] and [breaking changes][breaking_rules]. While we do have recommended defaults, you can always select the exact set of rules that your use case requires, with [40 lint rules][lint_rules] and [53 breaking change rules][breaking_rules] available.\n* **Configurable error formats** for CLI output. `buf` outputs information in `file:line:column:message` form by default for each lint error and breaking change it encounters, but you can also select JSON, MSVS, JUnit, and Github Actions output.\n* **Editor integration** driven by `buf`'s granular error output. We currently provide linting integrations for both [Vim and Visual Studio Code][ide] and [JetBrains IDEs][jetbrains] like IntelliJ and GoLand, but we plan to support other editors such as Emacs in the future.\n* **Universal Input targeting**. Buf enables you to perform actions like linting and breaking change detection not just against local `.proto` files but also against a broad range of other [Inputs], such as tarballs and ZIP files, remote Git repositories, and pre-built [image][images] files.\n* **Speed**. Buf's internal Protobuf [compiler] compiles your Protobuf sources using all available cores without compromising deterministic output, which is considerably faster than `protoc`. This allows for near-instantaneous feedback, which is of special importance for features like [editor integration][ide].\n\n## Next steps\n\nOnce you've installed `buf`, we recommend completing the [CLI tutorial][cli-tutorial], which provides a broad but hands-on overview of the core functionality of the CLI. The tour takes about 10 minutes to complete.\n\nAfter completing the tour, check out the remainder of the [docs] for your specific areas of interest.\n\n## Builds\n\nThe following is a breakdown of the binaries by CPU architecture and operating system available through our [releases]:\n\n|  | Linux | MacOS | Windows |\n| --- | --- | --- | --- |\n| x86 (64-bit) | ✅ | ✅ | ✅ |\n| ARM (64-bit) | ✅ | ✅ | ✅ |\n| ARMv7 (32-bit) | ✅ | ❌ | ❌ |\n| RISC-V (64-bit) | ✅ | ❌ | ❌ |\n| ppc64le | ✅ | ❌ | ❌ |\n| s390x | ✅ | ❌ | ❌ |\n\n## Community\n\nFor help and discussion around Protobuf, best practices, and more, join us on [Slack][badges_slack].\n\nFor updates on the Buf CLI, [follow this repo on GitHub][repo].\n\nFor feature requests, bugs, or technical questions, email us at [dev@buf.build][email_dev]. For general inquiries or inclusion in our upcoming feature betas, email us at [info@buf.build][email_info].\n\n[badges_slack]: https://buf.build/links/slack\n[bash]: https://www.gnu.org/software/bash\n[binary]: https://buf.build/docs/cli/installation/#source\n[breaking]: https://buf.build/docs/breaking/overview/\n[breaking_rules]: https://buf.build/docs/breaking/rules/\n[breaking_tutorial]: https://buf.build/docs/breaking/tutorial/\n[brew]: https://brew.sh\n[bsr]: https://buf.build/docs/bsr/\n[bsr_plugins]: https://buf.build/plugins\n[bsr_quickstart]: https://buf.build/docs/bsr/quickstart/\n[buf]: https://buf.build\n[build_config]: https://buf.build/docs/build/usage/#key-concepts\n[build_usage]: https://buf.build/docs/build/usage\n[cli-tutorial]: https://buf.build/docs/cli/quickstart/\n[compiler]: https://buf.build/docs/reference/internal-compiler/\n[docker]: https://buf.build/docs/cli/installation/#docker\n[docs]: https://buf.build/docs\n[email_dev]: mailto:dev@buf.build\n[email_info]: mailto:info@buf.build\n[features]: #features\n[fish]: https://fishshell.com\n[format_usage]: https://buf.build/docs/format/style/\n[generate_usage]: https://buf.build/docs/generate/tutorial/\n[ide]: https://buf.build/docs/cli/editor-integration/\n[idl]: https://en.wikipedia.org/wiki/Interface_description_language\n[images]: https://buf.build/docs/reference/images/\n[inputs]: https://buf.build/docs/reference/inputs/\n[install]: https://buf.build/docs/cli/installation/\n[jetbrains]: https://buf.build/docs/cli/editor-integration/#jetbrains-ides\n[lint]: https://buf.build/docs/lint/overview/\n[lint_rules]: https://buf.build/docs/lint/rules/\n[lint_usage]: https://buf.build/docs/lint/tutorial/\n[npm]: https://buf.build/docs/cli/installation/#npm\n[minisign]: https://github.com/jedisct1/minisign\n[powershell]: https://docs.microsoft.com/en-us/powershell\n[protobuf]: https://protobuf.dev\n[pushing]: https://buf.build/docs/bsr/module/publish/\n[releases]: https://buf.build/docs/cli/installation/#github\n[repo]: https://github.com/bufbuild/buf/\n[repositories]: https://buf.build/docs/concepts/repositories/\n[source]: https://buf.build/docs/cli/installation/#source\n[tarball]: https://buf.build/docs/cli/installation/#github\n[templates]: https://buf.build/docs/configuration/v2/buf-gen-yaml/\n[users]: https://buf.build/docs/admin/manage-members/\n[verifying]: https://buf.build/docs/cli/installation/#github\n[windows]: https://buf.build/docs/cli/installation/#windows\n[zsh]: https://zsh.org\n"
  },
  {
    "path": "buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto\n    name: buf.build/bufbuild/buf\nlint:\n  use:\n    - STANDARD\n    - UNARY_RPC\n  disallow_comment_ignores: true\nbreaking:\n  use:\n    - WIRE_JSON\n  ignore_unstable_packages: true\n"
  },
  {
    "path": "cmd/buf/buf.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/alpha/protoc\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/alpha/registry/token/tokendelete\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/alpha/registry/token/tokenget\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/alpha/registry/token/tokenlist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/bufpluginv1\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/bufpluginv1beta1\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/bufpluginv2\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/price\"\n\tbetaplugindelete \"github.com/bufbuild/buf/cmd/buf/internal/command/beta/registry/plugin/plugindelete\"\n\tbetapluginpush \"github.com/bufbuild/buf/cmd/buf/internal/command/beta/registry/plugin/pluginpush\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/registry/webhook/webhookcreate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/registry/webhook/webhookdelete\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/registry/webhook/webhooklist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/studioagent\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/breaking\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/build\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/config/configinit\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/config/configlsbreakingrules\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/config/configlslintrules\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/config/configlsmodules\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/config/configmigrate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/convert\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/curl\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/dep/depgraph\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/dep/depprune\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/dep/depupdate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/export\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/format\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/generate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/lint\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/lsfiles\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/lsp/lspserve\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/mod/modlsbreakingrules\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/mod/modlslintrules\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/mod/modopen\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/plugin/pluginprune\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/plugin/pluginpush\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/plugin/pluginupdate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/policy/policyprune\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/policy/policypush\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/policy/policyupdate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/push\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulecommit/modulecommitaddlabel\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulecommit/modulecommitinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulecommit/modulecommitlist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulecommit/modulecommitresolve\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulecreate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/moduledelete\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/moduledeprecate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/moduleinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulelabel/modulelabelarchive\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulelabel/modulelabelinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulelabel/modulelabellist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulelabel/modulelabelunarchive\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/modulesettings/modulesettingsupdate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/module/moduleundeprecate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/organization/organizationcreate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/organization/organizationdelete\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/organization/organizationinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/organization/organizationupdate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitaddlabel\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitlist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitresolve\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/plugincreate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/plugindelete\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/plugininfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabelarchive\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabelinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabellist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabelunarchive\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/plugin/pluginsettings/pluginsettingsupdate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policycommit/policycommitaddlabel\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policycommit/policycommitinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policycommit/policycommitlist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policycommit/policycommitresolve\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policycreate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policydelete\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policyinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policylabel/policylabelarchive\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policylabel/policylabelinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policylabel/policylabellist\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policylabel/policylabelunarchive\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/policy/policysettings/policysettingsupdate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/registrycc\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/registrylogin\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/registrylogout\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/sdk/sdkinfo\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/sdk/version\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/registry/whoami\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/source/sourceedit/sourceeditdeprecate\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/stats\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcobra\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconnect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newRootCommand(\"buf\"))\n}\n\nfunc newRootCommand(name string) *appcmd.Command {\n\tbuilder := appext.NewBuilder(\n\t\tname,\n\t\tappext.BuilderWithTimeout(0),\n\t\tappext.BuilderWithInterceptor(newErrorInterceptor()),\n\t\tappext.BuilderWithLoggerProvider(slogapp.LoggerProvider),\n\t)\n\treturn &appcmd.Command{\n\t\tUse:                 name,\n\t\tShort:               \"The Buf CLI\",\n\t\tLong:                \"A tool for working with Protocol Buffers and managing resources on the Buf Schema Registry (BSR)\",\n\t\tVersion:             bufcli.Version,\n\t\tBindPersistentFlags: builder.BindRoot,\n\t\tSubCommands: []*appcmd.Command{\n\t\t\tbuild.NewCommand(\"build\", builder),\n\t\t\texport.NewCommand(\"export\", builder),\n\t\t\tformat.NewCommand(\"format\", builder),\n\t\t\tlint.NewCommand(\"lint\", builder),\n\t\t\tbreaking.NewCommand(\"breaking\", builder),\n\t\t\tgenerate.NewCommand(\"generate\", builder),\n\t\t\tlsfiles.NewCommand(\"ls-files\", builder),\n\t\t\tstats.NewCommand(\"stats\", builder),\n\t\t\tpush.NewCommand(\"push\", builder),\n\t\t\tconvert.NewCommand(\"convert\", builder),\n\t\t\tcurl.NewCommand(\"curl\", builder),\n\t\t\t{\n\t\t\t\tUse:   \"dep\",\n\t\t\t\tShort: \"Work with dependencies\",\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tdepgraph.NewCommand(\"graph\", builder),\n\t\t\t\t\tdepprune.NewCommand(\"prune\", builder, ``, false),\n\t\t\t\t\tdepupdate.NewCommand(\"update\", builder, ``, false),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tUse:   \"config\",\n\t\t\t\tShort: \"Work with configuration files\",\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tconfiginit.NewCommand(\"init\", builder, ``, false, false),\n\t\t\t\t\tconfigmigrate.NewCommand(\"migrate\", builder),\n\t\t\t\t\tconfiglslintrules.NewCommand(\"ls-lint-rules\", builder),\n\t\t\t\t\tconfiglsbreakingrules.NewCommand(\"ls-breaking-rules\", builder),\n\t\t\t\t\tconfiglsmodules.NewCommand(\"ls-modules\", builder),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tUse:   \"source\",\n\t\t\t\tShort: \"Work with Protobuf source files\",\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"edit\",\n\t\t\t\t\t\tShort: \"Edit Protobuf source files\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\tsourceeditdeprecate.NewCommand(\"deprecate\", builder),\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\t{\n\t\t\t\tUse:   \"lsp\",\n\t\t\t\tShort: \"Work with Buf Language Server\",\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tlspserve.NewCommand(\"serve\", builder, ``, false, false),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tUse:        \"mod\",\n\t\t\t\tShort:      `Manage Buf modules, all commands are deprecated and have moved to the \"buf config\", \"buf dep\", or \"buf registry\" subcommands.`,\n\t\t\t\tDeprecated: `all commands are deprecated and have moved to the \"buf config\", \"buf dep\", or \"buf registry\" subcommands.`,\n\t\t\t\tHidden:     true,\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t// Deprecated and hidden.\n\t\t\t\t\tconfiginit.NewCommand(\"init\", builder, deprecatedMessage(\"buf config init\", \"buf mod init\"), true, true),\n\t\t\t\t\t// Deprecated and hidden.\n\t\t\t\t\tdepprune.NewCommand(\"prune\", builder, deprecatedMessage(\"buf dep prune\", \"buf mod update\"), true),\n\t\t\t\t\t// Deprecated and hidden.\n\t\t\t\t\tdepupdate.NewCommand(\"update\", builder, deprecatedMessage(\"buf dep update\", \"buf mod update\"), true),\n\t\t\t\t\t// Deprecated and hidden.\n\t\t\t\t\tmodopen.NewCommand(\"open\", builder),\n\t\t\t\t\t// Deprecated and hidden.\n\t\t\t\t\tregistrycc.NewCommand(\"clear-cache\", builder, deprecatedMessage(\"buf registry cc\", \"buf mod clear-cache\"), true, \"cc\"),\n\t\t\t\t\t// Deprecated and hidden.\n\t\t\t\t\tmodlslintrules.NewCommand(\"ls-lint-rules\", builder),\n\t\t\t\t\t// Deprecated and hidden.\n\t\t\t\t\tmodlsbreakingrules.NewCommand(\"ls-breaking-rules\", builder),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tUse:   \"plugin\",\n\t\t\t\tShort: \"Work with check plugins\",\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tpluginpush.NewCommand(\"push\", builder),\n\t\t\t\t\tpluginupdate.NewCommand(\"update\", builder),\n\t\t\t\t\tpluginprune.NewCommand(\"prune\", builder),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tUse:    \"policy\",\n\t\t\t\tShort:  \"Work with policies\",\n\t\t\t\tHidden: true,\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tpolicypush.NewCommand(\"push\", builder),\n\t\t\t\t\tpolicyupdate.NewCommand(\"update\", builder),\n\t\t\t\t\tpolicyprune.NewCommand(\"prune\", builder),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tUse:   \"registry\",\n\t\t\t\tShort: \"Manage assets on the Buf Schema Registry\",\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tregistrylogin.NewCommand(\"login\", builder),\n\t\t\t\t\tregistrylogout.NewCommand(\"logout\", builder),\n\t\t\t\t\twhoami.NewCommand(\"whoami\", builder),\n\t\t\t\t\tregistrycc.NewCommand(\"cc\", builder, ``, false),\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:        \"commit\",\n\t\t\t\t\t\tShort:      `Manage a module's commits, all commands are deprecated and have moved to the \"buf registry module commit\" subcommands`,\n\t\t\t\t\t\tDeprecated: `all commands are deprecated and have moved to the \"buf registry module commit\" subcommands.`,\n\t\t\t\t\t\tHidden:     true,\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\tmodulecommitaddlabel.NewCommand(\"add-label\", builder, deprecatedMessage(\"buf registry module commit add-label\", \"buf registry commit add-label\")),\n\t\t\t\t\t\t\tmodulecommitinfo.NewCommand(\"info\", builder, deprecatedMessage(\"buf registry module commit info\", \"buf registry commit info\")),\n\t\t\t\t\t\t\tmodulecommitlist.NewCommand(\"list\", builder, deprecatedMessage(\"buf registry module commit list\", \"buf registry commit list\")),\n\t\t\t\t\t\t\tmodulecommitresolve.NewCommand(\"resolve\", builder, deprecatedMessage(\"buf registry module commit resolve\", \"buf registry commit resolve\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"sdk\",\n\t\t\t\t\t\tShort: \"Manage Generated SDKs\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\tversion.NewCommand(\"version\", builder),\n\t\t\t\t\t\t\tsdkinfo.NewCommand(\"info\", builder),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:        \"label\",\n\t\t\t\t\t\tShort:      `Manage a module's labels, all commands are deprecated and have moved to the \"buf registry module label\" subcommands`,\n\t\t\t\t\t\tDeprecated: `all commands are deprecated and have moved to the \"buf registry module label\" subcommands.`,\n\t\t\t\t\t\tHidden:     true,\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\tmodulelabelarchive.NewCommand(\"archive\", builder, deprecatedMessage(\"buf registry module label archive\", \"buf registry label archive\")),\n\t\t\t\t\t\t\tmodulelabelinfo.NewCommand(\"info\", builder, deprecatedMessage(\"buf registry module label info\", \"buf registry label info\")),\n\t\t\t\t\t\t\tmodulelabellist.NewCommand(\"list\", builder, deprecatedMessage(\"buf registry module label list\", \"buf registry label list\")),\n\t\t\t\t\t\t\tmodulelabelunarchive.NewCommand(\"unarchive\", builder, deprecatedMessage(\"buf registry module label unarchive\", \"buf registry label unarchive\")),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"organization\",\n\t\t\t\t\t\tShort: \"Manage organizations\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\torganizationcreate.NewCommand(\"create\", builder),\n\t\t\t\t\t\t\torganizationdelete.NewCommand(\"delete\", builder),\n\t\t\t\t\t\t\torganizationinfo.NewCommand(\"info\", builder),\n\t\t\t\t\t\t\torganizationupdate.NewCommand(\"update\", builder),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"module\",\n\t\t\t\t\t\tShort: \"Manage BSR modules\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"commit\",\n\t\t\t\t\t\t\t\tShort: \"Manage a module's commits\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tmodulecommitaddlabel.NewCommand(\"add-label\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tmodulecommitinfo.NewCommand(\"info\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tmodulecommitlist.NewCommand(\"list\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tmodulecommitresolve.NewCommand(\"resolve\", builder, \"\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"label\",\n\t\t\t\t\t\t\t\tShort: \"Manage a module's labels\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tmodulelabelarchive.NewCommand(\"archive\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tmodulelabelinfo.NewCommand(\"info\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tmodulelabellist.NewCommand(\"list\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tmodulelabelunarchive.NewCommand(\"unarchive\", builder, \"\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"settings\",\n\t\t\t\t\t\t\t\tShort: \"Manage a module's settings\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tmodulesettingsupdate.NewCommand(\"update\", builder, \"\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tmodulecreate.NewCommand(\"create\", builder),\n\t\t\t\t\t\t\tmoduleinfo.NewCommand(\"info\", builder),\n\t\t\t\t\t\t\tmoduledelete.NewCommand(\"delete\", builder),\n\t\t\t\t\t\t\tmoduledeprecate.NewCommand(\"deprecate\", builder),\n\t\t\t\t\t\t\tmodulesettingsupdate.NewCommand(\"update\", builder, deprecatedMessage(\"buf registry module settings update\", \"buf registry update\")),\n\t\t\t\t\t\t\tmoduleundeprecate.NewCommand(\"undeprecate\", builder),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"plugin\",\n\t\t\t\t\t\tShort: \"Manage BSR plugins\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"commit\",\n\t\t\t\t\t\t\t\tShort: \"Manage a plugin's commits\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tplugincommitaddlabel.NewCommand(\"add-label\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tplugincommitinfo.NewCommand(\"info\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tplugincommitlist.NewCommand(\"list\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tplugincommitresolve.NewCommand(\"resolve\", builder, \"\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"label\",\n\t\t\t\t\t\t\t\tShort: \"Manage a plugin's labels\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tpluginlabelarchive.NewCommand(\"archive\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpluginlabelinfo.NewCommand(\"info\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpluginlabellist.NewCommand(\"list\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpluginlabelunarchive.NewCommand(\"unarchive\", builder, \"\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"settings\",\n\t\t\t\t\t\t\t\tShort: \"Manage a plugin's settings\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tpluginsettingsupdate.NewCommand(\"update\", builder),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tplugincreate.NewCommand(\"create\", builder),\n\t\t\t\t\t\t\tplugininfo.NewCommand(\"info\", builder),\n\t\t\t\t\t\t\tplugindelete.NewCommand(\"delete\", builder),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"policy\",\n\t\t\t\t\t\tShort: \"Manage BSR policies\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"commit\",\n\t\t\t\t\t\t\t\tShort: \"Manage a policy's commits\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tpolicycommitaddlabel.NewCommand(\"add-label\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpolicycommitinfo.NewCommand(\"info\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpolicycommitlist.NewCommand(\"list\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpolicycommitresolve.NewCommand(\"resolve\", builder, \"\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"label\",\n\t\t\t\t\t\t\t\tShort: \"Manage a policy's labels\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tpolicylabelarchive.NewCommand(\"archive\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpolicylabelinfo.NewCommand(\"info\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpolicylabellist.NewCommand(\"list\", builder, \"\"),\n\t\t\t\t\t\t\t\t\tpolicylabelunarchive.NewCommand(\"unarchive\", builder, \"\"),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"settings\",\n\t\t\t\t\t\t\t\tShort: \"Manage a policy's settings\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tpolicysettingsupdate.NewCommand(\"update\", builder),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tpolicycreate.NewCommand(\"create\", builder),\n\t\t\t\t\t\t\tpolicyinfo.NewCommand(\"info\", builder),\n\t\t\t\t\t\t\tpolicydelete.NewCommand(\"delete\", builder),\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\t{\n\t\t\t\tUse:   \"beta\",\n\t\t\t\tShort: \"Beta commands. Unstable and likely to change\",\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tlspserve.NewCommand(\"lsp\", builder, deprecatedMessage(\"buf lsp serve\", \"buf beta lsp\"), true, true),\n\t\t\t\t\tprice.NewCommand(\"price\", builder),\n\t\t\t\t\tbufpluginv1beta1.NewCommand(\"buf-plugin-v1beta1\", builder),\n\t\t\t\t\tbufpluginv1.NewCommand(\"buf-plugin-v1\", builder),\n\t\t\t\t\tbufpluginv2.NewCommand(\"buf-plugin-v2\", builder),\n\t\t\t\t\tstudioagent.NewCommand(\"studio-agent\", builder),\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"registry\",\n\t\t\t\t\t\tShort: \"Manage assets on the Buf Schema Registry\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"webhook\",\n\t\t\t\t\t\t\t\tShort: \"Manage webhooks for a repository on the Buf Schema Registry\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\twebhookcreate.NewCommand(\"create\", builder),\n\t\t\t\t\t\t\t\t\twebhookdelete.NewCommand(\"delete\", builder),\n\t\t\t\t\t\t\t\t\twebhooklist.NewCommand(\"list\", builder),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"plugin\",\n\t\t\t\t\t\t\t\tShort: \"Manage plugins on the Buf Schema Registry\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\tbetapluginpush.NewCommand(\"push\", builder),\n\t\t\t\t\t\t\t\t\tbetaplugindelete.NewCommand(\"delete\", builder),\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\t{\n\t\t\t\tUse:    \"alpha\",\n\t\t\t\tShort:  \"Alpha commands. Unstable and recommended only for experimentation. These may be deleted\",\n\t\t\t\tHidden: true,\n\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\tprotoc.NewCommand(\"protoc\", builder),\n\t\t\t\t\t{\n\t\t\t\t\t\tUse:   \"registry\",\n\t\t\t\t\t\tShort: \"Manage assets on the Buf Schema Registry\",\n\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tUse:   \"token\",\n\t\t\t\t\t\t\t\tShort: \"Manage user tokens\",\n\t\t\t\t\t\t\t\tSubCommands: []*appcmd.Command{\n\t\t\t\t\t\t\t\t\ttokenget.NewCommand(\"get\", builder),\n\t\t\t\t\t\t\t\t\ttokenlist.NewCommand(\"list\", builder),\n\t\t\t\t\t\t\t\t\ttokendelete.NewCommand(\"delete\", builder),\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\tModifyCobra: func(cobraCommand *cobra.Command) error {\n\t\t\tcobraCommand.AddCommand(bufcobra.NewWebpagesCommand(\"webpages\", cobraCommand))\n\t\t\treturn nil\n\t\t},\n\t}\n}\n\n// newErrorInterceptor returns a CLI interceptor that wraps Buf CLI errors.\nfunc newErrorInterceptor() appext.Interceptor {\n\treturn func(next func(context.Context, appext.Container) error) func(context.Context, appext.Container) error {\n\t\treturn func(ctx context.Context, container appext.Container) error {\n\t\t\treturn wrapError(next(ctx, container))\n\t\t}\n\t}\n}\n\n// wrapError is used when a CLI command fails, regardless of its error code.\n// Note that this function will wrap the error so that the underlying error\n// can be recovered via 'errors.Is'.\nfunc wrapError(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\n\tvar connectErr *connect.Error\n\tisConnectError := errors.As(err, &connectErr)\n\t// If error is empty and not a system error or Connect error, we return it as-is.\n\tif !isConnectError && err.Error() == \"\" {\n\t\treturn err\n\t}\n\tif isConnectError {\n\t\tvar augmentedConnectError *bufconnect.AugmentedConnectError\n\t\tisAugmentedConnectErr := errors.As(err, &augmentedConnectError)\n\t\tif isPossibleNewCLIOldBSRError(connectErr) && isAugmentedConnectErr {\n\t\t\treturn fmt.Errorf(\"Failure: %[1]s for https://%[2]s%[3]s\\n\"+\n\t\t\t\t\"This version of the buf CLI may require APIs that have not yet been deployed to https://%[2]s\\n\"+\n\t\t\t\t\"To resolve this failure, you can either:\\n\"+\n\t\t\t\t\"- Try using an older version of the buf CLI\\n\"+\n\t\t\t\t\"- Contact the site admin for https://%[2]s to upgrade the instance\",\n\t\t\t\tconnectErr,\n\t\t\t\taugmentedConnectError.Addr(),\n\t\t\t\taugmentedConnectError.Procedure(),\n\t\t\t)\n\t\t}\n\t\tconnectCode := connectErr.Code()\n\t\tswitch {\n\t\tcase connectCode == connect.CodeUnauthenticated, isEmptyUnknownError(err):\n\t\t\tloginCommand := \"buf registry login\"\n\t\t\tauthErr, ok := bufconnect.AsAuthError(err)\n\t\t\tif !ok {\n\t\t\t\t// This code should be unreachable.\n\t\t\t\treturn fmt.Errorf(\"Failure: you are not authenticated. \"+\n\t\t\t\t\t\"Set the %[1]s environment variable or run %q, using a Buf API token as the password. \"+\n\t\t\t\t\t\"If you have set the %[1]s or run the login command, \"+\n\t\t\t\t\t\"your token may have expired. \"+\n\t\t\t\t\t\"For details, visit https://buf.build/docs/bsr/authentication\",\n\t\t\t\t\tbufconnect.TokenEnvKey,\n\t\t\t\t\tloginCommand,\n\t\t\t\t)\n\t\t\t}\n\t\t\t// Invalid token found in env var.\n\t\t\tif authErr.HasToken() && authErr.TokenEnvKey() != \"\" {\n\t\t\t\treturn fmt.Errorf(\"Failure: the %[1]s environment variable is not valid for %[2]s. \"+\n\t\t\t\t\t\"Set %[1]s to a valid Buf API token, or unset it. \"+\n\t\t\t\t\t\"For details, visit https://buf.build/docs/bsr/authentication\",\n\t\t\t\t\tauthErr.TokenEnvKey(), authErr.Remote(),\n\t\t\t\t)\n\t\t\t}\n\t\t\tif authErr.Remote() != bufconnect.DefaultRemote {\n\t\t\t\tloginCommand = fmt.Sprintf(\"%s %s\", loginCommand, authErr.Remote())\n\t\t\t}\n\t\t\t// Invalid token found in netrc.\n\t\t\tif authErr.HasToken() {\n\t\t\t\treturn fmt.Errorf(\"Failure: your Buf API token for %s is invalid. \"+\n\t\t\t\t\t\"Run %q using a valid Buf API token. \"+\n\t\t\t\t\t\"For details, visit https://buf.build/docs/bsr/authentication\",\n\t\t\t\t\tauthErr.Remote(),\n\t\t\t\t\tloginCommand,\n\t\t\t\t)\n\t\t\t}\n\t\t\t// No token found.\n\t\t\treturn fmt.Errorf(\"Failure: you are not authenticated for %s. \"+\n\t\t\t\t\"Set the %s environment variable or run %q, \"+\n\t\t\t\t\"using a Buf API token as the password. \"+\n\t\t\t\t\"For details, visit https://buf.build/docs/bsr/authentication\",\n\t\t\t\tauthErr.Remote(),\n\t\t\t\tbufconnect.TokenEnvKey,\n\t\t\t\tloginCommand,\n\t\t\t)\n\t\tcase connectCode == connect.CodeUnavailable:\n\t\t\tmsg := `Failure: the server hosted at that remote is unavailable.`\n\t\t\t// If the returned error is Unavailable, then determine if this is a DNS error.  If so,\n\t\t\t// get the address used so that we can display a more helpful error message.\n\t\t\tif dnsError := (&net.DNSError{}); errors.As(err, &dnsError) && dnsError.IsNotFound {\n\t\t\t\treturn fmt.Errorf(`%s Are you sure \"%s\" is a valid remote address?`, msg, dnsError.Name)\n\t\t\t}\n\t\t\t// If the unavailable error wraps a tls.CertificateVerificationError, show a more specific\n\t\t\t// error message to the user to aid in troubleshooting.\n\t\t\tif tlsErr := wrappedTLSError(err); tlsErr != nil {\n\t\t\t\treturn fmt.Errorf(\"tls certificate verification: %w\", tlsErr)\n\t\t\t}\n\t\t\treturn errors.New(msg)\n\t\t}\n\t}\n\n\tsysError, isSysError := syserror.As(err)\n\tif isSysError {\n\t\terr = fmt.Errorf(\n\t\t\t\"it looks like you have found a bug in buf. \"+\n\t\t\t\t\"Please file an issue at https://github.com/bufbuild/buf/issues \"+\n\t\t\t\t\"and provide the command you ran, as well as the following message: %w\",\n\t\t\tsysError.Unwrap(),\n\t\t)\n\t}\n\n\tvar importNotExistError *bufmodule.ImportNotExistError\n\tif errors.As(err, &importNotExistError) {\n\t\t// There must be a better place to do this, perhaps in the Controller, but this works for now.\n\t\terr = app.WrapError(bufctl.ExitCodeFileAnnotation, importNotExistError)\n\t}\n\n\treturn appFailureError(err)\n}\n\n// isEmptyUnknownError returns true if the given\n// error is non-nil, but has an empty message\n// and an unknown error code.\n//\n// This is relevant for errors returned by\n// envoyauthd when the client does not provide\n// an authentication header.\nfunc isEmptyUnknownError(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\treturn err.Error() == \"\" && connect.CodeOf(err) == connect.CodeUnknown\n}\n\n// wrappedTLSError returns an unwrapped TLS error or nil if the error is another type of error.\nfunc wrappedTLSError(err error) error {\n\tif tlsErr := (&tls.CertificateVerificationError{}); errors.As(err, &tlsErr) {\n\t\treturn tlsErr\n\t}\n\treturn nil\n}\n\nfunc appFailureError(err error) error {\n\treturn fmt.Errorf(\"Failure: %w\", err)\n}\n\n// isPossibleNewCLIOldBSRError determines if an error might be from a newer\n// version of the CLI interacting with an older version of the BSR.\nfunc isPossibleNewCLIOldBSRError(connectErr *connect.Error) bool {\n\tswitch connectErr.Code() {\n\tcase connect.CodeUnknown:\n\t\t// Older versions of the BSR return errors of this shape\n\t\t// for unrecognized services.\n\t\t// NOTE: This handling can be removed once all BSR instances\n\t\t// are upgraded past v1.7.0.\n\t\treturn connectErr.Message() == fmt.Sprintf(\"%d %s\", http.StatusMethodNotAllowed, http.StatusText(http.StatusMethodNotAllowed))\n\tcase connect.CodeUnimplemented:\n\t\t// RPC was known, but unimplemented in the BSR version.\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\n// deprecatedMessage returns a message indicating that a command is deprecated.\nfunc deprecatedMessage(newCommand, oldCommand string) string {\n\treturn fmt.Sprintf(\n\t\t`use \"%s\" instead. However, \"%s\" will continue to work.`,\n\t\tnewCommand, oldCommand,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/buf_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/internaltesting\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/osext\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagetesting\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nvar (\n\tconvertTestDataDir = filepath.Join(\"internal\", \"command\", \"convert\", \"testdata\", \"convert\")\n\t// ordered, contains non-default\n\tbuiltinLintRulesV2 = []*outputCheckRule{\n\t\t{ID: \"DIRECTORY_SAME_PACKAGE\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files in a given directory are in the same package.\"},\n\t\t{ID: \"PACKAGE_DEFINED\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files have a package defined.\"},\n\t\t{ID: \"PACKAGE_DIRECTORY_MATCH\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files are in a directory that matches their package name.\"},\n\t\t{ID: \"PACKAGE_NO_IMPORT_CYCLE\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that packages do not have import cycles.\"},\n\t\t{ID: \"PACKAGE_SAME_DIRECTORY\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package are in the same directory.\"},\n\t\t{ID: \"ENUM_FIRST_VALUE_ZERO\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all first values of enums have a numeric value of 0.\"},\n\t\t{ID: \"ENUM_NO_ALLOW_ALIAS\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that enums do not have the allow_alias option set.\"},\n\t\t{ID: \"ENUM_PASCAL_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that enums are PascalCase.\"},\n\t\t{ID: \"ENUM_VALUE_UPPER_SNAKE_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that enum values are UPPER_SNAKE_CASE.\"},\n\t\t{ID: \"FIELD_LOWER_SNAKE_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that field names are lower_snake_case.\"},\n\t\t{ID: \"FIELD_NOT_REQUIRED\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that fields are not configured to be required.\"},\n\t\t{ID: \"IMPORT_NO_PUBLIC\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that imports are not public.\"},\n\t\t{ID: \"IMPORT_USED\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that imports are used.\"},\n\t\t{ID: \"MESSAGE_PASCAL_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that messages are PascalCase.\"},\n\t\t{ID: \"ONEOF_LOWER_SNAKE_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that oneof names are lower_snake_case.\"},\n\t\t{ID: \"PACKAGE_LOWER_SNAKE_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that packages are lower_snake.case.\"},\n\t\t{ID: \"PACKAGE_SAME_CSHARP_NAMESPACE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package have the same value for the csharp_namespace option.\"},\n\t\t{ID: \"PACKAGE_SAME_GO_PACKAGE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package have the same value for the go_package option.\"},\n\t\t{ID: \"PACKAGE_SAME_JAVA_MULTIPLE_FILES\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package have the same value for the java_multiple_files option.\"},\n\t\t{ID: \"PACKAGE_SAME_JAVA_PACKAGE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package have the same value for the java_package option.\"},\n\t\t{ID: \"PACKAGE_SAME_PHP_NAMESPACE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package have the same value for the php_namespace option.\"},\n\t\t{ID: \"PACKAGE_SAME_RUBY_PACKAGE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package have the same value for the ruby_package option.\"},\n\t\t{ID: \"PACKAGE_SAME_SWIFT_PREFIX\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package have the same value for the swift_prefix option.\"},\n\t\t{ID: \"RPC_PASCAL_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that RPCs are PascalCase.\"},\n\t\t{ID: \"SERVICE_PASCAL_CASE\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that services are PascalCase.\"},\n\t\t{ID: \"SYNTAX_SPECIFIED\", Categories: []string{\"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files have a syntax specified.\"},\n\t\t{ID: \"ENUM_VALUE_PREFIX\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that enum values are prefixed with ENUM_NAME_UPPER_SNAKE_CASE.\"},\n\t\t{ID: \"ENUM_ZERO_VALUE_SUFFIX\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that enum zero values have a consistent suffix (configurable, default suffix is \\\"_UNSPECIFIED\\\").\"},\n\t\t{ID: \"FILE_LOWER_SNAKE_CASE\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that filenames are lower_snake_case.\"},\n\t\t{ID: \"PACKAGE_VERSION_SUFFIX\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that the last component of all packages is a version of the form v\\\\d+, v\\\\d+test.*, v\\\\d+(alpha|beta)\\\\d+, or v\\\\d+p\\\\d+(alpha|beta)\\\\d+, where numbers are >=1.\"},\n\t\t{ID: \"PROTOVALIDATE\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that protovalidate rules are valid and all CEL expressions compile.\"},\n\t\t{ID: \"RPC_REQUEST_RESPONSE_UNIQUE\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that RPC request and response types are only used in one RPC (configurable).\"},\n\t\t{ID: \"RPC_REQUEST_STANDARD_NAME\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that RPC request type names are RPCNameRequest or ServiceNameRPCNameRequest (configurable).\"},\n\t\t{ID: \"RPC_RESPONSE_STANDARD_NAME\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that RPC response type names are RPCNameResponse or ServiceNameRPCNameResponse (configurable).\"},\n\t\t{ID: \"SERVICE_SUFFIX\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that services have a consistent suffix (configurable, default suffix is \\\"Service\\\").\"},\n\t\t{ID: \"COMMENT_ENUM\", Categories: []string{\"COMMENTS\"}, Default: false, Purpose: \"Checks that enums have non-empty comments.\"},\n\t\t{ID: \"COMMENT_ENUM_VALUE\", Categories: []string{\"COMMENTS\"}, Default: false, Purpose: \"Checks that enum values have non-empty comments.\"},\n\t\t{ID: \"COMMENT_FIELD\", Categories: []string{\"COMMENTS\"}, Default: false, Purpose: \"Checks that fields have non-empty comments.\"},\n\t\t{ID: \"COMMENT_MESSAGE\", Categories: []string{\"COMMENTS\"}, Default: false, Purpose: \"Checks that messages have non-empty comments.\"},\n\t\t{ID: \"COMMENT_ONEOF\", Categories: []string{\"COMMENTS\"}, Default: false, Purpose: \"Checks that oneofs have non-empty comments.\"},\n\t\t{ID: \"COMMENT_RPC\", Categories: []string{\"COMMENTS\"}, Default: false, Purpose: \"Checks that RPCs have non-empty comments.\"},\n\t\t{ID: \"COMMENT_SERVICE\", Categories: []string{\"COMMENTS\"}, Default: false, Purpose: \"Checks that services have non-empty comments.\"},\n\t\t{ID: \"RPC_NO_CLIENT_STREAMING\", Categories: []string{\"UNARY_RPC\"}, Default: false, Purpose: \"Checks that RPCs are not client streaming.\"},\n\t\t{ID: \"RPC_NO_SERVER_STREAMING\", Categories: []string{\"UNARY_RPC\"}, Default: false, Purpose: \"Checks that RPCs are not server streaming.\"},\n\t\t{ID: \"STABLE_PACKAGE_NO_IMPORT_UNSTABLE\", Categories: []string{}, Default: false, Purpose: \"Checks that all files that have stable versioned packages do not import packages with unstable version packages.\"},\n\t}\n\t// ordered, contains non-default\n\tbuiltinBreakingRulesV2 = []*outputCheckRule{\n\t\t{ID: \"EXTENSION_NO_DELETE\", Categories: []string{\"FILE\"}, Default: true, Purpose: \"Checks that extensions are not deleted from a given file.\"},\n\t\t{ID: \"SERVICE_NO_DELETE\", Categories: []string{\"FILE\"}, Default: true, Purpose: \"Checks that services are not deleted from a given file.\"},\n\t\t{ID: \"ENUM_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\"}, Default: true, Purpose: \"Checks that enums are not deleted from a given file.\"},\n\t\t{ID: \"FILE_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\"}, Default: true, Purpose: \"Checks that files are not deleted.\"},\n\t\t{ID: \"MESSAGE_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\"}, Default: true, Purpose: \"Checks that messages are not deleted from a given file.\"},\n\t\t{ID: \"ENUM_SAME_TYPE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that enums have the same type (open vs closed).\"},\n\t\t{ID: \"FIELD_SAME_CARDINALITY\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that fields have the same cardinalities in a given message.\"},\n\t\t{ID: \"FIELD_SAME_CPP_STRING_TYPE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that fields have the same C++ string type, based on ctype field option or (pb.cpp).string_type feature.\"},\n\t\t{ID: \"FIELD_SAME_JAVA_UTF8_VALIDATION\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that fields have the same Java string UTF8 validation, based on java_string_check_utf8 file option or (pb.java).utf8_validation feature.\"},\n\t\t{ID: \"FIELD_SAME_JSTYPE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that fields have the same value for the jstype option.\"},\n\t\t{ID: \"FIELD_SAME_UTF8_VALIDATION\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that string fields have the same UTF8 validation mode.\"},\n\t\t{ID: \"FILE_SAME_CC_ENABLE_ARENAS\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the cc_enable_arenas option.\"},\n\t\t{ID: \"FILE_SAME_CC_GENERIC_SERVICES\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the cc_generic_services option.\"},\n\t\t{ID: \"FILE_SAME_CSHARP_NAMESPACE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the csharp_namespace option.\"},\n\t\t{ID: \"FILE_SAME_GO_PACKAGE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the go_package option.\"},\n\t\t{ID: \"FILE_SAME_JAVA_GENERIC_SERVICES\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the java_generic_services option.\"},\n\t\t{ID: \"FILE_SAME_JAVA_MULTIPLE_FILES\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the java_multiple_files option.\"},\n\t\t{ID: \"FILE_SAME_JAVA_OUTER_CLASSNAME\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the java_outer_classname option.\"},\n\t\t{ID: \"FILE_SAME_JAVA_PACKAGE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the java_package option.\"},\n\t\t{ID: \"FILE_SAME_OBJC_CLASS_PREFIX\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the objc_class_prefix option.\"},\n\t\t{ID: \"FILE_SAME_OPTIMIZE_FOR\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the optimize_for option.\"},\n\t\t{ID: \"FILE_SAME_PHP_CLASS_PREFIX\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the php_class_prefix option.\"},\n\t\t{ID: \"FILE_SAME_PHP_METADATA_NAMESPACE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the php_metadata_namespace option.\"},\n\t\t{ID: \"FILE_SAME_PHP_NAMESPACE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the php_namespace option.\"},\n\t\t{ID: \"FILE_SAME_PY_GENERIC_SERVICES\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the py_generic_services option.\"},\n\t\t{ID: \"FILE_SAME_RUBY_PACKAGE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the ruby_package option.\"},\n\t\t{ID: \"FILE_SAME_SWIFT_PREFIX\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same value for the swift_prefix option.\"},\n\t\t{ID: \"RPC_NO_DELETE\", Categories: []string{\"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that rpcs are not deleted from a given service.\"},\n\t\t{ID: \"ENUM_VALUE_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that enum values are not deleted from a given enum.\"},\n\t\t{ID: \"EXTENSION_MESSAGE_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that extension ranges are not deleted from a given message.\"},\n\t\t{ID: \"FIELD_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that fields are not deleted from a given message.\"},\n\t\t{ID: \"FIELD_SAME_TYPE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that fields have the same types in a given message.\"},\n\t\t{ID: \"FILE_SAME_SYNTAX\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that files have the same syntax.\"},\n\t\t{ID: \"MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that messages do not change the no_standard_descriptor_accessor option from false or unset to true.\"},\n\t\t{ID: \"ONEOF_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\"}, Default: true, Purpose: \"Checks that oneofs are not deleted from a given message.\"},\n\t\t{ID: \"ENUM_SAME_JSON_FORMAT\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}, Default: true, Purpose: \"Checks that enums have the same JSON format support.\"},\n\t\t{ID: \"ENUM_VALUE_SAME_NAME\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}, Default: true, Purpose: \"Checks that enum values have the same name.\"},\n\t\t{ID: \"FIELD_SAME_JSON_NAME\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}, Default: true, Purpose: \"Checks that fields have the same value for the json_name option.\"},\n\t\t{ID: \"FIELD_SAME_NAME\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}, Default: true, Purpose: \"Checks that fields have the same names in a given message.\"},\n\t\t{ID: \"MESSAGE_SAME_JSON_FORMAT\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}, Default: true, Purpose: \"Checks that messages have the same JSON format support.\"},\n\t\t{ID: \"FIELD_SAME_DEFAULT\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that fields have the same default value, if a default is specified.\"},\n\t\t{ID: \"FIELD_SAME_ONEOF\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that fields have the same oneofs in a given message.\"},\n\t\t{ID: \"FILE_SAME_PACKAGE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that files have the same package.\"},\n\t\t{ID: \"MESSAGE_SAME_REQUIRED_FIELDS\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that messages have no added or deleted required fields.\"},\n\t\t{ID: \"RESERVED_ENUM_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that reserved ranges and names are not deleted from a given enum.\"},\n\t\t{ID: \"RESERVED_MESSAGE_NO_DELETE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that reserved ranges and names are not deleted from a given message.\"},\n\t\t{ID: \"RPC_SAME_CLIENT_STREAMING\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that rpcs have the same client streaming value.\"},\n\t\t{ID: \"RPC_SAME_IDEMPOTENCY_LEVEL\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that rpcs have the same value for the idempotency_level option.\"},\n\t\t{ID: \"RPC_SAME_REQUEST_TYPE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that rpcs are have the same request type.\"},\n\t\t{ID: \"RPC_SAME_RESPONSE_TYPE\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that rpcs are have the same response type.\"},\n\t\t{ID: \"RPC_SAME_SERVER_STREAMING\", Categories: []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}, Default: true, Purpose: \"Checks that rpcs have the same server streaming value.\"},\n\t\t{ID: \"PACKAGE_ENUM_NO_DELETE\", Categories: []string{\"PACKAGE\"}, Default: false, Purpose: \"Checks that enums are not deleted from a given package.\"},\n\t\t{ID: \"PACKAGE_EXTENSION_NO_DELETE\", Categories: []string{\"PACKAGE\"}, Default: false, Purpose: \"Checks that extensions are not deleted from a given package.\"},\n\t\t{ID: \"PACKAGE_MESSAGE_NO_DELETE\", Categories: []string{\"PACKAGE\"}, Default: false, Purpose: \"Checks that messages are not deleted from a given package.\"},\n\t\t{ID: \"PACKAGE_NO_DELETE\", Categories: []string{\"PACKAGE\"}, Default: false, Purpose: \"Checks that packages are not deleted.\"},\n\t\t{ID: \"PACKAGE_SERVICE_NO_DELETE\", Categories: []string{\"PACKAGE\"}, Default: false, Purpose: \"Checks that services are not deleted from a given package.\"},\n\t\t{ID: \"ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\", Categories: []string{\"CSR\", \"WIRE_JSON\"}, Default: false, Purpose: \"Checks that enum values are not deleted from a given enum unless the name is reserved.\"},\n\t\t{ID: \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\", Categories: []string{\"CSR\", \"WIRE_JSON\"}, Default: false, Purpose: \"Checks that fields are not deleted from a given message unless the name is reserved.\"},\n\t\t{ID: \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\", Categories: []string{\"CSR\", \"WIRE_JSON\"}, Default: false, Purpose: \"Checks that fields have wire and JSON compatible cardinalities in a given message.\"},\n\t\t{ID: \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\", Categories: []string{\"CSR\", \"WIRE_JSON\"}, Default: false, Purpose: \"Checks that fields have wire and JSON compatible types in a given message.\"},\n\t\t{ID: \"ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\", Categories: []string{\"CSR\", \"WIRE_JSON\", \"WIRE\"}, Default: false, Purpose: \"Checks that enum values are not deleted from a given enum unless the number is reserved.\"},\n\t\t{ID: \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\", Categories: []string{\"CSR\", \"WIRE_JSON\", \"WIRE\"}, Default: false, Purpose: \"Checks that fields are not deleted from a given message unless the number is reserved.\"},\n\t\t{ID: \"FIELD_WIRE_COMPATIBLE_CARDINALITY\", Categories: []string{\"WIRE\"}, Default: false, Purpose: \"Checks that fields have wire-compatible cardinalities in a given message.\"},\n\t\t{ID: \"FIELD_WIRE_COMPATIBLE_TYPE\", Categories: []string{\"WIRE\"}, Default: false, Purpose: \"Checks that fields have wire-compatible types in a given message.\"},\n\t}\n)\n\ntype outputCheckRule struct {\n\tID           string   `json:\"id\"`\n\tCategories   []string `json:\"categories\"`\n\tDefault      bool     `json:\"default\"`\n\tPurpose      string   `json:\"purpose\"`\n\tPlugin       string   `json:\"plugin\"`\n\tDeprecated   bool     `json:\"deprecated\"`\n\tReplacements []string `json:\"replacements\"`\n}\n\nfunc TestSuccess1(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 1, ``, \"build\", \"--source\", filepath.Join(\"testdata\", \"success\"))\n\ttestRunStdout(t, nil, 0, ``, \"build\", filepath.Join(\"testdata\", \"success\"))\n}\n\nfunc TestSuccess2(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 1, ``, \"build\", \"--exclude-imports\", \"--source\", filepath.Join(\"testdata\", \"success\"))\n\ttestRunStdout(t, nil, 0, ``, \"build\", \"--exclude-imports\", filepath.Join(\"testdata\", \"success\"))\n}\n\nfunc TestSuccess3(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 1, ``, \"build\", \"--exclude-source-info\", \"--source\", filepath.Join(\"testdata\", \"success\"))\n\ttestRunStdout(t, nil, 0, ``, \"build\", \"--exclude-source-info\", filepath.Join(\"testdata\", \"success\"))\n}\n\nfunc TestSuccess4(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 1, ``, \"build\", \"--exclude-imports\", \"--exclude-source-info\", \"--source\", filepath.Join(\"testdata\", \"success\"))\n\ttestRunStdout(t, nil, 0, ``, \"build\", \"--exclude-imports\", \"--exclude-source-info\", filepath.Join(\"testdata\", \"success\"))\n}\n\nfunc TestSuccess5(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 1, ``, \"build\", \"--exclude-imports\", \"--exclude-source-info\", \"--source\", filepath.Join(\"testdata\", \"success\"))\n\ttestRunStdout(t, nil, 0, ``, \"build\", \"--exclude-imports\", \"--exclude-source-info\", filepath.Join(\"testdata\", \"success\"))\n}\n\nfunc TestSuccess6(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 0, ``, \"lint\", filepath.Join(\"testdata\", \"success\"))\n\ttestRunStdout(t, nil, 1, ``, \"lint\", \"--input\", filepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"))\n\ttestRunStdout(t, nil, 0, ``, \"lint\", filepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"))\n}\n\nfunc TestSuccessDir(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 0, ``, \"build\", filepath.Join(\"testdata\", \"successnobufyaml\"))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"successnobufyaml\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"successnobufyaml\", \"buf\", \"buf.proto\"),\n\t)\n\twd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\ttestRunStdout(t, nil, 0, ``, \"build\", filepath.Join(wd, \"testdata\", \"successnobufyaml\"))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(wd, \"testdata\", \"successnobufyaml\"),\n\t\t\"--path\",\n\t\tfilepath.Join(wd, \"testdata\", \"successnobufyaml\", \"buf\", \"buf.proto\"),\n\t)\n}\n\nfunc TestFail1(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"build\",\n\t\t\"--source\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n}\n\nfunc TestFail2(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"build\",\n\t\t\"--exclude-imports\",\n\t\t\"--source\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"--exclude-imports\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n}\n\nfunc TestFail3(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"build\",\n\t\t\"--exclude-source-info\",\n\t\t\"--source\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"--exclude-source-info\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n}\n\nfunc TestFail4(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"build\",\n\t\t\"--exclude-imports\",\n\t\t\"--exclude-source-info\",\n\t\t\"--source\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"--exclude-imports\",\n\t\t\"--exclude-source-info\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n}\n\nfunc TestFail5(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n        testdata/fail/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"lint\",\n\t\t\"--input\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n        testdata/fail/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t)\n}\n\nfunc TestFail6(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n        testdata/fail/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".`),\n\t\t\"\", // stderr should be empty\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"lint\",\n\t\t\"--input\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\", // stdout should be empty\n\t\t\"Failure: --path is not valid for use with .proto file references\",\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t)\n}\n\nfunc TestFail7(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\"--input-config\",\n\t\t`{\"version\":\"v1\",\"lint\":{\"use\":[\"BASIC\"]}}`,\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"fail/buf\".\ntestdata/fail/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".`),\n\t\t// This is new behavior we introduced. When setting a config override, we no longer do\n\t\t// a search for the controlling workspace. See bufctl/option.go for additional details.\n\t\t// Only the paths specified by \"--path\" in the command are considered. This avoids build\n\t\t// failures from other proto files under testdata. Command \"build\" succeeds with this path\n\t\t// restriction, \"lint\" should be able to build the image and only fail on lint issue for\n\t\t// the specified file.\n\t\t\"\",\n\t\t\"lint\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\tfilepath.Join(\"testdata\"),\n\t\t\"--config\",\n\t\t`{\"version\":\"v1beta1\",\"lint\":{\"use\":[\"BASIC\"]}}`,\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\t// Note: `were in directory \"buf\"` was changed to `were in directory \"testdata/fail/buf\"`\n\t\t// during the refactor. This is actually more correct - pre-refactor, the CLI was acting\n\t\t// as if the buf.yaml at testdata/fail/buf.yaml mattered in some way. In fact, it doesn't -\n\t\t// you've said that you have overridden it entirely.\n\t\tfilepath.FromSlash(`testdata/fail/buf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \".\".\ntestdata/fail/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".`),\n\t\t\"\", // stderr should be empty\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\"--config\",\n\t\t`{\"version\":\"v1\",\"lint\":{\"use\":[\"BASIC\"]}}`,\n\t)\n}\n\nfunc TestFail8(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail2/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".\n\t\ttestdata/fail2/buf/buf2.proto:9:9:Field name \"oneThree\" should be lower_snake_case, such as \"one_three\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail2\"),\n\t)\n}\n\nfunc TestFail9(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail2/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail2\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail2\", \"buf\", \"buf.proto\"),\n\t)\n}\n\nfunc TestFail10(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail2\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail2\", \"buf\", \"buf3.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\",\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail2\", \"buf\", \"buf3.proto\"),\n\t)\n}\n\nfunc TestFail11(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"lint\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail2\", \"buf\", \"buf2.proto\"),\n\t\t\"--input\",\n\t\tfilepath.Join(\"testdata\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail2/buf/buf2.proto:9:9:Field name \"oneThree\" should be lower_snake_case, such as \"one_three\".`),\n\t\t\"lint\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"fail2\", \"buf\", \"buf2.proto\"),\n\t\tfilepath.Join(\"testdata\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail2/buf/buf2.proto:9:9:Field name \"oneThree\" should be lower_snake_case, such as \"one_three\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail2\", \"buf\", \"buf2.proto\"),\n\t)\n}\n\nfunc TestFail12(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\t`version: v1\nlint:\n  ignore_only:\n    FIELD_LOWER_SNAKE_CASE:\n\t  - buf/buf.proto\n\tPACKAGE_DIRECTORY_MATCH:\n\t  - buf/buf.proto`,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t\"--error-format\",\n\t\t\"config-ignore-yaml\",\n\t)\n}\n\nfunc TestFail13(t *testing.T) {\n\tt.Parallel()\n\t// this tests that we still use buf.mod if it exists\n\t// this has an ignore for FIELD_LOWER_SNAKE_CASE to make sure we are actually reading the config\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/fail_buf_mod/buf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"fail_buf_mod\"),\n\t)\n}\n\nfunc TestFailCheckBreaking1(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\n\t\t../../private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/1.proto:5:1:Previously present field \"3\" with name \"three\" on message \"Two\" was deleted.\n\t\t../../private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/1.proto:10:1:Previously present field \"3\" with name \"three\" on message \"Three\" was deleted.\n\t\t../../private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/1.proto:12:5:Previously present field \"3\" with name \"three\" on message \"Five\" was deleted.\n\t\t../../private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/1.proto:22:3:Previously present field \"3\" with name \"three\" on message \"Seven\" was deleted.\n\t\t../../private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/2.proto:57:1:Previously present field \"3\" with name \"three\" on message \"Nine\" was deleted.\n\t\t`),\n\t\t\"\", // stderr should be empty\n\t\t\"breaking\",\n\t\t// can't bother right now to filepath.Join this\n\t\t\"../../private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete\",\n\t\t\"--against\",\n\t\t\"../../private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete\",\n\t)\n}\n\nfunc TestFailCheckBreaking2(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/protofileref/breaking/a/foo.proto:7:3:Field \"2\" with name \"world\" on message \"Foo\" changed type from \"int32\" to \"string\".`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"a\", \"foo.proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"b\", \"foo.proto\"),\n\t)\n}\n\nfunc TestFailCheckBreaking3(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\n\t\t<input>:1:1:Previously present file \"bar.proto\" was deleted.\n\t\ttestdata/protofileref/breaking/a/foo.proto:7:3:Field \"2\" with name \"world\" on message \"Foo\" changed type from \"int32\" to \"string\".\n\t\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"a\", \"foo.proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"b\"),\n\t)\n}\n\nfunc TestFailCheckBreaking4(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\n\t\ttestdata/protofileref/breaking/a/bar.proto:5:1:Previously present field \"2\" with name \"value\" on message \"Bar\" was deleted.\n\t\ttestdata/protofileref/breaking/a/foo.proto:7:3:Field \"2\" with name \"world\" on message \"Foo\" changed type from \"int32\" to \"string\".\n\t\t`),\n\t\t\"breaking\",\n\t\tfmt.Sprintf(\"%s#include_package_files=true\", filepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"a\", \"foo.proto\")),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"b\"),\n\t)\n}\n\nfunc TestFailCheckBreaking5(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\n    <input>:1:1:Previously present file \"bar.proto\" was deleted.\n\t\ttestdata/protofileref/breaking/a/foo.proto:7:3:Field \"2\" with name \"world\" on message \"Foo\" changed type from \"int32\" to \"string\".\n\t\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"a\", \"foo.proto\"),\n\t\t\"--against\",\n\t\tfmt.Sprintf(\"%s#include_package_files=true\", filepath.Join(\"testdata\", \"protofileref\", \"breaking\", \"b\", \"foo.proto\")),\n\t)\n}\n\nfunc TestCheckLsLintRulesModAll(t *testing.T) {\n\tt.Parallel()\n\texpectedStdout := `\nID                                CATEGORIES                DEFAULT  PURPOSE\nDIRECTORY_SAME_PACKAGE            MINIMAL, BASIC, STANDARD  *        Checks that all files in a given directory are in the same package.\nPACKAGE_DEFINED                   MINIMAL, BASIC, STANDARD  *        Checks that all files have a package defined.\nPACKAGE_DIRECTORY_MATCH           MINIMAL, BASIC, STANDARD  *        Checks that all files are in a directory that matches their package name.\nPACKAGE_SAME_DIRECTORY            MINIMAL, BASIC, STANDARD  *        Checks that all files with a given package are in the same directory.\nENUM_FIRST_VALUE_ZERO             BASIC, STANDARD           *        Checks that all first values of enums have a numeric value of 0.\nENUM_NO_ALLOW_ALIAS               BASIC, STANDARD           *        Checks that enums do not have the allow_alias option set.\nENUM_PASCAL_CASE                  BASIC, STANDARD           *        Checks that enums are PascalCase.\nENUM_VALUE_UPPER_SNAKE_CASE       BASIC, STANDARD           *        Checks that enum values are UPPER_SNAKE_CASE.\nFIELD_LOWER_SNAKE_CASE            BASIC, STANDARD           *        Checks that field names are lower_snake_case.\nIMPORT_NO_PUBLIC                  BASIC, STANDARD           *        Checks that imports are not public.\nIMPORT_USED                       BASIC, STANDARD           *        Checks that imports are used.\nMESSAGE_PASCAL_CASE               BASIC, STANDARD           *        Checks that messages are PascalCase.\nONEOF_LOWER_SNAKE_CASE            BASIC, STANDARD           *        Checks that oneof names are lower_snake_case.\nPACKAGE_LOWER_SNAKE_CASE          BASIC, STANDARD           *        Checks that packages are lower_snake.case.\nPACKAGE_SAME_CSHARP_NAMESPACE     BASIC, STANDARD           *        Checks that all files with a given package have the same value for the csharp_namespace option.\nPACKAGE_SAME_GO_PACKAGE           BASIC, STANDARD           *        Checks that all files with a given package have the same value for the go_package option.\nPACKAGE_SAME_JAVA_MULTIPLE_FILES  BASIC, STANDARD           *        Checks that all files with a given package have the same value for the java_multiple_files option.\nPACKAGE_SAME_JAVA_PACKAGE         BASIC, STANDARD           *        Checks that all files with a given package have the same value for the java_package option.\nPACKAGE_SAME_PHP_NAMESPACE        BASIC, STANDARD           *        Checks that all files with a given package have the same value for the php_namespace option.\nPACKAGE_SAME_RUBY_PACKAGE         BASIC, STANDARD           *        Checks that all files with a given package have the same value for the ruby_package option.\nPACKAGE_SAME_SWIFT_PREFIX         BASIC, STANDARD           *        Checks that all files with a given package have the same value for the swift_prefix option.\nRPC_PASCAL_CASE                   BASIC, STANDARD           *        Checks that RPCs are PascalCase.\nSERVICE_PASCAL_CASE               BASIC, STANDARD           *        Checks that services are PascalCase.\nSYNTAX_SPECIFIED                  BASIC, STANDARD           *        Checks that all files have a syntax specified.\nENUM_VALUE_PREFIX                 STANDARD                  *        Checks that enum values are prefixed with ENUM_NAME_UPPER_SNAKE_CASE.\nENUM_ZERO_VALUE_SUFFIX            STANDARD                  *        Checks that enum zero values have a consistent suffix (configurable, default suffix is \"_UNSPECIFIED\").\nFILE_LOWER_SNAKE_CASE             STANDARD                  *        Checks that filenames are lower_snake_case.\nPACKAGE_VERSION_SUFFIX            STANDARD                  *        Checks that the last component of all packages is a version of the form v\\d+, v\\d+test.*, v\\d+(alpha|beta)\\d+, or v\\d+p\\d+(alpha|beta)\\d+, where numbers are >=1.\nPROTOVALIDATE                     STANDARD                  *        Checks that protovalidate rules are valid and all CEL expressions compile.\nRPC_REQUEST_RESPONSE_UNIQUE       STANDARD                  *        Checks that RPC request and response types are only used in one RPC (configurable).\nRPC_REQUEST_STANDARD_NAME         STANDARD                  *        Checks that RPC request type names are RPCNameRequest or ServiceNameRPCNameRequest (configurable).\nRPC_RESPONSE_STANDARD_NAME        STANDARD                  *        Checks that RPC response type names are RPCNameResponse or ServiceNameRPCNameResponse (configurable).\nSERVICE_SUFFIX                    STANDARD                  *        Checks that services have a consistent suffix (configurable, default suffix is \"Service\").\nCOMMENT_ENUM                      COMMENTS                           Checks that enums have non-empty comments.\nCOMMENT_ENUM_VALUE                COMMENTS                           Checks that enum values have non-empty comments.\nCOMMENT_FIELD                     COMMENTS                           Checks that fields have non-empty comments.\nCOMMENT_MESSAGE                   COMMENTS                           Checks that messages have non-empty comments.\nCOMMENT_ONEOF                     COMMENTS                           Checks that oneofs have non-empty comments.\nCOMMENT_RPC                       COMMENTS                           Checks that RPCs have non-empty comments.\nCOMMENT_SERVICE                   COMMENTS                           Checks that services have non-empty comments.\nRPC_NO_CLIENT_STREAMING           UNARY_RPC                          Checks that RPCs are not client streaming.\nRPC_NO_SERVER_STREAMING           UNARY_RPC                          Checks that RPCs are not server streaming.\nPACKAGE_NO_IMPORT_CYCLE                                              Checks that packages do not have import cycles.\n\t\t`\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\texpectedStdout,\n\t\t\"mod\",\n\t\t\"ls-lint-rules\",\n\t\t\"--all\",\n\t)\n}\n\nfunc TestCheckPolicyConfigLsLintRulesConfigured(t *testing.T) {\n\tt.Parallel()\n\texpectedConfiguredOnlyStdout, err := os.ReadFile(filepath.Join(\"testdata\", \"policy_list_rules\", \"expected_ls_lint_rules_configured_only.txt\"))\n\trequire.NoError(t, err)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tstring(expectedConfiguredOnlyStdout),\n\t\t\"config\",\n\t\t\"ls-lint-rules\",\n\t\t\"--config\",\n\t\tfilepath.Join(\"testdata\", \"policy_list_rules\", \"buf.yaml\"),\n\t\t\"--configured-only\",\n\t)\n}\n\nfunc TestCheckLsLintRulesFromConfig(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`\n\t\tID                       CATEGORIES                             DEFAULT  PURPOSE\n\t\tPACKAGE_DIRECTORY_MATCH  MINIMAL, BASIC, STANDARD, FILE_LAYOUT  *        Checks that all files are in a directory that matches their package name.\n\t\tENUM_NO_ALLOW_ALIAS      MINIMAL, BASIC, STANDARD, SENSIBLE     *        Checks that enums do not have the allow_alias option set.\n\t\t`,\n\t\t\"mod\",\n\t\t\"ls-lint-rules\",\n\t\t\"--config\",\n\t\tfilepath.Join(\"testdata\", \"small_list_rules\", \"buf.yaml\"),\n\t)\n\t// defaults only, built-ins and plugins.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeLint,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\tappend(\n\t\t\txslices.Filter(builtinLintRulesV2, func(lintRule *outputCheckRule) bool {\n\t\t\t\treturn lintRule.Default\n\t\t\t}),\n\t\t\t&outputCheckRule{ID: \"RPC_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no RPCs with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t&outputCheckRule{ID: \"SERVICE_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no services with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t),\n\t)\n\t// configure a deprecated category and a non-deprecated built-in category.\n\t// deprecated category contains some non-deprecated rules.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeLint,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"lint\": {\n\t\t\t\t\"use\": [\"MINIMAL\", \"RESOURCE_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\t[]*outputCheckRule{\n\t\t\t{ID: \"DIRECTORY_SAME_PACKAGE\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files in a given directory are in the same package.\"},\n\t\t\t{ID: \"PACKAGE_DEFINED\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files have a package defined.\"},\n\t\t\t{ID: \"PACKAGE_DIRECTORY_MATCH\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files are in a directory that matches their package name.\"},\n\t\t\t{ID: \"PACKAGE_NO_IMPORT_CYCLE\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that packages do not have import cycles.\"},\n\t\t\t{ID: \"PACKAGE_SAME_DIRECTORY\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package are in the same directory.\"},\n\t\t\t{ID: \"ENUM_VALUE_BANNED_SUFFIXES\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that there are no enum values of top-level enums with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"FIELD_BANNED_SUFFIXES\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that there are no fields with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t},\n\t)\n\t// configure a deprecated category and a non-deprecated category, no built-ins.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeLint,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"lint\": {\n\t\t\t\t\"use\": [\"OPERATION_SUFFIXES\",\"ATTRIBUTES_SUFFIXES\", \"RESOURCE_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\t[]*outputCheckRule{\n\t\t\t{ID: \"RPC_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no RPCs with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"SERVICE_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no services with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"ENUM_VALUE_BANNED_SUFFIXES\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that there are no enum values of top-level enums with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"FIELD_BANNED_SUFFIXES\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that there are no fields with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t},\n\t)\n\t// configure a deprecated category and a non-deprecated category, no built-ins.\n\t// note: ATTRIBUTES_SUFFIXES is not in USE, but is the replacement category for\n\t// RESOURCE_SUFFIXES.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeLint,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"lint\": {\n\t\t\t\t\"use\": [\"OPERATION_SUFFIXES\", \"RESOURCE_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\t[]*outputCheckRule{\n\t\t\t{ID: \"RPC_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no RPCs with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"SERVICE_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no services with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"ENUM_VALUE_BANNED_SUFFIXES\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that there are no enum values of top-level enums with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"FIELD_BANNED_SUFFIXES\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that there are no fields with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t},\n\t)\n\t// configure a mix of rules from built-ins and plugins. MESSAGE_BANNED_SUFFIXES is a deprecated\n\t// rule, expect to print its replacement, FIELD_BANNED_SUFFIXES.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeLint,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"lint\": {\n\t\t\t\t\"use\": [\"RPC_BANNED_SUFFIXES\",\"SERVICE_SUFFIX\", \"MESSAGE_BANNED_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\t[]*outputCheckRule{\n\t\t\t{ID: \"SERVICE_SUFFIX\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that services have a consistent suffix (configurable, default suffix is \\\"Service\\\").\"},\n\t\t\t{ID: \"RPC_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no RPCs with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"FIELD_BANNED_SUFFIXES\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that there are no fields with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t},\n\t)\n\t// configure a mix of categories and rules from built-ins and plugins.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeLint,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"lint\": {\n\t\t\t\t\"use\": [\"RPC_BANNED_SUFFIXES\",\"SERVICE_SUFFIX\", \"MINIMAL\", \"OPERATION_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\t[]*outputCheckRule{\n\t\t\t{ID: \"DIRECTORY_SAME_PACKAGE\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files in a given directory are in the same package.\"},\n\t\t\t{ID: \"PACKAGE_DEFINED\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files have a package defined.\"},\n\t\t\t{ID: \"PACKAGE_DIRECTORY_MATCH\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files are in a directory that matches their package name.\"},\n\t\t\t{ID: \"PACKAGE_NO_IMPORT_CYCLE\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that packages do not have import cycles.\"},\n\t\t\t{ID: \"PACKAGE_SAME_DIRECTORY\", Categories: []string{\"MINIMAL\", \"BASIC\", \"STANDARD\"}, Default: true, Purpose: \"Checks that all files with a given package are in the same directory.\"},\n\t\t\t{ID: \"SERVICE_SUFFIX\", Categories: []string{\"STANDARD\"}, Default: true, Purpose: \"Checks that services have a consistent suffix (configurable, default suffix is \\\"Service\\\").\"},\n\t\t\t{ID: \"RPC_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no RPCs with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"SERVICE_BANNED_SUFFIXES\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that there are no services with the list of configured banned suffixes.\", Plugin: \"buf-plugin-suffix\"},\n\t\t},\n\t)\n}\n\nfunc TestCheckLsLintRulesV1Beta1(t *testing.T) {\n\tt.Parallel()\n\texpectedStdout := `\nID                                CATEGORIES                                    DEFAULT  PURPOSE\nDIRECTORY_SAME_PACKAGE            MINIMAL, BASIC, STANDARD, FILE_LAYOUT         *        Checks that all files in a given directory are in the same package.\nPACKAGE_DIRECTORY_MATCH           MINIMAL, BASIC, STANDARD, FILE_LAYOUT         *        Checks that all files are in a directory that matches their package name.\nPACKAGE_SAME_DIRECTORY            MINIMAL, BASIC, STANDARD, FILE_LAYOUT         *        Checks that all files with a given package are in the same directory.\nPACKAGE_SAME_CSHARP_NAMESPACE     MINIMAL, BASIC, STANDARD, PACKAGE_AFFINITY    *        Checks that all files with a given package have the same value for the csharp_namespace option.\nPACKAGE_SAME_GO_PACKAGE           MINIMAL, BASIC, STANDARD, PACKAGE_AFFINITY    *        Checks that all files with a given package have the same value for the go_package option.\nPACKAGE_SAME_JAVA_MULTIPLE_FILES  MINIMAL, BASIC, STANDARD, PACKAGE_AFFINITY    *        Checks that all files with a given package have the same value for the java_multiple_files option.\nPACKAGE_SAME_JAVA_PACKAGE         MINIMAL, BASIC, STANDARD, PACKAGE_AFFINITY    *        Checks that all files with a given package have the same value for the java_package option.\nPACKAGE_SAME_PHP_NAMESPACE        MINIMAL, BASIC, STANDARD, PACKAGE_AFFINITY    *        Checks that all files with a given package have the same value for the php_namespace option.\nPACKAGE_SAME_RUBY_PACKAGE         MINIMAL, BASIC, STANDARD, PACKAGE_AFFINITY    *        Checks that all files with a given package have the same value for the ruby_package option.\nPACKAGE_SAME_SWIFT_PREFIX         MINIMAL, BASIC, STANDARD, PACKAGE_AFFINITY    *        Checks that all files with a given package have the same value for the swift_prefix option.\nENUM_NO_ALLOW_ALIAS               MINIMAL, BASIC, STANDARD, SENSIBLE            *        Checks that enums do not have the allow_alias option set.\nFIELD_NO_DESCRIPTOR               MINIMAL, BASIC, STANDARD, SENSIBLE            *        Checks that field names are not any capitalization of \"descriptor\" with any number of prefix or suffix underscores.\nIMPORT_NO_PUBLIC                  MINIMAL, BASIC, STANDARD, SENSIBLE            *        Checks that imports are not public.\nPACKAGE_DEFINED                   MINIMAL, BASIC, STANDARD, SENSIBLE            *        Checks that all files have a package defined.\nENUM_PASCAL_CASE                  BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that enums are PascalCase.\nENUM_VALUE_UPPER_SNAKE_CASE       BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that enum values are UPPER_SNAKE_CASE.\nFIELD_LOWER_SNAKE_CASE            BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that field names are lower_snake_case.\nMESSAGE_PASCAL_CASE               BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that messages are PascalCase.\nONEOF_LOWER_SNAKE_CASE            BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that oneof names are lower_snake_case.\nPACKAGE_LOWER_SNAKE_CASE          BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that packages are lower_snake.case.\nRPC_PASCAL_CASE                   BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that RPCs are PascalCase.\nSERVICE_PASCAL_CASE               BASIC, STANDARD, STYLE_BASIC, STYLE_STANDARD  *        Checks that services are PascalCase.\nENUM_VALUE_PREFIX                 STANDARD, STYLE_STANDARD                      *        Checks that enum values are prefixed with ENUM_NAME_UPPER_SNAKE_CASE.\nENUM_ZERO_VALUE_SUFFIX            STANDARD, STYLE_STANDARD                      *        Checks that enum zero values have a consistent suffix (configurable, default suffix is \"_UNSPECIFIED\").\nFILE_LOWER_SNAKE_CASE             STANDARD, STYLE_STANDARD                      *        Checks that filenames are lower_snake_case.\nPACKAGE_VERSION_SUFFIX            STANDARD, STYLE_STANDARD                      *        Checks that the last component of all packages is a version of the form v\\d+, v\\d+test.*, v\\d+(alpha|beta)\\d+, or v\\d+p\\d+(alpha|beta)\\d+, where numbers are >=1.\nRPC_REQUEST_RESPONSE_UNIQUE       STANDARD, STYLE_STANDARD                      *        Checks that RPC request and response types are only used in one RPC (configurable).\nRPC_REQUEST_STANDARD_NAME         STANDARD, STYLE_STANDARD                      *        Checks that RPC request type names are RPCNameRequest or ServiceNameRPCNameRequest (configurable).\nRPC_RESPONSE_STANDARD_NAME        STANDARD, STYLE_STANDARD                      *        Checks that RPC response type names are RPCNameResponse or ServiceNameRPCNameResponse (configurable).\nSERVICE_SUFFIX                    STANDARD, STYLE_STANDARD                      *        Checks that services have a consistent suffix (configurable, default suffix is \"Service\").\nCOMMENT_ENUM                      COMMENTS                                               Checks that enums have non-empty comments.\nCOMMENT_ENUM_VALUE                COMMENTS                                               Checks that enum values have non-empty comments.\nCOMMENT_FIELD                     COMMENTS                                               Checks that fields have non-empty comments.\nCOMMENT_MESSAGE                   COMMENTS                                               Checks that messages have non-empty comments.\nCOMMENT_ONEOF                     COMMENTS                                               Checks that oneofs have non-empty comments.\nCOMMENT_RPC                       COMMENTS                                               Checks that RPCs have non-empty comments.\nCOMMENT_SERVICE                   COMMENTS                                               Checks that services have non-empty comments.\nRPC_NO_CLIENT_STREAMING           UNARY_RPC                                              Checks that RPCs are not client streaming.\nRPC_NO_SERVER_STREAMING           UNARY_RPC                                              Checks that RPCs are not server streaming.\nENUM_FIRST_VALUE_ZERO             OTHER                                                  Checks that all first values of enums have a numeric value of 0.\n\t\t`\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\texpectedStdout,\n\t\t\"mod\",\n\t\t\"ls-lint-rules\",\n\t\t\"--version\",\n\t\t\"v1beta1\",\n\t)\n}\n\nfunc TestCheckLsLintRulesV2(t *testing.T) {\n\tt.Parallel()\n\texpectedStdout := `\nID                                 CATEGORIES                DEFAULT  PURPOSE\nDIRECTORY_SAME_PACKAGE             MINIMAL, BASIC, STANDARD  *        Checks that all files in a given directory are in the same package.\nPACKAGE_DEFINED                    MINIMAL, BASIC, STANDARD  *        Checks that all files have a package defined.\nPACKAGE_DIRECTORY_MATCH            MINIMAL, BASIC, STANDARD  *        Checks that all files are in a directory that matches their package name.\nPACKAGE_NO_IMPORT_CYCLE            MINIMAL, BASIC, STANDARD  *        Checks that packages do not have import cycles.\nPACKAGE_SAME_DIRECTORY             MINIMAL, BASIC, STANDARD  *        Checks that all files with a given package are in the same directory.\nENUM_FIRST_VALUE_ZERO              BASIC, STANDARD           *        Checks that all first values of enums have a numeric value of 0.\nENUM_NO_ALLOW_ALIAS                BASIC, STANDARD           *        Checks that enums do not have the allow_alias option set.\nENUM_PASCAL_CASE                   BASIC, STANDARD           *        Checks that enums are PascalCase.\nENUM_VALUE_UPPER_SNAKE_CASE        BASIC, STANDARD           *        Checks that enum values are UPPER_SNAKE_CASE.\nFIELD_LOWER_SNAKE_CASE             BASIC, STANDARD           *        Checks that field names are lower_snake_case.\nFIELD_NOT_REQUIRED                 BASIC, STANDARD           *        Checks that fields are not configured to be required.\nIMPORT_NO_PUBLIC                   BASIC, STANDARD           *        Checks that imports are not public.\nIMPORT_USED                        BASIC, STANDARD           *        Checks that imports are used.\nMESSAGE_PASCAL_CASE                BASIC, STANDARD           *        Checks that messages are PascalCase.\nONEOF_LOWER_SNAKE_CASE             BASIC, STANDARD           *        Checks that oneof names are lower_snake_case.\nPACKAGE_LOWER_SNAKE_CASE           BASIC, STANDARD           *        Checks that packages are lower_snake.case.\nPACKAGE_SAME_CSHARP_NAMESPACE      BASIC, STANDARD           *        Checks that all files with a given package have the same value for the csharp_namespace option.\nPACKAGE_SAME_GO_PACKAGE            BASIC, STANDARD           *        Checks that all files with a given package have the same value for the go_package option.\nPACKAGE_SAME_JAVA_MULTIPLE_FILES   BASIC, STANDARD           *        Checks that all files with a given package have the same value for the java_multiple_files option.\nPACKAGE_SAME_JAVA_PACKAGE          BASIC, STANDARD           *        Checks that all files with a given package have the same value for the java_package option.\nPACKAGE_SAME_PHP_NAMESPACE         BASIC, STANDARD           *        Checks that all files with a given package have the same value for the php_namespace option.\nPACKAGE_SAME_RUBY_PACKAGE          BASIC, STANDARD           *        Checks that all files with a given package have the same value for the ruby_package option.\nPACKAGE_SAME_SWIFT_PREFIX          BASIC, STANDARD           *        Checks that all files with a given package have the same value for the swift_prefix option.\nRPC_PASCAL_CASE                    BASIC, STANDARD           *        Checks that RPCs are PascalCase.\nSERVICE_PASCAL_CASE                BASIC, STANDARD           *        Checks that services are PascalCase.\nSYNTAX_SPECIFIED                   BASIC, STANDARD           *        Checks that all files have a syntax specified.\nENUM_VALUE_PREFIX                  STANDARD                  *        Checks that enum values are prefixed with ENUM_NAME_UPPER_SNAKE_CASE.\nENUM_ZERO_VALUE_SUFFIX             STANDARD                  *        Checks that enum zero values have a consistent suffix (configurable, default suffix is \"_UNSPECIFIED\").\nFILE_LOWER_SNAKE_CASE              STANDARD                  *        Checks that filenames are lower_snake_case.\nPACKAGE_VERSION_SUFFIX             STANDARD                  *        Checks that the last component of all packages is a version of the form v\\d+, v\\d+test.*, v\\d+(alpha|beta)\\d+, or v\\d+p\\d+(alpha|beta)\\d+, where numbers are >=1.\nPROTOVALIDATE                      STANDARD                  *        Checks that protovalidate rules are valid and all CEL expressions compile.\nRPC_REQUEST_RESPONSE_UNIQUE        STANDARD                  *        Checks that RPC request and response types are only used in one RPC (configurable).\nRPC_REQUEST_STANDARD_NAME          STANDARD                  *        Checks that RPC request type names are RPCNameRequest or ServiceNameRPCNameRequest (configurable).\nRPC_RESPONSE_STANDARD_NAME         STANDARD                  *        Checks that RPC response type names are RPCNameResponse or ServiceNameRPCNameResponse (configurable).\nSERVICE_SUFFIX                     STANDARD                  *        Checks that services have a consistent suffix (configurable, default suffix is \"Service\").\nCOMMENT_ENUM                       COMMENTS                           Checks that enums have non-empty comments.\nCOMMENT_ENUM_VALUE                 COMMENTS                           Checks that enum values have non-empty comments.\nCOMMENT_FIELD                      COMMENTS                           Checks that fields have non-empty comments.\nCOMMENT_MESSAGE                    COMMENTS                           Checks that messages have non-empty comments.\nCOMMENT_ONEOF                      COMMENTS                           Checks that oneofs have non-empty comments.\nCOMMENT_RPC                        COMMENTS                           Checks that RPCs have non-empty comments.\nCOMMENT_SERVICE                    COMMENTS                           Checks that services have non-empty comments.\nRPC_NO_CLIENT_STREAMING            UNARY_RPC                          Checks that RPCs are not client streaming.\nRPC_NO_SERVER_STREAMING            UNARY_RPC                          Checks that RPCs are not server streaming.\nSTABLE_PACKAGE_NO_IMPORT_UNSTABLE                                     Checks that all files that have stable versioned packages do not import packages with unstable version packages.\n\t\t`\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\texpectedStdout,\n\t\t\"config\",\n\t\t\"ls-lint-rules\",\n\t\t\"--version\",\n\t\t\"v2\",\n\t)\n}\n\nfunc TestCheckLsBreakingRulesV1(t *testing.T) {\n\tt.Parallel()\n\texpectedStdout := `\nID                                              CATEGORIES                      DEFAULT  PURPOSE\nENUM_NO_DELETE                                  FILE                            *        Checks that enums are not deleted from a given file.\nFILE_NO_DELETE                                  FILE                            *        Checks that files are not deleted.\nMESSAGE_NO_DELETE                               FILE                            *        Checks that messages are not deleted from a given file.\nSERVICE_NO_DELETE                               FILE                            *        Checks that services are not deleted from a given file.\nENUM_SAME_TYPE                                  FILE, PACKAGE                   *        Checks that enums have the same type (open vs closed).\nENUM_VALUE_NO_DELETE                            FILE, PACKAGE                   *        Checks that enum values are not deleted from a given enum.\nEXTENSION_MESSAGE_NO_DELETE                     FILE, PACKAGE                   *        Checks that extension ranges are not deleted from a given message.\nFIELD_NO_DELETE                                 FILE, PACKAGE                   *        Checks that fields are not deleted from a given message.\nFIELD_SAME_CARDINALITY                          FILE, PACKAGE                   *        Checks that fields have the same cardinalities in a given message.\nFIELD_SAME_CPP_STRING_TYPE                      FILE, PACKAGE                   *        Checks that fields have the same C++ string type, based on ctype field option or (pb.cpp).string_type feature.\nFIELD_SAME_JAVA_UTF8_VALIDATION                 FILE, PACKAGE                   *        Checks that fields have the same Java string UTF8 validation, based on java_string_check_utf8 file option or (pb.java).utf8_validation feature.\nFIELD_SAME_JSTYPE                               FILE, PACKAGE                   *        Checks that fields have the same value for the jstype option.\nFIELD_SAME_TYPE                                 FILE, PACKAGE                   *        Checks that fields have the same types in a given message.\nFIELD_SAME_UTF8_VALIDATION                      FILE, PACKAGE                   *        Checks that string fields have the same UTF8 validation mode.\nFILE_SAME_CC_ENABLE_ARENAS                      FILE, PACKAGE                   *        Checks that files have the same value for the cc_enable_arenas option.\nFILE_SAME_CC_GENERIC_SERVICES                   FILE, PACKAGE                   *        Checks that files have the same value for the cc_generic_services option.\nFILE_SAME_CSHARP_NAMESPACE                      FILE, PACKAGE                   *        Checks that files have the same value for the csharp_namespace option.\nFILE_SAME_GO_PACKAGE                            FILE, PACKAGE                   *        Checks that files have the same value for the go_package option.\nFILE_SAME_JAVA_GENERIC_SERVICES                 FILE, PACKAGE                   *        Checks that files have the same value for the java_generic_services option.\nFILE_SAME_JAVA_MULTIPLE_FILES                   FILE, PACKAGE                   *        Checks that files have the same value for the java_multiple_files option.\nFILE_SAME_JAVA_OUTER_CLASSNAME                  FILE, PACKAGE                   *        Checks that files have the same value for the java_outer_classname option.\nFILE_SAME_JAVA_PACKAGE                          FILE, PACKAGE                   *        Checks that files have the same value for the java_package option.\nFILE_SAME_OBJC_CLASS_PREFIX                     FILE, PACKAGE                   *        Checks that files have the same value for the objc_class_prefix option.\nFILE_SAME_OPTIMIZE_FOR                          FILE, PACKAGE                   *        Checks that files have the same value for the optimize_for option.\nFILE_SAME_PHP_CLASS_PREFIX                      FILE, PACKAGE                   *        Checks that files have the same value for the php_class_prefix option.\nFILE_SAME_PHP_METADATA_NAMESPACE                FILE, PACKAGE                   *        Checks that files have the same value for the php_metadata_namespace option.\nFILE_SAME_PHP_NAMESPACE                         FILE, PACKAGE                   *        Checks that files have the same value for the php_namespace option.\nFILE_SAME_PY_GENERIC_SERVICES                   FILE, PACKAGE                   *        Checks that files have the same value for the py_generic_services option.\nFILE_SAME_RUBY_PACKAGE                          FILE, PACKAGE                   *        Checks that files have the same value for the ruby_package option.\nFILE_SAME_SWIFT_PREFIX                          FILE, PACKAGE                   *        Checks that files have the same value for the swift_prefix option.\nFILE_SAME_SYNTAX                                FILE, PACKAGE                   *        Checks that files have the same syntax.\nMESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR  FILE, PACKAGE                   *        Checks that messages do not change the no_standard_descriptor_accessor option from false or unset to true.\nONEOF_NO_DELETE                                 FILE, PACKAGE                   *        Checks that oneofs are not deleted from a given message.\nRPC_NO_DELETE                                   FILE, PACKAGE                   *        Checks that rpcs are not deleted from a given service.\nENUM_SAME_JSON_FORMAT                           FILE, PACKAGE, WIRE_JSON        *        Checks that enums have the same JSON format support.\nENUM_VALUE_SAME_NAME                            FILE, PACKAGE, WIRE_JSON        *        Checks that enum values have the same name.\nFIELD_SAME_JSON_NAME                            FILE, PACKAGE, WIRE_JSON        *        Checks that fields have the same value for the json_name option.\nFIELD_SAME_NAME                                 FILE, PACKAGE, WIRE_JSON        *        Checks that fields have the same names in a given message.\nMESSAGE_SAME_JSON_FORMAT                        FILE, PACKAGE, WIRE_JSON        *        Checks that messages have the same JSON format support.\nFIELD_SAME_ONEOF                                FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that fields have the same oneofs in a given message.\nFILE_SAME_PACKAGE                               FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that files have the same package.\nMESSAGE_SAME_REQUIRED_FIELDS                    FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that messages have no added or deleted required fields.\nRESERVED_ENUM_NO_DELETE                         FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that reserved ranges and names are not deleted from a given enum.\nRESERVED_MESSAGE_NO_DELETE                      FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that reserved ranges and names are not deleted from a given message.\nRPC_SAME_CLIENT_STREAMING                       FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same client streaming value.\nRPC_SAME_IDEMPOTENCY_LEVEL                      FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same value for the idempotency_level option.\nRPC_SAME_REQUEST_TYPE                           FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs are have the same request type.\nRPC_SAME_RESPONSE_TYPE                          FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs are have the same response type.\nRPC_SAME_SERVER_STREAMING                       FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same server streaming value.\nPACKAGE_ENUM_NO_DELETE                          PACKAGE                                  Checks that enums are not deleted from a given package.\nPACKAGE_MESSAGE_NO_DELETE                       PACKAGE                                  Checks that messages are not deleted from a given package.\nPACKAGE_NO_DELETE                               PACKAGE                                  Checks that packages are not deleted.\nPACKAGE_SERVICE_NO_DELETE                       PACKAGE                                  Checks that services are not deleted from a given package.\nENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED       WIRE_JSON                                Checks that enum values are not deleted from a given enum unless the name is reserved.\nFIELD_NO_DELETE_UNLESS_NAME_RESERVED            WIRE_JSON                                Checks that fields are not deleted from a given message unless the name is reserved.\nFIELD_WIRE_JSON_COMPATIBLE_CARDINALITY          WIRE_JSON                                Checks that fields have wire and JSON compatible cardinalities in a given message.\nFIELD_WIRE_JSON_COMPATIBLE_TYPE                 WIRE_JSON                                Checks that fields have wire and JSON compatible types in a given message.\nENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED     WIRE_JSON, WIRE                          Checks that enum values are not deleted from a given enum unless the number is reserved.\nFIELD_NO_DELETE_UNLESS_NUMBER_RESERVED          WIRE_JSON, WIRE                          Checks that fields are not deleted from a given message unless the number is reserved.\nFIELD_WIRE_COMPATIBLE_CARDINALITY               WIRE                                     Checks that fields have wire-compatible cardinalities in a given message.\nFIELD_WIRE_COMPATIBLE_TYPE                      WIRE                                     Checks that fields have wire-compatible types in a given message.\n\t\t`\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\texpectedStdout,\n\t\t\"mod\",\n\t\t\"ls-breaking-rules\",\n\t\t\"--version\",\n\t\t\"v1\",\n\t)\n}\n\nfunc TestCheckLsBreakingRulesV1Beta1(t *testing.T) {\n\tt.Parallel()\n\texpectedStdout := `\nID                                              CATEGORIES                      DEFAULT  PURPOSE\nENUM_NO_DELETE                                  FILE                            *        Checks that enums are not deleted from a given file.\nFILE_NO_DELETE                                  FILE                            *        Checks that files are not deleted.\nFILE_SAME_PACKAGE                               FILE                            *        Checks that files have the same package.\nMESSAGE_NO_DELETE                               FILE                            *        Checks that messages are not deleted from a given file.\nSERVICE_NO_DELETE                               FILE                            *        Checks that services are not deleted from a given file.\nENUM_SAME_TYPE                                  FILE, PACKAGE                   *        Checks that enums have the same type (open vs closed).\nENUM_VALUE_NO_DELETE                            FILE, PACKAGE                   *        Checks that enum values are not deleted from a given enum.\nEXTENSION_MESSAGE_NO_DELETE                     FILE, PACKAGE                   *        Checks that extension ranges are not deleted from a given message.\nFIELD_NO_DELETE                                 FILE, PACKAGE                   *        Checks that fields are not deleted from a given message.\nFIELD_SAME_CPP_STRING_TYPE                      FILE, PACKAGE                   *        Checks that fields have the same C++ string type, based on ctype field option or (pb.cpp).string_type feature.\nFIELD_SAME_JAVA_UTF8_VALIDATION                 FILE, PACKAGE                   *        Checks that fields have the same Java string UTF8 validation, based on java_string_check_utf8 file option or (pb.java).utf8_validation feature.\nFIELD_SAME_JSTYPE                               FILE, PACKAGE                   *        Checks that fields have the same value for the jstype option.\nFIELD_SAME_UTF8_VALIDATION                      FILE, PACKAGE                   *        Checks that string fields have the same UTF8 validation mode.\nFILE_SAME_CC_ENABLE_ARENAS                      FILE, PACKAGE                   *        Checks that files have the same value for the cc_enable_arenas option.\nFILE_SAME_CC_GENERIC_SERVICES                   FILE, PACKAGE                   *        Checks that files have the same value for the cc_generic_services option.\nFILE_SAME_CSHARP_NAMESPACE                      FILE, PACKAGE                   *        Checks that files have the same value for the csharp_namespace option.\nFILE_SAME_GO_PACKAGE                            FILE, PACKAGE                   *        Checks that files have the same value for the go_package option.\nFILE_SAME_JAVA_GENERIC_SERVICES                 FILE, PACKAGE                   *        Checks that files have the same value for the java_generic_services option.\nFILE_SAME_JAVA_MULTIPLE_FILES                   FILE, PACKAGE                   *        Checks that files have the same value for the java_multiple_files option.\nFILE_SAME_JAVA_OUTER_CLASSNAME                  FILE, PACKAGE                   *        Checks that files have the same value for the java_outer_classname option.\nFILE_SAME_JAVA_PACKAGE                          FILE, PACKAGE                   *        Checks that files have the same value for the java_package option.\nFILE_SAME_OBJC_CLASS_PREFIX                     FILE, PACKAGE                   *        Checks that files have the same value for the objc_class_prefix option.\nFILE_SAME_OPTIMIZE_FOR                          FILE, PACKAGE                   *        Checks that files have the same value for the optimize_for option.\nFILE_SAME_PHP_CLASS_PREFIX                      FILE, PACKAGE                   *        Checks that files have the same value for the php_class_prefix option.\nFILE_SAME_PHP_METADATA_NAMESPACE                FILE, PACKAGE                   *        Checks that files have the same value for the php_metadata_namespace option.\nFILE_SAME_PHP_NAMESPACE                         FILE, PACKAGE                   *        Checks that files have the same value for the php_namespace option.\nFILE_SAME_PY_GENERIC_SERVICES                   FILE, PACKAGE                   *        Checks that files have the same value for the py_generic_services option.\nFILE_SAME_RUBY_PACKAGE                          FILE, PACKAGE                   *        Checks that files have the same value for the ruby_package option.\nFILE_SAME_SWIFT_PREFIX                          FILE, PACKAGE                   *        Checks that files have the same value for the swift_prefix option.\nFILE_SAME_SYNTAX                                FILE, PACKAGE                   *        Checks that files have the same syntax.\nMESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR  FILE, PACKAGE                   *        Checks that messages do not change the no_standard_descriptor_accessor option from false or unset to true.\nONEOF_NO_DELETE                                 FILE, PACKAGE                   *        Checks that oneofs are not deleted from a given message.\nRPC_NO_DELETE                                   FILE, PACKAGE                   *        Checks that rpcs are not deleted from a given service.\nENUM_SAME_JSON_FORMAT                           FILE, PACKAGE, WIRE_JSON        *        Checks that enums have the same JSON format support.\nENUM_VALUE_SAME_NAME                            FILE, PACKAGE, WIRE_JSON        *        Checks that enum values have the same name.\nFIELD_SAME_JSON_NAME                            FILE, PACKAGE, WIRE_JSON        *        Checks that fields have the same value for the json_name option.\nFIELD_SAME_NAME                                 FILE, PACKAGE, WIRE_JSON        *        Checks that fields have the same names in a given message.\nMESSAGE_SAME_JSON_FORMAT                        FILE, PACKAGE, WIRE_JSON        *        Checks that messages have the same JSON format support.\nFIELD_SAME_CARDINALITY                          FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that fields have the same cardinalities in a given message.\nFIELD_SAME_ONEOF                                FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that fields have the same oneofs in a given message.\nFIELD_SAME_TYPE                                 FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that fields have the same types in a given message.\nMESSAGE_SAME_REQUIRED_FIELDS                    FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that messages have no added or deleted required fields.\nRESERVED_ENUM_NO_DELETE                         FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that reserved ranges and names are not deleted from a given enum.\nRESERVED_MESSAGE_NO_DELETE                      FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that reserved ranges and names are not deleted from a given message.\nRPC_SAME_CLIENT_STREAMING                       FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same client streaming value.\nRPC_SAME_IDEMPOTENCY_LEVEL                      FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same value for the idempotency_level option.\nRPC_SAME_REQUEST_TYPE                           FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs are have the same request type.\nRPC_SAME_RESPONSE_TYPE                          FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs are have the same response type.\nRPC_SAME_SERVER_STREAMING                       FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same server streaming value.\nPACKAGE_ENUM_NO_DELETE                          PACKAGE                                  Checks that enums are not deleted from a given package.\nPACKAGE_MESSAGE_NO_DELETE                       PACKAGE                                  Checks that messages are not deleted from a given package.\nPACKAGE_NO_DELETE                               PACKAGE                                  Checks that packages are not deleted.\nPACKAGE_SERVICE_NO_DELETE                       PACKAGE                                  Checks that services are not deleted from a given package.\nENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED       WIRE_JSON                                Checks that enum values are not deleted from a given enum unless the name is reserved.\nFIELD_NO_DELETE_UNLESS_NAME_RESERVED            WIRE_JSON                                Checks that fields are not deleted from a given message unless the name is reserved.\nFIELD_WIRE_JSON_COMPATIBLE_CARDINALITY          WIRE_JSON                                Checks that fields have wire and JSON compatible cardinalities in a given message.\nENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED     WIRE_JSON, WIRE                          Checks that enum values are not deleted from a given enum unless the number is reserved.\nFIELD_NO_DELETE_UNLESS_NUMBER_RESERVED          WIRE_JSON, WIRE                          Checks that fields are not deleted from a given message unless the number is reserved.\nFIELD_WIRE_COMPATIBLE_CARDINALITY               WIRE                                     Checks that fields have wire-compatible cardinalities in a given message.\n\t\t`\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\texpectedStdout,\n\t\t\"mod\",\n\t\t\"ls-breaking-rules\",\n\t\t\"--version\",\n\t\t\"v1beta1\",\n\t)\n}\n\nfunc TestCheckLsBreakingRulesV2(t *testing.T) {\n\tt.Parallel()\n\texpectedStdout := `\nID                                              CATEGORIES                           DEFAULT  PURPOSE\nEXTENSION_NO_DELETE                             FILE                                 *        Checks that extensions are not deleted from a given file.\nSERVICE_NO_DELETE                               FILE                                 *        Checks that services are not deleted from a given file.\nENUM_NO_DELETE                                  CSR, FILE                            *        Checks that enums are not deleted from a given file.\nFILE_NO_DELETE                                  CSR, FILE                            *        Checks that files are not deleted.\nMESSAGE_NO_DELETE                               CSR, FILE                            *        Checks that messages are not deleted from a given file.\nENUM_SAME_TYPE                                  FILE, PACKAGE                        *        Checks that enums have the same type (open vs closed).\nFIELD_SAME_CARDINALITY                          FILE, PACKAGE                        *        Checks that fields have the same cardinalities in a given message.\nFIELD_SAME_CPP_STRING_TYPE                      FILE, PACKAGE                        *        Checks that fields have the same C++ string type, based on ctype field option or (pb.cpp).string_type feature.\nFIELD_SAME_JAVA_UTF8_VALIDATION                 FILE, PACKAGE                        *        Checks that fields have the same Java string UTF8 validation, based on java_string_check_utf8 file option or (pb.java).utf8_validation feature.\nFIELD_SAME_JSTYPE                               FILE, PACKAGE                        *        Checks that fields have the same value for the jstype option.\nFIELD_SAME_UTF8_VALIDATION                      FILE, PACKAGE                        *        Checks that string fields have the same UTF8 validation mode.\nFILE_SAME_CC_ENABLE_ARENAS                      FILE, PACKAGE                        *        Checks that files have the same value for the cc_enable_arenas option.\nFILE_SAME_CC_GENERIC_SERVICES                   FILE, PACKAGE                        *        Checks that files have the same value for the cc_generic_services option.\nFILE_SAME_CSHARP_NAMESPACE                      FILE, PACKAGE                        *        Checks that files have the same value for the csharp_namespace option.\nFILE_SAME_GO_PACKAGE                            FILE, PACKAGE                        *        Checks that files have the same value for the go_package option.\nFILE_SAME_JAVA_GENERIC_SERVICES                 FILE, PACKAGE                        *        Checks that files have the same value for the java_generic_services option.\nFILE_SAME_JAVA_MULTIPLE_FILES                   FILE, PACKAGE                        *        Checks that files have the same value for the java_multiple_files option.\nFILE_SAME_JAVA_OUTER_CLASSNAME                  FILE, PACKAGE                        *        Checks that files have the same value for the java_outer_classname option.\nFILE_SAME_JAVA_PACKAGE                          FILE, PACKAGE                        *        Checks that files have the same value for the java_package option.\nFILE_SAME_OBJC_CLASS_PREFIX                     FILE, PACKAGE                        *        Checks that files have the same value for the objc_class_prefix option.\nFILE_SAME_OPTIMIZE_FOR                          FILE, PACKAGE                        *        Checks that files have the same value for the optimize_for option.\nFILE_SAME_PHP_CLASS_PREFIX                      FILE, PACKAGE                        *        Checks that files have the same value for the php_class_prefix option.\nFILE_SAME_PHP_METADATA_NAMESPACE                FILE, PACKAGE                        *        Checks that files have the same value for the php_metadata_namespace option.\nFILE_SAME_PHP_NAMESPACE                         FILE, PACKAGE                        *        Checks that files have the same value for the php_namespace option.\nFILE_SAME_PY_GENERIC_SERVICES                   FILE, PACKAGE                        *        Checks that files have the same value for the py_generic_services option.\nFILE_SAME_RUBY_PACKAGE                          FILE, PACKAGE                        *        Checks that files have the same value for the ruby_package option.\nFILE_SAME_SWIFT_PREFIX                          FILE, PACKAGE                        *        Checks that files have the same value for the swift_prefix option.\nRPC_NO_DELETE                                   FILE, PACKAGE                        *        Checks that rpcs are not deleted from a given service.\nENUM_VALUE_NO_DELETE                            CSR, FILE, PACKAGE                   *        Checks that enum values are not deleted from a given enum.\nEXTENSION_MESSAGE_NO_DELETE                     CSR, FILE, PACKAGE                   *        Checks that extension ranges are not deleted from a given message.\nFIELD_NO_DELETE                                 CSR, FILE, PACKAGE                   *        Checks that fields are not deleted from a given message.\nFIELD_SAME_TYPE                                 CSR, FILE, PACKAGE                   *        Checks that fields have the same types in a given message.\nFILE_SAME_SYNTAX                                CSR, FILE, PACKAGE                   *        Checks that files have the same syntax.\nMESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR  CSR, FILE, PACKAGE                   *        Checks that messages do not change the no_standard_descriptor_accessor option from false or unset to true.\nONEOF_NO_DELETE                                 CSR, FILE, PACKAGE                   *        Checks that oneofs are not deleted from a given message.\nENUM_SAME_JSON_FORMAT                           CSR, FILE, PACKAGE, WIRE_JSON        *        Checks that enums have the same JSON format support.\nENUM_VALUE_SAME_NAME                            CSR, FILE, PACKAGE, WIRE_JSON        *        Checks that enum values have the same name.\nFIELD_SAME_JSON_NAME                            CSR, FILE, PACKAGE, WIRE_JSON        *        Checks that fields have the same value for the json_name option.\nFIELD_SAME_NAME                                 CSR, FILE, PACKAGE, WIRE_JSON        *        Checks that fields have the same names in a given message.\nMESSAGE_SAME_JSON_FORMAT                        CSR, FILE, PACKAGE, WIRE_JSON        *        Checks that messages have the same JSON format support.\nFIELD_SAME_DEFAULT                              CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that fields have the same default value, if a default is specified.\nFIELD_SAME_ONEOF                                CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that fields have the same oneofs in a given message.\nFILE_SAME_PACKAGE                               CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that files have the same package.\nMESSAGE_SAME_REQUIRED_FIELDS                    CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that messages have no added or deleted required fields.\nRESERVED_ENUM_NO_DELETE                         CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that reserved ranges and names are not deleted from a given enum.\nRESERVED_MESSAGE_NO_DELETE                      CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that reserved ranges and names are not deleted from a given message.\nRPC_SAME_CLIENT_STREAMING                       CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same client streaming value.\nRPC_SAME_IDEMPOTENCY_LEVEL                      CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same value for the idempotency_level option.\nRPC_SAME_REQUEST_TYPE                           CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs are have the same request type.\nRPC_SAME_RESPONSE_TYPE                          CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs are have the same response type.\nRPC_SAME_SERVER_STREAMING                       CSR, FILE, PACKAGE, WIRE_JSON, WIRE  *        Checks that rpcs have the same server streaming value.\nPACKAGE_ENUM_NO_DELETE                          PACKAGE                                       Checks that enums are not deleted from a given package.\nPACKAGE_EXTENSION_NO_DELETE                     PACKAGE                                       Checks that extensions are not deleted from a given package.\nPACKAGE_MESSAGE_NO_DELETE                       PACKAGE                                       Checks that messages are not deleted from a given package.\nPACKAGE_NO_DELETE                               PACKAGE                                       Checks that packages are not deleted.\nPACKAGE_SERVICE_NO_DELETE                       PACKAGE                                       Checks that services are not deleted from a given package.\nENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED       CSR, WIRE_JSON                                Checks that enum values are not deleted from a given enum unless the name is reserved.\nFIELD_NO_DELETE_UNLESS_NAME_RESERVED            CSR, WIRE_JSON                                Checks that fields are not deleted from a given message unless the name is reserved.\nFIELD_WIRE_JSON_COMPATIBLE_CARDINALITY          CSR, WIRE_JSON                                Checks that fields have wire and JSON compatible cardinalities in a given message.\nFIELD_WIRE_JSON_COMPATIBLE_TYPE                 CSR, WIRE_JSON                                Checks that fields have wire and JSON compatible types in a given message.\nENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED     CSR, WIRE_JSON, WIRE                          Checks that enum values are not deleted from a given enum unless the number is reserved.\nFIELD_NO_DELETE_UNLESS_NUMBER_RESERVED          CSR, WIRE_JSON, WIRE                          Checks that fields are not deleted from a given message unless the number is reserved.\nFIELD_WIRE_COMPATIBLE_CARDINALITY               WIRE                                          Checks that fields have wire-compatible cardinalities in a given message.\nFIELD_WIRE_COMPATIBLE_TYPE                      WIRE                                          Checks that fields have wire-compatible types in a given message.\n\t\t`\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\texpectedStdout,\n\t\t\"config\",\n\t\t\"ls-breaking-rules\",\n\t\t\"--version\",\n\t\t\"v2\",\n\t)\n}\n\nfunc TestCheckLsBreakingRulesFromConfig(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`\n\t \tID                    CATEGORIES     DEFAULT  PURPOSE\n\t \tENUM_VALUE_NO_DELETE  FILE, PACKAGE  *        Checks that enum values are not deleted from a given enum.\n\t \tFIELD_SAME_JSTYPE     FILE, PACKAGE  *        Checks that fields have the same value for the jstype option.\n\t \t`,\n\t\t\"mod\",\n\t\t\"ls-breaking-rules\",\n\t\t\"--config\",\n\t\tfilepath.Join(\"testdata\", \"small_list_rules\", \"buf.yaml\"),\n\t)\n\t// defaults only, built-ins and plugins.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeBreaking,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\tappend(\n\t\t\txslices.Filter(builtinBreakingRulesV2, func(breakingRule *outputCheckRule) bool {\n\t\t\t\treturn breakingRule.Default\n\t\t\t}),\n\t\t\t&outputCheckRule{ID: \"SERVICE_SUFFIXES_NO_CHANGE\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that services with configured suffixes are not deleted and do not have new RPCs or delete RPCs.\", Plugin: \"buf-plugin-suffix\"},\n\t\t),\n\t)\n\t// configure a deprecated category and a non-deprecated built-in category.\n\t// deprecated category contains some non-deprecated rules.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeBreaking,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"breaking\": {\n\t\t\t\t\"use\": [\"WIRE\", \"RESOURCE_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\tappend(\n\t\t\txslices.Filter(builtinBreakingRulesV2, func(breakingRule *outputCheckRule) bool {\n\t\t\t\treturn slices.Contains(breakingRule.Categories, \"WIRE\")\n\t\t\t}),\n\t\t\t&outputCheckRule{ID: \"ENUM_SUFFIXES_NO_CHANGE\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that enums with configured suffixes are not deleted and do not have new enum values or delete enum values.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t&outputCheckRule{ID: \"MESSAGE_SUFFIXES_NO_CHANGE\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that messages with configured suffixes are not deleted and do not have new fields or delete fields.\", Plugin: \"buf-plugin-suffix\"},\n\t\t),\n\t)\n\t// configure a deprecated category and a non-deprecated category, no built-ins.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeBreaking,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"breaking\": {\n\t\t\t\t\"use\": [\"OPERATION_SUFFIXES\",\"ATTRIBUTES_SUFFIXES\", \"RESOURCE_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\t[]*outputCheckRule{\n\t\t\t{ID: \"SERVICE_SUFFIXES_NO_CHANGE\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that services with configured suffixes are not deleted and do not have new RPCs or delete RPCs.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"ENUM_SUFFIXES_NO_CHANGE\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that enums with configured suffixes are not deleted and do not have new enum values or delete enum values.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t{ID: \"MESSAGE_SUFFIXES_NO_CHANGE\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that messages with configured suffixes are not deleted and do not have new fields or delete fields.\", Plugin: \"buf-plugin-suffix\"},\n\t\t},\n\t)\n\t// configure a mix of rules from built-ins and plugins.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeBreaking,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"breaking\": {\n\t\t\t\t\"use\": [\"FIELD_WIRE_COMPATIBLE_TYPE\", \"PACKAGE\", \"ENUM_SUFFIXES_NO_CHANGE\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\tappend(\n\t\t\txslices.Filter(builtinBreakingRulesV2, func(breakingRule *outputCheckRule) bool {\n\t\t\t\treturn slices.Contains(breakingRule.Categories, \"PACKAGE\")\n\t\t\t}),\n\t\t\t&outputCheckRule{ID: \"FIELD_WIRE_COMPATIBLE_TYPE\", Categories: []string{\"WIRE\"}, Default: false, Purpose: \"Checks that fields have wire-compatible types in a given message.\"},\n\t\t\t&outputCheckRule{ID: \"ENUM_SUFFIXES_NO_CHANGE\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that enums with configured suffixes are not deleted and do not have new enum values or delete enum values.\", Plugin: \"buf-plugin-suffix\"},\n\t\t),\n\t)\n\t// configure a mix of categories and rules from built-ins and plugins.\n\ttestLsRuleOutputJSON(\n\t\tt,\n\t\tcheck.RuleTypeBreaking,\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"breaking\": {\n\t\t\t\t\"use\": [\"FIELD_WIRE_COMPATIBLE_TYPE\", \"PACKAGE\", \"ENUM_SUFFIXES_NO_CHANGE\", \"OPERATION_SUFFIXES\"],\n\t\t\t},\n\t\t\t\"plugins\":[{\"plugin\": \"buf-plugin-suffix\"}]\n\t\t}`,\n\t\tappend(\n\t\t\txslices.Filter(builtinBreakingRulesV2, func(breakingRule *outputCheckRule) bool {\n\t\t\t\treturn slices.Contains(breakingRule.Categories, \"PACKAGE\") || breakingRule.ID == \"FIELD_WIRE_COMPATIBLE_TYPE\"\n\t\t\t}),\n\t\t\t&outputCheckRule{ID: \"SERVICE_SUFFIXES_NO_CHANGE\", Categories: []string{\"OPERATION_SUFFIXES\"}, Default: true, Purpose: \"Ensure that services with configured suffixes are not deleted and do not have new RPCs or delete RPCs.\", Plugin: \"buf-plugin-suffix\"},\n\t\t\t&outputCheckRule{ID: \"ENUM_SUFFIXES_NO_CHANGE\", Categories: []string{\"ATTRIBUTES_SUFFIXES\"}, Default: false, Purpose: \"Ensure that enums with configured suffixes are not deleted and do not have new enum values or delete enum values.\", Plugin: \"buf-plugin-suffix\"},\n\t\t),\n\t)\n}\n\nfunc TestCheckLsBreakingRulesFromConfigNotNamedBufYAML(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`\n\t\tID                    CATEGORIES     DEFAULT  PURPOSE\n\t\tENUM_VALUE_NO_DELETE  FILE, PACKAGE  *        Checks that enum values are not deleted from a given enum.\n\t\tFIELD_SAME_JSTYPE     FILE, PACKAGE  *        Checks that fields have the same value for the jstype option.\n\t\t`,\n\t\t\"mod\",\n\t\t\"ls-breaking-rules\",\n\t\t\"--config\",\n\t\t// making sure that .yml works\n\t\tfilepath.Join(\"testdata\", \"small_list_rules_yml\", \"config.yml\"),\n\t)\n}\n\nfunc TestCheckLsBreakingRulesFromConfigExceptDeprecated(t *testing.T) {\n\tt.Parallel()\n\n\tfor _, version := range bufconfig.AllFileVersions {\n\t\tt.Run(version.String(), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\t// Do not need any custom lint/breaking plugins here.\n\t\t\tclient, err := bufcheck.NewClient(slogtestext.NewLogger(t))\n\t\t\trequire.NoError(t, err)\n\t\t\tallRules, err := client.AllRules(t.Context(), check.RuleTypeBreaking, version)\n\t\t\trequire.NoError(t, err)\n\t\t\tallPackageIDs := make([]string, 0, len(allRules))\n\t\t\tfor _, rule := range allRules {\n\t\t\t\tif rule.Deprecated() {\n\t\t\t\t\t// Deprecated rules should not be associated with a category.\n\t\t\t\t\t// Instead, their replacements are associated with categories.\n\t\t\t\t\tassert.Empty(t, rule.Categories())\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tvar found bool\n\t\t\t\tfor _, category := range rule.Categories() {\n\t\t\t\t\tif category.ID() == \"PACKAGE\" {\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\tallPackageIDs = append(allPackageIDs, rule.ID())\n\t\t\t\t}\n\t\t\t}\n\t\t\tsort.Strings(allPackageIDs)\n\t\t\tdeprecations, err := bufcheck.GetDeprecatedIDToReplacementIDs(allRules)\n\t\t\trequire.NoError(t, err)\n\n\t\t\tfor deprecatedRule := range deprecations {\n\t\t\t\tt.Run(deprecatedRule, func(t *testing.T) {\n\t\t\t\t\tt.Parallel()\n\t\t\t\t\tids := getRuleIDsFromLsBreaking(t, version.String(), []string{\"PACKAGE\"}, []string{deprecatedRule})\n\t\t\t\t\texpectedIDs := make([]string, 0, len(allPackageIDs))\n\t\t\t\t\treplacements := deprecations[deprecatedRule]\n\t\t\t\t\tfor _, id := range allPackageIDs {\n\t\t\t\t\t\tif slices.Contains(replacements, id) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\texpectedIDs = append(expectedIDs, id)\n\t\t\t\t\t}\n\t\t\t\t\trequire.Equal(t, expectedIDs, ids)\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestLsModulesWorkspaceV1(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev1\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t`\na_v1\nb_no_name_v1\nc_v1beta1\nd_no_file\ne_no_file\nf_no_name_v1beta1\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as path\n\t\t`\na_v1\nb_no_name_v1\nc_v1beta1\nd_no_file\ne_no_file\nf_no_name_v1beta1\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as name\n\t\t`\nbuf.build/bar/baz\nbuf.build/foo/bar\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as json, sort by path\n\t\t`\n{\"path\":\"a_v1\",\"name\":\"buf.build/foo/bar\"}\n{\"path\":\"b_no_name_v1\"}\n{\"path\":\"c_v1beta1\",\"name\":\"buf.build/bar/baz\"}\n{\"path\":\"d_no_file\"}\n{\"path\":\"e_no_file\"}\n{\"path\":\"f_no_name_v1beta1\"}\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n}\n\nfunc TestLsModulesWorkspaceV2(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev2\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t`\na\nb_no_name\nc\nd_no_name\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as path\n\t\t`\na\nb_no_name\nc\nd_no_name\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as name\n\t\t`\nbuf.build/bar/baz\nbuf.build/foo/bar\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as json, sort by path\n\t\t`\n{\"path\":\"a\",\"name\":\"buf.build/foo/bar\"}\n{\"path\":\"b_no_name\"}\n{\"path\":\"c\",\"name\":\"buf.build/bar/baz\"}\n{\"path\":\"d_no_name\"}\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n}\n\nfunc TestLsModulesModuleV1(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\t// with name\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev1\", \"a_v1\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`\nbuf.build/foo/bar\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`{\"path\":\".\",\"name\":\"buf.build/foo/bar\"}`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n\t// without name\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev1\", \"b_no_name_v1\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\", // empty output\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`{\"path\":\".\"}`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n}\n\nfunc TestLsModulesModuleV1Beta1(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\t// with name\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev1\", \"c_v1beta1\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"buf.build/bar/baz\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`{\"path\":\".\",\"name\":\"buf.build/bar/baz\"}`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n\t// without name\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev1\", \"f_no_name_v1beta1\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\", // empty output\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`{\"path\":\".\"}`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n}\n\nfunc TestLsModulesNoConfig(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\t// with name\n\trequire.NoError(t, osext.Chdir(t.TempDir()))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\".\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\",\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`{\"path\":\".\"}`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n}\n\nfunc TestLsModulesBothConfig(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"extraconfigv1\")))\n\ttestRunStderrContainsNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t[]string{\"buf.yaml\", \"buf.work.yaml\"},\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"extraconfigv2\")))\n\ttestRunStderrContainsNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t[]string{\"buf.yaml\", \"buf.work.yaml\"},\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n}\n\nfunc TestLsModulesInvalidVersion(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspaceinvalid\")))\n\ttestRunStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t`Failure: buf.work.yaml pointed to directory \"proto\" which has a v2 buf.yaml file`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n}\n\nfunc TestLsModulesConfigFlag(t *testing.T) {\n\tt.Parallel()\n\n\t// v1beta1\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`{\"path\":\".\",\"name\":\"buf.build/bar/baz\"}`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--config\",\n\t\tfilepath.Join(\"testdata\", \"lsmodules\", \"workspacev1\", \"c_v1beta1\", \"buf.yaml\"),\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n\n\t// v1\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`{\"path\":\".\",\"name\":\"buf.build/foo/bar\"}`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--config\",\n\t\tfilepath.Join(\"testdata\", \"lsmodules\", \"workspacev1\", \"a_v1\", \"buf.yaml\"),\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n\n\t// v2\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`\n{\"path\":\"a\",\"name\":\"buf.build/foo/bar\"}\n{\"path\":\"b_no_name\"}\n{\"path\":\"c\",\"name\":\"buf.build/bar/baz\"}\n{\"path\":\"d_no_name\"}\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--config\",\n\t\tfilepath.Join(\"testdata\", \"lsmodules\", \"workspacev2\", \"buf.yaml\"),\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n}\n\nfunc TestLsModulesConfigFlagTakesPrecedence(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev1\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t`\na\nb_no_name\nc\nd_no_name\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--config\",\n\t\tfilepath.Join(pwd, \"testdata\", \"lsmodules\", \"workspacev2\", \"buf.yaml\"),\n\t)\n}\n\nfunc TestLsModulesWorkspaceV2DuplicateDirPath(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\n\trequire.NoError(t, osext.Chdir(filepath.Join(pwd, \"testdata\", \"workspace\", \"success\", \"duplicate_dir_path\")))\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// default format is path\n\t\t`\nproto/shared\nproto/shared\nproto/shared1\nproto/shared1\nseparate\n`,\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as path\n\t\t`\nproto/shared\nproto/shared\nproto/shared1\nproto/shared1\nseparate\n\t`,\n\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"path\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as name\n\t\t`\nbuf.build/shared/one\nbuf.build/shared/zero\n\t`,\n\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"name\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// format as json, sort by path\n\t\t`\n\n\t{\"path\":\"proto/shared\",\"excludes\":[\"proto/shared/prefix/foo\"]}\n\t{\"path\":\"proto/shared\",\"excludes\":[\"proto/shared/prefix/bar\"],\"name\":\"buf.build/shared/zero\"}\n\t{\"path\":\"proto/shared1\",\"includes\":[\"proto/shared1/prefix/x\"],\"name\":\"buf.build/shared/one\"}\n\t{\"path\":\"proto/shared1\",\"excludes\":[\"proto/shared1/prefix/x\"]}\n\t{\"path\":\"separate\"}\n\t`,\n\n\t\t\"config\",\n\t\t\"ls-modules\",\n\t\t\"--format\",\n\t\t\"json\",\n\t)\n}\n\nfunc TestLsBreakingRulesDeprecated(t *testing.T) {\n\tt.Parallel()\n\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"mod\", \"ls-breaking-rules\", \"--version\", \"v1beta1\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"mod\", \"ls-breaking-rules\", \"--version\", \"v1beta1\", \"--include-deprecated\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"mod\", \"ls-breaking-rules\", \"--version\", \"v1\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"mod\", \"ls-breaking-rules\", \"--version\", \"v1\", \"--include-deprecated\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--version\", \"v1beta1\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--version\", \"v1beta1\", \"--include-deprecated\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--version\", \"v1\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--version\", \"v1\", \"--include-deprecated\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.Contains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.Contains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--version\", \"v2\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\t// The deprecated rules are omitted from v2.\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--version\", \"v2\", \"--include-deprecated\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\t// Test the non-all version too. Should never have deprecated rules.\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"mod\", \"ls-breaking-rules\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"mod\", \"ls-breaking-rules\", \"--include-deprecated\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--configured-only\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(t, 0, nil, stdout, \"config\", \"ls-breaking-rules\", \"--configured-only\", \"--include-deprecated\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_CTYPE\")\n\tassert.NotContains(t, stdout.String(), \"FIELD_SAME_LABEL\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_JAVA_STRING_CHECK_UTF8\")\n\tassert.NotContains(t, stdout.String(), \"FILE_SAME_PHP_GENERIC_SERVICES\")\n}\n\nfunc TestLsFiles(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/success/buf/buf.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/success/buf/buf.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/protofileref/success/buf.proto`),\n\t\t\"ls-files\",\n\t\t// test single file ref that is not part of the module or workspace\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"success\", \"buf.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`\n\t\t\ttestdata/protofileref/success/buf.proto\n\t\t\ttestdata/protofileref/success/other.proto\n\t\t`),\n\t\t\"ls-files\",\n\t\t// test single file ref that is not part of the module or workspace\n\t\tfmt.Sprintf(\"%s#include_package_files=true\", filepath.Join(\"testdata\", \"protofileref\", \"success\", \"buf.proto\")),\n\t)\n}\n\nfunc TestLsFilesIncludeImports(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`google/protobuf/descriptor.proto\n`+filepath.FromSlash(`testdata/success/buf/buf.proto`),\n\t\t\"ls-files\",\n\t\t\"--include-imports\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`google/protobuf/descriptor.proto\n`+filepath.FromSlash(`testdata/protofileref/success/buf.proto`),\n\t\t\"ls-files\",\n\t\t\"--include-imports\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"success\", \"buf.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`google/protobuf/descriptor.proto`+filepath.FromSlash(`\n\t\ttestdata/protofileref/success/buf.proto\n\t\ttestdata/protofileref/success/other.proto\n\t\t`),\n\t\t\"ls-files\",\n\t\t\"--include-imports\",\n\t\tfmt.Sprintf(\"%s#include_package_files=true\", filepath.Join(\"testdata\", \"protofileref\", \"success\", \"buf.proto\")),\n\t)\n}\n\nfunc TestLsFilesIncludeImportsAsImportPaths(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`buf/buf.proto\ngoogle/protobuf/descriptor.proto`,\n\t\t\"ls-files\",\n\t\t\"--include-imports\",\n\t\t\"--as-import-paths\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`buf/buf.proto\ngoogle/protobuf/descriptor.proto`,\n\t\t\"ls-files\",\n\t\t\"--include-imports\",\n\t\t\"--as-import-paths\",\n\t\tfilepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"),\n\t)\n}\n\nfunc TestLsFilesImage1(t *testing.T) {\n\tt.Parallel()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-o\",\n\t\t\"-\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tstdout,\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto\n\t\t`,\n\t\t\"ls-files\",\n\t\t\"-\",\n\t)\n}\n\nfunc TestLsFilesImage1_Yaml(t *testing.T) {\n\tt.Parallel()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-o\",\n\t\t\"-#format=yaml\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tstdout,\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto\n\t\t`,\n\t\t\"ls-files\",\n\t\t\"-#format=yaml\",\n\t)\n}\n\nfunc TestLsFilesImage2(t *testing.T) {\n\tt.Parallel()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-o\",\n\t\t\"-\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tstdout,\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto\n\t\tgoogle/protobuf/descriptor.proto\n\t\t`,\n\t\t\"ls-files\",\n\t\t\"-\",\n\t\t\"--include-imports\",\n\t)\n}\n\nfunc TestLsFilesImage3(t *testing.T) {\n\tt.Parallel()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"--exclude-imports\",\n\t\t\"-o\",\n\t\t\"-\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tstdout,\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto\n\t\t`,\n\t\t\"ls-files\",\n\t\t\"-\",\n\t)\n}\n\nfunc TestLsFilesImage4(t *testing.T) {\n\tt.Parallel()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-o\",\n\t\t\"-\",\n\t\tfilepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tstdout,\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto\n\t\t`,\n\t\t\"ls-files\",\n\t\t\"-\",\n\t)\n}\n\nfunc TestLsFilesImage5(t *testing.T) {\n\tt.Parallel()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-o\",\n\t\t\"-\",\n\t\tfilepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tstdout,\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto\n\t\tgoogle/protobuf/descriptor.proto\n\t\t`,\n\t\t\"ls-files\",\n\t\t\"--include-imports\",\n\t\t\"-\",\n\t)\n}\n\nfunc TestBuildFailProtoFileRefWithPathFlag(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\", // stdout should be empty\n\t\t`Failure: --path is not valid for use with .proto file references`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"success\", \"buf\", \"buf.proto\"),\n\t\t\"-o\",\n\t\t\"-\",\n\t)\n}\n\nfunc TestImageConvertRoundtripBinaryJSONBinary(t *testing.T) {\n\tt.Parallel()\n\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-o\",\n\t\t\"-\",\n\t\tfilepath.Join(\"testdata\", \"customoptions1\"),\n\t)\n\n\tbinary1 := stdout.Bytes()\n\trequire.NotEmpty(t, binary1)\n\n\tstdin := stdout\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tstdin,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-\",\n\t\t\"-o\",\n\t\t\"-#format=json\",\n\t)\n\n\tstdin = stdout\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tstdin,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-#format=json\",\n\t\t\"-o\",\n\t\t\"-\",\n\t)\n\n\trequire.Equal(t, binary1, stdout.Bytes())\n}\n\nfunc TestImageConvertRoundtripJSONBinaryJSON(t *testing.T) {\n\tt.Parallel()\n\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-o\",\n\t\t\"-#format=json\",\n\t\tfilepath.Join(\"testdata\", \"customoptions1\"),\n\t)\n\n\tjson1 := stdout.Bytes()\n\trequire.NotEmpty(t, json1)\n\n\tstdin := stdout\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tstdin,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-#format=json\",\n\t\t\"-o\",\n\t\t\"-\",\n\t)\n\n\tstdin = stdout\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tstdin,\n\t\tstdout,\n\t\t\"build\",\n\t\t\"-\",\n\t\t\"-o\",\n\t\t\"-#format=json\",\n\t)\n\n\trequire.Equal(t, json1, stdout.Bytes())\n}\n\nfunc TestModInitBasic(t *testing.T) {\n\tt.Parallel()\n\ttestModInit(\n\t\tt,\n\t\t`# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml\nversion: v2\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n`,\n\t\tfalse,\n\t\t\"\",\n\t)\n}\n\nfunc TestLsFilesOverlappingPaths(t *testing.T) {\n\tt.Parallel()\n\t// It should be OK to have paths that overlap, and ls-files (and other commands)\n\t// should output the union.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/paths/a/v3/a.proto\ntestdata/paths/a/v3/foo/bar.proto\ntestdata/paths/a/v3/foo/foo.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t)\n}\n\nfunc TestBuildOverlappingPaths(t *testing.T) {\n\tt.Parallel()\n\t// This may differ from LsFilesOverlappingPaths as we do a build of an image here.\n\t// Building of images results in bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles being\n\t// called, which is the original source of the issue that resulted in this test.\n\ttestBuildLsFilesFormatImport(\n\t\tt,\n\t\t0,\n\t\t[]string{\n\t\t\t`a/v3/a.proto`,\n\t\t\t`a/v3/foo/bar.proto`,\n\t\t\t`a/v3/foo/foo.proto`,\n\t\t},\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t)\n}\n\nfunc TestExportProto(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\", \"proto\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\t// This should NOT include unimported.proto\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"request.proto\",\n\t\t\"rpc.proto\",\n\t)\n}\n\nfunc TestExportOtherProto(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\", \"other\", \"proto\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"request.proto\",\n\t\t\"unimported.proto\",\n\t\t\"another.proto\",\n\t)\n}\n\nfunc TestExportAll(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"another.proto\",\n\t\t\"request.proto\",\n\t\t\"rpc.proto\",\n\t\t\"unimported.proto\",\n\t)\n}\n\nfunc TestExportExcludeImports(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--exclude-imports\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\", \"proto\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"rpc.proto\",\n\t)\n}\n\nfunc TestExportPaths(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"export\", \"other\", \"proto\", \"request.proto\"),\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"request.proto\",\n\t)\n}\n\nfunc TestExportPathsAndExcludes(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t\t\"-o\",\n\t\ttempDir,\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"a/v3/a.proto\",\n\t)\n\tstoragetesting.AssertNotExist(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"a/v3/foo/foo.proto\",\n\t)\n\tstoragetesting.AssertNotExist(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"a/v3/foo/bar.proto\",\n\t)\n}\n\nfunc TestExportProtoFileRef(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\", \"proto\", \"rpc.proto\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"request.proto\",\n\t\t\"rpc.proto\",\n\t)\n}\n\nfunc TestExportProtoFileRefExcludeImports(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--exclude-imports\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\", \"proto\", \"rpc.proto\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"rpc.proto\",\n\t)\n}\n\nfunc TestExportProtoFileRefIncludePackageFiles(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfmt.Sprintf(\"%s#include_package_files=true\", filepath.Join(\"testdata\", \"export\", \"other\", \"proto\", \"request.proto\")),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"request.proto\",\n\t\t\"unimported.proto\",\n\t\t\"another.proto\",\n\t)\n}\n\nfunc TestExportProtoFileRefIncludePackageFilesExcludeImports(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--exclude-imports\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfmt.Sprintf(\"%s#include_package_files=true\", filepath.Join(\"testdata\", \"export\", \"other\", \"proto\", \"request.proto\")),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"request.proto\",\n\t\t\"unimported.proto\",\n\t)\n}\n\nfunc TestExportProtoFileRefWithPathFlag(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\", // stdout should be empty\n\t\t`Failure: --path is not valid for use with .proto file references`,\n\t\t\"export\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"success\", \"buf.proto\"),\n\t\t\"-o\",\n\t\ttempDir,\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"success\", \"buf.proto\"),\n\t)\n}\n\nfunc TestExportAllSourceFilesV1Module(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--all\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\", \"proto\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"LICENSE\",\n\t\t\"README.md\",\n\t\t\"request.proto\",\n\t\t\"rpc.proto\",\n\t)\n}\n\nfunc TestExportAllSourceFilesV1Workspace(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--all\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"export\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"LICENSE.request\",\n\t\t\"LICENSE.rpc\",\n\t\t\"README.another.md\",\n\t\t\"README.rpc.md\",\n\t\t\"another.proto\",\n\t\t\"request.proto\",\n\t\t\"rpc.proto\",\n\t\t\"unimported.proto\",\n\t)\n}\n\nfunc TestExportAllSourceFilesV2Module(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--all\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"export\", \"proto\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"LICENSE\",\n\t\t\"README.md\",\n\t\t\"request.proto\",\n\t\t\"rpc.proto\",\n\t)\n}\n\nfunc TestExportAllSourceFilesV2Workspace(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"export\",\n\t\t\"--all\",\n\t\t\"-o\",\n\t\ttempDir,\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"export\"),\n\t)\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"LICENSE.request\",\n\t\t\"LICENSE.rpc\",\n\t\t\"README.another.md\",\n\t\t\"README.rpc.md\",\n\t\t\"another.proto\",\n\t\t\"request.proto\",\n\t\t\"rpc.proto\",\n\t\t\"unimported.proto\",\n\t)\n}\n\nfunc TestBuildWithPaths(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 0, ``, \"build\", filepath.Join(\"testdata\", \"paths\"), \"--path\", filepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"), \"--exclude-path\", filepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"))\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\t\tfilepath.FromSlash(`Failure: excluded path \"testdata/paths/a/v3\" contains targeted path \"testdata/paths/a/v3/foo\", which means all paths in \"testdata/paths/a/v3/foo\" will be excluded`),\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t)\n}\n\nfunc TestLintWithPaths(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/paths/a/v3/a.proto:7:10:Field name \"Value\" should be lower_snake_case, such as \"value\".`),\n\t\t\"\",\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\",\n\t\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\t\tfilepath.FromSlash(`Failure: excluded path \"testdata/paths/a/v3\" contains targeted path \"testdata/paths/a/v3/foo\", which means all paths in \"testdata/paths/a/v3/foo\" will be excluded`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t)\n}\n\nfunc TestLintWithPlugins(t *testing.T) {\n\tt.Parallel()\n\t// defaults only, comment ignores on.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/api/v1/service.proto:11:1:Service name \"api.v1.FooServiceMock\" has banned suffix \"Mock\". (buf-plugin-suffix)\ntestdata/check_plugins/current/proto/api/v1/service.proto:12:14:RPC request type \"GetFooMockRequest\" should be named \"GetFooRequest\" or \"FooServiceMockGetFooRequest\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:12:42:RPC response type \"GetFooMockResponse\" should be named \"GetFooResponse\" or \"FooServiceMockGetFooResponse\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:16:9:Service name \"FooServiceTest\" should be suffixed with \"Service\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:17:14:RPC request type \"GetFooTestRequest\" should be named \"GetFooRequest\" or \"FooServiceTestGetFooRequest\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:17:42:RPC response type \"GetFooTestResponse\" should be named \"GetFooResponse\" or \"FooServiceTestGetFooResponse\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:26:1:\"ListFooResponse\" is a pagination response without a page token field named \"page_token\" (buf-plugin-rpc-ext)\ntestdata/check_plugins/current/proto/common/v1alpha1/messages.proto:16:5:field \"common.v1alpha1.Four.FourTwo.id\" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)\ntestdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:95:3:field \"buf.validate.Rule.id\" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)\n\t\t`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\"),\n\t)\n\t// Defaults only, comment ignores off.\n\t// Always ignore the vendored protovalidate module.\n\t//\n\t// There are still lint failures for protovalidate despite being set as an ignore path because\n\t// proto imports these files, and paths outside of a module cannot be configured as ignore paths\n\t// for the module -- this is expected behavior for now.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/api/v1/service.proto:11:1:Service name \"api.v1.FooServiceMock\" has banned suffix \"Mock\". (buf-plugin-suffix)\ntestdata/check_plugins/current/proto/api/v1/service.proto:11:9:Service name \"FooServiceMock\" should be suffixed with \"Service\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:12:14:RPC request type \"GetFooMockRequest\" should be named \"GetFooRequest\" or \"FooServiceMockGetFooRequest\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:12:42:RPC response type \"GetFooMockResponse\" should be named \"GetFooResponse\" or \"FooServiceMockGetFooResponse\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:16:1:Service name \"api.v1.FooServiceTest\" has banned suffix \"Test\". (buf-plugin-suffix)\ntestdata/check_plugins/current/proto/api/v1/service.proto:16:9:Service name \"FooServiceTest\" should be suffixed with \"Service\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:17:14:RPC request type \"GetFooTestRequest\" should be named \"GetFooRequest\" or \"FooServiceTestGetFooRequest\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:17:42:RPC response type \"GetFooTestResponse\" should be named \"GetFooResponse\" or \"FooServiceTestGetFooResponse\".\ntestdata/check_plugins/current/proto/api/v1/service.proto:26:1:\"ListFooResponse\" is a pagination response without a page token field named \"page_token\" (buf-plugin-rpc-ext)\ntestdata/check_plugins/current/proto/common/v1alpha1/messages.proto:16:5:field \"common.v1alpha1.Four.FourTwo.id\" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)\ntestdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:95:3:field \"buf.validate.Rule.id\" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)\n\t\t`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\"),\n\t\t\"--config\",\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"modules\": [\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t\t],\n\t\t\t\"lint\": {\n\t\t\t\t\"disallow_comment_ignores\": true,\n\t\t\t\t\"ignore\": [\n\t\t\t\t\t\"testdata/check_plugins/current/vendor/protovalidate\",\n    \t\t\t\t\"testdata/check_plugins/current/proto/common/v1/breaking.proto\",\n    \t\t\t\t\"testdata/check_plugins/current/proto/common/v1alpha1/breaking.proto\"\n\t\t\t\t]\n\t\t\t},\n\t\t\t\"plugins\":[\n\t\t\t\t{\n\t\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\t\"options\": {\n\t\t\t\t\t\t\"service_banned_suffixes\": [\"Mock\", \"Test\"],\n\t\t\t\t\t\t\"rpc_banned_suffixes\": [\"Element\"],\n\t\t\t\t\t\t\"field_banned_suffixes\": [\"_uuid\"],\n\t\t\t\t\t\t\"enum_value_banned_suffixes\": [\"_invalid\"],\n\t\t\t\t\t\t\"service_no_change_suffixes\": [\"Service\"],\n\t\t\t\t\t\t\"message_no_change_suffixes\": [\"Request\", \"Response\"],\n\t\t\t\t\t\t\"enum_no_change_suffixes\": [\"State\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"plugin\": \"buf-plugin-protovalidate-ext\"},\n\t\t\t\t{\"plugin\": \"buf-plugin-rpc-ext\"}\n\t\t\t]\n\t\t}`,\n\t)\n\t// With specified use, ignore, and ignore_only configurations.\n\t// Always ignore the vendored protovalidate module.\n\t//\n\t// There are still lint failures for protovalidate despite being set as an ignore path because\n\t// proto imports these files, and paths outside of a module cannot be configured as ignore paths\n\t// for the module -- this is expected behavior for now.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/api/v1/service.proto:11:1:Service name \"api.v1.FooServiceMock\" has banned suffix \"Mock\". (buf-plugin-suffix)\ntestdata/check_plugins/current/proto/common/v1alpha1/messages.proto:16:5:field \"common.v1alpha1.Four.FourTwo.id\" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)\ntestdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto:95:3:field \"buf.validate.Rule.id\" does not have rule (buf.validate.field).string.tuuid set (buf-plugin-protovalidate-ext)\n\t\t`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\"),\n\t\t\"--config\",\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"modules\": [\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t\t],\n\t\t\t\"lint\": {\n\t\t\t\t\"use\": [\"PAGE_REQUEST_HAS_TOKEN\", \"SERVICE_BANNED_SUFFIXES\", \"VALIDATE_ID_DASHLESS\"],\n\t\t\t\t\"ignore\": [\n\t\t\t\t\t\"testdata/check_plugins/current/vendor/protovalidate\",\n    \t\t\t\t\"testdata/check_plugins/current/proto/common/v1/breaking.proto\",\n    \t\t\t\t\"testdata/check_plugins/current/proto/common/v1alpha1/breaking.proto\"\n\t\t\t\t],\n\t\t\t\t\"ignore_only\": {\n\t\t\t\t\t\"VALIDATE_ID_DASHLESS\": [\"testdata/check_plugins/current/vendor/protovalidate/buf/validate\"],\n\t\t\t\t}\n\t\t\t},\n\t\t\t\"plugins\":[\n\t\t\t\t{\n\t\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\t\"options\": {\n\t\t\t\t\t\t\"service_banned_suffixes\": [\"Mock\", \"Test\"],\n\t\t\t\t\t\t\"rpc_banned_suffixes\": [\"Element\"],\n\t\t\t\t\t\t\"field_banned_suffixes\": [\"_uuid\"],\n\t\t\t\t\t\t\"enum_value_banned_suffixes\": [\"_invalid\"],\n\t\t\t\t\t\t\"service_no_change_suffixes\": [\"Service\"],\n\t\t\t\t\t\t\"message_no_change_suffixes\": [\"Request\", \"Response\"],\n\t\t\t\t\t\t\"enum_no_change_suffixes\": [\"State\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"plugin\": \"buf-plugin-protovalidate-ext\"},\n\t\t\t\t{\"plugin\": \"buf-plugin-rpc-ext\"}\n\t\t\t]\n\t\t}`,\n\t)\n\t// Set the same category for lint and breaking, but ensure that only the lint rules run.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/common.proto:8:5:Field name \"common.v1.One.Two.foo_uuid\" has banned suffix \"_uuid\". (buf-plugin-suffix)\n\t\t`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\"),\n\t\t\"--config\",\n\t\t`{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"modules\": [\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t\t],\n\t\t\t\"lint\": {\n\t\t\t\t\"use\": [\"ATTRIBUTES_SUFFIXES\"]\n\t\t\t},\n\t\t\t\"breaking\": {\n\t\t\t\t\"use\": [\"ATTRIBUTES_SUFFIXES\"]\n\t\t\t},\n\t\t\t\"plugins\":[\n\t\t\t\t{\n\t\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\t\"options\": {\n\t\t\t\t\t\t\"service_banned_suffixes\": [\"Mock\", \"Test\"],\n\t\t\t\t\t\t\"rpc_banned_suffixes\": [\"Element\"],\n\t\t\t\t\t\t\"field_banned_suffixes\": [\"_uuid\"],\n\t\t\t\t\t\t\"enum_value_banned_suffixes\": [\"_invalid\"],\n\t\t\t\t\t\t\"service_no_change_suffixes\": [\"Service\"],\n\t\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"plugin\": \"buf-plugin-protovalidate-ext\"},\n\t\t\t\t{\"plugin\": \"buf-plugin-rpc-ext\"}\n\t\t\t]\n\t\t}`,\n\t)\n\n\t// tests that if a plugin panics, the buf CLI does not panic\n\trequire.NotPanics(\n\t\tt,\n\t\tfunc() {\n\t\t\tappcmdtesting.Run(\n\t\t\t\tt,\n\t\t\t\tnewRootCommand,\n\t\t\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\t\t\tappcmdtesting.WithExpectedExitCode(1),\n\t\t\t\tappcmdtesting.WithExpectedStderrPartials(\n\t\t\t\t\t`panic: this panic is intentional`,\n\t\t\t\t\t`Failure: plugin \"buf-plugin-panic\" failed: Exited with code 2: exit status 2`,\n\t\t\t\t),\n\t\t\t\tappcmdtesting.WithArgs(\n\t\t\t\t\t\"lint\",\n\t\t\t\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\"),\n\t\t\t\t\t\"--config\",\n\t\t\t\t\t`{\n\t\t\t\t\t\"version\":\"v2\",\n\t\t\t\t\t\"modules\": [\n\t\t\t\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t\t\t\t],\n\t\t\t\t\t\"lint\": {\n\t\t\t\t\t\t\"use\": [\"LINT_PANIC\"]\n\t\t\t\t\t},\n\t\t\t\t\t\"plugins\":[\n\t\t\t\t\t\t{\"plugin\": \"buf-plugin-panic\"}\n\t\t\t\t\t]\n\t\t\t\t}`,\n\t\t\t\t),\n\t\t\t)\n\t\t},\n\t)\n}\n\nfunc TestBreakingWithPaths(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(t, nil, 0, ``, \"build\", filepath.Join(\"internal\", \"command\", \"generate\", \"testdata\", \"paths\"), \"-o\", filepath.Join(tempDir, \"previous.binpb\"))\n\ttestRunStdout(t, nil, 0, ``, \"build\", filepath.Join(\"testdata\", \"paths\"), \"-o\", filepath.Join(tempDir, \"current.binpb\"))\n\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tstoragetesting.AssertPaths(\n\t\tt,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\t\"previous.binpb\",\n\t\t\"current.binpb\",\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\t`a/v3/a.proto:6:3:Field \"1\" with name \"key\" on message \"Foo\" changed type from \"string\" to \"int32\".\na/v3/a.proto:7:3:Field \"2\" with name \"Value\" on message \"Foo\" changed option \"json_name\" from \"value\" to \"Value\".\na/v3/a.proto:7:10:Field \"2\" on message \"Foo\" changed name from \"value\" to \"Value\".`,\n\t\t\"\",\n\t\t\"breaking\",\n\t\tfilepath.Join(tempDir, \"current.binpb\"),\n\t\t\"--against\",\n\t\tfilepath.Join(tempDir, \"previous.binpb\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"a\", \"v3\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"a\", \"v3\", \"foo\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\t`a/v3/a.proto:6:3:Field \"1\" with name \"key\" on message \"Foo\" changed type from \"string\" to \"int32\". See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules.`,\n\t\t\"\",\n\t\t\"breaking\",\n\t\tfilepath.Join(tempDir, \"current.binpb\"),\n\t\t\"--against\",\n\t\tfilepath.Join(tempDir, \"previous.binpb\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"a\", \"v3\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"a\", \"v3\", \"foo\"),\n\t\t\"--config\",\n\t\t`{\"version\":\"v2\",\"breaking\":{\"use\":[\"WIRE\"]}}`,\n\t)\n}\n\nfunc TestBreakingWithPlugins(t *testing.T) {\n\tt.Parallel()\n\tcurrentConfig := `{\n\t\t\t\"version\":\"v2\",\n\t\t\t\"modules\": [\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t\t],\n\t\t\t\"breaking\": {\n\t\t\t\t\"use\": [\"STRING_LEN_RANGE_NO_SHRINK\"]\n\t\t\t},\n\t\t\t\"plugins\":[\n\t\t\t\t{\n\t\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\t\"options\": {\n\t\t\t\t\t\t\"service_banned_suffixes\": [\"Mock\", \"Test\"],\n\t\t\t\t\t\t\"rpc_banned_suffixes\": [\"Element\"],\n\t\t\t\t\t\t\"field_banned_suffixes\": [\"_uuid\"],\n\t\t\t\t\t\t\"enum_value_banned_suffixes\": [\"_invalid\"],\n\t\t\t\t\t\t\"service_no_change_suffixes\": [\"Service\"],\n\t\t\t\t\t\t\"message_no_change_suffixes\": [\"Request\", \"Response\"],\n\t\t\t\t\t\t\"enum_no_change_suffixes\": [\"State\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\"plugin\": \"buf-plugin-protovalidate-ext\"},\n\t\t\t\t{\"plugin\": \"buf-plugin-rpc-ext\"}\n\t\t\t]\n\t\t}`\n\tpreviousConfig := strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:10:5:max len requirement reduced from 10 to 5 (buf-plugin-protovalidate-ext)\ntestdata/check_plugins/current/proto/common/v1alpha1/breaking.proto:10:5:max len requirement reduced from 10 to 5 (buf-plugin-protovalidate-ext)\n\t\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\n\t// ignore unstable package\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"STRING_LEN_RANGE_NO_SHRINK\"],\n\t\t\t\"ignore_unstable_packages\": true\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"service_banned_suffixes\": [\"Mock\", \"Test\"],\n\t\t\t\t\t\"rpc_banned_suffixes\": [\"Element\"],\n\t\t\t\t\t\"field_banned_suffixes\": [\"_uuid\"],\n\t\t\t\t\t\"enum_value_banned_suffixes\": [\"_invalid\"],\n\t\t\t\t\t\"service_no_change_suffixes\": [\"Service\"],\n\t\t\t\t\t\"message_no_change_suffixes\": [\"Request\", \"Response\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"State\"]\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\"plugin\": \"buf-plugin-protovalidate-ext\"},\n\t\t\t{\"plugin\": \"buf-plugin-rpc-ext\"}\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:10:5:max len requirement reduced from 10 to 5 (buf-plugin-protovalidate-ext)\n\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\n\t// use category\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"ATTRIBUTES_SUFFIXES\"],\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t}\n\t\t\t},\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:14:1:Message \"common.v1.MSG_DONT_CHANGE\" has a suffix configured for no changes has different fields, previously [], currently [common.v1.MSG_DONT_CHANGE.new_field]. (buf-plugin-suffix)\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:18:1:Enum \"common.v1.E_DO_NOT_CHANGE\" has a suffix configured for no changes has different enum values, previously [common.v1.ZERO], currently [common.v1.ONE common.v1.ZERO]. (buf-plugin-suffix)\n\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\n\t// use deprecated category\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"RESOURCE_SUFFIXES\"],\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t}\n\t\t\t},\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:14:1:Message \"common.v1.MSG_DONT_CHANGE\" has a suffix configured for no changes has different fields, previously [], currently [common.v1.MSG_DONT_CHANGE.new_field]. (buf-plugin-suffix)\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:18:1:Enum \"common.v1.E_DO_NOT_CHANGE\" has a suffix configured for no changes has different enum values, previously [common.v1.ZERO], currently [common.v1.ONE common.v1.ZERO]. (buf-plugin-suffix)\n\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\n\t// use except\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"RESOURCE_SUFFIXES\"],\n\t\t\t\"except\": [\"ENUM_SUFFIXES_NO_CHANGE\"]\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t}\n\t\t\t},\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:14:1:Message \"common.v1.MSG_DONT_CHANGE\" has a suffix configured for no changes has different fields, previously [], currently [common.v1.MSG_DONT_CHANGE.new_field]. (buf-plugin-suffix)\n\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\n\t// ignore module\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"RESOURCE_SUFFIXES\"],\n\t\t\t\"ignore\": [\"testdata/check_plugins/current/proto\"]\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t}\n\t\t\t},\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\",\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\t// ignore path inside module\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"RESOURCE_SUFFIXES\"],\n\t\t\t\"ignore\": [\"testdata/check_plugins/current/proto/common/v1\"]\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t}\n\t\t\t},\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\",\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\t// ignore only\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"RESOURCE_SUFFIXES\"],\n\t\t\t\"ignore_only\": {\n\t\t\t\t\"MESSAGE_SUFFIXES_NO_CHANGE\": [\"testdata/check_plugins/current/proto/common\"],\n\t\t\t},\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t}\n\t\t\t},\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:18:1:Enum \"common.v1.E_DO_NOT_CHANGE\" has a suffix configured for no changes has different enum values, previously [common.v1.ZERO], currently [common.v1.ONE common.v1.ZERO]. (buf-plugin-suffix)\n\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n\t// Set the same category for lint and breaking but ensure only breaking is run.\n\tcurrentConfig = `{\n\t\t\"version\":\"v2\",\n\t\t\"modules\": [\n\t\t\t{\"path\": \"testdata/check_plugins/current/proto\"},\n\t\t\t{\"path\": \"testdata/check_plugins/current/vendor/protovalidate\"}\n\t\t],\n\t\t\"lint\": {\n\t\t\t\"use\": [\"ATTRIBUTES_SUFFIXES\"]\n\t\t},\n\t\t\"breaking\": {\n\t\t\t\"use\": [\"ATTRIBUTES_SUFFIXES\"]\n\t\t},\n\t\t\"plugins\":[\n\t\t\t{\n\t\t\t\t\"plugin\": \"buf-plugin-suffix\",\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"service_banned_suffixes\": [\"Mock\", \"Test\"],\n\t\t\t\t\t\"rpc_banned_suffixes\": [\"Element\"],\n\t\t\t\t\t\"field_banned_suffixes\": [\"_uuid\"],\n\t\t\t\t\t\"enum_value_banned_suffixes\": [\"_invalid\"],\n\t\t\t\t\t\"service_no_change_suffixes\": [\"Service\"],\n\t\t\t\t\t\"message_no_change_suffixes\": [\"DONT_CHANGE\"],\n\t\t\t\t\t\"enum_no_change_suffixes\": [\"DO_NOT_CHANGE\"]\n\t\t\t\t}\n\t\t\t},\n\t\t]\n\t}`\n\tpreviousConfig = strings.ReplaceAll(\n\t\tcurrentConfig,\n\t\t\"current\",\n\t\t\"previous\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:14:1:Message \"common.v1.MSG_DONT_CHANGE\" has a suffix configured for no changes has different fields, previously [], currently [common.v1.MSG_DONT_CHANGE.new_field]. (buf-plugin-suffix)\ntestdata/check_plugins/current/proto/common/v1/breaking.proto:18:1:Enum \"common.v1.E_DO_NOT_CHANGE\" has a suffix configured for no changes has different enum values, previously [common.v1.ZERO], currently [common.v1.ONE common.v1.ZERO]. (buf-plugin-suffix)\n\t`),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--config\",\n\t\tcurrentConfig,\n\t\t\"--against-config\",\n\t\tpreviousConfig,\n\t)\n}\n\nfunc TestBreakingAgainstRegistryFlag(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"Failure: Cannot set both --against and --against-registry\",\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"current\", \"proto\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"check_plugins\", \"previous\", \"proto\"),\n\t\t\"--against-registry\",\n\t)\n\ttestRunStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"Failure: cannot use --against-registry with unnamed module, testdata/success\",\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t\t\"--against-registry\",\n\t)\n}\n\nfunc TestVersion(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(t, nil, 0, bufcli.Version, \"--version\")\n}\n\nfunc TestConvertWithImage(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t)\n\tt.Run(\"stdin input\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tstdin, err := os.Open(filepath.Join(convertTestDataDir, \"descriptor.plain.binpb\"))\n\t\trequire.NoError(t, err)\n\t\tdefer stdin.Close()\n\t\tstdout := bytes.NewBuffer(nil)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tstdin,\n\t\t\tstdout,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t)\n\t\tassert.JSONEq(t, `{\"one\":\"55\"}`, stdout.String())\n\t})\n\n\tt.Run(\"no stdin input from binpb\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from=-#format=binpb\",\n\t\t\t\"--to=-#format=txtpb\",\n\t\t)\n\t})\n\tt.Run(\"no stdin input from txtpb\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from=-#format=txtpb\",\n\t\t\t\"--to=-#format=binpb\",\n\t\t)\n\t})\n\tt.Run(\"no stdin input from yaml\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from=-#format=yaml\",\n\t\t\t\"--to=-#format=binpb\",\n\t\t)\n\t})\n\tt.Run(\"no stdin input from json\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRunStderrContainsNoWarn(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t1,\n\t\t\t[]string{\n\t\t\t\t\"Failure: --from:\",\n\t\t\t\t\"json unmarshal:\",\n\t\t\t\t\"proto:\",\n\t\t\t\t\"syntax error (line 1:1): unexpected token\",\n\t\t\t},\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from=-#format=json\",\n\t\t\t\"--to=-#format=binpb\",\n\t\t)\n\t})\n}\n\nfunc TestConvertOutput(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t)\n\tt.Run(\"json file output\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tstdin, err := os.Open(filepath.Join(convertTestDataDir, \"descriptor.plain.binpb\"))\n\t\trequire.NoError(t, err)\n\t\tdefer stdin.Close()\n\t\toutputTempDir := t.TempDir()\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tstdin,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--to\",\n\t\t\tfilepath.Join(outputTempDir, \"result.json\"),\n\t\t)\n\t\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(outputTempDir)\n\t\trequire.NoError(t, err)\n\t\tstoragetesting.AssertPathToContent(\n\t\t\tt,\n\t\t\treadWriteBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"result.json\": `{\"one\":\"55\"}`,\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"txt file output\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tstdin, err := os.Open(filepath.Join(convertTestDataDir, \"descriptor.plain.binpb\"))\n\t\trequire.NoError(t, err)\n\t\tdefer stdin.Close()\n\t\toutputTempDir := t.TempDir()\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tstdin,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--to\",\n\t\t\tfilepath.Join(outputTempDir, \"result.txt\"),\n\t\t)\n\t\treadWriteBucket, err := storageos.NewProvider().NewReadWriteBucket(outputTempDir)\n\t\trequire.NoError(t, err)\n\t\tstoragetesting.AssertPathToContent(\n\t\t\tt,\n\t\t\treadWriteBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"result.txt\": `{\"one\":\"55\"}`,\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"stdout with dash\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tstdin, err := os.Open(filepath.Join(convertTestDataDir, \"descriptor.plain.binpb\"))\n\t\trequire.NoError(t, err)\n\t\tdefer stdin.Close()\n\t\tstdout := bytes.NewBuffer(nil)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tstdin,\n\t\t\tstdout,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--to\",\n\t\t\t\"-\",\n\t\t)\n\t\tassert.JSONEq(t, `{\"one\":\"55\"}`, stdout.String())\n\t})\n}\n\nfunc TestConvertInvalidTypeName(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t)\n\tstdin, err := os.Open(filepath.Join(convertTestDataDir, \"descriptor.plain.binpb\"))\n\trequire.NoError(t, err)\n\tdefer stdin.Close()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tstdin,\n\t\t1,\n\t\t\"\",\n\t\t`Failure: --from: \".foo\" is not a valid fully qualified type name`,\n\t\t\"convert\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\"--type\",\n\t\t\".foo\",\n\t)\n}\n\nfunc TestConvert(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"binpb-to-json-file-proto\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRunStdoutFile(t,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"--from=\"+convertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\tconvertTestDataDir+\"/bin_json/buf.proto\",\n\t\t)\n\t})\n\tt.Run(\"json-to-binpb-file-proto\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRunStdoutFile(t,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"--from=\"+convertTestDataDir+\"/bin_json/payload.json\",\n\t\t\tconvertTestDataDir+\"/bin_json/buf.proto\",\n\t\t)\n\t})\n\tt.Run(\"stdin-json-to-binpb-proto\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRunStdoutFile(t,\n\t\t\tstrings.NewReader(`{\"one\":\"55\"}`),\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=json\",\n\t\t\tconvertTestDataDir+\"/bin_json/buf.proto\",\n\t\t)\n\t})\n\tt.Run(\"stdin-binpb-to-json-proto\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/payload.binpb\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t, file,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=binpb\",\n\t\t\tconvertTestDataDir+\"/bin_json/buf.proto\",\n\t\t)\n\t})\n\tt.Run(\"stdin-json-to-json-proto\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestRunStdoutFile(t,\n\t\t\tstrings.NewReader(`{\"one\":\"55\"}`),\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\tconvertTestDataDir+\"/bin_json/buf.proto\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\")\n\t})\n\tt.Run(\"stdin-input-to-json-image\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/image.binpb\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t, file,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"-\",\n\t\t\t\"--from=\"+convertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t)\n\t})\n\tt.Run(\"stdin-json-to-json-image\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/payload.binpb\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\tconvertTestDataDir+\"/bin_json/image.binpb\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=binpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\")\n\t})\n\tt.Run(\"stdin-binpb-payload-to-json-with-image\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/payload.binpb\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\tconvertTestDataDir+\"/bin_json/image.binpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t)\n\t})\n\tt.Run(\"stdin-json-payload-to-binpb-with-image\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/payload.json\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\tconvertTestDataDir+\"/bin_json/image.binpb\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t)\n\t})\n\tt.Run(\"stdin-json-payload-to-yaml-with-image\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/payload.json\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.yaml\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\tconvertTestDataDir+\"/bin_json/image.yaml\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=yaml\",\n\t\t)\n\t})\n\tt.Run(\"stdin-image-json-to-binpb\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/image.json\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"-#format=json\",\n\t\t\t\"--from=\"+convertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t)\n\t})\n\tt.Run(\"stdin-image-json-to-yaml\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/image.json\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.yaml\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"-#format=json\",\n\t\t\t\"--from=\"+convertTestDataDir+\"/bin_json/payload.json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=yaml\",\n\t\t)\n\t})\n\tt.Run(\"stdin-image-txtpb-to-binpb\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/image.txtpb\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"-#format=txtpb\",\n\t\t\t\"--from=\"+convertTestDataDir+\"/bin_json/payload.txtpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t)\n\t})\n\tt.Run(\"stdin-image-yaml-to-binpb\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile, err := os.Open(convertTestDataDir + \"/bin_json/image.yaml\")\n\t\trequire.NoError(t, err)\n\t\ttestRunStdoutFile(t,\n\t\t\tfile,\n\t\t\t0,\n\t\t\tconvertTestDataDir+\"/bin_json/payload.binpb\",\n\t\t\t\"convert\",\n\t\t\t\"--type=buf.Foo\",\n\t\t\t\"-#format=yaml\",\n\t\t\t\"--from=\"+convertTestDataDir+\"/bin_json/payload.yaml\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t)\n\t})\n}\n\nfunc TestFormat(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t`\nsyntax = \"proto3\";\n\npackage simple;\n\nmessage Object {\n  string key = 1;\n  bytes value = 2;\n}\n\t\t`,\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"simple\"),\n\t)\n}\n\nfunc TestFormatSingleFile(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"simple\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"simple.formatted\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"format\",\n\t\tfilepath.Join(tempDir, \"simple.formatted\"),\n\t\t\"-d\",\n\t)\n}\n\nfunc TestFormatDiff(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\t0,\n\t\tnil,\n\t\tstdout,\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"diff\"),\n\t\t\"-d\",\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"formatted\"),\n\t)\n\tassert.Contains(\n\t\tt,\n\t\tstdout.String(),\n\t\t`\n@@ -1,13 +1,7 @@\n-\n syntax = \"proto3\";\n`,\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"format\",\n\t\tfilepath.Join(tempDir, \"formatted\"),\n\t\t\"-d\",\n\t)\n}\n\n// Tests if the exit code is set for common invocations of buf format\n// with the --exit-code flag.\nfunc TestFormatExitCode(t *testing.T) {\n\tt.Parallel()\n\tstdout := bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tnil,\n\t\tstdout,\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"diff\"),\n\t\t\"--exit-code\",\n\t)\n\tassert.NotEmpty(t, stdout.String())\n\tstdout = bytes.NewBuffer(nil)\n\ttestRun(\n\t\tt,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tnil,\n\t\tstdout,\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"diff\"),\n\t\t\"-d\",\n\t\t\"--exit-code\",\n\t)\n\tassert.NotEmpty(t, stdout.String())\n}\n\n// Tests if the image produced by the formatted result is\n// equivalent to the original result.\nfunc TestFormatEquivalence(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"complex\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\"--exclude-source-info\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"complex\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"formatted\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(tempDir, \"formatted\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"formatted.binpb\"),\n\t\t\"--exclude-source-info\",\n\t)\n\toriginalImageData, err := os.ReadFile(filepath.Join(tempDir, \"image.binpb\"))\n\trequire.NoError(t, err)\n\tformattedImageData, err := os.ReadFile(filepath.Join(tempDir, \"formatted.binpb\"))\n\trequire.NoError(t, err)\n\trequire.Equal(t, originalImageData, formattedImageData)\n}\n\nfunc TestFormatInvalidFlagCombination(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStderrContainsNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t[]string{\n\t\t\t`Failure: cannot use --output when using --write`,\n\t\t},\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"diff\"),\n\t\t\"-w\",\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"formatted\"),\n\t)\n}\n\nfunc TestFormatInvalidWriteWithModuleReference(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrContainsNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t[]string{\n\t\t\t`Failure: invalid input \"buf.build/acme/weather\" when using --write: must be a directory or proto file`,\n\t\t},\n\t\t\"format\",\n\t\t\"buf.build/acme/weather\",\n\t\t\"-w\",\n\t)\n}\n\nfunc TestFormatInvalidIncludePackageFiles(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrContainsNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t[]string{\n\t\t\t\"Failure: cannot specify include_package_files=true with format\",\n\t\t},\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"simple\", \"simple.proto#include_package_files=true\"),\n\t)\n}\n\nfunc TestFormatInvalidInputDoesNotCreateDirectory(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\",\n\t\tfilepath.FromSlash(`Failure: testdata/format/invalid/invalid.proto:4:12: syntax error: unexpected '.', expecting '{'`),\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"invalid\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"formatted\", \"invalid\"), // Directory output.\n\t)\n\t_, err := os.Stat(filepath.Join(tempDir, \"formatted\", \"invalid\"))\n\tassert.True(t, os.IsNotExist(err))\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\",\n\t\tfilepath.FromSlash(`Failure: testdata/format/invalid/invalid.proto:4:12: syntax error: unexpected '.', expecting '{'`),\n\t\t\"format\",\n\t\tfilepath.Join(\"testdata\", \"format\", \"invalid\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"formatted\", \"invalid\", \"invalid.proto\"), // Single file output.\n\t)\n\t_, err = os.Stat(filepath.Join(tempDir, \"formatted\", \"invalid\"))\n\tassert.True(t, os.IsNotExist(err))\n}\n\nfunc TestConvertRoundTrip(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"success\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t)\n\tt.Run(\"stdin and stdout\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tstdin := bytes.NewBufferString(`{\"one\":\"55\"}`)\n\t\tencodedMessage := bytes.NewBuffer(nil)\n\t\tdecodedMessage := bytes.NewBuffer(nil)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tstdin,\n\t\t\tencodedMessage,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=json\",\n\t\t)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tencodedMessage,\n\t\t\tdecodedMessage,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t)\n\t\tassert.JSONEq(t, `{\"one\":\"55\"}`, decodedMessage.String())\n\t})\n\tt.Run(\"stdin and stdout with type specified\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tstdin := bytes.NewBufferString(`{\"one\":\"55\"}`)\n\t\tencodedMessage := bytes.NewBuffer(nil)\n\t\tdecodedMessage := bytes.NewBuffer(nil)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tstdin,\n\t\t\tencodedMessage,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tencodedMessage,\n\t\t\tdecodedMessage,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=binpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t)\n\t\tassert.JSONEq(t, `{\"one\":\"55\"}`, decodedMessage.String())\n\t})\n\tt.Run(\"file output and input\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tstdin := bytes.NewBufferString(`{\"one\":\"55\"}`)\n\t\tdecodedMessage := bytes.NewBuffer(nil)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tstdin,\n\t\t\tnil,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=json\",\n\t\t\t\"--to\",\n\t\t\tfilepath.Join(tempDir, \"decoded_message.binpb\"),\n\t\t)\n\t\ttestRun(\n\t\t\tt,\n\t\t\t0,\n\t\t\tnil,\n\t\t\tdecodedMessage,\n\t\t\t\"convert\",\n\t\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\tfilepath.Join(tempDir, \"decoded_message.binpb\"),\n\t\t)\n\t\tassert.JSONEq(t, `{\"one\":\"55\"}`, decodedMessage.String())\n\t})\n}\n\nfunc TestProtoFileNoWorkspaceOrModule(t *testing.T) {\n\tt.Parallel()\n\t// We can build a simple proto file re that does not belong to any workspace or module\n\t// based on the directory of the input.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\",\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"noworkspaceormodule\", \"success\", \"simple.proto\"),\n\t)\n\t// However, we should fail if there is any complexity (e.g. an import that cannot be\n\t// resolved) since there is no workspace or module config to base this off of.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\"\", // no stdout\n\t\tfilepath.FromSlash(`testdata/protofileref/noworkspaceormodule/fail/import.proto:3:8:import \"`)+`google/type/date.proto\": file does not exist`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"noworkspaceormodule\", \"fail\", \"import.proto\"),\n\t)\n}\n\nfunc TestModuleArchiveDir(t *testing.T) {\n\t// Archive that defines module at input path\n\tt.Parallel()\n\tzipDir := createZipFromDir(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"failarchive\"),\n\t\t\"archive.zip\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`fail/buf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\nfail/buf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(zipDir, \"archive.zip#subdir=fail\"),\n\t)\n}\n\nfunc TestLintDisabledForModuleInWorkspace(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/lint_ignore_disabled/proto/a.proto:3:9:Message name \"foo\" should be PascalCase, such as \"Foo\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"lint_ignore_disabled\"),\n\t)\n}\n\nfunc TestLintNoSourceCodeInfoIgnores(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\t// Build image without source code info\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"--exclude-source-info\",\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t\"-o\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"lint\",\n\t\tfilepath.Join(tempDir, \"image.binpb\"),\n\t\t\"--config\",\n\t\t`{\n\t\t\"version\": \"v2\",\n\t\t\"lint\": {\n\t\t\t\"ignore_only\": {\n\t\t\t\t\"FIELD_LOWER_SNAKE_CASE\": [\"buf/buf.proto\"],\n\t\t\t\t\"PACKAGE_DIRECTORY_MATCH\": [\"buf/buf.proto\"],\n\t\t\t\t\"PACKAGE_VERSION_SUFFIX\": [\"buf/buf.proto\"],\n\t\t\t\t},\n\t\t\t},\n\t\t}`,\n\t)\n}\n\n// testBuildLsFilesFormatImport does effectively an ls-files, but via doing a build of an Image, and then\n// listing the files from the image as if --format=import was set.\nfunc testBuildLsFilesFormatImport(t *testing.T, expectedExitCode int, expectedFiles []string, buildArgs ...string) {\n\tbuffer := bytes.NewBuffer(nil)\n\ttestRun(t, expectedExitCode, nil, buffer, append([]string{\"build\", \"-o\", \"-\"}, buildArgs...)...)\n\tprotoImage := &imagev1.Image{}\n\terr := protoencoding.NewWireUnmarshaler(nil).Unmarshal(buffer.Bytes(), protoImage)\n\trequire.NoError(t, err)\n\timage, err := bufimage.NewImageForProto(protoImage)\n\trequire.NoError(t, err)\n\tvar paths []string\n\tfor _, imageFile := range image.Files() {\n\t\tpaths = append(paths, imageFile.Path())\n\t}\n\trequire.Equal(t, expectedFiles, paths)\n}\n\nfunc testModInit(t *testing.T, expectedData string, document bool, name string, deps ...string) {\n\ttempDir := t.TempDir()\n\tbaseArgs := []string{\"mod\", \"init\"}\n\targs := append(baseArgs, \"-o\", tempDir)\n\tif document {\n\t\targs = append(args, \"--doc\")\n\t}\n\tif name != \"\" {\n\t\targs = append(args, \"--name\", name)\n\t}\n\ttestRun(t, 0, nil, nil, args...)\n\tdata, err := os.ReadFile(filepath.Join(tempDir, \"buf.yaml\"))\n\trequire.NoError(t, err)\n\trequire.Equal(t, expectedData, string(data))\n}\n\nfunc testRunStdout(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStdout string, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tnewRootCommand,\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStdout(expectedStdout),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n\nfunc testRunStderr(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStderr string, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tnewRootCommand,\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStderr(expectedStderr),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n\nfunc testRunStdoutStderrNoWarn(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStdout string, expectedStderr string, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tnewRootCommand,\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStdout(expectedStdout),\n\t\tappcmdtesting.WithExpectedStderr(expectedStderr),\n\t\tappcmdtesting.WithArgs(\n\t\t\t// we do not want warnings to be part of our stderr test calculation\n\t\t\tappend(\n\t\t\t\targs,\n\t\t\t\t\"--no-warn\",\n\t\t\t)...,\n\t\t),\n\t)\n}\n\nfunc testRunStderrContainsNoWarn(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStderrPartials []string, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tnewRootCommand,\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStderrPartials(expectedStderrPartials...),\n\t\tappcmdtesting.WithArgs(\n\t\t\t// we do not want warnings to be part of our stderr test calculation\n\t\t\tappend(\n\t\t\t\targs,\n\t\t\t\t\"--no-warn\",\n\t\t\t)...,\n\t\t),\n\t)\n}\n\nfunc testRunStdoutFile(t *testing.T, stdin io.Reader, expectedExitCode int, wantFile string, args ...string) {\n\twantReader, err := os.Open(wantFile)\n\trequire.NoError(t, err)\n\twantBytes, err := io.ReadAll(wantReader)\n\trequire.NoError(t, err)\n\ttestRunStdout(\n\t\tt,\n\t\tstdin,\n\t\texpectedExitCode,\n\t\tstring(wantBytes),\n\t\targs...,\n\t)\n}\n\nfunc testRun(\n\tt *testing.T,\n\texpectedExitCode int,\n\tstdin io.Reader,\n\tstdout io.Writer,\n\targs ...string,\n) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tnewRootCommand,\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithStdout(stdout),\n\t\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n\nfunc getRuleIDsFromLsBreaking(t *testing.T, fileVersion string, useIDs []string, exceptIDs []string) []string {\n\tt.Helper()\n\tstdout := bytes.NewBuffer(nil)\n\tappcmdtesting.Run(\n\t\tt,\n\t\tnewRootCommand,\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdout(stdout),\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"config\",\n\t\t\t\"ls-breaking-rules\",\n\t\t\t\"--format=json\",\n\t\t\t\"--configured-only\",\n\t\t\t\"--config\",\n\t\t\tfmt.Sprintf(\n\t\t\t\t`{ \"version\": %q, \"breaking\": { \"use\": %s, \"except\": %s } }`,\n\t\t\t\tfileVersion,\n\t\t\t\t\"[\"+strings.Join(xslices.Map(useIDs, func(s string) string { return strconv.Quote(s) }), \",\")+\"]\",\n\t\t\t\t\"[\"+strings.Join(xslices.Map(exceptIDs, func(s string) string { return strconv.Quote(s) }), \",\")+\"]\",\n\t\t\t),\n\t\t),\n\t)\n\tvar ids []string\n\tdecoder := json.NewDecoder(stdout)\n\ttype entry struct {\n\t\tID string\n\t}\n\tfor {\n\t\tvar entry entry\n\t\terr := decoder.Decode(&entry)\n\t\tif errors.Is(err, io.EOF) {\n\t\t\tbreak\n\t\t}\n\t\trequire.NoError(t, err)\n\t\tids = append(ids, entry.ID)\n\t}\n\tsort.Strings(ids)\n\treturn ids\n}\n\nfunc testLsRuleOutputJSON(\n\tt *testing.T,\n\truleType check.RuleType,\n\tconfig string,\n\texpectedRules []*outputCheckRule,\n) {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tvar command string\n\tswitch ruleType {\n\tcase check.RuleTypeLint:\n\t\tcommand = \"ls-lint-rules\"\n\tcase check.RuleTypeBreaking:\n\t\tcommand = \"ls-breaking-rules\"\n\tdefault:\n\t\tt.Errorf(\"invalid rule type %v\", ruleType)\n\t\tt.FailNow()\n\t}\n\tappcmdtesting.Run(\n\t\tt,\n\t\tnewRootCommand,\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdout(stdout),\n\t\tappcmdtesting.WithStderr(stderr),\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"config\",\n\t\t\tcommand,\n\t\t\t\"--configured-only\",\n\t\t\t\"--config\",\n\t\t\tconfig,\n\t\t\t\"--format\",\n\t\t\t\"json\",\n\t\t),\n\t)\n\toutputRules :=\n\t\txslices.Map(\n\t\t\txslices.Filter(\n\t\t\t\tbytes.Split(stdout.Bytes(), []byte(\"\\n\")),\n\t\t\t\tfunc(outputBytes []byte) bool {\n\t\t\t\t\treturn len(outputBytes) > 0\n\t\t\t\t},\n\t\t\t),\n\t\t\tfunc(outputBytes []byte) *outputCheckRule {\n\t\t\t\tvar outputRule outputCheckRule\n\t\t\t\trequire.NoError(t, json.Unmarshal(outputBytes, &outputRule), \"unable to unmarshal %s\", string(outputBytes))\n\t\t\t\treturn &outputRule\n\t\t\t},\n\t\t)\n\trequire.Equal(t, expectedRules, outputRules)\n}\n"
  },
  {
    "path": "cmd/buf/buf_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage main\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestLsFilesSymlinks(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t// b.proto links to a .go file, which shouldn't be parsed.\n\t\t// This requires ls-files to not build an Image if we don't include imports\n\t\t// on ls-files. This test effectively verifies that we don't build unless\n\t\t// we have to.\n\t\tfilepath.FromSlash(`testdata/symlinks/a.proto\ntestdata/symlinks/b.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"symlinks\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/symlinks/a.proto`),\n\t\t\"ls-files\",\n\t\t\"--disable-symlinks\",\n\t\tfilepath.Join(\"testdata\", \"symlinks\"),\n\t)\n}\n\nfunc TestBuildSymlinks(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t100,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"symlinks\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"--disable-symlinks\",\n\t\tfilepath.Join(\"testdata\", \"symlinks\"),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/imports_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"io\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestValidNoImports(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrWithCache(\n\t\tt, nil, 0,\n\t\t\"\",\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"people\"),\n\t)\n}\n\nfunc TestValidImportFromCache(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrWithCache(\n\t\tt, nil, 0,\n\t\t\"\",\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"students\"),\n\t)\n}\n\nfunc TestValidImportFromCorruptedCacheFile(t *testing.T) {\n\tt.Parallel()\n\n\tmoduleFullName, err := bufparse.NewFullName(\"bufbuild.test\", \"bufbot\", \"people\")\n\trequire.NoError(t, err)\n\tcommitID, err := uuidutil.FromDashless(\"fc7d540124fd42db92511c19a60a1d98\")\n\trequire.NoError(t, err)\n\texpectedDigest, err := bufmodule.ParseDigest(\"b5:b22338d6faf2a727613841d760c9cbfd21af6950621a589df329e1fe6611125904c39e22a73e0aa8834006a514dbd084e6c33b6bef29c8e4835b4b9dec631465\")\n\trequire.NoError(t, err)\n\tactualDigest, err := bufmodule.ParseDigest(\"b5:87403abcc5ec8403180536840a46bef8751df78caa8ad4b46939f4673d8bd58663d0f593668651bb2cd23049fedac4989e8b28c7e0e36b9b524f58ab09bf1053\")\n\trequire.NoError(t, err)\n\tdigestMismatchError := &bufmodule.DigestMismatchError{\n\t\tFullName:       moduleFullName,\n\t\tCommitID:       commitID,\n\t\tExpectedDigest: expectedDigest,\n\t\tActualDigest:   actualDigest,\n\t}\n\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(use string) *appcmd.Command { return newRootCommand(use) },\n\t\tappcmdtesting.WithExpectedExitCode(1),\n\t\tappcmdtesting.WithExpectedStderr(appFailureError(digestMismatchError).Error()),\n\t\tappcmdtesting.WithEnv(\n\t\t\tfunc(use string) map[string]string {\n\t\t\t\treturn map[string]string{\n\t\t\t\t\tuseEnvVar(use, \"CACHE_DIR\"): filepath.Join(\"testdata\", \"imports\", \"corrupted_cache_file\"),\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"students\"),\n\t\t\t\"--no-warn\",\n\t\t),\n\t)\n}\n\nfunc TestValidImportFromCorruptedCacheDep(t *testing.T) {\n\tt.Parallel()\n\tmoduleFullName, err := bufparse.NewFullName(\"bufbuild.test\", \"bufbot\", \"students\")\n\trequire.NoError(t, err)\n\tcommitID, err := uuidutil.FromDashless(\"6c776ed5bee54462b06d31fb7f7c16b8\")\n\trequire.NoError(t, err)\n\texpectedDigest, err := bufmodule.ParseDigest(\"b5:01764dd31d0e1b8355eb3b262bba4539657af44872df6e4dfec76f57fbd9f1ae645c7c9c607db5c8352fb7041ca97111e3b0f142dafc1028832acbbc14ba1d70\")\n\trequire.NoError(t, err)\n\tactualDigest, err := bufmodule.ParseDigest(\"b5:975dad3641303843fb6a06eedf038b0e6ff41da82b8a483920afb36011e0b0a24f720a2407f5e0783389530486ff410b7e132f219add69a5c7324d54f6f89a6c\")\n\trequire.NoError(t, err)\n\tdigestMismatchError := &bufmodule.DigestMismatchError{\n\t\tFullName:       moduleFullName,\n\t\tCommitID:       commitID,\n\t\tExpectedDigest: expectedDigest,\n\t\tActualDigest:   actualDigest,\n\t}\n\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(use string) *appcmd.Command { return newRootCommand(use) },\n\t\tappcmdtesting.WithExpectedExitCode(1),\n\t\tappcmdtesting.WithExpectedStderr(appFailureError(digestMismatchError).Error()),\n\t\tappcmdtesting.WithEnv(\n\t\t\tfunc(use string) map[string]string {\n\t\t\t\treturn map[string]string{\n\t\t\t\t\tuseEnvVar(use, \"CACHE_DIR\"): filepath.Join(\"testdata\", \"imports\", \"corrupted_cache_dep\"),\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"school\"),\n\t\t\t\"--no-warn\",\n\t\t),\n\t)\n}\n\nfunc TestValidImportTransitiveFromCache(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrWithCache(\n\t\tt, nil, 0,\n\t\t\"\",\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"school\"),\n\t)\n}\n\nfunc TestValidImportWKT(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderr(\n\t\tt, nil, 0,\n\t\t\"\", // no warnings\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"wkt\"),\n\t)\n}\n\nfunc TestInvalidNonexistentImport(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrWithCache(\n\t\tt, nil, bufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/imports/failure/people/people/v1/people1.proto:5:8:import \"nonexistent.proto\": file does not exist`),\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"failure\", \"people\"),\n\t)\n}\n\nfunc TestInvalidNonexistentImportFromDirectDep(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrWithCache(\n\t\tt, nil, bufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/imports/failure/students/students/v1/students.proto:`)+`6:8:import \"people/v1/people_nonexistent.proto\": file does not exist`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"failure\", \"students\"),\n\t)\n}\n\nfunc TestInvalidImportFromTransitive(t *testing.T) {\n\tt.Parallel()\n\t// We actually want to verify that there are no warnings now. Transitive dependencies not declared\n\t// in your buf.yaml are acceptable now.\n\ttestRunStderrContainsWithCache(\n\t\tt, nil, 0,\n\t\t[]string{\n\t\t\t`WARN`,\n\t\t\t`File \"school/v1/school1.proto\" imports \"people/v1/people1.proto\", which is not in your workspace or in the dependencies declared in your buf.yaml`,\n\t\t\t`File \"school/v1/school1.proto\" imports \"people/v1/people2.proto\", which is not in your workspace or in the dependencies declared in your buf.yaml`,\n\t\t},\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"failure\", \"school\"),\n\t)\n}\n\nfunc TestInvalidImportFromTransitiveWorkspace(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderrWithCache(\n\t\tt, nil, 0,\n\t\t// We actually want to verify that there are no warnings now. deps in your v1 buf.yaml may actually\n\t\t// have an effect - they can affect your buf.lock.\n\t\t\"\",\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"failure\", \"workspace\", \"transitive_imports\"),\n\t)\n}\n\nfunc TestValidImportFromLocalOnlyWorkspaceUnnamedModules(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderr(\n\t\tt, nil, 0,\n\t\t\"\", // no warnings\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"workspace\", \"unnamed_local_only_modules\"),\n\t)\n}\n\nfunc TestGraphNoWarningsValidImportFromWorkspaceNamedModules(t *testing.T) {\n\tt.Parallel()\n\ttestRunStderr(\n\t\tt, nil, 0,\n\t\t\"\", // no warnings\n\t\t\"dep\",\n\t\t\"graph\",\n\t\tfilepath.Join(\"testdata\", \"imports\", \"success\", \"workspace\", \"valid_explicit_deps\"),\n\t)\n}\n\nfunc testRunStderrWithCache(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStderr string, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(use string) *appcmd.Command { return newRootCommand(use) },\n\t\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStderr(expectedStderr),\n\t\tappcmdtesting.WithEnv(\n\t\t\tfunc(use string) map[string]string {\n\t\t\t\treturn map[string]string{\n\t\t\t\t\tuseEnvVar(use, \"CACHE_DIR\"): filepath.Join(\"testdata\", \"imports\", \"cache\"),\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n\nfunc testRunStderrContainsWithCache(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStderrPartials []string, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(use string) *appcmd.Command { return newRootCommand(use) },\n\t\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStderrPartials(expectedStderrPartials...),\n\t\tappcmdtesting.WithEnv(\n\t\t\tfunc(use string) map[string]string {\n\t\t\t\treturn map[string]string{\n\t\t\t\t\tuseEnvVar(use, \"CACHE_DIR\"): filepath.Join(\"testdata\", \"imports\", \"cache\"),\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n\nfunc useEnvVar(use string, suffix string) string {\n\treturn strings.ToUpper(use) + \"_\" + suffix\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/const_unix.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Matching the unix-like build tags in the Golang source i.e. https://github.com/golang/go/blob/912f0750472dd4f674b69ca1616bfaf377af1805/src/os/file_unix.go#L6\n\n//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage protoc\n\n// https://github.com/protocolbuffers/protobuf/blob/336ed1820a4f2649c9aa3953d5059b03b7a77100/src/google/protobuf/compiler/command_line_interface.cc#L892-L896\n//\n// This will be \":\" for all unix-like platforms including darwin.\n// This will be \";\" for windows.\nconst includeDirPathSeparator = \":\"\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/const_windows.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\n// https://github.com/protocolbuffers/protobuf/blob/336ed1820a4f2649c9aa3953d5059b03b7a77100/src/google/protobuf/compiler/command_line_interface.cc#L892-L896\n//\n// This will be \":\" for all unix-like platforms including darwin.\n// This will be \";\" for windows.\nconst includeDirPathSeparator = \";\"\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar (\n\terrNoInputFiles = errors.New(\"no input files specified\")\n\terrArgEmpty     = errors.New(\"empty argument specified\")\n)\n\nfunc newCannotSpecifyOptWithoutOutError(pluginName string) error {\n\treturn fmt.Errorf(\"cannot specify --%s_opt without --%s_out\", pluginName, pluginName)\n}\n\nfunc newCannotSpecifyPathWithoutOutError(pluginName string) error {\n\treturn fmt.Errorf(\"cannot specify --%s=protoc-gen-%s without --%s_out\", pluginPathValuesFlagName, pluginName, pluginName)\n}\n\nfunc newRecursiveReferenceError(flagFilePath string) error {\n\treturn fmt.Errorf(\"%s recursively referenced\", flagFilePath)\n}\n\nfunc newDuplicateOutError(pluginName string) error {\n\treturn fmt.Errorf(\"duplicate --%s_out\", pluginName)\n}\n\nfunc newEmptyOptError(pluginName string) error {\n\treturn fmt.Errorf(\"empty option value for %s\", pluginName)\n}\n\nfunc newPluginPathValueEmptyError() error {\n\treturn fmt.Errorf(\"--%s had an empty value\", pluginPathValuesFlagName)\n}\n\nfunc newPluginPathValueInvalidError(pluginPathValue string) error {\n\treturn fmt.Errorf(\"--%s value invalid: %s\", pluginPathValuesFlagName, pluginPathValue)\n}\n\nfunc newPluginPathNameInvalidPrefixError(pluginName string) error {\n\treturn fmt.Errorf(`--%s had name %q which must be prefixed by \"protoc-gen-\"`, pluginPathValuesFlagName, pluginName)\n}\n\nfunc newDuplicatePluginPathError(pluginName string) error {\n\treturn fmt.Errorf(\"duplicate --%s for protoc-gen-%s\", pluginPathValuesFlagName, pluginName)\n}\n\nfunc newEncodeNotSupportedError() error {\n\treturn fmt.Errorf(\n\t\t`--%s is not supported by buf.\n\nBuf only handles the binary and JSON formats for now, however we can support this flag if there is sufficient demand.\nPlease email us at support@buf.build if this is a need for your organization.`,\n\t\tencodeFlagName,\n\t)\n}\n\nfunc newDecodeNotSupportedError() error {\n\treturn fmt.Errorf(\n\t\t`--%s is not supported by buf.\n\nBuf only handles the binary and JSON formats for now, however we can support this flag if there is sufficient demand.\nPlease email us at support@buf.build if this is a need for your organization.`,\n\t\tdecodeFlagName,\n\t)\n}\n\nfunc newDecodeRawNotSupportedError() error {\n\treturn fmt.Errorf(\n\t\t`--%s is not supported by buf.\n\nBuf only handles the binary and JSON formats for now, however we can support this flag if there is sufficient demand.\nPlease email us at support@buf.build if this is a need for your organization.`,\n\t\tdecodeRawFlagName,\n\t)\n}\n\nfunc newDescriptorSetInNotSupportedError() error {\n\treturn fmt.Errorf(\n\t\t`--%s is not supported by buf.\n\nBuf will work with cross-repository imports Buf Schema Registry, which will be based on source files, not pre-built Images.\nWe think this is a much safer option that leads to less errors and more consistent results.\n\nPlease email us at support@buf.build if this is a need for your organization.`,\n\t\tdescriptorSetInFlagName,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/flags.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tincludeDirPathsFlagName       = \"proto_path\"\n\tincludeImportsFlagName        = \"include_imports\"\n\tincludeSourceInfoFlagName     = \"include_source_info\"\n\tprintFreeFieldNumbersFlagName = \"print_free_field_numbers\"\n\toutputFlagName                = \"descriptor_set_out\"\n\tpluginPathValuesFlagName      = \"plugin\"\n\terrorFormatFlagName           = \"error_format\"\n\tbyDirFlagName                 = \"by-dir\"\n\n\tpluginFakeFlagName = \"protoc_plugin_fake\"\n\n\tencodeFlagName          = \"encode\"\n\tdecodeFlagName          = \"decode\"\n\tdecodeRawFlagName       = \"decode_raw\"\n\tdescriptorSetInFlagName = \"descriptor_set_in\"\n)\n\nvar (\n\tdefaultIncludeDirPaths = []string{\".\"}\n\tdefaultErrorFormat     = \"gcc\"\n)\n\ntype flags struct {\n\tIncludeDirPaths       []string\n\tIncludeImports        bool\n\tIncludeSourceInfo     bool\n\tPrintFreeFieldNumbers bool\n\tOutput                string\n\tErrorFormat           string\n\tByDir                 bool\n}\n\ntype env struct {\n\tflags\n\n\tPluginNamesSortedByOutIndex []string\n\tPluginNameToPluginInfo      map[string]*pluginInfo\n\tFilePaths                   []string\n}\n\ntype flagsBuilder struct {\n\tflags\n\n\tPluginPathValues []string\n\n\tEncode          string\n\tDecode          string\n\tDecodeRaw       bool\n\tDescriptorSetIn []string\n\n\tpluginFake        []string\n\tpluginNameToValue map[string]*pluginValue\n}\n\nfunc newFlagsBuilder() *flagsBuilder {\n\treturn &flagsBuilder{\n\t\tpluginNameToValue: make(map[string]*pluginValue),\n\t}\n}\n\nfunc (f *flagsBuilder) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringSliceVarP(\n\t\t&f.IncludeDirPaths,\n\t\tincludeDirPathsFlagName,\n\t\t\"I\",\n\t\t// cannot set default due to recursive flag parsing\n\t\t// no way to differentiate between default and set for now\n\t\t// perhaps we could rework pflag usage somehow\n\t\tnil,\n\t\t`The directory paths to include.`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.IncludeImports,\n\t\tincludeImportsFlagName,\n\t\tfalse,\n\t\t`Include imports in the resulting FileDescriptorSet.`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.IncludeSourceInfo,\n\t\tincludeSourceInfoFlagName,\n\t\tfalse,\n\t\t`Include source info in the resulting FileDescriptorSet.`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.PrintFreeFieldNumbers,\n\t\tprintFreeFieldNumbersFlagName,\n\t\tfalse,\n\t\t`Print the free field numbers of all messages.`,\n\t)\n\tflagSet.StringVarP(\n\t\t&f.Output,\n\t\toutputFlagName,\n\t\t\"o\",\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t`The location to write the FileDescriptorSet. Must be one of format %s.`,\n\t\t\tbuffetch.MessageFormatsString,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t// cannot set default due to recursive flag parsing\n\t\t// no way to differentiate between default and set for now\n\t\t// perhaps we could rework pflag usage somehow\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t`The error format to use. Must be one of format %s.`,\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStringsWithAliases),\n\t\t),\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.PluginPathValues,\n\t\tpluginPathValuesFlagName,\n\t\tnil,\n\t\t`The paths to the plugin executables to use, either in the form \"path/to/protoc-gen-foo\" or \"protoc-gen-foo=path/to/binary\".`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.ByDir,\n\t\tbyDirFlagName,\n\t\tfalse,\n\t\t`Execute parallel plugin calls for every directory containing .proto files.`,\n\t)\n\n\t// MUST be a StringArray instead of StringSlice so we do not split on commas\n\t// Otherwise --go_out=foo=bar,baz=bat:out would be treated as --go_out=foo=bar --go_out=baz=bat:out\n\tflagSet.StringArrayVar(\n\t\t&f.pluginFake,\n\t\tpluginFakeFlagName,\n\t\tnil,\n\t\t`If you are calling this, you should not be.`,\n\t)\n\t_ = flagSet.MarkHidden(pluginFakeFlagName)\n\n\tflagSet.StringVar(\n\t\t&f.Encode,\n\t\tencodeFlagName,\n\t\t\"\",\n\t\t`Not supported by buf.`,\n\t)\n\t_ = flagSet.MarkHidden(encodeFlagName)\n\tflagSet.StringVar(\n\t\t&f.Decode,\n\t\tdecodeFlagName,\n\t\t\"\",\n\t\t`Not supported by buf.`,\n\t)\n\t_ = flagSet.MarkHidden(decodeFlagName)\n\tflagSet.BoolVar(\n\t\t&f.DecodeRaw,\n\t\tdecodeRawFlagName,\n\t\tfalse,\n\t\t`Not supported by buf.`,\n\t)\n\t_ = flagSet.MarkHidden(decodeRawFlagName)\n\tflagSet.StringSliceVar(\n\t\t&f.DescriptorSetIn,\n\t\tdescriptorSetInFlagName,\n\t\tnil,\n\t\t`Not supported by buf.`,\n\t)\n\t_ = flagSet.MarkHidden(descriptorSetInFlagName)\n}\n\nfunc (f *flagsBuilder) Normalize(flagSet *pflag.FlagSet, name string) string {\n\tif name != \"descriptor_set_out\" && strings.HasSuffix(name, \"_out\") {\n\t\tf.pluginFakeParse(name, \"_out\", true)\n\t\treturn pluginFakeFlagName\n\t}\n\tif strings.HasSuffix(name, \"_opt\") {\n\t\tf.pluginFakeParse(name, \"_opt\", false)\n\t\treturn pluginFakeFlagName\n\t}\n\treturn strings.ReplaceAll(name, \"-\", \"_\")\n}\n\nfunc (f *flagsBuilder) Build(args []string) (*env, error) {\n\tpluginNameToPluginInfo := make(map[string]*pluginInfo)\n\tseenFlagFilePaths := make(map[string]struct{})\n\tfilePaths, err := f.buildRec(args, pluginNameToPluginInfo, seenFlagFilePaths)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := f.checkUnsupported(); err != nil {\n\t\treturn nil, err\n\t}\n\tfor pluginName, pluginInfo := range pluginNameToPluginInfo {\n\t\tif pluginInfo.Out == \"\" && len(pluginInfo.Opt) > 0 {\n\t\t\treturn nil, newCannotSpecifyOptWithoutOutError(pluginName)\n\t\t}\n\t\tif pluginInfo.Out == \"\" && pluginInfo.Path != \"\" {\n\t\t\treturn nil, newCannotSpecifyPathWithoutOutError(pluginName)\n\t\t}\n\t}\n\tpluginNamesSortedByOutIndex, err := f.getPluginNamesSortedByOutIndex(pluginNameToPluginInfo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(f.IncludeDirPaths) == 0 {\n\t\tf.IncludeDirPaths = defaultIncludeDirPaths\n\t} else {\n\t\tf.IncludeDirPaths = splitIncludeDirPaths(f.IncludeDirPaths)\n\t}\n\tif f.ErrorFormat == \"\" {\n\t\tf.ErrorFormat = defaultErrorFormat\n\t}\n\tif len(filePaths) == 0 {\n\t\treturn nil, errNoInputFiles\n\t}\n\treturn &env{\n\t\tflags:                       f.flags,\n\t\tPluginNamesSortedByOutIndex: pluginNamesSortedByOutIndex,\n\t\tPluginNameToPluginInfo:      pluginNameToPluginInfo,\n\t\tFilePaths:                   filePaths,\n\t}, nil\n}\n\nfunc (f *flagsBuilder) pluginFakeParse(name string, suffix string, isOut bool) {\n\tpluginName := strings.TrimSuffix(name, suffix)\n\tpluginValue, ok := f.pluginNameToValue[pluginName]\n\tif !ok {\n\t\tpluginValue = newPluginValue()\n\t\tf.pluginNameToValue[pluginName] = pluginValue\n\t}\n\tindex := len(f.pluginFake)\n\tif isOut {\n\t\tpluginValue.OutIndexes = append(pluginValue.OutIndexes, index)\n\t} else {\n\t\tpluginValue.OptIndexes = append(pluginValue.OptIndexes, index)\n\t}\n}\n\nfunc (f *flagsBuilder) buildRec(\n\targs []string,\n\tpluginNameToPluginInfo map[string]*pluginInfo,\n\tseenFlagFilePaths map[string]struct{},\n) ([]string, error) {\n\tif err := f.parsePluginNameToPluginInfo(pluginNameToPluginInfo); err != nil {\n\t\treturn nil, err\n\t}\n\tfilePaths := make([]string, 0, len(args))\n\tfor _, arg := range args {\n\t\tif len(arg) == 0 {\n\t\t\treturn nil, errArgEmpty\n\t\t}\n\t\tif arg[0] != '@' {\n\t\t\tfilePaths = append(filePaths, arg)\n\t\t} else {\n\t\t\tflagFilePath := normalpath.Unnormalize(arg[1:])\n\t\t\tif _, ok := seenFlagFilePaths[flagFilePath]; ok {\n\t\t\t\treturn nil, newRecursiveReferenceError(flagFilePath)\n\t\t\t}\n\t\t\tseenFlagFilePaths[flagFilePath] = struct{}{}\n\t\t\tdata, err := os.ReadFile(flagFilePath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tvar flagFilePathArgs []string\n\t\t\tfor flagFilePathArg := range strings.SplitSeq(string(data), \"\\n\") {\n\t\t\t\tflagFilePathArg = strings.TrimSpace(flagFilePathArg)\n\t\t\t\tif flagFilePathArg != \"\" {\n\t\t\t\t\tflagFilePathArgs = append(flagFilePathArgs, flagFilePathArg)\n\t\t\t\t}\n\t\t\t}\n\t\t\tsubFlagsBuilder := newFlagsBuilder()\n\t\t\tflagSet := pflag.NewFlagSet(flagFilePath, pflag.ContinueOnError)\n\t\t\tsubFlagsBuilder.Bind(flagSet)\n\t\t\tflagSet.SetNormalizeFunc(normalizeFunc(subFlagsBuilder.Normalize))\n\t\t\tif err := flagSet.Parse(flagFilePathArgs); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tsubFilePaths, err := subFlagsBuilder.buildRec(\n\t\t\t\tflagSet.Args(),\n\t\t\t\tpluginNameToPluginInfo,\n\t\t\t\tseenFlagFilePaths,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif err := f.merge(subFlagsBuilder); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfilePaths = append(filePaths, subFilePaths...)\n\t\t}\n\t}\n\treturn filePaths, nil\n}\n\n// we need to bind a separate flags as pflags overrides the values with defaults if you bind again\n// note that pflags does not error on duplicates so we do not either\nfunc (f *flagsBuilder) merge(subFlagsBuilder *flagsBuilder) error {\n\tf.IncludeDirPaths = append(f.IncludeDirPaths, subFlagsBuilder.IncludeDirPaths...)\n\tif subFlagsBuilder.IncludeImports {\n\t\tf.IncludeImports = true\n\t}\n\tif subFlagsBuilder.IncludeSourceInfo {\n\t\tf.IncludeSourceInfo = true\n\t}\n\tif subFlagsBuilder.PrintFreeFieldNumbers {\n\t\tf.PrintFreeFieldNumbers = true\n\t}\n\tif subFlagsBuilder.Output != \"\" {\n\t\tf.Output = subFlagsBuilder.Output\n\t}\n\tif subFlagsBuilder.ErrorFormat != \"\" {\n\t\tf.ErrorFormat = subFlagsBuilder.ErrorFormat\n\t}\n\tif subFlagsBuilder.ByDir {\n\t\tf.ByDir = true\n\t}\n\tf.PluginPathValues = append(f.PluginPathValues, subFlagsBuilder.PluginPathValues...)\n\tif subFlagsBuilder.Encode != \"\" {\n\t\tf.Encode = subFlagsBuilder.Encode\n\t}\n\tif subFlagsBuilder.Decode != \"\" {\n\t\tf.Decode = subFlagsBuilder.Decode\n\t}\n\tif subFlagsBuilder.DecodeRaw {\n\t\tf.DecodeRaw = true\n\t}\n\tf.DescriptorSetIn = append(f.DescriptorSetIn, subFlagsBuilder.DescriptorSetIn...)\n\treturn nil\n}\n\nfunc (f *flagsBuilder) parsePluginNameToPluginInfo(pluginNameToPluginInfo map[string]*pluginInfo) error {\n\tfor pluginName, pluginValue := range f.pluginNameToValue {\n\t\tswitch len(pluginValue.OutIndexes) {\n\t\tcase 0:\n\t\tcase 1:\n\t\t\tout := f.pluginFake[pluginValue.OutIndexes[0]]\n\t\t\tvar opt string\n\t\t\tif isOutNotAFullPath(out) {\n\t\t\t\tsplit := strings.SplitN(out, \":\", 2)\n\t\t\t\tswitch len(split) {\n\t\t\t\tcase 1:\n\t\t\t\tcase 2:\n\t\t\t\t\tout = split[1]\n\t\t\t\t\topt = split[0]\n\t\t\t\t}\n\t\t\t}\n\t\t\tpluginInfo, ok := pluginNameToPluginInfo[pluginName]\n\t\t\tif !ok {\n\t\t\t\tpluginInfo = newPluginInfo()\n\t\t\t\tpluginNameToPluginInfo[pluginName] = pluginInfo\n\t\t\t}\n\t\t\tpluginInfo.Out = out\n\t\t\tif opt != \"\" {\n\t\t\t\tfor value := range strings.SplitSeq(opt, \",\") {\n\t\t\t\t\tif value := strings.TrimSpace(value); value != \"\" {\n\t\t\t\t\t\tpluginInfo.Opt = append(pluginInfo.Opt, value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn newEmptyOptError(pluginName)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\treturn newDuplicateOutError(pluginName)\n\t\t}\n\t\tif len(pluginValue.OptIndexes) > 0 {\n\t\t\tpluginInfo, ok := pluginNameToPluginInfo[pluginName]\n\t\t\tif !ok {\n\t\t\t\tpluginInfo = newPluginInfo()\n\t\t\t\tpluginNameToPluginInfo[pluginName] = pluginInfo\n\t\t\t}\n\t\t\tfor _, optIndex := range pluginValue.OptIndexes {\n\t\t\t\tfor value := range strings.SplitSeq(f.pluginFake[optIndex], \",\") {\n\t\t\t\t\tif value := strings.TrimSpace(value); value != \"\" {\n\t\t\t\t\t\tpluginInfo.Opt = append(pluginInfo.Opt, value)\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn newEmptyOptError(pluginName)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor _, pluginPathValue := range f.PluginPathValues {\n\t\tvar pluginName string\n\t\tvar pluginPath string\n\t\tswitch split := strings.SplitN(pluginPathValue, \"=\", 2); len(split) {\n\t\tcase 0:\n\t\t\treturn newPluginPathValueEmptyError()\n\t\tcase 1:\n\t\t\tpluginName = filepath.Base(split[0])\n\t\t\tpluginPath = split[0]\n\t\tcase 2:\n\t\t\tpluginName = split[0]\n\t\t\tpluginPath = split[1]\n\t\tdefault:\n\t\t\treturn newPluginPathValueInvalidError(pluginPathValue)\n\t\t}\n\t\tif !strings.HasPrefix(pluginName, \"protoc-gen-\") {\n\t\t\treturn newPluginPathNameInvalidPrefixError(pluginName)\n\t\t}\n\t\tpluginName = strings.TrimPrefix(pluginName, \"protoc-gen-\")\n\t\tpluginInfo, ok := pluginNameToPluginInfo[pluginName]\n\t\tif !ok {\n\t\t\tpluginInfo = newPluginInfo()\n\t\t\tpluginNameToPluginInfo[pluginName] = pluginInfo\n\t\t}\n\t\tif pluginInfo.Path != \"\" {\n\t\t\treturn newDuplicatePluginPathError(pluginName)\n\t\t}\n\t\tpluginInfo.Path = pluginPath\n\t}\n\treturn nil\n}\n\nfunc (f *flagsBuilder) getPluginNamesSortedByOutIndex(\n\tpluginNameToPluginInfo map[string]*pluginInfo,\n) ([]string, error) {\n\tpluginNames := make([]string, 0, len(pluginNameToPluginInfo))\n\tfor pluginName := range pluginNameToPluginInfo {\n\t\tpluginNames = append(pluginNames, pluginName)\n\t}\n\tvar err error\n\tsort.Slice(\n\t\tpluginNames,\n\t\tfunc(i int, j int) bool {\n\t\t\tpluginName1 := pluginNames[i]\n\t\t\tpluginName2 := pluginNames[j]\n\t\t\tpluginValue1, ok := f.pluginNameToValue[pluginName1]\n\t\t\tif !ok {\n\t\t\t\terr = fmt.Errorf(\"no value for plugin name %q inside pluginNameToValue\", pluginName1)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tpluginValue2, ok := f.pluginNameToValue[pluginName2]\n\t\t\tif !ok {\n\t\t\t\terr = fmt.Errorf(\"no value for plugin name %q inside pluginNameToValue\", pluginName2)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif len(pluginValue1.OutIndexes) != 1 {\n\t\t\t\terr = fmt.Errorf(\"%d out indexes for plugin name %q\", len(pluginValue1.OutIndexes), pluginName1)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif len(pluginValue2.OutIndexes) != 1 {\n\t\t\t\terr = fmt.Errorf(\"%d out indexes for plugin name %q\", len(pluginValue2.OutIndexes), pluginName2)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn pluginValue1.OutIndexes[0] < pluginValue2.OutIndexes[0]\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn pluginNames, nil\n}\n\nfunc (f *flagsBuilder) checkUnsupported() error {\n\tif f.Encode != \"\" {\n\t\treturn newEncodeNotSupportedError()\n\t}\n\tif f.Decode != \"\" {\n\t\treturn newDecodeNotSupportedError()\n\t}\n\tif f.DecodeRaw {\n\t\treturn newDecodeRawNotSupportedError()\n\t}\n\tif len(f.DescriptorSetIn) > 0 {\n\t\treturn newDescriptorSetInNotSupportedError()\n\t}\n\treturn nil\n}\n\ntype pluginValue struct {\n\tOutIndexes []int\n\tOptIndexes []int\n}\n\nfunc newPluginValue() *pluginValue {\n\treturn &pluginValue{}\n}\n\nfunc normalizeFunc(f func(*pflag.FlagSet, string) string) func(*pflag.FlagSet, string) pflag.NormalizedName {\n\treturn func(flagSet *pflag.FlagSet, name string) pflag.NormalizedName {\n\t\treturn pflag.NormalizedName(f(flagSet, name))\n\t}\n}\n\n// https://github.com/protocolbuffers/protobuf/blob/336ed1820a4f2649c9aa3953d5059b03b7a77100/src/google/protobuf/compiler/command_line_interface.cc#L1699-L1705\n//\n// This roughly supports the equivalent of Java's -classpath flag.\n// Note that for filenames such as \"foo:bar\" on unix, this breaks, but our goal is to match\n// this flag from protoc.\nfunc splitIncludeDirPaths(includeDirPaths []string) []string {\n\tcopyIncludeDirPaths := make([]string, 0, len(includeDirPaths))\n\tfor _, includeDirPath := range includeDirPaths {\n\t\t// protocolbuffers/protobuf has true for omit_empty\n\t\tfor splitIncludeDirPath := range strings.SplitSeq(includeDirPath, includeDirPathSeparator) {\n\t\t\tif len(splitIncludeDirPath) > 0 {\n\t\t\t\tcopyIncludeDirPaths = append(copyIncludeDirPaths, splitIncludeDirPath)\n\t\t\t}\n\t\t}\n\t}\n\treturn copyIncludeDirPaths\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/flags_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/spf13/pflag\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestParseFlags(t *testing.T) {\n\tt.Parallel()\n\tabsFilePath, err := filepath.Abs(\"out\")\n\trequire.NoError(t, err)\n\ttestCases := []struct {\n\t\tArgs          []string\n\t\tExpected      *env\n\t\tExpectedError error\n\t}{\n\t\t{\n\t\t\tExpectedError: errNoInputFiles,\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: defaultIncludeDirPaths,\n\t\t\t\t\tErrorFormat:     defaultErrorFormat,\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"plugins=connect:go_out\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: \"go_out\",\n\t\t\t\t\t\tOpt: []string{\"plugins=connect\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"go_out\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"plugins=connect\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: \"go_out\",\n\t\t\t\t\t\tOpt: []string{\"plugins=connect\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"go_out\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"plugins=connect\",\n\t\t\t\t\"--plugin\",\n\t\t\t\t\"/bin/protoc-gen-go\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut:  \"go_out\",\n\t\t\t\t\t\tOpt:  []string{\"plugins=connect\"},\n\t\t\t\t\t\tPath: \"/bin/protoc-gen-go\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"go_out\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"plugins=connect\",\n\t\t\t\t\"--plugin\",\n\t\t\t\t\"protoc-gen-go=/bin/foo\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut:  \"go_out\",\n\t\t\t\t\t\tOpt:  []string{\"plugins=connect\"},\n\t\t\t\t\t\tPath: \"/bin/foo\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"@\" + filepath.Join(\"testdata\", \"1\", \"flags.txt\"),\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut:  \"go_out\",\n\t\t\t\t\t\tOpt:  []string{\"plugins=connect\"},\n\t\t\t\t\t\tPath: \"/bin/protoc-gen-go\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"@\" + filepath.Join(\"testdata\", \"2\", \"flags1.txt\"),\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut:  \"go_out\",\n\t\t\t\t\t\tOpt:  []string{\"plugins=connect\"},\n\t\t\t\t\t\tPath: \"/bin/protoc-gen-go\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"@\" + filepath.Join(\"testdata\", \"3\", \"flags1.txt\"),\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpectedError: newRecursiveReferenceError(filepath.Join(\"testdata\", \"3\", \"flags1.txt\")),\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"plugins=connect:go_out\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"foo=bar\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: \"go_out\",\n\t\t\t\t\t\tOpt: []string{\n\t\t\t\t\t\t\t\"plugins=connect\",\n\t\t\t\t\t\t\t\"foo=bar\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"plugins=connect:go_out\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"foo=bar\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"baz=bat\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: \"go_out\",\n\t\t\t\t\t\tOpt: []string{\n\t\t\t\t\t\t\t\"plugins=connect\",\n\t\t\t\t\t\t\t\"foo=bar\",\n\t\t\t\t\t\t\t\"baz=bat\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"go_out\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"foo=bar\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"baz=bat\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: \"go_out\",\n\t\t\t\t\t\tOpt: []string{\n\t\t\t\t\t\t\t\"foo=bar\",\n\t\t\t\t\t\t\t\"baz=bat\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"--error_format\",\n\t\t\t\t\"text\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"foo=bar,baz=bat:go_out\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"one=two,three=four\",\n\t\t\t\t\"--go_opt\",\n\t\t\t\t\"five=six\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"text\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: \"go_out\",\n\t\t\t\t\t\tOpt: []string{\n\t\t\t\t\t\t\t\"foo=bar\",\n\t\t\t\t\t\t\t\"baz=bat\",\n\t\t\t\t\t\t\t\"one=two\",\n\t\t\t\t\t\t\t\"three=four\",\n\t\t\t\t\t\t\t\"five=six\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"go_out\",\n\t\t\t\t\"--go_out\",\n\t\t\t\t\"go_out\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpectedError: newDuplicateOutError(\"go\"),\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"--foo_out=foo\",\n\t\t\t\t\"--bar_out=bar\",\n\t\t\t\t\"--baz_out=baz\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: defaultIncludeDirPaths,\n\t\t\t\t\tErrorFormat:     defaultErrorFormat,\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"foo\",\n\t\t\t\t\t\"bar\",\n\t\t\t\t\t\"baz\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"foo\": {\n\t\t\t\t\t\tOut: \"foo\",\n\t\t\t\t\t},\n\t\t\t\t\t\"bar\": {\n\t\t\t\t\t\tOut: \"bar\",\n\t\t\t\t\t},\n\t\t\t\t\t\"baz\": {\n\t\t\t\t\t\tOut: \"baz\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"foo\" + includeDirPathSeparator + \"bar\" + includeDirPathSeparator + \"baz\",\n\t\t\t\t\"-I\",\n\t\t\t\t\"bat\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"foo\",\n\t\t\t\t\t\t\"bar\",\n\t\t\t\t\t\t\"baz\",\n\t\t\t\t\t\t\"bat\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: defaultErrorFormat,\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"foo\" + includeDirPathSeparator + includeDirPathSeparator + \"baz\",\n\t\t\t\t\"-I\",\n\t\t\t\t\"bat\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"foo\",\n\t\t\t\t\t\t\"baz\",\n\t\t\t\t\t\t\"bat\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: defaultErrorFormat,\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"foo\" + includeDirPathSeparator + \"bar\" + includeDirPathSeparator,\n\t\t\t\t\"-I\",\n\t\t\t\t\"bat\",\n\t\t\t\t\"foo.proto\",\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"foo\",\n\t\t\t\t\t\t\"bar\",\n\t\t\t\t\t\t\"bat\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: defaultErrorFormat,\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"foo.proto\",\n\t\t\t\tfmt.Sprintf(\"--go_out=%s\", absFilePath),\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"gcc\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: absFilePath,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tArgs: []string{\n\t\t\t\t\"-I\",\n\t\t\t\t\"proto\",\n\t\t\t\t\"foo.proto\",\n\t\t\t\tfmt.Sprintf(\"--go_out=opt:%s\", absFilePath),\n\t\t\t},\n\t\t\tExpected: &env{\n\t\t\t\tflags: flags{\n\t\t\t\t\tIncludeDirPaths: []string{\n\t\t\t\t\t\t\"proto\",\n\t\t\t\t\t},\n\t\t\t\t\tErrorFormat: \"gcc\",\n\t\t\t\t},\n\t\t\t\tPluginNamesSortedByOutIndex: []string{\n\t\t\t\t\t\"go\",\n\t\t\t\t},\n\t\t\t\tPluginNameToPluginInfo: map[string]*pluginInfo{\n\t\t\t\t\t\"go\": {\n\t\t\t\t\t\tOut: absFilePath,\n\t\t\t\t\t\tOpt: []string{\"opt\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tFilePaths: []string{\n\t\t\t\t\t\"foo.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tfor i, testCase := range testCases {\n\t\tname := fmt.Sprintf(\"%d\", i)\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tenv, err := testParseFlags(name, testCase.Args)\n\t\t\tif testCase.ExpectedError != nil {\n\t\t\t\tassert.Equal(t, testCase.ExpectedError, err)\n\t\t\t} else {\n\t\t\t\trequire.NoError(t, err)\n\t\t\t\tif env != nil {\n\t\t\t\t\t// testify counts nil and empty as different\n\t\t\t\t\t// we do not want to have to set empty values in our expected env\n\t\t\t\t\t// so we set them to nil here for comparison\n\t\t\t\t\tif len(env.IncludeDirPaths) == 0 {\n\t\t\t\t\t\tenv.IncludeDirPaths = nil\n\t\t\t\t\t}\n\t\t\t\t\tif len(env.PluginNamesSortedByOutIndex) == 0 {\n\t\t\t\t\t\tenv.PluginNamesSortedByOutIndex = nil\n\t\t\t\t\t}\n\t\t\t\t\tif len(env.PluginNameToPluginInfo) == 0 {\n\t\t\t\t\t\tenv.PluginNameToPluginInfo = nil\n\t\t\t\t\t}\n\t\t\t\t\tif len(env.FilePaths) == 0 {\n\t\t\t\t\t\tenv.FilePaths = nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tassert.Equal(t, testCase.Expected, env)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc testParseFlags(name string, args []string) (*env, error) {\n\tflagsBuilder := newFlagsBuilder()\n\tflagSet := pflag.NewFlagSet(name, pflag.ContinueOnError)\n\tflagsBuilder.Bind(flagSet)\n\tflagSet.SetNormalizeFunc(normalizeFunc(flagsBuilder.Normalize))\n\tif err := flagSet.Parse(args); err != nil {\n\t\treturn nil, err\n\t}\n\treturn flagsBuilder.Build(flagSet.Args())\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/flags_unix.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage protoc\n\n// isOutNotAFullPath checks if we need to consider the path to be a full path.\n//\n// This is always true in unix, and is true if the path is not absolute in windows.\n// This is needed because i.e.:\n//\n//\t# unix\n//\t--go_out=opt:foo/bar\n//\t--go_out=foo/bar\n//\t# windows\n//\t--go_out=opt:C:\\foo\\bar\n//\t--go_out=C:\\foo\\bar\n//\n// protoc uses : in both unix and windows to separate the opt and out, but in windows,\n// if a full path is given, then we don't want it interpreted as something we should split.\nfunc isOutNotAFullPath(path string) bool {\n\treturn true\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/flags_windows.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\nimport (\n\t\"path/filepath\"\n)\n\n// isOutNotAFullPath checks if we need to consider the path to be a full path.\n//\n// This is always true in unix, and is true if the path is not absolute in windows.\n// This is needed because i.e.:\n//\n//\t# unix\n//\t--go_out=opt:foo/bar\n//\t--go_out=foo/bar\n//\t# windows\n//\t--go_out=opt:C:\\foo\\bar\n//\t--go_out=C:\\foo\\bar\n//\n// protoc uses : in both unix and windows to separate the opt and out, but in windows,\n// if a full path is given, then we don't want it interpreted as something we should split.\nfunc isOutNotAFullPath(path string) bool {\n\treturn !filepath.IsAbs(path)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc main() {\n\tprotoplugin.Main(protoplugin.HandlerFunc(handle))\n}\n\nfunc handle(\n\t_ context.Context,\n\t_ protoplugin.PluginEnv,\n\tresponseWriter protoplugin.ResponseWriter,\n\t_ protoplugin.Request,\n) error {\n\tresponseWriter.AddCodeGeneratorResponseFiles(\n\t\t&pluginpb.CodeGeneratorResponse_File{\n\t\t\tName: proto.String(\"test.txt\"),\n\t\t\tContent: proto.String(`\n\t\t// The following line represents an insertion point named 'example'.\n\t\t// We include a few indentation to verify the whitespace is preserved\n\t\t// in the inserted content.\n\t\t//\n\t\t//     @@protoc_insertion_point(example)\n\t\t//\n\t\t// The 'other' insertion point is also included so that we verify\n\t\t// multiple insertion points can be written in a single invocation.\n\t\t//\n\t\t//   @@protoc_insertion_point(other)\n\t\t//\n\t\t// Note that all text should be added above the insertion points.\n\t\t`),\n\t\t},\n\t)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-writer/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc main() {\n\tprotoplugin.Main(protoplugin.HandlerFunc(handle))\n}\n\nfunc handle(\n\t_ context.Context,\n\t_ protoplugin.PluginEnv,\n\tresponseWriter protoplugin.ResponseWriter,\n\t_ protoplugin.Request,\n) error {\n\tresponseWriter.AddCodeGeneratorResponseFiles(\n\t\t&pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           proto.String(\"test.txt\"),\n\t\t\tInsertionPoint: proto.String(\"example\"),\n\t\t\tContent: proto.String(`\n\t\t\t// Include this comment on the 'example' insertion point.\n\t\t\t  // This is another example where whitespaces are preserved.\n\t\t\t  // And this demonstrates a newline literal (\\n).\n\t\t\t// And don't forget the windows newline literal (\\r\\n).\n\t\t`),\n\t\t},\n\t\t&pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           proto.String(\"test.txt\"),\n\t\t\tInsertionPoint: proto.String(\"other\"),\n\t\t\tContent: proto.String(`\n\t\t\t// Include this comment on the 'other' insertion point.\n\t\t`),\n\t\t},\n\t)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/plugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/bufprotopluginexec\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\ntype pluginInfo struct {\n\t// Required\n\tOut string\n\t// optional\n\tOpt []string\n\t// optional\n\tPath string\n}\n\nfunc newPluginInfo() *pluginInfo {\n\treturn &pluginInfo{}\n}\n\nfunc executePlugin(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tcontainer app.EnvStderrContainer,\n\timages []bufimage.Image,\n\tpluginName string,\n\tpluginInfo *pluginInfo,\n) (*pluginpb.CodeGeneratorResponse, error) {\n\tgenerator := bufprotopluginexec.NewGenerator(\n\t\tlogger,\n\t\tstorageosProvider,\n\t)\n\trequests, err := bufimage.ImagesToCodeGeneratorRequests(\n\t\timages,\n\t\tstrings.Join(pluginInfo.Opt, \",\"),\n\t\tbufprotopluginexec.DefaultVersion,\n\t\tfalse,\n\t\tfalse,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar options []bufprotopluginexec.GenerateOption\n\tif pluginInfo.Path != \"\" {\n\t\toptions = append(options, bufprotopluginexec.GenerateWithPluginPath(pluginInfo.Path))\n\t}\n\tresponse, err := generator.Generate(\n\t\tctx,\n\t\tcontainer,\n\t\tpluginName,\n\t\trequests,\n\t\toptions...,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"--%s_out: %v\", pluginName, err)\n\t}\n\treturn response, nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/protoc.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/bufprotoc\"\n\t\"github.com/bufbuild/buf/private/buf/bufprotopluginexec\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotoplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotoplugin/bufprotopluginos\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflagsBuilder := newFlagsBuilder()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <proto_file1> <proto_file2> ...\",\n\t\tShort: \"High-performance protoc replacement\",\n\t\tLong: `This command replaces protoc using Buf's internal compiler.\n\nThe implementation is in progress. Although it outperforms mainline protoc,\nit hasn't yet been optimized.\n\nThis protoc replacement is currently stable but should be considered a preview.\n\nAdditional flags:\n\n      --(.*)_out:                   Run the named plugin.\n      --(.*)_opt:                   Options for the named plugin.\n      @filename:                    Parse arguments from the given filename.`,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\tenv, err := flagsBuilder.Build(app.Args(container))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn run(ctx, container, env)\n\t\t\t},\n\t\t),\n\t\tBindFlags:     flagsBuilder.Bind,\n\t\tNormalizeFlag: flagsBuilder.Normalize,\n\t\tVersion: fmt.Sprintf(\n\t\t\t\"%v.%v-buf\",\n\t\t\t// DefaultVersion has an extra major version that corresponds to\n\t\t\t// backwards-compatibility level of C++ runtime. The actual version\n\t\t\t// of the compiler is just the minor and patch versions.\n\t\t\tbufprotopluginexec.DefaultVersion.GetMinor(),\n\t\t\tbufprotopluginexec.DefaultVersion.GetPatch(),\n\t\t),\n\t}\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tenv *env,\n) (retErr error) {\n\tlogger := container.Logger()\n\tdefer xslog.DebugProfile(logger)()\n\n\tif env.PrintFreeFieldNumbers && len(env.PluginNameToPluginInfo) > 0 {\n\t\treturn fmt.Errorf(\"cannot call --%s and plugins at the same time\", printFreeFieldNumbersFlagName)\n\t}\n\tif env.PrintFreeFieldNumbers && env.Output != \"\" {\n\t\treturn fmt.Errorf(\"cannot call --%s and --%s at the same time\", printFreeFieldNumbersFlagName, outputFlagName)\n\t}\n\tif len(env.PluginNameToPluginInfo) > 0 && env.Output != \"\" {\n\t\treturn fmt.Errorf(\"cannot call --%s and plugins at the same time\", outputFlagName)\n\t}\n\n\tlogger.DebugContext(\n\t\tctx,\n\t\t\"env\",\n\t\tslog.Any(\"flags\", env.flags),\n\t\tslog.Any(\"plugins\", env.PluginNameToPluginInfo),\n\t)\n\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\tmoduleSet, err := bufprotoc.NewModuleSetForProtoc(\n\t\tctx,\n\t\tlogger,\n\t\tstorageosProvider,\n\t\tenv.IncludeDirPaths,\n\t\tenv.FilePaths,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar buildOptions []bufimage.BuildImageOption\n\t// we always need source code info if we are doing generation\n\tif len(env.PluginNameToPluginInfo) == 0 && !env.IncludeSourceInfo {\n\t\tbuildOptions = append(buildOptions, bufimage.WithExcludeSourceCodeInfo())\n\t}\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tlogger,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\tbuildOptions...,\n\t)\n\tif err != nil {\n\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\tif errors.As(err, &fileAnnotationSet) {\n\t\t\tif err := bufanalysis.PrintFileAnnotationSet(\n\t\t\t\tcontainer.Stderr(),\n\t\t\t\tfileAnnotationSet,\n\t\t\t\tenv.ErrorFormat,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// we do this even though we're in protoc compatibility mode as we just need to do non-zero\n\t\t\t// but this also makes us consistent with the rest of buf\n\t\t\treturn bufctl.ErrFileAnnotation\n\t\t}\n\t\treturn err\n\t}\n\tif env.PrintFreeFieldNumbers {\n\t\tfileInfos, err := bufmodule.GetTargetFileInfos(\n\t\t\tctx,\n\t\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(\n\t\t\t\tmoduleSet,\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tvar filePaths []string\n\t\tfor _, fileInfo := range fileInfos {\n\t\t\tfilePaths = append(filePaths, fileInfo.Path())\n\t\t}\n\t\ts, err := bufimageutil.FreeMessageRangeStrings(ctx, filePaths, image)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := container.Stdout().Write([]byte(strings.Join(s, \"\\n\") + \"\\n\")); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\tif len(env.PluginNameToPluginInfo) > 0 {\n\t\timages := []bufimage.Image{image}\n\t\tif env.ByDir {\n\t\t\tf := func() (retErr error) {\n\t\t\t\tdefer xslog.DebugProfile(logger)()\n\t\t\t\timages, err = bufimage.ImageByDir(image)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := f(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tpluginResponses := make([]*bufprotoplugin.PluginResponse, 0, len(env.PluginNamesSortedByOutIndex))\n\t\tfor _, pluginName := range env.PluginNamesSortedByOutIndex {\n\t\t\tpluginInfo, ok := env.PluginNameToPluginInfo[pluginName]\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"no value in PluginNamesToPluginInfo for %q\", pluginName)\n\t\t\t}\n\t\t\tresponse, err := executePlugin(\n\t\t\t\tctx,\n\t\t\t\tlogger,\n\t\t\t\tstorageosProvider,\n\t\t\t\tcontainer,\n\t\t\t\timages,\n\t\t\t\tpluginName,\n\t\t\t\tpluginInfo,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpluginResponses = append(pluginResponses, bufprotoplugin.NewPluginResponse(response, pluginName, pluginInfo.Out))\n\t\t}\n\t\tif err := bufprotoplugin.ValidatePluginResponses(pluginResponses); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresponseWriter := bufprotopluginos.NewResponseWriter(\n\t\t\tlogger,\n\t\t\tstorageosProvider,\n\t\t)\n\t\tfor _, pluginResponse := range pluginResponses {\n\t\t\tpluginInfo, ok := env.PluginNameToPluginInfo[pluginResponse.PluginName]\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"no value in PluginNamesToPluginInfo for %q\", pluginResponse.PluginName)\n\t\t\t}\n\t\t\tif err := responseWriter.AddResponse(\n\t\t\t\tctx,\n\t\t\t\tpluginResponse.Response,\n\t\t\t\tpluginInfo.Out,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := responseWriter.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\tif env.Output == \"\" {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"required flag %q not set\", outputFlagName)\n\t}\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn controller.PutImage(\n\t\tctx,\n\t\tenv.Output,\n\t\timage,\n\t\t// Actually redundant with bufimage.BuildImageOptions right now.\n\t\tbufctl.WithImageExcludeSourceInfo(!env.IncludeSourceInfo),\n\t\tbufctl.WithImageExcludeImports(!env.IncludeImports),\n\t\tbufctl.WithImageAsFileDescriptorSet(true),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/protoc_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoc\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xtesting\"\n\t\"github.com/bufbuild/buf/private/buf/buftesting\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/prototesting\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nvar buftestingDirPath = filepath.Join(\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"private\",\n\t\"buf\",\n\t\"buftesting\",\n)\n\ntype testPluginInfo struct {\n\tname string\n\topt  string\n}\n\nfunc TestOverlap(t *testing.T) {\n\tt.Parallel()\n\t// https://github.com/bufbuild/buf/issues/113\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"-I\",\n\t\t\tfilepath.Join(\"testdata\", \"overlap\", \"a\"),\n\t\t\t\"-I\",\n\t\t\tfilepath.Join(\"testdata\", \"overlap\", \"b\"),\n\t\t\t\"-o\",\n\t\t\tapp.DevNullFilePath,\n\t\t\tfilepath.Join(\"testdata\", \"overlap\", \"a\", \"1.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"overlap\", \"b\", \"2.proto\"),\n\t\t),\n\t)\n}\n\nfunc TestComparePrintFreeFieldNumbersGoogleapis(t *testing.T) {\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\tfilePaths := buftesting.GetProtocFilePaths(t, googleapisDirPath, 100)\n\tactualProtocStdout := bytes.NewBuffer(nil)\n\tbuftesting.RunActualProtoc(\n\t\tt,\n\t\tfalse,\n\t\tfalse,\n\t\tgoogleapisDirPath,\n\t\tfilePaths,\n\t\tnil,\n\t\tactualProtocStdout,\n\t\tfmt.Sprintf(\"--%s\", printFreeFieldNumbersFlagName),\n\t)\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(actualProtocStdout.String()),\n\t\tappcmdtesting.WithArgs(\n\t\t\tappend(\n\t\t\t\t[]string{\n\t\t\t\t\t\"-I\",\n\t\t\t\t\tgoogleapisDirPath,\n\t\t\t\t\tfmt.Sprintf(\"--%s\", printFreeFieldNumbersFlagName),\n\t\t\t\t},\n\t\t\t\tfilePaths...,\n\t\t\t)...,\n\t\t),\n\t)\n}\n\nfunc TestCompareOutputGoogleapis(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\tfilePaths := buftesting.GetProtocFilePaths(t, googleapisDirPath, 100)\n\tactualProtocFileDescriptorSet := buftesting.GetActualProtocFileDescriptorSet(\n\t\tt,\n\t\tfalse,\n\t\tfalse,\n\t\tgoogleapisDirPath,\n\t\tfilePaths,\n\t)\n\tbufProtocFileDescriptorSet := testGetBufProtocFileDescriptorSet(t, googleapisDirPath)\n\tprototesting.AssertFileDescriptorSetsEqual(t, bufProtocFileDescriptorSet, actualProtocFileDescriptorSet)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisGo(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubs(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]testPluginInfo{\n\t\t\t{name: \"go\", opt: \"Mgoogle/api/auth.proto=foo\"},\n\t\t},\n\t)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisGoZip(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubsArchive(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]testPluginInfo{\n\t\t\t{name: \"go\", opt: \"Mgoogle/api/auth.proto=foo\"},\n\t\t},\n\t\tfalse,\n\t)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisGoJar(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubsArchive(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]testPluginInfo{\n\t\t\t{name: \"go\", opt: \"Mgoogle/api/auth.proto=foo\"},\n\t\t},\n\t\ttrue,\n\t)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisObjc(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubs(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]testPluginInfo{{name: \"objc\"}},\n\t)\n}\n\nfunc TestCompareInsertionPointOutput(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tinsertionTestdataDirPath := filepath.Join(\"testdata\", \"insertion\")\n\ttestCompareGeneratedStubs(\n\t\tt,\n\t\tinsertionTestdataDirPath,\n\t\t[]testPluginInfo{\n\t\t\t{name: \"insertion-point-receiver\"},\n\t\t\t{name: \"insertion-point-writer\"},\n\t\t},\n\t)\n}\n\nfunc TestInsertionPointMixedPathsSuccess(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\twd, err := os.Getwd()\n\trequire.NoError(t, err)\n\ttestInsertionPointMixedPathsSuccess(t, \".\", wd)\n\ttestInsertionPointMixedPathsSuccess(t, wd, \".\")\n}\n\n// testInsertionPointMixedPathsSuccess demonstrates that insertion points are able\n// to generate to the same output directory, even if the absolute path points to\n// the same place.\nfunc testInsertionPointMixedPathsSuccess(t *testing.T, receiverOut string, writerOut string) {\n\tdirPath := filepath.Join(\"testdata\", \"insertion\")\n\tfilePaths := buftesting.GetProtocFilePaths(t, dirPath, 100)\n\tprotocFlags := []string{\n\t\tfmt.Sprintf(\"--%s_out=%s\", \"insertion-point-receiver\", receiverOut),\n\t\tfmt.Sprintf(\"--%s_out=%s\", \"insertion-point-writer\", writerOut),\n\t}\n\terr := prototesting.RunProtoc(\n\t\tt.Context(),\n\t\t[]string{dirPath},\n\t\tfilePaths,\n\t\tfalse,\n\t\tfalse,\n\t\tmap[string]string{\n\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t},\n\t\tnil,\n\t\tprotocFlags...,\n\t)\n\trequire.Error(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithEnv(\n\t\t\tfunc(string) map[string]string {\n\t\t\t\treturn map[string]string{\n\t\t\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithArgs(\n\t\t\tappend(\n\t\t\t\tappend(\n\t\t\t\t\tprotocFlags,\n\t\t\t\t\t\"-I\",\n\t\t\t\t\tdirPath,\n\t\t\t\t\t\"--by-dir\",\n\t\t\t\t),\n\t\t\t\tfilePaths...,\n\t\t\t)...,\n\t\t),\n\t)\n}\n\nfunc testCompareGeneratedStubs(\n\tt *testing.T,\n\tdirPath string,\n\tplugins []testPluginInfo,\n) {\n\tfilePaths := buftesting.GetProtocFilePaths(t, dirPath, 100)\n\tactualProtocDir := t.TempDir()\n\tbufProtocDir := t.TempDir()\n\tvar actualProtocPluginFlags []string\n\tfor _, plugin := range plugins {\n\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_out=%s\", plugin.name, actualProtocDir))\n\t\tif plugin.opt != \"\" {\n\t\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_opt=%s\", plugin.name, plugin.opt))\n\t\t}\n\t}\n\tbuftesting.RunActualProtoc(\n\t\tt,\n\t\tfalse,\n\t\tfalse,\n\t\tdirPath,\n\t\tfilePaths,\n\t\tmap[string]string{\n\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t},\n\t\tnil,\n\t\tactualProtocPluginFlags...,\n\t)\n\tvar bufProtocPluginFlags []string\n\tfor _, plugin := range plugins {\n\t\tbufProtocPluginFlags = append(bufProtocPluginFlags, fmt.Sprintf(\"--%s_out=%s\", plugin.name, bufProtocDir))\n\t\tif plugin.opt != \"\" {\n\t\t\tbufProtocPluginFlags = append(bufProtocPluginFlags, fmt.Sprintf(\"--%s_opt=%s\", plugin.name, plugin.opt))\n\t\t}\n\t}\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithEnv(\n\t\t\tfunc(string) map[string]string {\n\t\t\t\treturn map[string]string{\n\t\t\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithArgs(\n\t\t\tappend(\n\t\t\t\tappend(\n\t\t\t\t\tbufProtocPluginFlags,\n\t\t\t\t\t\"-I\",\n\t\t\t\t\tdirPath,\n\t\t\t\t\t\"--by-dir\",\n\t\t\t\t),\n\t\t\t\tfilePaths...,\n\t\t\t)...,\n\t\t),\n\t)\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\tactualReadWriteBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tactualProtocDir,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\tbufReadWriteBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tbufProtocDir,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\tdiff, err := storage.DiffBytes(\n\t\tt.Context(),\n\t\tactualReadWriteBucket,\n\t\tbufReadWriteBucket,\n\t)\n\trequire.NoError(t, err)\n\tassert.Empty(t, string(diff))\n}\n\nfunc testCompareGeneratedStubsArchive(\n\tt *testing.T,\n\tdirPath string,\n\tplugins []testPluginInfo,\n\tuseJar bool,\n) {\n\tfileExt := \".zip\"\n\tif useJar {\n\t\tfileExt = \".jar\"\n\t}\n\tfilePaths := buftesting.GetProtocFilePaths(t, dirPath, 100)\n\ttempDir := t.TempDir()\n\tactualProtocFile := filepath.Join(tempDir, \"actual-protoc\"+fileExt)\n\tbufProtocFile := filepath.Join(tempDir, \"buf-protoc\"+fileExt)\n\tvar actualProtocPluginFlags []string\n\tfor _, plugin := range plugins {\n\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_out=%s\", plugin.name, actualProtocFile))\n\t\tif plugin.opt != \"\" {\n\t\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_opt=%s\", plugin.name, plugin.opt))\n\t\t}\n\t}\n\tbuftesting.RunActualProtoc(\n\t\tt,\n\t\tfalse,\n\t\tfalse,\n\t\tdirPath,\n\t\tfilePaths,\n\t\tmap[string]string{\n\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t},\n\t\tnil,\n\t\tactualProtocPluginFlags...,\n\t)\n\tvar bufProtocPluginFlags []string\n\tfor _, plugin := range plugins {\n\t\tbufProtocPluginFlags = append(bufProtocPluginFlags, fmt.Sprintf(\"--%s_out=%s\", plugin.name, bufProtocFile))\n\t\tif plugin.opt != \"\" {\n\t\t\tbufProtocPluginFlags = append(bufProtocPluginFlags, fmt.Sprintf(\"--%s_opt=%s\", plugin.name, plugin.opt))\n\t\t}\n\t}\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithEnv(\n\t\t\tfunc(string) map[string]string {\n\t\t\t\treturn map[string]string{\n\t\t\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t\t\t}\n\t\t\t},\n\t\t),\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithArgs(\n\t\t\tappend(\n\t\t\t\tappend(\n\t\t\t\t\tbufProtocPluginFlags,\n\t\t\t\t\t\"-I\",\n\t\t\t\t\tdirPath,\n\t\t\t\t\t\"--by-dir\",\n\t\t\t\t),\n\t\t\t\tfilePaths...,\n\t\t\t)...,\n\t\t),\n\t)\n\tactualData, err := os.ReadFile(actualProtocFile)\n\trequire.NoError(t, err)\n\tactualReadWriteBucket := storagemem.NewReadWriteBucket()\n\terr = storagearchive.Unzip(\n\t\tt.Context(),\n\t\tbytes.NewReader(actualData),\n\t\tint64(len(actualData)),\n\t\tactualReadWriteBucket,\n\t)\n\trequire.NoError(t, err)\n\tbufData, err := os.ReadFile(bufProtocFile)\n\trequire.NoError(t, err)\n\tbufReadWriteBucket := storagemem.NewReadWriteBucket()\n\terr = storagearchive.Unzip(\n\t\tt.Context(),\n\t\tbytes.NewReader(bufData),\n\t\tint64(len(bufData)),\n\t\tbufReadWriteBucket,\n\t)\n\trequire.NoError(t, err)\n\tdiff, err := storage.DiffBytes(\n\t\tt.Context(),\n\t\tactualReadWriteBucket,\n\t\tbufReadWriteBucket,\n\t)\n\trequire.NoError(t, err)\n\tassert.Empty(t, string(diff))\n}\n\nfunc testGetBufProtocFileDescriptorSet(t *testing.T, dirPath string) *descriptorpb.FileDescriptorSet {\n\tdata := testGetBufProtocFileDescriptorSetBytes(t, dirPath)\n\tfileDescriptorSet := &descriptorpb.FileDescriptorSet{}\n\t// TODO: change to image read logic\n\trequire.NoError(\n\t\tt,\n\t\tprotoencoding.NewWireUnmarshaler(nil).Unmarshal(\n\t\t\tdata,\n\t\t\tfileDescriptorSet,\n\t\t),\n\t)\n\treturn fileDescriptorSet\n}\n\nfunc testGetBufProtocFileDescriptorSetBytes(t *testing.T, dirPath string) []byte {\n\tstdout := bytes.NewBuffer(nil)\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithStdout(stdout),\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithArgs(\n\t\t\tappend(\n\t\t\t\t[]string{\n\t\t\t\t\t\"-I\",\n\t\t\t\t\tdirPath,\n\t\t\t\t\t\"-o\",\n\t\t\t\t\t\"-\",\n\t\t\t\t},\n\t\t\t\tbuftesting.GetProtocFilePaths(t, dirPath, 100)...,\n\t\t\t)...,\n\t\t),\n\t)\n\treturn stdout.Bytes()\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/1/flags.txt",
    "content": "-I\nproto\n--error_format\ntext\n--go_out\ngo_out\n--go_opt\nplugins=connect\n--plugin\n/bin/protoc-gen-go\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/2/flags1.txt",
    "content": "-I\nproto\n--error_format\ntext\n@testdata/2/flags2.txt\n--go_opt\nplugins=connect\n--plugin\n/bin/protoc-gen-go\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/2/flags2.txt",
    "content": "--go_out\ngo_out\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/3/flags1.txt",
    "content": "-I\nproto\n--error_format\ntext\n@testdata/3/flags2.txt\n--go_opt\nplugins=connect\n--plugin\n/bin/protoc-gen-go\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/3/flags2.txt",
    "content": "--go_out\ngo_out\n@testdata/3/flags1.txt\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/insertion/test.proto",
    "content": "syntax = \"proto3\";\n\npackage test;\n\nmessage Test {\n    string name = 1;\n}"
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/overlap/a/1.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/overlap/a/1.txt",
    "content": ""
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/overlap/b/1.txt",
    "content": ""
  },
  {
    "path": "cmd/buf/internal/command/alpha/protoc/testdata/overlap/b/2.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/internal/command/alpha/registry/token/tokendelete/tokendelete.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 tokendelete\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tforceFlagName   = \"force\"\n\ttokenIDFlagName = \"token-id\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <buf.build>\",\n\t\tShort: \"Delete a token by ID\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tForce   bool\n\tTokenID string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(\n\t\t&f.Force,\n\t\tforceFlagName,\n\t\tfalse,\n\t\t\"Force deletion without confirming. Use with caution\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.TokenID,\n\t\ttokenIDFlagName,\n\t\t\"\",\n\t\t\"The ID of the token to delete\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, tokenIDFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tbufcli.WarnAlphaCommand(ctx, container)\n\tregistryHostname := container.Arg(0)\n\tif _, err := netext.ValidateHostname(registryHostname); err != nil {\n\t\treturn err\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(clientConfig, registryHostname, registryv1alpha1connect.NewTokenServiceClient)\n\tif !flags.Force {\n\t\tif err := bufcli.PromptUserForDelete(container, \"token\", flags.TokenID); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif _, err := service.DeleteToken(\n\t\tctx,\n\t\tconnect.NewRequest(registryv1alpha1.DeleteTokenRequest_builder{\n\t\t\tTokenId: flags.TokenID,\n\t\t}.Build()),\n\t); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewTokenNotFoundError(flags.TokenID)\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/registry/token/tokenget/tokenget.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 tokenget\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName  = \"format\"\n\ttokenIDFlagName = \"token-id\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <buf.build>\",\n\t\tShort: \"Get a token by ID\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat  string\n\tTokenID string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringVar(\n\t\t&f.TokenID,\n\t\ttokenIDFlagName,\n\t\t\"\",\n\t\t\"The ID of the token to get\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, tokenIDFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tbufcli.WarnAlphaCommand(ctx, container)\n\tregistryHostname := container.Arg(0)\n\tif _, err := netext.ValidateHostname(registryHostname); err != nil {\n\t\treturn err\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(clientConfig, registryHostname, registryv1alpha1connect.NewTokenServiceClient)\n\tresp, err := service.GetToken(\n\t\tctx,\n\t\tconnect.NewRequest(registryv1alpha1.GetTokenRequest_builder{\n\t\t\tTokenId: flags.TokenID,\n\t\t}.Build()),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewTokenNotFoundError(flags.TokenID)\n\t\t}\n\t\treturn err\n\t}\n\tprinter, err := bufprint.NewTokenPrinter(container.Stdout(), format)\n\tif err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn printer.PrintTokens(ctx, resp.Msg.GetToken())\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/alpha/registry/token/tokenlist/tokenlist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 tokenlist\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tpageSizeFlagName  = \"page-size\"\n\tpageTokenFlagName = \"page-token\"\n\treverseFlagName   = \"reverse\"\n\tformatFlagName    = \"format\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <buf.build>\",\n\t\tShort: \"List user tokens\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tPageSize  uint32\n\tPageToken string\n\tReverse   bool\n\tFormat    string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.Uint32Var(&f.PageSize,\n\t\tpageSizeFlagName,\n\t\t10,\n\t\t`The page size.`,\n\t)\n\tflagSet.StringVar(&f.PageToken,\n\t\tpageTokenFlagName,\n\t\t\"\",\n\t\t`The page token. If more results are available, a \"next_page\" key is present in the --format=json output.`,\n\t)\n\tflagSet.BoolVar(&f.Reverse,\n\t\treverseFlagName,\n\t\tfalse,\n\t\t`Reverse the results.`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tbufcli.WarnAlphaCommand(ctx, container)\n\tregistryHostname := container.Arg(0)\n\tif _, err := netext.ValidateHostname(registryHostname); err != nil {\n\t\treturn err\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(clientConfig, registryHostname, registryv1alpha1connect.NewTokenServiceClient)\n\tresp, err := service.ListTokens(\n\t\tctx,\n\t\tconnect.NewRequest(registryv1alpha1.ListTokensRequest_builder{\n\t\t\tPageSize:  flags.PageSize,\n\t\t\tPageToken: flags.PageToken,\n\t\t\tReverse:   flags.Reverse,\n\t\t}.Build()),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tprinter, err := bufprint.NewTokenPrinter(container.Stdout(), format)\n\tif err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\t// TODO: flag docs say \"next_token\" field will be present in the output,\n\t//  for paging through results but we are actually ignoring that field now.\n\treturn printer.PrintTokens(ctx, resp.Msg.GetTokens()...)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/bufpluginv1/bufpluginv1.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginv1\n\nimport (\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/internal\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {\n\treturn internal.NewCommand(name, builder, bufcheckserver.V1Spec)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/bufpluginv1beta1/bufpluginv1beta1.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginv1beta1\n\nimport (\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/internal\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {\n\treturn internal.NewCommand(name, builder, bufcheckserver.V1Beta1Spec)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/bufpluginv2/bufpluginv2.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginv2\n\nimport (\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/beta/internal\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {\n\treturn internal.NewCommand(name, builder, bufcheckserver.V2Spec)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/internal/internal.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/spf13/pflag\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tspec *check.Spec,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: \"Run buf as a check plugin.\",\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags, spec)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tProtocol bool\n\tSpec     bool\n\tFormat   string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(&f.Protocol, pluginrpc.ProtocolFlagName, false, \"Passed through to plugin.\")\n\tflagSet.BoolVar(&f.Spec, pluginrpc.SpecFlagName, false, \"Passed through to plugin.\")\n\tflagSet.StringVar(&f.Format, pluginrpc.FormatFlagName, pluginrpc.FormatBinary.String(), \"Passed through to plugin.\")\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n\tspec *check.Spec,\n) error {\n\tserver, err := check.NewServer(spec)\n\tif err != nil {\n\t\treturn err\n\t}\n\targs := app.Args(container)\n\tif flags.Protocol {\n\t\targs = append(args, \"--\"+pluginrpc.ProtocolFlagName)\n\t}\n\tif flags.Spec {\n\t\targs = append(args, \"--\"+pluginrpc.SpecFlagName)\n\t}\n\tif flags.Format != \"\" {\n\t\targs = append(args, \"--\"+pluginrpc.FormatFlagName+\"=\"+flags.Format)\n\t}\n\treturn server.Serve(\n\t\tctx,\n\t\tpluginrpc.Env{\n\t\t\tArgs:   args,\n\t\t\tStdin:  container.Stdin(),\n\t\t\tStdout: container.Stdout(),\n\t\t\tStderr: container.Stderr(),\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/price/price.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 price\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"math\"\n\t\"text/template\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/protostat\"\n\t\"github.com/bufbuild/buf/private/pkg/protostat/protostatstorage\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n\tteamsDollarsPerType     = float64(0.50)\n\tproDollarsPerType       = float64(5)\n\tproDollarsMinimumSpend  = float64(3000)\n\ttmplCopy                = `Current BSR pricing:\n\n  - Teams: $0.50 per type\n  - Pro: $5.00 per type, with a minimum spend of $3,000 per month\n\nPricing data last updated on February 1, 2025.\n\nMake sure you are on the latest version of the Buf CLI to get the most updated pricing\ninformation, and see buf.build/pricing if in doubt - this command runs completely locally\nand does not interact with our servers.\n\nYour sources have:\n\n  - {{.Messages}} messages\n  - {{.Enums}} enums\n  - {{.RPCs}} RPCs\n\nThis adds up to {{.Types}} types.\n\nBased on this, these sources will cost:\n\n- ${{.TeamsDollarsPerMonth}}/month for Teams\n- ${{.ProDollarsPerMonth}}/month for Pro\n\nThese values should be treated as an estimate - we price based on the average number\nof private types you have on the BSR during your billing period.\n`\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <source>\",\n\t\tShort: \"Get the price for BSR paid plans for a given source or module\",\n\t\tLong:  bufcli.GetSourceOrModuleLong(`the source or module to get a price for`),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tDisableSymlinks bool\n\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(\n\t\tctx,\n\t\tinput,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tstats, err := protostat.GetStats(\n\t\tctx,\n\t\tprotostatstorage.NewFileWalker(\n\t\t\tbufmodule.ModuleReadBucketToStorageReadBucket(\n\t\t\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFilesForTargetModules(\n\t\t\t\t\tworkspace,\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttmpl, err := template.New(\"tmpl\").Parse(tmplCopy)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn tmpl.Execute(\n\t\tcontainer.Stdout(),\n\t\tnewTmplData(stats),\n\t)\n}\n\ntype tmplData struct {\n\t*protostat.Stats\n\n\tTeamsDollarsPerMonth string\n\tProDollarsPerMonth   string\n}\n\nfunc newTmplData(stats *protostat.Stats) *tmplData {\n\ttmplData := &tmplData{\n\t\tStats: stats,\n\t}\n\ttmplData.TeamsDollarsPerMonth = fmt.Sprintf(\"%.2f\", float64(tmplData.Types)*teamsDollarsPerType)\n\ttmplData.ProDollarsPerMonth = fmt.Sprintf(\"%.2f\", math.Max(float64(tmplData.Types)*proDollarsPerType, proDollarsMinimumSpend))\n\treturn tmplData\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/registry/plugin/plugindelete/plugindelete.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugindelete\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <buf.build/owner/plugin[:version]>\",\n\t\tShort: \"Delete a plugin from the registry\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct{}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tbufcli.WarnBetaCommand(ctx, container)\n\tidentity, version, _ := strings.Cut(container.Arg(0), \":\")\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(identity)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif version != \"\" {\n\t\tif err := bufremotepluginref.ValidatePluginVersion(version); err != nil {\n\t\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t\t}\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(\n\t\tclientConfig,\n\t\tpluginIdentity.Remote(),\n\t\tregistryv1alpha1connect.NewPluginCurationServiceClient,\n\t)\n\tif _, err := service.DeleteCuratedPlugin(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\tregistryv1alpha1.DeleteCuratedPluginRequest_builder{\n\t\t\t\tOwner:   pluginIdentity.Owner(),\n\t\t\t\tName:    pluginIdentity.Plugin(),\n\t\t\t\tVersion: version,\n\t\t\t}.Build(),\n\t\t),\n\t); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn fmt.Errorf(\"the plugin %s does not exist\", container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/registry/plugin/pluginpush/pluginpush.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginpush\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"os\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremoteplugindocker\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/go-containerregistry/pkg/authn\"\n\t\"github.com/google/go-containerregistry/pkg/name\"\n\tpkgv1 \"github.com/google/go-containerregistry/pkg/v1\"\n\t\"github.com/google/go-containerregistry/pkg/v1/remote\"\n\t\"github.com/google/go-containerregistry/pkg/v1/remote/transport\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName          = \"format\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n\toverrideRemoteFlagName  = \"override-remote\"\n\timageFlagName           = \"image\"\n\tvisibilityFlagName      = \"visibility\"\n\n\tpublicVisibility  = \"public\"\n\tprivateVisibility = \"private\"\n)\n\nvar allVisibilityStrings = []string{\n\tpublicVisibility,\n\tprivateVisibility,\n}\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <source>\",\n\t\tShort: \"Push a plugin to a registry\",\n\t\tLong:  bufcli.GetSourceDirLong(`the source to push (directory containing buf.plugin.yaml or plugin release zip)`),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat          string\n\tDisableSymlinks bool\n\tOverrideRemote  string\n\tImage           string\n\tVisibility      string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringVar(\n\t\t&f.OverrideRemote,\n\t\toverrideRemoteFlagName,\n\t\t\"\",\n\t\t\"Override the default remote found in buf.plugin.yaml name and dependencies\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Image,\n\t\timageFlagName,\n\t\t\"\",\n\t\t\"Existing image to push\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Visibility,\n\t\tvisibilityFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(`The plugin's visibility setting. Must be one of %s`, xstrings.SliceToString(allVisibilityStrings)),\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, visibilityFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tbufcli.WarnBetaCommand(ctx, container)\n\tif len(flags.OverrideRemote) > 0 {\n\t\tif _, err := netext.ValidateHostname(flags.OverrideRemote); err != nil {\n\t\t\treturn fmt.Errorf(\"%s: %w\", overrideRemoteFlagName, err)\n\t\t}\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tsource, err := bufcli.GetInputValue(container, \"\" /* The input hashtag is not supported here */, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tstorageProvider := newStorageosProvider(flags.DisableSymlinks)\n\tsourceStat, err := os.Stat(source)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar sourceBucket storage.ReadWriteBucket\n\tif !sourceStat.IsDir() && strings.HasSuffix(strings.ToLower(sourceStat.Name()), \".zip\") {\n\t\t// Unpack plugin release to temporary directory\n\t\ttmpDir, err := os.MkdirTemp(os.TempDir(), \"plugin-push\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tif err := os.RemoveAll(tmpDir); !os.IsNotExist(err) {\n\t\t\t\tretErr = errors.Join(retErr, err)\n\t\t\t}\n\t\t}()\n\t\tsourceBucket, err = storageProvider.NewReadWriteBucket(tmpDir)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := unzipPluginToSourceBucket(ctx, source, sourceStat.Size(), sourceBucket); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tsourceBucket, err = storageProvider.NewReadWriteBucket(source)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\texistingConfigFilePath, err := bufremotepluginconfig.ExistingConfigFilePath(ctx, sourceBucket)\n\tif err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\tif existingConfigFilePath == \"\" {\n\t\treturn fmt.Errorf(\"please define a %s configuration file in the target directory\", bufremotepluginconfig.ExternalConfigFilePath)\n\t}\n\tvar options []bufremotepluginconfig.ConfigOption\n\tif len(flags.OverrideRemote) > 0 {\n\t\toptions = append(options, bufremotepluginconfig.WithOverrideRemote(flags.OverrideRemote))\n\t}\n\tpluginConfig, err := bufremotepluginconfig.GetConfigForBucket(ctx, sourceBucket, options...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclient, err := bufremoteplugindocker.NewClient(container.Logger(), bufcli.Version)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err := client.Close(); err != nil {\n\t\t\tretErr = errors.Join(retErr, fmt.Errorf(\"docker client close error: %w\", err))\n\t\t}\n\t}()\n\tvar imageID string\n\tif flags.Image != \"\" {\n\t\tinspectResponse, err := client.Inspect(ctx, flags.Image)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\timageID = inspectResponse.ImageID\n\t} else {\n\t\timage, err := loadDockerImage(ctx, sourceBucket)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tloadResponse, err := client.Load(ctx, image)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tif err := image.Close(); err != nil && !errors.Is(err, storage.ErrClosed) {\n\t\t\t\tretErr = errors.Join(retErr, fmt.Errorf(\"docker image close error: %w\", err))\n\t\t\t}\n\t\t}()\n\t\timageID = loadResponse.ImageID\n\t}\n\tvisibility, err := visibilityFlagToVisibility(flags.Visibility)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(\n\t\tclientConfig,\n\t\tpluginConfig.Name.Remote(),\n\t\tregistryv1alpha1connect.NewPluginCurationServiceClient,\n\t)\n\tlatestPluginResp, err := service.GetLatestCuratedPlugin(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\tregistryv1alpha1.GetLatestCuratedPluginRequest_builder{\n\t\t\t\tOwner:    pluginConfig.Name.Owner(),\n\t\t\t\tName:     pluginConfig.Name.Plugin(),\n\t\t\t\tVersion:  pluginConfig.PluginVersion,\n\t\t\t\tRevision: 0, // get latest revision for the plugin version.\n\t\t\t}.Build(),\n\t\t),\n\t)\n\tvar currentImageDigest string\n\tvar nextRevision uint32\n\tif err != nil {\n\t\tif connect.CodeOf(err) != connect.CodeNotFound {\n\t\t\treturn err\n\t\t}\n\t\tnextRevision = 1\n\t} else {\n\t\tnextRevision = latestPluginResp.Msg.GetPlugin().GetRevision() + 1\n\t\tcurrentImageDigest = latestPluginResp.Msg.GetPlugin().GetContainerImageDigest()\n\t}\n\tmachine, err := netrc.GetMachineForName(container, pluginConfig.Name.Remote())\n\tif err != nil {\n\t\treturn err\n\t}\n\tauthConfig := &bufremoteplugindocker.RegistryAuthConfig{}\n\tif machine != nil {\n\t\tauthConfig.ServerAddress = machine.Name()\n\t\tauthConfig.Username = machine.Login()\n\t\tauthConfig.Password = machine.Password()\n\t}\n\timageDigest, err := findExistingDigestForImageID(ctx, pluginConfig, authConfig, imageID, currentImageDigest)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif imageDigest == \"\" {\n\t\timageDigest, err = pushImage(ctx, client, authConfig, pluginConfig, imageID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tcontainer.Logger().Info(\"image found in registry - skipping push\")\n\t}\n\tplugin, err := bufremoteplugin.NewPlugin(\n\t\tpluginConfig.PluginVersion,\n\t\tpluginConfig.Dependencies,\n\t\tpluginConfig.Registry,\n\t\timageDigest,\n\t\tpluginConfig.SourceURL,\n\t\tpluginConfig.Description,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcreateRequest, err := createCuratedPluginRequest(pluginConfig, plugin, nextRevision, visibility)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar curatedPlugin *registryv1alpha1.CuratedPlugin\n\tcreatePluginResp, err := service.CreateCuratedPlugin(ctx, connect.NewRequest(createRequest))\n\tif err != nil {\n\t\tif connect.CodeOf(err) != connect.CodeAlreadyExists {\n\t\t\treturn err\n\t\t}\n\t\t// Plugin with the same image digest and metadata already exists\n\t\tcontainer.Logger().Info(\n\t\t\t\"plugin already exists\",\n\t\t\tslog.String(\"name\", pluginConfig.Name.IdentityString()),\n\t\t\tslog.String(\"digest\", plugin.ContainerImageDigest()),\n\t\t)\n\t\tif latestPluginResp == nil {\n\t\t\tlatestPluginResp, err = service.GetLatestCuratedPlugin(\n\t\t\t\tctx,\n\t\t\t\tconnect.NewRequest(\n\t\t\t\t\tregistryv1alpha1.GetLatestCuratedPluginRequest_builder{\n\t\t\t\t\t\tOwner:    pluginConfig.Name.Owner(),\n\t\t\t\t\t\tName:     pluginConfig.Name.Plugin(),\n\t\t\t\t\t\tVersion:  pluginConfig.PluginVersion,\n\t\t\t\t\t\tRevision: 0, // get latest revision for the plugin version.\n\t\t\t\t\t}.Build(),\n\t\t\t\t),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"unable to fetch latest plugin after AlreadyExists error: %w\", err)\n\t\t\t}\n\t\t}\n\t\t// Ensure the image digest matches.\n\t\tif latestPluginResp.Msg.GetPlugin().GetContainerImageDigest() != plugin.ContainerImageDigest() {\n\t\t\treturn fmt.Errorf(\"a plugin with the same name and version already exists, but with a different image digest (%s). If you want to push a new revision, please retry\", latestPluginResp.Msg.GetPlugin().GetContainerImageDigest())\n\t\t}\n\t\tcuratedPlugin = latestPluginResp.Msg.GetPlugin()\n\t} else {\n\t\tcuratedPlugin = createPluginResp.Msg.GetConfiguration()\n\t}\n\treturn bufprint.NewCuratedPluginPrinter(container.Stdout()).PrintCuratedPlugin(ctx, format, curatedPlugin)\n}\n\nfunc createCuratedPluginRequest(\n\tpluginConfig *bufremotepluginconfig.Config,\n\tplugin bufremoteplugin.Plugin,\n\tnextRevision uint32,\n\tvisibility registryv1alpha1.CuratedPluginVisibility,\n) (*registryv1alpha1.CreateCuratedPluginRequest, error) {\n\toutputLanguages, err := bufremoteplugin.OutputLanguagesToProtoLanguages(pluginConfig.OutputLanguages)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprotoRegistryConfig, err := bufremoteplugin.PluginRegistryToProtoRegistryConfig(plugin.Registry())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn registryv1alpha1.CreateCuratedPluginRequest_builder{\n\t\tOwner:                pluginConfig.Name.Owner(),\n\t\tName:                 pluginConfig.Name.Plugin(),\n\t\tRegistryType:         bufremoteplugin.PluginToProtoPluginRegistryType(plugin),\n\t\tVersion:              plugin.Version(),\n\t\tContainerImageDigest: plugin.ContainerImageDigest(),\n\t\tDependencies:         bufremoteplugin.PluginReferencesToCuratedProtoPluginReferences(plugin.Dependencies()),\n\t\tSourceUrl:            plugin.SourceURL(),\n\t\tDescription:          plugin.Description(),\n\t\tRegistryConfig:       protoRegistryConfig,\n\t\tRevision:             nextRevision,\n\t\tOutputLanguages:      outputLanguages,\n\t\tSpdxLicenseId:        pluginConfig.SPDXLicenseID,\n\t\tLicenseUrl:           pluginConfig.LicenseURL,\n\t\tVisibility:           visibility,\n\t\tIntegrationGuideUrl:  pluginConfig.IntegrationGuideURL,\n\t\tDeprecated:           pluginConfig.Deprecated,\n\t}.Build(), nil\n}\n\nfunc pushImage(\n\tctx context.Context,\n\tclient bufremoteplugindocker.Client,\n\tauthConfig *bufremoteplugindocker.RegistryAuthConfig,\n\tplugin *bufremotepluginconfig.Config,\n\timage string,\n) (_ string, retErr error) {\n\ttagResponse, err := client.Tag(ctx, image, plugin)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tcreatedImage := tagResponse.Image\n\t// We tag a Docker image using a unique ID label each time.\n\t// After we're done publishing the image, we delete it to not leave a lot of images left behind.\n\tdefer func() {\n\t\tif _, err := client.Delete(ctx, createdImage); err != nil {\n\t\t\tretErr = errors.Join(retErr, fmt.Errorf(\"failed to delete image %q\", createdImage))\n\t\t}\n\t}()\n\tpushResponse, err := client.Push(ctx, createdImage, authConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn pushResponse.Digest, nil\n}\n\n// findExistingDigestForImageID will query the OCI registry to see if the imageID already exists.\n// If an image is found with the same imageID, its digest will be returned (and we'll skip pushing to OCI registry).\n//\n// It performs the following search:\n//\n// - GET /v2/{owner}/{plugin}/tags/list\n// - For each tag:\n//   - Fetch image: GET /v2/{owner}/{plugin}/manifests/{tag}\n//   - If image manifest matches imageID, we can use the image digest for the image.\nfunc findExistingDigestForImageID(\n\tctx context.Context,\n\tplugin *bufremotepluginconfig.Config,\n\tauthConfig *bufremoteplugindocker.RegistryAuthConfig,\n\timageID string,\n\tcurrentImageDigest string,\n) (string, error) {\n\trepo, err := name.NewRepository(fmt.Sprintf(\"%s/%s/%s\", plugin.Name.Remote(), plugin.Name.Owner(), plugin.Name.Plugin()))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tauth := &authn.Basic{Username: authConfig.Username, Password: authConfig.Password}\n\tremoteOpts := []remote.Option{remote.WithContext(ctx), remote.WithAuth(auth)}\n\t// First attempt to see if the current image digest matches the image ID\n\tif currentImageDigest != \"\" {\n\t\tremoteImageID, _, err := getImageIDAndDigestFromReference(ctx, repo.Digest(currentImageDigest), remoteOpts...)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif remoteImageID == imageID {\n\t\t\treturn currentImageDigest, nil\n\t\t}\n\t}\n\t// List all tags and check for a match\n\ttags, err := remote.List(repo, remoteOpts...)\n\tif err != nil {\n\t\tstructuredErr := new(transport.Error)\n\t\tif errors.As(err, &structuredErr) {\n\t\t\tif structuredErr.StatusCode == http.StatusUnauthorized {\n\t\t\t\treturn \"\", errors.New(\"you are not authenticated. For details, visit https://buf.build/docs/bsr/authentication\")\n\t\t\t}\n\t\t\tif structuredErr.StatusCode == http.StatusNotFound {\n\t\t\t\treturn \"\", nil\n\t\t\t}\n\t\t}\n\t\treturn \"\", err\n\t}\n\texistingImageDigest := \"\"\n\tfor _, tag := range tags {\n\t\tremoteImageID, imageDigest, err := getImageIDAndDigestFromReference(ctx, repo.Tag(tag), remoteOpts...)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif remoteImageID == imageID {\n\t\t\texistingImageDigest = imageDigest\n\t\t\tbreak\n\t\t}\n\t}\n\treturn existingImageDigest, nil\n}\n\n// getImageIDAndDigestFromReference takes an image reference and returns 2 resolved digests:\n//\n//  1. The image config digest (https://github.com/opencontainers/image-spec/blob/v1.1.0/config.md)\n//  2. The image manifest digest (https://github.com/opencontainers/image-spec/blob/v1.1.0/manifest.md)\n//\n// The incoming ref is expected to be either an image manifest digest or an image index digest.\nfunc getImageIDAndDigestFromReference(\n\tctx context.Context,\n\tref name.Reference,\n\toptions ...remote.Option,\n) (string, string, error) {\n\tpuller, err := remote.NewPuller(options...)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tdesc, err := puller.Get(ctx, ref)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\n\tswitch {\n\tcase desc.MediaType.IsIndex():\n\t\timageIndex, err := desc.ImageIndex()\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"failed to get image index: %w\", err)\n\t\t}\n\t\tindexManifest, err := imageIndex.IndexManifest()\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"failed to get image manifests: %w\", err)\n\t\t}\n\t\tvar manifest pkgv1.Descriptor\n\t\tfor _, desc := range indexManifest.Manifests {\n\t\t\tif p := desc.Platform; p != nil {\n\t\t\t\t//  Drop attestations, which don't have a valid platform set.\n\t\t\t\tif p.OS == \"unknown\" && p.Architecture == \"unknown\" {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tmanifest = desc\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif manifest.Digest.String() == \"\" {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"no valid platform manifest found in image index for %q\", ref)\n\t\t}\n\t\t// We resolved the image index to an image manifest digest, we can now call this function\n\t\t// again to resolve the image manifest digest to an image config digest.\n\t\treturn getImageIDAndDigestFromReference(\n\t\t\tctx,\n\t\t\tref.Context().Digest(manifest.Digest.String()),\n\t\t\toptions...,\n\t\t)\n\tcase desc.MediaType.IsImage():\n\t\timageManifest, err := desc.Image()\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"failed to get image: %w\", err)\n\t\t}\n\t\timageManifestDigest, err := imageManifest.Digest()\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"failed to get image digest for %q: %w\", ref, err)\n\t\t}\n\t\tmanifest, err := imageManifest.Manifest()\n\t\tif err != nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"failed to get image manifest for %q: %w\", ref, err)\n\t\t}\n\t\treturn manifest.Config.Digest.String(), imageManifestDigest.String(), nil\n\t}\n\treturn \"\", \"\", fmt.Errorf(\"unsupported media type: %q\", desc.MediaType)\n}\n\nfunc unzipPluginToSourceBucket(ctx context.Context, pluginZip string, size int64, bucket storage.ReadWriteBucket) (retErr error) {\n\tf, err := os.Open(pluginZip)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err := f.Close(); err != nil {\n\t\t\tretErr = errors.Join(retErr, fmt.Errorf(\"plugin zip close error: %w\", err))\n\t\t}\n\t}()\n\treturn storagearchive.Unzip(ctx, f, size, bucket)\n}\n\nfunc loadDockerImage(ctx context.Context, bucket storage.ReadBucket) (storage.ReadObjectCloser, error) {\n\timage, err := bucket.Get(ctx, bufremoteplugindocker.ImagePath)\n\tif errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, fmt.Errorf(\"unable to find a %s plugin image: %w\", bufremoteplugindocker.ImagePath, err)\n\t}\n\treturn image, nil\n}\n\nfunc visibilityFlagToVisibility(visibility string) (registryv1alpha1.CuratedPluginVisibility, error) {\n\tswitch visibility {\n\tcase publicVisibility:\n\t\treturn registryv1alpha1.CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PUBLIC, nil\n\tcase privateVisibility:\n\t\treturn registryv1alpha1.CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PRIVATE, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid visibility: %s, expected one of %s\", visibility, xstrings.SliceToString(allVisibilityStrings))\n\t}\n}\n\nfunc newStorageosProvider(disableSymlinks bool) storageos.Provider {\n\tvar options []storageos.ProviderOption\n\tif !disableSymlinks {\n\t\toptions = append(options, storageos.ProviderWithSymlinks())\n\t}\n\treturn storageos.NewProvider(options...)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/registry/webhook/webhookcreate/webhookcreate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 webhookcreate\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\townerFlagName        = \"owner\"\n\trepositoryFlagName   = \"repository\"\n\tcallbackURLFlagName  = \"callback-url\"\n\twebhookEventFlagName = \"event\"\n\tremoteFlagName       = \"remote\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: \"Create a repository webhook\",\n\t\tArgs:  appcmd.ExactArgs(0),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tWebhookEvent   string\n\tOwnerName      string\n\tRepositoryName string\n\tCallbackURL    string\n\tRemote         string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.WebhookEvent,\n\t\twebhookEventFlagName,\n\t\t\"\",\n\t\t\"The event type to create a webhook for. The proto enum string value is used for this input (e.g. 'WEBHOOK_EVENT_REPOSITORY_PUSH')\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, webhookEventFlagName)\n\tflagSet.StringVar(\n\t\t&f.OwnerName,\n\t\townerFlagName,\n\t\t\"\",\n\t\t`The owner name of the repository to create a webhook for`,\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, ownerFlagName)\n\tflagSet.StringVar(\n\t\t&f.RepositoryName,\n\t\trepositoryFlagName,\n\t\t\"\",\n\t\t\"The repository name to create a webhook for\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, repositoryFlagName)\n\tflagSet.StringVar(\n\t\t&f.CallbackURL,\n\t\tcallbackURLFlagName,\n\t\t\"\",\n\t\t\"The url for the webhook to callback to on a given event\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, callbackURLFlagName)\n\tflagSet.StringVar(\n\t\t&f.Remote,\n\t\tremoteFlagName,\n\t\t\"\",\n\t\t\"The remote of the repository the created webhook will belong to\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, remoteFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tbufcli.WarnBetaCommand(ctx, container)\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(clientConfig, flags.Remote, registryv1alpha1connect.NewWebhookServiceClient)\n\tevent, ok := registryv1alpha1.WebhookEvent_value[flags.WebhookEvent]\n\tif !ok || event == int32(registryv1alpha1.WebhookEvent_WEBHOOK_EVENT_UNSPECIFIED) {\n\t\treturn fmt.Errorf(\"webhook event must be specified\")\n\t}\n\tresp, err := service.CreateWebhook(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\tregistryv1alpha1.CreateWebhookRequest_builder{\n\t\t\t\tWebhookEvent:   registryv1alpha1.WebhookEvent(event),\n\t\t\t\tOwnerName:      flags.OwnerName,\n\t\t\t\tRepositoryName: flags.RepositoryName,\n\t\t\t\tCallbackUrl:    flags.CallbackURL,\n\t\t\t}.Build(),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\twebhookJSON, err := json.MarshalIndent(resp.Msg.GetWebhook(), \"\", \"\\t\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Ignore errors for writing to stdout.\n\t_, _ = container.Stdout().Write(webhookJSON)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/registry/webhook/webhookdelete/webhookdelete.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 webhookdelete\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\twebhookIDFlagName = \"id\"\n\tremoteFlagName    = \"remote\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: \"Delete a repository webhook\",\n\t\tArgs:  appcmd.ExactArgs(0),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tWebhookID string\n\tRemote    string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.WebhookID,\n\t\twebhookIDFlagName,\n\t\t\"\",\n\t\t\"The webhook ID to delete\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, webhookIDFlagName)\n\tflagSet.StringVar(\n\t\t&f.Remote,\n\t\tremoteFlagName,\n\t\t\"\",\n\t\t\"The remote of the repository the webhook ID belongs to\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, remoteFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tbufcli.WarnBetaCommand(ctx, container)\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(clientConfig, flags.Remote, registryv1alpha1connect.NewWebhookServiceClient)\n\tif _, err := service.DeleteWebhook(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\tregistryv1alpha1.DeleteWebhookRequest_builder{\n\t\t\t\tWebhookId: flags.WebhookID,\n\t\t\t}.Build(),\n\t\t),\n\t); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/registry/webhook/webhooklist/webhooklist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 webhooklist\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\townerFlagName      = \"owner\"\n\trepositoryFlagName = \"repository\"\n\tremoteFlagName     = \"remote\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: \"List repository webhooks\",\n\t\tArgs:  appcmd.ExactArgs(0),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tOwnerName      string\n\tRepositoryName string\n\tRemote         string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.OwnerName,\n\t\townerFlagName,\n\t\t\"\",\n\t\t`The owner name of the repository to list webhooks for`,\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, ownerFlagName)\n\tflagSet.StringVar(\n\t\t&f.RepositoryName,\n\t\trepositoryFlagName,\n\t\t\"\",\n\t\t\"The repository name to list webhooks for.\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, repositoryFlagName)\n\tflagSet.StringVar(\n\t\t&f.Remote,\n\t\tremoteFlagName,\n\t\t\"\",\n\t\t\"The remote of the owner and repository to list webhooks for\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, remoteFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tbufcli.WarnBetaCommand(ctx, container)\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := connectclient.Make(clientConfig, flags.Remote, registryv1alpha1connect.NewWebhookServiceClient)\n\tresp, err := service.ListWebhooks(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\tregistryv1alpha1.ListWebhooksRequest_builder{\n\t\t\t\tRepositoryName: flags.RepositoryName,\n\t\t\t\tOwnerName:      flags.OwnerName,\n\t\t\t\t// TODO FUTURE: this should probably be in a loop so we can get page token from\n\t\t\t\t//   response and query for the next page\n\t\t\t}.Build(),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.Msg.GetWebhooks() == nil {\n\t\t// Ignore errors for writing to stdout.\n\t\t_, _ = container.Stdout().Write([]byte(\"[]\"))\n\t\treturn nil\n\t}\n\twebhooksJSON, err := json.MarshalIndent(resp.Msg.GetWebhooks(), \"\", \"\\t\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Ignore errors for writing to stdout.\n\t_, _ = container.Stdout().Write(webhooksJSON)\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/beta/studioagent/studioagent.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 studioagent\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"net\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/bufstudioagent\"\n\t\"github.com/bufbuild/buf/private/pkg/cert/certclient\"\n\t\"github.com/bufbuild/buf/private/pkg/transport/http/httpserver\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tbindFlagName              = \"bind\"\n\tportFlagName              = \"port\"\n\toriginFlagName            = \"origin\"\n\tdisallowedHeadersFlagName = \"disallowed-header\"\n\tforwardHeadersFlagName    = \"forward-header\"\n\tcaCertFlagName            = \"ca-cert\"\n\tclientCertFlagName        = \"client-cert\"\n\tclientKeyFlagName         = \"client-key\"\n\tserverCertFlagName        = \"server-cert\"\n\tserverKeyFlagName         = \"server-key\"\n\tprivateNetworkFlagName    = \"private-network\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: \"Run an HTTP(S) server as the Studio agent\",\n\t\tArgs:  appcmd.ExactArgs(0),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tBindAddress       string\n\tPort              string\n\tOrigin            string\n\tDisallowedHeaders []string\n\tForwardHeaders    map[string]string\n\tCACert            string\n\tClientCert        string\n\tClientKey         string\n\tServerCert        string\n\tServerKey         string\n\tPrivateNetwork    bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.BindAddress,\n\t\tbindFlagName,\n\t\t\"127.0.0.1\",\n\t\t\"The address to be exposed to accept HTTP requests\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Port,\n\t\tportFlagName,\n\t\t\"8080\",\n\t\t\"The port to be exposed to accept HTTP requests\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Origin,\n\t\toriginFlagName,\n\t\t\"https://buf.build\",\n\t\t\"The allowed origin for CORS options\",\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.DisallowedHeaders,\n\t\tdisallowedHeadersFlagName,\n\t\tnil,\n\t\t`The header names that are disallowed by this agent. When the agent receives an enveloped request with these headers set, it will return an error rather than forward the request to the target server. Multiple headers are appended if specified multiple times`,\n\t)\n\tflagSet.StringToStringVar(\n\t\t&f.ForwardHeaders,\n\t\tforwardHeadersFlagName,\n\t\tnil,\n\t\t`The headers to be forwarded via the agent to the target server. Must be an equals sign separated key-value pair (like --forward-header=fromHeader1=toHeader1). Multiple header pairs are appended if specified multiple times`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.CACert,\n\t\tcaCertFlagName,\n\t\t\"\",\n\t\t\"The CA cert to be used in the client and server TLS configuration\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ClientCert,\n\t\tclientCertFlagName,\n\t\t\"\",\n\t\t\"The cert to be used in the client TLS configuration\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ClientKey,\n\t\tclientKeyFlagName,\n\t\t\"\",\n\t\t\"The key to be used in the client TLS configuration\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ServerCert,\n\t\tserverCertFlagName,\n\t\t\"\",\n\t\t\"The cert to be used in the server TLS configuration\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ServerKey,\n\t\tserverKeyFlagName,\n\t\t\"\",\n\t\t\"The key to be used in the server TLS configuration\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.PrivateNetwork,\n\t\tprivateNetworkFlagName,\n\t\tfalse,\n\t\t`Use the agent with private network CORS`,\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\t// CA cert pool is optional. If it is nil, TLS uses the host's root CA set.\n\tvar rootCAConfig *tls.Config\n\tvar err error\n\tif flags.CACert != \"\" {\n\t\trootCAConfig, err = certclient.NewClientTLS(certclient.WithRootCertFilePaths(flags.CACert))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// client TLS config is optional. If it is nil, it uses the default configuration from http2.Transport.\n\tvar clientTLSConfig *tls.Config\n\tif flags.ClientCert != \"\" || flags.ClientKey != \"\" {\n\t\tclientTLSConfig, err = newTLSConfig(rootCAConfig, flags.ClientCert, flags.ClientKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot create new client TLS config: %w\", err)\n\t\t}\n\t}\n\t// server TLS config is optional. If it is nil, we serve with a h2c handler.\n\tvar serverTLSConfig *tls.Config\n\tif flags.ServerCert != \"\" || flags.ServerKey != \"\" {\n\t\tserverTLSConfig, err = newTLSConfig(rootCAConfig, flags.ServerCert, flags.ServerKey)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"cannot create new server TLS config: %w\", err)\n\t\t}\n\t}\n\tmux := bufstudioagent.NewHandler(\n\t\tcontainer.Logger(),\n\t\tflags.Origin,\n\t\tclientTLSConfig,\n\t\txslices.ToStructMap(flags.DisallowedHeaders),\n\t\tflags.ForwardHeaders,\n\t\tflags.PrivateNetwork,\n\t)\n\tvar httpListenConfig net.ListenConfig\n\thttpListener, err := httpListenConfig.Listen(ctx, \"tcp\", fmt.Sprintf(\"%s:%s\", flags.BindAddress, flags.Port))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn httpserver.Run(\n\t\tctx,\n\t\tcontainer.Logger(),\n\t\thttpListener,\n\t\tmux,\n\t\thttpserver.RunWithTLSConfig(\n\t\t\tserverTLSConfig,\n\t\t),\n\t)\n}\n\nfunc newTLSConfig(baseConfig *tls.Config, certFile, keyFile string) (*tls.Config, error) {\n\tconfig := baseConfig.Clone()\n\tif config == nil {\n\t\tconfig = &tls.Config{\n\t\t\tMinVersion: tls.VersionTLS12,\n\t\t}\n\t}\n\tcert, err := tls.LoadX509KeyPair(certFile, keyFile)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating x509 keypair from cert file %s and key file %s\", certFile, keyFile)\n\t}\n\tconfig.Certificates = []tls.Certificate{cert}\n\treturn config, nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/breaking.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 breaking\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"maps\"\n\t\"slices\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\terrorFormatFlagName       = \"error-format\"\n\texcludeImportsFlagName    = \"exclude-imports\"\n\tpathsFlagName             = \"path\"\n\tlimitToInputFilesFlagName = \"limit-to-input-files\"\n\tconfigFlagName            = \"config\"\n\tagainstFlagName           = \"against\"\n\tagainstConfigFlagName     = \"against-config\"\n\tagainstRegistryFlagName   = \"against-registry\"\n\texcludePathsFlagName      = \"exclude-path\"\n\tdisableSymlinksFlagName   = \"disable-symlinks\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <input> --against <against-input>\",\n\t\tShort: \"Verify no breaking changes have been made\",\n\t\tLong: `This command makes sure that the <input> location has no breaking changes compared to the <against-input> location.\n\n` +\n\t\t\tbufcli.GetInputLong(`the source, module, or image to check for breaking changes`),\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tErrorFormat       string\n\tExcludeImports    bool\n\tLimitToInputFiles bool\n\tPaths             []string\n\tConfig            string\n\tAgainst           string\n\tAgainstConfig     string\n\tAgainstRegistry   bool\n\tExcludePaths      []string\n\tDisableSymlinks   bool\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors or check violations printed to stdout. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.ExcludeImports,\n\t\texcludeImportsFlagName,\n\t\tfalse,\n\t\t\"Exclude imports from breaking change detection.\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.LimitToInputFiles,\n\t\tlimitToInputFilesFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t`Only run breaking checks against the files in the input\nWhen set, the against input contains only the files in the input\nOverrides --%s`,\n\t\t\tpathsFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Against,\n\t\tagainstFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t`Required, except if --%s is set. The source, module, or image to check against. Must be one of format %s`,\n\t\t\tagainstRegistryFlagName,\n\t\t\tbuffetch.AllFormatsString,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.AgainstConfig,\n\t\tagainstConfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use to configure the against source, module, or image`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.AgainstRegistry,\n\t\tagainstRegistryFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t`Run breaking checks against the latest commit on the default branch in the registry. All modules in the input must have a name configured, otherwise this will fail.\nIf a remote module is not found with the configured name, then this will fail. This cannot be set with --%s.`,\n\t\t\tagainstFlagName,\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tif err := validateFlags(flags); err != nil {\n\t\treturn err\n\t}\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t\tbufctl.WithFileAnnotationsToStdout(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\twasmRuntime, err := bufcli.NewWasmRuntime(ctx, container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, wasmRuntime.Close(ctx))\n\t}()\n\t// Do not exclude imports here. bufcheck's Client requires all imports.\n\t// Use bufcheck's BreakingWithExcludeImports.\n\timageWithConfigs, checkClient, err := controller.GetTargetImageWithConfigsAndCheckClient(\n\t\tctx,\n\t\tinput,\n\t\twasmRuntime,\n\t\tbufctl.WithTargetPaths(flags.Paths, flags.ExcludePaths),\n\t\tbufctl.WithConfigOverride(flags.Config),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// TODO: this doesn't actually work because we're using the same file paths for both sides\n\t// of the roots change, then we're torched\n\texternalPaths := flags.Paths\n\tif flags.LimitToInputFiles {\n\t\texternalPaths, err = getExternalPathsForImages(imageWithConfigs)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tvar againstImages []bufimage.Image\n\tif flags.Against != \"\" {\n\t\t// Do not exclude imports here. bufcheck's Client requires all imports.\n\t\t// Use bufcheck's BreakingWithExcludeImports.\n\t\tagainstImagesWithConfigs, _, err := controller.GetTargetImageWithConfigsAndCheckClient(\n\t\t\tctx,\n\t\t\tflags.Against,\n\t\t\twasm.UnimplementedRuntime,\n\t\t\tbufctl.WithTargetPaths(externalPaths, flags.ExcludePaths),\n\t\t\tbufctl.WithConfigOverride(flags.AgainstConfig),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// We do not require the check configs from the against target once built, so they can\n\t\t// be dropped here.\n\t\tagainstImages, err = xslices.MapError(\n\t\t\tagainstImagesWithConfigs,\n\t\t\tfunc(imageWithConfig bufctl.ImageWithConfig) (bufimage.Image, error) {\n\t\t\t\tagainstImage, ok := imageWithConfig.(bufimage.Image)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, syserror.New(\"imageWithConfig could not be converted to Image\")\n\t\t\t\t}\n\t\t\t\treturn againstImage, nil\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleServiceProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\tif flags.AgainstRegistry {\n\t\tfor _, imageWithConfig := range imageWithConfigs {\n\t\t\tmoduleFullName := imageWithConfig.ModuleFullName()\n\t\t\tif moduleFullName == nil {\n\t\t\t\tif imageWithConfig.ModuleOpaqueID() == \"\" {\n\t\t\t\t\t// This can occur in the case of a [buffetch.MessageRef], where we resolve the message\n\t\t\t\t\t// ref directly from the bucket without building the [bufmodule.Module]. In that case,\n\t\t\t\t\t// we are unnable to use --against-registry.\n\t\t\t\t\treturn fmt.Errorf(\"cannot use --%s with unnamed module\", againstRegistryFlagName)\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"cannot use --%s with unnamed module, %s\",\n\t\t\t\t\tagainstRegistryFlagName,\n\t\t\t\t\timageWithConfig.ModuleOpaqueID(),\n\t\t\t\t)\n\t\t\t}\n\t\t\t// Check commits exist for the module on the default label before we try to get the against image.\n\t\t\t// TODO: remove this check once we have error details to indicate that the against input\n\t\t\t// has no commits on the default label. We use the API directly here to avoid issues of conflating\n\t\t\t// dependency errors to empty module errors.\n\t\t\tcommitServiceClient := moduleServiceProvider.V1CommitServiceClient(moduleFullName.Registry())\n\t\t\tif _, err := commitServiceClient.GetCommits(\n\t\t\t\tctx,\n\t\t\t\tconnect.NewRequest(\n\t\t\t\t\t&modulev1.GetCommitsRequest{\n\t\t\t\t\t\tResourceRefs: []*modulev1.ResourceRef{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tValue: &modulev1.ResourceRef_Name_{\n\t\t\t\t\t\t\t\t\tName: &modulev1.ResourceRef_Name{\n\t\t\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\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); err != nil {\n\t\t\t\tif connect.CodeOf(err) == connect.CodeFailedPrecondition {\n\t\t\t\t\t// This error occurs when the against input is a module that has no commits on the default branch.\n\t\t\t\t\t// We ignore this case to support new modulues that have just been created in the registry.\n\t\t\t\t\tcontainer.Logger().DebugContext(\n\t\t\t\t\t\tctx, \"ignoring empty module without commits on the default branch\",\n\t\t\t\t\t\tslog.String(\"module\", imageWithConfig.ModuleFullName().String()),\n\t\t\t\t\t)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tagainstImage, err := controller.GetImage(\n\t\t\t\tctx,\n\t\t\t\tmoduleFullName.String(),\n\t\t\t\tbufctl.WithTargetPaths(externalPaths, flags.ExcludePaths),\n\t\t\t\tbufctl.WithConfigOverride(flags.AgainstConfig),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tagainstImages = append(againstImages, againstImage)\n\t\t}\n\t}\n\tif len(imageWithConfigs) != len(againstImages) {\n\t\t// In the case where the input and against workspaces do not contain the same number of\n\t\t// images, this could happen if the input contains new module(s). However, we require\n\t\t// the number of images to match because of module-specific [bufconfig.BreakingConfig].\n\t\t// This can result in a less satisfying UX when adding modules to a workspace.\n\t\t//\n\t\t// To mitigate this for users adding new modules to their workspace, for the case where\n\t\t// len(imageWithConfigs) > len(againstImages), if all modules in [imageWithConfigs] have\n\t\t// the same [bufconfig.BreakingConfig] (so no unique, module-specific [bufconfig.BreakingConfig]),\n\t\t// we query the [againstImages] for the matching modules and ignore any modules from\n\t\t// [imageWithConfigs] that are not found in [againstImages].\n\t\t//\n\t\t// In the case where len(imageWithConfigs) < len(againstImages) or there are module-specific\n\t\t// [bufconfig.BreakingConfig], we still return an error. Also, if the roots change, we're\n\t\t// torched. (Issue #3641)\n\t\tif len(imageWithConfigs) > len(againstImages) && hasNoUniqueBreakingConfig(imageWithConfigs) {\n\t\t\timageWithConfigs, err = filterImageWithConfigsNotInAgainstImages(imageWithConfigs, againstImages)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\treturn newInputAgainstImageCountError(len(imageWithConfigs), len(againstImages))\n\t\t}\n\t}\n\t// We add all check configs (both lint and breaking) as related configs to check if plugins\n\t// have rules configured.\n\t// We allocated twice the size of imageWithConfigs for both lint and breaking configs.\n\tallCheckConfigs := make([]bufconfig.CheckConfig, 0, len(imageWithConfigs)*2)\n\tfor _, imageWithConfig := range imageWithConfigs {\n\t\tallCheckConfigs = append(allCheckConfigs, imageWithConfig.LintConfig())\n\t\tallCheckConfigs = append(allCheckConfigs, imageWithConfig.BreakingConfig())\n\t}\n\tvar allFileAnnotations []bufanalysis.FileAnnotation\n\tfor i, imageWithConfig := range imageWithConfigs {\n\t\tbreakingOptions := []bufcheck.BreakingOption{\n\t\t\tbufcheck.WithPluginConfigs(imageWithConfig.PluginConfigs()...),\n\t\t\tbufcheck.WithPolicyConfigs(imageWithConfig.PolicyConfigs()...),\n\t\t\tbufcheck.WithRelatedCheckConfigs(allCheckConfigs...),\n\t\t}\n\t\tif flags.ExcludeImports {\n\t\t\tbreakingOptions = append(breakingOptions, bufcheck.BreakingWithExcludeImports())\n\t\t}\n\t\tif err := checkClient.Breaking(\n\t\t\tctx,\n\t\t\timageWithConfig.BreakingConfig(),\n\t\t\timageWithConfig,\n\t\t\tagainstImages[i],\n\t\t\tbreakingOptions...,\n\t\t); err != nil {\n\t\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\t\tif errors.As(err, &fileAnnotationSet) {\n\t\t\t\tallFileAnnotations = append(allFileAnnotations, fileAnnotationSet.FileAnnotations()...)\n\t\t\t} else {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif len(allFileAnnotations) > 0 {\n\t\tallFileAnnotationSet := bufanalysis.NewFileAnnotationSet(allFileAnnotations...)\n\t\tif err := bufanalysis.PrintFileAnnotationSet(\n\t\t\tcontainer.Stdout(),\n\t\t\tallFileAnnotationSet,\n\t\t\tflags.ErrorFormat,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn bufctl.ErrFileAnnotation\n\t}\n\treturn nil\n}\n\nfunc getExternalPathsForImages[I bufimage.Image, S ~[]I](images S) ([]string, error) {\n\texternalPaths := make(map[string]struct{})\n\tfor _, image := range images {\n\t\tfor _, imageFile := range image.Files() {\n\t\t\texternalPaths[imageFile.ExternalPath()] = struct{}{}\n\t\t}\n\t}\n\treturn xslices.MapKeysToSlice(externalPaths), nil\n}\n\nfunc validateFlags(flags *flags) error {\n\tif flags.Against == \"\" && !flags.AgainstRegistry {\n\t\treturn fmt.Errorf(\"Must set --%s or --%s\", againstFlagName, againstRegistryFlagName)\n\t}\n\tif flags.Against != \"\" && flags.AgainstRegistry {\n\t\treturn fmt.Errorf(\"Cannot set both --%s and --%s\", againstFlagName, againstRegistryFlagName)\n\t}\n\treturn nil\n}\n\n// hasNoUniqueBreakingConfig iterates through imageWithConfigs and checks to see if there\n// are any unique [bufconfig.BreakingConfig]. It returns true if all [bufconfig.BreakingConfig]\n// are the same across all the images.\nfunc hasNoUniqueBreakingConfig(imageWithConfigs []bufctl.ImageWithConfig) bool {\n\tvar base bufconfig.BreakingConfig\n\tfor _, imageWithConfig := range imageWithConfigs {\n\t\tif base == nil {\n\t\t\tbase = imageWithConfig.BreakingConfig()\n\t\t\tcontinue\n\t\t}\n\t\tif !equalBreakingConfig(base, imageWithConfig.BreakingConfig()) {\n\t\t\treturn false\n\t\t}\n\t\tbase = imageWithConfig.BreakingConfig()\n\t}\n\treturn true\n}\n\n// Checks if the specified [bufconfig.BreakingConfig]s are equal. Returns true if both\n// [bufconfig.BreakingConfig] have the same configuration parameters.\nfunc equalBreakingConfig(breakingConfig1, breakingConfig2 bufconfig.BreakingConfig) bool {\n\tif breakingConfig1.Disabled() == breakingConfig2.Disabled() &&\n\t\tbreakingConfig1.FileVersion() == breakingConfig2.FileVersion() &&\n\t\tslices.Equal(breakingConfig1.UseIDsAndCategories(), breakingConfig2.UseIDsAndCategories()) &&\n\t\tslices.Equal(breakingConfig1.ExceptIDsAndCategories(), breakingConfig2.ExceptIDsAndCategories()) &&\n\t\tslices.Equal(breakingConfig1.IgnorePaths(), breakingConfig2.IgnorePaths()) &&\n\t\tmaps.EqualFunc(\n\t\t\tbreakingConfig1.IgnoreIDOrCategoryToPaths(),\n\t\t\tbreakingConfig2.IgnoreIDOrCategoryToPaths(),\n\t\t\tslices.Equal[[]string],\n\t\t) &&\n\t\tbreakingConfig1.DisableBuiltin() == breakingConfig2.DisableBuiltin() &&\n\t\tbreakingConfig1.IgnoreUnstablePackages() == breakingConfig2.IgnoreUnstablePackages() {\n\t\treturn true\n\t}\n\treturn false\n}\n\n// A helper function for filtering out [bufctl.ImageWithConfig]s from [imagesWithConfig]\n// if there is no corresponding image in [againstImages]. We determine this based on image\n// file path.\n//\n// This assumes that len(imageWithConfigs) > len(againstImages).\n// We also expect that each image in [againstImages] is mapped only once to a single\n// imageWithConfig in [imagesWithConfig]. If an againstImage is found, then we don't check\n// it again. We also validate that each image in [againstImages] is mapped to an imageWithConfig\n// from [imageWithConfigs].\nfunc filterImageWithConfigsNotInAgainstImages(\n\timageWithConfigs []bufctl.ImageWithConfig,\n\tagainstImages []bufimage.Image,\n) ([]bufctl.ImageWithConfig, error) {\n\tfoundAgainstImageIndices := make(map[int]struct{})\n\tvar filteredImageWithConfigs []bufctl.ImageWithConfig\n\tfor _, imageWithConfig := range imageWithConfigs {\n\t\tfor _, imageFile := range imageWithConfig.Files() {\n\t\t\tif imageFile.IsImport() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar foundImage bufimage.Image\n\t\t\tfor i, againstImage := range againstImages {\n\t\t\t\tif _, ok := foundAgainstImageIndices[i]; ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif againstFile := againstImage.GetFile(imageFile.Path()); againstFile != nil && !againstFile.IsImport() {\n\t\t\t\t\tfoundAgainstImageIndices[i] = struct{}{}\n\t\t\t\t\tfoundImage = againstImage\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif foundImage != nil {\n\t\t\t\tfilteredImageWithConfigs = append(filteredImageWithConfigs, imageWithConfig)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\t// If we are unsuccessful in mapping all againstImages to a unique imageWithConfig, then\n\t// we return the same error message.\n\tif len(foundAgainstImageIndices) != len(againstImages) || len(againstImages) != len(filteredImageWithConfigs) {\n\t\treturn nil, newInputAgainstImageCountError(len(imageWithConfigs), len(againstImages))\n\t}\n\treturn filteredImageWithConfigs, nil\n}\n\nfunc newInputAgainstImageCountError(lenImageWithConfigs, lenAgainstImages int) error {\n\treturn fmt.Errorf(\n\t\t\"input contained %d images, whereas against contained %d images\",\n\t\tlenImageWithConfigs,\n\t\tlenAgainstImages,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/breaking_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 breaking\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/internaltesting\"\n)\n\n// TestBreakingWorkspaceNewModuleWithImport tests that adding a new module to a\n// workspace does not produce false breaking change errors when the new module\n// imports files from an existing module.\n//\n// This is a regression test for the case where the new module's imported files\n// cause filterImageWithConfigsNotInAgainstImages to incorrectly match the new\n// module to an existing against image, stealing the match from the module that\n// actually owns those files.\nfunc TestBreakingWorkspaceNewModuleWithImport(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t\"\",\n\t\t\"\",\n\t\tfilepath.Join(\"testdata\", \"workspace_new_module\", \"head\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace_new_module\", \"against\"),\n\t)\n}\n\nfunc testRunStdoutStderr(\n\tt *testing.T,\n\tstdin io.Reader,\n\texpectedExitCode int,\n\texpectedStdout string,\n\texpectedStderr string,\n\targs ...string,\n) {\n\tt.Helper()\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(\n\t\t\t\t\tname,\n\t\t\t\t\tappext.BuilderWithInterceptor(\n\t\t\t\t\t\tfunc(next func(context.Context, appext.Container) error) func(context.Context, appext.Container) error {\n\t\t\t\t\t\t\treturn func(ctx context.Context, container appext.Container) error {\n\t\t\t\t\t\t\t\terr := next(ctx, container)\n\t\t\t\t\t\t\t\tif err == nil {\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\treturn fmt.Errorf(\"Failure: %w\", err)\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\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStdout(expectedStdout),\n\t\tappcmdtesting.WithExpectedStderr(expectedStderr),\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/testdata/workspace_new_module/against/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nmessage Bar {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/testdata/workspace_new_module/against/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: b\n  - path: c\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/testdata/workspace_new_module/against/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c.v1;\n\nmessage Baz {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/testdata/workspace_new_module/head/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nimport \"c.proto\";\n\nmessage Foo {\n  c.v1.Baz baz = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/testdata/workspace_new_module/head/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nmessage Bar {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/testdata/workspace_new_module/head/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: a\n  - path: b\n  - path: c\n"
  },
  {
    "path": "cmd/buf/internal/command/breaking/testdata/workspace_new_module/head/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c.v1;\n\nmessage Baz {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/build/build.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 build\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tasFileDescriptorSetFlagName           = \"as-file-descriptor-set\"\n\terrorFormatFlagName                   = \"error-format\"\n\texcludeImportsFlagName                = \"exclude-imports\"\n\texcludeSourceInfoFlagName             = \"exclude-source-info\"\n\texcludeSourceRetentionOptionsFlagName = \"exclude-source-retention-options\"\n\tpathsFlagName                         = \"path\"\n\toutputFlagName                        = \"output\"\n\toutputFlagShortName                   = \"o\"\n\tconfigFlagName                        = \"config\"\n\texcludePathsFlagName                  = \"exclude-path\"\n\tdisableSymlinksFlagName               = \"disable-symlinks\"\n\ttypeFlagName                          = \"type\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <input>\",\n\t\tShort: \"Build Protobuf files into a Buf image\",\n\t\tLong:  bufcli.GetInputLong(`the source or module to build or image to convert`),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tAsFileDescriptorSet           bool\n\tErrorFormat                   string\n\tExcludeImports                bool\n\tExcludeSourceInfo             bool\n\tExcludeSourceRetentionOptions bool\n\tPaths                         []string\n\tOutput                        string\n\tConfig                        string\n\tExcludePaths                  []string\n\tDisableSymlinks               bool\n\tTypes                         []string\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindAsFileDescriptorSet(flagSet, &f.AsFileDescriptorSet, asFileDescriptorSetFlagName)\n\tbufcli.BindExcludeImports(flagSet, &f.ExcludeImports, excludeImportsFlagName)\n\tbufcli.BindExcludeSourceInfo(flagSet, &f.ExcludeSourceInfo, excludeSourceInfoFlagName)\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.BoolVar(\n\t\t&f.ExcludeSourceRetentionOptions,\n\t\texcludeSourceRetentionOptionsFlagName,\n\t\tfalse,\n\t\t\"Exclude options whose retention is source\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVarP(\n\t\t&f.Output,\n\t\toutputFlagName,\n\t\toutputFlagShortName,\n\t\tapp.DevNullFilePath,\n\t\tfmt.Sprintf(\n\t\t\t`The output location for the built image. Must be one of format %s`,\n\t\t\tbuffetch.MessageFormatsString,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.Types,\n\t\ttypeFlagName,\n\t\tnil,\n\t\t\"The types (package, message, enum, extension, service, method) that should be included in this image. When specified, the resulting image will only include descriptors to describe the requested types\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tif err := bufcli.ValidateRequiredFlag(outputFlagName, flags.Output); err != nil {\n\t\treturn err\n\t}\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\timage, err := controller.GetImage(\n\t\tctx,\n\t\tinput,\n\t\tbufctl.WithTargetPaths(flags.Paths, flags.ExcludePaths),\n\t\tbufctl.WithImageExcludeSourceInfo(flags.ExcludeSourceInfo),\n\t\tbufctl.WithImageExcludeImports(flags.ExcludeImports),\n\t\tbufctl.WithImageIncludeTypes(flags.Types),\n\t\tbufctl.WithConfigOverride(flags.Config),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif flags.ExcludeSourceRetentionOptions {\n\t\timage, err = bufimageutil.StripSourceRetentionOptions(image)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn controller.PutImage(\n\t\tctx,\n\t\tflags.Output,\n\t\timage,\n\t\tbufctl.WithImageAsFileDescriptorSet(flags.AsFileDescriptorSet),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configinit/configinit.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 configinit\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tdocumentationCommentsFlagName = \"doc\"\n\toutDirPathFlagName            = \"output\"\n\toutDirPathFlagShortName       = \"o\"\n\tuncommentFlagName             = \"uncomment\"\n)\n\n// NewCommand returns a new init Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n\thidden bool,\n\tbindOldFlags bool,\n) *appcmd.Command {\n\tflags := newFlags(bindOldFlags)\n\treturn &appcmd.Command{\n\t\tUse:   name + \" [buf.build/owner/foobar]\",\n\t\tShort: \"Initialize buf configuration files for your local development\",\n\t\tLong: `This command will write a new buf.yaml file to start your local development.\n\nIf a buf.yaml already exists, this command will not overwrite it, and will produce an error.\n\nThe effects of this command may change over time - this command may initialize i.e. buf.gen.yaml files in the future.`,\n\t\tArgs:       appcmd.MaximumNArgs(1),\n\t\tDeprecated: deprecated,\n\t\tHidden:     hidden,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tOutDirPath string\n\n\t// Hidden.\n\tDocumentationComments bool\n\t// Hidden.\n\tUncomment bool\n\n\tbindOldFlags bool\n}\n\nfunc newFlags(bindOldFlags bool) *flags {\n\treturn &flags{\n\t\tbindOldFlags: bindOldFlags,\n\t}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVarP(\n\t\t&f.OutDirPath,\n\t\toutDirPathFlagName,\n\t\toutDirPathFlagShortName,\n\t\t\".\",\n\t\t`The directory to write the configuration files to`,\n\t)\n\tif f.bindOldFlags {\n\t\t// TODO FUTURE: Bring this flag back in future versions if we decide it's important.\n\t\t// We're not breaking anyone by not actually producing comments for now.\n\t\tflagSet.BoolVar(\n\t\t\t&f.DocumentationComments,\n\t\t\tdocumentationCommentsFlagName,\n\t\t\tfalse,\n\t\t\t\"Write inline documentation in the form of comments in the resulting configuration file\",\n\t\t)\n\t\t_ = flagSet.MarkHidden(documentationCommentsFlagName)\n\t\tflagSet.BoolVar(\n\t\t\t&f.Uncomment,\n\t\t\tuncommentFlagName,\n\t\t\tfalse,\n\t\t\t\"Uncomment examples in the resulting configuration file\",\n\t\t)\n\t\t_ = flagSet.MarkHidden(uncommentFlagName)\n\t}\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tif err := bufcli.ValidateRequiredFlag(outDirPathFlagName, flags.OutDirPath); err != nil {\n\t\treturn err\n\t}\n\texists, err := bufcli.BufYAMLFileExistsForDirPath(ctx, flags.OutDirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif exists {\n\t\treturn fmt.Errorf(\"buf.yaml already exists in directory %s, will not overwrite\", flags.OutDirPath)\n\t}\n\n\tfileVersion := bufconfig.FileVersionV2\n\tvar moduleFullName bufparse.FullName\n\tif container.NumArgs() > 0 {\n\t\tmoduleFullName, err = bufparse.ParseFullName(container.Arg(0))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tmoduleConfig, err := bufconfig.NewModuleConfig(\n\t\t\".\",\n\t\tmoduleFullName,\n\t\t// The default (empty) value for rootToIncludes and rootToExcludes only has key \".\".\n\t\tmap[string][]string{\n\t\t\t\".\": {},\n\t\t},\n\t\tmap[string][]string{\n\t\t\t\".\": {},\n\t\t},\n\t\tbufconfig.NewLintConfig(\n\t\t\tbufconfig.NewEnabledCheckConfigForUseIDsAndCategories(\n\t\t\t\tfileVersion,\n\t\t\t\t[]string{\"STANDARD\"},\n\t\t\t\tfalse,\n\t\t\t),\n\t\t\t\"\",\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\t\"\",\n\t\t\t// We actually want comment ignores enabled by default\n\t\t\ttrue,\n\t\t),\n\t\tbufconfig.NewBreakingConfig(\n\t\t\tbufconfig.NewEnabledCheckConfigForUseIDsAndCategories(\n\t\t\t\tfileVersion,\n\t\t\t\t[]string{\"FILE\"},\n\t\t\t\tfalse,\n\t\t\t),\n\t\t\tfalse,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbufYAMLFile, err := bufconfig.NewBufYAMLFile(\n\t\tfileVersion,\n\t\t[]bufconfig.ModuleConfig{\n\t\t\tmoduleConfig,\n\t\t},\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tbufconfig.BufYAMLFileWithIncludeDocsLink(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn bufcli.PutBufYAMLFileForDirPath(ctx, flags.OutDirPath, bufYAMLFile)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configlsbreakingrules/configlsbreakingrules.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 configlsbreakingrules\n\nimport (\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/config/internal\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\treturn internal.NewLSCommand(\n\t\tname,\n\t\tbuilder,\n\t\tcheck.RuleTypeBreaking,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configlslintrules/configlslintrules.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 configlslintrules\n\nimport (\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/config/internal\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\treturn internal.NewLSCommand(\n\t\tname,\n\t\tbuilder,\n\t\tcheck.RuleTypeLint,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configlsmodules/configlsmodules.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 configlsmodules\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"sort\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tconfigFlagName = \"config\"\n\tformatFlagName = \"format\"\n\n\tformatPath = \"path\"\n\tformatName = \"name\"\n\tformatJSON = \"json\"\n\n\tdefaultFormat = formatPath\n)\n\nvar (\n\tallFormats = []string{\n\t\tformatPath,\n\t\tformatName,\n\t\tformatJSON,\n\t}\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: \"List configured modules\",\n\t\tArgs:  appcmd.NoArgs,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tConfig string\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration.`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tdefaultFormat,\n\t\tfmt.Sprintf(\n\t\t\t\"The format to print rules as. Must be one of %s\",\n\t\t\txstrings.SliceToString(allFormats),\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\texternalModules, err := getExternalModules(ctx, flags.Config)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn printExternalModules(ctx, container, flags.Format, externalModules)\n}\n\nfunc getExternalModules(\n\tctx context.Context,\n\tconfigOverride string,\n) ([]*externalModule, error) {\n\t// If an override is specified, read buf.yaml from it.\n\tif configOverride != \"\" {\n\t\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForOverride(configOverride)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn getExternalModulesForBufYAMLFile(ctx, bufYAMLFile)\n\t}\n\t// First, look for a buf.work.yaml file.\n\tbufWorkYAMLFile, err := bufcli.GetBufWorkYAMLFileForDirPath(ctx, \".\")\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, err\n\t\t}\n\t\t// We do not have a buf.work.yaml file, attempt to read a buf.yaml file.\n\t\tbufYAMLFile, err := bufcli.GetBufYAMLFileForDirPath(ctx, \".\")\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// We do not have a buf.work.yaml or buf.yaml file, use the default.\n\t\t\tbufYAMLFile, err = bufconfig.NewBufYAMLFile(\n\t\t\t\tbufconfig.FileVersionV2,\n\t\t\t\t[]bufconfig.ModuleConfig{\n\t\t\t\t\tbufconfig.DefaultModuleConfigV2,\n\t\t\t\t},\n\t\t\t\tnil,\n\t\t\t\tnil,\n\t\t\t\tnil,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\t// This handles both buf.yaml file and no file courtesy of the above logic.\n\t\treturn getExternalModulesForBufYAMLFile(ctx, bufYAMLFile)\n\t}\n\t// We did have a buf.work.yaml file, but before handling it, check there is not a buf.yaml.\n\t_, err = bufcli.GetBufYAMLFileForDirPath(ctx, \".\")\n\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, err\n\t}\n\tif err == nil {\n\t\treturn nil, errors.New(\"Both buf.work.yaml and buf.yaml found. It is not valid to have a buf.work.yaml and buf.yaml in the same directory, buf.work.yaml specifies a workspace of modules, while buf.yaml either specifies a single module or a workspace of modules itself.\")\n\t}\n\t// Handle the buf.work.yaml.\n\treturn getExternalModulesForBufWorkYAMLFile(ctx, bufWorkYAMLFile)\n}\n\n// This preserves directory order from the bufWorkYAMLFile.\nfunc getExternalModulesForBufWorkYAMLFile(\n\tctx context.Context,\n\tbufWorkYAMLFile bufconfig.BufWorkYAMLFile,\n) ([]*externalModule, error) {\n\tvar externalModules []*externalModule\n\tfor _, dirPath := range bufWorkYAMLFile.DirPaths() {\n\t\tbufYAMLFile, err := bufcli.GetBufYAMLFileForDirPath(ctx, dirPath)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\texternalModules = append(\n\t\t\t\texternalModules,\n\t\t\t\tnewExternalModule(dirPath, nil, nil, \"\"),\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\t\t// This is a sanity check. Make sure we have what we expect.\n\t\tswitch bufYAMLFile.FileVersion() {\n\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\t\t\tif len(moduleConfigs) != 1 {\n\t\t\t\treturn nil, syserror.Newf(\"got BufYAMLFile at %q with FileVersion %v with %d ModuleConfigs\", dirPath, bufYAMLFile.FileVersion(), len(moduleConfigs))\n\t\t\t}\n\t\t\tmoduleConfig := moduleConfigs[0]\n\t\t\tif moduleConfig.DirPath() != \".\" {\n\t\t\t\treturn nil, syserror.Newf(\"got BufYAMLFile at %q with FileVersion %v with ModuleConfig that had non-root DirPath %q\", dirPath, bufYAMLFile.FileVersion(), moduleConfig.DirPath())\n\t\t\t}\n\t\t\tvar name string\n\t\t\tif moduleFullName := moduleConfig.FullName(); moduleFullName != nil {\n\t\t\t\tname = moduleFullName.String()\n\t\t\t}\n\t\t\tincludes := xslices.Map(moduleConfig.RootToIncludes()[\".\"], func(include string) string { return normalpath.Join(dirPath, include) })\n\t\t\texcludes := xslices.Map(moduleConfig.RootToExcludes()[\".\"], func(exclude string) string { return normalpath.Join(dirPath, exclude) })\n\t\t\texternalModules = append(\n\t\t\t\texternalModules,\n\t\t\t\t// The dirPath is the path specified in the buf.work.yaml.\n\t\t\t\t// The DirPath for v1/v1beta1 ModuleConfigs is always \".\".\n\t\t\t\tnewExternalModule(dirPath, includes, excludes, name),\n\t\t\t)\n\t\tcase bufconfig.FileVersionV2:\n\t\t\treturn nil, fmt.Errorf(\"buf.work.yaml pointed to directory %q which has a v2 buf.yaml file\", dirPath)\n\t\tdefault:\n\t\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", bufYAMLFile.FileVersion())\n\t\t}\n\t}\n\treturn externalModules, nil\n}\n\n// This preserves module config order from the bufYAMLFile.\nfunc getExternalModulesForBufYAMLFile(\n\tctx context.Context,\n\tbufYAMLFile bufconfig.BufYAMLFile,\n) ([]*externalModule, error) {\n\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\texternalModules := make([]*externalModule, len(moduleConfigs))\n\tfor i, moduleConfig := range moduleConfigs {\n\t\tvar name string\n\t\tif moduleFullName := moduleConfig.FullName(); moduleFullName != nil {\n\t\t\tname = moduleFullName.String()\n\t\t}\n\t\tdirPath := moduleConfig.DirPath()\n\t\tincludes := xslices.Map(moduleConfig.RootToIncludes()[\".\"], func(include string) string { return normalpath.Join(dirPath, include) })\n\t\texcludes := xslices.Map(moduleConfig.RootToExcludes()[\".\"], func(exclude string) string { return normalpath.Join(dirPath, exclude) })\n\t\texternalModules[i] = newExternalModule(dirPath, includes, excludes, name)\n\t}\n\treturn externalModules, nil\n}\n\nfunc printExternalModules(\n\tctx context.Context,\n\tcontainer app.StdoutContainer,\n\tformat string,\n\texternalModules []*externalModule,\n) error {\n\tswitch format {\n\tcase formatPath:\n\t\t// Two modules may have the same path, SliceStable breaks the tie with the original ordering.\n\t\tsort.SliceStable(\n\t\t\texternalModules,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn externalModules[i].Path < externalModules[j].Path\n\t\t\t},\n\t\t)\n\t\tfor _, externalModule := range externalModules {\n\t\t\tif _, err := container.Stdout().Write([]byte(externalModule.Path + \"\\n\")); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase formatName:\n\t\tsort.Slice(\n\t\t\texternalModules,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn externalModules[i].Name < externalModules[j].Name\n\t\t\t},\n\t\t)\n\t\tfor _, externalModule := range externalModules {\n\t\t\tif externalModule.Name == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif _, err := container.Stdout().Write([]byte(externalModule.Name + \"\\n\")); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase formatJSON:\n\t\t// Two modules may have the same path, SliceStable breaks the tie with the original ordering.\n\t\tsort.SliceStable(\n\t\t\texternalModules,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn externalModules[i].Path < externalModules[j].Path\n\t\t\t},\n\t\t)\n\t\tfor _, externalModule := range externalModules {\n\t\t\tdata, err := json.Marshal(externalModule)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := container.Stdout().Write([]byte(string(data) + \"\\n\")); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"unknown value for --%s: %s\", formatFlagName, format)\n\t}\n}\n\ntype externalModule struct {\n\tPath     string   `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\tIncludes []string `json:\"includes,omitempty\" yaml:\"includes,omitempty\"`\n\tExcludes []string `json:\"excludes,omitempty\" yaml:\"excludes,omitempty\"`\n\tName     string   `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n}\n\nfunc newExternalModule(path string, includes []string, excludes []string, name string) *externalModule {\n\treturn &externalModule{\n\t\tPath:     path,\n\t\tIncludes: includes,\n\t\tExcludes: excludes,\n\t\tName:     name,\n\t}\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configmigrate/configmigrate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 configmigrate\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufmigrate\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tworkspaceDirectoriesFlagName = \"workspace\"\n\tmoduleDirectoriesFlagName    = \"module\"\n\tbufGenYAMLFilePathFlagName   = \"buf-gen-yaml\"\n\tdiffFlagName                 = \"diff\"\n\tdiffFlagShortName            = \"d\"\n)\n\n// ignoreDirPaths are paths we ignore when calling MigrateAll or DiffAll.\n//\n// This is just a hardcoded list for the 99% case. If users actually want to migrate files in one\n// of these locations, they can use the flags, but typically we do not want to pick these up.\nvar ignoreDirPaths = []string{\n\t\".git\",\n\t\".github\",\n}\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: `Migrate all buf.yaml, buf.work.yaml, buf.gen.yaml, and buf.lock files at the specified directories or paths to v2`,\n\t\tLong: `If no flags are specified, the current directory is searched for buf.yamls, buf.work.yamls, and buf.gen.yamls.\n\nThe effects of this command may change over time `,\n\t\tArgs: appcmd.MaximumNArgs(0),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tWorkspaceDirPaths   []string\n\tModuleDirPaths      []string\n\tBufGenYAMLFilePaths []string\n\tDiff                bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringSliceVar(\n\t\t&f.WorkspaceDirPaths,\n\t\tworkspaceDirectoriesFlagName,\n\t\tnil,\n\t\t\"The workspace directories to migrate. buf.work.yaml, buf.yamls and buf.locks will be migrated\",\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.ModuleDirPaths,\n\t\tmoduleDirectoriesFlagName,\n\t\tnil,\n\t\t\"The module directories to migrate. buf.yaml and buf.lock will be migrated\",\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.BufGenYAMLFilePaths,\n\t\tbufGenYAMLFilePathFlagName,\n\t\tnil,\n\t\t\"The paths to the buf.gen.yaml generation templates to migrate\",\n\t)\n\tflagSet.BoolVarP(\n\t\t&f.Diff,\n\t\tdiffFlagName,\n\t\tdiffFlagShortName,\n\t\tfalse,\n\t\t\"Write a diff to stdout instead of migrating files on disk. Useful for performing a dry run.\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleKeyProvider, err := bufcli.NewModuleKeyProvider(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitProvider, err := bufcli.NewCommitProvider(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbucket, err := storageos.NewProvider(storageos.ProviderWithSymlinks()).NewReadWriteBucket(\n\t\t\".\",\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmigrator := bufmigrate.NewMigrator(\n\t\tcontainer.Logger(),\n\t\tmoduleKeyProvider,\n\t\tcommitProvider,\n\t)\n\tall := len(flags.WorkspaceDirPaths) == 0 && len(flags.ModuleDirPaths) == 0 && len(flags.BufGenYAMLFilePaths) == 0\n\tif flags.Diff {\n\t\tif all {\n\t\t\treturn bufmigrate.DiffAll(\n\t\t\t\tctx,\n\t\t\t\tmigrator,\n\t\t\t\tbucket,\n\t\t\t\tcontainer.Stdout(),\n\t\t\t\tignoreDirPaths,\n\t\t\t)\n\t\t}\n\t\treturn migrator.Diff(\n\t\t\tctx,\n\t\t\tbucket,\n\t\t\tcontainer.Stdout(),\n\t\t\tflags.WorkspaceDirPaths,\n\t\t\tflags.ModuleDirPaths,\n\t\t\tflags.BufGenYAMLFilePaths,\n\t\t)\n\t}\n\tif all {\n\t\treturn bufmigrate.MigrateAll(\n\t\t\tctx,\n\t\t\tmigrator,\n\t\t\tbucket,\n\t\t\tignoreDirPaths,\n\t\t)\n\t}\n\treturn migrator.Migrate(\n\t\tctx,\n\t\tbucket,\n\t\tflags.WorkspaceDirPaths,\n\t\tflags.ModuleDirPaths,\n\t\tflags.BufGenYAMLFilePaths,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configmigrate/configmigrate_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 configmigrate\n\nimport (\n\t\"bytes\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/internaltesting\"\n\t\"github.com/bufbuild/buf/private/pkg/osext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestConfigMigrateV1DefaultConfig(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\ttestCompareConfigMigrate(t, \"testdata/defaultv1\", 0, \"\")\n}\n\nfunc TestConfigMigrateV1BetaV1DefaultConfig(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\ttestCompareConfigMigrate(t, \"testdata/defaultv1beta1\", 0, \"\")\n}\n\nfunc TestConfigMigrateUnknownVersion(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\ttestCompareConfigMigrate(t, \"testdata/unknown\", 1, \"decode buf.yaml: \\\"version\\\" is not set. Please add \\\"version: v2\\\"\")\n}\n\nfunc testCompareConfigMigrate(t *testing.T, dir string, expectCode int, expectStderr string) {\n\t// Setup temporary bucket with input, then compare it to the output.\n\tstorageosProvider := storageos.NewProvider()\n\tinputBucket, err := storageosProvider.NewReadWriteBucket(filepath.Join(dir, \"input\"))\n\trequire.NoError(t, err)\n\ttempDir := t.TempDir()\n\ttempBucket, err := storageosProvider.NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tctx := t.Context()\n\t_, err = storage.Copy(ctx, inputBucket, tempBucket)\n\trequire.NoError(t, err)\n\tvar outputBucket storage.ReadWriteBucket\n\tif expectCode == 0 {\n\t\toutputBucket, err = storageosProvider.NewReadWriteBucket(filepath.Join(dir, \"output\"))\n\t\trequire.NoError(t, err)\n\t}\n\t// Run in the temp directory.\n\tfunc() {\n\t\tpwd, err := osext.Getwd()\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, osext.Chdir(tempDir))\n\t\tdefer func() {\n\t\t\tr := recover()\n\t\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\t\tif r != nil {\n\t\t\t\tpanic(r)\n\t\t\t}\n\t\t}()\n\t\tappcmdtesting.Run(\n\t\t\tt,\n\t\t\tfunc(use string) *appcmd.Command {\n\t\t\t\treturn NewCommand(use, appext.NewBuilder(use))\n\t\t\t},\n\t\t\tappcmdtesting.WithExpectedExitCode(expectCode),\n\t\t\tappcmdtesting.WithExpectedStderr(expectStderr),\n\t\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\t)\n\t}()\n\tif expectCode != 0 {\n\t\treturn // Nothing to compare.\n\t}\n\tvar diff bytes.Buffer\n\trequire.NoError(t, storage.Diff(ctx, &diff, outputBucket, tempBucket))\n\tassert.Empty(t, diff.String())\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configmigrate/testdata/defaultv1/input/buf.yaml",
    "content": "version: v1\nname: \"\"\ndeps: []\nbuild:\n  excludes: []\nlint:\n  use:\n    - STANDARD\n  except: []\n  ignore: []\n  ignore_only: {}\n  allow_comment_ignores: false\n  enum_zero_value_suffix: _UNSPECIFIED\n  rpc_allow_same_request_response: false\n  rpc_allow_google_protobuf_empty_requests: false\n  rpc_allow_google_protobuf_empty_responses: false\n  service_suffix: Service\nbreaking:\n  use:\n    - FILE\n  except: []\n  ignore: []\n  ignore_only: {}\n  ignore_unstable_packages: false\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configmigrate/testdata/defaultv1/output/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - STANDARD\n  except:\n    - FIELD_NOT_REQUIRED\n    - PACKAGE_NO_IMPORT_CYCLE\n  enum_zero_value_suffix: _UNSPECIFIED\n  service_suffix: Service\n  disallow_comment_ignores: true\nbreaking:\n  use:\n    - FILE\n  except:\n    - EXTENSION_NO_DELETE\n    - FIELD_SAME_DEFAULT\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configmigrate/testdata/defaultv1beta1/input/buf.yaml",
    "content": "version: v1beta1\nname: \"\"\ndeps: []\nbuild:\n  roots:\n    - .\n  excludes: []\nlint:\n  use:\n    - STANDARD\n  enum_zero_value_suffix: _UNSPECIFIED\n  rpc_allow_same_request_response: false\n  rpc_allow_google_protobuf_empty_requests: false\n  rpc_allow_google_protobuf_empty_responses: false\n  service_suffix: Service\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configmigrate/testdata/defaultv1beta1/output/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - STANDARD\n  except:\n    - ENUM_FIRST_VALUE_ZERO\n    - FIELD_NOT_REQUIRED\n    - IMPORT_USED\n    - PACKAGE_NO_IMPORT_CYCLE\n    - PROTOVALIDATE\n    - SYNTAX_SPECIFIED\n  enum_zero_value_suffix: _UNSPECIFIED\n  service_suffix: Service\n  disallow_comment_ignores: true\nbreaking:\n  use:\n    - FILE\n  except:\n    - EXTENSION_NO_DELETE\n    - FIELD_SAME_DEFAULT\n"
  },
  {
    "path": "cmd/buf/internal/command/config/configmigrate/testdata/unknown/input/buf.yaml",
    "content": "name: \"empty\"\n"
  },
  {
    "path": "cmd/buf/internal/command/config/internal/internal.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tconfiguredOnlyFlagName    = \"configured-only\"\n\tconfigFlagName            = \"config\"\n\tincludeDeprecatedFlagName = \"include-deprecated\"\n\tformatFlagName            = \"format\"\n\tversionFlagName           = \"version\"\n\tmodulePathFlagName        = \"module-path\"\n)\n\n// NewLSCommand returns a new ls Command.\nfunc NewLSCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\truleType check.RuleType,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: fmt.Sprintf(\"List %s rules\", ruleType.String()),\n\t\tArgs:  appcmd.NoArgs,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn lsRun(\n\t\t\t\t\tctx,\n\t\t\t\t\tcontainer,\n\t\t\t\t\tflags,\n\t\t\t\t\tname,\n\t\t\t\t\truleType,\n\t\t\t\t)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tConfiguredOnly    bool\n\tConfig            string\n\tIncludeDeprecated bool\n\tFormat            string\n\tVersion           string\n\tModulePath        string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(\n\t\t&f.ConfiguredOnly,\n\t\tconfiguredOnlyFlagName,\n\t\tfalse,\n\t\t\"List rules that are configured instead of listing all available rules\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t`The buf.yaml file or data to use for configuration. --%s must be set`,\n\t\t\tconfiguredOnlyFlagName,\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.IncludeDeprecated,\n\t\tincludeDeprecatedFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t`Also print deprecated rules. Has no effect if --%s is set.`,\n\t\t\tconfiguredOnlyFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format to print rules as. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufcli.AllRuleFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Version,\n\t\tversionFlagName,\n\t\t\"\", // do not set a default as we need to know if this is unset\n\t\tfmt.Sprintf(\n\t\t\t\"List all the rules for the given configuration version. By default, the version in the buf.yaml in the current directory is used, or the latest version otherwise (currently v2). Cannot be set if --%s is set. Must be one of %s\",\n\t\t\tconfiguredOnlyFlagName,\n\t\t\txslices.Map(\n\t\t\t\tbufconfig.AllFileVersions,\n\t\t\t\tfunc(fileVersion bufconfig.FileVersion) string {\n\t\t\t\t\treturn fileVersion.String()\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.ModulePath,\n\t\tmodulePathFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t\"The path to the specific module to list configured rules for as specified in the buf.yaml. If the buf.yaml has more than one module defined, this must be set. --%s must be set\",\n\t\t\tconfiguredOnlyFlagName,\n\t\t),\n\t)\n}\n\nfunc lsRun(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n\tcommandName string,\n\truleType check.RuleType,\n) (retErr error) {\n\tif flags.ConfiguredOnly {\n\t\tif flags.Version != \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s cannot be specified if --%s is specified\", versionFlagName, configFlagName)\n\t\t}\n\t} else {\n\t\tif flags.Config != \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be set if --%s is specified\", configuredOnlyFlagName, configFlagName)\n\t\t}\n\t\tif flags.ModulePath != \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be set if --%s is specified\", configuredOnlyFlagName, modulePathFlagName)\n\t\t}\n\t}\n\tconfigOverride := flags.Config\n\tif flags.Version != \"\" {\n\t\tconfigOverride = fmt.Sprintf(`{\"version\":\"%s\"}`, flags.Version)\n\t}\n\tbufYAMLFile, err := bufcli.GetBufYAMLFileForDirPathOrOverride(ctx, \".\", configOverride)\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn err\n\t\t}\n\t\tbufYAMLFile, err = bufconfig.NewBufYAMLFile(\n\t\t\tbufconfig.FileVersionV2,\n\t\t\t[]bufconfig.ModuleConfig{\n\t\t\t\tbufconfig.DefaultModuleConfigV2,\n\t\t\t},\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tnil,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\twasmRuntime, err := bufcli.NewWasmRuntime(ctx, container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, wasmRuntime.Close(ctx))\n\t}()\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(\n\t\tctx,\n\t\t\".\",\n\t\tbufctl.WithConfigOverride(configOverride),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcheckClient, err := controller.GetCheckClientForWorkspace(\n\t\tctx,\n\t\tworkspace,\n\t\twasmRuntime,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar rules []bufcheck.Rule\n\tif flags.ConfiguredOnly {\n\t\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\t\tvar moduleConfig bufconfig.ModuleConfig\n\t\tswitch fileVersion := bufYAMLFile.FileVersion(); fileVersion {\n\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\tif len(moduleConfigs) != 1 {\n\t\t\t\treturn syserror.Newf(\"got %d ModuleConfigs for a v1beta1/v1 buf.yaml\", len(moduleConfigs))\n\t\t\t}\n\t\t\tmoduleConfig = moduleConfigs[0]\n\t\tcase bufconfig.FileVersionV2:\n\t\t\tswitch len(moduleConfigs) {\n\t\t\tcase 0:\n\t\t\t\treturn syserror.New(\"got 0 ModuleConfigs from a BufYAMLFile\")\n\t\t\tcase 1:\n\t\t\t\tmoduleConfig = moduleConfigs[0]\n\t\t\tdefault:\n\t\t\t\tif flags.ModulePath == \"\" {\n\t\t\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be specified if the the buf.yaml has more than one module\", modulePathFlagName)\n\t\t\t\t}\n\t\t\t\tmoduleConfig, err = getModuleConfigForModulePath(moduleConfigs, flags.ModulePath)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t}\n\t\tvar checkConfig bufconfig.CheckConfig\n\t\t// We add all check configs (both lint and breaking) as related configs to check if plugins\n\t\t// have rules configured.\n\t\t// We allocated twice the size of moduleConfigs for both lint and breaking configs.\n\t\tallCheckConfigs := make([]bufconfig.CheckConfig, 0, len(moduleConfigs)*2)\n\t\tfor _, moduleConfig := range moduleConfigs {\n\t\t\tallCheckConfigs = append(allCheckConfigs, moduleConfig.LintConfig())\n\t\t\tallCheckConfigs = append(allCheckConfigs, moduleConfig.BreakingConfig())\n\t\t}\n\t\tswitch ruleType {\n\t\tcase check.RuleTypeLint:\n\t\t\tcheckConfig = moduleConfig.LintConfig()\n\t\tcase check.RuleTypeBreaking:\n\t\t\tcheckConfig = moduleConfig.BreakingConfig()\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown check.RuleType: %v\", ruleType)\n\t\t}\n\t\tconfiguredRuleOptions := []bufcheck.ConfiguredRulesOption{\n\t\t\tbufcheck.WithPluginConfigs(bufYAMLFile.PluginConfigs()...),\n\t\t\tbufcheck.WithPolicyConfigs(bufYAMLFile.PolicyConfigs()...),\n\t\t\tbufcheck.WithRelatedCheckConfigs(allCheckConfigs...),\n\t\t}\n\t\trules, err = checkClient.ConfiguredRules(\n\t\t\tctx,\n\t\t\truleType,\n\t\t\tcheckConfig,\n\t\t\tconfiguredRuleOptions...,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tallRulesOptions := []bufcheck.AllRulesOption{\n\t\t\tbufcheck.WithPluginConfigs(bufYAMLFile.PluginConfigs()...),\n\t\t\tbufcheck.WithPolicyConfigs(bufYAMLFile.PolicyConfigs()...),\n\t\t}\n\t\trules, err = checkClient.AllRules(\n\t\t\tctx,\n\t\t\truleType,\n\t\t\tbufYAMLFile.FileVersion(),\n\t\t\tallRulesOptions...,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn bufcli.PrintRules(\n\t\tcontainer.Stdout(),\n\t\trules,\n\t\tflags.Format,\n\t\tflags.IncludeDeprecated,\n\t)\n}\n\nfunc getModuleConfigForModulePath(moduleConfigs []bufconfig.ModuleConfig, modulePath string) (bufconfig.ModuleConfig, error) {\n\tmodulePath = normalpath.Normalize(modulePath)\n\t// Multiple modules in a v2 workspace may have the same moduleDirPath.\n\tmoduleConfigsFound := []bufconfig.ModuleConfig{}\n\tfor _, moduleConfig := range moduleConfigs {\n\t\tif moduleConfig.DirPath() == modulePath {\n\t\t\tmoduleConfigsFound = append(moduleConfigsFound, moduleConfig)\n\t\t}\n\t}\n\tswitch len(moduleConfigsFound) {\n\tcase 0:\n\t\treturn nil, fmt.Errorf(\"no module found for path %q\", modulePath)\n\tcase 1:\n\t\treturn moduleConfigsFound[0], nil\n\tdefault:\n\t\t// TODO: add --module-name flag to allow differentiation\n\t\treturn nil, fmt.Errorf(\"multiple modules found for %q\", modulePath)\n\t}\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/convert.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 convert\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufconvert\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\terrorFormatFlagName     = \"error-format\"\n\ttypeFlagName            = \"type\"\n\tfromFlagName            = \"from\"\n\ttoFlagName              = \"to\"\n\tvalidateFlagName        = \"validate\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <input>\",\n\t\tShort: \"Convert a message between binary, text, or JSON\",\n\t\tLong: `\nUse an input proto to interpret a proto/json message and convert it to a different format.\n\nExamples:\n\n    $ buf convert <input> --type=<type> --from=<payload> --to=<output>\n\nThe <input> can be a local .proto file, binary output of \"buf build\", bsr module or local buf module:\n\n    $ buf convert example.proto --type=Foo.proto --from=payload.json --to=output.binpb\n\nAll of <input>, \"--from\" and \"to\" accept formatting options:\n\n    $ buf convert example.proto#format=binpb --type=buf.Foo --from=payload#format=json --to=out#format=json\n\nBoth <input> and \"--from\" accept stdin redirecting:\n\n    $ buf convert <(buf build -o -)#format=binpb --type=foo.Bar --from=<(echo \"{\\\"one\\\":\\\"55\\\"}\")#format=json\n\nRedirect from stdin to --from:\n\n    $ echo \"{\\\"one\\\":\\\"55\\\"}\" | buf convert buf.proto --type buf.Foo --from -#format=json\n\nRedirect from stdin to <input>:\n\n    $ buf build -o - | buf convert -#format=binpb --type buf.Foo --from=payload.json\n\nUse a module on the bsr:\n\n    $ buf convert <buf.build/owner/repository> --type buf.Foo --from=payload.json\n`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tErrorFormat     string\n\tType            string\n\tFrom            string\n\tTo              string\n\tValidate        bool\n\tDisableSymlinks bool\n\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Type,\n\t\ttypeFlagName,\n\t\t\"\",\n\t\t`The full type name of the message within the input (e.g. acme.weather.v1.Units)`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.From,\n\t\tfromFlagName,\n\t\t\"-\",\n\t\tfmt.Sprintf(\n\t\t\t`The location of the payload to be converted. Supported formats are %s`,\n\t\t\tbuffetch.MessageFormatsString,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.To,\n\t\ttoFlagName,\n\t\t\"-\",\n\t\tfmt.Sprintf(\n\t\t\t`The output location of the conversion. Supported formats are %s`,\n\t\t\tbuffetch.MessageFormatsString,\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Validate,\n\t\tvalidateFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t`Validate the message specified with --%s by applying protovalidate rules to it. See https://github.com/bufbuild/protovalidate for more details.`,\n\t\t\tfromFlagName,\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tschemaImage, schemaImageErr := controller.GetImage(\n\t\tctx,\n\t\tinput,\n\t)\n\tvar resolveWellKnownType bool\n\t// only resolve wkts if input was not set.\n\tif container.NumArgs() == 0 {\n\t\tif schemaImageErr != nil {\n\t\t\tresolveWellKnownType = true\n\t\t}\n\t\tif schemaImage != nil {\n\t\t\t_, filterErr := bufimageutil.FilterImage(\n\t\t\t\tschemaImage,\n\t\t\t\tbufimageutil.WithIncludeTypes(flags.Type),\n\t\t\t\tbufimageutil.WithMutateInPlace(),\n\t\t\t)\n\t\t\tif errors.Is(filterErr, bufimageutil.ErrImageFilterTypeNotFound) {\n\t\t\t\tresolveWellKnownType = true\n\t\t\t}\n\t\t}\n\t}\n\tif resolveWellKnownType {\n\t\tif _, ok := datawkt.MessageFilePath(flags.Type); ok {\n\t\t\tvar wktErr error\n\t\t\tschemaImage, wktErr = wellKnownTypeImage(\n\t\t\t\tctx,\n\t\t\t\tcontainer.Logger(),\n\t\t\t\tflags.Type,\n\t\t\t)\n\t\t\tif wktErr != nil {\n\t\t\t\treturn wktErr\n\t\t\t}\n\t\t}\n\t}\n\tif schemaImageErr != nil && schemaImage == nil {\n\t\treturn schemaImageErr\n\t}\n\t// We can't correctly convert anything that uses message-set wire\n\t// format. So we prevent that by having the resolver return an error\n\t// if asked to resolve any type that uses it.\n\tschemaImage = bufconvert.ImageWithoutMessageSetWireFormatResolution(schemaImage)\n\tvar fromFunctionOptions []bufctl.FunctionOption\n\tif flags.Validate {\n\t\tfromFunctionOptions = append(fromFunctionOptions, bufctl.WithMessageValidation())\n\t}\n\tfromMessage, fromMessageEncoding, err := controller.GetMessage(\n\t\tctx,\n\t\tschemaImage,\n\t\tflags.From,\n\t\tflags.Type,\n\t\tbuffetch.MessageEncodingBinpb,\n\t\tfromFunctionOptions...,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"--%s: %w\", fromFlagName, err)\n\t}\n\tdefaultToMessageEncoding, err := inverseEncoding(fromMessageEncoding)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := controller.PutMessage(\n\t\tctx,\n\t\tschemaImage,\n\t\tflags.To,\n\t\tfromMessage,\n\t\tdefaultToMessageEncoding,\n\t); err != nil {\n\t\treturn fmt.Errorf(\"--%s: %w\", toFlagName, err)\n\t}\n\treturn nil\n}\n\n// inverseEncoding returns the opposite encoding of the provided encoding,\n// which will be the default output encoding for a given payload encoding.\nfunc inverseEncoding(encoding buffetch.MessageEncoding) (buffetch.MessageEncoding, error) {\n\tswitch encoding {\n\tcase buffetch.MessageEncodingBinpb:\n\t\treturn buffetch.MessageEncodingJSON, nil\n\tcase buffetch.MessageEncodingJSON:\n\t\treturn buffetch.MessageEncodingBinpb, nil\n\tcase buffetch.MessageEncodingTxtpb:\n\t\treturn buffetch.MessageEncodingBinpb, nil\n\tcase buffetch.MessageEncodingYAML:\n\t\treturn buffetch.MessageEncodingBinpb, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown message encoding %v\", encoding)\n\t}\n}\n\n// wellKnownTypeImage returns an Image with just the given WKT type name (google.protobuf.Duration for example).\nfunc wellKnownTypeImage(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\twellKnownTypeName string,\n) (bufimage.Image, error) {\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, logger, bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\tmoduleSetBuilder.AddLocalModule(\n\t\tdatawkt.ReadBucket,\n\t\t\".\",\n\t\ttrue,\n\t)\n\tmoduleSet, err := moduleSetBuilder.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tlogger,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufimageutil.FilterImage(\n\t\timage,\n\t\tbufimageutil.WithIncludeTypes(wellKnownTypeName),\n\t\tbufimageutil.WithMutateInPlace(),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/convert_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 convert\n\nimport (\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestConvertDefaultInputBin(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`{\"one\":\"55\"}`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/payload.bin\",\n\t\t),\n\t)\n}\n\nfunc TestConvertDefaultInputBinpb(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`{\"one\":\"55\"}`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/payload.binpb\",\n\t\t),\n\t)\n}\n\nfunc TestConvertDefaultInputTxtpb(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`{\"one\":\"55\"}`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/payload.txtpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t),\n\t)\n}\n\nfunc TestConvertDefaultInputYAML(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`one: \"55\"`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/payload.txtpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=yaml\",\n\t\t),\n\t)\n}\nfunc TestConvertFromStdinBin(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/payload.bin\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`{\"one\":\"55\"}`),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=bin\",\n\t\t),\n\t)\n}\nfunc TestConvertFromStdinBinpb(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/payload.binpb\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`{\"one\":\"55\"}`),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=binpb\",\n\t\t),\n\t)\n}\nfunc TestConvertFromStdinTxtpbJSON(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/payload.txtpb\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`{\"one\":\"55\"}`),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=txtpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t),\n\t)\n}\nfunc TestConvertFromStdinTxtpbYAML(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/payload.txtpb\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`one: \"55\"`),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"-#format=txtpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=yaml\",\n\t\t),\n\t)\n}\nfunc TestConvertDiscardedStdin(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`{\"one\":\"55\"}`),\n\t\tappcmdtesting.WithStdin(strings.NewReader(\"this should be discarded\")), // stdin is discarded if not needed\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"buf.Foo\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/payload.binpb\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTBin(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`\"3600s\"`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"google.protobuf.Duration\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/duration.bin\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTBinpb(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`\"3600s\"`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"google.protobuf.Duration\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/duration.binpb\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTTxtpb(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`\"3600s\"`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"google.protobuf.Duration\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/duration.txtpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTYAML(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(`3600s`),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type\",\n\t\t\t\"google.protobuf.Duration\",\n\t\t\t\"--from\",\n\t\t\t\"testdata/convert/bin_json/duration.txtpb\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=yaml\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTFormatBin(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/duration.bin\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Duration\",\n\t\t\t\"--from=testdata/convert/bin_json/duration.json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=bin\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTFormatBinYAML(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/duration.bin\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Duration\",\n\t\t\t\"--from=testdata/convert/bin_json/duration.yaml\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=bin\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTFormatBinpb(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/duration.binpb\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Duration\",\n\t\t\t\"--from=testdata/convert/bin_json/duration.json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTFormatBinpbYAML(t *testing.T) {\n\tt.Parallel()\n\tstdin, err := os.Open(\"testdata/convert/bin_json/duration.binpb\")\n\trequire.NoError(t, err)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Duration\",\n\t\t\t\"--from=testdata/convert/bin_json/duration.yaml\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTIncorrectInput(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(1),\n\t\tappcmdtesting.WithExpectedStdout(\"\"), // explicitly check for empty stdout\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"filedoestexist\",\n\t\t\t\"--type=google.protobuf.Duration\",\n\t\t\t\"--from=testdata/convert/bin_json/duration.json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTGoogleFileLocal(t *testing.T) {\n\tt.Parallel()\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(1),\n\t\tappcmdtesting.WithExpectedStdout(\"\"), // explicitly check for empty stdout\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"google/protobuf/timestamp.proto\", // this file doesn't exist locally\n\t\t\t\"--type=google.protobuf.Duration\",\n\t\t\t\"--from=duration.json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=binpb\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTLocalWKTExists(t *testing.T) {\n\tt.Parallel()\n\texpected := `{\"name\":\"blah\"}` // valid google.protobuf.Method message\n\tstdin := strings.NewReader(expected)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(expected),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Method\",\n\t\t\t\"--from=-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTLocalChanged(t *testing.T) {\n\tt.Parallel()\n\texpected := `{\"notinoriginal\":\"blah\"}` // notinoriginal exists in the local api.proto\n\tstdin := strings.NewReader(expected)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(expected),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Method\",\n\t\t\t\"--from=-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t),\n\t)\n}\n\n// No idea what this does compared to above function - it was the same name in table tests,\n// and table tests dont enforce unique test names.\nfunc TestConvertWKTLocalChanged2(t *testing.T) {\n\tt.Parallel()\n\tstdin := strings.NewReader(`{\"notinchanged\":\"blah\"}`) // notinchanged does not exist in the local api.proto\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(\"{}\"), // we expect empty json because the field doesn't exist in api.proto\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Method\",\n\t\t\t\"--from=-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t),\n\t)\n}\nfunc TestConvertWKTImport(t *testing.T) {\n\tt.Parallel()\n\texpected := `{\"syntax\":\"SYNTAX_PROTO3\"}` // Syntax is imported into type.proto\n\tstdin := strings.NewReader(expected)\n\tappcmdtesting.Run(\n\t\tt,\n\t\ttestNewCommand,\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithExpectedStdout(expected),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(\n\t\t\t\"--type=google.protobuf.Type\",\n\t\t\t\"--from=-#format=json\",\n\t\t\t\"--to\",\n\t\t\t\"-#format=json\",\n\t\t),\n\t)\n}\n\nfunc testNewCommand(use string) *appcmd.Command {\n\treturn NewCommand(\"convert\", appext.NewBuilder(\"convert\"))\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/README.md",
    "content": "To re-generate the `descriptor.plain.binpb` file, run the following command in the root of the project:\n\n```\necho \"{\\\"one\\\":\\\"55\\\"}\" | \\\nbuf convert cmd/buf/testdata/success \\\n    --type buf.Foo \\\n    --from -#format=json \\\n    --to cmd/buf/internal/command/convert/testdata/convert/descriptor.plain.binpb\n```\n\nTo re-generate the `bin_json/duration.{bin,binpb,json,txtpb}` files, run the following command in the root of the project:\n\n```\nfor EXT in bin binpb json txtpb\ndo\n    echo \"\\\"3600s\\\"\" | \\\n    buf convert \\\n        --type google.protobuf.Duration \\\n        --from -#format=json \\\n        --to cmd/buf/internal/command/convert/testdata/convert/bin_json/duration.$EXT\ndone\n```\n\nTo re-generate the `bin_json/image.{bin,binpb,json,txtpb}` files, run the following command in the root of the project:\n\n```\nfor EXT in bin binpb json txtpb\ndo\n    buf build cmd/buf/internal/command/convert/testdata/convert/bin_json/buf.proto \\\n        --output cmd/buf/internal/command/convert/testdata/convert/bin_json/image.$EXT\ndone\n```\n\nTo re-generate the `bin_json/payload.{bin,binpb,json,txtpb}` files, run the following command in the root of the project:\n\n```\nfor EXT in bin binpb json txtpb\ndo\n    echo \"{\\\"one\\\":\\\"55\\\"}\" | \\\n    buf convert cmd/buf/internal/command/convert/testdata/convert/bin_json \\\n        --type buf.Foo \\\n        --from -#format=json \\\n        --to cmd/buf/internal/command/convert/testdata/convert/bin_json/payload.$EXT\ndone\n```\n\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/api.proto",
    "content": "syntax = \"proto3\";\n\npackage google.protobuf;\n\n// Example of if a well known type exists locally and is different to the\n// baked in well known types\nmessage Method {\n  string name = 1;\n  string notinoriginal = 2;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 one = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FILE\nlint:\n  use:\n    - DEFAULT\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/duration.binpb",
    "content": "\b\u001c"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/duration.json",
    "content": "\"3600s\""
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/duration.txtpb",
    "content": "seconds: 3600\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/duration.yaml",
    "content": "3600s\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/image.json",
    "content": "{\"file\":[{\"name\":\"buf.proto\",\"package\":\"buf\",\"messageType\":[{\"name\":\"Foo\",\"field\":[{\"name\":\"one\",\"number\":1,\"label\":\"LABEL_OPTIONAL\",\"type\":\"TYPE_INT64\",\"jsonName\":\"one\"}]}],\"sourceCodeInfo\":{\"location\":[{\"span\":[0,0,6,1]},{\"path\":[12],\"span\":[0,0,18]},{\"path\":[2],\"span\":[2,0,12]},{\"path\":[4,0],\"span\":[4,0,6,1]},{\"path\":[4,0,1],\"span\":[4,8,11]},{\"path\":[4,0,2,0],\"span\":[5,2,16]},{\"path\":[4,0,2,0,5],\"span\":[5,2,7]},{\"path\":[4,0,2,0,1],\"span\":[5,8,11]},{\"path\":[4,0,2,0,3],\"span\":[5,14,15]}]},\"syntax\":\"proto3\",\"bufExtension\":{\"isImport\":false,\"isSyntaxUnspecified\":false}}]}"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/image.txtpb",
    "content": "file: {\n  name: \"buf.proto\"\n  package: \"buf\"\n  message_type: {\n    name: \"Foo\"\n    field: {\n      name: \"one\"\n      number: 1\n      label: LABEL_OPTIONAL\n      type: TYPE_INT64\n      json_name: \"one\"\n    }\n  }\n  source_code_info: {\n    location: {\n      span: 0\n      span: 0\n      span: 6\n      span: 1\n    }\n    location: {\n      path: 12\n      span: 0\n      span: 0\n      span: 18\n    }\n    location: {\n      path: 2\n      span: 2\n      span: 0\n      span: 12\n    }\n    location: {\n      path: 4\n      path: 0\n      span: 4\n      span: 0\n      span: 6\n      span: 1\n    }\n    location: {\n      path: 4\n      path: 0\n      path: 1\n      span: 4\n      span: 8\n      span: 11\n    }\n    location: {\n      path: 4\n      path: 0\n      path: 2\n      path: 0\n      span: 5\n      span: 2\n      span: 16\n    }\n    location: {\n      path: 4\n      path: 0\n      path: 2\n      path: 0\n      path: 5\n      span: 5\n      span: 2\n      span: 7\n    }\n    location: {\n      path: 4\n      path: 0\n      path: 2\n      path: 0\n      path: 1\n      span: 5\n      span: 8\n      span: 11\n    }\n    location: {\n      path: 4\n      path: 0\n      path: 2\n      path: 0\n      path: 3\n      span: 5\n      span: 14\n      span: 15\n    }\n  }\n  syntax: \"proto3\"\n  buf_extension: {\n    is_import: false\n    is_syntax_unspecified: false\n  }\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/image.yaml",
    "content": "file:\n    - bufExtension:\n        isImport: false\n        isSyntaxUnspecified: false\n      messageType:\n        - field:\n            - jsonName: one\n              label: LABEL_OPTIONAL\n              name: one\n              number: 1\n              type: TYPE_INT64\n          name: Foo\n      name: buf.proto\n      package: buf\n      sourceCodeInfo:\n        location:\n            - span:\n                - 0\n                - 0\n                - 6\n                - 1\n            - path:\n                - 12\n              span:\n                - 0\n                - 0\n                - 18\n            - path:\n                - 2\n              span:\n                - 2\n                - 0\n                - 12\n            - path:\n                - 4\n                - 0\n              span:\n                - 4\n                - 0\n                - 6\n                - 1\n            - path:\n                - 4\n                - 0\n                - 1\n              span:\n                - 4\n                - 8\n                - 11\n            - path:\n                - 4\n                - 0\n                - 2\n                - 0\n              span:\n                - 5\n                - 2\n                - 16\n            - path:\n                - 4\n                - 0\n                - 2\n                - 0\n                - 5\n              span:\n                - 5\n                - 2\n                - 7\n            - path:\n                - 4\n                - 0\n                - 2\n                - 0\n                - 1\n              span:\n                - 5\n                - 8\n                - 11\n            - path:\n                - 4\n                - 0\n                - 2\n                - 0\n                - 3\n              span:\n                - 5\n                - 14\n                - 15\n      syntax: proto3\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/payload.binpb",
    "content": "\b7"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/payload.json",
    "content": "{\"one\":\"55\"}"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/payload.txtpb",
    "content": "one: 55\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/bin_json/payload.yaml",
    "content": "one: \"55\"\n"
  },
  {
    "path": "cmd/buf/internal/command/convert/testdata/convert/descriptor.plain.binpb",
    "content": "\b7"
  },
  {
    "path": "cmd/buf/internal/command/curl/curl.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 curl\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"crypto/tls\"\n\t\"encoding/base64\"\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/filepath\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\t\"time\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufcurl\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n\t\"github.com/bufbuild/buf/private/pkg/verbose\"\n\t\"github.com/quic-go/quic-go\"\n\t\"github.com/quic-go/quic-go/http3\"\n\t\"github.com/spf13/pflag\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\t// Input schema flags\n\tschemaFlagName = \"schema\"\n\n\t// Reflection flags\n\treflectFlagName         = \"reflect\"\n\treflectHeaderFlagName   = \"reflect-header\"\n\treflectProtocolFlagName = \"reflect-protocol\"\n\n\t// Protocol/transport flags\n\tprotocolFlagName            = \"protocol\"\n\tunixSocketFlagName          = \"unix-socket\"\n\thttp2PriorKnowledgeFlagName = \"http2-prior-knowledge\"\n\thttp3FlagName               = \"http3\"\n\n\t// TLS flags\n\tkeyFlagName           = \"key\"\n\tcertFlagName          = \"cert\"\n\tcertFlagShortName     = \"E\"\n\tcaCertFlagName        = \"cacert\"\n\tserverNameFlagName    = \"servername\"\n\tinsecureFlagName      = \"insecure\"\n\tinsecureFlagShortName = \"k\"\n\n\t// Action flags\n\tlistServicesFlagName = \"list-services\"\n\tlistMethodsFlagName  = \"list-methods\"\n\n\t// Timeout flags\n\tnoKeepAliveFlagName    = \"no-keepalive\"\n\tkeepAliveFlagName      = \"keepalive-time\"\n\tconnectTimeoutFlagName = \"connect-timeout\"\n\n\t// Header and request body flags\n\tuserAgentFlagName      = \"user-agent\"\n\tuserAgentFlagShortName = \"A\"\n\tuserFlagName           = \"user\"\n\tuserFlagShortName      = \"u\"\n\tnetrcFlagName          = \"netrc\"\n\tnetrcFlagShortName     = \"n\"\n\tnetrcFileFlagName      = \"netrc-file\"\n\theaderFlagName         = \"header\"\n\theaderFlagShortName    = \"H\"\n\tdataFlagName           = \"data\"\n\tdataFlagShortName      = \"d\"\n\n\t// Output flags\n\toutputFlagName       = \"output\"\n\toutputFlagShortName  = \"o\"\n\temitDefaultsFlagName = \"emit-defaults\"\n\n\tverboseFlagName      = \"verbose\"\n\tverboseFlagShortName = \"v\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <url>\",\n\t\tShort: \"Invoke an RPC endpoint, a la 'cURL'\",\n\t\tLong: `This command helps you invoke HTTP RPC endpoints on a server that uses gRPC or Connect.\n\nBy default, server reflection is used, unless the --reflect flag is set to false. Without server\nreflection, a --schema flag must be provided to indicate the Protobuf schema for the method being\ninvoked.\n\nThe only positional argument is the URL of the RPC method to invoke. The name of the method to\ninvoke comes from the last two path components of the URL, which should be the fully-qualified\nservice name and method name, respectively.\n\nThe URL can use either http or https as the scheme. If http is used then HTTP 1.1 will be used\nunless the --http2-prior-knowledge flag is set. If https is used then HTTP/2 will be preferred\nduring protocol negotiation and HTTP 1.1 used only if the server does not support HTTP/2.\n\nThe default RPC protocol used will be Connect. To use a different protocol (gRPC or gRPC-Web),\nuse the --protocol flag. Note that the gRPC protocol cannot be used with HTTP 1.1.\n\nThe input request is specified via the -d or --data flag. If absent, an empty request is sent. If\nthe flag value starts with an at-sign (@), then the rest of the flag value is interpreted as a\nfilename from which to read the request body. If that filename is just a dash (-), then the request\nbody is read from stdin. The request body is a JSON document that contains the JSON formatted\nrequest message. If the RPC method being invoked is a client-streaming method, the request body may\nconsist of multiple JSON values, appended to one another. Multiple JSON documents should usually be\nseparated by whitespace, though this is not strictly required unless the request message type has a\ncustom JSON representation that is not a JSON object.\n\nRequest metadata (i.e. headers) are defined using -H or --header flags. The flag value is in\n\"name: value\" format. But if it starts with an at-sign (@), the rest of the value is interpreted as\na filename from which headers are read, each on a separate line. If the filename is just a dash (-),\nthen the headers are read from stdin.\n\nIf headers and the request body are both to be read from the same file (or both read from stdin),\nthe file must include headers first, then a blank line, and then the request body.\n\nExamples:\n\nIssue a unary RPC to a plain-text (i.e. \"h2c\") gRPC server, where the schema for the service is\nin a Buf module in the current directory, using an empty request message:\n\n    $ buf curl --schema . --protocol grpc --http2-prior-knowledge  \\\n         http://localhost:20202/foo.bar.v1.FooService/DoSomething\n\nIssue an RPC to a Connect server, where the schema comes from the Buf Schema Registry, using\na request that is defined as a command-line argument:\n\n    $ buf curl --schema buf.build/connectrpc/eliza  \\\n         --data '{\"name\": \"Bob Loblaw\"}'          \\\n         https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Introduce\n\nIssue a unary RPC to a server that supports reflection, with verbose output:\n\n    $ buf curl --data '{\"sentence\": \"I am not feeling well.\"}' -v  \\\n\t\t https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Say\n\nIssue a client-streaming RPC to a gRPC-web server that supports reflection, where custom\nheaders and request data are both in a heredoc:\n\n    $ buf curl --data @- --header @- --protocol grpcweb                              \\\n\t\t https://demo.connectrpc.com/connectrpc.eliza.v1.ElizaService/Converse  \\\n       <<EOM\n    Custom-Header-1: foo-bar-baz\n    Authorization: token jas8374hgnkvje9wpkerebncjqol4\n\n    {\"sentence\": \"Hi, doc. I feel hungry.\"}\n    {\"sentence\": \"What is the answer to life, the universe, and everything?\"}\n    {\"sentence\": \"If you were a fish, what of fish would you be?.\"}\n    EOM\n\nNote that server reflection (i.e. use of the --reflect flag) does not work with HTTP 1.1 since the\nprotocol relies on bidirectional streaming. If server reflection is used, the assumed URL for the\nreflection service is the same as the given URL, but with the last two elements removed and\nreplaced with the service and method name for server reflection.\n\nIf an error occurs that is due to incorrect usage or other unexpected error, this program will\nreturn an exit code that is less than 8. If the RPC fails otherwise, this program will return an\nexit code that is the gRPC code, shifted three bits to the left.\n`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\t// Flags for defining input schema\n\tSchemas []string\n\n\t// Flags for server reflection\n\tReflect         bool\n\tReflectHeaders  []string\n\tReflectProtocol string\n\n\t// Protocol details\n\tProtocol            string\n\tUnixSocket          string\n\tHTTP2PriorKnowledge bool\n\tHTTP3               bool\n\n\t// TLS\n\tKey, Cert, CACert, ServerName string\n\tInsecure                      bool\n\t// TODO: CRLFile, CertStatus\n\n\t// Actions\n\tListServices, ListMethods bool\n\n\t// Timeouts\n\tNoKeepAlive           bool\n\tKeepAliveTimeSeconds  float64\n\tConnectTimeoutSeconds float64\n\n\t// Handling request and response data and metadata\n\tUserAgent string\n\tUser      string\n\tNetrc     bool\n\tNetrcFile string\n\tHeaders   []string\n\tData      string\n\n\t// Output options\n\tOutput       string\n\tEmitDefaults bool\n\n\tVerbose bool\n\n\t// so we can inquire about which flags present on command-line\n\t// TODO: ideally we'd use cobra directly instead of having the appcmd wrapper,\n\t//  which prevents a lot of basic functionality by not exposing many cobra features\n\tflagSet *pflag.FlagSet\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tf.flagSet = flagSet\n\n\tflagSet.StringSliceVar(\n\t\t&f.Schemas,\n\t\tschemaFlagName,\n\t\tnil,\n\t\tfmt.Sprintf(\n\t\t\t`The module to use for the RPC schema. This is necessary if the server does not support\nserver reflection. The format of this argument is the same as for the <input> arguments to\nother buf sub-commands such as build and generate. It can indicate a directory, a file, a\nremote module in the Buf Schema Registry, or even standard in (\"-\") for feeding an image or\nfile descriptor set to the command in a shell pipeline.\nIf multiple %s flags are present, they will be consulted in order to resolve service and type\nnames. Setting this flags implies --%s=false unless a %s flag is explicitly present. If both\n%s and %s flags are in use, reflection will be used first and the schemas will be consulted\nin order thereafter if reflection fails to resolve a schema element.`,\n\t\t\tschemaFlagName, reflectFlagName, reflectFlagName,\n\t\t\tschemaFlagName, reflectFlagName,\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Reflect,\n\t\treflectFlagName,\n\t\ttrue,\n\t\t`If true, use server reflection to determine the schema`,\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.ReflectHeaders,\n\t\treflectHeaderFlagName,\n\t\tnil,\n\t\tfmt.Sprintf(`Request headers to include with reflection requests. This flag may only be used\nwhen --%s is also set. This flag may be specified more than once to indicate\nmultiple headers. Each flag value should have the form \"name: value\". But a special value\nof '*' may be used to indicate that all normal request headers (from --%s and -%s\nflags) should also be included with reflection requests. A special value of '@<path>'\nmeans to read headers from the file at <path>. If the path is \"-\" then headers are\nread from stdin. It is not allowed to indicate a file with the same path as used with\nthe request data flag (--%s or -%s). Furthermore, it is not allowed to indicate stdin\nif the schema is expected to be provided via stdin as a file descriptor set or image`,\n\t\t\treflectFlagName, headerFlagName, headerFlagShortName, dataFlagName, dataFlagShortName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.ReflectProtocol,\n\t\treflectProtocolFlagName,\n\t\t\"\",\n\t\t`The reflection protocol to use for downloading information from the server. This flag\nmay only be used when server reflection is used. By default, this command will try all known\nreflection protocols from newest to oldest. If this results in a \"Not Implemented\" error,\nthen older protocols will be used. In practice, this means that \"grpc-v1\" is tried first,\nand \"grpc-v1alpha\" is used if it doesn't work. If newer reflection protocols are introduced,\nthey may be preferred in the absence of this flag being explicitly set to a specific protocol.\nThe valid values for this flag are \"grpc-v1\" and \"grpc-v1alpha\". These correspond to services\nnamed \"grpc.reflection.v1.ServerReflection\" and \"grpc.reflection.v1alpha.ServerReflection\"\nrespectively`,\n\t)\n\n\tflagSet.StringVar(\n\t\t&f.Protocol,\n\t\tprotocolFlagName,\n\t\tconnect.ProtocolConnect,\n\t\t`The RPC protocol to use. This can be one of \"grpc\", \"grpcweb\", or \"connect\"`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.UnixSocket,\n\t\tunixSocketFlagName,\n\t\t\"\",\n\t\t`The path to a unix socket that will be used instead of opening a TCP socket to the host\nand port indicated in the URL`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.HTTP2PriorKnowledge,\n\t\thttp2PriorKnowledgeFlagName,\n\t\tfalse,\n\t\t`This flag can be used to indicate that HTTP/2 should be used. Without this, HTTP 1.1\nwill be used with URLs with an http scheme, and protocol negotiation will be used to\nchoose either HTTP 1.1 or HTTP/2 for URLs with an https scheme. With this flag set,\nHTTP/2 is always used, even over plain-text.`,\n\t)\n\n\tflagSet.BoolVar(\n\t\t&f.HTTP3,\n\t\thttp3FlagName,\n\t\tfalse,\n\t\t`This flag can be used to indicate that HTTP/3 should be used. Without this, HTTP 1.1\nwill be used with URLs with an http scheme, and protocol negotiation will be used to\nchoose either HTTP 1.1 or HTTP/2 for URLs with an https scheme. With this flag set,\nHTTP/3 is always used.`,\n\t)\n\n\tflagSet.BoolVar(\n\t\t&f.NoKeepAlive,\n\t\tnoKeepAliveFlagName,\n\t\tfalse,\n\t\t`By default, connections are created using TCP keepalive. If this flag is present, they\nwill be disabled`,\n\t)\n\tflagSet.Float64Var(\n\t\t&f.KeepAliveTimeSeconds,\n\t\tkeepAliveFlagName,\n\t\t60,\n\t\t`The duration, in seconds, between TCP keepalive transmissions`,\n\t)\n\tflagSet.Float64Var(\n\t\t&f.ConnectTimeoutSeconds,\n\t\tconnectTimeoutFlagName,\n\t\t0,\n\t\t`The time limit, in seconds, for a connection to be established with the server. There is\nno limit if this flag is not present`,\n\t)\n\n\tflagSet.StringVar(\n\t\t&f.Key,\n\t\tkeyFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(`Path to a PEM-encoded X509 private key file, for using client certificates with TLS. This\noption is only valid when the URL uses the https scheme. A --%s or -%s flag must also be\npresent to provide the certificate and public key that corresponds to the given\nprivate key`,\n\t\t\tcertFlagName, certFlagShortName,\n\t\t),\n\t)\n\tflagSet.StringVarP(\n\t\t&f.Cert,\n\t\tcertFlagName,\n\t\tcertFlagShortName,\n\t\t\"\",\n\t\tfmt.Sprintf(`Path to a PEM-encoded X509 certificate file, for using client certificates with TLS. This\noption is only valid when the URL uses the https scheme. A --%s flag must also be\npresent to provide the private key that corresponds to the given certificate`,\n\t\t\tkeyFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.CACert,\n\t\tcaCertFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(`Path to a PEM-encoded X509 certificate pool file that contains the set of trusted\ncertificate authorities/issuers. If omitted, the system's default set of trusted\ncertificates are used to verify the server's certificate. This option is only valid\nwhen the URL uses the https scheme. It is not applicable if --%s or -%s flag is used`,\n\t\t\tinsecureFlagName, insecureFlagShortName,\n\t\t),\n\t)\n\tflagSet.BoolVarP(\n\t\t&f.Insecure,\n\t\tinsecureFlagName,\n\t\tinsecureFlagShortName,\n\t\tfalse,\n\t\t`If set, the TLS connection will be insecure and the server's certificate will NOT be\nverified. This is generally discouraged. This option is only valid when the URL uses\nthe https scheme`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.ServerName,\n\t\tserverNameFlagName,\n\t\t\"\",\n\t\t`The server name to use in TLS handshakes (for SNI) if the URL scheme is https. If not\nspecified, the default is the origin host in the URL or the value in a \"Host\" header if\none is provided`,\n\t)\n\n\tflagSet.BoolVar(\n\t\t&f.ListServices,\n\t\tlistServicesFlagName,\n\t\tfalse,\n\t\t`When set, the command lists supported services and then exits. If server reflection is used\nto provide the RPC schema, then the given URL must be a base URL, not including a service\nor method name. If the schema source is not server reflection, the URL is not used and\nmay be omitted.`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.ListMethods,\n\t\tlistMethodsFlagName,\n\t\tfalse,\n\t\t`When set, the command lists supported methods and then exits. If server reflection is used\nto provide the RPC schema, then the given URL must be a base URL, not including a service\nor method name. If the schema source is not server reflection, the URL is not used and\nmay be omitted.`,\n\t)\n\n\tflagSet.StringVarP(\n\t\t&f.UserAgent,\n\t\tuserAgentFlagName,\n\t\tuserAgentFlagShortName,\n\t\t\"\",\n\t\tfmt.Sprintf(`The user agent string to send. This is ignored if a --%s or -%s flag is provided\nthat sets a header named 'User-Agent'.`,\n\t\t\theaderFlagName, headerFlagShortName,\n\t\t),\n\t)\n\tflagSet.StringVarP(\n\t\t&f.User,\n\t\tuserFlagName,\n\t\tuserFlagShortName,\n\t\t\"\",\n\t\tfmt.Sprintf(`The user credentials to send, via a basic authorization header. The value should be\nin the format \"username:password\". If the value has no colon, it is assumed to just be\nthe username, in which case you will be prompted to enter a password. This overrides\nthe use of a .netrc file. This is ignored if a --%s or -%s flag is provided that sets\na header named 'Authorization'.`,\n\t\t\theaderFlagName, headerFlagShortName,\n\t\t),\n\t)\n\tflagSet.BoolVarP(\n\t\t&f.Netrc,\n\t\tnetrcFlagName,\n\t\tnetrcFlagShortName,\n\t\tfalse,\n\t\tfmt.Sprintf(`If true, a file named .netrc in the user's home directory will be examined to find\ncredentials for the request. The credentials will be sent via a basic authorization header.\nThe command will fail if the file does not have an entry for the hostname in the URL. This\nflag is ignored if a --%s or -%s flag is present. This is ignored if a --%s or -%s flag\nis provided that sets a header named 'Authorization'.`,\n\t\t\tuserFlagName, userFlagShortName, headerFlagName, headerFlagShortName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.NetrcFile,\n\t\tnetrcFileFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(`This is just like use --%s or -%s, except that the named file is used instead of\na file named .netrc in the user's home directory. This flag cannot be used with the --%s\nor -%s flag. This is ignored if a --%s or -%s flag is provided that sets a header named\n'Authorization'.`,\n\t\t\tnetrcFlagName, netrcFlagShortName, netrcFlagName, netrcFlagShortName, headerFlagName, headerFlagShortName,\n\t\t),\n\t)\n\tflagSet.StringSliceVarP(\n\t\t&f.Headers,\n\t\theaderFlagName,\n\t\theaderFlagShortName,\n\t\tnil,\n\t\tfmt.Sprintf(`Request headers to include with the RPC invocation. This flag may be specified more\nthan once to indicate multiple headers. Each flag value should have the form \"name: value\".\nA special value of '@<path>' means to read headers from the file at <path>. If the path\nis \"-\" then headers are read from stdin. If the same file is indicated as used with the\nrequest data flag (--%s or -%s), the file must contain all headers, then a blank line,\nand then the request body. It is not allowed to indicate stdin if the schema is expected\nto be provided via stdin as a file descriptor set or image`,\n\t\t\tdataFlagName, dataFlagShortName,\n\t\t),\n\t)\n\tflagSet.StringVarP(\n\t\t&f.Data,\n\t\tdataFlagName,\n\t\tdataFlagShortName,\n\t\t\"\",\n\t\tfmt.Sprintf(`Request data. This should be zero or more JSON documents, each indicating a request\nmessage. For unary RPCs, there should be exactly one JSON document. A special value of\n'@<path>' means to read the data from the file at <path>. If the path is \"-\" then the\nrequest data is read from stdin. If the same file is indicated as used with the request\nheaders flags (--%s or -%s), the file must contain all headers, then a blank line, and\nthen the request body. It is not allowed to indicate stdin if the schema is expected to be\nprovided via stdin as a file descriptor set or image`,\n\t\t\theaderFlagName, headerFlagShortName,\n\t\t),\n\t)\n\tflagSet.StringVarP(\n\t\t&f.Output,\n\t\toutputFlagName,\n\t\toutputFlagShortName,\n\t\t\"\",\n\t\t`Path to output file to create with response data. If absent, response is printed to stdout`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.EmitDefaults,\n\t\temitDefaultsFlagName,\n\t\tfalse,\n\t\t`Emit default values for JSON-encoded responses.`,\n\t)\n\n\tflagSet.BoolVarP(\n\t\t&f.Verbose,\n\t\tverboseFlagName,\n\t\tverboseFlagShortName,\n\t\tfalse,\n\t\t\"Turn on verbose mode\",\n\t)\n}\n\nfunc (f *flags) validate(hasURL, isSecure bool) error {\n\tif len(f.Schemas) > 0 && f.Reflect && !f.flagSet.Changed(reflectFlagName) {\n\t\t// Reflect just has default value; unset it since we're going to use --schema instead.\n\t\tf.Reflect = false\n\t}\n\tif !f.Reflect && len(f.Schemas) == 0 {\n\t\treturn fmt.Errorf(\"must specify --%s if --%s is false\", schemaFlagName, reflectFlagName)\n\t}\n\n\tif !hasURL && ((!f.ListServices && !f.ListMethods) || f.Reflect) {\n\t\t// If we are trying to use reflection for anything or if we are invoking an RPC (which\n\t\t// means we aren't listing services, listing methods, or describing an element), then\n\t\t// a URL is required.\n\t\treturn appcmd.NewInvalidArgumentError(\"URL positional argument is missing\")\n\t}\n\n\tif f.ListServices && f.ListMethods {\n\t\treturn fmt.Errorf(\"flags --%s and --%s are mutually exclusive\", listServicesFlagName, listMethodsFlagName)\n\t}\n\n\tif (f.Key != \"\" || f.Cert != \"\" || f.CACert != \"\" || f.ServerName != \"\" || f.flagSet.Changed(insecureFlagName)) &&\n\t\t!isSecure {\n\t\treturn fmt.Errorf(\n\t\t\t\"TLS flags (--%s, --%s, --%s, --%s, --%s) should not be used unless URL is secure (https)\",\n\t\t\tkeyFlagName, certFlagName, caCertFlagName, insecureFlagName, serverNameFlagName)\n\t}\n\tif (f.Key != \"\") != (f.Cert != \"\") {\n\t\treturn fmt.Errorf(\"if one of --%s or --%s flags is used, both should be used (mutual TLS with a client certificate requires both)\", keyFlagName, certFlagName)\n\t}\n\tif f.Insecure && f.CACert != \"\" {\n\t\treturn fmt.Errorf(\"if --%s is set, --%s should not be set as it is unused\", insecureFlagName, caCertFlagName)\n\t}\n\n\tif !isSecure && !f.HTTP2PriorKnowledge && f.Protocol == connect.ProtocolGRPC {\n\t\treturn fmt.Errorf(\"grpc protocol cannot be used with plain-text URLs (http) unless --%s flag is set\", http2PriorKnowledgeFlagName)\n\t}\n\n\tif !isSecure && f.HTTP3 {\n\t\treturn fmt.Errorf(\"--%s cannot be used with plain-text URLs (http)\", http3FlagName)\n\t}\n\n\tif f.UnixSocket != \"\" && f.HTTP3 {\n\t\treturn fmt.Errorf(\"--%s cannot be used with --%s\", unixSocketFlagName, http3FlagName)\n\t}\n\n\tif f.Netrc && f.NetrcFile != \"\" {\n\t\treturn fmt.Errorf(\"--%s and --%s flags are mutually exclusive; they may not both be specified\", netrcFlagName, netrcFileFlagName)\n\t}\n\n\tvar schemaIsStdin bool\n\tfor _, schema := range f.Schemas {\n\t\tisStdin := strings.HasPrefix(schema, \"-\")\n\t\tif isStdin && schemaIsStdin {\n\t\t\t// more than one schema argument wants to use stdin\n\t\t\treturn fmt.Errorf(\"multiple --%s flags indicate the use of stdin which is not allowed\", schemaFlagName)\n\t\t}\n\t\tif isStdin {\n\t\t\tschemaIsStdin = true\n\t\t}\n\t}\n\tif (len(f.ReflectHeaders) > 0 || f.flagSet.Changed(reflectProtocolFlagName)) && !f.Reflect {\n\t\treturn fmt.Errorf(\n\t\t\t\"reflection flags (--%s, --%s) should not be used if --%s is false\",\n\t\t\treflectHeaderFlagName, reflectProtocolFlagName, reflectFlagName)\n\t}\n\tif f.Reflect {\n\t\tif !isSecure && !f.HTTP2PriorKnowledge {\n\t\t\treturn fmt.Errorf(\"--%s cannot be used with plain-text URLs (http) unless --%s flag is set\", reflectFlagName, http2PriorKnowledgeFlagName)\n\t\t}\n\t\tif _, err := bufcurl.ParseReflectProtocol(f.ReflectProtocol); err != nil {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"--%s value must be one of %s\",\n\t\t\t\treflectProtocolFlagName,\n\t\t\t\txstrings.SliceToHumanStringOrQuoted(bufcurl.AllKnownReflectProtocolStrings),\n\t\t\t)\n\t\t}\n\t}\n\n\tswitch f.Protocol {\n\tcase connect.ProtocolConnect, connect.ProtocolGRPC, connect.ProtocolGRPCWeb:\n\tdefault:\n\t\treturn fmt.Errorf(\n\t\t\t\"--%s value must be one of %q, %q, or %q\",\n\t\t\tprotocolFlagName, connect.ProtocolConnect, connect.ProtocolGRPC, connect.ProtocolGRPCWeb)\n\t}\n\n\tif f.NoKeepAlive && f.flagSet.Changed(keepAliveFlagName) {\n\t\treturn fmt.Errorf(\"--%s should not be specified if keepalive is disabled\", keepAliveFlagName)\n\t}\n\tif f.KeepAliveTimeSeconds <= 0 {\n\t\treturn fmt.Errorf(\"--%s value must be positive\", keepAliveFlagName)\n\t}\n\t// these two default to zero (which means no timeout in effect)\n\tif f.ConnectTimeoutSeconds < 0 || (f.ConnectTimeoutSeconds == 0 && f.flagSet.Changed(connectTimeoutFlagName)) {\n\t\treturn fmt.Errorf(\"--%s value must be positive\", connectTimeoutFlagName)\n\t}\n\n\tvar dataFile string\n\tif after, ok := strings.CutPrefix(f.Data, \"@\"); ok {\n\t\tdataFile = after\n\t\tif dataFile == \"\" {\n\t\t\treturn fmt.Errorf(\"--%s value starting with '@' must indicate '-' for stdin or a filename\", dataFlagName)\n\t\t}\n\t\tif dataFile == \"-\" && schemaIsStdin {\n\t\t\treturn fmt.Errorf(\"--%s and --%s flags cannot both indicate reading from stdin\", schemaFlagName, dataFlagName)\n\t\t}\n\t}\n\n\theaderFiles := map[string]struct{}{}\n\tif err := validateHeaders(f.Headers, headerFlagName, schemaIsStdin, false, headerFiles); err != nil {\n\t\treturn err\n\t}\n\treflectHeaderFiles := map[string]struct{}{}\n\tif err := validateHeaders(f.ReflectHeaders, reflectHeaderFlagName, schemaIsStdin, true, reflectHeaderFiles); err != nil {\n\t\treturn err\n\t}\n\tfor file := range reflectHeaderFiles {\n\t\tif file == dataFile {\n\t\t\treturn fmt.Errorf(\"--%s and --%s flags cannot indicate the same source\", dataFlagName, reflectHeaderFlagName)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (f *flags) determineCredentials(\n\tctx context.Context,\n\tcontainer app.Container,\n\tverbosePrinter verbose.Printer,\n\thost string,\n) (string, error) {\n\tif f.User != \"\" {\n\t\t// this flag overrides any netrc-related flags\n\t\tparts := strings.SplitN(f.User, \":\", 2)\n\t\tusername := parts[0]\n\t\tvar password string\n\t\tif len(parts) < 2 {\n\t\t\tvar err error\n\t\t\tpassword, err = promptForPassword(ctx, container, fmt.Sprintf(\"Enter host password for user %q:\", username))\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", fmt.Errorf(\"could not prompt for password: %w\", err)\n\t\t\t}\n\t\t} else {\n\t\t\tpassword = parts[1]\n\t\t}\n\t\treturn basicAuth(username, password), nil\n\t}\n\n\t// process netrc-related flags\n\tnetrcFile := f.NetrcFile\n\tif netrcFile == \"\" {\n\t\tif !f.Netrc {\n\t\t\t// no netrc file usage, so no creds\n\t\t\treturn \"\", nil\n\t\t}\n\t\tvar err error\n\t\tnetrcFile, err = netrc.GetFilePath(container)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"could not determine path to .netrc file: %w\", err)\n\t\t}\n\t}\n\tif _, err := os.Stat(netrcFile); err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\t// This mirrors the behavior of curl when a netrc file does not exist ¯\\_(ツ)_/¯\n\t\t\tverbosePrinter.Printf(\"* Couldn't find host %s in the file %q; using no credentials\", host, netrcFile)\n\t\t\treturn \"\", nil\n\t\t}\n\t\tif !strings.Contains(err.Error(), netrcFile) {\n\t\t\t// make sure error message contains path to file\n\t\t\treturn \"\", fmt.Errorf(\"could not read file: %s: %w\", netrcFile, err)\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"could not read file: %w\", err)\n\t}\n\tmachine, err := netrc.GetMachineForNameAndFilePath(host, netrcFile)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"could not read file: %s: %w\", netrcFile, err)\n\t}\n\tif machine == nil {\n\t\t// no creds found for this host\n\t\tverbosePrinter.Printf(\"* Couldn't find host %s in the file %q; using no credentials\", host, netrcFile)\n\t\treturn \"\", nil\n\t}\n\tusername := machine.Login()\n\tif strings.ContainsRune(username, ':') {\n\t\treturn \"\", fmt.Errorf(\"invalid credentials found for %s in %s: username %s should not contain colon\", host, netrcFile, username)\n\t}\n\tpassword := machine.Password()\n\treturn basicAuth(username, password), nil\n}\n\nfunc (f *flags) getTLSConfig(authority string, printer verbose.Printer) (*tls.Config, error) {\n\treturn bufcurl.MakeVerboseTLSConfig(&bufcurl.TLSSettings{\n\t\tKeyFile:             f.Key,\n\t\tCertFile:            f.Cert,\n\t\tCACertFile:          f.CACert,\n\t\tServerName:          f.ServerName,\n\t\tInsecure:            f.Insecure,\n\t\tHTTP2PriorKnowledge: f.HTTP2PriorKnowledge,\n\t\tHTTP3:               f.HTTP3,\n\t}, authority, printer)\n}\n\nfunc promptForPassword(ctx context.Context, container app.Container, prompt string) (string, error) {\n\t// NB: The comments below and the mechanism of handling I/O async was\n\t// copied from the \"registry login\" command.\n\n\t// If a user sends a SIGINT to buf, the top-level application context is\n\t// cancelled and signal masks are reset. However, during an interactive\n\t// login the context is not respected; for example, it takes two SIGINTs\n\t// to interrupt the process.\n\n\t// Ideally we could just trigger an I/O timeout by setting the deadline on\n\t// stdin, but when stdin is connected to a terminal the underlying fd is in\n\t// blocking mode making it ineligible. As changing the mode of stdin is\n\t// dangerous, this change takes an alternate approach of simply returning\n\t// early.\n\n\t// Note that this does not gracefully handle the case where the terminal is\n\t// in no-echo mode, as is the case when prompting for a password\n\t// interactively.\n\tch := make(chan struct{})\n\tvar password string\n\tvar err error\n\tgo func() {\n\t\tdefer close(ch)\n\t\tpassword, err = bufcli.PromptUserForPassword(container, prompt)\n\t}()\n\tselect {\n\tcase <-ch:\n\t\treturn password, err\n\tcase <-ctx.Done():\n\t\tctxErr := ctx.Err()\n\t\t// Otherwise we will print \"Failure: context canceled\".\n\t\tif errors.Is(ctxErr, context.Canceled) {\n\t\t\t// Otherwise the next terminal line will be on the same line as the\n\t\t\t// last output from buf.\n\t\t\tif _, err := fmt.Fprintln(container.Stdout()); err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\treturn \"\", errors.New(\"interrupted\")\n\t\t}\n\t\treturn \"\", ctxErr\n\t}\n}\n\nfunc basicAuth(username, password string) string {\n\tvar buf bytes.Buffer\n\tbuf.WriteString(username)\n\tbuf.WriteByte(':')\n\tbuf.WriteString(password)\n\treturn \"Basic \" + base64.StdEncoding.EncodeToString(buf.Bytes())\n}\n\nfunc validateHeaders(flags []string, flagName string, schemaIsStdin bool, allowAsterisk bool, headerFiles map[string]struct{}) error {\n\tvar hasAsterisk bool\n\tfor _, header := range flags {\n\t\tswitch {\n\t\tcase strings.HasPrefix(header, \"@\"):\n\t\t\tfile := strings.TrimPrefix(header, \"@\")\n\t\t\tif _, ok := headerFiles[file]; ok {\n\t\t\t\treturn fmt.Errorf(\"multiple --%s values refer to the same file %s\", flagName, file)\n\t\t\t}\n\t\t\tif file == \"\" {\n\t\t\t\treturn fmt.Errorf(\"--%s value starting with '@' must indicate '-' for stdin or a filename\", flagName)\n\t\t\t}\n\t\t\tif file == \"-\" && schemaIsStdin {\n\t\t\t\treturn fmt.Errorf(\"--%s and --%s flags cannot both indicate reading from stdin\", schemaFlagName, flagName)\n\t\t\t}\n\t\t\theaderFiles[file] = struct{}{}\n\t\tcase header == \"*\":\n\t\t\tif !allowAsterisk {\n\t\t\t\treturn fmt.Errorf(\"--%s value '*' is not valid\", flagName)\n\t\t\t}\n\t\t\tif hasAsterisk {\n\t\t\t\treturn fmt.Errorf(\"multiple --%s values both indicate '*'\", flagName)\n\t\t\t}\n\t\t\thasAsterisk = true\n\t\tcase header == \"\":\n\t\t\treturn fmt.Errorf(\"--%s value cannot be blank\", flagName)\n\t\tcase strings.ContainsRune(header, '\\n'):\n\t\t\treturn fmt.Errorf(\"--%s value cannot contain a newline\", flagName)\n\t\tdefault:\n\t\t\tparts := strings.SplitN(header, \":\", 2)\n\t\t\tif len(parts) < 2 {\n\t\t\t\treturn fmt.Errorf(\"--%s value is a malformed header: %q\", flagName, header)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc verifyEndpointURL(urlArg string) (host string, isSecure bool, err error) {\n\tendpointURL, err := url.Parse(urlArg)\n\tif err != nil {\n\t\treturn \"\", false, fmt.Errorf(\"%q is not a valid endpoint URL: %w\", urlArg, err)\n\t}\n\tif endpointURL.Scheme != \"http\" && endpointURL.Scheme != \"https\" {\n\t\treturn \"\", false, fmt.Errorf(\"invalid endpoint URL: scheme %q is not supported\", endpointURL.Scheme)\n\t}\n\treturn endpointURL.Host, endpointURL.Scheme == \"https\", nil\n}\n\nfunc parseEndpointURL(urlArg string) (service, method, baseURL string, err error) {\n\tif strings.HasSuffix(urlArg, \"/\") {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"invalid endpoint URL: %q should not end with a slash (/)\", urlArg)\n\t}\n\tparts := strings.Split(urlArg, \"/\")\n\tif len(parts) < 3 || parts[len(parts)-1] == \"\" || parts[len(parts)-2] == \"\" {\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"invalid endpoint URL: %q should end with two non-empty components indicating service and method\", urlArg)\n\t}\n\tservice, method = parts[len(parts)-2], parts[len(parts)-1]\n\tbaseURL = strings.TrimSuffix(urlArg, service+\"/\"+method)\n\tif baseURL == urlArg {\n\t\t// should not be possible due to above checks\n\t\treturn \"\", \"\", \"\", fmt.Errorf(\"failed to extract base URL from %q\", urlArg)\n\t}\n\treturn service, method, baseURL, nil\n}\n\nfunc run(ctx context.Context, container appext.Container, f *flags) (err error) {\n\tvar urlArg, host string\n\tvar isSecure bool\n\tif container.NumArgs() != 0 {\n\t\turlArg = container.Arg(0)\n\t\tvar err error\n\t\thost, isSecure, err = verifyEndpointURL(urlArg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := f.validate(urlArg != \"\", isSecure); err != nil {\n\t\treturn err\n\t}\n\tvar service, method, baseURL string\n\tswitch {\n\tcase f.ListServices || f.ListMethods:\n\t\tbaseURL = urlArg\n\tdefault:\n\t\tservice, method, baseURL, err = parseEndpointURL(urlArg)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar verbosePrinter verbose.Printer = verbose.NopPrinter\n\tif f.Verbose {\n\t\tverbosePrinter = verbose.NewPrinter(container.Stderr(), container.AppName())\n\t}\n\n\tvar clientOptions []connect.ClientOption\n\tswitch f.Protocol {\n\tcase connect.ProtocolGRPC:\n\t\tclientOptions = []connect.ClientOption{connect.WithGRPC()}\n\tcase connect.ProtocolGRPCWeb:\n\t\tclientOptions = []connect.ClientOption{connect.WithGRPCWeb()}\n\t}\n\tif f.Protocol != connect.ProtocolGRPC {\n\t\t// The transport will log trailers to the verbose printer. But if\n\t\t// we're not using standard grpc protocol, trailers are actually encoded\n\t\t// in an end-of-stream message for streaming calls. So this interceptor\n\t\t// will print the trailers for streaming calls when the response stream\n\t\t// is drained.\n\t\tclientOptions = append(clientOptions, connect.WithInterceptors(bufcurl.TraceTrailersInterceptor(verbosePrinter)))\n\t}\n\n\tdataSource := \"(argument)\"\n\tvar dataFileReference string\n\tif after, ok := strings.CutPrefix(f.Data, \"@\"); ok {\n\t\tdataFileReference = after\n\t\tif dataFileReference == \"-\" {\n\t\t\tdataSource = \"(stdin)\"\n\t\t} else {\n\t\t\tdataSource = dataFileReference\n\t\t\tif absFile, err := filepath.Abs(dataFileReference); err == nil {\n\t\t\t\tdataFileReference = absFile\n\t\t\t}\n\t\t}\n\t}\n\trequestHeaders, dataReader, err := bufcurl.LoadHeaders(f.Headers, dataFileReference, nil)\n\tif err != nil {\n\t\treturn err\n\t}\n\tuserAgent := f.UserAgent\n\tif userAgent == \"\" {\n\t\tuserAgent = bufcurl.DefaultUserAgent(f.Protocol, bufcli.Version)\n\t}\n\tif len(requestHeaders.Values(\"user-agent\")) == 0 {\n\t\trequestHeaders.Set(\"user-agent\", userAgent)\n\t}\n\tvar basicCreds *string\n\tif len(requestHeaders.Values(\"authorization\")) == 0 {\n\t\tcreds, err := f.determineCredentials(ctx, container, verbosePrinter, host)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif creds != \"\" {\n\t\t\trequestHeaders.Set(\"authorization\", creds)\n\t\t}\n\t\t// set this to non-nil so we know we've already determined credentials\n\t\tbasicCreds = &creds\n\t}\n\tif dataReader == nil {\n\t\tif dataFileReference == \"-\" {\n\t\t\tdataReader = os.Stdin\n\t\t} else if dataFileReference != \"\" {\n\t\t\tf, err := os.Open(dataFileReference)\n\t\t\tif err != nil {\n\t\t\t\treturn bufcurl.ErrorHasFilename(err, dataFileReference)\n\t\t\t}\n\t\t\tdataReader = f\n\t\t} else if f.Data != \"\" {\n\t\t\tdataReader = io.NopCloser(strings.NewReader(f.Data))\n\t\t}\n\t\t// dataReader is left nil when nothing specified on command-line\n\t}\n\tdefer func() {\n\t\tif dataReader != nil {\n\t\t\terr = errors.Join(err, dataReader.Close())\n\t\t}\n\t}()\n\n\tmakeTransportOnce := sync.OnceValues(func() (connect.HTTPClient, error) {\n\t\t// We do this lazily since some commands don't need a transport, like listing\n\t\t// services and methods and describing elements when the schema source is\n\t\t// something other than server reflection. We memoize the result to use the\n\t\t// same transport for multiple operations where useful (like for both server\n\t\t// reflection and for subsequently invoking an RPC).\n\t\tif urlArg == \"\" {\n\t\t\t// This shouldn't be possible since we check in flags.validate, but just in case\n\t\t\treturn nil, errors.New(\"URL positional argument is missing\")\n\t\t}\n\t\troundTripper, err := makeHTTPRoundTripper(f, isSecure, bufcurl.GetAuthority(host, requestHeaders), verbosePrinter)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn bufcurl.NewVerboseHTTPClient(roundTripper, verbosePrinter), nil\n\t})\n\n\toutput := container.Stdout()\n\tif f.Output != \"\" {\n\t\toutput, err = os.Create(f.Output)\n\t\tif err != nil {\n\t\t\treturn bufcurl.ErrorHasFilename(err, f.Output)\n\t\t}\n\t}\n\n\tresolvers := make([]bufcurl.Resolver, 0, len(f.Schemas)+2)\n\tif f.Reflect {\n\t\treflectHeaders, _, err := bufcurl.LoadHeaders(f.ReflectHeaders, \"\", requestHeaders)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif len(reflectHeaders.Values(\"authorization\")) == 0 {\n\t\t\tvar creds string\n\t\t\tif basicCreds != nil {\n\t\t\t\tcreds = *basicCreds\n\t\t\t} else {\n\t\t\t\tif creds, err = f.determineCredentials(ctx, container, verbosePrinter, host); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif creds != \"\" {\n\t\t\t\treflectHeaders.Set(\"authorization\", creds)\n\t\t\t}\n\t\t}\n\t\tif len(reflectHeaders.Values(\"user-agent\")) == 0 {\n\t\t\treflectHeaders.Set(\"user-agent\", userAgent)\n\t\t}\n\t\treflectProtocol, err := bufcurl.ParseReflectProtocol(f.ReflectProtocol)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttransport, err := makeTransportOnce()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tres, closeRes := bufcurl.NewServerReflectionResolver(ctx, transport, clientOptions, baseURL, reflectProtocol, reflectHeaders, verbosePrinter)\n\t\tdefer closeRes()\n\t\tresolvers = append(resolvers, res)\n\t}\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, schema := range f.Schemas {\n\t\timage, err := controller.GetImage(ctx, schema)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresolvers = append(resolvers, bufcurl.ResolverForImage(image))\n\t}\n\t// Add a WKT resolver to the end of the end of the list. This is used\n\t// for printing a WKT encoded in a \"google.protobuf.Any\" type as JSON.\n\twktResolver, err := bufcurl.NewWKTResolver(ctx, container.Logger())\n\tif err != nil {\n\t\treturn err\n\t}\n\tres := bufcurl.CombineResolvers(append(resolvers, wktResolver)...)\n\n\tswitch {\n\tcase f.ListServices || f.ListMethods:\n\t\tserviceNames, err := res.ListServices()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tslices.Sort(serviceNames)\n\t\tfor _, serviceName := range serviceNames {\n\t\t\tif f.ListServices {\n\t\t\t\tif _, err := fmt.Fprintf(container.Stdout(), \"%s\\n\", serviceName); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tserviceDescriptor, err := bufcurl.ResolveServiceDescriptor(res, string(serviceName))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tmethods := serviceDescriptor.Methods()\n\t\t\t\tlength := methods.Len()\n\t\t\t\tmethodNames := make([]protoreflect.Name, length)\n\t\t\t\tfor i := range length {\n\t\t\t\t\tmethodNames[i] = methods.Get(i).Name()\n\t\t\t\t}\n\t\t\t\tslices.Sort(methodNames)\n\t\t\t\tfor _, methodName := range methodNames {\n\t\t\t\t\tif _, err := fmt.Fprintf(container.Stdout(), \"%s/%s\\n\", serviceName, methodName); 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}\n\t\treturn nil\n\tdefault:\n\t\t// Invoke RPC\n\t\tmethodDescriptor, err := bufcurl.ResolveMethodDescriptor(res, service, method)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttransport, err := makeTransportOnce()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinvoker := bufcurl.NewInvoker(container, verbosePrinter, methodDescriptor, res, f.EmitDefaults, transport, clientOptions, urlArg, output)\n\t\treturn invoker.Invoke(ctx, dataSource, dataReader, requestHeaders)\n\t}\n}\n\nfunc makeHTTPRoundTripper(f *flags, isSecure bool, authority string, printer verbose.Printer) (http.RoundTripper, error) {\n\tif f.HTTP3 {\n\t\treturn makeHTTP3RoundTripper(f, authority, printer)\n\t}\n\tvar dialer net.Dialer\n\tif f.ConnectTimeoutSeconds != 0 {\n\t\tdialer.Timeout = secondsToDuration(f.ConnectTimeoutSeconds)\n\t}\n\tif f.NoKeepAlive {\n\t\tdialer.KeepAlive = -1\n\t} else {\n\t\tdialer.KeepAlive = secondsToDuration(f.KeepAliveTimeSeconds)\n\t}\n\n\tvar dialFunc func(ctx context.Context, network, address string) (net.Conn, error)\n\tif f.UnixSocket != \"\" {\n\t\tdialFunc = func(ctx context.Context, network, addr string) (net.Conn, error) {\n\t\t\tprinter.Printf(\"* Dialing unix socket %s...\", f.UnixSocket)\n\t\t\treturn dialer.DialContext(ctx, \"unix\", f.UnixSocket)\n\t\t}\n\t} else {\n\t\tdialFunc = func(ctx context.Context, network, address string) (net.Conn, error) {\n\t\t\tprinter.Printf(\"* Dialing (%s) %s...\", network, address)\n\t\t\tconn, err := dialer.DialContext(ctx, network, address)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprinter.Printf(\"* Connected to %s\", conn.RemoteAddr().String())\n\t\t\treturn conn, err\n\t\t}\n\t}\n\n\tvar dialTLSFunc func(ctx context.Context, network, address string) (net.Conn, error)\n\tif isSecure {\n\t\ttlsConfig, err := f.getTLSConfig(authority, printer)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdialTLSFunc = func(ctx context.Context, network, addr string) (net.Conn, error) {\n\t\t\tconn, err := dialFunc(ctx, network, addr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprinter.Printf(\"* ALPN: offering %s\", strings.Join(tlsConfig.NextProtos, \",\"))\n\t\t\ttlsConn := tls.Client(conn, tlsConfig)\n\t\t\tif err := tlsConn.HandshakeContext(ctx); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn tlsConn, nil\n\t\t}\n\t}\n\tprotocols := new(http.Protocols)\n\tprotocols.SetHTTP1(!f.HTTP2PriorKnowledge)\n\tprotocols.SetHTTP2(true)\n\tprotocols.SetUnencryptedHTTP2(f.HTTP2PriorKnowledge && !isSecure)\n\treturn &http.Transport{\n\t\tProxy:             http.ProxyFromEnvironment,\n\t\tDialContext:       dialFunc,\n\t\tDialTLSContext:    dialTLSFunc,\n\t\tForceAttemptHTTP2: true,\n\t\tMaxIdleConns:      1,\n\t\tProtocols:         protocols,\n\t}, nil\n}\n\nfunc makeHTTP3RoundTripper(f *flags, authority string, printer verbose.Printer) (http.RoundTripper, error) {\n\tquicCfg := &quic.Config{\n\t\tKeepAlivePeriod: -1,\n\t}\n\tif f.ConnectTimeoutSeconds != 0 {\n\t\tquicCfg.HandshakeIdleTimeout = secondsToDuration(f.ConnectTimeoutSeconds)\n\t}\n\tif !f.NoKeepAlive {\n\t\tquicCfg.KeepAlivePeriod = secondsToDuration(f.KeepAliveTimeSeconds)\n\t}\n\n\ttlsConfig, err := f.getTLSConfig(authority, printer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tudpConn, err := net.ListenUDP(\"udp\", nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttransport := &quic.Transport{Conn: udpConn}\n\troundTripper := &http3.Transport{\n\t\tTLSClientConfig: tlsConfig,\n\t\tQUICConfig:      quicCfg,\n\t\tDial: func(ctx context.Context, addr string, tlsCfg *tls.Config, cfg *quic.Config) (*quic.Conn, error) {\n\t\t\tprinter.Printf(\"* Dialing (udp) %s...\", addr)\n\t\t\tudpAddr, err := net.ResolveUDPAddr(\"udp\", addr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprinter.Printf(\"* ALPN: offering %s\", strings.Join(tlsCfg.NextProtos, \",\"))\n\t\t\tconn, err := transport.DialEarly(ctx, udpAddr, tlsCfg, cfg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tprinter.Printf(\"* Connected to %s\", conn.RemoteAddr().String())\n\t\t\treturn conn, err\n\t\t},\n\t\tEnableDatagrams:        false,\n\t\tAdditionalSettings:     map[uint64]uint64{},\n\t\tMaxResponseHeaderBytes: 0,\n\t\tDisableCompression:     false,\n\t}\n\treturn roundTripper, nil\n}\n\nfunc secondsToDuration(secs float64) time.Duration {\n\treturn time.Duration(float64(time.Second) * secs)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/dep/depgraph/depgraph.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 depgraph\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"slices\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/dag\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\terrorFormatFlagName     = \"error-format\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n\tformatFlagName          = \"format\"\n\n\tdotFormatString  = \"dot\"\n\tjsonFormatString = \"json\"\n)\n\nvar (\n\tallGraphFormatStrings = []string{\n\t\tdotFormatString,\n\t\tjsonFormatString,\n\t}\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <input>\",\n\t\tShort: \"Print the dependency graph\",\n\t\tLong: `As an example, if module in directory \"src/proto\" depends on module \"buf.build/foo/bar\"\nfrom the BSR with commit \"12345\", and \"buf.build/foo/bar:12345\" depends on module \"buf.build/foo/baz\"\nfrom the BSR with commit \"67890\", the following will be printed:\n\ndigraph {\n\n  \"src/proto\" -> \"buf.build/foo/bar:12345\"\n  \"buf.build/foo/bar:12345\" -> \"buf.build/foo/baz:67890\"\n\n}\n\nThe actual output may vary between CLI versions and has no stability guarantees, however the output\nwill always be in valid DOT format. If you'd like us to produce an alternative stable format\n(such as a Protobuf message that we serialize to JSON), let us know!\n\nSee https://graphviz.org to explore Graphviz and the DOT language.\nInstallation of graphviz will vary by platform, but is easy to install using homebrew:\n\nbrew install graphviz\n\nYou can easily visualize a dependency graph using the dot tool:\n\nbuf dep graph | dot -Tpng >| graph.png && open graph.png\n` + bufcli.GetSourceOrModuleLong(`the source or module to print the dependency graph for`),\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tErrorFormat     string\n\tDisableSymlinks bool\n\t// special\n\tInputHashtag string\n\tFormat       string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tdotFormatString,\n\t\tfmt.Sprintf(\n\t\t\t\"The format to print graph as. Must be one of %s\",\n\t\t\txstrings.SliceToString(allGraphFormatStrings),\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(ctx, input)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgraph, err := bufmodule.ModuleSetToDAG(workspace)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar graphString string\n\tswitch flags.Format {\n\tcase dotFormatString:\n\t\tdotString, err := graph.DOTString(moduleToString)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgraphString = dotString\n\tcase jsonFormatString:\n\t\t// We traverse each module (node) in the graph and populate the deps (outbound nodes).\n\t\t// We keep track of every module we have seen so we can update their d\n\t\tmoduleFullNameOrOpaqueIDToExternalModule := make(map[string]externalModule)\n\t\tif err := graph.WalkNodes(\n\t\t\tfunc(module bufmodule.Module, _ []bufmodule.Module, deps []bufmodule.Module) error {\n\t\t\t\tmoduleFullNameOrOpaqueID := moduleFullNameOrOpaqueID(module)\n\t\t\t\t// We have already populated this node through deps, we can skip module.\n\t\t\t\tif _, ok := moduleFullNameOrOpaqueIDToExternalModule[moduleFullNameOrOpaqueID]; ok {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\t// We first scaffold a module with no deps populated yet.\n\t\t\t\texternalModule, err := externalModuleNoDepsForModule(module)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := externalModule.addDeps(deps, graph, moduleFullNameOrOpaqueIDToExternalModule, flags); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// Sort the deps alphabetically before adding our external module.\n\t\t\t\tsortExternalModules(externalModule.Deps)\n\t\t\t\tmoduleFullNameOrOpaqueIDToExternalModule[moduleFullNameOrOpaqueID] = externalModule\n\t\t\t\treturn nil\n\t\t\t},\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\texternalModules := xslices.MapValuesToSlice(moduleFullNameOrOpaqueIDToExternalModule)\n\t\t// Sort all modules alphabetically.\n\t\tsortExternalModules(externalModules)\n\t\tdata, err := json.Marshal(externalModules)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgraphString = string(data)\n\tdefault:\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid value for --%s: %s\", formatFlagName, flags.Format)\n\t}\n\t_, err = fmt.Fprintln(container.Stdout(), graphString)\n\treturn err\n}\n\nfunc moduleToString(module bufmodule.Module) string {\n\tif moduleFullName := module.FullName(); moduleFullName != nil {\n\t\tcommitID := dashlessCommitIDStringForModule(module)\n\t\tif commitID != \"\" {\n\t\t\treturn moduleFullName.String() + \":\" + commitID\n\t\t}\n\t\treturn moduleFullName.String()\n\t}\n\treturn module.OpaqueID()\n}\n\n// moduleFullNameOrOpaqueID returns the FullName for a module if available, otherwise\n// it returns the OpaqueID.\nfunc moduleFullNameOrOpaqueID(module bufmodule.Module) string {\n\tif moduleFullName := module.FullName(); moduleFullName != nil {\n\t\treturn moduleFullName.String()\n\t}\n\treturn module.OpaqueID()\n}\n\n// dashlessCommitIDStringForModule returns the dashless UUID for the commit. If no commit\n// is set, we return an empty string.\nfunc dashlessCommitIDStringForModule(module bufmodule.Module) string {\n\tif commitID := module.CommitID(); commitID != uuid.Nil {\n\t\treturn uuidutil.ToDashless(commitID)\n\t}\n\treturn \"\"\n}\n\ntype externalModule struct {\n\t// FullName if remote, OpaqueID if no FullName\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\t// Dashless\n\tCommit string           `json:\"commit,omitempty\" yaml:\"commit,omitempty\"`\n\tDigest string           `json:\"digest,omitempty\" yaml:\"digest,omitempty\"`\n\tDeps   []externalModule `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tLocal  bool             `json:\"local,omitempty\" yaml:\"local,omitempty\"`\n}\n\nfunc (e *externalModule) addDeps(\n\tdeps []bufmodule.Module,\n\tgraph *dag.Graph[string, bufmodule.Module],\n\tmoduleFullNameOrOpaqueIDToExternalModule map[string]externalModule,\n\tflags *flags,\n) error {\n\tfor _, dep := range deps {\n\t\tdepFullNameOrOpaqueID := moduleFullNameOrOpaqueID(dep)\n\t\tdepExternalModule, ok := moduleFullNameOrOpaqueIDToExternalModule[depFullNameOrOpaqueID]\n\t\tif ok {\n\t\t\t// If this dependency has already been seen, we can simply update our current module\n\t\t\t// and return early.\n\t\t\te.Deps = append(e.Deps, depExternalModule)\n\t\t\treturn nil\n\t\t}\n\t\t// Otherwise, we create a new external module for our direct dependency. However, we do\n\t\t// not add it to our map yet, we only add it once all transitive dependencies have been\n\t\t// handled.\n\t\tdepExternalModule, err := externalModuleNoDepsForModule(dep)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\ttransitiveDeps, err := graph.OutboundNodes(dep.OpaqueID())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := depExternalModule.addDeps(transitiveDeps, graph, moduleFullNameOrOpaqueIDToExternalModule, flags); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmoduleFullNameOrOpaqueIDToExternalModule[depFullNameOrOpaqueID] = depExternalModule\n\t\te.Deps = append(e.Deps, depExternalModule)\n\t}\n\treturn nil\n}\n\n// externalModuleNoDepsForModule returns an externalModule for the given bufmodule.Module\n// without populating the deps. This is because we want to populate the deps from the graph,\n// so we handle it outside of this function.\nfunc externalModuleNoDepsForModule(module bufmodule.Module) (externalModule, error) {\n\t// We always calculate the b5 digest here, we do not check the digest type that is stored\n\t// in buf.lock.\n\tdigest, err := module.Digest(bufmodule.DigestTypeB5)\n\tif err != nil {\n\t\treturn externalModule{}, err\n\t}\n\treturn externalModule{\n\t\tName:   moduleFullNameOrOpaqueID(module),\n\t\tCommit: dashlessCommitIDStringForModule(module),\n\t\tDigest: digest.String(),\n\t\tLocal:  module.IsLocal(),\n\t}, nil\n}\n\nfunc sortExternalModules(externalModules []externalModule) {\n\tslices.SortFunc(\n\t\texternalModules,\n\t\tfunc(a externalModule, b externalModule) int {\n\t\t\tif a.Name > b.Name {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn -1\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/dep/depprune/depprune.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 depprune\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/dep/internal\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n)\n\n// NewCommand returns a new prune Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n\thidden bool,\n) *appcmd.Command {\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <directory>\",\n\t\tShort: \"Prune unused dependencies from a buf.lock\",\n\t\tLong: `The first argument is the directory of your buf.yaml configuration file.\nDefaults to \".\" if no argument is specified.`,\n\t\tArgs:       appcmd.MaximumNArgs(1),\n\t\tDeprecated: deprecated,\n\t\tHidden:     hidden,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container)\n\t\t\t},\n\t\t),\n\t}\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n) error {\n\tdirPath := \".\"\n\tif container.NumArgs() > 0 {\n\t\tdirPath = container.Arg(0)\n\t}\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspaceDepManager, err := controller.GetWorkspaceDepManager(ctx, dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredDepModuleRefs, err := workspaceDepManager.ConfiguredDepModuleRefs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredDepModuleKeys, err := internal.ModuleKeysAndTransitiveDepModuleKeysForModuleRefs(\n\t\tctx,\n\t\tcontainer,\n\t\tconfiguredDepModuleRefs,\n\t\tworkspaceDepManager.BufLockFileDigestType(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn internal.Prune(\n\t\tctx,\n\t\tcontainer.Logger(),\n\t\tcontroller,\n\t\tconfiguredDepModuleKeys,\n\t\tworkspaceDepManager,\n\t\tdirPath,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/dep/depupdate/depupdate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 depupdate\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/dep/internal\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tonlyFlagName = \"only\"\n)\n\n// NewCommand returns a new update Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n\thidden bool,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <directory>\",\n\t\tShort: \"Update pinned module dependencies in a buf.lock\",\n\t\tLong: `Fetch the latest digests for the specified module references in buf.yaml,\nand write them and their transitive dependencies to buf.lock.\n\nThe first argument is the directory of the local module to update.\nDefaults to \".\" if no argument is specified.`,\n\t\tArgs:       appcmd.MaximumNArgs(1),\n\t\tDeprecated: deprecated,\n\t\tHidden:     hidden,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tOnly []string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringSliceVar(\n\t\t&f.Only,\n\t\tonlyFlagName,\n\t\tnil,\n\t\t\"The name of the dependency to update. When set, only this dependency and its transitive dependencies are updated. May be passed multiple times\",\n\t)\n\t// TODO FUTURE: implement\n\t_ = flagSet.MarkHidden(onlyFlagName)\n}\n\n// run update the buf.lock file for a specific module.\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tdirPath := \".\"\n\tif container.NumArgs() > 0 {\n\t\tdirPath = container.Arg(0)\n\t}\n\tif len(flags.Only) > 0 {\n\t\t// TODO FUTURE: implement\n\t\treturn syserror.Newf(\"--%s is not implemented\", onlyFlagName)\n\t}\n\n\tlogger := container.Logger()\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspaceDepManager, err := controller.GetWorkspaceDepManager(ctx, dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredDepModuleRefs, err := workspaceDepManager.ConfiguredDepModuleRefs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredDepModuleKeys, err := internal.ModuleKeysAndTransitiveDepModuleKeysForModuleRefs(\n\t\tctx,\n\t\tcontainer,\n\t\tconfiguredDepModuleRefs,\n\t\tworkspaceDepManager.BufLockFileDigestType(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlogger.DebugContext(\n\t\tctx,\n\t\t\"all deps\",\n\t\tslog.Any(\"deps\", xslices.Map(configuredDepModuleKeys, bufmodule.ModuleKey.String)),\n\t)\n\n\t// Store the existing buf.lock data.\n\texistingDepModuleKeys, err := workspaceDepManager.ExistingBufLockFileDepModuleKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif configuredDepModuleKeys == nil && existingDepModuleKeys == nil {\n\t\t// No new configured deps were found, and no existing buf.lock deps were found, so there\n\t\t// is nothing to update, we can return here.\n\t\t// This ensures we do not create an empty buf.lock when one did not exist in the first\n\t\t// place and we do not need to go through the entire operation of updating non-existent\n\t\t// deps and building the image for tamper-proofing.\n\t\tlogger.Warn(fmt.Sprintf(\"No configured dependencies were found to update in %q.\", dirPath))\n\t\treturn nil\n\t}\n\texistingRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFileRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingRemotePolicyKeys, err := workspaceDepManager.ExistingBufLockFileRemotePolicyKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingPolicyNameToRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFilePolicyNameToRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// We're about to edit the buf.lock file on disk. If we have a subsequent error,\n\t// attempt to revert the buf.lock file.\n\t//\n\t// TODO FUTURE: We should be able to update the buf.lock file in an in-memory bucket, then do the rebuild,\n\t// and if the rebuild is successful, then actually write to disk. It shouldn't even be that much work - just\n\t// overlay the new buf.lock file in a union bucket.\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = errors.Join(retErr, workspaceDepManager.UpdateBufLockFile(ctx, existingDepModuleKeys, existingRemotePluginKeys, existingRemotePolicyKeys, existingPolicyNameToRemotePluginKeys))\n\t\t}\n\t}()\n\t// Edit the buf.lock file with the unpruned dependencies.\n\tif err := workspaceDepManager.UpdateBufLockFile(ctx, configuredDepModuleKeys, existingRemotePluginKeys, existingRemotePolicyKeys, existingPolicyNameToRemotePluginKeys); err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(ctx, dirPath, bufctl.WithIgnoreAndDisallowV1BufWorkYAMLs())\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Validate that the workspace builds.\n\t// Building also has the side effect of doing tamper-proofing.\n\tif _, err := controller.GetImageForWorkspace(\n\t\tctx,\n\t\tworkspace,\n\t\t// This is a performance optimization - we don't need source code info.\n\t\tbufctl.WithImageExcludeSourceInfo(true),\n\t); err != nil {\n\t\treturn err\n\t}\n\t// Log warnings for users on unused configured deps.\n\treturn internal.LogUnusedConfiguredDepsForWorkspace(workspace, logger)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/dep/internal/internal.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// ModuleKeysAndTransitiveDepModuleKeysForModuleRefs gets the ModuleKeys for the\n// ModuleRefs, and all the transitive dependencies.\nfunc ModuleKeysAndTransitiveDepModuleKeysForModuleRefs(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tmoduleRefs []bufparse.Ref,\n\tdigestType bufmodule.DigestType,\n) ([]bufmodule.ModuleKey, error) {\n\tmoduleKeyProvider, err := bufcli.NewModuleKeyProvider(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmoduleKeys, err := moduleKeyProvider.GetModuleKeysForModuleRefs(\n\t\tctx,\n\t\tmoduleRefs,\n\t\tdigestType,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn moduleKeysAndTransitiveDepModuleKeysForModuleKeys(ctx, container, moduleKeys)\n}\n\n// Prune prunes the buf.lock.\n//\n// Used by dep/mod prune.\nfunc Prune(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tcontroller bufctl.Controller,\n\t// Contains all the Modules and their transitive dependencies based on the  buf.yaml.\n\t//\n\t// All dependencies must be within this group from RemoteDepsForModuleSet. If a dependency\n\t// is not within this group, this means it existed in the buf.lock from a previous buf dep update\n\t// call, but no longer is a declared remote dependency based on the current buf.yaml. In this\n\t// case, we error.\n\t//\n\t// This list is computed based on the result of ModuleKeysAndTransitiveDepModuleKeysForModuleRefs.\n\tbufYAMLBasedDepModuleKeys []bufmodule.ModuleKey,\n\tworkspaceDepManager bufworkspace.WorkspaceDepManager,\n\tdirPath string,\n) error {\n\tworkspace, err := controller.GetWorkspace(ctx, dirPath, bufctl.WithIgnoreAndDisallowV1BufWorkYAMLs())\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Make sure the workspace builds.\n\tif _, err := controller.GetImageForWorkspace(\n\t\tctx,\n\t\tworkspace,\n\t\tbufctl.WithImageExcludeSourceInfo(true),\n\t); err != nil {\n\t\treturn err\n\t}\n\t// Compute those dependencies that are in buf.yaml that are not used at all, and warn\n\t// about them.\n\tif err := LogUnusedConfiguredDepsForWorkspace(workspace, logger); err != nil {\n\t\treturn err\n\t}\n\t// Step that actually computes remote dependencies based on imports. These are all\n\t// that is needed for buf.lock.\n\tdepModules, err := bufmodule.RemoteDepsForModuleSet(workspace)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdepModuleKeys, err := xslices.MapError(\n\t\tdepModules,\n\t\tfunc(remoteDep bufmodule.RemoteDep) (bufmodule.ModuleKey, error) {\n\t\t\treturn bufmodule.ModuleToModuleKey(remoteDep, workspaceDepManager.BufLockFileDigestType())\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := validateModuleKeysContains(bufYAMLBasedDepModuleKeys, depModuleKeys); err != nil {\n\t\treturn err\n\t}\n\texistingRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFileRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingRemotePolicyKeys, err := workspaceDepManager.ExistingBufLockFileRemotePolicyKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingPolicyNameToRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFilePolicyNameToRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn workspaceDepManager.UpdateBufLockFile(ctx, depModuleKeys, existingRemotePluginKeys, existingRemotePolicyKeys, existingPolicyNameToRemotePluginKeys)\n}\n\n// LogUnusedConfiguredDepsForWorkspace takes a workspace and logs the unused configured\n// dependencies as warnings to the user.\nfunc LogUnusedConfiguredDepsForWorkspace(\n\tworkspace bufworkspace.Workspace,\n\tlogger *slog.Logger,\n) error {\n\tmalformedDeps, err := bufworkspace.MalformedDepsForWorkspace(workspace)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, malformedDep := range malformedDeps {\n\t\tswitch t := malformedDep.Type(); t {\n\t\tcase bufworkspace.MalformedDepTypeUnused:\n\t\t\tlogger.Warn(fmt.Sprintf(\n\t\t\t\t`Module %[1]s is declared in your buf.yaml deps but is unused. This command only modifies buf.lock files, not buf.yaml files. Please remove %[1]s from your buf.yaml deps if it is not needed.`,\n\t\t\t\tmalformedDep.ModuleRef().FullName(),\n\t\t\t))\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown MalformedDepType: %v\", t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// moduleKeysAndTransitiveDepModuleKeysForModuleKeys returns the ModuleKeys\n// and all the transitive dependencies.\nfunc moduleKeysAndTransitiveDepModuleKeysForModuleKeys(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.ModuleKey, error) {\n\tgraphProvider, err := bufcli.NewGraphProvider(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Walk the graph to get all ModuleKeys including transitive dependencies.\n\tgraph, err := graphProvider.GetGraphForModuleKeys(ctx, moduleKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar newModuleKeys []bufmodule.ModuleKey\n\tif err := graph.WalkNodes(\n\t\tfunc(moduleKey bufmodule.ModuleKey, _ []bufmodule.ModuleKey, _ []bufmodule.ModuleKey) error {\n\t\t\tnewModuleKeys = append(newModuleKeys, moduleKey)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newModuleKeys, nil\n}\n\n// validateModuleKeysContains validates that containingModuleKeys is a superset of moduleKeys.\n//\n// This is used by Prune to validate that bufYAMLBasedDepModuleKeys are a superset of RemoteDepsForModuleSet.\n//\n// See comment on Prune.\nfunc validateModuleKeysContains(containingModuleKeys []bufmodule.ModuleKey, moduleKeys []bufmodule.ModuleKey) error {\n\tcontainingFullNameStringToModuleKey, err := getFullNameStringToModuleKey(containingModuleKeys)\n\tif err != nil {\n\t\treturn syserror.Newf(\"validateModuleKeysContains: containingModuleKeys: %w\", err)\n\t}\n\tmoduleFullNameStringToModuleKey, err := getFullNameStringToModuleKey(moduleKeys)\n\tif err != nil {\n\t\treturn syserror.Newf(\"validateModuleKeysContains: moduleKeys: %w\", err)\n\t}\n\tfor moduleFullNameString := range moduleFullNameStringToModuleKey {\n\t\tif _, ok := containingFullNameStringToModuleKey[moduleFullNameString]; !ok {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t`Module %s is detected to be a still-used dependency from your existing buf.lock, but is not a declared dependency in your buf.yaml deps, and is not a transitive dependency of any declared dependency. Add %s to your buf.yaml deps.`,\n\t\t\t\tmoduleFullNameString,\n\t\t\t\tmoduleFullNameString,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// All ModuleKeys are expected to be unique by FullName.\nfunc getFullNameStringToModuleKey(moduleKeys []bufmodule.ModuleKey) (map[string]bufmodule.ModuleKey, error) {\n\treturn xslices.ToUniqueValuesMap(\n\t\tmoduleKeys,\n\t\tfunc(moduleKey bufmodule.ModuleKey) string {\n\t\t\treturn moduleKey.FullName().String()\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/export/export.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 export\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"os\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\texcludeImportsFlagName  = \"exclude-imports\"\n\tpathsFlagName           = \"path\"\n\toutputFlagName          = \"output\"\n\toutputFlagShortName     = \"o\"\n\tconfigFlagName          = \"config\"\n\texcludePathsFlagName    = \"exclude-path\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n\tallFlagName             = \"all\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <source>\",\n\t\tShort: \"Export proto files from one location to another\",\n\t\tLong: bufcli.GetSourceOrModuleLong(`the source or module to export`) + `\n\nExamples:\n\nExport proto files in <source> to an output directory.\n\n    $ buf export <source> --output=<output-dir>\n\nExport current directory to another local directory.\n\n    $ buf export . --output=<output-dir>\n\nExport the latest remote module to a local directory.\n\n    $ buf export <buf.build/owner/repository> --output=<output-dir>\n\nExport a specific version of a remote module to a local directory.\n\n    $ buf export <buf.build/owner/repository:ref> --output=<output-dir>\n\nExport a git repo to a local directory.\n\n    $ buf export https://github.com/owner/repository.git --output=<output-dir>\n`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tExcludeImports  bool\n\tPaths           []string\n\tOutput          string\n\tConfig          string\n\tExcludePaths    []string\n\tDisableSymlinks bool\n\tAll             bool\n\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindExcludeImports(flagSet, &f.ExcludeImports, excludeImportsFlagName)\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tflagSet.StringVarP(\n\t\t&f.Output,\n\t\toutputFlagName,\n\t\toutputFlagShortName,\n\t\t\"\",\n\t\t`The output directory for exported files`,\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, outputFlagName)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.All,\n\t\tallFlagName,\n\t\tfalse,\n\t\t`When set, include any available documentation and license files for the exported input. If the input has more than one module, then the documentation and license file names will be suffixed with the module name.`,\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(\n\t\tctx,\n\t\tinput,\n\t\tbufctl.WithTargetPaths(flags.Paths, flags.ExcludePaths),\n\t\tbufctl.WithConfigOverride(flags.Config),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleReadBucket := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(workspace)\n\n\tif err := os.MkdirAll(flags.Output, 0755); err != nil {\n\t\treturn err\n\t}\n\tvar options []storageos.ProviderOption\n\tif !flags.DisableSymlinks {\n\t\toptions = append(options, storageos.ProviderWithSymlinks())\n\t}\n\treadWriteBucket, err := storageos.NewProvider(options...).NewReadWriteBucket(\n\t\tflags.Output,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If the --all flag is set, then we need to pull the non-proto source files, documentation\n\t// and license files, for the input, if available.\n\t// We only add non-proto source files for target module(s).\n\t//\n\t// If the input has more than one target module (e.g. a workspace Git input), then we set\n\t// an identifier on the file path.\n\t// See [getNonProtoFilePath] docs for details on how that is set.\n\tif flags.All {\n\t\tseenModuleNamesForDocs := map[string]int{}\n\t\tseenModuleNamesForLicense := map[string]int{}\n\t\ttargetModules := bufmodule.ModuleSetTargetModules(workspace)\n\t\tfor _, module := range targetModules {\n\t\t\tdocFile, err := bufmodule.GetDocFile(ctx, module)\n\t\t\t// If the file is not found, then we ignore it.\n\t\t\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif docFile != nil {\n\t\t\t\tdocFilePath := docFile.Path()\n\t\t\t\tif len(targetModules) > 1 {\n\t\t\t\t\tdocFilePath = getNonProtoFilePath(docFilePath, module, seenModuleNamesForDocs)\n\t\t\t\t}\n\t\t\t\tif err := storage.CopyReader(ctx, readWriteBucket, docFile, docFilePath); err != nil {\n\t\t\t\t\treturn errors.Join(err, docFile.Close())\n\t\t\t\t}\n\t\t\t\tif err := docFile.Close(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tlicenseFile, err := bufmodule.GetLicenseFile(ctx, module)\n\t\t\t// If the file is not found, then we ignore it.\n\t\t\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif licenseFile != nil {\n\t\t\t\tlicenseFilePath := licenseFile.Path()\n\t\t\t\tif len(targetModules) > 1 {\n\t\t\t\t\tlicenseFilePath = getNonProtoFilePath(licenseFilePath, module, seenModuleNamesForLicense)\n\t\t\t\t}\n\t\t\t\tif err := storage.CopyReader(ctx, readWriteBucket, licenseFile, licenseFilePath); err != nil {\n\t\t\t\t\treturn errors.Join(err, licenseFile.Close())\n\t\t\t\t}\n\t\t\t\tif err := licenseFile.Close(); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// In the case where we are excluding imports, we are allowing users to specify an input\n\t// that may not have resolved imports (https://github.com/bufbuild/buf/issues/3002).\n\t// Thus we do not need to build the image, and instead we can return the non-import files\n\t// from the workspace.\n\tif flags.ExcludeImports {\n\t\tif err := moduleReadBucket.WalkFileInfos(\n\t\t\tctx,\n\t\t\tfunc(fileInfo bufmodule.FileInfo) error {\n\t\t\t\tmoduleFile, err := moduleReadBucket.GetFile(ctx, fileInfo.Path())\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn syserror.Wrap(err)\n\t\t\t\t}\n\t\t\t\tif err := storage.CopyReadObject(ctx, readWriteBucket, moduleFile); err != nil {\n\t\t\t\t\treturn errors.Join(err, moduleFile.Close())\n\t\t\t\t}\n\t\t\t\treturn moduleFile.Close()\n\t\t\t},\n\t\t\tbufmodule.WalkFileInfosWithOnlyTargetFiles(),\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\timage, err := controller.GetImageForWorkspace(\n\t\tctx,\n\t\tworkspace,\n\t\tbufctl.WithImageExcludeSourceInfo(true),\n\t\tbufctl.WithImageExcludeImports(flags.ExcludeImports),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\timageFiles := image.Files()\n\tif len(imageFiles) == 0 {\n\t\treturn errors.New(\"no .proto target files found\")\n\t}\n\tfor _, imageFile := range image.Files() {\n\t\tmoduleFile, err := moduleReadBucket.GetFile(ctx, imageFile.Path())\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) && datawkt.Exists(imageFile.Path()) {\n\t\t\t\t// Images include all imports, including WKTs. WKTs may or may not exist as part of the Workspace. They are implicitly\n\t\t\t\t// added to Images if they are not present in a Module or its dependencies. However, we want to make sure that\n\t\t\t\t// we still export them if they were part of a Module, or were part of an explicit dependency (for example,\n\t\t\t\t// buf.build/protocolbuffers/wellknowntypes).\n\t\t\t\t//\n\t\t\t\t// This is the only case where a file may exist in the Image but not in the Workspace. Any other case where a file\n\t\t\t\t// does not exist is a system error.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn syserror.Wrap(err)\n\t\t}\n\t\tif err := storage.CopyReadObject(ctx, readWriteBucket, moduleFile); err != nil {\n\t\t\treturn errors.Join(err, moduleFile.Close())\n\t\t}\n\t\tif err := moduleFile.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// This is a helper function that returns the path non-proto source files should be written\n// to if the --all flag has been set.\n//\n// This sets an identifier for the module using the module name, [bufparse.FullName.Name()]\n// if available, and if not, we use [module.OpaqueID()].\n//\n// e.g. README.foo.md, README.bar.md\n//\n// If a module name is repeated, e.g. acme/foo and bufbuild/foo both have the module name\n// \"foo\", then we use an incrementing integer based on the order they are seen in the workspace.\n//\n// e.g. README.foo.md, README.foo.2.md\nfunc getNonProtoFilePath(\n\tpath string,\n\tmodule bufmodule.Module,\n\tseenModuleNamesForPath map[string]int,\n) string {\n\tmoduleIdentifier := module.OpaqueID()\n\tif module.FullName() != nil {\n\t\tmoduleIdentifier = module.FullName().Name()\n\t\tseenModuleNamesForPath[module.FullName().Name()]++\n\t\tcount := seenModuleNamesForPath[module.FullName().Name()]\n\t\tif count > 1 {\n\t\t\tmoduleIdentifier = fmt.Sprintf(\"%s.%d\", module.FullName().Name(), count)\n\t\t}\n\t}\n\treturn fmt.Sprintf(\n\t\t\"%s.%s%s\",\n\t\tstrings.TrimSuffix(path, normalpath.Ext(path)),\n\t\tmoduleIdentifier,\n\t\tnormalpath.Ext(path),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/format/format.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 format\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/buf/bufformat\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tconfigFlagName          = \"config\"\n\tdiffFlagName            = \"diff\"\n\tdiffFlagShortName       = \"d\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n\terrorFormatFlagName     = \"error-format\"\n\texcludePathsFlagName    = \"exclude-path\"\n\texitCodeFlagName        = \"exit-code\"\n\toutputFlagName          = \"output\"\n\toutputFlagShortName     = \"o\"\n\tpathsFlagName           = \"path\"\n\twriteFlagName           = \"write\"\n\twriteFlagShortName      = \"w\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <source>\",\n\t\tShort: \"Format Protobuf files\",\n\t\tLong: `\nBy default, the source is the current directory and the formatted content is written to stdout.\n\nExamples:\n\nWrite the current directory's formatted content to stdout:\n\n    $ buf format\n\nMost people will want to rewrite the files defined in the current directory in-place with -w:\n\n    $ buf format -w\n\nDisplay a diff between the original and formatted content with -d\nWrite a diff instead of the formatted file:\n\n    $ buf format simple/simple.proto -d\n\n    $ diff -u simple/simple.proto.orig simple/simple.proto\n    --- simple/simple.proto.orig\t2022-03-24 09:44:10.000000000 -0700\n    +++ simple/simple.proto\t2022-03-24 09:44:10.000000000 -0700\n    @@ -2,8 +2,7 @@\n\n    package simple;\n\n    -\n    message Object {\n    -    string key = 1;\n    -   bytes value = 2;\n    +  string key = 1;\n    +  bytes value = 2;\n    }\n\nUse the --exit-code flag to exit with a non-zero exit code if there is a diff:\n\n    $ buf format --exit-code\n    $ buf format -w --exit-code\n    $ buf format -d --exit-code\n\nFormat a file, directory, or module reference by specifying a source e.g.\nWrite the formatted file to stdout:\n\n    $ buf format simple/simple.proto\n\n    syntax = \"proto3\";\n\n    package simple;\n\n    message Object {\n      string key = 1;\n      bytes value = 2;\n    }\n\nWrite the formatted directory to stdout:\n\n    $ buf format simple\n    ...\n\nWrite the formatted module reference to stdout:\n\n    $ buf format buf.build/acme/petapis\n    ...\n\nWrite the result to a specified output file or directory with -o e.g.\n\nWrite the formatted file to another file:\n\n    $ buf format simple/simple.proto -o simple/simple.formatted.proto\n\nWrite the formatted directory to another directory, creating it if it doesn't exist:\n\n    $ buf format proto -o formatted\n\nThis also works with module references:\n\n    $ buf format buf.build/acme/weather -o formatted\n\nRewrite the file(s) in-place with -w. e.g.\n\nRewrite a single file in-place:\n\n    $ buf format simple.proto -w\n\nRewrite an entire directory in-place:\n\n    $ buf format proto -w\n\nWrite a diff and rewrite the file(s) in-place:\n\n    $ buf format simple -d -w\n\n    $ diff -u simple/simple.proto.orig simple/simple.proto\n    ...\n\nThe -w and -o flags cannot be used together in a single invocation.\n`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tConfig          string\n\tDiff            bool\n\tDisableSymlinks bool\n\tErrorFormat     string\n\tExcludePaths    []string\n\tExitCode        bool\n\tPaths           []string\n\tOutput          string\n\tWrite           bool\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.BoolVarP(\n\t\t&f.Diff,\n\t\tdiffFlagName,\n\t\tdiffFlagShortName,\n\t\tfalse,\n\t\t\"Display diffs instead of rewriting files\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.ExitCode,\n\t\texitCodeFlagName,\n\t\tfalse,\n\t\t\"Exit with a non-zero exit code if files were not already formatted\",\n\t)\n\tflagSet.BoolVarP(\n\t\t&f.Write,\n\t\twriteFlagName,\n\t\twriteFlagShortName,\n\t\tfalse,\n\t\t\"Rewrite files in-place\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVarP(\n\t\t&f.Output,\n\t\toutputFlagName,\n\t\toutputFlagShortName,\n\t\t\"-\",\n\t\tfmt.Sprintf(\n\t\t\t`The output location for the formatted files. Must be one of format %s. If omitted, the result is written to stdout`,\n\t\t\tbuffetch.DirOrProtoFileFormatsString,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tsource, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We use getDirOrProtoFileRef to see if we have a valid DirOrProtoFileRef, and if so,\n\t// whether or not we have IncludePackageFiles Set.\n\t//\n\t// We abuse ExternalPaths below to say that if flags.Write is set, just write over\n\t// the ExternalPath, You can only really use flags.Write if you have a dir\n\t// or proto file. So, we abuse getDirOrProtoFileRef to determine if we have a writable source.\n\t// if flags.Write is set\n\t//\n\t// We also want to check that if we have a ProtoFileRef, we don't have IncludePackageFiles\n\t// set, regardless of if flags.Write is set.\n\tsourceDirOrProtoFileRef, sourceDirOrProtoFileRefErr := getDirOrProtoFileRef(ctx, container, source)\n\tif sourceDirOrProtoFileRefErr == nil {\n\t\tif err := validateNoIncludePackageFiles(sourceDirOrProtoFileRef); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif flags.Write {\n\t\tif flags.Output != \"-\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"cannot use --%s when using --%s\", outputFlagName, writeFlagName)\n\t\t}\n\t\t// We abuse ExternalPaths below to say that if flags.Write is set, just write over\n\t\t// the ExternalPath. Also, you can only really use flags.Write if you have a dir\n\t\t// or proto file. So, we abuse getDirOrProtoFileRef to determine if we have a writable source.\n\t\tif sourceDirOrProtoFileRefErr != nil {\n\t\t\tif errors.Is(sourceDirOrProtoFileRefErr, buffetch.ErrModuleFormatDetectedForDirOrProtoFileRef) {\n\t\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid input %q when using --%s: must be a directory or proto file\", source, writeFlagName)\n\t\t\t}\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid input %q when using --%s: %v\", source, writeFlagName, sourceDirOrProtoFileRefErr)\n\t\t}\n\t}\n\tdirOrProtoFileRef, err := getDirOrProtoFileRef(ctx, container, flags.Output)\n\tif err != nil {\n\t\tif errors.Is(err, buffetch.ErrModuleFormatDetectedForDirOrProtoFileRef) {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be a directory or proto file\", outputFlagName)\n\t\t}\n\t\treturn err\n\t}\n\tif err := validateNoIncludePackageFiles(dirOrProtoFileRef); err != nil {\n\t\treturn err\n\t}\n\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(\n\t\tctx,\n\t\tsource,\n\t\tbufctl.WithTargetPaths(flags.Paths, flags.ExcludePaths),\n\t\tbufctl.WithConfigOverride(flags.Config),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleReadBucket := bufmodule.ModuleReadBucketWithOnlyTargetFiles(\n\t\t// We only want to start with the target Modules. Otherwise, we're going to fetch potential\n\t\t// ModuleDeps that are not targeted, which may result in buf format making remote calls\n\t\t// when all we care to do is format local files.\n\t\t//\n\t\t// We need to make remote Modules even lazier to make sure that buf format is really\n\t\t// not making these remote calls, but this is one component of it.\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFilesForTargetModules(workspace),\n\t)\n\toriginalReadBucket := bufmodule.ModuleReadBucketToStorageReadBucket(moduleReadBucket)\n\tformattedReadBucket, err := bufformat.FormatBucket(ctx, originalReadBucket)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdiffBuffer := bytes.NewBuffer(nil)\n\tchangedPaths, err := storage.DiffWithFilenames(\n\t\tctx,\n\t\tdiffBuffer,\n\t\toriginalReadBucket,\n\t\tformattedReadBucket,\n\t\tstorage.DiffWithExternalPaths(), // No need to set prefixes as the buckets are from the same location.\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdiffExists := diffBuffer.Len() > 0\n\tdefer func() {\n\t\tif retErr == nil && flags.ExitCode && diffExists {\n\t\t\tretErr = bufctl.ErrFileAnnotation\n\t\t}\n\t}()\n\n\tif flags.Diff {\n\t\tif diffExists {\n\t\t\tif _, err := io.Copy(container.Stdout(), diffBuffer); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// If we haven't overridden the output flag and haven't set write, we can stop here.\n\t\tif flags.Output == \"-\" && !flags.Write {\n\t\t\treturn nil\n\t\t}\n\t}\n\tif flags.Write {\n\t\tchangedPathSet := xslices.ToStructMap(changedPaths)\n\t\treturn storage.WalkReadObjects(\n\t\t\tctx,\n\t\t\tformattedReadBucket,\n\t\t\t\"\",\n\t\t\tfunc(readObject storage.ReadObject) error {\n\t\t\t\tif _, ok := changedPathSet[readObject.Path()]; !ok {\n\t\t\t\t\t// no change, nothing to re-write\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\t// TODO FUTURE: This is a legacy hack that we shouldn't use. We should not\n\t\t\t\t// rely on external paths being writable.\n\t\t\t\t//\n\t\t\t\t// We do validation above on the flags.Write flag to quasi-ensure that ExternalPath\n\t\t\t\t// will be a real externalPath, but it's not great.\n\t\t\t\tfile, err := os.OpenFile(readObject.ExternalPath(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tdefer func() {\n\t\t\t\t\tretErr = errors.Join(retErr, file.Close())\n\t\t\t\t}()\n\t\t\t\tif _, err := file.ReadFrom(readObject); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t},\n\t\t)\n\t}\n\t// Both flags.Diff and flags.Write not set, do output logic.\n\tswitch t := dirOrProtoFileRef.(type) {\n\tcase buffetch.DirRef:\n\t\tif err := writeToDir(ctx, flags.DisableSymlinks, formattedReadBucket, t); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase buffetch.ProtoFileRef:\n\t\tif err := writeToProtoFile(ctx, container, formattedReadBucket, t); err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\treturn syserror.Newf(\"buffetch ref type must be dir or proto file: %T\", dirOrProtoFileRef)\n\t}\n\treturn nil\n}\n\nfunc writeToDir(\n\tctx context.Context,\n\tdisableSymlinks bool,\n\tformattedReadBucket storage.ReadBucket,\n\tdirRef buffetch.DirRef,\n) error {\n\tif err := createDirIfNotExists(dirRef.DirPath()); err != nil {\n\t\treturn err\n\t}\n\treadWriteBucket, err := newStorageosProvider(disableSymlinks).NewReadWriteBucket(\n\t\tdirRef.DirPath(),\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We don't copy with ExternalPaths, we use Paths.\n\t// This is what we were always doing, including pre-refactor.\n\t_, err = storage.Copy(\n\t\tctx,\n\t\tformattedReadBucket,\n\t\treadWriteBucket,\n\t)\n\treturn err\n}\n\nfunc writeToProtoFile(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tformattedReadBucket storage.ReadBucket,\n\tprotoFileRef buffetch.ProtoFileRef,\n) (retErr error) {\n\twriteCloser, err := buffetch.NewProtoFileWriter(container.Logger()).PutProtoFile(\n\t\tctx,\n\t\tcontainer,\n\t\tprotoFileRef,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeCloser.Close())\n\t}()\n\treturn storage.WalkReadObjects(\n\t\tctx,\n\t\tformattedReadBucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdata, err := io.ReadAll(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif _, err := writeCloser.Write(data); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\nfunc createDirIfNotExists(dirPath string) error {\n\t// OK to use os.Stat instead of os.LStat here as this is CLI-only\n\tif _, err := os.Stat(dirPath); err != nil {\n\t\t// We don't need to check fileInfo.IsDir() because it's\n\t\t// already handled by the storageosProvider.\n\t\tif os.IsNotExist(err) {\n\t\t\tif err := os.MkdirAll(dirPath, 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// We could os.RemoveAll if the overall command exits without error, but we're\n\t\t\t// not going to, just to be safe.\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc getDirOrProtoFileRef(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tvalue string,\n) (buffetch.DirOrProtoFileRef, error) {\n\treturn buffetch.NewDirOrProtoFileRefParser(\n\t\tcontainer.Logger(),\n\t).GetDirOrProtoFileRef(ctx, value)\n}\n\nfunc validateNoIncludePackageFiles(dirOrProtoFileRef buffetch.DirOrProtoFileRef) error {\n\tif protoFileRef, ok := dirOrProtoFileRef.(buffetch.ProtoFileRef); ok && protoFileRef.IncludePackageFiles() {\n\t\t// We should have a better answer here. Right now, it's\n\t\t// possible that the other files in the same package are defined\n\t\t// in a remote dependency, which makes it impossible to rewrite\n\t\t// in-place.\n\t\t//\n\t\t// In the case that the user uses the -w flag, we'll either need\n\t\t// to return an error, or omit the file that it can't rewrite in-place\n\t\t// (potentially including a debug log).\n\t\treturn appcmd.NewInvalidArgumentError(\"cannot specify include_package_files=true with format\")\n\t}\n\treturn nil\n}\n\nfunc newStorageosProvider(disableSymlinks bool) storageos.Provider {\n\tvar options []storageos.ProviderOption\n\tif !disableSymlinks {\n\t\toptions = append(options, storageos.ProviderWithSymlinks())\n\t}\n\treturn storageos.NewProvider(options...)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/generate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 generate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/bufgen\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\ttemplateFlagName            = \"template\"\n\tbaseOutDirPathFlagName      = \"output\"\n\tbaseOutDirPathFlagShortName = \"o\"\n\tdeleteOutsFlagName          = \"clean\"\n\terrorFormatFlagName         = \"error-format\"\n\tconfigFlagName              = \"config\"\n\tpathsFlagName               = \"path\"\n\tincludeImportsFlagName      = \"include-imports\"\n\tincludeWKTFlagName          = \"include-wkt\"\n\texcludePathsFlagName        = \"exclude-path\"\n\tdisableSymlinksFlagName     = \"disable-symlinks\"\n\ttypeFlagName                = \"type\"\n\ttypeDeprecatedFlagName      = \"include-types\"\n\texcludeTypeFlagName         = \"exclude-type\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <input>\",\n\t\tShort: \"Generate code with protoc plugins\",\n\t\tLong: `This command uses a template file of the shape:\n\n    # buf.gen.yaml\n    # The version of the generation template.\n    # The valid values are v1beta1, v1 and v2.\n    # Required.\n    version: v2\n    # When clean is set to true, delete the directories, zip files, and/or jar files specified in the\n    # \"out\" field for all plugins before running code generation. Defaults to false.\n    # Optional.\n    clean: true\n    # The plugins to run.\n    # Required.\n    plugins:\n        # Use the plugin hosted at buf.build/protocolbuffers/go at version v1.28.1.\n        # If version is omitted, uses the latest version of the plugin.\n        # One of \"remote\", \"local\" and \"protoc_builtin\" is required.\n      - remote: buf.build/protocolbuffers/go:v1.28.1\n        # The relative output directory.\n        # Required.\n        out: gen/go\n        # The revision of the remote plugin to use, a sequence number that Buf\n        # increments when rebuilding or repackaging the plugin.\n        revision: 4\n        # Any options to provide to the plugin.\n        # This can be either a single string or a list of strings.\n        # Optional.\n        opt: paths=source_relative\n        # Whether to generate code for imported files as well.\n        # Optional.\n        include_imports: false\n        # Whether to generate code for the well-known types.\n        # Optional.\n        include_wkt: false\n        # Include only these types for this plugin.\n        # Optional.\n        types:\n          - \"foo.v1.User\"\n        # Exclude these types for this plugin.\n        # Optional.\n        exclude_types:\n          - \"buf.validate.oneof\"\n          - \"buf.validate.message\"\n          - \"buf.validate.field\"\"\n\n        # The name of a local plugin if discoverable in \"${PATH}\" or its path in the file system.\n      - local: protoc-gen-es\n        out: gen/es\n        include_imports: true\n        include_wkt: true\n\n        # The full invocation of a local plugin can be specified as a list.\n      - local: [\"go\", \"run\", \"path/to/plugin.go\"]\n        out: gen/plugin\n        # The generation strategy to use. There are two options:\n        #\n        # 1. \"directory\"\n        #\n        #   This will result in buf splitting the input files by directory, and making separate plugin\n        #   invocations in parallel. This is roughly the concurrent equivalent of:\n        #\n        #     for dir in $(find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq); do\n        #       protoc -I . $(find \"${dir}\" -name '*.proto')\n        #     done\n        #\n        #   Almost every Protobuf plugin either requires this, or works with this,\n        #   and this is the recommended and default value.\n        #\n        # 2. \"all\"\n        #\n        #   This will result in buf making a single plugin invocation with all input files.\n        #   This is roughly the equivalent of:\n        #\n        #     protoc -I . $(find . -name '*.proto')\n        #\n        #   This is needed for certain plugins that expect all files to be given at once.\n        #   This is also the only strategy for remote plugins.\n        #\n        # If omitted, \"directory\" is used. Most users should not need to set this option.\n        # Optional.\n        strategy: directory\n\n        # \"protoc_builtin\" specifies a plugin that comes with protoc, without the \"protoc-gen-\" prefix.\n      - protoc_builtin: java\n        out: gen/java\n        # Path to protoc. If not specified, the protoc installation in \"${PATH}\" is used.\n        # Optional.\n        protoc_path: path/to/protoc\n\n    # Managed mode modifies file options and/or field options on the fly.\n    managed:\n      # Enables managed mode.\n      enabled: true\n\n      # Each override rule specifies an option, the value for this option and\n      # optionally the files/fields for which the override is applied.\n      #\n      # The accepted file options are:\n      #  - java_package\n      #  - java_package_prefix\n      #  - java_package_suffix\n      #  - java_multiple_files\n      #  - java_outer_classname\n      #  - java_string_check_utf8\n      #  - go_package\n      #  - go_package_prefix\n      #  - optimize_for\n      #  - csharp_namespace\n      #  - csharp_namespace_prefix\n      #  - ruby_package\n      #  - ruby_package_suffix\n      #  - objc_class_prefix\n      #  - php_namespace\n      #  - php_metadata_namespace\n      #  - php_metadata_namespace_suffix\n      #  - cc_enable_arenas\n      #\n      # An override rule can apply to a field option.\n      # The accepted field options are:\n      #  - jstype\n      #\n      # If multiple overrides for the same option apply to a file or field,\n      # the last rule takes effect.\n      # Optional.\n      override:\n          # Sets \"go_package_prefix\" to \"foo/bar/baz\" for all files.\n        - file_option: go_package_prefix\n          value: foo/bar/baz\n\n          # Sets \"java_package_prefix\" to \"net.foo\" for files in \"buf.build/foo/bar\".\n        - file_option: java_package_prefix\n          value: net.foo\n          module: buf.build/foo/bar\n\n          # Sets \"java_package_prefix\" to \"dev\" for \"file.proto\".\n          # This overrides the value \"net.foo\" for \"file.proto\" from the previous rule.\n        - file_option: java_package_prefix\n          value: dev\n          module: buf.build/foo/bar\n          path: file.proto\n\n          # Sets \"go_package\" to \"x/y/z\" for all files in directory \"x/y/z\".\n        - file_option: go_package\n          value: foo/bar/baz\n          path: x/y/z\n\n          # Sets a field's \"jstype\" to \"JS_NORMAL\".\n        - field_option: jstype\n          value: JS_STRING\n          field: foo.v1.Bar.baz\n\n      # Disables managed mode under certain conditions.\n      # Takes precedence over \"overrides\".\n      # Optional.\n      disable:\n          # Do not modify any options for files in this module.\n        - module: buf.build/googleapis/googleapis\n\n          # Do not modify any options for this file.\n        - module: buf.build/googleapis/googleapis\n          path: foo/bar/file.proto\n\n          # Do not modify \"java_multiple_files\" for any file\n        - file_option: java_multiple_files\n\n          # Do not modify \"csharp_namespace\" for files in this module.\n        - module: buf.build/acme/weather\n          file_option: csharp_namespace\n\n    # The inputs to generate code for.\n    # The inputs here are ignored if an input is specified as a command line argument.\n    # Each input is one of \"directory\", \"git_repo\", \"module\", \"tarball\", \"zip_archive\",\n    # \"proto_file\", \"binary_image\", \"json_image\", \"text_image\" and \"yaml_image\".\n    # Optional.\n    inputs:\n        # The path to a directory.\n      - directory: x/y/z\n\n        # The URL of a Git repository.\n      - git_repo: https://github.com/acme/weather.git\n        # The branch to clone.\n        # Optional.\n        branch: dev\n        # The subdirectory in the repository to use.\n        # Optional.\n        subdir: proto\n        # How deep of a clone to perform.\n        # Optional.\n        depth: 30\n\n        # The URL of a BSR module.\n      - module: buf.build/acme/weather\n        # Only generate code for these types.\n        # Optional.\n        types:\n          - \"foo.v1.User\"\n          - \"foo.v1.UserService\"\n        # Exclude these types.\n        # Optional.\n        exclude_types:\n          - \"buf.validate\"\n        # Only generate code for files in these paths.\n        # If empty, include all paths.\n        paths:\n          - a/b/c\n          - a/b/d\n        # Do not generate code for files in these paths.\n        exclude_paths:\n          - a/b/c/x.proto\n          - a/b/d/y.proto\n\n        # The URL or path to a tarball.\n      - tarball: a/b/x.tar.gz\n        # The relative path within the archive to use as the base directory.\n        # Optional.\n        subdir: proto\n\n        # The compression scheme, derived from the file extension if unspecified.\n        # \".tgz\" and \".tar.gz\" extensions automatically use Gzip.\n        # \".tar.zst\" automatically uses Zstandard.\n        # Optional.\n        compression: gzip\n\n        # Reads at the relative path and strips some number of components.\n        # Optional.\n        strip_components: 2\n\n        # The URL or path to a zip archive.\n      - zip_archive: https://github.com/googleapis/googleapis/archive/master.zip\n        # The number of directories to strip.\n        # Optional.\n        strip_components: 1\n\n        # The path to a specific proto file.\n      - proto_file: foo/bar/baz.proto\n        # Whether to generate code for files in the same package as well, default to false.\n        # Optional.\n        include_package_files: true\n\n        # A Buf image in binary format.\n        # Other image formats are \"yaml_image\", \"text_image\" and \"json_image\".\n      - binary_image: image.binpb.gz\n        # The compression scheme of the image file, derived from file extension if unspecified.\n        # Optional.\n        compression: gzip\n\nAs an example, here's a typical \"buf.gen.yaml\" go and grpc, assuming\n\"protoc-gen-go\" and \"protoc-gen-go-grpc\" are on your \"$PATH\":\n\n    # buf.gen.yaml\n    version: v2\n    plugins:\n      - local: protoc-gen-go\n        out: gen/go\n        opt: paths=source_relative\n      - local: protoc-gen-go-grpc\n        out: gen/go\n        opt:\n          - paths=source_relative\n          - require_unimplemented_servers=false\n\nBy default, buf generate will look for a file of this shape named\n\"buf.gen.yaml\" in your current directory. This can be thought of as a template\nfor the set of plugins you want to invoke.\n\nThe first argument is the source, module, or image to generate from.\nDefaults to \".\" if no argument is specified.\n\nUse buf.gen.yaml as template, current directory as input:\n\n    $ buf generate\n\nSame as the defaults (template of \"buf.gen.yaml\", current directory as input):\n\n    $ buf generate --template buf.gen.yaml .\n\nThe --template flag also takes YAML or JSON data as input, so it can be used without a file:\n\n    $ buf generate --template '{\"version\":\"v2\",\"plugins\":[{\"local\":\"protoc-gen-go\",\"out\":\"gen/go\"}]}'\n\nDownload the repository and generate code stubs per the bar.yaml template:\n\n    $ buf generate --template bar.yaml https://github.com/foo/bar.git\n\nGenerate to the bar/ directory, prepending bar/ to the out directives in the template:\n\n    $ buf generate --template bar.yaml -o bar https://github.com/foo/bar.git\n\nThe paths in the template and the -o flag will be interpreted as relative to the\ncurrent directory, so you can place your template files anywhere.\n\nIf you only want to generate stubs for a subset of your input, you can do so via the --path. e.g.\n\nOnly generate for the files in the directories proto/foo and proto/bar:\n\n    $ buf generate --path proto/foo --path proto/bar\n\nOnly generate for the files proto/foo/foo.proto and proto/foo/bar.proto:\n\n    $ buf generate --path proto/foo/foo.proto --path proto/foo/bar.proto\n\nOnly generate for the files in the directory proto/foo on your git repository:\n\n    $ buf generate --template buf.gen.yaml https://github.com/foo/bar.git --path proto/foo\n\nNote that all paths must be contained within the same module. For example, if you have a\nmodule in \"proto\", you cannot specify \"--path proto\", however \"--path proto/foo\" is allowed\nas \"proto/foo\" is contained within \"proto\".\n\nPlugins are invoked in the order they are specified in the template, but each plugin\nhas a per-directory parallel invocation, with results from each invocation combined\nbefore writing the result.\n\nInsertion points are processed in the order the plugins are specified in the template.\n`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tTemplate               string\n\tBaseOutDirPath         string\n\tDeleteOuts             *bool\n\tErrorFormat            string\n\tFiles                  []string\n\tConfig                 string\n\tPaths                  []string\n\tIncludeImportsOverride *bool\n\tIncludeWKTOverride     *bool\n\tExcludePaths           []string\n\tDisableSymlinks        bool\n\t// We may be able to bind two flags to one string slice but I don't\n\t// want to find out what will break if we do.\n\tTypes           []string\n\tTypesDeprecated []string\n\tExcludeTypes    []string\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tbindBoolPointer(\n\t\tflagSet,\n\t\tincludeImportsFlagName,\n\t\t&f.IncludeImportsOverride,\n\t\t\"Also generate all imports except for Well-Known Types\",\n\t)\n\tbindBoolPointer(\n\t\tflagSet,\n\t\tincludeWKTFlagName,\n\t\t&f.IncludeWKTOverride,\n\t\tfmt.Sprintf(\n\t\t\t\"Also generate Well-Known Types. Cannot be set to true without setting --%s to true\",\n\t\t\tincludeImportsFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Template,\n\t\ttemplateFlagName,\n\t\t\"\",\n\t\t`The generation template file or data to use. Must be in either YAML or JSON format`,\n\t)\n\tflagSet.StringVarP(\n\t\t&f.BaseOutDirPath,\n\t\tbaseOutDirPathFlagName,\n\t\tbaseOutDirPathFlagShortName,\n\t\t\".\",\n\t\t`The base directory to generate to. This is prepended to the out directories in the generation template`,\n\t)\n\tbindBoolPointer(\n\t\tflagSet,\n\t\tdeleteOutsFlagName,\n\t\t&f.DeleteOuts,\n\t\t`Prior to generation, delete the directories, jar files, or zip files that the plugins will write to. Allows cleaning of existing assets without having to call rm -rf`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors, printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.Types,\n\t\ttypeFlagName,\n\t\tnil,\n\t\t\"The types (package, message, enum, extension, service, method) that should be included in this image. When specified, the resulting image will only include descriptors to describe the requested types. Flag usage overrides buf.gen.yaml\",\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.TypesDeprecated,\n\t\ttypeDeprecatedFlagName,\n\t\tnil,\n\t\t\"The types (package, message, enum, extension, service, method) that should be included in this image. When specified, the resulting image will only include descriptors to describe the requested types. Flag usage overrides buf.gen.yaml\",\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.ExcludeTypes,\n\t\texcludeTypeFlagName,\n\t\tnil,\n\t\t\"The types (package, message, enum, extension, service, method) that should be excluded from this image. When specified, the resulting image will omit descriptors for the specified types and remove any references to them, such as fields typed to an excluded message or enum, or custom options tied to an excluded extension. The image is first filtered by the included types, then further reduced by the excluded. Flag usage overrides buf.gen.yaml\",\n\t)\n\t_ = flagSet.MarkDeprecated(typeDeprecatedFlagName, fmt.Sprintf(\"use --%s instead\", typeFlagName))\n\t_ = flagSet.MarkHidden(typeDeprecatedFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tlogger := container.Logger()\n\tif flags.IncludeWKTOverride != nil &&\n\t\t*flags.IncludeWKTOverride &&\n\t\t(flags.IncludeImportsOverride == nil || !*flags.IncludeImportsOverride) {\n\t\t// You need to set --include-imports to true if you set --include-wkt to true, which isn’t great.\n\t\t// The alternative is to have --include-wkt implicitly set --include-imports, but this could be surprising.\n\t\t// Or we could rename --include-wkt to --include-imports-and/with-wkt. But the summary is that the flag\n\t\t// only makes sense in the context of including imports.\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"Cannot set --%s to true without setting --%s to true\", includeWKTFlagName, includeImportsFlagName)\n\t}\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \"\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar storageosProvider storageos.Provider\n\tif flags.DisableSymlinks {\n\t\tstorageosProvider = storageos.NewProvider()\n\t} else {\n\t\tstorageosProvider = storageos.NewProvider(storageos.ProviderWithSymlinks())\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbufGenYAMLFile, err := readBufGenYAMLFile(ctx, storageosProvider, flags.Template)\n\tif err != nil {\n\t\treturn err\n\t}\n\timages, err := getInputImages(\n\t\tctx,\n\t\tlogger,\n\t\tcontroller,\n\t\tinput,\n\t\tbufGenYAMLFile,\n\t\tflags.Config,\n\t\tflags.Paths,\n\t\tflags.ExcludePaths,\n\t\tappend(flags.Types, flags.TypesDeprecated...),\n\t\tflags.ExcludeTypes,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgenerateOptions := []bufgen.GenerateOption{\n\t\tbufgen.GenerateWithBaseOutDirPath(flags.BaseOutDirPath),\n\t}\n\tif flags.DeleteOuts != nil {\n\t\tgenerateOptions = append(\n\t\t\tgenerateOptions,\n\t\t\tbufgen.GenerateWithDeleteOuts(*flags.DeleteOuts),\n\t\t)\n\t}\n\tif flags.IncludeImportsOverride != nil {\n\t\tgenerateOptions = append(\n\t\t\tgenerateOptions,\n\t\t\tbufgen.GenerateWithIncludeImportsOverride(*flags.IncludeImportsOverride),\n\t\t)\n\t}\n\tif flags.IncludeWKTOverride != nil {\n\t\tgenerateOptions = append(\n\t\t\tgenerateOptions,\n\t\t\tbufgen.GenerateWithIncludeWellKnownTypesOverride(*flags.IncludeWKTOverride),\n\t\t)\n\t}\n\treturn bufgen.NewGenerator(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\tclientConfig,\n\t).Generate(\n\t\tctx,\n\t\tcontainer,\n\t\tbufGenYAMLFile.GenerateConfig(),\n\t\timages,\n\t\tgenerateOptions...,\n\t)\n}\n\nfunc readBufGenYAMLFile(\n\tctx context.Context,\n\tstorageosProvider storageos.Provider,\n\ttemplatePath string,\n) (bufconfig.BufGenYAMLFile, error) {\n\ttemplatePathExtension := filepath.Ext(templatePath)\n\tswitch {\n\tcase templatePath == \"\":\n\t\tbucket, err := storageosProvider.NewReadWriteBucket(\".\", storageos.ReadWriteBucketWithSymlinksIfSupported())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn bufconfig.GetBufGenYAMLFileForPrefix(ctx, bucket, \".\")\n\tcase templatePathExtension == \".yaml\" || templatePathExtension == \".yml\" || templatePathExtension == \".json\":\n\t\t// We should not read from a bucket at \".\" because this path can jump context.\n\t\tconfigFile, err := os.Open(templatePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer configFile.Close()\n\t\treturn bufconfig.ReadBufGenYAMLFile(configFile)\n\tdefault:\n\t\treturn bufconfig.ReadBufGenYAMLFile(strings.NewReader(templatePath))\n\t}\n}\n\nfunc getInputImages(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tcontroller bufctl.Controller,\n\tinputSpecified string,\n\tbufGenYAMLFile bufconfig.BufGenYAMLFile,\n\tmoduleConfigOverride string,\n\ttargetPathsOverride []string,\n\texcludePathsOverride []string,\n\tincludeTypesOverride []string,\n\texcludeTypesOverride []string,\n) ([]bufimage.Image, error) {\n\t// If input is specified on the command line, we use that. If input is not\n\t// specified on the command line, use the default input.\n\tif inputSpecified != \"\" || len(bufGenYAMLFile.InputConfigs()) == 0 {\n\t\tinput := \".\"\n\t\tif inputSpecified != \"\" {\n\t\t\tinput = inputSpecified\n\t\t}\n\t\tvar includeTypes []string\n\t\tif typesConfig := bufGenYAMLFile.GenerateConfig().GenerateTypeConfig(); typesConfig != nil {\n\t\t\tincludeTypes = typesConfig.IncludeTypes()\n\t\t}\n\t\tif len(includeTypesOverride) > 0 {\n\t\t\tincludeTypes = includeTypesOverride\n\t\t}\n\t\tvar excludeTypes []string\n\t\tif len(excludeTypesOverride) > 0 {\n\t\t\texcludeTypes = excludeTypesOverride\n\t\t}\n\t\tinputImage, err := controller.GetImage(\n\t\t\tctx,\n\t\t\tinput,\n\t\t\tbufctl.WithConfigOverride(moduleConfigOverride),\n\t\t\tbufctl.WithTargetPaths(targetPathsOverride, excludePathsOverride),\n\t\t\tbufctl.WithImageIncludeTypes(includeTypes),\n\t\t\tbufctl.WithImageExcludeTypes(excludeTypes),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn []bufimage.Image{inputImage}, nil\n\t}\n\tvar inputImages []bufimage.Image\n\tfor _, inputConfig := range bufGenYAMLFile.InputConfigs() {\n\t\ttargetPaths := inputConfig.TargetPaths()\n\t\tif len(targetPathsOverride) > 0 {\n\t\t\ttargetPaths = targetPathsOverride\n\t\t}\n\t\texcludePaths := inputConfig.ExcludePaths()\n\t\tif len(excludePathsOverride) > 0 {\n\t\t\texcludePaths = excludePathsOverride\n\t\t}\n\t\tincludeTypes := inputConfig.IncludeTypes()\n\t\tif len(includeTypesOverride) > 0 {\n\t\t\tincludeTypes = includeTypesOverride\n\t\t}\n\t\texcludeTypes := inputConfig.ExcludeTypes()\n\t\tif len(excludeTypesOverride) > 0 {\n\t\t\texcludeTypes = excludeTypesOverride\n\t\t}\n\t\tinputImage, err := controller.GetImageForInputConfig(\n\t\t\tctx,\n\t\t\tinputConfig,\n\t\t\tbufctl.WithConfigOverride(moduleConfigOverride),\n\t\t\tbufctl.WithTargetPaths(targetPaths, excludePaths),\n\t\t\tbufctl.WithImageIncludeTypes(includeTypes),\n\t\t\tbufctl.WithImageExcludeTypes(excludeTypes),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tinputImages = append(inputImages, inputImage)\n\t}\n\treturn inputImages, nil\n}\n\n// TODO FUTURE: where does this belong? A flagsext package?\n// value must not be nil.\nfunc bindBoolPointer(flagSet *pflag.FlagSet, name string, value **bool, usage string) {\n\tflag := flagSet.VarPF(\n\t\t&boolPointerValue{\n\t\t\tvaluePointer: value,\n\t\t},\n\t\tname,\n\t\t\"\",\n\t\tusage,\n\t)\n\tflag.NoOptDefVal = \"true\"\n}\n\n// Implements pflag.Value.\ntype boolPointerValue struct {\n\t// This must not be nil at construction time.\n\tvaluePointer **bool\n}\n\nfunc (b *boolPointerValue) Type() string {\n\t// From the CLI users' perspective, this is just a bool.\n\treturn \"bool\"\n}\n\nfunc (b *boolPointerValue) String() string {\n\tif *b.valuePointer == nil {\n\t\t// From the CLI users' perspective, this is just false.\n\t\treturn \"false\"\n\t}\n\treturn strconv.FormatBool(**b.valuePointer)\n}\n\nfunc (b *boolPointerValue) Set(value string) error {\n\tparsedValue, err := strconv.ParseBool(value)\n\tif err != nil {\n\t\treturn err\n\t}\n\t*b.valuePointer = &parsedValue\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/generate_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 generate\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xtesting\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/internaltesting\"\n\t\"github.com/bufbuild/buf/private/buf/buftesting\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/spf13/pflag\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// TODO FUTURE: this has to change if we split up this repository\nvar buftestingDirPath = filepath.Join(\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"..\",\n\t\"private\",\n\t\"buf\",\n\t\"buftesting\",\n)\n\nfunc TestCompareGeneratedStubsGoogleapisGo(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubs(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]*testPluginInfo{\n\t\t\t{name: \"go\", opt: \"Mgoogle/api/auth.proto=foo\"},\n\t\t},\n\t)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisGoZip(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubsArchive(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]*testPluginInfo{\n\t\t\t{name: \"go\", opt: \"Mgoogle/api/auth.proto=foo\"},\n\t\t},\n\t\tfalse,\n\t)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisGoJar(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubsArchive(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]*testPluginInfo{\n\t\t\t{name: \"go\", opt: \"Mgoogle/api/auth.proto=foo\"},\n\t\t},\n\t\ttrue,\n\t)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisObjc(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubs(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]*testPluginInfo{{name: \"objc\"}},\n\t)\n}\n\nfunc TestCompareGeneratedStubsGoogleapisPyi(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\ttestCompareGeneratedStubs(\n\t\tt,\n\t\tgoogleapisDirPath,\n\t\t[]*testPluginInfo{{name: \"pyi\"}},\n\t)\n}\n\nfunc TestCompareInsertionPointOutput(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\tinsertionTestdataDirPath := filepath.Join(\"testdata\", \"insertion\")\n\ttestCompareGeneratedStubs(\n\t\tt,\n\t\tinsertionTestdataDirPath,\n\t\t[]*testPluginInfo{\n\t\t\t{name: \"insertion-point-receiver\"},\n\t\t\t{name: \"insertion-point-writer\"},\n\t\t},\n\t)\n}\n\nfunc TestGenerateV2LocalPluginBasic(t *testing.T) {\n\tt.Parallel()\n\n\ttempDirPath := t.TempDir()\n\tinput := filepath.Join(\"testdata\", \"v2\", \"local_plugin\")\n\ttemplate := filepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.basic.gen.yaml\")\n\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\ttemplate,\n\t\tinput,\n\t)\n\n\texpected, err := storagemem.NewReadBucket(\n\t\tmap[string][]byte{\n\t\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Bar\n    - a.v1.Foo\n`),\n\t\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Bar\n    - b.v1.Foo\n`),\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\tactual, err := storageos.NewProvider().NewReadWriteBucket(tempDirPath)\n\trequire.NoError(t, err)\n\n\tdiff, err := storage.DiffBytes(t.Context(), expected, actual)\n\trequire.NoError(t, err)\n\trequire.Empty(t, string(diff))\n}\n\nfunc TestGenerateV2LocalPluginTypes(t *testing.T) {\n\tt.Parallel()\n\ttestRunTypeArgs := func(t *testing.T, expect map[string][]byte, args ...string) {\n\t\tt.Helper()\n\t\ttempDirPath := t.TempDir()\n\t\ttestRunSuccess(\n\t\t\tt,\n\t\t\tappend([]string{\n\t\t\t\t\"--output\",\n\t\t\t\ttempDirPath,\n\t\t\t}, args...)...,\n\t\t)\n\t\texpected, err := storagemem.NewReadBucket(expect)\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, err)\n\t\tactual, err := storageos.NewProvider().NewReadWriteBucket(tempDirPath)\n\t\trequire.NoError(t, err)\n\n\t\tdiff, err := storage.DiffBytes(t.Context(), expected, actual)\n\t\trequire.NoError(t, err)\n\t\trequire.Empty(t, string(diff))\n\t}\n\n\t// buf.basic.gen.yaml\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Bar\n    - a.v1.Foo\n`),\n\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Bar\n    - b.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.basic.gen.yaml\"),\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\"),\n\t)\n\t// buf.types.gen.yaml\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.types.gen.yaml\"),\n\t)\n\t// input specified\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Bar\n    - a.v1.Foo\n`),\n\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Bar\n    - b.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.types.gen.yaml\"),\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\"), // input\n\t)\n\t// --template as CLI flag\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\t`version: v2\nplugins:\n  - local: protoc-gen-top-level-type-names-yaml\n    out: gen\ninputs:\n  - directory: ./testdata/v2/local_plugin\n    types:\n      - a.v1.Foo`,\n\t)\n\t// --type\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Bar\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.types.gen.yaml\"),\n\t\t\"--type\",\n\t\t\"b.v1.Bar\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\"),\n\t)\n\t// --path\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Bar\n    - b.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.types.gen.yaml\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"b\"),\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\"),\n\t)\n\t// --exclude-path\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Bar\n    - a.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.types.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"b\", \"v1\"),\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\"),\n\t)\n\t// buf.paths.gen.yaml\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Bar\n    - a.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.paths.gen.yaml\"),\n\t)\n\t// buf.exclude.paths.gen.yaml\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Bar\n    - b.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.exclude.paths.gen.yaml\"),\n\t)\n\t// --type overrides template\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Bar\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"local_plugin\", \"buf.types.gen.yaml\"),\n\t\t\"--type\",\n\t\t\"b.v1.Bar\",\n\t)\n\t// buf.gen.yaml has types and exclude_types on inputs and plugins\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Foo\n`),\n\t\tfilepath.Join(\"gen\", \"b\", \"v1\", \"b.top-level-type-names.yaml\"): []byte(`messages:\n    - b.v1.Baz\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"types\", \"buf.gen.yaml\"),\n\t)\n\t// --exclude-type override\n\ttestRunTypeArgs(t, map[string][]byte{\n\t\tfilepath.Join(\"gen\", \"a\", \"v1\", \"a.top-level-type-names.yaml\"): []byte(`messages:\n    - a.v1.Foo\n`),\n\t},\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"types\", \"buf.gen.yaml\"),\n\t\t\"--exclude-type\",\n\t\t\"b.v1.Baz\",\n\t)\n}\n\nfunc TestOutputFlag(t *testing.T) {\n\tt.Parallel()\n\tfor _, paths := range []struct {\n\t\ttemplate string\n\t\tdir      string\n\t}{\n\t\t// v1 buf.gen.yaml, v1 module\n\t\t{filepath.Join(\"testdata\", \"simple\", \"buf.gen.yaml\"), filepath.Join(\"testdata\", \"simple\")},\n\t\t// v1 buf.gen.yaml, v2 module\n\t\t{filepath.Join(\"testdata\", \"simple\", \"buf.gen.yaml\"), filepath.Join(\"testdata\", \"v2\", \"simple\")},\n\t\t// v2 buf.gen.yaml, v1 module\n\t\t{filepath.Join(\"testdata\", \"v2\", \"simple\", \"buf.gen.yaml\"), filepath.Join(\"testdata\", \"simple\")},\n\t\t// v2 buf.gen.yaml, v2 module\n\t\t{filepath.Join(\"testdata\", \"v2\", \"simple\", \"buf.gen.yaml\"), filepath.Join(\"testdata\", \"v2\", \"simple\")},\n\t} {\n\t\ttempDirPath := t.TempDir()\n\t\ttestRunSuccess(\n\t\t\tt,\n\t\t\t\"--output\",\n\t\t\ttempDirPath,\n\t\t\t\"--template\",\n\t\t\tpaths.template,\n\t\t\tpaths.dir,\n\t\t)\n\t\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\t\trequire.NoError(t, err)\n\t}\n}\n\nfunc TestProtoFileRefIncludePackageFiles(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"buf.gen.yaml\"),\n\t\tfmt.Sprintf(\"%s#include_package_files=true\", filepath.Join(\"testdata\", \"protofileref\", \"a\", \"v1\", \"a.proto\")),\n\t)\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"B.java\"))\n\trequire.NoError(t, err)\n}\n\nfunc TestGenerateDuplicatePlugins(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"duplicate_plugins\", \"buf.gen.yaml\"),\n\t\tfilepath.Join(\"testdata\", \"duplicate_plugins\"),\n\t)\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"foo\", \"a\", \"v1\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"bar\", \"a\", \"v1\", \"A.java\"))\n\trequire.NoError(t, err)\n}\n\nfunc TestGenerateDuplicatePluginsV2(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"v2\", \"duplicate_plugins\", \"buf.gen.yaml\"),\n\t\tfilepath.Join(\"testdata\", \"v2\", \"duplicate_plugins\"),\n\t)\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"foo\", \"a\", \"v1\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"bar\", \"a\", \"v1\", \"A.java\"))\n\trequire.NoError(t, err)\n}\n\nfunc TestOutputWithPathEqualToExclude(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\tfilepath.FromSlash(`Failure: cannot set the same path for both --path and --exclude-path: \"testdata/paths/a/v1/a.proto\"`),\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\", \"a.proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\", \"a.proto\"),\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t)\n}\n\nfunc TestGenerateInsertionPoint(t *testing.T) {\n\tt.Parallel()\n\ttestGenerateInsertionPointV1(t, \".\", \".\", filepath.Join(\"testdata\", \"insertion_point\"))\n\ttestGenerateInsertionPointV1(t, \"gen/proto/insertion\", \"gen/proto/insertion\", filepath.Join(\"testdata\", \"nested_insertion_point\"))\n\ttestGenerateInsertionPointV1(t, \"gen/proto/insertion/\", \"./gen/proto/insertion\", filepath.Join(\"testdata\", \"nested_insertion_point\"))\n\ttestGenerateInsertionPointV2(t, \".\", \".\", filepath.Join(\"testdata\", \"insertion_point\"))\n\ttestGenerateInsertionPointV2(t, \"gen/proto/insertion\", \"gen/proto/insertion\", filepath.Join(\"testdata\", \"nested_insertion_point\"))\n\ttestGenerateInsertionPointV2(t, \"gen/proto/insertion/\", \"./gen/proto/insertion\", filepath.Join(\"testdata\", \"nested_insertion_point\"))\n}\n\nfunc TestGenerateInsertionPointFail(t *testing.T) {\n\tt.Parallel()\n\tsuccessTemplate := `\nversion: v1\nplugins:\n  - name: insertion-point-receiver\n    out: gen/proto/insertion\n  - name: insertion-point-writer\n    out: .\n`\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: plugin insertion-point-writer: read test.txt: file does not exist`,\n\t\tfilepath.Join(\"testdata\", \"simple\"), // The input directory is irrelevant for these insertion points.\n\t\t\"--template\",\n\t\tsuccessTemplate,\n\t\t\"-o\",\n\t\tt.TempDir(),\n\t)\n}\n\nfunc TestGenerateInsertionPointFailV2(t *testing.T) {\n\tt.Parallel()\n\tsuccessTemplate := `\nversion: v2\nplugins:\n  - protoc_builtin: insertion-point-receiver\n    out: gen/proto/insertion\n  - protoc_builtin: insertion-point-writer\n    out: .\nmanaged:\n enabled: false\n`\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: plugin insertion-point-writer: read test.txt: file does not exist`,\n\t\tfilepath.Join(\"testdata\", \"v2\", \"simple\"), // The input directory is irrelevant for these insertion points.\n\t\t\"--template\",\n\t\tsuccessTemplate,\n\t\t\"-o\",\n\t\tt.TempDir(),\n\t)\n}\n\nfunc TestGenerateDuplicateFileFail(t *testing.T) {\n\tt.Parallel()\n\tsuccessTemplate := `\nversion: v1\nplugins:\n  - name: insertion-point-receiver\n    out: .\n  - name: insertion-point-receiver\n    out: .\n`\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: file \"test.txt\" was generated multiple times: once by plugin \"insertion-point-receiver\" and again by plugin \"insertion-point-receiver\"`,\n\t\tfilepath.Join(\"testdata\", \"simple\"), // The input directory is irrelevant for these insertion points.\n\t\t\"--template\",\n\t\tsuccessTemplate,\n\t\t\"-o\",\n\t\tt.TempDir(),\n\t)\n}\n\nfunc TestGenerateDuplicateFileFailV2(t *testing.T) {\n\tt.Parallel()\n\tsuccessTemplate := `\nversion: v2\nplugins:\n  - protoc_builtin: insertion-point-receiver\n    out: .\n  - protoc_builtin: insertion-point-receiver\n    out: .\nmanaged:\n  enabled: false\n`\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: file \"test.txt\" was generated multiple times: once by plugin \"insertion-point-receiver\" and again by plugin \"insertion-point-receiver\"`,\n\t\tfilepath.Join(\"testdata\", \"v2\", \"simple\"), // The input directory is irrelevant for these insertion points.\n\t\t\"--template\",\n\t\tsuccessTemplate,\n\t\t\"-o\",\n\t\tt.TempDir(),\n\t)\n}\n\nfunc TestGenerateInsertionPointMixedPathsFail(t *testing.T) {\n\tt.Parallel()\n\twd, err := os.Getwd()\n\trequire.NoError(t, err)\n\ttestGenerateInsertionPointMixedPathsFailV1(t, \".\", wd)\n\ttestGenerateInsertionPointMixedPathsFailV1(t, wd, \".\")\n\ttestGenerateInsertionPointMixedPathsFailV2(t, \".\", wd)\n\ttestGenerateInsertionPointMixedPathsFailV2(t, wd, \".\")\n}\n\nfunc TestGenerateDeleteOutDir(t *testing.T) {\n\tt.Parallel()\n\ttestGenerateDeleteOuts(t, \"\", \"foo\")\n\ttestGenerateDeleteOuts(t, \"base\", \"foo\")\n\ttestGenerateDeleteOuts(t, \"\", \"foo\", \"bar\")\n\ttestGenerateDeleteOuts(t, \"\", \"foo\", \"bar\", \"foo\")\n\ttestGenerateDeleteOuts(t, \"base\", \"foo\", \"bar\")\n\ttestGenerateDeleteOuts(t, \"base\", \"foo\", \"bar\", \"foo\")\n\ttestGenerateDeleteOuts(t, \"\", \"foo.jar\")\n\ttestGenerateDeleteOuts(t, \"\", \"foo.zip\")\n\ttestGenerateDeleteOuts(t, \"\", \"foo/bar.jar\")\n\ttestGenerateDeleteOuts(t, \"\", \"foo/bar.zip\")\n\ttestGenerateDeleteOuts(t, \"base\", \"foo.jar\")\n\ttestGenerateDeleteOuts(t, \"base\", \"foo.zip\")\n\ttestGenerateDeleteOuts(t, \"base\", \"foo/bar.jar\")\n\ttestGenerateDeleteOuts(t, \"base\", \"foo/bar.zip\")\n}\n\nfunc TestBoolPointerFlagTrue(t *testing.T) {\n\tt.Parallel()\n\texpected := true\n\ttestParseBoolPointer(t, \"test-name\", &expected, \"--test-name\")\n}\n\nfunc TestBoolPointerFlagTrueSpecified(t *testing.T) {\n\tt.Parallel()\n\texpected := true\n\ttestParseBoolPointer(t, \"test-name\", &expected, \"--test-name=true\")\n}\n\nfunc TestBoolPointerFlagFalseSpecified(t *testing.T) {\n\tt.Parallel()\n\texpected := false\n\ttestParseBoolPointer(t, \"test-name\", &expected, \"--test-name=false\")\n}\n\nfunc TestBoolPointerFlagUnspecified(t *testing.T) {\n\tt.Parallel()\n\ttestParseBoolPointer(t, \"test-name\", nil)\n}\n\nfunc testGenerateInsertionPointV1(\n\tt *testing.T,\n\treceiverOut string,\n\twriterOut string,\n\texpectedOutputPath string,\n) {\n\ttestGenerateInsertionPoint(\n\t\tt,\n\t\treceiverOut,\n\t\twriterOut,\n\t\texpectedOutputPath,\n\t\t`\nversion: v1\nplugins:\n  - name: insertion-point-receiver\n    out: %s\n  - name: insertion-point-writer\n    out: %s\n`,\n\t)\n}\n\nfunc testGenerateInsertionPointV2(\n\tt *testing.T,\n\treceiverOut string,\n\twriterOut string,\n\texpectedOutputPath string,\n) {\n\ttestGenerateInsertionPoint(\n\t\tt,\n\t\treceiverOut,\n\t\twriterOut,\n\t\texpectedOutputPath,\n\t\t`\nversion: v2\nplugins:\n  - protoc_builtin: insertion-point-receiver\n    out: %s\n  - protoc_builtin: insertion-point-writer\n    out: %s\n`,\n\t)\n}\n\nfunc testGenerateInsertionPoint(\n\tt *testing.T,\n\treceiverOut string,\n\twriterOut string,\n\texpectedOutputPath string,\n\tsuccessTemplate string,\n) {\n\tstorageosProvider := storageos.NewProvider()\n\ttempDir, readWriteBucket := internaltesting.CopyReadBucketToTempDir(\n\t\tt.Context(),\n\t\tt,\n\t\tstorageosProvider,\n\t\tstoragemem.NewReadWriteBucket(),\n\t)\n\ttestRunSuccess(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"simple\"), // The input directory is irrelevant for these insertion points.\n\t\t\"--template\",\n\t\tfmt.Sprintf(successTemplate, receiverOut, writerOut),\n\t\t\"-o\",\n\t\ttempDir,\n\t)\n\texpectedOutput, err := storageosProvider.NewReadWriteBucket(expectedOutputPath)\n\trequire.NoError(t, err)\n\tdiff, err := storage.DiffBytes(t.Context(), expectedOutput, readWriteBucket)\n\trequire.NoError(t, err)\n\trequire.Empty(t, string(diff))\n}\n\nfunc testGenerateInsertionPointMixedPathsFailV1(\n\tt *testing.T,\n\treceiverOut string,\n\twriterOut string,\n) {\n\ttestGenerateInsertionPointMixedPathsFail(\n\t\tt,\n\t\treceiverOut,\n\t\twriterOut,\n\t\t`\nversion: v1\nplugins:\n  - name: insertion-point-receiver\n    out: %s\n  - name: insertion-point-writer\n    out: %s\n`,\n\t)\n}\n\nfunc testGenerateInsertionPointMixedPathsFailV2(\n\tt *testing.T,\n\treceiverOut string,\n\twriterOut string,\n) {\n\ttestGenerateInsertionPointMixedPathsFail(\n\t\tt,\n\t\treceiverOut,\n\t\twriterOut,\n\t\t`\nversion: v2\nplugins:\n  - protoc_builtin: insertion-point-receiver\n    out: %s\n  - protoc_builtin: insertion-point-writer\n    out: %s\n`,\n\t)\n}\n\n// testGenerateInsertionPointMixedPathsFail demonstrates that insertion points are only\n// able to generate to the same output directory, even if the absolute path points to the\n// same place. This is equivalent to protoc's behavior.\nfunc testGenerateInsertionPointMixedPathsFail(\n\tt *testing.T,\n\treceiverOut string,\n\twriterOut string,\n\tsuccessTemplate string,\n) {\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: plugin insertion-point-writer: read test.txt: file does not exist`,\n\t\tfilepath.Join(\"testdata\", \"simple\"), // The input directory is irrelevant for these insertion points.\n\t\t\"--template\",\n\t\tfmt.Sprintf(successTemplate, receiverOut, writerOut),\n\t\t\"-o\",\n\t\tt.TempDir(),\n\t)\n}\n\nfunc testCompareGeneratedStubs(\n\tt *testing.T,\n\tdirPath string,\n\ttestPluginInfos []*testPluginInfo,\n) {\n\tfilePaths := buftesting.GetProtocFilePaths(t, dirPath, 100)\n\tactualProtocDir := t.TempDir()\n\tbufGenDir := t.TempDir()\n\tvar actualProtocPluginFlags []string\n\tfor _, testPluginInfo := range testPluginInfos {\n\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_out=%s\", testPluginInfo.name, actualProtocDir))\n\t\tif testPluginInfo.opt != \"\" {\n\t\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_opt=%s\", testPluginInfo.name, testPluginInfo.opt))\n\t\t}\n\t}\n\tbuftesting.RunActualProtoc(\n\t\tt,\n\t\tfalse,\n\t\tfalse,\n\t\tdirPath,\n\t\tfilePaths,\n\t\tmap[string]string{\n\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t},\n\t\tnil,\n\t\tactualProtocPluginFlags...,\n\t)\n\tgenFlags := []string{\n\t\tdirPath,\n\t\t\"--template\",\n\t\tnewExternalConfigV1String(t, testPluginInfos, bufGenDir),\n\t}\n\tfor _, filePath := range filePaths {\n\t\tgenFlags = append(\n\t\t\tgenFlags,\n\t\t\t\"--path\",\n\t\t\tfilePath,\n\t\t)\n\t}\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithArgs(genFlags...),\n\t)\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\tactualReadWriteBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tactualProtocDir,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\tbufReadWriteBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tbufGenDir,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\tdiff, err := storage.DiffBytes(\n\t\tt.Context(),\n\t\tactualReadWriteBucket,\n\t\tbufReadWriteBucket,\n\t\ttransformGolangProtocVersionToUnknown(t),\n\t)\n\trequire.NoError(t, err)\n\tassert.Empty(t, string(diff))\n}\n\nfunc testCompareGeneratedStubsArchive(\n\tt *testing.T,\n\tdirPath string,\n\ttestPluginInfos []*testPluginInfo,\n\tuseJar bool,\n) {\n\tfileExt := \".zip\"\n\tif useJar {\n\t\tfileExt = \".jar\"\n\t}\n\tfilePaths := buftesting.GetProtocFilePaths(t, dirPath, 100)\n\ttempDir := t.TempDir()\n\tactualProtocFile := filepath.Join(tempDir, \"actual-protoc\"+fileExt)\n\tbufGenFile := filepath.Join(tempDir, \"buf-generate\"+fileExt)\n\tvar actualProtocPluginFlags []string\n\tfor _, testPluginInfo := range testPluginInfos {\n\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_out=%s\", testPluginInfo.name, actualProtocFile))\n\t\tif testPluginInfo.opt != \"\" {\n\t\t\tactualProtocPluginFlags = append(actualProtocPluginFlags, fmt.Sprintf(\"--%s_opt=%s\", testPluginInfo.name, testPluginInfo.opt))\n\t\t}\n\t}\n\tbuftesting.RunActualProtoc(\n\t\tt,\n\t\tfalse,\n\t\tfalse,\n\t\tdirPath,\n\t\tfilePaths,\n\t\tmap[string]string{\n\t\t\t\"PATH\": os.Getenv(\"PATH\"),\n\t\t},\n\t\tnil,\n\t\tactualProtocPluginFlags...,\n\t)\n\tgenFlags := []string{\n\t\tdirPath,\n\t\t\"--template\",\n\t\tnewExternalConfigV1String(t, testPluginInfos, bufGenFile),\n\t}\n\tfor _, filePath := range filePaths {\n\t\tgenFlags = append(\n\t\t\tgenFlags,\n\t\t\t\"--path\",\n\t\t\tfilePath,\n\t\t)\n\t}\n\ttestRunSuccess(\n\t\tt,\n\t\tgenFlags...,\n\t)\n\tactualData, err := os.ReadFile(actualProtocFile)\n\trequire.NoError(t, err)\n\tactualReadWriteBucket := storagemem.NewReadWriteBucket()\n\terr = storagearchive.Unzip(\n\t\tt.Context(),\n\t\tbytes.NewReader(actualData),\n\t\tint64(len(actualData)),\n\t\tactualReadWriteBucket,\n\t)\n\trequire.NoError(t, err)\n\tbufData, err := os.ReadFile(bufGenFile)\n\trequire.NoError(t, err)\n\tbufReadWriteBucket := storagemem.NewReadWriteBucket()\n\terr = storagearchive.Unzip(\n\t\tt.Context(),\n\t\tbytes.NewReader(bufData),\n\t\tint64(len(bufData)),\n\t\tbufReadWriteBucket,\n\t)\n\trequire.NoError(t, err)\n\tdiff, err := storage.DiffBytes(\n\t\tt.Context(),\n\t\tactualReadWriteBucket,\n\t\tbufReadWriteBucket,\n\t\ttransformGolangProtocVersionToUnknown(t),\n\t)\n\trequire.NoError(t, err)\n\tassert.Empty(t, string(diff))\n}\n\nfunc testRunSuccess(t *testing.T, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(name),\n\t\t\t)\n\t\t},\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n\nfunc testGenerateDeleteOuts(\n\tt *testing.T,\n\tbaseOutDirPath string,\n\toutputPaths ...string,\n) {\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, nil, true, true, outputPaths)\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, nil, false, false, outputPaths)\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, []string{\"--clean\"}, false, true, outputPaths)\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, []string{\"--clean\"}, true, true, outputPaths)\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, []string{\"--clean=true\"}, true, true, outputPaths)\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, []string{\"--clean=true\"}, false, true, outputPaths)\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, []string{\"--clean=false\"}, true, false, outputPaths)\n\ttestGenerateDeleteOutsWithArgAndConfig(t, baseOutDirPath, []string{\"--clean=false\"}, false, false, outputPaths)\n}\n\nfunc testGenerateDeleteOutsWithArgAndConfig(\n\tt *testing.T,\n\tbaseOutDirPath string,\n\tcleanArgs []string,\n\tcleanOptionInConfig bool,\n\texpectedClean bool,\n\toutputPaths []string,\n) {\n\t// Just add more builtins to the plugins slice below if this goes off\n\trequire.True(t, len(outputPaths) < 4, \"we want to have unique plugins to work with and this test is only set up for three plugins max right now\")\n\tfullOutputPaths := outputPaths\n\tif baseOutDirPath != \"\" && baseOutDirPath != \".\" {\n\t\tfullOutputPaths = xslices.Map(\n\t\t\toutputPaths,\n\t\t\tfunc(outputPath string) string {\n\t\t\t\treturn normalpath.Join(baseOutDirPath, outputPath)\n\t\t\t},\n\t\t)\n\t}\n\tctx := t.Context()\n\ttmpDirPath := t.TempDir()\n\tstorageBucket, err := storageos.NewProvider().NewReadWriteBucket(tmpDirPath)\n\trequire.NoError(t, err)\n\tfor _, fullOutputPath := range fullOutputPaths {\n\t\tswitch normalpath.Ext(fullOutputPath) {\n\t\tcase \".jar\", \".zip\":\n\t\t\t// Write a one-byte file to the location. We'll compare the size below as a simple test.\n\t\t\trequire.NoError(\n\t\t\t\tt,\n\t\t\t\tstorage.PutPath(\n\t\t\t\t\tctx,\n\t\t\t\t\tstorageBucket,\n\t\t\t\t\tfullOutputPath,\n\t\t\t\t\t[]byte(`1`),\n\t\t\t\t),\n\t\t\t)\n\t\tdefault:\n\t\t\t// Write a file that won't be generated to the location.\n\t\t\trequire.NoError(\n\t\t\t\tt,\n\t\t\t\tstorage.PutPath(\n\t\t\t\t\tctx,\n\t\t\t\t\tstorageBucket,\n\t\t\t\t\tnormalpath.Join(fullOutputPath, \"foo.txt\"),\n\t\t\t\t\t[]byte(`1`),\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\tvar templateBuilder strings.Builder\n\t_, _ = templateBuilder.WriteString(`version: v2\nplugins:\n`)\n\n\tplugins := []string{\"java\", \"cpp\", \"ruby\"}\n\tfor i, outputPath := range outputPaths {\n\t\t_, _ = templateBuilder.WriteString(`  - protoc_builtin: `)\n\t\t_, _ = templateBuilder.WriteString(plugins[i])\n\t\t_, _ = templateBuilder.WriteString(\"\\n\")\n\t\t_, _ = templateBuilder.WriteString(`    out: `)\n\t\t_, _ = templateBuilder.WriteString(outputPath)\n\t\t_, _ = templateBuilder.WriteString(\"\\n\")\n\t}\n\tif cleanOptionInConfig {\n\t\ttemplateBuilder.WriteString(\"clean: true\\n\")\n\t}\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t``,\n\t\tappend(\n\t\t\t[]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"simple\"),\n\t\t\t\t\"--template\",\n\t\t\t\ttemplateBuilder.String(),\n\t\t\t\t\"-o\",\n\t\t\t\tfilepath.Join(tmpDirPath, normalpath.Unnormalize(baseOutDirPath)),\n\t\t\t},\n\t\t\tcleanArgs...,\n\t\t)...,\n\t)\n\tfor _, fullOutputPath := range fullOutputPaths {\n\t\tswitch normalpath.Ext(fullOutputPath) {\n\t\tcase \".jar\", \".zip\":\n\t\t\tdata, err := storage.ReadPath(\n\t\t\t\tctx,\n\t\t\t\tstorageBucket,\n\t\t\t\tfullOutputPath,\n\t\t\t)\n\t\t\trequire.NoError(t, err)\n\t\t\t// Always expect non-fake data, because the existing \".jar\" or \".zip\"\n\t\t\t// file is always replaced by the output. This is the existing and correct\n\t\t\t// behavior.\n\t\t\trequire.True(t, len(data) > 1, \"expected non-fake data at %q\", fullOutputPath)\n\t\tdefault:\n\t\t\tdata, err := storage.ReadPath(\n\t\t\t\tctx,\n\t\t\t\tstorageBucket,\n\t\t\t\tnormalpath.Join(fullOutputPath, \"foo.txt\"),\n\t\t\t)\n\t\t\tif expectedClean {\n\t\t\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t\t\t} else {\n\t\t\t\trequire.NoError(t, err, \"expected foo.txt at %q\", fullOutputPath)\n\t\t\t\trequire.NotNil(t, data, \"expected foo.txt at %q\", fullOutputPath)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc testRunStdoutStderr(t *testing.T, stdin io.Reader, expectedExitCode int, expectedStdout string, expectedStderr string, args ...string) {\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(name string) *appcmd.Command {\n\t\t\treturn NewCommand(\n\t\t\t\tname,\n\t\t\t\tappext.NewBuilder(\n\t\t\t\t\tname,\n\t\t\t\t\tappext.BuilderWithInterceptor(\n\t\t\t\t\t\t// TODO FUTURE: use the real interceptor. Currently in buf.go, NewBuilder receives appflag.BuilderWithInterceptor(newErrorInterceptor()).\n\t\t\t\t\t\t// However we cannot depend on newErrorInterceptor because it would create an import cycle, not to mention it needs to be exported first.\n\t\t\t\t\t\t// This can depend on newErrorInterceptor when it's moved to a separate package and made public.\n\t\t\t\t\t\tfunc(next func(context.Context, appext.Container) error) func(context.Context, appext.Container) error {\n\t\t\t\t\t\t\treturn func(ctx context.Context, container appext.Container) error {\n\t\t\t\t\t\t\t\terr := next(ctx, container)\n\t\t\t\t\t\t\t\tif err == nil {\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\treturn fmt.Errorf(\"Failure: %w\", err)\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\tappcmdtesting.WithExpectedExitCode(expectedExitCode),\n\t\tappcmdtesting.WithExpectedStdout(expectedStdout),\n\t\tappcmdtesting.WithExpectedStderr(expectedStderr),\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdin(stdin),\n\t\tappcmdtesting.WithArgs(args...),\n\t)\n}\n\nfunc testParseBoolPointer(t *testing.T, flagName string, expectedResult *bool, args ...string) {\n\tvar boolPointer *bool\n\tflagSet := pflag.NewFlagSet(\"test flag set\", pflag.ContinueOnError)\n\tbindBoolPointer(flagSet, flagName, &boolPointer, \"test usage\")\n\terr := flagSet.Parse(args)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expectedResult, boolPointer)\n}\n\nfunc newExternalConfigV1String(t *testing.T, plugins []*testPluginInfo, out string) string {\n\texternalConfig := make(map[string]any)\n\texternalConfig[\"version\"] = \"v1\"\n\tpluginConfigs := []map[string]string{}\n\tfor _, plugin := range plugins {\n\t\tpluginConfigs = append(\n\t\t\tpluginConfigs,\n\t\t\tmap[string]string{\n\t\t\t\t\"name\": plugin.name,\n\t\t\t\t\"opt\":  plugin.opt,\n\t\t\t\t\"out\":  out,\n\t\t\t},\n\t\t)\n\t}\n\texternalConfig[\"plugins\"] = pluginConfigs\n\tdata, err := json.Marshal(externalConfig)\n\trequire.NoError(t, err)\n\treturn string(data)\n}\n\ntype testPluginInfo struct {\n\tname string\n\topt  string\n}\n\nfunc transformGolangProtocVersionToUnknown(t *testing.T) storage.DiffOption {\n\treturn storage.DiffWithTransform(func(_, _ string, content []byte) []byte {\n\t\tlines := bytes.Split(content, []byte(\"\\n\"))\n\t\tfilteredLines := make([][]byte, 0, len(lines))\n\t\tcommentPrefix := []byte(\"//\")\n\t\tprotocVersionIndicator := []byte(\"protoc\")\n\t\tfor _, line := range lines {\n\t\t\tif !(bytes.HasPrefix(line, commentPrefix) && bytes.Contains(line, protocVersionIndicator)) {\n\t\t\t\tfilteredLines = append(filteredLines, line)\n\t\t\t}\n\t\t}\n\t\treturn bytes.Join(filteredLines, []byte(\"\\n\"))\n\t})\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/generate_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage generate\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestProtoFileRef(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"buf.gen.yaml\"),\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"a\", \"v1\", \"a.proto\"),\n\t)\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"B.java\"))\n\trequire.Contains(t, err.Error(), \"no such file or directory\")\n}\n\nfunc TestOutputWithExclude(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t)\n\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v2\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"b\", \"v1\", \"B.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"no such file or directory\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v3\", \"A.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"no such file or directory\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v3\", \"foo\", \"Foo.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"no such file or directory\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v3\", \"bar\", \"Bar.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"no such file or directory\")\n}\n\nfunc TestOutputWithPathWithinExclude(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\",\n\t\tfilepath.FromSlash(`Failure: excluded path \"testdata/paths/a\" contains targeted path \"testdata/paths/a/v1/a.proto\", which means all paths in \"testdata/paths/a/v1/a.proto\" will be excluded`),\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\", \"a.proto\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\"),\n\t)\n}\n\nfunc TestOutputWithExcludeWithinPath(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\", \"a.proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\"),\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t)\n\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v2\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"b\", \"v1\", \"B.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"no such file or directory\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"no such file or directory\")\n}\n\nfunc TestOutputWithNestedExcludeAndTargetPaths(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\",\n\t\tfilepath.FromSlash(`Failure: excluded path \"testdata/paths/a/v3\" contains targeted path \"testdata/paths/a/v3/foo\", which means all paths in \"testdata/paths/a/v3/foo\" will be excluded`),\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\", \"bar.proto\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t)\n}\n\nfunc TestWorkspaceGenerateWithExcludeAndTargetPaths(t *testing.T) {\n\tt.Parallel()\n\ttempDirPath := t.TempDir()\n\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t\"\",\n\t\tfilepath.FromSlash(`Failure: excluded path \"a/v3\" contains targeted path \"a/v3/foo\", which means all paths in \"a/v3/foo\" will be excluded`),\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"a\", \"v3\", \"foo\", \"bar.proto\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"a\", \"v3\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"a\", \"v3\", \"foo\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"b\", \"v1\", \"foo.proto\"),\n\t\tfilepath.Join(\"testdata\", \"workspace\"),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/generate_windows_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 generate\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestProtoFileRef(t *testing.T) {\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"buf.gen.yaml\"),\n\t\tfilepath.Join(\"testdata\", \"protofileref\", \"a\", \"v1\", \"a.proto\"),\n\t)\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"B.java\"))\n\trequire.Contains(t, err.Error(), \"The system cannot find the file specified.\")\n}\n\nfunc TestOutputWithExclude(t *testing.T) {\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t)\n\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v2\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"b\", \"v1\", \"B.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"The system cannot find the path specified.\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v3\", \"A.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"The system cannot find the path specified.\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v3\", \"foo\", \"Foo.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"The system cannot find the path specified.\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v3\", \"bar\", \"Bar.java\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"The system cannot find the path specified.\")\n}\n\nfunc TestOutputWithPathWithinExclude(t *testing.T) {\n\ttempDirPath := t.TempDir()\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\t\t`Failure: excluded path \"testdata\\paths\\a\" contains targeted path \"testdata\\paths\\a\\v1\\a.proto\", which means all paths in \"testdata\\paths\\a\\v1\\a.proto\" will be excluded`,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\", \"a.proto\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\"),\n\t)\n}\n\nfunc TestOutputWithExcludeWithinPath(t *testing.T) {\n\ttempDirPath := t.TempDir()\n\ttestRunSuccess(\n\t\tt,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v1\", \"a.proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\"),\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t)\n\n\t_, err := os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v2\", \"A.java\"))\n\trequire.NoError(t, err)\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"b\", \"v1\", \"B.java\"))\n\trequire.Contains(t, err.Error(), \"The system cannot find the path specified.\")\n\t_, err = os.Stat(filepath.Join(tempDirPath, \"java\", \"a\", \"v1\", \"A.java\"))\n\trequire.Contains(t, err.Error(), \"The system cannot find the path specified.\")\n}\n\nfunc TestOutputWithNestedExcludeAndTargetPaths(t *testing.T) {\n\ttempDirPath := t.TempDir()\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\t\t`Failure: excluded path \"testdata\\paths\\a\\v3\" contains targeted path \"testdata\\paths\\a\\v3\\foo\", which means all paths in \"testdata\\paths\\a\\v3\\foo\" will be excluded`,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\", \"bar.proto\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"paths\", \"a\", \"v3\", \"foo\"),\n\t\tfilepath.Join(\"testdata\", \"paths\"),\n\t)\n}\n\nfunc TestWorkspaceGenerateWithExcludeAndTargetPaths(t *testing.T) {\n\ttempDirPath := t.TempDir()\n\ttestRunStdoutStderr(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\t\t`Failure: excluded path \"testdata\\workspace\\a\\v3\" contains targeted path \"testdata\\workspace\\a\\v3\\foo\", which means all paths in \"testdata\\workspace\\a\\v3\\foo\" will be excluded`,\n\t\t\"--output\",\n\t\ttempDirPath,\n\t\t\"--template\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"buf.gen.yaml\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"a\", \"v3\", \"foo\", \"bar.proto\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"a\", \"v3\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"a\", \"v3\", \"foo\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"b\", \"v1\", \"foo.proto\"),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/internal/protoc-gen-top-level-type-names-yaml/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/protoplugin\"\n\t\"gopkg.in/yaml.v3\"\n)\n\nconst fileExt = \".top-level-type-names.yaml\"\n\nfunc main() {\n\tprotoplugin.Main(protoplugin.HandlerFunc(handle))\n}\n\nfunc handle(\n\t_ context.Context,\n\t_ protoplugin.PluginEnv,\n\tresponseWriter protoplugin.ResponseWriter,\n\trequest protoplugin.Request,\n) error {\n\tfileDescriptors, err := request.FileDescriptorsToGenerate()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, fileDescriptor := range fileDescriptors {\n\t\texternalFile := &externalFile{}\n\t\tenumDescriptors := fileDescriptor.Enums()\n\t\tfor i := range enumDescriptors.Len() {\n\t\t\texternalFile.Enums = append(externalFile.Enums, string(enumDescriptors.Get(i).FullName()))\n\t\t}\n\t\tmessageDescriptors := fileDescriptor.Messages()\n\t\tfor i := range messageDescriptors.Len() {\n\t\t\texternalFile.Messages = append(externalFile.Messages, string(messageDescriptors.Get(i).FullName()))\n\t\t}\n\t\tserviceDescriptors := fileDescriptor.Services()\n\t\tfor i := range serviceDescriptors.Len() {\n\t\t\texternalFile.Services = append(externalFile.Services, string(serviceDescriptors.Get(i).FullName()))\n\t\t}\n\t\tsort.Strings(externalFile.Enums)\n\t\tsort.Strings(externalFile.Messages)\n\t\tsort.Strings(externalFile.Services)\n\t\tdata, err := yaml.Marshal(externalFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tresponseWriter.AddFile(\n\t\t\tstrings.TrimSuffix(fileDescriptor.Path(), filepath.Ext(filepath.FromSlash(fileDescriptor.Path())))+fileExt,\n\t\t\tstring(data),\n\t\t)\n\t}\n\treturn nil\n}\n\ntype externalFile struct {\n\tEnums    []string `json:\"enums,omitempty\" yaml:\"enums,omitempty\"`\n\tMessages []string `json:\"messages,omitempty\" yaml:\"messages,omitempty\"`\n\tServices []string `json:\"services,omitempty\" yaml:\"services,omitempty\"`\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/duplicate_plugins/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/duplicate_plugins/buf.gen.yaml",
    "content": "# The same plugin can be executed more than once, as long as they are written\n# to different output directories.\nversion: v1\nplugins:\n  - name: java\n    out: foo\n  - name: java\n    out: bar\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/insertion/test.proto",
    "content": "syntax = \"proto3\";\n\npackage test;\n\nmessage Test {\n    string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/insertion_point/test.txt",
    "content": "\n\t\t// The following line represents an insertion point named 'example'.\n\t\t// We include a few indentation to verify the whitespace is preserved\n\t\t// in the inserted content.\n\t\t//\n\t\t\n\t\t\t\t\t// Include this comment on the 'example' insertion point.\n\t\t\t\t\t  // This is another example where whitespaces are preserved.\n\t\t\t\t\t  // And this demonstrates a newline literal (\\n).\n\t\t\t\t\t// And don't forget the windows newline literal (\\r\\n).\n\t\t\t\t\n\t\t//     @@protoc_insertion_point(example)\n\t\t//\n\t\t// The 'other' insertion point is also included so that we verify\n\t\t// multiple insertion points can be written in a single invocation.\n\t\t//\n\t\t\n\t\t\t\t\t// Include this comment on the 'other' insertion point.\n\t\t\t\t\n\t\t//   @@protoc_insertion_point(other)\n\t\t//\n\t\t// Note that all text should be added above the insertion points.\n\t\t"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/nested_insertion_point/gen/proto/insertion/test.txt",
    "content": "\n\t\t// The following line represents an insertion point named 'example'.\n\t\t// We include a few indentation to verify the whitespace is preserved\n\t\t// in the inserted content.\n\t\t//\n\t\t\n\t\t\t\t\t// Include this comment on the 'example' insertion point.\n\t\t\t\t\t  // This is another example where whitespaces are preserved.\n\t\t\t\t\t  // And this demonstrates a newline literal (\\n).\n\t\t\t\t\t// And don't forget the windows newline literal (\\r\\n).\n\t\t\t\t\n\t\t//     @@protoc_insertion_point(example)\n\t\t//\n\t\t// The 'other' insertion point is also included so that we verify\n\t\t// multiple insertion points can be written in a single invocation.\n\t\t//\n\t\t\n\t\t\t\t\t// Include this comment on the 'other' insertion point.\n\t\t\t\t\n\t\t//   @@protoc_insertion_point(other)\n\t\t//\n\t\t// Note that all text should be added above the insertion points.\n\t\t"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/a/v2/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v2;\n\nmessage Foo {\n  string key = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/a/v3/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3;\n\nmessage Foo {\n  string key = 1;\n  string value = 2;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/a/v3/foo/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3.foo;\n\nmessage Bar {\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/a/v3/foo/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3.foo;\n\nmessage Foo {\n  string id = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/b/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/buf.gen.yaml",
    "content": "version: v1\nplugins:\n  - name: java\n    out: java\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/paths/buf.yaml",
    "content": "version: v1\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/protofileref/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/protofileref/a/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/protofileref/buf.gen.yaml",
    "content": "version: v1\nplugins:\n  - name: java\n    out: java\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/protofileref/buf.yaml",
    "content": "version: v1\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/simple/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/simple/buf.gen.yaml",
    "content": "version: v1\nplugins:\n  - name: java\n    out: java\n\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/simple/buf.yaml",
    "content": "version: v1\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/types/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/types/buf.gen.yaml",
    "content": "version: v1\nplugins:\n  - name: java\n    out: java\ntypes:\n  - \"a.v1.Foo\"\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/types/buf.yaml",
    "content": "version: v1\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/duplicate_plugins/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/duplicate_plugins/buf.gen.yaml",
    "content": "# The same plugin can be executed more than once, as long as they are written\n# to different output directories.\nversion: v2\nplugins:\n  - protoc_builtin: java\n    out: foo\n  - protoc_builtin: java\n    out: bar\nmanaged:\n  enabled: false\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/local_plugin/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/local_plugin/b/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nmessage Foo {}\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/local_plugin/buf.basic.gen.yaml",
    "content": "version: v2\nplugins:\n  - local: protoc-gen-top-level-type-names-yaml\n    out: gen\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/local_plugin/buf.exclude.paths.gen.yaml",
    "content": "version: v2\nplugins:\n  - local: protoc-gen-top-level-type-names-yaml\n    out: gen\n    strategy: all\ninputs:\n  - directory: testdata/v2/local_plugin\n    exclude_paths:\n      - testdata/v2/local_plugin/a\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/local_plugin/buf.paths.gen.yaml",
    "content": "version: v2\nplugins:\n  - local: protoc-gen-top-level-type-names-yaml\n    out: gen\n    strategy: all\ninputs:\n  - directory: testdata/v2/local_plugin\n    paths:\n      - testdata/v2/local_plugin/a\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/local_plugin/buf.types.gen.yaml",
    "content": "version: v2\nplugins:\n  - local: protoc-gen-top-level-type-names-yaml\n    out: gen\n    strategy: all\ninputs:\n  - directory: ./testdata/v2/local_plugin\n    types:\n      - a.v1.Foo\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/local_plugin/buf.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/simple/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/simple/buf.gen.yaml",
    "content": "version: v2\nplugins:\n  - protoc_builtin: java\n    out: java\nmanaged:\n  enabled: false\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/simple/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\n    lint:\n      except:\n        - PACKAGE_NO_IMPORT_CYCLE\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/types/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nimport \"b/v1/b.proto\";\nimport \"pkg/v1/options.proto\";\n\nmessage Foo {\n  option (pkg.v1.message_foo).foo = \"str\";\n  message Bar {\n    option (pkg.v1.message_bar).bar = \"str\";\n    string bar = 1;\n  }\n  Bar nested_bar = 1;\n  b.v1.Baz baz = 2;\n}\n\nmessage Empty {}\n\nmessage FooBar {\n  Foo foo = 1;\n  Foo.Bar bar = 2;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/types/b/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nimport \"pkg/v1/options.proto\";\n\nmessage Baz {\n  option (pkg.v1.message_baz) = \"str\";\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/types/buf.gen.invalid.yaml",
    "content": "version: v2\nplugins:\n  - local: protoc-gen-top-level-type-names-yaml\n    out: gen\n    strategy: all\ninputs:\n  - directory: ./testdata/v2/types\n    types:\n      - \"a.v1.Foo.Bar\"\n    exclude_types:\n      - \"a.v1.Foo\"\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/types/buf.gen.yaml",
    "content": "version: v2\nmanaged:\n  enabled: true\n  override:\n    - file_option: java_package_prefix\n      value: net\nplugins:\n  - local: protoc-gen-top-level-type-names-yaml\n    out: gen\n    strategy: all\n    types:\n      - \"a.v1.Foo\"\n    exclude_types:\n      - \"a.v1.Foo.Bar\"\n      - \"pkg.v1.message_foo\"\n      - \"pkg.v1.message_bar\"\ninputs:\n  - directory: ./testdata/v2/types\n    types:\n      - \"a.v1.FooBar\"\n    exclude_types:\n      - \"a.v1.Empty\"\n      - \"pkg.v1.message_baz\"\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/types/buf.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/v2/types/pkg/v1/options.proto",
    "content": "syntax = \"proto3\";\n\npackage pkg.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage OptionFoo {\n  string foo = 1;\n}\n\nmessage OptionBar {\n  string bar = 1;\n}\n\nextend google.protobuf.MessageOptions {\n  optional OptionFoo message_foo = 50000;\n  optional OptionBar message_bar = 50001;\n  optional string message_baz = 50002;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/a/v2/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v2;\n\nmessage Foo {\n  string key = 1;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/a/v3/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3;\n\nmessage Foo {\n  string key = 1;\n  string value = 2;\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/a/v3/foo/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3.foo;\n\nmessage Bar {\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/a/v3/foo/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3.foo;\n\nmessage Foo {\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/b/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/b/v1/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage b.foo;\n\nmessage Foo {\n}\n\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/buf.gen.yaml",
    "content": "version: v1\nplugins:\n  - name: java\n    out: java\n"
  },
  {
    "path": "cmd/buf/internal/command/generate/testdata/workspace/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a\n  - b\n"
  },
  {
    "path": "cmd/buf/internal/command/lint/lint.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 lint\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\terrorFormatFlagName     = \"error-format\"\n\tconfigFlagName          = \"config\"\n\tpathsFlagName           = \"path\"\n\texcludePathsFlagName    = \"exclude-path\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <input>\",\n\t\tShort: \"Run linting on Protobuf files\",\n\t\tLong:  bufcli.GetInputLong(`the source, module, or Image to lint`),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tErrorFormat     string\n\tConfig          string\n\tPaths           []string\n\tExcludePaths    []string\n\tDisableSymlinks bool\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors or check violations printed to stdout. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufcli.AllLintFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tif err := bufcli.ValidateErrorFormatFlagLint(flags.ErrorFormat, errorFormatFlagName); err != nil {\n\t\treturn err\n\t}\n\t// Parse out if this is config-ignore-yaml.\n\t// This is messed.\n\tcontrollerErrorFormat := flags.ErrorFormat\n\tif controllerErrorFormat == \"config-ignore-yaml\" {\n\t\tcontrollerErrorFormat = \"text\"\n\t}\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(controllerErrorFormat),\n\t\tbufctl.WithFileAnnotationsToStdout(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\twasmRuntime, err := bufcli.NewWasmRuntime(ctx, container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, wasmRuntime.Close(ctx))\n\t}()\n\timageWithConfigs, checkClient, err := controller.GetTargetImageWithConfigsAndCheckClient(\n\t\tctx,\n\t\tinput,\n\t\twasmRuntime,\n\t\tbufctl.WithTargetPaths(flags.Paths, flags.ExcludePaths),\n\t\tbufctl.WithConfigOverride(flags.Config),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar allFileAnnotations []bufanalysis.FileAnnotation\n\t// We add all check configs (both lint and breaking) as related configs to check if plugins\n\t// have rules configured.\n\t// We allocated twice the size of imageWithConfigs for both lint and breaking configs.\n\tallCheckConfigs := make([]bufconfig.CheckConfig, 0, len(imageWithConfigs)*2)\n\tfor _, imageWithConfig := range imageWithConfigs {\n\t\tallCheckConfigs = append(allCheckConfigs, imageWithConfig.LintConfig())\n\t\tallCheckConfigs = append(allCheckConfigs, imageWithConfig.BreakingConfig())\n\t}\n\tfor _, imageWithConfig := range imageWithConfigs {\n\t\tlintOptions := []bufcheck.LintOption{\n\t\t\tbufcheck.WithPluginConfigs(imageWithConfig.PluginConfigs()...),\n\t\t\tbufcheck.WithPolicyConfigs(imageWithConfig.PolicyConfigs()...),\n\t\t\tbufcheck.WithRelatedCheckConfigs(allCheckConfigs...),\n\t\t}\n\t\tif err := checkClient.Lint(\n\t\t\tctx,\n\t\t\timageWithConfig.LintConfig(),\n\t\t\timageWithConfig,\n\t\t\tlintOptions...,\n\t\t); err != nil {\n\t\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\t\tif errors.As(err, &fileAnnotationSet) {\n\t\t\t\tallFileAnnotations = append(allFileAnnotations, fileAnnotationSet.FileAnnotations()...)\n\t\t\t} else {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\tif len(allFileAnnotations) > 0 {\n\t\tallFileAnnotationSet := bufanalysis.NewFileAnnotationSet(allFileAnnotations...)\n\t\tif flags.ErrorFormat == \"config-ignore-yaml\" {\n\t\t\tif err := bufcli.PrintFileAnnotationSetLintConfigIgnoreYAMLV1(\n\t\t\t\tcontainer.Stdout(),\n\t\t\t\tallFileAnnotationSet,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif err := bufanalysis.PrintFileAnnotationSet(\n\t\t\t\tcontainer.Stdout(),\n\t\t\t\tallFileAnnotationSet,\n\t\t\t\tflags.ErrorFormat,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn bufctl.ErrFileAnnotation\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/lsfiles/lsfiles.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 lsfiles\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName            = \"format\"\n\tconfigFlagName            = \"config\"\n\terrorFormatFlagName       = \"error-format\"\n\tincludeImportsFlagName    = \"include-imports\"\n\tincludeImportableFlagName = \"include-importable\"\n\tpathsFlagName             = \"path\"\n\texcludePathsFlagName      = \"exclude-path\"\n\tdisableSymlinksFlagName   = \"disable-symlinks\"\n\tasImportPathsFlagName     = \"as-import-paths\"\n\n\tformatText   = \"text\"\n\tformatJSON   = \"json\"\n\tformatImport = \"import\"\n)\n\nvar (\n\tallFormats = []string{formatText, formatJSON, formatImport}\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <input>\",\n\t\tShort: \"List Protobuf files\",\n\t\tLong:  bufcli.GetInputLong(`the source, module, or image to list from`),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat            string\n\tConfig            string\n\tIncludeImports    bool\n\tIncludeImportable bool\n\tPaths             []string\n\tExcludePaths      []string\n\tDisableSymlinks   bool\n\t// Deprecated. This flag no longer has any effect as we don't build images anymore.\n\tErrorFormat string\n\t// Deprecated\n\tAsImportPaths bool\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tformatText,\n\t\tfmt.Sprintf(\n\t\t\t`The format to print the .proto files. Must be one of %s`,\n\t\t\txstrings.SliceToString(allFormats),\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.IncludeImports,\n\t\tincludeImportsFlagName,\n\t\tfalse,\n\t\t\"Include imports\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.IncludeImportable,\n\t\tincludeImportableFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t\"Include all .proto files that are importable by the input. --%s is redundant if this is set\",\n\t\t\tincludeImportsFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\t_ = flagSet.MarkDeprecated(errorFormatFlagName, \"this flag no longer has any effect\")\n\t_ = flagSet.MarkHidden(errorFormatFlagName)\n\tflagSet.BoolVar(\n\t\t&f.AsImportPaths,\n\t\tasImportPathsFlagName,\n\t\tfalse,\n\t\t\"Strip local directory paths and print filepaths as they are imported\",\n\t)\n\t_ = flagSet.MarkDeprecated(asImportPathsFlagName, fmt.Sprintf(\"use --%s=import instead\", formatFlagName))\n\t_ = flagSet.MarkHidden(asImportPathsFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tif flags.AsImportPaths {\n\t\tflags.Format = formatImport\n\t}\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Sorted by Path.\n\timageFileInfos, err := controller.GetImportableImageFileInfos(\n\t\tctx,\n\t\tinput,\n\t\tbufctl.WithTargetPaths(flags.Paths, flags.ExcludePaths),\n\t\tbufctl.WithConfigOverride(flags.Config),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !flags.IncludeImportable {\n\t\tif !flags.IncludeImports {\n\t\t\timageFileInfos = xslices.Filter(\n\t\t\t\timageFileInfos,\n\t\t\t\tfunc(imageFileInfo bufimage.ImageFileInfo) bool {\n\t\t\t\t\treturn !imageFileInfo.IsImport()\n\t\t\t\t},\n\t\t\t)\n\t\t} else {\n\t\t\t// Also automatically adds imported WKTs if not present.\n\t\t\timageFileInfos, err = bufimage.ImageFileInfosWithOnlyTargetsAndTargetImports(\n\t\t\t\tctx,\n\t\t\t\tdatawkt.ReadBucket,\n\t\t\t\timageFileInfos,\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}\n\tvar formatFunc func(bufimage.ImageFileInfo) (string, error)\n\tswitch flags.Format {\n\tcase formatText:\n\t\tsort.Slice(\n\t\t\timageFileInfos,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn imageFileInfos[i].ExternalPath() < imageFileInfos[j].ExternalPath()\n\t\t\t},\n\t\t)\n\t\tformatFunc = func(imageFileInfo bufimage.ImageFileInfo) (string, error) {\n\t\t\treturn imageFileInfo.ExternalPath(), nil\n\t\t}\n\tcase formatJSON:\n\t\tsort.Slice(\n\t\t\timageFileInfos,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\tif imageFileInfos[i].LocalPath() < imageFileInfos[j].LocalPath() {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif imageFileInfos[i].LocalPath() > imageFileInfos[j].LocalPath() {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn imageFileInfos[i].Path() < imageFileInfos[j].Path()\n\t\t\t},\n\t\t)\n\t\tformatFunc = func(imageFileInfo bufimage.ImageFileInfo) (string, error) {\n\t\t\tdata, err := json.Marshal(newExternalImageFileInfo(imageFileInfo))\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\treturn string(data), nil\n\t\t}\n\tcase formatImport:\n\t\tformatFunc = func(imageFileInfo bufimage.ImageFileInfo) (string, error) {\n\t\t\treturn imageFileInfo.Path(), nil\n\t\t}\n\tdefault:\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be one of %s\", formatFlagName, strings.Join(allFormats, \", \"))\n\t}\n\tlines, err := xslices.MapError(imageFileInfos, formatFunc)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, line := range lines {\n\t\tif _, err := fmt.Fprintln(container.Stdout(), line); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\ntype externalImageFileInfo struct {\n\tPath       string `json:\"path\" yaml:\"path\"`\n\tImportPath string `json:\"import_path\" yaml:\"import_path\"`\n\tModule     string `json:\"module\" yaml:\"module\"`\n\t// Dashless\n\tCommit   string `json:\"commit\" yaml:\"commit\"`\n\tIsImport bool   `json:\"is_import\" yaml:\"is_import\"`\n}\n\nfunc newExternalImageFileInfo(imageFileInfo bufimage.ImageFileInfo) *externalImageFileInfo {\n\tvar module string\n\tif moduleFullName := imageFileInfo.FullName(); moduleFullName != nil {\n\t\tmodule = moduleFullName.String()\n\t}\n\tvar commit string\n\tif commitID := imageFileInfo.CommitID(); commitID != uuid.Nil {\n\t\tcommit = uuidutil.ToDashless(commitID)\n\t}\n\treturn &externalImageFileInfo{\n\t\tPath: imageFileInfo.LocalPath(),\n\t\t// This seems backwards when you read it, but it is right: the Path is the import path,\n\t\t// the LocalPath is the path that a user would have for a file on disk.\n\t\tImportPath: imageFileInfo.Path(),\n\t\tModule:     module,\n\t\tCommit:     commit,\n\t\tIsImport:   imageFileInfo.IsImport(),\n\t}\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/lsp/lspserve/lspserve.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 lspserve defines the entry-point for the Buf LSP within the CLI.\n//\n// The actual implementation of the LSP lives under private/buf/buflsp\npackage lspserve\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xio\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/bufbuild/protocompile/experimental/incremental\"\n\t\"github.com/spf13/pflag\"\n\t\"go.lsp.dev/jsonrpc2\"\n)\n\nconst (\n\t// pipe is chosen because that's what the vscode LSP client expects.\n\tpipeFlagName = \"pipe\"\n)\n\n// NewCommand constructs the CLI command for executing the LSP.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.Builder,\n\tdeprecated string,\n\thidden bool,\n\tbeta bool,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name,\n\t\tShort:      \"Start the language server\",\n\t\tArgs:       appcmd.NoArgs,\n\t\tDeprecated: deprecated,\n\t\tHidden:     hidden,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\tif beta {\n\t\t\t\t\tbufcli.WarnBetaCommand(ctx, container)\n\t\t\t\t}\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\t// A file path to a UNIX socket to use for IPC. If empty, stdio is used instead.\n\tPipePath string\n}\n\n// Bind sets up the CLI flags that the LSP needs.\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.PipePath,\n\t\tpipeFlagName,\n\t\t\"\",\n\t\t\"path to a UNIX socket to listen on; uses stdio if not specified\",\n\t)\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\n// run starts the LSP server and listens on the configured.\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\ttransport, err := dial(container, flags)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twktStore, err := bufcli.NewWKTStore(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\twktBucket, err := wktStore.GetBucket(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\twasmRuntime, err := bufcli.NewWasmRuntime(ctx, container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, wasmRuntime.Close(ctx))\n\t}()\n\n\tconn, err := buflsp.Serve(\n\t\tctx,\n\t\tbufcli.Version,\n\t\twktBucket,\n\t\tcontainer,\n\t\tcontroller,\n\t\twasmRuntime,\n\t\tjsonrpc2.NewStream(transport),\n\t\tincremental.New(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t<-conn.Done()\n\treturn conn.Err()\n}\n\n// dial opens a connection to the LSP client.\nfunc dial(container appext.Container, flags *flags) (io.ReadWriteCloser, error) {\n\tswitch {\n\tcase flags.PipePath != \"\":\n\t\tconn, err := net.Dial(\"unix\", flags.PipePath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not open IPC socket %q: %w\", flags.PipePath, err)\n\t\t}\n\t\treturn conn, nil\n\n\t// TODO: Add other transport implementations, such as TCP, here!\n\n\tdefault:\n\t\t// Fall back to stdio by default.\n\t\treturn xio.CompositeReadWriteCloser(\n\t\t\tcontainer.Stdin(),\n\t\t\tcontainer.Stdout(),\n\t\t\txio.NopCloser,\n\t\t), nil\n\t}\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/mod/internal/internal.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tallFlagName               = \"all\"\n\tconfigFlagName            = \"config\"\n\tincludeDeprecatedFlagName = \"include-deprecated\"\n\tformatFlagName            = \"format\"\n\tversionFlagName           = \"version\"\n)\n\n// NewLSCommand returns a new ls Command.\nfunc NewLSCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\truleType check.RuleType,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name,\n\t\tShort:      fmt.Sprintf(\"List %s rules\", ruleType.String()),\n\t\tArgs:       appcmd.NoArgs,\n\t\tDeprecated: fmt.Sprintf(`use \"buf config %s\" instead. However, \"buf mod %s\" will continue to work.`, name, name),\n\t\tHidden:     true,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn lsRun(\n\t\t\t\t\tctx,\n\t\t\t\t\tcontainer,\n\t\t\t\t\tflags,\n\t\t\t\t\tname,\n\t\t\t\t\truleType,\n\t\t\t\t)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tAll               bool\n\tConfig            string\n\tIncludeDeprecated bool\n\tFormat            string\n\tVersion           string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(\n\t\t&f.All,\n\t\tallFlagName,\n\t\tfalse,\n\t\t\"List all rules and not just those currently configured\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t`The buf.yaml file or data to use for configuration. Ignored if --%s or --%s is specified`,\n\t\t\tallFlagName,\n\t\t\tversionFlagName,\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.IncludeDeprecated,\n\t\tincludeDeprecatedFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t`Also print deprecated rules. Has no effect if --%s is not set.`,\n\t\t\tallFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format to print rules as. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufcli.AllRuleFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Version,\n\t\tversionFlagName,\n\t\t\"\", // do not set a default as we need to know if this is unset\n\t\tfmt.Sprintf(\n\t\t\t\"List all the rules for the given configuration version. Implies --%s. Must be one of %s\",\n\t\t\tallFlagName,\n\t\t\txslices.Map(\n\t\t\t\tbufconfig.AllFileVersions,\n\t\t\t\tfunc(fileVersion bufconfig.FileVersion) string {\n\t\t\t\t\treturn fileVersion.String()\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t)\n}\n\nfunc lsRun(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n\tcommandName string,\n\truleType check.RuleType,\n) error {\n\tif flags.All {\n\t\t// We explicitly document that if all is set, config is ignored.\n\t\t// If a user wants to override the version while using all, they should use version.\n\t\tflags.Config = \"\"\n\t}\n\tif flags.Version != \"\" {\n\t\t// If version is set, all is implied, and we use the config override to specify the version.\n\t\tflags.All = true\n\t\t// This also results in config being ignored per the documentation.\n\t\tflags.Config = fmt.Sprintf(`{\"version\":\"%s\"}`, flags.Version)\n\t}\n\tbufYAMLFile, err := bufcli.GetBufYAMLFileForDirPathOrOverride(ctx, \".\", flags.Config)\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn err\n\t\t}\n\t\tbufYAMLFile, err = bufconfig.NewBufYAMLFile(\n\t\t\tbufconfig.FileVersionV1,\n\t\t\t[]bufconfig.ModuleConfig{\n\t\t\t\tbufconfig.DefaultModuleConfigV1,\n\t\t\t},\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tnil,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfileVersion := bufYAMLFile.FileVersion()\n\tif fileVersion == bufconfig.FileVersionV2 {\n\t\treturn fmt.Errorf(`\"buf mod %s\" does not work for v2 buf.yaml files, use \"buf config %s\" instead`, commandName, commandName)\n\t}\n\t// BufYAMLFiles <=v1 never had plugins.\n\tclient, err := bufcheck.NewClient(\n\t\tcontainer.Logger(),\n\t\tbufcheck.ClientWithStderr(container.Stderr()),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar rules []bufcheck.Rule\n\tif flags.All {\n\t\trules, err = client.AllRules(ctx, ruleType, bufYAMLFile.FileVersion())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\t\tif len(moduleConfigs) != 1 {\n\t\t\treturn syserror.Newf(\"got %d ModuleConfigs for a v1beta1/v1 buf.yaml\", len(moduleConfigs))\n\t\t}\n\t\tvar checkConfig bufconfig.CheckConfig\n\t\tswitch ruleType {\n\t\tcase check.RuleTypeLint:\n\t\t\tcheckConfig = moduleConfigs[0].LintConfig()\n\t\tcase check.RuleTypeBreaking:\n\t\t\tcheckConfig = moduleConfigs[0].BreakingConfig()\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown check.RuleType: %v\", ruleType)\n\t\t}\n\t\trules, err = client.ConfiguredRules(ctx, ruleType, checkConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn bufcli.PrintRules(\n\t\tcontainer.Stdout(),\n\t\trules,\n\t\tflags.Format,\n\t\tflags.IncludeDeprecated,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/mod/modlsbreakingrules/modlsbreakingrules.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modlsbreakingrules\n\nimport (\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/mod/internal\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\treturn internal.NewLSCommand(\n\t\tname,\n\t\tbuilder,\n\t\tcheck.RuleTypeBreaking,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/mod/modlslintrules/modlslintrules.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modlslintrules\n\nimport (\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/command/mod/internal\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\treturn internal.NewLSCommand(\n\t\tname,\n\t\tbuilder,\n\t\tcheck.RuleTypeLint,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/mod/modopen/modopen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modopen\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/cli/browser\"\n)\n\nconst deprecationMessage = \"this command is not supported for v2 buf.yaml files as v2 buf.yaml files contain multiple modules. However, this command will continue to work for v1 buf.yaml files.\"\n\n// NewCommand returns a new open Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <directory>\",\n\t\tShort: \"Open the module's homepage in a web browser\",\n\t\tLong: `The first argument is the directory with the buf.yaml of the module to open.\n\nThe directory must have a buf.yaml that contains a single specified module name.\n\nThe directory defaults to \".\" if no argument is specified.`,\n\t\tDeprecated: deprecationMessage,\n\t\tHidden:     true,\n\t\tArgs:       appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container)\n\t\t\t},\n\t\t),\n\t}\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n) error {\n\tdirPath := \".\"\n\tif container.NumArgs() > 0 {\n\t\tdirPath = container.Arg(0)\n\t}\n\tbufYAMLFile, err := bufcli.GetBufYAMLFileForDirPath(ctx, dirPath)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn fmt.Errorf(\"no buf.yaml discovered in directory %s\", dirPath)\n\t\t}\n\t\treturn err\n\t}\n\tswitch fileVersion := bufYAMLFile.FileVersion(); fileVersion {\n\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\t\tif len(moduleConfigs) != 1 {\n\t\t\treturn syserror.Newf(\"got %d ModuleConfigs for a v1beta1/v1 buf.yaml\", len(moduleConfigs))\n\t\t}\n\t\tmoduleFullName := moduleConfigs[0].FullName()\n\t\tif moduleFullName == nil {\n\t\t\treturn fmt.Errorf(\"%s/buf.yaml has no module name\", dirPath)\n\t\t}\n\t\treturn browser.OpenURL(\"https://\" + moduleFullName.String())\n\tcase bufconfig.FileVersionV2:\n\t\treturn errors.New(deprecationMessage)\n\tdefault:\n\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/plugin/pluginprune/pluginprune.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginprune\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <directory>\",\n\t\tShort: \"Prune unused plugins from buf.lock\",\n\t\tLong: `Plugins that are no longer configured in buf.yaml are removed from the buf.lock file.\n\nThe first argument is the directory of your buf.yaml configuration file.\nDefaults to \".\" if no argument is specified.`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container)\n\t\t\t},\n\t\t),\n\t}\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n) error {\n\tdirPath := \".\"\n\tif container.NumArgs() > 0 {\n\t\tdirPath = container.Arg(0)\n\t}\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspaceDepManager, err := controller.GetWorkspaceDepManager(ctx, dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredRemotePluginRefs, err := workspaceDepManager.ConfiguredRemotePluginRefs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn prune(\n\t\tctx,\n\t\txslices.Map(\n\t\t\tconfiguredRemotePluginRefs,\n\t\t\tfunc(pluginRef bufparse.Ref) string {\n\t\t\t\treturn pluginRef.FullName().String()\n\t\t\t},\n\t\t),\n\t\tworkspaceDepManager,\n\t)\n}\n\nfunc prune(\n\tctx context.Context,\n\tbufYAMLBasedRemotePluginNames []string,\n\tworkspaceDepManager bufworkspace.WorkspaceDepManager,\n) error {\n\tbufYAMLRemotePluginNames := xslices.ToStructMap(bufYAMLBasedRemotePluginNames)\n\texistingRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFileRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar prunedBufLockPluginKeys []bufplugin.PluginKey\n\tfor _, existingRemotePluginKey := range existingRemotePluginKeys {\n\t\t// Check if an existing plugin key from the buf.lock is configured in the buf.yaml.\n\t\tif _, ok := bufYAMLRemotePluginNames[existingRemotePluginKey.FullName().String()]; ok {\n\t\t\t// If yes, then we keep it for the updated buf.lock.\n\t\t\tprunedBufLockPluginKeys = append(prunedBufLockPluginKeys, existingRemotePluginKey)\n\t\t}\n\t}\n\t// We keep the existing dep module keys as-is.\n\texistingDepModuleKeys, err := workspaceDepManager.ExistingBufLockFileDepModuleKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingRemotePolicyKeys, err := workspaceDepManager.ExistingBufLockFileRemotePolicyKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingPolicyNameToRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFilePolicyNameToRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn workspaceDepManager.UpdateBufLockFile(ctx, existingDepModuleKeys, prunedBufLockPluginKeys, existingRemotePolicyKeys, existingPolicyNameToRemotePluginKeys)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/plugin/pluginpush/pluginpush.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginpush\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tlabelFlagName            = \"label\"\n\tbinaryFlagName           = \"binary\"\n\tcreateFlagName           = \"create\"\n\tcreateVisibilityFlagName = \"create-visibility\"\n\tcreateTypeFlagName       = \"create-type\"\n\tsourceControlURLFlagName = \"source-control-url\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/plugin>\",\n\t\tShort: \"Push a check plugin to a registry\",\n\t\tLong:  `The first argument is the plugin full name in the format <remote/owner/plugin>.`,\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tLabels           []string\n\tBinary           string\n\tCreate           bool\n\tCreateVisibility string\n\tCreateType       string\n\tSourceControlURL string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindCreateVisibility(flagSet, &f.CreateVisibility, createVisibilityFlagName, createFlagName)\n\tflagSet.StringSliceVar(\n\t\t&f.Labels,\n\t\tlabelFlagName,\n\t\tnil,\n\t\t\"Associate the label with the plugins pushed. Can be used multiple times.\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Binary,\n\t\tbinaryFlagName,\n\t\t\"\",\n\t\t\"The path to the Wasm binary file to push.\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Create,\n\t\tcreateFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t\"Create the plugin if it does not exist. Defaults to creating a private plugin on the BSR if --%s is not set. Must be used with --%s.\",\n\t\t\tcreateVisibilityFlagName,\n\t\t\tcreateTypeFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.CreateType,\n\t\tcreateTypeFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t\"The plugin's type setting, if created. Can only be set with --%s. Must be one of %s\",\n\t\t\tcreateFlagName,\n\t\t\txstrings.SliceToString(bufplugin.AllPluginTypeStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.SourceControlURL,\n\t\tsourceControlURLFlagName,\n\t\t\"\",\n\t\t\"The URL for viewing the source code of the pushed plugins (e.g. the specific commit in source control).\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tif err := validateFlags(flags); err != nil {\n\t\treturn err\n\t}\n\t// We parse the plugin full name from the user-provided argument.\n\tpluginFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tcommit, err := upload(ctx, container, flags, pluginFullName)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Only one commit is returned.\n\tif _, err := fmt.Fprintf(container.Stdout(), \"%s\\n\", commit.PluginKey().String()); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n\nfunc upload(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n\tpluginFullName bufparse.FullName,\n) (_ bufplugin.Commit, retErr error) {\n\tvar plugin bufplugin.Plugin\n\tswitch {\n\tcase flags.Binary != \"\":\n\t\t// We create a local plugin reference to the Wasm binary.\n\t\tvar err error\n\t\tplugin, err = bufplugin.NewLocalWasmPlugin(\n\t\t\tpluginFullName,\n\t\t\tflags.Binary,\n\t\t\tnil, // args\n\t\t\tfunc() ([]byte, error) {\n\t\t\t\twasmBinary, err := os.ReadFile(flags.Binary)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"could not read Wasm binary %q: %w\", flags.Binary, err)\n\t\t\t\t}\n\t\t\t\treturn wasmBinary, nil\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tdefault:\n\t\t// This should never happen because the flags are validated.\n\t\treturn nil, syserror.Newf(\"--%s must be set\", binaryFlagName)\n\t}\n\tuploader, err := bufcli.NewPluginUploader(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar options []bufplugin.UploadOption\n\tif flags.Create {\n\t\tcreatePluginVisibility, err := bufplugin.ParsePluginVisibility(flags.CreateVisibility)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcreatePluginType, err := bufplugin.ParsePluginType(flags.CreateType)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toptions = append(options, bufplugin.UploadWithCreateIfNotExist(\n\t\t\tcreatePluginVisibility,\n\t\t\tcreatePluginType,\n\t\t))\n\t}\n\tif len(flags.Labels) > 0 {\n\t\toptions = append(options, bufplugin.UploadWithLabels(flags.Labels...))\n\t}\n\tif flags.SourceControlURL != \"\" {\n\t\toptions = append(options, bufplugin.UploadWithSourceControlURL(flags.SourceControlURL))\n\t}\n\tcommits, err := uploader.Upload(ctx, []bufplugin.Plugin{plugin}, options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(commits) != 1 {\n\t\treturn nil, syserror.Newf(\"unexpected number of commits returned from server: %d\", len(commits))\n\t}\n\treturn commits[0], nil\n}\n\nfunc validateFlags(flags *flags) error {\n\tif err := validateLabelFlags(flags); err != nil {\n\t\treturn err\n\t}\n\tif err := validateTypeFlags(flags); err != nil {\n\t\treturn err\n\t}\n\tif err := validateCreateFlags(flags); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc validateLabelFlags(flags *flags) error {\n\treturn validateLabelFlagValues(flags)\n}\n\nfunc validateTypeFlags(flags *flags) error {\n\tvar typeFlags []string\n\tif flags.Binary != \"\" {\n\t\ttypeFlags = append(typeFlags, binaryFlagName)\n\t}\n\tif len(typeFlags) > 1 {\n\t\tusedFlagsErrStr := strings.Join(\n\t\t\txslices.Map(\n\t\t\t\ttypeFlags,\n\t\t\t\tfunc(flag string) string { return fmt.Sprintf(\"--%s\", flag) },\n\t\t\t),\n\t\t\t\", \",\n\t\t)\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"These flags cannot be used in combination with one another: %s\", usedFlagsErrStr)\n\t}\n\tif len(typeFlags) == 0 {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be set\", binaryFlagName)\n\t}\n\treturn nil\n}\n\nfunc validateLabelFlagValues(flags *flags) error {\n\tif slices.Contains(flags.Labels, \"\") {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s requires a non-empty string\", labelFlagName)\n\t}\n\treturn nil\n}\n\nfunc validateCreateFlags(flags *flags) error {\n\tif flags.Create {\n\t\tif flags.CreateVisibility == \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be set if --%s is set\", createVisibilityFlagName, createFlagName)\n\t\t}\n\t\tif _, err := bufplugin.ParsePluginVisibility(flags.CreateVisibility); err != nil {\n\t\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t\t}\n\t}\n\tif flags.Create {\n\t\tif flags.CreateType == \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be set if --%s is set\", createTypeFlagName, createFlagName)\n\t\t}\n\t\tif _, err := bufplugin.ParsePluginType(flags.CreateType); err != nil {\n\t\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/plugin/pluginupdate/pluginupdate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginupdate\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tonlyFlagName = \"only\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <directory>\",\n\t\tShort: \"Update pinned remote plugins in a buf.lock\",\n\t\tLong: `Fetch the latest digests for the specified plugin references in buf.yaml.\n\nThe first argument is the directory of the local module to update.\nDefaults to \".\" if no argument is specified.`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tOnly []string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringSliceVar(\n\t\t&f.Only,\n\t\tonlyFlagName,\n\t\tnil,\n\t\t\"The name of the plugin to update. When set, only this plugin is updated. May be provided multiple times\",\n\t)\n\t// TODO FUTURE: implement\n\t_ = flagSet.MarkHidden(onlyFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tdirPath := \".\"\n\tif container.NumArgs() > 0 {\n\t\tdirPath = container.Arg(0)\n\t}\n\tif len(flags.Only) > 0 {\n\t\t// TODO FUTURE: implement\n\t\treturn syserror.Newf(\"--%s is not implemented\", onlyFlagName)\n\t}\n\n\tlogger := container.Logger()\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspaceDepManager, err := controller.GetWorkspaceDepManager(ctx, dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredRemotePluginRefs, err := workspaceDepManager.ConfiguredRemotePluginRefs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginKeyProvider, err := bufcli.NewPluginKeyProvider(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredRemotePluginKeys, err := pluginKeyProvider.GetPluginKeysForPluginRefs(\n\t\tctx,\n\t\tconfiguredRemotePluginRefs,\n\t\tbufplugin.DigestTypeP1,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Store the existing buf.lock data.\n\texistingRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFileRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif configuredRemotePluginKeys == nil && existingRemotePluginKeys == nil {\n\t\t// No new configured remote plugins were found, and no existing buf.lock deps were found, so there\n\t\t// is nothing to update, we can return here.\n\t\t// This ensures we do not create an empty buf.lock when one did not exist in the first\n\t\t// place and we do not need to go through the entire operation of updating non-existent\n\t\t// deps and building the image for tamper-proofing.\n\t\tlogger.Warn(fmt.Sprintf(\"No configured remote plugins were found to update in %q.\", dirPath))\n\t\treturn nil\n\t}\n\texistingDepModuleKeys, err := workspaceDepManager.ExistingBufLockFileDepModuleKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingRemotePolicyKeys, err := workspaceDepManager.ExistingBufLockFileRemotePolicyKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingPolicyNameToRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFilePolicyNameToRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// We're about to edit the buf.lock file on disk. If we have a subsequent error,\n\t// attempt to revert the buf.lock file.\n\t//\n\t// TODO FUTURE: We should be able to update the buf.lock file in an in-memory bucket, then do the rebuild,\n\t// and if the rebuild is successful, then actually write to disk. It shouldn't even be that much work - just\n\t// overlay the new buf.lock file in a union bucket.\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = errors.Join(retErr, workspaceDepManager.UpdateBufLockFile(\n\t\t\t\tctx, existingDepModuleKeys, existingRemotePluginKeys, existingRemotePolicyKeys, existingPolicyNameToRemotePluginKeys,\n\t\t\t))\n\t\t}\n\t}()\n\t// Edit the buf.lock file with the updated remote plugins.\n\tif err := workspaceDepManager.UpdateBufLockFile(ctx, existingDepModuleKeys, configuredRemotePluginKeys, existingRemotePolicyKeys, existingPolicyNameToRemotePluginKeys); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/policy/policyprune/policyprune.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policyprune\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <directory>\",\n\t\tShort: \"Prune unused policies from buf.lock\",\n\t\tLong: `Policies that are no longer configured in buf.yaml are removed from the buf.lock file.\n\nThe first argument is the directory of your buf.yaml configuration file.\nDefaults to \".\" if no argument is specified.`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container)\n\t\t\t},\n\t\t),\n\t}\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n) error {\n\tdirPath := \".\"\n\tif container.NumArgs() > 0 {\n\t\tdirPath = container.Arg(0)\n\t}\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspaceDepManager, err := controller.GetWorkspaceDepManager(ctx, dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredRemotePolicyRefs, err := workspaceDepManager.ConfiguredRemotePolicyRefs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn prune(\n\t\tctx,\n\t\txslices.Map(\n\t\t\tconfiguredRemotePolicyRefs,\n\t\t\tfunc(policyRef bufparse.Ref) string {\n\t\t\t\treturn policyRef.FullName().String()\n\t\t\t},\n\t\t),\n\t\tworkspaceDepManager,\n\t)\n}\n\nfunc prune(\n\tctx context.Context,\n\tbufYAMLBasedRemotePolicyNames []string,\n\tworkspaceDepManager bufworkspace.WorkspaceDepManager,\n) error {\n\tbufYAMLRemotePolicyNames := xslices.ToStructMap(bufYAMLBasedRemotePolicyNames)\n\texistingRemotePolicyKeys, err := workspaceDepManager.ExistingBufLockFileRemotePolicyKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingPolicyNameToRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFilePolicyNameToRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar (\n\t\tprunedBufLockPolicyKeys                   []bufpolicy.PolicyKey\n\t\tprunedBufLockPolicyNameToRemotePluginKeys = make(map[string][]bufplugin.PluginKey)\n\t)\n\tfor _, existingRemotePolicyKey := range existingRemotePolicyKeys {\n\t\t// Check if an existing policy key from the buf.lock is configured in the buf.yaml.\n\t\tpolicyFullNameString := existingRemotePolicyKey.FullName().String()\n\t\tif _, ok := bufYAMLRemotePolicyNames[policyFullNameString]; ok {\n\t\t\t// If yes, then we keep it for the updated buf.lock.\n\t\t\tprunedBufLockPolicyKeys = append(prunedBufLockPolicyKeys, existingRemotePolicyKey)\n\t\t\texistingRemotePluginKeys := existingPolicyNameToRemotePluginKeys[policyFullNameString]\n\t\t\tprunedBufLockPolicyNameToRemotePluginKeys[policyFullNameString] = existingRemotePluginKeys\n\t\t}\n\t}\n\t// We keep the existing dep module keys as-is.\n\texistingDepModuleKeys, err := workspaceDepManager.ExistingBufLockFileDepModuleKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFileRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn workspaceDepManager.UpdateBufLockFile(ctx, existingDepModuleKeys, existingRemotePluginKeys, prunedBufLockPolicyKeys, prunedBufLockPolicyNameToRemotePluginKeys)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/policy/policypush/policypush.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policypush\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"slices\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tlabelFlagName            = \"label\"\n\tcreateFlagName           = \"create\"\n\tcreateVisibilityFlagName = \"create-visibility\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <policy>\",\n\t\tShort: \"Push a policy to a registry\",\n\t\tLong:  `The first argument is the path to the local policy config.`,\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tLabels           []string\n\tCreate           bool\n\tCreateVisibility string\n\tSourceControlURL string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindCreateVisibility(flagSet, &f.CreateVisibility, createVisibilityFlagName, createFlagName)\n\tflagSet.StringSliceVar(\n\t\t&f.Labels,\n\t\tlabelFlagName,\n\t\tnil,\n\t\t\"Associate the label with the policies pushed. Can be used multiple times.\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Create,\n\t\tcreateFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t\"Create the policy if it does not exist. Defaults to creating a private policy on the BSR if --%s is not set.\",\n\t\t\tcreateVisibilityFlagName,\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tif err := validateFlags(flags); err != nil {\n\t\treturn err\n\t}\n\tcommit, err := upload(ctx, container, flags)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Only one commit is returned.\n\tif _, err := fmt.Fprintf(container.Stdout(), \"%s\\n\", commit.PolicyKey().String()); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n\nfunc upload(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (_ bufpolicy.Commit, retErr error) {\n\tvar policy bufpolicy.Policy\n\tif container.NumArgs() != 1 {\n\t\t// This should never happen because the args length is validated.\n\t\treturn nil, syserror.Newf(\"policy arg must be provided\")\n\t}\n\tpolicyFilePath := container.Arg(0)\n\t// We read the policy YAML file.\n\tdata, err := os.ReadFile(policyFilePath)\n\tif err != nil {\n\t\treturn nil, appcmd.NewInvalidArgumentErrorf(\"could not read policy file %q: %w\", policyFilePath, err)\n\t}\n\t// Parse the policy YAML file to validate it upfront.\n\tpolicyYamlFile, err := bufpolicyconfig.ReadBufPolicyYAMLFile(bytes.NewReader(data), policyFilePath)\n\tif err != nil {\n\t\treturn nil, appcmd.NewInvalidArgumentErrorf(\"unable to validate policy file %q: %w\", policyFilePath, err)\n\t}\n\t// We parse the policy full name from the user-provided argument.\n\tif policyYamlFile.Name() == \"\" {\n\t\treturn nil, appcmd.NewInvalidArgumentErrorf(\"policy file %q must have a name\", policyFilePath)\n\t}\n\tpolicyFullName, err := bufparse.ParseFullName(policyYamlFile.Name())\n\tif err != nil {\n\t\treturn nil, appcmd.NewInvalidArgumentErrorf(\"unable to parse policy full name %q: %w\", policyYamlFile.Name(), err)\n\t}\n\tpolicy, err = bufpolicy.NewPolicy(policyFilePath, policyFullName, policyFullName.Name(), uuid.Nil, policyYamlFile.PolicyConfig)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create policy from file %q: %w\", policyFilePath, err)\n\t}\n\tuploader, err := bufcli.NewPolicyUploader(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar options []bufpolicy.UploadOption\n\tif flags.Create {\n\t\tcreatePolicyVisibility, err := bufpolicy.ParsePolicyVisibility(flags.CreateVisibility)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toptions = append(options, bufpolicy.UploadWithCreateIfNotExist(\n\t\t\tcreatePolicyVisibility,\n\t\t))\n\t}\n\tif len(flags.Labels) > 0 {\n\t\toptions = append(options, bufpolicy.UploadWithLabels(flags.Labels...))\n\t}\n\tif flags.SourceControlURL != \"\" {\n\t\toptions = append(options, bufpolicy.UploadWithSourceControlURL(flags.SourceControlURL))\n\t}\n\tcommits, err := uploader.Upload(ctx, []bufpolicy.Policy{policy}, options...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(commits) != 1 {\n\t\treturn nil, syserror.Newf(\"unexpected number of commits returned from server: %d\", len(commits))\n\t}\n\treturn commits[0], nil\n}\n\nfunc validateFlags(flags *flags) error {\n\tif err := validateLabelFlags(flags); err != nil {\n\t\treturn err\n\t}\n\tif err := validateCreateFlags(flags); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc validateLabelFlags(flags *flags) error {\n\treturn validateLabelFlagValues(flags)\n}\n\nfunc validateLabelFlagValues(flags *flags) error {\n\tif slices.Contains(flags.Labels, \"\") {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s requires a non-empty string\", labelFlagName)\n\t}\n\treturn nil\n}\n\nfunc validateCreateFlags(flags *flags) error {\n\tif flags.Create {\n\t\tif flags.CreateVisibility == \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s must be set if --%s is set\", createVisibilityFlagName, createFlagName)\n\t\t}\n\t\tif _, err := bufpolicy.ParsePolicyVisibility(flags.CreateVisibility); err != nil {\n\t\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/policy/policyupdate/policyupdate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policyupdate\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"maps\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tonlyFlagName = \"only\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <directory>\",\n\t\tShort: \"Update pinned remote policies in a buf.lock\",\n\t\tLong: `Fetch the latest digests for the specified policy references in buf.yaml.\n\nThe first argument is the directory of the local module to update.\nDefaults to \".\" if no argument is specified.`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tOnly []string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringSliceVar(\n\t\t&f.Only,\n\t\tonlyFlagName,\n\t\tnil,\n\t\t\"The name of the policy to update. When set, only this policy is updated. May be provided multiple times\",\n\t)\n\t// TODO FUTURE: implement\n\t_ = flagSet.MarkHidden(onlyFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tdirPath := \".\"\n\tif container.NumArgs() > 0 {\n\t\tdirPath = container.Arg(0)\n\t}\n\tif len(flags.Only) > 0 {\n\t\t// TODO FUTURE: implement\n\t\treturn syserror.Newf(\"--%s is not implemented\", onlyFlagName)\n\t}\n\n\tlogger := container.Logger()\n\tcontroller, err := bufcli.NewController(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspaceDepManager, err := controller.GetWorkspaceDepManager(ctx, dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredRemotePolicyRefs, err := workspaceDepManager.ConfiguredRemotePolicyRefs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredLocalPolicyNameToRemotePluginRefs, err := workspaceDepManager.ConfiguredLocalPolicyNameToRemotePluginRefs(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyKeyProvider, err := bufcli.NewPolicyKeyProvider(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredRemotePolicyKeys, err := policyKeyProvider.GetPolicyKeysForPolicyRefs(\n\t\tctx,\n\t\tconfiguredRemotePolicyRefs,\n\t\tbufpolicy.DigestTypeO1,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredRemotePolicyNameToRemotePluginKeys, err := getPolicyKeyPluginKeysForPolicyKeys(\n\t\tctx,\n\t\tcontainer,\n\t\tconfiguredRemotePolicyKeys,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredLocalPolicyNameToRemotePluginKeys, err := getPolicyPluginKeysForPolicyNames(\n\t\tctx,\n\t\tcontainer,\n\t\tconfiguredLocalPolicyNameToRemotePluginRefs,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar configuredPolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey\n\tif policyCount := len(configuredRemotePolicyNameToRemotePluginKeys) + len(configuredLocalPolicyNameToRemotePluginKeys); policyCount > 0 {\n\t\tconfiguredPolicyNameToRemotePluginKeys = make(map[string][]bufplugin.PluginKey, policyCount)\n\t\tmaps.Copy(configuredPolicyNameToRemotePluginKeys, configuredRemotePolicyNameToRemotePluginKeys)\n\t\tmaps.Copy(configuredPolicyNameToRemotePluginKeys, configuredLocalPolicyNameToRemotePluginKeys)\n\t}\n\n\t// Store the existing buf.lock data.\n\texistingRemotePolicyKeys, err := workspaceDepManager.ExistingBufLockFileRemotePolicyKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingPolicyNameToRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFilePolicyNameToRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(configuredRemotePolicyKeys) == 0 && len(configuredPolicyNameToRemotePluginKeys) == 0 &&\n\t\tlen(existingRemotePolicyKeys) == 0 && len(existingPolicyNameToRemotePluginKeys) == 0 {\n\t\t// No new configured remote plugins were found, and no existing buf.lock deps were found, so there\n\t\t// is nothing to update, we can return here.\n\t\t// This ensures we do not create an empty buf.lock when one did not exist in the first\n\t\t// place and we do not need to go through the entire operation of updating non-existent\n\t\t// deps and building the image for tamper-proofing.\n\t\tlogger.Warn(fmt.Sprintf(\"No configured remote policies were found to update in %q.\", dirPath))\n\t\treturn nil\n\t}\n\texistingDepModuleKeys, err := workspaceDepManager.ExistingBufLockFileDepModuleKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\texistingRemotePluginKeys, err := workspaceDepManager.ExistingBufLockFileRemotePluginKeys(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We're about to edit the buf.lock file on disk. If we have a subsequent error,\n\t// attempt to revert the buf.lock file.\n\t//\n\t// TODO FUTURE: We should be able to update the buf.lock file in an in-memory bucket, then do the rebuild,\n\t// and if the rebuild is successful, then actually write to disk. It shouldn't even be that much work - just\n\t// overlay the new buf.lock file in a union bucket.\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = errors.Join(retErr, workspaceDepManager.UpdateBufLockFile(\n\t\t\t\tctx, existingDepModuleKeys, existingRemotePluginKeys, existingRemotePolicyKeys, existingPolicyNameToRemotePluginKeys,\n\t\t\t))\n\t\t}\n\t}()\n\t// Edit the buf.lock file with the updated remote plugins.\n\tif err := workspaceDepManager.UpdateBufLockFile(ctx, existingDepModuleKeys, existingRemotePluginKeys, configuredRemotePolicyKeys, configuredPolicyNameToRemotePluginKeys); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc getPolicyKeyPluginKeysForPolicyKeys(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tpolicyKeys []bufpolicy.PolicyKey,\n) (map[string][]bufplugin.PluginKey, error) {\n\tif len(policyKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tpolicyDataProvider, err := bufcli.NewPolicyDataProvider(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginKeyProvider, err := bufcli.NewPluginKeyProvider(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyDatas, err := policyDataProvider.GetPolicyDatasForPolicyKeys(ctx, policyKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyNameToRemotePluginKeys := make(map[string][]bufplugin.PluginKey)\n\tfor _, policyData := range policyDatas {\n\t\tpolicyConfig, err := policyData.Config()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginConfigs := policyConfig.PluginConfigs()\n\t\tpluginRefs, err := xslices.MapError(pluginConfigs, func(pluginConfig bufpolicy.PluginConfig) (bufparse.Ref, error) {\n\t\t\tpluginRef := pluginConfig.Ref()\n\t\t\tif pluginRef == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"plugin config %q does not have a valid ref\", pluginConfig.Name())\n\t\t\t}\n\t\t\treturn pluginRef, nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get plugin refs for policy %q: %w\", policyData.PolicyKey(), err)\n\t\t}\n\t\tremotePluginKeys, err := pluginKeyProvider.GetPluginKeysForPluginRefs(\n\t\t\tctx,\n\t\t\tpluginRefs,\n\t\t\tbufplugin.DigestTypeP1,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicyName := policyData.PolicyKey().FullName().String()\n\t\tif len(remotePluginKeys) > 0 {\n\t\t\tpolicyNameToRemotePluginKeys[policyName] = remotePluginKeys\n\t\t}\n\t}\n\treturn policyNameToRemotePluginKeys, nil\n}\n\nfunc getPolicyPluginKeysForPolicyNames(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tlocalPolicyNameToRemotePluginRefs map[string][]bufparse.Ref,\n) (map[string][]bufplugin.PluginKey, error) {\n\tif len(localPolicyNameToRemotePluginRefs) == 0 {\n\t\treturn nil, nil\n\t}\n\tpluginKeyProvider, err := bufcli.NewPluginKeyProvider(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyNameToRemotePluginKeys := make(map[string][]bufplugin.PluginKey)\n\tfor policyName, pluginRefs := range localPolicyNameToRemotePluginRefs {\n\t\tremotePluginKeys, err := pluginKeyProvider.GetPluginKeysForPluginRefs(\n\t\t\tctx,\n\t\t\tpluginRefs,\n\t\t\tbufplugin.DigestTypeP1,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(remotePluginKeys) > 0 {\n\t\t\tpolicyNameToRemotePluginKeys[policyName] = remotePluginKeys\n\t\t}\n\t}\n\treturn policyNameToRemotePluginKeys, nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/push/push.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 push\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tlabelFlagName              = \"label\"\n\terrorFormatFlagName        = \"error-format\"\n\tdisableSymlinksFlagName    = \"disable-symlinks\"\n\tcreateFlagName             = \"create\"\n\tcreateVisibilityFlagName   = \"create-visibility\"\n\tcreateDefaultLabelFlagName = \"create-default-label\"\n\tsourceControlURLFlagName   = \"source-control-url\"\n\tgitMetadataFlagName        = \"git-metadata\"\n\texcludeUnnamedFlagName     = \"exclude-unnamed\"\n\n\t// All deprecated.\n\ttagFlagName      = \"tag\"\n\ttagFlagShortName = \"t\"\n\tdraftFlagName    = \"draft\"\n\tbranchFlagName   = \"branch\"\n\n\tgitOriginRemote = \"origin\"\n)\n\nvar (\n\tuseLabelInstead = fmt.Sprintf(\"use --%s instead.\", labelFlagName)\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <source>\",\n\t\tShort: \"Push to a registry\",\n\t\tLong:  bufcli.GetSourceLong(`the source to push`),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tTags               []string\n\tBranch             string\n\tDraft              string\n\tLabels             []string\n\tErrorFormat        string\n\tDisableSymlinks    bool\n\tCreate             bool\n\tCreateVisibility   string\n\tCreateDefaultLabel string\n\tSourceControlURL   string\n\tExcludeUnnamed     bool\n\tGitMetadata        bool\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tbufcli.BindCreateVisibility(flagSet, &f.CreateVisibility, createVisibilityFlagName, createFlagName)\n\tflagSet.StringSliceVar(\n\t\t&f.Labels,\n\t\tlabelFlagName,\n\t\tnil,\n\t\t\"Associate the label with the modules pushed. Can be used multiple times.\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Create,\n\t\tcreateFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t\"Create the module if it does not exist. Defaults to creating a private module if --%s is not set.\",\n\t\t\tcreateVisibilityFlagName,\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.CreateDefaultLabel,\n\t\tcreateDefaultLabelFlagName,\n\t\t\"\",\n\t\t`The module's default label setting, if created. If this is not set, then the module will be created with the default label \"main\".`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.SourceControlURL,\n\t\tsourceControlURLFlagName,\n\t\t\"\",\n\t\t\"The URL for viewing the source code of the pushed modules (e.g. the specific commit in source control).\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.GitMetadata,\n\t\tgitMetadataFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t`Uses the Git source control state to set flag values. If this flag is set, we will use the following values for your flags:\n\n\t--%s to <git remote URL>/<repository name>/<route>/<checked out commit sha> (e.g. https://github.com/acme/weather/commit/ffac537e6cbbf934b08745a378932722df287a53).\n\t--%s for each Git tag and branch pointing to the currently checked out commit. You can set additional labels using --%s with this flag.\n\t--%s to the Git default branch (e.g. main) - this is only in effect if --%s is also set.\n\nThe source control URL and default branch is based on the required Git remote %q.\nThis flag is only compatible with checkouts of Git source repositories.\nIf you set the --%s flag and/or --%s flag yourself, then the value(s) will be used instead and the information will not be derived from the Git source control state.`,\n\t\t\tsourceControlURLFlagName,\n\t\t\tlabelFlagName,\n\t\t\tlabelFlagName,\n\t\t\tcreateDefaultLabelFlagName,\n\t\t\tcreateFlagName,\n\t\t\tgitOriginRemote,\n\t\t\tsourceControlURLFlagName,\n\t\t\tcreateDefaultLabelFlagName,\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.ExcludeUnnamed,\n\t\texcludeUnnamedFlagName,\n\t\tfalse,\n\t\t\"Only push named modules to the BSR. Named modules must not have any unnamed dependencies.\",\n\t)\n\n\tflagSet.StringSliceVarP(&f.Tags, tagFlagName, tagFlagShortName, nil, useLabelInstead)\n\t_ = flagSet.MarkHidden(tagFlagName)\n\t_ = flagSet.MarkHidden(tagFlagShortName)\n\t_ = flagSet.MarkDeprecated(\n\t\ttagFlagName,\n\t\tfmt.Sprintf(\n\t\t\t`%s Replace \"buf push --tag <tag-name>\" with \"buf push --label <default-label-name> --label <label-name>\" (<tag-name> and <label-name> are equivalent in this case).\nYou can also use \"buf registry commit add-label <remote/owner/module:commit> --label <label>\" to add a label to an existing commit.`,\n\t\t\tuseLabelInstead,\n\t\t),\n\t)\n\t_ = flagSet.MarkDeprecated(tagFlagShortName, useLabelInstead)\n\tflagSet.StringVar(&f.Draft, draftFlagName, \"\", useLabelInstead)\n\t_ = flagSet.MarkHidden(draftFlagName)\n\t_ = flagSet.MarkDeprecated(\n\t\tdraftFlagName,\n\t\tfmt.Sprintf(\n\t\t\t`%s Replace \"buf push --draft <draft-name>\" with \"buf push --label <label-name>\" (<draft-name> and <label-name> are equivalent in this case).`,\n\t\t\tuseLabelInstead,\n\t\t),\n\t)\n\tflagSet.StringVar(&f.Branch, branchFlagName, \"\", useLabelInstead)\n\t_ = flagSet.MarkHidden(branchFlagName)\n\t_ = flagSet.MarkDeprecated(branchFlagName,\n\t\tfmt.Sprintf(\n\t\t\t`%s Replace \"buf push --branch <branch-name>\" with \"buf push --label <label-name>\" (<branch-name> and <label-name> are equivalent in this case).`,\n\t\t\tuseLabelInstead,\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tif err := validateFlags(flags); err != nil {\n\t\treturn err\n\t}\n\n\tworkspace, err := getBuildableWorkspace(ctx, container, flags)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuploader, err := bufcli.NewModuleUploader(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar uploadOptions []bufmodule.UploadOption\n\tif flags.GitMetadata {\n\t\tgitMetadataUploadOptions, err := getGitMetadataUploadOptions(ctx, container, flags)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tuploadOptions = append(uploadOptions, gitMetadataUploadOptions...)\n\t\t// Accept any additional labels the user has set using `--label`\n\t\tif len(flags.Labels) > 0 {\n\t\t\tuploadOptions = append(uploadOptions, bufmodule.UploadWithLabels(xslices.ToUniqueSorted(flags.Labels)...))\n\t\t}\n\t} else {\n\t\t// Otherwise, we parse the flags set individually by the user.\n\t\tif labelUploadOption := getLabelUploadOption(flags); labelUploadOption != nil {\n\t\t\tuploadOptions = append(uploadOptions, labelUploadOption)\n\t\t}\n\t}\n\tif flags.Create {\n\t\tcreateModuleVisibility, err := bufmodule.ParseModuleVisibility(flags.CreateVisibility)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tuploadOptions = append(\n\t\t\tuploadOptions,\n\t\t\tbufmodule.UploadWithCreateIfNotExist(createModuleVisibility, flags.CreateDefaultLabel),\n\t\t)\n\t}\n\tif flags.SourceControlURL != \"\" {\n\t\tuploadOptions = append(uploadOptions, bufmodule.UploadWithSourceControlURL(flags.SourceControlURL))\n\t}\n\tif flags.ExcludeUnnamed {\n\t\tuploadOptions = append(uploadOptions, bufmodule.UploadWithExcludeUnnamed())\n\t}\n\n\tcommits, err := uploader.Upload(ctx, workspace, uploadOptions...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(commits) == 0 {\n\t\treturn nil\n\t}\n\tif workspace.IsV2() {\n\t\t_, err := container.Stdout().Write(\n\t\t\t[]byte(\n\t\t\t\tstrings.Join(\n\t\t\t\t\txslices.Map(\n\t\t\t\t\t\tcommits,\n\t\t\t\t\t\tfunc(commit bufmodule.Commit) string {\n\t\t\t\t\t\t\treturn commit.ModuleKey().String()\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t\t\"\\n\",\n\t\t\t\t) + \"\\n\",\n\t\t\t),\n\t\t)\n\t\treturn err\n\t}\n\t// v1 workspace, fallback to old behavior for backwards compatibility.\n\tif len(commits) > 1 {\n\t\treturn syserror.Newf(\"Received multiple commits back for a v1 module. We should only ever have created a single commit for a v1 module.\")\n\t}\n\t_, err = container.Stdout().Write(\n\t\t[]byte(uuidutil.ToDashless(commits[0].ModuleKey().CommitID()) + \"\\n\"),\n\t)\n\treturn err\n}\n\nfunc getBuildableWorkspace(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (bufworkspace.Workspace, error) {\n\tsource, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tworkspace, err := controller.GetWorkspace(\n\t\tctx,\n\t\tsource,\n\t\t// We actually could make it so that buf push would work with buf.work.yamls and push\n\t\t// v1 workspaces as well, but this may have unintended (and potentially breaking) consequences\n\t\t// that we don't want to deal with. If we have a v1 workspace, just outlaw pushing the whole\n\t\t// workspace, and force people into the pre-refactor behavior.\n\t\tbufctl.WithIgnoreAndDisallowV1BufWorkYAMLs(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Make sure the workspace builds.\n\tif _, err := controller.GetImageForWorkspace(\n\t\tctx,\n\t\tworkspace,\n\t\tbufctl.WithImageExcludeSourceInfo(true),\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn workspace, nil\n}\n\nfunc validateFlags(flags *flags) error {\n\tif err := validateCreateFlags(flags); err != nil {\n\t\treturn err\n\t}\n\tif err := validateLabelFlags(flags); err != nil {\n\t\treturn err\n\t}\n\treturn validateGitMetadataFlags(flags)\n}\n\nfunc validateCreateFlags(flags *flags) error {\n\tif flags.Create {\n\t\tif flags.CreateVisibility == \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\n\t\t\t\t\"--%s is required if --%s is set\",\n\t\t\t\tcreateVisibilityFlagName,\n\t\t\t\tcreateFlagName,\n\t\t\t)\n\t\t}\n\t\tif _, err := bufmodule.ParseModuleVisibility(flags.CreateVisibility); err != nil {\n\t\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t\t}\n\t} else {\n\t\tif flags.CreateDefaultLabel != \"\" {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\n\t\t\t\t\"Cannot set --%s without --%s\",\n\t\t\t\tcreateDefaultLabelFlagName,\n\t\t\t\tcreateFlagName,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateLabelFlags(flags *flags) error {\n\tif err := validateLabelFlagCombinations(flags); err != nil {\n\t\treturn err\n\t}\n\treturn validateLabelFlagValues(flags)\n}\n\n// We do not allow overlaps between `--label`, `--tag`, `--branch`, and `--draft` flags\n// when calling push. Only one type of flag is allowed to be used at a time when pushing.\nfunc validateLabelFlagCombinations(flags *flags) error {\n\tvar usedFlags []string\n\tif len(flags.Labels) > 0 {\n\t\tusedFlags = append(usedFlags, labelFlagName)\n\t}\n\tif len(flags.Tags) > 0 {\n\t\tusedFlags = append(usedFlags, tagFlagName)\n\t}\n\tif flags.Branch != \"\" {\n\t\tusedFlags = append(usedFlags, branchFlagName)\n\t}\n\tif flags.Draft != \"\" {\n\t\tusedFlags = append(usedFlags, draftFlagName)\n\t}\n\tif len(usedFlags) > 1 {\n\t\tusedFlagsErrStr := strings.Join(\n\t\t\txslices.Map(\n\t\t\t\tusedFlags,\n\t\t\t\tfunc(flag string) string { return fmt.Sprintf(\"--%s\", flag) },\n\t\t\t),\n\t\t\t\", \",\n\t\t)\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"These flags cannot be used in combination with one another: %s\", usedFlagsErrStr)\n\t}\n\treturn nil\n}\n\nfunc validateLabelFlagValues(flags *flags) error {\n\tif slices.Contains(flags.Labels, \"\") {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s requires a non-empty string\", labelFlagName)\n\t}\n\tif slices.Contains(flags.Tags, \"\") {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s requires a non-empty string\", tagFlagName)\n\t}\n\treturn nil\n}\n\n// We do not allow users to set --tag, --branch, and --draft\n// flags if the --git-metadata flag is set.\nfunc validateGitMetadataFlags(flags *flags) error {\n\tif flags.GitMetadata {\n\t\tvar usedFlags []string\n\t\tif len(flags.Tags) > 0 {\n\t\t\tusedFlags = append(usedFlags, tagFlagName)\n\t\t}\n\t\tif flags.Branch != \"\" {\n\t\t\tusedFlags = append(usedFlags, branchFlagName)\n\t\t}\n\t\tif flags.Draft != \"\" {\n\t\t\tusedFlags = append(usedFlags, draftFlagName)\n\t\t}\n\t\tif len(usedFlags) > 0 {\n\t\t\tusedFlagsErrStr := strings.Join(\n\t\t\t\txslices.Map(\n\t\t\t\t\tusedFlags,\n\t\t\t\t\tfunc(flag string) string { return fmt.Sprintf(\"--%s\", flag) },\n\t\t\t\t),\n\t\t\t\t\", \",\n\t\t\t)\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\n\t\t\t\t\"The following flag(s) cannot be used in combination with --%s: %s.\",\n\t\t\t\tgitMetadataFlagName,\n\t\t\t\tusedFlagsErrStr,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc getGitMetadataUploadOptions(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) ([]bufmodule.UploadOption, error) {\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// validate that input is a dirRef and is a valid git checkout\n\tif err := validateInputIsValidDirAndGitCheckout(ctx, container, input); err != nil {\n\t\treturn nil, err\n\t}\n\tuncommittedFiles, err := git.CheckForUncommittedGitChanges(ctx, container, input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(uncommittedFiles) > 0 {\n\t\treturn nil, fmt.Errorf(\"--%s requires that there are no uncommitted changes, uncommitted changes found in the following files: %v\", gitMetadataFlagName, uncommittedFiles)\n\t}\n\toriginRemote, err := git.GetRemote(ctx, container, input, gitOriginRemote)\n\tif err != nil {\n\t\tif errors.Is(err, git.ErrRemoteNotFound) {\n\t\t\treturn nil, appcmd.NewInvalidArgumentErrorf(\"remote %s must be present on Git checkout: %w\", gitOriginRemote, err)\n\t\t}\n\t\treturn nil, err\n\t}\n\tcurrentGitCommit, err := git.GetCurrentHEADGitCommit(ctx, container, input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar gitMetadataUploadOptions []bufmodule.UploadOption\n\tgitLabelsUploadOption, err := getGitMetadataLabelsUploadOptions(ctx, container, input, currentGitCommit)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif gitLabelsUploadOption != nil {\n\t\tgitMetadataUploadOptions = append(gitMetadataUploadOptions, gitLabelsUploadOption)\n\t}\n\t// We get the source control URL information if the user has not provided a value for\n\t// the --source-control-url flag. If they did, then we skip this step and use the user-set\n\t// value for source control URL instead.\n\tif flags.SourceControlURL == \"\" {\n\t\tsourceControlURL := originRemote.SourceControlURL(currentGitCommit)\n\t\tif sourceControlURL == \"\" {\n\t\t\treturn nil, appcmd.NewInvalidArgumentError(\"unable to determine source control URL for this repository; only GitHub/GitLab/BitBucket are supported\")\n\t\t}\n\t\tgitMetadataUploadOptions = append(gitMetadataUploadOptions, bufmodule.UploadWithSourceControlURL(sourceControlURL))\n\t}\n\t// We get the default label information if the user has not provided a value for the\n\t// --create-default-label flag. If they did, then we skip this step and use the user-set\n\t// value for --create-default-label instead.\n\tif flags.Create && flags.CreateDefaultLabel == \"\" {\n\t\tcreateModuleVisibility, err := bufmodule.ParseModuleVisibility(flags.CreateVisibility)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tgitMetadataUploadOptions = append(\n\t\t\tgitMetadataUploadOptions,\n\t\t\tbufmodule.UploadWithCreateIfNotExist(createModuleVisibility, originRemote.HEADBranch()),\n\t\t)\n\t}\n\treturn gitMetadataUploadOptions, nil\n}\n\nfunc validateInputIsValidDirAndGitCheckout(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tinput string,\n) error {\n\tif _, err := buffetch.NewDirRefParser(container.Logger()).GetDirRef(ctx, input); err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"input %q is not a valid directory: %w\", input, err)\n\t}\n\tif err := git.CheckDirectoryIsValidGitCheckout(ctx, container, input); err != nil {\n\t\tif errors.Is(err, git.ErrInvalidGitCheckout) {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"input %q is not a local Git repository checkout\", input)\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc getGitMetadataLabelsUploadOptions(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tinput string,\n\tgitCommitSha string,\n) (bufmodule.UploadOption, error) {\n\trefs, err := git.GetRefsForGitCommitAndRemote(ctx, envContainer, input, gitOriginRemote, gitCommitSha)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(refs) == 0 {\n\t\treturn nil, fmt.Errorf(\"no tags or branches found for HEAD, %s\", gitCommitSha)\n\t}\n\treturn bufmodule.UploadWithLabels(refs...), nil\n}\n\nfunc getLabelUploadOption(flags *flags) bufmodule.UploadOption {\n\t// We do not allow the mixing of flags, so post-validation, we only expect one of the\n\t// flags to be set. And so we return the corresponding bufmodule.UploadOption if any\n\t// flags are set.\n\tif len(flags.Labels) > 0 {\n\t\treturn bufmodule.UploadWithLabels(xslices.ToUniqueSorted(flags.Labels)...)\n\t}\n\tif len(flags.Tags) > 0 {\n\t\treturn bufmodule.UploadWithTags(xslices.ToUniqueSorted(flags.Tags)...)\n\t}\n\tif flags.Branch != \"\" {\n\t\t// We upload to a single label, the branch name.\n\t\treturn bufmodule.UploadWithLabels(flags.Branch)\n\t}\n\tif flags.Draft != \"\" {\n\t\t// We upload to a single label, the draft name.\n\t\treturn bufmodule.UploadWithLabels(flags.Draft)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulecommit/modulecommitaddlabel/modulecommitaddlabel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulecommitaddlabel\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName = \"format\"\n\tlabelsFlagName = \"label\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/module:commit> --label <label>\",\n\t\tShort:      \"Add labels to a commit\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n\tLabels []string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.Labels,\n\t\tlabelsFlagName,\n\t\tnil,\n\t\t\"The labels to add to the commit. Must have at least one\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif moduleRef.Ref() == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"commit is required\")\n\t}\n\tcommitID := moduleRef.Ref()\n\tif _, err := uuidutil.FromDashless(commitID); err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid commit: %w\", err)\n\t}\n\tlabels := flags.Labels\n\tif len(labels) == 0 {\n\t\treturn appcmd.NewInvalidArgumentError(\"must create at least one label\")\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleClientProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\tlabelServiceClient := moduleClientProvider.V1LabelServiceClient(moduleRef.FullName().Registry())\n\trequestValues := xslices.Map(labels, func(label string) *modulev1.CreateOrUpdateLabelsRequest_Value {\n\t\treturn &modulev1.CreateOrUpdateLabelsRequest_Value{\n\t\t\tLabelRef: &modulev1.LabelRef{\n\t\t\t\tValue: &modulev1.LabelRef_Name_{\n\t\t\t\t\tName: &modulev1.LabelRef_Name{\n\t\t\t\t\t\tOwner:  moduleRef.FullName().Owner(),\n\t\t\t\t\t\tModule: moduleRef.FullName().Name(),\n\t\t\t\t\t\tLabel:  label,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCommitId: commitID,\n\t\t}\n\t})\n\tresp, err := labelServiceClient.CreateOrUpdateLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.CreateOrUpdateLabelsRequest{\n\t\t\t\tValues: requestValues,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\t// Not explicitly handling error with connect.CodeNotFound as it can be repository not found or commit not found.\n\t\t// It can also be a misformatted commit ID error.\n\t\treturn err\n\t}\n\tif format == bufprint.FormatText {\n\t\tfor _, label := range resp.Msg.Labels {\n\t\t\tfmt.Fprintf(container.Stdout(), \"%s:%s\\n\", moduleRef.FullName(), label.Name)\n\t\t}\n\t\treturn nil\n\t}\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\txslices.Map(resp.Msg.Labels, func(label *modulev1.Label) bufprint.Entity {\n\t\t\treturn bufprint.NewLabelEntity(label, moduleRef.FullName())\n\t\t})...,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulecommit/modulecommitinfo/modulecommitinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulecommitinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/repository:commit>\",\n\t\tShort:      \"Get commit information\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif moduleRef.Ref() == \"\" {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"%q does not have a commit specified\", moduleRef.String())\n\t}\n\tcommitID := moduleRef.Ref()\n\tif _, err := uuidutil.FromDashless(commitID); err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid commit: %w\", err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1CommitServiceClient(moduleRef.FullName().Registry())\n\tresp, err := commitServiceClient.GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetCommitsRequest{\n\t\t\t\tResourceRefs: []*modulev1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.ResourceRef_Id{\n\t\t\t\t\t\t\tId: moduleRef.Ref(),\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 err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := resp.Msg.Commits\n\tif len(commits) != 1 {\n\t\treturn syserror.Newf(\"expect 1 commit from response, got %d\", len(commits))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewCommitEntity(commits[0], moduleRef.FullName(), commits[0].GetSourceControlUrl()),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulecommit/modulecommitlist/modulecommitlist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulecommitlist\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tpageSizeFlagName          = \"page-size\"\n\tpageTokenFlagName         = \"page-token\"\n\treverseFlagName           = \"reverse\"\n\tformatFlagName            = \"format\"\n\tdigestChangesOnlyFlagName = \"digest-changes-only\"\n\n\tdefaultPageSize = 10\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/module[:ref]>\",\n\t\tShort: \"List modules commits\",\n\t\tLong: `This command lists commits in a module based on the reference specified.\nFor a commit reference, it lists the commit itself.\nFor a label reference, it lists the current and past commits associated with this label.\nIf no reference is specified, it lists all commits in this module.\n`,\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat            string\n\tPageSize          uint32\n\tPageToken         string\n\tReverse           bool\n\tDigestChangesOnly bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.Uint32Var(&f.PageSize,\n\t\tpageSizeFlagName,\n\t\tdefaultPageSize,\n\t\t`The page size`,\n\t)\n\tflagSet.StringVar(&f.PageToken,\n\t\tpageTokenFlagName,\n\t\t\"\",\n\t\t`The page token. If more results are available, a \"next_page\" key is present in the --format=json output`,\n\t)\n\tflagSet.BoolVar(&f.Reverse,\n\t\treverseFlagName,\n\t\tfalse,\n\t\t`Reverse the results. By default, they are ordered with the newest first`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.DigestChangesOnly,\n\t\tdigestChangesOnlyFlagName,\n\t\tfalse,\n\t\t`Only commits that have changed digests. By default, all commits are listed`,\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tregistry := moduleRef.FullName().Registry()\n\tmoduleClientProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\tcommitServiceClient := moduleClientProvider.V1CommitServiceClient(registry)\n\tlabelServiceClient := moduleClientProvider.V1LabelServiceClient(registry)\n\tresourceServiceClient := moduleClientProvider.V1ResourceServiceClient(registry)\n\tresourceResp, err := resourceServiceClient.GetResources(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetResourcesRequest{\n\t\t\t\tResourceRefs: []*modulev1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tModule: moduleRef.FullName().Name(),\n\t\t\t\t\t\t\t\tChild: &modulev1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\t\tRef: moduleRef.Ref(),\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\tresources := resourceResp.Msg.Resources\n\tif len(resources) != 1 {\n\t\treturn syserror.Newf(\"expect 1 resource from response, got %d\", len(resources))\n\t}\n\tresource := resources[0]\n\tif commit := resource.GetCommit(); commit != nil {\n\t\t// If the ref is a commit, the commit is the only result and there is no next page.\n\t\treturn bufprint.PrintPage(\n\t\t\tcontainer.Stdout(),\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t[]bufprint.Entity{bufprint.NewCommitEntity(commit, moduleRef.FullName(), commit.GetSourceControlUrl())},\n\t\t)\n\t}\n\tif resource.GetModule() != nil {\n\t\t// The ref is a module, ListCommits returns all the commits.\n\t\tcommitOrder := modulev1.ListCommitsRequest_ORDER_CREATE_TIME_DESC\n\t\tif flags.Reverse {\n\t\t\tcommitOrder = modulev1.ListCommitsRequest_ORDER_CREATE_TIME_ASC\n\t\t}\n\t\tresp, err := commitServiceClient.ListCommits(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\t&modulev1.ListCommitsRequest{\n\t\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\t\tResourceRef: &modulev1.ResourceRef{\n\t\t\t\t\t\tValue: &modulev1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tModule: moduleRef.FullName().Name(),\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\tOrder: commitOrder,\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\t\treturn bufcli.NewRefNotFoundError(moduleRef)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\treturn bufprint.PrintPage(\n\t\t\tcontainer.Stdout(),\n\t\t\tformat,\n\t\t\tresp.Msg.NextPageToken,\n\t\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\t\txslices.Map(resp.Msg.Commits, func(commit *modulev1.Commit) bufprint.Entity {\n\t\t\t\treturn bufprint.NewCommitEntity(commit, moduleRef.FullName(), commit.GetSourceControlUrl())\n\t\t\t}),\n\t\t)\n\t}\n\tlabel := resource.GetLabel()\n\tif label == nil {\n\t\t// This should be impossible because getLabelOrCommitForRef would've returned an error.\n\t\treturn syserror.Newf(\"%s is neither a commit nor a label\", moduleRef.String())\n\t}\n\t// The ref is a label. Call ListLabelHistory to get all commits.\n\tlabelHistoryOrder := modulev1.ListLabelHistoryRequest_ORDER_DESC\n\tif flags.Reverse {\n\t\tlabelHistoryOrder = modulev1.ListLabelHistoryRequest_ORDER_ASC\n\t}\n\tresp, err := labelServiceClient.ListLabelHistory(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.ListLabelHistoryRequest{\n\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\tLabelRef: &modulev1.LabelRef{\n\t\t\t\t\tValue: &modulev1.LabelRef_Name_{\n\t\t\t\t\t\tName: &modulev1.LabelRef_Name{\n\t\t\t\t\t\t\tOwner:  moduleRef.FullName().Owner(),\n\t\t\t\t\t\t\tModule: moduleRef.FullName().Name(),\n\t\t\t\t\t\t\tLabel:  moduleRef.Ref(),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tOrder:                         labelHistoryOrder,\n\t\t\t\tOnlyCommitsWithChangedDigests: flags.DigestChangesOnly,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\t// This should be impossible since we just checked that the ref is a label.\n\t\t\treturn bufcli.NewRefNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := xslices.Map(\n\t\tresp.Msg.Values,\n\t\tfunc(value *modulev1.ListLabelHistoryResponse_Value) *modulev1.Commit {\n\t\t\treturn value.Commit\n\t\t},\n\t)\n\treturn bufprint.PrintPage(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tresp.Msg.NextPageToken,\n\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\txslices.Map(commits, func(commit *modulev1.Commit) bufprint.Entity {\n\t\t\treturn bufprint.NewCommitEntity(commit, moduleRef.FullName(), commit.GetSourceControlUrl())\n\t\t}),\n\t)\n}\n\nfunc nextPageCommand(container appext.Container, flags *flags, nextPageToken string) string {\n\tif nextPageToken == \"\" {\n\t\treturn \"\"\n\t}\n\tcommand := fmt.Sprintf(\"buf registry module commit list %s\", container.Arg(0))\n\tif flags.PageSize != defaultPageSize {\n\t\tcommand = fmt.Sprintf(\"%s --%s %d\", command, pageSizeFlagName, flags.PageSize)\n\t}\n\tif flags.Reverse {\n\t\tcommand = fmt.Sprintf(\"%s --%s\", command, reverseFlagName)\n\t}\n\tif flags.Format != bufprint.FormatText.String() {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, formatFlagName, flags.Format)\n\t}\n\treturn fmt.Sprintf(\"%s --%s %s\", command, pageTokenFlagName, nextPageToken)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulecommit/modulecommitresolve/modulecommitresolve.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulecommitresolve\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/repository[:ref]>\",\n\t\tShort:      \"Resolve commit from a reference\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1CommitServiceClient(moduleRef.FullName().Registry())\n\tresp, err := commitServiceClient.GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetCommitsRequest{\n\t\t\t\tResourceRefs: []*modulev1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tModule: moduleRef.FullName().Name(),\n\t\t\t\t\t\t\t\tChild: &modulev1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\t\tRef: moduleRef.Ref(),\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := resp.Msg.Commits\n\tif len(commits) != 1 {\n\t\treturn syserror.Newf(\"expect 1 commit from response, got %d\", len(commits))\n\t}\n\tcommit := commits[0]\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewCommitEntity(commit, moduleRef.FullName(), commit.GetSourceControlUrl()),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulecreate/modulecreate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulecreate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName      = \"format\"\n\tvisibilityFlagName  = \"visibility\"\n\tdefaultLabeFlagName = \"default-label-name\"\n\n\tdefaultDefaultLabel = \"main\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/module>\",\n\t\tShort: \"Create a BSR module\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat       string\n\tVisibility   string\n\tDefaultLabel string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName, false)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringVar(\n\t\t&f.DefaultLabel,\n\t\tdefaultLabeFlagName,\n\t\tdefaultDefaultLabel,\n\t\t\"The default label name of the module\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tvisibility, err := bufcli.VisibilityFlagToVisibilityAllowUnspecified(flags.Visibility)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1ModuleServiceClient(moduleFullName.Registry())\n\tresp, err := moduleServiceClient.CreateModules(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.CreateModulesRequest{\n\t\t\t\tValues: []*modulev1.CreateModulesRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tOwnerRef: &ownerv1.OwnerRef{\n\t\t\t\t\t\t\tValue: &ownerv1.OwnerRef_Name{\n\t\t\t\t\t\t\t\tName: moduleFullName.Owner(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tName:             moduleFullName.Name(),\n\t\t\t\t\t\tVisibility:       visibility,\n\t\t\t\t\t\tDefaultLabelName: flags.DefaultLabel,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeAlreadyExists {\n\t\t\treturn bufcli.NewModuleNameAlreadyExistsError(moduleFullName.String())\n\t\t}\n\t\treturn err\n\t}\n\tmodules := resp.Msg.Modules\n\tif len(modules) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of modules returned from server: %d\", len(modules))\n\t}\n\tif format == bufprint.FormatText {\n\t\t_, err = fmt.Fprintf(container.Stdout(), \"Created %s.\\n\", moduleFullName)\n\t\tif err != nil {\n\t\t\treturn syserror.Wrap(err)\n\t\t}\n\t\treturn nil\n\t}\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewModuleEntity(modules[0], moduleFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/moduledelete/moduledelete.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 moduledelete\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst forceFlagName = \"force\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/module>\",\n\t\tShort: \"Delete a BSR module\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tForce bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(\n\t\t&f.Force,\n\t\tforceFlagName,\n\t\tfalse,\n\t\t\"Force deletion without confirming. Use with caution\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !flags.Force {\n\t\tif err := bufcli.PromptUserForDelete(container, \"entity\", moduleFullName.Name()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tmoduleServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1ModuleServiceClient(moduleFullName.Registry())\n\tif _, err := moduleServiceClient.DeleteModules(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.DeleteModulesRequest{\n\t\t\t\tModuleRefs: []*modulev1.ModuleRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.ModuleRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.ModuleRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewModuleNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintf(container.Stdout(), \"Deleted %s.\\n\", moduleFullName); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/moduledeprecate/moduledeprecate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 moduledeprecate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/module>\",\n\t\tShort: \"Deprecate a BSR module\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct{}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {}\n\nfunc run(ctx context.Context, container appext.Container, flags *flags) error {\n\tmoduleFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleClientProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\tmoduleServiceClient := moduleClientProvider.V1ModuleServiceClient(moduleFullName.Registry())\n\tif _, err := moduleServiceClient.UpdateModules(\n\t\tctx,\n\t\t&connect.Request[modulev1.UpdateModulesRequest]{\n\t\t\tMsg: &modulev1.UpdateModulesRequest{\n\t\t\t\tValues: []*modulev1.UpdateModulesRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tModuleRef: &modulev1.ModuleRef{\n\t\t\t\t\t\t\tValue: &modulev1.ModuleRef_Name_{\n\t\t\t\t\t\t\t\tName: &modulev1.ModuleRef_Name{\n\t\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\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\tState: modulev1.ModuleState_MODULE_STATE_DEPRECATED.Enum(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewModuleNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintln(container.Stdout(), \"Module deprecated.\"); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/moduleinfo/moduleinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 moduleinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/module>\",\n\t\tShort: \"Get a BSR module\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1ModuleServiceClient(moduleFullName.Registry())\n\tresp, err := moduleServiceClient.GetModules(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetModulesRequest{\n\t\t\t\tModuleRefs: []*modulev1.ModuleRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.ModuleRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.ModuleRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewModuleNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tmodules := resp.Msg.Modules\n\tif len(modules) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of modules returned from server: %d\", len(modules))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewModuleEntity(modules[0], moduleFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulelabel/modulelabelarchive/modulelabelarchive.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulelabelarchive\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/module:label>\",\n\t\tShort:      \"Archive a module label\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\t_ *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := moduleRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleFullName := moduleRef.FullName()\n\tlabelServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1LabelServiceClient(moduleFullName.Registry())\n\t// ArchiveLabelsResponse is empty.\n\tif _, err := labelServiceClient.ArchiveLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.ArchiveLabelsRequest{\n\t\t\t\tLabelRefs: []*modulev1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Archived %s.\\n\", moduleRef)\n\treturn err\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulelabel/modulelabelinfo/modulelabelinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulelabelinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/module:label>\",\n\t\tShort:      \"Show label information\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := moduleRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleClientProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\tmoduleFullName := moduleRef.FullName()\n\tlabelServiceClient := moduleClientProvider.V1LabelServiceClient(moduleFullName.Registry())\n\tresp, err := labelServiceClient.GetLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetLabelsRequest{\n\t\t\t\tLabelRefs: []*modulev1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\tlabels := resp.Msg.Labels\n\tif len(labels) != 1 {\n\t\treturn syserror.Newf(\"expect 1 label from response, got %d\", len(labels))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewLabelEntity(labels[0], moduleFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulelabel/modulelabellist/modulelabellist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulelabellist\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tarchiveStatusName = \"archive-status\"\n\tpageSizeFlagName  = \"page-size\"\n\tpageTokenFlagName = \"page-token\"\n\treverseFlagName   = \"reverse\"\n\tformatFlagName    = \"format\"\n\n\tdefaultPageSize = 10\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/module[:ref]>\",\n\t\tShort:      \"List module labels\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tArchiveStatus string\n\tPageSize      uint32\n\tPageToken     string\n\tReverse       bool\n\tFormat        string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindArchiveStatus(flagSet, &f.ArchiveStatus, archiveStatusName)\n\tflagSet.Uint32Var(\n\t\t&f.PageSize,\n\t\tpageSizeFlagName,\n\t\tdefaultPageSize,\n\t\t`The page size.`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.PageToken,\n\t\tpageTokenFlagName,\n\t\t\"\",\n\t\t`The page token. If more results are available, a \"next_page\" key is present in the --format=json output`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Reverse,\n\t\treverseFlagName,\n\t\tfalse,\n\t\t`Reverse the results`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tarchiveStatusFilter, err := bufcli.ArchiveStatusFlagToModuleArchiveStatusFilter(flags.ArchiveStatus)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleClientProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\tmoduleFullName := moduleRef.FullName()\n\tlabelServiceClient := moduleClientProvider.V1LabelServiceClient(moduleFullName.Registry())\n\torder := modulev1.ListLabelsRequest_ORDER_UPDATE_TIME_DESC\n\tif flags.Reverse {\n\t\torder = modulev1.ListLabelsRequest_ORDER_UPDATE_TIME_ASC\n\t}\n\tresp, err := labelServiceClient.ListLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.ListLabelsRequest{\n\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\tResourceRef: &modulev1.ResourceRef{\n\t\t\t\t\tValue: &modulev1.ResourceRef_Name_{\n\t\t\t\t\t\tName: &modulev1.ResourceRef_Name{\n\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\tModule: moduleFullName.Name(),\n\t\t\t\t\t\t\tChild: &modulev1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\tRef: moduleRef.Ref(),\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\tOrder:         order,\n\t\t\t\tArchiveFilter: archiveStatusFilter,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\treturn bufprint.PrintPage(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tresp.Msg.NextPageToken,\n\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\txslices.Map(resp.Msg.Labels, func(label *modulev1.Label) bufprint.Entity {\n\t\t\treturn bufprint.NewLabelEntity(label, moduleFullName)\n\t\t}),\n\t)\n}\n\nfunc nextPageCommand(container appext.Container, flags *flags, nextPageToken string) string {\n\tif nextPageToken == \"\" {\n\t\treturn \"\"\n\t}\n\tcommand := fmt.Sprintf(\"buf registry module label list %s\", container.Arg(0))\n\tif flags.ArchiveStatus != bufcli.DefaultArchiveStatus {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, archiveStatusName, flags.ArchiveStatus)\n\t}\n\tif flags.PageSize != defaultPageSize {\n\t\tcommand = fmt.Sprintf(\"%s --%s %d\", command, pageSizeFlagName, flags.PageSize)\n\t}\n\tif flags.Reverse {\n\t\tcommand = fmt.Sprintf(\"%s --%s\", command, reverseFlagName)\n\t}\n\tif flags.Format != bufprint.FormatText.String() {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, formatFlagName, flags.Format)\n\t}\n\treturn fmt.Sprintf(\"%s --%s %s\", command, pageTokenFlagName, nextPageToken)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulelabel/modulelabelunarchive/modulelabelunarchive.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulelabelunarchive\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/module:label>\",\n\t\tShort:      \"Unarchive a module label\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\t_ *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := moduleRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleFullName := moduleRef.FullName()\n\tlabelServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1LabelServiceClient(moduleFullName.Registry())\n\t// UnarchiveLabelsResponse is empty.\n\tif _, err := labelServiceClient.UnarchiveLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.UnarchiveLabelsRequest{\n\t\t\t\tLabelRefs: []*modulev1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &modulev1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &modulev1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(moduleRef)\n\t\t}\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Unarchived %s.\\n\", moduleRef)\n\treturn err\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/modulesettings/modulesettingsupdate/modulesettingsupdate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 modulesettingsupdate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tvisibilityFlagName   = \"visibility\"\n\tdescriptionFlagName  = \"description\"\n\turlFlagName          = \"url\"\n\tdefaultLabelFlagName = \"default-label-name\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/module>\",\n\t\tShort:      \"Update BSR module settings\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tVisibility   string\n\tDescription  *string\n\tURL          *string\n\tDefaultLabel string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName, true)\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\tdescriptionFlagName,\n\t\t&f.Description,\n\t\t\"The new description for the module\",\n\t)\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\turlFlagName,\n\t\t&f.URL,\n\t\t\"The new URL for the module\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.DefaultLabel,\n\t\tdefaultLabelFlagName,\n\t\t\"\",\n\t\t\"The label that commits are pushed to by default\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tvisibility, err := bufcli.VisibilityFlagToVisibilityAllowUnspecified(flags.Visibility)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleServiceClient := bufregistryapimodule.NewClientProvider(clientConfig).V1ModuleServiceClient(moduleFullName.Registry())\n\tvisibilityUpdate := &visibility\n\tif visibility == modulev1.ModuleVisibility_MODULE_VISIBILITY_UNSPECIFIED {\n\t\tvisibilityUpdate = nil\n\t}\n\tdefaultLabelUpdate := &flags.DefaultLabel\n\tif flags.DefaultLabel == \"\" {\n\t\tdefaultLabelUpdate = nil\n\t}\n\tif _, err := moduleServiceClient.UpdateModules(\n\t\tctx,\n\t\t&connect.Request[modulev1.UpdateModulesRequest]{\n\t\t\tMsg: &modulev1.UpdateModulesRequest{\n\t\t\t\tValues: []*modulev1.UpdateModulesRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tModuleRef: &modulev1.ModuleRef{\n\t\t\t\t\t\t\tValue: &modulev1.ModuleRef_Name_{\n\t\t\t\t\t\t\t\tName: &modulev1.ModuleRef_Name{\n\t\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\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\tDescription:      flags.Description,\n\t\t\t\t\t\tUrl:              flags.URL,\n\t\t\t\t\t\tVisibility:       visibilityUpdate,\n\t\t\t\t\t\tDefaultLabelName: defaultLabelUpdate,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewModuleNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintf(container.Stdout(), \"Updated %s.\\n\", moduleFullName); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/module/moduleundeprecate/moduleundeprecate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 moduleundeprecate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <buf.build/owner/module>\",\n\t\tShort: \"Undeprecate a BSR module\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun:   builder.NewRunFunc(run),\n\t}\n}\n\nfunc run(ctx context.Context, container appext.Container) error {\n\tmoduleFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleClientProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\tmoduleServiceClient := moduleClientProvider.V1ModuleServiceClient(moduleFullName.Registry())\n\tif _, err := moduleServiceClient.UpdateModules(\n\t\tctx,\n\t\t&connect.Request[modulev1.UpdateModulesRequest]{\n\t\t\tMsg: &modulev1.UpdateModulesRequest{\n\t\t\t\tValues: []*modulev1.UpdateModulesRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tModuleRef: &modulev1.ModuleRef{\n\t\t\t\t\t\t\tValue: &modulev1.ModuleRef_Name_{\n\t\t\t\t\t\t\t\tName: &modulev1.ModuleRef_Name{\n\t\t\t\t\t\t\t\t\tOwner:  moduleFullName.Owner(),\n\t\t\t\t\t\t\t\t\tModule: moduleFullName.Name(),\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\tState: modulev1.ModuleState_MODULE_STATE_ACTIVE.Enum(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewModuleNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintln(container.Stdout(), \"Module undeprecated.\"); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/organization/organizationcreate/organizationcreate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 organizationcreate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/organization>\",\n\t\tShort: \"Create a new BSR organization\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleOwner, err := bufcli.ParseModuleOwner(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\townerClientProvider := bufregistryapiowner.NewClientProvider(clientConfig)\n\torganizationServiceClient := ownerClientProvider.V1OrganizationServiceClient(moduleOwner.Registry())\n\tresp, err := organizationServiceClient.CreateOrganizations(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&ownerv1.CreateOrganizationsRequest{\n\t\t\t\tValues: []*ownerv1.CreateOrganizationsRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: moduleOwner.Owner(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\t// Not explicitly handling error with connect.AlreadyExists as it can be a user or an\n\t\t// organization that already exists with that name.\n\t\treturn err\n\t}\n\torganizations := resp.Msg.GetOrganizations()\n\tif len(organizations) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of organizations created by server: %d\", len(organizations))\n\t}\n\tif format == bufprint.FormatText {\n\t\tif _, err := fmt.Fprintf(container.Stdout(), \"Created %s.\\n\", moduleOwner); err != nil {\n\t\t\treturn syserror.Wrap(err)\n\t\t}\n\t\treturn nil\n\t}\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewOrganizationEntity(organizations[0], moduleOwner.Registry()),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/organization/organizationdelete/organizationdelete.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 organizationdelete\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst forceFlagName = \"force\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/organization>\",\n\t\tShort: \"Delete a BSR organization\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tForce bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(\n\t\t&f.Force,\n\t\tforceFlagName,\n\t\tfalse,\n\t\t\"Force deletion without confirming. Use with caution\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleOwner, err := bufcli.ParseModuleOwner(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif !flags.Force {\n\t\tif err := bufcli.PromptUserForDelete(container, \"organization\", moduleOwner.Owner()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\townerClientProvider := bufregistryapiowner.NewClientProvider(clientConfig)\n\torganizationServiceClient := ownerClientProvider.V1OrganizationServiceClient(moduleOwner.Registry())\n\tif _, err := organizationServiceClient.DeleteOrganizations(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&ownerv1.DeleteOrganizationsRequest{\n\t\t\t\tOrganizationRefs: []*ownerv1.OrganizationRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &ownerv1.OrganizationRef_Name{\n\t\t\t\t\t\t\tName: moduleOwner.Owner(),\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewOrganizationNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintln(container.Stdout(), \"Organization deleted.\"); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/organization/organizationinfo/organizationinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 organizationinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/organization>\",\n\t\tShort: \"Show information about a BSR organization\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleOwner, err := bufcli.ParseModuleOwner(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\townerClientProvider := bufregistryapiowner.NewClientProvider(clientConfig)\n\torganizationServiceClient := ownerClientProvider.V1OrganizationServiceClient(moduleOwner.Registry())\n\tresp, err := organizationServiceClient.GetOrganizations(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&ownerv1.GetOrganizationsRequest{\n\t\t\t\tOrganizationRefs: []*ownerv1.OrganizationRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &ownerv1.OrganizationRef_Name{\n\t\t\t\t\t\t\tName: moduleOwner.Owner(),\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 err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewOrganizationNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\torganizations := resp.Msg.GetOrganizations()\n\tif len(organizations) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of organizations returned from server: %d\", len(organizations))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewOrganizationEntity(organizations[0], moduleOwner.Registry()),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/organization/organizationupdate/organizationupdate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 organizationupdate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tdescriptionFlagName = \"description\"\n\turlFlagName         = \"url\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/organization>\",\n\t\tShort: \"Update a BSR organization\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\turl         *string\n\tdescription *string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\tdescriptionFlagName,\n\t\t&f.description,\n\t\t\"The new description for the organization\",\n\t)\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\turlFlagName,\n\t\t&f.url,\n\t\t\"The new URL for the organization\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleOwner, err := bufcli.ParseModuleOwner(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\townerClientProvider := bufregistryapiowner.NewClientProvider(clientConfig)\n\torganizationServiceClient := ownerClientProvider.V1OrganizationServiceClient(moduleOwner.Registry())\n\tif _, err := organizationServiceClient.UpdateOrganizations(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&ownerv1.UpdateOrganizationsRequest{\n\t\t\t\tValues: []*ownerv1.UpdateOrganizationsRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tOrganizationRef: &ownerv1.OrganizationRef{\n\t\t\t\t\t\t\tValue: &ownerv1.OrganizationRef_Name{\n\t\t\t\t\t\t\t\tName: moduleOwner.Owner(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tDescription: flags.description,\n\t\t\t\t\t\tUrl:         flags.url,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t),\n\t); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewOrganizationNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintln(container.Stdout(), \"Organization updated.\"); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitaddlabel/plugincommitaddlabel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugincommitaddlabel\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName = \"format\"\n\tlabelsFlagName = \"label\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/plugin:commit> --label <label>\",\n\t\tShort:      \"Add labels to a commit\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n\tLabels []string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.Labels,\n\t\tlabelsFlagName,\n\t\tnil,\n\t\t\"The labels to add to the commit. Must have at least one\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif pluginRef.Ref() == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"commit is required\")\n\t}\n\tcommitID := pluginRef.Ref()\n\tif _, err := uuidutil.FromDashless(commitID); err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid commit: %w\", err)\n\t}\n\tlabels := flags.Labels\n\tif len(labels) == 0 {\n\t\treturn appcmd.NewInvalidArgumentError(\"must create at least one label\")\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginClientProvider := bufregistryapiplugin.NewClientProvider(clientConfig)\n\tlabelServiceClient := pluginClientProvider.V1Beta1LabelServiceClient(pluginRef.FullName().Registry())\n\trequestValues := xslices.Map(labels, func(label string) *pluginv1beta1.CreateOrUpdateLabelsRequest_Value {\n\t\treturn &pluginv1beta1.CreateOrUpdateLabelsRequest_Value{\n\t\t\tLabelRef: &pluginv1beta1.LabelRef{\n\t\t\t\tValue: &pluginv1beta1.LabelRef_Name_{\n\t\t\t\t\tName: &pluginv1beta1.LabelRef_Name{\n\t\t\t\t\t\tOwner:  pluginRef.FullName().Owner(),\n\t\t\t\t\t\tPlugin: pluginRef.FullName().Name(),\n\t\t\t\t\t\tLabel:  label,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCommitId: commitID,\n\t\t}\n\t})\n\tresp, err := labelServiceClient.CreateOrUpdateLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.CreateOrUpdateLabelsRequest{\n\t\t\t\tValues: requestValues,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\t// Not explicitly handling error with connect.CodeNotFound as\n\t\t// it can be Plugin or Commit not found error. May be caused by\n\t\t// a misformatted ID.\n\t\treturn err\n\t}\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\txslices.Map(resp.Msg.Labels, func(label *pluginv1beta1.Label) bufprint.Entity {\n\t\t\treturn bufprint.NewLabelEntity(label, pluginRef.FullName())\n\t\t})...,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitinfo/plugincommitinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugincommitinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/repository:commit>\",\n\t\tShort:      \"Get commit information\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif pluginRef.Ref() == \"\" {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"%q does not have a commit specified\", pluginRef.String())\n\t}\n\tcommitID := pluginRef.Ref()\n\tif _, err := uuidutil.FromDashless(commitID); err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid commit: %w\", err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).V1Beta1CommitServiceClient(pluginRef.FullName().Registry())\n\tresp, err := commitServiceClient.GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.GetCommitsRequest{\n\t\t\t\tResourceRefs: []*pluginv1beta1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &pluginv1beta1.ResourceRef_Id{\n\t\t\t\t\t\t\tId: pluginRef.Ref(),\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 err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := resp.Msg.Commits\n\tif len(commits) != 1 {\n\t\treturn syserror.Newf(\"expect 1 commit from response, got %d\", len(commits))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewCommitEntity(commits[0], pluginRef.FullName(), commits[0].GetSourceControlUrl()),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitlist/plugincommitlist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugincommitlist\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tpageSizeFlagName          = \"page-size\"\n\tpageTokenFlagName         = \"page-token\"\n\treverseFlagName           = \"reverse\"\n\tformatFlagName            = \"format\"\n\tdigestChangesOnlyFlagName = \"digest-changes-only\"\n\n\tdefaultPageSize = 10\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/plugin[:ref]>\",\n\t\tShort: \"List plugins commits\",\n\t\tLong: `This command lists commits in a plugin based on the reference specified.\nFor a commit reference, it lists the commit itself.\nFor a label reference, it lists the current and past commits associated with this label.\nIf no reference is specified, it lists all commits in this plugin.\n`,\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat            string\n\tPageSize          uint32\n\tPageToken         string\n\tReverse           bool\n\tDigestChangesOnly bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.Uint32Var(\n\t\t&f.PageSize,\n\t\tpageSizeFlagName,\n\t\tdefaultPageSize,\n\t\t`The page size`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.PageToken,\n\t\tpageTokenFlagName,\n\t\t\"\",\n\t\t`The page token. If more results are available, a \"next_page\" key is present in the --format=json output`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Reverse,\n\t\treverseFlagName,\n\t\tfalse,\n\t\t`Reverse the results. By default, they are ordered with the newest first`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.DigestChangesOnly,\n\t\tdigestChangesOnlyFlagName,\n\t\tfalse,\n\t\t`Only commits that have changed digests. By default, all commits are listed`,\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tregistry := pluginRef.FullName().Registry()\n\tpluginClientProvider := bufregistryapiplugin.NewClientProvider(clientConfig)\n\tcommitServiceClient := pluginClientProvider.V1Beta1CommitServiceClient(registry)\n\tlabelServiceClient := pluginClientProvider.V1Beta1LabelServiceClient(registry)\n\tresourceServiceClient := pluginClientProvider.V1Beta1ResourceServiceClient(registry)\n\n\tresourceResp, err := resourceServiceClient.GetResources(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.GetResourcesRequest{\n\t\t\t\tResourceRefs: []*pluginv1beta1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &pluginv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &pluginv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  pluginRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tPlugin: pluginRef.FullName().Name(),\n\t\t\t\t\t\t\t\tChild: &pluginv1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\t\tRef: pluginRef.Ref(),\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\tresources := resourceResp.Msg.Resources\n\tif len(resources) != 1 {\n\t\treturn syserror.Newf(\"expect 1 resource from response, got %d\", len(resources))\n\t}\n\tresource := resources[0]\n\tif commit := resource.GetCommit(); commit != nil {\n\t\t// If the ref is a commit, the commit is the only result and there is no next page.\n\t\treturn bufprint.PrintPage(\n\t\t\tcontainer.Stdout(),\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t[]bufprint.Entity{bufprint.NewCommitEntity(commit, pluginRef.FullName(), commit.GetSourceControlUrl())},\n\t\t)\n\t}\n\tif resource.GetPlugin() != nil {\n\t\t// The ref is a plugin, ListCommits returns all the commits.\n\t\tcommitOrder := pluginv1beta1.ListCommitsRequest_ORDER_CREATE_TIME_DESC\n\t\tif flags.Reverse {\n\t\t\tcommitOrder = pluginv1beta1.ListCommitsRequest_ORDER_CREATE_TIME_ASC\n\t\t}\n\t\tresp, err := commitServiceClient.ListCommits(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\t&pluginv1beta1.ListCommitsRequest{\n\t\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\t\tResourceRef: &pluginv1beta1.ResourceRef{\n\t\t\t\t\t\tValue: &pluginv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &pluginv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  pluginRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tPlugin: pluginRef.FullName().Name(),\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\tOrder: commitOrder,\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\t\treturn bufcli.NewRefNotFoundError(pluginRef)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\treturn bufprint.PrintPage(\n\t\t\tcontainer.Stdout(),\n\t\t\tformat,\n\t\t\tresp.Msg.NextPageToken,\n\t\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\t\txslices.Map(resp.Msg.Commits, func(commit *pluginv1beta1.Commit) bufprint.Entity {\n\t\t\t\treturn bufprint.NewCommitEntity(commit, pluginRef.FullName(), commit.GetSourceControlUrl())\n\t\t\t}),\n\t\t)\n\t}\n\tlabel := resource.GetLabel()\n\tif label == nil {\n\t\t// This should be impossible because getLabelOrCommitForRef would've returned an error.\n\t\treturn syserror.Newf(\"%s is neither a commit nor a label\", pluginRef.String())\n\t}\n\t// The ref is a label. Call ListLabelHistory to get all commits.\n\tlabelHistoryOrder := pluginv1beta1.ListLabelHistoryRequest_ORDER_DESC\n\tif flags.Reverse {\n\t\tlabelHistoryOrder = pluginv1beta1.ListLabelHistoryRequest_ORDER_ASC\n\t}\n\tresp, err := labelServiceClient.ListLabelHistory(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.ListLabelHistoryRequest{\n\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\tLabelRef: &pluginv1beta1.LabelRef{\n\t\t\t\t\tValue: &pluginv1beta1.LabelRef_Name_{\n\t\t\t\t\t\tName: &pluginv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\tOwner:  pluginRef.FullName().Owner(),\n\t\t\t\t\t\t\tPlugin: pluginRef.FullName().Name(),\n\t\t\t\t\t\t\tLabel:  pluginRef.Ref(),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tOrder:                         labelHistoryOrder,\n\t\t\t\tOnlyCommitsWithChangedDigests: flags.DigestChangesOnly,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\t// This should be impossible since we just checked that the ref is a label.\n\t\t\treturn bufcli.NewRefNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := xslices.Map(\n\t\tresp.Msg.Values,\n\t\tfunc(value *pluginv1beta1.ListLabelHistoryResponse_Value) *pluginv1beta1.Commit {\n\t\t\treturn value.Commit\n\t\t},\n\t)\n\treturn bufprint.PrintPage(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tresp.Msg.NextPageToken,\n\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\txslices.Map(commits, func(commit *pluginv1beta1.Commit) bufprint.Entity {\n\t\t\treturn bufprint.NewCommitEntity(commit, pluginRef.FullName(), commit.GetSourceControlUrl())\n\t\t}),\n\t)\n}\n\nfunc nextPageCommand(container appext.Container, flags *flags, nextPageToken string) string {\n\tif nextPageToken == \"\" {\n\t\treturn \"\"\n\t}\n\tcommand := fmt.Sprintf(\"buf registry commit list %s\", container.Arg(0))\n\tif flags.PageSize != defaultPageSize {\n\t\tcommand = fmt.Sprintf(\"%s --%s %d\", command, pageSizeFlagName, flags.PageSize)\n\t}\n\tif flags.Reverse {\n\t\tcommand = fmt.Sprintf(\"%s --%s\", command, reverseFlagName)\n\t}\n\tif flags.Format != bufprint.FormatText.String() {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, formatFlagName, flags.Format)\n\t}\n\treturn fmt.Sprintf(\"%s --%s %s\", command, pageTokenFlagName, nextPageToken)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/plugincommit/plugincommitresolve/plugincommitresolve.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugincommitresolve\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/repository[:ref]>\",\n\t\tShort:      \"Resolve commit from a reference\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).V1Beta1CommitServiceClient(pluginRef.FullName().Registry())\n\tresp, err := commitServiceClient.GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.GetCommitsRequest{\n\t\t\t\tResourceRefs: []*pluginv1beta1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &pluginv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &pluginv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  pluginRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tPlugin: pluginRef.FullName().Name(),\n\t\t\t\t\t\t\t\tChild: &pluginv1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\t\tRef: pluginRef.Ref(),\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := resp.Msg.Commits\n\tif len(commits) != 1 {\n\t\treturn syserror.Newf(\"expect 1 commit from response, got %d\", len(commits))\n\t}\n\tcommit := commits[0]\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewCommitEntity(commit, pluginRef.FullName(), commit.GetSourceControlUrl()),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/plugincreate/plugincreate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugincreate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName      = \"format\"\n\tvisibilityFlagName  = \"visibility\"\n\tdefaultLabeFlagName = \"default-label-name\"\n\ttypeFlagName        = \"type\"\n\n\tdefaultDefaultLabel = \"main\"\n\n\tpluginTypeCheck = \"check\"\n)\n\nvar (\n\tallPluginTypeStrings = []string{\n\t\tpluginTypeCheck,\n\t}\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/plugin>\",\n\t\tShort: \"Create a BSR plugin\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat       string\n\tVisibility   string\n\tDefaultLabel string\n\tType         string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName, false)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringVar(\n\t\t&f.DefaultLabel,\n\t\tdefaultLabeFlagName,\n\t\tdefaultDefaultLabel,\n\t\t\"The default label name of the module\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.Type,\n\t\ttypeFlagName,\n\t\t\"\",\n\t\tfmt.Sprintf(\n\t\t\t\"The type of the plugin. Must be one of %s\",\n\t\t\txstrings.SliceToString(allPluginTypeStrings),\n\t\t),\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, typeFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tvisibility, err := bufcli.VisibilityFlagToPluginVisibilityAllowUnspecified(flags.Visibility)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tpluginType, err := typeFlagToPluginType(flags.Type)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).\n\t\tV1Beta1PluginServiceClient(pluginFullName.Registry())\n\n\tpluginResponse, err := pluginServiceClient.CreatePlugins(ctx, connect.NewRequest(\n\t\t&pluginv1beta1.CreatePluginsRequest{\n\t\t\tValues: []*pluginv1beta1.CreatePluginsRequest_Value{\n\t\t\t\t{\n\t\t\t\t\tOwnerRef: &ownerv1.OwnerRef{\n\t\t\t\t\t\tValue: &ownerv1.OwnerRef_Name{\n\t\t\t\t\t\t\tName: pluginFullName.Owner(),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tName:       pluginFullName.Name(),\n\t\t\t\t\tVisibility: visibility,\n\t\t\t\t\tType:       pluginType,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t))\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeAlreadyExists {\n\t\t\treturn bufcli.NewPluginNameAlreadyExistsError(pluginFullName.String())\n\t\t}\n\t\treturn err\n\t}\n\tplugins := pluginResponse.Msg.Plugins\n\tif len(plugins) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of plugins returned from server: %d\", len(plugins))\n\t}\n\tif format == bufprint.FormatText {\n\t\t_, err = fmt.Fprintf(container.Stdout(), \"Created %s.\\n\", pluginFullName)\n\t\tif err != nil {\n\t\t\treturn syserror.Wrap(err)\n\t\t}\n\t\treturn nil\n\t}\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewPluginEntity(plugins[0], pluginFullName),\n\t)\n}\n\n// typeFlagToPluginType parses the given string as a pluginv1.PluginType.\nfunc typeFlagToPluginType(pluginType string) (pluginv1beta1.PluginType, error) {\n\tswitch pluginType {\n\tcase pluginTypeCheck:\n\t\treturn pluginv1beta1.PluginType_PLUGIN_TYPE_CHECK, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid plugin type: %s\", pluginType)\n\t}\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/plugindelete/plugindelete.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugindelete\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst forceFlagName = \"force\"\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/plugin>\",\n\t\tShort: \"Delete a BSR plugin\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tForce bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(\n\t\t&f.Force,\n\t\tforceFlagName,\n\t\tfalse,\n\t\t\"Force deletion without confirming. Use with caution\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif !flags.Force {\n\t\tif err := bufcli.PromptUserForDelete(container, \"entity\", pluginFullName.Name()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).\n\t\tV1Beta1PluginServiceClient(pluginFullName.Registry())\n\n\tif _, err := pluginServiceClient.DeletePlugins(ctx, connect.NewRequest(\n\t\t&pluginv1beta1.DeletePluginsRequest{\n\t\t\tPluginRefs: []*pluginv1beta1.PluginRef{\n\t\t\t\t{\n\t\t\t\t\tValue: &pluginv1beta1.PluginRef_Name_{\n\t\t\t\t\t\tName: &pluginv1beta1.PluginRef_Name{\n\t\t\t\t\t\t\tOwner:  pluginFullName.Owner(),\n\t\t\t\t\t\t\tPlugin: pluginFullName.Name(),\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)); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewPluginNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintf(container.Stdout(), \"Deleted %s.\\n\", pluginFullName); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/plugininfo/plugininfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 plugininfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/plugin>\",\n\t\tShort: \"Get a BSR plugin\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).\n\t\tV1Beta1PluginServiceClient(pluginFullName.Registry())\n\n\tpluginsResponse, err := pluginServiceClient.GetPlugins(ctx, connect.NewRequest(\n\t\t&pluginv1beta1.GetPluginsRequest{\n\t\t\tPluginRefs: []*pluginv1beta1.PluginRef{\n\t\t\t\t{\n\t\t\t\t\tValue: &pluginv1beta1.PluginRef_Name_{\n\t\t\t\t\t\tName: &pluginv1beta1.PluginRef_Name{\n\t\t\t\t\t\t\tOwner:  pluginFullName.Owner(),\n\t\t\t\t\t\t\tPlugin: pluginFullName.Name(),\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 err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewPluginNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tplugins := pluginsResponse.Msg.Plugins\n\tif len(plugins) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of plugins returned from server: %d\", len(plugins))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewPluginEntity(plugins[0], pluginFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabelarchive/pluginlabelarchive.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginlabelarchive\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/plugin:label>\",\n\t\tShort:      \"Archive a plugin label\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\t_ *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := pluginRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginFullName := pluginRef.FullName()\n\tlabelServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).V1Beta1LabelServiceClient(pluginFullName.Registry())\n\t// ArchiveLabelsResponse is empty.\n\tif _, err := labelServiceClient.ArchiveLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.ArchiveLabelsRequest{\n\t\t\t\tLabelRefs: []*pluginv1beta1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &pluginv1beta1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &pluginv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  pluginFullName.Owner(),\n\t\t\t\t\t\t\t\tPlugin: pluginFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Archived %s.\\n\", pluginRef)\n\treturn err\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabelinfo/pluginlabelinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginlabelinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/plugin:label>\",\n\t\tShort:      \"Show label information\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := pluginRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginClientProvider := bufregistryapiplugin.NewClientProvider(clientConfig)\n\tpluginFullName := pluginRef.FullName()\n\tlabelServiceClient := pluginClientProvider.V1Beta1LabelServiceClient(pluginFullName.Registry())\n\tresp, err := labelServiceClient.GetLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.GetLabelsRequest{\n\t\t\t\tLabelRefs: []*pluginv1beta1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &pluginv1beta1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &pluginv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  pluginFullName.Owner(),\n\t\t\t\t\t\t\t\tPlugin: pluginFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\tlabels := resp.Msg.Labels\n\tif len(labels) != 1 {\n\t\treturn syserror.Newf(\"expect 1 label from response, got %d\", len(labels))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewLabelEntity(labels[0], pluginFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabellist/pluginlabellist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginlabellist\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tarchiveStatusName = \"archive-status\"\n\tpageSizeFlagName  = \"page-size\"\n\tpageTokenFlagName = \"page-token\"\n\treverseFlagName   = \"reverse\"\n\tformatFlagName    = \"format\"\n\n\tdefaultPageSize = 10\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/plugin[:ref]>\",\n\t\tShort:      \"List plugin labels\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tArchiveStatus string\n\tPageSize      uint32\n\tPageToken     string\n\tReverse       bool\n\tFormat        string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindArchiveStatus(flagSet, &f.ArchiveStatus, archiveStatusName)\n\tflagSet.Uint32Var(\n\t\t&f.PageSize,\n\t\tpageSizeFlagName,\n\t\tdefaultPageSize,\n\t\t`The page size.`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.PageToken,\n\t\tpageTokenFlagName,\n\t\t\"\",\n\t\t`The page token. If more results are available, a \"next_page\" key is present in the --format=json output`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Reverse,\n\t\treverseFlagName,\n\t\tfalse,\n\t\t`Reverse the results`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tarchiveStatusFilter, err := bufcli.ArchiveStatusFlagToPluginArchiveStatusFilter(flags.ArchiveStatus)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginClientProvider := bufregistryapiplugin.NewClientProvider(clientConfig)\n\tpluginFullName := pluginRef.FullName()\n\tlabelServiceClient := pluginClientProvider.V1Beta1LabelServiceClient(pluginFullName.Registry())\n\torder := pluginv1beta1.ListLabelsRequest_ORDER_UPDATE_TIME_DESC\n\tif flags.Reverse {\n\t\torder = pluginv1beta1.ListLabelsRequest_ORDER_UPDATE_TIME_ASC\n\t}\n\tresp, err := labelServiceClient.ListLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.ListLabelsRequest{\n\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\tResourceRef: &pluginv1beta1.ResourceRef{\n\t\t\t\t\tValue: &pluginv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\tName: &pluginv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\tOwner:  pluginFullName.Owner(),\n\t\t\t\t\t\t\tPlugin: pluginFullName.Name(),\n\t\t\t\t\t\t\tChild: &pluginv1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\tRef: pluginRef.Ref(),\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\tOrder:         order,\n\t\t\t\tArchiveFilter: archiveStatusFilter,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\treturn bufprint.PrintPage(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tresp.Msg.NextPageToken,\n\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\txslices.Map(resp.Msg.Labels, func(label *pluginv1beta1.Label) bufprint.Entity {\n\t\t\treturn bufprint.NewLabelEntity(label, pluginFullName)\n\t\t}),\n\t)\n}\n\nfunc nextPageCommand(container appext.Container, flags *flags, nextPageToken string) string {\n\tif nextPageToken == \"\" {\n\t\treturn \"\"\n\t}\n\tcommand := fmt.Sprintf(\"buf registry plugin label list %s\", container.Arg(0))\n\tif flags.ArchiveStatus != bufcli.DefaultArchiveStatus {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, archiveStatusName, flags.ArchiveStatus)\n\t}\n\tif flags.PageSize != defaultPageSize {\n\t\tcommand = fmt.Sprintf(\"%s --%s %d\", command, pageSizeFlagName, flags.PageSize)\n\t}\n\tif flags.Reverse {\n\t\tcommand = fmt.Sprintf(\"%s --%s\", command, reverseFlagName)\n\t}\n\tif flags.Format != bufprint.FormatText.String() {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, formatFlagName, flags.Format)\n\t}\n\treturn fmt.Sprintf(\"%s --%s %s\", command, pageTokenFlagName, nextPageToken)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/pluginlabel/pluginlabelunarchive/pluginlabelunarchive.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginlabelunarchive\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/plugin:label>\",\n\t\tShort:      \"Unarchive a plugin label\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\t_ *flags,\n) error {\n\tpluginRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := pluginRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginFullName := pluginRef.FullName()\n\tlabelServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).V1Beta1LabelServiceClient(pluginFullName.Registry())\n\t// UnarchiveLabelsResponse is empty.\n\tif _, err := labelServiceClient.UnarchiveLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.UnarchiveLabelsRequest{\n\t\t\t\tLabelRefs: []*pluginv1beta1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &pluginv1beta1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &pluginv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  pluginFullName.Owner(),\n\t\t\t\t\t\t\t\tPlugin: pluginFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(pluginRef)\n\t\t}\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Unarchived %s.\\n\", pluginRef)\n\treturn err\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/plugin/pluginsettings/pluginsettingsupdate/pluginsettingsupdate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginsettingsupdate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tvisibilityFlagName  = \"visibility\"\n\tdescriptionFlagName = \"description\"\n\turlFlagName         = \"url\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/plugin>\",\n\t\tShort: \"Update BSR plugin settings\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tVisibility   string\n\tDescription  *string\n\tURL          *string\n\tDefaultLabel string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName, true)\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\tdescriptionFlagName,\n\t\t&f.Description,\n\t\t\"The new description for the plugin\",\n\t)\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\turlFlagName,\n\t\t&f.URL,\n\t\t\"The new URL for the plugin\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpluginFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tvisibility, err := bufcli.VisibilityFlagToPluginVisibilityAllowUnspecified(flags.Visibility)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar visibilityUpdate *pluginv1beta1.PluginVisibility\n\tif visibility != pluginv1beta1.PluginVisibility_PLUGIN_VISIBILITY_UNSPECIFIED {\n\t\tvisibilityUpdate = &visibility\n\t}\n\n\tpluginServiceClient := bufregistryapiplugin.NewClientProvider(clientConfig).\n\t\tV1Beta1PluginServiceClient(pluginFullName.Registry())\n\n\tpluginResponse, err := pluginServiceClient.UpdatePlugins(ctx, connect.NewRequest(\n\t\t&pluginv1beta1.UpdatePluginsRequest{\n\t\t\tValues: []*pluginv1beta1.UpdatePluginsRequest_Value{\n\t\t\t\t{\n\t\t\t\t\tPluginRef: &pluginv1beta1.PluginRef{\n\t\t\t\t\t\tValue: &pluginv1beta1.PluginRef_Name_{\n\t\t\t\t\t\t\tName: &pluginv1beta1.PluginRef_Name{\n\t\t\t\t\t\t\t\tOwner:  pluginFullName.Owner(),\n\t\t\t\t\t\t\t\tPlugin: pluginFullName.Name(),\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\tVisibility: visibilityUpdate,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t))\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewModuleNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tplugins := pluginResponse.Msg.Plugins\n\tif len(plugins) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of plugins returned from server: %d\", len(plugins))\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Updated %s.\\n\", pluginFullName)\n\tif err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policycommit/policycommitaddlabel/policycommitaddlabel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policycommitaddlabel\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName = \"format\"\n\tlabelsFlagName = \"label\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/policy:commit> --label <label>\",\n\t\tShort:      \"Add labels to a commit\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n\tLabels []string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.Labels,\n\t\tlabelsFlagName,\n\t\tnil,\n\t\t\"The labels to add to the commit. Must have at least one\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif policyRef.Ref() == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"commit is required\")\n\t}\n\tcommitID := policyRef.Ref()\n\tif _, err := uuidutil.FromDashless(commitID); err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid commit: %w\", err)\n\t}\n\tlabels := flags.Labels\n\tif len(labels) == 0 {\n\t\treturn appcmd.NewInvalidArgumentError(\"must create at least one label\")\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyClientProvider := bufregistryapipolicy.NewClientProvider(clientConfig)\n\tlabelServiceClient := policyClientProvider.V1Beta1LabelServiceClient(policyRef.FullName().Registry())\n\trequestValues := xslices.Map(labels, func(label string) *policyv1beta1.CreateOrUpdateLabelsRequest_Value {\n\t\treturn &policyv1beta1.CreateOrUpdateLabelsRequest_Value{\n\t\t\tLabelRef: &policyv1beta1.LabelRef{\n\t\t\t\tValue: &policyv1beta1.LabelRef_Name_{\n\t\t\t\t\tName: &policyv1beta1.LabelRef_Name{\n\t\t\t\t\t\tOwner:  policyRef.FullName().Owner(),\n\t\t\t\t\t\tPolicy: policyRef.FullName().Name(),\n\t\t\t\t\t\tLabel:  label,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCommitId: commitID,\n\t\t}\n\t})\n\tresp, err := labelServiceClient.CreateOrUpdateLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.CreateOrUpdateLabelsRequest{\n\t\t\t\tValues: requestValues,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\t// Not explicitly handling error with connect.CodeNotFound as\n\t\t// it can be Policy or Commit not found error. May be caused by\n\t\t// a misformatted ID.\n\t\treturn err\n\t}\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\txslices.Map(resp.Msg.Labels, func(label *policyv1beta1.Label) bufprint.Entity {\n\t\t\treturn bufprint.NewLabelEntity(label, policyRef.FullName())\n\t\t})...,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policycommit/policycommitinfo/policycommitinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policycommitinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/repository:commit>\",\n\t\tShort:      \"Get commit information\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif policyRef.Ref() == \"\" {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"%q does not have a commit specified\", policyRef.String())\n\t}\n\tcommitID := policyRef.Ref()\n\tif _, err := uuidutil.FromDashless(commitID); err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid commit: %w\", err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitServiceClient := bufregistryapipolicy.NewClientProvider(clientConfig).V1Beta1CommitServiceClient(policyRef.FullName().Registry())\n\tresp, err := commitServiceClient.GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.GetCommitsRequest{\n\t\t\t\tResourceRefs: []*policyv1beta1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &policyv1beta1.ResourceRef_Id{\n\t\t\t\t\t\t\tId: policyRef.Ref(),\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 err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := resp.Msg.Commits\n\tif len(commits) != 1 {\n\t\treturn syserror.Newf(\"expect 1 commit from response, got %d\", len(commits))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewCommitEntity(commits[0], policyRef.FullName(), \"\"), // No source control URL for policy commits\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policycommit/policycommitlist/policycommitlist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policycommitlist\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tpageSizeFlagName          = \"page-size\"\n\tpageTokenFlagName         = \"page-token\"\n\treverseFlagName           = \"reverse\"\n\tformatFlagName            = \"format\"\n\tdigestChangesOnlyFlagName = \"digest-changes-only\"\n\n\tdefaultPageSize = 10\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/policy[:ref]>\",\n\t\tShort: \"List policy's commits\",\n\t\tLong: `This command lists commits in a policy based on the reference specified.\nFor a commit reference, it lists the commit itself.\nFor a label reference, it lists the current and past commits associated with this label.\nIf no reference is specified, it lists all commits in this policy.\n`,\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat    string\n\tPageSize  uint32\n\tPageToken string\n\tReverse   bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.Uint32Var(\n\t\t&f.PageSize,\n\t\tpageSizeFlagName,\n\t\tdefaultPageSize,\n\t\t`The page size`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.PageToken,\n\t\tpageTokenFlagName,\n\t\t\"\",\n\t\t`The page token. If more results are available, a \"next_page\" key is present in the --format=json output`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Reverse,\n\t\treverseFlagName,\n\t\tfalse,\n\t\t`Reverse the results. By default, they are ordered with the newest first`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\t// TODO: Add support for DigestChangesOnly.\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tregistry := policyRef.FullName().Registry()\n\tpolicyClientProvider := bufregistryapipolicy.NewClientProvider(clientConfig)\n\tcommitServiceClient := policyClientProvider.V1Beta1CommitServiceClient(registry)\n\tlabelServiceClient := policyClientProvider.V1Beta1LabelServiceClient(registry)\n\tresourceServiceClient := policyClientProvider.V1Beta1ResourceServiceClient(registry)\n\n\tresourceResp, err := resourceServiceClient.GetResources(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.GetResourcesRequest{\n\t\t\t\tResourceRefs: []*policyv1beta1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &policyv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &policyv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  policyRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tPolicy: policyRef.FullName().Name(),\n\t\t\t\t\t\t\t\tChild: &policyv1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\t\tRef: policyRef.Ref(),\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\tresources := resourceResp.Msg.Resources\n\tif len(resources) != 1 {\n\t\treturn syserror.Newf(\"expect 1 resource from response, got %d\", len(resources))\n\t}\n\tresource := resources[0]\n\tif commit := resource.GetCommit(); commit != nil {\n\t\t// If the ref is a commit, the commit is the only result and there is no next page.\n\t\treturn bufprint.PrintPage(\n\t\t\tcontainer.Stdout(),\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t[]bufprint.Entity{bufprint.NewCommitEntity(commit, policyRef.FullName(), \"\")}, // No source control URL for policy commits\n\t\t)\n\t}\n\tif resource.GetPolicy() != nil {\n\t\t// The ref is a policy, ListCommits returns all the commits.\n\t\tcommitOrder := policyv1beta1.ListCommitsRequest_ORDER_CREATE_TIME_DESC\n\t\tif flags.Reverse {\n\t\t\tcommitOrder = policyv1beta1.ListCommitsRequest_ORDER_CREATE_TIME_ASC\n\t\t}\n\t\tresp, err := commitServiceClient.ListCommits(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\t&policyv1beta1.ListCommitsRequest{\n\t\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\t\tResourceRef: &policyv1beta1.ResourceRef{\n\t\t\t\t\t\tValue: &policyv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &policyv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  policyRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tPolicy: policyRef.FullName().Name(),\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\tOrder: commitOrder,\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\t\treturn bufcli.NewRefNotFoundError(policyRef)\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\treturn bufprint.PrintPage(\n\t\t\tcontainer.Stdout(),\n\t\t\tformat,\n\t\t\tresp.Msg.NextPageToken,\n\t\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\t\txslices.Map(resp.Msg.Commits, func(commit *policyv1beta1.Commit) bufprint.Entity {\n\t\t\t\treturn bufprint.NewCommitEntity(commit, policyRef.FullName(), \"\") // No source control URL for policy commits\n\t\t\t}),\n\t\t)\n\t}\n\tlabel := resource.GetLabel()\n\tif label == nil {\n\t\t// This should be impossible because getLabelOrCommitForRef would've returned an error.\n\t\treturn syserror.Newf(\"%s is neither a commit nor a label\", policyRef.String())\n\t}\n\t// The ref is a label. Call ListLabelHistory to get all commits.\n\tlabelHistoryOrder := policyv1beta1.ListLabelHistoryRequest_ORDER_DESC\n\tif flags.Reverse {\n\t\tlabelHistoryOrder = policyv1beta1.ListLabelHistoryRequest_ORDER_ASC\n\t}\n\tresp, err := labelServiceClient.ListLabelHistory(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.ListLabelHistoryRequest{\n\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\tLabelRef: &policyv1beta1.LabelRef{\n\t\t\t\t\tValue: &policyv1beta1.LabelRef_Name_{\n\t\t\t\t\t\tName: &policyv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\tOwner:  policyRef.FullName().Owner(),\n\t\t\t\t\t\t\tPolicy: policyRef.FullName().Name(),\n\t\t\t\t\t\t\tLabel:  policyRef.Ref(),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tOrder: labelHistoryOrder,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\t// This should be impossible since we just checked that the ref is a label.\n\t\t\treturn bufcli.NewRefNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := xslices.Map(\n\t\tresp.Msg.Values,\n\t\tfunc(value *policyv1beta1.ListLabelHistoryResponse_Value) *policyv1beta1.Commit {\n\t\t\treturn value.Commit\n\t\t},\n\t)\n\treturn bufprint.PrintPage(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tresp.Msg.NextPageToken,\n\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\txslices.Map(commits, func(commit *policyv1beta1.Commit) bufprint.Entity {\n\t\t\treturn bufprint.NewCommitEntity(commit, policyRef.FullName(), \"\") // No source control URL for policy commits\n\t\t}),\n\t)\n}\n\nfunc nextPageCommand(container appext.Container, flags *flags, nextPageToken string) string {\n\tif nextPageToken == \"\" {\n\t\treturn \"\"\n\t}\n\tcommand := fmt.Sprintf(\"buf registry commit list %s\", container.Arg(0))\n\tif flags.PageSize != defaultPageSize {\n\t\tcommand = fmt.Sprintf(\"%s --%s %d\", command, pageSizeFlagName, flags.PageSize)\n\t}\n\tif flags.Reverse {\n\t\tcommand = fmt.Sprintf(\"%s --%s\", command, reverseFlagName)\n\t}\n\tif flags.Format != bufprint.FormatText.String() {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, formatFlagName, flags.Format)\n\t}\n\treturn fmt.Sprintf(\"%s --%s %s\", command, pageTokenFlagName, nextPageToken)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policycommit/policycommitresolve/policycommitresolve.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policycommitresolve\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/repository[:ref]>\",\n\t\tShort:      \"Resolve commit from a reference\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitServiceClient := bufregistryapipolicy.NewClientProvider(clientConfig).V1Beta1CommitServiceClient(policyRef.FullName().Registry())\n\tresp, err := commitServiceClient.GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.GetCommitsRequest{\n\t\t\t\tResourceRefs: []*policyv1beta1.ResourceRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &policyv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\t\tName: &policyv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\t\tOwner:  policyRef.FullName().Owner(),\n\t\t\t\t\t\t\t\tPolicy: policyRef.FullName().Name(),\n\t\t\t\t\t\t\t\tChild: &policyv1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\t\tRef: policyRef.Ref(),\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\tcommits := resp.Msg.Commits\n\tif len(commits) != 1 {\n\t\treturn syserror.Newf(\"expect 1 commit from response, got %d\", len(commits))\n\t}\n\tcommit := commits[0]\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewCommitEntity(commit, policyRef.FullName(), \"\"), // No source control URL for policy commits\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policycreate/policycreate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policycreate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName      = \"format\"\n\tvisibilityFlagName  = \"visibility\"\n\tdefaultLabeFlagName = \"default-label-name\"\n\n\tdefaultDefaultLabel = \"main\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/policy>\",\n\t\tShort: \"Create a BSR policy\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat       string\n\tVisibility   string\n\tDefaultLabel string\n\tType         string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName, false)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tflagSet.StringVar(\n\t\t&f.DefaultLabel,\n\t\tdefaultLabeFlagName,\n\t\tdefaultDefaultLabel,\n\t\t\"The default label name of the module\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tvisibility, err := bufcli.VisibilityFlagToPolicyVisibilityAllowUnspecified(flags.Visibility)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyServiceClient := bufregistryapipolicy.NewClientProvider(clientConfig).\n\t\tV1Beta1PolicyServiceClient(policyFullName.Registry())\n\n\tpolicyResponse, err := policyServiceClient.CreatePolicies(ctx, connect.NewRequest(\n\t\t&policyv1beta1.CreatePoliciesRequest{\n\t\t\tValues: []*policyv1beta1.CreatePoliciesRequest_Value{\n\t\t\t\t{\n\t\t\t\t\tOwnerRef: &ownerv1.OwnerRef{\n\t\t\t\t\t\tValue: &ownerv1.OwnerRef_Name{\n\t\t\t\t\t\t\tName: policyFullName.Owner(),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tName:       policyFullName.Name(),\n\t\t\t\t\tVisibility: visibility,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t))\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeAlreadyExists {\n\t\t\treturn bufcli.NewPolicyNameAlreadyExistsError(policyFullName.String())\n\t\t}\n\t\treturn err\n\t}\n\tpolicys := policyResponse.Msg.Policies\n\tif len(policys) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of policies returned from server: %d\", len(policys))\n\t}\n\tif format == bufprint.FormatText {\n\t\t_, err = fmt.Fprintf(container.Stdout(), \"Created %s.\\n\", policyFullName)\n\t\tif err != nil {\n\t\t\treturn syserror.Wrap(err)\n\t\t}\n\t\treturn nil\n\t}\n\treturn bufprint.PrintNames(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewPolicyEntity(policys[0], policyFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policydelete/policydelete.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policydelete\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst forceFlagName = \"force\"\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/policy>\",\n\t\tShort: \"Delete a BSR policy\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tForce bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.BoolVar(\n\t\t&f.Force,\n\t\tforceFlagName,\n\t\tfalse,\n\t\t\"Force deletion without confirming. Use with caution\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif !flags.Force {\n\t\tif err := bufcli.PromptUserForDelete(container, \"entity\", policyFullName.Name()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyServiceClient := bufregistryapipolicy.NewClientProvider(clientConfig).\n\t\tV1Beta1PolicyServiceClient(policyFullName.Registry())\n\n\tif _, err := policyServiceClient.DeletePolicies(ctx, connect.NewRequest(\n\t\t&policyv1beta1.DeletePoliciesRequest{\n\t\t\tPolicyRefs: []*policyv1beta1.PolicyRef{\n\t\t\t\t{\n\t\t\t\t\tValue: &policyv1beta1.PolicyRef_Name_{\n\t\t\t\t\t\tName: &policyv1beta1.PolicyRef_Name{\n\t\t\t\t\t\t\tOwner:  policyFullName.Owner(),\n\t\t\t\t\t\t\tPolicy: policyFullName.Name(),\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)); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewPolicyNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tif _, err := fmt.Fprintf(container.Stdout(), \"Deleted %s.\\n\", policyFullName); err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policyinfo/policyinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policyinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/policy>\",\n\t\tShort: \"Get a BSR policy\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicieserviceClient := bufregistryapipolicy.NewClientProvider(clientConfig).\n\t\tV1Beta1PolicyServiceClient(policyFullName.Registry())\n\n\tpoliciesResponse, err := policieserviceClient.GetPolicies(ctx, connect.NewRequest(\n\t\t&policyv1beta1.GetPoliciesRequest{\n\t\t\tPolicyRefs: []*policyv1beta1.PolicyRef{\n\t\t\t\t{\n\t\t\t\t\tValue: &policyv1beta1.PolicyRef_Name_{\n\t\t\t\t\t\tName: &policyv1beta1.PolicyRef_Name{\n\t\t\t\t\t\t\tOwner:  policyFullName.Owner(),\n\t\t\t\t\t\t\tPolicy: policyFullName.Name(),\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 err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewPolicyNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tpolicies := policiesResponse.Msg.Policies\n\tif len(policies) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of policies returned from server: %d\", len(policies))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewPolicyEntity(policies[0], policyFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policylabel/policylabelarchive/policylabelarchive.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policylabelarchive\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/policy:label>\",\n\t\tShort:      \"Archive a policy label\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\t_ *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := policyRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyFullName := policyRef.FullName()\n\tlabelServiceClient := bufregistryapipolicy.NewClientProvider(clientConfig).V1Beta1LabelServiceClient(policyFullName.Registry())\n\t// ArchiveLabelsResponse is empty.\n\tif _, err := labelServiceClient.ArchiveLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.ArchiveLabelsRequest{\n\t\t\t\tLabelRefs: []*policyv1beta1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &policyv1beta1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &policyv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  policyFullName.Owner(),\n\t\t\t\t\t\t\t\tPolicy: policyFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Archived %s.\\n\", policyRef)\n\treturn err\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policylabel/policylabelinfo/policylabelinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policylabelinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst formatFlagName = \"format\"\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/policy:label>\",\n\t\tShort:      \"Show label information\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := policyRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyClientProvider := bufregistryapipolicy.NewClientProvider(clientConfig)\n\tpolicyFullName := policyRef.FullName()\n\tlabelServiceClient := policyClientProvider.V1Beta1LabelServiceClient(policyFullName.Registry())\n\tresp, err := labelServiceClient.GetLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.GetLabelsRequest{\n\t\t\t\tLabelRefs: []*policyv1beta1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &policyv1beta1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &policyv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  policyFullName.Owner(),\n\t\t\t\t\t\t\t\tPolicy: policyFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\tlabels := resp.Msg.Labels\n\tif len(labels) != 1 {\n\t\treturn syserror.Newf(\"expect 1 label from response, got %d\", len(labels))\n\t}\n\treturn bufprint.PrintEntity(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tbufprint.NewLabelEntity(labels[0], policyFullName),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policylabel/policylabellist/policylabellist.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policylabellist\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tarchiveStatusName = \"archive-status\"\n\tpageSizeFlagName  = \"page-size\"\n\tpageTokenFlagName = \"page-token\"\n\treverseFlagName   = \"reverse\"\n\tformatFlagName    = \"format\"\n\n\tdefaultPageSize = 10\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/policy[:ref]>\",\n\t\tShort:      \"List policy labels\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tArchiveStatus string\n\tPageSize      uint32\n\tPageToken     string\n\tReverse       bool\n\tFormat        string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindArchiveStatus(flagSet, &f.ArchiveStatus, archiveStatusName)\n\tflagSet.Uint32Var(\n\t\t&f.PageSize,\n\t\tpageSizeFlagName,\n\t\tdefaultPageSize,\n\t\t`The page size.`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.PageToken,\n\t\tpageTokenFlagName,\n\t\t\"\",\n\t\t`The page token. If more results are available, a \"next_page\" key is present in the --format=json output`,\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Reverse,\n\t\treverseFlagName,\n\t\tfalse,\n\t\t`Reverse the results`,\n\t)\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tarchiveStatusFilter, err := bufcli.ArchiveStatusFlagToPolicyArchiveStatusFilter(flags.ArchiveStatus)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyClientProvider := bufregistryapipolicy.NewClientProvider(clientConfig)\n\tpolicyFullName := policyRef.FullName()\n\tlabelServiceClient := policyClientProvider.V1Beta1LabelServiceClient(policyFullName.Registry())\n\torder := policyv1beta1.ListLabelsRequest_ORDER_UPDATE_TIME_DESC\n\tif flags.Reverse {\n\t\torder = policyv1beta1.ListLabelsRequest_ORDER_UPDATE_TIME_ASC\n\t}\n\tresp, err := labelServiceClient.ListLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.ListLabelsRequest{\n\t\t\t\tPageSize:  flags.PageSize,\n\t\t\t\tPageToken: flags.PageToken,\n\t\t\t\tResourceRef: &policyv1beta1.ResourceRef{\n\t\t\t\t\tValue: &policyv1beta1.ResourceRef_Name_{\n\t\t\t\t\t\tName: &policyv1beta1.ResourceRef_Name{\n\t\t\t\t\t\t\tOwner:  policyFullName.Owner(),\n\t\t\t\t\t\t\tPolicy: policyFullName.Name(),\n\t\t\t\t\t\t\tChild: &policyv1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\t\tRef: policyRef.Ref(),\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\tOrder:         order,\n\t\t\t\tArchiveFilter: archiveStatusFilter,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewRefNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\treturn bufprint.PrintPage(\n\t\tcontainer.Stdout(),\n\t\tformat,\n\t\tresp.Msg.NextPageToken,\n\t\tnextPageCommand(container, flags, resp.Msg.NextPageToken),\n\t\txslices.Map(resp.Msg.Labels, func(label *policyv1beta1.Label) bufprint.Entity {\n\t\t\treturn bufprint.NewLabelEntity(label, policyFullName)\n\t\t}),\n\t)\n}\n\nfunc nextPageCommand(container appext.Container, flags *flags, nextPageToken string) string {\n\tif nextPageToken == \"\" {\n\t\treturn \"\"\n\t}\n\tcommand := fmt.Sprintf(\"buf registry policy label list %s\", container.Arg(0))\n\tif flags.ArchiveStatus != bufcli.DefaultArchiveStatus {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, archiveStatusName, flags.ArchiveStatus)\n\t}\n\tif flags.PageSize != defaultPageSize {\n\t\tcommand = fmt.Sprintf(\"%s --%s %d\", command, pageSizeFlagName, flags.PageSize)\n\t}\n\tif flags.Reverse {\n\t\tcommand = fmt.Sprintf(\"%s --%s\", command, reverseFlagName)\n\t}\n\tif flags.Format != bufprint.FormatText.String() {\n\t\tcommand = fmt.Sprintf(\"%s --%s %s\", command, formatFlagName, flags.Format)\n\t}\n\treturn fmt.Sprintf(\"%s --%s %s\", command, pageTokenFlagName, nextPageToken)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policylabel/policylabelunarchive/policylabelunarchive.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policylabelunarchive\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name + \" <remote/owner/policy:label>\",\n\t\tShort:      \"Unarchive a policy label\",\n\t\tArgs:       appcmd.ExactArgs(1),\n\t\tDeprecated: deprecated,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\t_ *flags,\n) error {\n\tpolicyRef, err := bufparse.ParseRef(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tlabelName := policyRef.Ref()\n\tif labelName == \"\" {\n\t\treturn appcmd.NewInvalidArgumentError(\"label is required\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpolicyFullName := policyRef.FullName()\n\tlabelServiceClient := bufregistryapipolicy.NewClientProvider(clientConfig).V1Beta1LabelServiceClient(policyFullName.Registry())\n\t// UnarchiveLabelsResponse is empty.\n\tif _, err := labelServiceClient.UnarchiveLabels(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.UnarchiveLabelsRequest{\n\t\t\t\tLabelRefs: []*policyv1beta1.LabelRef{\n\t\t\t\t\t{\n\t\t\t\t\t\tValue: &policyv1beta1.LabelRef_Name_{\n\t\t\t\t\t\t\tName: &policyv1beta1.LabelRef_Name{\n\t\t\t\t\t\t\t\tOwner:  policyFullName.Owner(),\n\t\t\t\t\t\t\t\tPolicy: policyFullName.Name(),\n\t\t\t\t\t\t\t\tLabel:  labelName,\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); err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewLabelNotFoundError(policyRef)\n\t\t}\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Unarchived %s.\\n\", policyRef)\n\treturn err\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/policy/policysettings/policysettingsupdate/policysettingsupdate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 policysettingsupdate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tvisibilityFlagName  = \"visibility\"\n\tdescriptionFlagName = \"description\"\n\turlFlagName         = \"url\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(name string, builder appext.SubCommandBuilder) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <remote/owner/policy>\",\n\t\tShort: \"Update BSR policy settings\",\n\t\tArgs:  appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tVisibility   string\n\tDescription  *string\n\tURL          *string\n\tDefaultLabel string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName, true)\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\tdescriptionFlagName,\n\t\t&f.Description,\n\t\t\"The new description for the policy\",\n\t)\n\tbufcli.BindStringPointer(\n\t\tflagSet,\n\t\turlFlagName,\n\t\t&f.URL,\n\t\t\"The new URL for the policy\",\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tpolicyFullName, err := bufparse.ParseFullName(container.Arg(0))\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tvisibility, err := bufcli.VisibilityFlagToPolicyVisibilityAllowUnspecified(flags.Visibility)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar visibilityUpdate *policyv1beta1.PolicyVisibility\n\tif visibility != policyv1beta1.PolicyVisibility_POLICY_VISIBILITY_UNSPECIFIED {\n\t\tvisibilityUpdate = &visibility\n\t}\n\n\tpolicyServiceClient := bufregistryapipolicy.NewClientProvider(clientConfig).\n\t\tV1Beta1PolicyServiceClient(policyFullName.Registry())\n\n\tpolicyResponse, err := policyServiceClient.UpdatePolicies(ctx, connect.NewRequest(\n\t\t&policyv1beta1.UpdatePoliciesRequest{\n\t\t\tValues: []*policyv1beta1.UpdatePoliciesRequest_Value{\n\t\t\t\t{\n\t\t\t\t\tPolicyRef: &policyv1beta1.PolicyRef{\n\t\t\t\t\t\tValue: &policyv1beta1.PolicyRef_Name_{\n\t\t\t\t\t\t\tName: &policyv1beta1.PolicyRef_Name{\n\t\t\t\t\t\t\t\tOwner:  policyFullName.Owner(),\n\t\t\t\t\t\t\t\tPolicy: policyFullName.Name(),\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\tVisibility: visibilityUpdate,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t))\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\treturn bufcli.NewModuleNotFoundError(container.Arg(0))\n\t\t}\n\t\treturn err\n\t}\n\tpolicys := policyResponse.Msg.Policies\n\tif len(policys) != 1 {\n\t\treturn syserror.Newf(\"unexpected number of policys returned from server: %d\", len(policys))\n\t}\n\t_, err = fmt.Fprintf(container.Stdout(), \"Updated %s.\\n\", policyFullName)\n\tif err != nil {\n\t\treturn syserror.Wrap(err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/registrycc/registrycc.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 registrycc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n\tdeprecated string,\n\thidden bool,\n\taliases ...string,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:        name,\n\t\tAliases:    aliases,\n\t\tShort:      \"Clear the registry cache\",\n\t\tArgs:       appcmd.NoArgs,\n\t\tDeprecated: deprecated,\n\t\tHidden:     hidden,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct{}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tfor _, cacheModuleRelDirPath := range bufcli.AllCacheRelDirPaths {\n\t\tdirPath := filepath.Join(container.CacheDirPath(), normalpath.Unnormalize(cacheModuleRelDirPath))\n\t\tfileInfo, err := os.Stat(dirPath)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn err\n\t\t}\n\t\tif !fileInfo.IsDir() {\n\t\t\treturn fmt.Errorf(\"expected %q to be a directory\", dirPath)\n\t\t}\n\t\tif err := os.RemoveAll(dirPath); err != nil {\n\t\t\treturn fmt.Errorf(\"could not remove %q: %w\", dirPath, err)\n\t\t}\n\t\tif _, err := container.Stderr().Write([]byte(\"deleted \" + dirPath + \"\\n\")); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/registrylogin/client.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 !darwin\n\npackage registrylogin\n\nimport \"os\"\n\nfunc getClientName() (string, error) {\n\treturn os.Hostname()\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/registrylogin/client_darwin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 darwin\n\npackage registrylogin\n\nimport (\n\t\"os\"\n\t\"strings\"\n)\n\nfunc getClientName() (string, error) {\n\thostname, err := os.Hostname()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t// macOS uses .local for the hostname.\n\thostname = strings.TrimSuffix(hostname, \".local\")\n\treturn hostname, nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/registrylogin/registrylogin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 registrylogin\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\t\"time\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufapp\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconnect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/buftransport\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n\t\"github.com/bufbuild/buf/private/pkg/oauth2\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/transport/http/httpclient\"\n\t\"github.com/cli/browser\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tusernameFlagName   = \"username\"\n\ttokenStdinFlagName = \"token-stdin\"\n\tpromptFlagName     = \"prompt\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" [domain]\",\n\t\tShort: `Log in to the Buf Schema Registry`,\n\t\tLong:  fmt.Sprintf(`This command will open a browser to complete the login process. Use the flags --%s or --%s to complete an alternative login flow. The token is saved to your %s file. The [domain] argument will default to %s if not specified.`, promptFlagName, tokenStdinFlagName, netrc.Filename, bufconnect.DefaultRemote),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tUsername   string\n\tTokenStdin bool\n\tPrompt     bool\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Username,\n\t\tusernameFlagName,\n\t\t\"\",\n\t\t\"The username to use.\",\n\t)\n\t_ = flagSet.MarkDeprecated(usernameFlagName, \"this flag is no longer needed as the username is automatically derived from the token\")\n\t_ = flagSet.MarkHidden(usernameFlagName)\n\tflagSet.BoolVar(\n\t\t&f.TokenStdin,\n\t\ttokenStdinFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t\"Read the token from stdin. This command prompts for a token by default. Exclusive with the flag --%s.\",\n\t\t\tpromptFlagName,\n\t\t),\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Prompt,\n\t\tpromptFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\n\t\t\t\"Prompt for the token. The device must be a TTY. Exclusive with the flag --%s.\",\n\t\t\ttokenStdinFlagName,\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\t// If a user sends a SIGINT to buf, the top-level application context is\n\t// cancelled and signal masks are reset. However, during an interactive\n\t// login the context is not respected; for example, it takes two SIGINTs\n\t// to interrupt the process.\n\n\t// Ideally we could just trigger an I/O timeout by setting the deadline on\n\t// stdin, but when stdin is connected to a terminal the underlying fd is in\n\t// blocking mode making it ineligible. As changing the mode of stdin is\n\t// dangerous, this change takes an alternate approach of simply returning\n\t// early.\n\n\t// Note that this does not gracefully handle the case where the terminal is\n\t// in no-echo mode, as is the case when prompting for a password\n\t// interactively.\n\terrC := make(chan error, 1)\n\tgo func() {\n\t\terrC <- inner(ctx, container, flags)\n\t\tclose(errC)\n\t}()\n\tselect {\n\tcase err := <-errC:\n\t\treturn err\n\tcase <-ctx.Done():\n\t\tctxErr := ctx.Err()\n\t\t// Otherwise we will print \"Failure: context canceled\".\n\t\tif errors.Is(ctxErr, context.Canceled) {\n\t\t\t// Otherwise the next terminal line will be on the same line as the\n\t\t\t// last output from buf.\n\t\t\tif _, err := fmt.Fprintln(container.Stdout()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\treturn ctxErr\n\t}\n}\n\nfunc inner(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tremote := bufconnect.DefaultRemote\n\tif container.NumArgs() == 1 {\n\t\tremote = container.Arg(0)\n\t\tif _, err := netext.ValidateHostname(remote); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif flags.TokenStdin && flags.Prompt {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"cannot use both --%s and --%s flags\", tokenStdinFlagName, promptFlagName)\n\t}\n\tvar token string\n\tif flags.TokenStdin {\n\t\tdata, err := io.ReadAll(container.Stdin())\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to read token from stdin: %w\", err)\n\t\t}\n\t\ttoken = string(data)\n\t} else if flags.Prompt {\n\t\tvar err error\n\t\ttoken, err = doPromptLogin(ctx, container, remote)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tvar err error\n\t\ttoken, err = doBrowserLogin(ctx, container, remote)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, errors.ErrUnsupported) {\n\t\t\t\treturn fmt.Errorf(\"unable to complete authorize device grant: %w\", err)\n\t\t\t}\n\t\t\ttoken, err = doPromptLogin(ctx, container, remote)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\t// Remove leading and trailing spaces from user-supplied token to avoid\n\t// common input errors such as trailing new lines, as-is the case of using\n\t// echo vs echo -n.\n\ttoken = strings.TrimSpace(token)\n\tif token == \"\" {\n\t\treturn errors.New(\"token cannot be empty string\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfigWithToken(container, token)\n\tif err != nil {\n\t\treturn err\n\t}\n\tauthnService := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewAuthnServiceClient)\n\tresp, err := authnService.GetCurrentUser(ctx, connect.NewRequest(&registryv1alpha1.GetCurrentUserRequest{}))\n\tif err != nil {\n\t\tif connectErr := new(connect.Error); errors.As(err, &connectErr) && connectErr.Code() == connect.CodeUnavailable {\n\t\t\treturn connectErr\n\t\t}\n\t\t// We don't want to use the default error from wrapError here if the error\n\t\t// an unauthenticated error.\n\t\treturn fmt.Errorf(\"invalid token provided for %s\", remote)\n\t}\n\tuser := resp.Msg.GetUser()\n\tif user == nil {\n\t\treturn syserror.New(\"no user found for registry login token\")\n\t}\n\tif err := netrc.PutMachines(\n\t\tcontainer,\n\t\tnetrc.NewMachine(\n\t\t\tremote,\n\t\t\tuser.GetUsername(),\n\t\t\ttoken,\n\t\t),\n\t); err != nil {\n\t\treturn err\n\t}\n\tif _, err := netrc.DeleteMachineForName(container, \"go.\"+remote); err != nil {\n\t\treturn err\n\t}\n\tnetrcFilePath, err := netrc.GetFilePath(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tloggedInMessage := fmt.Sprintf(\"Logged in as %s. Credentials saved to %s.\\n\", user.GetUsername(), netrcFilePath)\n\t// Unless we did not prompt at all, print a newline first\n\tif !flags.TokenStdin {\n\t\tloggedInMessage = \"\\n\" + loggedInMessage\n\t}\n\tif _, err := container.Stdout().Write([]byte(loggedInMessage)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// doPromptLogin prompts the user for a token.\nfunc doPromptLogin(\n\t_ context.Context,\n\tcontainer appext.Container,\n\tremote string,\n) (string, error) {\n\tif _, err := fmt.Fprintf(\n\t\tcontainer.Stdout(),\n\t\t\"Enter the BSR token created at https://%s/settings/user.\\n\\n\",\n\t\tremote,\n\t); err != nil {\n\t\treturn \"\", err\n\t}\n\tvar err error\n\ttoken, err := bufcli.PromptUserForPassword(container, \"Token: \")\n\tif err != nil {\n\t\tif errors.Is(err, bufcli.ErrNotATTY) {\n\t\t\treturn \"\", errors.New(\"cannot perform an interactive login from a non-TTY device\")\n\t\t}\n\t\treturn \"\", err\n\t}\n\treturn token, nil\n}\n\n// doBrowserLogin performs the device authorization grant flow via the browser.\nfunc doBrowserLogin(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tremote string,\n) (string, error) {\n\tclientName, err := getClientName()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\texternalConfig := bufapp.ExternalConfig{}\n\tif err := appext.ReadConfig(container, &externalConfig); err != nil {\n\t\treturn \"\", err\n\t}\n\tappConfig, err := bufapp.NewConfig(container, externalConfig)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tbaseURL := buftransport.PrependHTTPS(remote)\n\tif appConfig.TLS == nil {\n\t\tbaseURL = buftransport.PrependHTTP(remote)\n\t}\n\tclient := httpclient.NewClient(appConfig.TLS)\n\toauth2Client := oauth2.NewClient(baseURL, client)\n\t// Register the device.\n\tdeviceRegistration, err := oauth2Client.RegisterDevice(ctx, &oauth2.DeviceRegistrationRequest{\n\t\tClientName: clientName,\n\t})\n\tif err != nil {\n\t\tvar oauth2Err *oauth2.Error\n\t\tif errors.As(err, &oauth2Err) {\n\t\t\treturn \"\", fmt.Errorf(\"authorization failed: %s\", oauth2Err.ErrorDescription)\n\t\t}\n\t\treturn \"\", err\n\t}\n\t// Request a device authorization code.\n\tdeviceAuthorization, err := oauth2Client.AuthorizeDevice(ctx, &oauth2.DeviceAuthorizationRequest{\n\t\tClientID:     deviceRegistration.ClientID,\n\t\tClientSecret: deviceRegistration.ClientSecret,\n\t})\n\tif err != nil {\n\t\tvar oauth2Err *oauth2.Error\n\t\tif errors.As(err, &oauth2Err) {\n\t\t\treturn \"\", fmt.Errorf(\"authorization failed: %s\", oauth2Err.ErrorDescription)\n\t\t}\n\t\treturn \"\", err\n\t}\n\t// Open the browser to the verification URI.\n\tif err := browser.OpenURL(deviceAuthorization.VerificationURIComplete); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to open browser: %w\", err)\n\t}\n\tif _, err := fmt.Fprintf(\n\t\tcontainer.Stdout(),\n\t\t`Opening your browser to complete authorization process.\n\nIf your browser doesn't open automatically, please open this URL in a browser to complete the process:\n\n%s\n`,\n\t\tdeviceAuthorization.VerificationURIComplete,\n\t); err != nil {\n\t\treturn \"\", err\n\t}\n\t// Poll the token endpoint until the user has authorized the device.\n\tdeviceToken, err := oauth2Client.AccessDeviceToken(ctx, &oauth2.DeviceAccessTokenRequest{\n\t\tClientID:     deviceRegistration.ClientID,\n\t\tClientSecret: deviceRegistration.ClientSecret,\n\t\tDeviceCode:   deviceAuthorization.DeviceCode,\n\t\tGrantType:    oauth2.DeviceAuthorizationGrantType,\n\t}, oauth2.AccessDeviceTokenWithPollingInterval(time.Duration(deviceAuthorization.Interval)*time.Second))\n\tif err != nil {\n\t\tvar oauth2Err *oauth2.Error\n\t\tif errors.As(err, &oauth2Err) {\n\t\t\treturn \"\", fmt.Errorf(\"authorization failed: %s\", oauth2Err.ErrorDescription)\n\t\t}\n\t\treturn \"\", err\n\t}\n\treturn deviceToken.AccessToken, nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/registrylogout/registrylogout.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 registrylogout\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconnect\"\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n\t\"github.com/spf13/pflag\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" [domain]\",\n\t\tShort: `Log out of the Buf Schema Registry`,\n\t\tLong:  fmt.Sprintf(`This command removes any BSR credentials from your %s file. The [domain] argument will default to %s if not specified.`, netrc.Filename, bufconnect.DefaultRemote),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t}\n}\n\ntype flags struct {\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tremote := bufconnect.DefaultRemote\n\tif container.NumArgs() == 1 {\n\t\tremote = container.Arg(0)\n\t\tif _, err := netext.ValidateHostname(remote); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tmodified1, err := netrc.DeleteMachineForName(container, remote)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmodified2, err := netrc.DeleteMachineForName(container, \"go.\"+remote)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnetrcFilePath, err := netrc.GetFilePath(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tloggedOutMessage := fmt.Sprintf(\"All existing BSR credentials removed from %s\\n\", netrcFilePath)\n\tif !modified1 && !modified2 {\n\t\tloggedOutMessage = fmt.Sprintf(\"No BSR credentials found in %s; you are already logged out\\n\", netrcFilePath)\n\t}\n\tif _, err := container.Stdout().Write([]byte(loggedOutMessage)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/sdk/sdkinfo/sdkinfo.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 sdkinfo\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName  = \"format\"\n\tmoduleFlagName  = \"module\"\n\tpluginFlagName  = \"plugin\"\n\tversionFlagName = \"version\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" --module=<remote/owner/repository[:ref]> --plugin=<remote/owner/plugin[:version]>\",\n\t\tShort: \"Get SDK information for the given module, plugin, and optionally version.\",\n\t\tLong: `This command returns the version information for a Generated SDK based on the specified information.\nIn order to resolve the SDK information, a module and plugin must be specified.\n\nExamples:\n\nTo get the SDK information for the latest commit of a module and latest version of a plugin, you only need to specify the module and plugin.\nThe following will resolve the SDK information for the latest commit of the connectrpc/eliza module and the latest version of the bufbuild/es plugin:\n\n    $ buf registry sdk info --module=buf.build/connectrpc/eliza --plugin=buf.build/connectrpc/es\n    Module\n    Owner:  connectrpc\n    Name:   eliza\n    Commit: <latest commit on default label>\n\n    Plugin\n    Owner:    bufbuild\n    Name:     es\n    Version:  <latest version of plugin>\n    Revision: <latest revision of the plugin version>\n\n    Version: <SDK version for the resolved module commit and plugin version>\n\nTo get the SDK information for a specific commit of a module and/or a specific version of a plugin, you can specify the commit with the module and/or the version with the plugin.\nThe following will resolve the SDK information for the specified commit of the connectrpc/eliza module and specified version of the bufbuild/es plugin:\n\n    $ buf registry sdk info --module=buf.build/connectrpc/eliza:d8fbf2620c604277a0ece1ff3a26f2ff --plugin=buf.build/bufbuild/es:v1.2.1\n    Module\n    Owner:  connectrpc\n    Name:   eliza\n    Commit: d8fbf2620c604277a0ece1ff3a26f2ff\n\n    Plugin\n    Owner:    bufbuild\n    Name:     es\n    Version:  v1.2.1\n    Revision: 1\n\n    Version: 1.2.1-20230727062025-d8fbf2620c60.1\n\nIf you have a SDK version and want to know the corresponding module commit and plugin version information for the SDK, you can specify the module and plugin with the version string.\nThe following will resolve the SDK information for the specified SDK version of the connectrpc/eliza module and bufbuild/es plugin.\n\n    $ buf registry sdk --module=buf.build/connectrpc/eliza --plugin=buf.build/bufbuild/es --version=1.2.1-20230727062025-d8fbf2620c60.1\n    Module\n    Owner:  connectrpc\n    Name:   eliza\n    Commit: d8fbf2620c604277a0ece1ff3a26f2ff\n\n    Plugin\n    Owner:    bufbuild\n    Name:     es\n    Version:  v1.2.1\n    Revision: 1\n\n    Version: 1.2.1-20230727062025-d8fbf2620c60.1\n\nThe module commit and plugin version information are resolved based on the specified SDK version string.\n\nIf a module reference and/or plugin version are specified along with the SDK version, then the SDK version will be validated against the specified module reference and/or plugin version.\nIf there is a mismatch, this command will error.\n\n    $ buf registry sdk info  \\\n        --module=buf.build/connectrpc/eliza:8b8b971d6fde4dc8ba5d96f9fda7d53c   \\\n        --plugin=buf.build/bufbuild/es  \\\n        --version=1.2.1-20230727062025-d8fbf2620c60.1\n    Failure: invalid_argument: invalid SDK version v1.2.1-20230727062025-d8fbf2620c60.1 with module short commit d8fbf2620c60 for resolved module reference connectrpc/eliza:8b8b971d6fde4dc8ba5d96f9fda7d53c\n\nIn this case, the SDK version provided resolves to a different commit than the commit provided for the module.`,\n\t\tArgs: appcmd.NoArgs,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat  string\n\tModule  string\n\tPlugin  string\n\tVersion string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(\"The output format to use. Must be one of %s\", bufprint.AllFormatsString),\n\t)\n\tflagSet.StringVar(&f.Module, moduleFlagName, \"\", \"The module reference for the SDK.\")\n\tflagSet.StringVar(&f.Plugin, pluginFlagName, \"\", \"The plugin reference for the SDK.\")\n\tflagSet.StringVar(&f.Version, versionFlagName, \"\", \"The version of the SDK.\")\n\t_ = appcmd.MarkFlagRequired(flagSet, moduleFlagName)\n\t_ = appcmd.MarkFlagRequired(flagSet, pluginFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(flags.Module)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tpluginIdentity, pluginVersion, err := bufremotepluginref.ParsePluginIdentityOptionalVersion(flags.Plugin)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif moduleRef.FullName().Registry() != pluginIdentity.Remote() {\n\t\treturn appcmd.NewInvalidArgumentError(\"module and plugin must be from the same BSR instance\")\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresolveServiceClient := connectclient.Make(\n\t\tclientConfig,\n\t\tmoduleRef.FullName().Registry(),\n\t\tregistryv1alpha1connect.NewResolveServiceClient,\n\t)\n\tres, err := resolveServiceClient.GetSDKInfo(\n\t\tctx,\n\t\tconnect.NewRequest(registryv1alpha1.GetSDKInfoRequest_builder{\n\t\t\tModuleReference: registryv1alpha1.LocalModuleReference_builder{\n\t\t\t\tOwner:      moduleRef.FullName().Owner(),\n\t\t\t\tRepository: moduleRef.FullName().Name(),\n\t\t\t\tReference:  moduleRef.Ref(),\n\t\t\t}.Build(),\n\t\t\tPluginReference: registryv1alpha1.GetRemotePackageVersionPlugin_builder{\n\t\t\t\tOwner:   pluginIdentity.Owner(),\n\t\t\t\tName:    pluginIdentity.Plugin(),\n\t\t\t\tVersion: pluginVersion,\n\t\t\t}.Build(),\n\t\t\tSdkVersion: flags.Version,\n\t\t}.Build()),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn bufprint.NewSDKInfoPrinter(container.Stdout()).PrintSDKInfo(\n\t\tctx,\n\t\tformat,\n\t\tres.Msg,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/sdk/version/version.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 version\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tpluginFlagName = \"plugin\"\n\tmoduleFlagName = \"module\"\n)\n\n// NewCommand returns a new Command\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" --module=<buf.build/owner/repository[:ref]> --plugin=<buf.build/owner/plugin[:version]>\",\n\t\tShort: \"Resolve module and plugin reference to a specific Generated SDK version\",\n\t\tLong: `This command returns the version of the Generated SDK for the given module and plugin.\nExamples:\n\nGet the version of the eliza module and the go plugin for use with the Go module proxy.\n    $ buf registry sdk version --module=buf.build/connectrpc/eliza --plugin=buf.build/protocolbuffers/go\n    v1.33.0-20230913231627-233fca715f49.1\n\nUse a specific module version and plugin version.\n    $ buf registry sdk version --module=buf.build/connectrpc/eliza:233fca715f49425581ec0a1b660be886 --plugin=buf.build/protocolbuffers/go:v1.32.0\n    v1.32.0-20230913231627-233fca715f49.1`,\n\t\tArgs: appcmd.NoArgs,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\n// TODO FUTURE: Add a --format flag, supports text (current behavior) and json, json will output information\n// such as resolved module commit, plugin version and revision, package-ecosystem, and full version.\n\ntype flags struct {\n\tPlugin string\n\tModule string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(&f.Module, moduleFlagName, \"\", \"The module reference to resolve\")\n\tflagSet.StringVar(&f.Plugin, pluginFlagName, \"\", \"The plugin reference to resolve\")\n\t_ = appcmd.MarkFlagRequired(flagSet, moduleFlagName)\n\t_ = appcmd.MarkFlagRequired(flagSet, pluginFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tmoduleRef, err := bufparse.ParseRef(flags.Module)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tpluginIdentity, pluginVersion, err := bufremotepluginref.ParsePluginIdentityOptionalVersion(flags.Plugin)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tif pluginIdentity.Remote() != moduleRef.FullName().Registry() {\n\t\treturn appcmd.NewInvalidArgumentError(\"module and plugin must be from the same BSR instance\")\n\t}\n\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginCurationServiceClient := connectclient.Make(\n\t\tclientConfig,\n\t\tmoduleRef.FullName().Registry(),\n\t\tregistryv1alpha1connect.NewPluginCurationServiceClient,\n\t)\n\tresolveServiceClient := connectclient.Make(\n\t\tclientConfig,\n\t\tmoduleRef.FullName().Registry(),\n\t\tregistryv1alpha1connect.NewResolveServiceClient,\n\t)\n\tgetLatestCuratedPluginResponse, err := pluginCurationServiceClient.GetLatestCuratedPlugin(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\tregistryv1alpha1.GetLatestCuratedPluginRequest_builder{\n\t\t\t\tOwner:   pluginIdentity.Owner(),\n\t\t\t\tName:    pluginIdentity.Plugin(),\n\t\t\t\tVersion: pluginVersion,\n\t\t\t}.Build(),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpluginRegistryType := getLatestCuratedPluginResponse.Msg.GetPlugin().GetRegistryType()\n\tif pluginRegistryType == 0 {\n\t\treturn fmt.Errorf(\"plugin %q is not associated with a package ecosystem\", flags.Plugin)\n\t}\n\tmoduleReference := registryv1alpha1.LocalModuleReference_builder{\n\t\tOwner:      moduleRef.FullName().Owner(),\n\t\tRepository: moduleRef.FullName().Name(),\n\t\tReference:  moduleRef.Ref(),\n\t}.Build()\n\tpluginReference := registryv1alpha1.GetRemotePackageVersionPlugin_builder{\n\t\tOwner:   pluginIdentity.Owner(),\n\t\tName:    pluginIdentity.Plugin(),\n\t\tVersion: pluginVersion,\n\t}.Build()\n\tvar version string\n\tswitch pluginRegistryType {\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_GO:\n\t\tgoVersionResponse, err := resolveServiceClient.GetGoVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetGoVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = goVersionResponse.Msg.GetVersion()\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_NPM:\n\t\tnpmVersionResponse, err := resolveServiceClient.GetNPMVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetNPMVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = npmVersionResponse.Msg.GetVersion()\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_MAVEN:\n\t\tmavenVersionResponse, err := resolveServiceClient.GetMavenVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetMavenVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = mavenVersionResponse.Msg.GetVersion()\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_SWIFT:\n\t\tswiftVersionResponse, err := resolveServiceClient.GetSwiftVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetSwiftVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = swiftVersionResponse.Msg.GetVersion()\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_PYTHON:\n\t\tpythonVersionResponse, err := resolveServiceClient.GetPythonVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetPythonVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = pythonVersionResponse.Msg.GetVersion()\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_CARGO:\n\t\tcargoVersionResponse, err := resolveServiceClient.GetCargoVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetCargoVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = cargoVersionResponse.Msg.GetVersion()\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_NUGET:\n\t\tnugetVersionResponse, err := resolveServiceClient.GetNugetVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetNugetVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = nugetVersionResponse.Msg.GetVersion()\n\tcase registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_CMAKE:\n\t\tcmakeVersionResponse, err := resolveServiceClient.GetCmakeVersion(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\tregistryv1alpha1.GetCmakeVersionRequest_builder{\n\t\t\t\t\tModuleReference: moduleReference,\n\t\t\t\t\tPluginReference: pluginReference,\n\t\t\t\t}.Build(),\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tversion = cmakeVersionResponse.Msg.GetVersion()\n\tdefault:\n\t\treturn syserror.Newf(\"unknown PluginRegistryType: %v\", pluginRegistryType)\n\t}\n\n\tif _, err := container.Stdout().Write([]byte(version + \"\\n\")); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/registry/whoami/whoami.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 whoami\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconnect\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName = \"format\"\n\n\tloginCommand = \"buf registry login\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <domain>\",\n\t\tShort: `Check if you are logged in to the Buf Schema Registry`,\n\t\tLong: `This command checks if you are currently logged into the Buf Schema Registry at the provided <domain>.\nThe <domain> argument will default to buf.build if not specified.`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tremote := bufconnect.DefaultRemote\n\tif container.NumArgs() == 1 {\n\t\tremote = container.Arg(0)\n\t\tif _, err := netext.ValidateHostname(remote); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tclientConfig, err := bufcli.NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tauthnService := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewAuthnServiceClient)\n\tcurrentUserResponse, err := authnService.GetCurrentUser(ctx, connect.NewRequest(&registryv1alpha1.GetCurrentUserRequest{}))\n\tif err != nil {\n\t\tif connectErr := new(connect.Error); errors.As(err, &connectErr) && connectErr.Code() == connect.CodeUnauthenticated {\n\t\t\treturn fmt.Errorf(\"Not currently logged in for %s.\", remote)\n\t\t}\n\t\treturn err\n\t}\n\tuser := currentUserResponse.Msg.GetUser()\n\tif user == nil {\n\t\treturn fmt.Errorf(\n\t\t\t`No user is logged in to %s. Run %q to refresh your credentials. If you have the %s environment variable set, ensure that the token is valid.`,\n\t\t\tremote,\n\t\t\tloginCommandForRemote(remote),\n\t\t\tbufconnect.TokenEnvKey,\n\t\t)\n\t}\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\t// ParseFormat always expects a format that is either text or json, otherwise it returns\n\t// an error, so do not need a default case for this switch.\n\tswitch format {\n\tcase bufprint.FormatText:\n\t\t_, err = fmt.Fprintf(container.Stdout(), \"Logged in as %s.\\n\", user.GetUsername())\n\t\treturn err\n\tcase bufprint.FormatJSON:\n\t\treturn bufprint.PrintEntity(\n\t\t\tcontainer.Stdout(),\n\t\t\tformat,\n\t\t\tbufprint.NewUserEntity(user),\n\t\t)\n\t}\n\treturn nil\n}\n\n// loginCommandForRemote returns the login command for the given remote,\n// the default remote is excluded in the command.\nfunc loginCommandForRemote(remote string) string {\n\tif remote == bufconnect.DefaultRemote {\n\t\treturn loginCommand\n\t}\n\treturn fmt.Sprintf(\"%s %s\", loginCommand, remote)\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/source/sourceedit/sourceeditdeprecate/sourceeditdeprecate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 sourceeditdeprecate\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/buf/bufformat\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tconfigFlagName          = \"config\"\n\tdiffFlagName            = \"diff\"\n\tdiffFlagShortName       = \"d\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n\terrorFormatFlagName     = \"error-format\"\n\texcludePathsFlagName    = \"exclude-path\"\n\tpathsFlagName           = \"path\"\n\tprefixFlagName          = \"prefix\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <source>\",\n\t\tShort: \"Deprecate Protobuf types\",\n\t\tLong: `\nDeprecate Protobuf types by adding the 'deprecated = true' option.\n\nThe --prefix flag is required and specifies the fully-qualified name prefix of the\ntypes to deprecate. All types whose fully-qualified name starts with this prefix\nwill have the 'deprecated = true' option added. For fields and enum values, only\nexact matches are deprecated.\n\nReturns an error if no types match the specified prefixes. If matching types are\nalready deprecated, no changes are made and the command succeeds.\n\nBy default, the source is the current directory and files are formatted and rewritten in-place.\n\nExamples:\n\nDeprecate all types under a package prefix:\n\n    $ buf source edit deprecate --prefix foo.bar\n\nDeprecate a specific message and all nested types:\n\n    $ buf source edit deprecate --prefix foo.bar.MyMessage\n\nDeprecate a specific field:\n\n    $ buf source edit deprecate --prefix foo.bar.MyMessage.my_field\n\nMultiple --prefix flags can be specified:\n\n    $ buf source edit deprecate --prefix foo.bar --prefix baz.qux\n\nDisplay a diff of the changes instead of rewriting files:\n\n    $ buf source edit deprecate --prefix foo.bar -d\n`,\n\t\tArgs: appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tConfig          string\n\tDiff            bool\n\tDisableSymlinks bool\n\tErrorFormat     string\n\tExcludePaths    []string\n\tPaths           []string\n\tPrefixes        []string\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n\tbufcli.BindPaths(flagSet, &f.Paths, pathsFlagName)\n\tbufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tflagSet.BoolVarP(\n\t\t&f.Diff,\n\t\tdiffFlagName,\n\t\tdiffFlagShortName,\n\t\tfalse,\n\t\t\"Display diffs instead of rewriting files\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ErrorFormat,\n\t\terrorFormatFlagName,\n\t\t\"text\",\n\t\tfmt.Sprintf(\n\t\t\t\"The format for build errors printed to stderr. Must be one of %s\",\n\t\t\txstrings.SliceToString(bufanalysis.AllFormatStrings),\n\t\t),\n\t)\n\tflagSet.StringVar(\n\t\t&f.Config,\n\t\tconfigFlagName,\n\t\t\"\",\n\t\t`The buf.yaml file or data to use for configuration`,\n\t)\n\tflagSet.StringSliceVar(\n\t\t&f.Prefixes,\n\t\tprefixFlagName,\n\t\tnil,\n\t\t`Required. The fully-qualified name prefix of types to deprecate. May be specified multiple times.`,\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, prefixFlagName)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) (retErr error) {\n\tsource, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We use getDirOrProtoFileRef to see if we have a valid DirOrProtoFileRef.\n\t// This is needed to write files in-place.\n\tsourceDirOrProtoFileRef, sourceDirOrProtoFileRefErr := getDirOrProtoFileRef(ctx, container, source)\n\tif sourceDirOrProtoFileRefErr != nil {\n\t\tif errors.Is(sourceDirOrProtoFileRefErr, buffetch.ErrModuleFormatDetectedForDirOrProtoFileRef) {\n\t\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid input %q: must be a directory or proto file\", source)\n\t\t}\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"invalid input %q: %v\", source, sourceDirOrProtoFileRefErr)\n\t}\n\tif err := validateNoIncludePackageFiles(sourceDirOrProtoFileRef); err != nil {\n\t\treturn err\n\t}\n\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t\tbufctl.WithFileAnnotationErrorFormat(flags.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(\n\t\tctx,\n\t\tsource,\n\t\tbufctl.WithTargetPaths(flags.Paths, flags.ExcludePaths),\n\t\tbufctl.WithConfigOverride(flags.Config),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleReadBucket := bufmodule.ModuleReadBucketWithOnlyTargetFiles(\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFilesForTargetModules(workspace),\n\t)\n\toriginalReadBucket := bufmodule.ModuleReadBucketToStorageReadBucket(moduleReadBucket)\n\n\t// Build format options from all prefixes\n\tvar formatOpts []bufformat.FormatOption\n\tfor _, prefix := range flags.Prefixes {\n\t\tformatOpts = append(formatOpts, bufformat.WithDeprecate(prefix))\n\t}\n\n\tformattedReadBucket, err := bufformat.FormatBucket(ctx, originalReadBucket, formatOpts...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Find changed files. Only generate diff text if displaying diff.\n\tvar diffBuffer bytes.Buffer\n\tdiffWriter := io.Discard\n\tif flags.Diff {\n\t\tdiffWriter = &diffBuffer\n\t}\n\tchangedPaths, err := storage.DiffWithFilenames(\n\t\tctx,\n\t\tdiffWriter,\n\t\toriginalReadBucket,\n\t\tformattedReadBucket,\n\t\tstorage.DiffWithExternalPaths(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// If no files changed, the matched types were already deprecated. This is not an error.\n\t// Note: if no types matched the prefix at all, FormatBucket already returned an error above.\n\tif len(changedPaths) == 0 {\n\t\treturn nil\n\t}\n\tif flags.Diff {\n\t\tif _, err := io.Copy(container.Stdout(), &diffBuffer); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\n\t// Write files in-place (default behavior)\n\tchangedPathSet := xslices.ToStructMap(changedPaths)\n\treturn storage.WalkReadObjects(\n\t\tctx,\n\t\tformattedReadBucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tif _, ok := changedPathSet[readObject.Path()]; !ok {\n\t\t\t\t// no change, nothing to re-write\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tfile, err := os.OpenFile(readObject.ExternalPath(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer func() {\n\t\t\t\tretErr = errors.Join(retErr, file.Close())\n\t\t\t}()\n\t\t\tif _, err := file.ReadFrom(readObject); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\nfunc getDirOrProtoFileRef(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tvalue string,\n) (buffetch.DirOrProtoFileRef, error) {\n\treturn buffetch.NewDirOrProtoFileRefParser(\n\t\tcontainer.Logger(),\n\t).GetDirOrProtoFileRef(ctx, value)\n}\n\nfunc validateNoIncludePackageFiles(dirOrProtoFileRef buffetch.DirOrProtoFileRef) error {\n\tif protoFileRef, ok := dirOrProtoFileRef.(buffetch.ProtoFileRef); ok && protoFileRef.IncludePackageFiles() {\n\t\treturn appcmd.NewInvalidArgumentError(\"cannot specify include_package_files=true with source edit deprecate\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "cmd/buf/internal/command/stats/stats.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 stats\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/bufprint\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/protostat\"\n\t\"github.com/bufbuild/buf/private/pkg/protostat/protostatstorage\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tformatFlagName          = \"format\"\n\tdisableSymlinksFlagName = \"disable-symlinks\"\n)\n\n// NewCommand returns a new Command.\nfunc NewCommand(\n\tname string,\n\tbuilder appext.SubCommandBuilder,\n) *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <source>\",\n\t\tShort: \"Get statistics for a given source or module\",\n\t\tLong:  bufcli.GetSourceOrModuleLong(`the source or module to get statistics for`),\n\t\tArgs:  appcmd.MaximumNArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tFormat          string\n\tDisableSymlinks bool\n\n\t// special\n\tInputHashtag string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Format,\n\t\tformatFlagName,\n\t\tbufprint.FormatText.String(),\n\t\tfmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString),\n\t)\n\tbufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName)\n\tbufcli.BindInputHashtag(flagSet, &f.InputHashtag)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tformat, err := bufprint.ParseFormat(flags.Format)\n\tif err != nil {\n\t\treturn appcmd.WrapInvalidArgumentError(err)\n\t}\n\tinput, err := bufcli.GetInputValue(container, flags.InputHashtag, \".\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithDisableSymlinks(flags.DisableSymlinks),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tworkspace, err := controller.GetWorkspace(\n\t\tctx,\n\t\tinput,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tstats, err := protostat.GetStats(\n\t\tctx,\n\t\tprotostatstorage.NewFileWalker(\n\t\t\tbufmodule.ModuleReadBucketToStorageReadBucket(\n\t\t\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFilesForTargetModules(\n\t\t\t\t\tworkspace,\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn bufprint.NewStatsPrinter(container.Stdout()).PrintStats(\n\t\tctx,\n\t\tformat,\n\t\tstats,\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/internal/internaltesting/internaltesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internaltesting\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// CopyReadBucketToTempDir copies the ReadBucket to a new temporary directory.\n//\n// Returns the temporary directory path and a ReadWriteBucket of the temporary directory.\nfunc CopyReadBucketToTempDir(\n\tctx context.Context,\n\ttb testing.TB,\n\tstorageosProvider storageos.Provider,\n\treadBucket storage.ReadBucket,\n) (string, storage.ReadWriteBucket) {\n\t// Copy to temporary directory to avoid writing to filesystem\n\ttempDirPath := tb.TempDir()\n\treadWriteBucket, err := storageosProvider.NewReadWriteBucket(tempDirPath)\n\trequire.NoError(tb, err)\n\t_, err = storage.Copy(ctx, readBucket, readWriteBucket)\n\trequire.NoError(tb, err)\n\treturn tempDirPath, readWriteBucket\n}\n\n// NewEnvFunc returns a new env func for testing.\nfunc NewEnvFunc(tb testing.TB) func(string) map[string]string {\n\ttempDirPath := tb.TempDir()\n\treturn func(use string) map[string]string {\n\t\treturn map[string]string{\n\t\t\tuseEnvVar(use, \"CACHE_DIR\"):  tempDirPath,\n\t\t\tuseEnvVar(use, \"CONFIG_DIR\"): tempDirPath,\n\t\t\t\"PATH\":                       os.Getenv(\"PATH\"),\n\t\t}\n\t}\n}\n\nfunc useEnvVar(use string, suffix string) string {\n\treturn strings.ToUpper(use) + \"_\" + suffix\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/current/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto\n    name: buf.test/test/module\n  - path: vendor/protovalidate\nlint:\n  ignore:\n    - vendor/protovalidate\n    - proto/common/v1/breaking.proto\n    - proto/common/v1alpha1/breaking.proto\nplugins:\n  - plugin: buf-plugin-suffix\n    options:\n      service_banned_suffixes:\n        - Mock\n        - Test\n      rpc_banned_suffixes:\n        - Element\n      field_banned_suffixes:\n        - _uuid\n      enum_value_banned_suffixes:\n        - _INVALID\n      service_no_change_suffixes:\n        - Service\n      message_no_change_suffixes:\n        - Request\n        - Response\n      enum_no_change_suffixes:\n        - State\n  - plugin: buf-plugin-protovalidate-ext\n  - plugin: buf-plugin-rpc-ext\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/current/proto/api/v1/service.proto",
    "content": "syntax = \"proto3\";\n\npackage api.v1;\n\nservice FooService {\n  rpc GetFoo(GetFooRequest) returns (GetFooResponse);\n  rpc ListFoo(ListFooRequest) returns (ListFooResponse);\n}\n\n// buf:lint:ignore SERVICE_SUFFIX\nservice FooServiceMock {\n  rpc GetFoo(GetFooMockRequest) returns (GetFooMockResponse);\n}\n\n// buf:lint:ignore SERVICE_BANNED_SUFFIXES\nservice FooServiceTest {\n  rpc GetFoo(GetFooTestRequest) returns (GetFooTestResponse);\n}\n\nmessage GetFooRequest {}\nmessage GetFooResponse {}\nmessage ListFooRequest{\n  uint32 page_size = 1;\n  string page_token = 2;\n}\nmessage ListFooResponse{}\n\nmessage GetFooMockRequest {}\nmessage GetFooMockResponse {}\n\nmessage GetFooTestRequest {}\nmessage GetFooTestResponse {}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/current/proto/common/v1/breaking.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1;\n\nimport \"buf/validate/validate.proto\";\n\nmessage Three {\n  message Four {\n    string was_two = 1 [(buf.validate.field).string.max_len = 5];\n    string was_ten = 2 [(buf.validate.field).string.max_len = 5]; // breaking change, max len 10 -> 5\n  }\n}\n\nmessage MSG_DONT_CHANGE {\n  string new_field = 1;\n}\n\nenum E_DO_NOT_CHANGE {\n  ZERO = 0;\n  ONE = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/current/proto/common/v1/common.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1;\n\nmessage One {\n  message Two {\n    string id_foo = 1;\n    string foo_uuid = 2;\n  }\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/current/proto/common/v1alpha1/breaking.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1alpha1;\n\nimport \"buf/validate/validate.proto\";\n\nmessage Six {\n  message Seven {\n    string was_two = 1 [(buf.validate.field).string.max_len = 5];\n    string was_ten = 2 [(buf.validate.field).string.max_len = 5]; // breaking change, max len 10 -> 5\n  }\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/current/proto/common/v1alpha1/messages.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1alpha1;\n\nimport \"common/v1/common.proto\";\nimport \"buf/validate/validate.proto\";\n\nmessage Three {\n  common.v1.One one = 1;\n  string two = 2;\n}\n\nmessage Four {\n  string id = 1 [(buf.validate.field).string.tuuid = true];\n  message FourTwo {\n    string id = 1;\n  }\n}\n\nenum Five {\n  FIVE_UNSPECIFIED = 0;\n  FIVE_VALID = 1;\n  FIVE_INVALID = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/current/vendor/protovalidate/buf/validate/validate.proto",
    "content": "// Copyright 2023-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto2\";\n\npackage buf.validate;\n\nimport \"google/protobuf/descriptor.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/field_mask.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\noption go_package = \"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\";\noption java_multiple_files = true;\noption java_outer_classname = \"ValidateProto\";\noption java_package = \"build.buf.validate\";\n\n// MessageOptions is an extension to google.protobuf.MessageOptions. It allows\n// the addition of validation rules at the message level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.MessageOptions {\n  // Rules specify the validations to be performed on this message. By default,\n  // no validation is performed against a message.\n  optional MessageRules message = 1159;\n}\n\n// OneofOptions is an extension to google.protobuf.OneofOptions. It allows\n// the addition of validation rules on a oneof. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.OneofOptions {\n  // Rules specify the validations to be performed on this oneof. By default,\n  // no validation is performed against a oneof.\n  optional OneofRules oneof = 1159;\n}\n\n// FieldOptions is an extension to google.protobuf.FieldOptions. It allows\n// the addition of validation rules at the field level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.FieldOptions {\n  // Rules specify the validations to be performed on this field. By default,\n  // no validation is performed against a field.\n  optional FieldRules field = 1159;\n\n  // Specifies predefined rules. When extending a standard rule message,\n  // this adds additional CEL expressions that apply when the extension is used.\n  //\n  // ```proto\n  // extend buf.validate.Int32Rules {\n  //   bool is_zero [(buf.validate.predefined).cel = {\n  //     id: \"int32.is_zero\",\n  //     message: \"value must be zero\",\n  //     expression: \"!rule || this == 0\",\n  //   }];\n  // }\n  //\n  // message Foo {\n  //   int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true];\n  // }\n  // ```\n  optional PredefinedRules predefined = 1160;\n}\n\n// `Rule` represents a validation rule written in the Common Expression\n// Language (CEL) syntax. Each Rule includes a unique identifier, an\n// optional error message, and the CEL expression to evaluate. For more\n// information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n//\n// ```proto\n// message Foo {\n//   option (buf.validate.message).cel = {\n//     id: \"foo.bar\"\n//     message: \"bar must be greater than 0\"\n//     expression: \"this.bar > 0\"\n//   };\n//   int32 bar = 1;\n// }\n// ```\nmessage Rule {\n  // `id` is a string that serves as a machine-readable name for this Rule.\n  // It should be unique within its scope, which could be either a message or a field.\n  optional string id = 1;\n\n  // `message` is an optional field that provides a human-readable error message\n  // for this Rule when the CEL expression evaluates to false. If a\n  // non-empty message is provided, any strings resulting from the CEL\n  // expression evaluation are ignored.\n  optional string message = 2;\n\n  // `expression` is the actual CEL expression that will be evaluated for\n  // validation. This string must resolve to either a boolean or a string\n  // value. If the expression evaluates to false or a non-empty string, the\n  // validation is considered failed, and the message is rejected.\n  optional string expression = 3;\n}\n\n// MessageRules represents validation rules that are applied to the entire message.\n// It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.\nmessage MessageRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel_expression = \"this.foo > 42\";\n  //   // The field `foo` must be less than 84.\n  //   option (buf.validate.message).cel_expression = \"this.foo < 84\";\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated string cel_expression = 5;\n  // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.\n  // These rules are written in Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this.foo > 42\",\n  //   };\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated Rule cel = 3;\n\n  // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields\n  // of which at most one can be present. If `required` is also specified, then exactly one\n  // of the specified fields _must_ be present.\n  //\n  // This will enforce oneof-like constraints with a few features not provided by\n  // actual Protobuf oneof declarations:\n  //   1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,\n  //      only scalar fields are allowed.\n  //   2. Fields with implicit presence are allowed. In a Protobuf oneof, all member\n  //      fields have explicit presence. This means that, for the purpose of determining\n  //      how many fields are set, explicitly setting such a field to its zero value is\n  //      effectively the same as not setting it at all.\n  //   3. This will always generate validation errors for a message unmarshalled from\n  //      serialized data that sets more than one field. With a Protobuf oneof, when\n  //      multiple fields are present in the serialized form, earlier values are usually\n  //      silently ignored when unmarshalling, with only the last field being set when\n  //      unmarshalling completes.\n  //\n  // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means\n  // only the field that is set will be validated and the unset fields are not validated according to the field rules.\n  // This behavior can be overridden by setting `ignore` against a field.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // Only one of `field1` or `field2` _can_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field1\", \"field2\"] };\n  //   // Exactly one of `field3` or `field4` _must_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field3\", \"field4\"], required: true };\n  //   string field1 = 1;\n  //   bytes field2 = 2;\n  //   bool field3 = 3;\n  //   int32 field4 = 4;\n  // }\n  // ```\n  repeated MessageOneofRule oneof = 4;\n\n  reserved 1;\n  reserved \"disabled\";\n}\n\nmessage MessageOneofRule {\n  // A list of field names to include in the oneof. All field names must be\n  // defined in the message. At least one field must be specified, and\n  // duplicates are not permitted.\n  repeated string fields = 1;\n  // If true, one of the fields specified _must_ be set.\n  optional bool required = 2;\n}\n\n// The `OneofRules` message type enables you to manage rules for\n// oneof fields in your protobuf messages.\nmessage OneofRules {\n  // If `required` is true, exactly one field of the oneof must be set. A\n  // validation error is returned if no fields in the oneof are set. Further rules\n  // should be placed on the fields themselves to ensure they are valid values,\n  // such as `min_len` or `gt`.\n  //\n  // ```proto\n  // message MyMessage {\n  //   oneof value {\n  //     // Either `a` or `b` must be set. If `a` is set, it must also be\n  //     // non-empty; whereas if `b` is set, it can still be an empty string.\n  //     option (buf.validate.oneof).required = true;\n  //     string a = 1 [(buf.validate.field).string.min_len = 1];\n  //     string b = 2;\n  //   }\n  // }\n  // ```\n  optional bool required = 1;\n}\n\n// FieldRules encapsulates the rules for each type of field. Depending on\n// the field, the correct set should be used to ensure proper validations.\nmessage FieldRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel_expression = \"this > 42\"];\n  // }\n  // ```\n  repeated string cel_expression = 29;\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 23;\n  // If `required` is true, the field must be set. A validation error is returned\n  // if the field is not set.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithPresence {\n  //   // Requires any string to be set, including the empty string.\n  //   optional string link = 1 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires true or false to be set.\n  //   optional bool disabled = 2 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires a message to be set, including the empty message.\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // All fields in the example above track presence. By default, Protovalidate\n  // ignores rules on those fields if no value is set. `required` ensures that\n  // the fields are set and valid.\n  //\n  // Fields that don't track presence are always validated by Protovalidate,\n  // whether they are set or not. It is not necessary to add `required`. It\n  // can be added to indicate that the field cannot be the zero value.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithoutPresence {\n  //   // `string.email` always applies, even to an empty string.\n  //   string link = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   // `repeated.min_items` always applies, even to an empty list.\n  //   repeated string labels = 2 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  //   // `required`, for fields that don't track presence, indicates\n  //   // the value of the field can't be the zero value.\n  //   int32 zero_value_not_allowed = 3 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  //\n  // Note: While field rules can be applied to repeated items, map keys, and map\n  // values, the elements are always considered to be set. Consequently,\n  // specifying `repeated.items.required` is redundant.\n  optional bool required = 25;\n  // Ignore validation rules on the field if its value matches the specified\n  // criteria. See the `Ignore` enum for details.\n  //\n  // ```proto\n  // message UpdateRequest {\n  //   // The uri rule only applies if the field is not an empty string.\n  //   string url = 1 [\n  //     (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,\n  //     (buf.validate.field).string.uri = true\n  //   ];\n  // }\n  // ```\n  optional Ignore ignore = 27;\n\n  oneof type {\n    // Scalar Field Types\n    FloatRules float = 1;\n    DoubleRules double = 2;\n    Int32Rules int32 = 3;\n    Int64Rules int64 = 4;\n    UInt32Rules uint32 = 5;\n    UInt64Rules uint64 = 6;\n    SInt32Rules sint32 = 7;\n    SInt64Rules sint64 = 8;\n    Fixed32Rules fixed32 = 9;\n    Fixed64Rules fixed64 = 10;\n    SFixed32Rules sfixed32 = 11;\n    SFixed64Rules sfixed64 = 12;\n    BoolRules bool = 13;\n    StringRules string = 14;\n    BytesRules bytes = 15;\n\n    // Complex Field Types\n    EnumRules enum = 16;\n    RepeatedRules repeated = 18;\n    MapRules map = 19;\n\n    // Well-Known Field Types\n    AnyRules any = 20;\n    DurationRules duration = 21;\n    FieldMaskRules field_mask = 28;\n    TimestampRules timestamp = 22;\n  }\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// PredefinedRules are custom rules that can be re-used with\n// multiple fields.\nmessage PredefinedRules {\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.predefined).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 1;\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// Specifies how `FieldRules.ignore` behaves, depending on the field's value, and\n// whether the field tracks presence.\nenum Ignore {\n  // Ignore rules if the field tracks presence and is unset. This is the default\n  // behavior.\n  //\n  // In proto3, only message fields, members of a Protobuf `oneof`, and fields\n  // with the `optional` label track presence. Consequently, the following fields\n  // are always validated, whether a value is set or not:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApply {\n  //   string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   int32 age = 2 [\n  //     (buf.validate.field).int32.gt = 0\n  //   ];\n  //   repeated string labels = 3 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  // }\n  // ```\n  //\n  // In contrast, the following fields track presence, and are only validated if\n  // a value is set:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApplyIfSet {\n  //   optional string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   oneof ref {\n  //     string reference = 2 [\n  //       (buf.validate.field).string.uuid = true\n  //     ];\n  //     string name = 3 [\n  //       (buf.validate.field).string.min_len = 4\n  //     ];\n  //   }\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).cel = {/* ... */}\n  //   ];\n  // }\n  // ```\n  //\n  // To ensure that such a field is set, add the `required` rule.\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  IGNORE_UNSPECIFIED = 0;\n\n  // Ignore rules if the field is unset, or set to the zero value.\n  //\n  // The zero value depends on the field type:\n  // - For strings, the zero value is the empty string.\n  // - For bytes, the zero value is empty bytes.\n  // - For bool, the zero value is false.\n  // - For numeric types, the zero value is zero.\n  // - For enums, the zero value is the first defined enum value.\n  // - For repeated fields, the zero is an empty list.\n  // - For map fields, the zero is an empty map.\n  // - For message fields, absence of the message (typically a null-value) is considered zero value.\n  //\n  // For fields that track presence (e.g. adding the `optional` label in proto3),\n  // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.\n  IGNORE_IF_ZERO_VALUE = 1;\n\n  // Always ignore rules, including the `required` rule.\n  //\n  // This is useful for ignoring the rules of a referenced message, or to\n  // temporarily ignore rules during development.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field's rules will always be ignored, including any validations\n  //   // on value's fields.\n  //   MyOtherMessage value = 1 [\n  //     (buf.validate.field).ignore = IGNORE_ALWAYS\n  //   ];\n  // }\n  // ```\n  IGNORE_ALWAYS = 3;\n\n  reserved 2;\n  reserved \"IGNORE_EMPTY\", \"IGNORE_DEFAULT\", \"IGNORE_IF_DEFAULT_VALUE\", \"IGNORE_IF_UNPOPULATED\";\n}\n\n// FloatRules describes the rules applied to `float` values. These\n// rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.\nmessage FloatRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must equal 42.0\n  //   float value = 1 [(buf.validate.field).float.const = 42.0];\n  // }\n  // ```\n  optional float const = 1 [(predefined).cel = {\n    id: \"float.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than 10.0\n    //   float value = 1 [(buf.validate.field).float.lt = 10.0];\n    // }\n    // ```\n    float lt = 2 [(predefined).cel = {\n      id: \"float.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than or equal to 10.0\n    //   float value = 1 [(buf.validate.field).float.lte = 10.0];\n    // }\n    // ```\n    float lte = 3 [(predefined).cel = {\n      id: \"float.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than 5.0 [float.gt]\n    //   float value = 1 [(buf.validate.field).float.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [float.gt_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gt = 4 [\n      (predefined).cel = {\n        id: \"float.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than or equal to 5.0 [float.gte]\n    //   float value = 1 [(buf.validate.field).float.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gte = 5 [\n      (predefined).cel = {\n        id: \"float.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float in = 6 [(predefined).cel = {\n    id: \"float.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float not_in = 7 [(predefined).cel = {\n    id: \"float.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"float.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFloat {\n  //   float value = 1 [\n  //     (buf.validate.field).float.example = 1.0,\n  //     (buf.validate.field).float.example = inf\n  //   ];\n  // }\n  // ```\n  repeated float example = 9 [(predefined).cel = {\n    id: \"float.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// DoubleRules describes the rules applied to `double` values. These\n// rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.\nmessage DoubleRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must equal 42.0\n  //   double value = 1 [(buf.validate.field).double.const = 42.0];\n  // }\n  // ```\n  optional double const = 1 [(predefined).cel = {\n    id: \"double.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than 10.0\n    //   double value = 1 [(buf.validate.field).double.lt = 10.0];\n    // }\n    // ```\n    double lt = 2 [(predefined).cel = {\n      id: \"double.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified value\n    // (field <= value). If the field value is greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than or equal to 10.0\n    //   double value = 1 [(buf.validate.field).double.lte = 10.0];\n    // }\n    // ```\n    double lte = 3 [(predefined).cel = {\n      id: \"double.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,\n    // the range is reversed, and the field value must be outside the specified\n    // range. If the field value doesn't meet the required conditions, an error\n    // message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than 5.0 [double.gt]\n    //   double value = 1 [(buf.validate.field).double.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [double.gt_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gt = 4 [\n      (predefined).cel = {\n        id: \"double.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than or equal to 5.0 [double.gte]\n    //   double value = 1 [(buf.validate.field).double.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gte = 5 [\n      (predefined).cel = {\n        id: \"double.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double in = 6 [(predefined).cel = {\n    id: \"double.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double not_in = 7 [(predefined).cel = {\n    id: \"double.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"double.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDouble {\n  //   double value = 1 [\n  //     (buf.validate.field).double.example = 1.0,\n  //     (buf.validate.field).double.example = inf\n  //   ];\n  // }\n  // ```\n  repeated double example = 9 [(predefined).cel = {\n    id: \"double.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int32Rules describes the rules applied to `int32` values. These\n// rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.\nmessage Int32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must equal 42\n  //   int32 value = 1 [(buf.validate.field).int32.const = 42];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"int32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than 10\n    //   int32 value = 1 [(buf.validate.field).int32.lt = 10];\n    // }\n    // ```\n    int32 lt = 2 [(predefined).cel = {\n      id: \"int32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than or equal to 10\n    //   int32 value = 1 [(buf.validate.field).int32.lte = 10];\n    // }\n    // ```\n    int32 lte = 3 [(predefined).cel = {\n      id: \"int32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than 5 [int32.gt]\n    //   int32 value = 1 [(buf.validate.field).int32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int32.gt_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gt = 4 [\n      (predefined).cel = {\n        id: \"int32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified value\n    // (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than or equal to 5 [int32.gte]\n    //   int32 value = 1 [(buf.validate.field).int32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gte = 5 [\n      (predefined).cel = {\n        id: \"int32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 in = 6 [(predefined).cel = {\n    id: \"int32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 not_in = 7 [(predefined).cel = {\n    id: \"int32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   int32 value = 1 [\n  //     (buf.validate.field).int32.example = 1,\n  //     (buf.validate.field).int32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int32 example = 8 [(predefined).cel = {\n    id: \"int32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int64Rules describes the rules applied to `int64` values. These\n// rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.\nmessage Int64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must equal 42\n  //   int64 value = 1 [(buf.validate.field).int64.const = 42];\n  // }\n  // ```\n  optional int64 const = 1 [(predefined).cel = {\n    id: \"int64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than 10\n    //   int64 value = 1 [(buf.validate.field).int64.lt = 10];\n    // }\n    // ```\n    int64 lt = 2 [(predefined).cel = {\n      id: \"int64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than or equal to 10\n    //   int64 value = 1 [(buf.validate.field).int64.lte = 10];\n    // }\n    // ```\n    int64 lte = 3 [(predefined).cel = {\n      id: \"int64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than 5 [int64.gt]\n    //   int64 value = 1 [(buf.validate.field).int64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int64.gt_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gt = 4 [\n      (predefined).cel = {\n        id: \"int64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than or equal to 5 [int64.gte]\n    //   int64 value = 1 [(buf.validate.field).int64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gte = 5 [\n      (predefined).cel = {\n        id: \"int64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 in = 6 [(predefined).cel = {\n    id: \"int64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 not_in = 7 [(predefined).cel = {\n    id: \"int64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   int64 value = 1 [\n  //     (buf.validate.field).int64.example = 1,\n  //     (buf.validate.field).int64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int64 example = 9 [(predefined).cel = {\n    id: \"int64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt32Rules describes the rules applied to `uint32` values. These\n// rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.\nmessage UInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must equal 42\n  //   uint32 value = 1 [(buf.validate.field).uint32.const = 42];\n  // }\n  // ```\n  optional uint32 const = 1 [(predefined).cel = {\n    id: \"uint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lt = 10];\n    // }\n    // ```\n    uint32 lt = 2 [(predefined).cel = {\n      id: \"uint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than or equal to 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lte = 10];\n    // }\n    // ```\n    uint32 lte = 3 [(predefined).cel = {\n      id: \"uint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than 5 [uint32.gt]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint32.gt_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gt = 4 [\n      (predefined).cel = {\n        id: \"uint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than or equal to 5 [uint32.gte]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gte = 5 [\n      (predefined).cel = {\n        id: \"uint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 in = 6 [(predefined).cel = {\n    id: \"uint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 not_in = 7 [(predefined).cel = {\n    id: \"uint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   uint32 value = 1 [\n  //     (buf.validate.field).uint32.example = 1,\n  //     (buf.validate.field).uint32.example = 10\n  //   ];\n  // }\n  // ```\n  repeated uint32 example = 8 [(predefined).cel = {\n    id: \"uint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt64Rules describes the rules applied to `uint64` values. These\n// rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.\nmessage UInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must equal 42\n  //   uint64 value = 1 [(buf.validate.field).uint64.const = 42];\n  // }\n  // ```\n  optional uint64 const = 1 [(predefined).cel = {\n    id: \"uint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lt = 10];\n    // }\n    // ```\n    uint64 lt = 2 [(predefined).cel = {\n      id: \"uint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than or equal to 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lte = 10];\n    // }\n    // ```\n    uint64 lte = 3 [(predefined).cel = {\n      id: \"uint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than 5 [uint64.gt]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint64.gt_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gt = 4 [\n      (predefined).cel = {\n        id: \"uint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than or equal to 5 [uint64.gte]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gte = 5 [\n      (predefined).cel = {\n        id: \"uint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 in = 6 [(predefined).cel = {\n    id: \"uint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 not_in = 7 [(predefined).cel = {\n    id: \"uint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   uint64 value = 1 [\n  //     (buf.validate.field).uint64.example = 1,\n  //     (buf.validate.field).uint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated uint64 example = 8 [(predefined).cel = {\n    id: \"uint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt32Rules describes the rules applied to `sint32` values.\nmessage SInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must equal 42\n  //   sint32 value = 1 [(buf.validate.field).sint32.const = 42];\n  // }\n  // ```\n  optional sint32 const = 1 [(predefined).cel = {\n    id: \"sint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lt = 10];\n    // }\n    // ```\n    sint32 lt = 2 [(predefined).cel = {\n      id: \"sint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than or equal to 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lte = 10];\n    // }\n    // ```\n    sint32 lte = 3 [(predefined).cel = {\n      id: \"sint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be greater than 5 [sint32.gt]\n    //   sint32 value = 1 [(buf.validate.field).sint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint32.gt_lt]\n    //   sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]\n    //   sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gt = 4 [\n      (predefined).cel = {\n        id: \"sint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //  // value must be greater than or equal to 5 [sint32.gte]\n    //  sint32 value = 1 [(buf.validate.field).sint32.gte = 5];\n    //\n    //  // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]\n    //  sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];\n    //\n    //  // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]\n    //  sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gte = 5 [\n      (predefined).cel = {\n        id: \"sint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 in = 6 [(predefined).cel = {\n    id: \"sint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 not_in = 7 [(predefined).cel = {\n    id: \"sint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   sint32 value = 1 [\n  //     (buf.validate.field).sint32.example = 1,\n  //     (buf.validate.field).sint32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint32 example = 8 [(predefined).cel = {\n    id: \"sint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt64Rules describes the rules applied to `sint64` values.\nmessage SInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must equal 42\n  //   sint64 value = 1 [(buf.validate.field).sint64.const = 42];\n  // }\n  // ```\n  optional sint64 const = 1 [(predefined).cel = {\n    id: \"sint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lt = 10];\n    // }\n    // ```\n    sint64 lt = 2 [(predefined).cel = {\n      id: \"sint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than or equal to 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lte = 10];\n    // }\n    // ```\n    sint64 lte = 3 [(predefined).cel = {\n      id: \"sint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than 5 [sint64.gt]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint64.gt_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gt = 4 [\n      (predefined).cel = {\n        id: \"sint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than or equal to 5 [sint64.gte]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gte = 5 [\n      (predefined).cel = {\n        id: \"sint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 in = 6 [(predefined).cel = {\n    id: \"sint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 not_in = 7 [(predefined).cel = {\n    id: \"sint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   sint64 value = 1 [\n  //     (buf.validate.field).sint64.example = 1,\n  //     (buf.validate.field).sint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint64 example = 8 [(predefined).cel = {\n    id: \"sint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed32Rules describes the rules applied to `fixed32` values.\nmessage Fixed32Rules {\n  // `const` requires the field value to exactly match the specified value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must equal 42\n  //   fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];\n  // }\n  // ```\n  optional fixed32 const = 1 [(predefined).cel = {\n    id: \"fixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];\n    // }\n    // ```\n    fixed32 lt = 2 [(predefined).cel = {\n      id: \"fixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than or equal to 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];\n    // }\n    // ```\n    fixed32 lte = 3 [(predefined).cel = {\n      id: \"fixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than 5 [fixed32.gt]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed32.gt_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than or equal to 5 [fixed32.gte]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 in = 6 [(predefined).cel = {\n    id: \"fixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 not_in = 7 [(predefined).cel = {\n    id: \"fixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   fixed32 value = 1 [\n  //     (buf.validate.field).fixed32.example = 1,\n  //     (buf.validate.field).fixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed32 example = 8 [(predefined).cel = {\n    id: \"fixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed64Rules describes the rules applied to `fixed64` values.\nmessage Fixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must equal 42\n  //   fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];\n  // }\n  // ```\n  optional fixed64 const = 1 [(predefined).cel = {\n    id: \"fixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];\n    // }\n    // ```\n    fixed64 lt = 2 [(predefined).cel = {\n      id: \"fixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than or equal to 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];\n    // }\n    // ```\n    fixed64 lte = 3 [(predefined).cel = {\n      id: \"fixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than 5 [fixed64.gt]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed64.gt_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than or equal to 5 [fixed64.gte]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 in = 6 [(predefined).cel = {\n    id: \"fixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 not_in = 7 [(predefined).cel = {\n    id: \"fixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   fixed64 value = 1 [\n  //     (buf.validate.field).fixed64.example = 1,\n  //     (buf.validate.field).fixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed64 example = 8 [(predefined).cel = {\n    id: \"fixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed32Rules describes the rules applied to `fixed32` values.\nmessage SFixed32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must equal 42\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];\n  // }\n  // ```\n  optional sfixed32 const = 1 [(predefined).cel = {\n    id: \"sfixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];\n    // }\n    // ```\n    sfixed32 lt = 2 [(predefined).cel = {\n      id: \"sfixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than or equal to 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];\n    // }\n    // ```\n    sfixed32 lte = 3 [(predefined).cel = {\n      id: \"sfixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than 5 [sfixed32.gt]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed32.gt_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than or equal to 5 [sfixed32.gte]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 in = 6 [(predefined).cel = {\n    id: \"sfixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 not_in = 7 [(predefined).cel = {\n    id: \"sfixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   sfixed32 value = 1 [\n  //     (buf.validate.field).sfixed32.example = 1,\n  //     (buf.validate.field).sfixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed32 example = 8 [(predefined).cel = {\n    id: \"sfixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed64Rules describes the rules applied to `fixed64` values.\nmessage SFixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must equal 42\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];\n  // }\n  // ```\n  optional sfixed64 const = 1 [(predefined).cel = {\n    id: \"sfixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];\n    // }\n    // ```\n    sfixed64 lt = 2 [(predefined).cel = {\n      id: \"sfixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than or equal to 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];\n    // }\n    // ```\n    sfixed64 lte = 3 [(predefined).cel = {\n      id: \"sfixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than 5 [sfixed64.gt]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed64.gt_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than or equal to 5 [sfixed64.gte]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 in = 6 [(predefined).cel = {\n    id: \"sfixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 not_in = 7 [(predefined).cel = {\n    id: \"sfixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   sfixed64 value = 1 [\n  //     (buf.validate.field).sfixed64.example = 1,\n  //     (buf.validate.field).sfixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed64 example = 8 [(predefined).cel = {\n    id: \"sfixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// BoolRules describes the rules applied to `bool` values. These rules\n// may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.\nmessage BoolRules {\n  // `const` requires the field value to exactly match the specified boolean value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBool {\n  //   // value must equal true\n  //   bool value = 1 [(buf.validate.field).bool.const = true];\n  // }\n  // ```\n  optional bool const = 1 [(predefined).cel = {\n    id: \"bool.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBool {\n  //   bool value = 1 [\n  //     (buf.validate.field).bool.example = 1,\n  //     (buf.validate.field).bool.example = 2\n  //   ];\n  // }\n  // ```\n  repeated bool example = 2 [(predefined).cel = {\n    id: \"bool.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// StringRules describes the rules applied to `string` values These\n// rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.\nmessage StringRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must equal `hello`\n  //   string value = 1 [(buf.validate.field).string.const = \"hello\"];\n  // }\n  // ```\n  optional string const = 1 [(predefined).cel = {\n    id: \"string.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal `%s`'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` dictates that the field value must have the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value does not meet the specified\n  // length, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 5 characters\n  //   string value = 1 [(buf.validate.field).string.len = 5];\n  // }\n  // ```\n  optional uint64 len = 19 [(predefined).cel = {\n    id: \"string.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s characters'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` specifies that the field value must have at least the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value contains fewer characters, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 3 characters\n  //   string value = 1 [(buf.validate.field).string.min_len = 3];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"string.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s characters'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` specifies that the field value must have no more than the specified\n  // number of characters (Unicode code points), which may differ from the\n  // number of bytes in the string. If the field value contains more characters,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 10 characters\n  //   string value = 1 [(buf.validate.field).string.max_len = 10];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"string.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value length must be at most %s characters'.format([rules.max_len]) : ''\"\n  }];\n\n  // `len_bytes` dictates that the field value must have the specified number of\n  // bytes. If the field value does not match the specified length in bytes,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 6 bytes\n  //   string value = 1 [(buf.validate.field).string.len_bytes = 6];\n  // }\n  // ```\n  optional uint64 len_bytes = 20 [(predefined).cel = {\n    id: \"string.len_bytes\"\n    expression: \"uint(bytes(this).size()) != rules.len_bytes ? 'value length must be %s bytes'.format([rules.len_bytes]) : ''\"\n  }];\n\n  // `min_bytes` specifies that the field value must have at least the specified\n  // number of bytes. If the field value contains fewer bytes, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 4 bytes\n  //   string value = 1 [(buf.validate.field).string.min_bytes = 4];\n  // }\n  //\n  // ```\n  optional uint64 min_bytes = 4 [(predefined).cel = {\n    id: \"string.min_bytes\"\n    expression: \"uint(bytes(this).size()) < rules.min_bytes ? 'value length must be at least %s bytes'.format([rules.min_bytes]) : ''\"\n  }];\n\n  // `max_bytes` specifies that the field value must have no more than the\n  //specified number of bytes. If the field value contains more bytes, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 8 bytes\n  //   string value = 1 [(buf.validate.field).string.max_bytes = 8];\n  // }\n  // ```\n  optional uint64 max_bytes = 5 [(predefined).cel = {\n    id: \"string.max_bytes\"\n    expression: \"uint(bytes(this).size()) > rules.max_bytes ? 'value length must be at most %s bytes'.format([rules.max_bytes]) : ''\"\n  }];\n\n  // `pattern` specifies that the field value must match the specified\n  // regular expression (RE2 syntax), with the expression provided without any\n  // delimiters. If the field value doesn't match the regular expression, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not match regex pattern `^[a-zA-Z]//$`\n  //   string value = 1 [(buf.validate.field).string.pattern = \"^[a-zA-Z]//$\"];\n  // }\n  // ```\n  optional string pattern = 6 [(predefined).cel = {\n    id: \"string.pattern\"\n    expression: \"!this.matches(rules.pattern) ? 'value does not match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` specifies that the field value must have the\n  //specified substring at the beginning of the string. If the field value\n  // doesn't start with the specified prefix, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have prefix `pre`\n  //   string value = 1 [(buf.validate.field).string.prefix = \"pre\"];\n  // }\n  // ```\n  optional string prefix = 7 [(predefined).cel = {\n    id: \"string.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix `%s`'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` specifies that the field value must have the\n  //specified substring at the end of the string. If the field value doesn't\n  // end with the specified suffix, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have suffix `post`\n  //   string value = 1 [(buf.validate.field).string.suffix = \"post\"];\n  // }\n  // ```\n  optional string suffix = 8 [(predefined).cel = {\n    id: \"string.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix `%s`'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` specifies that the field value must have the\n  //specified substring anywhere in the string. If the field value doesn't\n  // contain the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not contain substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.contains = \"inside\"];\n  // }\n  // ```\n  optional string contains = 9 [(predefined).cel = {\n    id: \"string.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain substring `%s`'.format([rules.contains]) : ''\"\n  }];\n\n  // `not_contains` specifies that the field value must not have the\n  //specified substring anywhere in the string. If the field value contains\n  // the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value contains substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.not_contains = \"inside\"];\n  // }\n  // ```\n  optional string not_contains = 23 [(predefined).cel = {\n    id: \"string.not_contains\"\n    expression: \"this.contains(rules.not_contains) ? 'value contains substring `%s`'.format([rules.not_contains]) : ''\"\n  }];\n\n  // `in` specifies that the field value must be equal to one of the specified\n  // values. If the field value isn't one of the specified values, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must be in list [\"apple\", \"banana\"]\n  //   string value = 1 [(buf.validate.field).string.in = \"apple\", (buf.validate.field).string.in = \"banana\"];\n  // }\n  // ```\n  repeated string in = 10 [(predefined).cel = {\n    id: \"string.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` specifies that the field value cannot be equal to any\n  // of the specified values. If the field value is one of the specified values,\n  // an error message will be generated.\n  // ```proto\n  // message MyString {\n  //   // value must not be in list [\"orange\", \"grape\"]\n  //   string value = 1 [(buf.validate.field).string.not_in = \"orange\", (buf.validate.field).string.not_in = \"grape\"];\n  // }\n  // ```\n  repeated string not_in = 11 [(predefined).cel = {\n    id: \"string.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `WellKnown` rules provide advanced rules against common string\n  // patterns.\n  oneof well_known {\n    // `email` specifies that the field value must be a valid email address, for\n    // example \"foo@example.com\".\n    //\n    // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).\n    // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),\n    // which allows many unexpected forms of email addresses and will easily match\n    // a typographical error.\n    //\n    // If the field value isn't a valid email address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid email address\n    //   string value = 1 [(buf.validate.field).string.email = true];\n    // }\n    // ```\n    bool email = 12 [\n      (predefined).cel = {\n        id: \"string.email\"\n        message: \"value must be a valid email address\"\n        expression: \"!rules.email || this == '' || this.isEmail()\"\n      },\n      (predefined).cel = {\n        id: \"string.email_empty\"\n        message: \"value is empty, which is not a valid email address\"\n        expression: \"!rules.email || this != ''\"\n      }\n    ];\n\n    // `hostname` specifies that the field value must be a valid hostname, for\n    // example \"foo.example.com\".\n    //\n    // A valid hostname follows the rules below:\n    // - The name consists of one or more labels, separated by a dot (\".\").\n    // - Each label can be 1 to 63 alphanumeric characters.\n    // - A label can contain hyphens (\"-\"), but must not start or end with a hyphen.\n    // - The right-most label must not be digits only.\n    // - The name can have a trailing dot—for example, \"foo.example.com.\".\n    // - The name can be 253 characters at most, excluding the optional trailing dot.\n    //\n    // If the field value isn't a valid hostname, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname\n    //   string value = 1 [(buf.validate.field).string.hostname = true];\n    // }\n    // ```\n    bool hostname = 13 [\n      (predefined).cel = {\n        id: \"string.hostname\"\n        message: \"value must be a valid hostname\"\n        expression: \"!rules.hostname || this == '' || this.isHostname()\"\n      },\n      (predefined).cel = {\n        id: \"string.hostname_empty\"\n        message: \"value is empty, which is not a valid hostname\"\n        expression: \"!rules.hostname || this != ''\"\n      }\n    ];\n\n    // `ip` specifies that the field value must be a valid IP (v4 or v6) address.\n    //\n    // IPv4 addresses are expected in the dotted decimal format—for example, \"192.168.5.21\".\n    // IPv6 addresses are expected in their text representation—for example, \"::1\",\n    // or \"2001:0DB8:ABCD:0012::0\".\n    //\n    // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone identifiers for IPv6 addresses (for example, \"fe80::a%en1\") are supported.\n    //\n    // If the field value isn't a valid IP address, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP address\n    //   string value = 1 [(buf.validate.field).string.ip = true];\n    // }\n    // ```\n    bool ip = 14 [\n      (predefined).cel = {\n        id: \"string.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this == '' || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this != ''\"\n      }\n    ];\n\n    // `ipv4` specifies that the field value must be a valid IPv4 address—for\n    // example \"192.168.5.21\". If the field value isn't a valid IPv4 address, an\n    // error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address\n    //   string value = 1 [(buf.validate.field).string.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 15 [\n      (predefined).cel = {\n        id: \"string.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this == '' || this.isIp(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this != ''\"\n      }\n    ];\n\n    // `ipv6` specifies that the field value must be a valid IPv6 address—for\n    // example \"::1\", or \"d7a:115c:a1e0:ab12:4843:cd96:626b:430b\". If the field\n    // value is not a valid IPv6 address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address\n    //   string value = 1 [(buf.validate.field).string.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 16 [\n      (predefined).cel = {\n        id: \"string.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this == '' || this.isIp(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this != ''\"\n      }\n    ];\n\n    // `uri` specifies that the field value must be a valid URI, for example\n    // \"https://example.com/foo/bar?baz=quux#frag\".\n    //\n    // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI\n    //   string value = 1 [(buf.validate.field).string.uri = true];\n    // }\n    // ```\n    bool uri = 17 [\n      (predefined).cel = {\n        id: \"string.uri\"\n        message: \"value must be a valid URI\"\n        expression: \"!rules.uri || this == '' || this.isUri()\"\n      },\n      (predefined).cel = {\n        id: \"string.uri_empty\"\n        message: \"value is empty, which is not a valid URI\"\n        expression: \"!rules.uri || this != ''\"\n      }\n    ];\n\n    // `uri_ref` specifies that the field value must be a valid URI Reference—either\n    // a URI such as \"https://example.com/foo/bar?baz=quux#frag\", or a Relative\n    // Reference such as \"./foo/bar?query\".\n    //\n    // URI, URI Reference, and Relative Reference are defined in the internet\n    // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone\n    // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI Reference, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI Reference\n    //   string value = 1 [(buf.validate.field).string.uri_ref = true];\n    // }\n    // ```\n    bool uri_ref = 18 [(predefined).cel = {\n      id: \"string.uri_ref\"\n      message: \"value must be a valid URI Reference\"\n      expression: \"!rules.uri_ref || this.isUriRef()\"\n    }];\n\n    // `address` specifies that the field value must be either a valid hostname\n    // (for example, \"example.com\"), or a valid IP (v4 or v6) address (for example,\n    // \"192.168.0.1\", or \"::1\"). If the field value isn't a valid hostname or IP,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname, or ip address\n    //   string value = 1 [(buf.validate.field).string.address = true];\n    // }\n    // ```\n    bool address = 21 [\n      (predefined).cel = {\n        id: \"string.address\"\n        message: \"value must be a valid hostname, or ip address\"\n        expression: \"!rules.address || this == '' || this.isHostname() || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.address_empty\"\n        message: \"value is empty, which is not a valid hostname, or ip address\"\n        expression: \"!rules.address || this != ''\"\n      }\n    ];\n\n    // `uuid` specifies that the field value must be a valid UUID as defined by\n    // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the\n    // field value isn't a valid UUID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid UUID\n    //   string value = 1 [(buf.validate.field).string.uuid = true];\n    // }\n    // ```\n    bool uuid = 22 [\n      (predefined).cel = {\n        id: \"string.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this != ''\"\n      }\n    ];\n\n    // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes\n    // omitted. If the field value isn't a valid UUID without dashes, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid trimmed UUID\n    //   string value = 1 [(buf.validate.field).string.tuuid = true];\n    // }\n    // ```\n    bool tuuid = 33 [\n      (predefined).cel = {\n        id: \"string.tuuid\"\n        message: \"value must be a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this == '' || this.matches('^[0-9a-fA-F]{32}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.tuuid_empty\"\n        message: \"value is empty, which is not a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this != ''\"\n      }\n    ];\n\n    // `ip_with_prefixlen` specifies that the field value must be a valid IP\n    // (v4 or v6) address with prefix length—for example, \"192.168.5.21/16\" or\n    // \"2001:0DB8:ABCD:0012::F1/64\". If the field value isn't a valid IP with\n    // prefix length, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP with prefix length\n    //    string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];\n    // }\n    // ```\n    bool ip_with_prefixlen = 26 [\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this == '' || this.isIpPrefix()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv4_with_prefixlen` specifies that the field value must be a valid\n    // IPv4 address with prefix length—for example, \"192.168.5.21/16\". If the\n    // field value isn't a valid IPv4 address with prefix length, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address with prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv4_with_prefixlen = 27 [\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen\"\n        message: \"value must be a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv6_with_prefixlen` specifies that the field value must be a valid\n    // IPv6 address with prefix length—for example, \"2001:0DB8:ABCD:0012::F1/64\".\n    // If the field value is not a valid IPv6 address with prefix length,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv6_with_prefixlen = 28 [\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen\"\n        message: \"value must be a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)\n    // prefix—for example, \"192.168.0.0/16\" or \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value isn't a valid IP prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP prefix\n    //    string value = 1 [(buf.validate.field).string.ip_prefix = true];\n    // }\n    // ```\n    bool ip_prefix = 29 [\n      (predefined).cel = {\n        id: \"string.ip_prefix\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this == '' || this.isIpPrefix(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_prefix_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv4_prefix` specifies that the field value must be a valid IPv4\n    // prefix, for example \"192.168.0.0/16\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"192.168.0.0/16\" designates the left-most 16 bits for the prefix,\n    // and the remaining 16 bits must be zero.\n    //\n    // If the field value isn't a valid IPv4 prefix, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv4_prefix = true];\n    // }\n    // ```\n    bool ipv4_prefix = 30 [\n      (predefined).cel = {\n        id: \"string.ipv4_prefix\"\n        message: \"value must be a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this == '' || this.isIpPrefix(4, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for\n    // example, \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value is not a valid IPv6 prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv6_prefix = true];\n    // }\n    // ```\n    bool ipv6_prefix = 31 [\n      (predefined).cel = {\n        id: \"string.ipv6_prefix\"\n        message: \"value must be a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this == '' || this.isIpPrefix(6, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this != ''\"\n      }\n    ];\n\n    // `host_and_port` specifies that the field value must be valid host/port\n    // pair—for example, \"example.com:8080\".\n    //\n    // The host can be one of:\n    //- An IPv4 address in dotted decimal format—for example, \"192.168.5.21\".\n    //- An IPv6 address enclosed in square brackets—for example, \"[2001:0DB8:ABCD:0012::F1]\".\n    //- A hostname—for example, \"example.com\".\n    //\n    // The port is separated by a colon. It must be non-empty, with a decimal number\n    // in the range of 0-65535, inclusive.\n    bool host_and_port = 32 [\n      (predefined).cel = {\n        id: \"string.host_and_port\"\n        message: \"value must be a valid host (hostname or IP address) and port pair\"\n        expression: \"!rules.host_and_port || this == '' || this.isHostAndPort(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.host_and_port_empty\"\n        message: \"value is empty, which is not a valid host and port pair\"\n        expression: \"!rules.host_and_port || this != ''\"\n      }\n    ];\n\n    // `ulid` specifies that the field value must be a valid ULID (Universally Unique\n    // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).\n    // If the field value isn't a valid ULID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid ULID\n    //   string value = 1 [(buf.validate.field).string.ulid = true];\n    // }\n    // ```\n    bool ulid = 35 [\n      (predefined).cel = {\n        id: \"string.ulid\"\n        message: \"value must be a valid ULID\"\n        expression: \"!rules.ulid || this == '' || this.matches('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.ulid_empty\"\n        message: \"value is empty, which is not a valid ULID\"\n        expression: \"!rules.ulid || this != ''\"\n      }\n    ];\n\n    // `well_known_regex` specifies a common well-known pattern\n    // defined as a regex. If the field value doesn't match the well-known\n    // regex, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid HTTP header value\n    //   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];\n    // }\n    // ```\n    //\n    // #### KnownRegex\n    //\n    // `well_known_regex` contains some well-known patterns.\n    //\n    // | Name                          | Number | Description                               |\n    // |-------------------------------|--------|-------------------------------------------|\n    // | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |\n    // | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2)  |\n    // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |\n    KnownRegex well_known_regex = 24 [\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name\"\n        message: \"value must be a valid HTTP header name\"\n        expression:\n          \"rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^:?[0-9a-zA-Z!#$%&\\\\'*+-.^_|~\\\\x60]+$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]+$')\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name_empty\"\n        message: \"value is empty, which is not a valid HTTP header name\"\n        expression: \"rules.well_known_regex != 1 || this != ''\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_value\"\n        message: \"value must be a valid HTTP header value\"\n        expression:\n          \"rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^[^\\\\u0000-\\\\u0008\\\\u000A-\\\\u001F\\\\u007F]*$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]*$')\"\n      }\n    ];\n  }\n\n  // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to\n  // enable strict header validation. By default, this is true, and HTTP header\n  // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser\n  // validations that only disallow `\\r\\n\\0` characters, which can be used to\n  // bypass header matching rules.\n  //\n  // ```proto\n  // message MyString {\n  //   // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.\n  //   string value = 1 [(buf.validate.field).string.strict = false];\n  // }\n  // ```\n  optional bool strict = 25;\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyString {\n  //   string value = 1 [\n  //     (buf.validate.field).string.example = \"hello\",\n  //     (buf.validate.field).string.example = \"world\"\n  //   ];\n  // }\n  // ```\n  repeated string example = 34 [(predefined).cel = {\n    id: \"string.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// KnownRegex contains some well-known patterns.\nenum KnownRegex {\n  KNOWN_REGEX_UNSPECIFIED = 0;\n\n  // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2).\n  KNOWN_REGEX_HTTP_HEADER_NAME = 1;\n\n  // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4).\n  KNOWN_REGEX_HTTP_HEADER_VALUE = 2;\n}\n\n// BytesRules describe the rules applied to `bytes` values. These rules\n// may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.\nmessage BytesRules {\n  // `const` requires the field value to exactly match the specified bytes\n  // value. If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be \"\\x01\\x02\\x03\\x04\"\n  //   bytes value = 1 [(buf.validate.field).bytes.const = \"\\x01\\x02\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes const = 1 [(predefined).cel = {\n    id: \"bytes.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must be %x'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` requires the field value to have the specified length in bytes.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be 4 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.len = 4];\n  // }\n  // ```\n  optional uint64 len = 13 [(predefined).cel = {\n    id: \"bytes.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s bytes'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` requires the field value to have at least the specified minimum\n  // length in bytes.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be at least 2 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"bytes.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s bytes'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` requires the field value to have at most the specified maximum\n  // length in bytes.\n  // If the field value exceeds the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be at most 6 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"bytes.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value must be at most %s bytes'.format([rules.max_len]) : ''\"\n  }];\n\n  // `pattern` requires the field value to match the specified regular\n  // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).\n  // The value of the field must be valid UTF-8 or validation will fail with a\n  // runtime error.\n  // If the field value doesn't match the pattern, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must match regex pattern \"^[a-zA-Z0-9]+$\".\n  //   optional bytes value = 1 [(buf.validate.field).bytes.pattern = \"^[a-zA-Z0-9]+$\"];\n  // }\n  // ```\n  optional string pattern = 4 [(predefined).cel = {\n    id: \"bytes.pattern\"\n    expression: \"!string(this).matches(rules.pattern) ? 'value must match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` requires the field value to have the specified bytes at the\n  // beginning of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have prefix \\x01\\x02\n  //   optional bytes value = 1 [(buf.validate.field).bytes.prefix = \"\\x01\\x02\"];\n  // }\n  // ```\n  optional bytes prefix = 5 [(predefined).cel = {\n    id: \"bytes.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix %x'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` requires the field value to have the specified bytes at the end\n  // of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have suffix \\x03\\x04\n  //   optional bytes value = 1 [(buf.validate.field).bytes.suffix = \"\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes suffix = 6 [(predefined).cel = {\n    id: \"bytes.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix %x'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` requires the field value to have the specified bytes anywhere in\n  // the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not contain \\x02\\x03\n  //   optional bytes value = 1 [(buf.validate.field).bytes.contains = \"\\x02\\x03\"];\n  // }\n  // ```\n  optional bytes contains = 7 [(predefined).cel = {\n    id: \"bytes.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain %x'.format([rules.contains]) : ''\"\n  }];\n\n  // `in` requires the field value to be equal to one of the specified\n  // values. If the field value doesn't match any of the specified values, an\n  // error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes in = 8 [(predefined).cel = {\n    id: \"bytes.in\"\n    expression: \"getField(rules, 'in').size() > 0 && !(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the specified\n  // values.\n  // If the field value matches any of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must not in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.not_in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes not_in = 9 [(predefined).cel = {\n    id: \"bytes.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // WellKnown rules provide advanced rules against common byte\n  // patterns\n  oneof well_known {\n    // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IP address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ip = true];\n    // }\n    // ```\n    bool ip = 10 [\n      (predefined).cel = {\n        id: \"bytes.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this.size() != 0\"\n      }\n    ];\n\n    // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv4 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 11 [\n      (predefined).cel = {\n        id: \"bytes.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() == 0 || this.size() == 4\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() != 0\"\n      }\n    ];\n\n    // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv6 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 12 [\n      (predefined).cel = {\n        id: \"bytes.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() != 0\"\n      }\n    ];\n\n    // `uuid` ensures that the field `value` encodes the 128-bit UUID data as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).\n    // The field must contain exactly 16 bytes\n    // representing the UUID. If the field value isn't a valid UUID, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid UUID\n    //   optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];\n    // }\n    // ```\n    bool uuid = 15 [\n      (predefined).cel = {\n        id: \"bytes.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this.size() != 0\"\n      }\n    ];\n  }\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBytes {\n  //   bytes value = 1 [\n  //     (buf.validate.field).bytes.example = \"\\x01\\x02\",\n  //     (buf.validate.field).bytes.example = \"\\x02\\x03\"\n  //   ];\n  // }\n  // ```\n  repeated bytes example = 14 [(predefined).cel = {\n    id: \"bytes.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// EnumRules describe the rules applied to `enum` values.\nmessage EnumRules {\n  // `const` requires the field value to exactly match the specified enum value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be exactly MY_ENUM_VALUE1.\n  //   MyEnum value = 1 [(buf.validate.field).enum.const = 1];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"enum.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `defined_only` requires the field value to be one of the defined values for\n  // this enum, failing on any undefined value.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be a defined value of MyEnum.\n  //   MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];\n  // }\n  // ```\n  optional bool defined_only = 2;\n\n  // `in` requires the field value to be equal to one of the\n  //specified enum values. If the field value doesn't match any of the\n  //specified values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be equal to one of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 in = 3 [(predefined).cel = {\n    id: \"enum.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the\n  //specified enum values. If the field value matches one of the specified\n  // values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must not be equal to any of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 not_in = 4 [(predefined).cel = {\n    id: \"enum.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //     (buf.validate.field).enum.example = 1,\n  //     (buf.validate.field).enum.example = 2\n  // }\n  // ```\n  repeated int32 example = 5 [(predefined).cel = {\n    id: \"enum.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// RepeatedRules describe the rules applied to `repeated` values.\nmessage RepeatedRules {\n  // `min_items` requires that this field must contain at least the specified\n  // minimum number of items.\n  //\n  // Note that `min_items = 1` is equivalent to setting a field as `required`.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain at least  2 items\n  //   repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];\n  // }\n  // ```\n  optional uint64 min_items = 1 [(predefined).cel = {\n    id: \"repeated.min_items\"\n    expression: \"uint(this.size()) < rules.min_items ? 'value must contain at least %d item(s)'.format([rules.min_items]) : ''\"\n  }];\n\n  // `max_items` denotes that this field must not exceed a\n  // certain number of items as the upper limit. If the field contains more\n  // items than specified, an error message will be generated, requiring the\n  // field to maintain no more than the specified number of items.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain no more than 3 item(s)\n  //   repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];\n  // }\n  // ```\n  optional uint64 max_items = 2 [(predefined).cel = {\n    id: \"repeated.max_items\"\n    expression: \"uint(this.size()) > rules.max_items ? 'value must contain no more than %s item(s)'.format([rules.max_items]) : ''\"\n  }];\n\n  // `unique` indicates that all elements in this field must\n  // be unique. This rule is strictly applicable to scalar and enum\n  // types, with message types not being supported.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // repeated value must contain unique items\n  //   repeated string value = 1 [(buf.validate.field).repeated.unique = true];\n  // }\n  // ```\n  optional bool unique = 3 [(predefined).cel = {\n    id: \"repeated.unique\"\n    message: \"repeated value must contain unique items\"\n    expression: \"!rules.unique || this.unique()\"\n  }];\n\n  // `items` details the rules to be applied to each item\n  // in the field. Even for repeated message fields, validation is executed\n  // against each item unless `ignore` is specified.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // The items in the field `value` must follow the specified rules.\n  //   repeated string value = 1 [(buf.validate.field).repeated.items = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Repeated items\n  // cannot be unset.\n  optional FieldRules items = 4;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// MapRules describe the rules applied to `map` values.\nmessage MapRules {\n  // Specifies the minimum number of key-value pairs allowed. If the field has\n  // fewer key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at least 2 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];\n  // }\n  // ```\n  optional uint64 min_pairs = 1 [(predefined).cel = {\n    id: \"map.min_pairs\"\n    expression: \"uint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''\"\n  }];\n\n  // Specifies the maximum number of key-value pairs allowed. If the field has\n  // more key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at most 3 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];\n  // }\n  // ```\n  optional uint64 max_pairs = 2 [(predefined).cel = {\n    id: \"map.max_pairs\"\n    expression: \"uint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''\"\n  }];\n\n  // Specifies the rules to be applied to each key in the field.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The keys in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.keys = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Map keys cannot be unset.\n  optional FieldRules keys = 4;\n\n  // Specifies the rules to be applied to the value of each key in the\n  // field. Message values will still have their validations evaluated unless\n  // `ignore` is specified.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The values in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.values = {\n  //     string: {\n  //       min_len: 5\n  //       max_len: 20\n  //     }\n  //   }];\n  // }\n  // ```\n  // Note that the `required` rule does not apply. Map values cannot be unset.\n  optional FieldRules values = 5;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type.\nmessage AnyRules {\n  // `in` requires the field's `type_url` to be equal to one of the\n  //specified values. If it doesn't match any of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must have a `type_url` equal to one of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       in: [\"type.googleapis.com/MyType1\", \"type.googleapis.com/MyType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2;\n\n  // requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must not have a `type_url` equal to any of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       not_in: [\"type.googleapis.com/ForbiddenType1\", \"type.googleapis.com/ForbiddenType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3;\n}\n\n// DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type.\nmessage DurationRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must equal 5s\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = \"5s\"];\n  // }\n  // ```\n  optional google.protobuf.Duration const = 2 [(predefined).cel = {\n    id: \"duration.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,\n    // exclusive. If the field's value is greater than or equal to the specified\n    // value, an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than 5s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = \"5s\"];\n    // }\n    // ```\n    google.protobuf.Duration lt = 3 [(predefined).cel = {\n      id: \"duration.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` indicates that the field must be less than or equal to the specified\n    // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than or equal to 10s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = \"10s\"];\n    // }\n    // ```\n    google.protobuf.Duration lte = 4 [(predefined).cel = {\n      id: \"duration.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the duration field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be greater than 5s [duration.gt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];\n    //\n    //   // duration must be greater than 5s and less than 10s [duration.gt_lt]\n    //   google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //   // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]\n    //   google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gt = 5 [\n      (predefined).cel = {\n        id: \"duration.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the duration field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value must\n    // be outside the specified range. If the field value doesn't meet the\n    // required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //  // duration must be greater than or equal to 5s [duration.gte]\n    //  google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];\n    //\n    //  // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]\n    //  google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //  // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]\n    //  google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gte = 6 [\n      (predefined).cel = {\n        id: \"duration.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value doesn't correspond to any of the specified values,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration in = 7 [(predefined).cel = {\n    id: \"duration.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` denotes that the field must not be equal to\n  // any of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value matches any of these values, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must not be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration not_in = 8 [(predefined).cel = {\n    id: \"duration.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDuration {\n  //   google.protobuf.Duration value = 1 [\n  //     (buf.validate.field).duration.example = { seconds: 1 },\n  //     (buf.validate.field).duration.example = { seconds: 2 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Duration example = 9 [(predefined).cel = {\n    id: \"duration.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type.\nmessage FieldMaskRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   // value must equal [\"a\"]\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {\n  //       paths: [\"a\"]\n  //   }];\n  // }\n  // ```\n  optional google.protobuf.FieldMask const = 1 [(predefined).cel = {\n    id: \"field_mask.const\"\n    expression: \"this.paths != getField(rules, 'const').paths ? 'value must equal paths %s'.format([getField(rules, 'const').paths]) : ''\"\n  }];\n\n  // `in` requires the field value to only contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths doesn't match the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask must only contain paths listed in `in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       in: [\"a\", \"b\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2 [(predefined).cel = {\n    id: \"field_mask.in\"\n    expression: \"!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'value must only contain paths in %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths matches the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask shall not contain paths listed in `not_in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       not_in: [\"forbidden\", \"immutable\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3 [(predefined).cel = {\n    id: \"field_mask.not_in\"\n    expression: \"!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'value must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   google.protobuf.FieldMask value = 1 [\n  //     (buf.validate.field).field_mask.example = { paths: [\"a\", \"b\"] },\n  //     (buf.validate.field).field_mask.example = { paths: [\"c.a\", \"d\"] },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.FieldMask example = 4 [(predefined).cel = {\n    id: \"field_mask.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.\nmessage TimestampRules {\n  // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must equal 2023-05-03T10:00:00Z\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];\n  // }\n  // ```\n  optional google.protobuf.Timestamp const = 2 [(predefined).cel = {\n    id: \"timestamp.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // requires the duration field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be less than 'P3D' [duration.lt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lt = 3 [(predefined).cel = {\n      id: \"timestamp.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lte = 4 [(predefined).cel = {\n      id: \"timestamp.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n\n    // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //  // value must be less than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];\n    // }\n    // ```\n    bool lt_now = 7 [(predefined).cel = {\n      id: \"timestamp.lt_now\"\n      expression: \"(rules.lt_now && this > now) ? 'value must be less than now' : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the timestamp field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gt = 5 [\n      (predefined).cel = {\n        id: \"timestamp.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the timestamp field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value\n    // must be outside the specified range. If the field value doesn't meet\n    // the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gte = 6 [\n      (predefined).cel = {\n        id: \"timestamp.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // value must be greater than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];\n    // }\n    // ```\n    bool gt_now = 8 [(predefined).cel = {\n      id: \"timestamp.gt_now\"\n      expression: \"(rules.gt_now && this < now) ? 'value must be greater than now' : ''\"\n    }];\n  }\n\n  // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must be within 1 hour of now\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];\n  // }\n  // ```\n  optional google.protobuf.Duration within = 9 [(predefined).cel = {\n    id: \"timestamp.within\"\n    expression: \"this < now-rules.within || this > now+rules.within ? 'value must be within %s of now'.format([rules.within]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   google.protobuf.Timestamp value = 1 [\n  //     (buf.validate.field).timestamp.example = { seconds: 1672444800 },\n  //     (buf.validate.field).timestamp.example = { seconds: 1672531200 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Timestamp example = 10 [(predefined).cel = {\n    id: \"timestamp.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// `Violations` is a collection of `Violation` messages. This message type is returned by\n// Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules.\n// Each individual violation is represented by a `Violation` message.\nmessage Violations {\n  // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.\n  repeated Violation violations = 1;\n}\n\n// `Violation` represents a single instance where a validation rule, expressed\n// as a `Rule`, was not met. It provides information about the field that\n// caused the violation, the specific rule that wasn't fulfilled, and a\n// human-readable error message.\n//\n// For example, consider the following message:\n//\n// ```proto\n// message User {\n//     int32 age = 1 [(buf.validate.field).cel = {\n//         id: \"user.age\",\n//         expression: \"this < 18 ? 'User must be at least 18 years old' : ''\",\n//     }];\n// }\n// ```\n//\n// It could produce the following violation:\n//\n// ```json\n// {\n//   \"ruleId\": \"user.age\",\n//   \"message\": \"User must be at least 18 years old\",\n//   \"field\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 1,\n//         \"fieldName\": \"age\",\n//         \"fieldType\": \"TYPE_INT32\"\n//       }\n//     ]\n//   },\n//   \"rule\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 23,\n//         \"fieldName\": \"cel\",\n//         \"fieldType\": \"TYPE_MESSAGE\",\n//         \"index\": \"0\"\n//       }\n//     ]\n//   }\n// }\n// ```\nmessage Violation {\n  // `field` is a machine-readable path to the field that failed validation.\n  // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  // }\n  // ```\n  //\n  // It could produce the following violation:\n  //\n  // ```textproto\n  // violation {\n  //   field { element { field_number: 1, field_name: \"a\", field_type: 8 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath field = 5;\n\n  // `rule` is a machine-readable path that points to the specific rule that failed validation.\n  // This will be a nested field starting from the FieldRules of the field that failed validation.\n  // For custom rules, this will provide the path of the rule, e.g. `cel[0]`.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  //   bool b = 2 [(buf.validate.field).cel = {\n  //     id: \"custom_rule\",\n  //     expression: \"!this ? 'b must be true': ''\"\n  //   }]\n  // }\n  // ```\n  //\n  // It could produce the following violations:\n  //\n  // ```textproto\n  // violation {\n  //   rule { element { field_number: 25, field_name: \"required\", field_type: 8 } }\n  //   ...\n  // }\n  // violation {\n  //   rule { element { field_number: 23, field_name: \"cel\", field_type: 11, index: 0 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath rule = 6;\n\n  // `rule_id` is the unique identifier of the `Rule` that was not fulfilled.\n  // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.\n  optional string rule_id = 2;\n\n  // `message` is a human-readable error message that describes the nature of the violation.\n  // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.\n  optional string message = 3;\n\n  // `for_key` indicates whether the violation was caused by a map key, rather than a value.\n  optional bool for_key = 4;\n\n  reserved 1;\n  reserved \"field_path\";\n}\n\n// `FieldPath` provides a path to a nested protobuf field.\n//\n// This message provides enough information to render a dotted field path even without protobuf descriptors.\n// It also provides enough information to resolve a nested field through unknown wire data.\nmessage FieldPath {\n  // `elements` contains each element of the path, starting from the root and recursing downward.\n  repeated FieldPathElement elements = 1;\n}\n\n// `FieldPathElement` provides enough information to nest through a single protobuf field.\n//\n// If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.\n// A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.\n// The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.\nmessage FieldPathElement {\n  // `field_number` is the field number this path element refers to.\n  optional int32 field_number = 1;\n\n  // `field_name` contains the field name this path element refers to.\n  // This can be used to display a human-readable path even if the field number is unknown.\n  optional string field_name = 2;\n\n  // `field_type` specifies the type of this field. When using reflection, this value is not needed.\n  //\n  // This value is provided to make it possible to traverse unknown fields through wire data.\n  // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.\n  //\n  // [1]: https://protobuf.dev/programming-guides/encoding/#packed\n  // [2]: https://protobuf.dev/programming-guides/encoding/#groups\n  //\n  // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and\n  // can be explicitly used in Protocol Buffers 2023 Edition.\n  optional google.protobuf.FieldDescriptorProto.Type field_type = 3;\n\n  // `key_type` specifies the map key type of this field. This value is useful when traversing\n  // unknown fields through wire data: specifically, it allows handling the differences between\n  // different integer encodings.\n  optional google.protobuf.FieldDescriptorProto.Type key_type = 4;\n\n  // `value_type` specifies map value type of this field. This is useful if you want to display a\n  // value inside unknown fields through wire data.\n  optional google.protobuf.FieldDescriptorProto.Type value_type = 5;\n\n  // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field.\n  oneof subscript {\n    // `index` specifies a 0-based index into a repeated field.\n    uint64 index = 6;\n\n    // `bool_key` specifies a map key of type bool.\n    bool bool_key = 7;\n\n    // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.\n    int64 int_key = 8;\n\n    // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.\n    uint64 uint_key = 9;\n\n    // `string_key` specifies a map key of type string.\n    string string_key = 10;\n  }\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/previous/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto\n    name: buf.test/test/module\n  - path: vendor/protovalidate\nlint:\n  ignore:\n    - vendor/protovalidate\nplugins:\n  - plugin: buf-plugin-suffix\n    options:\n      service_banned_suffixes:\n        - Mock\n        - Test\n      rpc_banned_suffixes:\n        - Element\n      field_banned_suffixes:\n        - _uuid\n      enum_value_banned_suffixes:\n        - _INVALID\n      service_no_change_suffixes:\n        - Service\n      message_no_change_suffixes:\n        - Request\n        - Response\n      enum_no_change_suffixes:\n        - State\n  - plugin: buf-plugin-protovalidate-ext\n  - plugin: buf-plugin-rpc-ext\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/previous/proto/api/v1/service.proto",
    "content": "syntax = \"proto3\";\n\npackage api.v1;\n\nservice FooService {\n  rpc GetFoo(GetFooRequest) returns (GetFooResponse);\n  rpc ListFoo(ListFooRequest) returns (ListFooResponse);\n}\n\n// buf:lint:ignore SERVICE_SUFFIX\nservice FooServiceMock {\n  rpc GetFoo(GetFooMockRequest) returns (GetFooMockResponse);\n}\n\n// buf:lint:ignore SERVICE_BANNED_SUFFIXES\nservice FooServiceTest {\n  rpc GetFoo(GetFooTestRequest) returns (GetFooTestResponse);\n}\n\nmessage GetFooRequest {}\nmessage GetFooResponse {}\nmessage ListFooRequest{\n  uint32 page_size = 1;\n  string page_token = 2;\n}\nmessage ListFooResponse{}\n\nmessage GetFooMockRequest {}\nmessage GetFooMockResponse {}\n\nmessage GetFooTestRequest {}\nmessage GetFooTestResponse {}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/previous/proto/common/v1/breaking.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1;\n\nimport \"buf/validate/validate.proto\";\n\nmessage Three {\n  message Four {\n    string was_two = 1 [(buf.validate.field).string.max_len = 2];\n    string was_ten = 2 [(buf.validate.field).string.max_len = 10];\n  }\n}\n\nmessage MSG_DONT_CHANGE {}\n\nenum E_DO_NOT_CHANGE {\n  ZERO = 0;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/previous/proto/common/v1/common.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1;\n\nmessage One {\n  message Two {\n    string id_foo = 1;\n  }\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/previous/proto/common/v1alpha1/breaking.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1alpha1;\n\nimport \"buf/validate/validate.proto\";\n\nmessage Six {\n  message Seven {\n    string was_two = 1 [(buf.validate.field).string.max_len = 2];\n    string was_ten = 2 [(buf.validate.field).string.max_len = 10];\n  }\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/previous/proto/common/v1alpha1/messages.proto",
    "content": "syntax = \"proto3\";\n\npackage common.v1alpha1;\n\nimport \"common/v1/common.proto\";\nimport \"buf/validate/validate.proto\";\n\nmessage Three {\n  common.v1.One one = 1;\n  string two = 2;\n}\n\nmessage Four {\n  string id = 1 [(buf.validate.field).string.tuuid = true];\n  message FourTwo {\n    string id = 1;\n  }\n}\n\nenum Five {\n  FIVE_UNSPECIFIED = 0;\n  FIVE_VALID = 1;\n  FIVE_INVALID = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/check_plugins/previous/vendor/protovalidate/buf/validate/validate.proto",
    "content": "// Copyright 2023-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto2\";\n\npackage buf.validate;\n\nimport \"google/protobuf/descriptor.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/field_mask.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\noption go_package = \"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\";\noption java_multiple_files = true;\noption java_outer_classname = \"ValidateProto\";\noption java_package = \"build.buf.validate\";\n\n// MessageOptions is an extension to google.protobuf.MessageOptions. It allows\n// the addition of validation rules at the message level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.MessageOptions {\n  // Rules specify the validations to be performed on this message. By default,\n  // no validation is performed against a message.\n  optional MessageRules message = 1159;\n}\n\n// OneofOptions is an extension to google.protobuf.OneofOptions. It allows\n// the addition of validation rules on a oneof. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.OneofOptions {\n  // Rules specify the validations to be performed on this oneof. By default,\n  // no validation is performed against a oneof.\n  optional OneofRules oneof = 1159;\n}\n\n// FieldOptions is an extension to google.protobuf.FieldOptions. It allows\n// the addition of validation rules at the field level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.FieldOptions {\n  // Rules specify the validations to be performed on this field. By default,\n  // no validation is performed against a field.\n  optional FieldRules field = 1159;\n\n  // Specifies predefined rules. When extending a standard rule message,\n  // this adds additional CEL expressions that apply when the extension is used.\n  //\n  // ```proto\n  // extend buf.validate.Int32Rules {\n  //   bool is_zero [(buf.validate.predefined).cel = {\n  //     id: \"int32.is_zero\",\n  //     message: \"value must be zero\",\n  //     expression: \"!rule || this == 0\",\n  //   }];\n  // }\n  //\n  // message Foo {\n  //   int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true];\n  // }\n  // ```\n  optional PredefinedRules predefined = 1160;\n}\n\n// `Rule` represents a validation rule written in the Common Expression\n// Language (CEL) syntax. Each Rule includes a unique identifier, an\n// optional error message, and the CEL expression to evaluate. For more\n// information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n//\n// ```proto\n// message Foo {\n//   option (buf.validate.message).cel = {\n//     id: \"foo.bar\"\n//     message: \"bar must be greater than 0\"\n//     expression: \"this.bar > 0\"\n//   };\n//   int32 bar = 1;\n// }\n// ```\nmessage Rule {\n  // `id` is a string that serves as a machine-readable name for this Rule.\n  // It should be unique within its scope, which could be either a message or a field.\n  optional string id = 1;\n\n  // `message` is an optional field that provides a human-readable error message\n  // for this Rule when the CEL expression evaluates to false. If a\n  // non-empty message is provided, any strings resulting from the CEL\n  // expression evaluation are ignored.\n  optional string message = 2;\n\n  // `expression` is the actual CEL expression that will be evaluated for\n  // validation. This string must resolve to either a boolean or a string\n  // value. If the expression evaluates to false or a non-empty string, the\n  // validation is considered failed, and the message is rejected.\n  optional string expression = 3;\n}\n\n// MessageRules represents validation rules that are applied to the entire message.\n// It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.\nmessage MessageRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel_expression = \"this.foo > 42\";\n  //   // The field `foo` must be less than 84.\n  //   option (buf.validate.message).cel_expression = \"this.foo < 84\";\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated string cel_expression = 5;\n  // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.\n  // These rules are written in Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this.foo > 42\",\n  //   };\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated Rule cel = 3;\n\n  // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields\n  // of which at most one can be present. If `required` is also specified, then exactly one\n  // of the specified fields _must_ be present.\n  //\n  // This will enforce oneof-like constraints with a few features not provided by\n  // actual Protobuf oneof declarations:\n  //   1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,\n  //      only scalar fields are allowed.\n  //   2. Fields with implicit presence are allowed. In a Protobuf oneof, all member\n  //      fields have explicit presence. This means that, for the purpose of determining\n  //      how many fields are set, explicitly setting such a field to its zero value is\n  //      effectively the same as not setting it at all.\n  //   3. This will always generate validation errors for a message unmarshalled from\n  //      serialized data that sets more than one field. With a Protobuf oneof, when\n  //      multiple fields are present in the serialized form, earlier values are usually\n  //      silently ignored when unmarshalling, with only the last field being set when\n  //      unmarshalling completes.\n  //\n  // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means\n  // only the field that is set will be validated and the unset fields are not validated according to the field rules.\n  // This behavior can be overridden by setting `ignore` against a field.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // Only one of `field1` or `field2` _can_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field1\", \"field2\"] };\n  //   // Exactly one of `field3` or `field4` _must_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field3\", \"field4\"], required: true };\n  //   string field1 = 1;\n  //   bytes field2 = 2;\n  //   bool field3 = 3;\n  //   int32 field4 = 4;\n  // }\n  // ```\n  repeated MessageOneofRule oneof = 4;\n\n  reserved 1;\n  reserved \"disabled\";\n}\n\nmessage MessageOneofRule {\n  // A list of field names to include in the oneof. All field names must be\n  // defined in the message. At least one field must be specified, and\n  // duplicates are not permitted.\n  repeated string fields = 1;\n  // If true, one of the fields specified _must_ be set.\n  optional bool required = 2;\n}\n\n// The `OneofRules` message type enables you to manage rules for\n// oneof fields in your protobuf messages.\nmessage OneofRules {\n  // If `required` is true, exactly one field of the oneof must be set. A\n  // validation error is returned if no fields in the oneof are set. Further rules\n  // should be placed on the fields themselves to ensure they are valid values,\n  // such as `min_len` or `gt`.\n  //\n  // ```proto\n  // message MyMessage {\n  //   oneof value {\n  //     // Either `a` or `b` must be set. If `a` is set, it must also be\n  //     // non-empty; whereas if `b` is set, it can still be an empty string.\n  //     option (buf.validate.oneof).required = true;\n  //     string a = 1 [(buf.validate.field).string.min_len = 1];\n  //     string b = 2;\n  //   }\n  // }\n  // ```\n  optional bool required = 1;\n}\n\n// FieldRules encapsulates the rules for each type of field. Depending on\n// the field, the correct set should be used to ensure proper validations.\nmessage FieldRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel_expression = \"this > 42\"];\n  // }\n  // ```\n  repeated string cel_expression = 29;\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 23;\n  // If `required` is true, the field must be set. A validation error is returned\n  // if the field is not set.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithPresence {\n  //   // Requires any string to be set, including the empty string.\n  //   optional string link = 1 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires true or false to be set.\n  //   optional bool disabled = 2 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires a message to be set, including the empty message.\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // All fields in the example above track presence. By default, Protovalidate\n  // ignores rules on those fields if no value is set. `required` ensures that\n  // the fields are set and valid.\n  //\n  // Fields that don't track presence are always validated by Protovalidate,\n  // whether they are set or not. It is not necessary to add `required`. It\n  // can be added to indicate that the field cannot be the zero value.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithoutPresence {\n  //   // `string.email` always applies, even to an empty string.\n  //   string link = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   // `repeated.min_items` always applies, even to an empty list.\n  //   repeated string labels = 2 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  //   // `required`, for fields that don't track presence, indicates\n  //   // the value of the field can't be the zero value.\n  //   int32 zero_value_not_allowed = 3 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  //\n  // Note: While field rules can be applied to repeated items, map keys, and map\n  // values, the elements are always considered to be set. Consequently,\n  // specifying `repeated.items.required` is redundant.\n  optional bool required = 25;\n  // Ignore validation rules on the field if its value matches the specified\n  // criteria. See the `Ignore` enum for details.\n  //\n  // ```proto\n  // message UpdateRequest {\n  //   // The uri rule only applies if the field is not an empty string.\n  //   string url = 1 [\n  //     (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,\n  //     (buf.validate.field).string.uri = true\n  //   ];\n  // }\n  // ```\n  optional Ignore ignore = 27;\n\n  oneof type {\n    // Scalar Field Types\n    FloatRules float = 1;\n    DoubleRules double = 2;\n    Int32Rules int32 = 3;\n    Int64Rules int64 = 4;\n    UInt32Rules uint32 = 5;\n    UInt64Rules uint64 = 6;\n    SInt32Rules sint32 = 7;\n    SInt64Rules sint64 = 8;\n    Fixed32Rules fixed32 = 9;\n    Fixed64Rules fixed64 = 10;\n    SFixed32Rules sfixed32 = 11;\n    SFixed64Rules sfixed64 = 12;\n    BoolRules bool = 13;\n    StringRules string = 14;\n    BytesRules bytes = 15;\n\n    // Complex Field Types\n    EnumRules enum = 16;\n    RepeatedRules repeated = 18;\n    MapRules map = 19;\n\n    // Well-Known Field Types\n    AnyRules any = 20;\n    DurationRules duration = 21;\n    FieldMaskRules field_mask = 28;\n    TimestampRules timestamp = 22;\n  }\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// PredefinedRules are custom rules that can be re-used with\n// multiple fields.\nmessage PredefinedRules {\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.predefined).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 1;\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// Specifies how `FieldRules.ignore` behaves, depending on the field's value, and\n// whether the field tracks presence.\nenum Ignore {\n  // Ignore rules if the field tracks presence and is unset. This is the default\n  // behavior.\n  //\n  // In proto3, only message fields, members of a Protobuf `oneof`, and fields\n  // with the `optional` label track presence. Consequently, the following fields\n  // are always validated, whether a value is set or not:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApply {\n  //   string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   int32 age = 2 [\n  //     (buf.validate.field).int32.gt = 0\n  //   ];\n  //   repeated string labels = 3 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  // }\n  // ```\n  //\n  // In contrast, the following fields track presence, and are only validated if\n  // a value is set:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApplyIfSet {\n  //   optional string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   oneof ref {\n  //     string reference = 2 [\n  //       (buf.validate.field).string.uuid = true\n  //     ];\n  //     string name = 3 [\n  //       (buf.validate.field).string.min_len = 4\n  //     ];\n  //   }\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).cel = {/* ... */}\n  //   ];\n  // }\n  // ```\n  //\n  // To ensure that such a field is set, add the `required` rule.\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  IGNORE_UNSPECIFIED = 0;\n\n  // Ignore rules if the field is unset, or set to the zero value.\n  //\n  // The zero value depends on the field type:\n  // - For strings, the zero value is the empty string.\n  // - For bytes, the zero value is empty bytes.\n  // - For bool, the zero value is false.\n  // - For numeric types, the zero value is zero.\n  // - For enums, the zero value is the first defined enum value.\n  // - For repeated fields, the zero is an empty list.\n  // - For map fields, the zero is an empty map.\n  // - For message fields, absence of the message (typically a null-value) is considered zero value.\n  //\n  // For fields that track presence (e.g. adding the `optional` label in proto3),\n  // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.\n  IGNORE_IF_ZERO_VALUE = 1;\n\n  // Always ignore rules, including the `required` rule.\n  //\n  // This is useful for ignoring the rules of a referenced message, or to\n  // temporarily ignore rules during development.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field's rules will always be ignored, including any validations\n  //   // on value's fields.\n  //   MyOtherMessage value = 1 [\n  //     (buf.validate.field).ignore = IGNORE_ALWAYS\n  //   ];\n  // }\n  // ```\n  IGNORE_ALWAYS = 3;\n\n  reserved 2;\n  reserved \"IGNORE_EMPTY\", \"IGNORE_DEFAULT\", \"IGNORE_IF_DEFAULT_VALUE\", \"IGNORE_IF_UNPOPULATED\";\n}\n\n// FloatRules describes the rules applied to `float` values. These\n// rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.\nmessage FloatRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must equal 42.0\n  //   float value = 1 [(buf.validate.field).float.const = 42.0];\n  // }\n  // ```\n  optional float const = 1 [(predefined).cel = {\n    id: \"float.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than 10.0\n    //   float value = 1 [(buf.validate.field).float.lt = 10.0];\n    // }\n    // ```\n    float lt = 2 [(predefined).cel = {\n      id: \"float.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than or equal to 10.0\n    //   float value = 1 [(buf.validate.field).float.lte = 10.0];\n    // }\n    // ```\n    float lte = 3 [(predefined).cel = {\n      id: \"float.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than 5.0 [float.gt]\n    //   float value = 1 [(buf.validate.field).float.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [float.gt_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gt = 4 [\n      (predefined).cel = {\n        id: \"float.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than or equal to 5.0 [float.gte]\n    //   float value = 1 [(buf.validate.field).float.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gte = 5 [\n      (predefined).cel = {\n        id: \"float.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float in = 6 [(predefined).cel = {\n    id: \"float.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float not_in = 7 [(predefined).cel = {\n    id: \"float.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"float.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFloat {\n  //   float value = 1 [\n  //     (buf.validate.field).float.example = 1.0,\n  //     (buf.validate.field).float.example = inf\n  //   ];\n  // }\n  // ```\n  repeated float example = 9 [(predefined).cel = {\n    id: \"float.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// DoubleRules describes the rules applied to `double` values. These\n// rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.\nmessage DoubleRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must equal 42.0\n  //   double value = 1 [(buf.validate.field).double.const = 42.0];\n  // }\n  // ```\n  optional double const = 1 [(predefined).cel = {\n    id: \"double.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than 10.0\n    //   double value = 1 [(buf.validate.field).double.lt = 10.0];\n    // }\n    // ```\n    double lt = 2 [(predefined).cel = {\n      id: \"double.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified value\n    // (field <= value). If the field value is greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than or equal to 10.0\n    //   double value = 1 [(buf.validate.field).double.lte = 10.0];\n    // }\n    // ```\n    double lte = 3 [(predefined).cel = {\n      id: \"double.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,\n    // the range is reversed, and the field value must be outside the specified\n    // range. If the field value doesn't meet the required conditions, an error\n    // message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than 5.0 [double.gt]\n    //   double value = 1 [(buf.validate.field).double.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [double.gt_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gt = 4 [\n      (predefined).cel = {\n        id: \"double.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than or equal to 5.0 [double.gte]\n    //   double value = 1 [(buf.validate.field).double.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gte = 5 [\n      (predefined).cel = {\n        id: \"double.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double in = 6 [(predefined).cel = {\n    id: \"double.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double not_in = 7 [(predefined).cel = {\n    id: \"double.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"double.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDouble {\n  //   double value = 1 [\n  //     (buf.validate.field).double.example = 1.0,\n  //     (buf.validate.field).double.example = inf\n  //   ];\n  // }\n  // ```\n  repeated double example = 9 [(predefined).cel = {\n    id: \"double.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int32Rules describes the rules applied to `int32` values. These\n// rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.\nmessage Int32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must equal 42\n  //   int32 value = 1 [(buf.validate.field).int32.const = 42];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"int32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than 10\n    //   int32 value = 1 [(buf.validate.field).int32.lt = 10];\n    // }\n    // ```\n    int32 lt = 2 [(predefined).cel = {\n      id: \"int32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than or equal to 10\n    //   int32 value = 1 [(buf.validate.field).int32.lte = 10];\n    // }\n    // ```\n    int32 lte = 3 [(predefined).cel = {\n      id: \"int32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than 5 [int32.gt]\n    //   int32 value = 1 [(buf.validate.field).int32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int32.gt_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gt = 4 [\n      (predefined).cel = {\n        id: \"int32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified value\n    // (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than or equal to 5 [int32.gte]\n    //   int32 value = 1 [(buf.validate.field).int32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gte = 5 [\n      (predefined).cel = {\n        id: \"int32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 in = 6 [(predefined).cel = {\n    id: \"int32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 not_in = 7 [(predefined).cel = {\n    id: \"int32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   int32 value = 1 [\n  //     (buf.validate.field).int32.example = 1,\n  //     (buf.validate.field).int32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int32 example = 8 [(predefined).cel = {\n    id: \"int32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int64Rules describes the rules applied to `int64` values. These\n// rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.\nmessage Int64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must equal 42\n  //   int64 value = 1 [(buf.validate.field).int64.const = 42];\n  // }\n  // ```\n  optional int64 const = 1 [(predefined).cel = {\n    id: \"int64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than 10\n    //   int64 value = 1 [(buf.validate.field).int64.lt = 10];\n    // }\n    // ```\n    int64 lt = 2 [(predefined).cel = {\n      id: \"int64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than or equal to 10\n    //   int64 value = 1 [(buf.validate.field).int64.lte = 10];\n    // }\n    // ```\n    int64 lte = 3 [(predefined).cel = {\n      id: \"int64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than 5 [int64.gt]\n    //   int64 value = 1 [(buf.validate.field).int64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int64.gt_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gt = 4 [\n      (predefined).cel = {\n        id: \"int64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than or equal to 5 [int64.gte]\n    //   int64 value = 1 [(buf.validate.field).int64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gte = 5 [\n      (predefined).cel = {\n        id: \"int64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 in = 6 [(predefined).cel = {\n    id: \"int64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 not_in = 7 [(predefined).cel = {\n    id: \"int64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   int64 value = 1 [\n  //     (buf.validate.field).int64.example = 1,\n  //     (buf.validate.field).int64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int64 example = 9 [(predefined).cel = {\n    id: \"int64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt32Rules describes the rules applied to `uint32` values. These\n// rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.\nmessage UInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must equal 42\n  //   uint32 value = 1 [(buf.validate.field).uint32.const = 42];\n  // }\n  // ```\n  optional uint32 const = 1 [(predefined).cel = {\n    id: \"uint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lt = 10];\n    // }\n    // ```\n    uint32 lt = 2 [(predefined).cel = {\n      id: \"uint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than or equal to 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lte = 10];\n    // }\n    // ```\n    uint32 lte = 3 [(predefined).cel = {\n      id: \"uint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than 5 [uint32.gt]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint32.gt_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gt = 4 [\n      (predefined).cel = {\n        id: \"uint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than or equal to 5 [uint32.gte]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gte = 5 [\n      (predefined).cel = {\n        id: \"uint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 in = 6 [(predefined).cel = {\n    id: \"uint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 not_in = 7 [(predefined).cel = {\n    id: \"uint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   uint32 value = 1 [\n  //     (buf.validate.field).uint32.example = 1,\n  //     (buf.validate.field).uint32.example = 10\n  //   ];\n  // }\n  // ```\n  repeated uint32 example = 8 [(predefined).cel = {\n    id: \"uint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt64Rules describes the rules applied to `uint64` values. These\n// rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.\nmessage UInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must equal 42\n  //   uint64 value = 1 [(buf.validate.field).uint64.const = 42];\n  // }\n  // ```\n  optional uint64 const = 1 [(predefined).cel = {\n    id: \"uint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lt = 10];\n    // }\n    // ```\n    uint64 lt = 2 [(predefined).cel = {\n      id: \"uint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than or equal to 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lte = 10];\n    // }\n    // ```\n    uint64 lte = 3 [(predefined).cel = {\n      id: \"uint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than 5 [uint64.gt]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint64.gt_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gt = 4 [\n      (predefined).cel = {\n        id: \"uint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than or equal to 5 [uint64.gte]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gte = 5 [\n      (predefined).cel = {\n        id: \"uint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 in = 6 [(predefined).cel = {\n    id: \"uint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 not_in = 7 [(predefined).cel = {\n    id: \"uint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   uint64 value = 1 [\n  //     (buf.validate.field).uint64.example = 1,\n  //     (buf.validate.field).uint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated uint64 example = 8 [(predefined).cel = {\n    id: \"uint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt32Rules describes the rules applied to `sint32` values.\nmessage SInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must equal 42\n  //   sint32 value = 1 [(buf.validate.field).sint32.const = 42];\n  // }\n  // ```\n  optional sint32 const = 1 [(predefined).cel = {\n    id: \"sint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lt = 10];\n    // }\n    // ```\n    sint32 lt = 2 [(predefined).cel = {\n      id: \"sint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than or equal to 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lte = 10];\n    // }\n    // ```\n    sint32 lte = 3 [(predefined).cel = {\n      id: \"sint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be greater than 5 [sint32.gt]\n    //   sint32 value = 1 [(buf.validate.field).sint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint32.gt_lt]\n    //   sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]\n    //   sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gt = 4 [\n      (predefined).cel = {\n        id: \"sint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //  // value must be greater than or equal to 5 [sint32.gte]\n    //  sint32 value = 1 [(buf.validate.field).sint32.gte = 5];\n    //\n    //  // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]\n    //  sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];\n    //\n    //  // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]\n    //  sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gte = 5 [\n      (predefined).cel = {\n        id: \"sint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 in = 6 [(predefined).cel = {\n    id: \"sint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 not_in = 7 [(predefined).cel = {\n    id: \"sint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   sint32 value = 1 [\n  //     (buf.validate.field).sint32.example = 1,\n  //     (buf.validate.field).sint32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint32 example = 8 [(predefined).cel = {\n    id: \"sint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt64Rules describes the rules applied to `sint64` values.\nmessage SInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must equal 42\n  //   sint64 value = 1 [(buf.validate.field).sint64.const = 42];\n  // }\n  // ```\n  optional sint64 const = 1 [(predefined).cel = {\n    id: \"sint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lt = 10];\n    // }\n    // ```\n    sint64 lt = 2 [(predefined).cel = {\n      id: \"sint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than or equal to 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lte = 10];\n    // }\n    // ```\n    sint64 lte = 3 [(predefined).cel = {\n      id: \"sint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than 5 [sint64.gt]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint64.gt_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gt = 4 [\n      (predefined).cel = {\n        id: \"sint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than or equal to 5 [sint64.gte]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gte = 5 [\n      (predefined).cel = {\n        id: \"sint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 in = 6 [(predefined).cel = {\n    id: \"sint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 not_in = 7 [(predefined).cel = {\n    id: \"sint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   sint64 value = 1 [\n  //     (buf.validate.field).sint64.example = 1,\n  //     (buf.validate.field).sint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint64 example = 8 [(predefined).cel = {\n    id: \"sint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed32Rules describes the rules applied to `fixed32` values.\nmessage Fixed32Rules {\n  // `const` requires the field value to exactly match the specified value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must equal 42\n  //   fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];\n  // }\n  // ```\n  optional fixed32 const = 1 [(predefined).cel = {\n    id: \"fixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];\n    // }\n    // ```\n    fixed32 lt = 2 [(predefined).cel = {\n      id: \"fixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than or equal to 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];\n    // }\n    // ```\n    fixed32 lte = 3 [(predefined).cel = {\n      id: \"fixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than 5 [fixed32.gt]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed32.gt_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than or equal to 5 [fixed32.gte]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 in = 6 [(predefined).cel = {\n    id: \"fixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 not_in = 7 [(predefined).cel = {\n    id: \"fixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   fixed32 value = 1 [\n  //     (buf.validate.field).fixed32.example = 1,\n  //     (buf.validate.field).fixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed32 example = 8 [(predefined).cel = {\n    id: \"fixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed64Rules describes the rules applied to `fixed64` values.\nmessage Fixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must equal 42\n  //   fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];\n  // }\n  // ```\n  optional fixed64 const = 1 [(predefined).cel = {\n    id: \"fixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];\n    // }\n    // ```\n    fixed64 lt = 2 [(predefined).cel = {\n      id: \"fixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than or equal to 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];\n    // }\n    // ```\n    fixed64 lte = 3 [(predefined).cel = {\n      id: \"fixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than 5 [fixed64.gt]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed64.gt_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than or equal to 5 [fixed64.gte]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 in = 6 [(predefined).cel = {\n    id: \"fixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 not_in = 7 [(predefined).cel = {\n    id: \"fixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   fixed64 value = 1 [\n  //     (buf.validate.field).fixed64.example = 1,\n  //     (buf.validate.field).fixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed64 example = 8 [(predefined).cel = {\n    id: \"fixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed32Rules describes the rules applied to `fixed32` values.\nmessage SFixed32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must equal 42\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];\n  // }\n  // ```\n  optional sfixed32 const = 1 [(predefined).cel = {\n    id: \"sfixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];\n    // }\n    // ```\n    sfixed32 lt = 2 [(predefined).cel = {\n      id: \"sfixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than or equal to 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];\n    // }\n    // ```\n    sfixed32 lte = 3 [(predefined).cel = {\n      id: \"sfixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than 5 [sfixed32.gt]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed32.gt_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than or equal to 5 [sfixed32.gte]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 in = 6 [(predefined).cel = {\n    id: \"sfixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 not_in = 7 [(predefined).cel = {\n    id: \"sfixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   sfixed32 value = 1 [\n  //     (buf.validate.field).sfixed32.example = 1,\n  //     (buf.validate.field).sfixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed32 example = 8 [(predefined).cel = {\n    id: \"sfixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed64Rules describes the rules applied to `fixed64` values.\nmessage SFixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must equal 42\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];\n  // }\n  // ```\n  optional sfixed64 const = 1 [(predefined).cel = {\n    id: \"sfixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];\n    // }\n    // ```\n    sfixed64 lt = 2 [(predefined).cel = {\n      id: \"sfixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than or equal to 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];\n    // }\n    // ```\n    sfixed64 lte = 3 [(predefined).cel = {\n      id: \"sfixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than 5 [sfixed64.gt]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed64.gt_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than or equal to 5 [sfixed64.gte]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 in = 6 [(predefined).cel = {\n    id: \"sfixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 not_in = 7 [(predefined).cel = {\n    id: \"sfixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   sfixed64 value = 1 [\n  //     (buf.validate.field).sfixed64.example = 1,\n  //     (buf.validate.field).sfixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed64 example = 8 [(predefined).cel = {\n    id: \"sfixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// BoolRules describes the rules applied to `bool` values. These rules\n// may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.\nmessage BoolRules {\n  // `const` requires the field value to exactly match the specified boolean value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBool {\n  //   // value must equal true\n  //   bool value = 1 [(buf.validate.field).bool.const = true];\n  // }\n  // ```\n  optional bool const = 1 [(predefined).cel = {\n    id: \"bool.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBool {\n  //   bool value = 1 [\n  //     (buf.validate.field).bool.example = 1,\n  //     (buf.validate.field).bool.example = 2\n  //   ];\n  // }\n  // ```\n  repeated bool example = 2 [(predefined).cel = {\n    id: \"bool.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// StringRules describes the rules applied to `string` values These\n// rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.\nmessage StringRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must equal `hello`\n  //   string value = 1 [(buf.validate.field).string.const = \"hello\"];\n  // }\n  // ```\n  optional string const = 1 [(predefined).cel = {\n    id: \"string.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal `%s`'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` dictates that the field value must have the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value does not meet the specified\n  // length, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 5 characters\n  //   string value = 1 [(buf.validate.field).string.len = 5];\n  // }\n  // ```\n  optional uint64 len = 19 [(predefined).cel = {\n    id: \"string.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s characters'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` specifies that the field value must have at least the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value contains fewer characters, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 3 characters\n  //   string value = 1 [(buf.validate.field).string.min_len = 3];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"string.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s characters'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` specifies that the field value must have no more than the specified\n  // number of characters (Unicode code points), which may differ from the\n  // number of bytes in the string. If the field value contains more characters,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 10 characters\n  //   string value = 1 [(buf.validate.field).string.max_len = 10];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"string.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value length must be at most %s characters'.format([rules.max_len]) : ''\"\n  }];\n\n  // `len_bytes` dictates that the field value must have the specified number of\n  // bytes. If the field value does not match the specified length in bytes,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 6 bytes\n  //   string value = 1 [(buf.validate.field).string.len_bytes = 6];\n  // }\n  // ```\n  optional uint64 len_bytes = 20 [(predefined).cel = {\n    id: \"string.len_bytes\"\n    expression: \"uint(bytes(this).size()) != rules.len_bytes ? 'value length must be %s bytes'.format([rules.len_bytes]) : ''\"\n  }];\n\n  // `min_bytes` specifies that the field value must have at least the specified\n  // number of bytes. If the field value contains fewer bytes, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 4 bytes\n  //   string value = 1 [(buf.validate.field).string.min_bytes = 4];\n  // }\n  //\n  // ```\n  optional uint64 min_bytes = 4 [(predefined).cel = {\n    id: \"string.min_bytes\"\n    expression: \"uint(bytes(this).size()) < rules.min_bytes ? 'value length must be at least %s bytes'.format([rules.min_bytes]) : ''\"\n  }];\n\n  // `max_bytes` specifies that the field value must have no more than the\n  //specified number of bytes. If the field value contains more bytes, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 8 bytes\n  //   string value = 1 [(buf.validate.field).string.max_bytes = 8];\n  // }\n  // ```\n  optional uint64 max_bytes = 5 [(predefined).cel = {\n    id: \"string.max_bytes\"\n    expression: \"uint(bytes(this).size()) > rules.max_bytes ? 'value length must be at most %s bytes'.format([rules.max_bytes]) : ''\"\n  }];\n\n  // `pattern` specifies that the field value must match the specified\n  // regular expression (RE2 syntax), with the expression provided without any\n  // delimiters. If the field value doesn't match the regular expression, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not match regex pattern `^[a-zA-Z]//$`\n  //   string value = 1 [(buf.validate.field).string.pattern = \"^[a-zA-Z]//$\"];\n  // }\n  // ```\n  optional string pattern = 6 [(predefined).cel = {\n    id: \"string.pattern\"\n    expression: \"!this.matches(rules.pattern) ? 'value does not match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` specifies that the field value must have the\n  //specified substring at the beginning of the string. If the field value\n  // doesn't start with the specified prefix, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have prefix `pre`\n  //   string value = 1 [(buf.validate.field).string.prefix = \"pre\"];\n  // }\n  // ```\n  optional string prefix = 7 [(predefined).cel = {\n    id: \"string.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix `%s`'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` specifies that the field value must have the\n  //specified substring at the end of the string. If the field value doesn't\n  // end with the specified suffix, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have suffix `post`\n  //   string value = 1 [(buf.validate.field).string.suffix = \"post\"];\n  // }\n  // ```\n  optional string suffix = 8 [(predefined).cel = {\n    id: \"string.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix `%s`'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` specifies that the field value must have the\n  //specified substring anywhere in the string. If the field value doesn't\n  // contain the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not contain substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.contains = \"inside\"];\n  // }\n  // ```\n  optional string contains = 9 [(predefined).cel = {\n    id: \"string.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain substring `%s`'.format([rules.contains]) : ''\"\n  }];\n\n  // `not_contains` specifies that the field value must not have the\n  //specified substring anywhere in the string. If the field value contains\n  // the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value contains substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.not_contains = \"inside\"];\n  // }\n  // ```\n  optional string not_contains = 23 [(predefined).cel = {\n    id: \"string.not_contains\"\n    expression: \"this.contains(rules.not_contains) ? 'value contains substring `%s`'.format([rules.not_contains]) : ''\"\n  }];\n\n  // `in` specifies that the field value must be equal to one of the specified\n  // values. If the field value isn't one of the specified values, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must be in list [\"apple\", \"banana\"]\n  //   string value = 1 [(buf.validate.field).string.in = \"apple\", (buf.validate.field).string.in = \"banana\"];\n  // }\n  // ```\n  repeated string in = 10 [(predefined).cel = {\n    id: \"string.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` specifies that the field value cannot be equal to any\n  // of the specified values. If the field value is one of the specified values,\n  // an error message will be generated.\n  // ```proto\n  // message MyString {\n  //   // value must not be in list [\"orange\", \"grape\"]\n  //   string value = 1 [(buf.validate.field).string.not_in = \"orange\", (buf.validate.field).string.not_in = \"grape\"];\n  // }\n  // ```\n  repeated string not_in = 11 [(predefined).cel = {\n    id: \"string.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `WellKnown` rules provide advanced rules against common string\n  // patterns.\n  oneof well_known {\n    // `email` specifies that the field value must be a valid email address, for\n    // example \"foo@example.com\".\n    //\n    // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).\n    // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),\n    // which allows many unexpected forms of email addresses and will easily match\n    // a typographical error.\n    //\n    // If the field value isn't a valid email address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid email address\n    //   string value = 1 [(buf.validate.field).string.email = true];\n    // }\n    // ```\n    bool email = 12 [\n      (predefined).cel = {\n        id: \"string.email\"\n        message: \"value must be a valid email address\"\n        expression: \"!rules.email || this == '' || this.isEmail()\"\n      },\n      (predefined).cel = {\n        id: \"string.email_empty\"\n        message: \"value is empty, which is not a valid email address\"\n        expression: \"!rules.email || this != ''\"\n      }\n    ];\n\n    // `hostname` specifies that the field value must be a valid hostname, for\n    // example \"foo.example.com\".\n    //\n    // A valid hostname follows the rules below:\n    // - The name consists of one or more labels, separated by a dot (\".\").\n    // - Each label can be 1 to 63 alphanumeric characters.\n    // - A label can contain hyphens (\"-\"), but must not start or end with a hyphen.\n    // - The right-most label must not be digits only.\n    // - The name can have a trailing dot—for example, \"foo.example.com.\".\n    // - The name can be 253 characters at most, excluding the optional trailing dot.\n    //\n    // If the field value isn't a valid hostname, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname\n    //   string value = 1 [(buf.validate.field).string.hostname = true];\n    // }\n    // ```\n    bool hostname = 13 [\n      (predefined).cel = {\n        id: \"string.hostname\"\n        message: \"value must be a valid hostname\"\n        expression: \"!rules.hostname || this == '' || this.isHostname()\"\n      },\n      (predefined).cel = {\n        id: \"string.hostname_empty\"\n        message: \"value is empty, which is not a valid hostname\"\n        expression: \"!rules.hostname || this != ''\"\n      }\n    ];\n\n    // `ip` specifies that the field value must be a valid IP (v4 or v6) address.\n    //\n    // IPv4 addresses are expected in the dotted decimal format—for example, \"192.168.5.21\".\n    // IPv6 addresses are expected in their text representation—for example, \"::1\",\n    // or \"2001:0DB8:ABCD:0012::0\".\n    //\n    // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone identifiers for IPv6 addresses (for example, \"fe80::a%en1\") are supported.\n    //\n    // If the field value isn't a valid IP address, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP address\n    //   string value = 1 [(buf.validate.field).string.ip = true];\n    // }\n    // ```\n    bool ip = 14 [\n      (predefined).cel = {\n        id: \"string.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this == '' || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this != ''\"\n      }\n    ];\n\n    // `ipv4` specifies that the field value must be a valid IPv4 address—for\n    // example \"192.168.5.21\". If the field value isn't a valid IPv4 address, an\n    // error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address\n    //   string value = 1 [(buf.validate.field).string.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 15 [\n      (predefined).cel = {\n        id: \"string.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this == '' || this.isIp(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this != ''\"\n      }\n    ];\n\n    // `ipv6` specifies that the field value must be a valid IPv6 address—for\n    // example \"::1\", or \"d7a:115c:a1e0:ab12:4843:cd96:626b:430b\". If the field\n    // value is not a valid IPv6 address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address\n    //   string value = 1 [(buf.validate.field).string.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 16 [\n      (predefined).cel = {\n        id: \"string.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this == '' || this.isIp(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this != ''\"\n      }\n    ];\n\n    // `uri` specifies that the field value must be a valid URI, for example\n    // \"https://example.com/foo/bar?baz=quux#frag\".\n    //\n    // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI\n    //   string value = 1 [(buf.validate.field).string.uri = true];\n    // }\n    // ```\n    bool uri = 17 [\n      (predefined).cel = {\n        id: \"string.uri\"\n        message: \"value must be a valid URI\"\n        expression: \"!rules.uri || this == '' || this.isUri()\"\n      },\n      (predefined).cel = {\n        id: \"string.uri_empty\"\n        message: \"value is empty, which is not a valid URI\"\n        expression: \"!rules.uri || this != ''\"\n      }\n    ];\n\n    // `uri_ref` specifies that the field value must be a valid URI Reference—either\n    // a URI such as \"https://example.com/foo/bar?baz=quux#frag\", or a Relative\n    // Reference such as \"./foo/bar?query\".\n    //\n    // URI, URI Reference, and Relative Reference are defined in the internet\n    // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone\n    // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI Reference, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI Reference\n    //   string value = 1 [(buf.validate.field).string.uri_ref = true];\n    // }\n    // ```\n    bool uri_ref = 18 [(predefined).cel = {\n      id: \"string.uri_ref\"\n      message: \"value must be a valid URI Reference\"\n      expression: \"!rules.uri_ref || this.isUriRef()\"\n    }];\n\n    // `address` specifies that the field value must be either a valid hostname\n    // (for example, \"example.com\"), or a valid IP (v4 or v6) address (for example,\n    // \"192.168.0.1\", or \"::1\"). If the field value isn't a valid hostname or IP,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname, or ip address\n    //   string value = 1 [(buf.validate.field).string.address = true];\n    // }\n    // ```\n    bool address = 21 [\n      (predefined).cel = {\n        id: \"string.address\"\n        message: \"value must be a valid hostname, or ip address\"\n        expression: \"!rules.address || this == '' || this.isHostname() || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.address_empty\"\n        message: \"value is empty, which is not a valid hostname, or ip address\"\n        expression: \"!rules.address || this != ''\"\n      }\n    ];\n\n    // `uuid` specifies that the field value must be a valid UUID as defined by\n    // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the\n    // field value isn't a valid UUID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid UUID\n    //   string value = 1 [(buf.validate.field).string.uuid = true];\n    // }\n    // ```\n    bool uuid = 22 [\n      (predefined).cel = {\n        id: \"string.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this != ''\"\n      }\n    ];\n\n    // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes\n    // omitted. If the field value isn't a valid UUID without dashes, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid trimmed UUID\n    //   string value = 1 [(buf.validate.field).string.tuuid = true];\n    // }\n    // ```\n    bool tuuid = 33 [\n      (predefined).cel = {\n        id: \"string.tuuid\"\n        message: \"value must be a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this == '' || this.matches('^[0-9a-fA-F]{32}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.tuuid_empty\"\n        message: \"value is empty, which is not a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this != ''\"\n      }\n    ];\n\n    // `ip_with_prefixlen` specifies that the field value must be a valid IP\n    // (v4 or v6) address with prefix length—for example, \"192.168.5.21/16\" or\n    // \"2001:0DB8:ABCD:0012::F1/64\". If the field value isn't a valid IP with\n    // prefix length, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP with prefix length\n    //    string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];\n    // }\n    // ```\n    bool ip_with_prefixlen = 26 [\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this == '' || this.isIpPrefix()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv4_with_prefixlen` specifies that the field value must be a valid\n    // IPv4 address with prefix length—for example, \"192.168.5.21/16\". If the\n    // field value isn't a valid IPv4 address with prefix length, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address with prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv4_with_prefixlen = 27 [\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen\"\n        message: \"value must be a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv6_with_prefixlen` specifies that the field value must be a valid\n    // IPv6 address with prefix length—for example, \"2001:0DB8:ABCD:0012::F1/64\".\n    // If the field value is not a valid IPv6 address with prefix length,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv6_with_prefixlen = 28 [\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen\"\n        message: \"value must be a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)\n    // prefix—for example, \"192.168.0.0/16\" or \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value isn't a valid IP prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP prefix\n    //    string value = 1 [(buf.validate.field).string.ip_prefix = true];\n    // }\n    // ```\n    bool ip_prefix = 29 [\n      (predefined).cel = {\n        id: \"string.ip_prefix\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this == '' || this.isIpPrefix(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_prefix_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv4_prefix` specifies that the field value must be a valid IPv4\n    // prefix, for example \"192.168.0.0/16\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"192.168.0.0/16\" designates the left-most 16 bits for the prefix,\n    // and the remaining 16 bits must be zero.\n    //\n    // If the field value isn't a valid IPv4 prefix, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv4_prefix = true];\n    // }\n    // ```\n    bool ipv4_prefix = 30 [\n      (predefined).cel = {\n        id: \"string.ipv4_prefix\"\n        message: \"value must be a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this == '' || this.isIpPrefix(4, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for\n    // example, \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value is not a valid IPv6 prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv6_prefix = true];\n    // }\n    // ```\n    bool ipv6_prefix = 31 [\n      (predefined).cel = {\n        id: \"string.ipv6_prefix\"\n        message: \"value must be a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this == '' || this.isIpPrefix(6, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this != ''\"\n      }\n    ];\n\n    // `host_and_port` specifies that the field value must be valid host/port\n    // pair—for example, \"example.com:8080\".\n    //\n    // The host can be one of:\n    //- An IPv4 address in dotted decimal format—for example, \"192.168.5.21\".\n    //- An IPv6 address enclosed in square brackets—for example, \"[2001:0DB8:ABCD:0012::F1]\".\n    //- A hostname—for example, \"example.com\".\n    //\n    // The port is separated by a colon. It must be non-empty, with a decimal number\n    // in the range of 0-65535, inclusive.\n    bool host_and_port = 32 [\n      (predefined).cel = {\n        id: \"string.host_and_port\"\n        message: \"value must be a valid host (hostname or IP address) and port pair\"\n        expression: \"!rules.host_and_port || this == '' || this.isHostAndPort(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.host_and_port_empty\"\n        message: \"value is empty, which is not a valid host and port pair\"\n        expression: \"!rules.host_and_port || this != ''\"\n      }\n    ];\n\n    // `ulid` specifies that the field value must be a valid ULID (Universally Unique\n    // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).\n    // If the field value isn't a valid ULID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid ULID\n    //   string value = 1 [(buf.validate.field).string.ulid = true];\n    // }\n    // ```\n    bool ulid = 35 [\n      (predefined).cel = {\n        id: \"string.ulid\"\n        message: \"value must be a valid ULID\"\n        expression: \"!rules.ulid || this == '' || this.matches('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.ulid_empty\"\n        message: \"value is empty, which is not a valid ULID\"\n        expression: \"!rules.ulid || this != ''\"\n      }\n    ];\n\n    // `well_known_regex` specifies a common well-known pattern\n    // defined as a regex. If the field value doesn't match the well-known\n    // regex, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid HTTP header value\n    //   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];\n    // }\n    // ```\n    //\n    // #### KnownRegex\n    //\n    // `well_known_regex` contains some well-known patterns.\n    //\n    // | Name                          | Number | Description                               |\n    // |-------------------------------|--------|-------------------------------------------|\n    // | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |\n    // | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2)  |\n    // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |\n    KnownRegex well_known_regex = 24 [\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name\"\n        message: \"value must be a valid HTTP header name\"\n        expression:\n          \"rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^:?[0-9a-zA-Z!#$%&\\\\'*+-.^_|~\\\\x60]+$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]+$')\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name_empty\"\n        message: \"value is empty, which is not a valid HTTP header name\"\n        expression: \"rules.well_known_regex != 1 || this != ''\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_value\"\n        message: \"value must be a valid HTTP header value\"\n        expression:\n          \"rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^[^\\\\u0000-\\\\u0008\\\\u000A-\\\\u001F\\\\u007F]*$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]*$')\"\n      }\n    ];\n  }\n\n  // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to\n  // enable strict header validation. By default, this is true, and HTTP header\n  // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser\n  // validations that only disallow `\\r\\n\\0` characters, which can be used to\n  // bypass header matching rules.\n  //\n  // ```proto\n  // message MyString {\n  //   // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.\n  //   string value = 1 [(buf.validate.field).string.strict = false];\n  // }\n  // ```\n  optional bool strict = 25;\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyString {\n  //   string value = 1 [\n  //     (buf.validate.field).string.example = \"hello\",\n  //     (buf.validate.field).string.example = \"world\"\n  //   ];\n  // }\n  // ```\n  repeated string example = 34 [(predefined).cel = {\n    id: \"string.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// KnownRegex contains some well-known patterns.\nenum KnownRegex {\n  KNOWN_REGEX_UNSPECIFIED = 0;\n\n  // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2).\n  KNOWN_REGEX_HTTP_HEADER_NAME = 1;\n\n  // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4).\n  KNOWN_REGEX_HTTP_HEADER_VALUE = 2;\n}\n\n// BytesRules describe the rules applied to `bytes` values. These rules\n// may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.\nmessage BytesRules {\n  // `const` requires the field value to exactly match the specified bytes\n  // value. If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be \"\\x01\\x02\\x03\\x04\"\n  //   bytes value = 1 [(buf.validate.field).bytes.const = \"\\x01\\x02\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes const = 1 [(predefined).cel = {\n    id: \"bytes.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must be %x'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` requires the field value to have the specified length in bytes.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be 4 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.len = 4];\n  // }\n  // ```\n  optional uint64 len = 13 [(predefined).cel = {\n    id: \"bytes.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s bytes'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` requires the field value to have at least the specified minimum\n  // length in bytes.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be at least 2 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"bytes.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s bytes'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` requires the field value to have at most the specified maximum\n  // length in bytes.\n  // If the field value exceeds the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be at most 6 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"bytes.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value must be at most %s bytes'.format([rules.max_len]) : ''\"\n  }];\n\n  // `pattern` requires the field value to match the specified regular\n  // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).\n  // The value of the field must be valid UTF-8 or validation will fail with a\n  // runtime error.\n  // If the field value doesn't match the pattern, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must match regex pattern \"^[a-zA-Z0-9]+$\".\n  //   optional bytes value = 1 [(buf.validate.field).bytes.pattern = \"^[a-zA-Z0-9]+$\"];\n  // }\n  // ```\n  optional string pattern = 4 [(predefined).cel = {\n    id: \"bytes.pattern\"\n    expression: \"!string(this).matches(rules.pattern) ? 'value must match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` requires the field value to have the specified bytes at the\n  // beginning of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have prefix \\x01\\x02\n  //   optional bytes value = 1 [(buf.validate.field).bytes.prefix = \"\\x01\\x02\"];\n  // }\n  // ```\n  optional bytes prefix = 5 [(predefined).cel = {\n    id: \"bytes.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix %x'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` requires the field value to have the specified bytes at the end\n  // of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have suffix \\x03\\x04\n  //   optional bytes value = 1 [(buf.validate.field).bytes.suffix = \"\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes suffix = 6 [(predefined).cel = {\n    id: \"bytes.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix %x'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` requires the field value to have the specified bytes anywhere in\n  // the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not contain \\x02\\x03\n  //   optional bytes value = 1 [(buf.validate.field).bytes.contains = \"\\x02\\x03\"];\n  // }\n  // ```\n  optional bytes contains = 7 [(predefined).cel = {\n    id: \"bytes.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain %x'.format([rules.contains]) : ''\"\n  }];\n\n  // `in` requires the field value to be equal to one of the specified\n  // values. If the field value doesn't match any of the specified values, an\n  // error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes in = 8 [(predefined).cel = {\n    id: \"bytes.in\"\n    expression: \"getField(rules, 'in').size() > 0 && !(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the specified\n  // values.\n  // If the field value matches any of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must not in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.not_in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes not_in = 9 [(predefined).cel = {\n    id: \"bytes.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // WellKnown rules provide advanced rules against common byte\n  // patterns\n  oneof well_known {\n    // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IP address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ip = true];\n    // }\n    // ```\n    bool ip = 10 [\n      (predefined).cel = {\n        id: \"bytes.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this.size() != 0\"\n      }\n    ];\n\n    // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv4 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 11 [\n      (predefined).cel = {\n        id: \"bytes.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() == 0 || this.size() == 4\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() != 0\"\n      }\n    ];\n\n    // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv6 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 12 [\n      (predefined).cel = {\n        id: \"bytes.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() != 0\"\n      }\n    ];\n\n    // `uuid` ensures that the field `value` encodes the 128-bit UUID data as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).\n    // The field must contain exactly 16 bytes\n    // representing the UUID. If the field value isn't a valid UUID, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid UUID\n    //   optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];\n    // }\n    // ```\n    bool uuid = 15 [\n      (predefined).cel = {\n        id: \"bytes.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this.size() != 0\"\n      }\n    ];\n  }\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBytes {\n  //   bytes value = 1 [\n  //     (buf.validate.field).bytes.example = \"\\x01\\x02\",\n  //     (buf.validate.field).bytes.example = \"\\x02\\x03\"\n  //   ];\n  // }\n  // ```\n  repeated bytes example = 14 [(predefined).cel = {\n    id: \"bytes.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// EnumRules describe the rules applied to `enum` values.\nmessage EnumRules {\n  // `const` requires the field value to exactly match the specified enum value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be exactly MY_ENUM_VALUE1.\n  //   MyEnum value = 1 [(buf.validate.field).enum.const = 1];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"enum.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `defined_only` requires the field value to be one of the defined values for\n  // this enum, failing on any undefined value.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be a defined value of MyEnum.\n  //   MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];\n  // }\n  // ```\n  optional bool defined_only = 2;\n\n  // `in` requires the field value to be equal to one of the\n  //specified enum values. If the field value doesn't match any of the\n  //specified values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be equal to one of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 in = 3 [(predefined).cel = {\n    id: \"enum.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the\n  //specified enum values. If the field value matches one of the specified\n  // values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must not be equal to any of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 not_in = 4 [(predefined).cel = {\n    id: \"enum.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //     (buf.validate.field).enum.example = 1,\n  //     (buf.validate.field).enum.example = 2\n  // }\n  // ```\n  repeated int32 example = 5 [(predefined).cel = {\n    id: \"enum.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// RepeatedRules describe the rules applied to `repeated` values.\nmessage RepeatedRules {\n  // `min_items` requires that this field must contain at least the specified\n  // minimum number of items.\n  //\n  // Note that `min_items = 1` is equivalent to setting a field as `required`.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain at least  2 items\n  //   repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];\n  // }\n  // ```\n  optional uint64 min_items = 1 [(predefined).cel = {\n    id: \"repeated.min_items\"\n    expression: \"uint(this.size()) < rules.min_items ? 'value must contain at least %d item(s)'.format([rules.min_items]) : ''\"\n  }];\n\n  // `max_items` denotes that this field must not exceed a\n  // certain number of items as the upper limit. If the field contains more\n  // items than specified, an error message will be generated, requiring the\n  // field to maintain no more than the specified number of items.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain no more than 3 item(s)\n  //   repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];\n  // }\n  // ```\n  optional uint64 max_items = 2 [(predefined).cel = {\n    id: \"repeated.max_items\"\n    expression: \"uint(this.size()) > rules.max_items ? 'value must contain no more than %s item(s)'.format([rules.max_items]) : ''\"\n  }];\n\n  // `unique` indicates that all elements in this field must\n  // be unique. This rule is strictly applicable to scalar and enum\n  // types, with message types not being supported.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // repeated value must contain unique items\n  //   repeated string value = 1 [(buf.validate.field).repeated.unique = true];\n  // }\n  // ```\n  optional bool unique = 3 [(predefined).cel = {\n    id: \"repeated.unique\"\n    message: \"repeated value must contain unique items\"\n    expression: \"!rules.unique || this.unique()\"\n  }];\n\n  // `items` details the rules to be applied to each item\n  // in the field. Even for repeated message fields, validation is executed\n  // against each item unless `ignore` is specified.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // The items in the field `value` must follow the specified rules.\n  //   repeated string value = 1 [(buf.validate.field).repeated.items = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Repeated items\n  // cannot be unset.\n  optional FieldRules items = 4;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// MapRules describe the rules applied to `map` values.\nmessage MapRules {\n  // Specifies the minimum number of key-value pairs allowed. If the field has\n  // fewer key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at least 2 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];\n  // }\n  // ```\n  optional uint64 min_pairs = 1 [(predefined).cel = {\n    id: \"map.min_pairs\"\n    expression: \"uint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''\"\n  }];\n\n  // Specifies the maximum number of key-value pairs allowed. If the field has\n  // more key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at most 3 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];\n  // }\n  // ```\n  optional uint64 max_pairs = 2 [(predefined).cel = {\n    id: \"map.max_pairs\"\n    expression: \"uint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''\"\n  }];\n\n  // Specifies the rules to be applied to each key in the field.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The keys in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.keys = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Map keys cannot be unset.\n  optional FieldRules keys = 4;\n\n  // Specifies the rules to be applied to the value of each key in the\n  // field. Message values will still have their validations evaluated unless\n  // `ignore` is specified.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The values in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.values = {\n  //     string: {\n  //       min_len: 5\n  //       max_len: 20\n  //     }\n  //   }];\n  // }\n  // ```\n  // Note that the `required` rule does not apply. Map values cannot be unset.\n  optional FieldRules values = 5;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type.\nmessage AnyRules {\n  // `in` requires the field's `type_url` to be equal to one of the\n  //specified values. If it doesn't match any of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must have a `type_url` equal to one of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       in: [\"type.googleapis.com/MyType1\", \"type.googleapis.com/MyType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2;\n\n  // requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must not have a `type_url` equal to any of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       not_in: [\"type.googleapis.com/ForbiddenType1\", \"type.googleapis.com/ForbiddenType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3;\n}\n\n// DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type.\nmessage DurationRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must equal 5s\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = \"5s\"];\n  // }\n  // ```\n  optional google.protobuf.Duration const = 2 [(predefined).cel = {\n    id: \"duration.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,\n    // exclusive. If the field's value is greater than or equal to the specified\n    // value, an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than 5s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = \"5s\"];\n    // }\n    // ```\n    google.protobuf.Duration lt = 3 [(predefined).cel = {\n      id: \"duration.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` indicates that the field must be less than or equal to the specified\n    // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than or equal to 10s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = \"10s\"];\n    // }\n    // ```\n    google.protobuf.Duration lte = 4 [(predefined).cel = {\n      id: \"duration.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the duration field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be greater than 5s [duration.gt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];\n    //\n    //   // duration must be greater than 5s and less than 10s [duration.gt_lt]\n    //   google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //   // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]\n    //   google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gt = 5 [\n      (predefined).cel = {\n        id: \"duration.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the duration field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value must\n    // be outside the specified range. If the field value doesn't meet the\n    // required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //  // duration must be greater than or equal to 5s [duration.gte]\n    //  google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];\n    //\n    //  // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]\n    //  google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //  // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]\n    //  google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gte = 6 [\n      (predefined).cel = {\n        id: \"duration.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value doesn't correspond to any of the specified values,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration in = 7 [(predefined).cel = {\n    id: \"duration.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` denotes that the field must not be equal to\n  // any of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value matches any of these values, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must not be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration not_in = 8 [(predefined).cel = {\n    id: \"duration.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDuration {\n  //   google.protobuf.Duration value = 1 [\n  //     (buf.validate.field).duration.example = { seconds: 1 },\n  //     (buf.validate.field).duration.example = { seconds: 2 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Duration example = 9 [(predefined).cel = {\n    id: \"duration.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type.\nmessage FieldMaskRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   // value must equal [\"a\"]\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {\n  //       paths: [\"a\"]\n  //   }];\n  // }\n  // ```\n  optional google.protobuf.FieldMask const = 1 [(predefined).cel = {\n    id: \"field_mask.const\"\n    expression: \"this.paths != getField(rules, 'const').paths ? 'value must equal paths %s'.format([getField(rules, 'const').paths]) : ''\"\n  }];\n\n  // `in` requires the field value to only contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths doesn't match the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask must only contain paths listed in `in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       in: [\"a\", \"b\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2 [(predefined).cel = {\n    id: \"field_mask.in\"\n    expression: \"!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'value must only contain paths in %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths matches the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask shall not contain paths listed in `not_in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       not_in: [\"forbidden\", \"immutable\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3 [(predefined).cel = {\n    id: \"field_mask.not_in\"\n    expression: \"!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'value must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   google.protobuf.FieldMask value = 1 [\n  //     (buf.validate.field).field_mask.example = { paths: [\"a\", \"b\"] },\n  //     (buf.validate.field).field_mask.example = { paths: [\"c.a\", \"d\"] },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.FieldMask example = 4 [(predefined).cel = {\n    id: \"field_mask.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.\nmessage TimestampRules {\n  // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must equal 2023-05-03T10:00:00Z\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];\n  // }\n  // ```\n  optional google.protobuf.Timestamp const = 2 [(predefined).cel = {\n    id: \"timestamp.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // requires the duration field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be less than 'P3D' [duration.lt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lt = 3 [(predefined).cel = {\n      id: \"timestamp.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lte = 4 [(predefined).cel = {\n      id: \"timestamp.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n\n    // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //  // value must be less than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];\n    // }\n    // ```\n    bool lt_now = 7 [(predefined).cel = {\n      id: \"timestamp.lt_now\"\n      expression: \"(rules.lt_now && this > now) ? 'value must be less than now' : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the timestamp field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gt = 5 [\n      (predefined).cel = {\n        id: \"timestamp.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the timestamp field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value\n    // must be outside the specified range. If the field value doesn't meet\n    // the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gte = 6 [\n      (predefined).cel = {\n        id: \"timestamp.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // value must be greater than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];\n    // }\n    // ```\n    bool gt_now = 8 [(predefined).cel = {\n      id: \"timestamp.gt_now\"\n      expression: \"(rules.gt_now && this < now) ? 'value must be greater than now' : ''\"\n    }];\n  }\n\n  // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must be within 1 hour of now\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];\n  // }\n  // ```\n  optional google.protobuf.Duration within = 9 [(predefined).cel = {\n    id: \"timestamp.within\"\n    expression: \"this < now-rules.within || this > now+rules.within ? 'value must be within %s of now'.format([rules.within]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   google.protobuf.Timestamp value = 1 [\n  //     (buf.validate.field).timestamp.example = { seconds: 1672444800 },\n  //     (buf.validate.field).timestamp.example = { seconds: 1672531200 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Timestamp example = 10 [(predefined).cel = {\n    id: \"timestamp.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// `Violations` is a collection of `Violation` messages. This message type is returned by\n// Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules.\n// Each individual violation is represented by a `Violation` message.\nmessage Violations {\n  // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.\n  repeated Violation violations = 1;\n}\n\n// `Violation` represents a single instance where a validation rule, expressed\n// as a `Rule`, was not met. It provides information about the field that\n// caused the violation, the specific rule that wasn't fulfilled, and a\n// human-readable error message.\n//\n// For example, consider the following message:\n//\n// ```proto\n// message User {\n//     int32 age = 1 [(buf.validate.field).cel = {\n//         id: \"user.age\",\n//         expression: \"this < 18 ? 'User must be at least 18 years old' : ''\",\n//     }];\n// }\n// ```\n//\n// It could produce the following violation:\n//\n// ```json\n// {\n//   \"ruleId\": \"user.age\",\n//   \"message\": \"User must be at least 18 years old\",\n//   \"field\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 1,\n//         \"fieldName\": \"age\",\n//         \"fieldType\": \"TYPE_INT32\"\n//       }\n//     ]\n//   },\n//   \"rule\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 23,\n//         \"fieldName\": \"cel\",\n//         \"fieldType\": \"TYPE_MESSAGE\",\n//         \"index\": \"0\"\n//       }\n//     ]\n//   }\n// }\n// ```\nmessage Violation {\n  // `field` is a machine-readable path to the field that failed validation.\n  // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  // }\n  // ```\n  //\n  // It could produce the following violation:\n  //\n  // ```textproto\n  // violation {\n  //   field { element { field_number: 1, field_name: \"a\", field_type: 8 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath field = 5;\n\n  // `rule` is a machine-readable path that points to the specific rule that failed validation.\n  // This will be a nested field starting from the FieldRules of the field that failed validation.\n  // For custom rules, this will provide the path of the rule, e.g. `cel[0]`.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  //   bool b = 2 [(buf.validate.field).cel = {\n  //     id: \"custom_rule\",\n  //     expression: \"!this ? 'b must be true': ''\"\n  //   }]\n  // }\n  // ```\n  //\n  // It could produce the following violations:\n  //\n  // ```textproto\n  // violation {\n  //   rule { element { field_number: 25, field_name: \"required\", field_type: 8 } }\n  //   ...\n  // }\n  // violation {\n  //   rule { element { field_number: 23, field_name: \"cel\", field_type: 11, index: 0 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath rule = 6;\n\n  // `rule_id` is the unique identifier of the `Rule` that was not fulfilled.\n  // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.\n  optional string rule_id = 2;\n\n  // `message` is a human-readable error message that describes the nature of the violation.\n  // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.\n  optional string message = 3;\n\n  // `for_key` indicates whether the violation was caused by a map key, rather than a value.\n  optional bool for_key = 4;\n\n  reserved 1;\n  reserved \"field_path\";\n}\n\n// `FieldPath` provides a path to a nested protobuf field.\n//\n// This message provides enough information to render a dotted field path even without protobuf descriptors.\n// It also provides enough information to resolve a nested field through unknown wire data.\nmessage FieldPath {\n  // `elements` contains each element of the path, starting from the root and recursing downward.\n  repeated FieldPathElement elements = 1;\n}\n\n// `FieldPathElement` provides enough information to nest through a single protobuf field.\n//\n// If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.\n// A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.\n// The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.\nmessage FieldPathElement {\n  // `field_number` is the field number this path element refers to.\n  optional int32 field_number = 1;\n\n  // `field_name` contains the field name this path element refers to.\n  // This can be used to display a human-readable path even if the field number is unknown.\n  optional string field_name = 2;\n\n  // `field_type` specifies the type of this field. When using reflection, this value is not needed.\n  //\n  // This value is provided to make it possible to traverse unknown fields through wire data.\n  // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.\n  //\n  // [1]: https://protobuf.dev/programming-guides/encoding/#packed\n  // [2]: https://protobuf.dev/programming-guides/encoding/#groups\n  //\n  // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and\n  // can be explicitly used in Protocol Buffers 2023 Edition.\n  optional google.protobuf.FieldDescriptorProto.Type field_type = 3;\n\n  // `key_type` specifies the map key type of this field. This value is useful when traversing\n  // unknown fields through wire data: specifically, it allows handling the differences between\n  // different integer encodings.\n  optional google.protobuf.FieldDescriptorProto.Type key_type = 4;\n\n  // `value_type` specifies map value type of this field. This is useful if you want to display a\n  // value inside unknown fields through wire data.\n  optional google.protobuf.FieldDescriptorProto.Type value_type = 5;\n\n  // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field.\n  oneof subscript {\n    // `index` specifies a 0-based index into a repeated field.\n    uint64 index = 6;\n\n    // `bool_key` specifies a map key of type bool.\n    bool bool_key = 7;\n\n    // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.\n    int64 int_key = 8;\n\n    // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.\n    uint64 uint_key = 9;\n\n    // `string_key` specifies a map key of type string.\n    string string_key = 10;\n  }\n}\n"
  },
  {
    "path": "cmd/buf/testdata/customoptions1/a.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FieldOptions {\n  int32 baz = 50007;\n}\n\nmessage Foo {\n  string bar = 1 [(baz) = 42];\n}\n"
  },
  {
    "path": "cmd/buf/testdata/export/another/proto/README.md",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/export/another/proto/another.proto",
    "content": "syntax = \"proto3\";\n\npackage another;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/export/another/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/another\n"
  },
  {
    "path": "cmd/buf/testdata/export/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - another/proto\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/export/other/proto/LICENSE",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/export/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/export/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/export/other/proto/unimported.proto",
    "content": "syntax = \"proto3\";\n\n// This file isn't imported so if we just export proto/ it should not appear.\n\npackage request;\n\nimport \"another.proto\";\n\nmessage NotImported {\n  string name = 1;\n  another.Request request = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/export/proto/LICENSE",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/export/proto/README.md",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/export/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/rpc\ndeps:\n  - bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/export/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/fail/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage other;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/fail/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - BASIC\n"
  },
  {
    "path": "cmd/buf/testdata/fail2/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/fail2/buf/buf2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nimport \"buf/buf.proto\";\n\nmessage Foo2 {\n  int64 one_two = 1;\n  int64 oneThree = 3;\n  Foo foo = 4;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/fail2/buf/buf3.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo3 {\n  int64 one_two = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/fail2/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - BASIC\n\n"
  },
  {
    "path": "cmd/buf/testdata/fail_buf_mod/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage other;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/fail_buf_mod/buf.mod",
    "content": "version: v1\nlint:\n  use:\n    - BASIC\n  except:\n    - FIELD_LOWER_SNAKE_CASE\n"
  },
  {
    "path": "cmd/buf/testdata/failarchive/fail/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage other;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/failarchive/fail/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - BASIC\n"
  },
  {
    "path": "cmd/buf/testdata/format/complex/complex.proto",
    "content": "syntax = \"proto2\";\n\npackage foo.bar;\n\noption java_multiple_files = true;\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Simple {\n\toptional string name = 1;\n\toptional uint64 id = 2;\n}\n\nextend . google.\n  protobuf .\n   ExtensionRangeOptions {\n\toptional string label = 20000;\n}\n\nmessage Test {\n\textensions 100 to 200;\n\n\textensions 249, 300 to 350, 500 to 550, 20000 to max [(label) = \"jazz\"];\n\n\tmessage Nested {\n\t\textend google.protobuf.MessageOptions {\n\t\t\toptional int32 fooblez = 20003;\n\t\t}\n\t\tmessage _NestedNested {\n\t\t\tenum EEE {\n\t\t\t\tOK = 0;\n\t\t\t\tV1 = 1;\n\t\t\t\tV2 = 2;\n\t\t\t\tV3 = 3;\n\t\t\t\tV4 = 4;\n\t\t\t\tV5 = 5;\n\t\t\t\tV6 = 6;\n\t\t\t}\n\t\t\toption (fooblez) = 10101;\n\t\t\textend Test {\n\t\t\t\toptional string _garblez = 100;\n\t\t\t}\n\t\t\toption (rept) = { foo: \"goo\" [foo.bar.Test.Nested._NestedNested._garblez]: \"boo\" };\n\t\t\tmessage NestedNestedNested {\n\t\t\t\toption (rept) = { foo: \"hoo\" [Test.Nested._NestedNested._garblez]: \"spoo\" };\n\n\t\t\t\toptional Test Test = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\toptional string foo = 1 [json_name = \"|foo|\"];\n\trepeated int32 array = 2;\n\toptional Simple s = 3;\n\trepeated Simple r = 4;\n\tmap<string, int32> m = 5;\n\n\toptional bytes b = 6 [default = \"\\0\\1\\2\\3\\4\\5\\6\\7fubar!\"];\n}\n\nenum EnumWithReservations {\n\treserved 1000 to max;\n\treserved -2 to 1;\n\treserved 5 to 10, 12 to 15, 18;\n\treserved -5 to -3;\n\treserved \"C\", \"B\", \"A\";\n\n\tX = 2;\n\tY = 3;\n\tZ = 4;\n}\n\nmessage MessageWithReservations {\n\treserved 5 to 10, 12 to 15, 18;\n\treserved 1000 to max;\n\treserved \"A\", \"B\", \"C\";\n}\n\nmessage MessageWithMap {\n\tmap<string, Simple> vals = 1;\n}\n\nextend google.protobuf.MessageOptions {\n\trepeated Test rept = 20002;\n\toptional Test.Nested._NestedNested.EEE eee = 20010;\n\toptional Another a = 20020;\n\toptional MessageWithMap map_vals = 20030;\n}\n\nmessage Another {\n    option (.foo.bar.rept) = { foo: \"abc\" s < name: \"foo\", id: 123 >, array: [1, 2 ,3], r:[<name:\"f\">, {name:\"s\"}, {id:456} ], };\n    option (foo.bar.rept) = { foo: \"def\" s { name: \"bar\", id: 321 }, array: [3, 2 ,1], r:{name:\"g\"} r:{name:\"s\"}};\n    option (rept) = { foo: \"def\" };\n    option (eee) = V1;\n\toption (a) = { fff: OK };\n\toption (a).test = { m { key: \"foo\" value: 100 } m { key: \"bar\" value: 200 }};\n\toption (a).test.foo = \"m&m\";\n\toption (a).test.s.name = \"yolo\";\n    option (a).test.s.id = 98765;\n    option (a).test.array = 1;\n    option (a).test.array = 2;\n    option (a).test.(.foo.bar.Test.Nested._NestedNested._garblez) = \"whoah!\";\n\n\toption (map_vals).vals = {}; // no key, no value\n\toption (map_vals).vals = {key: \"foo\"}; // no value\n\toption (map_vals).vals = {key: \"bar\", value: {name: \"baz\"}};\n\n    optional Test test = 1;\n    optional Test.Nested._NestedNested.EEE fff = 2 [default = V1];\n}\n\nmessage Validator {\n\tenum Action {\n\t\tLOGIN = 0;\n\t\tREAD = 1;\n\t\tWRITE = 2;\n\t}\n\tmessage Permission {\n\t\toptional Action action = 1;\n\t\toptional string entity = 2;\n\t}\n\n\toptional bool authenticated = 1;\n\trepeated Permission permission = 2;\n\n}\n\nextend google.protobuf.MethodOptions {\n\toptional Validator validator = 12345;\n}\n\nservice TestTestService {\n\trpc UserAuth(Test) returns (Test) {\n\t\toption (validator) = {\n\t\t\tauthenticated: true\n\t\t\tpermission: {\n\t\t\t\taction: LOGIN\n\t\t\t\tentity: \"client\"\n\t\t\t}\n\t\t};\n\t}\n\trpc Get(Test) returns (Test) {\n\t\toption (validator) = {\n\t\t\tauthenticated: true\n\t\t\tpermission: {\n\t\t\t\taction: READ\n\t\t\t\tentity: \"user\"\n\t\t\t}\n\t\t};\n\t}\n}\n\nmessage Rule {\n  message StringRule {\n    optional string pattern = 1;\n    optional bool allow_empty = 2;\n    optional int32 min_len = 3;\n    optional int32 max_len = 4;\n  }\n  message IntRule {\n    optional int64 min_val = 1;\n    optional uint64 max_val = 2;\n  }\n  message RepeatedRule {\n    optional bool allow_empty = 1;\n    optional int32 min_items = 2;\n    optional int32 max_items = 3;\n    optional Rule items = 4;\n  }\n  oneof rule {\n    StringRule string = 1;\n    RepeatedRule repeated = 2;\n    IntRule int = 3;\n\tgroup FloatRule = 4 {\n\t\toptional double min_val = 1;\n\t\toptional double max_val = 2;\n\t}\n  }\n}\n\nextend google.protobuf.FieldOptions {\n  optional Rule rules = 1234;\n}\n\nmessage IsAuthorizedReq {\n    repeated string subjects = 1\n      [(rules).repeated = {\n        min_items: 1,\n        items: { string: { pattern: \"^(?:(?:team:(?:local|ldap))|user):[[:alnum:]_-]+$\" } },\n       }];\n}\n\nmessage KeywordCollisions {\n\toptional bool syntax = 1;\n\toptional bool import = 2;\n\toptional bool public = 3;\n\toptional bool weak = 4;\n\toptional bool package = 5;\n\toptional string string = 6;\n\toptional bytes bytes = 7;\n\toptional int32 int32 = 8;\n\toptional int64 int64 = 9;\n\toptional uint32 uint32 = 10;\n\toptional uint64 uint64 = 11;\n\toptional sint32 sint32 = 12;\n\toptional sint64 sint64 = 13;\n\toptional fixed32 fixed32 = 14;\n\toptional fixed64 fixed64 = 15;\n\toptional sfixed32 sfixed32 = 16;\n\toptional sfixed64 sfixed64 = 17;\n\toptional bool bool = 18;\n\toptional float float = 19;\n\toptional double double = 20;\n\toptional bool optional = 21;\n\toptional bool repeated = 22;\n\toptional bool required = 23;\n\toptional bool message = 24;\n\toptional bool enum = 25;\n\toptional bool service = 26;\n\toptional bool rpc = 27;\n\toptional bool option = 28;\n\toptional bool extend = 29;\n\toptional bool extensions = 30;\n\toptional bool reserved = 31;\n\toptional bool to = 32;\n\toptional int32 true = 33;\n\toptional int32 false = 34;\n\toptional int32 default = 35;\n}\n\nextend google.protobuf.FieldOptions {\n\toptional bool syntax = 20001;\n\toptional bool import = 20002;\n\toptional bool public = 20003;\n\toptional bool weak = 20004;\n\toptional bool package = 20005;\n\toptional string string = 20006;\n\toptional bytes bytes = 20007;\n\toptional int32 int32 = 20008;\n\toptional int64 int64 = 20009;\n\toptional uint32 uint32 = 20010;\n\toptional uint64 uint64 = 20011;\n\toptional sint32 sint32 = 20012;\n\toptional sint64 sint64 = 20013;\n\toptional fixed32 fixed32 = 20014;\n\toptional fixed64 fixed64 = 20015;\n\toptional sfixed32 sfixed32 = 20016;\n\toptional sfixed64 sfixed64 = 20017;\n\toptional bool bool = 20018;\n\toptional float float = 20019;\n\toptional double double = 20020;\n\toptional bool optional = 20021;\n\toptional bool repeated = 20022;\n\toptional bool required = 20023;\n\toptional bool message = 20024;\n\toptional bool enum = 20025;\n\toptional bool service = 20026;\n\toptional bool rpc = 20027;\n\toptional bool option = 20028;\n\toptional bool extend = 20029;\n\toptional bool extensions = 20030;\n\toptional bool reserved = 20031;\n\toptional bool to = 20032;\n\toptional int32 true = 20033;\n\toptional int32 false = 20034;\n\toptional int32 default = 20035;\n\toptional KeywordCollisions boom = 20036;\n}\n\nmessage KeywordCollisionOptions {\n\toptional uint64 id = 1 [\n\t\t(syntax) = true, (import) = true, (public) = true, (weak) = true, (package) = true,\n\t\t(string) = \"string\", (bytes) = \"bytes\", (bool) = true,\n\t\t(float) = 3.14, (double) = 3.14159,\n\t\t(int32) = 32, (int64) = 64, (uint32) = 3200, (uint64) = 6400, (sint32) = -32, (sint64) = -64,\n\t\t(fixed32) = 3232, (fixed64) = 6464, (sfixed32) = -3232, (sfixed64) = -6464,\n\t\t(optional) = true, (repeated) = true, (required) = true,\n\t\t(message) = true, (enum) = true, (service) = true, (rpc) = true,\n\t\t(option) = true, (extend) = true, (extensions) = true, (reserved) = true,\n\t\t(to) = true, (true) = 111, (false) = -111, (default) = 222\n\t];\n\toptional string name = 2 [\n\t\t(boom) = {\n\t\t\tsyntax: true, import: true, public: true, weak: true, package: true,\n\t\t\tstring: \"string\", bytes: \"bytes\", bool: true,\n\t\t\tfloat: 3.14, double: 3.14159,\n\t\t\tint32: 32, int64: 64, uint32: 3200, uint64: 6400, sint32: -32, sint64: -64,\n\t\t\tfixed32: 3232, fixed64: 6464, sfixed32: -3232, sfixed64: -6464,\n\t\t\toptional: true, repeated: true, required: true,\n\t\t\tmessage: true, enum: true, service: true, rpc: true,\n\t\t\toption: true, extend: true, extensions: true, reserved: true,\n\t\t\tto: true, true: 111, false: -111, default: 222\n\t\t}\n\t];\n}\n// comment for last element in file, KeywordCollisionOptions\n"
  },
  {
    "path": "cmd/buf/testdata/format/diff/diff.proto",
    "content": "\nsyntax = \"proto3\";\n\n\n\npackage diff;\n\n\nmessage   Diff  {\n\n  string content = 1;\n\n  }\n"
  },
  {
    "path": "cmd/buf/testdata/format/invalid/invalid.proto",
    "content": "syntax = \"proto3\";\n\n// Foo... is not a valid identifier.\nmessage Foo... {}\n"
  },
  {
    "path": "cmd/buf/testdata/format/simple/simple.proto",
    "content": "syntax = \"proto3\";\n\npackage simple;\n\nmessage Object {\n  string key = 1;\n  bytes value = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/README.md",
    "content": "# Imports cache\n\nThis cache is used for the imports tests. It's caching an exact copy of the `school`, people`, and `students`\nmodules in the `success` dir.\n\nTo understand how this cache is built, see the `bufmodulecache` pkg.\n\nTo re-generate digests:\n\n```\nbuf-digest \\\n  cmd/buf/testdata/imports/success/school \\\n  cmd/buf/testdata/imports/success/people \\\n  cmd/buf/testdata/imports/success/students\n```\n\nTo make new commit IDs:\n\n```\nbuf-new-commit-id\n```\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/files/people/v1/people1.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nmessage Person1 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/files/people/v1/people2.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nmessage Person2 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/module.yaml",
    "content": "version: v1\nfiles_dir: files\nv1_buf_yaml_file: v1_buf_yaml/buf.yaml\nv1_buf_lock_file: v1_buf_lock/buf.lock\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/v1_buf_yaml/buf.yaml",
    "content": "mock_data\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/school/f4329b95720e46da93b5b4011a42ae7b/files/school/v1/school1.proto",
    "content": "syntax = \"proto3\";\n\npackage school.v1;\n\n\nimport \"school/v1/school2.proto\"; // source, ok\nimport \"students/v1/students.proto\"; // direct dep, ok\n\nmessage Class {\n  school.v1.SchoolType school_type = 1;\n  repeated students.v1.Student students = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/school/f4329b95720e46da93b5b4011a42ae7b/files/school/v1/school2.proto",
    "content": "syntax = \"proto3\";\n\npackage school.v1;\n\nenum SchoolType {\n  SCHOOL_TYPE_UNSPECIFIED = 0;\n  SCHOOL_TYPE_FOO = 1;\n  SCHOOL_TYPE_BAR = 2;\n  SCHOOL_TYPE_BAZ = 3;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/school/f4329b95720e46da93b5b4011a42ae7b/module.yaml",
    "content": "version: v1\ndeps:\n  - name: bufbuild.test/bufbot/people\n    commit: fc7d540124fd42db92511c19a60a1d98\n    digest: b5:b22338d6faf2a727613841d760c9cbfd21af6950621a589df329e1fe6611125904c39e22a73e0aa8834006a514dbd084e6c33b6bef29c8e4835b4b9dec631465\n  - name: bufbuild.test/bufbot/students\n    commit: 6c776ed5bee54462b06d31fb7f7c16b8\n    digest: b5:01764dd31d0e1b8355eb3b262bba4539657af44872df6e4dfec76f57fbd9f1ae645c7c9c607db5c8352fb7041ca97111e3b0f142dafc1028832acbbc14ba1d70\nfiles_dir: files\nv1_buf_yaml_file: v1_buf_yaml/buf.yaml\nv1_buf_lock_file: v1_buf_lock/buf.lock\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/school/f4329b95720e46da93b5b4011a42ae7b/v1_buf_yaml/buf.yaml",
    "content": "mock_data\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/students/6c776ed5bee54462b06d31fb7f7c16b8/files/students/v1/students.proto",
    "content": "syntax = \"proto3\";\n\npackage students.v1;\n\nimport \"people/v1/people1.proto\"; // explicit direct import, ok\nimport \"people/v1/people2.proto\"; // explicit direct import, ok\n\nmessage Student {\n  people.v1.Person1 person = 1;\n  people.v1.Person2 person2 = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/students/6c776ed5bee54462b06d31fb7f7c16b8/module.yaml",
    "content": "version: v1\ndeps:\n  - name: bufbuild.test/bufbot/people\n    commit: fc7d540124fd42db92511c19a60a1d98\n    digest: b5:b22338d6faf2a727613841d760c9cbfd21af6950621a589df329e1fe6611125904c39e22a73e0aa8834006a514dbd084e6c33b6bef29c8e4835b4b9dec631465\nfiles_dir: files\nv1_buf_yaml_file: v1_buf_yaml/buf.yaml\nv1_buf_lock_file: v1_buf_lock/buf.lock\n"
  },
  {
    "path": "cmd/buf/testdata/imports/cache/v3/modules/b5/bufbuild.test/bufbot/students/6c776ed5bee54462b06d31fb7f7c16b8/v1_buf_yaml/buf.yaml",
    "content": "mock_data\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/README.md",
    "content": "This cache has a copy of the `people` and `students` directories in `cache` with a corrupted dep in `students`.\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/files/people/v1/people1.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nmessage Person1 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/files/people/v1/people2.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nmessage Person2 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/module.yaml",
    "content": "version: v1\nfiles_dir: files\nv1_buf_yaml_file: v1_buf_yaml/buf.yaml\nv1_buf_lock_file: v1_buf_lock/buf.lock\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/v1_buf_yaml/buf.yaml",
    "content": "mock_data\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/v3/modules/b5/bufbuild.test/bufbot/students/6c776ed5bee54462b06d31fb7f7c16b8/files/students/v1/students.proto",
    "content": "syntax = \"proto3\";\n\npackage students.v1;\n\nimport \"people/v1/people1.proto\"; // explicit direct import, ok\nimport \"people/v1/people2.proto\"; // explicit direct import, ok\n\nmessage Student {\n  people.v1.Person1 person = 1;\n  people.v1.Person2 person2 = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/v3/modules/b5/bufbuild.test/bufbot/students/6c776ed5bee54462b06d31fb7f7c16b8/module.yaml",
    "content": "version: v1\ndeps:\n  - name: bufbuild.test/bufbot/people\n    commit: fc7d540124fd42db92511c19a60a1d98\n    # Last character changed from 5 to 4 to corrupt digest.\n    digest: b5:b22338d6faf2a727613841d760c9cbfd21af6950621a589df329e1fe6611125904c39e22a73e0aa8834006a514dbd084e6c33b6bef29c8e4835b4b9dec631464\nfiles_dir: files\nv1_buf_yaml_file: v1_buf_yaml/buf.yaml\nv1_buf_lock_file: v1_buf_lock/buf.lock\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_dep/v3/modules/b5/bufbuild.test/bufbot/students/6c776ed5bee54462b06d31fb7f7c16b8/v1_buf_yaml/buf.yaml",
    "content": "mock_data\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_file/README.md",
    "content": "This cache has a copy of the `people` directory in `cache` with a corrupted file.\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_file/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/files/people/v1/people1.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\n// Corrupted file!\n\nmessage Person1 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_file/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/files/people/v1/people2.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nmessage Person2 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_file/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/module.yaml",
    "content": "version: v1\nfiles_dir: files\nv1_buf_yaml_file: v1_buf_yaml/buf.yaml\nv1_buf_lock_file: v1_buf_lock/buf.lock\n"
  },
  {
    "path": "cmd/buf/testdata/imports/corrupted_cache_file/v3/modules/b5/bufbuild.test/bufbot/people/fc7d540124fd42db92511c19a60a1d98/v1_buf_yaml/buf.yaml",
    "content": "mock_data\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/people/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/bufbot/people\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/people/people/v1/people1.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nimport \"nonexistent.proto\";\n\nmessage Person1 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/school/buf.yaml",
    "content": "version: v2\nmodules:\n  - name: bufbuild.test/bufbot/school\n    path: .\ndeps:\n  - bufbuild.test/bufbot/students\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/school/school/v1/school1.proto",
    "content": "syntax = \"proto3\";\n\npackage school.v1;\n\n\nimport \"school/v1/school2.proto\"; // source, ok\nimport \"students/v1/students.proto\"; // direct dep, ok\nimport \"people/v1/people1.proto\"; // file from transitive dep, not ok\nimport \"people/v1/people2.proto\"; // file from transitive dep, not ok\n\nmessage Class {\n  school.v1.SchoolType school_type = 1;\n  repeated students.v1.Student students = 2;\n  people.v1.Person1 teacher = 3;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/school/school/v1/school2.proto",
    "content": "syntax = \"proto3\";\n\npackage school.v1;\n\nenum SchoolType {\n  SCHOOL_TYPE_UNSPECIFIED = 0;\n  SCHOOL_TYPE_FOO = 1;\n  SCHOOL_TYPE_BAR = 2;\n  SCHOOL_TYPE_BAZ = 3;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/students/buf.yaml",
    "content": "version: v2\nmodules:\n  - name: bufbuild.test/bufbot/students\n    path: .\ndeps:\n  - bufbuild.test/bufbot/people\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/students/students/v1/students.proto",
    "content": "syntax = \"proto3\";\n\npackage students.v1;\n\nimport \"people/v1/people1.proto\"; // explicit direct import, ok\nimport \"people/v1/people_nonexistent.proto\"; // but nonexistent file in explicit direct import\n\nmessage Student {\n  people.v1.Person1 person = 1;\n  people.v1.Person2 person2 = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/workspace/transitive_imports/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\nimport \"c.proto\"; // file from transitive dep in workspace, not ok\n\nmessage A {\n    b.B b = 1;\n    c.C c = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/workspace/transitive_imports/a/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/first\ndeps:\n  - bufbuild.test/workspace/second\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/workspace/transitive_imports/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c.proto\";\n\nmessage B {\n    c.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/workspace/transitive_imports/b/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/second\ndeps:\n  - bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/workspace/transitive_imports/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a\n  - b\n  - c\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/workspace/transitive_imports/c/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/imports/failure/workspace/transitive_imports/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/people/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/bufbot/people\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/people/people/v1/people1.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nmessage Person1 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/people/people/v1/people2.proto",
    "content": "syntax = \"proto3\";\n\npackage people.v1;\n\nmessage Person2 {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/school/buf.yaml",
    "content": "version: v2\nmodules:\n  - name: bufbuild.test/bufbot/school\n    path: .\ndeps:\n  - bufbuild.test/bufbot/students\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/school/school/v1/school1.proto",
    "content": "syntax = \"proto3\";\n\npackage school.v1;\n\n\nimport \"school/v1/school2.proto\"; // source, ok\nimport \"students/v1/students.proto\"; // direct dep, ok\n\nmessage Class {\n  school.v1.SchoolType school_type = 1;\n  repeated students.v1.Student students = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/school/school/v1/school2.proto",
    "content": "syntax = \"proto3\";\n\npackage school.v1;\n\nenum SchoolType {\n  SCHOOL_TYPE_UNSPECIFIED = 0;\n  SCHOOL_TYPE_FOO = 1;\n  SCHOOL_TYPE_BAR = 2;\n  SCHOOL_TYPE_BAZ = 3;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/students/buf.yaml",
    "content": "version: v2\nmodules:\n  - name: bufbuild.test/bufbot/students\n    path: .\ndeps:\n  - bufbuild.test/bufbot/people\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/students/students/v1/students.proto",
    "content": "syntax = \"proto3\";\n\npackage students.v1;\n\nimport \"people/v1/people1.proto\"; // explicit direct import, ok\nimport \"people/v1/people2.proto\"; // explicit direct import, ok\n\nmessage Student {\n  people.v1.Person1 person = 1;\n  people.v1.Person2 person2 = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/wkt/a.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage A {\n  google.protobuf.Timestamp timestamp = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/unnamed_local_only_modules/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\"; // file from workspace module b, it's unnamed and local-only, it's ok\nimport \"c.proto\"; // file from workspace module c, it's unnamed and local-only, it's ok\n\nmessage A {\n    b.B b = 1;\n    c.C c = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/unnamed_local_only_modules/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c.proto\"; // file from local workspace module c, not declared as explicit dep, not ok\n\nmessage B {\n    c.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/unnamed_local_only_modules/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a\n  - b\n  - c\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/unnamed_local_only_modules/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/valid_explicit_deps/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - mod-a\n  - mod-b\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/valid_explicit_deps/mod-a/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nimport \"b/v1/b.proto\";\n\nmessage A {\n  b.v1.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/valid_explicit_deps/mod-a/buf.yaml",
    "content": "version: v1\nname: buf.build/foo/mod-a\ndeps:\n  - buf.build/foo/mod-b\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/valid_explicit_deps/mod-b/b/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nmessage B {}\n"
  },
  {
    "path": "cmd/buf/testdata/imports/success/workspace/valid_explicit_deps/mod-b/buf.yaml",
    "content": "version: v1\nname: buf.build/foo/mod-b\n"
  },
  {
    "path": "cmd/buf/testdata/lint_ignore_disabled/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto\n  - path: vendor\nlint:\n  use:\n    - MESSAGE_PASCAL_CASE\n  ignore:\n    - vendor\n"
  },
  {
    "path": "cmd/buf/testdata/lint_ignore_disabled/proto/a.proto",
    "content": "syntax = \"proto3\";\n\nmessage foo {}\n"
  },
  {
    "path": "cmd/buf/testdata/lint_ignore_disabled/vendor/b.proto",
    "content": "syntax = \"proto3\";\n\nmessage bar {}\n"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/extraconfigv1/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - proto"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/extraconfigv1/buf.yaml",
    "content": "version: v1"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/extraconfigv1/proto/a.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/lsmodules/extraconfigv2/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - proto"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/extraconfigv2/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/extraconfigv2/proto/a.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspaceinvalid/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - proto"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspaceinvalid/proto/buf.yaml",
    "content": "# invalid because this directory is pointed to by a workspace\nversion: v2\n"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspacev1/a_v1/buf.yaml",
    "content": "version: v1\nname: buf.build/foo/bar"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspacev1/b_no_name_v1/buf.yaml",
    "content": "version: v1"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspacev1/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - e_no_file\n  - c_v1beta1\n  - f_no_name_v1beta1\n  - a_v1\n  - d_no_file\n  - b_no_name_v1"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspacev1/c_v1beta1/buf.yaml",
    "content": "version: v1beta1\nname: buf.build/bar/baz"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspacev1/f_no_name_v1beta1/buf.yaml",
    "content": "version: v1beta1"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspacev1/not_pointed_by_workspace/buf.yaml",
    "content": "version: v1\nname: buf.build/acme/weather"
  },
  {
    "path": "cmd/buf/testdata/lsmodules/workspacev2/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: d_no_name\n  - path: c\n    name: buf.build/bar/baz\n  - path: a\n    name: buf.build/foo/bar\n  - path: b_no_name"
  },
  {
    "path": "cmd/buf/testdata/paths/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/testdata/paths/a/v2/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v2;\n\nmessage Foo {\n  string key = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/paths/a/v3/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3;\n\nmessage Foo {\n  int32 key = 1;\n  string Value = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/paths/a/v3/foo/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3.foo;\n\nmessage Bar {\n}\n"
  },
  {
    "path": "cmd/buf/testdata/paths/a/v3/foo/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v3.foo;\n\nmessage Foo {\n  int32 id = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/paths/b/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b.v1;\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/testdata/paths/buf.gen.yaml",
    "content": "version: v1\nplugins:\n  - name: java\n    out: java\n"
  },
  {
    "path": "cmd/buf/testdata/paths/buf.yaml",
    "content": "version: v1\n"
  },
  {
    "path": "cmd/buf/testdata/policy_list_rules/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - ENUM_NO_ALLOW_ALIAS\n    - PACKAGE_DIRECTORY_MATCH\nbreaking:\n  use:\n    - ENUM_VALUE_NO_DELETE\n    - FIELD_SAME_JSTYPE\npolicies:\n  - policy: testdata/policy_list_rules/policy.yaml\n"
  },
  {
    "path": "cmd/buf/testdata/policy_list_rules/expected_ls_lint_rules_configured_only.txt",
    "content": "ID                       CATEGORIES                DEFAULT  PURPOSE\nPACKAGE_DIRECTORY_MATCH  MINIMAL, BASIC, STANDARD  *        Checks that all files are in a directory that matches their package name.\nENUM_NO_ALLOW_ALIAS      BASIC, STANDARD           *        Checks that enums do not have the allow_alias option set.\n\ntestdata/policy_list_rules/policy.yaml\n\nPACKAGE_DIRECTORY_MATCH  MINIMAL, BASIC, STANDARD  *        Checks that all files are in a directory that matches their package name.\nENUM_NO_ALLOW_ALIAS      BASIC, STANDARD           *        Checks that enums do not have the allow_alias option set.\n\ntestdata/policy_list_rules/policy.yaml buf-plugin-rpc-ext\n\nPAGE_REQUEST_HAS_TOKEN                             *        Checks that all pagination RPC requests has a page token set.\nPAGE_RESPONSE_HAS_TOKEN                            *        Checks that all pagination RPC responses has a page token set.\n"
  },
  {
    "path": "cmd/buf/testdata/policy_list_rules/policy.yaml",
    "content": "version: v2\nlint:\n  use:\n    - ENUM_NO_ALLOW_ALIAS\n    - PACKAGE_DIRECTORY_MATCH\n    - PAGE_REQUEST_HAS_TOKEN\n    - PAGE_RESPONSE_HAS_TOKEN\nbreaking:\n  use:\n    - ENUM_VALUE_NO_DELETE\n    - FIELD_SAME_JSTYPE\nplugins:\n  - plugin: buf-plugin-rpc-ext\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/breaking/a/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nmessage Bar {\n  string key = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/breaking/a/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/a\n\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/breaking/a/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nmessage Foo {\n  string hello = 1;\n  string world = 2;\n}"
  },
  {
    "path": "cmd/buf/testdata/protofileref/breaking/b/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nmessage Bar {\n  string key = 1;\n  int32 value = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/breaking/b/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/b\n\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/breaking/b/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nmessage Foo {\n  string hello = 1;\n  int32 world = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/noworkspaceormodule/fail/import.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/type/date.proto\";\n\nmessage A {\n  google.type.Date date = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/noworkspaceormodule/success/simple.proto",
    "content": "syntax = \"proto3\";\n\npackage simple;\n\nmessage Foo {\n  string key = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/success/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Foo {\n  int64 one = 1;\n  google.protobuf.DescriptorProto two = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/success/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/success\n\n"
  },
  {
    "path": "cmd/buf/testdata/protofileref/success/other.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Bar {\n  int64 one = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/small_list_rules/buf.yaml",
    "content": "version: v1beta1\nlint:\n  use:\n    - ENUM_NO_ALLOW_ALIAS\n    - PACKAGE_DIRECTORY_MATCH\nbreaking:\n  use:\n    - ENUM_VALUE_NO_DELETE\n    - FIELD_SAME_JSTYPE\n"
  },
  {
    "path": "cmd/buf/testdata/small_list_rules_yml/config.yml",
    "content": "version: v1beta1\nlint:\n  use:\n    - ENUM_NO_ALLOW_ALIAS\n    - PACKAGE_DIRECTORY_MATCH\nbreaking:\n  use:\n    - ENUM_VALUE_NO_DELETE\n    - FIELD_SAME_JSTYPE\n"
  },
  {
    "path": "cmd/buf/testdata/success/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Foo {\n  int64 one = 1;\n  google.protobuf.DescriptorProto two = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/success/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - BASIC\n"
  },
  {
    "path": "cmd/buf/testdata/successnobufyaml/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Foo {\n  int64 one = 1;\n  google.protobuf.DescriptorProto two = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/symlinks/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/absolute/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - /home/buf\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/absolute/windows/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - C:\\buf\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/breaking/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/breaking/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/breaking/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  int64 name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/diroverlap/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - foo\n  - foo/bar\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/duplicate/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/duplicate/other/proto/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nmessage Foo {}\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/duplicate/proto/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/invalidversion/buf.work.yaml",
    "content": "version: v9\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/jumpcontext/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - ../breaking/other/proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/modulebreakingconfig/a/proto/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage A {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/modulebreakingconfig/a/proto/buf.yaml",
    "content": "version: v1"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/modulebreakingconfig/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a/proto\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/modulebreakingconfig/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/modulebreakingconfig/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/modulebreakingconfig/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/rpc\ndeps:\n  - bufbuild.test/workspace/request\nbreaking:\n  use:\n    - PACKAGE\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/modulebreakingconfig/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/nodirectories/buf.work.yaml",
    "content": "version: v1\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/notexist/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - notexist\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/noversion/buf.work.yaml",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/overlap/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/overlap/proto/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Buf {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/symlink/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\n\nmessage A {\n    b.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/symlink/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a\n  - b\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/absolute/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: /home/buf\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/absolute/windows/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: C:\\buf\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/duplicate/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: other/proto\n    includes:\n      - other/proto/v1\n    excludes:\n      - other/proto/v1/inner\n  - path: proto\n    includes:\n      - proto/v1\n      - proto/v2\n    excludes:\n      - proto/v1/inner\n      - proto/v2/inner\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/duplicate/other/proto/v1/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nmessage Foo {}\n\nmessage Bar {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/duplicate/other/proto/v1/inner/bar.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/duplicate/proto/v1/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nmessage Foo {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/duplicate/proto/v1/inner/bar.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/jumpcontext/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: ../breaking/other/proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/modulebreakingconfig/a/proto/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage A {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/modulebreakingconfig/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: a/proto\n  - path: other/proto\n    name: bufbuild.test/workspace/request\n  - path: proto\n    name: bufbuild.test/workspace/rpc\n    breaking:\n      use:\n        - PACKAGE\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/modulebreakingconfig/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/modulebreakingconfig/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/notexist/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: notexist\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/overlap/buf.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/overlap/proto/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Buf {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/symlink/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\n\nmessage A {\n    b.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/fail/v2/symlink/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: a\n  - path: b\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/breaking/a/proto/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage A {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/breaking/a/proto/buf.yaml",
    "content": "version: v1"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/breaking/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a/proto\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/breaking/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/breaking/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/breaking/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/rpc\ndeps:\n  - bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/breaking/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request request = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/detached/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/detached/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/detached/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/diamond/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n  - private/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/diamond/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/diamond/other/proto/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/diamond/private/proto/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c.proto\";\n\nmessage B {\n    c.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/diamond/private/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/second\ndeps:\n  - bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/diamond/proto/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\nimport \"c.proto\";\n\nmessage A {\n    b.B b = 1;\n    c.C c = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/diamond/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/first\ndeps:\n  - bufbuild.test/workspace/second\n  - bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir/a/proto/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage A {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir/a/proto/buf.yaml",
    "content": "version: v1"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a/proto\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/rpc\ndeps:\n  - bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir_buf_work/a/proto/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage A {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir_buf_work/a/proto/buf.yaml",
    "content": "version: v1"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir_buf_work/buf.work",
    "content": "version: v1\ndirectories:\n  - a/proto\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir_buf_work/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir_buf_work/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir_buf_work/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/rpc\ndeps:\n  - bufbuild.test/workspace/request\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/dir_buf_work/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto/shared\n    excludes:\n      - proto/shared/prefix/foo\n  - path: proto//shared1\n    includes:\n      - proto/shared1/prefix/x\n    name: buf.build/shared/one\n  - path: separate  \n  - path: proto/shared/\n    excludes:\n      - proto/shared/prefix/bar\n    name: buf.build/shared/zero\n  - path: proto/shared1\n    excludes:\n      - proto/shared1/prefix/x\ndeps:\n  - buf.testing/acme/date\n  - buf.testing/acme/extension\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path/proto/shared/prefix/bar/v1/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix.bar.v1;\n\nmessage Bar {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path/proto/shared/prefix/foo/v1/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix.foo.v1;\n\nimport \"prefix/bar/v1/bar.proto\";\n\nmessage Foo {\n  prefix.bar.v1.Bar bar = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path/proto/shared1/prefix/x/x.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix;\n\nmessage X {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path/proto/shared1/prefix/y/y.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix;\n\nmessage Y {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path/separate/v1/separate.proto",
    "content": "syntax = \"proto3\";\n\npackage separate.v1;\n\nmessage Separate {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path_overlapping_include/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto\n    excludes:\n      - proto/foo/bar\n    lint:\n      use:\n        - DIRECTORY_SAME_PACKAGE # this effectively disables lint\n  - path: proto\n    includes:\n      - proto/foo/bar\n    excludes:\n      - proto/foo/bar/baz\n    lint:\n      use:\n        - PACKAGE_DEFINED\n      ignore:\n        - proto/foo/bar/v1\n  - path: proto\n    includes:\n      - proto/foo/bar/baz\n    lint:\n      use:\n        - SYNTAX_SPECIFIED\n      ignore:\n        - proto/foo/bar/baz/v1"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/bar/baz/v1/baz.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/bar/baz/v2/baz.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/bar/v1/bar.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/bar/v2/bar.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/v1/foo.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/v2/foo.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/lock/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\n\nmessage A {\n    b.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/lock/a/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/first\ndeps:\n  - bufbuild.test/workspace/second\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/lock/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nmessage B {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/lock/b/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/second\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/lock/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a\n  - b\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/nested/proto/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - external\n  - internal\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/nested/proto/external/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/external\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/nested/proto/external/external.proto",
    "content": "syntax = \"proto3\";\n\npackage external;\n\nmessage External {\n    string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/nested/proto/internal/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/internal\ndeps:\n  - bufbuild.test/workspace/external\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/nested/proto/internal/internal.proto",
    "content": "syntax = \"proto3\";\n\npackage internal;\n\nimport \"external.proto\";\n\nmessage Internal {\n    external.External external = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/noconfig/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/noconfig/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/noconfig/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/overlapping_dir_path/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto\n    name: buf.test/acme/foobar\n    includes:\n      - proto/foo\n      - proto/bar\n    excludes:\n      - proto/foo/internal\n      - proto/bar/internal\n  - path: proto/foo/internal\n  - path: proto/bar/internal"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/overlapping_dir_path/proto/bar/bar.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/overlapping_dir_path/proto/bar/internal/bar_internal.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/overlapping_dir_path/proto/foo/foo.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/overlapping_dir_path/proto/foo/internal/foo_internal.proto",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/protofileref/another/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage bar;\n\nmessage Bar {\n  string id = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/protofileref/another/foo/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nimport \"bar/bar.proto\";\n\nmessage Foo {\n  bar.Bar bar = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/protofileref/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - another\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/protofileref/proto/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage baz;\n\nmessage Baz {\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - module1\n  - module2\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/module1/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b/b.proto\";\nimport \"c/c.proto\";\n\nmessage A {\n    b.B b = 1;\n    c.C c = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/module1/buf.yaml",
    "content": "version: v1\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/module2/buf.yaml",
    "content": "version: v1beta1\nbuild:\n  roots:\n    - root1\n    - root2\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/module2/other.buf.yaml",
    "content": "version: v1beta1\nbuild:\n  roots:\n    - root1\n    - root2\n    - root3\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/module2/root1/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c/c.proto\";\n\nmessage B {\n    c.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/module2/root2/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/roots/module2/root3/d/d.proto",
    "content": "syntax = \"proto3\";\n\npackage d;\n\nmessage D {}\n\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/shared_parent_dir/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: standalone\n  - path: parent/foo\n  - path: parent/nextlayer/bar\n  - path: parent/nextlayer/baz\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/shared_parent_dir/parent/foo/foo.proto",
    "content": "package foo;\n\nimport \"imported.proto\";\n\nmessage Foo {\n  optional standalone.Imported i = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/shared_parent_dir/parent/nextlayer/bar/bar.proto",
    "content": "package bar;\n\nimport \"foo.proto\";\n\nmessage Bar {\n  optional foo.Foo foo = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/shared_parent_dir/parent/nextlayer/baz/baz.proto",
    "content": "package baz;\n\nimport \"bar.proto\";\n\nmessage Baz {\n  optional bar.Bar bar = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/shared_parent_dir/standalone/imported.proto",
    "content": "package standalone;\n\nmessage Imported {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/shared_parent_dir/standalone/standalone.proto",
    "content": "package standalone;\n\nmessage Standalone {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/symlink/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\n\nmessage A {\n    b.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/symlink/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - a\n  - b\n  - c\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/symlink/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/transitive/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n  - private/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/transitive/other/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/transitive/other/proto/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/transitive/private/proto/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c.proto\";\n\nmessage B {\n    c.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/transitive/private/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/second\ndeps:\n  - bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/transitive/proto/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\n\nmessage A {\n    b.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/transitive/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/first\ndeps:\n  - bufbuild.test/workspace/second\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/breaking/a/proto/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage A {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/breaking/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: a/proto\n  - path: other/proto\n    name: bufbuild.test/workspace/request\n  - path: proto\n    name: bufbuild.test/workspace/rpc\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/breaking/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/breaking/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request request = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/detached/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: other/proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/detached/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/detached/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/diamond/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: other/proto\n  - path: private/proto\n  - path: proto\n    name: bufbuild.test/workspace/first\n    lint:\n      except:\n        - PACKAGE_NO_IMPORT_CYCLE\ndeps:\n  - bufbuild.test/workspace/second\n  - bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/diamond/other/proto/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/diamond/private/proto/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c.proto\";\n\nmessage B {\n    c.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/diamond/proto/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\nimport \"c.proto\";\n\nmessage A {\n    b.B b = 1;\n    c.C c = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/diamond/proto/buf.yaml",
    "content": "version: v1\nname: bufbuild.test/workspace/first\ndeps:\n  - bufbuild.test/workspace/second\n  - bufbuild.test/workspace/third\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/dir/a/proto/a/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nmessage A {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/dir/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: a/proto\n  - path: other/proto\n    name: bufbuild.test/workspace/request\n  - path: proto\n    name: bufbuild.test/workspace/rpc\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/dir/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/dir/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/another/proto/README.md",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/another/proto/another.proto",
    "content": "syntax = \"proto3\";\n\npackage another;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: another/proto\n    name: bufbuild.test/workspace/another\n  - path: other/proto\n    name: bufbuild.test/workspace/request\n  - path: proto\n    name: bufbuild.test/workspace/rpc\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/other/proto/LICENSE",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/other/proto/request.proto",
    "content": "syntax = \"proto3\";\n\npackage request;\n\nmessage Request {\n  string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/other/proto/unimported.proto",
    "content": "syntax = \"proto3\";\n\n// This file isn't imported so if we just export proto/ it should not appear.\n\npackage request;\n\nimport \"another.proto\";\n\nmessage NotImported {\n  string name = 1;\n  another.Request request = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/proto/LICENSE",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/proto/README.md",
    "content": ""
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/export/proto/rpc.proto",
    "content": "syntax = \"proto3\";\n\npackage example;\n\nimport \"request.proto\";\n\nmessage RPC {\n    request.Request req = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/nested/proto/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: external\n    name: bufbuild.test/workspace/external\n  - path: internal\n    name: bufbuild.test/workspace/internal\ndeps:\n  - bufbuild.test/workspace/external\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/nested/proto/external/external.proto",
    "content": "syntax = \"proto3\";\n\npackage external;\n\nmessage External {\n    string name = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/nested/proto/internal/internal.proto",
    "content": "syntax = \"proto3\";\n\npackage internal;\n\nimport \"external.proto\";\n\nmessage Internal {\n    external.External external = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/symlink/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\n\nmessage A {\n    b.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/symlink/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: a\n  - path: b\n  - path: c\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/symlink/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/transitive/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: other/proto\n    name: bufbuild.test/workspace/third\n    lint:\n      except:\n        - PACKAGE_NO_IMPORT_CYCLE\n  - path: private/proto\n    name: bufbuild.test/workspace/second\n    lint:\n      except:\n        - PACKAGE_NO_IMPORT_CYCLE\n  - path: proto\n    name: bufbuild.test/workspace/first\n    lint:\n      except:\n        - PACKAGE_NO_IMPORT_CYCLE\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/transitive/other/proto/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/transitive/private/proto/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c.proto\";\n\nmessage B {\n    c.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/transitive/proto/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b.proto\";\n\nmessage A {\n    b.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/wkt/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: other/proto\n  - path: proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/wkt/other/proto/c/c.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a/a.proto\";\nimport \"google/protobuf/empty.proto\";\n\npackage c;\n\nmessage C {\n    a.A a = 1;\n    google.protobuf.Empty empty = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/wkt/proto/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b/b.proto\";\nimport \"google/protobuf/empty.proto\";\n\nmessage A {\n    b.B b = 1;\n    google.protobuf.Empty empty = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/v2/wkt/proto/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage B {\n    google.protobuf.Empty empty = 1;\n}\n\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/wkt/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n  - proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/wkt/other/proto/c/c.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a/a.proto\";\nimport \"google/protobuf/empty.proto\";\n\npackage c;\n\nmessage C {\n    a.A a = 1;\n    google.protobuf.Empty empty = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/wkt/proto/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b/b.proto\";\nimport \"google/protobuf/empty.proto\";\n\nmessage A {\n    b.B b = 1;\n    google.protobuf.Empty empty = 2;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace/success/wkt/proto/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage B {\n    google.protobuf.Empty empty = 1;\n}\n\n"
  },
  {
    "path": "cmd/buf/testdata/workspace_subdir/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - other/proto\n"
  },
  {
    "path": "cmd/buf/testdata/workspace_subdir/other/proto/one/a.proto",
    "content": "// Copyright 2020-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage one.v1;\n\nimport \"one/b.proto\";\n\nmessage A {\n    one.v1.B b = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace_subdir/other/proto/one/b.proto",
    "content": "// Copyright 2020-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage one.v1;\n\nimport \"two/c.proto\";\n\nmessage B {\n    two.v1.C c = 1;\n}\n"
  },
  {
    "path": "cmd/buf/testdata/workspace_subdir/other/proto/two/c.proto",
    "content": "// Copyright 2020-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage two.v1;\n\nmessage C {}\n"
  },
  {
    "path": "cmd/buf/workspace_subdir_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/osext\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// Test if workspaces work when buf is executed in a sub-directory specified\n// in the workspace.\n\nfunc TestWorkspaceSubDirectory(t *testing.T) {\n\t// Cannot run in parallel since we chdir\n\tdefer chdirToSubDir(t, \"testdata/workspace_subdir/other/proto/subdir\")()\n\t// Execute buf within a workspace directory.\n\twd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tparentDirectory := filepath.Join(wd, \"..\")\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`../one/a.proto\n        ../one/b.proto\n        ../two/c.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`../one/a.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".\n        ../one/b.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".\n        ../two/c.proto:17:1:Files with package \"two.v1\" must be within a directory \"two/v1\" relative to root but were in directory \"two\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`../one/a.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".\n        ../one/b.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"..\", \"one\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`../two/c.proto:17:1:Files with package \"two.v1\" must be within a directory \"two/v1\" relative to root but were in directory \"two\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"..\", \"two\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(wd, \"..\", \"..\", \"..\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(fmt.Sprintf(`%s/one/a.proto\n        %s/one/b.proto\n        %s/two/c.proto`, parentDirectory, parentDirectory, parentDirectory)),\n\t\t\"ls-files\",\n\t\tfilepath.Join(wd, \"..\", \"..\", \"..\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(fmt.Sprintf(`%s/one/a.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".\n        %s/one/b.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".\n        %s/two/c.proto:17:1:Files with package \"two.v1\" must be within a directory \"two/v1\" relative to root but were in directory \"two\".`,\n\t\t\tparentDirectory, parentDirectory, parentDirectory,\n\t\t)),\n\t\t\"lint\",\n\t\tfilepath.Join(wd, \"..\", \"..\", \"..\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\", \"other\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`../one/a.proto\n        ../one/b.proto\n        ../two/c.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\", \"other\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"breaking\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\", \"other\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(fmt.Sprintf(`%s/one/a.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".\n        %s/one/b.proto:17:1:Files with package \"one.v1\" must be within a directory \"one/v1\" relative to root but were in directory \"one\".`,\n\t\t\tparentDirectory, parentDirectory,\n\t\t)),\n\t\t\"lint\",\n\t\tfilepath.Join(wd, \"..\", \"..\", \"..\"),\n\t\t\"--path\",\n\t\tfilepath.Join(wd, \"..\", \"one\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(fmt.Sprintf(`%s/two/c.proto:17:1:Files with package \"two.v1\" must be within a directory \"two/v1\" relative to root but were in directory \"two\".`,\n\t\t\tparentDirectory,\n\t\t)),\n\t\t\"lint\",\n\t\tfilepath.Join(wd, \"..\", \"..\", \"..\"),\n\t\t\"--path\",\n\t\tfilepath.Join(wd, \"..\", \"two\"),\n\t)\n}\n\nfunc TestWorkspaceOverlapSubDirectory(t *testing.T) {\n\t// Cannot run in parallel since we chdir\n\tdefer chdirToSubDir(t, \"testdata/workspace_subdir/other/proto/subdir\")()\n\t// Specify an overlapping input in a sub-directory.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: failed to build input \"other/proto/one\" because it is contained by module at path \"other/proto\" specified in your configuration, you must provide the workspace or module as the input, and filter to this path using --path`,\n\t\t\"build\",\n\t\tfilepath.Join(\"..\", \"one\"),\n\t)\n}\n\nfunc TestWorkspaceWithProtoFileRef(t *testing.T) {\n\t// Cannot run in parallel since we chdir\n\tdefer chdirToSubDir(t, \"testdata/workspace_subdir/other/proto/subdir\")()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(\"../../../../workspace/success/protofileref/another/foo/foo.proto\"),\n\t\t``,\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\", \"..\", \"workspace\", \"success\", \"protofileref\", \"another\", \"foo\", \"foo.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`\n\t\t../../../../workspace/success/protofileref/another/foo/foo.proto:3:1:Package name \"foo\" should be suffixed with a correctly formed version, such as \"foo.v1\".\n\t\t`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"..\", \"..\", \"..\", \"..\", \"workspace\", \"success\", \"protofileref\", \"another\", \"foo\", \"foo.proto\"),\n\t)\n}\n\n// Change the the subdirectory and then return a function to undo the chdir.\n//\n// Using this prevents tests being able to be run in parallel\nfunc chdirToSubDir(t *testing.T, relSubDirPath string) func() {\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\tsubDirPath := normalpath.Unnormalize(normalpath.Join(pwd, relSubDirPath))\n\trequire.NoError(t, os.MkdirAll(subDirPath, os.ModePerm))\n\trequire.NoError(t, osext.Chdir(subDirPath))\n\treturn func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "cmd/buf/workspace_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appcmd/appcmdtesting\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/cmd/buf/internal/internaltesting\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/osext\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestWorkspaceDir(t *testing.T) {\n\t// Directory paths contained within a workspace.\n\tt.Parallel()\n\tfor _, baseDirPath := range []string{\n\t\t// TODO FUTURE(doria): can we move `dir` and `dir_buf_work` into a directory `v1` for symmetry with `v2`?\n\t\t\"dir\",          // dir contains a v1 buf.work.yaml\n\t\t\"dir_buf_work\", // dir_buf_work contains a v1 buf.work\n\t\t\"v2/dir\",       // v2/dir contains a v2 buf.yaml\n\t} {\n\t\twd, err := osext.Getwd()\n\t\trequire.NoError(t, err)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(\n\t\t\t\t`testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n\t\t    testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`,\n\t\t\t),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n\t\t    testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`,\n\t\t\t),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(\n\t\t\t\tfmt.Sprintf(`%s/testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n\t\t    %s/testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`, wd, wd),\n\t\t\t),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(wd, \"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/a/proto/a/v1/a.proto\n\t\t    testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto\n\t\t    testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n\t\t    testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".\n\t\t    testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n\t\t    testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t)\n\t\ttestRunStdoutStderrNoWarn(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:5:8:import \"request.proto\": file does not exist`),\n\t\t\t\"\",\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t\t\"--config\",\n\t\t\t`{\"version\":\"v1beta1\",\"lint\": {\"use\": [\"PACKAGE_DIRECTORY_MATCH\"]}}`,\n\t\t)\n\t\ttestRunStdoutStderrNoWarn(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:5:8:import \"request.proto\": file does not exist`),\n\t\t\t\"\",\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t\t\"--config\",\n\t\t\t`{\"version\":\"v1\",\"lint\": {\"use\": [\"PACKAGE_DIRECTORY_MATCH\"]}}`,\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t\t\"--config\",\n\t\t\t`version: v2\nmodules:\n  - path: a\n  - path: other/proto\n    lint:\n      use:\n\t    - PACKAGE_DIRECTORY_MATCH\n  - path: proto`,\n\t\t\t\"--path\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\", \"request.proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t\t\"--path\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"proto\", \"rpc.proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n\t\t    testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath),\n\t\t\t\"--path\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\", \"request.proto\"),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceBreaking(t *testing.T) {\n\tt.Parallel()\n\tfor _, dirPaths := range []struct {\n\t\tbase    string\n\t\tagainst string\n\t}{\n\t\t{base: \"dir\", against: \"breaking\"},\n\t\t{base: \"dir_buf_work\", against: \"breaking\"},\n\t\t{base: \"v2/dir\", against: \"breaking\"},\n\t\t{base: \"v2/dir\", against: \"v2/breaking\"},\n\t} {\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPaths.against),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPaths.against+`/a/proto/a/v1/a.proto\n\t\t    testdata/workspace/success/`+dirPaths.against+`/other/proto/request.proto\n\t\t    testdata/workspace/success/`+dirPaths.against+`/proto/rpc.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPaths.against),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPaths.against+`/other/proto/request.proto:5:1:Previously present field \"1\" with name \"name\" on message \"Request\" was deleted.\n\t\t    testdata/workspace/success/`+dirPaths.against+`/proto/rpc.proto:8:5:Field \"1\" with name \"request\" on message \"RPC\" changed option \"json_name\" from \"req\" to \"request\".\n\t\t    testdata/workspace/success/`+dirPaths.against+`/proto/rpc.proto:8:21:Field \"1\" on message \"RPC\" changed name from \"req\" to \"request\".`),\n\t\t\t\"breaking\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPaths.against),\n\t\t\t\"--against\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPaths.base),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceArchiveDir(t *testing.T) {\n\t// Archive that defines a workspace at the root of the archive.\n\tt.Parallel()\n\tfor _, dirPath := range []string{\n\t\t\"dir\",\n\t\t\"v2/dir\",\n\t} {\n\t\tzipDir := createZipFromDir(\n\t\t\tt,\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t\t\"archive.zip\",\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`proto/rpc.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n        proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n        proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t\t\"--path\",\n\t\t\tfilepath.Join(\"rpc.proto\"),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceNestedArchive(t *testing.T) {\n\t// Archive that defines a workspace in a sub-directory to the root.\n\tt.Parallel()\n\tfor _, dirPath := range []string{\n\t\t\"nested\",\n\t\t\"v2/nested\",\n\t} {\n\t\tzipDir := createZipFromDir(\n\t\t\tt,\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t\t\"archive.zip\",\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto/internal\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`proto/internal/internal.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto/internal\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`proto/internal/internal.proto:3:1:Files with package \"internal\" must be within a directory \"internal\" relative to root but were in directory \".\".\n        proto/internal/internal.proto:3:1:Package name \"internal\" should be suffixed with a correctly formed version, such as \"internal.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto/internal\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`proto/internal/internal.proto:3:1:Files with package \"internal\" must be within a directory \"internal\" relative to root but were in directory \".\".\n        proto/internal/internal.proto:3:1:Package name \"internal\" should be suffixed with a correctly formed version, such as \"internal.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto/internal\"),\n\t\t\t\"--path\",\n\t\t\tfilepath.Join(\"internal.proto\"),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceDetached(t *testing.T) {\n\tt.Parallel()\n\t// The workspace doesn't include the 'proto' directory, so\n\t// its contents aren't included in the workspace.\n\tfor _, dirPath := range []string{\n\t\t\"detached\",\n\t\t\"v2/detached\",\n\t} {\n\t\t// In the pre-refactor, this was a successful call, as the workspace was still being discovered\n\t\t// as the enclosing workspace, despite not pointing to the proto directory. In post-refactor\n\t\t// we'd consider this a bug: you specified the proto directory, and no controlling workspace\n\t\t// was discovered, therefore you build as if proto was the input directory, which results in\n\t\t// request.proto not existing as an import.\n\t\ttestRunStdoutStderrNoWarn(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\t``,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/proto/rpc.proto:5:8:import \"request.proto\": file does not exist`),\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/proto/rpc.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\t// In the pre-refactor, this was a successful call, as the workspace was still being discovered\n\t\t// as the enclosing workspace, despite not pointing to the proto directory. In post-refactor\n\t\t// we'd consider this a bug: you specified the proto directory, and no controlling workspace\n\t\t// was discovered, therefore you build as if proto was the input directory, which results in\n\t\t// request.proto not existing as an import.\n\t\ttestRunStdoutStderrNoWarn(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/proto/rpc.proto:5:8:import \"request.proto\": file does not exist`),\n\t\t\t``,\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/request.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/request.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceNoModuleConfig(t *testing.T) {\n\t// The workspace points to modules that don't contain a buf.yaml.\n\t//\n\t// This only tests for v1 workspaces, since in v2, we no longer have nested\n\t// buf.yaml files for workspace modules.\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"noconfig\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/workspace/success/noconfig/proto/rpc.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"noconfig\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/noconfig/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n        testdata/workspace/success/noconfig/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"noconfig\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"noconfig\", \"other\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/workspace/success/noconfig/other/proto/request.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"noconfig\", \"other\", \"proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/noconfig/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n        testdata/workspace/success/noconfig/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"noconfig\", \"other\", \"proto\"),\n\t)\n}\n\nfunc TestWorkspaceWithLock(t *testing.T) {\n\t// The workspace points to a module that includes a buf.lock, but\n\t// the listed dependency is defined in the workspace so the module\n\t// cache is unused.\n\t//\n\t// This only tests for v1 workspaces, since in v2, we no longer have nested\n\t// buf.lock files for workspace modules and this module would already be excluded\n\t// from the workspace-level buf.lock.\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"lock\", \"a\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/workspace/success/lock/a/a.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"lock\", \"a\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/lock/a/a.proto:3:1:Files with package \"a\" must be within a directory \"a\" relative to root but were in directory \".\".\n        testdata/workspace/success/lock/a/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"lock\", \"a\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"lock\", \"b\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/workspace/success/lock/b/b.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"lock\", \"b\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/lock/b/b.proto:3:1:Files with package \"b\" must be within a directory \"b\" relative to root but were in directory \".\".\n        testdata/workspace/success/lock/b/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"lock\", \"b\"),\n\t)\n}\n\nfunc TestWorkspaceWithTransitiveDependencies(t *testing.T) {\n\tt.Parallel()\n\t// The workspace points to a module that includes transitive\n\t// dependencies (i.e. a depends on b, and b depends on c).\n\tfor _, dirPath := range []string{\n\t\t\"transitive\",\n\t\t\"v2/transitive\",\n\t} {\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/proto/a.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/proto/a.proto:3:1:Files with package \"a\" must be within a directory \"a\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/proto/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"private\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/private/proto/b.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"private\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/private/proto/b.proto:3:1:Files with package \"b\" must be within a directory \"b\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/private/proto/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"private\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c.proto:3:1:Files with package \"c\" must be within a directory \"c\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/other/proto/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c.proto\n        testdata/workspace/success/`+dirPath+`/private/proto/b.proto\n        testdata/workspace/success/`+dirPath+`/proto/a.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c.proto:3:1:Files with package \"c\" must be within a directory \"c\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/other/proto/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".\n        testdata/workspace/success/`+dirPath+`/private/proto/b.proto:3:1:Files with package \"b\" must be within a directory \"b\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/private/proto/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".\n        testdata/workspace/success/`+dirPath+`/proto/a.proto:3:1:Files with package \"a\" must be within a directory \"a\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/proto/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceWithDiamondDependency(t *testing.T) {\n\tt.Parallel()\n\t// The workspace points to a module that includes a diamond\n\t// dependency (i.e. a depends on b and c, and b depends on c).\n\tfor _, dirPath := range []string{\n\t\t\"diamond\",\n\t\t\"v2/diamond\",\n\t} {\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/proto/a.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/proto/a.proto:3:1:Files with package \"a\" must be within a directory \"a\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/proto/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"private\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/private/proto/b.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"private\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/private/proto/b.proto:3:1:Files with package \"b\" must be within a directory \"b\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/private/proto/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"private\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c.proto:3:1:Files with package \"c\" must be within a directory \"c\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+dirPath+`/other/proto/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceWKT(t *testing.T) {\n\tt.Parallel()\n\t// The workspace includes multiple images that import the same\n\t// well-known type (empty.proto).\n\tfor _, dirPath := range []string{\n\t\t\"wkt\",\n\t\t\"v2/wkt\",\n\t} {\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c/c.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c/c.proto:6:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath, \"other\", \"proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"build\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c/c.proto\n        testdata/workspace/success/`+dirPath+`/proto/a/a.proto\n        testdata/workspace/success/`+dirPath+`/proto/b/b.proto`),\n\t\t\t\"ls-files\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+dirPath+`/other/proto/c/c.proto:6:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".\n        testdata/workspace/success/`+dirPath+`/proto/a/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".\n        testdata/workspace/success/`+dirPath+`/proto/b/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".`),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\t0,\n\t\t\t``,\n\t\t\t\"breaking\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t\t\"--against\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", dirPath),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceRoots(t *testing.T) {\n\t// Workspaces should support modules with multiple roots specified in a v1beta1 buf.yaml.\n\t// This is only tested with v1 workspaces, since v2 workspaces does not support individual\n\t// buf.yaml configurations.\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/workspace/success/roots/module1/a/a.proto\n        testdata/workspace/success/roots/module2/root1/b/b.proto\n        testdata/workspace/success/roots/module2/root2/c/c.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/roots/module1/a/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".\n        testdata/workspace/success/roots/module2/root1/b/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".\n\t\ttestdata/workspace/success/roots/module2/root2/c/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/roots/module1/a/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\", \"module1\", \"a\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/roots/module2/root1/b/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\", \"module2\", \"root1\", \"b\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/roots/module2/root2/c/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\", \"module2\", \"root2\", \"c\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/roots/module2/root1/b/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".\ntestdata/workspace/success/roots/module2/root2/c/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".\ntestdata/workspace/success/roots/module2/root3/d/d.proto:3:1:Package name \"d\" should be suffixed with a correctly formed version, such as \"d.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\", \"module2\"),\n\t\t\"--config\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"roots\", \"module2\", \"other.buf.yaml\"),\n\t)\n}\n\nfunc TestWorkspaceProtoFile(t *testing.T) {\n\tt.Parallel()\n\t// The ProtoFileRef is only accepted for lint commands, currently\n\t// dir_buf_work contains a buf.work instead of a buf.work.yaml\n\t// we want to make sure this still works\n\tfor _, baseDirPath := range []string{\n\t\t\"dir\",\n\t\t\"dir_buf_work\",\n\t\t\"v2/dir\",\n\t} {\n\t\twd, err := osext.Getwd()\n\t\trequire.NoError(t, err)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(\n\t\t\t\t`testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n        testdata/workspace/success/`+baseDirPath+`/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`,\n\t\t\t),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"proto\", \"rpc.proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(`testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n\t\t    testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`,\n\t\t\t),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\", \"request.proto\"),\n\t\t)\n\t\ttestRunStdout(\n\t\t\tt,\n\t\t\tnil,\n\t\t\tbufctl.ExitCodeFileAnnotation,\n\t\t\tfilepath.FromSlash(\n\t\t\t\tfmt.Sprintf(`%s/testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Files with package \"request\" must be within a directory \"request\" relative to root but were in directory \".\".\n\t\t    %s/testdata/workspace/success/`+baseDirPath+`/other/proto/request.proto:3:1:Package name \"request\" should be suffixed with a correctly formed version, such as \"request.v1\".`, wd, wd),\n\t\t\t),\n\t\t\t\"lint\",\n\t\t\tfilepath.Join(wd, \"testdata\", \"workspace\", \"success\", baseDirPath, \"other\", \"proto\", \"request.proto\"),\n\t\t)\n\t}\n}\n\nfunc TestWorkspaceBreakingFail(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"breaking\"),\n\t)\n\t// If the against contained more images than the input, we return a mismatch.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: input contained 1 images, whereas against contained 3 images`,\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"breaking\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"breaking\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: input contained 1 images, whereas against contained 3 images`,\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"breaking\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"breaking\"),\n\t)\n\t// If the input contains more images than the against, we attempt to map against images\n\t// if there are no unique module-specific breaking configs for the input.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(\n\t\t\t`testdata/workspace/success/dir/other/proto/request.proto:6:3:Field \"1\" with name \"name\" on message \"Request\" changed type from \"int64\" to \"string\".`,\n\t\t),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"breaking\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(\n\t\t\t`testdata/workspace/success/v2/dir/other/proto/request.proto:6:3:Field \"1\" with name \"name\" on message \"Request\" changed type from \"int64\" to \"string\".`,\n\t\t),\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"breaking\"),\n\t)\n\t// If we find unique module-specific breaking changes, then we still fail with a mismatch error.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"modulebreakingconfig\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"breaking\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t\"breaking\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"modulebreakingconfig\"),\n\t\t\"--against\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"breaking\"),\n\t)\n}\n\nfunc TestWorkspaceDuplicateDirPathSuccess(t *testing.T) {\n\tt.Parallel()\n\tworkspaceDir := filepath.Join(\"testdata\", \"workspace\", \"success\", \"duplicate_dir_path\")\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"prefix/bar/v1/bar.proto\": {},\n\t\t\t\"prefix/foo/v1/foo.proto\": {moduleFullName: \"buf.build/shared/zero\"},\n\t\t\t\"prefix/x/x.proto\":        {moduleFullName: \"buf.build/shared/one\"},\n\t\t\t\"prefix/y/y.proto\":        {},\n\t\t\t\"v1/separate.proto\":       {},\n\t\t},\n\t\tworkspaceDir,\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"prefix/bar/v1/bar.proto\": {},\n\t\t\t\"prefix/foo/v1/foo.proto\": {moduleFullName: \"buf.build/shared/zero\"},\n\t\t},\n\t\tfilepath.Join(workspaceDir, \"proto\", \"shared\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"prefix/x/x.proto\": {moduleFullName: \"buf.build/shared/one\"},\n\t\t\t\"prefix/y/y.proto\": {},\n\t\t},\n\t\tfilepath.Join(workspaceDir, \"proto\", \"shared1\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"prefix/x/x.proto\":        {moduleFullName: \"buf.build/shared/one\"},\n\t\t\t\"prefix/y/y.proto\":        {},\n\t\t\t\"prefix/bar/v1/bar.proto\": {},\n\t\t\t\"prefix/foo/v1/foo.proto\": {moduleFullName: \"buf.build/shared/zero\"},\n\t\t},\n\t\tfilepath.Join(workspaceDir, \"proto\"),\n\t)\n}\n\nfunc TestWorkspaceDuplicateDirPathOverlappingIncludeSuccess(t *testing.T) {\n\tt.Parallel()\n\tworkspaceDir := filepath.Join(\"testdata\", \"workspace\", \"success\", \"duplicate_dir_path_overlapping_include\")\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/v1/foo.proto\":         {},\n\t\t\t\"foo/v2/foo.proto\":         {},\n\t\t\t\"foo/bar/v1/bar.proto\":     {},\n\t\t\t\"foo/bar/v2/bar.proto\":     {},\n\t\t\t\"foo/bar/baz/v1/baz.proto\": {},\n\t\t\t\"foo/bar/baz/v2/baz.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/v1/foo.proto\": {},\n\t\t\t\"foo/v2/foo.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t\t// exclude a module contained within\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"bar\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/v1/foo.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t\t// filter within a module\n\t\t\"--path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"v1\", \"foo.proto\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/bar/v2/bar.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t\t// filter within another module\n\t\t\"--path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"bar\", \"v2\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/bar/v1/bar.proto\":     {},\n\t\t\t\"foo/bar/v2/bar.proto\":     {},\n\t\t\t\"foo/bar/baz/v2/baz.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t\t// filter and exclude\n\t\t\"--path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"bar\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"bar\", \"baz\", \"v1\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/v1/foo.proto\":         {},\n\t\t\t\"foo/bar/v1/bar.proto\":     {},\n\t\t\t\"foo/bar/baz/v1/baz.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t\t// filter within each module\n\t\t\"--path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"v1\"),\n\t\t\"--path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"bar\", \"v1\"),\n\t\t\"--path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"bar\", \"baz\", \"v1\"),\n\t)\n\t// Test each module is linted with the correct config.\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(\n\t\t\t`testdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/bar/baz/v2/baz.proto:1:1:Files must have a syntax explicitly specified. If no syntax is specified, the file defaults to \"proto2\".\ntestdata/workspace/success/duplicate_dir_path_overlapping_include/proto/foo/bar/v2/bar.proto:1:1:Files must have a package defined.`,\n\t\t),\n\t\t\"lint\",\n\t\tworkspaceDir,\n\t)\n}\n\nfunc TestWorkspaceOverlappingModuleDirPaths(t *testing.T) {\n\tt.Parallel()\n\tworkspaceDir := filepath.Join(\"testdata\", \"workspace\", \"success\", \"overlapping_dir_path\")\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/foo.proto\":      {moduleFullName: \"buf.test/acme/foobar\"},\n\t\t\t\"bar/bar.proto\":      {moduleFullName: \"buf.test/acme/foobar\"},\n\t\t\t\"foo_internal.proto\": {},\n\t\t\t\"bar_internal.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo_internal.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t\t\"--path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"internal\", \"foo_internal.proto\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo/foo.proto\": {moduleFullName: \"buf.test/acme/foobar\"},\n\t\t\t\"bar/bar.proto\": {moduleFullName: \"buf.test/acme/foobar\"},\n\t\t},\n\t\tworkspaceDir,\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"foo\", \"internal\", \"foo_internal.proto\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(workspaceDir, \"proto\", \"bar\", \"internal\", \"bar_internal.proto\"),\n\t)\n}\n\nfunc TestWorkspaceDuplicateFail(t *testing.T) {\n\tt.Parallel()\n\t// The workspace includes multiple images that define the same file.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: foo.proto is contained in multiple modules:\n  path: \"other/proto\"\n  path: \"proto\"`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"duplicate\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: v1/foo.proto is contained in multiple modules:\n  path: \"other/proto\", includes: \"other/proto/v1\", excludes: \"other/proto/v1/inner\"\n  path: \"proto\", includes: [\"proto/v1\", \"proto/v2\"], excludes: [\"proto/v1/inner\", \"proto/v2/inner\"]`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"duplicate\"),\n\t)\n}\n\nfunc TestWorkspaceDuplicateFailSpecificModule(t *testing.T) {\n\t// The workspace includes multiple images that define the same file.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: foo.proto is contained in multiple modules:\n  path: \"other/proto\"\n  path: \"proto\"`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"duplicate\", \"proto\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: v1/foo.proto is contained in multiple modules:\n  path: \"other/proto\", includes: \"other/proto/v1\", excludes: \"other/proto/v1/inner\"\n  path: \"proto\", includes: [\"proto/v1\", \"proto/v2\"], excludes: [\"proto/v1/inner\", \"proto/v2/inner\"]`,\n\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"duplicate\", \"proto\"),\n\t)\n}\n\nfunc TestWorkspaceNotExistFail(t *testing.T) {\n\tt.Parallel()\n\t// The directory defined in the workspace does not exist.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\tfilepath.FromSlash(`Failure: Module \"path: \"notexist\"\" had no .proto files`),\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"notexist\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\tfilepath.FromSlash(`Failure: Module \"path: \"notexist\"\" had no .proto files`),\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"notexist\"),\n\t)\n}\n\nfunc TestWorkspaceJumpContextFail(t *testing.T) {\n\tt.Parallel()\n\t// The workspace directories cannot jump context.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/jumpcontext/buf.work.yaml: directory \"../breaking/other/proto\" is invalid: ../breaking/other/proto: is outside the context directory`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"jumpcontext\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/v2/jumpcontext/buf.yaml: invalid module path: ../breaking/other/proto: is outside the context directory`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"jumpcontext\"),\n\t)\n}\n\nfunc TestWorkspaceDirOverlapFail(t *testing.T) {\n\tt.Parallel()\n\t// The buf.work.yaml file cannot specify overlapping directories.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/diroverlap/buf.work.yaml: directory \"foo\" contains directory \"foo/bar\"`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"diroverlap\"),\n\t)\n}\n\nfunc TestWorkspaceInputOverlapFail(t *testing.T) {\n\t// The target input cannot overlap with any of the directories defined\n\t// in the workspace.\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: failed to build input \"proto/buf\" because it is contained by module at path \"proto\" specified in your configuration, you must provide the workspace or module as the input, and filter to this path using --path`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"overlap\", \"proto\", \"buf\"),\n\t)\n\t// This works because of our fallback logic, so we build the workspace at testdata/workspace/success/dir\n\ttestRunStdout(t, nil, 0, ``, \"build\", filepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\", \"other\"))\n}\n\nfunc TestWorkspaceInputOverlapNonExistentDirFail(t *testing.T) {\n\t// The target input is a non-existent directory and the workspace contains a single\n\t// module at the root, \".\".\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: no .proto files were targeted. This can occur if no .proto files are found in your input, --path points to files that do not exist, or --exclude-path excludes all files.`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"overlap\", \"proto\", \"fake-dir\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: no .proto files were targeted. This can occur if no .proto files are found in your input, --path points to files that do not exist, or --exclude-path excludes all files.`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"overlap\", \"fake-dir\"),\n\t)\n}\n\nfunc TestWorkspaceNoVersionFail(t *testing.T) {\n\t// The buf.work.yaml must specify a version.\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/noversion/buf.work.yaml: \"version\" is not set. Please add \"version: v1\"`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"noversion\"),\n\t)\n}\n\nfunc TestWorkspaceInvalidVersionFail(t *testing.T) {\n\t// The buf.work.yaml must specify a valid version.\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/invalidversion/buf.work.yaml: unknown file version: \"v9\"`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"invalidversion\"),\n\t)\n}\n\nfunc TestWorkspaceNoDirectoriesFail(t *testing.T) {\n\tt.Parallel()\n\t// The buf.work.yaml must specify at least one directory.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/nodirectories/buf.work.yaml: directories is empty`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"nodirectories\"),\n\t)\n}\n\nfunc TestWorkspaceWithWorkspacePathFail(t *testing.T) {\n\tt.Parallel()\n\t// The --path flag cannot match the workspace directory (i.e. root requirements).\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: given input is equal to a value of --path, this has no effect and is disallowed`,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: given input is equal to a value of --path, this has no effect and is disallowed`,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t)\n}\n\nfunc TestWorkspaceWithWorkspaceExcludePathFail(t *testing.T) {\n\tt.Parallel()\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: given input \".\" is equal to a value of --exclude-path \".\", this would exclude everything`,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: given input \".\" is equal to a value of --exclude-path \".\", this would exclude everything`,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t\t\"--exclude-path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t)\n}\n\nfunc TestWorkspaceWithWorkspaceDirectoryPathFail(t *testing.T) {\n\tt.Parallel()\n\t// The --path flag cannot match one of the workspace directories (i.e. root requirements).\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: module \"proto\" was specified with --path, specify this module path directly as an input`,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\", \"proto\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: module \"proto\" was specified with --path, specify this module path directly as an input`,\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\", \"proto\"),\n\t)\n}\n\nfunc TestWorkspaceWithInvalidWorkspaceDirectoryPathFail(t *testing.T) {\n\tt.Parallel()\n\t// The --path flag did not reference a file found in either of the\n\t// workspace directories.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\", \"notexist\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\", \"notexist\"),\n\t)\n}\n\nfunc TestWorkspaceWithInvalidDirPathFail(t *testing.T) {\n\tt.Parallel()\n\t// The --path flag did not reference a file found outside of\n\t// one of the workspace directories.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\", \"proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\", \"proto\", \"notexist\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\", \"proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\", \"proto\", \"notexist\"),\n\t)\n}\n\nfunc TestWorkspaceWithInvalidArchivePathFail(t *testing.T) {\n\tif runtime.GOOS == \"windows\" {\n\t\t// TODO FUTURE: failing test, fix on windows, there is temp dir clean-up fail, a reference to archive.zip not closed\n\t\tt.Skip()\n\t}\n\t// The --path flag did not reference a file found in the archive.\n\tzipDir := createZipFromDir(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t\t\"archive.zip\",\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),\n\t\t\"lint\",\n\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"proto\", \"notexist\"),\n\t)\n\tzipDir = createZipFromDir(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t\t\"archive.zip\",\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: `+bufmodule.ErrNoTargetProtoFiles.Error(),\n\t\t\"lint\",\n\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(\"proto\", \"notexist\"),\n\t)\n}\n\nfunc TestWorkspaceWithInvalidArchiveAbsolutePathFail(t *testing.T) {\n\tif runtime.GOOS == \"windows\" {\n\t\t// TODO FUTURE: failing test, fix on windows, there is temp dir clean-up fail, a reference to archive.zip not closed\n\t\tt.Skip()\n\t}\n\t// The --path flag did not reference an absolute file patfound in the archive.\n\tzipDir := createZipFromDir(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"dir\"),\n\t\t\"archive.zip\",\n\t)\n\twd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\tfilepath.FromSlash(fmt.Sprintf(\n\t\t\t`Failure: %s/proto/rpc.proto: expected to be relative`,\n\t\t\twd,\n\t\t)),\n\t\t\"lint\",\n\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(wd, \"proto\", \"rpc.proto\"),\n\t)\n\tzipDir = createZipFromDir(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"dir\"),\n\t\t\"archive.zip\",\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\tfilepath.FromSlash(fmt.Sprintf(\n\t\t\t`Failure: %s/proto/rpc.proto: expected to be relative`,\n\t\t\twd,\n\t\t)),\n\t\t\"lint\",\n\t\tfilepath.Join(zipDir, \"archive.zip#subdir=proto\"),\n\t\t\"--path\",\n\t\tfilepath.Join(wd, \"proto\", \"rpc.proto\"),\n\t)\n}\n\nfunc TestWorkspaceWithTargetingModuleCommonParentDir(t *testing.T) {\n\tworkspaceDir := filepath.Join(\"testdata\", \"workspace\", \"success\", \"shared_parent_dir\")\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo.proto\":        {},\n\t\t\t\"bar.proto\":        {},\n\t\t\t\"baz.proto\":        {},\n\t\t\t\"imported.proto\":   {},\n\t\t\t\"standalone.proto\": {},\n\t\t},\n\t\tworkspaceDir,\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"imported.proto\":   {},\n\t\t\t\"standalone.proto\": {},\n\t\t},\n\t\tfilepath.Join(workspaceDir, \"standalone\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo.proto\":      {},\n\t\t\t\"bar.proto\":      {},\n\t\t\t\"baz.proto\":      {},\n\t\t\t\"imported.proto\": {isImport: true},\n\t\t},\n\t\tfilepath.Join(workspaceDir, \"parent\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo.proto\":      {isImport: true},\n\t\t\t\"bar.proto\":      {},\n\t\t\t\"baz.proto\":      {},\n\t\t\t\"imported.proto\": {isImport: true},\n\t\t},\n\t\tfilepath.Join(workspaceDir, \"parent/nextlayer\"),\n\t)\n\trequireBuildOutputFilePaths(\n\t\tt,\n\t\tmap[string]expectedFileInfo{\n\t\t\t\"foo.proto\":      {isImport: true},\n\t\t\t\"bar.proto\":      {},\n\t\t\t\"imported.proto\": {isImport: true},\n\t\t},\n\t\tfilepath.Join(workspaceDir, \"parent/nextlayer/bar\"),\n\t)\n}\n\nfunc createZipFromDir(t *testing.T, rootPath string, archiveName string) string {\n\tzipDir := filepath.Join(t.TempDir(), rootPath)\n\trequire.NoError(t, os.MkdirAll(zipDir, 0755))\n\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\ttestdataBucket, err := storageosProvider.NewReadWriteBucket(\n\t\trootPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\n\tbuffer := bytes.NewBuffer(nil)\n\trequire.NoError(t, storagearchive.Zip(\n\t\tt.Context(),\n\t\ttestdataBucket,\n\t\tbuffer,\n\t\ttrue,\n\t))\n\n\tzipBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tzipDir,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\trequire.NoError(t, storage.PutPath(\n\t\tt.Context(),\n\t\tzipBucket,\n\t\tarchiveName,\n\t\tbuffer.Bytes(),\n\t))\n\treturn zipDir\n}\n\ntype expectedFileInfo struct {\n\tisImport       bool\n\tmoduleFullName string\n}\n\nfunc requireBuildOutputFilePaths(t *testing.T, expectedFilePathToInfo map[string]expectedFileInfo, buildArgs ...string) {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tappcmdtesting.Run(\n\t\tt,\n\t\tfunc(use string) *appcmd.Command { return newRootCommand(use) },\n\t\tappcmdtesting.WithExpectedExitCode(0),\n\t\tappcmdtesting.WithEnv(internaltesting.NewEnvFunc(t)),\n\t\tappcmdtesting.WithStdout(stdout),\n\t\tappcmdtesting.WithStderr(stderr),\n\t\tappcmdtesting.WithArgs(append(\n\t\t\t[]string{\n\t\t\t\t\"build\",\n\t\t\t\t\"-o=-#format=binpb\",\n\t\t\t},\n\t\t\tbuildArgs...,\n\t\t)...),\n\t)\n\toutputImage := &imagev1.Image{}\n\trequire.NoError(t, protoencoding.NewWireUnmarshaler(nil).Unmarshal(stdout.Bytes(), outputImage))\n\n\tfilesToCheck := xslices.ToStructMap(xslices.MapKeysToSlice(expectedFilePathToInfo))\n\n\tfor _, imageFile := range outputImage.GetFile() {\n\t\tfilePath := imageFile.GetName()\n\t\texpectedFileInfo, ok := expectedFilePathToInfo[filePath]\n\t\trequire.Truef(t, ok, \"unexpected file in the image built: %s\", filePath)\n\t\trequire.Equal(t, expectedFileInfo.isImport, imageFile.GetBufExtension().GetIsImport())\n\t\tif expectedFileInfo.moduleFullName != \"\" {\n\t\t\tmoduleName := imageFile.GetBufExtension().GetModuleInfo().GetName()\n\t\t\trequire.NotNil(t, moduleName)\n\t\t\trequire.Equal(t, expectedFileInfo.moduleFullName, fmt.Sprintf(\"%s/%s/%s\", moduleName.GetRemote(), moduleName.GetOwner(), moduleName.GetRepository()))\n\t\t} else {\n\t\t\trequire.Nil(t, imageFile.GetBufExtension().GetModuleInfo().GetName())\n\t\t}\n\t\tdelete(filesToCheck, filePath)\n\t}\n\trequire.Zerof(t, len(filesToCheck), \"expected files missing from image built: %v\", xslices.MapKeysToSortedSlice(filesToCheck))\n}\n"
  },
  {
    "path": "cmd/buf/workspace_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage main\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n)\n\nfunc TestWorkspaceSymlinkFail(t *testing.T) {\n\tt.Parallel()\n\t// The workspace includes a symlink that isn't buildable.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\t``,\n\t\tfilepath.FromSlash(`testdata/workspace/fail/symlink/b/b.proto:5:8:import \"c.proto\": file does not exist`),\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"symlink\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\t``,\n\t\tfilepath.FromSlash(`testdata/workspace/fail/v2/symlink/b/b.proto:5:8:import \"c.proto\": file does not exist`),\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"symlink\"),\n\t)\n}\n\nfunc TestWorkspaceSymlink(t *testing.T) {\n\t// The workspace includes valid symlinks.\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"symlink\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/workspace/success/symlink/a/a.proto\n        testdata/workspace/success/symlink/b/b.proto\n        testdata/workspace/success/symlink/c/c.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"symlink\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/symlink/a/a.proto:3:1:Files with package \"a\" must be within a directory \"a\" relative to root but were in directory \".\".\n        testdata/workspace/success/symlink/a/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".\n        testdata/workspace/success/symlink/b/b.proto:3:1:Files with package \"b\" must be within a directory \"b\" relative to root but were in directory \".\".\n        testdata/workspace/success/symlink/b/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".\n        testdata/workspace/success/symlink/c/c.proto:3:1:Files with package \"c\" must be within a directory \"c\" relative to root but were in directory \".\".\n        testdata/workspace/success/symlink/c/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"symlink\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"symlink\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`testdata/workspace/success/v2/symlink/a/a.proto\n        testdata/workspace/success/v2/symlink/b/b.proto\n        testdata/workspace/success/v2/symlink/c/c.proto`),\n\t\t\"ls-files\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"symlink\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`testdata/workspace/success/v2/symlink/a/a.proto:3:1:Files with package \"a\" must be within a directory \"a\" relative to root but were in directory \".\".\n        testdata/workspace/success/v2/symlink/a/a.proto:3:1:Package name \"a\" should be suffixed with a correctly formed version, such as \"a.v1\".\n        testdata/workspace/success/v2/symlink/b/b.proto:3:1:Files with package \"b\" must be within a directory \"b\" relative to root but were in directory \".\".\n        testdata/workspace/success/v2/symlink/b/b.proto:3:1:Package name \"b\" should be suffixed with a correctly formed version, such as \"b.v1\".\n        testdata/workspace/success/v2/symlink/c/c.proto:3:1:Files with package \"c\" must be within a directory \"c\" relative to root but were in directory \".\".\n        testdata/workspace/success/v2/symlink/c/c.proto:3:1:Package name \"c\" should be suffixed with a correctly formed version, such as \"c.v1\".`),\n\t\t\"lint\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"success\", \"v2\", \"symlink\"),\n\t)\n}\n\nfunc TestWorkspaceAbsoluteFail(t *testing.T) {\n\tt.Parallel()\n\t// The workspace file (v1: buf.work.yaml, v2: buf.yaml) cannot specify absolute paths.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/absolute/buf.work.yaml: directory \"/home/buf\" is invalid: /home/buf: expected to be relative`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"absolute\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/v2/absolute/buf.yaml: invalid module path: /home/buf: expected to be relative`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"absolute\"),\n\t)\n}\n\n// TODO: Move this back to workspace_test.go. after resolving the issue where git\n// clone failed with \"unable to create file filename too long\" on Windows CI.\n// Workflow run: https://github.com/bufbuild/buf/actions/runs/6510804063/job/17685247791.\n// Potential fix: https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows.\nfunc TestWorkspaceGit(t *testing.T) {\n\t// Directory paths specified as a git reference within a workspace.\n\tt.Parallel()\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/dir/proto\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/dir/proto\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"rpc.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`cmd/buf/testdata/workspace/success/dir/proto/rpc.proto`),\n\t\t\"ls-files\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/dir/proto\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n\t cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\"lint\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/dir/proto\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n\t cmd/buf/testdata/workspace/success/dir/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\"lint\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/dir/proto\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"rpc.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/v2/dir/proto\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\t``,\n\t\t\"build\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/v2/dir/proto\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"rpc.proto\"),\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t\tfilepath.FromSlash(`cmd/buf/testdata/workspace/success/v2/dir/proto/rpc.proto`),\n\t\t\"ls-files\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/v2/dir/proto\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`cmd/buf/testdata/workspace/success/v2/dir/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n        cmd/buf/testdata/workspace/success/v2/dir/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\"lint\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/v2/dir/proto\",\n\t)\n\ttestRunStdout(\n\t\tt,\n\t\tnil,\n\t\tbufctl.ExitCodeFileAnnotation,\n\t\tfilepath.FromSlash(`cmd/buf/testdata/workspace/success/v2/dir/proto/rpc.proto:3:1:Files with package \"example\" must be within a directory \"example\" relative to root but were in directory \".\".\n        cmd/buf/testdata/workspace/success/v2/dir/proto/rpc.proto:3:1:Package name \"example\" should be suffixed with a correctly formed version, such as \"example.v1\".`),\n\t\t\"lint\",\n\t\t\"../../.git#ref=HEAD,subdir=cmd/buf/testdata/workspace/success/v2/dir/proto\",\n\t\t\"--path\",\n\t\tfilepath.Join(\"rpc.proto\"),\n\t)\n}\n"
  },
  {
    "path": "cmd/buf/workspace_windows_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestWorkspaceAbsoluteFail(t *testing.T) {\n\t// The workspace file (v1: buf.work.yaml, v2: buf.yaml) file cannot specify absolute paths.\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/absolute/windows/buf.work.yaml: directory \"C:\\\\buf\" is invalid: C:\\buf: expected to be relative`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"absolute\", \"windows\"),\n\t)\n\ttestRunStdoutStderrNoWarn(\n\t\tt,\n\t\tnil,\n\t\t1,\n\t\t``,\n\t\t`Failure: decode testdata/workspace/fail/v2/absolute/windows/buf.yaml: invalid module path: C:\\buf: expected to be relative`,\n\t\t\"build\",\n\t\tfilepath.Join(\"testdata\", \"workspace\", \"fail\", \"v2\", \"absolute\", \"windows\"),\n\t)\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-breaking/breaking.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/protoplugin\"\n)\n\nconst (\n\tappName        = \"protoc-gen-buf-breaking\"\n\tdefaultTimeout = 10 * time.Second\n)\n\nfunc main() {\n\tprotoplugin.Main(\n\t\tprotoplugin.HandlerFunc(handle),\n\t\t// An `EmptyResolver` is passed to protoplugin for unmarshalling instead of defaulting to\n\t\t// protoregistry.GlobalTypes so that extensions are not inadvertently parsed from generated\n\t\t// code linked into the binary. Extensions are later reparsed with the descriptorset itself.\n\t\t// https://github.com/bufbuild/buf/issues/3306\n\t\tprotoplugin.WithExtensionTypeResolver(protoencoding.EmptyResolver),\n\t)\n}\n\nfunc handle(\n\tctx context.Context,\n\tpluginEnv protoplugin.PluginEnv,\n\tresponseWriter protoplugin.ResponseWriter,\n\trequest protoplugin.Request,\n) (retErr error) {\n\tresponseWriter.SetFeatureProto3Optional()\n\tresponseWriter.SetFeatureSupportsEditions(protodescriptor.MinSupportedEdition, protodescriptor.MaxSupportedEdition)\n\texternalConfig := &externalConfig{}\n\tif err := encoding.UnmarshalJSONOrYAMLStrict(\n\t\t[]byte(request.Parameter()),\n\t\texternalConfig,\n\t); err != nil {\n\t\treturn err\n\t}\n\tif externalConfig.AgainstInput == \"\" {\n\t\t// this is actually checked as part of ReadImageEnv but just in case\n\t\treturn errors.New(`\"against_input\" is required`)\n\t}\n\tcontainer, err := bufcli.NewAppextContainerForPluginEnv(\n\t\tpluginEnv,\n\t\tappName,\n\t\texternalConfig.LogLevel,\n\t\texternalConfig.LogFormat,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttimeout := externalConfig.Timeout\n\tif timeout == 0 {\n\t\ttimeout = defaultTimeout\n\t}\n\tctx, cancel := context.WithTimeout(ctx, timeout)\n\tdefer cancel()\n\tvar targetPaths []string\n\tif externalConfig.LimitToInputFiles {\n\t\ttargetPaths = request.CodeGeneratorRequest().GetFileToGenerate()\n\t}\n\tcontroller, err := bufcli.NewController(\n\t\tcontainer,\n\t\tbufctl.WithFileAnnotationErrorFormat(externalConfig.ErrorFormat),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tagainstImage, err := controller.GetImage(\n\t\tctx,\n\t\texternalConfig.AgainstInput,\n\t\t// limit to the input files if specified\n\t\tbufctl.WithTargetPaths(targetPaths, nil),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar breakingOptions []bufcheck.BreakingOption\n\tif externalConfig.ExcludeImports {\n\t\tbreakingOptions = append(breakingOptions, bufcheck.BreakingWithExcludeImports())\n\t}\n\timage, err := bufimage.NewImageForCodeGeneratorRequest(request.CodeGeneratorRequest())\n\tif err != nil {\n\t\treturn err\n\t}\n\t// The protoc plugins only support local plugins.\n\twasmRuntime, err := bufcli.NewWasmRuntime(ctx, container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, wasmRuntime.Close(ctx))\n\t}()\n\tclient, err := bufcheck.NewClient(\n\t\tcontainer.Logger(),\n\t\tbufcheck.ClientWithStderr(pluginEnv.Stderr),\n\t\tbufcheck.ClientWithRunnerProvider(\n\t\t\tbufcheck.NewLocalRunnerProvider(wasmRuntime),\n\t\t),\n\t\tbufcheck.ClientWithLocalWasmPluginsFromOS(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleConfig, pluginConfigs, allCheckConfigs, err := bufcli.GetModuleConfigAndPluginConfigsForProtocPlugin(\n\t\tctx,\n\t\tencoding.GetJSONStringOrStringValue(externalConfig.InputConfig),\n\t\texternalConfig.Module,\n\t\texternalConfig.PluginOverrides,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(pluginConfigs) > 0 {\n\t\tbreakingOptions = append(breakingOptions, bufcheck.WithPluginConfigs(pluginConfigs...))\n\t\t// We add all check configs (both lint and breaking) across all configured modules in buf.yaml\n\t\t// as related configs to check if plugins have rules configured.\n\t\tbreakingOptions = append(breakingOptions, bufcheck.WithRelatedCheckConfigs(allCheckConfigs...))\n\t}\n\tif err := client.Breaking(\n\t\tctx,\n\t\tmoduleConfig.BreakingConfig(),\n\t\timage,\n\t\tagainstImage,\n\t\tbreakingOptions...,\n\t); err != nil {\n\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\tif errors.As(err, &fileAnnotationSet) {\n\t\t\tbuffer := bytes.NewBuffer(nil)\n\t\t\tif err := bufanalysis.PrintFileAnnotationSet(\n\t\t\t\tbuffer,\n\t\t\t\tfileAnnotationSet,\n\t\t\t\texternalConfig.ErrorFormat,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tresponseWriter.AddError(strings.TrimSpace(buffer.String()))\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype externalConfig struct {\n\tAgainstInput string `json:\"against_input,omitempty\" yaml:\"against_input,omitempty\"`\n\t// This was never actually used, but we keep it around for we can do unmarshal strict without breaking anyone.\n\tAgainstInputConfig json.RawMessage   `json:\"against_input_config,omitempty\" yaml:\"against_input_config,omitempty\"`\n\tInputConfig        json.RawMessage   `json:\"input_config,omitempty\" yaml:\"input_config,omitempty\"`\n\tModule             string            `json:\"module,omitempty\" yaml:\"module,omitempty\"`\n\tLimitToInputFiles  bool              `json:\"limit_to_input_files,omitempty\" yaml:\"limit_to_input_files,omitempty\"`\n\tExcludeImports     bool              `json:\"exclude_imports,omitempty\" yaml:\"exclude_imports,omitempty\"`\n\tLogLevel           string            `json:\"log_level,omitempty\" yaml:\"log_level,omitempty\"`\n\tLogFormat          string            `json:\"log_format,omitempty\" yaml:\"log_format,omitempty\"`\n\tErrorFormat        string            `json:\"error_format,omitempty\" yaml:\"error_format,omitempty\"`\n\tTimeout            time.Duration     `json:\"timeout,omitempty\" yaml:\"timeout,omitempty\"`\n\tPluginOverrides    map[string]string `json:\"plugin_overrides,omitempty\" yaml:\"plugin_overrides,omitempty\"`\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/lint.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/buf/bufcli\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/protoplugin\"\n)\n\nconst (\n\tappName        = \"protoc-gen-buf-lint\"\n\tdefaultTimeout = 10 * time.Second\n)\n\nfunc main() {\n\tprotoplugin.Main(\n\t\tprotoplugin.HandlerFunc(handle),\n\t\t// An `EmptyResolver` is passed to protoplugin for unmarshalling instead of defaulting to\n\t\t// protoregistry.GlobalTypes so that extensions are not inadvertently parsed from generated\n\t\t// code linked into the binary. Extensions are later reparsed with the descriptorset itself.\n\t\t// https://github.com/bufbuild/buf/issues/3306\n\t\tprotoplugin.WithExtensionTypeResolver(protoencoding.EmptyResolver),\n\t)\n}\n\nfunc handle(\n\tctx context.Context,\n\tpluginEnv protoplugin.PluginEnv,\n\tresponseWriter protoplugin.ResponseWriter,\n\trequest protoplugin.Request,\n) (retErr error) {\n\tresponseWriter.SetFeatureProto3Optional()\n\tresponseWriter.SetFeatureSupportsEditions(protodescriptor.MinSupportedEdition, protodescriptor.MaxSupportedEdition)\n\texternalConfig := &externalConfig{}\n\tif err := encoding.UnmarshalJSONOrYAMLStrict(\n\t\t[]byte(request.Parameter()),\n\t\texternalConfig,\n\t); err != nil {\n\t\treturn err\n\t}\n\tcontainer, err := bufcli.NewAppextContainerForPluginEnv(\n\t\tpluginEnv,\n\t\tappName,\n\t\texternalConfig.LogLevel,\n\t\texternalConfig.LogFormat,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttimeout := externalConfig.Timeout\n\tif timeout == 0 {\n\t\ttimeout = defaultTimeout\n\t}\n\tctx, cancel := context.WithTimeout(ctx, timeout)\n\tdefer cancel()\n\t// With the \"buf lint\" command, we build the image and then the linter can report\n\t// unused imports that the compiler reports. But with a plugin, we get descriptors\n\t// that are already built and no access to any possible associated compiler warnings.\n\t// So we have to analyze the files to compute the unused imports.\n\timage, err := bufimage.NewImageForCodeGeneratorRequest(request.CodeGeneratorRequest(), bufimage.WithUnusedImportsComputation())\n\tif err != nil {\n\t\treturn err\n\t}\n\t// The protoc plugins only support local plugins.\n\twasmRuntime, err := bufcli.NewWasmRuntime(ctx, container)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, wasmRuntime.Close(ctx))\n\t}()\n\tclient, err := bufcheck.NewClient(\n\t\tcontainer.Logger(),\n\t\tbufcheck.ClientWithStderr(pluginEnv.Stderr),\n\t\tbufcheck.ClientWithRunnerProvider(\n\t\t\tbufcheck.NewLocalRunnerProvider(wasmRuntime),\n\t\t),\n\t\tbufcheck.ClientWithLocalWasmPluginsFromOS(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleConfig, pluginConfigs, allCheckConfigs, err := bufcli.GetModuleConfigAndPluginConfigsForProtocPlugin(\n\t\tctx,\n\t\tencoding.GetJSONStringOrStringValue(externalConfig.InputConfig),\n\t\texternalConfig.Module,\n\t\texternalConfig.PluginOverrides,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := client.Lint(\n\t\tctx,\n\t\tmoduleConfig.LintConfig(),\n\t\timage,\n\t\tbufcheck.WithPluginConfigs(pluginConfigs...),\n\t\t// We add all check configs (both lint and breaking) across all configured modules in buf.yaml\n\t\t// as related configs to check if plugins have rules configured.\n\t\tbufcheck.WithRelatedCheckConfigs(allCheckConfigs...),\n\t); err != nil {\n\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\tif errors.As(err, &fileAnnotationSet) {\n\t\t\tbuffer := bytes.NewBuffer(nil)\n\t\t\tif externalConfig.ErrorFormat == \"config-ignore-yaml\" {\n\t\t\t\tif err := bufcli.PrintFileAnnotationSetLintConfigIgnoreYAMLV1(\n\t\t\t\t\tbuffer,\n\t\t\t\t\tfileAnnotationSet,\n\t\t\t\t); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif err := bufanalysis.PrintFileAnnotationSet(\n\t\t\t\t\tbuffer,\n\t\t\t\t\tfileAnnotationSet,\n\t\t\t\t\texternalConfig.ErrorFormat,\n\t\t\t\t); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tresponseWriter.AddError(strings.TrimSpace(buffer.String()))\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype externalConfig struct {\n\tInputConfig     json.RawMessage   `json:\"input_config,omitempty\" yaml:\"input_config,omitempty\"`\n\tModule          string            `json:\"module,omitempty\" yaml:\"module,omitempty\"`\n\tLogLevel        string            `json:\"log_level,omitempty\" yaml:\"log_level,omitempty\"`\n\tLogFormat       string            `json:\"log_format,omitempty\" yaml:\"log_format,omitempty\"`\n\tErrorFormat     string            `json:\"error_format,omitempty\" yaml:\"error_format,omitempty\"`\n\tTimeout         time.Duration     `json:\"timeout,omitempty\" yaml:\"timeout,omitempty\"`\n\tPluginOverrides map[string]string `json:\"plugin_overrides,omitempty\" yaml:\"plugin_overrides,omitempty\"`\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/lint_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/prototesting\"\n\t\"github.com/bufbuild/protoplugin\"\n\t\"github.com/google/uuid\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc TestRunLint1(t *testing.T) {\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t\"\",\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t\tnormalpath.Join(\"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n\t\tbuf/buf.proto:3:1:Package name \"other\" should be suffixed with a correctly formed version, such as \"other.v1\".\n\t\tbuf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".\n\t\tbuf/buf_two.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n\t\tbuf/buf_two.proto:3:1:Package name \"other\" should be suffixed with a correctly formed version, such as \"other.v1\".\n\t\tbuf/buf_two.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".\n\t\t`,\n\t)\n}\n\nfunc TestRunLint2(t *testing.T) {\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t\"\",\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n\t\tbuf/buf.proto:3:1:Package name \"other\" should be suffixed with a correctly formed version, such as \"other.v1\".\n\t\tbuf/buf.proto:6:9:Field name \"oneTwo\" should be lower_snake_case, such as \"one_two\".\n\t\t`,\n\t)\n}\n\nfunc TestRunLint3(t *testing.T) {\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t`{\"input_config\":\"testdata/fail/something.yaml\"}`,\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n\t\t`,\n\t)\n}\n\nfunc TestRunLint4(t *testing.T) {\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t`{\"input_config\":{\"version\":\"v1\",\"lint\":{\"use\":[\"PACKAGE_DIRECTORY_MATCH\"]}}}`,\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n\t\t`,\n\t)\n}\n\nfunc TestRunLint5(t *testing.T) {\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t`{\"input_config\":{\"version\":\"v1\",\"lint\":{\"use\":[\"PACKAGE_DIRECTORY_MATCH\"]}}}`,\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n\t\t`,\n\t)\n}\n\nfunc TestRunLint6(t *testing.T) {\n\t// specifically testing that output is stable\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t`{\"input_config\":{\"version\":\"v1\",\"lint\":{\"use\":[\"PACKAGE_DIRECTORY_MATCH\"]}},\"error_format\":\"json\"}`,\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\t{\"path\":\"buf/buf.proto\",\"start_line\":3,\"start_column\":1,\"end_line\":3,\"end_column\":15,\"type\":\"PACKAGE_DIRECTORY_MATCH\",\"message\":\"Files with package \\\"other\\\" must be within a directory \\\"other\\\" relative to root but were in directory \\\"buf\\\".\"}\n\t\t`,\n\t)\n}\n\nfunc TestRunLint7(t *testing.T) {\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t`{\"input_config\":{\"version\":\"v1\",\"lint\":{\"use\":[\"PACKAGE_DIRECTORY_MATCH\"]}},\"error_format\":\"json\"}`,\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\t{\"path\":\"buf/buf.proto\",\"start_line\":3,\"start_column\":1,\"end_line\":3,\"end_column\":15,\"type\":\"PACKAGE_DIRECTORY_MATCH\",\"message\":\"Files with package \\\"other\\\" must be within a directory \\\"other\\\" relative to root but were in directory \\\"buf\\\".\"}\n\t\t`,\n\t)\n}\n\nfunc TestRunLint8(t *testing.T) {\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"fail\"),\n\t\t[]string{\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf.proto\"),\n\t\t\tfilepath.Join(\"testdata\", \"fail\", \"buf\", \"buf_two.proto\"),\n\t\t},\n\t\t`{\"input_config\":\"testdata/fail/v2.yaml\",\"module\":\"fail\"}`,\n\t\t[]string{\n\t\t\tnormalpath.Join(\"buf\", \"buf.proto\"),\n\t\t},\n\t\t0,\n\t\t`\n\t\tbuf/buf.proto:3:1:Files with package \"other\" must be within a directory \"other\" relative to root but were in directory \"buf\".\n\t\t`,\n\t)\n}\n\nfunc TestRunLint_UnusedImports(t *testing.T) {\n\tunusedImportsFileComponents := [][]string{\n\t\t{\"buf\", \"v1\", \"a.proto\"},\n\t\t{\"buf\", \"v1\", \"b.proto\"},\n\t\t{\"buf\", \"v1\", \"c.proto\"},\n\t\t{\"buf\", \"v1\", \"d.proto\"},\n\t\t{\"buf\", \"v1\", \"e.proto\"},\n\t\t{\"buf\", \"v1\", \"f.proto\"},\n\t\t{\"buf\", \"v1\", \"g.proto\"},\n\t\t{\"buf\", \"v1\", \"file_option.proto\"},\n\t\t{\"buf\", \"v1\", \"msg_option.proto\"},\n\t\t{\"buf\", \"v1\", \"field_option.proto\"},\n\t\t{\"buf\", \"v1\", \"oneof_option.proto\"},\n\t\t{\"buf\", \"v1\", \"extrange_option.proto\"},\n\t\t{\"buf\", \"v1\", \"enum_option.proto\"},\n\t\t{\"buf\", \"v1\", \"enumvalue_option.proto\"},\n\t\t{\"buf\", \"v1\", \"service_option.proto\"},\n\t\t{\"buf\", \"v1\", \"method_option.proto\"},\n\t}\n\tunusedImportFilesWithFullPath := make([]string, len(unusedImportsFileComponents))\n\tfor i, components := range unusedImportsFileComponents {\n\t\tunusedImportFilesWithFullPath[i] = filepath.Join(append([]string{\"testdata\", \"unused-imports\"}, components...)...)\n\t}\n\tunusedImportFiles := make([]string, len(unusedImportsFileComponents))\n\tfor i, components := range unusedImportsFileComponents {\n\t\tunusedImportFiles[i] = normalpath.Join(components...)\n\t}\n\tt.Parallel()\n\ttestRunLint(\n\t\tt,\n\t\tfilepath.Join(\"testdata\", \"unused-imports\"),\n\t\tunusedImportFilesWithFullPath,\n\t\t``,\n\t\tunusedImportFiles,\n\t\t0,\n\t\t`\n\t\tbuf/v1/a.proto:13:1:Import \"buf/v1/f.proto\" is unused.\n\t\tbuf/v1/a.proto:14:1:Import \"buf/v1/extrange_option.proto\" is unused.\n\t\tbuf/v1/b.proto:5:1:Import \"buf/v1/c.proto\" must not be public.\n\t\tbuf/v1/c.proto:9:1:Import \"buf/v1/e.proto\" is unused.\n\t\tbuf/v1/c.proto:10:1:Import \"buf/v1/f.proto\" is unused.\n\t\tbuf/v1/d.proto:8:1:Import \"buf/v1/f.proto\" is unused.\n\t\tbuf/v1/e.proto:8:1:Import \"buf/v1/g.proto\" is unused.\n\t\t`,\n\t)\n}\n\nfunc testRunLint(\n\tt *testing.T,\n\troot string,\n\trealFilePaths []string,\n\tparameter string,\n\tfileToGenerate []string,\n\texpectedExitCode int,\n\texpectedErrorString string,\n) {\n\ttestRunHandlerFunc(\n\t\tt,\n\t\tprotoplugin.HandlerFunc(\n\t\t\tfunc(\n\t\t\t\tctx context.Context,\n\t\t\t\tpluginEnv protoplugin.PluginEnv,\n\t\t\t\tresponseWriter protoplugin.ResponseWriter,\n\t\t\t\trequest protoplugin.Request,\n\t\t\t) error {\n\t\t\t\treturn handle(\n\t\t\t\t\tctx,\n\t\t\t\t\tpluginEnv,\n\t\t\t\t\tresponseWriter,\n\t\t\t\t\trequest,\n\t\t\t\t)\n\t\t\t},\n\t\t),\n\t\ttestBuildRequest(\n\t\t\tt,\n\t\t\troot,\n\t\t\trealFilePaths,\n\t\t\tparameter,\n\t\t\tfileToGenerate,\n\t\t),\n\t\texpectedExitCode,\n\t\texpectedErrorString,\n\t)\n}\n\nfunc testRunHandlerFunc(\n\tt *testing.T,\n\thandler protoplugin.Handler,\n\trequest protoplugin.Request,\n\texpectedExitCode int,\n\texpectedErrorString string,\n) {\n\trequestData, err := protoencoding.NewWireMarshaler().Marshal(request.CodeGeneratorRequest())\n\trequire.NoError(t, err)\n\tstdin := bytes.NewReader(requestData)\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\n\texitCode := app.GetExitCode(\n\t\tprotoplugin.Run(\n\t\t\tt.Context(),\n\t\t\tprotoplugin.Env{\n\t\t\t\tArgs:    nil,\n\t\t\t\tStdin:   stdin,\n\t\t\t\tStdout:  stdout,\n\t\t\t\tStderr:  stderr,\n\t\t\t\tEnviron: nil,\n\t\t\t},\n\t\t\thandler,\n\t\t),\n\t)\n\n\trequire.Equal(t, expectedExitCode, exitCode, xstrings.TrimLines(stderr.String()))\n\tif exitCode == 0 {\n\t\tresponse := &pluginpb.CodeGeneratorResponse{}\n\t\t// we do not need fileDescriptorProtos as there are no extensions\n\t\tunmarshaler := protoencoding.NewWireUnmarshaler(nil)\n\t\trequire.NoError(t, unmarshaler.Unmarshal(stdout.Bytes(), response))\n\t\trequire.Equal(t, xstrings.TrimLines(expectedErrorString), response.GetError(), xstrings.TrimLines(stderr.String()))\n\t}\n}\n\nfunc testBuildRequest(\n\tt *testing.T,\n\troot string,\n\trealFilePaths []string,\n\tparameter string,\n\tfileToGenerate []string,\n) protoplugin.Request {\n\tfileDescriptorSet, err := prototesting.GetProtocFileDescriptorSet(\n\t\tt.Context(),\n\t\t[]string{root},\n\t\trealFilePaths,\n\t\ttrue,\n\t\ttrue,\n\t)\n\trequire.NoError(t, err)\n\tnonImportRootRelFilePaths := make(map[string]struct{}, len(fileToGenerate))\n\tfor _, fileToGenerateFilePath := range fileToGenerate {\n\t\tnonImportRootRelFilePaths[fileToGenerateFilePath] = struct{}{}\n\t}\n\timageFiles := make([]bufimage.ImageFile, len(fileDescriptorSet.File))\n\tfor i, fileDescriptorProto := range fileDescriptorSet.File {\n\t\t_, isNotImport := nonImportRootRelFilePaths[fileDescriptorProto.GetName()]\n\t\timageFile, err := bufimage.NewImageFile(\n\t\t\tfileDescriptorProto,\n\t\t\tnil,\n\t\t\tuuid.Nil,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\t!isNotImport,\n\t\t\tfalse,\n\t\t\tnil,\n\t\t)\n\t\trequire.NoError(t, err)\n\t\timageFiles[i] = imageFile\n\t}\n\timage, err := bufimage.NewImage(imageFiles)\n\trequire.NoError(t, err)\n\tcodeGenReq, err := bufimage.ImageToCodeGeneratorRequest(image, parameter, nil, false, false)\n\trequire.NoError(t, err)\n\trequest, err := protoplugin.NewRequest(codeGenReq)\n\trequire.NoError(t, err)\n\treturn request\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/fail/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage other;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Bar {\n  google.protobuf.Timestamp time = 1;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/fail/buf/buf_two.proto",
    "content": "syntax = \"proto3\";\n\npackage other;\n\nmessage FooTwo {\n  int64 oneTwo = 1;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/fail/something.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/fail/v2.yaml",
    "content": "version: v2\nmodules:\n  - path: fail\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"buf/v1/b.proto\"; // not directly used; but publicly imports c.proto which is used\nimport \"buf/v1/d.proto\"; // message type\nimport \"buf/v1/e.proto\"; // enum type\nimport \"buf/v1/file_option.proto\";\nimport \"buf/v1/msg_option.proto\";\nimport \"buf/v1/oneof_option.proto\";\nimport \"buf/v1/field_option.proto\";\n// unused ones\nimport \"buf/v1/f.proto\";\nimport \"buf/v1/extrange_option.proto\";\n\noption (file_option) = \"foo\";\n\nmessage A {\n  option (msg_option) = \"bar\";\n  oneof field {\n    option (oneof_option) = \"baz\";\n    C c = 1;\n    D d = 2 [(field_option) = \"buzz\"];\n    E e = 3;\n  }\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport public \"buf/v1/c.proto\"; // not used, but no warning because it's public\nimport \"buf/v1/d.proto\";\nimport \"buf/v1/service_option.proto\";\nimport \"buf/v1/method_option.proto\";\n\nmessage B {\n  D d = 1;\n}\n\nservice BService {\n  option (service_option) = \"foo\";\n  rpc DoB(DoBRequest) returns (DoBResponse) {\n    option (method_option) = \"bar\";\n  }\n}\n\nmessage DoBRequest {\n}\n\nmessage DoBResponse {\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/c.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nimport \"buf/v1/d.proto\"; // used in deeply nested any\n// unused ones\nimport \"buf/v1/e.proto\";\nimport \"buf/v1/f.proto\";\n\nmessage C {\n  string name = 1;\n  google.protobuf.Any any = 2;\n}\n\nextend google.protobuf.FieldOptions {\n  C ext_c = 12121 [(ext_c) = {\n    any: {\n      [type.googleapis.com/buf.v1.C]: {\n        any: {\n          [type.googleapis.com/buf.v1.C]: {\n            any: {\n              [type.googleapis.com/buf.v1.D]: {}\n            }\n          }\n        }\n      }\n    }\n  }];\n}"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/d.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nimport \"buf/v1/e.proto\"; // used in any\nimport \"buf/v1/f.proto\"; // unused\nimport \"buf/v1/g.proto\"; // used in any\n\nextend google.protobuf.MessageOptions {\n  google.protobuf.Any any = 11111;\n}\n\nmessage D {\n  option (any) = {\n    [type.googleapis.com/buf.v1.EMsg]: {\n      f: {\n        id: 123\n        [buf.v1.str]: \"abc\"\n      }\n    }\n  };\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/e.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"buf/v1/enum_option.proto\";\nimport \"buf/v1/enumvalue_option.proto\";\nimport \"buf/v1/f.proto\";\nimport \"buf/v1/g.proto\"; // unused\n\nenum E {\n  option (enum_option) = \"foo\";\n\n  E_UNSPECIFIED = 0;\n  E_ONE = 1 [(enumvalue_option) = \"bar\"];\n}\n\nmessage EMsg {\n  F f = 1;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/enum_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.EnumOptions {\n  string enum_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/enumvalue_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.EnumValueOptions {\n  string enumvalue_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/extrange_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.ExtensionRangeOptions {\n  string extrange_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/f.proto",
    "content": "syntax = \"proto2\";\n\npackage buf.v1;\n\nimport \"buf/v1/extrange_option.proto\";\n\nmessage F {\n  optional uint64 id = 1;\n  extensions 10 to 100 [(extrange_option) = \"foo\"];\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/field_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FieldOptions {\n  string field_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/file_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FileOptions {\n  string file_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/g.proto",
    "content": "syntax = \"proto2\";\n\npackage buf.v1;\n\nimport \"buf/v1/f.proto\";\n\nextend F {\n  optional string str = 77;\n}"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/method_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MethodOptions {\n  string method_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/msg_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  string msg_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/oneof_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.OneofOptions {\n  string oneof_option = 10101;\n}\n"
  },
  {
    "path": "cmd/protoc-gen-buf-lint/testdata/unused-imports/buf/v1/service_option.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.ServiceOptions {\n  string service_option = 10101;\n}\n"
  },
  {
    "path": "etc/bandeps/bandeps.yaml",
    "content": "bans:\n  - packages:\n      use:\n        - ./private/bufpkg/...\n        - ./private/pkg/...\n        - ./private/gen/...\n    deps:\n      use:\n        - ./private/buf/...\n    note: Packages in private/buf cannot be depended on by other packages.\n  - packages:\n      use:\n        - ./private/pkg/...\n        - ./private/gen/...\n    deps:\n      use:\n        - ./private/bufpkg/...\n    note: Packages in private/bufpkg cannot be depended on by other packages except private/buf packages.\n  - packages:\n      use:\n        - ./...\n      except:\n        - ./cmd/...\n    deps:\n      use:\n        - ./cmd/...\n    note: Packages in cmd should be self-contained.\n  - packages:\n      use:\n        - ./...\n      except:\n        - ./private/buf/bufcli/...\n        - ./cmd/...\n    deps:\n      use:\n        - ./private/buf/bufcli/...\n    note: Package bufcli can only be depended on by cmd packages.\n  - packages:\n      use:\n        - ./private/pkg/...\n    deps:\n      use:\n        - ./...\n      except:\n        - ./private/pkg/...\n    note: Packages in private/pkg cannot depend on packages outside of private/pkg.\n"
  },
  {
    "path": "etc/template/buf.go-client.gen.yaml",
    "content": "version: v2\nmanaged:\n  enabled: true\n  override:\n    - file_option: go_package_prefix\n      value: github.com/bufbuild/buf/private/gen/proto/go\nplugins:\n  - local: protoc-gen-connect-go\n    out: private/gen/proto/connect\n    opt: paths=source_relative\ninputs:\n  - directory: proto\n"
  },
  {
    "path": "etc/template/buf.go.gen.yaml",
    "content": "version: v2\nmanaged:\n  enabled: true\n  override:\n    - file_option: go_package_prefix\n      value: github.com/bufbuild/buf/private/gen/proto/go\nplugins:\n  - local: protoc-gen-go\n    out: private/gen/proto/go\n    opt:\n      - paths=source_relative\n      - default_api_level=API_OPAQUE\n      - Mgoogle/protobuf/cpp_features.proto=github.com/bufbuild/buf/private/gen/proto/go/google/protobuf\n      - Mgoogle/protobuf/java_features.proto=github.com/bufbuild/buf/private/gen/proto/go/google/protobuf\ninputs:\n  - directory: proto\n  - module: buf.build/grpc/grpc\n    types:\n      - grpc.reflection.v1.ServerReflection\n  - module: buf.build/protocolbuffers/wellknowntypes:v31.1\n    paths:\n     - google/protobuf/cpp_features.proto\n     - google/protobuf/java_features.proto\n"
  },
  {
    "path": "etc/windows/test.bash",
    "content": "#!/usr/bin/env bash\n\nset -eo pipefail\n\nPROTOC_VERSION=\"33.3\"\nPROTOC_GEN_GO_VERSION=\"v1.36.6\"\nCONNECT_VERSION=\"v1.18.1\"\n\n# Convert DOWNLOAD_CACHE from d:\\path to /d/path\nDOWNLOAD_CACHE=\"$(echo \"/${DOWNLOAD_CACHE}\" | sed 's|\\\\|/|g' | sed 's/://')\"\nmkdir -p \"${DOWNLOAD_CACHE}\"\nPATH=\"${DOWNLOAD_CACHE}/protoc/bin:${PATH}\"\n\nif [ -f \"${DOWNLOAD_CACHE}/protoc/bin/protoc.exe\" ]; then\n  CACHED_PROTOC_VERSION=\"$(\"${DOWNLOAD_CACHE}/protoc/bin/protoc.exe\" --version | cut -d \" \" -f 2)\"\nfi\n\nif [ \"${CACHED_PROTOC_VERSION}\" != \"$PROTOC_VERSION\" ]; then\n  PROTOC_RELEASE_VERSION=\"${PROTOC_VERSION/-rc/-rc-}\"\n  PROTOC_URL=\"https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_RELEASE_VERSION}-win64.zip\"\n  curl -sSL -o \"${DOWNLOAD_CACHE}/protoc.zip\" \"${PROTOC_URL}\"\n  7z x -y -o\"${DOWNLOAD_CACHE}/protoc\" \"${DOWNLOAD_CACHE}/protoc.zip\"\n  mkdir -p \"${DOWNLOAD_CACHE}/protoc/lib\"\n  cp -a \"${DOWNLOAD_CACHE}/protoc/include\" \"${DOWNLOAD_CACHE}/protoc/lib/include\"\nelse\n  echo \"Using cached protoc\"\nfi\n\nPATH=\"${DOWNLOAD_CACHE}/protoc/bin:${PATH}\"\n\ngo install google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION}\ngo install connectrpc.com/connect/cmd/protoc-gen-connect-go@${CONNECT_VERSION}\ngo install ./cmd/buf \\\n  ./cmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-writer \\\n  ./cmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver \\\n  ./cmd/buf/internal/command/generate/internal/protoc-gen-top-level-type-names-yaml \\\n  ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-panic \\\n  ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix \\\n  ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext \\\n  ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext \\\n  ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category \\\n  ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule\nGOOS=wasip1 GOARCH=wasm go build -o $(go env -json | jq -r .GOPATH)/bin/buf-plugin-suffix.wasm \\\n  ./private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix\ngo test ./...\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/bufbuild/buf\n\ngo 1.25.6\n\nrequire (\n\tbuf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.11-20250718181942-e35f9b667443.1\n\tbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260209202127-80ab13bee0bf.1\n\tbuf.build/gen/go/bufbuild/registry/connectrpc/go v1.19.1-20260126144947-819582968857.2\n\tbuf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.11-20260126144947-819582968857.1\n\tbuf.build/go/app v0.2.0\n\tbuf.build/go/bufplugin v0.9.0\n\tbuf.build/go/bufprivateusage v0.1.0\n\tbuf.build/go/protovalidate v1.1.3\n\tbuf.build/go/protoyaml v0.6.0\n\tbuf.build/go/spdx v0.2.0\n\tbuf.build/go/standard v0.1.0\n\tconnectrpc.com/connect v1.19.1\n\tconnectrpc.com/otelconnect v0.9.0\n\tgithub.com/bufbuild/protocompile v0.14.2-0.20260313233150-4b57e9e2a3ff\n\tgithub.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1\n\tgithub.com/cli/browser v1.3.0\n\tgithub.com/gofrs/flock v0.13.0\n\tgithub.com/google/cel-go v0.27.0\n\tgithub.com/google/go-cmp v0.7.0\n\tgithub.com/google/go-containerregistry v0.21.2\n\tgithub.com/google/uuid v1.6.0\n\tgithub.com/jdx/go-netrc v1.0.0\n\tgithub.com/jhump/protoreflect/v2 v2.0.0-beta.2\n\tgithub.com/klauspost/compress v1.18.4\n\tgithub.com/klauspost/pgzip v1.2.6\n\tgithub.com/mattn/go-colorable v0.1.14\n\tgithub.com/moby/moby/api v1.54.0\n\tgithub.com/moby/moby/client v0.3.0\n\tgithub.com/quic-go/quic-go v0.59.0\n\tgithub.com/rs/cors v1.11.1\n\tgithub.com/spf13/cobra v1.10.2\n\tgithub.com/spf13/pflag v1.0.10\n\tgithub.com/stretchr/testify v1.11.1\n\tgithub.com/tetratelabs/wazero v1.11.0\n\tgo.lsp.dev/jsonrpc2 v0.10.0\n\tgo.lsp.dev/protocol v0.12.0\n\tgo.lsp.dev/uri v0.3.0\n\tgo.uber.org/zap v1.27.1\n\tgolang.org/x/crypto v0.49.0\n\tgolang.org/x/mod v0.34.0\n\tgolang.org/x/sync v0.20.0\n\tgolang.org/x/term v0.41.0\n\tgolang.org/x/tools v0.43.0\n\tgoogle.golang.org/protobuf v1.36.11\n\tgopkg.in/yaml.v3 v3.0.1\n\tmvdan.cc/xurls/v2 v2.6.0\n\tpluginrpc.com/pluginrpc v0.5.0\n)\n\nrequire (\n\tbuf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.11-20241007202033-cf42259fcbfc.1 // indirect\n\tbuf.build/go/interrupt v1.1.0 // indirect\n\tcel.dev/expr v0.25.1 // indirect\n\tgithub.com/Microsoft/go-winio v0.6.2 // indirect\n\tgithub.com/antlr4-go/antlr/v4 v4.13.1 // indirect\n\tgithub.com/cespare/xxhash/v2 v2.3.0 // indirect\n\tgithub.com/containerd/errdefs v1.0.0 // indirect\n\tgithub.com/containerd/errdefs/pkg v0.3.0 // indirect\n\tgithub.com/containerd/stargz-snapshotter/estargz v0.18.2 // indirect\n\tgithub.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect\n\tgithub.com/davecgh/go-spew v1.1.1 // indirect\n\tgithub.com/distribution/reference v0.6.0 // indirect\n\tgithub.com/docker/cli v29.3.0+incompatible // indirect\n\tgithub.com/docker/distribution v2.8.3+incompatible // indirect\n\tgithub.com/docker/docker-credential-helpers v0.9.5 // indirect\n\tgithub.com/docker/go-connections v0.6.0 // indirect\n\tgithub.com/docker/go-units v0.5.0 // indirect\n\tgithub.com/felixge/httpsnoop v1.0.4 // indirect\n\tgithub.com/go-logr/logr v1.4.3 // indirect\n\tgithub.com/go-logr/stdr v1.2.2 // indirect\n\tgithub.com/inconshreveable/mousetrap v1.1.0 // indirect\n\tgithub.com/mattn/go-isatty v0.0.20 // indirect\n\tgithub.com/mitchellh/go-homedir v1.1.0 // indirect\n\tgithub.com/moby/docker-image-spec v1.3.1 // indirect\n\tgithub.com/opencontainers/go-digest v1.0.0 // indirect\n\tgithub.com/opencontainers/image-spec v1.1.1 // indirect\n\tgithub.com/petermattis/goid v0.0.0-20260226131333-17d1149c6ac6 // indirect\n\tgithub.com/pmezard/go-difflib v1.0.0 // indirect\n\tgithub.com/quic-go/qpack v0.6.0 // indirect\n\tgithub.com/rivo/uniseg v0.4.7 // indirect\n\tgithub.com/russross/blackfriday/v2 v2.1.0 // indirect\n\tgithub.com/segmentio/asm v1.2.1 // indirect\n\tgithub.com/segmentio/encoding v0.5.4 // indirect\n\tgithub.com/sirupsen/logrus v1.9.4 // indirect\n\tgithub.com/tidwall/btree v1.8.1 // indirect\n\tgithub.com/vbatts/tar-split v0.12.2 // indirect\n\tgo.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2 // indirect\n\tgo.opentelemetry.io/auto/sdk v1.2.1 // indirect\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect\n\tgo.opentelemetry.io/otel v1.42.0 // indirect\n\tgo.opentelemetry.io/otel/metric v1.42.0 // indirect\n\tgo.opentelemetry.io/otel/trace v1.42.0 // indirect\n\tgo.uber.org/multierr v1.11.0 // indirect\n\tgo.yaml.in/yaml/v3 v3.0.4 // indirect\n\tgolang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect\n\tgolang.org/x/net v0.52.0 // indirect\n\tgolang.org/x/sys v0.42.0 // indirect\n\tgolang.org/x/text v0.35.0 // indirect\n\tgoogle.golang.org/genproto/googleapis/api v0.0.0-20260311181403-84a4fc48630c // indirect\n\tgoogle.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c // indirect\n)\n"
  },
  {
    "path": "go.sum",
    "content": "buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.11-20250718181942-e35f9b667443.1 h1:zQ9C3e6FtwSZUFuKAQfpIKGFk5ZuRoGt5g35Bix55sI=\nbuf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go v1.36.11-20250718181942-e35f9b667443.1/go.mod h1:1Znr6gmYBhbxWUPRrrVnSLXQsz8bvFVw1HHJq2bI3VQ=\nbuf.build/gen/go/bufbuild/protodescriptor/protocolbuffers/go v1.36.11-20250109164928-1da0de137947.1 h1:HwzzCRS4ZrEm1++rzSDxHnO0DOjiT1b8I/24e8a4exY=\nbuf.build/gen/go/bufbuild/protodescriptor/protocolbuffers/go v1.36.11-20250109164928-1da0de137947.1/go.mod h1:8PRKXhgNes29Tjrnv8KdZzg3I1QceOkzibW1QK7EXv0=\nbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260209202127-80ab13bee0bf.1 h1:PMmTMyvHScV9Mn8wc6ASge9uRcHy0jtqPd+fM35LmsQ=\nbuf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.11-20260209202127-80ab13bee0bf.1/go.mod h1:tvtbpgaVXZX4g6Pn+AnzFycuRK3MOz5HJfEGeEllXYM=\nbuf.build/gen/go/bufbuild/registry/connectrpc/go v1.19.1-20260126144947-819582968857.2 h1:XPrWCd9ydEo5Ofv1aNJVJaxndMXLQjRO9vVzsJG3jL8=\nbuf.build/gen/go/bufbuild/registry/connectrpc/go v1.19.1-20260126144947-819582968857.2/go.mod h1:mpsjeEaxOYPIJV2cz4IagLghZufRvx+NPVtInjEeoQ8=\nbuf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.11-20260126144947-819582968857.1 h1:Yreby6Ypa58wdQUEm9Fnc5g8n/jP487Dq3aK5yBYwfk=\nbuf.build/gen/go/bufbuild/registry/protocolbuffers/go v1.36.11-20260126144947-819582968857.1/go.mod h1:1JJi9jvOqRxSMa+JxiZSm57doB+db/1WYCIa2lHfc40=\nbuf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.11-20241007202033-cf42259fcbfc.1 h1:iGPvEJltOXUMANWf0zajcRcbiOXLD90ZwPUFvbcuv6Q=\nbuf.build/gen/go/pluginrpc/pluginrpc/protocolbuffers/go v1.36.11-20241007202033-cf42259fcbfc.1/go.mod h1:nWVKKRA29zdt4uvkjka3i/y4mkrswyWwiu0TbdX0zts=\nbuf.build/go/app v0.2.0 h1:NYaH13A+RzPb7M5vO8uZYZ2maBZI5+MS9A9tQm66fy8=\nbuf.build/go/app v0.2.0/go.mod h1:0XVOYemubVbxNXVY0DnsVgWeGkcbbAvjDa1fmhBC+Wo=\nbuf.build/go/bufplugin v0.9.0 h1:ktZJNP3If7ldcWVqh46XKeiYJVPxHQxCfjzVQDzZ/lo=\nbuf.build/go/bufplugin v0.9.0/go.mod h1:Z0CxA3sKQ6EPz/Os4kJJneeRO6CjPeidtP1ABh5jPPY=\nbuf.build/go/bufprivateusage v0.1.0 h1:SzCoCcmzS3zyXHEXHeSQhGI7OTkgtljoknLzsUz9Gg4=\nbuf.build/go/bufprivateusage v0.1.0/go.mod h1:GlCCJ3VVF7EqqU0CoRmo1FzAwwaKymEWSr+ty69xU5w=\nbuf.build/go/interrupt v1.1.0 h1:olBuhgv9Sav4/9pkSLoxgiOsZDgM5VhRhvRpn3DL0lE=\nbuf.build/go/interrupt v1.1.0/go.mod h1:ql56nXPG1oHlvZa6efNC7SKAQ/tUjS6z0mhJl0gyeRM=\nbuf.build/go/protovalidate v1.1.3 h1:m2GVEgQWd7rk+vIoAZ+f0ygGjvQTuqPQapBBdcpWVPE=\nbuf.build/go/protovalidate v1.1.3/go.mod h1:9XIuohWz+kj+9JVn3WQneHA5LZP50mjvneZMnbLkiIE=\nbuf.build/go/protoyaml v0.6.0 h1:Nzz1lvcXF8YgNZXk+voPPwdU8FjDPTUV4ndNTXN0n2w=\nbuf.build/go/protoyaml v0.6.0/go.mod h1:RgUOsBu/GYKLDSIRgQXniXbNgFlGEZnQpRAUdLAFV2Q=\nbuf.build/go/spdx v0.2.0 h1:IItqM0/cMxvFJJumcBuP8NrsIzMs/UYjp/6WSpq8LTw=\nbuf.build/go/spdx v0.2.0/go.mod h1:bXdwQFem9Si3nsbNy8aJKGPoaPi5DKwdeEp5/ArZ6w8=\nbuf.build/go/standard v0.1.0 h1:g98T9IyvAl0vS3Pq8iVk6Cvj2ZiFvoUJRtfyGa0120U=\nbuf.build/go/standard v0.1.0/go.mod h1:PiqpHz/7ZFq+kqvYhc/SK3lxFIB9N/aiH2CFC2JHIQg=\ncel.dev/expr v0.25.1 h1:1KrZg61W6TWSxuNZ37Xy49ps13NUovb66QLprthtwi4=\ncel.dev/expr v0.25.1/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4=\nconnectrpc.com/connect v1.19.1 h1:R5M57z05+90EfEvCY1b7hBxDVOUl45PrtXtAV2fOC14=\nconnectrpc.com/connect v1.19.1/go.mod h1:tN20fjdGlewnSFeZxLKb0xwIZ6ozc3OQs2hTXy4du9w=\nconnectrpc.com/otelconnect v0.9.0 h1:NggB3pzRC3pukQWaYbRHJulxuXvmCKCKkQ9hbrHAWoA=\nconnectrpc.com/otelconnect v0.9.0/go.mod h1:AEkVLjCPXra+ObGFCOClcJkNjS7zPaQSqvO0lCyjfZc=\ngithub.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=\ngithub.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=\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/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs=\ngithub.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=\ngithub.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4=\ngithub.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs=\ngithub.com/bufbuild/protocompile v0.14.2-0.20260313233150-4b57e9e2a3ff h1:WlfOd1jG5BRozBAN/L6VphB3f2szZ25sZDn7mb+g+Cs=\ngithub.com/bufbuild/protocompile v0.14.2-0.20260313233150-4b57e9e2a3ff/go.mod h1:o4sxIWZ71DJt7/jan0/vi3XbGCQMTBk5KCo27vgT45Q=\ngithub.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1 h1:V1xulAoqLqVg44rY97xOR+mQpD2N+GzhMHVwJ030WEU=\ngithub.com/bufbuild/protoplugin v0.0.0-20250218205857-750e09ce93e1/go.mod h1:c5D8gWRIZ2HLWO3gXYTtUfw/hbJyD8xikv2ooPxnklQ=\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/cli/browser v1.3.0 h1:LejqCrpWr+1pRqmEPDGnTZOjsMe7sehifLynZJuqJpo=\ngithub.com/cli/browser v1.3.0/go.mod h1:HH8s+fOAxjhQoBUAsKuPCbqUuxZDhQ2/aD+SzsEfBTk=\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/stargz-snapshotter/estargz v0.18.2 h1:yXkZFYIzz3eoLwlTUZKz2iQ4MrckBxJjkmD16ynUTrw=\ngithub.com/containerd/stargz-snapshotter/estargz v0.18.2/go.mod h1:XyVU5tcJ3PRpkA9XS2T5us6Eg35yM0214Y+wvrZTBrY=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=\ngithub.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=\ngithub.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\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/docker/cli v29.3.0+incompatible h1:z3iWveU7h19Pqx7alZES8j+IeFQZ1lhTwb2F+V9SVvk=\ngithub.com/docker/cli v29.3.0+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-credential-helpers v0.9.5 h1:EFNN8DHvaiK8zVqFA2DT6BjXE0GzfLOZ38ggPTKePkY=\ngithub.com/docker/docker-credential-helpers v0.9.5/go.mod h1:v1S+hepowrQXITkEfw6o4+BMbGot02wiKpzWhGUZK6c=\ngithub.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94=\ngithub.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE=\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/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=\ngithub.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=\ngithub.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=\ngithub.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=\ngithub.com/go-logr/logr v1.4.3/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/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw=\ngithub.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0=\ngithub.com/google/cel-go v0.27.0 h1:e7ih85+4qVrBuqQWTW4FKSqZYokVuc3HnhH5keboFTo=\ngithub.com/google/cel-go v0.27.0/go.mod h1:tTJ11FWqnhw5KKpnWpvW9CJC3Y9GK4EIS0WXnBbebzw=\ngithub.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=\ngithub.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=\ngithub.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=\ngithub.com/google/go-containerregistry v0.21.2 h1:vYaMU4nU55JJGFC9JR/s8NZcTjbE9DBBbvusTW9NeS0=\ngithub.com/google/go-containerregistry v0.21.2/go.mod h1:ctO5aCaewH4AK1AumSF5DPW+0+R+d2FmylMJdp5G7p0=\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/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=\ngithub.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=\ngithub.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ=\ngithub.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8=\ngithub.com/jhump/protoreflect/v2 v2.0.0-beta.2 h1:qZU+rEZUOYTz1Bnhi3xbwn+VxdXkLVeEpAeZzVXLY88=\ngithub.com/jhump/protoreflect/v2 v2.0.0-beta.2/go.mod h1:4tnOYkB/mq7QTyS3YKtVtNrJv4Psqout8HA1U+hZtgM=\ngithub.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c=\ngithub.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=\ngithub.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU=\ngithub.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=\ngithub.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=\ngithub.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=\ngithub.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=\ngithub.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=\ngithub.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=\ngithub.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=\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/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=\ngithub.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=\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/moby/api v1.54.0 h1:7kbUgyiKcoBhm0UrWbdrMs7RX8dnwzURKVbZGy2GnL0=\ngithub.com/moby/moby/api v1.54.0/go.mod h1:8mb+ReTlisw4pS6BRzCMts5M49W5M7bKt1cJy/YbAqc=\ngithub.com/moby/moby/client v0.3.0 h1:UUGL5okry+Aomj3WhGt9Aigl3ZOxZGqR7XPo+RLPlKs=\ngithub.com/moby/moby/client v0.3.0/go.mod h1:HJgFbJRvogDQjbM8fqc1MCEm4mIAGMLjXbgwoZp6jCQ=\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.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=\ngithub.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M=\ngithub.com/petermattis/goid v0.0.0-20260226131333-17d1149c6ac6 h1:rh2lKw/P/EqHa724vYH2+VVQ1YnW4u6EOXl0PMAovZE=\ngithub.com/petermattis/goid v0.0.0-20260226131333-17d1149c6ac6/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=\ngithub.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/protocolbuffers/protoscope v0.0.0-20221109213918-8e7a6aafa2c9 h1:arwj11zP0yJIxIRiDn22E0H8PxfF7TsTrc2wIPFIsf4=\ngithub.com/protocolbuffers/protoscope v0.0.0-20221109213918-8e7a6aafa2c9/go.mod h1:SKZx6stCn03JN3BOWTwvVIO2ajMkb/zQdTceXYhKw/4=\ngithub.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=\ngithub.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=\ngithub.com/quic-go/quic-go v0.59.0 h1:OLJkp1Mlm/aS7dpKgTc6cnpynnD2Xg7C1pwL6vy/SAw=\ngithub.com/quic-go/quic-go v0.59.0/go.mod h1:upnsH4Ju1YkqpLXC305eW3yDZ4NfnNbmQRCMWS58IKU=\ngithub.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=\ngithub.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=\ngithub.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8=\ngithub.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0=\ngithub.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=\ngithub.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=\ngithub.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA=\ngithub.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=\ngithub.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=\ngithub.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=\ngithub.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=\ngithub.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=\ngithub.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfvNt0=\ngithub.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0=\ngithub.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w=\ngithub.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g=\ngithub.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=\ngithub.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=\ngithub.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=\ngithub.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=\ngithub.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=\ngithub.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=\ngithub.com/tetratelabs/wazero v1.11.0 h1:+gKemEuKCTevU4d7ZTzlsvgd1uaToIDtlQlmNbwqYhA=\ngithub.com/tetratelabs/wazero v1.11.0/go.mod h1:eV28rsN8Q+xwjogd7f4/Pp4xFxO7uOGbLcD/LzB1wiU=\ngithub.com/tidwall/btree v1.8.1 h1:27ehoXvm5AG/g+1VxLS1SD3vRhp/H7LuEfwNvddEdmA=\ngithub.com/tidwall/btree v1.8.1/go.mod h1:jBbTdUWhSZClZWoDg54VnvV7/54modSOzDN7VXftj1A=\ngithub.com/vbatts/tar-split v0.12.2 h1:w/Y6tjxpeiFMR47yzZPlPj/FcPLpXbTUi/9H7d3CPa4=\ngithub.com/vbatts/tar-split v0.12.2/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA=\ngo.lsp.dev/jsonrpc2 v0.10.0 h1:Pr/YcXJoEOTMc/b6OTmcR1DPJ3mSWl/SWiU1Cct6VmI=\ngo.lsp.dev/jsonrpc2 v0.10.0/go.mod h1:fmEzIdXPi/rf6d4uFcayi8HpFP1nBF99ERP1htC72Ac=\ngo.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2 h1:hCzQgh6UcwbKgNSRurYWSqh8MufqRRPODRBblutn4TE=\ngo.lsp.dev/pkg v0.0.0-20210717090340-384b27a52fb2/go.mod h1:gtSHRuYfbCT0qnbLnovpie/WEmqyJ7T4n6VXiFMBtcw=\ngo.lsp.dev/protocol v0.12.0 h1:tNprUI9klQW5FAFVM4Sa+AbPFuVQByWhP1ttNUAjIWg=\ngo.lsp.dev/protocol v0.12.0/go.mod h1:Qb11/HgZQ72qQbeyPfJbu3hZBH23s1sr4st8czGeDMQ=\ngo.lsp.dev/uri v0.3.0 h1:KcZJmh6nFIBeJzTugn5JTU6OOyG0lDOo3R9KwTxTYbo=\ngo.lsp.dev/uri v0.3.0/go.mod h1:P5sbO1IQR+qySTWOCnhnK7phBx+W3zbLqSMDJNTw88I=\ngo.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=\ngo.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 h1:OyrsyzuttWTSur2qN/Lm0m2a8yqyIjUVBZcxFPuXq2o=\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0/go.mod h1:C2NGBr+kAB4bk3xtMXfZ94gqFDtg/GkI7e9zqGh5Beg=\ngo.opentelemetry.io/otel v1.42.0 h1:lSQGzTgVR3+sgJDAU/7/ZMjN9Z+vUip7leaqBKy4sho=\ngo.opentelemetry.io/otel v1.42.0/go.mod h1:lJNsdRMxCUIWuMlVJWzecSMuNjE7dOYyWlqOXWkdqCc=\ngo.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4=\ngo.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI=\ngo.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo=\ngo.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts=\ngo.opentelemetry.io/otel/sdk/metric v1.42.0 h1:D/1QR46Clz6ajyZ3G8SgNlTJKBdGp84q9RKCAZ3YGuA=\ngo.opentelemetry.io/otel/sdk/metric v1.42.0/go.mod h1:Ua6AAlDKdZ7tdvaQKfSmnFTdHx37+J4ba8MwVCYM5hc=\ngo.opentelemetry.io/otel/trace v1.42.0 h1:OUCgIPt+mzOnaUTpOQcBiM/PLQ/Op7oq6g4LenLmOYY=\ngo.opentelemetry.io/otel/trace v1.42.0/go.mod h1:f3K9S+IFqnumBkKhRJMeaZeNk9epyhnCmQh/EysQCdc=\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/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=\ngo.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=\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.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=\ngo.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=\ngo.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=\ngo.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=\ngolang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=\ngolang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=\ngolang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA=\ngolang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ=\ngolang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI=\ngolang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY=\ngolang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=\ngolang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=\ngolang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=\ngolang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=\ngolang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=\ngolang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=\ngolang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=\ngolang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=\ngolang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=\ngolang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=\ngolang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=\ngolang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s=\ngolang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0=\ngolang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20260311181403-84a4fc48630c h1:OyQPd6I3pN/9gDxz6L13kYGJgqkpdrAohJRBeXyxlgI=\ngoogle.golang.org/genproto/googleapis/api v0.0.0-20260311181403-84a4fc48630c/go.mod h1:X2gu9Qwng7Nn009s/r3RUxqkzQNqOrAy79bluY7ojIg=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c h1:xgCzyF2LFIO/0X2UAoVRiXKU5Xg6VjToG4i2/ecSswk=\ngoogle.golang.org/genproto/googleapis/rpc v0.0.0-20260311181403-84a4fc48630c/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8=\ngoogle.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg=\ngoogle.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec=\ngoogle.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=\ngoogle.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=\ngopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\ngotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q=\ngotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA=\nmvdan.cc/xurls/v2 v2.6.0 h1:3NTZpeTxYVWNSokW3MKeyVkz/j7uYXYiMtXRUfmjbgI=\nmvdan.cc/xurls/v2 v2.6.0/go.mod h1:bCvEZ1XvdA6wDnxY7jPPjEmigDtvtvPXAD/Exa9IMSk=\npgregory.net/rapid v1.2.0 h1:keKAYRcjm+e1F0oAuU5F5+YPAWcyxNNRK2wud503Gnk=\npgregory.net/rapid v1.2.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=\npluginrpc.com/pluginrpc v0.5.0 h1:tOQj2D35hOmvHyPu8e7ohW2/QvAnEtKscy2IJYWQ2yo=\npluginrpc.com/pluginrpc v0.5.0/go.mod h1:UNWZ941hcVAoOZUn8YZsMmOZBzbUjQa3XMns8RQLp9o=\n"
  },
  {
    "path": "make/buf/all.mk",
    "content": "GO_ALL_REPO_PKGS := ./cmd/... ./private/...\nGO_GET_PKGS := $(GO_GET_PKGS) \\\n\tgithub.com/bufbuild/protocompile@main\nGO_BINS := $(GO_BINS) \\\n\tcmd/buf \\\n\tcmd/protoc-gen-buf-breaking \\\n\tcmd/protoc-gen-buf-lint \\\n\tprivate/buf/bufwkt/cmd/wkt-go-data \\\n\tprivate/bufpkg/bufmodule/bufmoduleapi/cmd/buf-legacyfederation-go-data \\\n\tprivate/bufpkg/bufmodule/bufmoduletesting/cmd/buf-digest \\\n\tprivate/bufpkg/bufmodule/bufmoduletesting/cmd/buf-new-commit-id \\\n\tprivate/pkg/bandeps/cmd/bandeps \\\n\tprivate/pkg/git/cmd/git-ls-files-unstaged \\\n\tprivate/pkg/storage/cmd/ddiff \\\n\tprivate/pkg/storage/cmd/storage-go-data \\\n\tprivate/pkg/licenseheader/cmd/license-header\nGO_TEST_BINS := $(GO_TEST_BINS) \\\n\tcmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-receiver \\\n\tcmd/buf/internal/command/alpha/protoc/internal/protoc-gen-insertion-point-writer \\\n\tcmd/buf/internal/command/generate/internal/protoc-gen-top-level-type-names-yaml \\\n\tprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-panic \\\n\tprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix \\\n\tprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext \\\n\tprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext \\\n\tprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category \\\n\tprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule\nGO_TEST_WASM_BINS := $(GO_TEST_WASM_BINS) \\\n\tprivate/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix\nGO_MOD_VERSION := 1.25\nDOCKER_BINS := $(DOCKER_BINS) buf\nFILE_IGNORES := $(FILE_IGNORES) \\\n\t.build/ \\\n\t.ctrlp \\\n\t.idea/ \\\n\t.vscode/ \\\n\tcmd/buf/internal/command/alpha/protoc/test.txt \\\n\tcmd/buf/testdata/imports/cache/v3/modulelocks/ \\\n\tcmd/buf/testdata/imports/corrupted_cache_dep/v3/modulelocks/ \\\n\tcmd/buf/testdata/imports/corrupted_cache_file/v3/modulelocks/ \\\n\tprivate/bufpkg/buftesting/cache/ \\\n\tprivate/buf/buftesting/cache/ \\\n\tprivate/pkg/storage/storageos/tmp/\nLICENSE_HEADER_LICENSE_TYPE := apache\nLICENSE_HEADER_COPYRIGHT_HOLDER := Buf Technologies, Inc.\nLICENSE_HEADER_YEAR_RANGE := 2020-2026\nLICENSE_HEADER_IGNORES := \\/testdata enterprise\nBANDEPS_CONFIG := etc/bandeps/bandeps.yaml\nBUFPRIVATEUSAGE_PKGS := ./private/...\nPROTOVALIDATE_VERSION := v1.1.0\n# Comment out to use released buf\n#BUF_GO_INSTALL_PATH := ./cmd/buf\n\nBUF_LINT_INPUT := .\nBUF_BREAKING_INPUT := .\nBUF_BREAKING_AGAINST_INPUT ?= .git\\#branch=main\nBUF_FORMAT_INPUT := .\n\nDISALLOW_NOLINT := true\n\nLEGACY_FEDERATION_FILE_PATH ?=\n\ninclude make/go/bootstrap.mk\ninclude make/go/dep_buf.mk\ninclude make/go/dep_minisign.mk\ninclude make/go/dep_protoc.mk\ninclude make/go/dep_protoc_gen_go.mk\ninclude make/go/dep_protoc_gen_connect_go.mk\ninclude make/go/go.mk\ninclude make/go/docker.mk\ninclude make/go/license_header.mk\ninclude make/go/buf.mk\n\ninstalltest:: $(PROTOC) $(PROTOC_GEN_GO)\n\n.PHONY: godata\ngodata: installwkt-go-data installbuf-legacyfederation-go-data $(PROTOC)\n\trm -rf private/gen/data/datawkt\n\tmkdir -p private/gen/data/datawkt\n\twkt-go-data \"$(CACHE_INCLUDE)\" --package datawkt --protobuf-version \"$(PROTOC_VERSION)\" > private/gen/data/datawkt/datawkt.gen.go\nifdef LEGACY_FEDERATION_FILE_PATH\n\trm -rf private/gen/data/datalegacyfederation\n\tmkdir -p private/gen/data/datalegacyfederation\n\tcat \"$(LEGACY_FEDERATION_FILE_PATH)\" | buf-legacyfederation-go-data --package datalegacyfederation > private/gen/data/datalegacyfederation/datalegacyfederation.gen.go\nendif\n\nprepostgenerate:: godata\n\n.PHONY: bufworkspacebuflocks\nbufworkspacebuflocks: installbuf-digest installbuf-new-commit-id\n\tbash private/buf/bufworkspace/testdata/basic/scripts/fakebuflock.bash\n\nprepostgenerate:: bufworkspacebuflocks\n\nbufgeneratedeps:: $(PROTOC_GEN_GO) $(PROTOC_GEN_CONNECT_GO)\n\n.PHONY: bufgeneratecleango\nbufgeneratecleango:\n\trm -rf private/gen/proto\n\n.PHONY: bufgeneratecleantestdata\nbufgeneratecleantestdata:\n\trm -rf cmd/buf/testdata/check_plugins/current/vendor/protovalidate\n\trm -rf cmd/buf/testdata/check_plugins/previous/vendor/protovalidate\n\trm -rf private/buf/buflsp/testdata/vendor/protovalidate\n\trm -rf private/bufpkg/bufcheck/testdata/lint/protovalidate/vendor/protovalidate\n\trm -rf private/bufpkg/bufcheck/testdata/lint/protovalidate_predefines/vendor/protovalidate\n\nbufgenerateclean:: \\\n\tbufgeneratecleango \\\n\tbufgeneratecleantestdata\n\n.PHONY: bufgeneratego\nbufgeneratego:\n\t$(BUF_BIN) generate --template etc/template/buf.go.gen.yaml\n\t$(BUF_BIN) generate --template etc/template/buf.go-client.gen.yaml\n\n.PHONY: bufgeneratetestdata\nbufgeneratetestdata:\n\t$(BUF_BIN) export \\\n\t\tbuf.build/bufbuild/protovalidate:$(PROTOVALIDATE_VERSION) \\\n\t\t--output cmd/buf/testdata/check_plugins/current/vendor/protovalidate\n\t$(BUF_BIN) export \\\n\t\tbuf.build/bufbuild/protovalidate:$(PROTOVALIDATE_VERSION) \\\n\t\t--output cmd/buf/testdata/check_plugins/previous/vendor/protovalidate\n\t$(BUF_BIN) export \\\n\t\tbuf.build/bufbuild/protovalidate:$(PROTOVALIDATE_VERSION) \\\n\t\t--output private/buf/buflsp/testdata/vendor/protovalidate\n\t$(BUF_BIN) export \\\n\t\tbuf.build/bufbuild/protovalidate:$(PROTOVALIDATE_VERSION) \\\n\t\t--output private/bufpkg/bufcheck/testdata/lint/protovalidate/vendor/protovalidate\n\t$(BUF_BIN) export \\\n\t\tbuf.build/bufbuild/protovalidate:$(PROTOVALIDATE_VERSION) \\\n\t\t--output private/bufpkg/bufcheck/testdata/lint/protovalidate_predefined/vendor/protovalidate\n\nbufgeneratesteps:: \\\n\tbufgeneratego \\\n\tbufgeneratetestdata\n\n.PHONY: bufrelease\nbufrelease: $(MINISIGN)\n\tbash make/buf/scripts/release.bash\n\n.PHONY: bufbinarysize\nbufbinarysize:\n\t@bash make/buf/scripts/binarysize.bash ./cmd/buf\n\n.PHONY: updateversion\nupdateversion:\nifndef VERSION\n\t$(error \"VERSION must be set\")\nendif\n\t$(SED_I) \"s/Version.*=.*\\\"[0-9]\\.[0-9][0-9]*\\.[0-9][0-9]*.*\\\"/Version = \\\"$(VERSION)\\\"/g\" private/buf/bufcli/bufcli.go\n\tgofmt -s -w private/buf/bufcli/bufcli.go\n\n.PHONY: releasechangelog\nreleasechangelog:\nifndef VERSION\n\t$(error \"VERSION must be set\")\nendif\n\t$(SED_I) 's/## \\[Unreleased\\]/## \\[v$(VERSION)\\] - $(shell date '+%Y-%m-%d')/' CHANGELOG.md\n\t$(SED_I) -E '/^\\[Unreleased\\]: .*HEAD$$/s/(Unreleased|HEAD)/v$(VERSION)/g' CHANGELOG.md\n\n.PHONY: updategoversion\nupdategoversion: installgit-ls-files-unstaged\nifndef GOVERSION\n\t$(error \"GOVERSION must be set\")\nendif\n\t# make sure both of these docker images exist\n\t# the release of these images will lag the actual release\n\tdocker pull golang:$(GOVERSION)-bookworm\n\tdocker pull golang:$(GOVERSION)-alpine3.23\n\t$(SED_I) \"s/golang:1\\.[0-9][0-9]*/golang:$(GOVERSION)/g\" $(shell git-ls-files-unstaged | grep Dockerfile)\n\t$(SED_I) \"s/golang:1\\.[0-9][0-9]*/golang:$(GOVERSION)/g\" $(shell git-ls-files-unstaged | grep \\.mk$)\n\t$(SED_I) \"s/go-version: '1\\.[0-9][0-9].x'/go-version: '$(GOVERSION).x'/g\" $(shell git-ls-files-unstaged | grep \\.github\\/workflows | grep -v previous.yaml)\n\t$(MAKE) checkandupdateprecommithooks\n\n.PHONY: bufimageutilupdateexpectations\nbufimageutilupdateexpectations:\n\t# You may need to run this after updating protoc versions\n\tBUFBUILD_BUF_BUFIMAGEUTIL_SHOULD_UPDATE_EXPECTATIONS=1 go test -parallel 1 ./private/bufpkg/bufimage/bufimageutil\n\n.PHONY: checkandupdateprecommithooks\ncheckandupdateprecommithooks:\n\t@bash make/buf/scripts/checkandupdateprecommithooks.bash\n\npostupgrade:: checkandupdateprecommithooks\n\n.PHONY: updatebufversion\nupdatebufversion:\n\t$(SED_I) -E \"s/BUF_VERSION \\?=.*/BUF_VERSION ?= v${RELEASE_BUF_VERSION}/\" \"make/go/dep_buf.mk\"\n\t$(SED_I) -E \"s/\\# https\\:\\/\\/github.com\\/bufbuild\\/buf\\/releases.*/\\# https\\:\\/\\/github.com\\/bufbuild\\/buf\\/releases $(shell date \"+%Y%m%d\") checked $(shell date \"+%Y%m%d\")/\" \"make/go/dep_buf.mk\"\n"
  },
  {
    "path": "make/buf/docker/Dockerfile.release",
    "content": "FROM golang:1.26-bookworm\nRUN  apt-get -y update \\\n     && apt-get -y autoremove \\\n     && apt-get clean \\\n     && apt-get install -y zip\n"
  },
  {
    "path": "make/buf/scripts/binarysize.bash",
    "content": "#!/usr/bin/env bash\n\nset -eo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\nTMP=\"$(mktemp -d )\"\ntrap 'rm -rf \"${TMP}\"' EXIT\n\nfail() {\n  echo \"error: $@\" >&2\n  exit 1\n}\n\nsize_bytes() {\n  case \"$(uname -s)\" in\n    Darwin) stat -f%z \"${1}\" ;;\n    Linux) stat -c%s \"${1}\" ;;\n    *) fail \"must be run on darwin or linux\" ;;\n  esac\n}\n\n# Build in the same manner as we do in release.bash.\nCGO_ENABLED=0 \\\n  GOOS=darwin \\\n  GOARCH=arm64 \\\n  go build -a -ldflags \"-s -w\" -trimpath -buildvcs=false \\\n  -o \"${TMP}/bin\" \\\n  \"${1}\"\n\necho \"$(awk \"BEGIN { printf(\\\"%.2f\\\", $(size_bytes \"${TMP}/bin\") / 1048576.0) }\") MB\"\n"
  },
  {
    "path": "make/buf/scripts/brew.sh",
    "content": "#!/bin/sh\n\nset -e\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\nif [ -z \"${1}\" ]; then\n  echo \"usage: ${0} out_dir\" >&2\n  exit 1\nfi\n\nOUT_DIR=\"${1}\"\nrm -rf \"${OUT_DIR}\"\nmkdir -p \"${OUT_DIR}/bin\"\nmkdir -p \"${OUT_DIR}/etc/bash_completion.d\"\nmkdir -p \"${OUT_DIR}/share/fish/vendor_completions.d\"\nmkdir -p \"${OUT_DIR}/share/zsh/site-functions\"\nmkdir -p \"${OUT_DIR}/share/man/man1\"\n\nfor binary in buf protoc-gen-buf-breaking protoc-gen-buf-lint; do\n  echo CGO_ENABLED=0 go build -ldflags \\\"-s -w\\\" -trimpath -o \\\"${OUT_DIR}/bin/${binary}\\\" \\\"./cmd/${binary}\\\"\n  CGO_ENABLED=0 go build -ldflags \"-s -w\" -trimpath -buildvcs=false -o \"${OUT_DIR}/bin/${binary}\" \"./cmd/${binary}\"\ndone\necho \\\"${OUT_DIR}/bin/buf\\\" completion bash \\> \\\"${OUT_DIR}/etc/bash_completion.d/buf\\\"\n\"${OUT_DIR}/bin/buf\" completion bash > \"${OUT_DIR}/etc/bash_completion.d/buf\"\necho \\\"${OUT_DIR}/bin/buf\\\" completion fish \\> \\\"${OUT_DIR}/share/fish/vendor_completions.d/buf.fish\\\"\n\"${OUT_DIR}/bin/buf\" completion fish > \"${OUT_DIR}/share/fish/vendor_completions.d/buf.fish\"\necho \\\"${OUT_DIR}/bin/buf\\\" completion zsh \\> \\\"${OUT_DIR}/share/zsh/site-functions/_buf\\\"\n\"${OUT_DIR}/bin/buf\" completion zsh > \"${OUT_DIR}/share/zsh/site-functions/_buf\"\necho \\\"${OUT_DIR}/bin/buf\\\" manpages \\\"${OUT_DIR}/share/man/man1\\\"\n\"${OUT_DIR}/bin/buf\" manpages \"${OUT_DIR}/share/man/man1\"\necho cp \\\"LICENSE\\\" \\\"${OUT_DIR}/LICENSE\\\"\ncp \"LICENSE\" \"${OUT_DIR}/LICENSE\"\n"
  },
  {
    "path": "make/buf/scripts/checkandupdateprecommithooks.bash",
    "content": "#!/usr/bin/env bash\n\nset -eo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\nGO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')\n# If the version in go.mod does not include the patch version, e.g. go 1.24, for the\n# .pre-commit-hook.yaml configuration, we'll need to add a 0.\nif [[ ! \"${GO_VERSION}\" =~ ^([0-9]+\\.){2}([0-9]+)$ ]]; then\n  GO_VERSION=\"${GO_VERSION}.0\"\nfi\n\nfunction lesser_version() {\n  echo -e \"$1\\n$2\" | sort -V | head -n 1\n}\n\nfunction update_pre_commit_hooks() {\n  yq .[].language_version=\\\"${GO_VERSION}\\\" .pre-commit-hooks.yaml > .pre-commit-hooks.yaml.tmp\n  mv .pre-commit-hooks.yaml.tmp .pre-commit-hooks.yaml\n}\n\nfor version in $(yq \".[].language_version\" .pre-commit-hooks.yaml)\ndo\n  LESSER_VERSION=$(lesser_version \"${GO_VERSION}\" \"${version}\")\n  if [ ${version} == \"${LESSER_VERSION}\" ]; then\n    echo \"found lower pre-commit hook version ${version} compared to go.mod version ${GO_VERSION}\"\n    update_pre_commit_hooks\n    break\n  fi\ndone\n"
  },
  {
    "path": "make/buf/scripts/createreleasepr.bash",
    "content": "#!/usr/bin/env bash\n\nset -euo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\n# We already have set -u, but want to fail early if a required variable is not set.\n: ${WEBHOOK_URL}\n# However, if you are already logged in for GitHub CLI locally, you can remove this line when running it locally.\n: ${GH_TOKEN}\n\nif [[ \"${VERSION}\" == v* ]]; then\n  echo \"error: VERSION ${VERSION} must not start with 'v'\" >&2\n  exit 1\nfi\n\nmake updateversion\nmake releasechangelog\n\nBRANCH=\"release/v${VERSION}\"\ngit switch -C ${BRANCH}\ngit add .\ngit commit -m \"Update version to ${VERSION}\"\ngit push --set-upstream origin --force ${BRANCH}\nurl=$(gh pr create --title \"Release v${VERSION}\" --body \"Release prepared for ${VERSION}\nReminder: Verify the changelog\")\n\njq --null-input \"{text: \\\"BufCLI Release v${VERSION} has started: ${url}\\\" }\" | curl -sSL -X POST -H \"Content-Type: application/json\" -d@- \"${WEBHOOK_URL}\"\n"
  },
  {
    "path": "make/buf/scripts/draftrelease.bash",
    "content": "#!/usr/bin/env bash\n\nset -euo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\n# We already have set -u, but want to fail early if a required variable is not set.\n: ${RELEASE_MINISIGN_PRIVATE_KEY}\n: ${RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}\n# However, if you are already logged in for GitHub CLI locally, you can remove this line when running it locally.\n: ${GH_TOKEN}\n: ${WEBHOOK_URL}\n\nif [[ \"${VERSION}\" == v* ]]; then\n  echo \"error: VERSION ${VERSION} must not start with 'v'\" >&2\n  exit 1\nfi\n\n\nmake bufrelease\nunset RELEASE_MINISIGN_PRIVATE_KEY\nunset RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD\n\nif [[ \"${OSTYPE}\" == \"linux-gnu\"* ]]; then\n  SED_BIN=sed\nelif [[ \"${OSTYPE}\" == \"darwin\"* ]]; then\n  SED_BIN=gsed\nelse\n  echo \"unsupported OSTYPE: ${OSTYPE}\"\n  exit 1\nfi\n\n# This starts a loop after seeing the first line starting with ## [. For each line in the loop, it is skipped (n)\n# if it's empty (^$). The loop ends (q) if it sees another line starting with '## ['. Otherwise it gets printed.\nrelease_notes=$(${SED_BIN} -n '/## \\[/{\n:loop n;\n/^$/n;\n/## \\[/q;\np;\nb loop\n}' CHANGELOG.md)\n\n# The second v${VERSION} is the tag, see https://cli.github.com/manual/gh_release_create\nurl=$(gh release create --draft --notes \"${release_notes}\" --title \"v${VERSION}\" \"v${VERSION}\" .build/release/buf/assets/*)\n\njq --null-input \"{text:\\\"BufCLI Release ${VERSION} has been drafted: ${url}\\\"}\" | curl -sSL -X POST -H 'Content-Type: application/json' -d@- \"${WEBHOOK_URL}\"\n"
  },
  {
    "path": "make/buf/scripts/gobacktodevelopment.bash",
    "content": "#!/usr/bin/env bash\n\nset -euo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\n# We already have set -u, but want to fail early if a required variable is not set.\n: ${WEBHOOK_URL}\n# However, if you are already logged in for GitHub CLI locally, you can remove this line when running it locally.\n: ${GH_TOKEN}\n\nRELEASED_VERSION_LINE=$(grep -oE 'Version.*=.*\\\"[0-9]\\.[0-9]+\\.[0-9]+[^\\\"]*' private/buf/bufcli/bufcli.go)\nRELEASED_VERSION=${RELEASED_VERSION_LINE##Version*=*\\\"}\n\nNEXT_VERSION=$(awk -F. -v OFS=. '{$NF += 1 ; print}' <<< ${RELEASED_VERSION})\nNEXT_VERSION=\"${NEXT_VERSION}-dev\"\n\nmake updateversion VERSION=${NEXT_VERSION}\n\nif [[ \"${OSTYPE}\" == \"linux-gnu\"* ]]; then\n  SED_BIN=sed\nelif [[ \"${OSTYPE}\" == \"darwin\"* ]]; then\n  SED_BIN=gsed\nelse\n  echo \"unsupported OSTYPE: ${OSTYPE}\"\n  exit 1\nfi\n\n${SED_BIN} -i \"/^# Changelog/ {\nN;\na\\\n## [Unreleased]\\\\\n\\\\\n- No changes yet.\\\\\n\n}\" CHANGELOG.md\n\n${SED_BIN} -i \"/^Initial beta release.$/ {\nN;\na\\\n[Unreleased]: https://github.com/bufbuild/buf/compare/v${RELEASED_VERSION}...HEAD\n}\" CHANGELOG.md\n\nBRANCH=\"next/v${RELEASED_VERSION}\"\ngit switch -C ${BRANCH}\ngit add .\ngit commit -m \"Back to development\"\ngit push --set-upstream origin --force ${BRANCH} \nurl=$(gh pr create --title \"Return to development\" --body \"Release complete for v${RELEASED_VERSION}\")\n\njq --null-input \"{ text: \\\"PR back to development: ${url}\\\" }\" | curl -sSL -X POST -H 'Content-Type: application/json' -d@- \"${WEBHOOK_URL}\"\n"
  },
  {
    "path": "make/buf/scripts/newtodos.bash",
    "content": "#!/usr/bin/env bash\n\nset -eo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\nif [ -z \"${BASE_BRANCH}\" ]; then\n  BASE_BRANCH=\"main\"\nfi\n\nTODOS=\"$(git diff \"${BASE_BRANCH}\" | awk '\n  /^diff / {f=\"?\"; next}\n  f==\"?\" {if (/^\\+\\+\\+ /) f=substr($0, 7)\"\\n\"; next}\n  /^@@/ {n=$3; sub(/,.*/,\"\",n); n=0+$3; next}\n  /^\\+.*TODO/ {print f n \":\" substr($0,2); f=\"\"}\n  substr($0,1,1)~/[ +]/ {n++}')\"\n\nFILENAME=\"\"\nwhile read -r line; do\n  if [[ \"${line}\" =~ [a-z,A-Z,0-9]+\\.[a-z]{2,3}$ ]]; then\n    FILENAME=\"${line}\"\n  elif [[ \"${line}\" == *\"make/buf/scripts/newtodos.bash\"* ]]; then\n    FILENAME=\"no print\"\n  else\n    if [[ \"${FILENAME}\" != \"no print\" ]]; then \n      LINENUMBER=\"${line%%:*}\"\n      TODO=\"${line#*:}\"\n      echo \"${FILENAME}\":\"${LINENUMBER}\":\"${TODO#\"${TODO%%[![:space:]]*}\"}\"\n    fi\n  fi\ndone <<< \"${TODOS}\"\n"
  },
  {
    "path": "make/buf/scripts/release.bash",
    "content": "#!/usr/bin/env bash\n\nset -eo pipefail\nset -x\n\nRELEASE_DOCKER_FILE=\"make/buf/docker/Dockerfile.release\"\nRELEASE_DOCKER_IMAGE=\"bufrelease-tag\"\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\nfail() {\n  echo \"error: $@\" >&2\n  exit 1\n}\n\ngoos() {\n  case \"${1}\" in\n    Darwin) echo darwin ;;\n    Linux) echo linux ;;\n    Windows) echo windows ;;\n    *) echo \"unsupported\"; return 1 ;;\n  esac\n}\n\ngoarch() {\n  case \"${1}\" in\n    x86_64) echo amd64 ;;\n    riscv64) echo riscv64 ;;\n    arm64) echo arm64 ;;\n    aarch64) echo arm64 ;;\n    armv7) echo arm ;;\n    ppc64le) echo ppc64le ;;\n    s390x) echo s390x ;;\n    *) echo \"unsupported\"; return 1 ;;\n  esac\n}\n\nsha256() {\n  if ! type sha256sum >/dev/null 2>/dev/null; then\n    if ! type shasum >/dev/null 2>/dev/null; then\n      echo \"sha256sum and shasum are not installed\" >&2\n      return 1\n    else\n      shasum -a 256 \"$@\"\n    fi\n  else\n    sha256sum \"$@\"\n  fi\n}\n\nif [ -z \"${INSIDE_DOCKER}\" ]; then\n  if [ -z \"${SKIP_MINISIGN}\" ]; then\n    if [ -z \"${RELEASE_MINISIGN_PRIVATE_KEY}\" -o -z \"${RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}\" ]; then\n      fail \"RELEASE_MINISIGN_PRIVATE_KEY and RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD must be set.\"\n    fi\n  fi\n  docker build -f \"${RELEASE_DOCKER_FILE}\" -t \"${RELEASE_DOCKER_IMAGE}\" .\n  docker run --volume \\\n    \"${DIR}:/app\" \\\n    --workdir \"/app\" \\\n    --rm \\\n    -e INSIDE_DOCKER=1 \\\n    \"${RELEASE_DOCKER_IMAGE}\" \\\n    bash -x make/buf/scripts/release.bash\n  if [ \"$(uname -s)\" == \"Linux\" ]; then\n    sudo chown -R \"$(id -u):$(id -g)\" .build\n  fi\n  if [ -z \"${SKIP_MINISIGN}\" ]; then\n    # Produce the signature outside the docker image where we have\n    # minisign installed.\n    secret_key_file=\"$(mktemp)\"\n    trap \"rm ${secret_key_file}\" EXIT\n    # Prevent printing of private key and password\n    set +x\n    echo \"${RELEASE_MINISIGN_PRIVATE_KEY}\" > \"${secret_key_file}\"\n    echo \"${RELEASE_MINISIGN_PRIVATE_KEY_PASSWORD}\" | minisign -S -s \"${secret_key_file}\" -m .build/release/buf/assets/sha256.txt\n    set -x\n  fi\n  exit 0\nfi\n\nBASE_NAME=\"buf\"\n\nRELEASE_DIR=\".build/release/${BASE_NAME}\"\nrm -rf \"${RELEASE_DIR}\"\nmkdir -p \"${RELEASE_DIR}\"\ncd \"${RELEASE_DIR}\"\n\nfor os in Darwin Linux Windows; do\n  for arch in x86_64 riscv64 arm64 armv7 ppc64le s390x; do\n    # our goal is to have the binaries be suffixed with $(uname -s)-$(uname -m)\n    # on mac, this is arm64, on linux, this is aarch64, for historical reasons\n    # this is a hacky way to not have to rewrite this loop (and others below)\n    if [ \"${os}\" == \"Linux\" ] && [ \"${arch}\" == \"arm64\" ]; then\n      arch=\"aarch64\"\n    fi\n    extension=\"\"\n    if [ \"${os}\" == \"Windows\" ]; then\n      extension=\".exe\"\n    fi\n    dir=\"${os}/${arch}/${BASE_NAME}\"\n    mkdir -p \"${dir}/bin\"\n    for binary in \\\n      buf \\\n      protoc-gen-buf-breaking \\\n      protoc-gen-buf-lint; do\n      if [[ ! \"${arch}\" =~ x86_64|arm64 ]] && [ \"${os}\" != \"Linux\" ]; then\n        continue\n      fi\n      if [ \"${arch}\" == \"armv7\" ]; then\n        CGO_ENABLED=0 GOOS=$(goos \"${os}\") GOARCH=$(goarch \"${arch}\") GOARM=7 \\\n          go build -a -ldflags \"-s -w\" -trimpath -buildvcs=false -o \"${dir}/bin/${binary}${extension}\" \"${DIR}/cmd/${binary}\"\n      else\n        CGO_ENABLED=0 GOOS=$(goos \"${os}\") GOARCH=$(goarch \"${arch}\") \\\n          go build -a -ldflags \"-s -w\" -trimpath -buildvcs=false -o \"${dir}/bin/${binary}${extension}\" \"${DIR}/cmd/${binary}\"\n      fi\n      cp \"${dir}/bin/${binary}${extension}\" \"${binary}-${os}-${arch}${extension}\"\n    done\n  done\ndone\n\nfor os in Darwin Linux Windows; do\n  for arch in x86_64 riscv64 arm64 armv7 ppc64le s390x; do\n    if [[ ! \"${arch}\" =~ x86_64|arm64 ]] && [ \"${os}\" != \"Linux\" ]; then\n      continue\n    fi\n    if [ \"${os}\" == \"Linux\" ] && [ \"${arch}\" == \"arm64\" ]; then\n      arch=\"aarch64\"\n    fi\n    dir=\"${os}/${arch}/${BASE_NAME}\"\n    cp -R \"${DIR}/LICENSE\" \"${dir}/LICENSE\"\n    if [ \"${os}\" == \"Darwin\" ] || [ \"${os}\" == \"Linux\" ]; then\n      mkdir -p \"${dir}/etc/bash_completion.d\"\n      mkdir -p \"${dir}/share/fish/vendor_completions.d\"\n      mkdir -p \"${dir}/share/zsh/site-functions\"\n      mkdir -p \"${dir}/share/man/man1\"\n      \"$(uname -s)/$(uname -m)/${BASE_NAME}/bin/buf\" completion bash > \"${dir}/etc/bash_completion.d/buf\"\n      \"$(uname -s)/$(uname -m)/${BASE_NAME}/bin/buf\" completion fish > \"${dir}/share/fish/vendor_completions.d/buf.fish\"\n      \"$(uname -s)/$(uname -m)/${BASE_NAME}/bin/buf\" completion zsh > \"${dir}/share/zsh/site-functions/_buf\"\n      \"$(uname -s)/$(uname -m)/${BASE_NAME}/bin/buf\" manpages \"${dir}/share/man/man1\"\n    fi\n  done\ndone\n\nfor os in Darwin Linux; do\n  for arch in x86_64 riscv64 arm64 armv7 ppc64le s390x; do\n    if [[ ! \"${arch}\" =~ x86_64|arm64 ]] && [ \"${os}\" != \"Linux\" ]; then\n      continue\n    fi\n    if [ \"${os}\" == \"Linux\" ] && [ \"${arch}\" == \"arm64\" ]; then\n      arch=\"aarch64\"\n    fi\n    dir=\"${os}/${arch}/${BASE_NAME}\"\n    tar_context_dir=\"$(dirname \"${dir}\")\"\n    tar_dir=\"${BASE_NAME}\"\n    tarball=\"${BASE_NAME}-${os}-${arch}.tar.gz\"\n    tar -C \"${tar_context_dir}\" -cvzf \"${tarball}\" \"${tar_dir}\"\n  done\ndone\n\nfor os in Windows; do\n  for arch in x86_64 arm64; do\n    dir=\"${os}/${arch}/${BASE_NAME}\"\n    # \"${os}/${arch}\"\n    zip_context_dir=\"$(dirname \"${dir}\")\"\n    zip_dir=\"${BASE_NAME}\"\n    zipfile=\"${BASE_NAME}-${os}-${arch}.zip\"\n    pushd \"${zip_context_dir}\" >/dev/null\n    zip -r \"${zipfile}\" \"${zip_dir}\"\n    popd >/dev/null\n    mv \"${zip_context_dir}/${zipfile}\" \"${zipfile}\"\n  done\ndone\n\nfor file in $(find . -maxdepth 1 -type f | sed 's/^\\.\\///' | sort | uniq); do\n  sha256 \"${file}\" >> sha256.txt\ndone\nsha256 -c sha256.txt\n\nmkdir -p assets\nfor file in $(find . -maxdepth 1 -type f | sed 's/^\\.\\///' | sort | uniq); do\n  mv \"${file}\" \"assets/${file}\"\ndone\n\necho Upload all the files in this directory to GitHub: open \"${RELEASE_DIR}/assets\"\n"
  },
  {
    "path": "make/buf/scripts/verifychangelog.bash",
    "content": "#!/usr/bin/env bash\n\nset -euo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\nfiles=`(git fetch origin main:main) && (git diff --name-only main)`\nfor file in $files; do\nif [ \"$file\" = \"CHANGELOG.md\" ]; then\n    exit 0\nfi\ndone\necho ERROR: CHANGELOG has not been updated\nexit 1\n"
  },
  {
    "path": "make/go/base.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n# Must be set\n$(call _assert_var,MAKEGO_REMOTE)\n# Must be set\n$(call _assert_var,PROJECT)\n# Must be set\n$(call _assert_var,GO_MODULE)\n\nUNAME_OS := $(shell uname -s)\nUNAME_ARCH := $(shell uname -m)\n\nENV_DIR := .env\nENV_SH := $(ENV_DIR)/env.sh\nENV_BACKUP_DIR := $(HOME)/.config/$(PROJECT)/env\n\nTMP := .tmp\n\n# Settable\n# These are exact file paths that are added to .gitignore and .dockerignore\nFILE_IGNORES := $(FILE_IGNORES) $(ENV_DIR)/ $(TMP)/ .claude/settings.local.json\n# Settable\n# These will be added without any modification to .gitignore\nGIT_FILE_IGNORES ?=\n# Settable\n# These will be added without any modification to .dockerignore\nDOCKER_FILE_IGNORES ?=\n# Settable\nCACHE_BASE ?= $(HOME)/.cache/$(PROJECT)\n\nCACHE := $(CACHE_BASE)/$(UNAME_OS)/$(UNAME_ARCH)\nCACHE_BIN := $(CACHE)/bin\nCACHE_INCLUDE := $(CACHE)/include\nCACHE_VERSIONS := $(CACHE)/versions\nCACHE_ENV := $(CACHE)/env\nCACHE_GO := $(CACHE)/go\n\n# CACHE_GOBIN is the location where binaries are installed for Golang projects\n# This is as opposed to CACHE_BIN, where dependencies binaries are installed\n# The separation is needed for i.e. buf, where we need to bootstrap with a\n# download from releases, but want to have a different namespace for the\n# version of buf installed from source\n# CACHE_GOBIN takes precedence over CACHE_BIN in PATH\nCACHE_GOBIN := $(CACHE)/gobin\n# CACHE_GOCACHE is where the build cache is stored.\nCACHE_GOCACHE := $(CACHE)/gocache\n\nifeq ($(UNAME_OS),Darwin)\nOPEN_CMD := open\nendif\nifeq ($(UNAME_OS),Linux)\nOPEN_CMD := xdg-open\nendif\n\nifeq ($(UNAME_OS),Darwin)\n# Explicitly use the \"BSD\" sed shipped with Darwin. Otherwise if the user has a\n# different sed (such as gnu-sed) on their PATH this will fail in an opaque\n# manner. /usr/bin/sed can only be modified if SIP is disabled, so this should\n# be relatively safe.\nSED_I := /usr/bin/sed -i ''\nendif\nifeq ($(UNAME_OS),Linux)\nSED_I := sed -i\nendif\n\n# Runtime ALL\n\n# All variables exported here must also be added to env.sh\n# via the direnv target below\nexport GO111MODULE := on\nifdef GOPRIVATE\nexport GOPRIVATE := $(GOPRIVATE),$(GO_MODULE)\nelse\nexport GOPRIVATE := $(GO_MODULE)\nendif\nexport GOPATH := $(abspath $(CACHE_GO))\nexport GOBIN := $(abspath $(CACHE_GOBIN))\nexport GOCACHE := $(abspath $(CACHE_GOCACHE))\nexport GOMODCACHE := $(GOPATH)/pkg/mod\n\nifdef EXTRAPATH\nEXTRAPATH := $(GOBIN):$(abspath $(CACHE_BIN)):$(EXTRAPATH)\nelse\nEXTRAPATH := $(GOBIN):$(abspath $(CACHE_BIN))\nendif\nexport PATH := $(EXTRAPATH):$(PATH)\nexport DOCKER_BUILDKIT := 1\n\n# A bug when using BuildKit on Darwin/arm64 causes docker to misbehave and try\n# to pull remote images instead of using local tagged images. Current\n# workaround is to explicitly set the platform. See\n# https://github.com/docker/for-mac/issues/5873 for details.\nifeq ($(UNAME_OS)/$(UNAME_ARCH),Darwin/arm64)\nexport DOCKER_DEFAULT_PLATFORM=linux/arm64\nendif\n\n# https://gist.github.com/prwhite/8168133#gistcomment-3785627\nHELP_COLUMN_SIZE := 20\n\n.PHONY: help\nhelp: ## Show help message.\n\t@awk 'BEGIN {FS = \":.*##\"; printf \"\\nUsage:\\n\\n\\033[36m\\033[0m\"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf \"  \\033[36m%-$(HELP_COLUMN_SIZE)s\\033[0m %s\\n\", $$1, $$2 } /^##@/ { printf \"\\n\\033[1m%s\\033[0m\\n\", substr($$0, 5) } ' $(MAKEFILE_LIST)\n\n\nprint-%:\n\t@echo $($*)\n\n.PHONY: envbackup\nenvbackup:\n\trm -rf \"$(ENV_BACKUP_DIR)\"\n\tmkdir -p \"$(dir $(ENV_BACKUP_DIR))\"\n\tcp -R \"$(ENV_DIR)\" \"$(ENV_BACKUP_DIR)\"\n\n.PHONY: envrestore\nenvrestore:\n\t@ if [ ! -d \"$(ENV_BACKUP_DIR)\" ]; then echo \"no backup stored in $(ENV_BACKUP_DIR)\"; exit 1; fi\n\trm -rf \"$(ENV_DIR)\"\n\tcp -R \"$(ENV_BACKUP_DIR)\" \"$(ENV_DIR)\"\n\n# All variables set in env.sh by this target need to also be exported\n# above in the Runtime ALL section, except for MAKEFLAGS.\n.PHONY: direnv\ndirenv:\n\t@mkdir -p $(CACHE_ENV)\n\t@rm -f $(CACHE_ENV)/env.sh\n\t@echo 'export CACHE=\"$(abspath $(CACHE))\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export GO111MODULE=\"$(GO111MODULE)\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export GOPRIVATE=\"$(GOPRIVATE)\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export GOPATH=\"$(GOPATH)\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export GOBIN=\"$(GOBIN)\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export GOCACHE=\"$(GOCACHE)\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export GOMODCACHE=\"$(GOPATH)/pkg/mod\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export PATH=\"$(EXTRAPATH):$${PATH}\"' >> $(CACHE_ENV)/env.sh\n\t@echo 'export DOCKER_BUILDKIT=1' >> $(CACHE_ENV)/env.sh\n\t@echo 'export MAKEFLAGS=\"-j $$(exec 2>/dev/null; nproc || getconf _NPROCESSORS_ONLN || sysctl -n hw.ncpu || echo 1)\"' >> $(CACHE_ENV)/env.sh\nifneq ($(DOCKER_DEFAULT_PLATFORM),)\n\t@echo 'export DOCKER_DEFAULT_PLATFORM=\"$(DOCKER_DEFAULT_PLATFORM)\"' >> $(CACHE_ENV)/env.sh\nendif\n\t@echo '[ -f \"$(abspath $(ENV_SH))\" ] && . \"$(abspath $(ENV_SH))\"' >> $(CACHE_ENV)/env.sh\n\t@echo $(CACHE_ENV)/env.sh\n\n.PHONY: clean\nclean: ## Run git clean with proper ignores.\n\tgit clean -xdf -e /$(ENV_DIR)/\n\n.PHONY: cleancache\ncleancache:\n\trm -rf $(CACHE_BASE)\n\n.PHONY: nuke\nnuke: clean\n\tsudo rm -rf $(CACHE_GO)/pkg/mod\n\trm -rf $(CACHE_BASE)\n\n.PHONY: dockerdeps\ndockerdeps::\n\n.PHONY: deps\ndeps:: dockerdeps\n\n.PHONY: preinstallgenerate\npreinstallgenerate::\n\n.PHONY: pregenerate\npregenerate::\n\n.PHONY: prepostgenerate\nprepostgenerate::\n\n.PHONY: postprepostgenerate\npostprepostgenerate::\n\n.PHONY: postgenerate\npostgenerate::\n\n.PHONY: licensegenerate\nlicensegenerate::\n\n.PHONY: format\nformat::\n\n.PHONY: generate\ngenerate: ## Run all generation steps.\n\t@$(MAKE) preinstallgenerate\n\t@$(MAKE) pregenerate\n\t@$(MAKE) prepostgenerate\n\t@$(MAKE) postprepostgenerate\n\t@$(MAKE) postgenerate\n\t@$(MAKE) licensegenerate\n\t@$(MAKE) format\n\n.PHONY: checknodiffgenerated\nchecknodiffgenerated:\n\t@ if [[ -d .git || -f .git ]]; then \\\n\t\t\t$(MAKE) __checknodiffgeneratedinternal; \\\n\t\telse \\\n\t\t\techo \"skipping make checknodiffgenerated due to no .git repository\" >&2; \\\n\t\tfi\n\n.PHONY: preupgrade\npreupgrade::\n\n.PHONY: postupgrade\npostupgrade::\n\n.PHONY: upgrade\nupgrade: ## Upgrade all dependencies.\n\t@$(MAKE) preupgrade\n\t@$(MAKE) generate\n\t@$(MAKE) postupgrade\n\n.PHONY: upgradenopost\nupgradenopost:\n\t@$(MAKE) preupgrade\n\t@$(MAKE) generate\n\n.PHONY: githubactionupgrade\ngithubactionupgrade:\n\tbash $(MAKEGO)/scripts/githubactionmakeupgrade.bash\n\n.PHONY: copyfrommakego\ncopyfrommakego:\n\t@rm -rf $(TMP)/makego\n\t@mkdir -p $(TMP)\n\tgit clone --depth 1 $(MAKEGO_REMOTE) $(TMP)/makego\n\trm -rf $(MAKEGO)\n\tcp -R $(TMP)/makego/make/go $(MAKEGO)\n\t@rm -rf $(TMP)/makego\n\n.PHONY: copytomakego\ncopytomakego:\n\t@rm -rf $(TMP)/makego\n\t@mkdir -p $(TMP)\n\tgit clone $(MAKEGO_REMOTE) $(TMP)/makego\n\trm -rf $(TMP)/makego/make/go\n\tcp -R $(MAKEGO) $(TMP)/makego/make/go\n\tbash $(MAKEGO)/scripts/pushall.bash $(TMP)/makego\n\n.PHONY: initmakego\ninitmakego::\n\n.PHONY: updategitignores\nupdategitignores:\n\t@rm -f .gitignore\n\t@echo '# Autogenerated by makego. DO NOT EDIT.' > .gitignore\n\t@$(foreach file_ignore,$(sort $(FILE_IGNORES)),echo /$(file_ignore) >> .gitignore || exit 1; )\n\t@$(foreach git_file_ignore,$(sort $(GIT_FILE_IGNORES)),echo $(git_file_ignore) >> .gitignore || exit 1; )\n\npregenerate:: updategitignores\n\n.PHONY: __checknodiffgeneratedinternal\n__checknodiffgeneratedinternal:\n\t@echo bash $(MAKEGO)/scripts/checknodiffgenerated.bash make generate\n\t@bash $(MAKEGO)/scripts/checknodiffgenerated.bash $(MAKE) generate\n"
  },
  {
    "path": "make/go/bootstrap.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\nSHELL := /usr/bin/env bash -o pipefail\n\nMAKEFLAGS += --no-builtin-rules\nMAKEFLAGS += --no-print-directory\n\ndefine _assert\n\t$(if $(1),,$(error Assertion failed: $(2)))\nendef\ndefine _assert_var\n\t$(call _assert,$($(1)),$(1) is not set)\nendef\ndefine _conditional_include\n\t$(if $(filter $(1),$(MAKEFILE_LIST)),,$(eval include $(1)))\nendef\n"
  },
  {
    "path": "make/go/buf.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,make/go/dep_buf.mk)\n\n# Settable\nBUF_LINT_INPUT ?=\n# Settable\nBUF_BREAKING_INPUT ?=\n# Settable\nBUF_BREAKING_AGAINST_INPUT ?=\n# Settable\nBUF_FORMAT_INPUT ?=\n\n.PHONY: bufgeneratedeps\nbufgeneratedeps:: $(BUF)\n\n.PHONY: bufgenerateclean\nbufgenerateclean::\n\n.PHONY: bufgeneratesteps\nbufgeneratesteps::\n\n.PHONY: bufgenerate\nbufgenerate: ## Run all generation steps for Protobuf.\n\t@$(MAKE) __bufgenerate\n\t@$(MAKE) licensegenerate\n\n# __bufgenerate calls just the buf generate steps. It should\n# only be referenced wtihin this file\n#\n# bufgenerate can be called independently of make generate and\n# *should* do everything required for a proto-only change. It's\n# not super-safe, but should work 99.9999% of the time, and CI\n# will catch when it does not via calling the full make generate.\n#\n# It will not work if other generate steps are required for\n# Protobuf files in the future that are not captured by\n# __bufgenerate and licensegenerate, however this is very unlikely.\n\n.PHONY: __bufgenerate\n__bufgenerate:\n\t@echo make bufgeneratedeps\n\t@$(MAKE) bufgeneratedeps\nifneq ($(BUF_FORMAT_INPUT),)\n\t@echo buf format -w $(BUF_FORMAT_INPUT)\n\t@$(BUF_BIN) format -w $(BUF_FORMAT_INPUT)\nendif\n\t@echo make bufgenerateclean\n\t@$(MAKE) bufgenerateclean\n\t@echo make bufgeneratesteps\n\t@$(MAKE) bufgeneratesteps\n\npregenerate:: __bufgenerate\n\n.PHONY: buflintdeps\nbuflintdeps:: $(BUF)\n\nifneq ($(BUF_LINT_INPUT),)\n.PHONY: buflint\nbuflint:\n\t@echo make buflintdeps\n\t@$(MAKE) buflintdeps\n\t@echo buf lint $(BUF_LINT_INPUT)\n\t@$(BUF_BIN) lint $(BUF_LINT_INPUT)\n\npostlint:: buflint\nendif\n\nifneq ($(BUF_BREAKING_INPUT),)\nifneq ($(BUF_BREAKING_AGAINST_INPUT),)\n.PHONY: bufbreaking\nbufbreaking: $(BUF)\n\t@echo buf breaking $(BUF_BREAKING_INPUT) --against $(BUF_BREAKING_AGAINST_INPUT)\n\t@$(BUF_BIN) breaking $(BUF_BREAKING_INPUT) --against $(BUF_BREAKING_AGAINST_INPUT)\n\npostlint:: bufbreaking\nendif\nendif\n"
  },
  {
    "path": "make/go/dep_bandeps.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,$(MAKEGO)/dep_buf.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n$(call _assert_var,BUF_VERSION)\n\n# Settable\n# https://github.com/bufbuild/buf/releases\nBANDEPS_VERSION ?= $(BUF_VERSION)\n\nBANDEPS := $(CACHE_VERSIONS)/bandeps/$(BANDEPS_VERSION)\n$(BANDEPS):\n\t@rm -f $(CACHE_BIN)/bandeps\n\tGOBIN=$(CACHE_BIN) go install github.com/bufbuild/buf/private/pkg/bandeps/cmd/bandeps@$(BANDEPS_VERSION)\n\t@rm -rf $(dir $(BANDEPS))\n\t@mkdir -p $(dir $(BANDEPS))\n\t@touch $(BANDEPS)\n\ndockerdeps:: $(BANDEPS)\n"
  },
  {
    "path": "make/go/dep_buf.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\n# Settable\n# https://github.com/bufbuild/buf/releases 20260203 checked 20260203\nBUF_VERSION ?= v1.65.0\n# Settable\n#\n# If set, this path will be installed every time someone depends on $(BUF)\n# as opposed to installing from github with @$(BUF_VERSION).\n#\n# This can be used to always do \"go install ./cmd/buf\" or\n# \"go install github.com/bufbuild/buf/cmd/buf\".\nBUF_GO_INSTALL_PATH ?=\nifneq ($(BUF_GO_INSTALL_PATH),)\n.PHONY: __goinstallbuf\n__goinstallbuf:\n\tgo install $(BUF_GO_INSTALL_PATH)\n\nBUF := __goinstallbuf\n\n# Use this instead of \"buf\" when using buf.\nBUF_BIN := $(CACHE_GOBIN)/buf\nelse\nBUF := $(CACHE_VERSIONS)/buf/$(BUF_VERSION)\n$(BUF):\n\t@rm -f $(CACHE_BIN)/buf\n\tGOBIN=$(CACHE_BIN) go install github.com/bufbuild/buf/cmd/buf@$(BUF_VERSION)\n\t@rm -rf $(dir $(BUF))\n\t@mkdir -p $(dir $(BUF))\n\t@touch $(BUF)\n\n# Use this instead of \"buf\" when using buf.\nBUF_BIN := $(CACHE_BIN)/buf\n\ndockerdeps:: $(BUF)\nendif\n"
  },
  {
    "path": "make/go/dep_bufprivateusage.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,$(MAKEGO)/dep_buf.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n$(call _assert_var,BUF_VERSION)\n\n# Settable\n# https://github.com/bufbuild/bufprivateusage-go/releases\nBUFPRIVATEUSAGE_VERSION ?= v0.1.0\n\nBUFPRIVATEUSAGE := $(CACHE_VERSIONS)/bufprivateusage/$(BUFPRIVATEUSAGE_VERSION)\n$(BUFPRIVATEUSAGE):\n\t@rm -f $(CACHE_BIN)/bufprivateusage\n\tGOBIN=$(CACHE_BIN) go install buf.build/go/bufprivateusage/cmd/bufprivateusage@$(BUFPRIVATEUSAGE_VERSION)\n\t@rm -rf $(dir $(BUFPRIVATEUSAGE))\n\t@mkdir -p $(dir $(BUFPRIVATEUSAGE))\n\t@touch $(BUFPRIVATEUSAGE)\n\ndockerdeps:: $(BUFPRIVATEUSAGE)\n"
  },
  {
    "path": "make/go/dep_bufstyle.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,$(MAKEGO)/dep_buf.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n$(call _assert_var,BUF_VERSION)\n\n# We want to ensure we rebuild bufstyle every time we require a new Go minor version.\n# Otherwise, the cached version may not support the latest language features.\nBUFSTYLE_GO_VERSION := $(shell go list -m -f '{{.GoVersion}}' | cut -d'.' -f1-2)\n\n# Settable\n# https://github.com/bufbuild/bufstyle-go/releases\nBUFSTYLE_VERSION ?= v0.5.0\n\nBUFSTYLE := $(CACHE_VERSIONS)/bufstyle/$(BUFSTYLE_VERSION)-go$(BUFSTYLE_GO_VERSION)\n$(BUFSTYLE):\n\t@rm -f $(CACHE_BIN)/bufstyle\n\tGOBIN=$(CACHE_BIN) go install buf.build/go/bufstyle@$(BUFSTYLE_VERSION)\n\t@rm -rf $(dir $(BUFSTYLE))\n\t@mkdir -p $(dir $(BUFSTYLE))\n\t@touch $(BUFSTYLE)\n\ndockerdeps:: $(BUFSTYLE)\n"
  },
  {
    "path": "make/go/dep_git_ls_files_unstaged.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,$(MAKEGO)/dep_buf.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n$(call _assert_var,BUF_VERSION)\n\n# Settable\n# https://github.com/bufbuild/buf/releases\nGIT_LS_FILES_UNSTAGED_VERSION ?= $(BUF_VERSION)\n\nGIT_LS_FILES_UNSTAGED := $(CACHE_VERSIONS)/git-ls-files-unstaged/$(GIT_LS_FILES_UNSTAGED_VERSION)\n$(GIT_LS_FILES_UNSTAGED):\n\t@rm -f $(CACHE_BIN)/git-ls-files-unstaged\n\tGOBIN=$(CACHE_BIN) go install github.com/bufbuild/buf/private/pkg/git/cmd/git-ls-files-unstaged@$(GIT_LS_FILES_UNSTAGED_VERSION)\n\t@rm -rf $(dir $(GIT_LS_FILES_UNSTAGED))\n\t@mkdir -p $(dir $(GIT_LS_FILES_UNSTAGED))\n\t@touch $(GIT_LS_FILES_UNSTAGED)\n\ndockerdeps:: $(GIT_LS_FILES_UNSTAGED)\n"
  },
  {
    "path": "make/go/dep_godoclint.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,$(MAKEGO)/dep_buf.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n$(call _assert_var,BUF_VERSION)\n\n# We want to ensure we rebuild godoclint every time we require a new Go minor version.\n# Otherwise, the cached version may not support the latest language features.\nGODOCLINT_GO_VERSION := $(shell go list -m -f '{{.GoVersion}}' | cut -d'.' -f1-2)\n\n# Settable\n#\n# Based off of dev branch.\n# https://github.com/bufbuild/godoc-lint/commits/dev\nGODOCLINT_VERSION ?= 26c7b506fc2bf37a67fc2b42a3d9825c7ade2068\n\nGODOCLINT := $(CACHE_VERSIONS)/godoclint/$(GODOCLINT_VERSION)-go$(GODOCLINT_GO_VERSION)\n$(GODOCLINT):\n\t@rm -f $(CACHE_BIN)/godoclint\n\t$(eval GODOCLINT_TMP := $(shell mktemp -d))\n\tcd $(GODOCLINT_TMP); \\\n\t\tgit clone https://github.com/bufbuild/godoc-lint && \\\n\t\tcd ./godoc-lint && \\\n\t\tgit checkout $(GODOCLINT_VERSION) && \\\n\t\tGOBIN=$(CACHE_BIN) go install ./cmd/godoclint\n\t@rm -rf $(GODOCLINT_TMP)\n\t@rm -rf $(dir $(GODOCLINT))\n\t@mkdir -p $(dir $(GODOCLINT))\n\t@touch $(GODOCLINT)\n\ndockerdeps:: $(GODOCLINT)\n"
  },
  {
    "path": "make/go/dep_golangci_lint.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\nifeq ($(UNAME_OS),Darwin)\nGOLANGCI_LINT_OS := darwin\nelse ifeq ($(UNAME_OS),Linux)\nGOLANGCI_LINT_OS := linux\nendif\n\nifeq ($(UNAME_ARCH),x86_64)\nGOLANGCI_LINT_ARCH := amd64\nelse ifeq ($(UNAME_ARCH),arm64)\nGOLANGCI_LINT_ARCH := arm64\nelse ifeq ($(UNAME_ARCH),aarch64)\nGOLANGCI_LINT_ARCH := arm64\nelse\nGOLANGCI_LINT_ARCH := $(UNAME_ARCH)\nendif\n\n# Settable\n# https://github.com/golangci/golangci-lint/releases 20260210 checked 20260211\nGOLANGCI_LINT_VERSION ?= v2.9.0\n\nGOLANGCI_LINT := $(CACHE_VERSIONS)/golangci-lint/$(GOLANGCI_LINT_VERSION)\n$(GOLANGCI_LINT):\n\t@rm -f $(CACHE_BIN)/golangci-lint\n\t@mkdir -p $(CACHE_BIN)\n\t$(eval GOLANGCI_LINT_TMP := $(shell mktemp -d))\n\tcurl -fsSL -o $(GOLANGCI_LINT_TMP)/golangci-lint.tar.gz \\\n\t\thttps://github.com/golangci/golangci-lint/releases/download/$(GOLANGCI_LINT_VERSION)/golangci-lint-$(subst v,,$(GOLANGCI_LINT_VERSION))-$(GOLANGCI_LINT_OS)-$(GOLANGCI_LINT_ARCH).tar.gz\n\tcd $(GOLANGCI_LINT_TMP); tar zxf $(GOLANGCI_LINT_TMP)/golangci-lint.tar.gz --strip-components 1 && mv golangci-lint $(CACHE_BIN)/golangci-lint\n\t@rm -rf $(GOLANGCI_LINT_TMP)\n\t@rm -rf $(dir $(GOLANGCI_LINT))\n\t@mkdir -p $(dir $(GOLANGCI_LINT))\n\t@touch $(GOLANGCI_LINT)\n\ndockerdeps:: $(GOLANGCI_LINT)\n"
  },
  {
    "path": "make/go/dep_govulncheck.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n#\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\n# We want to ensure we rebuild govulncheck every time we require a new Go minor version.\n# Otherwise, the cached version may not support the latest language features.\nGOVULNCHECK_GO_VERSION := $(shell go env GOVERSION | sed 's/^go//' | cut -d'.' -f1-2)\n\n# Settable\n# https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck 20250106 checked 20250212\nGOVULNCHECK_VERSION ?= v1.1.4\n\nGOVULNCHECK := $(CACHE_VERSIONS)/govulncheck/$(GOVULNCHECK_VERSION)-go$(GOVULNCHECK_GO_VERSION)\n$(GOVULNCHECK):\n\t@rm -f $(CACHE_BIN)/govulncheck\n\tGOBIN=$(CACHE_BIN) go install golang.org/x/vuln/cmd/govulncheck@$(GOVULNCHECK_VERSION)\n\t@rm -rf $(dir $(GOVULNCHECK))\n\t@mkdir -p $(dir $(GOVULNCHECK))\n\t@touch $(GOVULNCHECK)\n\ndockerdeps:: $(GOVULNCHECK)\n"
  },
  {
    "path": "make/go/dep_jq.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,UNAME_OS)\n$(call _assert_var,UNAME_ARCH)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\n# Settable\n# https://jqlang.github.io/jq/download 20250701 checked 20250808\nJQ_VERSION ?= 1.8.1\n\nifeq ($(UNAME_OS),Darwin)\nJQ_OS := macos\nelse ifeq ($(UNAME_OS),Linux)\nJQ_OS := linux\nendif\n\nifeq ($(UNAME_ARCH),x86_64)\nJQ_ARCH := amd64\nelse\nJQ_ARCH := $(UNAME_ARCH)\nendif\n\nJQ := $(CACHE_VERSIONS)/jq/$(JQ_VERSION)\n$(JQ):\n\t@rm -f $(CACHE_BIN)/jq\n\t@mkdir -p $(CACHE_BIN)\n\tcurl -sSL \\\n\t\thttps://github.com/jqlang/jq/releases/download/jq-$(JQ_VERSION)/jq-$(JQ_OS)-$(JQ_ARCH) \\\n\t\t-o $(CACHE_BIN)/jq\n\tchmod +x $(CACHE_BIN)/jq\n\t@rm -rf $(dir $(JQ))\n\t@mkdir -p $(dir $(JQ))\n\t@touch $(JQ)\n\ndockerdeps:: $(JQ)\n"
  },
  {
    "path": "make/go/dep_license_header.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,$(MAKEGO)/dep_buf.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n$(call _assert_var,BUF_VERSION)\n\n# Settable\n# https://github.com/bufbuild/buf/releases\nLICENSE_HEADER_VERSION ?= $(BUF_VERSION)\n\nLICENSE_HEADER := $(CACHE_VERSIONS)/license-header/$(LICENSE_HEADER_VERSION)\n$(LICENSE_HEADER):\n\t@rm -f $(CACHE_BIN)/license-header\n\tGOBIN=$(CACHE_BIN) go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@$(LICENSE_HEADER_VERSION)\n\t@rm -rf $(dir $(LICENSE_HEADER))\n\t@mkdir -p $(dir $(LICENSE_HEADER))\n\t@touch $(LICENSE_HEADER)\n\ndockerdeps:: $(LICENSE_HEADER)\n"
  },
  {
    "path": "make/go/dep_minisign.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\n# Settable\n# https://github.com/aead/minisign 20240519 checked 20240524\nMINISIGN_VERSION ?= v0.3.0\n\nMINISIGN := $(CACHE_VERSIONS)/MINISIGN/$(MINISIGN_VERSION)\n$(MINISIGN):\n\t@rm -f $(CACHE_BIN)/minisign\n\tGOBIN=$(CACHE_BIN) go install aead.dev/minisign/cmd/minisign@$(MINISIGN_VERSION)\n\t@rm -rf $(dir $(MINISIGN))\n\t@mkdir -p $(dir $(MINISIGN))\n\t@touch $(MINISIGN)\n\ndeps:: $(MINISIGN)\n"
  },
  {
    "path": "make/go/dep_protoc.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,UNAME_OS)\n$(call _assert_var,UNAME_ARCH)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_INCLUDE)\n$(call _assert_var,CACHE_BIN)\n\n# Settable\n# https://github.com/protocolbuffers/protobuf/releases 20250225 checked 20250310\n# NOTE: Set to version compatible with genproto source code (only used in tests).\nPROTOC_VERSION ?= 33.3\n\n# Google adds a dash to release candidate versions in the name of the\n# release artifact, i.e. v27.0-rc1 -> v27.0-rc-1\nifeq (,$(findstring $(PROTOC_VERSION),-rc))\nPROTOC_RELEASE_VERSION := $(subst -rc,-rc-,$(PROTOC_VERSION))\nelse\nPROTOC_RELEASE_VERSION := $(PROTOC_VERSION)\nendif\n\nifeq ($(UNAME_OS),Darwin)\nPROTOC_OS := osx\nifeq ($(UNAME_ARCH),arm64)\nPROTOC_ARCH := aarch_64\nelse\nPROTOC_ARCH := x86_64\nendif\nendif\nifeq ($(UNAME_OS),Linux)\nPROTOC_OS = linux\nPROTOC_ARCH := $(UNAME_ARCH)\nendif\n\nPROTOC := $(CACHE_VERSIONS)/protoc/$(PROTOC_VERSION)\n$(PROTOC):\n\t@if ! command -v curl >/dev/null 2>/dev/null; then echo \"error: curl must be installed\"  >&2; exit 1; fi\n\t@if ! command -v unzip >/dev/null 2>/dev/null; then echo \"error: unzip must be installed\"  >&2; exit 1; fi\n\t@rm -f $(CACHE_BIN)/protoc\n\t@rm -rf $(CACHE_INCLUDE)/google\n\t@mkdir -p $(CACHE_BIN) $(CACHE_INCLUDE)\n\t$(eval PROTOC_TMP := $(shell mktemp -d))\n\tcd $(PROTOC_TMP); curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_RELEASE_VERSION)-$(PROTOC_OS)-$(PROTOC_ARCH).zip -o protoc.zip\n\tcd $(PROTOC_TMP); unzip protoc.zip && mv bin/protoc $(CACHE_BIN)/protoc && mv include/google $(CACHE_INCLUDE)/google\n\t@rm -rf $(PROTOC_TMP)\n\t@rm -rf $(dir $(PROTOC))\n\t@mkdir -p $(dir $(PROTOC))\n\t@touch $(PROTOC)\n\ndockerdeps:: $(PROTOC)\n"
  },
  {
    "path": "make/go/dep_protoc_gen_connect_go.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\n# Settable\n# https://github.com/connectrpc/connect-go 20251006 checked 20251013\nCONNECT_VERSION ?= v1.19.1\n\nGO_GET_PKGS := $(GO_GET_PKGS) \\\n\tconnectrpc.com/connect@$(CONNECT_VERSION)\n\nPROTOC_GEN_CONNECT_GO := $(CACHE_VERSIONS)/connect-go/$(CONNECT_VERSION)\n$(PROTOC_GEN_CONNECT_GO):\n\t@rm -f $(CACHE_BIN)/protoc-gen-connect-go\n\tGOBIN=$(CACHE_BIN) go install connectrpc.com/connect/cmd/protoc-gen-connect-go@$(CONNECT_VERSION)\n\t@rm -rf $(dir $(PROTOC_GEN_CONNECT_GO))\n\t@mkdir -p $(dir $(PROTOC_GEN_CONNECT_GO))\n\t@touch $(PROTOC_GEN_CONNECT_GO)\n\ndockerdeps:: $(PROTOC_GEN_CONNECT_GO)\n"
  },
  {
    "path": "make/go/dep_protoc_gen_go.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\n# Settable\n# https://github.com/protocolbuffers/protobuf-go/releases 20251212 checked 20251219\nPROTOC_GEN_GO_VERSION ?= v1.36.11\n\nGO_GET_PKGS := $(GO_GET_PKGS) \\\n\tgoogle.golang.org/protobuf/proto@$(PROTOC_GEN_GO_VERSION)\n\nPROTOC_GEN_GO := $(CACHE_VERSIONS)/protoc-gen-go/$(PROTOC_GEN_GO_VERSION)\n$(PROTOC_GEN_GO):\n\t@rm -f $(CACHE_BIN)/protoc-gen-go\n\tGOBIN=$(CACHE_BIN) go install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO_VERSION)\n\t@rm -rf $(dir $(PROTOC_GEN_GO))\n\t@mkdir -p $(dir $(PROTOC_GEN_GO))\n\t@touch $(PROTOC_GEN_GO)\n\ndockerdeps:: $(PROTOC_GEN_GO)\n"
  },
  {
    "path": "make/go/dep_yq.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _assert_var,UNAME_OS)\n$(call _assert_var,UNAME_ARCH)\n$(call _assert_var,CACHE_VERSIONS)\n$(call _assert_var,CACHE_BIN)\n\n# Settable\n# https://github.com/mikefarah/yq/releases 20240511 checked 20240524\nYQ_VERSION ?= v4.44.1\n\nifeq ($(UNAME_OS),Darwin)\nYQ_OS := darwin\nelse ifeq ($(UNAME_OS),Linux)\nYQ_OS := linux\nendif\n\nifeq ($(UNAME_ARCH),x86_64)\nYQ_ARCH := amd64\nelse ifeq ($(UNAME_ARCH),arm64)\nYQ_ARCH := arm64\nelse ifeq ($(UNAME_ARCH),aarch64)\nYQ_ARCH := arm64\nelse\nYQ_ARCH := $(UNAME_ARCH)\nendif\n\n\nYQ := $(CACHE_VERSIONS)/yq/$(YQ_VERSION)\n$(YQ):\n\t@rm -f $(CACHE_BIN)/yq\n\t@mkdir -p $(CACHE_BIN)\n\tcurl -sSL \\\n\t\thttps://github.com/mikefarah/yq/releases/download/$(YQ_VERSION)/yq_$(YQ_OS)_$(YQ_ARCH) \\\n\t\t-o $(CACHE_BIN)/yq\n\tchmod +x $(CACHE_BIN)/yq\n\t@rm -rf $(dir $(YQ))\n\t@mkdir -p $(dir $(YQ))\n\t@touch $(YQ)\n"
  },
  {
    "path": "make/go/docker.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n# Must be set\n$(call _assert_var,PROJECT)\n# Must be set\n$(call _assert_var,GO_MODULE)\n# Must be set\n$(call _assert_var,DOCKER_ORG)\n# Must be set\n$(call _assert_var,DOCKER_PROJECT)\n\n# Settable\nDOCKER_BINS ?=\n# Settable\nDOCKER_BUILD_EXTRA_FLAGS ?=\n\n.PHONY: dockerbuild\ndockerbuild::\n\ndefine dockerbinfunc\n# Settable\n$(1)_DOCKER_BUILD_EXTRA_FLAGS ?=\n\n.PHONY: dockerbuilddeps$(1)\ndockerbuilddeps$(1)::\n\n.PHONY: dockerbuild$(1)\ndockerbuild$(1): dockerbuilddeps$(1)\n\tdocker build $(DOCKER_BUILD_EXTRA_FLAGS) $($(1)_DOCKER_BUILD_EXTRA_FLAGS) -t $(DOCKER_ORG)/$(1):latest -f Dockerfile.$(1) .\nifdef EXTRA_DOCKER_ORG\n\tdocker tag $(DOCKER_ORG)/$(1):latest $(EXTRA_DOCKER_ORG)/$(1):latest\nendif\n\ndockerbuild:: dockerbuild$(1)\nendef\n\n$(foreach dockerbin,$(sort $(DOCKER_BINS)),$(eval $(call dockerbinfunc,$(dockerbin))))\n\n.PHONY: updatedockerignores\nupdatedockerignores:\n\t@rm -f .dockerignore\n\t@echo '# Autogenerated by makego. DO NOT EDIT.' > .dockerignore\n\t@$(foreach file_ignore,$(sort $(FILE_IGNORES)),echo $(file_ignore) >> .dockerignore || exit 1;)\n\t@$(foreach docker_file_ignore,$(sort $(DOCKER_FILE_IGNORES)),echo $(docker_file_ignore) >> .dockerignore || exit 1;)\n\npregenerate:: updatedockerignores\n"
  },
  {
    "path": "make/go/go.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,$(MAKEGO)/dep_bandeps.mk)\n$(call _conditional_include,$(MAKEGO)/dep_bufstyle.mk)\n$(call _conditional_include,$(MAKEGO)/dep_bufprivateusage.mk)\n$(call _conditional_include,$(MAKEGO)/dep_godoclint.mk)\n$(call _conditional_include,$(MAKEGO)/dep_golangci_lint.mk)\n$(call _conditional_include,$(MAKEGO)/dep_govulncheck.mk)\n$(call _conditional_include,$(MAKEGO)/dep_yq.mk)\n# Must be set\n$(call _assert_var,GO_MODULE)\n$(call _assert_var,GOLANGCI_LINT)\n$(call _assert_var,TMP)\n$(call _assert_var,OPEN_CMD)\n\n# Settable\nGO_BINS ?=\n# Settable\nGO_TEST_BINS ?=\n# Settable\nGO_TEST_WASM_BINS ?=\n# Settable\nGO_GET_PKGS ?=\n# Settable\nGO_MOD_VERSION ?= 1.25.0\n# Settable\nGO_MOD_TOOLCHAIN ?=\n# Settable\nGO_ALL_REPO_PKGS ?= ./cmd/... ./internal/...\n# Settable\nSKIP_BUFSTYLE ?=\n# Settable\nSKIP_GODOCLINT ?=\n# Settable\nSKIP_GOLANGCI_LINT ?=\n# Settable\nSKIP_GOVULNCHECK ?=\n# Settable\nDISALLOW_NOLINT ?=\n# Settable\nBUFPRIVATEUSAGE_PKGS ?=\n# Settable\nBANDEPS_CONFIG ?=\n\n# Runtime\nGOPKGS ?= $(GO_ALL_REPO_PKGS)\n# Runtime\nGOLANGCILINTTIMEOUT ?= 3m0s\n# Runtime GONOTESTCACHE\n# Runtime COVEROPEN\n\nCOVER_HTML := $(TMP)/cover.html\nCOVER_TXT := $(TMP)/cover.txt\n\nifdef GONOTESTCACHE\nGO_TEST_FLAGS := -count=1\nelse\nGO_TEST_FLAGS :=\nendif\n\n\n.DEFAULT_GOAL := shortall\n\n.PHONY: all\nall: ## Run make lint and make test.\n\t@$(MAKE) lint\n\t@$(MAKE) test\n\npostupgrade:: all\n\n.PHONY: shortall\nshortall: ## Run make shortlint and make shorttest.\n\t@$(MAKE) shortlint\n\t@$(MAKE) shorttest\n\n.PHONY: ci\nci:\n\t@$(MAKE) lint\n\t@$(MAKE) test\n\n.PHONY: postupgradegodeps\npostupgradegodeps::\n\n.PHONY: upgradegodeps\nupgradegodeps:\n\trm -f go.mod go.sum\n\tgo mod init $(GO_MODULE)\n\tgo mod edit -go=$(GO_MOD_VERSION)\nifneq ($(GO_MOD_TOOLCHAIN),)\n\tgo mod edit -toolchain=go$(GO_MOD_TOOLCHAIN)\nendif\nifneq ($(GO_GET_PKGS),)\n\tgo get $(GO_GET_PKGS)\nendif\n\tgo get -u -t $(GO_ALL_REPO_PKGS) $(GO_GET_PKGS)\n\tgo mod tidy -v\n\t@$(MAKE) postupgradegodeps\n\npreupgrade:: upgradegodeps\n\ninitmakego:: upgradegodeps\n\n.PHONY: godeps\ngodeps: deps\n\tgo mod download\n\n.PHONY: gofmtmodtidy\ngofmtmodtidy: $(GOLANGCI_LINT)\n\t@echo gofmt -s -w ALL_GO_FILES\n\t@gofmt -s -w .\n\tgo mod tidy -v\nifeq ($(SKIP_GOLANGCI_LINT),)\n\tgolangci-lint fmt\nendif\n\nformat:: gofmtmodtidy\n\nifneq ($(BUFPRIVATEUSAGE_PKGS),)\n.PHONY: bufprivateusage\nbufprivateusage: $(BUFPRIVATEUSAGE)\n\tbufprivateusage $(BUFPRIVATEUSAGE_PKGS)\n\npostprepostgenerate:: bufprivateusage\nendif\n\n.PHONY: checknolintlint\nchecknolintlint: $(YQ)\nifneq ($(DISALLOW_NOLINT),)\n\t@if grep -r --include \"*.go\" '//nolint'; then \\\n\t\techo '//nolint directives found, surface ignores in .golangci.yml instead' >&2; \\\n\t\texit 1; \\\n\tfi\nelse\n\tbash $(MAKEGO)/scripts/checknolintlint.bash\nendif\n\n.PHONY: bufstyle\nbufstyle: $(BUFSTYLE)\nifneq ($(SKIP_BUFSTYLE),)\n\t@echo Skipping bufstyle...\nelse\n\t@echo bufstyle GOPKGS\n\t@bufstyle $(GOPKGS)\nendif\n\n.PHONY: godoclint\ngodoclint: $(GODOCLINT)\nifneq ($(SKIP_GODOCLINT),)\n\t@echo Skipping godoclint...\nelse\n\t@echo godoclint GOPKGS\n\t@godoclint $(GOPKGS)\nendif\n\n.PHONY: golangcilint\ngolangcilint: $(GOLANGCI_LINT)\nifneq ($(SKIP_GOLANGCI_LINT),)\n\t@echo Skipping golangci-lint...\nelse\n\tgolangci-lint fmt --diff\n\tgolangci-lint run --timeout $(GOLANGCILINTTIMEOUT)\nendif\n\n.PHONY: govulncheck\ngovulncheck: $(GOVULNCHECK)\n\t@echo govulncheck GOPKGS\n\t@govulncheck $(GOPKGS)\n\n.PHONY: postlint\npostlint::\n\n.PHONY: postlonglint\npostlonglint::\n\nifneq ($(BANDEPS_CONFIG),)\n.PHONY: bandeps\nbandeps: $(BANDEPS)\n\tbandeps -f $(BANDEPS_CONFIG)\n\npostlonglint:: bandeps\nendif\n\n.PHONY: shortlint\nshortlint: ## Run all linters but exclude long-running linters.\n\t@$(MAKE) checknodiffgenerated\n\t@$(MAKE) checknolintlint bufstyle godoclint golangcilint govulncheck postlint\n\n.PHONY: lint\nlint: ## Run all linters.\n\t@$(MAKE) shortlint\n\t@$(MAKE) postlonglint\n\n.PHONY: prebuild\nprebuild::\n\n.PHONY: build\nbuild: prebuild ## Run go build.\n\tgo build ./...\n\n.PHONY: pretest\npretest::\n\n.PHONY: test\ntest: pretest installtest installtestwasm ## Run all go tests.\n\tgo test $(GO_TEST_FLAGS) $(GOPKGS)\n\n.PHONY: testrace\ntestrace: pretest installtest\n\tgo test -race $(GO_TEST_FLAGS) $(GOPKGS)\n\n.PHONY: shorttest\nshorttest: pretest installtest ## Run all go tests but exclude long-running tests.\n\tgo test -test.short $(GO_TEST_FLAGS) $(GOPKGS)\n\n.PHONY: deppkgs\ndeppkgs:\n\t@go list -f '{{join .Deps \"\\n\"}}' $(GOPKGS) | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'\n\n.PHONY: coverpkgs\ncoverpkgs:\n\t@go list $(GOPKGS) | grep -v \\/gen\\/ | tr '\\n' ',' | sed \"s/,$$//\"\n\n.PHONY: cover\ncover: pretest installtest\n\t@mkdir -p $(dir $(COVER_HTML)) $(dir $(COVER_TXT))\n\t@rm -f $(COVER_HTML) $(COVER_TXT)\n\tgo test -race -coverprofile=$(COVER_TXT) -coverpkg=$(shell GOPKGS=$(GOPKGS) $(MAKE) -s coverpkgs) $(GOPKGS)\n\t@go tool cover -html=$(COVER_TXT) -o $(COVER_HTML)\n\t@echo\n\t@go tool cover -func=$(COVER_TXT) | grep total\n\t@echo\nifndef COVEROPEN\n\t@echo $(OPEN_CMD) $(COVER_HTML)\nelse\n\t$(OPEN_CMD) $(COVER_HTML)\nendif\n\n.PHONY: install\ninstall:: ## Install all go binaries.\n\ndefine gobinfunc\n.PHONY: install$(notdir $(1))\ninstall$(notdir $(1)):\n\tgo install ./$(1)\n\ninstall:: install$(notdir $(1))\n\n.PHONY: lint$(notdir $(1))\nlint$(notdir $(1)):\n\tbash $(MAKEGO)/scripts/checkcmdpackage.bash ./$(1)\n\npostlint:: lint$(notdir $(1))\nendef\n\n$(foreach gobin,$(sort $(GO_BINS)),$(eval $(call gobinfunc,$(gobin))))\n$(foreach gobin,$(sort $(GO_BINS)),$(eval FILE_IGNORES := $(FILE_IGNORES) $(gobin)/$(notdir $(gobin))))\n\n.PHONY: installtest\ninstalltest::\n\ndefine gotestbinfunc\n.PHONY: installtest$(notdir $(1))\ninstalltest$(notdir $(1)):\n\tgo install ./$(1)\n\ninstalltest:: installtest$(notdir $(1))\nendef\n\n$(foreach gobin,$(sort $(GO_TEST_BINS)),$(eval $(call gotestbinfunc,$(gobin))))\n$(foreach gobin,$(sort $(GO_TEST_BINS)),$(eval FILE_IGNORES := $(FILE_IGNORES) $(gobin)/$(notdir $(gobin))))\n\n.PHONY: installtestwasm\ninstalltestwasm::\n\ndefine gotestwasmfunc\n.PHONY: installtestwasm$(notdir $(1))\ninstalltestwasm$(notdir $(1)):\n\tGOOS=wasip1 GOARCH=wasm go build -o $(GOBIN)/$(notdir $(1)).wasm ./$(1)\n\ninstalltestwasm:: installtestwasm$(notdir $(1))\nendef\n\n$(foreach gobin,$(sort $(GO_TEST_WASM_BINS)),$(eval $(call gotestwasmfunc,$(gobin))))\n$(foreach gobin,$(sort $(GO_TEST_WASM_BINS)),$(eval FILE_IGNORES := $(FILE_IGNORES) $(gobin)/$(notdir $(gobin))))\n"
  },
  {
    "path": "make/go/license_header.mk",
    "content": "# Managed by makego. DO NOT EDIT.\n\n# Must be set\n$(call _assert_var,MAKEGO)\n$(call _conditional_include,$(MAKEGO)/base.mk)\n$(call _conditional_include,make/go/dep_license_header.mk)\n$(call _conditional_include,make/go/dep_git_ls_files_unstaged.mk)\n\n# Must be set\n$(call _assert_var,LICENSE_HEADER_LICENSE_TYPE)\n# Must be set\n$(call _assert_var,LICENSE_HEADER_COPYRIGHT_HOLDER)\n# Must be set\n$(call _assert_var,LICENSE_HEADER_YEAR_RANGE)\n# Must be set\n$(call _assert_var,LICENSE_HEADER_IGNORES)\n\n.PHONY: licenseheader\nlicenseheader: $(LICENSE_HEADER) $(GIT_LS_FILES_UNSTAGED)\n\tgit-ls-files-unstaged | \\\n\t\tgrep -v $(patsubst %,-e %,$(sort $(LICENSE_HEADER_IGNORES))) | \\\n\t\txargs license-header \\\n\t\t\t--license-type \"$(LICENSE_HEADER_LICENSE_TYPE)\" \\\n\t\t\t--copyright-holder \"$(LICENSE_HEADER_COPYRIGHT_HOLDER)\" \\\n\t\t\t--year-range \"$(LICENSE_HEADER_YEAR_RANGE)\"\n\nlicensegenerate:: licenseheader\n"
  },
  {
    "path": "make/go/scripts/checkcmdpackage.bash",
    "content": "#!/usr/bin/env bash\n\n# Managed by makego. DO NOT EDIT.\n\n## checkcmdpackage exits with exit code 1 if the given package has any sub-packages that are not in internal\n##\n## Note that we would check to make sure that there are no exported types from main, but this is a builtin\n## feature of Go (you cannot export types from main to use in other packages)\n\nset -euo pipefail\n\nNON_INTERNAL_SUB_PACKAGES=\"$(go list \"${1}/...\" | grep -v ^$(go list \"${1}\")\\/internal)\"\nif [ \"${NON_INTERNAL_SUB_PACKAGES}\" != \"$(go list ${1})\" ]; then\n  echo \"${1} had non-sub-packages outside of ${1}/internal which is not allowed:\" >&2\n  echo \"${NON_INTERNAL_SUB_PACKAGES}\" >&2\n  exit 1\nfi\n"
  },
  {
    "path": "make/go/scripts/checknodiffgenerated.bash",
    "content": "#!/usr/bin/env bash\n\n# Managed by makego. DO NOT EDIT.\n\nset -euo pipefail\n\nSTATUS_SHORT_PRE_FILE=\"$(mktemp)\"\nSTATUS_SHORT_POST_FILE=\"$(mktemp)\"\nSTATUS_SHORT_DIFF_FILE=\"$(mktemp)\"\ntrap 'rm -rf \"${STATUS_SHORT_PRE_FILE}\" \"${STATUS_SHORT_POST_FILE}\" \"${STATUS_SHORT_DIFF_FILE}\"' EXIT\n\ngit status --short > \"${STATUS_SHORT_PRE_FILE}\"\n\"$@\"\ngit status --short > \"${STATUS_SHORT_POST_FILE}\"\nset +e\ndiff \"${STATUS_SHORT_PRE_FILE}\" \"${STATUS_SHORT_POST_FILE}\" > \"${STATUS_SHORT_DIFF_FILE}\"\nset -e\n\nif [ -s \"${STATUS_SHORT_DIFF_FILE}\" ]; then\n  echo \"error: $@ produced a diff,  make sure to check these in:\" >&2\n  grep '<\\|>' \"${STATUS_SHORT_DIFF_FILE}\" >&2\n  exit 1\nfi\n"
  },
  {
    "path": "make/go/scripts/checknolintlint.bash",
    "content": "#!/usr/bin/env bash\n\n# Managed by makego. DO NOT EDIT.\n\n## checknolintlint exits with exit code 0 if nolintlint is enabled and configured according to standards.\n## Otherwise, it exits with exit code 1.\n\nset -euo pipefail\n\nif [[ ! -f .golangci.yml ]]; then\n    echo \"nolintlint not enabled in .golangci.yml\" >&2\n    exit 1\nfi\n\n# Check if nolintlint linter is enabled in config\nNOLINTLINT_ENABLED=0\nif [[ `yq '.linters.enable // [] | any_c(. == \"nolintlint\")' .golangci.yml` == \"true\" ]]; then\n    # Enabled individually\n    NOLINTLINT_ENABLED=1\nelif [[ `yq '.linters.default' .golangci.yml` == \"all\" ]]; then\n    # Enabled with enable-all\n    NOLINTLINT_ENABLED=1\nfi\nif [ \"${NOLINTLINT_ENABLED}\" -eq 1 ]; then\n    # Ensure it isn't disabled individually\n    if [[ `yq '.linters.disable // [] | any_c(. == \"nolintlint\")' .golangci.yml` == \"true\" ]]; then\n        NOLINTLINT_ENABLED=0\n    fi\nfi\nif [ \"${NOLINTLINT_ENABLED}\" -eq 0 ]; then\n    echo \"nolintlint not enabled in .golangci.yml\" >&2\n    exit 1\nfi\n\n# Check if nolintlint is configured according to standards.\n#\n#   linters-settings:\n#     nolintlint:\n#       allow-unused: false\n#       allow-no-explanation: []\n#       require-explanation: true\n#       require-specific: true\n#\n\n# These values will be set below by the yq command (if set in the file).\nallow_unused=\nrequire_explanation=\nrequire_specific=\nallow_no_explanation_0=\n\neval $(yq --output-format shell '.linters.settings.nolintlint' .golangci.yml)\nif [[ \"${allow_unused}\" != \"false\" ]]; then\n    echo \".golangci.yml: nolintlint allow-unused must be set to false\" >&2\n    exit 1\nfi\nif [[ \"${require_explanation}\" != \"true\" ]]; then\n    echo \".golangci.yml: nolintlint require-explanation must be set to true\" >&2\n    exit 1\nfi\nif [[ \"${require_specific}\" != \"true\" ]]; then\n    echo \".golangci.yml: nolintlint require-specific must be set to true\" >&2\n    exit 1\nfi\nif [[ -n \"${allow_no_explanation_0}\" ]]; then\n    echo \".golangci.yml: nolintlint allow-no-explanation must be empty\" >&2\n    exit 1\nfi\n"
  },
  {
    "path": "make/go/scripts/githubactionmakeupgrade.bash",
    "content": "#!/usr/bin/env bash\n\n# Managed by makego. DO NOT EDIT.\n\nset -euo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/../../..\" && pwd)\"\ncd \"${DIR}\"\n\n# Ensure the following environment variables are set:\n: \"${GH_TOKEN}\" # However, if you are already logged in for GitHub CLI locally, you can remove this line when running it locally.\n\nmake upgrade\n\nif ! [[ $(git status --porcelain) ]]; then\n  echo \"No changes detected. Exiting.\"\n  exit 0\nfi\n\nDATE=$(date +\"%Y-%m-%d\")\nBRANCH=\"make-upgrade-${DATE}\"\ngit switch -C \"${BRANCH}\"\ngit add .\ngit commit -m \"Make upgrade\"\ngit push --set-upstream origin \"${BRANCH}\"\nPR_URL=$(gh pr create --title \"Make upgrade\" --body \"Created on ${DATE}.\" --base main --head \"${BRANCH}\")\necho \"Pull request created: ${PR_URL}\"\n"
  },
  {
    "path": "make/go/scripts/pushall.bash",
    "content": "#!/usr/bin/env bash\n\n# Managed by makego. DO NOT EDIT.\n\nset -eo pipefail\n\nfail() {\n  echo \"error: $@\" >&2\n  exit 1\n}\n\nSYSTEM_GIT=\"$(command -v git)\"\n\ngit() {\n  if ! \"${SYSTEM_GIT}\" rev-parse --git-dir 2>/dev/null >/dev/null; then\n    echo \"fatal: not a git repository (or any of the parent directories)\" >&2\n    return 1\n  fi\n  if [ -n \"${GIT_USER_NAME}\" ] && [ -n \"${GIT_USER_EMAIL}\" ]; then\n    \"${SYSTEM_GIT}\" -c \"user.name=${GIT_USER_NAME}\" -c \"user.email=${GIT_USER_EMAIL}\" \"$@\"\n  else\n    \"${SYSTEM_GIT}\" \"$@\"\n  fi\n}\n\nif [ -z \"${1}\" ]; then\n  fail \"Usage: ${0} path/to/git/clone\"\nfi\n\ncd \"${1}\"\n\ngit add --all .\ngit status\ngit diff main\nif [ -z \"$(git status -s)\" ]; then\n  echo \"Nothing to copy, exiting.\" >&2\n  exit 0\nfi\n\nwhile true; do\n  read -p \"Do you want to commit and push all files [y/n]: \" push_all\n  case \"${push_all}\" in\n    [Yy] )\n      while true; do\n        read -p \"Enter commit message: \" commit_message\n        read -p \"Is \\\"${commit_message}\\\" correct [y/n]: \" correct\n        case \"${correct}\" in\n          [Yy] )\n            git commit -am \"${commit_message}\"\n            git push origin main\n            break\n            ;;\n          [Nn] )\n            echo \"Aborting.\"\n            exit 1\n            ;;\n          * )\n            echo \"Please answer yes or no.\"\n            ;;\n        esac\n      done\n      break\n      ;;\n    [Nn] )\n      echo \"Aborting.\"\n      exit 1\n      ;;\n    * )\n      echo \"Please answer yes or no.\"\n      ;;\n  esac\ndone\n"
  },
  {
    "path": "private/README.md",
    "content": "# Package structure\n\n- `private/pkg` contains utility packages that are not Buf-company-specific. In theory, any of these packages could be split into a separate repository in the future, and not depend on Buf types or concepts.\n- `private/bufpkg` contains utility packages that *are* Buf-company-specific, but not specific to github.com/bufbuild/buf. These packages could be split into separate repositories in the future.\n- `private/buf` contains packages specific to github.com/bufbuild/buf. In other repositories, this should be named after that specific repository, for example `github.com/bufbuild/foo` would contain `private/foo`.\n\nThere's a strict dependency graph imposed at this level:\n\n- `cmd/{binary}` packages must be `main` packages, and any sub-packages must be `internal`. `cmd/{binary}` packages can import from any `private` package.\n- `private/buf` packages can import from `private/bufpkg` and `private/pkg` packages, but not `cmd` packages.\n- `private/bufpkg` packages can import from `private/pkg` packages, but not `cmd` or `private/bufpkg` packages.\n- `private/pkg` packages can only import from other `private/pkg` packages.\n\nThat is, the ordering is strictly `cmd -> private/buf -> private/bufpkg -> private/pkg`. This is enforced by linting tools.\n"
  },
  {
    "path": "private/buf/bufapp/bufapp.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufapp\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/pkg/cert/certclient\"\n)\n\nconst currentVersion = \"v1\"\n\n// ExternalConfig is an external config.\ntype ExternalConfig struct {\n\t// If editing ExternalConfig, make sure to update ExternalConfig.IsEmpty!\n\n\tVersion string                             `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tTLS     certclient.ExternalClientTLSConfig `json:\"tls\" yaml:\"tls,omitempty\"`\n}\n\n// IsEmpty returns true if the externalConfig is empty.\nfunc (e ExternalConfig) IsEmpty() bool {\n\treturn e.Version == \"\" && e.TLS.IsEmpty()\n}\n\n// Config is a config.\ntype Config struct {\n\tTLS *tls.Config\n}\n\n// NewConfig returns a new Config for the ExternalConfig.\nfunc NewConfig(\n\tcontainer appext.NameContainer,\n\texternalConfig ExternalConfig,\n) (*Config, error) {\n\tif externalConfig.Version != currentVersion && !externalConfig.IsEmpty() {\n\t\treturn nil, fmt.Errorf(\"buf configuration at %q must declare 'version: %s'\", container.ConfigDirPath(), currentVersion)\n\t}\n\ttlsConfig, err := certclient.NewClientTLSConfig(container, externalConfig.TLS)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Config{\n\t\tTLS: tlsConfig,\n\t}, nil\n}\n"
  },
  {
    "path": "private/buf/bufapp/bufapp_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufapp\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestExternalConfigIsEmpty(t *testing.T) {\n\tt.Parallel()\n\tassert.True(t, ExternalConfig{}.IsEmpty())\n}\n"
  },
  {
    "path": "private/buf/bufapp/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufapp\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufcli/buf_work_yaml_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n)\n\n// GetBufWorkYAMLFileForDirPath gets the buf.work.yaml file for the directory path.\nfunc GetBufWorkYAMLFileForDirPath(\n\tctx context.Context,\n\tdirPath string,\n) (bufconfig.BufWorkYAMLFile, error) {\n\tbucket, err := newOSReadWriteBucketWithSymlinks(dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.GetBufWorkYAMLFileForPrefix(ctx, bucket, \".\")\n}\n"
  },
  {
    "path": "private/buf/bufcli/buf_yaml_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\n// GetBufYAMLFileForDirPathOrOverride get the buf.yaml file for either the usually-flag-based\n// override, or if the override is not set, the directory path.\nfunc GetBufYAMLFileForDirPathOrOverride(\n\tctx context.Context,\n\tdirPath string,\n\toverride string,\n) (bufconfig.BufYAMLFile, error) {\n\tbucket, err := newOSReadWriteBucketWithSymlinks(dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.GetBufYAMLFileForPrefixOrOverride(ctx, bucket, \".\", override)\n}\n\n// GetBufYAMLFileForDirPath gets the buf.yaml file for the directory path.\nfunc GetBufYAMLFileForDirPath(\n\tctx context.Context,\n\tdirPath string,\n) (bufconfig.BufYAMLFile, error) {\n\tbucket, err := newOSReadWriteBucketWithSymlinks(dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.GetBufYAMLFileForPrefix(ctx, bucket, \".\")\n}\n\n// PutBufYAMLFileForDirPath write the buf.yaml file to the directory path.\nfunc PutBufYAMLFileForDirPath(\n\tctx context.Context,\n\tdirPath string,\n\tbufYAMLFile bufconfig.BufYAMLFile,\n) error {\n\tbucket, err := newOSReadWriteBucketWithSymlinks(dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn bufconfig.PutBufYAMLFileForPrefix(ctx, bucket, \".\", bufYAMLFile)\n}\n\n// BufYAMLFileExistsForDirPath returns true if the buf.yaml file exists at the dir path.\nfunc BufYAMLFileExistsForDirPath(\n\tctx context.Context,\n\tdirPath string,\n) (bool, error) {\n\tbucket, err := newOSReadWriteBucketWithSymlinks(dirPath)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif _, err := bufconfig.GetBufYAMLFileVersionForPrefix(ctx, bucket, \".\"); err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\nfunc newOSReadWriteBucketWithSymlinks(dirPath string) (storage.ReadWriteBucket, error) {\n\treturn storageos.NewProvider(\n\t\tstorageos.ProviderWithSymlinks(),\n\t).NewReadWriteBucket(\n\t\tdirPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n}\n"
  },
  {
    "path": "private/buf/bufcli/bufcli.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\n// Version is the CLI version of buf.\nconst Version = \"1.66.2-dev\"\n"
  },
  {
    "path": "private/buf/bufcli/cache.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufwkt/bufwktstore\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestore\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugincache\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginstore\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicycache\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicystore\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/filelock\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n)\n\nvar (\n\t// AllCacheRelDirPaths are all directory paths for all time\n\t// concerning the module and plugin caches.\n\t//\n\t// These are normalized.\n\t// These are relative to container.CacheDirPath().\n\t//\n\t// This variable is used for clearing the cache.\n\tAllCacheRelDirPaths = []string{\n\t\tv1CacheModuleDataRelDirPath,\n\t\tv1CacheModuleLockRelDirPath,\n\t\tv1CacheModuleSumRelDirPath,\n\t\tv1beta1CacheModuleDataRelDirPath,\n\t\tv1beta1CacheModuleLockRelDirPath,\n\t\tv2CacheModuleRelDirPath,\n\t\tv3CacheCommitLockRelDirPath,\n\t\tv3CacheCommitsRelDirPath,\n\t\tv3CacheModuleLockRelDirPath,\n\t\tv3CacheModuleRelDirPath,\n\t\tv3CachePluginRelDirPath,\n\t\tv3CachePolicyRelDirPath,\n\t\tv3CacheWKTRelDirPath,\n\t\tv3CacheWasmRuntimeRelDirPath,\n\t}\n\n\t// v1CacheModuleDataRelDirPath is the relative path to the cache directory where module data\n\t// was stored in v1beta1.\n\t//\n\t// Normalized.\n\tv1beta1CacheModuleDataRelDirPath = \"mod\"\n\t// v1CacheModuleLockRelDirPath is the relative path to the cache directory where module lock files\n\t// were stored in v1beta1.\n\t//\n\t// Normalized.\n\tv1beta1CacheModuleLockRelDirPath = normalpath.Join(\"lock\", \"mod\")\n\t// v1CacheModuleDataRelDirPath is the relative path to the cache directory where module data is stored.\n\t//\n\t// Normalized.\n\t// This is where the actual \"clones\" of the modules are located.\n\tv1CacheModuleDataRelDirPath = normalpath.Join(\"v1\", \"module\", \"data\")\n\t// v1CacheModuleLockRelDirPath is the relative path to the cache directory where module lock files are stored.\n\t//\n\t// Normalized.\n\t// These lock files are used to make sure that multiple buf processes do not corrupt the cache.\n\tv1CacheModuleLockRelDirPath = normalpath.Join(\"v1\", \"module\", \"lock\")\n\t// v1CacheModuleSumRelDirPath is the relative path to the cache directory where module digests are stored.\n\t//\n\t// Normalized.\n\t// These digests are used to make sure that the data written is actually what we expect, and if it is not,\n\t// we clear an entry from the cache, i.e. delete the relevant data directory.\n\tv1CacheModuleSumRelDirPath = normalpath.Join(\"v1\", \"module\", \"sum\")\n\t// v2CacheModuleRelDirPath is the relative path to the cache directory for content addressable storage.\n\t//\n\t// Normalized.\n\t// This directory replaces the use of v1CacheModuleDataRelDirPath, v1CacheModuleLockRelDirPath, and\n\t// v1CacheModuleSumRelDirPath with a cache implementation using content addressable storage.\n\tv2CacheModuleRelDirPath = normalpath.Join(\"v2\", \"module\")\n\t// v3CacheModuleRelDirPath is the relative path to the files cache directory in its newest iteration.\n\t//\n\t// Normalized.\n\tv3CacheModuleRelDirPath = normalpath.Join(\"v3\", \"modules\")\n\t// v3CacheCommitsRelDirPath is the relative path to the commits cache directory in its newest iteration.\n\t//\n\t// Normalized.\n\tv3CacheCommitsRelDirPath = normalpath.Join(\"v3\", \"commits\")\n\t// v3CacheWKTRelDirPath is the relative path to the well-known types cache directory in its newest iteration.\n\t//\n\t// Normalized.\n\tv3CacheWKTRelDirPath = normalpath.Join(\"v3\", \"wellknowntypes\")\n\t// v3CacheModuleLockRelDirPath is the relative path to the lock files directory for module data.\n\t// This directory is used to store lock files for synchronizing reading and writing module data from the cache.\n\t//\n\t// Normalized.\n\tv3CacheModuleLockRelDirPath = normalpath.Join(\"v3\", \"modulelocks\")\n\t// v3CacheCommitLockRelDirPath is the relative path to the lock files directory for commit data.\n\t// This directory is used to store lock files for synchronizing reading and writing commit data from the cache.\n\t//\n\t// Normalized.\n\tv3CacheCommitLockRelDirPath = normalpath.Join(\"v3\", \"commitlocks\")\n\t// v3CachePluginRelDirPath is the relative path to the files cache directory in its newest iteration.\n\t//\n\t// Normalized.\n\tv3CachePluginRelDirPath = normalpath.Join(\"v3\", \"plugins\")\n\t// v3CacheWasmRuntimeRelDirPath is the relative path to the Wasm runtime cache directory in its newest iteration.\n\t// This directory is used to store the Wasm runtime cache. This is an implementation specific cache and opaque outside of the runtime.\n\t//\n\t// Normalized.\n\tv3CacheWasmRuntimeRelDirPath = normalpath.Join(\"v3\", \"wasmruntime\")\n\t// v3CachePolicyRelDirPath is the relative path to the files cache directory in its newest iteration.\n\t//\n\t// Normalized.\n\tv3CachePolicyRelDirPath = normalpath.Join(\"v3\", \"policies\")\n)\n\n// NewModuleDataProvider returns a new ModuleDataProvider while creating the\n// required cache directories.\nfunc NewModuleDataProvider(container appext.Container) (bufmodule.ModuleDataProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newModuleDataProvider(\n\t\tcontainer,\n\t\tbufregistryapimodule.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t\tbufregistryapiowner.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t)\n}\n\n// NewCommitProvider returns a new CommitProvider while creating the\n// required cache directories.\nfunc NewCommitProvider(container appext.Container) (bufmodule.CommitProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newCommitProvider(\n\t\tcontainer,\n\t\tbufregistryapimodule.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t\tbufregistryapiowner.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t)\n}\n\n// NewPluginDataProvider returns a new PluginDataProvider while creating the\n// required cache directories.\nfunc NewPluginDataProvider(container appext.Container) (bufplugin.PluginDataProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newPluginDataProvider(\n\t\tcontainer,\n\t\tbufregistryapiplugin.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t)\n}\n\n// NewPolicyDataProvider returns a new PolicyDataProvider while creating the\n// required cache directories.\nfunc NewPolicyDataProvider(container appext.Container) (bufpolicy.PolicyDataProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newPolicyDataProvider(\n\t\tcontainer,\n\t\tbufregistryapipolicy.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t)\n}\n\n// NewWasmRuntime returns a new Wasm runtime while creating the required cache\n// directories.\nfunc NewWasmRuntime(ctx context.Context, container appext.Container) (wasm.Runtime, error) {\n\t// This is used by the Wasm runtime to cache compiled Wasm plugins. This is an\n\t// implementation specific cache and opaque outside of the runtime. The runtime\n\t// will manage the cache versioning itself within this directory.\n\tif err := createCacheDir(container.CacheDirPath(), v3CacheWasmRuntimeRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfullCacheDirPath := normalpath.Join(container.CacheDirPath(), v3CacheWasmRuntimeRelDirPath)\n\twasmRuntime, err := wasm.NewRuntime(ctx, wasm.WithLocalCacheDir(fullCacheDirPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn wasmRuntime, nil\n}\n\n// NewWKTStore returns a new bufwktstore.Store while creating the required cache directories.\nfunc NewWKTStore(container appext.Container) (bufwktstore.Store, error) {\n\tif err := createCacheDir(container.CacheDirPath(), v3CacheWKTRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfullCacheDirPath := normalpath.Join(container.CacheDirPath(), v3CacheWKTRelDirPath)\n\t// No symlinks.\n\tstorageosProvider := storageos.NewProvider()\n\tcacheBucket, err := storageosProvider.NewReadWriteBucket(fullCacheDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufwktstore.NewStore(\n\t\tcontainer.Logger(),\n\t\tcacheBucket,\n\t), nil\n}\n\nfunc newModuleDataProvider(\n\tcontainer appext.Container,\n\tmoduleClientProvider bufregistryapimodule.ClientProvider,\n\townerClientProvider bufregistryapiowner.ClientProvider,\n) (bufmodule.ModuleDataProvider, error) {\n\tif err := createCacheDir(container.CacheDirPath(), v3CacheModuleRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfullCacheDirPath := normalpath.Join(container.CacheDirPath(), v3CacheModuleRelDirPath)\n\tdelegateModuleDataProvider := bufmoduleapi.NewModuleDataProvider(\n\t\tcontainer.Logger(),\n\t\tmoduleClientProvider,\n\t\tnewGraphProvider(container, moduleClientProvider, ownerClientProvider),\n\t)\n\t// No symlinks.\n\tstorageosProvider := storageos.NewProvider()\n\tcacheBucket, err := storageosProvider.NewReadWriteBucket(fullCacheDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := createCacheDir(container.CacheDirPath(), v3CacheModuleLockRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfilelocker, err := filelock.NewLocker(normalpath.Join(container.CacheDirPath(), v3CacheModuleLockRelDirPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmodulecache.NewModuleDataProvider(\n\t\tcontainer.Logger(),\n\t\tdelegateModuleDataProvider,\n\t\tbufmodulestore.NewModuleDataStore(\n\t\t\tcontainer.Logger(),\n\t\t\tcacheBucket,\n\t\t\tfilelocker,\n\t\t),\n\t), nil\n}\n\nfunc newCommitProvider(\n\tcontainer appext.Container,\n\tmoduleClientProvider bufregistryapimodule.ClientProvider,\n\townerClientProvider bufregistryapiowner.ClientProvider,\n) (bufmodule.CommitProvider, error) {\n\tif err := createCacheDir(container.CacheDirPath(), v3CacheCommitsRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfullCacheDirPath := normalpath.Join(container.CacheDirPath(), v3CacheCommitsRelDirPath)\n\tdelegateReader := bufmoduleapi.NewCommitProvider(container.Logger(), moduleClientProvider, ownerClientProvider)\n\t// No symlinks.\n\tstorageosProvider := storageos.NewProvider()\n\tcacheBucket, err := storageosProvider.NewReadWriteBucket(fullCacheDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := createCacheDir(container.CacheDirPath(), v3CacheCommitLockRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfilelocker, err := filelock.NewLocker(normalpath.Join(container.CacheDirPath(), v3CacheCommitLockRelDirPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmodulecache.NewCommitProvider(\n\t\tcontainer.Logger(),\n\t\tdelegateReader,\n\t\tbufmodulestore.NewCommitStore(\n\t\t\tcontainer.Logger(),\n\t\t\tcacheBucket,\n\t\t\tfilelocker,\n\t\t),\n\t), nil\n}\n\nfunc newPluginDataProvider(\n\tcontainer appext.Container,\n\tpluginClientProvider bufregistryapiplugin.ClientProvider,\n) (bufplugin.PluginDataProvider, error) {\n\tif err := createCacheDir(container.CacheDirPath(), v3CachePluginRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfullCacheDirPath := normalpath.Join(container.CacheDirPath(), v3CachePluginRelDirPath)\n\tstorageosProvider := storageos.NewProvider() // No symlinks.\n\tcacheBucket, err := storageosProvider.NewReadWriteBucket(fullCacheDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdelegateModuleDataProvider := bufpluginapi.NewPluginDataProvider(\n\t\tcontainer.Logger(),\n\t\tpluginClientProvider,\n\t)\n\treturn bufplugincache.NewPluginDataProvider(\n\t\tcontainer.Logger(),\n\t\tdelegateModuleDataProvider,\n\t\tbufpluginstore.NewPluginDataStore(\n\t\t\tcontainer.Logger(),\n\t\t\tcacheBucket,\n\t\t),\n\t), nil\n}\n\nfunc newPolicyDataProvider(\n\tcontainer appext.Container,\n\tpolicyClientProvider bufregistryapipolicy.ClientProvider,\n) (bufpolicy.PolicyDataProvider, error) {\n\tif err := createCacheDir(container.CacheDirPath(), v3CachePolicyRelDirPath); err != nil {\n\t\treturn nil, err\n\t}\n\tfullCacheDirPath := normalpath.Join(container.CacheDirPath(), v3CachePolicyRelDirPath)\n\tstorageosProvider := storageos.NewProvider() // No symlinks.\n\tcacheBucket, err := storageosProvider.NewReadWriteBucket(fullCacheDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdelegateModuleDataProvider := bufpolicyapi.NewPolicyDataProvider(\n\t\tcontainer.Logger(),\n\t\tpolicyClientProvider,\n\t)\n\treturn bufpolicycache.NewPolicyDataProvider(\n\t\tcontainer.Logger(),\n\t\tdelegateModuleDataProvider,\n\t\tbufpolicystore.NewPolicyDataStore(\n\t\t\tcontainer.Logger(),\n\t\t\tcacheBucket,\n\t\t),\n\t), nil\n}\n\nfunc createCacheDir(baseCacheDirPath string, relDirPath string) error {\n\tbaseCacheDirPath = normalpath.Unnormalize(baseCacheDirPath)\n\trelDirPath = normalpath.Unnormalize(relDirPath)\n\tfullDirPath := filepath.Join(baseCacheDirPath, relDirPath)\n\t// OK to use os.Stat instead of os.LStat here as this is CLI-only\n\tfileInfo, err := os.Stat(fullDirPath)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn os.MkdirAll(fullDirPath, 0755)\n\t\t}\n\t\treturn err\n\t}\n\tif !fileInfo.IsDir() {\n\t\treturn fmt.Errorf(\n\t\t\t\"Expected %q to be a directory. This is used for buf's cache. \"+\n\t\t\t\t\"You can override the base cache directory %q by setting the $BUF_CACHE_DIR environment variable.\",\n\t\t\tfullDirPath,\n\t\t\tbaseCacheDirPath,\n\t\t)\n\t}\n\tif fileInfo.Mode().Perm()&0700 != 0700 {\n\t\treturn fmt.Errorf(\n\t\t\t\"Expected %q to be a writeable directory. This is used for buf's cache. \"+\n\t\t\t\t\"You can override the base cache directory %q by setting the $BUF_CACHE_DIR environment variable.\",\n\t\t\tfullDirPath,\n\t\t\tbaseCacheDirPath,\n\t\t)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/bufcli/config_ignore_yaml.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"sort\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n)\n\n// AllLintFormatStrings are all format strings for lint.\nvar AllLintFormatStrings = append(\n\tbufanalysis.AllFormatStrings,\n\t\"config-ignore-yaml\",\n)\n\n// PrintFileAnnotationSetLintConfigIgnoreYAMLV1 prints the FileAnnotationSet to the Writer\n// for the lint config-ignore-yaml format.\n//\n// TODO FUTURE: This is messed.\nfunc PrintFileAnnotationSetLintConfigIgnoreYAMLV1(\n\twriter io.Writer,\n\tfileAnnotationSet bufanalysis.FileAnnotationSet,\n) error {\n\tignoreIDToPathMap := make(map[string]map[string]struct{})\n\tfor _, fileAnnotation := range fileAnnotationSet.FileAnnotations() {\n\t\tfileInfo := fileAnnotation.FileInfo()\n\t\tif fileInfo == nil || fileAnnotation.Type() == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tpathMap, ok := ignoreIDToPathMap[fileAnnotation.Type()]\n\t\tif !ok {\n\t\t\tpathMap = make(map[string]struct{})\n\t\t\tignoreIDToPathMap[fileAnnotation.Type()] = pathMap\n\t\t}\n\t\tpathMap[fileInfo.Path()] = struct{}{}\n\t}\n\tif len(ignoreIDToPathMap) == 0 {\n\t\treturn nil\n\t}\n\n\tsortedIgnoreIDs := make([]string, 0, len(ignoreIDToPathMap))\n\tignoreIDToSortedPaths := make(map[string][]string, len(ignoreIDToPathMap))\n\tfor id, pathMap := range ignoreIDToPathMap {\n\t\tsortedIgnoreIDs = append(sortedIgnoreIDs, id)\n\t\tpaths := make([]string, 0, len(pathMap))\n\t\tfor path := range pathMap {\n\t\t\tpaths = append(paths, path)\n\t\t}\n\t\tsort.Strings(paths)\n\t\tignoreIDToSortedPaths[id] = paths\n\t}\n\tsort.Strings(sortedIgnoreIDs)\n\n\tbuffer := bytes.NewBuffer(nil)\n\t_, _ = buffer.WriteString(`version: v1\nlint:\n  ignore_only:\n`)\n\tfor _, id := range sortedIgnoreIDs {\n\t\t_, _ = buffer.WriteString(\"    \")\n\t\t_, _ = buffer.WriteString(id)\n\t\t_, _ = buffer.WriteString(\":\\n\")\n\t\tfor _, rootPath := range ignoreIDToSortedPaths[id] {\n\t\t\t_, _ = buffer.WriteString(\"      - \")\n\t\t\t_, _ = buffer.WriteString(rootPath)\n\t\t\t_, _ = buffer.WriteString(\"\\n\")\n\t\t}\n\t}\n\t_, err := writer.Write(buffer.Bytes())\n\treturn err\n}\n"
  },
  {
    "path": "private/buf/bufcli/connectclient_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\totelconnect \"connectrpc.com/otelconnect\"\n\t\"github.com/bufbuild/buf/private/buf/bufapp\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconnect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/buftransport\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n\t\"github.com/bufbuild/buf/private/pkg/transport/http/httpclient\"\n)\n\n// NewConnectClientConfig creates a new connect.ClientConfig which uses a token reader to look\n// up the token in the container or in netrc based on the address of each individual client.\n// It is then set in the header of all outgoing requests from clients created using this config.\nfunc NewConnectClientConfig(container appext.Container) (*connectclient.Config, error) {\n\tenvTokenProvider, err := bufconnect.NewTokenProviderFromContainer(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnetrcTokenProvider := bufconnect.NewNetrcTokenProvider(container, netrc.GetMachineForName)\n\treturn newConnectClientConfigWithOptions(\n\t\tcontainer,\n\t\tconnectclient.WithAuthInterceptorProvider(\n\t\t\tbufconnect.NewAuthorizationInterceptorProvider(envTokenProvider, netrcTokenProvider),\n\t\t),\n\t)\n}\n\n// NewConnectClientConfigWithToken creates a new connect.ClientConfig with a given token. The provided token is\n// set in the header of all outgoing requests from this provider\nfunc NewConnectClientConfigWithToken(container appext.Container, token string) (*connectclient.Config, error) {\n\ttokenProvider, err := bufconnect.NewTokenProviderFromString(token)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newConnectClientConfigWithOptions(\n\t\tcontainer,\n\t\tconnectclient.WithAuthInterceptorProvider(\n\t\t\tbufconnect.NewAuthorizationInterceptorProvider(tokenProvider),\n\t\t),\n\t)\n}\n\n// Returns a registry provider with the given options applied in addition to default ones for all providers\nfunc newConnectClientConfigWithOptions(container appext.Container, opts ...connectclient.ConfigOption) (*connectclient.Config, error) {\n\tconfig, err := newConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\totelconnectInterceptor, err := otelconnect.NewInterceptor()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclient := httpclient.NewClient(config.TLS)\n\toptions := []connectclient.ConfigOption{\n\t\tconnectclient.WithAddressMapper(func(address string) string {\n\t\t\tif config.TLS == nil {\n\t\t\t\treturn buftransport.PrependHTTP(address)\n\t\t\t}\n\t\t\treturn buftransport.PrependHTTPS(address)\n\t\t}),\n\t\tconnectclient.WithInterceptors(\n\t\t\t[]connect.Interceptor{\n\t\t\t\tbufconnect.NewAugmentedConnectErrorInterceptor(),\n\t\t\t\tbufconnect.NewSetCLIVersionInterceptor(Version),\n\t\t\t\tbufconnect.NewCLIWarningInterceptor(container),\n\t\t\t\tbufconnect.NewDebugLoggingInterceptor(container),\n\t\t\t\totelconnectInterceptor,\n\t\t\t},\n\t\t),\n\t}\n\treturn connectclient.NewConfig(client, append(options, opts...)...), nil\n}\n\n// newConfig creates a new Config.\nfunc newConfig(container appext.Container) (*bufapp.Config, error) {\n\texternalConfig := bufapp.ExternalConfig{}\n\tif err := appext.ReadConfig(container, &externalConfig); err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufapp.NewConfig(container, externalConfig)\n}\n"
  },
  {
    "path": "private/buf/bufcli/controller.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n)\n\n// NewController returns a new Controller.\nfunc NewController(\n\tcontainer appext.Container,\n\toptions ...bufctl.ControllerOption,\n) (bufctl.Controller, error) {\n\tif container.Env(copyToInMemoryEnvKey) != \"\" {\n\t\toptions = append(\n\t\t\toptions,\n\t\t\tbufctl.WithCopyToInMemory(),\n\t\t)\n\t}\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmoduleClientProvider := bufregistryapimodule.NewClientProvider(clientConfig)\n\townerClientProvider := bufregistryapiowner.NewClientProvider(clientConfig)\n\tpluginClientProvider := bufregistryapiplugin.NewClientProvider(clientConfig)\n\tpolicyClientProvider := bufregistryapipolicy.NewClientProvider(clientConfig)\n\tmoduleDataProvider, err := newModuleDataProvider(container, moduleClientProvider, ownerClientProvider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitProvider, err := newCommitProvider(container, moduleClientProvider, ownerClientProvider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginDataProvider, err := newPluginDataProvider(container, pluginClientProvider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyDataProvider, err := newPolicyDataProvider(container, policyClientProvider)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\twktStore, err := NewWKTStore(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufctl.NewController(\n\t\tcontainer.Logger(),\n\t\tcontainer,\n\t\tnewGraphProvider(container, moduleClientProvider, ownerClientProvider),\n\t\tbufmoduleapi.NewModuleKeyProvider(container.Logger(), moduleClientProvider),\n\t\tmoduleDataProvider,\n\t\tcommitProvider,\n\t\tbufpluginapi.NewPluginKeyProvider(container.Logger(), pluginClientProvider),\n\t\tpluginDataProvider,\n\t\tbufpolicyapi.NewPolicyKeyProvider(container.Logger(), policyClientProvider),\n\t\tpolicyDataProvider,\n\t\twktStore,\n\t\t// TODO FUTURE: Delete defaultHTTPClient and use the one from newConfig\n\t\tdefaultHTTPClient,\n\t\tdefaultHTTPAuthenticator,\n\t\tdefaultGitClonerOptions,\n\t\toptions...,\n\t)\n}\n"
  },
  {
    "path": "private/buf/bufcli/env.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n)\n\nconst (\n\tinputHTTPSUsernameEnvKey      = \"BUF_INPUT_HTTPS_USERNAME\"\n\tinputHTTPSPasswordEnvKey      = \"BUF_INPUT_HTTPS_PASSWORD\"\n\tinputSSHKeyFileEnvKey         = \"BUF_INPUT_SSH_KEY_FILE\"\n\tinputSSHKnownHostsFilesEnvKey = \"BUF_INPUT_SSH_KNOWN_HOSTS_FILES\"\n\n\talphaSuppressWarningsEnvKey = \"BUF_ALPHA_SUPPRESS_WARNINGS\"\n\tbetaSuppressWarningsEnvKey  = \"BUF_BETA_SUPPRESS_WARNINGS\"\n\n\t// This is actually much slower with how it is currently implemented if you use --path.\n\t// Example: Build a repo with 1000 .proto files, but filter to a single path. As this is\n\t// implemented now, all 1000 .proto file are copied. You could get smarter with caching\n\t// at a per-file level.\n\tcopyToInMemoryEnvKey = \"BUF_BETA_COPY_FILES_TO_MEMORY\"\n\n\t// This should only be used for testing. This is not part of Buf's API, and should\n\t// never be documented or part of Buf's contract.\n\tlegacyFederationRegistryEnvKey = \"BUF_TESTING_LEGACY_FEDERATION_REGISTRY\"\n\t// This should only be used for testing. This is not part of Buf's API, and should\n\t// never be documented or part of Buf's contract.\n\tpublicRegistryEnvKey = \"BUF_TESTING_PUBLIC_REGISTRY\"\n)\n\nvar (\n\t// defaultHTTPClient is the client we use for HTTP requests.\n\t// Timeout should be set through context for calls to ImageConfigReader, not through http.Client\n\tdefaultHTTPClient = &http.Client{}\n\t// defaultHTTPAuthenticator is the default authenticator\n\t// used for HTTP requests.\n\tdefaultHTTPAuthenticator = httpauth.NewMultiAuthenticator(\n\t\thttpauth.NewNetrcAuthenticator(),\n\t\t// must keep this for legacy purposes\n\t\thttpauth.NewEnvAuthenticator(\n\t\t\tinputHTTPSPasswordEnvKey,\n\t\t\tinputHTTPSPasswordEnvKey,\n\t\t),\n\t)\n\t// defaultGitClonerOptions defines the default git clone options.\n\tdefaultGitClonerOptions = git.ClonerOptions{\n\t\tHTTPSUsernameEnvKey:      inputHTTPSUsernameEnvKey,\n\t\tHTTPSPasswordEnvKey:      inputHTTPSPasswordEnvKey,\n\t\tSSHKeyFileEnvKey:         inputSSHKeyFileEnvKey,\n\t\tSSHKnownHostsFilesEnvKey: inputSSHKnownHostsFilesEnvKey,\n\t}\n)\n\n// WarnAlphaCommand prints a warning for a alpha command unless the alphaSuppressWarningsEnvKey\n// environment variable is set.\nfunc WarnAlphaCommand(_ context.Context, container appext.Container) {\n\tif container.Env(alphaSuppressWarningsEnvKey) == \"\" {\n\t\tcontainer.Logger().Warn(\"This command is in alpha. It is hidden for a reason. This command is purely for development purposes, and may never even be promoted to beta, do not rely on this command's functionality. To suppress this warning, set \" + alphaSuppressWarningsEnvKey + \"=1\")\n\t}\n}\n\n// WarnBetaCommand prints a warning for a beta command unless the betaSuppressWarningsEnvKey\n// environment variable is set.\nfunc WarnBetaCommand(_ context.Context, container appext.Container) {\n\tif container.Env(betaSuppressWarningsEnvKey) == \"\" {\n\t\tcontainer.Logger().Warn(\"This command is in beta. It is unstable and likely to change. To suppress this warning, set \" + betaSuppressWarningsEnvKey + \"=1\")\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufcli/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n)\n\nvar (\n\t// ErrNotATTY is returned when an input io.Reader is not a TTY where it is expected.\n\tErrNotATTY = errors.New(\"reader was not a TTY as expected\")\n\n\t// ErrNoConfigFile is used when the user tries to execute a command without a configuration file.\n\tErrNoConfigFile = errors.New(`no buf.yaml file discovered in the specified directory`)\n)\n\n// NewTooManyEmptyAnswersError is used when the user does not answer a prompt in\n// the given number of attempts.\nfunc NewTooManyEmptyAnswersError(attempts int) error {\n\treturn fmt.Errorf(\"did not receive an answer in %d attempts\", attempts)\n}\n\n// NewOrganizationNameAlreadyExistsError informs the user that an organization with\n// that name already exists.\nfunc NewOrganizationNameAlreadyExistsError(name string) error {\n\treturn fmt.Errorf(\"an organization named %q already exists\", name)\n}\n\n// NewModuleNameAlreadyExistsError informs the user that a module\n// with that name already exists.\nfunc NewModuleNameAlreadyExistsError(name string) error {\n\treturn fmt.Errorf(\"a module named %q already exists\", name)\n}\n\n// NewLabelNameAlreadyExistsError informs the user that a label\n// with that name already exists.\nfunc NewLabelNameAlreadyExistsError(name string) error {\n\treturn fmt.Errorf(\"a label named %q already exists\", name)\n}\n\n// NewPluginNameAlreadyExistsError informs the user that a plugin\n// with that name already exists.\nfunc NewPluginNameAlreadyExistsError(name string) error {\n\treturn fmt.Errorf(\"a plugin named %q already exists\", name)\n}\n\n// NewPolicyNameAlreadyExistsError informs the user that a policy\n// with that name already exists.\nfunc NewPolicyNameAlreadyExistsError(name string) error {\n\treturn fmt.Errorf(\"a policy named %q already exists\", name)\n}\n\n// NewOrganizationNotFoundError informs the user that an organization with\n// that name does not exist.\nfunc NewOrganizationNotFoundError(name string) error {\n\treturn fmt.Errorf(`an organization named %q does not exist, use \"buf registry organization create\" to create one`, name)\n}\n\n// NewOrganizationOrUserNotFoundError informs the user that an organization or user with\n// that name does not exist.\nfunc NewOrganizationOrUserNotFoundError(name string) error {\n\treturn fmt.Errorf(`an organization or user named %q does not exist`, name)\n}\n\n// NewModuleNotFoundError informs the user that a module with\n// that name does not exist.\nfunc NewModuleNotFoundError(name string) error {\n\treturn fmt.Errorf(`a module named %q does not exist, use \"buf registry module create\" to create one`, name)\n}\n\n// NewRefNotFoundError informs the user that a Ref does not exist.\nfunc NewRefNotFoundError(ref bufparse.Ref) error {\n\treturn fmt.Errorf(\"%q does not exist\", ref)\n}\n\n// NewLabelNotFoundError informs the user that a Ref does not exist as a label.\nfunc NewLabelNotFoundError(ref bufparse.Ref) error {\n\treturn fmt.Errorf(\"label %q does not exist\", ref)\n}\n\n// NewTokenNotFoundError informs the user that a token with\n// that identifier does not exist.\nfunc NewTokenNotFoundError(tokenID string) error {\n\treturn fmt.Errorf(\"a token with ID %q does not exist\", tokenID)\n}\n\n// NewPluginNotFoundError informs the user that a plugin with\n// that name does not exist.\nfunc NewPluginNotFoundError(name string) error {\n\treturn fmt.Errorf(\"a plugin named %q does not exist\", name)\n}\n\n// NewPolicyNotFoundError informs the user that a plugin with\n// that name does not exist.\nfunc NewPolicyNotFoundError(name string) error {\n\treturn fmt.Errorf(\"a plugin named %q does not exist\", name)\n}\n\n// NewInvalidRemoteError informs the user that the given remote is invalid.\nfunc NewInvalidRemoteError(err error, remote string, moduleFullName string) error {\n\tvar connectErr *connect.Error\n\tok := errors.As(err, &connectErr)\n\tif ok {\n\t\terr = connectErr.Unwrap()\n\t}\n\treturn fmt.Errorf(\"%w. Are you sure %q (derived from module name %q) is a Buf Schema Registry?\", err, remote, moduleFullName)\n}\n"
  },
  {
    "path": "private/buf/bufcli/flag_args_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"testing\"\n\n\t\"github.com/spf13/pflag\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestStringPointerFlagSet(t *testing.T) {\n\tt.Parallel()\n\texpected := \"foo\"\n\ttestParseStringPointer(t, \"test-flag-name\", &expected, \"--test-flag-name\", \"foo\")\n}\n\nfunc TestStringPointerFlagSetEmpty(t *testing.T) {\n\tt.Parallel()\n\texpected := \"\"\n\ttestParseStringPointer(t, \"test-flag-name\", &expected, \"--test-flag-name\", \"\")\n}\n\nfunc TestStringPointerFlagNotSet(t *testing.T) {\n\tt.Parallel()\n\ttestParseStringPointer(t, \"test-flag-name\", nil)\n}\n\nfunc testParseStringPointer(t *testing.T, flagName string, expectedResult *string, args ...string) {\n\tvar stringPointer *string\n\tflagSet := pflag.NewFlagSet(\"test flag set\", pflag.ContinueOnError)\n\tBindStringPointer(flagSet, flagName, &stringPointer, \"test usage\")\n\terr := flagSet.Parse(args)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expectedResult, stringPointer)\n}\n"
  },
  {
    "path": "private/buf/bufcli/flags_args.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"slices\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\t// DefaultArchiveStatus is the default archive status.\n\t//\n\t// This is currently unarchived.\n\tDefaultArchiveStatus = unarchivedArchiveStatus\n\n\tinputHashtagFlagName      = \"__hashtag__\"\n\tinputHashtagFlagShortName = \"#\"\n\n\tpublicVisibility  = \"public\"\n\tprivateVisibility = \"private\"\n\n\tarchivedArchiveStatus   = \"archived\"\n\tunarchivedArchiveStatus = \"unarchived\"\n\tallArchiveStatus        = \"all\"\n)\n\nvar (\n\t// allVisibilityStrings are the possible options that a user can set the visibility flag with.\n\tallVisibilityStrings = []string{\n\t\tpublicVisibility,\n\t\tprivateVisibility,\n\t}\n\tallArchiveStatusStrings = []string{\n\t\tarchivedArchiveStatus,\n\t\tunarchivedArchiveStatus,\n\t\tallArchiveStatus,\n\t}\n)\n\n// BindAsFileDescriptorSet binds the exclude-imports flag.\nfunc BindAsFileDescriptorSet(flagSet *pflag.FlagSet, addr *bool, flagName string) {\n\tflagSet.BoolVar(\n\t\taddr,\n\t\tflagName,\n\t\tfalse,\n\t\t`Output as a google.protobuf.FileDescriptorSet instead of an image\nNote that images are wire compatible with FileDescriptorSets, but this flag strips\nthe additional metadata added for Buf usage`,\n\t)\n}\n\n// BindExcludeImports binds the exclude-imports flag.\nfunc BindExcludeImports(flagSet *pflag.FlagSet, addr *bool, flagName string) {\n\tflagSet.BoolVar(\n\t\taddr,\n\t\tflagName,\n\t\tfalse,\n\t\t\"Exclude imports.\",\n\t)\n}\n\n// BindExcludeSourceInfo binds the exclude-source-info flag.\nfunc BindExcludeSourceInfo(flagSet *pflag.FlagSet, addr *bool, flagName string) {\n\tflagSet.BoolVar(\n\t\taddr,\n\t\tflagName,\n\t\tfalse,\n\t\t\"Exclude source info\",\n\t)\n}\n\n// BindPaths binds the paths flag.\nfunc BindPaths(\n\tflagSet *pflag.FlagSet,\n\tpathsAddr *[]string,\n\tpathsFlagName string,\n) {\n\tflagSet.StringSliceVar(\n\t\tpathsAddr,\n\t\tpathsFlagName,\n\t\tnil,\n\t\t`Limit to specific files or directories, e.g. \"proto/a/a.proto\", \"proto/a\"\nIf specified multiple times, the union is taken`,\n\t)\n}\n\n// BindInputHashtag binds the input hashtag flag.\n//\n// This needs to be added to any command that has the input as the first argument.\n// This deals with the situation \"buf build -#format=json\" which results in\n// a parse error from pflag.\nfunc BindInputHashtag(flagSet *pflag.FlagSet, addr *string) {\n\tflagSet.StringVarP(\n\t\taddr,\n\t\tinputHashtagFlagName,\n\t\tinputHashtagFlagShortName,\n\t\t\"\",\n\t\t\"\",\n\t)\n\t_ = flagSet.MarkHidden(inputHashtagFlagName)\n}\n\n// BindExcludePaths binds the exclude-path flag.\nfunc BindExcludePaths(\n\tflagSet *pflag.FlagSet,\n\texcludePathsAddr *[]string,\n\texcludePathsFlagName string,\n) {\n\tflagSet.StringSliceVar(\n\t\texcludePathsAddr,\n\t\texcludePathsFlagName,\n\t\tnil,\n\t\t`Exclude specific files or directories, e.g. \"proto/a/a.proto\", \"proto/a\"\nIf specified multiple times, the union is taken`,\n\t)\n}\n\n// BindDisableSymlinks binds the disable-symlinks flag.\nfunc BindDisableSymlinks(flagSet *pflag.FlagSet, addr *bool, flagName string) {\n\tflagSet.BoolVar(\n\t\taddr,\n\t\tflagName,\n\t\tfalse,\n\t\t`Do not follow symlinks when reading sources or configuration from the local filesystem\nBy default, symlinks are followed in this CLI, but never followed on the Buf Schema Registry`,\n\t)\n}\n\n// BindVisibility binds the visibility flag.\nfunc BindVisibility(flagSet *pflag.FlagSet, addr *string, flagName string, emptyDefault bool) {\n\tdefaultVisibility := privateVisibility\n\tif emptyDefault {\n\t\tdefaultVisibility = \"\"\n\t}\n\tflagSet.StringVar(\n\t\taddr,\n\t\tflagName,\n\t\tdefaultVisibility,\n\t\tfmt.Sprintf(`The module's visibility setting. Must be one of %s`, xstrings.SliceToString(allVisibilityStrings)),\n\t)\n}\n\n// BindCreateVisibility binds the create-visibility flag. Kept in this package\n// so we can keep allVisibilityStrings private.\nfunc BindCreateVisibility(flagSet *pflag.FlagSet, addr *string, flagName string, createFlagName string) {\n\tflagSet.StringVar(\n\t\taddr,\n\t\tflagName,\n\t\tprivateVisibility,\n\t\tfmt.Sprintf(`The module's visibility setting, if created. Can only be set with --%s. Must be one of %s`, createFlagName, xstrings.SliceToString(allVisibilityStrings)),\n\t)\n}\n\n// BindArchiveStatus binds the archive-status flag. Kept in this package so we can\n// keep allArchiveStatusStrings private.\nfunc BindArchiveStatus(flagSet *pflag.FlagSet, addr *string, flagName string) {\n\tflagSet.StringVar(\n\t\taddr,\n\t\tflagName,\n\t\tDefaultArchiveStatus,\n\t\tfmt.Sprintf(`The archive status of the labels listed. Must be one of %s`, xstrings.SliceToString(allArchiveStatusStrings)),\n\t)\n}\n\n// BindStringPointer binds a string pointer flag, which indicates flag presence, i.e. `--flag \"\"` is not the same as not passing the flag.\n//\n// This is useful for buf registry organization/module update, where we only modify the fields specified.\n//\n// Value must not be nil.\nfunc BindStringPointer(flagSet *pflag.FlagSet, name string, value **string, usage string) {\n\tflagSet.Var(\n\t\t&stringPointerValue{\n\t\t\tvaluePointer: value,\n\t\t},\n\t\tname,\n\t\tusage,\n\t)\n}\n\n// Implements pflag.Value.\ntype stringPointerValue struct {\n\t// This must not be nil at construction time.\n\tvaluePointer **string\n}\n\nfunc (b *stringPointerValue) Type() string {\n\treturn \"string\"\n}\n\nfunc (b *stringPointerValue) String() string {\n\tif *b.valuePointer == nil {\n\t\treturn \"\"\n\t}\n\treturn **b.valuePointer\n}\n\nfunc (b *stringPointerValue) Set(value string) error {\n\t*b.valuePointer = &value\n\treturn nil\n}\n\n// GetInputLong gets the long command description for an input-based command.\nfunc GetInputLong(inputArgDescription string) string {\n\treturn fmt.Sprintf(\n\t\t`The first argument is %s, which must be one of format %s.\nThis defaults to \".\" if no argument is specified.`,\n\t\tinputArgDescription,\n\t\tbuffetch.AllFormatsString,\n\t)\n}\n\n// GetSourceLong gets the long command description for an input-based command.\nfunc GetSourceLong(inputArgDescription string) string {\n\treturn fmt.Sprintf(\n\t\t`The first argument is %s, which must be one of format %s.\nThis defaults to \".\" if no argument is specified.`,\n\t\tinputArgDescription,\n\t\tbuffetch.SourceFormatsString,\n\t)\n}\n\n// GetSourceDirLong gets the long command description for a directory-based command.\nfunc GetSourceDirLong(inputArgDescription string) string {\n\treturn fmt.Sprintf(\n\t\t`The first argument is %s, which must be a directory.\nThis defaults to \".\" if no argument is specified.`,\n\t\tinputArgDescription,\n\t)\n}\n\n// GetSourceOrModuleLong gets the long command description for an input-based command.\nfunc GetSourceOrModuleLong(inputArgDescription string) string {\n\treturn fmt.Sprintf(\n\t\t`The first argument is %s, which must be one of format %s.\nThis defaults to \".\" if no argument is specified.`,\n\t\tinputArgDescription,\n\t\tbuffetch.SourceOrModuleFormatsString,\n\t)\n}\n\n// GetInputValue gets the first arg.\n//\n// Also parses the special input hashtag flag that deals with the situation \"buf build -#format=json\".\n// The existence of 0 or 1 args should be handled by the Args field on Command.\nfunc GetInputValue(\n\tcontainer app.ArgContainer,\n\tinputHashtag string,\n\tdefaultValue string,\n) (string, error) {\n\tvar arg string\n\tswitch numArgs := container.NumArgs(); numArgs {\n\tcase 0:\n\t\tif inputHashtag != \"\" {\n\t\t\targ = \"-#\" + inputHashtag\n\t\t}\n\tcase 1:\n\t\targ = container.Arg(0)\n\t\tif arg == \"\" {\n\t\t\treturn \"\", errors.New(\"first argument is present but empty\")\n\t\t}\n\t\t// if arg is non-empty and inputHashtag is non-empty, this means two arguments were specified\n\t\tif inputHashtag != \"\" {\n\t\t\treturn \"\", errors.New(\"only 1 argument allowed but 2 arguments specified\")\n\t\t}\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"only 1 argument allowed but %d arguments specified\", numArgs)\n\t}\n\tif arg != \"\" {\n\t\treturn arg, nil\n\t}\n\treturn defaultValue, nil\n}\n\n// VisibilityFlagToVisibilityAllowUnspecified parses the given string as a modulev1.ModuleVisibility\n// where an empty string will be parsed as unspecified\nfunc VisibilityFlagToVisibilityAllowUnspecified(visibility string) (modulev1.ModuleVisibility, error) {\n\tswitch visibility {\n\tcase publicVisibility:\n\t\treturn modulev1.ModuleVisibility_MODULE_VISIBILITY_PUBLIC, nil\n\tcase privateVisibility:\n\t\treturn modulev1.ModuleVisibility_MODULE_VISIBILITY_PRIVATE, nil\n\tcase \"\":\n\t\treturn modulev1.ModuleVisibility_MODULE_VISIBILITY_UNSPECIFIED, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid visibility: %s\", visibility)\n\t}\n}\n\n// VisibilityFlagToPluginVisibilityAllowUnspecified parses the given string as a pluginv1.PluginVisibility\n// where an empty string will be parsed as unspecified.\nfunc VisibilityFlagToPluginVisibilityAllowUnspecified(visibility string) (pluginv1beta1.PluginVisibility, error) {\n\tswitch visibility {\n\tcase publicVisibility:\n\t\treturn pluginv1beta1.PluginVisibility_PLUGIN_VISIBILITY_PUBLIC, nil\n\tcase privateVisibility:\n\t\treturn pluginv1beta1.PluginVisibility_PLUGIN_VISIBILITY_PRIVATE, nil\n\tcase \"\":\n\t\treturn pluginv1beta1.PluginVisibility_PLUGIN_VISIBILITY_UNSPECIFIED, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid visibility: %s\", visibility)\n\t}\n}\n\n// VisibilityFlagToPolicyVisibilityAllowUnspecified parses the given string as a pluginv1.PolicyVisibility\n// where an empty string will be parsed as unspecified.\nfunc VisibilityFlagToPolicyVisibilityAllowUnspecified(visibility string) (policyv1beta1.PolicyVisibility, error) {\n\tswitch visibility {\n\tcase publicVisibility:\n\t\treturn policyv1beta1.PolicyVisibility_POLICY_VISIBILITY_PUBLIC, nil\n\tcase privateVisibility:\n\t\treturn policyv1beta1.PolicyVisibility_POLICY_VISIBILITY_PRIVATE, nil\n\tcase \"\":\n\t\treturn policyv1beta1.PolicyVisibility_POLICY_VISIBILITY_UNSPECIFIED, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid visibility: %s\", visibility)\n\t}\n}\n\n// ArchiveStatusFlagToModuleArchiveStatusFilter parses the given string as a modulev1.ListLabelsRequest_ArchiveFilter.\nfunc ArchiveStatusFlagToModuleArchiveStatusFilter(archiveStatus string) (modulev1.ListLabelsRequest_ArchiveFilter, error) {\n\tswitch archiveStatus {\n\tcase archivedArchiveStatus:\n\t\treturn modulev1.ListLabelsRequest_ARCHIVE_FILTER_ARCHIVED_ONLY, nil\n\tcase unarchivedArchiveStatus:\n\t\treturn modulev1.ListLabelsRequest_ARCHIVE_FILTER_UNARCHIVED_ONLY, nil\n\tcase allArchiveStatus:\n\t\treturn modulev1.ListLabelsRequest_ARCHIVE_FILTER_ALL, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid archive status: %s\", archiveStatus)\n\t}\n}\n\n// ArchiveStatusFlagToPluginArchiveStatusFilter parses the given string as a pluginv1beta1.ListLabelsRequest_ArchiveFilter.\nfunc ArchiveStatusFlagToPluginArchiveStatusFilter(archiveStatus string) (pluginv1beta1.ListLabelsRequest_ArchiveFilter, error) {\n\tswitch archiveStatus {\n\tcase archivedArchiveStatus:\n\t\treturn pluginv1beta1.ListLabelsRequest_ARCHIVE_FILTER_ARCHIVED_ONLY, nil\n\tcase unarchivedArchiveStatus:\n\t\treturn pluginv1beta1.ListLabelsRequest_ARCHIVE_FILTER_UNARCHIVED_ONLY, nil\n\tcase allArchiveStatus:\n\t\treturn pluginv1beta1.ListLabelsRequest_ARCHIVE_FILTER_ALL, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid archive status: %s\", archiveStatus)\n\t}\n}\n\n// ArchiveStatusFlagToPolicyArchiveStatusFilter parses the given string as a pluginv1beta1.ListLabelsRequest_ArchiveFilter.\nfunc ArchiveStatusFlagToPolicyArchiveStatusFilter(archiveStatus string) (policyv1beta1.ListLabelsRequest_ArchiveFilter, error) {\n\tswitch archiveStatus {\n\tcase archivedArchiveStatus:\n\t\treturn policyv1beta1.ListLabelsRequest_ARCHIVE_FILTER_ARCHIVED_ONLY, nil\n\tcase unarchivedArchiveStatus:\n\t\treturn policyv1beta1.ListLabelsRequest_ARCHIVE_FILTER_UNARCHIVED_ONLY, nil\n\tcase allArchiveStatus:\n\t\treturn policyv1beta1.ListLabelsRequest_ARCHIVE_FILTER_ALL, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid archive status: %s\", archiveStatus)\n\t}\n}\n\n// ValidateRequiredFlag validates that the required flag is set.\nfunc ValidateRequiredFlag[T comparable](flagName string, value T) error {\n\tvar zero T\n\tif value == zero {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s is required\", flagName)\n\t}\n\treturn nil\n}\n\n// ValidateErrorFormatFlagLint validates the error format flag for lint.\nfunc ValidateErrorFormatFlagLint(errorFormatString string, errorFormatFlagName string) error {\n\treturn validateErrorFormatFlag(AllLintFormatStrings, errorFormatString, errorFormatFlagName)\n}\n\nfunc validateErrorFormatFlag(validFormatStrings []string, errorFormatString string, errorFormatFlagName string) error {\n\tif slices.Contains(validFormatStrings, errorFormatString) {\n\t\treturn nil\n\t}\n\treturn appcmd.NewInvalidArgumentErrorf(\"--%s: invalid format: %q\", errorFormatFlagName, errorFormatString)\n}\n"
  },
  {
    "path": "private/buf/bufcli/graph_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n)\n\n// NewGraphProvider returns a new GraphProvider.\nfunc NewGraphProvider(container appext.Container) (bufmodule.GraphProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newGraphProvider(\n\t\tcontainer,\n\t\tbufregistryapimodule.NewClientProvider(clientConfig),\n\t\tbufregistryapiowner.NewClientProvider(clientConfig),\n\t), nil\n}\n\nfunc newGraphProvider(\n\tcontainer appext.Container,\n\tmoduleClientProvider bufregistryapimodule.ClientProvider,\n\townerClientProvider bufregistryapiowner.ClientProvider,\n) bufmodule.GraphProvider {\n\treturn bufmoduleapi.NewGraphProvider(\n\t\tcontainer.Logger(),\n\t\tmoduleClientProvider,\n\t\townerClientProvider,\n\t\t// OK if empty\n\t\tbufmoduleapi.GraphProviderWithLegacyFederationRegistry(container.Env(legacyFederationRegistryEnvKey)),\n\t\t// OK if empty\n\t\tbufmoduleapi.GraphProviderWithPublicRegistry(container.Env(publicRegistryEnvKey)),\n\t)\n}\n"
  },
  {
    "path": "private/buf/bufcli/module_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n)\n\n// NewModuleKeyProvider returns a new ModuleKeyProvider.\nfunc NewModuleKeyProvider(container appext.Container) (bufmodule.ModuleKeyProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmoduleapi.NewModuleKeyProvider(\n\t\tcontainer.Logger(),\n\t\tbufregistryapimodule.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t), nil\n}\n"
  },
  {
    "path": "private/buf/bufcli/module_owner.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n)\n\n// ModuleOwner represents a module owner, consisting of a registry and owner.\n//\n// This concept used to live in bufmodule but it doesn't really make sense there, as it isn't\n// use anywhere else. We only use this in buf registry organization commands at the moment.\ntype ModuleOwner interface {\n\t// String returns \"registry/owner\".\n\tfmt.Stringer\n\n\t// Registry returns the hostname of the BSR instance that this owner is contained within.\n\tRegistry() string\n\t// Owner returns the name of the user or organization.\n\tOwner() string\n\n\tisModuleOwner()\n}\n\n// NewModuleOwner returns a new ModuleOwner for the given components.\nfunc NewModuleOwner(\n\tregistry string,\n\towner string,\n) (ModuleOwner, error) {\n\treturn newModuleOwner(\n\t\tregistry,\n\t\towner,\n\t)\n}\n\n// ParseModuleOwner parses a ModuleOwner from a string in the form \"registry/owner\".\nfunc ParseModuleOwner(moduleOwnerString string) (ModuleOwner, error) {\n\tregistry, owner, err := parseModuleOwnerComponents(moduleOwnerString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewModuleOwner(registry, owner)\n}\n\n// *** PRIVATE ***\n\ntype moduleOwner struct {\n\tregistry string\n\towner    string\n}\n\nfunc newModuleOwner(\n\tregistry string,\n\towner string,\n) (*moduleOwner, error) {\n\tif registry == \"\" {\n\t\treturn nil, errors.New(\"registry is empty\")\n\t}\n\tif _, err := netext.ValidateHostname(registry); err != nil {\n\t\treturn nil, fmt.Errorf(\"registry %q is not a valid hostname: %w\", registry, err)\n\t}\n\tif owner == \"\" {\n\t\treturn nil, errors.New(\"owner is empty\")\n\t}\n\tif strings.Contains(owner, \"/\") {\n\t\treturn nil, fmt.Errorf(\"owner %q cannot contain slashes\", owner)\n\t}\n\treturn &moduleOwner{\n\t\tregistry: registry,\n\t\towner:    owner,\n\t}, nil\n}\n\nfunc (m *moduleOwner) Registry() string {\n\treturn m.registry\n}\n\nfunc (m *moduleOwner) Owner() string {\n\treturn m.owner\n}\n\nfunc (m *moduleOwner) String() string {\n\treturn m.registry + \"/\" + m.owner\n}\n\nfunc (*moduleOwner) isModuleOwner() {}\n\nfunc parseModuleOwnerComponents(path string) (registry string, owner string, err error) {\n\tslashSplit := strings.Split(path, \"/\")\n\tif len(slashSplit) != 2 {\n\t\treturn \"\", \"\", newInvalidModuleOwnerStringError(path)\n\t}\n\tregistry = strings.TrimSpace(slashSplit[0])\n\tif registry == \"\" {\n\t\treturn \"\", \"\", newInvalidModuleOwnerStringError(path)\n\t}\n\towner = strings.TrimSpace(slashSplit[1])\n\tif owner == \"\" {\n\t\treturn \"\", \"\", newInvalidModuleOwnerStringError(path)\n\t}\n\treturn registry, owner, nil\n}\n\nfunc newInvalidModuleOwnerStringError(s string) error {\n\treturn fmt.Errorf(\"invalid module owner %q: must be in the form registry/owner\", s)\n}\n"
  },
  {
    "path": "private/buf/bufcli/plugin_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n)\n\n// NewPluginKeyProvider returns a new PluginKeyProvider.\nfunc NewPluginKeyProvider(container appext.Container) (bufplugin.PluginKeyProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufpluginapi.NewPluginKeyProvider(\n\t\tcontainer.Logger(),\n\t\tbufregistryapiplugin.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t), nil\n}\n"
  },
  {
    "path": "private/buf/bufcli/policy_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n)\n\n// NewPolicyKeyProvider returns a new PolicyKeyProvider.\nfunc NewPolicyKeyProvider(container appext.Container) (bufpolicy.PolicyKeyProvider, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufpolicyapi.NewPolicyKeyProvider(\n\t\tcontainer.Logger(),\n\t\tbufregistryapipolicy.NewClientProvider(\n\t\t\tclientConfig,\n\t\t),\n\t), nil\n}\n"
  },
  {
    "path": "private/buf/bufcli/prompt.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"golang.org/x/term\"\n)\n\nconst userPromptAttempts = 3\n\n// PromptUser reads a line from Stdin, prompting the user with the prompt first.\n// The prompt is repeatedly shown until the user provides a non-empty response.\n// ErrNotATTY is returned if the input containers Stdin is not a terminal.\nfunc PromptUser(container app.Container, prompt string) (string, error) {\n\treturn promptUser(container, prompt, false)\n}\n\n// PromptUserForPassword reads a line from Stdin, prompting the user with the prompt first.\n// The prompt is repeatedly shown until the user provides a non-empty response.\n// ErrNotATTY is returned if the input containers Stdin is not a terminal.\nfunc PromptUserForPassword(container app.Container, prompt string) (string, error) {\n\treturn promptUser(container, prompt, true)\n}\n\n// PromptUserForDelete is used to receive user confirmation that a specific\n// entity should be deleted. If the user's answer does not match the expected\n// answer, an error is returned.\n// ErrNotATTY is returned if the input containers Stdin is not a terminal.\nfunc PromptUserForDelete(container app.Container, entityType string, expectedAnswer string) error {\n\tconfirmation, err := PromptUser(\n\t\tcontainer,\n\t\tfmt.Sprintf(\n\t\t\t\"Please confirm that you want to DELETE this %s by entering its name (%s) again.\"+\n\t\t\t\t\"\\nWARNING: This action is NOT reversible!\\n\",\n\t\t\tentityType,\n\t\t\texpectedAnswer,\n\t\t),\n\t)\n\tif err != nil {\n\t\tif errors.Is(err, ErrNotATTY) {\n\t\t\treturn errors.New(\"cannot perform an interactive delete from a non-TTY device\")\n\t\t}\n\t\treturn err\n\t}\n\tif confirmation != expectedAnswer {\n\t\treturn fmt.Errorf(\n\t\t\t\"expected %q, but received %q\",\n\t\t\texpectedAnswer,\n\t\t\tconfirmation,\n\t\t)\n\t}\n\treturn nil\n}\n\n// promptUser reads a line from Stdin, prompting the user with the prompt first.\n// The prompt is repeatedly shown until the user provides a non-empty response.\n// ErrNotATTY is returned if the input containers Stdin is not a terminal.\nfunc promptUser(container app.Container, prompt string, isPassword bool) (string, error) {\n\tfile, ok := container.Stdin().(*os.File)\n\tif !ok || !term.IsTerminal(int(file.Fd())) {\n\t\treturn \"\", ErrNotATTY\n\t}\n\tvar attempts int\n\tfor attempts < userPromptAttempts {\n\t\tattempts++\n\t\tif _, err := fmt.Fprint(\n\t\t\tcontainer.Stdout(),\n\t\t\tprompt,\n\t\t); err != nil {\n\t\t\treturn \"\", syserror.Wrap(err)\n\t\t}\n\t\tvar value string\n\t\tif isPassword {\n\t\t\tdata, err := term.ReadPassword(int(file.Fd()))\n\t\t\tif err != nil {\n\t\t\t\t// If the user submitted an EOF (e.g. via ^D) then we\n\t\t\t\t// should not treat it as an internal error; returning\n\t\t\t\t// the error directly makes it more clear as to\n\t\t\t\t// why the command failed.\n\t\t\t\tif errors.Is(err, io.EOF) {\n\t\t\t\t\treturn \"\", err\n\t\t\t\t}\n\t\t\t\treturn \"\", syserror.Wrap(err)\n\t\t\t}\n\t\t\tvalue = string(data)\n\t\t} else {\n\t\t\tscanner := bufio.NewScanner(container.Stdin())\n\t\t\tif !scanner.Scan() {\n\t\t\t\t// scanner.Err() returns nil on EOF.\n\t\t\t\tif err := scanner.Err(); err != nil {\n\t\t\t\t\treturn \"\", syserror.Wrap(err)\n\t\t\t\t}\n\t\t\t\treturn \"\", io.EOF\n\t\t\t}\n\t\t\tvalue = scanner.Text()\n\t\t\tif err := scanner.Err(); err != nil {\n\t\t\t\treturn \"\", syserror.Wrap(err)\n\t\t\t}\n\t\t}\n\t\tif len(strings.TrimSpace(value)) != 0 {\n\t\t\t// We want to preserve spaces in user input, so we only apply\n\t\t\t// strings.TrimSpace to verify an answer was provided.\n\t\t\treturn value, nil\n\t\t}\n\t\tif attempts < userPromptAttempts {\n\t\t\t// We only want to ask the user to try again if they actually\n\t\t\t// have another attempt.\n\t\t\tif _, err := fmt.Fprintln(\n\t\t\t\tcontainer.Stdout(),\n\t\t\t\t\"No answer was provided. Please try again.\",\n\t\t\t); err != nil {\n\t\t\t\treturn \"\", syserror.Wrap(err)\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\", NewTooManyEmptyAnswersError(userPromptAttempts)\n}\n"
  },
  {
    "path": "private/buf/bufcli/protoc_plugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/bufbuild/protoplugin\"\n)\n\n// GetModuleConfigAndPluginConfigsForProtocPlugin gets the [bufmodule.ModuleConfig] and\n// [bufmodule.PluginConfig]s for the specified module for the protoc plugin implementations.\n//\n// The caller can provide overrides for plugin paths in the plugin configurations. The protoc\n// plugin implementations do not support remote plugins. Also, for use-cases such as Bazel,\n// access to local binaries might require an explicit path override. So, this allows callers\n// to pass a map of plugin name to local path to override the plugin configuration.\n//\n// We also return all check configs for the option [bufcheck.WithRelatedCheckConfigs] to\n// validate the plugin configs when running lint/breaking.\n//\n// This is the same in both plugins so we just pulled it out to a common spot.\nfunc GetModuleConfigAndPluginConfigsForProtocPlugin(\n\tctx context.Context,\n\tconfigOverride string,\n\tmodule string,\n\tpluginPathOverrides map[string]string,\n) (bufconfig.ModuleConfig, []bufconfig.PluginConfig, []bufconfig.CheckConfig, error) {\n\tbufYAMLFile, err := GetBufYAMLFileForDirPathOrOverride(\n\t\tctx,\n\t\t\".\",\n\t\tconfigOverride,\n\t)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t// There are no plugin configs by default.\n\t\t\treturn bufconfig.DefaultModuleConfigV2, nil, []bufconfig.CheckConfig{bufconfig.DefaultLintConfigV2, bufconfig.DefaultBreakingConfigV2}, nil\n\t\t}\n\t\treturn nil, nil, nil, err\n\t}\n\tif module == \"\" {\n\t\tmodule = \".\"\n\t}\n\tpluginConfigs, err := getPluginConfigsForPluginPathOverrides(bufYAMLFile.PluginConfigs(), pluginPathOverrides)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tvar allCheckConfigs []bufconfig.CheckConfig\n\t// Multiple modules in a v2 workspace may have the same moduleDirPath.\n\tmoduleConfigsFound := []bufconfig.ModuleConfig{}\n\tfor _, moduleConfig := range bufYAMLFile.ModuleConfigs() {\n\t\tallCheckConfigs = append(allCheckConfigs, moduleConfig.LintConfig(), moduleConfig.BreakingConfig())\n\t\t// If we have a v1beta1 or v1 buf.yaml, dirPath will be \".\". Using the ModuleConfig from\n\t\t// a v1beta1 or v1 buf.yaml file matches the pre-refactor behavior.\n\t\t//\n\t\t// If we have a v2 buf.yaml, users have to provide a module path or full name, otherwise\n\t\t// we can't deduce what ModuleConfig to use.\n\t\tif fullName := moduleConfig.FullName(); fullName != nil && fullName.String() == module {\n\t\t\tmoduleConfigsFound = append(moduleConfigsFound, moduleConfig)\n\t\t\tcontinue\n\t\t}\n\t\tif dirPath := moduleConfig.DirPath(); dirPath == module {\n\t\t\tmoduleConfigsFound = append(moduleConfigsFound, moduleConfig)\n\t\t}\n\t}\n\tswitch len(moduleConfigsFound) {\n\tcase 0:\n\t\treturn nil, nil, nil, fmt.Errorf(\"no module found for %q\", module)\n\tcase 1:\n\t\treturn moduleConfigsFound[0], pluginConfigs, allCheckConfigs, nil\n\tdefault:\n\t\treturn nil, nil, nil, fmt.Errorf(\"multiple modules found at %q, specify its full name as <remote/owner/module> instead\", module)\n\t}\n}\n\n// NewAppextContainerForPluginEnv creates a new appext.Container for the PluginEnv.\n//\n// This is used by the protoc plugins.\nfunc NewAppextContainerForPluginEnv(\n\tpluginEnv protoplugin.PluginEnv,\n\tappName string,\n\tlogLevelString string,\n\tlogFormatString string,\n) (appext.Container, error) {\n\tlogLevel, err := appext.ParseLogLevel(logLevelString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogFormat, err := appext.ParseLogFormat(logFormatString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogger, err := slogapp.NewLogger(pluginEnv.Stderr, logLevel, logFormat)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tappContainer, err := newAppContainerForPluginEnv(pluginEnv)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnameContainer, err := appext.NewNameContainer(appContainer, appName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn appext.NewContainer(\n\t\tnameContainer,\n\t\tlogger,\n\t), nil\n}\n\ntype appContainer struct {\n\tapp.EnvContainer\n\tapp.StderrContainer\n\tapp.StdinContainer\n\tapp.StdoutContainer\n\tapp.ArgContainer\n}\n\nfunc newAppContainerForPluginEnv(pluginEnv protoplugin.PluginEnv) (*appContainer, error) {\n\tenvContainer, err := app.NewEnvContainerForEnviron(pluginEnv.Environ)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &appContainer{\n\t\tEnvContainer:    envContainer,\n\t\tStderrContainer: app.NewStderrContainer(pluginEnv.Stderr),\n\t\t// cannot read against input from stdin, this is for the CodeGeneratorRequest\n\t\tStdinContainer: app.NewStdinContainer(nil),\n\t\t// cannot write output to stdout, this is for the CodeGeneratorResponse\n\t\tStdoutContainer: app.NewStdoutContainer(nil),\n\t\t// no args\n\t\tArgContainer: app.NewArgContainer(),\n\t}, nil\n}\n\n// This processes the plugin path overrides for the protoc plugin implementations. It does\n// the following:\n//   - For each plugin config, it checks if a path override was configured\n//   - If an override was found, then a new config override is created based on whether the\n//     override is a WASM path.\n//   - If no override was found, if the plugin config is a remote plugin, we return an error,\n//     since remote plugins are not supported for protoc plugin implementations. Otherwise,\n//     we use the plugin config as-is.\nfunc getPluginConfigsForPluginPathOverrides(\n\tpluginConfigs []bufconfig.PluginConfig,\n\tpluginPathOverrides map[string]string,\n) ([]bufconfig.PluginConfig, error) {\n\toverridePluginConfigs := make([]bufconfig.PluginConfig, len(pluginConfigs))\n\tfor i, pluginConfig := range pluginConfigs {\n\t\tif overridePath, ok := pluginPathOverrides[pluginConfig.Name()]; ok {\n\t\t\tvar overridePluginConfig bufconfig.PluginConfig\n\t\t\tvar err error\n\t\t\t// Check if the override path is a WASM path, if so, treat as a local WASM plugin\n\t\t\tif filepath.Ext(overridePath) == \".wasm\" {\n\t\t\t\toverridePluginConfig, err = bufconfig.NewLocalWasmPluginConfig(\n\t\t\t\t\toverridePath,\n\t\t\t\t\tpluginConfig.Options(),\n\t\t\t\t\tpluginConfig.Args(),\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} else {\n\t\t\t\t// Otherwise, treat it as a non-WASM local plugin.\n\t\t\t\toverridePluginConfig, err = bufconfig.NewLocalPluginConfig(\n\t\t\t\t\toverridePath,\n\t\t\t\t\tpluginConfig.Options(),\n\t\t\t\t\tpluginConfig.Args(),\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}\n\t\t\toverridePluginConfigs[i] = overridePluginConfig\n\t\t\tcontinue\n\t\t}\n\t\tif pluginConfig.Type() == bufconfig.PluginConfigTypeRemoteWasm {\n\t\t\treturn nil, fmt.Errorf(\"remote plugin %s cannot be run with protoc plugin\", pluginConfig.Name())\n\t\t}\n\t\toverridePluginConfigs[i] = pluginConfig\n\t}\n\treturn overridePluginConfigs, nil\n}\n"
  },
  {
    "path": "private/buf/bufcli/rules.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n)\n\n// AllRuleFormatStrings is all rule format strings.\nvar AllRuleFormatStrings = []string{\n\t\"text\",\n\t\"json\",\n}\n\n// PrintRules prints the Rules to the writer given the --format and --include-deprecated flag values.\nfunc PrintRules(writer io.Writer, rules []bufcheck.Rule, format string, includeDeprecated bool) error {\n\tvar printRulesOptions []bufcheck.PrintRulesOption\n\tswitch s := strings.ToLower(strings.TrimSpace(format)); s {\n\tcase \"\", \"text\":\n\tcase \"json\":\n\t\tprintRulesOptions = append(printRulesOptions, bufcheck.PrintRulesWithJSON())\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown format: %q\", s)\n\t}\n\tif includeDeprecated {\n\t\tprintRulesOptions = append(printRulesOptions, bufcheck.PrintRulesWithDeprecated())\n\t}\n\treturn bufcheck.PrintRules(writer, rules, printRulesOptions...)\n}\n"
  },
  {
    "path": "private/buf/bufcli/uploader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcli\n\nimport (\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyapi\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n)\n\n// NewModuleUploader returns a new Uploader for ModuleSets.\nfunc NewModuleUploader(container appext.Container) (bufmodule.Uploader, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newModuleUploader(container, bufregistryapimodule.NewClientProvider(clientConfig)), nil\n}\n\n// NewPluginUploader returns a new Uploader for Plugins.\nfunc NewPluginUploader(container appext.Container) (bufplugin.Uploader, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newPluginUploader(container, bufregistryapiplugin.NewClientProvider(clientConfig)), nil\n}\n\n// NewPolicyUploader returns a new Uploader for Policys.\nfunc NewPolicyUploader(container appext.Container) (bufpolicy.Uploader, error) {\n\tclientConfig, err := NewConnectClientConfig(container)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newPolicyUploader(container, bufregistryapipolicy.NewClientProvider(clientConfig)), nil\n}\n\nfunc newModuleUploader(\n\tcontainer appext.Container,\n\tclientProvider bufregistryapimodule.ClientProvider,\n) bufmodule.Uploader {\n\treturn bufmoduleapi.NewUploader(\n\t\tcontainer.Logger(),\n\t\tclientProvider,\n\t\t// OK if empty\n\t\tbufmoduleapi.UploaderWithPublicRegistry(container.Env(publicRegistryEnvKey)),\n\t)\n}\n\nfunc newPluginUploader(\n\tcontainer appext.Container,\n\tclientProvider bufregistryapiplugin.ClientProvider,\n) bufplugin.Uploader {\n\treturn bufpluginapi.NewUploader(\n\t\tcontainer.Logger(),\n\t\tclientProvider,\n\t)\n}\n\nfunc newPolicyUploader(\n\tcontainer appext.Container,\n\tclientProvider bufregistryapipolicy.ClientProvider,\n) bufpolicy.Uploader {\n\treturn bufpolicyapi.NewUploader(\n\t\tcontainer.Logger(),\n\t\tclientProvider,\n\t)\n}\n"
  },
  {
    "path": "private/buf/bufcli/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcli\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufconvert/bufconvert.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconvert\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// ImageWithoutMessageSetWireFormatResolution returns an image with the\n// same contents as the given image, but whose resolver refuses to\n// resolve elements that refer to messages that use the message-set wire\n// format.\n//\n// We do this because the protobuf-go runtime does not support message-set\n// wire format (unless built with a \"protolegacy\" build tag). So if such a\n// message were used, we would not be able to correctly serialize or\n// de-serialize it.\nfunc ImageWithoutMessageSetWireFormatResolution(image bufimage.Image) bufimage.Image {\n\treturn &noResolveMessageSetWireFormatImage{image}\n}\n\ntype noResolveMessageSetWireFormatImage struct {\n\tbufimage.Image\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) Resolver() protoencoding.Resolver {\n\treturn n\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) FindFileByPath(path string) (protoreflect.FileDescriptor, error) {\n\treturn n.Image.Resolver().FindFileByPath(path)\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) {\n\tdescriptor, err := n.Image.Resolver().FindDescriptorByName(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch descriptor := descriptor.(type) {\n\tcase protoreflect.MessageDescriptor:\n\t\tif err := checkNoMessageSetWireFormat(descriptor, n.Image, nil); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase protoreflect.ExtensionDescriptor:\n\t\tif descriptor.Message() != nil {\n\t\t\tif err := checkNoMessageSetWireFormat(descriptor.Message(), n.Image, nil); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\treturn descriptor, nil\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {\n\textension, err := n.Image.Resolver().FindExtensionByName(field)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif msgDescriptor := extension.TypeDescriptor().Message(); msgDescriptor != nil {\n\t\tif err := checkNoMessageSetWireFormat(msgDescriptor, n.Image, nil); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn extension, nil\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {\n\textension, err := n.Image.Resolver().FindExtensionByNumber(message, field)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif msgDescriptor := extension.TypeDescriptor().Message(); msgDescriptor != nil {\n\t\tif err := checkNoMessageSetWireFormat(msgDescriptor, n.Image, nil); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn extension, nil\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {\n\tmessageType, err := n.Image.Resolver().FindMessageByName(message)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif msgDescriptor := messageType.Descriptor(); msgDescriptor != nil {\n\t\tif err := checkNoMessageSetWireFormat(msgDescriptor, n.Image, nil); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn messageType, nil\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) FindMessageByURL(url string) (protoreflect.MessageType, error) {\n\tmessageType, err := n.Image.Resolver().FindMessageByURL(url)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif msgDescriptor := messageType.Descriptor(); msgDescriptor != nil {\n\t\tif err := checkNoMessageSetWireFormat(msgDescriptor, n.Image, nil); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn messageType, nil\n}\n\nfunc (n *noResolveMessageSetWireFormatImage) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) {\n\treturn n.Image.Resolver().FindEnumByName(enum)\n}\n\ntype messageSetNotSupportedError struct {\n\ttypeName protoreflect.FullName\n}\n\nfunc (e *messageSetNotSupportedError) Error() string {\n\treturn fmt.Sprintf(\"message type %q uses message-set wire format, which is not supported\", e.typeName)\n}\n\nfunc checkNoMessageSetWireFormat(descriptor protoreflect.MessageDescriptor, image bufimage.Image, checked []protoreflect.FullName) error {\n\t// In order to create a protoreflect.MessageDescriptor, we may have already stripped\n\t// any message_set_wire_format option. So we must examine the file descriptor proto\n\t// in the image to see if the option is set. If it is, we cannot support this message.\n\tname := descriptor.FullName()\n\tif slices.Contains(checked, name) {\n\t\treturn nil\n\t}\n\tchecked = append(checked, name)\n\n\tpath := descriptor.ParentFile().Path()\n\timageFile := image.GetFile(path)\n\tif imageFile == nil {\n\t\t// shouldn't actually be possible\n\t\treturn fmt.Errorf(\"message type %q should be in file %q but that file was not found\", name, path)\n\t}\n\tdescriptorProto := findMessageInFile(name, imageFile.FileDescriptorProto())\n\tif descriptorProto == nil {\n\t\t// shouldn't actually be possible\n\t\treturn fmt.Errorf(\"message type %q should be in file %q but it was not found\", name, path)\n\t}\n\tif descriptorProto.GetOptions().GetMessageSetWireFormat() {\n\t\treturn &messageSetNotSupportedError{name}\n\t}\n\t// Also check all message fields\n\tfields := descriptor.Fields()\n\tfor i, length := 0, fields.Len(); i < length; i++ {\n\t\tfield := fields.Get(i)\n\t\tif field.Message() == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif err := checkNoMessageSetWireFormat(field.Message(), image, checked); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc findMessageInFile(name protoreflect.FullName, file *descriptorpb.FileDescriptorProto) *descriptorpb.DescriptorProto {\n\tif pkg := file.GetPackage(); pkg != \"\" {\n\t\tprefix := pkg + \".\"\n\t\tif !strings.HasPrefix(string(name), prefix) {\n\t\t\t// name has wrong package prefix\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn findMessageInFileRec(name, file)\n}\n\nfunc findMessageInFileRec(name protoreflect.FullName, file *descriptorpb.FileDescriptorProto) *descriptorpb.DescriptorProto {\n\tsimpleName := string(name.Name())\n\tparentName := name.Parent()\n\n\tif parentName == protoreflect.FullName(file.GetPackage()) {\n\t\t// This is a top-level message\n\t\tfor _, descriptor := range file.MessageType {\n\t\t\tif descriptor.GetName() == simpleName {\n\t\t\t\treturn descriptor\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\t// This is a nested message.\n\tparentMessage := findMessageInFileRec(parentName, file)\n\tif parentMessage == nil {\n\t\treturn nil\n\t}\n\tfor _, descriptor := range parentMessage.NestedType {\n\t\tif descriptor.GetName() == simpleName {\n\t\t\treturn descriptor\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/bufconvert/bufconvert_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconvert\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/google/uuid\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestImageWithoutMessageSetWireFormatResolution(t *testing.T) {\n\tt.Parallel()\n\tfile := getTestFileWithMessageSets()\n\timageFile, err := bufimage.NewImageFile(\n\t\tfile,\n\t\tnil,\n\t\tuuid.UUID{},\n\t\tfile.GetName(),\n\t\tfile.GetName(),\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\timage, err := bufimage.NewImage([]bufimage.ImageFile{imageFile})\n\trequire.NoError(t, err)\n\n\tnoResolveImage := ImageWithoutMessageSetWireFormatResolution(image)\n\t// assert.Same only supported pointers and not other reference types like slices :/\n\tassert.Equal(t, reflect.ValueOf(image.Files()).Pointer(), reflect.ValueOf(noResolveImage.Files()).Pointer())\n\n\tchecker := resultChecker{t}\n\tchecker.succeeds(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.Baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.MessageSetBaz\"))\n\tchecker.fails(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.ContainsMessageSetBaz\"))\n\tchecker.fails(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.IndirectContainsMessageSetBaz\"))\n\tchecker.succeeds(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.message_set_baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.contains_message_set_baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.indirect_contains_message_set_baz\"))\n\tchecker.succeeds(noResolveImage.Resolver().FindDescriptorByName(\"foo.bar.Enum\"))\n\n\tchecker.succeeds(noResolveImage.Resolver().FindMessageByName(\"foo.bar.Baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindMessageByName(\"foo.bar.MessageSetBaz\"))\n\tchecker.fails(noResolveImage.Resolver().FindMessageByName(\"foo.bar.ContainsMessageSetBaz\"))\n\tchecker.fails(noResolveImage.Resolver().FindMessageByName(\"foo.bar.IndirectContainsMessageSetBaz\"))\n\n\tchecker.succeeds(noResolveImage.Resolver().FindMessageByURL(\"type.googleapis.com/foo.bar.Baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindMessageByURL(\"type.googleapis.com/foo.bar.MessageSetBaz\"))\n\tchecker.fails(noResolveImage.Resolver().FindMessageByURL(\"type.googleapis.com/foo.bar.ContainsMessageSetBaz\"))\n\tchecker.fails(noResolveImage.Resolver().FindMessageByURL(\"type.googleapis.com/foo.bar.IndirectContainsMessageSetBaz\"))\n\n\tchecker.succeeds(noResolveImage.Resolver().FindExtensionByName(\"foo.bar.str\"))\n\tchecker.succeeds(noResolveImage.Resolver().FindExtensionByName(\"foo.bar.baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindExtensionByName(\"foo.bar.message_set_baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindExtensionByName(\"foo.bar.contains_message_set_baz\"))\n\tchecker.fails(noResolveImage.Resolver().FindExtensionByName(\"foo.bar.indirect_contains_message_set_baz\"))\n\n\tchecker.succeeds(noResolveImage.Resolver().FindExtensionByNumber(\"foo.bar.Baz\", 10101))\n\tchecker.succeeds(noResolveImage.Resolver().FindExtensionByNumber(\"foo.bar.Baz\", 10102))\n\tchecker.fails(noResolveImage.Resolver().FindExtensionByNumber(\"foo.bar.Baz\", 10103))\n\tchecker.fails(noResolveImage.Resolver().FindExtensionByNumber(\"foo.bar.Baz\", 10104))\n\tchecker.fails(noResolveImage.Resolver().FindExtensionByNumber(\"foo.bar.Baz\", 10105))\n\n\tchecker.succeeds(noResolveImage.Resolver().FindEnumByName(\"foo.bar.Enum\"))\n}\n\nfunc TestFindMessageInFile(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"no-package\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile := getTestFile(\"\" /* no package */)\n\n\t\tdoFindMessageInFile(t, \"Foo\", file, true)\n\t\tdoFindMessageInFile(t, \"Bar\", file, true)\n\t\tdoFindMessageInFile(t, \"Baz\", file, true)\n\t\tdoFindMessageInFile(t, \"Foo.Frob\", file, true)\n\t\tdoFindMessageInFile(t, \"Bar.Buzz\", file, true)\n\t\tdoFindMessageInFile(t, \"Baz.Abc.Xyz.Deeper.AndDeeper\", file, true)\n\n\t\tdoFindMessageInFile(t, \"foo.bar.Foo\", file, false)\n\t\tdoFindMessageInFile(t, \"Foobar\", file, false)\n\t\tdoFindMessageInFile(t, \"Foo.Nitz.Abc\", file, false)\n\t\tdoFindMessageInFile(t, \"Baz.Abc.Xyz.Deeper.Shallower\", file, false)\n\t})\n\tt.Run(\"with-package\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfile := getTestFile(\"buf.build.test\")\n\n\t\tdoFindMessageInFile(t, \"buf.build.test.Foo\", file, true)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Bar\", file, true)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Baz\", file, true)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Foo.Frob\", file, true)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Bar.Buzz\", file, true)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Baz.Abc.Xyz.Deeper.AndDeeper\", file, true)\n\n\t\tdoFindMessageInFile(t, \"Foo\", file, false)\n\t\tdoFindMessageInFile(t, \"buf.Foo\", file, false)\n\t\tdoFindMessageInFile(t, \"buf.build.Foo\", file, false)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Foobar\", file, false)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Foo.Nitz.Abc\", file, false)\n\t\tdoFindMessageInFile(t, \"buf.build.test.Baz.Abc.Xyz.Deeper.Shallower\", file, false)\n\t})\n}\n\ntype resultChecker struct {\n\tt *testing.T\n}\n\nfunc (c resultChecker) succeeds(result any, err error) {\n\tc.t.Helper()\n\trequire.NoError(c.t, err)\n\trequire.NotNil(c.t, result)\n}\n\nfunc (c resultChecker) fails(_ any, err error) {\n\tc.t.Helper()\n\tvar msgSetErr *messageSetNotSupportedError\n\trequire.ErrorAs(c.t, err, &msgSetErr)\n}\n\nfunc doFindMessageInFile(t *testing.T, name protoreflect.FullName, file *descriptorpb.FileDescriptorProto, expectToFind bool) {\n\tt.Helper()\n\tdescriptor := findMessageInFile(name, file)\n\tif !expectToFind {\n\t\trequire.Nil(t, descriptor)\n\t\treturn\n\t}\n\trequire.NotNil(t, descriptor)\n\trequire.Equal(t, descriptor.GetName(), string(name.Name()))\n}\n\nfunc getTestFile(pkg string) *descriptorpb.FileDescriptorProto {\n\tvar protoPkg *string\n\tif pkg != \"\" {\n\t\tprotoPkg = proto.String(pkg)\n\t}\n\treturn &descriptorpb.FileDescriptorProto{\n\t\tName:    proto.String(\"test.proto\"),\n\t\tPackage: protoPkg,\n\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Foo\"),\n\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Frob\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Nitz\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"Bar\"),\n\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Fizz\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Buzz\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"Baz\"),\n\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Abc\"),\n\t\t\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName: proto.String(\"Xyz\"),\n\t\t\t\t\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tName: proto.String(\"Deeper\"),\n\t\t\t\t\t\t\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\tName: proto.String(\"AndDeeper\"),\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},\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 getTestFileWithMessageSets() *descriptorpb.FileDescriptorProto {\n\treturn &descriptorpb.FileDescriptorProto{\n\t\tName:    proto.String(\"test.proto\"),\n\t\tPackage: proto.String(\"foo.bar\"),\n\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Baz\"),\n\t\t\t\tExtensionRange: []*descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\t\t\t{Start: proto.Int32(100), End: proto.Int32(99999)},\n\t\t\t\t},\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:   proto.String(\"name\"),\n\t\t\t\t\t\tNumber: proto.Int32(1),\n\t\t\t\t\t\tLabel:  descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:   descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     proto.String(\"fizz\"),\n\t\t\t\t\t\tNumber:   proto.Int32(2),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\t\t\tTypeName: proto.String(\".foo.bar.Fizz\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     proto.String(\"buzz\"),\n\t\t\t\t\t\tNumber:   proto.Int32(3),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_REPEATED.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\t\t\tTypeName: proto.String(\".foo.bar.Buzz\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:    proto.String(\"Fizz\"),\n\t\t\t\tOptions: &descriptorpb.MessageOptions{Deprecated: proto.Bool(true)},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"Buzz\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tName:    proto.String(\"MessageSetBaz\"),\n\t\t\t\tOptions: &descriptorpb.MessageOptions{MessageSetWireFormat: proto.Bool(true)},\n\t\t\t\tExtensionRange: []*descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\t\t\t{Start: proto.Int32(1), End: proto.Int32(9999999)},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"ContainsMessageSetBaz\"),\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     proto.String(\"baz\"),\n\t\t\t\t\t\tNumber:   proto.Int32(1),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\t\t\tTypeName: proto.String(\".foo.bar.MessageSetBaz\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"IndirectContainsMessageSetBaz\"),\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     proto.String(\"bazes\"),\n\t\t\t\t\t\tNumber:   proto.Int32(1),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_REPEATED.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\t\t\tTypeName: proto.String(\".foo.bar.IndirectContainsMessageSetBaz.BazesEntry\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:    proto.String(\"BazesEntry\"),\n\t\t\t\t\t\tOptions: &descriptorpb.MessageOptions{MapEntry: proto.Bool(true)},\n\t\t\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:   proto.String(\"key\"),\n\t\t\t\t\t\t\t\tNumber: proto.Int32(1),\n\t\t\t\t\t\t\t\tLabel:  descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\t\t\tType:   descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:     proto.String(\"value\"),\n\t\t\t\t\t\t\t\tNumber:   proto.Int32(2),\n\t\t\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\t\t\t\t\tTypeName: proto.String(\".foo.bar.ContainsMessageSetBaz\"),\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\tEnumType: []*descriptorpb.EnumDescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Enum\"),\n\t\t\t\tValue: []*descriptorpb.EnumValueDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:   proto.String(\"ZERO\"),\n\t\t\t\t\t\tNumber: proto.Int32(0),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\tName:     proto.String(\"str\"),\n\t\t\t\tNumber:   proto.Int32(10101),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\tName:     proto.String(\"baz\"),\n\t\t\t\tNumber:   proto.Int32(10102),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.Baz\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\tName:     proto.String(\"message_set_baz\"),\n\t\t\t\tNumber:   proto.Int32(10103),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.MessageSetBaz\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\tName:     proto.String(\"contains_message_set_baz\"),\n\t\t\t\tNumber:   proto.Int32(10104),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.ContainsMessageSetBaz\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\tName:     proto.String(\"indirect_contains_message_set_baz\"),\n\t\t\t\tNumber:   proto.Int32(10105),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.IndirectContainsMessageSetBaz\"),\n\t\t\t},\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufconvert/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufconvert\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufctl/bufctl.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufctl\n\nimport (\n\t\"buf.build/go/app\"\n)\n\nconst (\n\t// ExitCodeFileAnnotation is the exit code used when we print file annotations.\n\t//\n\t// We use a different exit code to be able to distinguish user-parsable errors from system errors.\n\t//\n\t// TODO FUTURE: Rename to something like \"ExitCodeCompileError\" as we use this for ImportNotExistErrors as well.\n\tExitCodeFileAnnotation = 100\n)\n\nvar (\n\t// ErrFileAnnotation is used when we print file annotations and want to return an error.\n\t//\n\t// The app package works on the concept that an error results in a non-zero exit\n\t// code, and we already print the messages with PrintFileAnnotations, so we do\n\t// not want to print any additional error message.\n\t//\n\t// We also exit with 100 to be able to distinguish user-parsable errors from system errors.\n\tErrFileAnnotation = app.NewError(ExitCodeFileAnnotation, \"\")\n)\n"
  },
  {
    "path": "private/buf/bufctl/controller.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufctl\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"slices\"\n\t\"sort\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/protovalidate\"\n\t\"buf.build/go/protoyaml\"\n\t\"buf.build/go/standard/xio\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n\t\"github.com/bufbuild/buf/private/buf/bufwkt/bufwktstore\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufreflect\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// ImageWithConfig pairs an Image with its corresponding [bufmodule.Module] full name\n// (which may be nil), [bufmodule.Module] opaque ID, and lint and breaking configurations.\ntype ImageWithConfig interface {\n\tbufimage.Image\n\n\tModuleFullName() bufparse.FullName\n\tModuleOpaqueID() string\n\tLintConfig() bufconfig.LintConfig\n\tBreakingConfig() bufconfig.BreakingConfig\n\tPluginConfigs() []bufconfig.PluginConfig\n\tPolicyConfigs() []bufconfig.PolicyConfig\n\n\tisImageWithConfig()\n}\n\n// Controller is the central entrypoint for the Buf CLI.\ntype Controller interface {\n\tGetWorkspace(\n\t\tctx context.Context,\n\t\tsourceOrModuleInput string,\n\t\toptions ...FunctionOption,\n\t) (bufworkspace.Workspace, error)\n\tGetWorkspaceDepManager(\n\t\tctx context.Context,\n\t\tdirPath string,\n\t\toptions ...FunctionOption,\n\t) (bufworkspace.WorkspaceDepManager, error)\n\tGetImage(\n\t\tctx context.Context,\n\t\tinput string,\n\t\toptions ...FunctionOption,\n\t) (bufimage.Image, error)\n\tGetImageForInputConfig(\n\t\tctx context.Context,\n\t\tinputConfig bufconfig.InputConfig,\n\t\toptions ...FunctionOption,\n\t) (bufimage.Image, error)\n\tGetImageForWorkspace(\n\t\tctx context.Context,\n\t\tworkspace bufworkspace.Workspace,\n\t\toptions ...FunctionOption,\n\t) (bufimage.Image, error)\n\t// GetTargetImageWithConfigsAndCheckClient gets the target ImageWithConfigs\n\t// with a configured bufcheck Client.\n\t//\n\t// ImageWithConfig scopes the configuration per image for use with breaking\n\t// and lint checks. The check Client is bound to the input to ensure that the\n\t// correct remote plugin dependencies are used. A wasmRuntime is provided\n\t// to evaluate Wasm plugins.\n\tGetTargetImageWithConfigsAndCheckClient(\n\t\tctx context.Context,\n\t\tinput string,\n\t\twasmRuntime wasm.Runtime,\n\t\toptions ...FunctionOption,\n\t) ([]ImageWithConfig, bufcheck.Client, error)\n\t// GetImportableImageFileInfos gets the importable .proto FileInfos for the given input.\n\t//\n\t// This includes all files that can be possible imported. For example, if a Module\n\t// is given, this will return FileInfos for the Module, its dependencies, and all of\n\t// the Well-Known Types.\n\t//\n\t// Returned ImageFileInfos are sorted by Path.\n\tGetImportableImageFileInfos(\n\t\tctx context.Context,\n\t\tinput string,\n\t\toptions ...FunctionOption,\n\t) ([]bufimage.ImageFileInfo, error)\n\tPutImage(\n\t\tctx context.Context,\n\t\timageOutput string,\n\t\timage bufimage.Image,\n\t\toptions ...FunctionOption,\n\t) error\n\tGetMessage(\n\t\tctx context.Context,\n\t\tschemaImage bufimage.Image,\n\t\tmessageInput string,\n\t\ttypeName string,\n\t\tdefaultMessageEncoding buffetch.MessageEncoding,\n\t\toptions ...FunctionOption,\n\t) (proto.Message, buffetch.MessageEncoding, error)\n\tPutMessage(\n\t\tctx context.Context,\n\t\tschemaImage bufimage.Image,\n\t\tmessageOutput string,\n\t\tmessage proto.Message,\n\t\tdefaultMessageEncoding buffetch.MessageEncoding,\n\t\toptions ...FunctionOption,\n\t) error\n\t// GetCheckClientForWorkspace returns a new bufcheck Client for the given Workspace.\n\t//\n\t// Clients are bound to a specific Workspace to ensure that the correct\n\t// plugin dependencies are used. A wasmRuntime is provided to evaluate\n\t// Wasm plugins.\n\tGetCheckClientForWorkspace(\n\t\tctx context.Context,\n\t\tworkspace bufworkspace.Workspace,\n\t\twasmRuntime wasm.Runtime,\n\t) (bufcheck.Client, error)\n}\n\n// NewController returns a new Controller.\nfunc NewController(\n\tlogger *slog.Logger,\n\tcontainer app.EnvStdioContainer,\n\tgraphProvider bufmodule.GraphProvider,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n\tmoduleDataProvider bufmodule.ModuleDataProvider,\n\tcommitProvider bufmodule.CommitProvider,\n\tpluginKeyProvider bufplugin.PluginKeyProvider,\n\tpluginDataProvider bufplugin.PluginDataProvider,\n\tpolicyKeyProvider bufpolicy.PolicyKeyProvider,\n\tpolicyDataProvider bufpolicy.PolicyDataProvider,\n\twktStore bufwktstore.Store,\n\thttpClient *http.Client,\n\thttpauthAuthenticator httpauth.Authenticator,\n\tgitClonerOptions git.ClonerOptions,\n\toptions ...ControllerOption,\n) (Controller, error) {\n\treturn newController(\n\t\tlogger,\n\t\tcontainer,\n\t\tgraphProvider,\n\t\tmoduleKeyProvider,\n\t\tmoduleDataProvider,\n\t\tcommitProvider,\n\t\tpluginKeyProvider,\n\t\tpluginDataProvider,\n\t\tpolicyKeyProvider,\n\t\tpolicyDataProvider,\n\t\twktStore,\n\t\thttpClient,\n\t\thttpauthAuthenticator,\n\t\tgitClonerOptions,\n\t\toptions...,\n\t)\n}\n\n/// *** PRIVATE ***\n\n// In theory, we want to keep this separate from our global variables in bufcli.\n//\n// Originally, this was in a different package, and we want to keep the option to split\n// it out again. The separation of concerns here is that the controller doesnt itself\n// deal in the global variables.\ntype controller struct {\n\tlogger             *slog.Logger\n\tcontainer          app.EnvStdioContainer\n\tmoduleDataProvider bufmodule.ModuleDataProvider\n\tgraphProvider      bufmodule.GraphProvider\n\tcommitProvider     bufmodule.CommitProvider\n\tpluginKeyProvider  bufplugin.PluginKeyProvider\n\tpluginDataProvider bufplugin.PluginDataProvider\n\tpolicyKeyProvider  bufpolicy.PolicyKeyProvider\n\tpolicyDataProvider bufpolicy.PolicyDataProvider\n\twktStore           bufwktstore.Store\n\n\tdisableSymlinks           bool\n\tfileAnnotationErrorFormat string\n\tfileAnnotationsToStdout   bool\n\tcopyToInMemory            bool\n\n\tstorageosProvider           storageos.Provider\n\tbuffetchRefParser           buffetch.RefParser\n\tbuffetchReader              buffetch.Reader\n\tbuffetchWriter              buffetch.Writer\n\tworkspaceProvider           bufworkspace.WorkspaceProvider\n\tworkspaceDepManagerProvider bufworkspace.WorkspaceDepManagerProvider\n}\n\nfunc newController(\n\tlogger *slog.Logger,\n\tcontainer app.EnvStdioContainer,\n\tgraphProvider bufmodule.GraphProvider,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n\tmoduleDataProvider bufmodule.ModuleDataProvider,\n\tcommitProvider bufmodule.CommitProvider,\n\tpluginKeyProvider bufplugin.PluginKeyProvider,\n\tpluginDataProvider bufplugin.PluginDataProvider,\n\tpolicyKeyProvider bufpolicy.PolicyKeyProvider,\n\tpolicyDataProvider bufpolicy.PolicyDataProvider,\n\twktStore bufwktstore.Store,\n\thttpClient *http.Client,\n\thttpauthAuthenticator httpauth.Authenticator,\n\tgitClonerOptions git.ClonerOptions,\n\toptions ...ControllerOption,\n) (*controller, error) {\n\tcontroller := &controller{\n\t\tlogger:             logger,\n\t\tcontainer:          container,\n\t\tgraphProvider:      graphProvider,\n\t\tmoduleDataProvider: moduleDataProvider,\n\t\tcommitProvider:     commitProvider,\n\t\tpluginKeyProvider:  pluginKeyProvider,\n\t\tpluginDataProvider: pluginDataProvider,\n\t\tpolicyKeyProvider:  policyKeyProvider,\n\t\tpolicyDataProvider: policyDataProvider,\n\t\twktStore:           wktStore,\n\t}\n\tfor _, option := range options {\n\t\toption(controller)\n\t}\n\tif err := validateFileAnnotationErrorFormat(controller.fileAnnotationErrorFormat); err != nil {\n\t\treturn nil, err\n\t}\n\tcontroller.storageosProvider = newStorageosProvider(controller.disableSymlinks)\n\tcontroller.buffetchRefParser = buffetch.NewRefParser(logger)\n\tcontroller.buffetchReader = buffetch.NewReader(\n\t\tlogger,\n\t\tcontroller.storageosProvider,\n\t\thttpClient,\n\t\thttpauthAuthenticator,\n\t\tgit.NewCloner(\n\t\t\tlogger,\n\t\t\tcontroller.storageosProvider,\n\t\t\tgitClonerOptions,\n\t\t),\n\t\tmoduleKeyProvider,\n\t)\n\tcontroller.buffetchWriter = buffetch.NewWriter(logger)\n\tcontroller.workspaceProvider = bufworkspace.NewWorkspaceProvider(\n\t\tlogger,\n\t\tgraphProvider,\n\t\tmoduleDataProvider,\n\t\tcommitProvider,\n\t\tpluginKeyProvider,\n\t)\n\tcontroller.workspaceDepManagerProvider = bufworkspace.NewWorkspaceDepManagerProvider(\n\t\tlogger,\n\t)\n\treturn controller, nil\n}\n\nfunc (c *controller) GetWorkspace(\n\tctx context.Context,\n\tsourceOrModuleInput string,\n\toptions ...FunctionOption,\n) (_ bufworkspace.Workspace, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\tsourceOrModuleRef, err := c.buffetchRefParser.GetSourceOrModuleRef(ctx, sourceOrModuleInput)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := sourceOrModuleRef.(type) {\n\tcase buffetch.ProtoFileRef:\n\t\treturn c.getWorkspaceForProtoFileRef(ctx, t, functionOptions)\n\tcase buffetch.SourceRef:\n\t\treturn c.getWorkspaceForSourceRef(ctx, t, functionOptions)\n\tcase buffetch.ModuleRef:\n\t\treturn c.getWorkspaceForModuleRef(ctx, t, functionOptions)\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"invalid SourceOrModuleRef: %T\", sourceOrModuleRef)\n\t}\n}\n\nfunc (c *controller) GetWorkspaceDepManager(\n\tctx context.Context,\n\tdirPath string,\n\toptions ...FunctionOption,\n) (_ bufworkspace.WorkspaceDepManager, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\tdirRef, err := c.buffetchRefParser.GetDirRef(ctx, dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.getWorkspaceDepManagerForDirRef(ctx, dirRef, functionOptions)\n}\n\nfunc (c *controller) GetImage(\n\tctx context.Context,\n\tinput string,\n\toptions ...FunctionOption,\n) (_ bufimage.Image, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\treturn c.getImage(ctx, input, functionOptions)\n}\n\nfunc (c *controller) GetImageForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n\toptions ...FunctionOption,\n) (_ bufimage.Image, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\treturn c.getImageForInputConfig(ctx, inputConfig, functionOptions)\n}\n\nfunc (c *controller) GetImageForWorkspace(\n\tctx context.Context,\n\tworkspace bufworkspace.Workspace,\n\toptions ...FunctionOption,\n) (_ bufimage.Image, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\treturn c.getImageForWorkspace(ctx, workspace, functionOptions)\n}\n\nfunc (c *controller) GetTargetImageWithConfigsAndCheckClient(\n\tctx context.Context,\n\tinput string,\n\twasmRuntime wasm.Runtime,\n\toptions ...FunctionOption,\n) (_ []ImageWithConfig, _ bufcheck.Client, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\tref, err := c.buffetchRefParser.GetRef(ctx, input)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar workspace bufworkspace.Workspace\n\tswitch t := ref.(type) {\n\tcase buffetch.ProtoFileRef:\n\t\tworkspace, err = c.getWorkspaceForProtoFileRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\tcase buffetch.SourceRef:\n\t\tworkspace, err = c.getWorkspaceForSourceRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\tcase buffetch.ModuleRef:\n\t\tworkspace, err = c.getWorkspaceForModuleRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\tcase buffetch.MessageRef:\n\t\timage, err := c.getImageForMessageRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tbucket, err := c.storageosProvider.NewReadWriteBucket(\n\t\t\t\".\",\n\t\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tlintConfig := bufconfig.DefaultLintConfigV1\n\t\tbreakingConfig := bufconfig.DefaultBreakingConfigV1\n\t\tvar (\n\t\t\tpluginConfigs            []bufconfig.PluginConfig\n\t\t\tpolicyConfigs            []bufconfig.PolicyConfig\n\t\t\tpluginKeyProvider        = bufplugin.NopPluginKeyProvider\n\t\t\tpolicyKeyProvider        = bufpolicy.NopPolicyKeyProvider\n\t\t\tpolicyPluginKeyProvider  = bufpolicy.NopPolicyPluginKeyProvider\n\t\t\tpolicyPluginDataProvider = bufpolicy.NopPolicyPluginDataProvider\n\t\t)\n\t\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefixOrOverride(\n\t\t\tctx,\n\t\t\tbucket,\n\t\t\t\".\",\n\t\t\tfunctionOptions.configOverride,\n\t\t)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\t// We did not find a buf.yaml in our current directory, and there was no config override.\n\t\t\t// Use the defaults.\n\t\t} else {\n\t\t\tif topLevelLintConfig := bufYAMLFile.TopLevelLintConfig(); topLevelLintConfig == nil {\n\t\t\t\t// Ensure that this is a v2 config\n\t\t\t\tif fileVersion := bufYAMLFile.FileVersion(); fileVersion != bufconfig.FileVersionV2 {\n\t\t\t\t\treturn nil, nil, syserror.Newf(\"non-v2 version with no top-level lint config: %s\", fileVersion)\n\t\t\t\t}\n\t\t\t\t// v2 config without a top-level lint config, use v2 default\n\t\t\t\tlintConfig = bufconfig.DefaultLintConfigV2\n\t\t\t} else {\n\t\t\t\tlintConfig = topLevelLintConfig\n\t\t\t}\n\t\t\tif topLevelBreakingConfig := bufYAMLFile.TopLevelBreakingConfig(); topLevelBreakingConfig == nil {\n\t\t\t\tif fileVersion := bufYAMLFile.FileVersion(); fileVersion != bufconfig.FileVersionV2 {\n\t\t\t\t\treturn nil, nil, syserror.Newf(\"non-v2 version with no top-level breaking config: %s\", fileVersion)\n\t\t\t\t}\n\t\t\t\t// v2 config without a top-level breaking config, use v2 default\n\t\t\t\tbreakingConfig = bufconfig.DefaultBreakingConfigV2\n\t\t\t} else {\n\t\t\t\tbreakingConfig = topLevelBreakingConfig\n\t\t\t}\n\t\t\t// The directory path is resolved to a buf.yaml file and a buf.lock file. If the\n\t\t\t// buf.yaml file is found, the PluginConfigs from the buf.yaml file and the PluginKeys\n\t\t\t// from the buf.lock file are resolved to create the PluginKeyProvider.\n\t\t\tpluginConfigs = bufYAMLFile.PluginConfigs()\n\t\t\tpolicyConfigs = bufYAMLFile.PolicyConfigs()\n\t\t\t// If a config override is provided, the PluginConfig remote Refs use the BSR\n\t\t\t// to resolve the PluginKeys. No buf.lock is required.\n\t\t\t// If the buf.yaml file is not found, the bufplugin.NopPluginKeyProvider is returned.\n\t\t\t// If the buf.lock file is not found, the bufplugin.NopPluginKeyProvider is returned.\n\t\t\tif functionOptions.configOverride != \"\" {\n\t\t\t\t// To support remote plugins in the override, we need to resolve the remote\n\t\t\t\t// Refs to PluginKeys. A buf.lock file is not required for this operation.\n\t\t\t\t// We use the BSR to resolve any remote plugin Refs.\n\t\t\t\tpluginKeyProvider = c.pluginKeyProvider\n\t\t\t} else if bufYAMLFile.FileVersion() == bufconfig.FileVersionV2 {\n\t\t\t\tvar (\n\t\t\t\t\tremotePluginKeys             []bufplugin.PluginKey\n\t\t\t\t\tremotePolicyKeys             []bufpolicy.PolicyKey\n\t\t\t\t\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey\n\t\t\t\t)\n\t\t\t\tif bufLockFile, err := bufconfig.GetBufLockFileForPrefix(\n\t\t\t\t\tctx,\n\t\t\t\t\tbucket,\n\t\t\t\t\t// buf.lock files live next to the buf.yaml\n\t\t\t\t\t\".\",\n\t\t\t\t); err != nil {\n\t\t\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\t\t\treturn nil, nil, err\n\t\t\t\t\t}\n\t\t\t\t\t// We did not find a buf.lock in our current directory.\n\t\t\t\t\t// Remote plugins and policies are not available.\n\t\t\t\t} else {\n\t\t\t\t\tremotePluginKeys = bufLockFile.RemotePluginKeys()\n\t\t\t\t\tremotePolicyKeys = bufLockFile.RemotePolicyKeys()\n\t\t\t\t\tpolicyNameToRemotePluginKeys = bufLockFile.PolicyNameToRemotePluginKeys()\n\t\t\t\t}\n\t\t\t\tpluginKeyProvider, err = newStaticPluginKeyProviderForPluginConfigs(\n\t\t\t\t\tpluginConfigs,\n\t\t\t\t\tremotePluginKeys,\n\t\t\t\t)\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\tpolicyKeyProvider, err = newStaticPolicyKeyProviderForPolicyConfigs(\n\t\t\t\t\tpolicyConfigs,\n\t\t\t\t\tremotePolicyKeys,\n\t\t\t\t)\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\tpolicyPluginKeyProvider, err = newStaticPolicyPluginKeyProviderForPolicyConfigs(\n\t\t\t\t\tpolicyConfigs,\n\t\t\t\t\tpolicyNameToRemotePluginKeys,\n\t\t\t\t)\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\tpolicyPluginDataProvider, err = newStaticPolicyPluginDataProviderForPolicyConfigs(\n\t\t\t\t\tc.pluginDataProvider,\n\t\t\t\t\tpolicyConfigs,\n\t\t\t\t)\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}\n\t\t}\n\t\timageWithConfigs := []ImageWithConfig{\n\t\t\tnewImageWithConfig(\n\t\t\t\timage,\n\t\t\t\tnil, // No module name for a single message ref\n\t\t\t\t\"\",  // No module opaque ID for a single message ref\n\t\t\t\tlintConfig,\n\t\t\t\tbreakingConfig,\n\t\t\t\tpluginConfigs,\n\t\t\t\tpolicyConfigs,\n\t\t\t),\n\t\t}\n\t\tcheckClient, err := bufcheck.NewClient(\n\t\t\tc.logger,\n\t\t\tbufcheck.ClientWithStderr(c.container.Stderr()),\n\t\t\tbufcheck.ClientWithRunnerProvider(\n\t\t\t\tbufcheck.NewLocalRunnerProvider(wasmRuntime),\n\t\t\t),\n\t\t\tbufcheck.ClientWithLocalWasmPluginsFromOS(),\n\t\t\tbufcheck.ClientWithRemoteWasmPlugins(pluginKeyProvider, c.pluginDataProvider),\n\t\t\tbufcheck.ClientWithLocalPoliciesFromOS(),\n\t\t\tbufcheck.ClientWithRemotePolicies(\n\t\t\t\tpolicyKeyProvider,\n\t\t\t\tc.policyDataProvider,\n\t\t\t\tpolicyPluginKeyProvider,\n\t\t\t\tpolicyPluginDataProvider,\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn imageWithConfigs, checkClient, nil\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, nil, syserror.Newf(\"invalid Ref: %T\", ref)\n\t}\n\ttargetImageWithConfigs, err := c.buildTargetImageWithConfigs(ctx, workspace, functionOptions)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tcheckClient, err := c.GetCheckClientForWorkspace(ctx, workspace, wasmRuntime)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn targetImageWithConfigs, checkClient, err\n}\n\nfunc (c *controller) GetImportableImageFileInfos(\n\tctx context.Context,\n\tinput string,\n\toptions ...FunctionOption,\n) (_ []bufimage.ImageFileInfo, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\t// We never care about SourceCodeInfo here.\n\tfunctionOptions.imageExcludeSourceInfo = true\n\t// We always want to include imports for images.\n\tfunctionOptions.imageExcludeImports = false\n\n\tref, err := c.buffetchRefParser.GetRef(ctx, input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar imageFileInfos []bufimage.ImageFileInfo\n\t// For images, we want to get a bucket with no local paths. For everything else,\n\t// we want to get a bucket with local paths. datawkt.ReadBucket will result in\n\t// no local paths, otherwise we get the bucket from the bufwktstore.Store to\n\t// get local paths.\n\twktBucket := datawkt.ReadBucket\n\tswitch t := ref.(type) {\n\tcase buffetch.ProtoFileRef:\n\t\tworkspace, err := c.getWorkspaceForProtoFileRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageFileInfos, err = getImageFileInfosForModuleSet(ctx, workspace)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\twktBucket, err = c.wktStore.GetBucket(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase buffetch.SourceRef:\n\t\tworkspace, err := c.getWorkspaceForSourceRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageFileInfos, err = getImageFileInfosForModuleSet(ctx, workspace)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\twktBucket, err = c.wktStore.GetBucket(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase buffetch.ModuleRef:\n\t\tworkspace, err := c.getWorkspaceForModuleRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageFileInfos, err = getImageFileInfosForModuleSet(ctx, workspace)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\twktBucket, err = c.wktStore.GetBucket(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase buffetch.MessageRef:\n\t\timage, err := c.getImageForMessageRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageFiles := image.Files()\n\t\timageFileInfos = make([]bufimage.ImageFileInfo, len(imageFiles))\n\t\tfor i, imageFile := range imageFiles {\n\t\t\timageFileInfos[i] = imageFile\n\t\t}\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"invalid Ref: %T\", ref)\n\t}\n\timageFileInfos, err = bufimage.AppendWellKnownTypeImageFileInfos(\n\t\tctx,\n\t\twktBucket,\n\t\timageFileInfos,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Slice(\n\t\timageFileInfos,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn imageFileInfos[i].Path() < imageFileInfos[j].Path()\n\t\t},\n\t)\n\treturn imageFileInfos, nil\n}\n\nfunc (c *controller) PutImage(\n\tctx context.Context,\n\timageOutput string,\n\timage bufimage.Image,\n\toptions ...FunctionOption,\n) (retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\t// Must be messageRefParser NOT c.buffetchRefParser as a NewMessageRefParser\n\t// defaults to a defaultMessageEncoding and not dir.\n\tmessageRefParser := buffetch.NewMessageRefParser(c.logger)\n\tmessageRef, err := messageRefParser.GetMessageRef(ctx, imageOutput)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Stop short for performance.\n\tif messageRef.IsNull() {\n\t\treturn nil\n\t}\n\tmarshaler, err := newProtoencodingMarshaler(image, messageRef)\n\tif err != nil {\n\t\treturn err\n\t}\n\tputImage, err := filterImage(image, functionOptions, false)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar putMessage proto.Message\n\tif functionOptions.imageAsFileDescriptorSet {\n\t\tputMessage = bufimage.ImageToFileDescriptorSet(putImage)\n\t} else {\n\t\tputMessage, err = bufimage.ImageToProtoImage(putImage)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tdata, err := marshaler.Marshal(putMessage)\n\tif err != nil {\n\t\treturn err\n\t}\n\twriteCloser, err := c.buffetchWriter.PutMessageFile(ctx, c.container, messageRef)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeCloser.Close())\n\t}()\n\t_, err = writeCloser.Write(data)\n\treturn err\n}\n\nfunc (c *controller) GetMessage(\n\tctx context.Context,\n\tschemaImage bufimage.Image,\n\tmessageInput string,\n\ttypeName string,\n\tdefaultMessageEncoding buffetch.MessageEncoding,\n\toptions ...FunctionOption,\n) (_ proto.Message, _ buffetch.MessageEncoding, retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\t// Must be messageRefParser NOT c.buffetchRefParser as a NewMessageRefParser\n\t// defaults to a defaultMessageEncoding and not dir.\n\tmessageRefParser := buffetch.NewMessageRefParser(\n\t\tc.logger,\n\t\tbuffetch.MessageRefParserWithDefaultMessageEncoding(\n\t\t\tdefaultMessageEncoding,\n\t\t),\n\t)\n\tmessageRef, err := messageRefParser.GetMessageRef(ctx, messageInput)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tmessageEncoding := messageRef.MessageEncoding()\n\tif messageRef.IsNull() {\n\t\treturn nil, messageEncoding, nil\n\t}\n\tvar validator protoyaml.Validator\n\tif functionOptions.messageValidation {\n\t\tprotovalidateValidator, err := protovalidate.New(\n\t\t\tprotovalidate.WithExtensionTypeResolver(schemaImage.Resolver()),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, 0, err\n\t\t}\n\t\tvalidator = yamlValidator{protovalidateValidator}\n\t}\n\tvar unmarshaler protoencoding.Unmarshaler\n\tswitch messageEncoding {\n\tcase buffetch.MessageEncodingBinpb:\n\t\tunmarshaler = protoencoding.NewWireUnmarshaler(schemaImage.Resolver())\n\tcase buffetch.MessageEncodingJSON:\n\t\tunmarshaler = protoencoding.NewJSONUnmarshaler(schemaImage.Resolver())\n\tcase buffetch.MessageEncodingTxtpb:\n\t\tunmarshaler = protoencoding.NewTxtpbUnmarshaler(schemaImage.Resolver())\n\tcase buffetch.MessageEncodingYAML:\n\t\tunmarshaler = protoencoding.NewYAMLUnmarshaler(\n\t\t\tschemaImage.Resolver(),\n\t\t\tprotoencoding.YAMLUnmarshalerWithPath(messageRef.Path()),\n\t\t\t// This will pretty print validation errors.\n\t\t\tprotoencoding.YAMLUnmarshalerWithValidator(validator),\n\t\t)\n\t\tvalidator = nil // Validation errors are handled by the unmarshaler.\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, 0, syserror.Newf(\"unknown MessageEncoding: %v\", messageEncoding)\n\t}\n\treadCloser, err := c.buffetchReader.GetMessageFile(ctx, c.container, messageRef)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tdata, err := xio.ReadAllAndClose(readCloser)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tmessage, err := bufreflect.NewMessage(ctx, schemaImage, typeName)\n\tif err != nil {\n\t\treturn nil, 0, err\n\t}\n\tif err := unmarshaler.Unmarshal(data, message); err != nil {\n\t\treturn nil, 0, err\n\t}\n\tif validator != nil {\n\t\tif err := validator.Validate(message); err != nil {\n\t\t\treturn nil, 0, err\n\t\t}\n\t}\n\treturn message, messageEncoding, nil\n}\n\nfunc (c *controller) PutMessage(\n\tctx context.Context,\n\tschemaImage bufimage.Image,\n\tmessageOutput string,\n\tmessage proto.Message,\n\tdefaultMessageEncoding buffetch.MessageEncoding,\n\toptions ...FunctionOption,\n) (retErr error) {\n\tdefer c.handleFileAnnotationSetRetError(&retErr)\n\tfunctionOptions := newFunctionOptions(c)\n\tfor _, option := range options {\n\t\toption(functionOptions)\n\t}\n\t// Must be messageRefParser NOT c.buffetchRefParser as a NewMessageRefParser\n\t// defaults to a defaultMessageEncoding and not dir.\n\tmessageRefParser := buffetch.NewMessageRefParser(\n\t\tc.logger,\n\t\tbuffetch.MessageRefParserWithDefaultMessageEncoding(\n\t\t\tdefaultMessageEncoding,\n\t\t),\n\t)\n\tmessageRef, err := messageRefParser.GetMessageRef(ctx, messageOutput)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif messageRef.IsNull() {\n\t\treturn nil\n\t}\n\tmarshaler, err := newProtoencodingMarshaler(schemaImage, messageRef)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdata, err := marshaler.Marshal(message)\n\tif err != nil {\n\t\treturn err\n\t}\n\twriteCloser, err := c.buffetchWriter.PutMessageFile(ctx, c.container, messageRef)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = writeCloser.Write(data)\n\treturn errors.Join(err, writeCloser.Close())\n}\n\nfunc (c *controller) GetCheckClientForWorkspace(\n\tctx context.Context,\n\tworkspace bufworkspace.Workspace,\n\twasmRuntime wasm.Runtime,\n) (_ bufcheck.Client, retErr error) {\n\tpluginKeyProvider, err := newStaticPluginKeyProviderForPluginConfigs(\n\t\tworkspace.PluginConfigs(),\n\t\tworkspace.RemotePluginKeys(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyKeyProvider, err := newStaticPolicyKeyProviderForPolicyConfigs(\n\t\tworkspace.PolicyConfigs(),\n\t\tworkspace.RemotePolicyKeys(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyPluginKeyProvider, err := newStaticPolicyPluginKeyProviderForPolicyConfigs(\n\t\tworkspace.PolicyConfigs(),\n\t\tworkspace.PolicyNameToRemotePluginKeys(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyPluginDataProvider, err := newStaticPolicyPluginDataProviderForPolicyConfigs(\n\t\tc.pluginDataProvider,\n\t\tworkspace.PolicyConfigs(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufcheck.NewClient(\n\t\tc.logger,\n\t\tbufcheck.ClientWithStderr(c.container.Stderr()),\n\t\tbufcheck.ClientWithRunnerProvider(\n\t\t\tbufcheck.NewLocalRunnerProvider(wasmRuntime),\n\t\t),\n\t\tbufcheck.ClientWithLocalWasmPluginsFromOS(),\n\t\tbufcheck.ClientWithRemoteWasmPlugins(\n\t\t\tpluginKeyProvider,\n\t\t\tc.pluginDataProvider,\n\t\t),\n\t\tbufcheck.ClientWithLocalPoliciesFromOS(),\n\t\tbufcheck.ClientWithRemotePolicies(\n\t\t\tpolicyKeyProvider,\n\t\t\tc.policyDataProvider,\n\t\t\tpolicyPluginKeyProvider,\n\t\t\tpolicyPluginDataProvider,\n\t\t),\n\t)\n}\n\nfunc (c *controller) getImage(\n\tctx context.Context,\n\tinput string,\n\tfunctionOptions *functionOptions,\n) (bufimage.Image, error) {\n\tref, err := c.buffetchRefParser.GetRef(ctx, input)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.getImageForRef(ctx, ref, functionOptions)\n}\n\nfunc (c *controller) getImageForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n\tfunctionOptions *functionOptions,\n) (bufimage.Image, error) {\n\tref, err := c.buffetchRefParser.GetRefForInputConfig(ctx, inputConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.getImageForRef(ctx, ref, functionOptions)\n}\n\nfunc (c *controller) getImageForRef(\n\tctx context.Context,\n\tref buffetch.Ref,\n\tfunctionOptions *functionOptions,\n) (bufimage.Image, error) {\n\tswitch t := ref.(type) {\n\tcase buffetch.ProtoFileRef:\n\t\tworkspace, err := c.getWorkspaceForProtoFileRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn c.getImageForWorkspace(ctx, workspace, functionOptions)\n\tcase buffetch.SourceRef:\n\t\tworkspace, err := c.getWorkspaceForSourceRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn c.getImageForWorkspace(ctx, workspace, functionOptions)\n\tcase buffetch.ModuleRef:\n\t\tworkspace, err := c.getWorkspaceForModuleRef(ctx, t, functionOptions)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn c.getImageForWorkspace(ctx, workspace, functionOptions)\n\tcase buffetch.MessageRef:\n\t\treturn c.getImageForMessageRef(ctx, t, functionOptions)\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"invalid Ref: %T\", ref)\n\t}\n}\n\nfunc (c *controller) getImageForWorkspace(\n\tctx context.Context,\n\tworkspace bufworkspace.Workspace,\n\tfunctionOptions *functionOptions,\n) (bufimage.Image, error) {\n\timage, err := c.buildImage(\n\t\tctx,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(workspace),\n\t\tfunctionOptions,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := c.warnUnconfiguredTransitiveImports(ctx, workspace, image); err != nil {\n\t\treturn nil, err\n\t}\n\treturn image, nil\n}\n\nfunc (c *controller) getWorkspaceForProtoFileRef(\n\tctx context.Context,\n\tprotoFileRef buffetch.ProtoFileRef,\n\tfunctionOptions *functionOptions,\n) (_ bufworkspace.Workspace, retErr error) {\n\tif len(functionOptions.targetPaths) > 0 {\n\t\t// Even though we didn't have an explicit error case, this never actually worked\n\t\t// properly in the pre-refactor buf CLI. We're going to call it unusable and this\n\t\t// not a breaking change - if anything, this is a bug fix.\n\t\t// TODO FUTURE: Feed flag names through to here.\n\t\treturn nil, fmt.Errorf(\"--path is not valid for use with .proto file references\")\n\t}\n\tif len(functionOptions.targetExcludePaths) > 0 {\n\t\t// Even though we didn't have an explicit error case, this never actually worked\n\t\t// properly in the pre-refactor buf CLI. We're going to call it unusable and this\n\t\t// not a breaking change - if anything, this is a bug fix.\n\t\t// TODO FUTURE: Feed flag names through to here.\n\t\treturn nil, fmt.Errorf(\"--exclude-path is not valid for use with .proto file references\")\n\t}\n\treadBucketCloser, bucketTargeting, err := c.buffetchReader.GetSourceReadBucketCloser(\n\t\tctx,\n\t\tc.container,\n\t\tprotoFileRef,\n\t\tfunctionOptions.getGetReadBucketCloserOptions()...,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readBucketCloser.Close())\n\t}()\n\toptions := []bufworkspace.WorkspaceBucketOption{\n\t\tbufworkspace.WithProtoFileTargetPath(\n\t\t\tprotoFileRef.ProtoFilePath(),\n\t\t\tprotoFileRef.IncludePackageFiles(),\n\t\t),\n\t\tbufworkspace.WithConfigOverride(\n\t\t\tfunctionOptions.configOverride,\n\t\t),\n\t}\n\tif functionOptions.ignoreAndDisallowV1BufWorkYAMLs {\n\t\toptions = append(\n\t\t\toptions,\n\t\t\tbufworkspace.WithIgnoreAndDisallowV1BufWorkYAMLs(),\n\t\t)\n\t}\n\treturn c.workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\treadBucketCloser,\n\t\tbucketTargeting,\n\t\toptions...,\n\t)\n}\n\nfunc (c *controller) getWorkspaceForSourceRef(\n\tctx context.Context,\n\tsourceRef buffetch.SourceRef,\n\tfunctionOptions *functionOptions,\n) (_ bufworkspace.Workspace, retErr error) {\n\treadBucketCloser, bucketTargeting, err := c.buffetchReader.GetSourceReadBucketCloser(\n\t\tctx,\n\t\tc.container,\n\t\tsourceRef,\n\t\tfunctionOptions.getGetReadBucketCloserOptions()...,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readBucketCloser.Close())\n\t}()\n\toptions := []bufworkspace.WorkspaceBucketOption{\n\t\tbufworkspace.WithConfigOverride(\n\t\t\tfunctionOptions.configOverride,\n\t\t),\n\t}\n\tif functionOptions.ignoreAndDisallowV1BufWorkYAMLs {\n\t\toptions = append(\n\t\t\toptions,\n\t\t\tbufworkspace.WithIgnoreAndDisallowV1BufWorkYAMLs(),\n\t\t)\n\t}\n\treturn c.workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\treadBucketCloser,\n\t\tbucketTargeting,\n\t\toptions...,\n\t)\n}\n\nfunc (c *controller) getWorkspaceDepManagerForDirRef(\n\tctx context.Context,\n\tdirRef buffetch.DirRef,\n\tfunctionOptions *functionOptions,\n) (_ bufworkspace.WorkspaceDepManager, retErr error) {\n\treadWriteBucket, bucketTargeting, err := c.buffetchReader.GetDirReadWriteBucket(\n\t\tctx,\n\t\tc.container,\n\t\tdirRef,\n\t\tfunctionOptions.getGetReadWriteBucketOptions()...,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// WE DO NOT USE PATHS/EXCLUDE PATHS.\n\t// When we refactor functionOptions, we need to make sure we only include what we can pass to WorkspaceDepManager.\n\treturn c.workspaceDepManagerProvider.GetWorkspaceDepManager(\n\t\tctx,\n\t\treadWriteBucket,\n\t\tbucketTargeting,\n\t)\n}\n\nfunc (c *controller) getWorkspaceForModuleRef(\n\tctx context.Context,\n\tmoduleRef buffetch.ModuleRef,\n\tfunctionOptions *functionOptions,\n) (bufworkspace.Workspace, error) {\n\tmoduleKey, err := c.buffetchReader.GetModuleKey(ctx, c.container, moduleRef)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn c.workspaceProvider.GetWorkspaceForModuleKey(\n\t\tctx,\n\t\tmoduleKey,\n\t\tbufworkspace.WithTargetPaths(\n\t\t\tfunctionOptions.targetPaths,\n\t\t\tfunctionOptions.targetExcludePaths,\n\t\t),\n\t\tbufworkspace.WithConfigOverride(\n\t\t\tfunctionOptions.configOverride,\n\t\t),\n\t)\n}\n\nfunc (c *controller) getImageForMessageRef(\n\tctx context.Context,\n\tmessageRef buffetch.MessageRef,\n\tfunctionOptions *functionOptions,\n) (_ bufimage.Image, retErr error) {\n\treadCloser, err := c.buffetchReader.GetMessageFile(ctx, c.container, messageRef)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readCloser.Close())\n\t}()\n\tdata, err := io.ReadAll(readCloser)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tprotoImage := &imagev1.Image{}\n\tvar imageFromProtoOptions []bufimage.NewImageForProtoOption\n\n\tswitch messageEncoding := messageRef.MessageEncoding(); messageEncoding {\n\t// we have to double parse due to custom options\n\t// See https://github.com/golang/protobuf/issues/1123\n\tcase buffetch.MessageEncodingBinpb:\n\t\tif err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(data, protoImage); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\tcase buffetch.MessageEncodingJSON:\n\t\tresolver, err := bootstrapResolver(protoencoding.NewJSONUnmarshaler(nil), data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := protoencoding.NewJSONUnmarshaler(resolver).Unmarshal(data, protoImage); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// we've already re-parsed, by unmarshalling 2x above\n\t\timageFromProtoOptions = append(imageFromProtoOptions, bufimage.WithNoReparse())\n\tcase buffetch.MessageEncodingTxtpb:\n\t\tresolver, err := bootstrapResolver(protoencoding.NewTxtpbUnmarshaler(nil), data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := protoencoding.NewTxtpbUnmarshaler(resolver).Unmarshal(data, protoImage); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// we've already re-parsed, by unmarshalling 2x above\n\t\timageFromProtoOptions = append(imageFromProtoOptions, bufimage.WithNoReparse())\n\tcase buffetch.MessageEncodingYAML:\n\t\t// No need to apply validation - Images do not use protovalidate.\n\t\tresolver, err := bootstrapResolver(protoencoding.NewYAMLUnmarshaler(nil), data)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := protoencoding.NewYAMLUnmarshaler(resolver).Unmarshal(data, protoImage); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// we've already re-parsed, by unmarshalling 2x above\n\t\timageFromProtoOptions = append(imageFromProtoOptions, bufimage.WithNoReparse())\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"unknown MessageEncoding: %v\", messageEncoding)\n\t}\n\n\tif functionOptions.imageExcludeSourceInfo {\n\t\tfor _, fileDescriptorProto := range protoImage.GetFile() {\n\t\t\tfileDescriptorProto.ClearSourceCodeInfo()\n\t\t}\n\t}\n\n\timage, err := bufimage.NewImageForProto(protoImage, imageFromProtoOptions...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn filterImage(image, functionOptions, false)\n}\n\nfunc (c *controller) buildImage(\n\tctx context.Context,\n\tmoduleReadBucket bufmodule.ModuleReadBucket,\n\tfunctionOptions *functionOptions,\n) (bufimage.Image, error) {\n\tvar options []bufimage.BuildImageOption\n\tif functionOptions.imageExcludeSourceInfo {\n\t\toptions = append(options, bufimage.WithExcludeSourceCodeInfo())\n\t}\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tc.logger,\n\t\tmoduleReadBucket,\n\t\toptions...,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn filterImage(image, functionOptions, true)\n}\n\n// buildTargetImageWithConfigs builds an image for each module in the workspace.\n// This is used to associate LintConfig and BreakingConfig on a per-module basis.\nfunc (c *controller) buildTargetImageWithConfigs(\n\tctx context.Context,\n\tworkspace bufworkspace.Workspace,\n\tfunctionOptions *functionOptions,\n) ([]ImageWithConfig, error) {\n\tmodules := bufmodule.ModuleSetTargetModules(workspace)\n\timageWithConfigs := make([]ImageWithConfig, 0, len(modules))\n\tfor _, module := range modules {\n\t\tc.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"building image for target module\",\n\t\t\tslog.String(\"moduleOpaqueID\", module.OpaqueID()),\n\t\t\tslog.String(\"moduleDescription\", module.Description()),\n\t\t)\n\t\topaqueID := module.OpaqueID()\n\t\t// We need to make sure that all dependencies are non-targets, so that they\n\t\t// end up as imports in the resulting image.\n\t\tmoduleSet, err := workspace.WithTargetOpaqueIDs(opaqueID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// The moduleReadBucket may include more modules than the target module\n\t\t// and its dependencies. This is because the moduleSet is constructed from\n\t\t// the workspace. Targeting the module does not remove non-related modules.\n\t\t// Build image will use the target info to build the image for the specific\n\t\t// module. Non-targeted modules will not be included in the image.\n\t\tmoduleReadBucket := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet)\n\t\ttargetFileInfos, err := bufmodule.GetTargetFileInfos(ctx, moduleReadBucket)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// This may happen after path targeting. We may have a Module that itself was targeted,\n\t\t// but no target files remain. In this case, this isn't a target image.\n\t\t//\n\t\t// TODO FUTURE: without allowNotExist, this results in silent behavior when --path is incorrect.\n\t\tif len(targetFileInfos) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\timage, err := c.buildImage(\n\t\t\tctx,\n\t\t\tmoduleReadBucket,\n\t\t\tfunctionOptions,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := c.warnUnconfiguredTransitiveImports(ctx, workspace, image); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageWithConfigs = append(\n\t\t\timageWithConfigs,\n\t\t\tnewImageWithConfig(\n\t\t\t\timage,\n\t\t\t\tmodule.FullName(),\n\t\t\t\tmodule.OpaqueID(),\n\t\t\t\tworkspace.GetLintConfigForOpaqueID(module.OpaqueID()),\n\t\t\t\tworkspace.GetBreakingConfigForOpaqueID(module.OpaqueID()),\n\t\t\t\tworkspace.PluginConfigs(),\n\t\t\t\tworkspace.PolicyConfigs(),\n\t\t\t),\n\t\t)\n\t}\n\tif len(imageWithConfigs) == 0 {\n\t\t// If we had no target modules, or no target files within the modules after path filtering, this is an error.\n\t\t// We could have a better user error than this. This gets back to the lack of allowNotExist.\n\t\treturn nil, bufmodule.ErrNoTargetProtoFiles\n\t}\n\treturn imageWithConfigs, nil\n}\n\n// warnUnconfiguredTransitiveImports will print a warning whenever a file imports another file that\n// is not in a local Module, or is not in the declared list of dependencies in your buf.yaml.\n//\n// If all the Modules in the Workspace are remote Modules, no warnings are printed.\nfunc (c *controller) warnUnconfiguredTransitiveImports(\n\tctx context.Context,\n\tworkspace bufworkspace.Workspace,\n\timage bufimage.Image,\n) error {\n\t// First, figure out if we have a local module. If we don't, just return - the Workspace\n\t// was purely built from remote Modules, and therefore buf.yaml configured dependencies\n\t// do not apply.\n\tif xslices.Count(workspace.Modules(), bufmodule.Module.IsLocal) == 0 {\n\t\treturn nil\n\t}\n\t// Construct a struct map of all the FullName strings of the configured buf.yaml\n\t// Module dependencies, and the local Modules. These are considered OK to depend on\n\t// for non-imports in the Image.\n\tconfiguredFullNameStrings, err := xslices.MapError(\n\t\tworkspace.ConfiguredDepModuleRefs(),\n\t\tfunc(moduleRef bufparse.Ref) (string, error) {\n\t\t\tmoduleFullName := moduleRef.FullName()\n\t\t\tif moduleFullName == nil {\n\t\t\t\treturn \"\", syserror.New(\"FullName nil on ModuleRef\")\n\t\t\t}\n\t\t\treturn moduleFullName.String(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfiguredFullNameStringMap := xslices.ToStructMap(configuredFullNameStrings)\n\tfor _, localModule := range bufmodule.ModuleSetLocalModules(workspace) {\n\t\tif moduleFullName := localModule.FullName(); moduleFullName != nil {\n\t\t\tconfiguredFullNameStringMap[moduleFullName.String()] = struct{}{}\n\t\t}\n\t}\n\n\t// Construct a map from Image file path -> FullName string.\n\t//\n\t// If a given file in the Image did not have a FullName, it came from a local unnamed Module\n\t// in the Workspace, and we're safe to ignore it with respect to calculating the undeclared\n\t// transitive imports.\n\tpathToFullNameString := make(map[string]string)\n\tfor _, imageFile := range image.Files() {\n\t\t// If nil, this came from a local unnamed Module in the Workspace, and we're safe to ignore.\n\t\tif moduleFullName := imageFile.FullName(); moduleFullName != nil {\n\t\t\tpathToFullNameString[imageFile.Path()] = moduleFullName.String()\n\t\t}\n\t}\n\n\tfor _, imageFile := range image.Files() {\n\t\t// Ignore imports. We only care about non-imports.\n\t\tif imageFile.IsImport() {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, importPath := range imageFile.FileDescriptorProto().GetDependency() {\n\t\t\tmoduleFullNameString, ok := pathToFullNameString[importPath]\n\t\t\tif !ok {\n\t\t\t\t// The import was from a local unnamed Module in the Workspace.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif _, ok := configuredFullNameStringMap[moduleFullNameString]; !ok {\n\t\t\t\tc.logger.Warn(fmt.Sprintf(\n\t\t\t\t\t`File %q imports %q, which is not in your workspace or in the dependencies declared in your buf.yaml, but is found in transitive dependency %q.\nDeclare %q in the deps key in your buf.yaml.`,\n\t\t\t\t\timageFile.Path(),\n\t\t\t\t\timportPath,\n\t\t\t\t\tmoduleFullNameString,\n\t\t\t\t\tmoduleFullNameString,\n\t\t\t\t))\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// handleFileAnnotationSetError will attempt to handle the error as a FileAnnotationSet, and if so, print\n// the FileAnnotationSet to the writer with the given error format while returning ErrFileAnnotation.\n//\n// Otherwise, the original error is returned.\nfunc (c *controller) handleFileAnnotationSetRetError(retErrAddr *error) {\n\tif *retErrAddr == nil {\n\t\treturn\n\t}\n\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\tif errors.As(*retErrAddr, &fileAnnotationSet) {\n\t\twriter := c.container.Stderr()\n\t\tif c.fileAnnotationsToStdout {\n\t\t\twriter = c.container.Stdout()\n\t\t}\n\t\tif err := bufanalysis.PrintFileAnnotationSet(\n\t\t\twriter,\n\t\t\tfileAnnotationSet,\n\t\t\tc.fileAnnotationErrorFormat,\n\t\t); err != nil {\n\t\t\t*retErrAddr = err\n\t\t\treturn\n\t\t}\n\t\t*retErrAddr = ErrFileAnnotation\n\t}\n}\n\n// Implements [protoyaml.Validator] using [protovalidate.Validator]. This allows us to pass\n// a [protovalidate.Validator] to the [protoencoding.NewYAMLUnmarshaler] and validate types\n// when unmarshalling.\ntype yamlValidator struct{ protovalidateValidator protovalidate.Validator }\n\nfunc (v yamlValidator) Validate(msg proto.Message) error {\n\treturn v.protovalidateValidator.Validate(msg)\n}\n\nfunc getImageFileInfosForModuleSet(ctx context.Context, moduleSet bufmodule.ModuleSet) ([]bufimage.ImageFileInfo, error) {\n\t// Sorted.\n\tfileInfos, err := bufmodule.GetFileInfos(\n\t\tctx,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.Map(\n\t\tfileInfos,\n\t\tfunc(fileInfo bufmodule.FileInfo) bufimage.ImageFileInfo {\n\t\t\treturn bufimage.ImageFileInfoForModuleFileInfo(fileInfo)\n\t\t},\n\t), nil\n}\n\nfunc bootstrapResolver(\n\tunmarshaler protoencoding.Unmarshaler,\n\tdata []byte,\n) (protoencoding.Resolver, error) {\n\tfirstProtoImage := &imagev1.Image{}\n\tif err := unmarshaler.Unmarshal(data, firstProtoImage); err != nil {\n\t\treturn nil, err\n\t}\n\treturn protoencoding.NewResolver(firstProtoImage.GetFile()...)\n}\n\n// WE DO NOT FILTER IF WE ALREADY FILTERED ON BUILDING OF A WORKSPACE\n// Also, paths are still external paths at this point if this came from a workspace\n// TODO FUTURE: redo functionOptions, this is a mess\nfunc filterImage(\n\timage bufimage.Image,\n\tfunctionOptions *functionOptions,\n\timageCameFromAWorkspace bool,\n) (bufimage.Image, error) {\n\tnewImage := image\n\tvar err error\n\tif functionOptions.imageExcludeImports {\n\t\tnewImage = bufimage.ImageWithoutImports(newImage)\n\t}\n\tincludeTypes := functionOptions.imageIncludeTypes\n\texcludeTypes := functionOptions.imageExcludeTypes\n\tif len(includeTypes) > 0 || len(excludeTypes) > 0 {\n\t\tnewImage, err = bufimageutil.FilterImage(\n\t\t\tnewImage,\n\t\t\tbufimageutil.WithIncludeTypes(includeTypes...),\n\t\t\tbufimageutil.WithExcludeTypes(excludeTypes...),\n\t\t\tbufimageutil.WithMutateInPlace(),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif !imageCameFromAWorkspace {\n\t\tif len(functionOptions.targetPaths) > 0 || len(functionOptions.targetExcludePaths) > 0 {\n\t\t\t// bufimage expects normalized paths, so we need to normalize the paths\n\t\t\t// from functionOptions before passing them through.\n\t\t\tnormalizedTargetPaths := make([]string, 0, len(functionOptions.targetPaths))\n\t\t\tnormalizedExcludePaths := make([]string, 0, len(functionOptions.targetExcludePaths))\n\t\t\tfor _, targetPath := range functionOptions.targetPaths {\n\t\t\t\tnormalizedTargetPaths = append(normalizedTargetPaths, normalpath.Normalize(targetPath))\n\t\t\t}\n\t\t\tfor _, excludePath := range functionOptions.targetExcludePaths {\n\t\t\t\tnormalizedExcludePaths = append(normalizedExcludePaths, normalpath.Normalize(excludePath))\n\t\t\t}\n\t\t\t// TODO FUTURE: allowNotExist? Also, does this affect lint or breaking?\n\t\t\tnewImage, err = bufimage.ImageWithOnlyPathsAllowNotExist(\n\t\t\t\tnewImage,\n\t\t\t\tnormalizedTargetPaths,\n\t\t\t\tnormalizedExcludePaths,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\treturn newImage, nil\n}\n\nfunc newStorageosProvider(disableSymlinks bool) storageos.Provider {\n\tvar options []storageos.ProviderOption\n\tif !disableSymlinks {\n\t\toptions = append(options, storageos.ProviderWithSymlinks())\n\t}\n\treturn storageos.NewProvider(options...)\n}\n\nfunc newProtoencodingMarshaler(\n\timage bufimage.Image,\n\tmessageRef buffetch.MessageRef,\n) (protoencoding.Marshaler, error) {\n\tswitch messageEncoding := messageRef.MessageEncoding(); messageEncoding {\n\tcase buffetch.MessageEncodingBinpb:\n\t\treturn protoencoding.NewWireMarshaler(), nil\n\tcase buffetch.MessageEncodingJSON:\n\t\treturn newJSONMarshaler(image.Resolver(), messageRef), nil\n\tcase buffetch.MessageEncodingTxtpb:\n\t\treturn protoencoding.NewTxtpbMarshaler(image.Resolver()), nil\n\tcase buffetch.MessageEncodingYAML:\n\t\treturn newYAMLMarshaler(image.Resolver(), messageRef), nil\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"unknown MessageEncoding: %v\", messageEncoding)\n\t}\n}\n\nfunc newJSONMarshaler(\n\tresolver protoencoding.Resolver,\n\tmessageRef buffetch.MessageRef,\n) protoencoding.Marshaler {\n\tjsonMarshalerOptions := []protoencoding.JSONMarshalerOption{\n\t\t//protoencoding.JSONMarshalerWithIndent(),\n\t}\n\tif messageRef.UseProtoNames() {\n\t\tjsonMarshalerOptions = append(\n\t\t\tjsonMarshalerOptions,\n\t\t\tprotoencoding.JSONMarshalerWithUseProtoNames(),\n\t\t)\n\t}\n\tif messageRef.UseEnumNumbers() {\n\t\tjsonMarshalerOptions = append(\n\t\t\tjsonMarshalerOptions,\n\t\t\tprotoencoding.JSONMarshalerWithUseEnumNumbers(),\n\t\t)\n\t}\n\treturn protoencoding.NewJSONMarshaler(resolver, jsonMarshalerOptions...)\n}\n\nfunc newYAMLMarshaler(\n\tresolver protoencoding.Resolver,\n\tmessageRef buffetch.MessageRef,\n) protoencoding.Marshaler {\n\tyamlMarshalerOptions := []protoencoding.YAMLMarshalerOption{\n\t\tprotoencoding.YAMLMarshalerWithIndent(),\n\t}\n\tif messageRef.UseProtoNames() {\n\t\tyamlMarshalerOptions = append(\n\t\t\tyamlMarshalerOptions,\n\t\t\tprotoencoding.YAMLMarshalerWithUseProtoNames(),\n\t\t)\n\t}\n\tif messageRef.UseEnumNumbers() {\n\t\tyamlMarshalerOptions = append(\n\t\t\tyamlMarshalerOptions,\n\t\t\tprotoencoding.YAMLMarshalerWithUseEnumNumbers(),\n\t\t)\n\t}\n\treturn protoencoding.NewYAMLMarshaler(resolver, yamlMarshalerOptions...)\n}\n\nfunc validateFileAnnotationErrorFormat(fileAnnotationErrorFormat string) error {\n\tif fileAnnotationErrorFormat == \"\" {\n\t\treturn nil\n\t}\n\tif slices.Contains(bufanalysis.AllFormatStrings, fileAnnotationErrorFormat) {\n\t\treturn nil\n\t}\n\t// TODO FUTURE: get standard flag names and bindings into this package.\n\tfileAnnotationErrorFormatFlagName := \"error-format\"\n\treturn appcmd.NewInvalidArgumentErrorf(\"--%s: invalid format: %q\", fileAnnotationErrorFormatFlagName, fileAnnotationErrorFormat)\n}\n\n// newStaticPluginKeyProvider creates a new PluginKeyProvider for the set of PluginKeys.\n//\n// The PluginKeys come from the buf.lock file. The PluginKeyProvider is static\n// and does not change. PluginConfigs are validated to ensure that all remote\n// PluginConfigs are pinned in the buf.lock file.\nfunc newStaticPluginKeyProviderForPluginConfigs(\n\tpluginConfigs []bufconfig.PluginConfig,\n\tpluginKeys []bufplugin.PluginKey,\n) (_ bufplugin.PluginKeyProvider, retErr error) {\n\t// Validate that all remote PluginConfigs are present in the buf.lock file.\n\tpluginKeysByFullName, err := xslices.ToUniqueValuesMap(pluginKeys, func(pluginKey bufplugin.PluginKey) string {\n\t\treturn pluginKey.FullName().String()\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to validate remote PluginKeys: %w\", err)\n\t}\n\t// Remote PluginConfig Refs are any PluginConfigs that have a Ref.\n\tremotePluginRefs := xslices.Filter(\n\t\txslices.Map(pluginConfigs, func(pluginConfig bufconfig.PluginConfig) bufparse.Ref {\n\t\t\treturn pluginConfig.Ref()\n\t\t}),\n\t\tfunc(pluginRef bufparse.Ref) bool {\n\t\t\treturn pluginRef != nil\n\t\t},\n\t)\n\tfor _, remotePluginRef := range remotePluginRefs {\n\t\tif _, ok := pluginKeysByFullName[remotePluginRef.FullName().String()]; !ok {\n\t\t\treturn nil, fmt.Errorf(`remote plugin %q is not in the buf.lock file, use \"buf plugin update\" to pin remote refs`, remotePluginRef)\n\t\t}\n\t}\n\treturn bufplugin.NewStaticPluginKeyProvider(pluginKeys)\n}\n\n// newStaticPolicyKeyProvider creates a new PolicyKeyProvider for the set of PolicyKeys.\n//\n// The PolicyKeys come from the buf.lock file. The PolicyKeyProvider is static\n// and does not change. PolicyConfigs are validated to ensure that all remote\n// PolicyConfigs are pinned in the buf.lock file.\nfunc newStaticPolicyKeyProviderForPolicyConfigs(\n\tpolicyConfigs []bufconfig.PolicyConfig,\n\tpolicyKeys []bufpolicy.PolicyKey,\n) (_ bufpolicy.PolicyKeyProvider, retErr error) {\n\t// Validate that all remote PolicyConfigs are present in the buf.lock file.\n\tpolicyKeysByFullName, err := xslices.ToUniqueValuesMap(policyKeys, func(policyKey bufpolicy.PolicyKey) string {\n\t\treturn policyKey.FullName().String()\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to validate remote PolicyKeys: %w\", err)\n\t}\n\t// Remote PolicyConfig Refs are any PolicyConfigs that have a Ref.\n\tremotePolicyRefs := xslices.Filter(\n\t\txslices.Map(policyConfigs, func(policyConfig bufconfig.PolicyConfig) bufparse.Ref {\n\t\t\treturn policyConfig.Ref()\n\t\t}),\n\t\tfunc(policyRef bufparse.Ref) bool {\n\t\t\treturn policyRef != nil\n\t\t},\n\t)\n\tfor _, remotePolicyRef := range remotePolicyRefs {\n\t\tif _, ok := policyKeysByFullName[remotePolicyRef.FullName().String()]; !ok {\n\t\t\treturn nil, fmt.Errorf(`remote policy %q is not in the buf.lock file, use \"buf policy update\" to pin remote refs`, remotePolicyRef)\n\t\t}\n\t}\n\treturn bufpolicy.NewStaticPolicyKeyProvider(policyKeys)\n}\n\n// newStaticPolicyPluginKeyProviderForPolicyConfigs creates a new PolicyPluginKeyProvider for the set of PolicyConfigs.\nfunc newStaticPolicyPluginKeyProviderForPolicyConfigs(\n\tpolicyConfigs []bufconfig.PolicyConfig,\n\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey,\n) (bufpolicy.PolicyPluginKeyProvider, error) {\n\tpolicyNames, err := xslices.ToUniqueValuesMap(policyConfigs, func(policyConfig bufconfig.PolicyConfig) string {\n\t\tpolicyName := policyConfig.Name()\n\t\tif policyConfig.Ref() != nil {\n\t\t\t// Remote policies are required to be referenced by their full name.\n\t\t\t// The buf.lock stores the name.\n\t\t\tpolicyName = policyConfig.Ref().FullName().String()\n\t\t}\n\t\treturn policyName\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to validate policy names in policy configs: %w\", err)\n\t}\n\t// We do not validate that all remote PolicyConfig plugins are present in the buf.lock file.\n\t// This would require loading the PolicyConfig data. Check is defered to the runtime.\n\tfor policyName, remotePluginKeys := range policyNameToRemotePluginKeys {\n\t\t_, err := xslices.ToUniqueValuesMap(remotePluginKeys, func(pluginKey bufplugin.PluginKey) string {\n\t\t\treturn pluginKey.FullName().String()\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to validate remote PluginKeys for Policy %q: %w\", policyName, err)\n\t\t}\n\t\tif _, ok := policyNames[policyName]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"remote plugins configured for unknown policy %q\", policyName)\n\t\t}\n\t}\n\treturn bufpolicy.NewStaticPolicyPluginKeyProvider(policyNameToRemotePluginKeys)\n}\n\n// newStaticPolicyPluginDataProviderForPolicyConfigs creates a new PolicyPluginKeyProvider for the set of PolicyConfigs.\n//\n// The pluginDataProvider is shared across all policies.\nfunc newStaticPolicyPluginDataProviderForPolicyConfigs(\n\tpluginDataProvider bufplugin.PluginDataProvider,\n\tpolicyConfigs []bufconfig.PolicyConfig,\n) (bufpolicy.PolicyPluginDataProvider, error) {\n\tpolicyNameToPluginDataProvider := make(map[string]bufplugin.PluginDataProvider)\n\tfor _, policyConfig := range policyConfigs {\n\t\tpolicyName := policyConfig.Name()\n\t\tif _, ok := policyNameToPluginDataProvider[policyName]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate policy name %q found in policy configs\", policyName)\n\t\t}\n\t\t// We use the same pluginDataProvider for all policies.\n\t\tpolicyNameToPluginDataProvider[policyName] = pluginDataProvider\n\t}\n\treturn bufpolicy.NewStaticPolicyPluginDataProvider(policyNameToPluginDataProvider)\n}\n"
  },
  {
    "path": "private/buf/bufctl/image_with_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufctl\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n)\n\ntype imageWithConfig struct {\n\tbufimage.Image\n\n\tmoduleFullName bufparse.FullName\n\tmoduleOpaqueID string\n\tlintConfig     bufconfig.LintConfig\n\tbreakingConfig bufconfig.BreakingConfig\n\tpluginConfigs  []bufconfig.PluginConfig\n\tpolicyConfigs  []bufconfig.PolicyConfig\n}\n\nfunc newImageWithConfig(\n\timage bufimage.Image,\n\tmoduleFullName bufparse.FullName,\n\tmoduleOpaqueID string,\n\tlintConfig bufconfig.LintConfig,\n\tbreakingConfig bufconfig.BreakingConfig,\n\tpluginConfigs []bufconfig.PluginConfig,\n\tpolicyConfigs []bufconfig.PolicyConfig,\n) *imageWithConfig {\n\treturn &imageWithConfig{\n\t\tImage:          image,\n\t\tmoduleFullName: moduleFullName,\n\t\tmoduleOpaqueID: moduleOpaqueID,\n\t\tlintConfig:     lintConfig,\n\t\tbreakingConfig: breakingConfig,\n\t\tpluginConfigs:  pluginConfigs,\n\t\tpolicyConfigs:  policyConfigs,\n\t}\n}\n\nfunc (i *imageWithConfig) ModuleFullName() bufparse.FullName {\n\treturn i.moduleFullName\n}\n\nfunc (i *imageWithConfig) ModuleOpaqueID() string {\n\treturn i.moduleOpaqueID\n}\n\nfunc (i *imageWithConfig) LintConfig() bufconfig.LintConfig {\n\treturn i.lintConfig\n}\n\nfunc (i *imageWithConfig) BreakingConfig() bufconfig.BreakingConfig {\n\treturn i.breakingConfig\n}\n\nfunc (i *imageWithConfig) PluginConfigs() []bufconfig.PluginConfig {\n\treturn i.pluginConfigs\n}\n\nfunc (i *imageWithConfig) PolicyConfigs() []bufconfig.PolicyConfig {\n\treturn i.policyConfigs\n}\n\nfunc (*imageWithConfig) isImageWithConfig() {}\n"
  },
  {
    "path": "private/buf/bufctl/option.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufctl\n\nimport (\n\t\"github.com/bufbuild/buf/private/buf/buffetch\"\n)\n\n// ControllerOption is a controller option.\ntype ControllerOption func(*controller)\n\n// WithDisableSymlinks returns a new ControllerOption that\nfunc WithDisableSymlinks(disableSymlinks bool) ControllerOption {\n\treturn func(controller *controller) {\n\t\tcontroller.disableSymlinks = disableSymlinks\n\t}\n}\n\n// WithFileAnnotationErrorFormat returns a new ControllerOption that sets the FileAnnotation format.\nfunc WithFileAnnotationErrorFormat(fileAnnotationErrorFormat string) ControllerOption {\n\treturn func(controller *controller) {\n\t\tcontroller.fileAnnotationErrorFormat = fileAnnotationErrorFormat\n\t}\n}\n\n// WithFileAnnotationsToStdout returns a new ControllerOption that sends FileAnnotations to stdout\nfunc WithFileAnnotationsToStdout() ControllerOption {\n\treturn func(controller *controller) {\n\t\tcontroller.fileAnnotationsToStdout = true\n\t}\n}\n\n// WithCopyToInMemory returns a new ControllerOption that copies to memory.\nfunc WithCopyToInMemory() ControllerOption {\n\treturn func(controller *controller) {\n\t\tcontroller.copyToInMemory = true\n\t}\n}\n\n// FunctionOption is an option for a function in a Controller.\n//\n// TODO FUTURE: split up to per-function.\ntype FunctionOption func(*functionOptions)\n\n// WithTargetPaths returns a new FunctionOption that  sets the target paths.\nfunc WithTargetPaths(targetPaths []string, targetExcludePaths []string) FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.targetPaths = targetPaths\n\t\tfunctionOptions.targetExcludePaths = targetExcludePaths\n\t}\n}\n\n// WithImageExcludeSourceInfo returns a new FunctionOption that excludes source code info.\nfunc WithImageExcludeSourceInfo(imageExcludeSourceInfo bool) FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.imageExcludeSourceInfo = imageExcludeSourceInfo\n\t}\n}\n\n// WithImageExcludeImports returns a new FunctionOption that excludes imports.\nfunc WithImageExcludeImports(imageExcludeImports bool) FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.imageExcludeImports = imageExcludeImports\n\t}\n}\n\n// WithImageIncludeTypes returns a new FunctionOption that includes the given types.\nfunc WithImageIncludeTypes(imageTypes []string) FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.imageIncludeTypes = imageTypes\n\t}\n}\n\n// WithImageExcludeTypes returns a new FunctionOption that excludes the given types.\nfunc WithImageExcludeTypes(imageExcludeTypes []string) FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.imageExcludeTypes = imageExcludeTypes\n\t}\n}\n\n// WithImageAsFileDescriptorSet returns a new FunctionOption that returns the image as a FileDescriptorSet.\nfunc WithImageAsFileDescriptorSet(imageAsFileDescriptorSet bool) FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.imageAsFileDescriptorSet = imageAsFileDescriptorSet\n\t}\n}\n\n// WithConfigOverride applies the config override.\n//\n// This flag will only work if no buf.work.yaml is detected, and the buf.yaml is a\n// v1beta1 buf.yaml, v1 buf.yaml, or no buf.yaml. This flag will not work if a buf.work.yaml\n// is detected, or a v2 buf.yaml is detected.\n//\n// If used with an image or module ref, this has no effect on the build, i.e. excludes are\n// not respected, and the module name is ignored. This matches old behavior.\n//\n// This implements the soon-to-be-deprecated --config flag.\n//\n// See bufconfig.GetBufYAMLFileForPrefixOrOverride for more details.\n//\n// *** DO NOT USE THIS OUTSIDE OF THE CLI AND/OR IF YOU DON'T UNDERSTAND IT. ***\n// *** DO NOT ADD THIS TO ANY NEW COMMANDS. ***\n//\n// Current commands that use this: build, breaking, lint, generate, format,\n// export, ls-breaking-rules, ls-lint-rules.\nfunc WithConfigOverride(configOverride string) FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.configOverride = configOverride\n\t}\n}\n\n// WithIgnoreAndDisallowV1BufWorkYAMLs returns a new FunctionOption that says\n// to ignore dependencies from buf.work.yamls at the root of the bucket, and to also\n// disallow directories with buf.work.yamls to be directly targeted.\n//\n// See bufworkspace.WithIgnoreAndDisallowV1BufWorkYAMLs for more details.\nfunc WithIgnoreAndDisallowV1BufWorkYAMLs() FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.ignoreAndDisallowV1BufWorkYAMLs = true\n\t}\n}\n\n// WithMessageValidation returns a new FunctionOption that says to validate the\n// message as it is being read.\n//\n// We want to do this as part of the read/unmarshal, as protoyaml has specific logic\n// on unmarshal that will pretty print validations.\nfunc WithMessageValidation() FunctionOption {\n\treturn func(functionOptions *functionOptions) {\n\t\tfunctionOptions.messageValidation = true\n\t}\n}\n\n// *** PRIVATE ***\n\ntype functionOptions struct {\n\tcopyToInMemory bool\n\n\ttargetPaths                     []string\n\ttargetExcludePaths              []string\n\timageExcludeSourceInfo          bool\n\timageExcludeImports             bool\n\timageIncludeTypes               []string\n\timageExcludeTypes               []string\n\timageAsFileDescriptorSet        bool\n\tconfigOverride                  string\n\tignoreAndDisallowV1BufWorkYAMLs bool\n\tmessageValidation               bool\n}\n\nfunc newFunctionOptions(controller *controller) *functionOptions {\n\treturn &functionOptions{\n\t\tcopyToInMemory: controller.copyToInMemory,\n\t}\n}\n\nfunc (f *functionOptions) getGetReadBucketCloserOptions() []buffetch.GetReadBucketCloserOption {\n\tvar getReadBucketCloserOptions []buffetch.GetReadBucketCloserOption\n\tif f.copyToInMemory {\n\t\tgetReadBucketCloserOptions = append(\n\t\t\tgetReadBucketCloserOptions,\n\t\t\tbuffetch.GetReadBucketCloserWithCopyToInMemory(),\n\t\t)\n\t}\n\tif len(f.targetPaths) > 0 {\n\t\tgetReadBucketCloserOptions = append(\n\t\t\tgetReadBucketCloserOptions,\n\t\t\tbuffetch.GetReadBucketCloserWithTargetPaths(f.targetPaths),\n\t\t)\n\t}\n\tif len(f.targetExcludePaths) > 0 {\n\t\tgetReadBucketCloserOptions = append(\n\t\t\tgetReadBucketCloserOptions,\n\t\t\tbuffetch.GetReadBucketCloserWithTargetExcludePaths(f.targetExcludePaths),\n\t\t)\n\t}\n\tif f.configOverride != \"\" {\n\t\t// If we have a config override, we do not search for buf.yamls or buf.work.yamls,\n\t\t// instead acting as if the config override was the only configuration file available.\n\t\t//\n\t\t// Note that this is slightly different behavior than the pre-refactor CLI had, but this\n\t\t// was always the intended behavior. The pre-refactor CLI would error if you had a buf.work.yaml,\n\t\t// and did the same search behavior for buf.yamls, which didn't really make sense. In the new\n\t\t// world where buf.yamls also represent the behavior of buf.work.yamls, you should be able\n\t\t// to specify whatever want here.\n\t\tgetReadBucketCloserOptions = append(\n\t\t\tgetReadBucketCloserOptions,\n\t\t\tbuffetch.GetReadBucketCloserWithNoSearch(),\n\t\t)\n\t}\n\treturn getReadBucketCloserOptions\n}\n\nfunc (f *functionOptions) getGetReadWriteBucketOptions() []buffetch.GetReadWriteBucketOption {\n\tif f.configOverride != \"\" {\n\t\t// If we have a config override, we do not search for buf.yamls or buf.work.yamls,\n\t\t// instead acting as if the config override was the only configuration file available.\n\t\t//\n\t\t// Note that this is slightly different behavior than the pre-refactor CLI had, but this\n\t\t// was always the intended behavior. The pre-refactor CLI would error if you had a buf.work.yaml,\n\t\t// and did the same search behavior for buf.yamls, which didn't really make sense. In the new\n\t\t// world where buf.yamls also represent the behavior of buf.work.yamls, you should be able\n\t\t// to specify whatever want here.\n\t\treturn []buffetch.GetReadWriteBucketOption{\n\t\t\tbuffetch.GetReadWriteBucketWithNoSearch(),\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/bufctl/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufctl\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufcurl/bufcurl.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/reflect/protoregistry\"\n)\n\n// Invoker provides the ability to invoke RPCs dynamically.\ntype Invoker interface {\n\t// Invoke invokes an RPC method using the given input data and request headers.\n\t// The dataSource is a string that describes the input data (e.g. a filename).\n\t// The actual contents of the request data is read from the given reader.\n\tInvoke(ctx context.Context, dataSource string, data io.Reader, headers http.Header) error\n}\n\n// ResolveMethodDescriptor uses the given resolver to find a descriptor for\n// the requested service and method. The service name must be fully-qualified.\nfunc ResolveMethodDescriptor(res protoencoding.Resolver, service, method string) (protoreflect.MethodDescriptor, error) {\n\tserviceDescriptor, err := ResolveServiceDescriptor(res, service)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmethodDescriptor := serviceDescriptor.Methods().ByName(protoreflect.Name(method))\n\tif methodDescriptor == nil {\n\t\treturn nil, fmt.Errorf(\"URL indicates method name %q, but service %q contains no such method\", method, service)\n\t}\n\treturn methodDescriptor, nil\n}\n\n// ResolveServiceDescriptor uses the given resolver to find a descriptor for\n// the requested service. The service name must be fully-qualified.\nfunc ResolveServiceDescriptor(res protoencoding.Resolver, service string) (protoreflect.ServiceDescriptor, error) {\n\tdescriptor, err := res.FindDescriptorByName(protoreflect.FullName(service))\n\tif errors.Is(err, protoregistry.NotFound) {\n\t\treturn nil, fmt.Errorf(\"failed to find service named %q in schema\", service)\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\tserviceDescriptor, ok := descriptor.(protoreflect.ServiceDescriptor)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"URL indicates service name %q, but that name is a %s\", service, descriptorKind(descriptor))\n\t}\n\treturn serviceDescriptor, nil\n}\n"
  },
  {
    "path": "private/buf/bufcurl/headers.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// headersBlockList contains disallowed headers. These are headers that are part\n// of the Connect or gRPC protocol and set by the protocol implementations, so\n// should not be set otherwise. It also includes \"transfer-encoding\", which is\n// not part of either protocol, but is unsafe for users to set as it handled\n// by the user agent.\n//\n// In addition to these headers, header names that start with \"Connect-\" and\n// \"Grpc-\" are also reserved for use by protocol implementations.\nvar headerBlockList = map[string]struct{}{\n\t\"accept\":            {},\n\t\"accept-encoding\":   {},\n\t\"content-type\":      {},\n\t\"content-encoding\":  {},\n\t\"te\":                {},\n\t\"transfer-encoding\": {},\n}\n\n// GetAuthority determines the authority for a request with the given URL and\n// request headers. If headers include a \"Host\" header, that is used. (If the\n// request contains more than one, that is usually not valid or acceptable to\n// servers, but this function will look at only the first.) If there is no\n// such header, the authority is the host portion of the URL (both the domain\n// name/IP address and port).\nfunc GetAuthority(urlHost string, headers http.Header) string {\n\theader := headers.Get(\"host\")\n\tif header != \"\" {\n\t\treturn header\n\t}\n\treturn urlHost\n}\n\n// LoadHeaders computes the set of request headers from the given flag values,\n// loading from file(s) if so instructed. A header flag is usually in the form\n// \"name: value\", but it may start with \"@\" to indicate a filename from which\n// headers are loaded. It may also be \"*\", to indicate that the given others\n// are included in full.\n//\n// If the filename following an \"@\" header flag is \"-\", it means to read from\n// stdin.\n//\n// The given dataFile is the name of a file from which request data is read. If\n// a \"@\" header flag indicates to read from the same file, then the headers must\n// be at the start of the file, following by a blank line, followed by the\n// actual request body. In such a case, the returned ReadCloser will be non-nil\n// and correspond to that point in the file (after headers and blank line), so\n// the request body can be read from it.\nfunc LoadHeaders(headerFlags []string, dataFile string, others http.Header) (http.Header, io.ReadCloser, error) {\n\tvar dataReader io.ReadCloser\n\theaders := http.Header{}\n\tfor _, headerFlag := range headerFlags {\n\t\tswitch {\n\t\tcase strings.HasPrefix(headerFlag, \"@\"):\n\t\t\theaderFile := strings.TrimPrefix(headerFlag, \"@\")\n\t\t\tif headerFile != \"-\" {\n\t\t\t\tif absFile, err := filepath.Abs(headerFile); err == nil {\n\t\t\t\t\theaderFile = absFile\n\t\t\t\t}\n\t\t\t}\n\t\t\tisAlsoDataFile := headerFile == dataFile\n\t\t\treader, err := readHeadersFile(headerFile, isAlsoDataFile, headers)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tif isAlsoDataFile {\n\t\t\t\tdataReader = reader\n\t\t\t}\n\t\tcase headerFlag == \"*\":\n\t\t\tfor k, v := range others {\n\t\t\t\theaders[k] = append(headers[k], v...)\n\t\t\t}\n\t\tdefault:\n\t\t\taddHeader(headerFlag, headers)\n\t\t}\n\t}\n\t// make sure there are no disallowed headers used\n\tfor key := range headers {\n\t\tlowerKey := strings.ToLower(key)\n\t\tif _, ok := headerBlockList[lowerKey]; ok || strings.HasPrefix(lowerKey, \"grpc-\") || strings.HasPrefix(lowerKey, \"connect-\") {\n\t\t\treturn nil, nil, fmt.Errorf(\"invalid header: %q is reserved and may not be used\", key)\n\t\t}\n\t}\n\treturn headers, dataReader, nil\n}\n\nfunc readHeadersFile(headerFile string, stopAtBlankLine bool, headers http.Header) (reader io.ReadCloser, err error) {\n\tvar f *os.File\n\tif headerFile == \"-\" {\n\t\tf = os.Stdin\n\t} else {\n\t\tf, err = os.Open(headerFile)\n\t\tif err != nil {\n\t\t\treturn nil, ErrorHasFilename(err, headerFile)\n\t\t}\n\t}\n\tdefer func() {\n\t\tif f != nil {\n\t\t\tcloseErr := f.Close()\n\t\t\tif closeErr != nil {\n\t\t\t\terr = errors.Join(err, ErrorHasFilename(closeErr, headerFile))\n\t\t\t}\n\t\t}\n\t}()\n\tin := &lineReader{r: bufio.NewReader(f)}\n\tvar lineNo int\n\tfor {\n\t\tline, err := in.ReadLine()\n\t\tif err == io.EOF {\n\t\t\tif stopAtBlankLine {\n\t\t\t\t// never hit a blank line\n\t\t\t\treturn nil, ErrorHasFilename(io.ErrUnexpectedEOF, headerFile)\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t} else if err != nil {\n\t\t\treturn nil, ErrorHasFilename(err, headerFile)\n\t\t}\n\t\tif line == \"\" && stopAtBlankLine {\n\t\t\tcloser := f\n\t\t\t// we don't want close f on return in above defer function, so we clear it\n\t\t\tf = nil\n\t\t\treturn &readerWithClose{Reader: in, Closer: closer}, nil\n\t\t}\n\t\tline = strings.TrimSpace(line)\n\t\tif strings.TrimSpace(line) == \"\" || strings.HasPrefix(line, \"#\") {\n\t\t\t// ignore blank lines and shell-style comments\n\t\t\tcontinue\n\t\t}\n\t\tif !addHeader(line, headers) {\n\t\t\treturn nil, fmt.Errorf(\"%s:%d: malformed header: %q\", headerFile, lineNo, line)\n\t\t}\n\t\tlineNo++\n\t}\n}\n\nfunc addHeader(header string, dest http.Header) bool {\n\tparts := strings.SplitN(header, \":\", 2)\n\theaderName := parts[0]\n\thasValue := len(parts) > 1\n\tvar headerVal string\n\tif hasValue {\n\t\theaderVal = parts[1]\n\t}\n\tdest.Add(strings.TrimSpace(headerName), strings.TrimSpace(headerVal))\n\treturn hasValue\n}\n"
  },
  {
    "path": "private/buf/bufcurl/invoker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"maps\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"sync\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/verbose\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n)\n\ntype deferredMessage struct {\n\tdata []byte\n}\n\ntype protoCodec struct{}\n\nfunc (p protoCodec) Name() string {\n\treturn \"proto\"\n}\n\nfunc (p protoCodec) Marshal(a any) ([]byte, error) {\n\tprotoMessage, ok := a.(proto.Message)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"cannot marshal: %T does not implement proto.Message\", a)\n\t}\n\treturn protoencoding.NewWireMarshaler().Marshal(protoMessage)\n}\n\nfunc (p protoCodec) Unmarshal(bytes []byte, a any) error {\n\tif deferred, ok := a.(*deferredMessage); ok {\n\t\t// must make a copy since Connect framework will re-use the byte slice\n\t\tdeferred.data = make([]byte, len(bytes))\n\t\tcopy(deferred.data, bytes)\n\t\treturn nil\n\t}\n\tprotoMessage, ok := a.(proto.Message)\n\tif !ok {\n\t\treturn fmt.Errorf(\"cannot unmarshal: %T does not implement proto.Message\", a)\n\t}\n\treturn protoencoding.NewWireUnmarshaler(nil).Unmarshal(bytes, protoMessage)\n}\n\ntype invokeClient = connect.Client[dynamicpb.Message, deferredMessage]\n\ntype invoker struct {\n\tmd           protoreflect.MethodDescriptor\n\tres          protoencoding.Resolver\n\temitDefaults bool\n\tclient       *invokeClient\n\toutput       io.Writer\n\terrOutput    io.Writer\n\tprinter      verbose.Printer\n}\n\n// NewInvoker creates a new invoker for invoking the method described by the\n// given descriptor. The given writer is used to write the output response(s)\n// in JSON format. The given resolver is used to resolve Any messages and\n// extensions that appear in the input or output. Other parameters are used\n// to create a Connect client, for issuing the RPC.\nfunc NewInvoker(container appext.Container, verbosePrinter verbose.Printer, md protoreflect.MethodDescriptor, res protoencoding.Resolver, emitDefaults bool, httpClient connect.HTTPClient, opts []connect.ClientOption, url string, out io.Writer) Invoker {\n\topts = append(opts, connect.WithCodec(protoCodec{}))\n\t// TODO: could also provide custom compressor implementations that could give us\n\t//  optics into when request and response messages are compressed (which could be\n\t//  useful to include in verbose output).\n\treturn &invoker{\n\t\tmd:           md,\n\t\tres:          res,\n\t\temitDefaults: emitDefaults,\n\t\toutput:       out,\n\t\tprinter:      verbosePrinter,\n\t\terrOutput:    container.Stderr(),\n\t\tclient:       connect.NewClient[dynamicpb.Message, deferredMessage](httpClient, url, opts...),\n\t}\n}\n\nfunc (inv *invoker) Invoke(ctx context.Context, dataSource string, data io.Reader, headers http.Header) error {\n\tinv.printer.Printf(\"* Invoking RPC %s\\n\", inv.md.FullName())\n\t// request's user-agent header(s) get overwritten by protocol, so we stash them in the\n\t// context so that underlying transport can restore them\n\tctx = withUserAgent(ctx, headers)\n\tswitch {\n\tcase inv.md.IsStreamingServer() && inv.md.IsStreamingClient():\n\t\treturn inv.handleBidiStream(ctx, dataSource, data, headers)\n\tcase inv.md.IsStreamingServer():\n\t\treturn inv.handleServerStream(ctx, dataSource, data, headers)\n\tcase inv.md.IsStreamingClient():\n\t\treturn inv.handleClientStream(ctx, dataSource, data, headers)\n\tdefault:\n\t\treturn inv.handleUnary(ctx, dataSource, data, headers)\n\t}\n}\n\nfunc (inv *invoker) handleUnary(ctx context.Context, dataSource string, data io.Reader, headers http.Header) error {\n\tprovider := newMessageProvider(dataSource, data, inv.res)\n\tmsg := dynamicpb.NewMessage(inv.md.Input())\n\tif err := provider.next(msg); err != nil {\n\t\treturn err\n\t}\n\t// make sure input does not contain a second message\n\tdummy := dynamicpb.NewMessage(inv.md.Input())\n\tif err := provider.next(dummy); err != io.EOF {\n\t\treturn fmt.Errorf(\"method %s is a unary RPC, but input contained more than one request message\", inv.md.Name())\n\t}\n\n\treq := connect.NewRequest(msg)\n\tmaps.Copy(req.Header(), headers)\n\tresp, err := inv.client.CallUnary(ctx, req)\n\tif err != nil {\n\t\tvar connErr *connect.Error\n\t\tif !errors.As(err, &connErr) {\n\t\t\treturn err\n\t\t}\n\t\terr := inv.handleErrorResponse(connErr)\n\t\treturn err\n\t}\n\treturn inv.handleResponse(resp.Msg.data, nil)\n}\n\nfunc (inv *invoker) handleClientStream(ctx context.Context, dataSource string, data io.Reader, headers http.Header) (retErr error) {\n\tprovider := newStreamMessageProvider(dataSource, data, inv.res)\n\tmsg := dynamicpb.NewMessage(inv.md.Input())\n\tstream := inv.client.CallClientStream(ctx)\n\tmaps.Copy(stream.RequestHeader(), headers)\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tvar connErr *connect.Error\n\t\t\tif errors.As(retErr, &connErr) {\n\t\t\t\tretErr = inv.handleErrorResponse(connErr)\n\t\t\t}\n\t\t}\n\t}()\n\tif err, isStreamError := inv.handleStreamRequest(provider, msg, stream); err != nil {\n\t\tif isStreamError {\n\t\t\t_, recvErr := stream.CloseAndReceive()\n\t\t\t// stream.Send should return io.EOF on error, and caller is expected to call\n\t\t\t// stream.Receive to get the actual RPC error.\n\t\t\tif recvErr != nil {\n\t\t\t\treturn recvErr\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n\tresp, err := stream.CloseAndReceive()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn inv.handleResponse(resp.Msg.data, nil)\n}\n\nfunc (inv *invoker) handleServerStream(ctx context.Context, dataSource string, data io.Reader, headers http.Header) (retErr error) {\n\tprovider := newMessageProvider(dataSource, data, inv.res)\n\tmsg := dynamicpb.NewMessage(inv.md.Input())\n\tif err := provider.next(msg); err != nil {\n\t\treturn err\n\t}\n\t// make sure input does not contain a second message\n\tdummy := dynamicpb.NewMessage(inv.md.Input())\n\tif err := provider.next(dummy); err != io.EOF {\n\t\treturn fmt.Errorf(\"method %s is a unary RPC, but input contained more than one request message\", inv.md.Name())\n\t}\n\n\treq := connect.NewRequest(msg)\n\tmaps.Copy(req.Header(), headers)\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tvar connErr *connect.Error\n\t\t\tif errors.As(retErr, &connErr) {\n\t\t\t\tretErr = inv.handleErrorResponse(connErr)\n\t\t\t}\n\t\t}\n\t}()\n\n\tstream, err := inv.client.CallServerStream(ctx, req)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn inv.handleStreamResponse(&serverStreamAdapter{stream: stream})\n}\n\nfunc (inv *invoker) handleBidiStream(ctx context.Context, dataSource string, data io.Reader, headers http.Header) (retErr error) {\n\tctx, cancel := context.WithCancel(ctx)\n\tprovider := newStreamMessageProvider(dataSource, data, inv.res)\n\tmsg := dynamicpb.NewMessage(inv.md.Input())\n\tstream := inv.client.CallBidiStream(ctx)\n\tmaps.Copy(stream.RequestHeader(), headers)\n\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tvar connErr *connect.Error\n\t\t\tif errors.As(retErr, &connErr) {\n\t\t\t\tretErr = inv.handleErrorResponse(connErr)\n\t\t\t}\n\t\t}\n\t}()\n\n\tvar recvErr error\n\tvar wg sync.WaitGroup\n\twg.Go(func() {\n\t\tdefer cancel()\n\t\tif err := inv.handleStreamResponse(stream); err != nil {\n\t\t\trecvErr = err\n\t\t}\n\t})\n\tdefer func() {\n\t\twg.Wait()\n\t\tif recvErr != nil {\n\t\t\t// may just get io.EOF or cancel error when trying to write to closed\n\t\t\t// request stream whereas actual error details will be seen on the read side\n\t\t\tif retErr == nil || errors.Is(retErr, io.EOF) || isCancelled(retErr) {\n\t\t\t\tretErr = recvErr\n\t\t\t}\n\t\t}\n\t}()\n\tshouldCancel := true\n\tdefer func() {\n\t\tif shouldCancel {\n\t\t\tcancel()\n\t\t}\n\t}()\n\n\terr, isStreamError := inv.handleStreamRequest(provider, msg, stream)\n\tshouldCancel = err != nil && !isStreamError\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn stream.CloseRequest()\n}\n\nfunc isCancelled(err error) bool {\n\tif errors.Is(err, context.Canceled) {\n\t\treturn true\n\t}\n\tvar connErr *connect.Error\n\tif errors.As(err, &connErr) {\n\t\treturn connErr.Code() == connect.CodeCanceled\n\t}\n\treturn false\n}\n\nfunc (inv *invoker) handleResponse(data []byte, msg *dynamicpb.Message) error {\n\tif msg == nil {\n\t\tmsg = dynamicpb.NewMessage(inv.md.Output())\n\t}\n\tif err := protoencoding.NewWireUnmarshaler(inv.res).Unmarshal(data, msg); err != nil {\n\t\treturn err\n\t}\n\tjsonMarshalerOptions := []protoencoding.JSONMarshalerOption{\n\t\tprotoencoding.JSONMarshalerWithIndent(),\n\t}\n\tif inv.emitDefaults {\n\t\tjsonMarshalerOptions = append(\n\t\t\tjsonMarshalerOptions,\n\t\t\tprotoencoding.JSONMarshalerWithEmitUnpopulated(),\n\t\t)\n\t}\n\tunrecognized := countUnrecognized(msg.ProtoReflect())\n\tif unrecognized > 0 {\n\t\tinv.printer.Printf(\"Response message (%s) contained %d bytes of unrecognized fields.\",\n\t\t\tmsg.ProtoReflect().Descriptor().FullName(), unrecognized)\n\t}\n\toutputBytes, err := protoencoding.NewJSONMarshaler(inv.res, jsonMarshalerOptions...).Marshal(msg)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = fmt.Fprintf(inv.output, \"%s\\n\", outputBytes)\n\treturn err\n}\n\ntype clientStream interface {\n\tSend(message *dynamicpb.Message) error\n}\n\ntype serverStream interface {\n\tReceive() (*deferredMessage, error)\n\tCloseResponse() error\n}\n\ntype serverStreamAdapter struct {\n\tstream *connect.ServerStreamForClient[deferredMessage]\n}\n\nfunc (ssa *serverStreamAdapter) Receive() (*deferredMessage, error) {\n\tif !ssa.stream.Receive() {\n\t\terr := ssa.stream.Err()\n\t\tif err == nil {\n\t\t\terr = io.EOF\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn ssa.stream.Msg(), nil\n}\n\nfunc (ssa *serverStreamAdapter) CloseResponse() error {\n\treturn ssa.stream.Close()\n}\n\nfunc (inv *invoker) handleStreamRequest(provider messageProvider, msg *dynamicpb.Message, stream clientStream) (error, bool) {\n\tfor {\n\t\tif err := provider.next(msg); errors.Is(err, io.EOF) {\n\t\t\tbreak\n\t\t} else if err != nil {\n\t\t\treturn err, false\n\t\t}\n\t\tif err := stream.Send(msg); err != nil {\n\t\t\treturn err, true\n\t\t}\n\t}\n\treturn nil, false\n}\n\nfunc (inv *invoker) handleStreamResponse(stream serverStream) (retError error) {\n\tdefer func() {\n\t\terr := stream.CloseResponse()\n\t\tif err != nil && retError == nil {\n\t\t\tretError = err\n\t\t}\n\t}()\n\tmsg := dynamicpb.NewMessage(inv.md.Output())\n\tfor {\n\t\tresponseMsg, err := stream.Receive()\n\t\tif errors.Is(err, io.EOF) {\n\t\t\treturn nil\n\t\t} else if err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := inv.handleResponse(responseMsg.data, msg); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n}\n\nfunc (inv *invoker) handleErrorResponse(connErr *connect.Error) error {\n\t// NB: This is a nasty hack: we create a fake request that looks\n\t//     like a unary Connect request, so that the ErrorWriter will\n\t//     print the error in the format we want, which is just the\n\t//     JSON representation of the Connect error. (We don't need\n\t//     an end-stream message representation or for the content\n\t//     to be put into response headers, which is what it may\n\t//     choose to do if it detects a different protocol in the\n\t//     request).\n\treq := &http.Request{\n\t\tHeader: http.Header{},\n\t}\n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tw := connect.NewErrorWriter()\n\tresponseWriter := httptest.NewRecorder()\n\terr := w.Write(responseWriter, req, connErr)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar prettyPrinted bytes.Buffer\n\tif err := json.Indent(&prettyPrinted, responseWriter.Body.Bytes(), \"\", \"   \"); err != nil {\n\t\treturn err\n\t}\n\t_, _ = inv.errOutput.Write(prettyPrinted.Bytes())\n\t_, _ = inv.errOutput.Write([]byte(\"\\n\"))\n\treturn app.NewError(int(connErr.Code()*8), \"\")\n}\n\nfunc newStreamMessageProvider(dataSource string, data io.Reader, res protoencoding.Resolver) messageProvider {\n\tif data == nil {\n\t\t// if no data provided, treat as empty input\n\t\tdata = bytes.NewBuffer(nil)\n\t}\n\treturn &streamMessageProvider{name: dataSource, dec: json.NewDecoder(data), res: res}\n}\n\nfunc newMessageProvider(dataSource string, data io.Reader, res protoencoding.Resolver) messageProvider {\n\tif data == nil {\n\t\t// if no data provider, treat as if single empty message\n\t\treturn &singleEmptyMessageProvider{}\n\t} else {\n\t\treturn newStreamMessageProvider(dataSource, data, res)\n\t}\n}\n\ntype messageProvider interface {\n\tnext(proto.Message) error\n}\n\ntype singleEmptyMessageProvider struct {\n\tread bool\n}\n\nfunc (s *singleEmptyMessageProvider) next(_ proto.Message) error {\n\tif !s.read {\n\t\ts.read = true\n\t\treturn nil\n\t}\n\treturn io.EOF\n}\n\ntype streamMessageProvider struct {\n\tname string\n\tdec  *json.Decoder\n\tres  protoencoding.Resolver\n}\n\nfunc (s *streamMessageProvider) next(msg proto.Message) error {\n\tvar jsonData json.RawMessage\n\tif err := s.dec.Decode(&jsonData); err != nil {\n\t\tif err == io.EOF {\n\t\t\treturn err\n\t\t}\n\t\treturn fmt.Errorf(\"%s at offset %d: %w\", s.name, s.dec.InputOffset(), err)\n\t}\n\treturn protoencoding.NewJSONUnmarshaler(\n\t\ts.res, protoencoding.JSONUnmarshalerWithDisallowUnknown(),\n\t).Unmarshal(jsonData, msg)\n}\n\nfunc countUnrecognized(msg protoreflect.Message) int {\n\tvar count int\n\tmsg.Range(func(field protoreflect.FieldDescriptor, val protoreflect.Value) bool {\n\t\tswitch {\n\t\tcase field.IsMap():\n\t\t\tif !isMessageKind(field.MapValue().Kind()) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\t// Note: Technically, each message entry could have had unrecognized field\n\t\t\t// bytes, but they are discarded by the runtime. So we can only look at\n\t\t\t// unrecognized fields in message values inside the map.\n\t\t\tmapVal := val.Map()\n\t\t\tmapVal.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool {\n\t\t\t\tcount += countUnrecognized(v.Message())\n\t\t\t\treturn true\n\t\t\t})\n\t\tcase field.IsList():\n\t\t\tif !isMessageKind(field.Kind()) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tlistVal := val.List()\n\t\t\tfor i, length := 0, listVal.Len(); i < length; i++ {\n\t\t\t\tcount += countUnrecognized(listVal.Get(i).Message())\n\t\t\t}\n\t\tcase isMessageKind(field.Kind()):\n\t\t\tcount += countUnrecognized(val.Message())\n\t\t}\n\t\treturn true\n\t})\n\treturn count + len(msg.GetUnknown())\n}\n\nfunc isMessageKind(k protoreflect.Kind) bool {\n\treturn k == protoreflect.MessageKind || k == protoreflect.GroupKind\n}\n"
  },
  {
    "path": "private/buf/bufcurl/invoker_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/protocompile\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nfunc TestCountUnrecognized(t *testing.T) {\n\tt.Parallel()\n\tdescriptors, err := (&protocompile.Compiler{\n\t\tResolver: &protocompile.SourceResolver{\n\t\t\tImportPaths: []string{\"./testdata\"},\n\t\t},\n\t}).Compile(t.Context(), \"test.proto\")\n\trequire.NoError(t, err)\n\tmsgType, err := descriptors.AsResolver().FindMessageByName(\"foo.bar.Message\")\n\trequire.NoError(t, err)\n\tmsg := msgType.New()\n\tmsgData, err := os.ReadFile(\"./testdata/testdata.txt\")\n\trequire.NoError(t, err)\n\terr = protoencoding.NewTxtpbUnmarshaler(nil).Unmarshal(msgData, msg.Interface())\n\trequire.NoError(t, err)\n\t// Add some unrecognized bytes\n\tunknownBytes := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1}\n\n\tmsg.SetUnknown(unknownBytes)\n\texpectedUnrecognized := len(unknownBytes)\n\n\tmsg.Get(msgType.Descriptor().Fields().ByName(\"msg\")).Message().SetUnknown(unknownBytes[:10])\n\texpectedUnrecognized += 10\n\tmsg.Get(msgType.Descriptor().Fields().ByName(\"grp\")).Message().SetUnknown(unknownBytes[:6])\n\texpectedUnrecognized += 6\n\n\tslice := msg.Get(msgType.Descriptor().Fields().ByName(\"rmsg\")).List()\n\tslice.Get(0).Message().SetUnknown(unknownBytes[:10])\n\tslice.Get(1).Message().SetUnknown(unknownBytes[:5])\n\texpectedUnrecognized += 15\n\tslice = msg.Get(msgType.Descriptor().Fields().ByName(\"rgrp\")).List()\n\tslice.Get(0).Message().SetUnknown(unknownBytes[:3])\n\tslice.Get(1).Message().SetUnknown(unknownBytes[:8])\n\texpectedUnrecognized += 11\n\n\tmapVal := msg.Get(msgType.Descriptor().Fields().ByName(\"mvmsg\")).Map()\n\tmapVal.Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool {\n\t\tv.Message().SetUnknown(unknownBytes[:6])\n\t\texpectedUnrecognized += 6\n\t\treturn true\n\t})\n\n\tunrecognized := countUnrecognized(msg)\n\tassert.Equal(t, expectedUnrecognized, unrecognized)\n}\n"
  },
  {
    "path": "private/buf/bufcurl/io.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\n// ErrorHasFilename makes sure that the given error includes a reference to the\n// given filename. If not, it wraps the given error and adds the filename. This\n// is to make sure errors are useful -- an error related to file I/O is not very\n// helpful if it doesn't indicate the name of the file.\nfunc ErrorHasFilename(err error, filename string) error {\n\tif strings.Contains(err.Error(), filename) {\n\t\treturn err\n\t}\n\treturn fmt.Errorf(\"%s: %w\", filename, err)\n}\n\ntype readerWithClose struct {\n\tio.Reader\n\tio.Closer\n}\n\n// lineReader wraps a *bufio.Reader, making it easier to read a file one line\n// at a time.\ntype lineReader struct {\n\tr   *bufio.Reader\n\terr error\n}\n\nfunc (r *lineReader) Read(p []byte) (n int, err error) {\n\treturn r.r.Read(p)\n}\n\nfunc (r *lineReader) ReadLine() (string, error) {\n\tif r.err != nil {\n\t\treturn \"\", r.err\n\t}\n\tstr, err := r.r.ReadString('\\n')\n\t// Instead of returning data AND error, like bufio.Reader.ReadString,\n\t// only return one or the other since that is easier for the caller.\n\tif err != nil {\n\t\tif str != \"\" {\n\t\t\tr.err = err // save for next call\n\t\t\treturn str, nil\n\t\t}\n\t\treturn \"\", err\n\t}\n\t// If bufio.Reader.ReadString returns nil err, then the string ends\n\t// with the delimiter. Remove it.\n\tstr = strings.TrimSuffix(str, \"\\n\")\n\treturn str, nil\n}\n"
  },
  {
    "path": "private/buf/bufcurl/reflection_resolver.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"maps\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"connectrpc.com/connect\"\n\treflectionv1 \"github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/verbose\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/reflect/protoregistry\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n)\n\nconst (\n\t// ReflectProtocolUnknown represents that the server reflection protocol\n\t// is unknown. If given this value, the server reflection resolver will\n\t// cycle through the known reflection protocols from newest to oldest,\n\t// trying each one until a reflection protocol that works is found.\n\tReflectProtocolUnknown ReflectProtocol = iota + 1\n\t// ReflectProtocolGRPCV1 represents the gRPC server reflection protocol\n\t// defined by the service grpc.reflection.v1.ServerReflection.\n\tReflectProtocolGRPCV1\n\t// ReflectProtocolGRPCV1Alpha represents the gRPC server reflection protocol\n\t// defined by the service grpc.reflection.v1alpha.ServerReflection.\n\tReflectProtocolGRPCV1Alpha\n)\n\nvar (\n\t// AllKnownReflectProtocolStrings are all string values for\n\t// ReflectProtocol that represent known reflection protocols.\n\tAllKnownReflectProtocolStrings = []string{\n\t\t\"grpc-v1\",\n\t\t\"grpc-v1alpha\",\n\t}\n\n\treflectProtocolToString = map[ReflectProtocol]string{\n\t\tReflectProtocolUnknown:     \"\",\n\t\tReflectProtocolGRPCV1:      \"grpc-v1\",\n\t\tReflectProtocolGRPCV1Alpha: \"grpc-v1alpha\",\n\t}\n\tstringToReflectProtocol = map[string]ReflectProtocol{\n\t\t\"\":             ReflectProtocolUnknown,\n\t\t\"grpc-v1\":      ReflectProtocolGRPCV1,\n\t\t\"grpc-v1alpha\": ReflectProtocolGRPCV1Alpha,\n\t}\n)\n\n// ReflectProtocol is a reflection protocol.\ntype ReflectProtocol int\n\n// String implements fmt.Stringer.\nfunc (r ReflectProtocol) String() string {\n\ts, ok := reflectProtocolToString[r]\n\tif !ok {\n\t\treturn strconv.Itoa(int(r))\n\t}\n\treturn s\n}\n\n// ParseReflectProtocol parses the ReflectProtocol.\n//\n// The empty string is a parse error.\nfunc ParseReflectProtocol(s string) (ReflectProtocol, error) {\n\tr, ok := stringToReflectProtocol[strings.ToLower(strings.TrimSpace(s))]\n\tif ok {\n\t\treturn r, nil\n\t}\n\treturn 0, fmt.Errorf(\"unknown ReflectProtocol: %q\", s)\n}\n\n// NewServerReflectionResolver creates a new resolver using the given details to\n// create an RPC reflection client, to ask the server for descriptors.\nfunc NewServerReflectionResolver(\n\tctx context.Context,\n\thttpClient connect.HTTPClient,\n\topts []connect.ClientOption,\n\tbaseURL string,\n\treflectProtocol ReflectProtocol,\n\theaders http.Header,\n\tprinter verbose.Printer,\n) (r Resolver, closeResolver func()) {\n\tbaseURL = strings.TrimSuffix(baseURL, \"/\")\n\tvar v1Client, v1alphaClient *reflectClient\n\tif reflectProtocol != ReflectProtocolGRPCV1 {\n\t\tv1alphaClient = connect.NewClient[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse](httpClient, baseURL+\"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo\", opts...)\n\t}\n\tif reflectProtocol != ReflectProtocolGRPCV1Alpha {\n\t\tv1Client = connect.NewClient[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse](httpClient, baseURL+\"/grpc.reflection.v1.ServerReflection/ServerReflectionInfo\", opts...)\n\t}\n\t// if version is neither \"v1\" nor \"v1alpha\", then we have both clients and\n\t// will automatically decide which one to use by trying v1 first and falling\n\t// back to v1alpha on \"not implemented\" error\n\n\t// elide the \"upload finished\" trace message for reflection calls\n\tctx = skippingUploadFinishedMessage(ctx)\n\t// request's user-agent header(s) get overwritten by protocol, so we stash them in the\n\t// context so that underlying transport can restore them\n\tctx = withUserAgent(ctx, headers)\n\n\tres := &reflectionResolver{\n\t\tctx:              ctx,\n\t\tv1Client:         v1Client,\n\t\tv1alphaClient:    v1alphaClient,\n\t\tuseV1Alpha:       reflectProtocol == ReflectProtocolGRPCV1Alpha,\n\t\theaders:          headers,\n\t\tprinter:          printer,\n\t\tdownloadedProtos: map[string]*descriptorpb.FileDescriptorProto{},\n\t}\n\treturn res, res.Reset\n}\n\ntype reflectClient = connect.Client[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse]\ntype reflectStream = connect.BidiStreamForClient[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse]\n\ntype reflectionResolver struct {\n\tctx                     context.Context\n\theaders                 http.Header\n\tprinter                 verbose.Printer\n\tv1Client, v1alphaClient *reflectClient\n\n\tmu                      sync.Mutex\n\tuseV1Alpha              bool\n\tv1Stream, v1alphaStream *reflectStream\n\tdownloadedProtos        map[string]*descriptorpb.FileDescriptorProto\n\tcachedFiles             protoregistry.Files\n\tcachedExts              protoregistry.Types\n}\n\nfunc (r *reflectionResolver) ListServices() ([]protoreflect.FullName, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\tr.printer.Printf(\"* Using server reflection to list services\\n\")\n\tresp, err := r.sendLocked(reflectionv1.ServerReflectionRequest_builder{\n\t\tListServices: proto.String(\"\"),\n\t}.Build())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch resp.WhichMessageResponse() {\n\tcase reflectionv1.ServerReflectionResponse_ErrorResponse_case:\n\t\t// This should never happen, however we do a bounds check to ensure we are doing a safe\n\t\t// conversion from int32 (ErrorResponse.ErrorCode) to uint32 (connect.Code).\n\t\tif resp.GetErrorResponse().GetErrorCode() < 0 {\n\t\t\treturn nil, fmt.Errorf(\"server replied with unsupported error code: %v\", resp.GetErrorResponse().GetErrorCode())\n\t\t}\n\t\treturn nil, connect.NewWireError(connect.Code(resp.GetErrorResponse().GetErrorCode()), errors.New(resp.GetErrorResponse().GetErrorMessage()))\n\tcase reflectionv1.ServerReflectionResponse_ListServicesResponse_case:\n\t\tserviceNames := make([]protoreflect.FullName, len(resp.GetListServicesResponse().GetService()))\n\t\tfor i, service := range resp.GetListServicesResponse().GetService() {\n\t\t\tserviceNames[i] = protoreflect.FullName(service.GetName())\n\t\t}\n\t\treturn serviceNames, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"server replied with unsupported response type: %v\", resp.WhichMessageResponse())\n\t}\n}\n\nfunc (r *reflectionResolver) FindFileByPath(path string) (protoreflect.FileDescriptor, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\td, err := r.cachedFiles.FindFileByPath(path)\n\tif d != nil {\n\t\treturn d, nil\n\t}\n\tif err != protoregistry.NotFound {\n\t\treturn nil, err\n\t}\n\t// if not found in existing files, fetch more\n\tfileDescriptorProtos, err := r.fileByNameLocked(path)\n\tif err != nil {\n\t\t// intentionally not using \"%w\" because, depending on the code, the bufcli\n\t\t// app framework might incorrectly interpret it and report a bad error message.\n\t\treturn nil, fmt.Errorf(\"failed to resolve filename %q: %v\", path, err)\n\t}\n\tif err := r.cacheFilesLocked(fileDescriptorProtos); err != nil {\n\t\treturn nil, err\n\t}\n\t// now it should definitely be in there!\n\treturn r.cachedFiles.FindFileByPath(path)\n}\n\nfunc (r *reflectionResolver) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\td, err := r.cachedFiles.FindDescriptorByName(name)\n\tif d != nil {\n\t\treturn d, nil\n\t}\n\tif err != protoregistry.NotFound {\n\t\treturn nil, err\n\t}\n\t// if not found in existing files, fetch more\n\tfileDescriptorProtos, err := r.fileContainingSymbolLocked(name)\n\tif err != nil {\n\t\t// intentionally not using \"%w\" because, depending on the code, the bufcli\n\t\t// app framework might incorrectly interpret it and report a bad error message.\n\t\treturn nil, fmt.Errorf(\"failed to resolve symbol %q: %v\", name, err)\n\t}\n\tif err := r.cacheFilesLocked(fileDescriptorProtos); err != nil {\n\t\treturn nil, err\n\t}\n\t// now it should definitely be in there!\n\treturn r.cachedFiles.FindDescriptorByName(name)\n}\n\nfunc (r *reflectionResolver) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) {\n\td, err := r.FindDescriptorByName(enum)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ted, ok := d.(protoreflect.EnumDescriptor)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"element %s is a %s, not an enum\", enum, descriptorKind(d))\n\t}\n\treturn dynamicpb.NewEnumType(ed), nil\n}\n\nfunc (r *reflectionResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {\n\td, err := r.FindDescriptorByName(message)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmd, ok := d.(protoreflect.MessageDescriptor)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"element %s is a %s, not a message\", message, descriptorKind(d))\n\t}\n\treturn dynamicpb.NewMessageType(md), nil\n}\n\nfunc (r *reflectionResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) {\n\tpos := strings.LastIndexByte(url, '/')\n\ttypeName := url[pos+1:]\n\treturn r.FindMessageByName(protoreflect.FullName(typeName))\n}\n\nfunc (r *reflectionResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {\n\td, err := r.FindDescriptorByName(field)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfd, ok := d.(protoreflect.FieldDescriptor)\n\tif !ok || !fd.IsExtension() {\n\t\treturn nil, fmt.Errorf(\"element %s is a %s, not an extension\", field, descriptorKind(d))\n\t}\n\treturn dynamicpb.NewExtensionType(fd), nil\n}\n\nfunc (r *reflectionResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\n\text, err := r.cachedExts.FindExtensionByNumber(message, field)\n\tif ext != nil {\n\t\treturn ext, nil\n\t}\n\tif err != protoregistry.NotFound {\n\t\treturn nil, err\n\t}\n\t// if not found in existing files, fetch more\n\tfileDescriptorProtos, err := r.fileContainingExtensionLocked(message, field)\n\tif err != nil {\n\t\t// intentionally not using \"%w\" because, depending on the code, the bufcli\n\t\t// app framework might incorrectly interpret it and report a bad error message.\n\t\treturn nil, fmt.Errorf(\"failed to resolve extension %d for %q: %v\", field, message, err)\n\t}\n\tif err := r.cacheFilesLocked(fileDescriptorProtos); err != nil {\n\t\treturn nil, err\n\t}\n\t// now it should definitely be in there!\n\treturn r.cachedExts.FindExtensionByNumber(message, field)\n}\n\nfunc (r *reflectionResolver) fileContainingSymbolLocked(name protoreflect.FullName) ([]*descriptorpb.FileDescriptorProto, error) {\n\tr.printer.Printf(\"* Using server reflection to resolve %q\\n\", name)\n\tresp, err := r.sendLocked(reflectionv1.ServerReflectionRequest_builder{\n\t\tFileContainingSymbol: proto.String(string(name)),\n\t}.Build())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn descriptorsInResponse(resp)\n}\n\nfunc (r *reflectionResolver) fileContainingExtensionLocked(message protoreflect.FullName, field protoreflect.FieldNumber) ([]*descriptorpb.FileDescriptorProto, error) {\n\tr.printer.Printf(\"* Using server reflection to retrieve extension %d for %q\\n\", field, message)\n\tresp, err := r.sendLocked(reflectionv1.ServerReflectionRequest_builder{\n\t\tFileContainingExtension: reflectionv1.ExtensionRequest_builder{\n\t\t\tContainingType:  string(message),\n\t\t\tExtensionNumber: int32(field),\n\t\t}.Build(),\n\t}.Build())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn descriptorsInResponse(resp)\n}\n\nfunc (r *reflectionResolver) fileByNameLocked(name string) ([]*descriptorpb.FileDescriptorProto, error) {\n\tr.printer.Printf(\"* Using server reflection to download file %q\\n\", name)\n\tresp, err := r.sendLocked(reflectionv1.ServerReflectionRequest_builder{\n\t\tFileByFilename: proto.String(name),\n\t}.Build())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn descriptorsInResponse(resp)\n}\n\nfunc descriptorsInResponse(resp *reflectionv1.ServerReflectionResponse) ([]*descriptorpb.FileDescriptorProto, error) {\n\tswitch resp.WhichMessageResponse() {\n\tcase reflectionv1.ServerReflectionResponse_ErrorResponse_case:\n\t\t// This should never happen, however we do a bounds check to ensure we are doing a safe\n\t\t// conversion from int32 (ErrorResponse.ErrorCode) to uint32 (connect.Code).\n\t\tif resp.GetErrorResponse().GetErrorCode() < 0 {\n\t\t\treturn nil, fmt.Errorf(\"server replied with unsupported error code: %v\", resp.GetErrorResponse().GetErrorCode())\n\t\t}\n\t\treturn nil, connect.NewWireError(connect.Code(resp.GetErrorResponse().GetErrorCode()), errors.New(resp.GetErrorResponse().GetErrorMessage()))\n\tcase reflectionv1.ServerReflectionResponse_FileDescriptorResponse_case:\n\t\tfiles := make([]*descriptorpb.FileDescriptorProto, len(resp.GetFileDescriptorResponse().GetFileDescriptorProto()))\n\t\tfor i, data := range resp.GetFileDescriptorResponse().GetFileDescriptorProto() {\n\t\t\tvar file descriptorpb.FileDescriptorProto\n\t\t\tif err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(data, &file); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfiles[i] = &file\n\t\t}\n\t\treturn files, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"server replied with unsupported response type: %v\", resp.WhichMessageResponse())\n\t}\n}\n\nfunc (r *reflectionResolver) cacheFilesLocked(files []*descriptorpb.FileDescriptorProto) error {\n\tfor _, file := range files {\n\t\tif _, ok := r.downloadedProtos[file.GetName()]; ok {\n\t\t\tcontinue // already downloaded, don't bother overwriting\n\t\t}\n\t\tr.downloadedProtos[file.GetName()] = file\n\t}\n\tfor _, file := range files {\n\t\tif err := r.cacheFileLocked(file.GetName(), nil); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (r *reflectionResolver) cacheFileLocked(name string, seen []string) error {\n\tif _, err := r.cachedFiles.FindFileByPath(name); err == nil {\n\t\treturn nil // already processed this file\n\t}\n\tfor i, alreadySeen := range seen {\n\t\tif name == alreadySeen {\n\t\t\t// we've seen this file already which means malformed\n\t\t\t// file descriptor protos that have an import cycle\n\t\t\tcycle := append(seen[i:], name)\n\t\t\treturn fmt.Errorf(\"downloaded files contain an import cycle: %s\", strings.Join(cycle, \" -> \"))\n\t\t}\n\t}\n\n\tfile := r.downloadedProtos[name]\n\tif file == nil {\n\t\t// download missing file(s)\n\t\tmoreFiles, err := r.fileByNameLocked(name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, newFile := range moreFiles {\n\t\t\tr.downloadedProtos[newFile.GetName()] = newFile\n\t\t\tif newFile.GetName() == name {\n\t\t\t\tfile = newFile\n\t\t\t}\n\t\t}\n\t\tif file == nil {\n\t\t\treturn fmt.Errorf(\"requested file %q but response did not contain it\", name)\n\t\t}\n\t}\n\n\t// make sure imports have been downloaded and cached\n\tfor _, dep := range file.Dependency {\n\t\tif err := r.cacheFileLocked(dep, append(seen, name)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// now we can create and cache this file\n\tfileDescriptor, err := protodesc.NewFile(file, &r.cachedFiles)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := r.cachedFiles.RegisterFile(fileDescriptor); err != nil {\n\t\treturn err\n\t}\n\tregisterExtensions(&r.cachedExts, fileDescriptor)\n\tr.printer.Printf(\"* Server reflection has resolved file %q\\n\", fileDescriptor.Path())\n\treturn nil\n}\n\nfunc (r *reflectionResolver) sendLocked(req *reflectionv1.ServerReflectionRequest) (*reflectionv1.ServerReflectionResponse, error) {\n\tstream, isNew := r.getStreamLocked()\n\tresp, err := send(stream, req)\n\tif isNotImplemented(err) && !r.useV1Alpha && r.v1alphaClient != nil {\n\t\tr.resetLocked()\n\t\tr.useV1Alpha = true\n\t\tstream, isNew = r.getStreamLocked()\n\t\tresp, err = send(stream, req)\n\t}\n\tif err != nil && !isNew {\n\t\t// the existing stream broke; try again with a new stream\n\t\tr.resetLocked()\n\t\tstream, _ = r.getStreamLocked()\n\t\tresp, err = send(stream, req)\n\t}\n\treturn resp, err\n}\n\nfunc isNotImplemented(err error) bool {\n\tvar connErr *connect.Error\n\tok := errors.As(err, &connErr)\n\treturn ok && connErr.Code() == connect.CodeUnimplemented\n}\n\nfunc send(stream *reflectStream, req *reflectionv1.ServerReflectionRequest) (*reflectionv1.ServerReflectionResponse, error) {\n\tsendErr := stream.Send(req)\n\t// even if sendErr != nil, we still call Receive because Send will typically return\n\t// io.EOF and caller is expected to use Receive to get the RPC error result.\n\tresp, recvErr := stream.Receive()\n\tif sendErr != nil && recvErr == nil {\n\t\treturn nil, sendErr\n\t}\n\treturn resp, recvErr\n}\n\nfunc (r *reflectionResolver) getStreamLocked() (*reflectStream, bool) {\n\tif r.useV1Alpha {\n\t\tisNew := r.maybeCreateStreamLocked(r.v1alphaClient, &r.v1alphaStream)\n\t\treturn r.v1alphaStream, isNew\n\t}\n\tisNew := r.maybeCreateStreamLocked(r.v1Client, &r.v1Stream)\n\treturn r.v1Stream, isNew\n}\n\nfunc (r *reflectionResolver) maybeCreateStreamLocked(client *reflectClient, stream **reflectStream) bool {\n\tif *stream != nil {\n\t\treturn false // already created\n\t}\n\t*stream = client.CallBidiStream(r.ctx)\n\tmaps.Copy((*stream).RequestHeader(), r.headers)\n\treturn true\n}\n\nfunc (r *reflectionResolver) Reset() {\n\tr.mu.Lock()\n\tdefer r.mu.Unlock()\n\tr.resetLocked()\n}\n\nfunc (r *reflectionResolver) resetLocked() {\n\tif r.v1Stream != nil {\n\t\treset(r.v1Stream)\n\t\tr.v1Stream = nil\n\t}\n\tif r.v1alphaStream != nil {\n\t\treset(r.v1alphaStream)\n\t\tr.v1alphaStream = nil\n\t}\n}\n\nfunc reset(stream *reflectStream) {\n\t_ = stream.CloseRequest()\n\t// Try to terminate gracefully by receiving the end of stream\n\t// (this call should return io.EOF). If we skip this and\n\t// immediately call CloseResponse, it could result in the\n\t// RPC being cancelled, which results in some nuisance\n\t// \"cancel\" errors.\n\t_, _ = stream.Receive()\n\t_ = stream.CloseResponse()\n}\n\ntype extensionContainer interface {\n\tMessages() protoreflect.MessageDescriptors\n\tExtensions() protoreflect.ExtensionDescriptors\n}\n\nfunc registerExtensions(reg *protoregistry.Types, descriptor extensionContainer) {\n\texts := descriptor.Extensions()\n\tfor i := range exts.Len() {\n\t\textType := dynamicpb.NewExtensionType(exts.Get(i))\n\t\t_ = reg.RegisterExtension(extType)\n\t}\n\tmsgs := descriptor.Messages()\n\tfor i := range msgs.Len() {\n\t\tregisterExtensions(reg, msgs.Get(i))\n\t}\n}\n\n// descriptorKind returns a succinct description of the type of the given descriptor.\nfunc descriptorKind(d protoreflect.Descriptor) string {\n\tswitch d := d.(type) {\n\tcase protoreflect.FileDescriptor:\n\t\treturn \"file\"\n\tcase protoreflect.MessageDescriptor:\n\t\treturn \"message\"\n\tcase protoreflect.FieldDescriptor:\n\t\tif d.IsExtension() {\n\t\t\treturn \"extension\"\n\t\t}\n\t\treturn \"field\"\n\tcase protoreflect.OneofDescriptor:\n\t\treturn \"oneof\"\n\tcase protoreflect.EnumDescriptor:\n\t\treturn \"enum\"\n\tcase protoreflect.EnumValueDescriptor:\n\t\treturn \"enum value\"\n\tcase protoreflect.ServiceDescriptor:\n\t\treturn \"service\"\n\tcase protoreflect.MethodDescriptor:\n\t\treturn \"method\"\n\tdefault:\n\t\treturn fmt.Sprintf(\"%T\", d)\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufcurl/resolver.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\n// Resolver is used to resolve descriptors, types, extensions, etc. Unlike\n// the base protoencoding.Resolver interface, it can also enumerate services.\ntype Resolver interface {\n\tprotoencoding.Resolver\n\tListServices() ([]protoreflect.FullName, error)\n}\n\n// ResolverForImage returns a Resolver backed by the given image.\nfunc ResolverForImage(image bufimage.Image) Resolver {\n\treturn &imageResolver{\n\t\tResolver: image.Resolver(),\n\t\timage:    image,\n\t}\n}\n\n// CombineResolvers returns a Resolver backed by the given underlying\n// resolvers. For any given query, each underlying resolver is checked,\n// starting with the first resolver provided. If the first cannot answer\n// a query, the second one is checked, and so on. The service names\n// returned by the ListServices methods is the union of service names\n// for all given resolvers.\nfunc CombineResolvers(resolvers ...Resolver) Resolver {\n\tencodingResolvers := make([]protoencoding.Resolver, len(resolvers))\n\tfor i := range resolvers {\n\t\tencodingResolvers[i] = resolvers[i]\n\t}\n\treturn &combinedResolver{\n\t\tResolver:  protoencoding.CombineResolvers(encodingResolvers...),\n\t\tresolvers: resolvers,\n\t}\n}\n\ntype imageResolver struct {\n\tprotoencoding.Resolver\n\timage bufimage.Image\n}\n\nfunc (i *imageResolver) ListServices() ([]protoreflect.FullName, error) {\n\tvar names []protoreflect.FullName\n\tfor _, file := range i.image.Files() {\n\t\tfileDescriptor := file.FileDescriptorProto()\n\t\tfor _, service := range fileDescriptor.Service {\n\t\t\tvar serviceName string\n\t\t\tif fileDescriptor.Package != nil {\n\t\t\t\tserviceName = fileDescriptor.GetPackage() + \".\" + service.GetName()\n\t\t\t} else {\n\t\t\t\tserviceName = service.GetName()\n\t\t\t}\n\t\t\tnames = append(names, protoreflect.FullName(serviceName))\n\t\t}\n\t}\n\treturn names, nil\n}\n\ntype combinedResolver struct {\n\tprotoencoding.Resolver // underlying resolver is already combined\n\tresolvers              []Resolver\n}\n\nfunc (c *combinedResolver) ListServices() ([]protoreflect.FullName, error) {\n\tnames := map[protoreflect.FullName]struct{}{}\n\tfor _, resolver := range c.resolvers {\n\t\tserviceNames, err := resolver.ListServices()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, serviceName := range serviceNames {\n\t\t\tnames[serviceName] = struct{}{}\n\t\t}\n\t}\n\tserviceNames := make([]protoreflect.FullName, 0, len(names))\n\tfor serviceName := range names {\n\t\tserviceNames = append(serviceNames, serviceName)\n\t}\n\treturn serviceNames, nil\n}\n\n// NewWKTResolver returns a Resolver that can resolve all well-known types.\nfunc NewWKTResolver(ctx context.Context, logger *slog.Logger) (Resolver, error) {\n\tmoduleSet, err := bufmodule.NewModuleSetBuilder(\n\t\tctx,\n\t\tlogger,\n\t\tbufmodule.NopModuleDataProvider,\n\t\tbufmodule.NopCommitProvider,\n\t).AddLocalModule(\n\t\tdatawkt.ReadBucket,\n\t\t\".\",\n\t\ttrue,\n\t).Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmodule := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet)\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tlogger,\n\t\tmodule,\n\t\tbufimage.WithExcludeSourceCodeInfo(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ResolverForImage(image), nil\n}\n"
  },
  {
    "path": "private/buf/bufcurl/testdata/test.proto",
    "content": "syntax = \"proto2\";\n\npackage foo.bar;\n\nmessage Message {\n  // Every kind of singular field\n  optional int32 i32 = 1;\n  optional int64 i64 = 2;\n  optional uint32 ui32 = 3;\n  optional uint64 ui64 = 4;\n  optional sint32 si32 = 5;\n  optional sint64 si64 = 6;\n  optional fixed32 f32 = 7;\n  optional fixed64 f64 = 8;\n  optional sfixed32 sf32 = 9;\n  optional sfixed64 sf64 = 10;\n  optional float fl = 11;\n  optional double dbl = 12;\n  optional bool b = 13;\n  optional string s = 14;\n  optional bytes bs = 15;\n  optional Enum en = 16;\n  optional Message msg = 17;\n  optional group Grp = 18 {\n    optional string name = 1;\n  };\n  // Every kind of repeated field\n  repeated int32 ri32 = 19;\n  repeated int64 ri64 = 20;\n  repeated uint32 rui32 = 21;\n  repeated uint64 rui64 = 22;\n  repeated sint32 rsi32 = 23;\n  repeated sint64 rsi64 = 24;\n  repeated fixed32 rf32 = 25;\n  repeated fixed64 rf64 = 26;\n  repeated sfixed32 rsf32 = 27;\n  repeated sfixed64 rsf64 = 28;\n  repeated float rfl = 29;\n  repeated double rdbl = 30;\n  repeated bool rb = 31;\n  repeated string rs = 32;\n  repeated bytes rbs = 33;\n  repeated Enum ren = 34;\n  repeated Message rmsg = 35;\n  repeated group Rgrp = 36 {\n    optional string name = 1;\n  };\n  // Every kind of map key\n  map<string, string> mks = 37;\n  map<int32, string> mki32 = 38;\n  map<int64, string> mki64 = 39;\n  map<uint32, string> mkui32 = 40;\n  map<uint64, string> mkui64 = 41;\n  map<sint32, string> mksi32 = 42;\n  map<sint64, string> mksi64 = 43;\n  map<fixed32, string> mkf32 = 44;\n  map<fixed64, string> mkf64 = 45;\n  map<sfixed32, string> mksf32 = 46;\n  map<sfixed64, string> mksf64 = 47;\n  map<bool, string> mkb = 48;\n  // Every kind of map value\n  map<string, int32> mvi32 = 51;\n  map<string, int64> mvi64 = 52;\n  map<string, uint32> mvui32 = 53;\n  map<string, uint64> mvui64 = 54;\n  map<string, sint32> mvsi32 = 55;\n  map<string, sint64> mvsi64 = 56;\n  map<string, fixed32> mvf32 = 57;\n  map<string, fixed64> mvf64 = 58;\n  map<string, sfixed32> mvsf32 = 59;\n  map<string, sfixed64> mvsf64 = 60;\n  map<string, float> mvfl = 61;\n  map<string, double> mvdbl = 62;\n  map<string, bool> mvb = 63;\n  map<string, string> mvs = 64;\n  map<string, bytes> mvbs = 65;\n  map<string, Enum> mven = 66;\n  map<string, Message> mvmsg = 67;\n}\n\nenum Enum {\n  A = 0;\n  B = 1;\n}\n"
  },
  {
    "path": "private/buf/bufcurl/testdata/testdata.txt",
    "content": "i32: -123\ni64: -456\nui32: 123\nui64: 456\nsi32: -123\nsi64: -456\nf32: 123\nf64: 456\nsf32: -123\nsf64: -456\nfl: 1.23\ndbl: 4.56\nb: true\ns: \"abcdef\"\nbs: \"\\x01\\x02\\x03\\x04\"\nen: A\nmsg: {\n\ti32: 1\n\ts: \"foo\"\n}\ngrp: {\n\tname: \"abc\"\n}\nri32: [-123,-123]\nri64: [-456,-456]\nrui32: [123,123]\nrui64: [456,456]\nrsi32: [-123,-123]\nrsi64: [-456,-456]\nrf32: [123,123]\nrf64: [456,456]\nrsf32: [-123,-123]\nrsf64: [-456,-456]\nrfl: [1.23,1.23]\nrdbl: [4.56,4.56]\nrb: [true,true]\nrs: [\"abcdef\",\"ghijkl\"]\nrbs: [\"\\x01\\x02\\x03\\x04\", \"\\x05\\x06\\x07\\x08\"]\nren: [A, B]\nrmsg: [{\n\ti32: 1\n\ts: \"foo\"\n},{\n\ti32: 2\n\ts: \"bar\"\n}]\nrgrp: [{\n\tname: \"abc\"\n},{\n\tname: \"def\"\n}]\nmks: [{\n\tkey: \"a\"\n\tvalue: \"abc\"\n},{\n\tkey: \"b\"\n\tvalue: \"def\"\n}]\nmki32: [{\n\tkey: 123\n\tvalue: \"abc\"\n},{\n\tkey: -123\n\tvalue: \"def\"\n}]\nmki64: [{\n\tkey: 456\n\tvalue: \"abc\"\n},{\n\tkey: -456\n\tvalue: \"def\"\n}]\nmkui32: [{\n\tkey: 123\n\tvalue: \"abc\"\n},{\n\tkey: 234\n\tvalue: \"def\"\n}]\nmkui64: [{\n\tkey: 456\n\tvalue: \"abc\"\n},{\n\tkey: 567\n\tvalue: \"def\"\n}]\nmksi32: [{\n\tkey: 123\n\tvalue: \"abc\"\n},{\n\tkey: -123\n\tvalue: \"def\"\n}]\nmksi64: [{\n\tkey: 456\n\tvalue: \"abc\"\n},{\n\tkey: -456\n\tvalue: \"def\"\n}]\nmkf32: [{\n\tkey: 123\n\tvalue: \"abc\"\n},{\n\tkey: 234\n\tvalue: \"def\"\n}]\nmkf64: [{\n\tkey: 456\n\tvalue: \"abc\"\n},{\n\tkey: 567\n\tvalue: \"def\"\n}]\nmksf32: [{\n\tkey: 123\n\tvalue: \"abc\"\n},{\n\tkey: -123\n\tvalue: \"def\"\n}]\nmksf64: [{\n\tkey: 456\n\tvalue: \"abc\"\n},{\n\tkey: -456\n\tvalue: \"def\"\n}]\nmkb: [{\n\tkey: true\n\tvalue: \"abc\"\n},{\n\tkey: false\n\tvalue: \"def\"\n}]\nmvi32: [{\n\tkey: \"a\"\n\tvalue: -123\n},{\n\tkey: \"b\"\n\tvalue: -123\n}]\nmvi64: [{\n\tkey: \"a\"\n\tvalue: -456\n},{\n\tkey: \"b\"\n\tvalue: -456\n}]\nmvui32: [{\n\tkey: \"a\"\n\tvalue: 123\n},{\n\tkey: \"b\"\n\tvalue: 123\n}]\nmvui64: [{\n\tkey: \"a\"\n\tvalue: 456\n},{\n\tkey: \"b\"\n\tvalue: 456\n}]\nmvsi32: [{\n\tkey: \"a\"\n\tvalue: -123\n},{\n\tkey: \"b\"\n\tvalue: -123\n}]\nmvsi64: [{\n\tkey: \"a\"\n\tvalue: -456\n},{\n\tkey: \"b\"\n\tvalue: -456\n}]\nmvf32: [{\n\tkey: \"a\"\n\tvalue: 123\n},{\n\tkey: \"b\"\n\tvalue: 123\n}]\nmvf64: [{\n\tkey: \"a\"\n\tvalue: 456\n},{\n\tkey: \"b\"\n\tvalue: 456\n}]\nmvsf32: [{\n\tkey: \"a\"\n\tvalue: -123\n},{\n\tkey: \"b\"\n\tvalue: -123\n}]\nmvsf64: [{\n\tkey: \"a\"\n\tvalue: -456\n},{\n\tkey: \"b\"\n\tvalue: -456\n}]\nmvfl: [{\n\tkey: \"a\"\n\tvalue: 1.23\n},{\n\tkey: \"b\"\n\tvalue: 1.23\n}]\nmvdbl: [{\n\tkey: \"a\"\n\tvalue: 4.56\n},{\n\tkey: \"b\"\n\tvalue: 4.56\n}]\nmvb: [{\n\tkey: \"a\"\n\tvalue: true\n},{\n\tkey: \"b\"\n\tvalue: false\n}]\nmvs: [{\n\tkey: \"a\"\n\tvalue: \"abc\"\n},{\n\tkey: \"b\"\n\tvalue: \"def\"\n}]\nmvbs: [{\n\tkey: \"a\"\n\tvalue: \"\\x01\\x02\\x03\\x04\"\n},{\n\tkey: \"b\"\n\tvalue: \"\\x05\\x06\\x07\\x08\"\n}]\nmven: [{\n\tkey: \"a\"\n\tvalue: A\n},{\n\tkey: \"b\"\n\tvalue: B\n}]\nmvmsg: [{\n\tkey: \"a\"\n\tvalue: {\n\t\ti32: 1\n\t\ts: \"foo\"\n\t}\n},{\n\tkey: \"b\"\n\tvalue: {\n\t\ti32: 2\n\t\ts: \"bar\"\n\t}\n}]"
  },
  {
    "path": "private/buf/bufcurl/tls.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"net\"\n\t\"os\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/pkg/verbose\"\n)\n\n// TLSSettings contains settings related to creating a TLS client.\ntype TLSSettings struct {\n\t// Filenames for a private key, certificate, and CA certificate pool.\n\tKeyFile, CertFile, CACertFile string\n\t// Override server name, for SNI.\n\tServerName string\n\t// If true, the server's certificate is not verified.\n\tInsecure bool\n\t// If true, the server is known to support HTTP/2. When set, the\n\t// ALPN protocols sent during the TLS handshake will include only\n\t// \"h2\", and exclude \"http/1.1\". If the server does not pick a\n\t// protocol, \"h2\" is assumed as the default.\n\tHTTP2PriorKnowledge bool\n\t// If true, the server is known to support HTTP/3. When set, the\n\t// ALPN protocols sent during the TLS handshake will include\n\t// only \"h3\", and exclude the other versions. Since HTTP/3 is\n\t// based on UDP, it is the only version to expect using the UDP\n\t// port right now.\n\tHTTP3 bool\n}\n\n// MakeVerboseTLSConfig constructs a *tls.Config that logs information to the\n// given printer as a TLS connection is negotiated.\nfunc MakeVerboseTLSConfig(settings *TLSSettings, authority string, printer verbose.Printer) (*tls.Config, error) {\n\tvar conf tls.Config\n\tif settings.HTTP2PriorKnowledge {\n\t\tconf.NextProtos = []string{\"h2\"}\n\t} else if settings.HTTP3 {\n\t\tconf.NextProtos = []string{\"h3\"}\n\t} else {\n\t\tconf.NextProtos = []string{\"h2\", \"http/1.1\"}\n\t}\n\t// we verify manually so that we can emit verbose output while doing so\n\tconf.InsecureSkipVerify = true\n\tconf.VerifyConnection = func(state tls.ConnectionState) error {\n\t\tprinter.Printf(\"* TLS connection using %s / %s\", tls.VersionName(state.Version), tls.CipherSuiteName(state.CipherSuite))\n\t\tif state.DidResume {\n\t\t\tprinter.Printf(\"* (TLS session resumed)\")\n\t\t}\n\t\tif state.NegotiatedProtocol == \"\" {\n\t\t\tif settings.HTTP2PriorKnowledge {\n\t\t\t\tprinter.Printf(\"* ALPN: server did not agree on a protocol. Using default h2\")\n\t\t\t} else if settings.HTTP3 {\n\t\t\t\tprinter.Printf(\"* ALPN: server did not agree on a protocol. Still attempting h3\")\n\t\t\t} else {\n\t\t\t\tprinter.Printf(\"* ALPN: server did not agree on a protocol. Using default http/1.1.\")\n\t\t\t}\n\t\t} else {\n\t\t\tprinter.Printf(\"* ALPN: server accepted %s\", state.NegotiatedProtocol)\n\t\t}\n\t\tprinter.Printf(\"* Server certificate:\")\n\t\tprinter.Printf(\"*   subject: %s\", state.PeerCertificates[0].Subject.String())\n\t\tprinter.Printf(\"*   start date: %s\", state.PeerCertificates[0].NotBefore)\n\t\tprinter.Printf(\"*   end date: %s\", state.PeerCertificates[0].NotAfter)\n\t\tvar subjectAlternatives []string\n\t\tsubjectAlternatives = append(subjectAlternatives, state.PeerCertificates[0].DNSNames...)\n\t\tfor _, ip := range state.PeerCertificates[0].IPAddresses {\n\t\t\tsubjectAlternatives = append(subjectAlternatives, ip.String())\n\t\t}\n\t\tsubjectAlternatives = append(subjectAlternatives, state.PeerCertificates[0].EmailAddresses...)\n\t\tfor _, uri := range state.PeerCertificates[0].URIs {\n\t\t\tsubjectAlternatives = append(subjectAlternatives, uri.String())\n\t\t}\n\t\tprinter.Printf(\"*   subjectAltNames: [%s]\", strings.Join(subjectAlternatives, \", \"))\n\t\tprinter.Printf(\"*   issuer: %s\", state.PeerCertificates[0].Issuer.String())\n\n\t\t// now we do verification\n\t\tif !settings.Insecure {\n\t\t\topts := x509.VerifyOptions{\n\t\t\t\tRoots:         conf.RootCAs,\n\t\t\t\tCurrentTime:   time.Now(),\n\t\t\t\tIntermediates: x509.NewCertPool(),\n\t\t\t}\n\t\t\tfor _, cert := range state.PeerCertificates[1:] {\n\t\t\t\topts.Intermediates.AddCert(cert)\n\t\t\t}\n\t\t\tif _, err := state.PeerCertificates[0].Verify(opts); err != nil {\n\t\t\t\tprinter.Printf(\"* Server certificate chain could not be verified: %v\", err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tprinter.Printf(\"* Server certificate chain verified\")\n\t\t\tif err := state.PeerCertificates[0].VerifyHostname(conf.ServerName); err != nil {\n\t\t\t\tprinter.Printf(\"* Server certificate is not valid for %s: %v\", conf.ServerName, err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tprinter.Printf(\"* Server certificate is valid for %s\", conf.ServerName)\n\t\t}\n\t\treturn nil\n\t}\n\tif settings.ServerName != \"\" {\n\t\tconf.ServerName = settings.ServerName\n\t} else if authority != \"\" {\n\t\t// strip port if present\n\t\thost, _, err := net.SplitHostPort(authority)\n\t\tif err == nil {\n\t\t\tauthority = host\n\t\t}\n\t\tconf.ServerName = authority\n\t}\n\n\tif settings.CACertFile != \"\" {\n\t\tcaCert, err := os.ReadFile(settings.CACertFile)\n\t\tif err != nil {\n\t\t\treturn nil, ErrorHasFilename(err, settings.CACertFile)\n\t\t}\n\t\tconf.RootCAs = x509.NewCertPool()\n\t\tconf.RootCAs.AppendCertsFromPEM(caCert)\n\t}\n\n\tif settings.KeyFile != \"\" && settings.CertFile != \"\" {\n\t\tcert, err := os.ReadFile(settings.CertFile)\n\t\tif err != nil {\n\t\t\treturn nil, ErrorHasFilename(err, settings.CertFile)\n\t\t}\n\t\tkey, err := os.ReadFile(settings.KeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, ErrorHasFilename(err, settings.KeyFile)\n\t\t}\n\t\tcertPair, err := tls.X509KeyPair(cert, key)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcertPair.Leaf, err = x509.ParseCertificate(certPair.Certificate[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tconf.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) {\n\t\t\tprinter.Printf(\"* Offering client cert:\")\n\t\t\tprinter.Printf(\"*   subject: %s\", certPair.Leaf.Subject.String())\n\t\t\tprinter.Printf(\"*   start date: %s\", certPair.Leaf.NotBefore)\n\t\t\tprinter.Printf(\"*   end date: %s\", certPair.Leaf.NotAfter)\n\t\t\tprinter.Printf(\"*   issuer: %s\", certPair.Leaf.Issuer.String())\n\t\t\treturn &certPair, nil\n\t\t}\n\t}\n\n\treturn &conf, nil\n}\n"
  },
  {
    "path": "private/buf/bufcurl/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcurl\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufcurl/verbose_transport.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcurl\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync/atomic\"\n\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/pkg/verbose\"\n)\n\ntype skipUploadFinishedMessageKey struct{}\n\nfunc skippingUploadFinishedMessage(ctx context.Context) context.Context {\n\treturn context.WithValue(ctx, skipUploadFinishedMessageKey{}, true)\n}\n\ntype userAgentKey struct{}\n\nfunc withUserAgent(ctx context.Context, headers http.Header) context.Context {\n\tif userAgentHeaders := headers.Values(\"user-agent\"); len(userAgentHeaders) > 0 {\n\t\treturn context.WithValue(ctx, userAgentKey{}, userAgentHeaders)\n\t}\n\treturn ctx // no change\n}\n\n// DefaultUserAgent returns the default user agent for the given protocol.\nfunc DefaultUserAgent(protocol string, bufVersion string) string {\n\t// mirror the default user agent for the Connect client library, but\n\t// add \"buf/<version>\" in front of it.\n\tlibUserAgent := \"connect-go\"\n\tif strings.Contains(protocol, \"grpc\") {\n\t\tlibUserAgent = \"grpc-go-connect\"\n\t}\n\treturn fmt.Sprintf(\"%s/%s (%s) buf/%s\", libUserAgent, connect.Version, runtime.Version(), bufVersion)\n}\n\n// NewVerboseHTTPClient creates a new HTTP client with the given transport and\n// printing verbose trace information to the given printer.\nfunc NewVerboseHTTPClient(transport http.RoundTripper, printer verbose.Printer) connect.HTTPClient {\n\treturn &verboseClient{transport: transport, printer: printer}\n}\n\n// TraceTrailersInterceptor returns an interceptor that will print information\n// about trailers for streaming calls to the given printer. This is used with\n// the Connect and gRPC-web protocols since these protocols include trailers in\n// the request body, instead of using actual HTTP trailers. (For the gRPC\n// protocol, which uses actual HTTP trailers, the verbose HTTP client suffices\n// since it already prints information about the trailers.)\nfunc TraceTrailersInterceptor(printer verbose.Printer) connect.Interceptor {\n\treturn traceTrailersInterceptor{printer: printer}\n}\n\ntype verboseClient struct {\n\ttransport http.RoundTripper\n\tprinter   verbose.Printer\n\treqNum    atomic.Int32\n}\n\ntype reqNumAddrKey struct{}\n\nfunc (v *verboseClient) Do(req *http.Request) (*http.Response, error) {\n\tif host := req.Header.Get(\"Host\"); host != \"\" {\n\t\t// Set based on host header. This way it is also correctly used as\n\t\t// the \":authority\" meta-header in HTTP/2.\n\t\treq.Host = host\n\t}\n\tif userAgentHeaders, _ := req.Context().Value(userAgentKey{}).([]string); len(userAgentHeaders) > 0 {\n\t\treq.Header.Del(\"user-agent\")\n\t\tfor _, val := range userAgentHeaders {\n\t\t\treq.Header.Add(\"user-agent\", val)\n\t\t}\n\t}\n\n\treqNum := v.reqNum.Add(1)\n\tif reqNumAddr, _ := req.Context().Value(reqNumAddrKey{}).(*int32); reqNumAddr != nil {\n\t\t*reqNumAddr = reqNum\n\t}\n\trawBody := req.Body\n\tif rawBody == nil {\n\t\trawBody = io.NopCloser(bytes.NewBuffer(nil))\n\t}\n\tvar atEnd func(error)\n\tif skip, _ := req.Context().Value(skipUploadFinishedMessageKey{}).(bool); !skip {\n\t\tatEnd = func(err error) {\n\t\t\tif errors.Is(err, io.EOF) {\n\t\t\t\tv.printer.Printf(\"* (#%d) Finished upload\", reqNum)\n\t\t\t}\n\t\t}\n\t}\n\treq.Body = &verboseReader{\n\t\tReadCloser: rawBody,\n\t\tcallback: func(count int) {\n\t\t\tv.traceWriteRequestBytes(reqNum, count)\n\t\t},\n\t\twhenDone: atEnd,\n\t\twhenStart: func() {\n\t\t\t// we defer this until body is read so that our HTTP client's dialer and TLS\n\t\t\t// config can potentially log useful things about connection setup *before*\n\t\t\t// we print the request info.\n\t\t\tv.traceRequest(req, reqNum)\n\t\t},\n\t}\n\tresp, err := v.transport.RoundTrip(req)\n\tif resp != nil {\n\t\tv.traceResponse(resp, reqNum)\n\t\tif resp.Body != nil {\n\t\t\tresp.Body = &verboseReader{\n\t\t\t\tReadCloser: resp.Body,\n\t\t\t\tcallback: func(count int) {\n\t\t\t\t\tv.traceReadResponseBytes(reqNum, count)\n\t\t\t\t},\n\t\t\t\twhenDone: func(err error) {\n\t\t\t\t\ttraceTrailers(v.printer, resp.Trailer, false, reqNum)\n\t\t\t\t\tv.printer.Printf(\"* (#%d) Call complete\", reqNum)\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t}\n\n\treturn resp, err\n}\n\nfunc (v *verboseClient) traceRequest(r *http.Request, reqNum int32) {\n\t// we look at the *raw* http headers, in case any get added by the\n\t// Connect client impl or an interceptor after we could otherwise\n\t// inspect them from an interceptor\n\tvar queryString string\n\tif r.URL.RawQuery != \"\" {\n\t\tqueryString = \"?\" + r.URL.RawQuery\n\t} else if r.URL.ForceQuery {\n\t\tqueryString = \"?\"\n\t}\n\tv.printer.Printf(\"> (#%d) %s %s%s\\n\", reqNum, r.Method, r.URL.Path, queryString)\n\ttraceMetadata(v.printer, r.Header, fmt.Sprintf(\"> (#%d) \", reqNum))\n\tv.printer.Printf(\"> (#%d)\\n\", reqNum)\n}\n\nfunc (v *verboseClient) traceWriteRequestBytes(reqNum int32, count int) {\n\tv.printer.Printf(\"} (#%d) [%d bytes data]\", reqNum, count)\n}\n\nfunc (v *verboseClient) traceResponse(r *http.Response, reqNum int32) {\n\tv.printer.Printf(\"< (#%d) %s %s\\n\", reqNum, r.Proto, r.Status)\n\ttraceMetadata(v.printer, r.Header, fmt.Sprintf(\"< (#%d) \", reqNum))\n\tv.printer.Printf(\"< (#%d)\\n\", reqNum)\n}\n\nfunc (v *verboseClient) traceReadResponseBytes(reqNum int32, count int) {\n\tv.printer.Printf(\"{ (#%d) [%d bytes data]\", reqNum, count)\n}\n\nfunc traceMetadata(printer verbose.Printer, meta http.Header, prefix string) {\n\tkeys := make([]string, 0, len(meta))\n\tfor key := range meta {\n\t\tkeys = append(keys, key)\n\t}\n\tsort.Strings(keys)\n\tfor _, key := range keys {\n\t\tvals := meta[key]\n\t\tfor _, val := range vals {\n\t\t\tprinter.Printf(\"%s%s: %s\\n\", prefix, key, val)\n\t\t}\n\t}\n}\n\nfunc traceTrailers(printer verbose.Printer, trailers http.Header, synthetic bool, reqNum int32) {\n\tif len(trailers) == 0 {\n\t\treturn\n\t}\n\tprinter.Printf(\"< (#%d)\\n\", reqNum)\n\tprefix := fmt.Sprintf(\"< (#%d) \", reqNum)\n\tif synthetic {\n\t\t// mark synthetic trailers with an asterisk\n\t\tprefix += \"[*] \"\n\t}\n\ttraceMetadata(printer, trailers, prefix)\n}\n\ntype verboseReader struct {\n\tio.ReadCloser\n\tcallback  func(int)\n\twhenStart func()\n\twhenDone  func(error)\n\tstarted   atomic.Bool\n\tdone      atomic.Bool\n}\n\nfunc (v *verboseReader) Read(dest []byte) (n int, err error) {\n\tif v.started.CompareAndSwap(false, true) && v.whenStart != nil {\n\t\tv.whenStart()\n\t}\n\tn, err = v.ReadCloser.Read(dest)\n\tif n > 0 && v.callback != nil {\n\t\tv.callback(n)\n\t}\n\tif err != nil {\n\t\tif v.done.CompareAndSwap(false, true) && v.whenDone != nil {\n\t\t\tv.whenDone(err)\n\t\t}\n\t}\n\treturn n, err\n}\n\nfunc (v *verboseReader) Close() error {\n\terr := v.ReadCloser.Close()\n\tif v.done.CompareAndSwap(false, true) && v.whenDone != nil {\n\t\treportError := err\n\t\tif reportError == nil {\n\t\t\treportError = io.EOF\n\t\t}\n\t\tv.whenDone(reportError)\n\t}\n\treturn err\n}\n\ntype traceTrailersInterceptor struct {\n\tprinter verbose.Printer\n}\n\nfunc (t traceTrailersInterceptor) WrapUnary(unaryFunc connect.UnaryFunc) connect.UnaryFunc {\n\treturn unaryFunc\n}\n\nfunc (t traceTrailersInterceptor) WrapStreamingClient(clientFunc connect.StreamingClientFunc) connect.StreamingClientFunc {\n\treturn func(ctx context.Context, spec connect.Spec) connect.StreamingClientConn {\n\t\tvar reqNum int32\n\t\tctx = context.WithValue(ctx, reqNumAddrKey{}, &reqNum)\n\t\treturn &traceTrailersStream{StreamingClientConn: clientFunc(ctx, spec), reqNum: &reqNum, printer: t.printer}\n\t}\n}\n\nfunc (t traceTrailersInterceptor) WrapStreamingHandler(handlerFunc connect.StreamingHandlerFunc) connect.StreamingHandlerFunc {\n\treturn handlerFunc\n}\n\ntype traceTrailersStream struct {\n\tconnect.StreamingClientConn\n\treqNum  *int32\n\tprinter verbose.Printer\n\tdone    atomic.Bool\n}\n\nfunc (s *traceTrailersStream) Receive(msg any) error {\n\terr := s.StreamingClientConn.Receive(msg)\n\tif err != nil && s.done.CompareAndSwap(false, true) {\n\t\ttraceTrailers(s.printer, s.ResponseTrailer(), true, *s.reqNum)\n\t}\n\treturn err\n}\n"
  },
  {
    "path": "private/buf/buffetch/buffetch.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\nconst (\n\t// MessageEncodingBinpb is the binary message encoding.\n\tMessageEncodingBinpb MessageEncoding = iota + 1\n\t// MessageEncodingJSON is the JSON message encoding.\n\tMessageEncodingJSON\n\t// MessageEncodingTxtpb is the text protobuf message encoding.\n\tMessageEncodingTxtpb\n\t// MessageEncodingYAML is the YAML message encoding.\n\tMessageEncodingYAML\n\n\tuseProtoNamesKey  = \"use_proto_names\"\n\tuseEnumNumbersKey = \"use_enum_numbers\"\n)\n\nvar (\n\t// MessageFormatsString is the string representation of all message formats.\n\t//\n\t// This does not include deprecated formats.\n\tMessageFormatsString = xstrings.SliceToString(messageFormatsNotDeprecated)\n\t// SourceDirFormatsString is the string representation of all source directory formats.\n\t// This includes all of the formats in SourceFormatsString except the protofile format.\n\t//\n\t// This does not include deprecated formats.\n\tSourceDirFormatsString = xstrings.SliceToString(sourceDirFormatsNotDeprecated)\n\t// SourceFormatsString is the string representation of all source formats.\n\t//\n\t// This does not include deprecated formats.\n\tSourceFormatsString = xstrings.SliceToString(sourceFormatsNotDeprecated)\n\t// ModuleFormatsString is the string representation of all module formats.\n\t//\n\t// Module formats are also source formats.\n\t//\n\t// This does not include deprecated formats.\n\tModuleFormatsString = xstrings.SliceToString(moduleFormatsNotDeprecated)\n\t// SourceOrModuleFormatsString is the string representation of all source or module formats.\n\t//\n\t// This does not include deprecated formats.\n\tSourceOrModuleFormatsString = xstrings.SliceToString(sourceOrModuleFormatsNotDeprecated)\n\t// DirOrProtoFileFormatsString is the string representation of all dir or proto file formats.\n\t//\n\t// This does not include deprecated formats.\n\tDirOrProtoFileFormatsString = xstrings.SliceToString(dirOrProtoFileFormats)\n\t// AllFormatsString is the string representation of all formats.\n\t//\n\t// This does not include deprecated formats.\n\tAllFormatsString = xstrings.SliceToString(allFormatsNotDeprecated)\n\n\t// ErrModuleFormatDetectedForDirOrProtoFileRef is the error returned if a module is the\n\t// detected format in the DirOrProtoFileRefParser. We have a special heuristic to determine\n\t// if a path is a module or directory, and if a user specifies a suspected module, we want to error.\n\tErrModuleFormatDetectedForDirOrProtoFileRef = errors.New(\"module format detected when parsing dir or proto file refs\")\n)\n\n// MessageEncoding is the encoding of the message.\ntype MessageEncoding int\n\n// Ref is an message file or source bucket reference.\ntype Ref interface {\n\tinternalRef() internal.Ref\n}\n\n// MessageRef is a message file reference.\ntype MessageRef interface {\n\tRef\n\tMessageEncoding() MessageEncoding\n\t// Path returns the path of the file.\n\t//\n\t// May be used for items such as YAML unmarshalling errors.\n\tPath() string\n\t// UseProtoNames only applies for MessageEncodingYAML at this time.\n\tUseProtoNames() bool\n\t// UseEnumNumbers only applies for MessageEncodingYAML at this time.\n\tUseEnumNumbers() bool\n\tIsNull() bool\n\tinternalSingleRef() internal.SingleRef\n}\n\n// SourceOrModuleRef is a source bucket or module reference.\ntype SourceOrModuleRef interface {\n\tRef\n\tisSourceOrModuleRef()\n}\n\n// DirOrProtoFileRef is a directory or proto file reference.\ntype DirOrProtoFileRef interface {\n\tisDirOrProtoFileRef()\n}\n\n// SourceRef is a source bucket reference.\ntype SourceRef interface {\n\tSourceOrModuleRef\n\tinternalBucketRef() internal.BucketRef\n}\n\n// DirRef is a dir bucket reference.\ntype DirRef interface {\n\tSourceRef\n\tDirOrProtoFileRef\n\tDirPath() string\n\tinternalDirRef() internal.DirRef\n}\n\n// ModuleRef is a module reference.\ntype ModuleRef interface {\n\tSourceOrModuleRef\n\tinternalModuleRef() internal.ModuleRef\n}\n\n// ProtoFileRef is a proto file reference.\ntype ProtoFileRef interface {\n\tSourceRef\n\tDirOrProtoFileRef\n\tProtoFilePath() string\n\t// IsDevPath returns true if the FileScheme is Stdio, Stdout, Stdin, or Null.\n\tIsDevPath() bool\n\tIncludePackageFiles() bool\n\tinternalProtoFileRef() internal.ProtoFileRef\n}\n\n// MessageRefParser is an message ref parser for Buf.\ntype MessageRefParser interface {\n\t// GetMessageRef gets the reference for the message file.\n\tGetMessageRef(ctx context.Context, value string) (MessageRef, error)\n\t// GetMessageRefForInputConfig gets the reference for the message file.\n\tGetMessageRefForInputConfig(\n\t\tctx context.Context,\n\t\tinputConfig bufconfig.InputConfig,\n\t) (MessageRef, error)\n}\n\n// SourceRefParser is a source ref parser for Buf.\ntype SourceRefParser interface {\n\t// GetSourceRef gets the reference for the source file.\n\tGetSourceRef(ctx context.Context, value string) (SourceRef, error)\n\t// GetSourceRefForInputConfig gets the reference for the source file.\n\tGetSourceRefForInputConfig(\n\t\tctx context.Context,\n\t\tinputConfig bufconfig.InputConfig,\n\t) (SourceRef, error)\n}\n\n// DirRefParser is a dir ref parser for Buf.\ntype DirRefParser interface {\n\t// GetDirRef gets the reference for the value.\n\t//\n\t// The value cannot be stdin, stdout, or stderr.\n\tGetDirRef(ctx context.Context, value string) (DirRef, error)\n\t// GetDirRefForInputConfig gets the reference for the InputConfig.\n\t//\n\t// The input cannot be stdin, stdout, or stderr.\n\tGetDirRefForInputConfig(\n\t\tctx context.Context,\n\t\tinputConfig bufconfig.InputConfig,\n\t) (DirRef, error)\n}\n\n// DirOrProtoFileRefParser is a dir or proto file ref parser for Buf.\ntype DirOrProtoFileRefParser interface {\n\t// GetDirOrProtoFileRef gets the reference for the value.\n\t//\n\t// The value cannot be stdin, stdout, or stderr.\n\tGetDirOrProtoFileRef(ctx context.Context, value string) (DirOrProtoFileRef, error)\n\t// GetDirOrProtoFileRefForInputConfig gets the reference for the InputConfig.\n\t//\n\t// The input cannot be stdin, stdout, or stderr.\n\tGetDirOrProtoFileRefForInputConfig(\n\t\tctx context.Context,\n\t\tinputConfig bufconfig.InputConfig,\n\t) (DirOrProtoFileRef, error)\n}\n\n// ModuleRefParser is a source ref parser for Buf.\ntype ModuleRefParser interface {\n\t// GetModuleRef gets the reference for the source file.\n\t//\n\t// A module is a special type of source with additional properties.\n\tGetModuleRef(ctx context.Context, value string) (ModuleRef, error)\n}\n\n// SourceOrModuleRefParser is a source or module ref parser for Buf.\ntype SourceOrModuleRefParser interface {\n\tSourceRefParser\n\tModuleRefParser\n\n\t// GetSourceOrModuleRef gets the reference for the message file or source bucket.\n\tGetSourceOrModuleRef(ctx context.Context, value string) (SourceOrModuleRef, error)\n\t// GetSourceOrModuleRefForInputConfig gets the reference for the message file or source bucket.\n\tGetSourceOrModuleRefForInputConfig(\n\t\tctx context.Context,\n\t\tinputConfig bufconfig.InputConfig,\n\t) (SourceOrModuleRef, error)\n}\n\n// RefParser is a ref parser for Buf.\ntype RefParser interface {\n\tMessageRefParser\n\tSourceRefParser\n\tDirRefParser\n\tSourceOrModuleRefParser\n\n\t// GetRef gets the reference for the message file, source bucket, or module.\n\t// TODO FUTURE: should this be renamed to GetRefForString?\n\tGetRef(ctx context.Context, value string) (Ref, error)\n\t// GetRefForInputConfig gets the reference for the message file, source bucket, or module.\n\tGetRefForInputConfig(ctx context.Context, inputConfig bufconfig.InputConfig) (Ref, error)\n}\n\n// NewRefParser returns a new RefParser.\n//\n// This defaults to dir or module.\nfunc NewRefParser(logger *slog.Logger) RefParser {\n\treturn newRefParser(logger)\n}\n\n// NewMessageRefParser returns a new RefParser for messages only.\nfunc NewMessageRefParser(logger *slog.Logger, options ...MessageRefParserOption) MessageRefParser {\n\treturn newMessageRefParser(logger, options...)\n}\n\n// MessageRefParserOption is an option for a new MessageRefParser.\ntype MessageRefParserOption func(*messageRefParserOptions)\n\n// MessageRefParserWithDefaultMessageEncoding says to use the default MessageEncoding.\n//\n// The default default is MessageEncodingBinpb.\nfunc MessageRefParserWithDefaultMessageEncoding(defaultMessageEncoding MessageEncoding) MessageRefParserOption {\n\treturn func(messageRefParserOptions *messageRefParserOptions) {\n\t\tmessageRefParserOptions.defaultMessageEncoding = defaultMessageEncoding\n\t}\n}\n\n// NewSourceRefParser returns a new RefParser for sources only.\n//\n// This defaults to dir.\nfunc NewSourceRefParser(logger *slog.Logger) SourceRefParser {\n\treturn newSourceRefParser(logger)\n}\n\n// NewDirRefParser returns a new RefParser for dirs only.\nfunc NewDirRefParser(logger *slog.Logger) DirRefParser {\n\treturn newDirRefParser(logger)\n}\n\n// NewDirOrProtoFileRefParser returns a new RefParser for dirs only.\nfunc NewDirOrProtoFileRefParser(logger *slog.Logger) DirOrProtoFileRefParser {\n\treturn newDirOrProtoFileRefParser(logger)\n}\n\n// NewModuleRefParser returns a new RefParser for modules only.\nfunc NewModuleRefParser(logger *slog.Logger) ModuleRefParser {\n\treturn newModuleRefParser(logger)\n}\n\n// NewSourceOrModuleRefParser returns a new RefParser for sources or modules only.\n//\n// This defaults to dir or module.\nfunc NewSourceOrModuleRefParser(logger *slog.Logger) SourceOrModuleRefParser {\n\treturn newSourceOrModuleRefParser(logger)\n}\n\n// BucketExtender matches the internal type.\ntype BucketExtender internal.BucketExtender\n\n// ReadBucketCloser matches the internal type.\ntype ReadBucketCloser internal.ReadBucketCloser\n\n// ReadWriteBucket matches the internal type.\ntype ReadWriteBucket internal.ReadWriteBucket\n\n// MessageReader is a message reader.\ntype MessageReader interface {\n\t// GetMessageFile gets the message file.\n\t//\n\t// The returned file will be uncompressed.\n\tGetMessageFile(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tmessageRef MessageRef,\n\t) (io.ReadCloser, error)\n}\n\n// SourceReader is a source reader.\ntype SourceReader interface {\n\t// GetSourceReadBucketCloser gets the source bucket.\n\tGetSourceReadBucketCloser(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tsourceRef SourceRef,\n\t\toptions ...GetReadBucketCloserOption,\n\t) (ReadBucketCloser, buftarget.BucketTargeting, error)\n}\n\n// GetReadBucketCloserOption is an option for a GetSourceReadBucketCloser call.\ntype GetReadBucketCloserOption func(*getReadBucketCloserOptions)\n\n// GetReadBucketCloserWithCopyToInMemory says to copy the returned ReadBucketCloser to an\n// in-memory ReadBucketCloser. This can be a performance optimization at the expense of memory.\nfunc GetReadBucketCloserWithCopyToInMemory() GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.copyToInMemory = true\n\t}\n}\n\n// GetReadBucketCloserWithNoSearch says to not search for buf.work.yamls or buf.yamls, instead just returning a bucket for the\n// direct SourceRef or DirRef given.\n//\n// This is used for when the --config flag is specified.\nfunc GetReadBucketCloserWithNoSearch() GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.noSearch = true\n\t}\n}\n\n// GetReadBucketCloserWithTargetPaths sets the targets paths for bucket targeting information\n// returned with the bucket.\nfunc GetReadBucketCloserWithTargetPaths(targetPaths []string) GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.targetPaths = targetPaths\n\t}\n}\n\n// GetReadBucketCloserWithTargetExcludePaths sets the target exclude paths for bucket targeting\n// information returned with the bucket.\nfunc GetReadBucketCloserWithTargetExcludePaths(targetExcludePaths []string) GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.targetExcludePaths = targetExcludePaths\n\t}\n}\n\n// DirReader is a dir reader.\ntype DirReader interface {\n\t// GetDirReadWriteBucket gets the dir bucket.\n\tGetDirReadWriteBucket(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tdirRef DirRef,\n\t\toptions ...GetReadWriteBucketOption,\n\t) (ReadWriteBucket, buftarget.BucketTargeting, error)\n}\n\n// GetReadWriteBucketOption is an option for a GetDirReadWriteBucket call.\ntype GetReadWriteBucketOption func(*getReadWriteBucketOptions)\n\n// GetReadWriteBucketWithNoSearch says to not search for buf.work.yamls or buf.yamls, instead just returning a bucket for the\n// direct SourceRef or DirRef given.\n//\n// This is used for when the --config flag is specified.\nfunc GetReadWriteBucketWithNoSearch() GetReadWriteBucketOption {\n\treturn func(getReadWriteBucketOptions *getReadWriteBucketOptions) {\n\t\tgetReadWriteBucketOptions.noSearch = true\n\t}\n}\n\n// GetReadWriteBucketWithTargetPaths sets the target paths for the bucket targeting information\n// returned with the bucket.\nfunc GetReadWriteBucketWithTargetPaths(targetPaths []string) GetReadWriteBucketOption {\n\treturn func(getReadWriteBucketOptions *getReadWriteBucketOptions) {\n\t\tgetReadWriteBucketOptions.targetPaths = targetPaths\n\t}\n}\n\n// GetReadWriteBucketWithTargetExcludePaths sets the target exclude paths for the bucket\n// targeting information returned with the bucket.\nfunc GetReadWriteBucketWithTargetExcludePaths(targetExcludePaths []string) GetReadWriteBucketOption {\n\treturn func(getReadWriteBucketOptions *getReadWriteBucketOptions) {\n\t\tgetReadWriteBucketOptions.targetExcludePaths = targetExcludePaths\n\t}\n}\n\n// ModuleFetcher is a module fetcher.\ntype ModuleFetcher interface {\n\t// GetModuleKey gets the ModuleKey.\n\t// Unresolved ModuleRef's are automatically resolved.\n\tGetModuleKey(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tmoduleRef ModuleRef,\n\t) (bufmodule.ModuleKey, error)\n}\n\n// Reader is a reader for Buf.\ntype Reader interface {\n\tMessageReader\n\tSourceReader\n\tDirReader\n\tModuleFetcher\n}\n\n// NewReader returns a new Reader.\nfunc NewReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n\thttpAuthenticator httpauth.Authenticator,\n\tgitCloner git.Cloner,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n) Reader {\n\treturn newReader(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\thttpClient,\n\t\thttpAuthenticator,\n\t\tgitCloner,\n\t\tmoduleKeyProvider,\n\t)\n}\n\n// NewMessageReader returns a new MessageReader.\nfunc NewMessageReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n\thttpAuthenticator httpauth.Authenticator,\n\tgitCloner git.Cloner,\n) MessageReader {\n\treturn newMessageReader(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\thttpClient,\n\t\thttpAuthenticator,\n\t\tgitCloner,\n\t)\n}\n\n// NewSourceReader returns a new SourceReader.\nfunc NewSourceReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n\thttpAuthenticator httpauth.Authenticator,\n\tgitCloner git.Cloner,\n) SourceReader {\n\treturn newSourceReader(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\thttpClient,\n\t\thttpAuthenticator,\n\t\tgitCloner,\n\t)\n}\n\n// NewDirReader returns a new DirReader.\nfunc NewDirReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n) DirReader {\n\treturn newDirReader(\n\t\tlogger,\n\t\tstorageosProvider,\n\t)\n}\n\n// NewModuleFetcher returns a new ModuleFetcher.\nfunc NewModuleFetcher(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n) ModuleFetcher {\n\treturn newModuleFetcher(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\tmoduleKeyProvider,\n\t)\n}\n\n// Writer is a writer for Buf.\ntype Writer interface {\n\t// PutMessageFile puts the message file.\n\tPutMessageFile(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdoutContainer,\n\t\tmessageRef MessageRef,\n\t) (io.WriteCloser, error)\n}\n\n// NewWriter returns a new Writer.\nfunc NewWriter(\n\tlogger *slog.Logger,\n) Writer {\n\treturn newWriter(\n\t\tlogger,\n\t)\n}\n\n// ProtoFileWriter is a writer of proto files.\ntype ProtoFileWriter interface {\n\t// PutProtoFile puts the proto file.\n\tPutProtoFile(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdoutContainer,\n\t\tprotoFileRef ProtoFileRef,\n\t) (io.WriteCloser, error)\n}\n\n// NewProtoFileWriter returns a new ProtoFileWriter.\nfunc NewProtoFileWriter(\n\tlogger *slog.Logger,\n) ProtoFileWriter {\n\treturn newProtoFileWriter(\n\t\tlogger,\n\t)\n}\n\n// GetInputConfigForString returns the input config for the input string.\nfunc GetInputConfigForString(\n\tctx context.Context,\n\trefParser RefParser,\n\tvalue string,\n) (bufconfig.InputConfig, error) {\n\tref, err := refParser.GetRef(ctx, value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := ref.(type) {\n\tcase MessageRef:\n\t\tswitch t.MessageEncoding() {\n\t\tcase MessageEncodingBinpb:\n\t\t\treturn bufconfig.NewBinaryImageInputConfig(\n\t\t\t\tt.Path(),\n\t\t\t\tt.internalSingleRef().CompressionType().String(),\n\t\t\t)\n\t\tcase MessageEncodingJSON:\n\t\t\treturn bufconfig.NewJSONImageInputConfig(\n\t\t\t\tt.Path(),\n\t\t\t\tt.internalSingleRef().CompressionType().String(),\n\t\t\t)\n\t\tcase MessageEncodingTxtpb:\n\t\t\treturn bufconfig.NewTextImageInputConfig(\n\t\t\t\tt.Path(),\n\t\t\t\tt.internalSingleRef().CompressionType().String(),\n\t\t\t)\n\t\tcase MessageEncodingYAML:\n\t\t\treturn bufconfig.NewYAMLImageInputConfig(\n\t\t\t\tt.Path(),\n\t\t\t\tt.internalSingleRef().CompressionType().String(),\n\t\t\t)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown encoding: %v\", t.MessageEncoding())\n\t\t}\n\t}\n\treturn internal.GetInputConfigForRef(ref.internalRef(), value)\n}\n\ntype getReadBucketCloserOptions struct {\n\tnoSearch           bool\n\tcopyToInMemory     bool\n\ttargetPaths        []string\n\ttargetExcludePaths []string\n}\n\nfunc newGetReadBucketCloserOptions() *getReadBucketCloserOptions {\n\treturn &getReadBucketCloserOptions{}\n}\n\ntype getReadWriteBucketOptions struct {\n\tnoSearch           bool\n\ttargetPaths        []string\n\ttargetExcludePaths []string\n}\n\nfunc newGetReadWriteBucketOptions() *getReadWriteBucketOptions {\n\treturn &getReadWriteBucketOptions{}\n}\n"
  },
  {
    "path": "private/buf/buffetch/buffetch_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"io\"\n\t\"log/slog\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestRoundTripBin(t *testing.T) {\n\tt.Parallel()\n\ttestRoundTripLocalFile(\n\t\tt,\n\t\t\"file.bin\",\n\t\t[]byte(\"one\"),\n\t\tformatBinpb,\n\t\tinternal.CompressionTypeNone,\n\t)\n}\n\nfunc TestRoundTripBinGz(t *testing.T) {\n\tt.Parallel()\n\ttestRoundTripLocalFile(\n\t\tt,\n\t\t\"file.bin.gz\",\n\t\t[]byte(\"one\"),\n\t\tformatBinpb,\n\t\tinternal.CompressionTypeGzip,\n\t)\n}\n\nfunc TestRoundTripBinZst(t *testing.T) {\n\tt.Parallel()\n\ttestRoundTripLocalFile(\n\t\tt,\n\t\t\"file.bin.zst\",\n\t\t[]byte(\"one\"),\n\t\tformatBinpb,\n\t\tinternal.CompressionTypeZstd,\n\t)\n}\n\nfunc TestRoundTripBinpb(t *testing.T) {\n\tt.Parallel()\n\ttestRoundTripLocalFile(\n\t\tt,\n\t\t\"file.binpb\",\n\t\t[]byte(\"one\"),\n\t\tformatBinpb,\n\t\tinternal.CompressionTypeNone,\n\t)\n}\n\nfunc TestRoundTripBinpbGz(t *testing.T) {\n\tt.Parallel()\n\ttestRoundTripLocalFile(\n\t\tt,\n\t\t\"file.binpb.gz\",\n\t\t[]byte(\"one\"),\n\t\tformatBinpb,\n\t\tinternal.CompressionTypeGzip,\n\t)\n}\n\nfunc TestRoundTripBinpbZst(t *testing.T) {\n\tt.Parallel()\n\ttestRoundTripLocalFile(\n\t\tt,\n\t\t\"file.binpb.zst\",\n\t\t[]byte(\"one\"),\n\t\tformatBinpb,\n\t\tinternal.CompressionTypeZstd,\n\t)\n}\n\nfunc testRoundTripLocalFile(\n\tt *testing.T,\n\tfilename string,\n\texpectedData []byte,\n\texpectedFormat string,\n\texpectedCompressionType internal.CompressionType,\n) {\n\tlogger := slogtestext.NewLogger(t)\n\trefParser := newRefParser(logger)\n\treader := testNewFetchReader(logger)\n\twriter := testNewFetchWriter(logger)\n\n\tctx := t.Context()\n\tcontainer := app.NewContainer(nil, nil, nil, nil)\n\n\ttmpDir := t.TempDir()\n\tfilePath := filepath.Join(tmpDir, filename)\n\n\tparsedRef, err := refParser.getParsedRef(ctx, filePath, allFormats)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expectedFormat, parsedRef.Format())\n\tfileRef, ok := parsedRef.(internal.FileRef)\n\trequire.True(t, ok)\n\trequire.Equal(t, expectedCompressionType, fileRef.CompressionType())\n\n\twriteCloser, err := writer.PutFile(ctx, container, fileRef)\n\trequire.NoError(t, err)\n\t_, err = writeCloser.Write(expectedData)\n\trequire.NoError(t, err)\n\trequire.NoError(t, writeCloser.Close())\n\n\treadCloser, err := reader.GetFile(ctx, container, fileRef)\n\trequire.NoError(t, err)\n\tactualData, err := io.ReadAll(readCloser)\n\trequire.NoError(t, err)\n\trequire.NoError(t, readCloser.Close())\n\n\trequire.Equal(t, string(expectedData), string(actualData))\n}\n\nfunc testNewFetchReader(logger *slog.Logger) internal.Reader {\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\treturn internal.NewReader(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\tinternal.WithReaderLocal(),\n\t)\n}\n\nfunc testNewFetchWriter(logger *slog.Logger) internal.Writer {\n\treturn internal.NewWriter(\n\t\tlogger,\n\t\tinternal.WithWriterLocal(),\n\t)\n}\n"
  },
  {
    "path": "private/buf/buffetch/dir_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\nvar _ DirRef = &dirRef{}\n\ntype dirRef struct {\n\tiDirRef internal.DirRef\n}\n\nfunc newDirRef(iDirRef internal.DirRef) *dirRef {\n\treturn &dirRef{\n\t\tiDirRef: iDirRef,\n\t}\n}\n\nfunc (r *dirRef) DirPath() string {\n\treturn r.iDirRef.Path()\n}\n\nfunc (r *dirRef) internalRef() internal.Ref {\n\treturn r.iDirRef\n}\n\nfunc (r *dirRef) internalBucketRef() internal.BucketRef {\n\treturn r.iDirRef\n}\n\nfunc (r *dirRef) internalDirRef() internal.DirRef {\n\treturn r.iDirRef\n}\n\nfunc (*dirRef) isSourceOrModuleRef() {}\n\nfunc (*dirRef) isDirOrProtoFileRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/format.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nconst (\n\t// formatBinpb is the protobuf binary format.\n\tformatBinpb = \"binpb\"\n\t// formatTxtpb is the protobuf text format.\n\tformatTxtpb = \"txtpb\"\n\t// formatDir is the directory format.\n\tformatDir = \"dir\"\n\t// formatGit is the git format.\n\tformatGit = \"git\"\n\t// formatJSON is the JSON format.\n\tformatJSON = \"json\"\n\t// formatYAML is the YAML format.\n\tformatYAML = \"yaml\"\n\t// formatMod is the module format.\n\tformatMod = \"mod\"\n\t// formatTar is the tar format.\n\tformatTar = \"tar\"\n\t// formatZip is the zip format.\n\tformatZip = \"zip\"\n\t// formatProtoFile is the proto file format.\n\tformatProtoFile = \"protofile\"\n\n\t// formatBin is the binary format's old form, now deprecated.\n\tformatBin = \"bin\"\n\t// formatBingz is the binary gzipped format, now deprecated.\n\tformatBingz = \"bingz\"\n\t// formatJSONGZ is the JSON gzipped format, now deprecated.\n\tformatJSONGZ = \"jsongz\"\n\t// formatTargz is the tar gzipped format, now deprecated.\n\tformatTargz = \"targz\"\n)\n\nvar (\n\t// sorted\n\tmessageFormats = []string{\n\t\tformatBin,\n\t\tformatBinpb,\n\t\tformatBingz,\n\t\tformatJSON,\n\t\tformatJSONGZ,\n\t\tformatTxtpb,\n\t\tformatYAML,\n\t}\n\t// sorted\n\tmessageFormatsNotDeprecated = []string{\n\t\tformatBinpb,\n\t\tformatJSON,\n\t\tformatTxtpb,\n\t\tformatYAML,\n\t}\n\t// sorted\n\tsourceFormats = []string{\n\t\tformatDir,\n\t\tformatGit,\n\t\tformatProtoFile,\n\t\tformatTar,\n\t\tformatTargz,\n\t\tformatZip,\n\t}\n\t// sorted\n\tsourceFormatsNotDeprecated = []string{\n\t\tformatDir,\n\t\tformatGit,\n\t\tformatProtoFile,\n\t\tformatTar,\n\t\tformatZip,\n\t}\n\tsourceDirFormatsNotDeprecated = []string{\n\t\tformatDir,\n\t\tformatGit,\n\t\tformatTar,\n\t\tformatZip,\n\t}\n\t// sorted\n\tdirFormats = []string{\n\t\tformatDir,\n\t}\n\t// sorted\n\tdirOrProtoFileFormats = []string{\n\t\tformatDir,\n\t\tformatProtoFile,\n\t}\n\t// sorted\n\tmoduleFormats = []string{\n\t\tformatMod,\n\t}\n\t// sorted\n\tmoduleFormatsNotDeprecated = []string{\n\t\tformatMod,\n\t}\n\t// sorted\n\tsourceOrModuleFormats = []string{\n\t\tformatDir,\n\t\tformatGit,\n\t\tformatMod,\n\t\tformatProtoFile,\n\t\tformatTar,\n\t\tformatTargz,\n\t\tformatZip,\n\t}\n\t// sorted\n\tsourceOrModuleFormatsNotDeprecated = []string{\n\t\tformatDir,\n\t\tformatGit,\n\t\tformatMod,\n\t\tformatProtoFile,\n\t\tformatTar,\n\t\tformatZip,\n\t}\n\t// sorted\n\tallFormats = []string{\n\t\tformatBin,\n\t\tformatBinpb,\n\t\tformatBingz,\n\t\tformatDir,\n\t\tformatGit,\n\t\tformatJSON,\n\t\tformatJSONGZ,\n\t\tformatMod,\n\t\tformatProtoFile,\n\t\tformatTar,\n\t\tformatTargz,\n\t\tformatTxtpb,\n\t\tformatYAML,\n\t\tformatZip,\n\t}\n\t// sorted\n\tallFormatsNotDeprecated = []string{\n\t\tformatBinpb,\n\t\tformatDir,\n\t\tformatGit,\n\t\tformatJSON,\n\t\tformatMod,\n\t\tformatProtoFile,\n\t\tformatTar,\n\t\tformatTxtpb,\n\t\tformatYAML,\n\t\tformatZip,\n\t}\n\n\tdeprecatedCompressionFormatToReplacementFormat = map[string]string{\n\t\tformatBingz:  formatBinpb,\n\t\tformatJSONGZ: formatJSON,\n\t\tformatTargz:  formatTar,\n\t}\n\n\tmessageEncodingToFormat = map[MessageEncoding]string{\n\t\tMessageEncodingBinpb: formatBinpb,\n\t\tMessageEncodingJSON:  formatJSON,\n\t\tMessageEncodingTxtpb: formatTxtpb,\n\t\tMessageEncodingYAML:  formatYAML,\n\t}\n)\n"
  },
  {
    "path": "private/buf/buffetch/internal/archive_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport \"github.com/bufbuild/buf/private/pkg/normalpath\"\n\nvar (\n\t_ ParsedArchiveRef = &archiveRef{}\n)\n\ntype archiveRef struct {\n\tformat          string\n\tpath            string\n\tfileScheme      FileScheme\n\tarchiveType     ArchiveType\n\tcompressionType CompressionType\n\tstripComponents uint32\n\tsubDirPath      string\n}\n\nfunc newArchiveRef(\n\tformat string,\n\tpath string,\n\tarchiveType ArchiveType,\n\tcompressionType CompressionType,\n\tstripComponents uint32,\n\tsubDirPath string,\n) (*archiveRef, error) {\n\tif archiveType == ArchiveTypeZip && compressionType != CompressionTypeNone {\n\t\treturn nil, NewCannotSpecifyCompressionForZipError()\n\t}\n\tsingleRef, err := newSingleRef(\n\t\tformat,\n\t\tpath,\n\t\tcompressionType,\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsubDirPath, err = normalpath.NormalizeAndValidate(subDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif subDirPath == \".\" {\n\t\tsubDirPath = \"\"\n\t}\n\treturn newDirectArchiveRef(\n\t\tsingleRef.Format(),\n\t\tsingleRef.Path(),\n\t\tsingleRef.FileScheme(),\n\t\tarchiveType,\n\t\tsingleRef.CompressionType(),\n\t\tstripComponents,\n\t\tsubDirPath,\n\t), nil\n}\n\nfunc newDirectArchiveRef(\n\tformat string,\n\tpath string,\n\tfileScheme FileScheme,\n\tarchiveType ArchiveType,\n\tcompressionType CompressionType,\n\tstripComponents uint32,\n\tsubDirPath string,\n) *archiveRef {\n\treturn &archiveRef{\n\t\tformat:          format,\n\t\tpath:            path,\n\t\tfileScheme:      fileScheme,\n\t\tarchiveType:     archiveType,\n\t\tcompressionType: compressionType,\n\t\tstripComponents: stripComponents,\n\t\tsubDirPath:      subDirPath,\n\t}\n}\n\nfunc (r *archiveRef) Format() string {\n\treturn r.format\n}\n\nfunc (r *archiveRef) Path() string {\n\treturn r.path\n}\n\nfunc (r *archiveRef) FileScheme() FileScheme {\n\treturn r.fileScheme\n}\n\nfunc (r *archiveRef) ArchiveType() ArchiveType {\n\treturn r.archiveType\n}\n\nfunc (r *archiveRef) CompressionType() CompressionType {\n\treturn r.compressionType\n}\n\nfunc (r *archiveRef) StripComponents() uint32 {\n\treturn r.stripComponents\n}\n\nfunc (r *archiveRef) SubDirPath() string {\n\treturn r.subDirPath\n}\n\nfunc (*archiveRef) ref()        {}\nfunc (*archiveRef) fileRef()    {}\nfunc (*archiveRef) bucketRef()  {}\nfunc (*archiveRef) archiveRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/internal/dir_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xpath/xfilepath\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\nvar (\n\t_ ParsedDirRef = &dirRef{}\n)\n\ntype dirRef struct {\n\tformat string\n\tpath   string\n}\n\nfunc newDirRef(\n\tformat string,\n\tpath string,\n) (*dirRef, error) {\n\tif path == \"\" {\n\t\treturn nil, NewNoPathError()\n\t}\n\tif app.IsDevStderr(path) {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tif path == \"-\" || app.IsDevNull(path) || app.IsDevStdin(path) || app.IsDevStdout(path) {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tif strings.Contains(path, \"://\") {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tpath, err := xfilepath.RealClean(path)\n\tif err != nil {\n\t\treturn nil, NewRealCleanPathError(path)\n\t}\n\treturn newDirectDirRef(\n\t\tformat,\n\t\tnormalpath.Normalize(path),\n\t), nil\n}\n\nfunc newDirectDirRef(\n\tformat string,\n\tpath string,\n) *dirRef {\n\treturn &dirRef{\n\t\tformat: format,\n\t\tpath:   path,\n\t}\n}\n\nfunc (r *dirRef) Format() string {\n\treturn r.format\n}\n\nfunc (r *dirRef) Path() string {\n\treturn r.path\n}\n\nfunc (*dirRef) ref()       {}\nfunc (*dirRef) bucketRef() {}\nfunc (*dirRef) dirRef()    {}\n"
  },
  {
    "path": "private/buf/buffetch/internal/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n)\n\nvar (\n\tknownCompressionTypeStrings = []string{\n\t\t\"none\",\n\t\t\"gzip\",\n\t\t\"zstd\",\n\t}\n)\n\n// NewFormatNotAllowedError is a fetch error.\nfunc NewFormatNotAllowedError(format string, allowedFormats map[string]struct{}) error {\n\treturn fmt.Errorf(\"format was %q but must be one of %s\", format, formatsToString(allowedFormats))\n}\n\n// NewFormatCannotBeDeterminedError is a fetch error.\nfunc NewFormatCannotBeDeterminedError(value string) error {\n\treturn fmt.Errorf(\"format cannot be determined from %q\", value)\n}\n\n// NewCannotSpecifyGitBranchAndCommitOrTagError is a fetch error.\nfunc NewCannotSpecifyGitBranchAndCommitOrTagError() error {\n\treturn errors.New(`must specify only one of \"branch\", \"commit\", or \"tag\"`)\n}\n\n// NewCannotSpecifyCommitOrTagWithRefError is a fetch error.\nfunc NewCannotSpecifyCommitOrTagWithRefError() error {\n\treturn errors.New(`cannot specify \"commit\" or \"tag\" with \"ref\"`)\n}\n\n// NewDepthParseError is a fetch error.\nfunc NewDepthParseError(s string) error {\n\treturn fmt.Errorf(`could not parse \"depth\" value %q`, s)\n}\n\n// NewDepthZeroError is a fetch error.\nfunc NewDepthZeroError() error {\n\treturn errors.New(`\"depth\" must be >0 if specified`)\n}\n\n// NewPathUnknownGzError is a fetch error.\nfunc NewPathUnknownGzError(path string) error {\n\treturn fmt.Errorf(\"path %q had .gz extension with unknown format\", path)\n}\n\n// NewCompressionUnknownError is a fetch error.\nfunc NewCompressionUnknownError(compression string) error {\n\treturn fmt.Errorf(\"unknown compression: %q (valid values are %q)\", compression, strings.Join(knownCompressionTypeStrings, \",\"))\n}\n\n// NewCannotSpecifyCompressionForZipError is a fetch error.\nfunc NewCannotSpecifyCompressionForZipError() error {\n\treturn errors.New(\"cannot specify compression type for zip files\")\n}\n\n// NewNoPathError is a fetch error.\nfunc NewNoPathError() error {\n\treturn errors.New(\"value has no path once processed\")\n}\n\n// NewOptionsInvalidKeysError is a fetch error.\nfunc NewOptionsInvalidKeysError(keys ...string) error {\n\tif len(keys) == 1 {\n\t\treturn fmt.Errorf(\"invalid key: %q\", keys[0])\n\t}\n\treturn fmt.Errorf(\"invalid keys: \\\"%v\\\"\", strings.Join(keys, \", \"))\n}\n\n// NewOptionsInvalidValueForKeyError is a fetch error.\nfunc NewOptionsInvalidValueForKeyError(key string, value string) error {\n\treturn fmt.Errorf(\"invalid value %q for key: %q\", value, key)\n}\n\n// NewOptionsInvalidForFormatError is a fetch error.\nfunc NewOptionsInvalidForFormatError(format string, inputName string, issue string) error {\n\treturn fmt.Errorf(\"invalid options for input %q for format %q: %s\", inputName, format, issue)\n}\n\n// NewOptionsCouldNotParseStripComponentsError is a fetch error.\nfunc NewOptionsCouldNotParseStripComponentsError(s string) error {\n\treturn fmt.Errorf(\"could not parse strip_components value %q\", s)\n}\n\n// NewOptionsCouldNotParseRecurseSubmodulesError is a fetch error.\nfunc NewOptionsCouldNotParseRecurseSubmodulesError(s string) error {\n\treturn fmt.Errorf(\"could not parse recurse_submodules value %q\", s)\n}\n\n// NewFormatOverrideNotAllowedForDevNullError is a fetch error.\nfunc NewFormatOverrideNotAllowedForDevNullError(devNull string) error {\n\treturn fmt.Errorf(\"not allowed if path is %s\", devNull)\n}\n\n// NewInvalidPathError is a fetch error.\nfunc NewInvalidPathError(format string, path string) error {\n\tif format != \"\" {\n\t\tformat = format + \" \"\n\t}\n\treturn fmt.Errorf(\"invalid %spath: %q\", format, path)\n}\n\n// NewProtoFileCannotBeDevPathError is a fetch error.\nfunc NewProtoFileCannotBeDevPathError(format string, path string) error {\n\tif format != \"\" {\n\t\tformat = format + \" \"\n\t}\n\treturn fmt.Errorf(\"invalid %spath: %q (protofiles cannot be read or written to or from stdio)\", format, path)\n}\n\n// NewRealCleanPathError is a fetch error.\nfunc NewRealCleanPathError(path string) error {\n\treturn fmt.Errorf(\"could not clean relative path %q\", path)\n}\n\n// NewFormatUnknownError is a fetch error.\nfunc NewFormatUnknownError(formatString string) error {\n\treturn fmt.Errorf(\"unknown format: %q\", formatString)\n}\n\n// NewReadDisabledError is a fetch error.\nfunc NewReadDisabledError(scheme string) error {\n\treturn fmt.Errorf(\"reading assets from %s disabled\", scheme)\n}\n\n// NewReadHTTPDisabledError is a fetch error.\nfunc NewReadHTTPDisabledError() error {\n\treturn NewReadDisabledError(\"http\")\n}\n\n// NewReadGitDisabledError is a fetch error.\nfunc NewReadGitDisabledError() error {\n\treturn NewReadDisabledError(\"git\")\n}\n\n// NewReadLocalDisabledError is a fetch error.\nfunc NewReadLocalDisabledError() error {\n\treturn NewReadDisabledError(\"local\")\n}\n\n// NewReadStdioDisabledError is a fetch error.\nfunc NewReadStdioDisabledError() error {\n\treturn NewReadDisabledError(\"stdin\")\n}\n\n// NewReadModuleDisabledError is a fetch error.\nfunc NewReadModuleDisabledError() error {\n\treturn NewReadDisabledError(\"module\")\n}\n\n// NewWriteDisabledError is a fetch error.\nfunc NewWriteDisabledError(scheme string) error {\n\treturn fmt.Errorf(\"writing assets to %s disabled\", scheme)\n}\n\n// NewWriteHTTPDisabledError is a fetch error.\nfunc NewWriteHTTPDisabledError() error {\n\treturn NewWriteDisabledError(\"http\")\n}\n\n// NewWriteLocalDisabledError is a fetch error.\nfunc NewWriteLocalDisabledError() error {\n\treturn NewWriteDisabledError(\"local\")\n}\n\n// NewWriteStdioDisabledError is a fetch error.\nfunc NewWriteStdioDisabledError() error {\n\treturn NewWriteDisabledError(\"stdout\")\n}\n\nfunc newValueEmptyError() error {\n\treturn errors.New(\"required\")\n}\n\nfunc newValueMultipleHashtagsError(value string) error {\n\treturn fmt.Errorf(\"%q has multiple #s which is invalid\", value)\n}\n\nfunc newValueStartsWithHashtagError(value string) error {\n\treturn fmt.Errorf(\"%q starts with # which is invalid\", value)\n}\n\nfunc newValueEndsWithHashtagError(value string) error {\n\treturn fmt.Errorf(\"%q ends with # which is invalid\", value)\n}\n\nfunc newOptionsInvalidError(s string) error {\n\treturn fmt.Errorf(\"invalid options: %q\", s)\n}\n\nfunc newOptionsDuplicateKeyError(key string) error {\n\treturn fmt.Errorf(\"duplicate options key: %q\", key)\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/git_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\nvar (\n\t_ ParsedGitRef = &gitRef{}\n\n\tgitSchemePrefixToGitScheme = map[string]GitScheme{\n\t\t\"http://\":  GitSchemeHTTP,\n\t\t\"https://\": GitSchemeHTTPS,\n\t\t\"file://\":  GitSchemeLocal,\n\t\t\"ssh://\":   GitSchemeSSH,\n\t\t\"git://\":   GitSchemeGit,\n\t}\n)\n\ntype gitRef struct {\n\tformat            string\n\tpath              string\n\tgitScheme         GitScheme\n\tgitName           git.Name\n\tdepth             uint32\n\trecurseSubmodules bool\n\tsubDirPath        string\n\tfilter            string\n}\n\nfunc newGitRef(\n\tformat string,\n\tpath string,\n\tgitName git.Name,\n\tdepth uint32,\n\trecurseSubmodules bool,\n\tsubDirPath string,\n\tfilter string,\n) (*gitRef, error) {\n\tgitScheme, path, err := getGitSchemeAndPath(format, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif depth == 0 {\n\t\treturn nil, NewDepthZeroError()\n\t}\n\tsubDirPath, err = normalpath.NormalizeAndValidate(subDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif subDirPath == \".\" {\n\t\tsubDirPath = \"\"\n\t}\n\treturn newDirectGitRef(\n\t\tformat,\n\t\tpath,\n\t\tgitScheme,\n\t\tgitName,\n\t\trecurseSubmodules,\n\t\tdepth,\n\t\tsubDirPath,\n\t\tfilter,\n\t), nil\n}\n\nfunc newDirectGitRef(\n\tformat string,\n\tpath string,\n\tgitScheme GitScheme,\n\tgitName git.Name,\n\trecurseSubmodules bool,\n\tdepth uint32,\n\tsubDirPath string,\n\tfilter string,\n) *gitRef {\n\treturn &gitRef{\n\t\tformat:            format,\n\t\tpath:              path,\n\t\tgitScheme:         gitScheme,\n\t\tgitName:           gitName,\n\t\tdepth:             depth,\n\t\trecurseSubmodules: recurseSubmodules,\n\t\tsubDirPath:        subDirPath,\n\t\tfilter:            filter,\n\t}\n}\n\nfunc (r *gitRef) Format() string {\n\treturn r.format\n}\n\nfunc (r *gitRef) Path() string {\n\treturn r.path\n}\n\nfunc (r *gitRef) GitScheme() GitScheme {\n\treturn r.gitScheme\n}\n\nfunc (r *gitRef) GitName() git.Name {\n\treturn r.gitName\n}\n\nfunc (r *gitRef) Depth() uint32 {\n\treturn r.depth\n}\n\nfunc (r *gitRef) RecurseSubmodules() bool {\n\treturn r.recurseSubmodules\n}\n\nfunc (r *gitRef) SubDirPath() string {\n\treturn r.subDirPath\n}\n\nfunc (r *gitRef) Filter() string {\n\treturn r.filter\n}\n\nfunc (*gitRef) ref()       {}\nfunc (*gitRef) bucketRef() {}\nfunc (*gitRef) gitRef()    {}\n\nfunc getGitSchemeAndPath(format string, path string) (GitScheme, string, error) {\n\tif path == \"\" {\n\t\treturn 0, \"\", NewNoPathError()\n\t}\n\tif app.IsDevStderr(path) {\n\t\treturn 0, \"\", NewInvalidPathError(format, path)\n\t}\n\tif path == \"-\" || app.IsDevNull(path) || app.IsDevStdin(path) || app.IsDevStdout(path) {\n\t\treturn 0, \"\", NewInvalidPathError(format, path)\n\t}\n\tfor prefix, gitScheme := range gitSchemePrefixToGitScheme {\n\t\tif after, ok := strings.CutPrefix(path, prefix); ok {\n\t\t\tpath := after\n\t\t\tif gitScheme == GitSchemeLocal {\n\t\t\t\tpath = normalpath.Normalize(path)\n\t\t\t}\n\t\t\tif path == \"\" {\n\t\t\t\treturn 0, \"\", NewNoPathError()\n\t\t\t}\n\t\t\treturn gitScheme, path, nil\n\t\t}\n\t}\n\tif strings.Contains(path, \"://\") {\n\t\treturn 0, \"\", NewInvalidPathError(format, path)\n\t}\n\treturn GitSchemeLocal, normalpath.Normalize(path), nil\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/internal.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\nconst (\n\t// FileSchemeHTTP is the http file scheme.\n\tFileSchemeHTTP FileScheme = iota + 1\n\t// FileSchemeHTTPS is the https file scheme.\n\tFileSchemeHTTPS\n\t// FileSchemeLocal is the local file scheme.\n\tFileSchemeLocal\n\t// FileSchemeStdio is the stdio file scheme.\n\t//\n\t// This can reference either stdin or stdout depending on if we are\n\t// reading or writing.\n\tFileSchemeStdio\n\t// FileSchemeStdin is the stdin file scheme.\n\tFileSchemeStdin\n\t// FileSchemeStdout is the stdout file scheme.\n\tFileSchemeStdout\n\t// FileSchemeNull is the null file scheme.\n\tFileSchemeNull\n\n\t// GitSchemeHTTP is the http git scheme.\n\tGitSchemeHTTP GitScheme = iota + 1\n\t// GitSchemeHTTPS is the https git scheme.\n\tGitSchemeHTTPS\n\t// GitSchemeLocal is the local git scheme.\n\tGitSchemeLocal\n\t// GitSchemeSSH is the ssh git scheme.\n\tGitSchemeSSH\n\t// GitSchemeGit is the git git scheme.\n\tGitSchemeGit\n\n\t// ArchiveTypeTar is a tar archive.\n\tArchiveTypeTar ArchiveType = iota + 1\n\t// ArchiveTypeZip is a zip archive.\n\tArchiveTypeZip\n\n\t// CompressionTypeNone is no compression.\n\tCompressionTypeNone CompressionType = iota + 1\n\t// CompressionTypeGzip is gzip compression.\n\tCompressionTypeGzip\n\t// CompressionTypeZstd is zstd compression.\n\tCompressionTypeZstd\n)\n\n// FileScheme is a file scheme.\ntype FileScheme int\n\n// GitScheme is a git scheme.\ntype GitScheme int\n\n// ArchiveType is a archive type.\ntype ArchiveType int\n\n// CompressionType is a compression type.\ntype CompressionType int\n\n// String implements fmt.Stringer\nfunc (c CompressionType) String() string {\n\tswitch c {\n\tcase CompressionTypeNone:\n\t\treturn \"none\"\n\tcase CompressionTypeGzip:\n\t\treturn \"gzip\"\n\tcase CompressionTypeZstd:\n\t\treturn \"zstd\"\n\tdefault:\n\t\treturn strconv.Itoa(int(c))\n\t}\n}\n\n// Ref is a reference.\ntype Ref interface {\n\tref()\n}\n\n// FileRef is a file reference.\ntype FileRef interface {\n\tRef\n\t// Path is the path to the reference.\n\t//\n\t// This will be the non-empty path minus the scheme for http and https files.\n\t// This will be the non-empty normalized file path for local files.\n\t// This will be empty for stdio and null files.\n\tPath() string\n\tFileScheme() FileScheme\n\tCompressionType() CompressionType\n\tfileRef()\n}\n\n// BucketRef is a bucket reference.\ntype BucketRef interface {\n\tRef\n\tbucketRef()\n}\n\n// SingleRef is a non-archive file reference.\ntype SingleRef interface {\n\tFileRef\n\tCustomOptionValue(key string) (string, bool)\n\tsingleRef()\n}\n\n// NewSingleRef returns a new SingleRef.\nfunc NewSingleRef(path string, compressionType CompressionType) (SingleRef, error) {\n\treturn newSingleRef(\"\", path, compressionType, nil)\n}\n\n// ArchiveRef is an archive reference.\n//\n// An ArchiveRef is a special type of reference that can be either a FileRef or a BucketRef.\n// Note that if ArchiveType is ArchiveTypeZip, CompressionType will always be CompressionTypeNone.\ntype ArchiveRef interface {\n\tFileRef\n\tBucketRef\n\tArchiveType() ArchiveType\n\t// Applied before subdir\n\tStripComponents() uint32\n\t// Will be empty instead of \".\" for root directory\n\tSubDirPath() string\n\tarchiveRef()\n}\n\n// NewArchiveRef returns a new ArchiveRef.\nfunc NewArchiveRef(\n\tpath string,\n\tarchiveType ArchiveType,\n\tcompressionType CompressionType,\n\tstripComponents uint32,\n\tsubDirPath string,\n) (ArchiveRef, error) {\n\treturn newArchiveRef(\"\", path, archiveType, compressionType, stripComponents, subDirPath)\n}\n\n// DirRef is a local directory reference.\ntype DirRef interface {\n\t// Path is the path to the reference.\n\t//\n\t// This will be the non-empty normalized directory path for directories.\n\tPath() string\n\tBucketRef\n\tdirRef()\n}\n\n// NewDirRef returns a new DirRef.\nfunc NewDirRef(path string) (DirRef, error) {\n\treturn newDirRef(\"\", path)\n}\n\n// ProtoFileRef is a file reference that incorporates a BucketRef.\ntype ProtoFileRef interface {\n\tBucketRef\n\t// Path is the normalized path to the file reference.\n\tPath() string\n\t// IncludePackageFiles says to include the files from the same package files\n\tIncludePackageFiles() bool\n\tFileScheme() FileScheme\n\tprotoFileRef()\n}\n\n// GitRef is a git reference.\ntype GitRef interface {\n\t// Path is the path to the reference.\n\t//\n\t// This will be the non-empty path minus the scheme for http, https, ssh, and git repositories.\n\t// This will be the non-empty normalized directory path for local git repositories.\n\tPath() string\n\tBucketRef\n\tGitScheme() GitScheme\n\t// Optional. May be nil, in which case clone the default branch.\n\tGitName() git.Name\n\t// Will always be >= 1\n\tDepth() uint32\n\tRecurseSubmodules() bool\n\t// Will be empty instead of \".\" for root directory\n\tSubDirPath() string\n\t// Filter spec to use, see the --filter option in git rev-list.\n\tFilter() string\n\tgitRef()\n}\n\n// NewGitRef returns a new GitRef.\nfunc NewGitRef(\n\tpath string,\n\tgitName git.Name,\n\tdepth uint32,\n\trecurseSubmodules bool,\n\tsubDirPath string,\n\tfilter string,\n) (GitRef, error) {\n\treturn newGitRef(\"\", path, gitName, depth, recurseSubmodules, subDirPath, filter)\n}\n\n// ModuleRef is a module reference.\ntype ModuleRef interface {\n\tRef\n\tModuleRef() bufparse.Ref\n\tmoduleRef()\n}\n\n// HasFormat is an object that has a format.\ntype HasFormat interface {\n\tFormat() string\n}\n\n// ParsedRef is a parsed Ref.\ntype ParsedRef interface {\n\tRef\n\tHasFormat\n}\n\n// ParsedFileRef is a parsed FileRef.\ntype ParsedFileRef interface {\n\tFileRef\n\tHasFormat\n}\n\n// ParsedBucketRef is a parsed BucketRef.\ntype ParsedBucketRef interface {\n\tBucketRef\n\tHasFormat\n}\n\n// ParsedSingleRef is a parsed SingleRef.\ntype ParsedSingleRef interface {\n\tSingleRef\n\tHasFormat\n}\n\n// NewDirectParsedSingleRef returns a new ParsedSingleRef with no validation checks.\n//\n// This should only be used for testing.\nfunc NewDirectParsedSingleRef(\n\tformat string,\n\tpath string,\n\tfileScheme FileScheme,\n\tcompressionType CompressionType,\n\tcustomOptions map[string]string,\n) ParsedSingleRef {\n\treturn newDirectSingleRef(\n\t\tformat,\n\t\tpath,\n\t\tfileScheme,\n\t\tcompressionType,\n\t\tcustomOptions,\n\t)\n}\n\n// ParsedArchiveRef is a parsed ArchiveRef.\ntype ParsedArchiveRef interface {\n\tArchiveRef\n\tHasFormat\n}\n\n// NewDirectParsedArchiveRef returns a new ParsedArchiveRef with no validation checks.\n//\n// This should only be used for testing.\nfunc NewDirectParsedArchiveRef(\n\tformat string,\n\tpath string,\n\tfileScheme FileScheme,\n\tarchiveType ArchiveType,\n\tcompressionType CompressionType,\n\tstripComponents uint32,\n\tsubDirPath string,\n) ParsedArchiveRef {\n\treturn newDirectArchiveRef(\n\t\tformat,\n\t\tpath,\n\t\tfileScheme,\n\t\tarchiveType,\n\t\tcompressionType,\n\t\tstripComponents,\n\t\tsubDirPath,\n\t)\n}\n\n// ParsedDirRef is a parsed DirRef.\ntype ParsedDirRef interface {\n\tDirRef\n\tHasFormat\n}\n\n// NewDirectParsedDirRef returns a new ParsedDirRef with no validation checks.\n//\n// This should only be used for testing.\nfunc NewDirectParsedDirRef(format string, path string) ParsedDirRef {\n\treturn newDirectDirRef(format, path)\n}\n\n// ParsedProtoFileRef is a parsed ProtoFileRef.\ntype ParsedProtoFileRef interface {\n\tProtoFileRef\n\tHasFormat\n}\n\n// NewDirectParsedProtoFileRef returns a new ParsedProtoFileRef with no validation checks.\n//\n// This should only be used for testing.\nfunc NewDirectParsedProtoFileRef(\n\tformat string,\n\tpath string,\n\tfileScheme FileScheme,\n\tincludePackageFiles bool,\n) ParsedProtoFileRef {\n\treturn newDirectProtoFileRef(format, path, fileScheme, includePackageFiles)\n}\n\n// ParsedGitRef is a parsed GitRef.\ntype ParsedGitRef interface {\n\tGitRef\n\tHasFormat\n}\n\n// NewDirectParsedGitRef returns a new ParsedGitRef with no validation checks.\n//\n// This should only be used for testing.\nfunc NewDirectParsedGitRef(\n\tformat string,\n\tpath string,\n\tgitScheme GitScheme,\n\tgitName git.Name,\n\trecurseSubmodules bool,\n\tdepth uint32,\n\tsubDirPath string,\n\tfilter string,\n) ParsedGitRef {\n\treturn newDirectGitRef(\n\t\tformat,\n\t\tpath,\n\t\tgitScheme,\n\t\tgitName,\n\t\trecurseSubmodules,\n\t\tdepth,\n\t\tsubDirPath,\n\t\tfilter,\n\t)\n}\n\n// ParsedModuleRef is a parsed ModuleRef.\ntype ParsedModuleRef interface {\n\tModuleRef\n\tHasFormat\n}\n\n// NewDirectParsedModuleRef returns a new ParsedModuleRef with no validation checks.\n//\n// This should only be used for testing.\nfunc NewDirectParsedModuleRef(\n\tformat string,\n\tmoduleRef bufparse.Ref,\n) ParsedModuleRef {\n\treturn newDirectModuleRef(\n\t\tformat,\n\t\tmoduleRef,\n\t)\n}\n\n// RefParser parses references.\ntype RefParser interface {\n\t// GetParsedRef gets the ParsedRef for the value.\n\t//\n\t// The returned ParsedRef will be either a ParsedSingleRef, ParsedArchiveRef, ParsedDirRef, ParsedGitRef, or ParsedModuleRef.\n\t//\n\t// The options should be used to validate that you are getting one of the correct formats.\n\tGetParsedRef(ctx context.Context, value string, options ...GetParsedRefOption) (ParsedRef, error)\n\t// GetParsedRefForInputConfig gets the ParsedRef for the input config.\n\t//\n\t// The returned ParsedRef will be either a ParsedSingleRef, ParsedArchiveRef, ParsedDirRef, ParsedGitRef, or ParsedModuleRef.\n\t//\n\t// The options should be used to validate that you are getting one of the correct formats.\n\tGetParsedRefForInputConfig(ctx context.Context, inputConfig bufconfig.InputConfig, options ...GetParsedRefOption) (ParsedRef, error)\n}\n\n// NewRefParser returns a new RefParser.\nfunc NewRefParser(logger *slog.Logger, options ...RefParserOption) RefParser {\n\treturn newRefParser(logger, options...)\n}\n\n// BucketExtender has extra methods we attach to buckets.\ntype BucketExtender interface {\n\t// SubDirPath is the subdir within the Bucket of the actual asset.\n\t//\n\t// This will be set if a terminate file was found. If so, the actual Bucket will be\n\t// the directory that contained this terminate file, and the subDirPath will be the sub-directory of\n\t// the actual asset relative to the terminate file.\n\tSubDirPath() string\n}\n\n// ReadBucketCloser is a bucket returned from GetReadBucketCloser.\ntype ReadBucketCloser interface {\n\tstorage.ReadBucketCloser\n\tBucketExtender\n}\n\n// ReadWriteBucket is a bucket returned from GetReadWriteBucket.\ntype ReadWriteBucket interface {\n\tstorage.ReadWriteBucket\n\tBucketExtender\n}\n\n// Reader is a reader.\ntype Reader interface {\n\t// GetFile gets the file.\n\t//\n\t// SingleRefs and ArchiveRefs will result in decompressed files unless KeepFileCompression is set.\n\tGetFile(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tfileRef FileRef,\n\t\toptions ...GetFileOption,\n\t) (io.ReadCloser, error)\n\t// GetReadBucketCloser gets the bucket.\n\tGetReadBucketCloser(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tbucketRef BucketRef,\n\t\toptions ...GetReadBucketCloserOption,\n\t) (ReadBucketCloser, buftarget.BucketTargeting, error)\n\t// GetReadWriteBucket gets the bucket.\n\tGetReadWriteBucket(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tdirRef DirRef,\n\t\toptions ...GetReadWriteBucketOption,\n\t) (ReadWriteBucket, buftarget.BucketTargeting, error)\n\t// GetModuleKey gets the ModuleKey.\n\tGetModuleKey(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdinContainer,\n\t\tmoduleRef ModuleRef,\n\t\toptions ...GetModuleOption,\n\t) (bufmodule.ModuleKey, error)\n}\n\n// NewReader returns a new Reader.\nfunc NewReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\toptions ...ReaderOption,\n) Reader {\n\treturn newReader(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\toptions...,\n\t)\n}\n\n// Writer is a writer.\ntype Writer interface {\n\t// PutFile puts the file.\n\tPutFile(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdoutContainer,\n\t\tfileRef FileRef,\n\t\toptions ...PutFileOption,\n\t) (io.WriteCloser, error)\n}\n\n// NewWriter returns a new Writer.\nfunc NewWriter(\n\tlogger *slog.Logger,\n\toptions ...WriterOption,\n) Writer {\n\treturn newWriter(\n\t\tlogger,\n\t\toptions...,\n\t)\n}\n\n// ProtoFileWriter is a writer of ProtoFiles.\ntype ProtoFileWriter interface {\n\t// PutProtoFile puts the proto file.\n\tPutProtoFile(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdoutContainer,\n\t\tprotoFileRef ProtoFileRef,\n\t) (io.WriteCloser, error)\n}\n\n// NewProtoFileWriter returns a new ProtoFileWriter.\nfunc NewProtoFileWriter(\n\tlogger *slog.Logger,\n) ProtoFileWriter {\n\treturn newProtoFileWriter(\n\t\tlogger,\n\t)\n}\n\n// RawRef is an unprocessed ref used for WithRefProcessor.\n//\n// A RawRefProcessor will allow modifications to a RawRef before continuing parsing.\n// This allows defaults to be inferred from the path.\n//\n// The Path will be the only value set when the RawRefProcessor is invoked, and is not normalized.\n// After the RawRefProcessor is called, options will be parsed.\ntype RawRef struct {\n\t// Will always be set.\n\t// Not normalized yet.\n\tPath string\n\t// Will always be set.\n\t// Set via RawRefProcessor if not explicitly set.\n\tFormat string\n\t// Only set for single, archive formats.\n\t// Cannot be set for zip archives.\n\tCompressionType CompressionType\n\t// Only set for archive, git formats.\n\tSubDirPath string\n\t// Only set for git formats.\n\t// Only one of GitBranch and GitCommitOrTag will be set.\n\tGitBranch string\n\t// Only set for git formats.\n\t// Only one of GitBranch and GitCommitOrTag will be set.\n\t// Should indicate a full commit hash or tag name.\n\t// This is defined as anything that can be given to \"git fetch\".\n\tGitCommitOrTag string\n\t// Only set for git formats\n\t// Specifies a git reference to use with \"git checkout\".\n\t// Can be used on its own or with GitBranch. Not allowed with GitCommitOrTag.\n\t// This is defined as anything that can be given to \"git checkout\".\n\t// Differs from GitCommitOrTag in that it can be a short hash, or even a\n\t// relative commit, such as \"HEAD^2\".\n\tGitRef string\n\t// Only set for git formats.\n\tGitRecurseSubmodules bool\n\t// Only set for git formats.\n\t// The depth to use when cloning a repository. Only allowed when GitRef\n\t// is set. Defaults to 50 if unset. It must be deep enough that the\n\t// requested GitRef will be included when cloning the requested branch\n\t// (or the repo's default branch if GitBranch is empty).\n\tGitDepth uint32\n\t// Only set for git formats.\n\t// The filter spec to use, see the --filter option in git rev-list.\n\tGitFilter string\n\t// Only set for archive formats.\n\tArchiveStripComponents uint32\n\t// Only set for proto file ref format.\n\t// Sets whether or not to include the files in the rest of the package\n\t// in the message for the ProtoFileRef.\n\t// This defaults to false.\n\tIncludePackageFiles bool\n\t// Any unrecognized options. Some formats may allow custom options, and those\n\t// formats should check for  those custom options in this map. If a format\n\t// does not allow an option, an error will be returned.\n\tUnrecognizedOptions map[string]string\n}\n\n// RefParserOption is an RefParser option.\ntype RefParserOption func(*refParser)\n\n// WithRawRefProcessor attaches the given RawRefProcessor.\n//\n// If format is not manually specified, the RefParser will use this format parser\n// with the raw path, that is not normalized.\nfunc WithRawRefProcessor(rawRefProcessor func(*RawRef) error) RefParserOption {\n\treturn func(refParser *refParser) {\n\t\trefParser.rawRefProcessor = rawRefProcessor\n\t}\n}\n\n// WithSingleFormat attaches the given format as a single format.\n//\n// It is up to the user to not incorrectly attached a format twice.\nfunc WithSingleFormat(format string, options ...SingleFormatOption) RefParserOption {\n\treturn func(refParser *refParser) {\n\t\tformat = normalizeFormat(format)\n\t\tif format == \"\" {\n\t\t\treturn\n\t\t}\n\t\tsingleFormatInfo := newSingleFormatInfo()\n\t\tfor _, option := range options {\n\t\t\toption(singleFormatInfo)\n\t\t}\n\t\trefParser.singleFormatToInfo[format] = singleFormatInfo\n\t}\n}\n\n// WithArchiveFormat attaches the given format as an archive format.\n//\n// It is up to the user to not incorrectly attached a format twice.\nfunc WithArchiveFormat(format string, archiveType ArchiveType, options ...ArchiveFormatOption) RefParserOption {\n\treturn func(refParser *refParser) {\n\t\tformat = normalizeFormat(format)\n\t\tif format == \"\" {\n\t\t\treturn\n\t\t}\n\t\tarchiveFormatInfo := newArchiveFormatInfo(archiveType)\n\t\tfor _, option := range options {\n\t\t\toption(archiveFormatInfo)\n\t\t}\n\t\trefParser.archiveFormatToInfo[format] = archiveFormatInfo\n\t}\n}\n\n// WithDirFormat attaches the given format as a dir format.\n//\n// It is up to the user to not incorrectly attached a format twice.\nfunc WithDirFormat(format string, options ...DirFormatOption) RefParserOption {\n\treturn func(refParser *refParser) {\n\t\tformat = normalizeFormat(format)\n\t\tif format == \"\" {\n\t\t\treturn\n\t\t}\n\t\tdirFormatInfo := newDirFormatInfo()\n\t\tfor _, option := range options {\n\t\t\toption(dirFormatInfo)\n\t\t}\n\t\trefParser.dirFormatToInfo[format] = dirFormatInfo\n\t}\n}\n\n// WithGitFormat attaches the given format as a git format.\n//\n// It is up to the user to not incorrectly attached a format twice.\nfunc WithGitFormat(format string, options ...GitFormatOption) RefParserOption {\n\treturn func(refParser *refParser) {\n\t\tformat = normalizeFormat(format)\n\t\tif format == \"\" {\n\t\t\treturn\n\t\t}\n\t\tgitFormatInfo := newGitFormatInfo()\n\t\tfor _, option := range options {\n\t\t\toption(gitFormatInfo)\n\t\t}\n\t\trefParser.gitFormatToInfo[format] = gitFormatInfo\n\t}\n}\n\n// WithModuleFormat attaches the given format as a module format.\n//\n// It is up to the user to not incorrectly attach a format twice.\nfunc WithModuleFormat(format string, options ...ModuleFormatOption) RefParserOption {\n\treturn func(refParser *refParser) {\n\t\tformat = normalizeFormat(format)\n\t\tif format == \"\" {\n\t\t\treturn\n\t\t}\n\t\tmoduleFormatInfo := newModuleFormatInfo()\n\t\tfor _, option := range options {\n\t\t\toption(moduleFormatInfo)\n\t\t}\n\t\trefParser.moduleFormatToInfo[format] = moduleFormatInfo\n\t}\n}\n\n// WithProtoFileFormat attaches the given format as a single file format.\n//\n// It is up to the user to not incorrectly attach a format twice.\nfunc WithProtoFileFormat(format string, options ...ProtoFileFormatOption) RefParserOption {\n\treturn func(refParser *refParser) {\n\t\tformat = normalizeFormat(format)\n\t\tif format == \"\" {\n\t\t\treturn\n\t\t}\n\t\tprotoFileFormatInfo := newProtoFileFormatInfo()\n\t\tfor _, option := range options {\n\t\t\toption(protoFileFormatInfo)\n\t\t}\n\t\trefParser.protoFileFormatToInfo[format] = protoFileFormatInfo\n\t}\n}\n\n// SingleFormatOption is a single format option.\ntype SingleFormatOption func(*singleFormatInfo)\n\n// WithSingleDefaultCompressionType sets the default compression type.\nfunc WithSingleDefaultCompressionType(defaultCompressionType CompressionType) SingleFormatOption {\n\treturn func(singleFormatInfo *singleFormatInfo) {\n\t\tsingleFormatInfo.defaultCompressionType = defaultCompressionType\n\t}\n}\n\n// WithSingleCustomOptionKey adds a custom option key that is recognized..\nfunc WithSingleCustomOptionKey(key string) SingleFormatOption {\n\treturn func(singleFormatInfo *singleFormatInfo) {\n\t\tsingleFormatInfo.customOptionKeys[key] = struct{}{}\n\t}\n}\n\n// ArchiveFormatOption is a archive format option.\ntype ArchiveFormatOption func(*archiveFormatInfo)\n\n// WithArchiveDefaultCompressionType sets the default compression type.\n//\n// Note this should never be set for zip.\nfunc WithArchiveDefaultCompressionType(defaultCompressionType CompressionType) ArchiveFormatOption {\n\treturn func(archiveFormatInfo *archiveFormatInfo) {\n\t\tarchiveFormatInfo.defaultCompressionType = defaultCompressionType\n\t}\n}\n\n// DirFormatOption is a dir format option.\ntype DirFormatOption func(*dirFormatInfo)\n\n// GitFormatOption is a git format option.\ntype GitFormatOption func(*gitFormatInfo)\n\n// ModuleFormatOption is a module format option.\ntype ModuleFormatOption func(*moduleFormatInfo)\n\n// ReaderOption is a Reader option.\ntype ReaderOption func(*reader)\n\n// ProtoFileFormatOption is a single file format option.\ntype ProtoFileFormatOption func(*protoFileFormatInfo)\n\n// WithReaderHTTP enables HTTP.\nfunc WithReaderHTTP(httpClient *http.Client, httpAuthenticator httpauth.Authenticator) ReaderOption {\n\treturn func(reader *reader) {\n\t\treader.httpEnabled = true\n\t\treader.httpClient = httpClient\n\t\treader.httpAuthenticator = httpAuthenticator\n\t}\n}\n\n// WithReaderGit enables Git.\nfunc WithReaderGit(gitCloner git.Cloner) ReaderOption {\n\treturn func(reader *reader) {\n\t\treader.gitEnabled = true\n\t\treader.gitCloner = gitCloner\n\t}\n}\n\n// WithReaderModule enables modules.\nfunc WithReaderModule(\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n) ReaderOption {\n\treturn func(reader *reader) {\n\t\treader.moduleEnabled = true\n\t\treader.moduleKeyProvider = moduleKeyProvider\n\t}\n}\n\n// WithReaderLocal enables local.\nfunc WithReaderLocal() ReaderOption {\n\treturn func(reader *reader) {\n\t\treader.localEnabled = true\n\t}\n}\n\n// WithReaderStdio enables stdio.\nfunc WithReaderStdio() ReaderOption {\n\treturn func(reader *reader) {\n\t\treader.stdioEnabled = true\n\t}\n}\n\n// WriterOption is an Writer option.\ntype WriterOption func(*writer)\n\n// WithWriterLocal enables local.\nfunc WithWriterLocal() WriterOption {\n\treturn func(writer *writer) {\n\t\twriter.localEnabled = true\n\t}\n}\n\n// WithWriterStdio enables stdio.\nfunc WithWriterStdio() WriterOption {\n\treturn func(writer *writer) {\n\t\twriter.stdioEnabled = true\n\t}\n}\n\n// GetParsedRefOption is a GetParsedRef option.\ntype GetParsedRefOption func(*getParsedRefOptions)\n\n// WithAllowedFormats limits the allowed formats to the given formats.\nfunc WithAllowedFormats(formats ...string) GetParsedRefOption {\n\treturn func(getParsedRefOptions *getParsedRefOptions) {\n\t\tfor _, format := range formats {\n\t\t\tgetParsedRefOptions.allowedFormats[normalizeFormat(format)] = struct{}{}\n\t\t}\n\t}\n}\n\n// GetFileOption is a GetFile option.\ntype GetFileOption func(*getFileOptions)\n\n// WithGetFileKeepFileCompression says to return compressed.\nfunc WithGetFileKeepFileCompression() GetFileOption {\n\treturn func(getFileOptions *getFileOptions) {\n\t\tgetFileOptions.keepFileCompression = true\n\t}\n}\n\n// GetReadBucketCloserOption is a GetReadBucketCloser option.\ntype GetReadBucketCloserOption func(*getReadBucketCloserOptions)\n\n// WithGetReadBucketCloserCopyToInMemory says to copy the returned ReadBucketCloser to an\n// in-memory ReadBucket. This can be a performance optimization at the expense of memory.\nfunc WithGetReadBucketCloserCopyToInMemory() GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.copyToInMemory = true\n\t}\n}\n\n// WithGetReadBucketCloserTerminateFunc says to check the bucket at the given prefix, and\n// potentially terminate the search for the workspace file. This will result in the\n// given prefix being the workspace directory, and a SubDirPath being computed appropriately.\n//\n// See bufconfig.TerminateAtControllingWorkspace, which is the only thing that uses this.\n// This is used by both non-ProtoFileRefs to find the controlling workspace, AND ProtoFileRefs\n// to find the controlling workspace of an enclosing module or workspace.\nfunc WithGetReadBucketCloserTerminateFunc(terminateFunc buftarget.TerminateFunc) GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.terminateFunc = terminateFunc\n\t}\n}\n\n// WithGetReadBucketCloserTargetPaths sets the target paths for the bucket targeting information.\nfunc WithGetReadBucketCloserTargetPaths(targetPaths []string) GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.targetPaths = targetPaths\n\t}\n}\n\n// WithGetReadBucketCloserTargetExcludePaths sets the target exclude paths for the bucket targeting information.\nfunc WithGetReadBucketCloserTargetExcludePaths(targetExcludePaths []string) GetReadBucketCloserOption {\n\treturn func(getReadBucketCloserOptions *getReadBucketCloserOptions) {\n\t\tgetReadBucketCloserOptions.targetExcludePaths = targetExcludePaths\n\t}\n}\n\n// GetReadWriteBucketOption is a GetReadWriteBucket option.\ntype GetReadWriteBucketOption func(*getReadWriteBucketOptions)\n\n// WithGetReadWriteBucketTerminateFunc says to check the bucket at the given prefix, and\n// potentially terminate the search for the workspace file. This will result in the\n// given prefix being the workspace directory, and a SubDirPath being computed appropriately.\n//\n// See bufconfig.TerminateAtControllingWorkspace, which is the only thing that uses this.\n// This is used by both non-ProtoFileRefs to find the controlling workspace, AND ProtoFileRefs\n// to find the controlling workspace of an enclosing module or workspace.\nfunc WithGetReadWriteBucketTerminateFunc(terminateFunc buftarget.TerminateFunc) GetReadWriteBucketOption {\n\treturn func(getReadWriteBucketOptions *getReadWriteBucketOptions) {\n\t\tgetReadWriteBucketOptions.terminateFunc = terminateFunc\n\t}\n}\n\n// WithGetReadWriteBucketTargetPaths sets the target paths for the bucket targeting information.\nfunc WithGetReadWriteBucketTargetPaths(targetPaths []string) GetReadWriteBucketOption {\n\treturn func(getReadWriteBucketOptions *getReadWriteBucketOptions) {\n\t\tgetReadWriteBucketOptions.targetPaths = targetPaths\n\t}\n}\n\n// WithGetReadWriteBucketTargetExcludePaths sets the target exclude paths.\nfunc WithGetReadWriteBucketTargetExcludePaths(targetExcludePaths []string) GetReadWriteBucketOption {\n\treturn func(getReadWriteBucketOptions *getReadWriteBucketOptions) {\n\t\tgetReadWriteBucketOptions.targetExcludePaths = targetExcludePaths\n\t}\n}\n\n// PutFileOption is a PutFile option.\ntype PutFileOption func(*putFileOptions)\n\n// WithPutFileNoFileCompression says to put s uncompressed.\nfunc WithPutFileNoFileCompression() PutFileOption {\n\treturn func(putFileOptions *putFileOptions) {\n\t\tputFileOptions.noFileCompression = true\n\t}\n}\n\n// GetModuleOption is a GetModule option.\ntype GetModuleOption func(*getModuleOptions)\n\n// GetInputConfigForRef returns the input config for the ref. A string is also\n// passed because if the ref is a git ref, it would only have a git.Name, instead\n// of a git branch, a git ref and a git tag. Therefore the original string is passed.\nfunc GetInputConfigForRef(ref Ref, value string) (bufconfig.InputConfig, error) {\n\t_, options, err := getRawPathAndOptions(value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := ref.(type) {\n\tcase ArchiveRef:\n\t\tswitch t.ArchiveType() {\n\t\tcase ArchiveTypeZip:\n\t\t\treturn bufconfig.NewZipArchiveInputConfig(\n\t\t\t\tt.Path(),\n\t\t\t\tt.SubDirPath(),\n\t\t\t\tt.StripComponents(),\n\t\t\t)\n\t\tcase ArchiveTypeTar:\n\t\t\treturn bufconfig.NewTarballInputConfig(\n\t\t\t\tt.Path(),\n\t\t\t\tt.SubDirPath(),\n\t\t\t\tt.CompressionType().String(),\n\t\t\t\tt.StripComponents(),\n\t\t\t)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"invalid archive type: %v\", t.ArchiveType())\n\t\t}\n\tcase DirRef:\n\t\treturn bufconfig.NewDirectoryInputConfig(\n\t\t\tt.Path(),\n\t\t)\n\tcase ModuleRef:\n\t\treturn bufconfig.NewModuleInputConfig(\n\t\t\tt.ModuleRef().String(),\n\t\t)\n\tcase ProtoFileRef:\n\t\treturn bufconfig.NewProtoFileInputConfig(\n\t\t\tt.Path(),\n\t\t\tt.IncludePackageFiles(),\n\t\t)\n\tcase GitRef:\n\t\treturn bufconfig.NewGitRepoInputConfig(\n\t\t\tt.Path(),\n\t\t\tt.SubDirPath(),\n\t\t\toptions[\"branch\"],\n\t\t\toptions[\"tag\"],\n\t\t\toptions[\"ref\"],\n\t\t\ttoPointer(t.Depth()),\n\t\t\tt.RecurseSubmodules(),\n\t\t)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unexpected Ref of type %T\", ref)\n\t}\n}\n\nfunc toPointer[T any](value T) *T {\n\treturn &value\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/module_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n)\n\nvar (\n\t_ ParsedModuleRef = &moduleRef{}\n)\n\ntype moduleRef struct {\n\tformat     string\n\tiModuleRef bufparse.Ref\n}\n\nfunc newModuleRef(\n\tformat string,\n\tpath string,\n) (*moduleRef, error) {\n\tif path == \"\" {\n\t\treturn nil, NewNoPathError()\n\t}\n\tif app.IsDevStderr(path) {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tif path == \"-\" || app.IsDevNull(path) || app.IsDevStdin(path) || app.IsDevStdout(path) {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tif strings.Contains(path, \"://\") {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tmoduleRef, err := bufparse.ParseRef(path)\n\tif err != nil {\n\t\t// TODO: this is dumb\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\treturn newDirectModuleRef(format, moduleRef), nil\n}\n\nfunc newDirectModuleRef(format string, iModuleRef bufparse.Ref) *moduleRef {\n\treturn &moduleRef{\n\t\tformat:     format,\n\t\tiModuleRef: iModuleRef,\n\t}\n}\n\nfunc (r *moduleRef) Format() string {\n\treturn r.format\n}\n\nfunc (r *moduleRef) ModuleRef() bufparse.Ref {\n\treturn r.iModuleRef\n}\n\nfunc (*moduleRef) ref()       {}\nfunc (*moduleRef) bucketRef() {}\nfunc (*moduleRef) moduleRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/internal/proto_file_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport \"buf.build/go/app\"\n\nvar (\n\t_ ParsedProtoFileRef = &protoFileRef{}\n)\n\ntype protoFileRef struct {\n\tformat              string\n\tpath                string\n\tfileScheme          FileScheme\n\tincludePackageFiles bool\n}\n\nfunc newProtoFileRef(format string, path string, includePackageFiles bool) (*protoFileRef, error) {\n\tif app.IsDevStderr(path) {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tif path == \"-\" {\n\t\treturn newDirectProtoFileRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeStdio,\n\t\t\tincludePackageFiles,\n\t\t), nil\n\t}\n\tif app.IsDevStdin(path) {\n\t\treturn newDirectProtoFileRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeStdin,\n\t\t\tincludePackageFiles,\n\t\t), nil\n\t}\n\tif app.IsDevStdout(path) {\n\t\treturn newDirectProtoFileRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeStdout,\n\t\t\tincludePackageFiles,\n\t\t), nil\n\t}\n\tif app.IsDevNull(path) {\n\t\treturn newDirectProtoFileRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeNull,\n\t\t\tincludePackageFiles,\n\t\t), nil\n\t}\n\treturn &protoFileRef{\n\t\tformat:              format,\n\t\tpath:                path,\n\t\tfileScheme:          FileSchemeLocal,\n\t\tincludePackageFiles: includePackageFiles,\n\t}, nil\n}\n\nfunc newDirectProtoFileRef(format string, path string, fileScheme FileScheme, includePackageFiles bool) *protoFileRef {\n\treturn &protoFileRef{\n\t\tformat:              format,\n\t\tpath:                path,\n\t\tfileScheme:          fileScheme,\n\t\tincludePackageFiles: includePackageFiles,\n\t}\n}\n\nfunc (s *protoFileRef) Format() string {\n\treturn s.format\n}\n\nfunc (s *protoFileRef) Path() string {\n\treturn s.path\n}\n\nfunc (s *protoFileRef) FileScheme() FileScheme {\n\treturn s.fileScheme\n}\n\nfunc (s *protoFileRef) IncludePackageFiles() bool {\n\treturn s.includePackageFiles\n}\n\nfunc (*protoFileRef) ref()          {}\nfunc (*protoFileRef) bucketRef()    {}\nfunc (*protoFileRef) protoFileRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/internal/proto_file_writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"os\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xio\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\ntype protoFileWriter struct {\n\tlogger *slog.Logger\n}\n\nfunc newProtoFileWriter(\n\tlogger *slog.Logger,\n) *protoFileWriter {\n\treturn &protoFileWriter{\n\t\tlogger: logger,\n\t}\n}\n\nfunc (w *protoFileWriter) PutProtoFile(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tprotoFileRef ProtoFileRef,\n) (io.WriteCloser, error) {\n\tswitch fileScheme := protoFileRef.FileScheme(); fileScheme {\n\tcase FileSchemeHTTP:\n\t\treturn nil, fmt.Errorf(\"http not supported for writes: %v\", protoFileRef.Path())\n\tcase FileSchemeHTTPS:\n\t\treturn nil, fmt.Errorf(\"https not supported for writes: %v\", protoFileRef.Path())\n\tcase FileSchemeLocal:\n\t\tfilePath := protoFileRef.Path()\n\t\tif filePath == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"empty path for ProtoFileRef: %v\", protoFileRef)\n\t\t}\n\t\tif dirPath := normalpath.Dir(filePath); dirPath != \".\" {\n\t\t\tif err := createDirIfNotExists(normalpath.Unnormalize(dirPath)); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\t// This was in the old formatter, just keeping as-is for now instead of using os.Create.\n\t\treturn os.OpenFile(filePath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)\n\tcase FileSchemeStdio, FileSchemeStdout:\n\t\treturn xio.NopWriteCloser(container.Stdout()), nil\n\tcase FileSchemeStdin:\n\t\treturn nil, errors.New(\"cannot write to stdin\")\n\tcase FileSchemeNull:\n\t\treturn xio.DiscardWriteCloser, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown FileScheme: %v\", fileScheme)\n\t}\n}\n\nfunc createDirIfNotExists(dirPath string) error {\n\t// OK to use os.Stat instead of os.LStat here as this is CLI-only\n\tif _, err := os.Stat(dirPath); err != nil {\n\t\t// We don't need to check fileInfo.IsDir() because it's\n\t\t// already handled by the storageosProvider.\n\t\tif os.IsNotExist(err) {\n\t\t\tif err := os.MkdirAll(dirPath, 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// We could os.RemoveAll if the overall command exits without error, but we're\n\t\t\t// not going to, just to be safe.\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/read_bucket_closer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n)\n\nvar _ ReadBucketCloser = &readBucketCloser{}\n\ntype readBucketCloser struct {\n\tstorage.ReadBucketCloser\n\n\tsubDirPath string\n}\n\nfunc newReadBucketCloser(\n\tstorageReadBucketCloser storage.ReadBucketCloser,\n\tbucketTargeting buftarget.BucketTargeting,\n) *readBucketCloser {\n\tnormalizedSubDirPath := normalpath.Normalize(bucketTargeting.SubDirPath())\n\treturn &readBucketCloser{\n\t\tReadBucketCloser: storageReadBucketCloser,\n\t\tsubDirPath:       normalizedSubDirPath,\n\t}\n}\n\nfunc newReadBucketCloserForReadWriteBucket(\n\treadWriteBucket ReadWriteBucket,\n) *readBucketCloser {\n\treturn &readBucketCloser{\n\t\tReadBucketCloser: storage.NopReadBucketCloser(readWriteBucket),\n\t\tsubDirPath:       readWriteBucket.SubDirPath(),\n\t}\n}\n\nfunc (r *readBucketCloser) SubDirPath() string {\n\treturn r.subDirPath\n}\n\nfunc (r *readBucketCloser) copyToInMemory(ctx context.Context) (*readBucketCloser, error) {\n\tstorageReadBucket, err := storagemem.CopyReadBucket(ctx, r.ReadBucketCloser)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &readBucketCloser{\n\t\tReadBucketCloser: compositeStorageReadBucketCloser{\n\t\t\tReadBucket: storageReadBucket,\n\t\t\tcloseFunc:  r.ReadBucketCloser.Close,\n\t\t},\n\t\tsubDirPath: r.subDirPath,\n\t}, nil\n}\n\ntype compositeStorageReadBucketCloser struct {\n\tstorage.ReadBucket\n\tcloseFunc func() error\n}\n\nfunc (c compositeStorageReadBucketCloser) Close() error {\n\tif c.closeFunc != nil {\n\t\treturn c.closeFunc()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/read_write_bucket.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\nvar _ ReadWriteBucket = &readWriteBucket{}\n\ntype readWriteBucket struct {\n\tstorage.ReadWriteBucket\n\n\tsubDirPath string\n}\n\nfunc newReadWriteBucket(\n\tstorageReadWriteBucket storage.ReadWriteBucket,\n\tbucketPath string,\n\tbucketTargeting buftarget.BucketTargeting,\n) *readWriteBucket {\n\tnormalizedSubDirPath := normalpath.Normalize(bucketTargeting.SubDirPath())\n\treturn &readWriteBucket{\n\t\tReadWriteBucket: storageReadWriteBucket,\n\t\tsubDirPath:      normalizedSubDirPath,\n\t}\n}\n\nfunc (r *readWriteBucket) SubDirPath() string {\n\treturn r.subDirPath\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/reader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xio\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/osext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/klauspost/compress/zstd\"\n\t\"github.com/klauspost/pgzip\"\n)\n\ntype reader struct {\n\tlogger            *slog.Logger\n\tstorageosProvider storageos.Provider\n\n\tlocalEnabled bool\n\tstdioEnabled bool\n\n\thttpEnabled       bool\n\thttpClient        *http.Client\n\thttpAuthenticator httpauth.Authenticator\n\n\tgitEnabled bool\n\tgitCloner  git.Cloner\n\n\tmoduleEnabled     bool\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider\n}\n\nfunc newReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\toptions ...ReaderOption,\n) *reader {\n\treader := &reader{\n\t\tlogger:            logger,\n\t\tstorageosProvider: storageosProvider,\n\t}\n\tfor _, option := range options {\n\t\toption(reader)\n\t}\n\treturn reader\n}\n\nfunc (r *reader) GetFile(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tfileRef FileRef,\n\toptions ...GetFileOption,\n) (io.ReadCloser, error) {\n\tgetFileOptions := newGetFileOptions()\n\tfor _, option := range options {\n\t\toption(getFileOptions)\n\t}\n\tswitch t := fileRef.(type) {\n\tcase SingleRef:\n\t\treturn r.getSingle(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tgetFileOptions.keepFileCompression,\n\t\t)\n\tcase ArchiveRef:\n\t\treturn r.getArchiveFile(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tgetFileOptions.keepFileCompression,\n\t\t)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown FileRef type: %T\", fileRef)\n\t}\n}\n\nfunc (r *reader) GetReadBucketCloser(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tbucketRef BucketRef,\n\toptions ...GetReadBucketCloserOption,\n) (retReadBucketCloser ReadBucketCloser, _ buftarget.BucketTargeting, retErr error) {\n\tgetReadBucketCloserOptions := newGetReadBucketCloserOptions()\n\tfor _, option := range options {\n\t\toption(getReadBucketCloserOptions)\n\t}\n\tif getReadBucketCloserOptions.copyToInMemory {\n\t\tdefer func() {\n\t\t\tif retReadBucketCloser != nil {\n\t\t\t\tcastReadBucketCloser, ok := retReadBucketCloser.(*readBucketCloser)\n\t\t\t\tif !ok {\n\t\t\t\t\tretErr = errors.Join(\n\t\t\t\t\t\tretErr,\n\t\t\t\t\t\tsyserror.Newf(\"expected *readBucketCloser but got %T\", retReadBucketCloser),\n\t\t\t\t\t)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tvar err error\n\t\t\t\tretReadBucketCloser, err = castReadBucketCloser.copyToInMemory(ctx)\n\t\t\t\tretErr = errors.Join(retErr, err)\n\t\t\t}\n\t\t}()\n\t}\n\tswitch t := bucketRef.(type) {\n\tcase ArchiveRef:\n\t\treturn r.getArchiveBucket(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tgetReadBucketCloserOptions.targetPaths,\n\t\t\tgetReadBucketCloserOptions.targetExcludePaths,\n\t\t\tgetReadBucketCloserOptions.terminateFunc,\n\t\t)\n\tcase DirRef:\n\t\treadWriteBucket, bucketTargeting, err := r.getDirBucket(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tgetReadBucketCloserOptions.targetPaths,\n\t\t\tgetReadBucketCloserOptions.targetExcludePaths,\n\t\t\tgetReadBucketCloserOptions.terminateFunc,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn newReadBucketCloserForReadWriteBucket(readWriteBucket), bucketTargeting, nil\n\tcase GitRef:\n\t\treturn r.getGitBucket(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tgetReadBucketCloserOptions.targetPaths,\n\t\t\tgetReadBucketCloserOptions.targetExcludePaths,\n\t\t\tgetReadBucketCloserOptions.terminateFunc,\n\t\t)\n\tcase ProtoFileRef:\n\t\treturn r.getProtoFileBucket(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tgetReadBucketCloserOptions.terminateFunc,\n\t\t)\n\tdefault:\n\t\treturn nil, nil, fmt.Errorf(\"unknown BucketRef type: %T\", bucketRef)\n\t}\n}\n\nfunc (r *reader) GetReadWriteBucket(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tdirRef DirRef,\n\toptions ...GetReadWriteBucketOption,\n) (ReadWriteBucket, buftarget.BucketTargeting, error) {\n\tgetReadWriteBucketOptions := newGetReadWriteBucketOptions()\n\tfor _, option := range options {\n\t\toption(getReadWriteBucketOptions)\n\t}\n\treturn r.getDirBucket(\n\t\tctx,\n\t\tcontainer,\n\t\tdirRef,\n\t\tgetReadWriteBucketOptions.targetPaths,\n\t\tgetReadWriteBucketOptions.targetExcludePaths,\n\t\tgetReadWriteBucketOptions.terminateFunc,\n\t)\n}\n\nfunc (r *reader) GetModuleKey(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tmoduleRef ModuleRef,\n\t_ ...GetModuleOption,\n) (bufmodule.ModuleKey, error) {\n\tswitch t := moduleRef.(type) {\n\tcase ModuleRef:\n\t\treturn r.getModuleKey(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown ModuleRef type: %T\", moduleRef)\n\t}\n}\n\nfunc (r *reader) getSingle(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tsingleRef SingleRef,\n\tkeepFileCompression bool,\n) (io.ReadCloser, error) {\n\treadCloser, _, err := r.getFileReadCloserAndSize(ctx, container, singleRef, keepFileCompression)\n\treturn readCloser, err\n}\n\nfunc (r *reader) getArchiveFile(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tarchiveRef ArchiveRef,\n\tkeepFileCompression bool,\n) (io.ReadCloser, error) {\n\treadCloser, _, err := r.getFileReadCloserAndSize(ctx, container, archiveRef, keepFileCompression)\n\treturn readCloser, err\n}\n\nfunc (r *reader) getArchiveBucket(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tarchiveRef ArchiveRef,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tterminateFunc buftarget.TerminateFunc,\n) (ReadBucketCloser, buftarget.BucketTargeting, error) {\n\treadCloser, size, err := r.getFileReadCloserAndSize(ctx, container, archiveRef, false)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\tswitch archiveType := archiveRef.ArchiveType(); archiveType {\n\tcase ArchiveTypeTar:\n\t\tif err := storagearchive.Untar(\n\t\t\tctx,\n\t\t\treadCloser,\n\t\t\treadWriteBucket,\n\t\t\tstoragearchive.UntarWithStripComponentCount(\n\t\t\t\tarchiveRef.StripComponents(),\n\t\t\t),\n\t\t); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\tcase ArchiveTypeZip:\n\t\tvar readerAt io.ReaderAt\n\t\tif size < 0 {\n\t\t\tdata, err := io.ReadAll(readCloser)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\treaderAt = bytes.NewReader(data)\n\t\t\tsize = int64(len(data))\n\t\t} else {\n\t\t\treaderAt, err = xio.ReaderAtForReader(readCloser)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t\tif err := storagearchive.Unzip(\n\t\t\tctx,\n\t\t\treaderAt,\n\t\t\tsize,\n\t\t\treadWriteBucket,\n\t\t\tstoragearchive.UnzipWithStripComponentCount(\n\t\t\t\tarchiveRef.StripComponents(),\n\t\t\t),\n\t\t); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\tdefault:\n\t\treturn nil, nil, fmt.Errorf(\"unknown ArchiveType: %v\", archiveType)\n\t}\n\treturn getReadBucketCloserForBucket(\n\t\tctx,\n\t\tr.logger,\n\t\tstorage.NopReadBucketCloser(readWriteBucket),\n\t\tarchiveRef.SubDirPath(),\n\t\ttargetPaths,\n\t\ttargetExcludePaths,\n\t\tterminateFunc,\n\t)\n}\n\nfunc (r *reader) getDirBucket(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tdirRef DirRef,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tterminateFunc buftarget.TerminateFunc,\n) (ReadWriteBucket, buftarget.BucketTargeting, error) {\n\tif !r.localEnabled {\n\t\treturn nil, nil, NewReadLocalDisabledError()\n\t}\n\treturn getReadWriteBucketForOS(\n\t\tctx,\n\t\tr.logger,\n\t\tr.storageosProvider,\n\t\tdirRef.Path(),\n\t\ttargetPaths,\n\t\ttargetExcludePaths,\n\t\tterminateFunc,\n\t)\n}\n\nfunc (r *reader) getProtoFileBucket(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tprotoFileRef ProtoFileRef,\n\tterminateFunc buftarget.TerminateFunc,\n) (ReadBucketCloser, buftarget.BucketTargeting, error) {\n\tif !r.localEnabled {\n\t\treturn nil, nil, NewReadLocalDisabledError()\n\t}\n\treturn getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tr.logger,\n\t\tr.storageosProvider,\n\t\tprotoFileRef.Path(),\n\t\tterminateFunc,\n\t)\n}\n\nfunc (r *reader) getGitBucket(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tgitRef GitRef,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tterminateFunc buftarget.TerminateFunc,\n) (ReadBucketCloser, buftarget.BucketTargeting, error) {\n\tif !r.gitEnabled {\n\t\treturn nil, nil, NewReadGitDisabledError()\n\t}\n\tif r.gitCloner == nil {\n\t\treturn nil, nil, errors.New(\"git cloner is nil\")\n\t}\n\tgitURL, err := getGitURL(gitRef)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\tif err := r.gitCloner.CloneToBucket(\n\t\tctx,\n\t\tcontainer,\n\t\tgitURL,\n\t\tgitRef.Depth(),\n\t\treadWriteBucket,\n\t\tgit.CloneToBucketOptions{\n\t\t\tName:              gitRef.GitName(),\n\t\t\tRecurseSubmodules: gitRef.RecurseSubmodules(),\n\t\t\tSubDir:            gitRef.SubDirPath(),\n\t\t\tFilter:            gitRef.Filter(),\n\t\t},\n\t); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"could not clone %s: %v\", gitURL, err)\n\t}\n\treturn getReadBucketCloserForBucket(\n\t\tctx,\n\t\tr.logger,\n\t\tstorage.NopReadBucketCloser(readWriteBucket),\n\t\tgitRef.SubDirPath(),\n\t\ttargetPaths,\n\t\ttargetExcludePaths,\n\t\tterminateFunc,\n\t)\n}\n\nfunc (r *reader) getModuleKey(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tmoduleRef ModuleRef,\n) (bufmodule.ModuleKey, error) {\n\tif !r.moduleEnabled {\n\t\treturn nil, NewReadModuleDisabledError()\n\t}\n\tif r.moduleKeyProvider == nil {\n\t\treturn nil, errors.New(\"module key provider is nil\")\n\t}\n\tmoduleKeys, err := r.moduleKeyProvider.GetModuleKeysForModuleRefs(\n\t\tctx,\n\t\t[]bufparse.Ref{moduleRef.ModuleRef()},\n\t\tbufmodule.DigestTypeB5,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(moduleKeys) != 1 {\n\t\treturn nil, fmt.Errorf(\"expected 1 ModuleKey, got %d\", len(moduleKeys))\n\t}\n\treturn moduleKeys[0], nil\n}\n\nfunc (r *reader) getFileReadCloserAndSize(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tfileRef FileRef,\n\tkeepFileCompression bool,\n) (_ io.ReadCloser, _ int64, retErr error) {\n\treadCloser, size, err := r.getFileReadCloserAndSizePotentiallyCompressed(ctx, container, fileRef)\n\tif err != nil {\n\t\treturn nil, -1, err\n\t}\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = errors.Join(retErr, readCloser.Close())\n\t\t}\n\t}()\n\tif keepFileCompression {\n\t\treturn readCloser, size, nil\n\t}\n\tswitch compressionType := fileRef.CompressionType(); compressionType {\n\tcase CompressionTypeNone:\n\t\treturn readCloser, size, nil\n\tcase CompressionTypeGzip:\n\t\tgzipReadCloser, err := pgzip.NewReader(readCloser)\n\t\tif err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t\treturn xio.CompositeReadCloser(\n\t\t\tgzipReadCloser,\n\t\t\txio.ChainCloser(\n\t\t\t\tgzipReadCloser,\n\t\t\t\treadCloser,\n\t\t\t),\n\t\t), -1, nil\n\tcase CompressionTypeZstd:\n\t\tzstdDecoder, err := zstd.NewReader(readCloser)\n\t\tif err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t\tzstdReadCloser := zstdDecoder.IOReadCloser()\n\t\treturn xio.CompositeReadCloser(\n\t\t\tzstdReadCloser,\n\t\t\txio.ChainCloser(\n\t\t\t\tzstdReadCloser,\n\t\t\t\treadCloser,\n\t\t\t),\n\t\t), -1, nil\n\tdefault:\n\t\treturn nil, -1, fmt.Errorf(\"unknown CompressionType: %v\", compressionType)\n\t}\n}\n\n// returns -1 if size unknown\nfunc (r *reader) getFileReadCloserAndSizePotentiallyCompressed(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tfileRef FileRef,\n) (io.ReadCloser, int64, error) {\n\tswitch fileScheme := fileRef.FileScheme(); fileScheme {\n\tcase FileSchemeHTTP:\n\t\tif !r.httpEnabled {\n\t\t\treturn nil, -1, NewReadHTTPDisabledError()\n\t\t}\n\t\treturn r.getFileReadCloserAndSizePotentiallyCompressedHTTP(ctx, container, \"http://\"+fileRef.Path())\n\tcase FileSchemeHTTPS:\n\t\tif !r.httpEnabled {\n\t\t\treturn nil, -1, NewReadHTTPDisabledError()\n\t\t}\n\t\treturn r.getFileReadCloserAndSizePotentiallyCompressedHTTP(ctx, container, \"https://\"+fileRef.Path())\n\tcase FileSchemeLocal:\n\t\tif !r.localEnabled {\n\t\t\treturn nil, -1, NewReadLocalDisabledError()\n\t\t}\n\t\tfile, err := os.Open(fileRef.Path())\n\t\tif err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t\tfileInfo, err := file.Stat()\n\t\tif err != nil {\n\t\t\treturn nil, -1, err\n\t\t}\n\t\treturn file, fileInfo.Size(), nil\n\tcase FileSchemeStdio, FileSchemeStdin:\n\t\tif !r.stdioEnabled {\n\t\t\treturn nil, -1, NewReadStdioDisabledError()\n\t\t}\n\t\treturn io.NopCloser(container.Stdin()), -1, nil\n\tcase FileSchemeStdout:\n\t\treturn nil, -1, errors.New(\"cannot read from stdout\")\n\tcase FileSchemeNull:\n\t\treturn xio.DiscardReadCloser, 0, nil\n\tdefault:\n\t\treturn nil, -1, fmt.Errorf(\"unknown FileScheme: %v\", fileScheme)\n\t}\n}\n\n// the httpPath must have the scheme attached\nfunc (r *reader) getFileReadCloserAndSizePotentiallyCompressedHTTP(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\thttpPath string,\n) (io.ReadCloser, int64, error) {\n\tif r.httpClient == nil {\n\t\treturn nil, 0, errors.New(\"http client is nil\")\n\t}\n\tif r.httpAuthenticator == nil {\n\t\treturn nil, 0, errors.New(\"http authenticator is nil\")\n\t}\n\trequest, err := http.NewRequestWithContext(ctx, \"GET\", httpPath, nil)\n\tif err != nil {\n\t\treturn nil, -1, err\n\t}\n\tif _, err := r.httpAuthenticator.SetAuth(container, request); err != nil {\n\t\treturn nil, -1, err\n\t}\n\tresponse, err := r.httpClient.Do(request)\n\tif err != nil {\n\t\treturn nil, -1, err\n\t}\n\tif response.StatusCode != http.StatusOK {\n\t\terr := fmt.Errorf(\"got HTTP status code %d\", response.StatusCode)\n\t\tif response.Body != nil {\n\t\t\treturn nil, -1, errors.Join(err, response.Body.Close())\n\t\t}\n\t\treturn nil, -1, err\n\t}\n\t// ContentLength is -1 if unknown, which is what we want\n\treturn response.Body, response.ContentLength, nil\n}\n\nfunc getGitURL(gitRef GitRef) (string, error) {\n\tswitch gitScheme := gitRef.GitScheme(); gitScheme {\n\tcase GitSchemeHTTP:\n\t\treturn \"http://\" + gitRef.Path(), nil\n\tcase GitSchemeHTTPS:\n\t\treturn \"https://\" + gitRef.Path(), nil\n\tcase GitSchemeSSH:\n\t\treturn \"ssh://\" + gitRef.Path(), nil\n\tcase GitSchemeGit:\n\t\treturn \"git://\" + gitRef.Path(), nil\n\tcase GitSchemeLocal:\n\t\tabsPath, err := filepath.Abs(normalpath.Unnormalize(gitRef.Path()))\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn \"file://\" + absPath, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown GitScheme: %v\", gitScheme)\n\t}\n}\n\n// Use for memory buckets i.e. archive and git.\nfunc getReadBucketCloserForBucket(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tinputBucket storage.ReadBucketCloser,\n\tinputSubDirPath string,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tterminateFunc buftarget.TerminateFunc,\n) (ReadBucketCloser, buftarget.BucketTargeting, error) {\n\tif err := validatePaths(inputSubDirPath, targetPaths, targetExcludePaths); err != nil {\n\t\treturn nil, nil, err\n\t}\n\t// For archive and git refs, target paths and target exclude paths are expected to be\n\t// mapped to the inputSubDirPath rather than the execution context.\n\t// This affects buftarget when checking and mapping paths against the controlling\n\t// workspace, so we need to ensure that all paths are properly mapped.\n\ttargetPaths, targetExcludePaths = mapTargetPathsAndTargetExcludePathsForArchiveAndGitRefs(\n\t\tinputSubDirPath,\n\t\ttargetPaths,\n\t\ttargetExcludePaths,\n\t)\n\tbucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tlogger,\n\t\tinputBucket,\n\t\tinputSubDirPath,\n\t\ttargetPaths,\n\t\ttargetExcludePaths,\n\t\tterminateFunc,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\t// If a controlling workspace is found, then we map the bucket on the controlling\n\t// workspace path. We only need to remap the bucket in the case where a controlling\n\t// workspace is found. In the case where no controlling workspace is found, bufworkspace\n\t// will handle the SubDirPath through workspace targeting given the bucket and BucketTargeting.\n\t//\n\t// We return the same bucket targeting information, since BucketTargeting\n\t// maps the target paths and target exclude paths to the controlling workspace path when\n\t// one is found.\n\tbucketPath := \".\"\n\tif bucketTargeting.ControllingWorkspace() != nil && bucketTargeting.ControllingWorkspace().Path() != \".\" {\n\t\tbucketPath = bucketTargeting.ControllingWorkspace().Path()\n\t\tinputBucket = storage.MapReadBucketCloser(\n\t\t\tinputBucket,\n\t\t\tstorage.MapOnPrefix(bucketPath),\n\t\t)\n\t}\n\tlogger.DebugContext(\n\t\tctx,\n\t\t\"buffetch creating new bucket\",\n\t\tslog.String(\"bucketPath\", bucketPath),\n\t\tslog.Any(\"targetPaths\", bucketTargeting.TargetPaths()),\n\t)\n\treadBucketCloser := newReadBucketCloser(inputBucket, bucketTargeting)\n\treturn readBucketCloser, bucketTargeting, nil\n}\n\n// Use for directory-based buckets.\nfunc getReadWriteBucketForOS(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tinputDirPath string,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tterminateFunc buftarget.TerminateFunc,\n) (ReadWriteBucket, buftarget.BucketTargeting, error) {\n\tfsRoot, fsRootInputSubDirPath, err := fsRootAndFSRelPathForPath(inputDirPath)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tfsRootTargetPaths := make([]string, len(targetPaths))\n\tfor i, targetPath := range targetPaths {\n\t\t_, fsRootTargetPath, err := fsRootAndFSRelPathForPath(targetPath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfsRootTargetPaths[i] = fsRootTargetPath\n\t}\n\tfsRootTargetExcludePaths := make([]string, len(targetExcludePaths))\n\tfor i, targetExcludePath := range targetExcludePaths {\n\t\t_, fsRootTargetExcludePath, err := fsRootAndFSRelPathForPath(targetExcludePath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfsRootTargetExcludePaths[i] = fsRootTargetExcludePath\n\t}\n\tosRootBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tfsRoot,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tosRootBucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tlogger,\n\t\tosRootBucket,\n\t\tfsRootInputSubDirPath,\n\t\tfsRootTargetPaths,\n\t\tfsRootTargetExcludePaths,\n\t\tterminateFunc,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, attemptToFixOSRootBucketPathErrors(fsRoot, err)\n\t}\n\t// osRootBucketTargeting returns the information on whether or not a controlling\n\t// workspace was found based on the inputDirPath.\n\t//\n\t// *** CONTROLLING WORKSPACE FOUND ***\n\t//\n\t// In the case where a controlling workspace is found, we want to create a new bucket\n\t// for the controlling workspace.\n\t// If the inputDirPath is an absolute path, we want to use an absolute path:\n\t//\n\t//    bucketPath := fsRoot + controllingWorkspace.Path()\n\t//\n\t// If the inputDirPath is a relative path, we want to use a relative path between the\n\t// current working directory (pwd) and controlling workspace.\n\t//\n\t//    bucketPath := Rel(Rel(fsRoot, pwd), controllingWorkspace.Path())\n\t//\n\t// We do not need to remap the input dir, target paths, and target exclude paths\n\t// returned by buftarget.BucketTargeting, because they are already relative to the\n\t// controlling workspace.\n\t//\n\t// *** CONTROLLING WORKSPACE NOT FOUND ***\n\t//\n\t// In the case where a controlling workspace is not found, we have three outcomes for\n\t// creating a new bucket.\n\t// If the inputDirPath is an absolute path, we want to use an absolute path to the input\n\t// path:\n\t//\n\t//    bucketPath := Abs(inputDirPath)\n\t//\n\t// If the inputDirPath is a relative path, there are two possible outcomes: the input\n\t// dir is within the context of the working directory or is outside of the context of\n\t// the working directory.\n\t//\n\t// In the case where the input dir, is within the context of the working directory, we\n\t// use pwd:\n\t//\n\t//    bucketPath := Rel(fsRoot,pwd)\n\t//\n\t// In the case where the input dir is outside the context of the working directory, we\n\t// use the input dir relative to the pwd:\n\t//\n\t//    bucketPath := Rel(Rel(fsRoot,pwd), Rel(fsRoot, inputDirPath))\n\t//\n\t// For all cases where no controlling workspace was found, we need to remap the input\n\t// path, target paths, and target exclude paths to the root of the new bucket.\n\tvar bucketPath string\n\tvar inputDir string\n\tbucketTargetPaths := make([]string, len(osRootBucketTargeting.TargetPaths()))\n\tbucketTargetExcludePaths := make([]string, len(osRootBucketTargeting.TargetExcludePaths()))\n\tif controllingWorkspace := osRootBucketTargeting.ControllingWorkspace(); controllingWorkspace != nil {\n\t\tif filepath.IsAbs(normalpath.Unnormalize(inputDirPath)) {\n\t\t\tbucketPath = normalpath.Join(fsRoot, osRootBucketTargeting.ControllingWorkspace().Path())\n\t\t} else {\n\t\t\t// Relative input dir\n\t\t\tpwdFSRelPath, err := getPWDFSRelPath()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tbucketPath, err = normalpath.Rel(pwdFSRelPath, osRootBucketTargeting.ControllingWorkspace().Path())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t\tinputDir = osRootBucketTargeting.SubDirPath()\n\t\tbucketTargetPaths = osRootBucketTargeting.TargetPaths()\n\t\tbucketTargetExcludePaths = osRootBucketTargeting.TargetExcludePaths()\n\t} else {\n\t\t// No controlling workspace found\n\t\tif filepath.IsAbs(normalpath.Unnormalize(inputDirPath)) {\n\t\t\tbucketPath = inputDirPath\n\t\t} else {\n\t\t\t// Relative input dir\n\t\t\tpwdFSRelPath, err := getPWDFSRelPath()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tif filepath.IsLocal(normalpath.Unnormalize(inputDirPath)) {\n\t\t\t\t// Use current working directory\n\t\t\t\tbucketPath = \".\"\n\t\t\t} else {\n\t\t\t\t// Relative input dir outside of working directory context\n\t\t\t\tbucketPath, err = normalpath.Rel(pwdFSRelPath, fsRootInputSubDirPath)\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}\n\t\t}\n\t\t// Map input dir, target paths, and target exclude paths to the new bucket path.\n\t\t_, bucketPathFSRelPath, err := fsRootAndFSRelPathForPath(bucketPath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tinputDir, err = normalpath.Rel(bucketPathFSRelPath, osRootBucketTargeting.SubDirPath())\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfor i, targetPath := range osRootBucketTargeting.TargetPaths() {\n\t\t\tbucketTargetPaths[i], err = normalpath.Rel(bucketPathFSRelPath, targetPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t\tfor i, targetExcludePath := range osRootBucketTargeting.TargetExcludePaths() {\n\t\t\tbucketTargetExcludePaths[i], err = normalpath.Rel(bucketPathFSRelPath, targetExcludePath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t}\n\tbucket, err := storageosProvider.NewReadWriteBucket(\n\t\tbucketPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tbucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tlogger,\n\t\tbucket,\n\t\tinputDir,\n\t\tbucketTargetPaths,\n\t\tbucketTargetExcludePaths,\n\t\tterminateFunc,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treadWriteBucket := newReadWriteBucket(bucket, bucketPath, bucketTargeting)\n\treturn readWriteBucket, bucketTargeting, nil\n}\n\n// Use for ProtoFileRefs.\nfunc getReadBucketCloserForOSProtoFile(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tprotoFilePath string,\n\tterminateFunc buftarget.TerminateFunc,\n) (ReadBucketCloser, buftarget.BucketTargeting, error) {\n\t// For proto file refs, we treat the input directory as the directory of\n\t// the file and the file as a target path.\n\t// No other target paths and target exclude paths are supported with\n\t// proto file refs.\n\tprotoFileDir := normalpath.Dir(protoFilePath)\n\treadWriteBucket, bucketTargeting, err := getReadWriteBucketForOS(\n\t\tctx,\n\t\tlogger,\n\t\tstorageosProvider,\n\t\tprotoFileDir,\n\t\t[]string{protoFilePath},\n\t\tnil, // no target exclude paths are supported for proto file refs\n\t\tterminateFunc,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn newReadBucketCloserForReadWriteBucket(readWriteBucket), bucketTargeting, nil\n}\n\n// getPWDFSRelPath is a helper function that gets the relative path of the current working\n// directory to the FS root.\nfunc getPWDFSRelPath() (string, error) {\n\tpwd, err := osext.Getwd()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\t_, pwdFSRelPath, err := fsRootAndFSRelPathForPath(pwd)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn pwdFSRelPath, nil\n}\n\n// fsRootAndFSRelPathForPath is a helper function that takes a path and returns the FS\n// root and relative path to the FS root.\nfunc fsRootAndFSRelPathForPath(path string) (string, string, error) {\n\tabsPath, err := normalpath.NormalizeAndAbsolute(path)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\t// Split the absolute path into components to get the FS root\n\tabsPathComponents := normalpath.Components(absPath)\n\tfsRoot := absPathComponents[0]\n\tfsRelPath, err := normalpath.Rel(fsRoot, absPath)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\treturn fsRoot, fsRelPath, nil\n}\n\n// We attempt to fix up paths we get back to better printing to the user.\n// Without this, we'll get things like \"stat: Users/foo/path/to/input: does not exist\"\n// based on our usage of osRootBucket and absProtoFileDirPath above. While we won't\n// break any contracts printing these out, this is confusing to the user, so this is\n// our attempt to fix that.\n//\n// This is going to take away other intermediate errors unfortunately.\nfunc attemptToFixOSRootBucketPathErrors(fsRoot string, err error) error {\n\tvar pathError *fs.PathError\n\tif errors.As(err, &pathError) {\n\t\tpwd, err := osext.Getwd()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpwd = normalpath.Normalize(pwd)\n\t\tif normalpath.EqualsOrContainsPath(pwd, normalpath.Join(fsRoot, pathError.Path), normalpath.Absolute) {\n\t\t\trelPath, err := normalpath.Rel(pwd, normalpath.Join(fsRoot, pathError.Path))\n\t\t\t// Just ignore if this errors and do nothing.\n\t\t\tif err == nil {\n\t\t\t\t// Making a copy just to be super-safe.\n\t\t\t\treturn &fs.PathError{\n\t\t\t\t\tOp:   pathError.Op,\n\t\t\t\t\tPath: relPath,\n\t\t\t\t\tErr:  pathError.Err,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn err\n}\n\nfunc validatePaths(\n\tinputSubDirPath string,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n) error {\n\tif _, err := normalpath.NormalizeAndValidate(inputSubDirPath); err != nil {\n\t\treturn err\n\t}\n\tif _, err := xslices.MapError(\n\t\ttargetPaths,\n\t\tnormalpath.NormalizeAndValidate,\n\t); err != nil {\n\t\treturn err\n\t}\n\tif _, err := xslices.MapError(\n\t\ttargetPaths,\n\t\tnormalpath.NormalizeAndValidate,\n\t); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc mapTargetPathsAndTargetExcludePathsForArchiveAndGitRefs(\n\tinputSubDirPath string,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n) ([]string, []string) {\n\t// No need to remap\n\tif inputSubDirPath == \".\" {\n\t\treturn targetPaths, targetExcludePaths\n\t}\n\treturn xslices.Map(\n\t\t\ttargetPaths,\n\t\t\tfunc(targetPath string) string {\n\t\t\t\treturn normalpath.Join(inputSubDirPath, targetPath)\n\t\t\t},\n\t\t),\n\t\txslices.Map(\n\t\t\ttargetExcludePaths,\n\t\t\tfunc(targetExcludePath string) string {\n\t\t\t\treturn normalpath.Join(inputSubDirPath, targetExcludePath)\n\t\t\t},\n\t\t)\n}\n\ntype getFileOptions struct {\n\tkeepFileCompression bool\n}\n\nfunc newGetFileOptions() *getFileOptions {\n\treturn &getFileOptions{}\n}\n\ntype getReadBucketCloserOptions struct {\n\tterminateFunc      buftarget.TerminateFunc\n\tcopyToInMemory     bool\n\ttargetPaths        []string\n\ttargetExcludePaths []string\n}\n\nfunc newGetReadBucketCloserOptions() *getReadBucketCloserOptions {\n\treturn &getReadBucketCloserOptions{}\n}\n\ntype getReadWriteBucketOptions struct {\n\tterminateFunc      buftarget.TerminateFunc\n\ttargetPaths        []string\n\ttargetExcludePaths []string\n}\n\nfunc newGetReadWriteBucketOptions() *getReadWriteBucketOptions {\n\treturn &getReadWriteBucketOptions{}\n}\n\ntype getModuleOptions struct{}\n"
  },
  {
    "path": "private/buf/buffetch/internal/reader_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/osext\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGetReadBucketCloserForBucketNoTerminateFileName(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tinputBucket, err := storageos.NewProvider().NewReadWriteBucket(\"testdata/bufyaml/one/two\")\n\trequire.NoError(t, err)\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForBucket(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorage.NopReadBucketCloser(inputBucket),\n\t\t\"three/four/five\",\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\tnil, // no terminate func, which should result in never finding a controlling workspace\n\t)\n\trequire.NoError(t, err)\n\trequire.Nil(t, bucketTargeting.ControllingWorkspace())\n\trequire.Equal(t, \"three/four/five\", readBucketCloser.SubDirPath())\n}\n\nfunc TestGetReadBucketCloserTerminateFileName(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tinputBucket, err := storageos.NewProvider().NewReadWriteBucket(\"testdata/bufyaml/one/two\")\n\trequire.NoError(t, err)\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForBucket(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorage.NopReadBucketCloser(inputBucket),\n\t\t\"three/four/five\",\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"three\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five\", readBucketCloser.SubDirPath())\n\t_, err = readBucketCloser.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForBucketNoSubDirPath(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tinputBucket, err := storageos.NewProvider().NewReadWriteBucket(\"testdata/bufyaml/one/two/three/four/five\")\n\trequire.NoError(t, err)\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForBucket(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorage.NopReadBucketCloser(inputBucket),\n\t\t\".\",\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\trequire.Nil(t, bucketTargeting.ControllingWorkspace())\n\trequire.Equal(t, \".\", readBucketCloser.SubDirPath())\n\t_, err = readBucketCloser.Stat(ctx, \"buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForBucketAbs(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tabsDirPath, err := filepath.Abs(\".\")\n\trequire.NoError(t, err)\n\tinputBucket, err := storageos.NewProvider().NewReadWriteBucket(normalpath.Join(absDirPath, \"testdata/bufyaml/one/two\"))\n\trequire.NoError(t, err)\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForBucket(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorage.NopReadBucketCloser(inputBucket),\n\t\t\"three/four/five\",\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"three\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five\", readBucketCloser.SubDirPath())\n\t_, err = readBucketCloser.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadWriteBucketForOSNoTerminateFileName(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\treadWriteBucket, bucketTargeting, err := getReadWriteBucketForOS(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"testdata/bufyaml/one/two/three/four/five\",\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\trequire.Nil(t, bucketTargeting.ControllingWorkspace())\n\trequire.Equal(t, \"testdata/bufyaml/one/two/three/four/five\", readWriteBucket.SubDirPath())\n\tfileInfo, err := readWriteBucket.Stat(ctx, \"testdata/bufyaml/one/two/three/four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"testdata/bufyaml/one/two/three/four/five/buf.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n}\n\nfunc TestGetReadWriteBucketForOSTerminateFileName(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\treadWriteBucket, bucketTargeting, err := getReadWriteBucketForOS(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"testdata/bufyaml/one/two/three/four/five\",\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five\", readWriteBucket.SubDirPath())\n\tfileInfo, err := readWriteBucket.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"testdata/bufyaml/one/two/three/four/five/buf.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\tfileInfo, err = readWriteBucket.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"testdata/bufyaml/one/two/three/buf.work.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n}\n\nfunc TestGetReadWriteBucketForOSParentPwd(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\n\tctx := t.Context()\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\trequire.NoError(t, osext.Chdir(normalpath.Unnormalize(normalpath.Join(pwd, \"testdata/bufyaml/one/two/three/four\"))))\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\treadWriteBucket, bucketTargeting, err := getReadWriteBucketForOS(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"five\",\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five\", readWriteBucket.SubDirPath())\n\tfileInfo, err := readWriteBucket.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"five/buf.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\tfileInfo, err = readWriteBucket.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"../buf.work.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n}\n\nfunc TestGetReadWriteBucketForOSAbsPwd(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\n\tctx := t.Context()\n\tabsDirPath, err := filepath.Abs(\".\")\n\trequire.NoError(t, err)\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\trequire.NoError(t, osext.Chdir(normalpath.Unnormalize(normalpath.Join(pwd, \"testdata/bufyaml/one/two/three/four\"))))\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\treadWriteBucket, bucketTargeting, err := getReadWriteBucketForOS(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\tnormalpath.Join(absDirPath, \"testdata/bufyaml/one/two/three/four/five\"),\n\t\tnil, // no target paths\n\t\tnil, // no target exclude paths\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five\", readWriteBucket.SubDirPath())\n\tfileInfo, err := readWriteBucket.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, normalpath.Join(absDirPath, \"testdata/bufyaml/one/two/three/four/five/buf.yaml\"), filepath.ToSlash(fileInfo.ExternalPath()))\n\tfileInfo, err = readWriteBucket.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, normalpath.Join(absDirPath, \"testdata/bufyaml/one/two/three/buf.work.yaml\"), filepath.ToSlash(fileInfo.ExternalPath()))\n}\n\nfunc TestGetReadBucketCloserForOSProtoFileNoWorkspaceTerminateFileName(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"testdata/bufyaml/one/two/three/four/five/proto/foo.proto\",\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"proto\", readBucketCloser.SubDirPath())\n\trequire.Len(t, bucketTargeting.TargetPaths(), 1)\n\trequire.Equal(t, \"proto/foo.proto\", bucketTargeting.TargetPaths()[0])\n\tfileInfo, err := readBucketCloser.Stat(ctx, \"buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"testdata/bufyaml/one/two/three/four/five/buf.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForOSProtoFileTerminateFileName(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"testdata/bufyaml/one/two/three/four/five/proto/foo.proto\",\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five/proto\", readBucketCloser.SubDirPath())\n\trequire.Len(t, bucketTargeting.TargetPaths(), 1)\n\trequire.Equal(t, \"four/five/proto/foo.proto\", bucketTargeting.TargetPaths()[0])\n\tfileInfo, err := readBucketCloser.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"testdata/bufyaml/one/two/three/four/five/buf.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\tfileInfo, err = readBucketCloser.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"testdata/bufyaml/one/two/three/buf.work.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForOSProtoFileParentPwd(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\n\tctx := t.Context()\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\trequire.NoError(t, osext.Chdir(normalpath.Unnormalize(normalpath.Join(pwd, \"testdata/bufyaml/one/two/three/four\"))))\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"five/proto/foo.proto\",\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five/proto\", readBucketCloser.SubDirPath())\n\trequire.Len(t, bucketTargeting.TargetPaths(), 1)\n\trequire.Equal(t, \"four/five/proto/foo.proto\", bucketTargeting.TargetPaths()[0])\n\tfileInfo, err := readBucketCloser.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"five/buf.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\tfileInfo, err = readBucketCloser.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"../buf.work.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForOSProtoFileAbsPwd(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\n\tctx := t.Context()\n\tabsDirPath, err := filepath.Abs(\".\")\n\trequire.NoError(t, err)\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\trequire.NoError(t, osext.Chdir(normalpath.Unnormalize(normalpath.Join(pwd, \"testdata/bufyaml/one/two/three/four\"))))\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\tnormalpath.Join(absDirPath, \"testdata/bufyaml/one/two/three/four/five/proto/foo.proto\"),\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five/proto\", readBucketCloser.SubDirPath())\n\trequire.Len(t, bucketTargeting.TargetPaths(), 1)\n\trequire.Equal(t, \"four/five/proto/foo.proto\", bucketTargeting.TargetPaths()[0])\n\tfileInfo, err := readBucketCloser.Stat(ctx, \"four/five/buf.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, normalpath.Join(absDirPath, \"testdata/bufyaml/one/two/three/four/five/buf.yaml\"), filepath.ToSlash(fileInfo.ExternalPath()))\n\tfileInfo, err = readBucketCloser.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, normalpath.Join(absDirPath, \"testdata/bufyaml/one/two/three/buf.work.yaml\"), filepath.ToSlash(fileInfo.ExternalPath()))\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForOSProtoFileNoBufYAMLTerminateFileName(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"testdata/nobufyaml/one/two/three/four/five/proto/foo.proto\",\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five/proto\", readBucketCloser.SubDirPath())\n\trequire.Len(t, bucketTargeting.TargetPaths(), 1)\n\trequire.Equal(t, \"four/five/proto/foo.proto\", bucketTargeting.TargetPaths()[0])\n\tfileInfo, err := readBucketCloser.Stat(ctx, \"four/five/proto/foo.proto\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"testdata/nobufyaml/one/two/three/four/five/proto/foo.proto\", filepath.ToSlash(fileInfo.ExternalPath()))\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForOSProtoFileNoBufYAMLParentPwd(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\n\tctx := t.Context()\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\trequire.NoError(t, osext.Chdir(normalpath.Unnormalize(normalpath.Join(pwd, \"testdata/nobufyaml/one/two/three/four\"))))\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t\"five/proto/foo.proto\",\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five/proto\", readBucketCloser.SubDirPath())\n\trequire.Len(t, bucketTargeting.TargetPaths(), 1)\n\trequire.Equal(t, \"four/five/proto/foo.proto\", bucketTargeting.TargetPaths()[0])\n\tfileInfo, err := readBucketCloser.Stat(ctx, \"four/five/proto/foo.proto\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"five/proto/foo.proto\", filepath.ToSlash(fileInfo.ExternalPath()))\n\tfileInfo, err = readBucketCloser.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, \"../buf.work.yaml\", filepath.ToSlash(fileInfo.ExternalPath()))\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc TestGetReadBucketCloserForOSProtoFileNoBufYAMLAbsPwd(t *testing.T) {\n\t// Cannot be parallel since we chdir.\n\tt.Skip()\n\n\tctx := t.Context()\n\tabsDirPath, err := filepath.Abs(\".\")\n\trequire.NoError(t, err)\n\tpwd, err := osext.Getwd()\n\trequire.NoError(t, err)\n\trequire.NoError(t, osext.Chdir(normalpath.Unnormalize(normalpath.Join(pwd, \"testdata/nobufyaml/one/two/three/four\"))))\n\tdefer func() {\n\t\tr := recover()\n\t\tassert.NoError(t, osext.Chdir(pwd))\n\t\tif r != nil {\n\t\t\tpanic(r)\n\t\t}\n\t}()\n\treadBucketCloser, bucketTargeting, err := getReadBucketCloserForOSProtoFile(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\tnormalpath.Join(absDirPath, \"testdata/nobufyaml/one/two/three/four/five/proto/foo.proto\"),\n\t\ttestNewTerminateAtFileNamesFunc(\"buf.work.yaml\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"four/five\", readBucketCloser.SubDirPath())\n\trequire.Len(t, bucketTargeting.TargetPaths(), 1)\n\trequire.Equal(t, \"four/five/proto/foo.proto\", bucketTargeting.TargetPaths()[0])\n\tfileInfo, err := readBucketCloser.Stat(ctx, \"four/five/proto/foo.proto\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, normalpath.Join(absDirPath, \"testdata/nobufyaml/one/two/three/four/five/proto/foo.proto\"), fileInfo.ExternalPath())\n\tfileInfo, err = readBucketCloser.Stat(ctx, \"buf.work.yaml\")\n\trequire.NoError(t, err)\n\trequire.Equal(t, normalpath.Join(absDirPath, \"testdata/nobufyaml/one/two/three/buf.work.yaml\"), fileInfo.ExternalPath())\n\trequire.NoError(t, readBucketCloser.Close())\n}\n\nfunc testNewTerminateAtFileNamesFunc(terminateFileNames ...string) buftarget.TerminateFunc {\n\treturn buftarget.TerminateFunc(\n\t\tfunc(\n\t\t\tctx context.Context,\n\t\t\tbucket storage.ReadBucket,\n\t\t\tprefix string,\n\t\t\tinputDir string,\n\t\t) (buftarget.ControllingWorkspace, error) {\n\t\t\tfor _, terminateFileName := range terminateFileNames {\n\t\t\t\t// We do not test for config file logic here, so it is fine to return empty configs.\n\t\t\t\tif _, err := bucket.Stat(ctx, normalpath.Join(prefix, terminateFileName)); err == nil {\n\t\t\t\t\treturn buftarget.NewControllingWorkspace(prefix, nil, nil), nil\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil, nil\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/ref_parser.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\ntype refParser struct {\n\tlogger                *slog.Logger\n\trawRefProcessor       func(*RawRef) error\n\tsingleFormatToInfo    map[string]*singleFormatInfo\n\tarchiveFormatToInfo   map[string]*archiveFormatInfo\n\tdirFormatToInfo       map[string]*dirFormatInfo\n\tgitFormatToInfo       map[string]*gitFormatInfo\n\tmoduleFormatToInfo    map[string]*moduleFormatInfo\n\tprotoFileFormatToInfo map[string]*protoFileFormatInfo\n}\n\nfunc newRefParser(logger *slog.Logger, options ...RefParserOption) *refParser {\n\trefParser := &refParser{\n\t\tlogger:                logger,\n\t\tsingleFormatToInfo:    make(map[string]*singleFormatInfo),\n\t\tarchiveFormatToInfo:   make(map[string]*archiveFormatInfo),\n\t\tdirFormatToInfo:       make(map[string]*dirFormatInfo),\n\t\tgitFormatToInfo:       make(map[string]*gitFormatInfo),\n\t\tmoduleFormatToInfo:    make(map[string]*moduleFormatInfo),\n\t\tprotoFileFormatToInfo: make(map[string]*protoFileFormatInfo),\n\t}\n\tfor _, option := range options {\n\t\toption(refParser)\n\t}\n\treturn refParser\n}\n\nfunc (a *refParser) GetParsedRef(\n\tctx context.Context,\n\tvalue string,\n\toptions ...GetParsedRefOption,\n) (ParsedRef, error) {\n\tgetParsedRefOptions := newGetParsedRefOptions()\n\tfor _, option := range options {\n\t\toption(getParsedRefOptions)\n\t}\n\treturn a.getParsedRef(ctx, value, getParsedRefOptions.allowedFormats)\n}\n\nfunc (a *refParser) GetParsedRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n\toptions ...GetParsedRefOption,\n) (ParsedRef, error) {\n\tgetParsedRefOptions := newGetParsedRefOptions()\n\tfor _, option := range options {\n\t\toption(getParsedRefOptions)\n\t}\n\treturn a.getParsedRefForInputConfig(ctx, inputConfig, getParsedRefOptions.allowedFormats)\n}\n\nfunc (a *refParser) getParsedRef(\n\tctx context.Context,\n\tvalue string,\n\tallowedFormats map[string]struct{},\n) (ParsedRef, error) {\n\t// path is never empty after returning from this function\n\tpath, options, err := getRawPathAndOptions(value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trawRef, err := a.getRawRef(path, value, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn a.parseRawRef(rawRef, allowedFormats)\n}\n\nfunc (a *refParser) getParsedRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n\tallowedFormats map[string]struct{},\n) (ParsedRef, error) {\n\trawRef, err := a.getRawRefForInputConfig(inputConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn a.parseRawRef(rawRef, allowedFormats)\n}\n\nfunc (a *refParser) getRawRef(\n\tpath string,\n\t// Used to reference the input config in error messages.\n\tdisplayName string,\n\toptions map[string]string,\n) (*RawRef, error) {\n\trawRef := &RawRef{\n\t\tPath:                path,\n\t\tUnrecognizedOptions: make(map[string]string),\n\t}\n\tif a.rawRefProcessor != nil {\n\t\tif err := a.rawRefProcessor(rawRef); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfor key, value := range options {\n\t\tswitch key {\n\t\tcase \"format\":\n\t\t\tif app.IsDevNull(path) {\n\t\t\t\treturn nil, NewFormatOverrideNotAllowedForDevNullError(app.DevNullFilePath)\n\t\t\t}\n\t\t\trawRef.Format = value\n\t\tcase \"compression\":\n\t\t\tcompressionType, err := parseCompressionType(value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trawRef.CompressionType = compressionType\n\t\tcase \"branch\":\n\t\t\trawRef.GitBranch = value\n\t\tcase \"tag\", \"commit\":\n\t\t\trawRef.GitCommitOrTag = value\n\t\tcase \"ref\":\n\t\t\trawRef.GitRef = value\n\t\tcase \"filter\":\n\t\t\trawRef.GitFilter = value\n\t\tcase \"depth\":\n\t\t\tdepth, err := parseGitDepth(value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trawRef.GitDepth = depth\n\t\tcase \"recurse_submodules\":\n\t\t\t// TODO FUTURE: need to refactor to make sure this is not set for any non-git input\n\t\t\t// ie right now recurse_submodules=false will not error\n\t\t\tswitch value {\n\t\t\tcase \"true\":\n\t\t\t\trawRef.GitRecurseSubmodules = true\n\t\t\tcase \"false\":\n\t\t\tdefault:\n\t\t\t\treturn nil, NewOptionsCouldNotParseRecurseSubmodulesError(value)\n\t\t\t}\n\t\tcase \"strip_components\":\n\t\t\t// TODO FUTURE: need to refactor to make sure this is not set for any non-tarball\n\t\t\t// ie right now strip_components=0 will not error\n\t\t\tstripComponents, err := strconv.ParseUint(value, 10, 32)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, NewOptionsCouldNotParseStripComponentsError(value)\n\t\t\t}\n\t\t\trawRef.ArchiveStripComponents = uint32(stripComponents)\n\t\tcase \"subdir\":\n\t\t\tsubDirPath, err := parseSubDirPath(value)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trawRef.SubDirPath = subDirPath\n\t\tcase \"include_package_files\":\n\t\t\tswitch value {\n\t\t\tcase \"true\":\n\t\t\t\trawRef.IncludePackageFiles = true\n\t\t\tcase \"false\", \"\":\n\t\t\t\trawRef.IncludePackageFiles = false\n\t\t\tdefault:\n\t\t\t\treturn nil, NewOptionsInvalidValueForKeyError(key, value)\n\t\t\t}\n\t\tdefault:\n\t\t\trawRef.UnrecognizedOptions[key] = value\n\t\t}\n\t}\n\t// This cannot be set ahead of time, it can only happen after all options are read.\n\tif rawRef.Format == \"git\" && rawRef.GitDepth == 0 {\n\t\t// Default to 1\n\t\trawRef.GitDepth = 1\n\t\tif rawRef.GitRef != \"\" {\n\t\t\t// Default to 50 when using ref\n\t\t\trawRef.GitDepth = 50\n\t\t}\n\t}\n\tif err := a.validateRawRef(displayName, rawRef); err != nil {\n\t\treturn nil, err\n\t}\n\treturn rawRef, nil\n}\n\nfunc (a *refParser) getRawRefForInputConfig(\n\tinputConfig bufconfig.InputConfig,\n) (*RawRef, error) {\n\trawRef := &RawRef{\n\t\tPath:                inputConfig.Location(),\n\t\tUnrecognizedOptions: make(map[string]string),\n\t}\n\tif a.rawRefProcessor != nil {\n\t\tif err := a.rawRefProcessor(rawRef); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tswitch inputConfig.Type() {\n\tcase bufconfig.InputConfigTypeModule:\n\t\trawRef.Format = \"mod\"\n\tcase bufconfig.InputConfigTypeDirectory:\n\t\trawRef.Format = \"dir\"\n\tcase bufconfig.InputConfigTypeGitRepo:\n\t\trawRef.Format = \"git\"\n\tcase bufconfig.InputConfigTypeProtoFile:\n\t\trawRef.Format = \"protofile\"\n\tcase bufconfig.InputConfigTypeTarball:\n\t\trawRef.Format = \"tar\"\n\tcase bufconfig.InputConfigTypeZipArchive:\n\t\trawRef.Format = \"zip\"\n\tcase bufconfig.InputConfigTypeBinaryImage:\n\t\trawRef.Format = \"binpb\"\n\tcase bufconfig.InputConfigTypeJSONImage:\n\t\trawRef.Format = \"json\"\n\tcase bufconfig.InputConfigTypeTextImage:\n\t\trawRef.Format = \"txtpb\"\n\tcase bufconfig.InputConfigTypeYAMLImage:\n\t\trawRef.Format = \"yaml\"\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown InputConfigType: %v\", inputConfig.Type())\n\t}\n\t// This cannot be set ahead of time, it can only happen after all options are read.\n\tif inputConfig.Type() == bufconfig.InputConfigTypeGitRepo {\n\t\t// TODO FUTURE: might change rawRef.Depth into a pointer or use some other way to handle the case where 0 is specified\n\t\tif inputConfig.Depth() != nil {\n\t\t\tif *inputConfig.Depth() == 0 {\n\t\t\t\treturn nil, NewDepthZeroError()\n\t\t\t}\n\t\t\trawRef.GitDepth = *inputConfig.Depth()\n\t\t}\n\t\trawRef.GitBranch = inputConfig.Branch()\n\t\trawRef.GitCommitOrTag = inputConfig.CommitOrTag()\n\t\trawRef.GitRef = inputConfig.Ref()\n\t\trawRef.GitRecurseSubmodules = inputConfig.RecurseSubmodules()\n\t\tif rawRef.GitDepth == 0 {\n\t\t\t// Default to 1\n\t\t\trawRef.GitDepth = 1\n\t\t\tif rawRef.GitRef != \"\" {\n\t\t\t\t// Default to 50 when using ref\n\t\t\t\trawRef.GitDepth = 50\n\t\t\t}\n\t\t}\n\t}\n\tvar err error\n\tif compression := inputConfig.Compression(); compression != \"\" {\n\t\trawRef.CompressionType, err = parseCompressionType(compression)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\trawRef.IncludePackageFiles = inputConfig.IncludePackageFiles()\n\trawRef.ArchiveStripComponents = inputConfig.StripComponents()\n\trawRef.SubDirPath, err = parseSubDirPath(inputConfig.SubDir())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := a.validateRawRef(inputConfig.Location(), rawRef); err != nil {\n\t\treturn nil, err\n\t}\n\treturn rawRef, nil\n}\n\nfunc (a *refParser) parseRawRef(\n\trawRef *RawRef,\n\tallowedFormats map[string]struct{},\n) (ParsedRef, error) {\n\tsingleFormatInfo, singleOK := a.singleFormatToInfo[rawRef.Format]\n\tarchiveFormatInfo, archiveOK := a.archiveFormatToInfo[rawRef.Format]\n\t_, dirOK := a.dirFormatToInfo[rawRef.Format]\n\t_, gitOK := a.gitFormatToInfo[rawRef.Format]\n\t_, moduleOK := a.moduleFormatToInfo[rawRef.Format]\n\t_, protoFileOK := a.protoFileFormatToInfo[rawRef.Format]\n\tif !(singleOK || archiveOK || dirOK || gitOK || moduleOK || protoFileOK) {\n\t\treturn nil, NewFormatUnknownError(rawRef.Format)\n\t}\n\tif len(allowedFormats) > 0 {\n\t\tif _, ok := allowedFormats[rawRef.Format]; !ok {\n\t\t\treturn nil, NewFormatNotAllowedError(rawRef.Format, allowedFormats)\n\t\t}\n\t}\n\tif !singleOK && len(rawRef.UnrecognizedOptions) > 0 {\n\t\t// Only single refs allow custom options. In every other case, this is an error.\n\t\t//\n\t\t// We verify unrecognized options match what is expected in getSingleRef.\n\t\tkeys := make([]string, 0, len(rawRef.UnrecognizedOptions))\n\t\tfor key := range rawRef.UnrecognizedOptions {\n\t\t\tkeys = append(keys, key)\n\t\t}\n\t\tsort.Strings(keys)\n\t\treturn nil, NewOptionsInvalidKeysError(keys...)\n\t}\n\tif singleOK {\n\t\treturn getSingleRef(rawRef, singleFormatInfo.defaultCompressionType, singleFormatInfo.customOptionKeys)\n\t}\n\tif archiveOK {\n\t\treturn getArchiveRef(rawRef, archiveFormatInfo.archiveType, archiveFormatInfo.defaultCompressionType)\n\t}\n\tif protoFileOK {\n\t\treturn getProtoFileRef(rawRef)\n\t}\n\tif dirOK {\n\t\treturn getDirRef(rawRef)\n\t}\n\tif gitOK {\n\t\treturn getGitRef(rawRef)\n\t}\n\tif moduleOK {\n\t\treturn getModuleRef(rawRef)\n\t}\n\treturn nil, NewFormatUnknownError(rawRef.Format)\n}\n\nfunc (a *refParser) validateRawRef(\n\tdisplayName string,\n\trawRef *RawRef,\n) error {\n\t// probably move everything below this point to a new function, perhaps called validateRawRef\n\tif rawRef.Format == \"\" {\n\t\treturn NewFormatCannotBeDeterminedError(displayName)\n\t}\n\t_, gitOK := a.gitFormatToInfo[rawRef.Format]\n\tarchiveFormatInfo, archiveOK := a.archiveFormatToInfo[rawRef.Format]\n\t_, singleOK := a.singleFormatToInfo[rawRef.Format]\n\tif gitOK {\n\t\tif rawRef.GitBranch != \"\" && rawRef.GitCommitOrTag != \"\" {\n\t\t\treturn NewCannotSpecifyGitBranchAndCommitOrTagError()\n\t\t}\n\t\tif rawRef.GitRef != \"\" && rawRef.GitCommitOrTag != \"\" {\n\t\t\treturn NewCannotSpecifyCommitOrTagWithRefError()\n\t\t}\n\t} else {\n\t\tif rawRef.GitBranch != \"\" || rawRef.GitCommitOrTag != \"\" || rawRef.GitRef != \"\" || rawRef.GitRecurseSubmodules || rawRef.GitDepth > 0 {\n\t\t\treturn NewOptionsInvalidForFormatError(rawRef.Format, displayName, \"git options set\")\n\t\t}\n\t}\n\t// not an archive format\n\tif !archiveOK {\n\t\tif rawRef.ArchiveStripComponents > 0 {\n\t\t\treturn NewOptionsInvalidForFormatError(rawRef.Format, displayName, \"archive options set\")\n\t\t}\n\t} else {\n\t\tif archiveFormatInfo.archiveType == ArchiveTypeZip && rawRef.CompressionType != 0 {\n\t\t\treturn NewCannotSpecifyCompressionForZipError()\n\t\t}\n\t}\n\tif !singleOK && !archiveOK {\n\t\tif rawRef.CompressionType != 0 {\n\t\t\treturn NewOptionsInvalidForFormatError(rawRef.Format, displayName, \"compression set\")\n\t\t}\n\t}\n\tif !archiveOK && !gitOK {\n\t\tif rawRef.SubDirPath != \"\" {\n\t\t\treturn NewOptionsInvalidForFormatError(rawRef.Format, displayName, \"subdir set\")\n\t\t}\n\t}\n\treturn nil\n}\n\n// empty value is an error\nfunc parseCompressionType(value string) (CompressionType, error) {\n\tswitch value {\n\tcase \"none\":\n\t\treturn CompressionTypeNone, nil\n\tcase \"gzip\":\n\t\treturn CompressionTypeGzip, nil\n\tcase \"zstd\":\n\t\treturn CompressionTypeZstd, nil\n\tdefault:\n\t\treturn 0, NewCompressionUnknownError(value)\n\t}\n}\n\nfunc parseGitDepth(value string) (uint32, error) {\n\tdepth, err := strconv.ParseUint(value, 10, 32)\n\tif err != nil {\n\t\treturn 0, NewDepthParseError(value)\n\t}\n\tif depth == 0 {\n\t\treturn 0, NewDepthZeroError()\n\t}\n\treturn uint32(depth), nil\n}\n\nfunc parseSubDirPath(value string) (string, error) {\n\tsubDirPath, err := normalpath.NormalizeAndValidate(value)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif subDirPath == \".\" {\n\t\treturn \"\", nil\n\t}\n\treturn subDirPath, nil\n}\n\n// getRawPathAndOptions returns the raw path and options from the value provided,\n// the rawPath will be non-empty when returning without error here.\nfunc getRawPathAndOptions(value string) (string, map[string]string, error) {\n\tvalue = strings.TrimSpace(value)\n\tif value == \"\" {\n\t\treturn \"\", nil, newValueEmptyError()\n\t}\n\n\tswitch splitValue := strings.Split(value, \"#\"); len(splitValue) {\n\tcase 1:\n\t\treturn value, nil, nil\n\tcase 2:\n\t\tpath := strings.TrimSpace(splitValue[0])\n\t\toptionsString := strings.TrimSpace(splitValue[1])\n\t\tif path == \"\" {\n\t\t\treturn \"\", nil, newValueStartsWithHashtagError(value)\n\t\t}\n\t\tif optionsString == \"\" {\n\t\t\treturn \"\", nil, newValueEndsWithHashtagError(value)\n\t\t}\n\t\toptions := make(map[string]string)\n\t\tfor pair := range strings.SplitSeq(optionsString, \",\") {\n\t\t\tsplit := strings.Split(pair, \"=\")\n\t\t\tif len(split) != 2 {\n\t\t\t\treturn \"\", nil, newOptionsInvalidError(optionsString)\n\t\t\t}\n\t\t\tkey := strings.TrimSpace(split[0])\n\t\t\tvalue := strings.TrimSpace(split[1])\n\t\t\tif key == \"\" || value == \"\" {\n\t\t\t\treturn \"\", nil, newOptionsInvalidError(optionsString)\n\t\t\t}\n\t\t\tif _, ok := options[key]; ok {\n\t\t\t\treturn \"\", nil, newOptionsDuplicateKeyError(key)\n\t\t\t}\n\t\t\toptions[key] = value\n\t\t}\n\t\treturn path, options, nil\n\tdefault:\n\t\treturn \"\", nil, newValueMultipleHashtagsError(value)\n\t}\n}\n\nfunc getSingleRef(\n\trawRef *RawRef,\n\tdefaultCompressionType CompressionType,\n\tcustomOptionKeys map[string]struct{},\n) (ParsedSingleRef, error) {\n\tcompressionType := rawRef.CompressionType\n\tif compressionType == 0 {\n\t\tcompressionType = defaultCompressionType\n\t}\n\tvar invalidKeys []string\n\tfor key := range rawRef.UnrecognizedOptions {\n\t\tif _, ok := customOptionKeys[key]; !ok {\n\t\t\tinvalidKeys = append(invalidKeys, key)\n\t\t}\n\t}\n\tif len(invalidKeys) > 0 {\n\t\treturn nil, NewOptionsInvalidKeysError(invalidKeys...)\n\t}\n\treturn newSingleRef(\n\t\trawRef.Format,\n\t\trawRef.Path,\n\t\tcompressionType,\n\t\trawRef.UnrecognizedOptions,\n\t)\n}\n\nfunc getArchiveRef(\n\trawRef *RawRef,\n\tarchiveType ArchiveType,\n\tdefaultCompressionType CompressionType,\n) (ParsedArchiveRef, error) {\n\tcompressionType := rawRef.CompressionType\n\tif compressionType == 0 {\n\t\tcompressionType = defaultCompressionType\n\t}\n\treturn newArchiveRef(\n\t\trawRef.Format,\n\t\trawRef.Path,\n\t\tarchiveType,\n\t\tcompressionType,\n\t\trawRef.ArchiveStripComponents,\n\t\trawRef.SubDirPath,\n\t)\n}\n\nfunc getDirRef(\n\trawRef *RawRef,\n) (ParsedDirRef, error) {\n\treturn newDirRef(\n\t\trawRef.Format,\n\t\trawRef.Path,\n\t)\n}\n\nfunc getGitRef(\n\trawRef *RawRef,\n) (ParsedGitRef, error) {\n\tgitRefName, err := getGitRefName(rawRef.Path, rawRef.GitBranch, rawRef.GitCommitOrTag, rawRef.GitRef)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newGitRef(\n\t\trawRef.Format,\n\t\trawRef.Path,\n\t\tgitRefName,\n\t\trawRef.GitDepth,\n\t\trawRef.GitRecurseSubmodules,\n\t\trawRef.SubDirPath,\n\t\trawRef.GitFilter,\n\t)\n}\n\nfunc getModuleRef(\n\trawRef *RawRef,\n) (ParsedModuleRef, error) {\n\treturn newModuleRef(\n\t\trawRef.Format,\n\t\trawRef.Path,\n\t)\n}\n\nfunc getGitRefName(path string, branch string, commitOrTag string, ref string) (git.Name, error) {\n\tif branch == \"\" && commitOrTag == \"\" && ref == \"\" {\n\t\treturn nil, nil\n\t}\n\tif branch != \"\" && commitOrTag != \"\" {\n\t\t// already did this in getRawRef but just in case\n\t\treturn nil, NewCannotSpecifyGitBranchAndCommitOrTagError()\n\t}\n\tif ref != \"\" && commitOrTag != \"\" {\n\t\t// already did this in getRawRef but just in case\n\t\treturn nil, NewCannotSpecifyCommitOrTagWithRefError()\n\t}\n\tif ref != \"\" && branch != \"\" {\n\t\treturn git.NewRefNameWithBranch(ref, branch), nil\n\t}\n\tif ref != \"\" {\n\t\treturn git.NewRefName(ref), nil\n\t}\n\tif branch != \"\" {\n\t\treturn git.NewBranchName(branch), nil\n\t}\n\treturn git.NewTagName(commitOrTag), nil\n}\n\nfunc getProtoFileRef(rawRef *RawRef) (ParsedProtoFileRef, error) {\n\treturn newProtoFileRef(\n\t\trawRef.Format,\n\t\trawRef.Path,\n\t\trawRef.IncludePackageFiles,\n\t)\n}\n\n// options\n\ntype singleFormatInfo struct {\n\tdefaultCompressionType CompressionType\n\tcustomOptionKeys       map[string]struct{}\n}\n\nfunc newSingleFormatInfo() *singleFormatInfo {\n\treturn &singleFormatInfo{\n\t\tdefaultCompressionType: CompressionTypeNone,\n\t\tcustomOptionKeys:       make(map[string]struct{}),\n\t}\n}\n\ntype archiveFormatInfo struct {\n\tarchiveType            ArchiveType\n\tdefaultCompressionType CompressionType\n}\n\nfunc newArchiveFormatInfo(archiveType ArchiveType) *archiveFormatInfo {\n\treturn &archiveFormatInfo{\n\t\tarchiveType:            archiveType,\n\t\tdefaultCompressionType: CompressionTypeNone,\n\t}\n}\n\ntype dirFormatInfo struct{}\n\nfunc newDirFormatInfo() *dirFormatInfo {\n\treturn &dirFormatInfo{}\n}\n\ntype gitFormatInfo struct{}\n\nfunc newGitFormatInfo() *gitFormatInfo {\n\treturn &gitFormatInfo{}\n}\n\ntype moduleFormatInfo struct{}\n\nfunc newModuleFormatInfo() *moduleFormatInfo {\n\treturn &moduleFormatInfo{}\n}\n\ntype getParsedRefOptions struct {\n\tallowedFormats map[string]struct{}\n}\n\ntype protoFileFormatInfo struct{}\n\nfunc newProtoFileFormatInfo() *protoFileFormatInfo {\n\treturn &protoFileFormatInfo{}\n}\n\nfunc newGetParsedRefOptions() *getParsedRefOptions {\n\treturn &getParsedRefOptions{\n\t\tallowedFormats: make(map[string]struct{}),\n\t}\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/ref_parser_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestGetRawPathAndOptionsError(t *testing.T) {\n\tt.Parallel()\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewValueEmptyError(),\n\t\t\"\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewValueMultipleHashtagsError(\"foo#format=git#branch=main\"),\n\t\t\"foo#format=git#branch=main\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewValueStartsWithHashtagError(\"#path/to/dir\"),\n\t\t\"#path/to/dir\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewValueEndsWithHashtagError(\"path/to/dir#\"),\n\t\t\"path/to/dir#\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewOptionsDuplicateKeyError(\"branch\"),\n\t\t\"path/to/foo#format=git,branch=foo,branch=bar\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewOptionsInvalidError(\"bar\"),\n\t\t\"path/to/foo#bar\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewOptionsInvalidError(\"bar=\"),\n\t\t\"path/to/foo#bar=\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewOptionsInvalidError(\"format=bin,bar=\"),\n\t\t\"path/to/foo#format=bin,bar=\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewOptionsInvalidError(\"format=bin,=bar\"),\n\t\t\"path/to/foo#format=bin,=bar\",\n\t)\n\ttestGetRawPathAndOptionsError(\n\t\tt,\n\t\tnewOptionsDuplicateKeyError(\"strip_components\"),\n\t\t\"path/to/foo.tar#strip_components=0,strip_components=1\",\n\t)\n}\n\nfunc testGetRawPathAndOptionsError(\n\tt *testing.T,\n\texpectedErr error,\n\tvalue string,\n) {\n\tt.Run(value, func(t *testing.T) {\n\t\tt.Parallel()\n\t\t_, _, err := getRawPathAndOptions(value)\n\t\tassert.EqualError(t, err, expectedErr.Error())\n\t})\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/single_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\nvar (\n\t_ ParsedSingleRef = &singleRef{}\n\n\tfileSchemePrefixToFileScheme = map[string]FileScheme{\n\t\t\"http://\":  FileSchemeHTTP,\n\t\t\"https://\": FileSchemeHTTPS,\n\t\t\"file://\":  FileSchemeLocal,\n\t}\n)\n\ntype singleRef struct {\n\tformat          string\n\tpath            string\n\tfileScheme      FileScheme\n\tcompressionType CompressionType\n\tcustomOptions   map[string]string\n}\n\nfunc newSingleRef(\n\tformat string,\n\tpath string,\n\tcompressionType CompressionType,\n\tcustomOptions map[string]string,\n) (*singleRef, error) {\n\tif path == \"\" {\n\t\treturn nil, NewNoPathError()\n\t}\n\tif app.IsDevStderr(path) {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\tif path == \"-\" {\n\t\treturn newDirectSingleRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeStdio,\n\t\t\tcompressionType,\n\t\t\tcustomOptions,\n\t\t), nil\n\t}\n\tif app.IsDevStdin(path) {\n\t\treturn newDirectSingleRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeStdin,\n\t\t\tcompressionType,\n\t\t\tcustomOptions,\n\t\t), nil\n\t}\n\tif app.IsDevStdout(path) {\n\t\treturn newDirectSingleRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeStdout,\n\t\t\tcompressionType,\n\t\t\tcustomOptions,\n\t\t), nil\n\t}\n\tif app.IsDevNull(path) {\n\t\treturn newDirectSingleRef(\n\t\t\tformat,\n\t\t\t\"\",\n\t\t\tFileSchemeNull,\n\t\t\tcompressionType,\n\t\t\tcustomOptions,\n\t\t), nil\n\t}\n\tfor prefix, fileScheme := range fileSchemePrefixToFileScheme {\n\t\tif after, ok := strings.CutPrefix(path, prefix); ok {\n\t\t\tpath = after\n\t\t\tif fileScheme == FileSchemeLocal {\n\t\t\t\tpath = normalpath.Normalize(path)\n\t\t\t}\n\t\t\tif path == \"\" {\n\t\t\t\treturn nil, NewNoPathError()\n\t\t\t}\n\t\t\treturn newDirectSingleRef(\n\t\t\t\tformat,\n\t\t\t\tpath,\n\t\t\t\tfileScheme,\n\t\t\t\tcompressionType,\n\t\t\t\tcustomOptions,\n\t\t\t), nil\n\t\t}\n\t}\n\tif strings.Contains(path, \"://\") {\n\t\treturn nil, NewInvalidPathError(format, path)\n\t}\n\treturn newDirectSingleRef(\n\t\tformat,\n\t\tnormalpath.Normalize(path),\n\t\tFileSchemeLocal,\n\t\tcompressionType,\n\t\tcustomOptions,\n\t), nil\n}\n\nfunc newDirectSingleRef(\n\tformat string,\n\tpath string,\n\tfileScheme FileScheme,\n\tcompressionType CompressionType,\n\tcustomOptions map[string]string,\n) *singleRef {\n\tif customOptions == nil {\n\t\tcustomOptions = make(map[string]string)\n\t}\n\treturn &singleRef{\n\t\tformat:          format,\n\t\tpath:            path,\n\t\tfileScheme:      fileScheme,\n\t\tcompressionType: compressionType,\n\t\tcustomOptions:   customOptions,\n\t}\n}\n\nfunc (r *singleRef) Format() string {\n\treturn r.format\n}\n\nfunc (r *singleRef) Path() string {\n\treturn r.path\n}\n\nfunc (r *singleRef) FileScheme() FileScheme {\n\treturn r.fileScheme\n}\n\nfunc (r *singleRef) CompressionType() CompressionType {\n\treturn r.compressionType\n}\n\nfunc (r *singleRef) CustomOptionValue(key string) (string, bool) {\n\tvalue, ok := r.customOptions[key]\n\treturn value, ok\n}\n\nfunc (*singleRef) ref()       {}\nfunc (*singleRef) fileRef()   {}\nfunc (*singleRef) singleRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/internal/testdata/bufyaml/one/two/three/buf.work.yaml",
    "content": ""
  },
  {
    "path": "private/buf/buffetch/internal/testdata/bufyaml/one/two/three/four/five/buf.yaml",
    "content": ""
  },
  {
    "path": "private/buf/buffetch/internal/testdata/bufyaml/one/two/three/four/five/proto/foo.proto",
    "content": ""
  },
  {
    "path": "private/buf/buffetch/internal/testdata/direndsinproto.proto/empty",
    "content": ""
  },
  {
    "path": "private/buf/buffetch/internal/testdata/nobufyaml/one/two/three/buf.work.yaml",
    "content": ""
  },
  {
    "path": "private/buf/buffetch/internal/testdata/nobufyaml/one/two/three/four/five/proto/foo.proto",
    "content": ""
  },
  {
    "path": "private/buf/buffetch/internal/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage internal\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/buffetch/internal/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc normalizeFormat(format string) string {\n\treturn strings.ToLower(strings.TrimSpace(format))\n}\n\nfunc formatsToString(formats map[string]struct{}) string {\n\tif len(formats) == 0 {\n\t\treturn \"[]\"\n\t}\n\ts := make([]string, 0, len(formats))\n\tfor format := range formats {\n\t\ts = append(s, format)\n\t}\n\tsort.Strings(s)\n\treturn \"[\" + strings.Join(s, \",\") + \"]\"\n}\n"
  },
  {
    "path": "private/buf/buffetch/internal/writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"compress/gzip\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"os\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xio\"\n\t\"github.com/klauspost/compress/zstd\"\n)\n\ntype writer struct {\n\tlogger *slog.Logger\n\n\t// never set for now (no corresponding option)\n\thttpEnabled  bool\n\tlocalEnabled bool\n\tstdioEnabled bool\n}\n\nfunc newWriter(\n\tlogger *slog.Logger,\n\toptions ...WriterOption,\n) *writer {\n\twriter := &writer{\n\t\tlogger: logger,\n\t}\n\tfor _, option := range options {\n\t\toption(writer)\n\t}\n\treturn writer\n}\n\nfunc (w *writer) PutFile(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tfileRef FileRef,\n\toptions ...PutFileOption,\n) (io.WriteCloser, error) {\n\tputFileOptions := newPutFileOptions()\n\tfor _, option := range options {\n\t\toption(putFileOptions)\n\t}\n\tswitch t := fileRef.(type) {\n\tcase SingleRef:\n\t\treturn w.putSingle(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tputFileOptions.noFileCompression,\n\t\t)\n\tcase ArchiveRef:\n\t\treturn w.putArchiveFile(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\tt,\n\t\t\tputFileOptions.noFileCompression,\n\t\t)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown FileRef type: %T\", fileRef)\n\t}\n}\n\nfunc (w *writer) putSingle(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tsingleRef SingleRef,\n\tnoFileCompression bool,\n) (io.WriteCloser, error) {\n\treturn w.putFileWriteCloser(ctx, container, singleRef, noFileCompression)\n}\n\nfunc (w *writer) putArchiveFile(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tarchiveRef ArchiveRef,\n\tnoFileCompression bool,\n) (io.WriteCloser, error) {\n\treturn w.putFileWriteCloser(ctx, container, archiveRef, noFileCompression)\n}\n\nfunc (w *writer) putFileWriteCloser(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tfileRef FileRef,\n\tnoFileCompression bool,\n) (_ io.WriteCloser, retErr error) {\n\twriteCloser, err := w.putFileWriteCloserPotentiallyUncompressed(ctx, container, fileRef)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = errors.Join(retErr, writeCloser.Close())\n\t\t}\n\t}()\n\tif noFileCompression {\n\t\treturn writeCloser, nil\n\t}\n\tswitch compressionType := fileRef.CompressionType(); compressionType {\n\tcase CompressionTypeNone:\n\t\treturn writeCloser, nil\n\tcase CompressionTypeGzip:\n\t\tgzipWriteCloser := gzip.NewWriter(writeCloser)\n\t\treturn xio.CompositeWriteCloser(\n\t\t\tgzipWriteCloser,\n\t\t\txio.ChainCloser(\n\t\t\t\tgzipWriteCloser,\n\t\t\t\twriteCloser,\n\t\t\t),\n\t\t), nil\n\tcase CompressionTypeZstd:\n\t\tzstdWriteCloser, err := zstd.NewWriter(writeCloser)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn xio.CompositeWriteCloser(\n\t\t\tzstdWriteCloser,\n\t\t\txio.ChainCloser(\n\t\t\t\tzstdWriteCloser,\n\t\t\t\twriteCloser,\n\t\t\t),\n\t\t), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown CompressionType: %v\", compressionType)\n\t}\n}\n\nfunc (w *writer) putFileWriteCloserPotentiallyUncompressed(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tfileRef FileRef,\n) (io.WriteCloser, error) {\n\tswitch fileScheme := fileRef.FileScheme(); fileScheme {\n\tcase FileSchemeHTTP:\n\t\tif !w.httpEnabled {\n\t\t\treturn nil, NewWriteHTTPDisabledError()\n\t\t}\n\t\treturn nil, fmt.Errorf(\"http not supported for writes: %v\", fileRef.Path())\n\tcase FileSchemeHTTPS:\n\t\tif !w.httpEnabled {\n\t\t\treturn nil, NewWriteHTTPDisabledError()\n\t\t}\n\t\treturn nil, fmt.Errorf(\"https not supported for writes: %v\", fileRef.Path())\n\tcase FileSchemeLocal:\n\t\tif !w.localEnabled {\n\t\t\treturn nil, NewWriteLocalDisabledError()\n\t\t}\n\t\treturn os.Create(fileRef.Path())\n\tcase FileSchemeStdio, FileSchemeStdout:\n\t\tif !w.stdioEnabled {\n\t\t\treturn nil, NewWriteStdioDisabledError()\n\t\t}\n\t\treturn xio.NopWriteCloser(container.Stdout()), nil\n\tcase FileSchemeStdin:\n\t\treturn nil, errors.New(\"cannot write to stdin\")\n\tcase FileSchemeNull:\n\t\treturn xio.DiscardWriteCloser, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown FileScheme: %v\", fileScheme)\n\t}\n}\n\ntype putFileOptions struct {\n\tnoFileCompression bool\n}\n\nfunc newPutFileOptions() *putFileOptions {\n\treturn &putFileOptions{}\n}\n"
  },
  {
    "path": "private/buf/buffetch/message_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\nvar _ MessageRef = &messageRef{}\n\ntype messageRef struct {\n\tsingleRef       internal.SingleRef\n\tuseProtoNames   bool\n\tuseEnumNumbers  bool\n\tmessageEncoding MessageEncoding\n}\n\nfunc newMessageRef(\n\tsingleRef internal.SingleRef,\n\tmessageEncoding MessageEncoding,\n) (*messageRef, error) {\n\tuseProtoNames, err := getTrueOrFalseForSingleRef(singleRef, useProtoNamesKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tuseEnumNumbers, err := getTrueOrFalseForSingleRef(singleRef, useEnumNumbersKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &messageRef{\n\t\tsingleRef:       singleRef,\n\t\tuseProtoNames:   useProtoNames,\n\t\tuseEnumNumbers:  useEnumNumbers,\n\t\tmessageEncoding: messageEncoding,\n\t}, nil\n}\n\nfunc (r *messageRef) MessageEncoding() MessageEncoding {\n\treturn r.messageEncoding\n}\n\nfunc (r *messageRef) Path() string {\n\treturn r.singleRef.Path()\n}\n\nfunc (r *messageRef) UseProtoNames() bool {\n\treturn r.useProtoNames\n}\n\nfunc (r *messageRef) UseEnumNumbers() bool {\n\treturn r.useEnumNumbers\n}\n\nfunc (r *messageRef) IsNull() bool {\n\treturn r.singleRef.FileScheme() == internal.FileSchemeNull\n}\n\nfunc (r *messageRef) internalRef() internal.Ref {\n\treturn r.singleRef\n}\n\nfunc (r *messageRef) internalSingleRef() internal.SingleRef {\n\treturn r.singleRef\n}\n\nfunc getTrueOrFalseForSingleRef(singleRef internal.SingleRef, key string) (bool, error) {\n\tvalue, ok := singleRef.CustomOptionValue(key)\n\tif !ok {\n\t\treturn false, nil\n\t}\n\tswitch value {\n\tcase \"true\":\n\t\treturn true, nil\n\tcase \"false\":\n\t\treturn false, nil\n\tdefault:\n\t\treturn false, internal.NewOptionsInvalidValueForKeyError(key, value)\n\t}\n}\n"
  },
  {
    "path": "private/buf/buffetch/module_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\nvar _ ModuleRef = &moduleRef{}\n\ntype moduleRef struct {\n\tiModuleRef internal.ModuleRef\n}\n\nfunc newModuleRef(iModuleRef internal.ModuleRef) *moduleRef {\n\treturn &moduleRef{\n\t\tiModuleRef: iModuleRef,\n\t}\n}\n\nfunc (r *moduleRef) internalRef() internal.Ref {\n\treturn r.iModuleRef\n}\n\nfunc (r *moduleRef) internalModuleRef() internal.ModuleRef {\n\treturn r.iModuleRef\n}\n\nfunc (*moduleRef) isSourceOrModuleRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/proto_file_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\nvar _ ProtoFileRef = &protoFileRef{}\n\ntype protoFileRef struct {\n\tprotoFileRef internal.ProtoFileRef\n}\n\nfunc newProtoFileRef(internalProtoFileRef internal.ProtoFileRef) *protoFileRef {\n\treturn &protoFileRef{\n\t\tprotoFileRef: internalProtoFileRef,\n\t}\n}\n\nfunc (r *protoFileRef) ProtoFilePath() string {\n\treturn r.protoFileRef.Path()\n}\n\nfunc (r *protoFileRef) IncludePackageFiles() bool {\n\treturn r.protoFileRef.IncludePackageFiles()\n}\n\nfunc (r *protoFileRef) IsDevPath() bool {\n\tswitch r.protoFileRef.FileScheme() {\n\tcase internal.FileSchemeStdio,\n\t\tinternal.FileSchemeStdin,\n\t\tinternal.FileSchemeStdout,\n\t\tinternal.FileSchemeNull:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (r *protoFileRef) internalRef() internal.Ref {\n\treturn r.protoFileRef\n}\n\nfunc (r *protoFileRef) internalBucketRef() internal.BucketRef {\n\treturn r.protoFileRef\n}\n\nfunc (r *protoFileRef) internalProtoFileRef() internal.ProtoFileRef {\n\treturn r.protoFileRef\n}\n\nfunc (*protoFileRef) isSourceOrModuleRef() {}\n\nfunc (*protoFileRef) isDirOrProtoFileRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/proto_file_writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\ntype protoFileWriter struct {\n\tinternalProtoFileWriter internal.ProtoFileWriter\n}\n\nfunc newProtoFileWriter(\n\tlogger *slog.Logger,\n) *protoFileWriter {\n\treturn &protoFileWriter{\n\t\tinternalProtoFileWriter: internal.NewProtoFileWriter(\n\t\t\tlogger,\n\t\t),\n\t}\n}\n\nfunc (w *protoFileWriter) PutProtoFile(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tprotoFileRef ProtoFileRef,\n) (io.WriteCloser, error) {\n\treturn w.internalProtoFileWriter.PutProtoFile(ctx, container, protoFileRef.internalProtoFileRef())\n}\n"
  },
  {
    "path": "private/buf/buffetch/reader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log/slog\"\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\ntype reader struct {\n\tinternalReader internal.Reader\n}\n\nfunc newReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n\thttpAuthenticator httpauth.Authenticator,\n\tgitCloner git.Cloner,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n) *reader {\n\treturn &reader{\n\t\tinternalReader: internal.NewReader(\n\t\t\tlogger,\n\t\t\tstorageosProvider,\n\t\t\tinternal.WithReaderHTTP(\n\t\t\t\thttpClient,\n\t\t\t\thttpAuthenticator,\n\t\t\t),\n\t\t\tinternal.WithReaderGit(\n\t\t\t\tgitCloner,\n\t\t\t),\n\t\t\tinternal.WithReaderLocal(),\n\t\t\tinternal.WithReaderStdio(),\n\t\t\tinternal.WithReaderModule(\n\t\t\t\tmoduleKeyProvider,\n\t\t\t),\n\t\t),\n\t}\n}\n\nfunc newMessageReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n\thttpAuthenticator httpauth.Authenticator,\n\tgitCloner git.Cloner,\n) *reader {\n\treturn &reader{\n\t\tinternalReader: internal.NewReader(\n\t\t\tlogger,\n\t\t\tstorageosProvider,\n\t\t\tinternal.WithReaderHTTP(\n\t\t\t\thttpClient,\n\t\t\t\thttpAuthenticator,\n\t\t\t),\n\t\t\tinternal.WithReaderLocal(),\n\t\t\tinternal.WithReaderStdio(),\n\t\t),\n\t}\n}\n\nfunc newSourceReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n\thttpAuthenticator httpauth.Authenticator,\n\tgitCloner git.Cloner,\n) *reader {\n\treturn &reader{\n\t\tinternalReader: internal.NewReader(\n\t\t\tlogger,\n\t\t\tstorageosProvider,\n\t\t\tinternal.WithReaderHTTP(\n\t\t\t\thttpClient,\n\t\t\t\thttpAuthenticator,\n\t\t\t),\n\t\t\tinternal.WithReaderGit(\n\t\t\t\tgitCloner,\n\t\t\t),\n\t\t\tinternal.WithReaderLocal(),\n\t\t\tinternal.WithReaderStdio(),\n\t\t),\n\t}\n}\n\nfunc newDirReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n) *reader {\n\treturn &reader{\n\t\tinternalReader: internal.NewReader(\n\t\t\tlogger,\n\t\t\tstorageosProvider,\n\t\t\tinternal.WithReaderLocal(),\n\t\t),\n\t}\n}\n\nfunc newModuleFetcher(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n) *reader {\n\treturn &reader{\n\t\tinternalReader: internal.NewReader(\n\t\t\tlogger,\n\t\t\tstorageosProvider,\n\t\t\tinternal.WithReaderModule(\n\t\t\t\tmoduleKeyProvider,\n\t\t\t),\n\t\t),\n\t}\n}\n\nfunc (a *reader) GetMessageFile(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tmessageRef MessageRef,\n) (io.ReadCloser, error) {\n\treturn a.internalReader.GetFile(ctx, container, messageRef.internalSingleRef())\n}\n\nfunc (a *reader) GetSourceReadBucketCloser(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tsourceRef SourceRef,\n\toptions ...GetReadBucketCloserOption,\n) (ReadBucketCloser, buftarget.BucketTargeting, error) {\n\tgetReadBucketCloserOptions := newGetReadBucketCloserOptions()\n\tfor _, option := range options {\n\t\toption(getReadBucketCloserOptions)\n\t}\n\tvar internalGetReadBucketCloserOptions []internal.GetReadBucketCloserOption\n\tif !getReadBucketCloserOptions.noSearch {\n\t\tinternalGetReadBucketCloserOptions = append(\n\t\t\tinternalGetReadBucketCloserOptions,\n\t\t\tinternal.WithGetReadBucketCloserTerminateFunc(buftarget.TerminateAtControllingWorkspace),\n\t\t)\n\t}\n\tif getReadBucketCloserOptions.copyToInMemory {\n\t\tinternalGetReadBucketCloserOptions = append(\n\t\t\tinternalGetReadBucketCloserOptions,\n\t\t\tinternal.WithGetReadBucketCloserCopyToInMemory(),\n\t\t)\n\t}\n\tinternalGetReadBucketCloserOptions = append(\n\t\tinternalGetReadBucketCloserOptions,\n\t\tinternal.WithGetReadBucketCloserTargetPaths(getReadBucketCloserOptions.targetPaths),\n\t)\n\tinternalGetReadBucketCloserOptions = append(\n\t\tinternalGetReadBucketCloserOptions,\n\t\tinternal.WithGetReadBucketCloserTargetExcludePaths(getReadBucketCloserOptions.targetExcludePaths),\n\t)\n\treturn a.internalReader.GetReadBucketCloser(\n\t\tctx,\n\t\tcontainer,\n\t\tsourceRef.internalBucketRef(),\n\t\tinternalGetReadBucketCloserOptions...,\n\t)\n}\n\nfunc (a *reader) GetDirReadWriteBucket(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tdirRef DirRef,\n\toptions ...GetReadWriteBucketOption,\n) (ReadWriteBucket, buftarget.BucketTargeting, error) {\n\tgetReadWriteBucketOptions := newGetReadWriteBucketOptions()\n\tfor _, option := range options {\n\t\toption(getReadWriteBucketOptions)\n\t}\n\tvar internalGetReadWriteBucketOptions []internal.GetReadWriteBucketOption\n\tif !getReadWriteBucketOptions.noSearch {\n\t\tinternalGetReadWriteBucketOptions = append(\n\t\t\tinternalGetReadWriteBucketOptions,\n\t\t\tinternal.WithGetReadWriteBucketTerminateFunc(buftarget.TerminateAtControllingWorkspace),\n\t\t)\n\t}\n\tinternalGetReadWriteBucketOptions = append(\n\t\tinternalGetReadWriteBucketOptions,\n\t\tinternal.WithGetReadWriteBucketTargetPaths(getReadWriteBucketOptions.targetPaths),\n\t)\n\tinternalGetReadWriteBucketOptions = append(\n\t\tinternalGetReadWriteBucketOptions,\n\t\tinternal.WithGetReadWriteBucketTargetExcludePaths(getReadWriteBucketOptions.targetExcludePaths),\n\t)\n\treturn a.internalReader.GetReadWriteBucket(\n\t\tctx,\n\t\tcontainer,\n\t\tdirRef.internalDirRef(),\n\t\tinternalGetReadWriteBucketOptions...,\n\t)\n}\n\nfunc (a *reader) GetModuleKey(\n\tctx context.Context,\n\tcontainer app.EnvStdinContainer,\n\tmoduleRef ModuleRef,\n) (bufmodule.ModuleKey, error) {\n\treturn a.internalReader.GetModuleKey(ctx, container, moduleRef.internalModuleRef())\n}\n"
  },
  {
    "path": "private/buf/buffetch/ref_parser.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\ntype refParser struct {\n\tlogger         *slog.Logger\n\tfetchRefParser internal.RefParser\n}\n\nfunc newRefParser(logger *slog.Logger) *refParser {\n\treturn &refParser{\n\t\tlogger: logger,\n\t\tfetchRefParser: internal.NewRefParser(\n\t\t\tlogger,\n\t\t\tinternal.WithRawRefProcessor(processRawRef),\n\t\t\tinternal.WithSingleFormat(formatBin),\n\t\t\tinternal.WithSingleFormat(formatBinpb),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatJSON,\n\t\t\t\tinternal.WithSingleCustomOptionKey(useProtoNamesKey),\n\t\t\t\tinternal.WithSingleCustomOptionKey(useEnumNumbersKey),\n\t\t\t),\n\t\t\tinternal.WithSingleFormat(formatTxtpb),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatYAML,\n\t\t\t\tinternal.WithSingleCustomOptionKey(useProtoNamesKey),\n\t\t\t\tinternal.WithSingleCustomOptionKey(useEnumNumbersKey),\n\t\t\t),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatBingz,\n\t\t\t\tinternal.WithSingleDefaultCompressionType(\n\t\t\t\t\tinternal.CompressionTypeGzip,\n\t\t\t\t),\n\t\t\t),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatJSONGZ,\n\t\t\t\tinternal.WithSingleDefaultCompressionType(\n\t\t\t\t\tinternal.CompressionTypeGzip,\n\t\t\t\t),\n\t\t\t),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatTar,\n\t\t\t\tinternal.ArchiveTypeTar,\n\t\t\t),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatTargz,\n\t\t\t\tinternal.ArchiveTypeTar,\n\t\t\t\tinternal.WithArchiveDefaultCompressionType(\n\t\t\t\t\tinternal.CompressionTypeGzip,\n\t\t\t\t),\n\t\t\t),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatZip,\n\t\t\t\tinternal.ArchiveTypeZip,\n\t\t\t),\n\t\t\tinternal.WithGitFormat(formatGit),\n\t\t\tinternal.WithDirFormat(formatDir),\n\t\t\tinternal.WithModuleFormat(formatMod),\n\t\t\tinternal.WithProtoFileFormat(formatProtoFile),\n\t\t),\n\t}\n}\n\nfunc newMessageRefParser(logger *slog.Logger, options ...MessageRefParserOption) *refParser {\n\tmessageRefParserOptions := newMessageRefParserOptions()\n\tfor _, option := range options {\n\t\toption(messageRefParserOptions)\n\t}\n\treturn &refParser{\n\t\tlogger: logger,\n\t\tfetchRefParser: internal.NewRefParser(\n\t\t\tlogger,\n\t\t\tinternal.WithRawRefProcessor(newProcessRawRefMessage(messageRefParserOptions.defaultMessageEncoding)),\n\t\t\tinternal.WithSingleFormat(formatBin),\n\t\t\tinternal.WithSingleFormat(formatBinpb),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatJSON,\n\t\t\t\tinternal.WithSingleCustomOptionKey(useProtoNamesKey),\n\t\t\t\tinternal.WithSingleCustomOptionKey(useEnumNumbersKey),\n\t\t\t),\n\t\t\tinternal.WithSingleFormat(formatTxtpb),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatYAML,\n\t\t\t\tinternal.WithSingleCustomOptionKey(useProtoNamesKey),\n\t\t\t\tinternal.WithSingleCustomOptionKey(useEnumNumbersKey),\n\t\t\t),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatBingz,\n\t\t\t\tinternal.WithSingleDefaultCompressionType(\n\t\t\t\t\tinternal.CompressionTypeGzip,\n\t\t\t\t),\n\t\t\t),\n\t\t\tinternal.WithSingleFormat(\n\t\t\t\tformatJSONGZ,\n\t\t\t\tinternal.WithSingleDefaultCompressionType(\n\t\t\t\t\tinternal.CompressionTypeGzip,\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\t}\n}\n\nfunc newSourceRefParser(logger *slog.Logger) *refParser {\n\treturn &refParser{\n\t\tlogger: logger,\n\t\tfetchRefParser: internal.NewRefParser(\n\t\t\tlogger,\n\t\t\tinternal.WithRawRefProcessor(processRawRefSource),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatTar,\n\t\t\t\tinternal.ArchiveTypeTar,\n\t\t\t),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatTargz,\n\t\t\t\tinternal.ArchiveTypeTar,\n\t\t\t\tinternal.WithArchiveDefaultCompressionType(\n\t\t\t\t\tinternal.CompressionTypeGzip,\n\t\t\t\t),\n\t\t\t),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatZip,\n\t\t\t\tinternal.ArchiveTypeZip,\n\t\t\t),\n\t\t\tinternal.WithGitFormat(formatGit),\n\t\t\tinternal.WithDirFormat(formatDir),\n\t\t\tinternal.WithProtoFileFormat(formatProtoFile),\n\t\t),\n\t}\n}\n\nfunc newDirRefParser(logger *slog.Logger) *refParser {\n\treturn &refParser{\n\t\tlogger: logger,\n\t\tfetchRefParser: internal.NewRefParser(\n\t\t\tlogger,\n\t\t\tinternal.WithRawRefProcessor(processRawRefDir),\n\t\t\tinternal.WithDirFormat(formatDir),\n\t\t),\n\t}\n}\n\nfunc newDirOrProtoFileRefParser(logger *slog.Logger) *refParser {\n\treturn &refParser{\n\t\tlogger: logger,\n\t\tfetchRefParser: internal.NewRefParser(\n\t\t\tlogger,\n\t\t\tinternal.WithRawRefProcessor(processRawRefDirOrProtoFile),\n\t\t\tinternal.WithDirFormat(formatDir),\n\t\t\tinternal.WithProtoFileFormat(formatProtoFile),\n\t\t),\n\t}\n}\n\nfunc newModuleRefParser(logger *slog.Logger) *refParser {\n\treturn &refParser{\n\t\tlogger: logger,\n\t\tfetchRefParser: internal.NewRefParser(\n\t\t\tlogger,\n\t\t\tinternal.WithRawRefProcessor(processRawRefModule),\n\t\t\tinternal.WithModuleFormat(formatMod),\n\t\t),\n\t}\n}\n\nfunc newSourceOrModuleRefParser(logger *slog.Logger) *refParser {\n\treturn &refParser{\n\t\tlogger: logger,\n\t\tfetchRefParser: internal.NewRefParser(\n\t\t\tlogger,\n\t\t\tinternal.WithRawRefProcessor(processRawRefSourceOrModule),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatTar,\n\t\t\t\tinternal.ArchiveTypeTar,\n\t\t\t),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatTargz,\n\t\t\t\tinternal.ArchiveTypeTar,\n\t\t\t\tinternal.WithArchiveDefaultCompressionType(\n\t\t\t\t\tinternal.CompressionTypeGzip,\n\t\t\t\t),\n\t\t\t),\n\t\t\tinternal.WithArchiveFormat(\n\t\t\t\tformatZip,\n\t\t\t\tinternal.ArchiveTypeZip,\n\t\t\t),\n\t\t\tinternal.WithGitFormat(formatGit),\n\t\t\tinternal.WithDirFormat(formatDir),\n\t\t\tinternal.WithModuleFormat(formatMod),\n\t\t\tinternal.WithProtoFileFormat(formatProtoFile),\n\t\t),\n\t}\n}\n\nfunc (a *refParser) GetRef(\n\tctx context.Context,\n\tvalue string,\n) (Ref, error) {\n\tparsedRef, err := a.getParsedRef(ctx, value, allFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := parsedRef.(type) {\n\tcase internal.ParsedSingleRef:\n\t\tmessageEncoding, err := parseMessageEncoding(t.Format())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newMessageRef(t, messageEncoding)\n\tcase internal.ParsedArchiveRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedDirRef:\n\t\treturn newDirRef(t), nil\n\tcase internal.ParsedGitRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedModuleRef:\n\t\treturn newModuleRef(t), nil\n\tcase internal.ProtoFileRef:\n\t\treturn newProtoFileRef(t), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown ParsedRef type: %T\", parsedRef)\n\t}\n}\n\nfunc (a *refParser) GetRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n) (Ref, error) {\n\tparsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, allFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := parsedRef.(type) {\n\tcase internal.ParsedSingleRef:\n\t\tmessageEncoding, err := parseMessageEncoding(t.Format())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newMessageRef(t, messageEncoding)\n\tcase internal.ParsedArchiveRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedDirRef:\n\t\treturn newDirRef(t), nil\n\tcase internal.ParsedGitRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedModuleRef:\n\t\treturn newModuleRef(t), nil\n\tcase internal.ProtoFileRef:\n\t\treturn newProtoFileRef(t), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown ParsedRef type: %T\", parsedRef)\n\t}\n}\n\nfunc (a *refParser) GetSourceOrModuleRef(\n\tctx context.Context,\n\tvalue string,\n) (SourceOrModuleRef, error) {\n\tparsedRef, err := a.getParsedRef(ctx, value, sourceOrModuleFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := parsedRef.(type) {\n\tcase internal.ParsedSingleRef:\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source or module: %T\", parsedRef)\n\tcase internal.ParsedArchiveRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedDirRef:\n\t\treturn newDirRef(t), nil\n\tcase internal.ParsedGitRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedModuleRef:\n\t\treturn newModuleRef(t), nil\n\tcase internal.ProtoFileRef:\n\t\treturn newProtoFileRef(t), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown ParsedRef type: %T\", parsedRef)\n\t}\n}\n\nfunc (a *refParser) GetSourceOrModuleRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n) (SourceOrModuleRef, error) {\n\tparsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, sourceOrModuleFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := parsedRef.(type) {\n\tcase internal.ParsedSingleRef:\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source or module: %T\", parsedRef)\n\tcase internal.ParsedArchiveRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedDirRef:\n\t\treturn newDirRef(t), nil\n\tcase internal.ParsedGitRef:\n\t\treturn newSourceRef(t), nil\n\tcase internal.ParsedModuleRef:\n\t\treturn newModuleRef(t), nil\n\tcase internal.ProtoFileRef:\n\t\treturn newProtoFileRef(t), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown ParsedRef type: %T\", parsedRef)\n\t}\n}\n\nfunc (a *refParser) GetMessageRef(\n\tctx context.Context,\n\tvalue string,\n) (MessageRef, error) {\n\tparsedRef, err := a.getParsedRef(ctx, value, messageFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedSingleRef, ok := parsedRef.(internal.ParsedSingleRef)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for message: %T\", parsedRef)\n\t}\n\tmessageEncoding, err := parseMessageEncoding(parsedSingleRef.Format())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newMessageRef(parsedSingleRef, messageEncoding)\n}\n\nfunc (a *refParser) GetMessageRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n) (MessageRef, error) {\n\tparsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, messageFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedSingleRef, ok := parsedRef.(internal.ParsedSingleRef)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for message: %T\", parsedRef)\n\t}\n\tmessageEncoding, err := parseMessageEncoding(parsedSingleRef.Format())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newMessageRef(parsedSingleRef, messageEncoding)\n}\n\nfunc (a *refParser) GetSourceRef(\n\tctx context.Context,\n\tvalue string,\n) (SourceRef, error) {\n\tparsedRef, err := a.getParsedRef(ctx, value, sourceFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedBucketRef, ok := parsedRef.(internal.ParsedBucketRef)\n\tif !ok {\n\t\t// this should never happen\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source: %T\", parsedRef)\n\t}\n\treturn newSourceRef(parsedBucketRef), nil\n}\n\nfunc (a *refParser) GetSourceRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n) (SourceRef, error) {\n\tparsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, sourceFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedBucketRef, ok := parsedRef.(internal.ParsedBucketRef)\n\tif !ok {\n\t\t// this should never happen\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source: %T\", parsedRef)\n\t}\n\treturn newSourceRef(parsedBucketRef), nil\n}\n\nfunc (a *refParser) GetDirRef(\n\tctx context.Context,\n\tvalue string,\n) (DirRef, error) {\n\tparsedRef, err := a.getParsedRef(ctx, value, dirFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedDirRef, ok := parsedRef.(internal.ParsedDirRef)\n\tif !ok {\n\t\t// this should never happen\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source: %T\", parsedRef)\n\t}\n\treturn newDirRef(parsedDirRef), nil\n}\n\nfunc (a *refParser) GetDirRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n) (DirRef, error) {\n\tparsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, dirFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedDirRef, ok := parsedRef.(internal.ParsedDirRef)\n\tif !ok {\n\t\t// this should never happen\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source: %T\", parsedRef)\n\t}\n\treturn newDirRef(parsedDirRef), nil\n}\n\nfunc (a *refParser) GetDirOrProtoFileRef(\n\tctx context.Context,\n\tvalue string,\n) (DirOrProtoFileRef, error) {\n\tparsedRef, err := a.getParsedRef(ctx, value, dirOrProtoFileFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := parsedRef.(type) {\n\tcase internal.ParsedDirRef:\n\t\treturn newDirRef(t), nil\n\tcase internal.ProtoFileRef:\n\t\treturn newProtoFileRef(t), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type: %T\", parsedRef)\n\t}\n}\n\nfunc (a *refParser) GetDirOrProtoFileRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n) (DirOrProtoFileRef, error) {\n\tparsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, dirOrProtoFileFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch t := parsedRef.(type) {\n\tcase internal.ParsedDirRef:\n\t\treturn newDirRef(t), nil\n\tcase internal.ProtoFileRef:\n\t\treturn newProtoFileRef(t), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type: %T\", parsedRef)\n\t}\n}\n\nfunc (a *refParser) GetModuleRef(\n\tctx context.Context,\n\tvalue string,\n) (ModuleRef, error) {\n\tparsedRef, err := a.getParsedRef(ctx, value, moduleFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedModuleRef, ok := parsedRef.(internal.ParsedModuleRef)\n\tif !ok {\n\t\t// this should never happen\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source: %T\", parsedRef)\n\t}\n\treturn newModuleRef(parsedModuleRef), nil\n}\n\nfunc (a *refParser) GetModuleRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n) (ModuleRef, error) {\n\tparsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, moduleFormats)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tparsedModuleRef, ok := parsedRef.(internal.ParsedModuleRef)\n\tif !ok {\n\t\t// this should never happen\n\t\treturn nil, fmt.Errorf(\"invalid ParsedRef type for source: %T\", parsedRef)\n\t}\n\treturn newModuleRef(parsedModuleRef), nil\n}\n\n// TODO FUTURE: rename to getParsedRefForString\nfunc (a *refParser) getParsedRef(\n\tctx context.Context,\n\tvalue string,\n\tallowedFormats []string,\n) (internal.ParsedRef, error) {\n\tparsedRef, err := a.fetchRefParser.GetParsedRef(\n\t\tctx,\n\t\tvalue,\n\t\tinternal.WithAllowedFormats(allowedFormats...),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ta.checkDeprecated(parsedRef)\n\treturn parsedRef, nil\n}\n\nfunc (a *refParser) getParsedRefForInputConfig(\n\tctx context.Context,\n\tinputConfig bufconfig.InputConfig,\n\tallowedFormats []string,\n) (internal.ParsedRef, error) {\n\tparsedRef, err := a.fetchRefParser.GetParsedRefForInputConfig(\n\t\tctx,\n\t\tinputConfig,\n\t\tinternal.WithAllowedFormats(allowedFormats...),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ta.checkDeprecated(parsedRef)\n\treturn parsedRef, nil\n}\n\nfunc (a *refParser) checkDeprecated(parsedRef internal.ParsedRef) {\n\tformat := parsedRef.Format()\n\tif replacementFormat, ok := deprecatedCompressionFormatToReplacementFormat[format]; ok {\n\t\ta.logger.Warn(fmt.Sprintf(\n\t\t\t`Format %q is deprecated. Use \"format=%s,compression=gzip\" instead. This will continue to work forever, but updating is recommended.`,\n\t\t\tformat,\n\t\t\treplacementFormat,\n\t\t))\n\t}\n}\n\nfunc processRawRef(rawRef *internal.RawRef) error {\n\t// if format option is not set and path is \"-\", default to bin\n\tvar format string\n\tvar compressionType internal.CompressionType\n\tif rawRef.Path == \"-\" || app.IsDevPath(rawRef.Path) {\n\t\tformat = formatBinpb\n\t} else {\n\t\tswitch filepath.Ext(rawRef.Path) {\n\t\tcase \".bin\", \".binpb\":\n\t\t\tformat = formatBinpb\n\t\tcase \".json\":\n\t\t\tformat = formatJSON\n\t\tcase \".tar\":\n\t\t\tformat = formatTar\n\t\tcase \".txtpb\":\n\t\t\tformat = formatTxtpb\n\t\tcase \".yaml\":\n\t\t\tformat = formatYAML\n\t\tcase \".zip\":\n\t\t\tformat = formatZip\n\t\tcase \".gz\":\n\t\t\tcompressionType = internal.CompressionTypeGzip\n\t\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\t\tcase \".bin\", \".binpb\":\n\t\t\t\tformat = formatBinpb\n\t\t\tcase \".json\":\n\t\t\t\tformat = formatJSON\n\t\t\tcase \".tar\":\n\t\t\t\tformat = formatTar\n\t\t\tcase \".txtpb\":\n\t\t\t\tformat = formatTxtpb\n\t\t\tcase \".yaml\":\n\t\t\t\tformat = formatYAML\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"path %q had .gz extension with unknown format\", rawRef.Path)\n\t\t\t}\n\t\tcase \".zst\":\n\t\t\tcompressionType = internal.CompressionTypeZstd\n\t\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\t\tcase \".bin\", \".binpb\":\n\t\t\t\tformat = formatBinpb\n\t\t\tcase \".json\":\n\t\t\t\tformat = formatJSON\n\t\t\tcase \".tar\":\n\t\t\t\tformat = formatTar\n\t\t\tcase \".txtpb\":\n\t\t\t\tformat = formatTxtpb\n\t\t\tcase \".yaml\":\n\t\t\t\tformat = formatYAML\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(\"path %q had .zst extension with unknown format\", rawRef.Path)\n\t\t\t}\n\t\tcase \".tgz\":\n\t\t\tformat = formatTar\n\t\t\tcompressionType = internal.CompressionTypeGzip\n\t\tcase \".git\":\n\t\t\tformat = formatGit\n\t\tcase \".proto\":\n\t\t\tfileInfo, err := os.Stat(rawRef.Path)\n\t\t\tif err == nil && fileInfo.IsDir() {\n\t\t\t\tformat = formatDir\n\t\t\t} else {\n\t\t\t\tformat = formatProtoFile\n\t\t\t}\n\t\tdefault:\n\t\t\tvar err error\n\t\t\tformat, err = assumeModuleOrDir(rawRef.Path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\trawRef.Format = format\n\trawRef.CompressionType = compressionType\n\treturn nil\n}\n\nfunc processRawRefSource(rawRef *internal.RawRef) error {\n\tvar format string\n\tvar compressionType internal.CompressionType\n\tswitch filepath.Ext(rawRef.Path) {\n\tcase \".tar\":\n\t\tformat = formatTar\n\tcase \".zip\":\n\t\tformat = formatZip\n\tcase \".gz\":\n\t\tcompressionType = internal.CompressionTypeGzip\n\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\tcase \".tar\":\n\t\t\tformat = formatTar\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"path %q had .gz extension with unknown format\", rawRef.Path)\n\t\t}\n\tcase \".zst\":\n\t\tcompressionType = internal.CompressionTypeZstd\n\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\tcase \".tar\":\n\t\t\tformat = formatTar\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"path %q had .zst extension with unknown format\", rawRef.Path)\n\t\t}\n\tcase \".tgz\":\n\t\tformat = formatTar\n\t\tcompressionType = internal.CompressionTypeGzip\n\tcase \".git\":\n\t\tformat = formatGit\n\tcase \".proto\":\n\t\tfileInfo, err := os.Stat(rawRef.Path)\n\t\tif err == nil && fileInfo.IsDir() {\n\t\t\tformat = formatDir\n\t\t} else {\n\t\t\tformat = formatProtoFile\n\t\t}\n\tdefault:\n\t\tformat = formatDir\n\t}\n\trawRef.Format = format\n\trawRef.CompressionType = compressionType\n\treturn nil\n}\n\nfunc processRawRefDir(rawRef *internal.RawRef) error {\n\trawRef.Format = formatDir\n\treturn nil\n}\n\nfunc processRawRefDirOrProtoFile(rawRef *internal.RawRef) error {\n\tvar format string\n\tif rawRef.Path == \"-\" || app.IsDevPath(rawRef.Path) {\n\t\tformat = formatProtoFile\n\t} else {\n\t\tswitch filepath.Ext(rawRef.Path) {\n\t\tcase \".proto\":\n\t\t\tfileInfo, err := os.Stat(rawRef.Path)\n\t\t\tif err == nil && fileInfo.IsDir() {\n\t\t\t\tformat = formatDir\n\t\t\t} else {\n\t\t\t\tformat = formatProtoFile\n\t\t\t}\n\t\tdefault:\n\t\t\tvar err error\n\t\t\tformat, err = assumeModuleOrDir(rawRef.Path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif format == formatMod {\n\t\t\t\treturn ErrModuleFormatDetectedForDirOrProtoFileRef\n\t\t\t}\n\t\t}\n\t}\n\trawRef.Format = format\n\treturn nil\n}\n\nfunc processRawRefSourceOrModule(rawRef *internal.RawRef) error {\n\tvar format string\n\tvar compressionType internal.CompressionType\n\tswitch filepath.Ext(rawRef.Path) {\n\tcase \".tar\":\n\t\tformat = formatTar\n\tcase \".zip\":\n\t\tformat = formatZip\n\tcase \".gz\":\n\t\tcompressionType = internal.CompressionTypeGzip\n\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\tcase \".tar\":\n\t\t\tformat = formatTar\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"path %q had .gz extension with unknown format\", rawRef.Path)\n\t\t}\n\tcase \".zst\":\n\t\tcompressionType = internal.CompressionTypeZstd\n\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\tcase \".tar\":\n\t\t\tformat = formatTar\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"path %q had .zst extension with unknown format\", rawRef.Path)\n\t\t}\n\tcase \".tgz\":\n\t\tformat = formatTar\n\t\tcompressionType = internal.CompressionTypeGzip\n\tcase \".git\":\n\t\tformat = formatGit\n\tcase \".proto\":\n\t\tfileInfo, err := os.Stat(rawRef.Path)\n\t\tif err != nil && !os.IsNotExist(err) {\n\t\t\treturn fmt.Errorf(\"path provided is not a valid proto file: %s, %w\", rawRef.Path, err)\n\t\t}\n\t\tif fileInfo != nil && fileInfo.IsDir() {\n\t\t\treturn fmt.Errorf(\"path provided is not a valid proto file: a directory named %s already exists\", rawRef.Path)\n\t\t}\n\t\tformat = formatProtoFile\n\tdefault:\n\t\tvar err error\n\t\tformat, err = assumeModuleOrDir(rawRef.Path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\trawRef.Format = format\n\trawRef.CompressionType = compressionType\n\treturn nil\n}\n\nfunc newProcessRawRefMessage(defaultMessageEncoding MessageEncoding) func(*internal.RawRef) error {\n\treturn func(rawRef *internal.RawRef) error {\n\t\tdefaultFormat, ok := messageEncodingToFormat[defaultMessageEncoding]\n\t\tif !ok {\n\t\t\t// This is a system error.\n\t\t\treturn syserror.Newf(\"unknown MessageEncoding: %v\", defaultMessageEncoding)\n\t\t}\n\t\t// if format option is not set and path is \"-\", default to bin\n\t\tvar format string\n\t\tvar compressionType internal.CompressionType\n\t\tif rawRef.Path == \"-\" || app.IsDevNull(rawRef.Path) || app.IsDevStdin(rawRef.Path) || app.IsDevStdout(rawRef.Path) {\n\t\t\tformat = defaultFormat\n\t\t} else {\n\t\t\tswitch filepath.Ext(rawRef.Path) {\n\t\t\tcase \".bin\", \".binpb\":\n\t\t\t\tformat = formatBinpb\n\t\t\tcase \".json\":\n\t\t\t\tformat = formatJSON\n\t\t\tcase \".txtpb\":\n\t\t\t\tformat = formatTxtpb\n\t\t\tcase \".yaml\":\n\t\t\t\tformat = formatYAML\n\t\t\tcase \".gz\":\n\t\t\t\tcompressionType = internal.CompressionTypeGzip\n\t\t\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\t\t\tcase \".bin\", \".binpb\":\n\t\t\t\t\tformat = formatBinpb\n\t\t\t\tcase \".json\":\n\t\t\t\t\tformat = formatJSON\n\t\t\t\tcase \".txtpb\":\n\t\t\t\t\tformat = formatTxtpb\n\t\t\t\tcase \".yaml\":\n\t\t\t\t\tformat = formatYAML\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"path %q had .gz extension with unknown format\", rawRef.Path)\n\t\t\t\t}\n\t\t\tcase \".zst\":\n\t\t\t\tcompressionType = internal.CompressionTypeZstd\n\t\t\t\tswitch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) {\n\t\t\t\tcase \".bin\", \".binpb\":\n\t\t\t\t\tformat = formatBinpb\n\t\t\t\tcase \".json\":\n\t\t\t\t\tformat = formatJSON\n\t\t\t\tcase \".txtpb\":\n\t\t\t\t\tformat = formatTxtpb\n\t\t\t\tcase \".yaml\":\n\t\t\t\t\tformat = formatYAML\n\t\t\t\tdefault:\n\t\t\t\t\treturn fmt.Errorf(\"path %q had .zst extension with unknown format\", rawRef.Path)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tformat = defaultFormat\n\t\t\t}\n\t\t}\n\t\trawRef.Format = format\n\t\trawRef.CompressionType = compressionType\n\t\treturn nil\n\t}\n}\n\nfunc processRawRefModule(rawRef *internal.RawRef) error {\n\trawRef.Format = formatMod\n\treturn nil\n}\n\nfunc parseMessageEncoding(format string) (MessageEncoding, error) {\n\tswitch format {\n\tcase formatBin, formatBinpb, formatBingz:\n\t\treturn MessageEncodingBinpb, nil\n\tcase formatJSON, formatJSONGZ:\n\t\treturn MessageEncodingJSON, nil\n\tcase formatTxtpb:\n\t\treturn MessageEncodingTxtpb, nil\n\tcase formatYAML:\n\t\treturn MessageEncodingYAML, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid format for message: %q\", format)\n\t}\n}\n\n// TODO FUTURE: this is a terrible heuristic, and we shouldn't be using what amounts\n// to heuristics here (technically this is a documentable rule, but still)\nfunc assumeModuleOrDir(path string) (string, error) {\n\tif path == \"\" {\n\t\treturn \"\", errors.New(\"assumeModuleOrDir: no path given\")\n\t}\n\tif _, err := bufparse.ParseRef(path); err == nil {\n\t\t// this is possible to be a module, check if it is a directory though\n\t\t// OK to use os.Stat instead of os.Lstat here\n\t\tfileInfo, err := os.Stat(path)\n\t\tif err == nil && fileInfo.IsDir() {\n\t\t\t// if we have a directory, assume this is a directory\n\t\t\treturn formatDir, nil\n\t\t}\n\t\t// not a directory, assume module\n\t\treturn formatMod, nil\n\t}\n\t// cannot be parsed into a module, assume dir for here\n\treturn formatDir, nil\n}\n\ntype messageRefParserOptions struct {\n\tdefaultMessageEncoding MessageEncoding\n}\n\nfunc newMessageRefParserOptions() *messageRefParserOptions {\n\treturn &messageRefParserOptions{\n\t\tdefaultMessageEncoding: MessageEncodingBinpb,\n\t}\n}\n"
  },
  {
    "path": "private/buf/buffetch/ref_parser_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// TODO FUTURE: test ref from input config as well.\nfunc TestGetParsedRefSuccess(t *testing.T) {\n\tt.Parallel()\n\t// This allows us to test an os-agnostic root directory\n\troot, err := filepath.Abs(\"/\")\n\trequire.NoError(t, err)\n\n\t// This lets us test an os-agnostic absolute path\n\tabsPath, err := filepath.Abs(\"/foo/bar/..\")\n\trequire.NoError(t, err)\n\texpectedAbsDir, err := filepath.Abs(\"/foo\")\n\trequire.NoError(t, err)\n\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\t\"path/to/some/dir\",\n\t\t),\n\t\t\"path/to/some/dir\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\t\".\",\n\t\t),\n\t\t\".\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\tnormalpath.Normalize(root),\n\t\t),\n\t\troot,\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\t\".\",\n\t\t),\n\t\t\"foo/..\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\t\"../foo\",\n\t\t),\n\t\t\"../foo\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\tnormalpath.Normalize(expectedAbsDir),\n\t\t),\n\t\tabsPath,\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tar\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"/path/to/file.tar\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"file:///path/to/file.tar\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tar#strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tar.gz\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tar.gz#strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tgz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tgz\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tgz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tgz#strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar\",\n\t\t\tinternal.FileSchemeHTTP,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"http://path/to/file.tar\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar\",\n\t\t\tinternal.FileSchemeHTTPS,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"https://path/to/file.tar\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatZip,\n\t\t\t\"path/to/file.zip\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeZip,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.zip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatZip,\n\t\t\t\"/path/to/file.zip\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeZip,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"file:///path/to/file.zip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatZip,\n\t\t\t\"path/to/file.zip\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeZip,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.zip#strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tnil,\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir.git\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tnil,\n\t\t\tfalse,\n\t\t\t40,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir.git#depth=40\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir.git#branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"/path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"file:///path/to/dir.git#branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewTagName(\"v1.0.0\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir.git#tag=v1.0.0\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"hello.com/path/to/dir.git\",\n\t\t\tinternal.GitSchemeHTTP,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"http://hello.com/path/to/dir.git#branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"hello.com/path/to/dir.git\",\n\t\t\tinternal.GitSchemeHTTPS,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"https://hello.com/path/to/dir.git#branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"user@hello.com:path/to/dir.git\",\n\t\t\tinternal.GitSchemeSSH,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"ssh://user@hello.com:path/to/dir.git#branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"user@hello.com:path/to/dir.git\",\n\t\t\tinternal.GitSchemeSSH,\n\t\t\tgit.NewRefName(\"refs/remotes/origin/HEAD\"),\n\t\t\tfalse,\n\t\t\t50,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"user@hello.com:path/to/dir.git\",\n\t\t\tinternal.GitSchemeSSH,\n\t\t\tgit.NewRefNameWithBranch(\"refs/remotes/origin/HEAD\", \"main\"),\n\t\t\tfalse,\n\t\t\t50,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD,branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"user@hello.com:path/to/dir.git\",\n\t\t\tinternal.GitSchemeSSH,\n\t\t\tgit.NewRefName(\"refs/remotes/origin/HEAD\"),\n\t\t\tfalse,\n\t\t\t10,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD,depth=10\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"user@hello.com:path/to/dir.git\",\n\t\t\tinternal.GitSchemeSSH,\n\t\t\tgit.NewRefNameWithBranch(\"refs/remotes/origin/HEAD\", \"main\"),\n\t\t\tfalse,\n\t\t\t10,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"ssh://user@hello.com:path/to/dir.git#ref=refs/remotes/origin/HEAD,branch=main,depth=10\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tnil,\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"foo/bar\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir.git#subdir=foo/bar\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tnil,\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir.git#subdir=.\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tnil,\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir.git#subdir=foo/..\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"user@hello.com:path/to/dir.git\",\n\t\t\tinternal.GitSchemeGit,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"git://user@hello.com:path/to/dir.git#branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeGit,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"git://path/to/dir.git#branch=main\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir.git\",\n\t\t\tinternal.GitSchemeGit,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"subdir\",\n\t\t\t\"tree:0\",\n\t\t),\n\t\t\"git://path/to/dir.git#branch=main,filter=tree:0,subdir=subdir\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/file.bin\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.bin\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/file.bin.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.bin.gz\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/file.binpb\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.binpb\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/file.binpb.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.binpb.gz\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatJSON,\n\t\t\t\"path/to/file.json\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.json\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatJSON,\n\t\t\t\"path/to/file.json.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.json.gz\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatJSON,\n\t\t\t\"path/to/file.json.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.json.gz#compression=none\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatJSON,\n\t\t\t\"path/to/file.json.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.json.gz#compression=gzip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatTxtpb,\n\t\t\t\"path/to/file.txtpb\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.txtpb\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatTxtpb,\n\t\t\t\"path/to/file.txtpb.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.txtpb.gz\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatTxtpb,\n\t\t\t\"path/to/file.txtpb.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.txtpb.gz#compression=none\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatTxtpb,\n\t\t\t\"path/to/file.txtpb.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.txtpb.gz#compression=gzip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatYAML,\n\t\t\t\"path/to/file.yaml\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.yaml\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatYAML,\n\t\t\t\"path/to/file.yaml.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.yaml.gz\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatYAML,\n\t\t\t\"path/to/file.yaml.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.yaml.gz#compression=none\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatYAML,\n\t\t\t\"path/to/file.yaml.gz\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.yaml.gz#compression=gzip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatYAML,\n\t\t\t\"path/to/file.yaml\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tmap[string]string{\n\t\t\t\t\"use_proto_names\": \"true\",\n\t\t\t},\n\t\t),\n\t\t\"path/to/file.yaml#use_proto_names=true\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewOptionsInvalidKeysError(\"use_something_else\"),\n\t\t\"path/to/file.yaml#use_something_else=true\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatJSON,\n\t\t\t\"path/to/file.json\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tmap[string]string{\n\t\t\t\t\"use_proto_names\": \"true\",\n\t\t\t},\n\t\t),\n\t\t\"path/to/file.json#use_proto_names=true\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewOptionsInvalidKeysError(\"use_something_else\"),\n\t\t\"path/to/file.json#use_something_else=true\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdio,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"-\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatJSON,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdio,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"-#format=json\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatTxtpb,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdio,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"-#format=txtpb\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatYAML,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdio,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"-#format=yaml\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeNull,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\tapp.DevNullFilePath,\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBin,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/dir#format=bin\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBin,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/dir#format=bin,compression=none\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBin,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/dir#format=bin,compression=gzip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/dir#format=binpb\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/dir#format=binpb,compression=none\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/dir#format=binpb,compression=gzip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"/path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewBranchName(\"main\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"/path/to/dir#branch=main,format=git\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"/path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewBranchName(\"main/foo\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"/path/to/dir#format=git,branch=main/foo\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewTagName(\"main/foo\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir#tag=main/foo,format=git\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewTagName(\"main/foo\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir#format=git,tag=main/foo\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewTagName(\"main/foo\"),\n\t\t\ttrue,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir#format=git,tag=main/foo,recurse_submodules=true\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewTagName(\"main/foo\"),\n\t\t\tfalse,\n\t\t\t1,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir#format=git,tag=main/foo,recurse_submodules=false\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewRefName(\"refs/remotes/origin/HEAD\"),\n\t\t\tfalse,\n\t\t\t50,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir#format=git,ref=refs/remotes/origin/HEAD\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedGitRef(\n\t\t\tformatGit,\n\t\t\t\"path/to/dir\",\n\t\t\tinternal.GitSchemeLocal,\n\t\t\tgit.NewRefName(\"refs/remotes/origin/HEAD\"),\n\t\t\tfalse,\n\t\t\t10,\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/dir#format=git,ref=refs/remotes/origin/HEAD,depth=10\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTargz,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file#format=targz,strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file#format=tar,strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file#format=tar,strip_components=1,compression=none\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeGzip,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file#format=tar,strip_components=1,compression=gzip\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatZip,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeZip,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file#format=zip,strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar.zst\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\t0,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tar.zst\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar.zst\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file.tar.zst#strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatZip,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeZip,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\t1,\n\t\t\t\"\",\n\t\t),\n\t\t\"path/to/file#format=zip,strip_components=1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file.tar.zst\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\t0,\n\t\t\t\"foo/bar\",\n\t\t),\n\t\t\"path/to/file.tar.zst#subdir=foo/bar\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedArchiveRef(\n\t\t\tformatTar,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.ArchiveTypeTar,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\t1,\n\t\t\t\"foo/bar\",\n\t\t),\n\t\t\"path/to/file#format=tar,strip_components=1,compression=zstd,subdir=foo/bar\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBin,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file#format=bin,compression=zstd\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/file.bin.zst\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.bin.zst\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/file\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file#format=binpb,compression=zstd\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"path/to/file.binpb.zst\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tinternal.CompressionTypeZstd,\n\t\t\tnil,\n\t\t),\n\t\t\"path/to/file.binpb.zst\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedModuleRef(\n\t\t\tformatMod,\n\t\t\ttestNewModuleRef(\n\t\t\t\tt,\n\t\t\t\t\"example.com\",\n\t\t\t\t\"foob\",\n\t\t\t\t\"bar\",\n\t\t\t\t\"v1\",\n\t\t\t),\n\t\t),\n\t\t\"example.com/foob/bar:v1\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedModuleRef(\n\t\t\tformatMod,\n\t\t\ttestNewModuleRef(\n\t\t\t\tt,\n\t\t\t\t\"example.com\",\n\t\t\t\t\"foob\",\n\t\t\t\t\"bar\",\n\t\t\t\t\"12345\",\n\t\t\t),\n\t\t),\n\t\t\"example.com/foob/bar:12345\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"github.com/path/to/file.bin\",\n\t\t\tinternal.FileSchemeHTTPS,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"https://github.com/path/to/file.bin\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBin,\n\t\t\t\"github.com/path/to/file.ext\",\n\t\t\tinternal.FileSchemeHTTPS,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"https://github.com/path/to/file.ext#format=bin\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBin,\n\t\t\t\"gitlab.com/api/v4/projects/foo/packages/generic/proto/0.0.1/proto.bin?private_token=bar\",\n\t\t\tinternal.FileSchemeHTTPS,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"https://gitlab.com/api/v4/projects/foo/packages/generic/proto/0.0.1/proto.bin?private_token=bar#format=bin\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"github.com/path/to/file.binpb\",\n\t\t\tinternal.FileSchemeHTTPS,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"https://github.com/path/to/file.binpb\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"github.com/path/to/file.ext\",\n\t\t\tinternal.FileSchemeHTTPS,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"https://github.com/path/to/file.ext#format=binpb\",\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"gitlab.com/api/v4/projects/foo/packages/generic/proto/0.0.1/proto.binpb?private_token=bar\",\n\t\t\tinternal.FileSchemeHTTPS,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\t\"https://gitlab.com/api/v4/projects/foo/packages/generic/proto/0.0.1/proto.binpb?private_token=bar#format=binpb\",\n\t)\n\ttestGetParsedDirOrProtoFileRef(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\t\"foo\",\n\t\t),\n\t\tnil,\n\t\t\"foo\",\n\t)\n\ttestGetParsedDirOrProtoFileRef(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\t\"internal/testdata/direndsinproto.proto\",\n\t\t),\n\t\tnil,\n\t\t\"internal/testdata/direndsinproto.proto\",\n\t)\n\ttestGetParsedDirOrProtoFileRef(\n\t\tt,\n\t\tinternal.NewDirectParsedProtoFileRef(\n\t\t\tformatProtoFile,\n\t\t\t\"foo.proto\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\tfalse,\n\t\t),\n\t\tnil,\n\t\t\"foo.proto\",\n\t)\n\ttestGetParsedDirOrProtoFileRef(\n\t\tt,\n\t\tinternal.NewDirectParsedDirRef(\n\t\t\tformatDir,\n\t\t\t\"foo.proto\",\n\t\t),\n\t\tnil,\n\t\t\"foo.proto#format=dir\",\n\t)\n\ttestGetParsedDirOrProtoFileRef(\n\t\tt,\n\t\tinternal.NewDirectParsedProtoFileRef(\n\t\t\tformatProtoFile,\n\t\t\t\"foo.proto\",\n\t\t\tinternal.FileSchemeLocal,\n\t\t\ttrue,\n\t\t),\n\t\tnil,\n\t\t\"foo.proto#include_package_files=true\",\n\t)\n\ttestGetParsedDirOrProtoFileRef(\n\t\tt,\n\t\tinternal.NewDirectParsedProtoFileRef(\n\t\t\tformatProtoFile,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdio,\n\t\t\tfalse,\n\t\t),\n\t\tnil,\n\t\t\"-\",\n\t)\n\ttestGetParsedDirOrProtoFileRef(\n\t\tt,\n\t\tinternal.NewDirectParsedProtoFileRef(\n\t\t\tformatProtoFile,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdio,\n\t\t\ttrue,\n\t\t),\n\t\tnil,\n\t\t\"-#include_package_files=true\",\n\t)\n}\n\nfunc TestGetParsedRefError(t *testing.T) {\n\tt.Parallel()\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewInvalidPathError(formatDir, \"-\"),\n\t\t\"-#format=dir\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewInvalidPathError(formatGit, \"-\"),\n\t\t\"-#format=git,branch=main\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyGitBranchAndCommitOrTagError(),\n\t\t\"path/to/foo#format=git,branch=foo,tag=bar\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyGitBranchAndCommitOrTagError(),\n\t\t\"path/to/foo#format=git,branch=foo,tag=bar,ref=baz\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyCommitOrTagWithRefError(),\n\t\t\"path/to/foo#format=git,tag=foo,ref=bar\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewDepthParseError(\"bar\"),\n\t\t\"path/to/foo#format=git,depth=bar\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewDepthZeroError(),\n\t\t\"path/to/foo#format=git,ref=foor,depth=0\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewPathUnknownGzError(\"path/to/foo.gz\"),\n\t\t\"path/to/foo.gz\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewPathUnknownGzError(\"path/to/foo.bar.gz\"),\n\t\t\"path/to/foo.bar.gz\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewFormatOverrideNotAllowedForDevNullError(app.DevNullFilePath),\n\t\tfmt.Sprintf(\"%s#format=bin\", app.DevNullFilePath),\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewFormatUnknownError(\"bar\"),\n\t\t\"path/to/foo#format=bar\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewOptionsCouldNotParseStripComponentsError(\"foo\"),\n\t\t\"path/to/foo.tar.gz#strip_components=foo\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCompressionUnknownError(\"foo\"),\n\t\t\"path/to/foo.tar.gz#compression=foo\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewOptionsInvalidKeysError(\"foo\"),\n\t\t\"path/to/foo.tar.gz#foo=bar\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewOptionsInvalidForFormatError(formatTar, \"path/to/foo.tar.gz#branch=main\", \"git options set\"),\n\t\t\"path/to/foo.tar.gz#branch=main\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewOptionsInvalidForFormatError(formatDir, \"path/to/some/foo#strip_components=1\", \"archive options set\"),\n\t\t\"path/to/some/foo#strip_components=1\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewOptionsInvalidForFormatError(formatDir, \"path/to/some/foo#compression=none\", \"compression set\"),\n\t\t\"path/to/some/foo#compression=none\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyCompressionForZipError(),\n\t\t\"path/to/foo.zip#compression=none\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyCompressionForZipError(),\n\t\t\"path/to/foo.zip#compression=gzip\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyCompressionForZipError(),\n\t\t\"path/to/foo#format=zip,compression=none\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyCompressionForZipError(),\n\t\t\"path/to/foo#format=zip,compression=gzip\",\n\t)\n\ttestGetParsedRefError(\n\t\tt,\n\t\tinternal.NewCannotSpecifyCompressionForZipError(),\n\t\t\"path/to/foo#format=zip,compression=gzip\",\n\t)\n}\n\nfunc testGetParsedRefSuccess(\n\tt *testing.T,\n\texpectedRef internal.ParsedRef,\n\tvalue string,\n) {\n\ttestGetParsedRef(\n\t\tt,\n\t\texpectedRef,\n\t\tnil,\n\t\tvalue,\n\t)\n}\n\nfunc testGetParsedRefError(\n\tt *testing.T,\n\texpectedErr error,\n\tvalue string,\n) {\n\ttestGetParsedRef(\n\t\tt,\n\t\tnil,\n\t\texpectedErr,\n\t\tvalue,\n\t)\n}\n\nfunc testGetParsedRef(\n\tt *testing.T,\n\texpectedParsedRef internal.ParsedRef,\n\texpectedErr error,\n\tvalue string,\n) {\n\tparsedRef, err := newRefParser(slogtestext.NewLogger(t)).getParsedRef(\n\t\tt.Context(),\n\t\tvalue,\n\t\tallFormats,\n\t)\n\tif expectedErr != nil {\n\t\tif err == nil {\n\t\t\tassert.Equal(t, nil, parsedRef, \"expected error\")\n\t\t} else {\n\t\t\tassert.Equal(t, expectedErr, err)\n\t\t}\n\t} else {\n\t\tassert.NoError(t, err)\n\t\tif err == nil {\n\t\t\tassert.Equal(t, expectedParsedRef, parsedRef)\n\t\t}\n\t}\n}\n\nfunc testGetParsedDirOrProtoFileRef(\n\tt *testing.T,\n\texpectedParsedRef internal.ParsedRef,\n\texpectedErr error,\n\tvalue string,\n) {\n\tparsedRef, err := newDirOrProtoFileRefParser(slogtestext.NewLogger(t)).getParsedRef(\n\t\tt.Context(),\n\t\tvalue,\n\t\tdirOrProtoFileFormats,\n\t)\n\tif expectedErr != nil {\n\t\tif err == nil {\n\t\t\tassert.Equal(t, nil, parsedRef, \"expected error\")\n\t\t} else {\n\t\t\tassert.Equal(t, expectedErr, err)\n\t\t}\n\t} else {\n\t\tassert.NoError(t, err)\n\t\tif err == nil {\n\t\t\tassert.Equal(t, expectedParsedRef, parsedRef)\n\t\t}\n\t}\n}\n\nfunc testNewModuleRef(\n\tt *testing.T,\n\tregistry string,\n\towner string,\n\tname string,\n\tref string,\n) bufparse.Ref {\n\tmoduleRef, err := bufparse.NewRef(registry, owner, name, ref)\n\trequire.NoError(t, err)\n\treturn moduleRef\n}\n"
  },
  {
    "path": "private/buf/buffetch/ref_parser_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage buffetch\n\nimport (\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\nfunc TestGetParsedRefSuccess_UnixOnly(t *testing.T) {\n\tt.Parallel()\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdin,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\tapp.DevStdinFilePath,\n\t)\n\ttestGetParsedRefSuccess(\n\t\tt,\n\t\tinternal.NewDirectParsedSingleRef(\n\t\t\tformatBinpb,\n\t\t\t\"\",\n\t\t\tinternal.FileSchemeStdout,\n\t\t\tinternal.CompressionTypeNone,\n\t\t\tnil,\n\t\t),\n\t\tapp.DevStdoutFilePath,\n\t)\n}\n"
  },
  {
    "path": "private/buf/buffetch/source_ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\nvar _ SourceRef = &sourceRef{}\n\ntype sourceRef struct {\n\tbucketRef internal.BucketRef\n}\n\nfunc newSourceRef(bucketRef internal.BucketRef) *sourceRef {\n\treturn &sourceRef{\n\t\tbucketRef: bucketRef,\n\t}\n}\n\nfunc (r *sourceRef) internalRef() internal.Ref {\n\treturn r.bucketRef\n}\n\nfunc (r *sourceRef) internalBucketRef() internal.BucketRef {\n\treturn r.bucketRef\n}\n\nfunc (*sourceRef) isSourceOrModuleRef() {}\n"
  },
  {
    "path": "private/buf/buffetch/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage buffetch\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/buffetch/writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buffetch\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/buf/buffetch/internal\"\n)\n\ntype writer struct {\n\tinternalWriter internal.Writer\n}\n\nfunc newWriter(\n\tlogger *slog.Logger,\n) *writer {\n\treturn &writer{\n\t\tinternalWriter: internal.NewWriter(\n\t\t\tlogger,\n\t\t\tinternal.WithWriterLocal(),\n\t\t\tinternal.WithWriterStdio(),\n\t\t),\n\t}\n}\n\nfunc (w *writer) PutMessageFile(\n\tctx context.Context,\n\tcontainer app.EnvStdoutContainer,\n\tmessageRef MessageRef,\n) (io.WriteCloser, error) {\n\treturn w.internalWriter.PutFile(ctx, container, messageRef.internalSingleRef())\n}\n"
  },
  {
    "path": "private/buf/bufformat/bufformat.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufformat\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"sync/atomic\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n\t\"github.com/bufbuild/protocompile/ast\"\n\t\"github.com/bufbuild/protocompile/parser\"\n\t\"github.com/bufbuild/protocompile/reporter\"\n)\n\n// FormatOption is an option for formatting.\ntype FormatOption func(*formatOptions)\n\n// formatOptions contains options for formatting.\ntype formatOptions struct {\n\tdeprecatePrefixes []string\n}\n\n// WithDeprecate adds a deprecation prefix. All types whose fully-qualified name\n// starts with this prefix will have the deprecated option added to them.\n// For fields and enum values, only exact matches are deprecated.\nfunc WithDeprecate(fqnPrefix string) FormatOption {\n\treturn func(opts *formatOptions) {\n\t\topts.deprecatePrefixes = append(opts.deprecatePrefixes, fqnPrefix)\n\t}\n}\n\n// FormatModuleSet formats and writes the target files into a read bucket.\nfunc FormatModuleSet(ctx context.Context, moduleSet bufmodule.ModuleSet, opts ...FormatOption) (_ storage.ReadBucket, retErr error) {\n\treturn FormatBucket(\n\t\tctx,\n\t\tbufmodule.ModuleReadBucketToStorageReadBucket(\n\t\t\tbufmodule.ModuleReadBucketWithOnlyTargetFiles(\n\t\t\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFilesForTargetModules(moduleSet),\n\t\t\t),\n\t\t),\n\t\topts...,\n\t)\n}\n\n// FormatBucket formats the .proto files in the bucket and returns a new bucket with the formatted files.\n// If WithDeprecate options are provided but no types match the prefixes, an error is returned.\nfunc FormatBucket(ctx context.Context, bucket storage.ReadBucket, opts ...FormatOption) (_ storage.ReadBucket, retErr error) {\n\toptions := &formatOptions{}\n\tfor _, opt := range opts {\n\t\topt(options)\n\t}\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\tpaths, err := storage.AllPaths(ctx, storage.FilterReadBucket(bucket, storage.MatchPathExt(\".proto\")), \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Track if any deprecation prefix matched across all files.\n\tvar deprecationMatched atomic.Bool\n\tjobs := make([]func(context.Context) error, len(paths))\n\tfor i, path := range paths {\n\t\tjobs[i] = func(ctx context.Context) (retErr error) {\n\t\t\treadObjectCloser, err := bucket.Get(ctx, path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer func() {\n\t\t\t\tretErr = errors.Join(retErr, readObjectCloser.Close())\n\t\t\t}()\n\t\t\tfileNode, err := parser.Parse(readObjectCloser.ExternalPath(), readObjectCloser, reporter.NewHandler(nil))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\twriteObjectCloser, err := readWriteBucket.Put(ctx, path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer func() {\n\t\t\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t\t\t}()\n\t\t\tmatched, err := formatFileNodeWithMatch(writeObjectCloser, fileNode, options)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif matched {\n\t\t\t\tdeprecationMatched.Store(true)\n\t\t\t}\n\t\t\treturn writeObjectCloser.SetExternalPath(readObjectCloser.ExternalPath())\n\t\t}\n\t}\n\tif err := thread.Parallelize(ctx, jobs); err != nil {\n\t\treturn nil, err\n\t}\n\t// If deprecation was requested but nothing matched, return an error.\n\tif len(options.deprecatePrefixes) > 0 && !deprecationMatched.Load() {\n\t\treturn nil, fmt.Errorf(\"no types matched the specified deprecation prefixes\")\n\t}\n\treturn readWriteBucket, nil\n}\n\n// FormatFileNode formats the given file node and writes the result to dest.\nfunc FormatFileNode(dest io.Writer, fileNode *ast.FileNode) error {\n\treturn formatFileNode(dest, fileNode, &formatOptions{})\n}\n\n// formatFileNode formats the given file node with options and writes the result to dest.\nfunc formatFileNode(dest io.Writer, fileNode *ast.FileNode, options *formatOptions) error {\n\t_, err := formatFileNodeWithMatch(dest, fileNode, options)\n\treturn err\n}\n\n// formatFileNodeWithMatch formats the given file node and returns whether any deprecation prefix matched.\nfunc formatFileNodeWithMatch(dest io.Writer, fileNode *ast.FileNode, options *formatOptions) (bool, error) {\n\t// Construct the file descriptor to ensure the AST is valid. This will\n\t// capture unknown syntax like edition \"2024\" which at the current time is\n\t// not supported.\n\tif _, err := parser.ResultFromAST(fileNode, true, reporter.NewHandler(nil)); err != nil {\n\t\treturn false, err\n\t}\n\tformatter := newFormatter(dest, fileNode, options)\n\tif err := formatter.Run(); err != nil {\n\t\treturn false, err\n\t}\n\treturn formatter.deprecationMatched, nil\n}\n"
  },
  {
    "path": "private/buf/bufformat/deprecate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufformat\n\nimport (\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/protocompile/ast\"\n)\n\n// fullNameMatcher determines which types should have deprecated options added.\ntype fullNameMatcher struct {\n\tprefixes []string\n}\n\n// newFullNameMatcher creates a new matcher for the given FQN prefixes.\nfunc newFullNameMatcher(fqnPrefixes ...string) *fullNameMatcher {\n\treturn &fullNameMatcher{prefixes: fqnPrefixes}\n}\n\n// matchesPrefix returns true if the given FQN matches using prefix matching.\nfunc (d *fullNameMatcher) matchesPrefix(fqn string) bool {\n\tfor _, prefix := range d.prefixes {\n\t\tif fqnMatchesPrefix(fqn, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// matchesExact returns true if the given FQN matches exactly.\nfunc (d *fullNameMatcher) matchesExact(fqn string) bool {\n\treturn slices.Contains(d.prefixes, fqn)\n}\n\n// fqnMatchesPrefix returns true if fqn starts with prefix using component-based matching.\nfunc fqnMatchesPrefix(fqn, prefix string) bool {\n\tif len(prefix) > len(fqn) {\n\t\treturn false\n\t}\n\tif len(prefix) == len(fqn) {\n\t\treturn fqn == prefix\n\t}\n\treturn prefix == \"\" || strings.HasPrefix(fqn, prefix+\".\")\n}\n\n// hasDeprecatedOption checks if a slice of declarations contains a deprecated = true option.\nfunc hasDeprecatedOption[T any](decls []T) bool {\n\tfor _, decl := range decls {\n\t\tif opt, ok := any(decl).(*ast.OptionNode); ok && isDeprecatedOptionNode(opt) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// hasCompactDeprecatedOption checks if a CompactOptionsNode contains deprecated = true.\nfunc hasCompactDeprecatedOption(opts *ast.CompactOptionsNode) bool {\n\tif opts == nil {\n\t\treturn false\n\t}\n\treturn slices.ContainsFunc(opts.Options, isDeprecatedOptionNode)\n}\n\n// isDeprecatedOptionNode checks if an option node is \"deprecated = true\".\nfunc isDeprecatedOptionNode(opt *ast.OptionNode) bool {\n\tif opt.Name == nil || len(opt.Name.Parts) != 1 {\n\t\treturn false\n\t}\n\tpart := opt.Name.Parts[0]\n\tif part.Name == nil {\n\t\treturn false\n\t}\n\tvar name string\n\tswitch n := part.Name.(type) {\n\tcase *ast.IdentNode:\n\t\tname = n.Val\n\tdefault:\n\t\treturn false\n\t}\n\tif name != \"deprecated\" {\n\t\treturn false\n\t}\n\tif ident, ok := opt.Val.(*ast.IdentNode); ok {\n\t\treturn ident.Val == \"true\"\n\t}\n\treturn false\n}\n\n// packageNameToString extracts package name as a dot-separated string from an identifier node.\nfunc packageNameToString(name ast.IdentValueNode) string {\n\tswitch n := name.(type) {\n\tcase *ast.IdentNode:\n\t\treturn n.Val\n\tcase *ast.CompoundIdentNode:\n\t\tcomponents := make([]string, len(n.Components))\n\t\tfor i, comp := range n.Components {\n\t\t\tcomponents[i] = comp.Val\n\t\t}\n\t\treturn strings.Join(components, \".\")\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n\n// parentFQN returns the parent FQN by removing the last component.\n// For example, \"foo.bar.baz\" returns \"foo.bar\".\nfunc parentFQN(fqn string) string {\n\tif idx := strings.LastIndex(fqn, \".\"); idx >= 0 {\n\t\treturn fqn[:idx]\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "private/buf/bufformat/deprecate_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufformat\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestFQNMatchesPrefix(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tname     string\n\t\tfqn      string\n\t\tprefix   string\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\tname:     \"exact match\",\n\t\t\tfqn:      \"foo.bar.baz\",\n\t\t\tprefix:   \"foo.bar.baz\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"prefix match\",\n\t\t\tfqn:      \"foo.bar.baz\",\n\t\t\tprefix:   \"foo.bar\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"single component prefix\",\n\t\t\tfqn:      \"foo.bar.baz\",\n\t\t\tprefix:   \"foo\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"empty prefix matches all\",\n\t\t\tfqn:      \"foo.bar\",\n\t\t\tprefix:   \"\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"prefix longer than fqn\",\n\t\t\tfqn:      \"foo.bar\",\n\t\t\tprefix:   \"foo.bar.baz\",\n\t\t\texpected: false,\n\t\t},\n\t\t{\n\t\t\tname:     \"partial component mismatch - foo.bar.b does not match foo.bar.baz\",\n\t\t\tfqn:      \"foo.bar.baz\",\n\t\t\tprefix:   \"foo.bar.b\",\n\t\t\texpected: false,\n\t\t},\n\t\t{\n\t\t\tname:     \"different path\",\n\t\t\tfqn:      \"foo.bar.baz\",\n\t\t\tprefix:   \"foo.qux\",\n\t\t\texpected: false,\n\t\t},\n\t\t{\n\t\t\tname:     \"empty fqn\",\n\t\t\tfqn:      \"\",\n\t\t\tprefix:   \"foo\",\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tresult := fqnMatchesPrefix(tt.fqn, tt.prefix)\n\t\t\tassert.Equal(t, tt.expected, result)\n\t\t})\n\t}\n}\n\nfunc TestFullNameMatcherMatchesPrefix(t *testing.T) {\n\tt.Parallel()\n\tmatcher := newFullNameMatcher(\"foo.bar\", \"baz.qux\")\n\n\ttests := []struct {\n\t\tname     string\n\t\tfqn      string\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\tname:     \"matches first prefix\",\n\t\t\tfqn:      \"foo.bar.baz\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"matches second prefix\",\n\t\t\tfqn:      \"baz.qux.quux\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"exact match on prefix\",\n\t\t\tfqn:      \"foo.bar\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"no match\",\n\t\t\tfqn:      \"other.package\",\n\t\t\texpected: false,\n\t\t},\n\t\t{\n\t\t\tname:     \"partial component no match\",\n\t\t\tfqn:      \"foo.bart\",\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tresult := matcher.matchesPrefix(tt.fqn)\n\t\t\tassert.Equal(t, tt.expected, result)\n\t\t})\n\t}\n}\n\nfunc TestFullNameMatcherMatchesExact(t *testing.T) {\n\tt.Parallel()\n\tmatcher := newFullNameMatcher(\"foo.bar.baz.SomeMessage.some_field\")\n\n\ttests := []struct {\n\t\tname     string\n\t\tfqn      string\n\t\texpected bool\n\t}{\n\t\t{\n\t\t\tname:     \"exact match\",\n\t\t\tfqn:      \"foo.bar.baz.SomeMessage.some_field\",\n\t\t\texpected: true,\n\t\t},\n\t\t{\n\t\t\tname:     \"prefix only - not exact\",\n\t\t\tfqn:      \"foo.bar.baz.SomeMessage\",\n\t\t\texpected: false,\n\t\t},\n\t\t{\n\t\t\tname:     \"longer than prefix\",\n\t\t\tfqn:      \"foo.bar.baz.SomeMessage.some_field.extra\",\n\t\t\texpected: false,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tresult := matcher.matchesExact(tt.fqn)\n\t\t\tassert.Equal(t, tt.expected, result)\n\t\t})\n\t}\n}\n\nfunc TestFullNameMatcherEmptyPrefixes(t *testing.T) {\n\tt.Parallel()\n\tmatcher := newFullNameMatcher()\n\n\t// Empty prefixes should not match anything\n\tassert.False(t, matcher.matchesPrefix(\"foo.bar\"))\n\tassert.False(t, matcher.matchesExact(\"foo.bar\"))\n}\n"
  },
  {
    "path": "private/buf/bufformat/formatter.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufformat\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/bufbuild/protocompile/ast\"\n)\n\n// formatter writes an *ast.FileNode as a .proto file.\ntype formatter struct {\n\twriter   io.Writer\n\tfileNode *ast.FileNode\n\n\t// Used to adjust comments when we remove superfluous\n\t// separators tp canonicalize message literals\n\toverrideTrailingComments map[ast.Node]ast.Comments\n\n\t// Current level of indentation.\n\tindent int\n\t// The last character written to writer.\n\tlastWritten rune\n\n\t// The last node written. This must be updated from all functions\n\t// that write comments with a node. This flag informs how the next\n\t// node's leading comments and whitespace should be written.\n\tpreviousNode ast.Node\n\n\t// If true, a space will be written to the output unless the next character\n\t// written is a newline (don't wait errant trailing spaces).\n\tpendingSpace bool\n\t// If true, the formatter is in the middle of printing compact options.\n\tinCompactOptions bool\n\n\t// Track runes that open blocks/scopes and are expected to increase indention\n\t// level. For example, when runes \"{\" \"[\" \"(\" \")\" are written, the pending\n\t// value is 2 (increment three times for \"{\" \"[\" \"(\"; decrement once for \")\").\n\t// If it's greater than zero at the end of a line, we call In() so that\n\t// subsequent lines are indented. If it's less than zero at the end of a line,\n\t// we call Out(). This minimizes the amount of explicit indent/unindent code\n\t// that is needed and makes it less error-prone.\n\tpendingIndent int\n\t// If true, an inline node/sequence is being written. We treat whitespace a\n\t// little differently for when blocks are printed inline vs. across multiple\n\t// lines. So this flag informs the logic that makes those whitespace decisions.\n\tinline bool\n\n\t// Records all errors that occur during the formatting process. Nearly any\n\t// non-nil error represents a bug in the implementation.\n\terr error\n\n\t// deprecation tracks which types should have deprecated options injected.\n\tdeprecation *fullNameMatcher\n\t// packageFQN holds the current fully-qualified name.\n\tpackageFQN string\n\t// injectCompactDeprecation is set when the next compact options should have\n\t// deprecated = true injected at the beginning.\n\tinjectCompactDeprecation bool\n\t// deprecationMatched is set to true when any type matches the deprecation prefix,\n\t// regardless of whether it was already deprecated.\n\tdeprecationMatched bool\n}\n\n// newFormatter returns a new formatter for the given file.\nfunc newFormatter(\n\twriter io.Writer,\n\tfileNode *ast.FileNode,\n\toptions *formatOptions,\n) *formatter {\n\tf := &formatter{\n\t\twriter:                   writer,\n\t\tfileNode:                 fileNode,\n\t\toverrideTrailingComments: map[ast.Node]ast.Comments{},\n\t}\n\tif options != nil && len(options.deprecatePrefixes) > 0 {\n\t\tf.deprecation = newFullNameMatcher(options.deprecatePrefixes...)\n\t}\n\treturn f\n}\n\n// Run runs the formatter and writes the file's content to the formatter's writer.\nfunc (f *formatter) Run() error {\n\tf.writeFile()\n\treturn f.err\n}\n\n// P prints a line to the generated output.\n//\n// This will emit a newline and proper indentation. If you do not\n// want to emit a newline and want to write a raw string, use\n// WriteString (which P calls).\n//\n// If strings.TrimSpace(elem) is empty, no indentation is produced.\nfunc (f *formatter) P(elem string) {\n\tif len(strings.TrimSpace(elem)) > 0 {\n\t\t// We only want to write an indent if we're\n\t\t// writing a non-empty string (not just a newline).\n\t\tf.Indent(nil)\n\t\tf.WriteString(elem)\n\t}\n\tf.WriteString(\"\\n\")\n\n\tif f.pendingIndent > 0 {\n\t\tf.In()\n\t} else if f.pendingIndent < 0 {\n\t\tf.Out()\n\t}\n\tf.pendingIndent = 0\n}\n\n// Space adds a space to the generated output.\nfunc (f *formatter) Space() {\n\tf.pendingSpace = true\n}\n\n// In increases the current level of indentation.\nfunc (f *formatter) In() {\n\tf.indent++\n}\n\n// Out reduces the current level of indentation.\nfunc (f *formatter) Out() {\n\tif f.indent <= 0 {\n\t\t// Unreachable.\n\t\tf.err = errors.Join(\n\t\t\tf.err,\n\t\t\terrors.New(\"internal error: attempted to decrement indentation at zero\"),\n\t\t)\n\t\treturn\n\t}\n\tf.indent--\n}\n\n// Indent writes the number of spaces associated\n// with the current level of indentation.\nfunc (f *formatter) Indent(nextNode ast.Node) {\n\t// only indent at beginning of line\n\tif f.lastWritten != '\\n' {\n\t\treturn\n\t}\n\tindent := f.indent\n\tif rn, ok := nextNode.(*ast.RuneNode); ok && indent > 0 {\n\t\tif strings.ContainsRune(\"}])>\", rn.Rune) {\n\t\t\tindent--\n\t\t}\n\t}\n\tf.WriteString(strings.Repeat(\"  \", indent))\n}\n\n// WriteString writes the given element to the generated output.\n//\n// This will not write indentation or newlines. Use P if you\n// want to emit indentation or newlines.\nfunc (f *formatter) WriteString(elem string) {\n\tif f.pendingSpace {\n\t\tf.pendingSpace = false\n\t\tfirst, _ := utf8.DecodeRuneInString(elem)\n\n\t\t// We don't want \"dangling spaces\" before certain characters:\n\t\t// newlines, commas, and semicolons. Also, when writing\n\t\t// elements inline, we don't want spaces before close parens\n\t\t// and braces. Similarly, we don't want extra/doubled spaces\n\t\t// or dangling spaces after certain characters when printing\n\t\t// inline, like open parens/braces. So only print the space\n\t\t// if the previous and next character don't match above\n\t\t// conditions.\n\n\t\tprevBlockList := \"\\x00 \\t\\n\"\n\t\tnextBlockList := \"\\n;,\"\n\t\tif f.inline {\n\t\t\tprevBlockList = \"\\x00 \\t\\n<[{(\"\n\t\t\tnextBlockList = \"\\n;,)]}>\"\n\t\t}\n\n\t\tif !strings.ContainsRune(prevBlockList, f.lastWritten) &&\n\t\t\t!strings.ContainsRune(nextBlockList, first) {\n\t\t\tif _, err := f.writer.Write([]byte{' '}); err != nil {\n\t\t\t\tf.err = errors.Join(f.err, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tif len(elem) == 0 {\n\t\treturn\n\t}\n\tf.lastWritten, _ = utf8.DecodeLastRuneInString(elem)\n\tif _, err := f.writer.Write([]byte(elem)); err != nil {\n\t\tf.err = errors.Join(f.err, err)\n\t}\n}\n\n// SetPreviousNode sets the previously written node. This should\n// be called in all of the comment writing functions.\nfunc (f *formatter) SetPreviousNode(node ast.Node) {\n\tf.previousNode = node\n}\n\n// writeFile writes the file node.\nfunc (f *formatter) writeFile() {\n\tf.writeFileHeader()\n\tf.writeFileTypes()\n\tif f.fileNode.EOF != nil {\n\t\tinfo := f.nodeInfo(f.fileNode.EOF)\n\t\tf.writeMultilineComments(info.LeadingComments())\n\t}\n\tif f.lastWritten != 0 && f.lastWritten != '\\n' {\n\t\t// If anything was written, we always conclude with\n\t\t// a newline.\n\t\tf.P(\"\")\n\t}\n}\n\n// writeFileHeader writes the header of a .proto file. This includes the syntax,\n// package, imports, and options (in that order). The imports and options are\n// sorted. All other file elements are handled by f.writeFileTypes.\n//\n// For example,\n//\n//\tsyntax = \"proto3\";\n//\n//\tpackage acme.v1.weather;\n//\n//\timport \"acme/payment/v1/payment.proto\";\n//\timport \"google/type/datetime.proto\";\n//\n//\toption cc_enable_arenas = true;\n//\toption optimize_for = SPEED;\nfunc (f *formatter) writeFileHeader() {\n\tvar (\n\t\tpackageNode *ast.PackageNode\n\t\timportNodes []*ast.ImportNode\n\t\toptionNodes []*ast.OptionNode\n\t)\n\tfor _, fileElement := range f.fileNode.Decls {\n\t\tswitch node := fileElement.(type) {\n\t\tcase *ast.PackageNode:\n\t\t\tpackageNode = node\n\t\tcase *ast.ImportNode:\n\t\t\timportNodes = append(importNodes, node)\n\t\tcase *ast.OptionNode:\n\t\t\toptionNodes = append(optionNodes, node)\n\t\tdefault:\n\t\t\tcontinue\n\t\t}\n\t}\n\t// Extract package FQN for deprecation tracking\n\tif packageNode != nil {\n\t\tf.packageFQN = packageNameToString(packageNode.Name)\n\t}\n\tif f.fileNode.Syntax == nil && f.fileNode.Edition == nil &&\n\t\tpackageNode == nil && importNodes == nil && optionNodes == nil {\n\t\t// There aren't any header values, so we can return early.\n\t\treturn\n\t}\n\t// We use a sentinel value to track which node was written first (since a proto file\n\t// without a syntax is valid). This is then used to ensure that we do not preserve\n\t// unnecessary leading whitespace for the first node written.\n\tfirst := true\n\teditionNode := f.fileNode.Edition\n\tif editionNode != nil {\n\t\tf.writeEdition(editionNode)\n\t\tfirst = false\n\t}\n\tif syntaxNode := f.fileNode.Syntax; syntaxNode != nil && editionNode == nil {\n\t\tf.writeSyntax(syntaxNode)\n\t\tfirst = false\n\t}\n\tif packageNode != nil {\n\t\tf.writePackage(packageNode, first)\n\t\tfirst = false\n\t}\n\tsort.Slice(importNodes, func(i, j int) bool {\n\t\tiName := importNodes[i].Name.AsString()\n\t\tjName := importNodes[j].Name.AsString()\n\t\t// sort by public > None > weak\n\t\tiOrder := importSortOrder(importNodes[i])\n\t\tjOrder := importSortOrder(importNodes[j])\n\n\t\tif iName < jName {\n\t\t\treturn true\n\t\t}\n\t\tif iName > jName {\n\t\t\treturn false\n\t\t}\n\t\tif iOrder > jOrder {\n\t\t\treturn true\n\t\t}\n\t\tif iOrder < jOrder {\n\t\t\treturn false\n\t\t}\n\n\t\t// put commented import first\n\t\treturn !f.importHasComment(importNodes[j])\n\t})\n\tfor i, importNode := range importNodes {\n\t\tif i == 0 && f.previousNode != nil && !f.leadingCommentsContainBlankLine(importNode) {\n\t\t\tf.P(\"\")\n\t\t}\n\n\t\t// since the imports are sorted, this will skip write imports\n\t\t// if they have appear before and dont have comment\n\t\tif i > 0 && importNode.Name.AsString() == importNodes[i-1].Name.AsString() &&\n\t\t\t!f.importHasComment(importNode) {\n\t\t\tcontinue\n\t\t}\n\n\t\tf.writeImport(importNode, i > 0, first)\n\t\tfirst = false\n\t}\n\tsort.Slice(optionNodes, func(i, j int) bool {\n\t\t// The default options (e.g. cc_enable_arenas) should always\n\t\t// be sorted above custom options (which are identified by a\n\t\t// leading '(').\n\t\tleft := stringForOptionName(optionNodes[i].Name)\n\t\tright := stringForOptionName(optionNodes[j].Name)\n\t\tif strings.HasPrefix(left, \"(\") && !strings.HasPrefix(right, \"(\") {\n\t\t\t// Prefer the default option on the right.\n\t\t\treturn false\n\t\t}\n\t\tif !strings.HasPrefix(left, \"(\") && strings.HasPrefix(right, \"(\") {\n\t\t\t// Prefer the default option on the left.\n\t\t\treturn true\n\t\t}\n\t\t// Both options are custom, so we defer to the standard sorting.\n\t\treturn left < right\n\t})\n\tfor i, optionNode := range optionNodes {\n\t\tif i == 0 && f.previousNode != nil && !f.leadingCommentsContainBlankLine(optionNode) {\n\t\t\tf.P(\"\")\n\t\t}\n\t\tf.writeFileOption(optionNode, i > 0, first)\n\t\tfirst = false\n\t}\n\t// Inject file-level deprecated option if needed\n\tif f.shouldInjectDeprecation(f.packageFQN) && !hasDeprecatedOption(optionNodes) {\n\t\tif len(optionNodes) == 0 && f.previousNode != nil {\n\t\t\tf.P(\"\")\n\t\t}\n\t\tf.writeDeprecatedOption()\n\t}\n}\n\n// writeFileTypes writes the types defined in a .proto file. This includes the messages, enums,\n// services, etc. All other elements are ignored since they are handled by f.writeFileHeader.\nfunc (f *formatter) writeFileTypes() {\n\tfor i, fileElement := range f.fileNode.Decls {\n\t\tswitch node := fileElement.(type) {\n\t\tcase *ast.PackageNode, *ast.OptionNode, *ast.ImportNode, *ast.EmptyDeclNode:\n\t\t\t// These elements have already been written by f.writeFileHeader.\n\t\t\tcontinue\n\t\tdefault:\n\t\t\tinfo := f.nodeInfo(node)\n\t\t\twantNewline := f.previousNode != nil && (i == 0 || info.LeadingComments().Len() > 0)\n\t\t\tif wantNewline && !f.leadingCommentsContainBlankLine(node) {\n\t\t\t\tf.P(\"\")\n\t\t\t}\n\t\t\tf.writeNode(node)\n\t\t}\n\t}\n}\n\n// writeSyntax writes the syntax.\n//\n// For example,\n//\n//\tsyntax = \"proto3\";\nfunc (f *formatter) writeSyntax(syntaxNode *ast.SyntaxNode) {\n\t// If this is the first node, we want to ignore leading whitespace, unless there are\n\t// leading comments.\n\tinfo := f.nodeInfo(syntaxNode)\n\tf.writeStart(syntaxNode.Keyword, info.LeadingComments().Len() == 0)\n\tf.Space()\n\tf.writeInline(syntaxNode.Equals)\n\tf.Space()\n\tf.writeInline(syntaxNode.Syntax)\n\tf.writeLineEnd(syntaxNode.Semicolon)\n}\n\n// writeEdition writes the edition.\n//\n// For example,\n//\n//\tedition = \"2023\";\nfunc (f *formatter) writeEdition(editionNode *ast.EditionNode) {\n\t// If this is the first node, we want to ignore leading whitespace, unless there are\n\t// leading comments.\n\tinfo := f.nodeInfo(editionNode)\n\tf.writeStart(editionNode.Keyword, info.LeadingComments().Len() == 0)\n\tf.Space()\n\tf.writeInline(editionNode.Equals)\n\tf.Space()\n\tf.writeInline(editionNode.Edition)\n\tf.writeLineEnd(editionNode.Semicolon)\n}\n\n// writePackage writes the package.\n//\n// For example,\n//\n//\tpackage acme.weather.v1;\nfunc (f *formatter) writePackage(packageNode *ast.PackageNode, first bool) {\n\t// If this is the first node, we want to ignore leading whitespace, unless there are\n\t// leading comments.\n\tinfo := f.nodeInfo(packageNode)\n\tf.writeStart(packageNode.Keyword, first && info.LeadingComments().Len() == 0)\n\tf.Space()\n\tf.writeInline(packageNode.Name)\n\tf.writeLineEnd(packageNode.Semicolon)\n}\n\n// writeImport writes an import statement.\n//\n// For example,\n//\n//\timport \"google/protobuf/descriptor.proto\";\nfunc (f *formatter) writeImport(importNode *ast.ImportNode, forceCompact, first bool) {\n\t// If this is the first node, we want to ignore leading whitespace, unless there are\n\t// leading comments.\n\tf.writeStartMaybeCompact(importNode.Keyword, forceCompact, first && !f.importHasComment(importNode))\n\tf.Space()\n\t// We don't want to write the \"public\" and \"weak\" nodes\n\t// if they aren't defined. One could be set, but never both.\n\tswitch {\n\tcase importNode.Public != nil:\n\t\tf.writeInline(importNode.Public)\n\t\tf.Space()\n\tcase importNode.Weak != nil:\n\t\tf.writeInline(importNode.Weak)\n\t\tf.Space()\n\t}\n\tf.writeInline(importNode.Name)\n\tf.writeLineEnd(importNode.Semicolon)\n}\n\n// writeFileOption writes a file option. This function is slightly\n// different than f.writeOption because file options are sorted at\n// the top of the file, and leading comments are adjusted accordingly.\nfunc (f *formatter) writeFileOption(optionNode *ast.OptionNode, forceCompact, first bool) {\n\t// If this is the first node, we want to ignore leading whitespace, unless there are\n\t// leading comments.\n\tinfo := f.nodeInfo(optionNode)\n\tf.writeStartMaybeCompact(optionNode.Keyword, forceCompact, first && info.LeadingComments().Len() == 0)\n\tf.Space()\n\tf.writeNode(optionNode.Name)\n\tf.Space()\n\tf.writeInline(optionNode.Equals)\n\tif node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok {\n\t\t// Compound string literals are written across multiple lines\n\t\t// immediately after the '=', so we don't need a trailing\n\t\t// space in the option prefix.\n\t\tf.writeCompoundStringLiteralIndentEndInline(node)\n\t\tf.writeLineEnd(optionNode.Semicolon)\n\t\treturn\n\t}\n\tf.Space()\n\tf.writeInline(optionNode.Val)\n\tf.writeLineEnd(optionNode.Semicolon)\n}\n\n// writeOption writes an option.\n//\n// For example,\n//\n//\toption go_package = \"github.com/foo/bar\";\nfunc (f *formatter) writeOption(optionNode *ast.OptionNode) {\n\tf.writeOptionPrefix(optionNode)\n\tif optionNode.Semicolon != nil {\n\t\tif node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok {\n\t\t\t// Compound string literals are written across multiple lines\n\t\t\t// immediately after the '=', so we don't need a trailing\n\t\t\t// space in the option prefix.\n\t\t\tf.writeCompoundStringLiteralIndentEndInline(node)\n\t\t\tf.writeLineEnd(optionNode.Semicolon)\n\t\t\treturn\n\t\t}\n\t\tf.writeInline(optionNode.Val)\n\t\tf.writeLineEnd(optionNode.Semicolon)\n\t\treturn\n\t}\n\n\tif node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok {\n\t\t// We write the compound string literal node and end in-line to handle any commas for\n\t\t// the option.\n\t\tf.writeCompoundStringLiteralIndentEndInline(node)\n\t\treturn\n\t}\n\tf.writeInline(optionNode.Val)\n}\n\n// writeLastCompactOption writes a compact option but preserves its the\n// trailing end comments. This is only used for the last compact option\n// since it's the only time a trailing ',' will be omitted.\n//\n// For example,\n//\n//\t[\n//\t  deprecated = true,\n//\t  json_name = \"something\" // Trailing comment on the last element.\n//\t]\nfunc (f *formatter) writeLastCompactOption(optionNode *ast.OptionNode) {\n\tf.writeOptionPrefix(optionNode)\n\tf.writeLineEnd(optionNode.Val)\n}\n\n// writeOptionValue writes the option prefix, which makes up all of the\n// option's definition, excluding the final token(s).\n//\n// For example,\n//\n//\tdeprecated =\nfunc (f *formatter) writeOptionPrefix(optionNode *ast.OptionNode) {\n\tif optionNode.Keyword != nil {\n\t\t// Compact options don't have the keyword.\n\t\tf.writeStart(optionNode.Keyword, false)\n\t\tf.Space()\n\t\tf.writeNode(optionNode.Name)\n\t} else {\n\t\tf.writeStart(optionNode.Name, false)\n\t}\n\tf.Space()\n\tf.writeInline(optionNode.Equals)\n\tf.Space()\n}\n\n// writeOptionName writes an option name.\n//\n// For example,\n//\n//\tgo_package\n//\t(custom.thing)\n//\t(custom.thing).bridge.(another.thing)\nfunc (f *formatter) writeOptionName(optionNameNode *ast.OptionNameNode) {\n\tfor i := range optionNameNode.Parts {\n\t\tif f.inCompactOptions && i == 0 {\n\t\t\t// The leading comments of the first token (either open rune or the\n\t\t\t// name) will have already been written, so we need to handle this\n\t\t\t// case specially.\n\t\t\tfieldReferenceNode := optionNameNode.Parts[0]\n\t\t\tif fieldReferenceNode.Open != nil {\n\t\t\t\tf.writeNode(fieldReferenceNode.Open)\n\t\t\t\tif info := f.nodeInfo(fieldReferenceNode.Open); info.TrailingComments().Len() > 0 {\n\t\t\t\t\tf.writeInlineComments(info.TrailingComments())\n\t\t\t\t}\n\t\t\t\tf.writeInline(fieldReferenceNode.Name)\n\t\t\t} else {\n\t\t\t\tf.writeNode(fieldReferenceNode.Name)\n\t\t\t\tif info := f.nodeInfo(fieldReferenceNode.Name); info.TrailingComments().Len() > 0 {\n\t\t\t\t\tf.writeInlineComments(info.TrailingComments())\n\t\t\t\t}\n\t\t\t}\n\t\t\tif fieldReferenceNode.Close != nil {\n\t\t\t\tf.writeInline(fieldReferenceNode.Close)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif i > 0 {\n\t\t\t// The length of this slice must be exactly len(Parts)-1.\n\t\t\tf.writeInline(optionNameNode.Dots[i-1])\n\t\t}\n\t\tf.writeNode(optionNameNode.Parts[i])\n\t}\n}\n\n// writeMessage writes the message node.\n//\n// For example,\n//\n//\tmessage Foo {\n//\t  option deprecated = true;\n//\t  reserved 50 to 100;\n//\t  extensions 150 to 200;\n//\n//\t  message Bar {\n//\t    string name = 1;\n//\t  }\n//\t  enum Baz {\n//\t    BAZ_UNSPECIFIED = 0;\n//\t  }\n//\t  extend Bar {\n//\t    string value = 2;\n//\t  }\n//\n//\t  Bar bar = 1;\n//\t  Baz baz = 2;\n//\t}\nfunc (f *formatter) writeMessage(messageNode *ast.MessageNode) {\n\t// Track FQN for deprecation\n\tpopFQN := f.pushFQN(messageNode.Name.Val)\n\tdefer popFQN()\n\n\tvar elementWriterFunc func()\n\tif len(messageNode.Decls) != 0 {\n\t\t// Check if we need to inject deprecation\n\t\tneedsDeprecation := f.shouldInjectDeprecation(f.currentFQN()) && !hasDeprecatedOption(messageNode.Decls)\n\t\telementWriterFunc = func() {\n\t\t\tif needsDeprecation {\n\t\t\t\tf.writeDeprecatedOption()\n\t\t\t}\n\t\t\tfor _, decl := range messageNode.Decls {\n\t\t\t\tf.writeNode(decl)\n\t\t\t}\n\t\t}\n\t} else if f.shouldInjectDeprecation(f.currentFQN()) {\n\t\t// Empty message that needs deprecation\n\t\telementWriterFunc = func() {\n\t\t\tf.writeDeprecatedOption()\n\t\t}\n\t}\n\tf.writeStart(messageNode.Keyword, false)\n\tf.Space()\n\tf.writeInline(messageNode.Name)\n\tf.Space()\n\tf.writeCompositeTypeBody(\n\t\tmessageNode.OpenBrace,\n\t\tmessageNode.CloseBrace,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeMessageLiteral writes a message literal.\n//\n// For example,\n//\n//\t{\n//\t  foo: 1\n//\t  foo: 2\n//\t  foo: 3\n//\t  bar: <\n//\t    name:\"abc\"\n//\t    id:123\n//\t  >\n//\t}\nfunc (f *formatter) writeMessageLiteral(messageLiteralNode *ast.MessageLiteralNode) {\n\tif f.maybeWriteCompactMessageLiteral(messageLiteralNode, false) {\n\t\treturn\n\t}\n\tvar elementWriterFunc func()\n\tif len(messageLiteralNode.Elements) > 0 {\n\t\telementWriterFunc = func() {\n\t\t\tf.writeMessageLiteralElements(messageLiteralNode)\n\t\t}\n\t}\n\tcloseNode := messageLiteralClose(messageLiteralNode)\n\t// In the case where we are writing a compact message literal, we need to check if there\n\t// are any trailing comments on the message literal that needs to be handled. The trailing\n\t// comments may end up on the message literal node itself rather than the closing bracket\n\t// in the case where a message literal is an element of a message literal, and trailing\n\t// comments on the separator are attached to message literal.\n\tmessageLiteralTrailingComments := f.nodeInfo(messageLiteralNode).TrailingComments()\n\t// Similar to how we handle the trailing comments on separators, we check if there are\n\t// any existing trailing comments on the closing bracket. If not, then we attach the trailing\n\t// comments of the message literal node to the closing bracket. Skip this if the closing\n\t// bracket already has trailing comments.\n\tif messageLiteralTrailingComments.Len() > 0 && f.nodeInfo(closeNode).TrailingComments().Len() == 0 {\n\t\tf.setTrailingComments(closeNode, messageLiteralTrailingComments)\n\t}\n\tf.writeCompositeValueBody(\n\t\tmessageLiteralOpen(messageLiteralNode),\n\t\tcloseNode,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeMessageLiteral writes a message literal suitable for\n// an element in an array literal.\nfunc (f *formatter) writeMessageLiteralForArray(\n\tmessageLiteralNode *ast.MessageLiteralNode,\n\tlastElement bool,\n) {\n\tif f.maybeWriteCompactMessageLiteral(messageLiteralNode, true) {\n\t\treturn\n\t}\n\tvar elementWriterFunc func()\n\tif len(messageLiteralNode.Elements) > 0 {\n\t\telementWriterFunc = func() {\n\t\t\tf.writeMessageLiteralElements(messageLiteralNode)\n\t\t}\n\t}\n\tcloseWriter := f.writeBodyEndInline\n\tif lastElement {\n\t\tcloseWriter = f.writeBodyEnd\n\t}\n\tcloseNode := messageLiteralClose(messageLiteralNode)\n\t// In the case where we are writing a compact message literal, we need to check if there\n\t// are any trailing comments on the message literal that needs to be handled. The trailing\n\t// comments may end up on the message literal node itself rather than the closing bracket\n\t// in the case where a message literal is an element of a message literal, and trailing\n\t// comments on the separator are attached to message literal.\n\tmessageLiteralTrailingComments := f.nodeInfo(messageLiteralNode).TrailingComments()\n\t// Similar to how we handle the trailing comments on separators, we check if there are\n\t// any existing trailing comments on the closing bracket. If not, then we attach the trailing\n\t// comments of the message literal node to the closing bracket. Skip this if the closing\n\t// bracket already has trailing comments.\n\tif messageLiteralTrailingComments.Len() > 0 && f.nodeInfo(closeNode).TrailingComments().Len() == 0 {\n\t\tf.setTrailingComments(closeNode, messageLiteralTrailingComments)\n\t}\n\tf.writeBody(\n\t\tmessageLiteralOpen(messageLiteralNode),\n\t\tcloseNode,\n\t\telementWriterFunc,\n\t\tf.writeOpenBracePrefixForArray,\n\t\tcloseWriter,\n\t)\n}\n\nfunc (f *formatter) maybeWriteCompactMessageLiteral(\n\tmessageLiteralNode *ast.MessageLiteralNode,\n\tinArrayLiteral bool,\n) bool {\n\t// We only want to write a compact message literal for a message literal with either 0 or\n\t// 1 elements, and if there are no interior comments, and the element, if present, is not\n\t// a message or array literal.\n\tif len(messageLiteralNode.Elements) > 1 ||\n\t\tf.hasInteriorComments(messageLiteralNode.Children()...) ||\n\t\tmessageLiteralHasNestedMessageOrArray(messageLiteralNode) {\n\t\treturn false\n\t}\n\n\t// messages with a single scalar field and no comments can be\n\t// printed all on one line\n\topenNode := messageLiteralOpen(messageLiteralNode)\n\tcloseNode := messageLiteralClose(messageLiteralNode)\n\n\t// In the case where we are writing a compact message literal, we need to check if there\n\t// are any trailing comments on the message literal that needs to be handled. The trailing\n\t// comments may end up on the message literal node itself rather than the closing bracket\n\t// in the case where a message literal is an element of a message literal, and trailing\n\t// comments on the separator are attached to message literal.\n\tmessageLiteralTrailingComments := f.nodeInfo(messageLiteralNode).TrailingComments()\n\t// Similar to how we handle the trailing comments on separators, we check if there are\n\t// any existing trailing comments on the closing bracket. If not, then we attach the trailing\n\t// comments of the message literal node to the closing bracket. Skip this if the closing\n\t// bracket already has trailing comments.\n\tif messageLiteralTrailingComments.Len() > 0 && f.nodeInfo(closeNode).TrailingComments().Len() == 0 {\n\t\tf.setTrailingComments(closeNode, messageLiteralTrailingComments)\n\t}\n\n\tif inArrayLiteral {\n\t\tf.Indent(openNode)\n\t}\n\tf.writeInline(openNode)\n\t// We check if our compact message has one element, if so, write that value as compact.\n\tif len(messageLiteralNode.Elements) == 1 {\n\t\tfieldNode := messageLiteralNode.Elements[0]\n\t\tf.writeInline(fieldNode.Name)\n\t\tif fieldNode.Sep != nil {\n\t\t\tf.writeInline(fieldNode.Sep)\n\t\t} else {\n\t\t\tf.WriteString(\":\")\n\t\t}\n\t\tf.Space()\n\t\tif messageLiteralNode.Seps[0] != nil {\n\t\t\t// We are dropping the optional trailing separator. If it had\n\t\t\t// trailing comments and the value does not, move the separator's\n\t\t\t// trailing comment to the value.\n\t\t\tsepTrailingComments := f.nodeInfo(messageLiteralNode.Seps[0]).TrailingComments()\n\t\t\tif sepTrailingComments.Len() > 0 &&\n\t\t\t\tf.nodeInfo(fieldNode.Val).TrailingComments().Len() == 0 {\n\t\t\t\tf.setTrailingComments(fieldNode.Val, sepTrailingComments)\n\t\t\t}\n\t\t}\n\t\tf.writeInline(fieldNode.Val)\n\t}\n\tf.writeInline(closeNode)\n\treturn true\n}\n\nfunc messageLiteralHasNestedMessageOrArray(messageLiteralNode *ast.MessageLiteralNode) bool {\n\tfor _, elem := range messageLiteralNode.Elements {\n\t\tswitch elem.Val.(type) {\n\t\tcase *ast.ArrayLiteralNode, *ast.MessageLiteralNode:\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc arrayLiteralHasNestedMessageOrArray(arrayLiteralNode *ast.ArrayLiteralNode) bool {\n\tfor _, elem := range arrayLiteralNode.Elements {\n\t\tswitch elem.(type) {\n\t\tcase *ast.ArrayLiteralNode, *ast.MessageLiteralNode:\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// writeMessageLiteralElements writes the message literal's elements.\n//\n// For example,\n//\n//\tfoo: 1\n//\tfoo: 2\nfunc (f *formatter) writeMessageLiteralElements(messageLiteralNode *ast.MessageLiteralNode) {\n\tfor i := range messageLiteralNode.Elements {\n\t\t// Separators (\",\" or \";\") are optional. To avoid inconsistent formatted output,\n\t\t// we suppress them, since they aren't needed. So we just write the element and\n\t\t// ignore any optional separator in the AST.\n\t\tif messageLiteralNode.Seps[i] != nil {\n\t\t\t// Since we are dropping the optional trailing separator, we should\n\t\t\t// possibly move its trailing comment to the element value so we don't\n\t\t\t// lose it. Skip this step if the value already has a trailing comment.\n\t\t\tsepTrailingComments := f.nodeInfo(messageLiteralNode.Seps[i]).TrailingComments()\n\t\t\tif sepTrailingComments.Len() > 0 &&\n\t\t\t\tf.nodeInfo(messageLiteralNode.Elements[i].Val).TrailingComments().Len() == 0 {\n\t\t\t\tf.setTrailingComments(messageLiteralNode.Elements[i].Val, sepTrailingComments)\n\t\t\t}\n\t\t}\n\t\tf.writeNode(messageLiteralNode.Elements[i])\n\t}\n}\n\n// writeMessageField writes the message field node, and concludes the\n// line without leaving room for a trailing separator in the parent\n// message literal.\nfunc (f *formatter) writeMessageField(messageFieldNode *ast.MessageFieldNode) {\n\tf.writeMessageFieldPrefix(messageFieldNode)\n\tif compoundStringLiteral, ok := messageFieldNode.Val.(*ast.CompoundStringLiteralNode); ok {\n\t\tf.writeCompoundStringLiteralIndent(compoundStringLiteral)\n\t\treturn\n\t}\n\tf.writeLineEnd(messageFieldNode.Val)\n}\n\n// writeMessageFieldPrefix writes the message field node as a single line.\n//\n// For example,\n//\n//\tfoo:\"bar\"\nfunc (f *formatter) writeMessageFieldPrefix(messageFieldNode *ast.MessageFieldNode) {\n\t// The comments need to be written as a multiline comment above\n\t// the message field name.\n\t//\n\t// Note that this is different than how field reference nodes are\n\t// normally formatted in-line (i.e. as option name components).\n\tfieldReferenceNode := messageFieldNode.Name\n\tif fieldReferenceNode.Open != nil {\n\t\tf.writeStart(fieldReferenceNode.Open, false)\n\t\tif fieldReferenceNode.URLPrefix != nil {\n\t\t\tf.writeInline(fieldReferenceNode.URLPrefix)\n\t\t\tf.writeInline(fieldReferenceNode.Slash)\n\t\t}\n\t\tf.writeInline(fieldReferenceNode.Name)\n\t} else {\n\t\tf.writeStart(fieldReferenceNode.Name, false)\n\t}\n\tif fieldReferenceNode.Close != nil {\n\t\tf.writeInline(fieldReferenceNode.Close)\n\t}\n\t// The colon separator is optional sometimes, but we don't have enough\n\t// information here to know whether it's necessary. For more consistent\n\t// output, just always include it.\n\tif messageFieldNode.Sep != nil {\n\t\tf.writeInline(messageFieldNode.Sep)\n\t} else {\n\t\tf.WriteString(\":\")\n\t}\n\tf.Space()\n}\n\n// writeEnum writes the enum node.\n//\n// For example,\n//\n//\tenum Foo {\n//\t  option deprecated = true;\n//\t  reserved 1 to 5;\n//\n//\t  FOO_UNSPECIFIED = 0;\n//\t}\nfunc (f *formatter) writeEnum(enumNode *ast.EnumNode) {\n\t// Track FQN for deprecation\n\tpopFQN := f.pushFQN(enumNode.Name.Val)\n\tdefer popFQN()\n\n\tvar elementWriterFunc func()\n\tif len(enumNode.Decls) > 0 {\n\t\t// Check if we need to inject deprecation\n\t\tneedsDeprecation := f.shouldInjectDeprecation(f.currentFQN()) && !hasDeprecatedOption(enumNode.Decls)\n\t\telementWriterFunc = func() {\n\t\t\tif needsDeprecation {\n\t\t\t\tf.writeDeprecatedOption()\n\t\t\t}\n\t\t\tfor _, decl := range enumNode.Decls {\n\t\t\t\tf.writeNode(decl)\n\t\t\t}\n\t\t}\n\t} else if f.shouldInjectDeprecation(f.currentFQN()) {\n\t\t// Empty enum that needs deprecation\n\t\telementWriterFunc = func() {\n\t\t\tf.writeDeprecatedOption()\n\t\t}\n\t}\n\tf.writeStart(enumNode.Keyword, false)\n\tf.Space()\n\tf.writeInline(enumNode.Name)\n\tf.Space()\n\tf.writeCompositeTypeBody(\n\t\tenumNode.OpenBrace,\n\t\tenumNode.CloseBrace,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeEnumValue writes the enum value as a single line. If the enum has\n// compact options, it will be written across multiple lines.\n//\n// For example,\n//\n//\tFOO_UNSPECIFIED = 1 [\n//\t  deprecated = true\n//\t];\nfunc (f *formatter) writeEnumValue(enumValueNode *ast.EnumValueNode) {\n\tf.writeStart(enumValueNode.Name, false)\n\tf.Space()\n\tf.writeInline(enumValueNode.Equals)\n\tf.Space()\n\tf.writeInline(enumValueNode.Number)\n\t// Check if we need to inject deprecation for this enum value (exact match only)\n\t// Enum values are scoped to their parent (message or package), NOT the enum itself.\n\t// So we use the parent FQN (without the enum name) + the enum value name.\n\tenumValueFQN := parentFQN(f.packageFQN) + \".\" + enumValueNode.Name.Val\n\tneedsDeprecation := f.shouldInjectDeprecationExact(enumValueFQN) &&\n\t\t!hasCompactDeprecatedOption(enumValueNode.Options)\n\tif enumValueNode.Options != nil {\n\t\tf.Space()\n\t\tif needsDeprecation {\n\t\t\tf.injectCompactDeprecation = true\n\t\t}\n\t\tf.writeNode(enumValueNode.Options)\n\t\tf.injectCompactDeprecation = false\n\t} else if needsDeprecation {\n\t\tf.writeCompactDeprecatedOption()\n\t}\n\tf.writeLineEnd(enumValueNode.Semicolon)\n}\n\n// writeField writes the field node as a single line. If the field has\n// compact options, it will be written across multiple lines.\n//\n// For example,\n//\n//\trepeated string name = 1 [\n//\t  deprecated = true,\n//\t  json_name = \"name\"\n//\t];\nfunc (f *formatter) writeField(fieldNode *ast.FieldNode) {\n\t// We need to handle the comments for the field label specially since\n\t// a label might not be defined, but it has the leading comments attached\n\t// to it.\n\tif fieldNode.Label.KeywordNode != nil {\n\t\tf.writeStart(fieldNode.Label, false)\n\t\tf.Space()\n\t\tf.writeInline(fieldNode.FldType)\n\t} else {\n\t\t// If a label was not written, the multiline comments will be\n\t\t// attached to the type.\n\t\tif compoundIdentNode, ok := fieldNode.FldType.(*ast.CompoundIdentNode); ok {\n\t\t\tf.writeCompoundIdentForFieldName(compoundIdentNode)\n\t\t} else {\n\t\t\tf.writeStart(fieldNode.FldType, false)\n\t\t}\n\t}\n\tf.Space()\n\tf.writeInline(fieldNode.Name)\n\tf.Space()\n\tif fieldNode.Equals != nil {\n\t\tf.writeInline(fieldNode.Equals)\n\t\tf.Space()\n\t}\n\tif fieldNode.Tag != nil {\n\t\tf.writeInline(fieldNode.Tag)\n\t}\n\t// Check if we need to inject deprecation for this field (exact match only)\n\tfieldFQN := f.currentFQN() + \".\" + fieldNode.Name.Val\n\tneedsDeprecation := f.shouldInjectDeprecationExact(fieldFQN) &&\n\t\t!hasCompactDeprecatedOption(fieldNode.Options)\n\tif fieldNode.Options != nil {\n\t\tf.Space()\n\t\tif needsDeprecation {\n\t\t\tf.injectCompactDeprecation = true\n\t\t}\n\t\tf.writeNode(fieldNode.Options)\n\t\tf.injectCompactDeprecation = false\n\t} else if needsDeprecation {\n\t\tf.writeCompactDeprecatedOption()\n\t}\n\tf.writeLineEnd(fieldNode.Semicolon)\n}\n\n// writeMapField writes a map field (e.g. 'map<string, string> pairs = 1;').\nfunc (f *formatter) writeMapField(mapFieldNode *ast.MapFieldNode) {\n\tf.writeNode(mapFieldNode.MapType)\n\tf.Space()\n\tf.writeInline(mapFieldNode.Name)\n\tf.Space()\n\tf.writeInline(mapFieldNode.Equals)\n\tf.Space()\n\tf.writeInline(mapFieldNode.Tag)\n\tif mapFieldNode.Options != nil {\n\t\tf.Space()\n\t\tf.writeNode(mapFieldNode.Options)\n\t}\n\tf.writeLineEnd(mapFieldNode.Semicolon)\n}\n\n// writeMapType writes a map type (e.g. 'map<string, string>').\nfunc (f *formatter) writeMapType(mapTypeNode *ast.MapTypeNode) {\n\tf.writeStart(mapTypeNode.Keyword, false)\n\tf.writeInline(mapTypeNode.OpenAngle)\n\tf.writeInline(mapTypeNode.KeyType)\n\tf.writeInline(mapTypeNode.Comma)\n\tf.Space()\n\tf.writeInline(mapTypeNode.ValueType)\n\tf.writeInline(mapTypeNode.CloseAngle)\n}\n\n// writeFieldReference writes a field reference (e.g. '(foo.bar)').\nfunc (f *formatter) writeFieldReference(fieldReferenceNode *ast.FieldReferenceNode) {\n\tif fieldReferenceNode.Open != nil {\n\t\tf.writeInline(fieldReferenceNode.Open)\n\t}\n\tf.writeInline(fieldReferenceNode.Name)\n\tif fieldReferenceNode.Close != nil {\n\t\tf.writeInline(fieldReferenceNode.Close)\n\t}\n}\n\n// writeExtend writes the extend node.\n//\n// For example,\n//\n//\textend google.protobuf.FieldOptions {\n//\t  bool redacted = 33333;\n//\t}\nfunc (f *formatter) writeExtend(extendNode *ast.ExtendNode) {\n\tvar elementWriterFunc func()\n\tif len(extendNode.Decls) > 0 {\n\t\telementWriterFunc = func() {\n\t\t\tfor _, decl := range extendNode.Decls {\n\t\t\t\tf.writeNode(decl)\n\t\t\t}\n\t\t}\n\t}\n\tf.writeStart(extendNode.Keyword, false)\n\tf.Space()\n\tf.writeInline(extendNode.Extendee)\n\tf.Space()\n\tf.writeCompositeTypeBody(\n\t\textendNode.OpenBrace,\n\t\textendNode.CloseBrace,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeService writes the service node.\n//\n// For example,\n//\n//\tservice FooService {\n//\t  option deprecated = true;\n//\n//\t  rpc Foo(FooRequest) returns (FooResponse) {};\nfunc (f *formatter) writeService(serviceNode *ast.ServiceNode) {\n\t// Track FQN for deprecation\n\tpopFQN := f.pushFQN(serviceNode.Name.Val)\n\tdefer popFQN()\n\n\tvar elementWriterFunc func()\n\tif len(serviceNode.Decls) > 0 {\n\t\t// Check if we need to inject deprecation\n\t\tneedsDeprecation := f.shouldInjectDeprecation(f.currentFQN()) && !hasDeprecatedOption(serviceNode.Decls)\n\t\telementWriterFunc = func() {\n\t\t\tif needsDeprecation {\n\t\t\t\tf.writeDeprecatedOption()\n\t\t\t}\n\t\t\tfor _, decl := range serviceNode.Decls {\n\t\t\t\tf.writeNode(decl)\n\t\t\t}\n\t\t}\n\t} else if f.shouldInjectDeprecation(f.currentFQN()) {\n\t\t// Empty service that needs deprecation\n\t\telementWriterFunc = func() {\n\t\t\tf.writeDeprecatedOption()\n\t\t}\n\t}\n\tf.writeStart(serviceNode.Keyword, false)\n\tf.Space()\n\tf.writeInline(serviceNode.Name)\n\tf.Space()\n\tf.writeCompositeTypeBody(\n\t\tserviceNode.OpenBrace,\n\t\tserviceNode.CloseBrace,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeRPC writes the RPC node. RPCs are formatted in\n// the following order:\n//\n// For example,\n//\n//\trpc Foo(FooRequest) returns (FooResponse) {\n//\t  option deprecated = true;\n//\t};\nfunc (f *formatter) writeRPC(rpcNode *ast.RPCNode) {\n\t// Track FQN for deprecation (RPCs are children of services)\n\tpopFQN := f.pushFQN(rpcNode.Name.Val)\n\tdefer popFQN()\n\n\tneedsDeprecation := f.shouldInjectDeprecation(f.currentFQN()) && !hasDeprecatedOption(rpcNode.Decls)\n\n\tvar elementWriterFunc func()\n\tif len(rpcNode.Decls) > 0 {\n\t\telementWriterFunc = func() {\n\t\t\tif needsDeprecation {\n\t\t\t\tf.writeDeprecatedOption()\n\t\t\t}\n\t\t\tfor _, decl := range rpcNode.Decls {\n\t\t\t\tf.writeNode(decl)\n\t\t\t}\n\t\t}\n\t} else if needsDeprecation {\n\t\telementWriterFunc = func() {\n\t\t\tf.writeDeprecatedOption()\n\t\t}\n\t}\n\tf.writeStart(rpcNode.Keyword, false)\n\tf.Space()\n\tf.writeInline(rpcNode.Name)\n\tf.writeInline(rpcNode.Input)\n\tf.Space()\n\tf.writeInline(rpcNode.Returns)\n\tf.Space()\n\tf.writeInline(rpcNode.Output)\n\tif rpcNode.OpenBrace == nil && !needsDeprecation {\n\t\t// This RPC doesn't have any elements and doesn't need deprecation,\n\t\t// so we prefer the ';' form.\n\t\t//\n\t\t//  rpc Ping(PingRequest) returns (PingResponse);\n\t\t//\n\t\tf.writeLineEnd(rpcNode.Semicolon)\n\t\treturn\n\t}\n\t// If we need to add deprecation to an RPC without a body, we need to\n\t// create a body for it.\n\tf.Space()\n\tif rpcNode.OpenBrace != nil {\n\t\tf.writeCompositeTypeBody(\n\t\t\trpcNode.OpenBrace,\n\t\t\trpcNode.CloseBrace,\n\t\t\telementWriterFunc,\n\t\t)\n\t} else {\n\t\t// RPC had no body but needs deprecation - create synthetic body\n\t\tf.WriteString(\"{\")\n\t\tf.P(\"\")\n\t\tf.In()\n\t\tif elementWriterFunc != nil {\n\t\t\telementWriterFunc()\n\t\t}\n\t\tf.Out()\n\t\tf.Indent(nil)\n\t\tf.WriteString(\"}\")\n\t\tf.P(\"\")\n\t}\n}\n\n// writeRPCType writes the RPC type node (e.g. (stream foo.Bar)).\nfunc (f *formatter) writeRPCType(rpcTypeNode *ast.RPCTypeNode) {\n\tf.writeInline(rpcTypeNode.OpenParen)\n\tif rpcTypeNode.Stream != nil {\n\t\tf.writeInline(rpcTypeNode.Stream)\n\t\tf.Space()\n\t}\n\tf.writeInline(rpcTypeNode.MessageType)\n\tf.writeInline(rpcTypeNode.CloseParen)\n}\n\n// writeOneOf writes the oneof node.\n//\n// For example,\n//\n//\toneof foo {\n//\t  option deprecated = true;\n//\n//\t  string name = 1;\n//\t  int number = 2;\n//\t}\nfunc (f *formatter) writeOneOf(oneOfNode *ast.OneofNode) {\n\tvar elementWriterFunc func()\n\tif len(oneOfNode.Decls) > 0 {\n\t\telementWriterFunc = func() {\n\t\t\tfor _, decl := range oneOfNode.Decls {\n\t\t\t\tf.writeNode(decl)\n\t\t\t}\n\t\t}\n\t}\n\tf.writeStart(oneOfNode.Keyword, false)\n\tf.Space()\n\tf.writeInline(oneOfNode.Name)\n\tf.Space()\n\tf.writeCompositeTypeBody(\n\t\toneOfNode.OpenBrace,\n\t\toneOfNode.CloseBrace,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeGroup writes the group node.\n//\n// For example,\n//\n//\toptional group Key = 4 [\n//\t  deprecated = true,\n//\t  json_name = \"key\"\n//\t] {\n//\t  optional uint64 id = 1;\n//\t  optional string name = 2;\n//\t}\nfunc (f *formatter) writeGroup(groupNode *ast.GroupNode) {\n\tvar elementWriterFunc func()\n\tif len(groupNode.Decls) > 0 {\n\t\telementWriterFunc = func() {\n\t\t\tfor _, decl := range groupNode.Decls {\n\t\t\t\tf.writeNode(decl)\n\t\t\t}\n\t\t}\n\t}\n\t// We need to handle the comments for the group label specially since\n\t// a label might not be defined, but it has the leading comments attached\n\t// to it.\n\tif groupNode.Label.KeywordNode != nil {\n\t\tf.writeStart(groupNode.Label, false)\n\t\tf.Space()\n\t\tf.writeInline(groupNode.Keyword)\n\t} else {\n\t\t// If a label was not written, the multiline comments will be\n\t\t// attached to the keyword.\n\t\tf.writeStart(groupNode.Keyword, false)\n\t}\n\tf.Space()\n\tf.writeInline(groupNode.Name)\n\tf.Space()\n\tf.writeInline(groupNode.Equals)\n\tf.Space()\n\tf.writeInline(groupNode.Tag)\n\tif groupNode.Options != nil {\n\t\tf.Space()\n\t\tf.writeNode(groupNode.Options)\n\t}\n\tf.Space()\n\tf.writeCompositeTypeBody(\n\t\tgroupNode.OpenBrace,\n\t\tgroupNode.CloseBrace,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeExtensionRange writes the extension range node.\n//\n// For example,\n//\n//\textensions 5-10, 100 to max [\n//\t  deprecated = true\n//\t];\nfunc (f *formatter) writeExtensionRange(extensionRangeNode *ast.ExtensionRangeNode) {\n\tf.writeStart(extensionRangeNode.Keyword, false)\n\tf.Space()\n\tfor i := range extensionRangeNode.Ranges {\n\t\tif i > 0 {\n\t\t\t// The length of this slice must be exactly len(Ranges)-1.\n\t\t\tf.writeInline(extensionRangeNode.Commas[i-1])\n\t\t\tf.Space()\n\t\t}\n\t\tf.writeNode(extensionRangeNode.Ranges[i])\n\t}\n\tif extensionRangeNode.Options != nil {\n\t\tf.Space()\n\t\tf.writeNode(extensionRangeNode.Options)\n\t}\n\tf.writeLineEnd(extensionRangeNode.Semicolon)\n}\n\n// writeReserved writes a reserved node.\n//\n// For example,\n//\n//\treserved 5-10, 100 to max;\nfunc (f *formatter) writeReserved(reservedNode *ast.ReservedNode) {\n\tf.writeStart(reservedNode.Keyword, false)\n\t// Either names or ranges will be set, but never both.\n\telements := make([]ast.Node, 0, len(reservedNode.Names)+len(reservedNode.Ranges))\n\tswitch {\n\tcase reservedNode.Names != nil:\n\t\tfor _, nameNode := range reservedNode.Names {\n\t\t\telements = append(elements, nameNode)\n\t\t}\n\tcase reservedNode.Identifiers != nil:\n\t\tfor _, identNode := range reservedNode.Identifiers {\n\t\t\telements = append(elements, identNode)\n\t\t}\n\tcase reservedNode.Ranges != nil:\n\t\tfor _, rangeNode := range reservedNode.Ranges {\n\t\t\telements = append(elements, rangeNode)\n\t\t}\n\t}\n\tf.Space()\n\tfor i := range elements {\n\t\tif i > 0 {\n\t\t\t// The length of this slice must be exactly len({Names,Ranges})-1.\n\t\t\tf.writeInline(reservedNode.Commas[i-1])\n\t\t\tf.Space()\n\t\t}\n\t\tf.writeInline(elements[i])\n\t}\n\tf.writeLineEnd(reservedNode.Semicolon)\n}\n\n// writeRange writes the given range node (e.g. '1 to max').\nfunc (f *formatter) writeRange(rangeNode *ast.RangeNode) {\n\tf.writeInline(rangeNode.StartVal)\n\tif rangeNode.To != nil {\n\t\tf.Space()\n\t\tf.writeInline(rangeNode.To)\n\t}\n\t// Either EndVal or Max will be set, but never both.\n\tswitch {\n\tcase rangeNode.EndVal != nil:\n\t\tf.Space()\n\t\tf.writeInline(rangeNode.EndVal)\n\tcase rangeNode.Max != nil:\n\t\tf.Space()\n\t\tf.writeInline(rangeNode.Max)\n\t}\n}\n\n// writeCompactOptions writes a compact options node.\n//\n// For example,\n//\n//\t[\n//\t  deprecated = true,\n//\t  json_name = \"something\"\n//\t]\nfunc (f *formatter) writeCompactOptions(compactOptionsNode *ast.CompactOptionsNode) {\n\tf.inCompactOptions = true\n\tdefer func() {\n\t\tf.inCompactOptions = false\n\t}()\n\t// If we need to inject deprecation, we must use multiline format\n\tinjectDeprecation := f.injectCompactDeprecation\n\tif len(compactOptionsNode.Options) == 1 && !injectDeprecation &&\n\t\t!f.hasInteriorComments(compactOptionsNode.OpenBracket, compactOptionsNode.Options[0].Name) {\n\t\t// If there's only a single compact scalar option without comments, we can write it\n\t\t// in-line. For example:\n\t\t//\n\t\t//  [deprecated = true]\n\t\t//\n\t\t// However, this does not include the case when the '[' has trailing comments,\n\t\t// or the option name has leading comments. In those cases, we write the option\n\t\t// across multiple lines. For example:\n\t\t//\n\t\t//  [\n\t\t//    // This type is deprecated.\n\t\t//    deprecated = true\n\t\t//  ]\n\t\t//\n\t\toptionNode := compactOptionsNode.Options[0]\n\t\tf.writeInline(compactOptionsNode.OpenBracket)\n\t\tf.writeInline(optionNode.Name)\n\t\tf.Space()\n\t\tf.writeInline(optionNode.Equals)\n\t\tif node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok {\n\t\t\t// If there's only a single compact option, the value needs to\n\t\t\t// write its comments (if any) in a way that preserves the closing ']'.\n\t\t\tf.writeCompoundStringLiteralNoIndentEndInline(node)\n\t\t\tf.writeInline(compactOptionsNode.CloseBracket)\n\t\t\treturn\n\t\t}\n\t\tf.Space()\n\t\tf.writeInline(optionNode.Val)\n\t\tf.writeInline(compactOptionsNode.CloseBracket)\n\t\treturn\n\t}\n\tvar elementWriterFunc func()\n\tif len(compactOptionsNode.Options) > 0 || injectDeprecation {\n\t\telementWriterFunc = func() {\n\t\t\t// If we need to inject deprecation, write it first\n\t\t\tif injectDeprecation {\n\t\t\t\tif len(compactOptionsNode.Options) > 0 {\n\t\t\t\t\tf.P(\"deprecated = true,\")\n\t\t\t\t} else {\n\t\t\t\t\tf.P(\"deprecated = true\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor i, opt := range compactOptionsNode.Options {\n\t\t\t\tif i == len(compactOptionsNode.Options)-1 {\n\t\t\t\t\t// The last element won't have a trailing comma.\n\t\t\t\t\tf.writeLastCompactOption(opt)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tf.writeNode(opt)\n\t\t\t\tf.writeLineEnd(compactOptionsNode.Commas[i])\n\t\t\t}\n\t\t}\n\t}\n\tf.writeCompositeValueBody(\n\t\tcompactOptionsNode.OpenBracket,\n\t\tcompactOptionsNode.CloseBracket,\n\t\telementWriterFunc,\n\t)\n}\n\nfunc (f *formatter) hasInteriorComments(nodes ...ast.Node) bool {\n\tfor i, n := range nodes {\n\t\t// interior comments mean we ignore leading comments on first\n\t\t// token and trailing comments on the last one\n\t\tinfo := f.nodeInfo(n)\n\t\tif i > 0 && info.LeadingComments().Len() > 0 {\n\t\t\treturn true\n\t\t}\n\t\tif i < len(nodes)-1 && info.TrailingComments().Len() > 0 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// writeArrayLiteral writes an array literal across multiple lines.\n//\n// For example,\n//\n//\t[\n//\t  \"foo\",\n//\t  \"bar\"\n//\t]\nfunc (f *formatter) writeArrayLiteral(arrayLiteralNode *ast.ArrayLiteralNode) {\n\t// We need to check if there are any trailing comments on the array literal itself that\n\t// needs to be handled. The trailing comments may end up on the array literal node itself\n\t// rather than the closing bracket in the case where an array literal is an element of a\n\t// message literal, and trailing comments on the separator are attached to array literal.\n\tarrayLiteralTrailingComments := f.nodeInfo(arrayLiteralNode).TrailingComments()\n\t// Similar to how we handle trailing comments on separators, we check if there are any\n\t// existing trailing comments on the closing bracket. If not, then we attach the trailing\n\t// comments of the array literal node to the closing bracket. Skip this if the closing\n\t// bracket already has trailing comments.\n\tif arrayLiteralTrailingComments.Len() > 0 && f.nodeInfo(arrayLiteralNode.CloseBracket).TrailingComments().Len() == 0 {\n\t\tf.setTrailingComments(arrayLiteralNode.CloseBracket, arrayLiteralTrailingComments)\n\t}\n\n\tif len(arrayLiteralNode.Elements) == 1 &&\n\t\t!f.hasInteriorComments(arrayLiteralNode.Children()...) &&\n\t\t!arrayLiteralHasNestedMessageOrArray(arrayLiteralNode) {\n\t\t// arrays with a single scalar value and no comments can be\n\t\t// printed all on one line\n\t\tvalueNode := arrayLiteralNode.Elements[0]\n\t\tf.writeInline(arrayLiteralNode.OpenBracket)\n\t\tf.writeInline(valueNode)\n\t\tf.writeInline(arrayLiteralNode.CloseBracket)\n\t\treturn\n\t}\n\n\tvar elementWriterFunc func()\n\tif len(arrayLiteralNode.Elements) > 0 {\n\t\telementWriterFunc = func() {\n\t\t\tfor i := range arrayLiteralNode.Elements {\n\t\t\t\tlastElement := i == len(arrayLiteralNode.Elements)-1\n\t\t\t\tif compositeNode, ok := arrayLiteralNode.Elements[i].(ast.CompositeNode); ok {\n\t\t\t\t\tf.writeCompositeValueForArrayLiteral(compositeNode, lastElement)\n\t\t\t\t\tif !lastElement {\n\t\t\t\t\t\tf.writeLineEnd(arrayLiteralNode.Commas[i])\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif lastElement {\n\t\t\t\t\t// The last element won't have a trailing comma.\n\t\t\t\t\tf.writeLineElement(arrayLiteralNode.Elements[i])\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tf.writeStart(arrayLiteralNode.Elements[i], false)\n\t\t\t\tf.writeLineEnd(arrayLiteralNode.Commas[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tf.writeCompositeValueBody(\n\t\tarrayLiteralNode.OpenBracket,\n\t\tarrayLiteralNode.CloseBracket,\n\t\telementWriterFunc,\n\t)\n}\n\n// writeCompositeForArrayLiteral writes the composite node in a way that's suitable\n// for array literals. In general, signed integers and compound strings should have their\n// comments written in-line because they are one of many components in a single line.\n//\n// However, each of these composite types occupy a single line in an array literal,\n// so they need their comments to be formatted like a standalone node.\n//\n// For example,\n//\n//\toption (value) = /* In-line comment for '-42' */ -42;\n//\n//\toption (thing) = {\n//\t  values: [\n//\t    // Leading comment on -42.\n//\t    -42, // Trailing comment on -42.\n//\t  ]\n//\t}\n//\n// The lastElement boolean is used to signal whether or not the composite value\n// should be written as the last element (i.e. it doesn't have a trailing comma).\nfunc (f *formatter) writeCompositeValueForArrayLiteral(\n\tcompositeNode ast.CompositeNode,\n\tlastElement bool,\n) {\n\tswitch node := compositeNode.(type) {\n\tcase *ast.CompoundStringLiteralNode:\n\t\tf.writeCompoundStringLiteralForArray(node, lastElement)\n\tcase *ast.NegativeIntLiteralNode:\n\t\tf.writeNegativeIntLiteralForArray(node, lastElement)\n\tcase *ast.SignedFloatLiteralNode:\n\t\tf.writeSignedFloatLiteralForArray(node, lastElement)\n\tcase *ast.MessageLiteralNode:\n\t\tf.writeMessageLiteralForArray(node, lastElement)\n\tdefault:\n\t\tf.err = errors.Join(f.err, fmt.Errorf(\"unexpected array value node %T\", node))\n\t}\n}\n\n// writeCompositeTypeBody writes the body of a composite type, e.g. message, enum, extend, oneof, etc.\nfunc (f *formatter) writeCompositeTypeBody(\n\topenBrace *ast.RuneNode,\n\tcloseBrace *ast.RuneNode,\n\telementWriterFunc func(),\n) {\n\tf.writeBody(\n\t\topenBrace,\n\t\tcloseBrace,\n\t\telementWriterFunc,\n\t\tf.writeOpenBracePrefix,\n\t\tf.writeBodyEnd,\n\t)\n}\n\n// writeCompositeValueBody writes the body of a composite value, e.g. compact options,\n// array literal, etc. We need to handle the ']' different than composite types because\n// there could be more tokens following the final ']'.\nfunc (f *formatter) writeCompositeValueBody(\n\topenBrace *ast.RuneNode,\n\tcloseBrace *ast.RuneNode,\n\telementWriterFunc func(),\n) {\n\tf.writeBody(\n\t\topenBrace,\n\t\tcloseBrace,\n\t\telementWriterFunc,\n\t\tf.writeOpenBracePrefix,\n\t\tf.writeBodyEndInline,\n\t)\n}\n\n// writeBody writes the body of a type or value, e.g. message, enum, compact options, etc.\n// The elementWriterFunc is used to write the declarations within the composite type (e.g.\n// fields in a message). The openBraceWriterFunc and closeBraceWriterFunc functions are used\n// to customize how the '{' and '} nodes are written, respectively.\nfunc (f *formatter) writeBody(\n\topenBrace *ast.RuneNode,\n\tcloseBrace *ast.RuneNode,\n\telementWriterFunc func(),\n\topenBraceWriterFunc func(ast.Node),\n\tcloseBraceWriterFunc func(ast.Node, bool),\n) {\n\tif elementWriterFunc == nil && !f.hasInteriorComments(openBrace, closeBrace) {\n\t\t// completely empty body\n\t\tf.writeInline(openBrace)\n\t\tcloseBraceWriterFunc(closeBrace, true)\n\t\treturn\n\t}\n\n\topenBraceWriterFunc(openBrace)\n\tif elementWriterFunc != nil {\n\t\telementWriterFunc()\n\t}\n\tcloseBraceWriterFunc(closeBrace, false)\n}\n\n// writeOpenBracePrefix writes the open brace with its leading comments in-line.\n// This is used for nearly every use case of f.writeBody, excluding the instances\n// in array literals.\nfunc (f *formatter) writeOpenBracePrefix(openBrace ast.Node) {\n\tdefer f.SetPreviousNode(openBrace)\n\tinfo := f.nodeInfo(openBrace)\n\tif info.LeadingComments().Len() > 0 {\n\t\tf.writeInlineComments(info.LeadingComments())\n\t\tif info.LeadingWhitespace() != \"\" {\n\t\t\tf.Space()\n\t\t}\n\t}\n\tf.writeNode(openBrace)\n\tif info.TrailingComments().Len() > 0 {\n\t\tf.writeTrailingEndComments(info.TrailingComments())\n\t} else {\n\t\tf.P(\"\")\n\t}\n}\n\n// writeOpenBracePrefixForArray writes the open brace with its leading comments\n// on multiple lines. This is only used for message literals in arrays.\nfunc (f *formatter) writeOpenBracePrefixForArray(openBrace ast.Node) {\n\tdefer f.SetPreviousNode(openBrace)\n\tinfo := f.nodeInfo(openBrace)\n\tif info.LeadingComments().Len() > 0 {\n\t\tf.writeMultilineComments(info.LeadingComments())\n\t}\n\tf.Indent(openBrace)\n\tf.writeNode(openBrace)\n\tif info.TrailingComments().Len() > 0 {\n\t\tf.writeTrailingEndComments(info.TrailingComments())\n\t} else {\n\t\tf.P(\"\")\n\t}\n}\n\n// writeCompoundIdent writes a compound identifier (e.g. '.com.foo.Bar').\nfunc (f *formatter) writeCompoundIdent(compoundIdentNode *ast.CompoundIdentNode) {\n\tif compoundIdentNode.LeadingDot != nil {\n\t\tf.writeInline(compoundIdentNode.LeadingDot)\n\t}\n\tfor i := range compoundIdentNode.Components {\n\t\tif i > 0 {\n\t\t\t// The length of this slice must be exactly len(Components)-1.\n\t\t\tf.writeInline(compoundIdentNode.Dots[i-1])\n\t\t}\n\t\tf.writeInline(compoundIdentNode.Components[i])\n\t}\n}\n\n// writeCompoundIdentForFieldName writes a compound identifier, but handles comments\n// specially for field names.\n//\n// For example,\n//\n//\tmessage Foo {\n//\t  // These are comments attached to bar.\n//\t  bar.v1.Bar bar = 1;\n//\t}\nfunc (f *formatter) writeCompoundIdentForFieldName(compoundIdentNode *ast.CompoundIdentNode) {\n\tif compoundIdentNode.LeadingDot != nil {\n\t\tf.writeStart(compoundIdentNode.LeadingDot, false)\n\t}\n\tfor i := range compoundIdentNode.Components {\n\t\tif i == 0 && compoundIdentNode.LeadingDot == nil {\n\t\t\tf.writeStart(compoundIdentNode.Components[i], false)\n\t\t\tcontinue\n\t\t}\n\t\tif i > 0 {\n\t\t\t// The length of this slice must be exactly len(Components)-1.\n\t\t\tf.writeInline(compoundIdentNode.Dots[i-1])\n\t\t}\n\t\tf.writeInline(compoundIdentNode.Components[i])\n\t}\n}\n\n// writeFieldLabel writes the field label node.\n//\n// For example,\n//\n//\toptional\n//\trepeated\n//\trequired\nfunc (f *formatter) writeFieldLabel(fieldLabel ast.FieldLabel) {\n\tf.WriteString(fieldLabel.Val)\n}\n\n// writeCompoundStringLiteral writes a compound string literal value.\n//\n// For example,\n//\n//\t\"one,\"\n//\t\"two,\"\n//\t\"three\"\nfunc (f *formatter) writeCompoundStringLiteral(\n\tcompoundStringLiteralNode *ast.CompoundStringLiteralNode,\n\tneedsIndent bool,\n\thasTrailingPunctuation bool,\n) {\n\tf.P(\"\")\n\tif needsIndent {\n\t\tf.In()\n\t}\n\tfor i, child := range compoundStringLiteralNode.Children() {\n\t\tif hasTrailingPunctuation && i == len(compoundStringLiteralNode.Children())-1 {\n\t\t\t// inline because there may be a subsequent comma or punctuation from enclosing element\n\t\t\tf.writeStart(child, false)\n\t\t\tbreak\n\t\t}\n\t\tf.writeLineElement(child)\n\t}\n\tif needsIndent {\n\t\tf.Out()\n\t}\n}\n\nfunc (f *formatter) writeCompoundStringLiteralIndent(\n\tcompoundStringLiteralNode *ast.CompoundStringLiteralNode,\n) {\n\tf.writeCompoundStringLiteral(compoundStringLiteralNode, true, false)\n}\n\nfunc (f *formatter) writeCompoundStringLiteralIndentEndInline(\n\tcompoundStringLiteralNode *ast.CompoundStringLiteralNode,\n) {\n\tf.writeCompoundStringLiteral(compoundStringLiteralNode, true, true)\n}\n\nfunc (f *formatter) writeCompoundStringLiteralNoIndentEndInline(\n\tcompoundStringLiteralNode *ast.CompoundStringLiteralNode,\n) {\n\tf.writeCompoundStringLiteral(compoundStringLiteralNode, false, true)\n}\n\n// writeCompoundStringLiteralForArray writes a compound string literal value,\n// but writes its comments suitable for an element in an array literal.\n//\n// The lastElement boolean is used to signal whether or not the value should\n// be written as the last element (i.e. it doesn't have a trailing comma).\nfunc (f *formatter) writeCompoundStringLiteralForArray(\n\tcompoundStringLiteralNode *ast.CompoundStringLiteralNode,\n\tlastElement bool,\n) {\n\tfor i, child := range compoundStringLiteralNode.Children() {\n\t\tif !lastElement && i == len(compoundStringLiteralNode.Children())-1 {\n\t\t\tf.writeStart(child, false)\n\t\t\treturn\n\t\t}\n\t\tf.writeLineElement(child)\n\t}\n}\n\n// writeFloatLiteral writes a float literal value (e.g. '42.2').\nfunc (f *formatter) writeFloatLiteral(floatLiteralNode *ast.FloatLiteralNode) {\n\tf.writeRaw(floatLiteralNode)\n}\n\n// writeSignedFloatLiteral writes a signed float literal value (e.g. '-42.2').\nfunc (f *formatter) writeSignedFloatLiteral(signedFloatLiteralNode *ast.SignedFloatLiteralNode) {\n\tf.writeInline(signedFloatLiteralNode.Sign)\n\tf.writeInline(signedFloatLiteralNode.Float)\n}\n\n// writeSignedFloatLiteralForArray writes a signed float literal value, but writes\n// its comments suitable for an element in an array literal.\n//\n// The lastElement boolean is used to signal whether or not the value should\n// be written as the last element (i.e. it doesn't have a trailing comma).\nfunc (f *formatter) writeSignedFloatLiteralForArray(\n\tsignedFloatLiteralNode *ast.SignedFloatLiteralNode,\n\tlastElement bool,\n) {\n\tf.writeStart(signedFloatLiteralNode.Sign, false)\n\tif lastElement {\n\t\tf.writeLineEnd(signedFloatLiteralNode.Float)\n\t\treturn\n\t}\n\tf.writeInline(signedFloatLiteralNode.Float)\n}\n\n// writeSpecialFloatLiteral writes a special float literal value (e.g. \"nan\" or \"inf\").\nfunc (f *formatter) writeSpecialFloatLiteral(specialFloatLiteralNode *ast.SpecialFloatLiteralNode) {\n\tf.WriteString(specialFloatLiteralNode.KeywordNode.Val)\n}\n\n// writeStringLiteral writes a string literal value (e.g. \"foo\").\n// Note that the raw string is written as-is so that it preserves\n// the quote style used in the original source.\nfunc (f *formatter) writeStringLiteral(stringLiteralNode *ast.StringLiteralNode) {\n\tf.writeRaw(stringLiteralNode)\n}\n\n// writeUintLiteral writes a uint literal (e.g. '42').\nfunc (f *formatter) writeUintLiteral(uintLiteralNode *ast.UintLiteralNode) {\n\tf.writeRaw(uintLiteralNode)\n}\n\n// writeNegativeIntLiteral writes a negative int literal (e.g. '-42').\nfunc (f *formatter) writeNegativeIntLiteral(negativeIntLiteralNode *ast.NegativeIntLiteralNode) {\n\tf.writeInline(negativeIntLiteralNode.Minus)\n\tf.writeInline(negativeIntLiteralNode.Uint)\n}\n\nfunc (f *formatter) writeRaw(n ast.Node) {\n\tinfo := f.nodeInfo(n)\n\tf.WriteString(info.RawText())\n}\n\n// writeNegativeIntLiteralForArray writes a negative int literal value, but writes\n// its comments suitable for an element in an array literal.\n//\n// The lastElement boolean is used to signal whether or not the value should\n// be written as the last element (i.e. it doesn't have a trailing comma).\nfunc (f *formatter) writeNegativeIntLiteralForArray(\n\tnegativeIntLiteralNode *ast.NegativeIntLiteralNode,\n\tlastElement bool,\n) {\n\tf.writeStart(negativeIntLiteralNode.Minus, false)\n\tif lastElement {\n\t\tf.writeLineEnd(negativeIntLiteralNode.Uint)\n\t\treturn\n\t}\n\tf.writeInline(negativeIntLiteralNode.Uint)\n}\n\n// writeIdent writes an identifier (e.g. 'foo').\nfunc (f *formatter) writeIdent(identNode *ast.IdentNode) {\n\tf.WriteString(identNode.Val)\n}\n\n// writeKeyword writes a keyword (e.g. 'syntax').\nfunc (f *formatter) writeKeyword(keywordNode *ast.KeywordNode) {\n\tf.WriteString(keywordNode.Val)\n}\n\n// writeRune writes a rune (e.g. '=').\nfunc (f *formatter) writeRune(runeNode *ast.RuneNode) {\n\tif strings.ContainsRune(\"{[(<\", runeNode.Rune) {\n\t\tf.pendingIndent++\n\t} else if strings.ContainsRune(\"}])>\", runeNode.Rune) {\n\t\tf.pendingIndent--\n\t}\n\tf.WriteString(string(runeNode.Rune))\n}\n\n// writeNode writes the node by dispatching to a function tailored to its concrete type.\n//\n// Comments are handled in each respective write function so that it can determine whether\n// to write the comments in-line or not.\nfunc (f *formatter) writeNode(node ast.Node) {\n\tswitch element := node.(type) {\n\tcase *ast.ArrayLiteralNode:\n\t\tf.writeArrayLiteral(element)\n\tcase *ast.CompactOptionsNode:\n\t\tf.writeCompactOptions(element)\n\tcase *ast.CompoundIdentNode:\n\t\tf.writeCompoundIdent(element)\n\tcase *ast.CompoundStringLiteralNode:\n\t\tf.writeCompoundStringLiteralIndent(element)\n\tcase *ast.EnumNode:\n\t\tf.writeEnum(element)\n\tcase *ast.EnumValueNode:\n\t\tf.writeEnumValue(element)\n\tcase *ast.ExtendNode:\n\t\tf.writeExtend(element)\n\tcase *ast.ExtensionRangeNode:\n\t\tf.writeExtensionRange(element)\n\tcase ast.FieldLabel:\n\t\tf.writeFieldLabel(element)\n\tcase *ast.FieldNode:\n\t\tf.writeField(element)\n\tcase *ast.FieldReferenceNode:\n\t\tf.writeFieldReference(element)\n\tcase *ast.FloatLiteralNode:\n\t\tf.writeFloatLiteral(element)\n\tcase *ast.GroupNode:\n\t\tf.writeGroup(element)\n\tcase *ast.IdentNode:\n\t\tf.writeIdent(element)\n\tcase *ast.ImportNode:\n\t\t// Make no assumptions on node ordering, set first == false to always preserve leading\n\t\t// whitespace.\n\t\tf.writeImport(element, false, false)\n\tcase *ast.KeywordNode:\n\t\tf.writeKeyword(element)\n\tcase *ast.MapFieldNode:\n\t\tf.writeMapField(element)\n\tcase *ast.MapTypeNode:\n\t\tf.writeMapType(element)\n\tcase *ast.MessageNode:\n\t\tf.writeMessage(element)\n\tcase *ast.MessageFieldNode:\n\t\tf.writeMessageField(element)\n\tcase *ast.MessageLiteralNode:\n\t\tf.writeMessageLiteral(element)\n\tcase *ast.NegativeIntLiteralNode:\n\t\tf.writeNegativeIntLiteral(element)\n\tcase *ast.OneofNode:\n\t\tf.writeOneOf(element)\n\tcase *ast.OptionNode:\n\t\tf.writeOption(element)\n\tcase *ast.OptionNameNode:\n\t\tf.writeOptionName(element)\n\tcase *ast.PackageNode:\n\t\t// Make no assumptions on node ordering, set first == false to always preserve leading\n\t\t// whitespace.\n\t\tf.writePackage(element, false)\n\tcase *ast.RangeNode:\n\t\tf.writeRange(element)\n\tcase *ast.ReservedNode:\n\t\tf.writeReserved(element)\n\tcase *ast.RPCNode:\n\t\tf.writeRPC(element)\n\tcase *ast.RPCTypeNode:\n\t\tf.writeRPCType(element)\n\tcase *ast.RuneNode:\n\t\tf.writeRune(element)\n\tcase *ast.ServiceNode:\n\t\tf.writeService(element)\n\tcase *ast.SignedFloatLiteralNode:\n\t\tf.writeSignedFloatLiteral(element)\n\tcase *ast.SpecialFloatLiteralNode:\n\t\tf.writeSpecialFloatLiteral(element)\n\tcase *ast.StringLiteralNode:\n\t\tf.writeStringLiteral(element)\n\tcase *ast.SyntaxNode:\n\t\tf.writeSyntax(element)\n\tcase *ast.UintLiteralNode:\n\t\tf.writeUintLiteral(element)\n\tcase *ast.EmptyDeclNode:\n\t\t// Nothing to do here.\n\tdefault:\n\t\tf.err = errors.Join(f.err, fmt.Errorf(\"unexpected node: %T\", node))\n\t}\n}\n\n// writeStart writes the node across as the start of a line.\n// Start nodes have their leading comments written across\n// multiple lines, but their trailing comments must be written\n// in-line to preserve the line structure.\n//\n// For example,\n//\n//\t// Leading comment on 'message'.\n//\t// Spread across multiple lines.\n//\tmessage /* This is a trailing comment on 'message' */ Foo {}\n//\n// Newlines are preserved, so that any logical grouping of elements\n// is maintained in the formatted result.\n//\n// For example,\n//\n//\t// Type represents a set of different types.\n//\tenum Type {\n//\t  // Unspecified is the naming convention for default enum values.\n//\t  TYPE_UNSPECIFIED = 0;\n//\n//\t  // The following elements are the real values.\n//\t  TYPE_ONE = 1;\n//\t  TYPE_TWO = 2;\n//\t}\n//\n// Start nodes are always indented according to the formatter's\n// current level of indentation (e.g. nested messages, fields, etc).\n//\n// Note that this is one of the most complex component of the formatter - it\n// controls how each node should be separated from one another and preserves\n// newlines in the original source.\nfunc (f *formatter) writeStart(node ast.Node, ignoreLeadingWhitespace bool) {\n\tf.writeStartMaybeCompact(node, false, ignoreLeadingWhitespace)\n}\n\nfunc (f *formatter) writeStartMaybeCompact(\n\tnode ast.Node,\n\tforceCompact bool,\n\tignoreLeadingWhitespace bool,\n) {\n\tdefer f.SetPreviousNode(node)\n\tinfo := f.nodeInfo(node)\n\tvar (\n\t\tnodeNewlineCount = newlineCount(info.LeadingWhitespace())\n\t\tcompact          = forceCompact || isOpenBrace(f.previousNode)\n\t)\n\tif ignoreLeadingWhitespace {\n\t\t// If we are asked to ignore leading whitespace, then we forcibly set nodeNewlineCount\n\t\t// to 0, effectively ignoring the leading whitespace line count.\n\t\tnodeNewlineCount = 0\n\t}\n\tif length := info.LeadingComments().Len(); length > 0 {\n\t\t// If leading comments are defined, the whitespace we care about\n\t\t// is attached to the first comment.\n\t\tf.writeMultilineCommentsMaybeCompact(info.LeadingComments(), forceCompact)\n\t\tif !forceCompact && nodeNewlineCount > 1 {\n\t\t\t// At this point, we're looking at the lines between\n\t\t\t// a comment and the node its attached to.\n\t\t\t//\n\t\t\t// If the last comment is a standard comment, a single newline\n\t\t\t// character is sufficient to warrant a separation of the\n\t\t\t// two.\n\t\t\t//\n\t\t\t// If the last comment is a C-style comment, multiple newline\n\t\t\t// characters are required because C-style comments don't consume\n\t\t\t// a newline.\n\t\t\tf.P(\"\")\n\t\t}\n\t} else if !compact && nodeNewlineCount > 1 {\n\t\t// If the previous node is an open brace, this is the first element\n\t\t// in the body of a composite type, so we don't want to write a\n\t\t// newline. This makes it so that trailing newlines are removed.\n\t\t//\n\t\t// For example,\n\t\t//\n\t\t//  message Foo {\n\t\t//\n\t\t//    string bar = 1;\n\t\t//  }\n\t\t//\n\t\t// Is formatted into the following:\n\t\t//\n\t\t//  message Foo {\n\t\t//    string bar = 1;\n\t\t//  }\n\t\tf.P(\"\")\n\t}\n\tf.Indent(node)\n\tf.writeNode(node)\n\tif info.TrailingComments().Len() > 0 {\n\t\tf.writeInlineComments(info.TrailingComments())\n\t}\n}\n\n// writeInline writes the node and its surrounding comments in-line.\n//\n// This is useful for writing individual nodes like keywords, runes,\n// string literals, etc.\n//\n// For example,\n//\n//\t// This is a leading comment on the syntax keyword.\n//\tsyntax = /* This is a leading comment on 'proto3' */\" proto3\";\nfunc (f *formatter) writeInline(node ast.Node) {\n\tf.inline = true\n\tdefer func() {\n\t\tf.inline = false\n\t}()\n\tif _, ok := node.(ast.CompositeNode); ok {\n\t\t// We only want to write comments for terminal nodes.\n\t\t// Otherwise comments accessible from CompositeNodes\n\t\t// will be written twice.\n\t\tf.writeNode(node)\n\t\treturn\n\t}\n\tdefer f.SetPreviousNode(node)\n\tinfo := f.nodeInfo(node)\n\tif info.LeadingComments().Len() > 0 {\n\t\tf.writeInlineComments(info.LeadingComments())\n\t\tif info.LeadingWhitespace() != \"\" {\n\t\t\tf.Space()\n\t\t}\n\t}\n\tf.writeNode(node)\n\tf.writeInlineComments(info.TrailingComments())\n}\n\n// writeBodyEnd writes the node as the end of a body.\n// Leading comments are written above the token across\n// multiple lines, whereas the trailing comments are\n// written in-line and preserve their format.\n//\n// Body end nodes are always indented according to the\n// formatter's current level of indentation (e.g. nested\n// messages).\n//\n// This is useful for writing a node that concludes a\n// composite node: ']', '}', '>', etc.\n//\n// For example,\n//\n//\tmessage Foo {\n//\t  string bar = 1;\n//\t  // Leading comment on '}'.\n//\t} // Trailing comment on '}.\nfunc (f *formatter) writeBodyEnd(node ast.Node, leadingEndline bool) {\n\tif _, ok := node.(ast.CompositeNode); ok {\n\t\t// We only want to write comments for terminal nodes.\n\t\t// Otherwise comments accessible from CompositeNodes\n\t\t// will be written twice.\n\t\tf.writeNode(node)\n\t\tif f.lastWritten != '\\n' {\n\t\t\tf.P(\"\")\n\t\t}\n\t\treturn\n\t}\n\tdefer f.SetPreviousNode(node)\n\tinfo := f.nodeInfo(node)\n\tif leadingEndline {\n\t\tif info.LeadingComments().Len() > 0 {\n\t\t\tf.writeInlineComments(info.LeadingComments())\n\t\t\tif info.LeadingWhitespace() != \"\" {\n\t\t\t\tf.Space()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tf.writeMultilineComments(info.LeadingComments())\n\t\tf.Indent(node)\n\t}\n\tf.writeNode(node)\n\tf.writeTrailingEndComments(info.TrailingComments())\n}\n\nfunc (f *formatter) writeLineElement(node ast.Node) {\n\tf.writeBodyEnd(node, false)\n}\n\n// writeBodyEndInline writes the node as the end of a body.\n// Leading comments are written above the token across\n// multiple lines, whereas the trailing comments are\n// written in-line and adapt their comment style if they\n// exist.\n//\n// Body end nodes are always indented according to the\n// formatter's current level of indentation (e.g. nested\n// messages).\n//\n// This is useful for writing a node that concludes either\n// compact options or an array literal.\n//\n// This is behaviorally similar to f.writeStart, but it ignores\n// the preceding newline logic because these body ends should\n// always be compact.\n//\n// For example,\n//\n//\tmessage Foo {\n//\t  string bar = 1 [\n//\t    deprecated = true\n//\n//\t    // Leading comment on ']'.\n//\t  ] /* Trailing comment on ']' */ ;\n//\t}\nfunc (f *formatter) writeBodyEndInline(node ast.Node, leadingInline bool) {\n\tif _, ok := node.(ast.CompositeNode); ok {\n\t\t// We only want to write comments for terminal nodes.\n\t\t// Otherwise comments accessible from CompositeNodes\n\t\t// will be written twice.\n\t\tf.writeNode(node)\n\t\treturn\n\t}\n\tdefer f.SetPreviousNode(node)\n\tinfo := f.nodeInfo(node)\n\tif leadingInline {\n\t\tif info.LeadingComments().Len() > 0 {\n\t\t\tf.writeInlineComments(info.LeadingComments())\n\t\t\tif info.LeadingWhitespace() != \"\" {\n\t\t\t\tf.Space()\n\t\t\t}\n\t\t}\n\t} else {\n\t\tf.writeMultilineComments(info.LeadingComments())\n\t\tf.Indent(node)\n\t}\n\tf.writeNode(node)\n\tif info.TrailingComments().Len() > 0 {\n\t\tf.writeInlineComments(info.TrailingComments())\n\t}\n}\n\n// writeLineEnd writes the node so that it ends a line.\n//\n// This is useful for writing individual nodes like ';' and other\n// tokens that conclude the end of a single line. In this case, we\n// don't want to transform the trailing comment's from '//' to C-style\n// because it's not necessary.\n//\n// For example,\n//\n//\t// This is a leading comment on the syntax keyword.\n//\tsyntax = \" proto3\" /* This is a leading comment on the ';'; // This is a trailing comment on the ';'.\nfunc (f *formatter) writeLineEnd(node ast.Node) {\n\tif _, ok := node.(ast.CompositeNode); ok {\n\t\t// We only want to write comments for terminal nodes.\n\t\t// Otherwise comments accessible from CompositeNodes\n\t\t// will be written twice.\n\t\tf.writeNode(node)\n\t\tif f.lastWritten != '\\n' {\n\t\t\tf.P(\"\")\n\t\t}\n\t\treturn\n\t}\n\tdefer f.SetPreviousNode(node)\n\tinfo := f.nodeInfo(node)\n\tif info.LeadingComments().Len() > 0 {\n\t\tf.writeInlineComments(info.LeadingComments())\n\t\tif info.LeadingWhitespace() != \"\" {\n\t\t\tf.Space()\n\t\t}\n\t}\n\tf.writeNode(node)\n\tf.Space()\n\tf.writeTrailingEndComments(info.TrailingComments())\n}\n\n// writeMultilineComments writes the given comments as a newline-delimited block.\n// This is useful for both the beginning of a type (e.g. message, field, etc), as\n// well as the trailing comments attached to the beginning of a body block (e.g.\n// '{', '[', '<', etc).\n//\n// For example,\n//\n//\t// This is a comment spread across\n//\t// multiple lines.\n//\tmessage Foo {}\nfunc (f *formatter) writeMultilineComments(comments ast.Comments) {\n\tf.writeMultilineCommentsMaybeCompact(comments, false)\n}\n\nfunc (f *formatter) writeMultilineCommentsMaybeCompact(comments ast.Comments, forceCompact bool) {\n\tcompact := forceCompact || isOpenBrace(f.previousNode)\n\tfor i := range comments.Len() {\n\t\tcomment := comments.Index(i)\n\t\tif !compact && newlineCount(comment.LeadingWhitespace()) > 1 {\n\t\t\t// Newlines between blocks of comments should be preserved.\n\t\t\t//\n\t\t\t// For example,\n\t\t\t//\n\t\t\t//  // This is a license header\n\t\t\t//  // spread across multiple lines.\n\t\t\t//\n\t\t\t//  // Package pet.v1 defines a PetStore API.\n\t\t\t//  package pet.v1;\n\t\t\t//\n\t\t\tf.P(\"\")\n\t\t}\n\t\tcompact = false\n\t\tf.writeComment(comment.RawText())\n\t\tf.WriteString(\"\\n\")\n\t}\n}\n\n// writeInlineComments writes the given comments in-line. Standard comments are\n// transformed to C-style comments so that we can safely write the comment in-line.\n//\n// Nearly all of these comments will already be C-style comments. The only cases we're\n// preventing are when the type is defined across multiple lines.\n//\n// For example, given the following:\n//\n//\textend . google. // in-line comment\n//\t protobuf .\n//\t  ExtensionRangeOptions {\n//\t   optional string label = 20000;\n//\t  }\n//\n// The formatted result is shown below:\n//\n//\textend .google.protobuf./* in-line comment */ExtensionRangeOptions {\n//\t  optional string label = 20000;\n//\t}\nfunc (f *formatter) writeInlineComments(comments ast.Comments) {\n\tfor i := range comments.Len() {\n\t\tif i > 0 || comments.Index(i).LeadingWhitespace() != \"\" || f.lastWritten == ';' || f.lastWritten == '}' {\n\t\t\tf.Space()\n\t\t}\n\t\ttext := comments.Index(i).RawText()\n\t\tif after, ok := strings.CutPrefix(text, \"//\"); ok {\n\t\t\ttext = strings.TrimSpace(after)\n\t\t\ttext = \"/* \" + text + \" */\"\n\t\t} else {\n\t\t\t// no multi-line comments\n\t\t\tlines := strings.Split(text, \"\\n\")\n\t\t\tfor i := range lines {\n\t\t\t\tlines[i] = strings.TrimSpace(lines[i])\n\t\t\t}\n\t\t\ttext = strings.Join(lines, \" \")\n\t\t}\n\t\tf.WriteString(text)\n\t}\n}\n\n// writeTrailingEndComments writes the given comments at the end of a line and\n// preserves the comment style. This is useful or writing comments attached to\n// things like ';' and other tokens that conclude a type definition on a single\n// line.\n//\n// If there is a newline between this trailing comment and the previous node, the\n// comments are written immediately underneath the node on a newline.\n//\n// For example,\n//\n//\tenum Type {\n//\t  TYPE_UNSPECIFIED = 0;\n//\t}\n//\t// This comment is attached to the '}'\n//\t// So is this one.\nfunc (f *formatter) writeTrailingEndComments(comments ast.Comments) {\n\tfor i := range comments.Len() {\n\t\tcomment := comments.Index(i)\n\t\tif i > 0 || comment.LeadingWhitespace() != \"\" {\n\t\t\tf.Space()\n\t\t}\n\t\tf.writeComment(comment.RawText())\n\t}\n\tf.P(\"\")\n}\n\nfunc (f *formatter) writeComment(comment string) {\n\tif strings.HasPrefix(comment, \"/*\") && newlineCount(comment) > 0 {\n\t\tlines := strings.Split(comment, \"\\n\")\n\t\t// find minimum indent, so we can make all other lines relative to that\n\t\tminIndent := -1 // sentinel that means unset\n\t\t// start at 1 because line at index zero starts with \"/*\", not whitespace\n\t\tvar prefix string\n\t\tfor i := 1; i < len(lines); i++ {\n\t\t\tindent, ok := computeIndent(lines[i])\n\t\t\tif ok && (minIndent == -1 || indent < minIndent) {\n\t\t\t\tminIndent = indent\n\t\t\t}\n\t\t\tif i > 1 && len(prefix) == 0 {\n\t\t\t\t// no shared prefix\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tline := strings.TrimSpace(lines[i])\n\t\t\tif line == \"*/\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar linePrefix string\n\t\t\tif len(line) > 0 && isCommentPrefix(line[0]) {\n\t\t\t\tlinePrefix = line[:1]\n\t\t\t}\n\t\t\tif i == 1 {\n\t\t\t\tprefix = linePrefix\n\t\t\t} else if linePrefix != prefix {\n\t\t\t\t// they do not share prefix\n\t\t\t\tprefix = \"\"\n\t\t\t}\n\t\t}\n\t\tif minIndent < 0 {\n\t\t\t// This shouldn't be necessary.\n\t\t\t// But we do it just in case, to avoid possible panic\n\t\t\tminIndent = 0\n\t\t}\n\t\tfor i, line := range lines {\n\t\t\ttrimmedLine := strings.TrimSpace(line)\n\t\t\tif trimmedLine == \"\" || trimmedLine == \"*/\" || len(prefix) > 0 {\n\t\t\t\tline = trimmedLine\n\t\t\t} else {\n\t\t\t\t// we only trim space from the right; for the left,\n\t\t\t\t// we unindent based on indentation found above.\n\t\t\t\tline = unindent(line, minIndent)\n\t\t\t\tline = strings.TrimRightFunc(line, unicode.IsSpace)\n\t\t\t}\n\t\t\t// If we have a block comment with no prefix, we'll format\n\t\t\t// like so:\n\n\t\t\t/*\n\t\t\t   This is a multi-line comment example.\n\t\t\t   It has no comment prefix on each line.\n\t\t\t*/\n\n\t\t\t// But if there IS a prefix, \"|\" for example, we'll left-align\n\t\t\t// the prefix symbol under the asterisk of the comment start\n\t\t\t// like this:\n\n\t\t\t/*\n\t\t\t | This comment has a prefix before each line.\n\t\t\t | Usually the prefix is asterisk, but it's a\n\t\t\t | pipe in this example.\n\t\t\t*/\n\n\t\t\t// Finally, if the comment prefix is an asterisk, we'll left-align\n\t\t\t// the comment end so its asterisk also aligns, like so:\n\n\t\t\t/*\n\t\t\t * This comment has a prefix before each line.\n\t\t\t * Usually the prefix is asterisk, which is the\n\t\t\t * case in this example.\n\t\t\t */\n\n\t\t\tif i > 0 && line != \"*/\" {\n\t\t\t\tif len(prefix) == 0 {\n\t\t\t\t\tline = \"   \" + line\n\t\t\t\t} else {\n\t\t\t\t\tline = \" \" + line\n\t\t\t\t}\n\t\t\t}\n\t\t\tif line == \"*/\" && prefix == \"*\" {\n\t\t\t\t// align the comment end with the other asterisks\n\t\t\t\tline = \" \" + line\n\t\t\t}\n\n\t\t\tif i != len(lines)-1 {\n\t\t\t\tf.P(line)\n\t\t\t} else {\n\t\t\t\t// for last line, we don't use P because we don't\n\t\t\t\t// want to print a trailing newline\n\t\t\t\tf.Indent(nil)\n\t\t\t\tf.WriteString(line)\n\t\t\t}\n\t\t}\n\t} else {\n\t\tf.Indent(nil)\n\t\tf.WriteString(strings.TrimSpace(comment))\n\t}\n}\n\nfunc isCommentPrefix(ch byte) bool {\n\tr := rune(ch)\n\t// A multi-line comment prefix is *usually* an asterisk, like in the following\n\t/*\n\t * Foo\n\t * Bar\n\t * Baz\n\t */\n\t// But we'll allow other prefixes. But if it's a letter or number, it's not a prefix.\n\treturn !unicode.IsLetter(r) && !unicode.IsNumber(r)\n}\n\nfunc unindent(s string, unindent int) string {\n\tpos := 0\n\tfor i, r := range s {\n\t\tif pos == unindent {\n\t\t\treturn s[i:]\n\t\t}\n\t\tif pos > unindent {\n\t\t\t// removing tab-stop unindented too far, so we\n\t\t\t// add back some spaces to compensate\n\t\t\treturn strings.Repeat(\" \", pos-unindent) + s[i:]\n\t\t}\n\n\t\tswitch r {\n\t\tcase ' ':\n\t\t\tpos++\n\t\tcase '\\t':\n\t\t\t// jump to next tab stop\n\t\t\tpos += 8 - (pos % 8)\n\t\tdefault:\n\t\t\treturn s[i:]\n\t\t}\n\t}\n\t// nothing but whitespace...\n\treturn \"\"\n}\n\nfunc computeIndent(s string) (int, bool) {\n\tif strings.TrimSpace(s) == \"*/\" {\n\t\treturn 0, false\n\t}\n\tindent := 0\n\tfor _, r := range s {\n\t\tswitch r {\n\t\tcase ' ':\n\t\t\tindent++\n\t\tcase '\\t':\n\t\t\t// jump to next tab stop\n\t\t\tindent += 8 - (indent % 8)\n\t\tdefault:\n\t\t\treturn indent, true\n\t\t}\n\t}\n\t// if we get here, line is nothing but whitespace\n\treturn 0, false\n}\n\nfunc (f *formatter) leadingCommentsContainBlankLine(n ast.Node) bool {\n\tinfo := f.nodeInfo(n)\n\tcomments := info.LeadingComments()\n\tfor i := range comments.Len() {\n\t\tif newlineCount(comments.Index(i).LeadingWhitespace()) > 1 {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn newlineCount(info.LeadingWhitespace()) > 1\n}\n\nfunc (f *formatter) importHasComment(importNode *ast.ImportNode) bool {\n\tif f.nodeHasComment(importNode) {\n\t\treturn true\n\t}\n\tif importNode == nil {\n\t\treturn false\n\t}\n\n\treturn f.nodeHasComment(importNode.Keyword) ||\n\t\tf.nodeHasComment(importNode.Name) ||\n\t\tf.nodeHasComment(importNode.Semicolon) ||\n\t\tf.nodeHasComment(importNode.Public) ||\n\t\tf.nodeHasComment(importNode.Weak)\n}\n\nfunc (f *formatter) nodeHasComment(node ast.Node) bool {\n\t// when node != nil, node's value could be nil, see: https://go.dev/doc/faq#nil_error\n\tif node == nil || reflect.ValueOf(node).IsNil() {\n\t\treturn false\n\t}\n\n\tnodeinfo := f.nodeInfo(node)\n\treturn nodeinfo.LeadingComments().Len() > 0 ||\n\t\tnodeinfo.TrailingComments().Len() > 0\n}\n\nfunc (f *formatter) setTrailingComments(node ast.Node, comments ast.Comments) {\n\tf.overrideTrailingComments[node] = comments\n}\n\nfunc (f *formatter) nodeInfo(node ast.Node) nodeInfo {\n\tinfo := f.fileNode.NodeInfo(node)\n\tif trailingComments, ok := f.overrideTrailingComments[node]; ok {\n\t\treturn infoWithTrailingComments{info, trailingComments}\n\t}\n\treturn info\n}\n\ntype nodeInfo interface {\n\tStart() ast.SourcePos\n\tEnd() ast.SourcePos\n\tLeadingComments() ast.Comments\n\tTrailingComments() ast.Comments\n\tLeadingWhitespace() string\n\tRawText() string\n}\n\ntype infoWithTrailingComments struct {\n\tast.NodeInfo\n\ttrailing ast.Comments\n}\n\nfunc (n infoWithTrailingComments) TrailingComments() ast.Comments {\n\treturn n.trailing\n}\n\n// importSortOrder maps import types to a sort order number, so it can be compared and sorted.\n// `import`=3, `import public`=2, `import weak`=1\nfunc importSortOrder(node *ast.ImportNode) int {\n\tswitch {\n\tcase node.Public != nil:\n\t\treturn 2\n\tcase node.Weak != nil:\n\t\treturn 1\n\tdefault:\n\t\treturn 3\n\t}\n}\n\n// stringForOptionName returns the string representation of the given option name node.\n// This is used for sorting file-level options.\nfunc stringForOptionName(optionNameNode *ast.OptionNameNode) string {\n\tvar result strings.Builder\n\tfor j, part := range optionNameNode.Parts {\n\t\tif j > 0 {\n\t\t\t// Add a dot between each of the parts.\n\t\t\tresult.WriteString(\".\")\n\t\t}\n\t\tresult.WriteString(stringForFieldReference(part))\n\t}\n\treturn result.String()\n}\n\n// stringForFieldReference returns the string representation of the given field reference.\n// This is used for sorting file-level options.\nfunc stringForFieldReference(fieldReference *ast.FieldReferenceNode) string {\n\tvar result string\n\tif fieldReference.Open != nil {\n\t\tresult += \"(\"\n\t}\n\tresult += string(fieldReference.Name.AsIdentifier())\n\tif fieldReference.Close != nil {\n\t\tresult += \")\"\n\t}\n\treturn result\n}\n\n// isOpenBrace returns true if the given node represents one of the\n// possible open brace tokens, namely '{', '[', or '<'.\nfunc isOpenBrace(node ast.Node) bool {\n\tif node == nil {\n\t\treturn false\n\t}\n\truneNode, ok := node.(*ast.RuneNode)\n\tif !ok {\n\t\treturn false\n\t}\n\treturn runeNode.Rune == '{' || runeNode.Rune == '[' || runeNode.Rune == '<'\n}\n\n// newlineCount returns the number of newlines in the given value.\n// This is useful for determining whether or not we should preserve\n// the newline between nodes.\n//\n// The newlines don't need to be adjacent to each other - all of the\n// tokens between them are other whitespace characters, so we can\n// safely ignore them.\nfunc newlineCount(value string) int {\n\treturn strings.Count(value, \"\\n\")\n}\n\nfunc messageLiteralOpen(msg *ast.MessageLiteralNode) *ast.RuneNode {\n\tnode := msg.Open\n\tif node.Rune == '{' {\n\t\treturn node\n\t}\n\t// If it's not \"{\" then this message literal used \"<\" and \">\" to enclose it.\n\t// For consistent formatted output, change it to \"{\".\n\treturn ast.NewRuneNode('{', node.Token())\n}\n\nfunc messageLiteralClose(msg *ast.MessageLiteralNode) *ast.RuneNode {\n\tnode := msg.Close\n\tif node.Rune == '}' {\n\t\treturn node\n\t}\n\t// If it's not \"}\" then this message literal used \"<\" and \">\" to enclose it.\n\t// For consistent formatted output, change it to \"}\".\n\treturn ast.NewRuneNode('}', node.Token())\n}\n\n// writeDeprecatedOption writes \"option deprecated = true;\" on its own line.\n// This is used to inject deprecation options for types that should be deprecated.\nfunc (f *formatter) writeDeprecatedOption() {\n\tf.Indent(nil)\n\tf.WriteString(\"option deprecated = true;\")\n\tf.P(\"\")\n}\n\n// currentFQN returns the current fully-qualified name.\nfunc (f *formatter) currentFQN() string {\n\treturn f.packageFQN\n}\n\n// pushFQN appends a name component to the current FQN and returns a function to restore it.\nfunc (f *formatter) pushFQN(name string) func() {\n\toriginal := f.packageFQN\n\tif f.packageFQN == \"\" {\n\t\tf.packageFQN = name\n\t} else {\n\t\tf.packageFQN = f.packageFQN + \".\" + name\n\t}\n\treturn func() {\n\t\tf.packageFQN = original\n\t}\n}\n\n// shouldInjectDeprecation returns true if the given FQN should have a deprecated option injected.\n// It also sets deprecationMatched to true if the FQN matches the prefix.\nfunc (f *formatter) shouldInjectDeprecation(fqn string) bool {\n\tif f.deprecation == nil {\n\t\treturn false\n\t}\n\tif f.deprecation.matchesPrefix(fqn) {\n\t\tf.deprecationMatched = true\n\t\treturn true\n\t}\n\treturn false\n}\n\n// shouldInjectDeprecationExact returns true if the given FQN should have a deprecated option\n// injected using exact matching (for fields and enum values).\n// It also sets deprecationMatched to true if the FQN matches exactly.\nfunc (f *formatter) shouldInjectDeprecationExact(fqn string) bool {\n\tif f.deprecation == nil {\n\t\treturn false\n\t}\n\tif f.deprecation.matchesExact(fqn) {\n\t\tf.deprecationMatched = true\n\t\treturn true\n\t}\n\treturn false\n}\n\n// writeCompactDeprecatedOption writes \" [deprecated = true]\" for compact options.\nfunc (f *formatter) writeCompactDeprecatedOption() {\n\tf.WriteString(\" [deprecated = true]\")\n}\n"
  },
  {
    "path": "private/buf/bufformat/formatter_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufformat\n\nimport (\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/diff\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestFormatter(t *testing.T) {\n\tt.Parallel()\n\ttestFormatCustomOptions(t)\n\ttestFormatEditions(t)\n\ttestFormatProto2(t)\n\ttestFormatProto3(t)\n\ttestFormatHeader(t)\n}\n\nfunc testFormatCustomOptions(t *testing.T) {\n\ttestFormatNoDiff(t, \"testdata/customoptions\")\n}\n\nfunc testFormatEditions(t *testing.T) {\n\ttestFormatNoDiff(t, \"testdata/editions/2023\")\n\ttestFormatError(t, \"testdata/editions/2024\", `edition \"2024\" not yet fully supported; latest supported edition \"2023\"`)\n}\n\nfunc testFormatProto2(t *testing.T) {\n\ttestFormatNoDiff(t, \"testdata/proto2/enum/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/extend/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/field/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/group/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/header/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/license/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/message/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/option/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/quotes/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto2/utf8/v1\")\n}\n\nfunc testFormatProto3(t *testing.T) {\n\ttestFormatNoDiff(t, \"testdata/proto3/all/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto3/block/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto3/file/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto3/header/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto3/literal/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto3/oneof/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto3/range/v1\")\n\ttestFormatNoDiff(t, \"testdata/proto3/service/v1\")\n}\n\nfunc testFormatHeader(t *testing.T) {\n\ttestFormatNoDiff(t, \"testdata/header\")\n}\n\nfunc testFormatNoDiff(t *testing.T, path string) {\n\tt.Run(path, func(t *testing.T) {\n\t\tctx := t.Context()\n\t\tbucket, err := storageos.NewProvider().NewReadWriteBucket(path)\n\t\trequire.NoError(t, err)\n\n\t\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, slogtestext.NewLogger(t), bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\t\tmoduleSetBuilder.AddLocalModule(bucket, path, true)\n\t\tmoduleSet, err := moduleSetBuilder.Build()\n\t\trequire.NoError(t, err)\n\t\tformatBucket, err := FormatModuleSet(ctx, moduleSet)\n\t\trequire.NoError(t, err)\n\t\tassertGolden := func(formatBucket storage.ReadBucket) {\n\t\t\terr := storage.WalkReadObjects(\n\t\t\t\tctx,\n\t\t\t\tformatBucket,\n\t\t\t\t\"\",\n\t\t\t\tfunc(formattedFile storage.ReadObject) error {\n\t\t\t\t\tformattedData, err := io.ReadAll(formattedFile)\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\texpectedPath := strings.Replace(formattedFile.Path(), \".proto\", \".golden\", 1)\n\t\t\t\t\texpectedData, err := storage.ReadPath(ctx, bucket, expectedPath)\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\tfileDiff, err := diff.Diff(ctx, expectedData, formattedData, expectedPath, formattedFile.Path()+\" (formatted)\")\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\trequire.Empty(t, string(fileDiff))\n\t\t\t\t\treturn nil\n\t\t\t\t},\n\t\t\t)\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t\tassertGolden(formatBucket)\n\n\t\tmoduleSetBuilder = bufmodule.NewModuleSetBuilder(ctx, slogtestext.NewLogger(t), bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\t\tmoduleSetBuilder.AddLocalModule(formatBucket, path, true)\n\t\tmoduleSet, err = moduleSetBuilder.Build()\n\t\trequire.NoError(t, err)\n\t\treformattedBucket, err := FormatModuleSet(ctx, moduleSet)\n\t\trequire.NoError(t, err)\n\t\tassertGolden(reformattedBucket)\n\t})\n}\n\nfunc testFormatError(t *testing.T, path string, errContains string) {\n\tt.Run(path, func(t *testing.T) {\n\t\tctx := t.Context()\n\t\tbucket, err := storageos.NewProvider().NewReadWriteBucket(path)\n\t\trequire.NoError(t, err)\n\t\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, slogtestext.NewLogger(t), bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\t\tmoduleSetBuilder.AddLocalModule(bucket, path, true)\n\t\tmoduleSet, err := moduleSetBuilder.Build()\n\t\trequire.NoError(t, err)\n\t\t_, err = FormatModuleSet(ctx, moduleSet)\n\t\trequire.ErrorContains(t, err, errContains)\n\t})\n}\n\nfunc TestFormatterWithDeprecation(t *testing.T) {\n\tt.Parallel()\n\t// Test basic deprecation with prefix matching\n\ttestDeprecateNoDiff(t, \"basic\", \"testdata/deprecate\", []string{\"test.deprecate\"},\n\t\t[]string{\"already_deprecated.proto\", \"nested_types.proto\"})\n\t// Test field deprecation with exact match\n\ttestDeprecateNoDiff(t, \"field\", \"testdata/deprecate\", []string{\"test.deprecate\", \"test.deprecate.MyMessage.id\"},\n\t\t[]string{\"field_deprecation.proto\"})\n\t// Test enum value deprecation with exact match\n\ttestDeprecateNoDiff(t, \"enum_value\", \"testdata/deprecate\", []string{\n\t\t\"test.deprecate\",\n\t\t\"test.deprecate.STATUS_ACTIVE\",\n\t\t\"test.deprecate.STATUS_INACTIVE\",\n\t\t\"test.deprecate.OuterMessage.NESTED_STATUS_ACTIVE\",\n\t}, []string{\"enum_value_deprecation.proto\"})\n}\n\nfunc testDeprecateNoDiff(t *testing.T, name string, path string, deprecatePrefixes []string, files []string) {\n\tt.Run(name, func(t *testing.T) {\n\t\tctx := t.Context()\n\t\tbucket, err := storageos.NewProvider().NewReadWriteBucket(path)\n\t\trequire.NoError(t, err)\n\t\tvar opts []FormatOption\n\t\tfor _, prefix := range deprecatePrefixes {\n\t\t\topts = append(opts, WithDeprecate(prefix))\n\t\t}\n\t\tvar matchers []storage.Matcher\n\t\tfor _, file := range files {\n\t\t\tmatchers = append(matchers, storage.MatchPathEqual(file))\n\t\t}\n\t\tfilteredBucket := storage.FilterReadBucket(bucket, storage.MatchOr(matchers...))\n\t\tassertGolden := func(formatBucket storage.ReadBucket) {\n\t\t\terr := storage.WalkReadObjects(\n\t\t\t\tctx,\n\t\t\t\tformatBucket,\n\t\t\t\t\"\",\n\t\t\t\tfunc(formattedFile storage.ReadObject) error {\n\t\t\t\t\tformattedData, err := io.ReadAll(formattedFile)\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\texpectedPath := strings.Replace(formattedFile.Path(), \".proto\", \".golden\", 1)\n\t\t\t\t\texpectedData, err := storage.ReadPath(ctx, bucket, expectedPath)\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\tfileDiff, err := diff.Diff(ctx, expectedData, formattedData, expectedPath, formattedFile.Path()+\" (formatted)\")\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\trequire.Empty(t, string(fileDiff), \"formatted output differs from golden file for %s\", formattedFile.Path())\n\t\t\t\t\treturn nil\n\t\t\t\t},\n\t\t\t)\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t\t// First pass: format with deprecation options\n\t\tformatBucket, err := FormatBucket(ctx, filteredBucket, opts...)\n\t\trequire.NoError(t, err)\n\t\tassertGolden(formatBucket)\n\t\t// Second pass: re-format the already-formatted output to verify stability\n\t\treformatBucket, err := FormatBucket(ctx, formatBucket, opts...)\n\t\trequire.NoError(t, err)\n\t\tassertGolden(reformatBucket)\n\t})\n}\n\nfunc TestFormatBucketNoTypesMatchedError(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tbucket, err := storageos.NewProvider().NewReadWriteBucket(\"testdata/deprecate\")\n\trequire.NoError(t, err)\n\t// Use a prefix that won't match anything in the deprecate testdata\n\t_, err = FormatBucket(ctx, bucket, WithDeprecate(\"nonexistent.package\"))\n\trequire.Error(t, err)\n\trequire.Contains(t, err.Error(), \"no types matched\")\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/customoptions/options.golden",
    "content": "syntax = \"proto3\";\n\npackage custom;\n\nimport \"google/protobuf/descriptor.proto\";\n\n// Thing is a thing.\nmessage Thing {\n  int64 foo = 1;\n  int64 bar = 2;\n  string baz = 3;\n  bool truth = 4;\n  Thing recursive = 5;\n  repeated int64 repeated_foo = 6;\n  repeated Thing repeated_thing = 7;\n  repeated string repeated_baz = 8;\n}\n// this is a comment after Thing\n\nextend google.protobuf.MessageOptions {\n  bool message_option = 80001;\n  string string_message_option = 80002;\n  Thing message_thing_option = 80003;\n}\n\nextend google.protobuf.FileOptions {\n  bool file_option = 80002;\n  string string_file_option = 80003;\n  Thing file_thing_option = 80004;\n}\n\nextend google.protobuf.FieldOptions {\n  bool field_option = 80006;\n  Thing field_thing_option = 80007;\n  repeated int64 repeated_field_option = 80017;\n  repeated Thing repeated_field_thing_option = 80018;\n  float float_field_option = 80019;\n  double double_field_option = 80020;\n  int32 int32_field_option = 80021;\n  int64 int64_field_option = 80022;\n  uint32 uint32_field_option = 80023;\n  uint64 uint64_field_option = 80024;\n  sint32 sint32_field_option = 80025;\n  sint64 sint64_field_option = 80026;\n  fixed32 fixed32_field_option = 80027;\n  fixed64 fixed64_field_option = 80028;\n  sfixed32 sfixed32_field_option = 80029;\n  sfixed64 sfixed64_field_option = 80030;\n  bool bool_field_option = 80031;\n  bytes bytes_field_option = 80032;\n  string string_field_option = 80033;\n}\n\nextend google.protobuf.OneofOptions {\n  bool oneof_option = 80008;\n  Thing oneof_thing_option = 80009;\n}\n\nextend google.protobuf.MethodOptions {\n  bool method_option = 80010;\n  Thing method_thing_option = 80011;\n}\n\nextend google.protobuf.EnumOptions {\n  bool enum_option = 80012;\n  Thing enum_thing_option = 80014;\n}\n\nextend google.protobuf.EnumValueOptions {\n  bool enum_value_option = 80015;\n  Thing enum_value_thing_option = 80016;\n}\n\n// this is a comment before service options\nextend google.protobuf.ServiceOptions {\n  bool service_option = 80012;\n  Thing service_thing_option = 80014;\n}\n// this is a comment after service options\n\nextend google.protobuf.ExtensionRangeOptions {\n  bool extension_range_option = 80012;\n  Thing extension_range_thing_option = 80014;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/customoptions/options.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/descriptor.proto\";\n\npackage custom;\n\n// Thing is a thing.\nmessage Thing {\n  int64 foo = 1;\n  int64 bar = 2;\n  string baz = 3;\n  bool truth = 4;\n  Thing recursive = 5;\n  repeated int64 repeated_foo = 6;\n  repeated Thing repeated_thing = 7;\n  repeated string repeated_baz = 8;\n}\n// this is a comment after Thing\n\nextend google.protobuf.MessageOptions {\n  bool message_option = 80001;\n  string string_message_option = 80002;\n  Thing message_thing_option = 80003;\n}\n\nextend google.protobuf.FileOptions {\n  bool file_option = 80002;\n  string string_file_option = 80003;\n  Thing file_thing_option = 80004;\n}\n\nextend google.protobuf.FieldOptions {\n  bool field_option = 80006;\n  Thing field_thing_option = 80007;\n  repeated int64 repeated_field_option = 80017;\n  repeated Thing repeated_field_thing_option = 80018;\n  float float_field_option = 80019;\n  double double_field_option = 80020;\n  int32 int32_field_option = 80021;\n  int64 int64_field_option = 80022;\n  uint32 uint32_field_option = 80023;\n  uint64 uint64_field_option = 80024;\n  sint32 sint32_field_option = 80025;\n  sint64 sint64_field_option = 80026;\n  fixed32 fixed32_field_option = 80027;\n  fixed64 fixed64_field_option = 80028;\n  sfixed32 sfixed32_field_option = 80029;\n  sfixed64 sfixed64_field_option = 80030;\n  bool bool_field_option = 80031;\n  bytes bytes_field_option = 80032;\n  string string_field_option = 80033;\n}\n\nextend google.protobuf.OneofOptions {\n  bool oneof_option = 80008;\n  Thing oneof_thing_option = 80009;\n}\n\nextend google.protobuf.MethodOptions {\n  bool method_option = 80010;\n  Thing method_thing_option = 80011;\n}\n\nextend google.protobuf.EnumOptions {\n  bool enum_option = 80012;\n  Thing enum_thing_option = 80014;\n}\n\nextend google.protobuf.EnumValueOptions {\n  bool enum_value_option = 80015;\n  Thing enum_value_thing_option = 80016;\n}\n// this is a comment before service options\nextend google.protobuf.ServiceOptions {\n  bool service_option = 80012;\n  Thing service_thing_option = 80014;\n}\n// this is a comment after service options\n\nextend google.protobuf.ExtensionRangeOptions {\n  bool extension_range_option = 80012;\n  Thing extension_range_thing_option = 80014;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/already_deprecated.golden",
    "content": "syntax = \"proto2\";\n\npackage test.deprecate;\n\noption cc_enable_arenas = true;\n// File already has deprecated option - should not add duplicate.\noption deprecated = true;\n\n// Message already deprecated - should not add duplicate.\nmessage AlreadyDeprecatedMessage {\n  option deprecated = true;\n  optional string name = 1;\n}\n\n// Message with other options but not deprecated - should add deprecated.\nmessage MessageWithOtherOptions {\n  option deprecated = true;\n  option no_standard_descriptor_accessor = true;\n  optional string name = 1;\n}\n\n// Message with deprecated and other options - should not add duplicate.\nmessage MessageWithDeprecatedAndOtherOptions {\n  option deprecated = true;\n  option no_standard_descriptor_accessor = true;\n  optional string name = 1;\n}\n\n// Message to test field deprecation.\nmessage MessageWithFields {\n  option deprecated = true;\n  // Field already deprecated - should not add duplicate.\n  optional string already_deprecated_field = 1 [deprecated = true];\n  // Field with other options but not deprecated - stays as is (not in exact match list).\n  optional NestedMessage field_with_other_options = 2 [lazy = true];\n  // Field with deprecated and other options - should not add duplicate.\n  optional NestedMessage field_with_deprecated_and_other_options = 3 [\n    deprecated = true,\n    lazy = true\n  ];\n  // Nested message for lazy fields.\n  message NestedMessage {\n    option deprecated = true;\n    optional string value = 1;\n  }\n}\n\n// Enum already deprecated - should not add duplicate.\nenum AlreadyDeprecatedEnum {\n  option deprecated = true;\n  ALREADY_DEPRECATED_ENUM_UNSPECIFIED = 0;\n  ALREADY_DEPRECATED_ENUM_VALUE = 1;\n}\n\n// Enum with other options but not deprecated - should add deprecated.\nenum EnumWithOtherOptions {\n  option deprecated = true;\n  option allow_alias = true;\n  ENUM_WITH_OTHER_OPTIONS_UNSPECIFIED = 0;\n  ENUM_WITH_OTHER_OPTIONS_VALUE = 1;\n  ENUM_WITH_OTHER_OPTIONS_ALIAS = 1;\n}\n\n// Enum with deprecated and other options - should not add duplicate.\nenum EnumWithDeprecatedAndOtherOptions {\n  option deprecated = true;\n  option allow_alias = true;\n  ENUM_WITH_DEPRECATED_AND_OTHER_OPTIONS_UNSPECIFIED = 0;\n  ENUM_WITH_DEPRECATED_AND_OTHER_OPTIONS_VALUE = 1;\n  ENUM_WITH_DEPRECATED_AND_OTHER_OPTIONS_ALIAS = 1;\n}\n\n// Enum to test enum value deprecation.\nenum EnumWithValues {\n  option deprecated = true;\n  ENUM_WITH_VALUES_UNSPECIFIED = 0;\n  // Enum value already deprecated - should not add duplicate.\n  ENUM_WITH_VALUES_ALREADY_DEPRECATED = 1 [deprecated = true];\n  // Enum value with other options - stays as is (not in exact match list).\n  ENUM_WITH_VALUES_WITH_OTHER_OPTIONS = 2 [debug_redact = true];\n  // Enum value with deprecated and other options - should not add duplicate.\n  ENUM_WITH_VALUES_WITH_DEPRECATED_AND_OTHER = 3 [\n    deprecated = true,\n    debug_redact = true\n  ];\n}\n\n// Service already deprecated - should not add duplicate.\nservice AlreadyDeprecatedService {\n  option deprecated = true;\n  rpc GetData(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage) {\n    option deprecated = true;\n  }\n}\n\n// Service with other methods to test method deprecation.\nservice ServiceWithMethods {\n  option deprecated = true;\n  // Method already deprecated - should not add duplicate.\n  rpc AlreadyDeprecatedMethod(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage) {\n    option deprecated = true;\n  }\n  // Method with other options but not deprecated - should add deprecated.\n  rpc MethodWithOtherOptions(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage) {\n    option deprecated = true;\n    option idempotency_level = IDEMPOTENT;\n  }\n  // Method with deprecated and other options - should not add duplicate.\n  rpc MethodWithDeprecatedAndOtherOptions(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage) {\n    option deprecated = true;\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/already_deprecated.proto",
    "content": "syntax = \"proto2\";\n\npackage test.deprecate;\n\noption cc_enable_arenas = true;\n// File already has deprecated option - should not add duplicate.\noption deprecated = true;\n\n// Message already deprecated - should not add duplicate.\nmessage AlreadyDeprecatedMessage {\n  option deprecated = true;\n  optional string name = 1;\n}\n\n// Message with other options but not deprecated - should add deprecated.\nmessage MessageWithOtherOptions {\n  option no_standard_descriptor_accessor = true;\n  optional string name = 1;\n}\n\n// Message with deprecated and other options - should not add duplicate.\nmessage MessageWithDeprecatedAndOtherOptions {\n  option deprecated = true;\n  option no_standard_descriptor_accessor = true;\n  optional string name = 1;\n}\n\n// Message to test field deprecation.\nmessage MessageWithFields {\n  option deprecated = true;\n  // Field already deprecated - should not add duplicate.\n  optional string already_deprecated_field = 1 [deprecated = true];\n  // Field with other options but not deprecated - stays as is (not in exact match list).\n  optional NestedMessage field_with_other_options = 2 [lazy = true];\n  // Field with deprecated and other options - should not add duplicate.\n  optional NestedMessage field_with_deprecated_and_other_options = 3 [\n    deprecated = true,\n    lazy = true\n  ];\n  // Nested message for lazy fields.\n  message NestedMessage {\n    option deprecated = true;\n    optional string value = 1;\n  }\n}\n\n// Enum already deprecated - should not add duplicate.\nenum AlreadyDeprecatedEnum {\n  option deprecated = true;\n  ALREADY_DEPRECATED_ENUM_UNSPECIFIED = 0;\n  ALREADY_DEPRECATED_ENUM_VALUE = 1;\n}\n\n// Enum with other options but not deprecated - should add deprecated.\nenum EnumWithOtherOptions {\n  option allow_alias = true;\n  ENUM_WITH_OTHER_OPTIONS_UNSPECIFIED = 0;\n  ENUM_WITH_OTHER_OPTIONS_VALUE = 1;\n  ENUM_WITH_OTHER_OPTIONS_ALIAS = 1;\n}\n\n// Enum with deprecated and other options - should not add duplicate.\nenum EnumWithDeprecatedAndOtherOptions {\n  option deprecated = true;\n  option allow_alias = true;\n  ENUM_WITH_DEPRECATED_AND_OTHER_OPTIONS_UNSPECIFIED = 0;\n  ENUM_WITH_DEPRECATED_AND_OTHER_OPTIONS_VALUE = 1;\n  ENUM_WITH_DEPRECATED_AND_OTHER_OPTIONS_ALIAS = 1;\n}\n\n// Enum to test enum value deprecation.\nenum EnumWithValues {\n  option deprecated = true;\n  ENUM_WITH_VALUES_UNSPECIFIED = 0;\n  // Enum value already deprecated - should not add duplicate.\n  ENUM_WITH_VALUES_ALREADY_DEPRECATED = 1 [deprecated = true];\n  // Enum value with other options - stays as is (not in exact match list).\n  ENUM_WITH_VALUES_WITH_OTHER_OPTIONS = 2 [debug_redact = true];\n  // Enum value with deprecated and other options - should not add duplicate.\n  ENUM_WITH_VALUES_WITH_DEPRECATED_AND_OTHER = 3 [\n    deprecated = true,\n    debug_redact = true\n  ];\n}\n\n// Service already deprecated - should not add duplicate.\nservice AlreadyDeprecatedService {\n  option deprecated = true;\n  rpc GetData(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage);\n}\n\n// Service with other methods to test method deprecation.\nservice ServiceWithMethods {\n  option deprecated = true;\n  // Method already deprecated - should not add duplicate.\n  rpc AlreadyDeprecatedMethod(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage) {\n    option deprecated = true;\n  }\n  // Method with other options but not deprecated - should add deprecated.\n  rpc MethodWithOtherOptions(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // Method with deprecated and other options - should not add duplicate.\n  rpc MethodWithDeprecatedAndOtherOptions(AlreadyDeprecatedMessage) returns (AlreadyDeprecatedMessage) {\n    option deprecated = true;\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/enum_value_deprecation.golden",
    "content": "syntax = \"proto2\";\n\npackage test.deprecate;\n\nimport \"google/protobuf/descriptor.proto\";\n\noption deprecated = true;\n\nextend google.protobuf.EnumValueOptions {\n  optional string string_name = 123456789;\n}\n\nenum Status {\n  option deprecated = true;\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1 [deprecated = true];\n  STATUS_INACTIVE = 2 [\n    deprecated = true,\n    (string_name) = \"display_value\"\n  ];\n}\n\n// Message with nested enum to test nested enum value FQN.\nmessage OuterMessage {\n  option deprecated = true;\n  enum NestedStatus {\n    option deprecated = true;\n    NESTED_STATUS_UNSPECIFIED = 0;\n    NESTED_STATUS_ACTIVE = 1 [deprecated = true];\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/enum_value_deprecation.proto",
    "content": "syntax = \"proto2\";\n\npackage test.deprecate;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.EnumValueOptions {\n  optional string string_name = 123456789;\n}\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_INACTIVE = 2 [(string_name) = \"display_value\"];\n}\n\n// Message with nested enum to test nested enum value FQN.\nmessage OuterMessage {\n  enum NestedStatus {\n    NESTED_STATUS_UNSPECIFIED = 0;\n    NESTED_STATUS_ACTIVE = 1;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/field_deprecation.golden",
    "content": "syntax = \"proto3\";\n\npackage test.deprecate;\n\noption deprecated = true;\n\nmessage MyMessage {\n  option deprecated = true;\n  string name = 1;\n  int32 id = 2 [deprecated = true];\n  bool active = 3;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/field_deprecation.proto",
    "content": "syntax = \"proto3\";\n\npackage test.deprecate;\n\nmessage MyMessage {\n  string name = 1;\n  int32 id = 2;\n  bool active = 3;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/nested_types.golden",
    "content": "syntax = \"proto3\";\n\npackage test.deprecate;\n\noption deprecated = true;\n\n// Outer message - should be deprecated.\nmessage OuterMessage {\n  option deprecated = true;\n  string name = 1;\n\n  // Nested message - should also be deprecated.\n  message NestedMessage {\n    option deprecated = true;\n    string value = 1;\n  }\n\n  // Nested enum - should also be deprecated.\n  enum NestedEnum {\n    option deprecated = true;\n    NESTED_ENUM_UNSPECIFIED = 0;\n    NESTED_ENUM_VALUE = 1;\n  }\n}\n\n// Top-level enum - should be deprecated.\nenum TopLevelEnum {\n  option deprecated = true;\n  TOP_LEVEL_ENUM_UNSPECIFIED = 0;\n  TOP_LEVEL_ENUM_VALUE = 1;\n}\n\n// Service - should be deprecated.\nservice TestService {\n  option deprecated = true;\n  rpc GetMessage(OuterMessage) returns (OuterMessage) {\n    option deprecated = true;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/deprecate/nested_types.proto",
    "content": "syntax = \"proto3\";\n\npackage test.deprecate;\n\n// Outer message - should be deprecated.\nmessage OuterMessage {\n  string name = 1;\n\n  // Nested message - should also be deprecated.\n  message NestedMessage {\n    string value = 1;\n  }\n\n  // Nested enum - should also be deprecated.\n  enum NestedEnum {\n    NESTED_ENUM_UNSPECIFIED = 0;\n    NESTED_ENUM_VALUE = 1;\n  }\n}\n\n// Top-level enum - should be deprecated.\nenum TopLevelEnum {\n  TOP_LEVEL_ENUM_UNSPECIFIED = 0;\n  TOP_LEVEL_ENUM_VALUE = 1;\n}\n\n// Service - should be deprecated.\nservice TestService {\n  rpc GetMessage(OuterMessage) returns (OuterMessage);\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/editions/2023/editions.golden",
    "content": "edition = \"2023\";\n\npackage a.b.c;\n\nimport \"google/protobuf/descriptor.proto\";\n\noption features.(string_feature) = \"abc\";\noption features.field_presence = IMPLICIT;\noption features.message_encoding = DELIMITED;\n\nextend google.protobuf.FeatureSet {\n  string string_feature = 9995;\n}\n\nextend google.protobuf.FieldOptions {\n  string string_option = 50000;\n}\n\nmessage Foo {\n  uint64 id = 1 [(string_option) = \"xyz\"];\n  string str = 2 [\n    features.field_presence = EXPLICIT,\n    default = \"str\"\n  ];\n  Foo child = 3;\n  Enum en = 4;\n\n  reserved abc, def, ghi_jkl, __xyz__;\n  reserved 10, 11, 12;\n}\n\nenum Enum {\n  ZERO = 0;\n  ONE = 1;\n  TWO = 2;\n\n  reserved 10, 11;\n  reserved TEN, ELEVEN, __100__;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/editions/2023/editions.proto",
    "content": "edition = \"2023\";\n\npackage a.b.c;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FeatureSet {\n  string string_feature = 9995;\n}\n\noption features.(string_feature) = \"abc\";\n\noption features.message_encoding = DELIMITED;\noption features.field_presence = IMPLICIT;\n\nextend google.protobuf.FieldOptions {\n  string string_option = 50000;\n}\n\nmessage Foo {\n  uint64 id = 1 [(string_option) = \"xyz\"];\n  string str = 2 [features.field_presence = EXPLICIT, default = \"str\"];\n  Foo child = 3;\n  Enum en = 4;\n\n  reserved abc, def, ghi_jkl, __xyz__;\n  reserved 10, 11, 12;\n}\n\nenum Enum {\n  ZERO = 0;\n  ONE = 1;\n  TWO = 2;\n\n  reserved 10, 11;\n  reserved TEN, ELEVEN, __100__;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/editions/2024/editions.proto",
    "content": "edition = \"2024\";\n\npackage a.b.c;\n\nimport option \"google/protobuf/descriptor.proto\";\n"
  },
  {
    "path": "private/buf/bufformat/testdata/header/nopackage.golden",
    "content": "import \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\noption java_package = \"com.foo.bar\";\n"
  },
  {
    "path": "private/buf/bufformat/testdata/header/nopackage.proto",
    "content": "\n\n\nimport \"google/protobuf/timestamp.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\n\nimport \"google/protobuf/any.proto\";\n\noption java_package = \"com.foo.bar\";\n\n\n\n"
  },
  {
    "path": "private/buf/bufformat/testdata/header/nosyntax.golden",
    "content": "package buf.alpha.audit.v1alpha1;\n\nimport \"google/protobuf/descriptor.proto\";\n"
  },
  {
    "path": "private/buf/bufformat/testdata/header/nosyntax.proto",
    "content": "import \"google/protobuf/descriptor.proto\";\n\npackage buf.alpha.audit.v1alpha1;\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/empty.golden",
    "content": "enum Foo {\n  FOO_UNKNOWN = 1;\n  /* C-style comment in the middle */\n}\n\nenum Bar {\n  BAR_UNKNOWN = 1;\n  // Normal comment in the middle\n}\n\nenum Baz {\n  BAZ_UNKNOWN = 1;\n  // Body comment.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/empty.proto",
    "content": "enum Foo { FOO_UNKNOWN = 1; /* C-style comment in the middle */ }\n\nenum Bar {\n  BAR_UNKNOWN = 1;\n  // Normal comment in the middle\n}\n\nenum Baz {\n  BAZ_UNKNOWN = 1;\n// Body comment.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum.golden",
    "content": "// Leading comment on Type.\n// Another leading comment on Type.\nenum Type {\n  // Trailing comment on Type.\n  // Another trailing comment on Type.\n  // A third trailing comment on Type.\n\n  TYPE_UNSPECIFIED /* Comment before '=' */ = /* Comment after '=' */ 0 [deprecated = true];\n\n  TYPE_ONE = 1; // In-line comment on TYPE_ONE.\n\n  // TYPE_TWO leading comment.\n  TYPE_TWO = 2 /* Before the ';' */;\n\n  // Leading comment on '}'.\n} // Trailing comment on '}'.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum.proto",
    "content": "// Leading comment on Type.\n  // Another leading comment on Type.\n  enum    Type    {\n           // Trailing comment on Type.\n    // Another trailing comment on Type.\n              // A third trailing comment on Type.\n\n      TYPE_UNSPECIFIED /* Comment before '=' */   = /* Comment after '=' */  0  [ deprecated =     true ];\n\n\n  TYPE_ONE = 1; // In-line comment on TYPE_ONE.\n\n       // TYPE_TWO leading comment.\n    TYPE_TWO    = 2 /* Before the ';' */;\n\n  // Leading comment on '}'.\n  } // Trailing comment on '}'.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum_trailing_comment.golden",
    "content": "syntax = \"proto2\";\n\nenum Type {\n  TYPE_UNSPECIFIED = 0;\n}\n// This is a trailing comment on '}', but\n// it should remain here.\n\n// These comments are attached to the EOF.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum_trailing_comment.proto",
    "content": "syntax = \"proto2\";\n\nenum Type {\n  TYPE_UNSPECIFIED = 0;\n}\n// This is a trailing comment on '}', but\n// it should remain here.\n\n\n\n// These comments are attached to the EOF.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum_trailing_newline.golden",
    "content": "enum One {\n  // This value should be formatted to the top\n  // because the newline is meaningless.\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  // The trailing comments should remain separated.\n\n  TWO_UNSPECIFIED = 0;\n}\n\nenum Three {\n  // The trailing comments should remain at the top.\n\n  // The leading comments should continue to be separated.\n  THREE_UNSPECIFIED = 0;\n}\n\n// FOUR_UNSPECIFIED should be compact because it has\n// no trailing or leading comments.\nenum Four {\n  FOUR_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum_trailing_newline.proto",
    "content": "enum One {\n\n  // This value should be formatted to the top\n  // because the newline is meaningless.\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  // The trailing comments should remain separated.\n\n  TWO_UNSPECIFIED = 0;\n}\n\nenum Three {\n  // The trailing comments should remain at the top.\n\n  // The leading comments should continue to be separated.\n  THREE_UNSPECIFIED = 0;\n}\n\n// FOUR_UNSPECIFIED should be compact because it has\n// no trailing or leading comments.\nenum Four {\n\n  FOUR_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum_value_trailing_comment.golden",
    "content": "syntax = \"proto2\";\n\nenum Foo {\n  FOO_UNSPECIFIED = 0;\n  // There are no other enum values.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/enum/v1/enum_value_trailing_comment.proto",
    "content": "syntax = \"proto2\";\n\nenum Foo {\n  FOO_UNSPECIFIED = 0;\n  // There are no other enum values.\n\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/extend/v1/empty.golden",
    "content": "message Foo {\n  extensions 2, 3;\n\n  optional string name = 1;\n}\n\nextend Foo {\n  // Trailing comment on '{'.\n\n  // Leading comment on value.\n  optional string value = 2 [deprecated = true]; // Trailing comment on value.\n\n  // Leading comment on Additional.\n  optional group Additional = 3 [deprecated = false] {\n    optional int64 four = 4;\n    optional int64 five = 5;\n  } // Trailing comment on Additional.\n\n  // Leading comment on '}'.\n} // Trailing comment on '}'.\n// Another trailing comment on '}'.\n\n// Comment on EOF.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/extend/v1/empty.proto",
    "content": "message Foo {\n  extensions 2, 3;\n\n  optional string name = 1;\n}\n\nextend Foo {\n  // Trailing comment on '{'.\n\n  // Leading comment on value.\n  optional string value = 2 [ \n    deprecated = true\n  ]; // Trailing comment on value.\n\n  // Leading comment on Additional.\n  optional group Additional = 3 [\n    deprecated = false\n  ] {\n    optional int64 four = 4;\n    optional int64 five = 5;\n  } // Trailing comment on Additional.\n\n// Leading comment on '}'.\n} // Trailing comment on '}'.\n// Another trailing comment on '}'.\n\n// Comment on EOF.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/field/v1/option.golden",
    "content": "import \"custom.proto\";\n\nmessage Foo {\n  // Leading comment on map field.\n  map<string, int64> pairs = 1 [\n    deprecated = true,\n    lazy = true\n  ];\n  /*\n     Heading 1:\n         Some content goes here.\n         \t\t\t\t\t\t   More content indented with tabs.\n         Last bit.\n     Heading 2:\n         - bullet\n         - another bullet\n            1. nested bullet\n            2. nested bullet again\n         - last bullet\n        Last bit of content.\n  */\n\n  // Leading comment on name_with_options.\n  optional string name_with_options = 2 [\n    (custom.float_field_option) = \"nan\",\n    (custom.double_field_option) = \"inf\",\n    (custom.int32_field_option) = -3,\n    (custom.int64_field_option) = -4,\n    (custom.uint32_field_option) = 5,\n    (custom.uint64_field_option) = 6,\n    (custom.sint32_field_option) = -7,\n    (custom.sint64_field_option) = -8,\n    (custom.fixed32_field_option) = 9,\n    (custom.fixed64_field_option) = 10,\n    (custom.sfixed32_field_option) = -11,\n    (custom.sfixed64_field_option) = -12,\n    (custom.bytes_field_option) = \"fcf7c1b8749cf99d88e5f34271d636178fb5d130\"\n  ]; /* foo\n     bar\n      baz\n       buzz */\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/field/v1/option.proto",
    "content": "import \"custom.proto\";\n\nmessage Foo {\n  // Leading comment on map field.\n     map<  string,  int64  > pairs = 1 [ deprecated = true,        lazy = true    ] ;\n/*\n            Heading 1:\n                Some content goes here.\n\t\t\t\t\t\t\t\t   More content indented with tabs.\n                Last bit.\n            Heading 2:\n                - bullet\n                - another bullet\n                   1. nested bullet\n                   2. nested bullet again\n                - last bullet\n               Last bit of content.\n           */\n\n         // Leading comment on name_with_options.\n   optional string name_with_options = 2 [\n   (custom.float_field_option) = \"nan\",\n      (custom.double_field_option) = \"inf\",   \n    (custom.int32_field_option) = -3,\n          (custom.int64_field_option) = -4,\n    (custom.uint32_field_option) = 5,\n(custom.uint64_field_option) = 6,\n    (custom.sint32_field_option) = -7,\n(custom.sint64_field_option) = -8,\n    (custom.fixed32_field_option) = 9,\n(custom.fixed64_field_option) = 10,\n    (custom.sfixed32_field_option) = -11,\n(custom.sfixed64_field_option) = -12,\n(custom.bytes_field_option) = \"fcf7c1b8749cf99d88e5f34271d636178fb5d130\"\n\n\n   ]   ; /* foo\n             bar\n              baz\n               buzz */\n\n        }\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/group/v1/empty.golden",
    "content": "message Foo {\n  optional group Bar = 1 {}\n}\n\nmessage Bar {\n  optional group Baz = 2 {\n    /* Comment inside the empty group */\n  }\n}\n\nmessage Baz {\n  optional group Qux = 3 {\n    // Trailing comment on '{'.\n    // Another trailing comment on '{'.\n\n    // Leading comment on '}'.\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/group/v1/empty.proto",
    "content": "message Foo {\n    optional group Bar = 1\n        {    }\n}\n\nmessage Bar {\n    optional group Baz =  2   { /* Comment inside the empty group */    }\n}\n\nmessage Baz {\n    optional group Qux =  3   {\n    // Trailing comment on '{'.\n    // Another trailing comment on '{'.\n\n    // Leading comment on '}'.\n    }\n}\n\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/header/v1/import.golden",
    "content": "// This should be first.\n/* This should be second */\nimport /* A well-known type */ \"google/protobuf/descriptor.proto\"; // In-line on the descriptor.proto import.\nimport /* Another well-known type */ \"google/protobuf/type.proto\"; // In-line on the type.proto import.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/header/v1/import.proto",
    "content": "     // This should be first.\n  /* This should be second */   import   /* A well-known type */    \"google/protobuf/descriptor.proto\"; // In-line on the descriptor.proto import.\nimport /* Another well-known type */    \"google/protobuf/type.proto\"; // In-line on the type.proto import.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/header/v1/option.golden",
    "content": "// The cc_enable_arenas option is defined below.\noption cc_enable_arenas = true /* Sometimes false */;\noption go_package = \"github.com/foo/bar\";\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/header/v1/option.proto",
    "content": " \n    // The cc_enable_arenas option is defined below.    \n  option cc_enable_arenas = true /* Sometimes false */ ;\n   option go_package = \"github.com/foo/bar\";\n    \n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/header/v1/package.golden",
    "content": "// File header attached to package node.\n\n/* Package prefix */\npackage header/*Between 'header' and the '.'*/./* Between ',' and 'v1' */v1; // In-line comment.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/header/v1/package.proto",
    "content": "// File header attached to package node.\n\n/* Package prefix */ package header/*Between 'header' and the '.'*/./* Between ',' and 'v1' */v1    ; // In-line comment.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/license/v1/enum.golden",
    "content": "/*\n   This is a license header.\n   It's separated be a newline\n   before the enums.\n*/\n\nenum Foo {\n  FOO_UNKNOWN = 1;\n}\nenum Bar {\n  BAR_UNKNOWN = 1;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/license/v1/enum.proto",
    "content": "/*\n   This is a license header.\n   It's separated be a newline\n   before the enums.\n*/\n\n\nenum Foo { FOO_UNKNOWN = 1;}\nenum Bar {BAR_UNKNOWN=1;}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/license/v1/message.golden",
    "content": "// This is a license header.\n// It's separated be a newline\n// before the messages.\n\nmessage Foo {}\nmessage Bar {}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/license/v1/message.proto",
    "content": "// This is a license header.\n// It's separated be a newline\n// before the messages.\n\n\n\nmessage Foo {}\nmessage Bar {}\n\n\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/empty.golden",
    "content": "message Foo {\n  /* C-style comment in the middle */\n}\n\nmessage Bar {\n  // Normal comment in the middle\n}\n\nmessage Baz {\n  // Body comment.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/empty.proto",
    "content": "message Foo { /* C-style comment in the middle */ }\n\nmessage Bar {\n  // Normal comment in the middle\n}\n\nmessage Baz {\n\n// Body comment.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message.golden",
    "content": "syntax = \"proto2\";\n\nmessage Foo {\n  // The newline is not preserved between the message\n  // and the first element if there aren't any trailing\n  // comments on the '{'.\n  option deprecated = false;\n\n  // This is attached to the optional label.\n  optional string name = 1 [deprecated = true];\n\n  repeated int64 values = 2;\n\n  // Leading comment on '}'.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message.proto",
    "content": "syntax = \"proto2\";\n\nmessage Foo {\n\n\n\n  // The newline is not preserved between the message\n  // and the first element if there aren't any trailing\n  // comments on the '{'.\n  option deprecated = false;\n\n  // This is attached to the optional label.\n  optional string name = 1 [\n    deprecated = true\n  ];\n\n  repeated int64 values = 2;\n\n// Leading comment on '}'.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_extensions.golden",
    "content": "syntax = \"proto2\";\n\nmessage Foo {\n  extensions 43 to /* Comment before 100 */ 100;\n  extensions /* Comment before 101 */ 101 to max /* Comment after max */;\n  extensions 1 /* After 1 */, 2 /* After bar */;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_extensions.proto",
    "content": "syntax = \"proto2\";\n\nmessage Foo    {        \n     extensions 43 to /* Comment before 100 */ 100; \nextensions /* Comment before 101 */ 101 to max /* Comment after max */;\n  extensions 1 /* After 1 */ , 2 /* After bar */ ;\n\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_group.golden",
    "content": "syntax = \"proto2\";\n\n// The following messages should all stay grouped together.\nmessage Foo {}\nmessage Bar {}\nmessage Baz {}\nmessage Qux {}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_group.proto",
    "content": "syntax = \"proto2\";\n\n\n\n// The following messages should all stay grouped together.\nmessage Foo {}\nmessage Bar {}\nmessage Baz {}\nmessage Qux {}\n\n\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_import.golden",
    "content": "syntax = \"proto2\";\n\nimport \"custom.proto\";\n\nmessage Thing { // Trailing comment on '}'.\n  // Leading comment on thing field.\n  optional custom.Thing thing = 1; // Trailing comment on thing field.\n\n  // Leading comment on '}',\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_import.proto",
    "content": "syntax = \"proto2\";\n\nimport \"custom.proto\";\n\nmessage Thing { // Trailing comment on '}'.\n\n  // Leading comment on thing field.\n  optional custom.Thing thing = 1; // Trailing comment on thing field.\n\n// Leading comment on '}',\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_options.golden",
    "content": "syntax = \"proto2\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  // Leading comment on deprecated.\n  option deprecated = false;\n  option /* Comment before the custom option name */ (custom.message_thing_option).foo = /* Comment on the bar value of the option */ 1;\n  option /* Comment before the custom option name */ (custom.message_thing_option)/* Comment between the name and the field */.bar = /* Comment on the foo value of the option */ 2;\n  option (custom.message_thing_option) = {\n    // This should be a trailing comment block on the message literal.\n    // It's spread across multiple lines.\n\n    /* Leading comment on the 'foo' element */\n    foo: 1\n    /* Comment on bar */\n    bar: 2\n    /* Comment on truth */\n    truth: false\n  };\n\n  option (custom.message_thing_option) = {\n    /*leading*/\n    foo: 1\n    /*trailing*/\n  } /*leading*/; /*trailing*/\n\n  // This is attached to the optional label.\n  optional string name = 1 [deprecated = true];\n  repeated int64 values = 2 [\n    /* leading comment */\n    packed = false\n    /* trailing comment */\n  ];\n\n  option (custom.message_thing_option) = {\n    foo: 1\n    bar: 2\n    baz: 3\n    buzz: {\n      a: \"abc\"\n      b: \"xyz\"\n      c: [\n        /*lead*/\n        \"foo\",\n        \"bar\",\n        \"baz\"\n        /*trail*/\n      ]\n      d: [\n        {foo: 99},\n        {foo: 98},\n        {\n          /*lead*/\n          foo: 97\n          /*trail*/\n        }\n      ]\n      e: []\n      f: {}\n      g: [1]\n    }\n    frobnitz: {foo: 1}\n  };\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/message_options.proto",
    "content": "syntax = \"proto2\";\n\n   import \"custom.proto\";\n\nmessage Foo    { \n       // Leading comment on deprecated.\n       option deprecated = false;\n          option /* Comment before the custom option name */ (custom.message_thing_option).foo = /* Comment on the bar value of the option */ 1;\n    option /* Comment before the custom option name */ (custom.message_thing_option)/* Comment between the name and the field */.bar = /* Comment on the foo value of the option */ 2; \noption (custom.message_thing_option) = {\n  // This should be a trailing comment block on the message literal.\n  // It's spread across multiple lines.\n\n /* Leading comment on the 'foo' element */ foo:  1  /* Comment on bar */ bar:   2  /* Comment on truth */  truth:false    }  ;\n\n\n\n      option (custom.message_thing_option)=  { /*leading*/ foo: 1 /*trailing*/ } /*leading*/;/*trailing*/\n\n       // This is attached to the optional label.\n     optional string name = 1 [    deprecated   = true  ]; \n   repeated int64 values = 2 [  /* leading comment */ packed=false /* trailing comment */ ];\n\n\noption (custom.message_thing_option)= {\n  foo:1 bar:2 baz:3\n  buzz:<\n    a:\"abc\" b:\"xyz\"\n    c:[ /*lead*/\"foo\", \"bar\", \"baz\"/*trail*/]\n    d[<\n        foo: 99\n      >,\n      <foo:98>,\n      </*lead*/foo:97/*trail*/>\n    ]\n    e []\n    f { }\n       g: [1]\n  >\n  frobnitz: <foo:1>\n};\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/multiple_nested.golden",
    "content": "syntax = \"proto2\";\n\nmessage Foo {\n  option deprecated = false;\n\n  optional string name = 1 /* Between the '1' and the '[' */ [deprecated = true]; // In-line comment on name.\n\n  // Repeated values comment.\n  repeated int64 values = 2 /* Before the semiolon */;\n\n  message /* Bar is a nested message */ Bar /* Before the '{' */ {\n    /* This one is required */\n    required bool /* Between 'bool' and 'truth' */ truth = 3;\n  }\n  // Comment on the nested Baz message.\n  message Baz {\n    optional string something = 5;\n\n    // Comment on the nested Qux message.\n    message Qux {\n      option deprecated = true;\n\n      option no_standard_descriptor_accessor = false;\n\n      optional string another = 6;\n    }\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/multiple_nested.proto",
    "content": "syntax = \"proto2\";\n\n  message Foo    { \n       \n       option deprecated = false;\n\n     optional string name = 1 /* Between the '1' and the '[' */  [    deprecated   = true  ]; // In-line comment on name.\n   \n// Repeated values comment.\n   repeated int64 values = 2 /* Before the semiolon */   ;\n\n              message   /* Bar is a nested message */ Bar  /* Before the '{' */ {\n\n                             /* This one is required */ required bool /* Between 'bool' and 'truth' */ truth = 3;\n                    }         \n        // Comment on the nested Baz message.\n     message Baz     {\n\n          optional string something = 5;\n   \n                 // Comment on the nested Qux message.\n         message Qux { \n              option deprecated = true;\n            \n             option no_standard_descriptor_accessor = false;\n\n               optional string another = 6;\n         }\n     }\n\n  }\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/nested.golden",
    "content": "syntax = \"proto2\";\n\nmessage Foo {\n  option deprecated = false;\n\n  optional string name = 1 /* Between the '1' and the '[' */ [deprecated = true]; // In-line comment on name.\n\n  // Repeated values comment.\n  repeated int64 values = 2 /* Before the semiolon */;\n\n  message /* Bar is a nested message */ Bar /* Before the '{' */ {\n    /* This one is required */\n    required bool /* Between 'bool' and 'truth' */ truth = 3;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/nested.proto",
    "content": "syntax = \"proto2\";\n\n  message Foo    {        \n       option deprecated = false;\n\n     optional string name = 1 /* Between the '1' and the '[' */  [    deprecated   = true  ]; // In-line comment on name.\n   \n// Repeated values comment.\n   repeated int64 values = 2 /* Before the semiolon */   ;\n\n              message   /* Bar is a nested message */ Bar  /* Before the '{' */ {\n\n                             /* This one is required */ required bool /* Between 'bool' and 'truth' */ truth = 3;\n                    }         \n\n  }\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/sparse.golden",
    "content": "syntax = \"proto2\";\n\nmessage Foo {\n  // This is a trailing comment on the '{'.\n\n  optional string name = 1;\n\n  optional string value = 2; // In-line on value.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/message/v1/sparse.proto",
    "content": "syntax = \"proto2\";\n\nmessage\n\n\n  Foo\n\n{\n\n  // This is a trailing comment on the '{'.\n\n\n                                optional string name = 1;\n\n    optional string value = 2; // In-line on value.\n\n\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option.golden",
    "content": "syntax = \"proto2\";\n\nimport \"custom.proto\";\n\n// Leading comment on Foo.\nmessage Foo {\n  // Trailing comment on Foo.\n\n  // Leading comment on extensions.\n  extensions 5 [\n    // Trailing comment on '['.\n\n    // Leading comment on extension_range_option.\n    (custom.extension_range_option) = true\n\n    // Leading comment on ']'.\n  ];\n\n  // Leading comment on deprecated.\n  option deprecated = true;\n  // Leading comment on message_set_wire_format.\n  option message_set_wire_format = false;\n\n  // Leading comment on something.\n  optional string something = 1 [\n    // Trailing comment on '['.\n    // Another trailing comment on '['.\n\n    // Leading comment on ctype.\n    ctype = CORD,\n    // Leading comment on deprecated.\n    deprecated = true\n  ]; // Trailing comment on ';'.\n  optional group Another = 2 [\n    // Trailing comment on '['.\n\n    // Leading comment on deprecated.\n    deprecated = true, // Trailing comment on deprecated.\n    // Another trailing comment on deprecated.\n\n    // Leading comment on ctype.\n    ctype = CORD\n  ] {\n    // Leading comment on one.\n    required string one = 3 [\n      deprecated = true,\n      ctype = CORD\n    ];\n    // Leading comment on two.\n    required string two = 4 [(custom.field_value_thing) = {}];\n    // Leading comment on three.\n    required string three = 5 [(custom.field_value_thing) = {\n      /* Empty message literal */\n    }];\n    // Leading comment on four.\n    required string four = 6 [(custom.field_value_thing) = {\n      // Trailing comment on '{'.\n      // Another trailing comment on '{'.\n    }];\n    // Leading comment on five.\n    required string five = 7 [(custom.field_value_thing) = {\n      // Trailing comment on '{'.\n\n      // Leading comment on '}'.\n    }];\n  }\n}\n\n// Leading comment on Type.\nenum Type {\n  // Trailing comment on Type.\n\n  // Leading comment on allow_alias.\n  option allow_alias = false;\n  // Leading comment on deprecated.\n  option deprecated = true;\n\n  // Leading comment on TYPE_UNSPECIFIED.\n  TYPE_UNSPECIFIED = 0 [\n    // Trailing comment on '['.\n\n    // Leading comment on deprecated.\n    deprecated = true\n  ]; // Trailing comment on ';'.\n  // Leading comment on TYPE_ONE.\n  TYPE_ONE = 1; // Trailing comment on ';'.\n  // Leading comment on TYPE_TWO.\n  TYPE_TWO = 2 [\n    // Trailing comment on TYPE_TWO.\n\n    // Leading comment on enum_value_thing_option.\n    (custom.enum_value_thing_option) = {\n      // Trailing comment on message literal.\n\n      // Leading comment on foo.\n      foo: 1 // Trailing comment on foo.\n      // Leading comment on bar.\n      bar: 2 // Trailing comment on bar.\n      // Leading comment on recursive.\n      recursive: {\n        // Leading comment on foo.\n        foo: 1\n        // Leading comment on bar.\n        bar: 2\n      }\n    }\n  ];\n}\n\n// Leading comment on Foo extension.\nextend Foo {\n  // Trailing comment on Foo.\n\n  // Leading comment on additional.\n  optional string additional = 5;\n}\n\n// Leading comment on FooService.\nservice FooService {\n  // Trailing comment on FooService.\n\n  // Leading comment on deprecated.\n  option deprecated = true;\n\n  // Leading comment on Foo.\n  rpc Foo(Foo) returns (Foo) {\n    // Trailing comment on Foo.\n\n    // Leading comment on deprecated.\n    option deprecated = true;\n\n    // Leading comment on idempotency_level.\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option.proto",
    "content": "syntax = \"proto2\";\n\nimport \"custom.proto\";\n\n// Leading comment on Foo.\nmessage Foo {\n  // Trailing comment on Foo.\n\n  // Leading comment on extensions.\n  extensions 5 [\n    // Trailing comment on '['.\n\n    // Leading comment on extension_range_option.\n    (custom.extension_range_option) = true\n\n  // Leading comment on ']'.\n  ];\n\n  // Leading comment on deprecated.\n  option deprecated = true;\n  // Leading comment on message_set_wire_format.\n  option message_set_wire_format = false;\n\n  // Leading comment on something.\n  optional string something = 1 [\n    // Trailing comment on '['.\n    // Another trailing comment on '['.\n\n    // Leading comment on ctype.\n    ctype = CORD,\n    // Leading comment on deprecated.\n    deprecated = true\n  ]; // Trailing comment on ';'.\n  optional group Another =  2 [\n    // Trailing comment on '['.\n\n    // Leading comment on deprecated.\n    deprecated = true, // Trailing comment on deprecated.\n    // Another trailing comment on deprecated.\n\n    // Leading comment on ctype.\n    ctype = CORD\n\n  ] {\n    // Leading comment on one.\n    required string one = 3 [\n      deprecated = true,\n      ctype = CORD\n    ];\n    // Leading comment on two.\n    required string two = 4 [\n      (custom.field_value_thing) = { }\n    ];\n    // Leading comment on three.\n    required string three = 5 [\n      (custom.field_value_thing) = { /* Empty message literal */ }\n    ];\n    // Leading comment on four.\n    required string four = 6 [\n      (custom.field_value_thing) = {\n        // Trailing comment on '{'.\n        // Another trailing comment on '{'.\n      }\n    ];\n    // Leading comment on five.\n    required string five = 7 [\n      (custom.field_value_thing) = {\n        // Trailing comment on '{'.\n\n      // Leading comment on '}'.\n      }\n    ];\n  }\n}\n\n// Leading comment on Type.\nenum Type {\n  // Trailing comment on Type.\n\n  // Leading comment on allow_alias.\n  option allow_alias = false;\n  // Leading comment on deprecated.\n  option deprecated = true;\n\n  // Leading comment on TYPE_UNSPECIFIED.\n  TYPE_UNSPECIFIED = 0 [\n    // Trailing comment on '['.\n\n    // Leading comment on deprecated.\n    deprecated = true\n  ]; // Trailing comment on ';'.\n  // Leading comment on TYPE_ONE.\n  TYPE_ONE = 1; // Trailing comment on ';'.\n  // Leading comment on TYPE_TWO.\n  TYPE_TWO = 2 [\n    // Trailing comment on TYPE_TWO.\n\n    // Leading comment on enum_value_thing_option.\n    (custom.enum_value_thing_option) = {\n      // Trailing comment on message literal.\n\n      // Leading comment on foo.\n      foo:1, // Trailing comment on foo.\n      // Leading comment on bar.\n      bar:2 // Trailing comment on bar.\n      // Leading comment on recursive.\n      recursive: <\n        // Leading comment on foo.\n        foo: 1,\n        // Leading comment on bar.\n        bar: 2,\n      >\n    }\n  ];\n}\n\n// Leading comment on Foo extension.\nextend Foo {\n  // Trailing comment on Foo.\n\n  // Leading comment on additional.\n  optional string additional = 5;\n}\n\n// Leading comment on FooService.\nservice FooService {\n  // Trailing comment on FooService.\n\n  // Leading comment on deprecated.\n  option deprecated = true;\n\n  // Leading comment on Foo.\n  rpc Foo(Foo) returns (Foo) {\n    // Trailing comment on Foo.\n\n    // Leading comment on deprecated.\n    option deprecated = true;\n\n    // Leading comment on idempotency_level.\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_array.golden",
    "content": "syntax = \"proto2\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  message Bar {\n    optional string name = 1 [(custom.field_thing_option) = {\n      // Trailing comment on '{'.\n\n      // Leading comment on repeated_foo field.\n      message_foo: [\n        // Trailing comment on array literal.\n\n        // Leading comment on '1'.\n        1, // Trailing comment on '1'.\n        // Leading comment on '2'.\n        2 // Trailing comment on '2'.\n\n        // Leading comment on ']'.\n      ]\n\n      // Leading comment on '}'.\n    }];\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_array.proto",
    "content": "syntax = \"proto2\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  message Bar {\n    optional string name = 1 [\n      (custom.field_thing_option) = {\n        // Trailing comment on '{'.\n\n        // Leading comment on repeated_foo field.\n        message_foo: [\n          // Trailing comment on array literal.\n\n          // Leading comment on '1'.\n          1, // Trailing comment on '1'.\n          // Leading comment on '2'.\n          2 // Trailing comment on '2'.\n\n        // Leading comment on ']'.\n        ]\n\n      // Leading comment on '}'.\n      }\n    ];\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_complex_array_literal.golden",
    "content": "syntax = \"proto2\";\n\nimport \"google/protobuf/descriptor.proto\";\n\n// Leading comment on (list).\noption (list) = {\n  names: [\n    // Trailing comment on '['.\n\n    // Leading comment on compound string.\n    \"one\"\n    /* One */\n    \"two\"\n    /* Two */\n    \"three\" // Trailing\n  ]\n\n  values: [\n    // Trailing comment on '['.\n\n    // Leading comment on '-42'.\n    -42, // Trailing on '-42'.\n\n    // Leading comment on '-43'.\n    - /* Between '-' and '43' */ 43 // Trailing on '43'.\n  ]\n\n  recursive: [\n    // Trailing comment on '['.\n\n    // Leading comment on '{'\n    {\n      // Leading comment on values key.\n      values: [\n        // Trailing comment on '['.\n\n        // Leading comment on '-44'.\n        -44, // Trailing on '-44'.\n        // Leading on '45'.\n        45 // Trailing on '45'.\n      ]\n\n      // Leading on '}'.\n    }\n\n    // Leading comment on ']',\n  ]\n};\n\nextend google.protobuf.FileOptions {\n  optional List list = 80000;\n}\n\nmessage List {\n  repeated string names = 1;\n  repeated sint32 values = 2;\n  repeated List recursive = 3;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_complex_array_literal.proto",
    "content": "syntax = \"proto2\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FileOptions {\n  optional List list = 80000;\n}\n\nmessage List {\n  repeated string names = 1;\n  repeated sint32 values = 2;\n  repeated List recursive = 3;\n}\n\n// Leading comment on (list).\noption (list) = {\n  names: [\n    // Trailing comment on '['.\n\n    // Leading comment on compound string.\n    \"one\"  /* One */  \"two\"  /* Two */  \"three\" // Trailing\n  ],\n\n  values: [\n    // Trailing comment on '['.\n\n    // Leading comment on '-42'.\n    -42, // Trailing on '-42'.\n\n    // Leading comment on '-43'.\n    - /* Between '-' and '43' */ 43 // Trailing on '43'.\n  ],\n\n  recursive: [\n    // Trailing comment on '['.\n\n    // Leading comment on '{'\n    {\n      // Leading comment on values key.\n      values: [\n        // Trailing comment on '['.\n    \n        // Leading comment on '-44'.\n        -44, // Trailing on '-44'.\n        // Leading on '45'.\n        45 // Trailing on '45'.\n      ]\n\n      // Leading on '}'.\n    }\n\n    // Leading comment on ']',\n  ]\n};\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_compound_name.golden",
    "content": "syntax = \"proto2\";\n\npackage foo.bar;\n\nimport \"custom.proto\";\n\noption (custom /* One */ . /* Two */ file_thing_option). /* Three */ foo = 0;\n\nextend google.protobuf.MessageOptions {\n  optional Another another = 20000;\n}\n\nmessage Thing {\n  message Nested {\n    message _NestedNested {\n      extend Test {\n        optional string one = 100;\n        optional string two = 101;\n      }\n    }\n  }\n}\n\nmessage Another {\n  // Leading on complex option name.\n  option (another).thing.(.foo.bar.Thing.Nested._NestedNested.one) = \"one\";\n\n  // Leading on complex option name with in-line.\n  option (another).thing.(/* One */ . /* Two */ foo.bar.Thing.Nested._NestedNested.one) = \"one\"; // Trailing\n\n  optional Thing thing = 1;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_compound_name.proto",
    "content": "syntax = \"proto2\";\n\npackage foo.bar;\n\nimport \"custom.proto\";\n\nextend google.protobuf.MessageOptions {\n  optional Another another = 20000;\n}\n\nmessage Thing {\n  message Nested {\n    message _NestedNested {\n      extend Test {\n        optional string one = 100;\n        optional string two = 101;\n      }\n    }\n  }\n}\n\nmessage Another {\n  // Leading on complex option name.\n  option (another).thing.(.foo.bar.Thing.Nested._NestedNested.one) = \"one\";\n\n  // Leading on complex option name with in-line.\n  option (another).thing.( /* One */ . /* Two */ foo.bar.Thing.Nested._NestedNested.one) = \"one\"; // Trailing\n\n  optional Thing thing = 1;\n}\n\noption (custom  /* One */  .  /* Two */  file_thing_option).  /* Three */  foo = 0;\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_message_field.golden",
    "content": "syntax = \"proto2\";\n\npackage foo.bar;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Simple {\n  optional string name = 1;\n  optional uint64 id = 2;\n}\n\nextend .google. /* identifier broken up strangely should still be accepted */protobuf.ExtensionRangeOptions {\n  optional string label = 20000;\n}\n\nmessage Test {\n  optional string foo = 1 [json_name = \"|foo|\"];\n  repeated int32 array = 2;\n  optional Simple s = 3;\n  repeated Simple r = 4;\n  map<string, int32> m = 5;\n\n  optional bytes b = 6 [default = \"\\0\\1\\2\\3\\4\\5\\6\\7fubar!\"];\n\n  extensions 100 to 200;\n\n  extensions 249, 300 to 350, 500 to 550, 20000 to max [(label) = \"jazz\"];\n\n  option (any) = {\n    [type.googleapis.com/foo.bar.Test]: {\n      foo: \"abc\"\n      array: [\n        1,\n        2,\n        3\n      ]\n    }\n  };\n\n  message Nested {\n    extend google.protobuf.MessageOptions {\n      optional int32 fooblez = 20003;\n    }\n    message _NestedNested {\n      enum EEE {\n        OK = 0;\n        V1 = 1;\n        V2 = 2;\n        V3 = 3;\n        V4 = 4;\n        V5 = 5;\n        V6 = 6;\n      }\n      option (fooblez) = 10101;\n      extend Test {\n        optional string _garblez = 100;\n      }\n      option (rept) = {\n        // Trailing comment on '{'.\n\n        // Leading comment on 'foo'.\n        foo: \"goo\" // Trailing comment on foo\n\n        // Leading comment on extension name.\n        [/* One */ foo.bar.Test.Nested._NestedNested._garblez /* Two */] /* Three */ : \"boo\" // Trailing comment on extension name.\n\n        // Leading comment on '}'.\n      };\n      message NestedNestedNested {\n        option (rept) = {\n          foo: \"hoo\"\n          [Test.Nested._NestedNested._garblez]: \"spoo\"\n        };\n\n        optional Test Test = 1;\n      }\n    }\n  }\n}\n\nextend google.protobuf.MessageOptions {\n  repeated Test rept = 20002;\n  optional Test.Nested._NestedNested.EEE eee = 20010;\n  optional google.protobuf.Any any = 20300;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_message_field.proto",
    "content": "syntax = \"proto2\";\n\npackage foo.bar;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Simple {\n\toptional string name = 1;\n\toptional uint64 id = 2;\n}\n\nextend . google. // identifier broken up strangely should still be accepted\n  protobuf .\n   ExtensionRangeOptions {\n\toptional string label = 20000;\n}\n\nmessage Test {\n\toptional string foo = 1 [json_name = \"|foo|\"];\n\trepeated int32 array = 2;\n\toptional Simple s = 3;\n\trepeated Simple r = 4;\n\tmap<string, int32> m = 5;\n\n\toptional bytes b = 6 [default = \"\\0\\1\\2\\3\\4\\5\\6\\7fubar!\"];\n\n\textensions 100 to 200;\n\n\textensions 249, 300 to 350, 500 to 550, 20000 to max [(label) = \"jazz\"];\n\n\toption (any) = {\n\t\t[ type . googleapis . com/ foo.bar.Test\t]: {\n\t\t\tfoo: \"abc\" array: [1,2,3]\n\t\t}\n\t};\n\n\tmessage Nested {\n\t\textend google.protobuf.MessageOptions {\n\t\t\toptional int32 fooblez = 20003;\n\t\t}\n\t\tmessage _NestedNested {\n\t\t\tenum EEE {\n\t\t\t\tOK = 0;\n\t\t\t\tV1 = 1;\n\t\t\t\tV2 = 2;\n\t\t\t\tV3 = 3;\n\t\t\t\tV4 = 4;\n\t\t\t\tV5 = 5;\n\t\t\t\tV6 = 6;\n\t\t\t}\n\t\t\toption (fooblez) = 10101;\n\t\t\textend Test {\n\t\t\t\toptional string _garblez = 100;\n\t\t\t}\n\t\t\toption (rept) = { \n              // Trailing comment on '{'.\n\n              // Leading comment on 'foo'.\n              foo: \"goo\" /* Leading comment on ',' */, // Trailing comment on foo\n\n              // Leading comment on extension name.\n              [ /* One */ foo.bar.Test.Nested._NestedNested._garblez /* Two */ ] /* Three */ : \"boo\" // Trailing comment on extension name.\n\n            // Leading comment on '}'.\n            };\n\t\t\tmessage NestedNestedNested {\n\t\t\t\toption (rept) = { foo: \"hoo\" [Test.Nested._NestedNested._garblez]: \"spoo\" };\n\n\t\t\t\toptional Test Test = 1;\n\t\t\t}\n\t\t}\n\t}\n}\n\nextend google.protobuf.MessageOptions {\n\trepeated Test rept = 20002;\n\toptional Test.Nested._NestedNested.EEE eee = 20010;\n\toptional google.protobuf.Any any = 20300;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_name.golden",
    "content": "syntax = \"proto2\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  optional int32 something = 20003;\n}\n\nextend google.protobuf.FieldOptions {\n  optional int32 another = 20004;\n}\n\nmessage Foo {\n  option (/* One */ something /* Two */) = 1;\n\n  optional string name = 1 [\n    // Leading comment on deprecated.\n    deprecated /* After deprecated */ = true,\n    // Leading comment on another.\n    (/* One */ another /* Two */) = 2\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/option_name.proto",
    "content": "syntax = \"proto2\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  optional int32 something = 20003;\n}\n\nextend google.protobuf.FieldOptions {\n  optional int32 another = 20004;\n}\n\nmessage Foo {\n  option (/* One */  something  /* Two */) = 1;\n\n  optional string name = 1 [\n    // Leading comment on deprecated.\n    deprecated /* After deprecated */ = true,\n    // Leading comment on another.\n    ( /* One */  another /* Two */ ) = 2\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/single_compact_option.golden",
    "content": "syntax = \"proto2\";\n\nmessage Foo {\n  optional string name = 1 [deprecated = true];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/option/v1/single_compact_option.proto",
    "content": "syntax = \"proto2\";\n\n\nmessage Foo {\n  optional string name = 1 [  deprecated = true  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/quotes/v1/quotes.golden",
    "content": "syntax = \"proto2\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Foo {\n  optional string something = 1;\n}\n\nextend google.protobuf.FieldOptions {\n  optional string name = 10001;\n  optional Foo foo = 10002;\n}\n\nmessage Foo {\n  optional string one = 1 [(name) = \"f\\\"o\\\"'o'\"];\n  optional string two = 2 [(name) = 'f\"oo\"'];\n  optional string three = 3 [(name) = \"f'oo'\"];\n  optional string four = 4 [(name) = \"f\\\"o\\\"\\'o\\'\"];\n  optional string five = 5 [(name) = \"f\\\"o\\\"o\"];\n  optional string six = 6 [(name) = 'f\\'o\\'o'];\n  optional string seven = 7 [(name) = \"foo\"];\n  optional string eight = 8 [(foo) = {something: 'something:\"foo\"'}];\n  optional string nine = 9 [(foo) = {something: \"something:\\\"foo\\\"\\nanother:\\\"bar\\\"\"}];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/quotes/v1/quotes.proto",
    "content": "syntax = \"proto2\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Foo {\n  optional string something = 1;\n}\n\nextend google.protobuf.FieldOptions {\n  optional string name = 10001;\n  optional Foo foo = 10002;\n}\n\nmessage Foo {\n  optional string one = 1 [(name) = \"f\\\"o\\\"'o'\"];\n  optional string two = 2 [(name) = 'f\"oo\"'];\n  optional string three = 3 [(name) = \"f'oo'\"];\n  optional string four = 4 [(name) = \"f\\\"o\\\"\\'o\\'\"];\n  optional string five = 5 [(name) = \"f\\\"o\\\"o\"];\n  optional string six = 6 [(name) = 'f\\'o\\'o'];\n  optional string seven = 7 [(name) = \"foo\"];\n  optional string eight = 8 [(foo) = {\n    something: 'something:\"foo\"'\n  }];\n  optional string nine = 9 [(foo) = {\n    something: \"something:\\\"foo\\\"\\nanother:\\\"bar\\\"\"\n  }];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/utf8/v1/utf8.golden",
    "content": "syntax = \"proto2\";\n\nenum Type {\n  // An example of strange characters in a comment: attachment���s\n  TYPE_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto2/utf8/v1/utf8.proto",
    "content": "syntax = \"proto2\";\n\nenum Type {\n  // An example of strange characters in a comment: attachment���s\n  TYPE_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/all/v1/all.golden",
    "content": "// top-level comment 1\n\n// top-level comment 2\n\nsyntax = \"proto3\"; // syntax-level-inline comment\n\n// between-syntax-and-package comment\n\npackage all.v1; // package-level-inline comment\n\nimport \"custom.proto\";\n// between-imports comment\nimport \"google/protobuf/duration.proto\"; // import-inline comment  2\n// between-package-and-import comment\n\n// import comment\nimport \"google/protobuf/timestamp.proto\"; // import-inline comment\n\n// option comment 3\noption go_package = \"foopb\"; // option-inline comment 3\n// between-imports-and-options comment\n\n// option comment\noption java_multiple_files = true; // option-inline comment\n// option comment 4\noption java_outer_classname = \"FooProto\"; // option-inline comment 4\n// option comment 2\noption java_package = \"com.foo\"; // option-inline comment 2\n// option comment 5\noption (custom.file_option) = true; // option-inline comment 5\n// option comment 6\noption (custom.file_thing_option) = {\n  foo: 1\n  bar: 2\n  truth: false\n  recursive: {\n    foo: 3\n    bar: 4\n    truth: true\n  }\n}; // option-inlinecomment 6\n\n// leading comment one1\n// leading comment one2\nmessage One {\n  // body comment one1\n\n  // message-option comment\n  // subsequent message-option comment\n  option (custom.message_option) = false; // message-option-inline comment\n  // message-option comment 2\n  option (custom.message_thing_option) = {foo: 5}; // message-option-inline comment 2\n\n  // body comment 2\n\n  // body comment 3\n\n  // nested-message comment\n  message Three {\n    int64 three_one = 1;\n  }\n\n  /*\n     c-style comment\n  */\n\n  int64 one_one = 1 [(custom.field_option) = true];\n  Two one_two = 2 [\n    (custom.field_option) = false,\n    (custom.field_thing_option) = {\n      foo: 6 // comment after foo\n    }\n  ]; // field-option-inline comment\n\n  Three one_three = 3; /* field-inline c-style comment */\n\n  map<string, uint32> map_field = 4;\n\n  oneof oneof_field {\n    // oneof-body comment\n\n    // oneof-field comment\n    option (custom.oneof_option) = true; // oneof-option-field-inline comment\n    option (custom.oneof_thing_option) = {foo: 7}; // oneof-option-field-inline comment 2\n    int64 foo1 = 8;\n    string foo2 = 9;\n    // oneof-field comment 2\n    int64 woot3 = 10 [\n      (custom.field_option) = false,\n      (custom.field_thing_option) = {foo: 8}\n    ]; // oneof-option-field-inline comment 3\n    // oneof-field comment 2\n    custom.Thing custom_field = 11; // oneof-option-field-inline comment 4\n  }\n\n  int64 integer_field = 12 [\n    (custom.repeated_field_option) = 1,\n    (custom.repeated_field_option) = 2\n  ];\n  int64 integer_field_two = 13 [\n    (custom.field_thing_option) = {\n      foo: 9\n      repeated_foo: [\n        1,\n        2\n      ]\n    },\n    (custom.repeated_field_thing_option) = {\n      foo: 1\n      recursive: {\n        foo: 2\n        repeated_foo: [\n          3,\n          4\n        ]\n      }\n    },\n    (custom.repeated_field_thing_option) = {\n      foo: 5\n      recursive: {\n        foo: 6\n        repeated_foo: [\n          7,\n          8\n        ]\n      }\n    },\n    (custom.repeated_field_thing_option) = {\n      foo: 1\n      repeated_thing: [\n        {\n          foo: 1\n          repeated_foo: [\n            1,\n            2\n          ]\n        },\n        {\n          foo: 3\n          repeated_foo: [\n            3,\n            4\n          ]\n        }\n      ]\n    }\n  ];\n\n  // body comment one2\n} // trailing comment one1\n\nmessage Two {\n  int64 two_one = 1;\n\n  reserved 2 to 10, 1000 to 1100;\n  reserved \"foo\";\n  reserved \"bar\", \"baz\";\n}\n\nenum EnumWithAlias {\n  // enum-body comment\n\n  ENUM_WITH_ALIAS_UNSPECIFIED = 0;\n  ENUM_WITH_ALIAS_FIRST = 1;\n  ENUM_WITH_ALIAS_SECOND = 2;\n  ENUM_WITH_ALIAS_THIRD = 3;\n  ENUM_WITH_ALIAS_OTHER_THIRD = 3;\n  option allow_alias = true;\n} // trailing enum comment\n\n// Empty is an empty message.\nmessage Empty {}\n\n// Pre-enum comment\n\n// OtherEnum is another enum.\nenum OtherEnum {\n  option (custom.enum_option) = 1;\n  // enum comment\n  OTHER_ENUM_UNSPECIFIED = 0 [\n    (custom.enum_value_option) = true,\n    (custom.enum_value_thing_option) = {\n      foo: 1\n      bar: 2\n      recursive: {\n        foo: 3\n        recursive: {bar: 2}\n      }\n    }\n  ]; // enum-option-inline comment\n  // enum comment 2\n  OTHER_ENUM_FIRST = 1; // enum-option-inline comment 2\n  // comment28\n  OTHER_ENUM_SECOND = 2; // enum-option-inline comment 3\n}\n\n// Pre-service comment\n\n// ExampleService is the example service.\nservice ExampleService {\n  option (custom.service_option) = true; // service-option-inline comment\n  option (custom.service_thing_option) = {foo: 1}; // service-option-inline comment 2\n  // rpc-leading comment\n  rpc Example(One) returns (Two) {\n    option (custom.method_option) = true;\n    option (custom.method_thing_option) = {\n      foo: 1\n      bar: 2\n      recursive: {\n        foo: 3\n        recursive: {bar: 2}\n      }\n    }; // service-option-inline comment 2\n  } // rpc-inline comment\n\n  // service-body comment\n\n  // rpc-leading comment 2\n  rpc Foo(Empty) returns (One); // rpc-inline comment 2\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/all/v1/all.proto",
    "content": "// top-level comment 1\n\n// top-level comment 2\n\nsyntax = \"proto3\"; // syntax-level-inline comment\n\n// between-syntax-and-package comment\n\npackage all.v1; // package-level-inline comment\n\n// between-package-and-import comment\n\n// import comment\nimport \"google/protobuf/timestamp.proto\"; // import-inline comment\n\n\nimport \"custom.proto\";\n// between-imports comment\nimport \"google/protobuf/duration.proto\";    // import-inline comment  2\n\n// between-imports-and-options comment\n\n// option comment\noption java_multiple_files = true; // option-inline comment\n// option comment 2\noption java_package = \"com.foo\";  // option-inline comment 2\n// option comment 3\noption go_package = \"foopb\";  // option-inline comment 3\n// option comment 4\noption java_outer_classname = \"FooProto\";  // option-inline comment 4\n// option comment 5\noption (custom.file_option) = true;  // option-inline comment 5\n// option comment 6\noption (custom.file_thing_option) = {\n  foo: 1\n  bar: 2\n  truth: false\n  recursive: {\n    foo: 3\n    bar: 4\n    truth: true\n  }\n}; // option-inlinecomment 6\n\n// leading comment one1\n// leading comment one2\nmessage One {\n  // body comment one1\n\n  // message-option comment\n  // subsequent message-option comment\n  option (custom.message_option) = false; // message-option-inline comment\n  // message-option comment 2\n  option (custom.message_thing_option) = { foo: 5 };// message-option-inline comment 2\n\n  // body comment 2\n\n  // body comment 3\n\n  // nested-message comment\n  message Three {\n    int64 three_one = 1;\n  }\n\n  /*\n  c-style comment\n  */\n\n  int64 one_one = 1 [ (custom.field_option) = true];\n  Two one_two = 2[\n  (custom.field_option) = false,\n  (custom.field_thing_option) = {\n     foo: 6, // comment after foo\n  }\n  ]; // field-option-inline comment\n\n  Three one_three = 3; /* field-inline c-style comment */\n\n  map<string, uint32> map_field = 4;\n\n  oneof oneof_field {\n  // oneof-body comment\n\n  // oneof-field comment\n  option (custom.oneof_option) = true  ; // oneof-option-field-inline comment\n  option (custom.oneof_thing_option) = {\n  foo: 7 };// oneof-option-field-inline comment 2\n    int64 foo1 = 8;\n    string foo2 = 9;\n    // oneof-field comment 2\n  int64 woot3 = 10 [\n  (custom.field_option) = false,\n  (custom.field_thing_option) = { foo: 8}\n  ]; // oneof-option-field-inline comment 3\n  // oneof-field comment 2\n  custom.Thing custom_field = 11; // oneof-option-field-inline comment 4\n  }; // oneof-inline-comment\n\n  int64 integer_field = 12 [\n    (custom.repeated_field_option) = 1,\n    (custom.repeated_field_option) = 2\n  ];\n  int64 integer_field_two = 13 [\n    (custom.field_thing_option) = { foo: 9, repeated_foo: [1, 2] },\n    (custom.repeated_field_thing_option) = { foo: 1, recursive: { foo: 2, repeated_foo: [3, 4] } },\n    (custom.repeated_field_thing_option) = { foo: 5, recursive: { foo: 6, repeated_foo: [7, 8] } },\n    (custom.repeated_field_thing_option) = { foo: 1, repeated_thing: [\n       { foo: 1, repeated_foo: [1, 2] },\n       { foo: 3, repeated_foo: [3, 4] } ] }\n  ];\n\n  // body comment one2\n} // trailing comment one1\n\nmessage Two {\n  int64 two_one = 1;\n\n  reserved 2 to 10, 1000 to 1100;\n  reserved \"foo\";\n  reserved \"bar\", \"baz\";\n}\n\nenum EnumWithAlias {\n  // enum-body comment\n\n  ENUM_WITH_ALIAS_UNSPECIFIED = 0;\n  ENUM_WITH_ALIAS_FIRST = 1;\n  ENUM_WITH_ALIAS_SECOND = 2;\n  ENUM_WITH_ALIAS_THIRD = 3;\n  ENUM_WITH_ALIAS_OTHER_THIRD = 3;\n  option allow_alias = true;\n} // trailing enum comment\n\n// Empty is an empty message.\nmessage Empty {\n}\n\n// Pre-enum comment\n\n// OtherEnum is another enum.\nenum OtherEnum {\n  option (custom.enum_option) = 1;\n// enum comment\n  OTHER_ENUM_UNSPECIFIED = 0 [\n  (custom.enum_value_option) = true,\n  (custom.enum_value_thing_option) = { foo: 1, bar: 2, recursive: { foo: 3, recursive: { bar: 2 } } }\n  ]; // enum-option-inline comment\n// enum comment 2\n  OTHER_ENUM_FIRST = 1; // enum-option-inline comment 2\n// comment28\n  OTHER_ENUM_SECOND = 2; // enum-option-inline comment 3\n}\n\n// Pre-service comment\n\n// ExampleService is the example service.\nservice ExampleService {\n  option (custom.service_option) = true  ; // service-option-inline comment\n  option (custom.service_thing_option) = {\n  foo: 1 };// service-option-inline comment 2\n  // rpc-leading comment\n  rpc Example(One) returns (Two) {\n    option (custom.method_option) = true;\n    option (custom.method_thing_option) = { foo: 1, bar: 2, recursive: { foo: 3, recursive: { bar: 2 } } }; // service-option-inline comment 2\n  } // rpc-inline comment\n\n  // service-body comment\n\n  // rpc-leading comment 2\n  rpc Foo(Empty) returns (One); // rpc-inline comment 2\n} \n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/block/v1/block.golden",
    "content": "syntax = \"proto3\";\n\npackage block.v1;\n\n/*\n   This comment has an empty line with no comment below this sentence.\n\n   The formatter should not output any indentation on the above line.\n*/\n\nmessage Baz {}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/block/v1/block.proto",
    "content": "syntax = \"proto3\";\n\npackage block.v1;\n\n/*\n   This comment has an empty line with no comment below this sentence.\n\n   The formatter should not output any indentation on the above line.\n*/\n\nmessage Baz {}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/file/v1/empty.golden",
    "content": ""
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/file/v1/empty.proto",
    "content": ""
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/file/v1/eof.golden",
    "content": "syntax = \"proto3\";\n\n// Leading comment on EOF.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/file/v1/eof.proto",
    "content": "syntax = \"proto3\";\n\n// Leading comment on EOF.\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/file/v1/option.golden",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\noption cc_enable_arenas = true;\noption java_multiple_files = true;\noption (file_option) = true;\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/file/v1/option.proto",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\noption (file_option) = true;\noption java_multiple_files = true;\noption cc_enable_arenas = true;\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/header/v1/header-block.golden",
    "content": "/*\n * This is a top level leading comment attached to the syntax.\n * It uses C-style block comments.\n */\n\n//\n//  It can be separated across multiple lines like this.\n\n//\n//      All of them should retain their newlines.\n\n// This is another leading comment on the syntax.\nsyntax /* This comment is attached to the '=' */ = \"proto3\"; // Trailing comment on syntax.\n\n// Between syntax and package.\n\npackage /* Leading on package name. */ header.v1 /* Leading on semicolon */; // Trailing in-line.\n\nimport /* Leading on import path */ \"custom.proto\";\n\noption /* Leading on option name */ (custom.file_thing_option).truth /* Between truth and value */ = true /* After 'true' */;\n\n/**\n = Here's another block comment.\n = But this one uses equal sign as the\n = prefix for each line.\n*/\nmessage Foo {\n  /*\n   * This is a comment nested inside a block.\n   * It too uses C-style block comments.\n   */\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/header/v1/header-block.proto",
    "content": "  /*\n    * This is a top level leading comment attached to the syntax.\n     * It uses C-style block comments.\n      */\n\n//\n//  It can be separated across multiple lines like this.\n\n//\n//      All of them should retain their newlines.\n\n// This is another leading comment on the syntax.\nsyntax /* This comment is attached to the '=' */ = \"proto3\"; // Trailing comment on syntax.\n\n// Between syntax and package.\n\npackage /* Leading on package name. */   header.v1   /* Leading on semicolon */;    // Trailing in-line.\n\noption /* Leading on option name */ (custom.file_thing_option).truth /* Between truth and value */ = true /* After 'true' */;\n\nimport /* Leading on import path */        \"custom.proto\";\n\n /**\n  = Here's another block comment.\n  = But this one uses equal sign as the\n    = prefix for each line.\n */\nmessage Foo {\n      /*\n       * This is a comment nested inside a block.\n       * It too uses C-style block comments.\n       */\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/header/v1/header.golden",
    "content": "// This is a top level leading comment attached to the syntax.\n//\n\n//\n//  It can be separated across multiple lines like this.\n\n//\n//      All of them should retain their newlines.\n\n// This is another leading comment on the syntax.\nsyntax /* This comment is attached to the '=' */ = \"proto3\"; // Trailing comment on syntax.\n\n// Between syntax and package.\n\npackage /* Leading on package name. */ header.v1 /* Leading on semicolon */; // Trailing in-line.\n\nimport /* Leading on import path */ \"custom.proto\";\n\noption /* Leading on option name */ (custom.file_thing_option).truth /* Between truth and value */ = true /* After 'true' */;\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/header/v1/header.proto",
    "content": "// This is a top level leading comment attached to the syntax.\n//\n\n//\n//  It can be separated across multiple lines like this.\n\n//\n//      All of them should retain their newlines.\n\n// This is another leading comment on the syntax.\nsyntax /* This comment is attached to the '=' */ = \"proto3\"; // Trailing comment on syntax.\n\n// Between syntax and package.\n\npackage /* Leading on package name. */   header.v1   /* Leading on semicolon */;    // Trailing in-line.\n\noption /* Leading on option name */ (custom.file_thing_option).truth /* Between truth and value */ = true /* After 'true' */; \n\nimport /* Leading on import path */        \"custom.proto\";\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/header/v1/unused_import.golden",
    "content": "syntax = \"proto3\";\n\n// This import is unused, but it should\n// still be referenced.\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Foo {\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/header/v1/unused_import.proto",
    "content": "syntax = \"proto3\";\n\n// This import is unused, but it should\n// still be referenced.\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Foo {\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/compound_string.golden",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\n// The string literal should be split across multiple lines.\noption (custom.string_file_option) =\n  \"One\"\n  \"Two\"\n  \"Three\" /* Trailing */;\n\nmessage Foo {\n  // The string literal should be split across multiple lines.\n  option (custom.string_message_option) =\n    \"One\"\n    \"Two\"\n    \"Three\" /* Trailing */;\n\n  // one has a single compact option, so it should be written in-line.\n  string one = 1 [(custom.string_field_option) =\n    \"this\"\n    // Second element.\n    \"is a\"\n    // Third element.\n    \"compound string\"];\n\n  // two has multiple compact options, so it should be written across multiple lines.\n  string two = 2 [\n    deprecated = true,\n    (custom.string_field_option) =\n      \"this\"\n      // Second element.\n      \"is a\"\n      // Third element.\n      \"compound string\"\n  ];\n\n  // three has an array of compound string literals, but it's all in a single compact option.\n  string three = 3 [(custom.field_thing_option) = {\n    baz:\n      \"One\"\n      \"Two\"\n      \"Three\"\n    repeated_baz: [\n      // First element.\n      \"this\"\n      // Second element.\n      \"is a\"\n      // Third element.\n      \"compound string\" /* Trailing in array */,\n      \"this\" // The first element.\n      \"is another\" // The second element.\n      \"compound string\" // The last element.\n    ]\n  }];\n\n  // four has an array of compound string literals, but there are multiple compact options.\n  string four = 4 [\n    deprecated = true,\n    (custom.field_thing_option) = {\n      baz:\n        \"One\"\n        \"Two\"\n        \"Three\"\n      repeated_baz: [\n        // First element.\n        \"this\"\n        // Second element.\n        \"is a\"\n        // Third element.\n        \"compound string\" /* Trailing in array */,\n        \"this\" // The first element.\n        \"is another\" // The second element.\n        \"compound string\"\n        // Trailing comment on a newline.\n      ]\n    }\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/compound_string.proto",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\n// The string literal should be split across multiple lines.\noption (custom.string_file_option) =\n  \"One\"\n  \"Two\"\n  \"Three\" // Trailing\n;\n\nmessage Foo {\n  // The string literal should be split across multiple lines.\n  option (custom.string_message_option) =\n    \"One\"\n    \"Two\"\n    \"Three\" // Trailing\n  ;\n\n  // one has a single compact option, so it should be written in-line.\n  string one = 1 [(custom.string_field_option) =\n    \"this\"\n    // Second element.\n    \"is a\"\n    // Third element.\n    \"compound string\"];\n\n    // two has multiple compact options, so it should be written across multiple lines.\n    string two = 2 [\n      deprecated = true,\n      (custom.string_field_option) =\n        \"this\"\n        // Second element.\n        \"is a\"\n        // Third element.\n        \"compound string\"\n    ];\n\n    // three has an array of compound string literals, but it's all in a single compact option.\n    string three = 3 [(custom.field_thing_option) = {\n      baz:\n        \"One\"\n        \"Two\"\n        \"Three\"\n      repeated_baz: [\n        // First element.\n        \"this\"\n        // Second element.\n        \"is a\"\n        // Third element.\n        \"compound string\" /* Trailing in array */,\n        \"this\" // The first element.\n        \"is another\" // The second element.\n        \"compound string\" // The last element.\n      ]\n    }];\n\n    // four has an array of compound string literals, but there are multiple compact options.\n    string four = 4 [\n      deprecated = true,\n      (custom.field_thing_option) = {\n        baz:\n          \"One\"\n          \"Two\"\n          \"Three\"\n        repeated_baz: [\n          // First element.\n          \"this\"\n          // Second element.\n          \"is a\"\n          // Third element.\n          \"compound string\" /* Trailing in array */,\n          \"this\" // The first element.\n          \"is another\" // The second element.\n          \"compound string\"\n          // Trailing comment on a newline.\n        ]\n      }\n    ];\n  }\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/literal.golden",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  string name = 1 [\n    (custom.float_field_option) = 42.2,\n    (custom.double_field_option) = 42.2424,\n    (custom.int32_field_option) = 32,\n    (custom.int64_field_option) = 64,\n    (custom.uint32_field_option) = 3200,\n    (custom.uint64_field_option) = 6400,\n    (custom.sint32_field_option) = -32,\n    (custom.sint64_field_option) = -64,\n    (custom.fixed32_field_option) = 3232,\n    (custom.fixed64_field_option) = 6464,\n    (custom.sfixed32_field_option) = -3232,\n    (custom.sfixed64_field_option) = -6464,\n    (custom.bool_field_option) = true,\n    (custom.bytes_field_option) = \"bytes\",\n    (custom.string_field_option) =\n      \"this\"\n      \"is a\"\n      \"compound string\"\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/literal.proto",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  string name = 1 [\n    (custom.float_field_option) = 42.2,\n    (custom.double_field_option) = 42.2424,\n    (custom.int32_field_option) = 32,\n    (custom.int64_field_option) = 64,\n    (custom.uint32_field_option) = 3200,\n    (custom.uint64_field_option) = 6400,\n    (custom.sint32_field_option) = -32,\n    (custom.sint64_field_option) = -64,\n    (custom.fixed32_field_option) = 3232,\n    (custom.fixed64_field_option) = 6464,\n    (custom.sfixed32_field_option) = -3232,\n    (custom.sfixed64_field_option) = -6464,\n    (custom.bool_field_option) = true,\n    (custom.bytes_field_option) = \"bytes\",\n    (custom.string_field_option) = \"this\" \"is a\" \"compound string\"\n\n\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/literal_comments.golden",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  string name = 1 [\n    (custom.float_field_option) = /* Before */ 42.2 /* After */, // Trailing\n    (custom.double_field_option) = /* Before */ 42.2424 /* After */, // Trailing\n    (custom.int32_field_option) = /* Before */ 32 /* After */, // Trailing\n    (custom.int64_field_option) = /* Before */ 64 /* After */, // Trailing\n    (custom.uint32_field_option) = /* Before */ 3200 /* After */, // Trailing\n    (custom.uint64_field_option) = /* Before */ 6400 /* After */, // Trailing\n    (custom.sint32_field_option) = - /* The '-' can be detached. */ 32 /* After 32 */, // Trailing\n    (custom.sint64_field_option) = - /* Again */ 64 /* After 64 */, // Trailing\n    (custom.fixed32_field_option) = /* Before */ 3232 /* After */, // Trailing\n    (custom.fixed64_field_option) = /* Before */ 6464 /* After */, // Trailing\n    (custom.sfixed32_field_option) = - /* Again */ 3232 /* After */, // Trailing\n    (custom.sfixed64_field_option) = - /* Finally */ 6464 /* After */, // Trailing\n    (custom.bool_field_option) = /* Before */ true /* After */, // Trailing\n    (custom.bytes_field_option) = /* Before */ \"bytes\" /* After */, // Trailing\n    (custom.string_field_option) =\n      /* One */\n      \"this\"\n      /* Two */\n      \"is a\"\n      /* Three */\n      \"compound string\", // Trailing\n    (custom.message_literal_field_option) = /* Before */ {\n      /* interior comment */\n      rule: \"rule\"\n    }, // Trailing\n    (custom.message_literal_no_interior_comment_field_option) = /* Before */ {rule: \"rule\"}, // Trailing\n    (custom.nested_message_literal_field_option) = {\n      // Comment on nested message\n      nested: {\n        nested_nested: {\n          /* interior comment on nested_nested message */\n          inner_most: \"value\"\n        }\n      } /* Trailing */\n      // Before\n      other_nested: /* Before */ {once: \"value\"} /* Trailing */\n    },\n    (custom.message_literal_with_array_literals) = {\n      additional_rules: [] /* comment on , */\n      additional_rules: [] /* comment on [ */\n      additional_rules: [] /* multi-line comment on , */\n      additional_rules: [\n        /* Before */ {}, // Trailing\n        /* Before */ {rule: \"child\"}, /* child node */\n        {\n          rule: \"another_child\"\n          additional_rules: [] /* Trailing */\n        }\n      ]\n      rule: \"parent\" // but this one is\n    }\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/literal_comments.proto",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  string name = 1 [\n    (custom.float_field_option) = /* Before */ 42.2 /* After */ , // Trailing\n    (custom.double_field_option) = /* Before */ 42.2424 /* After */ , // Trailing\n    (custom.int32_field_option) = /* Before */ 32 /* After */ , // Trailing\n    (custom.int64_field_option) = /* Before */ 64 /* After */, // Trailing\n    (custom.uint32_field_option) = /* Before */ 3200 /* After */, // Trailing\n    (custom.uint64_field_option) = /* Before */ 6400 /* After */ , // Trailing\n    (custom.sint32_field_option) = -  /* The '-' can be detached. */  32 /* After 32 */, // Trailing\n    (custom.sint64_field_option) = - /* Again */ 64 /* After 64 */, // Trailing\n    (custom.fixed32_field_option) = /* Before */ 3232 /* After */, // Trailing\n    (custom.fixed64_field_option) = /* Before */ 6464 /* After */, // Trailing\n    (custom.sfixed32_field_option) = - /* Again */ 3232 /* After */ , // Trailing\n    (custom.sfixed64_field_option) = - /* Finally */ 6464 /* After */, // Trailing\n    (custom.bool_field_option) = /* Before */ true /* After */ , // Trailing\n    (custom.bytes_field_option) = /* Before */ \"bytes\" /* After */ , // Trailing\n    (custom.string_field_option) = /* One */  \"this\"   /* Two */ \"is a\"  /* Three */ \"compound string\", // Trailing\n    (custom.message_literal_field_option) = /* Before */ { /* interior comment */  rule: \"rule\"}, // Trailing\n    (custom.message_literal_no_interior_comment_field_option) = /* Before */ {rule: \"rule\"}, // Trailing\n    (custom.nested_message_literal_field_option) = {\n      // Comment on nested message\n      nested: {\n        nested_nested: { /* interior comment on nested_nested message */ inner_most: \"value\" }\n      }, // Trailing\n      // Before\n      other_nested: /* Before */ { once: \"value\" } // Trailing\n    },\n    (custom.message_literal_with_array_literals) = {\n       additional_rules: [], // comment on ,\n       additional_rules: [] // comment on [\n       additional_rules: [], /* multi-line comment on , */\n       additional_rules: [\n        /* Before */ {}, // Trailing\n        /* Before */ { rule: \"child\" }, /* child node */\n        {\n          rule: \"another_child\",\n          additional_rules: [] // Trailing\n        }\n      ]\n      rule: \"parent\" // but this one is\n    }\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/special_literal.golden",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  string key = 1 [(custom.float_field_option) = /* Before */ nan /* Trailing */];\n  string value = 2 [\n    (custom.float_field_option) = /* Before */ inf /* After */, // Trailing\n    (custom.bool_field_option) = false\n  ];\n  string another = 3 [(custom.float_field_option) = /* Before */ - /* Between */ inf /* Trailing */];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/literal/v1/special_literal.proto",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Foo {\n  string key = 1 [\n    (custom.float_field_option) = /* Before */ nan // Trailing\n  ];\n  string value = 2 [\n    (custom.float_field_option) = /* Before */ inf /* After */, // Trailing\n    (custom.bool_field_option) = false\n  ];\n  string another = 3 [\n    (custom.float_field_option) = /* Before */ -  /* Between */  inf // Trailing\n  ];\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/oneof/v1/multiple.golden",
    "content": "syntax = \"proto3\";\n\nmessage Foo {\n  /* Leading comment on oneof */\n  oneof /* Comment between oneof and 'bar' */ bar /* Comment before '{' */ {\n    // This is a trailing comment on the oneof's '{'.\n    // This is another trailing comment.\n\n    // This is a leading comment on name.\n    string name = 1; // In-line comment on name.\n\n    float /* Comment after float */ value = 2;\n  } // Trailing comment on oneof's '}'.\n\n  // Leading comment on baz.\n  oneof baz {\n    int64 three = 3;\n\n    int64 four = 4;\n  } // Trailing comment on oneof's '}'.\n  // Another trailing comment before end of definition.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/oneof/v1/multiple.proto",
    "content": "syntax = \"proto3\";\n\nmessage Foo {\n        /* Leading comment on oneof */   oneof       /* Comment between oneof and 'bar' */ bar /* Comment before '{' */    {\n\n    // This is a trailing comment on the oneof's '{'.\n          // This is another trailing comment.\n\n    // This is a leading comment on name.\n    string name = 1; // In-line comment on name.\n\n  float /* Comment after float */ value = 2;\n\n  } // Trailing comment on oneof's '}'.\n\n\n\n// Leading comment on baz.\noneof   baz  { \n     int64 three = 3;\n\n     int64 four = 4;\n  } // Trailing comment on oneof's '}'.\n  // Another trailing comment before end of definition.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/oneof/v1/simple.golden",
    "content": "syntax = \"proto3\";\n\nmessage Foo {\n  /* Leading comment on oneof */\n  oneof /* Comment between oneof and 'bar' */ bar /* Comment before '{' */ {\n    // This is a trailing comment on the oneof's '{'.\n    // This is another trailing comment.\n\n    // This is a leading comment on name.\n    string name = 1; // In-line comment on name.\n    float /* Comment after float */ value = 2;\n  } // Trailing comment on oneof's '}'.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/oneof/v1/simple.proto",
    "content": "syntax = \"proto3\";\n\nmessage Foo {\n        /* Leading comment on oneof */   oneof       /* Comment between oneof and 'bar' */ bar /* Comment before '{' */    {\n\n    // This is a trailing comment on the oneof's '{'.\n          // This is another trailing comment.\n\n    // This is a leading comment on name.\n    string name = 1; // In-line comment on name.\n  float /* Comment after float */ value = 2;\n\n  } // Trailing comment on oneof's '}'.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/range/v1/range.golden",
    "content": "syntax = \"proto3\";\n\nmessage Foo {\n  reserved /* 43 is the start */ 43 to /* max is the end */ max;\n  reserved \"foo\" /* Comment before the ',' */, /* Comment before \"bar\" */ \"bar\";\n\n  // Always reserve the forty-second field.\n  reserved 42;\n\n  reserved \"baz\"; // Don't forget baz.\n\n  // The name field should exist after the reserved block.\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/range/v1/range.proto",
    "content": "syntax = \"proto3\";\n\n   message Foo {\n        reserved /* 43 is the start */ 43 to /* max is the end */ max;\n      reserved \"foo\" /* Comment before the ',' */ , /* Comment before \"bar\" */ \"bar\";\n\n          // Always reserve the forty-second field.\n          reserved 42;\n\n        reserved \"baz\"; // Don't forget baz.\n\n           // The name field should exist after the reserved block.\n        string name = 1;\n     }\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/empty.golden",
    "content": "syntax = \"proto3\";\n\nservice Foo {\n  /* C-style comment in the middle */\n}\n\nservice Bar {\n  // Normal comment in the middle\n}\n\nservice Baz {\n  // Body comment.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/empty.proto",
    "content": "syntax = \"proto3\";\n\nservice Foo { /* C-style comment in the middle */ }\n\nservice Bar {\n  // Normal comment in the middle\n}\n\nservice Baz {\n\n// Body comment.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/empty_rpc.golden",
    "content": "syntax = \"proto3\";\n\nmessage Message {}\n\nservice Foo {\n  rpc One(Message) returns (Message) {\n    /* C-style comment in the middle */\n  }\n  rpc Two(Message) returns (Message) {\n    // Normal comment in the middle\n  }\n  rpc Three(Message) returns (Message) {\n    // Body comment.\n  }\n\n  // Leading comment on '}'.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/empty_rpc.proto",
    "content": "syntax = \"proto3\";\n\nmessage Message {};\n\nservice Foo {\n  rpc One(Message) returns (Message) { /* C-style comment in the middle */ }\n  rpc Two(Message) returns (Message) {\n    // Normal comment in the middle\n  }\n  rpc Three(Message) returns (Message) {\n\n  // Body comment.\n  }\n\n// Leading comment on '}'.\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/service.golden",
    "content": "syntax = \"proto3\";\n\nmessage Message {}\n\n// Ping is an example service.\nservice /* Before Ping comment */ Ping /* After Ping comment */ { // Trailing comment on '{'\n  // This service is deprecated.\n  option deprecated = true; // In-line comment on deprecated option.\n\n  rpc /* Before Ping Method */ Ping(/* Before Request */Message/* After Request */) returns /* Before paren */ (Message);\n  rpc Echo(Message) returns (Message) { // Trailing comment on '{'\n    option deprecated = true; // In-line on deprecated option.\n\n    // This method has no side effects.\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n\n  // The Streamer method is bidirectional.\n  rpc Streamer(/* Client-side streaming */ stream Message) returns (stream /* Server-side streaming */ Message);\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/service.proto",
    "content": "syntax = \"proto3\";\n\nmessage Message   {};\n\n  // Ping is an example service.\n   service  /* Before Ping comment */ Ping /* After Ping comment */   { // Trailing comment on '{'\n\n      // This service is deprecated.\n      option deprecated = true; // In-line comment on deprecated option.\n\nrpc /* Before Ping Method */ Ping(/* Before Request */Message/* After Request */)    returns   /* Before paren */ (Message)  ;\n  rpc Echo(Message) returns (Message)   { // Trailing comment on '{'\n    \n    option deprecated = true; // In-line on deprecated option.\n\n  // This method has no side effects.\n  option idempotency_level = NO_SIDE_EFFECTS ;\n   \n}\n  \n    // The Streamer method is bidirectional.\n  rpc Streamer( /* Client-side streaming */ stream  Message) returns (stream /* Server-side streaming */ Message);\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/service_options.golden",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Message {}\n\nservice Ping {\n  // This is a trailing comment on the Ping service.\n\n  // This is a comment on the deprecated option.\n  option deprecated = true;\n\n  // This is a comment on the service_option.\n  option (custom.service_option) = false;\n\n  // This is a comment on the service_thing_option.\n  option (custom.service_thing_option) = {\n    foo: 1\n    bar: 2\n  };\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/service_options.proto",
    "content": "syntax = \"proto3\";\n\nimport \"custom.proto\";\n\nmessage Message {};\n\nservice Ping {\n    // This is a trailing comment on the Ping service.\n\n  // This is a comment on the deprecated option.\n  option deprecated = true;\n\n\n// This is a comment on the service_option.\noption (custom.service_option) = false;\n\n\n           // This is a comment on the service_thing_option.\n     option (custom.service_thing_option) = { foo: 1  bar: 2   };\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/simple.golden",
    "content": "syntax = \"proto3\";\n\nmessage Message {}\n\nservice Ping {\n  option deprecated = true;\n\n  rpc Echo(Message) returns (Message) {\n    option deprecated = true;\n  }\n}\n"
  },
  {
    "path": "private/buf/bufformat/testdata/proto3/service/v1/simple.proto",
    "content": "syntax = \"proto3\";\n\nmessage Message {} \n\nservice Ping {\n  option deprecated = true;\n\n  rpc Echo(Message) returns (Message) {\n     option deprecated = true;\n  } \n}\n"
  },
  {
    "path": "private/buf/bufformat/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufformat\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufgen/bufgen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufgen does configuration-based generation.\n//\n// It is used by the buf generate command.\npackage bufgen\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"strconv\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\nconst (\n\t// StrategyDirectory is the strategy that says to generate per directory.\n\t//\n\t// This is the default value.\n\tStrategyDirectory Strategy = 1\n\t// StrategyAll is the strategy that says to generate with all files at once.\n\tStrategyAll Strategy = 2\n)\n\n// Strategy is a generation strategy.\ntype Strategy int\n\n// ParseStrategy parses the Strategy.\n//\n// If the empty string is provided, this is interpreted as StrategyDirectory.\nfunc ParseStrategy(s string) (Strategy, error) {\n\tswitch s {\n\tcase \"\", \"directory\":\n\t\treturn StrategyDirectory, nil\n\tcase \"all\":\n\t\treturn StrategyAll, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown strategy: %s\", s)\n\t}\n}\n\n// String implements fmt.Stringer.\nfunc (s Strategy) String() string {\n\tswitch s {\n\tcase StrategyDirectory:\n\t\treturn \"directory\"\n\tcase StrategyAll:\n\t\treturn \"all\"\n\tdefault:\n\t\treturn strconv.Itoa(int(s))\n\t}\n}\n\n// Generator generates Protobuf stubs based on configurations.\ntype Generator interface {\n\t// Generate calls the generation logic.\n\t//\n\t// The config is assumed to be valid. If created by ReadConfig, it will\n\t// always be valid.\n\tGenerate(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStdioContainer,\n\t\tconfig bufconfig.GenerateConfig,\n\t\timages []bufimage.Image,\n\t\toptions ...GenerateOption,\n\t) error\n}\n\n// NewGenerator returns a new Generator.\nfunc NewGenerator(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\t// Pass a clientConfig instead of a CodeGenerationServiceClient because the\n\t// plugins' remotes/registries is not known at this time, and remotes/registries\n\t// may be different for different plugins.\n\tclientConfig *connectclient.Config,\n) Generator {\n\treturn newGenerator(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\tclientConfig,\n\t)\n}\n\n// GenerateOption is an option for Generate.\ntype GenerateOption func(*generateOptions)\n\n// GenerateWithBaseOutDirPath returns a new GenerateOption that uses the given\n// base directory as the output directory.\n//\n// The default is to use the current directory.\nfunc GenerateWithBaseOutDirPath(baseOutDirPath string) GenerateOption {\n\treturn func(generateOptions *generateOptions) {\n\t\tgenerateOptions.baseOutDirPath = baseOutDirPath\n\t}\n}\n\n// GenerateWithDeleteOuts returns a new GenerateOption that results in the\n// output directories, zip files, or jar files being deleted before generation is run.\nfunc GenerateWithDeleteOuts(deleteOuts bool) GenerateOption {\n\treturn func(generateOptions *generateOptions) {\n\t\tgenerateOptions.deleteOuts = &deleteOuts\n\t}\n}\n\n// GenerateWithIncludeImportsOverride is a strict override on whether imports are\n// generated. This overrides IncludeImports from the GeneratePluginConfig.\n//\n// This option has presence, i.e. setting this option to false is not the same\n// as not setting it, as the latter does not override the config.\n//\n// Note that this does NOT result in the Well-Known Types being generated when\n// set to true, use GenerateWithIncludeWellKnownTypes to include the Well-Known Types.\nfunc GenerateWithIncludeImportsOverride(includeImports bool) GenerateOption {\n\treturn func(generateOptions *generateOptions) {\n\t\tgenerateOptions.includeImportsOverride = &includeImports\n\t}\n}\n\n// GenerateWithIncludeWellKnownTypesOverride is a strict override on whether the\n// well known types are generated. This overrides IncludeWKT from the GeneratePluginConfig.\n//\n// This option has presence, i.e. setting this option to false is not the same\n// as not setting it, as the latter does not override the config.\n//\n// Setting this option to true has no effect if GenerateWithIncludeImports is not\n// set to true.\nfunc GenerateWithIncludeWellKnownTypesOverride(includeWellKnownTypes bool) GenerateOption {\n\treturn func(generateOptions *generateOptions) {\n\t\tgenerateOptions.includeWellKnownTypesOverride = &includeWellKnownTypes\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufgen/features.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufgen\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\n// Map of all known features to functions that can check whether a given file\n// uses said feature.\nvar featureToFeatureChecker = map[pluginpb.CodeGeneratorResponse_Feature]featureChecker{\n\tpluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL:   fileHasProto3Optional,\n\tpluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS: fileHasEditions,\n}\n\n// requiredFeatures maps a feature to the set of files in an image that\n// make use of that feature.\ntype requiredFeatures struct {\n\tfeatureToFilenames map[pluginpb.CodeGeneratorResponse_Feature][]string\n\teditionToFilenames map[descriptorpb.Edition][]string\n\tminEdition         descriptorpb.Edition\n\tmaxEdition         descriptorpb.Edition\n}\n\nfunc newRequiredFeatures() *requiredFeatures {\n\treturn &requiredFeatures{\n\t\tfeatureToFilenames: map[pluginpb.CodeGeneratorResponse_Feature][]string{},\n\t\teditionToFilenames: map[descriptorpb.Edition][]string{},\n\t}\n}\n\ntype featureChecker func(options *descriptorpb.FileDescriptorProto) bool\n\n// computeRequiredFeatures returns a map of required features to the files in\n// the image that require that feature. After plugins are invoked, the plugins'\n// responses are checked to make sure any required features were supported.\nfunc computeRequiredFeatures(image bufimage.Image) *requiredFeatures {\n\tfeatures := newRequiredFeatures()\n\tfor _, imageFile := range image.Files() {\n\t\tif imageFile.IsImport() {\n\t\t\t// we only want to check the sources in the module, not their dependencies\n\t\t\tcontinue\n\t\t}\n\t\t// Collect all required feature enum values.\n\t\tfor feature, checker := range featureToFeatureChecker {\n\t\t\tif checker(imageFile.FileDescriptorProto()) {\n\t\t\t\tfeatures.featureToFilenames[feature] = append(features.featureToFilenames[feature], imageFile.Path())\n\t\t\t}\n\t\t}\n\t\t// We also collect the range of required editions.\n\t\tif !fileHasEditions(imageFile.FileDescriptorProto()) {\n\t\t\tcontinue\n\t\t}\n\t\tedition := imageFile.FileDescriptorProto().GetEdition()\n\t\tfeatures.editionToFilenames[edition] = append(features.editionToFilenames[edition], imageFile.Path())\n\t\tif features.minEdition == 0 || edition < features.minEdition {\n\t\t\tfeatures.minEdition = edition\n\t\t}\n\t\tif edition > features.maxEdition {\n\t\t\tfeatures.maxEdition = edition\n\t\t}\n\t}\n\treturn features\n}\n\nfunc checkRequiredFeatures(\n\tlogger *slog.Logger,\n\trequired *requiredFeatures,\n\tresponses []*pluginpb.CodeGeneratorResponse,\n\tconfigs []bufconfig.GeneratePluginConfig,\n) error {\n\tvar errs []error\n\tfor responseIndex, response := range responses {\n\t\tif response == nil || response.GetError() != \"\" {\n\t\t\t// plugin failed, nothing to check\n\t\t\tcontinue\n\t\t}\n\n\t\tfailed := newRequiredFeatures()\n\t\tvar failedFeatures []pluginpb.CodeGeneratorResponse_Feature\n\t\tvar failedEditions []descriptorpb.Edition\n\t\tsupported := response.GetSupportedFeatures() // bit mask of features the plugin supports\n\t\tfor feature, files := range required.featureToFilenames {\n\t\t\tfeatureMask := uint64(feature)\n\t\t\tif supported&featureMask != featureMask {\n\t\t\t\t// doh! Supported features don't include this one\n\t\t\t\tfailed.featureToFilenames[feature] = files\n\t\t\t\tfailedFeatures = append(failedFeatures, feature)\n\t\t\t}\n\t\t}\n\t\tpluginName := configs[responseIndex].Name()\n\t\tif supported&uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS) != 0 && len(required.editionToFilenames) > 0 {\n\t\t\t// Plugin supports editions, and files include editions.\n\t\t\t// First, let's make sure that the plugin set the min/max edition fields correctly.\n\t\t\tif response.MinimumEdition == nil {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"plugin %q advertises that it supports editions but did not indicate a minimum supported edition\",\n\t\t\t\t\tpluginName,\n\t\t\t\t)\n\t\t\t}\n\t\t\tif response.MaximumEdition == nil {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"plugin %q advertises that it supports editions but did not indicate a maximum supported edition\",\n\t\t\t\t\tpluginName,\n\t\t\t\t)\n\t\t\t}\n\t\t\tif response.GetMaximumEdition() < response.GetMinimumEdition() {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"plugin %q indicates a maximum supported edition (%v) that is less than its minimum supported edition (%v)\",\n\t\t\t\t\tpluginName,\n\t\t\t\t\tdescriptorpb.Edition(response.GetMaximumEdition()),\n\t\t\t\t\tdescriptorpb.Edition(response.GetMinimumEdition()),\n\t\t\t\t)\n\t\t\t}\n\n\t\t\t// And also make sure the plugin supports precisely the right editions.\n\t\t\trequiredEditions := make([]descriptorpb.Edition, 0, len(required.editionToFilenames))\n\t\t\tfor edition := range required.editionToFilenames {\n\t\t\t\trequiredEditions = append(requiredEditions, edition)\n\t\t\t}\n\t\t\tslices.Sort(requiredEditions)\n\t\t\tfor _, requiredEdition := range requiredEditions {\n\t\t\t\tif int32(requiredEdition) < response.GetMinimumEdition() ||\n\t\t\t\t\tint32(requiredEdition) > response.GetMaximumEdition() {\n\t\t\t\t\tfailed.editionToFilenames[requiredEdition] = required.editionToFilenames[requiredEdition]\n\t\t\t\t\tfailedEditions = append(failedEditions, requiredEdition)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif len(failedFeatures) > 0 {\n\t\t\tslices.Sort(failedFeatures)\n\t\t\tfor _, feature := range failedFeatures {\n\t\t\t\t// For CLI versions pre-1.32.0, we logged unsupported features. However, this is an\n\t\t\t\t// unsafe behavior for editions. So, in keeping with pre-1.32.0 CLI versions, we\n\t\t\t\t// warn for proto3 optional, but error if editions are required (BSR-3931).\n\t\t\t\tif feature == pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL {\n\t\t\t\t\twarningMessage := fmt.Sprintf(\"plugin %q does not support required features.\\n\", pluginName)\n\n\t\t\t\t\tfiles := failed.featureToFilenames[feature]\n\t\t\t\t\twarningMessage = fmt.Sprintln(\n\t\t\t\t\t\twarningMessage,\n\t\t\t\t\t\tfmt.Sprintf(\" Feature %q is required by %d file(s):\", featureName(feature), len(files)),\n\t\t\t\t\t)\n\t\t\t\t\twarningMessage = fmt.Sprintln(warningMessage, fmt.Sprintf(\"   %s\", strings.Join(files, \",\")))\n\t\t\t\t\tlogger.Warn(strings.TrimSpace(warningMessage))\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfeatureErrs := xslices.Map(\n\t\t\t\t\tfailed.featureToFilenames[feature],\n\t\t\t\t\tfunc(fileName string) error {\n\t\t\t\t\t\treturn fmt.Errorf(\"plugin %q does not support feature %q which is required by %q\", pluginName, featureName(feature), fileName)\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\terrs = append(errs, featureErrs...)\n\t\t\t}\n\t\t}\n\t\tif len(failedEditions) > 0 {\n\t\t\tslices.Sort(failedEditions)\n\t\t\tfor _, edition := range failedEditions {\n\t\t\t\tfor _, file := range failed.editionToFilenames[edition] {\n\t\t\t\t\terrs = append(errs, fmt.Errorf(\"plugin %q does not support edition %q which is required by %q\",\n\t\t\t\t\t\tpluginName, editionName(edition), file))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn errors.Join(errs...)\n}\n\nfunc featureName(feature pluginpb.CodeGeneratorResponse_Feature) string {\n\t// FEATURE_PROTO3_OPTIONAL -> \"proto3 optional\"\n\treturn enumReadableName(feature, \"FEATURE\")\n}\n\nfunc editionName(edition descriptorpb.Edition) string {\n\t// EDITION_2023 -> \"2023\"\n\treturn enumReadableName(edition, \"EDITION\")\n}\n\nfunc enumReadableName(\n\tenum interface {\n\t\tprotoreflect.Enum\n\t\tString() string\n\t},\n\tprefix string,\n) string {\n\treturn strings.TrimSpace(\n\t\tstrings.ToLower(\n\t\t\tstrings.ReplaceAll(\n\t\t\t\tstrings.TrimPrefix(enum.String(), prefix),\n\t\t\t\t\"_\", \" \")))\n}\n\nfunc fileHasProto3Optional(fileDescriptorProto *descriptorpb.FileDescriptorProto) bool {\n\tif fileDescriptorProto.GetSyntax() != \"proto3\" {\n\t\t// can't have proto3 optional unless syntax is proto3\n\t\treturn false\n\t}\n\treturn slices.ContainsFunc(fileDescriptorProto.MessageType, messageHasProto3Optional)\n}\n\nfunc messageHasProto3Optional(descriptorProto *descriptorpb.DescriptorProto) bool {\n\tfor _, fld := range descriptorProto.Field {\n\t\tif fld.GetProto3Optional() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn slices.ContainsFunc(descriptorProto.NestedType, messageHasProto3Optional)\n}\n\nfunc fileHasEditions(fileDescriptorProto *descriptorpb.FileDescriptorProto) bool {\n\treturn fileDescriptorProto.GetSyntax() == \"editions\"\n}\n"
  },
  {
    "path": "private/buf/bufgen/features_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufgen\n\nimport (\n\t\"bytes\"\n\t\"log/slog\"\n\t\"math\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/google/uuid\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc TestComputeRequiredFeatures(t *testing.T) {\n\tt.Parallel()\n\tnoRequiredFeatures := makeImageNoRequiredFeatures(t)\n\trequiresProto3Optional := makeImageRequiresProto3Optional(t)\n\trequiresEditions := makeImageRequiresEditions(t)\n\trequiresBoth := makeImageRequiresBoth(t)\n\n\trequired := computeRequiredFeatures(noRequiredFeatures)\n\tassert.Empty(t, required.featureToFilenames)\n\tassert.Empty(t, required.editionToFilenames)\n\n\trequired = computeRequiredFeatures(requiresProto3Optional)\n\tassert.Equal(t, map[pluginpb.CodeGeneratorResponse_Feature][]string{\n\t\tpluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL: {\"proto3_optional.proto\"},\n\t}, required.featureToFilenames)\n\tassert.Empty(t, required.editionToFilenames)\n\n\trequired = computeRequiredFeatures(requiresEditions)\n\tassert.Equal(t, map[pluginpb.CodeGeneratorResponse_Feature][]string{\n\t\tpluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS: {\"editions.proto\"},\n\t}, required.featureToFilenames)\n\tassert.Equal(t, map[descriptorpb.Edition][]string{\n\t\tdescriptorpb.Edition_EDITION_2023: {\"editions.proto\"},\n\t}, required.editionToFilenames)\n\t// Note that we can't really test a wider range here right now because\n\t// we don't support building an editions file for anything other than\n\t// edition 2023 right now.\n\tassert.Equal(t, descriptorpb.Edition_EDITION_2023, required.minEdition)\n\tassert.Equal(t, descriptorpb.Edition_EDITION_2023, required.maxEdition)\n\n\trequired = computeRequiredFeatures(requiresBoth)\n\tassert.Equal(t, map[pluginpb.CodeGeneratorResponse_Feature][]string{\n\t\tpluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL:   {\"proto3_optional.proto\"},\n\t\tpluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS: {\"editions.proto\"},\n\t}, required.featureToFilenames)\n\tassert.Equal(t, map[descriptorpb.Edition][]string{\n\t\tdescriptorpb.Edition_EDITION_2023: {\"editions.proto\"},\n\t}, required.editionToFilenames)\n\tassert.Equal(t, descriptorpb.Edition_EDITION_2023, required.minEdition)\n\tassert.Equal(t, descriptorpb.Edition_EDITION_2023, required.maxEdition)\n}\n\nfunc TestCheckRequiredFeatures(t *testing.T) {\n\tt.Parallel()\n\tnoRequiredFeatures := makeImageNoRequiredFeatures(t)\n\trequiresProto3Optional := makeImageRequiresProto3Optional(t)\n\trequiresEditions := makeImageRequiresEditions(t)\n\trequiresBoth := makeImageRequiresBoth(t)\n\n\tsupportsNoFeatures := &pluginpb.CodeGeneratorResponse{}\n\tsupportsBoth := &pluginpb.CodeGeneratorResponse{\n\t\tSupportedFeatures: proto.Uint64(uint64(\n\t\t\tpluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL |\n\t\t\t\tpluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS,\n\t\t)),\n\t\tMinimumEdition: (*int32)(descriptorpb.Edition_EDITION_2023.Enum()),\n\t\tMaximumEdition: (*int32)(descriptorpb.Edition_EDITION_2024.Enum()),\n\t}\n\tsupportsEditionsButOutOfRange := &pluginpb.CodeGeneratorResponse{\n\t\tSupportedFeatures: proto.Uint64(uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS)),\n\t\tMinimumEdition:    (*int32)(descriptorpb.Edition_EDITION_2024.Enum()),\n\t\tMaximumEdition:    (*int32)(descriptorpb.Edition_EDITION_MAX.Enum()),\n\t}\n\tsupportsEditionsButNoRange := &pluginpb.CodeGeneratorResponse{\n\t\tSupportedFeatures: proto.Uint64(uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS)),\n\t}\n\tsupportsEditionsButMalformedRange := &pluginpb.CodeGeneratorResponse{\n\t\tSupportedFeatures: proto.Uint64(uint64(pluginpb.CodeGeneratorResponse_FEATURE_SUPPORTS_EDITIONS)),\n\t\tMinimumEdition:    (*int32)(descriptorpb.Edition_EDITION_2024.Enum()),\n\t\tMaximumEdition:    (*int32)(descriptorpb.Edition_EDITION_2023.Enum()),\n\t}\n\n\t// Successful cases\n\ttestCheckRequiredFeatures(t, noRequiredFeatures, supportsNoFeatures, \"\", \"\")\n\ttestCheckRequiredFeatures(t, requiresProto3Optional, supportsBoth, \"\", \"\")\n\ttestCheckRequiredFeatures(t, requiresEditions, supportsBoth, \"\", \"\")\n\ttestCheckRequiredFeatures(t, requiresBoth, supportsBoth, \"\", \"\")\n\t// These are successful because we intentionally don't validate the editions range unless the\n\t// file uses editions. This is to work around known issue in older versions of plugins in protoc\n\t// from when editions were still experimental. These plugins advertise supported for plugins but\n\t// don't correctly set the min and max edition fields.\n\ttestCheckRequiredFeatures(t, noRequiredFeatures, supportsEditionsButNoRange, \"\", \"\")\n\ttestCheckRequiredFeatures(t, noRequiredFeatures, supportsEditionsButMalformedRange, \"\", \"\")\n\n\t// Error cases\n\ttestCheckRequiredFeatures(\n\t\tt,\n\t\trequiresProto3Optional,\n\t\tsupportsNoFeatures,\n\t\t`plugin \"test\" does not support required features.\n  Feature \"proto3 optional\" is required by 1 file(s):\n    proto3_optional.proto`,\n\t\t\"\", // No error expected\n\t)\n\ttestCheckRequiredFeatures(\n\t\tt,\n\t\trequiresEditions,\n\t\tsupportsNoFeatures,\n\t\t\"\", // No stderr expected\n\t\t`plugin \"test\" does not support feature \"supports editions\" which is required by \"editions.proto\"`,\n\t)\n\ttestCheckRequiredFeatures(\n\t\tt,\n\t\trequiresBoth,\n\t\tsupportsNoFeatures,\n\t\t`plugin \"test\" does not support required features.\n  Feature \"proto3 optional\" is required by 1 file(s):\n    proto3_optional.proto`,\n\t\t`plugin \"test\" does not support feature \"supports editions\" which is required by \"editions.proto\"`,\n\t)\n\ttestCheckRequiredFeatures(\n\t\tt,\n\t\trequiresEditions,\n\t\tsupportsEditionsButOutOfRange,\n\t\t\"\", // No stderr expected\n\t\t`plugin \"test\" does not support edition \"2023\" which is required by \"editions.proto\"`,\n\t)\n\ttestCheckRequiredFeatures(\n\t\tt,\n\t\trequiresEditions,\n\t\tsupportsEditionsButNoRange,\n\t\t\"\", // No stderr expected\n\t\t`plugin \"test\" advertises that it supports editions but did not indicate a minimum supported edition`,\n\t)\n\ttestCheckRequiredFeatures(\n\t\tt,\n\t\trequiresEditions,\n\t\tsupportsEditionsButMalformedRange,\n\t\t\"\", // No stderr expected\n\t\t`plugin \"test\" indicates a maximum supported edition (EDITION_2023) that is less than its minimum supported edition (EDITION_2024)`,\n\t)\n}\n\nfunc testCheckRequiredFeatures(\n\tt *testing.T,\n\timage bufimage.Image,\n\tcodeGenResponse *pluginpb.CodeGeneratorResponse,\n\texpectedStdErr string,\n\texpectedErr string,\n) {\n\tt.Helper()\n\trequired := computeRequiredFeatures(image)\n\tbuffer := bytes.NewBuffer(nil)\n\tlogger := slog.New(slog.NewTextHandler(buffer, &slog.HandlerOptions{}))\n\terr := checkRequiredFeatures(\n\t\tlogger,\n\t\trequired,\n\t\t[]*pluginpb.CodeGeneratorResponse{\n\t\t\tcodeGenResponse,\n\t\t\t// this makes sure we handle multiple responses; this one never fails\n\t\t\t{\n\t\t\t\tSupportedFeatures: proto.Uint64(math.MaxUint), // all features enabled\n\t\t\t\tMinimumEdition:    proto.Int32(0),\n\t\t\t\tMaximumEdition:    proto.Int32(int32(descriptorpb.Edition_EDITION_MAX)),\n\t\t\t},\n\t\t},\n\t\t[]bufconfig.GeneratePluginConfig{\n\t\t\tnewMockPluginConfig(\"test\"),\n\t\t\tnewMockPluginConfig(\"never_fails\"),\n\t\t},\n\t)\n\tif expectedStdErr != \"\" {\n\t\trequire.NotEmpty(t, buffer.String())\n\t} else {\n\t\trequire.Empty(t, buffer.String())\n\t}\n\tif expectedErr != \"\" {\n\t\trequire.ErrorContains(t, err, expectedErr)\n\t} else {\n\t\trequire.NoError(t, err)\n\t}\n}\n\nfunc makeImageNoRequiredFeatures(t *testing.T) bufimage.Image {\n\tt.Helper()\n\ttestFile, err := bufimage.NewImageFile(\n\t\t&descriptorpb.FileDescriptorProto{\n\t\t\tName:   proto.String(\"test.proto\"),\n\t\t\tSyntax: proto.String(\"proto3\"),\n\t\t\tDependency: []string{\n\t\t\t\t\"imported_editions.proto\",\n\t\t\t\t\"imported_proto3_optional.proto\",\n\t\t\t},\n\t\t},\n\t\tnil,\n\t\tuuid.UUID{},\n\t\t\"test.proto\",\n\t\t\"test.proto\",\n\t\tfalse,\n\t\tfalse,\n\t\t[]int32{0, 1},\n\t)\n\trequire.NoError(t, err)\n\t// Imported files can use features since we're not doing code gen for them.\n\timportedFileEditions := makeImageFileRequiresEditions(t, \"imported_editions.proto\", true)\n\timportedFileProto3Optional := makeImageFileRequiresProto3Optional(t, \"imported_proto3_optional.proto\", true)\n\timage, err := bufimage.NewImage([]bufimage.ImageFile{importedFileEditions, importedFileProto3Optional, testFile})\n\trequire.NoError(t, err)\n\treturn image\n}\n\nfunc makeImageRequiresProto3Optional(t *testing.T) bufimage.Image {\n\tt.Helper()\n\tproto3OptionalFile := makeImageFileRequiresProto3Optional(t, \"proto3_optional.proto\", false)\n\timage, err := bufimage.NewImage([]bufimage.ImageFile{proto3OptionalFile})\n\trequire.NoError(t, err)\n\treturn image\n}\n\nfunc makeImageRequiresEditions(t *testing.T) bufimage.Image {\n\tt.Helper()\n\teditionsFile := makeImageFileRequiresEditions(t, \"editions.proto\", false)\n\timage, err := bufimage.NewImage([]bufimage.ImageFile{editionsFile})\n\trequire.NoError(t, err)\n\treturn image\n}\n\nfunc makeImageRequiresBoth(t *testing.T) bufimage.Image {\n\tt.Helper()\n\teditionsFile := makeImageFileRequiresEditions(t, \"editions.proto\", false)\n\tproto3OptionalFile := makeImageFileRequiresProto3Optional(t, \"proto3_optional.proto\", false)\n\timage, err := bufimage.NewImage([]bufimage.ImageFile{editionsFile, proto3OptionalFile})\n\trequire.NoError(t, err)\n\treturn image\n}\n\nfunc makeImageFileRequiresProto3Optional(t *testing.T, name string, isImport bool) bufimage.ImageFile {\n\tt.Helper()\n\timageFile, err := bufimage.NewImageFile(\n\t\t&descriptorpb.FileDescriptorProto{\n\t\t\tSyntax: proto.String(\"proto3\"),\n\t\t\tName:   proto.String(name),\n\t\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t\t{\n\t\t\t\t\tName: proto.String(\"Foo\"),\n\t\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName:           proto.String(\"bar\"),\n\t\t\t\t\t\t\tLabel:          descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\t\tType:           descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\t\tJsonName:       proto.String(\"bar\"),\n\t\t\t\t\t\t\tOneofIndex:     proto.Int32(0),\n\t\t\t\t\t\t\tProto3Optional: proto.Bool(true),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tOneofDecl: []*descriptorpb.OneofDescriptorProto{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: proto.String(\"_bar\"),\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\tnil,\n\t\tuuid.UUID{},\n\t\tname,\n\t\tname,\n\t\tisImport,\n\t\tfalse,\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\treturn imageFile\n}\n\nfunc makeImageFileRequiresEditions(t *testing.T, name string, isImport bool) bufimage.ImageFile {\n\tt.Helper()\n\timageFile, err := bufimage.NewImageFile(\n\t\t&descriptorpb.FileDescriptorProto{\n\t\t\tSyntax:  proto.String(\"editions\"),\n\t\t\tEdition: descriptorpb.Edition_EDITION_2023.Enum(),\n\t\t\tName:    proto.String(name),\n\t\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t\t{\n\t\t\t\t\tName: proto.String(\"Bar\"),\n\t\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName:     proto.String(\"baz\"),\n\t\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\t\tJsonName: proto.String(\"baz\"),\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\tnil,\n\t\tuuid.UUID{},\n\t\tname,\n\t\tname,\n\t\tisImport,\n\t\tfalse,\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\treturn imageFile\n}\n\ntype mockPluginConfig struct {\n\tbufconfig.GeneratePluginConfig\n\n\tname string\n}\n\nfunc newMockPluginConfig(name string) bufconfig.GeneratePluginConfig {\n\treturn mockPluginConfig{name: name}\n}\n\nfunc (p mockPluginConfig) Name() string {\n\treturn p.name\n}\n"
  },
  {
    "path": "private/buf/bufgen/generator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufgen\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"path/filepath\"\n\t\"sort\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xslices\"\n\tconnect \"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/buf/bufprotopluginexec\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotoplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotoplugin/bufprotopluginos\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\ntype generator struct {\n\tlogger              *slog.Logger\n\tstorageosProvider   storageos.Provider\n\tpluginexecGenerator bufprotopluginexec.Generator\n\tclientConfig        *connectclient.Config\n}\n\nfunc newGenerator(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tclientConfig *connectclient.Config,\n) *generator {\n\treturn &generator{\n\t\tlogger:              logger,\n\t\tstorageosProvider:   storageosProvider,\n\t\tpluginexecGenerator: bufprotopluginexec.NewGenerator(logger, storageosProvider),\n\t\tclientConfig:        clientConfig,\n\t}\n}\n\n// Generate executes all of the plugins specified by the given Config, and\n// consolidates the results in the same order that the plugins are listed.\n// Order is particularly important for insertion points, which are used to\n// modify the generated output from other plugins executed earlier in the chain.\n//\n// Note that insertion points will only have access to files that are written\n// in the same protoc invocation; plugins will not be able to insert code into\n// other files that already exist on disk (just like protoc).\n//\n// All of the plugins, both local and remote, are called concurrently. Each\n// plugin returns a single CodeGeneratorResponse, which are cached in-memory in\n// the bufprotopluginos.ResponseWriter. Once all of the CodeGeneratorResponses\n// are written in-memory, we flush them to the OS filesystem by closing the\n// bufprotopluginos.ResponseWriter.\n//\n// This behavior is equivalent to protoc, which only writes out the content\n// for each of the plugins if all of the plugins are successful.\nfunc (g *generator) Generate(\n\tctx context.Context,\n\tcontainer app.EnvStdioContainer,\n\tconfig bufconfig.GenerateConfig,\n\timages []bufimage.Image,\n\toptions ...GenerateOption,\n) error {\n\tgenerateOptions := newGenerateOptions()\n\tfor _, option := range options {\n\t\toption(generateOptions)\n\t}\n\tif !config.GenerateManagedConfig().Enabled() {\n\t\tif len(config.GenerateManagedConfig().Overrides()) != 0 || len(config.GenerateManagedConfig().Disables()) != 0 {\n\t\t\tg.logger.Warn(\"managed mode configs are set but are not enabled\")\n\t\t}\n\t}\n\tfor _, image := range images {\n\t\tif err := bufimagemodify.Modify(image, config.GenerateManagedConfig()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tshouldDeleteOuts := config.CleanPluginOuts()\n\tif generateOptions.deleteOuts != nil {\n\t\tshouldDeleteOuts = *generateOptions.deleteOuts\n\t}\n\tif shouldDeleteOuts {\n\t\tif err := g.deleteOuts(\n\t\t\tctx,\n\t\t\tgenerateOptions.baseOutDirPath,\n\t\t\tconfig.GeneratePluginConfigs(),\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor _, image := range images {\n\t\tif err := g.generateCode(\n\t\t\tctx,\n\t\t\tcontainer,\n\t\t\timage,\n\t\t\tgenerateOptions.baseOutDirPath,\n\t\t\tconfig.GeneratePluginConfigs(),\n\t\t\tgenerateOptions.includeImportsOverride,\n\t\t\tgenerateOptions.includeWellKnownTypesOverride,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (g *generator) deleteOuts(\n\tctx context.Context,\n\tbaseOutDir string,\n\tpluginConfigs []bufconfig.GeneratePluginConfig,\n) error {\n\treturn bufprotopluginos.NewCleaner(g.storageosProvider).DeleteOuts(\n\t\tctx,\n\t\txslices.Map(\n\t\t\tpluginConfigs,\n\t\t\tfunc(pluginConfig bufconfig.GeneratePluginConfig) string {\n\t\t\t\tout := pluginConfig.Out()\n\t\t\t\tif baseOutDir != \"\" && baseOutDir != \".\" {\n\t\t\t\t\treturn filepath.Join(baseOutDir, out)\n\t\t\t\t}\n\t\t\t\treturn out\n\t\t\t},\n\t\t),\n\t)\n}\n\nfunc (g *generator) generateCode(\n\tctx context.Context,\n\tcontainer app.EnvStdioContainer,\n\tinputImage bufimage.Image,\n\tbaseOutDir string,\n\tpluginConfigs []bufconfig.GeneratePluginConfig,\n\tincludeImportsOverride *bool,\n\tincludeWellKnownTypesOverride *bool,\n) error {\n\tresponses, err := g.execPlugins(\n\t\tctx,\n\t\tcontainer,\n\t\tpluginConfigs,\n\t\tinputImage,\n\t\tincludeImportsOverride,\n\t\tincludeWellKnownTypesOverride,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Apply the CodeGeneratorResponses in the order they were specified.\n\tresponseWriter := bufprotopluginos.NewResponseWriter(\n\t\tg.logger,\n\t\tg.storageosProvider,\n\t\tbufprotopluginos.ResponseWriterWithCreateOutDirIfNotExists(),\n\t)\n\tfor i, pluginConfig := range pluginConfigs {\n\t\tout := pluginConfig.Out()\n\t\tif baseOutDir != \"\" && baseOutDir != \".\" {\n\t\t\tout = filepath.Join(baseOutDir, out)\n\t\t}\n\t\tresponse := responses[i]\n\t\tif response == nil {\n\t\t\treturn fmt.Errorf(\"failed to get plugin response for %s\", pluginConfig.Name())\n\t\t}\n\t\tif err := responseWriter.AddResponse(\n\t\t\tctx,\n\t\t\tresponse,\n\t\t\tout,\n\t\t); err != nil {\n\t\t\treturn fmt.Errorf(\"plugin %s: %v\", pluginConfig.Name(), err)\n\t\t}\n\t}\n\tif err := responseWriter.Close(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (g *generator) execPlugins(\n\tctx context.Context,\n\tcontainer app.EnvStdioContainer,\n\tpluginConfigs []bufconfig.GeneratePluginConfig,\n\timage bufimage.Image,\n\tincludeImportsOverride *bool,\n\tincludeWellKnownTypesOverride *bool,\n) ([]*pluginpb.CodeGeneratorResponse, error) {\n\t// Collect all of the plugin jobs so that they can be executed in parallel.\n\tjobs := make([]func(context.Context) error, 0, len(pluginConfigs))\n\tresponses := make([]*pluginpb.CodeGeneratorResponse, len(pluginConfigs))\n\trequiredFeatures := computeRequiredFeatures(image)\n\n\t// Group the pluginConfigs by similar properties to batch image processing.\n\tpluginConfigsForImage := xslices.ToIndexedValuesMap(pluginConfigs, createPluginConfigKeyForImage)\n\tfor _, indexedPluginConfigs := range pluginConfigsForImage {\n\t\timage := image\n\t\tpluginConfigForKey := indexedPluginConfigs[0].Value\n\n\t\t// Apply per-plugin filters.\n\t\tincludeTypes := pluginConfigForKey.IncludeTypes()\n\t\texcludeTypes := pluginConfigForKey.ExcludeTypes()\n\t\tif len(includeTypes) > 0 || len(excludeTypes) > 0 {\n\t\t\tvar err error\n\t\t\timage, err = bufimageutil.FilterImage(\n\t\t\t\timage,\n\t\t\t\tbufimageutil.WithIncludeTypes(includeTypes...),\n\t\t\t\tbufimageutil.WithExcludeTypes(excludeTypes...),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\n\t\t// Batch for each remote.\n\t\tif remote := pluginConfigForKey.RemoteHost(); remote != \"\" {\n\t\t\tjobs = append(jobs, func(ctx context.Context) error {\n\t\t\t\tresults, err := g.execRemotePluginsV2(\n\t\t\t\t\tctx,\n\t\t\t\t\tcontainer,\n\t\t\t\t\timage,\n\t\t\t\t\tremote,\n\t\t\t\t\tindexedPluginConfigs,\n\t\t\t\t\tincludeImportsOverride,\n\t\t\t\t\tincludeWellKnownTypesOverride,\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\t\t\t\tfor _, result := range results {\n\t\t\t\t\tresponses[result.Index] = result.Value\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\t// Local plugins.\n\t\tvar images []bufimage.Image\n\t\tswitch Strategy(pluginConfigForKey.Strategy()) {\n\t\tcase StrategyAll:\n\t\t\timages = []bufimage.Image{image}\n\t\tcase StrategyDirectory:\n\t\t\tvar err error\n\t\t\timages, err = bufimage.ImageByDir(image)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown strategy: %v\", pluginConfigForKey.Strategy())\n\t\t}\n\t\tfor _, indexedPluginConfig := range indexedPluginConfigs {\n\t\t\tjobs = append(jobs, func(ctx context.Context) error {\n\t\t\t\tincludeImports := indexedPluginConfig.Value.IncludeImports()\n\t\t\t\tif includeImportsOverride != nil {\n\t\t\t\t\tincludeImports = *includeImportsOverride\n\t\t\t\t}\n\t\t\t\tincludeWellKnownTypes := indexedPluginConfig.Value.IncludeWKT()\n\t\t\t\tif includeWellKnownTypesOverride != nil {\n\t\t\t\t\tincludeWellKnownTypes = *includeWellKnownTypesOverride\n\t\t\t\t}\n\t\t\t\tresponse, err := g.execLocalPlugin(\n\t\t\t\t\tctx,\n\t\t\t\t\tcontainer,\n\t\t\t\t\timages,\n\t\t\t\t\tindexedPluginConfig.Value,\n\t\t\t\t\tincludeImports,\n\t\t\t\t\tincludeWellKnownTypes,\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\t\t\t\tresponses[indexedPluginConfig.Index] = response\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t}\n\t// We execute all of the jobs in parallel, but apply them in order so that any\n\t// insertion points are handled correctly.\n\t//\n\t// For example,\n\t//\n\t//  # buf.gen.yaml\n\t//  version: v1\n\t//  plugins:\n\t//    - plugin: buf.build/org/insertion-point-receiver\n\t//      out: gen/proto\n\t//    - name: insertion-point-writer\n\t//      out: gen/proto\n\tif err := thread.Parallelize(\n\t\tctx,\n\t\tjobs,\n\t\tthread.ParallelizeWithCancelOnFailure(),\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := validateResponses(responses, pluginConfigs); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := checkRequiredFeatures(g.logger, requiredFeatures, responses, pluginConfigs); err != nil {\n\t\treturn nil, err\n\t}\n\treturn responses, nil\n}\n\nfunc (g *generator) execLocalPlugin(\n\tctx context.Context,\n\tcontainer app.EnvStdioContainer,\n\tpluginImages []bufimage.Image,\n\tpluginConfig bufconfig.GeneratePluginConfig,\n\tincludeImports bool,\n\tincludeWellKnownTypes bool,\n) (*pluginpb.CodeGeneratorResponse, error) {\n\trequests, err := bufimage.ImagesToCodeGeneratorRequests(\n\t\tpluginImages,\n\t\tpluginConfig.Opt(),\n\t\tnil,\n\t\tincludeImports,\n\t\tincludeWellKnownTypes,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := g.pluginexecGenerator.Generate(\n\t\tctx,\n\t\tcontainer,\n\t\tpluginConfig.Name(),\n\t\trequests,\n\t\tbufprotopluginexec.GenerateWithPluginPath(pluginConfig.Path()...),\n\t\tbufprotopluginexec.GenerateWithProtocPath(pluginConfig.ProtocPath()...),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"plugin %s: %v\", pluginConfig.Name(), err)\n\t}\n\treturn response, nil\n}\n\nfunc (g *generator) execRemotePluginsV2(\n\tctx context.Context,\n\tcontainer app.EnvStdioContainer,\n\timage bufimage.Image,\n\tremote string,\n\tindexedPluginConfigs []xslices.Indexed[bufconfig.GeneratePluginConfig],\n\tincludeImportsOverride *bool,\n\tincludeWellKnownTypesOverride *bool,\n) ([]xslices.Indexed[*pluginpb.CodeGeneratorResponse], error) {\n\trequests := make([]*registryv1alpha1.PluginGenerationRequest, len(indexedPluginConfigs))\n\tfor i, indexedPluginConfig := range indexedPluginConfigs {\n\t\tincludeImports := indexedPluginConfig.Value.IncludeImports()\n\t\tif includeImportsOverride != nil {\n\t\t\tincludeImports = *includeImportsOverride\n\t\t}\n\t\tincludeWellKnownTypes := indexedPluginConfig.Value.IncludeWKT()\n\t\tif includeWellKnownTypesOverride != nil {\n\t\t\tincludeWellKnownTypes = *includeWellKnownTypesOverride\n\t\t}\n\t\trequest, err := getPluginGenerationRequest(\n\t\t\tindexedPluginConfig.Value,\n\t\t\tincludeImports,\n\t\t\tincludeWellKnownTypes,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trequests[i] = request\n\t}\n\tcodeGenerationService := connectclient.Make(g.clientConfig, remote, registryv1alpha1connect.NewCodeGenerationServiceClient)\n\tprotoImage, err := bufimage.ImageToProtoImage(image)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := codeGenerationService.GenerateCode(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\tregistryv1alpha1.GenerateCodeRequest_builder{\n\t\t\t\tImage:    protoImage,\n\t\t\t\tRequests: requests,\n\t\t\t}.Build(),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponses := response.Msg.GetResponses()\n\tif len(responses) != len(requests) {\n\t\treturn nil, fmt.Errorf(\"unexpected number of responses received, got %d, wanted %d\", len(responses), len(requests))\n\t}\n\tresult := make([]xslices.Indexed[*pluginpb.CodeGeneratorResponse], 0, len(responses))\n\tfor i := range requests {\n\t\tcodeGeneratorResponse := responses[i].GetResponse()\n\t\tif codeGeneratorResponse == nil {\n\t\t\treturn nil, errors.New(\"expected code generator response\")\n\t\t}\n\t\tresult = append(result, xslices.Indexed[*pluginpb.CodeGeneratorResponse]{\n\t\t\tValue: codeGeneratorResponse,\n\t\t\tIndex: indexedPluginConfigs[i].Index,\n\t\t})\n\t}\n\treturn result, nil\n}\n\nfunc getPluginGenerationRequest(\n\tpluginConfig bufconfig.GeneratePluginConfig,\n\tincludeImports bool,\n\tincludeWellKnownTypes bool,\n) (*registryv1alpha1.PluginGenerationRequest, error) {\n\tvar curatedPluginReference *registryv1alpha1.CuratedPluginReference\n\tif reference, err := bufremotepluginref.PluginReferenceForString(pluginConfig.Name(), pluginConfig.Revision()); err == nil {\n\t\tcuratedPluginReference = bufremoteplugin.PluginReferenceToProtoCuratedPluginReference(reference)\n\t} else {\n\t\t// Try parsing as a plugin identity (no version information)\n\t\tidentity, err := bufremotepluginref.PluginIdentityForString(pluginConfig.Name())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid remote plugin %q\", pluginConfig.Name())\n\t\t}\n\t\tcuratedPluginReference = bufremoteplugin.PluginIdentityToProtoCuratedPluginReference(identity)\n\t}\n\tvar options []string\n\tif len(pluginConfig.Opt()) > 0 {\n\t\t// Only include parameters if they're not empty.\n\t\toptions = []string{pluginConfig.Opt()}\n\t}\n\treturn registryv1alpha1.PluginGenerationRequest_builder{\n\t\tPluginReference:       curatedPluginReference,\n\t\tOptions:               options,\n\t\tIncludeImports:        &includeImports,\n\t\tIncludeWellKnownTypes: &includeWellKnownTypes,\n\t}.Build(), nil\n}\n\n// validateResponses verifies that a response is set for each of the\n// pluginConfigs, and that each generated file is generated by a single\n// plugin.\nfunc validateResponses(\n\tresponses []*pluginpb.CodeGeneratorResponse,\n\tpluginConfigs []bufconfig.GeneratePluginConfig,\n) error {\n\tif len(responses) != len(pluginConfigs) {\n\t\treturn fmt.Errorf(\"unexpected number of responses: expected %d but got %d\", len(pluginConfigs), len(responses))\n\t}\n\tpluginResponses := make([]*bufprotoplugin.PluginResponse, 0, len(responses))\n\tfor i, response := range responses {\n\t\tpluginConfig := pluginConfigs[i]\n\t\tif response == nil {\n\t\t\treturn fmt.Errorf(\"failed to create a response for %q\", pluginConfig.Name())\n\t\t}\n\t\tpluginResponses = append(\n\t\t\tpluginResponses,\n\t\t\tbufprotoplugin.NewPluginResponse(\n\t\t\t\tresponse,\n\t\t\t\tpluginConfig.Name(),\n\t\t\t\tpluginConfig.Out(),\n\t\t\t),\n\t\t)\n\t}\n\tif err := bufprotoplugin.ValidatePluginResponses(pluginResponses); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\ntype generateOptions struct {\n\tbaseOutDirPath                string\n\tdeleteOuts                    *bool\n\tincludeImportsOverride        *bool\n\tincludeWellKnownTypesOverride *bool\n}\n\nfunc newGenerateOptions() *generateOptions {\n\treturn &generateOptions{}\n}\n\ntype pluginConfigKeyForImage struct {\n\tincludeTypes string // string representation of []string\n\texcludeTypes string // string representation of []string\n\tstrategy     Strategy\n\tremoteHost   string\n}\n\n// createPluginConfigKeyForImage returns a key of the plugin config with\n// a subset of properties. This is used to batch plugins that have similar\n// configuration. The key is based on the following properties:\n//   - Types\n//   - ExcludeTypes\n//   - Strategy\n//   - RemoteHost\nfunc createPluginConfigKeyForImage(pluginConfig bufconfig.GeneratePluginConfig) pluginConfigKeyForImage {\n\t// Sort the types and excludeTypes so that the key is deterministic.\n\tsort.Strings(pluginConfig.IncludeTypes())\n\tsort.Strings(pluginConfig.ExcludeTypes())\n\treturn pluginConfigKeyForImage{\n\t\tincludeTypes: fmt.Sprintf(\"%v\", pluginConfig.IncludeTypes()),\n\t\texcludeTypes: fmt.Sprintf(\"%v\", pluginConfig.ExcludeTypes()),\n\t\tstrategy:     Strategy(pluginConfig.Strategy()),\n\t\tremoteHost:   pluginConfig.RemoteHost(),\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/buf.gen.yaml",
    "content": "version: v1\nplugins:\n  - name: go\n    out: private/gen/proto/go\n    opt: paths=source_relative\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error1.yaml",
    "content": "version: v1\nplugins:\n  - name: go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error10.yaml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  optimize_for:\n    # missing default\n    except:\n      - someremote.com/owner/repo\n      - someremote.com/owner/foo\n    override:\n      someremote.com/owner/bar: SPEED\n      someremote.com/owner/baz: LITE_RUNTIME\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error11.yaml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  optimize_for:\n    default: INVALID\n    except:\n      - someremote.com/owner/repo\n      - someremote.com/owner/foo\n    override:\n      someremote.com/owner/bar: SPEED\n      someremote.com/owner/baz: LITE_RUNTIME\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error12.yaml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  optimize_for:\n    default: INVALID\n    except:\n      - someremote.com/owner/repo\n      - someremote.com/owner/foo\n    override:\n      someremote.com/owner/bar: INVALID\n      someremote.com/owner/baz: LITE_RUNTIME\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error13.yaml",
    "content": "version: v1\nmanaged:  \n  objc_class_prefix:\n    default: default\n    except:\n      - someremote.com/owner/repo\n    override:\n      someremote.com/owner/repo: a\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error14.yaml",
    "content": "version: v1\nmanaged:  \n  objc_class_prefix:\n    default: default\n    except:\n      - someremote.com/owner/repo\n      - someremote.com/owner/repo\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error2.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  optimize_for: INVALID\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error3.yaml",
    "content": "version: v1\nmanaged:\n  optimize_for: SPEED\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error4.yaml",
    "content": "version: v1\nplugins:\n  - plugin: someremote.com/owner/myplugin:v1.1.0-1\n    # Remote and strategy specified at the same time, error\n    strategy: directory\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error5.yaml",
    "content": "version: v1\nplugins:\n  - plugin: someremote.com/owner/myplugin:v1.1.0-1\n    out: gen/go\n    # Path and remote name specified at the same time, Error\n    path: path/to/something\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error6.yaml",
    "content": "version: v1\nplugins:\n  - plugin: someremote.com/owner/myplugin:v1.1.0-1\n    # Remote and Name specified at the same time, error\n    name: go\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error7.yaml",
    "content": "version: v1\nplugins:\n  - plugin: buf.build/myuser/myplugin:v1.1.0-1\n    # No out specified, error\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error8.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  cc_enable_arenas: true\n  java_multiple_files: true\n  java_string_check_utf8: true\n  java_package_prefix: org\n  optimize_for: CODE_SIZE\n  override:\n    JAVA_PACKAGE:\n      ./foo.proto: override\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_error9.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  cc_enable_arenas: true\n  java_multiple_files: true\n  java_string_check_utf8: true\n  java_package_prefix: org\n  optimize_for: CODE_SIZE\n  override:\n    JAVA_PACKAGE:\n      ../foo/bar.proto: override\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success1.json",
    "content": "{\n  \"version\": \"v1\",\n  \"managed\": {\n    \"enabled\": true,\n    \"cc_enable_arenas\": true,\n    \"java_multiple_files\": true,\n    \"java_string_check_utf8\": true,\n    \"java_package_prefix\": \"org\",\n    \"optimize_for\": \"CODE_SIZE\",\n    \"override\": {\n      \"JAVA_PACKAGE\": {\n        \"a.proto\": \"override\"\n      }\n    }\n  },\n  \"plugins\": [\n    {\n      \"name\": \"go\",\n      \"out\": \"gen/go\",\n      \"opt\": \"plugins=connect\",\n      \"path\": \"/path/to/foo\",\n      \"strategy\": \"all\"\n    }\n  ],\n  \"types\": {\n    \"include\":[\n      \"buf.alpha.lint.v1.IDPaths\"\n    ]\n  }\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success1.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  cc_enable_arenas: true\n  java_multiple_files: true\n  java_string_check_utf8: true\n  java_package_prefix: org\n  optimize_for: CODE_SIZE\n  override:\n    JAVA_PACKAGE:\n      a.proto: override\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\ntypes:\n  include:\n    - \"buf.alpha.lint.v1.IDPaths\"\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success2.json",
    "content": "{\n  \"version\": \"v1\",\n  \"managed\": {\n    \"enabled\": true,\n    \"optimize_for\": \"SPEED\"\n  },\n  \"plugins\": [\n    {\n      \"name\": \"go\",\n      \"out\": \"gen/go\",\n      \"opt\": [\n        \"plugins=connect\",\n        \"foo=bar\"\n      ],\n      \"path\": \"/path/to/foo\",\n      \"strategy\": \"all\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success2.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  optimize_for: SPEED\nplugins:\n  - name: go\n    out: gen/go\n    opt:\n      - plugins=connect\n      - foo=bar\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success3.json",
    "content": "{\n  \"version\": \"v1\",\n  \"managed\": {\n    \"enabled\": true,\n    \"optimize_for\": \"LITE_RUNTIME\"\n  },\n  \"plugins\": [\n    {\n      \"name\": \"go\",\n      \"out\": \"gen/go\",\n      \"path\": \"/path/to/foo\",\n      \"strategy\": \"all\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success3.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  optimize_for: LITE_RUNTIME\nplugins:\n  - name: go\n    out: gen/go\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success3.yml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  optimize_for: LITE_RUNTIME\nplugins:\n  - name: go\n    out: gen/go\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success4.json",
    "content": "{\n  \"version\": \"v1\",\n  \"plugins\": [\n    {\n      \"plugin\": \"someremote.com/owner/myplugin:v1.1.0-1\",\n      \"out\": \"gen/go\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success4.yaml",
    "content": "version: v1\nplugins:\n  - plugin: someremote.com/owner/myplugin:v1.1.0-1\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success4.yml",
    "content": "version: v1\nplugins:\n  - plugin: someremote.com/owner/myplugin:v1.1.0-1\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success5.json",
    "content": "{\n  \"version\": \"v1\",\n  \"plugins\": [\n    {\n      \"plugin\": \"someremote.com/owner/myplugin\",\n      \"out\": \"gen/go\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success5.yaml",
    "content": "version: v1\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success5.yml",
    "content": "version: v1\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success6.json",
    "content": "{\n  \"version\": \"v1\",\n  \"managed\": {\n    \"enabled\": true,\n    \"java_package_prefix\": {\n      \"default\": \"org\",\n      \"except\": [\n        \"someremote.com/owner/repo\"\n      ]\n    }\n  },\n  \"plugins\": [\n    {\n      \"plugin\": \"someremote.com/owner/myplugin\",\n      \"out\": \"gen/go\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success6.yaml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  java_package_prefix:\n    default: \"org\"\n    except: \n      - someremote.com/owner/repo\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success6.yml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  java_package_prefix:\n    default: \"org\"\n    except: \n      - someremote.com/owner/repo\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n          "
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success7.json",
    "content": "{\n    \"version\": \"v1\",\n    \"managed\": {\n      \"go_package_prefix\": {\n        \"default\": \"github.com/foo/bar/gen/go\"\n      }\n    },\n    \"plugins\": [\n      {\n        \"name\": \"go\",\n        \"out\": \"gen/go\",\n        \"opt\": \"plugins=connect\",\n        \"path\": \"/path/to/foo\",\n        \"strategy\": \"all\"\n      }\n    ]\n  }\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success7.yaml",
    "content": "version: v1\nmanaged:\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success7.yml",
    "content": "version: v1\nmanaged:\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success8.json",
    "content": "{\n    \"version\": \"v1\",\n    \"managed\": {\n      \"enabled\": true,\n      \"csharp_namespace\": {\n        \"except\": [\n          \"someremote.com/owner/repo\"\n        ],\n        \"override\": {\n            \"someremote.com/owner/foo\": \"a\",\n            \"someremote.com/owner/bar\": \"b\",\n            \"someremote.com/owner/baz\": \"c\"\n        }\n      },\n      \"objc_class_prefix\": {\n        \"default\": \"default\",\n        \"except\": [\n          \"someremote.com/owner/repo\"\n        ],\n        \"override\": {\n            \"someremote.com/owner/foo\": \"a\",\n            \"someremote.com/owner/bar\": \"b\",\n            \"someremote.com/owner/baz\": \"c\"\n        }\n      },\n      \"ruby_package\": {\n        \"except\": [\n          \"someremote.com/owner/repo\"\n        ],\n        \"override\": {\n            \"someremote.com/owner/foo\": \"x\",\n            \"someremote.com/owner/bar\": \"y\",\n            \"someremote.com/owner/baz\": \"z\"\n        }\n      }\n    },\n    \"plugins\": [\n      {\n        \"plugin\": \"someremote.com/owner/myplugin\",\n        \"out\": \"gen/go\"\n      }\n    ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success8.yaml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  csharp_namespace:\n    except:\n      - someremote.com/owner/repo\n    override:\n      someremote.com/owner/foo: a\n      someremote.com/owner/bar: b\n      someremote.com/owner/baz: c\n  objc_class_prefix:\n    default: default\n    except:\n      - someremote.com/owner/repo\n    override:\n      someremote.com/owner/foo: a\n      someremote.com/owner/bar: b\n      someremote.com/owner/baz: c\n  ruby_package:\n    except:\n      - someremote.com/owner/repo\n    override:\n      someremote.com/owner/foo: x\n      someremote.com/owner/bar: y\n      someremote.com/owner/baz: z\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success8.yml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  csharp_namespace:\n    except:\n      - someremote.com/owner/repo\n    override:\n      someremote.com/owner/foo: a\n      someremote.com/owner/bar: b\n      someremote.com/owner/baz: c\n  objc_class_prefix:\n    default: default\n    except:\n      - someremote.com/owner/repo\n    override:\n      someremote.com/owner/foo: a\n      someremote.com/owner/bar: b\n      someremote.com/owner/baz: c\n  ruby_package:\n    except:\n      - someremote.com/owner/repo\n    override:\n      someremote.com/owner/foo: x\n      someremote.com/owner/bar: y\n      someremote.com/owner/baz: z\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success9.json",
    "content": "{\n    \"version\": \"v1\",\n    \"managed\": {\n      \"enabled\": true,\n      \"optimize_for\": {\n        \"default\": \"CODE_SIZE\",\n        \"except\": [\n            \"someremote.com/owner/repo\",\n            \"someremote.com/owner/foo\"\n        ],\n        \"override\": {\n            \"someremote.com/owner/bar\": \"SPEED\",\n            \"someremote.com/owner/baz\": \"LITE_RUNTIME\"\n        }\n      }\n    },\n    \"plugins\": [\n      {\n        \"plugin\": \"someremote.com/owner/myplugin\",\n        \"out\": \"gen/go\"\n      }\n    ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success9.yaml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  optimize_for:\n    default: CODE_SIZE\n    except:\n      - someremote.com/owner/repo\n      - someremote.com/owner/foo\n    override:\n      someremote.com/owner/bar: SPEED\n      someremote.com/owner/baz: LITE_RUNTIME\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/gen_success9.yml",
    "content": "version: v1\nmanaged:  \n  enabled: true\n  optimize_for:\n    default: CODE_SIZE\n    except:\n      - someremote.com/owner/repo\n      - someremote.com/owner/foo\n    override:\n      someremote.com/owner/bar: SPEED\n      someremote.com/owner/baz: LITE_RUNTIME\nplugins:\n  - plugin: someremote.com/owner/myplugin\n    out: gen/go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_error1.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\n    except:\n      - bufbuild.test/acme/weather\n    override:\n      bufbuild.test/acme/weather: github.com/foo/bar/private/gen/go\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_error2.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  go_package_prefix:\n    default: ../invalid/path\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_error3.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\n    except:\n      - invalid/identity\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_error4.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\n    override:\n      invalid/identity: github.com/foo/bar/private/gen/go\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_error5.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\n    override:\n      bufbuild.test/acme/weather: ../invalid/path\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_error6.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\n    except:\n      - bufbuild.test/acme/weather\n      - bufbuild.test/acme/payment\n      - bufbuild.test/acme/weather\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_success1.json",
    "content": "{\n  \"version\": \"v1\",\n  \"managed\": {\n    \"enabled\": true,\n    \"go_package_prefix\": {\n      \"default\": \"github.com/foo/bar/gen/go\"\n    }\n  },\n  \"plugins\": [\n    {\n      \"name\": \"go\",\n      \"out\": \"gen/go\",\n      \"opt\": \"plugins=connect\",\n      \"path\": \"/path/to/foo\",\n      \"strategy\": \"all\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1/go_gen_success1.yaml",
    "content": "version: v1\nmanaged:\n  enabled: true\n  go_package_prefix:\n    default: github.com/foo/bar/gen/go\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/buf.gen.yaml",
    "content": "version: v1beta1\nplugins:\n  - name: go\n    out: private/gen/proto/go\n    opt: paths=source_relative\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_error1.yaml",
    "content": "version: v1beta1\nplugins:\n  - name: go\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_error2.yaml",
    "content": "version: v1beta1\nmanaged: true\noptions:\n  optimize_for: INVALID\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_error3.yaml",
    "content": "version: v1beta1\noptions:\n  optimize_for: SPEED\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success1.json",
    "content": "{\n  \"version\": \"v1beta1\",\n  \"managed\": true,\n  \"options\": {\n    \"cc_enable_arenas\": true,\n    \"java_multiple_files\": true,\n    \"optimize_for\": \"CODE_SIZE\"\n  },\n  \"plugins\": [\n    {\n      \"name\": \"go\",\n      \"out\": \"gen/go\",\n      \"opt\": \"plugins=connect\",\n      \"path\": \"/path/to/foo\",\n      \"strategy\": \"all\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success1.yaml",
    "content": "version: v1beta1\nmanaged: true\noptions:\n  cc_enable_arenas: true\n  java_multiple_files: true\n  optimize_for: CODE_SIZE\nplugins:\n  - name: go\n    out: gen/go\n    opt: plugins=connect\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success2.json",
    "content": "{\n  \"version\": \"v1beta1\",\n  \"managed\": true,\n  \"options\": {\n    \"optimize_for\": \"SPEED\"\n  },\n  \"plugins\": [\n    {\n      \"name\": \"go\",\n      \"out\": \"gen/go\",\n      \"opt\": [\n        \"plugins=connect\",\n        \"foo=bar\"\n      ],\n      \"path\": \"/path/to/foo\",\n      \"strategy\": \"all\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success2.yaml",
    "content": "version: v1beta1\nmanaged: true\noptions:\n  optimize_for: SPEED\nplugins:\n  - name: go\n    out: gen/go\n    opt:\n      - plugins=connect\n      - foo=bar\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success3.json",
    "content": "{\n  \"version\": \"v1beta1\",\n  \"managed\": true,\n  \"options\": {\n    \"optimize_for\": \"LITE_RUNTIME\"\n  },\n  \"plugins\": [\n    {\n      \"name\": \"go\",\n      \"out\": \"gen/go\",\n      \"path\": \"/path/to/foo\",\n      \"strategy\": \"all\"\n    }\n  ]\n}\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success3.yaml",
    "content": "version: v1beta1\nmanaged: true\noptions:\n  optimize_for: LITE_RUNTIME\nplugins:\n  - name: go\n    out: gen/go\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success3.yml",
    "content": "version: v1beta1\nmanaged: true\noptions:\n  optimize_for: LITE_RUNTIME\nplugins:\n  - name: go\n    out: gen/go\n    path: /path/to/foo\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/testdata/v1beta1/gen_success4_nopath.yaml",
    "content": "version: v1beta1\nmanaged: true\noptions:\n  optimize_for: LITE_RUNTIME\nplugins:\n  - name: go\n    out: gen/go\n    strategy: all\n"
  },
  {
    "path": "private/buf/bufgen/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufgen\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/buflsp/buflsp.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp implements a language server for Protobuf.\n//\n// The main entry-point of this package is the Serve() function, which creates a new LSP server.\npackage buflsp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"runtime/debug\"\n\t\"sync\"\n\t\"sync/atomic\"\n\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"github.com/bufbuild/protocompile/experimental/incremental\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"go.lsp.dev/jsonrpc2\"\n\t\"go.lsp.dev/protocol\"\n\t\"go.uber.org/zap\"\n)\n\n// Serve spawns a new LSP server, listening on the given stream.\n//\n// Returns a context for managing the server.\nfunc Serve(\n\tctx context.Context,\n\tbufVersion string,\n\twktBucket storage.ReadBucket,\n\tcontainer appext.Container,\n\tcontroller bufctl.Controller,\n\twasmRuntime wasm.Runtime,\n\tstream jsonrpc2.Stream,\n\tqueryExecutor *incremental.Executor,\n) (jsonrpc2.Conn, error) {\n\t// Prefer build info version if available\n\tif buildInfo, ok := debug.ReadBuildInfo(); ok && buildInfo.Main.Version != \"\" {\n\t\tbufVersion = buildInfo.Main.Version\n\t}\n\n\tlogger := container.Logger()\n\tlogger = logger.With(slog.String(\"buf_version\", bufVersion))\n\tlogger.Info(\"starting LSP server\")\n\n\tconn := jsonrpc2.NewConn(stream)\n\t// connCtx is a context scoped to the connection's lifetime. It is cancelled\n\t// when the connection is done (or when ctx is cancelled), so that background\n\t// goroutines (e.g. RunChecks) do not outlive the connection.\n\tconnCtx, connCancel := context.WithCancel(context.Background())\n\tgo func() {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\tcase <-conn.Done():\n\t\t}\n\t\tconnCancel()\n\t}()\n\tlsp := &lsp{\n\t\tconn: conn,\n\t\tclient: protocol.ClientDispatcher(\n\t\t\t&connWrapper{Conn: conn, logger: logger},\n\t\t\tzap.NewNop(), // The logging from protocol itself isn't very good, we've replaced it with connAdapter here.\n\t\t),\n\t\tcontainer:     container,\n\t\tlogger:        logger,\n\t\tbufVersion:    bufVersion,\n\t\tcontroller:    controller,\n\t\twasmRuntime:   wasmRuntime,\n\t\twktBucket:     wktBucket,\n\t\tqueryExecutor: queryExecutor,\n\t\topener:        source.NewMap(nil),\n\t\tirSession:     new(ir.Session),\n\t\tconnCtx:       connCtx,\n\t\tconnCancel:    connCancel,\n\t}\n\tlsp.fileManager = newFileManager(lsp)\n\tlsp.workspaceManager = newWorkspaceManager(lsp)\n\toff := protocol.TraceOff\n\tlsp.traceValue.Store(&off)\n\n\thandler, err := lsp.newHandler()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconn.Go(ctx, handler)\n\treturn conn, nil\n}\n\n// *** PRIVATE ***\n\n// lsp contains all of the LSP server's state. (I.e., it is the \"god class\" the protocol requires\n// that we implement).\n//\n// This type does not implement protocol.Server; see server.go for that.\n// This type contains all the necessary book-keeping for keeping the server running.\n// Its handler methods are not defined in buflsp.go; they are defined in other files, grouped\n// according to the groupings in\ntype lsp struct {\n\tconn       jsonrpc2.Conn\n\tclient     protocol.Client\n\tcontainer  appext.Container\n\tconnCtx    context.Context    // cancelled when the connection is done\n\tconnCancel context.CancelFunc // cancels connCtx\n\n\tlogger           *slog.Logger\n\tbufVersion       string // buf version, set at server creation\n\tcontroller       bufctl.Controller\n\twasmRuntime      wasm.Runtime\n\tfileManager      *fileManager\n\tworkspaceManager *workspaceManager\n\tqueryExecutor    *incremental.Executor\n\topener           source.Map\n\tirSession        *ir.Session\n\twktBucket        storage.ReadBucket\n\tshutdown         bool\n\n\tlock sync.Mutex\n\n\t// These are atomics, because they are read often and written to\n\t// almost never, but potentially concurrently. Having them side-by-side\n\t// is fine; they are almost never written to so false sharing is not a\n\t// concern.\n\tinitParams atomic.Pointer[protocol.InitializeParams]\n\ttraceValue atomic.Pointer[protocol.TraceValue]\n}\n\n// init performs *actual* initialization of the server. This is called by Initialize().\n//\n// It may only be called once for a given server.\nfunc (l *lsp) init(_ context.Context, params *protocol.InitializeParams) error {\n\tif l.initParams.Load() != nil {\n\t\treturn fmt.Errorf(\"called the %q method more than once\", protocol.MethodInitialize)\n\t}\n\tl.initParams.Store(params)\n\n\t// TODO: set up logging. We need to forward everything from server.logger through to\n\t// the client, if tracing is turned on. The right way to do this is with an extra\n\t// goroutine and some channels.\n\n\treturn nil\n}\n\n// newHandler constructs an RPC handler that wraps the default one from jsonrpc2. This allows us\n// to inject debug logging, tracing, and timeouts to requests.\nfunc (l *lsp) newHandler() (jsonrpc2.Handler, error) {\n\tserver, err := newServer(l)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tactual := protocol.ServerHandler(server, nil)\n\t// [protocol.CancelHandler] intercepts $/cancelRequest notifications from the client and\n\t// cancels the context of the matching in-flight request. It must wrap AsyncHandler so\n\t// that the cancellable context is the one running inside each spawned goroutine.\n\treturn protocol.CancelHandler(jsonrpc2.AsyncHandler(func(ctx context.Context, reply jsonrpc2.Replier, req jsonrpc2.Request) error {\n\t\tl.logger.Debug(\n\t\t\t\"handling request\",\n\t\t\tslog.String(\"method\", req.Method()),\n\t\t)\n\t\tdefer xslog.DebugProfile(\n\t\t\tl.logger,\n\t\t\tslog.String(\"method\", req.Method()),\n\t\t)()\n\n\t\treplier := l.wrapReplier(reply, req)\n\n\t\tvar err error\n\t\tif req.Method() != protocol.MethodInitialize && l.initParams.Load() == nil {\n\t\t\t// Verify that the server has been initialized if this isn't the initialization\n\t\t\t// request.\n\t\t\terr = replier(ctx, nil, fmt.Errorf(\"the first call to the server must be the %q method\", protocol.MethodInitialize))\n\t\t} else {\n\t\t\tl.lock.Lock()\n\t\t\terr = actual(ctx, replier, req)\n\t\t\tl.lock.Unlock()\n\t\t}\n\n\t\tif err != nil {\n\t\t\tl.logger.Error(\n\t\t\t\t\"error while replying to request\",\n\t\t\t\tslog.String(\"method\", req.Method()),\n\t\t\t\txslog.ErrorAttr(err),\n\t\t\t)\n\t\t}\n\t\treturn nil\n\t})), nil\n}\n"
  },
  {
    "path": "private/buf/buflsp/buflsp_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"context\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/bufbuild/buf/private/buf/bufwkt/bufwktstore\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"github.com/bufbuild/protocompile/experimental/incremental\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/jsonrpc2\"\n\t\"go.lsp.dev/protocol\"\n\t\"go.lsp.dev/uri\"\n)\n\n// nopModuleKeyProvider is a no-op implementation of ModuleKeyProvider for testing\ntype nopModuleKeyProvider struct{}\n\nfunc (nopModuleKeyProvider) GetModuleKeysForModuleRefs(context.Context, []bufparse.Ref, bufmodule.DigestType) ([]bufmodule.ModuleKey, error) {\n\treturn nil, os.ErrNotExist\n}\n\n// setupLSPServer creates and initializes an LSP server for testing.\n// Returns the client JSON-RPC connection and the test file URI.\nfunc setupLSPServer(\n\tt *testing.T,\n\ttestProtoPath string,\n) (jsonrpc2.Conn, protocol.URI) {\n\tt.Helper()\n\n\tctx := t.Context()\n\n\tlogger := slogtestext.NewLogger(t, slogtestext.WithLogLevel(appext.LogLevelInfo))\n\n\tappContainer, err := app.NewContainerForOS()\n\trequire.NoError(t, err)\n\n\tnameContainer, err := appext.NewNameContainer(appContainer, \"buf-test\")\n\trequire.NoError(t, err)\n\tappextContainer := appext.NewContainer(nameContainer, logger)\n\n\tgraphProvider := bufmodule.NopGraphProvider\n\tmoduleDataProvider := bufmodule.NopModuleDataProvider\n\tcommitProvider := bufmodule.NopCommitProvider\n\tpluginKeyProvider := bufplugin.NopPluginKeyProvider\n\tpluginDataProvider := bufplugin.NopPluginDataProvider\n\tpolicyKeyProvider := bufpolicy.NopPolicyKeyProvider\n\tpolicyDataProvider := bufpolicy.NopPolicyDataProvider\n\n\ttmpDir := t.TempDir()\n\tstorageBucket, err := storageos.NewProvider().NewReadWriteBucket(tmpDir)\n\trequire.NoError(t, err)\n\n\twktStore := bufwktstore.NewStore(logger, storageBucket)\n\n\tcontroller, err := bufctl.NewController(\n\t\tlogger,\n\t\tappContainer,\n\t\tgraphProvider,\n\t\tnopModuleKeyProvider{},\n\t\tmoduleDataProvider,\n\t\tcommitProvider,\n\t\tpluginKeyProvider,\n\t\tpluginDataProvider,\n\t\tpolicyKeyProvider,\n\t\tpolicyDataProvider,\n\t\twktStore,\n\t\t&http.Client{},\n\t\thttpauth.NewNopAuthenticator(),\n\t\tgit.ClonerOptions{},\n\t)\n\trequire.NoError(t, err)\n\n\twktBucket, err := wktStore.GetBucket(ctx)\n\trequire.NoError(t, err)\n\n\twasmRuntime, err := wasm.NewRuntime(ctx)\n\trequire.NoError(t, err)\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, wasmRuntime.Close(ctx))\n\t})\n\n\tqueryExecutor := incremental.New()\n\n\tserverConn, clientConn := net.Pipe()\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, serverConn.Close())\n\t\trequire.NoError(t, clientConn.Close())\n\t})\n\n\tstream := jsonrpc2.NewStream(serverConn)\n\n\tconn, err := buflsp.Serve(\n\t\tctx,\n\t\t\"test\",\n\t\twktBucket,\n\t\tappextContainer,\n\t\tcontroller,\n\t\twasmRuntime,\n\t\tstream,\n\t\tqueryExecutor,\n\t)\n\trequire.NoError(t, err)\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, conn.Close())\n\t})\n\n\tclientStream := jsonrpc2.NewStream(clientConn)\n\tclientJSONConn := jsonrpc2.NewConn(clientStream)\n\tclientJSONConn.Go(ctx, jsonrpc2.AsyncHandler(func(_ context.Context, reply jsonrpc2.Replier, _ jsonrpc2.Request) error {\n\t\treturn reply(ctx, nil, nil)\n\t}))\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, clientJSONConn.Close())\n\t})\n\n\ttestWorkspaceDir := filepath.Dir(testProtoPath)\n\ttestURI := buflsp.FilePathToURI(testProtoPath)\n\tvar initResult protocol.InitializeResult\n\t_, initErr := clientJSONConn.Call(ctx, protocol.MethodInitialize, &protocol.InitializeParams{\n\t\tRootURI: uri.New(testWorkspaceDir),\n\t\tCapabilities: protocol.ClientCapabilities{\n\t\t\tTextDocument: &protocol.TextDocumentClientCapabilities{},\n\t\t},\n\t}, &initResult)\n\trequire.NoError(t, initErr)\n\tassert.True(t, initResult.Capabilities.HoverProvider != nil)\n\n\terr = clientJSONConn.Notify(ctx, protocol.MethodInitialized, &protocol.InitializedParams{})\n\trequire.NoError(t, err)\n\n\ttestProtoContent, err := os.ReadFile(testProtoPath)\n\trequire.NoError(t, err)\n\n\terr = clientJSONConn.Notify(ctx, protocol.MethodTextDocumentDidOpen, &protocol.DidOpenTextDocumentParams{\n\t\tTextDocument: protocol.TextDocumentItem{\n\t\t\tURI:        testURI,\n\t\t\tLanguageID: \"protobuf\",\n\t\t\tVersion:    1,\n\t\t\tText:       string(testProtoContent),\n\t\t},\n\t})\n\trequire.NoError(t, err)\n\n\treturn clientJSONConn, testURI\n}\n"
  },
  {
    "path": "private/buf/buflsp/builtin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Data for the built-in types.\n\npackage buflsp\n\n// builtinDocs contains documentation for the built-in types, to display in hover inlays.\nvar builtinDocs = map[string][]string{\n\t\"int32\": {\n\t\t\"A 32-bit integer (varint encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `-2147483648` and `2147483647`.\",\n\t\t\"Beware that negative values are encoded as five bytes on the wire!\",\n\t},\n\t\"int64\": {\n\t\t\"A 64-bit integer (varint encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `-9223372036854775808` and `9223372036854775807`.\",\n\t\t\"Beware that negative values are encoded as ten bytes on the wire!\",\n\t},\n\n\t\"uint32\": {\n\t\t\"A 32-bit unsigned integer (varint encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `0` and `4294967295`.\",\n\t},\n\t\"uint64\": {\n\t\t\"A 64-bit unsigned integer (varint encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `0` and `18446744073709551615`.\",\n\t},\n\n\t\"sint32\": {\n\t\t\"A 32-bit integer (ZigZag encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `-2147483648` and `2147483647`.\",\n\t},\n\t\"sint64\": {\n\t\t\"A 64-bit integer (ZigZag encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `-9223372036854775808` and `9223372036854775807`.\",\n\t},\n\n\t\"fixed32\": {\n\t\t\"A 32-bit unsigned integer (4-byte encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `0` and `4294967295`.\",\n\t},\n\t\"fixed64\": {\n\t\t\"A 64-bit unsigned integer (8-byte encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `0` and `18446744073709551615`.\",\n\t},\n\n\t\"sfixed32\": {\n\t\t\"A 32-bit integer (4-byte encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `-2147483648` and `2147483647`.\",\n\t},\n\t\"sfixed64\": {\n\t\t\"A 64-bit integer (8-byte encoding).\",\n\t\t\"\",\n\t\t\"Values of this type range between `-9223372036854775808` and `9223372036854775807`.\",\n\t},\n\n\t\"float\": {\n\t\t\"A single-precision floating point number (IEEE-745.2008 binary32).\",\n\t},\n\t\"double\": {\n\t\t\"A double-precision floating point number (IEEE-745.2008 binary64).\",\n\t},\n\n\t\"string\": {\n\t\t\"A string of text.\",\n\t\t\"\",\n\t\t\"Stores at most 4GB of text. Intended to be UTF-8 encoded Unicode; use `bytes` if you need other encodings.\",\n\t},\n\t\"bytes\": {\n\t\t\"A blob of arbitrary bytes.\",\n\t\t\"\",\n\t\t\"Stores at most 4GB of binary data. Encoded as base64 in JSON.\",\n\t},\n\n\t\"bool\": {\n\t\t\"A Boolean value: `true` or `false`.\",\n\t\t\"\",\n\t\t\"Encoded as a single byte: `0x00` or `0xff` (all non-zero bytes decode to `true`).\",\n\t},\n\n\t\"default\": {\n\t\t\"A magic option that specifies the field's default value.\",\n\t\t\"\",\n\t\t\"Unlike every other option on a field, this does not have a corresponding field in\",\n\t\t\"`google.protobuf.FieldOptions`; it is implemented by compiler magic.\",\n\t},\n\n\t\"map\": {\n\t\t\"A set of distinct keys, each of which is associated with a value.\",\n\t},\n}\n"
  },
  {
    "path": "private/buf/buflsp/cel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\tcelast \"github.com/google/cel-go/common/ast\"\n\t\"github.com/google/cel-go/common/operators\"\n)\n\n// celIsIdentChar reports whether c is a valid CEL identifier character:\n// ASCII letter, digit, or underscore. This mirrors the CEL spec's IDENT token\n// rule; there is no public API for this in cel-go.\nfunc celIsIdentChar(c byte) bool {\n\treturn (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'\n}\n\n// isCELKeyword returns true if the identifier is a CEL reserved keyword.\n// See https://github.com/google/cel-spec/blob/master/doc/langdef.md#syntax\nfunc isCELKeyword(name string) bool {\n\tswitch name {\n\tcase \"true\", \"false\", \"null\", // literals\n\t\t\"this\", \"now\": // protovalidate special variables\n\t\treturn true\n\t}\n\treturn false\n}\n\n// isCELMacroFunction returns true if the function name is a CEL macro (comprehension or special function).\n// See https://github.com/google/cel-spec/blob/master/doc/langdef.md#macros\nfunc isCELMacroFunction(funcName string) bool {\n\treturn funcName == operators.Has ||\n\t\tfuncName == operators.All ||\n\t\tfuncName == operators.Exists ||\n\t\tfuncName == operators.ExistsOne ||\n\t\tfuncName == operators.Map ||\n\t\tfuncName == operators.Filter\n\t// Note: \"size\" is intentionally excluded as it's more commonly used as a method\n}\n\n// celOperatorSymbol maps CEL operator function names to their operator symbols.\n// CEL represents operators as function calls with names like _&&_, _||_, _>_, etc.\n// Returns the operator symbol and true if the function name represents an operator.\n// See https://github.com/google/cel-spec/blob/master/doc/langdef.md#operators\nfunc celOperatorSymbol(funcName string) (string, bool) {\n\t// Use cel-go's operators.FindReverse to get the display symbol.\n\t// Only use the result when the display name is non-empty; the ternary operator\n\t// (_?_:_) is registered but has an empty display name, so FindReverse returns\n\t// (\"\", true) for it, which we must not treat as a valid symbol.\n\tif symbol, found := operators.FindReverse(funcName); found && symbol != \"\" {\n\t\treturn symbol, true\n\t}\n\n\t// Special case: ternary operator — use '?' as its hover symbol.\n\tif funcName == operators.Conditional {\n\t\treturn \"?\", true\n\t}\n\n\treturn \"\", false\n}\n\n// protoEscapeLen returns the number of source bytes consumed by the proto string\n// escape sequence beginning at s[i] (where s[i] == '\\\\').\n// Handles simple escapes (\\n, \\\\, etc.), hex (\\xNN), Unicode (\\uNNNN, \\UNNNNNNNN),\n// and octal (\\NNN) as defined by the proto language specification.\nfunc protoEscapeLen(s string, i int) int {\n\tif i+1 >= len(s) {\n\t\treturn 1\n\t}\n\tswitch s[i+1] {\n\tcase 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\\\', '\\'', '\"', '?':\n\t\treturn 2\n\tcase 'x', 'X':\n\t\t// Hex escape: \\xNN — consume up to 2 hex digits.\n\t\tend := i + 2\n\t\tfor end < len(s) && end < i+4 && isProtoHexDigit(s[end]) {\n\t\t\tend++\n\t\t}\n\t\treturn end - i\n\tcase 'u':\n\t\t// Unicode escape: \\uNNNN — consume up to 4 hex digits.\n\t\tend := i + 2\n\t\tfor end < len(s) && end < i+6 && isProtoHexDigit(s[end]) {\n\t\t\tend++\n\t\t}\n\t\treturn end - i\n\tcase 'U':\n\t\t// Unicode escape: \\UNNNNNNNN — consume up to 8 hex digits.\n\t\tend := i + 2\n\t\tfor end < len(s) && end < i+10 && isProtoHexDigit(s[end]) {\n\t\t\tend++\n\t\t}\n\t\treturn end - i\n\tdefault:\n\t\t// Octal: \\NNN — 1 to 3 octal digits.\n\t\tif s[i+1] >= '0' && s[i+1] <= '7' {\n\t\t\tend := i + 2\n\t\t\tfor end < len(s) && end < i+4 && s[end] >= '0' && s[end] <= '7' {\n\t\t\t\tend++\n\t\t\t}\n\t\t\treturn end - i\n\t\t}\n\t\treturn 2\n\t}\n}\n\n// isProtoHexDigit reports whether c is a valid hex digit (0-9, a-f, A-F).\n//\n// Equivalent to the unexported isHex in github.com/bufbuild/protocompile/linker.\nfunc isProtoHexDigit(c byte) bool {\n\treturn (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')\n}\n\n// createCELSpan creates a source.Span for a CEL token given its start and end offsets within the CEL expression.\n// exprLiteralSpan is the span of the proto string literal(s) containing the CEL expression (including quotes).\n// It handles both single-line and multi-line (adjacent proto string literals) spans uniformly by scanning for\n// opening quotes, then walking the string content while accounting for proto escape sequences.\nfunc createCELSpan(celStart, celEnd int, exprLiteralSpan source.Span) source.Span {\n\tspanText := exprLiteralSpan.Text()\n\tcelPos := 0\n\n\tfor i := 0; i < len(spanText); i++ {\n\t\tif spanText[i] != '\"' {\n\t\t\tcontinue\n\t\t}\n\t\t// Scan the content of this string literal.\n\t\ti++\n\t\tfor i < len(spanText) {\n\t\t\tif spanText[i] == '\"' {\n\t\t\t\tbreak // End of this string literal (unescaped closing quote)\n\t\t\t}\n\t\t\tif celPos == celStart {\n\t\t\t\tfileStart := exprLiteralSpan.Start + i\n\t\t\t\t// The token (celStart..celEnd) is assumed not to straddle a proto\n\t\t\t\t// escape sequence — true for all CEL identifiers, operators, and keywords.\n\t\t\t\tfileEnd := fileStart + (celEnd - celStart)\n\t\t\t\treturn source.Span{File: exprLiteralSpan.File, Start: fileStart, End: fileEnd}\n\t\t\t}\n\t\t\tvar charWidth int\n\t\t\tif spanText[i] == '\\\\' && i+1 < len(spanText) {\n\t\t\t\tcharWidth = protoEscapeLen(spanText, i)\n\t\t\t} else {\n\t\t\t\tcharWidth = 1\n\t\t\t}\n\t\t\tcelPos++\n\t\t\ti += charWidth\n\t\t}\n\t}\n\n\treturn source.Span{}\n}\n\n// fileByteOffsetToCELOffset is the inverse of createCELSpan: given a file byte\n// offset that falls within exprLiteralSpan, it returns the corresponding byte\n// offset within the concatenated CEL expression string.\n// Returns -1 if fileByteOffset is not inside any string content of the span\n// (e.g. it lands on a quote character, whitespace between literals, or is out\n// of range).\nfunc fileByteOffsetToCELOffset(fileByteOffset int, exprLiteralSpan source.Span) int {\n\tspanText := exprLiteralSpan.Text()\n\tcelPos := 0\n\n\tfor i := 0; i < len(spanText); i++ {\n\t\tif spanText[i] != '\"' {\n\t\t\tcontinue\n\t\t}\n\t\ti++\n\t\tfor i < len(spanText) {\n\t\t\tif spanText[i] == '\"' {\n\t\t\t\tbreak // End of this string literal\n\t\t\t}\n\t\t\tif exprLiteralSpan.Start+i == fileByteOffset {\n\t\t\t\treturn celPos\n\t\t\t}\n\t\t\tvar charWidth int\n\t\t\tif spanText[i] == '\\\\' && i+1 < len(spanText) {\n\t\t\t\tcharWidth = protoEscapeLen(spanText, i)\n\t\t\t} else {\n\t\t\t\tcharWidth = 1\n\t\t\t}\n\t\t\tcelPos++\n\t\t\ti += charWidth\n\t\t}\n\t}\n\treturn -1\n}\n\n// celLocByteOffset converts a CEL source location (line, col) to a byte offset\n// within exprString. line and col come from common.Location, which returns int,\n// but ComputeOffset requires int32; the conversion is safe for any realistic\n// CEL expression length.\nfunc celLocByteOffset(line, col int, sourceInfo *celast.SourceInfo, exprString string) int {\n\truneOffset := int32(col) + sourceInfo.ComputeOffset(int32(line), 0)\n\treturn celRuneOffsetToByteOffset(exprString, runeOffset)\n}\n\n// celRuneOffsetToByteOffset converts a CEL source position (Unicode code point offset)\n// to a UTF-8 byte offset within the expression string.\n//\n// CEL-go tracks source positions as Unicode code point (rune) offsets, not byte offsets.\n// We need byte offsets to correctly slice Go strings and compute file spans.\nfunc celRuneOffsetToByteOffset(s string, runeOffset int32) int {\n\tbyteIdx := 0\n\tfor runeIdx := int32(0); runeIdx < runeOffset && byteIdx < len(s); runeIdx++ {\n\t\t_, size := utf8.DecodeRuneInString(s[byteIdx:])\n\t\tbyteIdx += size\n\t}\n\treturn byteIdx\n}\n\n// celOffsetRangeToByteRange converts a CEL ast.OffsetRange to byte start and stop offsets.\n//\n// CEL stores OffsetRange.Start as a Unicode code point (rune) offset, but\n// OffsetRange.Stop = Start + len(tokenText) where len uses Go's byte count (UTF-8 bytes).\n// Therefore Stop-Start equals the byte length of the token, not its rune length.\n// This gives correct byte bounds for both ASCII and non-ASCII tokens.\nfunc celOffsetRangeToByteRange(exprString string, r celast.OffsetRange) (byteStart, byteStop int) {\n\tbyteStart = celRuneOffsetToByteOffset(exprString, r.Start)\n\tbyteStop = byteStart + int(r.Stop-r.Start) // Stop-Start is byte length of the token\n\treturn\n}\n\n// findMethodNameAfterDot finds the position of a method name after a dot in a CEL expression.\n// targetByteOffset is a byte offset (not rune offset) within exprString.\n// Returns the start and end byte positions, or -1 if not found.\nfunc findMethodNameAfterDot(targetByteOffset int, methodName string, exprString string) (start, end int) {\n\tsearchStart := targetByteOffset\n\tsearchRegion := exprString[searchStart:]\n\n\t// Search for \".methodName\" pattern in the remaining string\n\tif idx := strings.Index(searchRegion, \".\"+methodName); idx >= 0 {\n\t\t// Found the pattern, return the position of just the method name (skip the dot)\n\t\tnameStart := searchStart + idx + 1 // +1 to skip the dot\n\t\tnameEnd := nameStart + len(methodName)\n\t\treturn nameStart, nameEnd\n\t}\n\treturn -1, -1\n}\n\n// findNameAfterDot searches for \".name\" after targetByteOffset and returns the span of just the name (without the dot).\n// targetByteOffset is a byte offset (not rune offset) within exprString.\n// Returns zero span if not found.\nfunc findNameAfterDot(\n\ttargetByteOffset int,\n\tname string,\n\texprString string,\n\texprLiteralSpan source.Span,\n) source.Span {\n\tstart, end := findMethodNameAfterDot(targetByteOffset, name, exprString)\n\tif start < 0 {\n\t\treturn source.Span{}\n\t}\n\treturn createCELSpan(start, end, exprLiteralSpan)\n}\n\n// findStandaloneFunctionName calculates the position of a function name before an opening paren.\n// celByteOffset is the byte offset (not rune offset) of the opening paren within exprString.\nfunc findStandaloneFunctionName(celByteOffset int, funcName string, exprString string) (start, end int, found bool) {\n\tstart = celByteOffset - len(funcName)\n\tend = start + len(funcName)\n\tif start >= 0 && end <= len(exprString) && exprString[start:end] == funcName {\n\t\treturn start, end, true\n\t}\n\treturn -1, -1, false\n}\n"
  },
  {
    "path": "private/buf/buflsp/completion.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file implements code completion support for the LSP.\n\npackage buflsp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"iter\"\n\t\"log/slog\"\n\t\"math\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/ast/syntax\"\n\t\"github.com/bufbuild/protocompile/experimental/id\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/experimental/token\"\n\t\"github.com/bufbuild/protocompile/experimental/token/keyword\"\n\t\"go.lsp.dev/protocol\"\n\t\"google.golang.org/protobuf/encoding/protowire\"\n)\n\n// numberRange represents a range of numbers (inclusive) used for field/enum number completion.\ntype numberRange[T int32 | uint64] struct {\n\tstart T\n\tend   T\n}\n\n// getCompletionItems returns completion items for the given position in the file.\n//\n// This function is called by the Completion handler in server.go.\nfunc getCompletionItems(\n\tctx context.Context,\n\tfile *file,\n\tposition protocol.Position,\n) []protocol.CompletionItem {\n\tif file.ir.AST() == nil {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"no AST found for completion\",\n\t\t\tslog.String(\"file\", file.uri.Filename()),\n\t\t)\n\t\treturn nil\n\t}\n\n\t// This grabs the contents of the file as the top-level [ast.DeclBody], see [ast.File].Decls()\n\t// for reference.\n\toffset := positionToOffset(file, position)\n\tdeclPath := getDeclForOffset(id.Wrap(file.ir.AST(), id.ID[ast.DeclBody](1)), offset)\n\tif len(declPath) > 0 {\n\t\tdecl := declPath[len(declPath)-1]\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: found declaration\",\n\t\t\tslog.String(\"decl_kind\", decl.Kind().String()),\n\t\t\tslog.Int(\"path_depth\", len(declPath)),\n\t\t)\n\t} else {\n\t\tfile.lsp.logger.DebugContext(ctx, \"completion: no declaration found at position\")\n\t\treturn nil\n\t}\n\n\t// Return context-aware completions based on the declaration type.\n\treturn completionItemsForDeclPath(ctx, file, declPath, position)\n}\n\n// completionItemsForDeclPath returns completion items based on the AST declaration path at the cursor.\n// The declPath is a slice from parent to smallest declaration, where [0] is the top-level and [len-1] is the innermost.\nfunc completionItemsForDeclPath(ctx context.Context, file *file, declPath []ast.DeclAny, position protocol.Position) []protocol.CompletionItem {\n\tif len(declPath) == 0 {\n\t\treturn nil\n\t}\n\n\t// Get the innermost (smallest) declaration.\n\tdecl := declPath[len(declPath)-1]\n\tfile.lsp.logger.DebugContext(\n\t\tctx,\n\t\t\"completion: processing declaration\",\n\t\tslog.String(\"kind\", decl.Kind().String()),\n\t)\n\n\t// Return context-specific completions based on declaration type.\n\tswitch decl.Kind() {\n\tcase ast.DeclKindInvalid:\n\t\tfile.lsp.logger.DebugContext(ctx, \"completion: ignoring invalid declaration\")\n\t\treturn nil\n\tcase ast.DeclKindDef:\n\t\treturn completionItemsForDef(ctx, file, declPath, decl.AsDef(), position)\n\tcase ast.DeclKindSyntax:\n\t\treturn completionItemsForSyntax(ctx, file, decl.AsSyntax(), position)\n\tcase ast.DeclKindPackage:\n\t\treturn completionItemsForPackage(ctx, file, decl.AsPackage())\n\tcase ast.DeclKindImport:\n\t\treturn completionItemsForImport(ctx, file, decl.AsImport(), position)\n\tdefault:\n\t\tfile.lsp.logger.DebugContext(ctx, \"completion: unknown declaration type\", slog.String(\"kind\", decl.Kind().String()))\n\t\treturn nil\n\t}\n}\n\n// completionItemsForSyntax returns the completion items for the files syntax.\nfunc completionItemsForSyntax(ctx context.Context, file *file, syntaxDecl ast.DeclSyntax, position protocol.Position) []protocol.CompletionItem {\n\tfile.lsp.logger.DebugContext(ctx, \"completion: syntax declaration\", slog.Bool(\"is_edition\", syntaxDecl.IsEdition()))\n\n\toffset := positionToOffset(file, position)\n\tvalueSpan := syntaxDecl.Value().Span()\n\tstart, end := valueSpan.Start, valueSpan.End\n\tvalueText := valueSpan.Text()\n\n\t// Break on newlines to split an unintended capture.\n\tif index := strings.IndexByte(valueText, '\\n'); index != -1 {\n\t\tend = start + index\n\t\tvalueText = valueText[:index]\n\t}\n\n\tif start > offset || offset > end {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx, \"completion: syntax outside value\",\n\t\t\tslog.String(\"value\", valueSpan.Text()),\n\t\t\tslog.Int(\"start\", start),\n\t\t\tslog.Int(\"offset\", offset),\n\t\t\tslog.Int(\"end\", end),\n\t\t\tslog.Int(\"line\", int(position.Line)),\n\t\t\tslog.Int(\"character\", int(position.Character)),\n\t\t)\n\t\treturn nil // outside value\n\t}\n\n\tindex := offset - start\n\tprefix := valueText[:index]\n\tsuffix := valueText[index:]\n\n\tvar additionalTextEdits []protocol.TextEdit\n\tif syntaxDecl.Equals().IsZero() {\n\t\tvalueRange := reportSpanToProtocolRange(valueSpan)\n\t\tadditionalTextEdits = append(additionalTextEdits, protocol.TextEdit{\n\t\t\tNewText: \"= \",\n\t\t\t// Insert before value.\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: valueRange.Start,\n\t\t\t\tEnd:   valueRange.Start,\n\t\t\t},\n\t\t})\n\t}\n\tif syntaxDecl.Semicolon().IsZero() {\n\t\tadditionalTextEdits = append(additionalTextEdits, protocol.TextEdit{\n\t\t\tNewText: \";\",\n\t\t\t// End of line.\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: protocol.Position{\n\t\t\t\t\tLine:      position.Line,\n\t\t\t\t\tCharacter: math.MaxInt32 - 1,\n\t\t\t\t},\n\t\t\t\tEnd: protocol.Position{\n\t\t\t\t\tLine:      position.Line,\n\t\t\t\t\tCharacter: math.MaxUint32,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n\n\tvar syntaxes iter.Seq[syntax.Syntax]\n\tif syntaxDecl.IsEdition() {\n\t\tsyntaxes = syntax.Editions()\n\t} else {\n\t\tsyntaxes = func(yield func(syntax.Syntax) bool) {\n\t\t\t_ = yield(syntax.Proto2) &&\n\t\t\t\tyield(syntax.Proto3)\n\t\t}\n\t}\n\tvar items []protocol.CompletionItem\n\tfor syntax := range syntaxes {\n\t\tsuggest := fmt.Sprintf(\"%q\", syntax)\n\t\tif !strings.HasPrefix(suggest, prefix) || !strings.HasSuffix(suggest, suffix) {\n\t\t\tcontinue\n\t\t}\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel: syntax.String(),\n\t\t\tKind:  protocol.CompletionItemKindValue,\n\t\t\tTextEdit: &protocol.TextEdit{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: position,\n\t\t\t\t\tEnd:   position,\n\t\t\t\t},\n\t\t\t\tNewText: suggest[len(prefix) : len(suggest)-len(suffix)],\n\t\t\t},\n\t\t\tAdditionalTextEdits: additionalTextEdits,\n\t\t})\n\t}\n\treturn items\n}\n\n// completionItemsForPackage returns the completion items for the package name.\n//\n// Suggest the package name based on the filepath.\nfunc completionItemsForPackage(ctx context.Context, file *file, syntaxPackage ast.DeclPackage) []protocol.CompletionItem {\n\tcomponents := normalpath.Components(file.objectInfo.Path())\n\tsuggested := components[:len(components)-1] // Strip the filename.\n\tif len(suggested) == 0 {\n\t\tfile.lsp.logger.DebugContext(ctx, \"completion: package at root, no suggestions\")\n\t\treturn nil // File is at root, return no suggestions.\n\t}\n\tfile.lsp.logger.DebugContext(ctx, \"completion: package suggestion\", slog.String(\"package\", strings.Join(suggested, \".\")))\n\treturn []protocol.CompletionItem{{\n\t\tLabel: strings.Join(suggested, \".\") + \";\",\n\t\tKind:  protocol.CompletionItemKindModule,\n\t}}\n}\n\n// completionItemsForDef returns completion items for definition declarations (message, enum, service, etc.).\nfunc completionItemsForDef(ctx context.Context, file *file, declPath []ast.DeclAny, def ast.DeclDef, position protocol.Position) []protocol.CompletionItem {\n\toffset := positionToOffset(file, position)\n\tinBody := offsetInSpan(offset, def.Body().Span()) == 0\n\n\t// Parent declaration determines child completions.\n\tvar parentDef ast.DeclDef\n\tif len(declPath) >= 2 {\n\t\tparentDef = declPath[len(declPath)-2].AsDef()\n\t}\n\tif inBody {\n\t\tparentDef = def\n\t\tdef = ast.DeclDef{} // Mark current def as invalid.\n\t}\n\n\tfile.lsp.logger.DebugContext(\n\t\tctx,\n\t\t\"completion: definition\",\n\t\tslog.String(\"keyword\", def.Keyword().String()),\n\t\tslog.String(\"type\", def.Type().Span().Text()),\n\t\tslog.String(\"name\", def.Name().Span().Text()),\n\t\tslog.String(\"kind\", def.Classify().String()),\n\t\tslog.String(\"parent_kind\", parentDef.Classify().String()),\n\t\tslog.Bool(\"in_body\", inBody),\n\t\tslog.Int(\"path_depth\", len(declPath)),\n\t)\n\n\tswitch def.Classify() {\n\tcase ast.DefKindMessage, ast.DefKindService, ast.DefKindEnum, ast.DefKindGroup:\n\t\t// Ignore these kinds as this will be a completion for the name of the declaration.\n\t\treturn nil\n\tcase ast.DefKindOption:\n\t\treturn completionItemsForOptions(ctx, file, parentDef, def, offset)\n\tcase ast.DefKindField, ast.DefKindMethod, ast.DefKindInvalid, ast.DefKindEnumValue:\n\t\t// Use these kinds as completion starts.\n\t\t// An invalid kind is caused from partial values, which may be any kind.\n\tdefault:\n\t\tfile.lsp.logger.DebugContext(ctx, \"completion: unknown definition type\", slog.String(\"kind\", def.Classify().String()))\n\t\treturn nil\n\t}\n\n\t// This checks for options declared within the declaration.\n\tif offsetInSpan(offset, def.Options().Span()) == 0 {\n\t\treturn completionItemsForCompactOptions(ctx, file, def, offset)\n\t}\n\n\ttokenSpan := extractAroundOffset(file, offset, isTokenType, isTokenType)\n\ttokenPrefix, tokenSuffix := splitSpan(tokenSpan, offset)\n\n\t// Extract the full type and name declaration to compute the heuristics for completion.\n\t// Use the token stream to capture invalid declarations.\n\tbeforeCount, afterCount := 0, 0\n\thasBeforeGap, hasAfterGap := false, false\n\thasStart := false // Start is a newline or open parenthesis for the start of a definition\n\thasTypeModifier := false\n\thasDeclaration := false\n\ttypeSpan := extractAroundOffset(file, offset,\n\t\tfunc(tok token.Token) bool {\n\t\t\tif isTokenTypeDelimiter(tok) {\n\t\t\t\thasStart = true\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif hasBeforeGap {\n\t\t\t\tbeforeCount += 1\n\t\t\t\thasBeforeGap = false\n\t\t\t\tif kw := tok.Keyword(); kw != keyword.Unknown {\n\t\t\t\t\t_, isDeclaration := declarationSet[tok.Keyword()]\n\t\t\t\t\thasDeclaration = hasDeclaration || isDeclaration\n\t\t\t\t\t_, isFieldModifier := typeModifierSet[tok.Keyword()]\n\t\t\t\t\thasTypeModifier = hasTypeModifier || isFieldModifier\n\t\t\t\t}\n\t\t\t}\n\t\t\tif isTokenSpace(tok) {\n\t\t\t\thasBeforeGap = true\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn isTokenType(tok) || isTokenParen(tok)\n\t\t},\n\t\tfunc(tok token.Token) bool {\n\t\t\tif hasAfterGap {\n\t\t\t\tafterCount += 1\n\t\t\t\thasAfterGap = false\n\t\t\t}\n\t\t\tif isTokenTypeDelimiter(tok) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif isTokenSpace(tok) {\n\t\t\t\thasAfterGap = true\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn isTokenType(tok) || isTokenParen(tok)\n\t\t},\n\t)\n\ttypePrefix, typeSuffix := splitSpan(typeSpan, offset)\n\n\t// Check if cursor is inside map type parameters (e.g., map<int32, |>)\n\tinsideMapType, isMapKeyPosition := isInsideMapType(file, def, offset)\n\tfile.lsp.logger.DebugContext(ctx, \"completion: map type detection\",\n\t\tslog.Bool(\"inside_map\", insideMapType),\n\t\tslog.Bool(\"is_key_pos\", isMapKeyPosition))\n\n\tfile.lsp.logger.DebugContext(\n\t\tctx, \"completion: definition value\",\n\t\tslog.String(\"token\", tokenSpan.Text()),\n\t\tslog.String(\"token_prefix\", tokenPrefix),\n\t\tslog.String(\"token_suffix\", tokenSuffix),\n\t\tslog.String(\"type\", typeSpan.Text()),\n\t\tslog.String(\"type_prefix\", typePrefix),\n\t\tslog.String(\"type_suffix\", typeSuffix),\n\t\tslog.Int(\"before_count\", beforeCount),\n\t\tslog.Int(\"after_count\", afterCount),\n\t\tslog.Bool(\"has_start\", hasStart),\n\t\tslog.Bool(\"has_field_modifier\", hasTypeModifier),\n\t\tslog.Bool(\"has_declaration\", hasDeclaration),\n\t\tslog.Bool(\"inside_map_type\", insideMapType),\n\t\tslog.Bool(\"is_map_key_position\", isMapKeyPosition),\n\t)\n\t// Special case: field number completion\n\tif !hasStart && parentDef.Classify() == ast.DefKindMessage {\n\t\t// Case 1: Valid field definition with type and name but no tag\n\t\t// e.g., `string name = |;\\n`\n\t\tif def.Classify() == ast.DefKindField {\n\t\t\tfield := def.AsField()\n\t\t\tif !field.Type.IsZero() && !field.Name.IsZero() && field.Tag.IsZero() {\n\t\t\t\treturn completionItemsForFieldNumber(file, parentDef)\n\t\t\t}\n\t\t}\n\t\t// Case 2: Invalid definition (e.g., missing semicolon) but cursor is after equals sign\n\t\t// e.g., `string name = |`\n\t\tif def.Classify() == ast.DefKindInvalid && isAfterEqualsSign(file, offset) {\n\t\t\treturn completionItemsForFieldNumber(file, parentDef)\n\t\t}\n\t}\n\t// Special case: enum value number completion\n\tif !hasStart && parentDef.Classify() == ast.DefKindEnum {\n\t\t// Case 1: Valid enum value definition with name but no tag\n\t\t// e.g., `STATUS_ACTIVE = |;\\n`\n\t\tif def.Classify() == ast.DefKindEnumValue {\n\t\t\tenumValue := def.AsEnumValue()\n\t\t\tif !enumValue.Name.IsZero() && enumValue.Tag.IsZero() {\n\t\t\t\treturn completionItemsForEnumNumber(file, parentDef, enumValue)\n\t\t\t}\n\t\t}\n\t\t// Case 2: Invalid definition (e.g., missing semicolon) but cursor is after equals sign\n\t\t// e.g., `STATUS_ACTIVE = |`\n\t\tif def.Classify() == ast.DefKindInvalid && isAfterEqualsSign(file, offset) {\n\t\t\treturn completionItemsForEnumNumber(file, parentDef, ast.DefEnumValue{})\n\t\t}\n\t}\n\t// Allow completions when inside map types even if hasStart is false\n\t// (this handles completion after comma, e.g., \"map<int32, |\")\n\tif !hasStart && !insideMapType {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: ignoring definition type unable to find start\",\n\t\t\tslog.String(\"kind\", def.Classify().String()),\n\t\t)\n\t\treturn nil\n\t}\n\n\t// This corrects for invalid syntax on option declarations with a corrupt declaration.\n\t// For example \"option (extension).\" will fail to be parsed as a declaration.\n\tif def.Keyword() == keyword.Option ||\n\t\tstrings.HasPrefix(typeSpan.Text(), keyword.Option.String()+\" \") ||\n\t\tstrings.HasPrefix(def.Type().Span().Text(), keyword.Option.String()+\" \") {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: identified option from declaration\",\n\t\t\tslog.String(\"kind\", def.Classify().String()),\n\t\t\tslog.String(\"text\", typeSpan.Text()),\n\t\t)\n\t\treturn completionItemsForOptions(ctx, file, parentDef, def, offset)\n\t}\n\n\t// If at the top level, and on the first item, return top level keywords.\n\tif parentDef.IsZero() {\n\t\tshowKeywords := beforeCount == 0\n\t\tif showKeywords {\n\t\t\tfile.lsp.logger.DebugContext(ctx, \"completion: definition returning top-level keywords\")\n\t\t\treturn slices.Collect(keywordToCompletionItem(\n\t\t\t\ttopLevelKeywords(),\n\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\ttokenSpan,\n\t\t\t\toffset,\n\t\t\t))\n\t\t}\n\t\treturn nil // unknown\n\t}\n\n\tvar iters []iter.Seq[protocol.CompletionItem]\n\tswitch parentDef.Classify() {\n\tcase ast.DefKindMessage:\n\t\t// Limit completions based on the following heuristics:\n\t\t// - Show keywords for the first values (but not when inside map key position)\n\t\t// - Show types if no type declaration and at first, or second position with field modifier.\n\t\t// - Always show types if cursor is inside map<...> angle brackets\n\t\tshowKeywords := beforeCount == 0 && !(insideMapType && isMapKeyPosition)\n\t\tshowTypes := insideMapType || (!hasDeclaration && (beforeCount == 0 || (hasTypeModifier && beforeCount == 1)))\n\t\tif showKeywords {\n\t\t\tisProto2 := isProto2(file)\n\t\t\titers = append(iters,\n\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\tmessageLevelKeywords(isProto2),\n\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\ttokenSpan,\n\t\t\t\t\toffset,\n\t\t\t\t),\n\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\tmessageLevelFieldKeywords(),\n\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\ttokenSpan,\n\t\t\t\t\toffset,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t\tif showTypes {\n\t\t\t// When inside map angle brackets, use only the prefix of the tokenSpan for filtering\n\t\t\tcompletionSpan := tokenSpan\n\t\t\tif insideMapType {\n\t\t\t\t// Use only the prefix part for filtering when inside map<>\n\t\t\t\tcompletionSpan = source.Span{\n\t\t\t\t\tFile:  tokenSpan.File,\n\t\t\t\t\tStart: tokenSpan.Start,\n\t\t\t\t\tEnd:   offset,\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// For map key position, only show valid map key types\n\t\t\tif insideMapType && isMapKeyPosition {\n\t\t\t\tfile.lsp.logger.DebugContext(ctx, \"completion: map key position detected, showing only valid map key types\")\n\t\t\t\titers = append(iters,\n\t\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\t\tmapKeyTypeKeywords(),\n\t\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\t\tcompletionSpan,\n\t\t\t\t\t\toffset,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tfile.lsp.logger.DebugContext(ctx, \"completion: showing all types\",\n\t\t\t\t\tslog.Bool(\"inside_map\", insideMapType),\n\t\t\t\t\tslog.Bool(\"is_key_pos\", isMapKeyPosition),\n\t\t\t\t)\n\t\t\t\t// Regular type completions or map value position\n\t\t\t\titers = append(iters,\n\t\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\t\tpredeclaredTypeKeywords(),\n\t\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\t\tcompletionSpan,\n\t\t\t\t\t\toffset,\n\t\t\t\t\t),\n\t\t\t\t\ttypeReferencesToCompletionItems(\n\t\t\t\t\t\tfile,\n\t\t\t\t\t\tfindTypeFullName(file, parentDef),\n\t\t\t\t\t\tcompletionSpan,\n\t\t\t\t\t\toffset,\n\t\t\t\t\t\ttrue, // Allow enums.\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\tcase ast.DefKindService:\n\t\t// Method types are only shown within args of the method definition.\n\t\t// Use the type to handle invalid defs.\n\t\tdefMethod := def.AsMethod()\n\t\tisRPC := defMethod.Keyword.Keyword() == keyword.RPC ||\n\t\t\tstrings.HasPrefix(typeSpan.Text(), keyword.RPC.String())\n\n\t\t// Limit complitions based on the following heuristics:\n\t\t// - Show keywords for the first values.\n\t\t// - Show return keyword if an RPC method and at the third position.\n\t\t// - Show types if an RPC method and within the Input or Output args.\n\t\tshowKeywords := beforeCount == 0\n\t\tshowReturnKeyword := isRPC &&\n\t\t\t(beforeCount == 2 || offsetInSpan(offset, defMethod.Signature.Returns().Span()) == 0)\n\t\tshowTypes := isRPC && !hasDeclaration &&\n\t\t\t(beforeCount == 0 || (hasTypeModifier && beforeCount == 1)) &&\n\t\t\t(offsetInSpan(offset, defMethod.Signature.Inputs().Span()) == 0 ||\n\t\t\t\toffsetInSpan(offset, defMethod.Signature.Outputs().Span()) == 0)\n\n\t\tif showKeywords {\n\t\t\t// If both showKeywords and showTypes is set, we are in a services method args.\n\t\t\tif showTypes {\n\t\t\t\titers = append(iters,\n\t\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\t\tmethodArgLevelKeywords(),\n\t\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\t\ttokenSpan,\n\t\t\t\t\t\toffset,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\titers = append(iters,\n\t\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\t\tserviceLevelKeywords(),\n\t\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\t\ttokenSpan,\n\t\t\t\t\t\toffset,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t} else if showReturnKeyword {\n\t\t\titers = append(iters,\n\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\tserviceReturnKeyword(),\n\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\ttokenSpan,\n\t\t\t\t\toffset,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t\tif showTypes {\n\t\t\titers = append(iters,\n\t\t\t\ttypeReferencesToCompletionItems(\n\t\t\t\t\tfile,\n\t\t\t\t\t\"\", // No parent type within a service declaration.\n\t\t\t\t\ttokenSpan,\n\t\t\t\t\toffset,\n\t\t\t\t\tfalse, // Disallow enums.\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\tcase ast.DefKindMethod:\n\t\tshowKeywords := beforeCount == 0\n\t\tif showKeywords {\n\t\t\titers = append(iters,\n\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\toptionKeywords(),\n\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\ttokenSpan,\n\t\t\t\t\toffset,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\tcase ast.DefKindEnum:\n\t\tshowKeywords := beforeCount == 0\n\t\tif showKeywords {\n\t\t\titers = append(iters,\n\t\t\t\tkeywordToCompletionItem(\n\t\t\t\t\toptionKeywords(),\n\t\t\t\t\tprotocol.CompletionItemKindKeyword,\n\t\t\t\t\ttokenSpan,\n\t\t\t\t\toffset,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\tdefault:\n\t\treturn nil\n\t}\n\tif len(iters) == 0 {\n\t\treturn nil\n\t}\n\treturn slices.Collect(joinSequences(iters...))\n}\n\n// completionItemsForImport returns completion items for import declarations.\n//\n// Suggest all importable files.\nfunc completionItemsForImport(ctx context.Context, file *file, declImport ast.DeclImport, position protocol.Position) []protocol.CompletionItem {\n\tfile.lsp.logger.DebugContext(ctx, \"completion: import declaration\", slog.Int(\"importable_count\", len(file.workspace.PathToFile())))\n\n\toffset := positionToOffset(file, position)\n\timportPathSpan := declImport.ImportPath().Span()\n\tstart, end := importPathSpan.Start, importPathSpan.End\n\timportPathText := importPathSpan.Text()\n\n\t// Break on newlines to split an unintended capture.\n\tif index := strings.IndexByte(importPathText, '\\n'); index != -1 {\n\t\tend = start + index\n\t\timportPathText = importPathText[:index]\n\t}\n\n\tif start > offset || offset > end {\n\t\tfile.lsp.logger.Debug(\"completion: outside import expr range\",\n\t\t\tslog.String(\"import\", importPathText),\n\t\t\tslog.Int(\"start\", start),\n\t\t\tslog.Int(\"offset\", offset),\n\t\t\tslog.Int(\"end\", end),\n\t\t\tslog.Int(\"line\", int(position.Line)),\n\t\t\tslog.Int(\"character\", int(position.Character)),\n\t\t)\n\t\treturn nil\n\t}\n\n\tindex := offset - start\n\tprefix := importPathText[:index]\n\tsuffix := importPathText[index:]\n\n\t// We ought to also send along an AdditionalTextEdit for adding the `;` at the end of the\n\t// line, if it doesn't already exist.\n\tvar additionalTextEdits []protocol.TextEdit\n\tif declImport.Semicolon().IsZero() {\n\t\tadditionalTextEdits = append(additionalTextEdits, protocol.TextEdit{\n\t\t\tNewText: \";\",\n\t\t\t// End of line.\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: protocol.Position{\n\t\t\t\t\tLine:      position.Line,\n\t\t\t\t\tCharacter: math.MaxInt32 - 1,\n\t\t\t\t},\n\t\t\t\tEnd: protocol.Position{\n\t\t\t\t\tLine:      position.Line,\n\t\t\t\t\tCharacter: math.MaxUint32,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t}\n\n\tvar items []protocol.CompletionItem\n\tfor importPath, importFile := range file.workspace.PathToFile() {\n\t\tif file == importFile {\n\t\t\tcontinue // ignore self\n\t\t}\n\n\t\tsuggest := fmt.Sprintf(\"%q\", importPath)\n\t\tif !strings.HasPrefix(suggest, prefix) || !strings.HasSuffix(suggest, suffix) {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar importFileIsDeprecated bool\n\t\tif _, ok := importFile.ir.Deprecated().AsBool(); ok {\n\t\t\timportFileIsDeprecated = true\n\t\t}\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel: importPath,\n\t\t\tKind:  protocol.CompletionItemKindFile,\n\t\t\tTextEdit: &protocol.TextEdit{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: position,\n\t\t\t\t\tEnd:   position,\n\t\t\t\t},\n\t\t\t\tNewText: suggest[len(prefix) : len(suggest)-len(suffix)],\n\t\t\t},\n\t\t\tAdditionalTextEdits: additionalTextEdits,\n\t\t\tDeprecated:          importFileIsDeprecated,\n\t\t})\n\t}\n\treturn items\n}\n\n// completionItemsForOptions returns completion items for an option declaration.\nfunc completionItemsForOptions(\n\tctx context.Context,\n\tfile *file,\n\tparentDef ast.DeclDef,\n\tdef ast.DeclDef,\n\toffset int,\n) []protocol.CompletionItem {\n\tfile.lsp.logger.DebugContext(ctx, \"completion: options\", slog.Int(\"offset\", offset))\n\toptionSpan, optionSpanParts := parseOptionSpan(file, offset)\n\tif optionSpan.IsZero() {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: ignoring compact option unable to parse declaration\",\n\t\t\tslog.String(\"kind\", def.Classify().String()),\n\t\t)\n\t\treturn nil\n\t}\n\toptionsTypeName, targetKind := defKindToOptionType(parentDef.Classify())\n\tif targetKind == ir.OptionTargetInvalid {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: unknown def kind for options\",\n\t\t\tslog.String(\"kind\", parentDef.Classify().String()),\n\t\t)\n\t\treturn nil\n\t}\n\t// Find the options message type in the workspace by looking through all types.\n\tvar optionsType ir.Type\n\tfor _, importedFile := range file.workspace.PathToFile() {\n\t\tirSymbol := importedFile.ir.FindSymbol(optionsTypeName)\n\t\toptionsType = irSymbol.AsType()\n\t\tif !optionsType.IsZero() {\n\t\t\tbreak\n\t\t}\n\t}\n\tif optionsType.IsZero() {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: could not find options type in workspace\",\n\t\t\tslog.String(\"options_type_name\", string(optionsTypeName)),\n\t\t)\n\t\treturn nil\n\t}\n\t// Complete options within the value or the path.\n\tif offsetInSpan(offset, def.Value().Span()) == 0 {\n\t\tparentType := findTypeBySpan(file, parentDef.Span())\n\t\toptionType, isOptionType := getOptionValueType(file, ctx, parentType.Options(), offset)\n\t\tif !isOptionType {\n\t\t\tfile.lsp.logger.DebugContext(\n\t\t\t\tctx,\n\t\t\t\t\"completion: could not find options type within value\",\n\t\t\t)\n\t\t\treturn nil\n\t\t}\n\t\treturn slices.Collect(\n\t\t\tmessageFieldCompletionItems(file, optionType, optionSpan, offset, true),\n\t\t)\n\t}\n\treturn slices.Collect(\n\t\toptionNamesToCompletionItems(file, optionSpanParts, offset, optionsType, targetKind),\n\t)\n}\n\n// completionItemsForCompactOptions returns completion items for options within an options block.\nfunc completionItemsForCompactOptions(\n\tctx context.Context,\n\tfile *file,\n\tdef ast.DeclDef,\n\toffset int,\n) []protocol.CompletionItem {\n\tfile.lsp.logger.DebugContext(ctx, \"completion: compact options\", slog.Int(\"offset\", offset))\n\n\toptionSpan, optionSpanParts := parseOptionSpan(file, offset)\n\tif optionSpan.IsZero() {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: ignoring compact option unable to parse declaration\",\n\t\t\tslog.String(\"kind\", def.Classify().String()),\n\t\t)\n\t\treturn nil\n\t}\n\t// Find the parent containing type for the definition.\n\toptionsTypeName, targetKind := defKindToOptionType(def.Classify())\n\tif targetKind == ir.OptionTargetInvalid {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: unknown def kind for options\",\n\t\t\tslog.String(\"kind\", def.Classify().String()),\n\t\t)\n\t\treturn nil\n\t}\n\t// Search for the option message in the IR.\n\toptionMessage := defToOptionMessage(file, def)\n\tif !optionMessage.IsZero() {\n\t\t// Check the position within the option value.\n\t\tif optionValueType, isOptionValue := getOptionValueType(file, ctx, optionMessage, offset); isOptionValue {\n\t\t\tif optionValueType.IsZero() {\n\t\t\t\tfile.lsp.logger.DebugContext(ctx, \"completion: unknown option value type\")\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\t// Generate completions for fields in the options value at this position.\n\t\t\treturn slices.Collect(messageFieldCompletionItems(file, optionValueType, optionSpan, offset, true))\n\t\t}\n\t}\n\t// Find the options message type in the workspace by looking through all types.\n\tvar optionsType ir.Type\n\tfor _, importedFile := range file.workspace.PathToFile() {\n\t\tirSymbol := importedFile.ir.FindSymbol(optionsTypeName)\n\t\toptionsType = irSymbol.AsType()\n\t\tif !optionsType.IsZero() {\n\t\t\tbreak\n\t\t}\n\t}\n\tif optionsType.IsZero() {\n\t\tfile.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"completion: could not find options type in workspace\",\n\t\t\tslog.String(\"options_type_name\", string(optionsTypeName)),\n\t\t)\n\t\treturn nil\n\t}\n\treturn slices.Collect(\n\t\toptionNamesToCompletionItems(file, optionSpanParts, offset, optionsType, targetKind),\n\t)\n}\n\n// declarationSet is the set of keywords that starts a declaration.\nvar declarationSet = func() map[keyword.Keyword]struct{} {\n\tm := make(map[keyword.Keyword]struct{})\n\tfor keyword := range joinSequences(\n\t\ttopLevelKeywords(),\n\t\tmessageLevelKeywords(true),\n\t\tserviceLevelKeywords(),\n\t) {\n\t\tm[keyword] = struct{}{}\n\t}\n\treturn m\n}()\n\n// typeModifierSet is the set of keywords for type modifiers.\nvar typeModifierSet = func() map[keyword.Keyword]struct{} {\n\tm := make(map[keyword.Keyword]struct{})\n\tfor keyword := range joinSequences(\n\t\tmessageLevelFieldKeywords(),\n\t\tmethodArgLevelKeywords(),\n\t) {\n\t\tm[keyword] = struct{}{}\n\t}\n\treturn m\n}()\n\n// topLevelKeywords returns keywords for the top-level.\nfunc topLevelKeywords() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.Syntax) &&\n\t\t\tyield(keyword.Edition) &&\n\t\t\tyield(keyword.Import) &&\n\t\t\tyield(keyword.Package) &&\n\t\t\tyield(keyword.Message) &&\n\t\t\tyield(keyword.Service) &&\n\t\t\tyield(keyword.Option) &&\n\t\t\tyield(keyword.Enum) &&\n\t\t\tyield(keyword.Extend)\n\t}\n}\n\n// messageLevelKeywords returns keywords for messages.\nfunc messageLevelKeywords(isProto2 bool) iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\tok := yield(keyword.Message) &&\n\t\t\tyield(keyword.Enum) &&\n\t\t\tyield(keyword.Option) &&\n\t\t\tyield(keyword.Extend) &&\n\t\t\tyield(keyword.Oneof) &&\n\t\t\tyield(keyword.Extensions) &&\n\t\t\tyield(keyword.Reserved) &&\n\t\t\tyield(keyword.Map)\n\t\t_ = ok && isProto2 &&\n\t\t\tyield(keyword.Group)\n\t}\n}\n\n// messageLevelFieldKeywords returns keywords for type modifiers.\nfunc messageLevelFieldKeywords() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.Repeated) &&\n\t\t\tyield(keyword.Optional) &&\n\t\t\tyield(keyword.Required)\n\t}\n}\n\n// predeclaredTypeKeywords returns keywords for all predeclared types.\nfunc predeclaredTypeKeywords() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.Int32) &&\n\t\t\tyield(keyword.Int64) &&\n\t\t\tyield(keyword.Uint32) &&\n\t\t\tyield(keyword.Uint64) &&\n\t\t\tyield(keyword.Sint32) &&\n\t\t\tyield(keyword.Sint64) &&\n\t\t\tyield(keyword.Fixed32) &&\n\t\t\tyield(keyword.Fixed64) &&\n\t\t\tyield(keyword.Sfixed32) &&\n\t\t\tyield(keyword.Sfixed64) &&\n\t\t\tyield(keyword.Float) &&\n\t\t\tyield(keyword.Double) &&\n\t\t\tyield(keyword.Bool) &&\n\t\t\tyield(keyword.String) &&\n\t\t\tyield(keyword.Bytes)\n\t}\n}\n\n// mapKeyTypeKeywords returns keywords for valid map key types.\n// Map keys can only be integral types, bool, or string (not floating point or bytes).\n// See https://protobuf.com/docs/language-spec#maps\nfunc mapKeyTypeKeywords() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.Int32) &&\n\t\t\tyield(keyword.Int64) &&\n\t\t\tyield(keyword.Uint32) &&\n\t\t\tyield(keyword.Uint64) &&\n\t\t\tyield(keyword.Sint32) &&\n\t\t\tyield(keyword.Sint64) &&\n\t\t\tyield(keyword.Fixed32) &&\n\t\t\tyield(keyword.Fixed64) &&\n\t\t\tyield(keyword.Sfixed32) &&\n\t\t\tyield(keyword.Sfixed64) &&\n\t\t\tyield(keyword.Bool) &&\n\t\t\tyield(keyword.String)\n\t}\n}\n\n// serviceLevelKeywords returns keywords for services.\nfunc serviceLevelKeywords() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.RPC) &&\n\t\t\tyield(keyword.Option)\n\t}\n}\n\n// serviceReturnKeyword returns keyword for service \"return\" value.\nfunc serviceReturnKeyword() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.Returns)\n\t}\n}\n\n// methodArgLevelKeywords returns keyword for methods.\nfunc methodArgLevelKeywords() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.Stream)\n\t}\n}\n\n// optionKeywords returns the option keywords for methods and enums.\nfunc optionKeywords() iter.Seq[keyword.Keyword] {\n\treturn func(yield func(keyword.Keyword) bool) {\n\t\t_ = yield(keyword.Option)\n\t}\n}\n\n// keywordToCompletionItem converts a keyword to a completion item.\nfunc keywordToCompletionItem(\n\tkeywords iter.Seq[keyword.Keyword],\n\tkind protocol.CompletionItemKind,\n\tspan source.Span,\n\toffset int,\n) iter.Seq[protocol.CompletionItem] {\n\treturn func(yield func(protocol.CompletionItem) bool) {\n\t\teditRange := reportSpanToProtocolRange(span)\n\t\tprefix, suffix := splitSpan(span, offset)\n\t\tfor keyword := range keywords {\n\t\t\tsuggest := keyword.String()\n\t\t\tif !strings.HasPrefix(suggest, prefix) || !strings.HasSuffix(suggest, suffix) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !yield(protocol.CompletionItem{\n\t\t\t\tLabel: suggest,\n\t\t\t\tKind:  kind,\n\t\t\t\tTextEdit: &protocol.TextEdit{\n\t\t\t\t\tRange:   editRange,\n\t\t\t\t\tNewText: suggest,\n\t\t\t\t},\n\t\t\t}) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n// typeReferencesToCompletionItems returns completion items for user-defined types (messages, enums, etc).\nfunc typeReferencesToCompletionItems(\n\tcurrent *file,\n\tparentFullName ir.FullName,\n\tspan source.Span,\n\toffset int,\n\tallowEnums bool,\n) iter.Seq[protocol.CompletionItem] {\n\tfileSymbolTypesIter := func(yield func(*file, *symbol) bool) {\n\t\tfor _, imported := range current.workspace.PathToFile() {\n\t\t\tfor _, symbol := range imported.referenceableSymbols {\n\t\t\t\tif !yield(imported, symbol) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvar lastImportLine int64\n\tcurrentImportPaths := map[string]struct{}{}\n\tfor currentFileImport := range seq.Values(current.ir.Imports()) {\n\t\tlastImportLine = max(lastImportLine, int64(currentFileImport.Decl.Span().EndLoc().Line))\n\t\tcurrentImportPaths[currentFileImport.Path()] = struct{}{}\n\t}\n\tif lastImportLine == 0 {\n\t\t// If lastImportLine is 0, we have no imports in this file; put it after `package`, if\n\t\t// package exists. Otherwise, after `syntax`, if it exists. Otherwise, balk.\n\t\t// NOTE: We simply want to add the import on the next line (which may not be how `buf\n\t\t// format` would format the file); we leave the overall file formatting to `buf format`.\n\t\tswitch {\n\t\tcase !current.ir.AST().Package().IsZero():\n\t\t\tlastImportLine = int64(current.ir.AST().Package().Span().EndLoc().Line)\n\t\tcase !current.ir.AST().Syntax().IsZero():\n\t\t\tlastImportLine = int64(current.ir.AST().Syntax().Span().EndLoc().Line)\n\t\t}\n\t}\n\tif lastImportLine < 0 || lastImportLine > math.MaxUint32 {\n\t\tlastImportLine = 0 // Default to insert at top of page.\n\t}\n\timportInsertPosition := protocol.Position{\n\t\tLine:      uint32(lastImportLine),\n\t\tCharacter: 0,\n\t}\n\tparentPrefix := string(parentFullName) + \".\"\n\tpackagePrefix := string(current.ir.Package()) + \".\"\n\t// Check if we're completing an absolute type reference (starting with '.').\n\tisAbsoluteReference := strings.HasPrefix(span.Text(), \".\")\n\treturn func(yield func(protocol.CompletionItem) bool) {\n\t\teditRange := reportSpanToProtocolRange(span)\n\t\tprefix, _ := splitSpan(span, offset)\n\t\t// For relative references, filter on the trigger character '.' if present.\n\t\t// For absolute references, use the full prefix to match (e.g., \".goo\" matches \".google\").\n\t\tif !isAbsoluteReference {\n\t\t\tprefix = prefix[:strings.LastIndexByte(prefix, '.')+1]\n\t\t}\n\t\tfor _, symbol := range fileSymbolTypesIter {\n\t\t\t// We only support types in this completion instance, and not scalar values, which leaves us\n\t\t\t// with messages and enums.\n\t\t\tvar kind protocol.CompletionItemKind\n\t\t\tswitch symbol.ir.Kind() {\n\t\t\tcase ir.SymbolKindMessage:\n\t\t\t\tkind = protocol.CompletionItemKindClass // Messages are like classes\n\t\t\tcase ir.SymbolKindEnum:\n\t\t\t\tif !allowEnums {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tkind = protocol.CompletionItemKindEnum\n\t\t\tdefault:\n\t\t\t\tcontinue // Unsupported kind, skip it.\n\t\t\t}\n\t\t\tlabel := string(symbol.ir.FullName())\n\t\t\tif isAbsoluteReference {\n\t\t\t\t// For absolute references, prepend '.' to make the label fully qualified.\n\t\t\t\tlabel = \".\" + label\n\t\t\t} else {\n\t\t\t\t// For relative references, strip parent or package prefix to suggest short names.\n\t\t\t\tif len(parentFullName) > 0 && strings.HasPrefix(label, parentPrefix) {\n\t\t\t\t\tlabel = label[len(parentPrefix):]\n\t\t\t\t} else if strings.HasPrefix(label, packagePrefix) {\n\t\t\t\t\tlabel = label[len(packagePrefix):]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !strings.HasPrefix(label, prefix) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar isDeprecated bool\n\t\t\tif _, ok := symbol.ir.Deprecated().AsBool(); ok {\n\t\t\t\tisDeprecated = true\n\t\t\t}\n\t\t\tsymbolFile := symbol.ir.Context().Path()\n\t\t\t_, hasImport := currentImportPaths[symbolFile]\n\t\t\tvar additionalTextEdits []protocol.TextEdit\n\t\t\tif !hasImport && symbolFile != current.ir.Path() {\n\t\t\t\tadditionalTextEdits = append(additionalTextEdits, protocol.TextEdit{\n\t\t\t\t\tNewText: \"import \" + `\"` + symbolFile + `\";` + \"\\n\",\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: importInsertPosition,\n\t\t\t\t\t\tEnd:   importInsertPosition,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t}\n\t\t\tif !yield(protocol.CompletionItem{\n\t\t\t\tLabel: label,\n\t\t\t\tKind:  kind,\n\t\t\t\tTextEdit: &protocol.TextEdit{\n\t\t\t\t\tRange:   editRange,\n\t\t\t\t\tNewText: label,\n\t\t\t\t},\n\t\t\t\tDeprecated:          isDeprecated,\n\t\t\t\tDocumentation:       symbol.FormatDocs(),\n\t\t\t\tAdditionalTextEdits: additionalTextEdits,\n\t\t\t}) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n// optionToCompletionItems returns completion items for options.\nfunc optionToCompletionItems(\n\tcurrent *file,\n\tspan source.Span,\n\toffset int,\n\toptionsType ir.Type,\n\ttargetKind ir.OptionTarget,\n) iter.Seq[protocol.CompletionItem] {\n\tprefix, _ := splitSpan(span, offset)\n\treturn func(yield func(protocol.CompletionItem) bool) {\n\t\t// Add standard option fields (non-extensions) from the options type\n\t\t// Filter by option targets to only show options that can be applied to this symbol kind\n\t\tfor member := range seq.Values(optionsType.Members()) {\n\t\t\tif member.IsExtension() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Check if this option can target this symbol kind\n\t\t\tif !member.CanTarget(targetKind) {\n\t\t\t\tcurrent.lsp.logger.Debug(\n\t\t\t\t\t\"completion: skipping option due to target mismatch\",\n\t\t\t\t\tslog.String(\"option\", member.Name()),\n\t\t\t\t\tslog.String(\"target_kind\", targetKind.String()),\n\t\t\t\t)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlabel := member.Name()\n\t\t\tif !strings.HasPrefix(label, prefix) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar isDeprecated bool\n\t\t\tif _, ok := member.Deprecated().AsBool(); ok {\n\t\t\t\tisDeprecated = true\n\t\t\t}\n\t\t\tvar detail string\n\t\t\tfieldType := member.Element()\n\t\t\tif !fieldType.IsZero() {\n\t\t\t\tif fieldType.IsPredeclared() {\n\t\t\t\t\tdetail = fieldType.Name()\n\t\t\t\t} else {\n\t\t\t\t\tdetail = string(fieldType.FullName())\n\t\t\t\t}\n\t\t\t}\n\t\t\titem := protocol.CompletionItem{\n\t\t\t\tLabel: label,\n\t\t\t\tKind:  protocol.CompletionItemKindField,\n\t\t\t\tTextEdit: &protocol.TextEdit{\n\t\t\t\t\tRange:   reportSpanToProtocolRange(span),\n\t\t\t\t\tNewText: label,\n\t\t\t\t},\n\t\t\t\tDeprecated:    isDeprecated,\n\t\t\t\tDocumentation: irMemberDoc(member),\n\t\t\t\tDetail:        detail,\n\t\t\t}\n\t\t\tif !yield(item) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}\n\n// extensionToCompletionItems returns completion items for options from extensions.\nfunc extensionToCompletionItems(\n\tcurrent *file,\n\tspan source.Span,\n\toffset int,\n\toptionsType ir.Type,\n\ttargetKind ir.OptionTarget,\n) iter.Seq[protocol.CompletionItem] {\n\tprefix, _ := splitSpan(span, offset)\n\treturn func(yield func(protocol.CompletionItem) bool) {\n\t\t// Find all extensions in the workspace that extend the options type.\n\t\tfor _, importedFile := range current.workspace.PathToFile() {\n\t\t\tfor extension := range seq.Values(importedFile.ir.AllExtensions()) {\n\t\t\t\tif !extension.IsExtension() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Ensure the extension extends the type we are looking for.\n\t\t\t\tcontainer := extension.Container()\n\t\t\t\tif container.IsZero() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif container.FullName() != optionsType.FullName() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Check if this extension can target this symbol kind\n\t\t\t\tif !extension.CanTarget(targetKind) {\n\t\t\t\t\tcurrent.lsp.logger.Debug(\n\t\t\t\t\t\t\"completion: skipping extension due to target mismatch\",\n\t\t\t\t\t\tslog.String(\"extension\", string(extension.FullName())),\n\t\t\t\t\t\tslog.String(\"target_kind\", targetKind.String()),\n\t\t\t\t\t)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Extensions are referenced with parentheses, e.g., (my.extension)\n\t\t\t\tlabel := \"(\" + string(extension.FullName()) + \")\"\n\t\t\t\tif !strings.HasPrefix(label, prefix) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tvar isDeprecated bool\n\t\t\t\tif _, ok := extension.Deprecated().AsBool(); ok {\n\t\t\t\t\tisDeprecated = true\n\t\t\t\t}\n\t\t\t\tvar detail string\n\t\t\t\tfieldType := extension.Element()\n\t\t\t\tif !fieldType.IsZero() {\n\t\t\t\t\tif fieldType.IsPredeclared() {\n\t\t\t\t\t\tdetail = fieldType.Name()\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdetail = string(fieldType.FullName())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\titem := protocol.CompletionItem{\n\t\t\t\t\tLabel: label,\n\t\t\t\t\tKind:  protocol.CompletionItemKindProperty,\n\t\t\t\t\tTextEdit: &protocol.TextEdit{\n\t\t\t\t\t\tRange:   reportSpanToProtocolRange(span),\n\t\t\t\t\t\tNewText: label,\n\t\t\t\t\t},\n\t\t\t\t\tDeprecated:    isDeprecated,\n\t\t\t\t\tDocumentation: irMemberDoc(extension),\n\t\t\t\t\tDetail:        detail,\n\t\t\t\t}\n\t\t\t\tif !yield(item) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// optionNamesToCompletionItems completes nested option field paths like: option field.nested.sub = value\n// It walks through the path segments to find the current message type and suggests valid fields.\nfunc optionNamesToCompletionItems(\n\tcurrent *file,\n\tpathSpans []source.Span,\n\toffset int,\n\toptionType ir.Type,\n\ttargetKind ir.OptionTarget,\n) iter.Seq[protocol.CompletionItem] {\n\tif len(pathSpans) == 0 {\n\t\treturn func(yield func(protocol.CompletionItem) bool) {}\n\t}\n\n\trootSpan := pathSpans[0]\n\trootText := rootSpan.Text()\n\tisExtension := strings.HasPrefix(rootText, \"(\") && strings.HasSuffix(rootText, \")\")\n\trootFieldName := rootText\n\tif isExtension {\n\t\t// Remove parentheses: \"(foo.bar.Extension)\" -> \"foo.bar.Extension\"\n\t\trootFieldName = rootText[1 : len(rootText)-1]\n\t}\n\tif len(pathSpans) == 1 {\n\t\tif isExtension {\n\t\t\treturn extensionToCompletionItems(current, rootSpan, offset, optionType, targetKind)\n\t\t}\n\t\treturn optionToCompletionItems(current, rootSpan, offset, optionType, targetKind)\n\t}\n\ttokenSpan := pathSpans[len(pathSpans)-1]\n\tpathSpans = pathSpans[1 : len(pathSpans)-1]\n\n\tvar currentField ir.Member\n\tif isExtension {\n\t\t// Search for extension across all files in workspace\n\t\tfor _, importedFile := range current.workspace.PathToFile() {\n\t\t\tfor extension := range seq.Values(importedFile.ir.AllExtensions()) {\n\t\t\t\tif !extension.IsExtension() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tcontainer := extension.Container()\n\t\t\t\tif container.IsZero() || container.FullName() != optionType.FullName() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif string(extension.FullName()) == rootFieldName && extension.CanTarget(targetKind) {\n\t\t\t\t\tcurrentField = extension\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !currentField.IsZero() {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Search for regular field in optionsType members.\n\t\tfor member := range seq.Values(optionType.Members()) {\n\t\t\tif member.IsExtension() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif member.Name() == rootFieldName && member.CanTarget(targetKind) {\n\t\t\t\tcurrentField = member\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif currentField.IsZero() {\n\t\tcurrent.lsp.logger.Debug(\n\t\t\t\"completion: could not find root field\",\n\t\t\tslog.String(\"root\", rootFieldName),\n\t\t)\n\t}\n\t// Walk through each path segment to navigate nested messages.\n\tcurrentType := currentField.Element()\n\tfor i, pathSegment := range pathSpans {\n\t\tsegmentName := pathSegment.Text()\n\t\tcurrent.lsp.logger.Debug(\n\t\t\t\"completion: walking path segment\",\n\t\t\tslog.Int(\"index\", i),\n\t\t\tslog.String(\"segment\", segmentName),\n\t\t\tslog.String(\"current_type\", string(currentType.FullName())),\n\t\t)\n\t\t// The current field should be a message type to have nested fields\n\t\tif !currentType.IsMessage() || currentType.IsZero() {\n\t\t\tcurrent.lsp.logger.Debug(\n\t\t\t\t\"completion: current type is not a message, cannot continue path\",\n\t\t\t\tslog.String(\"segment\", segmentName),\n\t\t\t)\n\t\t\tbreak\n\t\t}\n\t\t// Find the field with this name in the current message\n\t\tvar found bool\n\t\tfor member := range seq.Values(currentType.Members()) {\n\t\t\tif member.Name() == segmentName {\n\t\t\t\tcurrentField = member\n\t\t\t\tcurrentType = member.Element()\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\tcurrent.lsp.logger.Debug(\n\t\t\t\t\"completion: could not find field in path\",\n\t\t\t\tslog.String(\"segment\", segmentName),\n\t\t\t\tslog.String(\"type\", string(currentType.FullName())),\n\t\t\t)\n\t\t\tcurrentType = ir.Type{}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn messageFieldCompletionItems(current, currentType, tokenSpan, offset, false)\n}\n\n// messageFieldCompletionItems generates completion items for fields in a message type.\n// This is used for both option field paths and option value field completion.\nfunc messageFieldCompletionItems(\n\tcurrent *file,\n\tmessageType ir.Type,\n\ttokenSpan source.Span,\n\toffset int,\n\tisValueType bool,\n) iter.Seq[protocol.CompletionItem] {\n\treturn func(yield func(protocol.CompletionItem) bool) {\n\t\tif messageType.IsZero() || !messageType.IsMessage() {\n\t\t\tcurrent.lsp.logger.Debug(\n\t\t\t\t\"completion: final type is not a message, no completions\",\n\t\t\t\tslog.String(\"type\", string(messageType.FullName())),\n\t\t\t)\n\t\t\treturn\n\t\t}\n\n\t\tprefix, _ := splitSpan(tokenSpan, offset)\n\t\teditRange := reportSpanToProtocolRange(tokenSpan)\n\n\t\tcurrent.lsp.logger.Debug(\n\t\t\t\"completion: generating message field completions\",\n\t\t\tslog.String(\"type\", string(messageType.FullName())),\n\t\t\tslog.String(\"prefix\", prefix),\n\t\t)\n\n\t\t// Generate completion items for all fields in the message\n\t\tfor member := range seq.Values(messageType.Members()) {\n\t\t\tlabel := member.Name()\n\t\t\tif !strings.HasPrefix(label, prefix) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif member.IsExtension() {\n\t\t\t\tlabel = \"(\" + label + \")\"\n\t\t\t}\n\t\t\tnewText := label\n\t\t\tif isValueType {\n\t\t\t\tnewText += \":\"\n\t\t\t}\n\t\t\tvar isDeprecated bool\n\t\t\tif _, ok := member.Deprecated().AsBool(); ok {\n\t\t\t\tisDeprecated = true\n\t\t\t}\n\t\t\t// Add detail string based on field type for better context\n\t\t\tvar detail string\n\t\t\tfieldType := member.Element()\n\t\t\tif !fieldType.IsZero() {\n\t\t\t\tif fieldType.IsPredeclared() {\n\t\t\t\t\tdetail = fieldType.Name()\n\t\t\t\t} else {\n\t\t\t\t\tdetail = string(fieldType.FullName())\n\t\t\t\t}\n\t\t\t}\n\t\t\titem := protocol.CompletionItem{\n\t\t\t\tLabel: label,\n\t\t\t\tKind:  protocol.CompletionItemKindField,\n\t\t\t\tTextEdit: &protocol.TextEdit{\n\t\t\t\t\tRange:   editRange,\n\t\t\t\t\tNewText: newText,\n\t\t\t\t},\n\t\t\t\tDeprecated:    isDeprecated,\n\t\t\t\tDocumentation: irMemberDoc(member),\n\t\t\t\tDetail:        detail,\n\t\t\t}\n\t\t\tif !yield(item) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\n// joinSequences returns a sequence of sequences.\nfunc joinSequences[T any](itemIters ...iter.Seq[T]) iter.Seq[T] {\n\treturn func(yield func(T) bool) {\n\t\tfor _, items := range itemIters {\n\t\t\tfor item := range items {\n\t\t\t\tif !yield(item) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// getDeclForOffset finds the path of AST declarations from parent to smallest that contains the given offset.\n// Returns a slice where [0] is the top-level declaration and [len-1] is the smallest/innermost declaration.\n// Returns nil if no declaration contains the offset.\nfunc getDeclForOffset(body ast.DeclBody, offset int) []ast.DeclAny {\n\treturn getDeclForOffsetHelper(body, offset, nil)\n}\n\n// getDeclForOffsetHelper is the recursive helper for getDeclForOffset.\nfunc getDeclForOffsetHelper(body ast.DeclBody, offset int, path []ast.DeclAny) []ast.DeclAny {\n\tsmallestSize := -1\n\tvar bestPath []ast.DeclAny\n\n\tfor decl := range seq.Values(body.Decls()) {\n\t\tif decl.IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\tspan := decl.Span()\n\t\tif span.IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\t// Check if the position is within this declaration's span.\n\t\tif offsetInSpan(offset, span) == 0 {\n\t\t\t// Build the new path including this declaration.\n\t\t\tnewPath := append(append([]ast.DeclAny(nil), path...), decl)\n\t\t\tsize := span.End - span.Start\n\t\t\tif smallestSize == -1 || size < smallestSize {\n\t\t\t\tbestPath = newPath\n\t\t\t\tsmallestSize = size\n\t\t\t}\n\n\t\t\t// If this is a definition with a body, search recursively.\n\t\t\tif decl.Kind() == ast.DeclKindDef && !decl.AsDef().Body().IsZero() {\n\t\t\t\tchildPath := getDeclForOffsetHelper(decl.AsDef().Body(), offset, newPath)\n\t\t\t\tif len(childPath) > 0 {\n\t\t\t\t\tchildSize := childPath[len(childPath)-1].Span().End - childPath[len(childPath)-1].Span().Start\n\t\t\t\t\tif childSize < smallestSize {\n\t\t\t\t\t\tbestPath = childPath\n\t\t\t\t\t\tsmallestSize = childSize\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn bestPath\n}\n\n// parseOptionSpan returns the span associated with the option declaration and\n// the fields up until the offset. This handles invalid declarations from\n// partial syntax.\nfunc parseOptionSpan(file *file, offset int) (source.Span, []source.Span) {\n\thasStart, hasGap := false, false\n\tvar tokens []token.Token\n\ttypeSpan := extractAroundOffset(\n\t\tfile, offset,\n\t\tfunc(tok token.Token) bool {\n\t\t\tswitch {\n\t\t\tcase isTokenTypeDelimiter(tok):\n\t\t\t\thasStart = true\n\t\t\t\treturn false\n\t\t\tcase isTokenSpace(tok):\n\t\t\t\thasGap = true\n\t\t\t\treturn true\n\t\t\tdefault:\n\t\t\t\t// A gap is only allowed if the preceding token is the \"option\" token.\n\t\t\t\t// This is the start of an option declaration.\n\t\t\t\tif hasGap {\n\t\t\t\t\thasStart = tok.Keyword() == keyword.Option\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ttokens = append(tokens, tok)\n\t\t\t\treturn isTokenType(tok) || isTokenParen(tok)\n\t\t\t}\n\t\t},\n\t\tisTokenType,\n\t)\n\tif !hasStart {\n\t\treturn source.Span{}, nil\n\t}\n\t// If no tokens were found, return an empty span at the offset.\n\tif len(tokens) == 0 {\n\t\temptySpan := source.Span{File: file.file, Start: offset, End: offset}\n\t\treturn emptySpan, []source.Span{emptySpan}\n\t}\n\tslices.Reverse(tokens)\n\tif typeSpan.Start > 0 && file.file.Text()[typeSpan.Start-1] == '(' {\n\t\t// Within parens, caputure the type as the full path. One root span.\n\t\t// The offset is within the child span. We expand the span to capture the\n\t\t// extension.\n\t\ttypeSpan.Start -= 1\n\t\tif strings.HasPrefix(file.file.Text()[typeSpan.End:], \")\") {\n\t\t\ttypeSpan.End += 1\n\t\t}\n\t\treturn typeSpan, []source.Span{typeSpan}\n\t}\n\tpathSpans := []source.Span{tokens[0].Span()}\n\tfor i := 1; i < len(tokens)-1; i += 2 {\n\t\tdotToken := tokens[i]\n\t\tidentToken := tokens[i+1]\n\t\tif dotToken.Text() != \".\" || identToken.Kind() != token.Ident {\n\t\t\treturn source.Span{}, nil\n\t\t}\n\t\tpathSpans = append(pathSpans, identToken.Span())\n\t}\n\t// Append an empty span on trailing \".\" token at it's position.\n\tif (len(tokens)-1)%2 != 0 {\n\t\tlastToken := tokens[len(tokens)-1]\n\t\tif lastToken.Kind() == token.Keyword && lastToken.Text() == \".\" {\n\t\t\tlastSpan := lastToken.Span()\n\t\t\tlastSpan.Start = lastSpan.End\n\t\t\tpathSpans = append(pathSpans, lastSpan)\n\t\t}\n\t}\n\treturn typeSpan, pathSpans\n}\n\n// defKindToOptionType returns the option type associated with the decl.\nfunc defKindToOptionType(kind ast.DefKind) (ir.FullName, ir.OptionTarget) {\n\tswitch kind {\n\tcase ast.DefKindInvalid:\n\t\treturn \"google.protobuf.FileOptions\", ir.OptionTargetFile\n\tcase ast.DefKindMessage:\n\t\treturn \"google.protobuf.MessageOptions\", ir.OptionTargetMessage\n\tcase ast.DefKindEnum:\n\t\treturn \"google.protobuf.EnumOptions\", ir.OptionTargetEnum\n\tcase ast.DefKindField:\n\t\treturn \"google.protobuf.FieldOptions\", ir.OptionTargetField\n\tcase ast.DefKindEnumValue:\n\t\treturn \"google.protobuf.EnumValueOptions\", ir.OptionTargetEnumValue\n\tcase ast.DefKindService:\n\t\treturn \"google.protobuf.ServiceOptions\", ir.OptionTargetService\n\tcase ast.DefKindMethod:\n\t\treturn \"google.protobuf.MethodOptions\", ir.OptionTargetMethod\n\tcase ast.DefKindOneof:\n\t\treturn \"google.protobuf.OneofOptions\", ir.OptionTargetOneof\n\tdefault:\n\t\treturn \"\", ir.OptionTargetInvalid\n\t}\n}\n\n// defToOptionMessage returns the option message associated with the decl.\nfunc defToOptionMessage(file *file, def ast.DeclDef) ir.MessageValue {\n\tdefSpan := def.Span()\n\tswitch kind := def.Classify(); kind {\n\tcase ast.DefKindMessage:\n\t\tirType := findTypeBySpan(file, defSpan)\n\t\tif !irType.IsZero() {\n\t\t\treturn irType.Options()\n\t\t}\n\tcase ast.DefKindEnum:\n\t\tirType := findTypeBySpan(file, defSpan)\n\t\tif !irType.IsZero() {\n\t\t\treturn irType.Options()\n\t\t}\n\tcase ast.DefKindField:\n\t\tfor irType := range seq.Values(file.ir.AllTypes()) {\n\t\t\tfor member := range seq.Values(irType.Members()) {\n\t\t\t\tif member.AST().Span() == defSpan {\n\t\t\t\t\treturn member.Options()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor extension := range seq.Values(file.ir.AllExtensions()) {\n\t\t\tif extension.AST().Span() == defSpan {\n\t\t\t\treturn extension.Options()\n\t\t\t}\n\t\t}\n\tcase ast.DefKindEnumValue:\n\t\tfor irType := range seq.Values(file.ir.AllTypes()) {\n\t\t\tfor member := range seq.Values(irType.Members()) {\n\t\t\t\tif member.AST().Span() == defSpan {\n\t\t\t\t\treturn member.Options()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase ast.DefKindService:\n\t\tfor service := range seq.Values(file.ir.Services()) {\n\t\t\tif service.AST().Span() == defSpan {\n\t\t\t\treturn service.Options()\n\t\t\t}\n\t\t}\n\tcase ast.DefKindMethod:\n\t\tfor service := range seq.Values(file.ir.Services()) {\n\t\t\tfor method := range seq.Values(service.Methods()) {\n\t\t\t\tif method.AST().Span() == defSpan {\n\t\t\t\t\treturn method.Options()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tcase ast.DefKindOneof:\n\t\tfor irType := range seq.Values(file.ir.AllTypes()) {\n\t\t\tfor oneof := range seq.Values(irType.Oneofs()) {\n\t\t\t\tif oneof.AST().Span() == defSpan {\n\t\t\t\t\treturn oneof.Options()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ir.MessageValue{}\n}\n\n// isAfterEqualsSign checks if the cursor offset is positioned after an equals sign,\n// which would indicate we're completing a field number.\nfunc isAfterEqualsSign(file *file, offset int) bool {\n\tif file.ir.AST() == nil || file.ir.AST().Stream() == nil {\n\t\treturn false\n\t}\n\n\tbefore, _ := file.ir.AST().Stream().Around(offset)\n\tcursor := token.NewCursorAt(before)\n\n\tif isTokenSpace(before) {\n\t\tbefore = cursor.PrevSkippable()\n\t}\n\treturn isTokenEqual(before)\n}\n\n// isTokenType returns true if the tokens are valid for a type declaration e.g \"buf.registry.Type\".\nfunc isTokenType(tok token.Token) bool {\n\tkind := tok.Kind()\n\treturn kind == token.Ident || (kind == token.Keyword && tok.Text() == \".\")\n}\n\n// isTokenSpace returns true for spaces, excluding newlines.\nfunc isTokenSpace(tok token.Token) bool {\n\treturn tok.Kind() == token.Space && strings.IndexByte(tok.Text(), '\\n') == -1\n}\n\n// isTokenNewline returns true if tok is a newline.\nfunc isTokenNewline(tok token.Token) bool {\n\treturn tok.Kind() == token.Space && strings.Count(tok.Text(), \"\\n\") == 1\n}\n\n// isTokenParen returns true for '(' or ')' tokens.\nfunc isTokenParen(tok token.Token) bool {\n\treturn tok.Kind() == token.Keyword &&\n\t\t(strings.HasPrefix(tok.Text(), \"(\") ||\n\t\t\tstrings.HasSuffix(tok.Text(), \")\"))\n}\n\n// isTokenEqual returns true for '=' tokens.\nfunc isTokenEqual(tok token.Token) bool {\n\treturn tok.Kind() == token.Keyword && tok.Keyword() == keyword.Assign\n}\n\n// isTokenTypeDelimiter returns true if the token represents a delimiter for completion.\n// A delimiter is a newline or start of stream. This handles invalid partial declarations.\nfunc isTokenTypeDelimiter(tok token.Token) bool {\n\tkind := tok.Kind()\n\treturn (kind == token.Unrecognized && tok.IsZero()) ||\n\t\t(kind == token.Space && strings.IndexByte(tok.Text(), '\\n') != -1) ||\n\t\t(kind == token.Comment && strings.HasSuffix(tok.Text(), \"\\n\"))\n}\n\n// isInsideMapType checks if the cursor is inside map type parameters (e.g., map<int32, |>).\n// Returns (insideMap, isKeyPosition) where isKeyPosition is true if before the comma.\nfunc isInsideMapType(file *file, def ast.DeclDef, offset int) (bool, bool) {\n\t// Try AST-based detection first for valid field declarations\n\tif def.Classify() == ast.DefKindField {\n\t\tfield := def.AsField()\n\t\tgenericType := field.Type.RemovePrefixes().AsGeneric()\n\t\tif !genericType.IsZero() {\n\t\t\tkeyType, valueType := genericType.AsMap()\n\t\t\t// Only use AST-based detection when both key and value types are valid\n\t\t\t// For incomplete syntax (missing key or value), fall through to character scanning\n\t\t\tif !keyType.IsZero() && !valueType.IsZero() {\n\t\t\t\tspan := genericType.Span()\n\t\t\t\tif offset > span.Start && offset <= span.End {\n\t\t\t\t\tkeySpan := keyType.Span()\n\t\t\t\t\tvalueSpan := valueType.Span()\n\n\t\t\t\t\t// Determine position based on key/value spans\n\t\t\t\t\tif offset <= keySpan.End {\n\t\t\t\t\t\treturn true, true // In key type\n\t\t\t\t\t}\n\t\t\t\t\tif offset >= valueSpan.Start {\n\t\t\t\t\t\treturn true, false // In value type\n\t\t\t\t\t}\n\t\t\t\t\t// Between key and value (after comma, before value start)\n\t\t\t\t\treturn true, false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fall back to character scanning for incomplete/invalid field declarations\n\tsourceText := file.file.Text()\n\tif offset <= 0 || offset > len(sourceText) {\n\t\treturn false, false\n\t}\n\n\tangleDepth := 0\n\tcommaFound := false\n\n\tfor i := offset - 1; i >= 0; i-- {\n\t\tch := sourceText[i]\n\t\tswitch ch {\n\t\tcase '>':\n\t\t\tangleDepth++\n\t\tcase '<':\n\t\t\tif angleDepth == 0 {\n\t\t\t\treturn true, !commaFound\n\t\t\t}\n\t\t\tangleDepth--\n\t\tcase ',':\n\t\t\tif angleDepth == 0 {\n\t\t\t\tcommaFound = true\n\t\t\t}\n\t\tcase '\\n', ';':\n\t\t\treturn false, false\n\t\t}\n\t}\n\n\treturn false, false\n}\n\n// extractAroundOffset extracts the value around the offset by querying the token stream.\nfunc extractAroundOffset(file *file, offset int, isTokenBefore, isTokenAfter func(token.Token) bool) source.Span {\n\tif file.ir.AST() == nil {\n\t\treturn source.Span{}\n\t}\n\tstream := file.ir.AST().Stream()\n\tif stream == nil {\n\t\treturn source.Span{}\n\t}\n\tbefore, after := stream.Around(offset)\n\tif before.IsZero() && after.IsZero() {\n\t\treturn source.Span{}\n\t}\n\n\tspan := source.Span{\n\t\tFile:  file.file,\n\t\tStart: offset,\n\t\tEnd:   offset,\n\t}\n\tif !before.IsZero() && isTokenBefore != nil {\n\t\tvar firstToken token.Token\n\t\tfor cursor := token.NewCursorAt(before); isTokenBefore(before); before = cursor.PrevSkippable() {\n\t\t\tfirstToken = before\n\t\t\tspan.Start = firstToken.Span().Start\n\t\t}\n\t}\n\tif !after.IsZero() && isTokenAfter != nil {\n\t\tvar lastToken token.Token\n\t\tfor cursor := token.NewCursorAt(after); isTokenAfter(after); after = cursor.NextSkippable() {\n\t\t\tlastToken = after\n\t\t}\n\t\tif !lastToken.IsZero() {\n\t\t\tspan.End = lastToken.Span().End\n\t\t}\n\t}\n\treturn span\n}\n\nfunc splitSpan(span source.Span, offset int) (prefix string, suffix string) {\n\tif offsetInSpan(offset, span) != 0 {\n\t\treturn \"\", \"\"\n\t}\n\tindex := offset - span.Start\n\ttext := span.Text()\n\treturn text[:index], text[index:]\n}\n\nfunc offsetInSpan(offset int, span source.Span) int {\n\tif offset < span.Start {\n\t\treturn -1\n\t} else if offset > span.End {\n\t\t// End is inclusive for completions\n\t\treturn 1\n\t}\n\treturn 0\n}\n\n// positionToOffset returns the offset from the protocol position.\nfunc positionToOffset(file *file, position protocol.Position) int {\n\tpositionLocation := file.file.InverseLocation(int(position.Line)+1, int(position.Character)+1, positionalEncoding)\n\treturn positionLocation.Offset\n}\n\n// isProto2 returns true if the file has a syntax declaration of proto2.\nfunc isProto2(file *file) bool {\n\treturn file.ir.Syntax() == syntax.Proto2\n}\n\n// findTypeBySpan returns the IR Type that corresponds to the given AST span.\n// Returns a zero Type if no matching type is found.\nfunc findTypeBySpan(file *file, span source.Span) ir.Type {\n\tif span.IsZero() {\n\t\treturn ir.Type{}\n\t}\n\tfor t := range seq.Values(file.ir.AllTypes()) {\n\t\tif t.AST().Span() == span {\n\t\t\treturn t\n\t\t}\n\t}\n\treturn ir.Type{}\n}\n\n// findTypeFullName simply loops through and finds the type definition name.\nfunc findTypeFullName(file *file, declDef ast.DeclDef) ir.FullName {\n\tdeclDefSpan := declDef.Span()\n\tif declDefSpan.IsZero() {\n\t\treturn \"\"\n\t}\n\tirType := findTypeBySpan(file, declDefSpan)\n\tif !irType.IsZero() {\n\t\tfile.lsp.logger.Debug(\"completion: found parent type\", slog.String(\"parent\", string(irType.FullName())))\n\t\treturn irType.FullName()\n\t}\n\treturn \"\"\n}\n\n// getOptionValueType finds the completion position within nested option message values.\n// It returns the message type containing the current offset if found.\nfunc getOptionValueType(file *file, ctx context.Context, optionValue ir.MessageValue, offset int) (\n\toptionType ir.Type,\n\tisOptionValue bool,\n) {\n\tfor field := range optionValue.Fields() {\n\t\tkeySpan := field.KeyAST().Span()\n\t\tvalueSpan := field.ValueAST().Span()\n\t\tfor element := range seq.Values(field.Elements()) {\n\t\t\tif msg := element.AsMessage(); !msg.IsZero() {\n\t\t\t\tif optionType, isOptionValue := getOptionValueType(file, ctx, msg, offset); isOptionValue {\n\t\t\t\t\treturn optionType, isOptionValue\n\t\t\t\t}\n\t\t\t\t// Option value must be different to the key, otherwise in type declaration.\n\t\t\t\tisOptionValue = isOptionValue ||\n\t\t\t\t\t(offsetInSpan(offset, element.AST().Span()) == 0 && keySpan != valueSpan)\n\t\t\t\tif isOptionValue {\n\t\t\t\t\treturn msg.Type(), isOptionValue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ir.Type{}, false\n}\n\nfunc completionItemsForFieldNumber(\n\tfile *file,\n\tparentDef ast.DeclDef,\n) []protocol.CompletionItem {\n\t// Find the IR Type corresponding to this AST definition\n\tirType := findTypeBySpan(file, parentDef.Span())\n\n\tvar ranges []numberRange[uint64]\n\n\t// Add protobuf reserved range\n\tranges = append(ranges, numberRange[uint64]{\n\t\tstart: uint64(protowire.FirstReservedNumber),\n\t\tend:   uint64(protowire.LastReservedNumber),\n\t})\n\n\tif !irType.IsZero() {\n\t\t// Add each member as a range of one\n\t\tfor member := range seq.Values(irType.Members()) {\n\t\t\tnum := uint64(member.Number())\n\t\t\tif num > 0 {\n\t\t\t\tranges = append(ranges, numberRange[uint64]{start: num, end: num})\n\t\t\t}\n\t\t}\n\n\t\t// Add reserved ranges\n\t\tfor reservedRange := range seq.Values(irType.ReservedRanges()) {\n\t\t\tstart, end := reservedRange.Range()\n\t\t\tif end == math.MaxInt32 {\n\t\t\t\t// Can't allocate beyond open-ended range\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif start > 0 {\n\t\t\t\tranges = append(ranges, numberRange[uint64]{\n\t\t\t\t\tstart: uint64(start),\n\t\t\t\t\tend:   uint64(end),\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\n\t// Sort by start position\n\tslices.SortFunc(ranges, func(a, b numberRange[uint64]) int {\n\t\tif a.start < b.start {\n\t\t\treturn -1\n\t\t} else if a.start > b.start {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t})\n\n\t// Find first gap starting from 1\n\tnextNumber := uint64(1)\n\tfor _, r := range ranges {\n\t\tif nextNumber < r.start {\n\t\t\t// Found a gap before this range\n\t\t\treturn []protocol.CompletionItem{\n\t\t\t\t{\n\t\t\t\t\tLabel: strconv.FormatUint(nextNumber, 10),\n\t\t\t\t\tKind:  protocol.CompletionItemKindValue,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t\t// Move past this range\n\t\tif r.end >= nextNumber {\n\t\t\tnextNumber = r.end + 1\n\t\t}\n\t}\n\n\t// Check if we're still within valid range\n\tif nextNumber <= uint64(protowire.MaxValidNumber) {\n\t\treturn []protocol.CompletionItem{\n\t\t\t{\n\t\t\t\tLabel: strconv.FormatUint(nextNumber, 10),\n\t\t\t\tKind:  protocol.CompletionItemKindValue,\n\t\t\t},\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// completionItemsForEnumNumber suggests the next available, non-reserved enum number in the enum\n// for completion.\n//\n// Enum values are _any_ int32 value, but we make the assumption here that the user is using the\n// \"typical\" incrementing from 0 approach and suggest the next available positive int32 value.\n//\n// Ref: https://protobuf.com/docs/language-spec#enum-values\nfunc completionItemsForEnumNumber(\n\tfile *file,\n\tparentDef ast.DeclDef,\n\tcurrentEnumValue ast.DefEnumValue,\n) []protocol.CompletionItem {\n\t// Find the IR Type corresponding to this AST definition\n\tirType := findTypeBySpan(file, parentDef.Span())\n\n\tif irType.IsZero() {\n\t\treturn []protocol.CompletionItem{\n\t\t\t{\n\t\t\t\tLabel: \"0\",\n\t\t\t\tKind:  protocol.CompletionItemKindValue,\n\t\t\t},\n\t\t}\n\t}\n\n\t// Get the span of the current enum value we're completing, if any\n\tvar currentEnumValueNameSpan source.Span\n\tif !currentEnumValue.Name.IsZero() {\n\t\tcurrentEnumValueNameSpan = currentEnumValue.Name.Span()\n\t}\n\n\tvar ranges []numberRange[int32]\n\n\t// Add each member as a range of one\n\t// Exclude the current enum value being completed, as it may have a default value in the IR\n\tfor member := range seq.Values(irType.Members()) {\n\t\t// Skip the member if it's the one we're currently completing\n\t\t// Compare the AST definition spans to identify the same enum value\n\t\tif !currentEnumValueNameSpan.IsZero() {\n\t\t\tmemberAST := member.AST()\n\t\t\tif memberAST.Classify() == ast.DefKindEnumValue {\n\t\t\t\tmemberEnumValue := memberAST.AsEnumValue()\n\t\t\t\tif !memberEnumValue.Name.IsZero() && memberEnumValue.Name.Span() == currentEnumValueNameSpan {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnum := member.Number()\n\t\tranges = append(ranges, numberRange[int32]{start: num, end: num})\n\t}\n\n\t// Add reserved ranges\n\tfor reservedRange := range seq.Values(irType.ReservedRanges()) {\n\t\tstart, end := reservedRange.Range()\n\t\tif end == math.MaxInt32 {\n\t\t\t// Can't allocate beyond open-ended range\n\t\t\treturn nil\n\t\t}\n\t\tranges = append(ranges, numberRange[int32]{\n\t\t\tstart: start,\n\t\t\tend:   end,\n\t\t})\n\t}\n\n\t// Sort by start position\n\tslices.SortFunc(ranges, func(a, b numberRange[int32]) int {\n\t\tif a.start < b.start {\n\t\t\treturn -1\n\t\t} else if a.start > b.start {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t})\n\n\t// Find first gap starting from 0\n\t// Enum values typically start at 0 and increment, but can be any int32 value\n\tvar nextNumber int32\n\tfor _, r := range ranges {\n\t\tif nextNumber < r.start {\n\t\t\t// Found a gap before this range\n\t\t\treturn []protocol.CompletionItem{\n\t\t\t\t{\n\t\t\t\t\tLabel: strconv.FormatInt(int64(nextNumber), 10),\n\t\t\t\t\tKind:  protocol.CompletionItemKindValue,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t\t// Move past this range\n\t\tif r.end >= nextNumber {\n\t\t\tif r.end == math.MaxInt32 {\n\t\t\t\t// Can't find next value after MaxInt32\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tnextNumber = r.end + 1\n\t\t}\n\t}\n\n\t// If we've checked all ranges and still have a valid number, return it\n\treturn []protocol.CompletionItem{\n\t\t{\n\t\t\tLabel: strconv.FormatInt(int64(nextNumber), 10),\n\t\t\tKind:  protocol.CompletionItemKindValue,\n\t\t},\n\t}\n}\n\n// resolveCompletionItem resolves additional details for a completion item.\n//\n// This function is called by the CompletionResolve handler in server.go.\nfunc resolveCompletionItem(\n\t_ context.Context,\n\titem *protocol.CompletionItem,\n) (*protocol.CompletionItem, error) {\n\t// TODO: Implement completion resolution logic.\n\t// For now, just return the item unchanged.\n\treturn item, nil\n}\n"
  },
  {
    "path": "private/buf/buflsp/completion_cel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file implements CEL expression completion support for the LSP.\n// CEL expressions appear in protovalidate (buf.validate) options.\n\npackage buflsp\n\nimport (\n\t\"cmp\"\n\t\"fmt\"\n\t\"maps\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/protocompile/experimental/ast/predeclared\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/google/cel-go/cel\"\n\t\"github.com/google/cel-go/common/decls\"\n\t\"github.com/google/cel-go/common/operators\"\n\t\"github.com/google/cel-go/common/types\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// celKeywords are CEL literal keywords, the protovalidate \"this\" special variable,\n// and the \"now\" runtime variable (google.protobuf.Timestamp) declared by protovalidate.\nvar celKeywords = []string{\"true\", \"false\", \"null\", \"this\", \"now\"}\n\n// getCELCompletionItems returns completion items if the cursor is inside a CEL expression.\n// Returns nil if the position is not inside a CEL expression.\nfunc getCELCompletionItems(\n\tfile *file,\n\tposition protocol.Position,\n\tcelEnv *cel.Env,\n) []protocol.CompletionItem {\n\tbyteOffset := positionToOffset(file, position)\n\n\tfor _, symbol := range file.symbols {\n\t\tfor _, exprInfo := range extractCELExpressions(file, symbol) {\n\t\t\tif byteOffset < exprInfo.span.Start || byteOffset >= exprInfo.span.End {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcelOffset := fileByteOffsetToCELOffset(byteOffset, exprInfo.span)\n\t\t\tif celOffset < 0 {\n\t\t\t\t// Cursor is at the closing quote or inside an empty string literal;\n\t\t\t\t// treat as end-of-expression for completion purposes.\n\t\t\t\tcelOffset = len(exprInfo.expression)\n\t\t\t}\n\t\t\tif celOffset > len(exprInfo.expression) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tcelContent := exprInfo.expression[:celOffset]\n\n\t\t\t// If the cursor is surrounded by identifier characters on both sides,\n\t\t\t// it is placed inside an existing token — do not offer completions.\n\t\t\t// Checking both sides avoids suppressing completions at the start of\n\t\t\t// an expression (where celContent is empty) when the next char happens\n\t\t\t// to be an identifier (e.g. cursor before \"this.\").\n\t\t\tif celOffset < len(exprInfo.expression) && len(celContent) > 0 {\n\t\t\t\tnext := exprInfo.expression[celOffset]\n\t\t\t\tprev := celContent[len(celContent)-1]\n\t\t\t\tif celIsIdentChar(next) && celIsIdentChar(prev) {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Determine the content to analyze for member access by stripping outer\n\t\t\t// context layers: comprehension bodies first (to capture the iter var type),\n\t\t\t// then has() macro arguments.\n\t\t\tmemberAccessContent := celContent\n\t\t\titerVarTypes := map[string]ir.Type{}\n\n\t\t\t// Peel comprehension layers from outermost to innermost.\n\t\t\t// Each iteration resolves the range expression (using all known variables\n\t\t\t// accumulated so far) to bind the iteration variable, then advances\n\t\t\t// memberAccessContent into the body expression for the next pass.\n\t\t\t//\n\t\t\t// lastRangeType tracks the element type from the previous layer. In chained\n\t\t\t// comprehensions (e.g. \"list.filter(x, pred).all(y, y.\"), the inner macro's\n\t\t\t// range candidate is the predicate expression \"pred\" which cannot be resolved\n\t\t\t// as a type. In that case we fall back to the previous element type because\n\t\t\t// filter/map/all preserve the element type of the input list.\n\t\t\tvar lastRangeType ir.Type\n\t\t\tfor {\n\t\t\t\trangeExpr, iterVar, body, inBody := celParseIteratorBody(memberAccessContent)\n\t\t\t\tif !inBody {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tvars := map[string]ir.Type{}\n\t\t\t\tif !exprInfo.thisIRType.IsZero() {\n\t\t\t\t\tvars[\"this\"] = exprInfo.thisIRType\n\t\t\t\t}\n\t\t\t\tmaps.Copy(vars, iterVarTypes)\n\t\t\t\trangeType, _ := celResolveExprType(rangeExpr, vars)\n\t\t\t\tif rangeType.IsZero() {\n\t\t\t\t\trangeType = lastRangeType\n\t\t\t\t}\n\t\t\t\tif !rangeType.IsZero() {\n\t\t\t\t\titerVarTypes[iterVar] = rangeType\n\t\t\t\t\tlastRangeType = rangeType\n\t\t\t\t}\n\t\t\t\tmemberAccessContent = body\n\t\t\t}\n\n\t\t\t// has() macro argument context: strip \"has(\" so the inner select\n\t\t\t// expression is handled by the regular member access path below.\n\t\t\t// E.g. \"has(this.f\" → memberAccessContent = \"this.f\".\n\t\t\tif innerContent, inHasArg := celParseHasArg(memberAccessContent); inHasArg {\n\t\t\t\tmemberAccessContent = innerContent\n\t\t\t}\n\n\t\t\t// Member access context: cursor immediately after a dot or typing\n\t\t\t// a member name. Handles both \"this.\" and \"this.ci\" (prefix \"ci\").\n\t\t\tif receiverExpr, memberPrefix, ok := celParseMemberAccess(memberAccessContent); ok {\n\t\t\t\tvar items []protocol.CompletionItem\n\n\t\t\t\t// Try CEL compile to determine receiver type (works for variables like \"now\").\n\t\t\t\tvar receiverCELType *types.Type\n\t\t\t\tif ast, iss := celEnv.Compile(receiverExpr); iss.Err() == nil {\n\t\t\t\t\treceiverCELType = ast.OutputType()\n\t\t\t\t}\n\n\t\t\t\t// Resolve via proto IR for field names and type mapping.\n\t\t\t\t// Build a variable map from \"this\" and any comprehension iteration variables.\n\t\t\t\tvar isListOrMapReceiver bool\n\t\t\t\tif !exprInfo.thisIRType.IsZero() || len(iterVarTypes) > 0 {\n\t\t\t\t\tvars := map[string]ir.Type{}\n\t\t\t\t\tif !exprInfo.thisIRType.IsZero() {\n\t\t\t\t\t\tvars[\"this\"] = exprInfo.thisIRType\n\t\t\t\t\t}\n\t\t\t\t\tmaps.Copy(vars, iterVarTypes)\n\t\t\t\t\tirType, isCollection := celResolveExprType(receiverExpr, vars)\n\t\t\t\t\tif !irType.IsZero() {\n\t\t\t\t\t\t// For the direct \"this\" receiver, use irMember cardinality:\n\t\t\t\t\t\t// thisIRType is already the element type so cardinality is not in vars.\n\t\t\t\t\t\tif receiverExpr == \"this\" && !exprInfo.irMember.IsZero() {\n\t\t\t\t\t\t\tif exprInfo.irMember.IsMap() {\n\t\t\t\t\t\t\t\tif receiverCELType == nil {\n\t\t\t\t\t\t\t\t\treceiverCELType = celMapEntryToCELType(irType)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tirType = ir.Type{}\n\t\t\t\t\t\t\t\tisListOrMapReceiver = true\n\t\t\t\t\t\t\t} else if exprInfo.irMember.IsRepeated() {\n\t\t\t\t\t\t\t\tif receiverCELType == nil {\n\t\t\t\t\t\t\t\t\treceiverCELType = types.NewListType(celProtoTypeToExprType(irType))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tirType = ir.Type{}\n\t\t\t\t\t\t\t\tisListOrMapReceiver = true\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if isCollection {\n\t\t\t\t\t\t\t// Path through a repeated or map field (e.g., \"this.items.\"):\n\t\t\t\t\t\t\t// offer collection methods rather than element field names.\n\t\t\t\t\t\t\tif receiverCELType == nil {\n\t\t\t\t\t\t\t\tif irType.IsMessage() && irType.IsMapEntry() {\n\t\t\t\t\t\t\t\t\treceiverCELType = celMapEntryToCELType(irType)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treceiverCELType = types.NewListType(celProtoTypeToExprType(irType))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tirType = ir.Type{}\n\t\t\t\t\t\t\tisListOrMapReceiver = true\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif !irType.IsZero() {\n\t\t\t\t\t\t\tif receiverCELType == nil {\n\t\t\t\t\t\t\t\treceiverCELType = celProtoTypeToExprType(irType)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif irType.IsMessage() {\n\t\t\t\t\t\t\t\titems = append(items, celProtoFieldCompletionItems(irType)...)\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\n\t\t\t\titems = append(items, celMemberCompletionItems(celEnv, receiverCELType)...)\n\t\t\t\tif isListOrMapReceiver {\n\t\t\t\t\titems = append(items, celMemberMacroCompletionItems()...)\n\t\t\t\t}\n\t\t\t\treturn celFilterByPrefix(items, memberPrefix)\n\t\t\t}\n\n\t\t\t// Extract the identifier prefix being typed at the end of celContent\n\t\t\t// so that operator context detection works on the preceding content.\n\t\t\tprefix := celCurrentPrefix(celContent)\n\t\t\tcontentBeforePrefix := celContent[:len(celContent)-len(prefix)]\n\n\t\t\t// Detect unary NOT or binary operator context to narrow expected type.\n\t\t\tvar expectedType *types.Type\n\t\t\ttrimmed := strings.TrimRight(contentBeforePrefix, \" \\t\\r\\n\")\n\t\t\tif strings.HasSuffix(trimmed, \"!\") {\n\t\t\t\t// After logical NOT, the operand must be bool.\n\t\t\t\texpectedType = types.BoolType\n\t\t\t} else {\n\t\t\t\texpectedType = celExpectedTypeAfterOperator(contentBeforePrefix, celEnv)\n\t\t\t}\n\n\t\t\tvar items []protocol.CompletionItem\n\t\t\titems = append(items, celGlobalCompletionItems(celEnv, expectedType)...)\n\t\t\titems = append(items, celMacroCompletionItems(celEnv)...)\n\t\t\titems = append(items, celKeywordCompletionItems(celEnv, expectedType)...)\n\t\t\treturn celFilterByPrefix(items, prefix)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// celParseMemberAccess detects if celContent is in a member access context:\n// either right after a dot (\"this.\") or typing a member name (\"this.ci\").\n// Returns the receiver expression, the typed prefix (possibly empty), and ok=true.\n// Examples:\n//   - \"this.\"     → (\"this\", \"\", true)\n//   - \"this.ci\"   → (\"this\", \"ci\", true)\n//   - \"size(\"     → (\"\", \"\", false)\n//   - \"si\"        → (\"\", \"\", false)\nfunc celParseMemberAccess(celContent string) (receiverExpr, memberPrefix string, ok bool) {\n\t// Peel off the identifier being typed at the end of celContent.\n\twordStart := len(celContent)\n\tfor wordStart > 0 && celIsIdentChar(celContent[wordStart-1]) {\n\t\twordStart--\n\t}\n\tbeforeWord := celContent[:wordStart]\n\tprefix := celContent[wordStart:]\n\n\t// Member access requires a dot immediately before the current word (or cursor).\n\ttrimmed := strings.TrimRight(beforeWord, \" \\t\\r\\n\")\n\tif len(trimmed) == 0 || trimmed[len(trimmed)-1] != '.' {\n\t\treturn \"\", \"\", false\n\t}\n\n\t// Receiver expression is everything before the dot.\n\treceiver := strings.TrimRight(trimmed[:len(trimmed)-1], \" \\t\\r\\n\")\n\tif receiver == \"\" {\n\t\treturn \"\", \"\", false\n\t}\n\treturn receiver, prefix, true\n}\n\n// celParseHasArg detects if the cursor is inside the argument of a has() macro call.\n// The has() macro takes a single select expression: has(receiver.field).\n// Returns the content after the last unqualified \"has(\" when the cursor is still\n// within the argument (i.e. no closing paren or comma has been written yet).\n// \"Unqualified\" means has( is not preceded by an identifier character or dot —\n// which would make it a method call (e.g. \"foo.has(\") rather than the macro.\n// Examples:\n//   - \"has(this.\"    → (\"this.\", true)\n//   - \"has(this.f\"   → (\"this.f\", true)\n//   - \"!has(this.f\"  → (\"this.f\", true)\n//   - \"has(this.f)\"  → (\"\", false)  — already closed\n//   - \"foo.has(this.\" → (\"\", false)  — method call, not the macro\nfunc celParseHasArg(celContent string) (innerContent string, ok bool) {\n\tidx := strings.LastIndex(celContent, \"has(\")\n\tif idx < 0 {\n\t\treturn \"\", false\n\t}\n\t// Reject method calls: \"expr.has(\" or \"ident.has(\" — the char before \"has(\" is a\n\t// dot or identifier character, indicating this is a method call, not the macro.\n\tif idx > 0 && (celIsIdentChar(celContent[idx-1]) || celContent[idx-1] == '.') {\n\t\treturn \"\", false\n\t}\n\tinner := celContent[idx+4:]\n\t// If we have already passed a closing paren or argument separator, we are\n\t// no longer inside the has() argument.\n\tif strings.ContainsAny(inner, \"),\") {\n\t\treturn \"\", false\n\t}\n\treturn inner, true\n}\n\n// celIteratorMacros are the CEL comprehension macros that bind an iteration variable.\nvar celIteratorMacros = []string{\"all\", \"exists\", \"exists_one\", \"filter\", \"map\"}\n\n// celParseIteratorBody detects if the cursor is inside the body expression of a CEL\n// comprehension macro call (all, exists, filter, map, etc.).\n// It finds the leftmost (outermost) such macro in celContent so that callers can\n// process comprehension layers from outer to inner by calling it in a loop.\n// Returns the range expression, the iteration variable name, and the body content\n// (the expression fragment after the separating comma), or ok=false if not matched.\n// Examples:\n//\n//\t\"this.items.filter(addr, addr.\"  → (\"this.items\", \"addr\", \"addr.\", true)\n//\t\"items.all(x, x.name\"            → (\"items\", \"x\", \"x.name\", true)\n//\t\"this.filter(\"                   → (\"\", \"\", \"\", false)  — no comma yet\nfunc celParseIteratorBody(celContent string) (rangeExpr, iterVar, bodyContent string, ok bool) {\n\t// Find the leftmost occurrence of any comprehension macro pattern.\n\tbestIdx := -1\n\tbestMacro := \"\"\n\tfor _, macro := range celIteratorMacros {\n\t\tpattern := \".\" + macro + \"(\"\n\t\tif idx := strings.Index(celContent, pattern); idx >= 0 {\n\t\t\tif bestIdx < 0 || idx < bestIdx {\n\t\t\t\tbestIdx = idx\n\t\t\t\tbestMacro = macro\n\t\t\t}\n\t\t}\n\t}\n\tif bestIdx < 0 {\n\t\treturn \"\", \"\", \"\", false\n\t}\n\tpattern := \".\" + bestMacro + \"(\"\n\tafterParen := celContent[bestIdx+len(pattern):]\n\tbeforeComma, afterComma, hasComma := strings.Cut(afterParen, \",\")\n\tif !hasComma {\n\t\treturn \"\", \"\", \"\", false\n\t}\n\tcandidate := strings.TrimSpace(beforeComma)\n\tif candidate == \"\" {\n\t\treturn \"\", \"\", \"\", false\n\t}\n\t// Iteration variable must be a plain identifier with no operators or parens.\n\tfor i := 0; i < len(candidate); i++ {\n\t\tif !celIsIdentChar(candidate[i]) {\n\t\t\treturn \"\", \"\", \"\", false\n\t\t}\n\t}\n\tbody := strings.TrimLeft(afterComma, \" \\t\\r\\n\")\n\trangeCandidate := strings.TrimRight(celContent[:bestIdx], \" \\t\\r\\n\")\n\t// Strip unbalanced trailing closing parens. These appear when this expression\n\t// is itself the body of an outer comprehension that was already peeled — e.g.\n\t// \"this.items.filter(item, item.addresses).all(addr, addr.\" yields a range\n\t// candidate of \"item.addresses)\" with one unmatched \")\".\n\topens := strings.Count(rangeCandidate, \"(\")\n\tcloses := strings.Count(rangeCandidate, \")\")\n\tfor closes > opens && strings.HasSuffix(rangeCandidate, \")\") {\n\t\trangeCandidate = strings.TrimRight(rangeCandidate[:len(rangeCandidate)-1], \" \\t\\r\\n\")\n\t\tcloses--\n\t}\n\treturn rangeCandidate, candidate, body, true\n}\n\n// celCurrentPrefix extracts the identifier being typed at the end of celContent.\n// Returns an empty string if celContent ends with a non-identifier character.\nfunc celCurrentPrefix(celContent string) string {\n\ti := len(celContent)\n\tfor i > 0 && celIsIdentChar(celContent[i-1]) {\n\t\ti--\n\t}\n\treturn celContent[i:]\n}\n\n// celFilterByPrefix filters completion items to those whose label starts with prefix.\n// Returns the full list unchanged when prefix is empty.\nfunc celFilterByPrefix(items []protocol.CompletionItem, prefix string) []protocol.CompletionItem {\n\tif prefix == \"\" {\n\t\treturn items\n\t}\n\tfiltered := make([]protocol.CompletionItem, 0, len(items))\n\tfor _, item := range items {\n\t\tif strings.HasPrefix(item.Label, prefix) {\n\t\t\tfiltered = append(filtered, item)\n\t\t}\n\t}\n\treturn filtered\n}\n\n// celResolveExprType resolves a CEL expression to its ir.Type, supporting both\n// dot access (\"this.field.sub\") and bracket-index notation (\"this.items[0]\" or\n// \"this.locations[\\\"key\\\"]\"). The second return value is true when the final\n// navigation step traverses a repeated or map field, indicating the returned type\n// is the element type of a list or map (so callers can offer collection methods\n// rather than individual field names).\n//\n// Examples (with vars = {\"this\": LocationType, \"addr\": AddressType}):\n//\n//\t\"this.address.city\"          → (string, false)\n//\t\"this.items\"                 → (Address, true)   // repeated field\n//\t\"this.items[0]\"              → (Address, false)  // element after indexing\n//\t\"this.locations[\\\"home\\\"]\" → (Address, false)  // map-value after indexing\n//\t\"addr.zip_code\"              → (int32, false)\nfunc celResolveExprType(expr string, vars map[string]ir.Type) (ir.Type, bool) {\n\texpr = strings.TrimSpace(expr)\n\tif expr == \"\" {\n\t\treturn ir.Type{}, false\n\t}\n\n\t// Handle bracket-index access: receiver[expr].\n\t// After indexing, the result is always a single element (not a collection).\n\tif strings.HasSuffix(expr, \"]\") {\n\t\tbracketOpen := strings.LastIndex(expr, \"[\")\n\t\tif bracketOpen < 0 {\n\t\t\treturn ir.Type{}, false\n\t\t}\n\t\treceiverType, _ := celResolveExprType(expr[:bracketOpen], vars)\n\t\tif receiverType.IsZero() {\n\t\t\treturn ir.Type{}, false\n\t\t}\n\t\tif receiverType.IsMessage() && receiverType.IsMapEntry() {\n\t\t\t// Map indexing: return the map value element type.\n\t\t\t_, valueMember := receiverType.EntryFields()\n\t\t\tif valueMember.IsZero() {\n\t\t\t\treturn ir.Type{}, false\n\t\t\t}\n\t\t\treturn valueMember.Element(), false\n\t\t}\n\t\t// List indexing: the receiver is already the element type.\n\t\treturn receiverType, false\n\t}\n\n\t// Handle dot access: split on the last dot.\n\tdotIdx := strings.LastIndex(expr, \".\")\n\tif dotIdx < 0 {\n\t\t// Simple root variable lookup.\n\t\tt, ok := vars[expr]\n\t\tif !ok {\n\t\t\treturn ir.Type{}, false\n\t\t}\n\t\treturn t, false\n\t}\n\n\tfieldName := strings.TrimSpace(expr[dotIdx+1:])\n\treceiverExpr := expr[:dotIdx]\n\tif fieldName == \"\" {\n\t\treturn ir.Type{}, false\n\t}\n\n\treceiverType, _ := celResolveExprType(receiverExpr, vars)\n\tif receiverType.IsZero() || !receiverType.IsMessage() {\n\t\treturn ir.Type{}, false\n\t}\n\n\tmember := receiverType.MemberByName(fieldName)\n\tif member.IsZero() {\n\t\treturn ir.Type{}, false\n\t}\n\n\t// Return element type and whether this step crosses a collection boundary.\n\treturn member.Element(), member.IsRepeated() || member.IsMap()\n}\n\n// celProtoTypeToExprType maps a proto ir.Type to the corresponding CEL *types.Type.\n// Returns nil if the type cannot be mapped.\nfunc celProtoTypeToExprType(irType ir.Type) *types.Type {\n\tif irType.IsZero() {\n\t\treturn nil\n\t}\n\tif irType.IsMessage() {\n\t\treturn types.NewObjectType(string(irType.FullName()))\n\t}\n\tif irType.IsEnum() {\n\t\treturn types.IntType // enums are integers in CEL\n\t}\n\tif !irType.IsPredeclared() {\n\t\treturn nil\n\t}\n\tswitch irType.Predeclared() {\n\tcase predeclared.Bool:\n\t\treturn types.BoolType\n\tcase predeclared.String:\n\t\treturn types.StringType\n\tcase predeclared.Bytes:\n\t\treturn types.BytesType\n\tcase predeclared.Float, predeclared.Double:\n\t\treturn types.DoubleType\n\tcase predeclared.UInt32, predeclared.UInt64, predeclared.Fixed32, predeclared.Fixed64:\n\t\treturn types.UintType\n\tcase predeclared.Int32, predeclared.Int64,\n\t\tpredeclared.SInt32, predeclared.SInt64,\n\t\tpredeclared.SFixed32, predeclared.SFixed64:\n\t\treturn types.IntType\n\tdefault:\n\t\treturn nil\n\t}\n}\n\n// celMapEntryToCELType converts a map-entry ir.Type to the corresponding CEL map type.\n// Map fields in proto are represented internally as repeated MapEntry messages;\n// this function extracts the key and value types to produce a CEL map type.\n// Returns nil if irType is not a valid map entry.\nfunc celMapEntryToCELType(irType ir.Type) *types.Type {\n\tif irType.IsZero() || !irType.IsMessage() || !irType.IsMapEntry() {\n\t\treturn nil\n\t}\n\tkeyMember, valueMember := irType.EntryFields()\n\tif keyMember.IsZero() || valueMember.IsZero() {\n\t\treturn nil\n\t}\n\tkeyType := celProtoTypeToExprType(keyMember.Element())\n\tvalueType := celProtoTypeToExprType(valueMember.Element())\n\tif keyType == nil || valueType == nil {\n\t\treturn nil\n\t}\n\treturn types.NewMapType(keyType, valueType)\n}\n\n// celProtoFieldCompletionItems returns completion items for the fields of a proto message type.\nfunc celProtoFieldCompletionItems(irType ir.Type) []protocol.CompletionItem {\n\tif irType.IsZero() || !irType.IsMessage() {\n\t\treturn nil\n\t}\n\tvar items []protocol.CompletionItem\n\tfor member := range seq.Values(irType.Members()) {\n\t\tif member.IsSynthetic() || member.IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\tfieldType := member.Element()\n\t\tdetail := \"\"\n\t\tif !fieldType.IsZero() {\n\t\t\tdetail = string(fieldType.FullName())\n\t\t}\n\t\t_, isDeprecated := member.Deprecated().AsBool()\n\t\tvar documentation any\n\t\tif doc := leadingDocComments(member.AST()); doc != \"\" {\n\t\t\tdocumentation = &protocol.MarkupContent{\n\t\t\t\tKind:  protocol.Markdown,\n\t\t\t\tValue: doc,\n\t\t\t}\n\t\t}\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel:         member.Name(),\n\t\t\tKind:          protocol.CompletionItemKindField,\n\t\t\tDetail:        detail,\n\t\t\tDocumentation: documentation,\n\t\t\tDeprecated:    isDeprecated,\n\t\t})\n\t}\n\tslices.SortFunc(items, func(a, b protocol.CompletionItem) int {\n\t\treturn cmp.Compare(a.Label, b.Label)\n\t})\n\treturn items\n}\n\n// celBinaryOperatorSymbols returns a map from display symbol (e.g. \"&&\") to\n// cel-go internal name (e.g. \"_&&_\") for all binary operators in the environment.\nfunc celBinaryOperatorSymbols(celEnv *cel.Env) map[string]string {\n\tresult := make(map[string]string)\n\tfor name := range celEnv.Functions() {\n\t\tdisplay, ok := operators.FindReverseBinaryOperator(name)\n\t\tif ok && display != \"\" {\n\t\t\tif _, exists := result[display]; !exists {\n\t\t\t\tresult[display] = name\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\n// celExpectedTypeAfterOperator checks if celContent ends with a binary operator and\n// returns the expected type for the right-hand operand. Returns nil if no binary\n// operator context is detected or the expected type cannot be determined.\nfunc celExpectedTypeAfterOperator(celContent string, celEnv *cel.Env) *types.Type {\n\tbefore := strings.TrimRight(celContent, \" \\t\\r\\n\")\n\tif before == \"\" {\n\t\treturn nil\n\t}\n\n\topSymbols := celBinaryOperatorSymbols(celEnv)\n\n\t// Sort display symbols longest-first so multi-character operators (e.g. \"&&\")\n\t// are matched before single-character ones (e.g. \">\").\n\tsymbols := make([]string, 0, len(opSymbols))\n\tfor sym := range opSymbols {\n\t\tsymbols = append(symbols, sym)\n\t}\n\tslices.SortFunc(symbols, func(a, b string) int {\n\t\treturn cmp.Compare(len(b), len(a))\n\t})\n\n\t// Find the binary operator at the end of the trimmed content.\n\tvar celOp, leftExpr string\n\tfor _, sym := range symbols {\n\t\tif strings.HasSuffix(before, sym) {\n\t\t\tcandidate := strings.TrimRight(before[:len(before)-len(sym)], \" \\t\\r\\n\")\n\t\t\tif candidate == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcelOp = opSymbols[sym]\n\t\t\tleftExpr = candidate\n\t\t\tbreak\n\t\t}\n\t}\n\tif celOp == \"\" {\n\t\treturn nil\n\t}\n\n\t// Compile the left-hand expression to determine its type.\n\tleftAst, iss := celEnv.Compile(leftExpr)\n\tif iss.Err() != nil {\n\t\treturn nil\n\t}\n\tleftType := leftAst.OutputType()\n\n\t// Find operator overloads accepting leftType and collect the expected right-hand types.\n\tfn, ok := celEnv.Functions()[celOp]\n\tif !ok {\n\t\treturn nil\n\t}\n\n\trightTypes := make(map[string]*types.Type)\n\tfor _, o := range fn.OverloadDecls() {\n\t\targs := o.ArgTypes()\n\t\tif len(args) != 2 {\n\t\t\tcontinue\n\t\t}\n\t\tif !args[0].IsAssignableType(leftType) && !leftType.IsAssignableType(args[0]) {\n\t\t\tcontinue\n\t\t}\n\t\tright := args[1]\n\t\tif celIsTypeParam(right) {\n\t\t\tright = leftType\n\t\t}\n\t\trightTypes[right.String()] = right\n\t}\n\n\t// Only narrow the type if there is exactly one expected type.\n\tif len(rightTypes) == 1 {\n\t\tfor _, t := range rightTypes {\n\t\t\treturn t\n\t\t}\n\t}\n\treturn nil\n}\n\n// celIsTypeParam returns true if t is a type parameter (e.g. <A>).\nfunc celIsTypeParam(t *types.Type) bool {\n\ts := t.String()\n\treturn strings.HasPrefix(s, \"<\") && strings.HasSuffix(s, \">\")\n}\n\n// celTypeMatches returns true if resultType is compatible with expectedType.\n// If expectedType is nil, all types match.\nfunc celTypeMatches(expectedType, resultType *types.Type) bool {\n\tif expectedType == nil {\n\t\treturn true\n\t}\n\treturn expectedType.IsAssignableType(resultType)\n}\n\n// celMemberCompletionItems returns completion items for member (receiver-style) functions.\n// If receiverType is non-nil, only functions whose first argument is assignable from\n// receiverType are included. If nil, all member functions are returned.\nfunc celMemberCompletionItems(celEnv *cel.Env, receiverType *types.Type) []protocol.CompletionItem {\n\tvar items []protocol.CompletionItem\n\tfor name, fn := range celEnv.Functions() {\n\t\tif celIsOperatorOrInternal(name) {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar matchingOverloads []*decls.OverloadDecl\n\t\tfor _, o := range fn.OverloadDecls() {\n\t\t\tif !o.IsMemberFunction() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif receiverType != nil && len(o.ArgTypes()) > 0 {\n\t\t\t\trecvType := o.ArgTypes()[0]\n\t\t\t\tif !recvType.IsAssignableType(receiverType) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t\tmatchingOverloads = append(matchingOverloads, o)\n\t\t}\n\t\tif len(matchingOverloads) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel:            name,\n\t\t\tKind:             protocol.CompletionItemKindMethod,\n\t\t\tDetail:           celFormatOverloadSignature(fn.Name(), matchingOverloads[0]),\n\t\t\tDocumentation:    fn.Description(),\n\t\t\tInsertText:       name + \"($1)\",\n\t\t\tInsertTextFormat: protocol.InsertTextFormatSnippet,\n\t\t})\n\t}\n\tslices.SortFunc(items, func(a, b protocol.CompletionItem) int {\n\t\treturn cmp.Compare(a.Label, b.Label)\n\t})\n\treturn items\n}\n\n// celMemberMacroCompletionItems returns completion items for CEL comprehension macros\n// (all, exists, filter, map, exists_one) invoked in member-access style on list and\n// map receivers (e.g. myList.filter(x, pred)). These macros are not regular functions\n// in cel-go's function registry, so celMemberCompletionItems does not include them.\nfunc celMemberMacroCompletionItems() []protocol.CompletionItem {\n\titems := make([]protocol.CompletionItem, 0, len(celIteratorMacros))\n\tfor _, name := range celIteratorMacros {\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel:            name,\n\t\t\tKind:             protocol.CompletionItemKindMethod,\n\t\t\tDetail:           \"macro\",\n\t\t\tInsertText:       name + \"($1, $2)\",\n\t\t\tInsertTextFormat: protocol.InsertTextFormatSnippet,\n\t\t})\n\t}\n\treturn items\n}\n\n// celGlobalCompletionItems returns completion items for global (non-receiver) functions\n// and type conversions. If expectedType is non-nil, only functions that can return a\n// compatible type are included.\nfunc celGlobalCompletionItems(celEnv *cel.Env, expectedType *types.Type) []protocol.CompletionItem {\n\tvar items []protocol.CompletionItem\n\tfor name, fn := range celEnv.Functions() {\n\t\tif celIsOperatorOrInternal(name) {\n\t\t\tcontinue\n\t\t}\n\n\t\thasMatchingGlobal := false\n\t\tfor _, o := range fn.OverloadDecls() {\n\t\t\tif o.IsMemberFunction() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif celTypeMatches(expectedType, o.ResultType()) {\n\t\t\t\thasMatchingGlobal = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !hasMatchingGlobal {\n\t\t\tcontinue\n\t\t}\n\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel:            name,\n\t\t\tKind:             protocol.CompletionItemKindFunction,\n\t\t\tDetail:           celGlobalFunctionDetail(fn),\n\t\t\tDocumentation:    fn.Description(),\n\t\t\tInsertText:       name + \"($1)\",\n\t\t\tInsertTextFormat: protocol.InsertTextFormatSnippet,\n\t\t})\n\t}\n\tslices.SortFunc(items, func(a, b protocol.CompletionItem) int {\n\t\treturn cmp.Compare(a.Label, b.Label)\n\t})\n\treturn items\n}\n\n// celMacroCompletionItems returns completion items for CEL macros derived from\n// cel-go's env.Macros(). Macros are not filtered by expectedType since they do\n// not carry return type information in cel-go.\nfunc celMacroCompletionItems(celEnv *cel.Env) []protocol.CompletionItem {\n\tseen := make(map[string]bool)\n\tvar items []protocol.CompletionItem\n\tfor _, m := range celEnv.Macros() {\n\t\tname := m.Function()\n\t\tif seen[name] {\n\t\t\tcontinue\n\t\t}\n\t\tseen[name] = true\n\t\t// Skip macros whose function name is an operator display symbol.\n\t\t// The \"in\" membership operator is registered as a CEL macro but is\n\t\t// an infix binary operator (\"value in list\"), not a callable function.\n\t\tif _, ok := operators.Find(name); ok {\n\t\t\tcontinue\n\t\t}\n\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel:            name,\n\t\t\tKind:             protocol.CompletionItemKindFunction,\n\t\t\tDetail:           \"macro\",\n\t\t\tInsertText:       name + \"($1)\",\n\t\t\tInsertTextFormat: protocol.InsertTextFormatSnippet,\n\t\t})\n\t}\n\tslices.SortFunc(items, func(a, b protocol.CompletionItem) int {\n\t\treturn cmp.Compare(a.Label, b.Label)\n\t})\n\treturn items\n}\n\n// celKeywordCompletionItems returns completion items for CEL literal keywords and\n// protovalidate runtime variables (\"this\", \"now\"). If expectedType is non-nil, only\n// keywords whose compiled type is compatible with it are included.\n// \"this\" is always included when there is no expected type constraint.\n// \"now\" is included when its timestamp type is compatible with expectedType.\nfunc celKeywordCompletionItems(celEnv *cel.Env, expectedType *types.Type) []protocol.CompletionItem {\n\tvar items []protocol.CompletionItem\n\tfor _, kw := range celKeywords {\n\t\tif kw == \"this\" {\n\t\t\t// \"this\" is the protovalidate special variable bound at eval time;\n\t\t\t// it cannot be compiled in the static environment. Always include it\n\t\t\t// unless the caller has narrowed to a specific expected type (in that\n\t\t\t// case its type is unknown so we cannot confirm compatibility).\n\t\t\tif expectedType == nil {\n\t\t\t\titems = append(items, protocol.CompletionItem{\n\t\t\t\t\tLabel:  kw,\n\t\t\t\t\tKind:   protocol.CompletionItemKindVariable,\n\t\t\t\t\tDetail: \"protovalidate: current message or field\",\n\t\t\t\t})\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tast, iss := celEnv.Compile(kw)\n\t\tif iss.Err() != nil {\n\t\t\tcontinue\n\t\t}\n\t\tkwType := ast.OutputType()\n\t\tif !celTypeMatches(expectedType, kwType) {\n\t\t\tcontinue\n\t\t}\n\t\tkind := protocol.CompletionItemKindKeyword\n\t\tdetail := kwType.String()\n\t\tif kw == \"now\" {\n\t\t\t// \"now\" is a protovalidate runtime variable, not a literal keyword.\n\t\t\tkind = protocol.CompletionItemKindVariable\n\t\t\tdetail = \"protovalidate: current evaluation timestamp\"\n\t\t}\n\t\titems = append(items, protocol.CompletionItem{\n\t\t\tLabel:  kw,\n\t\t\tKind:   kind,\n\t\t\tDetail: detail,\n\t\t})\n\t}\n\treturn items\n}\n\n// celIsOperatorOrInternal returns true if name represents an operator or internal\n// function that should not appear as a user-visible completion item.\nfunc celIsOperatorOrInternal(name string) bool {\n\t// Check internal operator names (e.g. \"@in\", \"_&&_\").\n\tif _, ok := operators.FindReverse(name); ok {\n\t\treturn true\n\t}\n\t// Check operator display names (e.g. \"in\"). Some CEL environments register\n\t// the in operator under its display name as well as its internal \"@in\" name.\n\tif _, ok := operators.Find(name); ok {\n\t\treturn true\n\t}\n\treturn strings.HasPrefix(name, \"@\") || strings.HasPrefix(name, \"_\")\n}\n\n// celGlobalFunctionDetail returns a short detail string for the first global\n// (non-member) overload of fn.\nfunc celGlobalFunctionDetail(fn *decls.FunctionDecl) string {\n\tfor _, o := range fn.OverloadDecls() {\n\t\tif o.IsMemberFunction() {\n\t\t\tcontinue\n\t\t}\n\t\treturn celFormatOverloadSignature(fn.Name(), o)\n\t}\n\treturn \"\"\n}\n\n// celFormatOverloadSignature formats a single overload as \"name(args...) -> result\".\n// For member functions, the format is \"receiver.name(args...) -> result\".\nfunc celFormatOverloadSignature(name string, o *decls.OverloadDecl) string {\n\targs := o.ArgTypes()\n\tvar parts []string\n\tstart := 0\n\tprefix := \"\"\n\tif o.IsMemberFunction() && len(args) > 0 {\n\t\tprefix = args[0].String() + \".\"\n\t\tstart = 1\n\t}\n\tfor _, a := range args[start:] {\n\t\tparts = append(parts, a.String())\n\t}\n\tresult := o.ResultType().String()\n\treturn fmt.Sprintf(\"%s%s(%s) -> %s\", prefix, name, strings.Join(parts, \", \"), result)\n}\n"
  },
  {
    "path": "private/buf/buflsp/completion_cel_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestCELCompletion(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\ttestProtoPath, err := filepath.Abs(\"testdata/completion/cel_completion.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\t// File contents (0-indexed lines):\n\t//  26:  `    expression: \"this.\"`                                              (dot context; also used for expression-start)\n\t//  32:  `    expression: \"\"`                                                   (empty expression)\n\t//  39:  `    expression: \"1 > \"`                                               (operator, no narrowing)\n\t//  46:  `    expression: \"true == \"`                                           (operator, narrowed to bool)\n\t//  53:  `    expression: \"th\"`                                                 (prefix \"th\", completes to \"this\")\n\t//  60:  `    expression: \"size(this) > 0\"`                                     (mid-token cursor, no completions)\n\t//  65:  `  string test_cel_expr = 7 [(buf.validate.field).cel_expression = \"this.\"];`\n\t//  71:  `    expression: \"this.\"`                                              (message-typed field)\n\t//  77:  `    expression: \"!\"`                                                  (unary NOT, narrowed to bool)\n\t//  84:  `    expression: \"this.address.ci\"`                                    (nested path; prefix \"ci\")\n\t//  91:  `    expression: \"has(this.\"`                                          (has() arg completions)\n\t//  98:  `    expression: \"has(this.address.ci\"`                                (has() nested path; prefix \"ci\")\n\t// 105:  `    expression: \"now.\"`                                               (Timestamp methods via \"now\" variable)\n\t// 112:  `    expression: \"this.\"`                                              (repeated field; list methods and macros)\n\t// 119:  `    expression: \"this.\"`                                              (map field; map methods)\n\t// 127:  `    expression: \"this.\"`                                              (message-level CEL)\n\t// 138:  `    expression: \"this.items.filter(addr, addr.\"`                      (comprehension iter var)\n\t// 155:  `    expression: \"this.items.filter(item, item.addresses.filter(addr, addr.\"` (nested comprehension iter var)\n\t// 165:  `    expression: \"this.\"`                                              (WKTHolder.created_at — Timestamp field)\n\t// 175:  `    expression: \"this.\"`                                              (OneofHolder message-level — oneof member fields)\n\t// 193:  `    expression: \"this.items.\"`                                        (RepeatedPathHolder — list receiver, not element fields)\n\t// 206:  `    expression: \"this.items[0].\"`                                     (IndexAccessHolder — indexed into list, yields element fields)\n\t// 210:  `    expression: \"this.locations[\\\"key\\\"].\"`                           (IndexAccessHolder — indexed into map, yields value fields)\n\t// 222:  `    expression: \"this.items.filter(item, item.zip_code > 0).all(addr, addr.\"` (ChainedComprehensionHolder)\n\t// 232:  `    expression: \"in\"`                                                    (InOperatorHolder — \"in\" is an operator, not a function)\n\ttests := []struct {\n\t\tname                string\n\t\tline                uint32\n\t\tcharacter           uint32\n\t\tnoCompletions       bool // expect nil or empty completion list\n\t\texpectedContains    []string\n\t\texpectedNotContains []string\n\t\texpectedDocs        map[string]string // maps item label → expected documentation substring\n\t\texpectedDeprecated  []string          // item labels expected to have Deprecated: true\n\t}{\n\t\t{\n\t\t\t// Cursor at closing `\"` of `\"this.\"` — isDotContext sees `this.`\n\t\t\t// and returns member completions filtered to string methods.\n\t\t\tname:      \"dot_context_member_completions\",\n\t\t\tline:      26,\n\t\t\tcharacter: 22, // position of closing `\"` after `this.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"contains\",\n\t\t\t\t\"endsWith\",\n\t\t\t\t\"matches\",\n\t\t\t\t\"size\",\n\t\t\t\t\"startsWith\",\n\t\t\t},\n\t\t\t// Keywords and global-only functions are not included in member completion.\n\t\t\texpectedNotContains: []string{\"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Cursor at closing `\"` of `\"\"` — empty expression, return all completions.\n\t\t\tname:      \"empty_expression_all_completions\",\n\t\t\tline:      32,\n\t\t\tcharacter: 17, // position of closing `\"` in empty string\n\t\t\texpectedContains: []string{\n\t\t\t\t// CEL keywords / protovalidate special variables\n\t\t\t\t\"true\",\n\t\t\t\t\"false\",\n\t\t\t\t\"null\",\n\t\t\t\t\"this\",\n\t\t\t\t\"now\", // protovalidate runtime timestamp variable\n\t\t\t\t// Standard global functions\n\t\t\t\t\"size\",\n\t\t\t\t// Standard macros\n\t\t\t\t\"all\",\n\t\t\t\t\"exists\",\n\t\t\t\t\"filter\",\n\t\t\t\t\"has\",\n\t\t\t\t\"map\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Cursor at closing `\"` of `\"1 > \"` — inside a CEL expression after an operator.\n\t\t\t// The `>` operator has mixed-type overloads (int, double, uint on the right),\n\t\t\t// so type narrowing does not apply and all CEL completions are returned.\n\t\t\tname:      \"operator_context_cel_completions\",\n\t\t\tline:      39,\n\t\t\tcharacter: 21, // position of closing `\"` after `1 > `\n\t\t\texpectedContains: []string{\n\t\t\t\t\"size\",\n\t\t\t\t\"all\",\n\t\t\t\t\"exists\",\n\t\t\t\t\"true\",\n\t\t\t\t\"false\",\n\t\t\t\t\"null\",\n\t\t\t\t\"this\",\n\t\t\t\t\"now\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Cursor at closing `\"` of `\"true == \"`.\n\t\t\t// `==` has a single type-param overload; with bool on the left, expectedType\n\t\t\t// narrows to bool. Only bool-compatible completions are returned.\n\t\t\tname:      \"operator_context_type_narrowed_to_bool\",\n\t\t\tline:      46,\n\t\t\tcharacter: 25, // position of closing `\"` after `true == `\n\t\t\texpectedContains: []string{\n\t\t\t\t// bool keywords match the expected type\n\t\t\t\t\"true\",\n\t\t\t\t\"false\",\n\t\t\t},\n\t\t\t// size() returns int, not bool — excluded by type narrowing.\n\t\t\t// \"this\" is excluded because expectedType is non-nil.\n\t\t\t// \"null\" has type \"value\", not bool — excluded.\n\t\t\t// \"now\" is timestamp, not bool — excluded.\n\t\t\texpectedNotContains: []string{\"size\", \"this\", \"null\", \"now\"},\n\t\t},\n\t\t{\n\t\t\t// Cursor at char 17 (first character of `this` in `\"this.\"`).\n\t\t\t// celContent=\"\" so all completions are returned, just like the empty expression case.\n\t\t\tname:      \"expression_start_all_completions\",\n\t\t\tline:      26,\n\t\t\tcharacter: 17, // char of `t` — celOffset=0, celContent=\"\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"true\",\n\t\t\t\t\"false\",\n\t\t\t\t\"null\",\n\t\t\t\t\"this\",\n\t\t\t\t\"now\",\n\t\t\t\t\"size\",\n\t\t\t\t\"all\",\n\t\t\t\t\"exists\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Cursor at closing `\"` of `\"th\"` — prefix \"th\" filters completions\n\t\t\t// to items starting with \"th\". The only standard CEL item is \"this\".\n\t\t\tname:      \"prefix_th_completes_this\",\n\t\t\tline:      53,\n\t\t\tcharacter: 19, // closing `\"` of `\"th\"`, celContent=\"th\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"this\",\n\t\t\t},\n\t\t\t// Items not starting with \"th\" are all filtered out.\n\t\t\texpectedNotContains: []string{\"true\", \"false\", \"null\", \"size\", \"all\", \"now\"},\n\t\t},\n\t\t{\n\t\t\t// Cursor at char 18 of `    expression: \"size(this) > 0\"`.\n\t\t\t// char 18 = `i`, so the next character after the cursor is an identifier\n\t\t\t// character — the cursor is inside a completed token. No completions offered.\n\t\t\tname:          \"no_completions_mid_token\",\n\t\t\tline:          60,\n\t\t\tcharacter:     18, // `i` in `size`, next char is also identifier\n\t\t\tnoCompletions: true,\n\t\t},\n\t\t{\n\t\t\t// `cel_expression` field — a direct repeated-string field on FieldRules,\n\t\t\t// not wrapped in a Rule message. Cursor at char 72 = closing `\"` after `this.`.\n\t\t\tname:      \"cel_expression_field_dot_completions\",\n\t\t\tline:      65,\n\t\t\tcharacter: 72, // closing `\"` of `\"this.\"` in the inline option\n\t\t\texpectedContains: []string{\n\t\t\t\t\"contains\",\n\t\t\t\t\"endsWith\",\n\t\t\t\t\"matches\",\n\t\t\t\t\"size\",\n\t\t\t\t\"startsWith\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Message-typed field: cursor at closing `\"` of `\"this.\"`.\n\t\t\t// Should return proto field names (city, country, zip_code) from Address,\n\t\t\t// not string member functions.\n\t\t\tname:      \"message_field_dot_completions\",\n\t\t\tline:      71,\n\t\t\tcharacter: 22, // closing `\"` of `\"this.\"` for Address-typed field\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t\t\"country\",\n\t\t\t\t\"zip_code\",\n\t\t\t},\n\t\t\t// String member functions and keywords are excluded.\n\t\t\texpectedNotContains: []string{\"contains\", \"startsWith\", \"true\", \"false\", \"null\"},\n\t\t\t// Verify that field doc comments are surfaced in completion documentation.\n\t\t\texpectedDocs: map[string]string{\n\t\t\t\t\"city\":     \"The city name.\",\n\t\t\t\t\"country\":  \"The country code.\",\n\t\t\t\t\"zip_code\": \"The ZIP or postal code.\",\n\t\t\t},\n\t\t\t// zip_code is marked deprecated = true in the proto.\n\t\t\texpectedDeprecated: []string{\"zip_code\"},\n\t\t},\n\t\t{\n\t\t\t// Unary NOT context: cursor at closing `\"` of `\"!\"`.\n\t\t\t// After `!`, the operand must be bool, so completions narrow to bool-typed items.\n\t\t\tname:      \"unary_not_bool_narrowing\",\n\t\t\tline:      77,\n\t\t\tcharacter: 18, // closing `\"` of `\"!\"`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"true\",\n\t\t\t\t\"false\",\n\t\t\t},\n\t\t\t// Non-bool items are excluded.\n\t\t\texpectedNotContains: []string{\"size\", \"null\", \"this\", \"now\"},\n\t\t},\n\t\t{\n\t\t\t// Nested path: cursor at end of `\"this.address.ci\"` on a Location-typed field.\n\t\t\t// `this` is Location, `this.address` is Address, prefix \"ci\" narrows to city.\n\t\t\tname:      \"nested_path_completions\",\n\t\t\tline:      84,\n\t\t\tcharacter: 32, // closing `\"` after `this.address.ci`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t},\n\t\t\t// Other Address fields don't start with \"ci\"; keywords and methods excluded.\n\t\t\texpectedNotContains: []string{\"country\", \"zip_code\", \"contains\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// has() macro argument: cursor at closing `\"` of `\"has(this.\"` on an Address field.\n\t\t\t// The inner `this.` selects Address fields.\n\t\t\tname:      \"has_arg_dot_completions\",\n\t\t\tline:      91,\n\t\t\tcharacter: 26, // closing `\"` after `has(this.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t\t\"country\",\n\t\t\t\t\"zip_code\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"contains\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// has() with a nested path: cursor at end of `\"has(this.address.ci\"`.\n\t\t\t// has() strips to \"this.address.ci\"; member access resolves to Address\n\t\t\t// via the nested path; prefix \"ci\" filters to only city.\n\t\t\tname:      \"has_arg_nested_path_completions\",\n\t\t\tline:      98,\n\t\t\tcharacter: 36, // closing `\"` after `has(this.address.ci`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"country\", \"zip_code\", \"contains\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// now. completions: cursor at closing `\"` of `\"now.\"`.\n\t\t\t// `now` is protovalidate's runtime Timestamp variable; \"now.\" should yield\n\t\t\t// Timestamp methods from the CEL environment.\n\t\t\tname:      \"now_dot_completions\",\n\t\t\tline:      105,\n\t\t\tcharacter: 21, // closing `\"` after `now.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"getFullYear\",\n\t\t\t\t\"getHours\",\n\t\t\t\t\"getMonth\",\n\t\t\t},\n\t\t\t// Proto field names and keywords are not Timestamp methods.\n\t\t\texpectedNotContains: []string{\"city\", \"name\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Repeated field: cursor at closing `\"` of `\"this.\"` on a `repeated Address` field.\n\t\t\t// CEL treats repeated proto fields as lists; `size` (list member function) and\n\t\t\t// comprehension macros (filter, all, exists, etc.) should be offered.\n\t\t\t// Address field names (city, etc.) should NOT appear since this is a list.\n\t\t\tname:      \"repeated_field_dot_completions\",\n\t\t\tline:      112,\n\t\t\tcharacter: 22, // closing `\"` after `this.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"size\",\n\t\t\t\t\"filter\",\n\t\t\t\t\"all\",\n\t\t\t\t\"exists\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"city\", \"country\", \"zip_code\"},\n\t\t},\n\t\t{\n\t\t\t// Map field: cursor at closing `\"` of `\"this.\"` on a `map<string, string>` field.\n\t\t\t// CEL treats map fields as maps; `size` should be offered.\n\t\t\t// String field names should NOT appear.\n\t\t\tname:      \"map_field_dot_completions\",\n\t\t\tline:      119,\n\t\t\tcharacter: 22, // closing `\"` after `this.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"size\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"city\", \"country\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Message-level CEL rule: `(buf.validate.message).cel`.\n\t\t\t// Cursor at char 22 = closing `\"` after `this.` in the message option.\n\t\t\t// `this` refers to CELCompletionMsg itself, so field completions yield `name`.\n\t\t\tname:      \"message_level_dot_completions\",\n\t\t\tline:      127,\n\t\t\tcharacter: 22,\n\t\t\texpectedContains: []string{\n\t\t\t\t\"name\",\n\t\t\t},\n\t\t\t// String member functions and keywords are not proto fields — excluded.\n\t\t\texpectedNotContains: []string{\"contains\", \"startsWith\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Comprehension iteration variable: cursor at closing `\"` of\n\t\t\t// `\"this.items.filter(addr, addr.\"`. The range `this.items` is a repeated\n\t\t\t// Address field; `addr` is bound to Address elements. Completions should\n\t\t\t// yield Address field names.\n\t\t\tname:      \"iter_var_dot_completions\",\n\t\t\tline:      138,\n\t\t\tcharacter: 46, // closing `\"` after `this.items.filter(addr, addr.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t\t\"country\",\n\t\t\t\t\"zip_code\",\n\t\t\t},\n\t\t\t// List methods and keywords are not Address fields.\n\t\t\texpectedNotContains: []string{\"size\", \"all\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Nested comprehension iteration variable: cursor at closing `\"` of\n\t\t\t// `\"this.items.filter(item, item.addresses.filter(addr, addr.\"`.\n\t\t\t// The outer range `this.items` is a repeated Item field; `item` is bound to Item.\n\t\t\t// The inner range `item.addresses` is a repeated Address field; `addr` is bound\n\t\t\t// to Address elements. Completions should yield Address field names.\n\t\t\tname:      \"iter_nested_var_completions\",\n\t\t\tline:      155,\n\t\t\tcharacter: 74, // closing `\"` after `this.items.filter(item, item.addresses.filter(addr, addr.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t\t\"country\",\n\t\t\t\t\"zip_code\",\n\t\t\t},\n\t\t\t// List methods, Item fields, and keywords are not Address fields.\n\t\t\texpectedNotContains: []string{\"size\", \"all\", \"label\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Well-known type field: cursor at closing `\"` of `\"this.\"` on a\n\t\t\t// google.protobuf.Timestamp field. The proto fields (seconds, nanos)\n\t\t\t// and CEL Timestamp methods (getFullYear, getHours, etc.) should be offered.\n\t\t\t// This exercises the IR path for WKT completions, which is distinct from\n\t\t\t// the `now.` test that resolves Timestamp via the CEL static environment.\n\t\t\tname:      \"wkt_timestamp_field_dot_completions\",\n\t\t\tline:      165,\n\t\t\tcharacter: 22, // closing `\"` after `this.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"seconds\",\n\t\t\t\t\"nanos\",\n\t\t\t\t\"getFullYear\",\n\t\t\t\t\"getHours\",\n\t\t\t\t\"getMonth\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"city\", \"country\", \"zip_code\"},\n\t\t},\n\t\t{\n\t\t\t// Oneof field completions: cursor at closing `\"` of `\"this.\"` in a\n\t\t\t// message-level CEL rule. The oneof member fields (text, code, location)\n\t\t\t// are non-synthetic members in the proto IR and must appear as completions.\n\t\t\tname:      \"oneof_field_dot_completions\",\n\t\t\tline:      175,\n\t\t\tcharacter: 22, // closing `\"` after `this.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"text\",\n\t\t\t\t\"code\",\n\t\t\t\t\"location\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"true\", \"false\", \"null\", \"contains\", \"startsWith\"},\n\t\t},\n\t\t{\n\t\t\t// Repeated path: cursor at closing `\"` of `\"this.items.\"` in a message-level\n\t\t\t// CEL rule on RepeatedPathHolder. `this.items` is a repeated Address field,\n\t\t\t// so the receiver is a list — list methods and comprehension macros should be\n\t\t\t// offered, not Address field names.\n\t\t\tname:      \"repeated_path_dot_completions\",\n\t\t\tline:      193,\n\t\t\tcharacter: 28, // closing `\"` after `this.items.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"size\",\n\t\t\t\t\"filter\",\n\t\t\t\t\"all\",\n\t\t\t\t\"exists\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"city\", \"country\", \"zip_code\"},\n\t\t},\n\t\t{\n\t\t\t// Index access (list): cursor at closing `\"` of `\"this.items[0].\"` in a\n\t\t\t// message-level CEL rule on IndexAccessHolder. After indexing into the\n\t\t\t// repeated Address field, the receiver is an Address element — Address\n\t\t\t// field names should be offered.\n\t\t\tname:      \"index_access_list_completions\",\n\t\t\tline:      206,\n\t\t\tcharacter: 31, // closing `\"` after `this.items[0].`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t\t\"country\",\n\t\t\t\t\"zip_code\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"size\", \"all\", \"true\", \"false\"},\n\t\t},\n\t\t{\n\t\t\t// Index access (map): cursor at closing `\"` of `\"this.locations[\"key\"].\"` in a\n\t\t\t// message-level CEL rule on IndexAccessHolder. After indexing into the\n\t\t\t// map<string, Address> field, the receiver is an Address value — Address\n\t\t\t// field names should be offered, not map methods.\n\t\t\tname:      \"index_access_map_completions\",\n\t\t\tline:      210,\n\t\t\tcharacter: 41, // closing `\"` after `this.locations[\"key\"].`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t\t\"country\",\n\t\t\t\t\"zip_code\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"size\", \"all\", \"true\", \"false\"},\n\t\t},\n\t\t{\n\t\t\t// Chained comprehension: cursor at closing `\"` of\n\t\t\t// `\"this.items.filter(item, item.zip_code > 0).all(addr, addr.\"`.\n\t\t\t// The outer filter's result is a list of Address elements; `addr` in the\n\t\t\t// inner all() is bound to those elements. Address field names must appear\n\t\t\t// even though the range expression has a trailing `)` from the outer call.\n\t\t\tname:      \"chained_comprehension_iter_var\",\n\t\t\tline:      222,\n\t\t\tcharacter: 75, // closing `\"` after `...all(addr, addr.`\n\t\t\texpectedContains: []string{\n\t\t\t\t\"city\",\n\t\t\t\t\"country\",\n\t\t\t\t\"zip_code\",\n\t\t\t},\n\t\t\texpectedNotContains: []string{\"size\", \"all\", \"true\", \"false\", \"null\"},\n\t\t},\n\t\t{\n\t\t\t// Cursor at closing `\"` of `\"in\"` — prefix \"in\".\n\t\t\t// `in` is a CEL binary membership operator (\"value in list\"), not a\n\t\t\t// callable function. It must NOT appear as a function completion \"in()\".\n\t\t\tname:                \"in_operator_not_function_completion\",\n\t\t\tline:                232,\n\t\t\tcharacter:           19, // closing `\"` after `in`\n\t\t\texpectedNotContains: []string{\"in\"},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tvar completionList *protocol.CompletionList\n\t\t\t_, err := clientJSONConn.Call(ctx, protocol.MethodTextDocumentCompletion, protocol.CompletionParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &completionList)\n\t\t\trequire.NoError(t, err)\n\n\t\t\tif tt.noCompletions {\n\t\t\t\tassert.True(t,\n\t\t\t\t\tcompletionList == nil || len(completionList.Items) == 0,\n\t\t\t\t\t\"expected no completions mid-token, got %v\",\n\t\t\t\t\tfunc() []string {\n\t\t\t\t\t\tif completionList == nil {\n\t\t\t\t\t\t\treturn nil\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabels := make([]string, len(completionList.Items))\n\t\t\t\t\t\tfor i, item := range completionList.Items {\n\t\t\t\t\t\t\tlabels[i] = item.Label\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn labels\n\t\t\t\t\t}(),\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\trequire.NotNil(t, completionList, \"expected completion list to be non-nil\")\n\n\t\t\tlabels := make([]string, 0, len(completionList.Items))\n\t\t\tfor _, item := range completionList.Items {\n\t\t\t\tlabels = append(labels, item.Label)\n\t\t\t}\n\t\t\tfor _, expected := range tt.expectedContains {\n\t\t\t\tassert.Contains(t, labels, expected, \"expected completion list to contain %q\", expected)\n\t\t\t}\n\t\t\tfor _, notExpected := range tt.expectedNotContains {\n\t\t\t\tassert.NotContains(t, labels, notExpected, \"expected completion list to not contain %q\", notExpected)\n\t\t\t}\n\t\t\tfor label, wantDoc := range tt.expectedDocs {\n\t\t\t\tvar found bool\n\t\t\t\tfor _, item := range completionList.Items {\n\t\t\t\t\tif item.Label != label {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfound = true\n\t\t\t\t\tvar docStr string\n\t\t\t\t\tswitch doc := item.Documentation.(type) {\n\t\t\t\t\tcase string:\n\t\t\t\t\t\tdocStr = doc\n\t\t\t\t\tcase *protocol.MarkupContent:\n\t\t\t\t\t\tdocStr = doc.Value\n\t\t\t\t\tcase map[string]any:\n\t\t\t\t\t\t// After JSON round-trip through the LSP JSON-RPC layer,\n\t\t\t\t\t\t// *protocol.MarkupContent is decoded as a generic map.\n\t\t\t\t\t\tif v, ok := doc[\"value\"].(string); ok {\n\t\t\t\t\t\t\tdocStr = v\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tassert.Contains(t, docStr, wantDoc, \"item %q: expected documentation to contain %q\", label, wantDoc)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tassert.True(t, found, \"item %q not found in completion list for doc check\", label)\n\t\t\t}\n\t\t\tfor _, label := range tt.expectedDeprecated {\n\t\t\t\tvar found bool\n\t\t\t\tfor _, item := range completionList.Items {\n\t\t\t\t\tif item.Label != label {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tfound = true\n\t\t\t\t\tassert.True(t, item.Deprecated, \"item %q: expected Deprecated to be true\", label)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tassert.True(t, found, \"item %q not found in completion list for deprecated check\", label)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/completion_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestCompletion(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/completion/test.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\ttests := []struct {\n\t\tname                string\n\t\tline                uint32\n\t\tcharacter           uint32\n\t\texpectedContains    []string\n\t\texpectedNotContains []string\n\t\texpectNoCompletions bool\n\t}{\n\t\t{\n\t\t\tname:             \"complete_builtin_toplevel\",\n\t\t\tline:             5,\n\t\t\tcharacter:        1, // After the \"m\"\n\t\t\texpectedContains: []string{\"message\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_message_field_modifiers\",\n\t\t\tline:             9, // Empty line in User message where field modifier would go\n\t\t\tcharacter:        2, // Indented position where field modifier would be\n\t\t\texpectedContains: []string{\"map\", \"repeated\", \"optional\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_message_field_types\",\n\t\t\tline:             10, // Empty line in User message where field would go\n\t\t\tcharacter:        2,  // Indented position where field type would be\n\t\t\texpectedContains: []string{\"string\", \"int32\", \"int64\", \"bool\", \"bytes\", \"User\", \"GetUserRequest\", \"GetUserResponse\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_builtin_service\",\n\t\t\tline:             15,\n\t\t\tcharacter:        2, // Indented position where \"rpc\" would be\n\t\t\texpectedContains: []string{\"rpc\", \"option\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_rpc_request_type\",\n\t\t\tline:             14,\n\t\t\tcharacter:        uint32(len(\"  rpc GetUser(Get\") - 1),\n\t\t\texpectedContains: []string{\"GetUserRequest\", \"GetUserResponse\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_rpc_response_type\",\n\t\t\tline:             14,\n\t\t\tcharacter:        uint32(len(\"  rpc GetUser(Get) returns (Get\") - 1),\n\t\t\texpectedContains: []string{\"GetUserRequest\", \"GetUserResponse\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_field_number_after_reserved\",\n\t\t\tline:             32, // Line with \"User user =\"\n\t\t\tcharacter:        14, // After \"  User user = \"\n\t\t\texpectedContains: []string{\"6\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_field_number_after_reserved_with_semicolon\",\n\t\t\tline:             41, // Line with \"User user = ;\"\n\t\t\tcharacter:        14, // After \"  User user = \"\n\t\t\texpectedContains: []string{\"6\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_field_number_skips_protobuf_reserved_range\",\n\t\t\tline:             47, // Line with \"User user = ;\"\n\t\t\tcharacter:        14, // After \"  User user = \"\n\t\t\texpectedContains: []string{\"20000\"},\n\t\t},\n\t\t{\n\t\t\tname:                \"complete_absolute_type_reference\",\n\t\t\tline:                51, // Line with \".goo field_name = 1;\"\n\t\t\tcharacter:           4,  // After \".goo\"\n\t\t\texpectedContains:    []string{\".google.protobuf.Timestamp\", \".google.protobuf.Duration\", \".google.protobuf.Any\"},\n\t\t\texpectedNotContains: []string{\".example.v1.User\", \".example.v1.GetUserRequest\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_enum_number_basic\",\n\t\t\tline:             57, // Line with \"STATUS_NEW = \" (0-indexed)\n\t\t\tcharacter:        15, // After \"  STATUS_NEW = \"\n\t\t\texpectedContains: []string{\"2\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_enum_number_with_gaps\",\n\t\t\tline:             64, // Line with \"STATUS_NEW = ;\" (0-indexed)\n\t\t\tcharacter:        15, // After \"  STATUS_NEW = \"\n\t\t\texpectedContains: []string{\"2\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_enum_number_with_reserved\",\n\t\t\tline:             74, // Line with \"STATUS_NEW = ;\" (0-indexed from line 74)\n\t\t\tcharacter:        15, // After \"  STATUS_NEW = \"\n\t\t\texpectedContains: []string{\"6\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_enum_number_empty\",\n\t\t\tline:             78, // Line with \"STATUS_FIRST = ;\" in EmptyStatus (0-indexed from line 78)\n\t\t\tcharacter:        17, // After \"  STATUS_FIRST = \"\n\t\t\texpectedContains: []string{\"0\"},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvar completionList *protocol.CompletionList\n\t\t\t_, completionErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentCompletion, protocol.CompletionParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &completionList)\n\t\t\trequire.NoError(t, completionErr)\n\t\t\tif tt.expectNoCompletions {\n\t\t\t\tassert.Nil(t, completionList, \"expected no completions\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\trequire.NotNil(t, completionList, \"expected completion list to be non-nil\")\n\t\t\tlabels := make([]string, 0, len(completionList.Items))\n\t\t\tfor _, item := range completionList.Items {\n\t\t\t\tlabels = append(labels, item.Label)\n\t\t\t}\n\t\t\tfor _, expected := range tt.expectedContains {\n\t\t\t\tassert.Contains(t, labels, expected, \"expected completion list to contain %q\", expected)\n\t\t\t}\n\t\t\tfor _, notExpected := range tt.expectedNotContains {\n\t\t\t\tassert.NotContains(t, labels, notExpected, \"expected completion list to not contain %q\", notExpected)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestCompletionAfterUpdate(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\ttestProtoPath, err := filepath.Abs(\"testdata/completion/update_test.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\t// Send a didChange notification to mutate the file state.\n\t// This simulates a user typing \"str\" on a new field line within the User message.\n\t// We replace the entire content with an updated version that has \"  str\" added.\n\tupdatedContent := `syntax = \"proto3\";\n\npackage example.v1;\n\nmessage User {\n  string id = 1;\n  str\n}\n`\n\terr = clientJSONConn.Notify(ctx, protocol.MethodTextDocumentDidChange, &protocol.DidChangeTextDocumentParams{\n\t\tTextDocument: protocol.VersionedTextDocumentIdentifier{\n\t\t\tTextDocumentIdentifier: protocol.TextDocumentIdentifier{\n\t\t\t\tURI: testURI,\n\t\t\t},\n\t\t\tVersion: 2,\n\t\t},\n\t\tContentChanges: []protocol.TextDocumentContentChangeEvent{\n\t\t\t{\n\t\t\t\tText: updatedContent,\n\t\t\t},\n\t\t},\n\t})\n\trequire.NoError(t, err)\n\n\t// Now request completions at the position where we just inserted \"str\"\n\t// This should return completions for \"string\" and other types starting with \"str\"\n\tvar completionList *protocol.CompletionList\n\t_, completionErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentCompletion, protocol.CompletionParams{\n\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\tURI: testURI,\n\t\t\t},\n\t\t\tPosition: protocol.Position{\n\t\t\t\tLine:      6,\n\t\t\t\tCharacter: 5, // After \"  str\"\n\t\t\t},\n\t\t},\n\t}, &completionList)\n\trequire.NoError(t, completionErr)\n\trequire.NotNil(t, completionList, \"expected completion list to be non-nil after file update\")\n\n\t// Check that we get \"string\" as a completion option\n\tlabels := xslices.Map(completionList.Items, func(item protocol.CompletionItem) string {\n\t\treturn item.Label\n\t})\n\tassert.Contains(t, labels, \"string\", \"expected completion list to contain 'string' after partial edit\")\n}\n\nfunc TestCompletionMaps(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/completion/map_test.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\ttests := []struct {\n\t\tname                string\n\t\tline                uint32\n\t\tcharacter           uint32\n\t\texpectedContains    []string\n\t\texpectedNotContains []string\n\t}{\n\t\t{\n\t\t\tname:                \"complete_map_key_type_all\",\n\t\t\tline:                16, // Line with \"map<int32, string> field0 = 10;\"\n\t\t\tcharacter:           6,  // After \"  map<\" (no prefix)\n\t\t\texpectedContains:    []string{\"int32\", \"int64\", \"bool\", \"string\", \"uint32\", \"sint32\"},\n\t\t\texpectedNotContains: []string{\"float\", \"double\", \"bytes\"}, // Not allowed for map keys\n\t\t},\n\t\t{\n\t\t\tname:                \"complete_map_key_type_prefix\",\n\t\t\tline:                19,                                   // Line with \"map<int32, string> field1 = 1;\"\n\t\t\tcharacter:           7,                                    // After \"  map<i\"\n\t\t\texpectedContains:    []string{\"int32\", \"int64\"},           // Types starting with \"i\"\n\t\t\texpectedNotContains: []string{\"float\", \"double\", \"bytes\"}, // Not allowed for map keys\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_map_value_type_builtin\",\n\t\t\tline:             22, // Line with \"map<int32, string> field2 = 2;\"\n\t\t\tcharacter:        13, // After \"  map<int32, s\"\n\t\t\texpectedContains: []string{\"string\", \"sint32\", \"sint64\"},\n\t\t},\n\t\t{\n\t\t\tname:             \"complete_map_value_type_custom\",\n\t\t\tline:             25, // Line with \"map<string, User> field3 = 3;\"\n\t\t\tcharacter:        16, // After \"  map<string, U\"\n\t\t\texpectedContains: []string{\"User\"},\n\t\t},\n\t\t{\n\t\t\tname:                \"complete_map_key_type_no_enums_or_messages\",\n\t\t\tline:                28,                                              // Line with \"map<int32, string> field4 = 4;\"\n\t\t\tcharacter:           6,                                               // After \"  map<\" (no prefix)\n\t\t\texpectedContains:    []string{\"int32\", \"bool\"},                       // Valid map key types\n\t\t\texpectedNotContains: []string{\"User\", \"Status\", \"MapCompletionTest\"}, // Enums and messages not allowed\n\t\t},\n\t\t{\n\t\t\tname:                \"complete_map_key_type_incomplete_syntax\",\n\t\t\tline:                31,                                              // Line with \"map<, int32> attributes = 30;\"\n\t\t\tcharacter:           6,                                               // Right after \"  map<\" (at comma, since no space)\n\t\t\texpectedContains:    []string{\"int32\", \"bool\", \"string\"},             // Valid map key types\n\t\t\texpectedNotContains: []string{\"User\", \"Status\", \"MapCompletionTest\"}, // Enums and messages not allowed\n\t\t},\n\t\t{\n\t\t\tname:                \"complete_map_value_type_incomplete_syntax\",\n\t\t\tline:                34,                                   // Line with \"map<int32, > attributes2 = 31;\"\n\t\t\tcharacter:           13,                                   // Right after \"  map<int32, \" (before >)\n\t\t\texpectedContains:    []string{\"User\", \"Status\", \"string\"}, // All types allowed for value\n\t\t\texpectedNotContains: []string{},                           // No restrictions on value types\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvar completionList *protocol.CompletionList\n\t\t\t_, completionErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentCompletion, protocol.CompletionParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &completionList)\n\t\t\trequire.NoError(t, completionErr)\n\t\t\trequire.NotNil(t, completionList, \"expected completion list to be non-nil\")\n\t\t\tlabels := xslices.Map(completionList.Items, func(item protocol.CompletionItem) string {\n\t\t\t\treturn item.Label\n\t\t\t})\n\t\t\tfor _, expected := range tt.expectedContains {\n\t\t\t\tassert.Contains(t, labels, expected, \"expected completion list to contain %q\", expected)\n\t\t\t}\n\t\t\tfor _, notExpected := range tt.expectedNotContains {\n\t\t\t\tassert.NotContains(t, labels, notExpected, \"expected completion list to not contain %q\", notExpected)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestCompletionOptions(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/completion/options_test.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\ttests := []struct {\n\t\tname             string\n\t\tline             uint32\n\t\tcharacter        uint32\n\t\texpectedContains []string\n\t}{\n\t\t{\n\t\t\tname:      \"complete_file_options_builtin\",\n\t\t\tline:      6,\n\t\t\tcharacter: 8, // After \"option d\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"deprecated\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_file_options_custom\",\n\t\t\tline:      7,\n\t\t\tcharacter: 9, // After \"option (c\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_file_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_message_options_builtin\",\n\t\t\tline:      11,\n\t\t\tcharacter: 10, // After \"option d\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"deprecated\",\n\t\t\t\t\"deprecated_legacy_json_field_conflicts\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_message_options_custom\",\n\t\t\tline:      12,\n\t\t\tcharacter: 10, // After \"option (\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_message_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_field_options_builtin\",\n\t\t\tline:      14,\n\t\t\tcharacter: 26, // After \"[d\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"deprecated\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_field_options_custom\",\n\t\t\tline:      15,\n\t\t\tcharacter: 27, // After \"[(\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_field_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_field_options_newline_builtin\",\n\t\t\tline:      17,\n\t\t\tcharacter: 5, // After \"d\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"deprecated\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_field_options_newline_custom\",\n\t\t\tline:      20,\n\t\t\tcharacter: 5, // After \"(\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_field_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_enum_options_builtin\",\n\t\t\tline:      26,\n\t\t\tcharacter: 10, // After \"option a\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"allow_alias\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_enum_options_custom\",\n\t\t\tline:      27,\n\t\t\tcharacter: 10, // After \"option (\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_enum_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_enum_value_options_builtin\",\n\t\t\tline:      29,\n\t\t\tcharacter: 19, // After \"[d\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"deprecated\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_enum_value_options_custom\",\n\t\t\tline:      30,\n\t\t\tcharacter: 20, // After \"[(\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_enum_value_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_service_options_builtin\",\n\t\t\tline:      37,\n\t\t\tcharacter: 10, // After \"option d\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"deprecated\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_service_options_custom\",\n\t\t\tline:      38,\n\t\t\tcharacter: 10, // After \"option (\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_service_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_method_options_builtin\",\n\t\t\tline:      41,\n\t\t\tcharacter: 12, // After \"option i\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"idempotency_level\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_method_options_custom\",\n\t\t\tline:      42,\n\t\t\tcharacter: 12, // After \"option (\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"(example.options.custom_method_option)\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_path_field_1\",\n\t\t\tline:      48,\n\t\t\tcharacter: 28, // After \"(example.options.field).\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"recurse\", \"strings\", \"required\", \"number\", \"enum\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"complete_path_field_2\",\n\t\t\tline:      49,\n\t\t\tcharacter: 36, // After \"(example.options.field).recurse.\"\n\t\t\texpectedContains: []string{\n\t\t\t\t\"recurse\", \"strings\", \"required\", \"number\", \"enum\",\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\t// Request completions at the specified position in the static file\n\t\t\tvar completionList *protocol.CompletionList\n\t\t\t_, completionErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentCompletion, protocol.CompletionParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &completionList)\n\t\t\trequire.NoError(t, completionErr)\n\t\t\trequire.NotNil(t, completionList, \"expected completion list to be non-nil\")\n\n\t\t\t// Extract labels from completion items\n\t\t\tlabels := xslices.Map(completionList.Items, func(item protocol.CompletionItem) string {\n\t\t\t\treturn item.Label\n\t\t\t})\n\t\t\t// Verify expected options are present\n\t\t\tfor _, expected := range tt.expectedContains {\n\t\t\t\tassert.Contains(t, labels, expected, \"expected completion list to contain %q\", expected)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/definition_cel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/google/cel-go/cel\"\n\t\"github.com/google/cel-go/common/types\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// getCELDefinition returns the definition location for a CEL token at the given position.\n// If the cursor is over `this` in a CEL expression, it navigates to the field or message\n// that `this` refers to:\n//   - For field-level rules, `this` refers to the field being validated.\n//   - For message-level rules, `this` refers to the message being validated.\nfunc getCELDefinition(\n\tfile *file,\n\tposition protocol.Position,\n\tcelEnv *cel.Env,\n) *protocol.Location {\n\t// Convert position to byte offset.\n\tlineColumn := file.file.InverseLocation(int(position.Line)+1, int(position.Character)+1, positionalEncoding)\n\tbyteOffset := lineColumn.Offset\n\n\tfor _, sym := range file.symbols {\n\t\tcelExpressions := extractCELExpressions(file, sym)\n\t\tfor _, exprInfo := range celExpressions {\n\t\t\t// Check if cursor is within this CEL expression span.\n\t\t\tif byteOffset < exprInfo.span.Start || byteOffset >= exprInfo.span.End {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Calculate offset within the CEL expression.\n\t\t\tcelOffset := fileByteOffsetToCELOffset(byteOffset, exprInfo.span)\n\t\t\tif celOffset < 0 || celOffset >= len(exprInfo.expression) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Parse the CEL expression.\n\t\t\tparsedAST, parseIssues := celEnv.Parse(exprInfo.expression)\n\t\t\tif parseIssues.Err() != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Default to the parsed AST, but prefer the checked AST for full type information.\n\t\t\tastForTypeInfo := parsedAST\n\t\t\tvar typeMap map[int64]*types.Type\n\t\t\tif checkedAST, compileIssues := celEnv.Compile(exprInfo.expression); compileIssues.Err() == nil {\n\t\t\t\tastForTypeInfo = checkedAST\n\t\t\t\ttypeMap = checkedAST.NativeRep().TypeMap()\n\t\t\t}\n\n\t\t\t// Find the token at the cursor position.\n\t\t\thoverInfo := findCELTokenAtOffset(astForTypeInfo, parsedAST, celOffset, exprInfo, typeMap)\n\t\t\tif hoverInfo == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Determine what the token refers to and find the corresponding symbol.\n\t\t\tvar fullName ir.FullName\n\t\t\tswitch {\n\t\t\tcase hoverInfo.kind == celHoverKeyword && hoverInfo.text == \"this\":\n\t\t\t\tif !exprInfo.irMember.IsZero() {\n\t\t\t\t\t// Field-level CEL rule: `this` refers to the field being validated.\n\t\t\t\t\tfullName = exprInfo.irMember.FullName()\n\t\t\t\t} else if !exprInfo.thisIRType.IsZero() {\n\t\t\t\t\t// Message-level CEL rule: `this` refers to the message being validated.\n\t\t\t\t\tfullName = exprInfo.thisIRType.FullName()\n\t\t\t\t}\n\t\t\tcase hoverInfo.kind == celHoverField && !hoverInfo.protoMember.IsZero():\n\t\t\t\t// Field access (e.g. `this.name`): navigate to the proto field declaration.\n\t\t\t\tfullName = hoverInfo.protoMember.FullName()\n\t\t\t}\n\t\t\tif fullName == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Look up the symbol in the current file and workspace.\n\t\t\tdefSym := file.findSymbolByFullName(fullName)\n\t\t\tif defSym == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tloc := defSym.Definition()\n\t\t\treturn &loc\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/buflsp/definition_cel_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestCELDefinition(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/definition/cel_definition.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\ttests := []struct {\n\t\tname               string\n\t\tline               uint32\n\t\tcharacter          uint32\n\t\texpectedDefURI     protocol.URI\n\t\texpectedDefLine    uint32\n\t\texpectedDefCharMin uint32\n\t\texpectedDefCharMax uint32\n\t\texpectNoDefinition bool\n\t}{\n\t\t{\n\t\t\t// message-level: `this` in `expression: \"this.name.size() > 0\"` (line 10, 0-indexed)\n\t\t\t// refers to TestMessage, defined on line 7 (0-indexed).\n\t\t\tname:               \"message_level_this_navigates_to_message\",\n\t\t\tline:               10,\n\t\t\tcharacter:          17, // start of \"this\" in `    expression: \"this...\"`\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    7, // message TestMessage {\n\t\t\texpectedDefCharMin: 8, // \"TestMessage\" starts at char 8\n\t\t\texpectedDefCharMax: 19,\n\t\t},\n\t\t{\n\t\t\t// field-level: `this` in `expression: \"this.contains('@')\"` (line 20, 0-indexed)\n\t\t\t// refers to the email field, defined on line 18 (0-indexed).\n\t\t\tname:               \"field_level_this_navigates_to_field\",\n\t\t\tline:               20,\n\t\t\tcharacter:          17, // start of \"this\" in `    expression: \"this...\"`\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    18, // string email = 1 [...]\n\t\t\texpectedDefCharMin: 9,  // \"email\" starts at char 9\n\t\t\texpectedDefCharMax: 14,\n\t\t},\n\t\t{\n\t\t\t// `name` in `expression: \"this.name.size() > 0\"` (line 10, 0-indexed)\n\t\t\t// refers to the name field, defined on line 13 (0-indexed).\n\t\t\tname:               \"field_access_navigates_to_field_declaration\",\n\t\t\tline:               10,\n\t\t\tcharacter:          22, // start of \"name\" in `    expression: \"this.name...\"`\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    13, // string name = 1;\n\t\t\texpectedDefCharMin: 9,  // \"name\" starts at char 9\n\t\t\texpectedDefCharMax: 13,\n\t\t},\n\t\t{\n\t\t\t// oneof field-level: `this` in `expression: \"this.contains('@')\"` (line 31, 0-indexed)\n\t\t\t// refers to the email field inside the oneof, defined on line 28 (0-indexed).\n\t\t\tname:               \"oneof_field_level_this_navigates_to_oneof_field\",\n\t\t\tline:               30,\n\t\t\tcharacter:          19, // start of \"this\" in `      expression: \"this...\"`\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    28, // string email = 1 [(buf.validate.field).cel = {\n\t\t\texpectedDefCharMin: 11, // \"email\" starts at char 11 (inside oneof, 4-space indent)\n\t\t\texpectedDefCharMax: 16,\n\t\t},\n\t\t{\n\t\t\t// oneof message-level: `this` in `expression: \"this.name.size() > 0\"` (line 41, 0-indexed)\n\t\t\t// refers to TestOneofMessage, defined on line 37 (0-indexed).\n\t\t\tname:               \"oneof_message_level_this_navigates_to_message\",\n\t\t\tline:               40,\n\t\t\tcharacter:          17, // start of \"this\" in `    expression: \"this...\"`\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    37, // message TestOneofMessage {\n\t\t\texpectedDefCharMin: 8,  // \"TestOneofMessage\" starts at char 8\n\t\t\texpectedDefCharMax: 24,\n\t\t},\n\t\t{\n\t\t\t// oneof message-level: `name` in `expression: \"this.name.size() > 0\"` (line 41, 0-indexed)\n\t\t\t// refers to the name field inside the oneof, defined on line 44 (0-indexed).\n\t\t\tname:               \"oneof_field_access_navigates_to_oneof_field\",\n\t\t\tline:               40,\n\t\t\tcharacter:          22, // start of \"name\" in `    expression: \"this.name...\"`\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    44, // string name = 1;\n\t\t\texpectedDefCharMin: 11, // \"name\" starts at char 11 (inside oneof, 4-space indent)\n\t\t\texpectedDefCharMax: 15,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvar locations []protocol.Location\n\t\t\t_, defErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentDefinition, protocol.DefinitionParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &locations)\n\t\t\trequire.NoError(t, defErr)\n\n\t\t\tif tt.expectNoDefinition {\n\t\t\t\tassert.Empty(t, locations, \"expected no definition locations\")\n\t\t\t} else {\n\t\t\t\trequire.Len(t, locations, 1, \"expected exactly one definition location\")\n\t\t\t\tlocation := locations[0]\n\t\t\t\tassert.Equal(t, tt.expectedDefURI, location.URI)\n\t\t\t\tassert.Equal(t, tt.expectedDefLine, location.Range.Start.Line)\n\t\t\t\tassert.GreaterOrEqual(t, location.Range.Start.Character, tt.expectedDefCharMin)\n\t\t\t\tassert.LessOrEqual(t, location.Range.Start.Character, tt.expectedDefCharMax)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/definition_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestDefinition(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/definition/definition.proto\")\n\trequire.NoError(t, err)\n\n\ttypesProtoPath, err := filepath.Abs(\"testdata/definition/types.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\ttypesURI := buflsp.FilePathToURI(typesProtoPath)\n\n\ttests := []struct {\n\t\tname               string\n\t\tline               uint32\n\t\tcharacter          uint32\n\t\texpectedDefURI     protocol.URI\n\t\texpectedDefLine    uint32\n\t\texpectedDefCharMin uint32\n\t\texpectedDefCharMax uint32\n\t\texpectNoDefinition bool\n\t}{\n\t\t{\n\t\t\tname:               \"definition_of_account_type_reference\",\n\t\t\tline:               12, // Line with \"AccountType type = 2;\"\n\t\t\tcharacter:          2,  // On \"AccountType\" type\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    52, // enum AccountType definition (line 53 in file)\n\t\t\texpectedDefCharMin: 5,\n\t\t\texpectedDefCharMax: 16,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_person_type_reference\",\n\t\t\tline:               15, // Line with \"Person owner = 3;\"\n\t\t\tcharacter:          2,  // On \"Person\" type\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    28, // message Person definition (line 29 in file)\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 14,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_address_type_reference\",\n\t\t\tline:               36, // Line with \"Address address = 3;\"\n\t\t\tcharacter:          2,  // On \"Address\" type\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    40, // message Address definition (line 41 in file)\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 15,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_country_code_reference\",\n\t\t\tline:               48, // Line with \"CountryCode country = 3;\"\n\t\t\tcharacter:          2,  // On \"CountryCode\" type\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    64, // enum CountryCode definition (line 65 in file)\n\t\t\texpectedDefCharMin: 5,\n\t\t\texpectedDefCharMax: 16,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_rpc_request_type\",\n\t\t\tline:               78, // Line with \"rpc GetAccount(GetAccountRequest)\"\n\t\t\tcharacter:          18, // On \"GetAccountRequest\"\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    85, // message GetAccountRequest definition (line 86 in file)\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 25,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_rpc_response_type\",\n\t\t\tline:               78, // Line with \"returns (GetAccountResponse)\"\n\t\t\tcharacter:          45, // On \"GetAccountResponse\"\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    91, // message GetAccountResponse definition (line 92 in file)\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 26,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_account_field_in_request\",\n\t\t\tline:               99, // Line with \"Account account = 1;\" in CreateAccountRequest\n\t\t\tcharacter:          2,  // On \"Account\" type\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    7, // message Account definition\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 15,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_field_name\",\n\t\t\tline:               12, // Line with \"AccountType type = 2;\"\n\t\t\tcharacter:          14, // On \"type\" field name\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    12,\n\t\t\texpectedDefCharMin: 14,\n\t\t\texpectedDefCharMax: 18,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_service\",\n\t\t\tline:               76, // Line with \"service AccountService {\"\n\t\t\tcharacter:          8,  // On \"AccountService\"\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    76, // service AccountService (line 77 in file)\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 22,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_status_imported_type\",\n\t\t\tline:               18, // Line with \"Status status = 4;\"\n\t\t\tcharacter:          2,  // On \"Status\" type\n\t\t\texpectedDefURI:     typesURI,\n\t\t\texpectedDefLine:    5, // enum Status definition in types.proto\n\t\t\texpectedDefCharMin: 5,\n\t\t\texpectedDefCharMax: 11,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_timestamp_imported_type\",\n\t\t\tline:               21, // Line with \"Timestamp created_at = 5;\"\n\t\t\tcharacter:          2,  // On \"Timestamp\" type\n\t\t\texpectedDefURI:     typesURI,\n\t\t\texpectedDefLine:    17, // message Timestamp definition in types.proto\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 17,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_syntax_keyword\",\n\t\t\tline:               0, // Line with \"syntax = \"proto3\";\"\n\t\t\tcharacter:          0, // On \"syntax\"\n\t\t\texpectNoDefinition: true,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_package_keyword\",\n\t\t\tline:               2, // Line with \"package definition.v1;\"\n\t\t\tcharacter:          0, // On \"package\"\n\t\t\texpectNoDefinition: true,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_package_name\",\n\t\t\tline:               2, // Line with \"package definition.v1;\"\n\t\t\tcharacter:          8, // On \"definition\"\n\t\t\texpectNoDefinition: true,\n\t\t},\n\t\t{\n\t\t\tname:               \"definition_of_map_value_type\",\n\t\t\tline:               24, // Line with \"map<string, Person> metadata = 6;\"\n\t\t\tcharacter:          16, // On \"Person\" in map value type\n\t\t\texpectedDefURI:     testURI,\n\t\t\texpectedDefLine:    28, // message Person definition\n\t\t\texpectedDefCharMin: 8,\n\t\t\texpectedDefCharMax: 14,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvar locations []protocol.Location\n\t\t\t_, defErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentDefinition, protocol.DefinitionParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &locations)\n\t\t\trequire.NoError(t, defErr)\n\n\t\t\tif tt.expectNoDefinition {\n\t\t\t\tassert.Empty(t, locations, \"expected no definition locations\")\n\t\t\t} else {\n\t\t\t\trequire.Len(t, locations, 1, \"expected exactly one definition location\")\n\t\t\t\tlocation := locations[0]\n\t\t\t\tassert.Equal(t, tt.expectedDefURI, location.URI)\n\t\t\t\tassert.Equal(t, tt.expectedDefLine, location.Range.Start.Line)\n\t\t\t\tassert.GreaterOrEqual(t, location.Range.Start.Character, tt.expectedDefCharMin)\n\t\t\t\tassert.LessOrEqual(t, location.Range.Start.Character, tt.expectedDefCharMax)\n\t\t\t}\n\t\t})\n\t}\n}\n\n// TestDefinitionURLEncoding verifies that file paths with special characters\n// like '@' are properly URL-encoded in the URI responses.\nfunc TestDefinitionURLEncoding(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\t// Use a file from a directory with '@' in the path\n\ttestProtoPath, err := filepath.Abs(\"testdata/uri@encode/test.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\t// Note: The client may send URIs with unencoded @ symbols, but the LSP\n\t// server normalizes them internally to ensure consistency\n\n\t// Test definition lookup for a type reference within the same file\n\tvar locations []protocol.Location\n\t_, defErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentDefinition, protocol.DefinitionParams{\n\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\tURI: testURI,\n\t\t\t},\n\t\t\tPosition: protocol.Position{\n\t\t\t\tLine:      13, // Line with \"Status status = 3;\" (0-indexed, line 14 in file)\n\t\t\t\tCharacter: 2,  // On \"Status\" type\n\t\t\t},\n\t\t},\n\t}, &locations)\n\trequire.NoError(t, defErr)\n\n\trequire.Len(t, locations, 1, \"expected exactly one definition location\")\n\tlocation := locations[0]\n\n\texpectedURI := buflsp.FilePathToURI(testProtoPath)\n\n\tassert.Equal(t, expectedURI, location.URI, \"returned URI should have @ encoded as %40\")\n\n\t// Verify it points to the correct location in the file\n\tassert.Equal(t, uint32(17), location.Range.Start.Line, \"should point to Status enum definition (0-indexed, line 18 in file)\")\n}\n"
  },
  {
    "path": "private/buf/buflsp/deprecate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file implements the deprecation code action using direct text insertion.\n\npackage buflsp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// getDeprecateCodeAction generates a code action for deprecating the symbol at the given range.\n// It returns nil if no deprecation action is available for the position.\nfunc (s *server) getDeprecateCodeAction(\n\tctx context.Context,\n\tfile *file,\n\tparams *protocol.CodeActionParams,\n) *protocol.CodeAction {\n\ts.logger.DebugContext(ctx, \"deprecate: checking code action\",\n\t\tslog.String(\"uri\", string(params.TextDocument.URI)),\n\t\tslog.Uint64(\"line\", uint64(params.Range.Start.Line)),\n\t\tslog.Uint64(\"char\", uint64(params.Range.Start.Character)),\n\t)\n\tif file.workspace == nil || file.ir == nil {\n\t\ts.logger.DebugContext(ctx, \"deprecate: no workspace or IR\")\n\t\treturn nil\n\t}\n\n\tfqnPrefix, title := getDeprecationTarget(ctx, file, params.Range.Start)\n\tif fqnPrefix == \"\" {\n\t\ts.logger.DebugContext(ctx, \"deprecate: no deprecation target\")\n\t\treturn nil\n\t}\n\ts.logger.DebugContext(\n\t\tctx, \"deprecate: generating edits\",\n\t\tslog.String(\"fqn_prefix\", string(fqnPrefix)),\n\t\tslog.String(\"title\", title),\n\t)\n\n\t// Generate workspace-wide edits for all types matching the FQN prefix.\n\tchecker := newFullNameMatcher(fqnPrefix)\n\tedits := make(map[protocol.DocumentURI][]protocol.TextEdit)\n\tfor _, wsFile := range file.workspace.PathToFile() {\n\t\tif wsFile.ir == nil {\n\t\t\tcontinue\n\t\t}\n\t\tfileEdits := generateDeprecationEdits(wsFile, checker)\n\t\tif len(fileEdits) > 0 {\n\t\t\tedits[wsFile.uri] = fileEdits\n\t\t}\n\t}\n\tif len(edits) == 0 {\n\t\ts.logger.DebugContext(ctx, \"deprecate: no edits generated\")\n\t\treturn nil\n\t}\n\ts.logger.DebugContext(\n\t\tctx, \"deprecate: returning code action\",\n\t\tslog.Int(\"edit_count\", len(edits)),\n\t)\n\treturn &protocol.CodeAction{\n\t\tTitle: title,\n\t\tKind:  protocol.RefactorRewrite,\n\t\tEdit:  &protocol.WorkspaceEdit{Changes: edits},\n\t}\n}\n\n// getDeprecationTarget determines what FQN prefix to deprecate based on the position.\n// Returns the FQN prefix and a human-readable title for the code action.\nfunc getDeprecationTarget(ctx context.Context, file *file, position protocol.Position) (ir.FullName, string) {\n\t// Get the symbol at the cursor position.\n\tsymbol := file.SymbolAt(ctx, position)\n\tif symbol == nil {\n\t\tastFile := file.ir.AST()\n\t\tif astFile == nil {\n\t\t\treturn \"\", \"\"\n\t\t}\n\t\tpkgDecl := astFile.Package()\n\t\tif pkgDecl.IsZero() {\n\t\t\treturn \"\", \"\"\n\t\t}\n\t\t// Check if cursor is within the package declaration span.\n\t\tpkgSpan := pkgDecl.Span()\n\t\toffset := positionToOffset(file, position)\n\t\tif offsetInSpan(offset, pkgSpan) != 0 {\n\t\t\treturn \"\", \"\"\n\t\t}\n\t\tcursorLine := int(position.Line) + 1 // Convert 0-indexed to 1-indexed\n\t\tif cursorLine < pkgSpan.StartLoc().Line || cursorLine > pkgSpan.EndLoc().Line {\n\t\t\treturn \"\", \"\"\n\t\t}\n\t\tpkg := file.ir.Package()\n\t\treturn pkg, fmt.Sprintf(\"Deprecate package %s\", pkg)\n\t}\n\tif symbol.ir.IsZero() {\n\t\treturn \"\", \"\"\n\t}\n\tfqn := symbol.ir.FullName()\n\tif fqn == \"\" {\n\t\treturn \"\", \"\"\n\t}\n\tswitch symbol.ir.Kind() {\n\tcase ir.SymbolKindMessage:\n\t\treturn fqn, fmt.Sprintf(\"Deprecate message %s\", fqn)\n\tcase ir.SymbolKindEnum:\n\t\treturn fqn, fmt.Sprintf(\"Deprecate enum %s\", fqn)\n\tcase ir.SymbolKindService:\n\t\treturn fqn, fmt.Sprintf(\"Deprecate service %s\", fqn)\n\tcase ir.SymbolKindMethod:\n\t\treturn fqn, fmt.Sprintf(\"Deprecate method %s\", fqn)\n\tcase ir.SymbolKindField:\n\t\treturn fqn, fmt.Sprintf(\"Deprecate field %s\", fqn)\n\tcase ir.SymbolKindEnumValue:\n\t\treturn fqn, fmt.Sprintf(\"Deprecate enum value %s\", fqn)\n\tcase ir.SymbolKindOneof:\n\t\treturn fqn, fmt.Sprintf(\"Deprecate oneof %s\", fqn)\n\tdefault:\n\t\treturn \"\", \"\"\n\t}\n}\n\n// generateDeprecationEdits generates TextEdits to add deprecation options for all\n// types in a file that match the deprecation checker's FQN prefixes.\nfunc generateDeprecationEdits(file *file, checker *fullNameMatcher) []protocol.TextEdit {\n\tvar edits []protocol.TextEdit\n\t// Check file-level deprecation (for package-level deprecation)\n\tpkgFQN := getPackageFQN(file)\n\tif len(pkgFQN) > 0 && checker.matchesPrefix(pkgFQN) {\n\t\tif edit := deprecateFile(file); edit != nil {\n\t\t\tedits = append(edits, *edit)\n\t\t}\n\t}\n\t// Check messages and enums\n\tfor typ := range seq.Values(file.ir.AllTypes()) {\n\t\tfqn := typ.FullName()\n\t\tif checker.matchesPrefix(fqn) {\n\t\t\tif edit := deprecateType(file, typ); edit != nil {\n\t\t\t\tedits = append(edits, *edit)\n\t\t\t}\n\t\t}\n\t}\n\t// Check services\n\tfor svc := range seq.Values(file.ir.Services()) {\n\t\tfqn := svc.FullName()\n\t\tif checker.matchesPrefix(fqn) {\n\t\t\tif edit := deprecateService(file, svc); edit != nil {\n\t\t\t\tedits = append(edits, *edit)\n\t\t\t}\n\t\t}\n\t\t// Check methods\n\t\tfor method := range seq.Values(svc.Methods()) {\n\t\t\tmethodFQN := method.FullName()\n\t\t\tif checker.matchesPrefix(methodFQN) {\n\t\t\t\tif edit := deprecateMethod(file, method); edit != nil {\n\t\t\t\t\tedits = append(edits, *edit)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Check fields and enum values (exact match only)\n\tfor member := range file.ir.AllMembers() {\n\t\tfqn := member.FullName()\n\t\tif checker.matchesExact(fqn) {\n\t\t\tif edit := deprecateMember(file, member); edit != nil {\n\t\t\t\tedits = append(edits, *edit)\n\t\t\t}\n\t\t}\n\t}\n\treturn edits\n}\n\n// getPackageFQN extracts the package FQN components from a file.\nfunc getPackageFQN(file *file) ir.FullName {\n\tif file.ir == nil {\n\t\treturn \"\"\n\t}\n\treturn file.ir.Package()\n}\n\n// getSpanIndentation returns the leading whitespace of the first line of a span.\nfunc getSpanIndentation(span source.Span) string {\n\tloc := span.StartLoc()\n\tif loc.Line < 1 {\n\t\treturn \"\"\n\t}\n\ttext := span.File.Text()\n\tlines := strings.Split(text, \"\\n\")\n\tif loc.Line > len(lines) {\n\t\treturn \"\"\n\t}\n\tline := lines[loc.Line-1]\n\tvar indent strings.Builder\n\tfor _, ch := range line {\n\t\tif ch == ' ' || ch == '\\t' {\n\t\t\tindent.WriteRune(ch)\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn indent.String()\n}\n\n// deprecateFile generates a TextEdit to insert \"option deprecated = true;\"\n// at the file level (after the package declaration).\nfunc deprecateFile(file *file) *protocol.TextEdit {\n\t// Check semantic value first\n\tif deprecated, ok := file.ir.Deprecated().AsBool(); ok && deprecated {\n\t\treturn nil\n\t}\n\tastFile := file.ir.AST()\n\tif astFile == nil {\n\t\treturn nil\n\t}\n\n\t// Check AST for existing file-level deprecated option\n\tif hasDeprecatedOption(astFile.Decls()) {\n\t\treturn nil\n\t}\n\n\t// Find the insertion point after package or syntax declaration\n\tvar insertSpan source.Span\n\tpkgDecl := astFile.Package()\n\tif !pkgDecl.IsZero() {\n\t\tinsertSpan = pkgDecl.Span()\n\t} else {\n\t\tsyntaxDecl := astFile.Syntax()\n\t\tif !syntaxDecl.IsZero() {\n\t\t\tinsertSpan = syntaxDecl.Span()\n\t\t} else {\n\t\t\t// No package or syntax - insert at start of file\n\t\t\treturn &protocol.TextEdit{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 0, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 0, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"option deprecated = true;\\n\",\n\t\t\t}\n\t\t}\n\t}\n\t// Insert after the end of the declaration (with blank line for readability)\n\tinsertLocation := insertSpan.File.Location(insertSpan.End, positionalEncoding)\n\treturn &protocol.TextEdit{\n\t\tRange:   reportLocationsToProtocolRange(insertLocation, insertLocation),\n\t\tNewText: \"\\n\\noption deprecated = true;\",\n\t}\n}\n\n// deprecateType generates a TextEdit to add \"option deprecated = true;\"\n// inside a message or enum definition.\nfunc deprecateType(file *file, typ ir.Type) *protocol.TextEdit {\n\t// Check semantic value first (handles deprecated = true)\n\tif deprecated, ok := typ.Deprecated().AsBool(); ok && deprecated {\n\t\treturn nil\n\t}\n\tdeclDef := typ.AST()\n\tif declDef.IsZero() {\n\t\treturn nil\n\t}\n\t// Also check AST for any existing deprecated option (handles deprecated = false)\n\tbody := declDef.Body()\n\tif !body.IsZero() && hasDeprecatedOption(body.Decls()) {\n\t\treturn nil\n\t}\n\treturn deprecateDeclWithBody(file, declDef)\n}\n\n// deprecateService generates a TextEdit to add \"option deprecated = true;\"\n// inside a service definition.\nfunc deprecateService(file *file, svc ir.Service) *protocol.TextEdit {\n\tif deprecated, ok := svc.Deprecated().AsBool(); ok && deprecated {\n\t\treturn nil\n\t}\n\n\tdeclDef := svc.AST()\n\tif declDef.IsZero() {\n\t\treturn nil\n\t}\n\n\tbody := declDef.Body()\n\tif !body.IsZero() && hasDeprecatedOption(body.Decls()) {\n\t\treturn nil\n\t}\n\n\treturn deprecateDeclWithBody(file, declDef)\n}\n\n// deprecateMethod generates a TextEdit to add \"option deprecated = true;\"\n// inside an RPC method definition.\nfunc deprecateMethod(file *file, method ir.Method) *protocol.TextEdit {\n\tif deprecated, ok := method.Deprecated().AsBool(); ok && deprecated {\n\t\treturn nil\n\t}\n\n\tdeclDef := method.AST()\n\tif declDef.IsZero() {\n\t\treturn nil\n\t}\n\n\tbody := declDef.Body()\n\tif body.IsZero() {\n\t\t// Method has no body (ends with semicolon), need to add braces and option\n\t\treturn deprecateMethodWithoutBody(file, declDef)\n\t}\n\n\tif hasDeprecatedOption(body.Decls()) {\n\t\treturn nil\n\t}\n\n\treturn deprecateDeclWithBody(file, declDef)\n}\n\n// hasDeprecatedOption checks if declarations contain an \"option deprecated\" declaration.\nfunc hasDeprecatedOption(decls seq.Inserter[ast.DeclAny]) bool {\n\tfor decl := range seq.Values(decls) {\n\t\tdef := decl.AsDef()\n\t\tif def.IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\t// Check if this is an \"option\" declaration with name \"deprecated\"\n\t\ttypePath := def.Type().AsPath()\n\t\tif typePath.IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\tif !typePath.Path.IsIdents(\"option\") {\n\t\t\tcontinue\n\t\t}\n\t\t// Check if the option name is \"deprecated\"\n\t\tnamePath := def.Name()\n\t\tif namePath.IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\tif namePath.IsIdents(\"deprecated\") {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// deprecateDeclWithBody generates a TextEdit for a declaration that has a body.\n// It inserts \"option deprecated = true;\" right after the opening brace.\nfunc deprecateDeclWithBody(file *file, declDef ast.DeclDef) *protocol.TextEdit {\n\tbody := declDef.Body()\n\tif body.IsZero() {\n\t\treturn nil\n\t}\n\n\t// Get the opening brace position (Braces() returns a fused token pair)\n\tbraceToken := body.Braces()\n\tif braceToken.IsZero() {\n\t\treturn nil\n\t}\n\n\t// Get the opening and closing braces\n\topenBrace, closeBrace := braceToken.StartEnd()\n\tif openBrace.IsZero() {\n\t\treturn nil\n\t}\n\n\t// Calculate indent: declaration indent + one level (2 spaces)\n\tdeclIndent := getSpanIndentation(declDef.Span())\n\tbodyIndent := declIndent + \"  \"\n\topenBraceSpan := openBrace.LeafSpan()\n\n\t// Check if braces are on the same line (empty or single-line body like `{}`)\n\t// If so, we need to add a trailing newline + indent for the closing brace\n\tvar newText string\n\tif !closeBrace.IsZero() {\n\t\tcloseBraceSpan := closeBrace.LeafSpan()\n\t\tif closeBraceSpan.StartLoc().Line == openBraceSpan.EndLoc().Line {\n\t\t\t// Same line: insert option with newlines to properly format\n\t\t\tnewText = \"\\n\" + bodyIndent + \"option deprecated = true;\\n\" + declIndent\n\t\t} else {\n\t\t\t// Different lines: just insert the option\n\t\t\tnewText = \"\\n\" + bodyIndent + \"option deprecated = true;\"\n\t\t}\n\t} else {\n\t\tnewText = \"\\n\" + bodyIndent + \"option deprecated = true;\"\n\t}\n\n\tinsertLocation := openBraceSpan.File.Location(openBraceSpan.End, positionalEncoding)\n\treturn &protocol.TextEdit{\n\t\tRange:   reportLocationsToProtocolRange(insertLocation, insertLocation),\n\t\tNewText: newText,\n\t}\n}\n\n// deprecateMethodWithoutBody handles methods that don't have a body yet.\n// It replaces the trailing semicolon with a body containing the deprecation option.\nfunc deprecateMethodWithoutBody(file *file, declDef ast.DeclDef) *protocol.TextEdit {\n\t// Find the semicolon at the end of the declaration\n\tsemi := declDef.Semicolon()\n\tif semi.IsZero() {\n\t\treturn nil\n\t}\n\n\t// Calculate indent\n\tdeclIndent := getSpanIndentation(declDef.Span())\n\tbodyIndent := declIndent + \"  \"\n\n\t// Replace the semicolon with a body block\n\tsemiSpan := semi.Span()\n\treturn &protocol.TextEdit{\n\t\tRange:   reportSpanToProtocolRange(semiSpan),\n\t\tNewText: \" {\\n\" + bodyIndent + \"option deprecated = true;\\n\" + declIndent + \"}\",\n\t}\n}\n\n// deprecateMember generates a TextEdit to add \"[deprecated = true]\"\n// to a field or enum value using compact options.\nfunc deprecateMember(file *file, member ir.Member) *protocol.TextEdit {\n\tif _, ok := member.Deprecated().AsBool(); ok {\n\t\treturn nil\n\t}\n\tdeclDef := member.AST()\n\tif declDef.IsZero() {\n\t\treturn nil\n\t}\n\n\t// Check if there are existing compact options\n\topts := declDef.Options()\n\tif !opts.IsZero() {\n\t\topenBracket, closeBracket := opts.Brackets().StartEnd()\n\t\topenBracketSpan := openBracket.LeafSpan()\n\t\tcloseBracketSpan := closeBracket.LeafSpan()\n\n\t\t// Check if options span multiple lines\n\t\tisMultiLine := openBracketSpan.StartLoc().Line != closeBracketSpan.StartLoc().Line\n\n\t\tif isMultiLine {\n\t\t\t// Multi-line options: insert after the last entry with proper formatting\n\t\t\tentries := opts.Entries()\n\t\t\tif entries.Len() > 0 {\n\t\t\t\tlastIdx := entries.Len() - 1\n\t\t\t\tlastEntry := entries.At(lastIdx)\n\t\t\t\tlastEntrySpan := lastEntry.Span()\n\n\t\t\t\t// Get indentation from the last entry\n\t\t\t\tindent := getSpanIndentation(lastEntrySpan)\n\n\t\t\t\t// Check if there's already a comma after the last entry\n\t\t\t\texistingComma := entries.Comma(lastIdx)\n\t\t\t\tvar newText string\n\t\t\t\tvar insertSpan source.Span\n\n\t\t\t\tif existingComma.IsZero() {\n\t\t\t\t\t// No comma - insert after the last entry value\n\t\t\t\t\tinsertSpan = lastEntrySpan\n\t\t\t\t\tnewText = \",\\n\" + indent + \"deprecated = true\"\n\t\t\t\t} else {\n\t\t\t\t\t// Has comma - insert after the comma\n\t\t\t\t\tinsertSpan = existingComma.LeafSpan()\n\t\t\t\t\tnewText = \"\\n\" + indent + \"deprecated = true\"\n\t\t\t\t}\n\n\t\t\t\tinsertLocation := insertSpan.File.Location(insertSpan.End, positionalEncoding)\n\t\t\t\treturn &protocol.TextEdit{\n\t\t\t\t\tRange:   reportLocationsToProtocolRange(insertLocation, insertLocation),\n\t\t\t\t\tNewText: newText,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Single-line options: insert \", deprecated = true\" before the closing bracket\n\t\tinsertLocation := closeBracketSpan.File.Location(closeBracketSpan.Start, positionalEncoding)\n\t\treturn &protocol.TextEdit{\n\t\t\tRange:   reportLocationsToProtocolRange(insertLocation, insertLocation),\n\t\t\tNewText: \", deprecated = true\",\n\t\t}\n\t}\n\n\t// No existing options - insert \"[deprecated = true]\" before the semicolon\n\tsemi := declDef.Semicolon()\n\tif semi.IsZero() {\n\t\treturn nil\n\t}\n\tsemiSpan := semi.Span()\n\tinsertLocation := semiSpan.File.Location(semiSpan.Start, positionalEncoding)\n\treturn &protocol.TextEdit{\n\t\tRange:   reportLocationsToProtocolRange(insertLocation, insertLocation),\n\t\tNewText: \" [deprecated = true]\",\n\t}\n}\n\n// fullNameMatcher determines which types should have deprecated options added.\ntype fullNameMatcher struct {\n\tprefixes []ir.FullName\n}\n\n// newFullNameMatcher creates a new matcher for the given FQN prefixes.\nfunc newFullNameMatcher(fqnPrefixes ...ir.FullName) *fullNameMatcher {\n\treturn &fullNameMatcher{prefixes: fqnPrefixes}\n}\n\n// matchesPrefix returns true if the given FQN matches using prefix matching.\nfunc (d *fullNameMatcher) matchesPrefix(fqn ir.FullName) bool {\n\tfor _, prefix := range d.prefixes {\n\t\tif fqnMatchesPrefix(fqn, prefix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// matchesExact returns true if the given FQN matches exactly.\nfunc (d *fullNameMatcher) matchesExact(fqn ir.FullName) bool {\n\treturn slices.Contains(d.prefixes, fqn)\n}\n\n// fqnMatchesPrefix returns true if fqn starts with prefix using component-based matching.\nfunc fqnMatchesPrefix(fqn, prefix ir.FullName) bool {\n\tif len(prefix) > len(fqn) {\n\t\treturn false\n\t}\n\tif len(prefix) == len(fqn) {\n\t\treturn fqn == prefix\n\t}\n\treturn strings.HasPrefix(string(fqn), string(prefix)+\".\")\n}\n"
  },
  {
    "path": "private/buf/buflsp/deprecate_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestCodeAction_Deprecate(t *testing.T) {\n\tt.Parallel()\n\n\t// Test: Deprecate message at cursor on \"MyMessage\" (line 5)\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/message_test.proto\",\n\t\t4, 8, // Line 5, on \"MyMessage\" (0-indexed: line 4)\n\t\t\"Deprecate message test.deprecate.MyMessage\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert \"option deprecated = true;\" after opening brace on line 5\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 19},\n\t\t\t\t\tEnd:   protocol.Position{Line: 4, Character: 19},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Deprecate enum at cursor on \"MyEnum\" (line 10)\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/message_test.proto\",\n\t\t9, 5, // Line 10, on \"MyEnum\" (0-indexed: line 9)\n\t\t\"Deprecate enum test.deprecate.MyEnum\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert \"option deprecated = true;\" after opening brace on line 10\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 9, Character: 13},\n\t\t\t\t\tEnd:   protocol.Position{Line: 9, Character: 13},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Deprecate service at cursor on \"MyService\" (line 15)\n\t// Service deprecation also deprecates the method\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/message_test.proto\",\n\t\t14, 8, // Line 15, on \"MyService\" (0-indexed: line 14)\n\t\t\"Deprecate service test.deprecate.MyService\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert \"option deprecated = true;\" in service body\n\t\t\t// Line 15: \"service MyService {\" - { is at char 18, insert at 19\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 14, Character: 19},\n\t\t\t\t\tEnd:   protocol.Position{Line: 14, Character: 19},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\",\n\t\t\t},\n\t\t\t// Replace method semicolon with body containing deprecation\n\t\t\t// Line 16: \"  rpc GetMessage(MyMessage) returns (MyMessage);\" - ; is at char 47\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 15, Character: 47},\n\t\t\t\t\tEnd:   protocol.Position{Line: 15, Character: 48},\n\t\t\t\t},\n\t\t\t\tNewText: \" {\\n    option deprecated = true;\\n  }\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: No action on whitespace (empty line after package)\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/message_test.proto\",\n\t\t3, 0, // Line 4, empty line (0-indexed: line 3)\n\t\t\"\", // No action expected\n\t\tnil,\n\t)\n\n\t// Test: Deprecate nested message \"Inner\" - verifies 4-space indentation\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/nested_test.proto\",\n\t\t7, 10, // Line 8, on \"Inner\" (0-indexed: line 7)\n\t\t\"Deprecate message test.deprecate.nested.Outer.Inner\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Inner message - Line 8: \"  message Inner {\" - insert at 17\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 7, Character: 17},\n\t\t\t\t\tEnd:   protocol.Position{Line: 7, Character: 17},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n    option deprecated = true;\",\n\t\t\t},\n\t\t\t// NestedEnum - Line 11: \"    enum NestedEnum {\" - insert at 21\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 10, Character: 21},\n\t\t\t\t\tEnd:   protocol.Position{Line: 10, Character: 21},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n      option deprecated = true;\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Deprecate doubly-nested enum \"NestedEnum\" - verifies 6-space indentation\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/nested_test.proto\",\n\t\t10, 9, // Line 11, on \"NestedEnum\" (0-indexed: line 10)\n\t\t\"Deprecate enum test.deprecate.nested.Outer.Inner.NestedEnum\",\n\t\t[]protocol.TextEdit{\n\t\t\t// NestedEnum - Line 11: \"    enum NestedEnum {\" - insert at 21\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 10, Character: 21},\n\t\t\t\t\tEnd:   protocol.Position{Line: 10, Character: 21},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n      option deprecated = true;\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Deprecate parent \"Outer\" - deprecates all nested types but NOT fields/enum values\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/nested_test.proto\",\n\t\t4, 8, // Line 5, on \"Outer\" (0-indexed: line 4)\n\t\t\"Deprecate message test.deprecate.nested.Outer\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Outer message - Line 5: \"message Outer {\" - insert at 15\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 15},\n\t\t\t\t\tEnd:   protocol.Position{Line: 4, Character: 15},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\",\n\t\t\t},\n\t\t\t// Inner message - Line 8: \"  message Inner {\" - insert at 17\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 7, Character: 17},\n\t\t\t\t\tEnd:   protocol.Position{Line: 7, Character: 17},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n    option deprecated = true;\",\n\t\t\t},\n\t\t\t// NestedEnum - Line 11: \"    enum NestedEnum {\" - insert at 21\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 10, Character: 21},\n\t\t\t\t\tEnd:   protocol.Position{Line: 10, Character: 21},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n      option deprecated = true;\",\n\t\t\t},\n\t\t\t// OuterEnum - Line 16: \"  enum OuterEnum {\" - insert at 18\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 15, Character: 18},\n\t\t\t\t\tEnd:   protocol.Position{Line: 15, Character: 18},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n    option deprecated = true;\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Deprecate package - deprecates file + all types\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/nested_test.proto\",\n\t\t2, 8, // Line 3, on package name (0-indexed: line 2)\n\t\t\"Deprecate package test.deprecate.nested\",\n\t\t[]protocol.TextEdit{\n\t\t\t// File-level deprecated option (after package declaration with blank line)\n\t\t\t// Line 3: \"package test.deprecate.nested;\" - insert at 30\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 2, Character: 30},\n\t\t\t\t\tEnd:   protocol.Position{Line: 2, Character: 30},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n\\noption deprecated = true;\",\n\t\t\t},\n\t\t\t// Outer message - Line 5: \"message Outer {\" - insert at 15\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 15},\n\t\t\t\t\tEnd:   protocol.Position{Line: 4, Character: 15},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\",\n\t\t\t},\n\t\t\t// Inner message - Line 8: \"  message Inner {\" - insert at 17\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 7, Character: 17},\n\t\t\t\t\tEnd:   protocol.Position{Line: 7, Character: 17},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n    option deprecated = true;\",\n\t\t\t},\n\t\t\t// NestedEnum - Line 11: \"    enum NestedEnum {\" - insert at 21\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 10, Character: 21},\n\t\t\t\t\tEnd:   protocol.Position{Line: 10, Character: 21},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n      option deprecated = true;\",\n\t\t\t},\n\t\t\t// OuterEnum - Line 16: \"  enum OuterEnum {\" - insert at 18\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 15, Character: 18},\n\t\t\t\t\tEnd:   protocol.Position{Line: 15, Character: 18},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n    option deprecated = true;\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Empty body message `{}` - must insert with proper newlines\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t5, 8, // Line 6, on \"EmptyMessage\" (0-indexed: line 5)\n\t\t\"Deprecate message test.deprecate.edge.EmptyMessage\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert after `{`, add newlines to format properly\n\t\t\t// Result: message EmptyMessage {\\n  option deprecated = true;\\n}\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 22},\n\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 22},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\\n\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Empty body with space `{ }` - similar handling\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t8, 8, // Line 9, on \"EmptyWithSpace\" (0-indexed: line 8)\n\t\t\"Deprecate message test.deprecate.edge.EmptyWithSpace\",\n\t\t[]protocol.TextEdit{\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 8, Character: 24},\n\t\t\t\t\tEnd:   protocol.Position{Line: 8, Character: 24},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\\n\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Already deprecated - no edit for this message\n\ttestCodeActionDeprecateNoEdit(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t11, 8, // Line 12, on \"AlreadyDeprecated\" (0-indexed: line 11)\n\t)\n\n\t// Test: Deprecated = false - no edit (don't conflict with explicit false)\n\ttestCodeActionDeprecateNoEdit(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t16, 8, // Line 17, on \"DeprecatedFalse\" (0-indexed: line 16)\n\t)\n\n\t// Test: Nested empty body message\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t26, 8, // Line 27, on \"OuterWithEmpty\" (0-indexed: line 26)\n\t\t\"Deprecate message test.deprecate.edge.OuterWithEmpty\",\n\t\t[]protocol.TextEdit{\n\t\t\t// OuterWithEmpty - Line 27: \"message OuterWithEmpty {\" - insert at 24\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 26, Character: 24},\n\t\t\t\t\tEnd:   protocol.Position{Line: 26, Character: 24},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n  option deprecated = true;\",\n\t\t\t},\n\t\t\t// NestedEmpty - Line 28: \"  message NestedEmpty {}\" - insert at 23\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 27, Character: 23},\n\t\t\t\t\tEnd:   protocol.Position{Line: 27, Character: 23},\n\t\t\t\t},\n\t\t\t\tNewText: \"\\n    option deprecated = true;\\n  \",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Multi-line options on enum value (no trailing comma)\n\t// Should add comma after last option and insert on new line\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t38, 2, // Line 39, on \"MULTI_LINE_OPTIONS_ONE\" (0-indexed: line 38)\n\t\t\"Deprecate enum value test.deprecate.edge.MULTI_LINE_OPTIONS_ONE\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert after \"debug_redact = true\" on line 40\n\t\t\t// Line 40: \"    debug_redact = true\" - ends at char 23\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 39, Character: 23},\n\t\t\t\t\tEnd:   protocol.Position{Line: 39, Character: 23},\n\t\t\t\t},\n\t\t\t\tNewText: \",\\n    deprecated = true\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Multi-line options on field (no trailing comma on last option)\n\t// Should add comma after last option and insert on new line\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t45, 9, // Line 46, on \"name\" field (0-indexed: line 45)\n\t\t\"Deprecate field test.deprecate.edge.FieldWithMultiLineOptions.name\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert after \"debug_redact = true\" on line 48\n\t\t\t// Line 48: \"    debug_redact = true\" - ends at char 23\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 47, Character: 23},\n\t\t\t\t\tEnd:   protocol.Position{Line: 47, Character: 23},\n\t\t\t\t},\n\t\t\t\tNewText: \",\\n    deprecated = true\",\n\t\t\t},\n\t\t},\n\t)\n\n\t// Test: Single-line options on enum value\n\t// Should insert \", deprecated = true\" before closing bracket\n\ttestCodeActionDeprecate(\n\t\tt,\n\t\t\"testdata/deprecate/edge_cases_test.proto\",\n\t\t54, 2, // Line 55, on \"SINGLE_LINE_OPTIONS_ONE\" (0-indexed: line 54)\n\t\t\"Deprecate enum value test.deprecate.edge.SINGLE_LINE_OPTIONS_ONE\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert before \"]\" on line 55\n\t\t\t// Line 55: \"  SINGLE_LINE_OPTIONS_ONE = 1 [debug_redact = true];\"\n\t\t\t// The \"]\" is at char 50\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 54, Character: 50},\n\t\t\t\t\tEnd:   protocol.Position{Line: 54, Character: 50},\n\t\t\t\t},\n\t\t\t\tNewText: \", deprecated = true\",\n\t\t\t},\n\t\t},\n\t)\n}\n\n// testCodeActionDeprecate tests that a deprecation code action at the given position\n// produces the expected edits. Use expectedTitle=\"\" and expectedEdits=nil to test\n// that no action is offered.\nfunc testCodeActionDeprecate(\n\tt *testing.T,\n\tfilename string,\n\tcursorLine, cursorChar uint32,\n\texpectedTitle string,\n\texpectedEdits []protocol.TextEdit,\n) {\n\tt.Helper()\n\tname := filename\n\tif expectedTitle != \"\" {\n\t\tname = expectedTitle\n\t}\n\tt.Run(name, func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestProtoPath, err := filepath.Abs(filename)\n\t\trequire.NoError(t, err)\n\n\t\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\t\tvar codeActions []protocol.CodeAction\n\t\t_, err = clientJSONConn.Call(t.Context(), protocol.MethodTextDocumentCodeAction, protocol.CodeActionParams{\n\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\tURI: testURI,\n\t\t\t},\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: protocol.Position{Line: cursorLine, Character: cursorChar},\n\t\t\t\tEnd:   protocol.Position{Line: cursorLine, Character: cursorChar},\n\t\t\t},\n\t\t\tContext: protocol.CodeActionContext{\n\t\t\t\tOnly: []protocol.CodeActionKind{\n\t\t\t\t\tprotocol.RefactorRewrite,\n\t\t\t\t},\n\t\t\t},\n\t\t}, &codeActions)\n\t\trequire.NoError(t, err)\n\n\t\t// Find the deprecate code action\n\t\tvar deprecateAction *protocol.CodeAction\n\t\tfor _, codeAction := range codeActions {\n\t\t\tif codeAction.Kind == protocol.RefactorRewrite {\n\t\t\t\tdeprecateAction = &codeAction\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// If no action expected, verify none found\n\t\tif expectedTitle == \"\" && expectedEdits == nil {\n\t\t\tassert.Nil(t, deprecateAction, \"expected no deprecate code action\")\n\t\t\treturn\n\t\t}\n\n\t\trequire.NotNil(t, deprecateAction, \"expected deprecate code action, got none\")\n\t\tassert.Equal(t, expectedTitle, deprecateAction.Title)\n\t\tassert.Equal(t, protocol.RefactorRewrite, deprecateAction.Kind)\n\n\t\trequire.NotNil(t, deprecateAction.Edit, \"code action should have workspace edit\")\n\t\trequire.NotNil(t, deprecateAction.Edit.Changes, \"workspace edit should have changes\")\n\n\t\tactualEdits, ok := deprecateAction.Edit.Changes[testURI]\n\t\trequire.True(t, ok, \"workspace edit should have changes for current file\")\n\t\trequire.Len(t, actualEdits, len(expectedEdits), \"edit count mismatch\")\n\n\t\tfor i, expected := range expectedEdits {\n\t\t\tactual := actualEdits[i]\n\t\t\tassert.Equal(t, expected.Range, actual.Range, \"edit %d: range mismatch\", i)\n\t\t\tassert.Equal(t, expected.NewText, actual.NewText, \"edit %d: newText mismatch\", i)\n\t\t}\n\t})\n}\n\n// testCodeActionDeprecateNoEdit tests that a deprecation code action is either not offered\n// or produces no edits for the target (e.g., already deprecated or deprecated=false).\nfunc testCodeActionDeprecateNoEdit(\n\tt *testing.T,\n\tfilename string,\n\tcursorLine, cursorChar uint32,\n) {\n\tt.Helper()\n\tt.Run(filename, func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestProtoPath, err := filepath.Abs(filename)\n\t\trequire.NoError(t, err)\n\n\t\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\t\tvar codeActions []protocol.CodeAction\n\t\t_, err = clientJSONConn.Call(t.Context(), protocol.MethodTextDocumentCodeAction, protocol.CodeActionParams{\n\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\tURI: testURI,\n\t\t\t},\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: protocol.Position{Line: cursorLine, Character: cursorChar},\n\t\t\t\tEnd:   protocol.Position{Line: cursorLine, Character: cursorChar},\n\t\t\t},\n\t\t\tContext: protocol.CodeActionContext{\n\t\t\t\tOnly: []protocol.CodeActionKind{\n\t\t\t\t\tprotocol.RefactorRewrite,\n\t\t\t\t},\n\t\t\t},\n\t\t}, &codeActions)\n\t\trequire.NoError(t, err)\n\n\t\t// Find the deprecate code action\n\t\tvar deprecateAction *protocol.CodeAction\n\t\tfor _, codeAction := range codeActions {\n\t\t\tif codeAction.Kind == protocol.RefactorRewrite {\n\t\t\t\tdeprecateAction = &codeAction\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\t// Either no action, or action with no edits for the target\n\t\tif deprecateAction == nil {\n\t\t\treturn // No action offered is acceptable\n\t\t}\n\n\t\t// If action offered, verify no edits that add deprecation\n\t\tif deprecateAction.Edit != nil && deprecateAction.Edit.Changes != nil {\n\t\t\tedits := deprecateAction.Edit.Changes[testURI]\n\t\t\tfor _, edit := range edits {\n\t\t\t\tassert.NotContains(t, edit.NewText, \"option deprecated = true;\",\n\t\t\t\t\t\"should not add deprecation to already deprecated or deprecated=false type\")\n\t\t\t}\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "private/buf/buflsp/diagnostic.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file provides helpers for bridging protocompile and LSP diagnostics.\n\npackage buflsp\n\nimport (\n\t\"github.com/bufbuild/protocompile/experimental/report\"\n\t\"github.com/bufbuild/protocompile/experimental/report/tags\"\n\t\"github.com/bufbuild/protocompile/experimental/source/length\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// UTF-16 is the default per LSP spec. Position encoding negotiation is not yet\n// supported by the go.lsp.dev/protocol library.\n// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#position\nconst positionalEncoding = length.UTF16\n\n// reportLevelToDiagnosticSeverity is a mapping of [report.Level] to [protocol.DiagnosticSeverity].\nvar reportLevelToDiagnosticSeverity = map[report.Level]protocol.DiagnosticSeverity{\n\treport.ICE:     protocol.DiagnosticSeverityError,\n\treport.Error:   protocol.DiagnosticSeverityError,\n\treport.Warning: protocol.DiagnosticSeverityWarning,\n\treport.Remark:  protocol.DiagnosticSeverityInformation,\n}\n\n// reportDiagnosticToProtocolDiagnostic takes a [report.Diagnostic] and returns the\n// corresponding [protocol.Diagnostic].\nfunc reportDiagnosticToProtocolDiagnostic(\n\treportDiagnostic report.Diagnostic,\n) protocol.Diagnostic {\n\tdiagnostic := protocol.Diagnostic{\n\t\tSource:   serverName,\n\t\tSeverity: reportLevelToDiagnosticSeverity[reportDiagnostic.Level()],\n\t\tMessage:  reportDiagnostic.Message(),\n\t}\n\tif primary := reportDiagnostic.Primary(); !primary.IsZero() {\n\t\tstartLocation := primary.Location(primary.Start, positionalEncoding)\n\t\tendLocation := primary.Location(primary.End, positionalEncoding)\n\t\tdiagnostic.Range = protocol.Range{\n\t\t\tStart: protocol.Position{\n\t\t\t\tLine:      uint32(startLocation.Line - 1),\n\t\t\t\tCharacter: uint32(startLocation.Column - 1),\n\t\t\t},\n\t\t\tEnd: protocol.Position{\n\t\t\t\tLine:      uint32(endLocation.Line - 1),\n\t\t\t\tCharacter: uint32(endLocation.Column - 1),\n\t\t\t},\n\t\t}\n\t}\n\tswitch reportDiagnostic.Tag() {\n\tcase tags.UnusedImport:\n\t\tdiagnostic.Tags = []protocol.DiagnosticTag{\n\t\t\tprotocol.DiagnosticTagUnnecessary,\n\t\t}\n\tcase tags.Deprecated:\n\t\tdiagnostic.Tags = []protocol.DiagnosticTag{\n\t\t\tprotocol.DiagnosticTagDeprecated,\n\t\t}\n\t}\n\treturn diagnostic\n}\n"
  },
  {
    "path": "private/buf/buflsp/diagnostics_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\t\"testing\"\n\t\"testing/synctest\"\n\t\"time\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/buf/bufctl\"\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/bufbuild/buf/private/buf/bufwkt/bufwktstore\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/httpauth\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"github.com/bufbuild/protocompile/experimental/incremental\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/jsonrpc2\"\n\t\"go.lsp.dev/protocol\"\n\t\"go.lsp.dev/uri\"\n)\n\n// setupLSPServerWithDiagnostics creates and initializes an LSP server for testing with diagnostic capture.\nfunc setupLSPServerWithDiagnostics(\n\tt *testing.T,\n\ttestProtoPath string,\n) (jsonrpc2.Conn, protocol.URI, *diagnosticsCapture) {\n\tt.Helper()\n\n\tctx := t.Context()\n\n\tlogger := slogtestext.NewLogger(t, slogtestext.WithLogLevel(appext.LogLevelInfo))\n\n\tappContainer, err := app.NewContainerForOS()\n\trequire.NoError(t, err)\n\n\tnameContainer, err := appext.NewNameContainer(appContainer, \"buf-test\")\n\trequire.NoError(t, err)\n\tappextContainer := appext.NewContainer(nameContainer, logger)\n\n\tgraphProvider := bufmodule.NopGraphProvider\n\tmoduleDataProvider := bufmodule.NopModuleDataProvider\n\tcommitProvider := bufmodule.NopCommitProvider\n\tpluginKeyProvider := bufplugin.NopPluginKeyProvider\n\tpluginDataProvider := bufplugin.NopPluginDataProvider\n\tpolicyKeyProvider := bufpolicy.NopPolicyKeyProvider\n\tpolicyDataProvider := bufpolicy.NopPolicyDataProvider\n\n\ttmpDir := t.TempDir()\n\tstorageBucket, err := storageos.NewProvider().NewReadWriteBucket(tmpDir)\n\trequire.NoError(t, err)\n\n\twktStore := bufwktstore.NewStore(logger, storageBucket)\n\n\tcontroller, err := bufctl.NewController(\n\t\tlogger,\n\t\tappContainer,\n\t\tgraphProvider,\n\t\tnopModuleKeyProvider{},\n\t\tmoduleDataProvider,\n\t\tcommitProvider,\n\t\tpluginKeyProvider,\n\t\tpluginDataProvider,\n\t\tpolicyKeyProvider,\n\t\tpolicyDataProvider,\n\t\twktStore,\n\t\t&http.Client{},\n\t\thttpauth.NewNopAuthenticator(),\n\t\tgit.ClonerOptions{},\n\t)\n\trequire.NoError(t, err)\n\n\twktBucket, err := wktStore.GetBucket(ctx)\n\trequire.NoError(t, err)\n\n\twasmRuntime, err := wasm.NewRuntime(ctx)\n\trequire.NoError(t, err)\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, wasmRuntime.Close(ctx))\n\t})\n\n\tqueryExecutor := incremental.New()\n\n\tserverConn, clientConn := net.Pipe()\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, serverConn.Close())\n\t\trequire.NoError(t, clientConn.Close())\n\t})\n\n\tstream := jsonrpc2.NewStream(serverConn)\n\n\tconn, err := buflsp.Serve(\n\t\tctx,\n\t\t\"test\",\n\t\twktBucket,\n\t\tappextContainer,\n\t\tcontroller,\n\t\twasmRuntime,\n\t\tstream,\n\t\tqueryExecutor,\n\t)\n\trequire.NoError(t, err)\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, conn.Close())\n\t})\n\n\tcapture := newDiagnosticsCapture()\n\n\tclientStream := jsonrpc2.NewStream(clientConn)\n\tclientJSONConn := jsonrpc2.NewConn(clientStream)\n\tclientJSONConn.Go(ctx, jsonrpc2.AsyncHandler(capture.handle))\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, clientJSONConn.Close())\n\t})\n\n\ttestWorkspaceDir := filepath.Dir(testProtoPath)\n\ttestURI := buflsp.FilePathToURI(testProtoPath)\n\tvar initResult protocol.InitializeResult\n\t_, initErr := clientJSONConn.Call(ctx, protocol.MethodInitialize, &protocol.InitializeParams{\n\t\tRootURI: uri.New(testWorkspaceDir),\n\t\tCapabilities: protocol.ClientCapabilities{\n\t\t\tTextDocument: &protocol.TextDocumentClientCapabilities{},\n\t\t},\n\t}, &initResult)\n\trequire.NoError(t, initErr)\n\n\terr = clientJSONConn.Notify(ctx, protocol.MethodInitialized, &protocol.InitializedParams{})\n\trequire.NoError(t, err)\n\n\ttestProtoContent, err := os.ReadFile(testProtoPath)\n\trequire.NoError(t, err)\n\n\terr = clientJSONConn.Notify(ctx, protocol.MethodTextDocumentDidOpen, &protocol.DidOpenTextDocumentParams{\n\t\tTextDocument: protocol.TextDocumentItem{\n\t\t\tURI:        testURI,\n\t\t\tLanguageID: \"protobuf\",\n\t\t\tVersion:    1,\n\t\t\tText:       string(testProtoContent),\n\t\t},\n\t})\n\trequire.NoError(t, err)\n\n\treturn clientJSONConn, testURI, capture\n}\n\n// TestDiagnostics tests various diagnostic scenarios published by the LSP server.\n// Each subtest uses synctest to provide deterministic timing for async diagnostics.\nfunc TestDiagnostics(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tname                string\n\t\tprotoFile           string\n\t\texpectedDiagnostics []protocol.Diagnostic\n\t}{\n\t\t{\n\t\t\tname:                \"valid_proto_no_diagnostics\",\n\t\t\tprotoFile:           \"testdata/diagnostics/valid.proto\",\n\t\t\texpectedDiagnostics: []protocol.Diagnostic{},\n\t\t},\n\t\t{\n\t\t\tname:      \"syntax_error_diagnostic\",\n\t\t\tprotoFile: \"testdata/diagnostics/syntax_error.proto\",\n\t\t\texpectedDiagnostics: []protocol.Diagnostic{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 8, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 8, Character: 0},\n\t\t\t\t\t},\n\t\t\t\t\tSeverity: protocol.DiagnosticSeverityError,\n\t\t\t\t\tSource:   \"buf-lsp\",\n\t\t\t\t\tMessage:  \"syntax error: expecting ';'\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"unused_import_diagnostic_with_tag\",\n\t\t\tprotoFile: \"testdata/diagnostics/unused_import.proto\",\n\t\t\texpectedDiagnostics: []protocol.Diagnostic{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 4, Character: 41},\n\t\t\t\t\t},\n\t\t\t\t\tSeverity: protocol.DiagnosticSeverityWarning,\n\t\t\t\t\tCode:     \"IMPORT_USED\",\n\t\t\t\t\tCodeDescription: &protocol.CodeDescription{\n\t\t\t\t\t\tHref: \"https://buf.build/docs/lint/rules/#import_used\",\n\t\t\t\t\t},\n\t\t\t\t\tSource:  \"buf lint\",\n\t\t\t\t\tMessage: `Import \"google/protobuf/timestamp.proto\" is unused.`,\n\t\t\t\t\tTags:    []protocol.DiagnosticTag{protocol.DiagnosticTagUnnecessary},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"unresolved_import_diagnostic\",\n\t\t\tprotoFile: \"testdata/diagnostics/unresolved_import.proto\",\n\t\t\texpectedDiagnostics: []protocol.Diagnostic{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 7},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 28},\n\t\t\t\t\t},\n\t\t\t\t\tSeverity: protocol.DiagnosticSeverityError,\n\t\t\t\t\tSource:   \"buf-lsp\",\n\t\t\t\t\tMessage:  `does/not/exist.proto: file does not exist`,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tsynctest.Test(t, func(t *testing.T) {\n\t\t\t\tprotoPath, err := filepath.Abs(tt.protoFile)\n\t\t\t\trequire.NoError(t, err)\n\n\t\t\t\t_, testURI, capture := setupLSPServerWithDiagnostics(t, protoPath)\n\n\t\t\t\t// Wait for diagnostics to be published\n\t\t\t\ttimeout := 5 * time.Second\n\t\t\t\tif len(tt.expectedDiagnostics) > 0 {\n\t\t\t\t\ttimeout = 10 * time.Second // Lint checks take longer\n\t\t\t\t}\n\t\t\t\tdiagnostics := capture.wait(t, testURI, timeout, func(p *protocol.PublishDiagnosticsParams) bool {\n\t\t\t\t\treturn len(p.Diagnostics) >= len(tt.expectedDiagnostics)\n\t\t\t\t})\n\n\t\t\t\trequire.NotNil(t, diagnostics, \"expected diagnostics to be published\")\n\t\t\t\tassert.Equal(t, testURI, diagnostics.URI)\n\n\t\t\t\t// Check that we have the expected number of diagnostics\n\t\t\t\trequire.Len(t, diagnostics.Diagnostics, len(tt.expectedDiagnostics),\n\t\t\t\t\t\"expected %d diagnostic(s), got %d\", len(tt.expectedDiagnostics), len(diagnostics.Diagnostics))\n\n\t\t\t\t// Compare each diagnostic directly\n\t\t\t\tfor i, expected := range tt.expectedDiagnostics {\n\t\t\t\t\tactual := diagnostics.Diagnostics[i]\n\t\t\t\t\tassert.Equal(t, expected, actual, \"diagnostic %d mismatch\", i)\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n}\n\n// TestDiagnosticsUpdate tests that diagnostics are updated when file content changes.\n// Uses synctest to provide deterministic timing for the async diagnostic updates.\nfunc TestDiagnosticsUpdate(t *testing.T) {\n\tt.Parallel()\n\n\tsynctest.Test(t, func(t *testing.T) {\n\t\tprotoPath, err := filepath.Abs(\"testdata/diagnostics/valid.proto\")\n\t\trequire.NoError(t, err)\n\n\t\tclientJSONConn, testURI, capture := setupLSPServerWithDiagnostics(t, protoPath)\n\n\t\tctx := t.Context()\n\n\t\t// Wait for initial diagnostics (should be empty for valid file)\n\t\tinitialDiagnostics := capture.wait(t, testURI, 5*time.Second, func(p *protocol.PublishDiagnosticsParams) bool {\n\t\t\treturn true // Accept any diagnostics\n\t\t})\n\t\trequire.NotNil(t, initialDiagnostics)\n\t\tassert.Empty(t, initialDiagnostics.Diagnostics, \"expected no initial diagnostics for valid file\")\n\n\t\t// Update the file with invalid content (missing semicolon)\n\t\tinvalidContent := `syntax = \"proto3\";\n\npackage diagnostics.v1;\n\nmessage TestMessage {\n  string name = 1\n  // Missing semicolon above\n}\n`\n\n\t\terr = clientJSONConn.Notify(ctx, protocol.MethodTextDocumentDidChange, &protocol.DidChangeTextDocumentParams{\n\t\t\tTextDocument: protocol.VersionedTextDocumentIdentifier{\n\t\t\t\tTextDocumentIdentifier: protocol.TextDocumentIdentifier{\n\t\t\t\t\tURI: testURI,\n\t\t\t\t},\n\t\t\t\tVersion: 2,\n\t\t\t},\n\t\t\tContentChanges: []protocol.TextDocumentContentChangeEvent{\n\t\t\t\t{\n\t\t\t\t\tText: invalidContent,\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\trequire.NoError(t, err)\n\n\t\t// Wait for updated diagnostics with version 2 and at least one error\n\t\tupdatedDiagnostics := capture.wait(t, testURI, 5*time.Second, func(p *protocol.PublishDiagnosticsParams) bool {\n\t\t\treturn p.Version == 2 && len(p.Diagnostics) > 0\n\t\t})\n\t\trequire.NotNil(t, updatedDiagnostics)\n\t\tassert.Equal(t, uint32(2), updatedDiagnostics.Version, \"expected diagnostics version to match file version\")\n\t\tassert.NotEmpty(t, updatedDiagnostics.Diagnostics, \"expected diagnostics after introducing syntax error\")\n\n\t\tif len(updatedDiagnostics.Diagnostics) > 0 {\n\t\t\tassert.Equal(t, protocol.DiagnosticSeverityError, updatedDiagnostics.Diagnostics[0].Severity)\n\t\t}\n\t})\n}\n\n// diagnosticsCapture captures publishDiagnostics notifications from the LSP server.\ntype diagnosticsCapture struct {\n\tmu          sync.Mutex\n\tdiagnostics map[protocol.URI]*protocol.PublishDiagnosticsParams\n}\n\nfunc newDiagnosticsCapture() *diagnosticsCapture {\n\treturn &diagnosticsCapture{\n\t\tdiagnostics: make(map[protocol.URI]*protocol.PublishDiagnosticsParams),\n\t}\n}\n\nfunc (dc *diagnosticsCapture) handle(_ context.Context, reply jsonrpc2.Replier, req jsonrpc2.Request) error {\n\tif req.Method() == protocol.MethodTextDocumentPublishDiagnostics {\n\t\tvar params protocol.PublishDiagnosticsParams\n\t\tif err := json.Unmarshal(req.Params(), &params); err == nil {\n\t\t\tdc.mu.Lock()\n\t\t\tdc.diagnostics[params.URI] = &params\n\t\t\tdc.mu.Unlock()\n\t\t}\n\t}\n\treturn reply(context.Background(), nil, nil)\n}\n\n// wait polls for diagnostics matching the predicate.\nfunc (dc *diagnosticsCapture) wait(t *testing.T, uri protocol.URI, timeout time.Duration, pred func(*protocol.PublishDiagnosticsParams) bool) *protocol.PublishDiagnosticsParams {\n\tt.Helper()\n\n\trequire.Eventually(t, func() bool {\n\t\tdc.mu.Lock()\n\t\tparams := dc.diagnostics[uri]\n\t\tdc.mu.Unlock()\n\t\treturn params != nil && pred(params)\n\t}, timeout, 50*time.Millisecond, \"timeout waiting for diagnostics matching predicate\")\n\n\tdc.mu.Lock()\n\tdefer dc.mu.Unlock()\n\treturn dc.diagnostics[uri]\n}\n"
  },
  {
    "path": "private/buf/buflsp/document_highlight_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"slices\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n\t\"go.lsp.dev/uri\"\n)\n\nfunc TestDocumentHighlight(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/document_highlight/highlight.proto\")\n\trequire.NoError(t, err)\n\n\ttypesProtoPath, err := filepath.Abs(\"testdata/document_highlight/types.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\ttypesURI := uri.New(typesProtoPath)\n\n\ttype highlightLocation struct {\n\t\tline           uint32\n\t\tstartCharacter uint32\n\t\tendCharacter   uint32\n\t\tkind           protocol.DocumentHighlightKind\n\t}\n\ttests := []struct {\n\t\tname               string\n\t\ttargetURI          protocol.URI\n\t\tline               uint32\n\t\tcharacter          uint32\n\t\texpectedHighlights []highlightLocation\n\t}{\n\t\t{\n\t\t\tname:      \"highlight_product_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      7,\n\t\t\tcharacter: 8,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 7, startCharacter: 8, endCharacter: 15, kind: protocol.DocumentHighlightKindText},    // message Product (definition)\n\t\t\t\t{line: 11, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product related\n\t\t\t\t{line: 16, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product products in Catalog\n\t\t\t\t{line: 33, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in GetProductResponse\n\t\t\t\t{line: 41, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product products in ListProductsResponse\n\t\t\t\t{line: 49, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in StreamProductsResponse\n\t\t\t\t{line: 53, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in UploadProductsRequest\n\t\t\t\t{line: 65, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in DownloadProductsResponse\n\t\t\t\t{line: 117, startCharacter: 14, endCharacter: 21, kind: protocol.DocumentHighlightKindText}, // Product in map<string, Product>\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_from_reference\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      11,\n\t\t\tcharacter: 11,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 7, startCharacter: 8, endCharacter: 15, kind: protocol.DocumentHighlightKindText},    // message Product (definition)\n\t\t\t\t{line: 11, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product related\n\t\t\t\t{line: 16, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product products in Catalog\n\t\t\t\t{line: 33, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in GetProductResponse\n\t\t\t\t{line: 41, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product products in ListProductsResponse\n\t\t\t\t{line: 49, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in StreamProductsResponse\n\t\t\t\t{line: 53, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in UploadProductsRequest\n\t\t\t\t{line: 65, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in DownloadProductsResponse\n\t\t\t\t{line: 117, startCharacter: 14, endCharacter: 21, kind: protocol.DocumentHighlightKindText}, // Product in map<string, Product>\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_catalog_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      14,\n\t\t\tcharacter: 8,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 14, startCharacter: 8, endCharacter: 15, kind: protocol.DocumentHighlightKindText}, // message Catalog (definition)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_category_enum_from_types\",\n\t\t\ttargetURI: typesURI,\n\t\t\tline:      4,\n\t\t\tcharacter: 5,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 4, startCharacter: 5, endCharacter: 13, kind: protocol.DocumentHighlightKindText}, // enum Category (definition)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_enum_value\",\n\t\t\ttargetURI:          typesURI,\n\t\t\tline:               6,\n\t\t\tcharacter:          2,\n\t\t\texpectedHighlights: nil, // Enum values should not be highlighted\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_service\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               20,\n\t\t\tcharacter:          8,\n\t\t\texpectedHighlights: nil, // Services should not be highlighted\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_rpc_method\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               21,\n\t\t\tcharacter:          6,\n\t\t\texpectedHighlights: nil, // RPC methods should not be highlighted\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_request_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      28,\n\t\t\tcharacter: 8,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 28, startCharacter: 8, endCharacter: 25, kind: protocol.DocumentHighlightKindText},  // message GetProductRequest (definition)\n\t\t\t\t{line: 21, startCharacter: 17, endCharacter: 34, kind: protocol.DocumentHighlightKindText}, // GetProductRequest in rpc\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_field_name\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               8,\n\t\t\tcharacter:          9,\n\t\t\texpectedHighlights: nil, // Field names should not be highlighted\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_nested_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      69,\n\t\t\tcharacter: 10,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 69, startCharacter: 10, endCharacter: 14, kind: protocol.DocumentHighlightKindText}, // message Item (definition)\n\t\t\t\t{line: 73, startCharacter: 11, endCharacter: 15, kind: protocol.DocumentHighlightKindText}, // repeated Item items (reference)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_nested_enum\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      74,\n\t\t\tcharacter: 7,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 74, startCharacter: 7, endCharacter: 13, kind: protocol.DocumentHighlightKindText}, // enum Status (definition)\n\t\t\t\t{line: 79, startCharacter: 2, endCharacter: 8, kind: protocol.DocumentHighlightKindText},  // Status status (reference)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_nested_enum_value\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               76,\n\t\t\tcharacter:          4,\n\t\t\texpectedHighlights: nil, // Enum values should not be highlighted\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_oneof_field\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               81,\n\t\t\tcharacter:          11,\n\t\t\texpectedHighlights: nil, // Oneof field names should not be highlighted\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_keyword\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               7,\n\t\t\tcharacter:          0,\n\t\t\texpectedHighlights: nil,\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_primitive_type\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               8,\n\t\t\tcharacter:          2,\n\t\t\texpectedHighlights: nil,\n\t\t},\n\t\t{\n\t\t\tname:               \"no_highlight_on_field_number\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               8,\n\t\t\tcharacter:          14,\n\t\t\texpectedHighlights: nil,\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_fully_qualified_reference\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      105, // Line 106 in file (1-indexed) = line 105 (0-indexed)\n\t\t\tcharacter: 8,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 105, startCharacter: 8, endCharacter: 16, kind: protocol.DocumentHighlightKindText},  // message Metadata (definition)\n\t\t\t\t{line: 111, startCharacter: 2, endCharacter: 10, kind: protocol.DocumentHighlightKindText},  // Metadata short_reference\n\t\t\t\t{line: 112, startCharacter: 2, endCharacter: 23, kind: protocol.DocumentHighlightKindText},  // highlight.v1.Metadata qualified_reference (entire span)\n\t\t\t\t{line: 118, startCharacter: 13, endCharacter: 21, kind: protocol.DocumentHighlightKindText}, // Metadata in map<int32, Metadata>\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_from_short_reference\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      111, // Line 112 in file (1-indexed) = line 111 (0-indexed)\n\t\t\tcharacter: 2,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 105, startCharacter: 8, endCharacter: 16, kind: protocol.DocumentHighlightKindText},  // message Metadata (definition)\n\t\t\t\t{line: 111, startCharacter: 2, endCharacter: 10, kind: protocol.DocumentHighlightKindText},  // Metadata short_reference\n\t\t\t\t{line: 112, startCharacter: 2, endCharacter: 23, kind: protocol.DocumentHighlightKindText},  // highlight.v1.Metadata qualified_reference (entire span)\n\t\t\t\t{line: 118, startCharacter: 13, endCharacter: 21, kind: protocol.DocumentHighlightKindText}, // Metadata in map<int32, Metadata>\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_from_qualified_reference\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      112, // Line 113 in file (1-indexed) = line 112 (0-indexed)\n\t\t\tcharacter: 20,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 105, startCharacter: 8, endCharacter: 16, kind: protocol.DocumentHighlightKindText},  // message Metadata (definition)\n\t\t\t\t{line: 111, startCharacter: 2, endCharacter: 10, kind: protocol.DocumentHighlightKindText},  // Metadata short_reference\n\t\t\t\t{line: 112, startCharacter: 2, endCharacter: 23, kind: protocol.DocumentHighlightKindText},  // highlight.v1.Metadata qualified_reference (entire span)\n\t\t\t\t{line: 118, startCharacter: 13, endCharacter: 21, kind: protocol.DocumentHighlightKindText}, // Metadata in map<int32, Metadata>\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_streaming_rpc_input_excludes_stream_keyword\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      23, // Line 24: rpc StreamProducts(stream StreamProductsRequest)\n\t\t\tcharacter: 30,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 44, startCharacter: 8, endCharacter: 29, kind: protocol.DocumentHighlightKindText},  // message StreamProductsRequest (definition)\n\t\t\t\t{line: 23, startCharacter: 28, endCharacter: 49, kind: protocol.DocumentHighlightKindText}, // StreamProductsRequest in RPC input (excluding \"stream \")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_streaming_rpc_output_excludes_stream_keyword\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      23, // Line 24: returns (stream StreamProductsResponse)\n\t\t\tcharacter: 70,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 48, startCharacter: 8, endCharacter: 30, kind: protocol.DocumentHighlightKindText},  // message StreamProductsResponse (definition)\n\t\t\t\t{line: 23, startCharacter: 67, endCharacter: 89, kind: protocol.DocumentHighlightKindText}, // StreamProductsResponse in RPC output (excluding \"stream \")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_from_streaming_request_definition\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      44, // message StreamProductsRequest\n\t\t\tcharacter: 8,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 44, startCharacter: 8, endCharacter: 29, kind: protocol.DocumentHighlightKindText},  // message StreamProductsRequest (definition)\n\t\t\t\t{line: 23, startCharacter: 28, endCharacter: 49, kind: protocol.DocumentHighlightKindText}, // StreamProductsRequest in RPC (excluding \"stream \")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_client_streaming_rpc_input\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      24, // Line 25: rpc UploadProducts(stream UploadProductsRequest)\n\t\t\tcharacter: 30,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 52, startCharacter: 8, endCharacter: 29, kind: protocol.DocumentHighlightKindText},  // message UploadProductsRequest (definition)\n\t\t\t\t{line: 24, startCharacter: 28, endCharacter: 49, kind: protocol.DocumentHighlightKindText}, // UploadProductsRequest in RPC (excluding \"stream \")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_server_streaming_rpc_output\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      25, // Line 26: returns (stream DownloadProductsResponse)\n\t\t\tcharacter: 70,\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 64, startCharacter: 8, endCharacter: 32, kind: protocol.DocumentHighlightKindText},  // message DownloadProductsResponse (definition)\n\t\t\t\t{line: 25, startCharacter: 64, endCharacter: 88, kind: protocol.DocumentHighlightKindText}, // DownloadProductsResponse in RPC (excluding \"stream \")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"highlight_map_keyword_no_highlights\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               116, // Line 117: map<string, int32> attributes = 1;\n\t\t\tcharacter:          2,   // Clicking on \"map\" keyword\n\t\t\texpectedHighlights: nil, // \"map\" is a static symbol, should not highlight\n\t\t},\n\t\t{\n\t\t\tname:               \"highlight_map_builtin_type_no_highlights\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               116, // Line 117: map<string, int32> attributes = 1;\n\t\t\tcharacter:          5,   // Clicking on \"string\" builtin type\n\t\t\texpectedHighlights: nil, // Builtin types should not highlight references\n\t\t},\n\t\t{\n\t\t\tname:               \"highlight_map_field_name_no_highlights\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               116, // Line 117: map<string, int32> attributes = 1;\n\t\t\tcharacter:          24,  // Clicking on \"attributes\" field name\n\t\t\texpectedHighlights: nil, // Map field names should not highlight\n\t\t},\n\t\t{\n\t\t\tname:      \"highlight_map_custom_type_product\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      117, // Line 118: map<string, Product> product_map = 2;\n\t\t\tcharacter: 17,  // Clicking on \"Product\" in map value type\n\t\t\texpectedHighlights: []highlightLocation{\n\t\t\t\t{line: 7, startCharacter: 8, endCharacter: 15, kind: protocol.DocumentHighlightKindText},    // message Product (definition)\n\t\t\t\t{line: 11, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product related\n\t\t\t\t{line: 16, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product products in Catalog\n\t\t\t\t{line: 33, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in GetProductResponse\n\t\t\t\t{line: 41, startCharacter: 11, endCharacter: 18, kind: protocol.DocumentHighlightKindText},  // repeated Product products in ListProductsResponse\n\t\t\t\t{line: 49, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in StreamProductsResponse\n\t\t\t\t{line: 53, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in UploadProductsRequest\n\t\t\t\t{line: 65, startCharacter: 2, endCharacter: 9, kind: protocol.DocumentHighlightKindText},    // Product product in DownloadProductsResponse\n\t\t\t\t{line: 117, startCharacter: 14, endCharacter: 21, kind: protocol.DocumentHighlightKindText}, // Product in map<string, Product>\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tvar highlights []protocol.DocumentHighlight\n\t\t\t_, highlightErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentDocumentHighlight, protocol.DocumentHighlightParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: tt.targetURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &highlights)\n\t\t\trequire.NoError(t, highlightErr)\n\n\t\t\tif tt.expectedHighlights == nil {\n\t\t\t\trequire.Nil(t, highlights)\n\t\t\t} else {\n\t\t\t\trequire.Len(t, highlights, len(tt.expectedHighlights))\n\n\t\t\t\tfor _, expectedHighlight := range tt.expectedHighlights {\n\t\t\t\t\tidx := slices.IndexFunc(highlights, func(h protocol.DocumentHighlight) bool {\n\t\t\t\t\t\treturn h.Range.Start.Line == expectedHighlight.line &&\n\t\t\t\t\t\t\th.Range.Start.Character == expectedHighlight.startCharacter &&\n\t\t\t\t\t\t\th.Range.End.Character == expectedHighlight.endCharacter &&\n\t\t\t\t\t\t\th.Kind == expectedHighlight.kind\n\t\t\t\t\t})\n\t\t\t\t\tassert.NotEqual(t, -1, idx, \"expected highlight at line %d:%d-%d with kind %v not found\", expectedHighlight.line, expectedHighlight.startCharacter, expectedHighlight.endCharacter, expectedHighlight.kind)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/document_link.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconnect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/experimental/token\"\n\t\"go.lsp.dev/protocol\"\n)\n\nconst (\n\t// bsrTabTypeDocs is the BSR docs tab type.\n\tbsrTabTypeDocs = \"docs\"\n\t// bsrTabTypeFile is the BSR file (code) tab type.\n\tbsrTabTypeFile = \"file\"\n)\n\n// documentLink generates document links for imports and URLs in comments.\n// For imports from BSR modules, this creates links to <remote>/<owner>/<module>/file/main:<file-path>.\n// For WKT imports, this creates links to buf.build/protocolbuffers/wellknowntypes/file/main:<file-path>.\n// For local imports without module names, it links to the local file.\n// For https:// URLs found in comments, it creates clickable links to those URLs.\nfunc (s *server) documentLink(file *file) []protocol.DocumentLink {\n\tvar links []protocol.DocumentLink\n\n\t// Create links for import statements\n\tfor _, symbol := range file.symbols {\n\t\tif imported, ok := symbol.kind.(*imported); ok && imported.file != nil {\n\t\t\tvar targetURI protocol.DocumentURI\n\n\t\t\t// Check if this is a Well-Known Type (WKT)\n\t\t\tif imported.file.IsWKT() && imported.file.objectInfo != nil {\n\t\t\t\tbsrHost := bufconnect.DefaultRemote + \"/protocolbuffers/wellknowntypes\"\n\t\t\t\tfilePath := imported.file.objectInfo.Path()\n\t\t\t\turl := \"https://\" + bsrHost + \"/file/main:\" + filePath\n\t\t\t\ttargetURI = protocol.DocumentURI(url)\n\t\t\t} else if file.workspace != nil && imported.file.objectInfo != nil {\n\t\t\t\t// Try to get BSR module information for non-WKT imports\n\t\t\t\tmodule := file.workspace.GetModule(imported.file.uri)\n\t\t\t\tfilePath := imported.file.objectInfo.Path()\n\t\t\t\turl := bsrURL(module, filePath, \"\", bsrTabTypeFile)\n\t\t\t\tif url != \"\" {\n\t\t\t\t\ttargetURI = protocol.DocumentURI(url)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fall back to local file link if no BSR module information\n\t\t\tif targetURI == \"\" {\n\t\t\t\ttargetURI = imported.file.uri\n\t\t\t}\n\n\t\t\tlinks = append(links, protocol.DocumentLink{\n\t\t\t\tRange:  reportSpanToProtocolRange(symbol.span),\n\t\t\t\tTarget: targetURI,\n\t\t\t})\n\t\t}\n\t}\n\n\t// Add links for URLs in comments\n\tif file.ir != nil {\n\t\tif astFile := file.ir.AST(); astFile != nil {\n\t\t\tlinks = append(links, s.findURLLinksInComments(astFile)...)\n\t\t}\n\t}\n\n\treturn links\n}\n\n// bsrURL constructs a BSR URL for a module.\n// Returns an empty string if the module has no FullName.\n// tabType should be bsrTabTypeDocs or bsrTabTypeFile.\n// For docs tab: https://remote/owner/name/docs/main:package#anchor\n// For file tab: https://remote/owner/name/file/main:filePath\nfunc bsrURL(module bufmodule.Module, pathOrPackage string, anchor string, tabType string) string {\n\tif module == nil {\n\t\treturn \"\"\n\t}\n\tfullName := module.FullName()\n\tif fullName == nil {\n\t\treturn \"\"\n\t}\n\n\tregistry := fullName.Registry()\n\towner := fullName.Owner()\n\tname := fullName.Name()\n\n\t// Default to buf.build if no remote or if it's the default remote\n\tif registry == \"\" {\n\t\tregistry = bufconnect.DefaultRemote\n\t}\n\n\turl := \"https://\" + registry + \"/\" + owner + \"/\" + name + \"/\" + tabType + \"/main:\" + pathOrPackage\n\tif anchor != \"\" {\n\t\turl += \"#\" + anchor\n\t}\n\treturn url\n}\n\n// findURLLinksInComments extracts document links for https:// URLs found in comments.\nfunc (s *server) findURLLinksInComments(astFile *ast.File) []protocol.DocumentLink {\n\tvar links []protocol.DocumentLink\n\n\tfor tok := range astFile.Stream().All() {\n\t\tif tok.Kind() != token.Comment {\n\t\t\tcontinue\n\t\t}\n\n\t\tcommentSpan := tok.Span()\n\t\tcommentText := commentSpan.Text()\n\n\t\t// Find all https:// URLs in this comment using the regex\n\t\tmatches := s.httpsURLRegex.FindAllStringIndex(commentText, -1)\n\t\tfor _, match := range matches {\n\t\t\turlStart := match[0]\n\t\t\turlEnd := match[1]\n\n\t\t\turl := commentText[urlStart:urlEnd]\n\t\t\turlSpan := source.Span{\n\t\t\t\tFile:  commentSpan.File,\n\t\t\t\tStart: commentSpan.Start + urlStart,\n\t\t\t\tEnd:   commentSpan.Start + urlEnd,\n\t\t\t}\n\n\t\t\tlinks = append(links, protocol.DocumentLink{\n\t\t\t\tRange:  reportSpanToProtocolRange(urlSpan),\n\t\t\t\tTarget: protocol.DocumentURI(url),\n\t\t\t})\n\t\t}\n\t}\n\n\treturn links\n}\n"
  },
  {
    "path": "private/buf/buflsp/document_link_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestDocumentLink(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttests := []struct {\n\t\tname          string\n\t\tprotoFile     string\n\t\texpectedLinks []expectedLink\n\t}{\n\t\t{\n\t\t\tname:      \"local_import_and_comment_urls\",\n\t\t\tprotoFile: \"testdata/document_link/main.proto\",\n\t\t\texpectedLinks: []expectedLink{\n\t\t\t\t{\n\t\t\t\t\tline:        4,  // import \"types.proto\" on line 5 (0-indexed line 4)\n\t\t\t\t\tstartChar:   7,  // Start of \"types.proto\" (including opening quote)\n\t\t\t\t\tendChar:     20, // End of \"types.proto\" (after closing quote)\n\t\t\t\t\tdescription: \"local import to types.proto\",\n\t\t\t\t\ttargetType:  linkTargetTypeLocal,\n\t\t\t\t\tlocalPath:   \"testdata/document_link/types.proto\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tline:        7, // https://example.com/docs on line 8\n\t\t\t\t\tstartChar:   7,\n\t\t\t\t\tendChar:     31,\n\t\t\t\t\tdescription: \"comment URL 1\",\n\t\t\t\t\ttargetType:  linkTargetTypeURL,\n\t\t\t\t\ttargetURL:   \"https://example.com/docs\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tline:        8, // https://github.com/example/repo on line 9\n\t\t\t\t\tstartChar:   14,\n\t\t\t\t\tendChar:     45,\n\t\t\t\t\tdescription: \"comment URL 2\",\n\t\t\t\t\ttargetType:  linkTargetTypeURL,\n\t\t\t\t\ttargetURL:   \"https://github.com/example/repo\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tline:        11, // https://example.com/status on line 12\n\t\t\t\t\tstartChar:   43,\n\t\t\t\t\tendChar:     69,\n\t\t\t\t\tdescription: \"comment URL 3\",\n\t\t\t\t\ttargetType:  linkTargetTypeURL,\n\t\t\t\t\ttargetURL:   \"https://example.com/status\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"wkt_imports\",\n\t\t\tprotoFile: \"testdata/document_link/wkt.proto\",\n\t\t\texpectedLinks: []expectedLink{\n\t\t\t\t{\n\t\t\t\t\tline:        4,  // import \"google/protobuf/timestamp.proto\" on line 5\n\t\t\t\t\tstartChar:   7,  // Start of \"google/protobuf/timestamp.proto\" (including opening quote)\n\t\t\t\t\tendChar:     40, // End of \"google/protobuf/timestamp.proto\" (after closing quote)\n\t\t\t\t\tdescription: \"WKT Timestamp import\",\n\t\t\t\t\ttargetType:  linkTargetTypeURL,\n\t\t\t\t\ttargetURL:   \"https://buf.build/protocolbuffers/wellknowntypes/file/main:google/protobuf/timestamp.proto\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tline:        5,  // import \"google/protobuf/duration.proto\" on line 6\n\t\t\t\t\tstartChar:   7,  // Start of \"google/protobuf/duration.proto\" (including opening quote)\n\t\t\t\t\tendChar:     39, // End of \"google/protobuf/duration.proto\" (after closing quote)\n\t\t\t\t\tdescription: \"WKT Duration import\",\n\t\t\t\t\ttargetType:  linkTargetTypeURL,\n\t\t\t\t\ttargetURL:   \"https://buf.build/protocolbuffers/wellknowntypes/file/main:google/protobuf/duration.proto\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tprotoPath, err := filepath.Abs(tt.protoFile)\n\t\t\trequire.NoError(t, err)\n\n\t\t\tclientJSONConn, testURI := setupLSPServer(t, protoPath)\n\n\t\t\tvar links []protocol.DocumentLink\n\t\t\t_, err = clientJSONConn.Call(ctx, protocol.MethodTextDocumentDocumentLink, protocol.DocumentLinkParams{\n\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\tURI: testURI,\n\t\t\t\t},\n\t\t\t}, &links)\n\t\t\trequire.NoError(t, err)\n\n\t\t\trequire.Len(t, links, len(tt.expectedLinks), \"unexpected number of document links\")\n\n\t\t\tfor i, expected := range tt.expectedLinks {\n\t\t\t\tlink := links[i]\n\t\t\t\tassert.Equal(t, expected.line, link.Range.Start.Line, \"link %d (%s): wrong start line\", i, expected.description)\n\t\t\t\tassert.Equal(t, expected.startChar, link.Range.Start.Character, \"link %d (%s): wrong start character\", i, expected.description)\n\t\t\t\tassert.Equal(t, expected.line, link.Range.End.Line, \"link %d (%s): wrong end line\", i, expected.description)\n\t\t\t\tassert.Equal(t, expected.endChar, link.Range.End.Character, \"link %d (%s): wrong end character\", i, expected.description)\n\n\t\t\t\tswitch expected.targetType {\n\t\t\t\tcase linkTargetTypeLocal:\n\t\t\t\t\tlocalPath, err := filepath.Abs(expected.localPath)\n\t\t\t\t\trequire.NoError(t, err)\n\t\t\t\t\texpectedURI := buflsp.FilePathToURI(localPath)\n\t\t\t\t\tassert.Equal(t, expectedURI, link.Target, \"link %d (%s): wrong target\", i, expected.description)\n\t\t\t\tcase linkTargetTypeURL:\n\t\t\t\t\tassert.Equal(t, protocol.DocumentURI(expected.targetURL), link.Target, \"link %d (%s): wrong target\", i, expected.description)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Verify no overlapping ranges\n\t\t\tassertNoOverlappingRanges(t, links)\n\t\t})\n\t}\n}\n\ntype linkTargetType int\n\nconst (\n\tlinkTargetTypeLocal linkTargetType = iota\n\tlinkTargetTypeURL\n)\n\ntype expectedLink struct {\n\tline        uint32\n\tstartChar   uint32 // expected starting character position\n\tendChar     uint32 // expected ending character position\n\tdescription string\n\ttargetType  linkTargetType\n\tlocalPath   string // used when targetType is linkTargetTypeLocal\n\ttargetURL   string // used when targetType is linkTargetTypeURL\n}\n\n// assertNoOverlappingRanges verifies that no two document link ranges overlap.\nfunc assertNoOverlappingRanges(t *testing.T, links []protocol.DocumentLink) {\n\tt.Helper()\n\n\tfor i := range links {\n\t\tfor j := i + 1; j < len(links); j++ {\n\t\t\trange1 := links[i].Range\n\t\t\trange2 := links[j].Range\n\n\t\t\t// Check if ranges overlap\n\t\t\tassert.False(\n\t\t\t\tt,\n\t\t\t\trangesOverlap(range1, range2),\n\t\t\t\t\"Document link ranges overlap:\\nLink %d (target=%s): Line %d:%d to %d:%d\\nLink %d (target=%s): Line %d:%d to %d:%d\",\n\t\t\t\ti, links[i].Target,\n\t\t\t\trange1.Start.Line, range1.Start.Character,\n\t\t\t\trange1.End.Line, range1.End.Character,\n\t\t\t\tj, links[j].Target,\n\t\t\t\trange2.Start.Line, range2.Start.Character,\n\t\t\t\trange2.End.Line, range2.End.Character,\n\t\t\t)\n\t\t}\n\t}\n}\n\n// rangesOverlap returns true if two ranges overlap.\nfunc rangesOverlap(r1, r2 protocol.Range) bool {\n\t// A range ends before another starts if r1.End <= r2.Start\n\t// Ranges don't overlap if one ends before the other starts\n\tif positionLessOrEqual(r1.End, r2.Start) || positionLessOrEqual(r2.End, r1.Start) {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// positionLessOrEqual returns true if pos1 <= pos2.\nfunc positionLessOrEqual(pos1, pos2 protocol.Position) bool {\n\tif pos1.Line < pos2.Line {\n\t\treturn true\n\t}\n\tif pos1.Line == pos2.Line && pos1.Character <= pos2.Character {\n\t\treturn true\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "private/buf/buflsp/document_symbol_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"slices\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestDocumentSymbol(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/symbols/symbols.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\ttype symbolInfo struct {\n\t\tname       string\n\t\tkind       protocol.SymbolKind\n\t\tline       uint32\n\t\tdeprecated bool\n\t}\n\ttests := []struct {\n\t\tname            string\n\t\texpectedSymbols []symbolInfo\n\t}{\n\t\t{\n\t\t\tname: \"all_document_symbols\",\n\t\t\texpectedSymbols: []symbolInfo{\n\t\t\t\t{name: \"symbols.v1.Document\", kind: protocol.SymbolKindClass, line: 4},                          // message Document\n\t\t\t\t{name: \"symbols.v1.Document.id\", kind: protocol.SymbolKindField, line: 5},                       // string id\n\t\t\t\t{name: \"symbols.v1.Document.title\", kind: protocol.SymbolKindField, line: 6},                    // string title\n\t\t\t\t{name: \"symbols.v1.Document.status\", kind: protocol.SymbolKindField, line: 7},                   // Status status\n\t\t\t\t{name: \"symbols.v1.Document.metadata\", kind: protocol.SymbolKindField, line: 8},                 // Metadata metadata\n\t\t\t\t{name: \"symbols.v1.Document.Metadata\", kind: protocol.SymbolKindClass, line: 9},                 // message Metadata (nested)\n\t\t\t\t{name: \"symbols.v1.Document.Metadata.author\", kind: protocol.SymbolKindField, line: 10},         // string author\n\t\t\t\t{name: \"symbols.v1.Document.Metadata.created_at\", kind: protocol.SymbolKindField, line: 11},     // int64 created_at\n\t\t\t\t{name: \"symbols.v1.Status\", kind: protocol.SymbolKindEnum, line: 15},                            // enum Status\n\t\t\t\t{name: \"symbols.v1.STATUS_UNSPECIFIED\", kind: protocol.SymbolKindEnumMember, line: 16},          // STATUS_UNSPECIFIED = 0\n\t\t\t\t{name: \"symbols.v1.STATUS_DRAFT\", kind: protocol.SymbolKindEnumMember, line: 17},                // STATUS_DRAFT = 1\n\t\t\t\t{name: \"symbols.v1.STATUS_PUBLISHED\", kind: protocol.SymbolKindEnumMember, line: 18},            // STATUS_PUBLISHED = 2\n\t\t\t\t{name: \"symbols.v1.DocumentService\", kind: protocol.SymbolKindInterface, line: 21},              // service DocumentService\n\t\t\t\t{name: \"symbols.v1.DocumentService.GetDocument\", kind: protocol.SymbolKindMethod, line: 22},     // rpc GetDocument\n\t\t\t\t{name: \"symbols.v1.DocumentService.CreateDocument\", kind: protocol.SymbolKindMethod, line: 23},  // rpc CreateDocument\n\t\t\t\t{name: \"symbols.v1.GetDocumentRequest\", kind: protocol.SymbolKindClass, line: 26},               // message GetDocumentRequest\n\t\t\t\t{name: \"symbols.v1.GetDocumentRequest.document_id\", kind: protocol.SymbolKindField, line: 27},   // string document_id\n\t\t\t\t{name: \"symbols.v1.GetDocumentResponse\", kind: protocol.SymbolKindClass, line: 30},              // message GetDocumentResponse\n\t\t\t\t{name: \"symbols.v1.GetDocumentResponse.document\", kind: protocol.SymbolKindField, line: 31},     // Document document\n\t\t\t\t{name: \"symbols.v1.CreateDocumentRequest\", kind: protocol.SymbolKindClass, line: 34},            // message CreateDocumentRequest\n\t\t\t\t{name: \"symbols.v1.CreateDocumentRequest.document\", kind: protocol.SymbolKindField, line: 35},   // Document document\n\t\t\t\t{name: \"symbols.v1.CreateDocumentResponse\", kind: protocol.SymbolKindClass, line: 38},           // message CreateDocumentResponse\n\t\t\t\t{name: \"symbols.v1.CreateDocumentResponse.document\", kind: protocol.SymbolKindField, line: 39},  // Document document\n\t\t\t\t{name: \"symbols.v1.LegacyDocument\", kind: protocol.SymbolKindClass, line: 42, deprecated: true}, // message LegacyDocument (deprecated)\n\t\t\t\t{name: \"symbols.v1.LegacyDocument.id\", kind: protocol.SymbolKindField, line: 44},                // string id\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tvar symbols []protocol.SymbolInformation\n\t\t\t_, symErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentDocumentSymbol, protocol.DocumentSymbolParams{\n\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\tURI: testURI,\n\t\t\t\t},\n\t\t\t}, &symbols)\n\t\t\trequire.NoError(t, symErr)\n\n\t\t\trequire.Len(t, symbols, len(tt.expectedSymbols))\n\n\t\t\tfor _, expectedSymbol := range tt.expectedSymbols {\n\t\t\t\tidx := slices.IndexFunc(symbols, func(s protocol.SymbolInformation) bool {\n\t\t\t\t\treturn s.Name == expectedSymbol.name\n\t\t\t\t})\n\t\t\t\trequire.NotEqual(t, -1, idx, \"expected to find symbol %s\", expectedSymbol.name)\n\t\t\t\tfound := symbols[idx]\n\t\t\t\tassert.Equal(t, expectedSymbol.kind, found.Kind, \"symbol %s has wrong kind\", expectedSymbol.name)\n\t\t\t\tassert.Equal(t, testURI, found.Location.URI, \"symbol %s has wrong URI\", expectedSymbol.name)\n\t\t\t\tassert.Equal(t, expectedSymbol.line, found.Location.Range.Start.Line, \"symbol %s has wrong line number\", expectedSymbol.name)\n\t\t\t\tassert.Equal(t, expectedSymbol.deprecated, found.Deprecated, \"symbol %s has wrong deprecated status\", expectedSymbol.name)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file defines file manipulation operations.\n\npackage buflsp\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"iter\"\n\t\"log/slog\"\n\t\"slices\"\n\t\"strings\"\n\t\"time\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/ast/predeclared\"\n\t\"github.com/bufbuild/protocompile/experimental/incremental\"\n\t\"github.com/bufbuild/protocompile/experimental/incremental/queries\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/report\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// file is a file that has been opened by the client.\n//\n// Mutating a file is thread-safe.\ntype file struct {\n\tlsp *lsp\n\turi protocol.URI\n\n\tfile *source.File\n\t// Version is an opaque version identifier given to us by the LSP client. This\n\t// is used in the protocol to disambiguate which version of a file e.g. publishing\n\t// diagnostics or symbols an operating refers to.\n\tversion int32\n\thasText bool // Whether this file has ever had text read into it.\n\n\tworkspace  *workspace         // May be nil.\n\tobjectInfo storage.ObjectInfo // Info in the context of the workspace.\n\n\tir                   *ir.File\n\treferenceableSymbols map[ir.FullName]*symbol\n\treferenceSymbols     []*symbol\n\tsymbols              []*symbol\n\tirReport             *report.Report        // IR diagnostic report for code actions\n\tdiagnostics          []protocol.Diagnostic // Converted LSP diagnostics\n\tcancelChecks         func()\n}\n\n// IsLocal returns whether this is a local file, i.e. a file that the editor\n// is editing and not something from e.g. the BSR.\nfunc (f *file) IsLocal() bool {\n\tif f.objectInfo == nil {\n\t\treturn false\n\t}\n\n\treturn f.objectInfo.LocalPath() == f.objectInfo.ExternalPath()\n}\n\n// IsWKT returns whether this file corresponds to a well-known type.\nfunc (f *file) IsWKT() bool {\n\t_, ok := f.objectInfo.(wktObjectInfo)\n\treturn ok\n}\n\n// Manager returns the file manager that owns this file.\nfunc (f *file) Manager() *fileManager {\n\treturn f.lsp.fileManager\n}\n\n// Reset clears all bookkeeping information on this file and resets it.\nfunc (f *file) Reset(ctx context.Context) {\n\tf.lsp.logger.DebugContext(ctx, \"resetting file\", slog.String(\"uri\", f.uri.Filename()))\n\tif f.workspace != nil {\n\t\tf.workspace.Release()\n\t\tf.workspace = nil\n\t}\n\t// Evict the query key if there is a query cached on the file. We cache the [queries.File]\n\t// query since this allows the executor to evict all dependent queries, e.g. AST and IR.\n\tf.lsp.queryExecutor.Evict(f.queryFileKeys()...)\n\t// Clear the file as nothing should use it after reset. This asserts that.\n\t*f = file{}\n}\n\n// Close marks a file as closed.\n//\n// This will not necessarily evict the file, since there may be more than one user\n// for this file.\nfunc (f *file) Close(ctx context.Context) {\n\tf.Manager().Close(ctx, f.uri)\n}\n\n// IsOpenInEditor returns whether this file was opened in the LSP client's\n// editor.\n//\n// Some files may be opened as dependencies, so we want to avoid doing extra\n// work like sending progress notifications.\nfunc (f *file) IsOpenInEditor() bool {\n\treturn f.version != -1 // See [file.ReadFromWorkspace].\n}\n\n// ReadFromWorkspace reads this file from the workspace if it has never had data loaded into it\n// before.\n//\n// If it has been read from disk before, or has received updates from the LSP client, this function\n// returns nil.\nfunc (f *file) ReadFromWorkspace(ctx context.Context) (err error) {\n\tif f.hasText {\n\t\treturn nil\n\t}\n\n\tfileName := f.uri.Filename()\n\tvar reader io.ReadCloser\n\tswitch info := f.objectInfo.(type) {\n\tcase bufmodule.FileInfo:\n\t\treader, err = info.Module().GetFile(ctx, info.Path())\n\tcase wktObjectInfo:\n\t\treader, err = f.lsp.wktBucket.Get(ctx, info.Path())\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported objectInfo type %T\", f.objectInfo)\n\t}\n\tif err != nil {\n\t\treturn fmt.Errorf(\"read file %q from workspace\", err)\n\t}\n\tdefer reader.Close()\n\n\tvar builder strings.Builder\n\tif _, err := io.Copy(&builder, reader); err != nil {\n\t\treturn fmt.Errorf(\"could not read file %q from workspace\", err)\n\t}\n\ttext := builder.String()\n\n\tf.version = -1\n\tf.file = source.NewFile(fileName, text)\n\tf.hasText = true\n\treturn nil\n}\n\n// Update updates the contents of this file with the given text received from\n// the LSP client.\nfunc (f *file) Update(ctx context.Context, version int32, text string) {\n\tf.lsp.logger.InfoContext(ctx, \"file updated\", slog.String(\"uri\", f.uri.Filename()), slog.Int(\"old_version\", int(f.version)), slog.Int(\"new_version\", int(version)))\n\tf.version = version\n\tf.file = source.NewFile(f.uri.Filename(), text)\n\tf.hasText = true\n\n\tf.CancelChecks(ctx)\n\tf.RefreshIR(ctx)\n\tf.IndexSymbols(ctx)\n\tf.RunChecks(ctx)\n\n\t// NOTE: Diagnostics are published unconditionally. This is necessary even\n\t// if we have zero diagnostics, so that the client correctly ticks over from\n\t// n > 0 diagnostics to 0 diagnostics.\n\tf.PublishDiagnostics(ctx)\n}\n\n// RefreshWorkspace rebuilds the workspace for the current file and sets the workspace.\n//\n// The Buf workspace provides the sources for the compiler to work with.\nfunc (f *file) RefreshWorkspace(ctx context.Context) {\n\tf.lsp.logger.Debug(\n\t\t\"refresh workspace\",\n\t\tslog.String(\"file\", f.uri.Filename()),\n\t\tslog.Int(\"version\", int(f.version)),\n\t)\n\tif f.workspace != nil {\n\t\tif err := f.workspace.Refresh(ctx); err != nil {\n\t\t\tf.lsp.logger.Error(\n\t\t\t\t\"could not refresh workspace\",\n\t\t\t\tslog.String(\"uri\", string(f.uri)),\n\t\t\t\txslog.ErrorAttr(err),\n\t\t\t)\n\t\t}\n\t} else {\n\t\tworkspace, err := f.lsp.workspaceManager.LeaseWorkspace(ctx, f.uri)\n\t\tif err != nil {\n\t\t\tf.lsp.logger.Error(\n\t\t\t\t\"could not lease workspace\",\n\t\t\t\tslog.String(\"uri\", string(f.uri)),\n\t\t\t\txslog.ErrorAttr(err),\n\t\t\t)\n\t\t\treturn\n\t\t}\n\t\tf.workspace = workspace\n\t}\n}\n\n// RefreshIR queries for the IR of the file and the IR of each import file.\n// Diagnostics from the compiler are returned when applicable.\n//\n// This operation requires a workspace.\nfunc (f *file) RefreshIR(ctx context.Context) {\n\tif f.objectInfo == nil {\n\t\t// This can happen if the file that is opened is excluded from the workspace through\n\t\t// includes/excludes in the build. In those cases, we ignore the file, the same way\n\t\t// the rest of our tools would.\n\t\t// In the future, we may want to rework this behavior in the LSP.\n\t\treturn\n\t}\n\n\tf.lsp.logger.Info(\n\t\t\"parsing IR for file\",\n\t\tslog.String(\"uri\", string(f.uri)),\n\t\tslog.Int(\"version\", int(f.version)),\n\t)\n\tf.diagnostics = nil\n\tf.ir = nil\n\tf.irReport = nil\n\n\t// Opener creates a cached view of all files in the workspace.\n\tpathToFiles := f.workspace.PathToFile()\n\tfiles := make([]*file, 0, len(pathToFiles))\n\tvar evictQueryKeys []any\n\n\topenerMap := f.lsp.opener.Get()\n\tfor path, file := range pathToFiles {\n\t\tcurrent := openerMap[path]\n\t\t// If there is no entry for the current path or if the file content has changed, we\n\t\t// update the opener and set a new query.\n\t\tif current == nil || current.Text() != file.file.Text() {\n\t\t\topenerMap[path] = file.file\n\t\t\tif current != nil {\n\t\t\t\t// This indicates the file content has changed, so we evict the query file keys.\n\t\t\t\tevictQueryKeys = append(evictQueryKeys, file.queryFileKeys()...)\n\t\t\t}\n\t\t}\n\t\tfiles = append(files, file)\n\t}\n\t// Remove paths that are no longer in the current workspace and evict stale query keys.\n\tfor path := range openerMap {\n\t\tif _, ok := pathToFiles[path]; !ok {\n\t\t\tdelete(openerMap, path)\n\t\t}\n\t}\n\tf.lsp.queryExecutor.Evict(evictQueryKeys...)\n\n\tqueries := xslices.Map(files, func(file *file) incremental.Query[*ir.File] {\n\t\treturn file.queryIR()\n\t})\n\n\tresults, diagnosticReport, err := incremental.Run(\n\t\tctx,\n\t\tf.lsp.queryExecutor,\n\t\tqueries...,\n\t)\n\tif err != nil {\n\t\tf.lsp.logger.Error(\n\t\t\t\"failed to parse IR for file\",\n\t\t\tslog.String(\"uri\", string(f.uri)),\n\t\t\tslog.Int(\"version\", int(f.version)),\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t\treturn\n\t}\n\tfor i, file := range files {\n\t\tfile.ir = results[i].Value\n\t\tif f != file {\n\t\t\t// Update symbols for imports.\n\t\t\tfile.IndexSymbols(ctx)\n\t\t}\n\t}\n\t// Store the IR report for code actions\n\tf.irReport = diagnosticReport\n\n\t// Only hold on to diagnostics where the primary span is for this path.\n\tfileDiagnostics := xslices.Filter(diagnosticReport.Diagnostics, func(d report.Diagnostic) bool {\n\t\treturn d.Primary().Path() == f.objectInfo.Path()\n\t})\n\tf.diagnostics = xslices.Map(fileDiagnostics, reportDiagnosticToProtocolDiagnostic)\n\tf.lsp.logger.DebugContext(\n\t\tctx, \"ir diagnostic(s)\",\n\t\tslog.String(\"uri\", f.uri.Filename()),\n\t\tslog.Int(\"count\", len(f.diagnostics)),\n\t)\n}\n\n// queryIR returns the [queries.IR] for the current file.\nfunc (f *file) queryIR() incremental.Query[*ir.File] {\n\tif f.objectInfo == nil {\n\t\treturn nil\n\t}\n\treturn queries.IR{\n\t\tOpener:  f.lsp.opener,\n\t\tPath:    f.objectInfo.Path(),\n\t\tSession: f.lsp.irSession,\n\t}\n}\n\n// queryFileKeys returns the keys for [queries.File] with ReportError set to true and false.\n// This is because [queries.AST] depends on ReportError set to true and [queries.IR] depends\n// on ReportError set to false, so we need both keys when evicting cached [queries.File]\n// results for stale file states.\nfunc (f *file) queryFileKeys() []any {\n\tif f.objectInfo == nil {\n\t\treturn nil\n\t}\n\treturn []any{\n\t\tqueries.File{\n\t\t\tOpener:      f.lsp.opener,\n\t\t\tPath:        f.objectInfo.Path(),\n\t\t\tReportError: true,\n\t\t}.Key(),\n\t\tqueries.File{\n\t\t\tOpener:      f.lsp.opener,\n\t\t\tPath:        f.objectInfo.Path(),\n\t\t\tReportError: false,\n\t\t}.Key(),\n\t}\n}\n\n// IndexSymbols processes the IR of a file and generates symbols for each symbol in\n// the document.\n//\n// This operation requires RefreshIR.\nfunc (f *file) IndexSymbols(ctx context.Context) {\n\tdefer xslog.DebugProfile(f.lsp.logger, slog.String(\"uri\", string(f.uri)))()\n\t// We cannot index symbols without the IR, so we keep the symbols as-is.\n\tif f.ir == nil {\n\t\treturn\n\t}\n\n\t// Throw away all the old symbols and rebuild symbols unconditionally. This is because if\n\t// this file depends on a file that has since been modified, we may need to update references.\n\tf.symbols = nil\n\tf.referenceSymbols = nil\n\tf.referenceableSymbols = make(map[ir.FullName]*symbol)\n\n\t// Process all imports as symbols\n\tfor imp := range seq.Values(f.ir.Imports()) {\n\t\tf.symbols = append(f.symbols, f.importToSymbol(imp))\n\t}\n\n\tresolved, unresolved := f.indexSymbols()\n\tf.symbols = append(f.symbols, resolved...)\n\tf.symbols = append(f.symbols, unresolved...)\n\tf.referenceSymbols = append(f.referenceSymbols, unresolved...)\n\n\t// Index all referenceable symbols\n\tfor _, sym := range resolved {\n\t\t_, ok := sym.kind.(*referenceable)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tf.referenceableSymbols[sym.ir.FullName()] = sym\n\t}\n\n\t// TODO: this could use a refactor, probably.\n\t//\n\t// Resolve all unresolved symbols from this file\n\tfor _, sym := range unresolved {\n\t\tswitch kind := sym.kind.(type) {\n\t\tcase *reference:\n\t\t\tdef := f.resolveASTDefinition(kind.def, kind.fullName)\n\t\t\tsym.def = def\n\t\t\tif def == nil {\n\t\t\t\t// In the case where the symbol is not resolved, we continue\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treferenceable, ok := def.kind.(*referenceable)\n\t\t\tif !ok {\n\t\t\t\t// This shouldn't happen, logging a warning\n\t\t\t\tf.lsp.logger.Warn(\n\t\t\t\t\t\"found non-referenceable symbol in index\",\n\t\t\t\t\tslog.String(\"file\", f.uri.Filename()),\n\t\t\t\t\tslog.Any(\"symbol\", def),\n\t\t\t\t)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treferenceable.references = append(referenceable.references, sym)\n\t\tcase *option:\n\t\t\tdef := f.resolveASTDefinition(kind.def, kind.defFullName)\n\t\t\tsym.def = def\n\t\t\tif def != nil {\n\t\t\t\treferenceable, ok := def.kind.(*referenceable)\n\t\t\t\tif !ok {\n\t\t\t\t\t// This shouldn't happen, logging a warning\n\t\t\t\t\tf.lsp.logger.Warn(\n\t\t\t\t\t\t\"found non-referenceable symbol in index\",\n\t\t\t\t\t\tslog.String(\"file\", f.uri.Filename()),\n\t\t\t\t\t\tslog.Any(\"symbol\", def),\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\treferenceable.references = append(referenceable.references, sym)\n\t\t\t\t}\n\t\t\t}\n\t\t\ttypeDef := f.resolveASTDefinition(kind.typeDef, kind.typeDefFullName)\n\t\t\tsym.typeDef = typeDef\n\t\tdefault:\n\t\t\t// This shouldn't happen, logging a warning\n\t\t\tf.lsp.logger.Warn(\n\t\t\t\t\"found unresolved non-reference and non-option symbol\",\n\t\t\t\tslog.String(\"file\", f.uri.Filename()),\n\t\t\t\tslog.Any(\"symbol\", sym),\n\t\t\t)\n\t\t}\n\t}\n\n\t// Resolve all references outside of this file to symbols in this file\n\tfor _, file := range f.workspace.PathToFile() {\n\t\tif f == file {\n\t\t\tcontinue // ignore self\n\t\t}\n\t\tfor _, sym := range file.referenceSymbols {\n\t\t\tvar fullName ir.FullName\n\t\t\tswitch kind := sym.kind.(type) {\n\t\t\tcase *reference:\n\t\t\t\tif kind.def.Span().Path() != f.objectInfo.LocalPath() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfullName = kind.fullName\n\t\t\tcase *option:\n\t\t\t\tif kind.def.Span().Path() != f.objectInfo.LocalPath() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfullName = kind.defFullName\n\t\t\tdefault:\n\t\t\t\t// This shouldn't happen, logging a warning\n\t\t\t\tf.lsp.logger.Warn(\n\t\t\t\t\t\"found unresolved non-reference and non-option symbol\",\n\t\t\t\t\tslog.String(\"file\", f.uri.Filename()),\n\t\t\t\t\tslog.Any(\"symbol\", sym),\n\t\t\t\t)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdef, ok := f.referenceableSymbols[fullName]\n\t\t\tif !ok {\n\t\t\t\t// This shouldn't happen, if a symbol is pointing at this file, all definitions\n\t\t\t\t// should be resolved, logging a warning\n\t\t\t\tf.lsp.logger.Warn(\n\t\t\t\t\t\"found reference to unknown symbol\",\n\t\t\t\t\tslog.String(\"file\", f.uri.Filename()),\n\t\t\t\t\tslog.Any(\"reference\", sym),\n\t\t\t\t)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treferenceable, ok := def.kind.(*referenceable)\n\t\t\tif !ok {\n\t\t\t\t// This shouldn't happen, logging a warning\n\t\t\t\tf.lsp.logger.Warn(\n\t\t\t\t\t\"found non-referenceable symbol in index\",\n\t\t\t\t\tslog.String(\"file\", f.uri.Filename()),\n\t\t\t\t\tslog.Any(\"symbol\", def),\n\t\t\t\t)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treferenceable.references = append(referenceable.references, sym)\n\t\t}\n\t}\n\n\t// Finally, sort the symbols in position order, with shorter symbols sorting smaller.\n\tslices.SortFunc(f.symbols, func(s1, s2 *symbol) int {\n\t\tdiff := s1.span.Start - s2.span.Start\n\t\tif diff == 0 {\n\t\t\treturn s1.span.End - s2.span.End\n\t\t}\n\t\treturn diff\n\t})\n\n\tf.lsp.logger.DebugContext(ctx, \"symbol indexing complete\", slog.String(\"uri\", f.uri.Filename()))\n}\n\n// indexSymbols takes the IR [ir.File] for each [file] and returns all the file symbols in\n// two slices:\n//   - The first slice contains definition symbols that are ready to go\n//   - The second slice contains reference symbols need to be resolved\n//\n// For unresolved symbols, we need to track the definition we're attempting to resolve.\nfunc (f *file) indexSymbols() ([]*symbol, []*symbol) {\n\tvar resolved, unresolved []*symbol\n\tfor i := range f.ir.Symbols().Len() {\n\t\t// We only index the symbols for this file.\n\t\tsymbol := f.ir.Symbols().At(i)\n\t\tif symbol.Context().Path() != f.objectInfo.Path() {\n\t\t\tcontinue\n\t\t}\n\t\tresolvedSyms, unresolvedSyms := f.irToSymbols(symbol)\n\t\tresolved = append(resolved, resolvedSyms...)\n\t\tunresolved = append(unresolved, unresolvedSyms...)\n\t}\n\treturn resolved, unresolved\n}\n\n// irToSymbols takes the [ir.Symbol] and returns the corresponding symbols used by the LSP\n// in two slices:\n//   - The first slice contains resolved symbols that are ready to go\n//   - The second slice contains symbols that resolution for their defs\nfunc (f *file) irToSymbols(irSymbol ir.Symbol) ([]*symbol, []*symbol) {\n\tvar resolved, unresolved []*symbol\n\n\t// Skip synthetic fields that belong to MapEntry messages (key/value fields)\n\tif irSymbol.Kind() == ir.SymbolKindField {\n\t\tif irSymbol.AsMember().IsSynthetic() {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\n\t// Skip synthetic MapEntry messages created for map fields\n\tif irSymbol.Kind() == ir.SymbolKindMessage {\n\t\tif irSymbol.AsType().IsMapEntry() {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\n\tswitch irSymbol.Kind() {\n\tcase ir.SymbolKindMessage:\n\t\tmsg := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsType().AST().AsMessage().Name.Span(),\n\t\t\tkind: &referenceable{\n\t\t\t\tast: irSymbol.AsType().AST(),\n\t\t\t},\n\t\t}\n\t\tmsg.def = msg\n\t\tresolved = append(resolved, msg)\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsType().Options())...)\n\tcase ir.SymbolKindEnum:\n\t\tenum := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsType().AST().AsEnum().Name.Span(),\n\t\t\tkind: &referenceable{\n\t\t\t\tast: irSymbol.AsType().AST(),\n\t\t\t},\n\t\t}\n\t\tenum.def = enum\n\t\tresolved = append(resolved, enum)\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsType().Options())...)\n\tcase ir.SymbolKindEnumValue:\n\t\tname := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsMember().AST().AsEnumValue().Name.Span(),\n\t\t\tkind: &static{\n\t\t\t\tast: irSymbol.AsMember().AST(),\n\t\t\t},\n\t\t}\n\t\tname.def = name\n\t\tresolved = append(resolved, name)\n\n\t\ttag := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsMember().AST().AsEnumValue().Tag.Span(),\n\t\t\tkind: &tag{},\n\t\t}\n\t\ttag.def = tag\n\t\tresolved = append(resolved, tag)\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsMember().Options())...)\n\tcase ir.SymbolKindField:\n\t\t// Check if this is a map field by looking for a generic type\n\t\ttypeWithoutPrefixes := irSymbol.AsMember().TypeAST().RemovePrefixes()\n\t\tif genericType := typeWithoutPrefixes.AsGeneric(); !genericType.IsZero() {\n\t\t\t// This is a map field - create symbols for \"map\" keyword, key type, and value type\n\t\t\tkeyType, valueType := genericType.AsMap()\n\n\t\t\t// Create symbol for \"map\" keyword itself\n\t\t\tif mapPath := genericType.Path(); !mapPath.IsZero() && !mapPath.Span().IsZero() {\n\t\t\t\tmapSymbol := &symbol{\n\t\t\t\t\tir:   irSymbol,\n\t\t\t\t\tfile: f,\n\t\t\t\t\tspan: mapPath.Span(),\n\t\t\t\t\tkind: &builtin{predeclared: predeclared.Map},\n\t\t\t\t}\n\t\t\t\tresolved = append(resolved, mapSymbol)\n\t\t\t}\n\n\t\t\t// Create symbol for key type\n\t\t\tif !keyType.IsZero() {\n\t\t\t\tif keyPath := keyType.RemovePrefixes().AsPath(); !keyPath.IsZero() && !keyPath.Span().IsZero() {\n\t\t\t\t\tkeySymbol := &symbol{\n\t\t\t\t\t\tir:   irSymbol,\n\t\t\t\t\t\tfile: f,\n\t\t\t\t\t\tspan: keyPath.Span(),\n\t\t\t\t\t}\n\t\t\t\t\tkind, needsResolution := getKindForMapType(keyType, irSymbol.AsMember(), true)\n\t\t\t\t\tif kind != nil {\n\t\t\t\t\t\tkeySymbol.kind = kind\n\t\t\t\t\t\tif needsResolution {\n\t\t\t\t\t\t\tunresolved = append(unresolved, keySymbol)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolved = append(resolved, keySymbol)\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\t// Create symbol for value type\n\t\t\tif !valueType.IsZero() {\n\t\t\t\tif valuePath := valueType.RemovePrefixes().AsPath(); !valuePath.IsZero() && !valuePath.Span().IsZero() {\n\t\t\t\t\tvalueSymbol := &symbol{\n\t\t\t\t\t\tir:   irSymbol,\n\t\t\t\t\t\tfile: f,\n\t\t\t\t\t\tspan: valuePath.Span(),\n\t\t\t\t\t}\n\t\t\t\t\tkind, needsResolution := getKindForMapType(valueType, irSymbol.AsMember(), false)\n\t\t\t\t\tif kind != nil {\n\t\t\t\t\t\tvalueSymbol.kind = kind\n\t\t\t\t\t\tif needsResolution {\n\t\t\t\t\t\t\tunresolved = append(unresolved, valueSymbol)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresolved = append(resolved, valueSymbol)\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} else {\n\t\t\t// Regular non-map field - use existing logic\n\t\t\t// Get the type span. We prefer AsPath() which excludes modifiers like \"repeated\"\n\t\t\t// while keeping package qualifiers, but fallback to RemovePrefixes() if AsPath is zero.\n\t\t\ttypeSpan := irSymbol.AsMember().TypeAST().AsPath().Span()\n\t\t\tif typeSpan.IsZero() {\n\t\t\t\ttypeSpan = irSymbol.AsMember().TypeAST().RemovePrefixes().Span()\n\t\t\t}\n\t\t\ttyp := &symbol{\n\t\t\t\tir:   irSymbol,\n\t\t\t\tfile: f,\n\t\t\t\tspan: typeSpan,\n\t\t\t}\n\t\t\tkind, needsResolution := getKindForMember(irSymbol.AsMember())\n\t\t\ttyp.kind = kind\n\t\t\tif needsResolution {\n\t\t\t\tunresolved = append(unresolved, typ)\n\t\t\t} else {\n\t\t\t\tresolved = append(resolved, typ)\n\t\t\t}\n\t\t}\n\n\t\tfield := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsMember().AST().AsField().Name.Span(),\n\t\t\tkind: &referenceable{\n\t\t\t\tast: irSymbol.AsMember().AST(),\n\t\t\t},\n\t\t}\n\t\tfield.def = field\n\t\tresolved = append(resolved, field)\n\n\t\ttag := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsMember().AST().AsField().Tag.Span(),\n\t\t\tkind: &tag{},\n\t\t}\n\t\ttag.def = tag\n\t\tresolved = append(resolved, tag)\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsMember().Options())...)\n\tcase ir.SymbolKindExtension:\n\t\t// Track the type reference for the extension field (e.g., \"Testing\" in \"Testing testing = 89181;\")\n\t\ttypeSpan := irSymbol.AsMember().TypeAST().AsPath().Span()\n\t\tif typeSpan.IsZero() {\n\t\t\ttypeSpan = irSymbol.AsMember().TypeAST().RemovePrefixes().Span()\n\t\t}\n\t\ttyp := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: typeSpan,\n\t\t}\n\t\tkind, needsResolution := getKindForMember(irSymbol.AsMember())\n\t\ttyp.kind = kind\n\t\tif needsResolution {\n\t\t\tunresolved = append(unresolved, typ)\n\t\t} else {\n\t\t\tresolved = append(resolved, typ)\n\t\t}\n\n\t\t// Track the extension field name itself.\n\t\text := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsMember().AST().AsExtend().Extendee.Span(),\n\t\t\tkind: &referenceable{\n\t\t\t\tast: irSymbol.AsMember().AST(),\n\t\t\t},\n\t\t}\n\t\tresolved = append(resolved, ext)\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsMember().Options())...)\n\tcase ir.SymbolKindOneof:\n\t\toneof := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsOneof().AST().AsOneof().Name.Span(),\n\t\t\tkind: &referenceable{\n\t\t\t\tast: irSymbol.AsOneof().AST(),\n\t\t\t},\n\t\t}\n\t\toneof.def = oneof\n\t\tresolved = append(resolved, oneof)\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsOneof().Options())...)\n\tcase ir.SymbolKindService:\n\t\tservice := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsService().AST().AsService().Name.Span(),\n\t\t\tkind: &static{\n\t\t\t\tast: irSymbol.AsService().AST(),\n\t\t\t},\n\t\t}\n\t\tservice.def = service\n\t\tresolved = append(resolved, service)\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsService().Options())...)\n\tcase ir.SymbolKindMethod:\n\t\tmethod := &symbol{\n\t\t\tir:   irSymbol,\n\t\t\tfile: f,\n\t\t\tspan: irSymbol.AsMethod().AST().AsMethod().Name.Span(),\n\t\t\tkind: &static{\n\t\t\t\tast: irSymbol.AsMethod().AST(),\n\t\t\t},\n\t\t}\n\t\tmethod.def = method\n\t\tresolved = append(resolved, method)\n\n\t\tinput, _ := irSymbol.AsMethod().Input()\n\t\t// Method input must be a single message type.\n\t\tif astInputs := irSymbol.AsMethod().AST().AsMethod().Signature.Inputs(); astInputs.Len() == 1 {\n\t\t\tinputAST := astInputs.At(0)\n\t\t\t// Get the type span, preferring AsPath() but falling back to RemovePrefixes().\n\t\t\tinputSpan := inputAST.AsPath().Span()\n\t\t\tif inputSpan.IsZero() {\n\t\t\t\tinputSpan = inputAST.RemovePrefixes().Span()\n\t\t\t}\n\t\t\tinputSym := &symbol{\n\t\t\t\tir:   irSymbol,\n\t\t\t\tfile: f,\n\t\t\t\tspan: inputSpan,\n\t\t\t\tkind: &reference{\n\t\t\t\t\tdef:      input.AST(), // Only messages can be method inputs and outputs\n\t\t\t\t\tfullName: input.FullName(),\n\t\t\t\t},\n\t\t\t}\n\t\t\tunresolved = append(unresolved, inputSym)\n\t\t}\n\t\toutput, _ := irSymbol.AsMethod().Output()\n\t\t// Method output must be a single message type.\n\t\tif astOutputs := irSymbol.AsMethod().AST().AsMethod().Signature.Outputs(); astOutputs.Len() == 1 {\n\t\t\toutputAST := astOutputs.At(0)\n\t\t\t// Get the type span, preferring AsPath() but falling back to RemovePrefixes().\n\t\t\toutputSpan := outputAST.AsPath().Span()\n\t\t\tif outputSpan.IsZero() {\n\t\t\t\toutputSpan = outputAST.RemovePrefixes().Span()\n\t\t\t}\n\t\t\toutputSym := &symbol{\n\t\t\t\tir:   irSymbol,\n\t\t\t\tfile: f,\n\t\t\t\tspan: outputSpan,\n\t\t\t\tkind: &reference{\n\t\t\t\t\tdef:      output.AST(), // Only messages can be method inputs and outputs\n\t\t\t\t\tfullName: output.FullName(),\n\t\t\t\t},\n\t\t\t}\n\t\t\tunresolved = append(unresolved, outputSym)\n\t\t}\n\t\tunresolved = append(unresolved, f.messageToSymbols(irSymbol.AsMethod().Options())...)\n\t}\n\treturn resolved, unresolved\n}\n\n// getKindForMember takes a [ir.Member] and returns the symbol kind and whether or not the\n// symbol is currently resolved.\nfunc getKindForMember(member ir.Member) (kind, bool) {\n\t// We remove prefixes to check for a predeclared type, e.g. repeated string values = 1;,\n\t// \"repeated string\" would not be captured as a predeclared type. The corresponding symbol\n\t// also excludes prefixes.\n\tif member.TypeAST().RemovePrefixes().AsPath().AsPredeclared() != predeclared.Unknown {\n\t\treturn &builtin{\n\t\t\tpredeclared: member.TypeAST().RemovePrefixes().AsPath().AsPredeclared(),\n\t\t}, false\n\t}\n\treturn &reference{\n\t\tdef:      member.Element().AST(),\n\t\tfullName: member.Element().FullName(),\n\t}, true\n}\n\n// getKindForMapType returns the kind for a map key or value type.\n// For map fields, member.Element() returns the synthetic MapEntry message,\n// so we need to look up the actual type through the MapEntry's key/value fields.\nfunc getKindForMapType(typeAST ast.TypeAny, mapField ir.Member, isKey bool) (kind, bool) {\n\ttypePath := typeAST.RemovePrefixes().AsPath()\n\tif typePath.IsZero() {\n\t\treturn nil, false\n\t}\n\n\t// Check if it's a predeclared type\n\tif typePath.AsPredeclared() != predeclared.Unknown {\n\t\treturn &builtin{predeclared: typePath.AsPredeclared()}, false\n\t}\n\n\t// For custom types, navigate through the MapEntry to find the key/value field\n\telem := mapField.Element()\n\tif elem.IsZero() || !elem.IsMessage() {\n\t\treturn &static{ast: mapField.AST()}, false\n\t}\n\n\tfieldName := \"value\"\n\tif isKey {\n\t\tfieldName = \"key\"\n\t}\n\n\t// Look for the key or value field in the MapEntry message\n\tfor i := range elem.Members().Len() {\n\t\tif field := elem.Members().At(i); field.Name() == fieldName {\n\t\t\treturn &reference{\n\t\t\t\tdef:      field.Element().AST(),\n\t\t\t\tfullName: field.Element().FullName(),\n\t\t\t}, true\n\t\t}\n\t}\n\n\t// Fallback if we couldn't resolve\n\treturn &static{ast: mapField.AST()}, false\n}\n\n// importToSymbol takes an [ir.Import] and returns a symbol for it.\nfunc (f *file) importToSymbol(imp ir.Import) *symbol {\n\treturn &symbol{\n\t\tfile: f,\n\t\tspan: imp.Decl.ImportPath().Span(),\n\t\tkind: &imported{\n\t\t\tfile: f.workspace.PathToFile()[imp.File.Path()],\n\t\t},\n\t}\n}\n\n// messageToSymbols takes an [ir.MessageValue] and returns the symbols parsed from it.\nfunc (f *file) messageToSymbols(msg ir.MessageValue) []*symbol {\n\treturn f.messageToSymbolsHelper(msg, 0, nil)\n}\n\n// messageToSymbolsHelper is a recursive helper for extracting the symbols from a [ir.MessageValue].\nfunc (f *file) messageToSymbolsHelper(msg ir.MessageValue, index int, parents []*symbol) []*symbol {\n\tvar symbols []*symbol\n\tfor field := range msg.Fields() {\n\t\tif field.ValueAST().IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\t// There are a couple of different ways options can be structured, e.g.\n\t\t//\n\t\t// [(option).message = {\n\t\t//    field_a: 2\n\t\t//    field_b: 100\n\t\t//  }]\n\t\t//\n\t\t// Or:\n\t\t//\n\t\t// [\n\t\t//    (option).message.field_a = 2\n\t\t//    (option).message.field_b = 100\n\t\t//  ]\n\t\t//\n\t\t// For both examples, we would want to create a separate symbol for each referenceable\n\t\t// part of each path, e.g. (option), .message, .field_a, etc.\n\t\t//\n\t\t// An option is represented as a [ir.MessageValue] that is accessed recursively, so in\n\t\t// both examples above, we have:\n\t\t//\n\t\t//  (option) -> (option).message -> (option).message.field_a / field_a\n\t\t//                               -> (option).message.field_b / field_b\n\t\t//\n\t\t// As we walk the message recursively, we set a symbol for each message/field along the\n\t\t// way. Because we are accessing each message from the top-level message, we need to\n\t\t// make sure that we capture a symbol for each corresponding path span along the way.\n\t\t//\n\t\t// In the example, in the second definition, (option) and .message for field_b has a\n\t\t// separate span from (option) and .message for field_a, but when we walk the mesasge\n\t\t// tree, we get the span for (option) and .message for the first field. So we check the\n\t\t// symbols we've collected so far in parents and make sure we have captured a symbol for\n\t\t// each path component.\n\t\tfor element := range seq.Values(field.Elements()) {\n\t\t\tkey := field.KeyASTs().At(element.ValueNodeIndex())\n\t\t\tcomponents := slices.Collect(key.AsPath().Components)\n\t\t\t// If there are no path components for an element, then we skip it, since there are\n\t\t\t// no symbols to track.\n\t\t\tif len(components) == 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar span source.Span\n\t\t\t// This covers the first case in the example above where the path is relative,\n\t\t\t// e.g. field_a is a relative path within { } for (option).message.\n\t\t\tif index > len(components)-1 {\n\t\t\t\tspan = components[len(components)-1].Span()\n\t\t\t} else {\n\t\t\t\t// Otherwise, we get the component for the corresponding index.\n\t\t\t\tspan = components[index].Span()\n\t\t\t}\n\t\t\tspan = trimLeadingDot(span)\n\t\t\tsym := &symbol{\n\t\t\t\t// NOTE: no [ir.Symbol] for option elements\n\t\t\t\tfile: f,\n\t\t\t\tspan: span,\n\t\t\t\tkind: &option{\n\t\t\t\t\tdef:             element.Field().AST(),\n\t\t\t\t\tdefFullName:     element.Field().FullName(),\n\t\t\t\t\ttypeDef:         element.Type().AST(),\n\t\t\t\t\ttypeDefFullName: element.Type().FullName(),\n\t\t\t\t},\n\t\t\t}\n\t\t\tsymbols = append(symbols, sym)\n\t\t\tif !element.AsMessage().IsZero() {\n\t\t\t\tsymbols = append(symbols, f.messageToSymbolsHelper(element.AsMessage(), index+1, symbols)...)\n\t\t\t}\n\n\t\t\t// We check back along the path to make sure that we have a symbol for each component.\n\t\t\t//\n\t\t\t// We need to ensure that (option) for (option).message.field_b has a symbol defined\n\t\t\t// among the parent symbols.\n\t\t\tif len(components) > 1 {\n\t\t\t\tparentType := element.Value().Container()\n\t\t\t\tfor _, component := range slices.Backward(components) {\n\t\t\t\t\tif component.IsLast() {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tcomponentSpan := trimLeadingDot(component.Span())\n\t\t\t\t\tfound := false\n\t\t\t\t\tfor _, parent := range parents {\n\t\t\t\t\t\tif parent.span == componentSpan {\n\t\t\t\t\t\t\tfound = true\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\tif !found {\n\t\t\t\t\t\tsym := &symbol{\n\t\t\t\t\t\t\t// NOTE: no [ir.Symbol] for option elements\n\t\t\t\t\t\t\tfile: f,\n\t\t\t\t\t\t\tspan: componentSpan,\n\t\t\t\t\t\t\tkind: &option{\n\t\t\t\t\t\t\t\tdef:             parentType.AsValue().Field().AST(),\n\t\t\t\t\t\t\t\tdefFullName:     parentType.AsValue().Field().FullName(),\n\t\t\t\t\t\t\t\ttypeDef:         parentType.Type().AST(),\n\t\t\t\t\t\t\t\ttypeDefFullName: parentType.Type().FullName(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsymbols = append(symbols, sym)\n\t\t\t\t\t}\n\t\t\t\t\tparentType = parentType.AsValue().Container()\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn symbols\n}\n\n// findSymbolByFullName searches for a referenceable symbol with the given full name\n// in the current file and its workspace.\nfunc (f *file) findSymbolByFullName(fullName ir.FullName) *symbol {\n\tif sym, ok := f.referenceableSymbols[fullName]; ok {\n\t\treturn sym\n\t}\n\tif f.workspace == nil {\n\t\treturn nil\n\t}\n\tfor _, wsFile := range f.workspace.PathToFile() {\n\t\tif sym, ok := wsFile.referenceableSymbols[fullName]; ok {\n\t\t\treturn sym\n\t\t}\n\t}\n\treturn nil\n}\n\n// resolveASTDefinition is a helper for resolving the [ast.DeclDef] to the *[symbol], if\n// there is a matching indexed *[symbol].\nfunc (f *file) resolveASTDefinition(def ast.DeclDef, defName ir.FullName) *symbol {\n\t// First check if the definition is in the current file.\n\tif def.Span().Path() == f.file.Path() {\n\t\treturn f.referenceableSymbols[defName]\n\t}\n\t// No workspace, we cannot resolve the AST definition from outside of the file.\n\tif f.workspace == nil {\n\t\treturn nil\n\t}\n\tfor _, file := range f.workspace.PathToFile() {\n\t\tif file.file.Path() == def.Span().Path() {\n\t\t\treturn file.referenceableSymbols[defName]\n\t\t}\n\t}\n\treturn nil\n}\n\n// SymbolAt finds a symbol in this file at the given cursor position, if one exists.\n//\n// Returns nil if no symbol is found.\nfunc (f *file) SymbolAt(ctx context.Context, cursor protocol.Position) *symbol {\n\toffset := positionToOffset(f, cursor)\n\n\t// Binary search for insertion point based on Start.\n\tidx, _ := slices.BinarySearchFunc(f.symbols, offset, func(sym *symbol, offset int) int {\n\t\tif sym.span.Start <= offset {\n\t\t\treturn -1\n\t\t}\n\t\treturn 1\n\t})\n\t// Walk backwards from symbol with Start > offset to find the smallest symbol.\n\t// This makes the assumption that overlapping spans share the same start position.\n\t// For example: the following spans A[0,10], B[0,15], C[0,20], D[20,30] and a\n\t// target offset 12, binary search returns 3 (D), and the minimum node is B.\n\tvar symbol *symbol\n\tfor _, before := range slices.Backward(f.symbols[:idx]) {\n\t\t// Offset is past the end. Range is half-open [Start, End)\n\t\tif offset > before.span.End {\n\t\t\tbreak\n\t\t}\n\t\tsymbol = before\n\t}\n\tif symbol != nil {\n\t\tf.lsp.logger.DebugContext(\n\t\t\tctx,\n\t\t\t\"symbol at\",\n\t\t\tslog.Int(\"line\", int(cursor.Line)),\n\t\t\tslog.Int(\"character\", int(cursor.Character)),\n\t\t\tslog.Any(\"symbol\", symbol),\n\t\t)\n\t}\n\treturn symbol\n}\n\n// CancelChecks cancels any currently running checks for this file.\nfunc (f *file) CancelChecks(ctx context.Context) {\n\tif f.cancelChecks != nil {\n\t\tf.cancelChecks()\n\t\tf.cancelChecks = nil\n\t}\n}\n\n// RunChecks triggers the run of checks for this file. Diagnostics are published asynchronously.\nfunc (f *file) RunChecks(ctx context.Context) {\n\tif f.IsWKT() || !f.IsOpenInEditor() {\n\t\treturn // Must be open and not a WKT.\n\t}\n\tf.CancelChecks(ctx)\n\n\tfor _, diagnostic := range f.diagnostics {\n\t\tif diagnostic.Severity == protocol.DiagnosticSeverityError {\n\t\t\tf.lsp.logger.DebugContext(\n\t\t\t\tctx, \"checks skipped on diagnostic severity\",\n\t\t\t\tslog.String(\"severity\", diagnostic.Severity.String()),\n\t\t\t)\n\t\t\treturn // Skip on not buildable images.\n\t\t}\n\t}\n\n\tworkspace := f.workspace.Workspace()\n\tmodule := f.workspace.GetModule(f.uri)\n\tcheckClient := f.workspace.CheckClient()\n\tif workspace == nil || module == nil || checkClient == nil || f.objectInfo == nil {\n\t\tf.lsp.logger.Debug(\"checks skipped\", slog.String(\"uri\", f.uri.Filename()))\n\t\treturn\n\t}\n\tpath := f.objectInfo.Path()\n\n\topener := make(fileOpener)\n\tfor path, file := range f.workspace.PathToFile() {\n\t\topener[path] = file.file.Text()\n\t}\n\n\tconst checkTimeout = 30 * time.Second\n\tctx, cancel := context.WithTimeout(f.lsp.connCtx, checkTimeout)\n\tf.cancelChecks = cancel\n\n\tgo func() {\n\t\tvar annotations []bufanalysis.FileAnnotation\n\t\timage, diagnostics := buildImage(ctx, path, f.lsp.logger, opener)\n\t\tif image != nil {\n\t\t\tf.lsp.logger.DebugContext(ctx, \"checks running lint\", slog.String(\"uri\", f.uri.Filename()), slog.String(\"module\", module.OpaqueID()))\n\t\t\tif err := checkClient.Lint(\n\t\t\t\tctx,\n\t\t\t\tworkspace.GetLintConfigForOpaqueID(module.OpaqueID()),\n\t\t\t\timage,\n\t\t\t\tbufcheck.WithPluginConfigs(workspace.PluginConfigs()...),\n\t\t\t\tbufcheck.WithPolicyConfigs(workspace.PolicyConfigs()...),\n\t\t\t); err != nil {\n\t\t\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\t\t\tif !errors.As(err, &fileAnnotationSet) {\n\t\t\t\t\tif errors.Is(err, context.Canceled) || ctx.Err() != nil {\n\t\t\t\t\t\tf.lsp.logger.DebugContext(ctx, \"checks cancelled\", slog.String(\"uri\", f.uri.Filename()), xslog.ErrorAttr(err))\n\t\t\t\t\t} else if errors.Is(err, context.DeadlineExceeded) {\n\t\t\t\t\t\tf.lsp.logger.WarnContext(ctx, \"checks deadline exceeded\", slog.String(\"uri\", f.uri.Filename()), xslog.ErrorAttr(err))\n\t\t\t\t\t} else {\n\t\t\t\t\t\tf.lsp.logger.WarnContext(ctx, \"checks failed\", slog.String(\"uri\", f.uri.Filename()), xslog.ErrorAttr(err))\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif len(fileAnnotationSet.FileAnnotations()) == 0 {\n\t\t\t\t\tf.lsp.logger.DebugContext(ctx, \"checks lint passed\", slog.String(\"uri\", f.uri.Filename()))\n\t\t\t\t} else {\n\t\t\t\t\tannotations = append(annotations, fileAnnotationSet.FileAnnotations()...)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tf.lsp.logger.DebugContext(ctx, \"checks cancelled\", slog.String(\"uri\", f.uri.Filename()), xslog.ErrorAttr(ctx.Err()))\n\t\t\treturn\n\t\tdefault:\n\t\t}\n\n\t\tf.lsp.lock.Lock()\n\t\tdefer f.lsp.lock.Unlock()\n\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tf.lsp.logger.DebugContext(ctx, \"checks: cancelled after waiting for file lock\", slog.String(\"uri\", f.uri.Filename()), xslog.ErrorAttr(ctx.Err()))\n\t\t\treturn // Context cancelled whilst waiting to publishing diagnostics.\n\t\tdefault:\n\t\t}\n\n\t\t// Update diagnostics and publish.\n\t\tif len(diagnostics) != 0 {\n\t\t\t// TODO: prefer diagnostics from the old compiler to the new compiler to remove duplicates from both.\n\t\t\tf.diagnostics = diagnostics\n\t\t}\n\t\tf.appendAnnotations(\"buf lint\", annotations)\n\t\tf.PublishDiagnostics(ctx)\n\t}()\n}\n\nfunc (f *file) appendAnnotations(source string, annotations []bufanalysis.FileAnnotation) {\n\tfor _, annotation := range annotations {\n\t\t// Convert 1-indexed byte-based line/column to byte offset.\n\t\tstartLocation := f.file.InverseLocation(annotation.StartLine(), annotation.StartColumn(), positionalEncoding)\n\t\tendLocation := f.file.InverseLocation(annotation.EndLine(), annotation.EndColumn(), positionalEncoding)\n\t\tprotocolRange := reportLocationsToProtocolRange(startLocation, endLocation)\n\t\tdiagnostic := protocol.Diagnostic{\n\t\t\tRange: protocolRange,\n\t\t\tCode:  annotation.Type(),\n\t\t\tCodeDescription: &protocol.CodeDescription{\n\t\t\t\tHref: protocol.URI(\"https://buf.build/docs/lint/rules/#\" + strings.ToLower(annotation.Type())),\n\t\t\t},\n\t\t\tSeverity: protocol.DiagnosticSeverityWarning,\n\t\t\tSource:   source,\n\t\t\tMessage:  annotation.Message(),\n\t\t}\n\t\tif annotation.Type() == \"IMPORT_USED\" {\n\t\t\tdiagnostic.Tags = []protocol.DiagnosticTag{\n\t\t\t\tprotocol.DiagnosticTagUnnecessary,\n\t\t\t}\n\t\t}\n\t\tf.diagnostics = append(f.diagnostics, diagnostic)\n\t}\n}\n\n// PublishDiagnostics publishes all of this file's diagnostics to the LSP client.\nfunc (f *file) PublishDiagnostics(ctx context.Context) {\n\tif !f.IsOpenInEditor() {\n\t\t// If the file does get opened by the editor, the server will call\n\t\t// Refresh() and this function will retry sending diagnostics. Which is\n\t\t// to say: returning here does not result in stale diagnostics on the\n\t\t// client.\n\t\treturn\n\t}\n\n\tdefer xslog.DebugProfile(f.lsp.logger, slog.String(\"uri\", string(f.uri)))()\n\n\t// NOTE: We need to avoid sending a JSON null here, so we replace it with\n\t// a non-nil empty slice when the diagnostics slice is nil.\n\tdiagnostics := f.diagnostics\n\tif f.diagnostics == nil {\n\t\tdiagnostics = []protocol.Diagnostic{}\n\t}\n\n\t// Publish the diagnostics. This error is automatically logged by the LSP framework.\n\t_ = f.lsp.client.PublishDiagnostics(ctx, &protocol.PublishDiagnosticsParams{\n\t\tURI: f.uri,\n\t\t// NOTE: For some reason, Version is int32 in the document struct, but uint32 here.\n\t\t// This seems like a bug in the LSP protocol package.\n\t\tVersion:     uint32(f.version),\n\t\tDiagnostics: diagnostics,\n\t})\n}\n\n// wktObjectInfo is a concrete type to help us identify WKTs among the importable files.\ntype wktObjectInfo struct {\n\tstorage.ObjectInfo\n}\n\n// GetSymbols retrieves symbols for the file. If a query is passed, matches only symbols matching\n// the case-insensitive substring match to the symbol.\n//\n// This operation requires [IndexSymbols].\nfunc (f *file) GetSymbols(query string) iter.Seq[protocol.SymbolInformation] {\n\treturn func(yield func(protocol.SymbolInformation) bool) {\n\t\tif f.ir == nil {\n\t\t\treturn\n\t\t}\n\t\t// Search through all symbols in this file.\n\t\tfor _, sym := range f.symbols {\n\t\t\tif sym.ir.IsZero() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Only include definitions: static and referenceable symbols.\n\t\t\t// Skip references, imports, builtins, and tags\n\t\t\t_, isStatic := sym.kind.(*static)\n\t\t\t_, isReferenceable := sym.kind.(*referenceable)\n\t\t\tif !isStatic && !isReferenceable {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsymbolInfo := sym.GetSymbolInformation()\n\t\t\tif symbolInfo.Name == \"\" {\n\t\t\t\tcontinue // Symbol information not supported for this symbol.\n\t\t\t}\n\t\t\t// Filter by query (case-insensitive substring match)\n\t\t\tif query != \"\" && !strings.Contains(strings.ToLower(symbolInfo.Name), query) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !yield(symbolInfo) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\n// trimLeadingDot removes the leading dot from a span if present.\n//\n// Option field references in protobuf use dot notation like \"(extension).field\",\n// but the AST component span includes the dot separator (e.g., \".field\" instead\n// of \"field\"). We need to trim this to get the correct symbol span for renaming,\n// otherwise we'd end up renaming \".field\" to \".newname\", resulting in invalid\n// syntax like \"(extension)newname\" instead of \"(extension).newname\".\nfunc trimLeadingDot(span source.Span) source.Span {\n\tif span.Text() != \"\" && span.Text()[0] == '.' {\n\t\treturn source.Span{\n\t\t\tFile:  span.File,\n\t\t\tStart: span.Start + 1,\n\t\t\tEnd:   span.End,\n\t\t}\n\t}\n\treturn span\n}\n"
  },
  {
    "path": "private/buf/buflsp/file_manager.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file defines a manager for tracking individual files.\n\npackage buflsp\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/pkg/refcount\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// fileManager tracks all files the LSP is currently handling, whether read from disk or opened\n// by the editor.\ntype fileManager struct {\n\tlsp       *lsp\n\turiToFile refcount.Map[protocol.URI, file]\n}\n\n// newFileManager creates a new file manager.\nfunc newFileManager(lsp *lsp) *fileManager {\n\treturn &fileManager{lsp: lsp}\n}\n\n// Track attempts to find the file at the given URI string. If the file has not been seen\n// before, a new entry for the file is created.\n//\n// This will increment the file's refcount.\nfunc (fm *fileManager) Track(uri protocol.URI) *file {\n\tnormalizedURI := normalizeURI(uri)\n\tfile, found := fm.uriToFile.Insert(normalizedURI)\n\tif !found {\n\t\tfile.lsp = fm.lsp\n\t\tfile.uri = normalizedURI\n\t}\n\treturn file\n}\n\n// Get finds a file with the given URI, or returns nil.\nfunc (fm *fileManager) Get(uri protocol.URI) *file {\n\treturn fm.uriToFile.Get(normalizeURI(uri))\n}\n\n// Close marks a file as closed.\n//\n// This will not necessarily evict the file, since there may be more than one user\n// for this file.\nfunc (fm *fileManager) Close(ctx context.Context, uri protocol.URI) {\n\tif deleted := fm.uriToFile.Delete(normalizeURI(uri)); deleted != nil {\n\t\tdeleted.Reset(ctx)\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/folding_range.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/experimental/token\"\n\t\"github.com/bufbuild/protocompile/experimental/token/keyword\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// foldingRange generates folding ranges for a file.\n// It finds messages, services, enums, and multi-line comment blocks.\nfunc (s *server) foldingRange(file *file) []protocol.FoldingRange {\n\tif file.ir == nil {\n\t\treturn nil\n\t}\n\n\tvar ranges []protocol.FoldingRange\n\n\t// Add folding ranges for all types (messages, enums)\n\tfor irType := range seq.Values(file.ir.AllTypes()) {\n\t\tif span := irType.AST().Span(); !span.IsZero() {\n\t\t\tranges = append(ranges, createFoldingRange(span, protocol.RegionFoldingRange))\n\t\t}\n\n\t\t// Add folding ranges for oneofs within messages\n\t\tfor oneof := range seq.Values(irType.Oneofs()) {\n\t\t\tif span := oneof.AST().Span(); !span.IsZero() {\n\t\t\t\tranges = append(ranges, createFoldingRange(span, protocol.RegionFoldingRange))\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add folding ranges for services\n\tfor service := range seq.Values(file.ir.Services()) {\n\t\tif span := service.AST().Span(); !span.IsZero() {\n\t\t\tranges = append(ranges, createFoldingRange(span, protocol.RegionFoldingRange))\n\t\t}\n\n\t\t// Add folding ranges for individual RPC methods\n\t\tfor method := range seq.Values(service.Methods()) {\n\t\t\tif span := method.AST().Span(); !span.IsZero() {\n\t\t\t\tranges = append(ranges, createFoldingRange(span, protocol.RegionFoldingRange))\n\t\t\t}\n\t\t}\n\t}\n\n\t// Add folding ranges for extend blocks\n\tfor extend := range seq.Values(file.ir.Extends()) {\n\t\tif span := extend.AST().Span(); !span.IsZero() {\n\t\t\tranges = append(ranges, createFoldingRange(span, protocol.RegionFoldingRange))\n\t\t}\n\t}\n\n\t// Add folding ranges for multi-line comments\n\tastFile := file.ir.AST()\n\tif astFile != nil {\n\t\tranges = append(ranges, s.commentFoldingRanges(astFile)...)\n\t\tranges = append(ranges, s.importGroupFoldingRanges(astFile)...)\n\t\tranges = append(ranges, s.optionBlockFoldingRanges(astFile)...)\n\t}\n\n\treturn ranges\n}\n\n// commentFoldingRanges creates folding ranges for multi-line comment blocks.\nfunc (s *server) commentFoldingRanges(astFile *ast.File) []protocol.FoldingRange {\n\tvar ranges []protocol.FoldingRange\n\tvar commentBlock []token.Token\n\n\tstream := astFile.Stream()\n\tif stream == nil {\n\t\treturn ranges\n\t}\n\n\t// Collect all comment tokens first\n\tvar commentTokens []token.Token\n\tfor tok := range stream.All() {\n\t\tif tok.Kind() == token.Comment {\n\t\t\tcommentTokens = append(commentTokens, tok)\n\t\t}\n\t}\n\n\t// Group consecutive comment tokens (on consecutive or same lines)\n\tfor _, tok := range commentTokens {\n\t\tif len(commentBlock) == 0 {\n\t\t\tcommentBlock = append(commentBlock, tok)\n\t\t\tcontinue\n\t\t}\n\n\t\tlastComment := commentBlock[len(commentBlock)-1]\n\t\tlastLine := lastComment.Span().EndLoc().Line\n\t\tcurrentLine := tok.Span().StartLoc().Line\n\n\t\t// If comments are on consecutive lines (or same line), group them\n\t\tif currentLine <= lastLine+1 {\n\t\t\tcommentBlock = append(commentBlock, tok)\n\t\t} else {\n\t\t\t// End of comment block - create folding range if multi-line\n\t\t\tif len(commentBlock) > 1 {\n\t\t\t\tfirstComment := commentBlock[0]\n\t\t\t\tlastComment := commentBlock[len(commentBlock)-1]\n\t\t\t\tspan := source.Join(firstComment, lastComment)\n\t\t\t\tranges = append(ranges, createFoldingRange(span, protocol.CommentFoldingRange))\n\t\t\t}\n\t\t\t// Start new block\n\t\t\tcommentBlock = []token.Token{tok}\n\t\t}\n\t}\n\n\t// Handle final comment block\n\tif len(commentBlock) > 1 {\n\t\tfirstComment := commentBlock[0]\n\t\tlastComment := commentBlock[len(commentBlock)-1]\n\t\tspan := source.Join(firstComment, lastComment)\n\t\tranges = append(ranges, createFoldingRange(span, protocol.CommentFoldingRange))\n\t}\n\n\treturn ranges\n}\n\n// importGroupFoldingRanges creates folding ranges for groups of consecutive imports.\nfunc (s *server) importGroupFoldingRanges(astFile *ast.File) []protocol.FoldingRange {\n\tvar ranges []protocol.FoldingRange\n\tvar importGroup []ast.DeclImport\n\n\t// Collect all imports and group consecutive ones\n\tfor imp := range astFile.Imports() {\n\t\tif len(importGroup) == 0 {\n\t\t\timportGroup = append(importGroup, imp)\n\t\t\tcontinue\n\t\t}\n\n\t\tlastImport := importGroup[len(importGroup)-1]\n\t\tlastLine := lastImport.Span().EndLoc().Line\n\t\tcurrentLine := imp.Span().StartLoc().Line\n\n\t\t// If imports are on consecutive lines (or close together), group them\n\t\t// Allow up to 1 blank line between imports to stay in the same group\n\t\tif currentLine <= lastLine+2 {\n\t\t\timportGroup = append(importGroup, imp)\n\t\t} else {\n\t\t\t// End of import group - create folding range if we have multiple imports\n\t\t\tif len(importGroup) > 1 {\n\t\t\t\tfirstImport := importGroup[0]\n\t\t\t\tlastImport := importGroup[len(importGroup)-1]\n\t\t\t\tspan := source.Join(firstImport, lastImport)\n\t\t\t\tranges = append(ranges, createFoldingRange(span, protocol.ImportsFoldingRange))\n\t\t\t}\n\t\t\t// Start new group\n\t\t\timportGroup = []ast.DeclImport{imp}\n\t\t}\n\t}\n\n\t// Handle final import group\n\tif len(importGroup) > 1 {\n\t\tfirstImport := importGroup[0]\n\t\tlastImport := importGroup[len(importGroup)-1]\n\t\tspan := source.Join(firstImport, lastImport)\n\t\tranges = append(ranges, createFoldingRange(span, protocol.ImportsFoldingRange))\n\t}\n\n\treturn ranges\n}\n\n// optionBlockFoldingRanges creates folding ranges for multi-line option blocks.\n// These are options in square brackets [...] that span multiple lines, like:\n//\n//\tstring field = 1 [\n//\t  option1 = value1,\n//\t  option2 = value2\n//\t];\nfunc (s *server) optionBlockFoldingRanges(astFile *ast.File) []protocol.FoldingRange {\n\tvar ranges []protocol.FoldingRange\n\n\tstream := astFile.Stream()\n\tif stream == nil {\n\t\treturn ranges\n\t}\n\n\t// Track seen spans to avoid duplicates from nested token traversal\n\ttype spanKey struct {\n\t\tstartLine int\n\t\tendLine   int\n\t}\n\tseen := make(map[spanKey]bool)\n\n\t// Iterate through all tokens looking for multi-line bracket pairs\n\tfor tok := range stream.All() {\n\t\t// Only handle fused bracket tokens, which are used for option blocks\n\t\tif tok.Keyword() == keyword.Brackets {\n\t\t\tspan := tok.Span()\n\t\t\tstartLine := span.StartLoc().Line\n\t\t\tendLine := span.EndLoc().Line\n\t\t\t// Only add if it spans multiple lines and we haven't seen it yet\n\t\t\tif endLine > startLine {\n\t\t\t\tkey := spanKey{startLine: startLine, endLine: endLine}\n\t\t\t\tif !seen[key] {\n\t\t\t\t\tseen[key] = true\n\t\t\t\t\tranges = append(ranges, createFoldingRange(span, protocol.RegionFoldingRange))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ranges\n}\n\n// createFoldingRange creates a protocol.FoldingRange from a source span.\nfunc createFoldingRange(span source.Span, kind protocol.FoldingRangeKind) protocol.FoldingRange {\n\tstartLoc := span.StartLoc()\n\tendLoc := span.EndLoc()\n\n\t// Convert from 1-based to 0-based line numbers\n\treturn protocol.FoldingRange{\n\t\tStartLine: uint32(startLoc.Line - 1),\n\t\tEndLine:   uint32(endLoc.Line - 1),\n\t\tKind:      kind,\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/folding_range_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestFoldingRange(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tname              string\n\t\tfile              string\n\t\texpectedAssertion func(t *testing.T, ranges []protocol.FoldingRange)\n\t}{\n\t\t{\n\t\t\tname: \"comprehensive\",\n\t\t\tfile: \"folding.proto\",\n\t\t\texpectedAssertion: func(t *testing.T, ranges []protocol.FoldingRange) {\n\t\t\t\tt.Helper()\n\t\t\t\trequire.NotEmpty(t, ranges)\n\n\t\t\t\t// Find import group\n\t\t\t\tassert.True(t, findRange(ranges, 4, 6, protocol.ImportsFoldingRange), \"import group\")\n\n\t\t\t\t// Find multi-line comment\n\t\t\t\tassert.True(t, findRange(ranges, 8, 10, protocol.CommentFoldingRange), \"multi-line comment\")\n\n\t\t\t\t// Find User message\n\t\t\t\tassert.True(t, findRange(ranges, 11, 15, protocol.RegionFoldingRange), \"User message\")\n\n\t\t\t\t// Find Status enum\n\t\t\t\tassert.True(t, findRange(ranges, 17, 21, protocol.RegionFoldingRange), \"Status enum\")\n\n\t\t\t\t// Find UserService\n\t\t\t\tassert.True(t, findRange(ranges, 23, 32, protocol.RegionFoldingRange), \"UserService\")\n\n\t\t\t\t// Find individual RPCs\n\t\t\t\tassert.True(t, findRange(ranges, 24, 24, protocol.RegionFoldingRange), \"GetUser RPC\")\n\t\t\t\tassert.True(t, findRange(ranges, 25, 25, protocol.RegionFoldingRange), \"CreateUser RPC\")\n\t\t\t\tassert.True(t, findRange(ranges, 28, 31, protocol.RegionFoldingRange), \"UpdateUser multi-line RPC\")\n\n\t\t\t\t// Find Config message\n\t\t\t\tassert.True(t, findRange(ranges, 60, 65, protocol.RegionFoldingRange), \"Config message\")\n\n\t\t\t\t// Find Repository message with multi-line options\n\t\t\t\tassert.True(t, findRange(ranges, 67, 74, protocol.RegionFoldingRange), \"Repository message\")\n\t\t\t\tassert.True(t, findRange(ranges, 68, 71, protocol.RegionFoldingRange), \"multi-line field options\")\n\n\t\t\t\t// Find Profile message with oneof and nested Address\n\t\t\t\tassert.True(t, findRange(ranges, 76, 88, protocol.RegionFoldingRange), \"Profile message\")\n\t\t\t\tassert.True(t, findRange(ranges, 77, 80, protocol.RegionFoldingRange), \"oneof\")\n\t\t\t\tassert.True(t, findRange(ranges, 83, 87, protocol.RegionFoldingRange), \"nested Address\")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto2_extensions\",\n\t\t\tfile: \"extensions.proto\",\n\t\t\texpectedAssertion: func(t *testing.T, ranges []protocol.FoldingRange) {\n\t\t\t\tt.Helper()\n\t\t\t\trequire.NotEmpty(t, ranges)\n\n\t\t\t\t// Find User message\n\t\t\t\tassert.True(t, findRange(ranges, 5, 9, protocol.RegionFoldingRange), \"User message\")\n\n\t\t\t\t// Find extend block\n\t\t\t\tassert.True(t, findRange(ranges, 12, 15, protocol.RegionFoldingRange), \"extend block\")\n\n\t\t\t\t// Find UserMetadata message\n\t\t\t\tassert.True(t, findRange(ranges, 18, 30, protocol.RegionFoldingRange), \"UserMetadata message\")\n\n\t\t\t\t// Find nested AuditInfo\n\t\t\t\tassert.True(t, findRange(ranges, 23, 27, protocol.RegionFoldingRange), \"nested AuditInfo\")\n\n\t\t\t\t// Find Preferences message\n\t\t\t\tassert.True(t, findRange(ranges, 33, 36, protocol.RegionFoldingRange), \"Preferences message\")\n\n\t\t\t\t// Find Settings message with multi-line options\n\t\t\t\tassert.True(t, findRange(ranges, 39, 44, protocol.RegionFoldingRange), \"Settings message\")\n\t\t\t\tassert.True(t, findRange(ranges, 40, 43, protocol.RegionFoldingRange), \"multi-line field options in proto2\")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"minimal\",\n\t\t\tfile: \"minimal.proto\",\n\t\t\texpectedAssertion: func(t *testing.T, ranges []protocol.FoldingRange) {\n\t\t\t\tt.Helper()\n\t\t\t\t// Should have exactly 1 range (the Simple message)\n\t\t\t\tassert.Len(t, ranges, 1, \"expected exactly 1 folding range\")\n\t\t\t\tif len(ranges) > 0 {\n\t\t\t\t\tassert.Equal(t, uint32(5), ranges[0].StartLine)\n\t\t\t\t\tassert.Equal(t, uint32(7), ranges[0].EndLine)\n\t\t\t\t\tassert.Equal(t, protocol.RegionFoldingRange, ranges[0].Kind)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"imports\",\n\t\t\tfile: \"imports.proto\",\n\t\t\texpectedAssertion: func(t *testing.T, ranges []protocol.FoldingRange) {\n\t\t\t\tt.Helper()\n\t\t\t\t// Count import groups\n\t\t\t\timportGroupCount := 0\n\t\t\t\tfor _, r := range ranges {\n\t\t\t\t\tif r.Kind == protocol.ImportsFoldingRange {\n\t\t\t\t\t\timportGroupCount++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Should have 3 import groups (separated by different gaps)\n\t\t\t\tassert.Equal(t, 3, importGroupCount, \"expected 3 import groups\")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"nested\",\n\t\t\tfile: \"nested.proto\",\n\t\t\texpectedAssertion: func(t *testing.T, ranges []protocol.FoldingRange) {\n\t\t\t\tt.Helper()\n\t\t\t\trequire.NotEmpty(t, ranges)\n\n\t\t\t\t// Find Level4 message (most deeply nested)\n\t\t\t\tassert.True(t, findRange(ranges, 14, 17, protocol.RegionFoldingRange), \"Level4 nested message\")\n\n\t\t\t\t// Find ComplexOneof with many options\n\t\t\t\tassert.True(t, findRange(ranges, 30, 39, protocol.RegionFoldingRange), \"ComplexOneof\")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"comments\",\n\t\t\tfile: \"comments.proto\",\n\t\t\texpectedAssertion: func(t *testing.T, ranges []protocol.FoldingRange) {\n\t\t\t\tt.Helper()\n\t\t\t\t// Count comment folding ranges\n\t\t\t\tcommentCount := 0\n\t\t\t\tfor _, r := range ranges {\n\t\t\t\t\tif r.Kind == protocol.CommentFoldingRange {\n\t\t\t\t\t\tcommentCount++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Should have multiple multi-line comment blocks but NOT single-line comments\n\t\t\t\tassert.GreaterOrEqual(t, commentCount, 4, \"expected at least 4 multi-line comment blocks\")\n\n\t\t\t\t// Verify the large comment block is found (spans at least 8 lines)\n\t\t\t\tfoundLarge := false\n\t\t\t\tfor _, r := range ranges {\n\t\t\t\t\tif r.Kind == protocol.CommentFoldingRange && r.EndLine-r.StartLine >= 8 {\n\t\t\t\t\t\tfoundLarge = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tassert.True(t, foundLarge, \"expected large multi-line comment block\")\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"options\",\n\t\t\tfile: \"options.proto\",\n\t\t\texpectedAssertion: func(t *testing.T, ranges []protocol.FoldingRange) {\n\t\t\t\tt.Helper()\n\t\t\t\t// Count multi-line option blocks (small regions)\n\t\t\t\toptionBlockCount := 0\n\t\t\t\tfor _, r := range ranges {\n\t\t\t\t\tif r.Kind == protocol.RegionFoldingRange && r.EndLine-r.StartLine <= 3 {\n\t\t\t\t\t\toptionBlockCount++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Should have multiple multi-line field option blocks\n\t\t\t\tassert.GreaterOrEqual(t, optionBlockCount, 5, \"expected at least 5 multi-line option blocks\")\n\n\t\t\t\t// Verify FieldOptions message is found\n\t\t\t\tassert.True(t, findRangeMinEnd(ranges, 5, 19, protocol.RegionFoldingRange), \"FieldOptions message\")\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tctx := t.Context()\n\n\t\t\tprotoPath, err := filepath.Abs(filepath.Join(\"testdata/folding_range\", tt.file))\n\t\t\trequire.NoError(t, err)\n\n\t\t\tclientJSONConn, protoURI := setupLSPServer(t, protoPath)\n\n\t\t\tvar ranges []protocol.FoldingRange\n\t\t\t_, err = clientJSONConn.Call(ctx, protocol.MethodTextDocumentFoldingRange, protocol.FoldingRangeParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: protoURI,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &ranges)\n\t\t\trequire.NoError(t, err)\n\n\t\t\t// Run custom assertions\n\t\t\ttt.expectedAssertion(t, ranges)\n\n\t\t\t// Verify no overlapping ranges (nested is OK, but improper overlap is not)\n\t\t\tassertNoOverlappingFoldingRanges(t, ranges)\n\t\t})\n\t}\n}\n\n// findRange returns true if a folding range with the exact start/end lines and kind exists.\nfunc findRange(ranges []protocol.FoldingRange, startLine, endLine uint32, kind protocol.FoldingRangeKind) bool {\n\tfor _, r := range ranges {\n\t\tif r.StartLine == startLine && r.EndLine == endLine && r.Kind == kind {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// findRangeMinEnd returns true if a folding range with the exact start line, at least the end line, and kind exists.\nfunc findRangeMinEnd(ranges []protocol.FoldingRange, startLine, minEndLine uint32, kind protocol.FoldingRangeKind) bool {\n\tfor _, r := range ranges {\n\t\tif r.StartLine == startLine && r.EndLine >= minEndLine && r.Kind == kind {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// assertNoOverlappingFoldingRanges verifies that no two folding ranges improperly overlap.\nfunc assertNoOverlappingFoldingRanges(t *testing.T, ranges []protocol.FoldingRange) {\n\tt.Helper()\n\n\tfor i := range ranges {\n\t\tfor j := i + 1; j < len(ranges); j++ {\n\t\t\tr1 := ranges[i]\n\t\t\tr2 := ranges[j]\n\n\t\t\t// Check for improper overlap (one starts inside another but doesn't nest properly)\n\t\t\t// Proper nesting: r2 is completely inside r1, or r1 is completely inside r2, or no overlap\n\t\t\tr1ContainsR2 := r1.StartLine <= r2.StartLine && r1.EndLine >= r2.EndLine\n\t\t\tr2ContainsR1 := r2.StartLine <= r1.StartLine && r2.EndLine >= r1.EndLine\n\t\t\tnoOverlap := r1.EndLine < r2.StartLine || r2.EndLine < r1.StartLine\n\n\t\t\tassert.True(\n\t\t\t\tt,\n\t\t\t\tr1ContainsR2 || r2ContainsR1 || noOverlap,\n\t\t\t\t\"Folding ranges improperly overlap:\\nRange %d: lines %d-%d\\nRange %d: lines %d-%d\",\n\t\t\t\ti, r1.StartLine, r1.EndLine,\n\t\t\t\tj, r2.StartLine, r2.EndLine,\n\t\t\t)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/format_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"context\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/bufformat\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestFormatting(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttests := []struct {\n\t\tname           string\n\t\tprotoFile      string\n\t\texpectEdits    bool\n\t\texpectNumEdits int\n\t}{\n\t\t{\n\t\t\tname:           \"format_unformatted_file\",\n\t\t\tprotoFile:      \"unformatted.proto\",\n\t\t\texpectEdits:    true,\n\t\t\texpectNumEdits: 1,\n\t\t},\n\t\t{\n\t\t\tname:           \"format_already_formatted_file\",\n\t\t\tprotoFile:      \"formatted.proto\",\n\t\t\texpectEdits:    false,\n\t\t\texpectNumEdits: 0,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\ttestProtoPath, err := filepath.Abs(filepath.Join(\"testdata/format\", tt.protoFile))\n\t\t\trequire.NoError(t, err)\n\t\t\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\t\t\tvar textEdits []protocol.TextEdit\n\t\t\t_, formatErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentFormatting, protocol.DocumentFormattingParams{\n\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\tURI: testURI,\n\t\t\t\t},\n\t\t\t}, &textEdits)\n\t\t\trequire.NoError(t, formatErr)\n\t\t\tassert.Len(t, textEdits, tt.expectNumEdits)\n\t\t\tif tt.expectEdits {\n\t\t\t\texpectedFormatted := getExpectedFormattedContent(t, ctx, testProtoPath)\n\t\t\t\tassert.Equal(t, expectedFormatted, textEdits[0].NewText)\n\t\t\t\tassert.Equal(t, uint32(0), textEdits[0].Range.Start.Line)\n\t\t\t\tassert.Equal(t, uint32(0), textEdits[0].Range.Start.Character)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc getExpectedFormattedContent(t *testing.T, ctx context.Context, protoPath string) string {\n\tt.Helper()\n\tdir := filepath.Dir(protoPath)\n\tbucket, err := storageos.NewProvider().NewReadWriteBucket(dir)\n\trequire.NoError(t, err)\n\tformattedBucket, err := bufformat.FormatBucket(ctx, bucket)\n\trequire.NoError(t, err)\n\tformatted, err := storage.ReadPath(ctx, formattedBucket, filepath.Base(protoPath))\n\trequire.NoError(t, err)\n\treturn string(formatted)\n}\n"
  },
  {
    "path": "private/buf/buflsp/hover_cel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"fmt\"\n\t\"maps\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/google/cel-go/cel\"\n\t\"github.com/google/cel-go/common\"\n\t\"github.com/google/cel-go/common/ast\"\n\t\"github.com/google/cel-go/common/operators\"\n\t\"github.com/google/cel-go/common/overloads\"\n\t\"github.com/google/cel-go/common/types\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// getCELHover returns hover documentation for CEL expressions.\n// If the cursor is over a CEL expression, it returns documentation for the token at that position.\nfunc getCELHover(\n\tfile *file,\n\tposition protocol.Position,\n\tcelEnv *cel.Env,\n) *protocol.Hover {\n\t// Convert position to byte offset\n\tlineColumn := file.file.InverseLocation(int(position.Line)+1, int(position.Character)+1, positionalEncoding)\n\tbyteOffset := lineColumn.Offset\n\n\t// Find if we're inside a CEL expression\n\tfor _, symbol := range file.symbols {\n\t\tcelExpressions := extractCELExpressions(file, symbol)\n\t\tfor _, exprInfo := range celExpressions {\n\t\t\t// Check if cursor is within this CEL expression span\n\t\t\tif byteOffset < exprInfo.span.Start || byteOffset >= exprInfo.span.End {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Calculate offset within the CEL expression.\n\t\t\t// For single-line literals this is simple arithmetic; for multi-line\n\t\t\t// (adjacent proto string literals) we must walk the span to find the\n\t\t\t// matching CEL byte position.\n\t\t\tcelOffset := fileByteOffsetToCELOffset(byteOffset, exprInfo.span)\n\t\t\tif celOffset < 0 || celOffset >= len(exprInfo.expression) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Parse the CEL expression. MacroCalls are only preserved in the\n\t\t\t// parsed AST (they are expanded in the checked AST), so we always\n\t\t\t// parse first and keep both.\n\t\t\tparsedAST, parseIssues := celEnv.Parse(exprInfo.expression)\n\t\t\tif parseIssues.Err() != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Default to the parsed AST, but prefer the checked AST for full\n\t\t\t// type information if type-checking succeeds.\n\t\t\tastForTypeInfo := parsedAST\n\t\t\tvar typeMap map[int64]*types.Type\n\n\t\t\tif checkedAST, compileIssues := celEnv.Compile(exprInfo.expression); compileIssues.Err() == nil {\n\t\t\t\tastForTypeInfo = checkedAST\n\t\t\t\ttypeMap = checkedAST.NativeRep().TypeMap()\n\t\t\t}\n\n\t\t\t// Find the token at the cursor position using proper AST walking.\n\t\t\t// Pass both ASTs: astForTypeInfo (for type info) and parsedAST (for macro info).\n\t\t\thoverInfo := findCELTokenAtOffset(astForTypeInfo, parsedAST, celOffset, exprInfo, typeMap)\n\t\t\tif hoverInfo == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Format documentation for the hover\n\t\t\tdocs := formatCELHoverContent(hoverInfo, celEnv)\n\t\t\tif docs == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Create hover range - highlight the whole token\n\t\t\ttokenSpan := createCELSpan(hoverInfo.start, hoverInfo.end, exprInfo.span)\n\t\t\tif tokenSpan.IsZero() {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\thoverRange := reportSpanToProtocolRange(tokenSpan)\n\t\t\treturn &protocol.Hover{\n\t\t\t\tContents: protocol.MarkupContent{\n\t\t\t\t\tKind:  protocol.Markdown,\n\t\t\t\t\tValue: docs,\n\t\t\t\t},\n\t\t\t\tRange: &hoverRange,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// celHoverInfo represents information about a CEL token for hover display\ntype celHoverInfo struct {\n\tkind        celHoverKind\n\ttext        string\n\tstart       int         // byte offset in CEL expression\n\tend         int         // byte offset in CEL expression\n\tcelType     *types.Type // from type checker\n\tprotoMember ir.Member   // resolved proto field\n\texprID      int64\n}\n\ntype celHoverKind int\n\nconst (\n\tcelHoverFunction celHoverKind = iota\n\tcelHoverOperator\n\tcelHoverKeyword\n\tcelHoverMacro\n\tcelHoverType\n\tcelHoverField\n\tcelHoverVariable\n\tcelHoverLiteral\n)\n\n// findCELTokenAtOffset finds the CEL token at the given offset using proper AST traversal.\n//\n// Parameters:\n//   - astForTypeInfo: The primary AST to walk (checked AST if available, otherwise parsed AST).\n//     Used for all expression walking and type information lookups.\n//   - parsedAst: The original parsed AST. Only used for macro lookups since MacroCalls\n//     are preserved only in the parsed AST (they get expanded in checked ASTs).\n//   - offset: The byte offset within the CEL expression string.\n//   - exprInfo: Context about the CEL expression being analyzed.\n//   - typeMap: Type information from the type checker (nil if only parsed AST available).\n//\n// Returns hover information for the token at the offset, or nil if not found.\nfunc findCELTokenAtOffset(astForTypeInfo *cel.Ast, parsedAst *cel.Ast, offset int, exprInfo celExpressionInfo, typeMap map[int64]*types.Type) *celHoverInfo {\n\t// Get expression and source info from the native AST directly\n\tnativeAST := astForTypeInfo.NativeRep()\n\tsourceInfo := nativeAST.SourceInfo()\n\texpr := nativeAST.Expr()\n\n\t// Walk the AST to find the deepest matching expression at the cursor position\n\t// Track comprehension variables for proper scoping\n\tcompVars := make(map[string]bool)\n\tresult := walkCELExprForHover(expr, sourceInfo, offset, exprInfo.expression, compVars, exprInfo, typeMap)\n\n\t// If we didn't find anything in the main AST, check macro calls in the parsed AST\n\t// Macros are expanded in the main AST, but parsedAst.MacroCalls preserves the original macro syntax\n\tif result == nil && parsedAst != nil {\n\t\tresult = findMacroAtOffset(parsedAst.NativeRep().SourceInfo(), offset, exprInfo.expression)\n\t}\n\n\treturn result\n}\n\n// findMacroAtOffset checks if the offset is within a CEL macro call.\n// Macros like has(), all(), exists(), map(), filter() are expanded in the main AST,\n// but sourceInfo.MacroCalls preserves the original macro call information.\nfunc findMacroAtOffset(sourceInfo *ast.SourceInfo, offset int, exprString string) *celHoverInfo {\n\tif sourceInfo == nil {\n\t\treturn nil\n\t}\n\n\t// Process each macro call\n\tfor macroID, macroExpr := range sourceInfo.MacroCalls() {\n\t\tif macroExpr.Kind() != ast.CallKind {\n\t\t\tcontinue\n\t\t}\n\t\tcall := macroExpr.AsCall()\n\t\tfuncName := call.FunctionName()\n\n\t\t// Only process recognized CEL macros\n\t\tif !isCELMacroFunction(funcName) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Get the position of the macro call (rune offset from CEL)\n\t\tstartLoc := sourceInfo.GetStartLocation(macroID)\n\t\tif startLoc.Line() <= 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// For method-style macros like this.all(...), find the method name after the dot\n\t\t// For standalone macros like has(...), find the function name before the paren\n\t\tvar funcStart, funcEnd int\n\t\tvar found bool\n\n\t\tif call.IsMemberFunction() {\n\t\t\t// Method call - search for \".funcName\" after the target\n\t\t\ttargetID := call.Target().ID()\n\t\t\ttargetLoc := sourceInfo.GetStartLocation(targetID)\n\t\t\tif targetLoc.Line() > 0 {\n\t\t\t\ttargetByteOffset := celLocByteOffset(targetLoc.Line(), targetLoc.Column(), sourceInfo, exprString)\n\t\t\t\tfuncStart, funcEnd = findMethodNameAfterDot(targetByteOffset, funcName, exprString)\n\t\t\t\tfound = funcStart >= 0\n\t\t\t}\n\t\t} else {\n\t\t\t// Standalone function call - CEL position points to opening paren, look backwards\n\t\t\tcelByteOffset := celLocByteOffset(startLoc.Line(), startLoc.Column(), sourceInfo, exprString)\n\t\t\tfuncStart, funcEnd, found = findStandaloneFunctionName(celByteOffset, funcName, exprString)\n\t\t}\n\n\t\t// Check if offset is within the macro function name\n\t\tif found && offset >= funcStart && offset < funcEnd {\n\t\t\treturn &celHoverInfo{\n\t\t\t\tkind:   celHoverMacro,\n\t\t\t\ttext:   funcName,\n\t\t\t\tstart:  funcStart,\n\t\t\t\tend:    funcEnd,\n\t\t\t\texprID: macroID,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// walkCELExprForHover walks the CEL AST to find the token at the given offset.\n// Returns the deepest matching expression that contains the offset.\nfunc walkCELExprForHover(\n\texpr ast.Expr,\n\tsourceInfo *ast.SourceInfo,\n\toffset int,\n\texprString string,\n\tcompVars map[string]bool,\n\texprInfo celExpressionInfo,\n\ttypeMap map[int64]*types.Type,\n) *celHoverInfo {\n\tif expr == nil || expr.Kind() == ast.UnspecifiedExprKind {\n\t\treturn nil\n\t}\n\n\t// Get the CEL rune offset for this expression and convert to byte offset.\n\t// CEL tracks positions as Unicode code point (rune) offsets, not byte offsets.\n\tstartLoc := sourceInfo.GetStartLocation(expr.ID())\n\tif startLoc.Line() <= 0 {\n\t\treturn nil\n\t}\n\tcelByteOffset := celLocByteOffset(startLoc.Line(), startLoc.Column(), sourceInfo, exprString)\n\n\t// Variable to hold the best match (deepest expression containing offset)\n\tvar bestMatch *celHoverInfo\n\n\tswitch expr.Kind() {\n\tcase ast.IdentKind:\n\t\t// Identifier reference (variable, field, keyword)\n\t\tidentName := expr.AsIdent()\n\n\t\t// Determine the hover kind\n\t\tvar hoverKind celHoverKind\n\t\tif isCELKeyword(identName) {\n\t\t\thoverKind = celHoverKeyword\n\t\t} else if compVars != nil && compVars[identName] {\n\t\t\t// Comprehension variable\n\t\t\thoverKind = celHoverVariable\n\t\t} else {\n\t\t\t// Field access or other identifier\n\t\t\thoverKind = celHoverField\n\t\t}\n\n\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\tif offset >= byteStart && offset < byteStop {\n\t\t\t\thoverInfo := &celHoverInfo{\n\t\t\t\t\tkind:   hoverKind,\n\t\t\t\t\ttext:   identName,\n\t\t\t\t\tstart:  byteStart,\n\t\t\t\t\tend:    byteStop,\n\t\t\t\t\texprID: expr.ID(),\n\t\t\t\t}\n\t\t\t\t// Add type information if available\n\t\t\t\tif typeMap != nil {\n\t\t\t\t\tif celType, hasType := typeMap[expr.ID()]; hasType {\n\t\t\t\t\t\thoverInfo.celType = celType\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbestMatch = hoverInfo\n\t\t\t}\n\t\t}\n\n\tcase ast.SelectKind:\n\t\t// Field access (target.field)\n\t\tsel := expr.AsSelect()\n\n\t\t// Walk target first (might contain the offset)\n\t\tif sel.Operand() != nil {\n\t\t\tif targetMatch := walkCELExprForHover(sel.Operand(), sourceInfo, offset, exprString, compVars, exprInfo, typeMap); targetMatch != nil {\n\t\t\t\tbestMatch = targetMatch\n\t\t\t}\n\t\t}\n\n\t\t// Check if cursor is on the field name itself\n\t\tif sel.Operand() != nil {\n\t\t\ttargetLoc := sourceInfo.GetStartLocation(sel.Operand().ID())\n\t\t\tif targetLoc.Line() > 0 {\n\t\t\t\ttargetByteOffset := celLocByteOffset(targetLoc.Line(), targetLoc.Column(), sourceInfo, exprString)\n\t\t\t\tfieldStart, fieldEnd := findMethodNameAfterDot(targetByteOffset, sel.FieldName(), exprString)\n\t\t\t\tif fieldStart >= 0 && offset >= fieldStart && offset < fieldEnd {\n\t\t\t\t\t// Cursor is on the field name\n\t\t\t\t\thoverInfo := &celHoverInfo{\n\t\t\t\t\t\tkind:   celHoverField,\n\t\t\t\t\t\ttext:   sel.FieldName(),\n\t\t\t\t\t\tstart:  fieldStart,\n\t\t\t\t\t\tend:    fieldEnd,\n\t\t\t\t\t\texprID: expr.ID(),\n\t\t\t\t\t}\n\t\t\t\t\t// Add type information\n\t\t\t\t\tif typeMap != nil {\n\t\t\t\t\t\tif celType, hasType := typeMap[expr.ID()]; hasType {\n\t\t\t\t\t\t\thoverInfo.celType = celType\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Try to resolve proto field\n\t\t\t\t\thoverInfo.protoMember = resolveCELFieldAccess(sel, exprInfo)\n\t\t\t\t\tbestMatch = hoverInfo\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tcase ast.CallKind:\n\t\t// Function call or operator\n\t\tcall := expr.AsCall()\n\n\t\t// Walk target first (for method calls)\n\t\tif call.IsMemberFunction() {\n\t\t\tif targetMatch := walkCELExprForHover(call.Target(), sourceInfo, offset, exprString, compVars, exprInfo, typeMap); targetMatch != nil {\n\t\t\t\tbestMatch = targetMatch\n\t\t\t}\n\t\t}\n\n\t\t// Walk arguments to see if offset is in any of them\n\t\tfor _, arg := range call.Args() {\n\t\t\tif argMatch := walkCELExprForHover(arg, sourceInfo, offset, exprString, compVars, exprInfo, typeMap); argMatch != nil {\n\t\t\t\tbestMatch = argMatch\n\t\t\t}\n\t\t}\n\n\t\tfuncName := call.FunctionName()\n\n\t\t// Check if this is an operator\n\t\tif _, isOperator := celOperatorSymbol(funcName); isOperator {\n\t\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\t\tif offset >= byteStart && offset < byteStop {\n\t\t\t\t\tbestMatch = &celHoverInfo{\n\t\t\t\t\t\tkind:   celHoverOperator,\n\t\t\t\t\t\ttext:   funcName,\n\t\t\t\t\t\tstart:  byteStart,\n\t\t\t\t\t\tend:    byteStop,\n\t\t\t\t\t\texprID: expr.ID(),\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Determine the function hover kind\n\t\t\tvar hoverKind celHoverKind\n\t\t\tif isCELMacroFunction(funcName) {\n\t\t\t\thoverKind = celHoverMacro\n\t\t\t} else if overloads.IsTypeConversionFunction(funcName) {\n\t\t\t\thoverKind = celHoverType\n\t\t\t} else {\n\t\t\t\thoverKind = celHoverFunction\n\t\t\t}\n\n\t\t\t// Check if cursor is on the function name\n\t\t\tvar funcStart, funcEnd int\n\t\t\tvar found bool\n\n\t\t\tif call.IsMemberFunction() {\n\t\t\t\t// Method call - search for the function name after the target\n\t\t\t\ttargetLoc := sourceInfo.GetStartLocation(call.Target().ID())\n\t\t\t\tif targetLoc.Line() > 0 {\n\t\t\t\t\ttargetByteOffset := celLocByteOffset(targetLoc.Line(), targetLoc.Column(), sourceInfo, exprString)\n\t\t\t\t\tfuncStart, funcEnd = findMethodNameAfterDot(targetByteOffset, funcName, exprString)\n\t\t\t\t\tfound = funcStart >= 0\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Standalone function call - function name is before the opening paren\n\t\t\t\tfuncStart, funcEnd, found = findStandaloneFunctionName(celByteOffset, funcName, exprString)\n\t\t\t}\n\n\t\t\tif found && offset >= funcStart && offset < funcEnd {\n\t\t\t\tbestMatch = &celHoverInfo{\n\t\t\t\t\tkind:   hoverKind,\n\t\t\t\t\ttext:   funcName,\n\t\t\t\t\tstart:  funcStart,\n\t\t\t\t\tend:    funcEnd,\n\t\t\t\t\texprID: expr.ID(),\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tcase ast.LiteralKind:\n\t\t// Constant literal\n\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\tif offset >= byteStart && offset < byteStop {\n\t\t\t\tbestMatch = &celHoverInfo{\n\t\t\t\t\tkind:    celHoverLiteral,\n\t\t\t\t\ttext:    exprString[byteStart:byteStop],\n\t\t\t\t\tstart:   byteStart,\n\t\t\t\t\tend:     byteStop,\n\t\t\t\t\texprID:  expr.ID(),\n\t\t\t\t\tcelType: getPrimitiveTypeForLiteral(expr),\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tcase ast.ListKind:\n\t\t// List literal - walk all elements\n\t\tfor _, elem := range expr.AsList().Elements() {\n\t\t\tif elemMatch := walkCELExprForHover(elem, sourceInfo, offset, exprString, compVars, exprInfo, typeMap); elemMatch != nil {\n\t\t\t\tbestMatch = elemMatch\n\t\t\t}\n\t\t}\n\n\tcase ast.MapKind:\n\t\t// Map literal - walk all entries\n\t\tfor _, entry := range expr.AsMap().Entries() {\n\t\t\tmapEntry := entry.AsMapEntry()\n\t\t\tif keyMatch := walkCELExprForHover(mapEntry.Key(), sourceInfo, offset, exprString, compVars, exprInfo, typeMap); keyMatch != nil {\n\t\t\t\tbestMatch = keyMatch\n\t\t\t}\n\t\t\tif valueMatch := walkCELExprForHover(mapEntry.Value(), sourceInfo, offset, exprString, compVars, exprInfo, typeMap); valueMatch != nil {\n\t\t\t\tbestMatch = valueMatch\n\t\t\t}\n\t\t}\n\n\tcase ast.StructKind:\n\t\t// Struct literal - walk all field values\n\t\tfor _, field := range expr.AsStruct().Fields() {\n\t\t\tif fieldMatch := walkCELExprForHover(field.AsStructField().Value(), sourceInfo, offset, exprString, compVars, exprInfo, typeMap); fieldMatch != nil {\n\t\t\t\tbestMatch = fieldMatch\n\t\t\t}\n\t\t}\n\n\tcase ast.ComprehensionKind:\n\t\t// List comprehension - walk all parts with proper variable scoping\n\t\tcomp := expr.AsComprehension()\n\n\t\t// Walk the range and init with current scope (they don't see loop variables)\n\t\tif rangeMatch := walkCELExprForHover(comp.IterRange(), sourceInfo, offset, exprString, compVars, exprInfo, typeMap); rangeMatch != nil {\n\t\t\tbestMatch = rangeMatch\n\t\t}\n\t\tif initMatch := walkCELExprForHover(comp.AccuInit(), sourceInfo, offset, exprString, compVars, exprInfo, typeMap); initMatch != nil {\n\t\t\tbestMatch = initMatch\n\t\t}\n\n\t\t// Create extended scope with comprehension variables for the loop body\n\t\textendedVars := compVars\n\t\tif comp.IterVar() != \"\" || comp.AccuVar() != \"\" {\n\t\t\t// Copy the current compVars map and add the new variables\n\t\t\tif compVars != nil {\n\t\t\t\textendedVars = make(map[string]bool, len(compVars)+2)\n\t\t\t\tmaps.Copy(extendedVars, compVars)\n\t\t\t} else {\n\t\t\t\textendedVars = make(map[string]bool, 2)\n\t\t\t}\n\t\t\tif comp.IterVar() != \"\" {\n\t\t\t\textendedVars[comp.IterVar()] = true\n\t\t\t}\n\t\t\tif comp.AccuVar() != \"\" {\n\t\t\t\textendedVars[comp.AccuVar()] = true\n\t\t\t}\n\t\t}\n\n\t\t// Walk the loop body with extended scope (they can see loop variables)\n\t\tif condMatch := walkCELExprForHover(comp.LoopCondition(), sourceInfo, offset, exprString, extendedVars, exprInfo, typeMap); condMatch != nil {\n\t\t\tbestMatch = condMatch\n\t\t}\n\t\tif stepMatch := walkCELExprForHover(comp.LoopStep(), sourceInfo, offset, exprString, extendedVars, exprInfo, typeMap); stepMatch != nil {\n\t\t\tbestMatch = stepMatch\n\t\t}\n\t\tif resultMatch := walkCELExprForHover(comp.Result(), sourceInfo, offset, exprString, extendedVars, exprInfo, typeMap); resultMatch != nil {\n\t\t\tbestMatch = resultMatch\n\t\t}\n\t}\n\n\treturn bestMatch\n}\n\n// formatCELHoverContent formats hover information into markdown documentation\nfunc formatCELHoverContent(info *celHoverInfo, celEnv *cel.Env) string {\n\tif info == nil {\n\t\treturn \"\"\n\t}\n\n\tvar result string\n\tswitch info.kind {\n\tcase celHoverKeyword:\n\t\tresult = getCELKeywordDocs(info.text)\n\tcase celHoverFunction:\n\t\tresult = getCELFunctionDocs(info.text, celEnv)\n\t\t// Add inferred return type if available\n\t\tif info.celType != nil {\n\t\t\tresult += fmt.Sprintf(\"\\n\\n**Return type**: `%s`\", getCELTypeString(info.celType))\n\t\t}\n\tcase celHoverOperator:\n\t\tresult = getCELOperatorDocs(info.text, celEnv)\n\tcase celHoverMacro:\n\t\tresult = getCELMacroDocs(info.text, celEnv)\n\tcase celHoverType:\n\t\tresult = getCELTypeDocs(info.text, celEnv)\n\tcase celHoverField:\n\t\t// For fields, show comprehensive proto field info\n\t\tresult = fmt.Sprintf(\"**Field**: `%s`\", info.text)\n\n\t\t// Add CEL type information\n\t\tif info.celType != nil {\n\t\t\tresult += fmt.Sprintf(\"\\n\\n**Type**: `%s`\", getCELTypeString(info.celType))\n\t\t}\n\n\t\t// Add proto field information if resolved\n\t\tif !info.protoMember.IsZero() {\n\t\t\tresult += \"\\n\\n\" + getProtoFieldDocumentation(info.protoMember)\n\t\t}\n\tcase celHoverVariable:\n\t\t// Comprehension variable\n\t\tresult = fmt.Sprintf(\"**Variable**: `%s`\\n\\nLoop variable from comprehension.\", info.text)\n\t\tif info.celType != nil {\n\t\t\tresult += fmt.Sprintf(\"\\n\\n**Type**: `%s`\", getCELTypeString(info.celType))\n\t\t}\n\tcase celHoverLiteral:\n\t\t// Literal value\n\t\ttypeName := \"value\"\n\t\tif info.celType != nil {\n\t\t\ttypeName = getCELTypeString(info.celType)\n\t\t}\n\t\tresult = fmt.Sprintf(\"**Literal**: `%s`\\n\\n**Type**: %s\", info.text, typeName)\n\tdefault:\n\t\treturn \"\"\n\t}\n\n\t// Append documentation link if available\n\tif link := celDocumentationLinks(info.kind, info.text); link != \"\" {\n\t\tresult += \"\\n\\n\" + link\n\t}\n\n\treturn result\n}\n\n// celDocumentationLinks returns a markdown link to external documentation for a CEL hover item.\n// Returns an empty string if no documentation link is available.\nfunc celDocumentationLinks(kind celHoverKind, name string) string {\n\tswitch kind {\n\tcase celHoverKeyword:\n\t\tswitch name {\n\t\tcase \"this\":\n\t\t\treturn celProtovalidateLink(\"this\")\n\t\tcase \"now\":\n\t\t\treturn celProtovalidateLink(\"now\")\n\t\t}\n\tcase celHoverOperator:\n\t\tswitch name {\n\t\tcase operators.LogicalAnd:\n\t\t\treturn celByExampleLink(\"logical-operators/#and\")\n\t\tcase operators.LogicalOr:\n\t\t\treturn celByExampleLink(\"logical-operators/#or\")\n\t\tcase operators.LogicalNot:\n\t\t\treturn celByExampleLink(\"logical-operators/#not\")\n\t\tcase operators.Equals, operators.NotEquals:\n\t\t\treturn celByExampleLink(\"comparison/#equality\")\n\t\tcase operators.Less, operators.LessEquals, operators.Greater, operators.GreaterEquals:\n\t\t\treturn celByExampleLink(\"comparison/#ordering\")\n\t\tcase operators.Add, operators.Subtract, operators.Multiply, operators.Divide, operators.Modulo:\n\t\t\treturn celByExampleLink(\"arithmetic/\")\n\t\tcase operators.In:\n\t\t\treturn celByExampleLink(\"collections/#membership-and-access\")\n\t\tcase operators.Conditional:\n\t\t\treturn celByExampleLink(\"ternary/\")\n\t\tcase operators.Index:\n\t\t\treturn celByExampleLink(\"lists/\")\n\t\t}\n\tcase celHoverMacro:\n\t\tswitch name {\n\t\tcase operators.Has:\n\t\t\treturn celByExampleLink(\"has/\")\n\t\tcase operators.All:\n\t\t\treturn celByExampleLink(\"all/\")\n\t\tcase operators.Exists:\n\t\t\treturn celByExampleLink(\"exists/\")\n\t\tcase operators.ExistsOne:\n\t\t\treturn celByExampleLink(\"exists-one/\")\n\t\tcase operators.Filter:\n\t\t\treturn celByExampleLink(\"filter/\")\n\t\tcase operators.Map:\n\t\t\treturn celByExampleLink(\"map-macro/\")\n\t\t}\n\tcase celHoverFunction:\n\t\tswitch name {\n\t\t// String functions\n\t\tcase overloads.Size:\n\t\t\treturn celByExampleLink(\"strings/#size\")\n\t\tcase overloads.Contains, overloads.StartsWith, overloads.EndsWith:\n\t\t\treturn celByExampleLink(\"strings/#substring-search\")\n\t\tcase overloads.Matches:\n\t\t\treturn celByExampleLink(\"strings/#regular-expressions\")\n\t\tcase \"split\", \"join\":\n\t\t\treturn celByExampleLink(\"strings/#split-and-join\")\n\t\tcase \"lowerAscii\", \"upperAscii\":\n\t\t\treturn celByExampleLink(\"strings/#case-conversion\")\n\t\tcase \"indexOf\", \"lastIndexOf\":\n\t\t\treturn celByExampleLink(\"strings/#position-search\")\n\t\tcase \"charAt\":\n\t\t\treturn celByExampleLink(\"strings/#character-access\")\n\t\tcase \"substring\":\n\t\t\treturn celByExampleLink(\"strings/#substring\")\n\t\tcase \"replace\":\n\t\t\treturn celByExampleLink(\"strings/#replace\")\n\t\tcase \"trim\":\n\t\t\treturn celByExampleLink(\"strings/#trim\")\n\t\tcase \"reverse\":\n\t\t\treturn celByExampleLink(\"strings/#reverse\")\n\t\t// Timestamp and duration functions\n\t\tcase overloads.TimeGetFullYear, overloads.TimeGetMonth, overloads.TimeGetDate,\n\t\t\toverloads.TimeGetDayOfMonth, overloads.TimeGetDayOfWeek, overloads.TimeGetDayOfYear,\n\t\t\toverloads.TimeGetHours, overloads.TimeGetMinutes, overloads.TimeGetSeconds,\n\t\t\toverloads.TimeGetMilliseconds:\n\t\t\treturn celByExampleLink(\"time/#timestamp-components\")\n\t\t// Protovalidate string extension functions\n\t\tcase \"isEmail\":\n\t\t\treturn celProtovalidateLink(\"isemail\")\n\t\tcase \"isHostname\":\n\t\t\treturn celProtovalidateLink(\"ishostname\")\n\t\tcase \"isIp\":\n\t\t\treturn celProtovalidateLink(\"isip\")\n\t\tcase \"isIpPrefix\":\n\t\t\treturn celProtovalidateLink(\"isipprefix\")\n\t\tcase \"isUri\":\n\t\t\treturn celProtovalidateLink(\"isuri\")\n\t\tcase \"isUriRef\":\n\t\t\treturn celProtovalidateLink(\"isuriref\")\n\t\tcase \"isHostAndPort\":\n\t\t\treturn celProtovalidateLink(\"ishostandport\")\n\t\t// Protovalidate double extension functions\n\t\tcase \"isNan\":\n\t\t\treturn celProtovalidateLink(\"isnan\")\n\t\tcase \"isInf\":\n\t\t\treturn celProtovalidateLink(\"isinf\")\n\t\t// Protovalidate list extension function\n\t\tcase \"unique\":\n\t\t\treturn celProtovalidateLink(\"unique\")\n\t\t}\n\tcase celHoverType:\n\t\tswitch name {\n\t\tcase overloads.TypeConvertInt, overloads.TypeConvertUint, overloads.TypeConvertDouble:\n\t\t\treturn celByExampleLink(\"type-conversions/#numeric-conversions\")\n\t\tcase overloads.TypeConvertString:\n\t\t\treturn celByExampleLink(\"type-conversions/#string-conversions\")\n\t\tcase overloads.TypeConvertBytes:\n\t\t\treturn celByExampleLink(\"type-conversions/#bytes-conversions\")\n\t\tcase overloads.TypeConvertTimestamp, overloads.TypeConvertDuration:\n\t\t\treturn celByExampleLink(\"type-conversions/#time-conversions\")\n\t\tcase overloads.TypeConvertDyn:\n\t\t\treturn celByExampleLink(\"type-conversions/#dynamic-type\")\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// celByExampleLink returns a markdown link to a page on celbyexample.com.\nfunc celByExampleLink(path string) string {\n\treturn \"[CEL by Example](https://celbyexample.com/\" + path + \")\"\n}\n\n// celProtovalidateLink returns a markdown link to an anchor on the Protovalidate CEL extensions\n// reference page.\nfunc celProtovalidateLink(anchor string) string {\n\treturn \"[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#\" + anchor + \")\"\n}\n\n// resolveCELFieldAccess resolves a CEL SelectExpr to a proto field/member.\n// Handles expressions like `this.fieldName` or `this.address.city`.\nfunc resolveCELFieldAccess(sel ast.SelectExpr, exprInfo celExpressionInfo) ir.Member {\n\tif sel == nil || exprInfo.thisIRType.IsZero() {\n\t\treturn ir.Member{}\n\t}\n\n\t// Start from the `this` type: the field's element type for field-level rules,\n\t// or the message type itself for message-level rules.\n\tcurrentType := exprInfo.thisIRType\n\n\t// Build the field path by walking up the select chain\n\tvar fieldPath []string\n\n\t// Walk the select chain to build the field path\n\tcurrentSel := sel\n\tfor {\n\t\tfieldPath = append([]string{currentSel.FieldName()}, fieldPath...)\n\n\t\t// Check if the operand is another select expression\n\t\toperand := currentSel.Operand()\n\t\tif operand == nil || operand.Kind() == ast.UnspecifiedExprKind {\n\t\t\tbreak\n\t\t}\n\t\tif operand.Kind() == ast.SelectKind {\n\t\t\tcurrentSel = operand.AsSelect()\n\t\t\tcontinue\n\t\t}\n\t\t// Non-select operand: must be 'this' to resolve\n\t\tif operand.Kind() != ast.IdentKind || operand.AsIdent() != \"this\" {\n\t\t\treturn ir.Member{}\n\t\t}\n\t\tbreak\n\t}\n\n\t// Now resolve the field path through the type hierarchy\n\tfor _, fieldName := range fieldPath {\n\t\tif !currentType.IsMessage() || currentType.IsZero() {\n\t\t\t// Can't navigate further\n\t\t\treturn ir.Member{}\n\t\t}\n\n\t\t// Find the field with this name in the current message\n\t\tvar found bool\n\t\tvar foundMember ir.Member\n\t\tfor member := range seq.Values(currentType.Members()) {\n\t\t\tif member.Name() == fieldName {\n\t\t\t\tfoundMember = member\n\t\t\t\tcurrentType = member.Element()\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif !found {\n\t\t\t// Field not found\n\t\t\treturn ir.Member{}\n\t\t}\n\n\t\t// If this is the last segment, return the member\n\t\tif fieldName == fieldPath[len(fieldPath)-1] {\n\t\t\treturn foundMember\n\t\t}\n\t}\n\n\treturn ir.Member{}\n}\n\n// getProtoFieldDocumentation returns documentation for a proto field/member.\nfunc getProtoFieldDocumentation(member ir.Member) string {\n\tif member.IsZero() {\n\t\treturn \"\"\n\t}\n\n\tvar parts []string\n\n\t// Add proto field details\n\tparts = append(parts, fmt.Sprintf(\"**Proto Field**: `%s`\", member.FullName()))\n\n\t// Add field number if it's a field\n\tif fieldNum := member.Number(); fieldNum > 0 {\n\t\tparts = append(parts, fmt.Sprintf(\"**Field Number**: %d\", fieldNum))\n\t}\n\n\t// Add field type\n\telemType := member.Element()\n\tif !elemType.IsZero() {\n\t\tparts = append(parts, fmt.Sprintf(\"**Proto Type**: `%s`\", elemType.FullName()))\n\t}\n\n\t// Add field documentation from proto comments\n\tif doc := irMemberDoc(member); doc != \"\" {\n\t\tparts = append(parts, doc)\n\t}\n\n\treturn strings.Join(parts, \"\\n\\n\")\n}\n\n// getCELTypeString converts a CEL type to a human-readable string.\nfunc getCELTypeString(t *types.Type) string {\n\tif t == nil {\n\t\treturn \"unknown\"\n\t}\n\tswitch t.Kind() {\n\tcase types.ListKind:\n\t\tparams := t.Parameters()\n\t\tif len(params) > 0 {\n\t\t\treturn fmt.Sprintf(\"list(%s)\", getCELTypeString(params[0]))\n\t\t}\n\tcase types.MapKind:\n\t\tparams := t.Parameters()\n\t\tif len(params) >= 2 {\n\t\t\treturn fmt.Sprintf(\"map(%s, %s)\", getCELTypeString(params[0]), getCELTypeString(params[1]))\n\t\t}\n\t}\n\tif name := t.TypeName(); name != \"\" {\n\t\treturn name\n\t}\n\treturn \"unknown\"\n}\n\n// getCELKeywordDocs returns documentation for CEL keywords.\n// These keywords are defined in the CEL specification and are not available from upstream documentation.\nfunc getCELKeywordDocs(keyword string) string {\n\t// Note: true, false, and null are ConstExpr nodes in the CEL AST (not IdentExpr),\n\t// so only \"this\" and \"now\" can reach this function via celHoverKeyword.\n\tswitch keyword {\n\tcase \"this\":\n\t\treturn \"**Special variable**\\n\\nRefers to the current message or field being validated.\\n\\n\" +\n\t\t\t\"In field-level rules, `this` refers to the field value.\\n\" +\n\t\t\t\"In message-level rules, `this` refers to the entire message.\"\n\tcase \"now\":\n\t\treturn \"**Special variable**\\n\\nThe current timestamp at the time of validation.\\n\\n**Type**: `google.protobuf.Timestamp`\"\n\t}\n\treturn \"\"\n}\n\n// getCELFunctionDocs returns documentation for CEL functions\nfunc getCELFunctionDocs(function string, celEnv *cel.Env) string {\n\t// Try to get documentation from cel-go\n\tif celEnv != nil {\n\t\tfuncs := celEnv.Functions()\n\t\tif funcDecl, ok := funcs[function]; ok {\n\t\t\t// Try structured documentation first\n\t\t\tif doc := funcDecl.Documentation(); doc != nil {\n\t\t\t\treturn formatCELDoc(doc)\n\t\t\t}\n\t\t\t// Fallback to simple description\n\t\t\tif desc := funcDecl.Description(); desc != \"\" {\n\t\t\t\treturn fmt.Sprintf(\"**Function**: `%s`\\n\\n%s\", function, desc)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\"\n}\n\n// formatCELDoc formats a CEL common.Doc into markdown\n// If headerPrefix is provided (e.g., \"**Operator**: \" or \"**Macro**: \"), it will be used instead of just the name\nfunc formatCELDoc(doc *common.Doc, headerPrefix ...string) string {\n\tif doc == nil {\n\t\treturn \"\"\n\t}\n\n\tvar result strings.Builder\n\n\t// Add signature/name with optional prefix\n\tvar nameToDisplay string\n\tif doc.Signature != \"\" {\n\t\tnameToDisplay = doc.Signature\n\t} else if doc.Name != \"\" {\n\t\tnameToDisplay = doc.Name\n\t}\n\n\tif nameToDisplay != \"\" {\n\t\tif len(headerPrefix) > 0 && headerPrefix[0] != \"\" {\n\t\t\t// Custom header with prefix (e.g., \"**Operator**: `+`\")\n\t\t\tfmt.Fprintf(&result, \"%s`%s`\", headerPrefix[0], nameToDisplay)\n\t\t} else {\n\t\t\t// Default header (just the name)\n\t\t\tfmt.Fprintf(&result, \"`%s`\", nameToDisplay)\n\t\t}\n\t}\n\n\t// Add description\n\tif doc.Description != \"\" {\n\t\tif result.Len() > 0 {\n\t\t\tresult.WriteString(\"\\n\\n\")\n\t\t}\n\t\tresult.WriteString(doc.Description)\n\t}\n\n\t// Add children information (either overloads or examples)\n\tif len(doc.Children) > 0 {\n\t\t// Check if children have signatures (overloads) or only descriptions (examples)\n\t\thasSignatures := false\n\t\tfor _, child := range doc.Children {\n\t\t\tif child.Signature != \"\" {\n\t\t\t\thasSignatures = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif hasSignatures {\n\t\t\t// Children are overloads\n\t\t\tresult.WriteString(\"\\n\\n**Overloads**:\")\n\t\t\tfor _, child := range doc.Children {\n\t\t\t\tif child.Signature != \"\" {\n\t\t\t\t\tfmt.Fprintf(&result, \"\\n- `%s`\", child.Signature)\n\t\t\t\t\tif child.Description != \"\" {\n\t\t\t\t\t\tfmt.Fprintf(&result, \": %s\", child.Description)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Children are examples (e.g., for macros)\n\t\t\tresult.WriteString(\"\\n\\n**Examples**:\")\n\t\t\tfor _, child := range doc.Children {\n\t\t\t\tif child.Description != \"\" {\n\t\t\t\t\tfmt.Fprintf(&result, \"\\n```cel\\n%s\\n```\", child.Description)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result.String()\n}\n\n// getCELOperatorDocs returns documentation for CEL operators.\n// funcName is the internal operator function name (e.g., \"_&&_\").\nfunc getCELOperatorDocs(funcName string, celEnv *cel.Env) string {\n\tif celEnv == nil {\n\t\treturn \"\"\n\t}\n\tfuncs := celEnv.Functions()\n\tfuncDecl, ok := funcs[funcName]\n\tif !ok {\n\t\treturn \"\"\n\t}\n\tsymbol, _ := celOperatorSymbol(funcName)\n\tif doc := funcDecl.Documentation(); doc != nil {\n\t\tdoc.Name = symbol\n\t\treturn formatCELDoc(doc, \"**Operator**: \")\n\t}\n\tif desc := funcDecl.Description(); desc != \"\" {\n\t\treturn fmt.Sprintf(\"**Operator**: `%s`\\n\\n%s\", symbol, desc)\n\t}\n\treturn \"\"\n}\n\n// getCELMacroDocs returns documentation for CEL macros\nfunc getCELMacroDocs(macro string, celEnv *cel.Env) string {\n\t// Macros might be available as functions in the environment\n\tif celEnv != nil {\n\t\tfuncs := celEnv.Functions()\n\t\tif funcDecl, ok := funcs[macro]; ok {\n\t\t\tif doc := funcDecl.Documentation(); doc != nil {\n\t\t\t\treturn formatCELDoc(doc)\n\t\t\t}\n\t\t\tif desc := funcDecl.Description(); desc != \"\" {\n\t\t\t\treturn fmt.Sprintf(\"**Macro**: `%s`\\n\\n%s\", macro, desc)\n\t\t\t}\n\t\t}\n\t\t// Check env.Macros() for documentation\n\t\tfor _, m := range celEnv.Macros() {\n\t\t\tif m.Function() == macro {\n\t\t\t\tif doc, ok := m.(common.Documentor); ok {\n\t\t\t\t\tif documentation := doc.Documentation(); documentation != nil {\n\t\t\t\t\t\t// Use formatCELDoc with macro prefix\n\t\t\t\t\t\tdocumentation.Name = macro\n\t\t\t\t\t\treturn formatCELDoc(documentation, \"**Macro**: \")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn \"\"\n}\n\n// getCELTypeDocs returns documentation for CEL type functions\nfunc getCELTypeDocs(typeName string, celEnv *cel.Env) string {\n\t// Type conversion functions are available in the environment\n\tif celEnv != nil {\n\t\tfuncs := celEnv.Functions()\n\t\tif funcDecl, ok := funcs[typeName]; ok {\n\t\t\tif doc := funcDecl.Documentation(); doc != nil {\n\t\t\t\treturn formatCELDoc(doc)\n\t\t\t}\n\t\t\tif desc := funcDecl.Description(); desc != \"\" {\n\t\t\t\treturn fmt.Sprintf(\"**Type**: `%s`\\n\\n%s\", typeName, desc)\n\t\t\t}\n\t\t}\n\t}\n\n\t// All type conversion functions are documented upstream\n\treturn fmt.Sprintf(\"**Type**: `%s`\", typeName)\n}\n\n// getPrimitiveTypeForLiteral returns the CEL type for a literal expression.\nfunc getPrimitiveTypeForLiteral(expr ast.Expr) *types.Type {\n\tswitch expr.AsLiteral().(type) {\n\tcase types.String:\n\t\treturn types.StringType\n\tcase types.Int:\n\t\treturn types.IntType\n\tcase types.Uint:\n\t\treturn types.UintType\n\tcase types.Double:\n\t\treturn types.DoubleType\n\tcase types.Bool:\n\t\treturn types.BoolType\n\tcase types.Bytes:\n\t\treturn types.BytesType\n\tdefault:\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/hover_cel_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestCELHover(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\ttestProtoPath, err := filepath.Abs(\"testdata/hover/cel_comprehensive.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\ttestCases := []struct {\n\t\tname     string\n\t\tline     uint32 // 0-indexed\n\t\tchar     uint32 // Character offset where the token starts\n\t\texpected string // Full expected hover content\n\t}{\n\t\t// Keywords\n\t\t{\n\t\t\tname:     \"keyword: this\",\n\t\t\tline:     19,\n\t\t\tchar:     17,\n\t\t\texpected: \"**Special variable**\\n\\nRefers to the current message or field being validated.\\n\\nIn field-level rules, `this` refers to the field value.\\nIn message-level rules, `this` refers to the entire message.\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#this)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"keyword: true\",\n\t\t\tline:     24,\n\t\t\tchar:     25,\n\t\t\texpected: \"**Literal**: `true`\\n\\n**Type**: bool\",\n\t\t},\n\t\t{\n\t\t\tname:     \"keyword: false\",\n\t\t\tline:     29,\n\t\t\tchar:     25,\n\t\t\texpected: \"**Literal**: `false`\\n\\n**Type**: bool\",\n\t\t},\n\t\t{\n\t\t\tname:     \"keyword: null\",\n\t\t\tline:     34,\n\t\t\tchar:     37, // Position of first \"null\" in full line: '    expression: \"true ? this != '' : null != null\"'\n\t\t\texpected: \"**Literal**: `null`\\n\\n**Type**: value\",\n\t\t},\n\n\t\t// Logical operators\n\t\t{\n\t\t\tname:     \"operator: &&\",\n\t\t\tline:     40,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `&&`\\n\\nlogically AND two boolean values. Errors and unknown values\\nare valid inputs and will not halt evaluation.\\n\\n**Overloads**:\\n- `bool && bool -> bool`\\n\\n[CEL by Example](https://celbyexample.com/logical-operators/#and)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: ||\",\n\t\t\tline:     45,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `||`\\n\\nlogically OR two boolean values. Errors and unknown values\\nare valid inputs and will not halt evaluation.\\n\\n**Overloads**:\\n- `bool || bool -> bool`\\n\\n[CEL by Example](https://celbyexample.com/logical-operators/#or)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: !\",\n\t\t\tline:     50,\n\t\t\tchar:     17,\n\t\t\texpected: \"**Operator**: `!`\\n\\nlogically negate a boolean value.\\n\\n**Overloads**:\\n- `!bool -> bool`\\n\\n[CEL by Example](https://celbyexample.com/logical-operators/#not)\",\n\t\t},\n\n\t\t// Comparison operators\n\t\t{\n\t\t\tname:     \"operator: ==\",\n\t\t\tline:     56,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `==`\\n\\ncompare two values of the same type for equality\\n\\n**Overloads**:\\n- `<A> == <A> -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#equality)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: !=\",\n\t\t\tline:     61,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `!=`\\n\\ncompare two values of the same type for inequality\\n\\n**Overloads**:\\n- `<A> != <A> -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#equality)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: <\",\n\t\t\tline:     66,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `<`\\n\\ncompare two values and return true if the first value is\\nless than the second\\n\\n**Overloads**:\\n- `bool < bool -> bool`\\n- `int < int -> bool`\\n- `int < double -> bool`\\n- `int < uint -> bool`\\n- `uint < uint -> bool`\\n- `uint < double -> bool`\\n- `uint < int -> bool`\\n- `double < double -> bool`\\n- `double < int -> bool`\\n- `double < uint -> bool`\\n- `string < string -> bool`\\n- `bytes < bytes -> bool`\\n- `google.protobuf.Timestamp < google.protobuf.Timestamp -> bool`\\n- `google.protobuf.Duration < google.protobuf.Duration -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#ordering)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: >\",\n\t\t\tline:     71,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `>`\\n\\ncompare two values and return true if the first value is\\ngreater than the second\\n\\n**Overloads**:\\n- `bool > bool -> bool`\\n- `int > int -> bool`\\n- `int > double -> bool`\\n- `int > uint -> bool`\\n- `uint > uint -> bool`\\n- `uint > double -> bool`\\n- `uint > int -> bool`\\n- `double > double -> bool`\\n- `double > int -> bool`\\n- `double > uint -> bool`\\n- `string > string -> bool`\\n- `bytes > bytes -> bool`\\n- `google.protobuf.Timestamp > google.protobuf.Timestamp -> bool`\\n- `google.protobuf.Duration > google.protobuf.Duration -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#ordering)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: <=\",\n\t\t\tline:     76,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `<=`\\n\\ncompare two values and return true if the first value is\\nless than or equal to the second\\n\\n**Overloads**:\\n- `bool <= bool -> bool`\\n- `int <= int -> bool`\\n- `int <= double -> bool`\\n- `int <= uint -> bool`\\n- `uint <= uint -> bool`\\n- `uint <= double -> bool`\\n- `uint <= int -> bool`\\n- `double <= double -> bool`\\n- `double <= int -> bool`\\n- `double <= uint -> bool`\\n- `string <= string -> bool`\\n- `bytes <= bytes -> bool`\\n- `google.protobuf.Timestamp <= google.protobuf.Timestamp -> bool`\\n- `google.protobuf.Duration <= google.protobuf.Duration -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#ordering)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: >=\",\n\t\t\tline:     81,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `>=`\\n\\ncompare two values and return true if the first value is\\ngreater than or equal to the second\\n\\n**Overloads**:\\n- `bool >= bool -> bool`\\n- `int >= int -> bool`\\n- `int >= double -> bool`\\n- `int >= uint -> bool`\\n- `uint >= uint -> bool`\\n- `uint >= double -> bool`\\n- `uint >= int -> bool`\\n- `double >= double -> bool`\\n- `double >= int -> bool`\\n- `double >= uint -> bool`\\n- `string >= string -> bool`\\n- `bytes >= bytes -> bool`\\n- `google.protobuf.Timestamp >= google.protobuf.Timestamp -> bool`\\n- `google.protobuf.Duration >= google.protobuf.Duration -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#ordering)\",\n\t\t},\n\n\t\t// Arithmetic operators\n\t\t{\n\t\t\tname:     \"operator: +\",\n\t\t\tline:     87,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `+`\\n\\nadds two numeric values or concatenates two strings, bytes,\\nor lists.\\n\\n**Overloads**:\\n- `bytes + bytes -> bytes`\\n- `double + double -> double`\\n- `google.protobuf.Duration + google.protobuf.Duration -> google.protobuf.Duration`\\n- `google.protobuf.Duration + google.protobuf.Timestamp -> google.protobuf.Timestamp`\\n- `google.protobuf.Timestamp + google.protobuf.Duration -> google.protobuf.Timestamp`\\n- `int + int -> int`\\n- `list(<A>) + list(<A>) -> list(<A>)`\\n- `string + string -> string`\\n- `uint + uint -> uint`\\n\\n[CEL by Example](https://celbyexample.com/arithmetic/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: -\",\n\t\t\tline:     92,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `-`\\n\\nsubtract two numbers, or two time-related values\\n\\n**Overloads**:\\n- `double - double -> double`\\n- `google.protobuf.Duration - google.protobuf.Duration -> google.protobuf.Duration`\\n- `int - int -> int`\\n- `google.protobuf.Timestamp - google.protobuf.Duration -> google.protobuf.Timestamp`\\n- `google.protobuf.Timestamp - google.protobuf.Timestamp -> google.protobuf.Duration`\\n- `uint - uint -> uint`\\n\\n[CEL by Example](https://celbyexample.com/arithmetic/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: *\",\n\t\t\tline:     97,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `*`\\n\\nmultiply two numbers\\n\\n**Overloads**:\\n- `double * double -> double`\\n- `int * int -> int`\\n- `uint * uint -> uint`\\n\\n[CEL by Example](https://celbyexample.com/arithmetic/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: /\",\n\t\t\tline:     102,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `/`\\n\\ndivide two numbers\\n\\n**Overloads**:\\n- `double / double -> double`\\n- `int / int -> int`\\n- `uint / uint -> uint`\\n\\n[CEL by Example](https://celbyexample.com/arithmetic/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: %\",\n\t\t\tline:     107,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `%`\\n\\ncompute the modulus of one integer into another\\n\\n**Overloads**:\\n- `int % int -> int`\\n- `uint % uint -> uint`\\n\\n[CEL by Example](https://celbyexample.com/arithmetic/)\",\n\t\t},\n\n\t\t// String functions (upstream docs)\n\t\t{\n\t\t\tname:     \"function: contains\",\n\t\t\tline:     113,\n\t\t\tchar:     23,\n\t\t\texpected: \"`contains`\\n\\ntest whether a string contains a substring\\n\\n**Overloads**:\\n- `string.contains(string) -> bool`\\n- `bytes.contains(bytes) -> bool`\\n\\n[CEL by Example](https://celbyexample.com/strings/#substring-search)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: startsWith\",\n\t\t\tline:     118,\n\t\t\tchar:     23,\n\t\t\texpected: \"`startsWith`\\n\\ntest whether a string starts with a substring prefix\\n\\n**Overloads**:\\n- `string.startsWith(string) -> bool`\\n- `bytes.startsWith(bytes) -> bool`\\n\\n[CEL by Example](https://celbyexample.com/strings/#substring-search)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: endsWith\",\n\t\t\tline:     123,\n\t\t\tchar:     23,\n\t\t\texpected: \"`endsWith`\\n\\ntest whether a string ends with a substring suffix\\n\\n**Overloads**:\\n- `string.endsWith(string) -> bool`\\n- `bytes.endsWith(bytes) -> bool`\\n\\n[CEL by Example](https://celbyexample.com/strings/#substring-search)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: matches\",\n\t\t\tline:     128,\n\t\t\tchar:     23,\n\t\t\texpected: \"`matches`\\n\\ntest whether a string matches an RE2 regular expression\\n\\n**Overloads**:\\n- `matches(string, string) -> bool`\\n- `string.matches(string) -> bool`\\n\\n[CEL by Example](https://celbyexample.com/strings/#regular-expressions)\",\n\t\t},\n\n\t\t// Collection functions (upstream docs)\n\t\t{\n\t\t\tname:     \"function: size\",\n\t\t\tline:     134,\n\t\t\tchar:     23,\n\t\t\texpected: \"`size`\\n\\ncompute the size of a list or map, the number of characters in a string,\\nor the number of bytes in a sequence\\n\\n**Overloads**:\\n- `size(bytes) -> int`\\n- `bytes.size() -> int`\\n- `size(list(<A>)) -> int`\\n- `list(<A>).size() -> int`\\n- `size(map(<A>, <B>)) -> int`\\n- `map(<A>, <B>).size() -> int`\\n- `size(string) -> int`\\n- `string.size() -> int`\\n\\n[CEL by Example](https://celbyexample.com/strings/#size)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"operator: in\",\n\t\t\tline:     139,\n\t\t\tchar:     26,\n\t\t\texpected: \"**Operator**: `in`\\n\\ntest whether a value exists in a list, or a key exists in a map\\n\\n**Overloads**:\\n- `<A> in list(<A>) -> bool`\\n- `<A> in map(<A>, <B>) -> bool`\\n\\n[CEL by Example](https://celbyexample.com/collections/#membership-and-access)\",\n\t\t},\n\n\t\t// Type conversion functions (upstream docs)\n\t\t{\n\t\t\tname:     \"function: int\",\n\t\t\tline:     145,\n\t\t\tchar:     17,\n\t\t\texpected: \"`int`\\n\\nconvert a value to an int\\n\\n**Overloads**:\\n- `int(int) -> int`\\n- `int(double) -> int`\\n- `int(google.protobuf.Duration) -> int`\\n- `int(string) -> int`\\n- `int(google.protobuf.Timestamp) -> int`\\n- `int(uint) -> int`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#numeric-conversions)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: uint\",\n\t\t\tline:     150,\n\t\t\tchar:     17,\n\t\t\texpected: \"`uint`\\n\\nconvert a value to a uint\\n\\n**Overloads**:\\n- `uint(uint) -> uint`\\n- `uint(double) -> uint`\\n- `uint(int) -> uint`\\n- `uint(string) -> uint`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#numeric-conversions)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: double\",\n\t\t\tline:     155,\n\t\t\tchar:     17,\n\t\t\texpected: \"`double`\\n\\nconvert a value to a double\\n\\n**Overloads**:\\n- `double(double) -> double`\\n- `double(int) -> double`\\n- `double(string) -> double`\\n- `double(uint) -> double`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#numeric-conversions)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: string\",\n\t\t\tline:     160,\n\t\t\tchar:     17,\n\t\t\texpected: \"`string`\\n\\nconvert a value to a string\\n\\n**Overloads**:\\n- `string(string) -> string`\\n- `string(bool) -> string`\\n- `string(bytes) -> string`\\n- `string(double) -> string`\\n- `string(google.protobuf.Duration) -> string`\\n- `string(int) -> string`\\n- `string(google.protobuf.Timestamp) -> string`\\n- `string(uint) -> string`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#string-conversions)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: bytes\",\n\t\t\tline:     165,\n\t\t\tchar:     17,\n\t\t\texpected: \"`bytes`\\n\\nconvert a value to bytes\\n\\n**Overloads**:\\n- `bytes(bytes) -> bytes`\\n- `bytes(string) -> bytes`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#bytes-conversions)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: timestamp\",\n\t\t\tline:     170,\n\t\t\tchar:     17,\n\t\t\texpected: \"`timestamp`\\n\\nconvert a value to a google.protobuf.Timestamp\\n\\n**Overloads**:\\n- `timestamp(google.protobuf.Timestamp) -> google.protobuf.Timestamp`\\n- `timestamp(int) -> google.protobuf.Timestamp`\\n- `timestamp(string) -> google.protobuf.Timestamp`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#time-conversions)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: duration\",\n\t\t\tline:     175,\n\t\t\tchar:     17,\n\t\t\texpected: \"`duration`\\n\\nconvert a value to a google.protobuf.Duration\\n\\n**Overloads**:\\n- `duration(google.protobuf.Duration) -> google.protobuf.Duration`\\n- `duration(int) -> google.protobuf.Duration`\\n- `duration(string) -> google.protobuf.Duration`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#time-conversions)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: type\",\n\t\t\tline:     180,\n\t\t\tchar:     17,\n\t\t\texpected: \"`type`\\n\\nconvert a value to its type identifier\\n\\n**Overloads**:\\n- `type(<A>) -> type`\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: dyn\",\n\t\t\tline:     185,\n\t\t\tchar:     17,\n\t\t\texpected: \"`dyn`\\n\\nindicate that the type is dynamic for type-checking purposes\\n\\n**Overloads**:\\n- `dyn(<A>) -> dyn`\\n\\n[CEL by Example](https://celbyexample.com/type-conversions/#dynamic-type)\",\n\t\t},\n\n\t\t// Timestamp functions (upstream docs)\n\t\t{\n\t\t\tname:     \"function: getFullYear\",\n\t\t\tline:     191,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getFullYear`\\n\\nget the 0-based full year from a timestamp, UTC unless an IANA timezone is specified.\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getFullYear() -> int`\\n- `google.protobuf.Timestamp.getFullYear(string) -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: getMonth\",\n\t\t\tline:     196,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getMonth`\\n\\nget the 0-based month from a timestamp, UTC unless an IANA timezone is specified.\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getMonth() -> int`\\n- `google.protobuf.Timestamp.getMonth(string) -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: getDate\",\n\t\t\tline:     201,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getDate`\\n\\nget the 1-based day of the month from a timestamp, UTC unless an IANA timezone is specified.\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getDate() -> int`\\n- `google.protobuf.Timestamp.getDate(string) -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: getHours\",\n\t\t\tline:     206,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getHours`\\n\\nget the hours portion from a timestamp, or convert a duration to hours\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getHours() -> int`\\n- `google.protobuf.Timestamp.getHours(string) -> int`\\n- `google.protobuf.Duration.getHours() -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: getMinutes\",\n\t\t\tline:     211,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getMinutes`\\n\\nget the minutes portion from a timestamp, or convert a duration to minutes\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getMinutes() -> int`\\n- `google.protobuf.Timestamp.getMinutes(string) -> int`\\n- `google.protobuf.Duration.getMinutes() -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: getSeconds\",\n\t\t\tline:     216,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getSeconds`\\n\\nget the seconds portion from a timestamp, or convert a duration to seconds\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getSeconds() -> int`\\n- `google.protobuf.Timestamp.getSeconds(string) -> int`\\n- `google.protobuf.Duration.getSeconds() -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: getDayOfWeek\",\n\t\t\tline:     221,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getDayOfWeek`\\n\\nget the 0-based day of the week from a timestamp, UTC unless an IANA timezone is specified.\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getDayOfWeek() -> int`\\n- `google.protobuf.Timestamp.getDayOfWeek(string) -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\n\t\t// Duration functions (upstream docs)\n\t\t{\n\t\t\tname:     \"function: duration.getSeconds\",\n\t\t\tline:     227,\n\t\t\tchar:     23,\n\t\t\texpected: \"`getSeconds`\\n\\nget the seconds portion from a timestamp, or convert a duration to seconds\\n\\n**Overloads**:\\n- `google.protobuf.Timestamp.getSeconds() -> int`\\n- `google.protobuf.Timestamp.getSeconds(string) -> int`\\n- `google.protobuf.Duration.getSeconds() -> int`\\n\\n[CEL by Example](https://celbyexample.com/time/#timestamp-components)\",\n\t\t},\n\n\t\t// Macros (upstream docs with examples)\n\t\t{\n\t\t\tname:     \"macro: has\",\n\t\t\tline:     233,\n\t\t\tchar:     17,\n\t\t\texpected: \"**Macro**: `has`\\n\\ncheck a protocol buffer message for the presence of a field, or check a map\\nfor the presence of a string key.\\nOnly map accesses using the select notation are supported.\\n\\n**Examples**:\\n```cel\\n// true if the 'address' field exists in the 'user' message\\nhas(user.address)\\n```\\n```cel\\n// test whether the 'key_name' is set on the map which defines it\\nhas({'key_name': 'value'}.key_name) // true\\n```\\n```cel\\n// test whether the 'id' field is set to a non-default value on the Expr{} message literal\\nhas(Expr{}.id) // false\\n```\\n\\n[CEL by Example](https://celbyexample.com/has/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"macro: all\",\n\t\t\tline:     238,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Macro**: `all`\\n\\ntests whether all elements in the input list or all keys in a map\\nsatisfy the given predicate. The all macro behaves in a manner consistent with\\nthe Logical AND operator including in how it absorbs errors and short-circuits.\\n\\n**Examples**:\\n```cel\\n[1, 2, 3].all(x, x > 0) // true\\n```\\n```cel\\n[1, 2, 0].all(x, x > 0) // false\\n```\\n```cel\\n['apple', 'banana', 'cherry'].all(fruit, fruit.size() > 3) // true\\n```\\n```cel\\n[3.14, 2.71, 1.61].all(num, num < 3.0) // false\\n```\\n```cel\\n{'a': 1, 'b': 2, 'c': 3}.all(key, key != 'b') // false\\n```\\n```cel\\n// an empty list or map as the range will result in a trivially true result\\n[].all(x, x > 0) // true\\n```\\n\\n[CEL by Example](https://celbyexample.com/all/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"macro: exists\",\n\t\t\tline:     243,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Macro**: `exists`\\n\\ntests whether any value in the list or any key in the map\\nsatisfies the predicate expression. The exists macro behaves in a manner\\nconsistent with the Logical OR operator including in how it absorbs errors and\\nshort-circuits.\\n\\n**Examples**:\\n```cel\\n[1, 2, 3].exists(i, i % 2 != 0) // true\\n```\\n```cel\\n[0, -1, 5].exists(num, num < 0) // true\\n```\\n```cel\\n{'x': 'foo', 'y': 'bar'}.exists(key, key.startsWith('z')) // false\\n```\\n```cel\\n// an empty list or map as the range will result in a trivially false result\\n[].exists(i, i > 0) // false\\n```\\n```cel\\n// test whether a key name equalling 'iss' exists in the map and the\\n// value contains the substring 'cel.dev'\\n// tokens = {'sub': 'me', 'iss': 'https://issuer.cel.dev'}\\ntokens.exists(k, k == 'iss' && tokens[k].contains('cel.dev'))\\n```\\n\\n[CEL by Example](https://celbyexample.com/exists/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"macro: exists_one\",\n\t\t\tline:     248,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Macro**: `exists_one`\\n\\ntests whether exactly one list element or map key satisfies\\nthe predicate expression. This macro does not short-circuit in order to remain\\nconsistent with logical operators being the only operators which can absorb\\nerrors within CEL.\\n\\n**Examples**:\\n```cel\\n[1, 2, 2].exists_one(i, i < 2) // true\\n```\\n```cel\\n{'a': 'hello', 'aa': 'hellohello'}.exists_one(k, k.startsWith('a')) // false\\n```\\n```cel\\n[1, 2, 3, 4].exists_one(num, num % 2 == 0) // false\\n```\\n```cel\\n// ensure exactly one key in the map ends in @acme.co\\n{'wiley@acme.co': 'coyote', 'aa@milne.co': 'bear'}.exists_one(k, k.endsWith('@acme.co')) // true\\n```\\n\\n[CEL by Example](https://celbyexample.com/exists-one/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"macro: map\",\n\t\t\tline:     253,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Macro**: `map`\\n\\nthe three-argument form of map transforms all elements in the input range.\\n\\n**Examples**:\\n```cel\\n[1, 2, 3].map(x, x * 2) // [2, 4, 6]\\n```\\n```cel\\n[5, 10, 15].map(x, x / 5) // [1, 2, 3]\\n```\\n```cel\\n['apple', 'banana'].map(fruit, fruit.upperAscii()) // ['APPLE', 'BANANA']\\n```\\n```cel\\n// Combine all map key-value pairs into a list\\n{'hi': 'you', 'howzit': 'bruv'}.map(k,\\n    k + \\\":\\\" + {'hi': 'you', 'howzit': 'bruv'}[k]) // ['hi:you', 'howzit:bruv']\\n```\\n\\n[CEL by Example](https://celbyexample.com/map-macro/)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"macro: filter\",\n\t\t\tline:     258,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Macro**: `filter`\\n\\nreturns a list containing only the elements from the input list\\nthat satisfy the given predicate\\n\\n**Examples**:\\n```cel\\n[1, 2, 3].filter(x, x > 1) // [2, 3]\\n```\\n```cel\\n['cat', 'dog', 'bird', 'fish'].filter(pet, pet.size() == 3) // ['cat', 'dog']\\n```\\n```cel\\n[{'a': 10, 'b': 5, 'c': 20}].map(m, m.filter(key, m[key] > 10)) // [['c']]\\n```\\n```cel\\n// filter a list to select only emails with the @cel.dev suffix\\n['alice@buf.io', 'tristan@cel.dev'].filter(v, v.endsWith('@cel.dev')) // ['tristan@cel.dev']\\n```\\n```cel\\n// filter a map into a list, selecting only the values for keys that start with 'http-auth'\\n{'http-auth-agent': 'secret', 'user-agent': 'mozilla'}.filter(k,\\n     k.startsWith('http-auth')) // ['secret']\\n```\\n\\n[CEL by Example](https://celbyexample.com/filter/)\",\n\t\t},\n\n\t\t// Protovalidate extension functions (using upstream docs)\n\t\t{\n\t\t\tname:     \"function: isEmail\",\n\t\t\tline:     264,\n\t\t\tchar:     22, // Position of \"isEmail\" in \"this.isEmail()\"\n\t\t\texpected: \"`isEmail`\\n\\n**Overloads**:\\n- `string.isEmail() -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#isemail)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: isHostname\",\n\t\t\tline:     269,\n\t\t\tchar:     22, // Position of \"isHostname\" in \"this.isHostname()\"\n\t\t\texpected: \"`isHostname`\\n\\n**Overloads**:\\n- `string.isHostname() -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#ishostname)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: isIp\",\n\t\t\tline:     274,\n\t\t\tchar:     22, // Position of \"isIp\" in \"this.isIp()\"\n\t\t\texpected: \"`isIp`\\n\\n**Overloads**:\\n- `string.isIp() -> bool`\\n- `string.isIp(int) -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#isip)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: isIpPrefix\",\n\t\t\tline:     279,\n\t\t\tchar:     22, // Position of \"isIpPrefix\" in \"this.isIpPrefix()\"\n\t\t\texpected: \"`isIpPrefix`\\n\\n**Overloads**:\\n- `string.isIpPrefix() -> bool`\\n- `string.isIpPrefix(int) -> bool`\\n- `string.isIpPrefix(bool) -> bool`\\n- `string.isIpPrefix(int, bool) -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#isipprefix)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: isUri\",\n\t\t\tline:     284,\n\t\t\tchar:     22, // Position of \"isUri\" in \"this.isUri()\"\n\t\t\texpected: \"`isUri`\\n\\n**Overloads**:\\n- `string.isUri() -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#isuri)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: isUriRef\",\n\t\t\tline:     289,\n\t\t\tchar:     22, // Position of \"isUriRef\" in \"this.isUriRef()\"\n\t\t\texpected: \"`isUriRef`\\n\\n**Overloads**:\\n- `string.isUriRef() -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#isuriref)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"function: isHostAndPort\",\n\t\t\tline:     294,\n\t\t\tchar:     22, // Position of \"isHostAndPort\" in \"this.isHostAndPort(true)\"\n\t\t\texpected: \"`isHostAndPort`\\n\\n**Overloads**:\\n- `string.isHostAndPort(bool) -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#ishostandport)\",\n\t\t},\n\n\t\t// Field access (proto field resolution)\n\t\t{\n\t\t\tname:     \"field: city\",\n\t\t\tline:     300,\n\t\t\tchar:     23,\n\t\t\texpected: \"**Field**: `city`\\n\\n**Proto Field**: `test.cel.v1.Address.city`\\n\\n**Field Number**: 1\\n\\n**Proto Type**: `string`\\n\\nencoded (hex): `0A` (1 byte)\",\n\t\t},\n\n\t\t// Literals\n\t\t{\n\t\t\tname:     \"literal: string\",\n\t\t\tline:     306,\n\t\t\tchar:     26,\n\t\t\texpected: \"**Literal**: `'literal'`\\n\\n**Type**: string\",\n\t\t},\n\t\t{\n\t\t\tname:     \"literal: int\",\n\t\t\tline:     311,\n\t\t\tchar:     25,\n\t\t\texpected: \"**Literal**: `42`\\n\\n**Type**: int\",\n\t\t},\n\t\t{\n\t\t\tname:     \"literal: double\",\n\t\t\tline:     316,\n\t\t\tchar:     25,\n\t\t\texpected: \"**Literal**: `3.14`\\n\\n**Type**: double\",\n\t\t},\n\t\t{\n\t\t\tname:     \"literal: bool\",\n\t\t\tline:     321,\n\t\t\tchar:     25,\n\t\t\texpected: \"**Literal**: `true`\\n\\n**Type**: bool\",\n\t\t},\n\n\t\t// Comprehension variables\n\t\t{\n\t\t\tname:     \"variable: item\",\n\t\t\tline:     327,\n\t\t\tchar:     32,\n\t\t\texpected: \"**Variable**: `item`\\n\\nLoop variable from comprehension.\",\n\t\t},\n\n\t\t// Ternary operator\n\t\t{\n\t\t\tname:     \"operator: ?\",\n\t\t\tline:     34,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `?`\\n\\nThe ternary operator tests a boolean predicate and returns the left-hand side (truthy) expression if true, or the right-hand side (falsy) expression if false\\n\\n**Overloads**:\\n- `bool ? <T> : <T> -> <T>`\\n\\n[CEL by Example](https://celbyexample.com/ternary/)\",\n\t\t},\n\n\t\t// Unicode: emoji are 2 UTF-16 code units but 1 rune each.\n\t\t// These tests verify correct offset handling past non-ASCII content.\n\t\t// '🎉😀' == this  (expression on line 335, 0-indexed: 334)\n\t\t//  ^  ^       ^--- this at UTF-16 char 27\n\t\t//  |  😀 at UTF-16 chars 20-21\n\t\t//  🎉 at UTF-16 chars 18-19\n\t\t//  '🎉😀' is at UTF-16 chars 17-22; == at 24; space at 26; this at 27\n\t\t{\n\t\t\tname:     \"unicode: string literal (first emoji)\",\n\t\t\tline:     334,\n\t\t\tchar:     18,\n\t\t\texpected: \"**Literal**: `'🎉😀'`\\n\\n**Type**: string\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: string literal (second emoji)\",\n\t\t\tline:     334,\n\t\t\tchar:     20,\n\t\t\texpected: \"**Literal**: `'🎉😀'`\\n\\n**Type**: string\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: == operator after emoji\",\n\t\t\tline:     334,\n\t\t\tchar:     24,\n\t\t\texpected: \"**Operator**: `==`\\n\\ncompare two values of the same type for equality\\n\\n**Overloads**:\\n- `<A> == <A> -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#equality)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: this after emoji\",\n\t\t\tline:     334,\n\t\t\tchar:     27,\n\t\t\texpected: \"**Special variable**\\n\\nRefers to the current message or field being validated.\\n\\nIn field-level rules, `this` refers to the field value.\\nIn message-level rules, `this` refers to the entire message.\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#this)\",\n\t\t},\n\n\t\t// Unicode: CJK characters are 3 UTF-8 bytes but 1 UTF-16 code unit and 1 rune —\n\t\t// a third point in the UTF-8/UTF-16/rune space (vs. emoji: 4/2/1, ASCII: 1/1/1).\n\t\t// '中文' == this  (expression on line 343, 0-indexed: 342)\n\t\t//  ^^        ^--- this at UTF-16 char 25\n\t\t//  |文 at UTF-16 char 19 (1 code unit, 3 UTF-8 bytes)\n\t\t//  中 at UTF-16 char 18 (1 code unit, 3 UTF-8 bytes)\n\t\t//  '中文' is at UTF-16 chars 17-20; == at 22; this at 25\n\t\t{\n\t\t\tname:     \"unicode: CJK string literal\",\n\t\t\tline:     342,\n\t\t\tchar:     18,\n\t\t\texpected: \"**Literal**: `'中文'`\\n\\n**Type**: string\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: == operator after CJK\",\n\t\t\tline:     342,\n\t\t\tchar:     22,\n\t\t\texpected: \"**Operator**: `==`\\n\\ncompare two values of the same type for equality\\n\\n**Overloads**:\\n- `<A> == <A> -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#equality)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: this after CJK\",\n\t\t\tline:     342,\n\t\t\tchar:     25,\n\t\t\texpected: \"**Special variable**\\n\\nRefers to the current message or field being validated.\\n\\nIn field-level rules, `this` refers to the field value.\\nIn message-level rules, `this` refers to the entire message.\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#this)\",\n\t\t},\n\n\t\t// Unicode: mixed emoji (4 UTF-8 bytes, 2 UTF-16 code units) and CJK (3 UTF-8\n\t\t// bytes, 1 UTF-16 code unit) in a single expression, verifying that the per-rune\n\t\t// offset walk handles interleaved character widths correctly.\n\t\t// '🎉中' == this  (expression on line 350, 0-indexed: 349)\n\t\t//  ^ ^        ^--- this at UTF-16 char 26\n\t\t//  | 中 at UTF-16 char 20 (1 code unit, 3 UTF-8 bytes)\n\t\t//  🎉 at UTF-16 chars 18-19 (2 code units, 4 UTF-8 bytes)\n\t\t//  '🎉中' is at UTF-16 chars 17-21; == at 23; this at 26\n\t\t{\n\t\t\tname:     \"unicode: mixed literal (emoji part)\",\n\t\t\tline:     349,\n\t\t\tchar:     18,\n\t\t\texpected: \"**Literal**: `'🎉中'`\\n\\n**Type**: string\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: mixed literal (CJK part)\",\n\t\t\tline:     349,\n\t\t\tchar:     20,\n\t\t\texpected: \"**Literal**: `'🎉中'`\\n\\n**Type**: string\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: == operator after mixed\",\n\t\t\tline:     349,\n\t\t\tchar:     23,\n\t\t\texpected: \"**Operator**: `==`\\n\\ncompare two values of the same type for equality\\n\\n**Overloads**:\\n- `<A> == <A> -> bool`\\n\\n[CEL by Example](https://celbyexample.com/comparison/#equality)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"unicode: this after mixed\",\n\t\t\tline:     349,\n\t\t\tchar:     26,\n\t\t\texpected: \"**Special variable**\\n\\nRefers to the current message or field being validated.\\n\\nIn field-level rules, `this` refers to the field value.\\nIn message-level rules, `this` refers to the entire message.\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#this)\",\n\t\t},\n\n\t\t// Multi-line: CEL expression split across two adjacent proto string literals,\n\t\t// which protocompile concatenates into one value. Hover targets in the second\n\t\t// segment exercise the multi-literal walk in createCELSpan.\n\t\t// Line 357 (0-indexed): `    expression: \"this.size() > 0\"`\n\t\t// Line 358 (0-indexed): `                \" && this != ''\"`\n\t\t//                          ^   ^--- this at UTF-16 char 21\n\t\t//                          && at UTF-16 char 18\n\t\t{\n\t\t\tname:     \"multiline: && in second segment\",\n\t\t\tline:     357,\n\t\t\tchar:     18,\n\t\t\texpected: \"**Operator**: `&&`\\n\\nlogically AND two boolean values. Errors and unknown values\\nare valid inputs and will not halt evaluation.\\n\\n**Overloads**:\\n- `bool && bool -> bool`\\n\\n[CEL by Example](https://celbyexample.com/logical-operators/#and)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"multiline: this in second segment\",\n\t\t\tline:     357,\n\t\t\tchar:     21,\n\t\t\texpected: \"**Special variable**\\n\\nRefers to the current message or field being validated.\\n\\nIn field-level rules, `this` refers to the field value.\\nIn message-level rules, `this` refers to the entire message.\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#this)\",\n\t\t},\n\n\t\t// Escape-sequence test: proto \\n (2 source bytes, 1 CEL byte) placed\n\t\t// immediately before a single-byte token. Without escape-aware offset\n\t\t// handling the computed celOffset lands on whitespace and hover returns\n\t\t// nil; with the fix it lands on '?'.\n\t\t// Line 366 (0-indexed): `    expression: \"true\\n? this : false\"`\n\t\t//                                                  ^--- '?' at column 23\n\t\t{\n\t\t\tname:     \"escape: ? after proto \\\\n\",\n\t\t\tline:     366,\n\t\t\tchar:     23,\n\t\t\texpected: \"**Operator**: `?`\\n\\nThe ternary operator tests a boolean predicate and returns the left-hand side (truthy) expression if true, or the right-hand side (falsy) expression if false\\n\\n**Overloads**:\\n- `bool ? <T> : <T> -> <T>`\\n\\n[CEL by Example](https://celbyexample.com/ternary/)\",\n\t\t},\n\n\t\t// Protovalidate special variable: now\n\t\t// Line 372 (0-indexed): `    expression: \"this < now\"`\n\t\t//                                                   ^--- now at column 24\n\t\t{\n\t\t\tname:     \"variable: now\",\n\t\t\tline:     372,\n\t\t\tchar:     24,\n\t\t\texpected: \"**Special variable**\\n\\nThe current timestamp at the time of validation.\\n\\n**Type**: `google.protobuf.Timestamp`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#now)\",\n\t\t},\n\n\t\t// Protovalidate double extension functions\n\t\t// Line 378 (0-indexed): `    expression: \"this.isNan()\"`\n\t\t//                                                ^--- isNan at column 22\n\t\t{\n\t\t\tname:     \"function: isNan\",\n\t\t\tline:     378,\n\t\t\tchar:     22,\n\t\t\texpected: \"`isNan`\\n\\n**Overloads**:\\n- `double.isNan() -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#isnan)\",\n\t\t},\n\t\t// Line 383 (0-indexed): `    expression: \"this.isInf()\"`\n\t\t//                                                ^--- isInf at column 22\n\t\t{\n\t\t\tname:     \"function: isInf\",\n\t\t\tline:     383,\n\t\t\tchar:     22,\n\t\t\texpected: \"`isInf`\\n\\n**Overloads**:\\n- `double.isInf() -> bool`\\n- `double.isInf(int) -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#isinf)\",\n\t\t},\n\n\t\t// Protovalidate list extension function\n\t\t// Line 389 (0-indexed): `    expression: \"this.unique()\"`\n\t\t//                                                 ^--- unique at column 22\n\t\t{\n\t\t\tname:     \"function: unique\",\n\t\t\tline:     389,\n\t\t\tchar:     22,\n\t\t\texpected: \"`unique`\\n\\n**Overloads**:\\n- `list(bool).unique() -> bool`\\n- `list(int).unique() -> bool`\\n- `list(uint).unique() -> bool`\\n- `list(double).unique() -> bool`\\n- `list(string).unique() -> bool`\\n- `list(bytes).unique() -> bool`\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#unique)\",\n\t\t},\n\n\t\t// Message-level CEL rules\n\t\t{\n\t\t\tname:     \"message-level: this\",\n\t\t\tline:     400,\n\t\t\tchar:     17,\n\t\t\texpected: \"**Special variable**\\n\\nRefers to the current message or field being validated.\\n\\nIn field-level rules, `this` refers to the field value.\\nIn message-level rules, `this` refers to the entire message.\\n\\n[Protovalidate CEL Extensions](https://protovalidate.com/reference/cel_extensions/#this)\",\n\t\t},\n\t\t{\n\t\t\tname:     \"message-level: &&\",\n\t\t\tline:     400,\n\t\t\tchar:     33,\n\t\t\texpected: \"**Operator**: `&&`\\n\\nlogically AND two boolean values. Errors and unknown values\\nare valid inputs and will not halt evaluation.\\n\\n**Overloads**:\\n- `bool && bool -> bool`\\n\\n[CEL by Example](https://celbyexample.com/logical-operators/#and)\",\n\t\t},\n\t\t{\n\t\t\t// `this.name` in the message-level expression; hovering over `name` should\n\t\t\t// resolve to CELMessageTest.name (string, field 1).\n\t\t\tname:     \"message-level: field access name\",\n\t\t\tline:     400,\n\t\t\tchar:     22, // `n` of `name` in `this.name != ''`\n\t\t\texpected: \"**Field**: `name`\\n\\n**Proto Field**: `test.cel.v1.CELMessageTest.name`\\n\\n**Field Number**: 1\\n\\n**Proto Type**: `string`\\n\\nencoded (hex): `0A` (1 byte)\",\n\t\t},\n\t\t{\n\t\t\t// `this.value` in the message-level expression; hovering over `value` should\n\t\t\t// resolve to CELMessageTest.value (int32, field 2).\n\t\t\tname:     \"message-level: field access value\",\n\t\t\tline:     400,\n\t\t\tchar:     41, // `v` of `value` in `this.value > 0`\n\t\t\texpected: \"**Field**: `value`\\n\\n**Proto Field**: `test.cel.v1.CELMessageTest.value`\\n\\n**Field Number**: 2\\n\\n**Proto Type**: `int32`\\n\\nencoded (hex): `10` (1 byte)\",\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tvar hoverResult *protocol.Hover\n\t\t\t_, err = clientJSONConn.Call(ctx, protocol.MethodTextDocumentHover, protocol.HoverParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{URI: testURI},\n\t\t\t\t\tPosition:     protocol.Position{Line: tc.line, Character: tc.char},\n\t\t\t\t},\n\t\t\t}, &hoverResult)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.NotNil(t, hoverResult, \"Expected hover result at Line:%d Char:%d\", tc.line, tc.char)\n\t\t\trequire.NotEmpty(t, hoverResult.Contents.Value, \"Expected non-empty hover content at Line:%d Char:%d\", tc.line, tc.char)\n\n\t\t\tassert.Equal(t, tc.expected, hoverResult.Contents.Value,\n\t\t\t\t\"Hover content mismatch at Line:%d Char:%d\", tc.line, tc.char)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/hover_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestHover(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttests := []struct {\n\t\tname                string\n\t\tprotoFile           string\n\t\tline                uint32\n\t\tcharacter           uint32\n\t\texpectedContains    string\n\t\texpectedNotContains string\n\t\texpectNoHover       bool\n\t}{\n\t\t{\n\t\t\tname:             \"hover_on_user_message\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             7,               // Line with \"message User {\"\n\t\t\tcharacter:        8,               // On the word \"User\"\n\t\t\texpectedContains: \"system.\\nThis\", // Ensure newline between comment lines\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_id_field\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             9,  // Line with \"string id = 1;\"\n\t\t\tcharacter:        10, // On the word \"id\"\n\t\t\texpectedContains: \"The unique identifier for the user\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_status_enum\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             19, // Line with \"enum Status {\"\n\t\t\tcharacter:        5,  // On the word \"Status\"\n\t\t\texpectedContains: \"Status represents the current state of a user\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_status_active\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             24, // Line with \"STATUS_ACTIVE = 1;\"\n\t\t\tcharacter:        2,  // On \"STATUS_ACTIVE\"\n\t\t\texpectedContains: \"The user is active\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_user_service\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             31, // Line with \"service UserService {\"\n\t\t\tcharacter:        8,  // On \"UserService\"\n\t\t\texpectedContains: \"UserService provides operations for managing users\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_get_user_rpc\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             33, // Line with \"rpc GetUser\"\n\t\t\tcharacter:        6,  // On \"GetUser\"\n\t\t\texpectedContains: \"GetUser retrieves a user by their ID\",\n\t\t},\n\t\t{\n\t\t\tname:      \"hover_on_deprecated_option\",\n\t\t\tprotoFile: \"testdata/hover/test.proto\",\n\t\t\tline:      37, // Line with \"option deprecated = true;\"\n\t\t\tcharacter: 11, // On \"deprecated\"\n\t\t\t// We don't want the hover info to include the floating comment that is separated by newlines\n\t\t\t// from the comment above the option.\n\t\t\t// Ref: https://buf.build/protocolbuffers/wellknowntypes/file/main:google/protobuf/descriptor.proto#L946\n\t\t\texpectedNotContains: \"Buffers.\", // From last line of the previous floating comment.\n\t\t\texpectedContains:    \"Is this method deprecated?\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_status_type_reference\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             15, // Line with \"Status status = 3;\"\n\t\t\tcharacter:        2,  // On \"Status\" type\n\t\t\texpectedContains: \"Status represents the current state of a user\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_user_type_reference\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             50, // Line with \"User user = 1;\"\n\t\t\tcharacter:        2,  // On \"User\" type\n\t\t\texpectedContains: \"User represents a user in the system\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_rpc_request_type\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             33, // Line with \"rpc GetUser(GetUserRequest)\"\n\t\t\tcharacter:        14, // On \"GetUserRequest\"\n\t\t\texpectedContains: \"GetUserRequest is the request message for GetUser\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_rpc_response_type\",\n\t\t\tprotoFile:        \"testdata/hover/test.proto\",\n\t\t\tline:             33, // Line with \"returns (GetUserResponse)\"\n\t\t\tcharacter:        39, // On \"GetUserResponse\"\n\t\t\texpectedContains: \"GetUserResponse is the response message for GetUser\",\n\t\t},\n\t\t{\n\t\t\tname:          \"hover_on_syntax_keyword\",\n\t\t\tprotoFile:     \"testdata/hover/test.proto\",\n\t\t\tline:          0, // Line with \"syntax = \"proto3\";\"\n\t\t\tcharacter:     0, // On \"syntax\"\n\t\t\texpectNoHover: true,\n\t\t},\n\t\t{\n\t\t\tname:          \"hover_on_proto3_string\",\n\t\t\tprotoFile:     \"testdata/hover/test.proto\",\n\t\t\tline:          0,  // Line with \"syntax = \"proto3\";\"\n\t\t\tcharacter:     10, // On \"proto3\"\n\t\t\texpectNoHover: true,\n\t\t},\n\t\t{\n\t\t\tname:          \"hover_on_package_keyword\",\n\t\t\tprotoFile:     \"testdata/hover/test.proto\",\n\t\t\tline:          2, // Line with \"package example.v1;\"\n\t\t\tcharacter:     0, // On \"package\"\n\t\t\texpectNoHover: true,\n\t\t},\n\t\t{\n\t\t\tname:          \"hover_on_package_name\",\n\t\t\tprotoFile:     \"testdata/hover/test.proto\",\n\t\t\tline:          2, // Line with \"package example.v1;\"\n\t\t\tcharacter:     8, // On \"example\"\n\t\t\texpectNoHover: true,\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_wkt_timestamp\",\n\t\t\tprotoFile:        \"testdata/document_link/wkt.proto\",\n\t\t\tline:             8, // Line with \"google.protobuf.Timestamp created_at = 1;\"\n\t\t\tcharacter:        9, // On \"Timestamp\" type\n\t\t\texpectedContains: \"https://buf.build/protocolbuffers/wellknowntypes/docs/main:google.protobuf#google.protobuf.Timestamp\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_wkt_duration\",\n\t\t\tprotoFile:        \"testdata/document_link/wkt.proto\",\n\t\t\tline:             9, // Line with \"google.protobuf.Duration timeout = 2;\"\n\t\t\tcharacter:        9, // On \"Duration\" type\n\t\t\texpectedContains: \"https://buf.build/protocolbuffers/wellknowntypes/docs/main:google.protobuf#google.protobuf.Duration\",\n\t\t},\n\t\t{\n\t\t\tname:             \"hover_on_map_keyword\",\n\t\t\tprotoFile:        \"testdata/completion/map_test.proto\",\n\t\t\tline:             16, // Line with \"map<int32, string> field0 = 10;\"\n\t\t\tcharacter:        3,  // On \"map\" keyword\n\t\t\texpectedContains: \"language-spec#maps\",\n\t\t},\n\t\t{\n\t\t\tname:          \"hover_on_message_after_import_with_trailing_comment\",\n\t\t\tprotoFile:     \"testdata/hover/unused_import.proto\",\n\t\t\tline:          4, // Line with \"message TestTopLevel {\"\n\t\t\tcharacter:     8, // On \"TestTopLevel\"\n\t\t\texpectNoHover: true,\n\t\t},\n\t\t{\n\t\t\tname:          \"hover_on_message_after_import_with_trailing_comment_no_blank_line\",\n\t\t\tprotoFile:     \"testdata/hover/unused_import_no_blank_line.proto\",\n\t\t\tline:          3, // Line with \"message TestTopLevel {}\"\n\t\t\tcharacter:     8, // On \"TestTopLevel\"\n\t\t\texpectNoHover: true,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\trequire.NotEmpty(t, tt.protoFile, \"protoFile must be specified\")\n\n\t\t\tprotoPath, err := filepath.Abs(tt.protoFile)\n\t\t\trequire.NoError(t, err)\n\n\t\t\tclientJSONConn, testURI := setupLSPServer(t, protoPath)\n\n\t\t\tvar hover *protocol.Hover\n\t\t\t_, hoverErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentHover, protocol.HoverParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &hover)\n\t\t\trequire.NoError(t, hoverErr)\n\n\t\t\tif tt.expectNoHover {\n\t\t\t\tassert.Nil(t, hover, \"expected no hover information\")\n\t\t\t} else {\n\t\t\t\tif tt.expectedContains != \"\" {\n\t\t\t\t\trequire.NotNil(t, hover, \"expected hover to be non-nil\")\n\t\t\t\t\tassert.Equal(t, protocol.Markdown, hover.Contents.Kind)\n\t\t\t\t\tassert.Contains(t, hover.Contents.Value, tt.expectedContains)\n\t\t\t\t}\n\t\t\t\tif tt.expectedNotContains != \"\" {\n\t\t\t\t\trequire.NotNil(t, hover, \"expected hover to be non-nil\")\n\t\t\t\t\tassert.Equal(t, protocol.Markdown, hover.Contents.Kind)\n\t\t\t\t\tassert.NotContains(t, hover.Contents.Value, tt.expectedNotContains)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/image.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/protocompile\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/linker\"\n\t\"github.com/bufbuild/protocompile/parser\"\n\t\"github.com/bufbuild/protocompile/protoutil\"\n\t\"github.com/bufbuild/protocompile/reporter\"\n\t\"github.com/google/uuid\"\n\t\"go.lsp.dev/protocol\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\n// fileOpener is a type that opens files as they are named in the import\n// statements of .proto files.\n//\n// This is the context given to [buildImage] to control what text to look up for\n// specific files, so that we can e.g. use file contents that are still unsaved\n// in the editor, or use files from a different commit for building an --against\n// image.\ntype fileOpener map[string]string\n\nfunc (p fileOpener) Open(path string) (io.ReadCloser, error) {\n\ttext, ok := p[path]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%s: %w\", path, fs.ErrNotExist)\n\t}\n\treturn io.NopCloser(strings.NewReader(text)), nil\n}\n\n// buildImage builds a Buf Image for the given path. This does not use the controller to build\n// the image, because we need delicate control over the input files: namely, for the case\n// when we depend on a file that has been opened and modified in the editor.\nfunc buildImage(\n\tctx context.Context,\n\tpath string,\n\tlogger *slog.Logger,\n\topener fileOpener,\n) (bufimage.Image, []protocol.Diagnostic) {\n\tvar errorsWithPos []reporter.ErrorWithPos\n\tvar warningErrorsWithPos []reporter.ErrorWithPos\n\tvar symbols linker.Symbols\n\tcompiler := protocompile.Compiler{\n\t\tSourceInfoMode: protocompile.SourceInfoExtraOptionLocations,\n\t\tResolver:       &protocompile.SourceResolver{Accessor: opener.Open},\n\t\tSymbols:        &symbols,\n\t\tReporter: reporter.NewReporter(\n\t\t\tfunc(errorWithPos reporter.ErrorWithPos) error {\n\t\t\t\terrorsWithPos = append(errorsWithPos, errorWithPos)\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tfunc(warningErrorWithPos reporter.ErrorWithPos) {\n\t\t\t\twarningErrorsWithPos = append(warningErrorsWithPos, warningErrorWithPos)\n\t\t\t},\n\t\t),\n\t}\n\n\tvar diagnostics []protocol.Diagnostic\n\tcompiled, err := compiler.Compile(ctx, path)\n\tif err != nil {\n\t\tif !errors.Is(err, context.Canceled) {\n\t\t\tlogger.WarnContext(ctx, \"error building image\", slog.String(\"path\", path), xslog.ErrorAttr(err))\n\t\t}\n\t\tvar errorWithPos reporter.ErrorWithPos\n\t\tif errors.As(err, &errorWithPos) {\n\t\t\tdiagnostics = []protocol.Diagnostic{newDiagnostic(errorWithPos, false, opener, logger)}\n\t\t}\n\t\tif len(errorsWithPos) > 0 {\n\t\t\tdiagnostics = slices.Concat(diagnostics, xslices.Map(errorsWithPos, func(errorWithPos reporter.ErrorWithPos) protocol.Diagnostic {\n\t\t\t\treturn newDiagnostic(errorWithPos, false, opener, logger)\n\t\t\t}))\n\t\t}\n\t}\n\tif len(compiled) == 0 || compiled[0] == nil {\n\t\treturn nil, diagnostics // Image failed to build.\n\t}\n\tcompiledFile := compiled[0]\n\n\tsyntaxMissing := make(map[string]bool)\n\tpathToUnusedImports := make(map[string]map[string]bool)\n\tfor _, warningErrorWithPos := range warningErrorsWithPos {\n\t\tif warningErrorWithPos.Unwrap() == parser.ErrNoSyntax {\n\t\t\tsyntaxMissing[warningErrorWithPos.GetPosition().Filename] = true\n\t\t} else if unusedImport, ok := warningErrorWithPos.Unwrap().(linker.ErrorUnusedImport); ok {\n\t\t\tpath := warningErrorWithPos.GetPosition().Filename\n\t\t\tunused, ok := pathToUnusedImports[path]\n\t\t\tif !ok {\n\t\t\t\tunused = map[string]bool{}\n\t\t\t\tpathToUnusedImports[path] = unused\n\t\t\t}\n\t\t\tunused[unusedImport.UnusedImport()] = true\n\t\t}\n\t}\n\n\tvar imageFiles []bufimage.ImageFile\n\tseen := map[string]bool{}\n\n\tqueue := []protoreflect.FileDescriptor{compiledFile}\n\tfor len(queue) > 0 {\n\t\tdescriptor := queue[len(queue)-1]\n\t\tqueue = queue[:len(queue)-1]\n\n\t\tif seen[descriptor.Path()] {\n\t\t\tcontinue\n\t\t}\n\t\tseen[descriptor.Path()] = true\n\n\t\tunused, ok := pathToUnusedImports[descriptor.Path()]\n\t\tvar unusedIndices []int32\n\t\tif ok {\n\t\t\tunusedIndices = make([]int32, 0, len(unused))\n\t\t}\n\n\t\timports := descriptor.Imports()\n\t\tfor i := range imports.Len() {\n\t\t\tdep := imports.Get(i).FileDescriptor\n\t\t\tif dep == nil {\n\t\t\t\tlogger.Warn(fmt.Sprintf(\"found nil FileDescriptor for import %s\", imports.Get(i).Path()))\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tqueue = append(queue, dep)\n\n\t\t\tif unused != nil {\n\t\t\t\tif _, ok := unused[dep.Path()]; ok {\n\t\t\t\t\tunusedIndices = append(unusedIndices, int32(i))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdescriptorProto := protoutil.ProtoFromFileDescriptor(descriptor)\n\t\tif descriptorProto == nil {\n\t\t\terr = fmt.Errorf(\"protoutil.ProtoFromFileDescriptor() returned nil for %q\", descriptor.Path())\n\t\t\tbreak\n\t\t}\n\n\t\tvar imageFile bufimage.ImageFile\n\t\timageFile, err = bufimage.NewImageFile(\n\t\t\tdescriptorProto,\n\t\t\tnil,\n\t\t\tuuid.UUID{},\n\t\t\t\"\",\n\t\t\tdescriptor.Path(),\n\t\t\tdescriptor.Path() != path,\n\t\t\tsyntaxMissing[descriptor.Path()],\n\t\t\tunusedIndices,\n\t\t)\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\n\t\timageFiles = append(imageFiles, imageFile)\n\t\tlogger.Debug(fmt.Sprintf(\"added image file for %s\", descriptor.Path()))\n\t}\n\n\tif err != nil {\n\t\tlogger.Warn(\"could not build image\", slog.String(\"path\", path), xslog.ErrorAttr(err))\n\t\treturn nil, diagnostics\n\t}\n\n\timage, err := bufimage.NewImage(imageFiles)\n\tif err != nil {\n\t\tlogger.Warn(\"could not build image\", slog.String(\"path\", path), xslog.ErrorAttr(err))\n\t\treturn nil, diagnostics\n\t}\n\n\treturn image, diagnostics\n}\n\n// newDiagnostic converts a protocompile error into a diagnostic.\n//\n// Unfortunately, protocompile's errors are currently too meagre to provide full code\n// spans; that will require a fix in the compiler.\nfunc newDiagnostic(err reporter.ErrorWithPos, isWarning bool, opener fileOpener, logger *slog.Logger) protocol.Diagnostic {\n\tstartPos := err.Start()\n\tendPos := err.End()\n\tfilename := startPos.Filename\n\n\t// Convert positions to UTF-16 encoding for LSP.\n\t// Fallback to byte-based column (will be wrong for non-ASCII).\n\tstartUtf16Col := startPos.Col - 1\n\tendUtf16Col := endPos.Col - 1\n\n\t// TODO: this is a temporary workaround for old diagnostic errors.\n\t// When using the new compiler these conversions will be already handled.\n\tif text, ok := opener[filename]; ok {\n\t\tfile := source.NewFile(filename, text)\n\t\tstartLoc := file.Location(startPos.Offset, positionalEncoding)\n\t\tendLoc := file.Location(endPos.Offset, positionalEncoding)\n\t\tstartUtf16Col = startLoc.Column - 1\n\t\tendUtf16Col = endLoc.Column - 1\n\t} else {\n\t\tlogger.Warn(\n\t\t\t\"failed to open file for diagnostic position encoding\",\n\t\t\tslog.String(\"filename\", filename),\n\t\t)\n\t}\n\n\tstart := protocol.Position{\n\t\tLine:      uint32(startPos.Line - 1),\n\t\tCharacter: uint32(startUtf16Col),\n\t}\n\tend := protocol.Position{\n\t\tLine:      uint32(endPos.Line - 1),\n\t\tCharacter: uint32(endUtf16Col),\n\t}\n\n\tseverity := protocol.DiagnosticSeverityError\n\tif isWarning {\n\t\tseverity = protocol.DiagnosticSeverityWarning\n\t}\n\n\treturn protocol.Diagnostic{\n\t\tRange:    protocol.Range{Start: start, End: end},\n\t\tSeverity: severity,\n\t\tMessage:  err.Unwrap().Error(),\n\t\tSource:   serverName,\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/jsonrpc_wrappers.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"go.lsp.dev/jsonrpc2\"\n)\n\n// wrapReplier wraps a jsonrpc2.Replier, allowing us to inject logging and tracing and so on.\nfunc (l *lsp) wrapReplier(reply jsonrpc2.Replier, req jsonrpc2.Request) jsonrpc2.Replier {\n\treturn func(ctx context.Context, result any, err error) error {\n\t\tif err != nil {\n\t\t\tl.logger.Warn(\n\t\t\t\t\"responding with error\",\n\t\t\t\tslog.String(\"method\", req.Method()),\n\t\t\t\txslog.ErrorAttr(err),\n\t\t\t)\n\t\t} else {\n\t\t\tl.logger.Debug(\n\t\t\t\t\"responding\",\n\t\t\t\tslog.String(\"method\", req.Method()),\n\t\t\t)\n\t\t}\n\n\t\treturn reply(ctx, result, err)\n\t}\n}\n\n// connWrapper wraps a connection and logs calls and notifications.\n//\n// By default, the ClientDispatcher does not log the bodies of requests and responses, making\n// for much lower-quality debugging.\ntype connWrapper struct {\n\tjsonrpc2.Conn\n\n\tlogger *slog.Logger\n}\n\nfunc (c *connWrapper) Call(\n\tctx context.Context, method string, params, result any) (id jsonrpc2.ID, err error) {\n\tc.logger.Debug(\n\t\t\"call\",\n\t\tslog.String(\"method\", method),\n\t)\n\n\tid, err = c.Conn.Call(ctx, method, params, result)\n\tif err != nil {\n\t\tc.logger.Warn(\n\t\t\t\"call returned error\",\n\t\t\tslog.String(\"method\", method),\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t} else {\n\t\tc.logger.Debug(\n\t\t\t\"call returned\",\n\t\t\tslog.String(\"method\", method),\n\t\t)\n\t}\n\n\treturn\n}\n\nfunc (c *connWrapper) Notify(\n\tctx context.Context, method string, params any) error {\n\tc.logger.Debug(\n\t\t\"notify\",\n\t\tslog.String(\"method\", method),\n\t)\n\n\terr := c.Conn.Notify(ctx, method, params)\n\tif err != nil {\n\t\tc.logger.Warn(\n\t\t\t\"notify returned error\",\n\t\t\tslog.String(\"method\", method),\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t} else {\n\t\tc.logger.Debug(\n\t\t\t\"notify returned\",\n\t\t\tslog.String(\"method\", method),\n\t\t)\n\t}\n\n\treturn err\n}\n"
  },
  {
    "path": "private/buf/buflsp/lint_ignore.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file implements the buf:lint:ignore code action for suppressing lint diagnostics.\n// Reference implementation: https://github.com/bufbuild/intellij-buf/pull/212\n\npackage buflsp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/protocompile/experimental/token\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// getLintIgnoreCodeActions generates code actions for suppressing lint diagnostics\n// at the given range. Returns a list of code actions, one for each applicable lint\n// diagnostic that overlaps with the provided range.\nfunc (s *server) getLintIgnoreCodeActions(\n\tctx context.Context,\n\tfile *file,\n\tparams *protocol.CodeActionParams,\n) []protocol.CodeAction {\n\ts.logger.DebugContext(ctx, \"lint_ignore: checking code actions\",\n\t\tslog.String(\"uri\", string(params.TextDocument.URI)),\n\t\tslog.Uint64(\"line\", uint64(params.Range.Start.Line)),\n\t\tslog.Uint64(\"char\", uint64(params.Range.Start.Character)),\n\t)\n\n\tvar actions []protocol.CodeAction\n\n\t// Filter diagnostics to find lint errors that overlap with the requested range\n\tfor _, diagnostic := range file.diagnostics {\n\t\t// Only handle lint diagnostics (not IR diagnostics)\n\t\tif diagnostic.Source != \"buf lint\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Diagnostic must have a code (the rule ID)\n\t\truleID, ok := diagnostic.Code.(string)\n\t\tif !ok || ruleID == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Skip file-wide lints (e.g., PACKAGE_DEFINED, FILE_LOWER_SNAKE_CASE).\n\t\tif isFileWideLint(diagnostic.Range) {\n\t\t\ts.logger.DebugContext(ctx, \"lint_ignore: skipping file-wide lint\",\n\t\t\t\tslog.String(\"rule_id\", ruleID),\n\t\t\t)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check if diagnostic overlaps with the requested range\n\t\tif !rangesOverlap(diagnostic.Range, params.Range) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Generate the code action for this diagnostic\n\t\tif action := s.generateLintIgnoreAction(ctx, file, diagnostic, ruleID); action != nil {\n\t\t\tactions = append(actions, *action)\n\t\t}\n\t}\n\n\t// If there's only one lint ignore action, mark it as preferred, since this likely corresponds\n\t// closely to a user's intent while requesting code actions on this line.\n\tif len(actions) == 1 {\n\t\tactions[0].IsPreferred = true\n\t}\n\n\ts.logger.DebugContext(ctx, \"lint_ignore: generated actions\",\n\t\tslog.Int(\"count\", len(actions)),\n\t)\n\n\treturn actions\n}\n\n// generateLintIgnoreAction creates a single code action for suppressing a lint diagnostic.\nfunc (s *server) generateLintIgnoreAction(\n\tctx context.Context,\n\tfile *file,\n\tdiagnostic protocol.Diagnostic,\n\truleID string,\n) *protocol.CodeAction {\n\t// We insert AT the diagnostic line (at character 0), which pushes it down,\n\t// making the comment appear on the line before the error in the final output.\n\tdiagnosticLine := diagnostic.Range.Start.Line\n\n\t// file.file.LineOffsets is 1-indexed; diagnosticLine is 0-indexed LSP.\n\tdiagLineStart, _ := file.file.LineOffsets(int(diagnosticLine) + 1)\n\n\t// Check if a standalone ignore comment already exists on the line before the diagnostic.\n\t// Walk back from the start of the diagnostic line through the token stream.\n\tif diagnosticLine > 0 && file.ir != nil && file.ir.AST() != nil && file.ir.AST().Stream() != nil {\n\t\tbefore, _ := file.ir.AST().Stream().Around(diagLineStart)\n\t\tif !before.IsZero() && before.Kind() == token.Comment &&\n\t\t\tstrings.Contains(strings.ToLower(before.Text()), \"buf:lint:ignore\") &&\n\t\t\tstrings.Contains(before.Text(), ruleID) {\n\t\t\t// Confirm the comment is standalone (not a trailing comment after code on the same line).\n\t\t\t// Walk back past indentation spaces; if what precedes is a newline or start of\n\t\t\t// block, the comment occupies its own line.\n\t\t\tcursor := token.NewCursorAt(before)\n\t\t\tprevTok := cursor.PrevSkippable()\n\t\t\tfor !prevTok.IsZero() && isTokenSpace(prevTok) {\n\t\t\t\tprevTok = cursor.PrevSkippable()\n\t\t\t}\n\t\t\tif prevTok.IsZero() || strings.ContainsRune(prevTok.Text(), '\\n') {\n\t\t\t\ts.logger.DebugContext(ctx, \"lint_ignore: ignore comment already exists for this rule\",\n\t\t\t\t\tslog.Uint64(\"line\", uint64(diagnosticLine-1)),\n\t\t\t\t\tslog.String(\"rule_id\", ruleID),\n\t\t\t\t)\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\n\t// Extract indentation from the diagnostic line.\n\tindentation := file.file.Indentation(diagLineStart)\n\n\t// Generate the ignore comment.\n\tcommentText := fmt.Sprintf(\"// buf:lint:ignore %s\\n\", ruleID)\n\n\t// Create the text edit.\n\tedit := protocol.TextEdit{\n\t\tRange: protocol.Range{\n\t\t\tStart: protocol.Position{Line: diagnosticLine, Character: 0},\n\t\t\tEnd:   protocol.Position{Line: diagnosticLine, Character: 0},\n\t\t},\n\t\tNewText: indentation + commentText,\n\t}\n\n\t// Create the code action.\n\taction := protocol.CodeAction{\n\t\tTitle: fmt.Sprintf(\"Suppress %s with buf:lint:ignore\", ruleID),\n\t\tKind:  protocol.QuickFix,\n\t\tEdit: &protocol.WorkspaceEdit{\n\t\t\tChanges: map[protocol.DocumentURI][]protocol.TextEdit{\n\t\t\t\tfile.uri: {edit},\n\t\t\t},\n\t\t},\n\t\tDiagnostics: []protocol.Diagnostic{diagnostic},\n\t}\n\n\treturn &action\n}\n\n// isFileWideLint returns true if the diagnostic is a file-wide lint.\n// File-wide lints apply to the entire file and are reported at position 0:0.\n// These should be suppressed in buf.yaml using ignore_only, not with inline comments.\n// Examples include PACKAGE_DEFINED and FILE_LOWER_SNAKE_CASE.\n// See: https://github.com/bufbuild/intellij-buf/issues/215\nfunc isFileWideLint(r protocol.Range) bool {\n\treturn r.Start.Line == 0 && r.Start.Character == 0\n}\n\n// rangesOverlap returns true if two ranges overlap or touch each other.\nfunc rangesOverlap(r1, r2 protocol.Range) bool {\n\t// Check if the ranges are on the same line (or overlapping lines)\n\t// For code actions, we consider a diagnostic to overlap if it's on the same line\n\t// as the cursor, even if the cursor is not directly on the diagnostic text.\n\tif r1.Start.Line > r2.End.Line || r2.Start.Line > r1.End.Line {\n\t\treturn false\n\t}\n\n\t// If they're on the same line or overlapping lines, consider them overlapping\n\treturn true\n}\n"
  },
  {
    "path": "private/buf/buflsp/lint_ignore_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\t\"testing\"\n\t\"testing/synctest\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestCodeAction_LintIgnore(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tname              string\n\t\tfilename          string\n\t\tcursorLine        uint32\n\t\tcursorChar        uint32\n\t\texpectedRuleIDs   []string // If multiple, tests multiple actions on same line\n\t\texpectedEdits     []protocol.TextEdit\n\t\texpectNoAction    bool\n\t\texpectIsPreferred bool\n\t}{\n\t\t{\n\t\t\tname:              \"basic_field_lint_error\",\n\t\t\tfilename:          \"testdata/lint_ignore/field_test.proto\",\n\t\t\tcursorLine:        5,\n\t\t\tcursorChar:        10,\n\t\t\texpectedRuleIDs:   []string{\"FIELD_LOWER_SNAKE_CASE\"},\n\t\t\texpectIsPreferred: true,\n\t\t\texpectedEdits: []protocol.TextEdit{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\t},\n\t\t\t\t\tNewText: \"  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\\n\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:              \"nested_message_with_indentation\",\n\t\t\tfilename:          \"testdata/lint_ignore/nested_test.proto\",\n\t\t\tcursorLine:        6,\n\t\t\tcursorChar:        10,\n\t\t\texpectedRuleIDs:   []string{\"FIELD_LOWER_SNAKE_CASE\"},\n\t\t\texpectIsPreferred: true,\n\t\t\texpectedEdits: []protocol.TextEdit{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 6, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 6, Character: 0},\n\t\t\t\t\t},\n\t\t\t\t\tNewText: \"    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\\n\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:            \"package_line_diagnostic\",\n\t\t\tfilename:        \"testdata/lint_ignore/syntax_test.proto\",\n\t\t\tcursorLine:      2,\n\t\t\tcursorChar:      0,\n\t\t\texpectedRuleIDs: []string{\"PACKAGE_DIRECTORY_MATCH\", \"PACKAGE_VERSION_SUFFIX\"},\n\t\t\t// Multiple actions, so IsPreferred should not be set\n\t\t},\n\t\t{\n\t\t\tname:           \"no_action_on_line_without_lints\",\n\t\t\tfilename:       \"testdata/lint_ignore/field_test.proto\",\n\t\t\tcursorLine:     1,\n\t\t\tcursorChar:     0,\n\t\t\texpectNoAction: true,\n\t\t},\n\t\t{\n\t\t\tname:            \"multiple_lints_on_same_line\",\n\t\t\tfilename:        \"testdata/lint_ignore/multiple_test.proto\",\n\t\t\tcursorLine:      2,\n\t\t\tcursorChar:      0,\n\t\t\texpectedRuleIDs: []string{\"PACKAGE_DIRECTORY_MATCH\", \"PACKAGE_VERSION_SUFFIX\"},\n\t\t},\n\t\t{\n\t\t\tname:           \"file_wide_lints_are_skipped\",\n\t\t\tfilename:       \"testdata/lint_ignore/filewide_test.proto\",\n\t\t\tcursorLine:     0,\n\t\t\tcursorChar:     0,\n\t\t\texpectNoAction: true,\n\t\t},\n\t\t{\n\t\t\tname:           \"already_has_ignore_for_same_rule\",\n\t\t\tfilename:       \"testdata/lint_ignore/already_ignored_test.proto\",\n\t\t\tcursorLine:     6,\n\t\t\tcursorChar:     10,\n\t\t\texpectNoAction: true,\n\t\t},\n\t\t{\n\t\t\tname:              \"already_has_ignore_for_different_rule\",\n\t\t\tfilename:          \"testdata/lint_ignore/different_rule_test.proto\",\n\t\t\tcursorLine:        6,\n\t\t\tcursorChar:        10,\n\t\t\texpectedRuleIDs:   []string{\"FIELD_LOWER_SNAKE_CASE\"},\n\t\t\texpectIsPreferred: true,\n\t\t\texpectedEdits: []protocol.TextEdit{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 6, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 6, Character: 0},\n\t\t\t\t\t},\n\t\t\t\t\tNewText: \"  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\\n\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:              \"tab_indentation_is_preserved\",\n\t\t\tfilename:          \"testdata/lint_ignore/tabs_test.proto\",\n\t\t\tcursorLine:        5,\n\t\t\tcursorChar:        10,\n\t\t\texpectedRuleIDs:   []string{\"FIELD_LOWER_SNAKE_CASE\"},\n\t\t\texpectIsPreferred: true,\n\t\t\texpectedEdits: []protocol.TextEdit{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\t},\n\t\t\t\t\tNewText: \"\\t// buf:lint:ignore FIELD_LOWER_SNAKE_CASE\\n\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:            \"trailing_comment_does_not_suppress_package_lint\",\n\t\t\tfilename:        \"testdata/lint_ignore/trailing_comment_test.proto\",\n\t\t\tcursorLine:      2,\n\t\t\tcursorChar:      10,\n\t\t\texpectedRuleIDs: []string{\"PACKAGE_DIRECTORY_MATCH\", \"PACKAGE_VERSION_SUFFIX\"},\n\t\t\t// Multiple actions, so IsPreferred should not be set\n\t\t},\n\t\t{\n\t\t\tname:              \"trailing_comment_does_not_suppress_field_lint\",\n\t\t\tfilename:          \"testdata/lint_ignore/trailing_comment_test.proto\",\n\t\t\tcursorLine:        5,\n\t\t\tcursorChar:        10,\n\t\t\texpectedRuleIDs:   []string{\"FIELD_LOWER_SNAKE_CASE\"},\n\t\t\texpectIsPreferred: true,\n\t\t\texpectedEdits: []protocol.TextEdit{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\t},\n\t\t\t\t\tNewText: \"  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\\n\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:              \"trailing_comment_on_previous_line_does_not_suppress_field_lint\",\n\t\t\tfilename:          \"testdata/lint_ignore/trailing_comment_test.proto\",\n\t\t\tcursorLine:        6,\n\t\t\tcursorChar:        10,\n\t\t\texpectedRuleIDs:   []string{\"FIELD_LOWER_SNAKE_CASE\"},\n\t\t\texpectIsPreferred: true,\n\t\t\texpectedEdits: []protocol.TextEdit{\n\t\t\t\t{\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: 6, Character: 0},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: 6, Character: 0},\n\t\t\t\t\t},\n\t\t\t\t\tNewText: \"  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\\n\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tsynctest.Test(t, func(t *testing.T) {\n\t\t\t\ttestProtoPath, err := filepath.Abs(tt.filename)\n\t\t\t\trequire.NoError(t, err)\n\n\t\t\t\tclientJSONConn, testURI, capture := setupLSPServerWithDiagnostics(t, testProtoPath)\n\n\t\t\t\t// Wait for lint diagnostics if we expect actions\n\t\t\t\tif !tt.expectNoAction && len(tt.expectedRuleIDs) > 0 {\n\t\t\t\t\tdiagnostics := capture.wait(t, testURI, 10*time.Second, func(p *protocol.PublishDiagnosticsParams) bool {\n\t\t\t\t\t\tcount := 0\n\t\t\t\t\t\tfor _, d := range p.Diagnostics {\n\t\t\t\t\t\t\tif d.Source == \"buf lint\" {\n\t\t\t\t\t\t\t\tif code, ok := d.Code.(string); ok {\n\t\t\t\t\t\t\t\t\tif slices.Contains(tt.expectedRuleIDs, code) {\n\t\t\t\t\t\t\t\t\t\tcount++\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\treturn count >= len(tt.expectedRuleIDs)\n\t\t\t\t\t})\n\t\t\t\t\trequire.NotNil(t, diagnostics, \"expected lint diagnostics to be published\")\n\t\t\t\t}\n\n\t\t\t\t// Request code actions at the specified position\n\t\t\t\tvar codeActions []protocol.CodeAction\n\t\t\t\t_, err = clientJSONConn.Call(t.Context(), protocol.MethodTextDocumentCodeAction, protocol.CodeActionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tRange: protocol.Range{\n\t\t\t\t\t\tStart: protocol.Position{Line: tt.cursorLine, Character: tt.cursorChar},\n\t\t\t\t\t\tEnd:   protocol.Position{Line: tt.cursorLine, Character: tt.cursorChar},\n\t\t\t\t\t},\n\t\t\t\t\tContext: protocol.CodeActionContext{\n\t\t\t\t\t\tOnly: []protocol.CodeActionKind{\n\t\t\t\t\t\t\tprotocol.QuickFix,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t}, &codeActions)\n\t\t\t\trequire.NoError(t, err)\n\n\t\t\t\t// Filter to lint ignore actions only\n\t\t\t\tvar lintIgnoreActions []protocol.CodeAction\n\t\t\t\tfor _, action := range codeActions {\n\t\t\t\t\tif action.Kind == protocol.QuickFix && strings.Contains(action.Title, \"buf:lint:ignore\") {\n\t\t\t\t\t\tlintIgnoreActions = append(lintIgnoreActions, action)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif tt.expectNoAction {\n\t\t\t\t\tassert.Empty(t, lintIgnoreActions, \"expected no lint ignore actions\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\t// Verify we have the expected number of actions\n\t\t\t\trequire.Len(t, lintIgnoreActions, len(tt.expectedRuleIDs),\n\t\t\t\t\t\"expected %d lint ignore action(s)\", len(tt.expectedRuleIDs))\n\n\t\t\t\t// Verify each expected rule has an action\n\t\t\t\tfor _, ruleID := range tt.expectedRuleIDs {\n\t\t\t\t\texpectedTitle := \"Suppress \" + ruleID + \" with buf:lint:ignore\"\n\t\t\t\t\tvar foundAction *protocol.CodeAction\n\t\t\t\t\tfor i := range lintIgnoreActions {\n\t\t\t\t\t\tif lintIgnoreActions[i].Title == expectedTitle {\n\t\t\t\t\t\t\tfoundAction = &lintIgnoreActions[i]\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\trequire.NotNil(t, foundAction, \"expected to find action for rule %s\", ruleID)\n\t\t\t\t\tassert.Equal(t, protocol.QuickFix, foundAction.Kind)\n\n\t\t\t\t\t// Check IsPreferred flag\n\t\t\t\t\tif tt.expectIsPreferred {\n\t\t\t\t\t\tassert.True(t, foundAction.IsPreferred, \"expected action to be marked as preferred\")\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Verify edits if provided (only for single-action tests)\n\t\t\t\tif len(tt.expectedEdits) > 0 && len(tt.expectedRuleIDs) == 1 {\n\t\t\t\t\taction := lintIgnoreActions[0]\n\t\t\t\t\trequire.NotNil(t, action.Edit)\n\t\t\t\t\trequire.NotNil(t, action.Edit.Changes)\n\n\t\t\t\t\tchanges, ok := action.Edit.Changes[testURI]\n\t\t\t\t\trequire.True(t, ok, \"expected changes for test file\")\n\t\t\t\t\trequire.Equal(t, len(tt.expectedEdits), len(changes),\n\t\t\t\t\t\t\"expected %d edit(s), got %d\", len(tt.expectedEdits), len(changes))\n\n\t\t\t\t\tfor i, expectedEdit := range tt.expectedEdits {\n\t\t\t\t\t\tassert.Equal(t, expectedEdit.Range, changes[i].Range, \"edit %d: range mismatch\", i)\n\t\t\t\t\t\tassert.Equal(t, expectedEdit.NewText, changes[i].NewText, \"edit %d: new text mismatch\", i)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/nyi.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file provides an implementation of protocol.Server where every function returns an error.\n\npackage buflsp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"runtime\"\n\n\t\"go.lsp.dev/protocol\"\n)\n\n// validate the protocol.Server implementation.\nvar _ protocol.Server = nyi{}\n\n// nyi implements protocol. Server, but every function returns an error.\ntype nyi struct{}\n\n// NOTE: The functions below were generated using code completion. Do not edit!\n\nfunc (nyi) CodeAction(ctx context.Context, params *protocol.CodeActionParams) (result []protocol.CodeAction, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) CodeLens(ctx context.Context, params *protocol.CodeLensParams) (result []protocol.CodeLens, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) CodeLensRefresh(ctx context.Context) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) CodeLensResolve(ctx context.Context, params *protocol.CodeLens) (result *protocol.CodeLens, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) ColorPresentation(ctx context.Context, params *protocol.ColorPresentationParams) (result []protocol.ColorPresentation, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Completion(ctx context.Context, params *protocol.CompletionParams) (result *protocol.CompletionList, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) CompletionResolve(ctx context.Context, params *protocol.CompletionItem) (result *protocol.CompletionItem, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Declaration(ctx context.Context, params *protocol.DeclarationParams) (result []protocol.Location, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Definition(ctx context.Context, params *protocol.DefinitionParams) (result []protocol.Location, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) DidChange(ctx context.Context, params *protocol.DidChangeTextDocumentParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidChangeConfiguration(ctx context.Context, params *protocol.DidChangeConfigurationParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidChangeWatchedFiles(ctx context.Context, params *protocol.DidChangeWatchedFilesParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidChangeWorkspaceFolders(ctx context.Context, params *protocol.DidChangeWorkspaceFoldersParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidClose(ctx context.Context, params *protocol.DidCloseTextDocumentParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidOpen(ctx context.Context, params *protocol.DidOpenTextDocumentParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DidSave(ctx context.Context, params *protocol.DidSaveTextDocumentParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) DocumentColor(ctx context.Context, params *protocol.DocumentColorParams) (result []protocol.ColorInformation, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) DocumentHighlight(ctx context.Context, params *protocol.DocumentHighlightParams) (result []protocol.DocumentHighlight, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) DocumentLink(ctx context.Context, params *protocol.DocumentLinkParams) (result []protocol.DocumentLink, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) DocumentLinkResolve(ctx context.Context, params *protocol.DocumentLink) (result *protocol.DocumentLink, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) DocumentSymbol(ctx context.Context, params *protocol.DocumentSymbolParams) (result []any, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) ExecuteCommand(ctx context.Context, params *protocol.ExecuteCommandParams) (result any, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Exit(ctx context.Context) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) FoldingRanges(ctx context.Context, params *protocol.FoldingRangeParams) (result []protocol.FoldingRange, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Formatting(ctx context.Context, params *protocol.DocumentFormattingParams) (result []protocol.TextEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Hover(ctx context.Context, params *protocol.HoverParams) (result *protocol.Hover, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Implementation(ctx context.Context, params *protocol.ImplementationParams) (result []protocol.Location, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) IncomingCalls(ctx context.Context, params *protocol.CallHierarchyIncomingCallsParams) (result []protocol.CallHierarchyIncomingCall, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Initialize(ctx context.Context, params *protocol.InitializeParams) (result *protocol.InitializeResult, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Initialized(ctx context.Context, params *protocol.InitializedParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) LinkedEditingRange(ctx context.Context, params *protocol.LinkedEditingRangeParams) (result *protocol.LinkedEditingRanges, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) LogTrace(ctx context.Context, params *protocol.LogTraceParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) Moniker(ctx context.Context, params *protocol.MonikerParams) (result []protocol.Moniker, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) OnTypeFormatting(ctx context.Context, params *protocol.DocumentOnTypeFormattingParams) (result []protocol.TextEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) OutgoingCalls(ctx context.Context, params *protocol.CallHierarchyOutgoingCallsParams) (result []protocol.CallHierarchyOutgoingCall, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) PrepareCallHierarchy(ctx context.Context, params *protocol.CallHierarchyPrepareParams) (result []protocol.CallHierarchyItem, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (result *protocol.Range, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) RangeFormatting(ctx context.Context, params *protocol.DocumentRangeFormattingParams) (result []protocol.TextEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) References(ctx context.Context, params *protocol.ReferenceParams) (result []protocol.Location, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Rename(ctx context.Context, params *protocol.RenameParams) (result *protocol.WorkspaceEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Request(ctx context.Context, method string, params any) (result any, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) SemanticTokensFull(ctx context.Context, params *protocol.SemanticTokensParams) (result *protocol.SemanticTokens, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) SemanticTokensFullDelta(ctx context.Context, params *protocol.SemanticTokensDeltaParams) (result any, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) SemanticTokensRange(ctx context.Context, params *protocol.SemanticTokensRangeParams) (result *protocol.SemanticTokens, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) SemanticTokensRefresh(ctx context.Context) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) SetTrace(ctx context.Context, params *protocol.SetTraceParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) ShowDocument(ctx context.Context, params *protocol.ShowDocumentParams) (result *protocol.ShowDocumentResult, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Shutdown(ctx context.Context) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) SignatureHelp(ctx context.Context, params *protocol.SignatureHelpParams) (result *protocol.SignatureHelp, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) Symbols(ctx context.Context, params *protocol.WorkspaceSymbolParams) (result []protocol.SymbolInformation, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) TypeDefinition(ctx context.Context, params *protocol.TypeDefinitionParams) (result []protocol.Location, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) WillCreateFiles(ctx context.Context, params *protocol.CreateFilesParams) (result *protocol.WorkspaceEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) WillDeleteFiles(ctx context.Context, params *protocol.DeleteFilesParams) (result *protocol.WorkspaceEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) WillRenameFiles(ctx context.Context, params *protocol.RenameFilesParams) (result *protocol.WorkspaceEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) WillSave(ctx context.Context, params *protocol.WillSaveTextDocumentParams) (err error) {\n\treturn newNYIError()\n}\nfunc (nyi) WillSaveWaitUntil(ctx context.Context, params *protocol.WillSaveTextDocumentParams) (result []protocol.TextEdit, err error) {\n\treturn nil, newNYIError()\n}\nfunc (nyi) WorkDoneProgressCancel(ctx context.Context, params *protocol.WorkDoneProgressCancelParams) (err error) {\n\treturn newNYIError()\n}\n\n// nyi returns a \"not yet implemented\" error containing the name of the function that called it.\nfunc newNYIError() error {\n\tcaller := \"<unknown function>\"\n\tif pc, _, _, ok := runtime.Caller(1); ok {\n\t\tif fn := runtime.FuncForPC(pc); fn != nil {\n\t\t\tcaller = fn.Name()\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"not yet implemented, sorry: %s\", caller)\n}\n"
  },
  {
    "path": "private/buf/buflsp/organize_imports.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file implements useful code actions.\n\npackage buflsp\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/report/tags\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/experimental/source/length\"\n\t\"github.com/bufbuild/protocompile/experimental/token\"\n\t\"github.com/bufbuild/protocompile/experimental/token/keyword\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// importInfo represents an import statement to be included in the organized imports.\ntype importInfo struct {\n\tpath string // The import path (e.g., \"acme/foo.proto\")\n\ttext string // The full import declaration including comments (e.g. \"// Foo\\nimport \"acme/foo.proto\";)\n}\n\n// getOrganizeImportsCodeAction generates a code action for organizing imports.\n// It uses IR diagnostics to find unresolved types, unused imports, and organizes all imports.\nfunc (s *server) getOrganizeImportsCodeAction(ctx context.Context, file *file) *protocol.CodeAction {\n\tif file.workspace == nil || file.irReport == nil {\n\t\treturn nil\n\t}\n\n\t// Find all unresolved type references and unused imports from the IR diagnostics\n\tunresolvedRefs := make(map[ir.FullName]bool)\n\tunusedImports := make(map[string]bool)\n\n\tfor _, diag := range file.irReport.Diagnostics {\n\t\tif diag.Primary().Path() != file.file.Path() {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Process UnknownSymbol diagnostics (missing imports)\n\t\tif diag.Tag() == tags.UnknownSymbol {\n\t\t\t// Get the exact symbol name as written in the source\n\t\t\tmissingType := diag.Primary().Text()\n\t\t\tif missingType != \"\" {\n\t\t\t\t// The text may have a leading dot for absolute paths, remove it\n\t\t\t\ttypeName := strings.TrimPrefix(missingType, \".\")\n\t\t\t\tunresolvedRefs[ir.FullName(typeName)] = true\n\t\t\t}\n\t\t}\n\n\t\t// Process UnusedImport diagnostics (imports to remove)\n\t\tif diag.Tag() == tags.UnusedImport {\n\t\t\t// The diagnostic text contains the import path\n\t\t\tunusedImportPath := diag.Primary().Text()\n\t\t\tif unusedImportPath != \"\" {\n\t\t\t\t// Remove quotes if present\n\t\t\t\tunusedImportPath = strings.Trim(unusedImportPath, \"\\\"\")\n\t\t\t\tunusedImports[unusedImportPath] = true\n\t\t\t}\n\t\t}\n\t}\n\n\t// Find imports needed for each unresolved type\n\timportsToAdd := make(map[string]bool)\n\tfor typeFullName := range unresolvedRefs {\n\t\t// Search for this type in all workspace files\n\t\tfor _, workspaceFile := range file.workspace.PathToFile() {\n\t\t\t// Skip the current file\n\t\t\tif workspaceFile.file.Path() == file.file.Path() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif symbolInFile(typeFullName, workspaceFile) {\n\t\t\t\timportPath := workspaceFile.objectInfo.Path()\n\t\t\t\timportsToAdd[importPath] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// Build a map of resolved imports from the IR (these exist and were successfully parsed)\n\tresolvedImports := make(map[string]bool)\n\tfor currentFileImport := range seq.Values(file.ir.Imports()) {\n\t\tresolvedImports[currentFileImport.Path()] = true\n\t}\n\n\tvar (\n\t\timports []importInfo\n\t\tedits   []protocol.TextEdit\n\t\tdirty   bool\n\t)\n\n\t// Iterate over ALL imports in the AST (including unknown/unresolved ones)\n\tfor importDecl := range file.ir.AST().Imports() {\n\t\timportPathExpr := importDecl.ImportPath()\n\t\tif importPathExpr.IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\timportPath := strings.Trim(importPathExpr.Span().Text(), \"\\\"\")\n\t\timportWithCommentsSpan := captureImportSpan(importDecl)\n\t\tedits = append(edits, protocol.TextEdit{\n\t\t\tRange:   reportSpanToProtocolRange(importWithCommentsSpan),\n\t\t\tNewText: \"\", // delete\n\t\t})\n\n\t\tif unusedImports[importPath] {\n\t\t\tdirty = true\n\t\t\tcontinue\n\t\t}\n\t\tif !resolvedImports[importPath] {\n\t\t\tdirty = true\n\t\t\tcontinue\n\t\t}\n\n\t\ttext := importWithCommentsSpan.Text()\n\t\ttext = strings.TrimRightFunc(text, unicode.IsSpace)\n\n\t\timportInfo := importInfo{\n\t\t\tpath: importPath,\n\t\t\ttext: text,\n\t\t}\n\t\timports = append(imports, importInfo)\n\t}\n\n\t// Add new imports.\n\tfor importPath := range importsToAdd {\n\t\timports = append(imports, importInfo{\n\t\t\tpath: importPath,\n\t\t\ttext: fmt.Sprintf(\"%s %q;\", keyword.Import, importPath),\n\t\t})\n\t\tdirty = true\n\t}\n\tslices.SortFunc(imports, func(a, b importInfo) int {\n\t\tif compare := strings.Compare(a.path, b.path); compare != 0 {\n\t\t\treturn compare\n\t\t}\n\t\treturn len(b.text) - len(a.text) // Prefer commented imports\n\t})\n\t// Remove duplicates by text content (compare with previous)\n\tdeduped := imports[:0]\n\tvar prev string\n\tfor _, info := range imports {\n\t\tif info.text != prev {\n\t\t\tdeduped = append(deduped, info)\n\t\t\tprev = info.text\n\t\t}\n\t}\n\timports = deduped\n\n\t// Build the new import text\n\tvar importText strings.Builder\n\tif len(imports) > 0 {\n\t\timportText.WriteString(\"\\n\")\n\t}\n\tfor _, info := range imports {\n\t\timportText.WriteString(info.text + \"\\n\")\n\t}\n\n\t// Find the insert position after the package or syntax declaration\n\tvar insertLine int\n\tswitch {\n\tcase !file.ir.AST().Package().IsZero():\n\t\tinsertLine = file.ir.AST().Package().Span().EndLoc().Line + 1\n\tcase !file.ir.AST().Syntax().IsZero():\n\t\tinsertLine = file.ir.AST().Syntax().Span().EndLoc().Line + 1\n\tdefault:\n\t\tinsertLine = 1 // Default at top of file.\n\t}\n\t// Compare to the insert offset, at the newline (so increment 1)\n\tinsertOffset := file.file.InverseLocation(insertLine, 0, length.Bytes).Offset + 1\n\tif !dirty && insertOffset < len(file.file.Text()) &&\n\t\tstrings.HasPrefix(file.file.Text()[insertOffset:], importText.String()) {\n\t\treturn nil // Matches, no changes needed.\n\t}\n\n\tif importText.Len() > 0 {\n\t\tedits = append(edits, protocol.TextEdit{\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: protocol.Position{Line: uint32(insertLine - 1)},\n\t\t\t\tEnd:   protocol.Position{Line: uint32(insertLine - 1)},\n\t\t\t},\n\t\t\tNewText: importText.String(),\n\t\t})\n\t}\n\treturn &protocol.CodeAction{\n\t\tTitle: \"Organize imports\",\n\t\tKind:  protocol.SourceOrganizeImports,\n\t\tEdit: &protocol.WorkspaceEdit{\n\t\t\tChanges: map[protocol.DocumentURI][]protocol.TextEdit{\n\t\t\t\tfile.uri: edits,\n\t\t\t},\n\t\t},\n\t}\n}\n\n// symbolInFiles searches through the files exported types.\nfunc symbolInFile(fullName ir.FullName, file *file) bool {\n\tfor _, typ := range seq.All(file.ir.AllTypes()) {\n\t\tif typ.FullName() == fullName {\n\t\t\treturn true\n\t\t}\n\t}\n\tfor typ := range file.ir.AllMembers() {\n\t\tif typ.FullName() == fullName {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// captureImportSpan expands the import span declaration to include both\n// leading and trailing comments and any trailing whitespace to the next\n// declaration.\nfunc captureImportSpan(decl ast.DeclImport) source.Span {\n\tspan := decl.Span()\n\tif decl.IsZero() {\n\t\treturn span\n\t}\n\tstream := decl.Context().Stream()\n\n\t// Capture up until the newline expanding upwards for all comments directly\n\t// above this declaration.\n\ttok, prev := stream.Around(decl.Span().Start)\n\tcursor := token.NewCursorAt(tok)\n\tfor isTokenSpace(tok) {\n\t\ttok, prev = cursor.PrevSkippable(), tok\n\t}\n\tspan.Start = tok.Span().Start\n\tfor isTokenNewline(tok) {\n\t\tspan.Start = prev.Span().Start // Capture the previous, up until this newline.\n\t\ttok, prev = cursor.PrevSkippable(), tok\n\t\tif tok.Kind() != token.Comment {\n\t\t\tbreak\n\t\t}\n\t\t// Consume all comments and space tokens\n\t\tfor tok.Kind() == token.Comment || isTokenSpace(tok) {\n\t\t\ttok, prev = cursor.PrevSkippable(), tok\n\t\t}\n\t}\n\n\t// Extract trailing comment (same line after semicolon)\n\ttok, _ = stream.Around(decl.Span().End)\n\tcursor = token.NewCursorAt(tok)\n\ttok = cursor.NextSkippable()\n\tfor isTokenSpace(tok) || tok.Kind() == token.Keyword && tok.Keyword() == keyword.Semi {\n\t\ttok = cursor.NextSkippable()\n\t}\n\tfor isTokenSpace(tok) || tok.Kind() == token.Comment {\n\t\ttok = cursor.NextSkippable()\n\t}\n\tif tok.Kind() != token.Space {\n\t\treturn span // unknown\n\t}\n\tfor next := cursor.NextSkippable(); next.Kind() == token.Space; {\n\t\ttok = next // Capture anywhitespace\n\t\tnext = cursor.NextSkippable()\n\t}\n\tspan.End = tok.Span().End\n\treturn span\n}\n"
  },
  {
    "path": "private/buf/buflsp/organize_imports_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestCodeAction_OrganizeImports(t *testing.T) {\n\tt.Parallel()\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/import_test.proto\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Delete #1: Remove unused import (file line 5)\n\t\t\t// Deletes: `import \"google/protobuf/cpp_features.proto\"; // unused import\\n`\n\t\t\t// This import is marked as unused by IR diagnostics and should be removed\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Delete #2: Remove existing import that will be re-added in sorted order (file lines 6-7)\n\t\t\t// Deletes: `import \"types/existing_field.proto\";\\n\\n`\n\t\t\t// This import is kept but will be re-inserted in alphabetically sorted position\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 7, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Insert organized imports after package declaration (file line 4, after line 3)\n\t\t\t// Adds 7 new imports (empty, timestamp, custom_option, method_input, method_output, nested, toplevel)\n\t\t\t// Plus re-adds existing_field in sorted position\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 3, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 3, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: `\nimport \"google/protobuf/empty.proto\";\nimport \"google/protobuf/timestamp.proto\";\nimport \"options/custom_option.proto\";\nimport \"types/existing_field.proto\";\nimport \"types/method_input.proto\";\nimport \"types/method_output.proto\";\nimport \"types/nested_field.proto\";\nimport \"types/toplevel_field.proto\";\n`,\n\t\t\t},\n\t\t},\n\t)\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/comments_test.proto\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Delete #1: Remove first import with comments (file lines 5-6)\n\t\t\t// Deletes: `// A comment about this\\nimport \"types/existing_field.proto\"; // trailing comment\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 6, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Delete #2: Remove second import with multi-line comment (file lines 7-11)\n\t\t\t// Deletes: `/* MultiComment\\n * \\n */\\nimport \"google/protobuf/timestamp.proto\";\\n\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 6, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 11, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Delete #3: Remove third import not at the top of the file (file lines 19-20)\n\t\t\t// Deletes: `// Import is not at top of file\\nimport \"types/notattop_import.proto\"; // another trailing comment`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 18, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 20, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Insert organized imports with all comments preserved in sorted order\n\t\t\t// Adds: notattop_import (moved from line 21), toplevel_field (new)\n\t\t\t// Re-adds: timestamp, existing_field with their comments attached\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 3, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 3, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: `\n/* MultiComment\n * \n */\nimport \"google/protobuf/timestamp.proto\";\n// A comment about this\nimport \"types/existing_field.proto\"; // trailing comment\n// Import is not at top of file\nimport \"types/notattop_import.proto\"; // another trailing comment\nimport \"types/toplevel_field.proto\";\n`,\n\t\t\t},\n\t\t},\n\t)\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/modifier_test.proto\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Deletes: `import weak \"google/protobuf/cpp_features.proto\"; // unused import\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Deletes: `// Comment on weak import\\nimport weak \"types/modifier_weak.proto\";\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 7, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Deletes: `// Comment on public import\\nimport public \"types/modifier_public.proto\";`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 7, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 9, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Deletes: `import \"types/existing_field.proto\";\\n\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 9, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 11, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Insert organized imports in sorted order\n\t\t\t// Re-adds: existing_field, modifer_public (from line 9, note typo in filename),\n\t\t\t//          modifier_weak with comment and weak modifier\n\t\t\t// Adds: toplevel_field (new)\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 3, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 3, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: `\nimport \"types/existing_field.proto\";\n// Comment on public import\nimport public \"types/modifier_public.proto\";\n// Comment on weak import\nimport weak \"types/modifier_weak.proto\";\nimport \"types/toplevel_field.proto\";\n`,\n\t\t\t},\n\t\t},\n\t)\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/noimports_test.proto\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert imports when file has no existing imports\n\t\t\t// File currently has no imports, so nothing to delete\n\t\t\t// Inserts after package declaration (line 3)\n\t\t\t// Adds: existing_field (for ExistingField type), toplevel_field (for TopLevelField type)\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 3, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 3, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: `\nimport \"types/existing_field.proto\";\nimport \"types/toplevel_field.proto\";\n`,\n\t\t\t},\n\t\t},\n\t)\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/nopackage_test.proto\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Insert imports when file has no package declaration\n\t\t\t// File has no package, so imports are inserted after syntax (line 1)\n\t\t\t// This tests the fallback behavior when package declaration is missing\n\t\t\t// Adds: existing_field (for ExistingField type), toplevel_field (for TopLevelField type)\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 1, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 1, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: `\nimport \"types/existing_field.proto\";\nimport \"types/toplevel_field.proto\";\n`,\n\t\t\t},\n\t\t},\n\t)\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/nochanges_test.proto\",\n\t\tnil, // No changes are expected.\n\t)\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/unknown_test.proto\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Delete unknown import (file lines 3-4)\n\t\t\t// Deletes: `import \"types/unknown.proto\";\\n\\n`\n\t\t\t// File doesn't exist, not resolved by IR, so it's removed\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 2, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 4, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t},\n\t)\n\n\ttestCodeActionOrganizeImports(\n\t\tt,\n\t\t\"testdata/organize_imports/duplicate_test.proto\",\n\t\t[]protocol.TextEdit{\n\t\t\t// Delete duplicate #1 (file line 5)\n\t\t\t// Deletes: `import \"types/existing_field.proto\";\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 4, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 5, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Delete duplicate #2 (file lines 6-7)\n\t\t\t// Deletes: `// A duplicate comment\\nimport \"types/existing_field.proto\";\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 5, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 7, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Delete duplicate #3 (file line 8)\n\t\t\t// Deletes: `import \"types/existing_field.proto\"; // this also has a trailing comment\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 7, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 8, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Delete duplicate #4 (file line 9)\n\t\t\t// Deletes: `import \"types/existing_field.proto\";\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 8, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 9, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Delete duplicate #5 (file lines 10-12)\n\t\t\t// Deletes: `// A duplicate comment\\nimport \"types/existing_field.proto\";\\n\\n`\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 9, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 12, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: \"\",\n\t\t\t},\n\t\t\t// Insert deduplicated imports (keeps unique versions by text content)\n\t\t\t// After deduplication: plain import, import with trailing comment, import with leading comment\n\t\t\t{\n\t\t\t\tRange: protocol.Range{\n\t\t\t\t\tStart: protocol.Position{Line: 3, Character: 0},\n\t\t\t\t\tEnd:   protocol.Position{Line: 3, Character: 0},\n\t\t\t\t},\n\t\t\t\tNewText: `\nimport \"types/existing_field.proto\"; // this also has a trailing comment\n// A duplicate comment\nimport \"types/existing_field.proto\";\nimport \"types/existing_field.proto\";\n`,\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunc testCodeActionOrganizeImports(t *testing.T, filename string, expectedEdits []protocol.TextEdit) {\n\tt.Run(filename, func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestProtoPath, err := filepath.Abs(filename)\n\t\trequire.NoError(t, err)\n\n\t\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\n\t\t// Request code actions for the file\n\t\t// The specific position doesn't matter since we're checking for file-level actions\n\t\tvar codeActions []protocol.CodeAction\n\t\t_, err = clientJSONConn.Call(t.Context(), protocol.MethodTextDocumentCodeAction, protocol.CodeActionParams{\n\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\tURI: testURI,\n\t\t\t},\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: protocol.Position{Line: 8, Character: 2},\n\t\t\t\tEnd:   protocol.Position{Line: 8, Character: 2},\n\t\t\t},\n\t\t\tContext: protocol.CodeActionContext{\n\t\t\t\tOnly: []protocol.CodeActionKind{\n\t\t\t\t\tprotocol.SourceOrganizeImports,\n\t\t\t\t},\n\t\t\t},\n\t\t}, &codeActions)\n\t\trequire.NoError(t, err)\n\n\t\t// Find the \"Organize imports\" code action\n\t\tvar organizeImportsAction *protocol.CodeAction\n\t\tfor _, codeAction := range codeActions {\n\t\t\tif codeAction.Title == \"Organize imports\" {\n\t\t\t\torganizeImportsAction = &codeAction\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif expectedEdits == nil {\n\t\t\trequire.Nil(t, organizeImportsAction, \"expected no changes to 'Organize imports' code action\")\n\t\t\treturn\n\t\t}\n\t\trequire.NotNil(t, organizeImportsAction, \"expected to find 'Organize imports' code action, got actions: %v\", codeActions)\n\n\t\t// Verify the code action properties\n\t\tassert.Equal(t, protocol.SourceOrganizeImports, organizeImportsAction.Kind, \"code action should be SourceOrganizeImports\")\n\t\tassert.NotNil(t, organizeImportsAction.Edit, \"code action should have a workspace edit\")\n\n\t\t// Verify the edit replaces the imports section\n\t\trequire.NotNil(t, organizeImportsAction.Edit.Changes, \"workspace edit should have changes\")\n\t\tactualEdits, ok := organizeImportsAction.Edit.Changes[testURI]\n\t\trequire.True(t, ok, \"workspace edit should have changes for the current file\")\n\t\trequire.NotEmpty(t, actualEdits, \"should have text edits\")\n\n\t\t// Validate that actual edits match expected edits\n\t\trequire.Len(t, actualEdits, len(expectedEdits), \"should have %d edits\", len(expectedEdits))\n\n\t\t// Compare each edit\n\t\tfor i, expected := range expectedEdits {\n\t\t\tactual := actualEdits[i]\n\t\t\tassert.Equal(t, expected.Range, actual.Range, \"edit %d: range mismatch\", i)\n\t\t\tassert.Equal(t, expected.NewText, actual.NewText, \"edit %d: newText mismatch\", i)\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "private/buf/buflsp/references_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"slices\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestReferences(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/references/references.proto\")\n\trequire.NoError(t, err)\n\n\ttypesProtoPath, err := filepath.Abs(\"testdata/references/types.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\ttypesURI := buflsp.FilePathToURI(typesProtoPath)\n\n\ttype refLocation struct {\n\t\turi  protocol.URI\n\t\tline uint32\n\t}\n\ttests := []struct {\n\t\tname               string\n\t\ttargetURI          protocol.URI\n\t\tline               uint32\n\t\tcharacter          uint32\n\t\tincludeDeclaration bool\n\t\texpectedReferences []refLocation\n\t}{\n\t\t{\n\t\t\tname:               \"references_to_item_message\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               6,\n\t\t\tcharacter:          8,\n\t\t\tincludeDeclaration: true,\n\t\t\texpectedReferences: []refLocation{\n\t\t\t\t{uri: testURI, line: 6},  // message Item\n\t\t\t\t{uri: testURI, line: 10}, // repeated Item related\n\t\t\t\t{uri: testURI, line: 15}, // repeated Item items in Container\n\t\t\t\t{uri: testURI, line: 17}, // map<string, Item> items_by_id in Container\n\t\t\t\t{uri: testURI, line: 30}, // Item item in GetItemResponse\n\t\t\t\t{uri: testURI, line: 38}, // repeated Item items in ListItemsResponse\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"references_to_item_message_no_declaration\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               6,\n\t\t\tcharacter:          8,\n\t\t\tincludeDeclaration: false,\n\t\t\texpectedReferences: []refLocation{\n\t\t\t\t{uri: testURI, line: 10}, // repeated Item related\n\t\t\t\t{uri: testURI, line: 15}, // repeated Item items in Container\n\t\t\t\t{uri: testURI, line: 17}, // map<string, Item> items_by_id in Container\n\t\t\t\t{uri: testURI, line: 30}, // Item item in GetItemResponse\n\t\t\t\t{uri: testURI, line: 38}, // repeated Item items in ListItemsResponse\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"references_to_color_enum_imported\",\n\t\t\ttargetURI:          typesURI,\n\t\t\tline:               4,\n\t\t\tcharacter:          5,\n\t\t\tincludeDeclaration: true,\n\t\t\texpectedReferences: []refLocation{\n\t\t\t\t{uri: typesURI, line: 4}, // enum Color\n\t\t\t\t{uri: testURI, line: 8},  // Color color in Item\n\t\t\t\t{uri: testURI, line: 16}, // Color default_color in Container\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"references_to_container_message\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               13,\n\t\t\tcharacter:          8,\n\t\t\tincludeDeclaration: true,\n\t\t\texpectedReferences: []refLocation{\n\t\t\t\t{uri: testURI, line: 13}, // message Container\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"references_to_label_imported_type\",\n\t\t\ttargetURI:          typesURI,\n\t\t\tline:               10,\n\t\t\tcharacter:          8,\n\t\t\tincludeDeclaration: true,\n\t\t\texpectedReferences: []refLocation{\n\t\t\t\t{uri: typesURI, line: 10}, // message Label\n\t\t\t\t{uri: testURI, line: 9},   // Label label in Item\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"references_to_get_item_request\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               25,\n\t\t\tcharacter:          8,\n\t\t\tincludeDeclaration: true,\n\t\t\texpectedReferences: []refLocation{\n\t\t\t\t{uri: testURI, line: 25}, // message GetItemRequest\n\t\t\t\t{uri: testURI, line: 21}, // rpc GetItem(GetItemRequest)\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:               \"references_to_service\",\n\t\t\ttargetURI:          testURI,\n\t\t\tline:               20,\n\t\t\tcharacter:          8,\n\t\t\tincludeDeclaration: true,\n\t\t\texpectedReferences: []refLocation{\n\t\t\t\t{uri: testURI, line: 20}, // service ItemService\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tvar locations []protocol.Location\n\t\t\t_, refErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentReferences, protocol.ReferenceParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: tt.targetURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tContext: protocol.ReferenceContext{\n\t\t\t\t\tIncludeDeclaration: tt.includeDeclaration,\n\t\t\t\t},\n\t\t\t}, &locations)\n\t\t\trequire.NoError(t, refErr)\n\n\t\t\trequire.Len(t, locations, len(tt.expectedReferences))\n\n\t\t\tfor _, expectedRef := range tt.expectedReferences {\n\t\t\t\tidx := slices.IndexFunc(locations, func(loc protocol.Location) bool {\n\t\t\t\t\treturn loc.URI == expectedRef.uri && loc.Range.Start.Line == expectedRef.line\n\t\t\t\t})\n\t\t\t\tassert.NotEqual(t, -1, idx, \"expected reference at %s:%d not found\", expectedRef.uri, expectedRef.line)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/rename_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestRename(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\ttestProtoPath, err := filepath.Abs(\"testdata/rename/rename.proto\")\n\trequire.NoError(t, err)\n\ttypesProtoPath, err := filepath.Abs(\"testdata/rename/types.proto\")\n\trequire.NoError(t, err)\n\textensionsProtoPath, err := filepath.Abs(\"testdata/rename/extensions.proto\")\n\trequire.NoError(t, err)\n\tsubpkgOptionsProtoPath, err := filepath.Abs(\"testdata/rename/subpkg/options.proto\")\n\trequire.NoError(t, err)\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\ttypesURI := buflsp.FilePathToURI(typesProtoPath)\n\textensionsURI := buflsp.FilePathToURI(extensionsProtoPath)\n\tsubpkgOptionsURI := buflsp.FilePathToURI(subpkgOptionsProtoPath)\n\n\ttype editLocation struct {\n\t\turi            protocol.URI\n\t\tline           uint32\n\t\tstartCharacter uint32\n\t\tendCharacter   uint32\n\t\tnewText        string // Optional: if set, verify the NewText matches\n\t}\n\ttests := []struct {\n\t\tname          string\n\t\ttargetURI     protocol.URI\n\t\tline          uint32\n\t\tcharacter     uint32\n\t\tnewName       string\n\t\texpectError   bool\n\t\texpectedEdits []editLocation\n\t}{\n\t\t{\n\t\t\tname:      \"rename_product_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      8,\n\t\t\tcharacter: 8,\n\t\t\tnewName:   \"Item\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 8, startCharacter: 8, endCharacter: 15},\n\t\t\t\t{uri: testURI, line: 12, startCharacter: 11, endCharacter: 18},\n\t\t\t\t{uri: testURI, line: 17, startCharacter: 11, endCharacter: 18},\n\t\t\t\t{uri: testURI, line: 31, startCharacter: 2, endCharacter: 9},\n\t\t\t\t{uri: testURI, line: 39, startCharacter: 11, endCharacter: 18},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_category_enum_imported\",\n\t\t\ttargetURI: typesURI,\n\t\t\tline:      4,\n\t\t\tcharacter: 5,\n\t\t\tnewName:   \"Type\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: typesURI, line: 4, startCharacter: 5, endCharacter: 13},\n\t\t\t\t{uri: testURI, line: 11, startCharacter: 2, endCharacter: 10},\n\t\t\t\t{uri: testURI, line: 18, startCharacter: 2, endCharacter: 10},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_category_electronics_enum_value\",\n\t\t\ttargetURI: typesURI,\n\t\t\tline:      6,\n\t\t\tcharacter: 2,\n\t\t\tnewName:   \"TYPE_GADGETS\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: typesURI, line: 6, startCharacter: 2, endCharacter: 22},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_name_field\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      10,\n\t\t\tcharacter: 9,\n\t\t\tnewName:   \"title\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 10, startCharacter: 9, endCharacter: 13},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_service\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      21,\n\t\t\tcharacter: 8,\n\t\t\tnewName:   \"ItemService\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 21, startCharacter: 8, endCharacter: 22},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_rpc_method\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      22,\n\t\t\tcharacter: 6,\n\t\t\tnewName:   \"FetchProduct\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 22, startCharacter: 6, endCharacter: 16},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_request_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      26,\n\t\t\tcharacter: 8,\n\t\t\tnewName:   \"FetchProductRequest\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 26, startCharacter: 8, endCharacter: 25},\n\t\t\t\t{uri: testURI, line: 22, startCharacter: 17, endCharacter: 34},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_metadata_imported_message\",\n\t\t\ttargetURI: typesURI,\n\t\t\tline:      10,\n\t\t\tcharacter: 8,\n\t\t\tnewName:   \"Tag\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: typesURI, line: 10, startCharacter: 8, endCharacter: 16},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_nested_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      42,\n\t\t\tcharacter: 10,\n\t\t\tnewName:   \"OrderItem\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 42, startCharacter: 10, endCharacter: 14},\n\t\t\t\t{uri: testURI, line: 46, startCharacter: 11, endCharacter: 15},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_nested_enum\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      47,\n\t\t\tcharacter: 7,\n\t\t\tnewName:   \"State\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 47, startCharacter: 7, endCharacter: 13},\n\t\t\t\t{uri: testURI, line: 52, startCharacter: 2, endCharacter: 8},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_nested_enum_value\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      49,\n\t\t\tcharacter: 4,\n\t\t\tnewName:   \"STATE_PENDING\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 49, startCharacter: 4, endCharacter: 18},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_oneof_field\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      54,\n\t\t\tcharacter: 11,\n\t\t\tnewName:   \"card_number\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 54, startCharacter: 11, endCharacter: 22},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_deeply_nested_message\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      59,\n\t\t\tcharacter: 10,\n\t\t\tnewName:   \"InnerData\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 59, startCharacter: 10, endCharacter: 15},\n\t\t\t\t{uri: testURI, line: 63, startCharacter: 4, endCharacter: 9},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_nested_message_used_in_sibling\",\n\t\t\ttargetURI: testURI,\n\t\t\tline:      62,\n\t\t\tcharacter: 10,\n\t\t\tnewName:   \"Wrapper\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: testURI, line: 62, startCharacter: 10, endCharacter: 19},\n\t\t\t\t{uri: testURI, line: 65, startCharacter: 2, endCharacter: 11},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:        \"rename_to_existing_message\",\n\t\t\ttargetURI:   testURI,\n\t\t\tline:        8,\n\t\t\tcharacter:   8,\n\t\t\tnewName:     \"Catalog\",\n\t\t\texpectError: true,\n\t\t},\n\t\t{\n\t\t\tname:        \"rename_to_existing_service\",\n\t\t\ttargetURI:   testURI,\n\t\t\tline:        15,\n\t\t\tcharacter:   10,\n\t\t\tnewName:     \"ProductService\",\n\t\t\texpectError: true,\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_custom_extension\",\n\t\t\ttargetURI: extensionsURI,\n\t\t\tline:      7,\n\t\t\tcharacter: 10,\n\t\t\tnewName:   \"validated\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: extensionsURI, line: 7, startCharacter: 10, endCharacter: 17, newText: \"validated\"},\n\t\t\t\t{uri: testURI, line: 69, startCharacter: 9, endCharacter: 18, newText: \"(validated)\"},\n\t\t\t\t{uri: testURI, line: 74, startCharacter: 9, endCharacter: 18, newText: \"(validated)\"},\n\t\t\t\t{uri: testURI, line: 75, startCharacter: 9, endCharacter: 18, newText: \"(validated)\"},\n\t\t\t\t{uri: testURI, line: 75, startCharacter: 9, endCharacter: 18, newText: \"(validated)\"}, // appears twice on this line: (testing).test and (testing).nested.value\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_extension_field\",\n\t\t\ttargetURI: extensionsURI,\n\t\t\tline:      11,\n\t\t\tcharacter: 7,\n\t\t\tnewName:   \"blah\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: extensionsURI, line: 11, startCharacter: 7, endCharacter: 11},\n\t\t\t\t{uri: testURI, line: 69, startCharacter: 19, endCharacter: 23},\n\t\t\t\t{uri: testURI, line: 74, startCharacter: 19, endCharacter: 23},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_nested_extension_field\",\n\t\t\ttargetURI: extensionsURI,\n\t\t\tline:      15,\n\t\t\tcharacter: 9,\n\t\t\tnewName:   \"val\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: extensionsURI, line: 15, startCharacter: 9, endCharacter: 14},\n\t\t\t\t{uri: testURI, line: 75, startCharacter: 26, endCharacter: 31},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_subpackage_extension\",\n\t\t\ttargetURI: subpkgOptionsURI,\n\t\t\tline:      7,\n\t\t\tcharacter: 10,\n\t\t\tnewName:   \"validated\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: subpkgOptionsURI, line: 7, startCharacter: 10, endCharacter: 17, newText: \"validated\"},\n\t\t\t\t{uri: testURI, line: 80, startCharacter: 9, endCharacter: 25, newText: \"(subpkg.validated)\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_subpackage_extension_field\",\n\t\t\ttargetURI: subpkgOptionsURI,\n\t\t\tline:      11,\n\t\t\tcharacter: 7,\n\t\t\tnewName:   \"blah\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: subpkgOptionsURI, line: 11, startCharacter: 7, endCharacter: 11},\n\t\t\t\t{uri: testURI, line: 80, startCharacter: 26, endCharacter: 30},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:      \"rename_extension_message_type\",\n\t\t\ttargetURI: extensionsURI,\n\t\t\tline:      10,\n\t\t\tcharacter: 8,\n\t\t\tnewName:   \"Test\",\n\t\t\texpectedEdits: []editLocation{\n\t\t\t\t{uri: extensionsURI, line: 10, startCharacter: 8, endCharacter: 15},\n\t\t\t\t{uri: extensionsURI, line: 7, startCharacter: 2, endCharacter: 9},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvar workspaceEdit protocol.WorkspaceEdit\n\t\t\t_, renameErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentRename, protocol.RenameParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: tt.targetURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tNewName: tt.newName,\n\t\t\t}, &workspaceEdit)\n\t\t\tif tt.expectError {\n\t\t\t\trequire.Error(t, renameErr)\n\t\t\t} else {\n\t\t\t\trequire.NoError(t, renameErr)\n\t\t\t\trequire.NotNil(t, workspaceEdit.Changes)\n\t\t\t\tvar allEdits []editLocation\n\t\t\t\tfor uri, edits := range workspaceEdit.Changes {\n\t\t\t\t\tfor _, edit := range edits {\n\t\t\t\t\t\tallEdits = append(allEdits, editLocation{\n\t\t\t\t\t\t\turi:            uri,\n\t\t\t\t\t\t\tline:           edit.Range.Start.Line,\n\t\t\t\t\t\t\tstartCharacter: edit.Range.Start.Character,\n\t\t\t\t\t\t\tendCharacter:   edit.Range.End.Character,\n\t\t\t\t\t\t\tnewText:        edit.NewText,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif len(allEdits) != len(tt.expectedEdits) {\n\t\t\t\t\tt.Logf(\"Expected %d edits, got %d\", len(tt.expectedEdits), len(allEdits))\n\t\t\t\t\tfor _, e := range allEdits {\n\t\t\t\t\t\tt.Logf(\"  actual: %s:%d:%d-%d (newText: %q)\", e.uri, e.line, e.startCharacter, e.endCharacter, e.newText)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trequire.Len(t, allEdits, len(tt.expectedEdits))\n\t\t\t\tfor _, expectedEdit := range tt.expectedEdits {\n\t\t\t\t\tidx := slices.IndexFunc(allEdits, func(e editLocation) bool {\n\t\t\t\t\t\treturn e.uri == expectedEdit.uri && e.line == expectedEdit.line && e.startCharacter == expectedEdit.startCharacter\n\t\t\t\t\t})\n\t\t\t\t\trequire.NotEqual(t, -1, idx, \"expected edit at %s:%d:%d not found\", expectedEdit.uri, expectedEdit.line, expectedEdit.startCharacter)\n\t\t\t\t\tassert.Equal(t, expectedEdit.startCharacter, allEdits[idx].startCharacter)\n\t\t\t\t\tassert.Equal(t, expectedEdit.endCharacter, allEdits[idx].endCharacter)\n\t\t\t\t\tif expectedEdit.newText != \"\" {\n\t\t\t\t\t\tassert.Equal(t, expectedEdit.newText, allEdits[idx].newText, \"NewText mismatch at %s:%d:%d\", expectedEdit.uri, expectedEdit.line, expectedEdit.startCharacter)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestPrepareRename(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\ttestProtoPath, err := filepath.Abs(\"testdata/rename/rename.proto\")\n\trequire.NoError(t, err)\n\twktProtoPath, err := filepath.Abs(\"testdata/rename/wkt.proto\")\n\trequire.NoError(t, err)\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\twktURI := buflsp.FilePathToURI(wktProtoPath)\n\n\ttests := []struct {\n\t\tname          string\n\t\tprotoFile     string\n\t\tline          uint32\n\t\tcharacter     uint32\n\t\texpectRange   bool\n\t\texpectError   bool\n\t\texpectedStart protocol.Position\n\t\texpectedEnd   protocol.Position\n\t}{\n\t\t{\n\t\t\tname:        \"prepare_rename_product_message\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        8,\n\t\t\tcharacter:   8,\n\t\t\texpectRange: true,\n\t\t\texpectedStart: protocol.Position{\n\t\t\t\tLine:      8,\n\t\t\t\tCharacter: 8,\n\t\t\t},\n\t\t\texpectedEnd: protocol.Position{\n\t\t\t\tLine:      8,\n\t\t\t\tCharacter: 15,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_field\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        10,\n\t\t\tcharacter:   9,\n\t\t\texpectRange: true,\n\t\t\texpectedStart: protocol.Position{\n\t\t\t\tLine:      10,\n\t\t\t\tCharacter: 9,\n\t\t\t},\n\t\t\texpectedEnd: protocol.Position{\n\t\t\t\tLine:      10,\n\t\t\t\tCharacter: 13,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_keyword\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        8,\n\t\t\tcharacter:   0,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_primitive_type\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        9,\n\t\t\tcharacter:   2,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_field_number\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        9,\n\t\t\tcharacter:   14,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_whitespace\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        9,\n\t\t\tcharacter:   0,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_extension_usage\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        69,\n\t\t\tcharacter:   11,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_extension_field_usage\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        69,\n\t\t\tcharacter:   20,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_qualified_extension_usage\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        80,\n\t\t\tcharacter:   18,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_qualified_extension_field_usage\",\n\t\t\tprotoFile:   \"testdata/rename/rename.proto\",\n\t\t\tline:        80,\n\t\t\tcharacter:   27,\n\t\t\texpectRange: false,\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_wkt_timestamp_type\",\n\t\t\tprotoFile:   \"testdata/rename/wkt.proto\",\n\t\t\tline:        7,     // Line with \"google.protobuf.Timestamp created_at = 1;\"\n\t\t\tcharacter:   23,    // On \"Timestamp\"\n\t\t\texpectRange: false, // Should not allow rename of WKT\n\t\t\texpectError: true,  // Should return error for non-local file\n\t\t},\n\t\t{\n\t\t\tname:        \"prepare_rename_on_wkt_package\",\n\t\t\tprotoFile:   \"testdata/rename/wkt.proto\",\n\t\t\tline:        7,     // Line with \"google.protobuf.Timestamp created_at = 1;\"\n\t\t\tcharacter:   2,     // On \"google\"\n\t\t\texpectRange: false, // Should not allow rename of WKT package\n\t\t\texpectError: true,  // Should return error for non-local file\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\t// Determine which URI to use based on protoFile\n\t\t\tvar targetURI protocol.URI\n\t\t\tswitch tt.protoFile {\n\t\t\tcase \"testdata/rename/rename.proto\":\n\t\t\t\ttargetURI = testURI\n\t\t\tcase \"testdata/rename/wkt.proto\":\n\t\t\t\ttargetURI = wktURI\n\t\t\t\t// Open the wkt.proto file so symbols get resolved to their definitions in WKT files.\n\t\t\t\t// Without this, symbol.def won't point to the non-local WKT file and IsLocal() won't work.\n\t\t\t\twktProtoContent, err := os.ReadFile(wktProtoPath)\n\t\t\t\trequire.NoError(t, err)\n\t\t\t\terr = clientJSONConn.Notify(ctx, protocol.MethodTextDocumentDidOpen, &protocol.DidOpenTextDocumentParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentItem{\n\t\t\t\t\t\tURI:        wktURI,\n\t\t\t\t\t\tLanguageID: \"protobuf\",\n\t\t\t\t\t\tVersion:    1,\n\t\t\t\t\t\tText:       string(wktProtoContent),\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t\trequire.NoError(t, err)\n\t\t\tdefault:\n\t\t\t\trequire.Fail(t, \"unknown protoFile\", tt.protoFile)\n\t\t\t}\n\n\t\t\tvar rnge *protocol.Range\n\t\t\t_, prepareErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentPrepareRename, protocol.PrepareRenameParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: targetURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &rnge)\n\t\t\tif tt.expectError {\n\t\t\t\trequire.Error(t, prepareErr, \"expected error for non-local file\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\trequire.NoError(t, prepareErr)\n\t\t\tif tt.expectRange {\n\t\t\t\trequire.NotNil(t, rnge)\n\t\t\t\tassert.Equal(t, tt.expectedStart, rnge.Start)\n\t\t\t\tassert.Equal(t, tt.expectedEnd, rnge.End)\n\t\t\t} else {\n\t\t\t\trequire.Nil(t, rnge)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/semantic_tokens.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"slices\"\n\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/experimental/token\"\n\t\"github.com/bufbuild/protocompile/experimental/token/keyword\"\n\t\"github.com/google/cel-go/cel\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// The subset of SemanticTokenTypes that we support.\n// Must match the order of [semanticTypeLegend].\n// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_semanticTokens\nconst (\n\tsemanticTypeProperty = iota\n\tsemanticTypeStruct\n\tsemanticTypeVariable\n\tsemanticTypeEnum\n\tsemanticTypeEnumMember\n\tsemanticTypeInterface\n\tsemanticTypeMethod\n\tsemanticTypeFunction\n\tsemanticTypeDecorator\n\tsemanticTypeMacro\n\tsemanticTypeNamespace\n\tsemanticTypeKeyword\n\tsemanticTypeModifier\n\tsemanticTypeComment\n\tsemanticTypeString\n\tsemanticTypeNumber\n\tsemanticTypeType\n\tsemanticTypeOperator\n)\n\n// The subset of SemanticTokenModifiers that we support.\n// Must match the order of [semanticModifierLegend].\n// Semantic modifiers are encoded as a bitset, hence the shifted iota.\n// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_semanticTokens\nconst (\n\tsemanticModifierDeprecated = 1 << iota\n\tsemanticModifierDefaultLibrary\n)\n\nvar (\n\t// These slices must match the order of the indices in the above const blocks.\n\t// We use protocol constants where available.\n\tsemanticTypeLegend = []string{\n\t\tstring(protocol.SemanticTokenProperty),\n\t\tstring(protocol.SemanticTokenStruct),\n\t\tstring(protocol.SemanticTokenVariable),\n\t\tstring(protocol.SemanticTokenEnum),\n\t\tstring(protocol.SemanticTokenEnumMember),\n\t\tstring(protocol.SemanticTokenInterface),\n\t\tstring(protocol.SemanticTokenMethod),\n\t\tstring(protocol.SemanticTokenFunction),\n\t\t\"decorator\", // Added in LSP 3.17.0; not in our protocol library yet.\n\t\tstring(protocol.SemanticTokenMacro),\n\t\tstring(protocol.SemanticTokenNamespace),\n\t\tstring(protocol.SemanticTokenKeyword),\n\t\tstring(protocol.SemanticTokenModifier),\n\t\tstring(protocol.SemanticTokenComment),\n\t\tstring(protocol.SemanticTokenString),\n\t\tstring(protocol.SemanticTokenNumber),\n\t\tstring(protocol.SemanticTokenType),\n\t\tstring(protocol.SemanticTokenOperator),\n\t}\n\tsemanticModifierLegend = []string{\n\t\tstring(protocol.SemanticTokenModifierDeprecated),\n\t\tstring(protocol.SemanticTokenModifierDefaultLibrary),\n\t}\n)\n\nfunc semanticTokensFull(file *file, celEnv *cel.Env) (*protocol.SemanticTokens, error) {\n\tif file == nil {\n\t\treturn nil, nil\n\t}\n\t// In the case where there are no symbols for the file, we return nil for SemanticTokensFull.\n\t// This is based on the specification for the method textDocument/semanticTokens/full,\n\t// the expected response is the union type `SemanticTokens | null`.\n\t// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens\n\tif len(file.symbols) == 0 {\n\t\treturn nil, nil\n\t}\n\t// Semantic tokens are encoded using a delta encoding scheme described here:\n\t// https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens\n\t//\n\t// We use a three-phase approach:\n\t// 1. Collect all tokens (can be in any order)\n\t// 2. Sort tokens by position (line, then column)\n\t// 3. Delta-encode the sorted tokens\n\t// tokenInfo holds information about a single semantic token before encoding.\n\ttype tokenInfo struct {\n\t\tspan    source.Span\n\t\tsemType uint32\n\t\tsemMod  uint32\n\t\tkeyword keyword.Keyword\n\t}\n\tvar tokens []tokenInfo\n\t// collectToken adds a token to the collection.\n\tcollectToken := func(span source.Span, semanticType, semanticModifier uint32, kw keyword.Keyword) {\n\t\tif span.IsZero() {\n\t\t\treturn\n\t\t}\n\t\ttokens = append(tokens, tokenInfo{\n\t\t\tspan:    span,\n\t\t\tsemType: semanticType,\n\t\t\tsemMod:  semanticModifier,\n\t\t\tkeyword: kw,\n\t\t})\n\t}\n\t// Phase 1: Collect all tokens\n\tastFile := file.ir.AST()\n\tif astFile == nil {\n\t\treturn nil, nil\n\t}\n\t// Collect all comments and certain keywords that can't be fetched in the IR from token stream\n\tfor tok := range astFile.Stream().All() {\n\t\tif tok.Kind() == token.Comment {\n\t\t\tcollectToken(tok.Span(), semanticTypeComment, 0, keyword.Unknown)\n\t\t}\n\t\tkw := tok.Keyword()\n\t\tswitch kw {\n\t\t// These keywords seemingly are not easy to reach via the IR.\n\t\tcase keyword.Option, keyword.Reserved, keyword.To, keyword.Returns, keyword.Extend, keyword.Extensions:\n\t\t\tcollectToken(tok.Span(), semanticTypeKeyword, 0, kw)\n\t\t}\n\t}\n\t// Collect syntax/edition declaration\n\tsyntax := astFile.Syntax()\n\tif kwTok := syntax.KeywordToken(); !kwTok.IsZero() {\n\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t}\n\tif value := syntax.Value(); !value.Span().IsZero() {\n\t\tcollectToken(value.Span(), semanticTypeString, 0, keyword.Unknown)\n\t}\n\t// Collect package declaration\n\tpkg := astFile.Package()\n\tif kwTok := pkg.KeywordToken(); !kwTok.IsZero() {\n\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t}\n\tif path := pkg.Path(); !path.Span().IsZero() {\n\t\tcollectToken(path.Span(), semanticTypeNamespace, 0, keyword.Unknown)\n\t}\n\t// Collect import declarations\n\tfor imp := range seq.Values(file.ir.Imports()) {\n\t\tif imp.Decl.Span().IsZero() {\n\t\t\tcontinue\n\t\t}\n\t\t// Collect import keyword\n\t\tif kwTok := imp.Decl.KeywordToken(); !kwTok.IsZero() {\n\t\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t\t}\n\t\t// Collect modifier keywords (weak, public)\n\t\tmodifierTokens := imp.Decl.ModifierTokens()\n\t\tfor modToken := range seq.Values(modifierTokens) {\n\t\t\tif !modToken.IsZero() {\n\t\t\t\tcollectToken(modToken.Span(), semanticTypeModifier, 0, keyword.Unknown)\n\t\t\t}\n\t\t}\n\t\t// Collect import path string\n\t\tif importPath := imp.Decl.ImportPath(); !importPath.Span().IsZero() {\n\t\t\tcollectToken(importPath.Span(), semanticTypeString, 0, keyword.Unknown)\n\t\t}\n\t}\n\t// Collect symbol tokens (identifiers, keywords for declarations)\n\tfor _, symbol := range file.symbols {\n\t\tvar semanticType uint32\n\t\tvar semanticModifier uint32\n\t\tswitch kind := symbol.kind.(type) {\n\t\tcase *option:\n\t\t\t// Options like [deprecated = true]\n\t\t\t// Note: \"option\" keyword is collected from the token stream scan\n\t\t\t// since options don't have associated ir.Symbol\n\t\t\tsemanticType = semanticTypeDecorator\n\t\tcase *reference:\n\t\t\t// Type references are highlighted based on what they reference\n\t\t\tswitch kind.def.Classify() {\n\t\t\tcase ast.DefKindMessage:\n\t\t\t\tsemanticType = semanticTypeStruct\n\t\t\tcase ast.DefKindEnum:\n\t\t\t\tsemanticType = semanticTypeEnum\n\t\t\t}\n\t\tdefault:\n\t\t\t// Declaration symbols\n\n\t\t\t// Collect field metadata (modifiers, tag) for all field-related symbols\n\t\t\tif symbol.ir.Kind() == ir.SymbolKindField {\n\t\t\t\tfieldDef := symbol.ir.AsMember().AST().AsField()\n\t\t\t\tfor prefix := range fieldDef.Type.Prefixes() {\n\t\t\t\t\tif prefixTok := prefix.PrefixToken(); !prefixTok.IsZero() {\n\t\t\t\t\t\tcollectToken(prefixTok.Span(), semanticTypeModifier, 0, keyword.Unknown)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !fieldDef.Tag.Span().IsZero() {\n\t\t\t\t\tcollectToken(fieldDef.Tag.Span(), semanticTypeNumber, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch symbol.ir.Kind() {\n\t\t\tcase ir.SymbolKindPackage:\n\t\t\t\tsemanticType = semanticTypeNamespace\n\t\t\tcase ir.SymbolKindMessage:\n\t\t\t\t// Collect \"message\" keyword\n\t\t\t\tif kwTok := symbol.ir.AsType().AST().KeywordToken(); !kwTok.IsZero() {\n\t\t\t\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t\t\t\t}\n\t\t\t\tsemanticType = semanticTypeStruct\n\t\t\tcase ir.SymbolKindEnum:\n\t\t\t\t// Collect \"enum\" keyword\n\t\t\t\tif kwTok := symbol.ir.AsType().AST().KeywordToken(); !kwTok.IsZero() {\n\t\t\t\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t\t\t\t}\n\t\t\t\tsemanticType = semanticTypeEnum\n\t\t\tcase ir.SymbolKindField:\n\t\t\t\t// Determine semantic type based on symbol kind\n\t\t\t\tif _, isReferenceable := symbol.kind.(*referenceable); isReferenceable {\n\t\t\t\t\t// Field name symbols are always properties\n\t\t\t\t\tsemanticType = semanticTypeProperty\n\t\t\t\t} else if symbol.IsBuiltIn() {\n\t\t\t\t\t// Builtin type symbols (like \"map\", \"int32\") are types\n\t\t\t\t\tsemanticType = semanticTypeType\n\t\t\t\t\tsemanticModifier += semanticModifierDefaultLibrary\n\t\t\t\t} else {\n\t\t\t\t\t// Other field-related symbols are properties\n\t\t\t\t\tsemanticType = semanticTypeProperty\n\t\t\t\t}\n\t\t\tcase ir.SymbolKindEnumValue:\n\t\t\t\tenumValueDef := symbol.ir.AsMember().AST().AsEnumValue()\n\t\t\t\t// Collect the enum value number\n\t\t\t\tif !enumValueDef.Tag.Span().IsZero() {\n\t\t\t\t\tcollectToken(enumValueDef.Tag.Span(), semanticTypeNumber, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t\tsemanticType = semanticTypeEnumMember\n\t\t\tcase ir.SymbolKindExtension:\n\t\t\t\tsemanticType = semanticTypeVariable\n\t\t\tcase ir.SymbolKindScalar:\n\t\t\t\t// Scalars are built-in types like int32, string, etc.\n\t\t\t\tsemanticType = semanticTypeType\n\t\t\t\tsemanticModifier += semanticModifierDefaultLibrary\n\t\t\tcase ir.SymbolKindService:\n\t\t\t\t// Collect \"service\" keyword\n\t\t\t\tif kwTok := symbol.ir.AsService().AST().KeywordToken(); !kwTok.IsZero() {\n\t\t\t\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t\t\t\t}\n\t\t\t\tsemanticType = semanticTypeInterface\n\t\t\tcase ir.SymbolKindOneof:\n\t\t\t\t// Collect \"oneof\" keyword\n\t\t\t\tif kwTok := symbol.ir.AsOneof().AST().KeywordToken(); !kwTok.IsZero() {\n\t\t\t\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t\t\t\t}\n\t\t\t\tsemanticType = semanticTypeProperty\n\t\t\tcase ir.SymbolKindMethod:\n\t\t\t\tdeclDef := symbol.ir.AsMethod().AST()\n\t\t\t\t// Collect \"rpc\" keyword\n\t\t\t\tif kwTok := declDef.KeywordToken(); !kwTok.IsZero() {\n\t\t\t\t\tcollectToken(kwTok.Span(), semanticTypeKeyword, 0, kwTok.Keyword())\n\t\t\t\t}\n\t\t\t\tmethodDef := declDef.AsMethod()\n\t\t\t\t// Collect \"stream\" modifiers for input/output types\n\t\t\t\tif inputs := methodDef.Signature.Inputs(); inputs.Len() == 1 {\n\t\t\t\t\tfor prefix := range inputs.At(0).Prefixes() {\n\t\t\t\t\t\tif prefixTok := prefix.PrefixToken(); !prefixTok.IsZero() {\n\t\t\t\t\t\t\tcollectToken(prefixTok.Span(), semanticTypeModifier, 0, keyword.Unknown)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif outputs := methodDef.Signature.Outputs(); outputs.Len() == 1 {\n\t\t\t\t\tfor prefix := range outputs.At(0).Prefixes() {\n\t\t\t\t\t\tif prefixTok := prefix.PrefixToken(); !prefixTok.IsZero() {\n\t\t\t\t\t\t\tcollectToken(prefixTok.Span(), semanticTypeModifier, 0, keyword.Unknown)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Note: \"returns\" keyword is collected from the token stream scan\n\t\t\t\tsemanticType = semanticTypeMethod\n\t\t\tdefault:\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tif _, ok := symbol.ir.Deprecated().AsBool(); ok {\n\t\t\tsemanticModifier += semanticModifierDeprecated\n\t\t}\n\n\t\tcollectToken(symbol.span, semanticType, semanticModifier, keyword.Unknown)\n\t}\n\n\t// Collect CEL tokens from protovalidate expressions\n\tfor _, symbol := range file.symbols {\n\t\t// Skip option symbols themselves - we want the symbols that HAVE options\n\t\tif _, isOption := symbol.kind.(*option); isOption {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Extract CEL expressions from buf.validate options if present\n\t\tcelExprs := extractCELExpressions(file, symbol)\n\t\tfor _, celExpr := range celExprs {\n\t\t\tcollectCELTokens(celEnv, celExpr, collectToken)\n\t\t}\n\t}\n\n\t// When multiple tokens share the same span, prefer more specific types over generic keywords.\n\t// For example, \"string\" appears as both a keyword and a built-in type; we want the type.\n\tseen := make(map[source.Span]int)\n\tdedupedTokens := tokens[:0]\n\tfor _, tok := range tokens {\n\t\tif idx, exists := seen[tok.span]; exists {\n\t\t\texistingTok := dedupedTokens[idx]\n\t\t\tif existingTok.semType == semanticTypeKeyword && tok.semType != semanticTypeKeyword {\n\t\t\t\tdedupedTokens[idx] = tok\n\t\t\t}\n\t\t} else {\n\t\t\tseen[tok.span] = len(dedupedTokens)\n\t\t\tdedupedTokens = append(dedupedTokens, tok)\n\t\t}\n\t}\n\ttokens = dedupedTokens\n\t// Phase 2: Sort tokens by position (line, then column)\n\tslices.SortFunc(tokens, func(a, b tokenInfo) int {\n\t\taLoc := a.span.StartLoc()\n\t\tbLoc := b.span.StartLoc()\n\t\tif aLoc.Line != bLoc.Line {\n\t\t\treturn aLoc.Line - bLoc.Line\n\t\t}\n\t\treturn aLoc.Column - bLoc.Column\n\t})\n\t// Phase 3: Delta-encode the sorted tokens\n\t// The encoding represents each token as:\n\t// [deltaLine, deltaStartChar, length, tokenType, tokenModifiers]\n\tvar (\n\t\tencoded           []uint32\n\t\tprevLine, prevCol uint32\n\t)\n\tfor _, tok := range tokens {\n\t\tstart := tok.span.StartLoc()\n\t\tend := tok.span.EndLoc()\n\t\t// Skip multi-line tokens\n\t\tif start.Line != end.Line {\n\t\t\tcontinue\n\t\t}\n\t\tcurrentLine := uint32(start.Line - 1) // Convert to 0-indexed\n\t\tstartCol := uint32(start.Column - 1)  // Convert to 0-indexed\n\t\tdeltaCol := startCol\n\t\t// If on the same line as previous token, make column delta relative\n\t\tif prevLine == currentLine {\n\t\t\tdeltaCol -= prevCol\n\t\t}\n\t\ttokenLen := uint32(end.Column - start.Column)\n\t\t// Append: [deltaLine, deltaCol, length, type, modifiers]\n\t\tencoded = append(encoded, currentLine-prevLine, deltaCol, tokenLen, tok.semType, tok.semMod)\n\t\t// Update state for next iteration\n\t\tprevLine = currentLine\n\t\tprevCol = startCol\n\t}\n\tif len(encoded) == 0 {\n\t\treturn nil, nil\n\t}\n\treturn &protocol.SemanticTokens{Data: encoded}, nil\n}\n"
  },
  {
    "path": "private/buf/buflsp/semantic_tokens_cel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"maps\"\n\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/seq\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/experimental/token/keyword\"\n\t\"github.com/google/cel-go/cel\"\n\t\"github.com/google/cel-go/common/ast\"\n\t\"github.com/google/cel-go/common/overloads\"\n\t\"github.com/google/cel-go/common/types\"\n)\n\nconst (\n\t// buf.validate extension field number on descriptor options\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate\n\tbufValidateExtensionNumber = 1159\n\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.FieldRules\n\tcelFieldNumberInFieldRules = 23\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.FieldRules\n\tcelExpressionFieldNumberInFieldRules = 29\n\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.MessageRules\n\tcelFieldNumberInMessageRules = 3\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.MessageRules\n\tcelExpressionFieldNumberInMessageRules = 5\n\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.Rule\n\texpressionFieldNumberInRule = 3\n)\n\n// celExpressionInfo holds information about a CEL expression found in protovalidate options.\ntype celExpressionInfo struct {\n\texpression string      // The CEL expression string\n\tspan       source.Span // The span of the expression string literal in the proto file\n\tirMember   ir.Member   // The field/member that has the option (for type context)\n\tthisIRType ir.Type     // The IR type of `this` in the expression:\n\t//   field/extension-level: the field's element type (e.g. string, Address)\n\t//   message-level: the message type itself\n}\n\n// extractCELExpressions finds CEL expressions in protovalidate options.\n// It looks for (buf.validate.field).cel[].expression and (buf.validate.field).cel_expression[] patterns.\nfunc extractCELExpressions(file *file, symbol *symbol) []celExpressionInfo {\n\tif symbol.ir.IsZero() {\n\t\treturn nil\n\t}\n\tvar optionValue ir.MessageValue\n\tswitch symbol.ir.Kind() {\n\tcase ir.SymbolKindField, ir.SymbolKindExtension:\n\t\toptionValue = symbol.ir.AsMember().Options()\n\tcase ir.SymbolKindMessage:\n\t\toptionValue = symbol.ir.AsType().Options()\n\tcase ir.SymbolKindEnum:\n\t\toptionValue = symbol.ir.AsType().Options()\n\tcase ir.SymbolKindEnumValue:\n\t\toptionValue = symbol.ir.AsMember().Options()\n\tcase ir.SymbolKindService:\n\t\toptionValue = symbol.ir.AsService().Options()\n\tcase ir.SymbolKindMethod:\n\t\toptionValue = symbol.ir.AsMethod().Options()\n\tcase ir.SymbolKindOneof:\n\t\toptionValue = symbol.ir.AsOneof().Options()\n\tdefault:\n\t\treturn nil\n\t}\n\tif optionValue.IsZero() {\n\t\treturn nil\n\t}\n\t// Traverse the option message value looking for buf.validate CEL expressions\n\treturn extractCELFromMessage(file, optionValue, symbol.ir)\n}\n\n// extractCELFromMessage recursively extracts CEL expressions from an option message.\nfunc extractCELFromMessage(file *file, msgValue ir.MessageValue, irSym ir.Symbol) []celExpressionInfo {\n\tvar results []celExpressionInfo\n\n\t// Helper to extract member from symbol\n\tgetMember := func() ir.Member {\n\t\tif irSym.Kind() == ir.SymbolKindField || irSym.Kind() == ir.SymbolKindExtension {\n\t\t\treturn irSym.AsMember()\n\t\t}\n\t\treturn ir.Member{}\n\t}\n\t// getThisType returns the IR type of `this` for the expression:\n\t//   field/extension → the field's element type\n\t//   message         → the message type itself (so this.field completions work)\n\tgetThisType := func() ir.Type {\n\t\tswitch irSym.Kind() {\n\t\tcase ir.SymbolKindField, ir.SymbolKindExtension:\n\t\t\treturn irSym.AsMember().Element()\n\t\tcase ir.SymbolKindMessage:\n\t\t\treturn irSym.AsType()\n\t\tdefault:\n\t\t\treturn ir.Type{}\n\t\t}\n\t}\n\n\tfor field := range msgValue.Fields() {\n\t\tfor element := range seq.Values(field.Elements()) {\n\t\t\telementField := element.Field()\n\t\t\tfieldNumber := elementField.Number()\n\n\t\t\t// Check if this is a top-level buf.validate extension - recurse into it\n\t\t\tif elementField.IsExtension() && fieldNumber == bufValidateExtensionNumber {\n\t\t\t\tnestedMsg := element.AsMessage()\n\t\t\t\tif !nestedMsg.IsZero() {\n\t\t\t\t\tresults = append(results, extractCELFromMessage(file, nestedMsg, irSym)...)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Handle nested Rule message (cel field containing Rule messages with expressions)\n\t\t\tif fieldNumber == celFieldNumberInFieldRules || fieldNumber == celFieldNumberInMessageRules {\n\t\t\t\t// This is a Rule message, look for the expression field\n\t\t\t\tnestedMsg := element.AsMessage()\n\t\t\t\tif !nestedMsg.IsZero() {\n\t\t\t\t\tfor nestedField := range nestedMsg.Fields() {\n\t\t\t\t\t\tfor nestedElement := range seq.Values(nestedField.Elements()) {\n\t\t\t\t\t\t\tnestedElementField := nestedElement.Field()\n\t\t\t\t\t\t\tif nestedElementField.Number() == expressionFieldNumberInRule {\n\t\t\t\t\t\t\t\tif exprString, ok := nestedElement.AsString(); ok {\n\t\t\t\t\t\t\t\t\tresults = append(results, celExpressionInfo{\n\t\t\t\t\t\t\t\t\t\texpression: exprString,\n\t\t\t\t\t\t\t\t\t\tspan:       nestedElement.AST().Span(),\n\t\t\t\t\t\t\t\t\t\tirMember:   getMember(),\n\t\t\t\t\t\t\t\t\t\tthisIRType: getThisType(),\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\t// Recursively check nested messages\n\t\t\t\t\tresults = append(results, extractCELFromMessage(file, nestedMsg, irSym)...)\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Handle cel_expression string field\n\t\t\tif fieldNumber == celExpressionFieldNumberInFieldRules || fieldNumber == celExpressionFieldNumberInMessageRules {\n\t\t\t\tif exprString, ok := element.AsString(); ok {\n\t\t\t\t\tresults = append(results, celExpressionInfo{\n\t\t\t\t\t\texpression: exprString,\n\t\t\t\t\t\tspan:       element.AST().Span(),\n\t\t\t\t\t\tirMember:   getMember(),\n\t\t\t\t\t\tthisIRType: getThisType(),\n\t\t\t\t\t})\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// Not a string value (e.g. a nested FieldRules message at the same field number\n\t\t\t\t// as a MessageRules cel_expression field) - fall through to general recursion.\n\t\t\t}\n\n\t\t\t// General case: recursively search any nested message for CEL expressions.\n\t\t\t// This handles nested structures like repeated.items.cel, map.keys.cel,\n\t\t\t// map.values.cel, and any other type-specific rule nesting in protovalidate.\n\t\t\tif nestedMsg := element.AsMessage(); !nestedMsg.IsZero() {\n\t\t\t\tresults = append(results, extractCELFromMessage(file, nestedMsg, irSym)...)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn results\n}\n\n// collectCELTokens compiles a CEL expression and collects semantic tokens from its AST.\nfunc collectCELTokens(\n\tbaseCelEnv *cel.Env,\n\texprInfo celExpressionInfo,\n\tcollectToken func(span source.Span, semanticType, semanticModifier uint32, kw keyword.Keyword),\n) {\n\t// Skip empty expressions\n\tif exprInfo.expression == \"\" {\n\t\treturn\n\t}\n\n\t// Parse the CEL expression (without type-checking) to get syntax highlighting even for invalid expressions\n\t// This provides a better user experience as users can see highlighting while writing\n\tparsedCELAST, issues := baseCelEnv.Parse(exprInfo.expression)\n\tif issues.Err() != nil {\n\t\t// Skip on parse errors (syntax errors)\n\t\treturn\n\t}\n\n\t// Get the native AST which has offset ranges for all expressions\n\tnativeAST := parsedCELAST.NativeRep()\n\tnativeSourceInfo := nativeAST.SourceInfo()\n\n\t// Walk the CEL AST and collect tokens\n\twalkCELExprWithVars(nativeAST.Expr(), nativeSourceInfo, exprInfo.span, exprInfo.expression, collectToken, nil)\n\n\t// Process macro calls separately since they're expanded in the main AST\n\t// but we want to highlight the original macro function names (has, all, exists, map, filter, etc.)\n\tcollectMacroTokens(nativeSourceInfo, exprInfo.span, exprInfo.expression, collectToken)\n}\n\n// collectMacroTokens processes CEL macro calls to highlight macro function names.\n// Macros like has(), all(), exists(), map(), filter() are expanded in the main AST,\n// but CEL preserves the original macro calls in sourceInfo.MacroCalls.\nfunc collectMacroTokens(\n\tsourceInfo *ast.SourceInfo,\n\texprLiteralSpan source.Span,\n\texprString string,\n\tcollectToken func(span source.Span, semanticType, semanticModifier uint32, kw keyword.Keyword),\n) {\n\t// Process each macro call\n\tfor macroID, macroExpr := range sourceInfo.MacroCalls() {\n\t\t// Only process call expressions\n\t\tif macroExpr.Kind() != ast.CallKind {\n\t\t\tcontinue\n\t\t}\n\t\tcall := macroExpr.AsCall()\n\t\tfuncName := call.FunctionName()\n\n\t\t// Only highlight if it's a recognized CEL macro\n\t\tif !isCELMacroFunction(funcName) {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Get the position of the macro call (rune offset from CEL)\n\t\tstartLoc := sourceInfo.GetStartLocation(macroID)\n\t\tif startLoc.Line() <= 0 {\n\t\t\tcontinue\n\t\t}\n\t\t// For method-style macros like this.all(...), we need to find the method name\n\t\t// For standalone macros like has(...), we need to find the function name\n\t\tif call.IsMemberFunction() {\n\t\t\t// Method call - search for \".funcName\" after the target\n\t\t\ttargetID := call.Target().ID()\n\t\t\ttargetLoc := sourceInfo.GetStartLocation(targetID)\n\t\t\tif targetLoc.Line() > 0 {\n\t\t\t\ttargetByteOffset := celLocByteOffset(targetLoc.Line(), targetLoc.Column(), sourceInfo, exprString)\n\t\t\t\ttokenSpan := findNameAfterDot(targetByteOffset, funcName, exprString, exprLiteralSpan)\n\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\tcollectToken(tokenSpan, semanticTypeMacro, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Standalone function call - CEL position points to opening paren, look backwards\n\t\t\tcelByteOffset := celLocByteOffset(startLoc.Line(), startLoc.Column(), sourceInfo, exprString)\n\t\t\tfuncStart := celByteOffset - len(funcName)\n\t\t\tfuncEnd := funcStart + len(funcName)\n\t\t\tif funcStart >= 0 && funcEnd <= len(exprString) {\n\t\t\t\tif exprString[funcStart:funcEnd] == funcName {\n\t\t\t\t\ttokenSpan := createCELSpan(funcStart, funcEnd, exprLiteralSpan)\n\t\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\t\tcollectToken(tokenSpan, semanticTypeMacro, 0, keyword.Unknown)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// walkCELExprWithVars recursively walks a CEL expression AST and collects semantic tokens.\n// The compVars parameter tracks comprehension variables in scope.\nfunc walkCELExprWithVars(\n\texpr ast.Expr,\n\tsourceInfo *ast.SourceInfo,\n\texprLiteralSpan source.Span,\n\texprString string,\n\tcollectToken func(span source.Span, semanticType, semanticModifier uint32, kw keyword.Keyword),\n\tcompVars map[string]bool,\n) {\n\tif expr == nil || expr.Kind() == ast.UnspecifiedExprKind {\n\t\treturn\n\t}\n\n\t// Get the CEL rune offset for this expression and convert to byte offset.\n\t// CEL tracks positions as Unicode code point (rune) offsets, not byte offsets.\n\tstartLoc := sourceInfo.GetStartLocation(expr.ID())\n\tif startLoc.Line() <= 0 {\n\t\treturn\n\t}\n\tcelByteOffset := celLocByteOffset(startLoc.Line(), startLoc.Column(), sourceInfo, exprString)\n\n\tvar tokenSpan source.Span\n\n\tswitch expr.Kind() {\n\tcase ast.IdentKind:\n\t\t// Identifier reference - use offset ranges from CEL's native AST\n\t\tidentName := expr.AsIdent()\n\n\t\t// Determine the token type\n\t\tvar tokenType uint32\n\t\tvar tokenModifier uint32\n\n\t\tif isCELKeyword(identName) {\n\t\t\t// CEL keywords (true, false, null, this, etc.)\n\t\t\ttokenType = semanticTypeKeyword\n\t\t} else if compVars != nil && compVars[identName] {\n\t\t\t// Comprehension variables\n\t\t\ttokenType = semanticTypeVariable\n\t\t} else {\n\t\t\t// Field access or other identifier\n\t\t\ttokenType = semanticTypeProperty\n\t\t}\n\n\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\ttokenSpan = createCELSpan(byteStart, byteStop, exprLiteralSpan)\n\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\tcollectToken(tokenSpan, tokenType, tokenModifier, keyword.Unknown)\n\t\t\t}\n\t\t}\n\n\tcase ast.SelectKind:\n\t\t// Field access (target.field)\n\t\tsel := expr.AsSelect()\n\n\t\t// Walk target first\n\t\tif sel.Operand() != nil {\n\t\t\twalkCELExprWithVars(sel.Operand(), sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\t}\n\n\t\t// Highlight the field name\n\t\tif sel.Operand() != nil {\n\t\t\ttargetLoc := sourceInfo.GetStartLocation(sel.Operand().ID())\n\t\t\tif targetLoc.Line() > 0 {\n\t\t\t\ttargetByteOffset := celLocByteOffset(targetLoc.Line(), targetLoc.Column(), sourceInfo, exprString)\n\t\t\t\ttokenSpan = findNameAfterDot(targetByteOffset, sel.FieldName(), exprString, exprLiteralSpan)\n\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\tcollectToken(tokenSpan, semanticTypeProperty, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tcase ast.CallKind:\n\t\t// Function call (or operator)\n\t\tcall := expr.AsCall()\n\n\t\t// Walk target first (for method calls)\n\t\tif call.IsMemberFunction() {\n\t\t\twalkCELExprWithVars(call.Target(), sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\t}\n\n\t\tfuncName := call.FunctionName()\n\n\t\t// Check if this is an operator (CEL represents operators as functions with special names)\n\t\t// Operators in CEL have names like _&&_, _||_, _>_, _==_, etc.\n\t\tif _, isOperator := celOperatorSymbol(funcName); isOperator {\n\t\t\t// This is an operator - use offset ranges from CEL's native AST\n\t\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\t\ttokenSpan = createCELSpan(byteStart, byteStop, exprLiteralSpan)\n\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\tcollectToken(tokenSpan, semanticTypeOperator, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Determine the token type based on the function\n\t\t\tvar tokenType uint32\n\t\t\tvar tokenModifier uint32\n\n\t\t\t// Check for special function types (macros, type functions)\n\t\t\tif isCELMacroFunction(funcName) {\n\t\t\t\t// Macro functions (has, all, exists, map, filter)\n\t\t\t\ttokenType = semanticTypeMacro\n\t\t\t} else if overloads.IsTypeConversionFunction(funcName) {\n\t\t\t\t// Built-in type conversion functions (int, uint, string, etc.)\n\t\t\t\ttokenType = semanticTypeType\n\t\t\t\ttokenModifier = semanticModifierDefaultLibrary\n\t\t\t} else if call.IsMemberFunction() {\n\t\t\t\t// Method call (e.g., this.size())\n\t\t\t\ttokenType = semanticTypeMethod\n\t\t\t} else {\n\t\t\t\t// Standalone function call (e.g., size(this))\n\t\t\t\ttokenType = semanticTypeFunction\n\t\t\t}\n\n\t\t\tif call.IsMemberFunction() {\n\t\t\t\t// Method call - search for the function name after the target\n\t\t\t\ttargetLoc := sourceInfo.GetStartLocation(call.Target().ID())\n\t\t\t\tif targetLoc.Line() > 0 {\n\t\t\t\t\ttargetByteOffset := celLocByteOffset(targetLoc.Line(), targetLoc.Column(), sourceInfo, exprString)\n\t\t\t\t\ttokenSpan = findNameAfterDot(targetByteOffset, funcName, exprString, exprLiteralSpan)\n\t\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\t\tcollectToken(tokenSpan, tokenType, tokenModifier, keyword.Unknown)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Standalone function call (no target)\n\t\t\t\t// CEL's position typically points to the opening paren, so look backwards for the function name\n\t\t\t\tfuncStart := celByteOffset - len(funcName)\n\t\t\t\tfuncEnd := funcStart + len(funcName)\n\t\t\t\tif funcStart >= 0 && funcEnd <= len(exprString) {\n\t\t\t\t\tif exprString[funcStart:funcEnd] == funcName {\n\t\t\t\t\t\ttokenSpan = createCELSpan(funcStart, funcEnd, exprLiteralSpan)\n\t\t\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\t\t\tcollectToken(tokenSpan, tokenType, tokenModifier, keyword.Unknown)\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\n\t\t// Walk arguments\n\t\tfor _, arg := range call.Args() {\n\t\t\twalkCELExprWithVars(arg, sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\t}\n\n\tcase ast.LiteralKind:\n\t\t// Constant literal\n\t\tswitch expr.AsLiteral().(type) {\n\t\tcase types.String:\n\t\t\t// String literal - use offset ranges from CEL's native AST\n\t\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\t\ttokenSpan = createCELSpan(byteStart, byteStop, exprLiteralSpan)\n\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\tcollectToken(tokenSpan, semanticTypeString, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase types.Int, types.Uint, types.Double:\n\t\t\t// Number literal - use offset ranges from CEL's native AST\n\t\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\t\ttokenSpan = createCELSpan(byteStart, byteStop, exprLiteralSpan)\n\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\tcollectToken(tokenSpan, semanticTypeNumber, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t}\n\n\t\tcase types.Bool:\n\t\t\t// Boolean literal - use offset ranges from CEL's native AST\n\t\t\tif offsetRange, ok := sourceInfo.GetOffsetRange(expr.ID()); ok {\n\t\t\t\tbyteStart, byteStop := celOffsetRangeToByteRange(exprString, offsetRange)\n\t\t\t\ttokenSpan = createCELSpan(byteStart, byteStop, exprLiteralSpan)\n\t\t\t\tif !tokenSpan.IsZero() {\n\t\t\t\t\tcollectToken(tokenSpan, semanticTypeKeyword, 0, keyword.Unknown)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\tcase ast.ListKind:\n\t\t// List literal - walk all elements\n\t\tfor _, elem := range expr.AsList().Elements() {\n\t\t\twalkCELExprWithVars(elem, sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\t}\n\n\tcase ast.MapKind:\n\t\t// Map literal - walk all entries\n\t\tfor _, entry := range expr.AsMap().Entries() {\n\t\t\tmapEntry := entry.AsMapEntry()\n\t\t\twalkCELExprWithVars(mapEntry.Key(), sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\t\twalkCELExprWithVars(mapEntry.Value(), sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\t}\n\n\tcase ast.StructKind:\n\t\t// Struct literal - walk all field values\n\t\tfor _, field := range expr.AsStruct().Fields() {\n\t\t\twalkCELExprWithVars(field.AsStructField().Value(), sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\t}\n\n\tcase ast.ComprehensionKind:\n\t\t// List comprehension - walk all parts\n\t\tcomp := expr.AsComprehension()\n\n\t\t// Walk the range and init with current scope (they don't see loop variables)\n\t\twalkCELExprWithVars(comp.IterRange(), sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\t\twalkCELExprWithVars(comp.AccuInit(), sourceInfo, exprLiteralSpan, exprString, collectToken, compVars)\n\n\t\t// Create extended scope with comprehension variables for the loop body\n\t\textendedVars := compVars\n\t\tif comp.IterVar() != \"\" || comp.AccuVar() != \"\" {\n\t\t\t// Copy the current compVars map and add the new variables\n\t\t\tif compVars != nil {\n\t\t\t\textendedVars = make(map[string]bool, len(compVars)+2)\n\t\t\t\tmaps.Copy(extendedVars, compVars)\n\t\t\t} else {\n\t\t\t\textendedVars = make(map[string]bool, 2)\n\t\t\t}\n\t\t\tif comp.IterVar() != \"\" {\n\t\t\t\textendedVars[comp.IterVar()] = true\n\t\t\t}\n\t\t\tif comp.AccuVar() != \"\" {\n\t\t\t\textendedVars[comp.AccuVar()] = true\n\t\t\t}\n\t\t}\n\n\t\t// Walk the loop body with extended scope (they can see loop variables)\n\t\twalkCELExprWithVars(comp.LoopCondition(), sourceInfo, exprLiteralSpan, exprString, collectToken, extendedVars)\n\t\twalkCELExprWithVars(comp.LoopStep(), sourceInfo, exprLiteralSpan, exprString, collectToken, extendedVars)\n\t\twalkCELExprWithVars(comp.Result(), sourceInfo, exprLiteralSpan, exprString, collectToken, extendedVars)\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/semantic_tokens_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"slices\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// TestSemanticTokensKeywords tests that keywords, modifiers, and other token types\n// are correctly identified and positioned in the semantic tokens output.\nfunc TestSemanticTokensKeywords(t *testing.T) {\n\tt.Parallel()\n\n\t// expectedToken represents an expected semantic token at a specific position.\n\ttype expectedToken struct {\n\t\tline      uint32\n\t\tstartChar uint32\n\t\tlength    uint32\n\t\ttokenType uint32\n\t\tdesc      string // Description for test failure messages\n\t}\n\n\t// notExpectedToken represents a token that should NOT be present at a specific position.\n\ttype notExpectedToken struct {\n\t\tline      uint32\n\t\tstartChar uint32\n\t\tlength    uint32\n\t\ttokenType uint32\n\t\tdesc      string // Description for test failure messages\n\t}\n\n\ttestCases := []struct {\n\t\tname              string\n\t\tfile              string\n\t\texpectedTokens    []expectedToken\n\t\tnotExpectedTokens []notExpectedToken\n\t}{\n\t\t{\n\t\t\tname: \"proto2\",\n\t\t\tfile: \"testdata/semantic_tokens/proto2.proto\",\n\t\t\texpectedTokens: []expectedToken{\n\t\t\t\t// syntax declaration\n\t\t\t\t{0, 0, 6, semanticTypeKeyword, \"'syntax' keyword\"},\n\t\t\t\t{0, 9, 8, semanticTypeString, \"'\\\"proto2\\\"' string\"},\n\t\t\t\t// package declaration\n\t\t\t\t{2, 0, 7, semanticTypeKeyword, \"'package' keyword\"},\n\t\t\t\t{2, 8, 7, semanticTypeNamespace, \"'test.v1' namespace\"},\n\t\t\t\t// message declaration\n\t\t\t\t{4, 0, 7, semanticTypeKeyword, \"'message' keyword\"},\n\t\t\t\t{4, 8, 6, semanticTypeStruct, \"'Person' struct\"},\n\t\t\t\t// required modifier\n\t\t\t\t{5, 2, 8, semanticTypeModifier, \"'required' modifier\"},\n\t\t\t\t{5, 11, 6, semanticTypeType, \"'string' as type\"},\n\t\t\t\t{5, 18, 4, semanticTypeProperty, \"'name' as property\"},\n\t\t\t\t{5, 25, 1, semanticTypeNumber, \"'1' field tag\"},\n\t\t\t\t// optional modifier + scalar types\n\t\t\t\t{6, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{6, 11, 5, semanticTypeType, \"'int32' as type\"},\n\t\t\t\t{6, 17, 3, semanticTypeProperty, \"'age' as property\"},\n\t\t\t\t{6, 23, 1, semanticTypeNumber, \"'2' field tag\"},\n\t\t\t\t{7, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{7, 11, 6, semanticTypeType, \"'double' as type\"},\n\t\t\t\t{7, 18, 6, semanticTypeProperty, \"'height' as property\"},\n\t\t\t\t{8, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{8, 11, 5, semanticTypeType, \"'float' as type\"},\n\t\t\t\t{8, 17, 6, semanticTypeProperty, \"'weight' as property\"},\n\t\t\t\t{9, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{9, 11, 4, semanticTypeType, \"'bool' as type\"},\n\t\t\t\t{9, 16, 6, semanticTypeProperty, \"'active' as property\"},\n\t\t\t\t{10, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{10, 11, 5, semanticTypeType, \"'bytes' as type\"},\n\t\t\t\t{10, 17, 4, semanticTypeProperty, \"'data' as property\"},\n\t\t\t\t{11, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{11, 11, 5, semanticTypeType, \"'int64' as type\"},\n\t\t\t\t{11, 17, 10, semanticTypeProperty, \"'big_number' as property\"},\n\t\t\t\t{12, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{12, 11, 6, semanticTypeType, \"'uint32' as type\"},\n\t\t\t\t{12, 18, 7, semanticTypeProperty, \"'counter' as property\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"edition\",\n\t\t\tfile: \"testdata/semantic_tokens/edition.proto\",\n\t\t\texpectedTokens: []expectedToken{\n\t\t\t\t// edition declaration\n\t\t\t\t{0, 0, 7, semanticTypeKeyword, \"'edition' keyword\"},\n\t\t\t\t{0, 10, 6, semanticTypeString, \"'\\\"2023\\\"' string\"},\n\t\t\t\t// package declaration\n\t\t\t\t{2, 0, 7, semanticTypeKeyword, \"'package' keyword\"},\n\t\t\t\t{2, 8, 7, semanticTypeNamespace, \"'test.v1' namespace\"},\n\t\t\t\t// message declaration\n\t\t\t\t{4, 0, 7, semanticTypeKeyword, \"'message' keyword\"},\n\t\t\t\t{4, 8, 7, semanticTypeStruct, \"'Product' struct\"},\n\t\t\t\t// string fields\n\t\t\t\t{5, 2, 6, semanticTypeType, \"'string' as type\"},\n\t\t\t\t{5, 9, 2, semanticTypeProperty, \"'id' as property\"},\n\t\t\t\t{6, 2, 6, semanticTypeType, \"'string' as type\"},\n\t\t\t\t{6, 9, 4, semanticTypeProperty, \"'name' as property\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"comprehensive\",\n\t\t\tfile: \"testdata/semantic_tokens/comprehensive.proto\",\n\t\t\texpectedTokens: []expectedToken{\n\t\t\t\t// comment\n\t\t\t\t{2, 0, 20, semanticTypeComment, \"comment on line 3\"},\n\t\t\t\t// import declarations (only resolved imports are tokenized)\n\t\t\t\t{5, 0, 6, semanticTypeKeyword, \"'import' keyword\"},\n\t\t\t\t{5, 7, 6, semanticTypeModifier, \"'public' modifier\"},\n\t\t\t\t{5, 14, 34, semanticTypeString, \"import path string\"},\n\t\t\t\t// Note: weak import on line 6 is not tokenized because the file doesn't exist\n\t\t\t\t// option keyword\n\t\t\t\t{10, 2, 6, semanticTypeKeyword, \"'option' keyword\"},\n\t\t\t\t// decorator (option)\n\t\t\t\t{10, 9, 10, semanticTypeDecorator, \"'deprecated' as decorator\"},\n\t\t\t\t// built-in type\n\t\t\t\t{13, 2, 6, semanticTypeType, \"'string' as type\"},\n\t\t\t\t// field name\n\t\t\t\t{13, 9, 4, semanticTypeProperty, \"'name' as property\"},\n\t\t\t\t{13, 16, 1, semanticTypeNumber, \"'1' field tag\"},\n\t\t\t\t{14, 2, 5, semanticTypeType, \"'int32' as type\"},\n\t\t\t\t{14, 8, 3, semanticTypeProperty, \"'age' as property\"},\n\t\t\t\t// optional field\n\t\t\t\t{16, 2, 8, semanticTypeModifier, \"'optional' modifier\"},\n\t\t\t\t{16, 11, 6, semanticTypeType, \"'string' as type\"},\n\t\t\t\t{16, 18, 8, semanticTypeProperty, \"'nickname' as property\"},\n\t\t\t\t{16, 29, 1, semanticTypeNumber, \"'5' field tag\"},\n\t\t\t\t// custom type\n\t\t\t\t{19, 2, 4, semanticTypeEnum, \"'Role' as enum\"},\n\t\t\t\t{19, 7, 4, semanticTypeProperty, \"'role' as property\"},\n\t\t\t\t// repeated modifier\n\t\t\t\t{22, 2, 8, semanticTypeModifier, \"'repeated' modifier\"},\n\t\t\t\t{22, 11, 6, semanticTypeType, \"'string' as type\"},\n\t\t\t\t{22, 18, 4, semanticTypeProperty, \"'tags' as property\"},\n\t\t\t\t// reserved keyword (single field)\n\t\t\t\t{25, 2, 8, semanticTypeKeyword, \"'reserved' keyword\"},\n\t\t\t\t// reserved keyword with range\n\t\t\t\t{26, 2, 8, semanticTypeKeyword, \"'reserved' keyword\"},\n\t\t\t\t{26, 14, 2, semanticTypeKeyword, \"'to' keyword\"},\n\t\t\t\t// reserved keyword with string\n\t\t\t\t{27, 2, 8, semanticTypeKeyword, \"'reserved' keyword\"},\n\t\t\t\t// oneof keyword\n\t\t\t\t{30, 2, 5, semanticTypeKeyword, \"'oneof' keyword\"},\n\t\t\t\t{30, 8, 7, semanticTypeProperty, \"'contact' oneof name\"},\n\t\t\t\t// map builtin\n\t\t\t\t{36, 2, 3, semanticTypeType, \"'map' builtin (builtin value)\"},\n\t\t\t\t{38, 2, 3, semanticTypeType, \"'map' builtin (enum value)\"},\n\t\t\t\t{40, 2, 3, semanticTypeType, \"'map' builtin (message value)\"},\n\t\t\t\t// map field names should be properties\n\t\t\t\t{36, 21, 10, semanticTypeProperty, \"'attributes' map field name\"},\n\t\t\t\t{38, 20, 8, semanticTypeProperty, \"'role_map' map field name\"},\n\t\t\t\t{40, 19, 8, semanticTypeProperty, \"'user_map' map field name\"},\n\t\t\t\t// map custom value types\n\t\t\t\t{38, 14, 4, semanticTypeEnum, \"'Role' as map value type (enum)\"},\n\t\t\t\t{40, 13, 4, semanticTypeStruct, \"'User' as map value type (message)\"},\n\t\t\t\t// enum declaration\n\t\t\t\t{44, 0, 4, semanticTypeKeyword, \"'enum' keyword\"},\n\t\t\t\t{44, 5, 4, semanticTypeEnum, \"'Role' enum\"},\n\t\t\t\t// enum member\n\t\t\t\t{45, 2, 16, semanticTypeEnumMember, \"'ROLE_UNSPECIFIED' as enumMember\"},\n\t\t\t\t{45, 21, 1, semanticTypeNumber, \"'0' enum value\"},\n\t\t\t\t// message type references\n\t\t\t\t{62, 2, 4, semanticTypeStruct, \"'User' message type reference\"},\n\t\t\t\t{62, 7, 4, semanticTypeProperty, \"'user' property\"},\n\t\t\t\t{70, 2, 8, semanticTypeModifier, \"'repeated' modifier\"},\n\t\t\t\t{70, 11, 4, semanticTypeStruct, \"'User' message type reference (repeated)\"},\n\t\t\t\t{70, 16, 5, semanticTypeProperty, \"'users' property\"},\n\t\t\t\t// service declaration\n\t\t\t\t{50, 0, 7, semanticTypeKeyword, \"'service' keyword\"},\n\t\t\t\t{50, 8, 11, semanticTypeInterface, \"'UserService' interface\"},\n\t\t\t\t// rpc method with stream\n\t\t\t\t{52, 2, 3, semanticTypeKeyword, \"'rpc' keyword\"},\n\t\t\t\t{52, 6, 7, semanticTypeMethod, \"'GetUser' method\"},\n\t\t\t\t{52, 14, 6, semanticTypeModifier, \"'stream' modifier (parameter)\"},\n\t\t\t\t{52, 21, 14, semanticTypeStruct, \"'GetUserRequest' type\"},\n\t\t\t\t{52, 37, 7, semanticTypeKeyword, \"'returns' keyword\"},\n\t\t\t\t{52, 46, 6, semanticTypeModifier, \"'stream' modifier (return)\"},\n\t\t\t\t{52, 53, 15, semanticTypeStruct, \"'GetUserResponse' type\"},\n\t\t\t\t// rpc method without stream\n\t\t\t\t{54, 2, 3, semanticTypeKeyword, \"'rpc' keyword\"},\n\t\t\t\t{54, 6, 9, semanticTypeMethod, \"'ListUsers' method\"},\n\t\t\t\t{54, 16, 16, semanticTypeStruct, \"'ListUsersRequest' type\"},\n\t\t\t\t{54, 34, 7, semanticTypeKeyword, \"'returns' keyword\"},\n\t\t\t\t{54, 43, 17, semanticTypeStruct, \"'ListUsersResponse' type\"},\n\t\t\t},\n\t\t\tnotExpectedTokens: []notExpectedToken{\n\t\t\t\t// = and ; should not be keywords\n\t\t\t\t{0, 7, 1, semanticTypeKeyword, \"'=' should not be keyword\"},\n\t\t\t\t{0, 17, 1, semanticTypeKeyword, \"';' should not be keyword\"},\n\t\t\t\t{10, 20, 1, semanticTypeKeyword, \"'=' should not be keyword\"},\n\t\t\t\t{10, 26, 1, semanticTypeKeyword, \"';' should not be keyword\"},\n\t\t\t\t{13, 14, 1, semanticTypeKeyword, \"'=' should not be keyword\"},\n\t\t\t\t{13, 17, 1, semanticTypeKeyword, \"';' should not be keyword\"},\n\t\t\t\t// Invalid import should not have string token (only resolved imports get string tokens)\n\t\t\t\t{6, 12, 13, semanticTypeString, \"invalid import path should not have string token\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"cel_expressions\",\n\t\t\tfile: \"testdata/semantic_tokens/cel.proto\",\n\t\t\texpectedTokens: []expectedToken{\n\t\t\t\t// Line 10: expression: \"this.startsWith('foo') && this.size() > 5\"\n\t\t\t\t// \"this\" keyword\n\t\t\t\t{10, 17, 4, semanticTypeKeyword, \"'this' keyword in CEL\"},\n\t\t\t\t// \"startsWith\" method\n\t\t\t\t{10, 22, 10, semanticTypeMethod, \"'startsWith' method in CEL\"},\n\t\t\t\t// 'foo' string literal\n\t\t\t\t{10, 33, 5, semanticTypeString, \"'foo' string in CEL\"},\n\t\t\t\t// \"&&\" operator\n\t\t\t\t{10, 40, 2, semanticTypeOperator, \"'&&' operator in CEL\"},\n\t\t\t\t// \"size\" method\n\t\t\t\t{10, 48, 4, semanticTypeMethod, \"'size' method in CEL\"},\n\t\t\t\t// \">\" operator\n\t\t\t\t{10, 55, 1, semanticTypeOperator, \"'>' operator in CEL\"},\n\t\t\t\t// \"5\" number\n\t\t\t\t{10, 57, 1, semanticTypeNumber, \"'5' number in CEL\"},\n\n\t\t\t\t// Line 16: expression: \"this > 0\"\n\t\t\t\t// \"this\" keyword\n\t\t\t\t{16, 17, 4, semanticTypeKeyword, \"'this' keyword in CEL\"},\n\t\t\t\t// \">\" operator\n\t\t\t\t{16, 22, 1, semanticTypeOperator, \"'>' operator in CEL\"},\n\t\t\t\t// \"0\" number\n\t\t\t\t{16, 24, 1, semanticTypeNumber, \"'0' number in CEL\"},\n\n\t\t\t\t// Line 21: cel_expression (array form): \"'@' in this\"\n\t\t\t\t// '@' string literal\n\t\t\t\t{20, 59, 3, semanticTypeString, \"'@' string in CEL\"},\n\t\t\t\t// \"in\" operator\n\t\t\t\t{20, 63, 2, semanticTypeOperator, \"'in' operator in CEL\"},\n\t\t\t\t// \"this\" keyword\n\t\t\t\t{20, 66, 4, semanticTypeKeyword, \"'this' keyword in CEL\"},\n\n\t\t\t\t// Line 29: message-level .cel expression: \"this.value > 0\"\n\t\t\t\t// \"this\" keyword\n\t\t\t\t{28, 17, 4, semanticTypeKeyword, \"'this' keyword in message CEL\"},\n\t\t\t\t// \"value\" property\n\t\t\t\t{28, 22, 5, semanticTypeProperty, \"'value' property in message CEL\"},\n\t\t\t\t// \">\" operator\n\t\t\t\t{28, 28, 1, semanticTypeOperator, \"'>' operator in message CEL\"},\n\t\t\t\t// \"0\" number\n\t\t\t\t{28, 30, 1, semanticTypeNumber, \"'0' number in message CEL\"},\n\n\t\t\t\t// Line 37: message-level cel_expression: \"this.count < 100\"\n\t\t\t\t// \"this\" keyword\n\t\t\t\t{36, 50, 4, semanticTypeKeyword, \"'this' keyword in message cel_expression\"},\n\t\t\t\t// \"count\" property\n\t\t\t\t{36, 55, 5, semanticTypeProperty, \"'count' property in message cel_expression\"},\n\t\t\t\t// \"<\" operator\n\t\t\t\t{36, 61, 1, semanticTypeOperator, \"'<' operator in message cel_expression\"},\n\t\t\t\t// \"100\" number\n\t\t\t\t{36, 63, 3, semanticTypeNumber, \"'100' number in message cel_expression\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"cel_advanced\",\n\t\t\tfile: \"testdata/semantic_tokens/cel_advanced.proto\",\n\t\t\texpectedTokens: []expectedToken{\n\t\t\t\t// Line 16 (file) = line 15 (0-indexed): expression: \"'@' in this\"\n\t\t\t\t// Test 'in' operator\n\t\t\t\t{15, 21, 2, semanticTypeOperator, \"'in' operator\"},\n\t\t\t\t{15, 24, 4, semanticTypeKeyword, \"'this' keyword (with in operator)\"},\n\n\t\t\t\t// Line 22 (file) = line 21 (0-indexed): expression: \"int(this) > 0 && string(int(this)) == this\"\n\t\t\t\t// Test type conversion functions (built-in type functions)\n\t\t\t\t{21, 17, 3, semanticTypeType, \"'int' type conversion function\"},\n\t\t\t\t{21, 21, 4, semanticTypeKeyword, \"'this' keyword (in int call)\"},\n\n\t\t\t\t// Line 40 (file) = line 39 (0-indexed): expression: \"has(this.street) && has(this.city)\"\n\t\t\t\t// Test has() macro highlighting\n\t\t\t\t{39, 17, 3, semanticTypeMacro, \"'has' macro\"},\n\t\t\t\t{39, 37, 3, semanticTypeMacro, \"'has' macro (second occurrence)\"},\n\t\t\t\t{39, 21, 4, semanticTypeKeyword, \"'this' keyword (in has call)\"},\n\t\t\t\t{39, 41, 4, semanticTypeKeyword, \"'this' keyword (in second has call)\"},\n\n\t\t\t\t// Line 46 (file) = line 45 (0-indexed): expression: \"this.all(tag, tag.size() > 0) && this.exists(tag, tag == 'valid')\"\n\t\t\t\t// Test all() and exists() macro highlighting + comprehension variables\n\t\t\t\t{45, 17, 4, semanticTypeKeyword, \"'this' keyword (before all)\"},\n\t\t\t\t{45, 22, 3, semanticTypeMacro, \"'all' macro\"},\n\t\t\t\t{45, 31, 3, semanticTypeVariable, \"'tag' comprehension variable (2nd use)\"},\n\t\t\t\t{45, 50, 4, semanticTypeKeyword, \"'this' keyword (before exists)\"},\n\t\t\t\t{45, 55, 6, semanticTypeMacro, \"'exists' macro\"},\n\t\t\t\t// Note: Other 'tag' uses in exists are at different positions due to expansion\n\n\t\t\t\t// Line 52 (file) = line 51 (0-indexed): expression: \"this > 0 ? true : false\"\n\t\t\t\t{51, 17, 4, semanticTypeKeyword, \"'this' keyword\"},\n\t\t\t\t{51, 22, 1, semanticTypeOperator, \"'>' operator\"},\n\t\t\t\t{51, 24, 1, semanticTypeNumber, \"'0' number\"},\n\t\t\t\t{51, 26, 1, semanticTypeOperator, \"'?' ternary operator\"},\n\t\t\t\t{51, 28, 4, semanticTypeKeyword, \"'true' keyword\"},\n\t\t\t\t{51, 35, 5, semanticTypeKeyword, \"'false' keyword\"},\n\n\t\t\t\t// Line 58 (file) = line 57 (0-indexed): expression: \"this.map(n, n * 2).size() > 0\"\n\t\t\t\t// Test map() macro highlighting + comprehension variables\n\t\t\t\t{57, 17, 4, semanticTypeKeyword, \"'this' keyword (before map)\"},\n\t\t\t\t{57, 22, 3, semanticTypeMacro, \"'map' macro\"},\n\t\t\t\t{57, 29, 1, semanticTypeVariable, \"'n' comprehension variable (2nd use)\"},\n\n\t\t\t\t// Line 64 (file) = line 63 (0-indexed): expression: \"this.filter(i, i.startsWith('test')).exists_one(i, i == 'test1')\"\n\t\t\t\t// Test filter() and exists_one() macro highlighting + comprehension variables\n\t\t\t\t{63, 17, 4, semanticTypeKeyword, \"'this' keyword (before filter)\"},\n\t\t\t\t{63, 22, 6, semanticTypeMacro, \"'filter' macro\"},\n\t\t\t\t{63, 32, 1, semanticTypeVariable, \"'i' comprehension variable (2nd use in filter)\"},\n\t\t\t\t{63, 54, 10, semanticTypeMacro, \"'exists_one' macro\"},\n\t\t\t\t// Note: Other 'i' uses in exists_one are at different positions due to expansion\n\n\t\t\t\t// Multi-line expression test 1 (lines 72-75)\n\t\t\t\t// Line 72 (0-indexed): \"      \"this.point_a == this.point_b ? 'point A...'\"\"\n\t\t\t\t{72, 7, 4, semanticTypeKeyword, \"'this' keyword in multi-line expression\"},\n\t\t\t\t{72, 12, 7, semanticTypeProperty, \"'point_a' property in multi-line expression\"},\n\t\t\t\t{72, 20, 2, semanticTypeOperator, \"'==' operator in multi-line expression\"},\n\t\t\t\t{72, 36, 1, semanticTypeOperator, \"'?' ternary operator in multi-line expression\"},\n\t\t\t\t// Second segment (line 73, 0-indexed): \"      \": this.point_b == this.point_c ? 'point B...'\"\"\n\t\t\t\t// Verifies that createCELSpan maps tokens in the second\n\t\t\t\t// string literal back to the correct file line and column.\n\t\t\t\t{73, 9, 4, semanticTypeKeyword, \"'this' in second segment of ternary\"},\n\t\t\t\t{73, 14, 7, semanticTypeProperty, \"'point_b' property in second segment\"},\n\t\t\t\t{73, 22, 2, semanticTypeOperator, \"'==' operator in second segment\"},\n\t\t\t\t{73, 25, 4, semanticTypeKeyword, \"second 'this' in second segment\"},\n\t\t\t\t{73, 30, 7, semanticTypeProperty, \"'point_c' property in second segment\"},\n\t\t\t\t{73, 38, 1, semanticTypeOperator, \"'?' ternary in second segment\"},\n\n\t\t\t\t// Multi-line expression test 2 (lines 81-82)\n\t\t\t\t// Line 81: \"(this.point_a.y - this.point_b.y) * (this.point_a.x - this.point_c.x)\"\n\t\t\t\t{81, 8, 4, semanticTypeKeyword, \"'this' keyword in multi-line arithmetic\"},\n\t\t\t\t{81, 13, 7, semanticTypeProperty, \"'point_a' property in multi-line arithmetic\"},\n\t\t\t\t// Line 82: \"!= (this.point_a.y - this.point_c.y) * (this.point_a.x - this.point_b.x)\"\n\t\t\t\t{82, 7, 2, semanticTypeOperator, \"'!=' operator in multi-line arithmetic\"},\n\t\t\t\t{82, 11, 4, semanticTypeKeyword, \"'this' keyword on line 2 of multi-line arithmetic\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"cel_invalid\",\n\t\t\tfile: \"testdata/semantic_tokens/cel_invalid.proto\",\n\t\t\t// Invalid CEL expressions should not be highlighted at all.\n\t\t\t// When CEL parsing fails, we skip highlighting and treat them as plain protobuf strings.\n\t\t\t// This test verifies that we don't crash or highlight invalid syntax.\n\t\t\texpectedTokens: []expectedToken{},\n\t\t},\n\t\t{\n\t\t\tname: \"cel_nested\",\n\t\t\tfile: \"testdata/semantic_tokens/cel_nested.proto\",\n\t\t\texpectedTokens: []expectedToken{\n\t\t\t\t// Line 10: repeated.items.cel expression: \"this.startsWith('x')\"\n\t\t\t\t{10, 17, 4, semanticTypeKeyword, \"'this' keyword in repeated.items.cel\"},\n\t\t\t\t{10, 22, 10, semanticTypeMethod, \"'startsWith' method in repeated.items.cel\"},\n\t\t\t\t{10, 33, 3, semanticTypeString, \"'x' string in repeated.items.cel\"},\n\n\t\t\t\t// Line 12: repeated.items.cel_expression: \"'@' in this\"\n\t\t\t\t{12, 84, 3, semanticTypeString, \"'@' string in repeated.items.cel_expression\"},\n\t\t\t\t{12, 88, 2, semanticTypeOperator, \"'in' operator in repeated.items.cel_expression\"},\n\t\t\t\t{12, 91, 4, semanticTypeKeyword, \"'this' keyword in repeated.items.cel_expression\"},\n\n\t\t\t\t// Line 16: map.keys.cel expression: \"this.size() > 0\"\n\t\t\t\t{16, 17, 4, semanticTypeKeyword, \"'this' keyword in map.keys.cel\"},\n\t\t\t\t{16, 22, 4, semanticTypeMethod, \"'size' method in map.keys.cel\"},\n\t\t\t\t{16, 29, 1, semanticTypeOperator, \"'>' operator in map.keys.cel\"},\n\t\t\t\t{16, 31, 1, semanticTypeNumber, \"'0' number in map.keys.cel\"},\n\n\t\t\t\t// Line 21: map.values.cel expression: \"this.size() > 1\"\n\t\t\t\t{21, 17, 4, semanticTypeKeyword, \"'this' keyword in map.values.cel\"},\n\t\t\t\t{21, 22, 4, semanticTypeMethod, \"'size' method in map.values.cel\"},\n\t\t\t\t{21, 29, 1, semanticTypeOperator, \"'>' operator in map.values.cel\"},\n\t\t\t\t{21, 31, 1, semanticTypeNumber, \"'1' number in map.values.cel\"},\n\n\t\t\t\t// Line 23: map.values.cel_expression: \"this.size() < 100\"\n\t\t\t\t{23, 84, 4, semanticTypeKeyword, \"'this' keyword in map.values.cel_expression\"},\n\t\t\t\t{23, 89, 4, semanticTypeMethod, \"'size' method in map.values.cel_expression\"},\n\t\t\t\t{23, 96, 1, semanticTypeOperator, \"'<' operator in map.values.cel_expression\"},\n\t\t\t\t{23, 98, 3, semanticTypeNumber, \"'100' number in map.values.cel_expression\"},\n\n\t\t\t\t// Line 25: map.keys.cel_expression: \"this.size() > 0\"\n\t\t\t\t{25, 81, 4, semanticTypeKeyword, \"'this' keyword in map.keys.cel_expression\"},\n\t\t\t\t{25, 86, 4, semanticTypeMethod, \"'size' method in map.keys.cel_expression\"},\n\t\t\t\t{25, 93, 1, semanticTypeOperator, \"'>' operator in map.keys.cel_expression\"},\n\t\t\t\t{25, 95, 1, semanticTypeNumber, \"'0' number in map.keys.cel_expression\"},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tctx := t.Context()\n\t\t\ttestProtoPath, err := filepath.Abs(tc.file)\n\t\t\trequire.NoError(t, err)\n\t\t\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\t\t\tvar semanticTokens *protocol.SemanticTokens\n\t\t\t_, err = clientJSONConn.Call(ctx, \"textDocument/semanticTokens/full\", protocol.SemanticTokensParams{\n\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\tURI: testURI,\n\t\t\t\t},\n\t\t\t}, &semanticTokens)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.NotNil(t, semanticTokens)\n\t\t\trequire.NotEmpty(t, semanticTokens.Data)\n\t\t\ttokens := decodeSemanticTokens(semanticTokens.Data)\n\n\t\t\t// Check for overlapping spans (tokens with exact same position and length)\n\t\t\ttype spanKey struct {\n\t\t\t\tline      uint32\n\t\t\t\tstartChar uint32\n\t\t\t\tlength    uint32\n\t\t\t}\n\t\t\tseenSpans := make(map[spanKey]int)\n\t\t\tfor i, token := range tokens {\n\t\t\t\tkey := spanKey{token.line, token.startChar, token.length}\n\t\t\t\tif prevIdx, exists := seenSpans[key]; exists {\n\t\t\t\t\tassert.Failf(t, \"Overlapping spans detected\",\n\t\t\t\t\t\t\"Token %d and token %d have the same span (line=%d, col=%d, len=%d). Token %d type=%d, Token %d type=%d\",\n\t\t\t\t\t\tprevIdx, i, token.line, token.startChar, token.length, prevIdx, tokens[prevIdx].tokenType, i, token.tokenType)\n\t\t\t\t}\n\t\t\t\tseenSpans[key] = i\n\t\t\t}\n\n\t\t\tfor _, expected := range tc.expectedTokens {\n\t\t\t\tassert.True(t, findToken(tokens, expected.line, expected.startChar, expected.length, expected.tokenType),\n\t\t\t\t\t\"Expected %s at line %d, column %d\", expected.desc, expected.line+1, expected.startChar)\n\t\t\t}\n\n\t\t\tfor _, notExpected := range tc.notExpectedTokens {\n\t\t\t\tassert.False(t, findToken(tokens, notExpected.line, notExpected.startChar, notExpected.length, notExpected.tokenType),\n\t\t\t\t\t\"Not expected %s at line %d, column %d\", notExpected.desc, notExpected.line+1, notExpected.startChar)\n\t\t\t}\n\t\t})\n\t}\n}\n\n// Semantic token types - must match semantic_tokens.go constants\nconst (\n\tsemanticTypeProperty   = 0\n\tsemanticTypeStruct     = 1\n\tsemanticTypeVariable   = 2\n\tsemanticTypeEnum       = 3\n\tsemanticTypeEnumMember = 4\n\tsemanticTypeInterface  = 5\n\tsemanticTypeMethod     = 6\n\tsemanticTypeFunction   = 7\n\tsemanticTypeDecorator  = 8\n\tsemanticTypeMacro      = 9\n\tsemanticTypeNamespace  = 10\n\tsemanticTypeKeyword    = 11\n\tsemanticTypeModifier   = 12\n\tsemanticTypeComment    = 13\n\tsemanticTypeString     = 14\n\tsemanticTypeNumber     = 15\n\tsemanticTypeType       = 16\n\tsemanticTypeOperator   = 17\n)\n\n// semanticToken represents a decoded semantic token for easier testing.\ntype semanticToken struct {\n\tline      uint32\n\tstartChar uint32\n\tlength    uint32\n\ttokenType uint32\n}\n\n// decodeSemanticTokens converts the delta-encoded token array into absolute positions.\nfunc decodeSemanticTokens(data []uint32) []semanticToken {\n\tvar tokens []semanticToken\n\tvar line, startChar uint32\n\n\tfor i := 0; i < len(data); i += 5 {\n\t\tdeltaLine := data[i]\n\t\tdeltaStartChar := data[i+1]\n\t\tlength := data[i+2]\n\t\ttokenType := data[i+3]\n\n\t\tline += deltaLine\n\t\tif deltaLine != 0 {\n\t\t\tstartChar = deltaStartChar\n\t\t} else {\n\t\t\tstartChar += deltaStartChar\n\t\t}\n\n\t\ttokens = append(tokens, semanticToken{\n\t\t\tline:      line,\n\t\t\tstartChar: startChar,\n\t\t\tlength:    length,\n\t\t\ttokenType: tokenType,\n\t\t})\n\t}\n\n\treturn tokens\n}\n\n// findToken searches for a token at the specified position with the given type.\nfunc findToken(tokens []semanticToken, line, startChar, length, tokenType uint32) bool {\n\treturn slices.ContainsFunc(tokens, func(token semanticToken) bool {\n\t\treturn token.line == line && token.startChar == startChar &&\n\t\t\ttoken.length == length && token.tokenType == tokenType\n\t})\n}\n"
  },
  {
    "path": "private/buf/buflsp/server.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"strings\"\n\t\"unicode/utf16\"\n\n\tcelpv \"buf.build/go/protovalidate/cel\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/bufformat\"\n\t\"github.com/bufbuild/protocompile/parser\"\n\t\"github.com/bufbuild/protocompile/reporter\"\n\t\"github.com/google/cel-go/cel\"\n\t\"go.lsp.dev/protocol\"\n\t\"mvdan.cc/xurls/v2\"\n)\n\nconst (\n\tserverName = \"buf-lsp\"\n\n\tmaxSymbolResults = 1000\n)\n\n// server is an implementation of [protocol.Server].\n//\n// This is a separate type from buflsp.lsp so that the dozens of handler methods for this\n// type are kept separate from the rest of the logic.\n//\n// See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification.\ntype server struct {\n\t// This automatically implements all of protocol.Server for us. By default,\n\t// every method returns an error.\n\tnyi\n\n\t// We embed the LSP pointer as well, since it only has private members.\n\t*lsp\n\n\t// httpsURLRegex is used to find https:// URLs in comments for document links.\n\thttpsURLRegex *regexp.Regexp\n\t// celEnv is the CEL environment used for parsing protovalidate expressions.\n\tcelEnv *cel.Env\n}\n\n// newServer creates a protocol.Server implementation out of an lsp.\nfunc newServer(lsp *lsp) (protocol.Server, error) {\n\thttpsURLRegex, err := xurls.StrictMatchingScheme(\"https://\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create HTTPS URL regex: %w\", err)\n\t}\n\tcelEnv, err := cel.NewEnv(\n\t\tcel.Lib(celpv.NewLibrary()),\n\t\tcel.EnableMacroCallTracking(),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create CEL environment: %w\", err)\n\t}\n\treturn &server{\n\t\tlsp:           lsp,\n\t\thttpsURLRegex: httpsURLRegex,\n\t\tcelEnv:        celEnv,\n\t}, nil\n}\n\n// Methods for server are grouped according to the groups in the LSP protocol specification.\n\n// -- Lifecycle Methods\n\n// Initialize is the first message the LSP receives from the client. This is where all\n// initialization of the server wrt to the project is is invoked on must occur.\nfunc (s *server) Initialize(\n\tctx context.Context,\n\tparams *protocol.InitializeParams,\n) (*protocol.InitializeResult, error) {\n\tif err := s.init(ctx, params); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif params.ClientInfo != nil {\n\t\ts.logger.Info(\n\t\t\t\"client attached\",\n\t\t\t\"client_name\", params.ClientInfo.Name,\n\t\t\t\"client_version\", params.ClientInfo.Version,\n\t\t)\n\t}\n\n\t// Set initial trace value, if provided.\n\tif params.Trace != \"\" {\n\t\ts.lsp.traceValue.Store(&params.Trace)\n\t}\n\n\tinfo := &protocol.ServerInfo{\n\t\tName:    serverName,\n\t\tVersion: s.lsp.bufVersion,\n\t}\n\n\t// The LSP protocol library doesn't actually provide SemanticTokensOptions\n\t// correctly.\n\ttype SemanticTokensLegend struct {\n\t\tTokenTypes     []string `json:\"tokenTypes\"`\n\t\tTokenModifiers []string `json:\"tokenModifiers\"`\n\t}\n\ttype SemanticTokensOptions struct {\n\t\tLegend SemanticTokensLegend `json:\"legend\"`\n\t\tFull   bool                 `json:\"full\"`\n\t}\n\n\treturn &protocol.InitializeResult{\n\t\tCapabilities: protocol.ServerCapabilities{\n\t\t\t// These are all the things we advertise to the client we can do.\n\t\t\t// For now, incomplete features are explicitly disabled here as TODOs.\n\t\t\tTextDocumentSync: &protocol.TextDocumentSyncOptions{\n\t\t\t\tOpenClose: true,\n\t\t\t\t// Request that whole files be sent to us. Protobuf IDL files don't\n\t\t\t\t// usually get especially huge, so this simplifies our logic without\n\t\t\t\t// necessarily making the LSP slow.\n\t\t\t\tChange: protocol.TextDocumentSyncKindFull,\n\t\t\t\tSave: &protocol.SaveOptions{\n\t\t\t\t\tIncludeText: false,\n\t\t\t\t},\n\t\t\t},\n\t\t\tCodeActionProvider: &protocol.CodeActionOptions{\n\t\t\t\tCodeActionKinds: []protocol.CodeActionKind{\n\t\t\t\t\tprotocol.SourceOrganizeImports,\n\t\t\t\t\tprotocol.RefactorRewrite,\n\t\t\t\t\tprotocol.QuickFix,\n\t\t\t\t},\n\t\t\t},\n\t\t\tCompletionProvider: &protocol.CompletionOptions{\n\t\t\t\tResolveProvider:   true,\n\t\t\t\tTriggerCharacters: []string{\".\", \"\\\"\", \"/\"},\n\t\t\t},\n\t\t\tDefinitionProvider:         &protocol.DefinitionOptions{},\n\t\t\tTypeDefinitionProvider:     &protocol.TypeDefinitionOptions{},\n\t\t\tDocumentFormattingProvider: true,\n\t\t\tDocumentHighlightProvider:  true,\n\t\t\tHoverProvider:              true,\n\t\t\tReferencesProvider:         &protocol.ReferenceOptions{},\n\t\t\tRenameProvider: &protocol.RenameOptions{\n\t\t\t\tPrepareProvider: true,\n\t\t\t},\n\t\t\tSemanticTokensProvider: &SemanticTokensOptions{\n\t\t\t\tLegend: SemanticTokensLegend{\n\t\t\t\t\tTokenTypes:     semanticTypeLegend,\n\t\t\t\t\tTokenModifiers: semanticModifierLegend,\n\t\t\t\t},\n\t\t\t\tFull: true,\n\t\t\t},\n\t\t\tWorkspaceSymbolProvider: true,\n\t\t\tDocumentSymbolProvider:  true,\n\t\t\tFoldingRangeProvider:    true,\n\t\t\tDocumentLinkProvider:    &protocol.DocumentLinkOptions{},\n\t\t},\n\t\tServerInfo: info,\n\t}, nil\n}\n\n// Initialized is sent by the client after it receives the Initialize response and has\n// initialized itself. This is only a notification.\nfunc (s *server) Initialized(\n\tctx context.Context,\n\tparams *protocol.InitializedParams,\n) error {\n\t// No initialization required.\n\treturn nil\n}\n\nfunc (s *server) SetTrace(\n\tctx context.Context,\n\tparams *protocol.SetTraceParams,\n) error {\n\ts.lsp.traceValue.Store(&params.Value)\n\treturn nil\n}\n\n// Shutdown is sent by the client when it wants the server to shut down and exit.\n// The client will wait until Shutdown returns, and then call Exit.\nfunc (s *server) Shutdown(ctx context.Context) error {\n\ts.lsp.shutdown = true\n\t// Cancel any in-progress checks for all tracked files, then cancel the\n\t// connection context to stop any remaining background goroutines.\n\tfor _, file := range s.lsp.fileManager.uriToFile.Range {\n\t\tfile.CancelChecks(ctx)\n\t}\n\ts.lsp.connCancel()\n\treturn nil\n}\n\n// Exit is a notification that the client has seen shutdown complete, and that the\n// server should now exit.\nfunc (s *server) Exit(ctx context.Context) error {\n\tif !s.lsp.shutdown {\n\t\treturn errors.New(\"shutdown was not called or not yet completed\")\n\t}\n\n\t// Close the connection. This will let the server shut down gracefully once this\n\t// notification is replied to.\n\treturn s.lsp.conn.Close()\n}\n\n// -- File synchronization methods.\n\n// DidOpen is called whenever the client opens a document. This is our signal to parse\n// the file.\nfunc (s *server) DidOpen(\n\tctx context.Context,\n\tparams *protocol.DidOpenTextDocumentParams,\n) error {\n\tfile := s.fileManager.Track(params.TextDocument.URI)\n\tfile.RefreshWorkspace(ctx)\n\tfile.Update(ctx, params.TextDocument.Version, params.TextDocument.Text)\n\treturn nil\n}\n\n// DidChange is called whenever the client opens a document. This is our signal to parse\n// the file.\nfunc (s *server) DidChange(\n\tctx context.Context,\n\tparams *protocol.DidChangeTextDocumentParams,\n) error {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\t// Update for a file we don't know about? Seems bad!\n\t\treturn fmt.Errorf(\"received update for file that was not open: %q\", params.TextDocument.URI)\n\t}\n\n\tfile.Update(ctx, params.TextDocument.Version, params.ContentChanges[0].Text)\n\treturn nil\n}\n\n// DidSave is called whenever the client saves a document.\nfunc (s *server) DidSave(\n\tctx context.Context,\n\tparams *protocol.DidSaveTextDocumentParams,\n) error {\n\t// We use this as an opportunity to do a refresh; some lints, such as\n\t// breaking-against-last-saved, rely on this.\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\t// Update for a file we don't know about? Seems bad!\n\t\treturn fmt.Errorf(\"received update for file that was not open: %q\", params.TextDocument.URI)\n\t}\n\tfile.RefreshWorkspace(ctx)\n\treturn nil\n}\n\n// Formatting is called whenever the user explicitly requests formatting.\n//\n// NOTE: this still uses the current compiler since formatting is not yet implemented with\n// the new compiler. This will be ported over once that is ready. For now, we parse the file\n// on-demand for formatting.\nfunc (s *server) Formatting(\n\tctx context.Context,\n\tparams *protocol.DocumentFormattingParams,\n) ([]protocol.TextEdit, error) {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\t// Format for a file we don't know about? Seems bad!\n\t\treturn nil, fmt.Errorf(\"received update for file that was not open: %q\", params.TextDocument.URI)\n\t}\n\tvar errorsWithPos []reporter.ErrorWithPos\n\tvar warningErrorsWithPos []reporter.ErrorWithPos\n\thandler := reporter.NewHandler(reporter.NewReporter(\n\t\tfunc(errorWithPos reporter.ErrorWithPos) error {\n\t\t\terrorsWithPos = append(errorsWithPos, errorWithPos)\n\t\t\treturn nil\n\t\t},\n\t\tfunc(errorWithPos reporter.ErrorWithPos) {\n\t\t\twarningErrorsWithPos = append(warningErrorsWithPos, errorWithPos)\n\t\t},\n\t))\n\tparsed, err := parser.Parse(file.uri.Filename(), strings.NewReader(file.file.Text()), handler)\n\tif err == nil {\n\t\t_, _ = parser.ResultFromAST(parsed, true, handler)\n\t}\n\tif len(errorsWithPos) > 0 {\n\t\treturn nil, fmt.Errorf(\"cannot format file %q, %v error(s) found\", file.uri.Filename(), len(errorsWithPos))\n\t}\n\t// Currently we have no way to honor any of the parameters.\n\t_ = params\n\tif parsed == nil {\n\t\treturn nil, nil\n\t}\n\tvar out strings.Builder\n\tif err := bufformat.FormatFileNode(&out, parsed); err != nil {\n\t\treturn nil, err\n\t}\n\tnewText := out.String()\n\tif newText == file.file.Text() {\n\t\treturn nil, nil\n\t}\n\n\t// Calculate the end location for the file range.\n\tendLine := strings.Count(file.file.Text(), \"\\n\")\n\tendCharacter := 0\n\tfor _, char := range file.file.Text()[strings.LastIndexByte(file.file.Text(), '\\n')+1:] {\n\t\tendCharacter += utf16.RuneLen(char)\n\t}\n\treturn []protocol.TextEdit{\n\t\t{\n\t\t\tRange: protocol.Range{\n\t\t\t\tStart: protocol.Position{\n\t\t\t\t\tLine:      0,\n\t\t\t\t\tCharacter: 0,\n\t\t\t\t},\n\t\t\t\tEnd: protocol.Position{\n\t\t\t\t\tLine:      uint32(endLine),\n\t\t\t\t\tCharacter: uint32(endCharacter),\n\t\t\t\t},\n\t\t\t},\n\t\t\tNewText: newText,\n\t\t},\n\t}, nil\n}\n\n// DidClose is called whenever the client closes a document.\nfunc (s *server) DidClose(\n\tctx context.Context,\n\tparams *protocol.DidCloseTextDocumentParams,\n) error {\n\tif file := s.fileManager.Get(params.TextDocument.URI); file != nil {\n\t\tfile.Close(ctx)\n\t}\n\treturn nil\n}\n\n// -- Language functionality methods.\n\n// Hover is the entry point for hover inlays.\nfunc (s *server) Hover(\n\tctx context.Context,\n\tparams *protocol.HoverParams,\n) (*protocol.Hover, error) {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\treturn nil, nil\n\t}\n\n\t// First, try to get CEL hover documentation\n\tcelHover := getCELHover(file, params.Position, s.celEnv)\n\tif celHover != nil {\n\t\treturn celHover, nil\n\t}\n\n\t// Fall back to regular symbol hover\n\tsymbol := file.SymbolAt(ctx, params.Position)\n\tif symbol == nil {\n\t\treturn nil, nil\n\t}\n\n\tdocs := symbol.FormatDocs()\n\tif docs == \"\" {\n\t\treturn nil, nil\n\t}\n\n\t// Escape < and > occurrences in the docs.\n\treplacer := strings.NewReplacer(\"<\", \"&lt;\", \">\", \"&gt;\")\n\tdocs = replacer.Replace(docs)\n\n\trange_ := symbol.Range() // Need to spill this here because Hover.Range is a pointer.\n\treturn &protocol.Hover{\n\t\tContents: protocol.MarkupContent{\n\t\t\tKind:  protocol.Markdown,\n\t\t\tValue: docs,\n\t\t},\n\t\tRange: &range_,\n\t}, nil\n}\n\n// Definition is the entry point for go-to-definition.\nfunc (s *server) Definition(\n\tctx context.Context,\n\tparams *protocol.DefinitionParams,\n) ([]protocol.Location, error) {\n\t// First, try to resolve a CEL definition (e.g. `this` → field or message).\n\tif file := s.fileManager.Get(params.TextDocument.URI); file != nil {\n\t\tif loc := getCELDefinition(file, params.Position, s.celEnv); loc != nil {\n\t\t\treturn []protocol.Location{*loc}, nil\n\t\t}\n\t}\n\tsymbol := s.getSymbol(ctx, params.TextDocument.URI, params.Position)\n\tif symbol == nil {\n\t\treturn nil, nil\n\t}\n\treturn []protocol.Location{\n\t\tsymbol.Definition(),\n\t}, nil\n}\n\n// TypeDefinition is the entry point for go-to type-definition.\nfunc (s *server) TypeDefinition(\n\tctx context.Context,\n\tparams *protocol.TypeDefinitionParams,\n) ([]protocol.Location, error) {\n\tsymbol := s.getSymbol(ctx, params.TextDocument.URI, params.Position)\n\tif symbol == nil {\n\t\treturn nil, nil\n\t}\n\treturn []protocol.Location{\n\t\tsymbol.TypeDefinition(),\n\t}, nil\n}\n\n// References is the entry point for get-all-references.\nfunc (s *server) References(\n\tctx context.Context,\n\tparams *protocol.ReferenceParams,\n) ([]protocol.Location, error) {\n\tsymbol := s.getSymbol(ctx, params.TextDocument.URI, params.Position)\n\tif symbol == nil {\n\t\treturn nil, nil\n\t}\n\t// We deduplicate the references here in the case where a file's symbols have not yet\n\t// been refreshed, but a new file with references to symbols in said file is opened. This\n\t// can cause duplicate references to be appended and not all clients deduplicate the\n\t// returned references.\n\t//\n\t// We also do not want to refresh all symbols in the workspace when a single file is\n\t// interacted with, since that could be detrimental to performance.\n\treturn xslices.Deduplicate(symbol.References(params.Context.IncludeDeclaration)), nil\n}\n\n// Completion is the entry point for code completion.\nfunc (s *server) Completion(\n\tctx context.Context,\n\tparams *protocol.CompletionParams,\n) (*protocol.CompletionList, error) {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\treturn nil, nil\n\t}\n\n\t// First, try CEL completion when the cursor is inside a protovalidate expression.\n\tif celItems := getCELCompletionItems(file, params.Position, s.celEnv); celItems != nil {\n\t\treturn &protocol.CompletionList{Items: celItems}, nil\n\t}\n\n\t// Fall back to proto-level completions.\n\titems := getCompletionItems(ctx, file, params.Position)\n\tif len(items) == 0 {\n\t\treturn nil, nil\n\t}\n\treturn &protocol.CompletionList{Items: items}, nil\n}\n\n// CompletionResolve is the entry point for resolving additional details for a completion item.\nfunc (s *server) CompletionResolve(\n\tctx context.Context,\n\tparams *protocol.CompletionItem,\n) (*protocol.CompletionItem, error) {\n\treturn resolveCompletionItem(ctx, params)\n}\n\n// SemanticTokensFull is called to render semantic token information on the client.\nfunc (s *server) SemanticTokensFull(\n\tctx context.Context,\n\tparams *protocol.SemanticTokensParams,\n) (*protocol.SemanticTokens, error) {\n\treturn semanticTokensFull(s.fileManager.Get(params.TextDocument.URI), s.celEnv)\n}\n\n// Symbols is the entry point for workspace-wide symbol search.\nfunc (s *server) Symbols(\n\tctx context.Context,\n\tparams *protocol.WorkspaceSymbolParams,\n) ([]protocol.SymbolInformation, error) {\n\tquery := strings.ToLower(params.Query)\n\tvar results []protocol.SymbolInformation\n\tfor _, file := range s.fileManager.uriToFile.Range {\n\t\tfor symbol := range file.GetSymbols(query) {\n\t\t\tresults = append(results, symbol)\n\t\t\tif len(results) > maxSymbolResults {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn results, nil\n}\n\n// DocumentSymbol is the entry point for document symbol search.\nfunc (s *server) DocumentSymbol(ctx context.Context, params *protocol.DocumentSymbolParams) (\n\tresult []any, // []protocol.SymbolInformation\n\terr error,\n) {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\treturn nil, nil\n\t}\n\tanyResults := []any{}\n\tfor symbol := range file.GetSymbols(\"\") {\n\t\tanyResults = append(anyResults, symbol)\n\t\tif len(anyResults) > maxSymbolResults {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn anyResults, nil\n}\n\n// DocumentHighlight is the entry point for highlighting occurrences of a symbol within a file.\n//\n// Supported symbol types for highlighting are [referenceable] and [reference] (messages, enums,\n// extensions, and their references). All highlights use Text kind.\n// Services, RPC methods, enum values, and field names are not highlighted.\nfunc (s *server) DocumentHighlight(ctx context.Context, params *protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error) {\n\tsymbol := s.getSymbol(ctx, params.TextDocument.URI, params.Position)\n\tif symbol == nil {\n\t\treturn nil, nil\n\t}\n\treturn symbol.DocumentHighlights(), nil\n}\n\n// CodeAction is called when the client requests code actions for a given range.\nfunc (s *server) CodeAction(ctx context.Context, params *protocol.CodeActionParams) ([]protocol.CodeAction, error) {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\treturn nil, nil\n\t}\n\tcodeActionSet := xslices.ToStructMap(params.Context.Only)\n\n\tvar actions []protocol.CodeAction\n\tif _, ok := codeActionSet[protocol.SourceOrganizeImports]; len(codeActionSet) == 0 || ok {\n\t\tif organizeImportsAction := s.getOrganizeImportsCodeAction(ctx, file); organizeImportsAction != nil {\n\t\t\tactions = append(actions, *organizeImportsAction)\n\t\t}\n\t}\n\tif _, ok := codeActionSet[protocol.RefactorRewrite]; len(codeActionSet) == 0 || ok {\n\t\tif deprecateAction := s.getDeprecateCodeAction(ctx, file, params); deprecateAction != nil {\n\t\t\tactions = append(actions, *deprecateAction)\n\t\t}\n\t}\n\tif _, ok := codeActionSet[protocol.QuickFix]; len(codeActionSet) == 0 || ok {\n\t\tlintIgnoreActions := s.getLintIgnoreCodeActions(ctx, file, params)\n\t\tactions = append(actions, lintIgnoreActions...)\n\t}\n\treturn actions, nil\n}\n\n// PrepareRename is the entry point for checking workspace wide renaming of a symbol.\n//\n// If a symbol can be renamed, PrepareRename will return the range for the rename. Returning\n// an empty range indicates that the requested position cannot be renamed and the client\n// will handle providing feedback to the user.\n//\n// Supported symbol types for renaming are [referenceable], [static], and [reference].\nfunc (s *server) PrepareRename(ctx context.Context, params *protocol.PrepareRenameParams) (*protocol.Range, error) {\n\tsymbol := s.getSymbol(ctx, params.TextDocument.URI, params.Position)\n\tif symbol == nil {\n\t\treturn nil, nil\n\t}\n\tswitch symbol.kind.(type) {\n\tcase *referenceable, *static, *reference:\n\t\t// Don't allow renaming symbols defined in non-local files (e.g., WKTs from ~/.cache)\n\t\t// Check the definition if available, otherwise check the symbol's own file\n\t\tdefFile := symbol.file\n\t\tif symbol.def != nil && symbol.def.file != nil {\n\t\t\tdefFile = symbol.def.file\n\t\t}\n\t\tif defFile != nil && !defFile.IsLocal() {\n\t\t\treturn nil, fmt.Errorf(\"cannot rename a symbol in a non-local file\")\n\t\t}\n\t\trnge := reportSpanToProtocolRange(symbol.span)\n\t\treturn &rnge, nil\n\t}\n\treturn nil, nil\n}\n\n// Rename is the entry point for workspace wide renaming of a symbol.\nfunc (s *server) Rename(\n\tctx context.Context,\n\tparams *protocol.RenameParams,\n) (*protocol.WorkspaceEdit, error) {\n\tsymbol := s.getSymbol(ctx, params.TextDocument.URI, params.Position)\n\tif symbol == nil {\n\t\treturn nil, nil\n\t}\n\t// Don't allow renaming symbols defined in non-local files (e.g., WKTs from ~/.cache)\n\t// Check the definition if available, otherwise check the symbol's own file\n\tdefFile := symbol.file\n\tif symbol.def != nil && symbol.def.file != nil {\n\t\tdefFile = symbol.def.file\n\t}\n\tif defFile != nil && !defFile.IsLocal() {\n\t\treturn nil, fmt.Errorf(\"cannot rename a symbol in a non-local file\")\n\t}\n\treturn symbol.Rename(params.NewName)\n}\n\n// FoldingRanges is the entry point for folding ranges, which allows collapsing/expanding blocks of code.\nfunc (s *server) FoldingRanges(\n\tctx context.Context,\n\tparams *protocol.FoldingRangeParams,\n) ([]protocol.FoldingRange, error) {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\treturn nil, nil\n\t}\n\treturn s.foldingRange(file), nil\n}\n\n// DocumentLink is the entry point for document links, which makes imports and URLs clickable.\nfunc (s *server) DocumentLink(\n\tctx context.Context,\n\tparams *protocol.DocumentLinkParams,\n) ([]protocol.DocumentLink, error) {\n\tfile := s.fileManager.Get(params.TextDocument.URI)\n\tif file == nil {\n\t\treturn nil, nil\n\t}\n\treturn s.documentLink(file), nil\n}\n\n// getSymbol is a helper function that gets the *[symbol] for the given [protocol.URI] and\n// [protocol.Position].\nfunc (s *server) getSymbol(\n\tctx context.Context,\n\turi protocol.URI,\n\tposition protocol.Position,\n) *symbol {\n\tfile := s.fileManager.Get(uri)\n\tif file == nil {\n\t\treturn nil\n\t}\n\treturn file.SymbolAt(ctx, position)\n}\n"
  },
  {
    "path": "private/buf/buflsp/symbol.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file defines all of the message handlers that involve symbols.\n//\n// In particular, this file handles semantic information in fileManager that have been\n// *opened by the editor*, and thus do not need references to Buf modules to find.\n// See imports.go for that part of the LSP.\n\npackage buflsp\n\nimport (\n\t\"fmt\"\n\t\"log/slog\"\n\t\"slices\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconnect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/protocompile/experimental/ast\"\n\t\"github.com/bufbuild/protocompile/experimental/ast/predeclared\"\n\t\"github.com/bufbuild/protocompile/experimental/ir\"\n\t\"github.com/bufbuild/protocompile/experimental/source\"\n\t\"github.com/bufbuild/protocompile/experimental/token\"\n\t\"github.com/bufbuild/protocompile/experimental/token/keyword\"\n\t\"go.lsp.dev/protocol\"\n\t\"google.golang.org/protobuf/encoding/protowire\"\n)\n\n// symbol represents a named symbol inside of a [file].\n//\n// For each symbol, we keep track of the location [source.Span] and file [*file] of the\n// actual symbol and the definition symbol, if available.\n//\n// We also keep track of metadata for documentation rendering.\ntype symbol struct {\n\tir ir.Symbol\n\n\tfile    *file\n\tdef     *symbol\n\ttypeDef *symbol // Empty for non-option symbols\n\tspan    source.Span\n\tkind    kind\n}\n\n// kind is used to track the symbol kind and lets us resolve definitions to their symbol.\ntype kind interface {\n\tisSymbolKind()\n}\n\ntype referenceable struct {\n\tast        ast.DeclDef\n\treferences []*symbol\n}\n\ntype reference struct {\n\tdef      ast.DeclDef\n\tfullName ir.FullName\n}\n\ntype option struct {\n\tdef             ast.DeclDef\n\tdefFullName     ir.FullName\n\ttypeDef         ast.DeclDef\n\ttypeDefFullName ir.FullName\n}\n\ntype static struct {\n\tast ast.DeclDef\n}\n\ntype imported struct {\n\tfile *file\n}\n\ntype builtin struct {\n\tpredeclared predeclared.Name\n}\n\ntype tag struct{}\n\nfunc (*referenceable) isSymbolKind() {}\nfunc (*reference) isSymbolKind()     {}\nfunc (*option) isSymbolKind()        {}\nfunc (*static) isSymbolKind()        {}\nfunc (*imported) isSymbolKind()      {}\nfunc (*builtin) isSymbolKind()       {}\nfunc (*tag) isSymbolKind()           {}\n\n// Range constructs an LSP protocol code range for this symbol.\nfunc (s *symbol) Range() protocol.Range {\n\treturn reportSpanToProtocolRange(s.span)\n}\n\n// IsBuiltIn checks if the symbol's type is a predeclared type. Predeclared type will\n// not have a resolved definition symbol and the underlying type AST will be predeclared.\nfunc (s *symbol) IsBuiltIn() bool {\n\t_, ok := s.kind.(*builtin)\n\treturn ok\n}\n\n// Definition returns the location of the definition of the symbol.\nfunc (s *symbol) Definition() protocol.Location {\n\tif imported, ok := s.kind.(*imported); ok {\n\t\treturn protocol.Location{\n\t\t\tURI: imported.file.uri,\n\t\t}\n\t}\n\tif s.def == nil {\n\t\t// The definition does not have a span, so we just jump to the span of the symbol itself\n\t\t// as a fallback.\n\t\treturn protocol.Location{\n\t\t\tURI:   s.file.uri,\n\t\t\tRange: s.Range(),\n\t\t}\n\t}\n\treturn protocol.Location{\n\t\tURI:   s.def.file.uri,\n\t\tRange: s.def.Range(),\n\t}\n}\n\n// TypeDefinition returns the location of the type definition of the symbol.\nfunc (s *symbol) TypeDefinition() protocol.Location {\n\t// For non-option symbols, this is the same as the definition, so we return that.\n\tif _, ok := s.kind.(*option); !ok {\n\t\treturn s.Definition()\n\t}\n\tif s.typeDef == nil {\n\t\t// The type definition does not have a span, so we just jump to the span of the symbol\n\t\t// itself as a fallback.\n\t\treturn protocol.Location{\n\t\t\tURI:   s.file.uri,\n\t\t\tRange: s.Range(),\n\t\t}\n\t}\n\treturn protocol.Location{\n\t\tURI:   s.typeDef.file.uri,\n\t\tRange: s.typeDef.Range(),\n\t}\n}\n\n// References returns the locations of references to the symbol (including the definition), if\n// applicable. Otherwise, it just returns the location of the symbol itself.\n// It also accepts the includeDeclaration param from the client - if true, the declaration\n// of the symbol is included as a reference.\nfunc (s *symbol) References(includeDeclaration bool) []protocol.Location {\n\tvar references []protocol.Location\n\treferenceableKind, ok := s.kind.(*referenceable)\n\tif !ok && s.def != nil {\n\t\t// If the symbol isn't referenceable itself, but has a referenceable definition, use the\n\t\t// definition for the references.\n\t\treferenceableKind, ok = s.def.kind.(*referenceable)\n\t}\n\tif ok {\n\t\tfor _, reference := range referenceableKind.references {\n\t\t\treferences = append(references, protocol.Location{\n\t\t\t\tURI:   reference.file.uri,\n\t\t\t\tRange: reference.Range(),\n\t\t\t})\n\t\t}\n\t} else {\n\t\t// No referenceable kind; add the location of the symbol itself.\n\t\treferences = append(references, protocol.Location{\n\t\t\tURI:   s.file.uri,\n\t\t\tRange: s.Range(),\n\t\t})\n\t}\n\tif includeDeclaration {\n\t\t// Add the definition of the symbol to the list of references.\n\t\tif s.def != nil {\n\t\t\treferences = append(references, protocol.Location{\n\t\t\t\tURI:   s.def.file.uri,\n\t\t\t\tRange: s.def.Range(),\n\t\t\t})\n\t\t}\n\t}\n\treturn references\n}\n\n// DocumentHighlights returns document highlights for the symbol within the current file.\n// This includes the definition (if in the same file) and all references in the same file.\n// All highlights use the [protocol.DocumentHighlightKindText] kind.\nfunc (s *symbol) DocumentHighlights() []protocol.DocumentHighlight {\n\t// Don't highlight static symbols (services, methods, enum values)\n\tif _, ok := s.kind.(*static); ok {\n\t\treturn nil\n\t}\n\n\t// Get the referenceable kind to find all references\n\treferenceableKind, ok := s.kind.(*referenceable)\n\tif !ok && s.def != nil {\n\t\t// If the symbol isn't referenceable itself, but has a referenceable definition, use the\n\t\t// definition for the references.\n\t\treferenceableKind, ok = s.def.kind.(*referenceable)\n\t}\n\tif !ok {\n\t\treturn nil\n\t}\n\n\t// Don't highlight field names. Field names have referenceable kind directly on the symbol,\n\t// whereas field type references have reference kind and reference a referenceable definition.\n\t// Both have ir.SymbolKindField, so we distinguish by checking if s.kind is referenceable.\n\tif _, isRefKind := s.kind.(*referenceable); isRefKind && s.ir.Kind() == ir.SymbolKindField {\n\t\treturn nil\n\t}\n\n\tvar highlights []protocol.DocumentHighlight\n\t// Add all references in the same file\n\tfor _, reference := range referenceableKind.references {\n\t\tif reference.file.uri == s.file.uri {\n\t\t\thighlights = append(highlights, protocol.DocumentHighlight{\n\t\t\t\tRange: reference.Range(),\n\t\t\t\tKind:  protocol.DocumentHighlightKindText,\n\t\t\t})\n\t\t}\n\t}\n\n\t// Add the definition if it's in the same file\n\tif s.def != nil && s.def.file.uri == s.file.uri {\n\t\thighlights = append(highlights, protocol.DocumentHighlight{\n\t\t\tRange: s.def.Range(),\n\t\t\tKind:  protocol.DocumentHighlightKindText,\n\t\t})\n\t} else if s.def == nil {\n\t\t// If there's no separate definition, the symbol itself is the definition\n\t\thighlights = append(highlights, protocol.DocumentHighlight{\n\t\t\tRange: s.Range(),\n\t\t\tKind:  protocol.DocumentHighlightKindText,\n\t\t})\n\t}\n\n\treturn highlights\n}\n\n// LogValue provides the log value for a symbol.\nfunc (s *symbol) LogValue() slog.Value {\n\tif s == nil {\n\t\treturn slog.AnyValue(nil)\n\t}\n\tloc := func(loc source.Location) slog.Value {\n\t\treturn slog.GroupValue(\n\t\t\tslog.Int(\"line\", loc.Line),\n\t\t\tslog.Int(\"column\", loc.Column),\n\t\t)\n\t}\n\tattrs := []slog.Attr{\n\t\tslog.String(\"path\", s.span.Path()),\n\t\tslog.Any(\"start\", loc(s.span.StartLoc())),\n\t\tslog.Any(\"end\", loc(s.span.EndLoc())),\n\t}\n\tif imported, ok := s.kind.(*imported); ok {\n\t\tattrs = append(attrs, slog.String(\"imported\", imported.file.uri.Filename()))\n\t} else if s.def != nil {\n\t\tattrs = append(attrs,\n\t\t\tslog.String(\"uri\", s.def.file.uri.Filename()),\n\t\t\tslog.Any(\"start\", loc(s.span.StartLoc())),\n\t\t\tslog.Any(\"end\", loc(s.span.EndLoc())),\n\t\t)\n\t}\n\treturn slog.GroupValue(attrs...)\n}\n\n// FormatDocs finds appropriate documentation for the given s and constructs a Markdown\n// string for showing to the client.\n//\n// Returns the empty string if no docs are available.\nfunc (s *symbol) FormatDocs() string {\n\tswitch s.kind.(type) {\n\tcase *imported:\n\t\timported, _ := s.kind.(*imported)\n\t\t// Show the path to the file on disk, which is similar to how other LSP clients treat hovering\n\t\t// on an import file.\n\t\treturn imported.file.file.Path()\n\tcase *tag:\n\t\treturn irMemberDoc(s.ir.AsMember())\n\tcase *builtin:\n\t\tbuiltin, _ := s.kind.(*builtin)\n\t\tcomments, ok := builtinDocs[builtin.predeclared.String()]\n\t\tif ok {\n\t\t\t// Use specific anchor for map, generic anchor for other builtins\n\t\t\tanchor := \"field-types\"\n\t\t\tif builtin.predeclared.String() == \"map\" {\n\t\t\t\tanchor = \"maps\"\n\t\t\t}\n\t\t\tcomments = append(\n\t\t\t\tcomments,\n\t\t\t\t\"\",\n\t\t\t\tfmt.Sprintf(\n\t\t\t\t\t\"`%s` is a Protobuf builtin. [Learn more on protobuf.com.](https://protobuf.com/docs/language-spec#%s)\",\n\t\t\t\t\tbuiltin.predeclared,\n\t\t\t\t\tanchor,\n\t\t\t\t),\n\t\t\t)\n\t\t\treturn strings.Join(comments, \"\\n\")\n\t\t}\n\t\treturn \"\"\n\tcase *referenceable, *static, *reference, *option:\n\t\treturn s.getDocsFromComments()\n\t}\n\treturn \"\"\n}\n\n// GetSymbolInformation returns the protocol symbol information for the symbol.\nfunc (s *symbol) GetSymbolInformation() protocol.SymbolInformation {\n\tif s.ir.IsZero() {\n\t\treturn protocol.SymbolInformation{}\n\t}\n\n\tname := s.ir.FullName()\n\tif name == \"\" {\n\t\treturn protocol.SymbolInformation{}\n\t}\n\tparentFullName := name.Parent()\n\tcontainerName := string(parentFullName)\n\n\tlocation := protocol.Location{\n\t\tURI:   s.file.uri,\n\t\tRange: s.Range(),\n\t}\n\n\t// Determine the symbol kind for LSP.\n\tvar kind protocol.SymbolKind\n\tswitch s.ir.Kind() {\n\tcase ir.SymbolKindMessage:\n\t\tkind = protocol.SymbolKindClass // Messages are like classes\n\tcase ir.SymbolKindEnum:\n\t\tkind = protocol.SymbolKindEnum\n\tcase ir.SymbolKindEnumValue:\n\t\tkind = protocol.SymbolKindEnumMember\n\tcase ir.SymbolKindField:\n\t\tkind = protocol.SymbolKindField\n\tcase ir.SymbolKindExtension:\n\t\tkind = protocol.SymbolKindField\n\tcase ir.SymbolKindOneof:\n\t\tkind = protocol.SymbolKindClass // Oneof are like classes\n\tcase ir.SymbolKindService:\n\t\tkind = protocol.SymbolKindInterface // Services are like interfaces\n\tcase ir.SymbolKindMethod:\n\t\tkind = protocol.SymbolKindMethod\n\tcase ir.SymbolKindScalar:\n\t\tkind = protocol.SymbolKindConstant\n\tdefault:\n\t\tkind = protocol.SymbolKindVariable\n\t}\n\tvar isDeprecated bool\n\tif _, ok := s.ir.Deprecated().AsBool(); ok {\n\t\tisDeprecated = true\n\t}\n\treturn protocol.SymbolInformation{\n\t\tName:          string(name),\n\t\tKind:          kind,\n\t\tLocation:      location,\n\t\tContainerName: containerName,\n\t\tDeprecated:    isDeprecated,\n\t\tTags: []protocol.SymbolTag{\n\t\t\tprotocol.SymbolTagDeprecated,\n\t\t},\n\t}\n}\n\n// Rename returns the [protocol.WorkspaceEdit] for renaming the symbol.\nfunc (s *symbol) Rename(newName string) (*protocol.WorkspaceEdit, error) {\n\tvar edits protocol.WorkspaceEdit\n\tswitch s.kind.(type) {\n\tcase *referenceable:\n\t\tif err := checkRenameConflicts(s, newName); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tchanges, err := renameChangesForReferenceableSymbol(s, newName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tedits.Changes = changes\n\tcase *static:\n\t\tif err := checkRenameConflicts(s, newName); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tedits.Changes = map[protocol.DocumentURI][]protocol.TextEdit{\n\t\t\ts.file.uri: {{\n\t\t\t\tRange:   reportSpanToProtocolRange(s.span),\n\t\t\t\tNewText: newName,\n\t\t\t}},\n\t\t}\n\tcase *reference:\n\t\t// For references, we attempt to rename the definition symbol, if resolved. This would\n\t\t// include this reference symbol.\n\t\tif s.def != nil {\n\t\t\tif err := checkRenameConflicts(s.def, newName); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tchanges, err := renameChangesForReferenceableSymbol(s.def, newName)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tedits.Changes = changes\n\t\t}\n\t}\n\t// All other symbol types (options, imports, built-ins, and tags) cannot be renamed.\n\treturn &edits, nil\n}\n\n// renameChangesForReferenceableSymbol is a helper for getting all rename changes for the\n// given referenceable symbol.\nfunc renameChangesForReferenceableSymbol(s *symbol, newName string) (map[protocol.DocumentURI][]protocol.TextEdit, error) {\n\t// At minimum, we would rename the symbol itself.\n\tchanges := map[protocol.DocumentURI][]protocol.TextEdit{\n\t\ts.file.uri: {{\n\t\t\tRange:   reportSpanToProtocolRange(s.span),\n\t\t\tNewText: newName,\n\t\t}},\n\t}\n\t// Get the referenceable kind to find all references\n\treferenceableKind, ok := s.kind.(*referenceable)\n\tif !ok && s.def != nil {\n\t\t// If the symbol isn't referenceable itself, but has a referenceable definition, use the\n\t\t// definition for the references.\n\t\treferenceableKind, ok = s.def.kind.(*referenceable)\n\t}\n\tif ok {\n\t\tfor _, reference := range referenceableKind.references {\n\t\t\tnewText := newName\n\t\t\t// For option references (extension usages), preserve package qualification and parentheses.\n\t\t\t// e.g., if renaming \"(subpkg.testing)\" to \"validated\", result should be \"(subpkg.validated)\"\n\t\t\tif _, isOption := reference.kind.(*option); isOption {\n\t\t\t\tspanText := reference.span.Text()\n\t\t\t\t// Extract components: prefix (opening paren + package), suffix (closing paren)\n\t\t\t\tprefix := \"\"\n\t\t\t\tsuffix := \"\"\n\t\t\t\tnameOnly := spanText\n\n\t\t\t\t// Check for opening parenthesis\n\t\t\t\tif strings.HasPrefix(spanText, \"(\") {\n\t\t\t\t\tprefix = \"(\"\n\t\t\t\t\tnameOnly = nameOnly[1:]\n\t\t\t\t}\n\t\t\t\t// Check for closing parenthesis\n\t\t\t\tif strings.HasSuffix(nameOnly, \")\") {\n\t\t\t\t\tsuffix = \")\"\n\t\t\t\t\tnameOnly = nameOnly[:len(nameOnly)-1]\n\t\t\t\t}\n\t\t\t\t// Check if there's package qualification (contains a dot)\n\t\t\t\tif lastDot := strings.LastIndex(nameOnly, \".\"); lastDot != -1 {\n\t\t\t\t\t// Preserve the package qualification\n\t\t\t\t\tpackageQualification := nameOnly[:lastDot+1]\n\t\t\t\t\tnewText = prefix + packageQualification + newName + suffix\n\t\t\t\t} else {\n\t\t\t\t\t// No package qualification, just preserve parens\n\t\t\t\t\tnewText = prefix + newName + suffix\n\t\t\t\t}\n\t\t\t}\n\t\t\tchanges[reference.file.uri] = append(changes[reference.file.uri], protocol.TextEdit{\n\t\t\t\tRange:   reportSpanToProtocolRange(reference.span),\n\t\t\t\tNewText: newText,\n\t\t\t})\n\t\t}\n\t} else {\n\t\treturn nil, fmt.Errorf(\"attempting to rename a non-referenceble symbol as a referenceable symbol: %v\", s)\n\t}\n\treturn changes, nil\n}\n\n// checkRenameConflicts takes the symbol and desired new name and checks if this conflicts\n// with an existing symbol in the same scope and returns an error if a conflict is found.\nfunc checkRenameConflicts(target *symbol, newName string) error {\n\tparent := target.ir.FullName().Parent()\n\tif parent != \"\" {\n\t\tvar existing source.Span\n\t\tnewFullName := parent.Append(newName)\n\t\tcontainsFunc := func(s *symbol) bool {\n\t\t\texisting = s.span\n\t\t\treturn s.ir.FullName() == newFullName\n\t\t}\n\t\t// We check all files in the workspace for a conflict, since a package can span an arbitrary\n\t\t// number of files.\n\t\t// We first check the current symbol's file.\n\t\tif slices.ContainsFunc(target.file.symbols, containsFunc) {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"Renaming %q to %q would conflict with existing symbol at %s:%d:%d\",\n\t\t\t\ttarget.ir.FullName().Name(),\n\t\t\t\tnewName,\n\t\t\t\ttarget.file.ir.Path(),\n\t\t\t\texisting.StartLoc().Line,\n\t\t\t\texisting.StartLoc().Column,\n\t\t\t)\n\t\t}\n\t\tfor _, file := range target.file.workspace.PathToFile() {\n\t\t\tif slices.ContainsFunc(file.symbols, containsFunc) {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"Renaming %q to %q would conflict with existing symbol at %s:%d:%d\",\n\t\t\t\t\ttarget.ir.FullName().Name(),\n\t\t\t\t\tnewName,\n\t\t\t\t\tfile.ir.Path(),\n\t\t\t\t\texisting.StartLoc().Line,\n\t\t\t\t\texisting.StartLoc().Column,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc protowireTypeForPredeclared(name predeclared.Name) protowire.Type {\n\tswitch name {\n\tcase predeclared.Bool, predeclared.Int32, predeclared.Int64, predeclared.UInt32,\n\t\tpredeclared.UInt64, predeclared.SInt32, predeclared.SInt64:\n\t\treturn protowire.VarintType\n\tcase predeclared.Fixed32, predeclared.SFixed32, predeclared.Float:\n\t\treturn protowire.Fixed32Type\n\tcase predeclared.Fixed64, predeclared.SFixed64, predeclared.Double:\n\t\treturn protowire.Fixed64Type\n\t}\n\treturn protowire.BytesType\n}\n\n// leadingDocComments extracts the leading doc comments immediately preceding def\n// from the token stream and returns them as a trimmed markdown string.\n// Returns \"\" if def is zero, has no leading comments, or if a blank line separates\n// the comments from the definition.\nfunc leadingDocComments(def ast.DeclDef) string {\n\tif def.IsZero() {\n\t\treturn \"\"\n\t}\n\tvar comments []string\n\t// We drop the other side of \"Around\" because we only care about the beginning -- we're\n\t// traversing backwards for leading comments only.\n\ttok, _ := def.Context().Stream().Around(def.Span().Start)\n\tcursor := token.NewCursorAt(tok)\n\t// Count consecutive newlines. If we accumulate 2+ without encountering a comment,\n\t// there's a blank line separating the comments from the symbol.\n\tnewlinesSeen := 0\n\tif tok.Kind() == token.Space {\n\t\tnewlinesSeen = strings.Count(tok.Text(), \"\\n\")\n\t\tif newlinesSeen >= 2 {\n\t\t\treturn \"\"\n\t\t}\n\t}\n\tfor {\n\t\tt := cursor.PrevSkippable()\n\t\tif t.Kind() == token.Comment {\n\t\t\tif isTrailingComment(t) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttext := commentToMarkdown(t.Text()) + \"\\n\"\n\t\t\tnewlinesSeen = 0\n\t\t\tcomments = append(comments, text)\n\t\t} else if t.Kind() == token.Space {\n\t\t\tnewlinesSeen += strings.Count(t.Text(), \"\\n\")\n\t\t\tif newlinesSeen >= 2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tcomments = lineUpComments(comments)\n\tslices.Reverse(comments)\n\tvar docs strings.Builder\n\tfor _, comment := range comments {\n\t\tdocs.WriteString(comment)\n\t}\n\treturn strings.TrimRight(docs.String(), \"\\n\")\n}\n\n// getDocsFromComments is a helper function that gets the doc string from the comments from\n// the definition AST, if available.\n// This helper function expects that imports, tags, and predeclared (builtin) types are\n// already handled, since those types currently do not get docs from their comments.\nfunc (s *symbol) getDocsFromComments() string {\n\tif s.def == nil {\n\t\treturn \"\"\n\t}\n\tvar def ast.DeclDef\n\tswitch s.kind.(type) {\n\tcase *referenceable:\n\t\treferenceable, _ := s.kind.(*referenceable)\n\t\tdef = referenceable.ast\n\tcase *static:\n\t\tstatic, _ := s.kind.(*static)\n\t\tdef = static.ast\n\tcase *reference:\n\t\treference, _ := s.kind.(*reference)\n\t\tdef = reference.def\n\tcase *option:\n\t\toption, _ := s.kind.(*option)\n\t\tdef = option.def\n\t}\n\tif def.IsZero() {\n\t\treturn \"\"\n\t}\n\n\tdocs := leadingDocComments(def)\n\n\t// If the file is a remote dependency, link to BSR docs.\n\tif s.def != nil && s.def.file != nil && !s.def.file.IsLocal() {\n\t\t// In the BSR, messages, enums, and service definitions support anchor tags in the link.\n\t\t// Otherwise, we use the anchor for the parent type.\n\t\tvar hasAnchor, isExtension bool\n\t\tswitch def.Classify() {\n\t\tcase ast.DefKindMessage, ast.DefKindEnum, ast.DefKindService:\n\t\t\thasAnchor = true\n\t\tcase ast.DefKindExtend:\n\t\t\tisExtension = !def.AsExtend().Extendee.IsZero()\n\t\t\thasAnchor = isExtension\n\t\t}\n\n\t\tvar module bufmodule.Module\n\t\tvar bsrHost string\n\t\tif s.def.file.IsWKT() {\n\t\t\tbsrHost = bufconnect.DefaultRemote + \"/protocolbuffers/wellknowntypes\"\n\t\t} else if fileInfo, ok := s.def.file.objectInfo.(bufmodule.FileInfo); ok {\n\t\t\tmodule = fileInfo.Module()\n\t\t\tbsrHost = module.FullName().String()\n\t\t}\n\n\t\tdefFullName := s.def.ir.FullName()\n\t\tif !hasAnchor {\n\t\t\tdefFullName = defFullName.Parent()\n\t\t}\n\t\tbsrAnchor := string(defFullName)\n\t\t// For extensions, we use the anchor for the extensions section in the BSR docs.\n\t\tif isExtension {\n\t\t\tbsrAnchor = \"extensions\"\n\t\t}\n\n\t\tif bsrHost != \"\" {\n\t\t\tpackageName := string(s.def.file.ir.Package())\n\t\t\tvar url string\n\t\t\tif s.def.file.IsWKT() {\n\t\t\t\t// WKT uses special bsrHost format\n\t\t\t\turl = \"https://\" + bsrHost + \"/docs/main:\" + packageName\n\t\t\t\tif bsrAnchor != \"\" {\n\t\t\t\t\turl += \"#\" + bsrAnchor\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Use bsrURL for non-WKT modules\n\t\t\t\turl = bsrURL(module, packageName, bsrAnchor, bsrTabTypeDocs)\n\t\t\t}\n\t\t\tif url != \"\" {\n\t\t\t\tdocs += fmt.Sprintf(\n\t\t\t\t\t\"\\n[`%s` on the Buf Schema Registry](%s)\\n\",\n\t\t\t\t\tdefFullName,\n\t\t\t\t\turl,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn docs\n}\n\n// commentToMarkdown processes comment strings and formats them for markdown display.\nfunc commentToMarkdown(comment string) string {\n\tif after, ok := strings.CutPrefix(comment, \"//\"); ok {\n\t\t// NOTE: We do not trim the space here, because indentation is\n\t\t// significant for Markdown code fences, and if every line\n\t\t// starts with a space, Markdown will trim it for us, even off\n\t\t// of code blocks.\n\t\treturn after\n\t}\n\tif strings.HasPrefix(comment, \"/**\") && !strings.HasPrefix(comment, \"/**/\") {\n\t\t// NOTE: Doxygen-style comments (/** ... */) to Markdown format\n\t\t// by removing comment delimiters and formatting the content.\n\t\t//\n\t\t// Example:\n\t\t// /**\n\t\t//  * This is a Doxygen comment\n\t\t//  * with multiple lines\n\t\t//  */\n\t\tcomment = strings.TrimSuffix(strings.TrimPrefix(comment, \"/**\"), \"*/\")\n\t\tlines := strings.Split(strings.TrimSpace(comment), \"\\n\")\n\t\tfor i, line := range lines {\n\t\t\tline = strings.TrimSpace(line)\n\t\t\tline = strings.TrimPrefix(line, \"*\")\n\t\t\tlines[i] = line\n\t\t}\n\t\treturn strings.Join(lines, \"\\n\")\n\t}\n\t// Handle standard multi-line comments (/* ... */)\n\treturn strings.TrimSuffix(strings.TrimPrefix(comment, \"/*\"), \"*/\")\n}\n\n// lineUpComments is a helper function for lining up the comments for docs, since some users\n// may start their comments with spaces, e.g.\n//\n//\t// Foo is a ...\n//\t//\n//\t// Foo is used for ...\n//\tmessage Foo { ... }\n//\n// vs.\n//\n//\t//Foo is a ...\n//\t//\n//\t//Foo is used for ...\n//\tmessage Foo { ... }\n//\n// When different LSP clients render these docs, they treat leading spaces differently. To\n// help mitigate this, we use the following heuristic to line up the comments:\n//\n// If all lines containing one or more non-space characters all start with a single space\n// character, we trim the space character for each of these lines. Otherwise, do nothing.\nfunc lineUpComments(comments []string) []string {\n\tlinedUp := make([]string, len(comments))\n\tfor i, comment := range comments {\n\t\tif strings.ContainsFunc(comment, func(r rune) bool {\n\t\t\treturn !unicode.IsSpace(r)\n\t\t}) {\n\t\t\t// We are only checking for \" \" and do not count nbsp's.\n\t\t\tif !strings.HasPrefix(comment, \" \") {\n\t\t\t\treturn comments\n\t\t\t}\n\t\t\tlinedUp[i] = strings.TrimPrefix(comment, \" \")\n\t\t} else {\n\t\t\tlinedUp[i] = comment\n\t\t}\n\t}\n\treturn linedUp\n}\n\n// irMemberDoc returns the documentation for a message field, enum value or extension field.\nfunc irMemberDoc(irMember ir.Member) string {\n\tnumber := irMember.Number()\n\tif irMember.IsEnumValue() {\n\t\tvarint := protowire.AppendVarint(nil, uint64(number))\n\t\treturn fmt.Sprintf(\n\t\t\t\"`0x%x`, `0b%b`\\n\\nencoded (hex): `%X` (%d byte%s)\",\n\t\t\tnumber,\n\t\t\tnumber,\n\t\t\tvarint,\n\t\t\tlen(varint),\n\t\t\tplural(len(varint)),\n\t\t)\n\t}\n\n\tvar (\n\t\tbuilder strings.Builder\n\t\tty      protowire.Type\n\t\tpacked  bool\n\t)\n\ttypeAST := irMember.TypeAST()\n\tif irMember.IsGroup() {\n\t\tty = protowire.StartGroupType\n\t} else if typeAST.Kind() == ast.TypeKindPrefixed {\n\t\tprefixed := typeAST.AsPrefixed()\n\t\tprefixedType := prefixed.Type()\n\t\tif prefixedType.Kind() == ast.TypeKindPath {\n\t\t\tty = protowireTypeForPredeclared(prefixedType.AsPath().AsPredeclared())\n\t\t\tif ty != protowire.BytesType {\n\t\t\t\tpacked = prefixed.Prefix() == keyword.Repeated\n\t\t\t}\n\t\t} else {\n\t\t\tty = protowire.BytesType\n\t\t}\n\t} else if typeAST.Kind() == ast.TypeKindPath {\n\t\tty = protowireTypeForPredeclared(typeAST.AsPath().AsPredeclared())\n\t} else {\n\t\t// All other cases, use protowire.BytesType\n\t\tty = protowire.BytesType\n\t}\n\tvarint := protowire.AppendTag(nil, protowire.Number(number), ty)\n\tfmt.Fprintf(\n\t\t&builder,\n\t\t\"encoded (hex): `%X` (%d byte%s)\",\n\t\tvarint, len(varint), plural(len(varint)),\n\t)\n\tif packed {\n\t\tpacked := protowire.AppendTag(nil, protowire.Number(number), protowire.BytesType)\n\t\tfmt.Fprintf(\n\t\t\t&builder,\n\t\t\t\"\\n\\npacked (hex): `%X` (%d byte%s)\",\n\t\t\tpacked, len(packed), plural(len(varint)),\n\t\t)\n\t\treturn builder.String()\n\t}\n\treturn builder.String()\n}\n\nfunc reportSpanToProtocolRange(span source.Span) protocol.Range {\n\tstartLocation := span.File.Location(span.Start, positionalEncoding)\n\tendLocation := span.File.Location(span.End, positionalEncoding)\n\treturn reportLocationsToProtocolRange(startLocation, endLocation)\n}\n\nfunc reportLocationsToProtocolRange(startLocation, endLocation source.Location) protocol.Range {\n\treturn protocol.Range{\n\t\tStart: protocol.Position{\n\t\t\tLine:      uint32(startLocation.Line - 1),\n\t\t\tCharacter: uint32(startLocation.Column - 1),\n\t\t},\n\t\tEnd: protocol.Position{\n\t\t\tLine:      uint32(endLocation.Line - 1),\n\t\t\tCharacter: uint32(endLocation.Column - 1),\n\t\t},\n\t}\n}\n\nfunc plural(i int) string {\n\tif i == 1 {\n\t\treturn \"\"\n\t}\n\treturn \"s\"\n}\n\n// isTrailingComment returns true if the comment has code on the same line before it.\nfunc isTrailingComment(t token.Token) bool {\n\tif t.Kind() != token.Comment {\n\t\treturn false\n\t}\n\tfor c := token.NewCursorAt(t); ; {\n\t\tp := c.PrevSkippable()\n\t\tif p.IsZero() || strings.Contains(p.Text(), \"\\n\") {\n\t\t\treturn false\n\t\t}\n\t\tif p.Kind() != token.Space {\n\t\t\treturn true\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/symbol_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// This file defines all of the message handlers that involve symbols.\n//\n// In particular, this file handles semantic information in fileManager that have been\n// *opened by the editor*, and thus do not need references to Buf modules to find.\n// See imports.go for that part of the LSP.\n\npackage buflsp\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestCommentToMarkdown(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tname     string\n\t\tinput    string\n\t\texpected string\n\t}{\n\t\t{\n\t\t\tname:     \"single-line-comment\",\n\t\t\tinput:    \"// this is a single-line comment\",\n\t\t\texpected: \" this is a single-line comment\",\n\t\t},\n\t\t{\n\t\t\tname: \"multi-line-comment\",\n\t\t\tinput: `/*\n this is a\n multi-line comment\n*/`,\n\t\t\texpected: `\n this is a\n multi-line comment\n`,\n\t\t},\n\t\t{\n\t\t\tname: \"doxygen-style-comment\",\n\t\t\tinput: `/**\n * Documentation comment\n * with asterisks\n */`,\n\t\t\texpected: ` Documentation comment\n with asterisks`,\n\t\t},\n\t\t{\n\t\t\tname: \"doxygen-mixed-indentation\",\n\t\t\tinput: `/**\n * First line\n * - Second line\n *   - Third line\n */`,\n\t\t\texpected: ` First line\n - Second line\n   - Third line`,\n\t\t},\n\t\t{\n\t\t\tname:     \"markdown-emphasis\",\n\t\t\tinput:    \"/*This is *important**/\",\n\t\t\texpected: \"This is *important*\",\n\t\t},\n\t\t{\n\t\t\tname:     \"single-line-doxygen\",\n\t\t\tinput:    \"/** Single line doc comment */\",\n\t\t\texpected: \"Single line doc comment\",\n\t\t},\n\t\t{\n\t\t\tname:     \"empty-comment\",\n\t\t\tinput:    \"/**/\",\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname:     \"only-space\",\n\t\t\tinput:    \"/* */\",\n\t\t\texpected: \" \",\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tassert.Equal(t, test.expected, commentToMarkdown(test.input))\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/completion/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\n  - path: vendor/protovalidate\nlint:\n  use:\n    - STANDARD\n  ignore:\n    - vendor/protovalidate\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/completion/cel_completion.proto",
    "content": "syntax = \"proto3\";\n\npackage test.celcompletion.v1;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// Address is used for testing message-field completions.\nmessage Address {\n  // The city name.\n  string city = 1;\n  // The country code.\n  string country = 2;\n  // The ZIP or postal code.\n  int32 zip_code = 3 [deprecated = true];\n}\n\n// Location wraps Address for testing nested path completions.\nmessage Location {\n  Address address = 1;\n}\n\nmessage CELCompletion {\n  // test_dot: cursor after \"this.\" should yield member completions.\n  string test_dot = 1 [(buf.validate.field).cel = {\n    id: \"test.dot\"\n    expression: \"this.\"\n  }];\n\n  // test_empty: cursor inside \"\" should yield all (global, macro, keyword) completions.\n  string test_empty = 2 [(buf.validate.field).cel = {\n    id: \"test.empty\"\n    expression: \"\"\n  }];\n\n  // test_operator: cursor after \"1 > \" — inside CEL expression after operator.\n  // The `>` operator has mixed-type overloads so type narrowing does not apply.\n  string test_operator = 3 [(buf.validate.field).cel = {\n    id: \"test.operator\"\n    expression: \"1 > \"\n  }];\n\n  // test_eq: cursor after \"true == \" — `==` has a single type-param overload.\n  // With bool left side, expectedType narrows to bool, filtering out int-return functions.\n  bool test_eq = 4 [(buf.validate.field).cel = {\n    id: \"test.eq\"\n    expression: \"true == \"\n  }];\n\n  // test_prefix: cursor at closing `\"` of `\"th\"` — prefix \"th\" filters completions\n  // to only items starting with \"th\", which is \"this\".\n  string test_prefix = 5 [(buf.validate.field).cel = {\n    id: \"test.prefix\"\n    expression: \"th\"\n  }];\n\n  // test_midword: cursor placed mid-token inside a fully written expression.\n  // No completion should be offered since the token is already complete.\n  string test_midword = 6 [(buf.validate.field).cel = {\n    id: \"test.midword\"\n    expression: \"size(this) > 0\"\n  }];\n\n  // test_cel_expr: the cel_expression field is a direct string (not a Rule message).\n  // Cursor after \"this.\" should yield member completions via the alternate extraction path.\n  string test_cel_expr = 7 [(buf.validate.field).cel_expression = \"this.\"];\n\n  // test_msg_dot: cursor after \"this.\" on a message-typed field should yield\n  // the fields of Address as completions.\n  Address test_msg = 8 [(buf.validate.field).cel = {\n    id: \"test.msg.dot\"\n    expression: \"this.\"\n  }];\n\n  // test_not: cursor after \"!\" should narrow completions to bool-returning items.\n  bool test_not = 9 [(buf.validate.field).cel = {\n    id: \"test.not\"\n    expression: \"!\"\n  }];\n\n  // test_nested: cursor at end of \"this.address.ci\" — nested path through a message-typed\n  // field. Prefix \"ci\" should yield only city from Address.\n  Location test_nested = 10 [(buf.validate.field).cel = {\n    id: \"test.nested\"\n    expression: \"this.address.ci\"\n  }];\n\n  // test_has: cursor after \"has(this.\" — inside the has() macro argument.\n  // Should yield Address field completions (city, country, zip_code).\n  Address test_has = 11 [(buf.validate.field).cel = {\n    id: \"test.has\"\n    expression: \"has(this.\"\n  }];\n\n  // test_has_nested: has() with a nested path \"has(this.address.ci\".\n  // Prefix \"ci\" filters to only the city field from Address.\n  Location test_has_nested = 12 [(buf.validate.field).cel = {\n    id: \"test.has.nested\"\n    expression: \"has(this.address.ci\"\n  }];\n\n  // test_now_dot: cursor after \"now.\" — now is protovalidate's Timestamp variable.\n  // Timestamp methods (getFullYear, getHours, etc.) should be offered.\n  string test_now_dot = 13 [(buf.validate.field).cel = {\n    id: \"test.now.dot\"\n    expression: \"now.\"\n  }];\n\n  // test_repeated_dot: cursor after \"this.\" on a repeated Address field.\n  // CEL treats repeated proto fields as lists; list methods should be offered.\n  repeated Address test_repeated = 14 [(buf.validate.field).cel = {\n    id: \"test.repeated.dot\"\n    expression: \"this.\"\n  }];\n\n  // test_map_dot: cursor after \"this.\" on a map<string, string> field.\n  // CEL treats map fields as maps; map methods (e.g. size) should be offered.\n  map<string, string> test_map = 15 [(buf.validate.field).cel = {\n    id: \"test.map.dot\"\n    expression: \"this.\"\n  }];\n}\n\n// CELCompletionMsg exercises message-level CEL rules.\nmessage CELCompletionMsg {\n  option (buf.validate.message).cel = {\n    id: \"test.msg\"\n    expression: \"this.\"\n  };\n  string name = 1;\n}\n\n// CELCompletionIter exercises iteration variable completions in comprehension macros.\nmessage CELCompletionIter {\n  repeated Address items = 1;\n\n  option (buf.validate.message).cel = {\n    id: \"test.iter\"\n    expression: \"this.items.filter(addr, addr.\"\n  };\n}\n\n// Item is used for testing nested comprehension completions.\nmessage Item {\n  string label = 1;\n  repeated Address addresses = 2;\n}\n\n// CELCompletionIterNested exercises nested comprehension iteration variable completions.\n// The inner iter var `addr` is bound to Address elements from `item.addresses`.\nmessage CELCompletionIterNested {\n  repeated Item items = 1;\n\n  option (buf.validate.message).cel = {\n    id: \"test.iter.nested\"\n    expression: \"this.items.filter(item, item.addresses.filter(addr, addr.\"\n  };\n}\n\n// WKTHolder exercises completions on well-known-type fields.\n// Completing `this.` on a google.protobuf.Timestamp field should offer both\n// the proto fields (seconds, nanos) and CEL Timestamp methods (getFullYear, etc.).\nmessage WKTHolder {\n  google.protobuf.Timestamp created_at = 1 [(buf.validate.field).cel = {\n    id: \"wkt.created_at\"\n    expression: \"this.\"\n  }];\n}\n\n// OneofHolder exercises completions on messages that contain oneof fields.\n// Oneof member fields are regular (non-synthetic) members in the proto IR\n// and must appear in `this.` completions.\nmessage OneofHolder {\n  option (buf.validate.message).cel = {\n    id: \"oneof.rule\"\n    expression: \"this.\"\n  };\n\n  oneof payload {\n    string text = 1;\n    int32 code = 2;\n    Address location = 3;\n  }\n}\n\n// RepeatedPathHolder exercises completions when the cursor is after a\n// repeated-field path (e.g. \"this.items.\"). The receiver `this.items` is a\n// list, so list methods and macros should be offered — not Address fields.\nmessage RepeatedPathHolder {\n  repeated Address items = 1;\n\n  option (buf.validate.message).cel = {\n    id: \"repeated.path\"\n    expression: \"this.items.\"\n  };\n}\n\n// IndexAccessHolder exercises completions after bracket-index expressions.\n// - \"this.items[0].\"     → Address fields (list element access)\n// - \"this.locations[\"key\"].\" → Address fields (map value access)\nmessage IndexAccessHolder {\n  repeated Address items = 1;\n  map<string, Address> locations = 2;\n\n  option (buf.validate.message).cel = {\n    id: \"index.list\"\n    expression: \"this.items[0].\"\n  };\n  option (buf.validate.message).cel = {\n    id: \"index.map\"\n    expression: \"this.locations[\\\"key\\\"].\"\n  };\n}\n\n// ChainedComprehensionHolder exercises completions in chained comprehension macros.\n// A filter result is piped into all(); the inner iter var `addr` is bound to\n// Address elements from the outer filter and must yield Address field completions.\nmessage ChainedComprehensionHolder {\n  repeated Address items = 1;\n\n  option (buf.validate.message).cel = {\n    id: \"chained.comp\"\n    expression: \"this.items.filter(item, item.zip_code > 0).all(addr, addr.\"\n  };\n}\n\n// InOperatorHolder verifies that the \"in\" membership operator does not appear\n// as a callable function completion (\"in()\") when typed as a prefix.\n// \"in\" is a binary infix operator (\"value in list\"), not a function call.\nmessage InOperatorHolder {\n  option (buf.validate.message).cel = {\n    id: \"in.operator\"\n    expression: \"in\"\n  };\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/completion/extensions.proto",
    "content": "syntax = \"proto2\";\n\npackage example.options;\n\nimport \"google/protobuf/descriptor.proto\";\n\n// Custom options for testing completions\nextend google.protobuf.FileOptions {\n  optional string custom_file_option = 50001;\n}\n\nextend google.protobuf.MessageOptions {\n  optional string custom_message_option = 50002;\n}\n\nextend google.protobuf.FieldOptions {\n  optional string custom_field_option = 50003;\n  optional FieldRules field = 50009;\n}\n\nextend google.protobuf.OneofOptions {\n  optional string custom_oneof_option = 50004;\n}\n\nextend google.protobuf.EnumOptions {\n  optional string custom_enum_option = 50005;\n}\n\nextend google.protobuf.EnumValueOptions {\n  optional string custom_enum_value_option = 50006;\n}\n\nextend google.protobuf.ServiceOptions {\n  optional string custom_service_option = 50007;\n}\n\nextend google.protobuf.MethodOptions {\n  optional string custom_method_option = 50008;\n}\n\nenum FieldEnum {\n  FIELD_ENUM_UNSPECIFIED = 0;\n  FIELD_ENUM_ONE = 1;\n  FIELD_ENUM_TWO = 2;\n}\n\nmessage FieldRules {\n  optional FieldRules recurse = 1;\n  repeated string strings = 2;\n  optional bool required = 3;\n  optional int64 number = 4;\n  optional FieldEnum enum = 5;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/completion/map_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.v1;\n\nmessage User {\n  string id = 1;\n}\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_INACTIVE = 2;\n}\n\nmessage MapCompletionTest {\n  // Test all map key types: cursor at \"map<\"\n  map<int32, string> field0 = 10;\n\n  // Test map key type completion: cursor at \"map<i\"\n  map<int32, string> field1 = 1;\n\n  // Test map value type completion (builtin): cursor at \"map<int32, s\"\n  map<int32, string> field2 = 2;\n\n  // Test map value type completion (custom): cursor at \"map<string, U\"\n  map<string, User> field3 = 3;\n\n  // Test map key type cannot be enum or message: cursor at \"map<\"\n  map<int32, string> field4 = 4;\n\n  // Test map key type with incomplete field (missing key type): cursor at \"map<\"\n  map<, int32> attributes = 30;\n\n  // Test map value type with incomplete field (missing value type): cursor after \"map<int32, \"\n  map<int32, > attributes2 = 31;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/completion/options_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.options;\n\nimport \"extensions.proto\";\n\noption d = false;\noption (e) = false;\n\n// Test message options\nmessage TestMessage {\n  option d // complete_message_options_builtin: position after 'd'\n  option () // complete_message_options_custom: position after '('\n\n  string test_field = 1 [d] // complete_field_options_builtin: position after 'd'\n  string test_field2 = 2 [()] // complete_field_options_custom: position after '('\n  string test_field = 3 [\n    d // complete_field_options_newline_builtin: position after 'd'\n  ] \n  string test_field2 = 2 [\n    () // complete_field_options_newline_custom: position after '('\n  ]\n}\n\n// Test enum options\nenum TestEnum {\n  option a // complete_enum_options_builtin: position after 'a'\n  option () // complete_enum_options_custom: position after '('\n\n  TEST_VALUE = 0 [d] // complete_enum_value_options_builtin: position after 'd'\n  TEST_VALUE2 = 1 [()] // complete_enum_value_options_custom: position after '('\n}\n\n// Test service and method options\nmessage Empty {}\n\nservice TestService {\n  option d // complete_service_options_builtin: position after 'd'\n  option () // complete_service_options_custom: position after '('\n\n  rpc TestMethod(Empty) returns (Empty) {\n    option i // complete_method_options_builtin: position after 'i'\n    option () // complete_method_options_custom: position after '('\n  }\n}\n\nmessage TestPathCompletion {\n  string test_field = 1 [\n    (example.options.field). // complete_path_field_1\n    (example.options.field).recurse. // complete_path_field_2\n  ]\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/completion/test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.v1;\n\n// complete_builtin_toplevel\nm {}\n\nmessage User {\n  string id = 1;\n  // complete_message_field_modifiers\n  // complete_message_field_types\n}\n\nservice UserService {\n  rpc GetUser(Get) returns (Get); // complete_rpc_request_type, complete_rpc_response_type\n  // complete_builtin_service\n}\n\nmessage GetUserRequest {\n  string user_id = 1;\n}\n\nmessage GetUserResponse {\n  User user = 1;\n}\n\nmessage ReservedFieldTest {\n  reserved 2;\n  reserved 3 to 5;\n  reserved 7 to 10;\n\n  string blah = 1;\n  User user =  // complete_field_number_after_reserved\n}\n\nmessage ReservedFieldTestTwo {\n  reserved 2;\n  reserved 3 to 5;\n  reserved 7 to 10;\n\n  string blah = 1;\n  User user = ; // complete_field_number_after_reserved_with_semicolon\n}\n\nmessage ProtobufReservedRangeTest {\n  reserved 1 to 18999;\n\n  User user = ; // complete_field_number_skips_protobuf_reserved_range\n}\n\nmessage AbsoluteTypeReferenceTest {\n  .goo field_name = 1; // complete_absolute_type_reference\n}\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_NEW =  // complete_enum_number_basic\n}\n\nenum StatusWithGaps {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_PAUSED = 3;\n  STATUS_NEW = ; // complete_enum_number_with_gaps\n}\n\nenum StatusWithReserved {\n  reserved 2;\n  reserved 3 to 5;\n  reserved 7 to 10;\n\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_NEW = ; // complete_enum_number_with_reserved\n}\n\nenum EmptyStatus {\n  STATUS_FIRST = ; // complete_enum_number_empty\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/completion/update_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.v1;\n\nmessage User {\n  string id = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/definition/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\n  - path: vendor/protovalidate\nlint:\n  use:\n    - STANDARD\n  ignore:\n    - vendor/protovalidate\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/definition/cel_definition.proto",
    "content": "syntax = \"proto3\";\n\npackage test.cel.definition.v1;\n\nimport \"buf/validate/validate.proto\";\n\n// TestMessage has a message-level CEL rule where `this` refers to the message.\nmessage TestMessage {\n  option (buf.validate.message).cel = {\n    id: \"test_message.valid\"\n    expression: \"this.name.size() > 0\"\n  };\n\n  string name = 1;\n}\n\n// TestField has a field-level CEL rule where `this` refers to the field.\nmessage TestField {\n  string email = 1 [(buf.validate.field).cel = {\n    id: \"test_field.email.valid\"\n    expression: \"this.contains('@')\"\n  }];\n}\n\n// TestOneofField has a field inside a oneof with a field-level CEL rule.\n// `this` refers to the field itself (the email field inside the oneof).\nmessage TestOneofField {\n  oneof value {\n    string email = 1 [(buf.validate.field).cel = {\n      id: \"test_oneof_field.email\"\n      expression: \"this.contains('@')\"\n    }];\n  }\n}\n\n// TestOneofMessage has a message-level CEL rule accessing a field inside a oneof.\n// `this.name` navigates to the `name` field declared inside the oneof.\nmessage TestOneofMessage {\n  option (buf.validate.message).cel = {\n    id: \"test_oneof_message.valid\"\n    expression: \"this.name.size() > 0\"\n  };\n\n  oneof value {\n    string name = 1;\n    int32 id_num = 2;\n  }\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/definition/definition.proto",
    "content": "syntax = \"proto3\";\n\npackage definition.v1;\n\nimport \"types.proto\";\n\n// Account represents a user account.\nmessage Account {\n  // The account ID.\n  string id = 1;\n\n  // The account type.\n  AccountType type = 2;\n\n  // The account owner.\n  Person owner = 3;\n\n  // The account status.\n  Status status = 4;\n\n  // The creation timestamp.\n  Timestamp created_at = 5;\n\n  // Map of metadata by key.\n  map<string, Person> metadata = 6;\n}\n\n// Person represents an individual.\nmessage Person {\n  // The person's name.\n  string name = 1;\n\n  // The person's email.\n  string email = 2;\n\n  // The person's address.\n  Address address = 3;\n}\n\n// Address represents a physical address.\nmessage Address {\n  // The street address.\n  string street = 1;\n\n  // The city.\n  string city = 2;\n\n  // The country code.\n  CountryCode country = 3;\n}\n\n// AccountType represents the type of account.\nenum AccountType {\n  // The account type is not specified.\n  ACCOUNT_TYPE_UNSPECIFIED = 0;\n\n  // A personal account.\n  ACCOUNT_TYPE_PERSONAL = 1;\n\n  // A business account.\n  ACCOUNT_TYPE_BUSINESS = 2;\n}\n\n// CountryCode represents an ISO country code.\nenum CountryCode {\n  // The country code is not specified.\n  COUNTRY_CODE_UNSPECIFIED = 0;\n\n  // United States.\n  COUNTRY_CODE_US = 1;\n\n  // Canada.\n  COUNTRY_CODE_CA = 2;\n}\n\n// AccountService provides operations for managing accounts.\nservice AccountService {\n  // GetAccount retrieves an account by ID.\n  rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);\n\n  // CreateAccount creates a new account.\n  rpc CreateAccount(CreateAccountRequest) returns (CreateAccountResponse);\n}\n\n// GetAccountRequest is the request for GetAccount.\nmessage GetAccountRequest {\n  // The account ID to retrieve.\n  string account_id = 1;\n}\n\n// GetAccountResponse is the response for GetAccount.\nmessage GetAccountResponse {\n  // The retrieved account.\n  Account account = 1;\n}\n\n// CreateAccountRequest is the request for CreateAccount.\nmessage CreateAccountRequest {\n  // The account to create.\n  Account account = 1;\n\n  // The account type.\n  AccountType type = 2;\n}\n\n// CreateAccountResponse is the response for CreateAccount.\nmessage CreateAccountResponse {\n  // The created account.\n  Account account = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/definition/types.proto",
    "content": "syntax = \"proto3\";\n\npackage definition.v1;\n\n// Status represents the status of an entity.\nenum Status {\n  // The status is not specified.\n  STATUS_UNSPECIFIED = 0;\n\n  // The entity is active.\n  STATUS_ACTIVE = 1;\n\n  // The entity is inactive.\n  STATUS_INACTIVE = 2;\n}\n\n// Timestamp represents a point in time.\nmessage Timestamp {\n  // Seconds since epoch.\n  int64 seconds = 1;\n\n  // Nanoseconds.\n  int32 nanos = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/deprecate/edge_cases_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.deprecate.edge;\n\n// Empty body on single line\nmessage EmptyMessage {}\n\n// Empty body with space\nmessage EmptyWithSpace { }\n\n// Already deprecated\nmessage AlreadyDeprecated {\n  option deprecated = true;\n}\n\n// Deprecated set to false\nmessage DeprecatedFalse {\n  option deprecated = false;\n}\n\n// Has other options\nmessage HasOtherOptions {\n  option (custom_option) = \"value\";\n}\n\n// Nested empty\nmessage OuterWithEmpty {\n  message NestedEmpty {}\n}\n\n// Empty enum\nenum EmptyEnum {\n  EMPTY_ENUM_UNSPECIFIED = 0;\n}\n\n// Enum with multi-line options on value\nenum MultiLineOptions {\n  MULTI_LINE_OPTIONS_UNSPECIFIED = 0;\n  MULTI_LINE_OPTIONS_ONE = 1 [\n    debug_redact = true\n  ];\n}\n\n// Field with multi-line options\nmessage FieldWithMultiLineOptions {\n  string name = 1 [\n    json_name = \"userName\",\n    debug_redact = true\n  ];\n}\n\n// Single-line options (for comparison)\nenum SingleLineOptions {\n  SINGLE_LINE_OPTIONS_UNSPECIFIED = 0;\n  SINGLE_LINE_OPTIONS_ONE = 1 [debug_redact = true];\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/deprecate/message_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.deprecate;\n\nmessage MyMessage {\n  string name = 1;\n  int32 id = 2;\n}\n\nenum MyEnum {\n  MY_ENUM_UNSPECIFIED = 0;\n  MY_ENUM_ONE = 1;\n}\n\nservice MyService {\n  rpc GetMessage(MyMessage) returns (MyMessage);\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/deprecate/nested_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.deprecate.nested;\n\nmessage Outer {\n  string outer_field = 1;\n\n  message Inner {\n    string inner_field = 1;\n\n    enum NestedEnum {\n      NESTED_ENUM_UNSPECIFIED = 0;\n    }\n  }\n\n  enum OuterEnum {\n    OUTER_ENUM_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/diagnostics/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - STANDARD\n  except:\n    - PACKAGE_DIRECTORY_MATCH\n"
  },
  {
    "path": "private/buf/buflsp/testdata/diagnostics/syntax_error.proto",
    "content": "syntax = \"proto3\";\n\npackage diagnostics.v1;\n\n// This file has a syntax error for testing diagnostics\nmessage TestMessage {\n  string name = 1\n  // Missing semicolon above\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/diagnostics/unresolved_import.proto",
    "content": "syntax = \"proto3\";\n\npackage diagnostics.v1;\n\n// This import points to a file that doesn't exist - should trigger unresolved import diagnostic\nimport \"does/not/exist.proto\";\n\nmessage TestMessage {\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/diagnostics/unused_import.proto",
    "content": "syntax = \"proto3\";\n\npackage diagnostics.v1;\n\nimport \"google/protobuf/timestamp.proto\";\n\n// timestamp is imported but not used - should trigger unused import diagnostic\nmessage TestMessage {\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/diagnostics/valid.proto",
    "content": "syntax = \"proto3\";\n\npackage diagnostics.v1;\n\n// A valid proto file with no issues\nmessage TestMessage {\n  string name = 1;\n  int32 age = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/document_highlight/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\n"
  },
  {
    "path": "private/buf/buflsp/testdata/document_highlight/highlight.proto",
    "content": "syntax = \"proto3\";\n\npackage highlight.v1;\n\nimport \"types.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Product {\n  string id = 1;\n  string name = 2;\n  Category category = 3;\n  repeated Product related = 4;\n}\n\nmessage Catalog {\n  string title = 1;\n  repeated Product products = 2;\n  Category default_category = 3;\n}\n\nservice ProductService {\n  rpc GetProduct(GetProductRequest) returns (GetProductResponse);\n  rpc ListProducts(ListProductsRequest) returns (ListProductsResponse);\n  rpc StreamProducts(stream StreamProductsRequest) returns (stream StreamProductsResponse);\n  rpc UploadProducts(stream UploadProductsRequest) returns (UploadProductsResponse);\n  rpc DownloadProducts(DownloadProductsRequest) returns (stream DownloadProductsResponse);\n}\n\nmessage GetProductRequest {\n  string product_id = 1;\n}\n\nmessage GetProductResponse {\n  Product product = 1;\n}\n\nmessage ListProductsRequest {\n  string catalog_name = 1;\n}\n\nmessage ListProductsResponse {\n  repeated Product products = 1;\n}\n\nmessage StreamProductsRequest {\n  string query = 1;\n}\n\nmessage StreamProductsResponse {\n  Product product = 1;\n}\n\nmessage UploadProductsRequest {\n  Product product = 1;\n}\n\nmessage UploadProductsResponse {\n  int32 uploaded_count = 1;\n}\n\nmessage DownloadProductsRequest {\n  string filter = 1;\n}\n\nmessage DownloadProductsResponse {\n  Product product = 1;\n}\n\nmessage Order {\n  message Item {\n    string product_id = 1;\n    int32 quantity = 2;\n  }\n  repeated Item items = 1;\n  enum Status {\n    STATUS_UNSPECIFIED = 0;\n    STATUS_PENDING = 1;\n    STATUS_SHIPPED = 2;\n  }\n  Status status = 2;\n  oneof payment {\n    string credit_card = 3;\n    string paypal_email = 4;\n  }\n}\n\nmessage Outer {\n  message Inner {\n    string title = 1;\n  }\n  message Container {\n    Inner inner = 1;\n  }\n  Container data = 1;\n}\n\nextend google.protobuf.MessageOptions {\n  optional string custom_message_option = 50001;\n}\n\nmessage WithExtension {\n  option (custom_message_option) = \"test\";\n  string field = 1;\n}\n\nmessage Metadata {\n  string key = 1;\n  string value = 2;\n}\n\nmessage FullyQualifiedReferenceTest {\n  Metadata short_reference = 1;\n  highlight.v1.Metadata qualified_reference = 2;\n}\n\nmessage MapFieldsTest {\n  map<string, int32> attributes = 1;\n  map<string, Product> product_map = 2;\n  map<int32, Metadata> metadata_by_id = 3;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/document_highlight/types.proto",
    "content": "syntax = \"proto3\";\n\npackage highlight.v1;\n\nenum Category {\n  CATEGORY_UNSPECIFIED = 0;\n  CATEGORY_ELECTRONICS = 1;\n  CATEGORY_BOOKS = 2;\n}\n\nmessage Metadata {\n  string key = 1;\n  string value = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/document_link/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\n"
  },
  {
    "path": "private/buf/buflsp/testdata/document_link/main.proto",
    "content": "syntax = \"proto3\";\n\npackage document_link.v1;\n\nimport \"types.proto\";\n\n// Request message for the API.\n// See https://example.com/docs for more info.\n// Also check https://github.com/example/repo for source code.\nmessage Request {\n  string id = 1;\n  Status status = 2; // Field status - see https://example.com/status\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/document_link/types.proto",
    "content": "syntax = \"proto3\";\n\npackage document_link.v1;\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_INACTIVE = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/document_link/wkt.proto",
    "content": "syntax = \"proto3\";\n\npackage document_link.v1;\n\nimport \"google/protobuf/timestamp.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Event {\n  google.protobuf.Timestamp created_at = 1;\n  google.protobuf.Duration timeout = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/buf.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/comments.proto",
    "content": "syntax = \"proto3\";\n\npackage folding.v1;\n\n// Single-line comment (should not be foldable)\n\n// Multi-line comment block 1\n// that spans multiple lines\n// and should be foldable\n\nmessage CommentTest {\n  string name = 1; // Inline comment (not foldable)\n}\n\n// Another multi-line comment\n// with consecutive lines\n// should be foldable too\n\nmessage AnotherMessage {\n  // Comment inside message\n  // also multi-line\n  // should fold\n  string field = 1;\n}\n\n// Separated comments\n\n// Should not group together\n\nmessage SeparatedComments {\n  string field = 1;\n}\n\n// Large comment block\n// Line 1\n// Line 2\n// Line 3\n// Line 4\n// Line 5\n// Line 6\n// Line 7\n// Line 8\n// Line 9\n// Line 10\n\nmessage LargeCommentBlock {\n  string field = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/extensions.proto",
    "content": "syntax = \"proto2\";\n\npackage folding.v1;\n\n// Base message with extension range\nmessage User {\n  optional string id = 1;\n  optional string name = 2;\n  extensions 100 to 199;\n}\n\n// Extend block with a message that has nested content\nextend User {\n  optional UserMetadata metadata = 100;\n  optional Preferences preferences = 101;\n}\n\n// Message used in extension with nested message\nmessage UserMetadata {\n  optional string created_by = 1;\n  optional int64 created_at = 2;\n\n  // Nested message inside extension message\n  message AuditInfo {\n    optional string ip_address = 1;\n    optional string user_agent = 2;\n    optional string location = 3;\n  }\n\n  optional AuditInfo audit = 3;\n}\n\n// Another message for extension\nmessage Preferences {\n  optional string theme = 1;\n  optional string language = 2;\n}\n\n// Multi-line field with options in proto2\nmessage Settings {\n  optional string api_key = 1 [\n    deprecated = true,\n    default = \"default_key\"\n  ];\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/folding.proto",
    "content": "syntax = \"proto3\";\n\npackage folding.v1;\n\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/empty.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// This is a multi-line comment\n// that should be foldable.\n// It spans several lines.\nmessage User {\n  string id = 1;\n  string name = 2;\n  string email = 3;\n}\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_INACTIVE = 2;\n}\n\nservice UserService {\n  rpc GetUser(GetUserRequest) returns (GetUserResponse);\n  rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);\n\n  // Multi-line RPC with options\n  rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) {\n    option deprecated = true;\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\nmessage GetUserRequest {\n  string user_id = 1;\n}\n\nmessage GetUserResponse {\n  User user = 1;\n}\n\nmessage CreateUserRequest {\n  string name = 1;\n  string email = 2;\n}\n\nmessage CreateUserResponse {\n  User user = 1;\n}\n\nmessage UpdateUserRequest {\n  User user = 1;\n}\n\nmessage UpdateUserResponse {\n  User user = 1;\n}\n\n// Message with multi-line message-level options\nmessage Config {\n  option deprecated = true;\n\n  string name = 1;\n  int32 value = 2;\n}\n\nmessage Repository {\n  string commit_id = 1 [\n    deprecated = true,\n    json_name = \"commitId\"\n  ];\n\n  string branch = 2 [deprecated = true];\n}\n\nmessage Profile {\n  oneof contact {\n    string email = 1;\n    string phone = 2;\n  }\n\n  // Nested message for testing\n  message Address {\n    string street = 1;\n    string city = 2;\n    string country = 3;\n  }\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/imports.proto",
    "content": "syntax = \"proto3\";\n\npackage folding.v1;\n\n// First group of imports (should be foldable)\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/empty.proto\";\n\n// Second group separated by blank line (should be foldable)\nimport \"google/protobuf/timestamp.proto\";\nimport \"google/protobuf/wrappers.proto\";\n\n\n// Third group separated by 2+ blank lines (should be separate)\nimport \"google/protobuf/struct.proto\";\nimport \"google/protobuf/field_mask.proto\";\n\n// Single import (should not be foldable)\nimport \"google/protobuf/type.proto\";\n\nmessage ImportTest {\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/minimal.proto",
    "content": "syntax = \"proto3\";\n\npackage folding.v1;\n\n// Single-line comment that should not be foldable\nmessage Simple {\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/nested.proto",
    "content": "syntax = \"proto3\";\n\npackage folding.v1;\n\n// Deeply nested message structure\nmessage Level1 {\n  string name = 1;\n\n  message Level2 {\n    string name = 1;\n\n    message Level3 {\n      string name = 1;\n\n      message Level4 {\n        string name = 1;\n        int32 value = 2;\n      }\n\n      Level4 deeply_nested = 2;\n    }\n\n    Level3 nested = 2;\n  }\n\n  Level2 nested = 2;\n}\n\n// Message with complex oneof\nmessage ComplexOneof {\n  oneof payment_method {\n    string credit_card = 1;\n    string debit_card = 2;\n    string paypal = 3;\n    string bitcoin = 4;\n    string bank_transfer = 5;\n    string cash = 6;\n    string check = 7;\n    string wire_transfer = 8;\n  }\n}\n\n// Nested oneofs\nmessage NestedOneofs {\n  message Address {\n    oneof location_type {\n      string home = 1;\n      string work = 2;\n      string other = 3;\n    }\n    string street = 4;\n  }\n\n  oneof contact {\n    string email = 1;\n    string phone = 2;\n    Address address = 3;\n  }\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/folding_range/options.proto",
    "content": "syntax = \"proto3\";\n\npackage folding.v1;\n\n// Message with multi-line field options\nmessage FieldOptions {\n  // Field with many options\n  string field1 = 1 [\n    json_name = \"field1\",\n    deprecated = true\n  ];\n\n  // Field with single-line options (not foldable)\n  string field2 = 2 [json_name = \"field2\"];\n\n  // Field with deeply nested options\n  string field3 = 3 [\n    json_name = \"field3\",\n    deprecated = false\n  ];\n}\n\n// Enum with options\nenum Status {\n  option allow_alias = true;\n\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1 [deprecated = true];\n  STATUS_INACTIVE = 2;\n  STATUS_UNKNOWN = 0;  // Alias due to allow_alias\n}\n\n// Service with method options\nservice OptionsService {\n  rpc Method1(Request) returns (Response) {\n    option deprecated = true;\n  }\n\n  rpc Method2(Request) returns (Response) {\n    option idempotency_level = IDEMPOTENT;\n    option deprecated = false;\n  }\n}\n\nmessage Request {\n  string query = 1;\n}\n\nmessage Response {\n  string result = 1;\n}\n\n// Multiple options on same message\nmessage MultiOptions {\n  string field1 = 1 [\n    json_name = \"f1\",\n    deprecated = true\n  ];\n\n  string field2 = 2 [\n    json_name = \"f2\",\n    deprecated = false\n  ];\n\n  string field3 = 3 [\n    json_name = \"f3\"\n  ];\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/format/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/format/formatted.proto",
    "content": "syntax = \"proto3\";\n\npackage example.v1;\n\nmessage Product {\n  string name = 1;\n  uint32 price = 2;\n  repeated string tags = 3;\n}\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_ACTIVE = 1;\n  STATUS_INACTIVE = 2;\n}\n\nservice ProductService {\n  rpc GetProduct(GetProductRequest) returns (GetProductResponse);\n  rpc ListProducts(ListProductsRequest) returns (ListProductsResponse);\n}\n\nmessage GetProductRequest {\n  string id = 1;\n}\n\nmessage GetProductResponse {\n  Product product = 1;\n}\n\nmessage ListProductsRequest {\n  uint32 page_size = 1;\n  string page_token = 2;\n}\n\nmessage ListProductsResponse {\n  repeated Product products = 1;\n  string next_page_token = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/format/unformatted.proto",
    "content": "syntax = \"proto3\";\n\npackage example.v1;\n\n\nmessage Product {\n    string name = 1;\n       uint32 price = 2;\n  repeated string tags = 3;\n}\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n    STATUS_ACTIVE = 1;\n      STATUS_INACTIVE = 2;\n}\n\nservice ProductService {\n    rpc GetProduct(GetProductRequest) returns (GetProductResponse);\n  rpc ListProducts(ListProductsRequest) returns   (ListProductsResponse);\n}\n\nmessage GetProductRequest {\n      string id = 1;\n}\n\nmessage GetProductResponse{\n  Product product = 1;\n}\n\nmessage ListProductsRequest {\n    uint32 page_size = 1;\n  string page_token = 2;\n}\n\nmessage ListProductsResponse {\nrepeated Product products = 1;\n    string next_page_token = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/hover/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\n  - path: vendor/protovalidate\nlint:\n  use:\n    - STANDARD\n  ignore:\n    - vendor/protovalidate\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/hover/cel_comprehensive.proto",
    "content": "syntax = \"proto3\";\n\npackage test.cel.v1;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Address {\n  string city = 1;\n  string state = 2;\n  optional string zip = 3; // Optional field for testing has() macro\n}\n\n// Comprehensive CEL test coverage for hover\nmessage CELTest {\n  // Keywords\n  string test_this = 1 [(buf.validate.field).cel = {\n    id: \"test.this\"\n    expression: \"this != ''\"\n  }];\n\n  bool test_true = 2 [(buf.validate.field).cel = {\n    id: \"test.true\"\n    expression: \"this == true\"\n  }];\n\n  bool test_false = 3 [(buf.validate.field).cel = {\n    id: \"test.false\"\n    expression: \"this != false\"\n  }];\n\n  optional string test_null = 4 [(buf.validate.field).cel = {\n    id: \"test.null\"\n    expression: \"true ? this != '' : null != null\"\n  }];\n\n  // Operators - Logical\n  bool test_and = 10 [(buf.validate.field).cel = {\n    id: \"test.and\"\n    expression: \"this && true\"\n  }];\n\n  bool test_or = 11 [(buf.validate.field).cel = {\n    id: \"test.or\"\n    expression: \"this || false\"\n  }];\n\n  bool test_not = 12 [(buf.validate.field).cel = {\n    id: \"test.not\"\n    expression: \"!this\"\n  }];\n\n  // Operators - Comparison\n  int32 test_eq = 20 [(buf.validate.field).cel = {\n    id: \"test.eq\"\n    expression: \"this == 5\"\n  }];\n\n  int32 test_ne = 21 [(buf.validate.field).cel = {\n    id: \"test.ne\"\n    expression: \"this != 0\"\n  }];\n\n  int32 test_lt = 22 [(buf.validate.field).cel = {\n    id: \"test.lt\"\n    expression: \"this < 10\"\n  }];\n\n  int32 test_gt = 23 [(buf.validate.field).cel = {\n    id: \"test.gt\"\n    expression: \"this > 0\"\n  }];\n\n  int32 test_le = 24 [(buf.validate.field).cel = {\n    id: \"test.le\"\n    expression: \"this <= 10\"\n  }];\n\n  int32 test_ge = 25 [(buf.validate.field).cel = {\n    id: \"test.ge\"\n    expression: \"this >= 0\"\n  }];\n\n  // Operators - Arithmetic\n  int32 test_add = 30 [(buf.validate.field).cel = {\n    id: \"test.add\"\n    expression: \"this + 1 > 0\"\n  }];\n\n  int32 test_sub = 31 [(buf.validate.field).cel = {\n    id: \"test.sub\"\n    expression: \"this - 1 >= 0\"\n  }];\n\n  int32 test_mul = 32 [(buf.validate.field).cel = {\n    id: \"test.mul\"\n    expression: \"this * 2 > 0\"\n  }];\n\n  int32 test_div = 33 [(buf.validate.field).cel = {\n    id: \"test.div\"\n    expression: \"this / 2 > 0\"\n  }];\n\n  int32 test_mod = 34 [(buf.validate.field).cel = {\n    id: \"test.mod\"\n    expression: \"this % 2 == 0\"\n  }];\n\n  // String functions\n  string test_contains = 50 [(buf.validate.field).cel = {\n    id: \"test.contains\"\n    expression: \"this.contains('test')\"\n  }];\n\n  string test_starts_with = 51 [(buf.validate.field).cel = {\n    id: \"test.startsWith\"\n    expression: \"this.startsWith('prefix')\"\n  }];\n\n  string test_ends_with = 52 [(buf.validate.field).cel = {\n    id: \"test.endsWith\"\n    expression: \"this.endsWith('suffix')\"\n  }];\n\n  string test_matches = 53 [(buf.validate.field).cel = {\n    id: \"test.matches\"\n    expression: \"this.matches('[a-z]+')\"\n  }];\n\n  // Collection functions\n  repeated string test_size = 60 [(buf.validate.field).cel = {\n    id: \"test.size\"\n    expression: \"this.size() > 0\"\n  }];\n\n  repeated string test_in = 61 [(buf.validate.field).cel = {\n    id: \"test.in\"\n    expression: \"'value' in this\"\n  }];\n\n  // Type conversion functions\n  string test_int = 70 [(buf.validate.field).cel = {\n    id: \"test.int\"\n    expression: \"int(this) > 0\"\n  }];\n\n  string test_uint = 71 [(buf.validate.field).cel = {\n    id: \"test.uint\"\n    expression: \"uint(this) > 0u\"\n  }];\n\n  int32 test_double = 72 [(buf.validate.field).cel = {\n    id: \"test.double\"\n    expression: \"double(this) > 0.0\"\n  }];\n\n  int32 test_string = 73 [(buf.validate.field).cel = {\n    id: \"test.string\"\n    expression: \"string(this) != ''\"\n  }];\n\n  string test_bytes = 74 [(buf.validate.field).cel = {\n    id: \"test.bytes\"\n    expression: \"bytes(this).size() > 0\"\n  }];\n\n  string test_timestamp = 75 [(buf.validate.field).cel = {\n    id: \"test.timestamp\"\n    expression: \"timestamp(this).getFullYear() > 2020\"\n  }];\n\n  string test_duration = 76 [(buf.validate.field).cel = {\n    id: \"test.duration\"\n    expression: \"duration(this).getSeconds() > 0\"\n  }];\n\n  string test_type = 77 [(buf.validate.field).cel = {\n    id: \"test.type\"\n    expression: \"type(this) == string\"\n  }];\n\n  string test_dyn = 78 [(buf.validate.field).cel = {\n    id: \"test.dyn\"\n    expression: \"dyn(this) != null\"\n  }];\n\n  // Timestamp functions\n  google.protobuf.Timestamp test_get_full_year = 80 [(buf.validate.field).cel = {\n    id: \"test.getFullYear\"\n    expression: \"this.getFullYear() > 2020\"\n  }];\n\n  google.protobuf.Timestamp test_get_month = 81 [(buf.validate.field).cel = {\n    id: \"test.getMonth\"\n    expression: \"this.getMonth() >= 0\"\n  }];\n\n  google.protobuf.Timestamp test_get_date = 82 [(buf.validate.field).cel = {\n    id: \"test.getDate\"\n    expression: \"this.getDate() > 0\"\n  }];\n\n  google.protobuf.Timestamp test_get_hours = 83 [(buf.validate.field).cel = {\n    id: \"test.getHours\"\n    expression: \"this.getHours() >= 0\"\n  }];\n\n  google.protobuf.Timestamp test_get_minutes = 84 [(buf.validate.field).cel = {\n    id: \"test.getMinutes\"\n    expression: \"this.getMinutes() >= 0\"\n  }];\n\n  google.protobuf.Timestamp test_get_seconds = 85 [(buf.validate.field).cel = {\n    id: \"test.getSeconds\"\n    expression: \"this.getSeconds() >= 0\"\n  }];\n\n  google.protobuf.Timestamp test_get_day_of_week = 86 [(buf.validate.field).cel = {\n    id: \"test.getDayOfWeek\"\n    expression: \"this.getDayOfWeek() >= 0\"\n  }];\n\n  // Duration functions\n  google.protobuf.Duration test_duration_get_seconds = 90 [(buf.validate.field).cel = {\n    id: \"test.duration.getSeconds\"\n    expression: \"this.getSeconds() > 0\"\n  }];\n\n  // Macros\n  Address test_has = 100 [(buf.validate.field).cel = {\n    id: \"test.has\"\n    expression: \"has(this.zip)\"\n  }];\n\n  repeated int32 test_all = 101 [(buf.validate.field).cel = {\n    id: \"test.all\"\n    expression: \"this.all(x, x > 0)\"\n  }];\n\n  repeated int32 test_exists = 102 [(buf.validate.field).cel = {\n    id: \"test.exists\"\n    expression: \"this.exists(x, x == 5)\"\n  }];\n\n  repeated int32 test_exists_one = 103 [(buf.validate.field).cel = {\n    id: \"test.exists_one\"\n    expression: \"this.exists_one(x, x == 5)\"\n  }];\n\n  repeated int32 test_map = 104 [(buf.validate.field).cel = {\n    id: \"test.map\"\n    expression: \"this.map(x, x * 2).size() > 0\"\n  }];\n\n  repeated int32 test_filter = 105 [(buf.validate.field).cel = {\n    id: \"test.filter\"\n    expression: \"this.filter(x, x > 0).size() > 0\"\n  }];\n\n  // Protovalidate extension functions\n  string test_is_email = 110 [(buf.validate.field).cel = {\n    id: \"test.isEmail\"\n    expression: \"this.isEmail()\"\n  }];\n\n  string test_is_hostname = 111 [(buf.validate.field).cel = {\n    id: \"test.isHostname\"\n    expression: \"this.isHostname()\"\n  }];\n\n  string test_is_ip = 112 [(buf.validate.field).cel = {\n    id: \"test.isIp\"\n    expression: \"this.isIp()\"\n  }];\n\n  string test_is_ip_prefix = 113 [(buf.validate.field).cel = {\n    id: \"test.isIpPrefix\"\n    expression: \"this.isIpPrefix()\"\n  }];\n\n  string test_is_uri = 114 [(buf.validate.field).cel = {\n    id: \"test.isUri\"\n    expression: \"this.isUri()\"\n  }];\n\n  string test_is_uri_ref = 115 [(buf.validate.field).cel = {\n    id: \"test.isUriRef\"\n    expression: \"this.isUriRef()\"\n  }];\n\n  string test_is_host_and_port = 116 [(buf.validate.field).cel = {\n    id: \"test.isHostAndPort\"\n    expression: \"this.isHostAndPort(true)\"\n  }];\n\n  // Field access\n  Address test_field_access = 120 [(buf.validate.field).cel = {\n    id: \"test.field_access\"\n    expression: \"this.city != ''\"\n  }];\n\n  // Literals\n  string test_string_literal = 130 [(buf.validate.field).cel = {\n    id: \"test.string_literal\"\n    expression: \"this == 'literal'\"\n  }];\n\n  int32 test_int_literal = 131 [(buf.validate.field).cel = {\n    id: \"test.int_literal\"\n    expression: \"this == 42\"\n  }];\n\n  double test_double_literal = 132 [(buf.validate.field).cel = {\n    id: \"test.double_literal\"\n    expression: \"this == 3.14\"\n  }];\n\n  bool test_bool_literal = 133 [(buf.validate.field).cel = {\n    id: \"test.bool_literal\"\n    expression: \"this == true\"\n  }];\n\n  // Comprehension variables\n  repeated int32 test_comp_var = 140 [(buf.validate.field).cel = {\n    id: \"test.comp_var\"\n    expression: \"this.all(item, item > 0)\"\n  }];\n\n  // Unicode test: emoji occupy 2 UTF-16 code units but 1 rune each.\n  // Hover targets after the emoji verify correct rune→byte offset conversion.\n  string test_unicode = 200 [(buf.validate.field).cel = {\n    id: \"test.unicode\"\n    expression: \"'🎉😀' == this\"\n  }];\n\n  // Unicode test: CJK characters are 3 UTF-8 bytes but 1 UTF-16 code unit and 1 rune.\n  // Different from emoji (4 bytes, 2 UTF-16) — exercises a third point in the\n  // UTF-8/UTF-16/rune space.\n  string test_unicode_cjk = 201 [(buf.validate.field).cel = {\n    id: \"test.unicode_cjk\"\n    expression: \"'中文' == this\"\n  }];\n\n  // Unicode test: mixed emoji and CJK in one expression exercises offset\n  // handling when different multi-byte character widths are interleaved.\n  string test_unicode_mixed = 202 [(buf.validate.field).cel = {\n    id: \"test.unicode_mixed\"\n    expression: \"'🎉中' == this\"\n  }];\n\n  // Multi-line CEL expression: proto adjacent string literals are concatenated,\n  // producing a span that crosses two file lines. Tests the multi-literal walk in createCELSpan.\n  string test_multiline = 203 [(buf.validate.field).cel = {\n    id: \"test.multiline\"\n    expression: \"this.size() > 0\"\n                \" && this != ''\"\n  }];\n\n  // Escape-sequence test: proto \\n occupies 2 source bytes but is a single\n  // byte in the decoded CEL expression string. A single-byte token immediately\n  // after the escape is at the wrong offset without escape-aware offset handling,\n  // causing hover to land in whitespace and return nil.\n  bool test_escape = 204 [(buf.validate.field).cel = {\n    id: \"test.escape\"\n    expression: \"true\\n? this : false\"\n  }];\n\n  // Protovalidate `now` variable (timestamp comparison)\n  google.protobuf.Timestamp test_now = 205 [(buf.validate.field).cel = {\n    id: \"test.now\"\n    expression: \"this < now\"\n  }];\n\n  // Protovalidate double extension functions\n  double test_isnan = 206 [(buf.validate.field).cel = {\n    id: \"test.isnan\"\n    expression: \"this.isNan()\"\n  }];\n\n  double test_isinf = 207 [(buf.validate.field).cel = {\n    id: \"test.isinf\"\n    expression: \"this.isInf()\"\n  }];\n\n  // Protovalidate list extension function\n  repeated double test_unique = 208 [(buf.validate.field).cel = {\n    id: \"test.unique\"\n    expression: \"this.unique()\"\n  }];\n}\n\n// Message-level CEL validation test\nmessage CELMessageTest {\n  string name = 1;\n  int32 value = 2;\n\n  option (buf.validate.message).cel = {\n    id: \"cel_message_test.rule\"\n    expression: \"this.name != '' && this.value > 0\"\n  };\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/hover/test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.v1;\n\n// User represents a user in the system.\n// This is a multi-line comment that provides\n// detailed information about the User message.\nmessage User {\n  // The unique identifier for the user.\n  string id = 1;\n\n  // The user's email address.\n  string email = 2;\n\n  // The user's current status.\n  Status status = 3;\n}\n\n// Status represents the current state of a user.\nenum Status {\n  // The status is not specified.\n  STATUS_UNSPECIFIED = 0;\n\n  // The user is active.\n  STATUS_ACTIVE = 1;\n\n  // The user is inactive.\n  STATUS_INACTIVE = 2;\n}\n\n// UserService provides operations for managing users.\nservice UserService {\n  // GetUser retrieves a user by their ID.\n  rpc GetUser(GetUserRequest) returns (GetUserResponse);\n\n  // DeleteUser deletes a user by their ID.\n  rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) {\n    option deprecated = true;\n  }\n}\n\n// GetUserRequest is the request message for GetUser.\nmessage GetUserRequest {\n  // The ID of the user to retrieve.\n  string user_id = 1;\n}\n\n// GetUserResponse is the response message for GetUser.\nmessage GetUserResponse {\n  // The retrieved user.\n  User user = 1;\n}\n\n// DeleteUserRequest is the request message for DeleteUser.\nmessage DeleteUserRequest {\n  // The ID of the user to delete.\n  string user_id = 1;\n}\n\n// DeleteUserResponse is the response message for DeleteUser.\nmessage DeleteUserResponse {\n  // Whether the deletion was successful.\n  bool success = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/hover/unused_import.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/cpp_features.proto\"; // unused import\n\nmessage TestTopLevel {\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/hover/unused_import_no_blank_line.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/cpp_features.proto\"; // unused import\nmessage TestTopLevel {}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/already_ignored_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.lint_ignore;\n\nmessage TestMessage {\n  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  string BadFieldName = 1; // This field already has an ignore comment\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/different_rule_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.lint_ignore;\n\nmessage TestMessage {\n  // buf:lint:ignore SOME_OTHER_RULE\n  string BadFieldName = 1; // Has ignore for different rule, should still offer FIELD_LOWER_SNAKE_CASE\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/field_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.lint_ignore;\n\nmessage TestMessage {\n  string BadFieldName = 1; // FIELD_LOWER_SNAKE_CASE violation\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/filewide_test.proto",
    "content": "syntax = \"proto3\";\n\n// No package statement - triggers PACKAGE_DEFINED which is a file-wide lint at 0:0\n\nmessage TestMessage {\n  string test_field = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/multiple_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.lint_ignore; // Both PACKAGE_DIRECTORY_MATCH and PACKAGE_VERSION_SUFFIX\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/nested_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.lint_ignore;\n\nmessage Outer {\n  message Inner {\n    string BadFieldName = 1; // FIELD_LOWER_SNAKE_CASE violation\n  }\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/syntax_test.proto",
    "content": "syntax = \"proto3\";\n\npackage wrong.path; // PACKAGE_DIRECTORY_MATCH violation\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/tabs_test.proto",
    "content": "syntax = \"proto3\";\n\npackage test.lint_ignore;\n\nmessage TestMessage {\n\tstring BadFieldName = 1; // Tab indentation\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/lint_ignore/trailing_comment_test.proto",
    "content": "syntax = \"proto3\";\n\npackage wrong.path; // buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n\nmessage TestMessage {\n  string BadFieldName = 1; // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  string AnotherBad = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/comments_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.main;\n\n// A comment about this\nimport \"types/existing_field.proto\"; // trailing comment\n/* MultiComment\n * \n */\nimport \"google/protobuf/timestamp.proto\";\n\nmessage CommentsTest {\n  example.types.TopLevelField field = 1; // Missing import: toplevel_field.proto\n  example.types.ExistingField imported = 2;\n  example.types.NotAtTop field2 = 3;\n  google.protobuf.Timestamp timestamp_field = 4;\n}\n\n// Import is not at top of file\nimport \"types/notattop_import.proto\"; // another trailing comment\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/duplicate_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.main;\n\nimport \"types/existing_field.proto\";\n// A duplicate comment\nimport \"types/existing_field.proto\";\nimport \"types/existing_field.proto\"; // this also has a trailing comment\nimport \"types/existing_field.proto\";\n// A duplicate comment\nimport \"types/existing_field.proto\";\n\nmessage DuplicateTest {\n  example.types.ExistingField imported = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/import_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.main;\n\nimport \"google/protobuf/cpp_features.proto\"; // unused import\nimport \"types/existing_field.proto\";\n\n// This file tests that organize imports works for different scenarios:\n// - Top-level message field\n// - Nested message field\n// - RPC method input type\n// - RPC method output type\n// - Custom option\n\n// Test top-level field\nmessage TestTopLevel {\n  example.types.TopLevelField field = 1; // Missing import: toplevel_field.proto\n  example.types.ExistingField imported = 2;\n  example.types.NotFound not_found = 3; // Invalid import: ignore\n}\n\n// Test nested field\nmessage TestNested {\n  message Inner {\n    example.types.NestedField field = 1; // Missing import: nested_field.proto\n  }\n}\n\n// Test RPC method input and output\nservice TestService {\n  rpc TestMethod(example.types.MethodInputType) returns (example.types.MethodOutputType);\n  // Missing imports: method_input.proto and method_output.proto\n\n  rpc TestGoogleTypes(google.protobuf.Empty) returns (google.protobuf.Timestamp);\n  // Missing imports: google/protobuf/empty.proto and google/protobuf/timestamp.proto\n}\n\n// Test custom option\nmessage TestOption {\n  option (example.options.custom_option).value = \"test_value\"; // Missing import: custom_option.proto\n  string value = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/modifier_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.main;\n\nimport weak \"google/protobuf/cpp_features.proto\"; // unused import\n// Comment on weak import\nimport weak \"types/modifier_weak.proto\";\n// Comment on public import\nimport public \"types/modifier_public.proto\";\nimport \"types/existing_field.proto\";\n\nmessage TestImportModifiers {\n  example.types.TopLevelField field = 1; // Missing import: toplevel_field.proto\n  example.types.ExistingField imported = 2;\n  example.types.NotFound not_found = 3; // Invalid import: ignore\n  example.types.ModifierPublic modifier_public = 4;\n  example.types.ModifierWeak modifier_weak = 5;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/nochanges_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.main;\n\n// All imports are present and in the correct order.\nimport \"google/protobuf/timestamp.proto\";\nimport \"types/existing_field.proto\"; // trailing comment\n\nmessage NoChangesTest {\n  example.types.ExistingField imported = 2;\n  google.protobuf.Timestamp present_too = 3;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/noimports_test.proto",
    "content": "syntax = \"proto3\";\n\npackage example.main;\n\nmessage TestNoImports {\n  example.types.TopLevelField field = 1; // Missing import: toplevel_field.proto\n  example.types.ExistingField imported = 2;\n  example.types.NotFound not_found = 3; // Invalid import: ignore\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/nopackage_test.proto",
    "content": "syntax = \"proto3\";\n\nmessage TestNoPackage {\n  example.types.TopLevelField field = 1; // Missing import: toplevel_field.proto\n  example.types.ExistingField imported = 2;\n  example.types.NotFound not_found = 3; // Invalid import: ignore\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/options/custom_option.proto",
    "content": "syntax = \"proto2\";\n\npackage example.options;\n\nimport \"google/protobuf/descriptor.proto\";\n\n// Custom option for messages\nextend google.protobuf.MessageOptions {\n  optional CustomOptionType custom_option = 50001;\n}\n\nmessage CustomOptionType {\n  optional string value = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/existing_field.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage ExistingField {\n  string value = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/method_input.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage MethodInputType {\n  string id = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/method_output.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage MethodOutputType {\n  string result = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/modifier_public.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage ModifierPublic {}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/modifier_weak.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage ModifierWeak {}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/nested_field.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage NestedField {\n  string value = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/notattop_import.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage NotAtTop {\n  string value = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/types/toplevel_field.proto",
    "content": "syntax = \"proto3\";\n\npackage example.types;\n\nmessage TopLevelField {\n  string value = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/organize_imports/unknown_test.proto",
    "content": "syntax = \"proto3\";\n\nimport \"types/unknown.proto\";\n\nmessage UnknownImport {}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/references/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/references/references.proto",
    "content": "syntax = \"proto3\";\n\npackage references.v1;\n\nimport \"types.proto\";\n\nmessage Item {\n  string id = 1;\n  Color color = 2;\n  Label label = 3;\n  repeated Item related = 4;\n}\n\nmessage Container {\n  string name = 1;\n  repeated Item items = 2;\n  Color default_color = 3;\n  map<string, Item> items_by_id = 4;\n}\n\nservice ItemService {\n  rpc GetItem(GetItemRequest) returns (GetItemResponse);\n  rpc ListItems(ListItemsRequest) returns (ListItemsResponse);\n}\n\nmessage GetItemRequest {\n  string item_id = 1;\n}\n\nmessage GetItemResponse {\n  Item item = 1;\n}\n\nmessage ListItemsRequest {\n  string container_name = 1;\n}\n\nmessage ListItemsResponse {\n  repeated Item items = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/references/types.proto",
    "content": "syntax = \"proto3\";\n\npackage references.v1;\n\nenum Color {\n  COLOR_UNSPECIFIED = 0;\n  COLOR_RED = 1;\n  COLOR_BLUE = 2;\n}\n\nmessage Label {\n  string key = 1;\n  string value = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/rename/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\n"
  },
  {
    "path": "private/buf/buflsp/testdata/rename/extensions.proto",
    "content": "syntax = \"proto3\";\n\npackage rename.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  Testing testing = 89181;\n}\n\nmessage Testing {\n  bool test = 1;\n  Nested nested = 2;\n\n  message Nested {\n    bool value = 1;\n  }\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/rename/rename.proto",
    "content": "syntax = \"proto3\";\n\npackage rename.v1;\n\nimport \"extensions.proto\";\nimport \"subpkg/options.proto\";\nimport \"types.proto\";\n\nmessage Product {\n  string id = 1;\n  string name = 2;\n  Category category = 3;\n  repeated Product related = 4;\n}\n\nmessage Catalog {\n  string title = 1;\n  repeated Product products = 2;\n  Category default_category = 3;\n}\n\nservice ProductService {\n  rpc GetProduct(GetProductRequest) returns (GetProductResponse);\n  rpc ListProducts(ListProductsRequest) returns (ListProductsResponse);\n}\n\nmessage GetProductRequest {\n  string product_id = 1;\n}\n\nmessage GetProductResponse {\n  Product product = 1;\n}\n\nmessage ListProductsRequest {\n  string catalog_name = 1;\n}\n\nmessage ListProductsResponse {\n  repeated Product products = 1;\n}\nmessage Order {\n  message Item {\n    string product_id = 1;\n    int32 quantity = 2;\n  }\n  repeated Item items = 1;\n  enum Status {\n    STATUS_UNSPECIFIED = 0;\n    STATUS_PENDING = 1;\n    STATUS_SHIPPED = 2;\n  }\n  Status status = 2;\n  oneof payment {\n    string credit_card = 3;\n    string paypal_email = 4;\n  }\n}\nmessage Outer {\n  message Inner {\n    string title = 1;\n  }\n  message Container {\n    Inner inner = 1;\n  }\n  Container data = 1;\n}\n\nmessage UploadRequest {\n  option (testing).test = true;\n  bytes data = 1;\n}\n\nmessage DeleteRequest {\n  option (testing).test = false;\n  option (testing).nested.value = true;\n  string id = 1;\n}\n\nmessage CreateRequest {\n  option (subpkg.testing).test = true;\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/rename/subpkg/options.proto",
    "content": "syntax = \"proto3\";\n\npackage rename.v1.subpkg;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  Testing testing = 89182;\n}\n\nmessage Testing {\n  bool test = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/rename/types.proto",
    "content": "syntax = \"proto3\";\n\npackage rename.v1;\n\nenum Category {\n  CATEGORY_UNSPECIFIED = 0;\n  CATEGORY_ELECTRONICS = 1;\n  CATEGORY_BOOKS = 2;\n}\n\nmessage Metadata {\n  string key = 1;\n  string value = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/rename/wkt.proto",
    "content": "syntax = \"proto3\";\n\npackage rename.v1;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Event {\n  google.protobuf.Timestamp created_at = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\n  - path: vendor/protovalidate\nlint:\n  use:\n    - STANDARD\n  ignore:\n    - vendor/protovalidate\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/cel.proto",
    "content": "syntax = \"proto3\";\n\npackage test.v1;\n\nimport \"buf/validate/validate.proto\";\n\nmessage User {\n  string name = 1 [(buf.validate.field).cel = {\n    id: \"user.name\"\n    message: \"name must start with foo\"\n    expression: \"this.startsWith('foo') && this.size() > 5\"\n  }];\n\n  int32 age = 2 [(buf.validate.field).cel = {\n    id: \"user.age\"\n    message: \"age must be positive\"\n    expression: \"this > 0\"\n  }];\n\n  // Test cel_expression instead of cel.expression\n  string email = 3 [(buf.validate.field).cel_expression = \"'@' in this\"];\n}\n\n// Test message-level options with .cel form\nmessage ValidatedMessage {\n  option (buf.validate.message).cel = {\n    id: \"message.valid\"\n    message: \"message must be valid\"\n    expression: \"this.value > 0\"\n  };\n\n  int32 value = 1;\n}\n\n// Test message-level options with .cel_expression form (array)\nmessage AnotherValidatedMessage {\n  option (buf.validate.message).cel_expression = \"this.count < 100\";\n\n  int32 count = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/cel_advanced.proto",
    "content": "syntax = \"proto3\";\n\npackage test.v1;\n\nimport \"buf/validate/validate.proto\";\n\nmessage Address {\n  string street = 1;\n  string city = 2;\n}\n\nmessage AdvancedUser {\n  // Test reserved keywords: in operator\n  string email = 1 [(buf.validate.field).cel = {\n    id: \"email.contains\"\n    expression: \"'@' in this\"\n  }];\n\n  // Test type conversion functions: int(), string()\n  string age_str = 2 [(buf.validate.field).cel = {\n    id: \"age.convert\"\n    expression: \"int(this) > 0 && string(int(this)) == this\"\n  }];\n\n  // Test hexadecimal and unsigned literals\n  int32 hex_value = 3 [(buf.validate.field).cel = {\n    id: \"hex.value\"\n    expression: \"this == 0xFF || this == 255u\"\n  }];\n\n  // Test float with exponent\n  double scientific = 4 [(buf.validate.field).cel = {\n    id: \"scientific.notation\"\n    expression: \"this > 1e-10 && this < 1.5e3\"\n  }];\n\n  // Test has() macro\n  Address address = 5 [(buf.validate.field).cel = {\n    id: \"address.has\"\n    expression: \"has(this.street) && has(this.city)\"\n  }];\n\n  // Test all() and exists() macros\n  repeated string tags = 6 [(buf.validate.field).cel = {\n    id: \"tags.all\"\n    expression: \"this.all(tag, tag.size() > 0) && this.exists(tag, tag == 'valid')\"\n  }];\n\n  // Test ternary operator (? :)\n  int32 status = 7 [(buf.validate.field).cel = {\n    id: \"status.ternary\"\n    expression: \"this > 0 ? true : false\"\n  }];\n\n  // Test map() macro\n  repeated int32 numbers = 8 [(buf.validate.field).cel = {\n    id: \"numbers.map\"\n    expression: \"this.map(n, n * 2).size() > 0\"\n  }];\n\n  // Test filter() macro and exists_one()\n  repeated string items = 9 [(buf.validate.field).cel = {\n    id: \"items.filter\"\n    expression: \"this.filter(i, i.startsWith('test')).exists_one(i, i == 'test1')\"\n  }];\n}\n\n// Ref: https://protovalidate.com/schemas/custom-rules/#ternary-expressions\nmessage Triangle {\n  option (buf.validate.message).cel = {\n    id: \"triangle.distinct_points\"\n    expression:\n      \"this.point_a == this.point_b ? 'point A and point B cannot be the same'\"\n      \": this.point_b == this.point_c ? 'point B and point C cannot be the same'\"\n      \": this.point_a == this.point_c ? 'point A and point C cannot be the same'\"\n      \": ''\"\n  };\n  option (buf.validate.message).cel = {\n    id: \"triangle.non_linear_points\"\n    message: \"three points must not be on the same line\"\n    expression:\n      \"(this.point_a.y - this.point_b.y) * (this.point_a.x - this.point_c.x)\"\n      \"!= (this.point_a.y - this.point_c.y) * (this.point_a.x - this.point_b.x)\"\n  };\n\n  Point point_a = 1;\n  Point point_b = 2;\n  Point point_c = 3;\n}\n\nmessage Point {\n  double x = 1;\n  double y = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/cel_invalid.proto",
    "content": "syntax = \"proto3\";\n\npackage test.v1;\n\nimport \"buf/validate/validate.proto\";\n\n// Test that invalid CEL expressions are not highlighted (treated as plain strings)\nmessage InvalidCel {\n  // Syntax error - unclosed operator\n  string field1 = 1 [(buf.validate.field).cel = {\n    id: \"invalid.1\"\n    message: \"invalid\"\n    expression: \"this >\"\n  }];\n\n  // Syntax error - malformed expression\n  string field2 = 2 [(buf.validate.field).cel = {\n    id: \"invalid.2\"\n    message: \"invalid\"\n    expression: \"&&& ||\"\n  }];\n\n  // Syntax error - unclosed parenthesis\n  string field3 = 3 [(buf.validate.field).cel_expression = \"this.startsWith(\"];\n\n  // Syntax error - invalid token sequence\n  string field4 = 4 [(buf.validate.field).cel_expression = \".. ...\"];\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/cel_nested.proto",
    "content": "syntax = \"proto3\";\n\npackage test.v1;\n\nimport \"buf/validate/validate.proto\";\n\nmessage Container {\n  repeated string tags = 1 [(buf.validate.field).repeated.items.cel = {\n    id: \"tag\"\n    message: \"tag must start with x\"\n    expression: \"this.startsWith('x')\"\n  }];\n  repeated string emails = 2 [(buf.validate.field).repeated.items.cel_expression = \"'@' in this\"];\n  map<string, string> attrs = 3 [(buf.validate.field).map.keys.cel = {\n    id: \"key\"\n    message: \"key must not be empty\"\n    expression: \"this.size() > 0\"\n  }];\n  map<string, string> meta = 4 [(buf.validate.field).map.values.cel = {\n    id: \"val\"\n    message: \"value must not be empty\"\n    expression: \"this.size() > 1\"\n  }];\n  map<string, string> labels = 5 [(buf.validate.field).map.values.cel_expression = \"this.size() < 100\"];\n\n  map<string, string> codes = 6 [(buf.validate.field).map.keys.cel_expression = \"this.size() > 0\"];\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/comprehensive.proto",
    "content": "syntax = \"proto3\";\n\n// This is a comment\npackage test.v1;\n\nimport public \"google/protobuf/descriptor.proto\";\nimport weak \"other.proto\"; // NOTE: file doesn't exist; not resolved in semantic tokens\n\n// Message with deprecated option\nmessage User {\n  option deprecated = true;\n\n  // Built-in type (property with defaultLibrary)\n  string name = 1;\n  int32 age = 2;\n  // Optional field\n  optional string nickname = 6;\n\n  // Custom type (variable -> struct reference)\n  Role role = 3;\n\n  // Field with repeated modifier\n  repeated string tags = 4;\n\n  // Reserved fields and ranges\n  reserved 5;\n  reserved 10 to 15;\n  reserved \"old_field\";\n\n  // Oneof\n  oneof contact {\n    string email = 20;\n    string phone = 21;\n  }\n\n  // Map field with builtin value type\n  map<string, int32> attributes = 30;\n  // Map field with custom enum value type\n  map<string, Role> role_map = 31;\n  // Map field with custom message value type\n  map<int32, User> user_map = 32;\n}\n\n// Enum with members\nenum Role {\n  ROLE_UNSPECIFIED = 0;\n  ROLE_ADMIN = 1;\n}\n\n// Service with RPC methods\nservice UserService {\n  // RPC with stream modifiers\n  rpc GetUser(stream GetUserRequest) returns (stream GetUserResponse);\n  // RPC without stream modifiers\n  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse);\n}\n\nmessage GetUserRequest {\n  string user_id = 1;\n}\n\nmessage GetUserResponse {\n  User user = 1;\n}\n\nmessage ListUsersRequest {\n  string query = 1;\n}\n\nmessage ListUsersResponse {\n  repeated User users = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/edition.proto",
    "content": "edition = \"2023\";\n\npackage test.v1;\n\nmessage Product {\n  string id = 1;\n  string name = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/semantic_tokens/proto2.proto",
    "content": "syntax = \"proto2\";\n\npackage test.v1;\n\nmessage Person {\n  required string name = 1;\n  optional int32 age = 2;\n  optional double height = 3;\n  optional float weight = 4;\n  optional bool active = 5;\n  optional bytes data = 6;\n  optional int64 big_number = 7;\n  optional uint32 counter = 8;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/symbols/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/symbols/symbols.proto",
    "content": "syntax = \"proto3\";\n\npackage symbols.v1;\n\nmessage Document {\n  string id = 1;\n  string title = 2;\n  Status status = 3;\n  Metadata metadata = 4;\n  message Metadata {\n    string author = 1;\n    int64 created_at = 2;\n  }\n}\n\nenum Status {\n  STATUS_UNSPECIFIED = 0;\n  STATUS_DRAFT = 1;\n  STATUS_PUBLISHED = 2;\n}\n\nservice DocumentService {\n  rpc GetDocument(GetDocumentRequest) returns (GetDocumentResponse);\n  rpc CreateDocument(CreateDocumentRequest) returns (CreateDocumentResponse);\n}\n\nmessage GetDocumentRequest {\n  string document_id = 1;\n}\n\nmessage GetDocumentResponse {\n  Document document = 1;\n}\n\nmessage CreateDocumentRequest {\n  Document document = 1;\n}\n\nmessage CreateDocumentResponse {\n  Document document = 1;\n}\n\nmessage LegacyDocument {\n  option deprecated = true;\n  string id = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/type_definition/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/type_definition/type_definition.proto",
    "content": "syntax = \"proto3\";\n\npackage type_definition.v1;\n\nimport \"types.proto\";\n\n// Product represents a product in the catalog.\nmessage Product {\n  // The product ID.\n  string id = 1;\n\n  // The product category.\n  Category category = 2;\n\n  // The product vendor.\n  Vendor vendor = 3;\n\n  // The product tags.\n  repeated Tag tags = 4;\n\n  // The product metadata.\n  map<string, Metadata> metadata = 5;\n\n  // The product priority.\n  Priority priority = 6;\n\n  // The audit information.\n  Audit audit = 7;\n}\n\n// Category represents a product category.\nmessage Category {\n  // The category name.\n  string name = 1;\n\n  // The parent category.\n  Category parent = 2;\n}\n\n// Vendor represents a product vendor.\nmessage Vendor {\n  // The vendor name.\n  string name = 1;\n\n  // The vendor type.\n  VendorType type = 2;\n}\n\n// Tag represents a product tag.\nmessage Tag {\n  // The tag key.\n  string key = 1;\n\n  // The tag value.\n  string value = 2;\n}\n\n// Metadata represents arbitrary metadata.\nmessage Metadata {\n  // The metadata value.\n  string value = 1;\n}\n\n// VendorType represents the type of vendor.\nenum VendorType {\n  // The vendor type is not specified.\n  VENDOR_TYPE_UNSPECIFIED = 0;\n\n  // A direct vendor.\n  VENDOR_TYPE_DIRECT = 1;\n\n  // A reseller vendor.\n  VENDOR_TYPE_RESELLER = 2;\n}\n\n// Order represents a customer order.\nmessage Order {\n  // The order ID.\n  string id = 1;\n\n  // The ordered product.\n  Product product = 2;\n\n  // The order status.\n  OrderStatus status = 3;\n\n  // The customer.\n  Customer customer = 4;\n}\n\n// Customer represents a customer.\nmessage Customer {\n  // The customer name.\n  string name = 1;\n\n  // The customer contact.\n  Contact contact = 2;\n}\n\n// Contact represents contact information.\nmessage Contact {\n  // The email address.\n  string email = 1;\n\n  // The phone number.\n  string phone = 2;\n}\n\n// OrderStatus represents the status of an order.\nenum OrderStatus {\n  // The order status is not specified.\n  ORDER_STATUS_UNSPECIFIED = 0;\n\n  // The order is pending.\n  ORDER_STATUS_PENDING = 1;\n\n  // The order is confirmed.\n  ORDER_STATUS_CONFIRMED = 2;\n}\n\n// ProductService provides operations for products.\nservice ProductService {\n  // GetProduct retrieves a product.\n  rpc GetProduct(GetProductRequest) returns (GetProductResponse);\n\n  // CreateProduct creates a new product.\n  rpc CreateProduct(CreateProductRequest) returns (CreateProductResponse);\n}\n\n// GetProductRequest is the request for GetProduct.\nmessage GetProductRequest {\n  // The product ID.\n  string product_id = 1;\n}\n\n// GetProductResponse is the response for GetProduct.\nmessage GetProductResponse {\n  // The retrieved product.\n  Product product = 1;\n}\n\n// CreateProductRequest is the request for CreateProduct.\nmessage CreateProductRequest {\n  // The product to create.\n  Product product = 1;\n\n  // The initial category.\n  Category category = 2;\n}\n\n// CreateProductResponse is the response for CreateProduct.\nmessage CreateProductResponse {\n  // The created product.\n  Product product = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/type_definition/types.proto",
    "content": "syntax = \"proto3\";\n\npackage type_definition.v1;\n\n// Priority represents the priority level.\nenum Priority {\n  // The priority is not specified.\n  PRIORITY_UNSPECIFIED = 0;\n\n  // Low priority.\n  PRIORITY_LOW = 1;\n\n  // High priority.\n  PRIORITY_HIGH = 2;\n}\n\n// Audit represents audit information.\nmessage Audit {\n  // The user who created this.\n  string created_by = 1;\n\n  // The timestamp of creation.\n  int64 created_at = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/uri@encode/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\n"
  },
  {
    "path": "private/buf/buflsp/testdata/uri@encode/test.proto",
    "content": "syntax = \"proto3\";\n\npackage uri.encode.v1;\n\n// User represents a user in the system.\nmessage User {\n  // The unique identifier for the user.\n  string id = 1;\n\n  // The user's email address.\n  string email = 2;\n\n  // The user's current status.\n  Status status = 3;\n}\n\n// Status represents the current state of a user.\nenum Status {\n  // The status is not specified.\n  STATUS_UNSPECIFIED = 0;\n\n  // The user is active.\n  STATUS_ACTIVE = 1;\n\n  // The user is inactive.\n  STATUS_INACTIVE = 2;\n}\n\n// UserService provides operations for managing users.\nservice UserService {\n  // GetUser retrieves a user by their ID.\n  rpc GetUser(GetUserRequest) returns (GetUserResponse);\n}\n\n// GetUserRequest is the request message for GetUser.\nmessage GetUserRequest {\n  // The ID of the user to retrieve.\n  string user_id = 1;\n}\n\n// GetUserResponse is the response message for GetUser.\nmessage GetUserResponse {\n  // The retrieved user.\n  User user = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/uri@encode/types.proto",
    "content": "syntax = \"proto3\";\n\npackage uri.encode.v1;\n\n// Address represents a physical address.\nmessage Address {\n  string street = 1;\n  string city = 2;\n  string state = 3;\n  string zip_code = 4;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/vendor/protovalidate/buf/validate/validate.proto",
    "content": "// Copyright 2023-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto2\";\n\npackage buf.validate;\n\nimport \"google/protobuf/descriptor.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/field_mask.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\noption go_package = \"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\";\noption java_multiple_files = true;\noption java_outer_classname = \"ValidateProto\";\noption java_package = \"build.buf.validate\";\n\n// MessageOptions is an extension to google.protobuf.MessageOptions. It allows\n// the addition of validation rules at the message level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.MessageOptions {\n  // Rules specify the validations to be performed on this message. By default,\n  // no validation is performed against a message.\n  optional MessageRules message = 1159;\n}\n\n// OneofOptions is an extension to google.protobuf.OneofOptions. It allows\n// the addition of validation rules on a oneof. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.OneofOptions {\n  // Rules specify the validations to be performed on this oneof. By default,\n  // no validation is performed against a oneof.\n  optional OneofRules oneof = 1159;\n}\n\n// FieldOptions is an extension to google.protobuf.FieldOptions. It allows\n// the addition of validation rules at the field level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.FieldOptions {\n  // Rules specify the validations to be performed on this field. By default,\n  // no validation is performed against a field.\n  optional FieldRules field = 1159;\n\n  // Specifies predefined rules. When extending a standard rule message,\n  // this adds additional CEL expressions that apply when the extension is used.\n  //\n  // ```proto\n  // extend buf.validate.Int32Rules {\n  //   bool is_zero [(buf.validate.predefined).cel = {\n  //     id: \"int32.is_zero\",\n  //     message: \"value must be zero\",\n  //     expression: \"!rule || this == 0\",\n  //   }];\n  // }\n  //\n  // message Foo {\n  //   int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true];\n  // }\n  // ```\n  optional PredefinedRules predefined = 1160;\n}\n\n// `Rule` represents a validation rule written in the Common Expression\n// Language (CEL) syntax. Each Rule includes a unique identifier, an\n// optional error message, and the CEL expression to evaluate. For more\n// information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n//\n// ```proto\n// message Foo {\n//   option (buf.validate.message).cel = {\n//     id: \"foo.bar\"\n//     message: \"bar must be greater than 0\"\n//     expression: \"this.bar > 0\"\n//   };\n//   int32 bar = 1;\n// }\n// ```\nmessage Rule {\n  // `id` is a string that serves as a machine-readable name for this Rule.\n  // It should be unique within its scope, which could be either a message or a field.\n  optional string id = 1;\n\n  // `message` is an optional field that provides a human-readable error message\n  // for this Rule when the CEL expression evaluates to false. If a\n  // non-empty message is provided, any strings resulting from the CEL\n  // expression evaluation are ignored.\n  optional string message = 2;\n\n  // `expression` is the actual CEL expression that will be evaluated for\n  // validation. This string must resolve to either a boolean or a string\n  // value. If the expression evaluates to false or a non-empty string, the\n  // validation is considered failed, and the message is rejected.\n  optional string expression = 3;\n}\n\n// MessageRules represents validation rules that are applied to the entire message.\n// It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.\nmessage MessageRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel_expression = \"this.foo > 42\";\n  //   // The field `foo` must be less than 84.\n  //   option (buf.validate.message).cel_expression = \"this.foo < 84\";\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated string cel_expression = 5;\n  // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.\n  // These rules are written in Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this.foo > 42\",\n  //   };\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated Rule cel = 3;\n\n  // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields\n  // of which at most one can be present. If `required` is also specified, then exactly one\n  // of the specified fields _must_ be present.\n  //\n  // This will enforce oneof-like constraints with a few features not provided by\n  // actual Protobuf oneof declarations:\n  //   1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,\n  //      only scalar fields are allowed.\n  //   2. Fields with implicit presence are allowed. In a Protobuf oneof, all member\n  //      fields have explicit presence. This means that, for the purpose of determining\n  //      how many fields are set, explicitly setting such a field to its zero value is\n  //      effectively the same as not setting it at all.\n  //   3. This will always generate validation errors for a message unmarshalled from\n  //      serialized data that sets more than one field. With a Protobuf oneof, when\n  //      multiple fields are present in the serialized form, earlier values are usually\n  //      silently ignored when unmarshalling, with only the last field being set when\n  //      unmarshalling completes.\n  //\n  // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means\n  // only the field that is set will be validated and the unset fields are not validated according to the field rules.\n  // This behavior can be overridden by setting `ignore` against a field.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // Only one of `field1` or `field2` _can_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field1\", \"field2\"] };\n  //   // Exactly one of `field3` or `field4` _must_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field3\", \"field4\"], required: true };\n  //   string field1 = 1;\n  //   bytes field2 = 2;\n  //   bool field3 = 3;\n  //   int32 field4 = 4;\n  // }\n  // ```\n  repeated MessageOneofRule oneof = 4;\n\n  reserved 1;\n  reserved \"disabled\";\n}\n\nmessage MessageOneofRule {\n  // A list of field names to include in the oneof. All field names must be\n  // defined in the message. At least one field must be specified, and\n  // duplicates are not permitted.\n  repeated string fields = 1;\n  // If true, one of the fields specified _must_ be set.\n  optional bool required = 2;\n}\n\n// The `OneofRules` message type enables you to manage rules for\n// oneof fields in your protobuf messages.\nmessage OneofRules {\n  // If `required` is true, exactly one field of the oneof must be set. A\n  // validation error is returned if no fields in the oneof are set. Further rules\n  // should be placed on the fields themselves to ensure they are valid values,\n  // such as `min_len` or `gt`.\n  //\n  // ```proto\n  // message MyMessage {\n  //   oneof value {\n  //     // Either `a` or `b` must be set. If `a` is set, it must also be\n  //     // non-empty; whereas if `b` is set, it can still be an empty string.\n  //     option (buf.validate.oneof).required = true;\n  //     string a = 1 [(buf.validate.field).string.min_len = 1];\n  //     string b = 2;\n  //   }\n  // }\n  // ```\n  optional bool required = 1;\n}\n\n// FieldRules encapsulates the rules for each type of field. Depending on\n// the field, the correct set should be used to ensure proper validations.\nmessage FieldRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel_expression = \"this > 42\"];\n  // }\n  // ```\n  repeated string cel_expression = 29;\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 23;\n  // If `required` is true, the field must be set. A validation error is returned\n  // if the field is not set.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithPresence {\n  //   // Requires any string to be set, including the empty string.\n  //   optional string link = 1 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires true or false to be set.\n  //   optional bool disabled = 2 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires a message to be set, including the empty message.\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // All fields in the example above track presence. By default, Protovalidate\n  // ignores rules on those fields if no value is set. `required` ensures that\n  // the fields are set and valid.\n  //\n  // Fields that don't track presence are always validated by Protovalidate,\n  // whether they are set or not. It is not necessary to add `required`. It\n  // can be added to indicate that the field cannot be the zero value.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithoutPresence {\n  //   // `string.email` always applies, even to an empty string.\n  //   string link = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   // `repeated.min_items` always applies, even to an empty list.\n  //   repeated string labels = 2 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  //   // `required`, for fields that don't track presence, indicates\n  //   // the value of the field can't be the zero value.\n  //   int32 zero_value_not_allowed = 3 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  //\n  // Note: While field rules can be applied to repeated items, map keys, and map\n  // values, the elements are always considered to be set. Consequently,\n  // specifying `repeated.items.required` is redundant.\n  optional bool required = 25;\n  // Ignore validation rules on the field if its value matches the specified\n  // criteria. See the `Ignore` enum for details.\n  //\n  // ```proto\n  // message UpdateRequest {\n  //   // The uri rule only applies if the field is not an empty string.\n  //   string url = 1 [\n  //     (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,\n  //     (buf.validate.field).string.uri = true\n  //   ];\n  // }\n  // ```\n  optional Ignore ignore = 27;\n\n  oneof type {\n    // Scalar Field Types\n    FloatRules float = 1;\n    DoubleRules double = 2;\n    Int32Rules int32 = 3;\n    Int64Rules int64 = 4;\n    UInt32Rules uint32 = 5;\n    UInt64Rules uint64 = 6;\n    SInt32Rules sint32 = 7;\n    SInt64Rules sint64 = 8;\n    Fixed32Rules fixed32 = 9;\n    Fixed64Rules fixed64 = 10;\n    SFixed32Rules sfixed32 = 11;\n    SFixed64Rules sfixed64 = 12;\n    BoolRules bool = 13;\n    StringRules string = 14;\n    BytesRules bytes = 15;\n\n    // Complex Field Types\n    EnumRules enum = 16;\n    RepeatedRules repeated = 18;\n    MapRules map = 19;\n\n    // Well-Known Field Types\n    AnyRules any = 20;\n    DurationRules duration = 21;\n    FieldMaskRules field_mask = 28;\n    TimestampRules timestamp = 22;\n  }\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// PredefinedRules are custom rules that can be re-used with\n// multiple fields.\nmessage PredefinedRules {\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.predefined).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 1;\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// Specifies how `FieldRules.ignore` behaves, depending on the field's value, and\n// whether the field tracks presence.\nenum Ignore {\n  // Ignore rules if the field tracks presence and is unset. This is the default\n  // behavior.\n  //\n  // In proto3, only message fields, members of a Protobuf `oneof`, and fields\n  // with the `optional` label track presence. Consequently, the following fields\n  // are always validated, whether a value is set or not:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApply {\n  //   string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   int32 age = 2 [\n  //     (buf.validate.field).int32.gt = 0\n  //   ];\n  //   repeated string labels = 3 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  // }\n  // ```\n  //\n  // In contrast, the following fields track presence, and are only validated if\n  // a value is set:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApplyIfSet {\n  //   optional string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   oneof ref {\n  //     string reference = 2 [\n  //       (buf.validate.field).string.uuid = true\n  //     ];\n  //     string name = 3 [\n  //       (buf.validate.field).string.min_len = 4\n  //     ];\n  //   }\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).cel = {/* ... */}\n  //   ];\n  // }\n  // ```\n  //\n  // To ensure that such a field is set, add the `required` rule.\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  IGNORE_UNSPECIFIED = 0;\n\n  // Ignore rules if the field is unset, or set to the zero value.\n  //\n  // The zero value depends on the field type:\n  // - For strings, the zero value is the empty string.\n  // - For bytes, the zero value is empty bytes.\n  // - For bool, the zero value is false.\n  // - For numeric types, the zero value is zero.\n  // - For enums, the zero value is the first defined enum value.\n  // - For repeated fields, the zero is an empty list.\n  // - For map fields, the zero is an empty map.\n  // - For message fields, absence of the message (typically a null-value) is considered zero value.\n  //\n  // For fields that track presence (e.g. adding the `optional` label in proto3),\n  // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.\n  IGNORE_IF_ZERO_VALUE = 1;\n\n  // Always ignore rules, including the `required` rule.\n  //\n  // This is useful for ignoring the rules of a referenced message, or to\n  // temporarily ignore rules during development.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field's rules will always be ignored, including any validations\n  //   // on value's fields.\n  //   MyOtherMessage value = 1 [\n  //     (buf.validate.field).ignore = IGNORE_ALWAYS\n  //   ];\n  // }\n  // ```\n  IGNORE_ALWAYS = 3;\n\n  reserved 2;\n  reserved \"IGNORE_EMPTY\", \"IGNORE_DEFAULT\", \"IGNORE_IF_DEFAULT_VALUE\", \"IGNORE_IF_UNPOPULATED\";\n}\n\n// FloatRules describes the rules applied to `float` values. These\n// rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.\nmessage FloatRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must equal 42.0\n  //   float value = 1 [(buf.validate.field).float.const = 42.0];\n  // }\n  // ```\n  optional float const = 1 [(predefined).cel = {\n    id: \"float.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than 10.0\n    //   float value = 1 [(buf.validate.field).float.lt = 10.0];\n    // }\n    // ```\n    float lt = 2 [(predefined).cel = {\n      id: \"float.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than or equal to 10.0\n    //   float value = 1 [(buf.validate.field).float.lte = 10.0];\n    // }\n    // ```\n    float lte = 3 [(predefined).cel = {\n      id: \"float.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than 5.0 [float.gt]\n    //   float value = 1 [(buf.validate.field).float.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [float.gt_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gt = 4 [\n      (predefined).cel = {\n        id: \"float.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than or equal to 5.0 [float.gte]\n    //   float value = 1 [(buf.validate.field).float.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gte = 5 [\n      (predefined).cel = {\n        id: \"float.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float in = 6 [(predefined).cel = {\n    id: \"float.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float not_in = 7 [(predefined).cel = {\n    id: \"float.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"float.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFloat {\n  //   float value = 1 [\n  //     (buf.validate.field).float.example = 1.0,\n  //     (buf.validate.field).float.example = inf\n  //   ];\n  // }\n  // ```\n  repeated float example = 9 [(predefined).cel = {\n    id: \"float.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// DoubleRules describes the rules applied to `double` values. These\n// rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.\nmessage DoubleRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must equal 42.0\n  //   double value = 1 [(buf.validate.field).double.const = 42.0];\n  // }\n  // ```\n  optional double const = 1 [(predefined).cel = {\n    id: \"double.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than 10.0\n    //   double value = 1 [(buf.validate.field).double.lt = 10.0];\n    // }\n    // ```\n    double lt = 2 [(predefined).cel = {\n      id: \"double.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified value\n    // (field <= value). If the field value is greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than or equal to 10.0\n    //   double value = 1 [(buf.validate.field).double.lte = 10.0];\n    // }\n    // ```\n    double lte = 3 [(predefined).cel = {\n      id: \"double.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,\n    // the range is reversed, and the field value must be outside the specified\n    // range. If the field value doesn't meet the required conditions, an error\n    // message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than 5.0 [double.gt]\n    //   double value = 1 [(buf.validate.field).double.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [double.gt_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gt = 4 [\n      (predefined).cel = {\n        id: \"double.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than or equal to 5.0 [double.gte]\n    //   double value = 1 [(buf.validate.field).double.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gte = 5 [\n      (predefined).cel = {\n        id: \"double.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double in = 6 [(predefined).cel = {\n    id: \"double.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double not_in = 7 [(predefined).cel = {\n    id: \"double.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"double.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDouble {\n  //   double value = 1 [\n  //     (buf.validate.field).double.example = 1.0,\n  //     (buf.validate.field).double.example = inf\n  //   ];\n  // }\n  // ```\n  repeated double example = 9 [(predefined).cel = {\n    id: \"double.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int32Rules describes the rules applied to `int32` values. These\n// rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.\nmessage Int32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must equal 42\n  //   int32 value = 1 [(buf.validate.field).int32.const = 42];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"int32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than 10\n    //   int32 value = 1 [(buf.validate.field).int32.lt = 10];\n    // }\n    // ```\n    int32 lt = 2 [(predefined).cel = {\n      id: \"int32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than or equal to 10\n    //   int32 value = 1 [(buf.validate.field).int32.lte = 10];\n    // }\n    // ```\n    int32 lte = 3 [(predefined).cel = {\n      id: \"int32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than 5 [int32.gt]\n    //   int32 value = 1 [(buf.validate.field).int32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int32.gt_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gt = 4 [\n      (predefined).cel = {\n        id: \"int32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified value\n    // (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than or equal to 5 [int32.gte]\n    //   int32 value = 1 [(buf.validate.field).int32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gte = 5 [\n      (predefined).cel = {\n        id: \"int32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 in = 6 [(predefined).cel = {\n    id: \"int32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 not_in = 7 [(predefined).cel = {\n    id: \"int32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   int32 value = 1 [\n  //     (buf.validate.field).int32.example = 1,\n  //     (buf.validate.field).int32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int32 example = 8 [(predefined).cel = {\n    id: \"int32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int64Rules describes the rules applied to `int64` values. These\n// rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.\nmessage Int64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must equal 42\n  //   int64 value = 1 [(buf.validate.field).int64.const = 42];\n  // }\n  // ```\n  optional int64 const = 1 [(predefined).cel = {\n    id: \"int64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than 10\n    //   int64 value = 1 [(buf.validate.field).int64.lt = 10];\n    // }\n    // ```\n    int64 lt = 2 [(predefined).cel = {\n      id: \"int64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than or equal to 10\n    //   int64 value = 1 [(buf.validate.field).int64.lte = 10];\n    // }\n    // ```\n    int64 lte = 3 [(predefined).cel = {\n      id: \"int64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than 5 [int64.gt]\n    //   int64 value = 1 [(buf.validate.field).int64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int64.gt_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gt = 4 [\n      (predefined).cel = {\n        id: \"int64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than or equal to 5 [int64.gte]\n    //   int64 value = 1 [(buf.validate.field).int64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gte = 5 [\n      (predefined).cel = {\n        id: \"int64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 in = 6 [(predefined).cel = {\n    id: \"int64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 not_in = 7 [(predefined).cel = {\n    id: \"int64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   int64 value = 1 [\n  //     (buf.validate.field).int64.example = 1,\n  //     (buf.validate.field).int64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int64 example = 9 [(predefined).cel = {\n    id: \"int64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt32Rules describes the rules applied to `uint32` values. These\n// rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.\nmessage UInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must equal 42\n  //   uint32 value = 1 [(buf.validate.field).uint32.const = 42];\n  // }\n  // ```\n  optional uint32 const = 1 [(predefined).cel = {\n    id: \"uint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lt = 10];\n    // }\n    // ```\n    uint32 lt = 2 [(predefined).cel = {\n      id: \"uint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than or equal to 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lte = 10];\n    // }\n    // ```\n    uint32 lte = 3 [(predefined).cel = {\n      id: \"uint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than 5 [uint32.gt]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint32.gt_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gt = 4 [\n      (predefined).cel = {\n        id: \"uint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than or equal to 5 [uint32.gte]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gte = 5 [\n      (predefined).cel = {\n        id: \"uint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 in = 6 [(predefined).cel = {\n    id: \"uint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 not_in = 7 [(predefined).cel = {\n    id: \"uint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   uint32 value = 1 [\n  //     (buf.validate.field).uint32.example = 1,\n  //     (buf.validate.field).uint32.example = 10\n  //   ];\n  // }\n  // ```\n  repeated uint32 example = 8 [(predefined).cel = {\n    id: \"uint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt64Rules describes the rules applied to `uint64` values. These\n// rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.\nmessage UInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must equal 42\n  //   uint64 value = 1 [(buf.validate.field).uint64.const = 42];\n  // }\n  // ```\n  optional uint64 const = 1 [(predefined).cel = {\n    id: \"uint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lt = 10];\n    // }\n    // ```\n    uint64 lt = 2 [(predefined).cel = {\n      id: \"uint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than or equal to 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lte = 10];\n    // }\n    // ```\n    uint64 lte = 3 [(predefined).cel = {\n      id: \"uint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than 5 [uint64.gt]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint64.gt_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gt = 4 [\n      (predefined).cel = {\n        id: \"uint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than or equal to 5 [uint64.gte]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gte = 5 [\n      (predefined).cel = {\n        id: \"uint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 in = 6 [(predefined).cel = {\n    id: \"uint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 not_in = 7 [(predefined).cel = {\n    id: \"uint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   uint64 value = 1 [\n  //     (buf.validate.field).uint64.example = 1,\n  //     (buf.validate.field).uint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated uint64 example = 8 [(predefined).cel = {\n    id: \"uint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt32Rules describes the rules applied to `sint32` values.\nmessage SInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must equal 42\n  //   sint32 value = 1 [(buf.validate.field).sint32.const = 42];\n  // }\n  // ```\n  optional sint32 const = 1 [(predefined).cel = {\n    id: \"sint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lt = 10];\n    // }\n    // ```\n    sint32 lt = 2 [(predefined).cel = {\n      id: \"sint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than or equal to 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lte = 10];\n    // }\n    // ```\n    sint32 lte = 3 [(predefined).cel = {\n      id: \"sint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be greater than 5 [sint32.gt]\n    //   sint32 value = 1 [(buf.validate.field).sint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint32.gt_lt]\n    //   sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]\n    //   sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gt = 4 [\n      (predefined).cel = {\n        id: \"sint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //  // value must be greater than or equal to 5 [sint32.gte]\n    //  sint32 value = 1 [(buf.validate.field).sint32.gte = 5];\n    //\n    //  // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]\n    //  sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];\n    //\n    //  // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]\n    //  sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gte = 5 [\n      (predefined).cel = {\n        id: \"sint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 in = 6 [(predefined).cel = {\n    id: \"sint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 not_in = 7 [(predefined).cel = {\n    id: \"sint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   sint32 value = 1 [\n  //     (buf.validate.field).sint32.example = 1,\n  //     (buf.validate.field).sint32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint32 example = 8 [(predefined).cel = {\n    id: \"sint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt64Rules describes the rules applied to `sint64` values.\nmessage SInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must equal 42\n  //   sint64 value = 1 [(buf.validate.field).sint64.const = 42];\n  // }\n  // ```\n  optional sint64 const = 1 [(predefined).cel = {\n    id: \"sint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lt = 10];\n    // }\n    // ```\n    sint64 lt = 2 [(predefined).cel = {\n      id: \"sint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than or equal to 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lte = 10];\n    // }\n    // ```\n    sint64 lte = 3 [(predefined).cel = {\n      id: \"sint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than 5 [sint64.gt]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint64.gt_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gt = 4 [\n      (predefined).cel = {\n        id: \"sint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than or equal to 5 [sint64.gte]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gte = 5 [\n      (predefined).cel = {\n        id: \"sint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 in = 6 [(predefined).cel = {\n    id: \"sint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 not_in = 7 [(predefined).cel = {\n    id: \"sint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   sint64 value = 1 [\n  //     (buf.validate.field).sint64.example = 1,\n  //     (buf.validate.field).sint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint64 example = 8 [(predefined).cel = {\n    id: \"sint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed32Rules describes the rules applied to `fixed32` values.\nmessage Fixed32Rules {\n  // `const` requires the field value to exactly match the specified value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must equal 42\n  //   fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];\n  // }\n  // ```\n  optional fixed32 const = 1 [(predefined).cel = {\n    id: \"fixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];\n    // }\n    // ```\n    fixed32 lt = 2 [(predefined).cel = {\n      id: \"fixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than or equal to 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];\n    // }\n    // ```\n    fixed32 lte = 3 [(predefined).cel = {\n      id: \"fixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than 5 [fixed32.gt]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed32.gt_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than or equal to 5 [fixed32.gte]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 in = 6 [(predefined).cel = {\n    id: \"fixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 not_in = 7 [(predefined).cel = {\n    id: \"fixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   fixed32 value = 1 [\n  //     (buf.validate.field).fixed32.example = 1,\n  //     (buf.validate.field).fixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed32 example = 8 [(predefined).cel = {\n    id: \"fixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed64Rules describes the rules applied to `fixed64` values.\nmessage Fixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must equal 42\n  //   fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];\n  // }\n  // ```\n  optional fixed64 const = 1 [(predefined).cel = {\n    id: \"fixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];\n    // }\n    // ```\n    fixed64 lt = 2 [(predefined).cel = {\n      id: \"fixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than or equal to 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];\n    // }\n    // ```\n    fixed64 lte = 3 [(predefined).cel = {\n      id: \"fixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than 5 [fixed64.gt]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed64.gt_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than or equal to 5 [fixed64.gte]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 in = 6 [(predefined).cel = {\n    id: \"fixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 not_in = 7 [(predefined).cel = {\n    id: \"fixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   fixed64 value = 1 [\n  //     (buf.validate.field).fixed64.example = 1,\n  //     (buf.validate.field).fixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed64 example = 8 [(predefined).cel = {\n    id: \"fixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed32Rules describes the rules applied to `fixed32` values.\nmessage SFixed32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must equal 42\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];\n  // }\n  // ```\n  optional sfixed32 const = 1 [(predefined).cel = {\n    id: \"sfixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];\n    // }\n    // ```\n    sfixed32 lt = 2 [(predefined).cel = {\n      id: \"sfixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than or equal to 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];\n    // }\n    // ```\n    sfixed32 lte = 3 [(predefined).cel = {\n      id: \"sfixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than 5 [sfixed32.gt]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed32.gt_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than or equal to 5 [sfixed32.gte]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 in = 6 [(predefined).cel = {\n    id: \"sfixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 not_in = 7 [(predefined).cel = {\n    id: \"sfixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   sfixed32 value = 1 [\n  //     (buf.validate.field).sfixed32.example = 1,\n  //     (buf.validate.field).sfixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed32 example = 8 [(predefined).cel = {\n    id: \"sfixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed64Rules describes the rules applied to `fixed64` values.\nmessage SFixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must equal 42\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];\n  // }\n  // ```\n  optional sfixed64 const = 1 [(predefined).cel = {\n    id: \"sfixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];\n    // }\n    // ```\n    sfixed64 lt = 2 [(predefined).cel = {\n      id: \"sfixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than or equal to 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];\n    // }\n    // ```\n    sfixed64 lte = 3 [(predefined).cel = {\n      id: \"sfixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than 5 [sfixed64.gt]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed64.gt_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than or equal to 5 [sfixed64.gte]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 in = 6 [(predefined).cel = {\n    id: \"sfixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 not_in = 7 [(predefined).cel = {\n    id: \"sfixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   sfixed64 value = 1 [\n  //     (buf.validate.field).sfixed64.example = 1,\n  //     (buf.validate.field).sfixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed64 example = 8 [(predefined).cel = {\n    id: \"sfixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// BoolRules describes the rules applied to `bool` values. These rules\n// may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.\nmessage BoolRules {\n  // `const` requires the field value to exactly match the specified boolean value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBool {\n  //   // value must equal true\n  //   bool value = 1 [(buf.validate.field).bool.const = true];\n  // }\n  // ```\n  optional bool const = 1 [(predefined).cel = {\n    id: \"bool.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBool {\n  //   bool value = 1 [\n  //     (buf.validate.field).bool.example = 1,\n  //     (buf.validate.field).bool.example = 2\n  //   ];\n  // }\n  // ```\n  repeated bool example = 2 [(predefined).cel = {\n    id: \"bool.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// StringRules describes the rules applied to `string` values These\n// rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.\nmessage StringRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must equal `hello`\n  //   string value = 1 [(buf.validate.field).string.const = \"hello\"];\n  // }\n  // ```\n  optional string const = 1 [(predefined).cel = {\n    id: \"string.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal `%s`'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` dictates that the field value must have the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value does not meet the specified\n  // length, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 5 characters\n  //   string value = 1 [(buf.validate.field).string.len = 5];\n  // }\n  // ```\n  optional uint64 len = 19 [(predefined).cel = {\n    id: \"string.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s characters'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` specifies that the field value must have at least the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value contains fewer characters, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 3 characters\n  //   string value = 1 [(buf.validate.field).string.min_len = 3];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"string.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s characters'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` specifies that the field value must have no more than the specified\n  // number of characters (Unicode code points), which may differ from the\n  // number of bytes in the string. If the field value contains more characters,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 10 characters\n  //   string value = 1 [(buf.validate.field).string.max_len = 10];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"string.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value length must be at most %s characters'.format([rules.max_len]) : ''\"\n  }];\n\n  // `len_bytes` dictates that the field value must have the specified number of\n  // bytes. If the field value does not match the specified length in bytes,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 6 bytes\n  //   string value = 1 [(buf.validate.field).string.len_bytes = 6];\n  // }\n  // ```\n  optional uint64 len_bytes = 20 [(predefined).cel = {\n    id: \"string.len_bytes\"\n    expression: \"uint(bytes(this).size()) != rules.len_bytes ? 'value length must be %s bytes'.format([rules.len_bytes]) : ''\"\n  }];\n\n  // `min_bytes` specifies that the field value must have at least the specified\n  // number of bytes. If the field value contains fewer bytes, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 4 bytes\n  //   string value = 1 [(buf.validate.field).string.min_bytes = 4];\n  // }\n  //\n  // ```\n  optional uint64 min_bytes = 4 [(predefined).cel = {\n    id: \"string.min_bytes\"\n    expression: \"uint(bytes(this).size()) < rules.min_bytes ? 'value length must be at least %s bytes'.format([rules.min_bytes]) : ''\"\n  }];\n\n  // `max_bytes` specifies that the field value must have no more than the\n  //specified number of bytes. If the field value contains more bytes, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 8 bytes\n  //   string value = 1 [(buf.validate.field).string.max_bytes = 8];\n  // }\n  // ```\n  optional uint64 max_bytes = 5 [(predefined).cel = {\n    id: \"string.max_bytes\"\n    expression: \"uint(bytes(this).size()) > rules.max_bytes ? 'value length must be at most %s bytes'.format([rules.max_bytes]) : ''\"\n  }];\n\n  // `pattern` specifies that the field value must match the specified\n  // regular expression (RE2 syntax), with the expression provided without any\n  // delimiters. If the field value doesn't match the regular expression, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not match regex pattern `^[a-zA-Z]//$`\n  //   string value = 1 [(buf.validate.field).string.pattern = \"^[a-zA-Z]//$\"];\n  // }\n  // ```\n  optional string pattern = 6 [(predefined).cel = {\n    id: \"string.pattern\"\n    expression: \"!this.matches(rules.pattern) ? 'value does not match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` specifies that the field value must have the\n  //specified substring at the beginning of the string. If the field value\n  // doesn't start with the specified prefix, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have prefix `pre`\n  //   string value = 1 [(buf.validate.field).string.prefix = \"pre\"];\n  // }\n  // ```\n  optional string prefix = 7 [(predefined).cel = {\n    id: \"string.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix `%s`'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` specifies that the field value must have the\n  //specified substring at the end of the string. If the field value doesn't\n  // end with the specified suffix, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have suffix `post`\n  //   string value = 1 [(buf.validate.field).string.suffix = \"post\"];\n  // }\n  // ```\n  optional string suffix = 8 [(predefined).cel = {\n    id: \"string.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix `%s`'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` specifies that the field value must have the\n  //specified substring anywhere in the string. If the field value doesn't\n  // contain the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not contain substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.contains = \"inside\"];\n  // }\n  // ```\n  optional string contains = 9 [(predefined).cel = {\n    id: \"string.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain substring `%s`'.format([rules.contains]) : ''\"\n  }];\n\n  // `not_contains` specifies that the field value must not have the\n  //specified substring anywhere in the string. If the field value contains\n  // the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value contains substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.not_contains = \"inside\"];\n  // }\n  // ```\n  optional string not_contains = 23 [(predefined).cel = {\n    id: \"string.not_contains\"\n    expression: \"this.contains(rules.not_contains) ? 'value contains substring `%s`'.format([rules.not_contains]) : ''\"\n  }];\n\n  // `in` specifies that the field value must be equal to one of the specified\n  // values. If the field value isn't one of the specified values, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must be in list [\"apple\", \"banana\"]\n  //   string value = 1 [(buf.validate.field).string.in = \"apple\", (buf.validate.field).string.in = \"banana\"];\n  // }\n  // ```\n  repeated string in = 10 [(predefined).cel = {\n    id: \"string.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` specifies that the field value cannot be equal to any\n  // of the specified values. If the field value is one of the specified values,\n  // an error message will be generated.\n  // ```proto\n  // message MyString {\n  //   // value must not be in list [\"orange\", \"grape\"]\n  //   string value = 1 [(buf.validate.field).string.not_in = \"orange\", (buf.validate.field).string.not_in = \"grape\"];\n  // }\n  // ```\n  repeated string not_in = 11 [(predefined).cel = {\n    id: \"string.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `WellKnown` rules provide advanced rules against common string\n  // patterns.\n  oneof well_known {\n    // `email` specifies that the field value must be a valid email address, for\n    // example \"foo@example.com\".\n    //\n    // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).\n    // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),\n    // which allows many unexpected forms of email addresses and will easily match\n    // a typographical error.\n    //\n    // If the field value isn't a valid email address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid email address\n    //   string value = 1 [(buf.validate.field).string.email = true];\n    // }\n    // ```\n    bool email = 12 [\n      (predefined).cel = {\n        id: \"string.email\"\n        message: \"value must be a valid email address\"\n        expression: \"!rules.email || this == '' || this.isEmail()\"\n      },\n      (predefined).cel = {\n        id: \"string.email_empty\"\n        message: \"value is empty, which is not a valid email address\"\n        expression: \"!rules.email || this != ''\"\n      }\n    ];\n\n    // `hostname` specifies that the field value must be a valid hostname, for\n    // example \"foo.example.com\".\n    //\n    // A valid hostname follows the rules below:\n    // - The name consists of one or more labels, separated by a dot (\".\").\n    // - Each label can be 1 to 63 alphanumeric characters.\n    // - A label can contain hyphens (\"-\"), but must not start or end with a hyphen.\n    // - The right-most label must not be digits only.\n    // - The name can have a trailing dot—for example, \"foo.example.com.\".\n    // - The name can be 253 characters at most, excluding the optional trailing dot.\n    //\n    // If the field value isn't a valid hostname, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname\n    //   string value = 1 [(buf.validate.field).string.hostname = true];\n    // }\n    // ```\n    bool hostname = 13 [\n      (predefined).cel = {\n        id: \"string.hostname\"\n        message: \"value must be a valid hostname\"\n        expression: \"!rules.hostname || this == '' || this.isHostname()\"\n      },\n      (predefined).cel = {\n        id: \"string.hostname_empty\"\n        message: \"value is empty, which is not a valid hostname\"\n        expression: \"!rules.hostname || this != ''\"\n      }\n    ];\n\n    // `ip` specifies that the field value must be a valid IP (v4 or v6) address.\n    //\n    // IPv4 addresses are expected in the dotted decimal format—for example, \"192.168.5.21\".\n    // IPv6 addresses are expected in their text representation—for example, \"::1\",\n    // or \"2001:0DB8:ABCD:0012::0\".\n    //\n    // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone identifiers for IPv6 addresses (for example, \"fe80::a%en1\") are supported.\n    //\n    // If the field value isn't a valid IP address, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP address\n    //   string value = 1 [(buf.validate.field).string.ip = true];\n    // }\n    // ```\n    bool ip = 14 [\n      (predefined).cel = {\n        id: \"string.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this == '' || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this != ''\"\n      }\n    ];\n\n    // `ipv4` specifies that the field value must be a valid IPv4 address—for\n    // example \"192.168.5.21\". If the field value isn't a valid IPv4 address, an\n    // error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address\n    //   string value = 1 [(buf.validate.field).string.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 15 [\n      (predefined).cel = {\n        id: \"string.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this == '' || this.isIp(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this != ''\"\n      }\n    ];\n\n    // `ipv6` specifies that the field value must be a valid IPv6 address—for\n    // example \"::1\", or \"d7a:115c:a1e0:ab12:4843:cd96:626b:430b\". If the field\n    // value is not a valid IPv6 address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address\n    //   string value = 1 [(buf.validate.field).string.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 16 [\n      (predefined).cel = {\n        id: \"string.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this == '' || this.isIp(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this != ''\"\n      }\n    ];\n\n    // `uri` specifies that the field value must be a valid URI, for example\n    // \"https://example.com/foo/bar?baz=quux#frag\".\n    //\n    // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI\n    //   string value = 1 [(buf.validate.field).string.uri = true];\n    // }\n    // ```\n    bool uri = 17 [\n      (predefined).cel = {\n        id: \"string.uri\"\n        message: \"value must be a valid URI\"\n        expression: \"!rules.uri || this == '' || this.isUri()\"\n      },\n      (predefined).cel = {\n        id: \"string.uri_empty\"\n        message: \"value is empty, which is not a valid URI\"\n        expression: \"!rules.uri || this != ''\"\n      }\n    ];\n\n    // `uri_ref` specifies that the field value must be a valid URI Reference—either\n    // a URI such as \"https://example.com/foo/bar?baz=quux#frag\", or a Relative\n    // Reference such as \"./foo/bar?query\".\n    //\n    // URI, URI Reference, and Relative Reference are defined in the internet\n    // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone\n    // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI Reference, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI Reference\n    //   string value = 1 [(buf.validate.field).string.uri_ref = true];\n    // }\n    // ```\n    bool uri_ref = 18 [(predefined).cel = {\n      id: \"string.uri_ref\"\n      message: \"value must be a valid URI Reference\"\n      expression: \"!rules.uri_ref || this.isUriRef()\"\n    }];\n\n    // `address` specifies that the field value must be either a valid hostname\n    // (for example, \"example.com\"), or a valid IP (v4 or v6) address (for example,\n    // \"192.168.0.1\", or \"::1\"). If the field value isn't a valid hostname or IP,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname, or ip address\n    //   string value = 1 [(buf.validate.field).string.address = true];\n    // }\n    // ```\n    bool address = 21 [\n      (predefined).cel = {\n        id: \"string.address\"\n        message: \"value must be a valid hostname, or ip address\"\n        expression: \"!rules.address || this == '' || this.isHostname() || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.address_empty\"\n        message: \"value is empty, which is not a valid hostname, or ip address\"\n        expression: \"!rules.address || this != ''\"\n      }\n    ];\n\n    // `uuid` specifies that the field value must be a valid UUID as defined by\n    // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the\n    // field value isn't a valid UUID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid UUID\n    //   string value = 1 [(buf.validate.field).string.uuid = true];\n    // }\n    // ```\n    bool uuid = 22 [\n      (predefined).cel = {\n        id: \"string.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this != ''\"\n      }\n    ];\n\n    // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes\n    // omitted. If the field value isn't a valid UUID without dashes, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid trimmed UUID\n    //   string value = 1 [(buf.validate.field).string.tuuid = true];\n    // }\n    // ```\n    bool tuuid = 33 [\n      (predefined).cel = {\n        id: \"string.tuuid\"\n        message: \"value must be a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this == '' || this.matches('^[0-9a-fA-F]{32}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.tuuid_empty\"\n        message: \"value is empty, which is not a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this != ''\"\n      }\n    ];\n\n    // `ip_with_prefixlen` specifies that the field value must be a valid IP\n    // (v4 or v6) address with prefix length—for example, \"192.168.5.21/16\" or\n    // \"2001:0DB8:ABCD:0012::F1/64\". If the field value isn't a valid IP with\n    // prefix length, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP with prefix length\n    //    string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];\n    // }\n    // ```\n    bool ip_with_prefixlen = 26 [\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this == '' || this.isIpPrefix()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv4_with_prefixlen` specifies that the field value must be a valid\n    // IPv4 address with prefix length—for example, \"192.168.5.21/16\". If the\n    // field value isn't a valid IPv4 address with prefix length, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address with prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv4_with_prefixlen = 27 [\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen\"\n        message: \"value must be a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv6_with_prefixlen` specifies that the field value must be a valid\n    // IPv6 address with prefix length—for example, \"2001:0DB8:ABCD:0012::F1/64\".\n    // If the field value is not a valid IPv6 address with prefix length,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv6_with_prefixlen = 28 [\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen\"\n        message: \"value must be a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)\n    // prefix—for example, \"192.168.0.0/16\" or \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value isn't a valid IP prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP prefix\n    //    string value = 1 [(buf.validate.field).string.ip_prefix = true];\n    // }\n    // ```\n    bool ip_prefix = 29 [\n      (predefined).cel = {\n        id: \"string.ip_prefix\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this == '' || this.isIpPrefix(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_prefix_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv4_prefix` specifies that the field value must be a valid IPv4\n    // prefix, for example \"192.168.0.0/16\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"192.168.0.0/16\" designates the left-most 16 bits for the prefix,\n    // and the remaining 16 bits must be zero.\n    //\n    // If the field value isn't a valid IPv4 prefix, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv4_prefix = true];\n    // }\n    // ```\n    bool ipv4_prefix = 30 [\n      (predefined).cel = {\n        id: \"string.ipv4_prefix\"\n        message: \"value must be a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this == '' || this.isIpPrefix(4, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for\n    // example, \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value is not a valid IPv6 prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv6_prefix = true];\n    // }\n    // ```\n    bool ipv6_prefix = 31 [\n      (predefined).cel = {\n        id: \"string.ipv6_prefix\"\n        message: \"value must be a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this == '' || this.isIpPrefix(6, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this != ''\"\n      }\n    ];\n\n    // `host_and_port` specifies that the field value must be valid host/port\n    // pair—for example, \"example.com:8080\".\n    //\n    // The host can be one of:\n    //- An IPv4 address in dotted decimal format—for example, \"192.168.5.21\".\n    //- An IPv6 address enclosed in square brackets—for example, \"[2001:0DB8:ABCD:0012::F1]\".\n    //- A hostname—for example, \"example.com\".\n    //\n    // The port is separated by a colon. It must be non-empty, with a decimal number\n    // in the range of 0-65535, inclusive.\n    bool host_and_port = 32 [\n      (predefined).cel = {\n        id: \"string.host_and_port\"\n        message: \"value must be a valid host (hostname or IP address) and port pair\"\n        expression: \"!rules.host_and_port || this == '' || this.isHostAndPort(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.host_and_port_empty\"\n        message: \"value is empty, which is not a valid host and port pair\"\n        expression: \"!rules.host_and_port || this != ''\"\n      }\n    ];\n\n    // `ulid` specifies that the field value must be a valid ULID (Universally Unique\n    // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).\n    // If the field value isn't a valid ULID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid ULID\n    //   string value = 1 [(buf.validate.field).string.ulid = true];\n    // }\n    // ```\n    bool ulid = 35 [\n      (predefined).cel = {\n        id: \"string.ulid\"\n        message: \"value must be a valid ULID\"\n        expression: \"!rules.ulid || this == '' || this.matches('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.ulid_empty\"\n        message: \"value is empty, which is not a valid ULID\"\n        expression: \"!rules.ulid || this != ''\"\n      }\n    ];\n\n    // `well_known_regex` specifies a common well-known pattern\n    // defined as a regex. If the field value doesn't match the well-known\n    // regex, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid HTTP header value\n    //   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];\n    // }\n    // ```\n    //\n    // #### KnownRegex\n    //\n    // `well_known_regex` contains some well-known patterns.\n    //\n    // | Name                          | Number | Description                               |\n    // |-------------------------------|--------|-------------------------------------------|\n    // | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |\n    // | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2)  |\n    // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |\n    KnownRegex well_known_regex = 24 [\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name\"\n        message: \"value must be a valid HTTP header name\"\n        expression:\n          \"rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^:?[0-9a-zA-Z!#$%&\\\\'*+-.^_|~\\\\x60]+$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]+$')\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name_empty\"\n        message: \"value is empty, which is not a valid HTTP header name\"\n        expression: \"rules.well_known_regex != 1 || this != ''\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_value\"\n        message: \"value must be a valid HTTP header value\"\n        expression:\n          \"rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^[^\\\\u0000-\\\\u0008\\\\u000A-\\\\u001F\\\\u007F]*$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]*$')\"\n      }\n    ];\n  }\n\n  // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to\n  // enable strict header validation. By default, this is true, and HTTP header\n  // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser\n  // validations that only disallow `\\r\\n\\0` characters, which can be used to\n  // bypass header matching rules.\n  //\n  // ```proto\n  // message MyString {\n  //   // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.\n  //   string value = 1 [(buf.validate.field).string.strict = false];\n  // }\n  // ```\n  optional bool strict = 25;\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyString {\n  //   string value = 1 [\n  //     (buf.validate.field).string.example = \"hello\",\n  //     (buf.validate.field).string.example = \"world\"\n  //   ];\n  // }\n  // ```\n  repeated string example = 34 [(predefined).cel = {\n    id: \"string.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// KnownRegex contains some well-known patterns.\nenum KnownRegex {\n  KNOWN_REGEX_UNSPECIFIED = 0;\n\n  // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2).\n  KNOWN_REGEX_HTTP_HEADER_NAME = 1;\n\n  // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4).\n  KNOWN_REGEX_HTTP_HEADER_VALUE = 2;\n}\n\n// BytesRules describe the rules applied to `bytes` values. These rules\n// may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.\nmessage BytesRules {\n  // `const` requires the field value to exactly match the specified bytes\n  // value. If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be \"\\x01\\x02\\x03\\x04\"\n  //   bytes value = 1 [(buf.validate.field).bytes.const = \"\\x01\\x02\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes const = 1 [(predefined).cel = {\n    id: \"bytes.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must be %x'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` requires the field value to have the specified length in bytes.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be 4 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.len = 4];\n  // }\n  // ```\n  optional uint64 len = 13 [(predefined).cel = {\n    id: \"bytes.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s bytes'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` requires the field value to have at least the specified minimum\n  // length in bytes.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be at least 2 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"bytes.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s bytes'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` requires the field value to have at most the specified maximum\n  // length in bytes.\n  // If the field value exceeds the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be at most 6 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"bytes.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value must be at most %s bytes'.format([rules.max_len]) : ''\"\n  }];\n\n  // `pattern` requires the field value to match the specified regular\n  // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).\n  // The value of the field must be valid UTF-8 or validation will fail with a\n  // runtime error.\n  // If the field value doesn't match the pattern, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must match regex pattern \"^[a-zA-Z0-9]+$\".\n  //   optional bytes value = 1 [(buf.validate.field).bytes.pattern = \"^[a-zA-Z0-9]+$\"];\n  // }\n  // ```\n  optional string pattern = 4 [(predefined).cel = {\n    id: \"bytes.pattern\"\n    expression: \"!string(this).matches(rules.pattern) ? 'value must match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` requires the field value to have the specified bytes at the\n  // beginning of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have prefix \\x01\\x02\n  //   optional bytes value = 1 [(buf.validate.field).bytes.prefix = \"\\x01\\x02\"];\n  // }\n  // ```\n  optional bytes prefix = 5 [(predefined).cel = {\n    id: \"bytes.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix %x'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` requires the field value to have the specified bytes at the end\n  // of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have suffix \\x03\\x04\n  //   optional bytes value = 1 [(buf.validate.field).bytes.suffix = \"\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes suffix = 6 [(predefined).cel = {\n    id: \"bytes.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix %x'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` requires the field value to have the specified bytes anywhere in\n  // the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not contain \\x02\\x03\n  //   optional bytes value = 1 [(buf.validate.field).bytes.contains = \"\\x02\\x03\"];\n  // }\n  // ```\n  optional bytes contains = 7 [(predefined).cel = {\n    id: \"bytes.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain %x'.format([rules.contains]) : ''\"\n  }];\n\n  // `in` requires the field value to be equal to one of the specified\n  // values. If the field value doesn't match any of the specified values, an\n  // error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes in = 8 [(predefined).cel = {\n    id: \"bytes.in\"\n    expression: \"getField(rules, 'in').size() > 0 && !(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the specified\n  // values.\n  // If the field value matches any of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must not in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.not_in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes not_in = 9 [(predefined).cel = {\n    id: \"bytes.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // WellKnown rules provide advanced rules against common byte\n  // patterns\n  oneof well_known {\n    // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IP address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ip = true];\n    // }\n    // ```\n    bool ip = 10 [\n      (predefined).cel = {\n        id: \"bytes.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this.size() != 0\"\n      }\n    ];\n\n    // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv4 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 11 [\n      (predefined).cel = {\n        id: \"bytes.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() == 0 || this.size() == 4\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() != 0\"\n      }\n    ];\n\n    // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv6 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 12 [\n      (predefined).cel = {\n        id: \"bytes.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() != 0\"\n      }\n    ];\n\n    // `uuid` ensures that the field `value` encodes the 128-bit UUID data as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).\n    // The field must contain exactly 16 bytes\n    // representing the UUID. If the field value isn't a valid UUID, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid UUID\n    //   optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];\n    // }\n    // ```\n    bool uuid = 15 [\n      (predefined).cel = {\n        id: \"bytes.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this.size() != 0\"\n      }\n    ];\n  }\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBytes {\n  //   bytes value = 1 [\n  //     (buf.validate.field).bytes.example = \"\\x01\\x02\",\n  //     (buf.validate.field).bytes.example = \"\\x02\\x03\"\n  //   ];\n  // }\n  // ```\n  repeated bytes example = 14 [(predefined).cel = {\n    id: \"bytes.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// EnumRules describe the rules applied to `enum` values.\nmessage EnumRules {\n  // `const` requires the field value to exactly match the specified enum value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be exactly MY_ENUM_VALUE1.\n  //   MyEnum value = 1 [(buf.validate.field).enum.const = 1];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"enum.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `defined_only` requires the field value to be one of the defined values for\n  // this enum, failing on any undefined value.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be a defined value of MyEnum.\n  //   MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];\n  // }\n  // ```\n  optional bool defined_only = 2;\n\n  // `in` requires the field value to be equal to one of the\n  //specified enum values. If the field value doesn't match any of the\n  //specified values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be equal to one of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 in = 3 [(predefined).cel = {\n    id: \"enum.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the\n  //specified enum values. If the field value matches one of the specified\n  // values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must not be equal to any of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 not_in = 4 [(predefined).cel = {\n    id: \"enum.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //     (buf.validate.field).enum.example = 1,\n  //     (buf.validate.field).enum.example = 2\n  // }\n  // ```\n  repeated int32 example = 5 [(predefined).cel = {\n    id: \"enum.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// RepeatedRules describe the rules applied to `repeated` values.\nmessage RepeatedRules {\n  // `min_items` requires that this field must contain at least the specified\n  // minimum number of items.\n  //\n  // Note that `min_items = 1` is equivalent to setting a field as `required`.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain at least  2 items\n  //   repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];\n  // }\n  // ```\n  optional uint64 min_items = 1 [(predefined).cel = {\n    id: \"repeated.min_items\"\n    expression: \"uint(this.size()) < rules.min_items ? 'value must contain at least %d item(s)'.format([rules.min_items]) : ''\"\n  }];\n\n  // `max_items` denotes that this field must not exceed a\n  // certain number of items as the upper limit. If the field contains more\n  // items than specified, an error message will be generated, requiring the\n  // field to maintain no more than the specified number of items.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain no more than 3 item(s)\n  //   repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];\n  // }\n  // ```\n  optional uint64 max_items = 2 [(predefined).cel = {\n    id: \"repeated.max_items\"\n    expression: \"uint(this.size()) > rules.max_items ? 'value must contain no more than %s item(s)'.format([rules.max_items]) : ''\"\n  }];\n\n  // `unique` indicates that all elements in this field must\n  // be unique. This rule is strictly applicable to scalar and enum\n  // types, with message types not being supported.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // repeated value must contain unique items\n  //   repeated string value = 1 [(buf.validate.field).repeated.unique = true];\n  // }\n  // ```\n  optional bool unique = 3 [(predefined).cel = {\n    id: \"repeated.unique\"\n    message: \"repeated value must contain unique items\"\n    expression: \"!rules.unique || this.unique()\"\n  }];\n\n  // `items` details the rules to be applied to each item\n  // in the field. Even for repeated message fields, validation is executed\n  // against each item unless `ignore` is specified.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // The items in the field `value` must follow the specified rules.\n  //   repeated string value = 1 [(buf.validate.field).repeated.items = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Repeated items\n  // cannot be unset.\n  optional FieldRules items = 4;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// MapRules describe the rules applied to `map` values.\nmessage MapRules {\n  // Specifies the minimum number of key-value pairs allowed. If the field has\n  // fewer key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at least 2 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];\n  // }\n  // ```\n  optional uint64 min_pairs = 1 [(predefined).cel = {\n    id: \"map.min_pairs\"\n    expression: \"uint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''\"\n  }];\n\n  // Specifies the maximum number of key-value pairs allowed. If the field has\n  // more key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at most 3 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];\n  // }\n  // ```\n  optional uint64 max_pairs = 2 [(predefined).cel = {\n    id: \"map.max_pairs\"\n    expression: \"uint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''\"\n  }];\n\n  // Specifies the rules to be applied to each key in the field.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The keys in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.keys = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Map keys cannot be unset.\n  optional FieldRules keys = 4;\n\n  // Specifies the rules to be applied to the value of each key in the\n  // field. Message values will still have their validations evaluated unless\n  // `ignore` is specified.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The values in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.values = {\n  //     string: {\n  //       min_len: 5\n  //       max_len: 20\n  //     }\n  //   }];\n  // }\n  // ```\n  // Note that the `required` rule does not apply. Map values cannot be unset.\n  optional FieldRules values = 5;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type.\nmessage AnyRules {\n  // `in` requires the field's `type_url` to be equal to one of the\n  //specified values. If it doesn't match any of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must have a `type_url` equal to one of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       in: [\"type.googleapis.com/MyType1\", \"type.googleapis.com/MyType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2;\n\n  // requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must not have a `type_url` equal to any of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       not_in: [\"type.googleapis.com/ForbiddenType1\", \"type.googleapis.com/ForbiddenType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3;\n}\n\n// DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type.\nmessage DurationRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must equal 5s\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = \"5s\"];\n  // }\n  // ```\n  optional google.protobuf.Duration const = 2 [(predefined).cel = {\n    id: \"duration.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,\n    // exclusive. If the field's value is greater than or equal to the specified\n    // value, an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than 5s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = \"5s\"];\n    // }\n    // ```\n    google.protobuf.Duration lt = 3 [(predefined).cel = {\n      id: \"duration.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` indicates that the field must be less than or equal to the specified\n    // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than or equal to 10s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = \"10s\"];\n    // }\n    // ```\n    google.protobuf.Duration lte = 4 [(predefined).cel = {\n      id: \"duration.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the duration field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be greater than 5s [duration.gt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];\n    //\n    //   // duration must be greater than 5s and less than 10s [duration.gt_lt]\n    //   google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //   // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]\n    //   google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gt = 5 [\n      (predefined).cel = {\n        id: \"duration.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the duration field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value must\n    // be outside the specified range. If the field value doesn't meet the\n    // required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //  // duration must be greater than or equal to 5s [duration.gte]\n    //  google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];\n    //\n    //  // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]\n    //  google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //  // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]\n    //  google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gte = 6 [\n      (predefined).cel = {\n        id: \"duration.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value doesn't correspond to any of the specified values,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration in = 7 [(predefined).cel = {\n    id: \"duration.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` denotes that the field must not be equal to\n  // any of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value matches any of these values, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must not be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration not_in = 8 [(predefined).cel = {\n    id: \"duration.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDuration {\n  //   google.protobuf.Duration value = 1 [\n  //     (buf.validate.field).duration.example = { seconds: 1 },\n  //     (buf.validate.field).duration.example = { seconds: 2 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Duration example = 9 [(predefined).cel = {\n    id: \"duration.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type.\nmessage FieldMaskRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   // value must equal [\"a\"]\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {\n  //       paths: [\"a\"]\n  //   }];\n  // }\n  // ```\n  optional google.protobuf.FieldMask const = 1 [(predefined).cel = {\n    id: \"field_mask.const\"\n    expression: \"this.paths != getField(rules, 'const').paths ? 'value must equal paths %s'.format([getField(rules, 'const').paths]) : ''\"\n  }];\n\n  // `in` requires the field value to only contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths doesn't match the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask must only contain paths listed in `in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       in: [\"a\", \"b\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2 [(predefined).cel = {\n    id: \"field_mask.in\"\n    expression: \"!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'value must only contain paths in %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths matches the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask shall not contain paths listed in `not_in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       not_in: [\"forbidden\", \"immutable\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3 [(predefined).cel = {\n    id: \"field_mask.not_in\"\n    expression: \"!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'value must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   google.protobuf.FieldMask value = 1 [\n  //     (buf.validate.field).field_mask.example = { paths: [\"a\", \"b\"] },\n  //     (buf.validate.field).field_mask.example = { paths: [\"c.a\", \"d\"] },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.FieldMask example = 4 [(predefined).cel = {\n    id: \"field_mask.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.\nmessage TimestampRules {\n  // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must equal 2023-05-03T10:00:00Z\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];\n  // }\n  // ```\n  optional google.protobuf.Timestamp const = 2 [(predefined).cel = {\n    id: \"timestamp.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // requires the duration field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be less than 'P3D' [duration.lt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lt = 3 [(predefined).cel = {\n      id: \"timestamp.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lte = 4 [(predefined).cel = {\n      id: \"timestamp.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n\n    // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //  // value must be less than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];\n    // }\n    // ```\n    bool lt_now = 7 [(predefined).cel = {\n      id: \"timestamp.lt_now\"\n      expression: \"(rules.lt_now && this > now) ? 'value must be less than now' : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the timestamp field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gt = 5 [\n      (predefined).cel = {\n        id: \"timestamp.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the timestamp field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value\n    // must be outside the specified range. If the field value doesn't meet\n    // the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gte = 6 [\n      (predefined).cel = {\n        id: \"timestamp.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // value must be greater than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];\n    // }\n    // ```\n    bool gt_now = 8 [(predefined).cel = {\n      id: \"timestamp.gt_now\"\n      expression: \"(rules.gt_now && this < now) ? 'value must be greater than now' : ''\"\n    }];\n  }\n\n  // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must be within 1 hour of now\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];\n  // }\n  // ```\n  optional google.protobuf.Duration within = 9 [(predefined).cel = {\n    id: \"timestamp.within\"\n    expression: \"this < now-rules.within || this > now+rules.within ? 'value must be within %s of now'.format([rules.within]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   google.protobuf.Timestamp value = 1 [\n  //     (buf.validate.field).timestamp.example = { seconds: 1672444800 },\n  //     (buf.validate.field).timestamp.example = { seconds: 1672531200 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Timestamp example = 10 [(predefined).cel = {\n    id: \"timestamp.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// `Violations` is a collection of `Violation` messages. This message type is returned by\n// Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules.\n// Each individual violation is represented by a `Violation` message.\nmessage Violations {\n  // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.\n  repeated Violation violations = 1;\n}\n\n// `Violation` represents a single instance where a validation rule, expressed\n// as a `Rule`, was not met. It provides information about the field that\n// caused the violation, the specific rule that wasn't fulfilled, and a\n// human-readable error message.\n//\n// For example, consider the following message:\n//\n// ```proto\n// message User {\n//     int32 age = 1 [(buf.validate.field).cel = {\n//         id: \"user.age\",\n//         expression: \"this < 18 ? 'User must be at least 18 years old' : ''\",\n//     }];\n// }\n// ```\n//\n// It could produce the following violation:\n//\n// ```json\n// {\n//   \"ruleId\": \"user.age\",\n//   \"message\": \"User must be at least 18 years old\",\n//   \"field\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 1,\n//         \"fieldName\": \"age\",\n//         \"fieldType\": \"TYPE_INT32\"\n//       }\n//     ]\n//   },\n//   \"rule\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 23,\n//         \"fieldName\": \"cel\",\n//         \"fieldType\": \"TYPE_MESSAGE\",\n//         \"index\": \"0\"\n//       }\n//     ]\n//   }\n// }\n// ```\nmessage Violation {\n  // `field` is a machine-readable path to the field that failed validation.\n  // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  // }\n  // ```\n  //\n  // It could produce the following violation:\n  //\n  // ```textproto\n  // violation {\n  //   field { element { field_number: 1, field_name: \"a\", field_type: 8 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath field = 5;\n\n  // `rule` is a machine-readable path that points to the specific rule that failed validation.\n  // This will be a nested field starting from the FieldRules of the field that failed validation.\n  // For custom rules, this will provide the path of the rule, e.g. `cel[0]`.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  //   bool b = 2 [(buf.validate.field).cel = {\n  //     id: \"custom_rule\",\n  //     expression: \"!this ? 'b must be true': ''\"\n  //   }]\n  // }\n  // ```\n  //\n  // It could produce the following violations:\n  //\n  // ```textproto\n  // violation {\n  //   rule { element { field_number: 25, field_name: \"required\", field_type: 8 } }\n  //   ...\n  // }\n  // violation {\n  //   rule { element { field_number: 23, field_name: \"cel\", field_type: 11, index: 0 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath rule = 6;\n\n  // `rule_id` is the unique identifier of the `Rule` that was not fulfilled.\n  // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.\n  optional string rule_id = 2;\n\n  // `message` is a human-readable error message that describes the nature of the violation.\n  // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.\n  optional string message = 3;\n\n  // `for_key` indicates whether the violation was caused by a map key, rather than a value.\n  optional bool for_key = 4;\n\n  reserved 1;\n  reserved \"field_path\";\n}\n\n// `FieldPath` provides a path to a nested protobuf field.\n//\n// This message provides enough information to render a dotted field path even without protobuf descriptors.\n// It also provides enough information to resolve a nested field through unknown wire data.\nmessage FieldPath {\n  // `elements` contains each element of the path, starting from the root and recursing downward.\n  repeated FieldPathElement elements = 1;\n}\n\n// `FieldPathElement` provides enough information to nest through a single protobuf field.\n//\n// If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.\n// A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.\n// The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.\nmessage FieldPathElement {\n  // `field_number` is the field number this path element refers to.\n  optional int32 field_number = 1;\n\n  // `field_name` contains the field name this path element refers to.\n  // This can be used to display a human-readable path even if the field number is unknown.\n  optional string field_name = 2;\n\n  // `field_type` specifies the type of this field. When using reflection, this value is not needed.\n  //\n  // This value is provided to make it possible to traverse unknown fields through wire data.\n  // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.\n  //\n  // [1]: https://protobuf.dev/programming-guides/encoding/#packed\n  // [2]: https://protobuf.dev/programming-guides/encoding/#groups\n  //\n  // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and\n  // can be explicitly used in Protocol Buffers 2023 Edition.\n  optional google.protobuf.FieldDescriptorProto.Type field_type = 3;\n\n  // `key_type` specifies the map key type of this field. This value is useful when traversing\n  // unknown fields through wire data: specifically, it allows handling the differences between\n  // different integer encodings.\n  optional google.protobuf.FieldDescriptorProto.Type key_type = 4;\n\n  // `value_type` specifies map value type of this field. This is useful if you want to display a\n  // value inside unknown fields through wire data.\n  optional google.protobuf.FieldDescriptorProto.Type value_type = 5;\n\n  // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field.\n  oneof subscript {\n    // `index` specifies a 0-based index into a repeated field.\n    uint64 index = 6;\n\n    // `bool_key` specifies a map key of type bool.\n    bool bool_key = 7;\n\n    // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.\n    int64 int_key = 8;\n\n    // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.\n    uint64 uint_key = 9;\n\n    // `string_key` specifies a map key of type string.\n    string string_key = 10;\n  }\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/workspace_symbols/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: .\nlint:\n  use:\n    - STANDARD\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/buf/buflsp/testdata/workspace_symbols/types.proto",
    "content": "syntax = \"proto3\";\n\npackage workspace_symbols.v1;\n\nenum Color {\n  COLOR_UNSPECIFIED = 0;\n  COLOR_RED = 1;\n  COLOR_BLUE = 2;\n}\n\nmessage Label {\n  string key = 1;\n  string value = 2;\n}\n"
  },
  {
    "path": "private/buf/buflsp/testdata/workspace_symbols/workspace_symbols.proto",
    "content": "syntax = \"proto3\";\n\npackage workspace_symbols.v1;\n\nimport \"types.proto\";\n\nmessage Item {\n  string id = 1;\n  Color color = 2;\n  Label label = 3;\n  repeated Item related = 4;\n}\n\nmessage Container {\n  string name = 1;\n  repeated Item items = 2;\n  Color default_color = 3;\n}\n\nservice ItemService {\n  rpc GetItem(GetItemRequest) returns (GetItemResponse);\n  rpc ListItems(ListItemsRequest) returns (ListItemsResponse);\n}\n\nmessage GetItemRequest {\n  string item_id = 1;\n}\n\nmessage GetItemResponse {\n  Item item = 1;\n}\n\nmessage ListItemsRequest {\n  string container_name = 1;\n}\n\nmessage ListItemsResponse {\n  repeated Item items = 1;\n}\n\nmessage LegacyItem {\n  option deprecated = true;\n  string id = 1;\n}\n"
  },
  {
    "path": "private/buf/buflsp/type_definition_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestTypeDefinition(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/type_definition/type_definition.proto\")\n\trequire.NoError(t, err)\n\n\ttypesProtoPath, err := filepath.Abs(\"testdata/type_definition/types.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\ttypesURI := buflsp.FilePathToURI(typesProtoPath)\n\n\ttests := []struct {\n\t\tname                string\n\t\tline                uint32\n\t\tcharacter           uint32\n\t\texpectedTypeDefURI  protocol.URI\n\t\texpectedTypeDefLine uint32\n\t\texpectedTypeDefChar uint32\n\t}{\n\t\t{\n\t\t\tname:                \"type_definition_of_category_field\",\n\t\t\tline:                12, // Line with \"Category category = 2;\"\n\t\t\tcharacter:           2,  // On \"Category\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 31, // message Category definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_vendor_field\",\n\t\t\tline:                15, // Line with \"Vendor vendor = 3;\"\n\t\t\tcharacter:           2,  // On \"Vendor\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 40, // message Vendor definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_tags_field\",\n\t\t\tline:                18, // Line with \"repeated Tag tags = 4;\"\n\t\t\tcharacter:           13, // On \"Tag\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 49, // message Tag definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_metadata_field\",\n\t\t\tline:                21, // Line with \"map<string, Metadata> metadata = 5;\"\n\t\t\tcharacter:           16, // On \"Metadata\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 58, // message Metadata definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_parent_field\",\n\t\t\tline:                36, // Line with \"Category parent = 2;\"\n\t\t\tcharacter:           2,  // On \"Category\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 31, // message Category definition (recursive reference)\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_type_field\",\n\t\t\tline:                45, // Line with \"VendorType type = 2;\"\n\t\t\tcharacter:           2,  // On \"VendorType\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 64, // enum VendorType definition\n\t\t\texpectedTypeDefChar: 5,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_product_field\",\n\t\t\tline:                81, // Line with \"Product product = 2;\" in Order message\n\t\t\tcharacter:           2,  // On \"Product\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 7, // message Product definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_status_field\",\n\t\t\tline:                84, // Line with \"OrderStatus status = 3;\"\n\t\t\tcharacter:           2,  // On \"OrderStatus\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 109, // enum OrderStatus definition\n\t\t\texpectedTypeDefChar: 5,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_customer_field\",\n\t\t\tline:                87, // Line with \"Customer customer = 4;\"\n\t\t\tcharacter:           2,  // On \"Customer\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 91, // message Customer definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_contact_field\",\n\t\t\tline:                96, // Line with \"Contact contact = 2;\"\n\t\t\tcharacter:           2,  // On \"Contact\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 100, // message Contact definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_product_in_request\",\n\t\t\tline:                144, // Line with \"Product product = 1;\" in CreateProductRequest\n\t\t\tcharacter:           2,   // On \"Product\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 7, // message Product definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_category_in_request\",\n\t\t\tline:                147, // Line with \"Category category = 2;\" in CreateProductRequest\n\t\t\tcharacter:           2,   // On \"Category\" type name\n\t\t\texpectedTypeDefURI:  testURI,\n\t\t\texpectedTypeDefLine: 31, // message Category definition\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_priority_imported_type\",\n\t\t\tline:                24, // Line with \"Priority priority = 6;\"\n\t\t\tcharacter:           2,  // On \"Priority\" type name\n\t\t\texpectedTypeDefURI:  typesURI,\n\t\t\texpectedTypeDefLine: 5, // enum Priority definition in types.proto\n\t\t\texpectedTypeDefChar: 5,\n\t\t},\n\t\t{\n\t\t\tname:                \"type_definition_of_audit_imported_type\",\n\t\t\tline:                27, // Line with \"Audit audit = 7;\"\n\t\t\tcharacter:           2,  // On \"Audit\" type name\n\t\t\texpectedTypeDefURI:  typesURI,\n\t\t\texpectedTypeDefLine: 17, // message Audit definition in types.proto\n\t\t\texpectedTypeDefChar: 8,\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvar locations []protocol.Location\n\t\t\t_, typeDefErr := clientJSONConn.Call(ctx, protocol.MethodTextDocumentTypeDefinition, protocol.TypeDefinitionParams{\n\t\t\t\tTextDocumentPositionParams: protocol.TextDocumentPositionParams{\n\t\t\t\t\tTextDocument: protocol.TextDocumentIdentifier{\n\t\t\t\t\t\tURI: testURI,\n\t\t\t\t\t},\n\t\t\t\t\tPosition: protocol.Position{\n\t\t\t\t\t\tLine:      tt.line,\n\t\t\t\t\t\tCharacter: tt.character,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}, &locations)\n\t\t\trequire.NoError(t, typeDefErr)\n\n\t\t\trequire.Len(t, locations, 1, \"expected exactly one type definition location\")\n\t\t\tlocation := locations[0]\n\t\t\tassert.Equal(t, tt.expectedTypeDefURI, location.URI)\n\t\t\tassert.Equal(t, tt.expectedTypeDefLine, location.Range.Start.Line)\n\t\t\tassert.Equal(t, tt.expectedTypeDefChar, location.Range.Start.Character)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/uri.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n\n\t\"go.lsp.dev/protocol\"\n\t\"go.lsp.dev/uri\"\n)\n\n// FilePathToURI converts a file path to a properly encoded URI.\nfunc FilePathToURI(path string) protocol.URI {\n\treturn normalizeURI(uri.File(path))\n}\n\n// normalizeURI encodes a URI to match VS Code's microsoft/vscode-uri behavior.\n//\n// Go's net/url follows RFC 3986 and permits '@' and ':' unencoded in path\n// components (valid pchar); vscode-uri always encodes them. vscode-uri also\n// lowercases Windows drive letters. When URIs differ, LSP operations like\n// go-to-definition silently fail because the client and server URIs don't match.\nfunc normalizeURI(u protocol.URI) protocol.URI {\n\tstr := string(u)\n\n\tafter, found := strings.CutPrefix(str, \"file:///\")\n\tif !found {\n\t\t// Non-file URIs: only encode @.\n\t\treturn protocol.URI(strings.ReplaceAll(str, \"@\", \"%40\"))\n\t}\n\n\tsegments := strings.Split(after, \"/\")\n\tfor i, segment := range segments {\n\t\t// Decode first to avoid double-encoding already-normalized URIs.\n\t\t// PathUnescape only fails on malformed sequences (e.g. %2G); falling\n\t\t// back to the raw segment is the best we can do.\n\t\tdecoded, err := url.PathUnescape(segment)\n\t\tif err != nil {\n\t\t\tdecoded = segment\n\t\t}\n\t\t// PathEscape encodes spaces as %20 (not +) and most special chars,\n\t\t// but permits '@' and ':' as RFC 3986 pchar. Encode those manually.\n\t\tencoded := url.PathEscape(decoded)\n\t\tencoded = strings.ReplaceAll(encoded, \"@\", \"%40\")\n\t\tencoded = strings.ReplaceAll(encoded, \":\", \"%3A\")\n\t\tsegments[i] = encoded\n\t}\n\n\t// vscode-uri lowercases Windows drive letters: C%3A → c%3A.\n\t// 'A'+32 == 'a' by ASCII identity; segments[0] is e.g. \"C%3A\" (4 bytes).\n\tif len(segments[0]) == 4 &&\n\t\tsegments[0][0] >= 'A' && segments[0][0] <= 'Z' &&\n\t\tsegments[0][1:] == \"%3A\" {\n\t\tsegments[0] = string(segments[0][0]+32) + \"%3A\"\n\t}\n\n\treturn protocol.URI(\"file:///\" + strings.Join(segments, \"/\"))\n}\n"
  },
  {
    "path": "private/buf/buflsp/uri_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestNormalizeURI(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tname     string\n\t\tinput    protocol.URI\n\t\texpected protocol.URI\n\t}{\n\t\t{\n\t\t\tname:     \"unix-path-unchanged\",\n\t\t\tinput:    \"file:///home/user/project/foo.proto\",\n\t\t\texpected: \"file:///home/user/project/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"at-sign-encoded\",\n\t\t\tinput:    \"file:///home/user@host/project/foo.proto\",\n\t\t\texpected: \"file:///home/user%40host/project/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"windows-drive-letter-uppercased-and-colon-encoded\",\n\t\t\tinput:    \"file:///C:/Users/project/foo.proto\",\n\t\t\texpected: \"file:///c%3A/Users/project/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"windows-lowercase-drive-letter-colon-encoded\",\n\t\t\tinput:    \"file:///d:/Users/project/foo.proto\",\n\t\t\texpected: \"file:///d%3A/Users/project/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"non-file-uri-colon-not-encoded\",\n\t\t\tinput:    \"untitled:Untitled-1\",\n\t\t\texpected: \"untitled:Untitled-1\",\n\t\t},\n\t\t{\n\t\t\tname:     \"non-file-uri-at-sign-encoded\",\n\t\t\tinput:    \"untitled:user@host\",\n\t\t\texpected: \"untitled:user%40host\",\n\t\t},\n\t\t{\n\t\t\tname:     \"at-sign-and-windows-drive-letter-both-encoded\",\n\t\t\tinput:    \"file:///C:/Users/user@host/foo.proto\",\n\t\t\texpected: \"file:///c%3A/Users/user%40host/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"space-in-path-encoded-as-percent-20\",\n\t\t\tinput:    \"file:///Users/bufbot/My Documents/foo.proto\",\n\t\t\texpected: \"file:///Users/bufbot/My%20Documents/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"already-encoded-space-is-idempotent\",\n\t\t\tinput:    \"file:///Users/bufbot/My%20Documents/foo.proto\",\n\t\t\texpected: \"file:///Users/bufbot/My%20Documents/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"already-encoded-at-sign-is-idempotent\",\n\t\t\tinput:    \"file:///home/user%40host/project/foo.proto\",\n\t\t\texpected: \"file:///home/user%40host/project/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"already-encoded-windows-drive-letter-lowercased\",\n\t\t\tinput:    \"file:///C%3A/Users/project/foo.proto\",\n\t\t\texpected: \"file:///c%3A/Users/project/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"percent-literal-in-filename-not-double-encoded\",\n\t\t\tinput:    \"file:///path/100%25done/foo.proto\",\n\t\t\texpected: \"file:///path/100%25done/foo.proto\",\n\t\t},\n\t\t{\n\t\t\tname:     \"space-at-sign-and-windows-drive-letter\",\n\t\t\tinput:    \"file:///C:/Users/user@host/My Documents/foo.proto\",\n\t\t\texpected: \"file:///c%3A/Users/user%40host/My%20Documents/foo.proto\",\n\t\t},\n\t}\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tassert.Equal(t, test.expected, normalizeURI(test.input))\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage buflsp\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/buflsp/workspace.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"iter\"\n\t\"log/slog\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"go.lsp.dev/protocol\"\n)\n\n// errUnresolvableWorkspace is an unsupported workspace error.\ntype errUnresolvableWorkspace protocol.URI\n\nfunc (e errUnresolvableWorkspace) Error() string {\n\treturn fmt.Sprintf(\"unresolvable workspace for %q\", string(e))\n}\n\n// workspaceManager tracks all workspaces the LSP is currently handling, per file.\ntype workspaceManager struct {\n\tlsp        *lsp\n\tworkspaces []*workspace\n}\n\n// newWorkspaceManager creates a new workspace manager.\nfunc newWorkspaceManager(lsp *lsp) *workspaceManager {\n\treturn &workspaceManager{lsp: lsp}\n}\n\n// LeaseWorkspace attempts to find and lease the workspace for the given URI string. If the\n// workspace has not been seen before, a new workspace is created. This may fail.\nfunc (w *workspaceManager) LeaseWorkspace(ctx context.Context, uri protocol.URI) (*workspace, error) {\n\tdefer func() {\n\t\t// Run a cleanup as a lazy job.\n\t\tw.Cleanup(ctx)\n\t\tw.lsp.logger.Debug(\"workspace: lease workspace\", slog.Int(\"active\", len(w.workspaces)))\n\t}()\n\n\tworkspace, err := w.getOrCreateWorkspace(ctx, uri)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tworkspace.Lease()\n\treturn workspace, nil\n}\n\n// Cleanup removes any workspaces no longer referenced.\nfunc (w *workspaceManager) Cleanup(ctx context.Context) {\n\t// Delete in-place.\n\tindex := 0\n\tfor _, workspace := range w.workspaces {\n\t\tif workspace.refCount > 0 {\n\t\t\tw.workspaces[index] = workspace\n\t\t\tindex++\n\t\t\tcontinue // workspace leased\n\t\t}\n\t\tw.lsp.logger.Debug(\"workspace: cleanup removing workspace\", slog.String(\"parent\", workspace.workspaceURI.Filename()))\n\t\tfor _, file := range workspace.pathToFile {\n\t\t\tfile.Close(ctx)\n\t\t}\n\t\tworkspace.pathToFile = nil\n\t}\n\tfor j := index; j < len(w.workspaces); j++ {\n\t\tw.workspaces[j] = nil\n\t}\n\tw.workspaces = w.workspaces[:index]\n}\n\n// createWorkspace creates a new workspace for the protocol URI.\nfunc (w *workspaceManager) getOrCreateWorkspace(ctx context.Context, uri protocol.URI) (*workspace, error) {\n\t// This looks for a workspace that already has ownership over the URI.\n\t// If a new file is added we will create a new workspace.\n\t// Reusing workspaces is an optimization. Matching is on best-effort.\n\tfileName := uri.Filename()\n\tfor _, workspace := range w.workspaces {\n\t\tif _, ok := workspace.fileNameToFileInfo[fileName]; ok {\n\t\t\t// Workspace already exists for this file. Refresh to update.\n\t\t\tif err := workspace.Refresh(ctx); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tw.lsp.logger.Debug(\"workspace: reusing workspace\", slog.String(\"file\", uri.Filename()), slog.String(\"parent\", workspace.workspaceURI.Filename()))\n\t\t\treturn workspace, nil\n\t\t}\n\t}\n\n\t// Workspaces are unresolvable for cached files.\n\tisCache := normalpath.ContainsPath(w.lsp.container.CacheDirPath(), fileName, normalpath.Absolute)\n\tif isCache {\n\t\tw.lsp.logger.Debug(\"workspace: unresolvable cache file outside workspace\", slog.String(\"path\", fileName))\n\t\treturn nil, errUnresolvableWorkspace(uri)\n\t}\n\t// Add the workspace to the manager.\n\tworkspace := &workspace{\n\t\tlsp:          w.lsp,\n\t\tworkspaceURI: uri,\n\t}\n\tif err := workspace.Refresh(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\tw.workspaces = append(w.workspaces, workspace)\n\treturn workspace, nil\n}\n\n// workspace is a workspace referenced from an open file by the client.\ntype workspace struct {\n\tlsp *lsp\n\n\t// refCount counts all the files that currently reference this workspace.\n\t// A refCount of zero will be removed by the workspaceManager on cleanup.\n\trefCount           int\n\tworkspaceURI       protocol.URI // File that created this workspace.\n\tworkspace          bufworkspace.Workspace\n\tfileNameToFileInfo map[string]bufmodule.FileInfo\n\tpathToFile         map[string]*file\n\tcheckClient        bufcheck.Client\n}\n\n// Lease increments the reference count.\nfunc (w *workspace) Lease() {\n\tw.lsp.logger.Debug(\"workspace: lease\", slog.String(\"path\", w.workspaceURI.Filename()))\n\tw.refCount++\n}\n\n// Release decrements the reference count.\nfunc (w *workspace) Release() int {\n\tw.lsp.logger.Debug(\"workspace: release\", slog.String(\"path\", w.workspaceURI.Filename()))\n\tw.refCount--\n\treturn w.refCount\n}\n\n// Refresh rebuilds the workspace and required context.\nfunc (w *workspace) Refresh(ctx context.Context) error {\n\tif w == nil {\n\t\treturn nil\n\t}\n\tfileName := w.workspaceURI.Filename()\n\tbufWorkspace, err := w.lsp.controller.GetWorkspace(ctx, fileName)\n\tif err != nil {\n\t\tw.lsp.logger.Error(\"workspace: get workspace\", slog.String(\"file\", fileName), xslog.ErrorAttr(err))\n\t\treturn err\n\t}\n\tfileNameToFileInfo := make(map[string]bufmodule.FileInfo)\n\tfor _, module := range bufWorkspace.Modules() {\n\t\tif err := module.WalkFileInfos(ctx, func(fileInfo bufmodule.FileInfo) error {\n\t\t\tif fileInfo.FileType() != bufmodule.FileTypeProto {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tfileNameToFileInfo[fileInfo.LocalPath()] = fileInfo\n\t\t\treturn nil\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// Get the check client for the workspace.\n\tcheckClient, err := w.lsp.controller.GetCheckClientForWorkspace(ctx, bufWorkspace, w.lsp.wasmRuntime)\n\tif err != nil {\n\t\tw.lsp.logger.Warn(\"workspace: get check client\", slog.String(\"file\", fileName), xslog.ErrorAttr(err))\n\t}\n\n\t// Update the workspace.\n\tw.workspace = bufWorkspace\n\tw.fileNameToFileInfo = fileNameToFileInfo\n\tw.checkClient = checkClient\n\tw.indexFiles(ctx)\n\treturn nil\n}\n\n// FileInfo returns an iterator over the files in the workspace.\nfunc (w *workspace) FileInfo() iter.Seq[bufmodule.FileInfo] {\n\treturn func(yield func(bufmodule.FileInfo) bool) {\n\t\tif w == nil {\n\t\t\treturn\n\t\t}\n\t\tfor _, fileInfo := range w.fileNameToFileInfo {\n\t\t\tif !yield(fileInfo) {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Workspace returns the buf Workspace.\nfunc (w *workspace) Workspace() bufworkspace.Workspace {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.workspace\n}\n\n// GetModule resolves the Module for the protocol URI.\nfunc (w *workspace) GetModule(uri protocol.URI) bufmodule.Module {\n\tif w == nil {\n\t\treturn nil\n\t}\n\tfileName := uri.Filename()\n\tif fileInfo, ok := w.fileNameToFileInfo[fileName]; ok {\n\t\treturn fileInfo.Module()\n\t}\n\tw.lsp.logger.Warn(\"workspace: module not found\", slog.String(\"file\", fileName), slog.String(\"parent\", w.workspaceURI.Filename()))\n\treturn nil\n}\n\n// CheckClient returns the buf check Client configured for the workspace.\nfunc (w *workspace) CheckClient() bufcheck.Client {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.checkClient\n}\n\n// PathToFile is an index of all files within the workspace.\nfunc (w *workspace) PathToFile() map[string]*file {\n\tif w == nil {\n\t\treturn nil\n\t}\n\treturn w.pathToFile\n}\n\n// indexFiles builds the pathToFile mapping.\nfunc (w *workspace) indexFiles(ctx context.Context) {\n\tw.lsp.logger.Debug(\"workspace: index files\", slog.String(\"path\", w.workspaceURI.Filename()))\n\tprevious := w.pathToFile\n\tw.pathToFile = make(map[string]*file, len(previous))\n\n\tfor fileInfo := range w.fileInfos(ctx) {\n\t\tfile, ok := previous[fileInfo.Path()]\n\t\tif !ok {\n\t\t\tfileURI := FilePathToURI(fileInfo.LocalPath())\n\t\t\tfile = w.lsp.fileManager.Track(fileURI)\n\t\t\tw.lsp.logger.Debug(\"workspace: index track file\", slog.String(\"path\", file.uri.Filename()))\n\t\t}\n\n\t\t// Currently we only associate a file with one workspace. This assumption isn't accurate\n\t\t// for shared dependencies. Here we update to the latest, most recently used, workspace.\n\t\t// This will make goto definition and find references only work in that workspace.\n\t\tif oldWorkspace := file.workspace; oldWorkspace != nil && oldWorkspace != w {\n\t\t\toldWorkspace.Release()\n\t\t\tw.Lease()\n\t\t\tfile.workspace = w\n\t\t}\n\n\t\tfile.objectInfo = fileInfo\n\t\tif err := file.ReadFromWorkspace(ctx); err != nil {\n\t\t\tw.lsp.logger.Error(\n\t\t\t\t\"failed to read contents for file\",\n\t\t\t\txslog.ErrorAttr(err),\n\t\t\t\tslog.String(\"file\", fileInfo.Path()),\n\t\t\t)\n\t\t}\n\n\t\t// Update index.\n\t\tw.pathToFile[fileInfo.Path()] = file\n\t\tdelete(previous, fileInfo.Path())\n\t}\n\t// Drop all unused files. It was deleted from the workspace.\n\tfor _, file := range previous {\n\t\tw.lsp.logger.Debug(\"workspace: index drop file\", slog.String(\"path\", file.uri.Filename()))\n\t\tfile.Close(ctx)\n\t}\n}\n\n// fileInfos returns all files within the workspace.\n//\n// This consists of files within the workspace plus WKTs.\nfunc (w *workspace) fileInfos(ctx context.Context) iter.Seq[storage.ObjectInfo] {\n\treturn func(yield func(storage.ObjectInfo) bool) {\n\t\tseen := make(map[string]struct{})\n\t\tfor fileInfo := range w.FileInfo() {\n\t\t\tif !yield(fileInfo) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tseen[fileInfo.Path()] = struct{}{}\n\t\t}\n\t\t// Add all wellknown types if not provided within the workspace.\n\t\tif err := w.lsp.wktBucket.Walk(ctx, \"\", func(objectInfo storage.ObjectInfo) error {\n\t\t\tif _, ok := seen[objectInfo.Path()]; !ok {\n\t\t\t\tif !yield(wktObjectInfo{objectInfo}) {\n\t\t\t\t\treturn io.EOF\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t}); err != nil && !errors.Is(err, io.EOF) {\n\t\t\tw.lsp.logger.Error(\"wkt bucket failed\", xslog.ErrorAttr(err))\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/buf/buflsp/workspace_symbol_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflsp_test\n\nimport (\n\t\"path/filepath\"\n\t\"slices\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/buf/buflsp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"go.lsp.dev/protocol\"\n)\n\nfunc TestWorkspaceSymbol(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\ttestProtoPath, err := filepath.Abs(\"testdata/workspace_symbols/workspace_symbols.proto\")\n\trequire.NoError(t, err)\n\n\ttypesProtoPath, err := filepath.Abs(\"testdata/workspace_symbols/types.proto\")\n\trequire.NoError(t, err)\n\n\tclientJSONConn, testURI := setupLSPServer(t, testProtoPath)\n\ttypesURI := buflsp.FilePathToURI(typesProtoPath)\n\n\ttype symbolInfo struct {\n\t\tname       string\n\t\tkind       protocol.SymbolKind\n\t\tline       uint32\n\t\tdeprecated bool\n\t\turi        protocol.URI\n\t}\n\n\ttests := []struct {\n\t\tname            string\n\t\tquery           string\n\t\texpectedSymbols []symbolInfo // Symbols that should be found with their details\n\t\tminResults      int          // Minimum number of results expected\n\t}{\n\t\t{\n\t\t\tname:  \"search_for_item\",\n\t\t\tquery: \"Item\",\n\t\t\texpectedSymbols: []symbolInfo{\n\t\t\t\t{name: \"workspace_symbols.v1.Item\", kind: protocol.SymbolKindClass, line: 6, uri: testURI},\n\t\t\t\t{name: \"workspace_symbols.v1.GetItemRequest\", kind: protocol.SymbolKindClass, line: 24, uri: testURI},\n\t\t\t\t{name: \"workspace_symbols.v1.GetItemResponse\", kind: protocol.SymbolKindClass, line: 28, uri: testURI},\n\t\t\t\t{name: \"workspace_symbols.v1.ListItemsRequest\", kind: protocol.SymbolKindClass, line: 32, uri: testURI},\n\t\t\t\t{name: \"workspace_symbols.v1.ListItemsResponse\", kind: protocol.SymbolKindClass, line: 36, uri: testURI},\n\t\t\t\t{name: \"workspace_symbols.v1.ItemService\", kind: protocol.SymbolKindInterface, line: 19, uri: testURI},\n\t\t\t},\n\t\t\tminResults: 6,\n\t\t},\n\t\t{\n\t\t\tname:  \"search_for_color\",\n\t\t\tquery: \"Color\",\n\t\t\texpectedSymbols: []symbolInfo{\n\t\t\t\t{name: \"workspace_symbols.v1.Color\", kind: protocol.SymbolKindEnum, line: 4, uri: typesURI},\n\t\t\t\t{name: \"workspace_symbols.v1.COLOR_UNSPECIFIED\", kind: protocol.SymbolKindEnumMember, line: 5, uri: typesURI},\n\t\t\t\t{name: \"workspace_symbols.v1.COLOR_RED\", kind: protocol.SymbolKindEnumMember, line: 6, uri: typesURI},\n\t\t\t\t{name: \"workspace_symbols.v1.COLOR_BLUE\", kind: protocol.SymbolKindEnumMember, line: 7, uri: typesURI},\n\t\t\t},\n\t\t\tminResults: 4,\n\t\t},\n\t\t{\n\t\t\tname:  \"search_for_label\",\n\t\t\tquery: \"Label\",\n\t\t\texpectedSymbols: []symbolInfo{\n\t\t\t\t{name: \"workspace_symbols.v1.Label\", kind: protocol.SymbolKindClass, line: 10, uri: typesURI},\n\t\t\t},\n\t\t\tminResults: 1,\n\t\t},\n\t\t{\n\t\t\tname:  \"search_for_container\",\n\t\t\tquery: \"Container\",\n\t\t\texpectedSymbols: []symbolInfo{\n\t\t\t\t{name: \"workspace_symbols.v1.Container\", kind: protocol.SymbolKindClass, line: 13, uri: testURI},\n\t\t\t},\n\t\t\tminResults: 1,\n\t\t},\n\t\t{\n\t\t\tname:  \"search_for_deprecated\",\n\t\t\tquery: \"Legacy\",\n\t\t\texpectedSymbols: []symbolInfo{\n\t\t\t\t{name: \"workspace_symbols.v1.LegacyItem\", kind: protocol.SymbolKindClass, line: 40, deprecated: true, uri: testURI},\n\t\t\t},\n\t\t\tminResults: 1,\n\t\t},\n\t\t{\n\t\t\tname:       \"empty_query_returns_all_symbols\",\n\t\t\tquery:      \"\",\n\t\t\tminResults: 20, // Should return many symbols from both files\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tvar symbols []protocol.SymbolInformation\n\t\t\t_, symErr := clientJSONConn.Call(ctx, protocol.MethodWorkspaceSymbol, protocol.WorkspaceSymbolParams{\n\t\t\t\tQuery: tt.query,\n\t\t\t}, &symbols)\n\t\t\trequire.NoError(t, symErr)\n\n\t\t\tassert.GreaterOrEqual(t, len(symbols), tt.minResults)\n\n\t\t\tfor _, expectedSymbol := range tt.expectedSymbols {\n\t\t\t\tidx := slices.IndexFunc(symbols, func(s protocol.SymbolInformation) bool {\n\t\t\t\t\treturn s.Name == expectedSymbol.name\n\t\t\t\t})\n\t\t\t\trequire.NotEqual(t, -1, idx, \"expected to find symbol %s\", expectedSymbol.name)\n\t\t\t\tfound := symbols[idx]\n\t\t\t\tassert.Equal(t, expectedSymbol.kind, found.Kind, \"symbol %s has wrong kind\", expectedSymbol.name)\n\t\t\t\tassert.Equal(t, expectedSymbol.uri, found.Location.URI, \"symbol %s has wrong URI\", expectedSymbol.name)\n\t\t\t\tassert.Equal(t, expectedSymbol.line, found.Location.Range.Start.Line, \"symbol %s has wrong line number\", expectedSymbol.name)\n\t\t\t\tassert.Equal(t, expectedSymbol.deprecated, found.Deprecated, \"symbol %s has wrong deprecated status\", expectedSymbol.name)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufmigrate/bufmigrate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmigrate\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// Migrator migrates buf configuration files.\ntype Migrator interface {\n\t// Migrate migrates buf configuration files.\n\t//\n\t// A buf.yaml v2 is written if any workspace directory or module directory is\n\t// specified. The modules directories in the buf.yaml v2 will contain:\n\t//\n\t//   - directories at moduleDirPaths\n\t//   - directories pointed to by buf.work.yamls at workspaceDirPaths\n\t//\n\t// More specifically:\n\t//\n\t//   - If a workspace is specified, then all of its module directories are also migrated,\n\t//     regardless whether these module directories are specified in moduleDirPaths. Same\n\t//     behavior with multiple workspaces. For example, if workspace foo has directories\n\t//     bar and baz, then specifying foo, foo + bar and foo + bar + baz are the same.\n\t//   - If a workspace is specified, and modules not from this workspace are specified, the\n\t//     buf.yaml will contain all directories from the workspace, as well as the module\n\t//     directories specified.\n\t//   - If only module directories are specified, then the buf.yaml will contain exactly\n\t//     these directories.\n\t//   - If a module specified is within some workspace not from workspaceDirPaths, we migrate\n\t//     the module directory only (updating/deciding on this behavior is still a todo).\n\t//   - If only one workspace directory is specified and no module directory is specified,\n\t//     the buf.yaml will be written at <workspace directory>/buf.yaml. Otherwise, it will\n\t//     be written at ./buf.yaml.\n\t//\n\t// Each generation template will be overwritten by a file in v2.\n\tMigrate(\n\t\tctx context.Context,\n\t\tbucket storage.ReadWriteBucket,\n\t\tworkspaceDirPaths []string,\n\t\tmoduleDirPaths []string,\n\t\tbufGenYAMLFilePaths []string,\n\t) error\n\t// Diff runs migrate, but produces a diff instead of writing the migration.\n\tDiff(\n\t\tctx context.Context,\n\t\tbucket storage.ReadBucket,\n\t\twriter io.Writer,\n\t\tworkspaceDirPaths []string,\n\t\tmoduleDirPaths []string,\n\t\tbufGenYAMLFilePaths []string,\n\t) error\n}\n\n// NewMigrator returns a new Migrator.\nfunc NewMigrator(\n\tlogger *slog.Logger,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n\tcommitProvider bufmodule.CommitProvider,\n) Migrator {\n\treturn newMigrator(\n\t\tlogger,\n\t\tmoduleKeyProvider,\n\t\tcommitProvider,\n\t)\n}\n\n// MigrateAll uses bufconfig.WalkFileInfos to discover all known module, workspace, and buf.gen.yaml\n// paths in the Bucket, and migrates them.\n//\n// ignoreDirPaths should be normalized and relative to the root of the bucket, if specified.\nfunc MigrateAll(\n\tctx context.Context,\n\tmigrator Migrator,\n\tbucket storage.ReadWriteBucket,\n\tignoreDirPaths []string,\n) error {\n\tworkspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths, err := getWorkspaceModuleBufGenYAMLPaths(ctx, bucket, ignoreDirPaths)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn migrator.Migrate(ctx, bucket, workspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths)\n}\n\n// DiffAll uses bufconfig.WalkFileInfos to discover all known module, workspace, and buf.gen.yaml\n// paths in the Bucket, and diffs them.\n//\n// ignoreDirPaths should be normalized and relative to the root of the bucket, if specified.\nfunc DiffAll(\n\tctx context.Context,\n\tmigrator Migrator,\n\tbucket storage.ReadBucket,\n\twriter io.Writer,\n\tignoreDirPaths []string,\n) error {\n\tworkspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths, err := getWorkspaceModuleBufGenYAMLPaths(ctx, bucket, ignoreDirPaths)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn migrator.Diff(ctx, bucket, writer, workspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths)\n}\n\n// *** PRIVATE ***\n\nfunc getWorkspaceModuleBufGenYAMLPaths(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tignoreDirPaths []string,\n) (workspaceDirPaths []string, moduleDirPaths []string, bufGenYAMLFilePaths []string, retErr error) {\n\tignoreDirPathMap := make(map[string]struct{}, len(ignoreDirPaths))\n\tfor _, ignoreDirPath := range ignoreDirPaths {\n\t\tignoreDirPath, err := normalpath.NormalizeAndValidate(ignoreDirPath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, err\n\t\t}\n\t\tignoreDirPathMap[ignoreDirPath] = struct{}{}\n\t}\n\tvar dirPath string\n\tif err := bufconfig.WalkFileInfos(\n\t\tctx,\n\t\tbucket,\n\t\tfunc(path string, fileInfo bufconfig.FileInfo) error {\n\t\t\tdirPath = normalpath.Dir(path)\n\t\t\tif len(ignoreDirPathMap) > 0 {\n\t\t\t\tif normalpath.MapHasEqualOrContainingPath(ignoreDirPathMap, dirPath, normalpath.Relative) {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t\tfileType := fileInfo.FileType()\n\t\t\tfileVersion := fileInfo.FileVersion()\n\t\t\tswitch fileType {\n\t\t\tcase bufconfig.FileTypeBufYAML:\n\t\t\t\tswitch fileVersion {\n\t\t\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\t\t\tmoduleDirPaths = append(moduleDirPaths, dirPath)\n\t\t\t\t\treturn nil\n\t\t\t\tcase bufconfig.FileVersionV2:\n\t\t\t\t\t// ignore\n\t\t\t\t\treturn nil\n\t\t\t\tdefault:\n\t\t\t\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t\t\t}\n\t\t\tcase bufconfig.FileTypeBufGenYAML:\n\t\t\t\tswitch fileVersion {\n\t\t\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\t\t\tbufGenYAMLFilePaths = append(bufGenYAMLFilePaths, path)\n\t\t\t\t\treturn nil\n\t\t\t\tcase bufconfig.FileVersionV2:\n\t\t\t\t\t// ignore\n\t\t\t\t\treturn nil\n\t\t\t\tdefault:\n\t\t\t\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t\t\t}\n\t\t\tcase bufconfig.FileTypeBufWorkYAML:\n\t\t\t\tswitch fileVersion {\n\t\t\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\t\t\tworkspaceDirPaths = append(workspaceDirPaths, dirPath)\n\t\t\t\t\treturn nil\n\t\t\t\tcase bufconfig.FileVersionV2:\n\t\t\t\t\treturn syserror.Newf(\"invalid FileVersion for %q: %v\", path, fileVersion)\n\t\t\t\tdefault:\n\t\t\t\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t\t\t}\n\t\t\tcase bufconfig.FileTypeBufLock:\n\t\t\t\t// ignore\n\t\t\t\treturn nil\n\t\t\tdefault:\n\t\t\t\treturn syserror.Newf(\"unknown FileType: %v\", fileType)\n\t\t\t}\n\t\t},\n\t); err != nil {\n\t\treturn nil, nil, nil, fmt.Errorf(\"unable to parse %q: %w\", dirPath, err)\n\t}\n\treturn workspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths, nil\n}\n"
  },
  {
    "path": "private/buf/bufmigrate/migrate_builder.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmigrate\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\ntype migrateBuilder struct {\n\tlogger             *slog.Logger\n\tcommitProvider     bufmodule.CommitProvider\n\tbucket             storage.ReadBucket\n\tdestinationDirPath string\n\n\taddedBufGenYAMLFilePaths map[string]struct{}\n\taddedWorkspaceDirPaths   map[string]struct{}\n\taddedModuleDirPaths      map[string]struct{}\n\n\tmoduleConfigs                    []bufconfig.ModuleConfig\n\tconfiguredDepModuleRefs          []bufparse.Ref\n\thasSeenBufLockFile               bool\n\tdepModuleKeys                    []bufmodule.ModuleKey\n\tpathToMigratedBufGenYAMLFile     map[string]bufconfig.BufGenYAMLFile\n\tmoduleFullNameStringToParentPath map[string]string\n\tpathsToDelete                    map[string]struct{}\n}\n\nfunc newMigrateBuilder(\n\tlogger *slog.Logger,\n\tcommitProvider bufmodule.CommitProvider,\n\tbucket storage.ReadBucket,\n\tdestinationDirPath string,\n) *migrateBuilder {\n\treturn &migrateBuilder{\n\t\tlogger:                           logger,\n\t\tcommitProvider:                   commitProvider,\n\t\tbucket:                           bucket,\n\t\tdestinationDirPath:               destinationDirPath,\n\t\taddedBufGenYAMLFilePaths:         make(map[string]struct{}),\n\t\taddedWorkspaceDirPaths:           make(map[string]struct{}),\n\t\taddedModuleDirPaths:              make(map[string]struct{}),\n\t\tpathToMigratedBufGenYAMLFile:     make(map[string]bufconfig.BufGenYAMLFile),\n\t\tmoduleFullNameStringToParentPath: make(map[string]string),\n\t\tpathsToDelete:                    make(map[string]struct{}),\n\t}\n}\n\n// addBufGenYAML adds a buf.gen.yaml to the list of files to migrate. It returns nil\n// nil if the file is already in v2.\n//\n// If the file is in v1 and has a 'types' section on the top level, this function will\n// ignore 'types' and print a warning, while migrating everything else in the file.\n//\n// bufGenYAMLPath is relative to the call site of CLI or an absolute path.\nfunc (m *migrateBuilder) addBufGenYAML(ctx context.Context, bufGenYAMLFilePath string) (retErr error) {\n\tif _, ok := m.addedBufGenYAMLFilePaths[bufGenYAMLFilePath]; ok {\n\t\treturn nil\n\t}\n\tm.addedBufGenYAMLFilePaths[bufGenYAMLFilePath] = struct{}{}\n\n\tfile, err := m.bucket.Get(ctx, bufGenYAMLFilePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, file.Close())\n\t}()\n\tbufGenYAML, err := bufconfig.ReadBufGenYAMLFile(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif bufGenYAML.FileVersion() == bufconfig.FileVersionV2 {\n\t\tm.logger.Warn(fmt.Sprintf(\"%s is a v2 file, no migration required\", bufGenYAMLFilePath))\n\t\treturn nil\n\t}\n\tif typeConfig := bufGenYAML.GenerateConfig().GenerateTypeConfig(); typeConfig != nil && len(typeConfig.IncludeTypes()) > 0 {\n\t\t// TODO FUTURE: what does this sentence mean? Get someone else to read it and understand it without any explanation.\n\t\tm.logger.Warn(fmt.Sprintf(\n\t\t\t\"%s is a v1 generation template with a top-level 'types' section including %s. In a v2 generation template, 'types' can\"+\n\t\t\t\t\" only exist within an input in the 'inputs' section. Since the migration command does not have information\"+\n\t\t\t\t\" on inputs, the migrated generation will not have an 'inputs' section. To add these types in the migrated file, you can\"+\n\t\t\t\t\" first add an input to 'inputs' and then add these types to the input.\",\n\t\t\tbufGenYAMLFilePath,\n\t\t\txstrings.SliceToHumanString(typeConfig.IncludeTypes()),\n\t\t))\n\t}\n\t// No special transformation needed, writeBufGenYAMLFile handles it correctly.\n\tmigratedBufGenYAMLFile := bufconfig.NewBufGenYAMLFile(\n\t\tbufconfig.FileVersionV2,\n\t\tbufGenYAML.GenerateConfig(),\n\t\t// Types is always nil in v2.\n\t\tnil,\n\t)\n\t// Even though we're just writing over this, we store this so that Diff can pick it up.\n\tm.pathsToDelete[bufGenYAMLFilePath] = struct{}{}\n\tm.pathToMigratedBufGenYAMLFile[bufGenYAMLFilePath] = migratedBufGenYAMLFile\n\treturn nil\n}\n\n// addWorkspace adds the buf.work.yaml at the root of the workspace directory\n// to the list of files to migrate, the buf.yamls and buf.locks at the root of each\n// directory pointed to by this workspace.\n//\n// workspaceDirectory is relative to the root bucket of the migrator.\nfunc (m *migrateBuilder) addWorkspace(ctx context.Context, workspaceDirPath string) (retErr error) {\n\tif _, ok := m.addedWorkspaceDirPaths[workspaceDirPath]; ok {\n\t\treturn nil\n\t}\n\tm.addedWorkspaceDirPaths[workspaceDirPath] = struct{}{}\n\n\tbufWorkYAML, err := bufconfig.GetBufWorkYAMLFileForPrefix(ctx, m.bucket, workspaceDirPath)\n\tif errors.Is(err, fs.ErrNotExist) {\n\t\treturn fmt.Errorf(\"%q does not have a workspace configuration file (i.e. typically a buf.work.yaml)\", workspaceDirPath)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tobjectData := bufWorkYAML.ObjectData()\n\tif objectData == nil {\n\t\treturn syserror.New(\"ObjectData was nil on BufWorkYAMLFile created for prefix\")\n\t}\n\tm.pathsToDelete[normalpath.Join(workspaceDirPath, objectData.Name())] = struct{}{}\n\tfor _, moduleDirRelativeToWorkspace := range bufWorkYAML.DirPaths() {\n\t\tif err := m.addModule(ctx, normalpath.Join(workspaceDirPath, moduleDirRelativeToWorkspace)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// addModule adds buf.yaml and buf.lock at the root of moduleDir to the list\n// of files to migrate. More specifically, it adds module configs and dependency module\n// keys to the migrator.\n//\n// moduleDir is relative to the root bucket of the migrator.\nfunc (m *migrateBuilder) addModule(ctx context.Context, moduleDirPath string) (retErr error) {\n\tif _, ok := m.addedModuleDirPaths[moduleDirPath]; ok {\n\t\treturn nil\n\t}\n\tm.addedModuleDirPaths[moduleDirPath] = struct{}{}\n\n\t// First get module configs from the buf.yaml at moduleDir.\n\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, m.bucket, moduleDirPath)\n\tif errors.Is(err, fs.ErrNotExist) {\n\t\t// If buf.yaml isn't present, migration does not fail. Instead we add an\n\t\t// empty module config representing this directory.\n\t\tmoduleRootRelativeToDestination, err := normalpath.Rel(m.destinationDirPath, moduleDirPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\temptyModuleConfig, err := bufconfig.NewModuleConfig(\n\t\t\tmoduleRootRelativeToDestination,\n\t\t\tnil,\n\t\t\t// The default (empty) value for rootToIncludes and rootToExcludes only has key \".\".\n\t\t\tmap[string][]string{\n\t\t\t\t\".\": {},\n\t\t\t},\n\t\t\tmap[string][]string{\n\t\t\t\t\".\": {},\n\t\t\t},\n\t\t\tbufconfig.NewLintConfig(\n\t\t\t\tbufconfig.NewEnabledCheckConfigForUseIDsAndCategories(\n\t\t\t\t\tbufconfig.FileVersionV2,\n\t\t\t\t\tnil,\n\t\t\t\t\tfalse,\n\t\t\t\t),\n\t\t\t\t\"\",\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\t\"\",\n\t\t\t\tfalse,\n\t\t\t),\n\t\t\tbufconfig.NewBreakingConfig(\n\t\t\t\tbufconfig.NewEnabledCheckConfigForUseIDsAndCategories(\n\t\t\t\t\tbufconfig.FileVersionV2,\n\t\t\t\t\tnil,\n\t\t\t\t\tfalse,\n\t\t\t\t),\n\t\t\t\tfalse,\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := m.appendModuleConfig(\n\t\t\temptyModuleConfig,\n\t\t\tnormalpath.Join(moduleDirPath, bufconfig.DefaultBufYAMLFileName),\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Assuming there is no co-resident buf.lock when there is no buf.yaml,\n\t\t// we return early here.\n\t\treturn nil\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tobjectData := bufYAMLFile.ObjectData()\n\tif objectData == nil {\n\t\treturn syserror.New(\"ObjectData was nil on BufYAMLFile created for prefix\")\n\t}\n\tbufYAMLFilePath := normalpath.Join(moduleDirPath, objectData.Name())\n\t// If this module is already visited, we don't add it for a second time. It's\n\t// possible to visit the same module directory twice when the user specifies both\n\t// a workspace and a module in this workspace.\n\tif _, ok := m.pathsToDelete[bufYAMLFilePath]; ok {\n\t\treturn nil\n\t}\n\tswitch bufYAMLFile.FileVersion() {\n\tcase bufconfig.FileVersionV1Beta1:\n\t\tif len(bufYAMLFile.ModuleConfigs()) != 1 {\n\t\t\t// This should never happen because it's guaranteed by the bufYAMLFile interface.\n\t\t\treturn syserror.Newf(\"expect exactly 1 module config from buf yaml, got %d\", len(bufYAMLFile.ModuleConfigs()))\n\t\t}\n\t\tmoduleConfig := bufYAMLFile.ModuleConfigs()[0]\n\t\tmoduleFullName := moduleConfig.FullName()\n\t\t// If a buf.yaml v1beta1 has a non-empty name and multiple roots, the\n\t\t// resulting buf.yaml v2 should have these roots as module directories,\n\t\t// but they should not share the same module name. Instead we just give\n\t\t// them empty module names.\n\t\tif len(moduleConfig.RootToExcludes()) > 1 && moduleFullName != nil {\n\t\t\tm.logger.Warn(fmt.Sprintf(\n\t\t\t\t\"%s has name %s and multiple roots. These roots are now separate unnamed modules.\",\n\t\t\t\tbufYAMLFilePath,\n\t\t\t\tmoduleFullName.String(),\n\t\t\t))\n\t\t\tmoduleFullName = nil\n\t\t}\n\t\t// Each root in buf.yaml v1beta1 should become its own module config in v2,\n\t\t// and we iterate through these roots in deterministic order.\n\t\tsortedRoots := xslices.MapKeysToSortedSlice(moduleConfig.RootToExcludes())\n\t\tfor _, root := range sortedRoots {\n\t\t\tmoduleRootRelativeToDestination, err := normalpath.Rel(\n\t\t\t\tm.destinationDirPath,\n\t\t\t\tnormalpath.Join(moduleDirPath, root),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlintConfigForRoot, err := equivalentLintConfigInV2(ctx, m.logger, moduleConfig.LintConfig())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbreakingConfigForRoot, err := equivalentBreakingConfigInV2(ctx, m.logger, moduleConfig.BreakingConfig())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tmoduleConfigForRoot, err := bufconfig.NewModuleConfig(\n\t\t\t\tmoduleRootRelativeToDestination,\n\t\t\t\tmoduleFullName,\n\t\t\t\t// We do not need to handle paths in rootToIncludes, rootToExcludes, lint or breaking config specially,\n\t\t\t\t// because the paths are transformed correctly by readBufYAMLFile and writeBufYAMLFile.\n\t\t\t\tmap[string][]string{\".\": moduleConfig.RootToIncludes()[root]},\n\t\t\t\tmap[string][]string{\".\": moduleConfig.RootToExcludes()[root]},\n\t\t\t\tlintConfigForRoot,\n\t\t\t\tbreakingConfigForRoot,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := m.appendModuleConfig(moduleConfigForRoot, bufYAMLFilePath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tm.configuredDepModuleRefs = append(m.configuredDepModuleRefs, bufYAMLFile.ConfiguredDepModuleRefs()...)\n\tcase bufconfig.FileVersionV1:\n\t\tif len(bufYAMLFile.ModuleConfigs()) != 1 {\n\t\t\t// This should never happen because it's guaranteed by the bufYAMLFile interface.\n\t\t\treturn syserror.Newf(\"expect exactly 1 module config from buf yaml, got %d\", len(bufYAMLFile.ModuleConfigs()))\n\t\t}\n\t\tmoduleConfig := bufYAMLFile.ModuleConfigs()[0]\n\t\tmoduleRootRelativeToDestination, err := normalpath.Rel(m.destinationDirPath, normalpath.Dir(bufYAMLFilePath))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlintConfig, err := equivalentLintConfigInV2(ctx, m.logger, moduleConfig.LintConfig())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbreakingConfig, err := equivalentBreakingConfigInV2(ctx, m.logger, moduleConfig.BreakingConfig())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmoduleConfig, err = bufconfig.NewModuleConfig(\n\t\t\tmoduleRootRelativeToDestination,\n\t\t\tmoduleConfig.FullName(),\n\t\t\t// We do not need to handle paths in rootToIncludes, rootToExcludes, lint or breaking config specially,\n\t\t\t// because the paths are transformed correctly by readBufYAMLFile and writeBufYAMLFile.\n\t\t\tmoduleConfig.RootToIncludes(),\n\t\t\tmoduleConfig.RootToExcludes(),\n\t\t\tlintConfig,\n\t\t\tbreakingConfig,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := m.appendModuleConfig(moduleConfig, bufYAMLFilePath); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tm.configuredDepModuleRefs = append(m.configuredDepModuleRefs, bufYAMLFile.ConfiguredDepModuleRefs()...)\n\tcase bufconfig.FileVersionV2:\n\t\tm.logger.Warn(fmt.Sprintf(\"%s is a v2 file, no migration required\", bufYAMLFilePath))\n\t\treturn nil\n\tdefault:\n\t\treturn syserror.Newf(\"unexpected version: %v\", bufYAMLFile.FileVersion())\n\t}\n\tm.pathsToDelete[bufYAMLFilePath] = struct{}{}\n\t// Now we read buf.lock and add its lock entries to the list of candidate lock entries\n\t// for the migrated buf.lock. These lock entries are candidates because different buf.locks\n\t// can have lock entries for the same module but for different commits.\n\tbufLockFile, err := bufconfig.GetBufLockFileForPrefix(\n\t\tctx,\n\t\tm.bucket,\n\t\tmoduleDirPath,\n\t\tbufconfig.BufLockFileWithDigestResolver(\n\t\t\tfunc(ctx context.Context, remote string, commitID uuid.UUID) (bufmodule.Digest, error) {\n\t\t\t\tcommitKey, err := bufmodule.NewCommitKey(remote, commitID, bufmodule.DigestTypeB4)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tcommits, err := m.commitProvider.GetCommitsForCommitKeys(ctx, []bufmodule.CommitKey{commitKey})\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 commits[0].ModuleKey().Digest()\n\t\t\t},\n\t\t),\n\t)\n\tif errors.Is(errors.Unwrap(err), fs.ErrNotExist) {\n\t\treturn nil\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tobjectData = bufLockFile.ObjectData()\n\tif objectData == nil {\n\t\treturn syserror.New(\"ObjectData was nil on BufLockFile created for prefix\")\n\t}\n\tbufLockFilePath := normalpath.Join(moduleDirPath, objectData.Name())\n\t// We don't need to check whether it's already in the map, but because if it were,\n\t// its co-resident buf.yaml would also have been a duplicate and made this\n\t// function return at an earlier point.\n\tm.pathsToDelete[bufLockFilePath] = struct{}{}\n\tm.hasSeenBufLockFile = true\n\tswitch bufLockFile.FileVersion() {\n\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\tm.depModuleKeys = append(m.depModuleKeys, bufLockFile.DepModuleKeys()...)\n\tcase bufconfig.FileVersionV2:\n\t\tm.logger.Warn(fmt.Sprintf(\"%s is a v2 file, no migration required\", bufLockFilePath))\n\t\treturn nil\n\tdefault:\n\t\treturn syserror.Newf(\"unrecognized version: %v\", bufLockFile.FileVersion())\n\t}\n\treturn nil\n}\n\nfunc (m *migrateBuilder) appendModuleConfig(moduleConfig bufconfig.ModuleConfig, parentPath string) error {\n\tm.moduleConfigs = append(m.moduleConfigs, moduleConfig)\n\tif moduleConfig.FullName() == nil {\n\t\treturn nil\n\t}\n\tif file, ok := m.moduleFullNameStringToParentPath[moduleConfig.FullName().String()]; ok {\n\t\treturn fmt.Errorf(\"module %s is found in both %s and %s\", moduleConfig.FullName(), file, parentPath)\n\t}\n\tm.moduleFullNameStringToParentPath[moduleConfig.FullName().String()] = parentPath\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/bufmigrate/migrator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmigrate\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/google/uuid\"\n)\n\ntype migrator struct {\n\tlogger            *slog.Logger\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider\n\tcommitProvider    bufmodule.CommitProvider\n}\n\nfunc newMigrator(\n\tlogger *slog.Logger,\n\tmoduleKeyProvider bufmodule.ModuleKeyProvider,\n\tcommitProvider bufmodule.CommitProvider,\n) *migrator {\n\treturn &migrator{\n\t\tlogger:            logger,\n\t\tmoduleKeyProvider: moduleKeyProvider,\n\t\tcommitProvider:    commitProvider,\n\t}\n}\n\nfunc (m *migrator) Migrate(\n\tctx context.Context,\n\tbucket storage.ReadWriteBucket,\n\tworkspaceDirPaths []string,\n\tmoduleDirPaths []string,\n\tbufGenYAMLFilePaths []string,\n) error {\n\tm.logPaths(workspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths)\n\tmigrateBuilder, err := m.getMigrateBuilder(ctx, bucket, workspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn m.migrate(ctx, bucket, migrateBuilder)\n}\n\nfunc (m *migrator) Diff(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\twriter io.Writer,\n\tworkspaceDirPaths []string,\n\tmoduleDirPaths []string,\n\tbufGenYAMLFilePaths []string,\n) error {\n\tm.logPaths(workspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths)\n\tmigrateBuilder, err := m.getMigrateBuilder(ctx, bucket, workspaceDirPaths, moduleDirPaths, bufGenYAMLFilePaths)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn m.diff(ctx, writer, migrateBuilder)\n}\n\nfunc (m *migrator) logPaths(\n\tworkspaceDirPaths []string,\n\tmoduleDirPaths []string,\n\tbufGenYAMLFilePaths []string,\n) {\n\tif len(workspaceDirPaths) > 0 {\n\t\tm.logger.Debug(fmt.Sprintf(\"workspace directory paths:\\n%s\", strings.Join(workspaceDirPaths, \"\\n\")))\n\t}\n\tif len(moduleDirPaths) > 0 {\n\t\tm.logger.Debug(fmt.Sprintf(\"module directory paths:\\n%s\", strings.Join(moduleDirPaths, \"\\n\")))\n\t}\n\tif len(bufGenYAMLFilePaths) > 0 {\n\t\tm.logger.Debug(fmt.Sprintf(\"buf.gen.yaml file paths:\\n%s\", strings.Join(bufGenYAMLFilePaths, \"\\n\")))\n\t}\n}\n\nfunc (m *migrator) getMigrateBuilder(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tworkspaceDirPaths []string,\n\tmoduleDirPaths []string,\n\tbufGenYAMLFilePaths []string,\n) (*migrateBuilder, error) {\n\tif len(workspaceDirPaths) == 0 && len(moduleDirPaths) == 0 && len(bufGenYAMLFilePaths) == 0 {\n\t\treturn nil, errors.New(\"no directory or file specified\")\n\t}\n\t// Directories cannot jump context because in the migrated buf.yaml v2, each\n\t// directory path cannot jump context. I.e. it's not valid to have `- path: ..`\n\t// in a buf.yaml v2.\n\tworkspaceDirPaths, err := xslices.MapError(workspaceDirPaths, normalpath.NormalizeAndValidate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmoduleDirPaths, err = xslices.MapError(moduleDirPaths, normalpath.NormalizeAndValidate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// This does mean that buf.gen.yamls need to be under the directory this is run at, but this is OK.\n\tbufGenYAMLFilePaths, err = xslices.MapError(bufGenYAMLFilePaths, normalpath.NormalizeAndValidate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// the directory where the migrated buf.yaml live, this is useful for computing\n\t// module directory paths, and possibly other paths.\n\tdestinationDirPath := \".\"\n\tif len(workspaceDirPaths) == 1 && len(moduleDirPaths) == 0 {\n\t\tdestinationDirPath = workspaceDirPaths[0]\n\t}\n\tmigrateBuilder := newMigrateBuilder(\n\t\tm.logger,\n\t\tm.commitProvider,\n\t\tbucket,\n\t\tdestinationDirPath,\n\t)\n\tfor _, workspaceDirPath := range workspaceDirPaths {\n\t\tif err := migrateBuilder.addWorkspace(ctx, workspaceDirPath); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfor _, moduleDirPath := range moduleDirPaths {\n\t\t// TODO FUTURE: read upwards to make sure it's not in a workspace.\n\t\t// i.e. for ./foo/bar/buf.yaml, check none of \"./foo\", \".\", \"../\", \"../..\", and etc. is a workspace.\n\t\t// The logic for this is in getMapPathAndSubDirPath from buffetch/internal\n\t\tif err := migrateBuilder.addModule(ctx, moduleDirPath); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfor _, bufGenYAMLFilePath := range bufGenYAMLFilePaths {\n\t\tif err := migrateBuilder.addBufGenYAML(ctx, bufGenYAMLFilePath); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn migrateBuilder, nil\n}\n\nfunc (m *migrator) migrate(ctx context.Context, bucket storage.WriteBucket, migrateBuilder *migrateBuilder) (retErr error) {\n\tfor _, path := range xslices.MapKeysToSortedSlice(migrateBuilder.pathsToDelete) {\n\t\tif err := bucket.Delete(ctx, path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor path, migratedBufGenYAMLFile := range migrateBuilder.pathToMigratedBufGenYAMLFile {\n\t\tif err := storage.ForWriteObject(ctx, bucket, path, func(writeObject storage.WriteObject) error {\n\t\t\treturn bufconfig.WriteBufGenYAMLFile(writeObject, migratedBufGenYAMLFile)\n\t\t}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// We create a buf.yaml if we have seen visited any module directory. Note\n\t// we add a module config even for a module directory without a buf.yaml.\n\tif len(migrateBuilder.moduleConfigs) > 0 {\n\t\tmigratedBufYAMLFile, migratedBufLockFile, err := m.buildBufYAMLAndBufLockFiles(ctx, migrateBuilder)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := bufconfig.PutBufYAMLFileForPrefix(ctx, bucket, migrateBuilder.destinationDirPath, migratedBufYAMLFile); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif migratedBufLockFile != nil {\n\t\t\tif err := bufconfig.PutBufLockFileForPrefix(ctx, bucket, migrateBuilder.destinationDirPath, migratedBufLockFile); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *migrator) diff(\n\tctx context.Context,\n\twriter io.Writer,\n\tmigrateBuilder *migrateBuilder,\n) (retErr error) {\n\toriginalFileBucket, addedFileBucket, err := m.getOriginalAndAddedFileBuckets(ctx, migrateBuilder)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn storage.Diff(\n\t\tctx,\n\t\twriter,\n\t\toriginalFileBucket,\n\t\taddedFileBucket,\n\t)\n}\n\n// Doing this as a separate function so we can use defer for WriteObjectCloser.Close.\n// Files are not written until Close is called.\nfunc (m *migrator) getOriginalAndAddedFileBuckets(\n\tctx context.Context,\n\tmigrateBuilder *migrateBuilder,\n) (_ storage.ReadBucket, _ storage.ReadBucket, retErr error) {\n\t// Contains the original files before modification. Includes both the deleted files\n\t// and the originals of any files that were added.\n\toriginalFileBucket := storagemem.NewReadWriteBucket()\n\t// Contains the added files\n\taddedFileBucket := storagemem.NewReadWriteBucket()\n\tfor pathToDelete := range migrateBuilder.pathsToDelete {\n\t\tif err := storage.CopyPath(\n\t\t\tctx,\n\t\t\tmigrateBuilder.bucket,\n\t\t\tpathToDelete,\n\t\t\toriginalFileBucket,\n\t\t\tpathToDelete,\n\t\t); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\t// We create a buf.yaml if we have seen visited any module directory. Note\n\t// we add a module config even for a module directory without a buf.yaml.\n\tif len(migrateBuilder.moduleConfigs) > 0 {\n\t\tmigratedBufYAMLFile, migratedBufLockFile, err := m.buildBufYAMLAndBufLockFiles(ctx, migrateBuilder)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tmigratedBufYAMLFilePath := normalpath.Join(migrateBuilder.destinationDirPath, bufconfig.DefaultBufYAMLFileName)\n\t\tif err := storage.CopyPath(\n\t\t\tctx,\n\t\t\tmigrateBuilder.bucket,\n\t\t\tmigratedBufYAMLFilePath,\n\t\t\toriginalFileBucket,\n\t\t\tmigratedBufYAMLFilePath,\n\t\t); err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t\twriteObjectCloser, err := addedFileBucket.Put(ctx, migratedBufYAMLFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tdefer func() {\n\t\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t\t}()\n\t\tif err := bufconfig.WriteBufYAMLFile(writeObjectCloser, migratedBufYAMLFile); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif migratedBufLockFile != nil {\n\t\t\tmigratedBufLockFilePath := normalpath.Join(migrateBuilder.destinationDirPath, bufconfig.DefaultBufLockFileName)\n\t\t\tif err := storage.CopyPath(\n\t\t\t\tctx,\n\t\t\t\tmigrateBuilder.bucket,\n\t\t\t\tmigratedBufLockFilePath,\n\t\t\t\toriginalFileBucket,\n\t\t\t\tmigratedBufLockFilePath,\n\t\t\t); err != nil {\n\t\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\t\treturn nil, nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\twriteObjectCloser, err := addedFileBucket.Put(ctx, migratedBufLockFilePath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tdefer func() {\n\t\t\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t\t\t}()\n\t\t\tif err := bufconfig.WriteBufLockFile(writeObjectCloser, migratedBufLockFile); err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t}\n\tfor bufGenYAMLPath, migratedBufGenYAMLFile := range migrateBuilder.pathToMigratedBufGenYAMLFile {\n\t\tif err := storage.CopyPath(\n\t\t\tctx,\n\t\t\tmigrateBuilder.bucket,\n\t\t\tbufGenYAMLPath,\n\t\t\toriginalFileBucket,\n\t\t\tbufGenYAMLPath,\n\t\t); err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t\twriteObjectCloser, err := addedFileBucket.Put(ctx, bufGenYAMLPath)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tdefer func() {\n\t\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t\t}()\n\t\tif err := bufconfig.WriteBufGenYAMLFile(writeObjectCloser, migratedBufGenYAMLFile); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\treturn originalFileBucket, addedFileBucket, nil\n}\n\n// If this function doesn't return an error, the BufYAMLFile returned is never nil,\n// but the BufLockFile returned may be nil.\nfunc (m *migrator) buildBufYAMLAndBufLockFiles(\n\tctx context.Context,\n\tmigrateBuilder *migrateBuilder,\n) (bufconfig.BufYAMLFile, bufconfig.BufLockFile, error) {\n\t// module full name --> the list of declared dependencies that are this module.\n\tdepModuleToDeclaredRefs := make(map[string][]bufparse.Ref)\n\tfor _, declaredRef := range migrateBuilder.configuredDepModuleRefs {\n\t\tmoduleFullName := declaredRef.FullName().String()\n\t\t// If a declared dependency also shows up in the workspace, it's not a dependency.\n\t\tif _, ok := migrateBuilder.moduleFullNameStringToParentPath[moduleFullName]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tdepModuleToDeclaredRefs[moduleFullName] = append(depModuleToDeclaredRefs[moduleFullName], declaredRef)\n\t}\n\t// module full name --> the list of lock entries that are this module.\n\tdepModuleToLockEntries := make(map[string][]bufmodule.ModuleKey)\n\tfor _, lockEntry := range migrateBuilder.depModuleKeys {\n\t\tmoduleFullName := lockEntry.FullName().String()\n\t\t// If a declared dependency also shows up in the workspace, it's not a dependency.\n\t\t//\n\t\t// We are only removing lock entries that are in the workspace. A lock entry\n\t\t// could be for an indirect dependency not listed in deps in any buf.yaml.\n\t\tif _, ok := migrateBuilder.moduleFullNameStringToParentPath[moduleFullName]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tdepModuleToLockEntries[moduleFullName] = append(depModuleToLockEntries[moduleFullName], lockEntry)\n\t}\n\t// This will be set to false if the duplicate dependencies cannot be resolved locally.\n\tareDependenciesResolved := true\n\tfor depModule, declaredRefs := range depModuleToDeclaredRefs {\n\t\trefStringToRef := make(map[string]bufparse.Ref)\n\t\tfor _, ref := range declaredRefs {\n\t\t\t// Add ref even if ref.Ref() is empty. Therefore, xslices.ToValuesMap is not used.\n\t\t\trefStringToRef[ref.Ref()] = ref\n\t\t}\n\t\t// If there are both buf.build/foo/bar and buf.build/foo/bar:some_ref, the former will\n\t\t// not be used.\n\t\tif len(refStringToRef) > 1 {\n\t\t\tdelete(refStringToRef, \"\")\n\t\t}\n\t\tdepModuleToDeclaredRefs[depModule] = xslices.MapValuesToSlice(refStringToRef)\n\t\tif len(refStringToRef) > 1 {\n\t\t\tareDependenciesResolved = false\n\t\t}\n\t}\n\tfor depModule, lockEntries := range depModuleToLockEntries {\n\t\tcommitIDToKey := make(map[uuid.UUID]bufmodule.ModuleKey)\n\t\tfor _, lockEntry := range lockEntries {\n\t\t\t// There may be duplicates, we ignore this. They should be the same.\n\t\t\t// We could check,\n\t\t\tcommitIDToKey[lockEntry.CommitID()] = lockEntry\n\t\t}\n\t\tdepModuleToLockEntries[depModule] = xslices.MapValuesToSlice(commitIDToKey)\n\t\tif len(commitIDToKey) > 1 {\n\t\t\tareDependenciesResolved = false\n\t\t}\n\t}\n\tif areDependenciesResolved {\n\t\tresolvedDeclaredRefs := make([]bufparse.Ref, 0, len(depModuleToDeclaredRefs))\n\t\tfor _, depModuleRefs := range depModuleToDeclaredRefs {\n\t\t\t// depModuleRefs is guaranteed to have length 1, because areDependenciesResolved is true.\n\t\t\tresolvedDeclaredRefs = append(resolvedDeclaredRefs, depModuleRefs...)\n\t\t}\n\t\tbufYAML, err := bufconfig.NewBufYAMLFile(\n\t\t\tbufconfig.FileVersionV2,\n\t\t\tmigrateBuilder.moduleConfigs,\n\t\t\t// TODO: If we ever need to migrate from a v2 to v3, we will need to handle PluginConfigs and PolicyConfigs\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tresolvedDeclaredRefs,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tresolvedLockEntries := make([]bufmodule.ModuleKey, 0, len(depModuleToLockEntries))\n\t\tfor _, lockEntry := range depModuleToLockEntries {\n\t\t\tresolvedLockEntries = append(resolvedLockEntries, lockEntry...)\n\t\t}\n\t\tvar bufLock bufconfig.BufLockFile\n\t\tif migrateBuilder.hasSeenBufLockFile {\n\t\t\tresolvedLockEntries, err := m.upgradeModuleKeysToB5(ctx, resolvedLockEntries)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tbufLock, err = bufconfig.NewBufLockFile(\n\t\t\t\tbufconfig.FileVersionV2,\n\t\t\t\tresolvedLockEntries,\n\t\t\t\tnil, // Plugins are not supported in v1.\n\t\t\t\tnil, // Policies are not supported in v1.\n\t\t\t\tnil, // Policy PluginKeys are not supported in v1.\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}\n\t\t// bufLock could be nil here, but that's OK, see docs for this function.\n\t\treturn bufYAML, bufLock, nil\n\t}\n\tmoduleToRefToCommit, err := m.getModuleToRefToCommit(ctx, migrateBuilder.configuredDepModuleRefs)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tcommitIDToCommit, err := m.getCommitIDToCommit(ctx, migrateBuilder.depModuleKeys)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tresolvedDepModuleRefs, resolvedDepModuleKeys, err := resolvedDeclaredAndLockedDependencies(\n\t\tmoduleToRefToCommit,\n\t\tcommitIDToCommit,\n\t\tdepModuleToDeclaredRefs,\n\t\tdepModuleToLockEntries,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tbufYAML, err := bufconfig.NewBufYAMLFile(\n\t\tbufconfig.FileVersionV2,\n\t\tmigrateBuilder.moduleConfigs,\n\t\t// TODO: If we ever need to migrate from a v2 to v3, we will need to handle PluginConfigs and PolicyConfigs\n\t\tnil,\n\t\tnil,\n\t\tresolvedDepModuleRefs,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tvar bufLock bufconfig.BufLockFile\n\tif migrateBuilder.hasSeenBufLockFile {\n\t\tresolvedDepModuleKeys, err := m.upgradeModuleKeysToB5(ctx, resolvedDepModuleKeys)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tbufLock, err = bufconfig.NewBufLockFile(\n\t\t\tbufconfig.FileVersionV2,\n\t\t\tresolvedDepModuleKeys,\n\t\t\tnil, // Plugins are not supported in v1.\n\t\t\tnil, // Policies are not supported in v1.\n\t\t\tnil, // Policy PluginKeys are not supported in v1.\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\treturn bufYAML, bufLock, nil\n}\n\nfunc (m *migrator) getModuleToRefToCommit(\n\tctx context.Context,\n\tmoduleRefs []bufparse.Ref,\n) (map[string]map[string]bufmodule.Commit, error) {\n\t// The module refs that are collected by migrateBuilder is across all modules being\n\t// migrated, so there may be duplicates. ModuleKeyProvider errors on duplicate module\n\t// refs because it is expensive to make multiple calls to resolve the same module ref,\n\t// so we deduplicate the module refs we are passing here.\n\tmoduleRefs = xslices.DeduplicateAny(\n\t\tmoduleRefs,\n\t\tfunc(moduleRef bufparse.Ref) string { return moduleRef.String() },\n\t)\n\tmoduleKeys, err := m.moduleKeyProvider.GetModuleKeysForModuleRefs(ctx, moduleRefs, bufmodule.DigestTypeB5)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommits, err := m.commitProvider.GetCommitsForModuleKeys(ctx, moduleKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmoduleToRefToCommit := make(map[string]map[string]bufmodule.Commit)\n\tfor i, moduleRef := range moduleRefs {\n\t\tif moduleRef.Ref() == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\t// We know that that the ModuleKeys and Commits match up with the ModuleRefs via the definition\n\t\t// of GetModuleKeysForModuleRefs and GetCommitsForModuleKeys.\n\t\tcommit := commits[i]\n\n\t\tmoduleFullName := moduleRef.FullName()\n\t\tif moduleToRefToCommit[moduleFullName.String()] == nil {\n\t\t\tmoduleToRefToCommit[moduleFullName.String()] = make(map[string]bufmodule.Commit)\n\t\t}\n\t\tmoduleToRefToCommit[moduleFullName.String()][moduleRef.Ref()] = commit\n\t}\n\treturn moduleToRefToCommit, nil\n}\n\nfunc (m *migrator) getCommitIDToCommit(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) (map[uuid.UUID]bufmodule.Commit, error) {\n\t// The module keys that are collected by migrateBuilder is across all modules being\n\t// migrated, so there may be duplicates. CommitProvider errors on duplicate module\n\t// keys because it is expensive to make multiple calls to resolve the same module key,\n\t// so we deduplicate the module keys we are passing here.\n\tmoduleKeys = xslices.DeduplicateAny(\n\t\tmoduleKeys,\n\t\tfunc(moduleKey bufmodule.ModuleKey) string { return moduleKey.String() },\n\t)\n\tcommits, err := m.commitProvider.GetCommitsForModuleKeys(ctx, moduleKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitIDToCommit := make(map[uuid.UUID]bufmodule.Commit, len(commits))\n\tfor _, commit := range commits {\n\t\t// We don't know if these are unique, so we do not use xslices.ToUniqueValuesMapError.\n\t\tcommitIDToCommit[commit.ModuleKey().CommitID()] = commit\n\t}\n\treturn commitIDToCommit, nil\n}\n\nfunc (m *migrator) upgradeModuleKeysToB5(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.ModuleKey, error) {\n\tmoduleKeys = slices.Clone(moduleKeys)\n\n\tb4IndexedModuleKeys, err := xslices.FilterError(\n\t\txslices.ToIndexed(moduleKeys),\n\t\tfunc(indexedModuleKey xslices.Indexed[bufmodule.ModuleKey]) (bool, error) {\n\t\t\tdigest, err := indexedModuleKey.Value.Digest()\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\treturn digest.Type() == bufmodule.DigestTypeB4, nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(b4IndexedModuleKeys) == 0 {\n\t\treturn moduleKeys, nil\n\t}\n\n\tcommitKeys, err := xslices.MapError(\n\t\tb4IndexedModuleKeys,\n\t\tfunc(indexedModuleKey xslices.Indexed[bufmodule.ModuleKey]) (bufmodule.CommitKey, error) {\n\t\t\treturn bufmodule.NewCommitKey(\n\t\t\t\tindexedModuleKey.Value.FullName().Registry(),\n\t\t\t\tindexedModuleKey.Value.CommitID(),\n\t\t\t\tbufmodule.DigestTypeB5,\n\t\t\t)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommits, err := m.commitProvider.GetCommitsForCommitKeys(ctx, commitKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor i, commit := range commits {\n\t\t// The index into moduleKeys.\n\t\tmoduleKeyIndex := b4IndexedModuleKeys[i].Index\n\t\texistingModuleKey := moduleKeys[moduleKeyIndex]\n\t\tnewModuleKey, err := bufmodule.NewModuleKey(\n\t\t\texistingModuleKey.FullName(),\n\t\t\texistingModuleKey.CommitID(),\n\t\t\tcommit.ModuleKey().Digest,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmoduleKeys[moduleKeyIndex] = newModuleKey\n\t}\n\treturn moduleKeys, nil\n}\n\nfunc resolvedDeclaredAndLockedDependencies(\n\tmoduleToRefToCommit map[string]map[string]bufmodule.Commit,\n\tcommitIDToCommit map[uuid.UUID]bufmodule.Commit,\n\tmoduleFullNameToDeclaredRefs map[string][]bufparse.Ref,\n\tmoduleFullNameToLockKeys map[string][]bufmodule.ModuleKey,\n) ([]bufparse.Ref, []bufmodule.ModuleKey, error) {\n\tdepFullNameToResolvedRef := make(map[string]bufparse.Ref)\n\tfor moduleFullName, refs := range moduleFullNameToDeclaredRefs {\n\t\tvar errs []error\n\t\t// There are multiple pinned versions of the same dependency, we use the latest one.\n\t\tsort.Slice(refs, func(i, j int) bool {\n\t\t\trefToCommit := moduleToRefToCommit[moduleFullName]\n\t\t\tiTime, err := refToCommit[refs[i].Ref()].CreateTime()\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\t\tjTime, err := refToCommit[refs[j].Ref()].CreateTime()\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\t\treturn iTime.After(jTime)\n\t\t})\n\t\tif len(errs) > 0 {\n\t\t\treturn nil, nil, errors.Join(errs...)\n\t\t}\n\t\tdepFullNameToResolvedRef[moduleFullName] = refs[0]\n\t}\n\tresolvedDepModuleKeys := make([]bufmodule.ModuleKey, 0, len(moduleFullNameToLockKeys))\n\tfor moduleFullName, lockKeys := range moduleFullNameToLockKeys {\n\t\tresolvedRef, ok := depFullNameToResolvedRef[moduleFullName]\n\t\tif ok && resolvedRef.Ref() != \"\" {\n\t\t\t// If we have already picked a pinned dependency ref for this dependency,\n\t\t\t// we use that as the lock entry as well.\n\t\t\tresolvedCommit := moduleToRefToCommit[moduleFullName][resolvedRef.Ref()]\n\t\t\tresolvedDepModuleKeys = append(resolvedDepModuleKeys, resolvedCommit.ModuleKey())\n\t\t\tcontinue\n\t\t}\n\t\tvar errs []error\n\t\t// Otherwise, we pick the latest key from the buf.locks we have read.\n\t\tsort.Slice(lockKeys, func(i, j int) bool {\n\t\t\tiTime, err := commitIDToCommit[lockKeys[i].CommitID()].CreateTime()\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\t\tjTime, err := commitIDToCommit[lockKeys[j].CommitID()].CreateTime()\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\t\treturn iTime.After(jTime)\n\t\t})\n\t\tif len(errs) > 0 {\n\t\t\treturn nil, nil, errors.Join(errs...)\n\t\t}\n\t\tresolvedDepModuleKeys = append(resolvedDepModuleKeys, lockKeys[0])\n\t}\n\tresolvedDeclaredDependencies := xslices.MapValuesToSlice(depFullNameToResolvedRef)\n\t// Sort the resolved dependencies for deterministic results.\n\tsort.Slice(resolvedDeclaredDependencies, func(i, j int) bool {\n\t\treturn resolvedDeclaredDependencies[i].FullName().String() < resolvedDeclaredDependencies[j].FullName().String()\n\t})\n\tsort.Slice(resolvedDepModuleKeys, func(i, j int) bool {\n\t\treturn resolvedDepModuleKeys[i].FullName().String() < resolvedDepModuleKeys[j].FullName().String()\n\t})\n\treturn resolvedDeclaredDependencies, resolvedDepModuleKeys, nil\n}\n\nfunc equivalentLintConfigInV2(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tlintConfig bufconfig.LintConfig,\n) (bufconfig.LintConfig, error) {\n\tequivalentCheckConfigV2, err := equivalentCheckConfigInV2(\n\t\tctx,\n\t\tlogger,\n\t\tcheck.RuleTypeLint,\n\t\tlintConfig,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.NewLintConfig(\n\t\tequivalentCheckConfigV2,\n\t\tlintConfig.EnumZeroValueSuffix(),\n\t\tlintConfig.RPCAllowSameRequestResponse(),\n\t\tlintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\tlintConfig.RPCAllowGoogleProtobufEmptyResponses(),\n\t\tlintConfig.ServiceSuffix(),\n\t\tlintConfig.AllowCommentIgnores(),\n\t), nil\n}\n\nfunc equivalentBreakingConfigInV2(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tbreakingConfig bufconfig.BreakingConfig,\n) (bufconfig.BreakingConfig, error) {\n\tequivalentCheckConfigV2, err := equivalentCheckConfigInV2(\n\t\tctx,\n\t\tlogger,\n\t\tcheck.RuleTypeBreaking,\n\t\tbreakingConfig,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.NewBreakingConfig(\n\t\tequivalentCheckConfigV2,\n\t\tbreakingConfig.IgnoreUnstablePackages(),\n\t), nil\n}\n\n// Returns an equivalent check config with (close to) minimal difference in the\n// list of rules and categories specified.\nfunc equivalentCheckConfigInV2(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\truleType check.RuleType,\n\tcheckConfig bufconfig.CheckConfig,\n) (bufconfig.CheckConfig, error) {\n\t// No need for custom lint/breaking plugins since there's no plugins to migrate from <=v1.\n\t// TODO: If we ever need v3, then we will have to deal with this.\n\tclient, err := bufcheck.NewClient(logger)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texpectedRules, err := client.ConfiguredRules(ctx, ruleType, checkConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdeprecations, err := bufcheck.GetDeprecatedIDToReplacementIDs(expectedRules)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texpectedRules = xslices.Filter(expectedRules, func(rule bufcheck.Rule) bool { return !rule.Deprecated() })\n\texpectedIDs := xslices.Map(\n\t\texpectedRules,\n\t\tfunc(rule bufcheck.Rule) string {\n\t\t\treturn rule.ID()\n\t\t},\n\t)\n\n\t// First create a check config with the exact same UseIDsAndCategories. This\n\t// is a simple translation. It may or may not be equivalent to the given check config.\n\tsimplyTranslatedCheckConfig, err := bufconfig.NewEnabledCheckConfig(\n\t\tbufconfig.FileVersionV2,\n\t\tundeprecateSlice(checkConfig.UseIDsAndCategories(), deprecations),\n\t\tundeprecateSlice(checkConfig.ExceptIDsAndCategories(), deprecations),\n\t\tcheckConfig.IgnorePaths(),\n\t\tundeprecateMap(checkConfig.IgnoreIDOrCategoryToPaths(), deprecations),\n\t\tcheckConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsimplyTranslatedRules, err := client.ConfiguredRules(ctx, ruleType, simplyTranslatedCheckConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsimplyTranslatedIDs := xslices.Map(\n\t\tsimplyTranslatedRules,\n\t\tfunc(rule bufcheck.Rule) string {\n\t\t\treturn rule.ID()\n\t\t},\n\t)\n\tif slices.Equal(expectedIDs, simplyTranslatedIDs) {\n\t\t// If the simple translation is equivalent to before, use it.\n\t\treturn simplyTranslatedCheckConfig, nil\n\t}\n\t// Otherwise, find what's missing and what's extra.\n\texpectedIDsMap := xslices.ToStructMap(expectedIDs)\n\tsimplyTranslatedIDsMap := xslices.ToStructMap(simplyTranslatedIDs)\n\tmissingIDs := xslices.Filter(\n\t\texpectedIDs,\n\t\tfunc(expectedID string) bool {\n\t\t\t_, ok := simplyTranslatedIDsMap[expectedID]\n\t\t\treturn !ok\n\t\t},\n\t)\n\textraIDs := xslices.Filter(\n\t\tsimplyTranslatedIDs,\n\t\tfunc(simplyTranslatedID string) bool {\n\t\t\t_, ok := expectedIDsMap[simplyTranslatedID]\n\t\t\treturn !ok\n\t\t},\n\t)\n\t// Filter remaining rules to match the V2 rule set. Any other rules are ignored.\n\t// Theres no additional rules from plugins as plugins didn't exist before v2.\n\tvalidV2IDsMap := make(map[string]struct{})\n\tfor _, ruleSpec := range bufcheckserver.V2Spec.Rules {\n\t\tif ruleSpec.Type == ruleType {\n\t\t\tvalidV2IDsMap[ruleSpec.ID] = struct{}{}\n\t\t}\n\t}\n\tfor _, categorySpec := range bufcheckserver.V2Spec.Categories {\n\t\tvalidV2IDsMap[categorySpec.ID] = struct{}{}\n\t}\n\tuseIDsAndCategories := xslices.Filter(\n\t\tappend(simplyTranslatedCheckConfig.UseIDsAndCategories(), missingIDs...),\n\t\tfunc(ruleID string) bool {\n\t\t\t_, ok := validV2IDsMap[ruleID]\n\t\t\treturn ok\n\t\t},\n\t)\n\texceptIDsAndCategories := xslices.Filter(\n\t\tappend(simplyTranslatedCheckConfig.ExceptIDsAndCategories(), extraIDs...),\n\t\tfunc(ruleID string) bool {\n\t\t\t_, ok := validV2IDsMap[ruleID]\n\t\t\treturn ok\n\t\t},\n\t)\n\treturn bufconfig.NewEnabledCheckConfig(\n\t\tbufconfig.FileVersionV2,\n\t\tuseIDsAndCategories,\n\t\texceptIDsAndCategories,\n\t\tsimplyTranslatedCheckConfig.IgnorePaths(),\n\t\tsimplyTranslatedCheckConfig.IgnoreIDOrCategoryToPaths(),\n\t\tsimplyTranslatedCheckConfig.DisableBuiltin(),\n\t)\n}\n\n// undeprecateSlice transforms the given slice of IDs so that any deprecated\n// IDs are replaced with their replacements per the given deprecations.\nfunc undeprecateSlice(ids []string, deprecations map[string][]string) []string {\n\tnewIDs := make([]string, 0, len(ids))\n\tfor _, id := range ids {\n\t\treplacements, ok := deprecations[id]\n\t\tif ok {\n\t\t\tnewIDs = append(newIDs, replacements...)\n\t\t} else {\n\t\t\tnewIDs = append(newIDs, id)\n\t\t}\n\t}\n\treturn newIDs\n}\n\n// undeprecateMap transforms the given map of IDs to values so that any\n// deprecated IDs are replaced with their replacements per the given\n// deprecations. When there is more than one replacement, all entries\n// for the replacements will have the same value.\nfunc undeprecateMap[T any](idMap map[string]T, deprecations map[string][]string) map[string]T {\n\tnewIDs := make(map[string]T, len(idMap))\n\tfor id, val := range idMap {\n\t\treplacements, ok := deprecations[id]\n\t\tif ok {\n\t\t\tfor _, replacement := range replacements {\n\t\t\t\tnewIDs[replacement] = val\n\t\t\t}\n\t\t} else {\n\t\t\tnewIDs[id] = val\n\t\t}\n\t}\n\treturn newIDs\n}\n"
  },
  {
    "path": "private/buf/bufmigrate/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufmigrate\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufprint/bufprint.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/protostat\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/known/timestamppb\"\n)\n\nconst (\n\t// FormatText is the text format.\n\tFormatText Format = 1\n\t// FormatJSON is the JSON format.\n\tFormatJSON Format = 2\n)\n\nvar (\n\t// AllFormatsString is the string representation of all Formats.\n\tAllFormatsString = xstrings.SliceToString([]string{FormatText.String(), FormatJSON.String()})\n)\n\n// Format is a format to print.\ntype Format int\n\n// ParseFormat parses the format.\n//\n// If the empty string is provided, this is interpreted as FormatText.\nfunc ParseFormat(s string) (Format, error) {\n\tswitch s {\n\tcase \"\", \"text\":\n\t\treturn FormatText, nil\n\tcase \"json\":\n\t\treturn FormatJSON, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown format: %s\", s)\n\t}\n}\n\n// String implements fmt.Stringer.\nfunc (f Format) String() string {\n\tswitch f {\n\tcase FormatText:\n\t\treturn \"text\"\n\tcase FormatJSON:\n\t\treturn \"json\"\n\tdefault:\n\t\treturn strconv.Itoa(int(f))\n\t}\n}\n\n// Entity is an entity printed structurally by functions in bufprint package.\n// It's used in \"buf registry\" commands where the CLI prints a page of entities, such as\n// commits, an entity's info or simply an entity's full name.\n//\n// When printed by PrintEntity in text format, any field with a field tag in the form\n// of `bufprint:\"<field name>[,omitempty]\"` is printed.\n//\n// This means that an implementation of Entity must also be a struct.\ntype Entity interface {\n\tfullName() string\n}\n\n// PrintNames prints entities' names.\n//\n// If format is FormatJSON, this also prints information about each entity, the\n// same as calling PrintInfo on each entity.\nfunc PrintNames(writer io.Writer, format Format, entities ...Entity) error {\n\tswitch format {\n\tcase FormatJSON:\n\t\tfor _, entity := range entities {\n\t\t\tif err := json.NewEncoder(writer).Encode(entity); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase FormatText:\n\t\tfor _, entity := range entities {\n\t\t\tif _, err := fmt.Fprintln(writer, entity.fullName()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn syserror.Newf(\"unknown format: %s\", format)\n\t}\n}\n\n// PrintPage prints a page of entities.\nfunc PrintPage(\n\twriter io.Writer,\n\tformat Format,\n\tnextPageToken string,\n\tnextPageCommand string,\n\tentities []Entity,\n) error {\n\tif len(entities) == 0 {\n\t\treturn nil\n\t}\n\tvar entitiesName string\n\tfor _, entity := range entities {\n\t\tvar currentEntitiesName string\n\t\tswitch entity.(type) {\n\t\tcase outputLabel:\n\t\t\tcurrentEntitiesName = \"labels\"\n\t\tcase outputCommit:\n\t\t\tcurrentEntitiesName = \"commits\"\n\t\tcase outputModule:\n\t\t\tcurrentEntitiesName = \"modules\"\n\t\tcase outputOrganization:\n\t\t\tcurrentEntitiesName = \"organizations\"\n\t\tdefault:\n\t\t\treturn syserror.Newf(\"unknown implementation of Entity: %T\", entity)\n\t\t}\n\t\tif currentEntitiesName != entitiesName && entitiesName != \"\" {\n\t\t\treturn syserror.Newf(\"the page has both %s and %s\", currentEntitiesName, entitiesName)\n\t\t}\n\t\tentitiesName = currentEntitiesName\n\t}\n\tswitch format {\n\tcase FormatText:\n\t\tif err := PrintNames(writer, format, entities...); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif nextPageToken == \"\" {\n\t\t\treturn nil\n\t\t}\n\t\t_, err := fmt.Fprintf(\n\t\t\twriter,\n\t\t\t\"\\nMore than %d %s found, run %q to list more\\n\",\n\t\t\tlen(entities),\n\t\t\tentitiesName,\n\t\t\tnextPageCommand,\n\t\t)\n\t\treturn err\n\tcase FormatJSON:\n\t\treturn json.NewEncoder(writer).Encode(&entityPage{\n\t\t\tNextPage:         nextPageToken,\n\t\t\tEntities:         entities,\n\t\t\tpluralEntityName: entitiesName,\n\t\t})\n\tdefault:\n\t\treturn syserror.Newf(\"unknown format: %v\", format)\n\t}\n}\n\n// PrintEntity prints an entity.\n//\n// If format is FormatText, this prints the information in a table.\n// If format is FormatJSON, this prints the information as a JSON object.\nfunc PrintEntity(writer io.Writer, format Format, entity Entity) error {\n\tswitch format {\n\tcase FormatJSON:\n\t\treturn json.NewEncoder(writer).Encode(entity)\n\tcase FormatText:\n\t\tfieldNames, fieldValues, err := getFieldNamesAndValuesForInfo(entity)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn WithTabWriter(\n\t\t\twriter,\n\t\t\tfieldNames,\n\t\t\tfunc(tabWriter TabWriter) error {\n\t\t\t\treturn tabWriter.Write(fieldValues...)\n\t\t\t},\n\t\t)\n\tdefault:\n\t\treturn syserror.Newf(\"unknown format: %s\", format)\n\t}\n}\n\n// NewLabelEntity returns a new label entity to print. It takes a label as an\n// interface to allow for modulev1.Label and pluginv1beta1.Label to be passed.\nfunc NewLabelEntity(label interface {\n\tGetName() string\n\tGetCommitId() string\n\tGetCreateTime() *timestamppb.Timestamp\n\tGetArchiveTime() *timestamppb.Timestamp\n}, moduleFullName bufparse.FullName) Entity {\n\tvar archiveTime *time.Time\n\tif label.GetArchiveTime() != nil {\n\t\ttimeValue := label.GetArchiveTime().AsTime()\n\t\tarchiveTime = &timeValue\n\t}\n\treturn outputLabel{\n\t\tName:           label.GetName(),\n\t\tCommit:         label.GetCommitId(),\n\t\tCreateTime:     label.GetCreateTime().AsTime(),\n\t\tArchiveTime:    archiveTime,\n\t\tentityFullName: moduleFullName,\n\t}\n}\n\n// NewCommitEntity returns a new commit entity to print. It takes a commit as\n// an interface to allow for modulev1.Commit and pluginv1beta1.Commit to be passed.\nfunc NewCommitEntity(\n\tcommit interface {\n\t\tGetId() string\n\t\tGetCreateTime() *timestamppb.Timestamp\n\t},\n\tmoduleFullName bufparse.FullName,\n\tsourceControlURL string,\n) Entity {\n\treturn outputCommit{\n\t\tCommit:           commit.GetId(),\n\t\tCreateTime:       commit.GetCreateTime().AsTime(),\n\t\tSourceControlURL: sourceControlURL,\n\t\tentityFullName:   moduleFullName,\n\t}\n}\n\n// NewModuleEntity returns a new module entity to print.\nfunc NewModuleEntity(module *modulev1.Module, moduleFullName bufparse.FullName) Entity {\n\treturn outputModule{\n\t\tID:               module.Id,\n\t\tRemote:           moduleFullName.Registry(),\n\t\tOwner:            moduleFullName.Owner(),\n\t\tName:             moduleFullName.Name(),\n\t\tFullName:         moduleFullName.String(),\n\t\tCreateTime:       module.CreateTime.AsTime(),\n\t\tState:            module.State.String(),\n\t\tDefaultLabelName: module.GetDefaultLabelName(),\n\t}\n}\n\n// NewOrganizationEntity returns a new organization entity to print.\nfunc NewOrganizationEntity(organization *ownerv1.Organization, remote string) Entity {\n\treturn outputOrganization{\n\t\tID:         organization.Id,\n\t\tRemote:     remote,\n\t\tName:       organization.Name,\n\t\tFullName:   fmt.Sprintf(\"%s/%s\", remote, organization.Name),\n\t\tCreateTime: organization.CreateTime.AsTime(),\n\t}\n}\n\n// NewPluginEntity returns a new plugin entity to print.\nfunc NewPluginEntity(plugin *pluginv1beta1.Plugin, pluginFullName bufparse.FullName) Entity {\n\treturn outputPlugin{\n\t\tID:         plugin.Id,\n\t\tRemote:     pluginFullName.Registry(),\n\t\tOwner:      pluginFullName.Owner(),\n\t\tName:       pluginFullName.Name(),\n\t\tFullName:   pluginFullName.String(),\n\t\tCreateTime: plugin.CreateTime.AsTime(),\n\t}\n}\n\n// NewPolicyEntity returns a new plugin entity to print.\nfunc NewPolicyEntity(policy *policyv1beta1.Policy, policyFullName bufparse.FullName) Entity {\n\treturn outputPolicy{\n\t\tID:         policy.Id,\n\t\tRemote:     policyFullName.Registry(),\n\t\tOwner:      policyFullName.Owner(),\n\t\tName:       policyFullName.Name(),\n\t\tFullName:   policyFullName.String(),\n\t\tCreateTime: policy.CreateTime.AsTime(),\n\t}\n}\n\n// NewUserEntity returns a new user entity to print.\nfunc NewUserEntity(user *registryv1alpha1.User) Entity {\n\treturn outputUser{\n\t\tUsername: user.GetUsername(),\n\t\t// We use the Username as the full name for the user when printing.\n\t\tFullName: user.GetUsername(),\n\t}\n}\n\n// CuratedPluginPrinter is a printer for curated plugins.\ntype CuratedPluginPrinter interface {\n\tPrintCuratedPlugin(ctx context.Context, format Format, plugin *registryv1alpha1.CuratedPlugin) error\n\tPrintCuratedPlugins(ctx context.Context, format Format, nextPageToken string, plugins ...*registryv1alpha1.CuratedPlugin) error\n}\n\n// NewCuratedPluginPrinter returns a new CuratedPluginPrinter.\nfunc NewCuratedPluginPrinter(writer io.Writer) CuratedPluginPrinter {\n\treturn newCuratedPluginPrinter(writer)\n}\n\n// TokenPrinter is a token printer.\n//\n// TODO: update to same format as other printers.\ntype TokenPrinter interface {\n\tPrintTokens(ctx context.Context, tokens ...*registryv1alpha1.Token) error\n}\n\n// NewTokenPrinter returns a new TokenPrinter.\n//\n// TODO: update to same format as other printers.\nfunc NewTokenPrinter(writer io.Writer, format Format) (TokenPrinter, error) {\n\tswitch format {\n\tcase FormatText:\n\t\treturn newTokenTextPrinter(writer), nil\n\tcase FormatJSON:\n\t\treturn newTokenJSONPrinter(writer), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown format: %v\", format)\n\t}\n}\n\n// StatsPrinter is a printer of Stats.\ntype StatsPrinter interface {\n\tPrintStats(ctx context.Context, format Format, stats *protostat.Stats) error\n}\n\n// NewStatsPrinter returns a new StatsPrinter.\nfunc NewStatsPrinter(writer io.Writer) StatsPrinter {\n\treturn newStatsPrinter(writer)\n}\n\n// SDKInfoPrinter is a printer for SDK info.\ntype SDKInfoPrinter interface {\n\tPrintSDKInfo(ctx context.Context, format Format, sdkInfo *registryv1alpha1.GetSDKInfoResponse) error\n}\n\n// NewSDKInfoPrinter returns a new SDKInfoPrinter.\nfunc NewSDKInfoPrinter(writer io.Writer) SDKInfoPrinter {\n\treturn newSDKInfoPrinter(writer)\n}\n\n// TabWriter is a tab writer.\ntype TabWriter interface {\n\tWrite(values ...string) error\n}\n\n// WithTabWriter calls a function with a TabWriter.\n//\n// Shared with internal packages.\nfunc WithTabWriter(\n\twriter io.Writer,\n\theader []string,\n\tf func(TabWriter) error,\n) (retErr error) {\n\ttabWriter := newTabWriter(writer)\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, tabWriter.Flush())\n\t}()\n\tif err := tabWriter.Write(header...); err != nil {\n\t\treturn err\n\t}\n\treturn f(tabWriter)\n}\n\n// *** PRIVATE ***\n\n// printProtoMessageJSON prints the Protobuf message as JSON.\nfunc printProtoMessageJSON(writer io.Writer, message proto.Message) error {\n\tdata, err := protoencoding.NewJSONMarshaler(nil, protoencoding.JSONMarshalerWithIndent()).Marshal(message)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = writer.Write(append(data, []byte(\"\\n\")...))\n\treturn err\n}\n\nfunc getFieldNamesAndValuesForInfo(entity any) ([]string, []string, error) {\n\treflectType := reflect.TypeOf(entity)\n\tif reflectType.Kind() != reflect.Struct {\n\t\treturn nil, nil, syserror.Newf(\"%T is not a struct\", entity)\n\t}\n\tnumField := reflectType.NumField()\n\treflectValue := reflect.ValueOf(entity)\n\tvar fieldNames []string\n\tvar fieldValues []string\n\tfor i := range numField {\n\t\tfield := reflectType.Field(i)\n\t\tbufprintTag, ok := field.Tag.Lookup(\"bufprint\")\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tvar fieldName string\n\t\tvar omitEmpty bool\n\t\tparts := strings.SplitN(bufprintTag, \",\", 2)\n\t\tswitch len(parts) {\n\t\tcase 1:\n\t\t\tfieldName = parts[0]\n\t\tcase 2:\n\t\t\tfieldName = parts[0]\n\t\t\tif parts[1] != \"omitempty\" {\n\t\t\t\treturn nil, nil, syserror.Newf(\"unknown bufprint tag value: %s\", parts[1])\n\t\t\t}\n\t\t\tomitEmpty = true\n\t\tdefault:\n\t\t\treturn nil, nil, syserror.Newf(\"unexpected number of parts in bufprint tag: %s\", bufprintTag)\n\t\t}\n\t\tvalue := reflectValue.Field(i)\n\t\tswitch t := value.Interface().(type) {\n\t\tcase string:\n\t\t\tif omitEmpty && t == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfieldValues = append(fieldValues, t)\n\t\tcase *time.Time:\n\t\t\tif omitEmpty && t == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar value string\n\t\t\tif t != nil {\n\t\t\t\tvalue = t.Format(time.RFC3339)\n\t\t\t}\n\t\t\tfieldValues = append(fieldValues, value)\n\t\tcase time.Time:\n\t\t\tif omitEmpty && (t.Equal(time.Time{}) || t.Equal((&timestamppb.Timestamp{}).AsTime())) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfieldValues = append(fieldValues, t.Format(time.RFC3339))\n\t\tdefault:\n\t\t\treturn nil, nil, syserror.Newf(\"unexpected data type: %T\", t)\n\t\t}\n\t\tfieldNames = append(fieldNames, fieldName)\n\t}\n\treturn fieldNames, fieldValues, nil\n}\n\ntype entityPage struct {\n\tNextPage string   `json:\"next_page,omitempty\"`\n\tEntities []Entity `json:\"entities\"`\n\n\tpluralEntityName string\n}\n\nfunc (p *entityPage) MarshalJSON() ([]byte, error) {\n\tvalue := reflect.ValueOf(*p)\n\tt := value.Type()\n\tfields := make([]reflect.StructField, 0)\n\tfor i := range t.NumField() {\n\t\tfields = append(fields, t.Field(i))\n\t\tif t.Field(i).Name == \"Entities\" {\n\t\t\tfields[i].Tag = reflect.StructTag(fmt.Sprintf(`json:\"%s\"`, p.pluralEntityName))\n\t\t}\n\t}\n\tnewType := reflect.StructOf(fields)\n\tnewValue := value.Convert(newType)\n\treturn json.Marshal(newValue.Interface())\n}\n\ntype outputLabel struct {\n\tName        string     `json:\"name,omitempty\" bufprint:\"Name\"`\n\tCommit      string     `json:\"commit,omitempty\" bufprint:\"Commit\"`\n\tCreateTime  time.Time  `json:\"create_time\" bufprint:\"Create Time\"`\n\tArchiveTime *time.Time `json:\"archive_time,omitempty\" bufprint:\"Archive Time,omitempty\"`\n\n\tentityFullName bufparse.FullName\n}\n\nfunc (l outputLabel) fullName() string {\n\treturn fmt.Sprintf(\"%s:%s\", l.entityFullName.String(), l.Name)\n}\n\ntype outputCommit struct {\n\tCommit           string    `json:\"commit,omitempty\" bufprint:\"Commit\"`\n\tCreateTime       time.Time `json:\"create_time\" bufprint:\"Create Time\"`\n\tSourceControlURL string    `json:\"source_control_url,omitempty\"`\n\n\tentityFullName bufparse.FullName\n}\n\nfunc (c outputCommit) fullName() string {\n\treturn fmt.Sprintf(\"%s:%s\", c.entityFullName.String(), c.Commit)\n}\n\ntype outputModule struct {\n\tID               string    `json:\"id,omitempty\"`\n\tRemote           string    `json:\"remote,omitempty\"`\n\tOwner            string    `json:\"owner,omitempty\"`\n\tName             string    `json:\"name,omitempty\"`\n\tFullName         string    `json:\"-\" bufprint:\"Name\"`\n\tCreateTime       time.Time `json:\"create_time\" bufprint:\"Create Time\"`\n\tState            string    `json:\"state,omitempty\"`\n\tDefaultLabelName string    `json:\"default_label_name,omitempty\"`\n}\n\nfunc (m outputModule) fullName() string {\n\treturn m.FullName\n}\n\ntype outputOrganization struct {\n\tID         string    `json:\"id,omitempty\"`\n\tRemote     string    `json:\"remote,omitempty\"`\n\tName       string    `json:\"name,omitempty\"`\n\tFullName   string    `json:\"-\" bufprint:\"Name\"`\n\tCreateTime time.Time `json:\"create_time\" bufprint:\"Create Time\"`\n}\n\nfunc (o outputOrganization) fullName() string {\n\treturn o.FullName\n}\n\ntype outputPlugin struct {\n\tID         string    `json:\"id,omitempty\"`\n\tRemote     string    `json:\"remote,omitempty\"`\n\tOwner      string    `json:\"owner,omitempty\"`\n\tName       string    `json:\"name,omitempty\"`\n\tFullName   string    `json:\"-\" bufprint:\"Name\"`\n\tCreateTime time.Time `json:\"create_time\" bufprint:\"Create Time\"`\n}\n\nfunc (m outputPlugin) fullName() string {\n\treturn m.FullName\n}\n\ntype outputPolicy struct {\n\tID         string    `json:\"id,omitempty\"`\n\tRemote     string    `json:\"remote,omitempty\"`\n\tOwner      string    `json:\"owner,omitempty\"`\n\tName       string    `json:\"name,omitempty\"`\n\tFullName   string    `json:\"-\" bufprint:\"Name\"`\n\tCreateTime time.Time `json:\"create_time\" bufprint:\"Create Time\"`\n}\n\nfunc (m outputPolicy) fullName() string {\n\treturn m.FullName\n}\n\ntype outputUser struct {\n\tUsername string `json:\"username,omitempty\"`\n\tFullName string `json:\"-\" bufprint:\"Name\"`\n}\n\nfunc (o outputUser) fullName() string {\n\treturn o.FullName\n}\n"
  },
  {
    "path": "private/buf/bufprint/curated_plugin_printer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n)\n\ntype curatedPluginPrinter struct {\n\twriter io.Writer\n}\n\nfunc newCuratedPluginPrinter(writer io.Writer) *curatedPluginPrinter {\n\treturn &curatedPluginPrinter{\n\t\twriter: writer,\n\t}\n}\n\nfunc (p *curatedPluginPrinter) PrintCuratedPlugin(_ context.Context, format Format, plugin *registryv1alpha1.CuratedPlugin) error {\n\tswitch format {\n\tcase FormatText:\n\t\treturn p.printCuratedPluginsText(plugin)\n\tcase FormatJSON:\n\t\treturn json.NewEncoder(p.writer).Encode(\n\t\t\tregistryCuratedPluginToOutputCuratedPlugin(plugin),\n\t\t)\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown format: %v\", format)\n\t}\n}\n\nfunc (p *curatedPluginPrinter) PrintCuratedPlugins(_ context.Context, format Format, nextPageToken string, plugins ...*registryv1alpha1.CuratedPlugin) error {\n\tswitch format {\n\tcase FormatText:\n\t\treturn p.printCuratedPluginsText(plugins...)\n\tcase FormatJSON:\n\t\toutputPlugins := make([]outputCuratedPlugin, 0, len(plugins))\n\t\tfor _, plugin := range plugins {\n\t\t\toutputPlugins = append(outputPlugins, registryCuratedPluginToOutputCuratedPlugin(plugin))\n\t\t}\n\t\treturn json.NewEncoder(p.writer).Encode(paginationWrapper{\n\t\t\tNextPage: nextPageToken,\n\t\t\tResults:  outputPlugins,\n\t\t})\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown format: %v\", format)\n\t}\n}\n\nfunc (p *curatedPluginPrinter) printCuratedPluginsText(plugins ...*registryv1alpha1.CuratedPlugin) error {\n\tif len(plugins) == 0 {\n\t\treturn nil\n\t}\n\treturn WithTabWriter(\n\t\tp.writer,\n\t\t[]string{\n\t\t\t\"Owner\",\n\t\t\t\"Name\",\n\t\t\t\"Version\",\n\t\t\t\"Revision\",\n\t\t},\n\t\tfunc(tabWriter TabWriter) error {\n\t\t\tfor _, plugin := range plugins {\n\t\t\t\tif err := tabWriter.Write(\n\t\t\t\t\tplugin.GetOwner(),\n\t\t\t\t\tplugin.GetName(),\n\t\t\t\t\tplugin.GetVersion(),\n\t\t\t\t\tstrconv.FormatInt(int64(plugin.GetRevision()), 10),\n\t\t\t\t); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\ntype outputCuratedPlugin struct {\n\tOwner       string `json:\"owner\"`\n\tName        string `json:\"name\"`\n\tVersion     string `json:\"version\"`\n\tRevision    uint32 `json:\"revision\"`\n\tImageDigest string `json:\"image_digest\"`\n}\n\nfunc registryCuratedPluginToOutputCuratedPlugin(plugin *registryv1alpha1.CuratedPlugin) outputCuratedPlugin {\n\treturn outputCuratedPlugin{\n\t\tOwner:       plugin.GetOwner(),\n\t\tName:        plugin.GetName(),\n\t\tVersion:     plugin.GetVersion(),\n\t\tRevision:    plugin.GetRevision(),\n\t\tImageDigest: plugin.GetContainerImageDigest(),\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufprint/pagination_wrapper.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\ntype paginationWrapper struct {\n\tNextPage string `json:\"next_page,omitempty\"`\n\tResults  any    `json:\"results\"`\n}\n"
  },
  {
    "path": "private/buf/bufprint/sdk_info_printer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"time\"\n\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n)\n\ntype sdkInfoPrinter struct {\n\twriter io.Writer\n}\n\nfunc newSDKInfoPrinter(writer io.Writer) *sdkInfoPrinter {\n\treturn &sdkInfoPrinter{\n\t\twriter: writer,\n\t}\n}\n\nfunc (p *sdkInfoPrinter) PrintSDKInfo(\n\tctx context.Context,\n\tformat Format,\n\tsdkInfo *registryv1alpha1.GetSDKInfoResponse,\n) error {\n\toutput := newOutputSDKInfo(sdkInfo)\n\tswitch format {\n\tcase FormatText:\n\t\tif _, err := fmt.Fprintf(\n\t\t\tp.writer,\n\t\t\t`Module\nOwner:  %s\nName:   %s\nCommit: %s\n\n`,\n\t\t\toutput.ModuleInfo.Owner,\n\t\t\toutput.ModuleInfo.Name,\n\t\t\toutput.ModuleInfo.Commit,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := fmt.Fprintf(\n\t\t\tp.writer,\n\t\t\t`Plugin\nOwner:    %s\nName:     %s\nVersion:  %s\nRevision: %d\n\n`,\n\t\t\toutput.PluginInfo.Owner,\n\t\t\toutput.PluginInfo.Name,\n\t\t\toutput.PluginInfo.Version,\n\t\t\toutput.PluginInfo.Revision,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err := fmt.Fprintf(p.writer, \"Version: %s\\n\", output.Version)\n\t\treturn err\n\tcase FormatJSON:\n\t\treturn json.NewEncoder(p.writer).Encode(output)\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown format: %v\", format)\n\t}\n}\n\ntype outputSDKInfo struct {\n\tModuleInfo outputSDKModuleInfo `json:\"module\"`\n\tPluginInfo outputSDKPluginInfo `json:\"plugin\"`\n\tVersion    string              `json:\"version,omitempty\"`\n}\n\ntype outputSDKModuleInfo struct {\n\tOwner            string    `json:\"owner,omitempty\"`\n\tName             string    `json:\"name,omitempty\"`\n\tCommit           string    `json:\"commit,omitempty\"`\n\tCommitCreateTime time.Time `json:\"commit_create_time\"`\n}\n\ntype outputSDKPluginInfo struct {\n\tOwner    string `json:\"owner,omitempty\"`\n\tName     string `json:\"name,omitempty\"`\n\tVersion  string `json:\"version,omitempty\"`\n\tRevision uint32 `json:\"revision,omitempty\"`\n}\n\nfunc newOutputSDKInfo(sdkInfo *registryv1alpha1.GetSDKInfoResponse) outputSDKInfo {\n\treturn outputSDKInfo{\n\t\tModuleInfo: outputSDKModuleInfo{\n\t\t\tOwner:            sdkInfo.GetModuleInfo().GetOwner(),\n\t\t\tName:             sdkInfo.GetModuleInfo().GetName(),\n\t\t\tCommit:           sdkInfo.GetModuleInfo().GetCommit(),\n\t\t\tCommitCreateTime: sdkInfo.GetModuleInfo().GetModuleCommitCreateTime().AsTime(),\n\t\t},\n\t\tPluginInfo: outputSDKPluginInfo{\n\t\t\tOwner:    sdkInfo.GetPluginInfo().GetOwner(),\n\t\t\tName:     sdkInfo.GetPluginInfo().GetName(),\n\t\t\tVersion:  sdkInfo.GetPluginInfo().GetVersion(),\n\t\t\tRevision: sdkInfo.GetPluginInfo().GetPluginRevision(),\n\t\t},\n\t\tVersion: sdkInfo.GetSdkVersion(),\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufprint/stats_printer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"github.com/bufbuild/buf/private/pkg/protostat\"\n)\n\ntype statsPrinter struct {\n\twriter io.Writer\n}\n\nfunc newStatsPrinter(writer io.Writer) *statsPrinter {\n\treturn &statsPrinter{\n\t\twriter: writer,\n\t}\n}\n\nfunc (p *statsPrinter) PrintStats(ctx context.Context, format Format, stats *protostat.Stats) error {\n\tswitch format {\n\tcase FormatText:\n\t\t_, err := fmt.Fprintf(\n\t\t\tp.writer,\n\t\t\t`Files:               %d\nTypes:               %d\nPackages:            %d\nMessages:            %d\nDeprecated Messages: %d\nFields:              %d\nEnums:               %d\nDeprecated Enums:    %d\nEnum Values:         %d\nServices:            %d\nRPCs:                %d\nDeprecated RPCs:     %d\nExtensions:          %d\n`,\n\n\t\t\tstats.Files,\n\t\t\tstats.Types,\n\t\t\tstats.Packages,\n\t\t\tstats.Messages,\n\t\t\tstats.DeprecatedMessages,\n\t\t\tstats.Fields,\n\t\t\tstats.Enums,\n\t\t\tstats.DeprecatedEnums,\n\t\t\tstats.EnumValues,\n\t\t\tstats.Services,\n\t\t\tstats.RPCs,\n\t\t\tstats.DeprecatedRPCs,\n\t\t\tstats.Extensions,\n\t\t)\n\t\treturn err\n\tcase FormatJSON:\n\t\treturn json.NewEncoder(p.writer).Encode(stats)\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown format: %v\", format)\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufprint/tab_writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\nimport (\n\t\"io\"\n\t\"strings\"\n\t\"text/tabwriter\"\n)\n\ntype tabWriter struct {\n\tdelegate *tabwriter.Writer\n}\n\nfunc newTabWriter(writer io.Writer) *tabWriter {\n\treturn &tabWriter{\n\t\tdelegate: tabwriter.NewWriter(writer, 0, 0, 2, ' ', 0),\n\t}\n}\n\nfunc (t *tabWriter) Write(values ...string) error {\n\tif len(values) == 0 {\n\t\treturn nil\n\t}\n\t_, err := t.delegate.Write([]byte(strings.Join(values, \"\\t\") + \"\\n\"))\n\treturn err\n}\n\nfunc (t *tabWriter) Flush() error {\n\treturn t.delegate.Flush()\n}\n"
  },
  {
    "path": "private/buf/bufprint/token_json_printer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n)\n\ntype tokenJSONPrinter struct {\n\twriter io.Writer\n}\n\nfunc newTokenJSONPrinter(writer io.Writer) *tokenJSONPrinter {\n\treturn &tokenJSONPrinter{\n\t\twriter: writer,\n\t}\n}\n\nfunc (p *tokenJSONPrinter) PrintTokens(\n\tctx context.Context,\n\ttokens ...*registryv1alpha1.Token,\n) error {\n\tfor _, token := range tokens {\n\t\tif err := printProtoMessageJSON(p.writer, token); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/bufprint/token_text_printer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprint\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"time\"\n\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n)\n\ntype tokenTextPrinter struct {\n\twriter io.Writer\n}\n\nfunc newTokenTextPrinter(writer io.Writer) *tokenTextPrinter {\n\treturn &tokenTextPrinter{\n\t\twriter: writer,\n\t}\n}\n\nfunc (p *tokenTextPrinter) PrintTokens(ctx context.Context, tokens ...*registryv1alpha1.Token) error {\n\tif len(tokens) == 0 {\n\t\treturn nil\n\t}\n\treturn WithTabWriter(\n\t\tp.writer,\n\t\t[]string{\n\t\t\t\"ID\",\n\t\t\t\"Note\",\n\t\t\t\"Create time\",\n\t\t\t\"Expire time\",\n\t\t},\n\t\tfunc(tabWriter TabWriter) error {\n\t\t\tfor _, token := range tokens {\n\t\t\t\tif err := tabWriter.Write(\n\t\t\t\t\ttoken.GetId(),\n\t\t\t\t\ttoken.GetNote(),\n\t\t\t\t\ttoken.GetCreateTime().AsTime().Format(time.RFC3339),\n\t\t\t\t\ttoken.GetExpireTime().AsTime().Format(time.RFC3339),\n\t\t\t\t); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/buf/bufprint/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufprint\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufprotoc/bufprotoc.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotoc builds ModuleSets for protoc include paths and file paths.\npackage bufprotoc\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"sort\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\n// NewModuleSetForProtoc returns a new ModuleSet for protoc -I dirPaths and filePaths.\n//\n// The returned ModuleSet will have a single targeted Module, with target files\n// matching the filePaths.\n//\n// Technically this will work with len(filePaths) == 0 but we should probably make sure\n// that is banned in protoc.\nfunc NewModuleSetForProtoc(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tincludeDirPaths []string,\n\tfilePaths []string,\n) (bufmodule.ModuleSet, error) {\n\tabsIncludeDirPaths, err := normalizeAndAbsolutePaths(includeDirPaths, \"include directory\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tabsFilePaths, err := normalizeAndAbsolutePaths(filePaths, \"input file\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar rootBuckets []storage.ReadBucket\n\tfor _, includeDirPath := range includeDirPaths {\n\t\trootBucket, err := storageosProvider.NewReadWriteBucket(\n\t\t\tincludeDirPath,\n\t\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// need to do match extension here\n\t\t// https://github.com/bufbuild/buf/issues/113\n\t\trootBuckets = append(rootBuckets, storage.FilterReadBucket(rootBucket, storage.MatchPathExt(\".proto\")))\n\t}\n\ttargetPaths, err := xslices.MapError(\n\t\tabsFilePaths,\n\t\tfunc(absFilePath string) (string, error) {\n\t\t\treturn applyRootsToTargetPath(absIncludeDirPaths, absFilePath, normalpath.Absolute)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, logger, bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\tmoduleSetBuilder.AddLocalModule(\n\t\tstorage.MultiReadBucket(rootBuckets...),\n\t\t\".\",\n\t\ttrue,\n\t\tbufmodule.LocalModuleWithTargetPaths(\n\t\t\ttargetPaths,\n\t\t\tnil,\n\t\t),\n\t)\n\treturn moduleSetBuilder.Build()\n}\n\n// *** PRIVATE ***\n\nfunc applyRootsToTargetPath(roots []string, path string, pathType normalpath.PathType) (string, error) {\n\tvar matchingRoots []string\n\tfor _, root := range roots {\n\t\tif normalpath.ContainsPath(root, path, pathType) {\n\t\t\tmatchingRoots = append(matchingRoots, root)\n\t\t}\n\t}\n\tswitch len(matchingRoots) {\n\tcase 0:\n\t\t// this is a user error and will likely happen often\n\t\treturn \"\", fmt.Errorf(\n\t\t\t\"path %q is not contained within any of roots %s - note that specified paths \"+\n\t\t\t\t\"cannot be roots, but must be contained within roots\",\n\t\t\tpath,\n\t\t\txstrings.SliceToHumanStringQuoted(roots),\n\t\t)\n\tcase 1:\n\t\ttargetPath, err := normalpath.Rel(matchingRoots[0], path)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\t// just in case\n\t\treturn normalpath.NormalizeAndValidate(targetPath)\n\tdefault:\n\t\t// this should never happen\n\t\treturn \"\", fmt.Errorf(\"%q is contained in multiple roots %s\", path, xstrings.SliceToHumanStringQuoted(roots))\n\t}\n}\n\n// normalizeAndAbsolutePaths verifies that:\n//\n//   - No paths are empty.\n//   - All paths are normalized.\n//   - All paths are unique.\n//   - No path contains another path.\n//\n// Normalizes, absolutes, and sorts the paths.\nfunc normalizeAndAbsolutePaths(paths []string, name string) ([]string, error) {\n\tif len(paths) == 0 {\n\t\treturn paths, nil\n\t}\n\toutputs := make([]string, len(paths))\n\tfor i, path := range paths {\n\t\tif path == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"%s contained an empty path\", name)\n\t\t}\n\t\toutput, err := normalpath.NormalizeAndAbsolute(path)\n\t\tif err != nil {\n\t\t\t// user error\n\t\t\treturn nil, err\n\t\t}\n\t\toutputs[i] = output\n\t}\n\tsort.Strings(outputs)\n\tfor i := range outputs {\n\t\tfor j := i + 1; j < len(outputs); j++ {\n\t\t\toutput1 := outputs[i]\n\t\t\toutput2 := outputs[j]\n\n\t\t\tif output1 == output2 {\n\t\t\t\treturn nil, fmt.Errorf(\"duplicate %s %q\", name, output1)\n\t\t\t}\n\t\t\tif normalpath.EqualsOrContainsPath(output2, output1, normalpath.Absolute) {\n\t\t\t\treturn nil, fmt.Errorf(\"%s %q is within %s %q which is not allowed\", name, output1, name, output2)\n\t\t\t}\n\t\t\tif normalpath.EqualsOrContainsPath(output1, output2, normalpath.Absolute) {\n\t\t\t\treturn nil, fmt.Errorf(\"%s %q is within %s %q which is not allowed\", name, output2, name, output1)\n\t\t\t}\n\t\t}\n\t}\n\treturn outputs, nil\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/bufprotoc_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotoc\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNewModuleSetForProtoc(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\tmoduleSet, err := NewModuleSetForProtoc(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tstorageos.NewProvider(),\n\t\t[]string{\n\t\t\t\"testdata/basic/bsr/buf.testing/acme/date\",\n\t\t\t\"testdata/basic/bsr/buf.testing/acme/extension\",\n\t\t\t\"testdata/basic/workspacev1/common/geo/proto\",\n\t\t\t\"testdata/basic/workspacev1/common/money/proto\",\n\t\t\t\"testdata/basic/workspacev1/finance/bond/proto/root1\",\n\t\t\t\"testdata/basic/workspacev1/finance/bond/proto/root2\",\n\t\t\t\"testdata/basic/workspacev1/finance/portfolio/proto\",\n\t\t},\n\t\t[]string{\n\t\t\t\"testdata/basic/workspacev1/finance/portfolio/proto/acme/portfolio/v1/portfolio.proto\",\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\n\tmodules := moduleSet.Modules()\n\trequire.Equal(t, 1, len(modules))\n\tmodule := modules[0]\n\trequire.Equal(t, \".\", module.OpaqueID())\n\trequire.True(t, module.IsTarget())\n\n\tfileInfo, err := module.StatFileInfo(ctx, \"acme/money/v1/currency_code.proto\")\n\trequire.NoError(t, err)\n\trequire.False(t, fileInfo.IsTargetFile())\n\tfileInfo, err = module.StatFileInfo(ctx, \"acme/money/v1/money.proto\")\n\trequire.NoError(t, err)\n\trequire.False(t, fileInfo.IsTargetFile())\n\tfileInfo, err = module.StatFileInfo(ctx, \"acme/bond/real/v1/bond.proto\")\n\trequire.NoError(t, err)\n\trequire.False(t, fileInfo.IsTargetFile())\n\tfileInfo, err = module.StatFileInfo(ctx, \"acme/portfolio/v1/portfolio.proto\")\n\trequire.NoError(t, err)\n\trequire.True(t, fileInfo.IsTargetFile())\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/bsr/buf.testing/acme/date/acme/date/v1/date.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.date.v1;\n\nimport \"acme/extension/v1/extension.proto\";\n\nmessage Date {\n  option (acme.extension.v1.experimental) = true;\n\n  uint32 day = 1;\n  uint32 month = 2;\n  uint32 year = 3;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/bsr/buf.testing/acme/extension/acme/extension/v1/extension.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.extension.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  bool experimental = 50001;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/workspacev1/common/geo/proto/acme/geo/v1/country_alpha_3_code.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.geo.v1;\n\nenum CountryAlpha3Code {\n  CURRENCY_ALPHA_3_CODE_UNSPECIFIED = 0;\n  CURRENCY_ALPHA_3_CODE_USA = 1;\n  CURRENCY_ALPHA_3_CODE_CAN = 2;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/workspacev1/common/money/proto/acme/money/v1/currency_code.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.money.v1;\n\nenum CurrencyCode {\n  CURRENCY_CODE_UNSPECIFIED = 0;\n  CURRENCY_CODE_USD = 1;\n  CURRENCY_CODE_CAD = 2;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/workspacev1/common/money/proto/acme/money/v1/money.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.money.v1;\n\nimport \"acme/money/v1/currency_code.proto\";\n\nmessage Money {\n  CurrencyCode currency_code = 1;\n  int64 value_micros = 2;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/workspacev1/finance/bond/proto/root1/acme/bond/excluded/v1/excluded.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.excluded.v1;\n\nmessage Excluded {}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/workspacev1/finance/bond/proto/root1/acme/bond/real/v1/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.real.v1;\n\nimport \"acme/date/v1/date.proto\";\nimport \"acme/geo/v1/country_alpha_3_code.proto\";\nimport \"acme/money/v1/currency_code.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  acme.geo.v1.CountryAlpha3Code country_alpha_3_code = 1;\n  acme.money.v1.CurrencyCode currency_code = 2;\n  acme.date.v1.Date purchase_date = 3;\n  google.protobuf.Duration duration = 4;\n  int64 interest_rate_micros = 5;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/workspacev1/finance/bond/proto/root2/acme/bond/v2/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.v2;\n\nimport \"acme/date/v1/date.proto\";\nimport \"acme/geo/v1/country_alpha_3_code.proto\";\nimport \"acme/money/v1/currency_code.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  acme.geo.v1.CountryAlpha3Code country_alpha_3_code = 1;\n  acme.money.v1.CurrencyCode currency_code = 2;\n  acme.date.v1.Date purchase_date = 3;\n  google.protobuf.Duration duration = 4;\n  int64 interest_rate_micros = 5;\n  string name = 6;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/testdata/basic/workspacev1/finance/portfolio/proto/acme/portfolio/v1/portfolio.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.portfolio.v1;\n\nimport \"acme/bond/v2/bond.proto\";\nimport \"acme/extension/v1/extension.proto\";\n\nmessage Portfolio {\n  option (acme.extension.v1.experimental) = true;\n\n  repeated acme.bond.v2.Bond bonds = 1;\n}\n"
  },
  {
    "path": "private/buf/bufprotoc/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufprotoc\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/binary_handler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io\"\n\t\"log/slog\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/standard/xio\"\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\ntype binaryHandler struct {\n\tlogger     *slog.Logger\n\tpluginPath string\n\tpluginArgs []string\n}\n\nfunc newBinaryHandler(\n\tlogger *slog.Logger,\n\tpluginPath string,\n\tpluginArgs []string,\n) *binaryHandler {\n\treturn &binaryHandler{\n\t\tlogger:     logger,\n\t\tpluginPath: pluginPath,\n\t\tpluginArgs: pluginArgs,\n\t}\n}\n\nfunc (h *binaryHandler) Handle(\n\tctx context.Context,\n\tpluginEnv protoplugin.PluginEnv,\n\tresponseWriter protoplugin.ResponseWriter,\n\trequest protoplugin.Request,\n) (retErr error) {\n\tdefer xslog.DebugProfile(h.logger, slog.String(\"plugin\", filepath.Base(h.pluginPath)))()\n\n\trequestData, err := protoencoding.NewWireMarshaler().Marshal(request.CodeGeneratorRequest())\n\tif err != nil {\n\t\treturn err\n\t}\n\tresponseBuffer := bytes.NewBuffer(nil)\n\tstderrWriteCloser := newStderrWriteCloser(pluginEnv.Stderr, h.pluginPath)\n\trunOptions := []xexec.RunOption{\n\t\txexec.WithEnv(pluginEnv.Environ),\n\t\txexec.WithStdin(bytes.NewReader(requestData)),\n\t\txexec.WithStdout(responseBuffer),\n\t\txexec.WithStderr(stderrWriteCloser),\n\t}\n\tif len(h.pluginArgs) > 0 {\n\t\trunOptions = append(runOptions, xexec.WithArgs(h.pluginArgs...))\n\t}\n\tif err := xexec.Run(\n\t\tctx,\n\t\th.pluginPath,\n\t\trunOptions...,\n\t); err != nil {\n\t\treturn err\n\t}\n\tresponse := &pluginpb.CodeGeneratorResponse{}\n\tif err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(responseBuffer.Bytes(), response); err != nil {\n\t\treturn err\n\t}\n\tresponseWriter.AddCodeGeneratorResponseFiles(response.GetFile()...)\n\tresponseWriter.AddError(response.GetError())\n\tresponseWriter.SetSupportedFeatures(response.GetSupportedFeatures())\n\tresponseWriter.SetMinimumEdition(response.GetMinimumEdition())\n\tresponseWriter.SetMaximumEdition(response.GetMaximumEdition())\n\treturn nil\n}\n\nfunc newStderrWriteCloser(delegate io.Writer, pluginPath string) io.WriteCloser {\n\tswitch filepath.Base(pluginPath) {\n\tcase \"protoc-gen-swift\":\n\t\t// https://github.com/bufbuild/buf/issues/1736\n\t\t// Swallowing specific stderr message for protoc-gen-swift as protoc-gen-swift, see issue.\n\t\t// This is all disgusting code but it's simple and it works.\n\t\t// We did not document if pluginPath is normalized or not, so\n\t\treturn newProtocGenSwiftStderrWriteCloser(delegate)\n\tdefault:\n\t\treturn xio.NopWriteCloser(delegate)\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/bufprotopluginexec.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec provides protoc plugin handling and execution.\n//\n// Note this is currently implicitly tested through buf's protoc command.\n// If this were split out into a separate package, testing would need to be moved to this package.\npackage bufprotopluginexec\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"os/exec\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nconst (\n\t// Note on versions: while Protobuf is on vX.0 where X >=21, and we\n\t// download protoc vX.0, the version reported by protoc --version is 3.X.0.\n\t// This is what we want to report here.\n\n\t// defaultMajorVersion is the default major version.\n\tdefaultMajorVersion = 6\n\t// defaultMinorVersion is the default minor version.\n\tdefaultMinorVersion = 33\n\t// defaultPatchVersion is the default patch version.\n\tdefaultPatchVersion = 3\n\t// defaultSuffixVersion is the default suffix version.\n\tdefaultSuffixVersion = \"\"\n)\n\nvar (\n\t// DefaultVersion represents the default version to use as compiler version for codegen requests.\n\tDefaultVersion = newVersion(\n\t\tdefaultMajorVersion,\n\t\tdefaultMinorVersion,\n\t\tdefaultPatchVersion,\n\t\tdefaultSuffixVersion,\n\t)\n)\n\n// Generator is used to generate code with plugins found on the local filesystem.\ntype Generator interface {\n\t// Generate generates a CodeGeneratorResponse for the given pluginName. The\n\t// pluginName must be available on the system's PATH or one of the plugins\n\t// built-in to protoc. The plugin path can be overridden via the\n\t// GenerateWithPluginPath option.\n\tGenerate(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStderrContainer,\n\t\tpluginName string,\n\t\trequests []*pluginpb.CodeGeneratorRequest,\n\t\toptions ...GenerateOption,\n\t) (*pluginpb.CodeGeneratorResponse, error)\n}\n\n// NewGenerator returns a new Generator.\nfunc NewGenerator(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n) Generator {\n\treturn newGenerator(logger, storageosProvider)\n}\n\n// GenerateOption is an option for Generate.\ntype GenerateOption func(*generateOptions)\n\n// GenerateWithPluginPath returns a new GenerateOption that uses the given path to the plugin.\n// If the path has more than one element, the first is the plugin binary and the others are\n// optional additional arguments to pass to the binary.\nfunc GenerateWithPluginPath(pluginPath ...string) GenerateOption {\n\treturn func(generateOptions *generateOptions) {\n\t\tgenerateOptions.pluginPath = pluginPath\n\t}\n}\n\n// GenerateWithProtocPath returns a new GenerateOption that uses the given protoc\n// path to the plugin.\nfunc GenerateWithProtocPath(protocPath ...string) GenerateOption {\n\treturn func(generateOptions *generateOptions) {\n\t\tgenerateOptions.protocPath = protocPath\n\t}\n}\n\n// NewHandler returns a new Handler based on the plugin name and optional path.\n//\n// protocPath and pluginPath are optional.\n//\n//   - If the plugin path is set, this returns a new binary handler for that path.\n//   - If the plugin path is unset, this does exec.LookPath for a binary named protoc-gen-pluginName,\n//     and if one is found, a new binary handler is returned for this.\n//   - Else, if the name is in ProtocProxyPluginNames, this returns a new protoc proxy handler.\n//   - Else, this returns error.\nfunc NewHandler(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tpluginName string,\n\toptions ...HandlerOption,\n) (protoplugin.Handler, error) {\n\thandlerOptions := newHandlerOptions()\n\tfor _, option := range options {\n\t\toption(handlerOptions)\n\t}\n\n\t// Initialize binary plugin handler when path is specified with optional args. Return\n\t// on error as something is wrong with the supplied pluginPath option.\n\tif len(handlerOptions.pluginPath) > 0 {\n\t\treturn NewBinaryHandler(logger, handlerOptions.pluginPath[0], handlerOptions.pluginPath[1:])\n\t}\n\n\t// Initialize binary plugin handler based on plugin name.\n\tif handler, err := NewBinaryHandler(logger, \"protoc-gen-\"+pluginName, nil); err == nil {\n\t\treturn handler, nil\n\t}\n\n\t// Initialize builtin protoc plugin handler. We always look for protoc-gen-X first,\n\t// but if not, check the builtins.\n\tif _, ok := bufconfig.ProtocProxyPluginNames[pluginName]; ok {\n\t\tif len(handlerOptions.protocPath) == 0 {\n\t\t\thandlerOptions.protocPath = []string{\"protoc\"}\n\t\t}\n\t\tprotocPath, protocExtraArgs := handlerOptions.protocPath[0], handlerOptions.protocPath[1:]\n\t\tprotocPath, err := unsafeLookPath(protocPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newProtocProxyHandler(logger, storageosProvider, protocPath, protocExtraArgs, pluginName), nil\n\t}\n\treturn nil, fmt.Errorf(\n\t\t\"could not find protoc plugin for name %s - please make sure protoc-gen-%s is installed and present on your $PATH\",\n\t\tpluginName,\n\t\tpluginName,\n\t)\n}\n\n// HandlerOption is an option for a new Handler.\ntype HandlerOption func(*handlerOptions)\n\n// HandlerWithProtocPath returns a new HandlerOption that sets the path to the protoc binary.\n//\n// The default is to do exec.LookPath on \"protoc\".\n// protocPath is expected to be unnormalized.\nfunc HandlerWithProtocPath(protocPath ...string) HandlerOption {\n\treturn func(handlerOptions *handlerOptions) {\n\t\thandlerOptions.protocPath = protocPath\n\t}\n}\n\n// HandlerWithPluginPath returns a new HandlerOption that sets the path to the plugin binary.\n//\n// The default is to do exec.LookPath on \"protoc-gen-\" + pluginName. pluginPath is expected\n// to be unnormalized. If the path has more than one element, the first is the plugin binary\n// and the others are optional additional arguments to pass to the binary\nfunc HandlerWithPluginPath(pluginPath ...string) HandlerOption {\n\treturn func(handlerOptions *handlerOptions) {\n\t\thandlerOptions.pluginPath = pluginPath\n\t}\n}\n\n// NewBinaryHandler returns a new Handler that invokes the specific plugin\n// specified by pluginPath.\nfunc NewBinaryHandler(logger *slog.Logger, pluginPath string, pluginArgs []string) (protoplugin.Handler, error) {\n\tpluginPath, err := unsafeLookPath(pluginPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newBinaryHandler(logger, pluginPath, pluginArgs), nil\n}\n\ntype handlerOptions struct {\n\tpluginPath []string\n\tprotocPath []string\n}\n\nfunc newHandlerOptions() *handlerOptions {\n\treturn &handlerOptions{}\n}\n\n// unsafeLookPath is a wrapper around exec.LookPath that restores the original\n// pre-Go 1.19 behavior of resolving queries that would use relative PATH\n// entries. We consider it acceptable for the use case of locating plugins.\n//\n// https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory\nfunc unsafeLookPath(file string) (string, error) {\n\tpath, err := exec.LookPath(file)\n\tif errors.Is(err, exec.ErrDot) {\n\t\terr = nil\n\t}\n\treturn path, err\n}\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/generator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotoplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\ntype generator struct {\n\tlogger            *slog.Logger\n\tstorageosProvider storageos.Provider\n}\n\nfunc newGenerator(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n) *generator {\n\treturn &generator{\n\t\tlogger:            logger,\n\t\tstorageosProvider: storageosProvider,\n\t}\n}\n\nfunc (g *generator) Generate(\n\tctx context.Context,\n\tcontainer app.EnvStderrContainer,\n\tpluginName string,\n\trequests []*pluginpb.CodeGeneratorRequest,\n\toptions ...GenerateOption,\n) (_ *pluginpb.CodeGeneratorResponse, retErr error) {\n\tgenerateOptions := newGenerateOptions()\n\tfor _, option := range options {\n\t\toption(generateOptions)\n\t}\n\thandlerOptions := []HandlerOption{\n\t\tHandlerWithPluginPath(generateOptions.pluginPath...),\n\t\tHandlerWithProtocPath(generateOptions.protocPath...),\n\t}\n\thandler, err := NewHandler(\n\t\tg.logger,\n\t\tg.storageosProvider,\n\t\tpluginName,\n\t\thandlerOptions...,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufprotoplugin.NewGenerator(\n\t\tg.logger,\n\t\thandler,\n\t).Generate(\n\t\tctx,\n\t\tcontainer,\n\t\trequests,\n\t)\n}\n\ntype generateOptions struct {\n\tpluginPath []string\n\tprotocPath []string\n}\n\nfunc newGenerateOptions() *generateOptions {\n\treturn &generateOptions{}\n}\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/protoc_gen_swift_stderr_write_closer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n)\n\ntype protocGenSwiftStderrWriteCloser struct {\n\tdelegate io.Writer\n\tbuffer   *bytes.Buffer\n}\n\nfunc newProtocGenSwiftStderrWriteCloser(delegate io.Writer) io.WriteCloser {\n\treturn &protocGenSwiftStderrWriteCloser{\n\t\tdelegate: delegate,\n\t\tbuffer:   bytes.NewBuffer(nil),\n\t}\n}\n\nfunc (p *protocGenSwiftStderrWriteCloser) Write(data []byte) (int, error) {\n\t// If protoc-gen-swift, we want to capture all the stderr so we can process it.\n\treturn p.buffer.Write(data)\n}\n\nfunc (p *protocGenSwiftStderrWriteCloser) Close() error {\n\tdata := p.buffer.Bytes()\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tnewData := bytes.ReplaceAll(\n\t\tdata,\n\t\t// If swift-protobuf changes their error message, this may not longer filter properly\n\t\t// but this is OK - this filtering should be treated as non-critical.\n\t\t// https://github.com/apple/swift-protobuf/blob/c3d060478fcf1f564be0a3876bde8c04247793ae/Sources/protoc-gen-swift/main.swift#L244\n\t\t//\n\t\t// Note that our heuristic as to whether this is protoc-gen-swift or not for isProtocGenSwift\n\t\t// is that the binary is named protoc-gen-swift, and protoc-gen-swift will print the binary name\n\t\t// before any message to stderr, so given our protoc-gen-swift heuristic, this is the\n\t\t// error message that will be printed.\n\t\t// https://github.com/apple/swift-protobuf/blob/c3d060478fcf1f564be0a3876bde8c04247793ae/Sources/protoc-gen-swift/FileIo.swift#L19\n\t\t//\n\t\t// Tested manually on Mac.\n\t\t// TODO: Test manually on Windows.\n\t\t[]byte(\"protoc-gen-swift: WARNING: unknown version of protoc, use 3.2.x or later to ensure JSON support is correct.\\n\"),\n\t\tnil,\n\t)\n\tif len(newData) == 0 {\n\t\treturn nil\n\t}\n\tn, err := p.delegate.Write(newData)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif n != len(newData) {\n\t\treturn errors.New(\"incomplete write\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/protoc_proxy_handler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xio\"\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/tmp\"\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\ntype protocProxyHandler struct {\n\tlogger            *slog.Logger\n\tstorageosProvider storageos.Provider\n\tprotocPath        string\n\tprotocExtraArgs   []string\n\tpluginName        string\n}\n\nfunc newProtocProxyHandler(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\tprotocPath string,\n\tprotocExtraArgs []string,\n\tpluginName string,\n) *protocProxyHandler {\n\treturn &protocProxyHandler{\n\t\tlogger:            logger,\n\t\tstorageosProvider: storageosProvider,\n\t\tprotocPath:        protocPath,\n\t\tprotocExtraArgs:   protocExtraArgs,\n\t\tpluginName:        pluginName,\n\t}\n}\n\nfunc (h *protocProxyHandler) Handle(\n\tctx context.Context,\n\tpluginEnv protoplugin.PluginEnv,\n\tresponseWriter protoplugin.ResponseWriter,\n\trequest protoplugin.Request,\n) (retErr error) {\n\tdefer xslog.DebugProfile(h.logger, slog.String(\"plugin\", filepath.Base(h.pluginName)))()\n\n\t// We should send the complete FileDescriptorSet with source-retention options to --descriptor_set_in.\n\t//\n\t// This is used via the FileDescriptorSet below.\n\trequest, err := request.WithSourceRetentionOptions()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tprotocVersion, err := h.getProtocVersion(ctx, pluginEnv)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif h.pluginName == \"kotlin\" && !getKotlinSupportedAsBuiltin(protocVersion) {\n\t\treturn fmt.Errorf(\"kotlin is not supported for protoc version %s\", versionString(protocVersion))\n\t}\n\tif h.pluginName == \"rust\" && !getRustSupportedAsBuiltin(protocVersion) {\n\t\treturn fmt.Errorf(\"rust is not supported for protoc version %s\", versionString(protocVersion))\n\t}\n\tif h.pluginName == \"rbs\" && !getRbsSupportedAsBuiltin(protocVersion) {\n\t\treturn fmt.Errorf(\"rbs is not supported for protoc version %s\", versionString(protocVersion))\n\t}\n\t// When we create protocProxyHandlers in NewHandler, we always prefer protoc-gen-.* plugins\n\t// over builtin plugins, so we only get here if we did not find protoc-gen-js, so this\n\t// is an error\n\tif h.pluginName == \"js\" && !getJSSupportedAsBuiltin(protocVersion) {\n\t\treturn errors.New(\"js moved to a separate plugin hosted at https://github.com/protocolbuffers/protobuf-javascript in v21, you must install this plugin\")\n\t}\n\tfileDescriptorSet := &descriptorpb.FileDescriptorSet{\n\t\tFile: request.AllFileDescriptorProtos(),\n\t}\n\tfileDescriptorSetData, err := protoencoding.NewWireMarshaler().Marshal(fileDescriptorSet)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptorFilePath := app.DevStdinFilePath\n\tvar tmpFile tmp.File\n\tif descriptorFilePath == \"\" {\n\t\t// since we have no stdin file (i.e. Windows), we're going to have to use a temporary file\n\t\ttmpFile, err = tmp.NewFile(ctx, bytes.NewReader(fileDescriptorSetData))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tretErr = errors.Join(retErr, tmpFile.Close())\n\t\t}()\n\t\tdescriptorFilePath = tmpFile.Path()\n\t}\n\ttmpDir, err := tmp.NewDir(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, tmpDir.Close())\n\t}()\n\targs := slices.Concat(h.protocExtraArgs, []string{\n\t\tfmt.Sprintf(\"--descriptor_set_in=%s\", descriptorFilePath),\n\t\tfmt.Sprintf(\"--%s_out=%s\", h.pluginName, tmpDir.Path()),\n\t})\n\tif getSetExperimentalAllowProto3OptionalFlag(protocVersion) {\n\t\targs = append(\n\t\t\targs,\n\t\t\t\"--experimental_allow_proto3_optional\",\n\t\t)\n\t}\n\tif parameter := request.Parameter(); parameter != \"\" {\n\t\targs = append(\n\t\t\targs,\n\t\t\tfmt.Sprintf(\"--%s_opt=%s\", h.pluginName, parameter),\n\t\t)\n\t}\n\targs = append(\n\t\targs,\n\t\trequest.CodeGeneratorRequest().GetFileToGenerate()...,\n\t)\n\tstdin := xio.DiscardReader\n\tif descriptorFilePath != \"\" && descriptorFilePath == app.DevStdinFilePath {\n\t\tstdin = bytes.NewReader(fileDescriptorSetData)\n\t}\n\tif err := xexec.Run(\n\t\tctx,\n\t\th.protocPath,\n\t\txexec.WithArgs(args...),\n\t\txexec.WithEnv(pluginEnv.Environ),\n\t\txexec.WithStdin(stdin),\n\t\txexec.WithStderr(pluginEnv.Stderr),\n\t); err != nil {\n\t\t// TODO: strip binary path as well?\n\t\t// We don't know if this is a system error or plugin error, so we assume system error\n\t\treturn handlePotentialTooManyFilesError(err)\n\t}\n\tif getFeatureProto3OptionalSupported(protocVersion) {\n\t\tresponseWriter.SetFeatureProto3Optional()\n\t}\n\t// We always claim support for all Editions in the response because the invocation to\n\t// \"protoc\" will fail if it can't handle the input editions. That way, we don't have to\n\t// track which protoc versions support which editions and synthesize this information.\n\t// And that also lets us support users passing \"--experimental_editions\" to protoc.\n\tresponseWriter.SetFeatureSupportsEditions(descriptorpb.Edition_EDITION_PROTO2, descriptorpb.Edition_EDITION_MAX)\n\n\t// no need for symlinks here, and don't want to support\n\treadWriteBucket, err := h.storageosProvider.NewReadWriteBucket(tmpDir.Path())\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn storage.WalkReadObjects(\n\t\tctx,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdata, err := io.ReadAll(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tresponseWriter.AddFile(readObject.Path(), string(data))\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\nfunc (h *protocProxyHandler) getProtocVersion(\n\tctx context.Context,\n\tpluginEnv protoplugin.PluginEnv,\n) (*pluginpb.Version, error) {\n\tstdoutBuffer := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\th.protocPath,\n\t\txexec.WithArgs(slices.Concat(h.protocExtraArgs, []string{\"--version\"})...),\n\t\txexec.WithEnv(pluginEnv.Environ),\n\t\txexec.WithStdout(stdoutBuffer),\n\t); err != nil {\n\t\t// TODO: strip binary path as well?\n\t\treturn nil, handlePotentialTooManyFilesError(err)\n\t}\n\treturn parseVersionForCLIVersion(strings.TrimSpace(stdoutBuffer.String()))\n}\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufprotopluginexec\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n)\n\n// handlePotentialTooManyFilesError checks if the error is a result of too many files\n// being open, and if so, modifies the output error with a help message.\n//\n// This could potentially go in osext, but we want to provide a specific help\n// message referencing StrategyAll, so it is simplest to just put this here for now.\nfunc handlePotentialTooManyFilesError(err error) error {\n\tif isTooManyFilesError(err) {\n\t\treturn fmt.Errorf(\"%w: %s\", err, tooManyFilesHelpMessage)\n\t}\n\treturn err\n}\n\nfunc isTooManyFilesError(err error) bool {\n\tvar syscallError *os.SyscallError\n\tif errors.As(err, &syscallError) {\n\t\t// This may not actually be correct on other platforms, however the worst case\n\t\t// is that we just don't provide the additional help message.\n\t\t//\n\t\t// Note that syscallError.Syscall has both equalled \"pipe\" and \"fork/exec\" in testing, but\n\t\t// we don't match on this as this could be particularly prone to being platform-specific.\n\t\treturn syscallError.Err != nil && syscallError.Err.Error() == \"too many open files\"\n\t}\n\treturn false\n}\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/util_darwin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 darwin\n\npackage bufprotopluginexec\n\nconst tooManyFilesHelpMessage = `This is commonly caused by the maximum file limit being too low. On Mac, the default is 256, which is very low. Run \"ulimit -n\" to check your file limit. If this happened on generation, setting \"strategy: all\" for each configured plugin in your buf.gen.yaml can mitigate the issue if you are unable to change your file limit.`\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/util_undarwin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 !darwin\n\npackage bufprotopluginexec\n\nconst tooManyFilesHelpMessage = `This is commonly caused by the maximum file limit being too low. Run \"ulimit -n\" to check your file limit. If this happened on generation, setting \"strategy: all\" for each configured plugin in your buf.gen.yaml can mitigate the issue if you are unable to change your file limit.`\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/version.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc newVersion(major int32, minor int32, patch int32, suffix string) *pluginpb.Version {\n\tversion := &pluginpb.Version{\n\t\tMajor: proto.Int32(major),\n\t\tMinor: proto.Int32(minor),\n\t\tPatch: proto.Int32(patch),\n\t}\n\tif suffix != \"\" {\n\t\tversion.Suffix = proto.String(suffix)\n\t}\n\treturn version\n}\n\nfunc parseVersionForCLIVersion(value string) (_ *pluginpb.Version, retErr error) {\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = fmt.Errorf(\"cannot parse protoc version %q: %w\", value, retErr)\n\t\t}\n\t}()\n\n\t// protoc always starts with \"libprotoc \"\n\tvalue = strings.TrimPrefix(value, \"libprotoc \")\n\tsplit := strings.Split(value, \".\")\n\tif n := len(split); n != 2 && n != 3 {\n\t\treturn nil, fmt.Errorf(\"%d components split by '.'\", n)\n\t}\n\tmajor, err := strconv.ParseInt(split[0], 10, 32)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar suffix string\n\trestSplit := strings.SplitN(split[len(split)-1], \"-\", 2)\n\tlastNumber, err := strconv.ParseInt(restSplit[0], 10, 32)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch len(restSplit) {\n\tcase 1:\n\tcase 2:\n\t\tsuffix = restSplit[1]\n\tdefault:\n\t\treturn nil, errors.New(\"more than two patch components split by '-'\")\n\t}\n\tvar minor int64\n\tvar patch int64\n\tswitch len(split) {\n\tcase 2:\n\t\tminor = lastNumber\n\tcase 3:\n\t\tminor, err = strconv.ParseInt(split[1], 10, 32)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpatch = lastNumber\n\t}\n\treturn newVersion(int32(major), int32(minor), int32(patch), suffix), nil\n}\n\nfunc versionString(version *pluginpb.Version) string {\n\tvar value string\n\tif version.GetMajor() <= 3 || version.GetPatch() != 0 {\n\t\tvalue = fmt.Sprintf(\"%d.%d.%d\", version.GetMajor(), version.GetMinor(), version.GetPatch())\n\t} else {\n\t\tvalue = fmt.Sprintf(\"%d.%d\", version.GetMajor(), version.GetMinor())\n\t}\n\tif version.Suffix != nil {\n\t\tvalue = value + \"-\" + version.GetSuffix()\n\t}\n\treturn value\n}\n\n// Should I set the --experimental_allow_proto3_optional flag?\nfunc getSetExperimentalAllowProto3OptionalFlag(version *pluginpb.Version) bool {\n\tif version.GetSuffix() == \"buf\" {\n\t\treturn false\n\t}\n\tif version.GetMajor() != 3 {\n\t\treturn false\n\t}\n\treturn version.GetMinor() > 11 && version.GetMinor() < 15\n}\n\n// Should I notify that I am OK with the proto3 optional feature?\nfunc getFeatureProto3OptionalSupported(version *pluginpb.Version) bool {\n\tif version.GetSuffix() == \"buf\" {\n\t\treturn true\n\t}\n\tif version.GetMajor() < 3 {\n\t\treturn false\n\t}\n\tif version.GetMajor() == 3 {\n\t\treturn version.GetMinor() > 11\n\t}\n\t// version.GetMajor() > 3\n\treturn true\n}\n\n// Is kotlin supported as a builtin plugin?\nfunc getKotlinSupportedAsBuiltin(version *pluginpb.Version) bool {\n\tif version.GetSuffix() == \"buf\" {\n\t\treturn true\n\t}\n\tif version.GetMajor() < 3 {\n\t\treturn false\n\t}\n\tif version.GetMajor() == 3 {\n\t\treturn version.GetMinor() > 16\n\t}\n\t// version.GetMajor() > 3\n\treturn true\n}\n\n// Is rust supported as a builtin plugin?\nfunc getRustSupportedAsBuiltin(version *pluginpb.Version) bool {\n\tif version.GetSuffix() == \"buf\" {\n\t\treturn true\n\t}\n\tif version.GetMajor() < 4 {\n\t\treturn false\n\t}\n\tif version.GetMajor() == 4 {\n\t\treturn version.GetMinor() > 22\n\t}\n\t// version.GetMajor() 4 5\n\treturn true\n}\n\n// Is rbs supported as a builtin plugin?\nfunc getRbsSupportedAsBuiltin(version *pluginpb.Version) bool {\n\tif version.GetSuffix() == \"buf\" {\n\t\treturn true\n\t}\n\t// rbs was added in protoc v34.0\n\treturn version.GetMajor() >= 34\n}\n\n// Is js supported as a builtin plugin?\nfunc getJSSupportedAsBuiltin(version *pluginpb.Version) bool {\n\tif version.GetSuffix() == \"buf\" {\n\t\treturn true\n\t}\n\tif version.GetMajor() < 3 {\n\t\treturn false\n\t}\n\tif version.GetMajor() == 3 {\n\t\t// v21 and above of protoc still returns \"3.MAJOR.Z\" for version\n\t\treturn version.GetMinor() < 21\n\t}\n\t// version.GetMajor() > 3\n\t// This will catch if they ever change protoc's returned version\n\t// to the proper major version\n\treturn false\n}\n"
  },
  {
    "path": "private/buf/bufprotopluginexec/version_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginexec\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc TestVersionString(t *testing.T) {\n\tt.Parallel()\n\tassert.Equal(t, \"3.11.1-buf\", versionString(newVersion(3, 11, 1, \"buf\")))\n\tassert.Equal(t, \"3.15.0\", versionString(newVersion(3, 15, 0, \"\")))\n\tassert.Equal(t, \"21.0\", versionString(newVersion(21, 0, 0, \"\")))\n\tassert.Equal(t, \"21.1\", versionString(newVersion(21, 1, 0, \"\")))\n\tassert.Equal(t, \"21.1-rc-1\", versionString(newVersion(21, 1, 0, \"rc-1\")))\n\tassert.Equal(t, \"21.1.1\", versionString(newVersion(21, 1, 1, \"\")))\n\tassert.Equal(t, \"21.1.1-rc-1\", versionString(newVersion(21, 1, 1, \"rc-1\")))\n}\n\nfunc TestGetSetExperimentalAllowProto3OptionalFlag(t *testing.T) {\n\tt.Parallel()\n\tassert.False(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(2, 12, 4, \"\")))\n\tassert.False(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(3, 11, 1, \"buf\")))\n\tassert.False(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(3, 11, 4, \"\")))\n\tassert.True(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(3, 12, 1, \"\")))\n\tassert.True(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(3, 14, 1, \"\")))\n\tassert.False(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(3, 14, 1, \"buf\")))\n\tassert.False(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(3, 15, 0, \"\")))\n\tassert.False(t, getSetExperimentalAllowProto3OptionalFlag(newVersion(21, 0, 0, \"\")))\n}\n\nfunc TestGetFeatureProto3OptionalSupported(t *testing.T) {\n\tt.Parallel()\n\tassert.False(t, getFeatureProto3OptionalSupported(newVersion(2, 12, 4, \"\")))\n\tassert.False(t, getFeatureProto3OptionalSupported(newVersion(3, 11, 4, \"\")))\n\tassert.True(t, getFeatureProto3OptionalSupported(newVersion(3, 11, 1, \"buf\")))\n\tassert.True(t, getFeatureProto3OptionalSupported(newVersion(3, 12, 1, \"\")))\n\tassert.True(t, getFeatureProto3OptionalSupported(newVersion(3, 14, 1, \"\")))\n\tassert.True(t, getFeatureProto3OptionalSupported(newVersion(3, 15, 0, \"\")))\n\tassert.True(t, getFeatureProto3OptionalSupported(newVersion(21, 0, 0, \"\")))\n}\n\nfunc TestGetKotlinSupportedAsBuiltin(t *testing.T) {\n\tt.Parallel()\n\tassert.True(t, getKotlinSupportedAsBuiltin(newVersion(3, 11, 1, \"buf\")))\n\tassert.True(t, getKotlinSupportedAsBuiltin(newVersion(3, 17, 4, \"\")))\n\tassert.True(t, getKotlinSupportedAsBuiltin(newVersion(21, 1, 0, \"\")))\n\tassert.True(t, getKotlinSupportedAsBuiltin(newVersion(21, 1, 0, \"buf\")))\n\tassert.False(t, getKotlinSupportedAsBuiltin(newVersion(3, 12, 1, \"\")))\n\tassert.False(t, getKotlinSupportedAsBuiltin(newVersion(3, 14, 1, \"\")))\n}\n\nfunc TestGetRustSupportedAsBuiltin(t *testing.T) {\n\tt.Parallel()\n\tassert.True(t, getRustSupportedAsBuiltin(newVersion(3, 11, 1, \"buf\")))\n\tassert.True(t, getRustSupportedAsBuiltin(newVersion(4, 23, 0, \"\")))\n\tassert.True(t, getRustSupportedAsBuiltin(newVersion(21, 1, 0, \"\")))\n\tassert.True(t, getRustSupportedAsBuiltin(newVersion(21, 1, 0, \"buf\")))\n\tassert.False(t, getRustSupportedAsBuiltin(newVersion(4, 22, 1, \"\")))\n\tassert.False(t, getRustSupportedAsBuiltin(newVersion(3, 14, 1, \"\")))\n}\n\nfunc TestGetRbsSupportedAsBuiltin(t *testing.T) {\n\tt.Parallel()\n\tassert.True(t, getRbsSupportedAsBuiltin(newVersion(3, 11, 1, \"buf\")))\n\tassert.True(t, getRbsSupportedAsBuiltin(newVersion(34, 0, 0, \"\")))\n\tassert.True(t, getRbsSupportedAsBuiltin(newVersion(35, 0, 0, \"\")))\n\tassert.False(t, getRbsSupportedAsBuiltin(newVersion(33, 5, 0, \"\")))\n\tassert.False(t, getRbsSupportedAsBuiltin(newVersion(21, 1, 0, \"\")))\n}\n\nfunc TestGetJSSupportedAsBuiltin(t *testing.T) {\n\tt.Parallel()\n\tassert.False(t, getJSSupportedAsBuiltin(newVersion(2, 11, 1, \"\")))\n\tassert.True(t, getJSSupportedAsBuiltin(newVersion(3, 11, 1, \"buf\")))\n\tassert.True(t, getJSSupportedAsBuiltin(newVersion(3, 17, 4, \"\")))\n\tassert.True(t, getJSSupportedAsBuiltin(newVersion(3, 20, 1, \"\")))\n\tassert.False(t, getJSSupportedAsBuiltin(newVersion(3, 21, 1, \"\")))\n\tassert.False(t, getJSSupportedAsBuiltin(newVersion(3, 22, 1, \"\")))\n\tassert.False(t, getJSSupportedAsBuiltin(newVersion(21, 1, 0, \"\")))\n\tassert.True(t, getJSSupportedAsBuiltin(newVersion(21, 1, 0, \"buf\")))\n}\n\nfunc TestParseVersionForCLIVersion(t *testing.T) {\n\tt.Parallel()\n\ttestParseVersionForCLIVersionSuccess(t, \"libprotoc 3.14.0\", newVersion(3, 14, 0, \"\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"libprotoc 3.14.0-rc1\", newVersion(3, 14, 0, \"rc1\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"libprotoc 3.14.0-rc-1\", newVersion(3, 14, 0, \"rc-1\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"3.14.0\", newVersion(3, 14, 0, \"\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"3.14.0-rc1\", newVersion(3, 14, 0, \"rc1\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"3.14.0-buf\", newVersion(3, 14, 0, \"buf\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"libprotoc 21.1\", newVersion(21, 1, 0, \"\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"libprotoc 21.1-rc1\", newVersion(21, 1, 0, \"rc1\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"libprotoc 21.1-rc-1\", newVersion(21, 1, 0, \"rc-1\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"21.1\", newVersion(21, 1, 0, \"\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"21.1-rc1\", newVersion(21, 1, 0, \"rc1\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"21.1-rc-1\", newVersion(21, 1, 0, \"rc-1\"))\n\ttestParseVersionForCLIVersionSuccess(t, \"21.1-buf\", newVersion(21, 1, 0, \"buf\"))\n\ttestParseVersionForCLIVersionError(t, \"libprotoc3.14.0\")\n\ttestParseVersionForCLIVersionError(t, \"libprotoc 3.14.0.1\")\n}\n\nfunc testParseVersionForCLIVersionSuccess(\n\tt *testing.T,\n\tvalue string,\n\texpectedVersion *pluginpb.Version,\n) {\n\tversion, err := parseVersionForCLIVersion(value)\n\tassert.NoError(t, err)\n\tif err == nil {\n\t\tassert.Equal(t, expectedVersion, version)\n\t}\n}\n\nfunc testParseVersionForCLIVersionError(\n\tt *testing.T,\n\tvalue string,\n) {\n\t_, err := parseVersionForCLIVersion(value)\n\tassert.Error(t, err)\n}\n"
  },
  {
    "path": "private/buf/bufstudioagent/buffer_codec.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufstudioagent\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\n\tconnect \"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// bufferCodec is a connect.Codec for use with clients of type\n// connect.Client[bytes.Buffer, bytes.Buffer] which does not attempt to parse\n// messages but instead allows the application layer to work on the buffers\n// directly. This is useful for creating proxies.\ntype bufferCodec struct {\n\tname string\n}\n\nvar _ connect.Codec = (*bufferCodec)(nil)\n\nfunc (b *bufferCodec) Name() string { return b.name }\n\nfunc (b *bufferCodec) Marshal(src any) ([]byte, error) {\n\tswitch typedSrc := src.(type) {\n\tcase *bytes.Buffer:\n\t\treturn typedSrc.Bytes(), nil\n\tcase proto.Message:\n\t\t// When the codec is named \"proto\", connect will assume that it\n\t\t// may also be used to unmarshal the errors in the\n\t\t// grpc-status-details-bin trailer. The type used is not\n\t\t// exported so we match against the general proto.Message.\n\t\treturn protoencoding.NewWireMarshaler().Marshal(typedSrc)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"marshal unexpected type %T\", src)\n\t}\n}\n\nfunc (b *bufferCodec) Unmarshal(src []byte, dst any) error {\n\tswitch destination := dst.(type) {\n\tcase *bytes.Buffer:\n\t\tdestination.Reset()\n\t\t_, err := io.Copy(destination, bytes.NewReader(src))\n\t\treturn err\n\tcase proto.Message:\n\t\t// When the codec is named \"proto\", connect will assume that it\n\t\t// may also be used to unmarshal the errors in the\n\t\t// grpc-status-details-bin trailer. The type used is not\n\t\t// exported so we match against the general proto.Message.\n\t\treturn protoencoding.NewWireUnmarshaler(nil).Unmarshal(src, destination)\n\tdefault:\n\t\treturn fmt.Errorf(\"unmarshal unexpected type %T\", dst)\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufstudioagent/bufstudioagent.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufstudioagent\n\nimport (\n\t\"crypto/tls\"\n\t\"log/slog\"\n\t\"net/http\"\n\n\t\"github.com/rs/cors\"\n)\n\n// NewHandler creates a new handler that serves the invoke endpoints for the\n// agent.\nfunc NewHandler(\n\tlogger *slog.Logger,\n\torigin string,\n\ttlsClientConfig *tls.Config,\n\tdisallowedHeaders map[string]struct{},\n\tforwardHeaders map[string]string,\n\tprivateNetwork bool,\n) http.Handler {\n\tcorsHandlerOptions := cors.Options{\n\t\tAllowedOrigins:   []string{origin},\n\t\tAllowedMethods:   []string{http.MethodPost, http.MethodOptions},\n\t\tAllowCredentials: true,\n\t}\n\tif privateNetwork {\n\t\tcorsHandlerOptions.AllowPrivateNetwork = true\n\t}\n\tcorsHandler := cors.New(corsHandlerOptions)\n\tplainHandler := corsHandler.Handler(newPlainPostHandler(logger, disallowedHeaders, forwardHeaders, tlsClientConfig))\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.Method {\n\t\tcase http.MethodGet:\n\t\t\t// In the future we could check for an upgrade header here.\n\t\t\t_, _ = w.Write([]byte(\"OK\"))\n\t\tcase http.MethodPost:\n\t\t\tplainHandler.ServeHTTP(w, r)\n\t\t\treturn\n\t\tcase http.MethodOptions:\n\t\t\tif privateNetwork {\n\t\t\t\tcorsHandler.HandlerFunc(w, r)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// If the private network flag is not used, fall through to the default\n\t\t\tfallthrough\n\t\tdefault:\n\t\t\thttp.Error(w, \"\", http.StatusMethodNotAllowed)\n\t\t\treturn\n\t\t}\n\t})\n\treturn mux\n}\n"
  },
  {
    "path": "private/buf/bufstudioagent/bufstudioagent_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufstudioagent\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"crypto/x509\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"io\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"strconv\"\n\t\"testing\"\n\t\"time\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"connectrpc.com/connect\"\n\tstudiov1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nconst (\n\techoPath  = \"/echo.Service/EchoEcho\"\n\terrorPath = \"/error.Service/Error\"\n)\n\nfunc TestPlainPostHandlerTLS(t *testing.T) {\n\tupstreamServerTLS := newTestConnectServer(t, true)\n\tdefer upstreamServerTLS.Close()\n\ttestPlainPostHandler(t, upstreamServerTLS)\n\ttestPlainPostHandlerErrors(t, upstreamServerTLS)\n}\n\nfunc TestPlainPostHandlerH2C(t *testing.T) {\n\tupstreamServerH2C := newTestConnectServer(t, false)\n\tdefer upstreamServerH2C.Close()\n\ttestPlainPostHandler(t, upstreamServerH2C)\n\ttestPlainPostHandlerErrors(t, upstreamServerH2C)\n}\n\nfunc testPlainPostHandler(t *testing.T, upstreamServer *httptest.Server) {\n\tagentServer := httptest.NewTLSServer(\n\t\tNewHandler(\n\t\t\tslogtestext.NewLogger(t),\n\t\t\t\"https://example.buf.build\",\n\t\t\tupstreamServer.TLS,\n\t\t\tnil,\n\t\t\tmap[string]string{\"foo\": \"bar\"},\n\t\t\tfalse,\n\t\t),\n\t)\n\tdefer agentServer.Close()\n\n\tt.Run(\"content_type_grpc_proto\", func(t *testing.T) {\n\t\trequestProto := studiov1alpha1.InvokeRequest_builder{\n\t\t\tTarget: upstreamServer.URL + echoPath,\n\t\t\tHeaders: goHeadersToProtoHeaders(http.Header{\n\t\t\t\t\"Content-Type\": []string{\"application/grpc+proto\"},\n\t\t\t}),\n\t\t\tBody: []byte(\"echothis\"),\n\t\t}.Build()\n\t\trequestBytes := protoMarshalBase64(t, requestProto)\n\t\trequest, err := http.NewRequest(http.MethodPost, agentServer.URL, bytes.NewReader(requestBytes))\n\t\trequire.NoError(t, err)\n\t\trequest.Header.Set(\"Content-Type\", \"text/plain\")\n\t\trequest.Header.Set(\"Origin\", \"https://example.buf.build\")\n\t\trequest.Header.Set(\"Foo\", \"foo-value\")\n\t\tresponse, err := agentServer.Client().Do(request)\n\t\trequire.NoError(t, err)\n\t\tdefer response.Body.Close()\n\n\t\tassert.Equal(t, http.StatusOK, response.StatusCode)\n\t\tassert.Equal(t, \"https://example.buf.build\", response.Header.Get(\"Access-Control-Allow-Origin\"))\n\t\tresponseBytes, err := io.ReadAll(response.Body)\n\t\tassert.NoError(t, err)\n\t\tinvokeResponse := &studiov1alpha1.InvokeResponse{}\n\t\tprotoUnmarshalBase64(t, responseBytes, invokeResponse)\n\t\tupstreamResponseHeaders := make(http.Header)\n\t\taddProtoHeadersToGoHeader(invokeResponse.GetHeaders(), upstreamResponseHeaders)\n\t\taddProtoHeadersToGoHeader(invokeResponse.GetTrailers(), upstreamResponseHeaders)\n\t\tassert.Equal(t, \"0\", upstreamResponseHeaders.Get(\"grpc-status\"))\n\t\tassert.Equal(t, []byte(\"echo: echothis\"), invokeResponse.GetBody())\n\t\tassert.Equal(t, \"foo-value\", upstreamResponseHeaders.Get(\"Echo-Bar\"))\n\t})\n\n\tt.Run(\"content_type_application_proto\", func(t *testing.T) {\n\t\trequestProto := studiov1alpha1.InvokeRequest_builder{\n\t\t\tTarget: upstreamServer.URL + echoPath,\n\t\t\tHeaders: goHeadersToProtoHeaders(http.Header{\n\t\t\t\t\"Content-Type\": []string{\"application/proto\"},\n\t\t\t}),\n\t\t\tBody: []byte(\"echothis\"),\n\t\t}.Build()\n\t\trequestBytes := protoMarshalBase64(t, requestProto)\n\t\trequest, err := http.NewRequest(http.MethodPost, agentServer.URL, bytes.NewReader(requestBytes))\n\t\trequire.NoError(t, err)\n\t\trequest.Header.Set(\"Content-Type\", \"text/plain\")\n\t\trequest.Header.Set(\"Origin\", \"https://example.buf.build\")\n\t\trequest.Header.Set(\"Foo\", \"foo-value\")\n\t\tresponse, err := agentServer.Client().Do(request)\n\t\trequire.NoError(t, err)\n\t\tdefer response.Body.Close()\n\n\t\tassert.Equal(t, http.StatusOK, response.StatusCode)\n\t\tassert.Equal(t, \"https://example.buf.build\", response.Header.Get(\"Access-Control-Allow-Origin\"))\n\t\tresponseBytes, err := io.ReadAll(response.Body)\n\t\tassert.NoError(t, err)\n\t\tinvokeResponse := &studiov1alpha1.InvokeResponse{}\n\t\tprotoUnmarshalBase64(t, responseBytes, invokeResponse)\n\t\tupstreamResponseHeaders := make(http.Header)\n\t\taddProtoHeadersToGoHeader(invokeResponse.GetHeaders(), upstreamResponseHeaders)\n\t\taddProtoHeadersToGoHeader(invokeResponse.GetTrailers(), upstreamResponseHeaders)\n\t\tassert.Equal(t, \"\", upstreamResponseHeaders.Get(\"grpc-status\"))\n\t\tassert.Equal(t, []byte(\"echo: echothis\"), invokeResponse.GetBody())\n\t\tassert.Equal(t, \"foo-value\", upstreamResponseHeaders.Get(\"Echo-Bar\"))\n\t})\n}\n\nfunc testPlainPostHandlerErrors(t *testing.T, upstreamServer *httptest.Server) {\n\tagentServer := httptest.NewTLSServer(\n\t\tNewHandler(\n\t\t\txslog.NopLogger,\n\t\t\t\"https://example.buf.build\",\n\t\t\tupstreamServer.TLS,\n\t\t\tmap[string]struct{}{\"forbidden-header\": {}},\n\t\t\tnil,\n\t\t\tfalse,\n\t\t),\n\t)\n\tdefer agentServer.Close()\n\n\tt.Run(\"forbidden_header\", func(t *testing.T) {\n\t\trequestProto := studiov1alpha1.InvokeRequest_builder{\n\t\t\tTarget: upstreamServer.URL + echoPath,\n\t\t\tHeaders: goHeadersToProtoHeaders(http.Header{\n\t\t\t\t\"forbidden-header\": []string{\"<tokens>\"},\n\t\t\t}),\n\t\t}.Build()\n\t\trequestBytes := protoMarshalBase64(t, requestProto)\n\t\trequest, err := http.NewRequest(http.MethodPost, agentServer.URL, bytes.NewReader(requestBytes))\n\t\trequire.NoError(t, err)\n\t\trequest.Header.Set(\"Content-Type\", \"text/plain\")\n\t\tresponse, err := agentServer.Client().Do(request)\n\t\trequire.NoError(t, err)\n\t\tdefer response.Body.Close()\n\t\tassert.Equal(t, http.StatusBadRequest, response.StatusCode)\n\t})\n\n\tt.Run(\"error_response\", func(t *testing.T) {\n\t\trequestProto := studiov1alpha1.InvokeRequest_builder{\n\t\t\tTarget: upstreamServer.URL + errorPath,\n\t\t\tHeaders: goHeadersToProtoHeaders(http.Header{\n\t\t\t\t\"Content-Type\": []string{\"application/grpc\"},\n\t\t\t}),\n\t\t\tBody: []byte(\"something\"),\n\t\t}.Build()\n\t\trequestBytes := protoMarshalBase64(t, requestProto)\n\t\trequest, err := http.NewRequest(http.MethodPost, agentServer.URL, bytes.NewReader(requestBytes))\n\t\trequire.NoError(t, err)\n\t\trequest.Header.Set(\"Content-Type\", \"text/plain\")\n\t\tresponse, err := agentServer.Client().Do(request)\n\t\trequire.NoError(t, err)\n\t\tdefer response.Body.Close()\n\t\tassert.Equal(t, http.StatusOK, response.StatusCode)\n\t\tresponseBytes, err := io.ReadAll(response.Body)\n\t\tassert.NoError(t, err)\n\t\tinvokeResponse := &studiov1alpha1.InvokeResponse{}\n\t\tprotoUnmarshalBase64(t, responseBytes, invokeResponse)\n\t\tupstreamResponseHeaders := make(http.Header)\n\t\taddProtoHeadersToGoHeader(invokeResponse.GetHeaders(), upstreamResponseHeaders)\n\t\taddProtoHeadersToGoHeader(invokeResponse.GetTrailers(), upstreamResponseHeaders)\n\t\tassert.Equal(t, strconv.Itoa(int(connect.CodeFailedPrecondition)), upstreamResponseHeaders.Get(\"grpc-status\"))\n\t\tassert.Equal(t, \"something\", upstreamResponseHeaders.Get(\"grpc-message\"))\n\t})\n\n\tt.Run(\"invalid_upstream\", func(t *testing.T) {\n\t\ttcpAddr, err := net.ResolveTCPAddr(\"tcp\", \"127.0.0.1:\")\n\t\trequire.NoError(t, err)\n\t\tlistener, err := net.ListenTCP(\"tcp\", tcpAddr)\n\t\trequire.NoError(t, err)\n\t\tdone := make(chan struct{})\n\t\tt.Cleanup(func() {\n\t\t\tdone <- struct{}{}\n\t\t})\n\t\tgo func() {\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-done:\n\t\t\t\t\tlistener.Close()\n\t\t\t\t\treturn\n\t\t\t\tdefault:\n\t\t\t\t\t// Do not call require.NoError to handle errors because it calls t.FailNow,\n\t\t\t\t\t// which is not safe from a goroutine, see https://pkg.go.dev/testing#T.FailNow\n\t\t\t\t\tif err := listener.SetDeadline(time.Now().Add(time.Millisecond * 10)); err != nil {\n\t\t\t\t\t\tt.Error(err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconn, err := listener.Accept()\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\tif err, ok := err.(net.Error); !ok || !err.Timeout() {\n\t\t\t\t\t\t\tt.Error(err)\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\tif err := conn.Close(); err != nil {\n\t\t\t\t\t\tt.Error(err)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\n\t\trequestProto := studiov1alpha1.InvokeRequest_builder{\n\t\t\tTarget: \"http://\" + listener.Addr().String(),\n\t\t\tHeaders: goHeadersToProtoHeaders(http.Header{\n\t\t\t\t\"Content-Type\": []string{\"application/grpc\"},\n\t\t\t}),\n\t\t}.Build()\n\t\trequestBytes := protoMarshalBase64(t, requestProto)\n\t\trequest, err := http.NewRequest(http.MethodPost, agentServer.URL, bytes.NewReader(requestBytes))\n\t\trequire.NoError(t, err)\n\t\trequest.Header.Set(\"Content-Type\", \"text/plain\")\n\t\tresponse, err := agentServer.Client().Do(request)\n\t\trequire.NoError(t, err)\n\t\tt.Cleanup(func() {\n\t\t\tresponse.Body.Close()\n\t\t})\n\t\tassert.Equal(t, http.StatusBadGateway, response.StatusCode)\n\t})\n}\n\nfunc newTestConnectServer(t *testing.T, tls bool) *httptest.Server {\n\tmux := http.NewServeMux()\n\t// echoPath echoes all incoming headers (prefixed with \"Echo-\") and the\n\t// body bytes prefixed with \"echo: \"\n\tmux.Handle(echoPath, connect.NewUnaryHandler(\n\t\techoPath,\n\t\tfunc(ctx context.Context, r *connect.Request[bytes.Buffer]) (*connect.Response[bytes.Buffer], error) {\n\t\t\tresponse := connect.NewResponse(bytes.NewBuffer(append([]byte(\"echo: \"), r.Msg.Bytes()...)))\n\t\t\tfor header, values := range r.Header() {\n\t\t\t\tfor _, value := range values {\n\t\t\t\t\tresponse.Header().Add(\"Echo-\"+header, value)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn response, nil\n\t\t},\n\t\tconnect.WithCodec(&bufferCodec{name: \"proto\"}),\n\t))\n\t// errorPath returns the body as error message with code failed precondition\n\tmux.Handle(errorPath, connect.NewUnaryHandler(\n\t\terrorPath,\n\t\tfunc(ctx context.Context, r *connect.Request[bytes.Buffer]) (*connect.Response[bytes.Buffer], error) {\n\t\t\treturn nil, connect.NewError(connect.CodeFailedPrecondition, errors.New(r.Msg.String()))\n\t\t},\n\t\tconnect.WithCodec(&bufferCodec{name: \"proto\"}),\n\t))\n\tprotocols := new(http.Protocols)\n\tprotocols.SetHTTP1(true)\n\tserver := httptest.NewUnstartedServer(mux)\n\tserver.Config.Protocols = protocols\n\tif tls {\n\t\tprotocols.SetHTTP2(true)\n\t\t// Enable HTTP/2 for TLS configuration.\n\t\tserver.EnableHTTP2 = true\n\t\tserver.StartTLS()\n\t\t// Add the server's certificate to its own trusted CA pool.\n\t\t// This is needed because the server TSL config is used to configure clients.\n\t\tcertpool := x509.NewCertPool()\n\t\tcertpool.AddCert(server.Certificate())\n\t\tserver.TLS.RootCAs = certpool\n\t} else {\n\t\tprotocols.SetUnencryptedHTTP2(true)\n\t\tserver.Start()\n\t}\n\treturn server\n}\n\nfunc protoMarshalBase64(t *testing.T, message proto.Message) []byte {\n\tprotoBytes, err := protoencoding.NewWireMarshaler().Marshal(message)\n\trequire.NoError(t, err)\n\tbase64Bytes := make([]byte, base64.StdEncoding.EncodedLen(len(protoBytes)))\n\tbase64.StdEncoding.Encode(base64Bytes, protoBytes)\n\treturn base64Bytes\n}\n\nfunc protoUnmarshalBase64(t *testing.T, base64Bytes []byte, message proto.Message) {\n\tprotoBytes := make([]byte, base64.StdEncoding.DecodedLen(len(base64Bytes)))\n\tactualLen, err := base64.StdEncoding.Decode(protoBytes, base64Bytes)\n\trequire.NoError(t, err)\n\tprotoBytes = protoBytes[:actualLen]\n\trequire.NoError(t, protoencoding.NewWireUnmarshaler(nil).Unmarshal(protoBytes, message))\n}\n\nfunc addProtoHeadersToGoHeader(fromHeaders []*studiov1alpha1.Headers, toHeaders http.Header) {\n\tfor _, meta := range fromHeaders {\n\t\tfor _, value := range meta.GetValue() {\n\t\t\ttoHeaders.Add(meta.GetKey(), value)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufstudioagent/plain_post_handler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufstudioagent\n\nimport (\n\t\"bytes\"\n\t\"crypto/tls\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"net/textproto\"\n\t\"net/url\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"connectrpc.com/connect\"\n\tstudiov1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// MaxMessageSizeBytesDefault determines the maximum number of bytes to read\n// from the request body.\nconst MaxMessageSizeBytesDefault = 1024 * 1024 * 5\n\n// plainPostHandler implements a POST handler for forwarding requests that can\n// be called with simple CORS requests.\n//\n// Simple CORS requests are limited [1] to certain headers and content types, so\n// this handler expects base64 encoded protobuf messages in the body and writes\n// out base64 encoded protobuf messages to be able to use Content-Type: text/plain.\n//\n// Because of the content-type restriction we do not define a protobuf service\n// that gets served by connect but instead use a plain post handler.\n//\n// [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests).\ntype plainPostHandler struct {\n\tLogger              *slog.Logger\n\tMaxMessageSizeBytes int64\n\tB64Encoding         *base64.Encoding\n\tClient              *http.Client\n\tDisallowedHeaders   map[string]struct{}\n\tForwardHeaders      map[string]string\n}\n\nfunc newPlainPostHandler(\n\tlogger *slog.Logger,\n\tdisallowedHeaders map[string]struct{},\n\tforwardHeaders map[string]string,\n\ttlsClientConfig *tls.Config,\n) *plainPostHandler {\n\tcanonicalDisallowedHeaders := make(map[string]struct{}, len(disallowedHeaders))\n\tfor k := range disallowedHeaders {\n\t\tcanonicalDisallowedHeaders[textproto.CanonicalMIMEHeaderKey(k)] = struct{}{}\n\t}\n\tcanonicalForwardHeaders := make(map[string]string, len(forwardHeaders))\n\tfor k, v := range forwardHeaders {\n\t\tcanonicalForwardHeaders[textproto.CanonicalMIMEHeaderKey(k)] = v\n\t}\n\tprotocols := new(http.Protocols)\n\tprotocols.SetHTTP1(true)\n\tprotocols.SetHTTP2(true)\n\tprotocols.SetUnencryptedHTTP2(true)\n\ttransport := &http.Transport{\n\t\tTLSClientConfig: tlsClientConfig,\n\t\tProtocols:       protocols,\n\t}\n\treturn &plainPostHandler{\n\t\tB64Encoding:       base64.StdEncoding,\n\t\tDisallowedHeaders: canonicalDisallowedHeaders,\n\t\tForwardHeaders:    canonicalForwardHeaders,\n\t\tClient: &http.Client{\n\t\t\tTransport: transport,\n\t\t},\n\t\tLogger:              logger,\n\t\tMaxMessageSizeBytes: MaxMessageSizeBytesDefault,\n\t}\n}\n\nfunc (i *plainPostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tif r.Method != http.MethodPost {\n\t\thttp.Error(w, \"\", http.StatusMethodNotAllowed)\n\t\treturn\n\t}\n\tif r.Header.Get(\"content-type\") != \"text/plain\" {\n\t\thttp.Error(w, \"\", http.StatusUnsupportedMediaType)\n\t\treturn\n\t}\n\tbodyBytes, err := io.ReadAll(\n\t\tbase64.NewDecoder(\n\t\t\ti.B64Encoding,\n\t\t\thttp.MaxBytesReader(w, r.Body, i.MaxMessageSizeBytes),\n\t\t),\n\t)\n\tif err != nil {\n\t\tif b64Err := new(base64.CorruptInputError); errors.As(err, &b64Err) {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\thttp.Error(w, err.Error(), http.StatusRequestEntityTooLarge)\n\t\treturn\n\t}\n\tenvelopeRequest := &studiov1alpha1.InvokeRequest{}\n\tif err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(bodyBytes, envelopeRequest); err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\trequest := connect.NewRequest(bytes.NewBuffer(envelopeRequest.GetBody()))\n\tfor _, header := range envelopeRequest.GetHeaders() {\n\t\tif _, ok := i.DisallowedHeaders[textproto.CanonicalMIMEHeaderKey(header.GetKey())]; ok {\n\t\t\thttp.Error(w, fmt.Sprintf(\"header %q disallowed by agent\", header.GetKey()), http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tfor _, value := range header.GetValue() {\n\t\t\trequest.Header().Add(header.GetKey(), value)\n\t\t}\n\t}\n\tfor fromHeader, toHeader := range i.ForwardHeaders {\n\t\theaderValues := r.Header.Values(fromHeader)\n\t\tif len(headerValues) > 0 {\n\t\t\trequest.Header().Del(toHeader)\n\t\t\tfor _, headerValue := range headerValues {\n\t\t\t\trequest.Header().Add(toHeader, headerValue)\n\t\t\t}\n\t\t}\n\t}\n\ttargetURL, err := url.Parse(envelopeRequest.GetTarget())\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tvar httpClient *http.Client\n\tswitch targetURL.Scheme {\n\tcase \"http\", \"https\":\n\t\thttpClient = i.Client\n\tdefault:\n\t\thttp.Error(w, fmt.Sprintf(\"must specify http or https url scheme, got %q\", targetURL.Scheme), http.StatusBadRequest)\n\t\treturn\n\t}\n\tclientOptions, err := connectClientOptionsFromContentType(request.Header().Get(\"Content-Type\"))\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tclient := connect.NewClient[bytes.Buffer, bytes.Buffer](\n\t\thttpClient,\n\t\ttargetURL.String(),\n\t\tclientOptions...,\n\t)\n\t// TODO(rvanginkel) should this context be cloned to remove attached values (but keep timeout)?\n\tresponse, err := client.CallUnary(r.Context(), request)\n\tif err != nil {\n\t\t// We need to differentiate client errors from server errors. In the former,\n\t\t// trigger a `StatusBadGateway` result, and in the latter surface whatever\n\t\t// error information came back from the server.\n\t\t//\n\t\t// Any error here is expected to be wrapped in a `connect.Error` struct. We\n\t\t// need to check *first* if it's not a wire error, so we can assume the\n\t\t// request never left the client, or a response never arrived from the\n\t\t// server. In those scenarios we trigger a `StatusBadGateway` to signal\n\t\t// that the upstream server is unreachable or in a bad status...\n\t\tif !connect.IsWireError(err) {\n\t\t\thttp.Error(w, err.Error(), http.StatusBadGateway)\n\t\t\treturn\n\t\t}\n\t\t// ... but if a response was received from the server, we assume there's\n\t\t// error information from the server we can surface to the user by including\n\t\t// it in the headers response, unless it is a `CodeUnknown` error. Connect\n\t\t// marks any issues connecting with the `CodeUnknown` error.\n\t\tif connectErr := new(connect.Error); errors.As(err, &connectErr) {\n\t\t\tif connectErr.Code() == connect.CodeUnknown {\n\t\t\t\thttp.Error(w, err.Error(), http.StatusBadGateway)\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti.writeProtoMessage(w, studiov1alpha1.InvokeResponse_builder{\n\t\t\t\t// connectErr.Meta contains the trailers for the\n\t\t\t\t// caller to find out the error details.\n\t\t\t\tHeaders: goHeadersToProtoHeaders(connectErr.Meta()),\n\t\t\t}.Build())\n\t\t\treturn\n\t\t}\n\t\ti.Logger.Warn(\n\t\t\t\"non_connect_unary_error\",\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t\thttp.Error(w, err.Error(), http.StatusBadGateway)\n\t\treturn\n\t}\n\ti.writeProtoMessage(w, studiov1alpha1.InvokeResponse_builder{\n\t\tHeaders:  goHeadersToProtoHeaders(response.Header()),\n\t\tBody:     response.Msg.Bytes(),\n\t\tTrailers: goHeadersToProtoHeaders(response.Trailer()),\n\t}.Build())\n}\n\nfunc connectClientOptionsFromContentType(contentType string) ([]connect.ClientOption, error) {\n\tswitch contentType {\n\tcase \"application/grpc\", \"application/grpc+proto\":\n\t\treturn []connect.ClientOption{\n\t\t\tconnect.WithGRPC(),\n\t\t\tconnect.WithCodec(&bufferCodec{name: \"proto\"}),\n\t\t}, nil\n\tcase \"application/grpc+json\":\n\t\treturn []connect.ClientOption{\n\t\t\tconnect.WithGRPC(),\n\t\t\tconnect.WithCodec(&bufferCodec{name: \"json\"}),\n\t\t}, nil\n\tcase \"application/json\":\n\t\treturn []connect.ClientOption{\n\t\t\tconnect.WithCodec(&bufferCodec{name: \"json\"}),\n\t\t}, nil\n\tcase \"application/proto\":\n\t\treturn []connect.ClientOption{\n\t\t\tconnect.WithCodec(&bufferCodec{name: \"proto\"}),\n\t\t}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown Content-Type: %q\", contentType)\n\t}\n}\n\nfunc (i *plainPostHandler) writeProtoMessage(w http.ResponseWriter, message proto.Message) {\n\tresponseProtoBytes, err := protoencoding.NewWireMarshaler().Marshal(message)\n\tif err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\tresponseB64Bytes := make([]byte, i.B64Encoding.EncodedLen(len(responseProtoBytes)))\n\ti.B64Encoding.Encode(responseB64Bytes, responseProtoBytes)\n\tw.Header().Set(\"Content-Type\", \"text/plain\")\n\tif n, err := w.Write(responseB64Bytes); n != len(responseB64Bytes) && err != nil {\n\t\ti.Logger.Error(\n\t\t\t\"write_error\",\n\t\t\tslog.Int(\"expected_bytes\", len(responseB64Bytes)),\n\t\t\tslog.Int(\"actual_bytes\", n),\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t}\n}\n\nfunc goHeadersToProtoHeaders(in http.Header) []*studiov1alpha1.Headers {\n\tvar out []*studiov1alpha1.Headers\n\tfor k, v := range in {\n\t\tout = append(out, studiov1alpha1.Headers_builder{\n\t\t\tKey:   k,\n\t\t\tValue: v,\n\t\t}.Build())\n\t}\n\treturn out\n}\n"
  },
  {
    "path": "private/buf/bufstudioagent/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufstudioagent\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/buftarget/bucket_targeting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buftarget\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// BucketTargeting provides targeting information for the bucket based on any controlling\n// workspaces that have been found.\ntype BucketTargeting interface {\n\t// ControllingWorkspace returns the information for the controlling workspace, if one was\n\t// found. If not found, then this will be nil.\n\tControllingWorkspace() ControllingWorkspace\n\t// SubDirPath returns the input directory relative to the controlling workspace, if one\n\t// was found, otherwise it is relative to the root of the bucket\n\tSubDirPath() string\n\t// TargetPaths returns the target paths relative to the controlling workspace, if one was\n\t// found, otherwise it is relative to the root of the bucket.\n\tTargetPaths() []string\n\t// TargetExcludePaths returns the target exclude paths relative to the controlling\n\t// workspace, if one is found, otherwise it is relative to the root of the bucket.\n\tTargetExcludePaths() []string\n\n\tisBucketTargeting()\n}\n\n// NewBucketTargeting returns new targeting information for the given bucket, input dir,\n// target paths, and target exclude paths.\n//\n// The subDirPath, targetPaths, and targetExcludePaths are expected to be relative to the\n// root of the bucket.\n//\n// If a controlling workspace is found, the input dir, target paths, and target exclude\n// paths are mapped as relative paths to the controlling workspace path.\n// Otherwise, the input dir, target paths, and target exclude paths are returned as-is.\nfunc NewBucketTargeting(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tbucket storage.ReadBucket,\n\tsubDirPath string,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tterminateFunc TerminateFunc,\n) (BucketTargeting, error) {\n\treturn newBucketTargeting(\n\t\tctx,\n\t\tlogger,\n\t\tbucket,\n\t\tsubDirPath,\n\t\ttargetPaths,\n\t\ttargetExcludePaths,\n\t\tterminateFunc,\n\t)\n}\n\n// *** PRIVATE ***\n\nvar _ BucketTargeting = &bucketTargeting{}\n\ntype bucketTargeting struct {\n\tcontrollingWorkspace ControllingWorkspace\n\tsubDirPath           string\n\ttargetPaths          []string\n\ttargetExcludePaths   []string\n}\n\nfunc newBucketTargeting(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tbucket storage.ReadBucket,\n\tsubDirPath string,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tterminateFunc TerminateFunc,\n) (*bucketTargeting, error) {\n\t// First we map the controlling workspace for the subDirpath.\n\tcontrollingWorkspace, mappedInputDir, err := mapControllingWorkspaceAndPath(\n\t\tctx,\n\t\tlogger,\n\t\tbucket,\n\t\tsubDirPath,\n\t\tterminateFunc,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// If no controlling workspace was found, we map the target paths and target exclude\n\t// paths to the input dir.\n\tmappedTargetPaths := targetPaths\n\tmappedTargetExcludePaths := targetExcludePaths\n\tif controllingWorkspace != nil && controllingWorkspace.Path() != \".\" {\n\t\t// If a controlling workspace was found, we map the paths to the controlling workspace\n\t\t// because we'll be working with a workspace bucket.\n\t\tfor i, targetPath := range targetPaths {\n\t\t\tmappedTargetPath, err := normalpath.Rel(controllingWorkspace.Path(), targetPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmappedTargetPath, err = normalpath.NormalizeAndValidate(mappedTargetPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmappedTargetPaths[i] = mappedTargetPath\n\t\t}\n\t\tfor i, targetExcludePath := range targetExcludePaths {\n\t\t\tmappedTargetExcludePath, err := normalpath.Rel(controllingWorkspace.Path(), targetExcludePath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmappedTargetExcludePath, err = normalpath.NormalizeAndValidate(mappedTargetExcludePath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmappedTargetExcludePaths[i] = mappedTargetExcludePath\n\t\t}\n\t}\n\treturn &bucketTargeting{\n\t\tcontrollingWorkspace: controllingWorkspace,\n\t\tsubDirPath:           mappedInputDir,\n\t\ttargetPaths:          mappedTargetPaths,\n\t\ttargetExcludePaths:   mappedTargetExcludePaths,\n\t}, nil\n}\n\nfunc (b *bucketTargeting) ControllingWorkspace() ControllingWorkspace {\n\treturn b.controllingWorkspace\n}\n\nfunc (b *bucketTargeting) SubDirPath() string {\n\treturn b.subDirPath\n}\n\nfunc (b *bucketTargeting) TargetPaths() []string {\n\treturn b.targetPaths\n}\n\nfunc (b *bucketTargeting) TargetExcludePaths() []string {\n\treturn b.targetExcludePaths\n}\n\nfunc (*bucketTargeting) isBucketTargeting() {}\n\n// mapControllingWorkspaceAndPath takes a bucket, path, and terminate func and returns the\n// controlling workspace and mapped path.\nfunc mapControllingWorkspaceAndPath(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tbucket storage.ReadBucket,\n\tpath string,\n\tterminateFunc TerminateFunc,\n) (ControllingWorkspace, string, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\t// If no terminateFunc is passed, we can simply assume that we are mapping the bucket at\n\t// the path.\n\tif terminateFunc == nil {\n\t\treturn nil, path, nil\n\t}\n\t// We can't do this in a traditional loop like this:\n\t//\n\t// for curDirPath := path; curDirPath != \".\"; curDirPath = normalpath.Dir(curDirPath) {\n\t//\n\t// If we do that, then we don't run terminateFunc for \".\", which we want to so that we get\n\t// the correct value for the terminate bool.\n\t//\n\t// Instead, we effectively do a do-while loop.\n\tcurDirPath := path\n\tfor {\n\t\tcontrollingWorkspace, err := terminateFunc(ctx, bucket, curDirPath, path)\n\t\tif err != nil {\n\t\t\treturn nil, \"\", err\n\t\t}\n\t\tif controllingWorkspace != nil {\n\t\t\tlogger.DebugContext(\n\t\t\t\tctx,\n\t\t\t\t\"buffetch termination found\",\n\t\t\t\tslog.String(\"curDirPath\", curDirPath),\n\t\t\t\tslog.String(\"path\", path),\n\t\t\t)\n\t\t\tsubDirPath, err := normalpath.Rel(curDirPath, path)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, \"\", err\n\t\t\t}\n\t\t\treturn controllingWorkspace, subDirPath, nil\n\t\t}\n\t\tif curDirPath == \".\" {\n\t\t\tbreak\n\t\t}\n\t\tcurDirPath = normalpath.Dir(curDirPath)\n\t}\n\tlogger.DebugContext(\n\t\tctx,\n\t\t\"buffetch no termination found\",\n\t\tslog.String(\"path\", path),\n\t)\n\t// No controlling workspace is found, we simply return the input dir\n\treturn nil, path, nil\n}\n"
  },
  {
    "path": "private/buf/buftarget/buftarget.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buftarget\n"
  },
  {
    "path": "private/buf/buftarget/controlling_workspace.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buftarget\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n)\n\n// ControllingWorkspace is the information for the ControllingWorkspace.\ntype ControllingWorkspace interface {\n\t// Path of the controlling workspace. This is a normalized path, relative to the root of\n\t// the bucket the controlling workspace was found in. Semantically, this is where the v1\n\t// buf.work.yaml or v2 buf.yaml workspace configuration is located.\n\tPath() string\n\t// Returns a buf.work.yaml file that was found for the controlling workspace.\n\t// This is empty if we are returning a buf.yaml.\n\tBufWorkYAMLFile() bufconfig.BufWorkYAMLFile\n\t// Returns a buf.yaml that was found for the controlling workspace.\n\t// This is empty if we are returning a buf.work.yaml.\n\tBufYAMLFile() bufconfig.BufYAMLFile\n\n\tisControllingWorkspace()\n}\n\n// NewControllingWorkspace takes a path where the controlling workspace configuration is\n// located and a workspace configuration file for the controlling workspace.\nfunc NewControllingWorkspace(\n\tpath string,\n\tbufWorkYAMLFile bufconfig.BufWorkYAMLFile,\n\tbufYAMLFile bufconfig.BufYAMLFile,\n) ControllingWorkspace {\n\treturn newControllingWorkspace(path, bufWorkYAMLFile, bufYAMLFile)\n}\n\n// *** PRIVATE ***\n\nvar _ ControllingWorkspace = &controllingWorkspace{}\n\ntype controllingWorkspace struct {\n\tpath            string\n\tbufWorkYAMLFile bufconfig.BufWorkYAMLFile\n\tbufYAMLFile     bufconfig.BufYAMLFile\n}\n\nfunc newControllingWorkspace(\n\tpath string,\n\tbufWorkYAMLFile bufconfig.BufWorkYAMLFile,\n\tbufYAMLFile bufconfig.BufYAMLFile,\n) ControllingWorkspace {\n\treturn &controllingWorkspace{\n\t\tpath:            path,\n\t\tbufWorkYAMLFile: bufWorkYAMLFile,\n\t\tbufYAMLFile:     bufYAMLFile,\n\t}\n}\n\nfunc (c *controllingWorkspace) Path() string {\n\treturn c.path\n}\n\nfunc (c *controllingWorkspace) BufWorkYAMLFile() bufconfig.BufWorkYAMLFile {\n\treturn c.bufWorkYAMLFile\n}\n\nfunc (c *controllingWorkspace) BufYAMLFile() bufconfig.BufYAMLFile {\n\treturn c.bufYAMLFile\n}\n\nfunc (c *controllingWorkspace) isControllingWorkspace() {}\n"
  },
  {
    "path": "private/buf/buftarget/terminate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buftarget\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// TerminateFunc is a termination function.\ntype TerminateFunc func(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\toriginalInputPath string,\n) (ControllingWorkspace, error)\n\n// TerminateAtControllingWorkspace implements a TerminateFunc and returns the workspace controlling\n// the input, if one is found at the given prefix.\nfunc TerminateAtControllingWorkspace(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\toriginalInputPath string,\n) (ControllingWorkspace, error) {\n\treturn terminateAtControllingWorkspace(ctx, bucket, prefix, originalInputPath)\n}\n\n// TerminateAtV1Module is a special terminate func that returns a controlling workspace with\n// a v1 module configuration if found at the given prefix.\nfunc TerminateAtV1Module(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\toriginalInputPath string,\n) (ControllingWorkspace, error) {\n\treturn terminateAtV1Module(ctx, bucket, prefix, originalInputPath)\n}\n\n// *** PRIVATE ***\n\nfunc terminateAtControllingWorkspace(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\toriginalInputPath string,\n) (ControllingWorkspace, error) {\n\tbufWorkYAMLFile, err := bufconfig.GetBufWorkYAMLFileForPrefix(ctx, bucket, prefix)\n\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, err\n\t}\n\tbufWorkYAMLExists := err == nil\n\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, bucket, prefix)\n\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, err\n\t}\n\tbufYAMLExists := err == nil\n\tif bufWorkYAMLExists && bufYAMLExists {\n\t\t// This isn't actually the external directory path, but we do the best we can here for now.\n\t\treturn nil, fmt.Errorf(\"cannot have a buf.work.yaml and buf.yaml in the same directory %q\", prefix)\n\t}\n\trelInputPath, err := normalpath.Rel(prefix, originalInputPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif bufYAMLExists && bufYAMLFile.FileVersion() == bufconfig.FileVersionV2 {\n\t\t// A input directory with a v2 buf.yaml is the controlling workspace for itself.\n\t\tif prefix == originalInputPath {\n\t\t\treturn newControllingWorkspace(prefix, nil, bufYAMLFile), nil\n\t\t}\n\t\tfor _, moduleConfig := range bufYAMLFile.ModuleConfigs() {\n\t\t\t// For a prefix/buf.yaml with:\n\t\t\t//  version: v2\n\t\t\t//  modules:\n\t\t\t//    - path: foo\n\t\t\t//    - path: dir/bar\n\t\t\t//    - path: dir/baz\n\t\t\t//  ...\n\t\t\t// - If the input is a module path (one of prefix/foo, prefix/dir/bar or prefix/dir/baz),\n\t\t\t//   then the input is a module controlled by the workspace at prefix.\n\t\t\t// - If the input is inside one of the module DirPaths (e.g. prefix/foo/suffix or prefix/dir/bar/suffix)\n\t\t\t//   we still consider prefix to be the workspace that controls the input. It is then up\n\t\t\t//   to the caller to decide what to do with this information. For example, the caller could\n\t\t\t//   say this is equivalent to input being prefix/foo with --path=prefix/foo/suffix specified,\n\t\t\t//   or it could say this is invalid, or the caller is not be concerned with validity.\n\t\t\tif normalpath.EqualsOrContainsPath(moduleConfig.DirPath(), relInputPath, normalpath.Relative) {\n\t\t\t\treturn newControllingWorkspace(prefix, nil, bufYAMLFile), nil\n\t\t\t}\n\t\t\t// Only in v2: if the input is not any of the module paths but contains a module path,\n\t\t\t// e.g. prefix/dir, we also consider prefix to be the controlling workspace, because in v2\n\t\t\t// an input is allowed to be a subset of a workspace's modules. In this example, input prefix/dir\n\t\t\t// is two modules, one at prefix/dir/bar and the other at prefix/dir/baz.\n\t\t\tif normalpath.EqualsOrContainsPath(relInputPath, moduleConfig.DirPath(), normalpath.Relative) {\n\t\t\t\treturn newControllingWorkspace(prefix, nil, bufYAMLFile), nil\n\t\t\t}\n\t\t}\n\t}\n\tif bufWorkYAMLExists {\n\t\t// A input directory with a buf.work.yaml is the controlling workspace for itself.\n\t\tif prefix == originalInputPath {\n\t\t\treturn newControllingWorkspace(prefix, bufWorkYAMLFile, nil), nil\n\t\t}\n\t\tfor _, dirPath := range bufWorkYAMLFile.DirPaths() {\n\t\t\t// Unlike v2 workspaces, we only check whether the input is a module path or is contained\n\t\t\t// in a module path.\n\t\t\tif normalpath.EqualsOrContainsPath(dirPath, relInputPath, normalpath.Relative) {\n\t\t\t\treturn newControllingWorkspace(prefix, bufWorkYAMLFile, nil), nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, nil\n}\n\nfunc terminateAtV1Module(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\toriginalInputPath string,\n) (ControllingWorkspace, error) {\n\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, bucket, prefix)\n\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, err\n\t}\n\tif err == nil && bufYAMLFile.FileVersion() == bufconfig.FileVersionV1 {\n\t\treturn newControllingWorkspace(prefix, nil, bufYAMLFile), nil\n\t}\n\treturn nil, nil\n}\n"
  },
  {
    "path": "private/buf/buftarget/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage buftarget\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/buftesting/buftesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buftesting\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"net/http\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"github.com/bufbuild/buf/private/buf/bufprotoc\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/github/githubtesting\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/prototesting\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nconst (\n\t// NumGoogleapisFiles is the number of googleapis files on the current test commit.\n\tNumGoogleapisFiles = 1574\n\t// NumGoogleapisFilesWithImports is the number of googleapis files on the current test commit with imports.\n\tNumGoogleapisFilesWithImports = 1585\n\n\ttestGoogleapisCommit = \"37c923effe8b002884466074f84bc4e78e6ade62\"\n)\n\nvar (\n\ttestHTTPClient = &http.Client{\n\t\tTimeout: 10 * time.Second,\n\t}\n\ttestStorageosProvider = storageos.NewProvider(storageos.ProviderWithSymlinks())\n\ttestArchiveReader     = githubtesting.NewArchiveReader(\n\t\txslog.NopLogger,\n\t\ttestStorageosProvider,\n\t\ttestHTTPClient,\n\t)\n\ttestGoogleapisDirPath = filepath.Join(\"cache\", \"googleapis\")\n)\n\n// GetActualProtocFileDescriptorSet gets the FileDescriptorSet for actual protoc.\nfunc GetActualProtocFileDescriptorSet(\n\tt *testing.T,\n\tincludeImports bool,\n\tincludeSourceInfo bool,\n\tdirPath string,\n\tfilePaths []string,\n) *descriptorpb.FileDescriptorSet {\n\tfileDescriptorSet, err := prototesting.GetProtocFileDescriptorSet(\n\t\tt.Context(),\n\t\t[]string{dirPath},\n\t\tfilePaths,\n\t\tincludeImports,\n\t\tincludeSourceInfo,\n\t)\n\trequire.NoError(t, err)\n\treturn fileDescriptorSet\n}\n\n// RunActualProtoc runs actual protoc.\nfunc RunActualProtoc(\n\tt *testing.T,\n\tincludeImports bool,\n\tincludeSourceInfo bool,\n\tdirPath string,\n\tfilePaths []string,\n\tenv map[string]string,\n\tstdout io.Writer,\n\textraFlags ...string,\n) {\n\terr := prototesting.RunProtoc(\n\t\tt.Context(),\n\t\t[]string{dirPath},\n\t\tfilePaths,\n\t\tincludeImports,\n\t\tincludeSourceInfo,\n\t\tenv,\n\t\tstdout,\n\t\textraFlags...,\n\t)\n\trequire.NoError(t, err)\n}\n\n// GetGoogleapisDirPath gets the path to a clone of googleapis.\nfunc GetGoogleapisDirPath(t *testing.T, buftestingDirPath string) string {\n\tgoogleapisDirPath := filepath.Join(buftestingDirPath, testGoogleapisDirPath)\n\trequire.NoError(\n\t\tt,\n\t\ttestArchiveReader.GetArchive(\n\t\t\tt.Context(),\n\t\t\tgoogleapisDirPath,\n\t\t\t\"googleapis\",\n\t\t\t\"googleapis\",\n\t\t\ttestGoogleapisCommit,\n\t\t),\n\t)\n\treturn googleapisDirPath\n}\n\n// GetProtocFilePaths gets the file paths for protoc.\n//\n// Limit limits the number of files returned if > 0.\n// protoc has a fixed size for number of characters to argument list.\nfunc GetProtocFilePaths(t *testing.T, dirPath string, limit int) []string {\n\trealFilePaths, err := GetProtocFilePathsErr(t.Context(), dirPath, limit)\n\trequire.NoError(t, err)\n\treturn realFilePaths\n}\n\n// GetProtocFilePathsErr is like GetProtocFilePaths except it returns an error and accepts a ctx.\nfunc GetProtocFilePathsErr(ctx context.Context, dirPath string, limit int) ([]string, error) {\n\t// TODO FUTURE: This is a really convoluted way to get protoc files. It also may have an\n\t// impact on our dependency tree.\n\tmoduleSet, err := bufprotoc.NewModuleSetForProtoc(\n\t\tctx,\n\t\txslog.NopLogger,\n\t\ttestStorageosProvider,\n\t\t[]string{dirPath},\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttargetFileInfos, err := bufmodule.GetTargetFileInfos(\n\t\tctx,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(\n\t\t\tmoduleSet,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trealFilePaths := make([]string, len(targetFileInfos))\n\tfor i, fileInfo := range targetFileInfos {\n\t\trealFilePaths[i] = normalpath.Unnormalize(normalpath.Join(dirPath, fileInfo.Path()))\n\t}\n\tif limit > 0 && len(realFilePaths) > limit {\n\t\trealFilePaths = realFilePaths[:limit]\n\t}\n\treturn realFilePaths, nil\n}\n"
  },
  {
    "path": "private/buf/buftesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage buftesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufwkt/bufwktstore/bufwktstore.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufwktstore\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// Store provides disk-backed WKT buckets.\ntype Store interface {\n\t// GetBucket gets a disk-backed WKT bucket.\n\t//\n\t// LocalPaths will be present on all files within the bucket.\n\tGetBucket(ctx context.Context) (storage.ReadBucket, error)\n}\n\n// NewStore returns a new Store for the given cache bucket.\n//\n// It is assumed that the Store has complete control of the bucket.\nfunc NewStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n) Store {\n\treturn newStore(logger, bucket)\n}\n"
  },
  {
    "path": "private/buf/bufwkt/bufwktstore/store.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufwktstore\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\ntype store struct {\n\tlogger *slog.Logger\n\tbucket storage.ReadWriteBucket\n}\n\nfunc newStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n) *store {\n\treturn &store{\n\t\tlogger: logger,\n\t\tbucket: bucket,\n\t}\n}\n\nfunc (s *store) GetBucket(ctx context.Context) (storage.ReadBucket, error) {\n\twktBucket := storage.MapReadWriteBucket(s.bucket, storage.MapOnPrefix(datawkt.Version))\n\n\tisEmpty, err := storage.IsEmpty(ctx, wktBucket, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif isEmpty {\n\t\tif err := copyToBucket(ctx, wktBucket); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tdiff, err := storage.DiffBytes(ctx, datawkt.ReadBucket, wktBucket)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(diff) > 0 {\n\t\t\tif err := deleteBucket(ctx, wktBucket); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif err := copyToBucket(ctx, wktBucket); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn storage.StripReadBucketExternalPaths(wktBucket), nil\n}\n\nfunc copyToBucket(ctx context.Context, wktBucket storage.WriteBucket) error {\n\t_, err := storage.Copy(ctx, datawkt.ReadBucket, wktBucket)\n\treturn err\n}\n\nfunc deleteBucket(ctx context.Context, wktBucket storage.WriteBucket) error {\n\treturn wktBucket.DeleteAll(ctx, \"\")\n}\n"
  },
  {
    "path": "private/buf/bufwkt/bufwktstore/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufwktstore\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufwkt/cmd/wkt-go-data/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"cmp\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tprogramName             = \"wkt-go-data\"\n\tpkgFlagName             = \"package\"\n\tprotobufVersionFlagName = \"protobuf-version\"\n\tbytesPerLine            = 20\n)\n\nvar failedError = app.NewError( /* exitCode */ 100, \"something went wrong\")\n\nfunc main() {\n\t// TODO: The datawkt machinery would be WAY simpler if it just used go:embed instead.\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\tflags := newFlags()\n\tbuilder := appext.NewBuilder(\n\t\tprogramName,\n\t\tappext.BuilderWithLoggerProvider(slogapp.LoggerProvider),\n\t)\n\treturn &appcmd.Command{\n\t\tUse:  fmt.Sprintf(\"%s path/to/google/protobuf/include\", programName),\n\t\tArgs: appcmd.ExactArgs(1),\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tPkg             string\n\tProtobufVersion string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Pkg,\n\t\tpkgFlagName,\n\t\t\"\",\n\t\t\"The name of the generated package.\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.ProtobufVersion,\n\t\tprotobufVersionFlagName,\n\t\t\"\",\n\t\t\"The version of protobuf used to get the Well-Known Types.\",\n\t)\n}\n\nfunc run(ctx context.Context, container appext.Container, flags *flags) error {\n\tdirPath := container.Arg(0)\n\tpackageName := flags.Pkg\n\tif packageName == \"\" {\n\t\tpackageName = filepath.Base(dirPath)\n\t}\n\tprotobufVersion := flags.ProtobufVersion\n\tif protobufVersion == \"\" {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s is required\", protobufVersionFlagName)\n\t}\n\treadWriteBucket, err := storageos.NewProvider(storageos.ProviderWithSymlinks()).NewReadWriteBucket(dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpathToData, err := getPathToData(ctx, readWriteBucket)\n\tif err != nil {\n\t\treturn err\n\t}\n\tprotosourceFiles, err := getProtosourceFiles(ctx, container, readWriteBucket)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfullNameToMessage, err := bufprotosource.FullNameToMessage(protosourceFiles...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfullNameToEnum, err := bufprotosource.FullNameToEnum(protosourceFiles...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpathToFile, err := bufprotosource.FilePathToFile(protosourceFiles...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpathToImports := make(map[string][]string, len(pathToFile))\n\tfor path, file := range pathToFile {\n\t\timports := xslices.Map(\n\t\t\tfile.FileImports(),\n\t\t\tfunc(fileImport bufprotosource.FileImport) string {\n\t\t\t\treturn fileImport.Import()\n\t\t\t},\n\t\t)\n\t\tsort.Strings(imports)\n\t\tpathToImports[path] = imports\n\t}\n\tgolangFileData, err := getGolangFileData(\n\t\tprotobufVersion,\n\t\tpathToData,\n\t\tfullNameToMessage,\n\t\tfullNameToEnum,\n\t\tpathToImports,\n\t\tpackageName,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = container.Stdout().Write(golangFileData)\n\treturn err\n}\n\nfunc getPathToData(ctx context.Context, bucket storage.ReadBucket) (map[string][]byte, error) {\n\tpathToData := make(map[string][]byte)\n\tif err := storage.WalkReadObjects(\n\t\tctx,\n\t\tbucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdata, err := io.ReadAll(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpathToData[readObject.Path()] = data\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn pathToData, nil\n}\n\nfunc getProtosourceFiles(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tbucket storage.ReadBucket,\n) ([]bufprotosource.File, error) {\n\tmoduleSet, err := bufmodule.NewModuleSetBuilder(\n\t\tctx,\n\t\tcontainer.Logger(),\n\t\tbufmodule.NopModuleDataProvider,\n\t\tbufmodule.NopCommitProvider,\n\t).AddLocalModule(\n\t\tbucket,\n\t\t\".\",\n\t\ttrue,\n\t).Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmodule := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet)\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tcontainer.Logger(),\n\t\tmodule,\n\t\tbufimage.WithExcludeSourceCodeInfo(),\n\t)\n\tif err != nil {\n\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\tif errors.As(err, &fileAnnotationSet) {\n\t\t\t// stderr since we do output to stdout\n\t\t\tif err := bufanalysis.PrintFileAnnotationSet(\n\t\t\t\tcontainer.Stderr(),\n\t\t\t\tfileAnnotationSet,\n\t\t\t\t\"text\",\n\t\t\t); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn nil, failedError\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn bufprotosource.NewFiles(ctx, image.Files(), image.Resolver())\n}\n\nfunc getGolangFileData(\n\tprotobufVersion string,\n\tpathToData map[string][]byte,\n\tfullNameToMessage map[string]bufprotosource.Message,\n\tfullNameToEnum map[string]bufprotosource.Enum,\n\t// imports are sorted\n\tpathToImports map[string][]string,\n\tpackageName string,\n) ([]byte, error) {\n\tpaths := make([]string, 0, len(pathToData))\n\tfor path := range pathToData {\n\t\tpaths = append(paths, path)\n\t}\n\tsort.Strings(paths)\n\n\tbuffer := bytes.NewBuffer(nil)\n\tp := func(s string) {\n\t\t_, _ = buffer.WriteString(s)\n\t}\n\n\tp(`// Code generated by `)\n\tp(programName)\n\tp(`. DO NOT EDIT.`)\n\tp(\"\\n\\n\")\n\tp(`// Package `)\n\tp(packageName)\n\tp(` stores the sources of the Well-Known Types, and provides helper functionality around them.`)\n\tp(\"\\n\")\n\tp(`package `)\n\tp(packageName)\n\tp(`\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)`)\n\tp(\"\\n\\n\")\n\tp(`// Version is the version of github.com/protocolbuffers/protobuf used to extract the Well-Known Types.\nconst Version = \"`)\n\tp(protobufVersion)\n\tp(`\"`)\n\tp(\"\\n\\n\")\n\tp(`var (\n\t// ReadBucket is the storage.ReadBucket with the static data generated for this package.\n\tReadBucket storage.ReadBucket`)\n\tp(\"\\n\\n\")\n\tp(`// AllFilePaths are all Well-Known Type file paths in sorted order.`)\n\tp(\"\\n\")\n\tp(`AllFilePaths = []string{`)\n\tp(\"\\n\")\n\tfor _, path := range paths {\n\t\tp(`\"`)\n\t\tp(path)\n\t\tp(`\",`)\n\t\tp(\"\\n\")\n\t}\n\tp(`}`)\n\tp(\"\\n\\n\")\n\tp(`filePathToData = map[string][]byte{\n`)\n\tfor _, path := range paths {\n\t\tp(`\"`)\n\t\tp(path)\n\t\tp(`\": {\n`)\n\t\tdata := pathToData[path]\n\t\tfor len(data) > 0 {\n\t\t\tn := min(bytesPerLine, len(data))\n\t\t\tvar accum strings.Builder\n\t\t\tfor _, elem := range data[:n] {\n\t\t\t\t_, _ = fmt.Fprintf(&accum, \"0x%02x,\", elem)\n\t\t\t}\n\t\t\tp(accum.String())\n\t\t\tp(\"\\n\")\n\t\t\tdata = data[n:]\n\t\t}\n\t\tp(`},\n`)\n\t}\n\tp(`}`)\n\tp(\"\\n\\n\")\n\tp(`filePathToImports = map[string][]string{\n`)\n\tfor _, pathToImportsPair := range sortedPairs(pathToImports) {\n\t\tp(`\"`)\n\t\tp(pathToImportsPair.key)\n\t\tp(`\": {`)\n\t\tp(\"\\n\")\n\t\tfor _, imp := range pathToImportsPair.val {\n\t\t\tp(`\"`)\n\t\t\tp(imp)\n\t\t\tp(`\",`)\n\t\t\tp(\"\\n\")\n\t\t}\n\t\tp(`},`)\n\t\tp(\"\\n\")\n\t}\n\tp(`}`)\n\tp(\"\\n\\n\")\n\tp(`messageNameToFilePath = map[string]string{\n`)\n\tfor _, fullNameToMessagePair := range sortedPairs(fullNameToMessage) {\n\t\tp(`\"`)\n\t\tp(fullNameToMessagePair.key)\n\t\tp(`\": \"`)\n\t\tp(fullNameToMessagePair.val.File().Path())\n\t\tp(`\",`)\n\t\tp(\"\\n\")\n\t}\n\tp(`}`)\n\tp(\"\\n\\n\")\n\tp(`enumNameToFilePath = map[string]string{\n`)\n\tfor _, fullNameToEnumPair := range sortedPairs(fullNameToEnum) {\n\t\tp(`\"`)\n\t\tp(fullNameToEnumPair.key)\n\t\tp(`\": \"`)\n\t\tp(fullNameToEnumPair.val.File().Path())\n\t\tp(`\",`)\n\t\tp(\"\\n\")\n\t}\n\tp(`}`)\n\tp(\"\\n\")\n\tp(`)`)\n\tp(\"\\n\\n\")\n\tp(`func init() {\n\treadBucket, err := storagemem.NewReadBucket(filePathToData)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tReadBucket = readBucket\n}\n\n// Exists returns true if the given path exists in the static data.\n//\n// The path is normalized within this function.\nfunc Exists(filePath string) bool {\n\t_, ok := filePathToData[normalpath.Normalize(filePath)]\n\treturn ok\n}\n\n// FileImports gets the imports for the given file path, if the file path exists.\nfunc FileImports(filePath string) ([]string, bool) {\n\timports, ok := filePathToImports[filePath]\n\tif !ok {\n\t\treturn nil, false\n\t}\n\tc := make([]string, len(imports))\n\tcopy(c, imports)\n\treturn c, true\n}\n\n// MessageFilePath gets the file path for the given message, if the message exists.\nfunc MessageFilePath(messageName string) (string, bool) {\n\tfilePath, ok := messageNameToFilePath[messageName]\n\treturn filePath, ok\n}\n\n// EnumFilePath gets the file path for the given enum, if the enum exists.\nfunc EnumFilePath(enumName string) (string, bool) {\n\tfilePath, ok := enumNameToFilePath[enumName]\n\treturn filePath, ok\n}\n`)\n\tformatted, err := format.Source(buffer.Bytes())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not format: %w\\n%s\", err, buffer.String())\n\t}\n\treturn formatted, nil\n}\n\ntype keyValPair[K any, V any] struct {\n\tkey K\n\tval V\n}\n\nfunc sortedPairs[K cmp.Ordered, V any](m map[K]V) []keyValPair[K, V] {\n\tret := make([]keyValPair[K, V], 0, len(m))\n\tfor key := range m {\n\t\tret = append(ret, keyValPair[K, V]{key: key, val: m[key]})\n\t}\n\tsort.Slice(ret, func(i, j int) bool {\n\t\treturn ret[i].key < ret[j].key\n\t})\n\treturn ret\n}\n"
  },
  {
    "path": "private/buf/bufwkt/cmd/wkt-go-data/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufworkspace/bufworkspace.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n"
  },
  {
    "path": "private/buf/bufworkspace/malformed_dep.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"sort\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// MalformedDepTypeUnused says that the dep was declared in the buf.yaml but was not used.\n\t//\n\t// A dep is not used if no .proto file references it, and the dep is not a local Module within the Workspace.\n\t//\n\t// We ignore local Modules within the Workspace as v1 buf.yamls needed to declare deps within the Workspace,\n\t// and there's no easy way for us to determine if a dep is needed or not within our current\n\t// Workspace/Module model. We could get more complicated and warn if you are using a v2 buf.lock\n\t// and have deps on local Modules, but there's little benefit.\n\tMalformedDepTypeUnused MalformedDepType = iota + 1\n)\n\n// MalformedDepType is the type of malformed dep.\ntype MalformedDepType int\n\n// MalformedDep is a dep that was malformed in some way in the buf.yaml.\n// It provides the module ref information and the malformed dep type.\ntype MalformedDep interface {\n\t// ModuleRef is the module ref information of the malformed dep.\n\t//\n\t// Always present.\n\tModuleRef() bufparse.Ref\n\t// Type is why this dep was malformed.\n\t//\n\t// Always present.\n\tType() MalformedDepType\n\n\tisMalformedDep()\n}\n\n// MalformedDepsForWorkspace gets the MalformedDeps for the workspace.\nfunc MalformedDepsForWorkspace(workspace Workspace) ([]MalformedDep, error) {\n\tlocalFullNameStringMap := xslices.ToStructMapOmitEmpty(\n\t\txslices.Map(\n\t\t\tbufmodule.ModuleSetLocalModules(workspace),\n\t\t\tfunc(module bufmodule.Module) string {\n\t\t\t\tif moduleFullName := module.FullName(); moduleFullName != nil {\n\t\t\t\t\treturn moduleFullName.String()\n\t\t\t\t}\n\t\t\t\treturn \"\"\n\t\t\t},\n\t\t),\n\t)\n\tremoteDeps, err := bufmodule.RemoteDepsForModuleSet(workspace)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmoduleFullNameStringToRemoteDep, err := xslices.ToUniqueValuesMapError(\n\t\tremoteDeps,\n\t\tfunc(remoteDep bufmodule.RemoteDep) (string, error) {\n\t\t\tmoduleFullName := remoteDep.FullName()\n\t\t\tif moduleFullName == nil {\n\t\t\t\treturn \"\", syserror.Newf(\"FullName nil on remote Module dependency %q\", remoteDep.OpaqueID())\n\t\t\t}\n\t\t\treturn moduleFullName.String(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmoduleFullNameStringToConfiguredDepModuleRef, err := xslices.ToUniqueValuesMapError(\n\t\tworkspace.ConfiguredDepModuleRefs(),\n\t\tfunc(moduleRef bufparse.Ref) (string, error) {\n\t\t\tmoduleFullName := moduleRef.FullName()\n\t\t\tif moduleFullName == nil {\n\t\t\t\treturn \"\", syserror.New(\"FullName nil on ModuleRef\")\n\t\t\t}\n\t\t\treturn moduleFullName.String(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar malformedDeps []MalformedDep\n\tfor moduleFullNameString, configuredDepModuleRef := range moduleFullNameStringToConfiguredDepModuleRef {\n\t\t_, isLocalModule := localFullNameStringMap[moduleFullNameString]\n\t\t_, isRemoteDep := moduleFullNameStringToRemoteDep[moduleFullNameString]\n\t\tif !isRemoteDep && !isLocalModule {\n\t\t\t// The module was in buf.yaml deps, but was not in the remote dep list after\n\t\t\t// adding all ModuleKeys and transitive dependency ModuleKeys. It is also not\n\t\t\t// a local module. Therefore it is unused.\n\t\t\tmalformedDeps = append(\n\t\t\t\tmalformedDeps,\n\t\t\t\tnewMalformedDep(\n\t\t\t\t\tconfiguredDepModuleRef,\n\t\t\t\t\tMalformedDepTypeUnused,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\tsort.Slice(\n\t\tmalformedDeps,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn malformedDeps[i].ModuleRef().FullName().String() <\n\t\t\t\tmalformedDeps[j].ModuleRef().FullName().String()\n\t\t},\n\t)\n\treturn malformedDeps, nil\n}\n\n// *** PRIVATE ***\n\ntype malformedDep struct {\n\tmoduleRef        bufparse.Ref\n\tmalformedDepType MalformedDepType\n}\n\nfunc newMalformedDep(\n\tmoduleRef bufparse.Ref,\n\tmalformedDepType MalformedDepType,\n) *malformedDep {\n\treturn &malformedDep{\n\t\tmoduleRef:        moduleRef,\n\t\tmalformedDepType: malformedDepType,\n\t}\n}\n\nfunc (m *malformedDep) ModuleRef() bufparse.Ref {\n\treturn m.moduleRef\n}\n\nfunc (m *malformedDep) Type() MalformedDepType {\n\treturn m.malformedDepType\n}\n\nfunc (*malformedDep) isMalformedDep() {}\n"
  },
  {
    "path": "private/buf/bufworkspace/module_targeting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"fmt\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\ntype moduleTargeting struct {\n\t// Whether this module is really a target module.\n\t//\n\t// False if this was not specified as a target module by the caller.\n\t// Also false if there were bucketTargeting.TargetPaths() or bucketTargeting.protoFileTargetPath, but\n\t// these paths did not match anything in the module.\n\tisTargetModule bool\n\t// moduleDirPath is the directory path of the module\n\tmoduleDirPath string\n\t// relative to the actual moduleDirPath and the roots parsed from the buf.yaml\n\tmoduleTargetPaths []string\n\t// relative to the actual moduleDirPath and the roots parsed from the buf.yaml\n\tmoduleTargetExcludePaths []string\n\t// relative to the actual moduleDirPath and the roots parsed from the buf.yaml\n\tmoduleProtoFileTargetPath string\n\tincludePackageFiles       bool\n}\n\nfunc newModuleTargeting(\n\tmoduleDirPath string,\n\troots []string,\n\tbucketTargeting buftarget.BucketTargeting,\n\tconfig *workspaceBucketConfig,\n\tisTentativelyTargetModule bool,\n) (*moduleTargeting, error) {\n\tif !isTentativelyTargetModule {\n\t\t// If this is not a target Module, we do not want to target anything, as targeting\n\t\t// paths for non-target Modules is an error.\n\t\treturn &moduleTargeting{moduleDirPath: moduleDirPath}, nil\n\t}\n\t// If we have no target paths, then we always match the value of isTargetModule.\n\t// Otherwise, we need to see that at least one path matches the moduleDirPath for us\n\t// to consider this module a target.\n\tisTargetModule := len(bucketTargeting.TargetPaths()) == 0 && config.protoFileTargetPath == \"\"\n\n\tvar moduleTargetPaths []string\n\tvar moduleTargetExcludePaths []string\n\tvar moduleProtoFileTargetPath string\n\tvar includePackageFiles bool\n\tif config.protoFileTargetPath != \"\" {\n\t\tvar err error\n\t\t// We are currently returning the mapped proto file path as a target path in bucketTargeting.\n\t\t// At the user level, we do not allow setting target paths or exclude paths for proto file\n\t\t// references, so we do this check here.\n\t\tif len(bucketTargeting.TargetPaths()) != 1 {\n\t\t\treturn nil, syserror.New(\"ProtoFileTargetPath not properly returned with bucketTargeting\")\n\t\t}\n\t\tprotoFileTargetPath := bucketTargeting.TargetPaths()[0]\n\t\tif normalpath.ContainsPath(moduleDirPath, protoFileTargetPath, normalpath.Relative) {\n\t\t\tisTargetModule = true\n\t\t\tmoduleProtoFileTargetPath, err = normalpath.Rel(moduleDirPath, protoFileTargetPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmoduleProtoFileTargetPath, err = applyRootsToTargetPath(roots, moduleProtoFileTargetPath, normalpath.Relative)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tincludePackageFiles = config.includePackageFiles\n\t\t}\n\t} else {\n\t\tvar err error\n\t\t// We use the bucketTargeting.TargetPaths() instead of the workspace config target paths\n\t\t// since those are stripped of the path to the module.\n\t\tfor _, targetPath := range bucketTargeting.TargetPaths() {\n\t\t\tif targetPath == moduleDirPath {\n\t\t\t\t// We're just going to be realists in our error messages here.\n\t\t\t\t// TODO FUTURE: Do we error here currently? If so, this error remains. For extra credit in the future,\n\t\t\t\t// if we were really clever, we'd go back and just add this as a module path.\n\t\t\t\treturn nil, fmt.Errorf(\"module %q was specified with --path, specify this module path directly as an input\", targetPath)\n\t\t\t}\n\t\t\tif normalpath.ContainsPath(moduleDirPath, targetPath, normalpath.Relative) {\n\t\t\t\tisTargetModule = true\n\t\t\t\tmoduleTargetPath, err := normalpath.Rel(moduleDirPath, targetPath)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tmoduleTargetPaths = append(moduleTargetPaths, moduleTargetPath)\n\t\t\t}\n\t\t}\n\t\t// If this is not a target module, then exclude-paths should not apply to the module.\n\t\t//\n\t\t// Otherwise, you will run into scenarios like this:\n\t\t//\n\t\t// buf build --exclude-path googleapis/google --path books/acme\n\t\t// Failure: cannot set TargetPaths for a non-target Module when calling AddLocalModule, bucketID=\"googleapis\", targetPaths=[], targetExcludePaths=[google]\n\t\t//\n\t\t// This syserror is valid: LocalModuleWithTargetPaths should only be called for target modules. If we pass --exclude-path for a non-target module (which in the above\n\t\t// example, googleapis is not targeted because --path books/acme only targeted books), then it should be as if --exclude-path pointed to a non-existent file or directory.\n\t\tif isTargetModule {\n\t\t\t// We use the bucketTargeting.TargetExcludePaths() instead of the workspace config target\n\t\t\t// exclude paths since those are stripped of the path to the module.\n\t\t\tfor _, targetExcludePath := range bucketTargeting.TargetExcludePaths() {\n\t\t\t\tif targetExcludePath == moduleDirPath {\n\t\t\t\t\t// We're just going to be realists in our error messages here.\n\t\t\t\t\t// TODO FUTURE: Do we error here currently? If so, this error remains. For extra credit in the future,\n\t\t\t\t\t// if we were really clever, we'd go back and just remove this as a module path if it was specified.\n\t\t\t\t\t// This really should be allowed - how else do you exclude from a workspace?\n\t\t\t\t\treturn nil, fmt.Errorf(\"module %q was specified with --exclude-path, this flag cannot be used to specify module directories\", targetExcludePath)\n\t\t\t\t}\n\t\t\t\tif normalpath.ContainsPath(moduleDirPath, targetExcludePath, normalpath.Relative) {\n\t\t\t\t\tmoduleTargetExcludePath, err := normalpath.Rel(moduleDirPath, targetExcludePath)\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\tmoduleTargetExcludePaths = append(moduleTargetExcludePaths, moduleTargetExcludePath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tmoduleTargetPaths, err = xslices.MapError(\n\t\t\tmoduleTargetPaths,\n\t\t\tfunc(moduleTargetPath string) (string, error) {\n\t\t\t\treturn applyRootsToTargetPath(roots, moduleTargetPath, normalpath.Relative)\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmoduleTargetExcludePaths, err = xslices.MapError(\n\t\t\tmoduleTargetExcludePaths,\n\t\t\tfunc(moduleTargetExcludePath string) (string, error) {\n\t\t\t\treturn applyRootsToTargetPath(roots, moduleTargetExcludePath, normalpath.Relative)\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &moduleTargeting{\n\t\tmoduleDirPath:             moduleDirPath,\n\t\tisTargetModule:            isTargetModule,\n\t\tmoduleTargetPaths:         moduleTargetPaths,\n\t\tmoduleTargetExcludePaths:  moduleTargetExcludePaths,\n\t\tmoduleProtoFileTargetPath: moduleProtoFileTargetPath,\n\t\tincludePackageFiles:       includePackageFiles,\n\t}, nil\n}\n\nfunc applyRootsToTargetPath(roots []string, path string, pathType normalpath.PathType) (string, error) {\n\tvar matchingRoots []string\n\tfor _, root := range roots {\n\t\tif normalpath.ContainsPath(root, path, pathType) {\n\t\t\tmatchingRoots = append(matchingRoots, root)\n\t\t}\n\t}\n\tswitch len(matchingRoots) {\n\tcase 0:\n\t\t// this is a user error and will likely happen often\n\t\treturn \"\", fmt.Errorf(\n\t\t\t\"path %q is not contained within any of roots %s - note that specified paths \"+\n\t\t\t\t\"cannot be roots, but must be contained within roots\",\n\t\t\tpath,\n\t\t\txstrings.SliceToHumanStringQuoted(roots),\n\t\t)\n\tcase 1:\n\t\ttargetPath, err := normalpath.Rel(matchingRoots[0], path)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\t// just in case\n\t\treturn normalpath.Normalize(targetPath), nil\n\tdefault:\n\t\t// this should never happen\n\t\treturn \"\", fmt.Errorf(\"%q is contained in multiple roots %s\", path, xstrings.SliceToHumanStringQuoted(roots))\n\t}\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/option.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// WorkspaceBucketOption is an option for a new Workspace created by a Bucket.\ntype WorkspaceBucketOption interface {\n\tapplyToWorkspaceBucketConfig(*workspaceBucketConfig)\n}\n\n// WorkspaceModuleKeyOption is an option for a new Workspace created by a ModuleKey.\ntype WorkspaceModuleKeyOption interface {\n\tapplyToWorkspaceModuleKeyConfig(*workspaceModuleKeyConfig)\n}\n\n// WorkspaceBucketAndModuleKeyOption is an option for a new Workspace created by either a Bucket or ModuleKey.\ntype WorkspaceBucketAndModuleKeyOption interface {\n\tWorkspaceBucketOption\n\tWorkspaceModuleKeyOption\n}\n\n// WithProtoFileTargetPath returns a new WorkspaceBucketOption that specifically targets\n// a single .proto file, and optionally targets all other .proto files that are in the same package.\n//\n// If targetPath is empty, includePackageFiles is ignored.\n// Exclusive with WithTargetPaths - only one of these can have a non-empty value.\n//\n// This is used for ProtoFileRefs only. Do not use this otherwise.\nfunc WithProtoFileTargetPath(protoFileTargetPath string, includePackageFiles bool) WorkspaceBucketOption {\n\treturn &workspaceProtoFileTargetPathOption{\n\t\tprotoFileTargetPath: protoFileTargetPath,\n\t\tincludePackageFiles: includePackageFiles,\n\t}\n}\n\n// WithIgnoreAndDisallowV1BufWorkYAMLs returns a new WorkspaceBucketOption that says\n// to ignore dependencies from buf.work.yamls at the root of the bucket, and to also\n// disallow directories with buf.work.yamls to be directly targeted.\n//\n// This is used for v1 updates with buf mod prune and buf mod update.\n//\n// A the root of the bucket targets a buf.work.yaml, but the targetSubDirPath targets\n// a module, this is allowed.\n//\n// Example: ./buf.work.yaml, targetSubDirPath = foo/bar, foo/bar/buf.yaml and foo/bar/buf.lock v1\n// This will result in the dependencies from buf.work.yaml being ignored, and a Workspace\n// with just the Module at foo/bar plus the dependencies from foo/bar/buf.lock being added.\n//\n// Example: ./buf.work.yaml, targetSubDirPath = .\n// This will result in an error.\n//\n// Example: ./buf.yaml v1.\n// This is fine.\nfunc WithIgnoreAndDisallowV1BufWorkYAMLs() WorkspaceBucketOption {\n\treturn &workspaceIgnoreAndDisallowV1BufWorkYAMLsOption{}\n}\n\n// WithTargetPaths specifies the target paths.\n//\n// Note these paths need to have the path/to/module stripped, and then each new path\n// filtered to the specific module it applies to. If some modules do not have any\n// target paths, but we specified WorkspaceWithTargetPaths, then those modules\n// need to be built as non-targeted.\n//\n// These paths have to  be within the subDirPath, if it exists.\nfunc WithTargetPaths(targetPaths []string, targetExcludePaths []string) WorkspaceModuleKeyOption {\n\treturn &workspaceTargetPathsOption{\n\t\ttargetPaths:        targetPaths,\n\t\ttargetExcludePaths: targetExcludePaths,\n\t}\n}\n\n// WithConfigOverride applies the config override.\n//\n// This flag will only work if no buf.work.yaml is detected, and the buf.yaml is a v1beta1\n// buf.yaml, v1 buf.yaml, or no buf.yaml. This flag will not work if a buf.work.yaml is\n// detected, or a v2 buf.yaml is detected.\n//\n// If used with NewWorkspaceForModuleKey, this has no effect on the build,\n// i.e. excludes are not respected, and the module name is ignored. This matches old behavior.\n//\n// This implements the deprecated --config flag.\n//\n// See bufconfig.GetBufYAMLFileForPrefixOrOverride for more details.\n//\n// *** DO NOT USE THIS OUTSIDE OF THE CLI AND/OR IF YOU DON'T UNDERSTAND IT. ***\n// *** DO NOT ADD THIS TO ANY NEW COMMANDS. ***\n//\n// Current comments that use this: build, breaking, lint, generate, format,\n// export, ls-breaking-rules, ls-lint-rules.\nfunc WithConfigOverride(configOverride string) WorkspaceBucketAndModuleKeyOption {\n\treturn &workspaceConfigOverrideOption{\n\t\tconfigOverride: configOverride,\n\t}\n}\n\n// *** PRIVATE ***\n\ntype workspaceTargetPathsOption struct {\n\ttargetPaths        []string\n\ttargetExcludePaths []string\n}\n\nfunc (t *workspaceTargetPathsOption) applyToWorkspaceModuleKeyConfig(config *workspaceModuleKeyConfig) {\n\tconfig.targetPaths = t.targetPaths\n\tconfig.targetExcludePaths = t.targetExcludePaths\n}\n\ntype workspaceProtoFileTargetPathOption struct {\n\tprotoFileTargetPath string\n\tincludePackageFiles bool\n}\n\nfunc (p *workspaceProtoFileTargetPathOption) applyToWorkspaceBucketConfig(config *workspaceBucketConfig) {\n\tconfig.protoFileTargetPath = p.protoFileTargetPath\n\tconfig.includePackageFiles = p.includePackageFiles\n}\n\ntype workspaceConfigOverrideOption struct {\n\tconfigOverride string\n}\n\nfunc (c *workspaceConfigOverrideOption) applyToWorkspaceBucketConfig(config *workspaceBucketConfig) {\n\tconfig.configOverride = c.configOverride\n}\n\nfunc (c *workspaceConfigOverrideOption) applyToWorkspaceModuleKeyConfig(config *workspaceModuleKeyConfig) {\n\tconfig.configOverride = c.configOverride\n}\n\ntype workspaceIgnoreAndDisallowV1BufWorkYAMLsOption struct{}\n\nfunc (c *workspaceIgnoreAndDisallowV1BufWorkYAMLsOption) applyToWorkspaceBucketConfig(config *workspaceBucketConfig) {\n\tconfig.ignoreAndDisallowV1BufWorkYAMLs = true\n}\n\ntype workspaceBucketConfig struct {\n\tprotoFileTargetPath             string\n\tincludePackageFiles             bool\n\tconfigOverride                  string\n\tignoreAndDisallowV1BufWorkYAMLs bool\n}\n\nfunc newWorkspaceBucketConfig(options []WorkspaceBucketOption) (*workspaceBucketConfig, error) {\n\tconfig := &workspaceBucketConfig{}\n\tfor _, option := range options {\n\t\toption.applyToWorkspaceBucketConfig(config)\n\t}\n\tif config.protoFileTargetPath != \"\" {\n\t\tconfig.protoFileTargetPath = normalpath.Normalize(config.protoFileTargetPath)\n\t}\n\treturn config, nil\n}\n\ntype workspaceModuleKeyConfig struct {\n\ttargetPaths        []string\n\ttargetExcludePaths []string\n\tconfigOverride     string\n}\n\nfunc newWorkspaceModuleKeyConfig(options []WorkspaceModuleKeyOption) (*workspaceModuleKeyConfig, error) {\n\tconfig := &workspaceModuleKeyConfig{}\n\tfor _, option := range options {\n\t\toption.applyToWorkspaceModuleKeyConfig(config)\n\t}\n\tvar err error\n\tconfig.targetPaths, err = xslices.MapError(\n\t\tconfig.targetPaths,\n\t\tnormalpath.NormalizeAndValidate,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig.targetExcludePaths, err = xslices.MapError(\n\t\tconfig.targetExcludePaths,\n\t\tnormalpath.NormalizeAndValidate,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn config, nil\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/README.md",
    "content": "# Layout\n\n## Modules in BSR\n\n- `buf.testing/acme/extension`\n\n- `buf.testing/acme/date`\n  - Direct Dep: `buf.testing/acme/extension`\n\n## Modules in workspace\n\nIn both `workspacev1` and `workspacev2`.\n\n- `buf.testing/acme/geo` at `common/geo/proto`\n\n- `buf.testing/acme/money` at `common/money/proto`\n\n- `buf.testing/acme/bond` at `finance/bond/proto`\n  - Direct Dep: `buf.testing/acme/date`\n  - Direct Dep: `buf.testing/acme/geo`\n  - Direct Dep: `buf.testing/acme/money`\n  - Transitive Dep: `buf.testing/acme/extension`\n\n- `finance/portfolio/proto` (unnamed)\n  - Direct Dep: `buf.testing/acme/bond`\n  - Transitive Dep: `buf.testing/acme/date`\n  - Transitive Dep: `buf.testing/acme/geo`\n  - Transitive Dep: `buf.testing/acme/money`\n  - Transitive Dep: `buf.testing/acme/extension`\n\n## Development\n\n```\nbash scripts/fakebuflock.bash\n```\n\nThis is automatically run by `make generate`.\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/bsr/buf.testing/acme/date/acme/date/v1/date.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.date.v1;\n\nimport \"acme/extension/v1/extension.proto\";\n\nmessage Date {\n  option (acme.extension.v1.experimental) = true;\n\n  uint32 day = 1;\n  uint32 month = 2;\n  uint32 year = 3;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/bsr/buf.testing/acme/extension/acme/extension/v1/extension.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.extension.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  bool experimental = 50001;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/scripts/fakebuflock.bash",
    "content": "#!/usr/bin/env bash\n\nset -euo pipefail\n\nDIR=\"$(CDPATH= cd \"$(dirname \"${0}\")/..\" && pwd)\"\ncd \"${DIR}\"\n\nB4_DATE_DIGEST=\"$(buf-digest --digest-type shake256 bsr/buf.testing/acme/date bsr/buf.testing/acme/extension | grep date | cut -f 2 -d ' ')\"\nB4_EXTENSION_DIGEST=\"$(buf-digest --digest-type shake256 bsr/buf.testing/acme/date bsr/buf.testing/acme/extension | grep extension | cut -f 2 -d ' ')\"\n\nB5_DATE_DIGEST=\"$(buf-digest --digest-type b5 bsr/buf.testing/acme/date bsr/buf.testing/acme/extension | grep date | cut -f 2 -d ' ')\"\nB5_EXTENSION_DIGEST=\"$(buf-digest --digest-type b5 bsr/buf.testing/acme/date bsr/buf.testing/acme/extension | grep extension | cut -f 2 -d ' ')\"\n\nDATE_COMMIT_ID=\"ffded0b4cf6b47cab74da08d291a3c2f\"\nEXTENSION_COMMIT_ID=\"b8488077ea6d4f6d9562a337b98259c8\"\n\nrm -f workspacev1/finance/bond/proto/buf.lock\ncat <<EOF > workspacev1/finance/bond/proto/buf.lock\nversion: v1\ndeps:\n  - remote: buf.testing\n    owner: acme\n    repository: date\n    commit: ${DATE_COMMIT_ID}\n    digest: ${B4_DATE_DIGEST}\n  - remote: buf.testing\n    owner: acme\n    repository: extension\n    commit: ${EXTENSION_COMMIT_ID}\n    digest: ${B4_EXTENSION_DIGEST}\nEOF\n\nrm -f workspacev1/finance/portfolio/proto/buf.lock\ncp workspacev1/finance/bond/proto/buf.lock workspacev1/finance/portfolio/proto/buf.lock\n\nrm -f workspacev2/buf.lock\ncat <<EOF > workspacev2/buf.lock\nversion: v2\ndeps:\n  - name: buf.testing/acme/date\n    commit: ${DATE_COMMIT_ID}\n    digest: ${B5_DATE_DIGEST}\n  - name: buf.testing/acme/extension\n    commit: ${EXTENSION_COMMIT_ID}\n    digest: ${B5_EXTENSION_DIGEST}\nEOF\n\nrm -f workspace_undeclared_dep/buf.lock\ncp workspacev2/buf.lock workspace_undeclared_dep/buf.lock\n\nrm -f workspace_unused_dep/buf.lock\ncp workspacev2/buf.lock workspace_unused_dep/buf.lock\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspace_undeclared_dep/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: finance/bond/proto\n    name: buf.testing/acme/bond\ndeps:\n  - buf.testing/acme/date\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspace_undeclared_dep/finance/bond/proto/acme/bond/v2/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.v2;\n\nimport \"acme/date/v1/date.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  acme.date.v1.Date purchase_date = 3;\n  google.protobuf.Duration duration = 4;\n  string name = 6;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspace_unused_dep/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: finance/bond/proto\n    name: buf.testing/acme/bond\ndeps:\n  - buf.testing/acme/date\n  - buf.testing/acme/extension\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspace_unused_dep/finance/bond/proto/acme/bond/v2/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.v2;\n\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  google.protobuf.Duration duration = 4;\n  string name = 6;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/LICENSE",
    "content": "workspace license\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/README.md",
    "content": "workspace doc\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - common/geo/proto\n  - common/money/proto\n  - finance/bond/proto\n  - finance/portfolio/proto\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/common/geo/proto/LICENSE",
    "content": "geo license\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/common/geo/proto/acme/geo/v1/country_alpha_3_code.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.geo.v1;\n\nenum CountryAlpha3Code {\n  CURRENCY_ALPHA_3_CODE_UNSPECIFIED = 0;\n  CURRENCY_ALPHA_3_CODE_USA = 1;\n  CURRENCY_ALPHA_3_CODE_CAN = 2;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/common/geo/proto/buf.yaml",
    "content": "version: v1\nname: buf.testing/acme/geo\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/common/money/proto/acme/money/v1/currency_code.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.money.v1;\n\nenum CurrencyCode {\n  CURRENCY_CODE_UNSPECIFIED = 0;\n  CURRENCY_CODE_USD = 1;\n  CURRENCY_CODE_CAD = 2;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/common/money/proto/acme/money/v1/money.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.money.v1;\n\nimport \"acme/money/v1/currency_code.proto\";\n\nmessage Money {\n  CurrencyCode currency_code = 1;\n  int64 value_micros = 2;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/common/money/proto/buf.md",
    "content": "money doc\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/common/money/proto/buf.yaml",
    "content": "version: v1\nname: buf.testing/acme/money\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/finance/bond/proto/LICENSE",
    "content": "bond license\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/finance/bond/proto/README.md",
    "content": "bond doc\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/finance/bond/proto/buf.yaml",
    "content": "version: v1beta1\nname: buf.testing/acme/bond\nbuild:\n  roots:\n    - root1\n    - root2\n  excludes:\n    - root1/acme/bond/excluded/v1\ndeps:\n  - buf.testing/acme/date\n  - buf.testing/acme/extension\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/finance/bond/proto/root1/acme/bond/excluded/v1/excluded.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.excluded.v1;\n\nmessage Excluded {}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/finance/bond/proto/root1/acme/bond/real/v1/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.real.v1;\n\nimport \"acme/date/v1/date.proto\";\nimport \"acme/geo/v1/country_alpha_3_code.proto\";\nimport \"acme/money/v1/currency_code.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  acme.geo.v1.CountryAlpha3Code country_alpha_3_code = 1;\n  acme.money.v1.CurrencyCode currency_code = 2;\n  acme.date.v1.Date purchase_date = 3;\n  google.protobuf.Duration duration = 4;\n  int64 interest_rate_micros = 5;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/finance/bond/proto/root2/acme/bond/v2/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.v2;\n\nimport \"acme/date/v1/date.proto\";\nimport \"acme/geo/v1/country_alpha_3_code.proto\";\nimport \"acme/money/v1/currency_code.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  acme.geo.v1.CountryAlpha3Code country_alpha_3_code = 1;\n  acme.money.v1.CurrencyCode currency_code = 2;\n  acme.date.v1.Date purchase_date = 3;\n  google.protobuf.Duration duration = 4;\n  int64 interest_rate_micros = 5;\n  string name = 6;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev1/finance/portfolio/proto/acme/portfolio/v1/portfolio.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.portfolio.v1;\n\nimport \"acme/bond/v2/bond.proto\";\nimport \"acme/extension/v1/extension.proto\";\n\nmessage Portfolio {\n  option (acme.extension.v1.experimental) = true;\n\n  repeated acme.bond.v2.Bond bonds = 1;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/LICENSE",
    "content": "workspace license\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/README.md",
    "content": "workspace doc\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: common/geo/proto\n    name: buf.testing/acme/geo\n  - path: common/money/proto\n    name: buf.testing/acme/money\n  - path: finance/bond/proto\n    name: buf.testing/acme/bond\n    excludes:\n      - finance/bond/proto/acme/bond/excluded/v1\n  - path: finance/portfolio/proto\n    # No name on purpose\ndeps:\n  - buf.testing/acme/date\n  - buf.testing/acme/extension\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/common/geo/proto/LICENSE",
    "content": "geo license\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/common/geo/proto/acme/geo/v1/country_alpha_3_code.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.geo.v1;\n\nenum CountryAlpha3Code {\n  CURRENCY_ALPHA_3_CODE_UNSPECIFIED = 0;\n  CURRENCY_ALPHA_3_CODE_USA = 1;\n  CURRENCY_ALPHA_3_CODE_CAN = 2;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/common/money/proto/acme/money/v1/currency_code.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.money.v1;\n\nenum CurrencyCode {\n  CURRENCY_CODE_UNSPECIFIED = 0;\n  CURRENCY_CODE_USD = 1;\n  CURRENCY_CODE_CAD = 2;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/common/money/proto/acme/money/v1/money.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.money.v1;\n\nimport \"acme/money/v1/currency_code.proto\";\n\nmessage Money {\n  CurrencyCode currency_code = 1;\n  int64 value_micros = 2;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/common/money/proto/buf.md",
    "content": "money doc\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/finance/bond/proto/LICENSE",
    "content": "bond license\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/finance/bond/proto/README.md",
    "content": "bond doc\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/finance/bond/proto/acme/bond/excluded/v1/excluded.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.excluded.v1;\n\nmessage Excluded {}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/finance/bond/proto/acme/bond/real/v1/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.real.v1;\n\nimport \"acme/date/v1/date.proto\";\nimport \"acme/geo/v1/country_alpha_3_code.proto\";\nimport \"acme/money/v1/currency_code.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  acme.geo.v1.CountryAlpha3Code country_alpha_3_code = 1;\n  acme.money.v1.CurrencyCode currency_code = 2;\n  acme.date.v1.Date purchase_date = 3;\n  google.protobuf.Duration duration = 4;\n  int64 interest_rate_micros = 5;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/finance/bond/proto/acme/bond/v2/bond.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.bond.v2;\n\nimport \"acme/date/v1/date.proto\";\nimport \"acme/geo/v1/country_alpha_3_code.proto\";\nimport \"acme/money/v1/currency_code.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage Bond {\n  acme.geo.v1.CountryAlpha3Code country_alpha_3_code = 1;\n  acme.money.v1.CurrencyCode currency_code = 2;\n  acme.date.v1.Date purchase_date = 3;\n  google.protobuf.Duration duration = 4;\n  int64 interest_rate_micros = 5;\n  string name = 6;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2/finance/portfolio/proto/acme/portfolio/v1/portfolio.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.portfolio.v1;\n\nimport \"acme/bond/v2/bond.proto\";\nimport \"acme/extension/v1/extension.proto\";\n\nmessage Portfolio {\n  option (acme.extension.v1.experimental) = true;\n\n  repeated acme.bond.v2.Bond bonds = 1;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2_duplicate_path/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto/shared\n    excludes:\n      - proto/shared/prefix/foo\n  - path: proto/shared1\n    includes:\n      - proto/shared1/prefix/x\n  - path: separate  \n  - path: proto/shared/\n    excludes:\n      - proto/shared/prefix/bar\n  - path: proto/shared1\n    excludes:\n      - proto/shared1/prefix/x\ndeps:\n  - buf.testing/acme/date\n  - buf.testing/acme/extension\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2_duplicate_path/proto/shared/prefix/bar/v1/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix.bar.v1;\n\nimport \"acme/extension/v1/extension.proto\";\n\nmessage Bar {\n  option (acme.extension.v1.experimental) = true;\n  string name = 1;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2_duplicate_path/proto/shared/prefix/foo/v1/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix.foo.v1;\n\nimport \"acme/date/v1/date.proto\";\nimport \"prefix/bar/v1/bar.proto\";\n\nmessage Foo {\n  acme.date.v1.Date date = 1;\n  prefix.bar.v1.Bar bar = 2;\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2_duplicate_path/proto/shared1/prefix/x/x.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix;\n\nmessage X {}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2_duplicate_path/proto/shared1/prefix/y/y.proto",
    "content": "syntax = \"proto3\";\n\npackage prefix;\n\nmessage Y {}\n"
  },
  {
    "path": "private/buf/bufworkspace/testdata/basic/workspacev2_duplicate_path/separate/v1/separate.proto",
    "content": "syntax = \"proto3\";\n\npackage separate.v1;\n\nmessage Separate {}\n"
  },
  {
    "path": "private/buf/bufworkspace/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufworkspace\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/buf/bufworkspace/workspace.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"maps\"\n\t\"slices\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n)\n\n// Workspace is a buf workspace.\n//\n// It is a bufmodule.ModuleSet with associated configuration.\n//\n// See ModuleSet helper functions for many of your needs. Some examples:\n//\n//   - bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles\n//   - bufmodule.ModuleSetToTargetModules\n//   - bufmodule.ModuleSetRemoteDepsOfLocalModules - gives you exact deps to put in buf.lock\n//\n// To get a specific file from a Workspace:\n//\n//\tmoduleReadBucket := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(workspace)\n//\tfileInfo, err := moduleReadBucket.GetFileInfo(ctx, path)\ntype Workspace interface {\n\tbufmodule.ModuleSet\n\n\t// GetLintConfigForOpaqueID gets the LintConfig for the OpaqueID, if the OpaqueID\n\t// represents a Module within the workspace.\n\t//\n\t// This will be the default value for Modules that didn't have an associated config,\n\t// such as Modules read from buf.lock files. These Modules will not be target Modules\n\t// in the workspace. This should result in items such as the linter or breaking change\n\t// detector ignoring these configs anyways.\n\t//\n\t// Returns nil if there is no Module with the given OpaqueID. However, as long\n\t// as the OpaqueID came from a Module contained within Modules(), this will always\n\t// return a non-nil value.\n\t//\n\t// Note that we originally designed exposing of Configs as:\n\t//\n\t//   type WorkspaceModule interface {\n\t//     bufmodule.Module\n\t//     LintConfig() LintConfig\n\t//   }\n\t//\n\t// However, this would mean that Workspace would not inherit ModuleSet, as we'd\n\t// want to create GetWorkspaceModule.* functions instead of GetModule.* functions,\n\t// and then provide a WorkspaceToModuleSet global function. This seems messier in\n\t// practice than having users call GetLintConfigForOpaqueID(module.OpaqueID())\n\t// in the situations where they need configuration.\n\tGetLintConfigForOpaqueID(opaqueID string) bufconfig.LintConfig\n\t// GetBreakingConfigForOpaqueID gets the BreakingConfig for the OpaqueID, if the OpaqueID\n\t// represents a Module within the workspace.\n\t//\n\t// This will be the default value for Modules that didn't have an associated config,\n\t// such as Modules read from buf.lock files. These Modules will not be target Modules\n\t// in the workspace. This should result in items such as the linter or breaking change\n\t// detector ignoring these configs anyways.\n\tGetBreakingConfigForOpaqueID(opaqueID string) bufconfig.BreakingConfig\n\t// PluginConfigs gets the configured PluginConfigs of the Workspace.\n\t//\n\t// These come from the buf.lock file. Only v2 supports plugins.\n\tPluginConfigs() []bufconfig.PluginConfig\n\t// RemotePluginKeys gets the remote PluginKeys of the Workspace.\n\t//\n\t// These come from the buf.lock file. Only v2 supports plugins.\n\tRemotePluginKeys() []bufplugin.PluginKey\n\t// PolicyConfigs gets the configured PolicyConfigs of the Workspace.\n\t//\n\t// These come from the buf.yaml files.\n\tPolicyConfigs() []bufconfig.PolicyConfig\n\t// RemotePolicyKeys gets the remote PolicyKeys of the Workspace.\n\t//\n\t// These come from the buf.lock file. Only v2 supports policies.\n\tRemotePolicyKeys() []bufpolicy.PolicyKey\n\t// PolicyNameToRemotePluginKeys gets a map of policy names to remote PluginKeys.\n\t//\n\t// These come from the buf.lock file. Only v2 supports policies.\n\tPolicyNameToRemotePluginKeys() map[string][]bufplugin.PluginKey\n\t// ConfiguredDepModuleRefs returns the configured dependencies of the Workspace as Refs.\n\t//\n\t// These come from buf.yaml files.\n\t//\n\t// The ModuleRefs in this list will be unique by FullName. If there are two ModuleRefs\n\t// in the buf.yaml with the same FullName but different Refs, an error will be given\n\t// at workspace constructions. For example, with v1 buf.yaml, this is a union of the deps in\n\t// the buf.yaml files in the workspace. If different buf.yamls had different refs, an error\n\t// will be returned - we have no way to resolve what the user intended.\n\t//\n\t// Sorted.\n\tConfiguredDepModuleRefs() []bufparse.Ref\n\n\t// IsV2 signifies if this module was created from a v2 buf.yaml.\n\t//\n\t// THIS SHOULD ONLY BE USED IN EXTREMELY LIMITED SITUATIONS. The codebase should generally\n\t// handle v1 vs v2 transparently. Right now, this is only approved to be used in push\n\t// when we want to know whether we need to print out only CommitIDs. Any other usages\n\t// need to be evaluated.\n\tIsV2() bool\n\n\tisWorkspace()\n}\n\n// *** PRIVATE ***\n\ntype workspace struct {\n\tbufmodule.ModuleSet\n\n\topaqueIDToLintConfig         map[string]bufconfig.LintConfig\n\topaqueIDToBreakingConfig     map[string]bufconfig.BreakingConfig\n\tpluginConfigs                []bufconfig.PluginConfig\n\tremotePluginKeys             []bufplugin.PluginKey\n\tpolicyConfigs                []bufconfig.PolicyConfig\n\tremotePolicyKeys             []bufpolicy.PolicyKey\n\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey\n\tconfiguredDepModuleRefs      []bufparse.Ref\n\n\t// If true, the workspace was created from v2 buf.yamls.\n\t// If false, the workspace was created from defaults, or v1beta1/v1 buf.yamls.\n\tisV2 bool\n}\n\nfunc newWorkspace(\n\tmoduleSet bufmodule.ModuleSet,\n\topaqueIDToLintConfig map[string]bufconfig.LintConfig,\n\topaqueIDToBreakingConfig map[string]bufconfig.BreakingConfig,\n\tpluginConfigs []bufconfig.PluginConfig,\n\tremotePluginKeys []bufplugin.PluginKey,\n\tpolicyConfigs []bufconfig.PolicyConfig,\n\tremotePolicyKeys []bufpolicy.PolicyKey,\n\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey,\n\tconfiguredDepModuleRefs []bufparse.Ref,\n\tisV2 bool,\n) *workspace {\n\treturn &workspace{\n\t\tModuleSet:                    moduleSet,\n\t\topaqueIDToLintConfig:         opaqueIDToLintConfig,\n\t\topaqueIDToBreakingConfig:     opaqueIDToBreakingConfig,\n\t\tpluginConfigs:                pluginConfigs,\n\t\tremotePluginKeys:             remotePluginKeys,\n\t\tpolicyConfigs:                policyConfigs,\n\t\tremotePolicyKeys:             remotePolicyKeys,\n\t\tpolicyNameToRemotePluginKeys: policyNameToRemotePluginKeys,\n\t\tconfiguredDepModuleRefs:      configuredDepModuleRefs,\n\t\tisV2:                         isV2,\n\t}\n}\n\nfunc (w *workspace) GetLintConfigForOpaqueID(opaqueID string) bufconfig.LintConfig {\n\treturn w.opaqueIDToLintConfig[opaqueID]\n}\n\nfunc (w *workspace) GetBreakingConfigForOpaqueID(opaqueID string) bufconfig.BreakingConfig {\n\treturn w.opaqueIDToBreakingConfig[opaqueID]\n}\n\nfunc (w *workspace) PluginConfigs() []bufconfig.PluginConfig {\n\treturn slices.Clone(w.pluginConfigs)\n}\n\nfunc (w *workspace) RemotePluginKeys() []bufplugin.PluginKey {\n\treturn slices.Clone(w.remotePluginKeys)\n}\n\nfunc (w *workspace) PolicyConfigs() []bufconfig.PolicyConfig {\n\treturn slices.Clone(w.policyConfigs)\n}\n\nfunc (w *workspace) RemotePolicyKeys() []bufpolicy.PolicyKey {\n\treturn slices.Clone(w.remotePolicyKeys)\n}\n\nfunc (w *workspace) PolicyNameToRemotePluginKeys() map[string][]bufplugin.PluginKey {\n\treturn maps.Clone(w.policyNameToRemotePluginKeys)\n}\n\nfunc (w *workspace) ConfiguredDepModuleRefs() []bufparse.Ref {\n\treturn slices.Clone(w.configuredDepModuleRefs)\n}\n\nfunc (w *workspace) IsV2() bool {\n\treturn w.isV2\n}\n\nfunc (*workspace) isWorkspace() {}\n"
  },
  {
    "path": "private/buf/bufworkspace/workspace_dep_manager.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\t\"sort\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// WorkspaceDepManager is a workspace that can be updated.\n//\n// A workspace can be updated if it was backed by a v2 buf.yaml, or a single, targeted, local\n// Module from defaults or a v1beta1/v1 buf.yaml exists in the Workspace. Config overrides\n// can also not be used, but this is enforced via the WorkspaceBucketOption/WorkspaceDepManagerBucketOption\n// difference.\n//\n// buf.work.yamls are ignored when constructing an WorkspaceDepManager.\ntype WorkspaceDepManager interface {\n\t// BufLockFileDigestType returns the DigestType that the buf.lock file expects.\n\tBufLockFileDigestType() bufmodule.DigestType\n\t// ExistingBufLockFileDepModuleKeys returns the ModuleKeys from the buf.lock file.\n\tExistingBufLockFileDepModuleKeys(ctx context.Context) ([]bufmodule.ModuleKey, error)\n\t// ExistingBufLockFileRemotePluginKeys returns the PluginKeys from the buf.lock file.\n\tExistingBufLockFileRemotePluginKeys(ctx context.Context) ([]bufplugin.PluginKey, error)\n\t// ExistingBufLockFileRemotePolicyKeys returns the PolicyKeys from the buf.lock file.\n\tExistingBufLockFileRemotePolicyKeys(ctx context.Context) ([]bufpolicy.PolicyKey, error)\n\t// ExistingBufLockFilePolicyNameToRemotePluginKeys returns the PluginKeys for each Policy name from the buf.lock file.\n\tExistingBufLockFilePolicyNameToRemotePluginKeys(ctx context.Context) (map[string][]bufplugin.PluginKey, error)\n\t// UpdateBufLockFile updates the lock file that backs the Workspace to contain exactly\n\t// the given ModuleKeys and PluginKeys.\n\t//\n\t// If a buf.lock does not exist, one will be created.\n\tUpdateBufLockFile(\n\t\tctx context.Context,\n\t\tdepModuleKeys []bufmodule.ModuleKey,\n\t\tremotePluginKeys []bufplugin.PluginKey,\n\t\tremotePolicyKeys []bufpolicy.PolicyKey,\n\t\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey,\n\t) error\n\t// ConfiguredDepModuleRefs returns the configured dependencies of the Workspace as ModuleRefs.\n\t//\n\t// These come from buf.yaml files.\n\t//\n\t// The ModuleRefs in this list will be unique by FullName. If there are two ModuleRefs\n\t// in the buf.yaml with the same FullName but different Refs, an error will be given\n\t// at workspace constructions. For example, with v1 buf.yaml, this is a union of the deps in\n\t// the buf.yaml files in the workspace. If different buf.yamls had different refs, an error\n\t// will be returned - we have no way to resolve what the user intended.\n\t//\n\t// Sorted.\n\tConfiguredDepModuleRefs(ctx context.Context) ([]bufparse.Ref, error)\n\t// ConfiguredRemotePluginRefs returns the configured remote plugins of the Workspace as PluginRefs.\n\t//\n\t// These come from buf.yaml files.\n\t//\n\t// The PluginRefs in this list will be unique by FullName. If there are two PluginRefs\n\t// in the buf.yaml with the same FullName but different Refs, an error will be given\n\t// at workspace constructions.\n\t//\n\t// Sorted.\n\tConfiguredRemotePluginRefs(ctx context.Context) ([]bufparse.Ref, error)\n\t// ConfiguredRemotePolicyRefs returns the configured remote plugins of the Workspace as PolicyRefs.\n\t//\n\t// These come from buf.yaml files.\n\t//\n\t// The PolicyRefs in this list will be unique by FullName. If there are two PolicyRefs\n\t// in the buf.yaml with the same FullName but different Refs, an error will be given\n\t// at workspace constructions.\n\t//\n\t// Sorted.\n\tConfiguredRemotePolicyRefs(ctx context.Context) ([]bufparse.Ref, error)\n\t// ConfiguredLocalPolicyNameToRemotePluginRefs returns the configured remote plugins for each local policy of the Workspace.\n\t//\n\t// These come from buf.yaml files and the local buf.policy.yaml files.\n\t//\n\t// The PluginRefs for each Policy will be unique by FullName. If there are two PluginRefs\n\t// in the buf.yaml for a given Policy with the same FullName but different Refs, an error will be given\n\t// at workspace constructions.\n\t//\n\t// PluginRefs are sorted for each Policy.\n\tConfiguredLocalPolicyNameToRemotePluginRefs(ctx context.Context) (map[string][]bufparse.Ref, error)\n\n\tisWorkspaceDepManager()\n}\n\n// *** PRIVATE ***\n\ntype workspaceDepManager struct {\n\tbucket storage.ReadWriteBucket\n\t// targetSubDirPath is the relative path within the bucket where a buf.yaml file should be and where a\n\t// buf.lock can be written.\n\t//\n\t// If isV2 is true, this will be \".\" - buf.yamls and buf.locks live at the root of the workspace.\n\t//\n\t// If isV2 is false, this will be the path to the single, local, targeted Module within the workspace\n\t// This is the only situation where we can do an update for a v1 buf.lock.\n\ttargetSubDirPath string\n\t// If true, the workspace was created from v2 buf.yamls\n\t//\n\t// If false, the workspace was created from defaults, or v1beta1/v1 buf.yamls.\n\t//\n\t// This is used to determine what DigestType to use, and what version\n\t// of buf.lock to write.\n\tisV2 bool\n}\n\nfunc newWorkspaceDepManager(\n\tbucket storage.ReadWriteBucket,\n\ttargetSubDirPath string,\n\tisV2 bool,\n) *workspaceDepManager {\n\treturn &workspaceDepManager{\n\t\tbucket:           bucket,\n\t\ttargetSubDirPath: targetSubDirPath,\n\t\tisV2:             isV2,\n\t}\n}\n\nfunc (w *workspaceDepManager) ConfiguredDepModuleRefs(ctx context.Context) ([]bufparse.Ref, error) {\n\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif bufYAMLFile == nil {\n\t\treturn nil, nil\n\t}\n\tswitch fileVersion := bufYAMLFile.FileVersion(); fileVersion {\n\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\tif w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v1beta1, v1\", w.targetSubDirPath, fileVersion)\n\t\t}\n\tcase bufconfig.FileVersionV2:\n\t\tif !w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v2\", w.targetSubDirPath, fileVersion)\n\t\t}\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n\treturn bufYAMLFile.ConfiguredDepModuleRefs(), nil\n}\n\nfunc (w *workspaceDepManager) ConfiguredRemotePluginRefs(ctx context.Context) ([]bufparse.Ref, error) {\n\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif bufYAMLFile == nil {\n\t\treturn nil, nil\n\t}\n\tswitch fileVersion := bufYAMLFile.FileVersion(); fileVersion {\n\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\tif w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v1beta1, v1\", w.targetSubDirPath, fileVersion)\n\t\t}\n\t\t// Plugins are not supported in versions less than v2.\n\t\treturn nil, nil\n\tcase bufconfig.FileVersionV2:\n\t\tif !w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v2\", w.targetSubDirPath, fileVersion)\n\t\t}\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n\tpluginRefs := xslices.Filter(\n\t\txslices.Map(\n\t\t\tbufYAMLFile.PluginConfigs(),\n\t\t\tfunc(value bufconfig.PluginConfig) bufparse.Ref {\n\t\t\t\treturn value.Ref()\n\t\t\t},\n\t\t),\n\t\tfunc(value bufparse.Ref) bool {\n\t\t\treturn value != nil\n\t\t},\n\t)\n\tsort.Slice(\n\t\tpluginRefs,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn pluginRefs[i].FullName().String() < pluginRefs[j].FullName().String()\n\t\t},\n\t)\n\treturn pluginRefs, nil\n}\n\nfunc (w *workspaceDepManager) ConfiguredRemotePolicyRefs(ctx context.Context) ([]bufparse.Ref, error) {\n\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif bufYAMLFile == nil {\n\t\treturn nil, nil\n\t}\n\tswitch fileVersion := bufYAMLFile.FileVersion(); fileVersion {\n\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\tif w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v1beta1, v1\", w.targetSubDirPath, fileVersion)\n\t\t}\n\t\t// Policys are not supported in versions less than v2.\n\t\treturn nil, nil\n\tcase bufconfig.FileVersionV2:\n\t\tif !w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v2\", w.targetSubDirPath, fileVersion)\n\t\t}\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n\tpolicyRefs := xslices.Filter(\n\t\txslices.Map(\n\t\t\tbufYAMLFile.PolicyConfigs(),\n\t\t\tfunc(value bufconfig.PolicyConfig) bufparse.Ref {\n\t\t\t\treturn value.Ref()\n\t\t\t},\n\t\t),\n\t\tfunc(value bufparse.Ref) bool {\n\t\t\treturn value != nil\n\t\t},\n\t)\n\tsort.Slice(\n\t\tpolicyRefs,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn policyRefs[i].FullName().String() < policyRefs[j].FullName().String()\n\t\t},\n\t)\n\treturn policyRefs, nil\n}\n\nfunc (w *workspaceDepManager) ConfiguredLocalPolicyNameToRemotePluginRefs(ctx context.Context) (map[string][]bufparse.Ref, error) {\n\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif bufYAMLFile == nil {\n\t\treturn nil, nil\n\t}\n\tswitch fileVersion := bufYAMLFile.FileVersion(); fileVersion {\n\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\tif w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v1beta1, v1\", w.targetSubDirPath, fileVersion)\n\t\t}\n\t\t// Policys are not supported in versions less than v2.\n\t\treturn nil, nil\n\tcase bufconfig.FileVersionV2:\n\t\tif !w.isV2 {\n\t\t\treturn nil, syserror.Newf(\"buf.yaml at %q did had version %v but expected v2\", w.targetSubDirPath, fileVersion)\n\t\t}\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n\tlocalPolicyNameToRemotePluginRefs := make(map[string][]bufparse.Ref)\n\tfor _, policyConfig := range bufYAMLFile.PolicyConfigs() {\n\t\tif policyConfig.Ref() != nil {\n\t\t\tcontinue // Only local policies refs are considered here.\n\t\t}\n\t\tlocalPolicyName := policyConfig.Name()\n\t\tbufPolicyFile, err := bufpolicyconfig.GetBufPolicyYAMLFile(ctx, w.bucket, localPolicyName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginRefs := xslices.Filter(\n\t\t\txslices.Map(\n\t\t\t\tbufPolicyFile.PluginConfigs(),\n\t\t\t\tfunc(value bufpolicy.PluginConfig) bufparse.Ref {\n\t\t\t\t\treturn value.Ref()\n\t\t\t\t},\n\t\t\t),\n\t\t\tfunc(value bufparse.Ref) bool {\n\t\t\t\treturn value != nil\n\t\t\t},\n\t\t)\n\t\tsort.Slice(\n\t\t\tpluginRefs,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn pluginRefs[i].FullName().String() < pluginRefs[j].FullName().String()\n\t\t\t},\n\t\t)\n\t\tlocalPolicyNameToRemotePluginRefs[localPolicyName] = pluginRefs\n\t}\n\treturn localPolicyNameToRemotePluginRefs, nil\n}\n\nfunc (w *workspaceDepManager) BufLockFileDigestType() bufmodule.DigestType {\n\tif w.isV2 {\n\t\treturn bufmodule.DigestTypeB5\n\t}\n\treturn bufmodule.DigestTypeB4\n}\n\nfunc (w *workspaceDepManager) ExistingBufLockFileDepModuleKeys(ctx context.Context) ([]bufmodule.ModuleKey, error) {\n\tbufLockFile, err := bufconfig.GetBufLockFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn bufLockFile.DepModuleKeys(), nil\n}\n\nfunc (w *workspaceDepManager) ExistingBufLockFileRemotePluginKeys(ctx context.Context) ([]bufplugin.PluginKey, error) {\n\tbufLockFile, err := bufconfig.GetBufLockFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn bufLockFile.RemotePluginKeys(), nil\n}\n\nfunc (w *workspaceDepManager) ExistingBufLockFileRemotePolicyKeys(ctx context.Context) ([]bufpolicy.PolicyKey, error) {\n\tbufLockFile, err := bufconfig.GetBufLockFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn bufLockFile.RemotePolicyKeys(), nil\n}\n\nfunc (w *workspaceDepManager) ExistingBufLockFilePolicyNameToRemotePluginKeys(ctx context.Context) (map[string][]bufplugin.PluginKey, error) {\n\tbufLockFile, err := bufconfig.GetBufLockFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn bufLockFile.PolicyNameToRemotePluginKeys(), nil\n}\n\nfunc (w *workspaceDepManager) UpdateBufLockFile(ctx context.Context, depModuleKeys []bufmodule.ModuleKey, remotePluginKeys []bufplugin.PluginKey, remotePolicyKeys []bufpolicy.PolicyKey, policyNameToRemotePluginKeys map[string][]bufplugin.PluginKey) error {\n\tvar bufLockFile bufconfig.BufLockFile\n\tvar err error\n\tif w.isV2 {\n\t\tbufLockFile, err = bufconfig.NewBufLockFile(\n\t\t\tbufconfig.FileVersionV2,\n\t\t\tdepModuleKeys,\n\t\t\tremotePluginKeys,\n\t\t\tremotePolicyKeys,\n\t\t\tpolicyNameToRemotePluginKeys,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tfileVersion := bufconfig.FileVersionV1\n\t\texistingBufYAMLFile, err := bufconfig.GetBufYAMLFileForPrefix(ctx, w.bucket, w.targetSubDirPath)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tfileVersion = existingBufYAMLFile.FileVersion()\n\t\t}\n\t\tif len(remotePluginKeys) > 0 {\n\t\t\treturn syserror.Newf(\"remote plugins are not supported for v1 buf.yaml files\")\n\t\t}\n\t\tbufLockFile, err = bufconfig.NewBufLockFile(fileVersion, depModuleKeys, nil, nil, nil)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn bufconfig.PutBufLockFileForPrefix(ctx, w.bucket, w.targetSubDirPath, bufLockFile)\n}\n\nfunc (*workspaceDepManager) isWorkspaceDepManager() {}\n"
  },
  {
    "path": "private/buf/bufworkspace/workspace_dep_manager_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// WorkspaceDepManagerProvider provides WorkspaceDepManagers.\ntype WorkspaceDepManagerProvider interface {\n\t// GetWorkspaceDepManager returns a new WorkspaceDepManager for the given Bucket.\n\t//\n\t// If the workspace is not updateable, an error is returned.\n\t//\n\t// If the underlying bucket has a v2 buf.yaml at the root, this builds a WorkspaceDepManager for this buf.yaml,\n\t// using TargetSubDirPath for targeting.\n\t//\n\t// Otherwise, this builds a Workspace with a single module at the TargetSubDirPath (which may be \".\"), ignoring buf.work.yamls.\n\t// Directories with buf.work.yamls cannot be directly targeted.\n\t//\n\t// Note this is the same logic as if WithIgnoreAndDisallowV1BufWorkYAMLs is applied with WorkspaceProvider!! If you want an equivalent\n\t// Workspace, you need to use this option!\n\t//\n\t// All parsing of configuration files is done behind the scenes here.\n\tGetWorkspaceDepManager(\n\t\tctx context.Context,\n\t\tbucket storage.ReadWriteBucket,\n\t\tbucketTargeting buftarget.BucketTargeting,\n\t) (WorkspaceDepManager, error)\n}\n\n// NewWorkspaceDepManagerProvider returns a new WorkspaceDepManagerProvider.\nfunc NewWorkspaceDepManagerProvider(\n\tlogger *slog.Logger,\n) WorkspaceDepManagerProvider {\n\treturn newWorkspaceDepManagerProvider(\n\t\tlogger,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype workspaceDepManagerProvider struct {\n\tlogger *slog.Logger\n}\n\nfunc newWorkspaceDepManagerProvider(\n\tlogger *slog.Logger,\n) *workspaceDepManagerProvider {\n\treturn &workspaceDepManagerProvider{\n\t\tlogger: logger,\n\t}\n}\n\nfunc (w *workspaceDepManagerProvider) GetWorkspaceDepManager(\n\tctx context.Context,\n\tbucket storage.ReadWriteBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n) (_ WorkspaceDepManager, retErr error) {\n\tcontrollingWorkspace := bucketTargeting.ControllingWorkspace()\n\tif controllingWorkspace != nil && controllingWorkspace.BufYAMLFile() != nil {\n\t\t// A v2 workspace was found, but we make sure\n\t\tbufYAMLFile := controllingWorkspace.BufYAMLFile()\n\t\tif bufYAMLFile.FileVersion() == bufconfig.FileVersionV2 {\n\t\t\treturn newWorkspaceDepManager(bucket, controllingWorkspace.Path(), true), nil\n\t\t}\n\t}\n\t// Otherwise we simply ignore any buf.work.yaml that was found and attempt to build\n\t// a v1 module at the SubDirPath\n\treturn newWorkspaceDepManager(bucket, bucketTargeting.SubDirPath(), false), nil\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/workspace_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\n// WorkspaceProvider provides Workspaces and UpdateableWorkspaces.\ntype WorkspaceProvider interface {\n\t// GetWorkspaceForBucket returns a new Workspace for the given Bucket.\n\t//\n\t// If the underlying bucket has a v2 buf.yaml at the root, this builds a Workspace for this buf.yaml,\n\t// using TargetSubDirPath for targeting.\n\t//\n\t// If the underlying bucket has a buf.work.yaml at the root, this builds a Workspace with all the modules\n\t// specified in the buf.work.yaml, using TargetSubDirPath for targeting.\n\t//\n\t// Otherwise, this builds a Workspace with a single module at the TargetSubDirPath (which may be \".\"),\n\t// assuming v1 defaults.\n\t//\n\t// If a config override is specified, all buf.work.yamls are ignored. If the config override is v1,\n\t// this builds a single module at the TargetSubDirPath, if the config override is v2, the builds\n\t// at the root, using TargetSubDirPath for targeting.\n\t//\n\t// All parsing of configuration files is done behind the scenes here.\n\tGetWorkspaceForBucket(\n\t\tctx context.Context,\n\t\tbucket storage.ReadBucket,\n\t\tbucketTargeting buftarget.BucketTargeting,\n\t\toptions ...WorkspaceBucketOption,\n\t) (Workspace, error)\n\n\t// GetWorkspaceForModuleKey wraps the ModuleKey into a workspace, returning defaults\n\t// for config values, and empty ConfiguredDepModuleRefs.\n\t//\n\t// This is useful for getting Workspaces for remote modules, but you still need\n\t// associated configuration.\n\tGetWorkspaceForModuleKey(\n\t\tctx context.Context,\n\t\tmoduleKey bufmodule.ModuleKey,\n\t\toptions ...WorkspaceModuleKeyOption,\n\t) (Workspace, error)\n}\n\n// NewWorkspaceProvider returns a new WorkspaceProvider.\nfunc NewWorkspaceProvider(\n\tlogger *slog.Logger,\n\tgraphProvider bufmodule.GraphProvider,\n\tmoduleDataProvider bufmodule.ModuleDataProvider,\n\tcommitProvider bufmodule.CommitProvider,\n\tpluginKeyProvider bufplugin.PluginKeyProvider,\n) WorkspaceProvider {\n\treturn newWorkspaceProvider(\n\t\tlogger,\n\t\tgraphProvider,\n\t\tmoduleDataProvider,\n\t\tcommitProvider,\n\t\tpluginKeyProvider,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype workspaceProvider struct {\n\tlogger             *slog.Logger\n\tgraphProvider      bufmodule.GraphProvider\n\tmoduleDataProvider bufmodule.ModuleDataProvider\n\tcommitProvider     bufmodule.CommitProvider\n\n\t// pluginKeyProvider is only used for getting remote plugin keys for a single module\n\t// when an override is specified.\n\tpluginKeyProvider bufplugin.PluginKeyProvider\n}\n\nfunc newWorkspaceProvider(\n\tlogger *slog.Logger,\n\tgraphProvider bufmodule.GraphProvider,\n\tmoduleDataProvider bufmodule.ModuleDataProvider,\n\tcommitProvider bufmodule.CommitProvider,\n\tpluginKeyProvider bufplugin.PluginKeyProvider,\n) *workspaceProvider {\n\treturn &workspaceProvider{\n\t\tlogger:             logger,\n\t\tgraphProvider:      graphProvider,\n\t\tmoduleDataProvider: moduleDataProvider,\n\t\tcommitProvider:     commitProvider,\n\t\tpluginKeyProvider:  pluginKeyProvider,\n\t}\n}\n\nfunc (w *workspaceProvider) GetWorkspaceForModuleKey(\n\tctx context.Context,\n\tmoduleKey bufmodule.ModuleKey,\n\toptions ...WorkspaceModuleKeyOption,\n) (Workspace, error) {\n\tdefer xslog.DebugProfile(w.logger)()\n\n\tconfig, err := newWorkspaceModuleKeyConfig(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// By default, the associated configuration for a Module gotten by ModuleKey is just\n\t// the default config. However, if we have a config override, we may have different\n\t// lint or breaking config. We will only apply this different config for the specific\n\t// module we are targeting, while the rest will retain the default config - generally,\n\t// you shouldn't be linting or doing breaking change detection for any module other\n\t// than the one your are targeting (which matches v1 behavior as well). In v1, we didn't\n\t// have a \"workspace\" for modules gotten by module reference, we just had the single\n\t// module we were building against, and whatever config override we had only applied\n\t// to that module. In v2, we have a ModuleSet, and we need lint and breaking config\n\t// for every modules in the ModuleSet, so we attach default lint and breaking config,\n\t// but given the presence of ignore_only, we don't want to apply configOverride to\n\t// non-target modules as the config override might have file paths, and we won't\n\t// lint or breaking change detect against non-target modules anyways.\n\ttargetModuleConfig := bufconfig.DefaultModuleConfigV1\n\t// By default, there will be no plugin configs, however, similar to the lint and breaking\n\t// configs, there may be an override, in which case, we need to populate the plugin configs\n\t// from the override. Any remote plugin refs will be resolved by the pluginKeyProvider.\n\tvar (\n\t\tpluginConfigs    []bufconfig.PluginConfig\n\t\tremotePluginKeys []bufplugin.PluginKey\n\t)\n\tif config.configOverride != \"\" {\n\t\tbufYAMLFile, err := bufconfig.GetBufYAMLFileForOverride(config.configOverride)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\t\tswitch len(moduleConfigs) {\n\t\tcase 0:\n\t\t\treturn nil, syserror.New(\"had BufYAMLFile with 0 ModuleConfigs\")\n\t\tcase 1:\n\t\t\t// If we have a single ModuleConfig, we assume that regardless of whether or not\n\t\t\t// This ModuleConfig has a name, that this is what the user intends to associate\n\t\t\t// with the target module. This also handles the v1 case - v1 buf.yamls will always\n\t\t\t// only have a single ModuleConfig, and it was expected pre-refactor that regardless\n\t\t\t// of if the ModuleConfig had a name associated with it or not, the lint and breaking\n\t\t\t// config that came from it would be associated.\n\t\t\ttargetModuleConfig = moduleConfigs[0]\n\t\tdefault:\n\t\t\t// If we have more than one ModuleConfig, find the ModuleConfig that matches the\n\t\t\t// name from the ModuleKey. If none is found, just fall back to the default (ie do nothing here).\n\t\t\tfor _, moduleConfig := range moduleConfigs {\n\t\t\t\tmoduleFullName := moduleConfig.FullName()\n\t\t\t\tif moduleFullName == nil {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif bufparse.FullNameEqual(moduleFullName, moduleKey.FullName()) {\n\t\t\t\t\ttargetModuleConfig = moduleConfig\n\t\t\t\t\t// We know that the ModuleConfigs are unique by FullName.\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif bufYAMLFile.FileVersion() == bufconfig.FileVersionV2 {\n\t\t\tpluginConfigs = bufYAMLFile.PluginConfigs()\n\t\t\t// To support remote plugins when using a config override, we need to resolve the remote\n\t\t\t// Refs to PluginKeys. We use the pluginKeyProvider to resolve any remote plugin Refs.\n\t\t\tremotePluginRefs := xslices.Filter(\n\t\t\t\txslices.Map(pluginConfigs, func(pluginConfig bufconfig.PluginConfig) bufparse.Ref {\n\t\t\t\t\treturn pluginConfig.Ref()\n\t\t\t\t}),\n\t\t\t\tfunc(ref bufparse.Ref) bool {\n\t\t\t\t\treturn ref != nil\n\t\t\t\t},\n\t\t\t)\n\t\t\tif len(remotePluginRefs) > 0 {\n\t\t\t\tvar err error\n\t\t\t\tremotePluginKeys, err = w.pluginKeyProvider.GetPluginKeysForPluginRefs(\n\t\t\t\t\tctx,\n\t\t\t\t\tremotePluginRefs,\n\t\t\t\t\tbufplugin.DigestTypeP1,\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}\n\t\t\t// TODO: Supporting Policies for ModuleKeys requires resolving each policies remote\n\t\t\t// plugins.  This is not currently supported. Instead of requiring the resolved Keys for\n\t\t\t// the workspace, passing resolvers for the remote refs would allow for lazy resolution.\n\t\t\tpolicyConfigs := bufYAMLFile.PolicyConfigs()\n\t\t\tif len(policyConfigs) > 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"policies are not supported for ModuleKeys\")\n\t\t\t}\n\t\t}\n\t}\n\n\tmoduleSet, err := bufmodule.NewModuleSetForRemoteModule(\n\t\tctx,\n\t\tw.logger,\n\t\tw.graphProvider,\n\t\tw.moduleDataProvider,\n\t\tw.commitProvider,\n\t\tmoduleKey,\n\t\tbufmodule.RemoteModuleWithTargetPaths(\n\t\t\tconfig.targetPaths,\n\t\t\tconfig.targetExcludePaths,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topaqueIDToLintConfig := make(map[string]bufconfig.LintConfig)\n\topaqueIDToBreakingConfig := make(map[string]bufconfig.BreakingConfig)\n\tfor _, module := range moduleSet.Modules() {\n\t\tif bufparse.FullNameEqual(module.FullName(), moduleKey.FullName()) {\n\t\t\t// Set the lint and breaking config for the single targeted Module.\n\t\t\topaqueIDToLintConfig[module.OpaqueID()] = targetModuleConfig.LintConfig()\n\t\t\topaqueIDToBreakingConfig[module.OpaqueID()] = targetModuleConfig.BreakingConfig()\n\t\t} else {\n\t\t\t// For all non-targets, set the default lint and breaking config.\n\t\t\topaqueIDToLintConfig[module.OpaqueID()] = bufconfig.DefaultLintConfigV1\n\t\t\topaqueIDToBreakingConfig[module.OpaqueID()] = bufconfig.DefaultBreakingConfigV1\n\t\t}\n\t}\n\treturn newWorkspace(\n\t\tmoduleSet,\n\t\topaqueIDToLintConfig,\n\t\topaqueIDToBreakingConfig,\n\t\tpluginConfigs,\n\t\tremotePluginKeys,\n\t\tnil, // PolicyConfigs are not supported for ModuleKeys\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tfalse,\n\t), nil\n}\n\nfunc (w *workspaceProvider) getWorkspaceTargetingForBucket(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n\toptions ...WorkspaceBucketOption,\n) (*workspaceTargeting, error) {\n\tconfig, err := newWorkspaceBucketConfig(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar overrideBufYAMLFile bufconfig.BufYAMLFile\n\tif config.configOverride != \"\" {\n\t\toverrideBufYAMLFile, err = bufconfig.GetBufYAMLFileForOverride(config.configOverride)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn newWorkspaceTargeting(\n\t\tctx,\n\t\tw.logger,\n\t\tconfig,\n\t\tbucket,\n\t\tbucketTargeting,\n\t\toverrideBufYAMLFile,\n\t\tconfig.ignoreAndDisallowV1BufWorkYAMLs,\n\t)\n}\n\nfunc (w *workspaceProvider) GetWorkspaceForBucket(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n\toptions ...WorkspaceBucketOption,\n) (Workspace, error) {\n\tdefer xslog.DebugProfile(w.logger)()\n\tworkspaceTargeting, err := w.getWorkspaceTargetingForBucket(\n\t\tctx,\n\t\tbucket,\n\t\tbucketTargeting,\n\t\toptions...,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif workspaceTargeting.v2 != nil {\n\t\treturn w.getWorkspaceForBucketBufYAMLV2(\n\t\t\tctx,\n\t\t\tbucket,\n\t\t\tworkspaceTargeting.v2,\n\t\t)\n\t}\n\treturn w.getWorkspaceForBucketAndModuleDirPathsV1Beta1OrV1(\n\t\tctx,\n\t\tbucket,\n\t\tworkspaceTargeting.v1,\n\t)\n}\n\nfunc (w *workspaceProvider) getWorkspaceForBucketAndModuleDirPathsV1Beta1OrV1(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tv1WorkspaceTargeting *v1Targeting,\n) (*workspace, error) {\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, w.logger, w.moduleDataProvider, w.commitProvider)\n\tfor _, moduleBucketAndTargeting := range v1WorkspaceTargeting.moduleBucketsAndTargeting {\n\t\tmappedModuleBucket := moduleBucketAndTargeting.bucket\n\t\tmoduleTargeting := moduleBucketAndTargeting.moduleTargeting\n\t\tbufLockFile, err := bufconfig.GetBufLockFileForPrefix(\n\t\t\tctx,\n\t\t\tbucket, // Need to use the non-mapped bucket since the mapped bucket excludes the buf.lock\n\t\t\tmoduleTargeting.moduleDirPath,\n\t\t\tbufconfig.BufLockFileWithDigestResolver(\n\t\t\t\tfunc(ctx context.Context, remote string, commitID uuid.UUID) (bufmodule.Digest, error) {\n\t\t\t\t\tcommitKey, err := bufmodule.NewCommitKey(remote, commitID, bufmodule.DigestTypeB4)\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\tcommits, err := w.commitProvider.GetCommitsForCommitKeys(ctx, []bufmodule.CommitKey{commitKey})\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 commits[0].ModuleKey().Digest()\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tswitch fileVersion := bufLockFile.FileVersion(); fileVersion {\n\t\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\tcase bufconfig.FileVersionV2:\n\t\t\t\treturn nil, errors.New(\"got a v2 buf.lock file for a v1 buf.yaml - this is not allowed, run buf mod update to update your buf.lock file\")\n\t\t\tdefault:\n\t\t\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t\t}\n\t\t\tfor _, depModuleKey := range bufLockFile.DepModuleKeys() {\n\t\t\t\t// DepModuleKeys from a BufLockFile is expected to have all transitive dependencies,\n\t\t\t\t// and we can rely on this property.\n\t\t\t\tmoduleSetBuilder.AddRemoteModule(\n\t\t\t\t\tdepModuleKey,\n\t\t\t\t\tfalse,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tv1BufYAMLObjectData, err := bufconfig.GetBufYAMLV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, moduleTargeting.moduleDirPath)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tv1BufLockObjectData, err := bufconfig.GetBufLockV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, moduleTargeting.moduleDirPath)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\t// Each moduleBucketAndTargeting represents a local module that we want to add to the moduleSet,\n\t\t// and we look up its moduleConfig by its bucketID, because that is guaranteed to be unique (technically,\n\t\t// moduleDirPath is also unique in v1/v1beta1, but just to be extra safe).\n\t\tmoduleConfig, ok := v1WorkspaceTargeting.bucketIDToModuleConfig[moduleBucketAndTargeting.bucketID]\n\t\tif !ok {\n\t\t\t// This should not happen since moduleBucketAndTargeting is derived from the module\n\t\t\t// configs, however, we return this error as a safety check\n\t\t\treturn nil, fmt.Errorf(\"no module config found for module at: %q\", moduleTargeting.moduleDirPath)\n\t\t}\n\t\tmoduleSetBuilder.AddLocalModule(\n\t\t\tmappedModuleBucket,\n\t\t\tmoduleBucketAndTargeting.bucketID,\n\t\t\tmoduleTargeting.isTargetModule,\n\t\t\tbufmodule.LocalModuleWithFullName(moduleConfig.FullName()),\n\t\t\tbufmodule.LocalModuleWithTargetPaths(\n\t\t\t\tmoduleTargeting.moduleTargetPaths,\n\t\t\t\tmoduleTargeting.moduleTargetExcludePaths,\n\t\t\t),\n\t\t\tbufmodule.LocalModuleWithProtoFileTargetPath(\n\t\t\t\tmoduleTargeting.moduleProtoFileTargetPath,\n\t\t\t\tmoduleTargeting.includePackageFiles,\n\t\t\t),\n\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufYAMLObjectData(v1BufYAMLObjectData),\n\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufLockObjectData(v1BufLockObjectData),\n\t\t\tbufmodule.LocalModuleWithDescription(\n\t\t\t\tgetLocalModuleDescription(\n\t\t\t\t\t// See comments on getLocalModuleDescription.\n\t\t\t\t\tmoduleBucketAndTargeting.bucketID,\n\t\t\t\t\tmoduleConfig,\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t}\n\tmoduleSet, err := moduleSetBuilder.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn w.getWorkspaceForBucketModuleSet(\n\t\tmoduleSet,\n\t\tv1WorkspaceTargeting.bucketIDToModuleConfig,\n\t\tnil, // No PluginConfigs for v1\n\t\tnil, // No remote PluginKeys for v1\n\t\tnil, // No PolicyConfigs for v1\n\t\tnil, // No remote PolicyKeys for v1\n\t\tnil, // No Policy's PluginKeys for v1.\n\t\tv1WorkspaceTargeting.allConfiguredDepModuleRefs,\n\t\tfalse,\n\t)\n}\n\nfunc (w *workspaceProvider) getWorkspaceForBucketBufYAMLV2(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tv2Targeting *v2Targeting,\n) (*workspace, error) {\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, w.logger, w.moduleDataProvider, w.commitProvider)\n\tvar (\n\t\tremotePluginKeys             []bufplugin.PluginKey\n\t\tremotePolicyKeys             []bufpolicy.PolicyKey\n\t\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey\n\t)\n\tbufLockFile, err := bufconfig.GetBufLockFileForPrefix(\n\t\tctx,\n\t\tbucket,\n\t\t// buf.lock files live next to the buf.yaml\n\t\t\".\",\n\t\t// We are not passing BufLockFileWithDigestResolver here because a buf.lock\n\t\t// v2 is expected to have digests\n\t)\n\tif err != nil {\n\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tswitch fileVersion := bufLockFile.FileVersion(); fileVersion {\n\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\treturn nil, fmt.Errorf(\"got a %s buf.lock file for a v2 buf.yaml\", bufLockFile.FileVersion().String())\n\t\tcase bufconfig.FileVersionV2:\n\t\tdefault:\n\t\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t}\n\t\tfor _, depModuleKey := range bufLockFile.DepModuleKeys() {\n\t\t\t// DepModuleKeys from a BufLockFile is expected to have all transitive dependencies,\n\t\t\t// and we can rely on this property.\n\t\t\tmoduleSetBuilder.AddRemoteModule(\n\t\t\t\tdepModuleKey,\n\t\t\t\tfalse,\n\t\t\t)\n\t\t}\n\t\tremotePluginKeys = bufLockFile.RemotePluginKeys()\n\t\tremotePolicyKeys = bufLockFile.RemotePolicyKeys()\n\t\tpolicyNameToRemotePluginKeys = bufLockFile.PolicyNameToRemotePluginKeys()\n\t}\n\t// Only check for duplicate module description in v2, which would be an user error, i.e.\n\t// This is not a system error:\n\t// modules:\n\t//   - path: proto\n\t//     excludes:\n\t//       - proot/foo\n\t//   - path: proto\n\t//     excludes:\n\t//       - proot/foo\n\t// but duplicate module description in v1 is a system error, which the ModuleSetBuilder catches.\n\tseenModuleDescriptions := make(map[string]struct{})\n\tfor _, moduleBucketAndTargeting := range v2Targeting.moduleBucketsAndTargeting {\n\t\tmappedModuleBucket := moduleBucketAndTargeting.bucket\n\t\tmoduleTargeting := moduleBucketAndTargeting.moduleTargeting\n\t\t// Each moduleBucketAndTargeting represents a local module that we want to add to the moduleSet,\n\t\t// and we look up its moduleConfig by its bucketID, because that is guaranteed to be unique (moduleDirPaths\n\t\t// are not in a v2 workspace).\n\t\tmoduleConfig, ok := v2Targeting.bucketIDToModuleConfig[moduleBucketAndTargeting.bucketID]\n\t\tif !ok {\n\t\t\t// This should not happen since moduleBucketAndTargeting is derived from the module\n\t\t\t// configs, however, we return this error as a safety check\n\t\t\treturn nil, fmt.Errorf(\"no module config found for module at: %q\", moduleTargeting.moduleDirPath)\n\t\t}\n\t\tmoduleDescription := getLocalModuleDescription(\n\t\t\t// See comments on getLocalModuleDescription.\n\t\t\tmoduleConfig.DirPath(),\n\t\t\tmoduleConfig,\n\t\t)\n\t\tif _, ok := seenModuleDescriptions[moduleDescription]; ok {\n\t\t\treturn nil, fmt.Errorf(\"multiple module configs found with the same description: %s\", moduleDescription)\n\t\t}\n\t\tseenModuleDescriptions[moduleDescription] = struct{}{}\n\t\tmoduleSetBuilder.AddLocalModule(\n\t\t\tmappedModuleBucket,\n\t\t\tmoduleBucketAndTargeting.bucketID,\n\t\t\tmoduleTargeting.isTargetModule,\n\t\t\tbufmodule.LocalModuleWithFullName(moduleConfig.FullName()),\n\t\t\tbufmodule.LocalModuleWithTargetPaths(\n\t\t\t\tmoduleTargeting.moduleTargetPaths,\n\t\t\t\tmoduleTargeting.moduleTargetExcludePaths,\n\t\t\t),\n\t\t\tbufmodule.LocalModuleWithProtoFileTargetPath(\n\t\t\t\tmoduleTargeting.moduleProtoFileTargetPath,\n\t\t\t\tmoduleTargeting.includePackageFiles,\n\t\t\t),\n\t\t\tbufmodule.LocalModuleWithDescription(moduleDescription),\n\t\t)\n\t}\n\tmoduleSet, err := moduleSetBuilder.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn w.getWorkspaceForBucketModuleSet(\n\t\tmoduleSet,\n\t\tv2Targeting.bucketIDToModuleConfig,\n\t\tv2Targeting.bufYAMLFile.PluginConfigs(),\n\t\tremotePluginKeys,\n\t\tv2Targeting.bufYAMLFile.PolicyConfigs(),\n\t\tremotePolicyKeys,\n\t\tpolicyNameToRemotePluginKeys,\n\t\tv2Targeting.bufYAMLFile.ConfiguredDepModuleRefs(),\n\t\ttrue,\n\t)\n}\n\n// only use for workspaces created from buckets\nfunc (w *workspaceProvider) getWorkspaceForBucketModuleSet(\n\tmoduleSet bufmodule.ModuleSet,\n\tbucketIDToModuleConfig map[string]bufconfig.ModuleConfig,\n\tpluginConfigs []bufconfig.PluginConfig,\n\tremotePluginKeys []bufplugin.PluginKey,\n\tpolicyConfigs []bufconfig.PolicyConfig,\n\tremotePolicyKeys []bufpolicy.PolicyKey,\n\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey,\n\t// Expected to already be unique by FullName.\n\tconfiguredDepModuleRefs []bufparse.Ref,\n\tisV2 bool,\n) (*workspace, error) {\n\topaqueIDToLintConfig := make(map[string]bufconfig.LintConfig)\n\topaqueIDToBreakingConfig := make(map[string]bufconfig.BreakingConfig)\n\tfor _, module := range moduleSet.Modules() {\n\t\tif bucketID := module.BucketID(); bucketID != \"\" {\n\t\t\tmoduleConfig, ok := bucketIDToModuleConfig[bucketID]\n\t\t\tif !ok {\n\t\t\t\t// This is a system error.\n\t\t\t\treturn nil, syserror.Newf(\"could not get ModuleConfig for BucketID %q\", bucketID)\n\t\t\t}\n\t\t\topaqueIDToLintConfig[module.OpaqueID()] = moduleConfig.LintConfig()\n\t\t\topaqueIDToBreakingConfig[module.OpaqueID()] = moduleConfig.BreakingConfig()\n\t\t} else {\n\t\t\topaqueIDToLintConfig[module.OpaqueID()] = bufconfig.DefaultLintConfigV1\n\t\t\topaqueIDToBreakingConfig[module.OpaqueID()] = bufconfig.DefaultBreakingConfigV1\n\t\t}\n\t}\n\treturn newWorkspace(\n\t\tmoduleSet,\n\t\topaqueIDToLintConfig,\n\t\topaqueIDToBreakingConfig,\n\t\tpluginConfigs,\n\t\tremotePluginKeys,\n\t\tpolicyConfigs,\n\t\tremotePolicyKeys,\n\t\tpolicyNameToRemotePluginKeys,\n\t\tconfiguredDepModuleRefs,\n\t\tisV2,\n\t), nil\n}\n\n// This formats a module name based on its module config entry in the v2 buf.yaml:\n// `path: foo, includes: [\"foo/v1, \"foo/v2\"], excludes: \"foo/v1/internal\"`.\n//\n// For v1/v1beta1 modules, pathDescription should be bucketID.\n// For v2 modules, pathDescription should be moduleConfig.DirPath().\n//\n// We edit bucketIDs in v2 to include an index since directories can be overlapping.\n// We would want to use moduleConfig.DirPath() everywhere, but it is always \".\" in\n// v1/v1beta1, and it's not a good description.\nfunc getLocalModuleDescription(pathDescription string, moduleConfig bufconfig.ModuleConfig) string {\n\tdescription := fmt.Sprintf(\"path: %q\", pathDescription)\n\tmoduleDirPath := moduleConfig.DirPath()\n\trelIncludePaths := moduleConfig.RootToIncludes()[\".\"]\n\tincludePaths := xslices.Map(relIncludePaths, func(relInclude string) string {\n\t\treturn normalpath.Join(moduleDirPath, relInclude)\n\t})\n\tswitch len(includePaths) {\n\tcase 0:\n\tcase 1:\n\t\tdescription = fmt.Sprintf(\"%s, includes: %q\", description, includePaths[0])\n\tdefault:\n\t\tdescription = fmt.Sprintf(\"%s, includes: [%s]\", description, xstrings.JoinSliceQuoted(includePaths, \", \"))\n\t}\n\trelExcludePaths := moduleConfig.RootToExcludes()[\".\"]\n\texcludePaths := xslices.Map(relExcludePaths, func(relInclude string) string {\n\t\treturn normalpath.Join(moduleDirPath, relInclude)\n\t})\n\tswitch len(excludePaths) {\n\tcase 0:\n\tcase 1:\n\t\tdescription = fmt.Sprintf(\"%s, excludes: %q\", description, excludePaths[0])\n\tdefault:\n\t\tdescription = fmt.Sprintf(\"%s, excludes: [%s]\", description, xstrings.JoinSliceQuoted(excludePaths, \", \"))\n\t}\n\treturn description\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/workspace_targeting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// workspaceTargeting figures out if we are working with a v1 or v2 workspace based on\n// buftarget.BucketTargeting information and provides the workspace targeting information\n// to WorkspaceProvider and WorkspaceDepManagerProvider.\n//\n// For v1 workspaces, this provides the bucket IDs to module configs, mapped module buckets and\n// module targeting information, and all configured dependency module refs.\n//\n// # For v2 workspaces, this provides the bucket IDs to module configs, module dir paths,\n// and mapped module buckets and module targeting.\n//\n// In the case where no controlling workspace is found, we default to a v1 workspace with\n// a single module directory path, which is equivalent to the input dir.\n//\n// We only ever return one of v1 or v2.\ntype workspaceTargeting struct {\n\tv1 *v1Targeting\n\tv2 *v2Targeting\n}\n\ntype v1Targeting struct {\n\tbucketIDToModuleConfig     map[string]bufconfig.ModuleConfig\n\tmoduleBucketsAndTargeting  []*moduleBucketAndModuleTargeting\n\tallConfiguredDepModuleRefs []bufparse.Ref\n}\n\ntype v2Targeting struct {\n\tbufYAMLFile               bufconfig.BufYAMLFile\n\tbucketIDToModuleConfig    map[string]bufconfig.ModuleConfig\n\tmoduleBucketsAndTargeting []*moduleBucketAndModuleTargeting\n}\n\ntype moduleBucketAndModuleTargeting struct {\n\tbucket storage.ReadBucket\n\t// A bucketID, which uniquely identifies a moduleBucketAndModuleTargeting, is needed\n\t// because in a v2 workspace multiple local modules may have the same DirPath.\n\tbucketID        string\n\tmoduleTargeting *moduleTargeting\n}\n\nfunc newWorkspaceTargeting(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tconfig *workspaceBucketConfig,\n\tbucket storage.ReadBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n\toverrideBufYAMLFile bufconfig.BufYAMLFile,\n\tignoreAndDisallowV1BufWorkYAMLs bool,\n) (*workspaceTargeting, error) {\n\tif err := validateBucketTargeting(bucketTargeting, config.protoFileTargetPath); err != nil {\n\t\treturn nil, err\n\t}\n\tif overrideBufYAMLFile != nil {\n\t\tlogger.DebugContext(\n\t\t\tctx,\n\t\t\t\"targeting workspace with config override\",\n\t\t\tslog.String(\"subDirPath\", bucketTargeting.SubDirPath()),\n\t\t)\n\t\tswitch fileVersion := overrideBufYAMLFile.FileVersion(); fileVersion {\n\t\tcase bufconfig.FileVersionV1Beta1, bufconfig.FileVersionV1:\n\t\t\treturn v1WorkspaceTargeting(\n\t\t\t\tctx,\n\t\t\t\tconfig,\n\t\t\t\tbucket,\n\t\t\t\tbucketTargeting,\n\t\t\t\t[]string{bucketTargeting.SubDirPath()},\n\t\t\t\toverrideBufYAMLFile,\n\t\t\t)\n\t\tcase bufconfig.FileVersionV2:\n\t\t\treturn v2WorkspaceTargeting(\n\t\t\t\tctx,\n\t\t\t\tconfig,\n\t\t\t\tbucket,\n\t\t\t\tbucketTargeting,\n\t\t\t\toverrideBufYAMLFile,\n\t\t\t\t// If the user specifies a `--config path/to/config/buf.yaml` and the input workspace\n\t\t\t\t// modules do not have their own doc/license files, we do not want to use \"path/to/config/README(or LICENSE)\"\n\t\t\t\t// or \"moduleDir/README(or LICENSE)\" as the module's doc/license.\n\t\t\t\tfalse,\n\t\t\t)\n\t\tdefault:\n\t\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t}\n\t}\n\tif controllingWorkspace := bucketTargeting.ControllingWorkspace(); controllingWorkspace != nil {\n\t\t// This is a v2 workspace.\n\t\tif controllingWorkspace.BufYAMLFile() != nil {\n\t\t\tlogger.DebugContext(\n\t\t\t\tctx,\n\t\t\t\t\"targeting workspace based on v2 buf.yaml\",\n\t\t\t\tslog.String(\"subDirPath\", bucketTargeting.SubDirPath()),\n\t\t\t)\n\t\t\treturn v2WorkspaceTargeting(\n\t\t\t\tctx,\n\t\t\t\tconfig,\n\t\t\t\tbucket,\n\t\t\t\tbucketTargeting,\n\t\t\t\tcontrollingWorkspace.BufYAMLFile(),\n\t\t\t\t// For a v2 controlling workspace, if a module inside does not have its own doc/license,\n\t\t\t\t// we want to the doc/license at the root of the workspace if they exist.\n\t\t\t\ttrue,\n\t\t\t)\n\t\t}\n\t\t// This is a v1 workspace.\n\t\tif bufWorkYAMLFile := controllingWorkspace.BufWorkYAMLFile(); bufWorkYAMLFile != nil {\n\t\t\tif ignoreAndDisallowV1BufWorkYAMLs {\n\t\t\t\t// This means that we attempted to target a v1 workspace at the buf.work.yaml, not\n\t\t\t\t// an individual module within the v1 workspace defined in buf.work.yaml.\n\t\t\t\t// This is disallowed.\n\t\t\t\tif bucketTargeting.SubDirPath() == \".\" {\n\t\t\t\t\treturn nil, errors.New(`Workspaces defined with buf.work.yaml cannot be updated or pushed, only\nthe individual modules within a workspace can be updated or pushed. Workspaces\ndefined with a v2 buf.yaml can be updated, see the migration documentation for more details.`)\n\t\t\t\t}\n\t\t\t\t// We targeted a specific module within the workspace. Based on the option we provided, we're going to ignore\n\t\t\t\t// the workspace entirely, and just act as if the buf.work.yaml did not exist.\n\t\t\t\tlogger.DebugContext(\n\t\t\t\t\tctx,\n\t\t\t\t\t\"targeting workspace, ignoring v1 buf.work.yaml, just building on module at target\",\n\t\t\t\t\tslog.String(\"subDirPath\", bucketTargeting.SubDirPath()),\n\t\t\t\t)\n\t\t\t\treturn v1WorkspaceTargeting(\n\t\t\t\t\tctx,\n\t\t\t\t\tconfig,\n\t\t\t\t\tbucket,\n\t\t\t\t\tbucketTargeting,\n\t\t\t\t\t[]string{bucketTargeting.SubDirPath()}, // Assume we are targeting only the module at the input dir\n\t\t\t\t\tnil,\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn v1WorkspaceTargeting(\n\t\t\t\tctx,\n\t\t\t\tconfig,\n\t\t\t\tbucket,\n\t\t\t\tbucketTargeting,\n\t\t\t\tbufWorkYAMLFile.DirPaths(),\n\t\t\t\tnil,\n\t\t\t)\n\t\t}\n\t}\n\tlogger.DebugContext(\n\t\tctx,\n\t\t\"targeting workspace with no found buf.work.yaml or v2 buf.yaml\",\n\t\tslog.String(\"subDirPath\", bucketTargeting.SubDirPath()),\n\t)\n\t// We did not find any buf.work.yaml or v2 buf.yaml, we invoke fallback logic.\n\treturn fallbackWorkspaceTargeting(\n\t\tctx,\n\t\tlogger,\n\t\tconfig,\n\t\tbucket,\n\t\tbucketTargeting,\n\t)\n}\n\nfunc v2WorkspaceTargeting(\n\tctx context.Context,\n\tconfig *workspaceBucketConfig,\n\tbucket storage.ReadBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n\tbufYAMLFile bufconfig.BufYAMLFile,\n\t// If true and if a workspace module does not have a license/doc at its moduleDirPath,\n\t// use the license/doc respectively at the workspace root for this module.\n\tuseWorkspaceLicenseDocIfNotFoundAtModule bool,\n) (*workspaceTargeting, error) {\n\t// We keep track of if any module was tentatively targeted, and then actually targeted via\n\t// the paths flags. We use this pre-building of the ModuleSet to see if the --path and\n\t// --exclude-path flags resulted in no targeted modules. This condition is represented\n\t// by hadIsTentativelyTargetModule == true && hadIsTargetModule = false\n\t//\n\t// If hadIsTentativelyTargetModule is false, this means that our input bucketTargeting.SubDirPath() was not\n\t// actually representative of any module that we detected in buf.work.yaml or v2 buf.yaml\n\t// directories, and this is a system error - this should be verified before we reach this function.\n\tvar hadIsTentativelyTargetModule bool\n\tvar hadIsTargetModule bool\n\tmoduleDirPaths := make([]string, 0, len(bufYAMLFile.ModuleConfigs()))\n\tbucketIDToModuleConfig := make(map[string]bufconfig.ModuleConfig)\n\tmoduleBucketsAndTargeting := make([]*moduleBucketAndModuleTargeting, 0, len(bufYAMLFile.ModuleConfigs()))\n\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\tbucketIDsForModuleConfigs := bucketIDsForModuleConfigsV2(moduleConfigs)\n\tif len(bucketIDsForModuleConfigs) != len(moduleConfigs) {\n\t\t// This is impossible, as the length is guaranteed by bucketIDsForModuleConfigsV2.\n\t\treturn nil, syserror.Newf(\"expected %d bucketIDs computed but got %d\", len(moduleConfigs), len(bucketIDsForModuleConfigs))\n\t}\n\tfor i, moduleConfig := range moduleConfigs {\n\t\tmoduleDirPath := moduleConfig.DirPath()\n\t\tmoduleDirPaths = append(moduleDirPaths, moduleDirPath)\n\t\t// bucketIDs have the same order as moduleConfigs\n\t\tbucketID := bucketIDsForModuleConfigs[i]\n\t\tbucketIDToModuleConfig[bucketID] = moduleConfig\n\t\t// bucketTargeting.SubDirPath() is the input targetSubDirPath. We only want to target modules that are inside\n\t\t// this targetSubDirPath. Example: bufWorkYAMLDirPath is \"foo\", targetSubDirPath is \"foo/bar\",\n\t\t// listed directories are \"bar/baz\", \"bar/bat\", \"other\". We want to include \"foo/bar/baz\"\n\t\t// and \"foo/bar/bat\".\n\t\t//\n\t\t// This is new behavior - before, we required that you input an exact match for the module directory path,\n\t\t// but now, we will take all the modules underneath this workspace.\n\t\tisTentativelyTargetModule := normalpath.EqualsOrContainsPath(bucketTargeting.SubDirPath(), moduleDirPath, normalpath.Relative)\n\t\t// We ignore this check for proto file refs, since the input is considered the directory\n\t\t// of the proto file reference, which is unlikely to contain a module in its entirety.\n\t\t// In the future, it would be nice to handle this more elegantly.\n\t\tif config.protoFileTargetPath != \"\" {\n\t\t\tisTentativelyTargetModule = true\n\t\t}\n\t\tif isTentativelyTargetModule {\n\t\t\thadIsTentativelyTargetModule = true\n\t\t}\n\t\tmappedModuleBucket, moduleTargeting, err := getMappedModuleBucketAndModuleTargeting(\n\t\t\tctx,\n\t\t\tconfig,\n\t\t\tbucket,\n\t\t\tbucketTargeting,\n\t\t\tmoduleDirPath,\n\t\t\tmoduleConfig,\n\t\t\tisTentativelyTargetModule,\n\t\t\tuseWorkspaceLicenseDocIfNotFoundAtModule,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif moduleTargeting.isTargetModule {\n\t\t\thadIsTargetModule = true\n\t\t}\n\t\tmoduleBucketsAndTargeting = append(moduleBucketsAndTargeting, &moduleBucketAndModuleTargeting{\n\t\t\tbucket:          mappedModuleBucket,\n\t\t\tbucketID:        bucketID,\n\t\t\tmoduleTargeting: moduleTargeting,\n\t\t})\n\t}\n\tif !hadIsTentativelyTargetModule {\n\t\t// Check if the input is overlapping within a module dir path. If so, return a nicer\n\t\t// error. In the future, we want to remove special treatment for input dir, and it\n\t\t// should be treated just like any target path.\n\t\treturn nil, checkForOverlap(ctx, bucket, bucketTargeting.SubDirPath(), moduleDirPaths)\n\t}\n\tif !hadIsTargetModule {\n\t\t// It would be nice to have a better error message than this in the long term.\n\t\treturn nil, bufmodule.ErrNoTargetProtoFiles\n\t}\n\treturn &workspaceTargeting{\n\t\tv2: &v2Targeting{\n\t\t\tbufYAMLFile:               bufYAMLFile,\n\t\t\tbucketIDToModuleConfig:    bucketIDToModuleConfig,\n\t\t\tmoduleBucketsAndTargeting: moduleBucketsAndTargeting,\n\t\t},\n\t}, nil\n}\n\nfunc v1WorkspaceTargeting(\n\tctx context.Context,\n\tconfig *workspaceBucketConfig,\n\tbucket storage.ReadBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n\tmoduleDirPaths []string,\n\toverrideBufYAMLFile bufconfig.BufYAMLFile,\n) (*workspaceTargeting, error) {\n\t// We keep track of if any module was tentatively targeted, and then actually targeted via\n\t// the paths flags. We use this pre-building of the ModuleSet to see if the --path and\n\t// --exclude-path flags resulted in no targeted modules. This condition is represented\n\t// by hadIsTentativelyTargetModule == true && hadIsTargetModule = false\n\t//\n\t// If hadIsTentativelyTargetModule is false, this means that our input bucketTargeting.SubDirPath() was not\n\t// actually representative of any module that we detected in buf.work.yaml or v2 buf.yaml\n\t// directories, and this is a system error - this should be verified before we reach this function.\n\tvar hadIsTentativelyTargetModule bool\n\tvar hadIsTargetModule bool\n\tvar allConfiguredDepModuleRefs []bufparse.Ref\n\tbucketIDToModuleConfig := make(map[string]bufconfig.ModuleConfig)\n\t// We use this to detect different refs across different files.\n\tmoduleFullNameStringToConfiguredDepModuleRefString := make(map[string]string)\n\tmoduleBucketsAndTargeting := make([]*moduleBucketAndModuleTargeting, 0, len(moduleDirPaths))\n\tfor _, moduleDirPath := range moduleDirPaths {\n\t\tmoduleConfig, configuredDepModuleRefs, err := getModuleConfigAndConfiguredDepModuleRefsV1Beta1OrV1(\n\t\t\tctx,\n\t\t\tbucket,\n\t\t\tmoduleDirPath,\n\t\t\toverrideBufYAMLFile,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, configuredDepModuleRef := range configuredDepModuleRefs {\n\t\t\tmoduleFullNameString := configuredDepModuleRef.FullName().String()\n\t\t\tconfiguredDepModuleRefString := configuredDepModuleRef.String()\n\t\t\texistingConfiguredDepModuleRefString, ok := moduleFullNameStringToConfiguredDepModuleRefString[moduleFullNameString]\n\t\t\tif !ok {\n\t\t\t\t// We haven't encountered a ModuleRef with this FullName yet, add it.\n\t\t\t\tallConfiguredDepModuleRefs = append(allConfiguredDepModuleRefs, configuredDepModuleRef)\n\t\t\t\tmoduleFullNameStringToConfiguredDepModuleRefString[moduleFullNameString] = configuredDepModuleRefString\n\t\t\t} else if configuredDepModuleRefString != existingConfiguredDepModuleRefString {\n\t\t\t\t// We encountered the same ModuleRef by FullName, but with a different Ref.\n\t\t\t\treturn nil, fmt.Errorf(\"found different refs for the same module within buf.yaml deps in the workspace: %s %s\", configuredDepModuleRefString, existingConfiguredDepModuleRefString)\n\t\t\t}\n\t\t}\n\t\t// DirPaths are unique within a v1 workspace, and so it's safe to use them as bucketIDs.\n\t\tbucketID := moduleDirPath\n\t\tbucketIDToModuleConfig[bucketID] = moduleConfig\n\t\t// We only want to target modules that are inside the bucketTargeting.SubDirPath().\n\t\t// Example: bufWorkYAMLDirPath is \"foo\", bucketTargeting.SubDirPath() is \"foo/bar\",\n\t\t// listed directories are \"bar/baz\", \"bar/bat\", \"other\". We want to include \"foo/bar/baz\"\n\t\t// and \"foo/bar/bat\".\n\t\t//\n\t\t// This is new behavior - before, we required that you input an exact match for the module directory path,\n\t\t// but now, we will take all the modules underneath this workspace.\n\t\tisTentativelyTargetModule := normalpath.EqualsOrContainsPath(bucketTargeting.SubDirPath(), moduleDirPath, normalpath.Relative)\n\t\t// We ignore this check for proto file refs, since the input is considered the directory\n\t\t// of the proto file reference, which is unlikely to contain a module in its entirety.\n\t\t// In the future, it would be nice to handle this more elegantly.\n\t\tif config.protoFileTargetPath != \"\" {\n\t\t\tisTentativelyTargetModule = true\n\t\t}\n\t\tif isTentativelyTargetModule {\n\t\t\thadIsTentativelyTargetModule = true\n\t\t}\n\t\tmappedModuleBucket, moduleTargeting, err := getMappedModuleBucketAndModuleTargeting(\n\t\t\tctx,\n\t\t\tconfig,\n\t\t\tbucket,\n\t\t\tbucketTargeting,\n\t\t\tmoduleDirPath,\n\t\t\tmoduleConfig,\n\t\t\tisTentativelyTargetModule,\n\t\t\t// In a v1 workspace, if a module does not have its own doc/license next to its v1 buf.yaml,\n\t\t\t// we do NOT want to fall back to the doc/license next to it's buf.work.yaml.\n\t\t\tfalse,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif moduleTargeting.isTargetModule {\n\t\t\thadIsTargetModule = true\n\t\t}\n\t\tmoduleBucketsAndTargeting = append(moduleBucketsAndTargeting, &moduleBucketAndModuleTargeting{\n\t\t\tbucket:          mappedModuleBucket,\n\t\t\tbucketID:        bucketID,\n\t\t\tmoduleTargeting: moduleTargeting,\n\t\t})\n\t}\n\tif !hadIsTentativelyTargetModule {\n\t\t// Check if the input is overlapping within a module dir path. If so, return a nicer\n\t\t// error. In the future, we want to remove special treatment for input dir, and it\n\t\t// should be treated just like any target path.\n\t\treturn nil, checkForOverlap(ctx, bucket, bucketTargeting.SubDirPath(), moduleDirPaths)\n\t}\n\tif !hadIsTargetModule {\n\t\t// It would be nice to have a better error message than this in the long term.\n\t\treturn nil, bufmodule.ErrNoTargetProtoFiles\n\t}\n\treturn &workspaceTargeting{\n\t\tv1: &v1Targeting{\n\t\t\tbucketIDToModuleConfig:     bucketIDToModuleConfig,\n\t\t\tmoduleBucketsAndTargeting:  moduleBucketsAndTargeting,\n\t\t\tallConfiguredDepModuleRefs: allConfiguredDepModuleRefs,\n\t\t},\n\t}, nil\n}\n\n// fallbackWorkspaceTargeting is the fallback logic when there is no config override or\n// controlling workspace discovered through bucket targeting.\n//\n// 1. We check if the input is in a v1 module. If yes, then we simply use that.\n// 2. If no v1 module was found for the input, we check the target paths, if there are any.\n// For each target path, we check if it is part of a workspace or v1 module.\n//\n//\ta. If we find a v1 or v2 workspace, we ensure that all them resolve to the same workspace.\n//\tb. If we find no workspace, we keep track of any v1 modules we find along the way. We\n//\tthen build those v1 modules as a v1 workspace.\n//\n// 3. In the case where we find nothing, we set the input as a v1 module in a v1 workspace.\nfunc fallbackWorkspaceTargeting(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tconfig *workspaceBucketConfig,\n\tbucket storage.ReadBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n) (*workspaceTargeting, error) {\n\tvar v1ModulePaths []string\n\tinputDirV1Module, err := checkForControllingWorkspaceOrV1Module(\n\t\tctx,\n\t\tlogger,\n\t\tbucket,\n\t\tbucketTargeting.SubDirPath(),\n\t\ttrue,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif inputDirV1Module != nil {\n\t\tv1ModulePaths = append(v1ModulePaths, inputDirV1Module.Path())\n\t} else if config.protoFileTargetPath == \"\" {\n\t\t// No v1 module found for the input dir, if the input was not a protoFileRef, then\n\t\t// check the target paths to see if a workspace or v1 module exists.\n\t\tvar v1BufWorkYAML bufconfig.BufWorkYAMLFile\n\t\tvar v2BufYAMLFile bufconfig.BufYAMLFile\n\t\tvar controllingWorkspacePath string\n\t\tfor _, targetPath := range bucketTargeting.TargetPaths() {\n\t\t\tcontrollingWorkspaceOrModule, err := checkForControllingWorkspaceOrV1Module(\n\t\t\t\tctx,\n\t\t\t\tlogger,\n\t\t\t\tbucket,\n\t\t\t\ttargetPath,\n\t\t\t\tfalse,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif controllingWorkspaceOrModule != nil {\n\t\t\t\t// v1 workspace found\n\t\t\t\tif bufWorkYAMLFile := controllingWorkspaceOrModule.BufWorkYAMLFile(); bufWorkYAMLFile != nil {\n\t\t\t\t\tif controllingWorkspacePath != \"\" && controllingWorkspaceOrModule.Path() != controllingWorkspacePath {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"different controlling workspaces found: %q, %q\", controllingWorkspacePath, controllingWorkspaceOrModule.Path())\n\t\t\t\t\t}\n\t\t\t\t\tcontrollingWorkspacePath = controllingWorkspaceOrModule.Path()\n\t\t\t\t\tv1BufWorkYAML = bufWorkYAMLFile\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\t// v2 workspace or v1 module found\n\t\t\t\tif bufYAMLFile := controllingWorkspaceOrModule.BufYAMLFile(); bufYAMLFile != nil {\n\t\t\t\t\tif bufYAMLFile.FileVersion() == bufconfig.FileVersionV2 {\n\t\t\t\t\t\tif controllingWorkspacePath != \"\" && controllingWorkspaceOrModule.Path() != controllingWorkspacePath {\n\t\t\t\t\t\t\treturn nil, fmt.Errorf(\"different controlling workspaces found: %q, %q\", controllingWorkspacePath, controllingWorkspaceOrModule.Path())\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontrollingWorkspacePath = controllingWorkspaceOrModule.Path()\n\t\t\t\t\t\tv2BufYAMLFile = bufYAMLFile\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif bufYAMLFile.FileVersion() == bufconfig.FileVersionV1 {\n\t\t\t\t\t\tv1ModulePaths = append(v1ModulePaths, controllingWorkspaceOrModule.Path())\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// If multiple workspaces were found, we return an error since we don't support building\n\t\t// multiple workspaces.\n\t\tif v1BufWorkYAML != nil && v2BufYAMLFile != nil {\n\t\t\treturn nil, fmt.Errorf(\"multiple workspaces found\")\n\t\t}\n\t\t// If we found a workspace and v1 modules that were not contained in the workspace, we\n\t\t// do not support building multiple workspaces.\n\t\tif controllingWorkspacePath != \"\" && len(v1ModulePaths) > 0 {\n\t\t\treturn nil, fmt.Errorf(\"found a workspace %q that does not contain all found modules: %v\", controllingWorkspacePath, v1ModulePaths)\n\t\t}\n\t\tif v2BufYAMLFile != nil {\n\t\t\treturn v2WorkspaceTargeting(\n\t\t\t\tctx,\n\t\t\t\tconfig,\n\t\t\t\tbucket,\n\t\t\t\tbucketTargeting,\n\t\t\t\tv2BufYAMLFile,\n\t\t\t\t// Since the v2 buf.yaml is found at the workspace root we allow falling back\n\t\t\t\t// to the doc/license at the workspace root, even though this function (fallbackWorkspaceTargeting)\n\t\t\t\t// is the logic for handling the situation where the a controlling workspace not found.\n\t\t\t\ttrue,\n\t\t\t)\n\t\t}\n\t\tif v1BufWorkYAML != nil {\n\t\t\tv1ModulePaths = v1BufWorkYAML.DirPaths()\n\t\t}\n\t}\n\t// If we still have no v1 module paths, then we go to the final fallback and set a v1\n\t// module at the input dir.\n\tif len(v1ModulePaths) == 0 {\n\t\tv1ModulePaths = append(v1ModulePaths, bucketTargeting.SubDirPath())\n\t}\n\treturn v1WorkspaceTargeting(\n\t\tctx,\n\t\tconfig,\n\t\tbucket,\n\t\tbucketTargeting,\n\t\tv1ModulePaths,\n\t\tnil,\n\t)\n}\n\nfunc validateBucketTargeting(\n\tbucketTargeting buftarget.BucketTargeting,\n\tprotoFilePath string,\n) error {\n\tif protoFilePath != \"\" {\n\t\t// We set the proto file path as a target path, which we handle in module targeting,\n\t\t// so we expect len(bucketTargeting.TargetPaths()) to be exactly 1.\n\t\tif len(bucketTargeting.TargetPaths()) != 1 || len(bucketTargeting.TargetExcludePaths()) > 0 {\n\t\t\t// This is just a system error. We messed up and called both exclusive options.\n\t\t\treturn syserror.New(\"cannot set targetPaths/targetExcludePaths with protoFileTargetPaths\")\n\t\t}\n\t}\n\t// These are actual user errors. This is us verifying --path and --exclude-path.\n\t// An argument could be made this should be at a higher level for user errors, and then\n\t// if it gets to this point, this should be a system error.\n\t//\n\t// We don't use --path, --exclude-path here because these paths have had ExternalPathToPath\n\t// applied to them. Which is another argument to do this at a higher level.\n\tfor _, targetPath := range bucketTargeting.TargetPaths() {\n\t\tif targetPath == bucketTargeting.SubDirPath() {\n\t\t\t// The targetPath/SubDirPath may not equal something on the command line as we have done\n\t\t\t// targeting via workspaces by now, so do not print them.\n\t\t\treturn errors.New(\"given input is equal to a value of --path, this has no effect and is disallowed\")\n\t\t}\n\t\t// We want this to be deterministic.  We don't have that many paths in almost all cases.\n\t\t// This being n^2 shouldn't be a huge issue unless someone has a diabolical wrapping shell script.\n\t\t// If this becomes a problem, there's optimizations we can do by turning targetExcludePaths into\n\t\t// a map but keeping the index in targetExcludePaths around to prioritize what error\n\t\t// message to print.\n\t\tfor _, targetExcludePath := range bucketTargeting.TargetExcludePaths() {\n\t\t\tif targetPath == targetExcludePath {\n\t\t\t\tunnormalizedTargetPath := filepath.Clean(normalpath.Unnormalize(targetPath))\n\t\t\t\treturn fmt.Errorf(`cannot set the same path for both --path and --exclude-path: \"%s\"`, unnormalizedTargetPath)\n\t\t\t}\n\t\t\t// This is new post-refactor. Before, we gave precedence to --path. While a change,\n\t\t\t// doing --path foo/bar --exclude-path foo seems like a bug rather than expected behavior to maintain.\n\t\t\tif normalpath.EqualsOrContainsPath(targetExcludePath, targetPath, normalpath.Relative) {\n\t\t\t\t// We clean and unnormalize the target paths to show in the error message\n\t\t\t\tunnormalizedTargetExcludePath := filepath.Clean(normalpath.Unnormalize(targetExcludePath))\n\t\t\t\tunnormalizedTargetPath := filepath.Clean(normalpath.Unnormalize(targetPath))\n\t\t\t\treturn fmt.Errorf(`excluded path \"%s\" contains targeted path \"%s\", which means all paths in \"%s\" will be excluded`, unnormalizedTargetExcludePath, unnormalizedTargetPath, unnormalizedTargetPath)\n\t\t\t}\n\t\t}\n\t}\n\tfor _, targetExcludePath := range bucketTargeting.TargetExcludePaths() {\n\t\tif targetExcludePath == bucketTargeting.SubDirPath() {\n\t\t\tunnormalizedTargetSubDirPath := filepath.Clean(normalpath.Unnormalize(bucketTargeting.SubDirPath()))\n\t\t\tunnormalizedTargetExcludePath := filepath.Clean(normalpath.Unnormalize(targetExcludePath))\n\t\t\treturn fmt.Errorf(`given input \"%s\" is equal to a value of --exclude-path \"%s\", this would exclude everything`, unnormalizedTargetSubDirPath, unnormalizedTargetExcludePath)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc getMappedModuleBucketAndModuleTargeting(\n\tctx context.Context,\n\tconfig *workspaceBucketConfig,\n\tworkspaceBucket storage.ReadBucket,\n\tbucketTargeting buftarget.BucketTargeting,\n\tmoduleDirPath string,\n\tmoduleConfig bufconfig.ModuleConfig,\n\tisTargetModule bool,\n\t// If true and if a workspace module does not have a license/doc at its moduleDirPath,\n\t// use the license/doc respectively at the workspace root for this module.\n\tuseWorkspaceLicenseDocIfNotFoundAtModule bool,\n) (storage.ReadBucket, *moduleTargeting, error) {\n\tmoduleBucket := storage.MapReadBucket(\n\t\tworkspaceBucket,\n\t\tstorage.MapOnPrefix(moduleDirPath),\n\t)\n\trootToExcludes := moduleConfig.RootToExcludes()\n\trootToIncludes := moduleConfig.RootToIncludes()\n\tvar rootBuckets []storage.ReadBucket\n\tfor root, excludes := range rootToExcludes {\n\t\tincludes, ok := rootToIncludes[root]\n\t\tif !ok {\n\t\t\t// This should never happen because ModuleConfig guarantees that they have the same keys.\n\t\t\treturn nil, nil, syserror.Newf(\"expected root %q to be also in rootToIncludes but not found\", root)\n\t\t}\n\t\t// Roots only applies to .proto files.\n\t\tmappers := []storage.Mapper{\n\t\t\tstorage.MapOnPrefix(root),\n\t\t}\n\t\tmatchers := []storage.Matcher{\n\t\t\t// need to do match extension here\n\t\t\t// https://github.com/bufbuild/buf/issues/113\n\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t}\n\t\t// Use MaskReadBucket over FilterReadBucket to optimize filtering on large file sets.\n\t\tfilteredBucket, err := storage.MaskReadBucket(\n\t\t\tstorage.FilterReadBucket(\n\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\tmoduleBucket,\n\t\t\t\t\tmappers...,\n\t\t\t\t),\n\t\t\t\tmatchers...,\n\t\t\t),\n\t\t\tincludes,\n\t\t\texcludes,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\trootBuckets = append(rootBuckets, filteredBucket)\n\t}\n\tdocStorageReadBucket, err := bufmodule.GetDocStorageReadBucket(ctx, moduleBucket)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tlicenseStorageReadBucket, err := bufmodule.GetLicenseStorageReadBucket(ctx, moduleBucket)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif useWorkspaceLicenseDocIfNotFoundAtModule {\n\t\tisModuleDocBucketEmpty, err := storage.IsEmpty(ctx, docStorageReadBucket, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\t// If at moduleDirPath there isn't a doc file, we fall back to use the doc file\n\t\t// at the workspace root if it exists.\n\t\tif isModuleDocBucketEmpty {\n\t\t\t// We do not need to check if a doc file exists at the workspace root by\n\t\t\t// checking whether the doc bucket for the workspace is empty, because\n\t\t\t// this bucket will just be empty there isn't one, which is what we want.\n\t\t\tdocStorageReadBucket, err = bufmodule.GetDocStorageReadBucket(ctx, workspaceBucket)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t\tisModuleLicenseBucketEmpty, err := storage.IsEmpty(ctx, licenseStorageReadBucket, \"\")\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\t// If at moduleDirPath there isn't a license, we fall back to use the license\n\t\t// at the workspace root if it exists.\n\t\tif isModuleLicenseBucketEmpty {\n\t\t\t// We do not need to check if this bucket is empty for the same reason, see comment for doc bucket.\n\t\t\tlicenseStorageReadBucket, err = bufmodule.GetLicenseStorageReadBucket(ctx, workspaceBucket)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t}\n\t}\n\trootBuckets = append(\n\t\trootBuckets,\n\t\tdocStorageReadBucket,\n\t\tlicenseStorageReadBucket,\n\t)\n\tmappedModuleBucket := storage.MultiReadBucket(rootBuckets...)\n\tmoduleTargeting, err := newModuleTargeting(\n\t\tmoduleDirPath,\n\t\txslices.MapKeysToSlice(rootToExcludes),\n\t\tbucketTargeting,\n\t\tconfig,\n\t\tisTargetModule,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn mappedModuleBucket, moduleTargeting, nil\n}\n\nfunc getModuleConfigAndConfiguredDepModuleRefsV1Beta1OrV1(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tmoduleDirPath string,\n\toverrideBufYAMLFile bufconfig.BufYAMLFile,\n) (bufconfig.ModuleConfig, []bufparse.Ref, error) {\n\tvar bufYAMLFile bufconfig.BufYAMLFile\n\tvar err error\n\tif overrideBufYAMLFile != nil {\n\t\tbufYAMLFile = overrideBufYAMLFile\n\t} else {\n\t\tbufYAMLFile, err = bufconfig.GetBufYAMLFileForPrefix(ctx, bucket, moduleDirPath)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\t// If we do not have a buf.yaml, we use the default config.\n\t\t\t\t// This is a v1 config.\n\t\t\t\treturn bufconfig.DefaultModuleConfigV1, nil, nil\n\t\t\t}\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\t// Ensure buf.yaml matches the expected version for a v1 module.\n\tif bufYAMLFile.FileVersion() != bufconfig.FileVersionV1Beta1 && bufYAMLFile.FileVersion() != bufconfig.FileVersionV1 {\n\t\treturn nil, nil, fmt.Errorf(\"buf.yaml at %s did not have version v1beta1 or v1\", moduleDirPath)\n\t}\n\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\tif len(moduleConfigs) != 1 {\n\t\t// This is a system error. This should never happen.\n\t\treturn nil, nil, syserror.Newf(\"received %d ModuleConfigs from a v1beta1 or v1 BufYAMLFile\", len(moduleConfigs))\n\t}\n\treturn moduleConfigs[0], bufYAMLFile.ConfiguredDepModuleRefs(), nil\n}\n\n// checkForControllingWorkspaceOrV1Module take a bucket and path, and walks up the bucket\n// from the base of the path, checking for a controlling workspace or v1 module.\n//\n// If ignoreWorkspaceCheck is set to true, then we only look for v1 modules. This is done\n// for the input, since we already did the workspace check in the initial bucketTargeting.\n// Note that this is something that we could build into the initial bucketTargeting,\n// however, moving forward, we want to encourage users to move to v2 workspaces, so it is\n// nice to be able to isolate this as fallback logic here.\nfunc checkForControllingWorkspaceOrV1Module(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tbucket storage.ReadBucket,\n\tpath string,\n\tignoreWorkspaceCheck bool,\n) (buftarget.ControllingWorkspace, error) {\n\tpath = normalpath.Normalize(path)\n\t// Keep track of any v1 module found along the way. If we find a v1 or v2 workspace, we\n\t// return that over the v1 module, but we return this as the fallback.\n\tvar fallbackV1Module buftarget.ControllingWorkspace\n\t// Similar to the mapping loop in buftarget for buftarget.BucketTargeting, we can't do\n\t// this in a traditional loop like this:\n\t//\n\t// for curDirPath := path; curDirPath != \".\"; curDirPath = normalpath.Dir(curDirPath) {\n\t//\n\t// If we do that, then we don't run terminateFunc for \".\", which we want to so that we get\n\t// the correct value for the terminate bool.\n\t//\n\t// Instead, we effectively do a do-while loop.\n\tcurDirPath := path\n\tfor {\n\t\tif !ignoreWorkspaceCheck {\n\t\t\tcontrollingWorkspace, err := buftarget.TerminateAtControllingWorkspace(\n\t\t\t\tctx,\n\t\t\t\tbucket,\n\t\t\t\tcurDirPath,\n\t\t\t\tpath,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif controllingWorkspace != nil {\n\t\t\t\tlogger.DebugContext(\n\t\t\t\t\tctx,\n\t\t\t\t\t\"buffetch termination found\",\n\t\t\t\t\tslog.String(\"curDirPath\", curDirPath),\n\t\t\t\t\tslog.String(\"path\", path),\n\t\t\t\t)\n\t\t\t\treturn controllingWorkspace, nil\n\t\t\t}\n\t\t}\n\t\t// Then check for a v1 module\n\t\tv1Module, err := buftarget.TerminateAtV1Module(ctx, bucket, curDirPath, path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif v1Module != nil {\n\t\t\tif fallbackV1Module != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"nested modules %q and %q are not allowed\", fallbackV1Module.Path(), v1Module.Path())\n\t\t\t}\n\t\t\tfallbackV1Module = v1Module\n\t\t}\n\t\tif curDirPath == \".\" {\n\t\t\tbreak\n\t\t}\n\t\tcurDirPath = normalpath.Dir(curDirPath)\n\t}\n\tlogger.DebugContext(\n\t\tctx,\n\t\t\"buffetch no termination found\",\n\t\tslog.String(\"path\", path),\n\t)\n\treturn fallbackV1Module, nil\n}\n\nfunc checkForOverlap(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tinputPath string,\n\tmoduleDirPaths []string,\n) error {\n\tfor _, moduleDirPath := range moduleDirPaths {\n\t\tif normalpath.ContainsPath(moduleDirPath, inputPath, normalpath.Relative) {\n\t\t\t// In the case where the inputPath would appear to be relative to moduleDirPath,\n\t\t\t// but does not exist, for example, moduleDirPath == \".\" and inputPath == \"fake-path\",\n\t\t\t// or moduleDirPath == \"real-path\" and inputPath == \"real-path/fake-path\", the error\n\t\t\t// returned below is not very clear (in particular the first case, \".\" and \"fake-path\").\n\t\t\t// We do a check here and return ErrNoTargetProtoFiles if the inputPath is empty\n\t\t\t// and/or it does not exist.\n\t\t\tempty, err := storage.IsEmpty(ctx, bucket, inputPath)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif empty {\n\t\t\t\treturn bufmodule.ErrNoTargetProtoFiles\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"failed to build input %q because it is contained by module at path %q specified in your configuration, you must provide the workspace or module as the input, and filter to this path using --path\", inputPath, moduleDirPath)\n\t\t}\n\t}\n\treturn fmt.Errorf(\"input %q did not contain modules found in workspace %v\", inputPath, moduleDirPaths)\n}\n\n// bucketIDsForModuleConfigsV2 returns the bucket IDs for the given moduleDirPaths in the same order.\n// moduleDirPaths must already be normalized.\n//\n// v1 does not need to call a function like this because bucketIDs are just their module roots relative to the workspace root, which are unique.\nfunc bucketIDsForModuleConfigsV2(moduleConfigs []bufconfig.ModuleConfig) []string {\n\tmoduleDirPaths := xslices.Map(moduleConfigs, bufconfig.ModuleConfig.DirPath)\n\t// In a v2 bufYAMLFile, multiple module configs may have the same DirPath, but we still want to\n\t// make sure each local module has a unique BucketID, which means we cannot use their DirPaths as\n\t// BucketIDs directly. Instead, we append an index (1-indexed) to each DirPath to deduplicate, and\n\t// each module's bucketID becomes \"<path>[index]\", except for the first one does not need the index\n\t// and its bucketID is still \"<path>\".\n\t// As an example, bucketIDs are shown for modules in the buf.yaml below:\n\t// ...\n\t// modules:\n\t//   - path: foo # bucketID: foo\n\t//   - path: bar # bucketID: bar\n\t//   - path: foo # bucketID: foo-2\n\t//   - path: bar # bucketID: bar-2\n\t//   - path: bar # bucketID: bar-3\n\t//   - path: new # bucketID: new\n\t//   - path: foo # bucketID: foo-3\n\t// ...\n\t// Note: The BufYAMLFile interface guarantees that the relative order among module configs with\n\t// the same path is the same order among these modules in the external buf.yaml v2, e.g. the 2nd\n\t// \"foo\" in the external buf.yaml above is also the 2nd \"foo\" in module configs, even though sorted:\n\t// [bar, bar, bar, foo, foo, foo, new].\n\t//                       ^\n\tbucketIDs := bucketIDsForDirPaths(moduleDirPaths, false)\n\tif len(xslices.Duplicates(bucketIDs)) == 0 {\n\t\t// This approach does not produce duplicate bucketIDs in the result most of the time, we return\n\t\t// the bucketIDs if we don't detect any duplicates and it gives us the nice property that for\n\t\t// 99% of the v2 workspaces, each module's bucketID is its DirPath.\n\t\treturn bucketIDs\n\t}\n\t// However, the approach above may create duplicates in the result bucketIDs, for example:\n\t// ...\n\t// modules:\n\t//   - path: foo-2 # bucketID: foo-2\n\t//   - path: foo   # bucketID: foo\n\t//   - path: foo   # bucketID: foo-2\n\t// Notice that both the module at \"foo-2\" and the second module at \"foo\" have bucketID \"foo-2\".\n\t// In this case, we append an index to every DirPath, including the first occurrence of each DirPath.\n\treturn bucketIDsForDirPaths(moduleDirPaths, true)\n}\n\nfunc bucketIDsForDirPaths(moduleDirPaths []string, firstIDHasSuffix bool) []string {\n\tbucketIDs := make([]string, 0, len(moduleDirPaths))\n\t// Use dirPathToRunningCount to keep track of how many modules of this path has been seen (before the\n\t// current module) in this BufYAMLFile.\n\tdirPathToRunningCount := make(map[string]int)\n\tfor _, moduleDirPath := range moduleDirPaths {\n\t\t// If n modules before this one has the same DirPath, then this module has index n+1 (1-indexed).\n\t\tcurrentModuleDirPathIndex := dirPathToRunningCount[moduleDirPath] + 1\n\t\tbucketID := fmt.Sprintf(\"%s-%d\", moduleDirPath, currentModuleDirPathIndex)\n\t\tif currentModuleDirPathIndex == 1 && !firstIDHasSuffix {\n\t\t\tbucketID = moduleDirPath\n\t\t}\n\t\tbucketIDs = append(bucketIDs, bucketID)\n\t\tdirPathToRunningCount[moduleDirPath]++\n\t}\n\treturn bucketIDs\n}\n"
  },
  {
    "path": "private/buf/bufworkspace/workspace_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufworkspace\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xio\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/dag/dagtest\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestBasicV1(t *testing.T) {\n\tt.Parallel()\n\ttestBasic(t, \"workspacev1\", false)\n}\n\nfunc TestBasicV2(t *testing.T) {\n\tt.Parallel()\n\ttestBasic(t, \"workspacev2\", true)\n}\n\nfunc testBasic(t *testing.T, subDirPath string, isV2 bool) {\n\tctx := t.Context()\n\n\t// This represents some external dependencies from the BSR.\n\tworkspaceProvider := testNewWorkspaceProvider(\n\t\tt,\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName:    \"buf.testing/acme/date\",\n\t\t\tDirPath: \"testdata/basic/bsr/buf.testing/acme/date\",\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName:    \"buf.testing/acme/extension\",\n\t\t\tDirPath: \"testdata/basic/bsr/buf.testing/acme/extension\",\n\t\t},\n\t)\n\n\tstorageosProvider := storageos.NewProvider()\n\tbucket, err := storageosProvider.NewReadWriteBucket(normalpath.Join(\"testdata/basic\", subDirPath))\n\trequire.NoError(t, err)\n\n\tbucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tbucket,\n\t\t\"finance/portfolio/proto\",\n\t\tnil,\n\t\tnil,\n\t\tbuftarget.TerminateAtControllingWorkspace,\n\t)\n\trequire.NotNil(t, bucketTargeting.ControllingWorkspace())\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"finance/portfolio/proto\", bucketTargeting.SubDirPath())\n\trequire.NoError(t, err)\n\n\tworkspace, err := workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\tbucket,\n\t\tbucketTargeting,\n\t)\n\trequire.NoError(t, err)\n\tmodule := workspace.GetModuleForOpaqueID(\"buf.testing/acme/bond\")\n\trequire.NotNil(t, module)\n\trequire.False(t, module.IsTarget())\n\tmodule = workspace.GetModuleForOpaqueID(\"finance/portfolio/proto\")\n\trequire.NotNil(t, module)\n\trequire.True(t, module.IsTarget())\n\tgraph, err := bufmodule.ModuleSetToDAG(workspace)\n\trequire.NoError(t, err)\n\tdagtest.RequireGraphEqual(\n\t\tt,\n\t\t[]dagtest.ExpectedNode[string]{\n\t\t\t{\n\t\t\t\tKey: \"buf.testing/acme/extension\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.testing/acme/date\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.testing/acme/extension\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.testing/acme/geo\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.testing/acme/money\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.testing/acme/bond\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.testing/acme/date\",\n\t\t\t\t\t\"buf.testing/acme/geo\",\n\t\t\t\t\t\"buf.testing/acme/money\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"finance/portfolio/proto\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.testing/acme/bond\",\n\t\t\t\t\t\"buf.testing/acme/extension\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tgraph,\n\t\tbufmodule.Module.OpaqueID,\n\t)\n\tgraphRemoteOnly, err := bufmodule.ModuleSetToDAG(workspace, bufmodule.ModuleSetToDAGWithRemoteOnly())\n\trequire.NoError(t, err)\n\tdagtest.RequireGraphEqual(\n\t\tt,\n\t\t[]dagtest.ExpectedNode[string]{\n\t\t\t{\n\t\t\t\tKey: \"buf.testing/acme/extension\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.testing/acme/date\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.testing/acme/extension\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tgraphRemoteOnly,\n\t\tbufmodule.Module.OpaqueID,\n\t)\n\tmodule = workspace.GetModuleForOpaqueID(\"buf.testing/acme/bond\")\n\trequire.NotNil(t, module)\n\t_, err = module.StatFileInfo(ctx, \"acme/bond/real/v1/bond.proto\")\n\trequire.NoError(t, err)\n\t_, err = module.StatFileInfo(ctx, \"acme/bond/v2/bond.proto\")\n\trequire.NoError(t, err)\n\t_, err = module.StatFileInfo(ctx, \"acme/bond/excluded/v2/excluded.proto\")\n\trequire.True(t, errors.Is(err, fs.ErrNotExist))\n\n\ttestLicenseAndDoc(t, ctx, workspace, isV2)\n\n\tbucketTargeting, err = buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tbucket,\n\t\t\"common/money/proto\",\n\t\t[]string{\"common/money/proto/acme/money/v1/currency_code.proto\"},\n\t\tnil,\n\t\tbuftarget.TerminateAtControllingWorkspace,\n\t)\n\trequire.NoError(t, err)\n\trequire.NotNil(t, bucketTargeting.ControllingWorkspace())\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \"common/money/proto\", bucketTargeting.SubDirPath())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\"common/money/proto/acme/money/v1/currency_code.proto\"},\n\t\tbucketTargeting.TargetPaths(),\n\t)\n\n\tworkspace, err = workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\tbucket,\n\t\tbucketTargeting,\n\t)\n\trequire.NoError(t, err)\n\tmodule = workspace.GetModuleForOpaqueID(\"buf.testing/acme/money\")\n\trequire.NotNil(t, module)\n\trequire.True(t, module.IsTarget())\n\tfileInfo, err := module.StatFileInfo(ctx, \"acme/money/v1/currency_code.proto\")\n\trequire.NoError(t, err)\n\trequire.True(t, fileInfo.IsTargetFile())\n\tfileInfo, err = module.StatFileInfo(ctx, \"acme/money/v1/money.proto\")\n\trequire.NoError(t, err)\n\trequire.False(t, fileInfo.IsTargetFile())\n\n\ttestLicenseAndDoc(t, ctx, workspace, isV2)\n}\n\nfunc TestUnusedDep(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\n\t// This represents some external dependencies from the BSR.\n\tworkspaceProvider := testNewWorkspaceProvider(\n\t\tt,\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName:    \"buf.testing/acme/date\",\n\t\t\tDirPath: \"testdata/basic/bsr/buf.testing/acme/date\",\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName:    \"buf.testing/acme/extension\",\n\t\t\tDirPath: \"testdata/basic/bsr/buf.testing/acme/extension\",\n\t\t},\n\t)\n\n\tstorageosProvider := storageos.NewProvider()\n\tbucket, err := storageosProvider.NewReadWriteBucket(\"testdata/basic/workspace_unused_dep\")\n\trequire.NoError(t, err)\n\tbucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tbucket,\n\t\t\".\",\n\t\tnil,\n\t\tnil,\n\t\tbuftarget.TerminateAtControllingWorkspace,\n\t)\n\trequire.NoError(t, err)\n\trequire.NotNil(t, bucketTargeting.ControllingWorkspace())\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \".\", bucketTargeting.SubDirPath())\n\n\tworkspace, err := workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\tbucket,\n\t\tbucketTargeting,\n\t)\n\trequire.NoError(t, err)\n\n\tmalformedDeps, err := MalformedDepsForWorkspace(workspace)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 2, len(malformedDeps))\n\trequire.Equal(t, \"buf.testing/acme/date\", malformedDeps[0].ModuleRef().FullName().String())\n\trequire.Equal(t, MalformedDepTypeUnused, malformedDeps[0].Type())\n\trequire.Equal(t, \"buf.testing/acme/extension\", malformedDeps[1].ModuleRef().FullName().String())\n\trequire.Equal(t, MalformedDepTypeUnused, malformedDeps[1].Type())\n}\n\nfunc TestDuplicatePath(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\n\t// This represents some external dependencies from the BSR.\n\tworkspaceProvider := testNewWorkspaceProvider(\n\t\tt,\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName:    \"buf.testing/acme/date\",\n\t\t\tDirPath: \"testdata/basic/bsr/buf.testing/acme/date\",\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName:    \"buf.testing/acme/extension\",\n\t\t\tDirPath: \"testdata/basic/bsr/buf.testing/acme/extension\",\n\t\t},\n\t)\n\n\tstorageosProvider := storageos.NewProvider()\n\tbucket, err := storageosProvider.NewReadWriteBucket(\"testdata/basic/workspacev2_duplicate_path\")\n\trequire.NoError(t, err)\n\tbucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tbucket,\n\t\t\".\",\n\t\tnil,\n\t\tnil,\n\t\tbuftarget.TerminateAtControllingWorkspace,\n\t)\n\trequire.NoError(t, err)\n\trequire.NotNil(t, bucketTargeting.ControllingWorkspace())\n\trequire.Equal(t, \".\", bucketTargeting.ControllingWorkspace().Path())\n\trequire.Equal(t, \".\", bucketTargeting.SubDirPath())\n\n\tworkspace, err := workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\tbucket,\n\t\tbucketTargeting,\n\t)\n\trequire.NoError(t, err)\n\trequire.NotNil(t, workspace)\n\n\trequire.Len(t, workspace.Modules(), 7) // 5 local + 2 remote\n\trequire.NotNil(t, workspace.GetModuleForOpaqueID(\"buf.testing/acme/date\"))\n\trequire.NotNil(t, workspace.GetModuleForOpaqueID(\"buf.testing/acme/extension\"))\n\n\tmodule := workspace.GetModuleForOpaqueID(\"proto/shared\")\n\trequire.NotNil(t, module)\n\trequireModuleContainFileNames(t, module, \"prefix/bar/v1/bar.proto\")\n\n\tmodule = workspace.GetModuleForOpaqueID(\"proto/shared-2\")\n\trequire.NotNil(t, module)\n\trequireModuleContainFileNames(t, module, \"prefix/foo/v1/foo.proto\")\n\n\tmodule = workspace.GetModuleForOpaqueID(\"proto/shared1\")\n\trequire.NotNil(t, module)\n\trequireModuleContainFileNames(t, module, \"prefix/x/x.proto\")\n\n\tmodule = workspace.GetModuleForOpaqueID(\"proto/shared1-2\")\n\trequire.NotNil(t, module)\n\trequireModuleContainFileNames(t, module, \"prefix/y/y.proto\")\n\n\tmodule = workspace.GetModuleForOpaqueID(\"separate\")\n\trequire.NotNil(t, module)\n\trequireModuleContainFileNames(t, module, \"v1/separate.proto\")\n}\n\nfunc testNewWorkspaceProvider(t *testing.T, testModuleDatas ...bufmoduletesting.ModuleData) WorkspaceProvider {\n\tbsrProvider, err := bufmoduletesting.NewOmniProvider(testModuleDatas...)\n\trequire.NoError(t, err)\n\treturn NewWorkspaceProvider(\n\t\tslogtestext.NewLogger(t),\n\t\tbsrProvider,\n\t\tbsrProvider,\n\t\tbsrProvider,\n\t\t// TODO: add support for plugins to bufmoduletesting.NewOmniProvider.\n\t\tbufplugin.NopPluginKeyProvider,\n\t)\n}\n\nfunc requireModuleContainFileNames(t *testing.T, module bufmodule.Module, expectedFileNames ...string) {\n\tfileNamesToBeSeen := xslices.ToStructMap(expectedFileNames)\n\trequire.NoError(t, module.WalkFileInfos(t.Context(), func(fi bufmodule.FileInfo) error {\n\t\tpath := fi.Path()\n\t\tif _, ok := fileNamesToBeSeen[path]; !ok {\n\t\t\treturn fmt.Errorf(\"module has unexpected file: %s\", path)\n\t\t}\n\t\tdelete(fileNamesToBeSeen, path)\n\t\treturn nil\n\t}))\n\trequire.Emptyf(t, fileNamesToBeSeen, \"expect %s from module\", xstrings.JoinSliceQuoted(xslices.MapKeysToSlice(fileNamesToBeSeen), \",\"))\n}\n\nfunc requireModuleFileContent(\n\tt *testing.T,\n\tctx context.Context,\n\tmodule bufmodule.Module,\n\tpath string,\n\texpectedContent string,\n) {\n\tfile, err := module.GetFile(ctx, path)\n\trequire.NoError(t, err)\n\tcontent, err := xio.ReadAllAndClose(file)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expectedContent, string(content))\n}\n\nfunc testLicenseAndDoc(t *testing.T, ctx context.Context, workspace Workspace, isV2 bool) {\n\t// bond has its own license and doc\n\tmodule := workspace.GetModuleForOpaqueID(\"buf.testing/acme/bond\")\n\trequire.NotNil(t, module)\n\trequireModuleFileContent(t, ctx, module, \"README.md\", \"bond doc\\n\")\n\trequireModuleFileContent(t, ctx, module, \"LICENSE\", \"bond license\\n\")\n\n\tmodule = workspace.GetModuleForOpaqueID(\"buf.testing/acme/geo\")\n\trequire.NotNil(t, module)\n\t// geo has its own license\n\trequireModuleFileContent(t, ctx, module, \"LICENSE\", \"geo license\\n\")\n\t// geo falls back to top-level doc if it's a v2 workspace\n\tif isV2 {\n\t\trequireModuleFileContent(t, ctx, module, \"README.md\", \"workspace doc\\n\")\n\t} else {\n\t\t_, err := module.StatFileInfo(ctx, \"README.md\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t}\n\t_, err := module.StatFileInfo(ctx, \"buf.md\")\n\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\n\tmodule = workspace.GetModuleForOpaqueID(\"buf.testing/acme/money\")\n\trequire.NotNil(t, module)\n\t// money has its own doc\n\trequireModuleFileContent(t, ctx, module, \"buf.md\", \"money doc\\n\")\n\t// money does not have README.md\n\t_, err = module.StatFileInfo(ctx, \"README.md\")\n\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t// money falls back to top-level license if it's a v2 workspace\n\tif isV2 {\n\t\trequireModuleFileContent(t, ctx, module, \"LICENSE\", \"workspace license\\n\")\n\t} else {\n\t\t_, err = module.StatFileInfo(ctx, \"LICENSE\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t}\n\n\tmodule = workspace.GetModuleForOpaqueID(\"finance/portfolio/proto\")\n\trequire.NotNil(t, module)\n\t// portfolio does not have its own license or doc\n\tif isV2 {\n\t\trequireModuleFileContent(t, ctx, module, \"LICENSE\", \"workspace license\\n\")\n\t\trequireModuleFileContent(t, ctx, module, \"README.md\", \"workspace doc\\n\")\n\t} else {\n\t\t_, err = module.StatFileInfo(ctx, \"LICENSE\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t\t_, err = module.StatFileInfo(ctx, \"README.md\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/bufanalysis.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufanalysis\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\t// FormatText is the text format for FileAnnotations.\n\tFormatText Format = iota + 1\n\t// FormatJSON is the JSON format for FileAnnotations.\n\tFormatJSON\n\t// FormatMSVS is the MSVS format for FileAnnotations.\n\tFormatMSVS\n\t// FormatJUnit is the JUnit format for FileAnnotations.\n\tFormatJUnit\n\t// FormatGithubActions is the Github Actions format for FileAnnotations.\n\t//\n\t// See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message.\n\tFormatGithubActions\n\t// FormatGitLabCodeQuality is the Code Qualiy report format for FileAnnotations.\n\t//\n\t// See https://docs.gitlab.com/ci/testing/code_quality/#code-quality-report-format\n\t// GitLab Code Quality report must be a single JSON array of GitLab Code Quality Issues\n\t// objects with the specified properties.\n\tFormatGitLabCodeQuality\n)\n\nvar (\n\t// AllFormatStrings is all format strings without aliases.\n\t//\n\t// Sorted in the order we want to display them.\n\tAllFormatStrings = []string{\n\t\t\"text\",\n\t\t\"json\",\n\t\t\"msvs\",\n\t\t\"junit\",\n\t\t\"github-actions\",\n\t\t\"gitlab-code-quality\",\n\t}\n\t// AllFormatStringsWithAliases is all format strings with aliases.\n\t//\n\t// Sorted in the order we want to display them.\n\tAllFormatStringsWithAliases = []string{\n\t\t\"text\",\n\t\t\"gcc\",\n\t\t\"json\",\n\t\t\"msvs\",\n\t\t\"junit\",\n\t\t\"github-actions\",\n\t\t\"gitlab-code-quality\",\n\t}\n\n\tstringToFormat = map[string]Format{\n\t\t\"text\": FormatText,\n\t\t// alias for text\n\t\t\"gcc\":                 FormatText,\n\t\t\"json\":                FormatJSON,\n\t\t\"msvs\":                FormatMSVS,\n\t\t\"junit\":               FormatJUnit,\n\t\t\"github-actions\":      FormatGithubActions,\n\t\t\"gitlab-code-quality\": FormatGitLabCodeQuality,\n\t}\n\tformatToString = map[Format]string{\n\t\tFormatText:              \"text\",\n\t\tFormatJSON:              \"json\",\n\t\tFormatMSVS:              \"msvs\",\n\t\tFormatJUnit:             \"junit\",\n\t\tFormatGithubActions:     \"github-actions\",\n\t\tFormatGitLabCodeQuality: \"gitlab-code-quality\",\n\t}\n)\n\n// Format is a FileAnnotation format.\ntype Format int\n\n// String implements fmt.Stringer.\nfunc (f Format) String() string {\n\ts, ok := formatToString[f]\n\tif !ok {\n\t\treturn strconv.Itoa(int(f))\n\t}\n\treturn s\n}\n\n// ParseFormat parses the Format.\n//\n// The empty strings defaults to FormatText.\nfunc ParseFormat(s string) (Format, error) {\n\ts = strings.ToLower(strings.TrimSpace(s))\n\tif s == \"\" {\n\t\treturn FormatText, nil\n\t}\n\tf, ok := stringToFormat[s]\n\tif ok {\n\t\treturn f, nil\n\t}\n\treturn 0, fmt.Errorf(\"unknown format: %q\", s)\n}\n\n// FileInfo is a minimal FileInfo interface.\ntype FileInfo interface {\n\tPath() string\n\tExternalPath() string\n}\n\n// FileAnnotation is a file annotation.\ntype FileAnnotation interface {\n\t// Stringer returns the string representation for this FileAnnotation.\n\tfmt.Stringer\n\n\t// FileInfo is the FileInfo for this annotation.\n\t//\n\t// This may be nil.\n\tFileInfo() FileInfo\n\n\t// StartLine is the starting line.\n\t//\n\t// If the starting line is not known, this will be 0.\n\tStartLine() int\n\t// StartColumn is the starting column.\n\t//\n\t// If the starting column is not known, this will be 0.\n\tStartColumn() int\n\t// EndLine is the ending line.\n\t//\n\t// If the ending line is not known, this will be 0.\n\t// If the ending line is the same as the starting line, this will be explicitly\n\t// set to the same value as start_line.\n\tEndLine() int\n\t// EndColumn is the ending column.\n\t//\n\t// If the ending column is not known, this will be 0.\n\t// If the ending column is the same as the starting column, this will be explicitly\n\t// set to the same value as start_column.\n\tEndColumn() int\n\t// Type is the type of annotation, typically an ID representing a failure type.\n\tType() string\n\t// Message is the message of the annotation.\n\tMessage() string\n\t// PluginName is the name of the plugin that the annotation originated from.\n\t//\n\t// May be empty if this annotation did not originate from a plugin.\n\t// This may be added to the printed message field for certain printers.\n\tPluginName() string\n\t// PolicyName is the name of the policy that the annotation originated from.\n\t//\n\t// May be empty if this annotation did not originate from a policy.\n\t// This may be added to the printed message field for certain printers.\n\tPolicyName() string\n\n\tisFileAnnotation()\n}\n\n// NewFileAnnotation returns a new FileAnnotation.\nfunc NewFileAnnotation(\n\tfileInfo FileInfo,\n\tstartLine int,\n\tstartColumn int,\n\tendLine int,\n\tendColumn int,\n\ttypeString string,\n\tmessage string,\n\tpluginName string,\n\tpolicyName string,\n) FileAnnotation {\n\treturn newFileAnnotation(\n\t\tfileInfo,\n\t\tstartLine,\n\t\tstartColumn,\n\t\tendLine,\n\t\tendColumn,\n\t\ttypeString,\n\t\tmessage,\n\t\tpluginName,\n\t\tpolicyName,\n\t)\n}\n\n// FileAnnotationSet is a set of FileAnnotations.\ntype FileAnnotationSet interface {\n\t// Stringer returns the string representation for this FileAnnotationSet.\n\tfmt.Stringer\n\t// error returns an error for this FileAnnotationSet. It will use the text format\n\t// to create an error message.\n\terror\n\n\t// FileAnnotations returns the FileAnnotations in the set.\n\t//\n\t// This will always be non-empty.\n\t// These will be deduplicated and sorted.\n\tFileAnnotations() []FileAnnotation\n\n\tisFileAnnotationSet()\n}\n\n// NewFileAnnotationSet returns a new FileAnnotationSet.\n//\n// If len(fileAnnotations) is 0, this returns nil.\nfunc NewFileAnnotationSet(fileAnnotations ...FileAnnotation) FileAnnotationSet {\n\treturn newFileAnnotationSet(fileAnnotations)\n}\n\n// PrintFileAnnotationSet prints the file annotations separated by newlines.\nfunc PrintFileAnnotationSet(writer io.Writer, fileAnnotationSet FileAnnotationSet, formatString string) error {\n\tformat, err := ParseFormat(formatString)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tswitch format {\n\tcase FormatText:\n\t\treturn printAsText(writer, fileAnnotationSet.FileAnnotations())\n\tcase FormatJSON:\n\t\treturn printAsJSON(writer, fileAnnotationSet.FileAnnotations())\n\tcase FormatMSVS:\n\t\treturn printAsMSVS(writer, fileAnnotationSet.FileAnnotations())\n\tcase FormatJUnit:\n\t\treturn printAsJUnit(writer, fileAnnotationSet.FileAnnotations())\n\tcase FormatGithubActions:\n\t\treturn printAsGithubActions(writer, fileAnnotationSet.FileAnnotations())\n\tcase FormatGitLabCodeQuality:\n\t\treturn printAsGitLabCodeQuality(writer, fileAnnotationSet.FileAnnotations())\n\tdefault:\n\t\treturn fmt.Errorf(\"unknown FileAnnotation Format: %v\", format)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/bufanalysistesting/bufanalysistesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufanalysistesting\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\n// NewFileAnnotationNoLocationOrPath returns a new FileAnnotation with no location or FileInfo.\nfunc NewFileAnnotationNoLocationOrPath(\n\tt *testing.T,\n\ttypeString string,\n) bufanalysis.FileAnnotation {\n\treturn NewFileAnnotation(\n\t\tt,\n\t\t\"\",\n\t\t0,\n\t\t0,\n\t\t0,\n\t\t0,\n\t\ttypeString,\n\t)\n}\n\n// NewFileAnnotationNoLocation returns a new FileAnnotation with no location.\n//\n// fileInfo can be nil.\nfunc NewFileAnnotationNoLocation(\n\tt *testing.T,\n\tpath string,\n\ttypeString string,\n\toptions ...FileAnnotationOption,\n) bufanalysis.FileAnnotation {\n\treturn NewFileAnnotation(\n\t\tt,\n\t\tpath,\n\t\t1,\n\t\t1,\n\t\t1,\n\t\t1,\n\t\ttypeString,\n\t\toptions...,\n\t)\n}\n\n// NewFileAnnotation returns a new FileAnnotation.\nfunc NewFileAnnotation(\n\tt *testing.T,\n\tpath string,\n\tstartLine int,\n\tstartColumn int,\n\tendLine int,\n\tendColumn int,\n\ttypeString string,\n\toptions ...FileAnnotationOption,\n) bufanalysis.FileAnnotation {\n\treturn newFileAnnotation(\n\t\tt,\n\t\tpath,\n\t\tstartLine,\n\t\tstartColumn,\n\t\tendLine,\n\t\tendColumn,\n\t\ttypeString,\n\t\t\"\", // message\n\t\toptions...,\n\t)\n}\n\n// FileAnnotationOption is an option for a FileAnnotation.\ntype FileAnnotationOption func(*fileAnnotationOptions)\n\n// WithPluginName returns a FileAnnotationOption that sets the plugin name.\nfunc WithPluginName(pluginName string) FileAnnotationOption {\n\treturn func(options *fileAnnotationOptions) {\n\t\toptions.pluginName = pluginName\n\t}\n}\n\n// WithPolicyName returns a FileAnnotationOption that sets the policy name.\nfunc WithPolicyName(policyName string) FileAnnotationOption {\n\treturn func(options *fileAnnotationOptions) {\n\t\toptions.policyName = policyName\n\t}\n}\n\nfunc newFileAnnotation(\n\tt *testing.T,\n\tpath string,\n\tstartLine int,\n\tstartColumn int,\n\tendLine int,\n\tendColumn int,\n\ttypeString string,\n\tmessage string,\n\toptions ...FileAnnotationOption,\n) bufanalysis.FileAnnotation {\n\tfileAnnotationOptions := &fileAnnotationOptions{}\n\tfor _, option := range options {\n\t\toption(fileAnnotationOptions)\n\t}\n\tvar fileInfo bufanalysis.FileInfo\n\tif path != \"\" {\n\t\tfileInfo = newFileInfo(path)\n\t}\n\treturn bufanalysis.NewFileAnnotation(\n\t\tfileInfo,\n\t\tstartLine,\n\t\tstartColumn,\n\t\tendLine,\n\t\tendColumn,\n\t\ttypeString,\n\t\tmessage,\n\t\tfileAnnotationOptions.pluginName,\n\t\tfileAnnotationOptions.policyName,\n\t)\n}\n\n// fileAnnotationOptions holds the options for a FileAnnotation.\ntype fileAnnotationOptions struct {\n\tpluginName string\n\tpolicyName string\n}\n\n// AssertFileAnnotationsEqual asserts that the annotations are equal minus the message.\nfunc AssertFileAnnotationsEqual(\n\tt *testing.T,\n\texpected []bufanalysis.FileAnnotation,\n\tactual []bufanalysis.FileAnnotation,\n) {\n\texpected = normalizeFileAnnotations(t, expected)\n\tactual = normalizeFileAnnotations(t, actual)\n\tif !assert.Equal(\n\t\tt,\n\t\texpected,\n\t\tactual,\n\t) {\n\t\tt.Log(\"If actuals are correct, change expectations to the following:\")\n\t\tfor _, annotation := range actual {\n\t\t\tvar path string\n\t\t\tif fileInfo := annotation.FileInfo(); fileInfo != nil {\n\t\t\t\tpath = fileInfo.Path()\n\t\t\t}\n\t\t\tif annotation.StartLine() == 0 && annotation.StartColumn() == 0 &&\n\t\t\t\tannotation.EndLine() == 0 && annotation.EndColumn() == 0 {\n\t\t\t\tif path == \"\" {\n\t\t\t\t\tt.Logf(\"    bufanalysistesting.NewFileAnnotationNoLocationOrPath(t, %q),\",\n\t\t\t\t\t\tannotation.Type(),\n\t\t\t\t\t)\n\t\t\t\t} else {\n\t\t\t\t\tt.Logf(\"    bufanalysistesting.NewFileAnnotationNoLocation(t, %q, %q),\",\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tannotation.Type(),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tt.Logf(\"    bufanalysistesting.NewFileAnnotation(t, %q, %d, %d, %d, %d, %q, %q %q),\",\n\t\t\t\t\tpath,\n\t\t\t\t\tannotation.StartLine(),\n\t\t\t\t\tannotation.StartColumn(),\n\t\t\t\t\tannotation.EndLine(),\n\t\t\t\t\tannotation.EndColumn(),\n\t\t\t\t\tannotation.Type(),\n\t\t\t\t\tannotation.PluginName(),\n\t\t\t\t\tannotation.PolicyName(),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc normalizeFileAnnotations(\n\tt *testing.T,\n\tfileAnnotations []bufanalysis.FileAnnotation,\n) []bufanalysis.FileAnnotation {\n\tif fileAnnotations == nil {\n\t\treturn nil\n\t}\n\tnormalizedFileAnnotations := make([]bufanalysis.FileAnnotation, len(fileAnnotations))\n\tfor i, a := range fileAnnotations {\n\t\tfileInfo := a.FileInfo()\n\t\tif fileInfo != nil {\n\t\t\tfileInfo = newFileInfo(fileInfo.Path())\n\t\t}\n\t\tnormalizedFileAnnotations[i] = bufanalysis.NewFileAnnotation(\n\t\t\tfileInfo,\n\t\t\ta.StartLine(),\n\t\t\ta.StartColumn(),\n\t\t\ta.EndLine(),\n\t\t\ta.EndColumn(),\n\t\t\ta.Type(),\n\t\t\t\"\",\n\t\t\ta.PluginName(),\n\t\t\ta.PolicyName(),\n\t\t)\n\t}\n\treturn normalizedFileAnnotations\n}\n\ntype fileInfo struct {\n\tpath string\n}\n\nfunc newFileInfo(path string) *fileInfo {\n\treturn &fileInfo{\n\t\tpath: path,\n\t}\n}\n\nfunc (f *fileInfo) Path() string {\n\treturn f.path\n}\n\nfunc (f *fileInfo) ExternalPath() string {\n\treturn f.path\n}\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/bufanalysistesting/bufanalysistesting_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufanalysistesting\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestBasic(t *testing.T) {\n\tt.Parallel()\n\tfileAnnotations := []bufanalysis.FileAnnotation{\n\t\tnewFileAnnotation(\n\t\t\tt,\n\t\t\t\"path/to/file.proto\",\n\t\t\t1,\n\t\t\t0,\n\t\t\t1,\n\t\t\t0,\n\t\t\t\"FOO\",\n\t\t\t\"Hello.\",\n\t\t),\n\t\tnewFileAnnotation(\n\t\t\tt,\n\t\t\t\"path/to/file.proto\",\n\t\t\t2,\n\t\t\t1,\n\t\t\t2,\n\t\t\t1,\n\t\t\t\"FOO\",\n\t\t\t\"Hello.\",\n\t\t\tWithPluginName(\"buf-plugin-foo\"),\n\t\t),\n\t}\n\tsb := &strings.Builder{}\n\terr := bufanalysis.PrintFileAnnotationSet(sb, bufanalysis.NewFileAnnotationSet(fileAnnotations...), \"text\")\n\trequire.NoError(t, err)\n\tassert.Equal(\n\t\tt,\n\t\t`path/to/file.proto:1:1:Hello.\npath/to/file.proto:2:1:Hello. (buf-plugin-foo)\n`,\n\t\tsb.String(),\n\t)\n\tsb.Reset()\n\terr = bufanalysis.PrintFileAnnotationSet(sb, bufanalysis.NewFileAnnotationSet(fileAnnotations...), \"json\")\n\trequire.NoError(t, err)\n\tassert.Equal(\n\t\tt,\n\t\t`{\"path\":\"path/to/file.proto\",\"start_line\":1,\"start_column\":1,\"end_line\":1,\"end_column\":1,\"type\":\"FOO\",\"message\":\"Hello.\"}\n{\"path\":\"path/to/file.proto\",\"start_line\":2,\"start_column\":1,\"end_line\":2,\"end_column\":1,\"type\":\"FOO\",\"message\":\"Hello.\",\"plugin\":\"buf-plugin-foo\"}\n`,\n\t\tsb.String(),\n\t)\n\tsb.Reset()\n\terr = bufanalysis.PrintFileAnnotationSet(sb, bufanalysis.NewFileAnnotationSet(fileAnnotations...), \"msvs\")\n\trequire.NoError(t, err)\n\tassert.Equal(t,\n\t\t`path/to/file.proto(1,1) : error FOO : Hello.\npath/to/file.proto(2,1) : error FOO : Hello. (buf-plugin-foo)\n`,\n\t\tsb.String(),\n\t)\n\tsb.Reset()\n\terr = bufanalysis.PrintFileAnnotationSet(sb, bufanalysis.NewFileAnnotationSet(fileAnnotations...), \"junit\")\n\trequire.NoError(t, err)\n\tassert.Equal(t,\n\t\t`<testsuites>\n  <testsuite name=\"path/to/file\" tests=\"2\" failures=\"2\" errors=\"0\">\n    <testcase name=\"FOO_1\">\n      <failure message=\"path/to/file.proto:1:1:Hello.\" type=\"FOO\"></failure>\n    </testcase>\n    <testcase name=\"FOO_2_1\">\n      <failure message=\"path/to/file.proto:2:1:Hello. (buf-plugin-foo)\" type=\"FOO\"></failure>\n    </testcase>\n  </testsuite>\n</testsuites>\n`,\n\t\tsb.String(),\n\t)\n\tsb.Reset()\n\terr = bufanalysis.PrintFileAnnotationSet(\n\t\tsb,\n\t\tbufanalysis.NewFileAnnotationSet(\n\t\t\tappend(\n\t\t\t\tfileAnnotations,\n\t\t\t\tnewFileAnnotation(\n\t\t\t\t\tt,\n\t\t\t\t\t\"path/to/file.proto\",\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t\"FOO\",\n\t\t\t\t\t\"Hello.\",\n\t\t\t\t),\n\t\t\t\tnewFileAnnotation(\n\t\t\t\t\tt,\n\t\t\t\t\t\"\",\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t\t\"FOO\",\n\t\t\t\t\t\"Hello.\",\n\t\t\t\t\tWithPluginName(\"buf-plugin-foo\"),\n\t\t\t\t),\n\t\t\t)...,\n\t\t),\n\t\t\"github-actions\",\n\t)\n\trequire.NoError(t, err)\n\tassert.Equal(t,\n\t\t`::error file=<input>::Hello. (buf-plugin-foo)\n::error file=path/to/file.proto::Hello.\n::error file=path/to/file.proto,line=1,endLine=1::Hello.\n::error file=path/to/file.proto,line=2,col=1,endLine=2,endColumn=1::Hello. (buf-plugin-foo)\n`,\n\t\tsb.String(),\n\t)\n\tsb.Reset()\n\terr = bufanalysis.PrintFileAnnotationSet(sb, bufanalysis.NewFileAnnotationSet(fileAnnotations...), \"gitlab-code-quality\")\n\trequire.NoError(t, err)\n\tassert.Equal(t,\n\t\t`[{\"description\":\"Hello.\",\"check_name\":\"FOO\",\"fingerprint\":\"7fa769d9df9f6db3b793316aa485c307df262ece452189a1c434e77480e9a6a26759f7616faf70c654639075b2fd170d3b66eef686ad402c72b550305883a7b7\",\"location\":{\"path\":\"path/to/file.proto\",\"positions\":{\"begin\":{\"line\":1},\"end\":{\"line\":1}}},\"severity\":\"minor\"},{\"description\":\"Hello.\",\"check_name\":\"FOO\",\"fingerprint\":\"60eab160b8308bb2c5fb823e200a54d58749513e2f2ad28447584f7223812f106a746ab7bf5fa5493e2e320163f86b46d098cb398f1795715617a825665e2a89\",\"location\":{\"path\":\"path/to/file.proto\",\"positions\":{\"begin\":{\"line\":2,\"column\":1},\"end\":{\"line\":2,\"column\":1}}},\"severity\":\"minor\"}]\n`,\n\t\tsb.String(),\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/bufanalysistesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufanalysistesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/file_annotation.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufanalysis\n\nimport (\n\t\"bytes\"\n\t\"strconv\"\n)\n\ntype fileAnnotation struct {\n\tfileInfo    FileInfo\n\tstartLine   int\n\tstartColumn int\n\tendLine     int\n\tendColumn   int\n\ttypeString  string\n\tmessage     string\n\tpluginName  string\n\tpolicyName  string\n}\n\nfunc newFileAnnotation(\n\tfileInfo FileInfo,\n\tstartLine int,\n\tstartColumn int,\n\tendLine int,\n\tendColumn int,\n\ttypeString string,\n\tmessage string,\n\tpluginName string,\n\tpolicyName string,\n) *fileAnnotation {\n\treturn &fileAnnotation{\n\t\tfileInfo:    fileInfo,\n\t\tstartLine:   startLine,\n\t\tstartColumn: startColumn,\n\t\tendLine:     endLine,\n\t\tendColumn:   endColumn,\n\t\ttypeString:  typeString,\n\t\tmessage:     message,\n\t\tpluginName:  pluginName,\n\t\tpolicyName:  policyName,\n\t}\n}\n\nfunc (f *fileAnnotation) FileInfo() FileInfo {\n\treturn f.fileInfo\n}\n\nfunc (f *fileAnnotation) StartLine() int {\n\treturn f.startLine\n}\n\nfunc (f *fileAnnotation) StartColumn() int {\n\treturn f.startColumn\n}\n\nfunc (f *fileAnnotation) EndLine() int {\n\treturn f.endLine\n}\n\nfunc (f *fileAnnotation) EndColumn() int {\n\treturn f.endColumn\n}\n\nfunc (f *fileAnnotation) Type() string {\n\treturn f.typeString\n}\n\nfunc (f *fileAnnotation) Message() string {\n\treturn f.message\n}\n\nfunc (f *fileAnnotation) PluginName() string {\n\treturn f.pluginName\n}\n\nfunc (f *fileAnnotation) PolicyName() string {\n\treturn f.policyName\n}\n\nfunc (f *fileAnnotation) String() string {\n\tif f == nil {\n\t\treturn \"\"\n\t}\n\tpath := \"<input>\"\n\tline := atLeast1(f.startLine)\n\tcolumn := atLeast1(f.startColumn)\n\tmessage := f.message\n\tif f.fileInfo != nil {\n\t\tpath = f.fileInfo.ExternalPath()\n\t}\n\tif message == \"\" {\n\t\tmessage = f.typeString\n\t\t// should never happen but just in case\n\t\tif message == \"\" {\n\t\t\tmessage = \"FAILURE\"\n\t\t}\n\t}\n\tbuffer := bytes.NewBuffer(nil)\n\t_, _ = buffer.WriteString(path)\n\t_, _ = buffer.WriteRune(':')\n\t_, _ = buffer.WriteString(strconv.Itoa(line))\n\t_, _ = buffer.WriteRune(':')\n\t_, _ = buffer.WriteString(strconv.Itoa(column))\n\t_, _ = buffer.WriteRune(':')\n\t_, _ = buffer.WriteString(message)\n\tif f.pluginName != \"\" || f.policyName != \"\" {\n\t\t_, _ = buffer.WriteString(\" (\")\n\t\tif f.pluginName != \"\" {\n\t\t\t_, _ = buffer.WriteString(f.pluginName)\n\t\t}\n\t\tif f.pluginName != \"\" && f.policyName != \"\" {\n\t\t\t_, _ = buffer.WriteString(\", \")\n\t\t}\n\t\tif f.policyName != \"\" {\n\t\t\t_, _ = buffer.WriteString(f.policyName)\n\t\t}\n\t\t_, _ = buffer.WriteRune(')')\n\t}\n\treturn buffer.String()\n}\n\nfunc (*fileAnnotation) isFileAnnotation() {}\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/file_annotation_set.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufanalysis\n\nimport (\n\t\"crypto/sha256\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype fileAnnotationSet struct {\n\tfileAnnotations []FileAnnotation\n}\n\nfunc newFileAnnotationSet(fileAnnotations []FileAnnotation) *fileAnnotationSet {\n\tif len(fileAnnotations) == 0 {\n\t\treturn nil\n\t}\n\treturn &fileAnnotationSet{\n\t\tfileAnnotations: deduplicateAndSortFileAnnotations(fileAnnotations),\n\t}\n}\n\nfunc (f *fileAnnotationSet) FileAnnotations() []FileAnnotation {\n\treturn f.fileAnnotations\n}\n\nfunc (f *fileAnnotationSet) String() string {\n\tvar sb strings.Builder\n\tfor i, fileAnnotation := range f.fileAnnotations {\n\t\t_, _ = sb.WriteString(fileAnnotation.String())\n\t\tif i != len(f.fileAnnotations)-1 {\n\t\t\t_, _ = sb.WriteRune('\\n')\n\t\t}\n\t}\n\treturn sb.String()\n}\n\nfunc (f *fileAnnotationSet) Error() string {\n\treturn f.String()\n}\n\nfunc (*fileAnnotationSet) isFileAnnotationSet() {}\n\n// deduplicateAndSortFileAnnotations deduplicates the FileAnnotations based on their\n// string representation and sorts them according to the order specified in SortFileAnnotations.\n//\n// This function makes a copy of the input FileAnnotations.\nfunc deduplicateAndSortFileAnnotations(fileAnnotations []FileAnnotation) []FileAnnotation {\n\tdeduplicated := make([]FileAnnotation, 0, len(fileAnnotations))\n\tseen := make(map[string]struct{}, len(fileAnnotations))\n\tfor _, fileAnnotation := range fileAnnotations {\n\t\tkey := hash(fileAnnotation)\n\t\tif _, ok := seen[key]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tseen[key] = struct{}{}\n\t\tdeduplicated = append(deduplicated, fileAnnotation)\n\t}\n\tsortFileAnnotations(deduplicated)\n\treturn deduplicated\n}\n\n// sortFileAnnotations sorts the FileAnnotations.\n//\n// The order of sorting is:\n//\n//\tExternalPath\n//\tStartLine\n//\tStartColumn\n//\tType\n//\tMessage\n//\tEndLine\n//\tEndColumn\nfunc sortFileAnnotations(fileAnnotations []FileAnnotation) {\n\tsort.Stable(sortFileAnnotationSlice(fileAnnotations))\n}\n\ntype sortFileAnnotationSlice []FileAnnotation\n\nfunc (a sortFileAnnotationSlice) Len() int          { return len(a) }\nfunc (a sortFileAnnotationSlice) Swap(i int, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a sortFileAnnotationSlice) Less(i int, j int) bool {\n\treturn fileAnnotationCompareTo(a[i], a[j]) < 0\n}\n\n// fileAnnotationCompareTo returns a value less than 0 if a < b, a value\n// greater than 0 if a > b, and 0 if a == b.\nfunc fileAnnotationCompareTo(a FileAnnotation, b FileAnnotation) int {\n\tif a == nil && b == nil {\n\t\treturn 0\n\t}\n\tif a == nil && b != nil {\n\t\treturn -1\n\t}\n\tif a != nil && b == nil {\n\t\treturn 1\n\t}\n\taFileInfo := a.FileInfo()\n\tbFileInfo := b.FileInfo()\n\tif aFileInfo == nil && bFileInfo != nil {\n\t\treturn -1\n\t}\n\tif aFileInfo != nil && bFileInfo == nil {\n\t\treturn 1\n\t}\n\tif aFileInfo != nil && bFileInfo != nil {\n\t\tif aFileInfo.ExternalPath() < bFileInfo.ExternalPath() {\n\t\t\treturn -1\n\t\t}\n\t\tif aFileInfo.ExternalPath() > bFileInfo.ExternalPath() {\n\t\t\treturn 1\n\t\t}\n\t}\n\tif a.StartLine() < b.StartLine() {\n\t\treturn -1\n\t}\n\tif a.StartLine() > b.StartLine() {\n\t\treturn 1\n\t}\n\tif a.StartColumn() < b.StartColumn() {\n\t\treturn -1\n\t}\n\tif a.StartColumn() > b.StartColumn() {\n\t\treturn 1\n\t}\n\tif a.Type() < b.Type() {\n\t\treturn -1\n\t}\n\tif a.Type() > b.Type() {\n\t\treturn 1\n\t}\n\tif a.Message() < b.Message() {\n\t\treturn -1\n\t}\n\tif a.Message() > b.Message() {\n\t\treturn 1\n\t}\n\tif a.EndLine() < b.EndLine() {\n\t\treturn -1\n\t}\n\tif a.EndLine() > b.EndLine() {\n\t\treturn 1\n\t}\n\tif a.EndColumn() < b.EndColumn() {\n\t\treturn -1\n\t}\n\tif a.EndColumn() > b.EndColumn() {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\n// hash returns a hash value that uniquely identifies the given FileAnnotation.\nfunc hash(fileAnnotation FileAnnotation) string {\n\tpath := \"\"\n\tif fileInfo := fileAnnotation.FileInfo(); fileInfo != nil {\n\t\tpath = fileInfo.ExternalPath()\n\t}\n\thash := sha256.New()\n\t_, _ = hash.Write([]byte(path))\n\t_, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.StartLine())))\n\t_, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.StartColumn())))\n\t_, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.EndLine())))\n\t_, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.EndColumn())))\n\t_, _ = hash.Write([]byte(fileAnnotation.Type()))\n\t_, _ = hash.Write([]byte(fileAnnotation.Message()))\n\t_, _ = hash.Write([]byte(fileAnnotation.PluginName()))\n\t_, _ = hash.Write([]byte(fileAnnotation.PolicyName()))\n\treturn string(hash.Sum(nil))\n}\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/print.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufanalysis\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/shake256\"\n)\n\nfunc printAsText(writer io.Writer, fileAnnotations []FileAnnotation) error {\n\treturn printEachAnnotationOnNewLine(\n\t\twriter,\n\t\tfileAnnotations,\n\t\tprintFileAnnotationAsText,\n\t)\n}\n\nfunc printAsMSVS(writer io.Writer, fileAnnotations []FileAnnotation) error {\n\treturn printEachAnnotationOnNewLine(\n\t\twriter,\n\t\tfileAnnotations,\n\t\tprintFileAnnotationAsMSVS,\n\t)\n}\n\nfunc printAsJSON(writer io.Writer, fileAnnotations []FileAnnotation) error {\n\treturn printEachAnnotationOnNewLine(\n\t\twriter,\n\t\tfileAnnotations,\n\t\tprintFileAnnotationAsJSON,\n\t)\n}\n\nfunc printAsGithubActions(writer io.Writer, fileAnnotations []FileAnnotation) error {\n\treturn printEachAnnotationOnNewLine(\n\t\twriter,\n\t\tfileAnnotations,\n\t\tprintFileAnnotationAsGithubActions,\n\t)\n}\n\nfunc printAsGitLabCodeQuality(writer io.Writer, fileAnnotations []FileAnnotation) error {\n\treport := make([]*externalGitLabCodeQualityIssue, 0, len(fileAnnotations))\n\tfor _, f := range fileAnnotations {\n\t\tif f == nil {\n\t\t\tcontinue\n\t\t}\n\t\tgitLabCodeQualityContentIssue, err := newExternalGitLabCodeQualityIssue(f)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treport = append(report, gitLabCodeQualityContentIssue)\n\t}\n\treturn json.NewEncoder(writer).Encode(report)\n}\n\nfunc printAsJUnit(writer io.Writer, fileAnnotations []FileAnnotation) error {\n\tencoder := xml.NewEncoder(writer)\n\tencoder.Indent(\"\", \"  \")\n\ttestsuites := xml.StartElement{Name: xml.Name{Local: \"testsuites\"}}\n\terr := encoder.EncodeToken(testsuites)\n\tif err != nil {\n\t\treturn err\n\t}\n\tannotationsByPath := groupAnnotationsByPath(fileAnnotations)\n\tfor _, annotations := range annotationsByPath {\n\t\tpath := \"<input>\"\n\t\tif fileInfo := annotations[0].FileInfo(); fileInfo != nil {\n\t\t\tpath = fileInfo.ExternalPath()\n\t\t}\n\t\tpath = strings.TrimSuffix(path, \".proto\")\n\t\ttestsuite := xml.StartElement{\n\t\t\tName: xml.Name{Local: \"testsuite\"},\n\t\t\tAttr: []xml.Attr{\n\t\t\t\t{Name: xml.Name{Local: \"name\"}, Value: path},\n\t\t\t\t{Name: xml.Name{Local: \"tests\"}, Value: strconv.Itoa(len(annotations))},\n\t\t\t\t{Name: xml.Name{Local: \"failures\"}, Value: strconv.Itoa(len(annotations))},\n\t\t\t\t{Name: xml.Name{Local: \"errors\"}, Value: \"0\"},\n\t\t\t},\n\t\t}\n\t\tif err := encoder.EncodeToken(testsuite); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, annotation := range annotations {\n\t\t\tif err := printFileAnnotationAsJUnit(encoder, annotation); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := encoder.EncodeToken(xml.EndElement{Name: testsuite.Name}); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := encoder.EncodeToken(xml.EndElement{Name: testsuites.Name}); err != nil {\n\t\treturn err\n\t}\n\tif err := encoder.Flush(); err != nil {\n\t\treturn err\n\t}\n\tif _, err := writer.Write([]byte(\"\\n\")); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc printFileAnnotationAsJUnit(encoder *xml.Encoder, annotation FileAnnotation) error {\n\ttestcase := xml.StartElement{Name: xml.Name{Local: \"testcase\"}}\n\tname := annotation.Type()\n\tif annotation.StartColumn() != 0 {\n\t\tname += fmt.Sprintf(\"_%d_%d\", annotation.StartLine(), annotation.StartColumn())\n\t} else if annotation.StartLine() != 0 {\n\t\tname += fmt.Sprintf(\"_%d\", annotation.StartLine())\n\t}\n\ttestcase.Attr = append(testcase.Attr, xml.Attr{Name: xml.Name{Local: \"name\"}, Value: name})\n\tif err := encoder.EncodeToken(testcase); err != nil {\n\t\treturn err\n\t}\n\tfailure := xml.StartElement{\n\t\tName: xml.Name{Local: \"failure\"},\n\t\tAttr: []xml.Attr{\n\t\t\t{Name: xml.Name{Local: \"message\"}, Value: annotation.String()},\n\t\t\t{Name: xml.Name{Local: \"type\"}, Value: annotation.Type()},\n\t\t},\n\t}\n\tif err := encoder.EncodeToken(failure); err != nil {\n\t\treturn err\n\t}\n\tif err := encoder.EncodeToken(xml.EndElement{Name: failure.Name}); err != nil {\n\t\treturn err\n\t}\n\tif err := encoder.EncodeToken(xml.EndElement{Name: testcase.Name}); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc groupAnnotationsByPath(annotations []FileAnnotation) [][]FileAnnotation {\n\tpathToIndex := make(map[string]int)\n\tannotationsByPath := make([][]FileAnnotation, 0)\n\tfor _, annotation := range annotations {\n\t\tpath := \"<input>\"\n\t\tif fileInfo := annotation.FileInfo(); fileInfo != nil {\n\t\t\tpath = fileInfo.ExternalPath()\n\t\t}\n\t\tindex, ok := pathToIndex[path]\n\t\tif !ok {\n\t\t\tindex = len(annotationsByPath)\n\t\t\tpathToIndex[path] = index\n\t\t\tannotationsByPath = append(annotationsByPath, nil)\n\t\t}\n\t\tannotationsByPath[index] = append(annotationsByPath[index], annotation)\n\t}\n\treturn annotationsByPath\n}\n\nfunc printFileAnnotationAsText(buffer *bytes.Buffer, f FileAnnotation) error {\n\t_, _ = buffer.WriteString(f.String())\n\treturn nil\n}\n\nfunc printFileAnnotationAsMSVS(buffer *bytes.Buffer, f FileAnnotation) error {\n\t// This will work as long as f != (*fileAnnotation)(nil)\n\tif f == nil {\n\t\treturn nil\n\t}\n\tpath := \"<input>\"\n\tline := atLeast1(f.StartLine())\n\tcolumn := atLeast1(f.StartColumn())\n\tmessage := f.Message()\n\tif f.FileInfo() != nil {\n\t\tpath = f.FileInfo().ExternalPath()\n\t}\n\ttypeString := f.Type()\n\tif typeString == \"\" {\n\t\t// should never happen but just in case\n\t\ttypeString = \"FAILURE\"\n\t}\n\tif message == \"\" {\n\t\tmessage = f.Type()\n\t\t// should never happen but just in case\n\t\tif message == \"\" {\n\t\t\tmessage = \"FAILURE\"\n\t\t}\n\t}\n\t_, _ = buffer.WriteString(path)\n\t_, _ = buffer.WriteRune('(')\n\t_, _ = buffer.WriteString(strconv.Itoa(line))\n\tif column != 0 {\n\t\t_, _ = buffer.WriteRune(',')\n\t\t_, _ = buffer.WriteString(strconv.Itoa(column))\n\t}\n\t_, _ = buffer.WriteString(\") : error \")\n\t_, _ = buffer.WriteString(typeString)\n\t_, _ = buffer.WriteString(\" : \")\n\t_, _ = buffer.WriteString(message)\n\tif pluginName, policyName := f.PluginName(), f.PolicyName(); pluginName != \"\" || policyName != \"\" {\n\t\t_, _ = buffer.WriteString(\" (\")\n\t\tif pluginName != \"\" {\n\t\t\t_, _ = buffer.WriteString(pluginName)\n\t\t}\n\t\tif pluginName != \"\" && policyName != \"\" {\n\t\t\t_, _ = buffer.WriteString(\", \")\n\t\t}\n\t\tif policyName != \"\" {\n\t\t\t_, _ = buffer.WriteString(policyName)\n\t\t}\n\t\t_, _ = buffer.WriteRune(')')\n\t}\n\treturn nil\n}\n\nfunc printFileAnnotationAsJSON(buffer *bytes.Buffer, f FileAnnotation) error {\n\tdata, err := json.Marshal(newExternalFileAnnotation(f))\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, _ = buffer.Write(data)\n\treturn nil\n}\n\nfunc printFileAnnotationAsGithubActions(buffer *bytes.Buffer, f FileAnnotation) error {\n\tif f == nil {\n\t\treturn nil\n\t}\n\t_, _ = buffer.WriteString(\"::error \")\n\n\t// file= is required for GitHub Actions, however it is possible to not have\n\t// a path for a FileAnnotation. We still print something, however we need\n\t// to test what happens in GitHub Actions if no valid path is printed out.\n\tpath := \"<input>\"\n\tif f.FileInfo() != nil {\n\t\tpath = f.FileInfo().ExternalPath()\n\t}\n\t_, _ = buffer.WriteString(\"file=\")\n\t_, _ = buffer.WriteString(path)\n\n\t// Everything else is optional.\n\tif startLine := f.StartLine(); startLine > 0 {\n\t\t_, _ = buffer.WriteString(\",line=\")\n\t\t_, _ = buffer.WriteString(strconv.Itoa(startLine))\n\t\t// We only print column information if we have line information.\n\t\tif startColumn := f.StartColumn(); startColumn > 0 {\n\t\t\t_, _ = buffer.WriteString(\",col=\")\n\t\t\t_, _ = buffer.WriteString(strconv.Itoa(startColumn))\n\t\t}\n\t\t// We only do any ending line information if we have starting line information\n\t\tif endLine := f.EndLine(); endLine > 0 {\n\t\t\t_, _ = buffer.WriteString(\",endLine=\")\n\t\t\t_, _ = buffer.WriteString(strconv.Itoa(endLine))\n\t\t\t// We only print column information if we have line information.\n\t\t\tif endColumn := f.EndColumn(); endColumn > 0 {\n\t\t\t\t// Yes, the spec has \"col\" for start and \"endColumn\" for end.\n\t\t\t\t_, _ = buffer.WriteString(\",endColumn=\")\n\t\t\t\t_, _ = buffer.WriteString(strconv.Itoa(endColumn))\n\t\t\t}\n\t\t}\n\t}\n\n\t_, _ = buffer.WriteString(\"::\")\n\t_, _ = buffer.WriteString(f.Message())\n\tif pluginName, policyName := f.PluginName(), f.PolicyName(); pluginName != \"\" || policyName != \"\" {\n\t\t_, _ = buffer.WriteString(\" (\")\n\t\tif pluginName != \"\" {\n\t\t\t_, _ = buffer.WriteString(pluginName)\n\t\t}\n\t\tif pluginName != \"\" && policyName != \"\" {\n\t\t\t_, _ = buffer.WriteString(\", \")\n\t\t}\n\t\tif policyName != \"\" {\n\t\t\t_, _ = buffer.WriteString(policyName)\n\t\t}\n\t\t_, _ = buffer.WriteRune(')')\n\t}\n\treturn nil\n}\n\ntype externalFileAnnotation struct {\n\tPath        string `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\tStartLine   int    `json:\"start_line,omitempty\" yaml:\"start_line,omitempty\"`\n\tStartColumn int    `json:\"start_column,omitempty\" yaml:\"start_column,omitempty\"`\n\tEndLine     int    `json:\"end_line,omitempty\" yaml:\"end_line,omitempty\"`\n\tEndColumn   int    `json:\"end_column,omitempty\" yaml:\"end_column,omitempty\"`\n\tType        string `json:\"type,omitempty\" yaml:\"type,omitempty\"`\n\tMessage     string `json:\"message,omitempty\" yaml:\"message,omitempty\"`\n\tPlugin      string `json:\"plugin,omitempty\" yaml:\"plugin,omitempty\"`\n\tPolicy      string `json:\"policy,omitempty\" yaml:\"policy,omitempty\"`\n}\n\nfunc newExternalFileAnnotation(f FileAnnotation) externalFileAnnotation {\n\tpath := \"\"\n\tif f.FileInfo() != nil {\n\t\tpath = f.FileInfo().ExternalPath()\n\t}\n\treturn externalFileAnnotation{\n\t\tPath:        path,\n\t\tStartLine:   atLeast1(f.StartLine()),\n\t\tStartColumn: atLeast1(f.StartColumn()),\n\t\tEndLine:     atLeast1(f.EndLine()),\n\t\tEndColumn:   atLeast1(f.EndColumn()),\n\t\tType:        f.Type(),\n\t\tMessage:     f.Message(),\n\t\tPlugin:      f.PluginName(),\n\t\tPolicy:      f.PolicyName(),\n\t}\n}\n\n// externalGitLabCodeQualityIssue represents the GitLab Code Quality Report Issue structure\n// expected for the GitLab Code Quality Report output.\n//\n// https://docs.gitlab.com/ci/testing/code_quality/#code-quality-report-format\n// Note that all fields are required for GitLabCodeQualityIssues. If a field is missing,\n// for example, the path of a deleted file in breaking changes, no GitLab Code Quality violation\n// will be surfaced in the Code Quality Report.\ntype externalGitLabCodeQualityIssue struct {\n\t// Description is a human readable description of the code quality violation. This maps\n\t// to the Message in FileAnnotation.\n\tDescription string `json:\"description,omitempty\"`\n\t// CheckName is a human readable name of the check or rule. This maps to the Type in\n\t// FileAnnotation.\n\tCheckName string `json:\"check_name,omitempty\"`\n\t// Fingerprint is a unique identifier for the specific code quality violation. This maps\n\t// to a shake256 digest of the JSON FileAnnotation.\n\tFingerprint string `json:\"fingerprint,omitempty\"`\n\t// Location is a location structure that represents the file location of the code quality\n\t// violation.\n\tLocation externalGitLabCodeQualityIssueLocation `json:\"location\"`\n\t// Severity is the line location of the code quality violation. We use \"minor\" as the default.\n\tSeverity string `json:\"severity,omitempty\"`\n}\n\ntype externalGitLabCodeQualityIssueLocation struct {\n\t// Path is the relative file path of the code quality violation. This maps to the external\n\t// path of the FileAnnotation.\n\tPath string `json:\"path,omitempty\"`\n\t// Positions is the line location of the code quality violation. This maps to StartLine\n\t// of the FileAnnotation.\n\tPositions externalGitLabCodeQualityIssueLocationPositions `json:\"positions\"`\n}\n\ntype externalGitLabCodeQualityIssueLocationPositions struct {\n\tBegin externalGitLabCodeQualityIssueLocationPosition `json:\"begin\"`\n\tEnd   externalGitLabCodeQualityIssueLocationPosition `json:\"end\"`\n}\n\ntype externalGitLabCodeQualityIssueLocationPosition struct {\n\tLine   int `json:\"line,omitempty\"`\n\tColumn int `json:\"column,omitempty\"`\n}\n\n// newExternalGitLabCodeQualityIssue returns an externalGitLabCodeQualityIssue for the\n// specified FileAnnotation.\nfunc newExternalGitLabCodeQualityIssue(f FileAnnotation) (*externalGitLabCodeQualityIssue, error) {\n\tpath := \"\"\n\tif f.FileInfo() != nil {\n\t\t// GitLab Code Quality Issues strictly require the path to be a relative path based on\n\t\t// the repository. This will need to be enforced by the user.\n\t\tpath = f.FileInfo().ExternalPath()\n\t}\n\tgitLabCodeQualityIssue := externalGitLabCodeQualityIssue{\n\t\tDescription: f.Message(),\n\t\tCheckName:   f.Type(),\n\t\tLocation: externalGitLabCodeQualityIssueLocation{\n\t\t\tPath: path,\n\t\t\tPositions: externalGitLabCodeQualityIssueLocationPositions{\n\t\t\t\tBegin: externalGitLabCodeQualityIssueLocationPosition{\n\t\t\t\t\tLine:   f.StartLine(),\n\t\t\t\t\tColumn: f.StartColumn(),\n\t\t\t\t},\n\t\t\t\tEnd: externalGitLabCodeQualityIssueLocationPosition{\n\t\t\t\t\tLine:   f.EndLine(),\n\t\t\t\t\tColumn: f.EndColumn(),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tSeverity: \"minor\",\n\t}\n\tgitLabCodeQualityIssueContent, err := json.Marshal(gitLabCodeQualityIssue)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// We use the hash of the GitLab Code Quality issues content, minus the hash itself.\n\thash, err := shake256.NewDigestForContent(bytes.NewReader(gitLabCodeQualityIssueContent))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgitLabCodeQualityIssue.Fingerprint = hex.EncodeToString(hash.Value())\n\treturn &gitLabCodeQualityIssue, nil\n}\n\nfunc printEachAnnotationOnNewLine(\n\twriter io.Writer,\n\tfileAnnotations []FileAnnotation,\n\tfileAnnotationPrinter func(writer *bytes.Buffer, fileAnnotation FileAnnotation) error,\n) error {\n\tbuffer := bytes.NewBuffer(nil)\n\tfor _, fileAnnotation := range fileAnnotations {\n\t\tbuffer.Reset()\n\t\tif err := fileAnnotationPrinter(buffer, fileAnnotation); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, _ = buffer.WriteString(\"\\n\")\n\t\tif _, err := writer.Write(buffer.Bytes()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufanalysis\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufanalysis/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufanalysis\n\nfunc atLeast1(i int) int {\n\tif i <= 0 {\n\t\treturn 1\n\t}\n\treturn i\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/annotation.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n)\n\ntype annotation struct {\n\tcheck.Annotation\n\n\tpluginName string\n\tpolicyName string\n}\n\nfunc newAnnotation(checkAnnotation check.Annotation, pluginName string, policyName string) *annotation {\n\treturn &annotation{\n\t\tAnnotation: checkAnnotation,\n\t\tpluginName: pluginName,\n\t\tpolicyName: policyName,\n\t}\n}\n\nfunc (a *annotation) PluginName() string {\n\treturn a.pluginName\n}\n\nfunc (a *annotation) PolicyName() string {\n\treturn a.policyName\n}\n\nfunc annotationsToFileAnnotations(\n\tpathToExternalPath map[string]string,\n\tannotations []*annotation,\n) []bufanalysis.FileAnnotation {\n\treturn xslices.Map(\n\t\tannotations,\n\t\tfunc(annotation *annotation) bufanalysis.FileAnnotation {\n\t\t\treturn annotationToFileAnnotation(pathToExternalPath, annotation)\n\t\t},\n\t)\n}\n\nfunc annotationToFileAnnotation(\n\tpathToExternalPath map[string]string,\n\tannotation *annotation,\n) bufanalysis.FileAnnotation {\n\tfileLocation := annotation.FileLocation()\n\tif fileLocation == nil {\n\t\t// We have to do this or we get a weird fileInfo != nil but it is nil thing.\n\t\treturn bufanalysis.NewFileAnnotation(\n\t\t\tnil,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\tannotation.RuleID(),\n\t\t\tannotation.Message(),\n\t\t\tannotation.PluginName(),\n\t\t\tannotation.PolicyName(),\n\t\t)\n\t}\n\tpath := fileLocation.FileDescriptor().ProtoreflectFileDescriptor().Path()\n\t// While it never should, it is OK if pathToExternalPath returns \"\" for a given path.\n\t// We handle this in fileInfo.\n\tfileInfo := newFileInfo(path, pathToExternalPath[path])\n\tstartLine := fileLocation.StartLine() + 1\n\tstartColumn := fileLocation.StartColumn() + 1\n\tendLine := fileLocation.EndLine() + 1\n\tendColumn := fileLocation.EndColumn() + 1\n\treturn bufanalysis.NewFileAnnotation(\n\t\tfileInfo,\n\t\tstartLine,\n\t\tstartColumn,\n\t\tendLine,\n\t\tendColumn,\n\t\tannotation.RuleID(),\n\t\tannotation.Message(),\n\t\tannotation.PluginName(),\n\t\tannotation.PolicyName(),\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/breaking_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck_test\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis/bufanalysistesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestRunBreakingEnumNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_enum_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 1, 18, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 14, 4, \"ENUM_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingEnumSameJSONFormat(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_enum_same_json_format\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 1, 11, 2, \"ENUM_SAME_JSON_FORMAT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 1, 15, 2, \"ENUM_SAME_JSON_FORMAT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 26, 3, 26, 52, \"ENUM_SAME_JSON_FORMAT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 11, 1, 13, 2, \"ENUM_SAME_JSON_FORMAT\"),\n\t)\n}\n\nfunc TestRunBreakingEnumSameType(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_enum_same_type\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 1, 11, 2, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 1, 15, 2, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 5, 1, 7, 2, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 17, 1, 19, 2, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 5, 1, 7, 2, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 17, 1, 19, 2, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 26, 3, 26, 38, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 11, 1, 13, 2, \"ENUM_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 29, 3, 29, 36, \"ENUM_SAME_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingEnumValueNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_enum_value_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 8, 2, \"ENUM_VALUE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 5, 15, 6, \"ENUM_VALUE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 3, 25, 4, \"ENUM_VALUE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 1, 42, 2, \"ENUM_VALUE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 48, 1, 52, 2, \"ENUM_VALUE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingEnumValueNoDeleteUnlessNameReserved(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_enum_value_no_delete_unless_name_reserved\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 9, 2, \"ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 5, 17, 6, \"ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 3, 28, 4, \"ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 1, 45, 2, \"ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 48, 1, 52, 2, \"ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t)\n}\n\nfunc TestRunBreakingEnumValueNoDeleteUnlessNumberReserved(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_enum_value_no_delete_unless_number_reserved\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 9, 2, \"ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 5, 17, 6, \"ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 3, 28, 4, \"ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 1, 45, 2, \"ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 48, 1, 52, 2, \"ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t)\n}\n\nfunc TestRunBreakingEnumValueSameName(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_enum_value_same_name\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 15, 8, 16, \"ENUM_VALUE_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 20, 16, 21, \"ENUM_VALUE_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 27, 19, 27, 20, \"ENUM_VALUE_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 46, 16, 46, 17, \"ENUM_VALUE_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 47, 18, 47, 19, \"ENUM_VALUE_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 51, 16, 51, 17, \"ENUM_VALUE_SAME_NAME\"),\n\t)\n}\n\nfunc TestRunBreakingExtensionMessageNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_extension_message_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 11, 2, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 11, 2, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 11, 2, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 15, 5, 21, 6, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 15, 5, 21, 6, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 15, 5, 21, 6, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 30, 3, 36, 4, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 30, 3, 36, 4, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 30, 3, 36, 4, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 49, 1, 53, 2, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 75, 1, 81, 2, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 75, 1, 81, 2, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 75, 1, 81, 2, \"EXTENSION_MESSAGE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingExtensionNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_extension_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"2.proto\", \"EXTENSION_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"2.proto\", \"EXTENSION_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"2.proto\", \"EXTENSION_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"3.proto\", \"EXTENSION_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 8, 3, 14, 4, \"EXTENSION_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingFieldNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 8, 2, \"FIELD_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 1, 33, 2, \"FIELD_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 5, 15, 6, \"FIELD_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 3, 25, 4, \"FIELD_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 57, 1, 60, 2, \"FIELD_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingFieldNoDeleteUnlessNameReserved(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_no_delete_unless_name_reserved\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 9, 2, \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 1, 35, 2, \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 1, 35, 2, \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 5, 17, 6, \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 3, 28, 4, \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 57, 1, 61, 2, \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\"),\n\t)\n}\n\nfunc TestRunBreakingFieldNoDeleteUnlessNumberReserved(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_no_delete_unless_number_reserved\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 9, 2, \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 1, 35, 2, \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 1, 35, 2, \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 5, 17, 6, \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 3, 28, 4, \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 57, 1, 61, 2, \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameCardinality(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_cardinality\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 8, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 24, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 19, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 16, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 18, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 3, 13, 17, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 7, 19, 30, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 7, 20, 28, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 7, 21, 23, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 7, 22, 20, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 22, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 7, 24, 21, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 32, 7, 32, 33, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 5, 40, 28, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 5, 41, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 5, 42, 21, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 5, 43, 18, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 5, 44, 20, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 45, 5, 45, 19, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 48, 5, 48, 19, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 54, 5, 54, 30, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 6, 3, 6, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 3, 13, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 14, 3, 14, 24, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 70, 3, 70, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 71, 3, 71, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 17, 7, 17, 32, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 25, 3, 25, 20, \"FIELD_SAME_CARDINALITY\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameCppStringType(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_cpp_string_type\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 23, 8, 41, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 22, 9, 32, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 23, 12, 57, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 22, 13, 56, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 15, 22, 15, 34, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 21, 16, 39, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 17, 3, 17, 30, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 18, 30, 18, 66, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 22, 19, 56, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 29, 23, 39, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 26, 30, 26, 64, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 27, 29, 27, 63, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 30, 25, 30, 35, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 31, 34, 31, 52, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 33, 25, 33, 59, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 24, 34, 58, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 8, 23, 8, 57, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 9, 22, 9, 56, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 12, 23, 12, 33, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 22, 13, 40, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 15, 22, 15, 58, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 16, 21, 16, 55, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 17, 3, 17, 30, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 18, 30, 18, 42, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 20, 21, 20, 39, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 22, 22, 22, 58, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 23, 21, 23, 55, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 24, 3, 24, 30, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 25, 30, 25, 42, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 26, 22, 26, 32, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 27, 21, 27, 39, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 30, 24, 30, 34, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 31, 34, 31, 52, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 33, 25, 33, 59, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 34, 24, 34, 58, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 43, 7, 43, 37, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 44, 29, 44, 63, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 11, 24, 11, 36, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 12, 23, 12, 33, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 13, 33, 13, 51, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 14, 32, 14, 68, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 16, 23, 16, 57, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 17, 3, 17, 32, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 27, 39, 27, 73, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 28, 7, 28, 29, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 30, 29, 30, 41, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 36, 3, 36, 33, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 40, 3, 40, 34, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameCType(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_ctype\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 6, 19, 6, 39, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 3, 7, 18, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 23, 13, 43, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 14, 7, 14, 22, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 21, 23, 33, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 49, 28, 49, 48, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 50, 28, 50, 42, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 58, 32, 58, 44, \"FIELD_SAME_CPP_STRING_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameJavaUTF8Validation(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_java_utf8_validation\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 3, 19, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 3, 20, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 3, 21, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 3, 21, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 30, 3, 30, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 31, 3, 31, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 32, 3, 32, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 32, 3, 32, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 3, 42, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 3, 43, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 3, 44, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 3, 44, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 54, 3, 54, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 55, 3, 55, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 56, 3, 56, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 56, 3, 56, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 66, 3, 66, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 67, 3, 67, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 68, 3, 68, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 68, 3, 68, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 5, 1, 5, 38, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 5, 1, 5, 38, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 5, 1, 5, 38, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 5, 1, 5, 38, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 6, 3, 6, 17, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 7, 3, 7, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 8, 3, 8, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 8, 3, 8, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 8, 3, 8, 17, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 9, 3, 9, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 10, 3, 10, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 10, 3, 10, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 85, 18, 85, 60, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 87, 3, 87, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 87, 3, 87, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 10, 3, 10, 17, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 11, 3, 11, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 12, 3, 12, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 12, 3, 12, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 87, 18, 87, 59, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 89, 3, 89, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 89, 3, 89, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 11, 3, 11, 17, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 12, 3, 12, 26, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 13, 3, 13, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 13, 3, 13, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 23, 5, 23, 24, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 24, 5, 24, 33, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 106, 5, 106, 24, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 114, 3, 114, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 114, 3, 114, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 125, 3, 125, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 125, 3, 125, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 134, 3, 134, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 135, 3, 135, 31, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 154, 3, 154, 22, \"FIELD_SAME_JAVA_UTF8_VALIDATION\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameDefault(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_default\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 3, 7, 26, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 27, 9, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 25, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 14, 26, 14, 41, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 18, 5, 18, 27, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 28, 20, 41, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 25, 5, 25, 28, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 27, 29, 27, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 32, 5, 32, 28, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 29, 34, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 39, 5, 39, 29, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 30, 41, 43, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 46, 5, 46, 30, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 48, 31, 48, 44, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 53, 5, 53, 27, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 55, 28, 55, 41, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 60, 5, 60, 28, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 62, 29, 62, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 67, 5, 67, 28, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 69, 29, 69, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 74, 5, 74, 29, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 76, 30, 76, 43, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 81, 5, 81, 30, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 83, 31, 83, 44, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 88, 5, 88, 27, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 90, 28, 90, 41, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 95, 5, 95, 28, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 97, 29, 97, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 102, 5, 102, 26, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 104, 27, 104, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 109, 5, 109, 26, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 111, 27, 111, 40, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 140, 30, 140, 45, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 141, 5, 141, 27, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 148, 29, 148, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 150, 28, 150, 43, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 153, 29, 153, 42, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 6, 18, 6, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 8, 17, 8, 30, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 10, 17, 10, 32, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 12, 16, 12, 30, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 15, 19, 15, 32, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 17, 20, 17, 35, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 21, 20, 21, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 23, 21, 23, 34, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 27, 20, 27, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 29, 19, 29, 34, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 33, 21, 33, 34, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 35, 20, 35, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 39, 22, 39, 35, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 41, 19, 41, 31, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 45, 19, 45, 32, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 47, 20, 47, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 51, 20, 51, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 53, 20, 53, 35, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 57, 20, 57, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 59, 20, 59, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 63, 21, 63, 34, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 65, 19, 65, 32, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 69, 22, 69, 35, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 71, 19, 71, 34, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 75, 19, 75, 36, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 77, 20, 77, 33, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 81, 20, 81, 37, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 83, 20, 83, 35, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 87, 18, 87, 32, \"FIELD_SAME_DEFAULT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 89, 20, 89, 33, \"FIELD_SAME_DEFAULT\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameJSONName(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_json_name\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 6, 3, 6, 17, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 18, 7, 35, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 20, 8, 37, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 27, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 28, 10, 46, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 27, 11, 45, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 31, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 32, 13, 50, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 14, 31, 14, 49, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 7, 20, 21, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 22, 21, 39, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 24, 22, 41, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 31, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 32, 24, 50, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 25, 31, 25, 49, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 26, 7, 26, 35, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 27, 36, 27, 54, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 28, 35, 28, 53, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 5, 43, 19, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 20, 44, 37, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 45, 22, 45, 39, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 46, 5, 46, 29, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 47, 30, 47, 48, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 48, 29, 48, 47, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 49, 5, 49, 33, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 50, 34, 50, 52, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 51, 33, 51, 51, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 92, 5, 92, 19, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 93, 20, 93, 37, \"FIELD_SAME_JSON_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 94, 22, 94, 39, \"FIELD_SAME_JSON_NAME\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameJSType(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_jstype\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 6, 18, 6, 36, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 3, 7, 17, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 22, 13, 40, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 14, 7, 14, 21, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 20, 22, 38, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 51, 27, 51, 45, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 52, 3, 52, 26, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 57, 32, 57, 50, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 58, 34, 58, 52, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 59, 5, 59, 34, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 68, 29, 68, 47, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 69, 29, 69, 47, \"FIELD_SAME_JSTYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 70, 3, 70, 28, \"FIELD_SAME_JSTYPE\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameLabel(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_label\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 8, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 8, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 8, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 24, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 24, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 24, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 19, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 19, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 19, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 16, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 16, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 16, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 18, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 18, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 18, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 3, 13, 17, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 3, 13, 17, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 3, 13, 17, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 7, 19, 30, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 7, 19, 30, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 7, 19, 30, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 7, 20, 28, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 7, 20, 28, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 7, 20, 28, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 7, 21, 23, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 7, 21, 23, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 7, 21, 23, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 7, 22, 20, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 7, 22, 20, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 7, 22, 20, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 22, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 22, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 22, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 7, 24, 21, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 7, 24, 21, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 7, 24, 21, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 32, 7, 32, 33, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 32, 7, 32, 33, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 5, 40, 28, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 5, 40, 28, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 5, 40, 28, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 5, 41, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 5, 41, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 5, 41, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 5, 42, 21, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 5, 42, 21, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 5, 42, 21, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 5, 43, 18, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 5, 43, 18, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 5, 43, 18, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 5, 44, 20, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 5, 44, 20, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 5, 44, 20, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 45, 5, 45, 19, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 45, 5, 45, 19, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 45, 5, 45, 19, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 48, 5, 48, 19, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 6, 3, 6, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 3, 13, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 3, 13, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 3, 13, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 14, 3, 14, 24, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 14, 3, 14, 24, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 14, 3, 14, 24, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 70, 3, 70, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 70, 3, 70, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 70, 3, 70, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 71, 3, 71, 26, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 71, 3, 71, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 71, 3, 71, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameName(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_name\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 9, 7, 13, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 15, 13, 15, 17, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 26, 11, 26, 15, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 35, 14, 35, 25, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 48, 23, 48, 33, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 64, 19, 64, 27, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 72, 19, 72, 29, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 78, 11, 78, 15, \"FIELD_SAME_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 82, 19, 82, 27, \"FIELD_SAME_NAME\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameOneof(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_oneof\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 6, 3, 6, 17, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 5, 8, 19, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 5, 11, 21, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 18, 7, 18, 21, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 9, 20, 23, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 9, 23, 25, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 37, 5, 37, 19, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 39, 7, 39, 21, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 7, 42, 23, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 95, 3, 95, 17, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 97, 5, 97, 19, \"FIELD_SAME_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 100, 5, 100, 21, \"FIELD_SAME_ONEOF\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameType(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_type\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 12, 8, 17, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 12, 9, 15, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 6, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 6, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 3, 13, 18, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 16, 19, 21, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 16, 20, 19, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 7, 22, 10, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 10, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 7, 24, 22, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 36, 14, 36, 19, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 37, 14, 37, 17, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 39, 5, 39, 8, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 5, 40, 8, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 5, 41, 20, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 57, 5, 57, 10, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 58, 5, 58, 9, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 68, 12, 68, 16, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 8, 3, 8, 7, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 9, 3, 9, 7, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 31, 5, 31, 9, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 33, 5, 33, 10, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 38, 3, 38, 8, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 39, 3, 39, 7, \"FIELD_SAME_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingFieldSameUTF8Validation(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_same_utf8_validation\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 3, 16, 27, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 17, 3, 17, 28, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 18, 3, 18, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 3, 19, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 3, 20, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 3, 20, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 26, 3, 26, 27, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 27, 3, 27, 28, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 28, 3, 28, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 29, 3, 29, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 30, 3, 30, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 30, 3, 30, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 6, 3, 6, 18, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 7, 3, 7, 28, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 8, 3, 8, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 9, 3, 9, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 10, 3, 10, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 10, 3, 10, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 36, 3, 36, 18, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 37, 3, 37, 28, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 38, 3, 38, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 39, 3, 39, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 40, 3, 40, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 40, 3, 40, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 6, 3, 6, 18, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 7, 3, 7, 28, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 8, 3, 8, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 9, 3, 9, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 10, 3, 10, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 10, 3, 10, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 36, 3, 36, 18, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 37, 3, 37, 28, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 38, 3, 38, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 39, 3, 39, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 40, 3, 40, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 40, 3, 40, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 56, 19, 56, 50, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 57, 29, 57, 60, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 58, 3, 58, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 59, 3, 59, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 60, 3, 60, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 60, 3, 60, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 18, 3, 18, 18, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 19, 3, 19, 28, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 20, 3, 20, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 21, 3, 21, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 22, 3, 22, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 22, 3, 22, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 58, 19, 58, 52, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 59, 29, 59, 62, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 60, 3, 60, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 61, 3, 61, 21, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 62, 3, 62, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 62, 3, 62, 22, \"FIELD_SAME_UTF8_VALIDATION\"),\n\t)\n}\n\nfunc TestRunBreakingFieldWireCompatibleCardinality(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_wire_compatible_cardinality\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 8, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 24, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 19, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 16, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 18, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 3, 13, 17, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 7, 19, 30, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 7, 20, 28, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 7, 21, 23, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 7, 22, 20, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 22, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 7, 24, 21, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 5, 40, 28, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 5, 41, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 5, 42, 21, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 5, 43, 18, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 5, 44, 20, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 45, 5, 45, 19, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 3, 13, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 14, 3, 14, 24, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 70, 3, 70, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 71, 3, 71, 26, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 17, 7, 17, 32, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 25, 3, 25, 20, \"FIELD_WIRE_COMPATIBLE_CARDINALITY\"),\n\t)\n}\n\nfunc TestRunBreakingFieldWireCompatibleType(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_wire_compatible_type\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 31, 3, 31, 11, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 32, 3, 32, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 33, 3, 33, 8, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 34, 3, 34, 8, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 35, 3, 35, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 36, 3, 36, 10, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 37, 3, 37, 11, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 38, 3, 38, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 39, 3, 39, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 40, 3, 40, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 41, 3, 41, 8, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 42, 3, 42, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 43, 3, 43, 8, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 44, 3, 44, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 45, 3, 45, 7, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 78, 3, 78, 6, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 79, 3, 79, 6, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 80, 3, 80, 6, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 85, 3, 85, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 89, 12, 89, 15, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 6, 3, 6, 10, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 7, 3, 7, 10, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 15, 5, 15, 12, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 23, 3, 23, 9, \"FIELD_WIRE_COMPATIBLE_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingFieldWireJSONCompatibleCardinality(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_wire_json_compatible_cardinality\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 8, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 24, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 19, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 16, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 18, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 3, 13, 17, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 7, 19, 30, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 7, 20, 28, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 7, 21, 23, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 7, 22, 20, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 7, 23, 22, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 24, 7, 24, 21, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 32, 7, 32, 33, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 40, 5, 40, 28, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 41, 5, 41, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 42, 5, 42, 21, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 43, 5, 43, 18, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 44, 5, 44, 20, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 45, 5, 45, 19, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 3, 13, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 14, 3, 14, 24, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 70, 3, 70, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 71, 3, 71, 26, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 17, 7, 17, 32, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 25, 3, 25, 20, \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\"),\n\t)\n}\n\nfunc TestRunBreakingFieldWireJSONCompatibleType(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_field_wire_json_compatible_type\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 34, 3, 34, 11, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 35, 3, 35, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 36, 3, 36, 8, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 37, 3, 37, 8, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 38, 3, 38, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 39, 3, 39, 10, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 40, 3, 40, 11, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 41, 3, 41, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 42, 3, 42, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 43, 3, 43, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 44, 3, 44, 8, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 45, 3, 45, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 46, 3, 46, 8, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 47, 3, 47, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 48, 3, 48, 7, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 81, 3, 81, 6, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 82, 3, 82, 6, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 83, 3, 83, 6, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 87, 3, 87, 8, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 88, 3, 88, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 92, 12, 92, 15, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 93, 3, 93, 8, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 6, 3, 6, 10, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 7, 3, 7, 10, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 14, 5, 14, 10, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 15, 5, 15, 12, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 16, 5, 16, 11, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 23, 3, 23, 9, \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingFileNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_file_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocationOrPath(t, \"FILE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocationOrPath(t, \"FILE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingFileNoDeleteUnstable(t *testing.T) {\n\tt.Parallel()\n\t// https://github.com/bufbuild/buf/issues/211\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_file_no_delete_unstable\",\n\t)\n}\n\nfunc TestRunBreakingFileNoDeleteIgnores(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_file_no_delete_ignores\",\n\t\t// a/a.proto deleted but not ignored\n\t\tbufanalysistesting.NewFileAnnotationNoLocationOrPath(t, \"FILE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingFileSamePackage(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_file_same_package\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/a.proto\", 3, 1, 3, 11, \"FILE_SAME_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"no_package.proto\", 3, 1, 3, 11, \"FILE_SAME_PACKAGE\"),\n\t)\n}\n\nfunc TestRunBreakingFileSameSyntax(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_file_same_syntax\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"no_package.proto\", 1, 1, 1, 19, \"FILE_SAME_SYNTAX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a/b/sub_a_b.proto\", 2, 1, 2, 19, \"FILE_SAME_SYNTAX\"),\n\t)\n}\n\nfunc TestRunBreakingFileSameValues(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_file_same_values\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 5, 29, \"FILE_SAME_JAVA_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 6, 1, 6, 37, \"FILE_SAME_JAVA_OUTER_CLASSNAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 1, 7, 36, \"FILE_SAME_JAVA_MULTIPLE_FILES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 1, 8, 27, \"FILE_SAME_GO_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 1, 9, 34, \"FILE_SAME_OBJC_CLASS_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 1, 10, 33, \"FILE_SAME_CSHARP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 1, 11, 29, \"FILE_SAME_SWIFT_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 1, 12, 33, \"FILE_SAME_PHP_CLASS_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 1, 13, 30, \"FILE_SAME_PHP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 14, 1, 14, 39, \"FILE_SAME_PHP_METADATA_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 15, 1, 15, 29, \"FILE_SAME_RUBY_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 18, 1, 18, 29, \"FILE_SAME_OPTIMIZE_FOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 19, 1, 19, 36, \"FILE_SAME_CC_GENERIC_SERVICES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 20, 1, 20, 38, \"FILE_SAME_JAVA_GENERIC_SERVICES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 21, 1, 21, 36, \"FILE_SAME_PY_GENERIC_SERVICES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 1, 23, 33, \"FILE_SAME_CC_ENABLE_ARENAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 3, 1, 3, 11, \"FILE_SAME_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 5, 1, 5, 29, \"FILE_SAME_JAVA_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 6, 1, 6, 37, \"FILE_SAME_JAVA_OUTER_CLASSNAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 7, 1, 7, 35, \"FILE_SAME_JAVA_MULTIPLE_FILES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 8, 1, 8, 27, \"FILE_SAME_GO_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 9, 1, 9, 34, \"FILE_SAME_OBJC_CLASS_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 10, 1, 10, 33, \"FILE_SAME_CSHARP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 11, 1, 11, 29, \"FILE_SAME_SWIFT_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 12, 1, 12, 33, \"FILE_SAME_PHP_CLASS_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 13, 1, 13, 30, \"FILE_SAME_PHP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 14, 1, 14, 39, \"FILE_SAME_PHP_METADATA_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 15, 1, 15, 29, \"FILE_SAME_RUBY_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 18, 1, 18, 33, \"FILE_SAME_OPTIMIZE_FOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 19, 1, 19, 35, \"FILE_SAME_CC_GENERIC_SERVICES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 20, 1, 20, 37, \"FILE_SAME_JAVA_GENERIC_SERVICES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 21, 1, 21, 35, \"FILE_SAME_PY_GENERIC_SERVICES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 23, 1, 23, 33, \"FILE_SAME_CC_ENABLE_ARENAS\"),\n\t)\n}\n\nfunc TestRunBreakingMessageNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_message_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 1, 12, 2, \"MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 10, 4, \"MESSAGE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingMessageSameJSONFormat(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_message_same_json_format\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 1, 11, 2, \"MESSAGE_SAME_JSON_FORMAT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 1, 15, 2, \"MESSAGE_SAME_JSON_FORMAT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 26, 3, 26, 52, \"MESSAGE_SAME_JSON_FORMAT\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"4.proto\", 11, 1, 13, 2, \"MESSAGE_SAME_JSON_FORMAT\"),\n\t)\n}\n\nfunc TestRunBreakingMessageSameValues(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_message_same_values\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 6, 3, 6, 49, \"MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 7, 12, 53, \"MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 3, 23, 49, \"MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 6, 3, 6, 49, \"MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 10, 3, 10, 49, \"MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\"),\n\t)\n}\n\nfunc TestRunBreakingMessageSameRequiredFields(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_message_same_required_fields\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 7, 2, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 6, 3, 6, 27, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 1, 11, 2, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 27, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 1, 30, 2, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 15, 5, 17, 6, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 7, 16, 31, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 18, 5, 20, 6, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 22, 3, 24, 4, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 23, 5, 23, 29, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 27, 5, 27, 29, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 29, 3, 29, 27, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 5, 1, 7, 2, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 6, 3, 6, 27, \"MESSAGE_SAME_REQUIRED_FIELDS\"),\n\t)\n}\n\nfunc TestRunBreakingOneofNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_oneof_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 9, 2, \"ONEOF_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 13, 5, 17, 6, \"ONEOF_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 26, 3, 30, 4, \"ONEOF_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 76, 1, 80, 2, \"ONEOF_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingPackageExtensionNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_package_extension_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"2.proto\", \"PACKAGE_EXTENSION_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"3.proto\", \"PACKAGE_EXTENSION_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"3.proto\", 8, 3, 14, 4, \"PACKAGE_EXTENSION_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingPackageNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_package_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocationOrPath(t, \"PACKAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a1.proto\", \"PACKAGE_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a1.proto\", \"PACKAGE_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a1.proto\", \"PACKAGE_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a1.proto\", \"PACKAGE_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a1.proto\", \"PACKAGE_SERVICE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a2.proto\", 11, 1, 16, 2, \"PACKAGE_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a2.proto\", 12, 3, 14, 4, \"PACKAGE_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"b1.proto\", \"PACKAGE_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"b1.proto\", \"PACKAGE_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"b1.proto\", \"PACKAGE_SERVICE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b2.proto\", 7, 1, 21, 2, \"PACKAGE_MESSAGE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingPackageServiceNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_package_service_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"PACKAGE_SERVICE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingReservedEnumNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_reserved_enum_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 53, 1, 58, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 88, 1, 95, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 88, 1, 95, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 88, 1, 95, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 88, 1, 95, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 88, 1, 95, 2, \"RESERVED_ENUM_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingReservedMessageNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_reserved_message_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 5, 1, 12, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 16, 5, 23, 6, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 34, 3, 41, 4, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 56, 1, 60, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 91, 1, 98, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 91, 1, 98, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 91, 1, 98, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 91, 1, 98, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 91, 1, 98, 2, \"RESERVED_MESSAGE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingRPCNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_rpc_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 1, 10, 2, \"RPC_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 31, 1, 34, 2, \"RPC_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingRPCSameValues(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_rpc_same_values\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 3, 9, 71, \"RPC_SAME_CLIENT_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 18, 9, 37, \"RPC_SAME_REQUEST_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 9, 48, 9, 67, \"RPC_SAME_RESPONSE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 3, 10, 71, \"RPC_SAME_SERVER_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 11, 10, 30, \"RPC_SAME_REQUEST_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 10, 48, 10, 67, \"RPC_SAME_RESPONSE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 11, 3, 11, 68, \"RPC_SAME_CLIENT_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 12, 3, 12, 68, \"RPC_SAME_SERVER_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 37, 3, 37, 71, \"RPC_SAME_CLIENT_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 37, 18, 37, 37, \"RPC_SAME_REQUEST_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 37, 48, 37, 67, \"RPC_SAME_RESPONSE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 38, 3, 38, 71, \"RPC_SAME_SERVER_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 38, 11, 38, 30, \"RPC_SAME_REQUEST_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 38, 48, 38, 67, \"RPC_SAME_RESPONSE_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 39, 3, 39, 68, \"RPC_SAME_CLIENT_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 40, 3, 40, 68, \"RPC_SAME_SERVER_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 45, 5, 45, 48, \"RPC_SAME_IDEMPOTENCY_LEVEL\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 49, 5, 49, 43, \"RPC_SAME_IDEMPOTENCY_LEVEL\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 55, 5, 55, 48, \"RPC_SAME_IDEMPOTENCY_LEVEL\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 59, 5, 59, 43, \"RPC_SAME_IDEMPOTENCY_LEVEL\"),\n\t)\n}\n\nfunc TestRunBreakingServiceNoDelete(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_service_no_delete\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"SERVICE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"SERVICE_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingIgnoreUnstablePackagesTrue(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_ignore_unstable_packages_true\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 1, 16, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 12, 4, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a/v1/1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/v1/1.proto\", 9, 1, 18, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/v1/1.proto\", 10, 3, 14, 4, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"b/1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b/1.proto\", 9, 1, 18, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b/1.proto\", 10, 3, 14, 4, \"ENUM_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingIgnoreUnstablePackagesFalse(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_ignore_unstable_packages_false\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 7, 1, 16, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 8, 3, 12, 4, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a/v1/1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/v1/1.proto\", 9, 1, 18, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/v1/1.proto\", 10, 3, 14, 4, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a/v1beta1/1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/v1beta1/1.proto\", 9, 1, 18, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/v1beta1/1.proto\", 10, 3, 14, 4, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"b/1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b/1.proto\", 9, 1, 18, 2, \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b/1.proto\", 10, 3, 14, 4, \"ENUM_NO_DELETE\"),\n\t)\n}\n\nfunc TestRunBreakingIgnoreUnstablePackagesDeleteFile(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_ignore_unstable_packages_delete_file\",\n\t)\n}\n\nfunc TestRunBreakingIntEnum(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_int_enum\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"1.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 3, 3, 3, 8, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 3, 3, 3, 7, \"FIELD_SAME_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingMessageEnum(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_message_enum\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 3, 3, 3, 15, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 3, 3, 3, 6, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"2.proto\", \"ENUM_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 3, 3, 3, 16, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 3, 3, 3, 7, \"FIELD_SAME_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingMessageInt(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_message_int\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 3, 3, 3, 15, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 3, 3, 3, 6, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 3, 3, 3, 17, \"FIELD_SAME_CARDINALITY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 3, 3, 3, 8, \"FIELD_SAME_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingMessageMessage(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_message_message\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"1.proto\", 3, 3, 3, 8, \"FIELD_SAME_TYPE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"2.proto\", \"MESSAGE_NO_DELETE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"2.proto\", 3, 3, 3, 7, \"FIELD_SAME_TYPE\"),\n\t)\n}\n\nfunc TestRunBreakingWithCustomPlugins(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_custom_plugins\",\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 3, 1, 6, 2, \"SERVICE_SUFFIXES_NO_CHANGE\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 11, 3, 14, 4, \"ENUM_SUFFIXES_NO_CHANGE\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 15, 3, 19, 4, \"MESSAGE_SUFFIXES_NO_CHANGE\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix\"),\n\t\t),\n\t)\n}\n\nfunc TestRunBreakingPolicyEmpty(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_policy_empty\",\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 1, 1, 1, 1, \"MESSAGE_NO_DELETE\",\n\t\t\tbufanalysistesting.WithPolicyName(\"empty.policy.yaml\"),\n\t\t),\n\t)\n}\n\nfunc TestRunBreakingPolicyLocal(t *testing.T) {\n\tt.Parallel()\n\ttestBreaking(\n\t\tt,\n\t\t\"breaking_policy_local\",\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 3, 1, 6, 2, \"SERVICE_SUFFIXES_NO_CHANGE\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t\tbufanalysistesting.WithPolicyName(\"buf.policy1.yaml\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 11, 3, 14, 4, \"ENUM_SUFFIXES_NO_CHANGE\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t\tbufanalysistesting.WithPolicyName(\"buf.policy2.yaml\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 15, 3, 19, 4, \"MESSAGE_SUFFIXES_NO_CHANGE\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t\tbufanalysistesting.WithPolicyName(\"buf.policy2.yaml\"),\n\t\t),\n\t)\n}\n\nfunc testBreaking(\n\tt *testing.T,\n\trelDirPath string,\n\texpectedFileAnnotations ...bufanalysis.FileAnnotation,\n) {\n\tctx, cancel := context.WithTimeout(t.Context(), 60*time.Second) // Increased timeout for Wasm runtime\n\tdefer cancel()\n\tlogger := slogtestext.NewLogger(t)\n\n\tbaseDirPath := filepath.Join(\"testdata\", \"breaking\", \"current\")\n\tbasePreviousDirPath := filepath.Join(\"testdata\", \"breaking\", \"previous\")\n\tpreviousDirPath := filepath.Join(basePreviousDirPath, relDirPath)\n\tdirPath := filepath.Join(baseDirPath, relDirPath)\n\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\tpreviousReadWriteBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tpreviousDirPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\tpreviousBucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tlogger,\n\t\tpreviousReadWriteBucket,\n\t\t\".\", // the bucket is rooted at the input\n\t\tnil,\n\t\tnil,\n\t\tbuftarget.TerminateAtControllingWorkspace,\n\t)\n\trequire.NoError(t, err)\n\treadWriteBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tdirPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\tbucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tlogger,\n\t\treadWriteBucket,\n\t\t\".\", // the bucket is rooted at the input\n\t\tnil,\n\t\tnil,\n\t\tbuftarget.TerminateAtControllingWorkspace,\n\t)\n\trequire.NoError(t, err)\n\n\tworkspaceProvider := bufworkspace.NewWorkspaceProvider(\n\t\tlogger,\n\t\tbufmodule.NopGraphProvider,\n\t\tbufmodule.NopModuleDataProvider,\n\t\tbufmodule.NopCommitProvider,\n\t\tbufplugin.NopPluginKeyProvider,\n\t)\n\tpreviousWorkspace, err := workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\tpreviousReadWriteBucket,\n\t\tpreviousBucketTargeting,\n\t)\n\trequire.NoError(t, err)\n\tworkspace, err := workspaceProvider.GetWorkspaceForBucket(\n\t\tctx,\n\t\treadWriteBucket,\n\t\tbucketTargeting,\n\t)\n\trequire.NoError(t, err)\n\n\tpreviousImage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tlogger,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(previousWorkspace),\n\t)\n\trequire.NoError(t, err)\n\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tlogger,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(workspace),\n\t)\n\trequire.NoError(t, err)\n\n\topaqueID, err := testGetRootOpaqueID(workspace, \".\")\n\trequire.NoError(t, err)\n\tbreakingConfig := workspace.GetBreakingConfigForOpaqueID(opaqueID)\n\trequire.NotNil(t, breakingConfig)\n\twasmRuntime, err := wasm.NewRuntime(ctx)\n\trequire.NoError(t, err)\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, wasmRuntime.Close(ctx))\n\t})\n\tclient, err := bufcheck.NewClient(\n\t\tlogger,\n\t\tbufcheck.ClientWithRunnerProvider(bufcheck.NewLocalRunnerProvider(wasmRuntime)),\n\t\tbufcheck.ClientWithLocalWasmPluginsFromOS(),\n\t\tbufcheck.ClientWithLocalPolicies(func(filePath string) ([]byte, error) {\n\t\t\t// Read policies relative to the base directory path.\n\t\t\treturn os.ReadFile(filepath.Join(dirPath, filePath))\n\t\t}),\n\t)\n\trequire.NoError(t, err)\n\terr = client.Breaking(\n\t\tctx,\n\t\tbreakingConfig,\n\t\timage,\n\t\tpreviousImage,\n\t\tbufcheck.BreakingWithExcludeImports(),\n\t\tbufcheck.WithPluginConfigs(workspace.PluginConfigs()...),\n\t\tbufcheck.WithPolicyConfigs(workspace.PolicyConfigs()...),\n\t)\n\tif len(expectedFileAnnotations) == 0 {\n\t\tassert.NoError(t, err)\n\t} else {\n\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\trequire.ErrorAs(t, err, &fileAnnotationSet)\n\t\tbufanalysistesting.AssertFileAnnotationsEqual(\n\t\t\tt,\n\t\t\texpectedFileAnnotations,\n\t\t\tfileAnnotationSet.FileAnnotations(),\n\t\t)\n\t}\n}\n\nfunc testGetRootOpaqueID(workspace bufworkspace.Workspace, prefix string) (string, error) {\n\tvar rootModules []bufmodule.Module\n\tfor _, module := range workspace.Modules() {\n\t\tif strings.HasPrefix(module.OpaqueID(), prefix) {\n\t\t\trootModules = append(rootModules, module)\n\t\t}\n\t}\n\tswitch len(rootModules) {\n\tcase 0:\n\t\treturn \"\", errors.New(\"no module with opaque ID starting with \\\".\\\"\")\n\tcase 1:\n\t\treturn rootModules[0].OpaqueID(), nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"got %d modules with opaque ID starting with \\\".\\\"\", len(rootModules))\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheck.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log/slog\"\n\t\"os\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/pluginrpcutil\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\n// Client is the main client into bufcheck.\n//\n// Rules are returned sorted by ID, but PrintRules does our sort by category.\ntype Client interface {\n\t// Lint lints the given Image with the given LintConfig.\n\t//\n\t// The Image should have source code info for this to work properly.\n\t//\n\t// Images should *not* be filtered with regards to imports before passing to this function.\n\t//\n\t// An error of type bufanalysis.FileAnnotationSet will be returned lint failure.\n\tLint(ctx context.Context, config bufconfig.LintConfig, image bufimage.Image, options ...LintOption) error\n\t// Breaking checks the given Images for breaking changes with the given BreakingConfig.\n\t//\n\t// The Images should have source code info for this to work properly.\n\t//\n\t// Images should *not* be filtered with regards to imports before passing to this function.\n\t// To exclude imports, pass BreakingWithExcludeImports.\n\t//\n\t// An error of type bufanalysis.FileAnnotationSet will be returned lint failure.\n\tBreaking(ctx context.Context, config bufconfig.BreakingConfig, image bufimage.Image, againstImage bufimage.Image, options ...BreakingOption) error\n\t// ConfiguredRules returns all of the Configured Rules for the given RuleType.\n\tConfiguredRules(ctx context.Context, ruleType check.RuleType, config bufconfig.CheckConfig, options ...ConfiguredRulesOption) ([]Rule, error)\n\t// AllRules returns all Rules (configured or not) for the given RuleType.\n\tAllRules(ctx context.Context, ruleType check.RuleType, fileVersion bufconfig.FileVersion, options ...AllRulesOption) ([]Rule, error)\n\t// AllCategories returns all Categories.\n\tAllCategories(ctx context.Context, fileVersion bufconfig.FileVersion, options ...AllCategoriesOption) ([]Category, error)\n}\n\n// Rule is an individual line or breaking Rule.\n//\n// It wraps check.Rule and adds the name of the plugin that implements the Rule.\ntype Rule interface {\n\tcheck.Rule\n\n\t// BufcheckCategories returns the Rule's Categories.\n\tBufcheckCategories() []Category\n\n\t// PluginName returns the name of the plugin that created this Rule.\n\t//\n\t// Names are freeform.\n\t//\n\t// Will be empty for Rules based on builtin plugins.\n\tPluginName() string\n\t// PolicyName returns the name of the policy that contains this Rule, if any.\n\t//\n\t// Names are freeform.\n\t//\n\t// Will be empty for Rules not based on policies.\n\tPolicyName() string\n\n\tisRule()\n\tisRuleOrCategory()\n}\n\n// Category is an individual line or breaking Category.\n//\n// It wraps check.Category and adds the name of the plugin that implements the Category.\ntype Category interface {\n\tcheck.Category\n\n\t// PluginName returns the name of the plugin that created this Category.\n\t//\n\t// Names are freeform.\n\t//\n\t// Will be empty for Categorys based on builtin plugins.\n\tPluginName() string\n\t// PolicyName returns the name of the policy that contains this Category, if any.\n\t//\n\t// Names are freeform.\n\t//\n\t// Will be empty for Categorys not based on policies.\n\tPolicyName() string\n\n\tisCategory()\n\tisRuleOrCategory()\n}\n\n// RuleOrCategory is a union interface with the common types in both Rule and Category.\ntype RuleOrCategory interface {\n\tID() string\n\tPurpose() string\n\tDeprecated() bool\n\tReplacementIDs() []string\n\tPluginName() string\n\n\tisRuleOrCategory()\n}\n\n// LintOption is an option for Lint.\ntype LintOption interface {\n\tapplyToLint(*lintOptions)\n}\n\n// BreakingOption is an option for Breaking.\ntype BreakingOption interface {\n\tapplyToBreaking(*breakingOptions)\n}\n\n// BreakingWithExcludeImports returns a new BreakingOption that says to exclude imports from\n// breaking change detection.\n//\n// The default is to check imports for breaking changes.\nfunc BreakingWithExcludeImports() BreakingOption {\n\treturn &excludeImportsOption{}\n}\n\n// ConfiguredRulesOption is an option for ConfiguredRules.\ntype ConfiguredRulesOption interface {\n\tapplyToConfiguredRules(*configuredRulesOptions)\n}\n\n// LintBreakingAndConfiguredRulesOption is an option for Lint, Breaking, and ConfiguredRules.\ntype LintBreakingAndConfiguredRulesOption interface {\n\tLintOption\n\tBreakingOption\n\tConfiguredRulesOption\n}\n\n// WithRelatedCheckConfigs returns a new LintBreakingAndConfiguredRulesOption that allows\n// the caller to provide additional related check configs. This allows the client to check\n// for unused plugins across related check configs and provide users with a warning if the\n// plugin is unused in all check configs.\n//\n// The default is to only check the configs provided to the client for Lint, Breaking, or ConfiguredRules.\nfunc WithRelatedCheckConfigs(relatedCheckConfigs ...bufconfig.CheckConfig) LintBreakingAndConfiguredRulesOption {\n\treturn &relatedCheckConfigsOption{\n\t\trelatedCheckConfigs: relatedCheckConfigs,\n\t}\n}\n\n// AllRulesOption is an option for AllRules.\ntype AllRulesOption interface {\n\tapplyToAllRules(*allRulesOptions)\n}\n\n// AllCategoriesOption is an option for AllCategories.\ntype AllCategoriesOption interface {\n\tapplyToAllCategories(*allCategoriesOptions)\n}\n\n// ClientFunctionOption is an option that applies to any Client function.\ntype ClientFunctionOption interface {\n\tLintOption\n\tBreakingOption\n\tConfiguredRulesOption\n\tAllRulesOption\n\tAllCategoriesOption\n}\n\n// WithPluginConfigs returns a new ClientFunctionOption that says to also use the given plugins.\n//\n// The default is to only use the builtin Rules and Categories.\nfunc WithPluginConfigs(pluginConfigs ...bufconfig.PluginConfig) ClientFunctionOption {\n\treturn &pluginConfigsOption{\n\t\tpluginConfigs: pluginConfigs,\n\t}\n}\n\n// WithPolicyConfigs returns a new ClientFunctionOption that says to also use the given policies.\nfunc WithPolicyConfigs(policyConfigs ...bufconfig.PolicyConfig) ClientFunctionOption {\n\treturn &policyConfigsOption{\n\t\tpolicyConfigs: policyConfigs,\n\t}\n}\n\n// RunnerProvider provides pluginrpc.Runners for a given plugin config and an optional policy config.\ntype RunnerProvider interface {\n\tNewRunner(plugin bufplugin.Plugin) (pluginrpc.Runner, error)\n}\n\n// RunnerProviderFunc is a function that implements RunnerProvider.\ntype RunnerProviderFunc func(bufplugin.Plugin) (pluginrpc.Runner, error)\n\n// NewRunner implements RunnerProvider.\n//\n// RunnerProvider selects the correct Runner based on the type of pluginConfig.\nfunc (r RunnerProviderFunc) NewRunner(plugin bufplugin.Plugin) (pluginrpc.Runner, error) {\n\treturn r(plugin)\n}\n\n// NewLocalRunnerProvider returns a new RunnerProvider to invoke plugins locally.\n//\n// This implementation should only be used for local applications. It is safe to\n// use concurrently.\n//\n// The RunnerProvider selects the correct Runner based on the Plugin:\n//   - Local plugins will be run with pluginrpcutil.NewLocalRunner.\n//   - Local Wasm plugins will be run with pluginrpcutil.NewWasmRunner.\n//   - Remote Wasm plugins will be run with pluginrpcutil.NewWasmRunner.\n//\n// If the plugin type is not supported, an error is returned.\n// To disable support for Wasm plugins, set wasmRuntime to wasm.UnimplementedRuntime.\nfunc NewLocalRunnerProvider(wasmRuntime wasm.Runtime) RunnerProvider {\n\treturn newLocalRunnerProvider(wasmRuntime)\n}\n\n// NewClient returns a new Client.\nfunc NewClient(\n\tlogger *slog.Logger,\n\toptions ...ClientOption,\n) (Client, error) {\n\treturn newClient(logger, options...)\n}\n\n// ClientOption is an option for a new Client.\ntype ClientOption func(*clientOptions)\n\n// ClientWithStderr returns a new ClientOption that specifies a stderr to proxy plugin stderrs to.\n//\n// The default is the equivalent of /dev/null.\nfunc ClientWithStderr(stderr io.Writer) ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.stderr = stderr\n\t}\n}\n\n// ClientWithRunnerProvider returns a new ClientOption that specifies a RunnerProvider.\n//\n// The runnerProvider is used to create pluginrpc.Runners for the plugins.\n// By default, only builtin plugins are used.\nfunc ClientWithRunnerProvider(runnerProvider RunnerProvider) ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.runnerProvider = runnerProvider\n\t}\n}\n\n// ClientWithLocalWasmPlugins returns a new ClientOption that specifies reading Wasm plugins.\n//\n// The readFile is used to read the Wasm plugin data from the filesystem.\nfunc ClientWithLocalWasmPlugins(readFile func(string) ([]byte, error)) ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.pluginReadFile = readFile\n\t}\n}\n\n// ClientWithLocalWasmPluginsFromOS returns a new ClientOption that specifies reading Wasm plugins\n// from the OS.\n//\n// This is only used for local applications.\nfunc ClientWithLocalWasmPluginsFromOS() ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.pluginReadFile = pluginrpcutil.ReadWasmFileFromOS\n\t}\n}\n\n// ClientWithRemoteWasmPlugins returns a new ClientOption that specifies the remote plugin key\n// and data providers.\nfunc ClientWithRemoteWasmPlugins(\n\tpluginKeyProvider bufplugin.PluginKeyProvider,\n\tpluginDataProvider bufplugin.PluginDataProvider,\n) ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.pluginKeyProvider = pluginKeyProvider\n\t\tclientOptions.pluginDataProvider = pluginDataProvider\n\t}\n}\n\n// ClientWithLocalPolicies returns a new ClientOption that specifies reading local policies.\n//\n// The readFile is used to read the policy data from the filesystem.\nfunc ClientWithLocalPolicies(readFile func(string) ([]byte, error)) ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.policyReadFile = readFile\n\t}\n}\n\n// ClientWithLocalPoliciesFromOS returns a new ClientOption that specifies reading local policies\n// from the OS.\nfunc ClientWithLocalPoliciesFromOS() ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.policyReadFile = os.ReadFile\n\t}\n}\n\n// ClientWithRemotePolicies returns a new ClientOption that specifies the remote policy key\n// and data providers.\nfunc ClientWithRemotePolicies(\n\tpolicyKeyProvider bufpolicy.PolicyKeyProvider,\n\tpolicyDataProvider bufpolicy.PolicyDataProvider,\n\tpolicyPluginKeyProvider bufpolicy.PolicyPluginKeyProvider,\n\tpolicyPluginDataProvider bufpolicy.PolicyPluginDataProvider,\n) ClientOption {\n\treturn func(clientOptions *clientOptions) {\n\t\tclientOptions.policyKeyProvider = policyKeyProvider\n\t\tclientOptions.policyDataProvider = policyDataProvider\n\t\tclientOptions.policyPluginKeyProvider = policyPluginKeyProvider\n\t\tclientOptions.policyPluginDataProvider = policyPluginDataProvider\n\t}\n}\n\n// PrintRules prints the rules to the Writer.\nfunc PrintRules(writer io.Writer, rules []Rule, options ...PrintRulesOption) (retErr error) {\n\treturn printRules(writer, rules, options...)\n}\n\n// PrintRulesOption is an option for PrintRules.\ntype PrintRulesOption func(*printRulesOptions)\n\n// PrintRulesWithJSON returns a new PrintRulesOption that says to print the rules as JSON.\n//\n// The default is to print as text.\nfunc PrintRulesWithJSON() PrintRulesOption {\n\treturn func(printRulesOptions *printRulesOptions) {\n\t\tprintRulesOptions.asJSON = true\n\t}\n}\n\n// PrintRulesWithDeprecated returns a new PrintRulesOption that results in deprecated rules  being printed.\nfunc PrintRulesWithDeprecated() PrintRulesOption {\n\treturn func(printRulesOptions *printRulesOptions) {\n\t\tprintRulesOptions.includeDeprecated = true\n\t}\n}\n\n// GetDeprecatedIDToReplacementIDs gets a map from deprecated ID to replacement IDs.\nfunc GetDeprecatedIDToReplacementIDs[R RuleOrCategory](rulesOrCategories []R) (map[string][]string, error) {\n\tidToRuleOrCategory, err := xslices.ToUniqueValuesMap(rulesOrCategories, func(ruleOrCategory R) string { return ruleOrCategory.ID() })\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tidToReplacementIDs := make(map[string][]string)\n\tfor _, ruleOrCategory := range rulesOrCategories {\n\t\tif ruleOrCategory.Deprecated() {\n\t\t\treplacementIDs := ruleOrCategory.ReplacementIDs()\n\t\t\tif replacementIDs == nil {\n\t\t\t\treplacementIDs = []string{}\n\t\t\t}\n\t\t\tfor _, replacementID := range replacementIDs {\n\t\t\t\tif _, ok := idToRuleOrCategory[replacementID]; !ok {\n\t\t\t\t\treturn nil, syserror.Newf(\"unknown rule or category ID given as a replacement ID: %q\", replacementID)\n\t\t\t\t}\n\t\t\t}\n\t\t\tidToReplacementIDs[ruleOrCategory.ID()] = replacementIDs\n\t\t}\n\t}\n\treturn idToReplacementIDs, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/bufcheckserver.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserver\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverbuild\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil\"\n)\n\nvar (\n\t// V1Beta1Spec is the v1beta1 check.Spec.\n\tV1Beta1Spec = &check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\tbufcheckserverbuild.BreakingEnumNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingServiceNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumSameTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingExtensionMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCardinalityRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCppStringTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJavaUTF8ValidationRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJSTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameUTF8ValidationRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCcEnableArenasRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCcGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCsharpNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameGoPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaMultipleFilesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaOuterClassnameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameObjcClassPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameOptimizeForRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpClassPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpMetadataNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePyGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameRubyPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameSwiftPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameSyntaxRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageNoRemoveStandardDescriptorAccessorRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingOneofNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumSameJSONFormatRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueSameNameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJSONNameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameNameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameJSONFormatRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameOneofRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePackageRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameRequiredFieldsRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingReservedEnumNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingReservedMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameClientStreamingRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameIdempotencyLevelRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameRequestTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameResponseTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameServerStreamingRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageEnumNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageMessageNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageServiceNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteUnlessNameReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteUnlessNameReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireJSONCompatibleCardinalityRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteUnlessNumberReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteUnlessNumberReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireCompatibleCardinalityRuleSpecBuilder.Build(false, []string{\"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCTypeRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameLabelRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaStringCheckUtf8RuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpGenericServicesRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameMessageSetWireFormatRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.LintCommentEnumRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentEnumValueRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentFieldRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentMessageRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentOneofRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentRPCRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentServiceRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintDirectorySamePackageRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"FILE_LAYOUT\"}),\n\t\t\tbufcheckserverbuild.LintEnumFirstValueZeroRuleSpecBuilder.Build(false, []string{\"OTHER\"}),\n\t\t\tbufcheckserverbuild.LintEnumNoAllowAliasRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"SENSIBLE\"}),\n\t\t\tbufcheckserverbuild.LintEnumPascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumValuePrefixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumValueUpperSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumZeroValueSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintFieldLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintFieldNoDescriptorRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"SENSIBLE\"}),\n\t\t\tbufcheckserverbuild.LintFileLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportNoPublicRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"SENSIBLE\"}),\n\t\t\tbufcheckserverbuild.LintMessagePascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintOneofLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageDefinedRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"SENSIBLE\"}),\n\t\t\tbufcheckserverbuild.LintPackageDirectoryMatchRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"FILE_LAYOUT\"}),\n\t\t\tbufcheckserverbuild.LintPackageLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameCsharpNamespaceRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"PACKAGE_AFFINITY\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameDirectoryRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"FILE_LAYOUT\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameGoPackageRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"PACKAGE_AFFINITY\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameJavaMultipleFilesRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"PACKAGE_AFFINITY\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameJavaPackageRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"PACKAGE_AFFINITY\"}),\n\t\t\tbufcheckserverbuild.LintPackageSamePhpNamespaceRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"PACKAGE_AFFINITY\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameRubyPackageRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"PACKAGE_AFFINITY\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameSwiftPrefixRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\", \"PACKAGE_AFFINITY\"}),\n\t\t\tbufcheckserverbuild.LintPackageVersionSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCNoClientStreamingRuleSpecBuilder.Build(false, []string{\"UNARY_RPC\"}),\n\t\t\tbufcheckserverbuild.LintRPCNoServerStreamingRuleSpecBuilder.Build(false, []string{\"UNARY_RPC\"}),\n\t\t\tbufcheckserverbuild.LintRPCPascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCRequestResponseUniqueRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCRequestStandardNameRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCResponseStandardNameRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintServicePascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\", \"STYLE_BASIC\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintServiceSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\", \"STYLE_DEFAULT\", \"STYLE_STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportNoWeakRuleSpecBuilder.Build(false, []string{}),\n\t\t},\n\t\tCategories: []*check.CategorySpec{\n\t\t\tbufcheckserverbuild.FileCategorySpec,\n\t\t\tbufcheckserverbuild.PackageCategorySpec,\n\t\t\tbufcheckserverbuild.WireCategorySpec,\n\t\t\tbufcheckserverbuild.WireJSONCategorySpec,\n\t\t\tbufcheckserverbuild.BasicCategorySpec,\n\t\t\tbufcheckserverbuild.CommentsCategorySpec,\n\t\t\tbufcheckserverbuild.DefaultCategorySpec,\n\t\t\tbufcheckserverbuild.FileLayoutCategorySpec,\n\t\t\tbufcheckserverbuild.MinimalCategorySpec,\n\t\t\tbufcheckserverbuild.OtherCategorySpec,\n\t\t\tbufcheckserverbuild.PackageAffinityCategorySpec,\n\t\t\tbufcheckserverbuild.SensibleCategorySpec,\n\t\t\tbufcheckserverbuild.StyleBasicCategorySpec,\n\t\t\tbufcheckserverbuild.StyleDefaultCategorySpec,\n\t\t\tbufcheckserverbuild.StyleStandardCategorySpec,\n\t\t\tbufcheckserverbuild.StandardCategorySpec,\n\t\t\tbufcheckserverbuild.UnaryRPCCategorySpec,\n\t\t},\n\t\tBefore: bufcheckserverutil.Before,\n\t}\n\n\t// V1Spec is the v1beta1 check.Spec.\n\tV1Spec = &check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\tbufcheckserverbuild.BreakingEnumNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingServiceNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumSameTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingExtensionMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCardinalityRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCppStringTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJavaUTF8ValidationRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJSTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameUTF8ValidationRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCcEnableArenasRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCcGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCsharpNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameGoPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaMultipleFilesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaOuterClassnameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameObjcClassPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameOptimizeForRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpClassPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpMetadataNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePyGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameRubyPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameSwiftPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameSyntaxRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageNoRemoveStandardDescriptorAccessorRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingOneofNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumSameJSONFormatRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueSameNameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJSONNameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameNameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameJSONFormatRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameOneofRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameRequiredFieldsRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingReservedEnumNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingReservedMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameClientStreamingRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameIdempotencyLevelRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameRequestTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameResponseTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameServerStreamingRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageEnumNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageMessageNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageServiceNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteUnlessNameReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteUnlessNameReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireJSONCompatibleCardinalityRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireJSONCompatibleTypeRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteUnlessNumberReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteUnlessNumberReservedRuleSpecBuilder.Build(false, []string{\"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireCompatibleCardinalityRuleSpecBuilder.Build(false, []string{\"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireCompatibleTypeRuleSpecBuilder.Build(false, []string{\"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCTypeRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameLabelRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameMessageSetWireFormatRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaStringCheckUtf8RuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpGenericServicesRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.LintCommentEnumRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentEnumValueRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentFieldRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentMessageRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentOneofRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentRPCRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentServiceRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintDirectorySamePackageRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumFirstValueZeroRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumNoAllowAliasRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumPascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumValuePrefixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumValueUpperSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumZeroValueSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintFieldLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintFileLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportNoPublicRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportUsedRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintMessagePascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintOneofLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageDefinedRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageDirectoryMatchRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageNoImportCycleRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.LintPackageSameCsharpNamespaceRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameDirectoryRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameGoPackageRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameJavaMultipleFilesRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameJavaPackageRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSamePhpNamespaceRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameRubyPackageRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameSwiftPrefixRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageVersionSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintProtovalidateRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCNoClientStreamingRuleSpecBuilder.Build(false, []string{\"UNARY_RPC\"}),\n\t\t\tbufcheckserverbuild.LintRPCNoServerStreamingRuleSpecBuilder.Build(false, []string{\"UNARY_RPC\"}),\n\t\t\tbufcheckserverbuild.LintRPCPascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCRequestResponseUniqueRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCRequestStandardNameRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCResponseStandardNameRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintServicePascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintServiceSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintSyntaxSpecifiedRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportNoWeakRuleSpecBuilder.Build(false, []string{}),\n\t\t},\n\t\tCategories: []*check.CategorySpec{\n\t\t\tbufcheckserverbuild.FileCategorySpec,\n\t\t\tbufcheckserverbuild.PackageCategorySpec,\n\t\t\tbufcheckserverbuild.WireCategorySpec,\n\t\t\tbufcheckserverbuild.WireJSONCategorySpec,\n\t\t\tbufcheckserverbuild.BasicCategorySpec,\n\t\t\tbufcheckserverbuild.CommentsCategorySpec,\n\t\t\tbufcheckserverbuild.DefaultCategorySpec,\n\t\t\tbufcheckserverbuild.MinimalCategorySpec,\n\t\t\tbufcheckserverbuild.StandardCategorySpec,\n\t\t\tbufcheckserverbuild.UnaryRPCCategorySpec,\n\t\t},\n\t\tBefore: bufcheckserverutil.Before,\n\t}\n\n\t// V2Spec is the v2 check.Spec.\n\tV2Spec = &check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\tbufcheckserverbuild.BreakingEnumNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingExtensionNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingServiceNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumSameTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingExtensionMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCardinalityRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameCppStringTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJavaUTF8ValidationRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJSTypeRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameTypeRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameUTF8ValidationRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCcEnableArenasRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCcGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameCsharpNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameGoPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaMultipleFilesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaOuterClassnameRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameJavaPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameObjcClassPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameOptimizeForRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpClassPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpMetadataNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePhpNamespaceRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePyGenericServicesRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameRubyPackageRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameSwiftPrefixRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSameSyntaxRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageNoRemoveStandardDescriptorAccessorRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingOneofNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCNoDeleteRuleSpecBuilder.Build(true, []string{\"FILE\", \"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumSameJSONFormatRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueSameNameRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameJSONNameRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameNameRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameJSONFormatRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameDefaultRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldSameOneofRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFileSamePackageRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameRequiredFieldsRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingReservedEnumNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingReservedMessageNoDeleteRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameClientStreamingRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameIdempotencyLevelRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameRequestTypeRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameResponseTypeRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingRPCSameServerStreamingRuleSpecBuilder.Build(true, []string{\"CSR\", \"FILE\", \"PACKAGE\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageEnumNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageExtensionNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageMessageNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingPackageServiceNoDeleteRuleSpecBuilder.Build(false, []string{\"PACKAGE\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteUnlessNameReservedRuleSpecBuilder.Build(false, []string{\"CSR\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteUnlessNameReservedRuleSpecBuilder.Build(false, []string{\"CSR\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireJSONCompatibleCardinalityRuleSpecBuilder.Build(false, []string{\"CSR\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireJSONCompatibleTypeRuleSpecBuilder.Build(false, []string{\"CSR\", \"WIRE_JSON\"}),\n\t\t\tbufcheckserverbuild.BreakingEnumValueNoDeleteUnlessNumberReservedRuleSpecBuilder.Build(false, []string{\"CSR\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldNoDeleteUnlessNumberReservedRuleSpecBuilder.Build(false, []string{\"CSR\", \"WIRE_JSON\", \"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireCompatibleCardinalityRuleSpecBuilder.Build(false, []string{\"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingFieldWireCompatibleTypeRuleSpecBuilder.Build(false, []string{\"WIRE\"}),\n\t\t\tbufcheckserverbuild.BreakingMessageSameMessageSetWireFormatRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.LintCommentEnumRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentEnumValueRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentFieldRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentMessageRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentOneofRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentRPCRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintCommentServiceRuleSpecBuilder.Build(false, []string{\"COMMENTS\"}),\n\t\t\tbufcheckserverbuild.LintDirectorySamePackageRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumFirstValueZeroRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumNoAllowAliasRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumPascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumValuePrefixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumValueUpperSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintEnumZeroValueSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintFieldLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintFieldNotRequiredRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintFileLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportNoPublicRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportUsedRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintMessagePascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintOneofLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageDefinedRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageDirectoryMatchRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageLowerSnakeCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageNoImportCycleRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameCsharpNamespaceRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameDirectoryRuleSpecBuilder.Build(true, []string{\"MINIMAL\", \"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameGoPackageRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameJavaMultipleFilesRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameJavaPackageRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSamePhpNamespaceRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameRubyPackageRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageSameSwiftPrefixRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintPackageVersionSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintProtovalidateRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCNoClientStreamingRuleSpecBuilder.Build(false, []string{\"UNARY_RPC\"}),\n\t\t\tbufcheckserverbuild.LintRPCNoServerStreamingRuleSpecBuilder.Build(false, []string{\"UNARY_RPC\"}),\n\t\t\tbufcheckserverbuild.LintRPCPascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCRequestResponseUniqueRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCRequestStandardNameRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintRPCResponseStandardNameRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintServicePascalCaseRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintServiceSuffixRuleSpecBuilder.Build(true, []string{\"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintStablePackageNoImportUnstableRuleSpecBuilder.Build(false, []string{}),\n\t\t\tbufcheckserverbuild.LintSyntaxSpecifiedRuleSpecBuilder.Build(true, []string{\"BASIC\", \"DEFAULT\", \"STANDARD\"}),\n\t\t\tbufcheckserverbuild.LintImportNoWeakRuleSpecBuilder.Build(false, []string{}),\n\t\t},\n\t\tCategories: []*check.CategorySpec{\n\t\t\tbufcheckserverbuild.CSRCategorySpec,\n\t\t\tbufcheckserverbuild.FileCategorySpec,\n\t\t\tbufcheckserverbuild.PackageCategorySpec,\n\t\t\tbufcheckserverbuild.WireCategorySpec,\n\t\t\tbufcheckserverbuild.WireJSONCategorySpec,\n\t\t\tbufcheckserverbuild.BasicCategorySpec,\n\t\t\tbufcheckserverbuild.CommentsCategorySpec,\n\t\t\tbufcheckserverbuild.DefaultCategorySpec,\n\t\t\tbufcheckserverbuild.MinimalCategorySpec,\n\t\t\tbufcheckserverbuild.StandardCategorySpec,\n\t\t\tbufcheckserverbuild.UnaryRPCCategorySpec,\n\t\t},\n\t\tBefore: bufcheckserverutil.Before,\n\t}\n)\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/bufcheckserver_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserver_test\n\nimport (\n\t\"testing\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/check/checktest\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver\"\n)\n\n// *** DO NOT ADD MORE TESTS ***\n//\n// We're going to rely on the existing integration tests bufbreaking_test.go and\n// buflint_test.go, and adapt everything to those tests, once we complete the client-side\n// work. This test was just to make sure everything was working end-to-end.\n\nfunc TestSpecs(t *testing.T) {\n\tt.Parallel()\n\n\tchecktest.SpecTest(t, bufcheckserver.V1Beta1Spec)\n\tchecktest.SpecTest(t, bufcheckserver.V1Spec)\n\tchecktest.SpecTest(t, bufcheckserver.V2Spec)\n}\n\nfunc TestServicePascalCase(t *testing.T) {\n\tt.Parallel()\n\n\tfor _, spec := range []*check.Spec{\n\t\tbufcheckserver.V2Spec,\n\t} {\n\t\tchecktest.CheckTest{\n\t\t\tRequest: &checktest.RequestSpec{\n\t\t\t\tFiles: &checktest.ProtoFileSpec{\n\t\t\t\t\tDirPaths:  []string{\"testdata/lint/service_pascal_case\"},\n\t\t\t\t\tFilePaths: []string{\"a.proto\"},\n\t\t\t\t},\n\t\t\t\tRuleIDs: []string{\n\t\t\t\t\t\"SERVICE_PASCAL_CASE\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tSpec: spec,\n\t\t\tExpectedAnnotations: []checktest.ExpectedAnnotation{\n\t\t\t\t{\n\t\t\t\t\tRuleID: \"SERVICE_PASCAL_CASE\",\n\t\t\t\t\tFileLocation: &checktest.ExpectedFileLocation{\n\t\t\t\t\t\tFileName:    \"a.proto\",\n\t\t\t\t\t\tStartLine:   7,\n\t\t\t\t\t\tStartColumn: 8,\n\t\t\t\t\t\tEndLine:     7,\n\t\t\t\t\t\tEndColumn:   12,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tRuleID: \"SERVICE_PASCAL_CASE\",\n\t\t\t\t\tFileLocation: &checktest.ExpectedFileLocation{\n\t\t\t\t\t\tFileName:    \"a.proto\",\n\t\t\t\t\t\tStartLine:   8,\n\t\t\t\t\t\tStartColumn: 8,\n\t\t\t\t\t\tEndLine:     8,\n\t\t\t\t\t\tEndColumn:   15,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tRuleID: \"SERVICE_PASCAL_CASE\",\n\t\t\t\t\tFileLocation: &checktest.ExpectedFileLocation{\n\t\t\t\t\t\tFileName:    \"a.proto\",\n\t\t\t\t\t\tStartLine:   9,\n\t\t\t\t\t\tStartColumn: 8,\n\t\t\t\t\t\tEndLine:     9,\n\t\t\t\t\t\tEndColumn:   18,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tRuleID: \"SERVICE_PASCAL_CASE\",\n\t\t\t\t\tFileLocation: &checktest.ExpectedFileLocation{\n\t\t\t\t\t\tFileName:    \"a.proto\",\n\t\t\t\t\t\tStartLine:   10,\n\t\t\t\t\t\tStartColumn: 8,\n\t\t\t\t\t\tEndLine:     10,\n\t\t\t\t\t\tEndColumn:   17,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t}.Run(t)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverbuild/bufcheckserverbuild.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverbuild\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil\"\n)\n\nvar (\n\t// BreakingEnumNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingEnumNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_NO_DELETE\",\n\t\tPurpose: \"Checks that enums are not deleted from a given file.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingEnumNoDelete,\n\t}\n\t// BreakingEnumSameJSONFormatRuleSpecBuilder is a rule spec builder.\n\tBreakingEnumSameJSONFormatRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_SAME_JSON_FORMAT\",\n\t\tPurpose: \"Checks that enums have the same JSON format support.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingEnumSameJSONFormat,\n\t}\n\t// BreakingEnumSameTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingEnumSameTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_SAME_TYPE\",\n\t\tPurpose: \"Checks that enums have the same type (open vs closed).\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingEnumSameType,\n\t}\n\t// BreakingEnumValueNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingEnumValueNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_VALUE_NO_DELETE\",\n\t\tPurpose: \"Checks that enum values are not deleted from a given enum.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingEnumValueNoDelete,\n\t}\n\t// BreakingEnumValueNoDeleteUnlessNameReservedRuleSpecBuilder is a rule spec builder.\n\tBreakingEnumValueNoDeleteUnlessNameReservedRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\",\n\t\tPurpose: \"Checks that enum values are not deleted from a given enum unless the name is reserved.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingEnumValueNoDeleteUnlessNameReserved,\n\t}\n\t// BreakingEnumValueNoDeleteUnlessNumberReservedRuleSpecBuilder is a rule spec builder.\n\tBreakingEnumValueNoDeleteUnlessNumberReservedRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\",\n\t\tPurpose: \"Checks that enum values are not deleted from a given enum unless the number is reserved.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingEnumValueNoDeleteUnlessNumberReserved,\n\t}\n\t// BreakingEnumValueSameNameRuleSpecBuilder is a rule spec builder.\n\tBreakingEnumValueSameNameRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_VALUE_SAME_NAME\",\n\t\tPurpose: \"Checks that enum values have the same name.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingEnumValueSameName,\n\t}\n\t// BreakingExtensionMessageNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingExtensionMessageNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"EXTENSION_MESSAGE_NO_DELETE\",\n\t\tPurpose: \"Checks that extension ranges are not deleted from a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingExtensionMessageNoDelete,\n\t}\n\t// BreakingExtensionNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingExtensionNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"EXTENSION_NO_DELETE\",\n\t\tPurpose: \"Checks that extensions are not deleted from a given file.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingExtensionNoDelete,\n\t}\n\t// BreakingFieldNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_NO_DELETE\",\n\t\tPurpose: \"Checks that fields are not deleted from a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldNoDelete,\n\t}\n\t// BreakingFieldNoDeleteUnlessNameReservedRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldNoDeleteUnlessNameReservedRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_NO_DELETE_UNLESS_NAME_RESERVED\",\n\t\tPurpose: \"Checks that fields are not deleted from a given message unless the name is reserved.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldNoDeleteUnlessNameReserved,\n\t}\n\t// BreakingFieldNoDeleteUnlessNumberReservedRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldNoDeleteUnlessNumberReservedRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\",\n\t\tPurpose: \"Checks that fields are not deleted from a given message unless the number is reserved.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldNoDeleteUnlessNumberReserved,\n\t}\n\t// BreakingFieldSameCardinalityRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameCardinalityRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_CARDINALITY\",\n\t\tPurpose: \"Checks that fields have the same cardinalities in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameCardinality,\n\t}\n\t// BreakingFieldSameCppStringTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameCppStringTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_CPP_STRING_TYPE\",\n\t\tPurpose: \"Checks that fields have the same C++ string type, based on ctype field option or (pb.cpp).string_type feature.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameCppStringType,\n\t}\n\t// BreakingFieldSameCTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameCTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:             \"FIELD_SAME_CTYPE\",\n\t\tPurpose:        \"Checks that fields have the same value for the ctype option.\",\n\t\tDeprecated:     true,\n\t\tType:           check.RuleTypeBreaking,\n\t\tReplacementIDs: []string{\"FIELD_SAME_CPP_STRING_TYPE\"},\n\t\tHandler: check.RuleHandlerFunc(\n\t\t\tfunc(context.Context, check.ResponseWriter, check.Request) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t),\n\t}\n\t// BreakingFieldSameJavaUTF8ValidationRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameJavaUTF8ValidationRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_JAVA_UTF8_VALIDATION\",\n\t\tPurpose: \"Checks that fields have the same Java string UTF8 validation, based on java_string_check_utf8 file option or (pb.java).utf8_validation feature.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameJavaUTF8Validation,\n\t}\n\t// BreakingFieldSameDefaultRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameDefaultRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_DEFAULT\",\n\t\tPurpose: \"Checks that fields have the same default value, if a default is specified.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameDefault,\n\t}\n\t// BreakingFieldSameJSONNameRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameJSONNameRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_JSON_NAME\",\n\t\tPurpose: \"Checks that fields have the same value for the json_name option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameJSONName,\n\t}\n\t// BreakingFieldSameJSTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameJSTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_JSTYPE\",\n\t\tPurpose: \"Checks that fields have the same value for the jstype option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameJSType,\n\t}\n\t// BreakingFieldSameLabelRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameLabelRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:         \"FIELD_SAME_LABEL\",\n\t\tPurpose:    \"Checks that fields have the same labels in a given message.\",\n\t\tDeprecated: true,\n\t\tType:       check.RuleTypeBreaking,\n\t\tReplacementIDs: []string{\n\t\t\t\"FIELD_SAME_CARDINALITY\",\n\t\t\t\"FIELD_WIRE_COMPATIBLE_CARDINALITY\",\n\t\t\t\"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\",\n\t\t},\n\t\tHandler: check.RuleHandlerFunc(\n\t\t\tfunc(context.Context, check.ResponseWriter, check.Request) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t),\n\t}\n\t// BreakingFieldSameLabelV1Beta1RuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameLabelV1Beta1RuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:             \"FIELD_SAME_LABEL\",\n\t\tPurpose:        \"Checks that fields have the same labels in a given message.\",\n\t\tDeprecated:     true,\n\t\tType:           check.RuleTypeBreaking,\n\t\tReplacementIDs: []string{\"FIELD_SAME_CARDINALITY\"},\n\t\tHandler: check.RuleHandlerFunc(\n\t\t\tfunc(context.Context, check.ResponseWriter, check.Request) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t),\n\t}\n\t// BreakingFieldSameNameRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameNameRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_NAME\",\n\t\tPurpose: \"Checks that fields have the same names in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameName,\n\t}\n\t// BreakingFieldSameOneofRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameOneofRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_ONEOF\",\n\t\tPurpose: \"Checks that fields have the same oneofs in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameOneof,\n\t}\n\t// BreakingFieldSameUTF8ValidationRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameUTF8ValidationRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_UTF8_VALIDATION\",\n\t\tPurpose: \"Checks that string fields have the same UTF8 validation mode.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameUTF8Validation,\n\t}\n\t// BreakingFieldSameTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldSameTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_SAME_TYPE\",\n\t\tPurpose: \"Checks that fields have the same types in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldSameType,\n\t}\n\t// BreakingFieldWireCompatibleCardinalityRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldWireCompatibleCardinalityRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_WIRE_COMPATIBLE_CARDINALITY\",\n\t\tPurpose: \"Checks that fields have wire-compatible cardinalities in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldWireCompatibleCardinality,\n\t}\n\t// BreakingFieldWireCompatibleTypeRuleSpecBuilder  is a rule spec builder.\n\tBreakingFieldWireCompatibleTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_WIRE_COMPATIBLE_TYPE\",\n\t\tPurpose: \"Checks that fields have wire-compatible types in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldWireCompatibleType,\n\t}\n\t// BreakingFieldWireJSONCompatibleCardinalityRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldWireJSONCompatibleCardinalityRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\",\n\t\tPurpose: \"Checks that fields have wire and JSON compatible cardinalities in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldWireJSONCompatibleCardinality,\n\t}\n\t// BreakingFieldWireJSONCompatibleTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingFieldWireJSONCompatibleTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_WIRE_JSON_COMPATIBLE_TYPE\",\n\t\tPurpose: \"Checks that fields have wire and JSON compatible types in a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFieldWireJSONCompatibleType,\n\t}\n\t// BreakingFileNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingFileNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_NO_DELETE\",\n\t\tPurpose: \"Checks that files are not deleted.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileNoDelete,\n\t}\n\t// BreakingFileSameCsharpNamespaceRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameCsharpNamespaceRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_CSHARP_NAMESPACE\",\n\t\tPurpose: \"Checks that files have the same value for the csharp_namespace option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameCsharpNamespace,\n\t}\n\t// BreakingFileSameGoPackageRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameGoPackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_GO_PACKAGE\",\n\t\tPurpose: \"Checks that files have the same value for the go_package option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameGoPackage,\n\t}\n\t// BreakingFileSameJavaMultipleFilesRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameJavaMultipleFilesRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_JAVA_MULTIPLE_FILES\",\n\t\tPurpose: \"Checks that files have the same value for the java_multiple_files option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameJavaMultipleFiles,\n\t}\n\t// BreakingFileSameJavaOuterClassnameRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameJavaOuterClassnameRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_JAVA_OUTER_CLASSNAME\",\n\t\tPurpose: \"Checks that files have the same value for the java_outer_classname option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameJavaOuterClassname,\n\t}\n\t// BreakingFileSameJavaPackageRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameJavaPackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_JAVA_PACKAGE\",\n\t\tPurpose: \"Checks that files have the same value for the java_package option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameJavaPackage,\n\t}\n\t// BreakingFileSameJavaStringCheckUtf8RuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameJavaStringCheckUtf8RuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:             \"FILE_SAME_JAVA_STRING_CHECK_UTF8\",\n\t\tPurpose:        \"Checks that files have the same value for the java_string_check_utf8 option.\",\n\t\tDeprecated:     true,\n\t\tType:           check.RuleTypeBreaking,\n\t\tReplacementIDs: []string{\"FIELD_SAME_JAVA_UTF8_VALIDATION\"},\n\t\tHandler: check.RuleHandlerFunc(\n\t\t\tfunc(context.Context, check.ResponseWriter, check.Request) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t),\n\t}\n\t// BreakingFileSameObjcClassPrefixRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameObjcClassPrefixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_OBJC_CLASS_PREFIX\",\n\t\tPurpose: \"Checks that files have the same value for the objc_class_prefix option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameObjcClassPrefix,\n\t}\n\t// BreakingFileSamePackageRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSamePackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_PACKAGE\",\n\t\tPurpose: \"Checks that files have the same package.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSamePackage,\n\t}\n\t// BreakingFileSamePhpClassPrefixRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSamePhpClassPrefixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_PHP_CLASS_PREFIX\",\n\t\tPurpose: \"Checks that files have the same value for the php_class_prefix option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSamePhpClassPrefix,\n\t}\n\t// BreakingFileSamePhpMetadataNamespaceRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSamePhpMetadataNamespaceRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_PHP_METADATA_NAMESPACE\",\n\t\tPurpose: \"Checks that files have the same value for the php_metadata_namespace option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSamePhpMetadataNamespace,\n\t}\n\t// BreakingFileSamePhpNamespaceRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSamePhpNamespaceRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_PHP_NAMESPACE\",\n\t\tPurpose: \"Checks that files have the same value for the php_namespace option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSamePhpNamespace,\n\t}\n\t// BreakingFileSameRubyPackageRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameRubyPackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_RUBY_PACKAGE\",\n\t\tPurpose: \"Checks that files have the same value for the ruby_package option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameRubyPackage,\n\t}\n\t// BreakingFileSameSwiftPrefixRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameSwiftPrefixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_SWIFT_PREFIX\",\n\t\tPurpose: \"Checks that files have the same value for the swift_prefix option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameSwiftPrefix,\n\t}\n\t// BreakingFileSameOptimizeForRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameOptimizeForRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_OPTIMIZE_FOR\",\n\t\tPurpose: \"Checks that files have the same value for the optimize_for option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameOptimizeFor,\n\t}\n\t// BreakingFileSameCcGenericServicesRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameCcGenericServicesRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_CC_GENERIC_SERVICES\",\n\t\tPurpose: \"Checks that files have the same value for the cc_generic_services option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameCcGenericServices,\n\t}\n\t// BreakingFileSameJavaGenericServicesRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameJavaGenericServicesRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_JAVA_GENERIC_SERVICES\",\n\t\tPurpose: \"Checks that files have the same value for the java_generic_services option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameJavaGenericServices,\n\t}\n\t// BreakingFileSamePyGenericServicesRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSamePyGenericServicesRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_PY_GENERIC_SERVICES\",\n\t\tPurpose: \"Checks that files have the same value for the py_generic_services option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSamePyGenericServices,\n\t}\n\t// BreakingFileSamePhpGenericServicesRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSamePhpGenericServicesRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:         \"FILE_SAME_PHP_GENERIC_SERVICES\",\n\t\tPurpose:    \"Checks that files have the same value for the php_generic_services option.\",\n\t\tDeprecated: true,\n\t\tType:       check.RuleTypeBreaking,\n\t\tHandler: check.RuleHandlerFunc(\n\t\t\tfunc(context.Context, check.ResponseWriter, check.Request) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t),\n\t}\n\t// BreakingFileSameCcEnableArenasRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameCcEnableArenasRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_CC_ENABLE_ARENAS\",\n\t\tPurpose: \"Checks that files have the same value for the cc_enable_arenas option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameCcEnableArenas,\n\t}\n\t// BreakingFileSameSyntaxRuleSpecBuilder is a rule spec builder.\n\tBreakingFileSameSyntaxRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_SAME_SYNTAX\",\n\t\tPurpose: \"Checks that files have the same syntax.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingFileSameSyntax,\n\t}\n\t// BreakingMessageNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingMessageNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"MESSAGE_NO_DELETE\",\n\t\tPurpose: \"Checks that messages are not deleted from a given file.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingMessageNoDelete,\n\t}\n\t// BreakingMessageNoRemoveStandardDescriptorAccessorRuleSpecBuilder is a rule spec builder.\n\tBreakingMessageNoRemoveStandardDescriptorAccessorRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\",\n\t\tPurpose: \"Checks that messages do not change the no_standard_descriptor_accessor option from false or unset to true.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingMessageNoRemoveStandardDescriptorAccessor,\n\t}\n\t// BreakingMessageSameJSONFormatRuleSpecBuilder is a rule spec builder.\n\tBreakingMessageSameJSONFormatRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"MESSAGE_SAME_JSON_FORMAT\",\n\t\tPurpose: \"Checks that messages have the same JSON format support.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingMessageSameJSONFormat,\n\t}\n\t// BreakingMessageSameMessageSetWireFormatRuleSpecBuilder is a rule spec builder.\n\t//\n\t// This is deprecated. This rule is now a no-op. We can't do this rule anymore because protobuf-go\n\t// locked out handling of MessageSets. Because reasons. Grep \"ProtoLegacy\" in protobuf-go for more details.\n\tBreakingMessageSameMessageSetWireFormatRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:         \"MESSAGE_SAME_MESSAGE_SET_WIRE_FORMAT\",\n\t\tPurpose:    \"Checks that messages have the same value for the message_set_wire_format option.\",\n\t\tType:       check.RuleTypeBreaking,\n\t\tDeprecated: true,\n\t\tHandler: check.RuleHandlerFunc(\n\t\t\tfunc(context.Context, check.ResponseWriter, check.Request) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t),\n\t}\n\t// BreakingMessageSameRequiredFieldsRuleSpecBuilder is a rule spec builder.\n\tBreakingMessageSameRequiredFieldsRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"MESSAGE_SAME_REQUIRED_FIELDS\",\n\t\tPurpose: \"Checks that messages have no added or deleted required fields.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingMessageSameRequiredFields,\n\t}\n\t// BreakingOneofNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingOneofNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ONEOF_NO_DELETE\",\n\t\tPurpose: \"Checks that oneofs are not deleted from a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingOneofNoDelete,\n\t}\n\t// BreakingPackageEnumNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingPackageEnumNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_ENUM_NO_DELETE\",\n\t\tPurpose: \"Checks that enums are not deleted from a given package.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingPackageEnumNoDelete,\n\t}\n\t// BreakingPackageExtensionNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingPackageExtensionNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_EXTENSION_NO_DELETE\",\n\t\tPurpose: \"Checks that extensions are not deleted from a given package.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingPackageExtensionNoDelete,\n\t}\n\t// BreakingPackageMessageNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingPackageMessageNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_MESSAGE_NO_DELETE\",\n\t\tPurpose: \"Checks that messages are not deleted from a given package.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingPackageMessageNoDelete,\n\t}\n\t// BreakingPackageNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingPackageNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_NO_DELETE\",\n\t\tPurpose: \"Checks that packages are not deleted.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingPackageNoDelete,\n\t}\n\t// BreakingPackageServiceNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingPackageServiceNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SERVICE_NO_DELETE\",\n\t\tPurpose: \"Checks that services are not deleted from a given package.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingPackageServiceNoDelete,\n\t}\n\t// BreakingReservedEnumNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingReservedEnumNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RESERVED_ENUM_NO_DELETE\",\n\t\tPurpose: \"Checks that reserved ranges and names are not deleted from a given enum.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingReservedEnumNoDelete,\n\t}\n\t// BreakingReservedMessageNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingReservedMessageNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RESERVED_MESSAGE_NO_DELETE\",\n\t\tPurpose: \"Checks that reserved ranges and names are not deleted from a given message.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingReservedMessageNoDelete,\n\t}\n\t// BreakingRPCNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingRPCNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_NO_DELETE\",\n\t\tPurpose: \"Checks that rpcs are not deleted from a given service.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingRPCNoDelete,\n\t}\n\t// BreakingRPCSameClientStreamingRuleSpecBuilder is a rule spec builder.\n\tBreakingRPCSameClientStreamingRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_SAME_CLIENT_STREAMING\",\n\t\tPurpose: \"Checks that rpcs have the same client streaming value.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingRPCSameClientStreaming,\n\t}\n\t// BreakingRPCSameIdempotencyLevelRuleSpecBuilder is a rule spec builder.\n\tBreakingRPCSameIdempotencyLevelRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_SAME_IDEMPOTENCY_LEVEL\",\n\t\tPurpose: \"Checks that rpcs have the same value for the idempotency_level option.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingRPCSameIdempotencyLevel,\n\t}\n\t// BreakingRPCSameRequestTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingRPCSameRequestTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_SAME_REQUEST_TYPE\",\n\t\tPurpose: \"Checks that rpcs are have the same request type.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingRPCSameRequestType,\n\t}\n\t// BreakingRPCSameResponseTypeRuleSpecBuilder is a rule spec builder.\n\tBreakingRPCSameResponseTypeRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_SAME_RESPONSE_TYPE\",\n\t\tPurpose: \"Checks that rpcs are have the same response type.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingRPCSameResponseType,\n\t}\n\t// BreakingRPCSameServerStreamingRuleSpecBuilder is a rule spec builder.\n\tBreakingRPCSameServerStreamingRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_SAME_SERVER_STREAMING\",\n\t\tPurpose: \"Checks that rpcs have the same server streaming value.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingRPCSameServerStreaming,\n\t}\n\t// BreakingServiceNoDeleteRuleSpecBuilder is a rule spec builder.\n\tBreakingServiceNoDeleteRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"SERVICE_NO_DELETE\",\n\t\tPurpose: \"Checks that services are not deleted from a given file.\",\n\t\tType:    check.RuleTypeBreaking,\n\t\tHandler: bufcheckserverhandle.HandleBreakingServiceNoDelete,\n\t}\n\t// LintCommentEnumRuleSpecBuilder is a rule spec builder.\n\tLintCommentEnumRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"COMMENT_ENUM\",\n\t\tPurpose: \"Checks that enums have non-empty comments.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintCommentEnum,\n\t}\n\t// LintCommentEnumValueRuleSpecBuilder is a rule spec builder.\n\tLintCommentEnumValueRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"COMMENT_ENUM_VALUE\",\n\t\tPurpose: \"Checks that enum values have non-empty comments.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintCommentEnumValue,\n\t}\n\t// LintCommentFieldRuleSpecBuilder is a rule spec builder.\n\tLintCommentFieldRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"COMMENT_FIELD\",\n\t\tPurpose: \"Checks that fields have non-empty comments.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintCommentField,\n\t}\n\t// LintCommentMessageRuleSpecBuilder is a rule spec builder.\n\tLintCommentMessageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"COMMENT_MESSAGE\",\n\t\tPurpose: \"Checks that messages have non-empty comments.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintCommentMessage,\n\t}\n\t// LintCommentOneofRuleSpecBuilder is a rule spec builder.\n\tLintCommentOneofRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"COMMENT_ONEOF\",\n\t\tPurpose: \"Checks that oneofs have non-empty comments.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintCommentOneof,\n\t}\n\t// LintCommentRPCRuleSpecBuilder is a rule spec builder.\n\tLintCommentRPCRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"COMMENT_RPC\",\n\t\tPurpose: \"Checks that RPCs have non-empty comments.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintCommentRPC,\n\t}\n\t// LintCommentServiceRuleSpecBuilder is a rule spec builder.\n\tLintCommentServiceRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"COMMENT_SERVICE\",\n\t\tPurpose: \"Checks that services have non-empty comments.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintCommentService,\n\t}\n\t// LintDirectorySamePackageRuleSpecBuilder is a rule spec builder.\n\tLintDirectorySamePackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"DIRECTORY_SAME_PACKAGE\",\n\t\tPurpose: \"Checks that all files in a given directory are in the same package.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintDirectorySamePackage,\n\t}\n\t// LintEnumFirstValueZeroRuleSpecBuilder is a rule spec builder.\n\tLintEnumFirstValueZeroRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_FIRST_VALUE_ZERO\",\n\t\tPurpose: \"Checks that all first values of enums have a numeric value of 0.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintEnumFirstValueZero,\n\t}\n\t// LintEnumNoAllowAliasRuleSpecBuilder is a rule spec builder.\n\tLintEnumNoAllowAliasRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_NO_ALLOW_ALIAS\",\n\t\tPurpose: \"Checks that enums do not have the allow_alias option set.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintEnumNoAllowAlias,\n\t}\n\t// LintEnumPascalCaseRuleSpecBuilder is a rule spec builder.\n\tLintEnumPascalCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_PASCAL_CASE\",\n\t\tPurpose: \"Checks that enums are PascalCase.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintEnumPascalCase,\n\t}\n\t// LintEnumValuePrefixRuleSpecBuilder is a rule spec builder.\n\tLintEnumValuePrefixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_VALUE_PREFIX\",\n\t\tPurpose: \"Checks that enum values are prefixed with ENUM_NAME_UPPER_SNAKE_CASE.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintEnumValuePrefix,\n\t}\n\t// LintEnumValueUpperSnakeCaseRuleSpecBuilder is a rule spec builder.\n\tLintEnumValueUpperSnakeCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_VALUE_UPPER_SNAKE_CASE\",\n\t\tPurpose: \"Checks that enum values are UPPER_SNAKE_CASE.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintEnumValueUpperSnakeCase,\n\t}\n\t// LintEnumZeroValueSuffixRuleSpecBuilder is a rule spec builder.\n\tLintEnumZeroValueSuffixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ENUM_ZERO_VALUE_SUFFIX\",\n\t\tPurpose: `Checks that enum zero values have a consistent suffix (configurable, default suffix is \"_UNSPECIFIED\").`,\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintEnumZeroValueSuffix,\n\t}\n\t// LintFieldLowerSnakeCaseRuleSpecBuilder is a rule spec builder.\n\tLintFieldLowerSnakeCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_LOWER_SNAKE_CASE\",\n\t\tPurpose: \"Checks that field names are lower_snake_case.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintFieldLowerSnakeCase,\n\t}\n\t// LintFieldNoDescriptorRuleSpecBuilder is a rule spec builder.\n\tLintFieldNoDescriptorRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_NO_DESCRIPTOR\",\n\t\tPurpose: `Checks that field names are not any capitalization of \"descriptor\" with any number of prefix or suffix underscores.`,\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintFieldNoDescriptor,\n\t}\n\t// LintFieldNotRequiredRuleSpecBuilder is a rule spec builder.\n\tLintFieldNotRequiredRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FIELD_NOT_REQUIRED\",\n\t\tPurpose: `Checks that fields are not configured to be required.`,\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintFieldNotRequired,\n\t}\n\t// LintFileLowerSnakeCaseRuleSpecBuilder is a rule spec builder.\n\tLintFileLowerSnakeCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"FILE_LOWER_SNAKE_CASE\",\n\t\tPurpose: \"Checks that filenames are lower_snake_case.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintFileLowerSnakeCase,\n\t}\n\t// LintImportNoPublicRuleSpecBuilder is a rule spec builder.\n\tLintImportNoPublicRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"IMPORT_NO_PUBLIC\",\n\t\tPurpose: \"Checks that imports are not public.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintImportNoPublic,\n\t}\n\t// LintImportNoWeakRuleSpecBuilder is a rule spec builder.\n\tLintImportNoWeakRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:         \"IMPORT_NO_WEAK\",\n\t\tPurpose:    \"Checks that imports are not weak.\",\n\t\tDeprecated: true,\n\t\tType:       check.RuleTypeLint,\n\t\tHandler: check.RuleHandlerFunc(\n\t\t\tfunc(context.Context, check.ResponseWriter, check.Request) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t),\n\t}\n\t// LintImportUsedRuleSpecBuilder is a rule spec builder.\n\tLintImportUsedRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"IMPORT_USED\",\n\t\tPurpose: \"Checks that imports are used.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintImportUsed,\n\t}\n\t// LintMessagePascalCaseRuleSpecBuilder is a rule spec builder.\n\tLintMessagePascalCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"MESSAGE_PASCAL_CASE\",\n\t\tPurpose: \"Checks that messages are PascalCase.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintMessagePascalCase,\n\t}\n\t// LintOneofLowerSnakeCaseRuleSpecBuilder is a rule spec builder.\n\tLintOneofLowerSnakeCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"ONEOF_LOWER_SNAKE_CASE\",\n\t\tPurpose: \"Checks that oneof names are lower_snake_case.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintOneofLowerSnakeCase,\n\t}\n\t// LintPackageDefinedRuleSpecBuilder is a rule spec builder.\n\tLintPackageDefinedRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_DEFINED\",\n\t\tPurpose: \"Checks that all files have a package defined.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageDefined,\n\t}\n\t// LintPackageDirectoryMatchRuleSpecBuilder is a rule spec builder.\n\tLintPackageDirectoryMatchRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_DIRECTORY_MATCH\",\n\t\tPurpose: \"Checks that all files are in a directory that matches their package name.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageDirectoryMatch,\n\t}\n\t// LintPackageLowerSnakeCaseRuleSpecBuilder is a rule spec builder.\n\tLintPackageLowerSnakeCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_LOWER_SNAKE_CASE\",\n\t\tPurpose: \"Checks that packages are lower_snake.case.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageLowerSnakeCase,\n\t}\n\t// LintPackageNoImportCycleRuleSpecBuilder is a rule spec builder.\n\tLintPackageNoImportCycleRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_NO_IMPORT_CYCLE\",\n\t\tPurpose: \"Checks that packages do not have import cycles.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageNoImportCycle,\n\t}\n\t// LintPackageSameCsharpNamespaceRuleSpecBuilder is a rule spec builder.\n\tLintPackageSameCsharpNamespaceRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_CSHARP_NAMESPACE\",\n\t\tPurpose: \"Checks that all files with a given package have the same value for the csharp_namespace option.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSameCsharpNamespace,\n\t}\n\t// LintPackageSameDirectoryRuleSpecBuilder is a rule spec builder.\n\tLintPackageSameDirectoryRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_DIRECTORY\",\n\t\tPurpose: \"Checks that all files with a given package are in the same directory.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSameDirectory,\n\t}\n\t// LintPackageSameGoPackageRuleSpecBuilder is a rule spec builder.\n\tLintPackageSameGoPackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_GO_PACKAGE\",\n\t\tPurpose: \"Checks that all files with a given package have the same value for the go_package option.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSameGoPackage,\n\t}\n\t// LintPackageSameJavaMultipleFilesRuleSpecBuilder is a rule spec builder.\n\tLintPackageSameJavaMultipleFilesRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_JAVA_MULTIPLE_FILES\",\n\t\tPurpose: \"Checks that all files with a given package have the same value for the java_multiple_files option.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSameJavaMultipleFiles,\n\t}\n\t// LintPackageSameJavaPackageRuleSpecBuilder is a rule spec builder.\n\tLintPackageSameJavaPackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_JAVA_PACKAGE\",\n\t\tPurpose: \"Checks that all files with a given package have the same value for the java_package option.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSameJavaPackage,\n\t}\n\t// LintPackageSamePhpNamespaceRuleSpecBuilder is a rule spec builder.\n\tLintPackageSamePhpNamespaceRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_PHP_NAMESPACE\",\n\t\tPurpose: \"Checks that all files with a given package have the same value for the php_namespace option.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSamePhpNamespace,\n\t}\n\t// LintPackageSameRubyPackageRuleSpecBuilder is a rule spec builder.\n\tLintPackageSameRubyPackageRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_RUBY_PACKAGE\",\n\t\tPurpose: \"Checks that all files with a given package have the same value for the ruby_package option.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSameRubyPackage,\n\t}\n\t// LintPackageSameSwiftPrefixRuleSpecBuilder is a rule spec builder.\n\tLintPackageSameSwiftPrefixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_SAME_SWIFT_PREFIX\",\n\t\tPurpose: \"Checks that all files with a given package have the same value for the swift_prefix option.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageSameSwiftPrefix,\n\t}\n\t// LintPackageVersionSuffixRuleSpecBuilder is a rule spec builder.\n\tLintPackageVersionSuffixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PACKAGE_VERSION_SUFFIX\",\n\t\tPurpose: `Checks that the last component of all packages is a version of the form v\\d+, v\\d+test.*, v\\d+(alpha|beta)\\d+, or v\\d+p\\d+(alpha|beta)\\d+, where numbers are >=1.`,\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintPackageVersionSuffix,\n\t}\n\t// LintProtovalidateRuleSpecBuilder is a rule spec builder.\n\tLintProtovalidateRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"PROTOVALIDATE\",\n\t\tPurpose: \"Checks that protovalidate rules are valid and all CEL expressions compile.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintProtovalidate,\n\t}\n\t// LintRPCNoClientStreamingRuleSpecBuilder is a rule spec builder.\n\tLintRPCNoClientStreamingRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_NO_CLIENT_STREAMING\",\n\t\tPurpose: \"Checks that RPCs are not client streaming.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintRPCNoClientStreaming,\n\t}\n\t// LintRPCNoServerStreamingRuleSpecBuilder is a rule spec builder.\n\tLintRPCNoServerStreamingRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_NO_SERVER_STREAMING\",\n\t\tPurpose: \"Checks that RPCs are not server streaming.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintRPCNoServerStreaming,\n\t}\n\t// LintRPCPascalCaseRuleSpecBuilder is a rule spec builder.\n\tLintRPCPascalCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_PASCAL_CASE\",\n\t\tPurpose: \"Checks that RPCs are PascalCase.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintRPCPascalCase,\n\t}\n\t// LintRPCRequestResponseUniqueRuleSpecBuilder is a rule spec builder.\n\tLintRPCRequestResponseUniqueRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_REQUEST_RESPONSE_UNIQUE\",\n\t\tPurpose: \"Checks that RPC request and response types are only used in one RPC (configurable).\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintRPCRequestResponseUnique,\n\t}\n\t// LintRPCRequestStandardNameRuleSpecBuilder is a rule spec builder.\n\tLintRPCRequestStandardNameRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_REQUEST_STANDARD_NAME\",\n\t\tPurpose: \"Checks that RPC request type names are RPCNameRequest or ServiceNameRPCNameRequest (configurable).\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintRPCRequestStandardName,\n\t}\n\t// LintRPCResponseStandardNameRuleSpecBuilder is a rule spec builder.\n\tLintRPCResponseStandardNameRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"RPC_RESPONSE_STANDARD_NAME\",\n\t\tPurpose: \"Checks that RPC response type names are RPCNameResponse or ServiceNameRPCNameResponse (configurable).\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintRPCResponseStandardName,\n\t}\n\t// LintServicePascalCaseRuleSpecBuilder is a rule spec builder.\n\tLintServicePascalCaseRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"SERVICE_PASCAL_CASE\",\n\t\tPurpose: \"Checks that services are PascalCase.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintServicePascalCase,\n\t}\n\t// LintServiceSuffixRuleSpecBuilder is a rule spec builder.\n\tLintServiceSuffixRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"SERVICE_SUFFIX\",\n\t\tPurpose: `Checks that services have a consistent suffix (configurable, default suffix is \"Service\").`,\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintServiceSuffix,\n\t}\n\t// LintStablePackageNoImportUnstableRuleSpecBuilder is a rule spec builder.\n\tLintStablePackageNoImportUnstableRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"STABLE_PACKAGE_NO_IMPORT_UNSTABLE\",\n\t\tPurpose: \"Checks that all files that have stable versioned packages do not import packages with unstable version packages.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintStablePackageNoImportUnstable,\n\t}\n\t// LintSyntaxSpecifiedRuleSpecBuilder is a rule spec builder.\n\tLintSyntaxSpecifiedRuleSpecBuilder = &bufcheckserverutil.RuleSpecBuilder{\n\t\tID:      \"SYNTAX_SPECIFIED\",\n\t\tPurpose: \"Checks that all files have a syntax specified.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: bufcheckserverhandle.HandleLintSyntaxSpecified,\n\t}\n\n\t// TODO: Improve purposes. These are in buf.build/docs. Perhaps we can abandon the \"checks that\" prefix.\n\n\t// CSRCategorySpec is a category spec.\n\tCSRCategorySpec = &check.CategorySpec{\n\t\tID:      \"CSR\",\n\t\tPurpose: \"Checks that there are no Confluent Schema Registry (CSR) compatibility breaking changes.\",\n\t}\n\t// FileCategorySpec is a category spec.\n\tFileCategorySpec = &check.CategorySpec{\n\t\tID:      \"FILE\",\n\t\tPurpose: \"Checks that there are no source-code breaking changes at the per-file level.\",\n\t}\n\t// PackageCategorySpec is a category spec.\n\tPackageCategorySpec = &check.CategorySpec{\n\t\tID:      \"PACKAGE\",\n\t\tPurpose: \"Checks that there are no source-code breaking changes at the per-package level.\",\n\t}\n\t// WireCategorySpec is a category spec.\n\tWireCategorySpec = &check.CategorySpec{\n\t\tID:      \"WIRE\",\n\t\tPurpose: \"Checks that there are no wire breaking changes for the binary encoding.\",\n\t}\n\t// WireJSONCategorySpec is a category spec.\n\tWireJSONCategorySpec = &check.CategorySpec{\n\t\tID:      \"WIRE_JSON\",\n\t\tPurpose: \"Checks that there are no wire breaking changes for the binary or JSON encodings.\",\n\t}\n\n\t// BasicCategorySpec is a category spec.\n\tBasicCategorySpec = &check.CategorySpec{\n\t\tID:      \"BASIC\",\n\t\tPurpose: \"Checks that basic lint rules are followed.\",\n\t}\n\t// CommentsCategorySpec is a category spec.\n\tCommentsCategorySpec = &check.CategorySpec{\n\t\tID:      \"COMMENTS\",\n\t\tPurpose: \"Checks that all types have comments.\",\n\t}\n\t// DefaultCategorySpec is a category spec.\n\tDefaultCategorySpec = &check.CategorySpec{\n\t\tID:             \"DEFAULT\",\n\t\tPurpose:        \"Checks that default lint rules are followed.\",\n\t\tDeprecated:     true,\n\t\tReplacementIDs: []string{\"STANDARD\"},\n\t}\n\t// FileLayoutCategorySpec is a category spec.\n\tFileLayoutCategorySpec = &check.CategorySpec{\n\t\tID:      \"FILE_LAYOUT\",\n\t\tPurpose: \"Checks the file layout.\",\n\t}\n\t// MinimalCategorySpec is a category spec.\n\tMinimalCategorySpec = &check.CategorySpec{\n\t\tID:      \"MINIMAL\",\n\t\tPurpose: \"Checks that bare-minimum lint rules are followed.\",\n\t}\n\t// OtherCategorySpec is a category spec.\n\tOtherCategorySpec = &check.CategorySpec{\n\t\tID:      \"OTHER\",\n\t\tPurpose: \"Checks other lint rules.\",\n\t}\n\t// PackageAffinityCategorySpec is a category spec.\n\tPackageAffinityCategorySpec = &check.CategorySpec{\n\t\tID:      \"PACKAGE_AFFINITY\",\n\t\tPurpose: \"Checks package affinity.\",\n\t}\n\t// SensibleCategorySpec is a category spec.\n\tSensibleCategorySpec = &check.CategorySpec{\n\t\tID:      \"SENSIBLE\",\n\t\tPurpose: \"Checks sensible lint rules.\",\n\t}\n\t// StyleBasicCategorySpec is a category spec.\n\tStyleBasicCategorySpec = &check.CategorySpec{\n\t\tID:      \"STYLE_BASIC\",\n\t\tPurpose: \"Checks that basic style lint rules are followed.\",\n\t}\n\t// StyleDefaultCategorySpec is a category spec.\n\tStyleDefaultCategorySpec = &check.CategorySpec{\n\t\tID:             \"STYLE_DEFAULT\",\n\t\tPurpose:        \"Checks that default style lint rules are followed.\",\n\t\tDeprecated:     true,\n\t\tReplacementIDs: []string{\"STYLE_STANDARD\"},\n\t}\n\t// StyleStandardCategorySpec is a category spec.\n\tStyleStandardCategorySpec = &check.CategorySpec{\n\t\tID:      \"STYLE_STANDARD\",\n\t\tPurpose: \"Checks that standard style lint rules are followed.\",\n\t}\n\t// StandardCategorySpec is a category spec.\n\tStandardCategorySpec = &check.CategorySpec{\n\t\tID:      \"STANDARD\",\n\t\tPurpose: \"Checks that standard lint rules are followed.\",\n\t}\n\t// UnaryRPCCategorySpec is a category spec.\n\tUnaryRPCCategorySpec = &check.CategorySpec{\n\t\tID:      \"UNARY_RPC\",\n\t\tPurpose: \"Checks that all RPCs are unary.\",\n\t}\n)\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverbuild/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcheckserverbuild\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/breaking.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/gen/proto/go/google/protobuf\"\n\t\"github.com/bufbuild/protocompile/protoutil\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// HandleBreakingEnumNoDelete is a check function.\nvar HandleBreakingEnumNoDelete = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingEnumNoDelete)\n\nfunc handleBreakingEnumNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\tpreviousNestedNameToEnum, err := bufprotosource.NestedNameToEnum(previousFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnestedNameToEnum, err := bufprotosource.NestedNameToEnum(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousNestedName, previousEnum := range previousNestedNameToEnum {\n\t\tif _, ok := nestedNameToEnum[previousNestedName]; !ok {\n\t\t\t// TODO: search for enum in other files and return that the enum was moved?\n\t\t\tdescriptor, location, err := getDescriptorAndLocationForDeletedElement(file, previousNestedName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tlocation,\n\t\t\t\tpreviousEnum.Location(),\n\t\t\t\tdescriptor.File().Path(),\n\t\t\t\t`Previously present enum %q was deleted from file.`,\n\t\t\t\tpreviousNestedName,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingExtensionNoDelete is a check function.\nvar HandleBreakingExtensionNoDelete = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingExtensionNoDelete)\n\nfunc handleBreakingExtensionNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\tpreviousNestedNameToExtension, err := bufprotosource.NestedNameToExtension(previousFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnestedNameToExtension, err := bufprotosource.NestedNameToExtension(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousNestedName, previousExtension := range previousNestedNameToExtension {\n\t\tif _, ok := nestedNameToExtension[previousNestedName]; !ok {\n\t\t\tdescriptor, location, err := getDescriptorAndLocationForDeletedElement(file, previousNestedName)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tlocation,\n\t\t\t\tpreviousExtension.Location(),\n\t\t\t\tdescriptor.File().Path(),\n\t\t\t\t`Previously present extension %q was deleted from file.`,\n\t\t\t\tpreviousNestedName,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingFileNoDelete is a check function.\nvar HandleBreakingFileNoDelete = bufcheckserverutil.NewRuleHandler(handleBreakingFileNoDelete)\n\nfunc handleBreakingFileNoDelete(\n\t_ context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\tpreviousFilePathToFile, err := bufprotosource.FilePathToFile(request.AgainstProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfilePathToFile, err := bufprotosource.FilePathToFile(request.ProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousFilePath := range previousFilePathToFile {\n\t\tif _, ok := filePathToFile[previousFilePath]; !ok {\n\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\tcheck.WithAgainstFileName(previousFilePath),\n\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t`Previously present file %q was deleted.`,\n\t\t\t\t\tpreviousFilePath,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingMessageNoDelete is a check function.\nvar HandleBreakingMessageNoDelete = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingMessageNoDelete)\n\nfunc handleBreakingMessageNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\tpreviousNestedNameToMessage, err := bufprotosource.NestedNameToMessage(previousFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnestedNameToMessage, err := bufprotosource.NestedNameToMessage(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousNestedName, previousMessage := range previousNestedNameToMessage {\n\t\tif _, ok := nestedNameToMessage[previousNestedName]; !ok {\n\t\t\tdescriptor, location := getDescriptorAndLocationForDeletedMessage(file, nestedNameToMessage, previousNestedName)\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tlocation,\n\t\t\t\tpreviousMessage.Location(),\n\t\t\t\tdescriptor.File().Path(),\n\t\t\t\t`Previously present message %q was deleted from file.`,\n\t\t\t\tpreviousNestedName,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingServiceNoDelete is a check function.\nvar HandleBreakingServiceNoDelete = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingServiceNoDelete)\n\nfunc handleBreakingServiceNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\tpreviousNameToService, err := bufprotosource.NameToService(previousFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnameToService, err := bufprotosource.NameToService(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousName, previousService := range previousNameToService {\n\t\tif _, ok := nameToService[previousName]; !ok {\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tnil, // Deleted service does not have an input location\n\t\t\t\tpreviousService.Location(),\n\t\t\t\tfile.Path(),\n\t\t\t\t`Previously present service %q was deleted from file.`,\n\t\t\t\tpreviousName,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingEnumSameType is a check function.\nvar HandleBreakingEnumSameType = bufcheckserverutil.NewBreakingEnumPairRuleHandler(handleBreakingEnumSameType)\n\nfunc handleBreakingEnumSameType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n\tpreviousEnum bufprotosource.Enum,\n) error {\n\tpreviousDescriptor, err := previousEnum.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := enum.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousDescriptor.IsClosed() != descriptor.IsClosed() {\n\t\tpreviousState, currentState := \"closed\", \"open\"\n\t\tif descriptor.IsClosed() {\n\t\t\tpreviousState, currentState = currentState, previousState\n\t\t}\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(enum.Features().EnumTypeLocation(), enum.Location()),\n\t\t\twithBackupLocation(previousEnum.Features().EnumTypeLocation(), previousEnum.Location()),\n\t\t\tenum.File().Path(),\n\t\t\t`Enum %q changed from %s to %s.`,\n\t\t\tenum.Name(),\n\t\t\tpreviousState,\n\t\t\tcurrentState,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingEnumValueNoDelete is a check function.\nvar HandleBreakingEnumValueNoDelete = bufcheckserverutil.NewBreakingEnumPairRuleHandler(handleBreakingEnumValueNoDelete)\n\nfunc handleBreakingEnumValueNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n\tpreviousEnum bufprotosource.Enum,\n) error {\n\treturn checkEnumValueNoDeleteWithRules(\n\t\tresponseWriter,\n\t\tpreviousEnum,\n\t\tenum,\n\t\tfalse,\n\t\tfalse,\n\t)\n}\n\n// HandleBreakingEnumValueNoDeleteUnlessNameReserved is a check function.\nvar HandleBreakingEnumValueNoDeleteUnlessNameReserved = bufcheckserverutil.NewBreakingEnumPairRuleHandler(handleBreakingEnumValueNoDeleteUnlessNameReserved)\n\nfunc handleBreakingEnumValueNoDeleteUnlessNameReserved(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n\tpreviousEnum bufprotosource.Enum,\n) error {\n\treturn checkEnumValueNoDeleteWithRules(\n\t\tresponseWriter,\n\t\tpreviousEnum,\n\t\tenum,\n\t\tfalse,\n\t\ttrue,\n\t)\n}\n\n// HandleBreakingEnumValueNoDeleteUnlessNumberReserved is a check function.\nvar HandleBreakingEnumValueNoDeleteUnlessNumberReserved = bufcheckserverutil.NewBreakingEnumPairRuleHandler(handleBreakingEnumValueNoDeleteUnlessNumberReserved)\n\nfunc handleBreakingEnumValueNoDeleteUnlessNumberReserved(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n\tpreviousEnum bufprotosource.Enum,\n) error {\n\treturn checkEnumValueNoDeleteWithRules(\n\t\tresponseWriter,\n\t\tpreviousEnum,\n\t\tenum,\n\t\ttrue,\n\t\tfalse,\n\t)\n}\n\nfunc checkEnumValueNoDeleteWithRules(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\tpreviousEnum bufprotosource.Enum,\n\tenum bufprotosource.Enum,\n\tallowIfNumberReserved bool,\n\tallowIfNameReserved bool,\n) error {\n\tpreviousNumberToNameToEnumValue, err := bufprotosource.NumberToNameToEnumValue(previousEnum)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnumberToNameToEnumValue, err := bufprotosource.NumberToNameToEnumValue(enum)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousNumber, previousNameToEnumValue := range previousNumberToNameToEnumValue {\n\t\tif _, ok := numberToNameToEnumValue[previousNumber]; !ok {\n\t\t\tif !isDeletedEnumValueAllowedWithRules(\n\t\t\t\tpreviousNumber,\n\t\t\t\tpreviousNameToEnumValue,\n\t\t\t\tenum,\n\t\t\t\tallowIfNumberReserved,\n\t\t\t\tallowIfNameReserved,\n\t\t\t) {\n\t\t\t\tsuffix := \"\"\n\t\t\t\tif allowIfNumberReserved && allowIfNameReserved {\n\t\t\t\t\treturn errors.New(\"both allowIfNumberReserved and allowIfNameReserved set\")\n\t\t\t\t}\n\t\t\t\tif allowIfNumberReserved {\n\t\t\t\t\tsuffix = fmt.Sprintf(` without reserving the number \"%d\"`, previousNumber)\n\t\t\t\t}\n\t\t\t\tif allowIfNameReserved {\n\t\t\t\t\tnameSuffix := \"\"\n\t\t\t\t\tif len(previousNameToEnumValue) > 1 {\n\t\t\t\t\t\tnameSuffix = \"s\"\n\t\t\t\t\t}\n\t\t\t\t\tsuffix = fmt.Sprintf(` without reserving the name%s %s`, nameSuffix, xstrings.JoinSliceQuoted(getSortedEnumValueNames(previousNameToEnumValue), \", \"))\n\t\t\t\t}\n\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\tenum.Location(),\n\t\t\t\t\tpreviousEnum.Location(),\n\t\t\t\t\tpreviousEnum.File().Path(),\n\t\t\t\t\t`Previously present enum value \"%d\" on enum %q was deleted%s.`,\n\t\t\t\t\tpreviousNumber,\n\t\t\t\t\tenum.Name(),\n\t\t\t\t\tsuffix,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc isDeletedEnumValueAllowedWithRules(\n\tpreviousNumber int,\n\tpreviousNameToEnumValue map[string]bufprotosource.EnumValue,\n\tenum bufprotosource.Enum,\n\tallowIfNumberReserved bool,\n\tallowIfNameReserved bool,\n) bool {\n\tif allowIfNumberReserved {\n\t\treturn bufprotosource.NumberInReservedRanges(previousNumber, enum.ReservedTagRanges()...)\n\t}\n\tif allowIfNameReserved {\n\t\t// if true for all names, then ok\n\t\tfor previousName := range previousNameToEnumValue {\n\t\t\tif !bufprotosource.NameInReservedNames(previousName, enum.ReservedNames()...) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\n// HandleBreakingExtensionMessageNoDelete is a check function.\nvar HandleBreakingExtensionMessageNoDelete = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingExtensionMessageNoDelete)\n\nfunc handleBreakingExtensionMessageNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\treturn checkTagRanges(\n\t\tresponseWriter,\n\t\t\"extension\",\n\t\tmessage,\n\t\tpreviousMessage,\n\t\tpreviousMessage.ExtensionRanges(),\n\t\tmessage.ExtensionRanges(),\n\t)\n}\n\n// HandleBreakingFieldNoDelete is a check function.\nvar HandleBreakingFieldNoDelete = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingFieldNoDelete)\n\nfunc handleBreakingFieldNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\treturn checkFieldNoDeleteWithRules(\n\t\tresponseWriter,\n\t\tpreviousMessage,\n\t\tmessage,\n\t\tfalse,\n\t\tfalse,\n\t)\n}\n\n// HandleBreakingFieldNoDeleteUnlessNameReserved is a check function.\nvar HandleBreakingFieldNoDeleteUnlessNameReserved = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingFieldNoDeleteUnlessNameReserved)\n\nfunc handleBreakingFieldNoDeleteUnlessNameReserved(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\treturn checkFieldNoDeleteWithRules(\n\t\tresponseWriter,\n\t\tpreviousMessage,\n\t\tmessage,\n\t\tfalse,\n\t\ttrue,\n\t)\n}\n\n// HandleBreakingFieldNoDeleteUnlessNumberReserved is a check function.\nvar HandleBreakingFieldNoDeleteUnlessNumberReserved = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingFieldNoDeleteUnlessNumberReserved)\n\nfunc handleBreakingFieldNoDeleteUnlessNumberReserved(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\treturn checkFieldNoDeleteWithRules(\n\t\tresponseWriter,\n\t\tpreviousMessage,\n\t\tmessage,\n\t\ttrue,\n\t\tfalse,\n\t)\n}\n\nfunc checkFieldNoDeleteWithRules(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\tpreviousMessage bufprotosource.Message,\n\tmessage bufprotosource.Message,\n\tallowIfNumberReserved bool,\n\tallowIfNameReserved bool,\n) error {\n\tpreviousNumberToField, err := bufprotosource.NumberToMessageField(previousMessage)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnumberToField, err := bufprotosource.NumberToMessageField(message)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousNumber, previousField := range previousNumberToField {\n\t\tif _, ok := numberToField[previousNumber]; !ok {\n\t\t\tif !isDeletedFieldAllowedWithRules(previousField, message, allowIfNumberReserved, allowIfNameReserved) {\n\t\t\t\tsuffix := \"\"\n\t\t\t\tif allowIfNumberReserved && allowIfNameReserved {\n\t\t\t\t\treturn errors.New(\"both allowIfNumberReserved and allowIfNameReserved set\")\n\t\t\t\t}\n\t\t\t\tif allowIfNumberReserved {\n\t\t\t\t\tsuffix = fmt.Sprintf(` without reserving the number \"%d\"`, previousField.Number())\n\t\t\t\t}\n\t\t\t\tif allowIfNameReserved {\n\t\t\t\t\tsuffix = fmt.Sprintf(` without reserving the name %q`, previousField.Name())\n\t\t\t\t}\n\t\t\t\tdescription := fieldDescription(previousField)\n\t\t\t\t// Description will start with capital letter; lower-case it\n\t\t\t\t// to better fit in this message.\n\t\t\t\tdescription = strings.ToLower(description[:1]) + description[1:]\n\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\tmessage.Location(),\n\t\t\t\t\tpreviousMessage.Location(),\n\t\t\t\t\tmessage.File().Path(),\n\t\t\t\t\t`Previously present %s was deleted%s.`,\n\t\t\t\t\tdescription,\n\t\t\t\t\tsuffix,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc isDeletedFieldAllowedWithRules(\n\tpreviousField bufprotosource.Field,\n\tmessage bufprotosource.Message,\n\tallowIfNumberReserved bool,\n\tallowIfNameReserved bool,\n) bool {\n\treturn (allowIfNumberReserved && bufprotosource.NumberInReservedRanges(previousField.Number(), message.ReservedTagRanges()...)) ||\n\t\t(allowIfNameReserved && bufprotosource.NameInReservedNames(previousField.Name(), message.ReservedNames()...))\n}\n\n// HandleBreakingFieldSameCardinality is a check function.\nvar HandleBreakingFieldSameCardinality = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameCardinality)\n\nfunc handleBreakingFieldSameCardinality(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousDescriptor.ContainingMessage().IsMapEntry() && descriptor.ContainingMessage().IsMapEntry() {\n\t\t// Map entries are generated so nothing to do here. They\n\t\t// usually would be safe to check anyway, but it's possible\n\t\t// that a map entry field \"appears\" to inherit field presence\n\t\t// from a file default or file syntax, but they don't actually\n\t\t// behave differently whether they report implicit vs explicit\n\t\t// presence. So just skip the check.\n\t\treturn nil\n\t}\n\n\tpreviousCardinality := getCardinality(previousDescriptor)\n\tcurrentCardinality := getCardinality(descriptor)\n\tif previousCardinality != currentCardinality {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfield.Location(),\n\t\t\tpreviousField.Location(),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed cardinality from %q to %q.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousCardinality,\n\t\t\tcurrentCardinality,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameCppStringType is a check function.\nvar HandleBreakingFieldSameCppStringType = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameCppStringType)\n\nfunc handleBreakingFieldSameCppStringType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousDescriptor.ContainingMessage().IsMapEntry() && descriptor.ContainingMessage().IsMapEntry() {\n\t\t// Map entries, even with string or bytes keys or values,\n\t\t// don't allow configuring the string type.\n\t\treturn nil\n\t}\n\tif (previousDescriptor.Kind() != protoreflect.StringKind && previousDescriptor.Kind() != protoreflect.BytesKind) ||\n\t\t(descriptor.Kind() != protoreflect.StringKind && descriptor.Kind() != protoreflect.BytesKind) {\n\t\t// this check only applies to string/bytes fields\n\t\treturn nil\n\t}\n\tpreviousStringType, previousIsStringPiece, err := fieldCppStringType(previousField, previousDescriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tstringType, isStringPiece, err := fieldCppStringType(field, descriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif (previousStringType != stringType || previousIsStringPiece != isStringPiece) &&\n\t\t// it is NOT breaking to move from string_piece -> string\n\t\t!(previousIsStringPiece && stringType == protobuf.CppFeatures_STRING) {\n\t\tvar previousType, currentType fmt.Stringer\n\t\tif previousIsStringPiece {\n\t\t\tpreviousType = descriptorpb.FieldOptions_STRING_PIECE\n\t\t} else {\n\t\t\tpreviousType = previousStringType\n\t\t}\n\t\tif isStringPiece {\n\t\t\tcurrentType = descriptorpb.FieldOptions_STRING_PIECE\n\t\t} else {\n\t\t\tcurrentType = stringType\n\t\t}\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(field.CTypeLocation(), fieldCppStringTypeLocation(field), field.Location()),\n\t\t\twithBackupLocation(previousField.CTypeLocation(), fieldCppStringTypeLocation(previousField), previousField.Location()),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed C++ string type from %q to %q.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousType,\n\t\t\tcurrentType,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameJavaUTF8Validation is a check function.\nvar HandleBreakingFieldSameJavaUTF8Validation = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameJavaUTF8Validation)\n\nfunc handleBreakingFieldSameJavaUTF8Validation(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousDescriptor.Kind() != protoreflect.StringKind || descriptor.Kind() != protoreflect.StringKind {\n\t\t// this check only applies to string fields\n\t\treturn nil\n\t}\n\tpreviousValidation, err := fieldJavaUTF8Validation(previousDescriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvalidation, err := fieldJavaUTF8Validation(descriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousValidation != validation {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(field.File().JavaStringCheckUtf8Location(), fieldJavaUTF8ValidationLocation(field), field.Location()),\n\t\t\twithBackupLocation(previousField.File().JavaStringCheckUtf8Location(), fieldJavaUTF8ValidationLocation(previousField), previousField.Location()),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed Java string UTF8 validation from %q to %q.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousValidation,\n\t\t\tvalidation,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameJSType is a check function.\nvar HandleBreakingFieldSameJSType = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameJSType)\n\nfunc handleBreakingFieldSameJSType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tif !is64bitInteger(previousField.Type()) || !is64bitInteger(field.Type()) {\n\t\t// this check only applies to 64-bit integer fields\n\t\treturn nil\n\t}\n\tif previousField.JSType() != field.JSType() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(field.JSTypeLocation(), field.Location()),\n\t\t\twithBackupLocation(previousField.JSTypeLocation(), previousField.Location()),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed option \"jstype\" from %q to %q.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousField.JSType().String(), field.JSType().String())\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameType is a check function.\nvar HandleBreakingFieldSameType = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameType)\n\nfunc handleBreakingFieldSameType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We use descriptor.Kind(), instead of field.Type(), because it also includes\n\t// a check of resolved features in Editions files so it can distinguish between\n\t// normal (length-prefixed) and delimited (aka \"group\" encoded) messages, which\n\t// are not compatible.\n\tif previousDescriptor.Kind() != descriptor.Kind() {\n\t\taddFieldChangedType(\n\t\t\tresponseWriter,\n\t\t\tpreviousField,\n\t\t\tpreviousDescriptor,\n\t\t\tfield,\n\t\t\tdescriptor,\n\t\t)\n\t\treturn nil\n\t}\n\n\tswitch field.Type() {\n\tcase descriptorpb.FieldDescriptorProto_TYPE_ENUM,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_GROUP,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_MESSAGE:\n\t\tif previousField.TypeName() != field.TypeName() {\n\t\t\taddEnumGroupMessageFieldChangedTypeName(responseWriter, previousField, field)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldWireCompatibleType is a check function.\nvar HandleBreakingFieldWireCompatibleType = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldWireCompatibleType)\n\nfunc handleBreakingFieldWireCompatibleType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We use descriptor.Kind(), instead of field.Type(), because it also includes\n\t// a check of resolved features in Editions files so it can distinguish between\n\t// normal (length-prefixed) and delimited (aka \"group\" encoded) messages, which\n\t// are not compatible.\n\tpreviousWireCompatibilityGroup, ok := fieldKindToWireCompatibilityGroup[previousDescriptor.Kind()]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown FieldDescriptorProtoType: %v\", previousDescriptor.Kind())\n\t}\n\twireCompatibilityGroup, ok := fieldKindToWireCompatibilityGroup[descriptor.Kind()]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown FieldDescriptorProtoType: %v\", descriptor.Kind())\n\t}\n\tif previousWireCompatibilityGroup != wireCompatibilityGroup {\n\t\textraMessages := []string{\n\t\t\t\"See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules.\",\n\t\t}\n\t\tswitch {\n\t\tcase previousDescriptor.Kind() == protoreflect.StringKind && descriptor.Kind() == protoreflect.BytesKind:\n\t\t\t// It is OK to evolve from string to bytes\n\t\t\treturn nil\n\t\tcase previousDescriptor.Kind() == protoreflect.BytesKind && descriptor.Kind() == protoreflect.StringKind:\n\t\t\textraMessages = append(\n\t\t\t\textraMessages,\n\t\t\t\t\"Note that while string and bytes are compatible if the data is valid UTF-8, there is no way to enforce that a bytes field is UTF-8, so these fields may be incompatible.\",\n\t\t\t)\n\t\t}\n\t\taddFieldChangedType(responseWriter, previousField, previousDescriptor, field, descriptor, extraMessages...)\n\t\treturn nil\n\t}\n\tswitch field.Type() {\n\tcase descriptorpb.FieldDescriptorProto_TYPE_ENUM:\n\t\tif previousField.TypeName() != field.TypeName() {\n\t\t\treturn checkEnumWireCompatibleForField(responseWriter, request, previousField, field)\n\t\t}\n\tcase descriptorpb.FieldDescriptorProto_TYPE_GROUP,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_MESSAGE:\n\t\tif previousField.TypeName() != field.TypeName() {\n\t\t\taddEnumGroupMessageFieldChangedTypeName(responseWriter, previousField, field)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldWireJSONCompatibleType is a check function.\nvar HandleBreakingFieldWireJSONCompatibleType = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldWireJSONCompatibleType)\n\nfunc handleBreakingFieldWireJSONCompatibleType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We use descriptor.Kind(), instead of field.Type(), because it also includes\n\t// a check of resolved features in Editions files so it can distinguish between\n\t// normal (length-prefixed) and delimited (aka \"group\" encoded) messages, which\n\t// are not compatible.\n\tpreviousWireJSONCompatibilityGroup, ok := fieldKindToWireJSONCompatibilityGroup[previousDescriptor.Kind()]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown FieldDescriptorProtoType: %v\", previousDescriptor.Kind())\n\t}\n\twireJSONCompatibilityGroup, ok := fieldKindToWireJSONCompatibilityGroup[descriptor.Kind()]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown FieldDescriptorProtoType: %v\", descriptor.Kind())\n\t}\n\tif previousWireJSONCompatibilityGroup != wireJSONCompatibilityGroup {\n\t\taddFieldChangedType(\n\t\t\tresponseWriter,\n\t\t\tpreviousField,\n\t\t\tpreviousDescriptor,\n\t\t\tfield,\n\t\t\tdescriptor,\n\t\t\t\"See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules and https://developers.google.com/protocol-buffers/docs/proto3#json for JSON compatibility rules.\",\n\t\t)\n\t\treturn nil\n\t}\n\tswitch descriptor.Kind() {\n\tcase protoreflect.EnumKind:\n\t\tif previousField.TypeName() != field.TypeName() {\n\t\t\treturn checkEnumWireCompatibleForField(responseWriter, request, previousField, field)\n\t\t}\n\tcase protoreflect.GroupKind, protoreflect.MessageKind:\n\t\tif previousField.TypeName() != field.TypeName() {\n\t\t\taddEnumGroupMessageFieldChangedTypeName(responseWriter, previousField, field)\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc checkEnumWireCompatibleForField(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tpreviousField bufprotosource.Field,\n\tfield bufprotosource.Field,\n) error {\n\tpreviousEnum, err := getEnumByFullName(\n\t\trequest.AgainstProtosourceFiles(),\n\t\tstrings.TrimPrefix(previousField.TypeName(), \".\"),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tenum, err := getEnumByFullName(\n\t\trequest.ProtosourceFiles(),\n\t\tstrings.TrimPrefix(field.TypeName(), \".\"),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousEnum.Name() != enum.Name() {\n\t\t// If the short names are not equal, we say that this is a different enum.\n\t\taddEnumGroupMessageFieldChangedTypeName(responseWriter, previousField, field)\n\t\treturn nil\n\t}\n\tisSubset, err := bufprotosource.EnumIsSubset(enum, previousEnum)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !isSubset {\n\t\t// If the previous enum is not a subset of the new enum, we say that\n\t\t// this is a different enum.\n\t\t// We allow subsets so that enum values can be added within the\n\t\t// same change.\n\t\taddEnumGroupMessageFieldChangedTypeName(responseWriter, previousField, field)\n\t\treturn nil\n\t}\n\treturn nil\n}\n\nfunc addEnumGroupMessageFieldChangedTypeName(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\tpreviousField bufprotosource.Field,\n\tfield bufprotosource.Field,\n) {\n\tresponseWriter.AddProtosourceAnnotationf(\n\t\tfield.TypeNameLocation(),\n\t\tpreviousField.TypeNameLocation(),\n\t\tfield.File().Path(),\n\t\t`%s changed type from %q to %q.`,\n\t\tfieldDescription(field),\n\t\tstrings.TrimPrefix(previousField.TypeName(), \".\"),\n\t\tstrings.TrimPrefix(field.TypeName(), \".\"),\n\t)\n}\n\nfunc addFieldChangedType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\tpreviousField bufprotosource.Field,\n\tpreviousDescriptor protoreflect.FieldDescriptor,\n\tfield bufprotosource.Field,\n\tdescriptor protoreflect.FieldDescriptor,\n\textraMessages ...string,\n) {\n\tcombinedExtraMessage := \"\"\n\tif len(extraMessages) > 0 {\n\t\t// protect against mistakenly added empty extra messages\n\t\tif joined := strings.TrimSpace(strings.Join(extraMessages, \" \")); joined != \"\" {\n\t\t\tcombinedExtraMessage = \" \" + joined\n\t\t}\n\t}\n\tvar fieldLocation bufprotosource.Location\n\tswitch descriptor.Kind() {\n\tcase protoreflect.MessageKind, protoreflect.EnumKind, protoreflect.GroupKind:\n\t\tfieldLocation = field.TypeNameLocation()\n\tdefault:\n\t\tfieldLocation = field.TypeLocation()\n\t}\n\tvar previousFieldLocation bufprotosource.Location\n\tswitch previousDescriptor.Kind() {\n\tcase protoreflect.MessageKind, protoreflect.EnumKind, protoreflect.GroupKind:\n\t\tpreviousFieldLocation = previousField.TypeNameLocation()\n\tdefault:\n\t\tpreviousFieldLocation = previousField.TypeLocation()\n\t}\n\tresponseWriter.AddProtosourceAnnotationf(\n\t\tfieldLocation,\n\t\tpreviousFieldLocation,\n\t\tfield.File().Path(),\n\t\t`%s changed type from %q to %q.%s`,\n\t\tfieldDescription(field),\n\t\tfieldDescriptorTypePrettyString(previousDescriptor),\n\t\tfieldDescriptorTypePrettyString(descriptor),\n\t\tcombinedExtraMessage,\n\t)\n}\n\n// HandleBreakingFieldSameUTF8Validation is a check function.\nvar HandleBreakingFieldSameUTF8Validation = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameUTF8Validation)\n\nfunc handleBreakingFieldSameUTF8Validation(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousDescriptor.Kind() != protoreflect.StringKind || descriptor.Kind() != protoreflect.StringKind {\n\t\treturn nil\n\t}\n\tfeatureField, err := findFeatureField(featureNameUTF8Validation, protoreflect.EnumKind)\n\tif err != nil {\n\t\treturn err\n\t}\n\tval, err := protoutil.ResolveFeature(previousDescriptor, featureField)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to resolve value of %s feature: %w\", featureField.Name(), err)\n\t}\n\tpreviousUTF8Validation := descriptorpb.FeatureSet_Utf8Validation(val.Enum())\n\tval, err = protoutil.ResolveFeature(descriptor, featureField)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to resolve value of %s feature: %w\", featureField.Name(), err)\n\t}\n\tutf8Validation := descriptorpb.FeatureSet_Utf8Validation(val.Enum())\n\tif previousUTF8Validation != utf8Validation {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(field.Features().UTF8ValidationLocation(), field.Location()),\n\t\t\twithBackupLocation(previousField.Features().UTF8ValidationLocation(), previousField.Location()),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed UTF8 validation from %v to %v.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousUTF8Validation,\n\t\t\tutf8Validation,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFileSameCcEnableArenas is a check function.\nvar HandleBreakingFileSameCcEnableArenas = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameCcEnableArenas)\n\nfunc handleBreakingFileSameCcEnableArenas(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tstrconv.FormatBool(previousFile.CcEnableArenas()),\n\t\tstrconv.FormatBool(file.CcEnableArenas()),\n\t\tfile,\n\t\tfile.CcEnableArenasLocation(),\n\t\tpreviousFile.CcEnableArenasLocation(),\n\t\t`option \"cc_enable_arenas\"`,\n\t)\n}\n\n// HandleBreakingFileSameCcGenericServices is a check function.\nvar HandleBreakingFileSameCcGenericServices = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameCcGenericServices)\n\nfunc handleBreakingFileSameCcGenericServices(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tstrconv.FormatBool(previousFile.CcGenericServices()),\n\t\tstrconv.FormatBool(file.CcGenericServices()),\n\t\tfile,\n\t\tfile.CcGenericServicesLocation(),\n\t\tpreviousFile.CcGenericServicesLocation(),\n\t\t`option \"cc_generic_services\"`,\n\t)\n}\n\n// HandleBreakingFileSameCsharpNamespace is a check function.\nvar HandleBreakingFileSameCsharpNamespace = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameCsharpNamespace)\n\nfunc handleBreakingFileSameCsharpNamespace(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.CsharpNamespace(),\n\t\tfile.CsharpNamespace(),\n\t\tfile,\n\t\tfile.CsharpNamespaceLocation(),\n\t\tpreviousFile.CsharpNamespaceLocation(),\n\t\t`option \"csharp_namespace\"`,\n\t)\n}\n\n// HandleBreakingFileSameGoPackage is a check function.\nvar HandleBreakingFileSameGoPackage = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameGoPackage)\n\nfunc handleBreakingFileSameGoPackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.GoPackage(),\n\t\tfile.GoPackage(),\n\t\tfile,\n\t\tfile.GoPackageLocation(),\n\t\tpreviousFile.GoPackageLocation(),\n\t\t`option \"go_package\"`,\n\t)\n}\n\n// HandleBreakingFileSameJavaGenericServices is a check function.\nvar HandleBreakingFileSameJavaGenericServices = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameJavaGenericServices)\n\nfunc handleBreakingFileSameJavaGenericServices(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tstrconv.FormatBool(previousFile.JavaGenericServices()),\n\t\tstrconv.FormatBool(file.JavaGenericServices()),\n\t\tfile,\n\t\tfile.JavaGenericServicesLocation(),\n\t\tpreviousFile.JavaGenericServicesLocation(),\n\t\t`option \"java_generic_services\"`,\n\t)\n}\n\n// HandleBreakingFileSameJavaMultipleFiles is a check function.\nvar HandleBreakingFileSameJavaMultipleFiles = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameJavaMultipleFiles)\n\nfunc handleBreakingFileSameJavaMultipleFiles(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tstrconv.FormatBool(previousFile.JavaMultipleFiles()),\n\t\tstrconv.FormatBool(file.JavaMultipleFiles()),\n\t\tfile,\n\t\tfile.JavaMultipleFilesLocation(),\n\t\tpreviousFile.JavaMultipleFilesLocation(),\n\t\t`option \"java_multiple_files\"`,\n\t)\n}\n\n// HandleBreakingFileSameJavaOuterClassname is a check function.\nvar HandleBreakingFileSameJavaOuterClassname = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameJavaOuterClassname)\n\nfunc handleBreakingFileSameJavaOuterClassname(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.JavaOuterClassname(),\n\t\tfile.JavaOuterClassname(),\n\t\tfile,\n\t\tfile.JavaOuterClassnameLocation(),\n\t\tpreviousFile.JavaOuterClassnameLocation(),\n\t\t`option \"java_outer_classname\"`,\n\t)\n}\n\n// HandleBreakingFileSameJavaPackage is a check function.\nvar HandleBreakingFileSameJavaPackage = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameJavaPackage)\n\nfunc handleBreakingFileSameJavaPackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.JavaPackage(),\n\t\tfile.JavaPackage(),\n\t\tfile,\n\t\tfile.JavaPackageLocation(),\n\t\tpreviousFile.JavaPackageLocation(),\n\t\t`option \"java_package\"`,\n\t)\n}\n\n// HandleBreakingFileSameObjcClassPrefix is a check function.\nvar HandleBreakingFileSameObjcClassPrefix = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameObjcClassPrefix)\n\nfunc handleBreakingFileSameObjcClassPrefix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.ObjcClassPrefix(),\n\t\tfile.ObjcClassPrefix(),\n\t\tfile,\n\t\tfile.ObjcClassPrefixLocation(),\n\t\tpreviousFile.ObjcClassPrefixLocation(),\n\t\t`option \"objc_class_prefix\"`,\n\t)\n}\n\n// HandleBreakingFileSameOptimizeFor is a check function.\nvar HandleBreakingFileSameOptimizeFor = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameOptimizeFor)\n\nfunc handleBreakingFileSameOptimizeFor(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.OptimizeFor().String(),\n\t\tfile.OptimizeFor().String(),\n\t\tfile,\n\t\tfile.OptimizeForLocation(),\n\t\tpreviousFile.OptimizeForLocation(),\n\t\t`option \"optimize_for\"`,\n\t)\n}\n\n// HandleBreakingFileSamePhpClassPrefix is a check function.\nvar HandleBreakingFileSamePhpClassPrefix = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSamePhpClassPrefix)\n\nfunc handleBreakingFileSamePhpClassPrefix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.PhpClassPrefix(),\n\t\tfile.PhpClassPrefix(),\n\t\tfile,\n\t\tfile.PhpClassPrefixLocation(),\n\t\tpreviousFile.PhpClassPrefixLocation(),\n\t\t`option \"php_class_prefix\"`,\n\t)\n}\n\n// HandleBreakingFileSamePhpMetadataNamespace is a check function.\nvar HandleBreakingFileSamePhpMetadataNamespace = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSamePhpMetadataNamespace)\n\nfunc handleBreakingFileSamePhpMetadataNamespace(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.PhpMetadataNamespace(),\n\t\tfile.PhpMetadataNamespace(),\n\t\tfile,\n\t\tfile.PhpMetadataNamespaceLocation(),\n\t\tpreviousFile.PhpMetadataNamespaceLocation(),\n\t\t`option \"php_metadata_namespace\"`,\n\t)\n}\n\n// HandleBreakingFileSamePhpNamespace is a check function.\nvar HandleBreakingFileSamePhpNamespace = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSamePhpNamespace)\n\nfunc handleBreakingFileSamePhpNamespace(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.PhpNamespace(),\n\t\tfile.PhpNamespace(),\n\t\tfile,\n\t\tfile.PhpNamespaceLocation(),\n\t\tpreviousFile.PhpNamespaceLocation(),\n\t\t`option \"php_namespace\"`,\n\t)\n}\n\n// HandleBreakingFileSamePyGenericServices is a check function.\nvar HandleBreakingFileSamePyGenericServices = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSamePyGenericServices)\n\nfunc handleBreakingFileSamePyGenericServices(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tstrconv.FormatBool(previousFile.PyGenericServices()),\n\t\tstrconv.FormatBool(file.PyGenericServices()),\n\t\tfile,\n\t\tfile.PyGenericServicesLocation(),\n\t\tpreviousFile.PyGenericServicesLocation(),\n\t\t`option \"py_generic_services\"`,\n\t)\n}\n\n// HandleBreakingFileSameRubyPackage is a check function.\nvar HandleBreakingFileSameRubyPackage = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameRubyPackage)\n\nfunc handleBreakingFileSameRubyPackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.RubyPackage(),\n\t\tfile.RubyPackage(),\n\t\tfile,\n\t\tfile.RubyPackageLocation(),\n\t\tpreviousFile.RubyPackageLocation(),\n\t\t`option \"ruby_package\"`,\n\t)\n}\n\n// HandleBreakingFileSameSwiftPrefix is a check function.\nvar HandleBreakingFileSameSwiftPrefix = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameSwiftPrefix)\n\nfunc handleBreakingFileSameSwiftPrefix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.SwiftPrefix(),\n\t\tfile.SwiftPrefix(),\n\t\tfile,\n\t\tfile.SwiftPrefixLocation(),\n\t\tpreviousFile.SwiftPrefixLocation(),\n\t\t`option \"swift_prefix\"`,\n\t)\n}\n\n// HandleBreakingFileSameSyntax is a check function.\nvar HandleBreakingFileSameSyntax = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSameSyntax)\n\nfunc handleBreakingFileSameSyntax(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\tpreviousSyntax := previousFile.Syntax()\n\tif previousSyntax == bufprotosource.SyntaxUnspecified {\n\t\tpreviousSyntax = bufprotosource.SyntaxProto2\n\t}\n\tsyntax := file.Syntax()\n\tif syntax == bufprotosource.SyntaxUnspecified {\n\t\tsyntax = bufprotosource.SyntaxProto2\n\t}\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousSyntax.String(),\n\t\tsyntax.String(),\n\t\tfile,\n\t\tfile.SyntaxLocation(),\n\t\tpreviousFile.SyntaxLocation(),\n\t\t`syntax`,\n\t)\n}\n\n// HandleBreakingFileSamePackage is a check function.\nvar HandleBreakingFileSamePackage = bufcheckserverutil.NewBreakingFilePairRuleHandler(handleBreakingFileSamePackage)\n\nfunc handleBreakingFileSamePackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n\tpreviousFile bufprotosource.File,\n) error {\n\treturn checkFileSameValue(\n\t\tresponseWriter,\n\t\tpreviousFile.Package(),\n\t\tfile.Package(),\n\t\tfile,\n\t\tfile.PackageLocation(),\n\t\tpreviousFile.PackageLocation(),\n\t\t`package`,\n\t)\n}\n\nfunc checkFileSameValue(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\tpreviousValue any,\n\tvalue any,\n\tfile bufprotosource.File,\n\tlocation bufprotosource.Location,\n\tpreviousLocation bufprotosource.Location,\n\tname string,\n) error {\n\tif previousValue != value {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tlocation,\n\t\t\tpreviousLocation,\n\t\t\tfile.Path(),\n\t\t\t`File %s changed from %q to %q.`,\n\t\t\tname,\n\t\t\tpreviousValue,\n\t\t\tvalue,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingMessageNoRemoveStandardDescriptorAccessor is a check function.\nvar HandleBreakingMessageNoRemoveStandardDescriptorAccessor = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingMessageNoRemoveStandardDescriptorAccessor)\n\nfunc handleBreakingMessageNoRemoveStandardDescriptorAccessor(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\tprevious := strconv.FormatBool(previousMessage.NoStandardDescriptorAccessor())\n\tcurrent := strconv.FormatBool(message.NoStandardDescriptorAccessor())\n\tif previous == \"false\" && current == \"true\" {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmessage.NoStandardDescriptorAccessorLocation(),\n\t\t\tpreviousMessage.NoStandardDescriptorAccessorLocation(),\n\t\t\tmessage.File().Path(),\n\t\t\t`Message option \"no_standard_descriptor_accessor\" changed from %q to %q.`,\n\t\t\tprevious,\n\t\t\tcurrent,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingOneofNoDelete is a check function.\nvar HandleBreakingOneofNoDelete = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingOneofNoDelete)\n\nfunc handleBreakingOneofNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\tpreviousNameToOneof, err := bufprotosource.NameToMessageOneof(previousMessage)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnameToOneof, err := bufprotosource.NameToMessageOneof(message)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousName, previousOneof := range previousNameToOneof {\n\t\tif _, ok := nameToOneof[previousName]; !ok {\n\t\t\tpreviousOneofDescriptor, err := previousOneof.AsDescriptor()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif previousOneofDescriptor.IsSynthetic() {\n\t\t\t\t// Not considering synthetic oneofs since those are really\n\t\t\t\t// just strange byproducts of how \"explicit presence\" is\n\t\t\t\t// modeled in proto3 syntax. We will separately detect this\n\t\t\t\t// kind of change via field presence check.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tmessage.Location(),\n\t\t\t\tpreviousMessage.Location(),\n\t\t\t\tmessage.File().Path(),\n\t\t\t\t`Previously present oneof %q on message %q was deleted.`,\n\t\t\t\tpreviousName, message.Name(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingRPCNoDelete is a check function.\nvar HandleBreakingRPCNoDelete = bufcheckserverutil.NewBreakingServicePairRuleHandler(handleBreakingRPCNoDelete)\n\nfunc handleBreakingRPCNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tservice bufprotosource.Service,\n\tpreviousService bufprotosource.Service,\n) error {\n\tpreviousNameToMethod, err := bufprotosource.NameToMethod(previousService)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnameToMethod, err := bufprotosource.NameToMethod(service)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousName := range previousNameToMethod {\n\t\tif _, ok := nameToMethod[previousName]; !ok {\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tservice.Location(),\n\t\t\t\tpreviousService.Location(),\n\t\t\t\tservice.File().Path(),\n\t\t\t\t`Previously present RPC %q on service %q was deleted.`,\n\t\t\t\tpreviousName,\n\t\t\t\tservice.Name(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingEnumSameJSONFormat is a check function.\nvar HandleBreakingEnumSameJSONFormat = bufcheckserverutil.NewBreakingEnumPairRuleHandler(handleBreakingEnumSameJSONFormat)\n\nfunc handleBreakingEnumSameJSONFormat(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n\tpreviousEnum bufprotosource.Enum,\n) error {\n\tpreviousDescriptor, err := previousEnum.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := enum.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfeatureField, err := findFeatureField(featureNameJSONFormat, protoreflect.EnumKind)\n\tif err != nil {\n\t\treturn err\n\t}\n\tval, err := protoutil.ResolveFeature(previousDescriptor, featureField)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to resolve value of %s feature: %w\", featureField.Name(), err)\n\t}\n\tpreviousJSONFormat := descriptorpb.FeatureSet_JsonFormat(val.Enum())\n\tval, err = protoutil.ResolveFeature(descriptor, featureField)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to resolve value of %s feature: %w\", featureField.Name(), err)\n\t}\n\tjsonFormat := descriptorpb.FeatureSet_JsonFormat(val.Enum())\n\tif previousJSONFormat == descriptorpb.FeatureSet_ALLOW && jsonFormat != descriptorpb.FeatureSet_ALLOW {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(enum.Features().JSONFormatLocation(), enum.Location()),\n\t\t\twithBackupLocation(previousEnum.Features().JSONFormatLocation(), previousEnum.Location()),\n\t\t\tenum.File().Path(),\n\t\t\t`Enum %q JSON format support changed from %v to %v.`,\n\t\t\tenum.Name(),\n\t\t\tpreviousJSONFormat,\n\t\t\tjsonFormat,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingEnumValueSameName is a check function.\nvar HandleBreakingEnumValueSameName = bufcheckserverutil.NewBreakingEnumValuePairRuleHandler(handleBreakingEnumValueSameName)\n\nfunc handleBreakingEnumValueSameName(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tnameToEnumValue map[string]bufprotosource.EnumValue,\n\tpreviousNameToEnumValue map[string]bufprotosource.EnumValue,\n) error {\n\tpreviousNames := getSortedEnumValueNames(previousNameToEnumValue)\n\tnames := getSortedEnumValueNames(nameToEnumValue)\n\t// all current names for this number need to be in the previous set\n\t// ie if you now have FOO=2, BAR=2, you need to have had FOO=2, BAR=2 previously\n\t// FOO=2, BAR=2, BAZ=2 now would pass\n\t// FOO=2, BAR=2, BAZ=2 previously would fail\n\tif !xslices.ElementsContained(names, previousNames) {\n\t\tpreviousNamesString := xstrings.JoinSliceQuoted(previousNames, \", \")\n\t\tnamesString := xstrings.JoinSliceQuoted(names, \", \")\n\t\tnameSuffix := \"\"\n\t\tif len(previousNames) > 1 && len(names) > 1 {\n\t\t\tnameSuffix = \"s\"\n\t\t}\n\t\tfor enumName, enumValue := range nameToEnumValue {\n\t\t\tvar previousEnumValueNumberLocation bufprotosource.Location\n\t\t\tif previousEnumValue, ok := previousNameToEnumValue[enumName]; ok {\n\t\t\t\tpreviousEnumValueNumberLocation = previousEnumValue.NumberLocation()\n\t\t\t}\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tenumValue.NumberLocation(),\n\t\t\t\tpreviousEnumValueNumberLocation,\n\t\t\t\tenumValue.File().Path(),\n\t\t\t\t`Enum value \"%d\" on enum %q changed name%s from %s to %s.`,\n\t\t\t\tenumValue.Number(),\n\t\t\t\tenumValue.Enum().Name(),\n\t\t\t\tnameSuffix,\n\t\t\t\tpreviousNamesString,\n\t\t\t\tnamesString,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameJSONName is a check function.\nvar HandleBreakingFieldSameJSONName = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameJSONName)\n\nfunc handleBreakingFieldSameJSONName(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tif previousField.Extendee() != \"\" {\n\t\t// JSON name can't be set explicitly for extensions\n\t\treturn nil\n\t}\n\tif previousField.JSONName() != field.JSONName() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(field.JSONNameLocation(), field.Location()),\n\t\t\twithBackupLocation(previousField.JSONNameLocation(), previousField.Location()),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed option \"json_name\" from %q to %q.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousField.JSONName(),\n\t\t\tfield.JSONName(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameName is a check function.\nvar HandleBreakingFieldSameName = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameName)\n\nfunc handleBreakingFieldSameName(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tvar previousName, name string\n\tif previousField.Extendee() != \"\" {\n\t\tpreviousName = previousField.FullName()\n\t\tname = field.FullName()\n\t} else {\n\t\tpreviousName = previousField.Name()\n\t\tname = field.Name()\n\t}\n\tif previousName != name {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfield.NameLocation(),\n\t\t\tpreviousField.NameLocation(),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed name from %q to %q.`,\n\t\t\tfieldDescriptionWithName(field, \"\"), // don't include name in description\n\t\t\tpreviousName,\n\t\t\tname,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingMessageSameJSONFormat is a check function.\nvar HandleBreakingMessageSameJSONFormat = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingMessageSameJSONFormat)\n\nfunc handleBreakingMessageSameJSONFormat(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\tpreviousDescriptor, err := previousMessage.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := message.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfeatureField, err := findFeatureField(featureNameJSONFormat, protoreflect.EnumKind)\n\tif err != nil {\n\t\treturn err\n\t}\n\tval, err := protoutil.ResolveFeature(previousDescriptor, featureField)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to resolve value of %s feature: %w\", featureField.Name(), err)\n\t}\n\tpreviousJSONFormat := descriptorpb.FeatureSet_JsonFormat(val.Enum())\n\tval, err = protoutil.ResolveFeature(descriptor, featureField)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to resolve value of %s feature: %w\", featureField.Name(), err)\n\t}\n\tjsonFormat := descriptorpb.FeatureSet_JsonFormat(val.Enum())\n\tif previousJSONFormat == descriptorpb.FeatureSet_ALLOW && jsonFormat != descriptorpb.FeatureSet_ALLOW {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(message.Features().JSONFormatLocation(), message.Location()),\n\t\t\twithBackupLocation(previousMessage.Features().JSONFormatLocation(), previousMessage.Location()),\n\t\t\tmessage.File().Path(),\n\t\t\t`Message %q JSON format support changed from %v to %v.`,\n\t\t\tmessage.Name(),\n\t\t\tpreviousJSONFormat,\n\t\t\tjsonFormat,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameDefault is a check function.\nvar HandleBreakingFieldSameDefault = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameDefault)\n\nfunc handleBreakingFieldSameDefault(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !canHaveDefault(previousDescriptor) || !canHaveDefault(descriptor) {\n\t\treturn nil\n\t}\n\tpreviousDefault := getDefault(previousDescriptor)\n\tcurrentDefault := getDefault(descriptor)\n\tif previousDefault.isZero() && currentDefault.isZero() {\n\t\t// no defaults to check\n\t\treturn nil\n\t}\n\tif !defaultsEqual(previousDefault, currentDefault) {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\twithBackupLocation(field.DefaultLocation(), field.Location()),\n\t\t\twithBackupLocation(previousField.DefaultLocation(), previousField.Location()),\n\t\t\tfield.File().Path(),\n\t\t\t`% changed default value from %v to %v.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousDefault.printable,\n\t\t\tcurrentDefault.printable,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldSameOneof is a check function.\nvar HandleBreakingFieldSameOneof = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldSameOneof)\n\nfunc handleBreakingFieldSameOneof(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tif previousField.Extendee() != \"\" {\n\t\t// extensions can't be defined inside oneofs\n\t\treturn nil\n\t}\n\tpreviousOneof := previousField.Oneof()\n\tif previousOneof != nil {\n\t\tpreviousOneofDescriptor, err := previousOneof.AsDescriptor()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif previousOneofDescriptor.IsSynthetic() {\n\t\t\t// Not considering synthetic oneofs since those are really\n\t\t\t// just strange byproducts of how \"explicit presence\" is\n\t\t\t// modeled in proto3 syntax. We will separately detect this\n\t\t\t// kind of change via field presence check.\n\t\t\tpreviousOneof = nil\n\t\t}\n\t}\n\toneof := field.Oneof()\n\tif oneof != nil {\n\t\toneofDescriptor, err := oneof.AsDescriptor()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif oneofDescriptor.IsSynthetic() {\n\t\t\t// Same remark as above.\n\t\t\toneof = nil\n\t\t}\n\t}\n\n\tpreviousInsideOneof := previousOneof != nil\n\tinsideOneof := oneof != nil\n\tif !previousInsideOneof && !insideOneof {\n\t\treturn nil\n\t}\n\tif previousInsideOneof && insideOneof {\n\t\tif previousOneof.Name() != oneof.Name() {\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tfield.Location(),\n\t\t\t\tpreviousField.Location(),\n\t\t\t\tfield.File().Path(),\n\t\t\t\t`%sq moved from oneof %q to oneof %q.`,\n\t\t\t\tfieldDescription(field),\n\t\t\t\tpreviousOneof.Name(),\n\t\t\t\toneof.Name(),\n\t\t\t)\n\t\t}\n\t\treturn nil\n\t}\n\n\tprevious := \"inside\"\n\tcurrent := \"outside\"\n\tif insideOneof {\n\t\tprevious = \"outside\"\n\t\tcurrent = \"inside\"\n\t}\n\tresponseWriter.AddProtosourceAnnotationf(\n\t\tfield.Location(),\n\t\tpreviousField.Location(),\n\t\tfield.File().Path(),\n\t\t`%s moved from %s to %s a oneof.`,\n\t\tfieldDescription(field),\n\t\tprevious,\n\t\tcurrent,\n\t)\n\treturn nil\n}\n\n// HandleBreakingMessageSameRequiredFields is a check function.\nvar HandleBreakingMessageSameRequiredFields = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingMessageSameRequiredFields)\n\nfunc handleBreakingMessageSameRequiredFields(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\tpreviousNumberToRequiredField, err := bufprotosource.NumberToMessageFieldForLabel(\n\t\tpreviousMessage,\n\t\tdescriptorpb.FieldDescriptorProto_LABEL_REQUIRED,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tnumberToRequiredField, err := bufprotosource.NumberToMessageFieldForLabel(\n\t\tmessage,\n\t\tdescriptorpb.FieldDescriptorProto_LABEL_REQUIRED,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousNumber := range previousNumberToRequiredField {\n\t\tif _, ok := numberToRequiredField[previousNumber]; !ok {\n\t\t\t// we attach the error to the message as the field no longer exists\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tmessage.Location(),\n\t\t\t\tpreviousMessage.Location(),\n\t\t\t\tmessage.File().Path(),\n\t\t\t\t`Message %q had required field \"%d\" deleted. Required fields must always be sent, so if one side does not know about the required field, this will result in a breakage.`,\n\t\t\t\tpreviousMessage.Name(),\n\t\t\t\tpreviousNumber,\n\t\t\t)\n\t\t}\n\t}\n\tfor number, requiredField := range numberToRequiredField {\n\t\tif _, ok := previousNumberToRequiredField[number]; !ok {\n\t\t\t// we attach the error to the added required field\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\trequiredField.Location(),\n\t\t\t\tnil,\n\t\t\t\trequiredField.File().Path(),\n\t\t\t\t`Message %q had required field \"%d\" added. Required fields must always be sent, so if one side does not know about the required field, this will result in a breakage.`,\n\t\t\t\tmessage.Name(),\n\t\t\t\tnumber,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingReservedEnumNoDelete is a check function.\nvar HandleBreakingReservedEnumNoDelete = bufcheckserverutil.NewBreakingEnumPairRuleHandler(handleBreakingReservedEnumNoDelete)\n\nfunc handleBreakingReservedEnumNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n\tpreviousEnum bufprotosource.Enum,\n) error {\n\tif err := checkTagRanges(\n\t\tresponseWriter,\n\t\t\"reserved\",\n\t\tenum,\n\t\tpreviousEnum,\n\t\tpreviousEnum.ReservedEnumRanges(),\n\t\tenum.ReservedEnumRanges(),\n\t); err != nil {\n\t\treturn err\n\t}\n\tpreviousValueToReservedName := bufprotosource.ValueToReservedName(previousEnum)\n\tvalueToReservedName := bufprotosource.ValueToReservedName(enum)\n\tfor previousValue := range previousValueToReservedName {\n\t\tif _, ok := valueToReservedName[previousValue]; !ok {\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tenum.Location(),\n\t\t\t\tpreviousEnum.Location(),\n\t\t\t\tenum.File().Path(),\n\t\t\t\t`Previously present reserved name %q on enum %q was deleted.`,\n\t\t\t\tpreviousValue,\n\t\t\t\tenum.Name(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingReservedMessageNoDelete is a check function.\nvar HandleBreakingReservedMessageNoDelete = bufcheckserverutil.NewBreakingMessagePairRuleHandler(handleBreakingReservedMessageNoDelete)\n\nfunc handleBreakingReservedMessageNoDelete(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n\tpreviousMessage bufprotosource.Message,\n) error {\n\tif err := checkTagRanges(\n\t\tresponseWriter,\n\t\t\"reserved\",\n\t\tmessage,\n\t\tpreviousMessage,\n\t\tpreviousMessage.ReservedMessageRanges(),\n\t\tmessage.ReservedMessageRanges(),\n\t); err != nil {\n\t\treturn err\n\t}\n\tpreviousValueToReservedName := bufprotosource.ValueToReservedName(previousMessage)\n\tvalueToReservedName := bufprotosource.ValueToReservedName(message)\n\tfor previousValue := range previousValueToReservedName {\n\t\tif _, ok := valueToReservedName[previousValue]; !ok {\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tmessage.Location(),\n\t\t\t\tpreviousMessage.Location(),\n\t\t\t\tmessage.File().Path(),\n\t\t\t\t`Previously present reserved name %q on message %q was deleted.`,\n\t\t\t\tpreviousValue,\n\t\t\t\tmessage.Name(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingRPCSameClientStreaming is a check function.\nvar HandleBreakingRPCSameClientStreaming = bufcheckserverutil.NewBreakingMethodPairRuleHandler(handleBreakingRPCSameClientStreaming)\n\nfunc handleBreakingRPCSameClientStreaming(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n\tpreviousMethod bufprotosource.Method,\n) error {\n\tif previousMethod.ClientStreaming() != method.ClientStreaming() {\n\t\tprevious := \"streaming\"\n\t\tcurrent := \"unary\"\n\t\tif method.ClientStreaming() {\n\t\t\tprevious = \"unary\"\n\t\t\tcurrent = \"streaming\"\n\t\t}\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.Location(),\n\t\t\tpreviousMethod.Location(),\n\t\t\tmethod.File().Path(),\n\t\t\t`RPC %q on service %q changed from client %s to client %s.`,\n\t\t\tmethod.Name(),\n\t\t\tmethod.Service().Name(),\n\t\t\tprevious,\n\t\t\tcurrent,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingRPCSameIdempotencyLevel is a check function.\nvar HandleBreakingRPCSameIdempotencyLevel = bufcheckserverutil.NewBreakingMethodPairRuleHandler(handleBreakingRPCSameIdempotencyLevel)\n\nfunc handleBreakingRPCSameIdempotencyLevel(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n\tpreviousMethod bufprotosource.Method,\n) error {\n\tprevious := previousMethod.IdempotencyLevel()\n\tcurrent := method.IdempotencyLevel()\n\tif previous != current {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.IdempotencyLevelLocation(),\n\t\t\tpreviousMethod.IdempotencyLevelLocation(),\n\t\t\tmethod.File().Path(),\n\t\t\t`RPC %q on service %q changed option \"idempotency_level\" from %q to %q.`,\n\t\t\tmethod.Name(),\n\t\t\tmethod.Service().Name(),\n\t\t\tprevious.String(),\n\t\t\tcurrent.String(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingRPCSameRequestType is a check function.\nvar HandleBreakingRPCSameRequestType = bufcheckserverutil.NewBreakingMethodPairRuleHandler(handleBreakingRPCSameRequestType)\n\nfunc handleBreakingRPCSameRequestType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n\tpreviousMethod bufprotosource.Method,\n) error {\n\tif previousMethod.InputTypeName() != method.InputTypeName() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.InputTypeLocation(),\n\t\t\tpreviousMethod.InputTypeLocation(),\n\t\t\tmethod.File().Path(),\n\t\t\t`RPC %q on service %q changed request type from %q to %q.`,\n\t\t\tmethod.Name(),\n\t\t\tmethod.Service().Name(),\n\t\t\tpreviousMethod.InputTypeName(),\n\t\t\tmethod.InputTypeName(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingRPCSameResponseType is a check function.\nvar HandleBreakingRPCSameResponseType = bufcheckserverutil.NewBreakingMethodPairRuleHandler(handleBreakingRPCSameResponseType)\n\nfunc handleBreakingRPCSameResponseType(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n\tpreviousMethod bufprotosource.Method,\n) error {\n\tif previousMethod.OutputTypeName() != method.OutputTypeName() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.OutputTypeLocation(),\n\t\t\tpreviousMethod.OutputTypeLocation(),\n\t\t\tmethod.File().Path(),\n\t\t\t`RPC %q on service %q changed response type from %q to %q.`,\n\t\t\tmethod.Name(),\n\t\t\tmethod.Service().Name(),\n\t\t\tpreviousMethod.OutputTypeName(),\n\t\t\tmethod.OutputTypeName(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingRPCSameServerStreaming is a check function.\nvar HandleBreakingRPCSameServerStreaming = bufcheckserverutil.NewBreakingMethodPairRuleHandler(handleBreakingRPCSameServerStreaming)\n\nfunc handleBreakingRPCSameServerStreaming(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n\tpreviousMethod bufprotosource.Method,\n) error {\n\tif previousMethod.ServerStreaming() != method.ServerStreaming() {\n\t\tprevious := \"streaming\"\n\t\tcurrent := \"unary\"\n\t\tif method.ServerStreaming() {\n\t\t\tprevious = \"unary\"\n\t\t\tcurrent = \"streaming\"\n\t\t}\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.Location(),\n\t\t\tpreviousMethod.Location(),\n\t\t\tmethod.File().Path(),\n\t\t\t`RPC %q on service %q changed from server %s to server %s.`,\n\t\t\tmethod.Name(),\n\t\t\tmethod.Service().Name(),\n\t\t\tprevious,\n\t\t\tcurrent,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingPackageEnumNoDelete is a check function.\nvar HandleBreakingPackageEnumNoDelete = bufcheckserverutil.NewRuleHandler(handleBreakingPackageEnumNoDelete)\n\nfunc handleBreakingPackageEnumNoDelete(\n\t_ context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\tpreviousPackageToNestedNameToEnum, err := bufprotosource.PackageToNestedNameToEnum(request.AgainstProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpackageToNestedNameToEnum, err := bufprotosource.PackageToNestedNameToEnum(request.ProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// caching across loops\n\tvar filePathToFile map[string]bufprotosource.File\n\tfor previousPackage, previousNestedNameToEnum := range previousPackageToNestedNameToEnum {\n\t\tif nestedNameToEnum, ok := packageToNestedNameToEnum[previousPackage]; ok {\n\t\t\tfor previousNestedName, previousEnum := range previousNestedNameToEnum {\n\t\t\t\tif _, ok := nestedNameToEnum[previousNestedName]; !ok {\n\t\t\t\t\t// if cache not populated, populate it\n\t\t\t\t\tif filePathToFile == nil {\n\t\t\t\t\t\tfilePathToFile, err = bufprotosource.FilePathToFile(request.ProtosourceFiles()...)\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\t\t\t\t\t}\n\t\t\t\t\t// Check if the file still exists.\n\t\t\t\t\tfile, ok := filePathToFile[previousEnum.File().Path()]\n\t\t\t\t\tvar location bufprotosource.Location\n\t\t\t\t\tvar filePath string\n\t\t\t\t\tif ok {\n\t\t\t\t\t\tvar descriptor bufprotosource.Descriptor\n\t\t\t\t\t\t// File exists, try to get a location to attach the error to.\n\t\t\t\t\t\tdescriptor, location, err = getDescriptorAndLocationForDeletedElement(file, previousNestedName)\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\t\t\t\t\t\tfilePath = descriptor.File().Path()\n\t\t\t\t\t\t// If the file does not exist, we don't know where the enum was deleted from.\n\t\t\t\t\t\t// The previous enum location is used to check for ignores. This means that if\n\t\t\t\t\t\t// ignore_unstable_packages is set, this will be triggered if the\n\t\t\t\t\t\t// previous enum was in an unstable package.\n\t\t\t\t\t}\n\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\tlocation,\n\t\t\t\t\t\tpreviousEnum.Location(),\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\t`Previously present enum %q was deleted from package %q.`,\n\t\t\t\t\t\tpreviousNestedName,\n\t\t\t\t\t\tpreviousPackage,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingPackageExtensionNoDelete is a check function.\nvar HandleBreakingPackageExtensionNoDelete = bufcheckserverutil.NewRuleHandler(handleBreakingPackageExtensionNoDelete)\n\nfunc handleBreakingPackageExtensionNoDelete(\n\t_ context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\tpreviousPackageToNestedNameToExtension, err := bufprotosource.PackageToNestedNameToExtension(request.AgainstProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpackageToNestedNameToExtension, err := bufprotosource.PackageToNestedNameToExtension(request.ProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// caching across loops\n\tvar filePathToFile map[string]bufprotosource.File\n\tfor previousPackage, previousNestedNameToExtension := range previousPackageToNestedNameToExtension {\n\t\tif nestedNameToExtension, ok := packageToNestedNameToExtension[previousPackage]; ok {\n\t\t\tfor previousNestedName, previousExtension := range previousNestedNameToExtension {\n\t\t\t\tif _, ok := nestedNameToExtension[previousNestedName]; !ok {\n\t\t\t\t\t// if cache not populated, populate it\n\t\t\t\t\tif filePathToFile == nil {\n\t\t\t\t\t\tfilePathToFile, err = bufprotosource.FilePathToFile(request.ProtosourceFiles()...)\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\t\t\t\t\t}\n\t\t\t\t\t// Check if the file still exists.\n\t\t\t\t\tfile, ok := filePathToFile[previousExtension.File().Path()]\n\t\t\t\t\tvar location bufprotosource.Location\n\t\t\t\t\tvar filePath string\n\t\t\t\t\tif ok {\n\t\t\t\t\t\tvar descriptor bufprotosource.Descriptor\n\t\t\t\t\t\t// File exists, try to get a location to attach the error to.\n\t\t\t\t\t\tdescriptor, location, err = getDescriptorAndLocationForDeletedElement(file, previousNestedName)\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\t\t\t\t\t\tfilePath = descriptor.File().Path()\n\t\t\t\t\t\t// If the file does not exist, we don't know where the enum was deleted from.\n\t\t\t\t\t\t// The previous enum location is used to check for ignores. This means that if\n\t\t\t\t\t\t// ignore_unstable_packages is set, this will be triggered if the\n\t\t\t\t\t\t// previous enum was in an unstable package.\n\t\t\t\t\t}\n\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\tlocation,\n\t\t\t\t\t\tpreviousExtension.Location(),\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\t`Previously present extension %q was deleted from package %q.`,\n\t\t\t\t\t\tpreviousNestedName,\n\t\t\t\t\t\tpreviousPackage,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingPackageMessageNoDelete is a check function.\nvar HandleBreakingPackageMessageNoDelete = bufcheckserverutil.NewRuleHandler(handleBreakingPackageMessageNoDelete)\n\nfunc handleBreakingPackageMessageNoDelete(\n\t_ context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\tpreviousPackageToNestedNameToMessage, err := bufprotosource.PackageToNestedNameToMessage(request.AgainstProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpackageToNestedNameToMessage, err := bufprotosource.PackageToNestedNameToMessage(request.ProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// caching across loops\n\tvar filePathToFile map[string]bufprotosource.File\n\tfor previousPackage, previousNestedNameToMessage := range previousPackageToNestedNameToMessage {\n\t\tif nestedNameToMessage, ok := packageToNestedNameToMessage[previousPackage]; ok {\n\t\t\tfor previousNestedName, previousMessage := range previousNestedNameToMessage {\n\t\t\t\tif _, ok := nestedNameToMessage[previousNestedName]; !ok {\n\t\t\t\t\t// if cache not populated, populate it\n\t\t\t\t\tif filePathToFile == nil {\n\t\t\t\t\t\tfilePathToFile, err = bufprotosource.FilePathToFile(request.ProtosourceFiles()...)\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\t\t\t\t\t}\n\t\t\t\t\t// Check if the file still exists.\n\t\t\t\t\tfile, ok := filePathToFile[previousMessage.File().Path()]\n\t\t\t\t\tvar location bufprotosource.Location\n\t\t\t\t\tvar filePath string\n\t\t\t\t\tif ok {\n\t\t\t\t\t\tvar descriptor bufprotosource.Descriptor\n\t\t\t\t\t\t// File exists, try to get a location to attach the error to.\n\t\t\t\t\t\tdescriptor, location = getDescriptorAndLocationForDeletedMessage(file, nestedNameToMessage, previousNestedName)\n\t\t\t\t\t\tfilePath = descriptor.File().Path()\n\t\t\t\t\t\t// If the file does not exist, we don't know where the message was deleted from.\n\t\t\t\t\t\t// The previous message location is used to check for ignores. This means that if\n\t\t\t\t\t\t// ignore_unstable_packages is set, this will be triggered if the\n\t\t\t\t\t\t// previous message was in an unstable package.\n\t\t\t\t\t}\n\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\tlocation,\n\t\t\t\t\t\tpreviousMessage.Location(),\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\t`Previously present message %q was deleted from package %q.`,\n\t\t\t\t\t\tpreviousNestedName,\n\t\t\t\t\t\tpreviousPackage,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingPackageNoDelete is check function.\nvar HandleBreakingPackageNoDelete = bufcheckserverutil.NewRuleHandler(handleBreakingPackageNoDelete)\n\nfunc handleBreakingPackageNoDelete(\n\t_ context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\tpreviousPackageToFiles, err := bufprotosource.PackageToFiles(request.AgainstProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpackageToFiles, err := bufprotosource.PackageToFiles(request.ProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor previousPackage, previousFiles := range previousPackageToFiles {\n\t\tif _, ok := packageToFiles[previousPackage]; !ok {\n\t\t\t// Add previous descriptors in the same package as other descriptors to check\n\t\t\t// for ignores. This will mean that if we have ignore_unstable_packages set,\n\t\t\t// any one of these files will cause the ignore to happen. Note that we\n\t\t\t// could probably just attach a single file, but we do this in case we\n\t\t\t// have other ways to ignore in the future.\n\t\t\tpreviousDescriptors := make([]bufprotosource.Descriptor, len(previousFiles))\n\t\t\tfor i, previousFile := range previousFiles {\n\t\t\t\tpreviousDescriptors[i] = previousFile\n\t\t\t}\n\t\t\t// ResponseWriter only expects a single against file name, so we grab the first one in\n\t\t\t// alphabetical order from the previous descriptors, so this is deterministic. As noted,\n\t\t\t// this is to provide a path for check ignoring unstable packages.\n\t\t\tpreviousDescriptorsFileNames := xslices.Map(\n\t\t\t\tpreviousDescriptors,\n\t\t\t\tfunc(previousDescriptor bufprotosource.Descriptor) string {\n\t\t\t\t\treturn previousDescriptor.File().Path()\n\t\t\t\t},\n\t\t\t)\n\t\t\tslices.Sort(previousDescriptorsFileNames)\n\t\t\tvar fileName string\n\t\t\tif len(previousDescriptorsFileNames) > 0 {\n\t\t\t\tfileName = previousDescriptorsFileNames[0]\n\t\t\t}\n\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\tcheck.WithAgainstFileName(fileName),\n\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t`Previously present package %q was deleted.`,\n\t\t\t\t\tpreviousPackage,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingPackageServiceNoDelete is a check function.\nvar HandleBreakingPackageServiceNoDelete = bufcheckserverutil.NewRuleHandler(handleBreakingPackageServiceNoDelete)\n\nfunc handleBreakingPackageServiceNoDelete(\n\t_ context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\tpreviousPackageToNameToService, err := bufprotosource.PackageToNameToService(request.AgainstProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpackageToNameToService, err := bufprotosource.PackageToNameToService(request.ProtosourceFiles()...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// caching across loops\n\tvar filePathToFile map[string]bufprotosource.File\n\tfor previousPackage, previousNameToService := range previousPackageToNameToService {\n\t\tif nameToService, ok := packageToNameToService[previousPackage]; ok {\n\t\t\tfor previousName, previousService := range previousNameToService {\n\t\t\t\tif _, ok := nameToService[previousName]; !ok {\n\t\t\t\t\t// if cache not populated, populate it\n\t\t\t\t\tif filePathToFile == nil {\n\t\t\t\t\t\tfilePathToFile, err = bufprotosource.FilePathToFile(request.ProtosourceFiles()...)\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\t\t\t\t\t}\n\t\t\t\t\t// Check if the file still exists.\n\t\t\t\t\tfile, ok := filePathToFile[previousService.File().Path()]\n\t\t\t\t\tvar filePath string\n\t\t\t\t\tif ok {\n\t\t\t\t\t\t// File exists.\n\t\t\t\t\t\tfilePath = file.Path()\n\t\t\t\t\t\t// If the file does not exist, we don't know where the service was deleted from.\n\t\t\t\t\t\t// The previous service location is used to check for ignores. This means that if\n\t\t\t\t\t\t// ignore_unstable_packages is set, this will be triggered if the\n\t\t\t\t\t\t// previous service was in an unstable package.\n\t\t\t\t\t\t// TODO: find the service and print that this moved?\n\t\t\t\t\t}\n\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\tnil,\n\t\t\t\t\t\tpreviousService.Location(),\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t\t`Previously present service %q was deleted from package %q.`,\n\t\t\t\t\t\tpreviousName,\n\t\t\t\t\t\tpreviousPackage,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldWireJSONCompatibleCardinality is a check function.\nvar HandleBreakingFieldWireJSONCompatibleCardinality = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldWireJSONCompatibleCardinality)\n\nfunc handleBreakingFieldWireJSONCompatibleCardinality(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousDescriptor.ContainingMessage().IsMapEntry() && descriptor.ContainingMessage().IsMapEntry() {\n\t\t// Map entries are generated so nothing to do here. They\n\t\t// usually would be safe to check anyway, but it's possible\n\t\t// that a map entry field \"appears\" to inherit field presence\n\t\t// from a file default or file syntax, but they don't actually\n\t\t// behave differently whether they report implicit vs explicit\n\t\t// presence. So just skip the check.\n\t\treturn nil\n\t}\n\n\tpreviousCardinality := getCardinality(previousDescriptor)\n\tcurrentCardinality := getCardinality(descriptor)\n\tif cardinalityToWireJSONCompatibilityGroup[previousCardinality] != cardinalityToWireJSONCompatibilityGroup[currentCardinality] {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfield.Location(),\n\t\t\tpreviousField.Location(),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed cardinality from %q to %q.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousCardinality,\n\t\t\tcurrentCardinality,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleBreakingFieldWireCompatibleCardinality is a check function.\nvar HandleBreakingFieldWireCompatibleCardinality = bufcheckserverutil.NewBreakingFieldPairRuleHandler(handleBreakingFieldWireCompatibleCardinality)\n\nfunc handleBreakingFieldWireCompatibleCardinality(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n\tpreviousField bufprotosource.Field,\n) error {\n\tpreviousDescriptor, err := previousField.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif previousDescriptor.ContainingMessage().IsMapEntry() && descriptor.ContainingMessage().IsMapEntry() {\n\t\t// Map entries are generated so nothing to do here. They\n\t\t// usually would be safe to check anyway, but it's possible\n\t\t// that a map entry field \"appears\" to inherit field presence\n\t\t// from a file default or file syntax, but they don't actually\n\t\t// behave differently whether they report implicit vs explicit\n\t\t// presence. So just skip the check.\n\t\treturn nil\n\t}\n\n\tpreviousCardinality := getCardinality(previousDescriptor)\n\tcurrentCardinality := getCardinality(descriptor)\n\tif cardinalityToWireCompatibilityGroup[previousCardinality] != cardinalityToWireCompatibilityGroup[currentCardinality] {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfield.Location(),\n\t\t\tpreviousField.Location(),\n\t\t\tfield.File().Path(),\n\t\t\t`%s changed cardinality from %q to %q.`,\n\t\t\tfieldDescription(field),\n\t\t\tpreviousCardinality,\n\t\t\tcurrentCardinality,\n\t\t)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/breaking_util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/customfeatures/customfeatures\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/gen/proto/go/google/protobuf\"\n\t\"github.com/bufbuild/protocompile/protoutil\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nconst (\n\tfeaturesFieldName             = \"features\"\n\tfeatureNameUTF8Validation     = \"utf8_validation\"\n\tfeatureNameJSONFormat         = \"json_format\"\n\tcppFeatureNameStringType      = \"string_type\"\n\tjavaFeatureNameUTF8Validation = \"utf8_validation\"\n)\n\nvar (\n\t// https://developers.google.com/protocol-buffers/docs/proto3#updating\n\tfieldKindToWireCompatibilityGroup = map[protoreflect.Kind]int{\n\t\tprotoreflect.Int32Kind:  1,\n\t\tprotoreflect.Int64Kind:  1,\n\t\tprotoreflect.Uint32Kind: 1,\n\t\tprotoreflect.Uint64Kind: 1,\n\t\tprotoreflect.BoolKind:   1,\n\t\tprotoreflect.Sint32Kind: 2,\n\t\tprotoreflect.Sint64Kind: 2,\n\t\t// While string and bytes are compatible if the bytes are valid UTF-8, we cannot\n\t\t// determine if a field will actually be valid UTF-8, as we are concerned with the\n\t\t// definitions and not individual messages, so we have these in different\n\t\t// compatibility groups. We allow string to evolve to bytes, but not bytes to\n\t\t// string, but we need them to be in different compatibility groups so that\n\t\t// we have to manually detect this.\n\t\tprotoreflect.StringKind:   3,\n\t\tprotoreflect.BytesKind:    4,\n\t\tprotoreflect.Fixed32Kind:  5,\n\t\tprotoreflect.Sfixed32Kind: 5,\n\t\tprotoreflect.Fixed64Kind:  6,\n\t\tprotoreflect.Sfixed64Kind: 6,\n\t\tprotoreflect.DoubleKind:   7,\n\t\tprotoreflect.FloatKind:    8,\n\t\tprotoreflect.GroupKind:    9,\n\t\t// Embedded messages are compatible with bytes if the bytes are serialized versions\n\t\t// of the message, but we have no way of verifying this.\n\t\tprotoreflect.MessageKind: 10,\n\t\t// Enum is compatible with int32, uint32, int64, uint64 if the values match\n\t\t// an enum value, but we have no way of verifying this.\n\t\tprotoreflect.EnumKind: 11,\n\t}\n\n\t// httpsKind://developers.google.com/protocol-buffers/docs/proto3#json\n\t// this is not just JSON-compatible, but also wire-compatible, i.e. the intersection\n\tfieldKindToWireJSONCompatibilityGroup = map[protoreflect.Kind]int{\n\t\t// fixed32 not compatible for wire so not included\n\t\tprotoreflect.Int32Kind:  1,\n\t\tprotoreflect.Uint32Kind: 1,\n\t\t// fixed64 not compatible for wire so not included\n\t\tprotoreflect.Int64Kind:    2,\n\t\tprotoreflect.Uint64Kind:   2,\n\t\tprotoreflect.Fixed32Kind:  3,\n\t\tprotoreflect.Sfixed32Kind: 3,\n\t\tprotoreflect.Fixed64Kind:  4,\n\t\tprotoreflect.Sfixed64Kind: 4,\n\t\tprotoreflect.BoolKind:     5,\n\t\tprotoreflect.Sint32Kind:   6,\n\t\tprotoreflect.Sint64Kind:   7,\n\t\tprotoreflect.StringKind:   8,\n\t\tprotoreflect.BytesKind:    9,\n\t\tprotoreflect.DoubleKind:   10,\n\t\tprotoreflect.FloatKind:    11,\n\t\tprotoreflect.GroupKind:    12,\n\t\tprotoreflect.MessageKind:  13,\n\t\tprotoreflect.EnumKind:     14,\n\t}\n)\n\nfunc fieldDescriptorTypePrettyString(descriptor protoreflect.FieldDescriptor) string {\n\tif descriptor.Kind() == protoreflect.GroupKind && descriptor.Syntax() != protoreflect.Proto2 {\n\t\t// Kind will be set to \"group\", but it's really a \"delimited-encoded message\"\n\t\treturn \"message (delimited encoding)\"\n\t}\n\treturn descriptor.Kind().String()\n}\n\nfunc getDescriptorAndLocationForDeletedElement(\n\tfile bufprotosource.File,\n\tpreviousNestedName string,\n) (bufprotosource.Descriptor, bufprotosource.Location, error) {\n\tif strings.Contains(previousNestedName, \".\") {\n\t\tnestedNameToMessage, err := bufprotosource.NestedNameToMessage(file)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tsplit := strings.Split(previousNestedName, \".\")\n\t\tfor i := len(split) - 1; i > 0; i-- {\n\t\t\tif message, ok := nestedNameToMessage[strings.Join(split[0:i], \".\")]; ok {\n\t\t\t\treturn message, message.Location(), nil\n\t\t\t}\n\t\t}\n\t}\n\treturn file, nil, nil\n}\n\nfunc getDescriptorAndLocationForDeletedMessage(\n\tfile bufprotosource.File,\n\tnestedNameToMessage map[string]bufprotosource.Message,\n\tpreviousNestedName string,\n) (bufprotosource.Descriptor, bufprotosource.Location) {\n\tif strings.Contains(previousNestedName, \".\") {\n\t\tsplit := strings.Split(previousNestedName, \".\")\n\t\tfor i := len(split) - 1; i > 0; i-- {\n\t\t\tif message, ok := nestedNameToMessage[strings.Join(split[0:i], \".\")]; ok {\n\t\t\t\treturn message, message.Location()\n\t\t\t}\n\t\t}\n\t}\n\treturn file, nil\n}\n\nfunc getSortedEnumValueNames(nameToEnumValue map[string]bufprotosource.EnumValue) []string {\n\tnames := make([]string, 0, len(nameToEnumValue))\n\tfor name := range nameToEnumValue {\n\t\tnames = append(names, name)\n\t}\n\tsort.Strings(names)\n\treturn names\n}\n\nfunc getEnumByFullName(files []bufprotosource.File, enumFullName string) (bufprotosource.Enum, error) {\n\tfullNameToEnum, err := bufprotosource.FullNameToEnum(files...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tenum, ok := fullNameToEnum[enumFullName]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expected enum %q to exist but was not found\", enumFullName)\n\t}\n\treturn enum, nil\n}\n\nfunc withBackupLocation(locs ...bufprotosource.Location) bufprotosource.Location {\n\tfor _, loc := range locs {\n\t\tif loc != nil {\n\t\t\treturn loc\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc findFeatureField(name protoreflect.Name, expectedKind protoreflect.Kind) (protoreflect.FieldDescriptor, error) {\n\tfeatureSetDescriptor := (*descriptorpb.FeatureSet)(nil).ProtoReflect().Descriptor()\n\tfeatureField := featureSetDescriptor.Fields().ByName(name)\n\tif featureField == nil {\n\t\treturn nil, fmt.Errorf(\"unable to resolve field descriptor for %s.%s\", featureSetDescriptor.FullName(), name)\n\t}\n\tif featureField.Kind() != expectedKind || featureField.IsList() {\n\t\treturn nil, fmt.Errorf(\"resolved field descriptor for %s.%s has unexpected type: expected optional %s, got %s %s\",\n\t\t\tfeatureSetDescriptor.FullName(), name, expectedKind, featureField.Cardinality(), featureField.Kind())\n\t}\n\treturn featureField, nil\n}\n\nfunc fieldCppStringType(field bufprotosource.Field, descriptor protoreflect.FieldDescriptor) (protobuf.CppFeatures_StringType, bool, error) {\n\t// We don't support Edition 2024 yet. But we know of this rule, so we can go ahead and\n\t// implement it so it's one less thing to do when we DO add support for 2024.\n\tif field.File().Edition() < descriptorpb.Edition_EDITION_2024 {\n\t\topts, _ := descriptor.Options().(*descriptorpb.FieldOptions)\n\t\t// TODO: In Edition 2024, it will be *required* to use the new (pb.cpp).string_type option. So\n\t\t//       we shouldn't bother checking the ctype option in editions >= 2024.\n\t\tif opts != nil && opts.Ctype != nil {\n\t\t\tswitch opts.GetCtype() {\n\t\t\tcase descriptorpb.FieldOptions_CORD:\n\t\t\t\treturn protobuf.CppFeatures_CORD, false, nil\n\t\t\tcase descriptorpb.FieldOptions_STRING_PIECE:\n\t\t\t\treturn protobuf.CppFeatures_STRING, true, nil\n\t\t\tcase descriptorpb.FieldOptions_STRING:\n\t\t\t\treturn protobuf.CppFeatures_STRING, false, nil\n\t\t\tdefault:\n\t\t\t\tif descriptor.ParentFile().Syntax() != protoreflect.Editions {\n\t\t\t\t\treturn protobuf.CppFeatures_STRING, false, nil\n\t\t\t\t}\n\t\t\t\t// If the file is edition 2023, we fall through to below since 2023 allows either\n\t\t\t\t// the ctype field or the (pb.cpp).string_type feature.\n\t\t\t}\n\t\t}\n\t}\n\tval, err := customfeatures.ResolveCppFeature(descriptor, cppFeatureNameStringType, protoreflect.EnumKind)\n\tif err != nil {\n\t\treturn 0, false, err\n\t}\n\treturn protobuf.CppFeatures_StringType(val.Enum()), false, nil\n}\n\nfunc fieldCppStringTypeLocation(field bufprotosource.Field) bufprotosource.Location {\n\text := protobuf.E_Cpp.TypeDescriptor()\n\tif ext.Message() == nil {\n\t\treturn nil\n\t}\n\treturn getCustomFeatureLocation(field, ext, cppFeatureNameStringType)\n}\n\nfunc fieldJavaUTF8Validation(field protoreflect.FieldDescriptor) (descriptorpb.FeatureSet_Utf8Validation, error) {\n\tstandardFeatureField, err := findFeatureField(featureNameUTF8Validation, protoreflect.EnumKind)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tval, err := protoutil.ResolveFeature(field, standardFeatureField)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"unable to resolve value of %s feature: %w\", standardFeatureField.Name(), err)\n\t}\n\tdefaultValue := descriptorpb.FeatureSet_Utf8Validation(val.Enum())\n\n\topts, _ := field.ParentFile().Options().(*descriptorpb.FileOptions)\n\tif field.ParentFile().Syntax() != protoreflect.Editions || (opts != nil && opts.JavaStringCheckUtf8 != nil) {\n\t\tif opts.GetJavaStringCheckUtf8() {\n\t\t\treturn descriptorpb.FeatureSet_VERIFY, nil\n\t\t}\n\t\treturn defaultValue, nil\n\t}\n\n\tval, err = customfeatures.ResolveJavaFeature(field, javaFeatureNameUTF8Validation, protoreflect.EnumKind)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif protobuf.JavaFeatures_Utf8Validation(val.Enum()) == protobuf.JavaFeatures_VERIFY {\n\t\treturn descriptorpb.FeatureSet_VERIFY, nil\n\t}\n\treturn defaultValue, nil\n}\n\nfunc fieldJavaUTF8ValidationLocation(field bufprotosource.Field) bufprotosource.Location {\n\text := protobuf.E_Java.TypeDescriptor()\n\tif ext.Message() == nil {\n\t\treturn nil\n\t}\n\treturn getCustomFeatureLocation(field, ext, javaFeatureNameUTF8Validation)\n}\n\nfunc getCustomFeatureLocation(field bufprotosource.Field, extension protoreflect.ExtensionTypeDescriptor, fieldName protoreflect.Name) bufprotosource.Location {\n\tif extension.Message() == nil {\n\t\treturn nil\n\t}\n\tfeature := extension.Message().Fields().ByName(fieldName)\n\tif feature == nil {\n\t\treturn nil\n\t}\n\tfeatureField := (*descriptorpb.FieldOptions)(nil).ProtoReflect().Descriptor().Fields().ByName(featuresFieldName)\n\tif featureField == nil {\n\t\t// should not be possible\n\t\treturn nil\n\t}\n\treturn field.OptionLocation(featureField, int32(extension.Number()), int32(feature.Number()))\n}\n\nfunc fieldDescription(field bufprotosource.Field) string {\n\tvar name string\n\tif field.Extendee() != \"\" {\n\t\t// extensions are known by fully-qualified name\n\t\tname = field.FullName()\n\t} else {\n\t\tname = field.Name()\n\t}\n\treturn fieldDescriptionWithName(field, name)\n}\n\nfunc fieldDescriptionWithName(field bufprotosource.Field, name string) string {\n\tif name != \"\" {\n\t\tname = fmt.Sprintf(\" with name %q\", name)\n\t}\n\t// otherwise prints as hex\n\tnumberString := strconv.FormatInt(int64(field.Number()), 10)\n\tvar kind, message string\n\tif field.Extendee() != \"\" {\n\t\tkind = \"Extension\"\n\t\tmessage = field.Extendee()\n\t} else {\n\t\tkind = \"Field\"\n\t\tmessage = field.ParentMessage().Name()\n\t}\n\treturn fmt.Sprintf(\"%s %q%s on message %q\", kind, numberString, name, message)\n}\n\nfunc is64bitInteger(fieldType descriptorpb.FieldDescriptorProto_Type) bool {\n\tswitch fieldType {\n\tcase descriptorpb.FieldDescriptorProto_TYPE_INT64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SINT64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_UINT64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_FIXED64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SFIXED64:\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/bufcheckserverhandle.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/cardinality.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"strconv\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tcardinalityOptionalExplicitPresence cardinality = iota + 1\n\tcardinalityOptionalImplicitPresence\n\tcardinalityRequired\n\tcardinalityRepeated\n\tcardinalityMap\n)\n\nvar (\n\tcardinalityToWireCompatibilityGroup = map[cardinality]int{\n\t\tcardinalityOptionalExplicitPresence: 1,\n\t\tcardinalityOptionalImplicitPresence: 1,\n\t\tcardinalityRequired:                 2,\n\t\tcardinalityRepeated:                 3,\n\t\tcardinalityMap:                      3,\n\t}\n\n\tcardinalityToWireJSONCompatibilityGroup = map[cardinality]int{\n\t\tcardinalityOptionalExplicitPresence: 1,\n\t\tcardinalityOptionalImplicitPresence: 1,\n\t\tcardinalityRequired:                 2,\n\t\tcardinalityRepeated:                 3,\n\t\tcardinalityMap:                      4, // maps and repeated use different JSON format\n\t}\n)\n\ntype cardinality int\n\nfunc (c cardinality) String() string {\n\tswitch c {\n\tcase cardinalityOptionalExplicitPresence:\n\t\treturn \"optional with explicit presence\"\n\tcase cardinalityOptionalImplicitPresence:\n\t\treturn \"optional with implicit presence\"\n\tcase cardinalityRequired:\n\t\treturn \"required\"\n\tcase cardinalityRepeated:\n\t\treturn \"repeated\"\n\tcase cardinalityMap:\n\t\treturn \"map\"\n\tdefault:\n\t\treturn strconv.Itoa(int(c))\n\t}\n}\n\nfunc getCardinality(field protoreflect.FieldDescriptor) cardinality {\n\tswitch {\n\tcase field.IsList():\n\t\treturn cardinalityRepeated\n\tcase field.IsMap():\n\t\treturn cardinalityMap\n\tcase field.Cardinality() == protoreflect.Required:\n\t\treturn cardinalityRequired\n\tcase field.HasPresence():\n\t\treturn cardinalityOptionalExplicitPresence\n\tdefault:\n\t\treturn cardinalityOptionalImplicitPresence\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/field_default.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"reflect\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\ntype fieldDefault struct {\n\tcomparable any\n\tprintable  any\n}\n\nfunc (f fieldDefault) isZero() bool {\n\treturn reflect.ValueOf(f.comparable).IsZero()\n}\n\nfunc getDefault(descriptor protoreflect.FieldDescriptor) fieldDefault {\n\tswitch descriptor.Kind() {\n\tcase protoreflect.BytesKind:\n\t\tdata := descriptor.Default().Bytes()\n\t\tprintable := strings.Join(\n\t\t\txslices.Map(data, func(b byte) string { return fmt.Sprintf(\"0x%X\", b) }),\n\t\t\t\",\")\n\t\treturn fieldDefault{\n\t\t\t// cannot compare slices, so we convert []byte to string\n\t\t\tcomparable: string(data),\n\t\t\tprintable:  \"[\" + printable + \"]\",\n\t\t}\n\tcase protoreflect.StringKind:\n\t\treturn fieldDefault{\n\t\t\tcomparable: descriptor.Default().String(),\n\t\t\tprintable:  fmt.Sprintf(\"%q\", descriptor.Default().String()),\n\t\t}\n\tcase protoreflect.EnumKind:\n\t\t// Ideally, we'd use descriptor.DefaultEnumValue(). But that returns\n\t\t// nil when the default is not explicitly set :(\n\t\tenumVal := descriptor.Default().Enum()\n\t\tenumDescriptor := descriptor.Enum()\n\t\tvar printable string\n\t\tif enumValDescriptor := enumDescriptor.Values().ByNumber(enumVal); enumValDescriptor != nil {\n\t\t\tprintable = fmt.Sprintf(\"%s.%s\", enumDescriptor.Name(), enumValDescriptor.Name())\n\t\t} else {\n\t\t\t// should not be possible\n\t\t\tprintable = fmt.Sprintf(\"%s.%d(?)\", enumDescriptor.Name(), enumVal)\n\t\t}\n\t\treturn fieldDefault{\n\t\t\tcomparable: int32(enumVal),\n\t\t\tprintable:  printable,\n\t\t}\n\tdefault:\n\t\t// All other kinds (bool, numbers) compare and print just fine.\n\t\t// (We're not considering list, map, or message types since such\n\t\t// fields cannot have default values.)\n\t\treturn fieldDefault{\n\t\t\tcomparable: descriptor.Default().Interface(),\n\t\t\tprintable:  descriptor.Default().Interface(),\n\t\t}\n\t}\n}\n\nfunc defaultsEqual(previous, current fieldDefault) bool {\n\t// Since the FIELD_SAME_TYPE check will catch type change errors, we try\n\t// to be lenient about types here. Basically, we can successfully compare\n\t// defaults between strings and bytes and then between all other numeric\n\t// types (including bool and enum). But changing a field from string to\n\t// number (or vice versa) will trigger an issue about default value change.\n\t_, previousIsString := previous.comparable.(string)\n\t_, currentIsString := current.comparable.(string)\n\tif previousIsString || currentIsString {\n\t\treturn previous.comparable == current.comparable\n\t}\n\t// If neither are strings, we know they are both bools or numeric types.\n\n\t// If the type changed from float to double or vice versa, then\n\t// the big.Float approach below can report a difference due to\n\t// the extra precision of float64 meaning the value is not\n\t// *precisely* equal to the float32 form. So for these changes,\n\t// we convert both to float32 to do the comparison.\n\tswitch previousFloat := previous.comparable.(type) {\n\tcase float32:\n\t\tif currentFloat, ok := current.comparable.(float64); ok {\n\t\t\treturn (math.IsNaN(float64(previousFloat)) && math.IsNaN(currentFloat)) ||\n\t\t\t\tpreviousFloat == float32(currentFloat)\n\t\t}\n\tcase float64:\n\t\tif currentFloat, ok := current.comparable.(float32); ok {\n\t\t\treturn (math.IsNaN(previousFloat) && math.IsNaN(float64(currentFloat))) ||\n\t\t\t\tfloat32(previousFloat) == currentFloat\n\t\t}\n\t}\n\n\t// To compare values without overflow (and without an inordinate number\n\t// of switches), we convert them to a common numeric format and compare that.\n\t// We use *big.Float since it can represent the full range of values\n\t// for float64, int64, or uint64 without any loss of precision.\n\tpreviousVal, previousNaN := asBigFloat(previous.comparable)\n\tcurrentVal, currentNaN := asBigFloat(current.comparable)\n\tif previousNaN && currentNaN {\n\t\treturn true\n\t} else if previousNaN != currentNaN {\n\t\treturn false\n\t}\n\tif previousVal == nil || currentVal == nil {\n\t\t// should not be possible; but just in case, don't panic\n\t\treturn previous.comparable == current.comparable\n\t}\n\treturn previousVal.Cmp(currentVal) == 0\n}\n\nfunc asBigFloat(val any) (result *big.Float, isNaN bool) {\n\tswitch val := val.(type) {\n\tcase bool:\n\t\tif val {\n\t\t\treturn big.NewFloat(1), false\n\t\t}\n\t\treturn big.NewFloat(0), false\n\tcase int32:\n\t\tvar float big.Float\n\t\tfloat.SetInt64(int64(val))\n\t\treturn &float, false\n\tcase int64:\n\t\tvar float big.Float\n\t\tfloat.SetInt64(val)\n\t\treturn &float, false\n\tcase uint32:\n\t\tvar float big.Float\n\t\tfloat.SetUint64(uint64(val))\n\t\treturn &float, false\n\tcase uint64:\n\t\tvar float big.Float\n\t\tfloat.SetUint64(val)\n\t\treturn &float, false\n\tcase float32:\n\t\tif math.IsNaN(float64(val)) {\n\t\t\treturn nil, true\n\t\t}\n\t\treturn big.NewFloat(float64(val)), false\n\tcase float64:\n\t\tif math.IsNaN(val) {\n\t\t\treturn nil, true\n\t\t}\n\t\treturn big.NewFloat(val), false\n\tdefault:\n\t\t// should never happen...\n\t\treturn nil, false\n\t}\n}\n\nfunc canHaveDefault(descriptor protoreflect.FieldDescriptor) bool {\n\treturn !descriptor.IsList() && !descriptor.IsMap() && descriptor.Message() == nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/field_default_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"math\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/protocompile\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestDefaultsEqual(t *testing.T) {\n\tt.Parallel()\n\t// With an entry, all values are considered equal. But they are all\n\t// considered unequal to values in any other entry.\n\tvalues := map[string][]any{\n\t\t\"zero\": {\n\t\t\tint32(0), int64(0), uint32(0), uint64(0), float32(0), 0.0, false,\n\t\t},\n\t\t\"one\": {\n\t\t\tint32(1), int64(1), uint32(1), uint64(1), float32(1), 1.0, true,\n\t\t},\n\t\t\"other-integer\": {\n\t\t\tint32(456), int64(456), uint32(456), uint64(456), float32(456), 456.0,\n\t\t},\n\t\t\"other-non-integer\": {\n\t\t\tfloat32(-987.654), -987.654,\n\t\t},\n\t\t\"nan\": {\n\t\t\tfloat32(math.NaN()), math.NaN(), -float32(math.NaN()), -math.NaN(),\n\t\t},\n\t\t\"positive-inf\": {\n\t\t\tfloat32(math.Inf(1)), math.Inf(1),\n\t\t},\n\t\t\"negative-inf\": {\n\t\t\tfloat32(math.Inf(-1)), math.Inf(-1),\n\t\t},\n\t\t\"other-string\": {\n\t\t\t\"foobar\",\n\t\t},\n\t}\n\tfor name, vals := range values {\n\t\tt.Run(name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tfor _, val := range vals {\n\t\t\t\tfor other, otherVals := range values {\n\t\t\t\t\tfor _, otherVal := range otherVals {\n\t\t\t\t\t\tdefault1 := fieldDefault{\n\t\t\t\t\t\t\tcomparable: val, printable: val,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdefault2 := fieldDefault{\n\t\t\t\t\t\t\tcomparable: otherVal, printable: otherVal,\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif name == other {\n\t\t\t\t\t\t\tassert.True(t, defaultsEqual(default1, default2),\n\t\t\t\t\t\t\t\t\"expected %v (%T) to be sufficiently equal default to %v (%T)\",\n\t\t\t\t\t\t\t\tval, val, otherVal, otherVal)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tassert.False(t, defaultsEqual(default1, default2),\n\t\t\t\t\t\t\t\t\"expected %v (%T) to be NOT equal default to %v (%T)\",\n\t\t\t\t\t\t\t\tval, val, otherVal, otherVal)\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 TestGetDefault(t *testing.T) {\n\tt.Parallel()\n\ttestFile := `\n\t\tsyntax = \"proto2\";\n\t\tmessage A {\n\t\t\toptional int32 int32 = 1 [default=123];\n\t\t\toptional sint32 sint32 = 2 [default=123];\n\t\t\toptional uint32 uint32 = 3 [default=123];\n\t\t\toptional fixed32 fixed32 = 4 [default=123];\n\t\t\toptional sfixed32 sfixed32 = 5 [default=123];\n\t\t\toptional int64 int64 = 6 [default=123];\n\t\t\toptional sint64 sint64 = 7 [default=123];\n\t\t\toptional uint64 uint64 = 8 [default=123];\n\t\t\toptional fixed64 fixed64 = 9 [default=123];\n\t\t\toptional sfixed64 sfixed64 = 10 [default=123];\n\t\t\toptional float float = 11 [default=123.123];\n\t\t\toptional double double = 12 [default=123.123];\n\t\t\toptional bool bool = 13 [default=true];\n\t\t\toptional string string = 14 [default=\"xyz\"];\n\t\t\toptional bytes bytes = 15 [default=\"xyz\"];\n\t\t\toptional Enum enum = 16 [default=V123];\n\t\t\toptional A message = 17;\n\t\t\trepeated int32 repeated = 18;\n\t\t\tmap<int32, int32> map = 19;\n\t\t}\n\t\tenum Enum {\n\t\t\tV0 = 0;\n\t\t\tV1 = 1;\n\t\t\tV123 = 123;\n\t\t}`\n\tcompiler := &protocompile.Compiler{\n\t\tResolver: &protocompile.SourceResolver{\n\t\t\tAccessor: protocompile.SourceAccessorFromMap(map[string]string{\n\t\t\t\t\"test.proto\": testFile,\n\t\t\t}),\n\t\t},\n\t}\n\tresults, err := compiler.Compile(t.Context(), \"test.proto\")\n\trequire.NoError(t, err)\n\tmsg := results[0].Messages().ByName(\"A\")\n\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: int32(123),\n\t\t\tprintable:  int32(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"int32\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: int32(123),\n\t\t\tprintable:  int32(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"sint32\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: uint32(123),\n\t\t\tprintable:  uint32(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"uint32\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: uint32(123),\n\t\t\tprintable:  uint32(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"fixed32\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: int32(123),\n\t\t\tprintable:  int32(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"sfixed32\")))\n\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: int64(123),\n\t\t\tprintable:  int64(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"int64\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: int64(123),\n\t\t\tprintable:  int64(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"sint64\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: uint64(123),\n\t\t\tprintable:  uint64(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"uint64\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: uint64(123),\n\t\t\tprintable:  uint64(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"fixed64\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: int64(123),\n\t\t\tprintable:  int64(123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"sfixed64\")))\n\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: float32(123.123),\n\t\t\tprintable:  float32(123.123),\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"float\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: 123.123,\n\t\t\tprintable:  123.123,\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"double\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: true,\n\t\t\tprintable:  true,\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"bool\")))\n\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: \"xyz\",\n\t\t\tprintable:  `\"xyz\"`,\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"string\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: \"xyz\",\n\t\t\tprintable:  \"[0x78,0x79,0x7A]\",\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"bytes\")))\n\tassert.Equal(t,\n\t\tfieldDefault{\n\t\t\tcomparable: int32(123),\n\t\t\tprintable:  \"Enum.V123\",\n\t\t},\n\t\tgetDefault(msg.Fields().ByName(\"enum\")))\n\n\tcannotHaveDefault := map[string]struct{}{\n\t\t\"message\":  {},\n\t\t\"repeated\": {},\n\t\t\"map\":      {},\n\t}\n\tfor i := range msg.Fields().Len() {\n\t\tfield := msg.Fields().Get(i)\n\t\tif _, nope := cannotHaveDefault[string(field.Name())]; nope {\n\t\t\tassert.False(t, canHaveDefault(field))\n\t\t} else {\n\t\t\tassert.True(t, canHaveDefault(field))\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/lint.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/bufcheckopt\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/protoversion\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nvar (\n\t// HandleLintCommentEnum is a handle function.\n\tHandleLintCommentEnum = bufcheckserverutil.NewLintEnumRuleHandler(handleLintCommentEnum)\n\t// HandleLintCommentEnumValue is a handle function.\n\tHandleLintCommentEnumValue = bufcheckserverutil.NewLintEnumValueRuleHandler(handleLintCommentEnumValue)\n\t// HandleLintCommentField is a handle function.\n\tHandleLintCommentField = bufcheckserverutil.NewLintFieldRuleHandler(handleLintCommentField)\n\t// HandleLintCommentMessage is a handle function.\n\tHandleLintCommentMessage = bufcheckserverutil.NewLintMessageRuleHandler(handleLintCommentMessage)\n\t// HandleLintCommentOneof is a handle function.\n\tHandleLintCommentOneof = bufcheckserverutil.NewLintOneofRuleHandler(handleLintCommentOneof)\n\t// HandleLintCommentService is a handle function.\n\tHandleLintCommentService = bufcheckserverutil.NewLintServiceRuleHandler(handleLintCommentService)\n\t// HandleLintCommentRPC is a handle function.\n\tHandleLintCommentRPC = bufcheckserverutil.NewLintMethodRuleHandler(handleLintCommentRPC)\n)\n\nfunc handleLintCommentEnum(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tvalue bufprotosource.Enum,\n) error {\n\treturn handleLintCommentNamedDescriptor(responseWriter, request, value, \"Enum\")\n}\n\nfunc handleLintCommentEnumValue(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tvalue bufprotosource.EnumValue,\n) error {\n\treturn handleLintCommentNamedDescriptor(responseWriter, request, value, \"Enum value\")\n}\n\nfunc handleLintCommentField(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tvalue bufprotosource.Field,\n) error {\n\tif value.ParentMessage() != nil && value.ParentMessage().IsMapEntry() {\n\t\t// Don't handle synthetic fields for map entries. They have no comments.\n\t\treturn nil\n\t}\n\tif value.Type() == descriptorpb.FieldDescriptorProto_TYPE_GROUP {\n\t\t// Group fields also have no comments: comments in source get\n\t\t// attributed to the nested message, not the field.\n\t\treturn nil\n\t}\n\treturn handleLintCommentNamedDescriptor(responseWriter, request, value, \"Field\")\n}\n\nfunc handleLintCommentMessage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tvalue bufprotosource.Message,\n) error {\n\tif value.IsMapEntry() {\n\t\t// Don't handle synthetic map entries. They have no comments.\n\t\treturn nil\n\t}\n\treturn handleLintCommentNamedDescriptor(responseWriter, request, value, \"Message\")\n}\n\nfunc handleLintCommentOneof(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tvalue bufprotosource.Oneof,\n) error {\n\toneofDescriptor, err := value.AsDescriptor()\n\tif err == nil && oneofDescriptor.IsSynthetic() {\n\t\t// Don't handle synthetic oneofs (for proto3-optional fields). They have no comments.\n\t\treturn nil\n\t}\n\treturn handleLintCommentNamedDescriptor(responseWriter, request, value, \"Oneof\")\n}\n\nfunc handleLintCommentRPC(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tvalue bufprotosource.Method,\n) error {\n\treturn handleLintCommentNamedDescriptor(responseWriter, request, value, \"RPC\")\n}\n\nfunc handleLintCommentService(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tvalue bufprotosource.Service,\n) error {\n\treturn handleLintCommentNamedDescriptor(responseWriter, request, value, \"Service\")\n}\n\nfunc handleLintCommentNamedDescriptor(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tnamedDescriptor bufprotosource.NamedDescriptor,\n\ttypeName string,\n) error {\n\tlocation := namedDescriptor.Location()\n\tif location == nil {\n\t\t// this will magically skip map entry fields as well as a side-effect, although originally unintended\n\t\treturn nil\n\t}\n\t// Note that this does result in us parsing the comment excludes on every call to the rule.\n\t// This is theoretically inefficient, but shouldn't have any real world impact. The alternative\n\t// is doing a custom parse of all the options we expect within bufcheckopt, and attaching\n\t// this result to the bufcheckserverutil.Request, which gets us even further from the bufplugin-go\n\t// SDK. We want to do what is native as much as possible. If this is a real performance problem,\n\t// we can update in the future.\n\tcommentExcludes, err := bufcheckopt.GetCommentExcludes(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !validLeadingComment(commentExcludes, location.LeadingComments()) {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tlocation,\n\t\t\tnil,\n\t\t\tnamedDescriptor.File().Path(),\n\t\t\t\"%s %q should have a non-empty comment for documentation.\",\n\t\t\ttypeName,\n\t\t\tnamedDescriptor.Name(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintDirectorySamePackage is a handle function.\nvar HandleLintDirectorySamePackage = bufcheckserverutil.NewLintDirPathToFilesRuleHandler(handleLintDirectorySamePackage)\n\nfunc handleLintDirectorySamePackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tdirPath string,\n\tdirFiles []bufprotosource.File,\n) error {\n\tpkgMap := make(map[string]struct{})\n\tfor _, file := range dirFiles {\n\t\t// works for no package set as this will result in \"\" which is a valid map key\n\t\tpkgMap[file.Package()] = struct{}{}\n\t}\n\tif len(pkgMap) > 1 {\n\t\tvar messagePrefix string\n\t\tif _, ok := pkgMap[\"\"]; ok {\n\t\t\tdelete(pkgMap, \"\")\n\t\t\tif len(pkgMap) > 1 {\n\t\t\t\tmessagePrefix = fmt.Sprintf(\"Multiple packages %q and file with no package\", strings.Join(xslices.MapKeysToSortedSlice(pkgMap), \",\"))\n\t\t\t} else {\n\t\t\t\t// Join works with only one element as well by adding no comma\n\t\t\t\tmessagePrefix = fmt.Sprintf(\"Package %q and file with no package\", strings.Join(xslices.MapKeysToSortedSlice(pkgMap), \",\"))\n\t\t\t}\n\t\t} else {\n\t\t\tmessagePrefix = fmt.Sprintf(\"Multiple packages %q\", strings.Join(xslices.MapKeysToSortedSlice(pkgMap), \",\"))\n\t\t}\n\t\tfor _, file := range dirFiles {\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tfile.PackageLocation(),\n\t\t\t\tnil,\n\t\t\t\tfile.Path(),\n\t\t\t\t\"%s detected within directory %q.\",\n\t\t\t\tmessagePrefix,\n\t\t\t\tdirPath,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleLintEnumNoAllowAlias is a handle function.\nvar HandleLintEnumNoAllowAlias = bufcheckserverutil.NewLintEnumRuleHandler(handleLintEnumNoAllowAlias)\n\nfunc handleLintEnumNoAllowAlias(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n) error {\n\tif enum.AllowAlias() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tenum.AllowAliasLocation(),\n\t\t\tnil,\n\t\t\tenum.File().Path(),\n\t\t\t`Enum option \"allow_alias\" on enum %q must be false.`,\n\t\t\tenum.Name(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintEnumPascalCase is a handle function.\nvar HandleLintEnumPascalCase = bufcheckserverutil.NewLintEnumRuleHandler(handleLintEnumPascalCase)\n\nfunc handleLintEnumPascalCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n) error {\n\tname := enum.Name()\n\texpectedName := xstrings.ToPascalCase(name)\n\tif name != expectedName {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tenum.NameLocation(),\n\t\t\tnil,\n\t\t\tenum.File().Path(),\n\t\t\t\"Enum name %q should be PascalCase, such as %q.\",\n\t\t\tname,\n\t\t\texpectedName,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintEnumFirstValueZero is a handle function.\nvar HandleLintEnumFirstValueZero = bufcheckserverutil.NewLintEnumRuleHandler(handleLintEnumFirstValueZero)\n\nfunc handleLintEnumFirstValueZero(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tenum bufprotosource.Enum,\n) error {\n\tif values := enum.Values(); len(values) > 0 {\n\t\tif firstEnumValue := values[0]; firstEnumValue.Number() != 0 {\n\t\t\t// proto3 compilation references the number\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tfirstEnumValue.NumberLocation(),\n\t\t\t\tnil,\n\t\t\t\tfirstEnumValue.File().Path(),\n\t\t\t\t\"First enum value %q should have a numeric value of 0\",\n\t\t\t\tfirstEnumValue.Name(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleLintEnumValuePrefix is a handle function.\nvar HandleLintEnumValuePrefix = bufcheckserverutil.NewLintEnumValueRuleHandler(handleLintEnumValuePrefix)\n\nfunc handleLintEnumValuePrefix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tenumValue bufprotosource.EnumValue,\n) error {\n\tname := enumValue.Name()\n\texpectedPrefix := fieldToUpperSnakeCase(enumValue.Enum().Name()) + \"_\"\n\tif !strings.HasPrefix(name, expectedPrefix) {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tenumValue.NameLocation(),\n\t\t\tnil,\n\t\t\tenumValue.File().Path(),\n\t\t\t\"Enum value name %q should be prefixed with %q.\",\n\t\t\tname,\n\t\t\texpectedPrefix,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintEnumValueUpperSnakeCase is a handle function.\nvar HandleLintEnumValueUpperSnakeCase = bufcheckserverutil.NewLintEnumValueRuleHandler(handleLintEnumValueUpperSnakeCase)\n\nfunc handleLintEnumValueUpperSnakeCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tenumValue bufprotosource.EnumValue,\n) error {\n\tname := enumValue.Name()\n\texpectedName := fieldToUpperSnakeCase(name)\n\tif name != expectedName {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tenumValue.NameLocation(),\n\t\t\tnil,\n\t\t\tenumValue.File().Path(),\n\t\t\t\"Enum value name %q should be UPPER_SNAKE_CASE, such as %q.\",\n\t\t\tname,\n\t\t\texpectedName,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintEnumZeroValueSuffix is a handle function.\nvar HandleLintEnumZeroValueSuffix = bufcheckserverutil.NewLintEnumValueRuleHandler(handleLintEnumZeroValueSuffix)\n\nfunc handleLintEnumZeroValueSuffix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tenumValue bufprotosource.EnumValue,\n) error {\n\tsuffix, err := bufcheckopt.GetEnumZeroValueSuffix(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\trequest.Options()\n\tif enumValue.Number() != 0 {\n\t\treturn nil\n\t}\n\tname := enumValue.Name()\n\tif !strings.HasSuffix(name, suffix) {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tenumValue.NameLocation(),\n\t\t\tnil,\n\t\t\tenumValue.File().Path(),\n\t\t\t\"Enum zero value name %q should be suffixed with %q.\",\n\t\t\tname,\n\t\t\tsuffix,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintFieldLowerSnakeCase is a handle function.\nvar HandleLintFieldLowerSnakeCase = bufcheckserverutil.NewLintFieldRuleHandler(handleLintFieldLowerSnakeCase)\n\nfunc handleLintFieldLowerSnakeCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n) error {\n\tmessage := field.ParentMessage()\n\tif message != nil && message.IsMapEntry() {\n\t\t// this check should always pass anyways but just in case\n\t\treturn nil\n\t}\n\tname := field.Name()\n\texpectedName := fieldToLowerSnakeCase(name)\n\tif name != expectedName {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfield.NameLocation(),\n\t\t\tnil,\n\t\t\tfield.File().Path(),\n\t\t\t\"Field name %q should be lower_snake_case, such as %q.\",\n\t\t\tname,\n\t\t\texpectedName,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintFieldNoDescriptor is a handle function.\nvar HandleLintFieldNoDescriptor = bufcheckserverutil.NewLintFieldRuleHandler(handleLintFieldNoDescriptor)\n\nfunc handleLintFieldNoDescriptor(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n) error {\n\tname := field.Name()\n\tif strings.ToLower(strings.Trim(name, \"_\")) == \"descriptor\" {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfield.NameLocation(),\n\t\t\tnil,\n\t\t\tfield.File().Path(),\n\t\t\t`Field name %q cannot be any capitalization of \"descriptor\" with any number of prefix or suffix underscores.`,\n\t\t\tname,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintFieldNotRequired is a handle function.\nvar HandleLintFieldNotRequired = bufcheckserverutil.NewLintFieldRuleHandler(handleLintFieldNotRequired)\n\nfunc handleLintFieldNotRequired(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfield bufprotosource.Field,\n) error {\n\tfieldDescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// We use the protoreflect field descriptor to handle editions, where the\n\t// field is set to required using special \"features\" options, instead of the\n\t// label on the descriptor proto.\n\tif fieldDescriptor.Cardinality() == protoreflect.Required {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfield.NameLocation(),\n\t\t\tnil,\n\t\t\tfield.File().Path(),\n\t\t\t`Field named %q should not be required.`,\n\t\t\tfield.Name(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintFileLowerSnakeCase is a handle function.\nvar HandleLintFileLowerSnakeCase = bufcheckserverutil.NewLintFileRuleHandler(handleLintFileLowerSnakeCase)\n\nfunc handleLintFileLowerSnakeCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n) error {\n\tfilename := file.Path()\n\tbase := normalpath.Base(filename)\n\text := normalpath.Ext(filename)\n\tbaseWithoutExt := strings.TrimSuffix(base, ext)\n\texpectedBaseWithoutExt := xstrings.ToLowerSnakeCase(baseWithoutExt)\n\tif baseWithoutExt != expectedBaseWithoutExt {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tfilename,\n\t\t\t`Filename %q should be lower_snake_case%s, such as \"%s%s\".`,\n\t\t\tbase,\n\t\t\text,\n\t\t\texpectedBaseWithoutExt,\n\t\t\text,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintImportNoPublic is a handle function.\nvar HandleLintImportNoPublic = bufcheckserverutil.NewLintFileImportRuleHandler(handleLintImportNoPublic)\n\nfunc handleLintImportNoPublic(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfileImport bufprotosource.FileImport,\n) error {\n\tif fileImport.IsPublic() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfileImport.Location(),\n\t\t\tnil,\n\t\t\tfileImport.File().Path(),\n\t\t\t`Import %q must not be public.`,\n\t\t\tfileImport.Import(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintImportUsed is a handle function.\nvar HandleLintImportUsed = bufcheckserverutil.NewLintFileImportRuleHandler(handleLintImportUsed)\n\nfunc handleLintImportUsed(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfileImport bufprotosource.FileImport,\n) error {\n\tif fileImport.IsUnused() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfileImport.Location(),\n\t\t\tnil,\n\t\t\tfileImport.File().Path(),\n\t\t\t`Import %q is unused.`,\n\t\t\tfileImport.Import(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintMessagePascalCase is a handle function.\nvar HandleLintMessagePascalCase = bufcheckserverutil.NewLintMessageRuleHandler(handleLintMessagePascalCase)\n\nfunc handleLintMessagePascalCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tmessage bufprotosource.Message,\n) error {\n\tif message.IsMapEntry() {\n\t\t// map entries should always be pascal case but we don't want to check them anyways\n\t\treturn nil\n\t}\n\tname := message.Name()\n\texpectedName := xstrings.ToPascalCase(name)\n\tif name != expectedName {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmessage.NameLocation(),\n\t\t\tnil,\n\t\t\tmessage.File().Path(),\n\t\t\t\"Message name %q should be PascalCase, such as %q.\",\n\t\t\tname,\n\t\t\texpectedName,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintOneofLowerSnakeCase is a handle function.\nvar HandleLintOneofLowerSnakeCase = bufcheckserverutil.NewLintOneofRuleHandler(handleLintOneofLowerSnakeCase)\n\nfunc handleLintOneofLowerSnakeCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\toneof bufprotosource.Oneof,\n) error {\n\tname := oneof.Name()\n\texpectedName := fieldToLowerSnakeCase(name)\n\tif name != expectedName {\n\t\t// if this is an implicit oneof for a proto3 optional field, do not error\n\t\t// https://github.com/protocolbuffers/protobuf/blob/master/docs/implementing_proto3_presence.md\n\t\tif fields := oneof.Fields(); len(fields) == 1 {\n\t\t\tif fields[0].Proto3Optional() {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\toneof.NameLocation(),\n\t\t\tnil,\n\t\t\toneof.File().Path(),\n\t\t\t\"Oneof name %q should be lower_snake_case, such as %q.\",\n\t\t\tname,\n\t\t\texpectedName,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintPackageDefined is a handle function.\nvar HandleLintPackageDefined = bufcheckserverutil.NewLintFileRuleHandler(handleLintPackageDefined)\n\nfunc handleLintPackageDefined(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n) error {\n\tif file.Package() == \"\" {\n\t\tresponseWriter.AddAnnotation(\n\t\t\tcheck.WithFileName(file.Path()),\n\t\t\tcheck.WithMessage(\"Files must have a package defined.\"),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintPackageDirectoryMatch is a handle function.\nvar HandleLintPackageDirectoryMatch = bufcheckserverutil.NewLintFileRuleHandler(handleLintPackageDirectoryMatch)\n\nfunc handleLintPackageDirectoryMatch(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n) error {\n\tpkg := file.Package()\n\tif pkg == \"\" {\n\t\treturn nil\n\t}\n\texpectedDirPath := strings.ReplaceAll(pkg, \".\", \"/\")\n\tdirPath := normalpath.Dir(file.Path())\n\t// need to check case where in root relative directory and no package defined\n\t// this should be valid although if SENSIBLE is turned on this will be invalid\n\tif dirPath != expectedDirPath {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfile.PackageLocation(),\n\t\t\tnil,\n\t\t\tfile.Path(),\n\t\t\t`Files with package %q must be within a directory \"%s\" relative to root but were in directory \"%s\".`,\n\t\t\tpkg,\n\t\t\tnormalpath.Unnormalize(expectedDirPath),\n\t\t\tnormalpath.Unnormalize(dirPath),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintPackageLowerSnakeCase is a handle function.\nvar HandleLintPackageLowerSnakeCase = bufcheckserverutil.NewLintFileRuleHandler(handleLintPackageLowerSnakeCase)\n\nfunc handleLintPackageLowerSnakeCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n) error {\n\tpkg := file.Package()\n\tif pkg == \"\" {\n\t\treturn nil\n\t}\n\tsplit := strings.Split(pkg, \".\")\n\tfor i, elem := range split {\n\t\tsplit[i] = xstrings.ToLowerSnakeCase(elem)\n\t}\n\texpectedPkg := strings.Join(split, \".\")\n\tif pkg != expectedPkg {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfile.PackageLocation(),\n\t\t\tnil,\n\t\t\tfile.Path(),\n\t\t\t\"Package name %q should be lower_snake.case, such as %q.\",\n\t\t\tpkg,\n\t\t\texpectedPkg,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintPackageNoImportCycle is a handle function.\n//\n// Note that imports are not skipped via the helper, as we want to detect import cycles\n// even if they are within imports, and report on them. If a non-import is part of an\n// import cycle, we report it, even if the import cycle includes imports in it.\nvar HandleLintPackageNoImportCycle = bufcheckserverutil.NewRuleHandler(handleLintPackageNoImportCycle)\n\nfunc handleLintPackageNoImportCycle(\n\t_ context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\tfiles := request.ProtosourceFiles()\n\tpackageToDirectlyImportedPackageToFileImports, err := bufprotosource.PackageToDirectlyImportedPackageToFileImports(files...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// This is way more algorithmically complex than it needs to be.\n\t//\n\t// We're doing a DFS starting at each package. What we should do is start from any package,\n\t// do the DFS and keep track of the packages hit, and then don't ever do DFS from a given\n\t// package twice. The problem is is that with the current janky package -> direct -> file imports\n\t// setup, we would then end up with error messages like \"import cycle: a -> b -> c -> b\", and\n\t// attach the error message to a file with package a, and we want to just print \"b -> c -> b\".\n\t// So to get this to market, we just do a DFS from each package.\n\t//\n\t// This may prove to be too expensive but early testing say it is not so far.\n\tfor pkg := range packageToDirectlyImportedPackageToFileImports {\n\t\t// Can equal \"\" per the function signature of PackageToDirectlyImportedPackageToFileImports\n\t\tif pkg == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\t// Go one deep in the potential import cycle so that we can get the file imports\n\t\t// we want to potentially attach errors to.\n\t\t//\n\t\t// We know that pkg is never equal to directlyImportedPackage due to the signature\n\t\t// of PackageToDirectlyImportedPackageToFileImports.\n\t\tfor directlyImportedPackage, fileImports := range packageToDirectlyImportedPackageToFileImports[pkg] {\n\t\t\t// Can equal \"\" per the function signature of PackageToDirectlyImportedPackageToFileImports\n\t\t\tif directlyImportedPackage == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif importCycle := getImportCycleIfExists(\n\t\t\t\tdirectlyImportedPackage,\n\t\t\t\tpackageToDirectlyImportedPackageToFileImports,\n\t\t\t\tmap[string]struct{}{\n\t\t\t\t\tpkg: {},\n\t\t\t\t},\n\t\t\t\t[]string{\n\t\t\t\t\tpkg,\n\t\t\t\t},\n\t\t\t); len(importCycle) > 0 {\n\t\t\t\tfor _, fileImport := range fileImports {\n\t\t\t\t\t// We used newFilesWithImportsCheckFunc, meaning that we did not skip imports.\n\t\t\t\t\t// We do not want to report errors on imports.\n\t\t\t\t\tif fileImport.File().IsImport() {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\tfileImport.Location(),\n\t\t\t\t\t\tnil,\n\t\t\t\t\t\tfileImport.File().Path(),\n\t\t\t\t\t\t`Package import cycle: %s`,\n\t\t\t\t\t\tstrings.Join(importCycle, ` -> `),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleLintPackageSameDirectory is a handle function.\nvar HandleLintPackageSameDirectory = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSameDirectory)\n\nfunc handleLintPackageSameDirectory(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\tdirMap := make(map[string]struct{})\n\tfor _, file := range pkgFiles {\n\t\tdirMap[normalpath.Dir(file.Path())] = struct{}{}\n\t}\n\tif len(dirMap) > 1 {\n\t\tdirs := xslices.MapKeysToSortedSlice(dirMap)\n\t\tfor _, file := range pkgFiles {\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tfile.PackageLocation(),\n\t\t\t\tnil,\n\t\t\t\tfile.Path(),\n\t\t\t\t\"Multiple directories %q contain files with package %q.\",\n\t\t\t\tstrings.Join(dirs, \",\"),\n\t\t\t\tpkg,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nvar (\n\t// HandleLintPackageSameCsharpNamespace is a handle function.\n\tHandleLintPackageSameCsharpNamespace = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSameCsharpNamespace)\n\t// HandleLintPackageSameGoPackage is a handle function.\n\tHandleLintPackageSameGoPackage = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSameGoPackage)\n\t// HandleLintPackageSameJavaMultipleFiles is a handle function.\n\tHandleLintPackageSameJavaMultipleFiles = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSameJavaMultipleFiles)\n\t// HandleLintPackageSameJavaPackage is a handle function.\n\tHandleLintPackageSameJavaPackage = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSameJavaPackage)\n\t// HandleLintPackageSamePhpNamespace is a handle function.\n\tHandleLintPackageSamePhpNamespace = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSamePhpNamespace)\n\t// HandleLintPackageSameRubyPackage is a handle function.\n\tHandleLintPackageSameRubyPackage = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSameRubyPackage)\n\t// HandleLintPackageSameSwiftPrefix is a handle function.\n\tHandleLintPackageSameSwiftPrefix = bufcheckserverutil.NewLintPackageToFilesRuleHandler(handleLintPackageSameSwiftPrefix)\n)\n\nfunc handleLintPackageSameCsharpNamespace(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\treturn handleLintPackageSameOptionValue(\n\t\tresponseWriter,\n\t\tpkg,\n\t\tpkgFiles,\n\t\tbufprotosource.File.CsharpNamespace,\n\t\tbufprotosource.File.CsharpNamespaceLocation,\n\t\t\"csharp_namespace\",\n\t)\n}\n\nfunc handleLintPackageSameGoPackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\treturn handleLintPackageSameOptionValue(\n\t\tresponseWriter,\n\t\tpkg,\n\t\tpkgFiles,\n\t\tbufprotosource.File.GoPackage,\n\t\tbufprotosource.File.GoPackageLocation,\n\t\t\"go_package\",\n\t)\n}\n\nfunc handleLintPackageSameJavaMultipleFiles(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\treturn handleLintPackageSameOptionValue(\n\t\tresponseWriter,\n\t\tpkg,\n\t\tpkgFiles,\n\t\tfunc(file bufprotosource.File) string {\n\t\t\t// Return empty string when the option is not present, instead of returning a \"true\" or \"false\" value.\n\t\t\tif fileOptions := file.FileDescriptor().GetOptions(); fileOptions == nil || fileOptions.JavaMultipleFiles == nil {\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t\treturn strconv.FormatBool(file.JavaMultipleFiles())\n\t\t},\n\t\tbufprotosource.File.JavaMultipleFilesLocation,\n\t\t\"java_multiple_files\",\n\t)\n}\n\nfunc handleLintPackageSameJavaPackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\treturn handleLintPackageSameOptionValue(\n\t\tresponseWriter,\n\t\tpkg,\n\t\tpkgFiles,\n\t\tbufprotosource.File.JavaPackage,\n\t\tbufprotosource.File.JavaPackageLocation,\n\t\t\"java_package\",\n\t)\n}\n\nfunc handleLintPackageSamePhpNamespace(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\treturn handleLintPackageSameOptionValue(\n\t\tresponseWriter,\n\t\tpkg,\n\t\tpkgFiles,\n\t\tbufprotosource.File.PhpNamespace,\n\t\tbufprotosource.File.PhpNamespaceLocation,\n\t\t\"php_namespace\",\n\t)\n}\n\nfunc handleLintPackageSameRubyPackage(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\treturn handleLintPackageSameOptionValue(\n\t\tresponseWriter,\n\t\tpkg,\n\t\tpkgFiles,\n\t\tbufprotosource.File.RubyPackage,\n\t\tbufprotosource.File.RubyPackageLocation,\n\t\t\"ruby_package\",\n\t)\n}\n\nfunc handleLintPackageSameSwiftPrefix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n) error {\n\treturn handleLintPackageSameOptionValue(\n\t\tresponseWriter,\n\t\tpkg,\n\t\tpkgFiles,\n\t\tbufprotosource.File.SwiftPrefix,\n\t\tbufprotosource.File.SwiftPrefixLocation,\n\t\t\"swift_prefix\",\n\t)\n}\n\nfunc handleLintPackageSameOptionValue(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\tpkg string,\n\tpkgFiles []bufprotosource.File,\n\tgetFileOptionValue func(bufprotosource.File) string,\n\tgetFileOptionLocation func(bufprotosource.File) bufprotosource.Location,\n\tname string,\n) error {\n\toptionValueMap := make(map[string]struct{})\n\tfor _, file := range pkgFiles {\n\t\toptionValueMap[getFileOptionValue(file)] = struct{}{}\n\t}\n\tif len(optionValueMap) > 1 {\n\t\t_, noOptionValue := optionValueMap[\"\"]\n\t\tdelete(optionValueMap, \"\")\n\t\toptionValues := xslices.MapKeysToSortedSlice(optionValueMap)\n\t\tfor _, file := range pkgFiles {\n\t\t\tvar message string\n\t\t\tif noOptionValue {\n\t\t\t\tmessage = fmt.Sprintf(\n\t\t\t\t\t\"Files in package %q have both values %q and no value for option %q and all values must be equal.\",\n\t\t\t\t\tpkg,\n\t\t\t\t\tstrings.Join(optionValues, \",\"),\n\t\t\t\t\tname,\n\t\t\t\t)\n\t\t\t} else {\n\t\t\t\tmessage = fmt.Sprintf(\n\t\t\t\t\t\"Files in package %q have multiple values %q for option %q and all values must be equal.\",\n\t\t\t\t\tpkg,\n\t\t\t\t\tstrings.Join(optionValues, \",\"),\n\t\t\t\t\tname,\n\t\t\t\t)\n\t\t\t}\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\tgetFileOptionLocation(file),\n\t\t\t\tnil,\n\t\t\t\tfile.Path(),\n\t\t\t\tmessage,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleLintPackageVersionSuffix is a handle function.\nvar HandleLintPackageVersionSuffix = bufcheckserverutil.NewLintFileRuleHandler(handleLintPackageVersionSuffix)\n\nfunc handleLintPackageVersionSuffix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n) error {\n\tpkg := file.Package()\n\tif pkg == \"\" {\n\t\treturn nil\n\t}\n\tif _, ok := protoversion.NewPackageVersionForPackage(pkg); !ok {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tfile.PackageLocation(),\n\t\t\tnil,\n\t\t\tfile.Path(),\n\t\t\t`Package name %q should be suffixed with a correctly formed version, such as %q.`,\n\t\t\tpkg,\n\t\t\tpkg+\".v1\",\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintProtovalidate is a handle function.\nvar HandleLintProtovalidate = bufcheckserverutil.NewRuleHandler(handleLintProtovalidate)\n\n// handleLintProtovalidate runs checks all predefined rules, message rules, and field rules.\n//\n// NOTE: Oneofs also have protovalidate support, but they only have a \"required\" field, so nothing to lint.\nfunc handleLintProtovalidate(\n\tctx context.Context,\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n) error {\n\t// TODO: addAnnotationFunc is used to set add annotations to responseWriter. A follow-up\n\t// will be made to refactor the code so we no longer need this.\n\taddAnnotationFunc := func(\n\t\tdescriptor bufprotosource.Descriptor,\n\t\tlocation bufprotosource.Location,\n\t\t_ []bufprotosource.Location,\n\t\tformat string,\n\t\targs ...any,\n\t) {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tlocation,\n\t\t\tnil,\n\t\t\tdescriptor.File().Path(),\n\t\t\tformat,\n\t\t\targs...,\n\t\t)\n\t}\n\t// We create a new extension resolver using all of the files from the request, including\n\t// import files. This is because there can be a case where a non-import file uses a predefined\n\t// rule from an imported file.\n\textensionResolver, err := protoencoding.NewResolver(\n\t\txslices.Map(\n\t\t\trequest.ProtosourceFiles(),\n\t\t\tfunc(protosourceFile bufprotosource.File) protodescriptor.FileDescriptor {\n\t\t\t\treturn protosourceFile.FileDescriptor()\n\t\t\t},\n\t\t)...,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// However, we only want to check non-import files, so we can use NewLintMessageRuleHandler\n\t// and NewLintFieldRuleHandler utils to check messages and fields respectively.\n\tif err := bufcheckserverutil.NewLintMessageRuleHandler(\n\t\tfunc(\n\t\t\t_ bufcheckserverutil.ResponseWriter,\n\t\t\t_ bufcheckserverutil.Request,\n\t\t\tmessage bufprotosource.Message,\n\t\t) error {\n\t\t\treturn buflintvalidate.CheckMessage(addAnnotationFunc, message)\n\t\t},\n\t\t// The responseWriter is being passed in through the shared addAnnotationFunc, so we\n\t\t// do not pass in responseWriter again. This should be addressed in a refactor.\n\t).Handle(ctx, nil, request); err != nil {\n\t\treturn err\n\t}\n\treturn bufcheckserverutil.NewLintFieldRuleHandler(\n\t\tfunc(\n\t\t\t_ bufcheckserverutil.ResponseWriter,\n\t\t\t_ bufcheckserverutil.Request,\n\t\t\tfield bufprotosource.Field,\n\t\t) error {\n\t\t\tif err := buflintvalidate.CheckPredefinedRuleExtension(addAnnotationFunc, field, extensionResolver); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn buflintvalidate.CheckField(addAnnotationFunc, field, extensionResolver)\n\t\t},\n\t\t// The responseWriter is being passed in through the shared addAnnotationFunc, so we\n\t\t// do not pass in responseWriter again. This should be addressed in a refactor.\n\t).Handle(ctx, nil, request)\n}\n\n// HandleLintRPCNoClientStreaming is a handle function.\nvar HandleLintRPCNoClientStreaming = bufcheckserverutil.NewLintMethodRuleHandler(handleLintRPCNoClientStreaming)\n\nfunc handleLintRPCNoClientStreaming(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n) error {\n\tif method.ClientStreaming() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.Location(),\n\t\t\tnil,\n\t\t\tmethod.File().Path(),\n\t\t\t\"RPC %q is client streaming.\",\n\t\t\tmethod.Name(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintRPCNoServerStreaming is a handle function.\nvar HandleLintRPCNoServerStreaming = bufcheckserverutil.NewLintMethodRuleHandler(handleLintRPCNoServerStreaming)\n\nfunc handleLintRPCNoServerStreaming(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n) error {\n\tif method.ServerStreaming() {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.Location(),\n\t\t\tnil,\n\t\t\tmethod.File().Path(),\n\t\t\t\"RPC %q is server streaming.\",\n\t\t\tmethod.Name(),\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintRPCPascalCase is a handle function.\nvar HandleLintRPCPascalCase = bufcheckserverutil.NewLintMethodRuleHandler(handleLintRPCPascalCase)\n\nfunc handleLintRPCPascalCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n) error {\n\tname := method.Name()\n\texpectedName := xstrings.ToPascalCase(name)\n\tif name != expectedName {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.NameLocation(),\n\t\t\tnil,\n\t\t\tmethod.File().Path(),\n\t\t\t\"RPC name %q should be PascalCase, such as %q.\",\n\t\t\tname,\n\t\t\texpectedName,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintRPCRequestResponseUnique is a handle function.\nvar HandleLintRPCRequestResponseUnique = bufcheckserverutil.NewLintFilesRuleHandler(handleLintRPCRequestResponseUnique)\n\nfunc handleLintRPCRequestResponseUnique(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tfiles []bufprotosource.File,\n) error {\n\tallowSameRequestResponse, err := bufcheckopt.GetRPCAllowSameRequestResponse(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\tallowGoogleProtobufEmptyRequests, err := bufcheckopt.GetRPCAllowGoogleProtobufEmptyRequests(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\tallowGoogleProtobufEmptyResponses, err := bufcheckopt.GetRPCAllowGoogleProtobufEmptyResponses(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\tallFullNameToMethod, err := bufprotosource.FullNameToMethod(files...)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// first check if any requests or responses are the same\n\t// if not, we can treat requests and responses equally for checking if more than\n\t// one method uses a type\n\tif !allowSameRequestResponse {\n\t\tfor _, method := range allFullNameToMethod {\n\t\t\tif method.InputTypeName() == method.OutputTypeName() {\n\t\t\t\t// if we allow both empty requests and responses, we do not want to add a FileAnnotation\n\t\t\t\tif !(method.InputTypeName() == \"google.protobuf.Empty\" && allowGoogleProtobufEmptyRequests && allowGoogleProtobufEmptyResponses) {\n\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\tmethod.Location(),\n\t\t\t\t\t\tnil,\n\t\t\t\t\t\tmethod.File().Path(),\n\t\t\t\t\t\t\"RPC %q has the same type %q for the request and response.\",\n\t\t\t\t\t\tmethod.Name(),\n\t\t\t\t\t\tmethod.InputTypeName(),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// we have now added errors for the same request and response type if applicable\n\t// we can now check methods for unique usage of a given type\n\trequestResponseTypeToFullNameToMethod := make(map[string]map[string]bufprotosource.Method)\n\tfor fullName, method := range allFullNameToMethod {\n\t\tfor _, requestResponseType := range []string{method.InputTypeName(), method.OutputTypeName()} {\n\t\t\tfullNameToMethod, ok := requestResponseTypeToFullNameToMethod[requestResponseType]\n\t\t\tif !ok {\n\t\t\t\tfullNameToMethod = make(map[string]bufprotosource.Method)\n\t\t\t\trequestResponseTypeToFullNameToMethod[requestResponseType] = fullNameToMethod\n\t\t\t}\n\t\t\tfullNameToMethod[fullName] = method\n\t\t}\n\t}\n\tfor requestResponseType, fullNameToMethod := range requestResponseTypeToFullNameToMethod {\n\t\t// only this method uses this request or response type, no issue\n\t\tif len(fullNameToMethod) == 1 {\n\t\t\tcontinue\n\t\t}\n\t\t// if the request or response type is google.protobuf.Empty and we allow this for requests or responses,\n\t\t// we have to do a harder check\n\t\tif requestResponseType == \"google.protobuf.Empty\" && (allowGoogleProtobufEmptyRequests || allowGoogleProtobufEmptyResponses) {\n\t\t\t// if both requests and responses can be google.protobuf.Empty, then do not add any error\n\t\t\t// else, we check\n\t\t\tif !(allowGoogleProtobufEmptyRequests && allowGoogleProtobufEmptyResponses) {\n\t\t\t\t// inside this if statement, one of allowGoogleProtobufEmptyRequests or allowGoogleProtobufEmptyResponses is true\n\t\t\t\tvar requestMethods []bufprotosource.Method\n\t\t\t\tvar responseMethods []bufprotosource.Method\n\t\t\t\tfor _, method := range fullNameToMethod {\n\t\t\t\t\tif method.InputTypeName() == \"google.protobuf.Empty\" {\n\t\t\t\t\t\trequestMethods = append(requestMethods, method)\n\t\t\t\t\t}\n\t\t\t\t\tif method.OutputTypeName() == \"google.protobuf.Empty\" {\n\t\t\t\t\t\tresponseMethods = append(responseMethods, method)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !allowGoogleProtobufEmptyRequests && len(requestMethods) > 1 {\n\t\t\t\t\tfor _, method := range requestMethods {\n\t\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\t\tmethod.Location(),\n\t\t\t\t\t\t\tnil,\n\t\t\t\t\t\t\tmethod.File().Path(),\n\t\t\t\t\t\t\t\"%q is used as the request for multiple RPCs.\",\n\t\t\t\t\t\t\trequestResponseType,\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !allowGoogleProtobufEmptyResponses && len(responseMethods) > 1 {\n\t\t\t\t\tfor _, method := range responseMethods {\n\t\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\t\tmethod.Location(),\n\t\t\t\t\t\t\tnil,\n\t\t\t\t\t\t\tmethod.File().Path(),\n\t\t\t\t\t\t\t\"%q is used as the response for multiple RPCs.\",\n\t\t\t\t\t\t\trequestResponseType,\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} else {\n\t\t\t// else, we have a duplicate usage of requestResponseType, add an FileAnnotation to each method\n\t\t\tfor _, method := range fullNameToMethod {\n\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\tmethod.Location(),\n\t\t\t\t\tnil,\n\t\t\t\t\tmethod.File().Path(),\n\t\t\t\t\t\"%q is used as the request or response type for multiple RPCs.\",\n\t\t\t\t\trequestResponseType,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleLintRPCRequestStandardName is a handle function.\nvar HandleLintRPCRequestStandardName = bufcheckserverutil.NewLintMethodRuleHandler(handleLintRPCRequestStandardName)\n\nfunc handleLintRPCRequestStandardName(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n) error {\n\tallowGoogleProtobufEmptyRequests, err := bufcheckopt.GetRPCAllowGoogleProtobufEmptyRequests(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := method.Service()\n\tif service == nil {\n\t\treturn errors.New(\"method.Service() is nil\")\n\t}\n\tname := method.InputTypeName()\n\tif allowGoogleProtobufEmptyRequests && name == \"google.protobuf.Empty\" {\n\t\treturn nil\n\t}\n\tif strings.Contains(name, \".\") {\n\t\tsplit := strings.Split(name, \".\")\n\t\tname = split[len(split)-1]\n\t}\n\texpectedName1 := xstrings.ToPascalCase(method.Name()) + \"Request\"\n\texpectedName2 := xstrings.ToPascalCase(service.Name()) + expectedName1\n\tif name != expectedName1 && name != expectedName2 {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.InputTypeLocation(),\n\t\t\tnil,\n\t\t\tmethod.File().Path(),\n\t\t\t\"RPC request type %q should be named %q or %q.\",\n\t\t\tname,\n\t\t\texpectedName1,\n\t\t\texpectedName2,\n\t\t)\n\t}\n\n\treturn nil\n}\n\n// HandleLintRPCResponseStandardName is a handle function.\nvar HandleLintRPCResponseStandardName = bufcheckserverutil.NewLintMethodRuleHandler(handleLintRPCResponseStandardName)\n\nfunc handleLintRPCResponseStandardName(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tmethod bufprotosource.Method,\n) error {\n\tallowGoogleProtobufEmptyResponses, err := bufcheckopt.GetRPCAllowGoogleProtobufEmptyResponses(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\tservice := method.Service()\n\tif service == nil {\n\t\treturn errors.New(\"method.Service() is nil\")\n\t}\n\tname := method.OutputTypeName()\n\tif allowGoogleProtobufEmptyResponses && name == \"google.protobuf.Empty\" {\n\t\treturn nil\n\t}\n\tif strings.Contains(name, \".\") {\n\t\tsplit := strings.Split(name, \".\")\n\t\tname = split[len(split)-1]\n\t}\n\texpectedName1 := xstrings.ToPascalCase(method.Name()) + \"Response\"\n\texpectedName2 := xstrings.ToPascalCase(service.Name()) + expectedName1\n\tif name != expectedName1 && name != expectedName2 {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tmethod.OutputTypeLocation(),\n\t\t\tnil,\n\t\t\tmethod.File().Path(),\n\t\t\t\"RPC response type %q should be named %q or %q.\",\n\t\t\tname,\n\t\t\texpectedName1,\n\t\t\texpectedName2,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintServicePascalCase is a handle function.\nvar HandleLintServicePascalCase = bufcheckserverutil.NewLintServiceRuleHandler(handleLintServicePascalCase)\n\nfunc handleLintServicePascalCase(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tservice bufprotosource.Service,\n) error {\n\tname := service.Name()\n\texpectedName := xstrings.ToPascalCase(name)\n\tif name != expectedName {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tservice.NameLocation(),\n\t\t\tnil,\n\t\t\tservice.File().Path(),\n\t\t\t\"Service name %q should be PascalCase, such as %q.\",\n\t\t\tname,\n\t\t\texpectedName,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintServiceSuffix is a handle function.\nvar HandleLintServiceSuffix = bufcheckserverutil.NewLintServiceRuleHandler(handleLintServiceSuffix)\n\nfunc handleLintServiceSuffix(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trequest bufcheckserverutil.Request,\n\tservice bufprotosource.Service,\n) error {\n\tsuffix, err := bufcheckopt.GetServiceSuffix(request.Options())\n\tif err != nil {\n\t\treturn err\n\t}\n\tname := service.Name()\n\tif !strings.HasSuffix(name, suffix) {\n\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\tservice.NameLocation(),\n\t\t\tnil,\n\t\t\tservice.File().Path(),\n\t\t\t\"Service name %q should be suffixed with %q.\",\n\t\t\tname,\n\t\t\tsuffix,\n\t\t)\n\t}\n\treturn nil\n}\n\n// HandleLintStablePackageNoImportUnstable is a handle function.\nvar HandleLintStablePackageNoImportUnstable = bufcheckserverutil.NewLintFilesRuleHandler(handleLintStablePackageNoImportUnstable)\n\nfunc handleLintStablePackageNoImportUnstable(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfiles []bufprotosource.File,\n) error {\n\tfilePathToFile, err := bufprotosource.FilePathToFile(files...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, file := range files {\n\t\tpackageVersion, ok := protoversion.NewPackageVersionForPackage(file.Package())\n\t\tif !ok {\n\t\t\t// No package, or no version on package - unstable to determine if stable.\n\t\t\tcontinue\n\t\t}\n\t\tif packageVersion.StabilityLevel() != protoversion.StabilityLevelStable {\n\t\t\t// If package is not stable, no failure.\n\t\t\tcontinue\n\t\t}\n\t\t// Package is stable. Check imports.\n\t\tfor _, fileImport := range file.FileImports() {\n\t\t\tif importedFile, ok := filePathToFile[fileImport.Import()]; ok {\n\t\t\t\timportedFilePackageVersion, ok := protoversion.NewPackageVersionForPackage(importedFile.Package())\n\t\t\t\tif !ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif importedFilePackageVersion.StabilityLevel() != protoversion.StabilityLevelStable {\n\t\t\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\t\t\tfileImport.Location(),\n\t\t\t\t\t\tnil,\n\t\t\t\t\t\tfileImport.File().Path(),\n\t\t\t\t\t\t`This file is in stable package %q, so it should not depend on %q from unstable package %q.`,\n\t\t\t\t\t\tfile.Package(),\n\t\t\t\t\t\tfileImport.Import(),\n\t\t\t\t\t\timportedFile.Package(),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// HandleLintSyntaxSpecified is a handle function.\nvar HandleLintSyntaxSpecified = bufcheckserverutil.NewLintFileRuleHandler(handleLintSyntaxSpecified)\n\nfunc handleLintSyntaxSpecified(\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\t_ bufcheckserverutil.Request,\n\tfile bufprotosource.File,\n) error {\n\tif file.Syntax() == bufprotosource.SyntaxUnspecified {\n\t\tresponseWriter.AddAnnotation(\n\t\t\tcheck.WithFileName(file.Path()),\n\t\t\tcheck.WithMessage(`Files must have a syntax explicitly specified. If no syntax is specified, the file defaults to \"proto2\".`),\n\t\t)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/lint_util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"strings\"\n\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n)\n\nfunc fieldToLowerSnakeCase(s string) string {\n\t// Try running this on googleapis and watch\n\t// We allow both effectively by not passing the option\n\t//return xstrings.ToLowerSnakeCase(s, xstrings.SnakeCaseWithNewWordOnDigits())\n\treturn xstrings.ToLowerSnakeCase(s)\n}\n\nfunc fieldToUpperSnakeCase(s string) string {\n\t// Try running this on googleapis and watch\n\t// We allow both effectively by not passing the option\n\t//return xstrings.ToUpperSnakeCase(s, xstrings.SnakeCaseWithNewWordOnDigits())\n\treturn xstrings.ToUpperSnakeCase(s)\n}\n\n// validLeadingComment returns true if comment has at least one line that isn't empty\n// and doesn't start with one of the comment excludes.\nfunc validLeadingComment(commentExcludes []string, comment string) bool {\n\tfor line := range strings.SplitSeq(comment, \"\\n\") {\n\t\tline = strings.TrimSpace(line)\n\t\tfor _, commentExclude := range commentExcludes {\n\t\t\tif line != \"\" && !strings.HasPrefix(line, commentExclude) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\n// Returns the usedPackageList if there is an import cycle.\n//\n// Note this stops on the first import cycle detected, it doesn't attempt to get all of them - not perfect.\nfunc getImportCycleIfExists(\n\t// Should never be \"\"\n\tpkg string,\n\tpackageToDirectlyImportedPackageToFileImports map[string]map[string][]bufprotosource.FileImport,\n\tusedPackageMap map[string]struct{},\n\tusedPackageList []string,\n) []string {\n\t// Append before checking so that the returned import cycle is actually a cycle\n\tusedPackageList = append(usedPackageList, pkg)\n\tif _, ok := usedPackageMap[pkg]; ok {\n\t\t// We have an import cycle, but if the first package in the list does not\n\t\t// equal the last, do not return as an import cycle unless the first\n\t\t// element equals the last - we do DFS from each package so this will\n\t\t// be picked up separately\n\t\tif usedPackageList[0] == usedPackageList[len(usedPackageList)-1] {\n\t\t\treturn usedPackageList\n\t\t}\n\t\treturn nil\n\t}\n\tusedPackageMap[pkg] = struct{}{}\n\t// Will never equal pkg\n\tfor directlyImportedPackage := range packageToDirectlyImportedPackageToFileImports[pkg] {\n\t\t// Can equal \"\" per the function signature of PackageToDirectlyImportedPackageToFileImports\n\t\tif directlyImportedPackage == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif importCycle := getImportCycleIfExists(\n\t\t\tdirectlyImportedPackage,\n\t\t\tpackageToDirectlyImportedPackageToFileImports,\n\t\t\tusedPackageMap,\n\t\t\tusedPackageList,\n\t\t); len(importCycle) != 0 {\n\t\t\treturn importCycle\n\t\t}\n\t}\n\tdelete(usedPackageMap, pkg)\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/tag_ranges.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n)\n\ntype tagRange interface {\n\tStart() int\n\tEnd() int\n}\n\ntype simpleTagRange [2]int\n\nfunc (r simpleTagRange) Start() int { return r[0] }\nfunc (r simpleTagRange) End() int   { return r[1] }\n\nfunc checkTagRanges[R bufprotosource.TagRange](\n\tresponseWriter bufcheckserverutil.ResponseWriter,\n\trangeKind string,\n\telement bufprotosource.NamedDescriptor,\n\tpreviousElement bufprotosource.NamedDescriptor,\n\tpreviousRanges []R,\n\tranges []R,\n) error {\n\tif len(previousRanges) == 0 {\n\t\treturn nil // nothing to check\n\t}\n\tcollapsedRanges := collapseRanges(ranges)\n\tfor _, previousRange := range previousRanges {\n\t\tstart, end := previousRange.Start(), previousRange.End()\n\t\tmissingRanges := findMissing(start, end, collapsedRanges)\n\t\tif len(missingRanges) > 0 {\n\t\t\telementKind, maxTag, err := classifyElementRange(element)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousString := bufprotosource.TagRangeString(previousRange)\n\t\t\tremovedString := missingRangesString(maxTag, missingRanges)\n\t\t\tresponseWriter.AddProtosourceAnnotationf(\n\t\t\t\telement.Location(),\n\t\t\t\tpreviousElement.Location(),\n\t\t\t\telement.File().Path(),\n\t\t\t\t`Previously present %s range %q on %s %q is missing values: %s were removed.`,\n\t\t\t\trangeKind,\n\t\t\t\tpreviousString,\n\t\t\t\telementKind,\n\t\t\t\telement.Name(),\n\t\t\t\tremovedString,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc collapseRanges[R tagRange](ranges []R) []simpleTagRange {\n\tif len(ranges) == 0 {\n\t\treturn nil\n\t}\n\tsortedRanges := make([]simpleTagRange, len(ranges))\n\tfor i, curRange := range ranges {\n\t\tstart, end := curRange.Start(), curRange.End()\n\t\tsortedRanges[i] = simpleTagRange{start, end}\n\t}\n\tsort.Slice(sortedRanges, func(i, j int) bool {\n\t\tif sortedRanges[i].Start() == sortedRanges[j].Start() {\n\t\t\treturn sortedRanges[i].End() < sortedRanges[j].End()\n\t\t}\n\t\treturn sortedRanges[i].Start() < sortedRanges[j].Start()\n\t})\n\tvar j int\n\tfor i := 1; i < len(sortedRanges); i++ {\n\t\tif sortedRanges[i].Start() <= sortedRanges[j].End()+1 {\n\t\t\t// overlapping or adjacent, so we can collapse i into j\n\t\t\tif sortedRanges[i].End() > sortedRanges[j].End() {\n\t\t\t\tsortedRanges[j][1] = sortedRanges[i].End()\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tj++\n\t\tif i != j {\n\t\t\tsortedRanges[j] = sortedRanges[i]\n\t\t}\n\t}\n\treturn sortedRanges[:j+1]\n}\n\nfunc findMissing(start, end int, collapsedRanges []simpleTagRange) []simpleTagRange {\n\tindex := sort.Search(len(collapsedRanges), func(i int) bool {\n\t\treturn collapsedRanges[i].End() >= start\n\t})\n\tvar entryStart, entryEnd int\n\tif index < len(collapsedRanges) {\n\t\tentryStart, entryEnd = collapsedRanges[index].Start(), collapsedRanges[index].End()\n\t}\n\tvar missingRanges []simpleTagRange\n\tif index >= len(collapsedRanges) || entryStart > end {\n\t\t// No overlapping ranges; entire span is missing\n\t\treturn []simpleTagRange{{start, end}}\n\t}\n\tfor {\n\t\tif start < entryStart {\n\t\t\tif end < entryStart {\n\t\t\t\tmissingRanges = append(missingRanges, simpleTagRange{start, end})\n\t\t\t} else {\n\t\t\t\tmissingRanges = append(missingRanges, simpleTagRange{start, entryStart - 1})\n\t\t\t}\n\t\t}\n\t\tstart = entryEnd + 1\n\t\tindex++\n\t\tif index >= len(collapsedRanges) || entryEnd >= end {\n\t\t\t// no further to go or no need to go further\n\t\t\tbreak\n\t\t}\n\t\tentryStart, entryEnd = collapsedRanges[index].Start(), collapsedRanges[index].End()\n\t}\n\tif end > entryEnd {\n\t\tmissingRanges = append(missingRanges, simpleTagRange{entryEnd + 1, end})\n\t}\n\treturn missingRanges\n}\n\nfunc classifyElementRange(element bufprotosource.Descriptor) (elementKind string, maxTag int, err error) {\n\tswitch element := element.(type) {\n\tcase bufprotosource.Message:\n\t\tif element.MessageSetWireFormat() {\n\t\t\treturn \"message\", bufprotosource.MessageSetRangeInclusiveMax, nil\n\t\t}\n\t\treturn \"message\", bufprotosource.MessageRangeInclusiveMax, nil\n\tcase bufprotosource.Enum:\n\t\treturn \"enum\", bufprotosource.EnumRangeInclusiveMax, nil\n\tdefault:\n\t\treturn \"\", 0, fmt.Errorf(\"only messages and enums have ranges but instead got %T\", element)\n\t}\n}\n\nfunc missingRangesString(maxTag int, missingRanges []simpleTagRange) string {\n\tremovedStrings := make([]string, len(missingRanges))\n\tfor i, missingRange := range missingRanges {\n\t\tstart := missingRange.Start()\n\t\tend := missingRange.End()\n\t\tswitch {\n\t\tcase start == end:\n\t\t\tremovedStrings[i] = fmt.Sprintf(\"[%d]\", start)\n\t\tcase missingRange.End() == maxTag:\n\t\t\tremovedStrings[i] = fmt.Sprintf(\"[%d,max]\", start)\n\t\tdefault:\n\t\t\tremovedStrings[i] = fmt.Sprintf(\"[%d,%d]\", start, end)\n\t\t}\n\t}\n\treturn strings.Join(removedStrings, \", \")\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/tag_ranges_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverhandle\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestCollapseRanges(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"empty\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tdoCollapseRanges(\n\t\t\tt,\n\t\t\t[]simpleTagRange{},\n\t\t\tnil,\n\t\t)\n\t})\n\tt.Run(\"single\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tdoCollapseRanges(\n\t\t\tt,\n\t\t\t[]simpleTagRange{\n\t\t\t\t{1, 100},\n\t\t\t},\n\t\t\t[]simpleTagRange{\n\t\t\t\t{1, 100},\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"many\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tdoCollapseRanges(\n\t\t\tt,\n\t\t\t[]simpleTagRange{\n\t\t\t\t{1, 1},\n\t\t\t\t{2, 5},\n\t\t\t\t{7, 20},\n\t\t\t\t{21, 21},\n\t\t\t\t{22, 23},\n\t\t\t\t{99, 99},\n\t\t\t\t{100, 100},\n\t\t\t\t{101, 101},\n\t\t\t\t{110, 120},\n\t\t\t},\n\t\t\t[]simpleTagRange{\n\t\t\t\t{1, 5},\n\t\t\t\t{7, 23},\n\t\t\t\t{99, 101},\n\t\t\t\t{110, 120},\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"overlaps\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tdoCollapseRanges(\n\t\t\tt,\n\t\t\t[]simpleTagRange{\n\t\t\t\t{1, 5},\n\t\t\t\t{2, 3},\n\t\t\t\t{7, 20},\n\t\t\t\t{15, 23},\n\t\t\t\t{99, 99},\n\t\t\t\t{100, 100},\n\t\t\t\t{101, 101},\n\t\t\t\t{110, 118},\n\t\t\t\t{116, 120},\n\t\t\t\t{120, 120},\n\t\t\t},\n\t\t\t[]simpleTagRange{\n\t\t\t\t{1, 5},\n\t\t\t\t{7, 23},\n\t\t\t\t{99, 101},\n\t\t\t\t{110, 120},\n\t\t\t},\n\t\t)\n\t})\n}\n\nfunc TestFindMissing(t *testing.T) {\n\tt.Parallel()\n\tranges := []simpleTagRange{\n\t\t{10, 100},\n\t\t{200, 200},\n\t\t{300, 302},\n\t\t{305, 310},\n\t\t{312, 320},\n\t\t{330, 350},\n\t}\n\tmissing := findMissing(10, 100, ranges)\n\tassert.Empty(t, missing)\n\tmissing = findMissing(1, 5, ranges)\n\tassert.Equal(t, []simpleTagRange{{1, 5}}, missing)\n\tmissing = findMissing(101, 110, ranges)\n\tassert.Equal(t, []simpleTagRange{{101, 110}}, missing)\n\tmissing = findMissing(150, 200, ranges)\n\tassert.Equal(t, []simpleTagRange{{150, 199}}, missing)\n\tmissing = findMissing(199, 201, ranges)\n\tassert.Equal(t, []simpleTagRange{{199, 199}, {201, 201}}, missing)\n\tmissing = findMissing(200, 200, ranges)\n\tassert.Empty(t, missing)\n\tmissing = findMissing(300, 300, ranges)\n\tassert.Empty(t, missing)\n\tmissing = findMissing(300, 350, ranges)\n\tassert.Equal(t, []simpleTagRange{{303, 304}, {311, 311}, {321, 329}}, missing)\n\tmissing = findMissing(335, 360, ranges)\n\tassert.Equal(t, []simpleTagRange{{351, 360}}, missing)\n\tmissing = findMissing(400, 400, ranges)\n\tassert.Equal(t, []simpleTagRange{{400, 400}}, missing)\n\tmissing = findMissing(1, 400, ranges)\n\tassert.Equal(t, []simpleTagRange{{1, 9}, {101, 199}, {201, 299}, {303, 304}, {311, 311}, {321, 329}, {351, 400}}, missing)\n}\n\nfunc doCollapseRanges(t *testing.T, input, expected []simpleTagRange) {\n\tt.Helper()\n\tcollapsed := collapseRanges(input)\n\tassert.Equal(t, expected, collapsed)\n\t// Try some random permutations of the inputs and make sure\n\t// they resolve in the same way.\n\tfor range 10 {\n\t\trand.Shuffle(len(input), func(i, j int) {\n\t\t\tinput[i], input[j] = input[j], input[i]\n\t\t})\n\t\tcollapsed := collapseRanges(input)\n\t\tassert.Equal(t, expected, collapsed)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverhandle/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcheckserverhandle\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/breaking.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverutil\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n)\n\n// NewBreakingFilePairRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewBreakingFilePairRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tfile bufprotosource.File,\n\t\tpreviousFile bufprotosource.File,\n\t) error,\n) check.RuleHandler {\n\treturn NewRuleHandler(\n\t\tfunc(\n\t\t\t_ context.Context,\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t) error {\n\t\t\tfilePathToFile, err := bufprotosource.FilePathToFile(request.ProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousFilePathToFile, err := bufprotosource.FilePathToFile(request.AgainstProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor previousFilePath, previousFile := range previousFilePathToFile {\n\t\t\t\tif file, ok := filePathToFile[previousFilePath]; ok {\n\t\t\t\t\tif err := f(responseWriter, request, file, previousFile); 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\treturn nil\n\t\t},\n\t)\n}\n\n// NewBreakingEnumPairRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewBreakingEnumPairRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tenum bufprotosource.Enum,\n\t\tpreviousEnum bufprotosource.Enum,\n\t) error,\n) check.RuleHandler {\n\treturn NewRuleHandler(\n\t\tfunc(\n\t\t\t_ context.Context,\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t) error {\n\t\t\tfullNameToEnum, err := bufprotosource.FullNameToEnum(request.ProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousFullNameToEnum, err := bufprotosource.FullNameToEnum(request.AgainstProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor previousFullName, previousEnum := range previousFullNameToEnum {\n\t\t\t\tif enum, ok := fullNameToEnum[previousFullName]; ok {\n\t\t\t\t\tif err := f(responseWriter, request, enum, previousEnum); 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\treturn nil\n\t\t},\n\t)\n}\n\n// NewBreakingEnumValuePairRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewBreakingEnumValuePairRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tnameToEnumValue map[string]bufprotosource.EnumValue,\n\t\tpreviousNameToEnumValue map[string]bufprotosource.EnumValue,\n\t) error,\n) check.RuleHandler {\n\treturn NewBreakingEnumPairRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tenum bufprotosource.Enum,\n\t\t\tpreviousEnum bufprotosource.Enum,\n\t\t) error {\n\t\t\tnumberToNameToEnumValue, err := bufprotosource.NumberToNameToEnumValue(enum)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousNumberToNameToEnumValue, err := bufprotosource.NumberToNameToEnumValue(previousEnum)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor previousNumber, previousNameToEnumValue := range previousNumberToNameToEnumValue {\n\t\t\t\tif nameToEnumValue, ok := numberToNameToEnumValue[previousNumber]; ok {\n\t\t\t\t\tif err := f(responseWriter, request, nameToEnumValue, previousNameToEnumValue); 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\treturn nil\n\t\t},\n\t)\n}\n\n// NewBreakingMessagePairRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewBreakingMessagePairRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tmessage bufprotosource.Message,\n\t\tpreviousMessage bufprotosource.Message,\n\t) error,\n) check.RuleHandler {\n\treturn NewRuleHandler(\n\t\tfunc(\n\t\t\t_ context.Context,\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t) error {\n\t\t\tfullNameToMessage, err := bufprotosource.FullNameToMessage(request.ProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousFullNameToMessage, err := bufprotosource.FullNameToMessage(request.AgainstProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor previousFullName, previousMessage := range previousFullNameToMessage {\n\t\t\t\tif message, ok := fullNameToMessage[previousFullName]; ok {\n\t\t\t\t\tif err := f(responseWriter, request, message, previousMessage); 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\treturn nil\n\t\t},\n\t)\n}\n\n// NewBreakingFieldPairRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewBreakingFieldPairRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tfield bufprotosource.Field,\n\t\tpreviousField bufprotosource.Field,\n\t) error,\n) check.RuleHandler {\n\treturn NewRuleHandler(\n\t\tfunc(\n\t\t\t_ context.Context,\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t) error {\n\t\t\t// Fields on messages.\n\t\t\tfullNameToMessage, err := bufprotosource.FullNameToMessage(request.ProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousFullNameToMessage, err := bufprotosource.FullNameToMessage(request.AgainstProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor previousFullName, previousMessage := range previousFullNameToMessage {\n\t\t\t\tif message, ok := fullNameToMessage[previousFullName]; ok {\n\t\t\t\t\tpreviousNumberToField, err := bufprotosource.NumberToMessageField(previousMessage)\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\tnumberToField, err := bufprotosource.NumberToMessageField(message)\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\tfor previousNumber, previousField := range previousNumberToField {\n\t\t\t\t\t\tif field, ok := numberToField[previousNumber]; ok {\n\t\t\t\t\t\t\tif err := f(responseWriter, request, field, previousField); err != nil {\n\t\t\t\t\t\t\t\treturn err\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\t// Extensions.\n\t\t\ttypeToNumberToField := make(map[string]map[int]bufprotosource.Field)\n\t\t\tfor _, file := range request.ProtosourceFiles() {\n\t\t\t\tif err := addToTypeToNumberToExtension(file, typeToNumberToField); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tpreviousTypeToNumberToField := make(map[string]map[int]bufprotosource.Field)\n\t\t\tfor _, previousFile := range request.AgainstProtosourceFiles() {\n\t\t\t\tif err := addToTypeToNumberToExtension(previousFile, previousTypeToNumberToField); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor previousType, previousNumberToField := range previousTypeToNumberToField {\n\t\t\t\tnumberToField := typeToNumberToField[previousType]\n\t\t\t\tfor previousNumber, previousField := range previousNumberToField {\n\t\t\t\t\tif field, ok := numberToField[previousNumber]; ok {\n\t\t\t\t\t\tif err := f(responseWriter, request, field, previousField); err != nil {\n\t\t\t\t\t\t\treturn err\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\treturn nil\n\t\t},\n\t)\n}\n\n// NewBreakingServicePairRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewBreakingServicePairRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tservice bufprotosource.Service,\n\t\tpreviousService bufprotosource.Service,\n\t) error,\n) check.RuleHandler {\n\treturn NewRuleHandler(\n\t\tfunc(\n\t\t\t_ context.Context,\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t) error {\n\t\t\tfullNameToService, err := bufprotosource.FullNameToService(request.ProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousFullNameToService, err := bufprotosource.FullNameToService(request.AgainstProtosourceFiles()...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor previousFullName, previousService := range previousFullNameToService {\n\t\t\t\tif service, ok := fullNameToService[previousFullName]; ok {\n\t\t\t\t\tif err := f(responseWriter, request, service, previousService); 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\treturn nil\n\t\t},\n\t)\n}\n\n// NewBreakingMethodPairRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewBreakingMethodPairRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tmethod bufprotosource.Method,\n\t\tpreviousMethod bufprotosource.Method,\n\t) error,\n) check.RuleHandler {\n\treturn NewBreakingServicePairRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tservice bufprotosource.Service,\n\t\t\tpreviousService bufprotosource.Service,\n\t\t) error {\n\t\t\tnameToMethod, err := bufprotosource.NameToMethod(service)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpreviousNameToMethod, err := bufprotosource.NameToMethod(previousService)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor previousName, previousMethod := range previousNameToMethod {\n\t\t\t\tif method, ok := nameToMethod[previousName]; ok {\n\t\t\t\t\tif err := f(responseWriter, request, method, previousMethod); 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\treturn nil\n\t\t},\n\t)\n}\n\n// *** PRIVATE ***\n\nfunc addToTypeToNumberToExtension(container bufprotosource.ContainerDescriptor, typeToNumberToExt map[string]map[int]bufprotosource.Field) error {\n\tfor _, extension := range container.Extensions() {\n\t\tnumberToExt := typeToNumberToExt[extension.Extendee()]\n\t\tif numberToExt == nil {\n\t\t\tnumberToExt = make(map[int]bufprotosource.Field)\n\t\t\ttypeToNumberToExt[extension.Extendee()] = numberToExt\n\t\t}\n\t\tif existing, ok := numberToExt[extension.Number()]; ok {\n\t\t\treturn fmt.Errorf(\"duplicate extension %d of %s: %s in %q and %s in %q\",\n\t\t\t\textension.Number(), extension.Extendee(),\n\t\t\t\texisting.FullName(), existing.File().Path(),\n\t\t\t\textension.FullName(), extension.File().Path())\n\t\t}\n\t\tnumberToExt[extension.Number()] = extension\n\t}\n\tfor _, message := range container.Messages() {\n\t\tif err := addToTypeToNumberToExtension(message, typeToNumberToExt); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/bufcheckserverutil.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverutil\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/descriptor\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype protosourceFilesContextKey struct{}\ntype againstProtosourceFilesContextKey struct{}\n\n// Before should be attached to each check.Spec that uses the functionality in this package.\nfunc Before(\n\tctx context.Context,\n\trequest check.Request,\n) (context.Context, check.Request, error) {\n\tprotosourceFiles, err := protosourceFilesForFileDescriptors(ctx, request.FileDescriptors())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tagainstProtosourceFiles, err := protosourceFilesForFileDescriptors(ctx, request.AgainstFileDescriptors())\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif len(protosourceFiles) > 0 {\n\t\tctx = context.WithValue(ctx, protosourceFilesContextKey{}, protosourceFiles)\n\t}\n\tif len(againstProtosourceFiles) > 0 {\n\t\tctx = context.WithValue(ctx, againstProtosourceFilesContextKey{}, againstProtosourceFiles)\n\t}\n\treturn ctx, request, nil\n}\n\n// NewRuleHandler returns a new check.RuleHandler for the given function.\nfunc NewRuleHandler(\n\tf func(\n\t\tctx context.Context,\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t) error,\n) check.RuleHandler {\n\treturn check.RuleHandlerFunc(\n\t\tfunc(\n\t\t\tctx context.Context,\n\t\t\tresponseWriter check.ResponseWriter,\n\t\t\trequest check.Request,\n\t\t) error {\n\t\t\tprotosourceFiles, _ := ctx.Value(protosourceFilesContextKey{}).([]bufprotosource.File)\n\t\t\tagainstProtosourceFiles, _ := ctx.Value(againstProtosourceFilesContextKey{}).([]bufprotosource.File)\n\t\t\treturn f(\n\t\t\t\tctx,\n\t\t\t\tnewResponseWriter(responseWriter),\n\t\t\t\tnewRequest(\n\t\t\t\t\trequest,\n\t\t\t\t\tprotosourceFiles,\n\t\t\t\t\tagainstProtosourceFiles,\n\t\t\t\t),\n\t\t\t)\n\t\t},\n\t)\n}\n\n// NewMultiHandler returns a new check.RuleHandler combined from multiple handlers.\nfunc NewMultiHandler(handlers ...check.RuleHandler) check.RuleHandler {\n\treturn multiRuleHandler(handlers)\n}\n\ntype multiRuleHandler []check.RuleHandler\n\nfunc (h multiRuleHandler) Handle(ctx context.Context, responseWriter check.ResponseWriter, request check.Request) error {\n\tfor _, ruleHandler := range h {\n\t\tif err := ruleHandler.Handle(ctx, responseWriter, request); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc protosourceFilesForFileDescriptors(ctx context.Context, fileDescriptors []descriptor.FileDescriptor) ([]bufprotosource.File, error) {\n\tif len(fileDescriptors) == 0 {\n\t\treturn nil, nil\n\t}\n\tresolver, err := protodesc.NewFiles(\n\t\t&descriptorpb.FileDescriptorSet{\n\t\t\tFile: xslices.Map(fileDescriptors, descriptor.FileDescriptor.FileDescriptorProto),\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufprotosource.NewFiles(ctx, xslices.Map(fileDescriptors, newInputFile), resolver)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/customfeatures/customfeatures/customfeatures.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 customfeatures\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/gen/proto/go/google/protobuf\"\n\t\"github.com/bufbuild/protocompile/protoutil\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\n// ResolveCppFeature returns a value for the given field name of the (pb.cpp) custom feature\n// for the given field.\nfunc ResolveCppFeature(field protoreflect.FieldDescriptor, fieldName protoreflect.Name, expectedKind protoreflect.Kind) (protoreflect.Value, error) {\n\treturn resolveFeature(field, protobuf.E_Cpp.TypeDescriptor(), fieldName, expectedKind)\n}\n\n// ResolveJavaFeature returns a value for the given field name of the (pb.java) custom feature\n// for the given field.\nfunc ResolveJavaFeature(field protoreflect.FieldDescriptor, fieldName protoreflect.Name, expectedKind protoreflect.Kind) (protoreflect.Value, error) {\n\treturn resolveFeature(field, protobuf.E_Java.TypeDescriptor(), fieldName, expectedKind)\n}\n\nfunc resolveFeature(\n\tfield protoreflect.FieldDescriptor,\n\textension protoreflect.ExtensionTypeDescriptor,\n\tfieldName protoreflect.Name,\n\texpectedKind protoreflect.Kind,\n) (protoreflect.Value, error) {\n\tfeatureField := extension.Message().Fields().ByName(fieldName)\n\tif featureField == nil {\n\t\treturn protoreflect.Value{}, fmt.Errorf(\"unable to resolve field descriptor for %s.%s\", extension.Message().FullName(), fieldName)\n\t}\n\tif featureField.Kind() != expectedKind || featureField.IsList() {\n\t\treturn protoreflect.Value{}, fmt.Errorf(\"resolved field descriptor for %s.%s has unexpected type: expected optional %s, got %s %s\",\n\t\t\textension.Message().FullName(), fieldName, expectedKind, featureField.Cardinality(), featureField.Kind())\n\t}\n\treturn protoutil.ResolveCustomFeature(\n\t\tfield,\n\t\textension.Type(),\n\t\tfeatureField,\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/customfeatures/customfeatures/customfeatures_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 customfeatures\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/gen/proto/go/google/protobuf\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestResolveCppFeatures(t *testing.T) {\n\tt.Parallel()\n\tfield := (*descriptorpb.FileDescriptorProto)(nil).ProtoReflect().Descriptor().Fields().ByName(\"package\")\n\tval, err := ResolveCppFeature(field, \"string_type\", protoreflect.EnumKind)\n\trequire.NoError(t, err)\n\t// This will use the default value for proto2\n\trequire.Equal(t, protobuf.CppFeatures_STRING.Number(), val.Enum())\n}\n\nfunc TestResolveJavaFeatures(t *testing.T) {\n\tt.Parallel()\n\tfield := (*descriptorpb.FileDescriptorProto)(nil).ProtoReflect().Descriptor().Fields().ByName(\"package\")\n\tval, err := ResolveJavaFeature(field, \"utf8_validation\", protoreflect.EnumKind)\n\trequire.NoError(t, err)\n\t// This will use the default value for proto2\n\trequire.Equal(t, protobuf.JavaFeatures_DEFAULT.Number(), val.Enum())\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/customfeatures/customfeatures/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage customfeatures\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/input_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverutil\n\nimport (\n\t\"buf.build/go/bufplugin/descriptor\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/google/uuid\"\n)\n\ntype inputFile struct {\n\tdescriptor.FileDescriptor\n}\n\nfunc newInputFile(fileDescriptor descriptor.FileDescriptor) *inputFile {\n\treturn &inputFile{\n\t\tFileDescriptor: fileDescriptor,\n\t}\n}\n\nfunc (i *inputFile) Path() string {\n\treturn i.FileDescriptor.FileDescriptorProto().GetName()\n}\n\nfunc (i *inputFile) ExternalPath() string {\n\treturn i.Path()\n}\n\nfunc (i *inputFile) FullName() bufparse.FullName {\n\treturn nil\n}\n\nfunc (i *inputFile) CommitID() uuid.UUID {\n\treturn uuid.Nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/lint.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverutil\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n)\n\n// NewLintFilesRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The files slice does not include imports.\nfunc NewLintFilesRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tfiles []bufprotosource.File,\n\t) error,\n) check.RuleHandler {\n\treturn NewRuleHandler(\n\t\tfunc(\n\t\t\t_ context.Context,\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t) error {\n\t\t\tfiles := request.ProtosourceFiles()\n\t\t\tfilesWithoutImports := make([]bufprotosource.File, 0, len(files))\n\t\t\tfor _, file := range files {\n\t\t\t\tif !file.IsImport() {\n\t\t\t\t\tfilesWithoutImports = append(filesWithoutImports, file)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn f(responseWriter, request, filesWithoutImports)\n\t\t},\n\t)\n}\n\n// NewLintPackageToFilesRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The pkgFiles slice will only have files for the given package.\n// The pkgFiles slice does not include imports.\nfunc NewLintPackageToFilesRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tpkg string,\n\t\tpkgFiles []bufprotosource.File,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFilesRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfiles []bufprotosource.File,\n\t\t) error {\n\t\t\tpkgToFiles, err := bufprotosource.PackageToFiles(files...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor pkg, pkgFiles := range pkgToFiles {\n\t\t\t\tif err := f(responseWriter, request, pkg, pkgFiles); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintDirPathToFilesRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The dirFiles slice will only have files for the given directory.\n// The dirFiles slice does not include imports.\nfunc NewLintDirPathToFilesRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tdirPath string,\n\t\tdirFiles []bufprotosource.File,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFilesRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfiles []bufprotosource.File,\n\t\t) error {\n\t\t\tdirPathToFiles, err := bufprotosource.DirPathToFiles(files...)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor dirPath, dirFiles := range dirPathToFiles {\n\t\t\t\tif err := f(responseWriter, request, dirPath, dirFiles); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintFileRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintFileRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tfile bufprotosource.File,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFilesRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfiles []bufprotosource.File,\n\t\t) error {\n\t\t\tfor _, file := range files {\n\t\t\t\tif err := f(responseWriter, request, file); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintFileImportRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each FileImport within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintFileImportRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tfileImport bufprotosource.FileImport,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFileRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfile bufprotosource.File,\n\t\t) error {\n\t\t\tfor _, fileImport := range file.FileImports() {\n\t\t\t\tif err := f(responseWriter, request, fileImport); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintEnumRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each Enum within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintEnumRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tenum bufprotosource.Enum,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFileRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfile bufprotosource.File,\n\t\t) error {\n\t\t\treturn bufprotosource.ForEachEnum(\n\t\t\t\tfunc(enum bufprotosource.Enum) error {\n\t\t\t\t\treturn f(responseWriter, request, enum)\n\t\t\t\t},\n\t\t\t\tfile,\n\t\t\t)\n\t\t},\n\t)\n}\n\n// NewLintEnumValueRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each EnumValue within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintEnumValueRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tenumValue bufprotosource.EnumValue,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintEnumRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tenum bufprotosource.Enum,\n\t\t) error {\n\t\t\tfor _, enumValue := range enum.Values() {\n\t\t\t\tif err := f(responseWriter, request, enumValue); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintMessageRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each Message within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintMessageRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tmessage bufprotosource.Message,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFileRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfile bufprotosource.File,\n\t\t) error {\n\t\t\treturn bufprotosource.ForEachMessage(\n\t\t\t\tfunc(message bufprotosource.Message) error {\n\t\t\t\t\treturn f(responseWriter, request, message)\n\t\t\t\t},\n\t\t\t\tfile,\n\t\t\t)\n\t\t},\n\t)\n}\n\n// NewLintFieldRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each Field within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintFieldRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tfield bufprotosource.Field,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFileRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfile bufprotosource.File,\n\t\t) error {\n\t\t\tif err := bufprotosource.ForEachMessage(\n\t\t\t\tfunc(message bufprotosource.Message) error {\n\t\t\t\t\tfor _, field := range message.Fields() {\n\t\t\t\t\t\tif err := f(responseWriter, request, field); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfor _, field := range message.Extensions() {\n\t\t\t\t\t\tif err := f(responseWriter, request, field); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t},\n\t\t\t\tfile,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfor _, field := range file.Extensions() {\n\t\t\t\tif err := f(responseWriter, request, field); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintOneofRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each Oneof within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintOneofRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\toneof bufprotosource.Oneof,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintMessageRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tmessage bufprotosource.Message,\n\t\t) error {\n\t\t\tfor _, oneof := range message.Oneofs() {\n\t\t\t\tif err := f(responseWriter, request, oneof); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintServiceRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each Service within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintServiceRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tservice bufprotosource.Service,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintFileRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tfile bufprotosource.File,\n\t\t) error {\n\t\t\tfor _, service := range file.Services() {\n\t\t\t\tif err := f(responseWriter, request, service); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewLintMethodRuleHandler returns a new check.RuleHandler for the given function.\n//\n// The function will be called for each Method within each File in the request.\n//\n// Files that are imports are skipped.\nfunc NewLintMethodRuleHandler(\n\tf func(\n\t\tresponseWriter ResponseWriter,\n\t\trequest Request,\n\t\tmethod bufprotosource.Method,\n\t) error,\n) check.RuleHandler {\n\treturn NewLintServiceRuleHandler(\n\t\tfunc(\n\t\t\tresponseWriter ResponseWriter,\n\t\t\trequest Request,\n\t\t\tservice bufprotosource.Service,\n\t\t) error {\n\t\t\tfor _, method := range service.Methods() {\n\t\t\t\tif err := f(responseWriter, request, method); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/request.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverutil\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n)\n\n// Request is a check.Request that also includes bufprotosource functionality.\ntype Request interface {\n\tcheck.Request\n\n\t// ProtosourceFiles returns the check.Files as bufprotosource.Files.\n\tProtosourceFiles() []bufprotosource.File\n\t// AgainstProtosourceFiles returns the check.AgainstFiles as bufprotosource.Files.\n\tAgainstProtosourceFiles() []bufprotosource.File\n}\n\ntype request struct {\n\tcheck.Request\n\n\tprotosourceFiles        []bufprotosource.File\n\tagainstProtosourceFiles []bufprotosource.File\n}\n\nfunc newRequest(\n\tcheckRequest check.Request,\n\tprotosourceFiles []bufprotosource.File,\n\tagainstProtosourceFiles []bufprotosource.File,\n) *request {\n\treturn &request{\n\t\tRequest:                 checkRequest,\n\t\tprotosourceFiles:        protosourceFiles,\n\t\tagainstProtosourceFiles: againstProtosourceFiles,\n\t}\n}\n\nfunc (r *request) ProtosourceFiles() []bufprotosource.File {\n\treturn r.protosourceFiles\n}\n\nfunc (r *request) AgainstProtosourceFiles() []bufprotosource.File {\n\treturn r.againstProtosourceFiles\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/response_writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverutil\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n)\n\n// ResponseWriter is a check.ResponseWriter that also includes bufprotosource functionality.\ntype ResponseWriter interface {\n\tcheck.ResponseWriter\n\n\t// AddProtosourceAnnotationf adds a [check.Annotation] for the specified [bufprotosource.Location]s.\n\t//\n\t// If location is non-nil, it is used to populate the annotation's source code information,\n\t// and inputFileName is ignored. If location is nil and inputFileName is provided, the\n\t// latter is used as a fallback to set the input file name in the annotation.\n\t// againstLocation is optional and may be nil.\n\t//\n\t// The format string and args are used to construct the annotation message.\n\tAddProtosourceAnnotationf(\n\t\tlocation bufprotosource.Location,\n\t\tagainstLocation bufprotosource.Location,\n\t\tinputFileName string,\n\t\tformat string,\n\t\targs ...any,\n\t)\n}\n\ntype responseWriter struct {\n\tcheck.ResponseWriter\n}\n\nfunc newResponseWriter(checkResponseWriter check.ResponseWriter) *responseWriter {\n\treturn &responseWriter{\n\t\tResponseWriter: checkResponseWriter,\n\t}\n}\n\nfunc (w *responseWriter) AddProtosourceAnnotationf(\n\tlocation bufprotosource.Location,\n\tagainstLocation bufprotosource.Location,\n\tinputFileName string,\n\tformat string,\n\targs ...any,\n) {\n\taddAnnotationOptions := []check.AddAnnotationOption{\n\t\tcheck.WithMessagef(format, args...),\n\t}\n\tif location != nil {\n\t\taddAnnotationOptions = append(\n\t\t\taddAnnotationOptions,\n\t\t\tcheck.WithFileNameAndSourcePath(location.FilePath(), location.SourcePath()),\n\t\t)\n\t} else if inputFileName != \"\" {\n\t\taddAnnotationOptions = append(\n\t\t\taddAnnotationOptions,\n\t\t\tcheck.WithFileName(inputFileName),\n\t\t)\n\t}\n\tif againstLocation != nil {\n\t\taddAnnotationOptions = append(\n\t\t\taddAnnotationOptions,\n\t\t\tcheck.WithAgainstFileNameAndSourcePath(againstLocation.FilePath(), againstLocation.SourcePath()),\n\t\t)\n\t}\n\tw.ResponseWriter.AddAnnotation(addAnnotationOptions...)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/rule_spec_builder.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckserverutil\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n)\n\n// RuleSpecBuilder matches check.RuleSpec but without categories.\n//\n// We have very similar RuleSpecs across our versions of our lint rules, however their categories do change\n// across versions. This allows us to share the basic RuleSpec shape across versions.\ntype RuleSpecBuilder struct {\n\t// Required.\n\tID string\n\t// Required.\n\tPurpose string\n\t// Required.\n\tType           check.RuleType\n\tDeprecated     bool\n\tReplacementIDs []string\n\t// Required.\n\tHandler check.RuleHandler\n}\n\n// Build builds the RuleSpec for the categories.\n//\n// Not making categories variadic in case we want to add extra parameters later easily.\nfunc (b *RuleSpecBuilder) Build(isDefault bool, categoryIDs []string) *check.RuleSpec {\n\treturn &check.RuleSpec{\n\t\tID:             b.ID,\n\t\tCategoryIDs:    categoryIDs,\n\t\tDefault:        isDefault,\n\t\tPurpose:        b.Purpose,\n\t\tType:           b.Type,\n\t\tDeprecated:     b.Deprecated,\n\t\tReplacementIDs: b.ReplacementIDs,\n\t\tHandler:        b.Handler,\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/bufcheckserverutil/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcheckserverutil\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/adder.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"google.golang.org/protobuf/encoding/protowire\"\n)\n\n// The typical use of adder is calling adder.addForPathf([]int32{int64RulesFieldNumber, someFieldNumber}, \"message\")\n// from checkRulesForField (or a function that it calls). Notice that checkRulesForField\n// is recursive, because it can call checkMapRules and checkRepeatedRules, both of which can\n// call checkRulesForField.\n//\n// If checkRulesForField is called by checkMapRules, when we add a file annotation, the\n// location should be for something like `repeated.items.string.max_len`. We need to search for the\n// location by a path like [mapRulesFieldNumber, keysFieldNumber, StringRulesFieldNumber, ...].\n//\n// If checkRulesForField is not in a recursive call, when we add a file annotation, the\n// location should be for something like `string.max_len`. We need to search for the location by\n// a path like [int64RulesFieldNumber, ...].\n//\n// However, from checkRulesForField's perspective, it doesn't know whether it's in a recursive\n// call. It always treats the path like [int64RulesFieldNumber, ...], as opposed to [mapRulesFieldNumber, keysFieldNumber, StringRulesFieldNumber, ...].\n// To preserve the first part of the path, [mapRulesFieldNumber, keysFieldNumber], we create a new adder\n// with a base path when we recursively call checkRulesForField. The new adder will automatically\n// prepend the base path whenever it searches for a location. This is manageable because the recursion\n// depth is at most 2 -- if checkMapRules or checkRepeatedRules calls checkRulesForField,\n// this call of checkRulesForField won't call checkMapRules or checkRepeatedRules.\ntype adder struct {\n\tfield               bufprotosource.Field\n\tfieldPrettyTypeName string\n\tbasePath            []int32\n\taddFunc             func(bufprotosource.Descriptor, bufprotosource.Location, []bufprotosource.Location, string, ...any)\n}\n\nfunc (a *adder) cloneWithNewBasePath(basePath ...int32) *adder {\n\treturn &adder{\n\t\tfield:               a.field,\n\t\tfieldPrettyTypeName: a.fieldPrettyTypeName,\n\t\tbasePath:            basePath,\n\t\taddFunc:             a.addFunc,\n\t}\n}\n\nfunc (a *adder) addForPathf(path []int32, format string, args ...any) {\n\t// Copy a.basePath so it won't be modified by append.\n\tcombinedPath := make([]int32, len(a.basePath), len(a.basePath)+len(path))\n\tcopy(combinedPath, a.basePath)\n\ta.addFunc(\n\t\ta.field,\n\t\ta.field.OptionExtensionLocation(validate.E_Field, append(combinedPath, path...)...),\n\t\tnil,\n\t\tformat,\n\t\targs...,\n\t)\n}\n\nfunc (a *adder) addForPathsf(paths [][]int32, format string, args ...any) {\n\tlocations := make([]bufprotosource.Location, 0, len(paths))\n\tfor _, path := range paths {\n\t\t// Copy a.basePath so it won't be modified by append.\n\t\tcombinedPath := make([]int32, len(a.basePath), len(a.basePath)+len(path))\n\t\tcopy(combinedPath, a.basePath)\n\t\tlocations = append(locations, a.field.OptionExtensionLocation(validate.E_Field, append(combinedPath, path...)...))\n\t}\n\t// different paths can have the same location\n\tlocations = deduplicateLocations(locations)\n\tfor _, location := range locations {\n\t\ta.addFunc(\n\t\t\ta.field,\n\t\t\tlocation,\n\t\t\tnil,\n\t\t\tformat,\n\t\t\targs...,\n\t\t)\n\t}\n}\n\nfunc (a *adder) fieldName() string {\n\treturn a.field.Name()\n}\n\nfunc (a *adder) getFieldRuleName(path ...int32) string {\n\tname := \"(buf.validate.field)\"\n\tfields := fieldRulesDescriptor.Fields()\n\tcombinedPath := path\n\tif len(a.basePath) > 0 {\n\t\tcombinedPath = make([]int32, len(a.basePath), len(a.basePath)+len(path))\n\t\tcopy(combinedPath, a.basePath)\n\t\tcombinedPath = append(combinedPath, path...)\n\t}\n\tfor _, fieldNumber := range combinedPath {\n\t\tsubField := fields.ByNumber(protowire.Number(fieldNumber))\n\t\tif subField == nil {\n\t\t\treturn name\n\t\t}\n\t\tname += \".\"\n\t\tname += string(subField.Name())\n\t\tsubFieldMessage := subField.Message()\n\t\tif subFieldMessage == nil {\n\t\t\treturn name\n\t\t}\n\t\tfields = subField.Message().Fields()\n\t}\n\treturn name\n}\n\nfunc deduplicateLocations(locations []bufprotosource.Location) []bufprotosource.Location {\n\ttype locationFields struct {\n\t\tstartLine   int\n\t\tstartColumn int\n\t\tendLine     int\n\t\tendColumn   int\n\t}\n\texactLocations := map[locationFields]struct{}{}\n\tuniqueLocations := make([]bufprotosource.Location, 0, len(locations))\n\tfor _, location := range locations {\n\t\tvar locationValue locationFields\n\t\tif location != nil {\n\t\t\tlocationValue = locationFields{\n\t\t\t\tstartLine:   location.StartLine(),\n\t\t\t\tstartColumn: location.StartColumn(),\n\t\t\t\tendLine:     location.EndLine(),\n\t\t\t\tendColumn:   location.EndColumn(),\n\t\t\t}\n\t\t}\n\t\tif _, ok := exactLocations[locationValue]; ok {\n\t\t\tcontinue\n\t\t}\n\t\texactLocations[locationValue] = struct{}{}\n\t\tuniqueLocations = append(uniqueLocations, location)\n\t}\n\treturn uniqueLocations\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/buflintvalidate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"buf.build/go/protovalidate\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n)\n\n// CheckMessage validates that all rules on the message are valid, and any CEL expressions compile.\n// It also checks all predefined rule extensions on the messages.\nfunc CheckMessage(\n\t// addAnnotationFunc adds an annotation with the descriptor and location for check results.\n\taddAnnotationFunc func(bufprotosource.Descriptor, bufprotosource.Location, []bufprotosource.Location, string, ...any),\n\tmessage bufprotosource.Message,\n) error {\n\tmessageDescriptor, err := message.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tmessageRules, err := protovalidate.ResolveMessageRules(messageDescriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif messageRules == nil {\n\t\treturn nil\n\t}\n\treturn checkCELForMessage(\n\t\taddAnnotationFunc,\n\t\tmessageRules,\n\t\tmessageDescriptor,\n\t\tmessage,\n\t)\n}\n\n// CheckField validates that all rules on the field are valid, and any CEL expressions compile.\n//\n// For a set of rules to be valid, it must\n//  1. permit _some_ value and all example values, if any\n//  2. have a type compatible with the field it validates.\nfunc CheckField(\n\t// addAnnotationFunc adds an annotation with the descriptor and location for check results.\n\taddAnnotationFunc func(bufprotosource.Descriptor, bufprotosource.Location, []bufprotosource.Location, string, ...any),\n\tfield bufprotosource.Field,\n\textensionTypeResolver protoencoding.Resolver,\n) error {\n\treturn checkField(addAnnotationFunc, field, extensionTypeResolver)\n}\n\n// CheckPredefinedRuleExtension checks that a predefined extension is valid, and any CEL expressions compile.\nfunc CheckPredefinedRuleExtension(\n\t// addAnnotationFunc adds an annotation with the descriptor and location for check results.\n\taddAnnotationFunc func(bufprotosource.Descriptor, bufprotosource.Location, []bufprotosource.Location, string, ...any),\n\tfield bufprotosource.Field,\n\textensionResolver protoencoding.Resolver,\n) error {\n\treturn checkPredefinedRuleExtension(addAnnotationFunc, field, extensionResolver)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/cel.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\"\n\tcelpv \"buf.build/go/protovalidate/cel\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/google/cel-go/cel\"\n\t\"github.com/google/cel-go/common/types\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n)\n\nconst (\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.FieldRules\n\tcelFieldNumberInFieldRules = 23\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.MessageRules\n\tcelFieldNumberInMessageRules = 3\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.MessageRules\n\tcelExpressionFieldNumberInMessageRules = 5\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.FieldRules\n\tcelExpressionFieldNumberInFieldRules = 29\n)\n\nfunc checkCELForMessage(\n\tadd func(bufprotosource.Descriptor, bufprotosource.Location, []bufprotosource.Location, string, ...any),\n\tmessageRules *validate.MessageRules,\n\tmessageDescriptor protoreflect.MessageDescriptor,\n\tmessage bufprotosource.Message,\n) error {\n\tif len(messageRules.GetCel()) == 0 && len(messageRules.GetCelExpression()) == 0 {\n\t\treturn nil\n\t}\n\tcelEnv, err := cel.NewEnv(\n\t\tcel.Lib(celpv.NewLibrary()),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcelEnv, err = celEnv.Extend(\n\t\tcel.Types(dynamicpb.NewMessage(messageDescriptor)),\n\t\tcel.Variable(\"this\", cel.ObjectType(string(messageDescriptor.FullName()))),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcheckCEL(\n\t\tcelEnv,\n\t\tmessageRules.GetCel(),\n\t\tfmt.Sprintf(\"message %q\", message.Name()),\n\t\tfmt.Sprintf(\"Message %q\", message.Name()),\n\t\t\"(buf.validate.message).cel\",\n\t\tfunc(index int, format string, args ...any) {\n\t\t\tmessageRulesOptionLocation := message.OptionExtensionLocation(\n\t\t\t\tvalidate.E_Message,\n\t\t\t\tcelFieldNumberInMessageRules,\n\t\t\t\tint32(index),\n\t\t\t)\n\t\t\tadd(message, messageRulesOptionLocation, nil, format, args...)\n\t\t},\n\t\tfalse, // isCELExpression\n\t)\n\tif len(messageRules.GetCelExpression()) > 0 {\n\t\tcelExpressionRules := make([]*validate.Rule, len(messageRules.GetCelExpression()))\n\t\tfor i, expr := range messageRules.GetCelExpression() {\n\t\t\tcelExpressionRules[i] = &validate.Rule{\n\t\t\t\tExpression: &expr,\n\t\t\t}\n\t\t}\n\t\tcheckCEL(\n\t\t\tcelEnv,\n\t\t\tcelExpressionRules,\n\t\t\tfmt.Sprintf(\"message %q\", message.Name()),\n\t\t\tfmt.Sprintf(\"Message %q\", message.Name()),\n\t\t\t\"(buf.validate.message).cel_expression\",\n\t\t\tfunc(index int, format string, args ...any) {\n\t\t\t\tmessageRulesOptionLocation := message.OptionExtensionLocation(\n\t\t\t\t\tvalidate.E_Message,\n\t\t\t\t\tcelExpressionFieldNumberInMessageRules,\n\t\t\t\t\tint32(index),\n\t\t\t\t)\n\t\t\t\tadd(message, messageRulesOptionLocation, nil, format, args...)\n\t\t\t},\n\t\t\ttrue, // isCELExpression\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc checkCELForField(\n\tadder *adder,\n\tfieldRules *validate.FieldRules,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\t// forItems is true if the CEL rule is defined on a non-repeated field or on each item of a repeated field.\n\tforItems bool,\n) error {\n\tif len(fieldRules.GetCel()) == 0 && len(fieldRules.GetCelExpression()) == 0 {\n\t\treturn nil\n\t}\n\tcelEnv, err := cel.NewEnv(\n\t\tcel.Lib(celpv.NewLibrary()),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcelEnv, err = celEnv.Extend(\n\t\tappend(\n\t\t\tcelpv.RequiredEnvOptions(fieldDescriptor),\n\t\t\tcel.Variable(\"this\", celpv.ProtoFieldToType(fieldDescriptor, false, forItems)),\n\t\t)...,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcheckCEL(\n\t\tcelEnv,\n\t\tfieldRules.GetCel(),\n\t\tfmt.Sprintf(\"field %q\", adder.fieldName()),\n\t\tfmt.Sprintf(\"Field %q\", adder.fieldName()),\n\t\tadder.getFieldRuleName(celFieldNumberInFieldRules),\n\t\tfunc(index int, format string, args ...any) {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{celFieldNumberInFieldRules, int32(index)},\n\t\t\t\tformat,\n\t\t\t\targs...,\n\t\t\t)\n\t\t},\n\t\tfalse, // isCELExpression\n\t)\n\tif len(fieldRules.GetCelExpression()) > 0 {\n\t\tcelExpressionRules := make([]*validate.Rule, len(fieldRules.GetCelExpression()))\n\t\tfor i, expr := range fieldRules.GetCelExpression() {\n\t\t\tcelExpressionRules[i] = &validate.Rule{\n\t\t\t\tExpression: &expr,\n\t\t\t}\n\t\t}\n\t\tcheckCEL(\n\t\t\tcelEnv,\n\t\t\tcelExpressionRules,\n\t\t\tfmt.Sprintf(\"field %q\", adder.fieldName()),\n\t\t\tfmt.Sprintf(\"Field %q\", adder.fieldName()),\n\t\t\tadder.getFieldRuleName(celExpressionFieldNumberInFieldRules),\n\t\t\tfunc(index int, format string, args ...any) {\n\t\t\t\tadder.addForPathf(\n\t\t\t\t\t[]int32{celExpressionFieldNumberInFieldRules, int32(index)},\n\t\t\t\t\tformat,\n\t\t\t\t\targs...,\n\t\t\t\t)\n\t\t\t},\n\t\t\ttrue, // isCELExpression\n\t\t)\n\t}\n\treturn nil\n}\n\n// Returns true only if all cel expressions compile\nfunc checkCEL(\n\tcelEnv *cel.Env,\n\tcelRules []*validate.Rule,\n\tparentName string,\n\tparentNameCapitalized string,\n\tcelName string,\n\tadd func(int, string, ...any),\n\tisCELExpression bool,\n) bool {\n\tallCelExpressionsCompile := true\n\tidToConstraintIndices := make(map[string][]int, len(celRules))\n\texpressionField := celName + \".expression\"\n\tif isCELExpression {\n\t\texpressionField = celName\n\t}\n\tfor i, celConstraint := range celRules {\n\t\tif celID := celConstraint.GetId(); celID != \"\" {\n\t\t\tfor _, char := range celID {\n\t\t\t\tif 'a' <= char && char <= 'z' {\n\t\t\t\t\tcontinue\n\t\t\t\t} else if 'A' <= char && char <= 'Z' {\n\t\t\t\t\tcontinue\n\t\t\t\t} else if '0' <= char && char <= '9' {\n\t\t\t\t\tcontinue\n\t\t\t\t} else if char == '_' || char == '-' || char == '.' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tadd(\n\t\t\t\t\ti,\n\t\t\t\t\t\"%s has invalid characters for %s.id. IDs must contain only characters a-z, A-Z, 0-9, '.', '_', '-'.\",\n\t\t\t\t\tparentNameCapitalized,\n\t\t\t\t\tcelName,\n\t\t\t\t)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tidToConstraintIndices[celID] = append(idToConstraintIndices[celID], i)\n\t\t}\n\t\tif len(strings.TrimSpace(celConstraint.GetExpression())) == 0 {\n\t\t\tadd(i, \"%s has an empty %s. Expressions should always be specified.\", parentNameCapitalized, expressionField)\n\t\t\tcontinue\n\t\t}\n\t\tast, compileIssues := celEnv.Compile(celConstraint.GetExpression())\n\t\tswitch {\n\t\tcase ast.OutputType().IsAssignableType(cel.BoolType):\n\t\tcase ast.OutputType().IsAssignableType(cel.StringType):\n\t\t\tif celConstraint.GetMessage() != \"\" {\n\t\t\t\tadd(\n\t\t\t\t\ti,\n\t\t\t\t\t\"%s has a %s with an expression that evaluates to a string, and also has a message. The message is redundant - since the expression evaluates to a string, its result will be printed instead of the message, so the message should be removed.\",\n\t\t\t\t\tparentNameCapitalized,\n\t\t\t\t\tcelName,\n\t\t\t\t)\n\t\t\t}\n\t\tcase ast.OutputType().IsExactType(types.ErrorType):\n\t\t\t// If the output type is error, it means compilation has failed and we\n\t\t\t// only need to add the compilation issues.\n\t\tdefault:\n\t\t\tadd(\n\t\t\t\ti,\n\t\t\t\t\"%s on %s evaluates to a %s, only string and boolean are allowed.\",\n\t\t\t\texpressionField,\n\t\t\t\tparentName,\n\t\t\t\tcel.FormatCELType(ast.OutputType()),\n\t\t\t)\n\t\t}\n\t\tif compileIssues.Err() != nil {\n\t\t\tallCelExpressionsCompile = false\n\t\t\tfor _, parsedIssue := range parseCelIssuesText(compileIssues.Err().Error()) {\n\t\t\t\tadd(\n\t\t\t\t\ti,\n\t\t\t\t\t\"%s on %s fails to compile: %s\",\n\t\t\t\t\texpressionField,\n\t\t\t\t\tparentName,\n\t\t\t\t\tparsedIssue,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\tfor celID, constraintIndices := range idToConstraintIndices {\n\t\tif len(constraintIndices) <= 1 {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, constraintIndex := range constraintIndices {\n\t\t\tadd(\n\t\t\t\tconstraintIndex,\n\t\t\t\t\"%s.id (%q) is not unique within %s.\",\n\t\t\t\tcelName,\n\t\t\t\tcelID,\n\t\t\t\tparentName,\n\t\t\t)\n\t\t}\n\t}\n\treturn allCelExpressionsCompile\n}\n\n// this depends on the undocumented behavior of cel-go's error message\n//\n// maps a string in this form:\n// \"ERROR: <input>:1:6: found no matching overload for '_+_' applied to '(int, string)'\n// | this + 'xyz' > (this * 'xyz')\n// | .....^\n// ERROR: <input>:1:22: found no matching overload for '_*_' applied to '(int, string)'\n// | this + 'xyz' > (this * 'xyz')\n// | .....................^\"\n// to a string slice:\n// [ \"found no matching overload for '_+_' applied to '(int, string)'\n// | this + 'xyz' > (this * 'xyz')\n// | .....^\",\n// \"found no matching overload for '_*_' applied to '(int, string)'\n// | this + 'xyz' > (this * 'xyz')\n// | .....................^\"]\nfunc parseCelIssuesText(issuesText string) []string {\n\tissues := strings.Split(issuesText, \"ERROR: <input>:\")\n\tparsedIssues := make([]string, 0, len(issues)-1)\n\tfor _, issue := range issues {\n\t\tissue = strings.TrimSpace(issue)\n\t\tif len(issue) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\t// now issue looks like 1:2:<error message>\n\t\tparts := strings.SplitAfterN(issue, \":\", 3)\n\t\tparsedIssues = append(parsedIssues, strings.TrimSpace(parts[len(parts)-1]))\n\t}\n\treturn parsedIssues\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/cel_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/cel-go/cel\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCelIssuesErrorTextMatch(t *testing.T) {\n\tt.Parallel()\n\tcelEnv, err := cel.NewEnv()\n\trequire.NoError(t, err)\n\tt.Run(\"parse_single_issue\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\t_, issues := celEnv.Compile(\"1 / 'a'\")\n\t\texpectedErrorText := `ERROR: <input>:1:3: found no matching overload for '_/_' applied to '(int, string)'\n | 1 / 'a'\n | ..^`\n\t\trequire.Equal(t, expectedErrorText, issues.Err().Error())\n\t\texpectedParsedTexts := []string{\n\t\t\t`found no matching overload for '_/_' applied to '(int, string)'\n | 1 / 'a'\n | ..^`,\n\t\t}\n\t\trequire.Equal(t, expectedParsedTexts, parseCelIssuesText(issues.Err().Error()))\n\t})\n\tt.Run(\"parse_multiple_issues\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\t_, issues := celEnv.Compile(\"(1 / 'a') * (1 - 'a') * (1 * 'a')\")\n\t\texpectedErrorText := `ERROR: <input>:1:4: found no matching overload for '_/_' applied to '(int, string)'\n | (1 / 'a') * (1 - 'a') * (1 * 'a')\n | ...^\nERROR: <input>:1:16: found no matching overload for '_-_' applied to '(int, string)'\n | (1 / 'a') * (1 - 'a') * (1 * 'a')\n | ...............^\nERROR: <input>:1:28: found no matching overload for '_*_' applied to '(int, string)'\n | (1 / 'a') * (1 - 'a') * (1 * 'a')\n | ...........................^`\n\t\trequire.Equal(t, expectedErrorText, issues.Err().Error())\n\t\texpectedParsedTexts := []string{\n\t\t\t`found no matching overload for '_/_' applied to '(int, string)'\n | (1 / 'a') * (1 - 'a') * (1 * 'a')\n | ...^`,\n\t\t\t`found no matching overload for '_-_' applied to '(int, string)'\n | (1 / 'a') * (1 - 'a') * (1 * 'a')\n | ...............^`,\n\t\t\t`found no matching overload for '_*_' applied to '(int, string)'\n | (1 / 'a') * (1 - 'a') * (1 * 'a')\n | ...........................^`,\n\t\t}\n\t\trequire.Equal(t, expectedParsedTexts, parseCelIssuesText(issues.Err().Error()))\n\t})\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/field.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"regexp\"\n\t\"slices\"\n\t\"strings\"\n\t\"unicode/utf8\"\n\n\t\"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\"\n\t\"buf.build/go/protovalidate\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n\t\"google.golang.org/protobuf/types/known/anypb\"\n\t\"google.golang.org/protobuf/types/known/durationpb\"\n\t\"google.golang.org/protobuf/types/known/fieldmaskpb\"\n\t\"google.golang.org/protobuf/types/known/timestamppb\"\n\t\"google.golang.org/protobuf/types/known/wrapperspb\"\n)\n\nconst (\n\t// https://buf.build/bufbuild/protovalidate/docs/main:buf.validate#buf.validate.FieldRule\n\t// These numbers are used for two purposes:\n\t// 1. Identity which type oneof is specified in a FieldRule. i.e. Is DoubleRules defined or\n\t// StringRules defined?\n\t// 2. Use it to construct a path to pass it to OptionExtensionLocation to get a more precise location.\n\tfloatRulesFieldNumber     = 1\n\tdoubleRulesFieldNumber    = 2\n\tint32RulesFieldNumber     = 3\n\tint64RulesFieldNumber     = 4\n\tuInt32RulesFieldNumber    = 5\n\tuInt64RulesFieldNumber    = 6\n\tsInt32RulesFieldNumber    = 7\n\tsInt64RulesFieldNumber    = 8\n\tfixed32RulesFieldNumber   = 9\n\tfixed64RulesFieldNumber   = 10\n\tsFixed32RulesFieldNumber  = 11\n\tsFixed64RulesFieldNumber  = 12\n\tboolRulesFieldNumber      = 13\n\tstringRulesFieldNumber    = 14\n\tbytesRulesFieldNumber     = 15\n\tenumRulesFieldNumber      = 16\n\trepeatedRulesFieldNumber  = 18\n\tmapRulesFieldNumber       = 19\n\tanyRulesFieldNumber       = 20\n\tdurationRulesFieldNumber  = 21\n\ttimestampRulesFieldNumber = 22\n\tskippedFieldNumber        = 24\n\trequiredFieldNumber       = 25\n\tignoreEmptyFieldNumber    = 26\n\tignoreFieldNumber         = 27\n\tfieldMaskRulesFieldNumber = 28\n\t// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.StringRules\n\tminLenFieldNumberInStringRules         = 2\n\tmaxLenFieldNumberInStringRules         = 3\n\tminBytesFieldNumberInStringRules       = 4\n\tmaxBytesFieldNumberInStringRules       = 5\n\tpatternFieldNumberInStringRules        = 6\n\tprefixFieldNumberInStringRules         = 7\n\tsuffixFieldNumberInStringRules         = 8\n\tcontainsFieldNumberInStringRules       = 9\n\tnotContainsFieldNumberInStringRules    = 23\n\twellKnownRegexFieldNumberInStringRules = 24\n\tstrictFieldNumberInStringRules         = 25\n\t// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.BytesRules\n\tpatternFieldNumberInBytesRules  = 4\n\tprefixFieldNumberInBytesRules   = 5\n\tsuffixFieldNumberInBytesRules   = 6\n\tcontainsFieldNumberInBytesRules = 7\n\t// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.RepeatedRules\n\tminItemsFieldNumberInRepeatedFieldRules = 1\n\tmaxItemsFieldNumberInRepeatedFieldRules = 2\n\tuniqueFieldNumberInRepeatedFieldRules   = 3\n\titemsFieldNumberInRepeatedRules         = 4\n\t// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.MapRules\n\tminPairsFieldNumberInMapRules = 1\n\tmaxPairsFieldNumberInMapRules = 2\n\tkeysFieldNumberInMapRules     = 4\n\tvaluesFieldNumberInMapRules   = 5\n\t// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.TimestampRules\n\tltNowFieldNumberInTimestampRules  = 7\n\tgtNowFieldNumberInTimestampRules  = 8\n\twithInFieldNumberInTimestampRules = 9\n\t// https://buf.build/bufbuild/protovalidate/docs/v1.1.0:buf.validate#buf.validate.FieldMaskRules\n\tinFieldMaskRules = 2\n\n\texampleName = \"example\"\n)\n\nvar (\n\tfieldNumberToAllowedScalarType = map[int32]protoreflect.Kind{\n\t\tfloatRulesFieldNumber:    protoreflect.FloatKind,\n\t\tdoubleRulesFieldNumber:   protoreflect.DoubleKind,\n\t\tint32RulesFieldNumber:    protoreflect.Int32Kind,\n\t\tint64RulesFieldNumber:    protoreflect.Int64Kind,\n\t\tuInt32RulesFieldNumber:   protoreflect.Uint32Kind,\n\t\tuInt64RulesFieldNumber:   protoreflect.Uint64Kind,\n\t\tsInt32RulesFieldNumber:   protoreflect.Sint32Kind,\n\t\tsInt64RulesFieldNumber:   protoreflect.Sint64Kind,\n\t\tfixed32RulesFieldNumber:  protoreflect.Fixed32Kind,\n\t\tfixed64RulesFieldNumber:  protoreflect.Fixed64Kind,\n\t\tsFixed32RulesFieldNumber: protoreflect.Sfixed32Kind,\n\t\tsFixed64RulesFieldNumber: protoreflect.Sfixed64Kind,\n\t\tboolRulesFieldNumber:     protoreflect.BoolKind,\n\t\tstringRulesFieldNumber:   protoreflect.StringKind,\n\t\tbytesRulesFieldNumber:    protoreflect.BytesKind,\n\t\tenumRulesFieldNumber:     protoreflect.EnumKind,\n\t}\n\tfieldNumberToAllowedMessageName = map[int32]string{\n\t\tfloatRulesFieldNumber:     string((&wrapperspb.FloatValue{}).ProtoReflect().Descriptor().FullName()),\n\t\tdoubleRulesFieldNumber:    string((&wrapperspb.DoubleValue{}).ProtoReflect().Descriptor().FullName()),\n\t\tint32RulesFieldNumber:     string((&wrapperspb.Int32Value{}).ProtoReflect().Descriptor().FullName()),\n\t\tint64RulesFieldNumber:     string((&wrapperspb.Int64Value{}).ProtoReflect().Descriptor().FullName()),\n\t\tuInt32RulesFieldNumber:    string((&wrapperspb.UInt32Value{}).ProtoReflect().Descriptor().FullName()),\n\t\tuInt64RulesFieldNumber:    string((&wrapperspb.UInt64Value{}).ProtoReflect().Descriptor().FullName()),\n\t\tboolRulesFieldNumber:      string((&wrapperspb.BoolValue{}).ProtoReflect().Descriptor().FullName()),\n\t\tstringRulesFieldNumber:    string((&wrapperspb.StringValue{}).ProtoReflect().Descriptor().FullName()),\n\t\tbytesRulesFieldNumber:     string((&wrapperspb.BytesValue{}).ProtoReflect().Descriptor().FullName()),\n\t\tanyRulesFieldNumber:       string((&anypb.Any{}).ProtoReflect().Descriptor().FullName()),\n\t\tdurationRulesFieldNumber:  string((&durationpb.Duration{}).ProtoReflect().Descriptor().FullName()),\n\t\ttimestampRulesFieldNumber: string((&timestamppb.Timestamp{}).ProtoReflect().Descriptor().FullName()),\n\t\tfieldMaskRulesFieldNumber: string((&fieldmaskpb.FieldMask{}).ProtoReflect().Descriptor().FullName()),\n\t}\n\twrapperTypeNames = map[string]struct{}{\n\t\tstring((&wrapperspb.FloatValue{}).ProtoReflect().Descriptor().FullName()):  {},\n\t\tstring((&wrapperspb.DoubleValue{}).ProtoReflect().Descriptor().FullName()): {},\n\t\tstring((&wrapperspb.Int32Value{}).ProtoReflect().Descriptor().FullName()):  {},\n\t\tstring((&wrapperspb.Int64Value{}).ProtoReflect().Descriptor().FullName()):  {},\n\t\tstring((&wrapperspb.UInt32Value{}).ProtoReflect().Descriptor().FullName()): {},\n\t\tstring((&wrapperspb.UInt64Value{}).ProtoReflect().Descriptor().FullName()): {},\n\t\tstring((&wrapperspb.BoolValue{}).ProtoReflect().Descriptor().FullName()):   {},\n\t\tstring((&wrapperspb.StringValue{}).ProtoReflect().Descriptor().FullName()): {},\n\t\tstring((&wrapperspb.BytesValue{}).ProtoReflect().Descriptor().FullName()):  {},\n\t}\n\t// https://buf.build/bufbuild/protovalidate/docs/v0.5.1:buf.validate#buf.validate.FieldRules\n\tfieldRulesDescriptor = validate.File_buf_validate_validate_proto.Messages().ByName(\"FieldRules\")\n\ttypeOneofDescriptor  = fieldRulesDescriptor.Oneofs().ByName(\"type\")\n)\n\n// checkField validates that protovalidate rules defined for this field are\n// valid, not including CEL expressions.\nfunc checkField(\n\tadd func(bufprotosource.Descriptor, bufprotosource.Location, []bufprotosource.Location, string, ...any),\n\tfield bufprotosource.Field,\n\textensionTypeResolver protoencoding.Resolver,\n) error {\n\tfieldDescriptor, err := field.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\tconstraints, err := protovalidate.ResolveFieldRules(fieldDescriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn checkRulesForField(\n\t\t&adder{\n\t\t\tfield:               field,\n\t\t\tfieldPrettyTypeName: getFieldTypePrettyNameName(fieldDescriptor),\n\t\t\taddFunc:             add,\n\t\t},\n\t\tconstraints,\n\t\tfieldDescriptor.ContainingMessage(),\n\t\tnil,\n\t\tfieldDescriptor,\n\t\tfieldDescriptor.Cardinality() == protoreflect.Repeated,\n\t\textensionTypeResolver,\n\t)\n}\n\nfunc checkRulesForField(\n\tadder *adder,\n\tfieldRules *validate.FieldRules,\n\t// This is needed because recursive calls of this function still need the same\n\t// containing message. For example, checkRulesForField(.., fieldDescriptor, ...)\n\t// may call checkRulesForField(..., fieldDescriptor.MapKey(), ...), but the map\n\t// key should be associated with the same containing message as the field's. Since\n\t// fieldDescriptor.MapKey().ContainingMessage() is not the same as fieldDescriptor.ContainingMessage(),\n\t// this needs to be passed around.\n\tcontainingMessageDescriptor protoreflect.MessageDescriptor,\n\t// Only pass a non nil value when the field is a synthetic map key/value field\n\tparentMapFieldDescriptor protoreflect.FieldDescriptor,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\texpectRepeatedRule bool,\n\textensionTypeResolver protoencoding.Resolver,\n) error {\n\tif fieldRules == nil {\n\t\treturn nil\n\t}\n\tif fieldDescriptor.IsExtension() {\n\t\tcheckRulesForExtension(adder, fieldRules)\n\t}\n\tif fieldDescriptor.ContainingOneof() != nil &&\n\t\t!protodesc.ToFieldDescriptorProto(fieldDescriptor).GetProto3Optional() &&\n\t\tfieldRules.GetRequired() {\n\t\tadder.addForPathf(\n\t\t\t[]int32{requiredFieldNumber},\n\t\t\t\"Field %q has %s but is in a oneof (%s). Oneof fields must not have %s.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(requiredFieldNumber),\n\t\t\tfieldDescriptor.ContainingOneof().Name(),\n\t\t\tadder.getFieldRuleName(requiredFieldNumber),\n\t\t)\n\t}\n\tcheckFieldFlags(adder, fieldDescriptor, fieldRules)\n\tif err := checkCELForField(\n\t\tadder,\n\t\tfieldRules,\n\t\tfieldDescriptor,\n\t\t!expectRepeatedRule,\n\t); err != nil {\n\t\treturn err\n\t}\n\tfieldRulesMessage := fieldRules.ProtoReflect()\n\ttypeRulesFieldDescriptor := fieldRulesMessage.WhichOneof(typeOneofDescriptor)\n\tif typeRulesFieldDescriptor == nil {\n\t\treturn nil\n\t}\n\ttypeRulesFieldNumber := int32(typeRulesFieldDescriptor.Number())\n\t// Map and repeated special cases that contain fieldRules.\n\tif typeRulesFieldNumber == mapRulesFieldNumber {\n\t\treturn checkMapRules(adder, fieldRules.GetMap(), fieldDescriptor, containingMessageDescriptor, extensionTypeResolver)\n\t}\n\tif typeRulesFieldNumber == repeatedRulesFieldNumber {\n\t\treturn checkRepeatedRules(adder, fieldRules.GetRepeated(), fieldDescriptor, containingMessageDescriptor, extensionTypeResolver)\n\t}\n\ttypesMatch := checkRulesTypeMatchFieldType(adder, fieldDescriptor, typeRulesFieldNumber, expectRepeatedRule)\n\tif !typesMatch {\n\t\treturn nil\n\t}\n\ttypeRulesMessage := fieldRulesMessage.Get(typeRulesFieldDescriptor).Message()\n\tvar exampleValues []protoreflect.Value\n\tvar exampleFieldNumber int32\n\ttypeRulesMessage.Range(func(fd protoreflect.FieldDescriptor, value protoreflect.Value) bool {\n\t\tif string(fd.Name()) == exampleName {\n\t\t\texampleFieldNumber = int32(fd.Number())\n\t\t\t// This assumed all *Rules.Example are repeated, otherwise it panics.\n\t\t\tlist := value.List()\n\t\t\tfor i := range list.Len() {\n\t\t\t\texampleValues = append(exampleValues, list.Get(i))\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t})\n\tif len(exampleValues) > 0 {\n\t\tif err := checkExampleValues(\n\t\t\tadder,\n\t\t\t[]int32{typeRulesFieldNumber, exampleFieldNumber},\n\t\t\tfieldRules,\n\t\t\ttypeRulesMessage,\n\t\t\tcontainingMessageDescriptor,\n\t\t\tparentMapFieldDescriptor,\n\t\t\tfieldDescriptor,\n\t\t\texampleValues,\n\t\t\textensionTypeResolver,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif numberRulesCheckFunc, ok := fieldNumberToCheckNumberRulesFunc[typeRulesFieldNumber]; ok {\n\t\tnumberRulesMessage := fieldRulesMessage.Get(typeRulesFieldDescriptor).Message()\n\t\treturn numberRulesCheckFunc(adder, typeRulesFieldNumber, numberRulesMessage)\n\t}\n\tswitch typeRulesFieldNumber {\n\tcase boolRulesFieldNumber:\n\t\t// Bool rules only have `const` and does not need validating.\n\tcase stringRulesFieldNumber:\n\t\treturn checkStringRules(adder, fieldRules.GetString())\n\tcase bytesRulesFieldNumber:\n\t\treturn checkBytesRules(adder, fieldRules.GetBytes())\n\tcase enumRulesFieldNumber:\n\t\tcheckEnumRules(adder, fieldRules.GetEnum())\n\tcase anyRulesFieldNumber:\n\t\tcheckAnyRules(adder, fieldRules.GetAny())\n\tcase durationRulesFieldNumber:\n\t\treturn checkDurationRules(adder, fieldRules.GetDuration())\n\tcase timestampRulesFieldNumber:\n\t\treturn checkTimestampRules(adder, fieldRules.GetTimestamp())\n\tcase fieldMaskRulesFieldNumber:\n\t\tcheckFieldMaskRules(adder, fieldRules.GetFieldMask())\n\t}\n\treturn nil\n}\n\nfunc checkFieldFlags(\n\tadder *adder,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\tfieldRules *validate.FieldRules,\n) {\n\tvar fieldCount int\n\tfieldRules.ProtoReflect().Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {\n\t\tfieldCount++\n\t\treturn true\n\t})\n\tif fieldRules.GetIgnore() == validate.Ignore_IGNORE_ALWAYS && fieldCount > 1 {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ignoreFieldNumber},\n\t\t\t\"Field %q has %s=%v and therefore other rules in %s are not applied and should be removed.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ignoreFieldNumber),\n\t\t\tvalidate.Ignore_IGNORE_ALWAYS,\n\t\t\tadder.getFieldRuleName(),\n\t\t)\n\t}\n\tif fieldRules.GetRequired() && fieldRules.GetIgnore() == validate.Ignore_IGNORE_IF_ZERO_VALUE {\n\t\tadder.addForPathsf(\n\t\t\t[][]int32{\n\t\t\t\t{requiredFieldNumber},\n\t\t\t\t{ignoreFieldNumber},\n\t\t\t},\n\t\t\t\"Field %q has both %s and %s=%v. A field cannot be empty if it is required.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(requiredFieldNumber),\n\t\t\tadder.getFieldRuleName(ignoreFieldNumber),\n\t\t\tvalidate.Ignore_IGNORE_IF_ZERO_VALUE,\n\t\t)\n\t}\n\tif fieldRules.GetIgnore() == validate.Ignore_IGNORE_IF_ZERO_VALUE && fieldDescriptor.HasPresence() && !fieldDescriptor.IsExtension() {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ignoreFieldNumber},\n\t\t\t\"Field %q has %s=%v and tracks presence. This is the same the default and the ignore option can be removed.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ignoreFieldNumber),\n\t\t\tvalidate.Ignore_IGNORE_IF_ZERO_VALUE,\n\t\t)\n\t}\n}\n\n// Assumes the rule isn't a map rule or repeated rule, but the field could be a\n// map or a repeated field.\nfunc checkRulesTypeMatchFieldType(\n\tadder *adder,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\truleFieldNumber int32,\n\texpectRepeatedRule bool,\n) bool {\n\tif expectRepeatedRule {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ruleFieldNumber},\n\t\t\t\"Field %q is of type repeated %s but has %s rules.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.fieldPrettyTypeName,\n\t\t\tadder.getFieldRuleName(ruleFieldNumber),\n\t\t)\n\t\treturn false\n\t}\n\tif expectedScalarType, ok := fieldNumberToAllowedScalarType[ruleFieldNumber]; ok &&\n\t\texpectedScalarType == fieldDescriptor.Kind() {\n\t\treturn true\n\t}\n\tif expectedFieldMessageName, ok := fieldNumberToAllowedMessageName[ruleFieldNumber]; ok &&\n\t\tisFieldDescriptorMessage(fieldDescriptor) && string(fieldDescriptor.Message().FullName()) == expectedFieldMessageName {\n\t\treturn true\n\t}\n\tadder.addForPathf(\n\t\t[]int32{ruleFieldNumber},\n\t\t\"Field %q is of type %s but has %s rules.\",\n\t\tadder.fieldName(),\n\t\tadder.fieldPrettyTypeName,\n\t\tadder.getFieldRuleName(ruleFieldNumber),\n\t)\n\treturn false\n}\n\nfunc checkRulesForExtension(\n\tadder *adder,\n\tfieldRules *validate.FieldRules,\n) {\n\tif fieldRules.GetRequired() {\n\t\tadder.addForPathf(\n\t\t\t[]int32{requiredFieldNumber},\n\t\t\t\"Field %q is an extension field and cannot have %s.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(requiredFieldNumber),\n\t\t)\n\t}\n\tif fieldRules.GetIgnore() == validate.Ignore_IGNORE_IF_ZERO_VALUE {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ignoreFieldNumber},\n\t\t\t\"Field %q is an extension field and cannot have %s=%v.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ignoreFieldNumber),\n\t\t\tvalidate.Ignore_IGNORE_IF_ZERO_VALUE,\n\t\t)\n\t}\n}\n\nfunc checkRepeatedRules(\n\tbaseAdder *adder,\n\trepeatedRules *validate.RepeatedRules,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\tcontainingMessageDescriptor protoreflect.MessageDescriptor,\n\textensionTypeResolver protoencoding.Resolver,\n) error {\n\tif !fieldDescriptor.IsList() {\n\t\tbaseAdder.addForPathf(\n\t\t\t[]int32{repeatedRulesFieldNumber},\n\t\t\t\"Field %q is not repeated but has %s.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\tbaseAdder.getFieldRuleName(repeatedRulesFieldNumber),\n\t\t)\n\t\treturn nil\n\t}\n\tif repeatedRules.GetUnique() && isFieldDescriptorMessage(fieldDescriptor) {\n\t\tif _, isFieldWrapper := wrapperTypeNames[string(fieldDescriptor.Message().FullName())]; !isFieldWrapper {\n\t\t\tbaseAdder.addForPathf(\n\t\t\t\t[]int32{repeatedRulesFieldNumber, uniqueFieldNumberInRepeatedFieldRules},\n\t\t\t\t\"Field %q is of type %s but has %s set to true, which is only allowed for scalar types and wrapper types.\",\n\t\t\t\tbaseAdder.fieldName(),\n\t\t\t\tbaseAdder.fieldPrettyTypeName,\n\t\t\t\tbaseAdder.getFieldRuleName(repeatedRulesFieldNumber, uniqueFieldNumberInRepeatedFieldRules),\n\t\t\t)\n\t\t}\n\t}\n\tif repeatedRules.MinItems != nil && repeatedRules.MaxItems != nil && *repeatedRules.MinItems > *repeatedRules.MaxItems {\n\t\tbaseAdder.addForPathf(\n\t\t\t[]int32{repeatedRulesFieldNumber, minItemsFieldNumberInRepeatedFieldRules},\n\t\t\t\"Field %q has value %d for %s, which must be higher than value %d for %s.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\t*repeatedRules.MinItems,\n\t\t\tbaseAdder.getFieldRuleName(repeatedRulesFieldNumber, minItemsFieldNumberInRepeatedFieldRules),\n\t\t\t*repeatedRules.MaxItems,\n\t\t\tbaseAdder.getFieldRuleName(repeatedRulesFieldNumber, maxItemsFieldNumberInRepeatedFieldRules),\n\t\t)\n\t\tbaseAdder.addForPathf(\n\t\t\t[]int32{repeatedRulesFieldNumber, maxItemsFieldNumberInRepeatedFieldRules},\n\t\t\t\"Field %q has value %d for %s, which must be lower than value %d for %s.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\t*repeatedRules.MaxItems,\n\t\t\tbaseAdder.getFieldRuleName(repeatedRulesFieldNumber, maxItemsFieldNumberInRepeatedFieldRules),\n\t\t\t*repeatedRules.MinItems,\n\t\t\tbaseAdder.getFieldRuleName(repeatedRulesFieldNumber, minItemsFieldNumberInRepeatedFieldRules),\n\t\t)\n\t}\n\titemAdder := baseAdder.cloneWithNewBasePath(repeatedRulesFieldNumber, itemsFieldNumberInRepeatedRules)\n\tif repeatedRules.Items != nil && repeatedRules.Items.GetRequired() {\n\t\titemAdder.addForPathf(\n\t\t\t[]int32{requiredFieldNumber},\n\t\t\t\"Field %q has %s on repeated item rules, which is unenforceable. The %s constraint cannot be applied to individual items in a repeated field.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\titemAdder.getFieldRuleName(requiredFieldNumber),\n\t\t\titemAdder.getFieldRuleName(requiredFieldNumber),\n\t\t)\n\t}\n\treturn checkRulesForField(itemAdder, repeatedRules.Items, containingMessageDescriptor, nil, fieldDescriptor, false, extensionTypeResolver)\n}\n\nfunc checkMapRules(\n\tbaseAdder *adder,\n\tmapRules *validate.MapRules,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\tcontainingMessageDescriptor protoreflect.MessageDescriptor,\n\textensionTypeResolver protoencoding.Resolver,\n) error {\n\tif !fieldDescriptor.IsMap() {\n\t\tbaseAdder.addForPathf(\n\t\t\t[]int32{mapRulesFieldNumber},\n\t\t\t\"Field %q is not a map but has %s.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\tbaseAdder.getFieldRuleName(mapRulesFieldNumber),\n\t\t)\n\t\treturn nil\n\t}\n\tif mapRules.MinPairs != nil && mapRules.MaxPairs != nil && *mapRules.MinPairs > *mapRules.MaxPairs {\n\t\tbaseAdder.addForPathf(\n\t\t\t[]int32{mapRulesFieldNumber, minPairsFieldNumberInMapRules},\n\t\t\t\"Field %q has value %d for %s, which must be lower than value %d for %s.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\t*mapRules.MinPairs,\n\t\t\tbaseAdder.getFieldRuleName(mapRulesFieldNumber, minPairsFieldNumberInMapRules),\n\t\t\t*mapRules.MaxPairs,\n\t\t\tbaseAdder.getFieldRuleName(mapRulesFieldNumber, maxPairsFieldNumberInMapRules),\n\t\t)\n\t\tbaseAdder.addForPathf(\n\t\t\t[]int32{mapRulesFieldNumber, maxPairsFieldNumberInMapRules},\n\t\t\t\"Field %q has value %d for %s, which is lower than value %d for %s.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\t*mapRules.MaxPairs,\n\t\t\tbaseAdder.getFieldRuleName(mapRulesFieldNumber, maxPairsFieldNumberInMapRules),\n\t\t\t*mapRules.MinPairs,\n\t\t\tbaseAdder.getFieldRuleName(mapRulesFieldNumber, minPairsFieldNumberInMapRules),\n\t\t)\n\t}\n\tkeyAdder := baseAdder.cloneWithNewBasePath(mapRulesFieldNumber, keysFieldNumberInMapRules)\n\tif mapRules.Keys != nil && mapRules.Keys.GetRequired() {\n\t\tkeyAdder.addForPathf(\n\t\t\t[]int32{requiredFieldNumber},\n\t\t\t\"Field %q has %s on map key rules, which is unenforceable. The %s constraint cannot be applied to map keys.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\tkeyAdder.getFieldRuleName(requiredFieldNumber),\n\t\t\tkeyAdder.getFieldRuleName(requiredFieldNumber),\n\t\t)\n\t}\n\terr := checkRulesForField(keyAdder, mapRules.Keys, containingMessageDescriptor, fieldDescriptor, fieldDescriptor.MapKey(), false, extensionTypeResolver)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvalueAdder := baseAdder.cloneWithNewBasePath(mapRulesFieldNumber, valuesFieldNumberInMapRules)\n\tif mapRules.Values != nil && mapRules.Values.GetRequired() {\n\t\tvalueAdder.addForPathf(\n\t\t\t[]int32{requiredFieldNumber},\n\t\t\t\"Field %q has %s on map value rules, which is unenforceable. The %s constraint cannot be applied to map values.\",\n\t\t\tbaseAdder.fieldName(),\n\t\t\tvalueAdder.getFieldRuleName(requiredFieldNumber),\n\t\t\tvalueAdder.getFieldRuleName(requiredFieldNumber),\n\t\t)\n\t}\n\treturn checkRulesForField(valueAdder, mapRules.Values, containingMessageDescriptor, fieldDescriptor, fieldDescriptor.MapValue(), false, extensionTypeResolver)\n}\n\nfunc checkStringRules(adder *adder, stringRules *validate.StringRules) error {\n\tcheckConst(adder, stringRules, stringRulesFieldNumber)\n\tif err := checkLenRules(adder, stringRules, stringRulesFieldNumber, \"len\", \"min_len\", \"max_len\"); err != nil {\n\t\treturn err\n\t}\n\tif err := checkLenRules(adder, stringRules, stringRulesFieldNumber, \"len_bytes\", \"min_bytes\", \"max_bytes\"); err != nil {\n\t\treturn err\n\t}\n\tif stringRules.MinLen != nil && stringRules.MaxBytes != nil && *stringRules.MaxBytes < *stringRules.MinLen {\n\t\tadder.addForPathf(\n\t\t\t[]int32{stringRulesFieldNumber, minLenFieldNumberInStringRules},\n\t\t\t\"Field %q has value %d for %s, which must be lower than value %d for %s. A string with %d UTF-8 characters has at least %d bytes, which is higher than %d bytes.\",\n\t\t\tadder.fieldName(),\n\t\t\t*stringRules.MinLen,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, minLenFieldNumberInStringRules),\n\t\t\t*stringRules.MaxBytes,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, maxBytesFieldNumberInStringRules),\n\t\t\t*stringRules.MinLen,\n\t\t\t*stringRules.MinLen,\n\t\t\t*stringRules.MaxBytes,\n\t\t)\n\t\tadder.addForPathf(\n\t\t\t[]int32{stringRulesFieldNumber, maxBytesFieldNumberInStringRules},\n\t\t\t\"Field %q has value %d for %s, which must be higher than value %d for %s. A string with %d UTF-8 characters has at least %d bytes, which is higher than %d bytes.\",\n\t\t\tadder.fieldName(),\n\t\t\t*stringRules.MaxBytes,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, maxBytesFieldNumberInStringRules),\n\t\t\t*stringRules.MinLen,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, minLenFieldNumberInStringRules),\n\t\t\t*stringRules.MinLen,\n\t\t\t*stringRules.MinLen,\n\t\t\t*stringRules.MaxBytes,\n\t\t)\n\t}\n\tif stringRules.MaxLen != nil && stringRules.MinBytes != nil && *stringRules.MaxLen*4 < *stringRules.MinBytes {\n\t\tadder.addForPathf(\n\t\t\t[]int32{stringRulesFieldNumber, minBytesFieldNumberInStringRules},\n\t\t\t\"Field %q has value %d for %s but %d for %s. A string with %d UTF-8 characters has at most %d bytes.\",\n\t\t\tadder.fieldName(),\n\t\t\t*stringRules.MinBytes,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, minBytesFieldNumberInStringRules),\n\t\t\t*stringRules.MaxLen,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, maxLenFieldNumberInStringRules),\n\t\t\t*stringRules.MaxLen,\n\t\t\t*stringRules.MaxLen*4,\n\t\t)\n\t\tadder.addForPathf(\n\t\t\t[]int32{stringRulesFieldNumber, maxLenFieldNumberInStringRules},\n\t\t\t\"Field %q has value %d for %s but %d for %s. A string with %d UTF-8 characters has at most %d bytes.\",\n\t\t\tadder.fieldName(),\n\t\t\t*stringRules.MaxLen,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, maxLenFieldNumberInStringRules),\n\t\t\t*stringRules.MinBytes,\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, minBytesFieldNumberInStringRules),\n\t\t\t*stringRules.MaxLen,\n\t\t\t*stringRules.MaxLen*4,\n\t\t)\n\t}\n\tsubstringFields := []struct {\n\t\tvalue       *string\n\t\tname        string\n\t\tfieldNumber int32\n\t}{\n\t\t{value: stringRules.Prefix, name: \"prefix\", fieldNumber: prefixFieldNumberInStringRules},\n\t\t{value: stringRules.Suffix, name: \"suffix\", fieldNumber: suffixFieldNumberInStringRules},\n\t\t{value: stringRules.Contains, name: \"contains\", fieldNumber: containsFieldNumberInStringRules},\n\t}\n\tfor _, substringField := range substringFields {\n\t\tif substringField.value == nil {\n\t\t\tcontinue\n\t\t}\n\t\tsubstring := *substringField.value\n\t\tsubstringFieldNumber := substringField.fieldNumber\n\t\tif runeCount := uint64(utf8.RuneCountInString(substring)); stringRules.MaxLen != nil && runeCount > *stringRules.MaxLen {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{stringRulesFieldNumber, substringFieldNumber},\n\t\t\t\t\"Field %q has a %s of length %d, exceeding its max_len (%d). It is impossible for a string to contain %q while having less than or equal to %d UTF-8 characters.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, substringFieldNumber),\n\t\t\t\truneCount,\n\t\t\t\t*stringRules.MaxLen,\n\t\t\t\tsubstring,\n\t\t\t\truneCount,\n\t\t\t)\n\t\t}\n\t\tif lenBytes := uint64(len(substring)); stringRules.MaxBytes != nil && lenBytes > *stringRules.MaxBytes {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{stringRulesFieldNumber, substringFieldNumber},\n\t\t\t\t\"Field %q has a %s of %d bytes, exceeding its max_bytes (%d). It is impossible for a string to contain %q while having less than or equal to %d bytes.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, substringFieldNumber),\n\t\t\t\tlenBytes,\n\t\t\t\t*stringRules.MaxBytes,\n\t\t\t\tsubstring,\n\t\t\t\tlenBytes,\n\t\t\t)\n\t\t}\n\t\tif stringRules.NotContains != nil && strings.Contains(substring, *stringRules.NotContains) {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{stringRulesFieldNumber, substringFieldNumber},\n\t\t\t\t\"Field %q has a %s (%q) containing its not_contains (%q). It is impossible for a string to contain %q without containing %q.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, substringFieldNumber),\n\t\t\t\tsubstring,\n\t\t\t\t*stringRules.NotContains,\n\t\t\t\tsubstring,\n\t\t\t\t*stringRules.NotContains,\n\t\t\t)\n\t\t}\n\t}\n\tif stringRules.Pattern != nil {\n\t\tif _, err := regexp.Compile(*stringRules.Pattern); err != nil {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{stringRulesFieldNumber, patternFieldNumberInStringRules},\n\t\t\t\t\"Field %q has a %s that fails to compile: %s.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, patternFieldNumberInStringRules),\n\t\t\t\terr.Error(),\n\t\t\t)\n\t\t}\n\t}\n\tnonStrict := stringRules.Strict != nil && !*stringRules.Strict\n\tif stringRules.GetWellKnownRegex() == validate.KnownRegex_KNOWN_REGEX_UNSPECIFIED && nonStrict {\n\t\tadder.addForPathf(\n\t\t\t[]int32{stringRulesFieldNumber, strictFieldNumberInStringRules},\n\t\t\t\"Field %q has %s without %s. %s only applies to %s and is invalid without it.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, strictFieldNumberInStringRules),\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, wellKnownRegexFieldNumberInStringRules),\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, strictFieldNumberInStringRules),\n\t\t\tadder.getFieldRuleName(stringRulesFieldNumber, wellKnownRegexFieldNumberInStringRules),\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc checkBytesRules(adder *adder, bytesRules *validate.BytesRules) error {\n\tcheckConst(adder, bytesRules, bytesRulesFieldNumber)\n\tif err := checkLenRules(adder, bytesRules, bytesRulesFieldNumber, \"len\", \"min_len\", \"max_len\"); err != nil {\n\t\treturn err\n\t}\n\tsubBytesFields := []struct {\n\t\tvalue       []byte\n\t\tname        string\n\t\tfieldNumber int32\n\t}{\n\t\t{value: bytesRules.Prefix, name: \"prefix\", fieldNumber: prefixFieldNumberInBytesRules},\n\t\t{value: bytesRules.Suffix, name: \"suffix\", fieldNumber: suffixFieldNumberInBytesRules},\n\t\t{value: bytesRules.Contains, name: \"contains\", fieldNumber: containsFieldNumberInBytesRules},\n\t}\n\tfor _, subBytesField := range subBytesFields {\n\t\tif bytesRules.MaxLen != nil && uint64(len(subBytesField.value)) > *bytesRules.MaxLen {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{bytesRulesFieldNumber, subBytesField.fieldNumber},\n\t\t\t\t\"Field %q has a %s of %d bytes, exceeding its max_len (%d). It is impossible to contain %q while having less than or equal to %d bytes.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(bytesRulesFieldNumber, subBytesField.fieldNumber),\n\t\t\t\tlen(subBytesField.value),\n\t\t\t\t*bytesRules.MaxLen,\n\t\t\t\tsubBytesField.value,\n\t\t\t\t*bytesRules.MaxLen,\n\t\t\t)\n\t\t}\n\t}\n\tif bytesRules.Pattern != nil {\n\t\tif _, err := regexp.Compile(*bytesRules.Pattern); err != nil {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{bytesRulesFieldNumber, patternFieldNumberInBytesRules},\n\t\t\t\t\"Field %q has a %s that fails to compile: %s.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(bytesRulesFieldNumber, patternFieldNumberInBytesRules),\n\t\t\t\terr.Error(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc checkEnumRules(\n\tadder *adder,\n\tenumRules *validate.EnumRules,\n) {\n\tcheckConst(adder, enumRules, enumRulesFieldNumber)\n}\n\nfunc checkAnyRules(adder *adder, anyRules *validate.AnyRules) {\n\tcheckConst(adder, anyRules, anyRulesFieldNumber)\n}\n\nfunc checkDurationRules(adder *adder, r *validate.DurationRules) error {\n\treturn checkNumericRules[durationpb.Duration](\n\t\tadder,\n\t\tdurationRulesFieldNumber,\n\t\tr.ProtoReflect(),\n\t\tgetDurationFromValue,\n\t\tcompareDuration,\n\t\tfunc(d *durationpb.Duration) any { return d },\n\t)\n}\n\nfunc checkTimestampRules(adder *adder, timestampRules *validate.TimestampRules) error {\n\tif err := checkNumericRules[timestamppb.Timestamp](\n\t\tadder,\n\t\ttimestampRulesFieldNumber,\n\t\ttimestampRules.ProtoReflect(),\n\t\tgetTimestampFromValue,\n\t\tcompareTimestamp,\n\t\tfunc(t *timestamppb.Timestamp) any { return t },\n\t); err != nil {\n\t\treturn err\n\t}\n\tif timestampRules.GetLtNow() && timestampRules.GetGtNow() {\n\t\tadder.addForPathsf(\n\t\t\t[][]int32{\n\t\t\t\t{timestampRulesFieldNumber, gtNowFieldNumberInTimestampRules},\n\t\t\t\t{timestampRulesFieldNumber, ltNowFieldNumberInTimestampRules},\n\t\t\t},\n\t\t\t\"Field %q has both %s and %s. A timestamp cannot be both before and after validation time.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(timestampRulesFieldNumber, gtNowFieldNumberInTimestampRules),\n\t\t\tadder.getFieldRuleName(timestampRulesFieldNumber, ltNowFieldNumberInTimestampRules),\n\t\t)\n\t}\n\tif timestampRules.Within != nil {\n\t\tif durationErrString := checkDuration(timestampRules.Within); durationErrString != \"\" {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{timestampRulesFieldNumber, withInFieldNumberInTimestampRules},\n\t\t\t\t\"Field %q has an invalid %s: %s.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(timestampRulesFieldNumber, withInFieldNumberInTimestampRules),\n\t\t\t\tdurationErrString,\n\t\t\t)\n\t\t} else if timestampRules.Within.Seconds <= 0 && timestampRules.Within.Nanos <= 0 {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{timestampRulesFieldNumber, withInFieldNumberInTimestampRules},\n\t\t\t\t\"Field %q must have a positive %s (%v).\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(timestampRulesFieldNumber, withInFieldNumberInTimestampRules),\n\t\t\t\ttimestampRules.Within,\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc checkFieldMaskRules(adder *adder, fieldMaskRules *validate.FieldMaskRules) {\n\tcheckConst(adder, fieldMaskRules, fieldMaskRulesFieldNumber)\n\tif len(fieldMaskRules.In) > 0 && len(fieldMaskRules.NotIn) > 0 {\n\t\tfor _, in := range fieldMaskRules.In {\n\t\t\tif slices.Contains(fieldMaskRules.NotIn, in) {\n\t\t\t\tadder.addForPathf(\n\t\t\t\t\t[]int32{fieldMaskRulesFieldNumber, inFieldMaskRules},\n\t\t\t\t\t\"Field %q has path %q in both in and not_in rules.\",\n\t\t\t\t\tadder.fieldName(),\n\t\t\t\t\tin,\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc checkExampleValues(\n\tadder *adder,\n\tpathToExampleValues []int32,\n\tfieldRules *validate.FieldRules,\n\ttypeRulesMessage protoreflect.Message,\n\tcontainingMessageDescriptor protoreflect.MessageDescriptor,\n\t// Not nil only if fieldDescriptor is a synthetic field for map key/value.\n\tparentMapFieldDescriptor protoreflect.FieldDescriptor,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\texampleValues []protoreflect.Value,\n\textensionTypeResolver protoencoding.Resolver,\n) error {\n\t// A rule on this field may be from a predefined rule from an imported file. In order to\n\t// set example values on the message for validation and check against all rules on the field,\n\t// we pass in an extensionTypeResolver that includes imported files and reparse all extensions\n\t// for the message to ensure that we are able to resolve predefined rules.\n\tif err := protoencoding.ReparseExtensions(extensionTypeResolver, typeRulesMessage); err != nil {\n\t\treturn err\n\t}\n\thasRules := len(fieldRules.GetCel()) > 0\n\tif !hasRules {\n\t\ttypeRulesMessage.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {\n\t\t\tif string(fd.Name()) != exampleName {\n\t\t\t\thasRules = true\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t})\n\t}\n\tif !hasRules {\n\t\t// Since there are no constraints to check example values against, we already checked\n\t\t// if the proper example type has been set on the field, so we can return here.\n\t\treturn nil\n\t}\n\t// For each example value, instantiate a message of its containing message's type\n\t// and set the field that we are linting to the example value:\n\t//  containingMessage {\n\t//    ...\n\t//    fieldToLint: exampleValue,\n\t//    ...\n\t//  }\n\t// and validate this message instance with protovalidate and filter the structured\n\t// errors by field name to determine whether this example value fails rules defined\n\t// on the same field.\n\tvalidator, err := protovalidate.New()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// The shape of field path in a protovalidate.Violation depends on the type of the field descriptor.\n\tviolationFilterFunc := func(violation *validate.Violation) bool {\n\t\treturn len(violation.GetField().GetElements()) == 1 &&\n\t\t\tviolation.GetField().GetElements()[0].GetFieldNumber() == int32(fieldDescriptor.Number()) &&\n\t\t\tviolation.GetField().GetElements()[0].GetSubscript() == nil\n\t}\n\tswitch {\n\tcase fieldDescriptor.IsList():\n\t\t// Field path looks like repeated_field[10]\n\t\tviolationFilterFunc = func(violation *validate.Violation) bool {\n\t\t\tif len(violation.GetField().GetElements()) != 1 ||\n\t\t\t\tviolation.GetField().GetElements()[0].GetFieldNumber() != int32(fieldDescriptor.Number()) ||\n\t\t\t\tviolation.GetField().GetElements()[0].GetSubscript() == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t_, ok := violation.GetField().GetElements()[0].Subscript.(*validate.FieldPathElement_Index)\n\t\t\treturn ok\n\t\t}\n\tcase parentMapFieldDescriptor != nil && fieldDescriptor.Name() == \"key\":\n\t\t// Field path looks like map_field[\"the key value that failed\"] and ForKey is set to true.\n\t\tviolationFilterFunc = func(violation *validate.Violation) bool {\n\t\t\tif !violation.GetForKey() ||\n\t\t\t\tlen(violation.GetField().GetElements()) != 1 ||\n\t\t\t\tviolation.GetField().GetElements()[0].GetFieldNumber() != int32(parentMapFieldDescriptor.Number()) ||\n\t\t\t\tviolation.GetField().GetElements()[0].GetSubscript() == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t_, ok := violation.GetField().GetElements()[0].Subscript.(*validate.FieldPathElement_Index)\n\t\t\treturn !ok\n\t\t}\n\tcase parentMapFieldDescriptor != nil && fieldDescriptor.Name() == \"value\":\n\t\t// Field path looks like map_field[\"the key value that failed\"], but ForKey is set to false.\n\t\tviolationFilterFunc = func(violation *validate.Violation) bool {\n\t\t\tif violation.GetForKey() ||\n\t\t\t\tlen(violation.GetField().GetElements()) != 1 ||\n\t\t\t\tviolation.GetField().GetElements()[0].GetFieldNumber() != int32(parentMapFieldDescriptor.Number()) ||\n\t\t\t\tviolation.GetField().GetElements()[0].GetSubscript() == nil {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\t_, ok := violation.GetField().GetElements()[0].Subscript.(*validate.FieldPathElement_Index)\n\t\t\treturn !ok\n\t\t}\n\t}\n\tfor exampleValueIndex, exampleValue := range exampleValues {\n\t\tfilterFieldDescriptor := fieldDescriptor\n\t\tmessageToValidate := dynamicpb.NewMessage(containingMessageDescriptor)\n\t\tswitch {\n\t\tcase fieldDescriptor.IsList():\n\t\t\tlist := messageToValidate.NewField(fieldDescriptor).List()\n\t\t\tlist.Append(exampleValue)\n\t\t\tmessageToValidate.Set(fieldDescriptor, protoreflect.ValueOfList(list))\n\t\tcase parentMapFieldDescriptor != nil:\n\t\t\t// In the case of map fields, we need to filter for the parent field descriptor in the\n\t\t\t// Filter function. The violationFilterFunc will filter to approrpriate violation for\n\t\t\t// \"key\" and \"value\" example values.\n\t\t\tfilterFieldDescriptor = parentMapFieldDescriptor\n\t\t\tmapEntryMessageDescriptor := fieldDescriptor.ContainingMessage()\n\t\t\t// We are being very defensive, because a type mismatch may cause a panic in protoreflect.\n\t\t\tif !mapEntryMessageDescriptor.IsMapEntry() {\n\t\t\t\treturn syserror.Newf(\"containing message %q is not a map\", mapEntryMessageDescriptor.Name())\n\t\t\t}\n\t\t\tif !parentMapFieldDescriptor.IsMap() {\n\t\t\t\treturn syserror.Newf(\"parent field descriptor %q is passed but is not a map field\", parentMapFieldDescriptor.Name())\n\t\t\t}\n\t\t\tif containingMessageDescriptor.Fields().ByName(parentMapFieldDescriptor.Name()) == nil {\n\t\t\t\treturn syserror.Newf(\"containing message %q does not have field named %q\", containingMessageDescriptor.Name(), parentMapFieldDescriptor.Name())\n\t\t\t}\n\t\t\tif parentMapFieldDescriptor.Message().Name() != mapEntryMessageDescriptor.Name() {\n\t\t\t\treturn syserror.Newf(\"field %q should have parent of type %q but has type %q\", fieldDescriptor.Name(), parentMapFieldDescriptor.Message().Name(), containingMessageDescriptor.Name())\n\t\t\t}\n\t\t\tmapEntry := messageToValidate.NewField(parentMapFieldDescriptor).Map()\n\t\t\tswitch fieldDescriptor.Name() {\n\t\t\tcase \"key\":\n\t\t\t\tmapEntry.Set(\n\t\t\t\t\texampleValue.MapKey(),\n\t\t\t\t\tdynamicpb.NewMessage(parentMapFieldDescriptor.Message()).NewField(parentMapFieldDescriptor.MapValue()),\n\t\t\t\t)\n\t\t\tcase \"value\":\n\t\t\t\tmapEntry.Set(\n\t\t\t\t\tdynamicpb.NewMessage(parentMapFieldDescriptor.Message()).NewField(parentMapFieldDescriptor.MapKey()).MapKey(),\n\t\t\t\t\texampleValue,\n\t\t\t\t)\n\t\t\tdefault:\n\t\t\t\treturn syserror.Newf(\"expected key or value as synthetic field name for map entry's field name, got %q\", fieldDescriptor.Name())\n\t\t\t}\n\t\t\tmessageToValidate.Set(parentMapFieldDescriptor, protoreflect.ValueOfMap(mapEntry))\n\t\tcase fieldDescriptor.Enum() != nil:\n\t\t\t// We need to handle enum examples in a special way, since enum examples are set as\n\t\t\t// int32, but we need to set it to the enum value to the field.\n\t\t\t// So we cast exampleValue to an int32 and check that cast first before attempting\n\t\t\t// to set it to the message field. This is because messageToValidate.Set will panic\n\t\t\t// if an invalid type is attempted to be set.\n\t\t\texampleInt32, ok := exampleValue.Interface().(int32)\n\t\t\tif !ok {\n\t\t\t\treturn syserror.Newf(\"expected enum example value to be int32 for field %q, got %T type instead\", fieldDescriptor.FullName(), exampleValue)\n\t\t\t}\n\t\t\tmessageToValidate.Set(fieldDescriptor, protoreflect.ValueOf(protoreflect.EnumNumber(exampleInt32)))\n\t\tcase fieldDescriptor.Message() != nil:\n\t\t\t// We need to handle the case where the field is a wrapper type. We set the value directly base on the wrapper type.\n\t\t\tswitch string(fieldDescriptor.Message().FullName()) {\n\t\t\tcase string((&wrapperspb.FloatValue{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueFloat, ok := exampleValue.Interface().(float32)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for float wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.FloatValue{Value: exampleValueFloat}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.DoubleValue{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueDouble, ok := exampleValue.Interface().(float64)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for double wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.DoubleValue{Value: exampleValueDouble}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.Int32Value{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueInt32, ok := exampleValue.Interface().(int32)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for int32 wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.Int32Value{Value: exampleValueInt32}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.Int64Value{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueInt64, ok := exampleValue.Interface().(int64)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for int64 wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.Int64Value{Value: exampleValueInt64}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.UInt32Value{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueUInt32, ok := exampleValue.Interface().(uint32)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for uint32 wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.UInt32Value{Value: exampleValueUInt32}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.UInt64Value{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueUInt64, ok := exampleValue.Interface().(uint64)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for uint32 wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.UInt64Value{Value: exampleValueUInt64}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.BoolValue{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueBool, ok := exampleValue.Interface().(bool)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for bool wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.BoolValue{Value: exampleValueBool}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.StringValue{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueString, ok := exampleValue.Interface().(string)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for string wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.StringValue{Value: exampleValueString}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tcase string((&wrapperspb.BytesValue{}).ProtoReflect().Descriptor().FullName()):\n\t\t\t\texampleValueBytes, ok := exampleValue.Interface().([]byte)\n\t\t\t\tif !ok {\n\t\t\t\t\treturn syserror.Newf(\"unexpected type found for bytes wrapper type %T\", exampleValue.Interface())\n\t\t\t\t}\n\t\t\t\tmessageToValidate.Set(\n\t\t\t\t\tfieldDescriptor,\n\t\t\t\t\tprotoreflect.ValueOf(\n\t\t\t\t\t\t(&wrapperspb.BytesValue{Value: exampleValueBytes}).ProtoReflect(),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\tdefault:\n\t\t\t\t// In the case where it is not a wrapper type (e.g. google.protobuf.Timestamp), we just set the example\n\t\t\t\t// value directly.\n\t\t\t\tmessageToValidate.Set(fieldDescriptor, exampleValue)\n\t\t\t}\n\t\tdefault:\n\t\t\tmessageToValidate.Set(fieldDescriptor, exampleValue)\n\t\t}\n\t\terr := validator.Validate(messageToValidate,\n\t\t\tprotovalidate.WithFilter(\n\t\t\t\tprotovalidate.FilterFunc(func(\n\t\t\t\t\t_ protoreflect.Message,\n\t\t\t\t\td protoreflect.Descriptor,\n\t\t\t\t) bool {\n\t\t\t\t\treturn d == filterFieldDescriptor\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t\tif err == nil {\n\t\t\tcontinue\n\t\t}\n\t\tvar compilationErr *protovalidate.CompilationError\n\t\tif errors.As(err, &compilationErr) {\n\t\t\t// Expression failing to compile meaning some CEL expressions are invalid,\n\t\t\t// which is checked in this rule (PROTOVALIDATE), but not by this function.\n\t\t\tbreak\n\t\t}\n\t\tvalidationErr := &protovalidate.ValidationError{}\n\t\tif errors.As(err, &validationErr) {\n\t\t\tfor _, violation := range validationErr.Violations {\n\t\t\t\tif violationFilterFunc(violation.Proto) {\n\t\t\t\t\tadder.addForPathf(append(pathToExampleValues, int32(exampleValueIndex)), `\"%v\" is an example value but does not satisfy rule %q: %s`, exampleValue.Interface(), violation.Proto.GetRuleId(), violation.Proto.GetMessage())\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\treturn fmt.Errorf(\"unexpected error from protovalidate: %s\", err.Error())\n\t}\n\treturn nil\n}\n\nfunc checkConst(adder *adder, rule proto.Message, ruleFieldNumber int32) {\n\tvar (\n\t\tfieldCount       int\n\t\tconstFieldNumber int32\n\t\tisConstSpecified bool\n\t)\n\truleMessage := rule.ProtoReflect()\n\truleMessage.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {\n\t\tfieldCount++\n\t\tswitch string(fd.Name()) {\n\t\tcase \"const\":\n\t\t\tisConstSpecified = true\n\t\t\tconstFieldNumber = int32(fd.Number())\n\t\t}\n\t\treturn true\n\t})\n\tif isConstSpecified && fieldCount > 1 {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ruleFieldNumber, constFieldNumber},\n\t\t\t\"Field %q has %s, therefore other rules in %s are not applied and should be removed.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, constFieldNumber),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber),\n\t\t)\n\t}\n}\n\nfunc checkLenRules(\n\tadder *adder,\n\trules proto.Message,\n\truleFieldNumber int32,\n\tlenFieldName string,\n\tminLenFieldName string,\n\tmaxLenFieldName string,\n) error {\n\tvar (\n\t\tlength            *uint64\n\t\tlengthFieldNumber int32\n\t\tminLen            *uint64\n\t\tminLenFieldNumber int32\n\t\tmaxLen            *uint64\n\t\tmaxLenFieldNumber int32\n\t\terr               error\n\t)\n\trules.ProtoReflect().Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {\n\t\tswitch string(fd.Name()) {\n\t\tcase lenFieldName:\n\t\t\tlengthValue, ok := v.Interface().(uint64)\n\t\t\tif !ok {\n\t\t\t\terr = fmt.Errorf(\"%v is not an uint64\", v.Interface())\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tlength = &lengthValue\n\t\t\tlengthFieldNumber = int32(fd.Number())\n\t\tcase minLenFieldName:\n\t\t\tlengthValue, ok := v.Interface().(uint64)\n\t\t\tif !ok {\n\t\t\t\terr = fmt.Errorf(\"%v is not an uint64\", v.Interface())\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tminLen = &lengthValue\n\t\t\tminLenFieldNumber = int32(fd.Number())\n\t\tcase maxLenFieldName:\n\t\t\tlengthValue, ok := v.Interface().(uint64)\n\t\t\tif !ok {\n\t\t\t\terr = fmt.Errorf(\"%v is not an uint64\", v.Interface())\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tmaxLen = &lengthValue\n\t\t\tmaxLenFieldNumber = int32(fd.Number())\n\t\t}\n\t\treturn true\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif length != nil && minLen != nil {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ruleFieldNumber, minLenFieldNumber},\n\t\t\t\"Field %q has %s and therefore, %s is redundant and should be removed.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, lengthFieldNumber),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, minLenFieldNumber),\n\t\t)\n\t}\n\tif length != nil && maxLen != nil {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ruleFieldNumber, maxLenFieldNumber},\n\t\t\t\"Field %q has %s and therefore, %s is redundant and should be removed.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, lengthFieldNumber),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, maxLenFieldNumber),\n\t\t)\n\t}\n\tif maxLen == nil || minLen == nil {\n\t\treturn nil\n\t}\n\tif *minLen > *maxLen {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ruleFieldNumber, minLenFieldNumber},\n\t\t\t\"Field %q has value %d for %s, which must be lower than value %d for %s.\",\n\t\t\tadder.fieldName(),\n\t\t\t*minLen,\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, minLenFieldNumber),\n\t\t\t*maxLen,\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, maxLenFieldNumber),\n\t\t)\n\t\tadder.addForPathf(\n\t\t\t[]int32{ruleFieldNumber, maxLenFieldNumber},\n\t\t\t\"Field %q has value %d for %s, which must be higher than value %d for %s.\",\n\t\t\tadder.fieldName(),\n\t\t\t*maxLen,\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, maxLenFieldNumber),\n\t\t\t*minLen,\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, minLenFieldNumber),\n\t\t)\n\t} else if *minLen == *maxLen {\n\t\tadder.addForPathsf(\n\t\t\t[][]int32{\n\t\t\t\t{ruleFieldNumber, minLenFieldNumber},\n\t\t\t\t{ruleFieldNumber, maxLenFieldNumber},\n\t\t\t},\n\t\t\t\"Field %q has equal %s and %s, use %s.%s instead.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, minLenFieldNumber),\n\t\t\tmaxLenFieldName,\n\t\t\tadder.getFieldRuleName(ruleFieldNumber),\n\t\t\tlenFieldName,\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc getFieldTypePrettyNameName(fieldDescriptor protoreflect.FieldDescriptor) string {\n\tif !isFieldDescriptorMessage(fieldDescriptor) {\n\t\treturn fieldDescriptor.Kind().String()\n\t}\n\tif fieldDescriptor.IsMap() {\n\t\treturn fmt.Sprintf(\n\t\t\t\"map<%s, %s>\",\n\t\t\tgetFieldTypePrettyNameName(fieldDescriptor.MapKey()),\n\t\t\tgetFieldTypePrettyNameName(fieldDescriptor.MapValue()),\n\t\t)\n\t}\n\treturn string(fieldDescriptor.Message().FullName())\n}\n\nfunc isFieldDescriptorMessage(fieldDescriptor protoreflect.FieldDescriptor) bool {\n\treturn fieldDescriptor.Kind() == protoreflect.MessageKind || fieldDescriptor.Kind() == protoreflect.GroupKind\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/numeric.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/known/durationpb\"\n\t\"google.golang.org/protobuf/types/known/timestamppb\"\n)\n\nvar fieldNumberToCheckNumberRulesFunc = map[int32]func(*adder, int32, protoreflect.Message) error{\n\tfloatRulesFieldNumber:    checkNumberRules[float32],\n\tdoubleRulesFieldNumber:   checkNumberRules[float64],\n\tint32RulesFieldNumber:    checkNumberRules[int32],\n\tint64RulesFieldNumber:    checkNumberRules[int64],\n\tuInt32RulesFieldNumber:   checkNumberRules[uint32],\n\tuInt64RulesFieldNumber:   checkNumberRules[uint64],\n\tsInt32RulesFieldNumber:   checkNumberRules[int32],\n\tsInt64RulesFieldNumber:   checkNumberRules[int64],\n\tfixed32RulesFieldNumber:  checkNumberRules[uint32],\n\tfixed64RulesFieldNumber:  checkNumberRules[uint64],\n\tsFixed32RulesFieldNumber: checkNumberRules[int32],\n\tsFixed64RulesFieldNumber: checkNumberRules[int64],\n}\n\nfunc checkNumberRules[\n\tT int32 | int64 | uint32 | uint64 | float32 | float64,\n](\n\tadder *adder,\n\tnumberRuleFieldNumber int32,\n\truleMessage protoreflect.Message,\n) error {\n\treturn checkNumericRules[T](\n\t\tadder,\n\t\tnumberRuleFieldNumber,\n\t\truleMessage,\n\t\tgetNumericPointerFromValue[T],\n\t\tcompareNumber[T],\n\t\tfunc(t *T) any { return *t },\n\t)\n}\n\nfunc checkNumericRules[\n\tT int32 | int64 | uint32 | uint64 | float32 | float64 | timestamppb.Timestamp | durationpb.Duration,\n](\n\tadder *adder,\n\truleFieldNumber int32,\n\truleMessage protoreflect.Message,\n\t// convertFunc returns the converted value, a file annotation string and an error.\n\tconvertFunc func(protoreflect.Value) (*T, string, error),\n\t// equalFunc returns whether two values are equal.\n\tequalFunc func(*T, *T) bool,\n\t// formatFunc returns the value suitable for printing with %v.\n\tformatFunc func(*T) any,\n) error {\n\tvar fieldCount int\n\tvar constant, lowerBound, upperBound *T\n\tvar isLowerBoundInclusive, isUpperBoundInclusive bool\n\tvar constFieldNumber, lowerBoundFieldNumber, upperBoundFieldNumber int32\n\tvar err error\n\truleMessage.Range(func(field protoreflect.FieldDescriptor, value protoreflect.Value) bool {\n\t\tfieldCount++\n\t\tvar convertErrorMessage string\n\t\tfieldNumber := int32(field.Number())\n\t\tswitch fieldName := string(field.Name()); fieldName {\n\t\tcase \"const\":\n\t\t\tconstFieldNumber = fieldNumber\n\t\t\tconstant, convertErrorMessage, err = convertFunc(value)\n\t\tcase \"gt\":\n\t\t\tlowerBound, convertErrorMessage, err = convertFunc(value)\n\t\t\tlowerBoundFieldNumber = fieldNumber\n\t\tcase \"gte\":\n\t\t\tlowerBound, convertErrorMessage, err = convertFunc(value)\n\t\t\tlowerBoundFieldNumber = fieldNumber\n\t\t\tisLowerBoundInclusive = true\n\t\tcase \"lt\":\n\t\t\tupperBound, convertErrorMessage, err = convertFunc(value)\n\t\t\tupperBoundFieldNumber = fieldNumber\n\t\tcase \"lte\":\n\t\t\tupperBound, convertErrorMessage, err = convertFunc(value)\n\t\t\tupperBoundFieldNumber = fieldNumber\n\t\t\tisUpperBoundInclusive = true\n\t\t}\n\t\tif convertErrorMessage != \"\" {\n\t\t\tadder.addForPathf(\n\t\t\t\t[]int32{ruleFieldNumber, fieldNumber},\n\t\t\t\t\"Field %q has an invalid %s: %s.\",\n\t\t\t\tadder.fieldName(),\n\t\t\t\tadder.getFieldRuleName(ruleFieldNumber, int32(field.Number())),\n\t\t\t\tconvertErrorMessage,\n\t\t\t)\n\t\t}\n\t\treturn true\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif constant != nil && fieldCount > 1 {\n\t\tadder.addForPathf(\n\t\t\t[]int32{ruleFieldNumber, constFieldNumber},\n\t\t\t\"Field %q has %s, therefore other rules in %s are not applied and should be removed.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, constFieldNumber),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber),\n\t\t)\n\t}\n\tif lowerBound == nil || upperBound == nil {\n\t\treturn nil\n\t}\n\t// We do not check which one is larger because in protovalidate, both\n\t// {lt: 3, gt: 5} and {lt: 5, gt: 3} are valid.\n\tif !equalFunc(upperBound, lowerBound) {\n\t\treturn nil\n\t}\n\tif isUpperBoundInclusive && isLowerBoundInclusive {\n\t\tadder.addForPathsf(\n\t\t\t[][]int32{\n\t\t\t\t{ruleFieldNumber, lowerBoundFieldNumber},\n\t\t\t\t{ruleFieldNumber, upperBoundFieldNumber},\n\t\t\t},\n\t\t\t\"Field %q has equal %s and %s, use %s.const instead.\",\n\t\t\tadder.fieldName(),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, lowerBoundFieldNumber),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber, upperBoundFieldNumber),\n\t\t\tadder.getFieldRuleName(ruleFieldNumber),\n\t\t)\n\t\treturn nil\n\t}\n\tadder.addForPathsf(\n\t\t[][]int32{\n\t\t\t{ruleFieldNumber, lowerBoundFieldNumber},\n\t\t\t{ruleFieldNumber, upperBoundFieldNumber},\n\t\t},\n\t\t\"Field %q has equal %s and %s. All values are rejected by these checks.\",\n\t\tadder.fieldName(),\n\t\tadder.getFieldRuleName(ruleFieldNumber, lowerBoundFieldNumber),\n\t\tadder.getFieldRuleName(ruleFieldNumber, upperBoundFieldNumber),\n\t)\n\treturn nil\n}\n\nfunc getNumericPointerFromValue[\n\tT int32 | int64 | uint32 | uint64 | float32 | float64,\n](value protoreflect.Value) (*T, string, error) {\n\tnumber, ok := value.Interface().(T)\n\tif !ok {\n\t\treturn nil, \"\", fmt.Errorf(\"unable to cast value to type %T\", number)\n\t}\n\treturn &number, \"\", nil\n}\n\nfunc getTimestampFromValue(value protoreflect.Value) (*timestamppb.Timestamp, string, error) {\n\tbytes, err := protoencoding.NewWireMarshaler().Marshal(value.Message().Interface())\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\ttimestamp := &timestamppb.Timestamp{}\n\terr = protoencoding.NewWireUnmarshaler(nil).Unmarshal(bytes, timestamp)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\ttimestampErr := timestamp.CheckValid()\n\tif timestampErr == nil {\n\t\treturn timestamp, \"\", nil\n\t}\n\treturn nil, timestampErr.Error(), nil\n}\n\nfunc getDurationFromValue(value protoreflect.Value) (*durationpb.Duration, string, error) {\n\tbytes, err := protoencoding.NewWireMarshaler().Marshal(value.Message().Interface())\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tduration := &durationpb.Duration{}\n\terr = protoencoding.NewWireUnmarshaler(nil).Unmarshal(bytes, duration)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tif durationErrString := checkDuration(duration); durationErrString != \"\" {\n\t\treturn nil, durationErrString, nil\n\t}\n\treturn duration, \"\", nil\n}\n\nfunc compareNumber[T int32 | int64 | uint32 | uint64 | float32 | float64](a *T, b *T) bool {\n\treturn *a == *b\n}\n\nfunc compareTimestamp(t1 *timestamppb.Timestamp, t2 *timestamppb.Timestamp) bool {\n\treturn t1.Seconds == t2.Seconds && t1.Nanos == t2.Nanos\n}\n\nfunc compareDuration(d1 *durationpb.Duration, d2 *durationpb.Duration) bool {\n\treturn d1.Seconds == d2.Seconds && d1.Nanos == d2.Nanos\n}\n\nfunc checkDuration(duration *durationpb.Duration) string {\n\t// This is slightly smaller than MaxInt64, 9,223,372,036,854,775,807,\n\t// but 9,223,372,036,854,775,428 is the maximum value that does not cause a\n\t// runtime error in protovalidate.\n\tmaxDuration := &durationpb.Duration{\n\t\tSeconds: 9223372036,\n\t\tNanos:   854775428,\n\t}\n\tminDuration := &durationpb.Duration{\n\t\tSeconds: -9223372036,\n\t\tNanos:   -854775428,\n\t}\n\tsecs := duration.GetSeconds()\n\tnanos := duration.GetNanos()\n\tswitch {\n\tcase nanos <= -1e9 || nanos >= +1e9:\n\t\treturn fmt.Sprintf(\"duration (%v) must have nanos in the range 0 to 999999999\", duration)\n\tcase (secs > 0 && nanos < 0) || (secs < 0 && nanos > 0):\n\t\treturn fmt.Sprintf(\"duration (%v) has seconds and nanos with different signs\", duration)\n\tcase duration.AsDuration() > maxDuration.AsDuration() || duration.AsDuration() < minDuration.AsDuration():\n\t\treturn fmt.Sprintf(\"duration (%v) must be in the range %v to %v\", duration, minDuration, maxDuration)\n\t}\n\treturn \"\"\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/predefined_rules.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"strings\"\n\n\t\"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\"\n\tcelpv \"buf.build/go/protovalidate/cel\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/cel-go/cel\"\n)\n\nconst (\n\tcelFieldNumberPath = int32(1)\n)\n\nfunc checkPredefinedRuleExtension(\n\taddAnnotationFunc func(bufprotosource.Descriptor, bufprotosource.Location, []bufprotosource.Location, string, ...any),\n\textension bufprotosource.Field,\n\textensionResolver protoencoding.Resolver,\n) error {\n\textensionDescriptor, err := extension.AsDescriptor()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Double check.\n\tif !extensionDescriptor.IsExtension() {\n\t\treturn nil\n\t}\n\textendedStandardRuleDescriptor := extensionDescriptor.ContainingMessage()\n\textendedRuleFullName := extendedStandardRuleDescriptor.FullName()\n\t// This function only lints extensions extending buf.validate.*Rules, e.g. buf.validate.StringRules.\n\tif !(strings.HasPrefix(string(extendedRuleFullName), \"buf.validate.\") && strings.HasSuffix(string(extendedRuleFullName), \"Rules\")) {\n\t\treturn nil\n\t}\n\t// Just to be extra sure.\n\tif validate.File_buf_validate_validate_proto.Messages().ByName(extendedRuleFullName.Name()) == nil {\n\t\treturn nil\n\t}\n\tpredefinedRules, err := resolveExtension[*validate.PredefinedRules](extensionDescriptor.Options(), validate.E_Predefined, extensionResolver)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif predefinedRules == nil {\n\t\treturn nil\n\t}\n\tcelEnv, err := cel.NewEnv(\n\t\tcel.Lib(celpv.NewLibrary()),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// In order to evaluate whether the CEL expression for the rule compiles, we need to check\n\t// the type declaration for two keywords, \"this\" and \"rule\".\n\t// \"this\" refers to the type the rule is checking, e.g. StringRules would have type string.\n\t// \"rule\" refers to the type of the rule extension, e.g. a rule that checks the length\n\t// of a string has type int32 to represent the length.\n\t//\n\t// In this example, an int32 field is added to extend string rules, and therefore,\n\t// \"rule\" has type int32 and \"this\" has type \"string\":\n\t//\n\t// extend buf.validate.StringRules {\n\t//\t optional int32 my_max = 47892 [(buf.validate.predefined).cel = {\n\t//\t   id: \"mymax\"\n\t//\t   message: \"at most max\"\n\t//\t   expression: \"size(this) < rule\"\n\t//\t }];\n\t// }\n\t//\n\truleType := celpv.ProtoFieldToType(extensionDescriptor, false, false)\n\t// To check for the type of \"this\", we check the descriptor for the rule type we are extending.\n\tthisType := celTypeForStandardRuleMessageDescriptor(extendedStandardRuleDescriptor)\n\tif thisType == nil {\n\t\treturn syserror.Newf(\"extension for unexpected rule type %q found\", extendedStandardRuleDescriptor.FullName())\n\t}\n\tcelEnv, err = celEnv.Extend(\n\t\tappend(\n\t\t\tcelpv.RequiredEnvOptions(extensionDescriptor),\n\t\t\tcel.Variable(\"rule\", ruleType),\n\t\t\tcel.Variable(\"this\", thisType),\n\t\t\tcel.Variable(\"rules\", cel.ObjectType(string(extendedRuleFullName))),\n\t\t)...,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tcheckCEL(\n\t\tcelEnv,\n\t\tpredefinedRules.GetCel(),\n\t\t\"extension field\",\n\t\t\"Extension field\",\n\t\t\"(buf.validate.predefined).cel\",\n\t\tfunc(index int, format string, args ...any) {\n\t\t\taddAnnotationFunc(\n\t\t\t\textension,\n\t\t\t\textension.OptionExtensionLocation(validate.E_Predefined, celFieldNumberPath, int32(index)),\n\t\t\t\tnil,\n\t\t\t\tformat,\n\t\t\t\targs...,\n\t\t\t)\n\t\t},\n\t\tfalse,\n\t)\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage buflintvalidate\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/internal/buflintvalidate/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buflintvalidate\n\nimport (\n\t\"fmt\"\n\n\t\"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/google/cel-go/cel\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\n// This function is copied directly from protovalidate-go, except refactored to use protoencoding\n// for marshalling and unmarshalling. We also added error handling for marshal/unmarshal.\n//\n// This resolves the given extension and returns the constraints for the extension.\nfunc resolveExtension[C proto.Message](\n\toptions proto.Message,\n\textType protoreflect.ExtensionType,\n\tresolver protoencoding.Resolver,\n) (constraints C, retErr error) {\n\tnum := extType.TypeDescriptor().Number()\n\tvar message proto.Message\n\n\tproto.RangeExtensions(options, func(typ protoreflect.ExtensionType, i any) bool {\n\t\tif num != typ.TypeDescriptor().Number() {\n\t\t\treturn true\n\t\t}\n\t\tmessage, _ = i.(proto.Message)\n\t\treturn false\n\t})\n\n\tif message == nil {\n\t\treturn constraints, nil\n\t} else if m, ok := message.(C); ok {\n\t\treturn m, nil\n\t}\n\tvar ok bool\n\tconstraints, ok = constraints.ProtoReflect().New().Interface().(C)\n\tif !ok {\n\t\treturn constraints, fmt.Errorf(\"unexpected type for constraints %T\", constraints)\n\t}\n\tb, err := protoencoding.NewWireMarshaler().Marshal(message)\n\tif err != nil {\n\t\treturn constraints, err\n\t}\n\treturn constraints, protoencoding.NewWireUnmarshaler(resolver).Unmarshal(b, constraints)\n}\n\nfunc celTypeForStandardRuleMessageDescriptor(\n\truleMessageDescriptor protoreflect.MessageDescriptor,\n) *cel.Type {\n\tswitch ruleMessageDescriptor.FullName() {\n\tcase (&validate.AnyRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.AnyType\n\tcase (&validate.BoolRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.BoolType\n\tcase (&validate.BytesRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.BytesType\n\tcase (&validate.StringRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.StringType\n\tcase\n\t\t(&validate.Int32Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.Int64Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.SInt32Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.SInt64Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.SFixed32Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.SFixed64Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.EnumRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.IntType\n\tcase\n\t\t(&validate.UInt32Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.UInt64Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.Fixed32Rules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.Fixed64Rules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.UintType\n\tcase\n\t\t(&validate.DoubleRules{}).ProtoReflect().Descriptor().FullName(),\n\t\t(&validate.FloatRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.DoubleType\n\tcase (&validate.MapRules{}).ProtoReflect().Descriptor().FullName():\n\t\t// The key and value constraints are handled separately as field constraints, so we use\n\t\t// cel.DynType for key and value here.\n\t\treturn cel.MapType(cel.DynType, cel.DynType)\n\tcase (&validate.RepeatedRules{}).ProtoReflect().Descriptor().FullName():\n\t\t// The repeated type is handled separately as field constraints, so we use cel.DynType\n\t\t// for the value type here.\n\t\treturn cel.ListType(cel.DynType)\n\tcase (&validate.DurationRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.DurationType\n\tcase (&validate.TimestampRules{}).ProtoReflect().Descriptor().FullName():\n\t\treturn cel.TimestampType\n\t}\n\t// We default to returning nil if this does not match with one of the *Rule declarations.\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/testdata/lint/service_pascal_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice Success {}\nservice SuccessTwo {}\nservice SuccessFOOThree {}\nservice fail {}\nservice failTwo {}\nservice fail_three {}\nservice Fail_four {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/bufcheckserver/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcheckserver\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/category.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport \"buf.build/go/bufplugin/check\"\n\nvar _ check.Category = &category{}\nvar _ Category = &category{}\nvar _ RuleOrCategory = &category{}\n\ntype category struct {\n\tcheck.Category\n\n\tpluginName string\n\tpolicyName string\n}\n\nfunc newCategory(checkCategory check.Category, pluginName string, policyName string) *category {\n\treturn &category{\n\t\tCategory:   checkCategory,\n\t\tpluginName: pluginName,\n\t\tpolicyName: policyName,\n\t}\n}\n\nfunc (r *category) PluginName() string {\n\treturn r.pluginName\n}\n\nfunc (r *category) PolicyName() string {\n\treturn r.policyName\n}\n\nfunc (*category) isCategory()       {}\nfunc (*category) isRuleOrCategory() {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/check_client_spec.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/option\"\n)\n\n// checkClientSpec contains a check.Client and details on what to do about\n// options it should pass when calling check.\n//\n// This allows us to take a bufconfig.PluginConfig and turn it into a client/options pair.\ntype checkClientSpec struct {\n\tPluginName string\n\tPolicyName string\n\tClient     check.Client\n\tOptions    option.Options\n}\n\nfunc newCheckClientSpec(pluginName string, policyName string, client check.Client, options option.Options) *checkClientSpec {\n\treturn &checkClientSpec{\n\t\tPluginName: pluginName,\n\t\tPolicyName: policyName,\n\t\tClient:     client,\n\t\tOptions:    options,\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/client.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"strings\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/descriptor\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheckserver\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protosourcepath\"\n\t\"github.com/bufbuild/buf/private/pkg/protoversion\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\ntype client struct {\n\tlogger                          *slog.Logger\n\tstderr                          io.Writer\n\tfileVersionToDefaultCheckClient map[bufconfig.FileVersion]check.Client\n\trunnerProvider                  RunnerProvider\n\tpluginReadFile                  func(string) ([]byte, error)\n\tpluginKeyProvider               bufplugin.PluginKeyProvider\n\tpluginDataProvider              bufplugin.PluginDataProvider\n\tpolicyReadFile                  func(string) ([]byte, error)\n\tpolicyKeyProvider               bufpolicy.PolicyKeyProvider\n\tpolicyDataProvider              bufpolicy.PolicyDataProvider\n\tpolicyPluginKeyProvider         bufpolicy.PolicyPluginKeyProvider\n\tpolicyPluginDataProvider        bufpolicy.PolicyPluginDataProvider\n}\n\nfunc newClient(\n\tlogger *slog.Logger,\n\toptions ...ClientOption,\n) (*client, error) {\n\tclientOptions := newClientOptions()\n\tfor _, option := range options {\n\t\toption(clientOptions)\n\t}\n\t// We want to keep our check.Clients static for caching instead of creating them on every lint and breaking call.\n\tv1beta1DefaultCheckClient, err := check.NewClientForSpec(bufcheckserver.V1Beta1Spec, check.ClientWithCaching())\n\tif err != nil {\n\t\treturn nil, syserror.Wrap(err)\n\t}\n\tv1DefaultCheckClient, err := check.NewClientForSpec(bufcheckserver.V1Spec, check.ClientWithCaching())\n\tif err != nil {\n\t\treturn nil, syserror.Wrap(err)\n\t}\n\tv2DefaultCheckClient, err := check.NewClientForSpec(bufcheckserver.V2Spec, check.ClientWithCaching())\n\tif err != nil {\n\t\treturn nil, syserror.Wrap(err)\n\t}\n\n\treturn &client{\n\t\tlogger: logger,\n\t\tstderr: clientOptions.stderr,\n\t\tfileVersionToDefaultCheckClient: map[bufconfig.FileVersion]check.Client{\n\t\t\tbufconfig.FileVersionV1Beta1: v1beta1DefaultCheckClient,\n\t\t\tbufconfig.FileVersionV1:      v1DefaultCheckClient,\n\t\t\tbufconfig.FileVersionV2:      v2DefaultCheckClient,\n\t\t},\n\t\trunnerProvider:           clientOptions.runnerProvider,\n\t\tpluginReadFile:           clientOptions.pluginReadFile,\n\t\tpluginKeyProvider:        clientOptions.pluginKeyProvider,\n\t\tpluginDataProvider:       clientOptions.pluginDataProvider,\n\t\tpolicyReadFile:           clientOptions.policyReadFile,\n\t\tpolicyKeyProvider:        clientOptions.policyKeyProvider,\n\t\tpolicyDataProvider:       clientOptions.policyDataProvider,\n\t\tpolicyPluginKeyProvider:  clientOptions.policyPluginKeyProvider,\n\t\tpolicyPluginDataProvider: clientOptions.policyPluginDataProvider,\n\t}, nil\n}\n\nfunc (c *client) Lint(\n\tctx context.Context,\n\tlintConfig bufconfig.LintConfig,\n\timage bufimage.Image,\n\toptions ...LintOption,\n) error {\n\tdefer xslog.DebugProfile(c.logger)()\n\n\tlintOptions := newLintOptions()\n\tfor _, option := range options {\n\t\toption.applyToLint(lintOptions)\n\t}\n\t// Run lint checks.\n\tvar annotations []*annotation\n\tlintAnnotations, err := c.lint(\n\t\tctx,\n\t\timage,\n\t\tlintConfig,\n\t\tlintOptions.pluginConfigs,\n\t\tnil, // policyConfig.\n\t\tlintOptions.relatedCheckConfigs,\n\t\tlen(lintOptions.policyConfigs) > 0, // hasPolicyConfigs.\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tannotations = append(annotations, lintAnnotations...)\n\t// Run lint policy checks.\n\tpolicies, err := c.getPolicies(ctx, lintOptions.policyConfigs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor index, policy := range policies {\n\t\tpolicyConfig := lintOptions.policyConfigs[index]\n\t\tpolicyLintConfig, err := policyToBufConfigLintConfig(policy, policyConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpluginConfigs, err := policyToBufConfigPluginConfigs(policy)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpolicyAnnotations, err := c.lint(\n\t\t\tctx,\n\t\t\timage,\n\t\t\tpolicyLintConfig,\n\t\t\tpluginConfigs,\n\t\t\tpolicyConfig,\n\t\t\tnil,  // relatedCheckConfigs.\n\t\t\ttrue, // hasPolicyConfigs.\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tannotations = append(annotations, policyAnnotations...)\n\t}\n\tif len(annotations) == 0 {\n\t\treturn nil\n\t}\n\treturn bufanalysis.NewFileAnnotationSet(\n\t\tannotationsToFileAnnotations(\n\t\t\timageToPathToExternalPath(\n\t\t\t\timage,\n\t\t\t),\n\t\t\tannotations,\n\t\t)...,\n\t)\n}\n\nfunc (c *client) lint(\n\tctx context.Context,\n\timage bufimage.Image,\n\tlintConfig bufconfig.LintConfig,\n\tpluginConfigs []bufconfig.PluginConfig,\n\tpolicyConfig bufconfig.PolicyConfig,\n\trelatedCheckConfigs []bufconfig.CheckConfig,\n\thasPolicyConfigs bool,\n) ([]*annotation, error) {\n\tif lintConfig.Disabled() {\n\t\treturn nil, nil\n\t}\n\tallRules, allCategories, err := c.allRulesAndCategories(\n\t\tctx,\n\t\tlintConfig.FileVersion(),\n\t\tpluginConfigs,\n\t\tpolicyConfig,\n\t\tlintConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig, err := configForLintConfig(lintConfig, allRules, allCategories, relatedCheckConfigs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfigName := bufconfig.DefaultBufYAMLFileName\n\tif policyConfig != nil {\n\t\tconfigName = policyConfig.Name()\n\t}\n\tlogRulesConfig(c.logger, configName, config.rulesConfig, hasPolicyConfigs)\n\tfiles, err := descriptor.FileDescriptorsForProtoFileDescriptors(imageToProtoFileDescriptors(image))\n\tif err != nil {\n\t\t// An Image may be invalid if it does not contain all of the required dependencies.\n\t\treturn nil, fmt.Errorf(\"input image: %w\", err)\n\t}\n\trequest, err := check.NewRequest(\n\t\tfiles,\n\t\tcheck.WithRuleIDs(config.RuleIDs...),\n\t\tcheck.WithOptions(config.DefaultOptions),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmultiClient, err := c.getMultiClient(\n\t\tctx,\n\t\tlintConfig.FileVersion(),\n\t\tpluginConfigs,\n\t\tpolicyConfig,\n\t\tlintConfig.DisableBuiltin(),\n\t\tconfig.DefaultOptions,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tannotations, err := multiClient.Check(ctx, request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(annotations) == 0 {\n\t\treturn nil, nil\n\t}\n\treturn filterAnnotations(config, annotations)\n}\n\nfunc (c *client) Breaking(\n\tctx context.Context,\n\tbreakingConfig bufconfig.BreakingConfig,\n\timage bufimage.Image,\n\tagainstImage bufimage.Image,\n\toptions ...BreakingOption,\n) error {\n\tdefer xslog.DebugProfile(c.logger)()\n\n\tbreakingOptions := newBreakingOptions()\n\tfor _, option := range options {\n\t\toption.applyToBreaking(breakingOptions)\n\t}\n\t// Run breaking checks.\n\tvar annotations []*annotation\n\tbreakingAnnotations, err := c.breaking(\n\t\tctx,\n\t\timage,\n\t\tagainstImage,\n\t\tbreakingConfig,\n\t\tbreakingOptions.pluginConfigs,\n\t\tnil, // policyConfig.\n\t\tbreakingOptions.excludeImports,\n\t\tbreakingOptions.relatedCheckConfigs,\n\t\tlen(breakingOptions.policyConfigs) > 0, // hasPolicyConfigs.\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tannotations = append(annotations, breakingAnnotations...)\n\t// Run breaking policy checks.\n\tpolicies, err := c.getPolicies(ctx, breakingOptions.policyConfigs)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor index, policy := range policies {\n\t\tpolicyConfig := breakingOptions.policyConfigs[index]\n\t\tpolicyBreakingConfig, err := policyToBufConfigBreakingConfig(policy, policyConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpluginConfigs, err := policyToBufConfigPluginConfigs(policy)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpolicyAnnotations, err := c.breaking(\n\t\t\tctx,\n\t\t\timage,\n\t\t\tagainstImage,\n\t\t\tpolicyBreakingConfig,\n\t\t\tpluginConfigs,\n\t\t\tpolicyConfig,\n\t\t\tbreakingOptions.excludeImports,\n\t\t\tnil,  // relatedCheckConfigs.\n\t\t\ttrue, // hasPolicyConfigs.\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tannotations = append(annotations, policyAnnotations...)\n\t}\n\tif len(annotations) == 0 {\n\t\treturn nil\n\t}\n\treturn bufanalysis.NewFileAnnotationSet(\n\t\tannotationsToFileAnnotations(\n\t\t\timageToPathToExternalPath(\n\t\t\t\timage,\n\t\t\t),\n\t\t\tannotations,\n\t\t)...,\n\t)\n}\n\nfunc (c *client) breaking(\n\tctx context.Context,\n\timage bufimage.Image,\n\tagainstImage bufimage.Image,\n\tbreakingConfig bufconfig.BreakingConfig,\n\tpluginConfigs []bufconfig.PluginConfig,\n\tpolicyConfig bufconfig.PolicyConfig,\n\texcludeImports bool,\n\trelatedCheckConfigs []bufconfig.CheckConfig,\n\thasPolicyConfigs bool,\n) ([]*annotation, error) {\n\tif breakingConfig.Disabled() {\n\t\treturn nil, nil\n\t}\n\tallRules, allCategories, err := c.allRulesAndCategories(\n\t\tctx,\n\t\tbreakingConfig.FileVersion(),\n\t\tpluginConfigs,\n\t\tpolicyConfig,\n\t\tbreakingConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig, err := configForBreakingConfig(\n\t\tbreakingConfig,\n\t\tallRules,\n\t\tallCategories,\n\t\texcludeImports,\n\t\trelatedCheckConfigs,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfigName := bufconfig.DefaultBufYAMLFileName\n\tif policyConfig != nil {\n\t\tconfigName = policyConfig.Name()\n\t}\n\tlogRulesConfig(c.logger, configName, config.rulesConfig, hasPolicyConfigs)\n\tfileDescriptors, err := descriptor.FileDescriptorsForProtoFileDescriptors(imageToProtoFileDescriptors(image))\n\tif err != nil {\n\t\t// An Image may be invalid if it does not contain all of the required dependencies.\n\t\treturn nil, fmt.Errorf(\"input image: %w\", err)\n\t}\n\tagainstFileDescriptors, err := descriptor.FileDescriptorsForProtoFileDescriptors(imageToProtoFileDescriptors(againstImage))\n\tif err != nil {\n\t\t// An Image may be invalid if it does not contain all of the required dependencies.\n\t\treturn nil, fmt.Errorf(\"against image: %w\", err)\n\t}\n\trequest, err := check.NewRequest(\n\t\tfileDescriptors,\n\t\tcheck.WithRuleIDs(config.RuleIDs...),\n\t\tcheck.WithAgainstFileDescriptors(againstFileDescriptors),\n\t\tcheck.WithOptions(config.DefaultOptions),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmultiClient, err := c.getMultiClient(\n\t\tctx,\n\t\tbreakingConfig.FileVersion(),\n\t\tpluginConfigs,\n\t\tpolicyConfig,\n\t\tbreakingConfig.DisableBuiltin(),\n\t\tconfig.DefaultOptions,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tannotations, err := multiClient.Check(ctx, request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(annotations) == 0 {\n\t\treturn nil, nil\n\t}\n\treturn filterAnnotations(config, annotations)\n}\n\nfunc (c *client) ConfiguredRules(\n\tctx context.Context,\n\truleType check.RuleType,\n\tcheckConfig bufconfig.CheckConfig,\n\toptions ...ConfiguredRulesOption,\n) ([]Rule, error) {\n\tdefer xslog.DebugProfile(c.logger)()\n\n\tconfiguredRulesOptions := newConfiguredRulesOptions()\n\tfor _, option := range options {\n\t\toption.applyToConfiguredRules(configuredRulesOptions)\n\t}\n\trules, categories, err := c.allRulesAndCategories(\n\t\tctx,\n\t\tcheckConfig.FileVersion(),\n\t\tconfiguredRulesOptions.pluginConfigs,\n\t\tnil, // PolicyConfig.\n\t\tcheckConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trulesConfig, err := rulesConfigForCheckConfig(checkConfig, rules, categories, ruleType, configuredRulesOptions.relatedCheckConfigs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlogRulesConfig(c.logger, \"\", rulesConfig, len(configuredRulesOptions.policyConfigs) > 0)\n\tallRules := rulesForRuleIDs(rules, rulesConfig.RuleIDs)\n\tpolicies, err := c.getPolicies(ctx, configuredRulesOptions.policyConfigs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor index, policy := range policies {\n\t\tpolicyConfig := configuredRulesOptions.policyConfigs[index]\n\t\tpluginConfigs, err := policyToBufConfigPluginConfigs(policy)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Load the check config for the rule type.\n\t\tvar policyCheckConfig bufconfig.CheckConfig\n\t\tswitch ruleType {\n\t\tcase check.RuleTypeLint:\n\t\t\tpolicyCheckConfig, err = policyToBufConfigLintConfig(policy, policyConfig)\n\t\tcase check.RuleTypeBreaking:\n\t\t\tpolicyCheckConfig, err = policyToBufConfigBreakingConfig(policy, policyConfig)\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown check.RuleType: %v\", ruleType)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicyRules, policyCategories, err := c.allRulesAndCategories(ctx, policyCheckConfig.FileVersion(), pluginConfigs, policyConfig, false)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicyRulesConfig, err := rulesConfigForCheckConfig(policyCheckConfig, policyRules, policyCategories, ruleType, nil)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tallRules = append(allRules, rulesForRuleIDs(policyRules, policyRulesConfig.RuleIDs)...)\n\t}\n\treturn allRules, nil\n}\n\nfunc (c *client) AllRules(\n\tctx context.Context,\n\truleType check.RuleType,\n\tfileVersion bufconfig.FileVersion,\n\toptions ...AllRulesOption,\n) ([]Rule, error) {\n\tdefer xslog.DebugProfile(c.logger)()\n\n\tallRulesOptions := newAllRulesOptions()\n\tfor _, option := range options {\n\t\toption.applyToAllRules(allRulesOptions)\n\t}\n\trules, _, err := c.allRulesAndCategories(ctx, fileVersion, allRulesOptions.pluginConfigs, nil, false)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicies, err := c.getPolicies(ctx, allRulesOptions.policyConfigs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor index, policy := range policies {\n\t\tpolicyConfig := allRulesOptions.policyConfigs[index]\n\t\tpluginConfigs, err := policyToBufConfigPluginConfigs(policy)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicyRules, _, err := c.allRulesAndCategories(ctx, fileVersion, pluginConfigs, policyConfig, false)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trules = append(rules, policyRules...)\n\t}\n\treturn rulesForType(rules, ruleType), nil\n}\n\nfunc (c *client) AllCategories(\n\tctx context.Context,\n\tfileVersion bufconfig.FileVersion,\n\toptions ...AllCategoriesOption,\n) ([]Category, error) {\n\tdefer xslog.DebugProfile(c.logger)()\n\n\tallCategoriesOptions := newAllCategoriesOptions()\n\tfor _, option := range options {\n\t\toption.applyToAllCategories(allCategoriesOptions)\n\t}\n\t_, categories, err := c.allRulesAndCategories(ctx, fileVersion, allCategoriesOptions.pluginConfigs, nil, false)\n\treturn categories, err\n}\n\nfunc (c *client) allRulesAndCategories(\n\tctx context.Context,\n\tfileVersion bufconfig.FileVersion,\n\tpluginConfigs []bufconfig.PluginConfig,\n\tpolicyConfig bufconfig.PolicyConfig, // May be nil.\n\tdisableBuiltin bool,\n) ([]Rule, []Category, error) {\n\t// Just passing through to fulfill all contracts, ie checkClientSpec has non-nil Options.\n\t// Options are not used here.\n\t// config struct really just needs refactoring.\n\tmultiClient, err := c.getMultiClient(ctx, fileVersion, pluginConfigs, policyConfig, disableBuiltin, option.EmptyOptions)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn multiClient.ListRulesAndCategories(ctx)\n}\n\nfunc (c *client) getMultiClient(\n\tctx context.Context,\n\tfileVersion bufconfig.FileVersion,\n\tpluginConfigs []bufconfig.PluginConfig,\n\tpolicyConfig bufconfig.PolicyConfig,\n\tdisableBuiltin bool,\n\tdefaultOptions option.Options,\n) (*multiClient, error) {\n\tvar policyConfigName string\n\tif policyConfig != nil {\n\t\tpolicyConfigName = policyConfig.Name()\n\t}\n\tvar checkClientSpecs []*checkClientSpec\n\tif !disableBuiltin {\n\t\tdefaultCheckClient, ok := c.fileVersionToDefaultCheckClient[fileVersion]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"unknown FileVersion: %v\", fileVersion)\n\t\t}\n\t\tcheckClientSpecs = append(\n\t\t\tcheckClientSpecs,\n\t\t\t// We do not set PluginName for default check.Clients.\n\t\t\tnewCheckClientSpec(\"\", policyConfigName, defaultCheckClient, defaultOptions),\n\t\t)\n\t}\n\tplugins, err := c.getPlugins(ctx, pluginConfigs, policyConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor index, pluginConfig := range pluginConfigs {\n\t\toptions, err := option.NewOptions(pluginConfig.Options())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not parse options for plugin %q: %w\", pluginConfig.Name(), err)\n\t\t}\n\t\tif c.runnerProvider == nil {\n\t\t\treturn nil, fmt.Errorf(\"must set a RunnerProvider to use plugins\")\n\t\t}\n\t\trunner, err := c.runnerProvider.NewRunner(plugins[index])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not create runner for plugin %q: %w\", pluginConfig.Name(), err)\n\t\t}\n\t\tcheckClient := check.NewClient(\n\t\t\tpluginrpc.NewClient(\n\t\t\t\trunner,\n\t\t\t\tpluginrpc.ClientWithStderr(c.stderr),\n\t\t\t\t// We have to set binary as some things cannot be encoded as JSON.\n\t\t\t\t// Example: google.protobuf.Timestamps with positive seconds and negative nanos.\n\t\t\t\t// We still want to send this over the wire to lint.\n\t\t\t\t//\n\t\t\t\t// FormatBinary is the default, but we're just being explicit here.\n\t\t\t\tpluginrpc.ClientWithFormat(pluginrpc.FormatBinary),\n\t\t\t),\n\t\t\tcheck.ClientWithCaching(),\n\t\t)\n\t\tcheckClientSpecs = append(\n\t\t\tcheckClientSpecs,\n\t\t\tnewCheckClientSpec(pluginConfig.Name(), policyConfigName, checkClient, options),\n\t\t)\n\t}\n\treturn newMultiClient(c.logger, checkClientSpecs), nil\n}\n\nfunc (c *client) getPlugins(ctx context.Context, pluginConfigs []bufconfig.PluginConfig, policyConfig bufconfig.PolicyConfig) ([]bufplugin.Plugin, error) {\n\tif len(pluginConfigs) == 0 {\n\t\treturn nil, nil\n\t}\n\tplugins := make([]bufplugin.Plugin, len(pluginConfigs))\n\n\tvar indexedPluginRefs []xslices.Indexed[bufparse.Ref]\n\tfor index, pluginConfig := range pluginConfigs {\n\t\tswitch pluginConfig.Type() {\n\t\tcase bufconfig.PluginConfigTypeLocal:\n\t\t\tplugin, err := bufplugin.NewLocalPlugin(\n\t\t\t\tpluginConfig.Name(),\n\t\t\t\tpluginConfig.Args(),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"could not create local Plugin %q: %w\", pluginConfig.Name(), err)\n\t\t\t}\n\t\t\tplugins[index] = plugin\n\t\tcase bufconfig.PluginConfigTypeLocalWasm:\n\t\t\tif c.pluginReadFile == nil {\n\t\t\t\t// Local Wasm plugins are not supported without a pluginReadFile.\n\t\t\t\treturn nil, fmt.Errorf(\"unable to read local Wasm Plugin %q\", pluginConfig.Name())\n\t\t\t}\n\t\t\tvar pluginFullName bufparse.FullName\n\t\t\tif ref := pluginConfig.Ref(); ref != nil {\n\t\t\t\tpluginFullName = ref.FullName()\n\t\t\t}\n\t\t\tplugin, err := bufplugin.NewLocalWasmPlugin(\n\t\t\t\tpluginFullName,\n\t\t\t\tpluginConfig.Name(),\n\t\t\t\tpluginConfig.Args(),\n\t\t\t\tfunc() ([]byte, error) {\n\t\t\t\t\treturn c.pluginReadFile(pluginConfig.Name())\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tplugins[index] = plugin\n\t\tcase bufconfig.PluginConfigTypeRemoteWasm:\n\t\t\tpluginRef := pluginConfig.Ref()\n\t\t\tif pluginRef == nil {\n\t\t\t\treturn nil, syserror.Newf(\"missing Ref for remote PluginConfig %q\", pluginConfig.Name())\n\t\t\t}\n\t\t\tindexedPluginRefs = append(indexedPluginRefs, xslices.Indexed[bufparse.Ref]{\n\t\t\t\tValue: pluginRef,\n\t\t\t\tIndex: index,\n\t\t\t})\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown PluginConfig type %q\", pluginConfig.Type())\n\t\t}\n\t}\n\t// Load the remote plugin data for each plugin ref.\n\tif len(indexedPluginRefs) > 0 {\n\t\tpluginKeyProvider := c.pluginKeyProvider\n\t\tpluginDataProvider := c.pluginDataProvider\n\t\tif policyConfig != nil {\n\t\t\t// Resolve the Plugin providers for the policy config.\n\t\t\tpluginKeyProvider = c.policyPluginKeyProvider.GetPluginKeyProviderForPolicy(policyConfig.Name())\n\t\t\tpluginDataProvider = c.policyPluginDataProvider.GetPluginDataProviderForPolicy(policyConfig.Name())\n\t\t}\n\t\tpluginRefs := xslices.IndexedToValues(indexedPluginRefs)\n\t\tpluginKeys, err := pluginKeyProvider.GetPluginKeysForPluginRefs(ctx, pluginRefs, bufplugin.DigestTypeP1)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\tif policyConfig != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unable to resolve plugins for policy %q: %w\", policyConfig.Name(), err)\n\t\t\t\t}\n\t\t\t\treturn nil, fmt.Errorf(\"unable to resolve plugins: %w\", err)\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginDatas, err := pluginDataProvider.GetPluginDatasForPluginKeys(ctx, pluginKeys)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(pluginDatas) != len(pluginRefs) {\n\t\t\treturn nil, syserror.Newf(\"expected %d PluginData, got %d\", len(pluginRefs), len(pluginDatas))\n\t\t}\n\t\tfor dataIndex, indexedPluginRef := range indexedPluginRefs {\n\t\t\tpluginData := pluginDatas[dataIndex]\n\t\t\tpluginRef := indexedPluginRef.Value\n\t\t\tindex := indexedPluginRef.Index\n\t\t\tpluginConfig := pluginConfigs[index]\n\t\t\tplugin, err := bufplugin.NewRemoteWasmPlugin(\n\t\t\t\tpluginRef.FullName(),\n\t\t\t\tpluginConfig.Args(),\n\t\t\t\tpluginData.PluginKey().CommitID(),\n\t\t\t\tpluginData.Data,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"could not create remote Plugin %q: %w\", pluginRef.String(), err)\n\t\t\t}\n\t\t\tplugins[index] = plugin\n\t\t}\n\t}\n\treturn plugins, nil\n}\n\nfunc (c *client) getPolicies(ctx context.Context, policyConfigs []bufconfig.PolicyConfig) ([]bufpolicy.Policy, error) {\n\tif len(policyConfigs) == 0 {\n\t\treturn nil, nil\n\t}\n\tpolicies := make([]bufpolicy.Policy, len(policyConfigs))\n\n\tvar indexedPolicyRefs []xslices.Indexed[bufparse.Ref]\n\tfor index, policyConfig := range policyConfigs {\n\t\tif ref := policyConfig.Ref(); ref != nil {\n\t\t\tindexedPolicyRefs = append(indexedPolicyRefs, xslices.Indexed[bufparse.Ref]{\n\t\t\t\tValue: ref,\n\t\t\t\tIndex: index,\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\t\t// Local policy config.\n\t\tif c.policyReadFile == nil {\n\t\t\t// Local policy configs are not supported without a policyReadFile.\n\t\t\treturn nil, fmt.Errorf(\"unable to read local Policy %q\", policyConfig.Name())\n\t\t}\n\t\tpolicyData, err := c.policyReadFile(policyConfig.Name())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not read local policy config %q: %w\", policyConfig.Name(), err)\n\t\t}\n\t\treader := bytes.NewReader(policyData)\n\t\tpolicyFile, err := bufpolicyconfig.ReadBufPolicyYAMLFile(reader, policyConfig.Name())\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not read policy file %q: %w\", policyConfig.Name(), err)\n\t\t}\n\t\tpolicy, err := bufpolicy.NewPolicy(\"\", nil, policyConfig.Name(), uuid.Nil, policyFile.PolicyConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicies[index] = policy\n\t}\n\t// Load the remote policy data for each policy ref.\n\tif len(indexedPolicyRefs) > 0 {\n\t\tpolicyRefs := xslices.IndexedToValues(indexedPolicyRefs)\n\t\tpolicyKeys, err := c.policyKeyProvider.GetPolicyKeysForPolicyRefs(ctx, policyRefs, bufpolicy.DigestTypeO1)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not get PolicyKeys for PolicyRefs: %w\", err)\n\t\t}\n\t\tpolicyDatas, err := c.policyDataProvider.GetPolicyDatasForPolicyKeys(ctx, policyKeys)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not get PolicyDatas for PolicyKeys: %w\", err)\n\t\t}\n\t\tif len(policyDatas) != len(policyRefs) {\n\t\t\treturn nil, syserror.Newf(\"expected %d PolicyData, got %d\", len(policyRefs), len(policyDatas))\n\t\t}\n\t\tfor dataIndex, indexedPolicyRef := range indexedPolicyRefs {\n\t\t\tpolicyData := policyDatas[dataIndex]\n\t\t\tpolicyKey := policyData.PolicyKey()\n\t\t\tindex := indexedPolicyRef.Index\n\t\t\tpolicy, err := bufpolicy.NewPolicy(\"\", policyKey.FullName(), policyKey.FullName().String(), policyKey.CommitID(), func() (bufpolicy.PolicyConfig, error) {\n\t\t\t\treturn policyData.Config()\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpolicies[index] = policy\n\t\t}\n\t}\n\treturn policies, nil\n}\n\nfunc filterAnnotations(\n\tconfig *config,\n\tannotations []*annotation,\n) ([]*annotation, error) {\n\treturn xslices.FilterError(\n\t\tannotations,\n\t\tfunc(annotation *annotation) (bool, error) {\n\t\t\tignore, err := ignoreAnnotation(config, annotation)\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\treturn !ignore, nil\n\t\t},\n\t)\n}\n\nfunc ignoreAnnotation(\n\tconfig *config,\n\tannotation *annotation,\n) (bool, error) {\n\tif fileLocation := annotation.FileLocation(); fileLocation != nil {\n\t\tignore, err := ignoreFileLocation(config, annotation.RuleID(), fileLocation)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif ignore {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\tif againstFileLocation := annotation.AgainstFileLocation(); againstFileLocation != nil {\n\t\treturn ignoreFileLocation(config, annotation.RuleID(), againstFileLocation)\n\t}\n\treturn false, nil\n}\n\nfunc ignoreFileLocation(\n\tconfig *config,\n\truleID string,\n\tfileLocation descriptor.FileLocation,\n) (bool, error) {\n\tfileDescriptor := fileLocation.FileDescriptor()\n\tif config.ExcludeImports && fileDescriptor.IsImport() {\n\t\treturn true, nil\n\t}\n\n\tprotoreflectFileDescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\tpath := protoreflectFileDescriptor.Path()\n\tif normalpath.MapHasEqualOrContainingPath(config.IgnoreRootPaths, path, normalpath.Relative) {\n\t\treturn true, nil\n\t}\n\t// If the config says to ignore this specific rule for this path, ignore this location, otherwise we look for other forms of ignores.\n\tif ignoreRootPaths, ok := config.IgnoreRuleIDToRootPaths[ruleID]; ok && normalpath.MapHasEqualOrContainingPath(ignoreRootPaths, path, normalpath.Relative) {\n\t\treturn true, nil\n\t}\n\n\t// Not a great design, but will never be triggered by lint since this is never set.\n\tif config.IgnoreUnstablePackages {\n\t\tif packageVersion, ok := protoversion.NewPackageVersionForPackage(string(protoreflectFileDescriptor.Package())); ok {\n\t\t\tif packageVersion.StabilityLevel() != protoversion.StabilityLevelStable {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t}\n\n\t// Not a great design, but will never be triggered by breaking since this is never set.\n\t// Therefore, never called for an againstLocation  (since lint never has againstLocations).\n\tif config.AllowCommentIgnores && config.CommentIgnorePrefix != \"\" {\n\t\tsourcePath := fileLocation.SourcePath()\n\t\tif len(sourcePath) == 0 {\n\t\t\treturn false, nil\n\t\t}\n\t\tassociatedSourcePaths, err := protosourcepath.GetAssociatedSourcePaths(sourcePath)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tsourceLocations := protoreflectFileDescriptor.SourceLocations()\n\t\tfor _, associatedSourcePath := range associatedSourcePaths {\n\t\t\tsourceLocation := sourceLocations.ByPath(associatedSourcePath)\n\t\t\tif leadingComments := sourceLocation.LeadingComments; leadingComments != \"\" {\n\t\t\t\tfor _, line := range xstrings.SplitTrimLinesNoEmpty(leadingComments) {\n\t\t\t\t\tif checkCommentLineForCheckIgnore(line, config.CommentIgnorePrefix, ruleID) {\n\t\t\t\t\t\treturn true, nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false, nil\n}\n\n// checkCommentLineForCheckIgnore checks that the comment line starts with the configured\n// comment ignore prefix, a space and the ruleID of the check.\n//\n// All of the following comments are valid, ignoring SERVICE_PASCAL_CASE and this rule only:\n//\n//\t// buf:lint:ignore SERVICE_PASCAL_CASE, SERVICE_SUFFIX (only SERVICE_PASCAL_CASE is ignored)\n//\t// buf:lint:ignore SERVICE_PASCAL_CASE\n//\t// buf:lint:ignore SERVICE_PASCAL_CASEsome other comment\n//\t// buf:lint:ignore SERVICE_PASCAL_CASE some other comment\n//\n// While the following is invalid and a nop\n//\n//\t// buf:lint:ignoreSERVICE_PASCAL_CASE\nfunc checkCommentLineForCheckIgnore(\n\tcommentLine string,\n\tcommentIgnorePrefix string,\n\truleID string,\n) bool {\n\tfullIgnorePrefix := commentIgnorePrefix + \" \" + ruleID\n\treturn strings.HasPrefix(commentLine, fullIgnorePrefix)\n}\n\ntype lintOptions struct {\n\tpluginConfigs       []bufconfig.PluginConfig\n\tpolicyConfigs       []bufconfig.PolicyConfig\n\trelatedCheckConfigs []bufconfig.CheckConfig\n}\n\nfunc newLintOptions() *lintOptions {\n\treturn &lintOptions{}\n}\n\ntype breakingOptions struct {\n\tpluginConfigs       []bufconfig.PluginConfig\n\tpolicyConfigs       []bufconfig.PolicyConfig\n\texcludeImports      bool\n\trelatedCheckConfigs []bufconfig.CheckConfig\n}\n\nfunc newBreakingOptions() *breakingOptions {\n\treturn &breakingOptions{}\n}\n\ntype configuredRulesOptions struct {\n\tpluginConfigs       []bufconfig.PluginConfig\n\tpolicyConfigs       []bufconfig.PolicyConfig\n\trelatedCheckConfigs []bufconfig.CheckConfig\n}\n\nfunc newConfiguredRulesOptions() *configuredRulesOptions {\n\treturn &configuredRulesOptions{}\n}\n\ntype allRulesOptions struct {\n\tpluginConfigs []bufconfig.PluginConfig\n\tpolicyConfigs []bufconfig.PolicyConfig\n}\n\nfunc newAllRulesOptions() *allRulesOptions {\n\treturn &allRulesOptions{}\n}\n\ntype allCategoriesOptions struct {\n\tpluginConfigs []bufconfig.PluginConfig\n\tpolicyConfigs []bufconfig.PolicyConfig\n}\n\nfunc newAllCategoriesOptions() *allCategoriesOptions {\n\treturn &allCategoriesOptions{}\n}\n\ntype clientOptions struct {\n\tstderr                   io.Writer\n\trunnerProvider           RunnerProvider\n\tpluginReadFile           func(string) ([]byte, error)\n\tpluginKeyProvider        bufplugin.PluginKeyProvider\n\tpluginDataProvider       bufplugin.PluginDataProvider\n\tpolicyReadFile           func(string) ([]byte, error)\n\tpolicyKeyProvider        bufpolicy.PolicyKeyProvider\n\tpolicyDataProvider       bufpolicy.PolicyDataProvider\n\tpolicyPluginKeyProvider  bufpolicy.PolicyPluginKeyProvider\n\tpolicyPluginDataProvider bufpolicy.PolicyPluginDataProvider\n}\n\nfunc newClientOptions() *clientOptions {\n\treturn &clientOptions{\n\t\tpluginKeyProvider:        bufplugin.NopPluginKeyProvider,\n\t\tpluginDataProvider:       bufplugin.NopPluginDataProvider,\n\t\tpolicyKeyProvider:        bufpolicy.NopPolicyKeyProvider,\n\t\tpolicyDataProvider:       bufpolicy.NopPolicyDataProvider,\n\t\tpolicyPluginKeyProvider:  bufpolicy.NopPolicyPluginKeyProvider,\n\t\tpolicyPluginDataProvider: bufpolicy.NopPolicyPluginDataProvider,\n\t}\n}\n\ntype excludeImportsOption struct{}\n\nfunc (e *excludeImportsOption) applyToBreaking(breakingOptions *breakingOptions) {\n\tbreakingOptions.excludeImports = true\n}\n\ntype pluginConfigsOption struct {\n\tpluginConfigs []bufconfig.PluginConfig\n}\n\nfunc (p *pluginConfigsOption) applyToLint(lintOptions *lintOptions) {\n\tlintOptions.pluginConfigs = append(lintOptions.pluginConfigs, p.pluginConfigs...)\n}\n\nfunc (p *pluginConfigsOption) applyToBreaking(breakingOptions *breakingOptions) {\n\tbreakingOptions.pluginConfigs = append(breakingOptions.pluginConfigs, p.pluginConfigs...)\n}\n\nfunc (p *pluginConfigsOption) applyToConfiguredRules(configuredRulesOptions *configuredRulesOptions) {\n\tconfiguredRulesOptions.pluginConfigs = append(configuredRulesOptions.pluginConfigs, p.pluginConfigs...)\n}\n\nfunc (p *pluginConfigsOption) applyToAllRules(allRulesOptions *allRulesOptions) {\n\tallRulesOptions.pluginConfigs = append(allRulesOptions.pluginConfigs, p.pluginConfigs...)\n}\n\nfunc (p *pluginConfigsOption) applyToAllCategories(allCategoriesOptions *allCategoriesOptions) {\n\tallCategoriesOptions.pluginConfigs = append(allCategoriesOptions.pluginConfigs, p.pluginConfigs...)\n}\n\ntype policyConfigsOption struct {\n\tpolicyConfigs []bufconfig.PolicyConfig\n}\n\nfunc (p *policyConfigsOption) applyToLint(lintOptions *lintOptions) {\n\tlintOptions.policyConfigs = append(lintOptions.policyConfigs, p.policyConfigs...)\n}\n\nfunc (p *policyConfigsOption) applyToBreaking(breakingOptions *breakingOptions) {\n\tbreakingOptions.policyConfigs = append(breakingOptions.policyConfigs, p.policyConfigs...)\n}\n\nfunc (p *policyConfigsOption) applyToConfiguredRules(configuredRulesOptions *configuredRulesOptions) {\n\tconfiguredRulesOptions.policyConfigs = append(configuredRulesOptions.policyConfigs, p.policyConfigs...)\n}\n\nfunc (p *policyConfigsOption) applyToAllRules(allRulesOptions *allRulesOptions) {\n\tallRulesOptions.policyConfigs = append(allRulesOptions.policyConfigs, p.policyConfigs...)\n}\n\nfunc (p *policyConfigsOption) applyToAllCategories(allCategoriesOptions *allCategoriesOptions) {\n\tallCategoriesOptions.policyConfigs = append(allCategoriesOptions.policyConfigs, p.policyConfigs...)\n}\n\ntype relatedCheckConfigsOption struct {\n\trelatedCheckConfigs []bufconfig.CheckConfig\n}\n\nfunc (r *relatedCheckConfigsOption) applyToLint(lintOptions *lintOptions) {\n\tlintOptions.relatedCheckConfigs = append(lintOptions.relatedCheckConfigs, r.relatedCheckConfigs...)\n}\n\nfunc (r *relatedCheckConfigsOption) applyToBreaking(breakingOptions *breakingOptions) {\n\tbreakingOptions.relatedCheckConfigs = append(breakingOptions.relatedCheckConfigs, r.relatedCheckConfigs...)\n}\n\nfunc (r *relatedCheckConfigsOption) applyToConfiguredRules(configuredRulesOptions *configuredRulesOptions) {\n\tconfiguredRulesOptions.relatedCheckConfigs = append(configuredRulesOptions.relatedCheckConfigs, r.relatedCheckConfigs...)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n)\n\ntype config struct {\n\t*rulesConfig\n\t*optionsConfig\n}\n\nfunc configForLintConfig(\n\tlintConfig bufconfig.LintConfig,\n\tallRules []Rule,\n\tallCategories []Category,\n\trelatedCheckConfigs []bufconfig.CheckConfig,\n) (*config, error) {\n\trulesConfig, err := rulesConfigForCheckConfig(lintConfig, allRules, allCategories, check.RuleTypeLint, relatedCheckConfigs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\toptionsConfig, err := optionsConfigForLintConfig(lintConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &config{\n\t\trulesConfig:   rulesConfig,\n\t\toptionsConfig: optionsConfig,\n\t}, nil\n}\n\nfunc configForBreakingConfig(\n\tbreakingConfig bufconfig.BreakingConfig,\n\tallRules []Rule,\n\tallCategories []Category,\n\texcludeImports bool,\n\trelatedCheckConfigs []bufconfig.CheckConfig,\n) (*config, error) {\n\trulesConfig, err := rulesConfigForCheckConfig(breakingConfig, allRules, allCategories, check.RuleTypeBreaking, relatedCheckConfigs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\toptionsConfig, err := optionsConfigForBreakingConfig(breakingConfig, excludeImports)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &config{\n\t\trulesConfig:   rulesConfig,\n\t\toptionsConfig: optionsConfig,\n\t}, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/file_info.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\ntype fileInfo struct {\n\tpath         string\n\texternalPath string\n}\n\nfunc newFileInfo(path string, externalPath string) *fileInfo {\n\treturn &fileInfo{\n\t\tpath:         path,\n\t\texternalPath: externalPath,\n\t}\n}\n\nfunc (f *fileInfo) Path() string {\n\treturn f.path\n}\n\nfunc (f *fileInfo) ExternalPath() string {\n\tif f.externalPath != \"\" {\n\t\treturn f.externalPath\n\t}\n\treturn f.path\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/bufcheckopt/bufcheckopt.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheckopt\n\nimport (\n\t\"buf.build/go/bufplugin/option\"\n)\n\nconst (\n\tenumZeroValueSuffixKey                  = \"enum_zero_value_suffix\"\n\trpcAllowSameRequestResponseKey          = \"rpc_allow_same_request_response\"\n\trpcAllowGoogleProtobufEmptyRequestsKey  = \"rpc_allow_google_protobuf_empty_requests\"\n\trpcAllowGoogleProtobufEmptyResponsesKey = \"rpc_allow_google_protobuf_empty_responses\"\n\tserviceSuffixKey                        = \"service_suffix\"\n\tcommentExcludesKey                      = \"comment_excludes\"\n\n\tdefaultEnumZeroValueSuffix = \"_UNSPECIFIED\"\n\tdefaultServiceSuffix       = \"Service\"\n)\n\n// OptionsSpec builds option.Options for clients.\n//\n// These can then be sent over the wire to servers.\n//\n// Note that we don't expose OptionsSpec for the server-side rules, instead we rely\n// on the static functions, as we want to move our rules to be as native to bufplugin-go\n// as possible. Instead of i.e. attaching an Options struct to bufcheckserverutil.Requests,\n// we have individual rules go through the direct reading of option.Options using\n// the static functions below.\n//\n// Only use this on the client side.\ntype OptionsSpec struct {\n\tEnumZeroValueSuffix                  string\n\tRPCAllowSameRequestResponse          bool\n\tRPCAllowGoogleProtobufEmptyRequests  bool\n\tRPCAllowGoogleProtobufEmptyResponses bool\n\tServiceSuffix                        string\n\t// CommentExcludes are lines of comments that should be excluded for the COMMENT.* Rules.\n\t//\n\t// If a comment line starts with one of these excludes, it is not considered an actual comment.\n\t//\n\t// Right now, this should just be []string{\"buf:lint:ignore\"}, however we do this as a proper option\n\t// to maintain the client/server split we want; the server (ie the Rules) should not have the lint comment\n\t// ignore strings as part of their logic, all lint comment ignore logic is a client-side concern. However,\n\t// it is conceivable that a COMMENT.* Rule might want to say \"I don't want to consider this generic\n\t// line to be a comment\", which is exclusive of the lint comment ignore logic. We could even potentially\n\t// give users the ability to configure things to ignore as part of their buf.yaml configuration. So,\n\t// this feels OK to expose here.\n\t//\n\t// In practice, right now, the client-side should just set this to be []string{\"buf:lint:ignore\"}.\n\t//\n\t// All elements must be non-empty.\n\tCommentExcludes []string\n}\n\n// ToOptions builds a option.Options.\nfunc (o *OptionsSpec) ToOptions() (option.Options, error) {\n\tkeyToValue := make(map[string]any, 5)\n\tif value := o.EnumZeroValueSuffix; len(value) > 0 {\n\t\tkeyToValue[enumZeroValueSuffixKey] = value\n\t}\n\tif o.RPCAllowSameRequestResponse {\n\t\tkeyToValue[rpcAllowSameRequestResponseKey] = true\n\t}\n\tif o.RPCAllowGoogleProtobufEmptyRequests {\n\t\tkeyToValue[rpcAllowGoogleProtobufEmptyRequestsKey] = true\n\t}\n\tif o.RPCAllowGoogleProtobufEmptyResponses {\n\t\tkeyToValue[rpcAllowGoogleProtobufEmptyResponsesKey] = true\n\t}\n\tif value := o.ServiceSuffix; len(value) > 0 {\n\t\tkeyToValue[serviceSuffixKey] = value\n\t}\n\tif value := o.CommentExcludes; len(value) > 0 {\n\t\tkeyToValue[commentExcludesKey] = value\n\t}\n\treturn option.NewOptions(keyToValue)\n}\n\n// GetEnumZeroValueSuffix gets the enum zero-value suffix.\n//\n// Returns the default suffix if the option is not set.\nfunc GetEnumZeroValueSuffix(options option.Options) (string, error) {\n\tvalue, err := option.GetStringValue(options, enumZeroValueSuffixKey)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif value != \"\" {\n\t\treturn value, nil\n\t}\n\treturn defaultEnumZeroValueSuffix, nil\n}\n\n// GetRPCAllowSameRequestResponse returns true if the rpc_allow_same_request_response option is set to true.\n//\n// Returns error if the value was unrecognized.\nfunc GetRPCAllowSameRequestResponse(options option.Options) (bool, error) {\n\treturn option.GetBoolValue(options, rpcAllowSameRequestResponseKey)\n}\n\n// GetRPCAllowGoogleProtobufEmptyRequests returns true if the rpc_allow_google_protobuf_empty_requests\n// option is set to true.\n//\n// Returns error if the value was unrecognized.\nfunc GetRPCAllowGoogleProtobufEmptyRequests(options option.Options) (bool, error) {\n\treturn option.GetBoolValue(options, rpcAllowGoogleProtobufEmptyRequestsKey)\n}\n\n// GetRPCAllowGoogleProtobufEmptyResponses returns true if the rpc_allow_google_protobuf_empty_responses\n// option is set to true.\n//\n// Returns error if the value was unrecognized.\nfunc GetRPCAllowGoogleProtobufEmptyResponses(options option.Options) (bool, error) {\n\treturn option.GetBoolValue(options, rpcAllowGoogleProtobufEmptyResponsesKey)\n}\n\n// GetServiceSuffix gets the service suffix.\n//\n// Returns the default suffix if the option is not set.\nfunc GetServiceSuffix(options option.Options) (string, error) {\n\tvalue, err := option.GetStringValue(options, serviceSuffixKey)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif value != \"\" {\n\t\treturn value, nil\n\t}\n\treturn defaultServiceSuffix, nil\n}\n\n// GetCommentExcludes are lines of comments that should be excluded for the COMMENT.* Rules.\n//\n// If a comment line starts with one of these excludes, it is not considered an actual comment.\n//\n// The returned slice is guaranteed to have only non-empty elements.\nfunc GetCommentExcludes(options option.Options) ([]string, error) {\n\treturn option.GetStringSliceValue(options, commentExcludesKey)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/bufcheckopt/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcheckopt\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n)\n\nfunc main() {\n\tcheck.Main(&check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\t{\n\t\t\t\tID:          \"FOO\",\n\t\t\t\tPurpose:     \"Checks foo.\",\n\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\tCategoryIDs: []string{\"STANDARD\", \"NOT_DUPLICATE\"},\n\t\t\t\tHandler:     check.RuleHandlerFunc(func(context.Context, check.ResponseWriter, check.Request) error { return nil }),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:          \"BAR\",\n\t\t\t\tPurpose:     \"Checks bar.\",\n\t\t\t\tType:        check.RuleTypeBreaking,\n\t\t\t\tCategoryIDs: []string{\"STANDARD\", \"NOT_DUPLICATE\"},\n\t\t\t\tHandler:     check.RuleHandlerFunc(func(context.Context, check.ResponseWriter, check.Request) error { return nil }),\n\t\t\t},\n\t\t},\n\t\tCategories: []*check.CategorySpec{\n\t\t\t{\n\t\t\t\tID:      \"STANDARD\",\n\t\t\t\tPurpose: \"Duplicate the built-in STANDARD category.\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:      \"NOT_DUPLICATE\",\n\t\t\t\tPurpose: \"To be a non-duplicate category.\",\n\t\t\t},\n\t\t},\n\t})\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-category/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n)\n\nfunc main() {\n\tcheck.Main(&check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\t{\n\t\t\t\tID:      \"PACKAGE_DIRECTORY_MATCH\", // duplicate of a built-in lint rule\n\t\t\t\tPurpose: \"Checks that all files are in a directory that matches their package name.\",\n\t\t\t\tType:    check.RuleTypeLint,\n\t\t\t\tHandler: check.RuleHandlerFunc(func(context.Context, check.ResponseWriter, check.Request) error { return nil }),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:      \"ENUM_NO_DELETE\", // duplicate of a built-in breaking rule\n\t\t\t\tPurpose: \"Checks that enums are not deleted from a given file.\",\n\t\t\t\tType:    check.RuleTypeBreaking,\n\t\t\t\tHandler: check.RuleHandlerFunc(func(context.Context, check.ResponseWriter, check.Request) error { return nil }),\n\t\t\t},\n\t\t},\n\t})\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-duplicate-rule/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-panic/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/check/checkutil\"\n\t\"buf.build/go/bufplugin/descriptor\"\n)\n\nfunc main() {\n\tcheck.Main(\n\t\t&check.Spec{\n\t\t\tRules: []*check.RuleSpec{\n\t\t\t\t{\n\t\t\t\t\tID:             \"LINT_PANIC\",\n\t\t\t\t\tDefault:        true,\n\t\t\t\t\tPurpose:        `This rule panics.`,\n\t\t\t\t\tType:           check.RuleTypeLint,\n\t\t\t\t\tReplacementIDs: nil,\n\t\t\t\t\tHandler:        checkutil.NewFileRuleHandler(checkPanic),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunc checkPanic(context.Context, check.ResponseWriter, check.Request, descriptor.FileDescriptor) error {\n\tpanic(\"this panic is intentional\")\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-panic/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/handlers.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\"\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"buf.build/go/protovalidate\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tidFieldNameOptionKey = \"id_field_name\"\n\tdefaultIDFieldName   = \"id\"\n)\n\nfunc checkFieldNotSkippedNoImport(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n) error {\n\tconstraints, err := protovalidate.ResolveFieldRules(fieldDescriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif constraints.GetIgnore() == validate.Ignore_IGNORE_ALWAYS {\n\t\tskippedRuleName := \"(buf.validate.field).skipped\"\n\t\tif fieldDescriptor.Cardinality() == protoreflect.Repeated {\n\t\t\tskippedRuleName = \"(buf.validate.field).repeated.items.skipped\"\n\t\t}\n\t\tresponseWriter.AddAnnotation(\n\t\t\tcheck.WithDescriptor(fieldDescriptor),\n\t\t\tcheck.WithMessagef(\n\t\t\t\t\"field %q has %s set\",\n\t\t\t\tfieldDescriptor.FullName(),\n\t\t\t\tskippedRuleName,\n\t\t\t),\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc checkFieldNotSkipped(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n) error {\n\tconstraints, err := protovalidate.ResolveFieldRules(fieldDescriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif constraints.GetIgnore() == validate.Ignore_IGNORE_ALWAYS {\n\t\tskippedRuleName := \"(buf.validate.field).skipped\"\n\t\tif fieldDescriptor.Cardinality() == protoreflect.Repeated {\n\t\t\tskippedRuleName = \"(buf.validate.field).repeated.items.skipped\"\n\t\t}\n\t\tresponseWriter.AddAnnotation(\n\t\t\tcheck.WithDescriptor(fieldDescriptor),\n\t\t\tcheck.WithMessagef(\n\t\t\t\t\"field %q has %s set\",\n\t\t\t\tfieldDescriptor.FullName(),\n\t\t\t\tskippedRuleName,\n\t\t\t),\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc checkStringLenRangeDontShrink(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n\tfield protoreflect.FieldDescriptor,\n\tagainstField protoreflect.FieldDescriptor,\n) error {\n\tagainstRules, err := protovalidate.ResolveFieldRules(againstField)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif againstStringRules := againstRules.GetString(); againstStringRules != nil {\n\t\tconstraints, _ := protovalidate.ResolveFieldRules(field)\n\t\tif stringRules := constraints.GetString(); stringRules != nil {\n\t\t\tif againstStringRules.MinLen != nil && stringRules.MinLen != nil && stringRules.GetMinLen() > againstStringRules.GetMinLen() {\n\t\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\t\tcheck.WithDescriptor(field),\n\t\t\t\t\tcheck.WithAgainstDescriptor(againstField),\n\t\t\t\t\tcheck.WithMessagef(\"min len requirement raised from %d to %d\", againstStringRules.GetMinLen(), stringRules.GetMinLen()),\n\t\t\t\t)\n\t\t\t}\n\t\t\tif againstStringRules.MaxLen != nil && stringRules.MaxLen != nil && stringRules.GetMaxLen() < againstStringRules.GetMaxLen() {\n\t\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\t\tcheck.WithDescriptor(field),\n\t\t\t\t\tcheck.WithAgainstDescriptor(againstField),\n\t\t\t\t\tcheck.WithMessagef(\"max len requirement reduced from %d to %d\", againstStringRules.GetMaxLen(), stringRules.GetMaxLen()),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc checkValidateIDDashless(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n) error {\n\tidFieldName := defaultIDFieldName\n\tidFieldNameOptionValue, err := option.GetStringValue(request.Options(), idFieldNameOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif idFieldNameOptionValue != \"\" {\n\t\tidFieldName = idFieldNameOptionValue\n\t}\n\tif string(fieldDescriptor.Name()) != idFieldName {\n\t\treturn nil\n\t}\n\tif fieldDescriptor.Kind() != protoreflect.StringKind {\n\t\treturn nil\n\t}\n\tconstraints, err := protovalidate.ResolveFieldRules(fieldDescriptor)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif stringRules := constraints.GetString(); stringRules == nil || !stringRules.GetTuuid() {\n\t\tmissingRuleName := \"(buf.validate.field).string.tuuid\"\n\t\tif fieldDescriptor.Cardinality() == protoreflect.Repeated {\n\t\t\tmissingRuleName = \"(buf.validate.field).repeated.items.string.tuuid\"\n\t\t}\n\t\tresponseWriter.AddAnnotation(\n\t\t\tcheck.WithDescriptor(fieldDescriptor),\n\t\t\tcheck.WithMessagef(\n\t\t\t\t\"field %q does not have rule %s set\",\n\t\t\t\tfieldDescriptor.FullName(),\n\t\t\t\tmissingRuleName,\n\t\t\t),\n\t\t)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/check/checkutil\"\n)\n\nconst (\n\tvalidateIDDashlessRuleID                = \"VALIDATE_ID_DASHLESS\"\n\tfieldValidationNotSkippedNoImportRuleID = \"FIELD_VALIDATION_NOT_SKIPPED_NO_IMPORT\"\n\tfieldValidationNotSkippedRuleID         = \"FIELD_VALIDATION_NOT_SKIPPED\"\n\tstringLenRangeNoShrinkRuleID            = \"STRING_LEN_RANGE_NO_SHRINK\"\n)\n\nfunc main() {\n\tcheck.Main(&check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\t{\n\t\t\t\tID:             validateIDDashlessRuleID,\n\t\t\t\tCategoryIDs:    nil,\n\t\t\t\tDefault:        true,\n\t\t\t\tDeprecated:     false,\n\t\t\t\tPurpose:        `Checks that all fields named with a certain name (default is \"id\") are validated as dashless UUIDs in protovalidate.`,\n\t\t\t\tType:           check.RuleTypeLint,\n\t\t\t\tReplacementIDs: nil,\n\t\t\t\tHandler:        checkutil.NewFieldRuleHandler(checkValidateIDDashless),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:             fieldValidationNotSkippedNoImportRuleID,\n\t\t\t\tCategoryIDs:    nil,\n\t\t\t\tDefault:        false,\n\t\t\t\tDeprecated:     false,\n\t\t\t\tPurpose:        `Checks that no field is marked as skipped in protovalidate.`,\n\t\t\t\tType:           check.RuleTypeLint,\n\t\t\t\tReplacementIDs: nil,\n\t\t\t\tHandler: checkutil.NewFieldRuleHandler(\n\t\t\t\t\tcheckFieldNotSkippedNoImport,\n\t\t\t\t\tcheckutil.WithoutImports(),\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:             fieldValidationNotSkippedRuleID,\n\t\t\t\tCategoryIDs:    nil,\n\t\t\t\tDefault:        false,\n\t\t\t\tDeprecated:     true,\n\t\t\t\tPurpose:        `Checks that no field is marked as skipped in protovalidate.`,\n\t\t\t\tType:           check.RuleTypeLint,\n\t\t\t\tReplacementIDs: []string{fieldValidationNotSkippedNoImportRuleID},\n\t\t\t\tHandler: checkutil.NewFieldRuleHandler(\n\t\t\t\t\tcheckFieldNotSkipped,\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:             stringLenRangeNoShrinkRuleID,\n\t\t\t\tCategoryIDs:    nil,\n\t\t\t\tPurpose:        `Checks that string field length ranges in protovalidate do not shrink.`,\n\t\t\t\tType:           check.RuleTypeBreaking,\n\t\t\t\tDefault:        false,\n\t\t\t\tDeprecated:     false,\n\t\t\t\tReplacementIDs: nil,\n\t\t\t\tHandler:        breakingRuleHandlerForField(checkStringLenRangeDontShrink, true),\n\t\t\t},\n\t\t},\n\t})\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-protovalidate-ext/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/descriptor\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nfunc breakingRuleHandlerForFile(\n\tf func(\n\t\t_ context.Context,\n\t\t_ check.ResponseWriter,\n\t\t_ check.Request,\n\t\tfile protoreflect.FileDescriptor,\n\t\tagainstFile protoreflect.FileDescriptor,\n\t) error,\n\tcheckImport bool,\n) check.RuleHandler {\n\treturn check.RuleHandlerFunc(\n\t\tfunc(\n\t\t\tctx context.Context,\n\t\t\tresponseWriter check.ResponseWriter,\n\t\t\trequest check.Request,\n\t\t) error {\n\t\t\tfileDescriptorPathToFileDescriptor := make(map[string]descriptor.FileDescriptor)\n\t\t\tfor _, fileDescriptor := range request.FileDescriptors() {\n\t\t\t\tfileDescriptorPathToFileDescriptor[fileDescriptor.ProtoreflectFileDescriptor().Path()] = fileDescriptor\n\t\t\t}\n\t\t\tfor _, againstFileDescriptor := range request.AgainstFileDescriptors() {\n\t\t\t\tif !checkImport && againstFileDescriptor.IsImport() {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif fileDescriptor, ok := fileDescriptorPathToFileDescriptor[againstFileDescriptor.ProtoreflectFileDescriptor().Path()]; ok {\n\t\t\t\t\tif err := f(ctx, responseWriter, request, fileDescriptor.ProtoreflectFileDescriptor(), againstFileDescriptor.ProtoreflectFileDescriptor()); 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\treturn nil\n\t\t})\n}\n\nfunc breakingRuleHandlerForField(\n\tf func(\n\t\t_ context.Context,\n\t\t_ check.ResponseWriter,\n\t\t_ check.Request,\n\t\tfield protoreflect.FieldDescriptor,\n\t\tagainstField protoreflect.FieldDescriptor,\n\t) error,\n\tcheckImport bool,\n) check.RuleHandler {\n\treturn breakingRuleHandlerForFile(\n\t\tfunc(\n\t\t\tctx context.Context,\n\t\t\tresponseWriter check.ResponseWriter,\n\t\t\trequest check.Request,\n\t\t\tfile protoreflect.FileDescriptor,\n\t\t\tagainstFile protoreflect.FileDescriptor,\n\t\t) error {\n\t\t\treturn forEachMessage(\n\t\t\t\tfile.Messages(),\n\t\t\t\tagainstFile.Messages(),\n\t\t\t\tfunc(message, againstMessage protoreflect.MessageDescriptor) error {\n\t\t\t\t\treturn forEachField(\n\t\t\t\t\t\tmessage.Fields(),\n\t\t\t\t\t\tagainstMessage.Fields(),\n\t\t\t\t\t\tfunc(field, againstField protoreflect.FieldDescriptor) error {\n\t\t\t\t\t\t\treturn f(ctx, responseWriter, request, field, againstField)\n\t\t\t\t\t\t})\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\t\tcheckImport,\n\t)\n}\n\nfunc forEachMessage(\n\tmessages protoreflect.MessageDescriptors,\n\tagainstMessages protoreflect.MessageDescriptors,\n\tf func(message, againstMessage protoreflect.MessageDescriptor) error,\n) error {\n\tfor i := range againstMessages.Len() {\n\t\tagainstMessage := againstMessages.Get(i)\n\t\tif message := messages.ByName(againstMessage.Name()); message != nil {\n\t\t\tif err := f(message, againstMessage); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := forEachMessage(message.Messages(), againstMessage.Messages(), f); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc forEachField(\n\tfields protoreflect.FieldDescriptors,\n\tagainstFields protoreflect.FieldDescriptors,\n\tf func(field, againstField protoreflect.FieldDescriptor) error,\n) error {\n\tfor i := range againstFields.Len() {\n\t\tagainstField := againstFields.Get(i)\n\t\tif field := fields.ByName(againstField.Name()); field != nil {\n\t\t\tif err := f(field, againstField); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\t\"strings\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/check/checkutil\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tpageRPCRequestToken         = \"PAGE_REQUEST_HAS_TOKEN\"\n\tpageRPCResponseToken        = \"PAGE_RESPONSE_HAS_TOKEN\"\n\tpageTokenFieldNameOptionKey = \"page_token_field_name\"\n\tpageRPCPrefixOptionKey      = \"page_rpc_prefix\"\n\tdefaultPageTokenFieldName   = \"page_token\"\n)\n\nvar (\n\tdefaultPageRPCPrefixes = []string{\"List\"}\n)\n\nfunc main() {\n\tcheck.Main(&check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\t{\n\t\t\t\tID:             pageRPCRequestToken,\n\t\t\t\tCategoryIDs:    nil,\n\t\t\t\tDefault:        true,\n\t\t\t\tPurpose:        `Checks that all pagination RPC requests has a page token set.`,\n\t\t\t\tType:           check.RuleTypeLint,\n\t\t\t\tReplacementIDs: nil,\n\t\t\t\tHandler:        checkutil.NewMessageRuleHandler(checkPageRequestHasToken),\n\t\t\t},\n\t\t\t{\n\t\t\t\tID:             pageRPCResponseToken,\n\t\t\t\tCategoryIDs:    nil,\n\t\t\t\tDefault:        true,\n\t\t\t\tPurpose:        `Checks that all pagination RPC responses has a page token set.`,\n\t\t\t\tType:           check.RuleTypeLint,\n\t\t\t\tReplacementIDs: nil,\n\t\t\t\tHandler:        checkutil.NewMessageRuleHandler(checkPageResponseHasToken),\n\t\t\t},\n\t\t},\n\t})\n}\n\nfunc checkPageRequestHasToken(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n\tmessageDescriptor protoreflect.MessageDescriptor,\n) error {\n\trequestName := string(messageDescriptor.Name())\n\tif !strings.HasSuffix(requestName, \"Request\") {\n\t\treturn nil\n\t}\n\tpageRPCPrefixes := defaultPageRPCPrefixes\n\tpageRPCPrefixesOptionValue, err := option.GetStringSliceValue(request.Options(), pageRPCPrefixOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(pageRPCPrefixesOptionValue) > 0 {\n\t\tpageRPCPrefixes = pageRPCPrefixesOptionValue\n\t}\n\tvar isPaginationPRC bool\n\tfor _, prefx := range pageRPCPrefixes {\n\t\tif strings.HasPrefix(requestName, prefx) {\n\t\t\tisPaginationPRC = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !isPaginationPRC {\n\t\treturn nil\n\t}\n\tpageTokenFieldName := defaultPageTokenFieldName\n\tpageTokenFieldNameOptionValue, err := option.GetStringValue(request.Options(), pageTokenFieldNameOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif pageTokenFieldNameOptionValue != \"\" {\n\t\tpageTokenFieldName = pageTokenFieldNameOptionValue\n\t}\n\tfields := messageDescriptor.Fields()\n\tfor i := range fields.Len() {\n\t\tfieldName := string(fields.Get(i).Name())\n\t\tif fieldName == pageTokenFieldName {\n\t\t\treturn nil\n\t\t}\n\t}\n\tresponseWriter.AddAnnotation(\n\t\tcheck.WithDescriptor(messageDescriptor),\n\t\tcheck.WithMessagef(\"%q is a pagination request without a page token field named %q\", requestName, pageTokenFieldName),\n\t)\n\treturn nil\n}\n\nfunc checkPageResponseHasToken(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n\tmessageDescriptor protoreflect.MessageDescriptor,\n) error {\n\tresponseName := string(messageDescriptor.Name())\n\tif !strings.HasSuffix(responseName, \"Response\") {\n\t\treturn nil\n\t}\n\tpageRPCPrefixes := defaultPageRPCPrefixes\n\tpageRPCPrefixesOptionValue, err := option.GetStringSliceValue(request.Options(), pageRPCPrefixOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(pageRPCPrefixesOptionValue) > 0 {\n\t\tpageRPCPrefixes = pageRPCPrefixesOptionValue\n\t}\n\tvar isPaginationPRC bool\n\tfor _, prefx := range pageRPCPrefixes {\n\t\tif strings.HasPrefix(responseName, prefx) {\n\t\t\tisPaginationPRC = true\n\t\t\tbreak\n\t\t}\n\t}\n\tif !isPaginationPRC {\n\t\treturn nil\n\t}\n\tpageTokenFieldName := defaultPageTokenFieldName\n\tpageTokenFieldNameOptionValue, err := option.GetStringValue(request.Options(), pageTokenFieldNameOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif pageTokenFieldNameOptionValue != \"\" {\n\t\tpageTokenFieldName = pageTokenFieldNameOptionValue\n\t}\n\tfields := messageDescriptor.Fields()\n\tfor i := range fields.Len() {\n\t\tfieldName := string(fields.Get(i).Name())\n\t\tif fieldName == pageTokenFieldName {\n\t\t\treturn nil\n\t\t}\n\t}\n\tresponseWriter.AddAnnotation(\n\t\tcheck.WithDescriptor(messageDescriptor),\n\t\tcheck.WithMessagef(\"%q is a pagination response without a page token field named %q\", responseName, pageTokenFieldName),\n\t)\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-rpc-ext/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix/handlers.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/descriptor\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tserviceBannedSuffixesOptionKey   = \"service_banned_suffixes\"\n\trpcBannedSuffixesOptionKey       = \"rpc_banned_suffixes\"\n\tfieldBannedSuffixesOptionKey     = \"field_banned_suffixes\"\n\tenumValueBannedSuffixesOptionKey = \"enum_value_banned_suffixes\"\n\tserviceNoChangeSuffixesOptionKey = \"service_no_change_suffixes\"\n\tmessageNoChangeSuffixesOptionKey = \"message_no_change_suffixes\"\n\tenumNoChangeSuffixesOptionKey    = \"enum_no_change_suffixes\"\n)\n\nfunc handleLintServiceBannedSuffixes(\n\tctx context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n) error {\n\tbannedServiceSuffixes, err := getSuffixes(request, serviceBannedSuffixesOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, fileDescriptor := range request.FileDescriptors() {\n\t\tdescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\t\tfor i := range descriptor.Services().Len() {\n\t\t\tservice := descriptor.Services().Get(i)\n\t\t\tcheckDescriptorBannedSuffixes(responseWriter, service, bannedServiceSuffixes, \"Service\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc handleLintRPCBannedSuffixes(\n\tctx context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n) error {\n\tbannedRPCSuffixes, err := getSuffixes(request, rpcBannedSuffixesOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, fileDescriptor := range request.FileDescriptors() {\n\t\tdescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\t\tfor i := range descriptor.Services().Len() {\n\t\t\tmethods := descriptor.Services().Get(i).Methods()\n\t\t\tfor j := range methods.Len() {\n\t\t\t\tmethod := methods.Get(j)\n\t\t\t\tcheckDescriptorBannedSuffixes(responseWriter, method, bannedRPCSuffixes, \"Method\")\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc handleLintFieldBannedSuffixes(\n\tctx context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n) error {\n\tbannedFieldSuffixes, err := getSuffixes(request, fieldBannedSuffixesOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, fileDescriptor := range request.FileDescriptors() {\n\t\tdescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\t\tfor i := range descriptor.Messages().Len() {\n\t\t\tmessage := descriptor.Messages().Get(i)\n\t\t\tcheckBannedFieldSuffixesForMessage(responseWriter, message, bannedFieldSuffixes)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc checkBannedFieldSuffixesForMessage(\n\tresponseWriter check.ResponseWriter,\n\tmessageDescriptor protoreflect.MessageDescriptor,\n\tbannedFieldSuffixes []string,\n) {\n\t// Check all fields of the message\n\tfor i := range messageDescriptor.Fields().Len() {\n\t\tfield := messageDescriptor.Fields().Get(i)\n\t\tcheckDescriptorBannedSuffixes(responseWriter, field, bannedFieldSuffixes, \"Field\")\n\t}\n\t// Check each nested messages\n\tfor i := range messageDescriptor.Messages().Len() {\n\t\tmessage := messageDescriptor.Messages().Get(i)\n\t\tcheckBannedFieldSuffixesForMessage(responseWriter, message, bannedFieldSuffixes)\n\t}\n}\n\nfunc handleLintEnumValueBannedSuffixes(\n\tctx context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n) error {\n\tbannedEnumValueSuffixes, err := getSuffixes(request, enumValueBannedSuffixesOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, fileDescriptor := range request.FileDescriptors() {\n\t\tdescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\t\tfor i := range descriptor.Enums().Len() {\n\t\t\tenum := descriptor.Enums().Get(i)\n\t\t\tfor j := range enum.Values().Len() {\n\t\t\t\tenumValue := enum.Values().Get(j)\n\t\t\t\tcheckDescriptorBannedSuffixes(responseWriter, enumValue, bannedEnumValueSuffixes, \"Enum value\")\n\t\t\t}\n\t\t}\n\t\t// Check messages for nested enums\n\t\tfor i := range descriptor.Messages().Len() {\n\t\t\tmessage := descriptor.Messages().Get(i)\n\t\t\tcheckBannedEnumValueSuffixesForMessage(responseWriter, message, bannedEnumValueSuffixes)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc checkBannedEnumValueSuffixesForMessage(\n\tresponseWriter check.ResponseWriter,\n\tmessageDescriptor protoreflect.MessageDescriptor,\n\tbannedEnumValueSuffixes []string,\n) {\n\t// Check each nested enum\n\tfor i := range messageDescriptor.Enums().Len() {\n\t\tenum := messageDescriptor.Enums().Get(i)\n\t\tfor j := range enum.Values().Len() {\n\t\t\tenumValue := enum.Values().Get(j)\n\t\t\tcheckDescriptorBannedSuffixes(responseWriter, enumValue, bannedEnumValueSuffixes, \"Enum value\")\n\t\t}\n\t}\n\t// Check each nested message for nested enums\n\tfor i := range messageDescriptor.Messages().Len() {\n\t\tmessage := messageDescriptor.Messages().Get(i)\n\t\tcheckBannedEnumValueSuffixesForMessage(responseWriter, message, bannedEnumValueSuffixes)\n\t}\n}\n\nfunc checkDescriptorBannedSuffixes(\n\tresponseWriter check.ResponseWriter,\n\tdescriptor protoreflect.Descriptor,\n\tbannedSuffixes []string,\n\tdescriptorTypeName string,\n) {\n\tfor _, bannedSuffix := range bannedSuffixes {\n\t\tif strings.HasSuffix(string(descriptor.FullName()), bannedSuffix) {\n\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\tcheck.WithDescriptor(descriptor),\n\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t\"%s name %q has banned suffix %q.\",\n\t\t\t\t\tdescriptorTypeName,\n\t\t\t\t\tdescriptor.FullName(),\n\t\t\t\t\tbannedSuffix,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n}\n\nfunc handleBreakingServiceSuffixesNoChange(\n\tctx context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n) error {\n\tserviceNoChangeSuffixes, err := getSuffixes(request, serviceNoChangeSuffixesOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpreviousNoChangeServiceNameToServiceDescriptor := mapServiceNameToServiceDescriptorForFilesAndNoChangeSuffixes(\n\t\trequest.AgainstFileDescriptors(),\n\t\tserviceNoChangeSuffixes,\n\t)\n\tcurrentNoChangeServiceNameToServiceDescriptor := mapServiceNameToServiceDescriptorForFilesAndNoChangeSuffixes(\n\t\trequest.FileDescriptors(),\n\t\tnil,\n\t)\n\tfor previousServiceName, previousServiceDescriptor := range previousNoChangeServiceNameToServiceDescriptor {\n\t\tif currentServiceDescriptor, ok := currentNoChangeServiceNameToServiceDescriptor[previousServiceName]; ok {\n\t\t\tpreviousMethodNames := getAllMethodNamesSortedForService(previousServiceDescriptor)\n\t\t\tcurrentMethodNames := getAllMethodNamesSortedForService(currentServiceDescriptor)\n\t\t\tif !slices.Equal(previousMethodNames, currentMethodNames) {\n\t\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\t\tcheck.WithDescriptor(currentServiceDescriptor),\n\t\t\t\t\tcheck.WithAgainstDescriptor(previousServiceDescriptor),\n\t\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t\t\"Service %q has a suffix configured for no changes has different methods, previously %s, currently %s.\",\n\t\t\t\t\t\tpreviousServiceName,\n\t\t\t\t\t\tpreviousMethodNames,\n\t\t\t\t\t\tcurrentMethodNames,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\tcheck.WithAgainstDescriptor(previousServiceDescriptor),\n\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t\"Service %q has a suffix configured for no changes has been deleted.\",\n\t\t\t\t\tpreviousServiceName,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// mapServiceNameToServiceDescriptorForFilesAndNoChangeSuffixes maps the service name to\n// service descriptors for the given check files based on the the no change suffixes.\n// If no suffixes are passed, then all services are returned.\nfunc mapServiceNameToServiceDescriptorForFilesAndNoChangeSuffixes(\n\tfileDescriptors []descriptor.FileDescriptor,\n\tserviceNoChangeSuffixes []string,\n) map[string]protoreflect.ServiceDescriptor {\n\tresult := map[string]protoreflect.ServiceDescriptor{}\n\tfor _, fileDescriptor := range fileDescriptors {\n\t\tdescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\t\tfor i := range descriptor.Services().Len() {\n\t\t\tservice := descriptor.Services().Get(i)\n\t\t\tif checkDescriptorHasNoChangeSuffix(service, serviceNoChangeSuffixes) {\n\t\t\t\tresult[string(service.FullName())] = service\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc getAllMethodNamesSortedForService(serviceDescriptor protoreflect.ServiceDescriptor) []string {\n\tvar methodNames []string\n\tfor i := range serviceDescriptor.Methods().Len() {\n\t\tmethod := serviceDescriptor.Methods().Get(i)\n\t\tmethodNames = append(methodNames, string(method.FullName()))\n\t}\n\tslices.Sort(methodNames)\n\treturn methodNames\n}\n\nfunc handleBreakingMessageSuffixesNoChange(\n\tctx context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n) error {\n\tmessageNoChangeSuffixes, err := getSuffixes(request, messageNoChangeSuffixesOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpreviousNoChangeMessageNameToMessageDescriptor := mapMessageNameToMessageDescriptorForFilesAndNoChangeSuffixes(\n\t\trequest.AgainstFileDescriptors(),\n\t\tmessageNoChangeSuffixes,\n\t)\n\tcurrentNoChangeMessageNameToMessageDescriptor := mapMessageNameToMessageDescriptorForFilesAndNoChangeSuffixes(\n\t\trequest.FileDescriptors(),\n\t\tmessageNoChangeSuffixes,\n\t)\n\tfor previousMessageName, previousMessageDescriptor := range previousNoChangeMessageNameToMessageDescriptor {\n\t\tif currentMessageDescriptor, ok := currentNoChangeMessageNameToMessageDescriptor[previousMessageName]; ok {\n\t\t\tpreviousFieldNames := getFieldNamesSortedForMessage(previousMessageDescriptor)\n\t\t\tcurrentFieldNames := getFieldNamesSortedForMessage(currentMessageDescriptor)\n\t\t\tif !slices.Equal(previousFieldNames, currentFieldNames) {\n\t\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\t\tcheck.WithDescriptor(currentMessageDescriptor),\n\t\t\t\t\tcheck.WithAgainstDescriptor(previousMessageDescriptor),\n\t\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t\t\"Message %q has a suffix configured for no changes has different fields, previously %s, currently %s.\",\n\t\t\t\t\t\tpreviousMessageName,\n\t\t\t\t\t\tpreviousFieldNames,\n\t\t\t\t\t\tcurrentFieldNames,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\tcheck.WithAgainstDescriptor(previousMessageDescriptor),\n\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t\"Message %q has a suffix configured for no changes has been deleted.\",\n\t\t\t\t\tpreviousMessageName,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// mapMessageNameToMessageDescriptorForFilesAndNoChangeSuffixes maps the message name to\n// message descriptors for the given check files based on the the no change suffixes.\n// If no suffixes are passed, then all messages are returned.\nfunc mapMessageNameToMessageDescriptorForFilesAndNoChangeSuffixes(\n\tfileDescriptors []descriptor.FileDescriptor,\n\tmessageNoChangeSuffixes []string,\n) map[string]protoreflect.MessageDescriptor {\n\tresult := map[string]protoreflect.MessageDescriptor{}\n\tfor _, fileDescriptor := range fileDescriptors {\n\t\tdescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\t\tmessages := getNestedMessageDescriptors(descriptor.Messages(), messageNoChangeSuffixes)\n\t\tfor _, message := range messages {\n\t\t\tresult[string(message.FullName())] = message\n\t\t}\n\t}\n\treturn result\n}\n\nfunc getNestedMessageDescriptors(\n\tmessageDescriptors protoreflect.MessageDescriptors,\n\tmessageNoChangeSuffixes []string,\n) []protoreflect.MessageDescriptor {\n\tvar messages []protoreflect.MessageDescriptor\n\tfor i := range messageDescriptors.Len() {\n\t\tmessage := messageDescriptors.Get(i)\n\t\tif checkDescriptorHasNoChangeSuffix(message, messageNoChangeSuffixes) {\n\t\t\tmessages = append(messages, message)\n\t\t}\n\t\tnestedMessages := getNestedMessageDescriptors(message.Messages(), messageNoChangeSuffixes)\n\t\tmessages = append(messages, nestedMessages...)\n\t}\n\treturn messages\n}\n\nfunc getFieldNamesSortedForMessage(messageDescriptor protoreflect.MessageDescriptor) []string {\n\tvar fieldNames []string\n\tfor i := range messageDescriptor.Fields().Len() {\n\t\tfield := messageDescriptor.Fields().Get(i)\n\t\tfieldNames = append(fieldNames, string(field.FullName()))\n\t}\n\tslices.Sort(fieldNames)\n\treturn fieldNames\n}\n\nfunc handleBreakingEnumSuffixesNoChange(\n\tctx context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n) error {\n\tenumNoChangeSuffixes, err := getSuffixes(request, enumNoChangeSuffixesOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tpreviousNoChangeEnumNameToEnumDescriptor := mapEnumNameToEnumDescriptorForFilesAndNoChangeSuffixes(\n\t\trequest.AgainstFileDescriptors(),\n\t\tenumNoChangeSuffixes,\n\t)\n\tcurrentNoChangeEnumNameToEnumDescriptor := mapEnumNameToEnumDescriptorForFilesAndNoChangeSuffixes(\n\t\trequest.FileDescriptors(),\n\t\tenumNoChangeSuffixes,\n\t)\n\tfor previousEnumName, previousEnumDescriptor := range previousNoChangeEnumNameToEnumDescriptor {\n\t\tif currentEnumDescriptor, ok := currentNoChangeEnumNameToEnumDescriptor[previousEnumName]; ok {\n\t\t\tpreviousEnumValueNames := getEnumValueNamesSortedForEnum(previousEnumDescriptor)\n\t\t\tcurrentEnumValueNames := getEnumValueNamesSortedForEnum(currentEnumDescriptor)\n\t\t\tif !slices.Equal(previousEnumValueNames, currentEnumValueNames) {\n\t\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\t\tcheck.WithDescriptor(currentEnumDescriptor),\n\t\t\t\t\tcheck.WithAgainstDescriptor(previousEnumDescriptor),\n\t\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t\t\"Enum %q has a suffix configured for no changes has different enum values, previously %s, currently %s.\",\n\t\t\t\t\t\tpreviousEnumName,\n\t\t\t\t\t\tpreviousEnumValueNames,\n\t\t\t\t\t\tcurrentEnumValueNames,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t} else {\n\t\t\tresponseWriter.AddAnnotation(\n\t\t\t\tcheck.WithAgainstDescriptor(previousEnumDescriptor),\n\t\t\t\tcheck.WithMessagef(\n\t\t\t\t\t\"Enum %q has a suffix configured for no changes has been deleted.\",\n\t\t\t\t\tpreviousEnumName,\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc mapEnumNameToEnumDescriptorForFilesAndNoChangeSuffixes(\n\tfileDescriptors []descriptor.FileDescriptor,\n\tenumNoChangeSuffixes []string,\n) map[string]protoreflect.EnumDescriptor {\n\tresult := map[string]protoreflect.EnumDescriptor{}\n\tfor _, fileDescriptor := range fileDescriptors {\n\t\tdescriptor := fileDescriptor.ProtoreflectFileDescriptor()\n\t\tfor i := range descriptor.Enums().Len() {\n\t\t\tenum := descriptor.Enums().Get(i)\n\t\t\tif checkDescriptorHasNoChangeSuffix(enum, enumNoChangeSuffixes) {\n\t\t\t\tresult[string(enum.FullName())] = enum\n\t\t\t}\n\t\t}\n\t\tenums := getNestedEnumDescriptors(descriptor.Messages(), enumNoChangeSuffixes)\n\t\tfor _, enum := range enums {\n\t\t\tresult[string(enum.FullName())] = enum\n\t\t}\n\t}\n\treturn result\n}\n\nfunc getEnumValueNamesSortedForEnum(enumDescriptor protoreflect.EnumDescriptor) []string {\n\tvar enumValueNames []string\n\tfor i := range enumDescriptor.Values().Len() {\n\t\tenumValue := enumDescriptor.Values().Get(i)\n\t\tenumValueNames = append(enumValueNames, string(enumValue.FullName()))\n\t}\n\tslices.Sort(enumValueNames)\n\treturn enumValueNames\n}\n\nfunc getNestedEnumDescriptors(\n\tmessageDescriptors protoreflect.MessageDescriptors,\n\tenumNoChangeSuffixes []string,\n) []protoreflect.EnumDescriptor {\n\tvar enums []protoreflect.EnumDescriptor\n\tfor i := range messageDescriptors.Len() {\n\t\tmessage := messageDescriptors.Get(i)\n\t\tfor j := range message.Enums().Len() {\n\t\t\tenum := message.Enums().Get(j)\n\t\t\tif checkDescriptorHasNoChangeSuffix(enum, enumNoChangeSuffixes) {\n\t\t\t\tenums = append(enums, enum)\n\t\t\t}\n\t\t}\n\t\tnestedEnums := getNestedEnumDescriptors(message.Messages(), enumNoChangeSuffixes)\n\t\tenums = append(enums, nestedEnums...)\n\t}\n\treturn enums\n}\n\nfunc checkDescriptorHasNoChangeSuffix(\n\tdescriptor protoreflect.Descriptor,\n\tnoChangeSuffixes []string,\n) bool {\n\tif noChangeSuffixes == nil {\n\t\treturn true\n\t}\n\tfor _, noChangeSuffix := range noChangeSuffixes {\n\t\tif strings.HasSuffix(string(descriptor.FullName()), noChangeSuffix) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc getSuffixes(\n\trequest check.Request,\n\toptionKey string,\n) ([]string, error) {\n\treturn option.GetStringSliceValue(request.Options(), optionKey)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\n\t\"buf.build/go/bufplugin/check\"\n)\n\nconst (\n\tlintServiceBannedSuffixesRuleID       = \"SERVICE_BANNED_SUFFIXES\"\n\tlintRPCBannedSuffixesRuleID           = \"RPC_BANNED_SUFFIXES\"\n\tlintFieldBannedSuffixesRuleID         = \"FIELD_BANNED_SUFFIXES\"\n\tlintEnumValueBannedSuffixesRuleID     = \"ENUM_VALUE_BANNED_SUFFIXES\"\n\tbreakingServiceSuffixesNoChangeRuleID = \"SERVICE_SUFFIXES_NO_CHANGE\"\n\tbreakingMessageSuffixesNoChangeRuleID = \"MESSAGE_SUFFIXES_NO_CHANGE\"\n\tbreakingEnumSuffixesNoChangeRuleID    = \"ENUM_SUFFIXES_NO_CHANGE\"\n\n\tcategoryOperationSuffixesID  = \"OPERATION_SUFFIXES\"\n\tcategoryAttributesSuffixesID = \"ATTRIBUTES_SUFFIXES\"\n\n\t// deprecated rules and category IDs\n\tlintMessageBannedSuffixesRuleID = \"MESSAGE_BANNED_SUFFIXES\"\n\tlintEnumBannedSuffixesRuleID    = \"ENUM_BANNED_SUFFIXES\"\n\tcategoryResourceSuffixesID      = \"RESOURCE_SUFFIXES\"\n)\n\nfunc main() {\n\tcheck.Main(\n\t\t&check.Spec{\n\t\t\tRules: []*check.RuleSpec{\n\t\t\t\t{\n\t\t\t\t\tID:          lintServiceBannedSuffixesRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that there are no services with the list of configured banned suffixes.\",\n\t\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\t\tCategoryIDs: []string{categoryOperationSuffixesID},\n\t\t\t\t\tDefault:     true,\n\t\t\t\t\tHandler:     check.RuleHandlerFunc(handleLintServiceBannedSuffixes),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          lintRPCBannedSuffixesRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that there are no RPCs with the list of configured banned suffixes.\",\n\t\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\t\tCategoryIDs: []string{categoryOperationSuffixesID},\n\t\t\t\t\tDefault:     true,\n\t\t\t\t\tHandler:     check.RuleHandlerFunc(handleLintRPCBannedSuffixes),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          lintMessageBannedSuffixesRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that there are no messages with the list of configured banned suffixes.\",\n\t\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\t\tCategoryIDs: []string{categoryResourceSuffixesID},\n\t\t\t\t\tDefault:     false,\n\t\t\t\t\tDeprecated:  true,\n\t\t\t\t\tReplacementIDs: []string{\n\t\t\t\t\t\t// Mesasges encapsulate too many use-cases, we only lint fields instead.\n\t\t\t\t\t\tlintFieldBannedSuffixesRuleID,\n\t\t\t\t\t},\n\t\t\t\t\tHandler: check.RuleHandlerFunc(func(_ context.Context, _ check.ResponseWriter, _ check.Request) error { return nil }),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          lintFieldBannedSuffixesRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that there are no fields with the list of configured banned suffixes.\",\n\t\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\t\tCategoryIDs: []string{categoryAttributesSuffixesID},\n\t\t\t\t\tDefault:     false,\n\t\t\t\t\tHandler:     check.RuleHandlerFunc(handleLintFieldBannedSuffixes),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          lintEnumBannedSuffixesRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that there are no enums with the list of configured banned suffixes.\",\n\t\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\t\tCategoryIDs: []string{categoryResourceSuffixesID},\n\t\t\t\t\tDefault:     false,\n\t\t\t\t\tDeprecated:  true,\n\t\t\t\t\tReplacementIDs: []string{\n\t\t\t\t\t\t// Enums encapsulate too many use-cases, we only lint enum values instead.\n\t\t\t\t\t\tlintEnumValueBannedSuffixesRuleID,\n\t\t\t\t\t},\n\t\t\t\t\tHandler: check.RuleHandlerFunc(func(_ context.Context, _ check.ResponseWriter, _ check.Request) error { return nil }),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          lintEnumValueBannedSuffixesRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that there are no enum values of top-level enums with the list of configured banned suffixes.\",\n\t\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\t\tCategoryIDs: []string{categoryAttributesSuffixesID},\n\t\t\t\t\tDefault:     false,\n\t\t\t\t\tHandler:     check.RuleHandlerFunc(handleLintEnumValueBannedSuffixes),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          breakingServiceSuffixesNoChangeRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that services with configured suffixes are not deleted and do not have new RPCs or delete RPCs.\",\n\t\t\t\t\tType:        check.RuleTypeBreaking,\n\t\t\t\t\tCategoryIDs: []string{categoryOperationSuffixesID},\n\t\t\t\t\tDefault:     true,\n\t\t\t\t\tHandler:     check.RuleHandlerFunc(handleBreakingServiceSuffixesNoChange),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          breakingMessageSuffixesNoChangeRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that messages with configured suffixes are not deleted and do not have new fields or delete fields.\",\n\t\t\t\t\tType:        check.RuleTypeBreaking,\n\t\t\t\t\tCategoryIDs: []string{categoryResourceSuffixesID, categoryAttributesSuffixesID},\n\t\t\t\t\tDefault:     false,\n\t\t\t\t\tHandler:     check.RuleHandlerFunc(handleBreakingMessageSuffixesNoChange),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:          breakingEnumSuffixesNoChangeRuleID,\n\t\t\t\t\tPurpose:     \"Ensure that enums with configured suffixes are not deleted and do not have new enum values or delete enum values.\",\n\t\t\t\t\tType:        check.RuleTypeBreaking,\n\t\t\t\t\tCategoryIDs: []string{categoryResourceSuffixesID, categoryAttributesSuffixesID},\n\t\t\t\t\tDefault:     false,\n\t\t\t\t\tHandler:     check.RuleHandlerFunc(handleBreakingEnumSuffixesNoChange),\n\t\t\t\t},\n\t\t\t},\n\t\t\tCategories: []*check.CategorySpec{\n\t\t\t\t{\n\t\t\t\t\tID:      categoryOperationSuffixesID,\n\t\t\t\t\tPurpose: \"Check that all operations (services and methods) have valid suffixes and those with specific suffixes have no change.\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:         categoryResourceSuffixesID,\n\t\t\t\t\tPurpose:    \"Check that all resources (messages and enums) have valid suffixes and those with specific suffixes have no change.\",\n\t\t\t\t\tDeprecated: true,\n\t\t\t\t\tReplacementIDs: []string{\n\t\t\t\t\t\t// Deprecated in favour for attributes category to incorporate fields and enum values checks.\n\t\t\t\t\t\tcategoryAttributesSuffixesID,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tID:      categoryAttributesSuffixesID,\n\t\t\t\t\tPurpose: \"Check that all fields and enum values have valid suffixes and messages and enums with specific suffixes have no change.\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/internal/cmd/buf-plugin-suffix/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/lint_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck_test\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/buf/buftarget\"\n\t\"github.com/bufbuild/buf/private/buf/bufworkspace\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis/bufanalysistesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// Hint on how to get these:\n// 1. cd into the specific directory\n// 2. buf lint --error-format=json | jq '[.path, .start_line, .start_column, .end_line, .end_column, .type] | @csv' --raw-output\n//      or\n//    buf lint --error-format=json | jq -r '\"bufanalysistesting.NewFileAnnotation(t, \\\"\\(.path)\\\", \\(.start_line|tostring), \\(.start_column|tostring), \\(.end_line|tostring), \\(.end_column|tostring), \\\"\\(.type)\\\"),\"'\n\nfunc TestRunComments(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"comments\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 7, 1, 10, 2, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 3, 8, 28, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 3, 9, 20, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 1, 37, 2, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 13, 3, 28, 4, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 14, 5, 17, 6, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 15, 7, 15, 27, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 16, 7, 16, 19, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 18, 5, 23, 6, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 19, 7, 19, 30, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 20, 7, 22, 8, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 9, 21, 23, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 5, 24, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 5, 27, 6, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 26, 7, 26, 21, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 32, 4, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 5, 30, 25, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 31, 5, 31, 17, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 33, 3, 33, 17, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 34, 3, 36, 4, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 35, 5, 35, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 39, 1, 41, 2, \"COMMENT_SERVICE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 40, 3, 40, 74, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 104, 1, 107, 2, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 105, 3, 105, 29, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 106, 3, 106, 21, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 109, 1, 134, 2, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 110, 3, 125, 4, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 111, 5, 114, 6, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 112, 7, 112, 27, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 113, 7, 113, 19, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 115, 5, 120, 6, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 116, 7, 116, 21, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 117, 7, 119, 8, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 118, 9, 118, 23, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 121, 5, 121, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 122, 5, 124, 6, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 123, 7, 123, 21, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 126, 3, 129, 4, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 127, 5, 127, 25, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 128, 5, 128, 17, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 130, 3, 130, 17, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 131, 3, 133, 4, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 132, 5, 132, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 136, 1, 139, 2, \"COMMENT_SERVICE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 137, 3, 137, 74, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 138, 3, 138, 72, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 142, 1, 147, 2, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 144, 3, 144, 29, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 146, 3, 146, 21, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 150, 1, 192, 2, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 152, 3, 177, 4, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 154, 5, 159, 6, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 156, 7, 156, 27, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 158, 7, 158, 19, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 161, 5, 169, 6, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 163, 7, 163, 21, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 165, 7, 168, 8, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 167, 9, 167, 23, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 171, 5, 171, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 173, 5, 176, 6, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 175, 7, 175, 21, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 179, 3, 184, 4, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 181, 5, 181, 25, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 183, 5, 183, 17, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 186, 3, 186, 17, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 188, 3, 191, 4, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 190, 5, 190, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 195, 1, 200, 2, \"COMMENT_SERVICE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 197, 3, 197, 74, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 199, 3, 199, 72, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 203, 1, 208, 2, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 205, 3, 205, 29, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 207, 3, 207, 21, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 211, 1, 253, 2, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 213, 3, 238, 4, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 215, 5, 220, 6, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 217, 7, 217, 27, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 219, 7, 219, 19, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 222, 5, 230, 6, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 224, 7, 224, 21, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 226, 7, 229, 8, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 228, 9, 228, 23, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 232, 5, 232, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 234, 5, 237, 6, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 236, 7, 236, 21, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 240, 3, 245, 4, \"COMMENT_ENUM\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 242, 5, 242, 25, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 244, 5, 244, 17, \"COMMENT_ENUM_VALUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 247, 3, 247, 17, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 249, 3, 252, 4, \"COMMENT_ONEOF\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 251, 5, 251, 19, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 256, 1, 261, 2, \"COMMENT_SERVICE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 258, 3, 258, 74, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 260, 3, 260, 72, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 263, 1, 265, 2, \"COMMENT_MESSAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 264, 3, 264, 30, \"COMMENT_FIELD\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 273, 3, 273, 72, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 277, 3, 277, 72, \"COMMENT_RPC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 13, 3, 13, 31, \"COMMENT_MESSAGE\"),\n\t)\n}\n\nfunc TestRunDirectorySamePackage(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"directory_same_package\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 3, 1, 3, 11, \"DIRECTORY_SAME_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"no_package.proto\", \"DIRECTORY_SAME_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"one/c.proto\", 3, 1, 3, 11, \"DIRECTORY_SAME_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"one/d.proto\", 3, 1, 3, 11, \"DIRECTORY_SAME_PACKAGE\"),\n\t)\n}\n\nfunc TestRunImportNoPublic(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"import_no_public\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 6, 1, 6, 32, \"IMPORT_NO_PUBLIC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 7, 1, 7, 31, \"IMPORT_NO_PUBLIC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"one/one.proto\", 6, 1, 6, 32, \"IMPORT_NO_PUBLIC\"),\n\t)\n}\n\nfunc TestRunImportUsed(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"import_used\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 5, 1, 5, 25, \"IMPORT_USED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 7, 1, 7, 24, \"IMPORT_USED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"one/one.proto\", 6, 1, 6, 25, \"IMPORT_USED\"),\n\t)\n}\n\nfunc TestRunEnumFirstValueZero(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"enum_first_value_zero\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 13, 12, 14, \"ENUM_FIRST_VALUE_ZERO\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 18, 13, 18, 14, \"ENUM_FIRST_VALUE_ZERO\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 38, 17, 38, 18, \"ENUM_FIRST_VALUE_ZERO\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 44, 17, 44, 18, \"ENUM_FIRST_VALUE_ZERO\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 62, 15, 62, 16, \"ENUM_FIRST_VALUE_ZERO\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 68, 15, 68, 16, \"ENUM_FIRST_VALUE_ZERO\"),\n\t)\n}\n\nfunc TestRunEnumNoAllowAlias(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"enum_no_allow_alias\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 3, 12, 29, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 19, 3, 19, 29, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 41, 7, 41, 33, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 48, 7, 48, 33, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 68, 5, 68, 31, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 75, 5, 75, 31, \"ENUM_NO_ALLOW_ALIAS\"),\n\t)\n}\n\nfunc TestRunEnumPascalCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"enum_pascal_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 16, 6, 16, 10, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 19, 6, 19, 13, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 6, 22, 16, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 6, 25, 15, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 42, 10, 42, 14, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 45, 10, 45, 17, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 48, 10, 48, 20, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 51, 10, 51, 19, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 66, 8, 66, 12, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 69, 8, 69, 15, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 72, 8, 72, 18, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 75, 8, 75, 17, \"ENUM_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunEnumValuePrefix(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"enum_value_prefix\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 3, 10, 12, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 3, 11, 14, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 3, 12, 15, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 7, 22, 17, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 7, 23, 19, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 7, 24, 20, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 7, 25, 20, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 33, 5, 33, 15, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 34, 5, 34, 17, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 35, 5, 35, 18, \"ENUM_VALUE_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 36, 5, 36, 18, \"ENUM_VALUE_PREFIX\"),\n\t)\n}\n\nfunc TestRunEnumValueUpperSnakeCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"enum_value_upper_snake_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 3, 10, 12, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 3, 11, 17, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 3, 12, 14, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 7, 23, 16, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 7, 24, 21, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 7, 25, 18, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 34, 5, 34, 14, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 35, 5, 35, 19, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 36, 5, 36, 16, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t)\n}\n\nfunc TestRunEnumZeroValueSuffix(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"enum_zero_value_suffix\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 14, 3, 14, 18, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 18, 3, 18, 23, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 19, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 36, 7, 36, 22, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 40, 7, 40, 27, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 44, 7, 44, 23, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 56, 5, 56, 20, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 60, 5, 60, 25, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 64, 5, 64, 21, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t)\n}\n\nfunc TestRunEnumZeroValueSuffixCustom(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"enum_zero_value_suffix_custom\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 18, 3, 18, 16, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 23, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 40, 7, 40, 20, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 44, 7, 44, 27, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 60, 5, 60, 18, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 64, 5, 64, 25, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t)\n}\n\nfunc TestRunFieldLowerSnakeCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"field_lower_snake_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 9, 8, 13, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 9, 9, 16, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 9, 10, 18, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 9, 11, 19, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 9, 12, 19, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 20, 13, 20, 17, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 13, 21, 20, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 13, 22, 22, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 13, 23, 23, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 13, 24, 23, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 28, 11, 28, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 11, 29, 18, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 11, 30, 20, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 31, 11, 31, 21, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 32, 11, 32, 21, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 10, 23, 10, 24, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 17, 19, 17, 20, \"FIELD_LOWER_SNAKE_CASE\"),\n\t)\n}\n\nfunc TestRunFieldNoDescriptor(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"field_no_descriptor\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 6, 19, 6, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 7, 19, 7, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 19, 8, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 19, 9, 30, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 19, 10, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 19, 11, 30, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 19, 12, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 13, 19, 13, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 20, 23, 20, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 23, 21, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 23, 22, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 23, 23, 34, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 23, 24, 35, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 23, 25, 34, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 26, 23, 26, 35, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 27, 23, 27, 37, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 27, 30, 37, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 31, 27, 31, 37, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 32, 27, 32, 37, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 33, 27, 33, 38, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 34, 27, 34, 39, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 35, 27, 35, 38, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 36, 27, 36, 39, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 37, 27, 37, 41, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 41, 21, 41, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 42, 21, 42, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 43, 21, 43, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 44, 21, 44, 32, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 45, 21, 45, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 46, 21, 46, 32, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 47, 21, 47, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 48, 21, 48, 35, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 50, 19, 50, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 51, 19, 51, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 52, 19, 52, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 53, 19, 53, 30, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 54, 19, 54, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 55, 19, 55, 30, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 56, 19, 56, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 57, 19, 57, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 61, 19, 61, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 62, 19, 62, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 63, 19, 63, 29, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 64, 19, 64, 30, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 65, 19, 65, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 66, 19, 66, 30, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 67, 19, 67, 31, \"FIELD_NO_DESCRIPTOR\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 68, 19, 68, 33, \"FIELD_NO_DESCRIPTOR\"),\n\t)\n}\n\nfunc TestRunFieldNotRequired(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"field_not_required\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 13, 19, 13, 20, \"FIELD_NOT_REQUIRED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 28, 19, 28, 20, \"FIELD_NOT_REQUIRED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 13, 10, 13, 11, \"FIELD_NOT_REQUIRED\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 28, 10, 28, 11, \"FIELD_NOT_REQUIRED\"),\n\t)\n}\n\nfunc TestRunFileLowerSnakeCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"file_lower_snake_case\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"B.proto\", \"FILE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"Foo.proto\", \"FILE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"aBc.proto\", \"FILE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"ab_c_.proto\", \"FILE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"fooBar.proto\", \"FILE_LOWER_SNAKE_CASE\"),\n\t)\n}\n\nfunc TestRunMessagePascalCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"message_pascal_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 11, 8, 15, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 11, 9, 18, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 13, 10, 23, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 14, 9, 14, 13, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 15, 9, 15, 16, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 16, 9, 16, 19, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 17, 9, 17, 18, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 18, 11, 18, 15, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 19, 11, 19, 18, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 20, 13, 20, 23, \"MESSAGE_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunOneofLowerSnakeCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"oneof_lower_snake_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 9, 12, 13, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 15, 9, 15, 16, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 18, 9, 18, 18, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 9, 21, 19, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 9, 24, 19, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 38, 13, 38, 17, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 41, 13, 41, 20, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 44, 13, 44, 22, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 47, 13, 47, 23, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 50, 13, 50, 23, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 60, 11, 60, 15, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 63, 11, 63, 18, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 66, 11, 66, 20, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 69, 11, 69, 21, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 72, 11, 72, 21, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t)\n}\n\nfunc TestRunPackageDefined(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"package_defined\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a/no_package.proto\", \"PACKAGE_DEFINED\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"no_package.proto\", \"PACKAGE_DEFINED\"),\n\t)\n}\n\nfunc TestRunPackageDirectoryMatch(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"package_directory_match\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a/b/a_c.proto\", 3, 1, 3, 13, \"PACKAGE_DIRECTORY_MATCH\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a/b/a_b.proto\", 3, 1, 3, 13, \"PACKAGE_DIRECTORY_MATCH\"),\n\t)\n}\n\nfunc TestRunPackageLowerSnakeCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"package_lower_snake_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"5.proto\", 3, 1, 3, 19, \"PACKAGE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"6.proto\", 3, 1, 3, 19, \"PACKAGE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"7.proto\", 3, 1, 3, 18, \"PACKAGE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"8.proto\", 3, 1, 3, 20, \"PACKAGE_LOWER_SNAKE_CASE\"),\n\t)\n}\n\nfunc TestRunPackageNoImportCycle(t *testing.T) {\n\tt.Parallel()\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"package_no_import_cycle\",\n\t\t\"\",\n\t\tfunc(image bufimage.Image) bufimage.Image {\n\t\t\t// Testing that import cycles are still detected via imports, but are\n\t\t\t// not reported for imports, only for non-imports.\n\t\t\tvar newImageFiles []bufimage.ImageFile\n\t\t\tfor _, imageFile := range image.Files() {\n\t\t\t\tif imageFile.FileDescriptorProto().GetPackage() == \"b\" {\n\t\t\t\t\tnewImageFiles = append(newImageFiles, bufimage.ImageFileWithIsImport(imageFile, true))\n\t\t\t\t} else {\n\t\t\t\t\trequire.False(t, imageFile.IsImport())\n\t\t\t\t\tnewImageFiles = append(newImageFiles, imageFile)\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewImage, err := bufimage.NewImage(newImageFiles)\n\t\t\trequire.NoError(t, err)\n\t\t\treturn newImage\n\t\t},\n\t\tbufanalysistesting.NewFileAnnotation(t, \"c1.proto\", 5, 1, 5, 19, \"PACKAGE_NO_IMPORT_CYCLE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"d1.proto\", 5, 1, 5, 19, \"PACKAGE_NO_IMPORT_CYCLE\"),\n\t)\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"package_no_import_cycle\",\n\t\t\"\",\n\t\tfunc(image bufimage.Image) bufimage.Image {\n\t\t\t// Testing that import cycles are still detected via imports, but are\n\t\t\t// not reported for imports, only for non-imports.\n\t\t\tvar newImageFiles []bufimage.ImageFile\n\t\t\tfor _, imageFile := range image.Files() {\n\t\t\t\tif imageFile.FileDescriptorProto().GetPackage() == \"b\" {\n\t\t\t\t\tnewImageFiles = append(newImageFiles, bufimage.ImageFileWithIsImport(imageFile, true))\n\t\t\t\t} else {\n\t\t\t\t\trequire.False(t, imageFile.IsImport())\n\t\t\t\t\tnewImageFiles = append(newImageFiles, imageFile)\n\t\t\t\t}\n\t\t\t}\n\t\t\tnewImage, err := bufimage.NewImage(newImageFiles)\n\t\t\trequire.NoError(t, err)\n\t\t\treturn newImage\n\t\t},\n\t\tbufanalysistesting.NewFileAnnotation(t, \"c1.proto\", 5, 1, 5, 19, \"PACKAGE_NO_IMPORT_CYCLE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"d1.proto\", 5, 1, 5, 19, \"PACKAGE_NO_IMPORT_CYCLE\"),\n\t)\n}\n\nfunc TestRunPackageSameDirectory(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"package_same_directory\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 3, 1, 3, 11, \"PACKAGE_SAME_DIRECTORY\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"one/a.proto\", 3, 1, 3, 11, \"PACKAGE_SAME_DIRECTORY\"),\n\t)\n}\n\nfunc TestRunPackageSameDirectoryNoPackage(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"package_same_directory_no_package\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"no_package.proto\", \"PACKAGE_SAME_DIRECTORY\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"one/no_package.proto\", \"PACKAGE_SAME_DIRECTORY\"),\n\t)\n}\n\nfunc TestRunPackageSameOptionValue(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"package_same_option_value\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 5, 1, 5, 33, \"PACKAGE_SAME_CSHARP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 6, 1, 6, 35, \"PACKAGE_SAME_JAVA_MULTIPLE_FILES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 7, 1, 7, 29, \"PACKAGE_SAME_JAVA_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 1, 8, 27, \"PACKAGE_SAME_GO_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 1, 9, 30, \"PACKAGE_SAME_PHP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 1, 10, 29, \"PACKAGE_SAME_RUBY_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 1, 11, 29, \"PACKAGE_SAME_SWIFT_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 5, 1, 5, 33, \"PACKAGE_SAME_CSHARP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 6, 1, 6, 36, \"PACKAGE_SAME_JAVA_MULTIPLE_FILES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 7, 1, 7, 29, \"PACKAGE_SAME_JAVA_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 1, 8, 27, \"PACKAGE_SAME_GO_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 9, 1, 9, 30, \"PACKAGE_SAME_PHP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 10, 1, 10, 29, \"PACKAGE_SAME_RUBY_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 11, 1, 11, 29, \"PACKAGE_SAME_SWIFT_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a.proto\", 6, 1, 6, 33, \"PACKAGE_SAME_CSHARP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a.proto\", 7, 1, 7, 35, \"PACKAGE_SAME_JAVA_MULTIPLE_FILES\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a.proto\", 8, 1, 8, 29, \"PACKAGE_SAME_JAVA_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a.proto\", 9, 1, 9, 27, \"PACKAGE_SAME_GO_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a.proto\", 10, 1, 10, 30, \"PACKAGE_SAME_PHP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a.proto\", 11, 1, 11, 29, \"PACKAGE_SAME_RUBY_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"sub/a.proto\", 12, 1, 12, 29, \"PACKAGE_SAME_SWIFT_PREFIX\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"sub/b.proto\", \"PACKAGE_SAME_CSHARP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"sub/b.proto\", \"PACKAGE_SAME_GO_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"sub/b.proto\", \"PACKAGE_SAME_JAVA_MULTIPLE_FILES\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"sub/b.proto\", \"PACKAGE_SAME_JAVA_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"sub/b.proto\", \"PACKAGE_SAME_PHP_NAMESPACE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"sub/b.proto\", \"PACKAGE_SAME_RUBY_PACKAGE\"),\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"sub/b.proto\", \"PACKAGE_SAME_SWIFT_PREFIX\"),\n\t)\n}\n\nfunc TestRunPackageVersionSuffix(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"package_version_suffix\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo.proto\", 3, 1, 3, 13, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo_bar.proto\", 3, 1, 3, 17, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo_bar_v0beta1.proto\", 3, 1, 3, 25, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo_bar_v1test_foo.proto\", 3, 1, 3, 28, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo_bar_v2beta0.proto\", 3, 1, 3, 25, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo_bar_vv1beta1.proto\", 3, 1, 3, 26, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"v1.proto\", 3, 1, 3, 12, \"PACKAGE_VERSION_SUFFIX\"),\n\t)\n}\n\nfunc TestRunProtovalidate(t *testing.T) {\n\tt.Parallel()\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"protovalidate\",\n\t\t\"buf.testing/lint/protovalidate\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bool.proto\", 18, 51, 18, 84, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bool.proto\", 19, 31, 19, 69, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bool.proto\", 20, 50, 20, 88, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bool.proto\", 27, 5, 27, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bool.proto\", 33, 45, 33, 89, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bytes.proto\", 21, 5, 21, 48, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bytes.proto\", 26, 5, 26, 45, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bytes.proto\", 31, 5, 31, 45, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bytes.proto\", 43, 5, 43, 65, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bytes.proto\", 46, 45, 46, 106, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_expression.proto\", 11, 37, 11, 85, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_expression.proto\", 14, 38, 14, 84, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_expression.proto\", 19, 5, 19, 53, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_expression.proto\", 25, 3, 25, 65, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 10, 37, 14, 4, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 17, 5, 21, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 29, 5, 33, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 35, 39, 39, 4, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 60, 3, 64, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 76, 5, 80, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 88, 5, 92, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 106, 5, 110, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 116, 5, 120, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_field.proto\", 156, 5, 160, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 22, 3, 26, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 34, 3, 38, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 40, 3, 44, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 46, 3, 50, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 52, 3, 56, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 58, 3, 62, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 58, 3, 62, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 70, 3, 74, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 76, 3, 80, 5, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"cel_message.proto\", 82, 5, 86, 7, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 57, 5, 60, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 61, 5, 64, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 68, 5, 71, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 72, 5, 75, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 79, 5, 82, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 83, 5, 86, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 90, 5, 93, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 94, 5, 97, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 105, 5, 108, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 122, 5, 125, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 127, 5, 130, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 155, 5, 158, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"duration.proto\", 164, 64, 164, 126, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"enum.proto\", 28, 5, 28, 40, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"enum.proto\", 36, 5, 36, 42, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"enum.proto\", 39, 47, 39, 102, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"extension.proto\", 21, 7, 21, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"extension.proto\", 26, 7, 26, 57, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"extension.proto\", 36, 5, 36, 41, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"extension.proto\", 41, 5, 41, 55, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"field.proto\", 18, 5, 18, 41, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"field.proto\", 19, 5, 19, 55, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"field.proto\", 23, 52, 23, 102, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"field_mask.proto\", 16, 45, 16, 88, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"field_mask.proto\", 20, 5, 22, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"field_mask.proto\", 31, 5, 31, 45, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 24, 38, 24, 76, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 27, 5, 27, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 29, 5, 29, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 34, 5, 34, 53, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 39, 5, 39, 55, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 44, 5, 44, 47, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 46, 5, 46, 47, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 50, 5, 50, 57, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 53, 5, 53, 50, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 56, 41, 56, 80, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 70, 5, 70, 53, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 71, 5, 71, 77, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 78, 5, 78, 57, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 83, 5, 83, 55, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 86, 5, 86, 57, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 87, 5, 87, 55, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 90, 53, 90, 98, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"map.proto\", 92, 55, 92, 102, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 20, 5, 20, 42, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 25, 5, 25, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 28, 5, 28, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 32, 5, 32, 42, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 35, 5, 35, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 39, 5, 39, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 42, 5, 42, 42, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 46, 5, 46, 11, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 47, 5, 47, 12, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 56, 5, 56, 39, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 65, 5, 65, 41, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 74, 5, 74, 40, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 83, 5, 83, 41, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 92, 5, 92, 39, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 101, 5, 101, 38, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 134, 5, 134, 56, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 139, 5, 139, 50, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 142, 5, 142, 52, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 160, 5, 160, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 163, 53, 163, 91, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 172, 5, 172, 45, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 180, 54, 180, 95, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 184, 5, 184, 45, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 194, 5, 194, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 197, 51, 197, 91, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 206, 5, 206, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 209, 51, 209, 91, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 218, 5, 218, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 221, 57, 221, 97, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 230, 5, 230, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 233, 57, 233, 97, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 242, 5, 242, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 245, 52, 245, 90, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 254, 5, 254, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 257, 52, 257, 90, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 266, 5, 266, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 269, 52, 269, 90, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 278, 5, 278, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 281, 52, 281, 90, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 290, 5, 290, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 293, 77, 293, 116, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 302, 5, 302, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 305, 77, 305, 116, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 314, 5, 314, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 317, 79, 317, 117, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 326, 5, 326, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"number.proto\", 329, 79, 329, 117, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"oneof.proto\", 13, 7, 13, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"oneof.proto\", 19, 7, 19, 43, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 25, 5, 25, 48, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 27, 5, 27, 48, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 45, 5, 45, 48, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 49, 28, 49, 71, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 51, 38, 51, 92, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 53, 26, 53, 74, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 55, 42, 55, 76, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 65, 5, 65, 62, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 68, 55, 68, 110, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"repeated.proto\", 70, 51, 70, 102, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 31, 5, 31, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 36, 5, 36, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 41, 5, 41, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 45, 5, 45, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 47, 5, 47, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 51, 5, 51, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 53, 5, 53, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 58, 5, 58, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 63, 5, 63, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 67, 5, 67, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 69, 5, 69, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 73, 5, 73, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 75, 5, 75, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 79, 5, 79, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 81, 5, 81, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 85, 5, 85, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 87, 5, 87, 44, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 92, 5, 92, 47, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 97, 5, 97, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 102, 5, 102, 47, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 107, 5, 107, 47, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 112, 5, 112, 49, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 117, 5, 117, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 122, 5, 122, 47, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 130, 5, 130, 46, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 133, 5, 133, 45, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 152, 5, 152, 51, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 154, 5, 154, 49, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"string.proto\", 157, 46, 157, 86, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 57, 5, 60, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 61, 5, 64, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 68, 5, 71, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 72, 5, 75, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 79, 5, 82, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 83, 5, 86, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 90, 5, 93, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 94, 5, 97, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 105, 5, 108, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 124, 5, 127, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 129, 5, 132, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 142, 5, 145, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 150, 5, 153, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 157, 5, 160, 6, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"timestamp.proto\", 198, 65, 201, 4, \"PROTOVALIDATE\"),\n\t)\n}\n\nfunc TestRunProtovalidatePredefinedRules(t *testing.T) {\n\tt.Parallel()\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"protovalidate_predefined\",\n\t\t\"buf.testing/lint/proto\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotation(t, \"test.proto\", 14, 44, 18, 4, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"test.proto\", 43, 5, 43, 57, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"test.proto\", 43, 5, 43, 57, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"test.proto\", 44, 5, 44, 64, \"PROTOVALIDATE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"test.proto\", 60, 5, 60, 43, \"PROTOVALIDATE\"),\n\t)\n}\n\nfunc TestRunRPCNoStreaming(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_no_streaming\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 3, 9, 88, \"RPC_NO_CLIENT_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 3, 10, 89, \"RPC_NO_SERVER_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 3, 11, 92, \"RPC_NO_CLIENT_STREAMING\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 3, 11, 92, \"RPC_NO_SERVER_STREAMING\"),\n\t)\n}\n\nfunc TestRunRPCPascalCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_pascal_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 7, 11, 11, \"RPC_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 7, 12, 14, \"RPC_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 13, 7, 13, 17, \"RPC_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 14, 7, 14, 16, \"RPC_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunRPCRequestResponseUnique(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_request_response_unique\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 3, 21, 32, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 3, 23, 35, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 3, 25, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 27, 3, 27, 52, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 28, 3, 28, 55, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 29, 69, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 29, 69, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 3, 30, 38, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t)\n}\n\nfunc TestRunRPCRequestResponseUniqueAllowEmptyRequests(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_request_response_unique_allow_empty_requests\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 3, 21, 32, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 3, 23, 35, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 3, 25, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 28, 3, 28, 55, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 29, 69, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 29, 69, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 3, 30, 38, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t)\n}\n\nfunc TestRunRPCRequestResponseUniqueAllowEmptyResponses(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_request_response_unique_allow_empty_responses\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 3, 21, 32, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 3, 23, 35, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 3, 25, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 27, 3, 27, 52, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 29, 69, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 29, 69, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 3, 30, 38, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t)\n}\n\nfunc TestRunRPCRequestResponseUniqueAllowEmptyRequestsAndResponses(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_request_response_unique_allow_empty_requests_and_responses\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 3, 21, 32, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 3, 23, 35, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 3, 25, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 3, 30, 38, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t)\n}\n\nfunc TestRunRPCRequestResponseUniqueAllowSame(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_request_response_unique_allow_same\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 3, 21, 32, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 3, 23, 35, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 3, 25, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 27, 3, 27, 52, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 28, 3, 28, 55, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 29, 3, 29, 69, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t)\n}\n\nfunc TestRunRPCRequestResponseUniqueAllowSameAndEmptyRequestResponses(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_request_response_unique_allow_same_and_empty_request_responses\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 21, 3, 21, 32, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 36, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 23, 3, 23, 35, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 34, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 25, 3, 25, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 8, 3, 8, 37, \"RPC_REQUEST_RESPONSE_UNIQUE\"),\n\t)\n}\n\nfunc TestRunRPCStandardName(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_standard_name\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 19, 10, 22, \"RPC_REQUEST_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 50, 11, 53, \"RPC_RESPONSE_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 27, 12, 48, \"RPC_REQUEST_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 13, 66, 13, 87, \"RPC_RESPONSE_STANDARD_NAME\"),\n\t)\n}\n\nfunc TestRunRPCStandardNameAllowEmpty(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"rpc_standard_name_allow_empty\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 19, 10, 22, \"RPC_REQUEST_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 50, 11, 53, \"RPC_RESPONSE_STANDARD_NAME\"),\n\t)\n}\n\nfunc TestRunServicePascalCase(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"service_pascal_case\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 9, 8, 13, \"SERVICE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 9, 9, 16, \"SERVICE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 9, 10, 19, \"SERVICE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 9, 11, 18, \"SERVICE_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunServiceSuffix(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"service_suffix\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 9, 8, 13, \"SERVICE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 9, 9, 16, \"SERVICE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 9, 10, 21, \"SERVICE_SUFFIX\"),\n\t)\n}\n\nfunc TestRunServiceSuffixCustom(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"service_suffix_custom\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 8, 9, 8, 13, \"SERVICE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 9, 9, 20, \"SERVICE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 10, 9, 10, 17, \"SERVICE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 11, 9, 11, 17, \"SERVICE_SUFFIX\"),\n\t)\n}\n\nfunc TestRunSyntaxSpecified(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"syntax_specified\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a/a.proto\", \"SYNTAX_SPECIFIED\"),\n\t)\n}\n\nfunc TestRunStablePackageNoImportUnstable(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"lint_stable_package_import\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"api/v1/foo.proto\", 5, 1, 5, 32, \"STABLE_PACKAGE_NO_IMPORT_UNSTABLE\"),\n\t)\n}\n\nfunc TestRunIgnores1(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"ignores1\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/bar/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/bar/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunIgnores2(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"ignores2\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunIgnores3(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"ignores3\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunIgnores4(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"ignores4\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestRunV2WorkspaceIgnores(t *testing.T) {\n\tt.Parallel()\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"v2/ignores\",\n\t\t\"ignores1\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar1/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar1/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar1/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar1/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar1/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar1/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf1.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf1.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf1.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/bar/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/bar/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo1/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t)\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"v2/ignores\",\n\t\t\"ignores2\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar2/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar2/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar2/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf2.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf2.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t)\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"v2/ignores\",\n\t\t\"ignores3\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar3/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar3/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar3/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"bar3/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf3.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf3.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf3.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo3/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo3/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo3/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo3/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo3/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"foo3/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\"),\n\t)\n}\n\nfunc TestCommentIgnoresOff(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"comment_ignores_off\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 1, 9, 11, \"PACKAGE_DIRECTORY_MATCH\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 1, 9, 11, \"PACKAGE_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 9, 1, 9, 11, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 12, 1, 12, 45, \"IMPORT_NO_PUBLIC\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 15, 6, 15, 13, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 17, 3, 17, 29, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 20, 3, 20, 14, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 20, 3, 20, 14, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 22, 3, 22, 13, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 3, 24, 13, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 28, 9, 28, 19, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 30, 11, 30, 21, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 32, 13, 32, 23, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 34, 12, 34, 19, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 36, 9, 36, 35, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 39, 9, 39, 20, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 39, 9, 39, 20, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 41, 9, 41, 19, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 43, 9, 43, 19, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 46, 13, 46, 16, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 48, 13, 48, 16, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 50, 15, 50, 18, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 54, 11, 54, 14, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 56, 11, 56, 14, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 58, 13, 58, 16, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 62, 9, 62, 12, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 64, 9, 64, 12, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 66, 11, 66, 14, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 71, 9, 71, 19, \"SERVICE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 75, 7, 75, 16, \"RPC_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 75, 17, 75, 38, \"RPC_REQUEST_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 75, 49, 75, 70, \"RPC_RESPONSE_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 5, 1, 5, 11, \"PACKAGE_DIRECTORY_MATCH\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 5, 1, 5, 11, \"PACKAGE_VERSION_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 9, 26, 9, 28, \"ENUM_FIRST_VALUE_ZERO\"),\n\t)\n}\n\nfunc TestCommentIgnoresOn(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"comment_ignores_on\",\n\t)\n}\n\nfunc TestCommentIgnoresCascadeOff(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"comment_ignores_cascade_off\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 13, 6, 13, 13, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 15, 3, 15, 29, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 16, 3, 16, 14, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 16, 3, 16, 14, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 17, 3, 17, 13, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 18, 3, 18, 13, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 24, 9, 24, 19, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 28, 11, 28, 21, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 32, 13, 32, 23, \"MESSAGE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 35, 12, 35, 19, \"ENUM_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 37, 9, 37, 35, \"ENUM_NO_ALLOW_ALIAS\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 39, 9, 39, 20, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 39, 9, 39, 20, \"ENUM_ZERO_VALUE_SUFFIX\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 40, 9, 40, 19, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 41, 9, 41, 19, \"ENUM_VALUE_UPPER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 43, 13, 43, 16, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 44, 13, 44, 16, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 45, 15, 45, 18, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 48, 11, 48, 14, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 49, 11, 49, 14, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 50, 13, 50, 16, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 53, 9, 53, 12, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 54, 9, 54, 12, \"ONEOF_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 55, 11, 55, 14, \"FIELD_LOWER_SNAKE_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 63, 9, 63, 19, \"SERVICE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 64, 7, 64, 16, \"RPC_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 64, 17, 64, 38, \"RPC_REQUEST_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 64, 49, 64, 70, \"RPC_RESPONSE_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 68, 9, 68, 19, \"SERVICE_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 72, 7, 72, 16, \"RPC_PASCAL_CASE\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 72, 17, 72, 38, \"RPC_REQUEST_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 72, 49, 72, 70, \"RPC_RESPONSE_STANDARD_NAME\"),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"b.proto\", 9, 26, 9, 28, \"ENUM_FIRST_VALUE_ZERO\"),\n\t)\n}\n\nfunc TestCommentIgnoresCascadeOn(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"comment_ignores_cascade_on\",\n\t)\n}\n\nfunc TestCommentIgnoresOnlyRule(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"comment_ignores_multiple_fails\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"a.proto\", 4, 1, 4, 11, \"PACKAGE_VERSION_SUFFIX\"),\n\t)\n}\n\nfunc TestCommentIgnoresWithTrailingComment(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"comment_ignores_with_trailing_comment\",\n\t)\n}\n\nfunc TestRunLintCustomPlugins(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"custom_plugins\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a.proto\", \"PACKAGE_DEFINED\"),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 8, 1, 10, 2, \"SERVICE_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 15, 1, 17, 2, \"PAGE_REQUEST_HAS_TOKEN\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-rpc-ext\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 19, 1, 25, 2, \"PAGE_RESPONSE_HAS_TOKEN\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-rpc-ext\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 21, 5, 21, 19, \"VALIDATE_ID_DASHLESS\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-protovalidate-ext\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 27, 1, 27, 26, \"PAGE_REQUEST_HAS_TOKEN\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-rpc-ext\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 28, 1, 28, 27, \"PAGE_RESPONSE_HAS_TOKEN\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-rpc-ext\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 6, 3, 6, 66, \"RPC_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 14, 5, 14, 24, \"ENUM_VALUE_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 19, 5, 19, 23, \"FIELD_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix\"),\n\t\t),\n\t)\n}\n\nfunc TestRunLintCustomWasmPlugins(t *testing.T) {\n\tt.Parallel()\n\tif testing.Short() {\n\t\tt.Skip(\"skipping test in short mode\")\n\t}\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"custom_wasm_plugins\",\n\t\t\"\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a.proto\", \"PACKAGE_DEFINED\"),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 8, 1, 10, 2, \"SERVICE_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 6, 3, 6, 66, \"RPC_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 14, 5, 14, 24, \"ENUM_VALUE_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 19, 5, 19, 23, \"FIELD_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t),\n\t)\n}\n\nfunc TestRunLintEditionsGoFeatures(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"editions_go_features\",\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a.proto\", \"PACKAGE_DEFINED\"),\n\t)\n}\n\nfunc TestRunLintPolicyEmpty(t *testing.T) {\n\tt.Parallel()\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"policy_empty\",\n\t\t\"\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 3, 1, 3, 11, \"PACKAGE_DIRECTORY_MATCH\",\n\t\t\tbufanalysistesting.WithPolicyName(\"empty.policy.yaml\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 3, 1, 3, 11, \"PACKAGE_VERSION_SUFFIX\",\n\t\t\tbufanalysistesting.WithPolicyName(\"empty.policy.yaml\"),\n\t\t),\n\t)\n}\n\nfunc TestRunLintPolicyDisableBuiltin(t *testing.T) {\n\tt.Parallel()\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"policy_disablebuiltin\",\n\t\t\"\",\n\t\tnil,\n\t)\n}\n\nfunc TestRunLintPolicyLocal(t *testing.T) {\n\tt.Parallel()\n\ttestLintWithOptions(\n\t\tt,\n\t\t\"policy_local\",\n\t\t\"\",\n\t\tnil,\n\t\tbufanalysistesting.NewFileAnnotationNoLocation(t, \"a.proto\", \"PACKAGE_DEFINED\"),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"a.proto\", 8, 1, 10, 2, \"SERVICE_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t\tbufanalysistesting.WithPolicyName(\"buf.policy1.yaml\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 6, 3, 6, 66, \"RPC_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t\tbufanalysistesting.WithPolicyName(\"buf.policy1.yaml\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 14, 5, 14, 24, \"ENUM_VALUE_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t\tbufanalysistesting.WithPolicyName(\"buf.policy2.yaml\"),\n\t\t),\n\t\tbufanalysistesting.NewFileAnnotation(\n\t\t\tt, \"b.proto\", 19, 5, 19, 23, \"FIELD_BANNED_SUFFIXES\",\n\t\t\tbufanalysistesting.WithPluginName(\"buf-plugin-suffix.wasm\"),\n\t\t\tbufanalysistesting.WithPolicyName(\"buf.policy2.yaml\"),\n\t\t),\n\t)\n}\n\nfunc TestRunLintPolicyIgnores1(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"policy_ignores1\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/bar/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/bar/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t)\n}\n\nfunc TestRunLintPolicyIgnores2(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"policy_ignores2\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t)\n}\n\nfunc TestRunLintPolicyIgnores3(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"policy_ignores3\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t)\n}\n\nfunc TestRunLintPolicyIgnores4(t *testing.T) {\n\tt.Parallel()\n\ttestLint(\n\t\tt,\n\t\t\"policy_ignores4\",\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 9, 9, 9, 13, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/bar/bar2.proto\", 13, 6, 13, 10, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/baz/baz.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 6, 9, 6, 15, \"FIELD_LOWER_SNAKE_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 9, 9, 9, 12, \"MESSAGE_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t\tbufanalysistesting.NewFileAnnotation(t, \"buf/foo/buf.proto\", 13, 6, 13, 9, \"ENUM_PASCAL_CASE\", bufanalysistesting.WithPolicyName(\"policy.yaml\")),\n\t)\n}\n\nfunc testLint(\n\tt *testing.T,\n\trelDirPath string,\n\texpectedFileAnnotations ...bufanalysis.FileAnnotation,\n) {\n\ttestLintWithOptions(\n\t\tt,\n\t\trelDirPath,\n\t\t\"\",\n\t\tnil,\n\t\texpectedFileAnnotations...,\n\t)\n}\n\nfunc testLintWithOptions(\n\tt *testing.T,\n\trelDirPath string,\n\t// only set if in workspace\n\tmoduleFullNameString string,\n\timageModifier func(bufimage.Image) bufimage.Image,\n\texpectedFileAnnotations ...bufanalysis.FileAnnotation,\n) {\n\tctx, cancel := context.WithTimeout(t.Context(), 60*time.Second) // Increased timeout for Wasm runtime\n\tdefer cancel()\n\n\tbaseDirPath := filepath.Join(\"testdata\", \"lint\")\n\tdirPath := filepath.Join(baseDirPath, relDirPath)\n\tlogger := slogtestext.NewLogger(t)\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\treadWriteBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tdirPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\tbucketTargeting, err := buftarget.NewBucketTargeting(\n\t\tctx,\n\t\tlogger,\n\t\treadWriteBucket,\n\t\t\".\", // the bucket is rooted at the input\n\t\tnil,\n\t\tnil,\n\t\tbuftarget.TerminateAtControllingWorkspace,\n\t)\n\trequire.NoError(t, err)\n\tworkspace, err := bufworkspace.NewWorkspaceProvider(\n\t\tlogger,\n\t\tbufmodule.NopGraphProvider,\n\t\tbufmodule.NopModuleDataProvider,\n\t\tbufmodule.NopCommitProvider,\n\t\tbufplugin.NopPluginKeyProvider,\n\t).GetWorkspaceForBucket(\n\t\tctx,\n\t\treadWriteBucket,\n\t\tbucketTargeting,\n\t)\n\trequire.NoError(t, err)\n\n\t// the module full name string represents the opaque ID of the module\n\topaqueID, err := testGetRootOpaqueID(workspace, moduleFullNameString)\n\tif err != nil {\n\t\topaqueID, err = testGetRootOpaqueID(workspace, \".\")\n\t\trequire.NoError(t, err)\n\t}\n\n\t// build the image for the specified module string (opaqueID)\n\tmoduleSet, err := workspace.WithTargetOpaqueIDs(opaqueID)\n\trequire.NoError(t, err)\n\tmoduleReadBucket := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet)\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tlogger,\n\t\tmoduleReadBucket,\n\t)\n\trequire.NoError(t, err)\n\tif imageModifier != nil {\n\t\timage = imageModifier(image)\n\t}\n\n\tlintConfig := workspace.GetLintConfigForOpaqueID(opaqueID)\n\trequire.NotNil(t, lintConfig)\n\twasmRuntime, err := wasm.NewRuntime(ctx)\n\trequire.NoError(t, err)\n\tt.Cleanup(func() {\n\t\trequire.NoError(t, wasmRuntime.Close(ctx))\n\t})\n\tclient, err := bufcheck.NewClient(\n\t\tlogger,\n\t\tbufcheck.ClientWithRunnerProvider(bufcheck.NewLocalRunnerProvider(wasmRuntime)),\n\t\tbufcheck.ClientWithLocalWasmPluginsFromOS(),\n\t\tbufcheck.ClientWithLocalPolicies(func(filePath string) ([]byte, error) {\n\t\t\t// Read policies relative to the base directory path.\n\t\t\treturn os.ReadFile(filepath.Join(dirPath, filePath))\n\t\t}),\n\t)\n\trequire.NoError(t, err)\n\terr = client.Lint(\n\t\tctx,\n\t\tlintConfig,\n\t\timage,\n\t\tbufcheck.WithPluginConfigs(workspace.PluginConfigs()...),\n\t\tbufcheck.WithPolicyConfigs(workspace.PolicyConfigs()...),\n\t)\n\tif len(expectedFileAnnotations) == 0 {\n\t\tassert.NoError(t, err)\n\t} else {\n\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\trequire.ErrorAs(t, err, &fileAnnotationSet, \"error has unexpected type: %T\", err)\n\t\tbufanalysistesting.AssertFileAnnotationsEqual(\n\t\t\tt,\n\t\t\texpectedFileAnnotations,\n\t\t\tfileAnnotationSet.FileAnnotations(),\n\t\t)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/multi_client.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n)\n\ntype multiClient struct {\n\tlogger           *slog.Logger\n\tcheckClientSpecs []*checkClientSpec\n}\n\nfunc newMultiClient(logger *slog.Logger, checkClientSpecs []*checkClientSpec) *multiClient {\n\treturn &multiClient{\n\t\tlogger:           logger,\n\t\tcheckClientSpecs: checkClientSpecs,\n\t}\n}\n\nfunc (c *multiClient) Check(ctx context.Context, request check.Request) ([]*annotation, error) {\n\tallRules, chunkedRuleIDs, _, _, err := c.getRulesCategoriesAndChunkedIDs(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// These are the specific ruleIDs that were requested.\n\trequestRuleIDs := request.RuleIDs()\n\tif len(requestRuleIDs) == 0 {\n\t\t// If we didn't have specific ruleIDs, the requested ruleIDs are all default ruleIDs.\n\t\trequestRuleIDs = xslices.Map(xslices.Filter(allRules, Rule.Default), Rule.ID)\n\t}\n\t// This is a map of the requested ruleIDs.\n\trequestRuleIDMap := make(map[string]struct{})\n\tfor _, requestRuleID := range requestRuleIDs {\n\t\trequestRuleIDMap[requestRuleID] = struct{}{}\n\t}\n\n\tvar allAnnotations []*annotation\n\tvar jobs []func(context.Context) error\n\tvar lock sync.Mutex\n\tfor i, delegate := range c.checkClientSpecs {\n\t\t// This is all ruleIDs for this client.\n\t\tallDelegateRuleIDs := chunkedRuleIDs[i]\n\t\t// This is the specific requested ruleIDs for this client\n\t\trequestDelegateRuleIDs := make([]string, 0, len(allDelegateRuleIDs))\n\t\tfor _, delegateRuleID := range allDelegateRuleIDs {\n\t\t\t// If this ruleID was requested, add it to requestDelegateRuleIDs.\n\t\t\t// This will result it being part of the delegate Request.\n\t\t\tif _, ok := requestRuleIDMap[delegateRuleID]; ok {\n\t\t\t\trequestDelegateRuleIDs = append(requestDelegateRuleIDs, delegateRuleID)\n\t\t\t}\n\t\t}\n\t\t// When there are no rule IDs requested, we already set all default rules above, so\n\t\t// if there are no rule IDs set for the delegate, we skip this delegate. Otherwise, a\n\t\t// request with no rule IDs will be made to the delegate client, and default rules will\n\t\t// be called.\n\t\tif len(requestDelegateRuleIDs) == 0 {\n\t\t\tc.logger.DebugContext(ctx, \"skipping delegate client\", slog.String(\"pluginName\", delegate.PluginName))\n\t\t\tcontinue\n\t\t}\n\t\tdelegateRequest, err := check.NewRequest(\n\t\t\trequest.FileDescriptors(),\n\t\t\tcheck.WithAgainstFileDescriptors(request.AgainstFileDescriptors()),\n\t\t\t// Do not use the options from Request. We parsed the options to the config or to\n\t\t\t// the checkClientSpec.\n\t\t\tcheck.WithOptions(delegate.Options),\n\t\t\tcheck.WithRuleIDs(requestDelegateRuleIDs...),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tjobs = append(\n\t\t\tjobs,\n\t\t\tfunc(ctx context.Context) error {\n\t\t\t\tdefer xslog.DebugProfile(c.logger, slog.String(\"plugin\", delegate.PluginName))()\n\t\t\t\tdelegateResponse, err := delegate.Client.Check(ctx, delegateRequest)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn formatDelegateError(delegate, err)\n\t\t\t\t}\n\t\t\t\tannotations := xslices.Map(\n\t\t\t\t\tdelegateResponse.Annotations(),\n\t\t\t\t\tfunc(checkAnnotation check.Annotation) *annotation {\n\t\t\t\t\t\treturn newAnnotation(checkAnnotation, delegate.PluginName, delegate.PolicyName)\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tlock.Lock()\n\t\t\t\tallAnnotations = append(allAnnotations, annotations...)\n\t\t\t\tlock.Unlock()\n\t\t\t\treturn nil\n\t\t\t},\n\t\t)\n\t}\n\tif err := thread.Parallelize(ctx, jobs); err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Slice(\n\t\tallAnnotations,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn check.CompareAnnotations(allAnnotations[i], allAnnotations[j]) < 0\n\t\t},\n\t)\n\treturn allAnnotations, nil\n}\n\nfunc (c *multiClient) ListRulesAndCategories(ctx context.Context) ([]Rule, []Category, error) {\n\trules, _, categories, _, err := c.getRulesCategoriesAndChunkedIDs(ctx)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn rules, categories, nil\n}\n\n// Each []string within the returned [][]string is a slice of ruleIDs that corresponds\n// to the client at the same index.\n//\n// For example, chunkedRuleIDs[1] corresponds to the ruleIDs for c.clients[1].\n//\n// This function does duplicate checking across all the Rules and Categories\n// across the plugins.\nfunc (c *multiClient) getRulesCategoriesAndChunkedIDs(ctx context.Context) (\n\tretRules []Rule,\n\tretChunkedRuleIDs [][]string,\n\tretCategories []Category,\n\tretChunkedCategoryIDs [][]string,\n\tretErr error,\n) {\n\tdefer xslog.DebugProfile(c.logger)()\n\tvar rules []Rule\n\tchunkedRuleIDs := make([][]string, len(c.checkClientSpecs))\n\tfor i, delegate := range c.checkClientSpecs {\n\t\tdelegateCheckRules, err := delegate.Client.ListRules(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, nil, formatDelegateError(delegate, err)\n\t\t}\n\t\tdelegateRules := xslices.Map(\n\t\t\tdelegateCheckRules,\n\t\t\tfunc(checkRule check.Rule) Rule {\n\t\t\t\treturn newRule(checkRule, delegate.PluginName, delegate.PolicyName)\n\t\t\t},\n\t\t)\n\t\trules = append(rules, delegateRules...)\n\t\t// Already sorted.\n\t\tchunkedRuleIDs[i] = xslices.Map(delegateRules, Rule.ID)\n\t}\n\n\tvar categories []Category\n\tchunkedCategoryIDs := make([][]string, len(c.checkClientSpecs))\n\tfor i, delegate := range c.checkClientSpecs {\n\t\tdelegateCheckCategories, err := delegate.Client.ListCategories(ctx)\n\t\tif err != nil {\n\t\t\treturn nil, nil, nil, nil, formatDelegateError(delegate, err)\n\t\t}\n\t\tdelegateCategories := xslices.Map(\n\t\t\tdelegateCheckCategories,\n\t\t\tfunc(checkCategory check.Category) Category {\n\t\t\t\treturn newCategory(checkCategory, delegate.PluginName, delegate.PolicyName)\n\t\t\t},\n\t\t)\n\t\tcategories = append(categories, delegateCategories...)\n\t\t// Already sorted.\n\t\tchunkedCategoryIDs[i] = xslices.Map(delegateCategories, Category.ID)\n\t}\n\n\tif err := validateNoDuplicateRulesOrCategories(rules, categories); err != nil {\n\t\treturn nil, nil, nil, nil, err\n\t}\n\n\tsort.Slice(\n\t\trules,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn check.CompareRules(rules[i], rules[j]) < 0\n\t\t},\n\t)\n\tsort.Slice(\n\t\tcategories,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn check.CompareCategories(categories[i], categories[j]) < 0\n\t\t},\n\t)\n\n\treturn rules, chunkedRuleIDs, categories, chunkedCategoryIDs, nil\n}\n\nfunc validateNoDuplicateRulesOrCategories(rules []Rule, categories []Category) error {\n\tidToRuleOrCategories := make(map[string][]RuleOrCategory)\n\tfor _, rule := range rules {\n\t\tidToRuleOrCategories[rule.ID()] = append(\n\t\t\tidToRuleOrCategories[rule.ID()],\n\t\t\trule,\n\t\t)\n\t}\n\tfor _, category := range categories {\n\t\tidToRuleOrCategories[category.ID()] = append(\n\t\t\tidToRuleOrCategories[category.ID()],\n\t\t\tcategory,\n\t\t)\n\t}\n\tfor id, ruleOrCategories := range idToRuleOrCategories {\n\t\tif len(ruleOrCategories) <= 1 {\n\t\t\tdelete(idToRuleOrCategories, id)\n\t\t}\n\t}\n\tif len(idToRuleOrCategories) > 0 {\n\t\treturn newDuplicateRuleOrCategoryError(idToRuleOrCategories)\n\t}\n\treturn nil\n}\n\ntype duplicateRuleOrCategoryError struct {\n\tduplicateIDToRuleOrCategories map[string][]RuleOrCategory\n}\n\nfunc newDuplicateRuleOrCategoryError(\n\tduplicateIDToRuleOrCategories map[string][]RuleOrCategory,\n) *duplicateRuleOrCategoryError {\n\treturn &duplicateRuleOrCategoryError{\n\t\tduplicateIDToRuleOrCategories: duplicateIDToRuleOrCategories,\n\t}\n}\n\nfunc (d *duplicateRuleOrCategoryError) Error() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\tif len(d.duplicateIDToRuleOrCategories) == 0 {\n\t\treturn \"\"\n\t}\n\n\tvar sb strings.Builder\n\t_, _ = sb.WriteString(\"duplicate rule IDs detected from plugins:\\n\")\n\tduplicateIDs := d.duplicateIDs()\n\tfor i, duplicateID := range duplicateIDs {\n\t\t// Example of this loop:\n\t\t//\n\t\t// RULE_FOO: builtin, buf-plugin-foo, buf-plugin-bar\n\t\t// CATEGORY_BAR: buf-plugin-foo, buf-plugin-baz\n\t\t_, _ = sb.WriteString(duplicateID)\n\t\t_, _ = sb.WriteString(\": \")\n\t\truleOrCategories := d.duplicateIDToRuleOrCategories[duplicateID]\n\t\tsort.Slice(\n\t\t\truleOrCategories,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn ruleOrCategories[i].ID() < ruleOrCategories[j].ID()\n\t\t\t},\n\t\t)\n\t\t_, _ = sb.WriteString(\n\t\t\tstrings.Join(\n\t\t\t\txslices.Map(\n\t\t\t\t\truleOrCategories,\n\t\t\t\t\tfunc(ruleOrCategory RuleOrCategory) string {\n\t\t\t\t\t\tif pluginName := ruleOrCategory.PluginName(); pluginName != \"\" {\n\t\t\t\t\t\t\treturn pluginName\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"builtin\"\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\t\", \",\n\t\t\t),\n\t\t)\n\t\tif i != len(duplicateIDs)-1 {\n\t\t\t_, _ = sb.WriteString(\"\\n\")\n\t\t}\n\t}\n\treturn sb.String()\n}\n\nfunc (d *duplicateRuleOrCategoryError) duplicateIDs() []string {\n\tif d == nil {\n\t\treturn nil\n\t}\n\tif len(d.duplicateIDToRuleOrCategories) == 0 {\n\t\treturn nil\n\t}\n\treturn xslices.MapKeysToSortedSlice(d.duplicateIDToRuleOrCategories)\n}\n\n// formatDelegateError formats the error messages including plugin and policy information.\nfunc formatDelegateError(delegate *checkClientSpec, err error) error {\n\tif delegate.PluginName == \"\" {\n\t\treturn err // Built-in rule, return error as-is\n\t}\n\tvar errorMsg strings.Builder\n\terrorMsg.WriteString(\"plugin \")\n\terrorMsg.WriteString(fmt.Sprintf(\"%q\", delegate.PluginName))\n\tif delegate.PolicyName != \"\" {\n\t\terrorMsg.WriteString(\" from policy \")\n\t\terrorMsg.WriteString(fmt.Sprintf(\"%q\", delegate.PolicyName))\n\t}\n\terrorMsg.WriteString(\" failed: \")\n\treturn fmt.Errorf(\"%s%w\", errorMsg.String(), err)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/multi_client_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"context\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/check/checktest\"\n\t\"buf.build/go/bufplugin/check/checkutil\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tfieldLowerSnakeCaseRuleID = \"FIELD_LOWER_SNAKE_CASE\"\n\ttimestampSuffixRuleID     = \"TIMESTAMP_SUFFIX\"\n\ttimestampSuffixOptionKey  = \"timestamp_suffix\"\n\tdefaultTimestampSuffix    = \"_time\"\n)\n\nvar (\n\tfieldLowerSnakeCaseRuleSpec = &check.RuleSpec{\n\t\tID:      fieldLowerSnakeCaseRuleID,\n\t\tDefault: true,\n\t\tPurpose: \"Checks that all field names are lower_snake_case.\",\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: checkutil.NewFieldRuleHandler(checkFieldLowerSnakeCase),\n\t}\n\n\tfieldLowerSnakeCaseSpec = &check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\tfieldLowerSnakeCaseRuleSpec,\n\t\t},\n\t}\n\n\ttimestampSuffixRuleSpec = &check.RuleSpec{\n\t\tID:      timestampSuffixRuleID,\n\t\tDefault: true,\n\t\tPurpose: `Checks that all google.protobuf.Timestamps end in a specific suffix (default is \"_time\").`,\n\t\tType:    check.RuleTypeLint,\n\t\tHandler: checkutil.NewFieldRuleHandler(checkTimestampSuffix),\n\t}\n\n\ttimestampSuffixSpec = &check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\ttimestampSuffixRuleSpec,\n\t\t},\n\t}\n)\n\nfunc TestMultiClientSimple(t *testing.T) {\n\tt.Parallel()\n\n\ttestMultiClientSimple(t, false)\n}\n\nfunc TestMultiClientSimpleCacheRules(t *testing.T) {\n\tt.Parallel()\n\n\ttestMultiClientSimple(t, true)\n}\n\nfunc testMultiClientSimple(t *testing.T, cacheRules bool) {\n\tctx := t.Context()\n\n\trequestSpec := &checktest.RequestSpec{\n\t\tFiles: &checktest.ProtoFileSpec{\n\t\t\tDirPaths:  []string{\"testdata/multi_client/simple\"},\n\t\t\tFilePaths: []string{\"simple.proto\"},\n\t\t},\n\t}\n\trequest, err := requestSpec.ToRequest(ctx)\n\trequire.NoError(t, err)\n\n\tvar clientForSpecOptions []check.ClientForSpecOption\n\tif cacheRules {\n\t\tclientForSpecOptions = append(clientForSpecOptions, check.ClientWithCaching())\n\t}\n\tfieldLowerSnakeCaseClient, err := check.NewClientForSpec(fieldLowerSnakeCaseSpec, clientForSpecOptions...)\n\trequire.NoError(t, err)\n\ttimestampSuffixClient, err := check.NewClientForSpec(timestampSuffixSpec, clientForSpecOptions...)\n\trequire.NoError(t, err)\n\temptyOptions, err := option.NewOptions(nil)\n\trequire.NoError(t, err)\n\tmultiClient := newMultiClient(\n\t\tslogtestext.NewLogger(t),\n\t\t[]*checkClientSpec{\n\t\t\tnewCheckClientSpec(\"buf-plugin-field-lower-snake-case\", \"\", fieldLowerSnakeCaseClient, emptyOptions),\n\t\t\tnewCheckClientSpec(\"buf-plugin-timestamp-suffix\", \"\", timestampSuffixClient, emptyOptions),\n\t\t},\n\t)\n\n\trules, _, err := multiClient.ListRulesAndCategories(ctx)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\tfieldLowerSnakeCaseRuleID,\n\t\t\ttimestampSuffixRuleID,\n\t\t},\n\t\txslices.Map(rules, Rule.ID),\n\t)\n\tannotations, err := multiClient.Check(ctx, request)\n\trequire.NoError(t, err)\n\tchecktest.AssertAnnotationsEqual(\n\t\tt,\n\t\t[]checktest.ExpectedAnnotation{\n\t\t\t{\n\t\t\t\tRuleID: fieldLowerSnakeCaseRuleID,\n\t\t\t\tFileLocation: &checktest.ExpectedFileLocation{\n\t\t\t\t\tFileName:    \"simple.proto\",\n\t\t\t\t\tStartLine:   10,\n\t\t\t\t\tStartColumn: 2,\n\t\t\t\t\tEndLine:     10,\n\t\t\t\t\tEndColumn:   23,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tRuleID: timestampSuffixRuleID,\n\t\t\t\tFileLocation: &checktest.ExpectedFileLocation{\n\t\t\t\t\tFileName:    \"simple.proto\",\n\t\t\t\t\tStartLine:   9,\n\t\t\t\t\tStartColumn: 2,\n\t\t\t\t\tEndLine:     9,\n\t\t\t\t\tEndColumn:   50,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\txslices.Map(\n\t\t\tannotations,\n\t\t\tfunc(annotation *annotation) check.Annotation {\n\t\t\t\treturn annotation\n\t\t\t},\n\t\t),\n\t)\n}\n\nfunc TestMultiClientCannotHaveOverlappingRules(t *testing.T) {\n\tt.Parallel()\n\n\tfieldLowerSnakeCaseClient, err := check.NewClientForSpec(fieldLowerSnakeCaseSpec)\n\trequire.NoError(t, err)\n\temptyOptions, err := option.NewOptions(nil)\n\trequire.NoError(t, err)\n\tmultiClient := newMultiClient(\n\t\tslogtestext.NewLogger(t),\n\t\t[]*checkClientSpec{\n\t\t\tnewCheckClientSpec(\"buf-plugin-field-lower-snake-case\", \"\", fieldLowerSnakeCaseClient, emptyOptions),\n\t\t\tnewCheckClientSpec(\"buf-plugin-field-lower-snake-case\", \"\", fieldLowerSnakeCaseClient, emptyOptions),\n\t\t},\n\t)\n\n\t_, _, err = multiClient.ListRulesAndCategories(t.Context())\n\tduplicateRuleOrCategoryError := &duplicateRuleOrCategoryError{}\n\trequire.ErrorAs(t, err, &duplicateRuleOrCategoryError)\n\trequire.Equal(t, []string{fieldLowerSnakeCaseRuleID}, duplicateRuleOrCategoryError.duplicateIDs())\n}\n\nfunc TestMultiClientCannotHaveOverlappingRulesWithBuiltIn(t *testing.T) {\n\tt.Parallel()\n\n\tclient, err := newClient(\n\t\tslogtestext.NewLogger(t),\n\t\tClientWithRunnerProvider(NewLocalRunnerProvider(wasm.UnimplementedRuntime)),\n\t)\n\trequire.NoError(t, err)\n\tduplicateBuiltInRulePluginConfig, err := bufconfig.NewLocalPluginConfig(\n\t\t\"buf-plugin-duplicate-rule\",\n\t\tnil,\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\temptyOptions, err := option.NewOptions(nil)\n\trequire.NoError(t, err)\n\n\tmultiClient, err := client.getMultiClient(\n\t\tt.Context(),\n\t\tbufconfig.FileVersionV2,\n\t\t[]bufconfig.PluginConfig{\n\t\t\tduplicateBuiltInRulePluginConfig,\n\t\t},\n\t\tnil,\n\t\tfalse,\n\t\temptyOptions,\n\t)\n\trequire.NoError(t, err)\n\n\t_, _, err = multiClient.ListRulesAndCategories(t.Context())\n\tduplicateRuleOrCategoryError := &duplicateRuleOrCategoryError{}\n\trequire.ErrorAs(t, err, &duplicateRuleOrCategoryError)\n\trequire.Equal(t, []string{\"ENUM_NO_DELETE\", \"PACKAGE_DIRECTORY_MATCH\"}, duplicateRuleOrCategoryError.duplicateIDs())\n}\n\nfunc TestMultiClientCannotHaveOverlappingCategories(t *testing.T) {\n\tt.Parallel()\n\n\tclient1Spec := &check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\t{\n\t\t\t\tID:          timestampSuffixRuleID,\n\t\t\t\tDefault:     true,\n\t\t\t\tCategoryIDs: []string{\"FOO\"},\n\t\t\t\tPurpose:     `Checks that all google.protobuf.Timestamps end in a specific suffix (default is \"_time\").`,\n\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\tHandler:     checkutil.NewFieldRuleHandler(checkTimestampSuffix),\n\t\t\t},\n\t\t},\n\t\tCategories: []*check.CategorySpec{\n\t\t\t{\n\t\t\t\tID:      \"FOO\",\n\t\t\t\tPurpose: \"Checks foo.\",\n\t\t\t},\n\t\t},\n\t}\n\tclient2Spec := &check.Spec{\n\t\tRules: []*check.RuleSpec{\n\t\t\t{\n\t\t\t\tID:          fieldLowerSnakeCaseRuleID,\n\t\t\t\tDefault:     true,\n\t\t\t\tCategoryIDs: []string{\"FOO\"},\n\t\t\t\tPurpose:     \"Checks that all field names are lower_snake_case.\",\n\t\t\t\tType:        check.RuleTypeLint,\n\t\t\t\tHandler:     checkutil.NewFieldRuleHandler(checkFieldLowerSnakeCase),\n\t\t\t},\n\t\t},\n\t\tCategories: []*check.CategorySpec{\n\t\t\t{\n\t\t\t\tID:      \"FOO\",\n\t\t\t\tPurpose: \"Checks foo.\",\n\t\t\t},\n\t\t},\n\t}\n\n\tclient1, err := check.NewClientForSpec(client1Spec)\n\trequire.NoError(t, err)\n\tclient2, err := check.NewClientForSpec(client2Spec)\n\trequire.NoError(t, err)\n\temptyOptions, err := option.NewOptions(nil)\n\trequire.NoError(t, err)\n\tmultiClient := newMultiClient(\n\t\tslogtestext.NewLogger(t),\n\t\t[]*checkClientSpec{\n\t\t\tnewCheckClientSpec(\"buf-plugin-1\", \"\", client1, emptyOptions),\n\t\t\tnewCheckClientSpec(\"buf-plugin-2\", \"\", client2, emptyOptions),\n\t\t},\n\t)\n\n\t_, _, err = multiClient.ListRulesAndCategories(t.Context())\n\tduplicateRuleOrCategoryError := &duplicateRuleOrCategoryError{}\n\trequire.ErrorAs(t, err, &duplicateRuleOrCategoryError)\n\trequire.Equal(t, []string{\"FOO\"}, duplicateRuleOrCategoryError.duplicateIDs())\n}\n\nfunc TestMultiClientCannotHaveOverlappingCategoriesWithBuiltIn(t *testing.T) {\n\tt.Parallel()\n\n\tclient, err := newClient(\n\t\tslogtestext.NewLogger(t),\n\t\tClientWithRunnerProvider(NewLocalRunnerProvider(wasm.UnimplementedRuntime)),\n\t)\n\trequire.NoError(t, err)\n\tduplicateBuiltInRulePluginConfig, err := bufconfig.NewLocalPluginConfig(\n\t\t\"buf-plugin-duplicate-category\",\n\t\tnil,\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\temptyOptions, err := option.NewOptions(nil)\n\trequire.NoError(t, err)\n\n\tmultiClient, err := client.getMultiClient(\n\t\tt.Context(),\n\t\tbufconfig.FileVersionV2,\n\t\t[]bufconfig.PluginConfig{\n\t\t\tduplicateBuiltInRulePluginConfig,\n\t\t},\n\t\tnil,\n\t\tfalse,\n\t\temptyOptions,\n\t)\n\trequire.NoError(t, err)\n\n\t_, _, err = multiClient.ListRulesAndCategories(t.Context())\n\tduplicateRuleOrCategoryError := &duplicateRuleOrCategoryError{}\n\trequire.ErrorAs(t, err, &duplicateRuleOrCategoryError)\n\trequire.Equal(t, []string{\"STANDARD\"}, duplicateRuleOrCategoryError.duplicateIDs())\n}\n\nfunc checkFieldLowerSnakeCase(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\t_ check.Request,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n) error {\n\tfieldName := string(fieldDescriptor.Name())\n\tfieldNameToLowerSnakeCase := xstrings.ToLowerSnakeCase(fieldName)\n\tif fieldName != fieldNameToLowerSnakeCase {\n\t\tresponseWriter.AddAnnotation(\n\t\t\tcheck.WithMessagef(\"Field name %q should be lower_snake_case, such as %q.\", fieldName, fieldNameToLowerSnakeCase),\n\t\t\tcheck.WithDescriptor(fieldDescriptor),\n\t\t)\n\t}\n\treturn nil\n}\n\nfunc checkTimestampSuffix(\n\t_ context.Context,\n\tresponseWriter check.ResponseWriter,\n\trequest check.Request,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n) error {\n\ttimestampSuffix := defaultTimestampSuffix\n\ttimestampSuffixOptionValue, err := option.GetStringValue(request.Options(), timestampSuffixOptionKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif timestampSuffixOptionValue != \"\" {\n\t\ttimestampSuffix = timestampSuffixOptionValue\n\t}\n\n\tfieldDescriptorType := fieldDescriptor.Message()\n\tif fieldDescriptorType == nil {\n\t\treturn nil\n\t}\n\tif string(fieldDescriptorType.FullName()) != \"google.protobuf.Timestamp\" {\n\t\treturn nil\n\t}\n\tif !strings.HasSuffix(string(fieldDescriptor.Name()), timestampSuffix) {\n\t\tresponseWriter.AddAnnotation(\n\t\t\tcheck.WithMessagef(\"Fields of type google.protobuf.Timestamp must end in %q but field name was %q.\", timestampSuffix, string(fieldDescriptor.Name())),\n\t\t\tcheck.WithDescriptor(fieldDescriptor),\n\t\t)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/options_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/bufcheckopt\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n)\n\nconst lintCommentIgnorePrefix = \"buf:lint:ignore\"\n\ntype optionsConfig struct {\n\t// DefaultOptions are the options that should be passed to the default check.Client.\n\t//\n\t// Do not pass these to plugin check.Clients. Use options from checkClientSpecs instead.\n\t// Will never be nil.\n\tDefaultOptions         option.Options\n\tAllowCommentIgnores    bool\n\tIgnoreUnstablePackages bool\n\tCommentIgnorePrefix    string\n\tExcludeImports         bool\n}\n\nfunc optionsConfigForLintConfig(\n\tlintConfig bufconfig.LintConfig,\n) (*optionsConfig, error) {\n\treturn optionsConfigSpecForLintConfig(lintConfig).newOptionsConfig(\n\t\tcheck.RuleTypeLint,\n\t)\n}\n\nfunc optionsConfigForBreakingConfig(\n\tbreakingConfig bufconfig.BreakingConfig,\n\texcludeImports bool,\n) (*optionsConfig, error) {\n\treturn optionsConfigSpecForBreakingConfig(breakingConfig, excludeImports).newOptionsConfig(\n\t\tcheck.RuleTypeBreaking,\n\t)\n}\n\n// *** BELOW THIS LINE SHOULD ONLY BE USED BY THIS FILE ***\n\ntype optionsConfigSpec struct {\n\tAllowCommentIgnores                  bool\n\tIgnoreUnstablePackages               bool\n\tEnumZeroValueSuffix                  string\n\tRPCAllowSameRequestResponse          bool\n\tRPCAllowGoogleProtobufEmptyRequests  bool\n\tRPCAllowGoogleProtobufEmptyResponses bool\n\tServiceSuffix                        string\n\tCommentIgnorePrefix                  string\n\tExcludeImports                       bool\n}\n\nfunc optionsConfigSpecForLintConfig(lintConfig bufconfig.LintConfig) *optionsConfigSpec {\n\treturn &optionsConfigSpec{\n\t\tAllowCommentIgnores:                  lintConfig.AllowCommentIgnores(),\n\t\tIgnoreUnstablePackages:               false,\n\t\tEnumZeroValueSuffix:                  lintConfig.EnumZeroValueSuffix(),\n\t\tRPCAllowSameRequestResponse:          lintConfig.RPCAllowSameRequestResponse(),\n\t\tRPCAllowGoogleProtobufEmptyRequests:  lintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\tRPCAllowGoogleProtobufEmptyResponses: lintConfig.RPCAllowGoogleProtobufEmptyResponses(),\n\t\tServiceSuffix:                        lintConfig.ServiceSuffix(),\n\t\tCommentIgnorePrefix:                  lintCommentIgnorePrefix,\n\t\tExcludeImports:                       false,\n\t}\n}\n\nfunc optionsConfigSpecForBreakingConfig(\n\tbreakingConfig bufconfig.BreakingConfig,\n\texcludeImports bool,\n) *optionsConfigSpec {\n\treturn &optionsConfigSpec{\n\t\tAllowCommentIgnores:                  false,\n\t\tIgnoreUnstablePackages:               breakingConfig.IgnoreUnstablePackages(),\n\t\tEnumZeroValueSuffix:                  \"\",\n\t\tRPCAllowSameRequestResponse:          false,\n\t\tRPCAllowGoogleProtobufEmptyRequests:  false,\n\t\tRPCAllowGoogleProtobufEmptyResponses: false,\n\t\tServiceSuffix:                        \"\",\n\t\tCommentIgnorePrefix:                  \"\",\n\t\tExcludeImports:                       excludeImports,\n\t}\n}\n\nfunc (b *optionsConfigSpec) newOptionsConfig(ruleType check.RuleType) (*optionsConfig, error) {\n\toptionsSpec := &bufcheckopt.OptionsSpec{\n\t\tEnumZeroValueSuffix:                  b.EnumZeroValueSuffix,\n\t\tRPCAllowSameRequestResponse:          b.RPCAllowSameRequestResponse,\n\t\tRPCAllowGoogleProtobufEmptyRequests:  b.RPCAllowGoogleProtobufEmptyRequests,\n\t\tRPCAllowGoogleProtobufEmptyResponses: b.RPCAllowGoogleProtobufEmptyResponses,\n\t\tServiceSuffix:                        b.ServiceSuffix,\n\t}\n\tif b.CommentIgnorePrefix != \"\" {\n\t\toptionsSpec.CommentExcludes = []string{b.CommentIgnorePrefix}\n\t}\n\toptions, err := optionsSpec.ToOptions()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &optionsConfig{\n\t\tDefaultOptions:         options,\n\t\tAllowCommentIgnores:    b.AllowCommentIgnores,\n\t\tIgnoreUnstablePackages: b.IgnoreUnstablePackages,\n\t\tCommentIgnorePrefix:    b.CommentIgnorePrefix,\n\t\tExcludeImports:         b.ExcludeImports,\n\t}, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/policy_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyconfig\"\n)\n\n// policyToBufConfigLintConfig creates a new bufconfig.LintConfig from the source bufpolicy.Policy\n// applied through the buf.yaml file's policy configuration.\nfunc policyToBufConfigLintConfig(\n\tpolicy bufpolicy.Policy,\n\tbufYamlPolicyConfig bufconfig.PolicyConfig,\n) (bufconfig.LintConfig, error) {\n\tpolicyConfig, err := policy.Config()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyLintConfig := policyConfig.LintConfig()\n\tcheckConfig, err := bufconfig.NewEnabledCheckConfig(\n\t\tbufconfig.FileVersionV2,\n\t\tpolicyLintConfig.UseIDsAndCategories(),\n\t\tpolicyLintConfig.ExceptIDsAndCategories(),\n\t\tbufYamlPolicyConfig.IgnorePaths(),\n\t\tbufYamlPolicyConfig.IgnoreIDOrCategoryToPaths(),\n\t\tpolicyLintConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.NewLintConfig(\n\t\tcheckConfig,\n\t\tpolicyLintConfig.EnumZeroValueSuffix(),\n\t\tpolicyLintConfig.RPCAllowSameRequestResponse(),\n\t\tpolicyLintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\tpolicyLintConfig.RPCAllowGoogleProtobufEmptyResponses(),\n\t\tpolicyLintConfig.ServiceSuffix(),\n\t\tfalse, // We do not allow comment ignores in policy files.\n\t), nil\n}\n\n// policyToBufConfigBreakingConfig creates a new bufconfig.BreakingConfig from the source bufpolicy.Policy\n// applied through the buf.yaml file's policy configuration.\nfunc policyToBufConfigBreakingConfig(\n\tpolicy bufpolicy.Policy,\n\tbufYamlPolicyConfig bufconfig.PolicyConfig,\n) (bufconfig.BreakingConfig, error) {\n\tpolicyConfig, err := policy.Config()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyBreakingConfig := policyConfig.BreakingConfig()\n\tcheckConfig, err := bufconfig.NewEnabledCheckConfig(\n\t\tbufconfig.FileVersionV2,\n\t\tpolicyBreakingConfig.UseIDsAndCategories(),\n\t\tpolicyBreakingConfig.ExceptIDsAndCategories(),\n\t\tbufYamlPolicyConfig.IgnorePaths(),\n\t\tbufYamlPolicyConfig.IgnoreIDOrCategoryToPaths(),\n\t\tpolicyBreakingConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.NewBreakingConfig(\n\t\tcheckConfig,\n\t\tpolicyBreakingConfig.IgnoreUnstablePackages(),\n\t), nil\n}\n\n// policyToBufConfigPluginConfigs converts the given policy to a slice of bufconfig.PluginConfig.\nfunc policyToBufConfigPluginConfigs(\n\tpolicy bufpolicy.Policy,\n) ([]bufconfig.PluginConfig, error) {\n\tpolicyConfig, err := policy.Config()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginConfigs := policyConfig.PluginConfigs()\n\treturn bufpolicyconfig.PluginConfigsToBufConfig(pluginConfigs)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/print.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\t\"text/tabwriter\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\tidHeader         = \"ID\"\n\tcategoriesHeader = \"CATEGORIES\"\n\tdefaultHeader    = \"DEFAULT\"\n\tpurposeHeader    = \"PURPOSE\"\n\n\ttextHeader = idHeader + \"\\t\" + categoriesHeader + \"\\t\" + defaultHeader + \"\\t\" + purposeHeader\n)\n\n// topLevelCategoryIDToPriority is a map from builtin Category ID to the\n// order in which it should be printed by the ls-.*-rules commands.\n//\n// This has been a crude way to do ordering from early on.\n//\n// priority 1 should be printed before priority 2.\nvar topLevelCategoryIDToPriority = map[string]int{\n\t\"MINIMAL\":   1,\n\t\"BASIC\":     2,\n\t\"STANDARD\":  3,\n\t\"DEFAULT\":   4,\n\t\"COMMENTS\":  5,\n\t\"UNARY_RPC\": 6,\n\t\"OTHER\":     7,\n\t\"FILE\":      1,\n\t\"PACKAGE\":   2,\n\t\"WIRE_JSON\": 3,\n\t\"WIRE\":      4,\n}\n\nfunc printRules(writer io.Writer, rules []Rule, options ...PrintRulesOption) (retErr error) {\n\tprintRulesOptions := newPrintRulesOptions()\n\tfor _, option := range options {\n\t\toption(printRulesOptions)\n\t}\n\tif len(rules) == 0 {\n\t\treturn nil\n\t}\n\trules = cloneAndSortRulesForPrint(rules)\n\tcategoriesFunc := Rule.Categories\n\tif !printRulesOptions.includeDeprecated {\n\t\trules = xslices.Filter(rules, func(rule Rule) bool { return !rule.Deprecated() })\n\t\tcategoriesFunc = func(rule Rule) []check.Category {\n\t\t\treturn xslices.Filter(rule.Categories(), func(category check.Category) bool { return !category.Deprecated() })\n\t\t}\n\t}\n\tif printRulesOptions.asJSON {\n\t\treturn printRulesJSON(writer, rules, categoriesFunc)\n\t}\n\treturn printRulesText(writer, rules, categoriesFunc)\n}\n\n// Rules already sorted in correct order.\n// Rules already filtered for deprecated.\nfunc printRulesJSON(writer io.Writer, rules []Rule, categoriesFunc func(Rule) []check.Category) error {\n\tfor _, rule := range rules {\n\t\tdata, err := json.Marshal(newExternalRule(rule, categoriesFunc))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := fmt.Fprintln(writer, string(data)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// Rules already sorted in correct order.\n// Rules already filtered for deprecated.\nfunc printRulesText(writer io.Writer, rules []Rule, categoriesFunc func(Rule) []check.Category) (retErr error) {\n\ttype policyPluginKey struct {\n\t\tpluginName string\n\t\tpolicyName string\n\t}\n\tvar policyPluginKeys []policyPluginKey\n\tpolicyPluginKeyToRules := make(map[policyPluginKey][]Rule)\n\tfor _, rule := range rules {\n\t\tkey := policyPluginKey{\n\t\t\tpluginName: rule.PluginName(),\n\t\t\tpolicyName: rule.PolicyName(),\n\t\t}\n\t\tif _, ok := policyPluginKeyToRules[key]; !ok {\n\t\t\tpolicyPluginKeys = append(policyPluginKeys, key)\n\t\t}\n\t\tpolicyPluginKeyToRules[key] = append(policyPluginKeyToRules[key], rule)\n\t}\n\tsort.Slice(policyPluginKeys, func(i int, j int) bool {\n\t\tkeyOne, keyTwo := policyPluginKeys[i], policyPluginKeys[j]\n\t\tif keyOne.policyName == keyTwo.policyName {\n\t\t\treturn keyOne.pluginName < keyTwo.pluginName\n\t\t}\n\t\treturn keyOne.policyName < keyTwo.policyName\n\t})\n\tlongestRuleID := getLongestRuleID(rules)\n\tlongestRuleCategories := getLongestRuleCategories(rules, categoriesFunc)\n\n\ttabWriter := tabwriter.NewWriter(writer, 0, 0, 2, ' ', 0)\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, tabWriter.Flush())\n\t}()\n\twriter = tabWriter\n\tfor index, key := range policyPluginKeys {\n\t\trules := policyPluginKeyToRules[key]\n\t\thavePrintedSection := index > 0\n\t\tif havePrintedSection {\n\t\t\tif _, err := fmt.Fprintln(writer); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif len(rules) == 0 {\n\t\t\t// This should never happen.\n\t\t\treturn syserror.Newf(\"no rules for plugin name %q\", key.pluginName)\n\t\t}\n\t\tif err := printRulesTextSection(writer, rules, categoriesFunc, key.policyName, key.pluginName, havePrintedSection, longestRuleID, longestRuleCategories); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc printRulesTextSection(\n\twriter io.Writer,\n\trules []Rule,\n\tcategoriesFunc func(Rule) []check.Category,\n\tpolicyName string,\n\tpluginName string,\n\thavePrintedSection bool,\n\tgloballyLongestRuleID string,\n\tgloballyLongestRuleCategories string,\n) error {\n\tsubLongestRuleID := getLongestRuleID(rules)\n\tsubLongestRuleCategories := getLongestRuleCategories(rules, categoriesFunc)\n\tif policyName != \"\" || pluginName != \"\" {\n\t\tvar builder strings.Builder\n\t\tif policyName != \"\" {\n\t\t\t_, _ = builder.WriteString(policyName)\n\t\t\tif pluginName != \"\" {\n\t\t\t\t_, _ = builder.WriteString(\" \")\n\t\t\t}\n\t\t}\n\t\tif pluginName != \"\" {\n\t\t\t_, _ = builder.WriteString(pluginName)\n\t\t}\n\t\tif _, err := fmt.Fprintf(writer, \"%s\\n\\n\", builder.String()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif !havePrintedSection {\n\t\tif _, err := fmt.Fprintln(writer, textHeader); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor _, rule := range rules {\n\t\tvar defaultString string\n\t\tif rule.Default() {\n\t\t\tdefaultString = \"*\" + strings.Repeat(\" \", len(defaultHeader)-1)\n\t\t} else {\n\t\t\tdefaultString = strings.Repeat(\" \", len(defaultHeader))\n\t\t}\n\t\tid := rule.ID()\n\t\t// If our globally-longest ID is longer than any ID we have in this section, AND this current ID\n\t\t// is the longest, pad it with spaces so that all the sections have their columns aligned.\n\t\tif len(globallyLongestRuleID) > len(subLongestRuleID) && id == subLongestRuleID {\n\t\t\tid = id + strings.Repeat(\" \", len(globallyLongestRuleID)-len(subLongestRuleID))\n\t\t}\n\t\tcategories := getCategoriesString(categoriesFunc(rule))\n\t\tif len(globallyLongestRuleCategories) > len(subLongestRuleCategories) && categories == subLongestRuleCategories {\n\t\t\tcategories = categories + strings.Repeat(\" \", len(globallyLongestRuleCategories)-len(subLongestRuleCategories))\n\t\t}\n\t\t// Same logic for category strings.\n\t\tif _, err := fmt.Fprintf(writer, \"%s\\t%s\\t%s\\t%s\\n\", id, categories, defaultString, rule.Purpose()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc getLongestRuleID(rules []Rule) string {\n\treturn xslices.Reduce(\n\t\trules,\n\t\tfunc(accumulator string, rule Rule) string {\n\t\t\tid := rule.ID()\n\t\t\tif len(accumulator) > len(id) {\n\t\t\t\treturn accumulator\n\t\t\t}\n\t\t\treturn id\n\t\t},\n\t\t\"\",\n\t)\n}\n\nfunc getLongestRuleCategories(\n\trules []Rule,\n\tcategoriesFunc func(Rule) []check.Category,\n) string {\n\treturn xslices.Reduce(\n\t\trules,\n\t\tfunc(accumulator string, rule Rule) string {\n\t\t\tcategories := getCategoriesString(categoriesFunc(rule))\n\t\t\tif len(accumulator) > len(categories) {\n\t\t\t\treturn accumulator\n\t\t\t}\n\t\t\treturn categories\n\t\t},\n\t\t\"\",\n\t)\n}\n\nfunc getCategoriesString(categories []check.Category) string {\n\treturn strings.Join(xslices.Map(categories, check.Category.ID), \", \")\n}\n\n// cloneAndSortRulesForPrint sorts the rules just for printing.\n//\n// This has different sorting than the result of check.CompareRules.\nfunc cloneAndSortRulesForPrint(rules []Rule) []Rule {\n\trules = slices.Clone(rules)\n\t// Apply the default sorting to start.\n\tsort.Slice(rules, func(i int, j int) bool { return check.CompareRules(rules[i], rules[j]) < 0 })\n\t// Then, apply our own sorting.\n\tsort.SliceStable(\n\t\trules,\n\t\tfunc(i int, j int) bool {\n\t\t\t// categories are sorted at this point\n\t\t\t// so we know the first category is a top-level category if present\n\t\t\tone := rules[i]\n\t\t\ttwo := rules[j]\n\t\t\t// Sort non-policy rules before policy rules, then by policy name.\n\t\t\tonePolicyName := one.PolicyName()\n\t\t\ttwoPolicyName := two.PolicyName()\n\t\t\tif onePolicyName != twoPolicyName {\n\t\t\t\treturn onePolicyName < twoPolicyName\n\t\t\t}\n\t\t\t// Sort builtin rules before plugin rules, then plugin rules by plugin name.\n\t\t\tonePluginName := one.PluginName()\n\t\t\ttwoPluginName := two.PluginName()\n\t\t\tif onePluginName != twoPluginName {\n\t\t\t\treturn onePluginName < twoPluginName\n\t\t\t}\n\t\t\t// Sort default rules before non-default.\n\t\t\tif one.Default() && !two.Default() {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif !one.Default() && two.Default() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\toneCategories := one.Categories()\n\t\t\tsort.Slice(oneCategories, func(i int, j int) bool { return printCategoryIDLess(oneCategories[i].ID(), oneCategories[j].ID()) })\n\t\t\ttwoCategories := two.Categories()\n\t\t\tsort.Slice(twoCategories, func(i int, j int) bool { return printCategoryIDLess(twoCategories[i].ID(), twoCategories[j].ID()) })\n\t\t\tif len(oneCategories) == 0 && len(twoCategories) > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif len(oneCategories) > 0 && len(twoCategories) == 0 {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif len(oneCategories) > 0 && len(twoCategories) > 0 {\n\t\t\t\tcompare := printCategoryIDCompare(oneCategories[0].ID(), twoCategories[0].ID())\n\t\t\t\tif compare < 0 {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t\tif compare > 0 {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\toneCategoriesString := getCategoriesString(oneCategories)\n\t\t\ttwoCategoriesString := getCategoriesString(twoCategories)\n\t\t\tif oneCategoriesString < twoCategoriesString {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif oneCategoriesString > twoCategoriesString {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn one.ID() < two.ID()\n\t\t},\n\t)\n\treturn rules\n}\n\nfunc printCategoryIDLess(one string, two string) bool {\n\treturn printCategoryIDCompare(one, two) < 0\n}\n\nfunc printCategoryIDCompare(one string, two string) int {\n\tonePriority, oneIsTopLevel := topLevelCategoryIDToPriority[one]\n\ttwoPriority, twoIsTopLevel := topLevelCategoryIDToPriority[two]\n\tif oneIsTopLevel && !twoIsTopLevel {\n\t\treturn -1\n\t}\n\tif !oneIsTopLevel && twoIsTopLevel {\n\t\treturn 1\n\t}\n\tif oneIsTopLevel && twoIsTopLevel {\n\t\tif onePriority < twoPriority {\n\t\t\treturn -1\n\t\t}\n\t\tif onePriority > twoPriority {\n\t\t\treturn 1\n\t\t}\n\t}\n\tif one < two {\n\t\treturn -1\n\t}\n\tif one > two {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\ntype externalRule struct {\n\tID           string   `json:\"id\" yaml:\"id\"`\n\tCategories   []string `json:\"categories\" yaml:\"categories\"`\n\tDefault      bool     `json:\"default\" yaml:\"default\"`\n\tPurpose      string   `json:\"purpose\" yaml:\"purpose\"`\n\tPolicy       string   `json:\"policy,omitempty\" yaml:\"policy,omitempty\"`\n\tPlugin       string   `json:\"plugin\" yaml:\"plugin\"`\n\tDeprecated   bool     `json:\"deprecated\" yaml:\"deprecated\"`\n\tReplacements []string `json:\"replacements\" yaml:\"replacements\"`\n}\n\nfunc newExternalRule(\n\trule Rule,\n\tcategoriesFunc func(Rule) []check.Category,\n) *externalRule {\n\treturn &externalRule{\n\t\tID:           rule.ID(),\n\t\tCategories:   xslices.Map(categoriesFunc(rule), check.Category.ID),\n\t\tDefault:      rule.Default(),\n\t\tPurpose:      rule.Purpose(),\n\t\tPolicy:       rule.PolicyName(),\n\t\tPlugin:       rule.PluginName(),\n\t\tDeprecated:   rule.Deprecated(),\n\t\tReplacements: rule.ReplacementIDs(),\n\t}\n}\n\ntype printRulesOptions struct {\n\tasJSON            bool\n\tincludeDeprecated bool\n}\n\nfunc newPrintRulesOptions() *printRulesOptions {\n\treturn &printRulesOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/rule.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n)\n\nvar _ check.Rule = &rule{}\nvar _ Rule = &rule{}\nvar _ RuleOrCategory = &rule{}\n\ntype rule struct {\n\tcheck.Rule\n\n\tpluginName string\n\tpolicyName string\n}\n\nfunc newRule(checkRule check.Rule, pluginName string, policyName string) *rule {\n\treturn &rule{\n\t\tRule:       checkRule,\n\t\tpluginName: pluginName,\n\t\tpolicyName: policyName,\n\t}\n}\n\nfunc (r *rule) BufcheckCategories() []Category {\n\treturn xslices.Map(\n\t\tr.Rule.Categories(),\n\t\tfunc(checkCategory check.Category) Category {\n\t\t\treturn newCategory(checkCategory, r.pluginName, r.policyName)\n\t\t},\n\t)\n}\n\nfunc (r *rule) PluginName() string {\n\treturn r.pluginName\n}\nfunc (r *rule) PolicyName() string {\n\treturn r.policyName\n}\n\nfunc (*rule) isRule()           {}\nfunc (*rule) isRuleOrCategory() {}\n\n// Returns Rules in same order as in allRules.\nfunc rulesForType[R check.Rule](allRules []R, ruleType check.RuleType) []R {\n\treturn xslices.Filter(allRules, func(rule R) bool { return rule.Type() == ruleType })\n}\n\n// Returns Rules in same order as in allRules.\nfunc rulesForRuleIDs[R check.Rule](allRules []R, ruleIDs []string) []R {\n\trules := make([]R, 0, len(allRules))\n\truleIDMap := xslices.ToStructMap(ruleIDs)\n\tfor _, rule := range allRules {\n\t\tif _, ok := ruleIDMap[rule.ID()]; ok {\n\t\t\trules = append(rules, rule)\n\t\t}\n\t}\n\treturn rules\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/rules_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"fmt\"\n\t\"log/slog\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/bufplugin/check\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nfunc rulesConfigForCheckConfig(\n\tcheckConfig bufconfig.CheckConfig,\n\tallRules []Rule,\n\tallCategories []Category,\n\truleType check.RuleType,\n\trelatedCheckConfigs []bufconfig.CheckConfig,\n) (*rulesConfig, error) {\n\treturn newRulesConfig(\n\t\tcheckConfig.UseIDsAndCategories(),\n\t\tcheckConfig.ExceptIDsAndCategories(),\n\t\tcheckConfig.IgnorePaths(),\n\t\tcheckConfig.IgnoreIDOrCategoryToPaths(),\n\t\tallRules,\n\t\tallCategories,\n\t\truleType,\n\t\trelatedCheckConfigs,\n\t)\n}\n\nfunc logRulesConfig(logger *slog.Logger, configName string, rulesConfig *rulesConfig, hasPolicyConfigs bool) {\n\tlogger.Debug(\"rulesConfig\", slog.Any(\"ruleIDs\", rulesConfig.RuleIDs))\n\tif len(rulesConfig.RuleIDs) == 0 && !hasPolicyConfigs {\n\t\tlogger.Warn(\"No \" + rulesConfig.RuleType.String() + \" rules are configured in \" + configName + \".\")\n\t}\n\twarnReferencedDeprecatedIDs(logger, configName, rulesConfig)\n\twarnUnusedPlugins(logger, configName, rulesConfig)\n}\n\ntype rulesConfig struct {\n\t// RuleType is the RuleType that was passed when creating this rulesConfig.\n\t//\n\t// All of the Rule IDs will be for Rules of this type.\n\tRuleType check.RuleType\n\t// RuleIDs contains the specific RuleIDs to use.\n\t//\n\t// Will only contain non-deprecated RuleIDs.\n\t// This will only contain RuleIDs of the given RuleType.\n\t//\n\t// Will always be non-empty.\n\t//\n\t// If no specific RuleIDs were configured, this will return all default RuleIDs that were of\n\t// the specified RuleType.\n\tRuleIDs         []string\n\tIgnoreRootPaths map[string]struct{}\n\t// Will only contain non-deprecated RuleIDs.\n\t// This will only contain RuleIDs of the given RuleType.\n\tIgnoreRuleIDToRootPaths map[string]map[string]struct{}\n\t// ReferencedDeprecatedRuleIDToReplacementIDs contains a map from a Rule ID\n\t// that was used in the configuration, to a map of the IDs that\n\t// replace this Rule ID.\n\t//\n\t// This will only contain RuleIDs of the given RuleType.\n\t//\n\t// This can be used for warning messages.\n\tReferencedDeprecatedRuleIDToReplacementIDs map[string]map[string]struct{}\n\t// ReferencedDeprecatedCategoryIDToReplacementIDs contains a map from a Category ID\n\t// that was used in the configuration, to a map of the IDs that\n\t// replace this Category ID.\n\t//\n\t// This will only contain RuleIDs of the given RuleType.\n\t//\n\t// This can be used for warning messages.\n\tReferencedDeprecatedCategoryIDToReplacementIDs map[string]map[string]struct{}\n\t// UnusedPluginNameToRuleIDs contains a map from unused plugin name to the Rule IDs that\n\t// that plugin has.\n\t//\n\t// A plugin is unused if no rules from the plugin are configured.\n\t//\n\t// The caller can provide additional related check configs to check if the plugin has rules\n\t// configured. If the plugin has rules configured in any of the additional check configs\n\t// provided, then we don't warn.\n\t//\n\t// The Rule IDs will be sorted.\n\t// This will only contain RuleIDs of the given RuleType.\n\t// There will be no empty key for plugin name (which means the Rule is builtin), that is\n\t// builtin rules are not accounted for as unused.\n\t//\n\t// This can be used for warning messages.\n\tUnusedPluginNameToRuleIDs map[string][]string\n}\n\nfunc newRulesConfig(\n\t// May contain deprecated IDs.\n\tuseRuleIDsAndCategoryIDs []string,\n\t// May contain deprecated IDs.\n\texceptRuleIDsAndCategoryIDs []string,\n\tignoreRootPaths []string,\n\t// May contain deprecated IDs.\n\tignoreRuleIDOrCategoryIDToRootPaths map[string][]string,\n\t// Rules and Categories are guaranteed to be unique by ID at this point,\n\t// including across each other.\n\tallRules []Rule,\n\tallCategories []Category,\n\truleType check.RuleType,\n\trelatedCheckConfigs []bufconfig.CheckConfig,\n) (*rulesConfig, error) {\n\tallRulesForType := rulesForType(allRules, ruleType)\n\tif len(allRulesForType) == 0 {\n\t\t// This can happen with i.e. disable_builtin pretty easily.\n\t\t//\n\t\t// We return here so that we can do some syserror checking below for expectations\n\t\t// that certain variables are non-empty at certain points.\n\t\treturn &rulesConfig{\n\t\t\tRuleType:                ruleType,\n\t\t\tRuleIDs:                 make([]string, 0),\n\t\t\tIgnoreRootPaths:         make(map[string]struct{}),\n\t\t\tIgnoreRuleIDToRootPaths: make(map[string]map[string]struct{}),\n\t\t\tReferencedDeprecatedRuleIDToReplacementIDs:     make(map[string]map[string]struct{}),\n\t\t\tReferencedDeprecatedCategoryIDToReplacementIDs: make(map[string]map[string]struct{}),\n\t\t\tUnusedPluginNameToRuleIDs:                      make(map[string][]string),\n\t\t}, nil\n\t}\n\n\t// Transform to struct map values. We'll want to use this later\n\t// in the function instead of slices.\n\tignoreRuleIDOrCategoryIDToRootPathMap := make(\n\t\tmap[string]map[string]struct{},\n\t\tlen(ignoreRuleIDOrCategoryIDToRootPaths),\n\t)\n\tfor ruleIDOrCategoryID, rootPaths := range ignoreRuleIDOrCategoryIDToRootPaths {\n\t\tignoreRuleIDOrCategoryIDToRootPathMap[ruleIDOrCategoryID] = xslices.ToStructMap(rootPaths)\n\t}\n\n\truleIDToRule, err := getIDToRuleOrCategory(allRulesForType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Contains all rules, not referenced rules.\n\tdeprecatedRuleIDToReplacementRuleIDs, err := GetDeprecatedIDToReplacementIDs(allRulesForType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Contains all categories, not referenced categories.\n\tdeprecatedCategoryIDToReplacementCategoryIDs, err := GetDeprecatedIDToReplacementIDs(allCategories)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Gather all the referenced deprecated IDs into maps for the rulesConfig.\n\treferencedDeprecatedRuleIDToReplacementIDs := make(map[string]map[string]struct{})\n\treferencedDeprecatedCategoryIDToReplacementIDs := make(map[string]map[string]struct{})\n\tfor _, ids := range [][]string{\n\t\tuseRuleIDsAndCategoryIDs,\n\t\texceptRuleIDsAndCategoryIDs,\n\t\txslices.MapKeysToSlice(ignoreRuleIDOrCategoryIDToRootPathMap),\n\t} {\n\t\tfor _, id := range ids {\n\t\t\treplacementRuleIDs, ok := deprecatedRuleIDToReplacementRuleIDs[id]\n\t\t\tif ok {\n\t\t\t\treferencedIDMap, ok2 := referencedDeprecatedRuleIDToReplacementIDs[id]\n\t\t\t\tif !ok2 {\n\t\t\t\t\treferencedIDMap = make(map[string]struct{})\n\t\t\t\t\treferencedDeprecatedRuleIDToReplacementIDs[id] = referencedIDMap\n\t\t\t\t}\n\t\t\t\tfor _, replacementRuleID := range replacementRuleIDs {\n\t\t\t\t\treferencedIDMap[replacementRuleID] = struct{}{}\n\t\t\t\t}\n\t\t\t}\n\t\t\treplacementCategoryIDs, ok := deprecatedCategoryIDToReplacementCategoryIDs[id]\n\t\t\tif ok {\n\t\t\t\treferencedIDMap, ok2 := referencedDeprecatedCategoryIDToReplacementIDs[id]\n\t\t\t\tif !ok2 {\n\t\t\t\t\treferencedIDMap = make(map[string]struct{})\n\t\t\t\t\treferencedDeprecatedCategoryIDToReplacementIDs[id] = referencedIDMap\n\t\t\t\t}\n\t\t\t\tfor _, replacementCategoryID := range replacementCategoryIDs {\n\t\t\t\t\treferencedIDMap[replacementCategoryID] = struct{}{}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Sort and filter empty.\n\tuseRuleIDsAndCategoryIDs = xstrings.SliceToUniqueSortedSliceFilterEmptyStrings(useRuleIDsAndCategoryIDs)\n\tif len(useRuleIDsAndCategoryIDs) == 0 {\n\t\tuseRuleIDsAndCategoryIDs = xslices.Map(xslices.Filter(allRulesForType, func(rule Rule) bool { return rule.Default() }), Rule.ID)\n\t}\n\texceptRuleIDsAndCategoryIDs = xstrings.SliceToUniqueSortedSliceFilterEmptyStrings(exceptRuleIDsAndCategoryIDs)\n\tif len(useRuleIDsAndCategoryIDs) == 0 && len(exceptRuleIDsAndCategoryIDs) == 0 {\n\t\treturn nil, syserror.New(\"use and except should always be non-empty at this point\")\n\t}\n\n\t// Transform from rules/categories to rules.\n\truleIDToCategoryIDs, err := getRuleIDToCategoryIDs(allRulesForType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcategoryIDToRuleIDs := getCategoryIDToRuleIDs(ruleIDToCategoryIDs)\n\tuseRuleIDs, err := transformRuleOrCategoryIDsToRuleIDs(\n\t\tuseRuleIDsAndCategoryIDs,\n\t\truleIDToCategoryIDs,\n\t\tcategoryIDToRuleIDs,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texceptRuleIDs, err := transformRuleOrCategoryIDsToRuleIDs(\n\t\texceptRuleIDsAndCategoryIDs,\n\t\truleIDToCategoryIDs,\n\t\tcategoryIDToRuleIDs,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tignoreRuleIDToRootPathMap, err := transformRuleOrCategoryIDToIgnoreRootPathsToRuleIDs(\n\t\tignoreRuleIDOrCategoryIDToRootPathMap,\n\t\truleIDToCategoryIDs,\n\t\tcategoryIDToRuleIDs,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Replace deprecated rules.\n\tuseRuleIDs = transformRuleIDsToUndeprecated(\n\t\tuseRuleIDs,\n\t\tdeprecatedRuleIDToReplacementRuleIDs,\n\t)\n\texceptRuleIDs = transformRuleIDsToUndeprecated(\n\t\texceptRuleIDs,\n\t\tdeprecatedRuleIDToReplacementRuleIDs,\n\t)\n\tignoreRuleIDToRootPathMap = transformRuleIDToIgnoreRootPathsToUndeprecated(\n\t\tignoreRuleIDToRootPathMap,\n\t\tdeprecatedRuleIDToReplacementRuleIDs,\n\t)\n\n\t// Figure out result rules.\n\tresultRuleIDToRule := make(map[string]Rule)\n\tfor _, ruleID := range useRuleIDs {\n\t\trule, ok := ruleIDToRule[ruleID]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"%q is not a known rule ID after verification\", ruleID)\n\t\t}\n\t\tresultRuleIDToRule[rule.ID()] = rule\n\t}\n\tfor _, ruleID := range exceptRuleIDs {\n\t\tif _, ok := ruleIDToRule[ruleID]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"%q is not a known rule ID after verification\", ruleID)\n\t\t}\n\t\tdelete(resultRuleIDToRule, ruleID)\n\t}\n\tresultRules := xslices.MapValuesToSlice(resultRuleIDToRule)\n\tif len(resultRules) == 0 {\n\t\treturn nil, syserror.New(\"resultRules was empty\")\n\t}\n\tsort.Slice(\n\t\tresultRules,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn resultRules[i].ID() < resultRules[j].ID()\n\t\t},\n\t)\n\n\t// Normalize ignore paths.\n\tignoreRootPaths, err = normalizeIgnoreRootPaths(ignoreRootPaths)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tignoreRuleIDToRootPathMap, err = normalizeKeyToIgnoreRootPathMap(ignoreRuleIDToRootPathMap)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// This map initially contains a map from plugin name to ALL Rule IDs, but we will\n\t// then delete the used plugin names, and then delete the plugins with other rule types.\n\t//\n\t// Note this will only contain RuleIDs for the given RuleType.\n\tunusedPluginNameToRuleIDs := getPluginNameToRuleOrCategoryIDs(allRulesForType)\n\tfor _, rule := range resultRules {\n\t\t// If the rule is not from a builtin rule (i.e. PluginName() is not empty),\n\t\t// delete the plugin name from the map.\n\t\tif pluginName := rule.PluginName(); pluginName != \"\" {\n\t\t\tdelete(unusedPluginNameToRuleIDs, pluginName)\n\t\t}\n\t}\n\t// We check additional check configs. If rules are set in the related check configs, then\n\t// the plugin is not considered unused. We check against all rules for all rule types.\n\tallRuleIDToRule, err := getIDToRuleOrCategory(allRules)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tallRuleIDToCategoryIDs, err := getRuleIDToCategoryIDs(allRules)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tallCategoryIDToRuleIDs := getCategoryIDToRuleIDs(allRuleIDToCategoryIDs)\n\tfor _, checkConfig := range relatedCheckConfigs {\n\t\tcheckConfigUseRuleIDs, err := transformRuleOrCategoryIDsToRuleIDs(\n\t\t\tcheckConfig.UseIDsAndCategories(),\n\t\t\tallRuleIDToCategoryIDs,\n\t\t\tallCategoryIDToRuleIDs,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, checkConfigRuleID := range checkConfigUseRuleIDs {\n\t\t\t// If a rule from a non-builtin plugin is found, then we remove it from the unused plugins.\n\t\t\tif rule, ok := allRuleIDToRule[checkConfigRuleID]; rule.PluginName() != \"\" && ok {\n\t\t\t\tdelete(unusedPluginNameToRuleIDs, rule.PluginName())\n\t\t\t}\n\t\t}\n\t}\n\n\treturn &rulesConfig{\n\t\tRuleType:                ruleType,\n\t\tRuleIDs:                 xslices.Map(resultRules, Rule.ID),\n\t\tIgnoreRootPaths:         xslices.ToStructMap(ignoreRootPaths),\n\t\tIgnoreRuleIDToRootPaths: ignoreRuleIDToRootPathMap,\n\t\tReferencedDeprecatedRuleIDToReplacementIDs:     referencedDeprecatedRuleIDToReplacementIDs,\n\t\tReferencedDeprecatedCategoryIDToReplacementIDs: referencedDeprecatedCategoryIDToReplacementIDs,\n\t\tUnusedPluginNameToRuleIDs:                      unusedPluginNameToRuleIDs,\n\t}, nil\n}\n\n// *** JUST USED WITHIN THIS FILE ***\n\nfunc warnReferencedDeprecatedIDs(logger *slog.Logger, configName string, rulesConfig *rulesConfig) {\n\twarnReferencedDeprecatedIDsForIDType(\n\t\tlogger,\n\t\tconfigName,\n\t\trulesConfig.ReferencedDeprecatedRuleIDToReplacementIDs,\n\t\t\"Rule\",\n\t\t\"rules\",\n\t)\n\twarnReferencedDeprecatedIDsForIDType(\n\t\tlogger,\n\t\tconfigName,\n\t\trulesConfig.ReferencedDeprecatedCategoryIDToReplacementIDs,\n\t\t\"Category\",\n\t\t\"categories\",\n\t)\n}\n\nfunc warnUnusedPlugins(logger *slog.Logger, configName string, rulesConfig *rulesConfig) {\n\tif len(rulesConfig.UnusedPluginNameToRuleIDs) == 0 {\n\t\treturn\n\t}\n\tunusedPluginNames := xslices.MapKeysToSortedSlice(rulesConfig.UnusedPluginNameToRuleIDs)\n\tvar sb strings.Builder\n\t_, _ = sb.WriteString(\"Your \" + configName + \" has plugins added which have no rules configured:\\n\\n\")\n\tfor _, unusedPluginName := range unusedPluginNames {\n\t\t_, _ = sb.WriteString(\"\\t  - \")\n\t\t_, _ = sb.WriteString(unusedPluginName)\n\t\t_, _ = sb.WriteString(\" (available rules: \")\n\t\t_, _ = sb.WriteString(strings.Join(rulesConfig.UnusedPluginNameToRuleIDs[unusedPluginName], \",\"))\n\t\t_, _ = sb.WriteString(\")\\n\")\n\t}\n\t_, _ = sb.WriteString(\"\\n\\tThis is usually a configuration error. You must specify the rules or categories you want to use from this plugin.\\n\")\n\t_, _ = sb.WriteString(\"\\tFor example (selecting one rule from each plugin):\\n\\n\\t\")\n\t_, _ = sb.WriteString(rulesConfig.RuleType.String())\n\t_, _ = sb.WriteString(\"\\n\\t  use:\\n\")\n\tfor _, unusedPluginName := range unusedPluginNames {\n\t\t_, _ = sb.WriteString(\"\\t    - \")\n\t\t// We assume that all values have at least one element given how we constructed this.\n\t\t// We know that the rule IDs are sorted, so this is deterministic.\n\t\t_, _ = sb.WriteString(rulesConfig.UnusedPluginNameToRuleIDs[unusedPluginName][0])\n\t\t_, _ = sb.WriteString(\"\\n\")\n\t}\n\t_, _ = sb.WriteString(\"\\n\\tIf you do not want to use these plugins, we recommend removing them from your configuration.\")\n\tlogger.Warn(sb.String())\n}\n\nfunc warnReferencedDeprecatedIDsForIDType(\n\tlogger *slog.Logger,\n\tconfigName string,\n\treferencedDeprecatedIDToReplacementIDs map[string]map[string]struct{},\n\tcapitalizedIDType string,\n\tpluralIDType string,\n) {\n\tfor _, deprecatedID := range xslices.MapKeysToSortedSlice(referencedDeprecatedIDToReplacementIDs) {\n\t\treplacementIDs := xslices.MapKeysToSortedSlice(referencedDeprecatedIDToReplacementIDs[deprecatedID])\n\t\tvar replaceString string\n\t\tswitch len(replacementIDs) {\n\t\tcase 0:\n\t\tcase 1:\n\t\t\treplaceString = fmt.Sprintf(\" It has been replaced by %s %s.\", strings.ToLower(capitalizedIDType), replacementIDs[0])\n\t\tdefault:\n\t\t\treplaceString = fmt.Sprintf(\" It has been replaced by %s %s.\", pluralIDType, strings.Join(replacementIDs, \", \"))\n\t\t}\n\t\tvar specialCallout string\n\t\tif deprecatedID == \"DEFAULT\" {\n\t\t\tspecialCallout = fmt.Sprintf(`\n\n\tThe concept of a default rule has been introduced. A default rule is a rule that will be run\n\tif no rules are explicitly configured in your %s. Run buf config ls-lint-rules or\n\tbuf config ls-breaking-rules to see which rules are defaults. With this introduction, having a category\n\talso named DEFAULT is confusing, as while it happens that all the rules in the DEFAULT category\n\tare also default rules, the name has become overloaded.\n`, configName)\n\t\t}\n\t\tlogger.Warn(\n\t\t\tfmt.Sprintf(\n\t\t\t\t\"%s %s referenced in your %s is deprecated.%s%s\\n\\tAs with all buf changes, this change is backwards-compatible: %s will continue to work.\\n\\tWe recommend replacing %s in your %s, but no action is immediately necessary.\",\n\t\t\t\tcapitalizedIDType,\n\t\t\t\tdeprecatedID,\n\t\t\t\tconfigName,\n\t\t\t\treplaceString,\n\t\t\t\tspecialCallout,\n\t\t\t\tdeprecatedID,\n\t\t\t\tdeprecatedID,\n\t\t\t\tconfigName,\n\t\t\t),\n\t\t)\n\t}\n}\n\nfunc getIDToRuleOrCategory[R RuleOrCategory](ruleOrCategories []R) (map[string]R, error) {\n\tm := make(map[string]R)\n\tfor _, ruleOrCategory := range ruleOrCategories {\n\t\tif _, ok := m[ruleOrCategory.ID()]; ok {\n\t\t\treturn nil, syserror.Newf(\"duplicate rule or category ID: %q\", ruleOrCategory.ID())\n\t\t}\n\t\tm[ruleOrCategory.ID()] = ruleOrCategory\n\t}\n\treturn m, nil\n}\n\nfunc getPluginNameToRuleOrCategoryIDs[R RuleOrCategory](ruleOrCategories []R) map[string][]string {\n\tm := make(map[string][]string)\n\tfor _, ruleOrCategory := range ruleOrCategories {\n\t\tif pluginName := ruleOrCategory.PluginName(); pluginName != \"\" {\n\t\t\tm[pluginName] = append(m[pluginName], ruleOrCategory.ID())\n\t\t}\n\t}\n\tfor _, ruleOrCategoryIDs := range m {\n\t\tsort.Strings(ruleOrCategoryIDs)\n\t}\n\treturn m\n}\n\nfunc getRuleIDToCategoryIDs(rules []Rule) (map[string][]string, error) {\n\tm := make(map[string][]string)\n\tfor _, rule := range rules {\n\t\tif _, ok := m[rule.ID()]; ok {\n\t\t\treturn nil, syserror.Newf(\"duplicate rule ID: %q\", rule.ID())\n\t\t}\n\t\tm[rule.ID()] = xslices.Map(rule.Categories(), check.Category.ID)\n\t}\n\treturn m, nil\n}\n\nfunc getCategoryIDToRuleIDs(ruleIDToCategoryIDs map[string][]string) map[string][]string {\n\tcategoryIDToRuleIDs := make(map[string][]string)\n\tfor id, categoryIDs := range ruleIDToCategoryIDs {\n\t\tfor _, categoryID := range categoryIDs {\n\t\t\t// handles empty category as well\n\t\t\tcategoryIDToRuleIDs[categoryID] = append(categoryIDToRuleIDs[categoryID], id)\n\t\t}\n\t}\n\treturn categoryIDToRuleIDs\n}\n\nfunc transformRuleOrCategoryIDsToRuleIDs(\n\truleOrCategoryIDs []string,\n\truleIDToCategoryIDs map[string][]string,\n\tcategoryIDToRuleIDs map[string][]string,\n) ([]string, error) {\n\tif len(ruleOrCategoryIDs) == 0 {\n\t\treturn nil, nil\n\t}\n\truleIDMap := make(map[string]struct{}, len(ruleOrCategoryIDs))\n\tfor _, ruleOrCategoryID := range ruleOrCategoryIDs {\n\t\tif ruleOrCategoryID == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := ruleIDToCategoryIDs[ruleOrCategoryID]; ok {\n\t\t\truleIDMap[ruleOrCategoryID] = struct{}{}\n\t\t} else if ruleIDs, ok := categoryIDToRuleIDs[ruleOrCategoryID]; ok {\n\t\t\tfor _, ruleID := range ruleIDs {\n\t\t\t\truleIDMap[ruleID] = struct{}{}\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"%q is not a known rule or category ID\", ruleOrCategoryID)\n\t\t}\n\t}\n\treturn xslices.MapKeysToSortedSlice(ruleIDMap), nil\n}\n\nfunc transformRuleOrCategoryIDToIgnoreRootPathsToRuleIDs(\n\truleOrCategoryIDToIgnoreRootPaths map[string]map[string]struct{},\n\truleIDToCategoryIDs map[string][]string,\n\tcategoryIDToRuleIDs map[string][]string,\n) (map[string]map[string]struct{}, error) {\n\tif len(ruleOrCategoryIDToIgnoreRootPaths) == 0 {\n\t\treturn nil, nil\n\t}\n\truleIDToIgnoreRootPaths := make(\n\t\tmap[string]map[string]struct{},\n\t\tlen(ruleOrCategoryIDToIgnoreRootPaths),\n\t)\n\taddRootPaths := func(ruleID string, rootPaths map[string]struct{}) {\n\t\tignoreRootPathMap, ok := ruleIDToIgnoreRootPaths[ruleID]\n\t\tif !ok {\n\t\t\tignoreRootPathMap = make(map[string]struct{})\n\t\t\truleIDToIgnoreRootPaths[ruleID] = ignoreRootPathMap\n\t\t}\n\t\tfor rootPath := range rootPaths {\n\t\t\tignoreRootPathMap[rootPath] = struct{}{}\n\t\t}\n\t}\n\tfor ruleOrCategoryID, rootPaths := range ruleOrCategoryIDToIgnoreRootPaths {\n\t\tif ruleOrCategoryID == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := ruleIDToCategoryIDs[ruleOrCategoryID]; ok {\n\t\t\taddRootPaths(ruleOrCategoryID, rootPaths)\n\t\t} else if ruleIDs, ok := categoryIDToRuleIDs[ruleOrCategoryID]; ok {\n\t\t\tfor _, ruleID := range ruleIDs {\n\t\t\t\taddRootPaths(ruleID, rootPaths)\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"%q is not a known rule or category ID\", ruleOrCategoryID)\n\t\t}\n\t}\n\treturn ruleIDToIgnoreRootPaths, nil\n}\n\nfunc transformRuleIDsToUndeprecated(\n\truleIDs []string,\n\tdeprecatedRuleIDToReplacementIDs map[string][]string,\n) []string {\n\tundeprecatedRuleIDMap := make(map[string]struct{}, len(ruleIDs))\n\tfor _, ruleID := range ruleIDs {\n\t\treplacementIDs, ok := deprecatedRuleIDToReplacementIDs[ruleID]\n\t\tif ok {\n\t\t\t// May iterate over empty.\n\t\t\tfor _, replacementID := range replacementIDs {\n\t\t\t\tundeprecatedRuleIDMap[replacementID] = struct{}{}\n\t\t\t}\n\t\t} else {\n\t\t\tundeprecatedRuleIDMap[ruleID] = struct{}{}\n\t\t}\n\t}\n\treturn xslices.MapKeysToSortedSlice(undeprecatedRuleIDMap)\n}\n\nfunc transformRuleIDToIgnoreRootPathsToUndeprecated(\n\truleIDToIgnoreRootPaths map[string]map[string]struct{},\n\tdeprecatedRuleIDToReplacementIDs map[string][]string,\n) map[string]map[string]struct{} {\n\tundeprecatedRuleIDToIgnoreRootPaths := make(\n\t\tmap[string]map[string]struct{},\n\t\tlen(ruleIDToIgnoreRootPaths),\n\t)\n\taddRootPaths := func(ruleID string, rootPaths map[string]struct{}) {\n\t\tignoreRootPathMap, ok := undeprecatedRuleIDToIgnoreRootPaths[ruleID]\n\t\tif !ok {\n\t\t\tignoreRootPathMap = make(map[string]struct{})\n\t\t\tundeprecatedRuleIDToIgnoreRootPaths[ruleID] = ignoreRootPathMap\n\t\t}\n\t\tfor rootPath := range rootPaths {\n\t\t\tignoreRootPathMap[rootPath] = struct{}{}\n\t\t}\n\t}\n\tfor ruleID, rootPaths := range ruleIDToIgnoreRootPaths {\n\t\treplacementIDs, ok := deprecatedRuleIDToReplacementIDs[ruleID]\n\t\tif ok {\n\t\t\t// May iterate over empty.\n\t\t\tfor _, replacementID := range replacementIDs {\n\t\t\t\taddRootPaths(replacementID, rootPaths)\n\t\t\t}\n\t\t} else {\n\t\t\taddRootPaths(ruleID, rootPaths)\n\t\t}\n\t}\n\treturn undeprecatedRuleIDToIgnoreRootPaths\n}\n\nfunc normalizeIgnoreRootPaths(rootPaths []string) ([]string, error) {\n\trootPathMap := make(map[string]struct{}, len(rootPaths))\n\tfor _, rootPath := range rootPaths {\n\t\tif rootPath == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\trootPath, err := normalpath.NormalizeAndValidate(rootPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif rootPath == \".\" {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify %q as an ignore path\", rootPath)\n\t\t}\n\t\trootPathMap[rootPath] = struct{}{}\n\t}\n\treturn xslices.MapKeysToSortedSlice(rootPathMap), nil\n}\n\nfunc normalizeKeyToIgnoreRootPathMap[K comparable](\n\tkeyToRootPaths map[K]map[string]struct{},\n) (map[K]map[string]struct{}, error) {\n\tkeyToNormalizedRootPathMap := make(map[K]map[string]struct{}, len(keyToRootPaths))\n\tfor key, rootPathMap := range keyToRootPaths {\n\t\trootPaths, err := normalizeIgnoreRootPaths(xslices.MapKeysToSortedSlice(rootPathMap))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tkeyToNormalizedRootPathMap[key] = xslices.ToStructMap(rootPaths)\n\t}\n\treturn keyToNormalizedRootPathMap, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/runner_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/pluginrpcutil\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\ntype localRunnerProvider struct {\n\twasmRuntime wasm.Runtime\n}\n\nfunc newLocalRunnerProvider(\n\twasmRuntime wasm.Runtime,\n) *localRunnerProvider {\n\treturn &localRunnerProvider{\n\t\twasmRuntime: wasmRuntime,\n\t}\n}\n\nfunc (r *localRunnerProvider) NewRunner(plugin bufplugin.Plugin) (pluginrpc.Runner, error) {\n\tswitch isLocal, isWasm := plugin.IsLocal(), plugin.IsWasm(); {\n\tcase isLocal && !isWasm:\n\t\treturn pluginrpcutil.NewLocalRunner(\n\t\t\tplugin.Name(),\n\t\t\tplugin.Args()...,\n\t\t), nil\n\tcase isWasm:\n\t\treturn pluginrpcutil.NewWasmRunner(\n\t\t\tr.wasmRuntime,\n\t\t\tplugin.Data,\n\t\t\tplugin.Name(),\n\t\t\tplugin.Args()...,\n\t\t), nil\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unsupported Plugin runtime: %v\", plugin.OpaqueID())\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_custom_plugins/a.proto",
    "content": "syntax = \"proto3\";\n\nservice ALegacy {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n  string page_token = 2;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n  string page_token = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_custom_plugins/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice B {\n  rpc GetB(GetBRequest) returns (GetBResponse);\n}\n\nmessage GetBRequest {}\nmessage GetBResponse {\n  enum BStatus {\n    B_STATUS_UNSPECIFIED = 0;\n    B_STATUS_VALID = 1;\n  }\n  message ValueStable {\n    string name = 1;\n    BStatus status = 2;\n    string a_uuid = 3;\n  }\n  ValueStable value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_custom_plugins/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - ENUM_NO_DELETE\n    - SERVICE_SUFFIXES_NO_CHANGE\n    - MESSAGE_SUFFIXES_NO_CHANGE\n    - ENUM_SUFFIXES_NO_CHANGE\nplugins:\n  - plugin: buf-plugin-suffix\n    options:\n      service_no_change_suffixes:\n        - Legacy\n        - Bridge\n      message_no_change_suffixes:\n        - Stable\n      enum_no_change_suffixes:\n        - Status\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_json_format/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nenum A1 {\n  A1_ZERO = 0;\n}\n\nenum B1 {\n  B1_ZERO = 0;\n}\n\nenum C1 {\n  C1_ZERO = 0;\n}\n\nenum D1 {\n  D1_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_json_format/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum A2 {\n  A2_ZERO = 0;\n}\n\nenum B2 {\n  B2_ZERO = 0;\n}\n\nenum C2 {\n  C2_ZERO = 0;\n}\n\nenum D2 {\n  D2_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_json_format/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nenum A3 {\n  A3_ZERO = 0;\n}\n\nenum B3 {\n  B3_ZERO = 0;\n}\n\nenum C3 {\n  C3_ZERO = 0;\n}\n\nenum D3 {\n  D3_ZERO = 0;\n}\n\nenum D5 {\n  D5_ZERO = 0;\n}\n\nenum D6 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  D6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_json_format/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.json_format = LEGACY_BEST_EFFORT;\n\nenum A4 {\n  A4_ZERO = 0;\n}\n\nenum B4 {\n  B4_ZERO = 0;\n}\n\nenum C4 {\n  C4_ZERO = 0;\n}\n\nenum D4 {\n  option features.json_format = ALLOW;\n  D4_ZERO = 0;\n}\n\nenum C5 {\n  C5_ZERO = 0;\n}\n\nenum C6 {\n  option features.json_format = ALLOW;\n  C6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_json_format/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_SAME_JSON_FORMAT\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_type/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nenum A1 {\n  A1_ZERO = 0;\n}\n\nenum B1 {\n  B1_ZERO = 0;\n}\n\nenum C1 {\n  C1_ZERO = 0;\n}\n\nenum D1 {\n  D1_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_type/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum A2 {\n  A2_ZERO = 0;\n}\n\nenum B2 {\n  B2_ZERO = 0;\n}\n\nenum C2 {\n  C2_ZERO = 0;\n}\n\nenum D2 {\n  D2_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nenum A3 {\n  A3_ZERO = 0;\n}\n\nenum B3 {\n  B3_ZERO = 0;\n}\n\nenum C3 {\n  C3_ZERO = 0;\n}\n\nenum D3 {\n  D3_ZERO = 0;\n}\n\nenum D5 {\n  D5_ZERO = 0;\n}\n\nenum D6 {\n  option features.enum_type = CLOSED;\n  D6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_type/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.enum_type = CLOSED;\n\nenum A4 {\n  A4_ZERO = 0;\n}\n\nenum B4 {\n  B4_ZERO = 0;\n}\n\nenum C4 {\n  C4_ZERO = 0;\n}\n\nenum D4 {\n  option features.enum_type = OPEN;\n  D4_ZERO = 0;\n}\n\nenum C5 {\n  C5_ZERO = 0;\n}\n\nenum C6 {\n  option features.enum_type = OPEN;\n  C6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_same_type/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_SAME_TYPE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  ELEVEN_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_TWO = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_VALUE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete_unless_name_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Two {\n  reserved \"TWO_TWO\";\n\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      reserved \"FIVE_TWO\";\n\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    reserved \"SEVEN_TWO\";\n\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  ELEVEN_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete_unless_name_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  reserved \"NINE_TWO\";\n\n  NINE_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete_unless_name_reserved/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete_unless_number_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Two {\n  reserved 2 to 6;\n\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      reserved 2 to 6;\n\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    reserved 2 to 6;\n\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  ELEVEN_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete_unless_number_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  reserved 2 to 6;\n\n  NINE_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_no_delete_unless_number_reserved/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_same_name/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n  TWO_THREE = 2;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_THREE = 2;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_THREE = 2;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  option allow_alias = true;\n  ELEVEN_UNSPECIFIED = 0;\n  ELEVEN_ONE = 1;\n  ELEVEN_THREE = 1;\n}\n\nenum Twelve {\n  option allow_alias = true;\n  TWELVE_UNSPECIFIED = 0;\n  TWELVE_ONE = 1;\n  TWELVE_TWO = 1;\n  TWELVE_THREE = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_same_name/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_THREE = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_enum_value_same_name/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_VALUE_SAME_NAME\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_message_no_delete/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Two {\n  extensions 100 to 200;\n  extensions 300;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      extensions 100 to 200;\n      extensions 300;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n    message Six {\n      extensions 4 to 5, 100 to 200;\n      extensions 300, 301, 1000 to max;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n  }\n  message Seven {\n    extensions 100 to 200;\n    extensions 300;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  message Eight {\n    extensions 4 to 5, 100 to 200;\n    extensions 300, 301, 1000 to max;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Ten {\n  extensions 1 to 1000;\n  extensions 2000 to 5000, 10000 to 50000;\n  extensions 100000 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_message_no_delete/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  extensions 8 to 25;\n  extensions 50, 51, 52, 53 to 60, 61 to 65, 66, 67, 68 to 70, 71 to 75;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage One2 {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Two2 {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      extensions 4 to 5, 100 to 200;\n      extensions 300, 301, 1000 to max;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n    message Six2 {\n      extensions 4 to 5, 100 to 200;\n      extensions 300, 301, 1000 to max;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n  }\n  message Seven2 {\n    extensions 4 to 5, 100 to 200;\n    extensions 300, 301, 1000 to max;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  message Eight2 {\n    extensions 4 to 5, 100 to 200;\n    extensions 300, 301, 1000 to max;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Nine2 {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Nine {\n  extensions 100 to 200;\n  extensions 300;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_message_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - EXTENSION_MESSAGE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_no_delete/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"3.proto\";\nimport \"4.proto\";\n\nmessage One {\n  optional int32 one = 1;\n  optional int32 two = 2;\n}\n\nmessage Nine {\n  optional int32 one = 1;\n  optional int32 three = 3;\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  optional Foo ch = 22;\n}\n\nextend b.Fizz {\n  optional b.Fizz child = 22;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_no_delete/3.proto",
    "content": "syntax = \"proto2\";\n\npackage b;\n\nmessage Fizz {\n  extensions 10 to 100;\n\n  message Buzz {\n    optional int32 len = 1;\n\n    extend Fizz {\n      optional string str = 10;\n    }\n  }\n}\n\nextend Fizz {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_no_delete/4.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_extension_no_delete/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - EXTENSION_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 changed_name = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage One2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n  message Bar {\n    optional int32 len = 1;\n    extend Foo {\n      optional string str = 10;\n    }\n  }\n}\n\nextend Foo {\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_name_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  reserved \"three\";\n\n  int32 one = 1;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      reserved \"three\";\n\n      int32 one = 1;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    reserved \"three\";\n\n    int32 one = 1;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 changed_name = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_name_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage One2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  reserved \"three\";\n\n  int32 one = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_name_reserved/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n  message Bar {\n    optional int32 len = 1;\n    extend Foo {\n      optional string str = 10;\n    }\n  }\n}\n\nextend Foo {\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_name_reserved/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_NO_DELETE_UNLESS_NAME_RESERVED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_number_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  reserved 3 ;\n\n  int32 one = 1;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      reserved 3 ;\n\n      int32 one = 1;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    reserved 3 ;\n\n    int32 one = 1;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 changed_name = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n}\n\nmessage Ten {\n  reserved 2 to 3;\n  reserved 5 to max;\n  int32 one = 1;\n  int32 four = 4;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_number_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage One2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  reserved 3 ;\n\n  int32 one = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_number_reserved/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n  message Bar {\n    optional int32 len = 1;\n    extend Foo {\n      optional string str = 10;\n    }\n  }\n}\n\nextend Foo {\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_no_delete_unless_number_reserved/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cardinality/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"2.proto\";\n\nmessage Two {\n  repeated int64 one = 1;\n  repeated Two two = 2;\n  int64 three = 3;\n  Two four = 4;\n  int32 five = 5;\n  int32 six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      repeated int64 one = 1;\n      repeated Two two = 2;\n      int64 three = 3;\n      Two four = 4;\n      int32 five = 5;\n      int32 six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      repeated SixEntry six = 6;\n      message SixEntry {\n        int32 key = 1;\n        One value = 2;\n      }\n    }\n  }\n  message Seven {\n    repeated int64 one = 1;\n    repeated Two two = 2;\n    int64 three = 3;\n    Two four = 4;\n    int32 five = 5;\n    int32 six = 6;\n  }\n  message Eight {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n    optional int32 seven = 7;\n    Eight eight = 8;\n    optional Eight nine = 9;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cardinality/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage One2 {\n  required int32 one = 1;\n  required One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int64 one = 1;\n    Nine two = 2;\n  }\n}\n\nmessage Ten {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cardinality/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  int64 two = 2 [features.field_presence = LEGACY_REQUIRED];\n}\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    int32 len = 1;\n\n    extend Foo {\n      repeated string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  bytes meta = 20;\n  uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cardinality/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_CARDINALITY\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cpp_string_type/1.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"google/protobuf/cpp_features.proto\";\n\nmessage Foo {\n  string string1 = 1 [ctype=STRING_PIECE];\n  bytes string2 = 2 [ctype=CORD];\n  repeated string string3 = 3;\n  repeated bytes string4 = 4 [features.(pb.cpp).string_type=STRING];\n  string string5 = 5 [features.(pb.cpp).string_type=VIEW];\n  bytes string6 = 6 [features.(pb.cpp).string_type=CORD];\n\n  string cord1 = 11 [ctype=STRING];\n  bytes cord2 = 12 [ctype=STRING_PIECE];\n  repeated string cord3 = 13;\n  repeated bytes cord4 = 14 [features.(pb.cpp).string_type=STRING];\n  string cord5 = 15 [features.(pb.cpp).string_type=VIEW];\n  bytes cord6 = 16 [features.(pb.cpp).string_type=CORD];\n\n  string string_piece1 = 21 [ctype=STRING];\n  bytes string_piece2 = 22 [ctype=CORD];\n  repeated string string_piece3 = 23;\n  repeated bytes string_piece4 = 24 [features.(pb.cpp).string_type=STRING];\n  string string_piece5 = 25 [features.(pb.cpp).string_type=VIEW];\n  bytes string_piece6 = 26 [features.(pb.cpp).string_type=CORD];\n\n  string default1 = 31  [ctype=STRING];\n  bytes default2 = 32  [ctype=CORD];\n  repeated string default3 = 33 [ctype=STRING_PIECE];\n  repeated bytes default4 = 34 [features.(pb.cpp).string_type=STRING];\n  string default5 = 35 [features.(pb.cpp).string_type=VIEW];\n  bytes default6 = 36 [features.(pb.cpp).string_type=CORD];\n  repeated string default7 = 37;\n\n  Foo message1 = 40;\n  bool bool1 = 41;\n  repeated uint32 uint32s1= 42;\n  map<string,string> map1 = 43;\n  Foo message2 = 44;\n  bool bool2 = 45;\n  repeated uint32 uint32s2 = 46;\n  map<string,string> map2 = 47;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cpp_string_type/2.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"google/protobuf/cpp_features.proto\";\n\nmessage Bar {\n  string string1 = 1 [features.(pb.cpp).string_type=VIEW];\n  bytes string2 = 2 [features.(pb.cpp).string_type=CORD];\n  repeated string string3 = 3;\n  repeated bytes string4 = 4 [ctype=STRING];\n  string string5 = 5 [ctype=CORD];\n  bytes string6 = 6 [ctype=STRING_PIECE];\n\n  string cord1 = 11 [features.(pb.cpp).string_type=STRING];\n  bytes cord2 = 12 [features.(pb.cpp).string_type=VIEW];\n  repeated string cord3 = 13;\n  repeated bytes cord4 = 14 [ctype=STRING];\n  string cord5 = 15 [ctype=CORD];\n  bytes cord6 = 16 [ctype=STRING_PIECE];\n\n  string view1 = 21 [features.(pb.cpp).string_type=STRING];\n  bytes view2 = 22 [features.(pb.cpp).string_type=CORD];\n  repeated string view3 = 23;\n  repeated bytes view4 = 24 [ctype=STRING];\n  string view5 = 25 [ctype=CORD];\n  bytes view6 = 26 [ctype=STRING_PIECE];\n\n  string default1 = 31 [ctype=STRING];\n  bytes default2 = 32 [ctype=CORD];\n  repeated string default3 = 33 [ctype=STRING_PIECE];\n  repeated bytes default4 = 34 [features.(pb.cpp).string_type=STRING];\n  string default5 = 35 [features.(pb.cpp).string_type=VIEW];\n  bytes default6 = 36 [features.(pb.cpp).string_type=CORD];\n  repeated string default7 = 37;\n\n  extensions 100 to 300;\n\n  message Frobnitz {\n    extend Bar {\n      repeated string ext_str1 = 100;\n      string ext_str2 = 101;\n      repeated bytes ext_byt1 = 102;\n      bytes ext_byt2 = 103 [features.(pb.cpp).string_type=VIEW];\n    }\n  }\n}\n\nextend Bar {\n  repeated string ext_str1 = 200;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cpp_string_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"2.proto\";\nimport \"google/protobuf/cpp_features.proto\";\n\noption features.(pb.cpp).string_type=CORD;\n\nmessage Baz {\n  string default1 = 1 [ctype=STRING];\n  bytes default2 = 2 [ctype=CORD];\n  repeated string default3 = 3 [ctype=STRING_PIECE];\n  repeated bytes default4 = 4 [features.(pb.cpp).string_type=STRING];\n  string default5 = 5 [features.(pb.cpp).string_type=VIEW];\n  bytes default6 = 6 [features.(pb.cpp).string_type=CORD];\n  repeated string default7 = 7;\n\n  map<string, Baz> map1 = 11;\n  map<uint32, string> map2 = 12;\n  map<int64, bytes> map3 = 13;\n\n  extensions 100 to 200;\n\n  message Fizzbuzz {\n    extend Baz {\n      repeated string ext_str1 = 100 [features.(pb.cpp).string_type=CORD];\n      string ext_str2 = 101;\n      repeated bytes ext_byt1 = 102 [features.(pb.cpp).string_type=VIEW];\n      bytes ext_byt2 = 103 [ctype=STRING];\n    }\n  }\n}\n\nextend Baz {\n  repeated string ext_str = 200;\n}\n\nextend Bar {\n  repeated string ext_str2 = 201;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cpp_string_type/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_CPP_STRING_TYPE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_cpp_string_type/google/protobuf/cpp_features.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2023 Google Inc.  All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file or at\n// https://developers.google.com/open-source/licenses/bsd\n\nsyntax = \"proto2\";\n\n// TODO: Remove this file once datawkt is updated to use v27.0.\n// Note that this is not identical to the protoc version so\n// that we don't also have to provide a separate copy of\n// descriptor.proto. (The actual v27 version of the file\n// includes additional options that only work with v27+ of\n// descriptor.proto.)\npackage pb;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FeatureSet {\n  optional CppFeatures cpp = 1000;\n}\n\nmessage CppFeatures {\n  // Whether or not to treat an enum field as closed.  This option is only\n  // applicable to enum fields, and will be removed in the future.  It is\n  // consistent with the legacy behavior of using proto3 enum types for proto2\n  // fields.\n  optional bool legacy_closed_enum = 1 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    edition_defaults = { edition: EDITION_PROTO2, value: \"true\" },\n    edition_defaults = { edition: EDITION_PROTO3, value: \"false\" }\n  ];\n\n  enum StringType {\n    STRING_TYPE_UNKNOWN = 0;\n    VIEW = 1;\n    CORD = 2;\n    STRING = 3;\n  }\n\n  optional StringType string_type = 2 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    edition_defaults = { edition: EDITION_PROTO2, value: \"STRING\" },\n    edition_defaults = { edition: EDITION_2024, value: \"VIEW\" }\n  ];\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_ctype/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  string one = 1 [ctype = STRING_PIECE];\n  string two = 2;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      string one = 1 [ctype = STRING_PIECE];\n      string two = 2;\n    }\n    message Six {\n      string one = 1;\n      string two = 2;\n    }\n  }\n  message Seven {\n    string one = 1 [ctype = STRING];\n    string two = 2 [ctype = CORD];\n  }\n  message Eight {\n    string one = 1;\n    string two = 2;\n  }\n  string one = 1;\n  string two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_ctype/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional string one = 1;\n  optional string two = 2 [ctype = CORD];\n}\n\nmessage One2 {\n  optional string one = 1 [ctype = STRING_PIECE];\n  required string two = 2 [ctype = CORD];\n}\n\nmessage Two2 {\n  optional string one = 1 [ctype = STRING_PIECE];\n  required string two = 2 [ctype = CORD];\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional string one = 1 [ctype = STRING_PIECE];\n      required string two = 2 [ctype = CORD];\n    }\n    message Six2 {\n      optional string one = 1;\n      required string two = 2;\n    }\n  }\n  message Seven2 {\n    optional string one = 1;\n    required string two = 2;\n  }\n  message Eight2 {\n    optional string one = 1;\n    required string two = 2;\n  }\n  optional string one = 1;\n  required string two = 2;\n}\n\nmessage Nine2 {\n  optional string one = 1 [ctype = STRING_PIECE];\n  required string two = 2 [ctype = CORD];\n}\n\nmessage Nine {\n  optional string one = 1 [ctype = STRING_PIECE];\n  optional string two = 2 [ctype = STRING];\n}\n\nmessage Ten2 {\n  extensions 1 to 100;\n}\n\nextend Ten2 {\n  optional string ten_one = 1 [ctype = CORD];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_ctype/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_CTYPE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_default/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  optional string s1 = 1 [default = \"abc\"];\n  optional string s2 = 2;\n  optional bytes s3 = 3 [default = \"abc\"];\n  optional string s4 = 4 [default = \"xyz\"];\n\n  optional bytes b1 = 5 [default = \"xyz\"];\n  optional bytes b2 = 6;\n  optional string b3 = 7 [default = \"xyz\"];\n  optional bytes b4 = 8 [default = \"abc\"];\n\n  message Int32s {\n    optional int32 i1 = 1 [default = 123];\n    optional int32 i2 = 2;\n    optional double i3 = 3 [default = 123];\n    optional int32 i4 = 4 [default = 456];\n  }\n\n  message Uint32s {\n    optional uint32 i1 = 1 [default = 123];\n    optional uint32 i2 = 2;\n    optional sint64 i3 = 3 [default = 123];\n    optional uint32 i4 = 4 [default = 456];\n  }\n\n  message Sint32s {\n    optional sint32 i1 = 1 [default = 123];\n    optional sint32 i2 = 2;\n    optional float i3 = 3 [default = 123];\n    optional sint32 i4 = 4 [default = 456];\n  }\n\n  message Fixed32s {\n    optional fixed32 i1 = 1 [default = 123];\n    optional fixed32 i2 = 2;\n    optional sfixed64 i3 = 3 [default = 123];\n    optional fixed32 i4 = 4 [default = 456];\n  }\n\n  message Sfixed32s {\n    optional sfixed32 i1 = 1 [default = 123];\n    optional sfixed32 i2 = 2;\n    optional int64 i3 = 3 [default = 123];\n    optional sfixed32 i4 = 4 [default = 456];\n  }\n\n  message Int64s {\n    optional int64 i1 = 1 [default = 123];\n    optional int64 i2 = 2;\n    optional uint32 i3 = 3 [default = 123];\n    optional int64 i4 = 4 [default = 456];\n  }\n\n  message Uint64s {\n    optional uint64 i1 = 1 [default = 123];\n    optional uint64 i2 = 2;\n    optional fixed32 i3 = 3 [default = 123];\n    optional uint64 i4 = 4 [default = 456];\n  }\n\n  message Sint64s {\n    optional sint64 i1 = 1 [default = 123];\n    optional sint64 i2 = 2;\n    optional sfixed32 i3 = 3 [default = 123];\n    optional sint64 i4 = 4 [default = 456];\n  }\n\n  message Fixed64s {\n    optional fixed64 i1 = 1 [default = 123];\n    optional fixed64 i2 = 2;\n    optional float i3 = 3 [default = 123];\n    optional fixed64 i4 = 4 [default = 456];\n  }\n\n  message Sfixed64s {\n    optional sfixed64 i1 = 1 [default = 123];\n    optional sfixed64 i2 = 2;\n    optional double i3 = 3 [default = 123];\n    optional sfixed64 i4 = 4 [default = 456];\n  }\n\n  message Floats {\n    optional float i1 = 1 [default = 123];\n    optional float i2 = 2;\n    optional int32 i3 = 3 [default = 123];\n    optional float i4 = 4 [default = 456];\n  }\n\n  message Doubles {\n    optional double i1 = 1 [default = 123];\n    optional double i2 = 2;\n    optional uint64 i3 = 3 [default = 123];\n    optional double i4 = 4 [default = 456];\n  }\n\n  message Bools {\n    optional bool i1 = 1 [default = true];\n    optional bool i2 = 2;\n    optional int32 i3 = 3 [default = 1];\n    optional bool i4 = 4 [default = false];\n  }\n\n  message Enums {\n    optional Enum i1 = 1 [default = ABC];\n    optional Enum i2 = 2;\n    optional uint32 i3 = 3 [default = 1];\n    optional Enum i4 = 4 [default = XYZ];\n\n    enum Enum {\n      ZERO = 0;\n      ABC = 1;\n      DEF = 2;\n      XYZ = 3;\n    }\n  }\n}\n\nmessage Bar {\n  map<string, int32> map = 1;\n  repeated string strings = 2;\n  repeated uint64 uints = 3;\n  optional Bar bar = 4;\n  repeated Bar bars = 5;\n}\n\nmessage Baz {\n  map<string, int32> map = 1;\n  repeated string strings = 2;\n  repeated uint64 uints = 3;\n  optional Bar bar = 4;\n  repeated Bar bars = 5;\n\n  extensions 100 to 200;\n\n  extend Baz {\n    optional string s = 200 [default = \"abc\"];\n    optional bool b = 199;\n    optional float f32 = 198 [default = 123.0];\n    optional double f = 196 [default = 0.1020304];\n  }\n}\n\nextend Baz {\n  optional uint32 u1 = 100 [default = 123];\n  optional uint32 u2 = 101 [default = 9876];\n  optional bytes b1 = 102 [default = \"abc\"];\n  optional bytes b2 = 103 [default = \"a1b2c3\"];\n  repeated Baz bb1 = 104;\n  optional string s1 = 105 [default = \"0\"];\n  optional string s2 = 106 [default = \"xyz\"];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_default/2.proto",
    "content": "edition = \"2023\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Fizz {\n  string s1 = 1 [default = \"abc\"];\n  string s2 = 2;\n  int32 s3 = 3 [default = 123];\n\n  bytes b1 = 5 [default = \"abc\"];\n  bytes b2 = 6;\n  bool b3 = 7 [default = true];\n\n  message Int32s {\n    int32 i1 = 1 [default = 123];\n    int32 i2 = 2;\n    string i3 = 3 [default = \"abc\"];\n  }\n\n  message Uint32s {\n    uint32 i1 = 1 [default = 123];\n    uint32 i2 = 2;\n    fixed64 i3 = 3 [default = 456];\n  }\n\n  message Sint32s {\n    sint32 i1 = 1 [default = 123];\n    sint32 i2 = 2;\n    bytes i3 = 3 [default = \"abc\"];\n  }\n\n  message Fixed32s {\n    fixed32 i1 = 1 [default = 123];\n    fixed32 i2 = 2;\n    sint64 i3 = 3 [default = 456];\n  }\n\n  message Sfixed32s {\n    sfixed32 i1 = 1 [default = 123];\n    sfixed32 i2 = 2;\n    int64 i3 = 3 [default = 64];\n  }\n\n  message Int64s {\n    int64 i1 = 1 [default = 123];\n    int64 i2 = 2;\n    sint32 i3 = 3 [default = 456];\n  }\n\n  message Uint64s {\n    uint64 i1 = 1 [default = 123];\n    uint64 i2 = 2;\n    string i3 = 3 [default = \"xyz\"];\n  }\n\n  message Sint64s {\n    sint64 i1 = 1 [default = 123];\n    sint64 i2 = 2;\n    uint32 i3 = 3 [default = 456];\n  }\n\n  message Fixed64s {\n    fixed64 i1 = 1 [default = 123];\n    fixed64 i2 = 2;\n    int32 i3 = 3 [default = 456];\n  }\n\n  message Sfixed64s {\n    sfixed64 i1 = 1 [default = 123];\n    sfixed64 i2 = 2;\n    bytes i3 = 3 [default = \"xyz\"];\n  }\n\n  message Floats {\n    float i1 = 1 [default = 123.123];\n    float i2 = 2;\n    uint32 i3 = 3 [default = 456];\n  }\n\n  message Doubles {\n    double i1 = 1 [default = 123.123];\n    double i2 = 2;\n    string i3 = 3 [default = \"xyz\"];\n  }\n\n  message Bools {\n    bool i1 = 1 [default = true];\n    bool i2 = 2;\n    uint32 i3 = 3 [default = 456];\n  }\n}\n\nmessage Buzz {\n  map<string, int32> map = 1;\n  repeated string strings = 2;\n  repeated uint64 uints = 3;\n  Buzz buzz = 4;\n  repeated Buzz buzzes = 5;\n}\n\nextend google.protobuf.MessageOptions {\n  uint32 num = 10000 [default = 0];\n  repeated string strings = 10101;\n  Buzz buzz = 20202;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_default/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - FIELD_SAME_DEFAULT\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_java_utf8_validation/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage A1 {\n  extensions 100 to 1000;\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A1 other4 = 14;\n}\n\nmessage B1 {\n  extensions 100 to 1000;\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B1 other4 = 14;\n}\n\nmessage C1 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional C1 other4 = 14;\n}\n\nmessage D1 {\n  extensions 100 to 1000;\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional D1 other4 = 14;\n}\n\nmessage E1 {\n  extensions 100 to 1000;\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional E1 other4 = 14;\n}\n\nmessage F1 {\n  extensions 100 to 1000;\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional F1 other4 = 14;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_java_utf8_validation/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\noption java_string_check_utf8 = true;\n\nmessage A2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A2 other4 = 14;\n}\n\nmessage B2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B2 other4 = 14;\n}\n\nmessage C2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional C2 other4 = 14;\n}\n\nmessage D2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional D2 other4 = 14;\n}\n\nmessage E2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional E2 other4 = 14;\n}\n\nmessage F2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional F2 other4 = 14;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_java_utf8_validation/3.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage A3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  A3 other4 = 14;\n}\n\nmessage B3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  B3 other4 = 14;\n}\n\nmessage C3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C3 other4 = 14;\n}\n\nmessage D3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D3 other4 = 14;\n}\n\nmessage E3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E3 other4 = 14;\n}\n\nmessage F3 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional F3 other4 = 14;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_java_utf8_validation/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"google/protobuf/java_features.proto\";\n\nmessage A4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  A4 other4 = 14;\n}\n\nmessage B4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  B4 other4 = 14;\n}\n\nmessage C4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C4 other4 = 14;\n}\n\nmessage D4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D4 other4 = 14;\n}\n\nmessage E4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E4 other4 = 14;\n}\n\nmessage F4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F4 other4 = 14;\n}\n\nmessage E7 {\n  string s1 = 1 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string s2 = 2;\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=VERIFY];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E7 other4 = 14;\n}\n\nmessage F7 {\n  string s1 = 1 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string s2 = 2;\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=VERIFY];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F7 other4 = 14;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_java_utf8_validation/5.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"google/protobuf/java_features.proto\";\n\noption features.(pb.java).utf8_validation = VERIFY;\n\nmessage A5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  A5 other4 = 14;\n}\n\nmessage B5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  B5 other4 = 14;\n}\n\nmessage C5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C5 other4 = 14;\n}\n\nmessage D5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D5 other4 = 14;\n}\n\nmessage E5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E5 other4 = 14;\n}\n\nmessage F5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F5 other4 = 14;\n}\n\nmessage D7 {\n  string s1 = 1 [features.(pb.java).utf8_validation=VERIFY];\n  repeated string s2 = 2;\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D7 other4 = 14;\n}\n\nmessage F8 {\n  string s1 = 1 [features.(pb.java).utf8_validation=VERIFY];\n  repeated string s2 = 2;\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F8 other4 = 14;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_java_utf8_validation/6.proto",
    "content": "edition = \"2023\";\n\npackage a;\nimport \"1.proto\";\nimport \"google/protobuf/java_features.proto\";\n\noption features.utf8_validation = NONE;\noption features.(pb.java).utf8_validation = VERIFY;\n\nmessage A6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  A6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend A1 {\n    string a1_s1 = 100;\n    repeated string a1_s2 = 101;\n  }\n}\n\nmessage B6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  B6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend B1 {\n    string b1_s1 = 100;\n    repeated string b1_s2 = 101;\n  }\n}\n\nmessage C6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C6 other4 = 14;\n}\n\nmessage D6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend D1 {\n    string d1_s1 = 100;\n    repeated string d1_s2 = 101;\n  }\n}\n\nmessage E6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend E1 {\n    string e1_s1 = 100;\n    repeated string e1_s2 = 101;\n  }\n}\n\nmessage F6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend F1 {\n    string f1_s1 = 100;\n    repeated string f1_s2 = 101;\n  }\n}\n\nmessage D8 {\n  string s1 = 1 [features.(pb.java).utf8_validation=VERIFY];\n  repeated string s2 = 2;\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D8 other4 = 14;\n}\n\nmessage E8 {\n  string s1 = 1 [features.(pb.java).utf8_validation=VERIFY];\n  repeated string s2 = 2;\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E8 other4 = 14;\n}\n\nextend A6 {\n  string a6_s1 = 100;\n  repeated string a6_s2 = 101;\n}\n\nextend B6 {\n  string b6_s1 = 100;\n  repeated string b6_s2 = 101;\n}\n\nextend D6 {\n  string d6_s1 = 100;\n  repeated string d6_s2 = 101;\n}\n\nextend E6 {\n  string e6_s1 = 100;\n  repeated string e6_s2 = 101;\n}\n\nextend F6 {\n  string f6_s1 = 100;\n  repeated string f6_s2 = 101;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_java_utf8_validation/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_JAVA_UTF8_VALIDATION\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_json_name/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2 [json_name = \"bar\"];\n  int32 three = 3 [json_name = \"baz\"];\n  repeated int32 four = 4;\n  repeated int32 five = 5 [json_name = \"bar2\"];\n  repeated int32 six = 6 [json_name = \"baz2\"];\n  map<int32, int32> seven = 7;\n  map<int32, int32> eight = 8 [json_name = \"bar3\"];\n  map<int32, int32> nine = 9 [json_name = \"baz3\"];\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2 [json_name = \"bar\"];\n      int32 three = 3 [json_name = \"baz\"];\n      repeated int32 four = 4;\n      repeated int32 five = 5 [json_name = \"bar2\"];\n      repeated int32 six = 6 [json_name = \"baz2\"];\n      map<int32, int32> seven = 7;\n      map<int32, int32> eight = 8 [json_name = \"bar3\"];\n      map<int32, int32> nine = 9 [json_name = \"baz3\"];\n    }\n    message Six {\n      int32 one = 1 [json_name = \"foo\"];\n      int32 two = 2 [json_name = \"\" ];\n      int32 three = 3;\n      repeated int32 four = 4 [json_name = \"bar\"];\n      repeated int32 five = 5 [json_name = \"1\" ];\n      repeated int32 six = 6;\n      map<int32, int32> seven = 7 [json_name = \"baz\"];\n      map<int32, int32> eight = 8 [json_name = \"2\" ];\n      map<int32, int32> nine = 9;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2 [json_name = \"bar\"];\n    int32 three = 3 [json_name = \"baz\"];\n    repeated int32 four = 4;\n    repeated int32 five = 5 [json_name = \"bar2\"];\n    repeated int32 six = 6 [json_name = \"baz2\"];\n    map<int32, int32> seven = 7;\n    map<int32, int32> eight = 8 [json_name = \"bar3\"];\n    map<int32, int32> nine = 9 [json_name = \"baz3\"];\n  }\n  message Eight {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n    repeated int32 four = 4 [json_name = \"bar\"];\n    repeated int32 five = 5 [json_name = \"1\" ];\n    repeated int32 six = 6;\n    map<int32, int32> seven = 7 [json_name = \"baz\"];\n    map<int32, int32> eight = 8 [json_name = \"2\" ];\n    map<int32, int32> nine = 9;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_json_name/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1 [json_name = \"foo\"];\n  int32 two = 2 [json_name = \"\" ];\n  int32 three = 3;\n  repeated int32 four = 4 [json_name = \"bar\"];\n  repeated int32 five = 5 [json_name = \"1\" ];\n  repeated int32 six = 6;\n  map<int32, int32> seven = 7 [json_name = \"baz\"];\n  map<int32, int32> eight = 8 [json_name = \"2\" ];\n  map<int32, int32> nine = 9;\n}\n\nmessage One2 {\n  int32 one = 1 [json_name = \"foo\"];\n  int32 two = 2 [json_name = \"\" ];\n  int32 three = 3;\n  repeated int32 four = 4 [json_name = \"bar\"];\n  repeated int32 five = 5 [json_name = \"1\" ];\n  repeated int32 six = 6;\n  map<int32, int32> seven = 7 [json_name = \"baz\"];\n  map<int32, int32> eight = 8 [json_name = \"2\" ];\n  map<int32, int32> nine = 9;\n}\n\nmessage Two2 {\n  int32 one = 1 [json_name = \"foo\"];\n  int32 two = 2 [json_name = \"\" ];\n  int32 three = 3;\n  repeated int32 four = 4 [json_name = \"bar\"];\n  repeated int32 five = 5 [json_name = \"1\" ];\n  repeated int32 six = 6;\n  map<int32, int32> seven = 7 [json_name = \"baz\"];\n  map<int32, int32> eight = 8 [json_name = \"2\" ];\n  map<int32, int32> nine = 9;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1 [json_name = \"foo\"];\n      int32 two = 2 [json_name = \"\" ];\n      int32 three = 3;\n      repeated int32 four = 4 [json_name = \"bar\"];\n      repeated int32 five = 5 [json_name = \"1\" ];\n      repeated int32 six = 6;\n      map<int32, int32> seven = 7 [json_name = \"baz\"];\n      map<int32, int32> eight = 8 [json_name = \"2\" ];\n      map<int32, int32> nine = 9;\n    }\n    message Six2 {\n      int32 one = 1 [json_name = \"foo\"];\n      int32 two = 2 [json_name = \"\" ];\n      int32 three = 3;\n      repeated int32 four = 4 [json_name = \"bar\"];\n      repeated int32 five = 5 [json_name = \"1\" ];\n      repeated int32 six = 6;\n      map<int32, int32> seven = 7 [json_name = \"baz\"];\n      map<int32, int32> eight = 8 [json_name = \"2\" ];\n      map<int32, int32> nine = 9;\n    }\n  }\n  message Seven2 {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n    repeated int32 four = 4 [json_name = \"bar\"];\n    repeated int32 five = 5 [json_name = \"1\" ];\n    repeated int32 six = 6;\n    map<int32, int32> seven = 7 [json_name = \"baz\"];\n    map<int32, int32> eight = 8 [json_name = \"2\" ];\n    map<int32, int32> nine = 9;\n  }\n  message Eight2 {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n    repeated int32 four = 4 [json_name = \"bar\"];\n    repeated int32 five = 5 [json_name = \"1\" ];\n    repeated int32 six = 6;\n    map<int32, int32> seven = 7 [json_name = \"baz\"];\n    map<int32, int32> eight = 8 [json_name = \"2\" ];\n    map<int32, int32> nine = 9;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2 [json_name = \"bar\" ];\n    int32 three = 3 [json_name = \"baz\"];\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_json_name/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_JSON_NAME\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_jstype/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  int64 one = 1 [jstype = JS_NUMBER];\n  int64 two = 2;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int64 one = 1 [jstype = JS_NUMBER];\n      int64 two = 2;\n    }\n    message Six {\n      int64 one = 1;\n      int64 two = 2;\n    }\n  }\n  message Seven {\n    int64 one = 1 [jstype = JS_NUMBER];\n    int64 two = 2 [jstype = JS_NORMAL];\n  }\n  message Eight {\n    int64 one = 1;\n    int64 two = 2;\n  }\n  int64 one = 1;\n  int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_jstype/2.proto",
    "content": "syntax = \"proto2\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage One {\n  optional int64 one = 1;\n  optional int64 two = 2 [jstype = JS_STRING];\n}\n\nmessage One2 {\n  optional int64 one = 1 [jstype = JS_NUMBER];\n  required int64 two = 2 [jstype = JS_STRING];\n}\n\nmessage Two2 {\n  optional int64 one = 1 [jstype = JS_NUMBER];\n  required int64 two = 2 [jstype = JS_STRING];\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int64 one = 1 [jstype = JS_NUMBER];\n      required int64 two = 2 [jstype = JS_STRING];\n    }\n    message Six2 {\n      optional int64 one = 1;\n      required int64 two = 2;\n    }\n  }\n  message Seven2 {\n    optional int64 one = 1;\n    required int64 two = 2;\n  }\n  message Eight2 {\n    optional int64 one = 1;\n    required int64 two = 2;\n  }\n  optional int64 one = 1;\n  required int64 two = 2;\n}\n\nmessage Nine2 {\n  optional int64 one = 1 [jstype = JS_NUMBER];\n  required int64 two = 2 [jstype = JS_STRING];\n\n  extensions 100 to 1000;\n}\n\nmessage Nine {\n  optional int64 one = 1 [jstype = JS_NUMBER];\n  optional int64 two = 2;\n\n  extend google.protobuf.FileOptions {\n    optional uint64 f1 = 10001 [jstype = JS_NORMAL];\n    optional sint64 f2 = 10002 [jstype = JS_STRING];\n    optional int64 f3 = 10003 [jstype = JS_STRING];\n    optional fixed64 f4 = 10004 [jstype = JS_NUMBER];\n    optional sfixed64 f5 = 10005;\n  }\n}\n\nextend Nine2 {\n  optional sint64 s1 = 101 [jstype = JS_NORMAL];\n  optional sint64 s2 = 102 [jstype = JS_NUMBER];\n  optional sint64 s3 = 103 [jstype = JS_STRING];\n  optional sint64 s4 = 104;\n  optional sint64 s5 = 105 [jstype = JS_STRING];\n  optional sint64 s6 = 106 [jstype = JS_NUMBER];\n  optional sint64 s7 = 107;\n  optional sint64 s8 = 108;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_jstype/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_JSTYPE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_label/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"2.proto\";\n\nmessage Two {\n  repeated int64 one = 1;\n  repeated Two two = 2;\n  int64 three = 3;\n  Two four = 4;\n  int32 five = 5;\n  int32 six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      repeated int64 one = 1;\n      repeated Two two = 2;\n      int64 three = 3;\n      Two four = 4;\n      int32 five = 5;\n      int32 six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      repeated SixEntry six = 6;\n      message SixEntry {\n        int32 key = 1;\n        One value = 2;\n      }\n    }\n  }\n  message Seven {\n    repeated int64 one = 1;\n    repeated Two two = 2;\n    int64 three = 3;\n    Two four = 4;\n    int32 five = 5;\n    int32 six = 6;\n  }\n  message Eight {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_label/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage One2 {\n  required int32 one = 1;\n  required One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int64 one = 1;\n    Nine two = 2;\n  }\n}\n\nmessage Ten {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_label/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  int64 two = 2 [features.field_presence = LEGACY_REQUIRED];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_label/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_LABEL\n\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_name/1.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Two {\n  int32 one = 1;\n  int32 four = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 four = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 four = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n\n    extend google.protobuf.MessageOptions {\n      string msg_str_opt = 10101;\n    }\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\n\nextend google.protobuf.FileOptions {\n  string file_str_opt = 10101;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_name/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage One2 {\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n\n    extend Three2 {\n      repeated uint64 uint_opt = 101;\n      optional string str_option = 102;\n    }\n  }\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n\n  extensions 100 to 1000;\n}\n\nmessage Nine2 {\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n\n  extend Three2 {\n    optional bool bool_opt = 103;\n  }\n\n  extensions 100 to 1000;\n}\n\nextend Nine2 {\n  repeated uint64 uint_opt = 101;\n  optional string str_option = 102;\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    int32 four = 2;\n    int32 three = 3;\n  }\n  extend Nine2 {\n    optional bool bool_opt = 103;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_name/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_NAME\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_oneof/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  int32 one = 1;\n  oneof baz {\n    int32 two = 2;\n  }\n  oneof foo {\n    int32 three = 3;\n  }\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      oneof baz {\n        int32 two = 2;\n      }\n      oneof foo {\n        int32 three = 3;\n      }\n    }\n    message Six {\n      oneof foo {\n        int32 one = 1;\n      }\n      oneof bar {\n        int32 two = 2;\n      }\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    oneof baz {\n      int32 two = 2;\n    }\n    oneof foo {\n      int32 three = 3;\n    }\n  }\n  message Eight {\n    oneof foo {\n      int32 one = 1;\n    }\n    oneof bar {\n      int32 two = 2;\n    }\n    int32 three = 3;\n  }\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_oneof/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n  string four = 4;\n}\n\nmessage One2 {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Two2 {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      oneof foo {\n        int32 one = 1;\n      }\n      oneof bar {\n        int32 two = 2;\n      }\n      int32 three = 3;\n    }\n    message Six2 {\n      oneof foo {\n        int32 one = 1;\n      }\n      oneof bar {\n        int32 two = 2;\n      }\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    oneof foo {\n      int32 one = 1;\n    }\n    oneof bar {\n      int32 two = 2;\n    }\n    int32 three = 3;\n  }\n  message Eight2 {\n    oneof foo {\n      int32 one = 1;\n    }\n    oneof bar {\n      int32 two = 2;\n    }\n    int32 three = 3;\n  }\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  oneof baz {\n    int32 two = 2;\n  }\n  oneof foo {\n    int32 three = 3;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_oneof/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_ONEOF\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_type/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"2.proto\";\n\nmessage Two {\n  repeated int64 one = 1;\n  repeated Two two = 2;\n  int32 three = 3;\n  Two four = 4;\n  Two five = 5;\n  map<int32, Two> six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      repeated int64 one = 1;\n      repeated Two two = 2;\n      int32 three = 3;\n      Two four = 4;\n      Two five = 5;\n      map<int32, Two> six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n  }\n  message Seven {\n    repeated int64 one = 1;\n    repeated Two two = 2;\n    int32 three = 3;\n    Two four = 4;\n    Two five = 5;\n    map<int32, Two> six = 6;\n  }\n  message Eight {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_type/2.proto",
    "content": "syntax = \"proto2\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage One {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage One2 {\n  required int32 one = 1;\n  required One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int64 one = 1;\n    Nine two = 2;\n  }\n}\n\nmessage Ten {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n\nextend google.protobuf.FieldOptions {\n  repeated Nine ten_option = 10101;\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"2.proto\";\n\nmessage One3 {\n  One3 normal = 1 [features.message_encoding=DELIMITED];\n  One3 delimited = 2;\n  One3 normal_b = 3;\n  One3 delimited_b = 4 [features.message_encoding=DELIMITED];\n\n  extensions 100 to 1000;\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten2 {\n  Foo foo = 1 [features.message_encoding=DELIMITED];\n  message Foo {\n  }\n\n  extensions 100 to 1000;\n\n  extend Ten2 {\n    bool ten2_str = 100;\n    Ten2 ten2_msg = 101;\n    int64 ten2_uint32 = 102;\n  }\n}\n\nextend One3 {\n  bytes one3_str = 100;\n  One3 one3_msg = 101 [features.message_encoding=DELIMITED];\n  uint32 one3_uint32 = 102;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_type/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_TYPE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_utf8_validation/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage A1 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional A1 msg = 6;\n  optional int32 int = 7;\n}\n\nmessage B1 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional B1 msg = 6;\n  optional int32 int = 7;\n}\n\nmessage C1 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional C1 msg = 6;\n  optional int32 int = 7;\n}\n\nmessage D1 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional D1 msg = 6;\n  optional int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_utf8_validation/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage A2 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  A2 msg = 6;\n  int32 int = 7;\n}\n\nmessage B2 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  B2 msg = 6;\n  int32 int = 7;\n}\n\nmessage C2 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  C2 msg = 6;\n  int32 int = 7;\n}\n\nmessage D2 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  D2 msg = 6;\n  int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_utf8_validation/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage A3 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  A3 msg = 6;\n  int32 int = 7;\n}\n\nmessage B3 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  B3 msg = 6;\n  int32 int = 7;\n}\n\nmessage C3 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  C3 msg = 6;\n  int32 int = 7;\n}\n\nmessage D3 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  D3 msg = 6;\n  int32 int = 7;\n}\n\nmessage D5 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  D5 msg = 6;\n  int32 int = 7;\n}\n\nmessage D6 {\n  string str = 1 [features.utf8_validation = NONE];\n  repeated string strs = 2 [features.utf8_validation = NONE];\n  map<string, int32> str2int = 3 [features.utf8_validation = NONE];\n  map<int32, string> int2str = 4 [features.utf8_validation = NONE];\n  map<string, string> str2str = 5 [features.utf8_validation = NONE];\n  D6 msg = 6;\n  int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_utf8_validation/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.utf8_validation = NONE;\n\nmessage A4 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  A4 msg = 6;\n  int32 int = 7;\n}\n\nmessage B4 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  B4 msg = 6;\n  int32 int = 7;\n}\n\nmessage C4 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  C4 msg = 6;\n  int32 int = 7;\n}\n\nmessage D4 {\n  string str = 1 [features.utf8_validation = VERIFY];\n  repeated string strs = 2 [features.utf8_validation = VERIFY];\n  map<string, int32> str2int = 3 [features.utf8_validation = VERIFY];\n  map<int32, string> int2str = 4 [features.utf8_validation = VERIFY];\n  map<string, string> str2str = 5 [features.utf8_validation = VERIFY];\n  D4 msg = 6;\n  int32 int = 7;\n}\n\nmessage C5 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  C5 msg = 6;\n  int32 int = 7;\n}\n\nmessage C6 {\n  string str = 1 [features.utf8_validation = VERIFY];\n  repeated string strs = 2 [features.utf8_validation = VERIFY];\n  map<string, int32> str2int = 3 [features.utf8_validation = VERIFY];\n  map<int32, string> int2str = 4 [features.utf8_validation = VERIFY];\n  map<string, string> str2str = 5 [features.utf8_validation = VERIFY];\n  C6 msg = 6;\n  int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_same_utf8_validation/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_SAME_UTF8_VALIDATION\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_compatible_cardinality/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"2.proto\";\n\nmessage Two {\n  repeated int64 one = 1;\n  repeated Two two = 2;\n  int64 three = 3;\n  Two four = 4;\n  int32 five = 5;\n  int32 six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      repeated int64 one = 1;\n      repeated Two two = 2;\n      int64 three = 3;\n      Two four = 4;\n      int32 five = 5;\n      int32 six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      repeated SixEntry six = 6;\n      message SixEntry {\n        int32 key = 1;\n        One value = 2;\n      }\n    }\n  }\n  message Seven {\n    repeated int64 one = 1;\n    repeated Two two = 2;\n    int64 three = 3;\n    Two four = 4;\n    int32 five = 5;\n    int32 six = 6;\n  }\n  message Eight {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_compatible_cardinality/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage One2 {\n  required int32 one = 1;\n  required One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int64 one = 1;\n    Nine two = 2;\n  }\n}\n\nmessage Ten {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_compatible_cardinality/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  int64 two = 2 [features.field_presence = LEGACY_REQUIRED];\n}\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    int32 len = 1;\n\n    extend Foo {\n      repeated string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  bytes meta = 20;\n  uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_compatible_cardinality/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - FIELD_WIRE_COMPATIBLE_CARDINALITY\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_compatible_type/2.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage CompatiblePrimitives {\n  bool bool_field_1 = 1;\n  int32 int32_field_1 = 2;\n  uint32 uint32_field_1 = 3;\n  int64 int64_field_1 = 4;\n  uint64 uint64_field_1 = 5;\n\n  sint64 sint64_field_1 = 6;\n  sint32 sint32_field_1 = 7;\n\n  sfixed32 sfixed32_field_1 = 8;\n  fixed32 fixed32_field_1 = 9;\n\n  sfixed64 sfixed64_field_1 = 10;\n  fixed64 fixed64_field_1 = 11;\n\n  string string_field_1 = 12;\n\n  bytes bytes_field_1 = 14;\n\n  float float_field_1 = 15;\n\n  double double_field_1 = 16;\n}\n\nmessage IncompatiblePrimitives {\n  sfixed64 sfixed64_field_1 = 1;\n  string string_field_1 = 2;\n  bytes bytes_field_1 = 3;\n  float float_field_1 = 4;\n  double double_field_1 = 5;\n  fixed32 fixed32_field_1 = 6;\n  sfixed32 sfixed32_field_1 = 7;\n  sint32 sint32_field_1 = 8;\n  sint64 sint64_field_1 = 9;\n  string fixed64_field_1 = 10;\n  int32 int32_field_1 = 11;\n  uint32 uint32_field_1 = 12;\n  int64 int64_field_1 = 14;\n  uint64 uint64_field_1 = 15;\n  bool bool_field_1 = 16;\n}\n\nenum Baz {\n  BAZ_UNSPECIFIED = 0;\n  BAZ_ONE = 1;\n  BAZ_TWO = 2;\n}\n\nmessage WithCompatibleEnums {\n  enum Foo {\n    FOO_UNSPECIFIED = 0;\n    FOO_ONE = 1;\n    FOO_TWO = 2;\n  }\n  Foo foo = 1;\n  Baz baz = 2;\n}\n\nenum Bat {\n  BAT_UNSPECIFIED = 0;\n  BAT_TWO = 1;\n}\n\nmessage WithIncompatibleEnums {\n  enum Bar {\n    BAR_UNSPECIFIED = 0;\n    BAR_TWO = 1;\n  }\n  enum Ban {\n    BAN_UNSPECIFIED = 0;\n    BAN_ONE = 1;\n  }\n  Bar bar = 1;\n  Bat bat = 2;\n  Ban ban = 3;\n}\n\nmessage StringBytes {\n  bytes string_field_1 = 1;\n  string bytes_field_1 = 2;\n}\n\nextend google.protobuf.FieldOptions {\n  repeated Bat bat_option = 10101;\n  bytes str_option = 10102;\n  bytes byt_option = 10103;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_compatible_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Message {\n  Message normal = 1 [features.message_encoding=DELIMITED];\n  Message delimited = 2;\n  Message normal_b = 3;\n  Message delimited_b = 4 [features.message_encoding=DELIMITED];\n\n  extensions 100 to 1000;\n\n  extend Message {\n    bytes str = 100;\n    Message msg = 101 [features.message_encoding=DELIMITED];\n    uint64 uint64 = 102;\n  }\n}\n\nextend Message {\n  string str = 200;\n  Message msg = 201;\n  sint32 sint32 = 202;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_compatible_type/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_WIRE_COMPATIBLE_TYPE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_json_compatible_cardinality/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"2.proto\";\n\nmessage Two {\n  repeated int64 one = 1;\n  repeated Two two = 2;\n  int64 three = 3;\n  Two four = 4;\n  int32 five = 5;\n  int32 six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      repeated int64 one = 1;\n      repeated Two two = 2;\n      int64 three = 3;\n      Two four = 4;\n      int32 five = 5;\n      int32 six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      repeated SixEntry six = 6;\n      message SixEntry {\n        int32 key = 1;\n        One value = 2;\n      }\n    }\n  }\n  message Seven {\n    repeated int64 one = 1;\n    repeated Two two = 2;\n    int64 three = 3;\n    Two four = 4;\n    int32 five = 5;\n    int32 six = 6;\n  }\n  message Eight {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_json_compatible_cardinality/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage One2 {\n  required int32 one = 1;\n  required One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int64 one = 1;\n    Nine two = 2;\n  }\n}\n\nmessage Ten {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_json_compatible_cardinality/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  int64 two = 2 [features.field_presence = LEGACY_REQUIRED];\n}\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    int32 len = 1;\n\n    extend Foo {\n      repeated string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  bytes meta = 20;\n  uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_json_compatible_cardinality/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - FIELD_WIRE_JSON_COMPATIBLE_CARDINALITY\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_json_compatible_type/2.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage CompatiblePrimitives {\n  uint32 uint32_field_1 = 1;\n  int32 int32_field_1 = 2;\n\n  uint64 uint64_field_1 = 3;\n  int64 int64_field_1 = 4;\n\n  sfixed32 sfixed32_field_1 = 5;\n  fixed32 fixed32_field_1 = 6;\n\n  sfixed64 sfixed64_field_1 = 7;\n  fixed64 fixed64_field_1 = 8;\n\n  bool bool_field_1 = 9;\n\n  sint32 sint32_field_1 = 10;\n\n  sint64 sint64_field_1 = 11;\n\n  string string_field_1 = 12;\n\n  bytes bytes_field_1 = 14;\n\n  float float_field_1 = 15;\n\n  double double_field_1 = 16;\n}\n\nmessage IncompatiblePrimitives {\n  sfixed64 sfixed64_field_1 = 1;\n  string string_field_1 = 2;\n  bytes bytes_field_1 = 3;\n  float float_field_1 = 4;\n  double double_field_1 = 5;\n  fixed32 fixed32_field_1 = 6;\n  sfixed32 sfixed32_field_1 = 7;\n  sint32 sint32_field_1 = 8;\n  sint64 sint64_field_1 = 9;\n  string fixed64_field_1 = 10;\n  int32 int32_field_1 = 11;\n  uint32 uint32_field_1 = 12;\n  int64 int64_field_1 = 14;\n  uint64 uint64_field_1 = 15;\n  bool bool_field_1 = 16;\n}\n\nenum Baz {\n  BAZ_UNSPECIFIED = 0;\n  BAZ_ONE = 1;\n  BAZ_TWO = 2;\n}\n\nmessage WithCompatibleEnums {\n  enum Foo {\n    FOO_UNSPECIFIED = 0;\n    FOO_ONE = 1;\n    FOO_TWO = 2;\n  }\n  Foo foo = 1;\n  Baz baz = 2;\n}\n\nenum Bat {\n  BAT_UNSPECIFIED = 0;\n  BAT_TWO = 1;\n}\n\nmessage WithIncompatibleEnums {\n  enum Bar {\n    BAR_UNSPECIFIED = 0;\n    BAR_TWO = 1;\n  }\n  enum Ban {\n    BAN_UNSPECIFIED = 0;\n    BAN_ONE = 1;\n  }\n  Bar bar = 1;\n  Bat bat = 2;\n  Ban ban = 3;\n}\n\nmessage StringBytes {\n  bytes string_field_1 = 1;\n  string bytes_field_1 = 2;\n}\n\nextend google.protobuf.FieldOptions {\n  repeated Bat bat_option = 10101;\n  bytes str_option = 10102;\n  bytes byt_option = 10103;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_json_compatible_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Message {\n  Message normal = 1 [features.message_encoding=DELIMITED];\n  Message delimited = 2;\n  Message normal_b = 3;\n  Message delimited_b = 4 [features.message_encoding=DELIMITED];\n\n  extensions 100 to 1000;\n\n  extend Message {\n    bytes str = 100;\n    Message msg = 101 [features.message_encoding=DELIMITED];\n    uint64 uint64 = 102;\n  }\n}\n\nextend Message {\n  string str = 200;\n  Message msg = 201;\n  sint32 sint32 = 202;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_field_wire_json_compatible_type/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FIELD_WIRE_JSON_COMPATIBLE_TYPE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FILE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete/sub/a/b/sub_a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete_ignores/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete_ignores/buf.yaml",
    "content": "version: v1beta1\nbreaking:\n  use:\n    - FILE_NO_DELETE\n  ignore:\n    - a/c\n    - no_package.proto\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete_ignores/sub/a/b/sub_a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete_unstable/a/v1beta1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_no_delete_unstable/buf.yaml",
    "content": "version: v1\nbreaking:\n  ignore_unstable_packages: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_package/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_package/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_package/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FILE_SAME_PACKAGE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_package/no_package.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_package/sub/a/b/sub_a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_syntax/buf.yaml",
    "content": "version: v1beta1\nbuild:\n  roots:\n    - root\nbreaking:\n  use:\n    - FILE_SAME_SYNTAX\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_syntax/root/a/a.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_syntax/root/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_syntax/root/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_syntax/root/sub/a/b/sub_a_b.proto",
    "content": "\nsyntax = \"proto2\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_values/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\noption java_package = \"bar\";\noption java_outer_classname = \"bar\";\noption java_multiple_files = false;\noption go_package = \"bar\";\noption objc_class_prefix = \"bar\";\noption csharp_namespace = \"bar\";\noption swift_prefix = \"bar\";\noption php_class_prefix = \"bar\";\noption php_namespace = \"bar\";\noption php_metadata_namespace = \"bar\";\noption ruby_package = \"bar\";\n\noption java_string_check_utf8 = false;\noption optimize_for = SPEED;\noption cc_generic_services = false;\noption java_generic_services = false;\noption py_generic_services = false;\n//option php_generic_services = false;\noption cc_enable_arenas = false;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_values/2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\noption java_package = \"bar\";\noption java_outer_classname = \"bar\";\noption java_multiple_files = true;\noption go_package = \"bar\";\noption objc_class_prefix = \"bar\";\noption csharp_namespace = \"bar\";\noption swift_prefix = \"bar\";\noption php_class_prefix = \"bar\";\noption php_namespace = \"bar\";\noption php_metadata_namespace = \"bar\";\noption ruby_package = \"bar\";\n\noption java_string_check_utf8 = true;\noption optimize_for = CODE_SIZE;\noption cc_generic_services = true;\noption java_generic_services = true;\noption py_generic_services = true;\n//option php_generic_services = true;\noption cc_enable_arenas = false; // the default option is true as of 3.12, so this should be changed now\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_file_same_values/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_delete_file/a/v1beta1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nmessage A {}\n\nenum AEnum {\n  A_ENUM_UNSPECIFIED = 0;\n}\n\nservice AService{}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_delete_file/buf.yaml",
    "content": "version: v1beta1\nbreaking:\n  use:\n    - PACKAGE\n  ignore_unstable_packages: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/1.proto",
    "content": "syntax = \"proto3\";\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/2.proto",
    "content": "syntax = \"proto3\";\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/a/v1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/a/v1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/a/v1beta1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/a/v1beta1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_false/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/1.proto",
    "content": "syntax = \"proto3\";\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/2.proto",
    "content": "syntax = \"proto3\";\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/a/v1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/a/v1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/a/v1beta1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/a/v1beta1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_ignore_unstable_packages_true/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ENUM_NO_DELETE\n  ignore_unstable_packages: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_int_enum/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  int32 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_int_enum/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  Bar2 foo = 1;\n}\nenum Bar2 {\n  Blah = 0;\n}\n\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_enum/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  Bar foo = 1;\n}\nenum Bar {\n  Blah = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_enum/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  Foo2 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_int/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  Foo foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_int/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  int32 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_message/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  Foo22 foo = 1;\n}\nmessage Foo22 {\n  int32 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_message/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  Foo2 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {}\n\nmessage Three {\n  message Four {\n    message Six {}\n  }\n  message Eight{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {}\n\nmessage Two2 {}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {}\n    message Six2 {}\n  }\n  message Seven2{}\n  message Eight2{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - MESSAGE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_json_format/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage A1 {\n  optional string s = 1;\n}\n\nmessage B1 {\n  optional string s = 1;\n}\n\nmessage C1 {\n  optional string s = 1;\n}\n\nmessage D1 {\n  optional string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_json_format/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage A2 {\n  string s = 1;\n}\n\nmessage B2 {\n  string s = 1;\n}\n\nmessage C2 {\n  string s = 1;\n}\n\nmessage D2 {\n  string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_json_format/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage A3 {\n  string s = 1;\n}\n\nmessage B3 {\n  string s = 1;\n}\n\nmessage C3 {\n  string s = 1;\n}\n\nmessage D3 {\n  string s = 1;\n}\n\nmessage D5 {\n  string s = 1;\n}\n\nmessage D6 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_json_format/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.json_format = LEGACY_BEST_EFFORT;\n\nmessage A4 {\n  string s = 1;\n}\n\nmessage B4 {\n  string s = 1;\n}\n\nmessage C4 {\n  string s = 1;\n}\n\nmessage D4 {\n  option features.json_format = ALLOW;\n  string s = 1;\n}\n\nmessage C5 {\n  string s = 1;\n}\n\nmessage C6 {\n  option features.json_format = ALLOW;\n  string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_json_format/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - MESSAGE_SAME_JSON_FORMAT\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_required_fields/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  required string two = 2;\n}\n\nmessage Two {\n  required string two = 2;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      required string two = 2;\n    }\n    message Six {\n      // Six had a required field previously\n    }\n  }\n  message Seven {\n    required string two = 2;\n  }\n  message Eight {\n    // Eight had no previous required field\n    required string two = 2;\n  }\n  required string two = 2;\n}\n\nmessage Nine {\n  // Nine is a new message so this should not end up being a breaking change.\n  required string one = 1;\n  required string two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_required_fields/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  required string two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_required_fields/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - MESSAGE_SAME_REQUIRED_FIELDS\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_values/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  option no_standard_descriptor_accessor = true;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      option no_standard_descriptor_accessor = true;\n    }\n    message Six {\n      extensions 4 to max;\n    }\n  }\n  message Seven {\n  }\n  message Eight {\n    extensions 4 to max;\n  }\n  option no_standard_descriptor_accessor = true;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_values/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  option no_standard_descriptor_accessor = true;\n}\n\nmessage Two {\n  option no_standard_descriptor_accessor = true;\n}\n\n\nmessage Nine {\n  extensions 4 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_message_same_values/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR\n    - MESSAGE_SAME_MESSAGE_SET_WIRE_FORMAT\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_oneof_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      oneof foo {\n        int32 one = 1;\n        int32 two = 2;\n        int32 three = 3;\n      }\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    oneof foo {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_oneof_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  string four = 4;\n}\n\nmessage One2 {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Two2 {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      oneof foo {\n        int32 one = 1;\n        int32 two = 2;\n        int32 three = 3;\n      }\n    }\n    message Six2 {\n      oneof foo {\n        int32 one = 1;\n        int32 two = 2;\n        int32 three = 3;\n      }\n    }\n  }\n  message Seven2 {\n    oneof foo {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Eight2 {\n    oneof foo {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_oneof_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - ONEOF_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_extension_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_extension_no_delete/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"3.proto\";\nimport \"4.proto\";\n\nmessage One {\n  optional int32 one = 1;\n  optional int32 two = 2;\n}\n\nmessage Nine {\n  optional int32 one = 1;\n  optional int32 three = 3;\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  optional Foo ch = 22;\n}\n\nextend b.Fizz {\n  optional b.Fizz child = 22;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_extension_no_delete/3.proto",
    "content": "syntax = \"proto2\";\n\npackage b;\n\nmessage Fizz {\n  extensions 10 to 100;\n\n  message Buzz {\n    optional int32 len = 1;\n\n    extend Fizz {\n      optional string str = 10;\n    }\n  }\n}\n\nextend Fizz {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_extension_no_delete/4.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_extension_no_delete/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - PACKAGE_EXTENSION_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_no_delete/a1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {}\n\nservice Foo {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_no_delete/a2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  enum EnumOne {\n    ENUM_ONE_UNSPECIFIED = 0;\n  }\n}\n\nmessage Three {\n  message Four {\n    message Six {}\n  }\n  message Eight {}\n}\n\nenum EnumTwo {\n  ENUM_TWO_UNSPECIFIED = 0;\n}\n\nservice Baz {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_no_delete/b1.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nmessage One {}\n\nservice Foo {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_no_delete/b2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nmessage Two {}\n\nmessage Three {\n  message Four {\n    message Five {\n      enum EnumOne {\n        ENUM_ONE_UNSPECIFIED = 0;\n      }\n    }\n    message Six {}\n  }\n  message Seven {\n    enum EnumOne {\n      ENUM_ONE_UNSPECIFIED = 0;\n    }\n  }\n}\n\nmessage Nine {}\n\nenum EnumTwo {\n  ENUM_TWO_UNSPECIFIED = 0;\n}\n\nservice Baz {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - PACKAGE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_service_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage ARequest {\n  string key = 1;\n}\n\nmessage AResponse {\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_service_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice BService {\n  rpc BRPC(BRequest) returns (BResponse);\n}\n\nmessage BRequest {\n  string key = 1;\n}\n\nmessage BResponse {\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_package_service_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - PACKAGE_SERVICE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_disablebuiltin/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage A {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_disablebuiltin/buf.yaml",
    "content": "version: v2\nbreaking:\n  disable_builtin: true\npolicies:\n  - policy: disablebuiltin.policy.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_disablebuiltin/disablebuiltin.policy.yaml",
    "content": "version: v2\nbreaking:\n  disable_builtin: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_empty/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage A {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_empty/buf.yaml",
    "content": "version: v2\nbreaking:\n  disable_builtin: true\npolicies:\n  - policy: empty.policy.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_empty/empty.policy.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_local/a.proto",
    "content": "syntax = \"proto3\";\n\nservice ALegacy {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n  string page_token = 2;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n  string page_token = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_local/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice B {\n  rpc GetB(GetBRequest) returns (GetBResponse);\n}\n\nmessage GetBRequest {}\nmessage GetBResponse {\n  enum BStatus {\n    B_STATUS_UNSPECIFIED = 0;\n    B_STATUS_VALID = 1;\n  }\n  message ValueStable {\n    string name = 1;\n    BStatus status = 2;\n    string a_uuid = 3;\n  }\n  ValueStable value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_local/buf.policy1.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - ENUM_NO_DELETE\n    - SERVICE_SUFFIXES_NO_CHANGE\nplugins:\n  - plugin: buf-plugin-suffix.wasm\n    options:\n      service_no_change_suffixes:\n        - Legacy\n        - Bridge\n      message_no_change_suffixes:\n        - Stable\n      enum_no_change_suffixes:\n        - Status\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_local/buf.policy2.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - MESSAGE_SUFFIXES_NO_CHANGE\n    - ENUM_SUFFIXES_NO_CHANGE\nplugins:\n  - plugin: buf-plugin-suffix.wasm\n    options:\n      service_no_change_suffixes:\n        - Legacy\n        - Bridge\n      message_no_change_suffixes:\n        - Stable\n      enum_no_change_suffixes:\n        - Status\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_policy_local/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - ENUM_NO_DELETE\npolicies:\n  - policy: buf.policy1.yaml\n  - policy: buf.policy2.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_reserved_enum_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Two {\n  reserved 100 to 250;\n  reserved 300;\n  reserved \"foo\";\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n  TWO_TWO = 2;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      reserved 100 to 250;\n      reserved 300;\n      reserved \"foo\";\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six {\n      reserved 3 to 5, 100 to 250;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    reserved 100 to 200;\n    reserved 300;\n    reserved \"foo\";\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight {\n    reserved 3 to 5, 100 to 250;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Ten {\n  reserved 1 to 1000;\n  reserved 2000 to 5000, 10000 to 50000;\n  reserved 100000 to max;\n  TEN_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_reserved_enum_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved 8 to 25;\n  reserved 50, 51, 52, 53 to 60, 61 to 65, 66, 67, 68 to 70, 71 to 75;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum One2 {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      reserved 3 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      reserved 3 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    reserved 3 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    reserved 3 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine2 {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  NINE2_UNSPECIFIED = 0;\n  NINE2_ONE = 1;\n  NINE2_TWO = 2;\n}\n\nenum Nine {\n  reserved 100 to 200;\n  reserved 300;\n  reserved \"foo\";\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_TWO = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_reserved_enum_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - RESERVED_ENUM_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_reserved_message_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Two {\n  reserved 100 to 250;\n  reserved 300;\n  reserved \"foo\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      reserved 100 to 250;\n      reserved 300;\n      reserved \"foo\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      reserved 4 to 5, 100 to 250;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    reserved 100 to 250;\n    reserved 300;\n    reserved \"foo\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    reserved 4 to 5, 100 to 250;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Ten {\n  reserved 1 to 1000;\n  reserved 2000 to 5000, 10000 to 50000;\n  reserved 100000 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_reserved_message_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved 8 to 25;\n  reserved 50, 51, 52, 53 to 60, 61 to 65, 66, 67, 68 to 70, 71 to 75;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage One2 {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      reserved 4 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      reserved 4 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    reserved 4 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    reserved 4 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  reserved 100 to 200;\n  reserved 300;\n  reserved \"foo\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_reserved_message_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - RESERVED_MESSAGE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_rpc_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Two {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_rpc_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice One {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice One2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Two2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Three2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Three {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_rpc_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - RPC_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_rpc_same_values/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/empty.proto\";\n\nservice Two {\n  rpc Foo(stream google.protobuf.Any) returns (google.protobuf.Any) {}\n  rpc Bar(google.protobuf.Any) returns (stream google.protobuf.Any) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_rpc_same_values/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/empty.proto\";\n\nservice One {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice One2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Two2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Three2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Three {\n  rpc Foo(stream google.protobuf.Any) returns (google.protobuf.Any) {}\n  rpc Bar(google.protobuf.Any) returns (stream google.protobuf.Any) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Four {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\nservice Four2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_rpc_same_values/buf.yaml",
    "content": "version: v1\nbreaking:\n  except:\n    - SERVICE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_service_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice One {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_service_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice One2 {}\nservice Two2 {}\nservice Three2 {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/current/breaking_service_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - SERVICE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_custom_plugins/a.proto",
    "content": "syntax = \"proto3\";\n\nservice ALegacy {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n  rpc GetATwo(GetATwoRequest) returns (GetATwoResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n  string page_token = 2;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n  string page_token = 2;\n}\n\nmessage GetATwoRequest {}\nmessage GetATwoResponse {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_custom_plugins/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice B {\n  rpc GetB(GetBRequest) returns (GetBResponse);\n}\n\nmessage GetBRequest {}\nmessage GetBResponse {\n  enum BStatus {\n    B_STATUS_UNSPECIFIED = 0;\n    B_STATUS_VALID = 1;\n    B_STATUS_NEW = 2;\n  }\n  message ValueStable {\n    string name = 1;\n    BStatus status = 2;\n    string b_uuid = 3;\n  }\n  ValueStable value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_custom_plugins/buf.yaml",
    "content": "version: v2\nbreaking:\n  use:\n    - ENUM_NO_DELETE\n    - SERVICE_SUFFIXES_NO_CHANGE\n    - MESSAGE_SUFFIXES_NO_CHANGE\n    - ENUM_SUFFIXES_NO_CHANGE\nplugins:\n  - plugin: buf-plugin-suffix\n    options:\n      service_no_change_suffixes:\n        - Legacy\n        - Bridge\n      message_no_change_suffixes:\n        - Stable\n      enum_no_change_suffixes:\n        - Status\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_json_format/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nenum A1 {\n  A1_ZERO = 0;\n}\n\nenum A2 {\n  A2_ZERO = 0;\n}\n\nenum A3 {\n  A3_ZERO = 0;\n}\n\nenum A4 {\n  A4_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_json_format/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum B1 {\n  B1_ZERO = 0;\n}\n\nenum B2 {\n  B2_ZERO = 0;\n}\n\nenum B3 {\n  B3_ZERO = 0;\n}\n\nenum B4 {\n  B4_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_json_format/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nenum C1 {\n  C1_ZERO = 0;\n}\n\nenum C2 {\n  C2_ZERO = 0;\n}\n\nenum C3 {\n  C3_ZERO = 0;\n}\n\nenum C4 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  C4_ZERO = 0;\n}\n\nenum C5 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  C5_ZERO = 0;\n}\n\nenum C6 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  C6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_json_format/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.json_format = LEGACY_BEST_EFFORT;\n\nenum D1 {\n  D1_ZERO = 0;\n}\n\nenum D2 {\n  D2_ZERO = 0;\n}\n\nenum D3 {\n  D3_ZERO = 0;\n}\n\nenum D4 {\n  option features.json_format = ALLOW;\n  D4_ZERO = 0;\n}\n\nenum D5 {\n  option features.json_format = ALLOW;\n  D5_ZERO = 0;\n}\n\nenum D6 {\n  option features.json_format = ALLOW;\n  D6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_type/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nenum A1 {\n  A1_ZERO = 0;\n}\n\nenum A2 {\n  A2_ZERO = 0;\n}\n\nenum A3 {\n  A3_ZERO = 0;\n}\n\nenum A4 {\n  A4_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_type/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum B1 {\n  B1_ZERO = 0;\n}\n\nenum B2 {\n  B2_ZERO = 0;\n}\n\nenum B3 {\n  B3_ZERO = 0;\n}\n\nenum B4 {\n  B4_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nenum C1 {\n  C1_ZERO = 0;\n}\n\nenum C2 {\n  C2_ZERO = 0;\n}\n\nenum C3 {\n  C3_ZERO = 0;\n}\n\nenum C4 {\n  option features.enum_type = CLOSED;\n  C4_ZERO = 0;\n}\n\nenum C5 {\n  option features.enum_type = CLOSED;\n  C5_ZERO = 0;\n}\n\nenum C6 {\n  option features.enum_type = CLOSED;\n  C6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_same_type/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.enum_type = CLOSED;\n\nenum D1 {\n  D1_ZERO = 0;\n}\n\nenum D2 {\n  D2_ZERO = 0;\n}\n\nenum D3 {\n  D3_ZERO = 0;\n}\n\nenum D4 {\n  option features.enum_type = OPEN;\n  D4_ZERO = 0;\n}\n\nenum D5 {\n  option features.enum_type = OPEN;\n  D5_ZERO = 0;\n}\n\nenum D6 {\n  option features.enum_type = OPEN;\n  D6_ZERO = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n  TWO_TWO = 2;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_TWO = 2;\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  option allow_alias = true;\n  ELEVEN_UNSPECIFIED = 0;\n  ELEVEN_ONE = 1;\n  ELEVEN_TWO = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_no_delete_unless_name_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n  TWO_TWO = 2;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_TWO = 2;\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  option allow_alias = true;\n  ELEVEN_UNSPECIFIED = 0;\n  ELEVEN_ONE = 1;\n  ELEVEN_TWO = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_no_delete_unless_name_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_no_delete_unless_number_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n  TWO_TWO = 2;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_TWO = 2;\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  option allow_alias = true;\n  ELEVEN_UNSPECIFIED = 0;\n  ELEVEN_ONE = 1;\n  ELEVEN_TWO = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_no_delete_unless_number_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_same_name/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n  TWO_TWO = 2;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_TWO = 2;\n}\n\nenum Ten {\n  option allow_alias = true;\n  TEN_UNSPECIFIED = 0;\n  TEN_ONE = 1;\n  TEN_TWO = 1;\n}\n\nenum Eleven {\n  option allow_alias = true;\n  ELEVEN_UNSPECIFIED = 0;\n  ELEVEN_ONE = 1;\n  ELEVEN_TWO = 1;\n}\n\nenum Twelve {\n  option allow_alias = true;\n  TWELVE_UNSPECIFIED = 0;\n  TWELVE_ONE = 1;\n  TWELVE_TWO = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_enum_value_same_name/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One2 {\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_extension_message_no_delete/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  extensions 10 to 20, 50 to 75;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Two {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      extensions 4 to 5, 100 to 200;\n      extensions 300, 301, 1000 to max;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n    message Six {\n      extensions 4 to 5, 100 to 200;\n      extensions 300, 301, 1000 to max;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n  }\n  message Seven {\n    extensions 4 to 5, 100 to 200;\n    extensions 300, 301, 1000 to max;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  message Eight {\n    extensions 4 to 5, 100 to 200;\n    extensions 300, 301, 1000 to max;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Nine {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Ten {\n  extensions 1 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_extension_message_no_delete/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Two2 {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      extensions 4 to 5, 100 to 200;\n      extensions 300, 301, 1000 to max;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n    message Six2 {\n      extensions 4 to 5, 100 to 200;\n      extensions 300, 301, 1000 to max;\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n  }\n  message Seven2 {\n    extensions 4 to 5, 100 to 200;\n    extensions 300, 301, 1000 to max;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  message Eight2 {\n    extensions 4 to 5, 100 to 200;\n    extensions 300, 301, 1000 to max;\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Nine2 {\n  extensions 4 to 5, 100 to 200;\n  extensions 300, 301, 1000 to max;\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_extension_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_extension_no_delete/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n  optional Foo ch = 22;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_extension_no_delete/3.proto",
    "content": "syntax = \"proto2\";\n\npackage b;\n\nmessage Fizz {\n  extensions 10 to 100;\n\n  message Buzz {\n    optional int32 len = 1;\n\n    extend Fizz {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Fizz {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n  optional Fizz child = 22;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete_unless_name_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete_unless_name_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete_unless_name_reserved/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete_unless_number_reserved/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Ten {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n  int32 four = 4;\n  int32 five = 5;\n  int32 six = 6;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete_unless_number_reserved/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_no_delete_unless_number_reserved/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_cardinality/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Two {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n  message Eight {\n    optional int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n    int32 seven = 7;\n    optional Eight eight = 8;\n    Eight nine = 9;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten {\n  int64 one = 1;\n  int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_cardinality/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"1.proto\";\n\nmessage One2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_cardinality/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_cpp_string_type/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Foo {\n  string string1 = 1 [ctype=STRING];\n  bytes string2 = 2 [ctype=STRING];\n  repeated string string3 = 3 [ctype=STRING];\n  repeated bytes string4 = 4 [ctype=STRING];\n  string string5 = 5 [ctype=STRING];\n  bytes string6 = 6 [ctype=STRING];\n\n  string cord1 = 11 [ctype=CORD];\n  bytes cord2 = 12 [ctype=CORD];\n  repeated string cord3 = 13 [ctype=CORD];\n  repeated bytes cord4 = 14 [ctype=CORD];\n  string cord5 = 15 [ctype=CORD];\n  bytes cord6 = 16 [ctype=CORD];\n\n  string string_piece1 = 21 [ctype=STRING_PIECE];\n  bytes string_piece2 = 22 [ctype=STRING_PIECE];\n  repeated string string_piece3 = 23 [ctype=STRING_PIECE];\n  repeated bytes string_piece4 = 24 [ctype=STRING_PIECE];\n  string string_piece5 = 25 [ctype=STRING_PIECE];\n  bytes string_piece6 = 26 [ctype=STRING_PIECE];\n\n  string default1 = 31;\n  bytes default2 = 32;\n  repeated string default3 = 33;\n  repeated bytes default4 = 34;\n  string default5 = 35;\n  bytes default6 = 36;\n  repeated string default7 = 37;\n\n  // ignored for non-string/non-bytes fields (not even allowed editions)\n  Foo message1 = 40 [ctype=STRING_PIECE];\n  bool bool1 = 41 [ctype=CORD];\n  repeated uint32 uint32s1= 42 [ctype=STRING_PIECE];\n  map<string,string> map1 = 43 [ctype=CORD];\n  Foo message2 = 44;\n  bool bool2 = 45;\n  repeated uint32 uint32s2 = 46;\n  map<string,string> map2 = 47;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_cpp_string_type/2.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"google/protobuf/cpp_features.proto\";\n\nmessage Bar {\n  string string1 = 1 [features.(pb.cpp).string_type=STRING];\n  bytes string2 = 2 [features.(pb.cpp).string_type=STRING];\n  repeated string string3 = 3 [features.(pb.cpp).string_type=STRING];\n  repeated bytes string4 = 4 [features.(pb.cpp).string_type=STRING];\n  string string5 = 5 [features.(pb.cpp).string_type=STRING];\n  bytes string6 = 6 [features.(pb.cpp).string_type=STRING];\n\n  string cord1 = 11 [features.(pb.cpp).string_type=CORD];\n  bytes cord2 = 12 [features.(pb.cpp).string_type=CORD];\n  repeated string cord3 = 13 [features.(pb.cpp).string_type=CORD];\n  repeated bytes cord4 = 14 [features.(pb.cpp).string_type=CORD];\n  string cord5 = 15 [features.(pb.cpp).string_type=CORD];\n  bytes cord6 = 16 [features.(pb.cpp).string_type=CORD];\n\n  string view1 = 21 [features.(pb.cpp).string_type=VIEW];\n  bytes view2 = 22 [features.(pb.cpp).string_type=VIEW];\n  repeated string view3 = 23 [features.(pb.cpp).string_type=VIEW];\n  repeated bytes view4 = 24 [features.(pb.cpp).string_type=VIEW];\n  string view5 = 25 [features.(pb.cpp).string_type=VIEW];\n  bytes view6 = 26 [features.(pb.cpp).string_type=VIEW];\n\n  string default1 = 31;\n  bytes default2 = 32;\n  repeated string default3 = 33;\n  repeated bytes default4 = 34;\n  string default5 = 35;\n  bytes default6 = 36;\n  repeated string default7 = 37;\n\n  extensions 100 to 300;\n\n  message Frobnitz {\n    extend Bar {\n      repeated string ext_str1 = 100;\n      string ext_str2 = 101 [ctype=STRING_PIECE];\n      repeated bytes ext_byt1 = 102 [features.(pb.cpp).string_type=VIEW];\n      bytes ext_byt2 = 103;\n    }\n  }\n}\n\nextend Bar {\n  repeated string ext_str1 = 200 [features.(pb.cpp).string_type=STRING];\n  repeated string ext_str2 = 201;\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_cpp_string_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nimport \"google/protobuf/cpp_features.proto\";\n\noption features.(pb.cpp).string_type=VIEW;\n\nmessage Baz {\n  string default1 = 1;\n  bytes default2 = 2;\n  repeated string default3 = 3;\n  repeated bytes default4 = 4;\n  string default5 = 5;\n  bytes default6 = 6;\n  repeated string default7 = 7;\n\n  map<string, Baz> map1 = 11;\n  map<uint32, string> map2 = 12;\n  map<int64, bytes> map3 = 13;\n\n  extensions 100 to 200;\n\n  message Fizzbuzz {\n    extend Baz {\n      repeated string ext_str1 = 100;\n      string ext_str2 = 101 [ctype=STRING_PIECE];\n      repeated bytes ext_byt1 = 102 [features.(pb.cpp).string_type=VIEW];\n      bytes ext_byt2 = 103;\n    }\n  }\n}\n\nextend Baz {\n  repeated string ext_str = 200;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_cpp_string_type/google/protobuf/cpp_features.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2023 Google Inc.  All rights reserved.\n//\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file or at\n// https://developers.google.com/open-source/licenses/bsd\n\nsyntax = \"proto2\";\n\n// TODO: Remove this file once datawkt is updated to use v27.0.\n// Note that this is not identical to the protoc version so\n// that we don't also have to provide a separate copy of\n// descriptor.proto. (The actual v27 version of the file\n// includes additional options that only work with v27+ of\n// descriptor.proto.)\npackage pb;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FeatureSet {\n  optional CppFeatures cpp = 1000;\n}\n\nmessage CppFeatures {\n  // Whether or not to treat an enum field as closed.  This option is only\n  // applicable to enum fields, and will be removed in the future.  It is\n  // consistent with the legacy behavior of using proto3 enum types for proto2\n  // fields.\n  optional bool legacy_closed_enum = 1 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    edition_defaults = { edition: EDITION_PROTO2, value: \"true\" },\n    edition_defaults = { edition: EDITION_PROTO3, value: \"false\" }\n  ];\n\n  enum StringType {\n    STRING_TYPE_UNKNOWN = 0;\n    VIEW = 1;\n    CORD = 2;\n    STRING = 3;\n  }\n\n  optional StringType string_type = 2 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    edition_defaults = { edition: EDITION_PROTO2, value: \"STRING\" },\n    edition_defaults = { edition: EDITION_2024, value: \"VIEW\" }\n  ];\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_ctype/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  string one = 1 [ctype = STRING];\n  string two = 2 [ctype = CORD];\n}\n\nmessage Two {\n  string one = 1 [ctype = STRING];\n  string two = 2 [ctype = CORD];\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      string one = 1 [ctype = STRING];\n      string two = 2 [ctype = CORD];\n    }\n    message Six {\n      string one = 1;\n      string two = 2;\n    }\n  }\n  message Seven {\n    string one = 1;\n    string two = 2;\n  }\n  message Eight {\n    string one = 1;\n    string two = 2;\n  }\n  string one = 1;\n  string two = 2;\n}\n\nmessage Nine {\n  string one = 1 [ctype = STRING];\n  string two = 2 [ctype = CORD];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_ctype/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  optional string one = 1 [ctype = STRING_PIECE];\n  required string two = 2 [ctype = CORD];\n}\n\nmessage Two2 {\n  optional string one = 1 [ctype = STRING_PIECE];\n  required string two = 2 [ctype = CORD];\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional string one = 1 [ctype = STRING_PIECE];\n      required string two = 2 [ctype = CORD];\n    }\n    message Six2 {\n      optional string one = 1;\n      required string two = 2;\n    }\n  }\n  message Seven2 {\n    optional string one = 1;\n    required string two = 2;\n  }\n  message Eight2 {\n    optional string one = 1;\n    required string two = 2;\n  }\n  optional string one = 1;\n  required string two = 2;\n}\n\nmessage Nine2 {\n  optional string one = 1 [ctype = STRING_PIECE];\n  required string two = 2 [ctype = CORD];\n}\n\nmessage Ten2 {\n  extensions 1 to 100;\n}\n\nextend Ten2 {\n  optional string ten_one = 1 [ctype = STRING_PIECE];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_default/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  optional string s1 = 1 [default = \"abc\"];\n  optional string s2 = 2 [default = \"abc\"];\n  optional string s3 = 3 [default = \"abc\"];\n  optional string s4 = 4 [default = \"abc\"];\n\n  optional bytes b1 = 5 [default = \"xyz\"];\n  optional bytes b2 = 6 [default = \"xyz\"];\n  optional bytes b3 = 7 [default = \"xyz\"];\n  optional bytes b4 = 8 [default = \"xyz\"];\n\n  message Int32s {\n    optional int32 i1 = 1 [default = 123];\n    optional int32 i2 = 2 [default = 123];\n    optional int32 i3 = 3 [default = 123];\n    optional int32 i4 = 4 [default = 123];\n  }\n\n  message Uint32s {\n    optional uint32 i1 = 1 [default = 123];\n    optional uint32 i2 = 2 [default = 123];\n    optional uint32 i3 = 3 [default = 123];\n    optional uint32 i4 = 4 [default = 123];\n  }\n\n  message Sint32s {\n    optional sint32 i1 = 1 [default = 123];\n    optional sint32 i2 = 2 [default = 123];\n    optional sint32 i3 = 3 [default = 123];\n    optional sint32 i4 = 4 [default = 123];\n  }\n\n  message Fixed32s {\n    optional fixed32 i1 = 1 [default = 123];\n    optional fixed32 i2 = 2 [default = 123];\n    optional fixed32 i3 = 3 [default = 123];\n    optional fixed32 i4 = 4 [default = 123];\n  }\n\n  message Sfixed32s {\n    optional sfixed32 i1 = 1 [default = 123];\n    optional sfixed32 i2 = 2 [default = 123];\n    optional sfixed32 i3 = 3 [default = 123];\n    optional sfixed32 i4 = 4 [default = 123];\n  }\n\n  message Int64s {\n    optional int64 i1 = 1 [default = 123];\n    optional int64 i2 = 2 [default = 123];\n    optional int64 i3 = 3 [default = 123];\n    optional int64 i4 = 4 [default = 123];\n  }\n\n  message Uint64s {\n    optional uint64 i1 = 1 [default = 123];\n    optional uint64 i2 = 2 [default = 123];\n    optional uint64 i3 = 3 [default = 123];\n    optional uint64 i4 = 4 [default = 123];\n  }\n\n  message Sint64s {\n    optional sint64 i1 = 1 [default = 123];\n    optional sint64 i2 = 2 [default = 123];\n    optional sint64 i3 = 3 [default = 123];\n    optional sint64 i4 = 4 [default = 123];\n  }\n\n  message Fixed64s {\n    optional fixed64 i1 = 1 [default = 123];\n    optional fixed64 i2 = 2 [default = 123];\n    optional fixed64 i3 = 3 [default = 123];\n    optional fixed64 i4 = 4 [default = 123];\n  }\n\n  message Sfixed64s {\n    optional sfixed64 i1 = 1 [default = 123];\n    optional sfixed64 i2 = 2 [default = 123];\n    optional sfixed64 i3 = 3 [default = 123];\n    optional sfixed64 i4 = 4 [default = 123];\n  }\n\n  message Floats {\n    optional float i1 = 1 [default = 123];\n    optional float i2 = 2 [default = 123];\n    optional float i3 = 3 [default = 123];\n    optional float i4 = 4 [default = 123];\n  }\n\n  message Doubles {\n    optional double i1 = 1 [default = 123];\n    optional double i2 = 2 [default = 123];\n    optional double i3 = 3 [default = 123];\n    optional double i4 = 4 [default = 123];\n  }\n\n  message Bools {\n    optional bool i1 = 1 [default = true];\n    optional bool i2 = 2 [default = true];\n    optional bool i3 = 3 [default = true];\n    optional bool i4 = 4 [default = true];\n  }\n\n  message Enums {\n    optional Enum i1 = 1 [default = ABC];\n    optional Enum i2 = 2 [default = ABC];\n    optional Enum i3 = 3 [default = ABC];\n    optional Enum i4 = 4 [default = ABC];\n\n    enum Enum {\n      ZERO = 0;\n      ABC = 1;\n      DEF = 2;\n      XYZ = 3;\n    }\n  }\n}\n\nmessage Bar {\n  map<string, int32> map = 1;\n  repeated string strings = 2;\n  repeated uint64 uints = 3;\n  optional Bar bar = 4;\n  repeated Bar bars = 5;\n}\n\nmessage Baz {\n  map<string, int32> map = 1;\n  repeated string strings = 2;\n  repeated uint64 uints = 3;\n  optional Bar bar = 4;\n  repeated Bar bars = 5;\n\n  extensions 100 to 200;\n\n  extend Baz {\n    optional string s = 200;\n    optional bool b = 199 [default = true];\n    optional fixed32 f32 = 198 [default = 123];\n    optional sint64 s64 = 197 [default = -456];\n    optional float f = 196 [default = 0.1020304];\n  }\n}\n\nextend Baz {\n  optional uint32 u1 = 100 [default = 3456];\n  optional uint32 u2 = 101 [default = 9876];\n  optional bytes b1 = 102 [default = \"abcdef\"];\n  optional bytes b2 = 103 [default = \"a1b2c3\"];\n  repeated Baz bb1 = 104;\n  optional string s1 = 105 [default = \"abc\"];\n  optional string s2 = 106 [default = \"xyz\"];\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_default/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Fizz {\n  string s1 = 1;\n  string s2 = 2;\n  string s3 = 3;\n\n  bytes b1 = 5;\n  bytes b2 = 6;\n  bytes b3 = 7;\n\n  message Int32s {\n    int32 i1 = 1;\n    int32 i2 = 2;\n    int32 i3 = 3;\n  }\n\n  message Uint32s {\n    uint32 i1 = 1;\n    uint32 i2 = 2;\n    uint32 i3 = 3;\n  }\n\n  message Sint32s {\n    sint32 i1 = 1;\n    sint32 i2 = 2;\n    sint32 i3 = 3;\n  }\n\n  message Fixed32s {\n    fixed32 i1 = 1;\n    fixed32 i2 = 2;\n    fixed32 i3 = 3;\n  }\n\n  message Sfixed32s {\n    sfixed32 i1 = 1;\n    sfixed32 i2 = 2;\n    sfixed32 i3 = 3;\n  }\n\n  message Int64s {\n    int64 i1 = 1;\n    int64 i2 = 2;\n    int64 i3 = 3;\n  }\n\n  message Uint64s {\n    uint64 i1 = 1;\n    uint64 i2 = 2;\n    uint64 i3 = 3;\n  }\n\n  message Sint64s {\n    sint64 i1 = 1;\n    sint64 i2 = 2;\n    sint64 i3 = 3;\n  }\n\n  message Fixed64s {\n    fixed64 i1 = 1;\n    fixed64 i2 = 2;\n    fixed64 i3 = 3;\n  }\n\n  message Sfixed64s {\n    sfixed64 i1 = 1;\n    sfixed64 i2 = 2;\n    sfixed64 i3 = 3;\n  }\n\n  message Floats {\n    float i1 = 1;\n    float i2 = 2;\n    float i3 = 3;\n  }\n\n  message Doubles {\n    double i1 = 1;\n    double i2 = 2;\n    double i3 = 3;\n  }\n\n  message Bools {\n    bool i1 = 1;\n    bool i2 = 2;\n    bool i3 = 3;\n  }\n}\n\nmessage Buzz {\n  map<string, int32> map = 1;\n  repeated string strings = 2;\n  repeated uint64 uints = 3;\n  Buzz buzz = 4;\n  repeated Buzz buzzes = 5;\n}\n\nextend google.protobuf.MessageOptions {\n  uint32 num = 10000;\n  repeated string strings = 10101;\n  Buzz buzz = 20202;\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_java_utf8_validation/1.proto",
    "content": "syntax = \"proto2\";\npackage a;\n\nmessage A1 {\n  extensions 100 to 1000;\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A1 other4 = 14;\n}\n\nmessage A2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A2 other4 = 14;\n}\n\nmessage A3 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A3 other4 = 14;\n}\n\nmessage A4 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A4 other4 = 14;\n}\n\nmessage A5 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A5 other4 = 14;\n}\n\nmessage A6 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional A6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend A1 {\n    optional string a1_s1 = 100;\n    repeated string a1_s2 = 101;\n  }\n}\n\nextend A6 {\n  optional string a6_s1 = 100;\n  repeated string a6_s2 = 101;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_java_utf8_validation/2.proto",
    "content": "syntax = \"proto2\";\npackage a;\n\noption java_string_check_utf8 = true;\n\nmessage B1 {\n  extensions 100 to 1000;\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B1 other4 = 14;\n}\n\nmessage B2 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B2 other4 = 14;\n}\n\nmessage B3 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B3 other4 = 14;\n}\n\nmessage B4 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B4 other4 = 14;\n}\n\nmessage B5 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B5 other4 = 14;\n}\n\nmessage B6 {\n  optional string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  optional uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  optional B6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend B1 {\n    optional string b1_s1 = 100;\n    repeated string b1_s2 = 101;\n  }\n}\n\nextend B6 {\n  optional string b6_s1 = 100;\n  repeated string b6_s2 = 101;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_java_utf8_validation/3.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage C1 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C1 other4 = 14;\n}\n\nmessage C2 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C2 other4 = 14;\n}\n\nmessage C3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C3 other4 = 14;\n}\n\nmessage C4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C4 other4 = 14;\n}\n\nmessage C5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C5 other4 = 14;\n}\n\nmessage C6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  C6 other4 = 14;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_java_utf8_validation/4.proto",
    "content": "edition = \"2023\";\npackage a;\n\nimport \"google/protobuf/java_features.proto\";\n\nmessage D1 {\n  extensions 100 to 1000;\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D1 other4 = 14;\n}\n\nmessage D2 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D2 other4 = 14;\n}\n\nmessage D3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D3 other4 = 14;\n}\n\nmessage D4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D4 other4 = 14;\n}\n\nmessage D5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D5 other4 = 14;\n}\n\nmessage D6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend D1 {\n    string d1_s1 = 100 [features.(pb.java).utf8_validation=VERIFY];\n    repeated string d1_s2 = 101;\n  }\n}\n\nextend D6 {\n  string d6_s1 = 100 [features.(pb.java).utf8_validation=VERIFY];\n  repeated string d6_s2 = 101;\n}\n\nmessage D7 {\n  string s1 = 1 [features.(pb.java).utf8_validation=VERIFY];\n  repeated string s2 = 2 [features.(pb.java).utf8_validation=DEFAULT];\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=VERIFY];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D7 other4 = 14;\n}\n\nmessage D8 {\n  string s1 = 1 [features.(pb.java).utf8_validation=VERIFY];\n  repeated string s2 = 2 [features.(pb.java).utf8_validation=DEFAULT];\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=VERIFY];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  D8 other4 = 14;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_java_utf8_validation/5.proto",
    "content": "edition = \"2023\";\npackage a;\n\nimport \"google/protobuf/java_features.proto\";\n\noption features.(pb.java).utf8_validation = VERIFY;\n\nmessage E1 {\n  extensions 100 to 1000;\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E1 other4 = 14;\n}\n\nmessage E2 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E2 other4 = 14;\n}\n\nmessage E3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E3 other4 = 14;\n}\n\nmessage E4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E4 other4 = 14;\n}\n\nmessage E5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E5 other4 = 14;\n}\n\nmessage E6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend E1 {\n    string e1_s1 = 100 [features.(pb.java).utf8_validation=DEFAULT];\n    repeated string e1_s2 = 101;\n  }\n}\n\nextend E6 {\n  string e6_s1 = 100 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string e6_s2 = 101;\n}\n\nmessage E7 {\n  string s1 = 1 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string s2 = 2 [features.(pb.java).utf8_validation=VERIFY];\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E7 other4 = 14;\n}\n\nmessage E8 {\n  string s1 = 1 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string s2 = 2 [features.(pb.java).utf8_validation=VERIFY];\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  E8 other4 = 14;\n\n  extensions 100 to 1000;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_java_utf8_validation/6.proto",
    "content": "edition = \"2023\";\npackage a;\n\nimport \"google/protobuf/java_features.proto\";\n\noption features.utf8_validation = NONE;\noption features.(pb.java).utf8_validation = VERIFY;\n\nmessage F1 {\n  extensions 100 to 1000;\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F1 other4 = 14;\n}\n\nmessage F2 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F2 other4 = 14;\n}\n\nmessage F3 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F3 other4 = 14;\n}\n\nmessage F4 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F4 other4 = 14;\n}\n\nmessage F5 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F5 other4 = 14;\n}\n\nmessage F6 {\n  string s1 = 1;\n  repeated string s2 = 2;\n  map<string, string> s3 = 3;\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F6 other4 = 14;\n\n  extensions 100 to 1000;\n\n  extend F1 {\n    string f1_s1 = 100 [features.(pb.java).utf8_validation=DEFAULT];\n    repeated string f1_s2 = 101;\n  }\n}\n\nextend F6 {\n  string f6_s1 = 100 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string f6_s2 = 101;\n}\n\nmessage F7 {\n  string s1 = 1 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string s2 = 2 [features.(pb.java).utf8_validation=VERIFY];\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F7 other4 = 14;\n}\n\nmessage F8 {\n  string s1 = 1 [features.(pb.java).utf8_validation=DEFAULT];\n  repeated string s2 = 2 [features.(pb.java).utf8_validation=VERIFY];\n  map<string, string> s3 = 3 [features.(pb.java).utf8_validation=DEFAULT];\n\n  uint32 other1 = 11;\n  repeated double other2 = 12;\n  map<uint64, bytes> other3 = 13;\n  F8 other4 = 14;\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_json_name/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1 [json_name = \"foo\"];\n  int32 two = 2 [json_name = \"\" ];\n  int32 three = 3;\n  repeated int32 four = 4 [json_name = \"bar\"];\n  repeated int32 five = 5 [json_name = \"1\" ];\n  repeated int32 six = 6;\n  map<int32, int32> seven = 7 [json_name = \"baz\"];\n  map<int32, int32> eight = 8 [json_name = \"2\" ];\n  map<int32, int32> nine = 9;\n}\n\nmessage Two {\n  int32 one = 1 [json_name = \"foo\"];\n  int32 two = 2 [json_name = \"\" ];\n  int32 three = 3;\n  repeated int32 four = 4 [json_name = \"bar\"];\n  repeated int32 five = 5 [json_name = \"1\" ];\n  repeated int32 six = 6;\n  map<int32, int32> seven = 7 [json_name = \"baz\"];\n  map<int32, int32> eight = 8 [json_name = \"2\" ];\n  map<int32, int32> nine = 9;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1 [json_name = \"foo\"];\n      int32 two = 2 [json_name = \"\" ];\n      int32 three = 3;\n      repeated int32 four = 4 [json_name = \"bar\"];\n      repeated int32 five = 5 [json_name = \"2\" ];\n      repeated int32 six = 6;\n      map<int32, int32> seven = 7 [json_name = \"baz\"];\n      map<int32, int32> eight = 8 [json_name = \"3\" ];\n      map<int32, int32> nine = 9;\n    }\n    message Six {\n      int32 one = 1 [json_name = \"foo\"];\n      int32 two = 2 [json_name = \"\" ];\n      int32 three = 3;\n      repeated int32 four = 4 [json_name = \"bar\"];\n      repeated int32 five = 5 [json_name = \"1\" ];\n      repeated int32 six = 6;\n      map<int32, int32> seven = 7 [json_name = \"baz\"];\n      map<int32, int32> eight = 8 [json_name = \"2\" ];\n      map<int32, int32> nine = 9;\n    }\n  }\n  message Seven {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n    repeated int32 four = 4 [json_name = \"bar\"];\n    repeated int32 five = 5 [json_name = \"1\" ];\n    repeated int32 six = 6;\n    map<int32, int32> seven = 7 [json_name = \"baz\"];\n    map<int32, int32> eight = 8 [json_name = \"2\" ];\n    map<int32, int32> nine = 9;\n  }\n  message Eight {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n    repeated int32 four = 4 [json_name = \"bar\"];\n    repeated int32 five = 5 [json_name = \"1\" ];\n    repeated int32 six = 6;\n    map<int32, int32> seven = 7 [json_name = \"baz\"];\n    map<int32, int32> eight = 8 [json_name = \"2\" ];\n    map<int32, int32> nine = 9;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_json_name/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {\n  int32 one = 1 [json_name = \"foo\"];\n  int32 two = 2 [json_name = \"\" ];\n  int32 three = 3;\n  repeated int32 four = 4 [json_name = \"bar\"];\n  repeated int32 five = 5 [json_name = \"1\" ];\n  repeated int32 six = 6;\n  map<int32, int32> seven = 7 [json_name = \"baz\"];\n  map<int32, int32> eight = 8 [json_name = \"2\" ];\n  map<int32, int32> nine = 9;\n}\n\nmessage Two2 {\n  int32 one = 1 [json_name = \"foo\"];\n  int32 two = 2 [json_name = \"\" ];\n  int32 three = 3;\n  repeated int32 four = 4 [json_name = \"bar\"];\n  repeated int32 five = 5 [json_name = \"1\" ];\n  repeated int32 six = 6;\n  map<int32, int32> seven = 7 [json_name = \"baz\"];\n  map<int32, int32> eight = 8 [json_name = \"2\" ];\n  map<int32, int32> nine = 9;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      int32 one = 1 [json_name = \"foo\"];\n      int32 two = 2 [json_name = \"\" ];\n      int32 three = 3;\n      repeated int32 four = 4 [json_name = \"bar\"];\n      repeated int32 five = 5 [json_name = \"1\" ];\n      repeated int32 six = 6;\n      map<int32, int32> seven = 7 [json_name = \"baz\"];\n      map<int32, int32> eight = 8 [json_name = \"2\" ];\n      map<int32, int32> nine = 9;\n    }\n    message Six2 {\n      int32 one = 1 [json_name = \"foo\"];\n      int32 two = 2 [json_name = \"\" ];\n      int32 three = 3;\n      repeated int32 four = 4 [json_name = \"bar\"];\n      repeated int32 five = 5 [json_name = \"1\" ];\n      repeated int32 six = 6;\n      map<int32, int32> seven = 7 [json_name = \"baz\"];\n      map<int32, int32> eight = 8 [json_name = \"2\" ];\n      map<int32, int32> nine = 9;\n    }\n  }\n  message Seven2 {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n    repeated int32 four = 4 [json_name = \"bar\"];\n    repeated int32 five = 5 [json_name = \"1\" ];\n    repeated int32 six = 6;\n    map<int32, int32> seven = 7 [json_name = \"baz\"];\n    map<int32, int32> eight = 8 [json_name = \"2\" ];\n    map<int32, int32> nine = 9;\n  }\n  message Eight2 {\n    int32 one = 1 [json_name = \"foo\"];\n    int32 two = 2 [json_name = \"\" ];\n    int32 three = 3;\n    repeated int32 four = 4 [json_name = \"bar\"];\n    repeated int32 five = 5 [json_name = \"1\" ];\n    repeated int32 six = 6;\n    map<int32, int32> seven = 7 [json_name = \"baz\"];\n    map<int32, int32> eight = 8 [json_name = \"2\" ];\n    map<int32, int32> nine = 9;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_jstype/1.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage One {\n  int64 one = 1 [jstype = JS_NORMAL];\n  int64 two = 2 [jstype = JS_STRING];\n}\n\nmessage Two {\n  int64 one = 1 [jstype = JS_NORMAL];\n  int64 two = 2 [jstype = JS_STRING];\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int64 one = 1 [jstype = JS_NORMAL];\n      int64 two = 2 [jstype = JS_STRING];\n    }\n    message Six {\n      int64 one = 1;\n      int64 two = 2;\n    }\n  }\n  message Seven {\n    int64 one = 1;\n    int64 two = 2;\n  }\n  message Eight {\n    int64 one = 1;\n    int64 two = 2;\n  }\n  int64 one = 1;\n  int64 two = 2;\n}\n\nmessage Nine {\n  int64 one = 1 [jstype = JS_NORMAL];\n  int64 two = 2 [jstype = JS_STRING];\n\n  extend google.protobuf.FileOptions {\n    uint64 f1 = 10001;\n    sint64 f2 = 10002 [jstype = JS_STRING];\n    int64 f3 = 10003 [jstype = JS_NUMBER];\n    fixed64 f4 = 10004 [jstype = JS_NORMAL];\n    sfixed64 f5 = 10005 [jstype = JS_STRING];\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_jstype/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  optional int64 one = 1 [jstype = JS_NUMBER];\n  required int64 two = 2 [jstype = JS_STRING];\n}\n\nmessage Two2 {\n  optional int64 one = 1 [jstype = JS_NUMBER];\n  required int64 two = 2 [jstype = JS_STRING];\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int64 one = 1 [jstype = JS_NUMBER];\n      required int64 two = 2 [jstype = JS_STRING];\n    }\n    message Six2 {\n      optional int64 one = 1;\n      required int64 two = 2;\n    }\n  }\n  message Seven2 {\n    optional int64 one = 1;\n    required int64 two = 2;\n  }\n  message Eight2 {\n    optional int64 one = 1;\n    required int64 two = 2;\n  }\n  optional int64 one = 1;\n  required int64 two = 2;\n}\n\nmessage Nine2 {\n  optional int64 one = 1 [jstype = JS_NUMBER];\n  required int64 two = 2 [jstype = JS_STRING];\n\n  extensions 100 to 1000;\n}\n\nextend Nine2 {\n  optional sint64 s1 = 101 [jstype = JS_NORMAL];\n  optional sint64 s2 = 102 [jstype = JS_NUMBER];\n  optional sint64 s3 = 103 [jstype = JS_STRING];\n  optional sint64 s4 = 104;\n  optional sint64 s5 = 105;\n  optional sint64 s6 = 106 [jstype = JS_STRING];\n  optional sint64 s7 = 107 [jstype = JS_NUMBER];\n  optional sint64 s8 = 108 [jstype = JS_NORMAL];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_label/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Two {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n  message Eight {\n    optional int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten {\n  int64 one = 1;\n  int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_label/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"1.proto\";\n\nmessage One2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_name/1.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n\n  extend google.protobuf.MessageOptions {\n    string msg_str_opt = 10101;\n  }\n}\n\nextend google.protobuf.FileOptions {\n  string file_str_opt = 10101;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_name/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional int32 two = 2;\n      optional int32 three = 3;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional int32 two = 2;\n    optional int32 three = 3;\n    extend Three2 {\n      repeated uint64 uint_opt = 101;\n      optional string str_opt = 102;\n      optional bool bool_opt = 103;\n    }\n  }\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n\n  extensions 100 to 1000;\n}\n\nmessage Nine2 {\n  optional int32 one = 1;\n  optional int32 two = 2;\n  optional int32 three = 3;\n\n  extensions 100 to 1000;\n}\n\nextend Nine2 {\n  repeated uint64 uint_opt = 101;\n  optional string str_opt = 102;\n  optional bool bool_opt = 103;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_oneof/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n  optional string four = 4;\n}\n\nmessage Two {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      oneof foo {\n        int32 one = 1;\n      }\n      oneof bar {\n        int32 two = 2;\n      }\n      int32 three = 3;\n    }\n    message Six {\n      oneof foo {\n        int32 one = 1;\n      }\n      oneof bar {\n        int32 two = 2;\n      }\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    oneof foo {\n      int32 one = 1;\n    }\n    oneof bar {\n      int32 two = 2;\n    }\n    int32 three = 3;\n  }\n  message Eight {\n    oneof foo {\n      int32 one = 1;\n    }\n    oneof bar {\n      int32 two = 2;\n    }\n    int32 three = 3;\n  }\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_oneof/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Two2 {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      oneof foo {\n        int32 one = 1;\n      }\n      oneof bar {\n        int32 two = 2;\n      }\n      int32 three = 3;\n    }\n    message Six2 {\n      oneof foo {\n        int32 one = 1;\n      }\n      oneof bar {\n        int32 two = 2;\n      }\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    oneof foo {\n      int32 one = 1;\n    }\n    oneof bar {\n      int32 two = 2;\n    }\n    int32 three = 3;\n  }\n  message Eight2 {\n    oneof foo {\n      int32 one = 1;\n    }\n    oneof bar {\n      int32 two = 2;\n    }\n    int32 three = 3;\n  }\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n  }\n  oneof bar {\n    int32 two = 2;\n  }\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_type/1.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage One {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Two {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n  message Eight {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten {\n  int64 one = 1;\n  int64 two = 2;\n}\n\nextend google.protobuf.FieldOptions {\n  repeated Ten ten_option = 10101;\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_type/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"1.proto\";\n\nmessage One2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten2 {\n  optional group Foo = 1 {\n  }\n\n  extensions 100 to 1000;\n\n  extend Ten2 {\n    optional string ten2_str = 100;\n    optional Ten2 ten2_msg = 101;\n    optional uint32 ten2_uint32 = 102;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_type/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage One3 {\n  One3 normal = 1;\n  One3 delimited = 2 [features.message_encoding=DELIMITED];\n  One3 normal_b = 3;\n  One3 delimited_b = 4 [features.message_encoding=DELIMITED];\n\n  extensions 100 to 1000;\n}\n\nextend One3 {\n  string one3_str = 100;\n  One3 one3_msg = 101;\n  uint32 one3_uint32 = 102;\n}"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_utf8_validation/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage A1 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional A1 msg = 6;\n  optional int32 int = 7;\n}\n\nmessage A2 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional A2 msg = 6;\n  optional int32 int = 7;\n}\n\nmessage A3 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional A3 msg = 6;\n  optional int32 int = 7;\n}\n\nmessage A4 {\n  optional string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  optional A4 msg = 6;\n  optional int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_utf8_validation/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage B1 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  B1 msg = 6;\n  int32 int = 7;\n}\n\nmessage B2 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  B2 msg = 6;\n  int32 int = 7;\n}\n\nmessage B3 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  B3 msg = 6;\n  int32 int = 7;\n}\n\nmessage B4 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  B4 msg = 6;\n  int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_utf8_validation/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage C1 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  C1 msg = 6;\n  int32 int = 7;\n}\n\nmessage C2 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  C2 msg = 6;\n  int32 int = 7;\n}\n\nmessage C3 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  C3 msg = 6;\n  int32 int = 7;\n}\n\nmessage C4 {\n  string str = 1 [features.utf8_validation = NONE];\n  repeated string strs = 2 [features.utf8_validation = NONE];\n  map<string, int32> str2int = 3 [features.utf8_validation = NONE];\n  map<int32, string> int2str = 4 [features.utf8_validation = NONE];\n  map<string, string> str2str = 5 [features.utf8_validation = NONE];\n  C4 msg = 6;\n  int32 int = 7;\n}\n\nmessage C5 {\n  string str = 1 [features.utf8_validation = NONE];\n  repeated string strs = 2 [features.utf8_validation = NONE];\n  map<string, int32> str2int = 3 [features.utf8_validation = NONE];\n  map<int32, string> int2str = 4 [features.utf8_validation = NONE];\n  map<string, string> str2str = 5 [features.utf8_validation = NONE];\n  C5 msg = 6;\n  int32 int = 7;\n}\n\nmessage C6 {\n  string str = 1 [features.utf8_validation = NONE];\n  repeated string strs = 2 [features.utf8_validation = NONE];\n  map<string, int32> str2int = 3 [features.utf8_validation = NONE];\n  map<int32, string> int2str = 4 [features.utf8_validation = NONE];\n  map<string, string> str2str = 5 [features.utf8_validation = NONE];\n  C6 msg = 6;\n  int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_same_utf8_validation/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.utf8_validation = NONE;\n\nmessage D1 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  D1 msg = 6;\n  int32 int = 7;\n}\n\nmessage D2 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  D2 msg = 6;\n  int32 int = 7;\n}\n\nmessage D3 {\n  string str = 1;\n  repeated string strs = 2;\n  map<string, int32> str2int = 3;\n  map<int32, string> int2str = 4;\n  map<string, string> str2str = 5;\n  D3 msg = 6;\n  int32 int = 7;\n}\n\nmessage D4 {\n  string str = 1 [features.utf8_validation = VERIFY];\n  repeated string strs = 2 [features.utf8_validation = VERIFY];\n  map<string, int32> str2int = 3 [features.utf8_validation = VERIFY];\n  map<int32, string> int2str = 4 [features.utf8_validation = VERIFY];\n  map<string, string> str2str = 5 [features.utf8_validation = VERIFY];\n  D4 msg = 6;\n  int32 int = 7;\n}\n\nmessage D5 {\n  string str = 1 [features.utf8_validation = VERIFY];\n  repeated string strs = 2 [features.utf8_validation = VERIFY];\n  map<string, int32> str2int = 3 [features.utf8_validation = VERIFY];\n  map<int32, string> int2str = 4 [features.utf8_validation = VERIFY];\n  map<string, string> str2str = 5 [features.utf8_validation = VERIFY];\n  D5 msg = 6;\n  int32 int = 7;\n}\n\nmessage D6 {\n  string str = 1 [features.utf8_validation = VERIFY];\n  repeated string strs = 2 [features.utf8_validation = VERIFY];\n  map<string, int32> str2int = 3 [features.utf8_validation = VERIFY];\n  map<int32, string> int2str = 4 [features.utf8_validation = VERIFY];\n  map<string, string> str2str = 5 [features.utf8_validation = VERIFY];\n  D6 msg = 6;\n  int32 int = 7;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_compatible_cardinality/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Two {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n  message Eight {\n    optional int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten {\n  int64 one = 1;\n  int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_compatible_cardinality/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"1.proto\";\n\nmessage One2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_compatible_cardinality/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_compatible_type/1.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage CompatiblePrimitives {\n  int32 int32_field_1 = 1;\n  uint32 uint32_field_1 = 2;\n  int64 int64_field_1 = 3;\n  uint64 uint64_field_1 = 4;\n  bool bool_field_1 = 5;\n\n  sint32 sint32_field_1 = 6;\n  sint64 sint64_field_1 = 7;\n\n  fixed32 fixed32_field_1 = 8;\n  sfixed32 sfixed32_field_1 = 9;\n\n  fixed64 fixed64_field_1 = 10;\n  sfixed64 sfixed64_field_1 = 11;\n\n  string string_field_1 = 12;\n\n  bytes bytes_field_1 = 14;\n\n  float float_field_1 = 15;\n\n  double double_field_1 = 16;\n}\n\nmessage IncompatiblePrimitives {\n  int32 int32_field_1 = 1;\n  uint32 uint32_field_1 = 2;\n  int64 int64_field_1 = 3;\n  uint64 uint64_field_1 = 4;\n  bool bool_field_1 = 5;\n  sint32 sint32_field_1 = 6;\n  sint64 sint64_field_1 = 7;\n  fixed32 fixed32_field_1 = 8;\n  sfixed32 sfixed32_field_1 = 9;\n  fixed64 fixed64_field_1 = 10;\n  sfixed64 sfixed64_field_1 = 11;\n  string string_field_1 = 12;\n  bytes bytes_field_1 = 14;\n  float float_field_1 = 15;\n  double double_field_1 = 16;\n}\n\n\nenum Foo {\n  FOO_UNSPECIFIED = 0;\n  FOO_ONE = 1;\n}\n\nmessage WithCompatibleEnums {\n  enum Baz {\n    BAZ_UNSPECIFIED = 0;\n    BAZ_ONE = 1;\n  }\n  Foo foo = 1;\n  Baz baz = 2;\n}\n\nenum Bar {\n  BAR_UNSPECIFIED = 0;\n  BAR_ONE = 1;\n}\n\nmessage WithIncompatibleEnums {\n  enum Bat {\n    BAT_UNSPECIFIED = 0;\n    BAT_ONE = 1;\n  }\n  enum Bam {\n    BAM_UNSPECIFIED = 0;\n    BAM_ONE = 1;\n  }\n  Bar bar = 1;\n  Bat bat = 2;\n  Bam bam = 3;\n}\n\nmessage StringBytes {\n  string string_field_1 = 1;\n  bytes bytes_field_1 = 2;\n}\n\nextend google.protobuf.FieldOptions {\n  repeated Bar bar_option = 10101;\n  string str_option = 10102;\n  bytes byt_option = 10103;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_compatible_type/2.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Message {\n  Message normal = 1;\n  Message delimited = 2 [features.message_encoding=DELIMITED];\n  Message normal_b = 3;\n  Message delimited_b = 4 [features.message_encoding=DELIMITED];\n\n  extensions 100 to 1000;\n\n  extend Message {\n    string str = 100;\n    Message msg = 101;\n    uint32 uint32 = 102;\n  }\n}\n\nextend Message {\n  string str = 200;\n  Message msg = 201;\n  uint32 uint32 = 202;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_json_compatible_cardinality/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Two {\n  int32 one = 1;\n  One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n  map<int32, int32> five = 5;\n  map<int32, One> six = 6;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n    message Six {\n      int32 one = 1;\n      One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n      map<int32, int32> five = 5;\n      map<int32, One> six = 6;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n  message Eight {\n    optional int32 one = 1;\n    One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n    map<int32, int32> five = 5;\n    map<int32, One> six = 6;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten {\n  int64 one = 1;\n  int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_json_compatible_cardinality/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"1.proto\";\n\nmessage One2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Two2 {\n  optional int32 one = 1;\n  optional One two = 2;\n  repeated int32 three = 3;\n  repeated One four = 4;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n    message Six2 {\n      optional int32 one = 1;\n      optional One two = 2;\n      repeated int32 three = 3;\n      repeated One four = 4;\n    }\n  }\n  message Seven2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n  message Eight2 {\n    optional int32 one = 1;\n    optional One two = 2;\n    repeated int32 three = 3;\n    repeated One four = 4;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    One two = 2;\n  }\n}\n\nmessage Ten2 {\n  repeated int64 one = 1;\n  required int64 two = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_json_compatible_cardinality/3.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_json_compatible_type/1.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage CompatiblePrimitives {\n  int32 int32_field_1 = 1;\n  uint32 uint32_field_1 = 2;\n\n  int64 int64_field_1 = 3;\n  uint64 uint64_field_1 = 4;\n\n  fixed32 fixed32_field_1 = 5;\n  sfixed32 sfixed32_field_1 = 6;\n\n  fixed64 fixed64_field_1 = 7;\n  sfixed64 sfixed64_field_1 = 8;\n\n  bool bool_field_1 = 9;\n\n  sint32 sint32_field_1 = 10;\n\n  sint64 sint64_field_1 = 11;\n\n  string string_field_1 = 12;\n\n  bytes bytes_field_1 = 14;\n\n  float float_field_1 = 15;\n\n  double double_field_1 = 16;\n}\n\nmessage IncompatiblePrimitives {\n  int32 int32_field_1 = 1;\n  uint32 uint32_field_1 = 2;\n  int64 int64_field_1 = 3;\n  uint64 uint64_field_1 = 4;\n  bool bool_field_1 = 5;\n  sint32 sint32_field_1 = 6;\n  sint64 sint64_field_1 = 7;\n  fixed32 fixed32_field_1 = 8;\n  sfixed32 sfixed32_field_1 = 9;\n  fixed64 fixed64_field_1 = 10;\n  sfixed64 sfixed64_field_1 = 11;\n  string string_field_1 = 12;\n  bytes bytes_field_1 = 14;\n  float float_field_1 = 15;\n  double double_field_1 = 16;\n}\n\n\nenum Foo {\n  FOO_UNSPECIFIED = 0;\n  FOO_ONE = 1;\n}\n\nmessage WithCompatibleEnums {\n  enum Baz {\n    BAZ_UNSPECIFIED = 0;\n    BAZ_ONE = 1;\n  }\n  Foo foo = 1;\n  Baz baz = 2;\n}\n\nenum Bar {\n  BAR_UNSPECIFIED = 0;\n  BAR_ONE = 1;\n}\n\nmessage WithIncompatibleEnums {\n  enum Bat {\n    BAT_UNSPECIFIED = 0;\n    BAT_ONE = 1;\n  }\n  enum Bam {\n    BAM_UNSPECIFIED = 0;\n    BAM_ONE = 1;\n  }\n  Bar bar = 1;\n  Bat bat = 2;\n  Bam bam = 3;\n}\n\nmessage StringBytes {\n  string string_field_1 = 1;\n  bytes bytes_field_1 = 2;\n}\n\nextend google.protobuf.FieldOptions {\n  repeated Bar bar_option = 10101;\n  string str_option = 10102;\n  bytes byt_option = 10103;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_field_wire_json_compatible_type/2.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage Message {\n  Message normal = 1;\n  Message delimited = 2 [features.message_encoding=DELIMITED];\n  Message normal_b = 3;\n  Message delimited_b = 4 [features.message_encoding=DELIMITED];\n\n  extensions 100 to 1000;\n\n  extend Message {\n    string str = 100;\n    Message msg = 101;\n    uint32 uint32 = 102;\n  }\n}\n\nextend Message {\n  string str = 200;\n  Message msg = 201;\n  uint32 uint32 = 202;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete/buf.yaml",
    "content": "version: v1beta1\nbuild:\n  roots:\n    - root\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete/root/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete/root/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete/root/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete/root/sub/a/b/sub_a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_ignores/buf.yaml",
    "content": "version: v1beta1\nbuild:\n  roots:\n    - root\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_ignores/root/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_ignores/root/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_ignores/root/a/c/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_ignores/root/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_ignores/root/sub/a/b/sub_a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_unstable/a/v1beta1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_no_delete_unstable/a/v1beta1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_package/buf.yaml",
    "content": "version: v1beta1\nbuild:\n  roots:\n    - root\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_package/root/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_package/root/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_package/root/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_package/root/sub/a/b/sub_a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_syntax/buf.yaml",
    "content": "version: v1beta1\nbuild:\n  roots:\n    - root\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_syntax/root/a/a.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_syntax/root/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_syntax/root/no_package.proto",
    "content": "package a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_syntax/root/sub/a/b/sub_a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage sub.a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_values/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\noption java_package = \"foo\";\noption java_outer_classname = \"foo\";\noption java_multiple_files = true;\noption go_package = \"foo\";\noption objc_class_prefix = \"foo\";\noption csharp_namespace = \"foo\";\noption swift_prefix = \"foo\";\noption php_class_prefix = \"foo\";\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\noption ruby_package = \"foo\";\n\noption java_string_check_utf8 = true;\noption optimize_for = CODE_SIZE;\noption cc_generic_services = true;\noption java_generic_services = true;\noption py_generic_services = true;\n//option php_generic_services = true;\noption cc_enable_arenas = true;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_file_same_values/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_delete_file/a/v1beta1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nmessage A {}\n\nenum AEnum {\n  A_ENUM_UNSPECIFIED = 0;\n}\n\nservice AService{}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_delete_file/a/v1beta1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nmessage B {}\n\nenum BEnum {\n  B_ENUM_UNSPECIFIED = 0;\n}\n\nservice BService{}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/1.proto",
    "content": "syntax = \"proto3\";\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/2.proto",
    "content": "syntax = \"proto3\";\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/a/v1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/a/v1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/a/v1beta1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/a/v1beta1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_false/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/1.proto",
    "content": "syntax = \"proto3\";\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/2.proto",
    "content": "syntax = \"proto3\";\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/a/v1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/a/v1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/a/v1beta1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/a/v1beta1/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.v1beta1;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One {\n  ONE_UNSPECIFIED = 0;\n}\n\nenum Two {\n  TWO_UNSPECIFIED = 0;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      FIVE_UNSPECIFIED = 0;\n    }\n    enum Six {\n      SIX_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven {\n    SEVEN_UNSPECIFIED = 0;\n  }\n  enum Eight {\n    EIGHT_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_ignore_unstable_packages_true/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nenum One2 {\n  ONE_2_UNSPECIFIED = 0;\n}\n\nenum Two2 {\n  TWO_2_UNSPECIFIED = 0;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      FIVE_2_UNSPECIFIED = 0;\n    }\n    enum Six2 {\n      SIX_2_UNSPECIFIED = 0;\n    }\n  }\n  enum Seven2 {\n    SEVEN_2_UNSPECIFIED = 0;\n  }\n  enum Eight2 {\n    EIGHT_2_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_int_enum/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  Bar foo = 1;\n}\nenum Bar {\n  Blah = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_int_enum/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  int32 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_enum/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  Foo foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_enum/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  Bar2 foo = 1;\n}\nenum Bar2 {\n  Blah = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_int/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  int32 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_int/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  Foo2 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_message/1.proto",
    "content": "syntax = \"proto3\";\nmessage Foo {\n  Foo foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_message/2.proto",
    "content": "syntax = \"proto3\";\nmessage Foo2 {\n  Foo22 foo = 1;\n}\nmessage Foo22 {\n  int32 foo = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {}\n\nmessage Two {}\n\nmessage Three {\n  message Four {\n    message Five {}\n    message Six {}\n  }\n  message Seven{}\n  message Eight{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {}\n\nmessage Two2 {}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {}\n    message Six2 {}\n  }\n  message Seven2{}\n  message Eight2{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_json_format/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage A1 {\n  optional string s = 1;\n}\n\nmessage A2 {\n  optional string s = 1;\n}\n\nmessage A3 {\n  optional string s = 1;\n}\n\nmessage A4 {\n  optional string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_json_format/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage B1 {\n  string s = 1;\n}\n\nmessage B2 {\n  string s = 1;\n}\n\nmessage B3 {\n  string s = 1;\n}\n\nmessage B4 {\n  string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_json_format/3.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\nmessage C1 {\n  string s = 1;\n}\n\nmessage C2 {\n  string s = 1;\n}\n\nmessage C3 {\n  string s = 1;\n}\n\nmessage C4 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  string s = 1;\n}\n\nmessage C5 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  string s = 1;\n}\n\nmessage C6 {\n  option features.json_format = LEGACY_BEST_EFFORT;\n  string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_json_format/4.proto",
    "content": "edition = \"2023\";\n\npackage a;\n\noption features.json_format = LEGACY_BEST_EFFORT;\n\nmessage D1 {\n  string s = 1;\n}\n\nmessage D2 {\n  string s = 1;\n}\n\nmessage D3 {\n  string s = 1;\n}\n\nmessage D4 {\n  option features.json_format = ALLOW;\n  string s = 1;\n}\n\nmessage D5 {\n  option features.json_format = ALLOW;\n  string s = 1;\n}\n\nmessage D6 {\n  option features.json_format = ALLOW;\n  string s = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_required_fields/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  required string one = 1;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      required string one = 1;\n    }\n    message Six {\n      required string one = 1;\n    }\n  }\n  message Seven {\n    required string one = 1;\n  }\n  message Eight {}\n  required string one = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_required_fields/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  required string one = 1;\n}\n\nmessage Two {\n  required string one = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_values/1.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  option no_standard_descriptor_accessor = false;\n  extensions 4 to max;\n}\n\nmessage Two {\n  extensions 4 to max;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      option no_standard_descriptor_accessor = false;\n      extensions 4 to max;\n    }\n    message Six {}\n  }\n  message Seven {\n    option no_standard_descriptor_accessor = false;\n    extensions 4 to max;\n  }\n  message Eight {}\n  extensions 4 to max;\n}\n\nmessage Nine {\n  extensions 4 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_message_same_values/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One2 {\n  extensions 4 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_oneof_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  optional string four = 4;\n}\n\nmessage Two {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      oneof foo {\n        int32 one = 1;\n        int32 two = 2;\n        int32 three = 3;\n      }\n    }\n    message Six {\n      oneof foo {\n        int32 one = 1;\n        int32 two = 2;\n        int32 three = 3;\n      }\n    }\n  }\n  message Seven {\n    oneof foo {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Eight {\n    oneof foo {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Nine {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_oneof_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Two2 {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      oneof foo {\n        int32 one = 1;\n        int32 two = 2;\n        int32 three = 3;\n      }\n    }\n    message Six2 {\n      oneof foo {\n        int32 one = 1;\n        int32 two = 2;\n        int32 three = 3;\n      }\n    }\n  }\n  message Seven2 {\n    oneof foo {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Eight2 {\n    oneof foo {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n\nmessage Nine2 {\n  oneof foo {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_extension_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_extension_no_delete/2.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage Foo {\n  extensions 10 to 100;\n\n  message Bar {\n    optional int32 len = 1;\n\n    extend Foo {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Foo {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n  optional Foo ch = 22;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_extension_no_delete/3.proto",
    "content": "syntax = \"proto2\";\n\npackage b;\n\nmessage Fizz {\n  extensions 10 to 100;\n\n  message Buzz {\n    optional int32 len = 1;\n\n    extend Fizz {\n      optional string str = 10;\n      repeated string labels = 11;\n    }\n  }\n}\n\nextend Fizz {\n  optional bytes meta = 20;\n  repeated uint64 tags = 21;\n  optional Fizz child = 22;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_no_delete/a1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {}\n\nmessage Two {\n  enum EnumOne {\n    ENUM_ONE_UNSPECIFIED = 0;\n  }\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      enum EnumOne {\n        ENUM_ONE_UNSPECIFIED = 0;\n      }\n    }\n    message Six {}\n  }\n  message Seven {\n    enum EnumOne {\n      ENUM_ONE_UNSPECIFIED = 0;\n    }\n  }\n  message Eight {}\n}\n\nmessage Nine {}\n\nenum EnumOne {\n  ENUM_ONE_UNSPECIFIED = 0;\n}\n\nenum EnumTwo {\n  ENUM_TWO_UNSPECIFIED = 0;\n}\n\nservice Foo {}\nservice Bar {}\nservice Baz {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_no_delete/b1.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nmessage One {}\n\nmessage Two {\n  enum EnumOne {\n    ENUM_ONE_UNSPECIFIED = 0;\n  }\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      enum EnumOne {\n        ENUM_ONE_UNSPECIFIED = 0;\n      }\n    }\n    message Six {}\n  }\n  message Seven {\n    enum EnumOne {\n      ENUM_ONE_UNSPECIFIED = 0;\n    }\n  }\n  message Eight {}\n}\n\nmessage Nine {}\n\nenum EnumOne {\n  ENUM_ONE_UNSPECIFIED = 0;\n}\n\nenum EnumTwo {\n  ENUM_TWO_UNSPECIFIED = 0;\n}\n\nservice Foo {}\nservice Bar {}\nservice Baz {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - FILE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_no_delete/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_service_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice AService {\n  rpc ARPC(ARequest) returns (AResponse);\n}\n\nmessage ARequest {\n  string key = 1;\n}\n\nmessage AResponse {\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_service_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice BService {\n  rpc BRPC(BRequest) returns (BResponse);\n}\n\nmessage BRequest {\n  string key = 1;\n}\n\nmessage BResponse {\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_package_service_no_delete/buf.yaml",
    "content": "version: v1\nbreaking:\n  use:\n    - PACKAGE_SERVICE_NO_DELETE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_disablebuiltin/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage A {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_disablebuiltin/buf.yaml",
    "content": "version: v2\nbreaking:\n  disable_builtin: true\npolicies:\n  - policy: disablebuiltin.policy.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_disablebuiltin/disablebuiltin.policy.yaml",
    "content": "version: v2\nbreaking:\n  disable_builtin: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_empty/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage B {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_empty/buf.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\npolicies:\n  - policy: empty.policy.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_empty/empty.policy.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_local/a.proto",
    "content": "syntax = \"proto3\";\n\nservice ALegacy {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n  rpc GetATwo(GetATwoRequest) returns (GetATwoResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n  string page_token = 2;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n  string page_token = 2;\n}\n\nmessage GetATwoRequest {}\nmessage GetATwoResponse {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_local/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice B {\n  rpc GetB(GetBRequest) returns (GetBResponse);\n}\n\nmessage GetBRequest {}\nmessage GetBResponse {\n  enum BStatus {\n    B_STATUS_UNSPECIFIED = 0;\n    B_STATUS_VALID = 1;\n    B_STATUS_NEW = 2;\n  }\n  message ValueStable {\n    string name = 1;\n    BStatus status = 2;\n    string b_uuid = 3;\n  }\n  ValueStable value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_policy_local/buf.yaml",
    "content": "version: v2\nplugins:\n  - plugin: buf-plugin-suffix\n    options:\n      service_no_change_suffixes:\n        - Legacy\n        - Bridge\n      message_no_change_suffixes:\n        - Stable\n      enum_no_change_suffixes:\n        - Status\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_reserved_enum_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved 10 to 20, 50 to 75;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  ONE_UNSPECIFIED = 0;\n  ONE_ONE = 1;\n  ONE_TWO = 2;\n}\n\nenum Two {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  TWO_UNSPECIFIED = 0;\n  TWO_ONE = 1;\n  TWO_TWO = 2;\n}\n\nmessage Three {\n  message Four {\n    enum Five {\n      reserved 3 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six {\n      reserved 3 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven {\n    reserved 3 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight {\n    reserved 3 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  NINE_UNSPECIFIED = 0;\n  NINE_ONE = 1;\n  NINE_TWO = 2;\n}\n\nenum Ten {\n  reserved 1 to max;\n  TEN_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_reserved_enum_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum One2 {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  ONE2_UNSPECIFIED = 0;\n  ONE2_ONE = 1;\n  ONE2_TWO = 2;\n}\n\nenum Two2 {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  TWO2_UNSPECIFIED = 0;\n  TWO2_ONE = 1;\n  TWO2_TWO = 2;\n}\n\nmessage Three2 {\n  message Four2 {\n    enum Five2 {\n      reserved 3 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      FIVE_UNSPECIFIED = 0;\n      FIVE_ONE = 1;\n      FIVE_TWO = 2;\n    }\n    enum Six2 {\n      reserved 3 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      SIX_UNSPECIFIED = 0;\n      SIX_ONE = 1;\n      SIX_TWO = 2;\n    }\n  }\n  enum Seven2 {\n    reserved 3 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    SEVEN_UNSPECIFIED = 0;\n    SEVEN_ONE = 1;\n    SEVEN_TWO = 2;\n  }\n  enum Eight2 {\n    reserved 3 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    EIGHT_UNSPECIFIED = 0;\n    EIGHT_ONE = 1;\n    EIGHT_TWO = 2;\n  }\n}\n\nenum Nine2 {\n  reserved 3 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  NINE2_UNSPECIFIED = 0;\n  NINE2_ONE = 1;\n  NINE2_TWO = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_reserved_message_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved 10 to 20, 50 to 75;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three {\n  message Four {\n    message Five {\n      reserved 4 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six {\n      reserved 4 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven {\n    reserved 4 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight {\n    reserved 4 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Ten {\n  reserved 1 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_reserved_message_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One2 {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Two2 {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Three2 {\n  message Four2 {\n    message Five2 {\n      reserved 4 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n    message Six2 {\n      reserved 4 to 5, 100 to 200;\n      reserved 300, 301, 1000 to max;\n      reserved \"foo\", \"bar\";\n      reserved \"baz\";\n      int32 one = 1;\n      int32 two = 2;\n      int32 three = 3;\n    }\n  }\n  message Seven2 {\n    reserved 4 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  message Eight2 {\n    reserved 4 to 5, 100 to 200;\n    reserved 300, 301, 1000 to max;\n    reserved \"foo\", \"bar\";\n    reserved \"baz\";\n    int32 one = 1;\n    int32 two = 2;\n    int32 three = 3;\n  }\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n\nmessage Nine2 {\n  reserved 4 to 5, 100 to 200;\n  reserved 300, 301, 1000 to max;\n  reserved \"foo\", \"bar\";\n  reserved \"baz\";\n  int32 one = 1;\n  int32 two = 2;\n  int32 three = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_rpc_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice One {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Two {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Three {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_rpc_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice One2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Two2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\nservice Three2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_rpc_same_values/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice One {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Two {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Three {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Four {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = IDEMPOTENCY_UNKNOWN;\n  }\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_rpc_same_values/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice One2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Two2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Three2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Baz(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bat(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n\nservice Four2 {\n  rpc Foo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = IDEMPOTENCY_UNKNOWN;\n  }\n  rpc Baz(google.protobuf.Empty) returns (google.protobuf.Empty) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_service_no_delete/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice One {}\nservice Two {}\nservice Three {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/breaking/previous/breaking_service_no_delete/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice One2 {}\nservice Two2 {}\nservice Three2 {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_cascade_off/a.proto",
    "content": "syntax = \"proto3\";\n\n// To team members: I am sorry you have to read such a bad file.\n// To others: Do the opposite of whatever this file does.\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\n// buf:lint:ignore ENUM_PASCAL_CASE\n// buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\nenum enumFoo {\n  // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n  option allow_alias = true;\n  enumFooNone = 0;\n  enumFooOne = 1;\n  enumFooTwo = 1;\n}\n\n// buf:lint:ignore MESSAGE_PASCAL_CASE\n// buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n// buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\nmessage messageFoo {\n  // buf:lint:ignore MESSAGE_PASCAL_CASE\n  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n  message messageBar {\n    // buf:lint:ignore MESSAGE_PASCAL_CASE\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n    message messageBaz {\n      // buf:lint:ignore ENUM_PASCAL_CASE\n      // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n      enum enumFoo {\n        // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n        option allow_alias = true;\n        // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n        enumFooNone = 0;\n        enumFooOne = 1;\n        enumFooTwo = 1;\n      }\n      int64 Foo = 1;\n      oneof Bar {\n        int64 Baz = 2;\n      }\n    }\n    int64 Foo = 1;\n    oneof Bar {\n      int64 Baz = 2;\n    }\n  }\n  int64 Foo = 1;\n  oneof Bar {\n    int64 Baz = 2;\n  }\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\n// buf:lint:ignore RPC_PASCAL_CASE\n// buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\nservice serviceFoo {\n  rpc methodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\nservice serviceBar {\n  // buf:lint:ignore RPC_PASCAL_CASE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\n  rpc methodBar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_cascade_off/b.proto",
    "content": "syntax = \"proto2\";\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n// buf:lint:ignore PACKAGE_VERSION_SUFFIX\npackage a;\n\n// buf:lint:ignore ENUM_FIRST_VALUE_ZERO\nenum EnumFoo {\n  ENUM_FOO_UNSPECIFIED = 10;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_cascade_off/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_FIRST_VALUE_ZERO\n    - ENUM_PASCAL_CASE\n    - ENUM_NO_ALLOW_ALIAS\n    - ENUM_ZERO_VALUE_SUFFIX\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - ONEOF_LOWER_SNAKE_CASE\n    - SERVICE_PASCAL_CASE\n    - RPC_PASCAL_CASE\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_cascade_on/a.proto",
    "content": "syntax = \"proto3\";\n\n// To team members: I am sorry you have to read such a bad file.\n// To others: Do the opposite of whatever this file does.\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\n// buf:lint:ignore ENUM_PASCAL_CASE\n// buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\nenum enumFoo {\n  // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n  option allow_alias = true;\n  enumFooNone = 0;\n  enumFooOne = 1;\n  enumFooTwo = 1;\n}\n\n// buf:lint:ignore MESSAGE_PASCAL_CASE\n// buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n// buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\nmessage messageFoo {\n  // buf:lint:ignore MESSAGE_PASCAL_CASE\n  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n  message messageBar {\n    // buf:lint:ignore MESSAGE_PASCAL_CASE\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n    message messageBaz {\n      // buf:lint:ignore ENUM_PASCAL_CASE\n      // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n      enum enumFoo {\n        // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n        option allow_alias = true;\n        // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n        enumFooNone = 0;\n        enumFooOne = 1;\n        enumFooTwo = 1;\n      }\n      int64 Foo = 1;\n      oneof Bar {\n        int64 Baz = 2;\n      }\n    }\n    int64 Foo = 1;\n    oneof Bar {\n      int64 Baz = 2;\n    }\n  }\n  int64 Foo = 1;\n  oneof Bar {\n    int64 Baz = 2;\n  }\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\n// buf:lint:ignore RPC_PASCAL_CASE\n// buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\nservice serviceFoo {\n  rpc methodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\nservice serviceBar {\n  // buf:lint:ignore RPC_PASCAL_CASE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\n  rpc methodBar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_cascade_on/b.proto",
    "content": "syntax = \"proto2\";\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n// buf:lint:ignore PACKAGE_VERSION_SUFFIX\npackage a;\n\n// buf:lint:ignore ENUM_FIRST_VALUE_ZERO\nenum EnumFoo {\n  ENUM_FOO_UNSPECIFIED = 10;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_cascade_on/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_FIRST_VALUE_ZERO\n    - ENUM_PASCAL_CASE\n    - ENUM_NO_ALLOW_ALIAS\n    - ENUM_ZERO_VALUE_SUFFIX\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - ONEOF_LOWER_SNAKE_CASE\n    - SERVICE_PASCAL_CASE\n    - RPC_PASCAL_CASE\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n  allow_comment_ignores: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_multiple_fails/a.proto",
    "content": "syntax = \"proto3\";\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_multiple_fails/buf.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_off/a.proto",
    "content": "syntax = \"proto3\";\n\n// To team members: I am sorry you have to read such a bad file.\n// To others: Do the opposite of whatever this file does.\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n// buf:lint:ignore PACKAGE_LOWER_SNAKE_CASE\n// buf:lint:ignore PACKAGE_VERSION_SUFFIX\npackage A;\n\n// buf:lint:ignore IMPORT_NO_PUBLIC\nimport public \"google/protobuf/empty.proto\";\n\n// buf:lint:ignore ENUM_PASCAL_CASE\nenum enumFoo {\n  // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n  option allow_alias = true;\n  // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooNone = 0;\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooOne = 1;\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooTwo = 1;\n}\n\n// buf:lint:ignore MESSAGE_PASCAL_CASE\nmessage messageFoo {\n  // buf:lint:ignore MESSAGE_PASCAL_CASE\n  message messageBar {\n    // buf:lint:ignore MESSAGE_PASCAL_CASE\n    message messageBaz {\n      // buf:lint:ignore ENUM_PASCAL_CASE\n      enum enumFoo {\n        // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n        option allow_alias = true;\n        // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooNone = 0;\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooOne = 1;\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooTwo = 1;\n      }\n      // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n      int64 Foo = 1;\n      // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n      oneof Bar {\n        // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n        int64 Baz = 2;\n      }\n    }\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    int64 Foo = 1;\n    // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n    oneof Bar {\n      // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n      int64 Baz = 2;\n    }\n  }\n  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  int64 Foo = 1;\n  // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n  oneof Bar {\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    int64 Baz = 2;\n  }\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\nservice serviceFoo {\n  // buf:lint:ignore RPC_PASCAL_CASE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\n  rpc methodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_off/b.proto",
    "content": "syntax = \"proto2\";\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n// buf:lint:ignore PACKAGE_VERSION_SUFFIX\npackage a;\n\nenum EnumFoo {\n  // buf:lint:ignore ENUM_FIRST_VALUE_ZERO\n  ENUM_FOO_UNSPECIFIED = 10;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_off/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - PACKAGE_LOWER_SNAKE_CASE\n    - PACKAGE_VERSION_SUFFIX\n    - IMPORT_NO_PUBLIC\n    - ENUM_FIRST_VALUE_ZERO\n    - ENUM_PASCAL_CASE\n    - ENUM_NO_ALLOW_ALIAS\n    - ENUM_ZERO_VALUE_SUFFIX\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - ONEOF_LOWER_SNAKE_CASE\n    - SERVICE_PASCAL_CASE\n    - RPC_PASCAL_CASE\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_on/a.proto",
    "content": "syntax = \"proto3\";\n\n// To team members: I am sorry you have to read such a bad file.\n// To others: Do the opposite of whatever this file does.\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n// buf:lint:ignore PACKAGE_LOWER_SNAKE_CASE\n// buf:lint:ignore PACKAGE_VERSION_SUFFIX\npackage A;\n\n// buf:lint:ignore IMPORT_NO_PUBLIC\nimport public \"google/protobuf/empty.proto\";\n\n// buf:lint:ignore ENUM_PASCAL_CASE\nenum enumFoo {\n  // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n  option allow_alias = true;\n  // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooNone = 0;\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooOne = 1;\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooTwo = 1;\n}\n\n// buf:lint:ignore MESSAGE_PASCAL_CASE\nmessage messageFoo {\n  // buf:lint:ignore MESSAGE_PASCAL_CASE\n  message messageBar {\n    // buf:lint:ignore MESSAGE_PASCAL_CASE\n    message messageBaz {\n      // buf:lint:ignore ENUM_PASCAL_CASE\n      enum enumFoo {\n        // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n        option allow_alias = true;\n        // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooNone = 0;\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooOne = 1;\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooTwo = 1;\n      }\n      // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n      int64 Foo = 1;\n      // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n      oneof Bar {\n        // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n        int64 Baz = 2;\n      }\n    }\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    int64 Foo = 1;\n    // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n    oneof Bar {\n      // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n      int64 Baz = 2;\n    }\n  }\n  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  int64 Foo = 1;\n  // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n  oneof Bar {\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    int64 Baz = 2;\n  }\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\nservice serviceFoo {\n  // buf:lint:ignore RPC_PASCAL_CASE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\n  rpc methodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_on/b.proto",
    "content": "syntax = \"proto2\";\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n// buf:lint:ignore PACKAGE_VERSION_SUFFIX\npackage a;\n\nenum EnumFoo {\n  // buf:lint:ignore ENUM_FIRST_VALUE_ZERO\n  ENUM_FOO_UNSPECIFIED = 10;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_on/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - PACKAGE_LOWER_SNAKE_CASE\n    - PACKAGE_VERSION_SUFFIX\n    - IMPORT_NO_PUBLIC\n    - ENUM_FIRST_VALUE_ZERO\n    - ENUM_PASCAL_CASE\n    - ENUM_NO_ALLOW_ALIAS\n    - ENUM_ZERO_VALUE_SUFFIX\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - ONEOF_LOWER_SNAKE_CASE\n    - SERVICE_PASCAL_CASE\n    - RPC_PASCAL_CASE\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n  allow_comment_ignores: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_with_trailing_comment/a.proto",
    "content": "syntax = \"proto3\";\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH trailing comment after the ignore comment is also OK\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comment_ignores_with_trailing_comment/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comments/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nenum EnumFoo {\n  ENUM_FOO_UNSPECIFIED = 0;\n  ENUM_FOO_ONE = 1;\n}\n\nmessage MessageFoo {\n  message MessageBar {\n    enum Foo {\n      FOO_UNSPECIFIED = 0;\n      FOO_ONE = 1;\n    }\n    message MessageBaz {\n      optional int64 foo = 1;\n      oneof bar {\n        int64 baz = 2;\n      }\n    }\n    int64 foo = 1;\n    oneof bar {\n      int64 baz = 2;\n    }\n  }\n  enum Foo {\n    FOO_UNSPECIFIED = 0;\n    FOO_ONE = 1;\n  }\n  int64 foo = 1;\n  oneof bar {\n    int64 baz = 2;\n  }\n}\n\nservice ServiceFoo {\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\n// comment\nenum EnumFoo2 {\n  // comment\n  ENUM_FOO2_UNSPECIFIED = 0;\n  // comment\n  ENUM_FOO2_ONE = 1;\n}\n\n// comment\nmessage MessageFoo2 {\n  // comment\n  message MessageBar {\n  // comment\n    enum Foo {\n  // comment\n      FOO_UNSPECIFIED = 0;\n  // comment\n      FOO_ONE = 1;\n    }\n    // comment\n    message MessageBaz {\n      // comment\n      int64 foo = 1;\n      // comment\n      oneof bar {\n        // comment\n        int64 baz = 2;\n      }\n    }\n        // comment\n    int64 foo = 1;\n        // comment\n    oneof bar {\n        // comment\n      int64 baz = 2;\n    }\n  }\n  // comment\n  enum Foo {\n    // comment\n    FOO_UNSPECIFIED = 0;\n    // comment\n    FOO_ONE = 1;\n  }\n  // comment\n  int64 foo = 1;\n  // comment\n  oneof bar {\n    // comment\n    int64 baz = 2;\n  }\n}\n\n// comment\nservice ServiceFoo2 {\n  // comment\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  // comment\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n\nenum EnumFoo3 {\n  ENUM_FOO3_UNSPECIFIED = 0; // bad comment\n  ENUM_FOO3_ONE = 1; // bad comment\n} // bad comment\n\nmessage MessageFoo3 {\n  message MessageBar {\n    enum Foo {\n      FOO_UNSPECIFIED = 0; // bad comment\n      FOO_ONE = 1; // bad comment\n    } // bad comment\n    message MessageBaz {\n      int64 foo = 1; // bad comment\n      oneof bar { // bad comment\n        int64 baz = 2; // bad comment\n      } // bad comment\n    }\n    int64 foo = 1; // bad comment\n    oneof bar { // bad comment\n      int64 baz = 2; // bad comment\n    } // bad comment\n  } // bad comment\n  enum Foo { // bad comment\n    FOO_UNSPECIFIED = 0; // bad comment\n    FOO_ONE = 1; // bad comment\n  } // bad comment\n  int64 foo = 1; // bad comment\n  oneof bar { // bad comment\n    int64 baz = 2; // bad comment\n  } // bad comment\n}\n\nservice ServiceFoo3 {\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {} // bad comment\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty); // bad comment\n}\n\n//\nenum EnumFoo4 {\n  //\n  ENUM_FOO4_UNSPECIFIED = 0;\n  //\n  ENUM_FOO4_ONE = 1;\n}\n\n//\nmessage MessageFoo4 {\n  //\n  message MessageBar {\n  //\n    enum Foo {\n  //\n      FOO_UNSPECIFIED = 0;\n  //\n      FOO_ONE = 1;\n    }\n    //\n    message MessageBaz {\n      //\n      int64 foo = 1;\n      //\n      oneof bar {\n        //\n        int64 baz = 2;\n      }\n    }\n        //\n    int64 foo = 1;\n        //\n    oneof bar {\n        //\n      int64 baz = 2;\n    }\n  }\n  //\n  enum Foo {\n    //\n    FOO_UNSPECIFIED = 0;\n    //\n    FOO_ONE = 1;\n  }\n  //\n  int64 foo = 1;\n  //\n  oneof bar {\n    //\n    int64 baz = 2;\n  }\n}\n\n//\nservice ServiceFoo4 {\n  //\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  //\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n\n/*   */\nenum EnumFoo5 {\n  /*   */\n  ENUM_FOO5_UNSPECIFIED = 0;\n  /*   */\n  ENUM_FOO5_ONE = 1;\n}\n\n/*   */\nmessage MessageFoo5 {\n  /*   */\n  message MessageBar {\n  /*   */\n    enum Foo {\n  /*   */\n      FOO_UNSPECIFIED = 0;\n  /*   */\n      FOO_ONE = 1;\n    }\n    /*   */\n    message MessageBaz {\n      /*   */\n      int64 foo = 1;\n      /*   */\n      oneof bar {\n        /*   */\n        int64 baz = 2;\n      }\n    }\n        /*   */\n    int64 foo = 1;\n        /*   */\n    oneof bar {\n        /*   */\n      int64 baz = 2;\n    }\n  }\n  /*   */\n  enum Foo {\n    /*   */\n    FOO_UNSPECIFIED = 0;\n    /*   */\n    FOO_ONE = 1;\n  }\n  /*   */\n  int64 foo = 1;\n  /*   */\n  oneof bar {\n    /*   */\n    int64 baz = 2;\n  }\n}\n\n/*   */\nservice ServiceFoo5 {\n  /*   */\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  /*   */\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n\nmessage Baz {\n  map<int64, string> one = 1;\n}\n\n// comment\nservice ServiceFoo6 {\n  // this method should pass lint\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  //buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE this method should fail lint\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n  //buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE this method should also fail lint\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  //\n  rpc MethodBaz(google.protobuf.Empty) returns (google.protobuf.Empty);\n  //buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  // this method should pass lint\n  rpc MethodBat(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comments/b.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\n// Comment for FooWithGroup\nmessage FooWithGroup {\n  // Comment for Group1\n  optional group Group1 = 1 {\n    // Comment for s\n    optional string s = 1;\n  }\n\n  optional group Group2 = 2 {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/comments/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - COMMENTS\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/custom_plugins/a.proto",
    "content": "syntax = \"proto3\";\n\nservice A {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n}\n\nservice AMock {\n  rpc GetAllA(GetAllARequest) returns (GetAllAResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n}\n\nmessage GetAllARequest {}\nmessage GetAllAResponse {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/custom_plugins/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice B {\n  rpc GetElement(GetElementRequest) returns (GetElementResponse);\n}\n\nmessage GetElementRequest {}\nmessage GetElementResponse {\n  enum Status {\n    STATUS_UNSPECIFIED = 0;\n    STATUS_VALID = 1;\n    STATUS_INVALID = 2;\n  }\n  message Value {\n    string name = 1;\n    Status status = 2;\n    string a_uuid = 3;\n  }\n  Value value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/custom_plugins/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DEFINED\n    - SERVICE_BANNED_SUFFIXES\n    - RPC_BANNED_SUFFIXES\n    - FIELD_BANNED_SUFFIXES\n    - ENUM_VALUE_BANNED_SUFFIXES\n    - VALIDATE_ID_DASHLESS\n    - PAGE_REQUEST_HAS_TOKEN\n    - PAGE_RESPONSE_HAS_TOKEN\nplugins:\n  - plugin: buf-plugin-suffix\n    options:\n      service_banned_suffixes:\n        - Mock\n        - Test\n      rpc_banned_suffixes:\n        - Element\n      field_banned_suffixes:\n        - _uuid\n      enum_value_banned_suffixes:\n        - _INVALID\n  - plugin: buf-plugin-protovalidate-ext\n  - plugin: buf-plugin-rpc-ext\n    options:\n      page_rpc_prefix:\n        - List\n        - GetAll\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/custom_wasm_plugins/a.proto",
    "content": "syntax = \"proto3\";\n\nservice A {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n}\n\nservice AMock {\n  rpc GetAllA(GetAllARequest) returns (GetAllAResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n}\n\nmessage GetAllARequest {}\nmessage GetAllAResponse {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/custom_wasm_plugins/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice B {\n  rpc GetElement(GetElementRequest) returns (GetElementResponse);\n}\n\nmessage GetElementRequest {}\nmessage GetElementResponse {\n  enum Status {\n    STATUS_UNSPECIFIED = 0;\n    STATUS_VALID = 1;\n    STATUS_INVALID = 2;\n  }\n  message Value {\n    string name = 1;\n    Status status = 2;\n    string a_uuid = 3;\n  }\n  Value value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/custom_wasm_plugins/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DEFINED\n    - SERVICE_BANNED_SUFFIXES\n    - RPC_BANNED_SUFFIXES\n    - FIELD_BANNED_SUFFIXES\n    - ENUM_VALUE_BANNED_SUFFIXES\nplugins:\n  - plugin: buf-plugin-suffix.wasm\n    options:\n      service_banned_suffixes:\n        - Mock\n        - Test\n      rpc_banned_suffixes:\n        - Element\n      field_banned_suffixes:\n        - _uuid\n      enum_value_banned_suffixes:\n        - _INVALID\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/directory_same_package/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/directory_same_package/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - DIRECTORY_SAME_PACKAGE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/directory_same_package/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/directory_same_package/one/c.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/directory_same_package/one/d.proto",
    "content": "syntax = \"proto3\";\n\npackage d;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/editions_go_features/a.proto",
    "content": "edition = \"2023\";\n\nimport \"google/protobuf/go_features.proto\";\n\noption features.(pb.go).api_level = API_OPAQUE;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/editions_go_features/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DEFINED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_first_value_zero/a.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nenum Foo {\n  FOO_UNSPECIFIED = 0;\n  FOO_ONE = 1;\n  FOO_TWO = 2;\n}\n\nenum Bar {\n  BAR_ONE = 1;\n  BAR_UNSPECIFIED = 0;\n  BAR_TWO = 2;\n}\n\nenum Baz {\n  BAZ_ONE = 1;\n  BAZ_UNSPECIFIED = 0;\n  BAZ_TWO = 2;\n}\n\nenum Bat {\n  BAT_UNSPECIFIED = 0;\n  BAT_ONE = 1;\n  BAT_TWO = 2;\n}\n\nmessage One {\n  message Two {\n    enum Foo {\n      FOO_UNSPECIFIED = 0;\n      FOO_ONE = 1;\n      FOO_TWO = 2;\n    }\n\n    enum Bar {\n      BAR_ONE = 1;\n      BAR_UNSPECIFIED = 0;\n      BAR_TWO = 2;\n    }\n\n    enum Baz {\n      BAZ_ONE = 1;\n      BAZ_UNSPECIFIED = 0;\n      BAZ_TWO = 2;\n    }\n\n    enum Bat {\n      BAT_UNSPECIFIED = 0;\n      BAT_ONE = 1;\n      BAT_TWO = 2;\n    }\n  }\n  enum Foo {\n    FOO_UNSPECIFIED = 0;\n    FOO_ONE = 1;\n    FOO_TWO = 2;\n  }\n\n  enum Bar {\n    BAR_ONE = 1;\n    BAR_UNSPECIFIED = 0;\n    BAR_TWO = 2;\n  }\n\n  enum Baz {\n    BAZ_ONE = 1;\n    BAZ_UNSPECIFIED = 0;\n    BAZ_TWO = 2;\n  }\n\n  enum Bat {\n    BAT_UNSPECIFIED = 0;\n    BAT_ONE = 1;\n    BAT_TWO = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_first_value_zero/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_FIRST_VALUE_ZERO\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_no_allow_alias/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Foo {\n  FOO_UNSPECIFIED = 0;\n  FOO_ONE = 1;\n  FOO_TWO = 2;\n}\n\nenum Bar {\n  option allow_alias = true;\n  BAR_UNSPECIFIED = 0;\n  BAR_ONE = 1;\n  BAR_TWO = 1;\n}\n\nenum Baz {\n  option allow_alias = true;\n  BAZ_UNSPECIFIED = 0;\n  BAZ_ONE = 1;\n  BAZ_TWO = 1;\n}\n\nenum Bat {\n  option allow_alias = false;\n  BAT_UNSPECIFIED = 0;\n  BAT_ONE = 1;\n  BAT_TWO = 2;\n}\n\nmessage One {\n  message Two {\n    enum Foo {\n      FOO_UNSPECIFIED = 0;\n      FOO_ONE = 1;\n      FOO_TWO = 2;\n    }\n\n    enum Bar {\n      option allow_alias = true;\n      BAR_UNSPECIFIED = 0;\n      BAR_ONE = 1;\n      BAR_TWO = 1;\n    }\n\n    enum Baz {\n      option allow_alias = true;\n      BAZ_UNSPECIFIED = 0;\n      BAZ_ONE = 1;\n      BAZ_TWO = 1;\n    }\n\n    enum Bat {\n      option allow_alias = false;\n      BAT_UNSPECIFIED = 0;\n      BAT_ONE = 1;\n      BAT_TWO = 2;\n    }\n  }\n  enum Foo {\n    FOO_UNSPECIFIED = 0;\n    FOO_ONE = 1;\n    FOO_TWO = 2;\n  }\n\n  enum Bar {\n    option allow_alias = true;\n    BAR_UNSPECIFIED = 0;\n    BAR_ONE = 1;\n    BAR_TWO = 1;\n  }\n\n  enum Baz {\n    option allow_alias = true;\n    BAZ_UNSPECIFIED = 0;\n    BAZ_ONE = 1;\n    BAZ_TWO = 1;\n  }\n\n  enum Bat {\n    option allow_alias = false;\n    BAT_UNSPECIFIED = 0;\n    BAT_ONE = 1;\n    BAT_TWO = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_no_allow_alias/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_NO_ALLOW_ALIAS\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_pascal_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Success {\n  SUCCESS_UNSPECIFIED = 0;\n}\n\nenum SuccessTwo {\n  SUCCESS_TWO_UNSPECIFIED = 0;\n}\n\nenum SuccessFOOThree {\n  SUCCESS_FOO_THREE_UNSPECIFIED = 0;\n}\nenum fail {\n  FAIL_UNSPECIFIED = 0;\n}\nenum failTwo {\n  FAIL_TWO_UNSPECIFIED = 0;\n}\nenum fail_three {\n  FAIL_THREE_UNSPECIFIED = 0;\n}\nenum Fail_four {\n  FAIL_FOUR_UNSPECIFIED = 0;\n}\n\nmessage Foo {\n  message Bar {\n    enum Success {\n      SUCCESS_UNSPECIFIED = 0;\n    }\n\n    enum SuccessTwo {\n      SUCCESS_TWO_UNSPECIFIED = 0;\n    }\n\n    enum SuccessFOOThree {\n      SUCCESS_FOO_THREE_UNSPECIFIED = 0;\n    }\n    enum fail {\n      FAIL_UNSPECIFIED = 0;\n    }\n    enum failTwo {\n      FAIL_TWO_UNSPECIFIED = 0;\n    }\n    enum fail_three {\n      FAIL_THREE_UNSPECIFIED = 0;\n    }\n    enum Fail_four {\n      FAIL_FOUR_UNSPECIFIED = 0;\n    }\n  }\n  enum Success {\n    SUCCESS_UNSPECIFIED = 0;\n  }\n\n  enum SuccessTwo {\n    SUCCESS_TWO_UNSPECIFIED = 0;\n  }\n\n  enum SuccessFOOThree {\n    SUCCESS_FOO_THREE_UNSPECIFIED = 0;\n  }\n  enum fail {\n    FAIL_UNSPECIFIED = 0;\n  }\n  enum failTwo {\n    FAIL_TWO_UNSPECIFIED = 0;\n  }\n  enum fail_three {\n    FAIL_THREE_UNSPECIFIED = 0;\n  }\n  enum Fail_four {\n    FAIL_FOUR_UNSPECIFIED = 0;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_pascal_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_value_prefix/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Test {\n  TEST_UNSPECIFIED = 0;\n  TEST_SUCCESS = 1;\n  TEST_SUCCESS_TWO = 2;\n  TEST_SUCCESS_THREE_3 = 3;\n  TESt_FAIL = 4;\n  test_FAIL_5 = 5;\n  test__FAIL_6 = 6;\n}\n\nmessage Foo {\n  message Bar {\n    enum Test1 {\n      TEST1_UNSPECIFIED = 0;\n      TEST1_SUCCESS = 1;\n      TEST1_SUCCESS_TWO = 2;\n      TEST1_SUCCESS_THREE_3 = 3;\n      TESt1_FAIL = 4;\n      test1_FAIL_5 = 5;\n      test1__FAIL_6 = 6;\n      TEST_1_FAIL_7 = 7;\n    }\n  }\n  enum Test1 {\n    TEST1_UNSPECIFIED = 0;\n    TEST1_SUCCESS = 1;\n    TEST1_SUCCESS_TWO = 2;\n    TEST1_SUCCESS_THREE_3 = 3;\n    TESt1_FAIL = 4;\n    test1_FAIL_5 = 5;\n    test1__FAIL_6 = 6;\n    TEST_1_FAIL_7 = 7;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_value_prefix/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_VALUE_PREFIX\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_value_upper_snake_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Test {\n  TEST_UNSPECIFIED = 0;\n  TEST_SUCCESS = 1;\n  TEST_SUCCESS_TWO = 2;\n  TEST_SUCCESS_THREE3 = 3;\n  TEST_FAIl = 4;\n  test_fail_five = 5;\n  testFailSix = 6;\n  TEST_SUCCESS_7 = 7;\n}\n\nmessage Foo {\n  message Bar {\n    enum Test {\n      TEST_UNSPECIFIED = 0;\n      TEST_SUCCESS = 1;\n      TEST_SUCCESS_TWO = 2;\n      TEST_SUCCESS_THREE3 = 3;\n      TEST_FAIl = 4;\n      test_fail_five = 5;\n      testFailSix = 6;\n      TEST_SUCCESS_7 = 7;\n    }\n  }\n  enum Test {\n    TEST_UNSPECIFIED = 0;\n    TEST_SUCCESS = 1;\n    TEST_SUCCESS_TWO = 2;\n    TEST_SUCCESS_THREE3 = 3;\n    TEST_FAIl = 4;\n    test_fail_five = 5;\n    testFailSix = 6;\n    TEST_SUCCESS_7 = 7;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_value_upper_snake_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_zero_value_suffix/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Success {\n  SUCCESS_UNSPECIFIED = 0;\n}\n\nenum SuccessTwo {\n  SUCCESS_TWO_UNSPECIFIED = 0;\n}\n\nenum Fail {\n  FAILUNSPECIFIED = 0;\n}\n\nenum FailTwo {\n  FAIL_TWO_UNSPECIFIEd = 0;\n}\n\nenum FailThree {\n  FAIL_THREE_OTHER = 0;\n}\n\nmessage Foo {\n  message Bar {\n    enum Success {\n      SUCCESS_UNSPECIFIED = 0;\n    }\n\n    enum SuccessTwo {\n      SUCCESS_TWO_UNSPECIFIED = 0;\n    }\n\n    enum Fail {\n      FAILUNSPECIFIED = 0;\n    }\n\n    enum FailTwo {\n      FAIL_TWO_UNSPECIFIEd = 0;\n    }\n\n    enum FailThree {\n      FAIL_THREE_OTHER = 0;\n    }\n  }\n  enum Success {\n    SUCCESS_UNSPECIFIED = 0;\n  }\n\n  enum SuccessTwo {\n    SUCCESS_TWO_UNSPECIFIED = 0;\n  }\n\n  enum Fail {\n    FAILUNSPECIFIED = 0;\n  }\n\n  enum FailTwo {\n    FAIL_TWO_UNSPECIFIEd = 0;\n  }\n\n  enum FailThree {\n    FAIL_THREE_OTHER = 0;\n  }\n}\n\nenum SuccessThree {\n  SUCCESS_THREE_UNSPECIFIED = 0;\n  SUCCESS_THREE_ONE = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_zero_value_suffix/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_ZERO_VALUE_SUFFIX\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_zero_value_suffix_custom/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nenum Success {\n  SUCCESSOTHER = 0;\n}\n\nenum SuccessTwo {\n  SUCCESS_TWOOTHER = 0;\n}\n\nenum SuccessThree {\n  SUCCESS_THREE_OTHER = 0;\n}\n\nenum FailTwo {\n  FAIL_TWOOTHEr = 0;\n}\n\nenum FailThree {\n  FAIL_TWO_UNSPECIFIED = 0;\n}\n\nmessage Foo {\n  message Bar {\n    enum Success {\n      SUCCESSOTHER = 0;\n    }\n\n    enum SuccessTwo {\n      SUCCESS_TWOOTHER = 0;\n    }\n\n    enum SuccessThree {\n      SUCCESS_THREE_OTHER = 0;\n    }\n\n    enum FailTwo {\n      FAIL_TWOOTHEr = 0;\n    }\n\n    enum FailThree {\n      FAIL_TWO_UNSPECIFIED = 0;\n    }\n  }\n  enum Success {\n    SUCCESSOTHER = 0;\n  }\n\n  enum SuccessTwo {\n    SUCCESS_TWOOTHER = 0;\n  }\n\n  enum SuccessThree {\n    SUCCESS_THREE_OTHER = 0;\n  }\n\n  enum FailTwo {\n    FAIL_TWOOTHEr = 0;\n  }\n\n  enum FailThree {\n    FAIL_TWO_UNSPECIFIED = 0;\n  }\n}\n\nenum SuccessFour {\n  SUCCESS_FOUROTHER = 0;\n  SUCCESS_FOUR_ONE = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/enum_zero_value_suffix_custom/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ENUM_ZERO_VALUE_SUFFIX\n  enum_zero_value_suffix: OTHER\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_lower_snake_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 success = 1;\n  int32 success_two = 2;\n  int32 Fail = 3;\n  int32 FailTwo = 4;\n  int32 failThree = 5;\n  int32 fail_four_ = 6;\n  int32 _fail_five = 7;\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      int32 success = 1;\n      int32 success_two = 2;\n      int32 Fail = 3;\n      int32 FailTwo = 4;\n      int32 failThree = 5;\n      int32 fail_four_ = 6;\n      int32 _fail_five = 7;\n    }\n    int32 success = 1;\n    int32 success_two = 2;\n    int32 Fail = 3;\n    int32 FailTwo = 4;\n    int32 failThree = 5;\n    int32 fail_four_ = 6;\n    int32 _fail_five = 7;\n  }\n}\n\nmessage Five {\n  int32 success1 = 1;\n  int32 success_2 = 2;\n  int32 success3_1 = 3;\n  int32 success_4_1 = 4;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_lower_snake_case/b.proto",
    "content": "syntax = \"proto2\";\n\npackage b;\n\nmessage Foo {\n  extensions 1 to 100;\n  message Bar {\n    extend Foo {\n      optional string a = 1;\n      optional string B = 2;\n    }\n  }\n}\n\nextend Foo {\n  optional string c = 3;\n  optional string D = 4;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_lower_snake_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - FIELD_LOWER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_no_descriptor/a.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional string descriptor = 1;\n  optional string Descriptor = 2;\n  optional string descRiptor = 3;\n  optional string _descriptor = 4;\n  optional string __descriptor = 5;\n  optional string descriptor_ = 6;\n  optional string descriptor__ = 7;\n  optional string __descriptor__ = 8;\n  extensions 10 to 100;\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      optional string descriptor = 1;\n      optional string Descriptor = 2;\n      optional string descRiptor = 3;\n      optional string _descriptor = 4;\n      optional string __descriptor = 5;\n      optional string descriptor_ = 6;\n      optional string descriptor__ = 7;\n      optional string __descriptor__ = 8;\n      message Five {\n        extend One {\n          optional string descriptor = 10;\n          optional string Descriptor = 11;\n          optional string descRiptor = 12;\n          optional string _descriptor = 13;\n          optional string __descriptor = 14;\n          optional string descriptor_ = 15;\n          optional string descriptor__ = 16;\n          optional string __descriptor__ = 17;\n        }\n      }\n    }\n    optional string descriptor = 1;\n    optional string Descriptor = 2;\n    optional string descRiptor = 3;\n    optional string _descriptor = 4;\n    optional string __descriptor = 5;\n    optional string descriptor_ = 6;\n    optional string descriptor__ = 7;\n    optional string __descriptor__ = 8;\n  }\n  optional string descriptor = 1;\n  optional string Descriptor = 2;\n  optional string descRiptor = 3;\n  optional string _descriptor = 4;\n  optional string __descriptor = 5;\n  optional string descriptor_ = 6;\n  optional string descriptor__ = 7;\n  optional string __descriptor__ = 8;\n}\n\nextend One {\n  optional string descriptor = 20;\n  optional string Descriptor = 21;\n  optional string descRiptor = 22;\n  optional string _descriptor = 23;\n  optional string __descriptor = 24;\n  optional string descriptor_ = 25;\n  optional string descriptor__ = 26;\n  optional string __descriptor__ = 27;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_no_descriptor/buf.yaml",
    "content": "version: v1beta1\nlint:\n  use:\n    - FIELD_NO_DESCRIPTOR\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_not_required/a.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional string a = 1;\n  repeated string b = 2;\n  optional string c = 3;\n  repeated string d = 4;\n  optional string e = 5;\n  optional string f = 6;\n  optional string g = 7;\n  required string h = 8;\n  extensions 10 to 100;\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      optional string a = 1;\n      optional string b = 2;\n      optional string c = 3;\n    }\n    repeated string a = 1;\n    repeated string b = 2;\n    optional string c = 3;\n  }\n  required string a = 1;\n  optional string b = 2;\n  repeated string c = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_not_required/b.proto",
    "content": "edition = \"2023\";\n\npackage b;\n\nmessage One {\n  string a = 1;\n  repeated string b = 2;\n  string c = 3;\n  repeated string d = 4;\n  string e = 5;\n  string f = 6;\n  string g = 7;\n  string h = 8 [features.field_presence = LEGACY_REQUIRED];\n  extensions 10 to 100;\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      string a = 1;\n      string b = 2;\n      string c = 3;\n    }\n    repeated string a = 1;\n    repeated string b = 2;\n    string c = 3;\n  }\n  string a = 1 [features.field_presence = LEGACY_REQUIRED];\n  string b = 2;\n  repeated string c = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/field_not_required/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - FIELD_NOT_REQUIRED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/B.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/Foo.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/aBc.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/aBc.txt",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/ab.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/ab_c.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/ab_c_.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - FILE_LOWER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/file_lower_snake_case/fooBar.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores1/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores1/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores1/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores1/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores1/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores1/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores1/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores2/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores2/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores2/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores2/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores2/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores2/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores2/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n  ignore:\n    - buf/bar/bar2.proto\n    - buf/foo\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores3/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores3/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores3/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores3/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores3/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores3/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores3/buf.yaml",
    "content": "version: v1beta1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n  ignore_only:\n    ENUM_PASCAL_CASE:\n      - buf/bar/bar.proto\n      - buf/foo/bar\n      - buf/foo/bar\n    MESSAGE_PASCAL_CASE:\n      - buf/bar/bar.proto\n    STYLE_BASIC:\n      - buf/foo/bar\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores4/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores4/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores4/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores4/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores4/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores4/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/ignores4/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n  ignore_only:\n    ENUM_PASCAL_CASE:\n      - buf/bar/bar.proto\n      - buf/foo/bar\n      - buf/foo/bar\n    MESSAGE_PASCAL_CASE:\n      - buf/bar/bar.proto\n    BASIC:\n      - buf/foo/bar\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_no_public/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"sub/sub1.proto\";\nimport public \"sub/sub2.proto\";\nimport public \"one/one.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_no_public/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - IMPORT_NO_PUBLIC\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_no_public/one/one.proto",
    "content": "syntax = \"proto3\";\n\npackage one;\n\nimport \"sub/sub1.proto\";\nimport public \"sub/sub2.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_no_public/sub/sub1.proto",
    "content": "syntax = \"proto3\";\n\npackage sub;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_no_public/sub/sub2.proto",
    "content": "syntax = \"proto3\";\n\npackage sub;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_used/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"sub/sub1.proto\";\nimport \"sub/sub2.proto\";\nimport \"one/one.proto\";\n\nmessage A {\n  sub.Sub2 sub2 = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_used/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - IMPORT_USED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_used/one/one.proto",
    "content": "syntax = \"proto3\";\n\npackage one;\n\nimport \"sub/sub1.proto\";\nimport \"sub/sub2.proto\";\n\nmessage One {\n  sub.Sub1 sub1 = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_used/sub/sub1.proto",
    "content": "syntax = \"proto3\";\n\npackage sub;\n\nmessage Sub1 {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/import_used/sub/sub2.proto",
    "content": "syntax = \"proto3\";\n\npackage sub;\n\nmessage Sub2 {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/lint_stable_package_import/api/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage api.baz;\n\nmessage Baz {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/lint_stable_package_import/api/v1/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage api.v1;\n\nimport \"api/v1alpha/bar.proto\";\nimport \"api/baz/baz.proto\";\nimport \"api/v2/foo.proto\";\n\nmessage Foo {\n  api.v1alpha.Bar bar = 1;\n  api.baz.Baz baz = 2;\n  api.v2.Foo foo = 3;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/lint_stable_package_import/api/v1alpha/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage api.v1alpha;\n\nmessage Bar {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/lint_stable_package_import/api/v2/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage api.v2;\n\nmessage Foo {}\n\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/lint_stable_package_import/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - STABLE_PACKAGE_NO_IMPORT_UNSTABLE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/message_pascal_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Success {}\nmessage SuccessTwo {}\nmessage SuccessFOOThree {\n  message fail {}\n  message failTwo {\n    message fail_three {}\n  }\n}\n\nmessage fail {}\nmessage failTwo {}\nmessage fail_three {}\nmessage Fail_four {\n  message fail {}\n  message failTwo {\n    message fail_three {}\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/message_pascal_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - MESSAGE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/oneof_lower_snake_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  oneof success {\n    int32 one = 1;\n  }\n  oneof success_two {\n    int32 two = 2;\n  }\n  oneof Fail {\n    int32 three = 3;\n  }\n  oneof FailTwo {\n    int32 four = 4;\n  }\n  oneof failThree {\n    int32 five = 5;\n  }\n  oneof fail_four_ {\n    int32 six = 6;\n  }\n  oneof _fail_five {\n    int32 seven = 7;\n  }\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      oneof success {\n        int32 one = 1;\n      }\n      oneof success_two {\n        int32 two = 2;\n      }\n      oneof Fail {\n        int32 three = 3;\n      }\n      oneof FailTwo {\n        int32 four = 4;\n      }\n      oneof failThree {\n        int32 five = 5;\n      }\n      oneof fail_four_ {\n        int32 six = 6;\n      }\n      oneof _fail_five {\n        int32 seven = 7;\n      }\n    }\n    oneof success {\n      int32 one = 1;\n    }\n    oneof success_two {\n      int32 two = 2;\n    }\n    oneof Fail {\n      int32 three = 3;\n    }\n    oneof FailTwo {\n      int32 four = 4;\n    }\n    oneof failThree {\n      int32 five = 5;\n    }\n    oneof fail_four_ {\n      int32 six = 6;\n    }\n    oneof _fail_five {\n      int32 seven = 7;\n    }\n  }\n}\n\n// checking to see if the implicit oneof triggers the linter, which it should not\nmessage Three {\n  message Four {\n    message Five {\n      optional string one = 1;\n    }\n    optional string one = 1;\n  }\n  optional string one = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/oneof_lower_snake_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - ONEOF_LOWER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_defined/a/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_defined/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DEFINED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_defined/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_directory_match/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_directory_match/a/b/a_c.proto",
    "content": "syntax = \"proto3\";\n\npackage a.c;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_directory_match/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_directory_match/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_directory_match/sub/a/b/a_b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/2.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/3.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b_cde;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/4.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b_cde.f;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/5.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b_cdE.f;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/6.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b_cde.F;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/7.proto",
    "content": "syntax = \"proto3\";\n\npackage a.bcde.F;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/8.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b_cde.f_;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_LOWER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_lower_snake_case/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/a1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"d1.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/a2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/b1.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"c1.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/b2.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_NO_IMPORT_CYCLE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/c1.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n\nimport \"d1.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/c2.proto",
    "content": "syntax = \"proto3\";\n\npackage c;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/d1.proto",
    "content": "syntax = \"proto3\";\n\npackage d;\n\nimport \"b2.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/d2.proto",
    "content": "syntax = \"proto3\";\n\npackage d;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/none1.proto",
    "content": "syntax = \"proto3\";\n\nimport \"b1.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_no_import_cycle/none2.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_directory/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_directory/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_SAME_DIRECTORY\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_directory/one/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_directory_no_package/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_SAME_DIRECTORY\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_directory_no_package/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_directory_no_package/one/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_option_value/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\noption csharp_namespace = \"foo\";\noption java_multiple_files = true;\noption java_package = \"foo\";\noption go_package = \"foo\";\noption php_namespace = \"foo\";\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_option_value/b.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\noption csharp_namespace = \"bar\";\noption java_multiple_files = false;\noption java_package = \"bar\";\noption go_package = \"bar\";\noption php_namespace = \"bar\";\noption ruby_package = \"bar\";\noption swift_prefix = \"bar\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_option_value/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_SAME_CSHARP_NAMESPACE\n    - PACKAGE_SAME_GO_PACKAGE\n    - PACKAGE_SAME_JAVA_MULTIPLE_FILES\n    - PACKAGE_SAME_JAVA_PACKAGE\n    - PACKAGE_SAME_PHP_NAMESPACE\n    - PACKAGE_SAME_RUBY_PACKAGE\n    - PACKAGE_SAME_SWIFT_PREFIX\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_option_value/sub/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n\n// comment\noption csharp_namespace = \"foo\";\noption java_multiple_files = true;\noption java_package = \"foo\";\noption go_package = \"foo\";\noption php_namespace = \"foo\";\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_same_option_value/sub/b.proto",
    "content": "syntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - PACKAGE_VERSION_SUFFIX\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v0beta1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v0beta1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v1beta1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v1beta1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v1test.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v1test;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v1test_foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v1test.foo;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v1testfoo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v1testfoo;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v2;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_v2beta0.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.v2beta0;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/foo_bar_vv1beta1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.vv1beta1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/no_package.proto",
    "content": "syntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/package_version_suffix/v1.proto",
    "content": "syntax = \"proto3\";\n\npackage v1;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_disablebuiltin/a.proto",
    "content": "syntax = \"proto3\";\n\nservice A {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n}\n\nservice AMock {\n  rpc GetAllA(GetAllARequest) returns (GetAllAResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n}\n\nmessage GetAllARequest {}\nmessage GetAllAResponse {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_disablebuiltin/buf.policydisablebuiltin.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\nbreaking:\n  disable_builtin: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_disablebuiltin/buf.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\nbreaking:\n  disable_builtin: true\npolicies:\n  - policy: buf.policydisablebuiltin.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_empty/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage A {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_empty/buf.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\npolicies:\n  - policy: empty.policy.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_empty/empty.policy.yaml",
    "content": "version: v2\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/buf.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\npolicies:\n  - policy: policy.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores1/policy.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/buf.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\npolicies:\n  - policy: policy.yaml\n    ignore:\n      - buf/bar/bar2.proto\n      - buf/foo\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores2/policy.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/buf.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\npolicies:\n  - policy: policy.yaml\n    ignore_only:\n      ENUM_PASCAL_CASE:\n        - buf/bar/bar.proto\n        - buf/foo/bar\n        - buf/foo/bar\n      MESSAGE_PASCAL_CASE:\n        - buf/bar/bar.proto\n      BASIC:\n        - buf/foo/bar\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores3/policy.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/buf/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/buf/bar/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/buf/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/buf/foo/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/buf/foo/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/buf/foo/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/buf.yaml",
    "content": "version: v2\nlint:\n  disable_builtin: true\npolicies:\n  - policy: policy.yaml\n    ignore_only:\n      ENUM_PASCAL_CASE:\n        - buf/bar/bar.proto\n        - buf/foo/bar\n        - buf/foo/bar\n      MESSAGE_PASCAL_CASE:\n        - buf/bar/bar.proto\n      BASIC:\n        - buf/foo/bar\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_ignores4/policy.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - ENUM_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_local/a.proto",
    "content": "syntax = \"proto3\";\n\nservice A {\n  rpc GetA(GetARequest) returns (GetAResponse);\n  rpc ListA(ListARequest) returns (ListAResponse);\n}\n\nservice AMock {\n  rpc GetAllA(GetAllARequest) returns (GetAllAResponse);\n}\n\nmessage GetARequest {}\nmessage GetAResponse {}\n\nmessage ListARequest {\n  uint32 page_size = 1;\n}\n\nmessage ListAResponse {\n  message Value {\n    string id = 1;\n    bytes content = 2;\n  }\n  repeated Value values = 1;\n}\n\nmessage GetAllARequest {}\nmessage GetAllAResponse {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_local/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nservice B {\n  rpc GetElement(GetElementRequest) returns (GetElementResponse);\n}\n\nmessage GetElementRequest {}\nmessage GetElementResponse {\n  enum Status {\n    STATUS_UNSPECIFIED = 0;\n    STATUS_VALID = 1;\n    STATUS_INVALID = 2;\n  }\n  message Value {\n    string name = 1;\n    Status status = 2;\n    string a_uuid = 3;\n  }\n  Value value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_local/buf.policy1.yaml",
    "content": "version: v2\nlint:\n  use:\n    - SERVICE_BANNED_SUFFIXES\n    - RPC_BANNED_SUFFIXES\nplugins:\n  - plugin: buf-plugin-suffix.wasm\n    options:\n      service_banned_suffixes:\n        - Mock\n        - Test\n      rpc_banned_suffixes:\n        - Element\n      field_banned_suffixes:\n        - _uuid\n      enum_value_banned_suffixes:\n        - _INVALID\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_local/buf.policy2.yaml",
    "content": "version: v2\nlint:\n  use:\n    - FIELD_BANNED_SUFFIXES\n    - ENUM_VALUE_BANNED_SUFFIXES\nplugins:\n  - plugin: buf-plugin-suffix.wasm\n    options:\n      service_banned_suffixes:\n        - Mock\n        - Test\n      rpc_banned_suffixes:\n        - Element\n      field_banned_suffixes:\n        - _uuid\n      enum_value_banned_suffixes:\n        - _INVALID\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/policy_local/buf.yaml",
    "content": "version: v2\nlint:\n  use:\n    - PACKAGE_DEFINED\nplugins:\n  - plugin: buf-plugin-suffix.wasm\n    options:\n      service_banned_suffixes:\n        - Mock\n        - Test\n      rpc_banned_suffixes:\n        - Element\n      field_banned_suffixes:\n        - _uuid\n      enum_value_banned_suffixes:\n        - _INVALID\npolicies:\n  - policy: buf.policy1.yaml\n  - policy: buf.policy2.yaml\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/buf.work.yaml",
    "content": "version: v1\ndirectories:\n  - proto\n  - vendor/protovalidate\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/any.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/any.proto\";\n\nmessage AnyTest {\n  // valid\n  google.protobuf.Any no_protovalidate_option = 1;\n  // valid\n  google.protobuf.Any other_option = 2 [deprecated = true];\n  // valid\n  google.protobuf.Any valid_in = 3 [\n    (buf.validate.field).any.in = \"type.googleapis.com/MyType1\",\n    (buf.validate.field).any.in = \"type.googleapis.com/MyType2\"\n  ];\n  // valid\n  google.protobuf.Any valid_not_in = 4 [\n    (buf.validate.field).any.not_in = \"type.googleapis.com/MyType1\",\n    (buf.validate.field).any.not_in = \"type.googleapis.com/MyType2\"\n  ];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/bool.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/wrappers.proto\";\n\nmessage BoolTest {\n  // valid\n  bool no_protovalidate_option = 1;\n  // valid\n  bool other_option = 2 [deprecated = true];\n  // valid\n  bool valid_const = 3 [(buf.validate.field).bool.const = true];\n  // valid\n  google.protobuf.BoolValue valid_wrapper = 7 [(buf.validate.field).bool.const = false];\n  // int32 rules on a BoolValue field\n  google.protobuf.BoolValue mismatch_wrapper = 8 [(buf.validate.field).int32.lt = 1];\n  string string_mismatch = 9 [(buf.validate.field).bool.const = true];\n  google.protobuf.Int32Value wrong_wrapper = 10 [(buf.validate.field).bool.const = true];\n  bool valid_example = 4 [\n    (buf.validate.field).bool.const = true,\n    (buf.validate.field).bool.example = true\n  ];\n  bool invalid_example = 5 [\n    (buf.validate.field).bool.const = true,\n    (buf.validate.field).bool.example = false\n  ];\n  bool valid_no_constraint_example = 6 [\n    (buf.validate.field).bool.example = true,\n    (buf.validate.field).bool.example = false\n  ];\n  bool invalid_example_type_mistmatch = 12 [(buf.validate.field).string.example = \"true\"];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/buf.yaml",
    "content": "version: v1\nname: buf.testing/lint/protovalidate\nlint:\n  use:\n    - PROTOVALIDATE\n  allow_comment_ignores: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/bytes.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/wrappers.proto\";\n\nmessage BytesTest {\n  // valid\n  bytes no_protovalidate_option = 1;\n  // valid\n  bytes other_option = 2 [deprecated = true];\n  // valid\n  bytes valid_prefix_and_max_len = 3 [\n    (buf.validate.field).bytes.prefix = \"ÀÀÀÀÀ\",\n    (buf.validate.field).bytes.max_len = 10\n  ];\n  bytes prefix_over_max_len = 4 [\n    (buf.validate.field).bytes.max_len = 9,\n    // len is 10\n    (buf.validate.field).bytes.prefix = \"ÀÀÀÀÀ\"\n  ];\n  bytes valid_pattern = 5 [(buf.validate.field).bytes.pattern = \"[0-9]\"];\n  bytes invalid_pattern = 6 [\n    (buf.validate.field).bytes.len = 1,\n    (buf.validate.field).bytes.pattern = \"[\"\n  ];\n  google.protobuf.BytesValue valid_wrapper = 7 [(buf.validate.field).bytes.pattern = \"[0-9]\"];\n  bytes invalid_wrapper = 8 [\n    (buf.validate.field).bytes.len = 1,\n    (buf.validate.field).bytes.pattern = \"[\"\n  ];\n  bytes valid_example = 9 [\n    (buf.validate.field).bytes.prefix = \"ÀÀÀÀÀ\",\n    (buf.validate.field).bytes.example = \"ÀÀÀÀÀÇÇÇÇÇÇÇÇÅÅÅÅÅÅÅÅ\"\n  ];\n  bytes valid_and_invalid_example = 10 [\n    (buf.validate.field).bytes.prefix = \"ÀÀÀÀÀ\",\n    (buf.validate.field).bytes.max_len = 17,\n    // valid\n    (buf.validate.field).bytes.example = \"ÀÀÀÀÀÀÀÀ\",\n    // invalid, fails one of the rules\n    (buf.validate.field).bytes.example = \"ÀÀÀÀÀÇÇÇÇÇÇÇÇÅÅÅÅÅÅÅÅ\"\n  ];\n  bytes valid_no_constraint_example = 11 [(buf.validate.field).bytes.example = \"ÀÀÀÀÀÇÇÇÇÇÇÇÇÅÅÅÅÅÅÅÅ\"];\n  bytes invalid_example_type_mismatch = 12 [(buf.validate.field).string.example = \"ÀÀÀÀÀÇÇÇÇÇÇÇÇÅÅÅÅÅÅÅÅ\"];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/cel_expression.proto",
    "content": "syntax = \"proto2\";\n\nimport \"buf/validate/validate.proto\";\n\n// Test cel_expression validation\nmessage TestCelExpression {\n  // Valid expression\n  optional string valid_field = 1 [(buf.validate.field).cel_expression = \"this.size() > 5\"];\n\n  // Invalid expression - type error\n  optional string invalid_type = 2 [(buf.validate.field).cel_expression = \"this > 5\"];\n\n  // Invalid expression - syntax error\n  optional int32 invalid_syntax = 3 [(buf.validate.field).cel_expression = \"this +\"];\n\n  // Multiple expressions, some valid, some invalid\n  optional string mixed = 4 [\n    (buf.validate.field).cel_expression = \"this.size() > 0\",\n    (buf.validate.field).cel_expression = \"this * 2\"\n  ];\n\n  // Message-level cel_expression\n  optional string foo = 5;\n  option (buf.validate.message).cel_expression = \"this.foo.size() > 0\";\n  option (buf.validate.message).cel_expression = \"this.foo > 5\";\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/cel_field.proto",
    "content": "syntax = \"proto2\";\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/api.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Foo {\n  required double compile_fail = 1 [(buf.validate.field).cel = {\n    id: \"Foo.compile_fail\"\n    message: \"compile_fail_message\"\n    expression: \"this > '1'\"\n  }];\n  optional string some_expressions_fail = 2 [\n    // this one fails\n    (buf.validate.field).cel = {\n      id: \"Foo.some_expressions_fail_1\"\n      message: \"some_expressions_fail_1_message\"\n      expression: \"this > 5\"\n    },\n    // this one succeeds\n    (buf.validate.field).cel = {\n      id: \"Foo.some_expressions_fail_2\"\n      message: \"some_expressions_fail_2_message\"\n      expression: \"size(this) > 5\"\n    },\n    // this one fails\n    (buf.validate.field).cel = {\n      id: \"Foo.some_expressions_fail_3\"\n      message: \"some_expressions_fail_3_message\"\n      expression: \"this * 2\"\n    }\n  ];\n  required int32 bad_return_type = 3 [(buf.validate.field).cel = {\n    id: \"Foo.bad_return_type\"\n    message: \"some_expressions_fail_3_message\"\n    expression: \"this + 1\"\n  }];\n  optional string no_validate = 4;\n  optional string no_cel = 5 [(buf.validate.field).string.email = true];\n  required string expressions_succeed = 6 [\n    (buf.validate.field).cel = {\n      id: \"Foo.expressions_succeed\"\n      message: \"expression_succeed_message\"\n      expression: \"this.startsWith('foo') && this.endsWith('bar')\"\n    },\n    (buf.validate.field).cel = {\n      id: \"Foo.expressions_succeed_2\"\n      message: \"expression_succeed_message_2\"\n      expression: \"'bar' < this && this < 'foo'\"\n    }\n  ];\n  required string bar = 8;\n  option (buf.validate.message).cel = {\n    id: \"Foo.bar.1\"\n    message: \"bar\"\n    expression: \"this.bar.matches('foo')\"\n  };\n  option (buf.validate.message).cel = {\n    id: \"Foo.bar.2\"\n    message: \"bar\"\n    expression: \"size(this.bar)\"\n  };\n  required google.protobuf.Api transitive_dependency_succeed = 9 [(buf.validate.field).cel = {\n    id: \"Foo.api\"\n    message: \"api\"\n    expression: \"this.source_context.file_name.contains('foo')\"\n  }];\n  required google.protobuf.Duration duration = 10 [\n    (buf.validate.field).cel = {\n      id: \"Foo.duration\"\n      message: \"duration\"\n      expression: \"this <= duration('23h59m59s')\"\n    },\n    (buf.validate.field).cel = {\n      id: \"Foo.duration.fail\"\n      message: \"duration_fail\"\n      expression: \"this <= 1\"\n    }\n  ];\n  required google.protobuf.Timestamp timestamp = 11 [\n    (buf.validate.field).cel = {\n      id: \"Foo.timestamp\"\n      message: \"timestamp\"\n      expression: \"this < timestamp('1900-01-01T00:00:00+00:00')\"\n    },\n    (buf.validate.field).cel = {\n      id: \"Foo.timestamp.fail\"\n      message: \"duration_fail\"\n      expression: \"this < 1\"\n    }\n  ];\n  required google.protobuf.Any any = 12 [(buf.validate.field).cel = {\n    id: \"Foo.any\"\n    message: \"any fail\"\n    // This is valid.\n    expression: \"this == this\"\n  }];\n  map<int32, string> invalid_map = 13 [\n    (buf.validate.field).map.keys.cel = {\n      id: \"map_keys_valid\"\n      message: \"foo\"\n      expression: \"this > 5\"\n    },\n    (buf.validate.field).map.keys.cel = {\n      id: \"map_keys_invalid\"\n      message: \"foo\"\n      expression: \"this\"\n    },\n    (buf.validate.field).map.values.cel = {\n      id: \"map_values_valid\"\n      message: \"foo\"\n      expression: \"size(this) < 100\"\n    },\n    (buf.validate.field).map.values.cel = {\n      id: \"map_values_invalid\"\n      message: \"foo\"\n      expression: \"this * this\"\n    }\n  ];\n  // Valid CEL expressions for repeated fields.\n  repeated string allow_cidr = 14 [(buf.validate.field).repeated = {\n    min_items: 1\n    items: {\n      cel: [\n        {\n          id: \"ip_prefix\"\n          message: \"value must be IPv4 prefix\"\n          expression: \"this.isIpPrefix(4, true)\"\n        }\n      ]\n    }\n  }];\n  // Valid CEL expressions for map fields.\n  map<string, bool> allow_cidr_map = 15 [(buf.validate.field).map = {\n    keys: {\n      cel: [\n        {\n          id: \"ip_prefix\"\n          message: \"key must be IPv4 prefix\"\n          expression: \"this.isIpPrefix(4, true)\"\n        }\n      ]\n    }\n  }];\n  // CEL expression defined on the field itself (not each element) should treat\n  // \"this\" as a list, not the element type.\n  repeated int32 values = 16 [\n    (buf.validate.field).cel = {\n      id: \"min_len_and_min_value\"\n      message: \"must have at least one value and all values must be greater than 2\"\n      expression: \"size(this) > 0 && this.all(x, x >= 2)\"\n    },\n    // This is incorrect because \"this\" is not an int32 but a list of int32.\n    (buf.validate.field).cel = {\n      id: \"min_value\"\n      message: \"each value must be greater than 2\"\n      expression: \"this > 2\"\n    }\n  ];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/cel_message.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/any.proto\";\n\nmessage MessageTest {\n  string s = 1;\n  // valid bool expression\n  option (buf.validate.message).cel = {\n    id: \"id1\",\n    message: \"message\",\n    expression: \"this == this\"\n  };\n  // valid string expression\n  option (buf.validate.message).cel = {\n    id: \"id_1_string\",\n    expression: \"this == this ? '' : 'error'\"\n  };\n  // invalid id\n  option (buf.validate.message).cel = {\n    id: \"?\",\n    message: \"message\",\n    expression: \"this == this\"\n  };\n  // empty id UPDATE this is now OK\n  option (buf.validate.message).cel = {\n    id: \"\",\n    message: \"message\",\n    expression: \"this == this\"\n  };\n  // id is duplicate\n  option (buf.validate.message).cel = {\n    id: \"id2\",\n    message: \"message\",\n    expression: \"this == this\"\n  };\n  // id is duplicate\n  option (buf.validate.message).cel = {\n    id: \"id2\",\n    message: \"message\",\n    expression: \"this == this\"\n  };\n  // empty expression\n  option (buf.validate.message).cel = {\n    id: \"id_empty_exp\",\n    message: \"message\",\n    expression: \" \"\n  };\n  // failed compilation\n  option (buf.validate.message).cel = {\n    id: \"id3\",\n    message: \"uh\",\n    expression: \"xyz\"\n  };\n  // failed with multiple compilation errors\n  option (buf.validate.message).cel = {\n    id: \"id4\",\n    message: \"uh\",\n    expression: \"foo + bar\",\n  };\n  // missing message with a bool expression UPDATE: this is now OK\n  option (buf.validate.message).cel = {\n    id: \"id5\",\n    message: \"\",\n    expression: \"this == this\"\n  };\n  // redundant message with a string expression\n  option (buf.validate.message).cel = {\n    id: \"id6\",\n    message: \"message\",\n    expression: \"''\"\n  };\n  // expression not string or bool\n  option (buf.validate.message).cel = {\n    id: \"id7\",\n    message: \"message\",\n    expression: \"1 + 1\"\n  };\n  message NestedMessage {\n    option (buf.validate.message).cel = {\n      id: \"?\",\n      message: \"message\",\n      expression: \"this == this\"\n    };\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/duration.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage DurationTest {\n  // valid\n  google.protobuf.Duration no_protovalidate_option = 1;\n  // valid\n  google.protobuf.Duration other_option = 2 [deprecated = true];\n  // valid\n  google.protobuf.Duration valid_range_1 = 3 [\n    (buf.validate.field).duration.gt = {\n      seconds: 5\n      nanos: 1\n    },\n    (buf.validate.field).duration.lt = {\n      seconds: 5\n      nanos: 2\n    }\n  ];\n  // it's ok to have gt > lt\n  google.protobuf.Duration valid_range_2 = 4 [\n    (buf.validate.field).duration.gt = {\n      seconds: 5\n      nanos: 2\n    },\n    (buf.validate.field).duration.lte = {\n      seconds: 5\n      nanos: 1\n    }\n  ];\n  google.protobuf.Duration valid_range_3 = 5 [\n    (buf.validate.field).duration.gte = {\n      seconds: -5\n      nanos: -20\n    },\n    (buf.validate.field).duration.lt = {\n      seconds: -4\n      nanos: -1\n    }\n  ];\n  google.protobuf.Duration valid_range_4 = 6 [\n    (buf.validate.field).duration.gte = {\n      seconds: -4\n      nanos: -2\n    },\n    (buf.validate.field).duration.lte = {\n      seconds: -4\n      nanos: -1\n    }\n  ];\n  google.protobuf.Duration invalid_range_1 = 7 [\n    // gt == lte\n    (buf.validate.field).duration.gt = {\n      seconds: 1\n      nanos: 2\n    },\n    (buf.validate.field).duration.lte = {\n      seconds: 1\n      nanos: 2\n    }\n  ];\n  google.protobuf.Duration invalid_range_2 = 8 [\n    // gte == lt\n    (buf.validate.field).duration.gte = {\n      seconds: 2\n      nanos: 1\n    },\n    (buf.validate.field).duration.lt = {\n      seconds: 2\n      nanos: 1\n    }\n  ];\n  google.protobuf.Duration invalid_range_3 = 9 [\n    // gt == lt\n    (buf.validate.field).duration.gt = {\n      seconds: -2\n      nanos: -1\n    },\n    (buf.validate.field).duration.lt = {\n      seconds: -2\n      nanos: -1\n    }\n  ];\n  google.protobuf.Duration equal_lte_gte = 10 [\n    // lte == gte\n    (buf.validate.field).duration.gte = {\n      seconds: -1\n      nanos: -1\n    },\n    (buf.validate.field).duration.lte = {\n      seconds: -1\n      nanos: -1\n    }\n  ];\n  google.protobuf.Duration invalid_Duration = 11 [\n    (buf.validate.field).duration.gte = {\n      seconds: 1\n      nanos: 1\n    },\n    // seconds and nanos must have the same sign\n    (buf.validate.field).duration.lte = {\n      seconds: 1\n      nanos: -1\n    }\n  ];\n  google.protobuf.Duration in_range_Duration = 13 [\n    (buf.validate.field).duration.gte = {\n      seconds: -9223372036\n      nanos: -854775428\n    },\n    (buf.validate.field).duration.lte = {\n      seconds: 9223372036\n      nanos: 854775428\n    }\n  ];\n  google.protobuf.Duration out_of_range = 14 [\n    // 1 nanosecond lower than the minimum value allowed\n    (buf.validate.field).duration.gte = {\n      seconds: -9223372036\n      nanos: -854775429\n    },\n    // 1 nanosecond higher than the maximum value allowed\n    (buf.validate.field).duration.lte = {\n      seconds: 9223372036\n      nanos: 854775429\n    }\n  ];\n  google.protobuf.Duration valid_example = 20 [\n    (buf.validate.field).duration.lt = {\n      seconds: 17\n      nanos: 25\n    },\n    (buf.validate.field).duration.gt = {\n      seconds: 5\n      nanos: 1\n    },\n    (buf.validate.field).duration.example = {\n      seconds: 7\n      nanos: 3\n    }\n  ];\n  google.protobuf.Duration invalid_example = 21 [\n    (buf.validate.field).duration.lt = {\n      seconds: 17\n      nanos: 25\n    },\n    (buf.validate.field).duration.gt = {\n      seconds: 5\n      nanos: 1\n    },\n    (buf.validate.field).duration.example = {\n      seconds: 2\n      nanos: 3\n    }\n  ];\n  google.protobuf.Duration valid_no_constraint_example = 22 [(buf.validate.field).duration.example = {\n    seconds: 2\n    nanos: 3\n  }];\n  google.protobuf.Duration invalid_no_constraint_example = 23 [(buf.validate.field).timestamp.example = {seconds: 1672444800}];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/enum.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\n\nenum TestEnum {\n  TEST_ENUM_UNSPECIFIED = 0;\n  TEST_ENUM_FIRST = 1;\n  TEST_ENUM_SECOND = 2;\n}\n\nmessage EnumTest {\n  // valid\n  TestEnum no_protovalidate_option = 1;\n  // valid\n  TestEnum other_option = 2 [deprecated = true];\n  // valid const\n  TestEnum valid_const = 3 [(buf.validate.field).enum.const = 1];\n  // valid in\n  TestEnum valid_in = 4 [\n    (buf.validate.field).enum.in = 1,\n    (buf.validate.field).enum.in = 2\n  ];\n  TestEnum const_and_not_in = 5 [\n    (buf.validate.field).enum.not_in = 1,\n    // const should be the only field\n    (buf.validate.field).enum.const = 2\n  ];\n  TestEnum valid_example = 6 [\n    (buf.validate.field).enum.defined_only = true,\n    (buf.validate.field).enum.example = 1\n  ];\n  TestEnum invalid_example = 7 [\n    (buf.validate.field).enum.defined_only = true,\n    (buf.validate.field).enum.example = 4\n  ];\n  TestEnum valid_no_constraint_example = 8 [(buf.validate.field).enum.example = 2];\n  TestEnum invalid_no_constraint_example = 9 [(buf.validate.field).string.example = \"TEST_ENUM_FIRST\"];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/extension.proto",
    "content": "syntax = \"proto2\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\n\nmessage ExtensionTest {\n  optional string valid_required = 1 [\n    (buf.validate.field).string.min_len = 3,\n    (buf.validate.field).required = true\n  ];\n  extensions 10 to 10000;\n}\n\nmessage Extending {\n  extend ExtensionTest {\n    optional string valid = 12 [(buf.validate.field).string.min_len = 3];\n    optional string invalid_required = 13 [\n      (buf.validate.field).string.min_len = 3,\n      // required cannot be specified for extension\n      (buf.validate.field).required = true\n    ];\n    optional string invalid_ignore_empty = 14 [\n      (buf.validate.field).string.min_len = 3,\n      // ignore if zero value cannot be specified for extension\n      (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE\n    ];\n  }\n}\n\nextend ExtensionTest {\n  optional string valid = 22 [(buf.validate.field).string.min_len = 3];\n  optional string invalid_required = 23 [\n    (buf.validate.field).string.min_len = 3,\n    // required cannot be specified for extension\n    (buf.validate.field).required = true\n  ];\n  optional string invalid_ignore_empty = 24 [\n    (buf.validate.field).string.min_len = 3,\n    // ignore if zero value cannot be specified for extension\n    (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE\n  ];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/field.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\n\nmessage FieldTest {\n  int32 valid_required = 1 [\n    (buf.validate.field).required = true,\n    (buf.validate.field).int32.lt = 1\n  ];\n  string valid_ignore_empty = 2 [\n    (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,\n    (buf.validate.field).string.min_len = 5\n  ];\n  string invalid_required_and_ignore_empty = 3 [\n    (buf.validate.field).string.min_len = 5,\n    (buf.validate.field).required = true,\n    (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE\n  ];\n  // buf:lint:ignore PROTOVALIDATE\n  int32 int32_validated_with_int64 = 4 [(buf.validate.field).int64.gt = 5];\n  optional string optional_zero_ignored_field = 5 [(buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/field_mask.proto",
    "content": "syntax = \"proto3\";\n\npackage example.v1;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/field_mask.proto\";\n\nmessage FieldMaskTest {\n  // valid\n  google.protobuf.FieldMask const_field_mask = 1 [(buf.validate.field).field_mask.const = {\n    paths: [\"a\"]\n  }];\n  google.protobuf.FieldMask in_field_mask = 2 [(buf.validate.field).field_mask.in = \"some_field\"];\n  google.protobuf.FieldMask not_in_field_mask = 3 [(buf.validate.field).field_mask.not_in = \"some_other_field\"];\n  // invalid\n  google.protobuf.FieldMask not_string = 4 [(buf.validate.field).string.const = \"field\"];\n  // const should be the only field if defined\n  google.protobuf.FieldMask in_and_const = 5 [\n    (buf.validate.field).field_mask.in = \"a\",\n    (buf.validate.field).field_mask.const = {\n      paths: [\"b\"]\n    }];\n  // valid\n  google.protobuf.FieldMask no_conflict = 6 [\n    (buf.validate.field).field_mask.in = \"a\",\n    (buf.validate.field).field_mask.not_in = \"b\",\n    (buf.validate.field).field_mask.not_in = \"c\"\n  ];\n  // conflict between in and not_in\n  google.protobuf.FieldMask conflict = 7 [\n    (buf.validate.field).field_mask.in = \"a\",\n    (buf.validate.field).field_mask.not_in = \"b\",\n    (buf.validate.field).field_mask.not_in = \"a\"\n  ];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/map.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/wrappers.proto\";\n\nmessage MapTest {\n  // valid\n  map<int32, string> no_protovalidate_option = 1;\n  // valid\n  map<int64, google.protobuf.Duration> other_option = 2 [deprecated = true];\n  // valid\n  map<int64, string> valid = 3 [\n    (buf.validate.field).map.min_pairs = 1,\n    (buf.validate.field).map.max_pairs = 2,\n    (buf.validate.field).map.keys.int64.gt = 1,\n    (buf.validate.field).map.keys.int64.lt = 10,\n    (buf.validate.field).map.values.string.min_len = 1,\n    (buf.validate.field).map.values.string.max_len = 10\n  ];\n  // not a map\n  repeated int32 repeated_field = 4 [(buf.validate.field).map.min_pairs = 1];\n  map<int64, string> invalid_range = 5 [\n    // invalid range\n    (buf.validate.field).map.min_pairs = 2,\n    // invalid range\n    (buf.validate.field).map.max_pairs = 1\n  ];\n  map<int64, google.protobuf.Duration> key_type_mismatch = 6 [\n    (buf.validate.field).map.min_pairs = 1,\n    // key has type int64\n    (buf.validate.field).map.keys.string.min_len = 1\n  ];\n  map<int64, google.protobuf.Duration> value_type_mismatch = 7 [\n    (buf.validate.field).map.min_pairs = 1,\n    // value has type Duration\n    (buf.validate.field).map.values.string.min_len = 1\n  ];\n  map<int64, google.protobuf.Duration> key_rules_invalid = 8 [\n    (buf.validate.field).map.min_pairs = 1,\n    // invalid range\n    (buf.validate.field).map.keys.int64.gt = 1,\n    // invalid range\n    (buf.validate.field).map.keys.int64.lt = 1\n  ];\n  map<int64, google.protobuf.Duration> value_rules_invalid = 9 [\n    (buf.validate.field).map.min_pairs = 1,\n    (buf.validate.field).map.values.string.pattern = \"[\"\n  ];\n  int32 not_a_map = 14 [\n    (buf.validate.field).map.values.int32.lt = 10,\n    (buf.validate.field).map.values.int32.gt = 1\n  ];\n  map<int64, string> non_map_rule = 15 [(buf.validate.field).string.min_len = 1];\n  map<int64, string> valid_keys_values_example = 11 [\n    (buf.validate.field).map.keys.int64.gt = 1,\n    (buf.validate.field).map.keys.int64.lt = 10,\n    (buf.validate.field).map.values.string.min_len = 1,\n    (buf.validate.field).map.values.string.max_len = 10,\n    (buf.validate.field).map.keys.int64.example = 5,\n    (buf.validate.field).map.values.string.example = \"good\"\n  ];\n  map<int64, string> invalid_keys_values_example = 12 [\n    (buf.validate.field).map.keys.int64.gt = 1,\n    (buf.validate.field).map.keys.int64.lt = 10,\n    (buf.validate.field).map.values.string.min_len = 1,\n    (buf.validate.field).map.values.string.max_len = 10,\n    (buf.validate.field).map.keys.int64.example = -1,\n    (buf.validate.field).map.values.string.example = \"this_is_a_long_string\"\n  ];\n  map<int64, string> valid_keys_values_no_constraint_example = 13 [\n    (buf.validate.field).map.keys.int64.example = -1,\n    (buf.validate.field).map.values.string.example = \"good\"\n  ];\n  map<int64, string> invalid_keys_valid_values_no_constriant_example = 16 [\n    (buf.validate.field).map.keys.string.example = \"bad\",\n    (buf.validate.field).map.values.string.example = \"good\"\n  ];\n  map<int64, string> valid_keys_invalid_values_no_constriant_example = 17 [\n    (buf.validate.field).map.keys.int64.example = 1,\n    (buf.validate.field).map.values.int64.example = -1\n  ];\n  map<int64, string> invalid_keys_invalid_values_no_constriant_example = 18 [\n    (buf.validate.field).map.keys.string.example = \"bad\",\n    (buf.validate.field).map.values.int64.example = -1\n  ];\n  // invalid: required cannot be set on map keys\n  map<string, int32> invalid_required_on_keys = 19 [(buf.validate.field).map.keys.required = true];\n  // invalid: required cannot be set on map values\n  map<int32, string> invalid_required_on_values = 20 [(buf.validate.field).map.values.required = true];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/number.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/timestamp.proto\";\nimport \"google/protobuf/wrappers.proto\";\n\nmessage IntTest {\n  // valid\n  int32 no_protovalidate_option = 1;\n  // valid\n  float other_option = 2 [deprecated = true];\n  // valid\n  int64 only_const = 4 [(buf.validate.field).int64.const = 5];\n  uint32 const_and_other_fields = 5 [\n    (buf.validate.field).uint32.lt = 10,\n    // the next line should be annotated\n    (buf.validate.field).uint32.const = 1,\n    (buf.validate.field).uint32.gt = 8\n  ];\n  double equal_lte_gte = 8 [\n    // the next line should be annotated\n    (buf.validate.field).double.lte = 10.0,\n    (buf.validate.field).required = true,\n    // the next line should be annotated\n    (buf.validate.field).double.gte = 10.0\n  ];\n  sfixed32 invalid_bounds_1 = 9 [\n    // the next line should be annotated\n    (buf.validate.field).sfixed32.lt = 10,\n    (buf.validate.field).required = true,\n    // the next line should be annotated\n    (buf.validate.field).sfixed32.gte = 10\n  ];\n  sfixed64 invalid_bounds_2 = 10 [\n    // the next line should be annotated\n    (buf.validate.field).sfixed64.lte = 10,\n    (buf.validate.field).required = true,\n    // the next line should be annotated\n    (buf.validate.field).sfixed64.gt = 10\n  ];\n  // annotating items inside an option value\n  fixed32 invalid_bound_aggregate_syntax = 11 [(buf.validate.field).fixed32 = {\n    lt: 10 // this line should be annotated\n    gte: 10 // and this one, too\n  }];\n  // valid\n  google.protobuf.Int32Value int32_value_match = 12 [\n    (buf.validate.field).int32.lt = 10,\n    (buf.validate.field).int32.gt = 8\n  ];\n  google.protobuf.Int32Value int32_value_mismatch = 13 [\n    // the next line should be annotated\n    (buf.validate.field).sint32.lt = 5,\n    (buf.validate.field).sint32.gt = 1\n  ];\n  google.protobuf.Int64Value int64_value_match = 14 [\n    (buf.validate.field).int64.lt = 10,\n    (buf.validate.field).int64.gt = 8\n  ];\n  google.protobuf.Int64Value int64_value_mismatch = 15 [\n    // the next line should be annotated\n    (buf.validate.field).sfixed64.lt = 5,\n    (buf.validate.field).sfixed64.gt = 1\n  ];\n  google.protobuf.UInt32Value uint32_value_match = 16 [\n    (buf.validate.field).uint32.lt = 10,\n    (buf.validate.field).uint32.gt = 8\n  ];\n  google.protobuf.UInt32Value uint32_value_mismatch = 17 [\n    // the next line should be annotated\n    (buf.validate.field).fixed32.lt = 5,\n    (buf.validate.field).fixed32.gt = 1\n  ];\n  google.protobuf.UInt64Value uint64_value_match = 18 [\n    (buf.validate.field).uint64.lt = 10,\n    (buf.validate.field).uint64.gt = 8\n  ];\n  google.protobuf.UInt64Value uint64_value_mismatch = 19 [\n    // the next line should be annotated\n    (buf.validate.field).sfixed64.lt = 5,\n    (buf.validate.field).sfixed64.gt = 1\n  ];\n  google.protobuf.FloatValue float_value_match = 20 [\n    (buf.validate.field).float.lt = 10,\n    (buf.validate.field).float.gt = 8\n  ];\n  google.protobuf.FloatValue float_value_mismatch = 21 [\n    // the next line should be annotated\n    (buf.validate.field).double.lt = 5,\n    (buf.validate.field).double.gt = 1\n  ];\n  google.protobuf.DoubleValue double_value_match = 22 [\n    (buf.validate.field).double.lt = 10,\n    (buf.validate.field).double.gt = 8\n  ];\n  google.protobuf.DoubleValue double_value_mismatch = 23 [\n    // the next line should be annotated\n    (buf.validate.field).float.lt = 5,\n    (buf.validate.field).float.gt = 1\n  ];\n  int32 int32_match = 24 [(buf.validate.field).int32.lt = 1];\n  int64 int64_match = 25 [(buf.validate.field).int64.lt = 1];\n  fixed32 fixed32_match = 26 [(buf.validate.field).fixed32.lt = 1];\n  fixed64 fixed64_match = 27 [(buf.validate.field).fixed64.lt = 1];\n  sfixed32 sfixed32_match = 28 [(buf.validate.field).sfixed32.lt = 1];\n  sfixed64 sfixed64_match = 29 [(buf.validate.field).sfixed64.lt = 1];\n  sint32 sint32_match = 30 [(buf.validate.field).sint32.lt = 1];\n  sint64 sint64_matchk = 31 [(buf.validate.field).sint64.lt = 1];\n  uint32 uint32_match = 32 [(buf.validate.field).uint32.lt = 1];\n  uint64 uint64_match = 33 [(buf.validate.field).uint64.lt = 1];\n  float float_match = 34 [(buf.validate.field).float.lt = 1];\n  double double_match = 35 [(buf.validate.field).double.lt = 1];\n  // valid\n  repeated google.protobuf.Int32Value wrapper_repeated = 36 [\n    (buf.validate.field).repeated.unique = true,\n    (buf.validate.field).repeated.items.int32.lt = 5\n  ];\n  // valid\n  google.protobuf.Int64Value int64_value = 37 [\n    (buf.validate.field).int64.lt = 10,\n    (buf.validate.field).int64.gt = 8\n  ];\n  repeated google.protobuf.Int32Value wrapper_repeated_valid = 38 [\n    (buf.validate.field).repeated.unique = true,\n    (buf.validate.field).repeated.items.int32.lt = 5\n  ];\n  repeated google.protobuf.Int32Value wrapper_repeated_invalid = 39 [\n    (buf.validate.field).repeated.unique = true,\n    (buf.validate.field).repeated.items.int32.lt = 5,\n    // the next line should be annotated\n    (buf.validate.field).repeated.items.int32.const = 1\n  ];\n  map<int32, float> map_int32_int32 = 40 [\n    (buf.validate.field).map.keys.int32.lt = 1,\n    // the next line should be annotated\n    (buf.validate.field).map.keys.int32.const = 0,\n    (buf.validate.field).map.values.float.lt = 1,\n    // the next line should be annotated\n    (buf.validate.field).map.values.float.const = 0\n  ];\n  int32 valid_range_gt_less_than_lt = 41 [\n    (buf.validate.field).int32.lt = 10,\n    (buf.validate.field).int32.gt = 9\n  ];\n  int32 valid_range_gt_greater_than_lt = 42 [\n    (buf.validate.field).int32.lt = 9,\n    (buf.validate.field).int32.gt = 10\n  ];\n  // examples\n  double valid_double_example = 50 [\n    (buf.validate.field).double.lt = 10,\n    (buf.validate.field).double.example = 9\n  ];\n  double invalid_double_example = 51 [\n    (buf.validate.field).double.lt = 10,\n    (buf.validate.field).double.gt = 5,\n    (buf.validate.field).double.example = 1\n  ];\n  double valid_double_no_constraint_example = 80 [(buf.validate.field).double.example = 1];\n  double invalid_double_no_constraint_example = 81 [(buf.validate.field).int64.example = 1];\n  fixed32 valid_fixed32_example = 52 [\n    (buf.validate.field).fixed32.lt = 10,\n    (buf.validate.field).fixed32.gt = 5,\n    (buf.validate.field).fixed32.example = 9\n  ];\n  fixed32 invalid_fixed32_example = 53 [\n    (buf.validate.field).fixed32.lt = 10,\n    (buf.validate.field).fixed32.gt = 5,\n    (buf.validate.field).fixed32.example = 1\n  ];\n  fixed64 valid_fixed64_example = 54 [\n    (buf.validate.field).fixed64.lt = 10,\n    (buf.validate.field).fixed64.gt = 5,\n    (buf.validate.field).fixed64.example = 9\n  ];\n  fixed32 valid_fixed32_no_constaint_example = 82 [(buf.validate.field).fixed32.example = 1];\n  fixed32 invalid_fixed32_no_constaint_example = 83 [(buf.validate.field).sfixed32.example = 1];\n  fixed64 invalid_fixed64_example = 55 [\n    (buf.validate.field).fixed64.lt = 10,\n    (buf.validate.field).fixed64.gt = 5,\n    (buf.validate.field).fixed64.example = 1\n  ];\n  int32 valid_int32_example = 56 [\n    (buf.validate.field).int32.lt = 10,\n    (buf.validate.field).int32.gt = 5,\n    (buf.validate.field).int32.example = 9\n  ];\n  int32 invalid_int32_example = 57 [\n    (buf.validate.field).int32.lt = 10,\n    (buf.validate.field).int32.gt = 5,\n    (buf.validate.field).int32.example = 1\n  ];\n  int32 valid_int32_no_constraint_example = 84 [(buf.validate.field).int32.example = 1];\n  int32 invalid_int32_no_constraint_example = 85 [(buf.validate.field).fixed32.example = 1];\n  int64 valid_int64_example = 58 [\n    (buf.validate.field).int64.lt = 10,\n    (buf.validate.field).int64.gt = 5,\n    (buf.validate.field).int64.example = 9\n  ];\n  int64 invalid_int64_example = 59 [\n    (buf.validate.field).int64.lt = 10,\n    (buf.validate.field).int64.gt = 5,\n    (buf.validate.field).int64.example = 1\n  ];\n  int64 valid_int64_no_constraint_example = 86 [(buf.validate.field).int64.example = 1];\n  int64 invalid_int64_no_constraint_example = 87 [(buf.validate.field).fixed64.example = 1];\n  sfixed32 valid_sfixed32_example = 60 [\n    (buf.validate.field).sfixed32.lt = 10,\n    (buf.validate.field).sfixed32.gt = 5,\n    (buf.validate.field).sfixed32.example = 9\n  ];\n  sfixed32 invalid_sfixed32_example = 61 [\n    (buf.validate.field).sfixed32.lt = 10,\n    (buf.validate.field).sfixed32.gt = 5,\n    (buf.validate.field).sfixed32.example = 1\n  ];\n  sfixed32 valid_sfixed32_no_constraint_example = 88 [(buf.validate.field).sfixed32.example = 1];\n  sfixed32 invalid_sfixed32_no_constraint_example = 89 [(buf.validate.field).fixed32.example = 1];\n  sfixed64 valid_sfixed64_example = 64 [\n    (buf.validate.field).sfixed64.lt = 10,\n    (buf.validate.field).sfixed64.gt = 5,\n    (buf.validate.field).sfixed64.example = 9\n  ];\n  sfixed64 invalid_sfixed64_example = 65 [\n    (buf.validate.field).sfixed64.lt = 10,\n    (buf.validate.field).sfixed64.gt = 5,\n    (buf.validate.field).sfixed64.example = 1\n  ];\n  sfixed64 valid_sfixed64_no_constraint_example = 90 [(buf.validate.field).sfixed64.example = 1];\n  sfixed64 invalid_sfixed64_no_constraint_example = 91 [(buf.validate.field).fixed64.example = 1];\n  sint32 valid_sint32_example = 68 [\n    (buf.validate.field).sint32.lt = 10,\n    (buf.validate.field).sint32.gt = 5,\n    (buf.validate.field).sint32.example = 9\n  ];\n  sint32 invalid_sint32_example = 69 [\n    (buf.validate.field).sint32.lt = 10,\n    (buf.validate.field).sint32.gt = 5,\n    (buf.validate.field).sint32.example = 1\n  ];\n  sint32 valid_sint32_no_constaint_example = 92 [(buf.validate.field).sint32.example = 1];\n  sint32 invalid_sint32_no_constaint_example = 93 [(buf.validate.field).int32.example = 1];\n  sint64 valid_sint64_example = 72 [\n    (buf.validate.field).sint64.lt = 10,\n    (buf.validate.field).sint64.gt = 5,\n    (buf.validate.field).sint64.example = 9\n  ];\n  sint64 invalid_sint64_example = 73 [\n    (buf.validate.field).sint64.lt = 10,\n    (buf.validate.field).sint64.gt = 5,\n    (buf.validate.field).sint64.example = 1\n  ];\n  sint64 valid_sint64_no_constaint_example = 94 [(buf.validate.field).sint64.example = 1];\n  sint64 invalid_sint64_no_constaint_example = 95 [(buf.validate.field).int64.example = 1];\n  uint32 valid_uint32_example = 74 [\n    (buf.validate.field).uint32.lt = 10,\n    (buf.validate.field).uint32.gt = 5,\n    (buf.validate.field).uint32.example = 9\n  ];\n  uint32 invalid_uint32_example = 75 [\n    (buf.validate.field).uint32.lt = 10,\n    (buf.validate.field).uint32.gt = 5,\n    (buf.validate.field).uint32.example = 1\n  ];\n  uint32 valid_uint32_no_constaint_example = 96 [(buf.validate.field).uint32.example = 1];\n  uint32 invalid_uint32_no_constaint_example = 97 [(buf.validate.field).int32.example = 1];\n  uint64 valid_uint64_example = 76 [\n    (buf.validate.field).uint64.lt = 10,\n    (buf.validate.field).uint64.gt = 5,\n    (buf.validate.field).uint64.example = 9\n  ];\n  uint64 invalid_uint64_example = 77 [\n    (buf.validate.field).uint64.lt = 10,\n    (buf.validate.field).uint64.gt = 5,\n    (buf.validate.field).uint64.example = 1\n  ];\n  uint64 valid_uint64_no_constaint_example = 98 [(buf.validate.field).uint64.example = 1];\n  uint64 invalid_uint64_no_constaint_example = 99 [(buf.validate.field).int64.example = 1];\n  google.protobuf.Int64Value valid_wkt_int64_example = 66 [\n    (buf.validate.field).int64.lt = 10,\n    (buf.validate.field).int64.gt = 5,\n    (buf.validate.field).int64.example = 9\n  ];\n  google.protobuf.Int64Value invalid_wkt_int64_example = 67 [\n    (buf.validate.field).int64.lt = 10,\n    (buf.validate.field).int64.gt = 5,\n    (buf.validate.field).int64.example = 1\n  ];\n  google.protobuf.Int64Value valid_wkt_int64_no_constraint_example = 100 [(buf.validate.field).int64.example = 1];\n  google.protobuf.Int64Value invalid_wkt_int64_no_constraint_example = 101 [(buf.validate.field).uint64.example = 1];\n  google.protobuf.Int32Value valid_wkt_int32_example = 70 [\n    (buf.validate.field).int32.lt = 10,\n    (buf.validate.field).int32.gt = 5,\n    (buf.validate.field).int32.example = 9\n  ];\n  google.protobuf.Int32Value invalid_wkt_int32_example = 71 [\n    (buf.validate.field).int32.lt = 10,\n    (buf.validate.field).int32.gt = 5,\n    (buf.validate.field).int32.example = 1\n  ];\n  google.protobuf.Int32Value valid_wkt_int32_no_constraint_example = 102 [(buf.validate.field).int32.example = 1];\n  google.protobuf.Int32Value invalid_wkt_int32_no_constraint_example = 103 [(buf.validate.field).uint32.example = 1];\n  google.protobuf.UInt32Value valid_wkt_uint32_example = 62 [\n    (buf.validate.field).uint32.lt = 10,\n    (buf.validate.field).uint32.gt = 5,\n    (buf.validate.field).uint32.example = 9\n  ];\n  google.protobuf.UInt32Value invalid_wkt_uint32_example = 63 [\n    (buf.validate.field).uint32.lt = 10,\n    (buf.validate.field).uint32.gt = 5,\n    (buf.validate.field).uint32.example = 1\n  ];\n  google.protobuf.UInt32Value valid_wkt_uint32_no_constraint_example = 104 [(buf.validate.field).uint32.example = 1];\n  google.protobuf.UInt32Value invalid_wkt_uint32_no_constraint_example = 105 [(buf.validate.field).int32.example = 1];\n  google.protobuf.UInt64Value valid_wkt_uint64_example = 78 [\n    (buf.validate.field).uint64.lt = 10,\n    (buf.validate.field).uint64.gt = 5,\n    (buf.validate.field).uint64.example = 9\n  ];\n  google.protobuf.UInt64Value invalid_wkt_uint64_example = 79 [\n    (buf.validate.field).uint64.lt = 10,\n    (buf.validate.field).uint64.gt = 5,\n    (buf.validate.field).uint64.example = 1\n  ];\n  google.protobuf.UInt64Value valid_wkt_uint64_no_constraint_example = 106 [(buf.validate.field).uint64.example = 1];\n  google.protobuf.UInt64Value invalid_wkt_uint64_no_constraint_example = 107 [(buf.validate.field).int64.example = 1];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/oneof.proto",
    "content": "syntax = \"proto3\";\n\npackage what;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/duration.proto\";\n\nmessage OneofTest {\n  oneof foo {\n    int32 v1 = 1 [\n      (buf.validate.field).int32.lt = 3,\n      // must not have required\n      (buf.validate.field).required = true\n    ];\n    string v2 = 2;\n    google.protobuf.Duration v3 = 3 [\n      (buf.validate.field).duration.gt = {seconds: 5},\n      // must not have required\n      (buf.validate.field).required = true,\n      (buf.validate.field).duration.lt = {seconds: 10}\n    ];\n  }\n  // required is OK for non-oneof fields\n  string f4 = 4 [(buf.validate.field).required = true];\n  // optional in proto3 is a synthetic oneof, we should not report error.\n  optional string f5 = 5 [(buf.validate.field).required = true];\n  optional google.protobuf.Duration f6 = 6 [(buf.validate.field).required = true];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/repeated.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/wrappers.proto\";\n\nmessage RepeatedTest {\n  // valid\n  repeated string no_protovalidate_option = 1;\n  // valid\n  repeated int32 other_option = 2 [deprecated = true];\n  // valid\n  repeated string valid = 3 [\n    (buf.validate.field).repeated.min_items = 1,\n    (buf.validate.field).repeated.max_items = 2,\n    (buf.validate.field).repeated.unique = true,\n    (buf.validate.field).repeated.items.string.min_len = 1,\n    (buf.validate.field).repeated.items.string.max_len = 10\n  ];\n  repeated string invalid_count_range = 4 [\n    (buf.validate.field).repeated.unique = true,\n    // invalid range\n    (buf.validate.field).repeated.min_items = 2,\n    // invalid range\n    (buf.validate.field).repeated.max_items = 1,\n    (buf.validate.field).repeated.items.string.min_len = 1,\n    (buf.validate.field).repeated.items.string.max_len = 10\n  ];\n  // wrappers can have unique has well.\n  repeated google.protobuf.DoubleValue double_wrapper = 5 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.FloatValue float_wrapper = 6 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.Int32Value int32_wrapper = 7 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.Int64Value int64_wrapper = 8 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.UInt32Value uint32_wrapper = 9 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.UInt64Value uint64_wrapper = 10 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.BoolValue bool_wrapper = 11 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.BytesValue bytes_wrapper = 12 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.StringValue string_wrapper = 13 [(buf.validate.field).repeated.unique = true];\n  repeated google.protobuf.Duration invalid_unique = 14 [\n    (buf.validate.field).repeated.min_items = 1,\n    (buf.validate.field).repeated.max_items = 2,\n    // unique cannot be set for non-scalar fields.\n    (buf.validate.field).repeated.unique = true,\n    (buf.validate.field).repeated.items.duration.gt.seconds = 0\n  ];\n  // field is not repeated\n  int32 not_repeated = 15 [(buf.validate.field).repeated.unique = true];\n  // map value is also not repeated\n  map<int32, string> map_field = 16 [(buf.validate.field).map.values.repeated.unique = true];\n  // int64 does not match int32\n  int32 wrong_type = 17 [(buf.validate.field).repeated.items.int64.lt = 1];\n  // non repeated\n  repeated int32 non_repeated_rule = 18 [(buf.validate.field).int32.gt = 10];\n  repeated string valid_example = 19 [\n    (buf.validate.field).repeated.items.string.min_len = 1,\n    (buf.validate.field).repeated.items.string.max_len = 10,\n    (buf.validate.field).repeated.items.string.example = \"proto\"\n  ];\n  repeated string invalid_example = 20 [\n    (buf.validate.field).repeated.items.string.min_len = 3,\n    (buf.validate.field).repeated.items.string.max_len = 10,\n    (buf.validate.field).repeated.items.string.example = \"proto\", // valid\n    (buf.validate.field).repeated.items.string.example = \"pr\"\n  ];\n  repeated string valid_no_constraint_example = 21 [(buf.validate.field).repeated.items.string.example = \"proto\"];\n  repeated string invalid_no_constraint_example = 22 [(buf.validate.field).repeated.items.bool.example = true];\n  // invalid: required cannot be set on repeated items\n  repeated string invalid_required_on_items = 23 [(buf.validate.field).repeated.items.required = true];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/string.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/wrappers.proto\";\n\nmessage StringTest {\n  // valid\n  string no_protovalidate_option = 1;\n  // valid\n  string other_option = 2 [deprecated = true];\n  // valid\n  string valid = 3 [\n    (buf.validate.field).string.max_len = 20,\n    (buf.validate.field).string.max_bytes = 32,\n    (buf.validate.field).string.prefix = \"foo\",\n    (buf.validate.field).string.not_in = \"foo_1\",\n    (buf.validate.field).string.not_in = \"foo_2\"\n  ];\n  // valid\n  string valid_const = 4 [(buf.validate.field).string.const = \"foo\"];\n  // valid\n  string valid_in = 5 [\n    (buf.validate.field).string.in = \"foo\",\n    (buf.validate.field).string.in = \"bar\"\n  ];\n  string const = 6 [\n    (buf.validate.field).string.max_len = 1,\n    // const should be the only field if defined\n    (buf.validate.field).string.const = \"foo\"\n  ];\n  string len_and_min_len = 8 [\n    (buf.validate.field).string.len = 1,\n    // len is exclusive with min_len\n    (buf.validate.field).string.min_len = 1\n  ];\n  string len_and_max_len = 9 [\n    (buf.validate.field).string.len = 1,\n    // len is exclusive with max_len\n    (buf.validate.field).string.max_len = 1\n  ];\n  string min_len_greater_than_max_len = 10 [\n    // invalid bound\n    (buf.validate.field).string.max_len = 1,\n    // invalid bound\n    (buf.validate.field).string.min_len = 2\n  ];\n  string min_len_equal_to_max_len = 11 [\n    // invalid bound\n    (buf.validate.field).string.max_len = 1,\n    // invalid bound\n    (buf.validate.field).string.min_len = 1\n  ];\n  string len_bytes_and_min_bytes = 12 [\n    (buf.validate.field).string.len_bytes = 1,\n    // len_bytes is exclusive with min_bytes\n    (buf.validate.field).string.min_bytes = 1\n  ];\n  string len_bytes_and_max_bytes = 13 [\n    (buf.validate.field).string.len_bytes = 1,\n    // len bytes is exclusive with max_bytes\n    (buf.validate.field).string.max_bytes = 1\n  ];\n  string min_bytes_greater_than_max_bytes = 14 [\n    // invalid bound\n    (buf.validate.field).string.max_bytes = 1,\n    // invalid bound\n    (buf.validate.field).string.min_bytes = 2\n  ];\n  string min_bytes_equal_to_max_bytes = 15 [\n    // use const instead\n    (buf.validate.field).string.max_bytes = 1,\n    // use const instead\n    (buf.validate.field).string.min_bytes = 1\n  ];\n  string max_bytes_less_than_min_len = 16 [\n    // invalid bound\n    (buf.validate.field).string.max_bytes = 1,\n    // invalid bound\n    (buf.validate.field).string.min_len = 2\n  ];\n  string min_bytes_greater_than_4_time_max_len = 17 [\n    // invalid bound\n    (buf.validate.field).string.min_bytes = 5,\n    // invalid bound\n    (buf.validate.field).string.max_len = 1\n  ];\n  string prefix_over_max_len = 19 [\n    (buf.validate.field).string.max_len = 2,\n    // len is 3\n    (buf.validate.field).string.prefix = \"ÀÀÀ\"\n  ];\n  string prefix_over_max_bytes = 21 [\n    (buf.validate.field).string.max_bytes = 3,\n    // prefix over max_bytes\n    (buf.validate.field).string.prefix = \"ÀÀ\"\n  ];\n  string prefix_contains_not_contains = 22 [\n    (buf.validate.field).string.not_contains = \"À\",\n    // prefix contains not_contains\n    (buf.validate.field).string.prefix = \"bÀr\"\n  ];\n  string suffix_contains_not_contains = 23 [\n    (buf.validate.field).string.not_contains = \"À\",\n    // suffix contains not_contains\n    (buf.validate.field).string.suffix = \"bÀr\"\n  ];\n  string contains_contains_not_contains = 24 [\n    (buf.validate.field).string.not_contains = \"À\",\n    // contains contains not_contains\n    (buf.validate.field).string.contains = \"bÀr\"\n  ];\n  string invalid_pattern = 25 [\n    (buf.validate.field).string.not_in = \"foo\",\n    // invalid pattern\n    (buf.validate.field).string.pattern = \"[\"\n  ];\n  string non_strict_without_well_known_regex = 26 [\n    (buf.validate.field).string.min_len = 1,\n    // well_known_regex isn't set\n    (buf.validate.field).string.strict = false\n  ];\n  google.protobuf.StringValue string_wrapper_valid = 27 [\n    (buf.validate.field).string.min_len = 1,\n    (buf.validate.field).string.max_len = 5\n  ];\n  google.protobuf.StringValue string_wrapper_invalid = 28 [\n    (buf.validate.field).string.min_len = 10,\n    (buf.validate.field).string.const = \"foo\"\n  ];\n  bytes type_mismatch = 29 [\n    (buf.validate.field).string.min_len = 10,\n    (buf.validate.field).string.max_len = 20\n  ];\n  string valid_prefix_and_not_contains = 30 [\n    (buf.validate.field).string.prefix = \"foo\",\n    (buf.validate.field).string.not_contains = \"bar\"\n  ];\n  // this is valid: for example, \"foo_\" contains \"foo\" without containing \"bar_foo\".\n  string not_contains_contains_prefix = 31 [\n    (buf.validate.field).string.not_contains = \"bar_foo\",\n    (buf.validate.field).string.prefix = \"foo\"\n  ];\n  string examples = 32 [\n    (buf.validate.field).string.max_len = 20,\n    (buf.validate.field).string.max_bytes = 32,\n    (buf.validate.field).string.prefix = \"foo\",\n    (buf.validate.field).string.not_in = \"foo_1\",\n    (buf.validate.field).string.not_in = \"foo_2\",\n    (buf.validate.field).string.example = \"foo_8\", // valid\n    (buf.validate.field).string.example = \"afoo_8\", // invalid\n    (buf.validate.field).string.example = \"foofoofoo\", // valid\n    (buf.validate.field).string.example = \"bfoo\" // invalid\n  ];\n  string valid_no_constraint_example = 33 [(buf.validate.field).string.example = \"proto\"];\n  string invalid_no_constraint_example = 34 [(buf.validate.field).bool.example = true];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/proto/timestamp.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"buf/validate/validate.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage TimestampTest {\n  // valid\n  google.protobuf.Timestamp no_protovalidate_option = 1;\n  // valid\n  google.protobuf.Timestamp other_option = 2 [deprecated = true];\n  // gt < lt is valid\n  google.protobuf.Timestamp valid_range_1 = 3 [\n    (buf.validate.field).timestamp.gt = {\n      seconds: 5\n      nanos: 1\n    },\n    (buf.validate.field).timestamp.lt = {\n      seconds: 5\n      nanos: 2\n    }\n  ];\n  // gt > lte is also valid\n  google.protobuf.Timestamp valid_range_2 = 4 [\n    (buf.validate.field).timestamp.gt = {\n      seconds: 5\n      nanos: 2\n    },\n    (buf.validate.field).timestamp.lte = {\n      seconds: 5\n      nanos: 0\n    }\n  ];\n  google.protobuf.Timestamp valid_range_3 = 5 [\n    (buf.validate.field).timestamp.gte = {\n      seconds: -5\n      nanos: 20\n    },\n    (buf.validate.field).timestamp.lt = {\n      seconds: -4\n      nanos: 1\n    }\n  ];\n  google.protobuf.Timestamp valid_range_4 = 6 [\n    (buf.validate.field).timestamp.gte = {\n      seconds: -4\n      nanos: 1\n    },\n    (buf.validate.field).timestamp.lte = {\n      seconds: -4\n      nanos: 2\n    }\n  ];\n  google.protobuf.Timestamp invalid_range_1 = 7 [\n    // gt == lte\n    (buf.validate.field).timestamp.gt = {\n      seconds: 2\n      nanos: 1\n    },\n    (buf.validate.field).timestamp.lte = {\n      seconds: 2\n      nanos: 1\n    }\n  ];\n  google.protobuf.Timestamp invalid_range_2 = 8 [\n    // gte == lt\n    (buf.validate.field).timestamp.gte = {\n      seconds: 5\n      nanos: 2\n    },\n    (buf.validate.field).timestamp.lt = {\n      seconds: 5\n      nanos: 2\n    }\n  ];\n  google.protobuf.Timestamp invalid_range_3 = 9 [\n    // gt == lt\n    (buf.validate.field).timestamp.gt = {\n      seconds: -5\n      nanos: 2\n    },\n    (buf.validate.field).timestamp.lt = {\n      seconds: -5\n      nanos: 2\n    }\n  ];\n  google.protobuf.Timestamp equal_lte_gte = 10 [\n    // lte == gte\n    (buf.validate.field).timestamp.gte = {\n      seconds: -1\n      nanos: 1\n    },\n    (buf.validate.field).timestamp.lte = {\n      seconds: -1\n      nanos: 1\n    }\n  ];\n  google.protobuf.Timestamp invalid_timestamp = 11 [\n    (buf.validate.field).timestamp.gte = {\n      seconds: 1\n      nanos: 1\n    },\n    // nanos cannot be negative\n    (buf.validate.field).timestamp.lte = {\n      seconds: 1\n      nanos: -1\n    }\n  ];\n  google.protobuf.Timestamp in_range_timestamp = 13 [\n    // a timestamp is at least -62135596800 seconds.\n    (buf.validate.field).timestamp.gte = {\n      seconds: -62135596800\n      nanos: 0\n    },\n    // a timestamp is at most 253402300799 seconds.\n    (buf.validate.field).timestamp.lte = {\n      seconds: 253402300799\n      nanos: 999999999\n    }\n  ];\n  google.protobuf.Timestamp out_of_range = 14 [\n    // a timestamp is at least -62135596800 seconds.\n    (buf.validate.field).timestamp.gte = {\n      seconds: -62135596801\n      nanos: 0\n    },\n    // a timestamp is at most 253402300799 seconds.\n    (buf.validate.field).timestamp.lte = {\n      seconds: 2534023008000\n      nanos: 999999999\n    }\n  ];\n  // valid\n  google.protobuf.Timestamp valid_within_duration = 15 [(buf.validate.field).timestamp.within = {\n    seconds: 5\n    nanos: 1\n  }];\n  google.protobuf.Timestamp invalid_within_duraion = 16 [\n    (buf.validate.field).timestamp.lt_now = true,\n    // seconds and nanos must have the same sign\n    (buf.validate.field).timestamp.within = {\n      seconds: 1\n      nanos: -1\n    }\n  ];\n  google.protobuf.Timestamp negative_within_duraion = 17 [\n    (buf.validate.field).timestamp.lt_now = true,\n    // within must be positive\n    (buf.validate.field).timestamp.within = {\n      seconds: -1\n      nanos: -1\n    }\n  ];\n  NotTimestamp type_mismatch = 18 [\n    // timestamp rules can only be defined on a timestamp field\n    (buf.validate.field).timestamp.gt = {\n      seconds: 5\n      nanos: 1\n    },\n    (buf.validate.field).timestamp.lte = {\n      seconds: 4\n      nanos: 1\n    }\n  ];\n  google.protobuf.Timestamp valid_example = 19 [\n    (buf.validate.field).timestamp.gt = {\n      seconds: 5\n      nanos: 2\n    },\n    (buf.validate.field).timestamp.lte = {\n      seconds: 5\n      nanos: 0\n    },\n    (buf.validate.field).timestamp.example = {\n      seconds: 4\n      nanos: 1\n    }\n  ];\n  google.protobuf.Timestamp invalid_example = 20 [\n    (buf.validate.field).timestamp.gt = {\n      seconds: 5\n      nanos: 2\n    },\n    (buf.validate.field).timestamp.lte = {\n      seconds: 5\n      nanos: 0\n    },\n    (buf.validate.field).timestamp.example = {\n      seconds: 5\n      nanos: 17\n    }\n  ];\n  google.protobuf.Timestamp valid_no_constraint_example = 21 [(buf.validate.field).timestamp.example = {\n    seconds: 5\n    nanos: 17\n  }];\n  google.protobuf.Timestamp invalid_no_constraint_example = 22 [(buf.validate.field).duration.example = {\n    seconds: 1\n    nanos: 3\n  }];\n}\n\nmessage NotTimestamp {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate/vendor/protovalidate/buf/validate/validate.proto",
    "content": "// Copyright 2023-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto2\";\n\npackage buf.validate;\n\nimport \"google/protobuf/descriptor.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/field_mask.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\noption go_package = \"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\";\noption java_multiple_files = true;\noption java_outer_classname = \"ValidateProto\";\noption java_package = \"build.buf.validate\";\n\n// MessageOptions is an extension to google.protobuf.MessageOptions. It allows\n// the addition of validation rules at the message level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.MessageOptions {\n  // Rules specify the validations to be performed on this message. By default,\n  // no validation is performed against a message.\n  optional MessageRules message = 1159;\n}\n\n// OneofOptions is an extension to google.protobuf.OneofOptions. It allows\n// the addition of validation rules on a oneof. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.OneofOptions {\n  // Rules specify the validations to be performed on this oneof. By default,\n  // no validation is performed against a oneof.\n  optional OneofRules oneof = 1159;\n}\n\n// FieldOptions is an extension to google.protobuf.FieldOptions. It allows\n// the addition of validation rules at the field level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.FieldOptions {\n  // Rules specify the validations to be performed on this field. By default,\n  // no validation is performed against a field.\n  optional FieldRules field = 1159;\n\n  // Specifies predefined rules. When extending a standard rule message,\n  // this adds additional CEL expressions that apply when the extension is used.\n  //\n  // ```proto\n  // extend buf.validate.Int32Rules {\n  //   bool is_zero [(buf.validate.predefined).cel = {\n  //     id: \"int32.is_zero\",\n  //     message: \"value must be zero\",\n  //     expression: \"!rule || this == 0\",\n  //   }];\n  // }\n  //\n  // message Foo {\n  //   int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true];\n  // }\n  // ```\n  optional PredefinedRules predefined = 1160;\n}\n\n// `Rule` represents a validation rule written in the Common Expression\n// Language (CEL) syntax. Each Rule includes a unique identifier, an\n// optional error message, and the CEL expression to evaluate. For more\n// information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n//\n// ```proto\n// message Foo {\n//   option (buf.validate.message).cel = {\n//     id: \"foo.bar\"\n//     message: \"bar must be greater than 0\"\n//     expression: \"this.bar > 0\"\n//   };\n//   int32 bar = 1;\n// }\n// ```\nmessage Rule {\n  // `id` is a string that serves as a machine-readable name for this Rule.\n  // It should be unique within its scope, which could be either a message or a field.\n  optional string id = 1;\n\n  // `message` is an optional field that provides a human-readable error message\n  // for this Rule when the CEL expression evaluates to false. If a\n  // non-empty message is provided, any strings resulting from the CEL\n  // expression evaluation are ignored.\n  optional string message = 2;\n\n  // `expression` is the actual CEL expression that will be evaluated for\n  // validation. This string must resolve to either a boolean or a string\n  // value. If the expression evaluates to false or a non-empty string, the\n  // validation is considered failed, and the message is rejected.\n  optional string expression = 3;\n}\n\n// MessageRules represents validation rules that are applied to the entire message.\n// It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.\nmessage MessageRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel_expression = \"this.foo > 42\";\n  //   // The field `foo` must be less than 84.\n  //   option (buf.validate.message).cel_expression = \"this.foo < 84\";\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated string cel_expression = 5;\n  // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.\n  // These rules are written in Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this.foo > 42\",\n  //   };\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated Rule cel = 3;\n\n  // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields\n  // of which at most one can be present. If `required` is also specified, then exactly one\n  // of the specified fields _must_ be present.\n  //\n  // This will enforce oneof-like constraints with a few features not provided by\n  // actual Protobuf oneof declarations:\n  //   1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,\n  //      only scalar fields are allowed.\n  //   2. Fields with implicit presence are allowed. In a Protobuf oneof, all member\n  //      fields have explicit presence. This means that, for the purpose of determining\n  //      how many fields are set, explicitly setting such a field to its zero value is\n  //      effectively the same as not setting it at all.\n  //   3. This will always generate validation errors for a message unmarshalled from\n  //      serialized data that sets more than one field. With a Protobuf oneof, when\n  //      multiple fields are present in the serialized form, earlier values are usually\n  //      silently ignored when unmarshalling, with only the last field being set when\n  //      unmarshalling completes.\n  //\n  // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means\n  // only the field that is set will be validated and the unset fields are not validated according to the field rules.\n  // This behavior can be overridden by setting `ignore` against a field.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // Only one of `field1` or `field2` _can_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field1\", \"field2\"] };\n  //   // Exactly one of `field3` or `field4` _must_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field3\", \"field4\"], required: true };\n  //   string field1 = 1;\n  //   bytes field2 = 2;\n  //   bool field3 = 3;\n  //   int32 field4 = 4;\n  // }\n  // ```\n  repeated MessageOneofRule oneof = 4;\n\n  reserved 1;\n  reserved \"disabled\";\n}\n\nmessage MessageOneofRule {\n  // A list of field names to include in the oneof. All field names must be\n  // defined in the message. At least one field must be specified, and\n  // duplicates are not permitted.\n  repeated string fields = 1;\n  // If true, one of the fields specified _must_ be set.\n  optional bool required = 2;\n}\n\n// The `OneofRules` message type enables you to manage rules for\n// oneof fields in your protobuf messages.\nmessage OneofRules {\n  // If `required` is true, exactly one field of the oneof must be set. A\n  // validation error is returned if no fields in the oneof are set. Further rules\n  // should be placed on the fields themselves to ensure they are valid values,\n  // such as `min_len` or `gt`.\n  //\n  // ```proto\n  // message MyMessage {\n  //   oneof value {\n  //     // Either `a` or `b` must be set. If `a` is set, it must also be\n  //     // non-empty; whereas if `b` is set, it can still be an empty string.\n  //     option (buf.validate.oneof).required = true;\n  //     string a = 1 [(buf.validate.field).string.min_len = 1];\n  //     string b = 2;\n  //   }\n  // }\n  // ```\n  optional bool required = 1;\n}\n\n// FieldRules encapsulates the rules for each type of field. Depending on\n// the field, the correct set should be used to ensure proper validations.\nmessage FieldRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel_expression = \"this > 42\"];\n  // }\n  // ```\n  repeated string cel_expression = 29;\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 23;\n  // If `required` is true, the field must be set. A validation error is returned\n  // if the field is not set.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithPresence {\n  //   // Requires any string to be set, including the empty string.\n  //   optional string link = 1 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires true or false to be set.\n  //   optional bool disabled = 2 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires a message to be set, including the empty message.\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // All fields in the example above track presence. By default, Protovalidate\n  // ignores rules on those fields if no value is set. `required` ensures that\n  // the fields are set and valid.\n  //\n  // Fields that don't track presence are always validated by Protovalidate,\n  // whether they are set or not. It is not necessary to add `required`. It\n  // can be added to indicate that the field cannot be the zero value.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithoutPresence {\n  //   // `string.email` always applies, even to an empty string.\n  //   string link = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   // `repeated.min_items` always applies, even to an empty list.\n  //   repeated string labels = 2 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  //   // `required`, for fields that don't track presence, indicates\n  //   // the value of the field can't be the zero value.\n  //   int32 zero_value_not_allowed = 3 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  //\n  // Note: While field rules can be applied to repeated items, map keys, and map\n  // values, the elements are always considered to be set. Consequently,\n  // specifying `repeated.items.required` is redundant.\n  optional bool required = 25;\n  // Ignore validation rules on the field if its value matches the specified\n  // criteria. See the `Ignore` enum for details.\n  //\n  // ```proto\n  // message UpdateRequest {\n  //   // The uri rule only applies if the field is not an empty string.\n  //   string url = 1 [\n  //     (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,\n  //     (buf.validate.field).string.uri = true\n  //   ];\n  // }\n  // ```\n  optional Ignore ignore = 27;\n\n  oneof type {\n    // Scalar Field Types\n    FloatRules float = 1;\n    DoubleRules double = 2;\n    Int32Rules int32 = 3;\n    Int64Rules int64 = 4;\n    UInt32Rules uint32 = 5;\n    UInt64Rules uint64 = 6;\n    SInt32Rules sint32 = 7;\n    SInt64Rules sint64 = 8;\n    Fixed32Rules fixed32 = 9;\n    Fixed64Rules fixed64 = 10;\n    SFixed32Rules sfixed32 = 11;\n    SFixed64Rules sfixed64 = 12;\n    BoolRules bool = 13;\n    StringRules string = 14;\n    BytesRules bytes = 15;\n\n    // Complex Field Types\n    EnumRules enum = 16;\n    RepeatedRules repeated = 18;\n    MapRules map = 19;\n\n    // Well-Known Field Types\n    AnyRules any = 20;\n    DurationRules duration = 21;\n    FieldMaskRules field_mask = 28;\n    TimestampRules timestamp = 22;\n  }\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// PredefinedRules are custom rules that can be re-used with\n// multiple fields.\nmessage PredefinedRules {\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.predefined).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 1;\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// Specifies how `FieldRules.ignore` behaves, depending on the field's value, and\n// whether the field tracks presence.\nenum Ignore {\n  // Ignore rules if the field tracks presence and is unset. This is the default\n  // behavior.\n  //\n  // In proto3, only message fields, members of a Protobuf `oneof`, and fields\n  // with the `optional` label track presence. Consequently, the following fields\n  // are always validated, whether a value is set or not:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApply {\n  //   string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   int32 age = 2 [\n  //     (buf.validate.field).int32.gt = 0\n  //   ];\n  //   repeated string labels = 3 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  // }\n  // ```\n  //\n  // In contrast, the following fields track presence, and are only validated if\n  // a value is set:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApplyIfSet {\n  //   optional string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   oneof ref {\n  //     string reference = 2 [\n  //       (buf.validate.field).string.uuid = true\n  //     ];\n  //     string name = 3 [\n  //       (buf.validate.field).string.min_len = 4\n  //     ];\n  //   }\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).cel = {/* ... */}\n  //   ];\n  // }\n  // ```\n  //\n  // To ensure that such a field is set, add the `required` rule.\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  IGNORE_UNSPECIFIED = 0;\n\n  // Ignore rules if the field is unset, or set to the zero value.\n  //\n  // The zero value depends on the field type:\n  // - For strings, the zero value is the empty string.\n  // - For bytes, the zero value is empty bytes.\n  // - For bool, the zero value is false.\n  // - For numeric types, the zero value is zero.\n  // - For enums, the zero value is the first defined enum value.\n  // - For repeated fields, the zero is an empty list.\n  // - For map fields, the zero is an empty map.\n  // - For message fields, absence of the message (typically a null-value) is considered zero value.\n  //\n  // For fields that track presence (e.g. adding the `optional` label in proto3),\n  // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.\n  IGNORE_IF_ZERO_VALUE = 1;\n\n  // Always ignore rules, including the `required` rule.\n  //\n  // This is useful for ignoring the rules of a referenced message, or to\n  // temporarily ignore rules during development.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field's rules will always be ignored, including any validations\n  //   // on value's fields.\n  //   MyOtherMessage value = 1 [\n  //     (buf.validate.field).ignore = IGNORE_ALWAYS\n  //   ];\n  // }\n  // ```\n  IGNORE_ALWAYS = 3;\n\n  reserved 2;\n  reserved \"IGNORE_EMPTY\", \"IGNORE_DEFAULT\", \"IGNORE_IF_DEFAULT_VALUE\", \"IGNORE_IF_UNPOPULATED\";\n}\n\n// FloatRules describes the rules applied to `float` values. These\n// rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.\nmessage FloatRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must equal 42.0\n  //   float value = 1 [(buf.validate.field).float.const = 42.0];\n  // }\n  // ```\n  optional float const = 1 [(predefined).cel = {\n    id: \"float.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than 10.0\n    //   float value = 1 [(buf.validate.field).float.lt = 10.0];\n    // }\n    // ```\n    float lt = 2 [(predefined).cel = {\n      id: \"float.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than or equal to 10.0\n    //   float value = 1 [(buf.validate.field).float.lte = 10.0];\n    // }\n    // ```\n    float lte = 3 [(predefined).cel = {\n      id: \"float.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than 5.0 [float.gt]\n    //   float value = 1 [(buf.validate.field).float.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [float.gt_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gt = 4 [\n      (predefined).cel = {\n        id: \"float.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than or equal to 5.0 [float.gte]\n    //   float value = 1 [(buf.validate.field).float.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gte = 5 [\n      (predefined).cel = {\n        id: \"float.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float in = 6 [(predefined).cel = {\n    id: \"float.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float not_in = 7 [(predefined).cel = {\n    id: \"float.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"float.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFloat {\n  //   float value = 1 [\n  //     (buf.validate.field).float.example = 1.0,\n  //     (buf.validate.field).float.example = inf\n  //   ];\n  // }\n  // ```\n  repeated float example = 9 [(predefined).cel = {\n    id: \"float.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// DoubleRules describes the rules applied to `double` values. These\n// rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.\nmessage DoubleRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must equal 42.0\n  //   double value = 1 [(buf.validate.field).double.const = 42.0];\n  // }\n  // ```\n  optional double const = 1 [(predefined).cel = {\n    id: \"double.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than 10.0\n    //   double value = 1 [(buf.validate.field).double.lt = 10.0];\n    // }\n    // ```\n    double lt = 2 [(predefined).cel = {\n      id: \"double.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified value\n    // (field <= value). If the field value is greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than or equal to 10.0\n    //   double value = 1 [(buf.validate.field).double.lte = 10.0];\n    // }\n    // ```\n    double lte = 3 [(predefined).cel = {\n      id: \"double.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,\n    // the range is reversed, and the field value must be outside the specified\n    // range. If the field value doesn't meet the required conditions, an error\n    // message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than 5.0 [double.gt]\n    //   double value = 1 [(buf.validate.field).double.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [double.gt_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gt = 4 [\n      (predefined).cel = {\n        id: \"double.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than or equal to 5.0 [double.gte]\n    //   double value = 1 [(buf.validate.field).double.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gte = 5 [\n      (predefined).cel = {\n        id: \"double.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double in = 6 [(predefined).cel = {\n    id: \"double.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double not_in = 7 [(predefined).cel = {\n    id: \"double.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"double.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDouble {\n  //   double value = 1 [\n  //     (buf.validate.field).double.example = 1.0,\n  //     (buf.validate.field).double.example = inf\n  //   ];\n  // }\n  // ```\n  repeated double example = 9 [(predefined).cel = {\n    id: \"double.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int32Rules describes the rules applied to `int32` values. These\n// rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.\nmessage Int32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must equal 42\n  //   int32 value = 1 [(buf.validate.field).int32.const = 42];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"int32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than 10\n    //   int32 value = 1 [(buf.validate.field).int32.lt = 10];\n    // }\n    // ```\n    int32 lt = 2 [(predefined).cel = {\n      id: \"int32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than or equal to 10\n    //   int32 value = 1 [(buf.validate.field).int32.lte = 10];\n    // }\n    // ```\n    int32 lte = 3 [(predefined).cel = {\n      id: \"int32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than 5 [int32.gt]\n    //   int32 value = 1 [(buf.validate.field).int32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int32.gt_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gt = 4 [\n      (predefined).cel = {\n        id: \"int32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified value\n    // (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than or equal to 5 [int32.gte]\n    //   int32 value = 1 [(buf.validate.field).int32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gte = 5 [\n      (predefined).cel = {\n        id: \"int32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 in = 6 [(predefined).cel = {\n    id: \"int32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 not_in = 7 [(predefined).cel = {\n    id: \"int32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   int32 value = 1 [\n  //     (buf.validate.field).int32.example = 1,\n  //     (buf.validate.field).int32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int32 example = 8 [(predefined).cel = {\n    id: \"int32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int64Rules describes the rules applied to `int64` values. These\n// rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.\nmessage Int64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must equal 42\n  //   int64 value = 1 [(buf.validate.field).int64.const = 42];\n  // }\n  // ```\n  optional int64 const = 1 [(predefined).cel = {\n    id: \"int64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than 10\n    //   int64 value = 1 [(buf.validate.field).int64.lt = 10];\n    // }\n    // ```\n    int64 lt = 2 [(predefined).cel = {\n      id: \"int64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than or equal to 10\n    //   int64 value = 1 [(buf.validate.field).int64.lte = 10];\n    // }\n    // ```\n    int64 lte = 3 [(predefined).cel = {\n      id: \"int64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than 5 [int64.gt]\n    //   int64 value = 1 [(buf.validate.field).int64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int64.gt_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gt = 4 [\n      (predefined).cel = {\n        id: \"int64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than or equal to 5 [int64.gte]\n    //   int64 value = 1 [(buf.validate.field).int64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gte = 5 [\n      (predefined).cel = {\n        id: \"int64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 in = 6 [(predefined).cel = {\n    id: \"int64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 not_in = 7 [(predefined).cel = {\n    id: \"int64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   int64 value = 1 [\n  //     (buf.validate.field).int64.example = 1,\n  //     (buf.validate.field).int64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int64 example = 9 [(predefined).cel = {\n    id: \"int64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt32Rules describes the rules applied to `uint32` values. These\n// rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.\nmessage UInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must equal 42\n  //   uint32 value = 1 [(buf.validate.field).uint32.const = 42];\n  // }\n  // ```\n  optional uint32 const = 1 [(predefined).cel = {\n    id: \"uint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lt = 10];\n    // }\n    // ```\n    uint32 lt = 2 [(predefined).cel = {\n      id: \"uint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than or equal to 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lte = 10];\n    // }\n    // ```\n    uint32 lte = 3 [(predefined).cel = {\n      id: \"uint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than 5 [uint32.gt]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint32.gt_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gt = 4 [\n      (predefined).cel = {\n        id: \"uint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than or equal to 5 [uint32.gte]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gte = 5 [\n      (predefined).cel = {\n        id: \"uint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 in = 6 [(predefined).cel = {\n    id: \"uint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 not_in = 7 [(predefined).cel = {\n    id: \"uint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   uint32 value = 1 [\n  //     (buf.validate.field).uint32.example = 1,\n  //     (buf.validate.field).uint32.example = 10\n  //   ];\n  // }\n  // ```\n  repeated uint32 example = 8 [(predefined).cel = {\n    id: \"uint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt64Rules describes the rules applied to `uint64` values. These\n// rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.\nmessage UInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must equal 42\n  //   uint64 value = 1 [(buf.validate.field).uint64.const = 42];\n  // }\n  // ```\n  optional uint64 const = 1 [(predefined).cel = {\n    id: \"uint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lt = 10];\n    // }\n    // ```\n    uint64 lt = 2 [(predefined).cel = {\n      id: \"uint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than or equal to 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lte = 10];\n    // }\n    // ```\n    uint64 lte = 3 [(predefined).cel = {\n      id: \"uint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than 5 [uint64.gt]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint64.gt_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gt = 4 [\n      (predefined).cel = {\n        id: \"uint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than or equal to 5 [uint64.gte]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gte = 5 [\n      (predefined).cel = {\n        id: \"uint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 in = 6 [(predefined).cel = {\n    id: \"uint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 not_in = 7 [(predefined).cel = {\n    id: \"uint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   uint64 value = 1 [\n  //     (buf.validate.field).uint64.example = 1,\n  //     (buf.validate.field).uint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated uint64 example = 8 [(predefined).cel = {\n    id: \"uint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt32Rules describes the rules applied to `sint32` values.\nmessage SInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must equal 42\n  //   sint32 value = 1 [(buf.validate.field).sint32.const = 42];\n  // }\n  // ```\n  optional sint32 const = 1 [(predefined).cel = {\n    id: \"sint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lt = 10];\n    // }\n    // ```\n    sint32 lt = 2 [(predefined).cel = {\n      id: \"sint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than or equal to 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lte = 10];\n    // }\n    // ```\n    sint32 lte = 3 [(predefined).cel = {\n      id: \"sint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be greater than 5 [sint32.gt]\n    //   sint32 value = 1 [(buf.validate.field).sint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint32.gt_lt]\n    //   sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]\n    //   sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gt = 4 [\n      (predefined).cel = {\n        id: \"sint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //  // value must be greater than or equal to 5 [sint32.gte]\n    //  sint32 value = 1 [(buf.validate.field).sint32.gte = 5];\n    //\n    //  // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]\n    //  sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];\n    //\n    //  // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]\n    //  sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gte = 5 [\n      (predefined).cel = {\n        id: \"sint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 in = 6 [(predefined).cel = {\n    id: \"sint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 not_in = 7 [(predefined).cel = {\n    id: \"sint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   sint32 value = 1 [\n  //     (buf.validate.field).sint32.example = 1,\n  //     (buf.validate.field).sint32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint32 example = 8 [(predefined).cel = {\n    id: \"sint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt64Rules describes the rules applied to `sint64` values.\nmessage SInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must equal 42\n  //   sint64 value = 1 [(buf.validate.field).sint64.const = 42];\n  // }\n  // ```\n  optional sint64 const = 1 [(predefined).cel = {\n    id: \"sint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lt = 10];\n    // }\n    // ```\n    sint64 lt = 2 [(predefined).cel = {\n      id: \"sint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than or equal to 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lte = 10];\n    // }\n    // ```\n    sint64 lte = 3 [(predefined).cel = {\n      id: \"sint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than 5 [sint64.gt]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint64.gt_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gt = 4 [\n      (predefined).cel = {\n        id: \"sint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than or equal to 5 [sint64.gte]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gte = 5 [\n      (predefined).cel = {\n        id: \"sint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 in = 6 [(predefined).cel = {\n    id: \"sint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 not_in = 7 [(predefined).cel = {\n    id: \"sint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   sint64 value = 1 [\n  //     (buf.validate.field).sint64.example = 1,\n  //     (buf.validate.field).sint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint64 example = 8 [(predefined).cel = {\n    id: \"sint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed32Rules describes the rules applied to `fixed32` values.\nmessage Fixed32Rules {\n  // `const` requires the field value to exactly match the specified value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must equal 42\n  //   fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];\n  // }\n  // ```\n  optional fixed32 const = 1 [(predefined).cel = {\n    id: \"fixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];\n    // }\n    // ```\n    fixed32 lt = 2 [(predefined).cel = {\n      id: \"fixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than or equal to 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];\n    // }\n    // ```\n    fixed32 lte = 3 [(predefined).cel = {\n      id: \"fixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than 5 [fixed32.gt]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed32.gt_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than or equal to 5 [fixed32.gte]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 in = 6 [(predefined).cel = {\n    id: \"fixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 not_in = 7 [(predefined).cel = {\n    id: \"fixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   fixed32 value = 1 [\n  //     (buf.validate.field).fixed32.example = 1,\n  //     (buf.validate.field).fixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed32 example = 8 [(predefined).cel = {\n    id: \"fixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed64Rules describes the rules applied to `fixed64` values.\nmessage Fixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must equal 42\n  //   fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];\n  // }\n  // ```\n  optional fixed64 const = 1 [(predefined).cel = {\n    id: \"fixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];\n    // }\n    // ```\n    fixed64 lt = 2 [(predefined).cel = {\n      id: \"fixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than or equal to 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];\n    // }\n    // ```\n    fixed64 lte = 3 [(predefined).cel = {\n      id: \"fixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than 5 [fixed64.gt]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed64.gt_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than or equal to 5 [fixed64.gte]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 in = 6 [(predefined).cel = {\n    id: \"fixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 not_in = 7 [(predefined).cel = {\n    id: \"fixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   fixed64 value = 1 [\n  //     (buf.validate.field).fixed64.example = 1,\n  //     (buf.validate.field).fixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed64 example = 8 [(predefined).cel = {\n    id: \"fixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed32Rules describes the rules applied to `fixed32` values.\nmessage SFixed32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must equal 42\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];\n  // }\n  // ```\n  optional sfixed32 const = 1 [(predefined).cel = {\n    id: \"sfixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];\n    // }\n    // ```\n    sfixed32 lt = 2 [(predefined).cel = {\n      id: \"sfixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than or equal to 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];\n    // }\n    // ```\n    sfixed32 lte = 3 [(predefined).cel = {\n      id: \"sfixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than 5 [sfixed32.gt]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed32.gt_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than or equal to 5 [sfixed32.gte]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 in = 6 [(predefined).cel = {\n    id: \"sfixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 not_in = 7 [(predefined).cel = {\n    id: \"sfixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   sfixed32 value = 1 [\n  //     (buf.validate.field).sfixed32.example = 1,\n  //     (buf.validate.field).sfixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed32 example = 8 [(predefined).cel = {\n    id: \"sfixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed64Rules describes the rules applied to `fixed64` values.\nmessage SFixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must equal 42\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];\n  // }\n  // ```\n  optional sfixed64 const = 1 [(predefined).cel = {\n    id: \"sfixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];\n    // }\n    // ```\n    sfixed64 lt = 2 [(predefined).cel = {\n      id: \"sfixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than or equal to 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];\n    // }\n    // ```\n    sfixed64 lte = 3 [(predefined).cel = {\n      id: \"sfixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than 5 [sfixed64.gt]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed64.gt_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than or equal to 5 [sfixed64.gte]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 in = 6 [(predefined).cel = {\n    id: \"sfixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 not_in = 7 [(predefined).cel = {\n    id: \"sfixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   sfixed64 value = 1 [\n  //     (buf.validate.field).sfixed64.example = 1,\n  //     (buf.validate.field).sfixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed64 example = 8 [(predefined).cel = {\n    id: \"sfixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// BoolRules describes the rules applied to `bool` values. These rules\n// may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.\nmessage BoolRules {\n  // `const` requires the field value to exactly match the specified boolean value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBool {\n  //   // value must equal true\n  //   bool value = 1 [(buf.validate.field).bool.const = true];\n  // }\n  // ```\n  optional bool const = 1 [(predefined).cel = {\n    id: \"bool.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBool {\n  //   bool value = 1 [\n  //     (buf.validate.field).bool.example = 1,\n  //     (buf.validate.field).bool.example = 2\n  //   ];\n  // }\n  // ```\n  repeated bool example = 2 [(predefined).cel = {\n    id: \"bool.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// StringRules describes the rules applied to `string` values These\n// rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.\nmessage StringRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must equal `hello`\n  //   string value = 1 [(buf.validate.field).string.const = \"hello\"];\n  // }\n  // ```\n  optional string const = 1 [(predefined).cel = {\n    id: \"string.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal `%s`'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` dictates that the field value must have the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value does not meet the specified\n  // length, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 5 characters\n  //   string value = 1 [(buf.validate.field).string.len = 5];\n  // }\n  // ```\n  optional uint64 len = 19 [(predefined).cel = {\n    id: \"string.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s characters'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` specifies that the field value must have at least the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value contains fewer characters, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 3 characters\n  //   string value = 1 [(buf.validate.field).string.min_len = 3];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"string.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s characters'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` specifies that the field value must have no more than the specified\n  // number of characters (Unicode code points), which may differ from the\n  // number of bytes in the string. If the field value contains more characters,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 10 characters\n  //   string value = 1 [(buf.validate.field).string.max_len = 10];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"string.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value length must be at most %s characters'.format([rules.max_len]) : ''\"\n  }];\n\n  // `len_bytes` dictates that the field value must have the specified number of\n  // bytes. If the field value does not match the specified length in bytes,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 6 bytes\n  //   string value = 1 [(buf.validate.field).string.len_bytes = 6];\n  // }\n  // ```\n  optional uint64 len_bytes = 20 [(predefined).cel = {\n    id: \"string.len_bytes\"\n    expression: \"uint(bytes(this).size()) != rules.len_bytes ? 'value length must be %s bytes'.format([rules.len_bytes]) : ''\"\n  }];\n\n  // `min_bytes` specifies that the field value must have at least the specified\n  // number of bytes. If the field value contains fewer bytes, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 4 bytes\n  //   string value = 1 [(buf.validate.field).string.min_bytes = 4];\n  // }\n  //\n  // ```\n  optional uint64 min_bytes = 4 [(predefined).cel = {\n    id: \"string.min_bytes\"\n    expression: \"uint(bytes(this).size()) < rules.min_bytes ? 'value length must be at least %s bytes'.format([rules.min_bytes]) : ''\"\n  }];\n\n  // `max_bytes` specifies that the field value must have no more than the\n  //specified number of bytes. If the field value contains more bytes, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 8 bytes\n  //   string value = 1 [(buf.validate.field).string.max_bytes = 8];\n  // }\n  // ```\n  optional uint64 max_bytes = 5 [(predefined).cel = {\n    id: \"string.max_bytes\"\n    expression: \"uint(bytes(this).size()) > rules.max_bytes ? 'value length must be at most %s bytes'.format([rules.max_bytes]) : ''\"\n  }];\n\n  // `pattern` specifies that the field value must match the specified\n  // regular expression (RE2 syntax), with the expression provided without any\n  // delimiters. If the field value doesn't match the regular expression, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not match regex pattern `^[a-zA-Z]//$`\n  //   string value = 1 [(buf.validate.field).string.pattern = \"^[a-zA-Z]//$\"];\n  // }\n  // ```\n  optional string pattern = 6 [(predefined).cel = {\n    id: \"string.pattern\"\n    expression: \"!this.matches(rules.pattern) ? 'value does not match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` specifies that the field value must have the\n  //specified substring at the beginning of the string. If the field value\n  // doesn't start with the specified prefix, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have prefix `pre`\n  //   string value = 1 [(buf.validate.field).string.prefix = \"pre\"];\n  // }\n  // ```\n  optional string prefix = 7 [(predefined).cel = {\n    id: \"string.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix `%s`'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` specifies that the field value must have the\n  //specified substring at the end of the string. If the field value doesn't\n  // end with the specified suffix, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have suffix `post`\n  //   string value = 1 [(buf.validate.field).string.suffix = \"post\"];\n  // }\n  // ```\n  optional string suffix = 8 [(predefined).cel = {\n    id: \"string.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix `%s`'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` specifies that the field value must have the\n  //specified substring anywhere in the string. If the field value doesn't\n  // contain the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not contain substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.contains = \"inside\"];\n  // }\n  // ```\n  optional string contains = 9 [(predefined).cel = {\n    id: \"string.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain substring `%s`'.format([rules.contains]) : ''\"\n  }];\n\n  // `not_contains` specifies that the field value must not have the\n  //specified substring anywhere in the string. If the field value contains\n  // the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value contains substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.not_contains = \"inside\"];\n  // }\n  // ```\n  optional string not_contains = 23 [(predefined).cel = {\n    id: \"string.not_contains\"\n    expression: \"this.contains(rules.not_contains) ? 'value contains substring `%s`'.format([rules.not_contains]) : ''\"\n  }];\n\n  // `in` specifies that the field value must be equal to one of the specified\n  // values. If the field value isn't one of the specified values, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must be in list [\"apple\", \"banana\"]\n  //   string value = 1 [(buf.validate.field).string.in = \"apple\", (buf.validate.field).string.in = \"banana\"];\n  // }\n  // ```\n  repeated string in = 10 [(predefined).cel = {\n    id: \"string.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` specifies that the field value cannot be equal to any\n  // of the specified values. If the field value is one of the specified values,\n  // an error message will be generated.\n  // ```proto\n  // message MyString {\n  //   // value must not be in list [\"orange\", \"grape\"]\n  //   string value = 1 [(buf.validate.field).string.not_in = \"orange\", (buf.validate.field).string.not_in = \"grape\"];\n  // }\n  // ```\n  repeated string not_in = 11 [(predefined).cel = {\n    id: \"string.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `WellKnown` rules provide advanced rules against common string\n  // patterns.\n  oneof well_known {\n    // `email` specifies that the field value must be a valid email address, for\n    // example \"foo@example.com\".\n    //\n    // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).\n    // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),\n    // which allows many unexpected forms of email addresses and will easily match\n    // a typographical error.\n    //\n    // If the field value isn't a valid email address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid email address\n    //   string value = 1 [(buf.validate.field).string.email = true];\n    // }\n    // ```\n    bool email = 12 [\n      (predefined).cel = {\n        id: \"string.email\"\n        message: \"value must be a valid email address\"\n        expression: \"!rules.email || this == '' || this.isEmail()\"\n      },\n      (predefined).cel = {\n        id: \"string.email_empty\"\n        message: \"value is empty, which is not a valid email address\"\n        expression: \"!rules.email || this != ''\"\n      }\n    ];\n\n    // `hostname` specifies that the field value must be a valid hostname, for\n    // example \"foo.example.com\".\n    //\n    // A valid hostname follows the rules below:\n    // - The name consists of one or more labels, separated by a dot (\".\").\n    // - Each label can be 1 to 63 alphanumeric characters.\n    // - A label can contain hyphens (\"-\"), but must not start or end with a hyphen.\n    // - The right-most label must not be digits only.\n    // - The name can have a trailing dot—for example, \"foo.example.com.\".\n    // - The name can be 253 characters at most, excluding the optional trailing dot.\n    //\n    // If the field value isn't a valid hostname, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname\n    //   string value = 1 [(buf.validate.field).string.hostname = true];\n    // }\n    // ```\n    bool hostname = 13 [\n      (predefined).cel = {\n        id: \"string.hostname\"\n        message: \"value must be a valid hostname\"\n        expression: \"!rules.hostname || this == '' || this.isHostname()\"\n      },\n      (predefined).cel = {\n        id: \"string.hostname_empty\"\n        message: \"value is empty, which is not a valid hostname\"\n        expression: \"!rules.hostname || this != ''\"\n      }\n    ];\n\n    // `ip` specifies that the field value must be a valid IP (v4 or v6) address.\n    //\n    // IPv4 addresses are expected in the dotted decimal format—for example, \"192.168.5.21\".\n    // IPv6 addresses are expected in their text representation—for example, \"::1\",\n    // or \"2001:0DB8:ABCD:0012::0\".\n    //\n    // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone identifiers for IPv6 addresses (for example, \"fe80::a%en1\") are supported.\n    //\n    // If the field value isn't a valid IP address, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP address\n    //   string value = 1 [(buf.validate.field).string.ip = true];\n    // }\n    // ```\n    bool ip = 14 [\n      (predefined).cel = {\n        id: \"string.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this == '' || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this != ''\"\n      }\n    ];\n\n    // `ipv4` specifies that the field value must be a valid IPv4 address—for\n    // example \"192.168.5.21\". If the field value isn't a valid IPv4 address, an\n    // error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address\n    //   string value = 1 [(buf.validate.field).string.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 15 [\n      (predefined).cel = {\n        id: \"string.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this == '' || this.isIp(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this != ''\"\n      }\n    ];\n\n    // `ipv6` specifies that the field value must be a valid IPv6 address—for\n    // example \"::1\", or \"d7a:115c:a1e0:ab12:4843:cd96:626b:430b\". If the field\n    // value is not a valid IPv6 address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address\n    //   string value = 1 [(buf.validate.field).string.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 16 [\n      (predefined).cel = {\n        id: \"string.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this == '' || this.isIp(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this != ''\"\n      }\n    ];\n\n    // `uri` specifies that the field value must be a valid URI, for example\n    // \"https://example.com/foo/bar?baz=quux#frag\".\n    //\n    // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI\n    //   string value = 1 [(buf.validate.field).string.uri = true];\n    // }\n    // ```\n    bool uri = 17 [\n      (predefined).cel = {\n        id: \"string.uri\"\n        message: \"value must be a valid URI\"\n        expression: \"!rules.uri || this == '' || this.isUri()\"\n      },\n      (predefined).cel = {\n        id: \"string.uri_empty\"\n        message: \"value is empty, which is not a valid URI\"\n        expression: \"!rules.uri || this != ''\"\n      }\n    ];\n\n    // `uri_ref` specifies that the field value must be a valid URI Reference—either\n    // a URI such as \"https://example.com/foo/bar?baz=quux#frag\", or a Relative\n    // Reference such as \"./foo/bar?query\".\n    //\n    // URI, URI Reference, and Relative Reference are defined in the internet\n    // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone\n    // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI Reference, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI Reference\n    //   string value = 1 [(buf.validate.field).string.uri_ref = true];\n    // }\n    // ```\n    bool uri_ref = 18 [(predefined).cel = {\n      id: \"string.uri_ref\"\n      message: \"value must be a valid URI Reference\"\n      expression: \"!rules.uri_ref || this.isUriRef()\"\n    }];\n\n    // `address` specifies that the field value must be either a valid hostname\n    // (for example, \"example.com\"), or a valid IP (v4 or v6) address (for example,\n    // \"192.168.0.1\", or \"::1\"). If the field value isn't a valid hostname or IP,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname, or ip address\n    //   string value = 1 [(buf.validate.field).string.address = true];\n    // }\n    // ```\n    bool address = 21 [\n      (predefined).cel = {\n        id: \"string.address\"\n        message: \"value must be a valid hostname, or ip address\"\n        expression: \"!rules.address || this == '' || this.isHostname() || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.address_empty\"\n        message: \"value is empty, which is not a valid hostname, or ip address\"\n        expression: \"!rules.address || this != ''\"\n      }\n    ];\n\n    // `uuid` specifies that the field value must be a valid UUID as defined by\n    // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the\n    // field value isn't a valid UUID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid UUID\n    //   string value = 1 [(buf.validate.field).string.uuid = true];\n    // }\n    // ```\n    bool uuid = 22 [\n      (predefined).cel = {\n        id: \"string.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this != ''\"\n      }\n    ];\n\n    // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes\n    // omitted. If the field value isn't a valid UUID without dashes, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid trimmed UUID\n    //   string value = 1 [(buf.validate.field).string.tuuid = true];\n    // }\n    // ```\n    bool tuuid = 33 [\n      (predefined).cel = {\n        id: \"string.tuuid\"\n        message: \"value must be a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this == '' || this.matches('^[0-9a-fA-F]{32}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.tuuid_empty\"\n        message: \"value is empty, which is not a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this != ''\"\n      }\n    ];\n\n    // `ip_with_prefixlen` specifies that the field value must be a valid IP\n    // (v4 or v6) address with prefix length—for example, \"192.168.5.21/16\" or\n    // \"2001:0DB8:ABCD:0012::F1/64\". If the field value isn't a valid IP with\n    // prefix length, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP with prefix length\n    //    string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];\n    // }\n    // ```\n    bool ip_with_prefixlen = 26 [\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this == '' || this.isIpPrefix()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv4_with_prefixlen` specifies that the field value must be a valid\n    // IPv4 address with prefix length—for example, \"192.168.5.21/16\". If the\n    // field value isn't a valid IPv4 address with prefix length, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address with prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv4_with_prefixlen = 27 [\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen\"\n        message: \"value must be a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv6_with_prefixlen` specifies that the field value must be a valid\n    // IPv6 address with prefix length—for example, \"2001:0DB8:ABCD:0012::F1/64\".\n    // If the field value is not a valid IPv6 address with prefix length,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv6_with_prefixlen = 28 [\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen\"\n        message: \"value must be a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)\n    // prefix—for example, \"192.168.0.0/16\" or \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value isn't a valid IP prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP prefix\n    //    string value = 1 [(buf.validate.field).string.ip_prefix = true];\n    // }\n    // ```\n    bool ip_prefix = 29 [\n      (predefined).cel = {\n        id: \"string.ip_prefix\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this == '' || this.isIpPrefix(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_prefix_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv4_prefix` specifies that the field value must be a valid IPv4\n    // prefix, for example \"192.168.0.0/16\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"192.168.0.0/16\" designates the left-most 16 bits for the prefix,\n    // and the remaining 16 bits must be zero.\n    //\n    // If the field value isn't a valid IPv4 prefix, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv4_prefix = true];\n    // }\n    // ```\n    bool ipv4_prefix = 30 [\n      (predefined).cel = {\n        id: \"string.ipv4_prefix\"\n        message: \"value must be a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this == '' || this.isIpPrefix(4, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for\n    // example, \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value is not a valid IPv6 prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv6_prefix = true];\n    // }\n    // ```\n    bool ipv6_prefix = 31 [\n      (predefined).cel = {\n        id: \"string.ipv6_prefix\"\n        message: \"value must be a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this == '' || this.isIpPrefix(6, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this != ''\"\n      }\n    ];\n\n    // `host_and_port` specifies that the field value must be valid host/port\n    // pair—for example, \"example.com:8080\".\n    //\n    // The host can be one of:\n    //- An IPv4 address in dotted decimal format—for example, \"192.168.5.21\".\n    //- An IPv6 address enclosed in square brackets—for example, \"[2001:0DB8:ABCD:0012::F1]\".\n    //- A hostname—for example, \"example.com\".\n    //\n    // The port is separated by a colon. It must be non-empty, with a decimal number\n    // in the range of 0-65535, inclusive.\n    bool host_and_port = 32 [\n      (predefined).cel = {\n        id: \"string.host_and_port\"\n        message: \"value must be a valid host (hostname or IP address) and port pair\"\n        expression: \"!rules.host_and_port || this == '' || this.isHostAndPort(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.host_and_port_empty\"\n        message: \"value is empty, which is not a valid host and port pair\"\n        expression: \"!rules.host_and_port || this != ''\"\n      }\n    ];\n\n    // `ulid` specifies that the field value must be a valid ULID (Universally Unique\n    // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).\n    // If the field value isn't a valid ULID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid ULID\n    //   string value = 1 [(buf.validate.field).string.ulid = true];\n    // }\n    // ```\n    bool ulid = 35 [\n      (predefined).cel = {\n        id: \"string.ulid\"\n        message: \"value must be a valid ULID\"\n        expression: \"!rules.ulid || this == '' || this.matches('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.ulid_empty\"\n        message: \"value is empty, which is not a valid ULID\"\n        expression: \"!rules.ulid || this != ''\"\n      }\n    ];\n\n    // `well_known_regex` specifies a common well-known pattern\n    // defined as a regex. If the field value doesn't match the well-known\n    // regex, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid HTTP header value\n    //   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];\n    // }\n    // ```\n    //\n    // #### KnownRegex\n    //\n    // `well_known_regex` contains some well-known patterns.\n    //\n    // | Name                          | Number | Description                               |\n    // |-------------------------------|--------|-------------------------------------------|\n    // | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |\n    // | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2)  |\n    // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |\n    KnownRegex well_known_regex = 24 [\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name\"\n        message: \"value must be a valid HTTP header name\"\n        expression:\n          \"rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^:?[0-9a-zA-Z!#$%&\\\\'*+-.^_|~\\\\x60]+$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]+$')\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name_empty\"\n        message: \"value is empty, which is not a valid HTTP header name\"\n        expression: \"rules.well_known_regex != 1 || this != ''\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_value\"\n        message: \"value must be a valid HTTP header value\"\n        expression:\n          \"rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^[^\\\\u0000-\\\\u0008\\\\u000A-\\\\u001F\\\\u007F]*$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]*$')\"\n      }\n    ];\n  }\n\n  // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to\n  // enable strict header validation. By default, this is true, and HTTP header\n  // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser\n  // validations that only disallow `\\r\\n\\0` characters, which can be used to\n  // bypass header matching rules.\n  //\n  // ```proto\n  // message MyString {\n  //   // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.\n  //   string value = 1 [(buf.validate.field).string.strict = false];\n  // }\n  // ```\n  optional bool strict = 25;\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyString {\n  //   string value = 1 [\n  //     (buf.validate.field).string.example = \"hello\",\n  //     (buf.validate.field).string.example = \"world\"\n  //   ];\n  // }\n  // ```\n  repeated string example = 34 [(predefined).cel = {\n    id: \"string.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// KnownRegex contains some well-known patterns.\nenum KnownRegex {\n  KNOWN_REGEX_UNSPECIFIED = 0;\n\n  // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2).\n  KNOWN_REGEX_HTTP_HEADER_NAME = 1;\n\n  // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4).\n  KNOWN_REGEX_HTTP_HEADER_VALUE = 2;\n}\n\n// BytesRules describe the rules applied to `bytes` values. These rules\n// may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.\nmessage BytesRules {\n  // `const` requires the field value to exactly match the specified bytes\n  // value. If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be \"\\x01\\x02\\x03\\x04\"\n  //   bytes value = 1 [(buf.validate.field).bytes.const = \"\\x01\\x02\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes const = 1 [(predefined).cel = {\n    id: \"bytes.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must be %x'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` requires the field value to have the specified length in bytes.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be 4 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.len = 4];\n  // }\n  // ```\n  optional uint64 len = 13 [(predefined).cel = {\n    id: \"bytes.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s bytes'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` requires the field value to have at least the specified minimum\n  // length in bytes.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be at least 2 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"bytes.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s bytes'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` requires the field value to have at most the specified maximum\n  // length in bytes.\n  // If the field value exceeds the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be at most 6 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"bytes.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value must be at most %s bytes'.format([rules.max_len]) : ''\"\n  }];\n\n  // `pattern` requires the field value to match the specified regular\n  // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).\n  // The value of the field must be valid UTF-8 or validation will fail with a\n  // runtime error.\n  // If the field value doesn't match the pattern, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must match regex pattern \"^[a-zA-Z0-9]+$\".\n  //   optional bytes value = 1 [(buf.validate.field).bytes.pattern = \"^[a-zA-Z0-9]+$\"];\n  // }\n  // ```\n  optional string pattern = 4 [(predefined).cel = {\n    id: \"bytes.pattern\"\n    expression: \"!string(this).matches(rules.pattern) ? 'value must match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` requires the field value to have the specified bytes at the\n  // beginning of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have prefix \\x01\\x02\n  //   optional bytes value = 1 [(buf.validate.field).bytes.prefix = \"\\x01\\x02\"];\n  // }\n  // ```\n  optional bytes prefix = 5 [(predefined).cel = {\n    id: \"bytes.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix %x'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` requires the field value to have the specified bytes at the end\n  // of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have suffix \\x03\\x04\n  //   optional bytes value = 1 [(buf.validate.field).bytes.suffix = \"\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes suffix = 6 [(predefined).cel = {\n    id: \"bytes.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix %x'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` requires the field value to have the specified bytes anywhere in\n  // the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not contain \\x02\\x03\n  //   optional bytes value = 1 [(buf.validate.field).bytes.contains = \"\\x02\\x03\"];\n  // }\n  // ```\n  optional bytes contains = 7 [(predefined).cel = {\n    id: \"bytes.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain %x'.format([rules.contains]) : ''\"\n  }];\n\n  // `in` requires the field value to be equal to one of the specified\n  // values. If the field value doesn't match any of the specified values, an\n  // error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes in = 8 [(predefined).cel = {\n    id: \"bytes.in\"\n    expression: \"getField(rules, 'in').size() > 0 && !(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the specified\n  // values.\n  // If the field value matches any of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must not in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.not_in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes not_in = 9 [(predefined).cel = {\n    id: \"bytes.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // WellKnown rules provide advanced rules against common byte\n  // patterns\n  oneof well_known {\n    // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IP address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ip = true];\n    // }\n    // ```\n    bool ip = 10 [\n      (predefined).cel = {\n        id: \"bytes.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this.size() != 0\"\n      }\n    ];\n\n    // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv4 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 11 [\n      (predefined).cel = {\n        id: \"bytes.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() == 0 || this.size() == 4\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() != 0\"\n      }\n    ];\n\n    // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv6 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 12 [\n      (predefined).cel = {\n        id: \"bytes.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() != 0\"\n      }\n    ];\n\n    // `uuid` ensures that the field `value` encodes the 128-bit UUID data as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).\n    // The field must contain exactly 16 bytes\n    // representing the UUID. If the field value isn't a valid UUID, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid UUID\n    //   optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];\n    // }\n    // ```\n    bool uuid = 15 [\n      (predefined).cel = {\n        id: \"bytes.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this.size() != 0\"\n      }\n    ];\n  }\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBytes {\n  //   bytes value = 1 [\n  //     (buf.validate.field).bytes.example = \"\\x01\\x02\",\n  //     (buf.validate.field).bytes.example = \"\\x02\\x03\"\n  //   ];\n  // }\n  // ```\n  repeated bytes example = 14 [(predefined).cel = {\n    id: \"bytes.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// EnumRules describe the rules applied to `enum` values.\nmessage EnumRules {\n  // `const` requires the field value to exactly match the specified enum value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be exactly MY_ENUM_VALUE1.\n  //   MyEnum value = 1 [(buf.validate.field).enum.const = 1];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"enum.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `defined_only` requires the field value to be one of the defined values for\n  // this enum, failing on any undefined value.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be a defined value of MyEnum.\n  //   MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];\n  // }\n  // ```\n  optional bool defined_only = 2;\n\n  // `in` requires the field value to be equal to one of the\n  //specified enum values. If the field value doesn't match any of the\n  //specified values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be equal to one of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 in = 3 [(predefined).cel = {\n    id: \"enum.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the\n  //specified enum values. If the field value matches one of the specified\n  // values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must not be equal to any of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 not_in = 4 [(predefined).cel = {\n    id: \"enum.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //     (buf.validate.field).enum.example = 1,\n  //     (buf.validate.field).enum.example = 2\n  // }\n  // ```\n  repeated int32 example = 5 [(predefined).cel = {\n    id: \"enum.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// RepeatedRules describe the rules applied to `repeated` values.\nmessage RepeatedRules {\n  // `min_items` requires that this field must contain at least the specified\n  // minimum number of items.\n  //\n  // Note that `min_items = 1` is equivalent to setting a field as `required`.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain at least  2 items\n  //   repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];\n  // }\n  // ```\n  optional uint64 min_items = 1 [(predefined).cel = {\n    id: \"repeated.min_items\"\n    expression: \"uint(this.size()) < rules.min_items ? 'value must contain at least %d item(s)'.format([rules.min_items]) : ''\"\n  }];\n\n  // `max_items` denotes that this field must not exceed a\n  // certain number of items as the upper limit. If the field contains more\n  // items than specified, an error message will be generated, requiring the\n  // field to maintain no more than the specified number of items.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain no more than 3 item(s)\n  //   repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];\n  // }\n  // ```\n  optional uint64 max_items = 2 [(predefined).cel = {\n    id: \"repeated.max_items\"\n    expression: \"uint(this.size()) > rules.max_items ? 'value must contain no more than %s item(s)'.format([rules.max_items]) : ''\"\n  }];\n\n  // `unique` indicates that all elements in this field must\n  // be unique. This rule is strictly applicable to scalar and enum\n  // types, with message types not being supported.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // repeated value must contain unique items\n  //   repeated string value = 1 [(buf.validate.field).repeated.unique = true];\n  // }\n  // ```\n  optional bool unique = 3 [(predefined).cel = {\n    id: \"repeated.unique\"\n    message: \"repeated value must contain unique items\"\n    expression: \"!rules.unique || this.unique()\"\n  }];\n\n  // `items` details the rules to be applied to each item\n  // in the field. Even for repeated message fields, validation is executed\n  // against each item unless `ignore` is specified.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // The items in the field `value` must follow the specified rules.\n  //   repeated string value = 1 [(buf.validate.field).repeated.items = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Repeated items\n  // cannot be unset.\n  optional FieldRules items = 4;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// MapRules describe the rules applied to `map` values.\nmessage MapRules {\n  // Specifies the minimum number of key-value pairs allowed. If the field has\n  // fewer key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at least 2 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];\n  // }\n  // ```\n  optional uint64 min_pairs = 1 [(predefined).cel = {\n    id: \"map.min_pairs\"\n    expression: \"uint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''\"\n  }];\n\n  // Specifies the maximum number of key-value pairs allowed. If the field has\n  // more key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at most 3 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];\n  // }\n  // ```\n  optional uint64 max_pairs = 2 [(predefined).cel = {\n    id: \"map.max_pairs\"\n    expression: \"uint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''\"\n  }];\n\n  // Specifies the rules to be applied to each key in the field.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The keys in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.keys = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Map keys cannot be unset.\n  optional FieldRules keys = 4;\n\n  // Specifies the rules to be applied to the value of each key in the\n  // field. Message values will still have their validations evaluated unless\n  // `ignore` is specified.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The values in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.values = {\n  //     string: {\n  //       min_len: 5\n  //       max_len: 20\n  //     }\n  //   }];\n  // }\n  // ```\n  // Note that the `required` rule does not apply. Map values cannot be unset.\n  optional FieldRules values = 5;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type.\nmessage AnyRules {\n  // `in` requires the field's `type_url` to be equal to one of the\n  //specified values. If it doesn't match any of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must have a `type_url` equal to one of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       in: [\"type.googleapis.com/MyType1\", \"type.googleapis.com/MyType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2;\n\n  // requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must not have a `type_url` equal to any of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       not_in: [\"type.googleapis.com/ForbiddenType1\", \"type.googleapis.com/ForbiddenType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3;\n}\n\n// DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type.\nmessage DurationRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must equal 5s\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = \"5s\"];\n  // }\n  // ```\n  optional google.protobuf.Duration const = 2 [(predefined).cel = {\n    id: \"duration.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,\n    // exclusive. If the field's value is greater than or equal to the specified\n    // value, an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than 5s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = \"5s\"];\n    // }\n    // ```\n    google.protobuf.Duration lt = 3 [(predefined).cel = {\n      id: \"duration.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` indicates that the field must be less than or equal to the specified\n    // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than or equal to 10s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = \"10s\"];\n    // }\n    // ```\n    google.protobuf.Duration lte = 4 [(predefined).cel = {\n      id: \"duration.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the duration field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be greater than 5s [duration.gt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];\n    //\n    //   // duration must be greater than 5s and less than 10s [duration.gt_lt]\n    //   google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //   // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]\n    //   google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gt = 5 [\n      (predefined).cel = {\n        id: \"duration.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the duration field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value must\n    // be outside the specified range. If the field value doesn't meet the\n    // required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //  // duration must be greater than or equal to 5s [duration.gte]\n    //  google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];\n    //\n    //  // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]\n    //  google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //  // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]\n    //  google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gte = 6 [\n      (predefined).cel = {\n        id: \"duration.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value doesn't correspond to any of the specified values,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration in = 7 [(predefined).cel = {\n    id: \"duration.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` denotes that the field must not be equal to\n  // any of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value matches any of these values, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must not be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration not_in = 8 [(predefined).cel = {\n    id: \"duration.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDuration {\n  //   google.protobuf.Duration value = 1 [\n  //     (buf.validate.field).duration.example = { seconds: 1 },\n  //     (buf.validate.field).duration.example = { seconds: 2 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Duration example = 9 [(predefined).cel = {\n    id: \"duration.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type.\nmessage FieldMaskRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   // value must equal [\"a\"]\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {\n  //       paths: [\"a\"]\n  //   }];\n  // }\n  // ```\n  optional google.protobuf.FieldMask const = 1 [(predefined).cel = {\n    id: \"field_mask.const\"\n    expression: \"this.paths != getField(rules, 'const').paths ? 'value must equal paths %s'.format([getField(rules, 'const').paths]) : ''\"\n  }];\n\n  // `in` requires the field value to only contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths doesn't match the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask must only contain paths listed in `in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       in: [\"a\", \"b\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2 [(predefined).cel = {\n    id: \"field_mask.in\"\n    expression: \"!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'value must only contain paths in %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths matches the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask shall not contain paths listed in `not_in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       not_in: [\"forbidden\", \"immutable\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3 [(predefined).cel = {\n    id: \"field_mask.not_in\"\n    expression: \"!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'value must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   google.protobuf.FieldMask value = 1 [\n  //     (buf.validate.field).field_mask.example = { paths: [\"a\", \"b\"] },\n  //     (buf.validate.field).field_mask.example = { paths: [\"c.a\", \"d\"] },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.FieldMask example = 4 [(predefined).cel = {\n    id: \"field_mask.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.\nmessage TimestampRules {\n  // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must equal 2023-05-03T10:00:00Z\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];\n  // }\n  // ```\n  optional google.protobuf.Timestamp const = 2 [(predefined).cel = {\n    id: \"timestamp.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // requires the duration field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be less than 'P3D' [duration.lt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lt = 3 [(predefined).cel = {\n      id: \"timestamp.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lte = 4 [(predefined).cel = {\n      id: \"timestamp.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n\n    // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //  // value must be less than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];\n    // }\n    // ```\n    bool lt_now = 7 [(predefined).cel = {\n      id: \"timestamp.lt_now\"\n      expression: \"(rules.lt_now && this > now) ? 'value must be less than now' : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the timestamp field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gt = 5 [\n      (predefined).cel = {\n        id: \"timestamp.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the timestamp field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value\n    // must be outside the specified range. If the field value doesn't meet\n    // the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gte = 6 [\n      (predefined).cel = {\n        id: \"timestamp.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // value must be greater than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];\n    // }\n    // ```\n    bool gt_now = 8 [(predefined).cel = {\n      id: \"timestamp.gt_now\"\n      expression: \"(rules.gt_now && this < now) ? 'value must be greater than now' : ''\"\n    }];\n  }\n\n  // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must be within 1 hour of now\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];\n  // }\n  // ```\n  optional google.protobuf.Duration within = 9 [(predefined).cel = {\n    id: \"timestamp.within\"\n    expression: \"this < now-rules.within || this > now+rules.within ? 'value must be within %s of now'.format([rules.within]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   google.protobuf.Timestamp value = 1 [\n  //     (buf.validate.field).timestamp.example = { seconds: 1672444800 },\n  //     (buf.validate.field).timestamp.example = { seconds: 1672531200 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Timestamp example = 10 [(predefined).cel = {\n    id: \"timestamp.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// `Violations` is a collection of `Violation` messages. This message type is returned by\n// Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules.\n// Each individual violation is represented by a `Violation` message.\nmessage Violations {\n  // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.\n  repeated Violation violations = 1;\n}\n\n// `Violation` represents a single instance where a validation rule, expressed\n// as a `Rule`, was not met. It provides information about the field that\n// caused the violation, the specific rule that wasn't fulfilled, and a\n// human-readable error message.\n//\n// For example, consider the following message:\n//\n// ```proto\n// message User {\n//     int32 age = 1 [(buf.validate.field).cel = {\n//         id: \"user.age\",\n//         expression: \"this < 18 ? 'User must be at least 18 years old' : ''\",\n//     }];\n// }\n// ```\n//\n// It could produce the following violation:\n//\n// ```json\n// {\n//   \"ruleId\": \"user.age\",\n//   \"message\": \"User must be at least 18 years old\",\n//   \"field\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 1,\n//         \"fieldName\": \"age\",\n//         \"fieldType\": \"TYPE_INT32\"\n//       }\n//     ]\n//   },\n//   \"rule\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 23,\n//         \"fieldName\": \"cel\",\n//         \"fieldType\": \"TYPE_MESSAGE\",\n//         \"index\": \"0\"\n//       }\n//     ]\n//   }\n// }\n// ```\nmessage Violation {\n  // `field` is a machine-readable path to the field that failed validation.\n  // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  // }\n  // ```\n  //\n  // It could produce the following violation:\n  //\n  // ```textproto\n  // violation {\n  //   field { element { field_number: 1, field_name: \"a\", field_type: 8 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath field = 5;\n\n  // `rule` is a machine-readable path that points to the specific rule that failed validation.\n  // This will be a nested field starting from the FieldRules of the field that failed validation.\n  // For custom rules, this will provide the path of the rule, e.g. `cel[0]`.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  //   bool b = 2 [(buf.validate.field).cel = {\n  //     id: \"custom_rule\",\n  //     expression: \"!this ? 'b must be true': ''\"\n  //   }]\n  // }\n  // ```\n  //\n  // It could produce the following violations:\n  //\n  // ```textproto\n  // violation {\n  //   rule { element { field_number: 25, field_name: \"required\", field_type: 8 } }\n  //   ...\n  // }\n  // violation {\n  //   rule { element { field_number: 23, field_name: \"cel\", field_type: 11, index: 0 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath rule = 6;\n\n  // `rule_id` is the unique identifier of the `Rule` that was not fulfilled.\n  // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.\n  optional string rule_id = 2;\n\n  // `message` is a human-readable error message that describes the nature of the violation.\n  // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.\n  optional string message = 3;\n\n  // `for_key` indicates whether the violation was caused by a map key, rather than a value.\n  optional bool for_key = 4;\n\n  reserved 1;\n  reserved \"field_path\";\n}\n\n// `FieldPath` provides a path to a nested protobuf field.\n//\n// This message provides enough information to render a dotted field path even without protobuf descriptors.\n// It also provides enough information to resolve a nested field through unknown wire data.\nmessage FieldPath {\n  // `elements` contains each element of the path, starting from the root and recursing downward.\n  repeated FieldPathElement elements = 1;\n}\n\n// `FieldPathElement` provides enough information to nest through a single protobuf field.\n//\n// If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.\n// A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.\n// The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.\nmessage FieldPathElement {\n  // `field_number` is the field number this path element refers to.\n  optional int32 field_number = 1;\n\n  // `field_name` contains the field name this path element refers to.\n  // This can be used to display a human-readable path even if the field number is unknown.\n  optional string field_name = 2;\n\n  // `field_type` specifies the type of this field. When using reflection, this value is not needed.\n  //\n  // This value is provided to make it possible to traverse unknown fields through wire data.\n  // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.\n  //\n  // [1]: https://protobuf.dev/programming-guides/encoding/#packed\n  // [2]: https://protobuf.dev/programming-guides/encoding/#groups\n  //\n  // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and\n  // can be explicitly used in Protocol Buffers 2023 Edition.\n  optional google.protobuf.FieldDescriptorProto.Type field_type = 3;\n\n  // `key_type` specifies the map key type of this field. This value is useful when traversing\n  // unknown fields through wire data: specifically, it allows handling the differences between\n  // different integer encodings.\n  optional google.protobuf.FieldDescriptorProto.Type key_type = 4;\n\n  // `value_type` specifies map value type of this field. This is useful if you want to display a\n  // value inside unknown fields through wire data.\n  optional google.protobuf.FieldDescriptorProto.Type value_type = 5;\n\n  // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field.\n  oneof subscript {\n    // `index` specifies a 0-based index into a repeated field.\n    uint64 index = 6;\n\n    // `bool_key` specifies a map key of type bool.\n    bool bool_key = 7;\n\n    // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.\n    int64 int_key = 8;\n\n    // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.\n    uint64 uint_key = 9;\n\n    // `string_key` specifies a map key of type string.\n    string string_key = 10;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate_predefined/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: proto\n    name: buf.testing/lint/proto\n    lint:\n      use:\n        - PROTOVALIDATE\n  - path: import\n  - path: vendor/protovalidate\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate_predefined/import/import.proto",
    "content": "syntax = \"proto2\";\n\npackage custom;\n\nimport \"buf/validate/validate.proto\";\n\nextend buf.validate.StringRules {\n  optional string special_suffix = 1800 [(buf.validate.predefined).cel = {\n    id: \"string.special_suffix\"\n    expression: \"!this.endsWith(rule + '_') ? \\'value does not have suffix `%s`\\'.format([rule + '_']) : \\'\\'\"\n  }];\n\n  optional string bad_rule = 1900 [(buf.validate.predefined).cel = {\n    id: \"string.bad_rule\"\n    expression: \"bad\"\n    message: \"this rule does not compile\"\n  }];\n}\n\nextend buf.validate.Int32Rules {\n  repeated int32 abs_not_in = 1800 [(buf.validate.predefined).cel = {\n    id: \"int32.abs_not_in\"\n    expression: \"!(this in rule || this in rule.map(n, -n))\"\n    message: \"value must be in absolute value of list\"\n  }];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate_predefined/proto/rules.proto",
    "content": "syntax = \"proto2\";\n\npackage rules;\n\nimport \"buf/validate/validate.proto\";\n\nextend buf.validate.StringRules {\n  optional int32 required_with_max = 80048954 [(buf.validate.predefined).cel = {\n    id: \"string.required.max\"\n    expression:\n      \"(rules.min_len > 0 && rules.max_len > 0) || (this.size() > 0 && this.size() <= rule)\"\n      \"? ''\"\n      \": 'this is required and must be ' + string(rule) + ' or fewer characters but ' + string(rules.max_len)\"\n  }];\n}\n\nextend buf.validate.Int32Rules {\n  optional int32 required_lt = 18001 [(buf.validate.predefined).cel = {\n    id: \"int32.required.lt\"\n    expression:\n      \"(rules.lt > 0)\"\n      \"? ''\"\n      \": 'this is required and must be ' + string(rule)\"\n  }];\n}\n\nextend buf.validate.RepeatedRules {\n  optional int32 required_max_items = 18002 [(buf.validate.predefined).cel = {\n    id: \"repeated.required.max\"\n    expression:\n      \"(rules.min_items > 0 && rules.max_items > 0) || (this.size() > 0 && this.size() <= rule)\"\n      \"? ''\"\n      \": 'this is required and must be ' + string(rule) + ' or fewer items but ' + string(rules.max_items)\"\n  }];\n}\n\nextend buf.validate.MapRules {\n  optional int32 required_max_pairs = 18003 [(buf.validate.predefined).cel = {\n    id: \"map.required.max\"\n    expression:\n      \"(rules.min_pairs > 0 && rules.max_pairs > 0) || (this.size() > 0 && this.size() <= rule)\"\n      \"? ''\"\n      \": 'this is required and must be ' + string(rule) + ' or fewer items but ' + string(rules.max_pairs)\"\n  }];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate_predefined/proto/test.proto",
    "content": "syntax = \"proto2\";\n\npackage test;\n\nimport \"buf/validate/validate.proto\";\nimport \"import.proto\";\n\nextend buf.validate.StringRules {\n  optional string special_prefix = 1801 [(buf.validate.predefined).cel = {\n    id: \"string.special_prefix\"\n    expression: \"!this.startsWith('_' + rule) ? \\'value does not have prefix `%s`\\'.format(['_' + rule]) : \\'\\'\"\n  }];\n\n  optional string another_bad_rule = 1902 [(buf.validate.predefined).cel = {\n    id: \"string.another_bad_rule\"\n    expression: \"bad\"\n    message: \"this rule does not compile\"\n  }];\n}\n\nmessage TestPredefinedStringRules {\n  // valid\n  optional string all_rules_valid = 1 [\n    (buf.validate.field).string.max_len = 20,\n    // imported\n    (buf.validate.field).string.(custom.special_suffix) = \"suffix\",\n    (buf.validate.field).string.(special_prefix) = \"prefix\"\n  ];\n  optional string all_rules_valid_with_all_valid_examples = 2 [\n    (buf.validate.field).string.max_len = 50,\n    (buf.validate.field).string.(custom.special_suffix) = \"suffix\",\n    (buf.validate.field).string.(special_prefix) = \"prefix\",\n    (buf.validate.field).string.example = \"_prefix_foo_foo_suffix_\",\n    (buf.validate.field).string.example = \"_prefixfoofoosuffix_\"\n  ];\n  optional string all_rules_valid_with_examples = 3 [\n    (buf.validate.field).string.max_len = 50,\n    (buf.validate.field).string.(custom.special_suffix) = \"suffix\",\n    (buf.validate.field).string.(special_prefix) = \"prefix\",\n    // valid\n    (buf.validate.field).string.example = \"_prefix_foo_foo_suffix_\",\n    // invalid\n    (buf.validate.field).string.example = \"fail_example\",\n    (buf.validate.field).string.example = \"_prefix_fail_suffix\"\n  ];\n  optional string invalid_predefined_rule = 4 [\n    (buf.validate.field).string.max_len = 5,\n    (buf.validate.field).string.(custom.bad_rule) = \"suffix\",\n    (buf.validate.field).string.example = \"ah\",\n    (buf.validate.field).string.example = \"too_long\"\n  ];\n}\n\nmessage TestInt32Rules {\n  optional int32 test = 1 [\n    (buf.validate.field).int32.lt = 5,\n    (buf.validate.field).int32.(custom.abs_not_in) = 1,\n    (buf.validate.field).int32.(custom.abs_not_in) = -2,\n    (buf.validate.field).int32.example = 3,\n    (buf.validate.field).int32.example = 2\n  ];\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/protovalidate_predefined/vendor/protovalidate/buf/validate/validate.proto",
    "content": "// Copyright 2023-2025 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto2\";\n\npackage buf.validate;\n\nimport \"google/protobuf/descriptor.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/field_mask.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\noption go_package = \"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\";\noption java_multiple_files = true;\noption java_outer_classname = \"ValidateProto\";\noption java_package = \"build.buf.validate\";\n\n// MessageOptions is an extension to google.protobuf.MessageOptions. It allows\n// the addition of validation rules at the message level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.MessageOptions {\n  // Rules specify the validations to be performed on this message. By default,\n  // no validation is performed against a message.\n  optional MessageRules message = 1159;\n}\n\n// OneofOptions is an extension to google.protobuf.OneofOptions. It allows\n// the addition of validation rules on a oneof. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.OneofOptions {\n  // Rules specify the validations to be performed on this oneof. By default,\n  // no validation is performed against a oneof.\n  optional OneofRules oneof = 1159;\n}\n\n// FieldOptions is an extension to google.protobuf.FieldOptions. It allows\n// the addition of validation rules at the field level. These rules can be\n// applied to incoming messages to ensure they meet certain criteria before\n// being processed.\nextend google.protobuf.FieldOptions {\n  // Rules specify the validations to be performed on this field. By default,\n  // no validation is performed against a field.\n  optional FieldRules field = 1159;\n\n  // Specifies predefined rules. When extending a standard rule message,\n  // this adds additional CEL expressions that apply when the extension is used.\n  //\n  // ```proto\n  // extend buf.validate.Int32Rules {\n  //   bool is_zero [(buf.validate.predefined).cel = {\n  //     id: \"int32.is_zero\",\n  //     message: \"value must be zero\",\n  //     expression: \"!rule || this == 0\",\n  //   }];\n  // }\n  //\n  // message Foo {\n  //   int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true];\n  // }\n  // ```\n  optional PredefinedRules predefined = 1160;\n}\n\n// `Rule` represents a validation rule written in the Common Expression\n// Language (CEL) syntax. Each Rule includes a unique identifier, an\n// optional error message, and the CEL expression to evaluate. For more\n// information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n//\n// ```proto\n// message Foo {\n//   option (buf.validate.message).cel = {\n//     id: \"foo.bar\"\n//     message: \"bar must be greater than 0\"\n//     expression: \"this.bar > 0\"\n//   };\n//   int32 bar = 1;\n// }\n// ```\nmessage Rule {\n  // `id` is a string that serves as a machine-readable name for this Rule.\n  // It should be unique within its scope, which could be either a message or a field.\n  optional string id = 1;\n\n  // `message` is an optional field that provides a human-readable error message\n  // for this Rule when the CEL expression evaluates to false. If a\n  // non-empty message is provided, any strings resulting from the CEL\n  // expression evaluation are ignored.\n  optional string message = 2;\n\n  // `expression` is the actual CEL expression that will be evaluated for\n  // validation. This string must resolve to either a boolean or a string\n  // value. If the expression evaluates to false or a non-empty string, the\n  // validation is considered failed, and the message is rejected.\n  optional string expression = 3;\n}\n\n// MessageRules represents validation rules that are applied to the entire message.\n// It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.\nmessage MessageRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel_expression = \"this.foo > 42\";\n  //   // The field `foo` must be less than 84.\n  //   option (buf.validate.message).cel_expression = \"this.foo < 84\";\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated string cel_expression = 5;\n  // `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.\n  // These rules are written in Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `foo` must be greater than 42.\n  //   option (buf.validate.message).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this.foo > 42\",\n  //   };\n  //   optional int32 foo = 1;\n  // }\n  // ```\n  repeated Rule cel = 3;\n\n  // `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields\n  // of which at most one can be present. If `required` is also specified, then exactly one\n  // of the specified fields _must_ be present.\n  //\n  // This will enforce oneof-like constraints with a few features not provided by\n  // actual Protobuf oneof declarations:\n  //   1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,\n  //      only scalar fields are allowed.\n  //   2. Fields with implicit presence are allowed. In a Protobuf oneof, all member\n  //      fields have explicit presence. This means that, for the purpose of determining\n  //      how many fields are set, explicitly setting such a field to its zero value is\n  //      effectively the same as not setting it at all.\n  //   3. This will always generate validation errors for a message unmarshalled from\n  //      serialized data that sets more than one field. With a Protobuf oneof, when\n  //      multiple fields are present in the serialized form, earlier values are usually\n  //      silently ignored when unmarshalling, with only the last field being set when\n  //      unmarshalling completes.\n  //\n  // Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means\n  // only the field that is set will be validated and the unset fields are not validated according to the field rules.\n  // This behavior can be overridden by setting `ignore` against a field.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // Only one of `field1` or `field2` _can_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field1\", \"field2\"] };\n  //   // Exactly one of `field3` or `field4` _must_ be present in this message.\n  //   option (buf.validate.message).oneof = { fields: [\"field3\", \"field4\"], required: true };\n  //   string field1 = 1;\n  //   bytes field2 = 2;\n  //   bool field3 = 3;\n  //   int32 field4 = 4;\n  // }\n  // ```\n  repeated MessageOneofRule oneof = 4;\n\n  reserved 1;\n  reserved \"disabled\";\n}\n\nmessage MessageOneofRule {\n  // A list of field names to include in the oneof. All field names must be\n  // defined in the message. At least one field must be specified, and\n  // duplicates are not permitted.\n  repeated string fields = 1;\n  // If true, one of the fields specified _must_ be set.\n  optional bool required = 2;\n}\n\n// The `OneofRules` message type enables you to manage rules for\n// oneof fields in your protobuf messages.\nmessage OneofRules {\n  // If `required` is true, exactly one field of the oneof must be set. A\n  // validation error is returned if no fields in the oneof are set. Further rules\n  // should be placed on the fields themselves to ensure they are valid values,\n  // such as `min_len` or `gt`.\n  //\n  // ```proto\n  // message MyMessage {\n  //   oneof value {\n  //     // Either `a` or `b` must be set. If `a` is set, it must also be\n  //     // non-empty; whereas if `b` is set, it can still be an empty string.\n  //     option (buf.validate.oneof).required = true;\n  //     string a = 1 [(buf.validate.field).string.min_len = 1];\n  //     string b = 2;\n  //   }\n  // }\n  // ```\n  optional bool required = 1;\n}\n\n// FieldRules encapsulates the rules for each type of field. Depending on\n// the field, the correct set should be used to ensure proper validations.\nmessage FieldRules {\n  // `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation\n  // rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.\n  //\n  // This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for\n  // simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will\n  // be same as the `expression`.\n  //\n  // For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel_expression = \"this > 42\"];\n  // }\n  // ```\n  repeated string cel_expression = 29;\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.field).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 23;\n  // If `required` is true, the field must be set. A validation error is returned\n  // if the field is not set.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithPresence {\n  //   // Requires any string to be set, including the empty string.\n  //   optional string link = 1 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires true or false to be set.\n  //   optional bool disabled = 2 [\n  //     (buf.validate.field).required = true\n  //   ];\n  //   // Requires a message to be set, including the empty message.\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // All fields in the example above track presence. By default, Protovalidate\n  // ignores rules on those fields if no value is set. `required` ensures that\n  // the fields are set and valid.\n  //\n  // Fields that don't track presence are always validated by Protovalidate,\n  // whether they are set or not. It is not necessary to add `required`. It\n  // can be added to indicate that the field cannot be the zero value.\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message FieldsWithoutPresence {\n  //   // `string.email` always applies, even to an empty string.\n  //   string link = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   // `repeated.min_items` always applies, even to an empty list.\n  //   repeated string labels = 2 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  //   // `required`, for fields that don't track presence, indicates\n  //   // the value of the field can't be the zero value.\n  //   int32 zero_value_not_allowed = 3 [\n  //     (buf.validate.field).required = true\n  //   ];\n  // }\n  // ```\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  //\n  // Note: While field rules can be applied to repeated items, map keys, and map\n  // values, the elements are always considered to be set. Consequently,\n  // specifying `repeated.items.required` is redundant.\n  optional bool required = 25;\n  // Ignore validation rules on the field if its value matches the specified\n  // criteria. See the `Ignore` enum for details.\n  //\n  // ```proto\n  // message UpdateRequest {\n  //   // The uri rule only applies if the field is not an empty string.\n  //   string url = 1 [\n  //     (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,\n  //     (buf.validate.field).string.uri = true\n  //   ];\n  // }\n  // ```\n  optional Ignore ignore = 27;\n\n  oneof type {\n    // Scalar Field Types\n    FloatRules float = 1;\n    DoubleRules double = 2;\n    Int32Rules int32 = 3;\n    Int64Rules int64 = 4;\n    UInt32Rules uint32 = 5;\n    UInt64Rules uint64 = 6;\n    SInt32Rules sint32 = 7;\n    SInt64Rules sint64 = 8;\n    Fixed32Rules fixed32 = 9;\n    Fixed64Rules fixed64 = 10;\n    SFixed32Rules sfixed32 = 11;\n    SFixed64Rules sfixed64 = 12;\n    BoolRules bool = 13;\n    StringRules string = 14;\n    BytesRules bytes = 15;\n\n    // Complex Field Types\n    EnumRules enum = 16;\n    RepeatedRules repeated = 18;\n    MapRules map = 19;\n\n    // Well-Known Field Types\n    AnyRules any = 20;\n    DurationRules duration = 21;\n    FieldMaskRules field_mask = 28;\n    TimestampRules timestamp = 22;\n  }\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// PredefinedRules are custom rules that can be re-used with\n// multiple fields.\nmessage PredefinedRules {\n  // `cel` is a repeated field used to represent a textual expression\n  // in the Common Expression Language (CEL) syntax. For more information,\n  // [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field `value` must be greater than 42.\n  //   optional int32 value = 1 [(buf.validate.predefined).cel = {\n  //     id: \"my_message.value\",\n  //     message: \"value must be greater than 42\",\n  //     expression: \"this > 42\",\n  //   }];\n  // }\n  // ```\n  repeated Rule cel = 1;\n\n  reserved 24, 26;\n  reserved \"skipped\", \"ignore_empty\";\n}\n\n// Specifies how `FieldRules.ignore` behaves, depending on the field's value, and\n// whether the field tracks presence.\nenum Ignore {\n  // Ignore rules if the field tracks presence and is unset. This is the default\n  // behavior.\n  //\n  // In proto3, only message fields, members of a Protobuf `oneof`, and fields\n  // with the `optional` label track presence. Consequently, the following fields\n  // are always validated, whether a value is set or not:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApply {\n  //   string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   int32 age = 2 [\n  //     (buf.validate.field).int32.gt = 0\n  //   ];\n  //   repeated string labels = 3 [\n  //     (buf.validate.field).repeated.min_items = 1\n  //   ];\n  // }\n  // ```\n  //\n  // In contrast, the following fields track presence, and are only validated if\n  // a value is set:\n  //\n  // ```proto\n  // syntax=\"proto3\";\n  //\n  // message RulesApplyIfSet {\n  //   optional string email = 1 [\n  //     (buf.validate.field).string.email = true\n  //   ];\n  //   oneof ref {\n  //     string reference = 2 [\n  //       (buf.validate.field).string.uuid = true\n  //     ];\n  //     string name = 3 [\n  //       (buf.validate.field).string.min_len = 4\n  //     ];\n  //   }\n  //   SomeMessage msg = 4 [\n  //     (buf.validate.field).cel = {/* ... */}\n  //   ];\n  // }\n  // ```\n  //\n  // To ensure that such a field is set, add the `required` rule.\n  //\n  // To learn which fields track presence, see the\n  // [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).\n  IGNORE_UNSPECIFIED = 0;\n\n  // Ignore rules if the field is unset, or set to the zero value.\n  //\n  // The zero value depends on the field type:\n  // - For strings, the zero value is the empty string.\n  // - For bytes, the zero value is empty bytes.\n  // - For bool, the zero value is false.\n  // - For numeric types, the zero value is zero.\n  // - For enums, the zero value is the first defined enum value.\n  // - For repeated fields, the zero is an empty list.\n  // - For map fields, the zero is an empty map.\n  // - For message fields, absence of the message (typically a null-value) is considered zero value.\n  //\n  // For fields that track presence (e.g. adding the `optional` label in proto3),\n  // this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.\n  IGNORE_IF_ZERO_VALUE = 1;\n\n  // Always ignore rules, including the `required` rule.\n  //\n  // This is useful for ignoring the rules of a referenced message, or to\n  // temporarily ignore rules during development.\n  //\n  // ```proto\n  // message MyMessage {\n  //   // The field's rules will always be ignored, including any validations\n  //   // on value's fields.\n  //   MyOtherMessage value = 1 [\n  //     (buf.validate.field).ignore = IGNORE_ALWAYS\n  //   ];\n  // }\n  // ```\n  IGNORE_ALWAYS = 3;\n\n  reserved 2;\n  reserved \"IGNORE_EMPTY\", \"IGNORE_DEFAULT\", \"IGNORE_IF_DEFAULT_VALUE\", \"IGNORE_IF_UNPOPULATED\";\n}\n\n// FloatRules describes the rules applied to `float` values. These\n// rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.\nmessage FloatRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must equal 42.0\n  //   float value = 1 [(buf.validate.field).float.const = 42.0];\n  // }\n  // ```\n  optional float const = 1 [(predefined).cel = {\n    id: \"float.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than 10.0\n    //   float value = 1 [(buf.validate.field).float.lt = 10.0];\n    // }\n    // ```\n    float lt = 2 [(predefined).cel = {\n      id: \"float.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be less than or equal to 10.0\n    //   float value = 1 [(buf.validate.field).float.lte = 10.0];\n    // }\n    // ```\n    float lte = 3 [(predefined).cel = {\n      id: \"float.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than 5.0 [float.gt]\n    //   float value = 1 [(buf.validate.field).float.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [float.gt_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gt = 4 [\n      (predefined).cel = {\n        id: \"float.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFloat {\n    //   // value must be greater than or equal to 5.0 [float.gte]\n    //   float value = 1 [(buf.validate.field).float.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]\n    //   float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]\n    //   float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    float gte = 5 [\n      (predefined).cel = {\n        id: \"float.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"float.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float in = 6 [(predefined).cel = {\n    id: \"float.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFloat {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated float not_in = 7 [(predefined).cel = {\n    id: \"float.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"float.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFloat {\n  //   float value = 1 [\n  //     (buf.validate.field).float.example = 1.0,\n  //     (buf.validate.field).float.example = inf\n  //   ];\n  // }\n  // ```\n  repeated float example = 9 [(predefined).cel = {\n    id: \"float.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// DoubleRules describes the rules applied to `double` values. These\n// rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.\nmessage DoubleRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must equal 42.0\n  //   double value = 1 [(buf.validate.field).double.const = 42.0];\n  // }\n  // ```\n  optional double const = 1 [(predefined).cel = {\n    id: \"double.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than 10.0\n    //   double value = 1 [(buf.validate.field).double.lt = 10.0];\n    // }\n    // ```\n    double lt = 2 [(predefined).cel = {\n      id: \"double.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this >= rules.lt)\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified value\n    // (field <= value). If the field value is greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be less than or equal to 10.0\n    //   double value = 1 [(buf.validate.field).double.lte = 10.0];\n    // }\n    // ```\n    double lte = 3 [(predefined).cel = {\n      id: \"double.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && (this.isNan() || this > rules.lte)\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,\n    // the range is reversed, and the field value must be outside the specified\n    // range. If the field value doesn't meet the required conditions, an error\n    // message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than 5.0 [double.gt]\n    //   double value = 1 [(buf.validate.field).double.gt = 5.0];\n    //\n    //   // value must be greater than 5 and less than 10.0 [double.gt_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gt = 4 [\n      (predefined).cel = {\n        id: \"double.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this <= rules.gt)\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this.isNan() || this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (this.isNan() || (rules.lt <= this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this.isNan() || this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (this.isNan() || (rules.lte < this && this <= rules.gt))\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDouble {\n    //   // value must be greater than or equal to 5.0 [double.gte]\n    //   double value = 1 [(buf.validate.field).double.gte = 5.0];\n    //\n    //   // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]\n    //   double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];\n    //\n    //   // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]\n    //   double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];\n    // }\n    // ```\n    double gte = 5 [\n      (predefined).cel = {\n        id: \"double.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && (this.isNan() || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this.isNan() || this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (this.isNan() || (rules.lt <= this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this.isNan() || this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"double.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (this.isNan() || (rules.lte < this && this < rules.gte))\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double in = 6 [(predefined).cel = {\n    id: \"double.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyDouble {\n  //   // value must not be in list [1.0, 2.0, 3.0]\n  //   double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];\n  // }\n  // ```\n  repeated double not_in = 7 [(predefined).cel = {\n    id: \"double.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `finite` requires the field value to be finite. If the field value is\n  // infinite or NaN, an error message is generated.\n  optional bool finite = 8 [(predefined).cel = {\n    id: \"double.finite\"\n    expression: \"rules.finite ? (this.isNan() || this.isInf() ? 'value must be finite' : '') : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDouble {\n  //   double value = 1 [\n  //     (buf.validate.field).double.example = 1.0,\n  //     (buf.validate.field).double.example = inf\n  //   ];\n  // }\n  // ```\n  repeated double example = 9 [(predefined).cel = {\n    id: \"double.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int32Rules describes the rules applied to `int32` values. These\n// rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.\nmessage Int32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must equal 42\n  //   int32 value = 1 [(buf.validate.field).int32.const = 42];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"int32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than 10\n    //   int32 value = 1 [(buf.validate.field).int32.lt = 10];\n    // }\n    // ```\n    int32 lt = 2 [(predefined).cel = {\n      id: \"int32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be less than or equal to 10\n    //   int32 value = 1 [(buf.validate.field).int32.lte = 10];\n    // }\n    // ```\n    int32 lte = 3 [(predefined).cel = {\n      id: \"int32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than 5 [int32.gt]\n    //   int32 value = 1 [(buf.validate.field).int32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int32.gt_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gt = 4 [\n      (predefined).cel = {\n        id: \"int32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified value\n    // (exclusive). If the value of `gte` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt32 {\n    //   // value must be greater than or equal to 5 [int32.gte]\n    //   int32 value = 1 [(buf.validate.field).int32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]\n    //   int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]\n    //   int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int32 gte = 5 [\n      (predefined).cel = {\n        id: \"int32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 in = 6 [(predefined).cel = {\n    id: \"int32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int32 not_in = 7 [(predefined).cel = {\n    id: \"int32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt32 {\n  //   int32 value = 1 [\n  //     (buf.validate.field).int32.example = 1,\n  //     (buf.validate.field).int32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int32 example = 8 [(predefined).cel = {\n    id: \"int32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Int64Rules describes the rules applied to `int64` values. These\n// rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.\nmessage Int64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must equal 42\n  //   int64 value = 1 [(buf.validate.field).int64.const = 42];\n  // }\n  // ```\n  optional int64 const = 1 [(predefined).cel = {\n    id: \"int64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than 10\n    //   int64 value = 1 [(buf.validate.field).int64.lt = 10];\n    // }\n    // ```\n    int64 lt = 2 [(predefined).cel = {\n      id: \"int64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be less than or equal to 10\n    //   int64 value = 1 [(buf.validate.field).int64.lte = 10];\n    // }\n    // ```\n    int64 lte = 3 [(predefined).cel = {\n      id: \"int64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than 5 [int64.gt]\n    //   int64 value = 1 [(buf.validate.field).int64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [int64.gt_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gt = 4 [\n      (predefined).cel = {\n        id: \"int64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyInt64 {\n    //   // value must be greater than or equal to 5 [int64.gte]\n    //   int64 value = 1 [(buf.validate.field).int64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]\n    //   int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]\n    //   int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    int64 gte = 5 [\n      (predefined).cel = {\n        id: \"int64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"int64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 in = 6 [(predefined).cel = {\n    id: \"int64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated int64 not_in = 7 [(predefined).cel = {\n    id: \"int64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyInt64 {\n  //   int64 value = 1 [\n  //     (buf.validate.field).int64.example = 1,\n  //     (buf.validate.field).int64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated int64 example = 9 [(predefined).cel = {\n    id: \"int64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt32Rules describes the rules applied to `uint32` values. These\n// rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.\nmessage UInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must equal 42\n  //   uint32 value = 1 [(buf.validate.field).uint32.const = 42];\n  // }\n  // ```\n  optional uint32 const = 1 [(predefined).cel = {\n    id: \"uint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lt = 10];\n    // }\n    // ```\n    uint32 lt = 2 [(predefined).cel = {\n      id: \"uint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be less than or equal to 10\n    //   uint32 value = 1 [(buf.validate.field).uint32.lte = 10];\n    // }\n    // ```\n    uint32 lte = 3 [(predefined).cel = {\n      id: \"uint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than 5 [uint32.gt]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint32.gt_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gt = 4 [\n      (predefined).cel = {\n        id: \"uint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt32 {\n    //   // value must be greater than or equal to 5 [uint32.gte]\n    //   uint32 value = 1 [(buf.validate.field).uint32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]\n    //   uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]\n    //   uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint32 gte = 5 [\n      (predefined).cel = {\n        id: \"uint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 in = 6 [(predefined).cel = {\n    id: \"uint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint32 not_in = 7 [(predefined).cel = {\n    id: \"uint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt32 {\n  //   uint32 value = 1 [\n  //     (buf.validate.field).uint32.example = 1,\n  //     (buf.validate.field).uint32.example = 10\n  //   ];\n  // }\n  // ```\n  repeated uint32 example = 8 [(predefined).cel = {\n    id: \"uint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// UInt64Rules describes the rules applied to `uint64` values. These\n// rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.\nmessage UInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must equal 42\n  //   uint64 value = 1 [(buf.validate.field).uint64.const = 42];\n  // }\n  // ```\n  optional uint64 const = 1 [(predefined).cel = {\n    id: \"uint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lt = 10];\n    // }\n    // ```\n    uint64 lt = 2 [(predefined).cel = {\n      id: \"uint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be less than or equal to 10\n    //   uint64 value = 1 [(buf.validate.field).uint64.lte = 10];\n    // }\n    // ```\n    uint64 lte = 3 [(predefined).cel = {\n      id: \"uint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than 5 [uint64.gt]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [uint64.gt_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gt = 4 [\n      (predefined).cel = {\n        id: \"uint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyUInt64 {\n    //   // value must be greater than or equal to 5 [uint64.gte]\n    //   uint64 value = 1 [(buf.validate.field).uint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]\n    //   uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]\n    //   uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    uint64 gte = 5 [\n      (predefined).cel = {\n        id: \"uint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"uint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 in = 6 [(predefined).cel = {\n    id: \"uint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated uint64 not_in = 7 [(predefined).cel = {\n    id: \"uint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyUInt64 {\n  //   uint64 value = 1 [\n  //     (buf.validate.field).uint64.example = 1,\n  //     (buf.validate.field).uint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated uint64 example = 8 [(predefined).cel = {\n    id: \"uint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt32Rules describes the rules applied to `sint32` values.\nmessage SInt32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must equal 42\n  //   sint32 value = 1 [(buf.validate.field).sint32.const = 42];\n  // }\n  // ```\n  optional sint32 const = 1 [(predefined).cel = {\n    id: \"sint32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lt = 10];\n    // }\n    // ```\n    sint32 lt = 2 [(predefined).cel = {\n      id: \"sint32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be less than or equal to 10\n    //   sint32 value = 1 [(buf.validate.field).sint32.lte = 10];\n    // }\n    // ```\n    sint32 lte = 3 [(predefined).cel = {\n      id: \"sint32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //   // value must be greater than 5 [sint32.gt]\n    //   sint32 value = 1 [(buf.validate.field).sint32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint32.gt_lt]\n    //   sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]\n    //   sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gt = 4 [\n      (predefined).cel = {\n        id: \"sint32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt32 {\n    //  // value must be greater than or equal to 5 [sint32.gte]\n    //  sint32 value = 1 [(buf.validate.field).sint32.gte = 5];\n    //\n    //  // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]\n    //  sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];\n    //\n    //  // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]\n    //  sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint32 gte = 5 [\n      (predefined).cel = {\n        id: \"sint32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 in = 6 [(predefined).cel = {\n    id: \"sint32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint32 not_in = 7 [(predefined).cel = {\n    id: \"sint32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt32 {\n  //   sint32 value = 1 [\n  //     (buf.validate.field).sint32.example = 1,\n  //     (buf.validate.field).sint32.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint32 example = 8 [(predefined).cel = {\n    id: \"sint32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SInt64Rules describes the rules applied to `sint64` values.\nmessage SInt64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must equal 42\n  //   sint64 value = 1 [(buf.validate.field).sint64.const = 42];\n  // }\n  // ```\n  optional sint64 const = 1 [(predefined).cel = {\n    id: \"sint64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field\n    // < value). If the field value is equal to or greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lt = 10];\n    // }\n    // ```\n    sint64 lt = 2 [(predefined).cel = {\n      id: \"sint64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be less than or equal to 10\n    //   sint64 value = 1 [(buf.validate.field).sint64.lte = 10];\n    // }\n    // ```\n    sint64 lte = 3 [(predefined).cel = {\n      id: \"sint64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than 5 [sint64.gt]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sint64.gt_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gt = 4 [\n      (predefined).cel = {\n        id: \"sint64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySInt64 {\n    //   // value must be greater than or equal to 5 [sint64.gte]\n    //   sint64 value = 1 [(buf.validate.field).sint64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]\n    //   sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]\n    //   sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sint64 gte = 5 [\n      (predefined).cel = {\n        id: \"sint64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sint64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 in = 6 [(predefined).cel = {\n    id: \"sint64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sint64 not_in = 7 [(predefined).cel = {\n    id: \"sint64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySInt64 {\n  //   sint64 value = 1 [\n  //     (buf.validate.field).sint64.example = 1,\n  //     (buf.validate.field).sint64.example = -10\n  //   ];\n  // }\n  // ```\n  repeated sint64 example = 8 [(predefined).cel = {\n    id: \"sint64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed32Rules describes the rules applied to `fixed32` values.\nmessage Fixed32Rules {\n  // `const` requires the field value to exactly match the specified value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must equal 42\n  //   fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];\n  // }\n  // ```\n  optional fixed32 const = 1 [(predefined).cel = {\n    id: \"fixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];\n    // }\n    // ```\n    fixed32 lt = 2 [(predefined).cel = {\n      id: \"fixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be less than or equal to 10\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];\n    // }\n    // ```\n    fixed32 lte = 3 [(predefined).cel = {\n      id: \"fixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than 5 [fixed32.gt]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed32.gt_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed32 {\n    //   // value must be greater than or equal to 5 [fixed32.gte]\n    //   fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]\n    //   fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]\n    //   fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message\n  // is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 in = 6 [(predefined).cel = {\n    id: \"fixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed32 not_in = 7 [(predefined).cel = {\n    id: \"fixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed32 {\n  //   fixed32 value = 1 [\n  //     (buf.validate.field).fixed32.example = 1,\n  //     (buf.validate.field).fixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed32 example = 8 [(predefined).cel = {\n    id: \"fixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// Fixed64Rules describes the rules applied to `fixed64` values.\nmessage Fixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must equal 42\n  //   fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];\n  // }\n  // ```\n  optional fixed64 const = 1 [(predefined).cel = {\n    id: \"fixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];\n    // }\n    // ```\n    fixed64 lt = 2 [(predefined).cel = {\n      id: \"fixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be less than or equal to 10\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];\n    // }\n    // ```\n    fixed64 lte = 3 [(predefined).cel = {\n      id: \"fixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than 5 [fixed64.gt]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [fixed64.gt_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"fixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyFixed64 {\n    //   // value must be greater than or equal to 5 [fixed64.gte]\n    //   fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]\n    //   fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]\n    //   fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    fixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"fixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"fixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 in = 6 [(predefined).cel = {\n    id: \"fixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated fixed64 not_in = 7 [(predefined).cel = {\n    id: \"fixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFixed64 {\n  //   fixed64 value = 1 [\n  //     (buf.validate.field).fixed64.example = 1,\n  //     (buf.validate.field).fixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated fixed64 example = 8 [(predefined).cel = {\n    id: \"fixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed32Rules describes the rules applied to `fixed32` values.\nmessage SFixed32Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must equal 42\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];\n  // }\n  // ```\n  optional sfixed32 const = 1 [(predefined).cel = {\n    id: \"sfixed32.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];\n    // }\n    // ```\n    sfixed32 lt = 2 [(predefined).cel = {\n      id: \"sfixed32.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be less than or equal to 10\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];\n    // }\n    // ```\n    sfixed32 lte = 3 [(predefined).cel = {\n      id: \"sfixed32.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than 5 [sfixed32.gt]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed32.gt_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed32.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed32 {\n    //   // value must be greater than or equal to 5 [sfixed32.gte]\n    //   sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]\n    //   sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]\n    //   sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed32 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed32.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed32.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 in = 6 [(predefined).cel = {\n    id: \"sfixed32.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed32 not_in = 7 [(predefined).cel = {\n    id: \"sfixed32.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed32 {\n  //   sfixed32 value = 1 [\n  //     (buf.validate.field).sfixed32.example = 1,\n  //     (buf.validate.field).sfixed32.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed32 example = 8 [(predefined).cel = {\n    id: \"sfixed32.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// SFixed64Rules describes the rules applied to `fixed64` values.\nmessage SFixed64Rules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must equal 42\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];\n  // }\n  // ```\n  optional sfixed64 const = 1 [(predefined).cel = {\n    id: \"sfixed64.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` requires the field value to be less than the specified value (field <\n    // value). If the field value is equal to or greater than the specified value,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];\n    // }\n    // ```\n    sfixed64 lt = 2 [(predefined).cel = {\n      id: \"sfixed64.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` requires the field value to be less than or equal to the specified\n    // value (field <= value). If the field value is greater than the specified\n    // value, an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be less than or equal to 10\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];\n    // }\n    // ```\n    sfixed64 lte = 3 [(predefined).cel = {\n      id: \"sfixed64.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the field value to be greater than the specified value\n    // (exclusive). If the value of `gt` is larger than a specified `lt` or\n    // `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than 5 [sfixed64.gt]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];\n    //\n    //   // value must be greater than 5 and less than 10 [sfixed64.gt_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];\n    //\n    //   // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gt = 4 [\n      (predefined).cel = {\n        id: \"sfixed64.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the field value to be greater than or equal to the specified\n    // value (exclusive). If the value of `gte` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MySFixed64 {\n    //   // value must be greater than or equal to 5 [sfixed64.gte]\n    //   sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];\n    //\n    //   // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]\n    //   sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];\n    //\n    //   // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]\n    //   sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];\n    // }\n    // ```\n    sfixed64 gte = 5 [\n      (predefined).cel = {\n        id: \"sfixed64.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"sfixed64.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` requires the field value to be equal to one of the specified values.\n  // If the field value isn't one of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 in = 6 [(predefined).cel = {\n    id: \"sfixed64.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not be equal to any of the specified\n  // values. If the field value is one of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   // value must not be in list [1, 2, 3]\n  //   sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];\n  // }\n  // ```\n  repeated sfixed64 not_in = 7 [(predefined).cel = {\n    id: \"sfixed64.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MySFixed64 {\n  //   sfixed64 value = 1 [\n  //     (buf.validate.field).sfixed64.example = 1,\n  //     (buf.validate.field).sfixed64.example = 2\n  //   ];\n  // }\n  // ```\n  repeated sfixed64 example = 8 [(predefined).cel = {\n    id: \"sfixed64.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// BoolRules describes the rules applied to `bool` values. These rules\n// may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.\nmessage BoolRules {\n  // `const` requires the field value to exactly match the specified boolean value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBool {\n  //   // value must equal true\n  //   bool value = 1 [(buf.validate.field).bool.const = true];\n  // }\n  // ```\n  optional bool const = 1 [(predefined).cel = {\n    id: \"bool.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBool {\n  //   bool value = 1 [\n  //     (buf.validate.field).bool.example = 1,\n  //     (buf.validate.field).bool.example = 2\n  //   ];\n  // }\n  // ```\n  repeated bool example = 2 [(predefined).cel = {\n    id: \"bool.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// StringRules describes the rules applied to `string` values These\n// rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.\nmessage StringRules {\n  // `const` requires the field value to exactly match the specified value. If\n  // the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must equal `hello`\n  //   string value = 1 [(buf.validate.field).string.const = \"hello\"];\n  // }\n  // ```\n  optional string const = 1 [(predefined).cel = {\n    id: \"string.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal `%s`'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` dictates that the field value must have the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value does not meet the specified\n  // length, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 5 characters\n  //   string value = 1 [(buf.validate.field).string.len = 5];\n  // }\n  // ```\n  optional uint64 len = 19 [(predefined).cel = {\n    id: \"string.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s characters'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` specifies that the field value must have at least the specified\n  // number of characters (Unicode code points), which may differ from the number\n  // of bytes in the string. If the field value contains fewer characters, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 3 characters\n  //   string value = 1 [(buf.validate.field).string.min_len = 3];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"string.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s characters'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` specifies that the field value must have no more than the specified\n  // number of characters (Unicode code points), which may differ from the\n  // number of bytes in the string. If the field value contains more characters,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 10 characters\n  //   string value = 1 [(buf.validate.field).string.max_len = 10];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"string.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value length must be at most %s characters'.format([rules.max_len]) : ''\"\n  }];\n\n  // `len_bytes` dictates that the field value must have the specified number of\n  // bytes. If the field value does not match the specified length in bytes,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be 6 bytes\n  //   string value = 1 [(buf.validate.field).string.len_bytes = 6];\n  // }\n  // ```\n  optional uint64 len_bytes = 20 [(predefined).cel = {\n    id: \"string.len_bytes\"\n    expression: \"uint(bytes(this).size()) != rules.len_bytes ? 'value length must be %s bytes'.format([rules.len_bytes]) : ''\"\n  }];\n\n  // `min_bytes` specifies that the field value must have at least the specified\n  // number of bytes. If the field value contains fewer bytes, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at least 4 bytes\n  //   string value = 1 [(buf.validate.field).string.min_bytes = 4];\n  // }\n  //\n  // ```\n  optional uint64 min_bytes = 4 [(predefined).cel = {\n    id: \"string.min_bytes\"\n    expression: \"uint(bytes(this).size()) < rules.min_bytes ? 'value length must be at least %s bytes'.format([rules.min_bytes]) : ''\"\n  }];\n\n  // `max_bytes` specifies that the field value must have no more than the\n  //specified number of bytes. If the field value contains more bytes, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value length must be at most 8 bytes\n  //   string value = 1 [(buf.validate.field).string.max_bytes = 8];\n  // }\n  // ```\n  optional uint64 max_bytes = 5 [(predefined).cel = {\n    id: \"string.max_bytes\"\n    expression: \"uint(bytes(this).size()) > rules.max_bytes ? 'value length must be at most %s bytes'.format([rules.max_bytes]) : ''\"\n  }];\n\n  // `pattern` specifies that the field value must match the specified\n  // regular expression (RE2 syntax), with the expression provided without any\n  // delimiters. If the field value doesn't match the regular expression, an\n  // error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not match regex pattern `^[a-zA-Z]//$`\n  //   string value = 1 [(buf.validate.field).string.pattern = \"^[a-zA-Z]//$\"];\n  // }\n  // ```\n  optional string pattern = 6 [(predefined).cel = {\n    id: \"string.pattern\"\n    expression: \"!this.matches(rules.pattern) ? 'value does not match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` specifies that the field value must have the\n  //specified substring at the beginning of the string. If the field value\n  // doesn't start with the specified prefix, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have prefix `pre`\n  //   string value = 1 [(buf.validate.field).string.prefix = \"pre\"];\n  // }\n  // ```\n  optional string prefix = 7 [(predefined).cel = {\n    id: \"string.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix `%s`'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` specifies that the field value must have the\n  //specified substring at the end of the string. If the field value doesn't\n  // end with the specified suffix, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not have suffix `post`\n  //   string value = 1 [(buf.validate.field).string.suffix = \"post\"];\n  // }\n  // ```\n  optional string suffix = 8 [(predefined).cel = {\n    id: \"string.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix `%s`'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` specifies that the field value must have the\n  //specified substring anywhere in the string. If the field value doesn't\n  // contain the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value does not contain substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.contains = \"inside\"];\n  // }\n  // ```\n  optional string contains = 9 [(predefined).cel = {\n    id: \"string.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain substring `%s`'.format([rules.contains]) : ''\"\n  }];\n\n  // `not_contains` specifies that the field value must not have the\n  //specified substring anywhere in the string. If the field value contains\n  // the specified substring, an error message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value contains substring `inside`.\n  //   string value = 1 [(buf.validate.field).string.not_contains = \"inside\"];\n  // }\n  // ```\n  optional string not_contains = 23 [(predefined).cel = {\n    id: \"string.not_contains\"\n    expression: \"this.contains(rules.not_contains) ? 'value contains substring `%s`'.format([rules.not_contains]) : ''\"\n  }];\n\n  // `in` specifies that the field value must be equal to one of the specified\n  // values. If the field value isn't one of the specified values, an error\n  // message will be generated.\n  //\n  // ```proto\n  // message MyString {\n  //   // value must be in list [\"apple\", \"banana\"]\n  //   string value = 1 [(buf.validate.field).string.in = \"apple\", (buf.validate.field).string.in = \"banana\"];\n  // }\n  // ```\n  repeated string in = 10 [(predefined).cel = {\n    id: \"string.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` specifies that the field value cannot be equal to any\n  // of the specified values. If the field value is one of the specified values,\n  // an error message will be generated.\n  // ```proto\n  // message MyString {\n  //   // value must not be in list [\"orange\", \"grape\"]\n  //   string value = 1 [(buf.validate.field).string.not_in = \"orange\", (buf.validate.field).string.not_in = \"grape\"];\n  // }\n  // ```\n  repeated string not_in = 11 [(predefined).cel = {\n    id: \"string.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `WellKnown` rules provide advanced rules against common string\n  // patterns.\n  oneof well_known {\n    // `email` specifies that the field value must be a valid email address, for\n    // example \"foo@example.com\".\n    //\n    // Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).\n    // Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),\n    // which allows many unexpected forms of email addresses and will easily match\n    // a typographical error.\n    //\n    // If the field value isn't a valid email address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid email address\n    //   string value = 1 [(buf.validate.field).string.email = true];\n    // }\n    // ```\n    bool email = 12 [\n      (predefined).cel = {\n        id: \"string.email\"\n        message: \"value must be a valid email address\"\n        expression: \"!rules.email || this == '' || this.isEmail()\"\n      },\n      (predefined).cel = {\n        id: \"string.email_empty\"\n        message: \"value is empty, which is not a valid email address\"\n        expression: \"!rules.email || this != ''\"\n      }\n    ];\n\n    // `hostname` specifies that the field value must be a valid hostname, for\n    // example \"foo.example.com\".\n    //\n    // A valid hostname follows the rules below:\n    // - The name consists of one or more labels, separated by a dot (\".\").\n    // - Each label can be 1 to 63 alphanumeric characters.\n    // - A label can contain hyphens (\"-\"), but must not start or end with a hyphen.\n    // - The right-most label must not be digits only.\n    // - The name can have a trailing dot—for example, \"foo.example.com.\".\n    // - The name can be 253 characters at most, excluding the optional trailing dot.\n    //\n    // If the field value isn't a valid hostname, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname\n    //   string value = 1 [(buf.validate.field).string.hostname = true];\n    // }\n    // ```\n    bool hostname = 13 [\n      (predefined).cel = {\n        id: \"string.hostname\"\n        message: \"value must be a valid hostname\"\n        expression: \"!rules.hostname || this == '' || this.isHostname()\"\n      },\n      (predefined).cel = {\n        id: \"string.hostname_empty\"\n        message: \"value is empty, which is not a valid hostname\"\n        expression: \"!rules.hostname || this != ''\"\n      }\n    ];\n\n    // `ip` specifies that the field value must be a valid IP (v4 or v6) address.\n    //\n    // IPv4 addresses are expected in the dotted decimal format—for example, \"192.168.5.21\".\n    // IPv6 addresses are expected in their text representation—for example, \"::1\",\n    // or \"2001:0DB8:ABCD:0012::0\".\n    //\n    // Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone identifiers for IPv6 addresses (for example, \"fe80::a%en1\") are supported.\n    //\n    // If the field value isn't a valid IP address, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP address\n    //   string value = 1 [(buf.validate.field).string.ip = true];\n    // }\n    // ```\n    bool ip = 14 [\n      (predefined).cel = {\n        id: \"string.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this == '' || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this != ''\"\n      }\n    ];\n\n    // `ipv4` specifies that the field value must be a valid IPv4 address—for\n    // example \"192.168.5.21\". If the field value isn't a valid IPv4 address, an\n    // error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address\n    //   string value = 1 [(buf.validate.field).string.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 15 [\n      (predefined).cel = {\n        id: \"string.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this == '' || this.isIp(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this != ''\"\n      }\n    ];\n\n    // `ipv6` specifies that the field value must be a valid IPv6 address—for\n    // example \"::1\", or \"d7a:115c:a1e0:ab12:4843:cd96:626b:430b\". If the field\n    // value is not a valid IPv6 address, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address\n    //   string value = 1 [(buf.validate.field).string.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 16 [\n      (predefined).cel = {\n        id: \"string.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this == '' || this.isIp(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this != ''\"\n      }\n    ];\n\n    // `uri` specifies that the field value must be a valid URI, for example\n    // \"https://example.com/foo/bar?baz=quux#frag\".\n    //\n    // URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).\n    // Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI\n    //   string value = 1 [(buf.validate.field).string.uri = true];\n    // }\n    // ```\n    bool uri = 17 [\n      (predefined).cel = {\n        id: \"string.uri\"\n        message: \"value must be a valid URI\"\n        expression: \"!rules.uri || this == '' || this.isUri()\"\n      },\n      (predefined).cel = {\n        id: \"string.uri_empty\"\n        message: \"value is empty, which is not a valid URI\"\n        expression: \"!rules.uri || this != ''\"\n      }\n    ];\n\n    // `uri_ref` specifies that the field value must be a valid URI Reference—either\n    // a URI such as \"https://example.com/foo/bar?baz=quux#frag\", or a Relative\n    // Reference such as \"./foo/bar?query\".\n    //\n    // URI, URI Reference, and Relative Reference are defined in the internet\n    // standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone\n    // Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).\n    //\n    // If the field value isn't a valid URI Reference, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid URI Reference\n    //   string value = 1 [(buf.validate.field).string.uri_ref = true];\n    // }\n    // ```\n    bool uri_ref = 18 [(predefined).cel = {\n      id: \"string.uri_ref\"\n      message: \"value must be a valid URI Reference\"\n      expression: \"!rules.uri_ref || this.isUriRef()\"\n    }];\n\n    // `address` specifies that the field value must be either a valid hostname\n    // (for example, \"example.com\"), or a valid IP (v4 or v6) address (for example,\n    // \"192.168.0.1\", or \"::1\"). If the field value isn't a valid hostname or IP,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid hostname, or ip address\n    //   string value = 1 [(buf.validate.field).string.address = true];\n    // }\n    // ```\n    bool address = 21 [\n      (predefined).cel = {\n        id: \"string.address\"\n        message: \"value must be a valid hostname, or ip address\"\n        expression: \"!rules.address || this == '' || this.isHostname() || this.isIp()\"\n      },\n      (predefined).cel = {\n        id: \"string.address_empty\"\n        message: \"value is empty, which is not a valid hostname, or ip address\"\n        expression: \"!rules.address || this != ''\"\n      }\n    ];\n\n    // `uuid` specifies that the field value must be a valid UUID as defined by\n    // [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the\n    // field value isn't a valid UUID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid UUID\n    //   string value = 1 [(buf.validate.field).string.uuid = true];\n    // }\n    // ```\n    bool uuid = 22 [\n      (predefined).cel = {\n        id: \"string.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this != ''\"\n      }\n    ];\n\n    // `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes\n    // omitted. If the field value isn't a valid UUID without dashes, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid trimmed UUID\n    //   string value = 1 [(buf.validate.field).string.tuuid = true];\n    // }\n    // ```\n    bool tuuid = 33 [\n      (predefined).cel = {\n        id: \"string.tuuid\"\n        message: \"value must be a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this == '' || this.matches('^[0-9a-fA-F]{32}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.tuuid_empty\"\n        message: \"value is empty, which is not a valid trimmed UUID\"\n        expression: \"!rules.tuuid || this != ''\"\n      }\n    ];\n\n    // `ip_with_prefixlen` specifies that the field value must be a valid IP\n    // (v4 or v6) address with prefix length—for example, \"192.168.5.21/16\" or\n    // \"2001:0DB8:ABCD:0012::F1/64\". If the field value isn't a valid IP with\n    // prefix length, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP with prefix length\n    //    string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];\n    // }\n    // ```\n    bool ip_with_prefixlen = 26 [\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this == '' || this.isIpPrefix()\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv4_with_prefixlen` specifies that the field value must be a valid\n    // IPv4 address with prefix length—for example, \"192.168.5.21/16\". If the\n    // field value isn't a valid IPv4 address with prefix length, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 address with prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv4_with_prefixlen = 27 [\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen\"\n        message: \"value must be a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this == '' || this.isIpPrefix(4)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv4 address with prefix length\"\n        expression: \"!rules.ipv4_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ipv6_with_prefixlen` specifies that the field value must be a valid\n    // IPv6 address with prefix length—for example, \"2001:0DB8:ABCD:0012::F1/64\".\n    // If the field value is not a valid IPv6 address with prefix length,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 address prefix length\n    //    string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];\n    // }\n    // ```\n    bool ipv6_with_prefixlen = 28 [\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen\"\n        message: \"value must be a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this == '' || this.isIpPrefix(6)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_with_prefixlen_empty\"\n        message: \"value is empty, which is not a valid IPv6 address with prefix length\"\n        expression: \"!rules.ipv6_with_prefixlen || this != ''\"\n      }\n    ];\n\n    // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)\n    // prefix—for example, \"192.168.0.0/16\" or \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value isn't a valid IP prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IP prefix\n    //    string value = 1 [(buf.validate.field).string.ip_prefix = true];\n    // }\n    // ```\n    bool ip_prefix = 29 [\n      (predefined).cel = {\n        id: \"string.ip_prefix\"\n        message: \"value must be a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this == '' || this.isIpPrefix(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ip_prefix_empty\"\n        message: \"value is empty, which is not a valid IP prefix\"\n        expression: \"!rules.ip_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv4_prefix` specifies that the field value must be a valid IPv4\n    // prefix, for example \"192.168.0.0/16\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"192.168.0.0/16\" designates the left-most 16 bits for the prefix,\n    // and the remaining 16 bits must be zero.\n    //\n    // If the field value isn't a valid IPv4 prefix, an error message\n    // will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv4 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv4_prefix = true];\n    // }\n    // ```\n    bool ipv4_prefix = 30 [\n      (predefined).cel = {\n        id: \"string.ipv4_prefix\"\n        message: \"value must be a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this == '' || this.isIpPrefix(4, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv4_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv4 prefix\"\n        expression: \"!rules.ipv4_prefix || this != ''\"\n      }\n    ];\n\n    // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for\n    // example, \"2001:0DB8:ABCD:0012::0/64\".\n    //\n    // The prefix must have all zeros for the unmasked bits. For example,\n    // \"2001:0DB8:ABCD:0012::0/64\" designates the left-most 64 bits for the\n    // prefix, and the remaining 64 bits must be zero.\n    //\n    // If the field value is not a valid IPv6 prefix, an error message will be\n    // generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid IPv6 prefix\n    //    string value = 1 [(buf.validate.field).string.ipv6_prefix = true];\n    // }\n    // ```\n    bool ipv6_prefix = 31 [\n      (predefined).cel = {\n        id: \"string.ipv6_prefix\"\n        message: \"value must be a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this == '' || this.isIpPrefix(6, true)\"\n      },\n      (predefined).cel = {\n        id: \"string.ipv6_prefix_empty\"\n        message: \"value is empty, which is not a valid IPv6 prefix\"\n        expression: \"!rules.ipv6_prefix || this != ''\"\n      }\n    ];\n\n    // `host_and_port` specifies that the field value must be valid host/port\n    // pair—for example, \"example.com:8080\".\n    //\n    // The host can be one of:\n    //- An IPv4 address in dotted decimal format—for example, \"192.168.5.21\".\n    //- An IPv6 address enclosed in square brackets—for example, \"[2001:0DB8:ABCD:0012::F1]\".\n    //- A hostname—for example, \"example.com\".\n    //\n    // The port is separated by a colon. It must be non-empty, with a decimal number\n    // in the range of 0-65535, inclusive.\n    bool host_and_port = 32 [\n      (predefined).cel = {\n        id: \"string.host_and_port\"\n        message: \"value must be a valid host (hostname or IP address) and port pair\"\n        expression: \"!rules.host_and_port || this == '' || this.isHostAndPort(true)\"\n      },\n      (predefined).cel = {\n        id: \"string.host_and_port_empty\"\n        message: \"value is empty, which is not a valid host and port pair\"\n        expression: \"!rules.host_and_port || this != ''\"\n      }\n    ];\n\n    // `ulid` specifies that the field value must be a valid ULID (Universally Unique\n    // Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).\n    // If the field value isn't a valid ULID, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid ULID\n    //   string value = 1 [(buf.validate.field).string.ulid = true];\n    // }\n    // ```\n    bool ulid = 35 [\n      (predefined).cel = {\n        id: \"string.ulid\"\n        message: \"value must be a valid ULID\"\n        expression: \"!rules.ulid || this == '' || this.matches('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$')\"\n      },\n      (predefined).cel = {\n        id: \"string.ulid_empty\"\n        message: \"value is empty, which is not a valid ULID\"\n        expression: \"!rules.ulid || this != ''\"\n      }\n    ];\n\n    // `well_known_regex` specifies a common well-known pattern\n    // defined as a regex. If the field value doesn't match the well-known\n    // regex, an error message will be generated.\n    //\n    // ```proto\n    // message MyString {\n    //   // value must be a valid HTTP header value\n    //   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];\n    // }\n    // ```\n    //\n    // #### KnownRegex\n    //\n    // `well_known_regex` contains some well-known patterns.\n    //\n    // | Name                          | Number | Description                               |\n    // |-------------------------------|--------|-------------------------------------------|\n    // | KNOWN_REGEX_UNSPECIFIED       | 0      |                                           |\n    // | KNOWN_REGEX_HTTP_HEADER_NAME  | 1      | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2)  |\n    // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |\n    KnownRegex well_known_regex = 24 [\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name\"\n        message: \"value must be a valid HTTP header name\"\n        expression:\n          \"rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^:?[0-9a-zA-Z!#$%&\\\\'*+-.^_|~\\\\x60]+$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]+$')\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_name_empty\"\n        message: \"value is empty, which is not a valid HTTP header name\"\n        expression: \"rules.well_known_regex != 1 || this != ''\"\n      },\n      (predefined).cel = {\n        id: \"string.well_known_regex.header_value\"\n        message: \"value must be a valid HTTP header value\"\n        expression:\n          \"rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?\"\n          \"'^[^\\\\u0000-\\\\u0008\\\\u000A-\\\\u001F\\\\u007F]*$' :\"\n          \"'^[^\\\\u0000\\\\u000A\\\\u000D]*$')\"\n      }\n    ];\n  }\n\n  // This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to\n  // enable strict header validation. By default, this is true, and HTTP header\n  // validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser\n  // validations that only disallow `\\r\\n\\0` characters, which can be used to\n  // bypass header matching rules.\n  //\n  // ```proto\n  // message MyString {\n  //   // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.\n  //   string value = 1 [(buf.validate.field).string.strict = false];\n  // }\n  // ```\n  optional bool strict = 25;\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyString {\n  //   string value = 1 [\n  //     (buf.validate.field).string.example = \"hello\",\n  //     (buf.validate.field).string.example = \"world\"\n  //   ];\n  // }\n  // ```\n  repeated string example = 34 [(predefined).cel = {\n    id: \"string.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// KnownRegex contains some well-known patterns.\nenum KnownRegex {\n  KNOWN_REGEX_UNSPECIFIED = 0;\n\n  // HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2).\n  KNOWN_REGEX_HTTP_HEADER_NAME = 1;\n\n  // HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4).\n  KNOWN_REGEX_HTTP_HEADER_VALUE = 2;\n}\n\n// BytesRules describe the rules applied to `bytes` values. These rules\n// may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.\nmessage BytesRules {\n  // `const` requires the field value to exactly match the specified bytes\n  // value. If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be \"\\x01\\x02\\x03\\x04\"\n  //   bytes value = 1 [(buf.validate.field).bytes.const = \"\\x01\\x02\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes const = 1 [(predefined).cel = {\n    id: \"bytes.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must be %x'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `len` requires the field value to have the specified length in bytes.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be 4 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.len = 4];\n  // }\n  // ```\n  optional uint64 len = 13 [(predefined).cel = {\n    id: \"bytes.len\"\n    expression: \"uint(this.size()) != rules.len ? 'value length must be %s bytes'.format([rules.len]) : ''\"\n  }];\n\n  // `min_len` requires the field value to have at least the specified minimum\n  // length in bytes.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value length must be at least 2 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];\n  // }\n  // ```\n  optional uint64 min_len = 2 [(predefined).cel = {\n    id: \"bytes.min_len\"\n    expression: \"uint(this.size()) < rules.min_len ? 'value length must be at least %s bytes'.format([rules.min_len]) : ''\"\n  }];\n\n  // `max_len` requires the field value to have at most the specified maximum\n  // length in bytes.\n  // If the field value exceeds the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must be at most 6 bytes.\n  //   optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];\n  // }\n  // ```\n  optional uint64 max_len = 3 [(predefined).cel = {\n    id: \"bytes.max_len\"\n    expression: \"uint(this.size()) > rules.max_len ? 'value must be at most %s bytes'.format([rules.max_len]) : ''\"\n  }];\n\n  // `pattern` requires the field value to match the specified regular\n  // expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).\n  // The value of the field must be valid UTF-8 or validation will fail with a\n  // runtime error.\n  // If the field value doesn't match the pattern, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must match regex pattern \"^[a-zA-Z0-9]+$\".\n  //   optional bytes value = 1 [(buf.validate.field).bytes.pattern = \"^[a-zA-Z0-9]+$\"];\n  // }\n  // ```\n  optional string pattern = 4 [(predefined).cel = {\n    id: \"bytes.pattern\"\n    expression: \"!string(this).matches(rules.pattern) ? 'value must match regex pattern `%s`'.format([rules.pattern]) : ''\"\n  }];\n\n  // `prefix` requires the field value to have the specified bytes at the\n  // beginning of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have prefix \\x01\\x02\n  //   optional bytes value = 1 [(buf.validate.field).bytes.prefix = \"\\x01\\x02\"];\n  // }\n  // ```\n  optional bytes prefix = 5 [(predefined).cel = {\n    id: \"bytes.prefix\"\n    expression: \"!this.startsWith(rules.prefix) ? 'value does not have prefix %x'.format([rules.prefix]) : ''\"\n  }];\n\n  // `suffix` requires the field value to have the specified bytes at the end\n  // of the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not have suffix \\x03\\x04\n  //   optional bytes value = 1 [(buf.validate.field).bytes.suffix = \"\\x03\\x04\"];\n  // }\n  // ```\n  optional bytes suffix = 6 [(predefined).cel = {\n    id: \"bytes.suffix\"\n    expression: \"!this.endsWith(rules.suffix) ? 'value does not have suffix %x'.format([rules.suffix]) : ''\"\n  }];\n\n  // `contains` requires the field value to have the specified bytes anywhere in\n  // the string.\n  // If the field value doesn't meet the requirement, an error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value does not contain \\x02\\x03\n  //   optional bytes value = 1 [(buf.validate.field).bytes.contains = \"\\x02\\x03\"];\n  // }\n  // ```\n  optional bytes contains = 7 [(predefined).cel = {\n    id: \"bytes.contains\"\n    expression: \"!this.contains(rules.contains) ? 'value does not contain %x'.format([rules.contains]) : ''\"\n  }];\n\n  // `in` requires the field value to be equal to one of the specified\n  // values. If the field value doesn't match any of the specified values, an\n  // error message is generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes in = 8 [(predefined).cel = {\n    id: \"bytes.in\"\n    expression: \"getField(rules, 'in').size() > 0 && !(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the specified\n  // values.\n  // If the field value matches any of the specified values, an error message is\n  // generated.\n  //\n  // ```proto\n  // message MyBytes {\n  //   // value must not in [\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"]\n  //   optional bytes value = 1 [(buf.validate.field).bytes.not_in = {\"\\x01\\x02\", \"\\x02\\x03\", \"\\x03\\x04\"}];\n  // }\n  // ```\n  repeated bytes not_in = 9 [(predefined).cel = {\n    id: \"bytes.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // WellKnown rules provide advanced rules against common byte\n  // patterns\n  oneof well_known {\n    // `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IP address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ip = true];\n    // }\n    // ```\n    bool ip = 10 [\n      (predefined).cel = {\n        id: \"bytes.ip\"\n        message: \"value must be a valid IP address\"\n        expression: \"!rules.ip || this.size() == 0 || this.size() == 4 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ip_empty\"\n        message: \"value is empty, which is not a valid IP address\"\n        expression: \"!rules.ip || this.size() != 0\"\n      }\n    ];\n\n    // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv4 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];\n    // }\n    // ```\n    bool ipv4 = 11 [\n      (predefined).cel = {\n        id: \"bytes.ipv4\"\n        message: \"value must be a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() == 0 || this.size() == 4\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv4_empty\"\n        message: \"value is empty, which is not a valid IPv4 address\"\n        expression: \"!rules.ipv4 || this.size() != 0\"\n      }\n    ];\n\n    // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.\n    // If the field value doesn't meet this rule, an error message is generated.\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid IPv6 address\n    //   optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];\n    // }\n    // ```\n    bool ipv6 = 12 [\n      (predefined).cel = {\n        id: \"bytes.ipv6\"\n        message: \"value must be a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.ipv6_empty\"\n        message: \"value is empty, which is not a valid IPv6 address\"\n        expression: \"!rules.ipv6 || this.size() != 0\"\n      }\n    ];\n\n    // `uuid` ensures that the field `value` encodes the 128-bit UUID data as\n    // defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).\n    // The field must contain exactly 16 bytes\n    // representing the UUID. If the field value isn't a valid UUID, an error\n    // message will be generated.\n    //\n    // ```proto\n    // message MyBytes {\n    //   // value must be a valid UUID\n    //   optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];\n    // }\n    // ```\n    bool uuid = 15 [\n      (predefined).cel = {\n        id: \"bytes.uuid\"\n        message: \"value must be a valid UUID\"\n        expression: \"!rules.uuid || this.size() == 0 || this.size() == 16\"\n      },\n      (predefined).cel = {\n        id: \"bytes.uuid_empty\"\n        message: \"value is empty, which is not a valid UUID\"\n        expression: \"!rules.uuid || this.size() != 0\"\n      }\n    ];\n  }\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyBytes {\n  //   bytes value = 1 [\n  //     (buf.validate.field).bytes.example = \"\\x01\\x02\",\n  //     (buf.validate.field).bytes.example = \"\\x02\\x03\"\n  //   ];\n  // }\n  // ```\n  repeated bytes example = 14 [(predefined).cel = {\n    id: \"bytes.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// EnumRules describe the rules applied to `enum` values.\nmessage EnumRules {\n  // `const` requires the field value to exactly match the specified enum value.\n  // If the field value doesn't match, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be exactly MY_ENUM_VALUE1.\n  //   MyEnum value = 1 [(buf.validate.field).enum.const = 1];\n  // }\n  // ```\n  optional int32 const = 1 [(predefined).cel = {\n    id: \"enum.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n\n  // `defined_only` requires the field value to be one of the defined values for\n  // this enum, failing on any undefined value.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be a defined value of MyEnum.\n  //   MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];\n  // }\n  // ```\n  optional bool defined_only = 2;\n\n  // `in` requires the field value to be equal to one of the\n  //specified enum values. If the field value doesn't match any of the\n  //specified values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must be equal to one of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 in = 3 [(predefined).cel = {\n    id: \"enum.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to be not equal to any of the\n  //specified enum values. If the field value matches one of the specified\n  // values, an error message is generated.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //   // The field `value` must not be equal to any of the specified values.\n  //   MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];\n  // }\n  // ```\n  repeated int32 not_in = 4 [(predefined).cel = {\n    id: \"enum.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // enum MyEnum {\n  //   MY_ENUM_UNSPECIFIED = 0;\n  //   MY_ENUM_VALUE1 = 1;\n  //   MY_ENUM_VALUE2 = 2;\n  // }\n  //\n  // message MyMessage {\n  //     (buf.validate.field).enum.example = 1,\n  //     (buf.validate.field).enum.example = 2\n  // }\n  // ```\n  repeated int32 example = 5 [(predefined).cel = {\n    id: \"enum.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// RepeatedRules describe the rules applied to `repeated` values.\nmessage RepeatedRules {\n  // `min_items` requires that this field must contain at least the specified\n  // minimum number of items.\n  //\n  // Note that `min_items = 1` is equivalent to setting a field as `required`.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain at least  2 items\n  //   repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];\n  // }\n  // ```\n  optional uint64 min_items = 1 [(predefined).cel = {\n    id: \"repeated.min_items\"\n    expression: \"uint(this.size()) < rules.min_items ? 'value must contain at least %d item(s)'.format([rules.min_items]) : ''\"\n  }];\n\n  // `max_items` denotes that this field must not exceed a\n  // certain number of items as the upper limit. If the field contains more\n  // items than specified, an error message will be generated, requiring the\n  // field to maintain no more than the specified number of items.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // value must contain no more than 3 item(s)\n  //   repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];\n  // }\n  // ```\n  optional uint64 max_items = 2 [(predefined).cel = {\n    id: \"repeated.max_items\"\n    expression: \"uint(this.size()) > rules.max_items ? 'value must contain no more than %s item(s)'.format([rules.max_items]) : ''\"\n  }];\n\n  // `unique` indicates that all elements in this field must\n  // be unique. This rule is strictly applicable to scalar and enum\n  // types, with message types not being supported.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // repeated value must contain unique items\n  //   repeated string value = 1 [(buf.validate.field).repeated.unique = true];\n  // }\n  // ```\n  optional bool unique = 3 [(predefined).cel = {\n    id: \"repeated.unique\"\n    message: \"repeated value must contain unique items\"\n    expression: \"!rules.unique || this.unique()\"\n  }];\n\n  // `items` details the rules to be applied to each item\n  // in the field. Even for repeated message fields, validation is executed\n  // against each item unless `ignore` is specified.\n  //\n  // ```proto\n  // message MyRepeated {\n  //   // The items in the field `value` must follow the specified rules.\n  //   repeated string value = 1 [(buf.validate.field).repeated.items = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Repeated items\n  // cannot be unset.\n  optional FieldRules items = 4;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// MapRules describe the rules applied to `map` values.\nmessage MapRules {\n  // Specifies the minimum number of key-value pairs allowed. If the field has\n  // fewer key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at least 2 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];\n  // }\n  // ```\n  optional uint64 min_pairs = 1 [(predefined).cel = {\n    id: \"map.min_pairs\"\n    expression: \"uint(this.size()) < rules.min_pairs ? 'map must be at least %d entries'.format([rules.min_pairs]) : ''\"\n  }];\n\n  // Specifies the maximum number of key-value pairs allowed. If the field has\n  // more key-value pairs than specified, an error message is generated.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The field `value` must have at most 3 key-value pairs.\n  //   map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];\n  // }\n  // ```\n  optional uint64 max_pairs = 2 [(predefined).cel = {\n    id: \"map.max_pairs\"\n    expression: \"uint(this.size()) > rules.max_pairs ? 'map must be at most %d entries'.format([rules.max_pairs]) : ''\"\n  }];\n\n  // Specifies the rules to be applied to each key in the field.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The keys in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.keys = {\n  //     string: {\n  //       min_len: 3\n  //       max_len: 10\n  //     }\n  //   }];\n  // }\n  // ```\n  //\n  // Note that the `required` rule does not apply. Map keys cannot be unset.\n  optional FieldRules keys = 4;\n\n  // Specifies the rules to be applied to the value of each key in the\n  // field. Message values will still have their validations evaluated unless\n  // `ignore` is specified.\n  //\n  // ```proto\n  // message MyMap {\n  //   // The values in the field `value` must follow the specified rules.\n  //   map<string, string> value = 1 [(buf.validate.field).map.values = {\n  //     string: {\n  //       min_len: 5\n  //       max_len: 20\n  //     }\n  //   }];\n  // }\n  // ```\n  // Note that the `required` rule does not apply. Map values cannot be unset.\n  optional FieldRules values = 5;\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type.\nmessage AnyRules {\n  // `in` requires the field's `type_url` to be equal to one of the\n  //specified values. If it doesn't match any of the specified values, an error\n  // message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must have a `type_url` equal to one of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       in: [\"type.googleapis.com/MyType1\", \"type.googleapis.com/MyType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2;\n\n  // requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.\n  //\n  // ```proto\n  // message MyAny {\n  //   //  The `value` field must not have a `type_url` equal to any of the specified values.\n  //   google.protobuf.Any value = 1 [(buf.validate.field).any = {\n  //       not_in: [\"type.googleapis.com/ForbiddenType1\", \"type.googleapis.com/ForbiddenType2\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3;\n}\n\n// DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type.\nmessage DurationRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must equal 5s\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = \"5s\"];\n  // }\n  // ```\n  optional google.protobuf.Duration const = 2 [(predefined).cel = {\n    id: \"duration.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,\n    // exclusive. If the field's value is greater than or equal to the specified\n    // value, an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than 5s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = \"5s\"];\n    // }\n    // ```\n    google.protobuf.Duration lt = 3 [(predefined).cel = {\n      id: \"duration.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // `lte` indicates that the field must be less than or equal to the specified\n    // value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,\n    // an error message will be generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // value must be less than or equal to 10s\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = \"10s\"];\n    // }\n    // ```\n    google.protobuf.Duration lte = 4 [(predefined).cel = {\n      id: \"duration.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the duration field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be greater than 5s [duration.gt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];\n    //\n    //   // duration must be greater than 5s and less than 10s [duration.gt_lt]\n    //   google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //   // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]\n    //   google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gt = 5 [\n      (predefined).cel = {\n        id: \"duration.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the duration field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value must\n    // be outside the specified range. If the field value doesn't meet the\n    // required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //  // duration must be greater than or equal to 5s [duration.gte]\n    //  google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];\n    //\n    //  // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]\n    //  google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];\n    //\n    //  // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]\n    //  google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];\n    // }\n    // ```\n    google.protobuf.Duration gte = 6 [\n      (predefined).cel = {\n        id: \"duration.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"duration.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n  }\n\n  // `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value doesn't correspond to any of the specified values,\n  // an error message will be generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration in = 7 [(predefined).cel = {\n    id: \"duration.in\"\n    expression: \"!(this in getField(rules, 'in')) ? 'value must be in list %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` denotes that the field must not be equal to\n  // any of the specified values of the `google.protobuf.Duration` type.\n  // If the field's value matches any of these values, an error message will be\n  // generated.\n  //\n  // ```proto\n  // message MyDuration {\n  //   // value must not be in list [1s, 2s, 3s]\n  //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = [\"1s\", \"2s\", \"3s\"]];\n  // }\n  // ```\n  repeated google.protobuf.Duration not_in = 8 [(predefined).cel = {\n    id: \"duration.not_in\"\n    expression: \"this in rules.not_in ? 'value must not be in list %s'.format([rules.not_in]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyDuration {\n  //   google.protobuf.Duration value = 1 [\n  //     (buf.validate.field).duration.example = { seconds: 1 },\n  //     (buf.validate.field).duration.example = { seconds: 2 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Duration example = 9 [(predefined).cel = {\n    id: \"duration.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type.\nmessage FieldMaskRules {\n  // `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.\n  // If the field's value deviates from the specified value, an error message\n  // will be generated.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   // value must equal [\"a\"]\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {\n  //       paths: [\"a\"]\n  //   }];\n  // }\n  // ```\n  optional google.protobuf.FieldMask const = 1 [(predefined).cel = {\n    id: \"field_mask.const\"\n    expression: \"this.paths != getField(rules, 'const').paths ? 'value must equal paths %s'.format([getField(rules, 'const').paths]) : ''\"\n  }];\n\n  // `in` requires the field value to only contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths doesn't match the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask must only contain paths listed in `in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       in: [\"a\", \"b\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string in = 2 [(predefined).cel = {\n    id: \"field_mask.in\"\n    expression: \"!this.paths.all(p, p in getField(rules, 'in') || getField(rules, 'in').exists(f, p.startsWith(f+'.'))) ? 'value must only contain paths in %s'.format([getField(rules, 'in')]) : ''\"\n  }];\n\n  // `not_in` requires the field value to not contain paths matching specified\n  // values or their subpaths.\n  // If any of the field value's paths matches the rule,\n  // an error message is generated.\n  // See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   //  The `value` FieldMask shall not contain paths listed in `not_in`.\n  //   google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {\n  //       not_in: [\"forbidden\", \"immutable\", \"c.a\"]\n  //   }];\n  // }\n  // ```\n  repeated string not_in = 3 [(predefined).cel = {\n    id: \"field_mask.not_in\"\n    expression: \"!this.paths.all(p, !(p in getField(rules, 'not_in') || getField(rules, 'not_in').exists(f, p.startsWith(f+'.')))) ? 'value must not contain any paths in %s'.format([getField(rules, 'not_in')]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyFieldMask {\n  //   google.protobuf.FieldMask value = 1 [\n  //     (buf.validate.field).field_mask.example = { paths: [\"a\", \"b\"] },\n  //     (buf.validate.field).field_mask.example = { paths: [\"c.a\", \"d\"] },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.FieldMask example = 4 [(predefined).cel = {\n    id: \"field_mask.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.\nmessage TimestampRules {\n  // `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must equal 2023-05-03T10:00:00Z\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];\n  // }\n  // ```\n  optional google.protobuf.Timestamp const = 2 [(predefined).cel = {\n    id: \"timestamp.const\"\n    expression: \"this != getField(rules, 'const') ? 'value must equal %s'.format([getField(rules, 'const')]) : ''\"\n  }];\n  oneof less_than {\n    // requires the duration field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyDuration {\n    //   // duration must be less than 'P3D' [duration.lt]\n    //   google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lt = 3 [(predefined).cel = {\n      id: \"timestamp.lt\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this >= rules.lt\"\n        \"? 'value must be less than %s'.format([rules.lt]) : ''\"\n    }];\n\n    // requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];\n    // }\n    // ```\n    google.protobuf.Timestamp lte = 4 [(predefined).cel = {\n      id: \"timestamp.lte\"\n      expression:\n        \"!has(rules.gte) && !has(rules.gt) && this > rules.lte\"\n        \"? 'value must be less than or equal to %s'.format([rules.lte]) : ''\"\n    }];\n\n    // `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //  // value must be less than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];\n    // }\n    // ```\n    bool lt_now = 7 [(predefined).cel = {\n      id: \"timestamp.lt_now\"\n      expression: \"(rules.lt_now && this > now) ? 'value must be less than now' : ''\"\n    }];\n  }\n  oneof greater_than {\n    // `gt` requires the timestamp field value to be greater than the specified\n    // value (exclusive). If the value of `gt` is larger than a specified `lt`\n    // or `lte`, the range is reversed, and the field value must be outside the\n    // specified range. If the field value doesn't meet the required conditions,\n    // an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gt = 5 [\n      (predefined).cel = {\n        id: \"timestamp.gt\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this <= rules.gt\"\n          \"? 'value must be greater than %s'.format([rules.gt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gt && (this >= rules.lt || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gt && (rules.lt <= this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than %s'.format([rules.gt, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gt && (this > rules.lte || this <= rules.gt)\"\n          \"? 'value must be greater than %s and less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gt_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gt && (rules.lte < this && this <= rules.gt)\"\n          \"? 'value must be greater than %s or less than or equal to %s'.format([rules.gt, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gte` requires the timestamp field value to be greater than or equal to the\n    // specified value (exclusive). If the value of `gte` is larger than a\n    // specified `lt` or `lte`, the range is reversed, and the field value\n    // must be outside the specified range. If the field value doesn't meet\n    // the required conditions, an error message is generated.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]\n    //   google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]\n    //   google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];\n    //\n    //   // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]\n    //   google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];\n    // }\n    // ```\n    google.protobuf.Timestamp gte = 6 [\n      (predefined).cel = {\n        id: \"timestamp.gte\"\n        expression:\n          \"!has(rules.lt) && !has(rules.lte) && this < rules.gte\"\n          \"? 'value must be greater than or equal to %s'.format([rules.gte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt\"\n        expression:\n          \"has(rules.lt) && rules.lt >= rules.gte && (this >= rules.lt || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lt_exclusive\"\n        expression:\n          \"has(rules.lt) && rules.lt < rules.gte && (rules.lt <= this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than %s'.format([rules.gte, rules.lt]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte\"\n        expression:\n          \"has(rules.lte) && rules.lte >= rules.gte && (this > rules.lte || this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s and less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      },\n      (predefined).cel = {\n        id: \"timestamp.gte_lte_exclusive\"\n        expression:\n          \"has(rules.lte) && rules.lte < rules.gte && (rules.lte < this && this < rules.gte)\"\n          \"? 'value must be greater than or equal to %s or less than or equal to %s'.format([rules.gte, rules.lte]) : ''\"\n      }\n    ];\n\n    // `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.\n    //\n    // ```proto\n    // message MyTimestamp {\n    //   // value must be greater than now\n    //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];\n    // }\n    // ```\n    bool gt_now = 8 [(predefined).cel = {\n      id: \"timestamp.gt_now\"\n      expression: \"(rules.gt_now && this < now) ? 'value must be greater than now' : ''\"\n    }];\n  }\n\n  // `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   // value must be within 1 hour of now\n  //   google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];\n  // }\n  // ```\n  optional google.protobuf.Duration within = 9 [(predefined).cel = {\n    id: \"timestamp.within\"\n    expression: \"this < now-rules.within || this > now+rules.within ? 'value must be within %s of now'.format([rules.within]) : ''\"\n  }];\n\n  // `example` specifies values that the field may have. These values SHOULD\n  // conform to other rules. `example` values will not impact validation\n  // but may be used as helpful guidance on how to populate the given field.\n  //\n  // ```proto\n  // message MyTimestamp {\n  //   google.protobuf.Timestamp value = 1 [\n  //     (buf.validate.field).timestamp.example = { seconds: 1672444800 },\n  //     (buf.validate.field).timestamp.example = { seconds: 1672531200 },\n  //   ];\n  // }\n  // ```\n  repeated google.protobuf.Timestamp example = 10 [(predefined).cel = {\n    id: \"timestamp.example\"\n    expression: \"true\"\n  }];\n\n  // Extension fields in this range that have the (buf.validate.predefined)\n  // option set will be treated as predefined field rules that can then be\n  // set on the field options of other fields to apply field rules.\n  // Extension numbers 1000 to 99999 are reserved for extension numbers that are\n  // defined in the [Protobuf Global Extension Registry][1]. Extension numbers\n  // above this range are reserved for extension numbers that are not explicitly\n  // assigned. For rules defined in publicly-consumed schemas, use of extensions\n  // above 99999 is discouraged due to the risk of conflicts.\n  //\n  // [1]: https://github.com/protocolbuffers/protobuf/blob/main/docs/options.md\n  extensions 1000 to max;\n}\n\n// `Violations` is a collection of `Violation` messages. This message type is returned by\n// Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules.\n// Each individual violation is represented by a `Violation` message.\nmessage Violations {\n  // `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.\n  repeated Violation violations = 1;\n}\n\n// `Violation` represents a single instance where a validation rule, expressed\n// as a `Rule`, was not met. It provides information about the field that\n// caused the violation, the specific rule that wasn't fulfilled, and a\n// human-readable error message.\n//\n// For example, consider the following message:\n//\n// ```proto\n// message User {\n//     int32 age = 1 [(buf.validate.field).cel = {\n//         id: \"user.age\",\n//         expression: \"this < 18 ? 'User must be at least 18 years old' : ''\",\n//     }];\n// }\n// ```\n//\n// It could produce the following violation:\n//\n// ```json\n// {\n//   \"ruleId\": \"user.age\",\n//   \"message\": \"User must be at least 18 years old\",\n//   \"field\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 1,\n//         \"fieldName\": \"age\",\n//         \"fieldType\": \"TYPE_INT32\"\n//       }\n//     ]\n//   },\n//   \"rule\": {\n//     \"elements\": [\n//       {\n//         \"fieldNumber\": 23,\n//         \"fieldName\": \"cel\",\n//         \"fieldType\": \"TYPE_MESSAGE\",\n//         \"index\": \"0\"\n//       }\n//     ]\n//   }\n// }\n// ```\nmessage Violation {\n  // `field` is a machine-readable path to the field that failed validation.\n  // This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  // }\n  // ```\n  //\n  // It could produce the following violation:\n  //\n  // ```textproto\n  // violation {\n  //   field { element { field_number: 1, field_name: \"a\", field_type: 8 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath field = 5;\n\n  // `rule` is a machine-readable path that points to the specific rule that failed validation.\n  // This will be a nested field starting from the FieldRules of the field that failed validation.\n  // For custom rules, this will provide the path of the rule, e.g. `cel[0]`.\n  //\n  // For example, consider the following message:\n  //\n  // ```proto\n  // message Message {\n  //   bool a = 1 [(buf.validate.field).required = true];\n  //   bool b = 2 [(buf.validate.field).cel = {\n  //     id: \"custom_rule\",\n  //     expression: \"!this ? 'b must be true': ''\"\n  //   }]\n  // }\n  // ```\n  //\n  // It could produce the following violations:\n  //\n  // ```textproto\n  // violation {\n  //   rule { element { field_number: 25, field_name: \"required\", field_type: 8 } }\n  //   ...\n  // }\n  // violation {\n  //   rule { element { field_number: 23, field_name: \"cel\", field_type: 11, index: 0 } }\n  //   ...\n  // }\n  // ```\n  optional FieldPath rule = 6;\n\n  // `rule_id` is the unique identifier of the `Rule` that was not fulfilled.\n  // This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.\n  optional string rule_id = 2;\n\n  // `message` is a human-readable error message that describes the nature of the violation.\n  // This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.\n  optional string message = 3;\n\n  // `for_key` indicates whether the violation was caused by a map key, rather than a value.\n  optional bool for_key = 4;\n\n  reserved 1;\n  reserved \"field_path\";\n}\n\n// `FieldPath` provides a path to a nested protobuf field.\n//\n// This message provides enough information to render a dotted field path even without protobuf descriptors.\n// It also provides enough information to resolve a nested field through unknown wire data.\nmessage FieldPath {\n  // `elements` contains each element of the path, starting from the root and recursing downward.\n  repeated FieldPathElement elements = 1;\n}\n\n// `FieldPathElement` provides enough information to nest through a single protobuf field.\n//\n// If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.\n// A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.\n// The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.\nmessage FieldPathElement {\n  // `field_number` is the field number this path element refers to.\n  optional int32 field_number = 1;\n\n  // `field_name` contains the field name this path element refers to.\n  // This can be used to display a human-readable path even if the field number is unknown.\n  optional string field_name = 2;\n\n  // `field_type` specifies the type of this field. When using reflection, this value is not needed.\n  //\n  // This value is provided to make it possible to traverse unknown fields through wire data.\n  // When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.\n  //\n  // [1]: https://protobuf.dev/programming-guides/encoding/#packed\n  // [2]: https://protobuf.dev/programming-guides/encoding/#groups\n  //\n  // N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and\n  // can be explicitly used in Protocol Buffers 2023 Edition.\n  optional google.protobuf.FieldDescriptorProto.Type field_type = 3;\n\n  // `key_type` specifies the map key type of this field. This value is useful when traversing\n  // unknown fields through wire data: specifically, it allows handling the differences between\n  // different integer encodings.\n  optional google.protobuf.FieldDescriptorProto.Type key_type = 4;\n\n  // `value_type` specifies map value type of this field. This is useful if you want to display a\n  // value inside unknown fields through wire data.\n  optional google.protobuf.FieldDescriptorProto.Type value_type = 5;\n\n  // `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field.\n  oneof subscript {\n    // `index` specifies a 0-based index into a repeated field.\n    uint64 index = 6;\n\n    // `bool_key` specifies a map key of type bool.\n    bool bool_key = 7;\n\n    // `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.\n    int64 int_key = 8;\n\n    // `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.\n    uint64 uint_key = 9;\n\n    // `string_key` specifies a map key of type string.\n    string string_key = 10;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_no_streaming/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc NoStreaming(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc RequestStreaming(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc ResponseStreaming(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n  rpc BothStreaming(stream google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_no_streaming/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_NO_CLIENT_STREAMING\n    - RPC_NO_SERVER_STREAMING\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_pascal_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc Success(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc SuccessTwo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc SuccessFOOThree(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc fail(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc failTwo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc fail_three(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Fail_four(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_pascal_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage One {}\nmessage Two {}\nmessage Three {}\nmessage Four {}\nmessage Five {}\nmessage Six {}\nmessage Seven {}\nmessage Eight {}\nmessage Nine {}\nmessage Ten {}\nmessage Eleven {}\nmessage Twelve {}\n\nservice Foo {\n  rpc On1(One) returns (Two) {}\n  rpc Tw2(Three) returns (Three) {}\n  rpc Thre3(Four) returns (One) {}\n  rpc Fou4(Five) returns (Six) {}\n  rpc Fiv5(Three) returns (Seven) {}\n  rpc Si6(Eight) returns (Nine) {}\n  rpc Seve7(google.protobuf.Empty) returns (Ten) {}\n  rpc Eigh8(Eleven) returns (google.protobuf.Empty) {}\n  rpc Nin9(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Te1(Twelve) returns (Twelve) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"a.proto\";\n\nservice Foo {\n  rpc Baz(a.Six) returns (a.Five) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_RESPONSE_UNIQUE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_requests/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage One {}\nmessage Two {}\nmessage Three {}\nmessage Four {}\nmessage Five {}\nmessage Six {}\nmessage Seven {}\nmessage Eight {}\nmessage Nine {}\nmessage Ten {}\nmessage Eleven {}\nmessage Twelve {}\n\nservice Foo {\n  rpc On1(One) returns (Two) {}\n  rpc Tw2(Three) returns (Three) {}\n  rpc Thre3(Four) returns (One) {}\n  rpc Fou4(Five) returns (Six) {}\n  rpc Fiv5(Three) returns (Seven) {}\n  rpc Si6(Eight) returns (Nine) {}\n  rpc Seve7(google.protobuf.Empty) returns (Ten) {}\n  rpc Eigh8(Eleven) returns (google.protobuf.Empty) {}\n  rpc Nin9(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Te1(Twelve) returns (Twelve) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_requests/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"a.proto\";\n\nservice Foo {\n  rpc Baz(a.Six) returns (a.Five) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_requests/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_RESPONSE_UNIQUE\n  rpc_allow_google_protobuf_empty_requests: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_requests_and_responses/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage One {}\nmessage Two {}\nmessage Three {}\nmessage Four {}\nmessage Five {}\nmessage Six {}\nmessage Seven {}\nmessage Eight {}\nmessage Nine {}\nmessage Ten {}\nmessage Eleven {}\nmessage Twelve {}\n\nservice Foo {\n  rpc On1(One) returns (Two) {}\n  rpc Tw2(Three) returns (Three) {}\n  rpc Thre3(Four) returns (One) {}\n  rpc Fou4(Five) returns (Six) {}\n  rpc Fiv5(Three) returns (Seven) {}\n  rpc Si6(Eight) returns (Nine) {}\n  rpc Seve7(google.protobuf.Empty) returns (Ten) {}\n  rpc Eigh8(Eleven) returns (google.protobuf.Empty) {}\n  rpc Nin9(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Te1(Twelve) returns (Twelve) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_requests_and_responses/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"a.proto\";\n\nservice Foo {\n  rpc Baz(a.Six) returns (a.Five) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_requests_and_responses/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_RESPONSE_UNIQUE\n  rpc_allow_google_protobuf_empty_requests: true\n  rpc_allow_google_protobuf_empty_responses: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_responses/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage One {}\nmessage Two {}\nmessage Three {}\nmessage Four {}\nmessage Five {}\nmessage Six {}\nmessage Seven {}\nmessage Eight {}\nmessage Nine {}\nmessage Ten {}\nmessage Eleven {}\nmessage Twelve {}\n\nservice Foo {\n  rpc On1(One) returns (Two) {}\n  rpc Tw2(Three) returns (Three) {}\n  rpc Thre3(Four) returns (One) {}\n  rpc Fou4(Five) returns (Six) {}\n  rpc Fiv5(Three) returns (Seven) {}\n  rpc Si6(Eight) returns (Nine) {}\n  rpc Seve7(google.protobuf.Empty) returns (Ten) {}\n  rpc Eigh8(Eleven) returns (google.protobuf.Empty) {}\n  rpc Nin9(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Te1(Twelve) returns (Twelve) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_responses/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"a.proto\";\n\nservice Foo {\n  rpc Baz(a.Six) returns (a.Five) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_empty_responses/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_RESPONSE_UNIQUE\n  rpc_allow_google_protobuf_empty_responses: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_same/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage One {}\nmessage Two {}\nmessage Three {}\nmessage Four {}\nmessage Five {}\nmessage Six {}\nmessage Seven {}\nmessage Eight {}\nmessage Nine {}\nmessage Ten {}\nmessage Eleven {}\nmessage Twelve {}\n\nservice Foo {\n  rpc On1(One) returns (Two) {}\n  rpc Tw2(Three) returns (Three) {}\n  rpc Thre3(Four) returns (One) {}\n  rpc Fou4(Five) returns (Six) {}\n  rpc Fiv5(Three) returns (Seven) {}\n  rpc Si6(Eight) returns (Nine) {}\n  rpc Seve7(google.protobuf.Empty) returns (Ten) {}\n  rpc Eigh8(Eleven) returns (google.protobuf.Empty) {}\n  rpc Nin9(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Te1(Twelve) returns (Twelve) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_same/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"a.proto\";\n\nservice Foo {\n  rpc Baz(a.Six) returns (a.Five) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_same/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_RESPONSE_UNIQUE\n  rpc_allow_same_request_response: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_same_and_empty_request_responses/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nmessage One {}\nmessage Two {}\nmessage Three {}\nmessage Four {}\nmessage Five {}\nmessage Six {}\nmessage Seven {}\nmessage Eight {}\nmessage Nine {}\nmessage Ten {}\nmessage Eleven {}\nmessage Twelve {}\n\nservice Foo {\n  rpc On1(One) returns (Two) {}\n  rpc Tw2(Three) returns (Three) {}\n  rpc Thre3(Four) returns (One) {}\n  rpc Fou4(Five) returns (Six) {}\n  rpc Fiv5(Three) returns (Seven) {}\n  rpc Si6(Eight) returns (Nine) {}\n  rpc Seve7(google.protobuf.Empty) returns (Ten) {}\n  rpc Eigh8(Eleven) returns (google.protobuf.Empty) {}\n  rpc Nin9(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Te1(Twelve) returns (Twelve) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_same_and_empty_request_responses/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"a.proto\";\n\nservice Foo {\n  rpc Baz(a.Six) returns (a.Five) {}\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_request_response_unique_allow_same_and_empty_request_responses/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_RESPONSE_UNIQUE\n  rpc_allow_same_request_response: true\n  rpc_allow_google_protobuf_empty_requests: true\n  rpc_allow_google_protobuf_empty_responses: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_standard_name/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc Success(SuccessRequest) returns (SuccessResponse) {}\n  rpc AnotherSuccess(FooAnotherSuccessRequest) returns (FooAnotherSuccessResponse) {}\n  rpc FailRequest(Bar) returns (FailRequestResponse) {}\n  rpc FailResponse(FailResponseRequest) returns (Bar) {}\n  rpc NoAllowEmptyRequest(google.protobuf.Empty) returns (NoAllowEmptyRequestResponse) {}\n  rpc NoAllowEmptyResponse(NoAllowEmptyResponseRequest) returns (google.protobuf.Empty) {}\n}\n\nmessage SuccessRequest {}\nmessage SuccessResponse {}\nmessage FooAnotherSuccessRequest {}\nmessage FooAnotherSuccessResponse {}\nmessage FailRequestResponse {}\nmessage FailResponseRequest {}\nmessage NoAllowEmptyRequestResponse {}\nmessage NoAllowEmptyResponseRequest {}\nmessage Bar {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_standard_name/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_standard_name_allow_empty/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc Success(SuccessRequest) returns (SuccessResponse) {}\n  rpc AnotherSuccess(FooAnotherSuccessRequest) returns (FooAnotherSuccessResponse) {}\n  rpc FailRequest(Bar) returns (FailRequestResponse) {}\n  rpc FailResponse(FailResponseRequest) returns (Bar) {}\n  rpc AllowEmptyRequest(google.protobuf.Empty) returns (AllowEmptyRequestResponse) {}\n  rpc AllowEmptyResponse(AllowEmptyResponseRequest) returns (google.protobuf.Empty) {}\n}\n\nmessage SuccessRequest {}\nmessage SuccessResponse {}\nmessage FooAnotherSuccessRequest {}\nmessage FooAnotherSuccessResponse {}\nmessage FailRequestResponse {}\nmessage FailResponseRequest {}\nmessage AllowEmptyRequestResponse {}\nmessage AllowEmptyResponseRequest {}\nmessage Bar {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/rpc_standard_name_allow_empty/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n  rpc_allow_google_protobuf_empty_requests: true\n  rpc_allow_google_protobuf_empty_responses: true\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/service_pascal_case/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice Success {}\nservice SuccessTwo {}\nservice SuccessFOOThree {}\nservice fail {}\nservice failTwo {}\nservice fail_three {}\nservice Fail_four {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/service_pascal_case/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - SERVICE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/service_suffix/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice SuccessService {}\nservice SuccessTwoService {}\nservice SuccessThree_Service {}\nservice Fail {}\nservice FailAPI {}\nservice FailService_ {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/service_suffix/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - SERVICE_SUFFIX\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/service_suffix_custom/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nservice SuccessAPI {}\nservice SuccessTwoAPI {}\nservice SuccessThree_API {}\nservice Fail {}\nservice FailService {}\nservice FailAPI_ {}\nservice FailApi_ {}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/service_suffix_custom/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - SERVICE_SUFFIX\n  service_suffix: API\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/syntax_specified/a/a.proto",
    "content": "// comment\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/syntax_specified/a/a2.proto",
    "content": "// comment\n\nsyntax = \"proto2\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/syntax_specified/a/a3.proto",
    "content": "// comment\n\nsyntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/syntax_specified/buf.yaml",
    "content": "version: v1\nlint:\n  use:\n    - SYNTAX_SPECIFIED\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/buf.yaml",
    "content": "version: v2\nmodules:\n  - path: ignores1\n    lint:\n      use:\n        - ENUM_PASCAL_CASE\n        - FIELD_LOWER_SNAKE_CASE\n        - MESSAGE_PASCAL_CASE\n  - path: ignores2\n    lint:\n      use:\n        - ENUM_PASCAL_CASE\n        - FIELD_LOWER_SNAKE_CASE\n        - MESSAGE_PASCAL_CASE\n      ignore:\n        - ignores2/bar2/bar2.proto\n        - ignores2/foo2\n  - path: ignores3\n    lint:\n      use:\n        - ENUM_PASCAL_CASE\n        - FIELD_LOWER_SNAKE_CASE\n        - MESSAGE_PASCAL_CASE\n      ignore_only:\n        BASIC:\n          - ignores3/foo3/bar\n        ENUM_PASCAL_CASE:\n          - ignores3/bar3/bar.proto\n          - ignores3/foo3/bar\n        MESSAGE_PASCAL_CASE:\n          - ignores3/bar3/bar.proto\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores1/bar1/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar1;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores1/bar1/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar1;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores1/buf1.proto",
    "content": "syntax = \"proto3\";\n\npackage buf1;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores1/foo1/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar1;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores1/foo1/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores1/foo1/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo1;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores2/bar2/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar2;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores2/bar2/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar2;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores2/buf2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf2;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores2/foo2/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar2;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores2/foo2/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz2;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores2/foo2/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo2;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores3/bar3/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar3;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores3/bar3/bar2.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.bar3;\n\nmessage Foo2 {\n  int64 oneTwo = 1;\n}\n\nmessage bar2 {\n  int64 three = 3;\n}\n\nenum baz2 {\n  BAZ2_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores3/buf3.proto",
    "content": "syntax = \"proto3\";\n\npackage buf3;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores3/foo3/bar/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.bar3;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores3/foo3/baz/baz.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo.baz3;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage bar {\n  int64 three = 3;\n}\n\nenum baz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/lint/v2/ignores/ignores3/foo3/buf.proto",
    "content": "syntax = \"proto3\";\n\npackage buf.foo3;\n\nmessage Foo {\n  int64 oneTwo = 1;\n}\n\nmessage biz {\n  int64 three = 3;\n}\n\nenum buz {\n  BAZ_UNSPECIFIED = 0;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/testdata/multi_client/simple/simple.proto",
    "content": "syntax = \"proto3\";\n\npackage simple;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Foo {\n  google.protobuf.Timestamp valid_time = 1;\n  int32 lower_snake_case = 2;\n  google.protobuf.Timestamp invalid_timestamp = 3;\n  int32 PascalCase = 4;\n}\n"
  },
  {
    "path": "private/bufpkg/bufcheck/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcheck\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufcheck/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcheck\n\nimport (\n\tdescriptorv1 \"buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go/buf/plugin/descriptor/v1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n)\n\nfunc imageToProtoFileDescriptors(image bufimage.Image) []*descriptorv1.FileDescriptor {\n\tif image == nil {\n\t\treturn nil\n\t}\n\treturn xslices.Map(image.Files(), imageToProtoFileDescriptor)\n}\n\nfunc imageToProtoFileDescriptor(imageFile bufimage.ImageFile) *descriptorv1.FileDescriptor {\n\treturn &descriptorv1.FileDescriptor{\n\t\tFileDescriptorProto: imageFile.FileDescriptorProto(),\n\t\tIsImport:            imageFile.IsImport(),\n\t\tIsSyntaxUnspecified: imageFile.IsSyntaxUnspecified(),\n\t\tUnusedDependency:    imageFile.UnusedDependencyIndexes(),\n\t}\n}\n\n// imageToPathToExternalPath returns a map from path to external path for all ImageFiles in the Image.\n//\n// We do not transmit external path information over the wire to plugins, so we need to keep track\n// of this on the client side to properly construct bufanalysis.FileAnnotations when we get back\n// check.Annotations. This is used in annotationToFileAnnotation.\nfunc imageToPathToExternalPath(image bufimage.Image) map[string]string {\n\timageFiles := image.Files()\n\tpathToExternalPath := make(map[string]string, len(imageFiles))\n\tfor _, imageFile := range imageFiles {\n\t\t// We know that Images do not have overlapping paths.\n\t\tpathToExternalPath[imageFile.Path()] = imageFile.ExternalPath()\n\t}\n\treturn pathToExternalPath\n}\n"
  },
  {
    "path": "private/bufpkg/bufcobra/bufcobra.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcobra\n\nimport (\n\t\"regexp\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\twebpagesConfigFlagName = \"config\"\n\n\tindexFileName         = \"index.md\"\n\tmarkdownFileExtension = \".md\"\n)\n\nvar codeBlockRegex = regexp.MustCompile(`(^\\s\\s\\s\\s)|(^\\t)`)\n\n// NewWebpagesCommand returns a new [cobra.Command] that will generate markdown documentation\n// for the given [cobra.Command].\nfunc NewWebpagesCommand(name string, cobraCommand *cobra.Command) *cobra.Command {\n\twebpagesCommand := &cobra.Command{\n\t\tUse:    name,\n\t\tHidden: true,\n\t\tShort:  \"Generate markdown files for CLI reference documentation.\",\n\t\tArgs:   cobra.NoArgs,\n\t\tRunE: func(command *cobra.Command, _ []string) error {\n\t\t\treturn run(command.Flags(), cobraCommand)\n\t\t},\n\t}\n\twebpagesCommand.Flags().String(\n\t\twebpagesConfigFlagName,\n\t\t\"\",\n\t\t\"Path to config file to use\",\n\t)\n\treturn webpagesCommand\n}\n\nfunc run(\n\tflags *pflag.FlagSet,\n\tcobraCommand *cobra.Command,\n) error {\n\tconfigPath, err := flags.GetString(webpagesConfigFlagName)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// TODO: rework this to be flags, no more config files\n\tconfig, err := readConfigFromFile(configPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\texcludes := xslices.ToStructMap(config.ExcludeCommands)\n\tfor _, command := range cobraCommand.Commands() {\n\t\tif _, ok := excludes[command.CommandPath()]; ok {\n\t\t\tcommand.Hidden = true\n\t\t}\n\t}\n\treturn generateMarkdownTree(\n\t\tcobraCommand,\n\t\tconfig,\n\t\tconfig.OutputDir,\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufcobra/config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcobra\n\nimport (\n\t\"io\"\n\t\"os\"\n\n\t\"gopkg.in/yaml.v3\"\n)\n\n// TODO: convert to flags, the only tricky one is command weigh configs\n// config represents the config file for the webpages command.\n// For example:\n//\n//\texclude_commands:\n//\t\t- buf completion\n//\t\t- buf ls-files\n//\tweight_commands:\n//\tbuf beta: 1\n//\tslug_prefix: /reference/cli/\n//\toutput_dir: output/docs\ntype config struct {\n\t// ExcludeCommands will filter out these command paths from generation.\n\tExcludeCommands []string `yaml:\"exclude_commands,omitempty\"`\n\t// WeightCommands will weight the command paths and show higher weighted commands later on the sidebar.\n\tWeightCommands map[string]int `yaml:\"weight_commands,omitempty\"`\n\tSlugPrefix     string         `yaml:\"slug_prefix,omitempty\"`\n\tOutputDir      string         `yaml:\"output_dir,omitempty\"`\n\t// SidebarPathThreshold will dictate if the sidebar label is the full path or just the name.\n\t// if the command path is longer than this then the `cobra.Command.Name()` is used,\n\t// otherwise `cobra.Command.CommandPath() is used.\n\tSidebarPathThreshold int `yaml:\"sidebar_path_threshold,omitempty\"`\n}\n\nfunc readConfigFromFile(path string) (*config, error) {\n\tvar webpagesConfig config\n\tif path == \"\" {\n\t\treturn &webpagesConfig, nil\n\t}\n\tfile, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdata, err := io.ReadAll(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := yaml.Unmarshal(data, &webpagesConfig); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &webpagesConfig, err\n}\n"
  },
  {
    "path": "private/bufpkg/bufcobra/markdown.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufcobra\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"html\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/spf13/pflag\"\n)\n\n// generateMarkdownTree generates markdown for a whole command tree\nfunc generateMarkdownTree(\n\tcommand *cobra.Command,\n\tconfig *config,\n\tparentDirPath string,\n) error {\n\tif !command.IsAvailableCommand() {\n\t\treturn nil\n\t}\n\tdirPath := parentDirPath\n\tfileName := command.Name() + markdownFileExtension\n\tif command.HasSubCommands() {\n\t\t// For commands with subcommands, we create a directory for the command, and create a\n\t\t// markdown index file for the command.\n\t\tdirPath = filepath.Join(parentDirPath, command.Name())\n\t\tif err := os.MkdirAll(dirPath, os.ModePerm); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfileName = indexFileName\n\t}\n\tfilePath := filepath.Join(dirPath, fileName)\n\tfile, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer file.Close()\n\tif err := generateMarkdownPage(command, config, file); err != nil {\n\t\treturn err\n\t}\n\tif command.HasSubCommands() {\n\t\tcommands := command.Commands()\n\t\torderCommands(config.WeightCommands, commands)\n\t\tfor _, command := range commands {\n\t\t\tif err := generateMarkdownTree(command, config, dirPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// generateMarkdownPage creates custom markdown output.\nfunc generateMarkdownPage(\n\tcommand *cobra.Command,\n\tconfig *config,\n\twriter io.Writer,\n) error {\n\tvar err error\n\tp := func(format string, a ...any) {\n\t\t_, err = fmt.Fprintf(writer, format, a...)\n\t}\n\tp(\"---\\n\")\n\tp(\"title: %s\\n\", command.CommandPath())\n\tp(\"---\\n\")\n\tp(\"# %s\\n\", command.CommandPath())\n\tcommand.InitDefaultHelpCmd()\n\tcommand.InitDefaultHelpFlag()\n\tif command.Version != \"\" {\n\t\tp(\"version `%s`\\n\\n\", command.Version)\n\t}\n\tp(\"%s\\n\\n\", html.EscapeString(command.Short))\n\tif command.Runnable() {\n\t\tp(\"### Usage\\n\")\n\t\tp(\"```console\\n$ %s\\n```\\n\\n\", command.UseLine())\n\t}\n\tif len(command.Long) > 0 {\n\t\tp(\"### Description\\n\\n\")\n\t\tp(\"%s \\n\\n\", processDescription(command.Long))\n\t}\n\tif len(command.Example) > 0 {\n\t\tp(\"### Examples\\n\\n\")\n\t\tp(\"```console\\n%s\\n```\\n\\n\", processDescription(command.Example))\n\t}\n\tcommandFlags := command.NonInheritedFlags()\n\tif commandFlags.HasAvailableFlags() {\n\t\tp(\"### Flags {#flags}\\n\\n\")\n\t\tif err := writeFlags(commandFlags, writer); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tinheritedFlags := command.InheritedFlags()\n\tif inheritedFlags.HasAvailableFlags() {\n\t\tp(\"### Flags inherited from parent commands {#persistent-flags}\\n\")\n\t\tif err := writeFlags(inheritedFlags, writer); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif hasSubCommands(command) {\n\t\tp(\"### Subcommands\\n\\n\")\n\t\tchildren := command.Commands()\n\t\torderCommands(config.WeightCommands, children)\n\t\tfor _, child := range children {\n\t\t\tif !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tchildRelPath := child.Name() + markdownFileExtension\n\t\t\tif child.HasSubCommands() {\n\t\t\t\tchildRelPath = filepath.Join(child.Name(), indexFileName)\n\t\t\t}\n\t\t\tp(\"* [%s](./%s)\\t - %s\\n\", child.CommandPath(), childRelPath, html.EscapeString(child.Short))\n\t\t}\n\t\tp(\"\\n\")\n\t}\n\tif command.HasParent() {\n\t\tp(\"### Parent Command\\n\\n\")\n\t\tparent := command.Parent()\n\t\tparentName := parent.CommandPath()\n\t\tif hasSubCommands(command) {\n\t\t\t// If the current command has sub-commands, the parent command is the index file in\n\t\t\t// the parent directory.\n\t\t\tp(\"* [%s](../%s)\\t - %s\\n\", parentName, indexFileName, html.EscapeString(parent.Short))\n\t\t} else {\n\t\t\t// If the current command is a leaf command, the parent command is the index file in\n\t\t\t// the current directory.\n\t\t\tp(\"* [%s](./%s)\\t - %s\\n\", parentName, indexFileName, html.EscapeString(parent.Short))\n\t\t}\n\t\tcommand.VisitParents(func(c *cobra.Command) {\n\t\t\tif c.DisableAutoGenTag {\n\t\t\t\tcommand.DisableAutoGenTag = c.DisableAutoGenTag\n\t\t\t}\n\t\t})\n\t}\n\treturn err\n}\n\n// hasSubCommands checks for whether a command has available sub-commands, not including help.\nfunc hasSubCommands(cmd *cobra.Command) bool {\n\tfor _, command := range cmd.Commands() {\n\t\tif !command.IsAvailableCommand() || command.IsAdditionalHelpTopicCommand() {\n\t\t\tcontinue\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\n// processDescription is used to process description and example text. It does the following:\n//\n// - Converts all code blocks to console code blocks  (```console)\n// - Unindents code blocks\n// - Writes out the text, escaping all HTML characters.\n//\n// This is done because Pygments (which mkdocs-material uses for syntax highlighting)\n// specifies `console` as the language for bash sessions in code blocks.\nfunc processDescription(description string) string {\n\tout := &bytes.Buffer{}\n\tread := bufio.NewReader(strings.NewReader(description))\n\tvar inCodeBlock bool\n\tfor {\n\t\tline, _, err := read.ReadLine()\n\t\tif err == io.EOF {\n\t\t\tbreak\n\t\t}\n\t\ttext := string(line)\n\t\t// convert indented code blocks into terminal code blocks so the\n\t\t// $ isn't copied when using the copy button\n\t\tif codeBlockRegex.MatchString(text) {\n\t\t\tif !inCodeBlock {\n\t\t\t\tout.WriteString(\"```console\\n\")\n\t\t\t\tinCodeBlock = true\n\t\t\t}\n\t\t\t// remove the indentation level from the indented code block\n\t\t\ttext = codeBlockRegex.ReplaceAllString(text, \"\")\n\t\t\tout.WriteString(text)\n\t\t\tout.WriteString(\"\\n\")\n\t\t\tcontinue\n\t\t}\n\t\t// indented code blocks can have blank lines in them so\n\t\t// if the next line is a whitespace then we don't want to\n\t\t// terminate the code block\n\t\tif inCodeBlock && text == \"\" {\n\t\t\tif b, err := read.Peek(1); err == nil && unicode.IsSpace(rune(b[0])) {\n\t\t\t\tout.WriteString(text)\n\t\t\t\tout.WriteString(\"\\n\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\t// terminate the fenced code block with ```\n\t\tif inCodeBlock {\n\t\t\tout.WriteString(\"```\\n\")\n\t\t\tinCodeBlock = false\n\t\t}\n\t\tout.WriteString(html.EscapeString(text))\n\t\tout.WriteString(\"\\n\")\n\t}\n\tif inCodeBlock {\n\t\tout.WriteString(\"```\\n\")\n\t}\n\treturn out.String()\n}\n\nfunc orderCommands(weights map[string]int, commands []*cobra.Command) {\n\tsort.SliceStable(commands, func(i, j int) bool {\n\t\treturn weights[commands[i].CommandPath()] < weights[commands[j].CommandPath()]\n\t})\n}\n\nfunc writeFlags(f *pflag.FlagSet, writer io.Writer) error {\n\tvar err error\n\tp := func(format string, a ...any) {\n\t\t_, err = fmt.Fprintf(writer, format, a...)\n\t}\n\tf.VisitAll(func(flag *pflag.Flag) {\n\t\tif flag.Hidden {\n\t\t\treturn\n\t\t}\n\t\tif flag.Shorthand != \"\" && flag.ShorthandDeprecated == \"\" {\n\t\t\tp(\"#### -%s, --%s\", flag.Shorthand, flag.Name)\n\t\t} else {\n\t\t\tp(\"#### --%s\", flag.Name)\n\t\t}\n\t\tvarname, usage := pflag.UnquoteUsage(flag)\n\t\tif varname != \"\" {\n\t\t\tp(\" *%s*\", html.EscapeString(varname))\n\t\t}\n\t\tp(\" {#%s}\", flag.Name)\n\t\tp(\"\\n\")\n\t\tp(\"%s\", html.EscapeString(usage))\n\t\tif flag.NoOptDefVal != \"\" {\n\t\t\tswitch flag.Value.Type() {\n\t\t\tcase \"string\":\n\t\t\t\tp(\"[=\\\"%s\\\"]\", flag.NoOptDefVal)\n\t\t\tcase \"bool\":\n\t\t\t\tif flag.NoOptDefVal != \"true\" {\n\t\t\t\t\tp(\"[=%s]\", flag.NoOptDefVal)\n\t\t\t\t}\n\t\t\tcase \"count\":\n\t\t\t\tif flag.NoOptDefVal != \"+1\" {\n\t\t\t\t\tp(\"[=%s]\", flag.NoOptDefVal)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tp(\"[=%s]\", flag.NoOptDefVal)\n\t\t\t}\n\t\t}\n\t\tif len(flag.Deprecated) != 0 {\n\t\t\tp(\" (DEPRECATED: %s)\", flag.Deprecated)\n\t\t}\n\t\tp(\"\\n\\n\")\n\t})\n\treturn err\n}\n"
  },
  {
    "path": "private/bufpkg/bufcobra/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufcobra\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufconfig/breaking_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nvar (\n\t// DefaultBreakingConfigV1 is the default breaking config for v1.\n\tDefaultBreakingConfigV1 BreakingConfig = NewBreakingConfig(\n\t\tdefaultCheckConfigV1,\n\t\tfalse,\n\t)\n\n\t// DefaultBreakingConfigV2 is the default breaking config for v1.\n\tDefaultBreakingConfigV2 BreakingConfig = NewBreakingConfig(\n\t\tdefaultCheckConfigV2,\n\t\tfalse,\n\t)\n)\n\n// BreakingConfig is breaking configuration for a specific Module.\ntype BreakingConfig interface {\n\tCheckConfig\n\n\tIgnoreUnstablePackages() bool\n\n\tisBreakingConfig()\n}\n\n// NewBreakingConfig returns a new BreakingConfig.\nfunc NewBreakingConfig(\n\tcheckConfig CheckConfig,\n\tignoreUnstablePackages bool,\n) BreakingConfig {\n\treturn newBreakingConfig(\n\t\tcheckConfig,\n\t\tignoreUnstablePackages,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype breakingConfig struct {\n\tCheckConfig\n\n\tignoreUnstablePackages bool\n}\n\nfunc newBreakingConfig(\n\tcheckConfig CheckConfig,\n\tignoreUnstablePackages bool,\n) *breakingConfig {\n\treturn &breakingConfig{\n\t\tCheckConfig:            checkConfig,\n\t\tignoreUnstablePackages: ignoreUnstablePackages,\n\t}\n}\n\nfunc (b *breakingConfig) IgnoreUnstablePackages() bool {\n\treturn b.ignoreUnstablePackages\n}\n\nfunc (*breakingConfig) isBreakingConfig() {}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_gen_yaml_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"io\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\tdefaultBufGenYAMLFileName    = \"buf.gen.yaml\"\n\tdefaultBufGenYAMLFileVersion = FileVersionV1Beta1\n)\n\nvar (\n\t// ordered\n\tbufGenYAMLFileNames                       = []string{defaultBufGenYAMLFileName}\n\tbufGenYAMLFileNameToSupportedFileVersions = map[string]map[FileVersion]struct{}{\n\t\tdefaultBufGenYAMLFileName: {\n\t\t\tFileVersionV1Beta1: struct{}{},\n\t\t\tFileVersionV1:      struct{}{},\n\t\t\tFileVersionV2:      struct{}{},\n\t\t},\n\t}\n)\n\n// BufGenYAMLFile represents a buf.gen.yaml file.\n//\n// For v2, generation configuration has been merged into BufYAMLFiles.\ntype BufGenYAMLFile interface {\n\tFile\n\n\t// GenerateConfig returns the generate config.\n\tGenerateConfig() GenerateConfig\n\t// InputConfigs returns the input configs, which can be empty.\n\tInputConfigs() []InputConfig\n\n\tisBufGenYAMLFile()\n}\n\n// NewBufGenYAMLFile returns a new BufGenYAMLFile. It is validated given each\n// parameter is validated.\nfunc NewBufGenYAMLFile(\n\tfileVersion FileVersion,\n\tgenerateConfig GenerateConfig,\n\tinputConfigs []InputConfig,\n) BufGenYAMLFile {\n\treturn newBufGenYAMLFile(\n\t\tfileVersion,\n\t\tnil,\n\t\tgenerateConfig,\n\t\tinputConfigs,\n\t)\n}\n\n// GetBufGenYAMLFileForPrefix gets the buf.gen.yaml file at the given bucket prefix.\n//\n// The buf.gen.yaml file will be attempted to be read at prefix/buf.gen.yaml.\nfunc GetBufGenYAMLFileForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (BufGenYAMLFile, error) {\n\treturn getFileForPrefix(ctx, bucket, prefix, bufGenYAMLFileNames, bufGenYAMLFileNameToSupportedFileVersions, readBufGenYAMLFile)\n}\n\n// GetBufGenYAMLFileVersionForPrefix gets the buf.gen.yaml file version at the given bucket prefix.\n//\n// The buf.gen.yaml file will be attempted to be read at prefix/buf.gen.yaml.\nfunc GetBufGenYAMLFileVersionForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (FileVersion, error) {\n\treturn getFileVersionForPrefix(ctx, bucket, prefix, bufGenYAMLFileNames, bufGenYAMLFileNameToSupportedFileVersions, true, FileVersionV2, defaultBufGenYAMLFileVersion)\n}\n\n// PutBufGenYAMLFileForPrefix puts the buf.gen.yaml file at the given bucket prefix.\n//\n// The buf.gen.yaml file will be attempted to be written to prefix/buf.gen.yaml.\n// The buf.gen.yaml file will be written atomically.\nfunc PutBufGenYAMLFileForPrefix(\n\tctx context.Context,\n\tbucket storage.WriteBucket,\n\tprefix string,\n\tbufYAMLFile BufGenYAMLFile,\n) error {\n\treturn putFileForPrefix(ctx, bucket, prefix, bufYAMLFile, defaultBufGenYAMLFileName, bufGenYAMLFileNameToSupportedFileVersions, writeBufGenYAMLFile)\n}\n\n// ReadBufGenYAMLFile reads the BufGenYAMLFile from the io.Reader.\nfunc ReadBufGenYAMLFile(reader io.Reader) (BufGenYAMLFile, error) {\n\treturn readFile(reader, \"\", readBufGenYAMLFile)\n}\n\n// WriteBufGenYAMLFile writes the BufGenYAMLFile to the io.Writer.\nfunc WriteBufGenYAMLFile(writer io.Writer, bufGenYAMLFile BufGenYAMLFile) error {\n\treturn writeFile(writer, bufGenYAMLFile, writeBufGenYAMLFile)\n}\n\n// *** PRIVATE ***\n\ntype bufGenYAMLFile struct {\n\tgenerateConfig GenerateConfig\n\tinputConfigs   []InputConfig\n\n\tfileVersion FileVersion\n\tobjectData  ObjectData\n}\n\nfunc newBufGenYAMLFile(\n\tfileVersion FileVersion,\n\tobjectData ObjectData,\n\tgenerateConfig GenerateConfig,\n\tinputConfigs []InputConfig,\n) *bufGenYAMLFile {\n\treturn &bufGenYAMLFile{\n\t\tfileVersion:    fileVersion,\n\t\tobjectData:     objectData,\n\t\tgenerateConfig: generateConfig,\n\t\tinputConfigs:   inputConfigs,\n\t}\n}\n\nfunc (g *bufGenYAMLFile) FileVersion() FileVersion {\n\treturn g.fileVersion\n}\n\nfunc (*bufGenYAMLFile) FileType() FileType {\n\treturn FileTypeBufGenYAML\n}\n\nfunc (g *bufGenYAMLFile) ObjectData() ObjectData {\n\treturn g.objectData\n}\n\nfunc (g *bufGenYAMLFile) GenerateConfig() GenerateConfig {\n\treturn g.generateConfig\n}\n\nfunc (g *bufGenYAMLFile) InputConfigs() []InputConfig {\n\treturn g.inputConfigs\n}\n\nfunc (*bufGenYAMLFile) isBufGenYAMLFile() {}\nfunc (*bufGenYAMLFile) isFile()           {}\nfunc (*bufGenYAMLFile) isFileInfo()       {}\n\nfunc readBufGenYAMLFile(\n\tdata []byte,\n\tobjectData ObjectData,\n\tallowJSON bool,\n) (BufGenYAMLFile, error) {\n\t// We have always enforced that buf.gen.yamls have file versions.\n\tfileVersion, err := getFileVersionForData(data, allowJSON, true, bufGenYAMLFileNameToSupportedFileVersions, FileVersionV2, defaultBufGenYAMLFileVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch fileVersion {\n\tcase FileVersionV1Beta1:\n\t\tvar externalGenYAMLFile externalBufGenYAMLFileV1Beta1\n\t\tif err := getUnmarshalStrict(allowJSON)(data, &externalGenYAMLFile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tgenerateConfig, err := newGenerateConfigFromExternalFileV1Beta1(externalGenYAMLFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newBufGenYAMLFile(\n\t\t\tfileVersion,\n\t\t\tobjectData,\n\t\t\tgenerateConfig,\n\t\t\tnil,\n\t\t), nil\n\tcase FileVersionV1:\n\t\tvar externalGenYAMLFile externalBufGenYAMLFileV1\n\t\tif err := getUnmarshalStrict(allowJSON)(data, &externalGenYAMLFile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tgenerateConfig, err := newGenerateConfigFromExternalFileV1(externalGenYAMLFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newBufGenYAMLFile(\n\t\t\tfileVersion,\n\t\t\tobjectData,\n\t\t\tgenerateConfig,\n\t\t\tnil,\n\t\t), nil\n\tcase FileVersionV2:\n\t\tvar externalGenYAMLFile externalBufGenYAMLFileV2\n\t\tif err := getUnmarshalStrict(allowJSON)(data, &externalGenYAMLFile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tgenerateConfig, err := newGenerateConfigFromExternalFileV2(externalGenYAMLFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tinputConfigs, err := xslices.MapError(\n\t\t\texternalGenYAMLFile.Inputs,\n\t\t\tnewInputConfigFromExternalV2,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newBufGenYAMLFile(\n\t\t\tfileVersion,\n\t\t\tobjectData,\n\t\t\tgenerateConfig,\n\t\t\tinputConfigs,\n\t\t), nil\n\tdefault:\n\t\t// This is a system error since we've already parsed.\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n}\n\nfunc writeBufGenYAMLFile(writer io.Writer, bufGenYAMLFile BufGenYAMLFile) error {\n\t// Regardless of version, we write the file as v2:\n\texternalPluginConfigsV2, err := xslices.MapError(\n\t\tbufGenYAMLFile.GenerateConfig().GeneratePluginConfigs(),\n\t\tnewExternalGeneratePluginConfigV2FromPluginConfig,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\texternalManagedConfigV2, err := newExternalManagedConfigV2FromGenerateManagedConfig(\n\t\tbufGenYAMLFile.GenerateConfig().GenerateManagedConfig(),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\texternalInputConfigsV2, err := xslices.MapError(\n\t\tbufGenYAMLFile.InputConfigs(),\n\t\tnewExternalInputConfigV2FromInputConfig,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\texternalBufGenYAMLFileV2 := externalBufGenYAMLFileV2{\n\t\tVersion: FileVersionV2.String(),\n\t\tClean:   bufGenYAMLFile.GenerateConfig().CleanPluginOuts(),\n\t\tPlugins: externalPluginConfigsV2,\n\t\tManaged: externalManagedConfigV2,\n\t\tInputs:  externalInputConfigsV2,\n\t}\n\tdata, err := encoding.MarshalYAML(&externalBufGenYAMLFileV2)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = writer.Write(data)\n\treturn err\n}\n\n// externalBufGenYAMLFileV1Beta1 represents the v1beta buf.gen.yaml file.\ntype externalBufGenYAMLFileV1Beta1 struct {\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\t// Managed is whether managed mode is enabled.\n\tManaged bool                                  `json:\"managed,omitempty\" yaml:\"managed,omitempty\"`\n\tPlugins []externalGeneratePluginConfigV1Beta1 `json:\"plugins,omitempty\" yaml:\"plugins,omitempty\"`\n\tOptions externalGenerateManagedConfigV1Beta1  `json:\"options\" yaml:\"options,omitempty\"`\n}\n\n// externalGeneratePluginConfigV1Beta1 represents a single plugin config in a v1beta1 buf.gen.yaml file.\ntype externalGeneratePluginConfigV1Beta1 struct {\n\tName     string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tOut      string `json:\"out,omitempty\" yaml:\"out,omitempty\"`\n\tOpt      any    `json:\"opt,omitempty\" yaml:\"opt,omitempty\"`\n\tPath     string `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\tStrategy string `json:\"strategy,omitempty\" yaml:\"strategy,omitempty\"`\n}\n\n// externalGenerateManagedConfigV1Beta1 represents the options (for managed mode) config in a v1beta1 buf.gen.yaml file.\ntype externalGenerateManagedConfigV1Beta1 struct {\n\tCcEnableArenas    *bool  `json:\"cc_enable_arenas,omitempty\" yaml:\"cc_enable_arenas,omitempty\"`\n\tJavaMultipleFiles *bool  `json:\"java_multiple_files,omitempty\" yaml:\"java_multiple_files,omitempty\"`\n\tOptimizeFor       string `json:\"optimize_for,omitempty\" yaml:\"optimize_for,omitempty\"`\n}\n\n// externalBufGenYAMLFileV1 represents the v1 buf.gen.yaml file.\ntype externalBufGenYAMLFileV1 struct {\n\tVersion string                           `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tPlugins []externalGeneratePluginConfigV1 `json:\"plugins,omitempty\" yaml:\"plugins,omitempty\"`\n\tManaged externalGenerateManagedConfigV1  `json:\"managed\" yaml:\"managed,omitempty\"`\n\tTypes   externalTypesConfigV1            `json:\"types\" yaml:\"types,omitempty\"`\n}\n\n// externalGeneratePluginConfigV1 represents a single plugin config in a v1 buf.gen.yaml file.\ntype externalGeneratePluginConfigV1 struct {\n\t// Exactly one of Plugin and Name is required.\n\t// Plugin is the key for a local or remote plugin.\n\tPlugin string `json:\"plugin,omitempty\" yaml:\"plugin,omitempty\"`\n\t// Name is the key for a local plugin.\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\t// Out is required.\n\tOut      string `json:\"out,omitempty\" yaml:\"out,omitempty\"`\n\tRevision int    `json:\"revision,omitempty\" yaml:\"revision,omitempty\"`\n\t// Opt can be one string or multiple strings.\n\tOpt any `json:\"opt,omitempty\" yaml:\"opt,omitempty\"`\n\t// Path can be one string or multiple strings.\n\tPath       any    `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\tProtocPath any    `json:\"protoc_path,omitempty\" yaml:\"protoc_path,omitempty\"`\n\tStrategy   string `json:\"strategy,omitempty\" yaml:\"strategy,omitempty\"`\n}\n\n// externalGenerateManagedConfigV1 represents the managed mode config in a v1 buf.gen.yaml file.\ntype externalGenerateManagedConfigV1 struct {\n\tEnabled             bool                              `json:\"enabled,omitempty\" yaml:\"enabled,omitempty\"`\n\tCcEnableArenas      *bool                             `json:\"cc_enable_arenas,omitempty\" yaml:\"cc_enable_arenas,omitempty\"`\n\tJavaMultipleFiles   *bool                             `json:\"java_multiple_files,omitempty\" yaml:\"java_multiple_files,omitempty\"`\n\tJavaStringCheckUtf8 *bool                             `json:\"java_string_check_utf8,omitempty\" yaml:\"java_string_check_utf8,omitempty\"`\n\tJavaPackagePrefix   externalJavaPackagePrefixConfigV1 `json:\"java_package_prefix\" yaml:\"java_package_prefix,omitempty\"`\n\tCsharpNamespace     externalCsharpNamespaceConfigV1   `json:\"csharp_namespace\" yaml:\"csharp_namespace,omitempty\"`\n\tOptimizeFor         externalOptimizeForConfigV1       `json:\"optimize_for\" yaml:\"optimize_for,omitempty\"`\n\tGoPackagePrefix     externalGoPackagePrefixConfigV1   `json:\"go_package_prefix\" yaml:\"go_package_prefix,omitempty\"`\n\tObjcClassPrefix     externalObjcClassPrefixConfigV1   `json:\"objc_class_prefix\" yaml:\"objc_class_prefix,omitempty\"`\n\tRubyPackage         externalRubyPackageConfigV1       `json:\"ruby_package\" yaml:\"ruby_package,omitempty\"`\n\tSwiftPrefix         externalSwiftPrefixConfigV1       `json:\"swift_prefix\" yaml:\"swift_prefix,omitempty\"`\n\t// Override maps from a file option to a file path then to the value.\n\tOverride map[string]map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// externalJavaPackagePrefixConfigV1 represents the java_package_prefix config in a v1 buf.gen.yaml file.\ntype externalJavaPackagePrefixConfigV1 struct {\n\tDefault  string            `json:\"default,omitempty\" yaml:\"default,omitempty\"`\n\tExcept   []string          `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tOverride map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// UnmarshalYAML implements the yaml.Unmarshaler interface. This is done to maintain backward compatibility\n// of accepting a plain string value for java_package_prefix.\nfunc (e *externalJavaPackagePrefixConfigV1) UnmarshalYAML(unmarshal func(any) error) error {\n\treturn e.unmarshalWith(unmarshal)\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface. This is done to maintain backward compatibility\n// of accepting a plain string value for java_package_prefix.\nfunc (e *externalJavaPackagePrefixConfigV1) UnmarshalJSON(data []byte) error {\n\tunmarshal := func(v any) error {\n\t\treturn json.Unmarshal(data, v)\n\t}\n\treturn e.unmarshalWith(unmarshal)\n}\n\n// unmarshalWith is used to unmarshal into json/yaml. See https://abhinavg.net/posts/flexible-yaml for details.\nfunc (e *externalJavaPackagePrefixConfigV1) unmarshalWith(unmarshal func(any) error) error {\n\tvar prefix string\n\tif err := unmarshal(&prefix); err == nil {\n\t\te.Default = prefix\n\t\treturn nil\n\t}\n\ttype rawExternalJavaPackagePrefixConfigV1 externalJavaPackagePrefixConfigV1\n\tif err := unmarshal((*rawExternalJavaPackagePrefixConfigV1)(e)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// isEmpty returns true if the config is empty.\nfunc (e externalJavaPackagePrefixConfigV1) isEmpty() bool {\n\treturn e.Default == \"\" &&\n\t\tlen(e.Except) == 0 &&\n\t\tlen(e.Override) == 0\n}\n\n// externalOptimizeForConfigV1 represents the optimize_for config in a v1 buf.gen.yaml file.\ntype externalOptimizeForConfigV1 struct {\n\tDefault  string            `json:\"default,omitempty\" yaml:\"default,omitempty\"`\n\tExcept   []string          `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tOverride map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// UnmarshalYAML implements the yaml.Unmarshaler interface. This is done to maintain backward compatibility\n// of accepting a plain string value for optimize_for.\nfunc (e *externalOptimizeForConfigV1) UnmarshalYAML(unmarshal func(any) error) error {\n\treturn e.unmarshalWith(unmarshal)\n}\n\n// UnmarshalJSON implements the json.Unmarshaler interface. This is done to maintain backward compatibility\n// of accepting a plain string value for optimize_for.\nfunc (e *externalOptimizeForConfigV1) UnmarshalJSON(data []byte) error {\n\tunmarshal := func(v any) error {\n\t\treturn json.Unmarshal(data, v)\n\t}\n\treturn e.unmarshalWith(unmarshal)\n}\n\n// unmarshalWith is used to unmarshal into json/yaml. See https://abhinavg.net/posts/flexible-yaml for details.\nfunc (e *externalOptimizeForConfigV1) unmarshalWith(unmarshal func(any) error) error {\n\tvar optimizeFor string\n\tif err := unmarshal(&optimizeFor); err == nil {\n\t\te.Default = optimizeFor\n\t\treturn nil\n\t}\n\ttype rawExternalOptimizeForConfigV1 externalOptimizeForConfigV1\n\tif err := unmarshal((*rawExternalOptimizeForConfigV1)(e)); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// isEmpty returns true if the config is empty\nfunc (e externalOptimizeForConfigV1) isEmpty() bool {\n\treturn e.Default == \"\" &&\n\t\tlen(e.Except) == 0 &&\n\t\tlen(e.Override) == 0\n}\n\n// externalGoPackagePrefixConfigV1 represents the go_package_prefix config in a v1 buf.gen.yaml file.\ntype externalGoPackagePrefixConfigV1 struct {\n\tDefault  string            `json:\"default,omitempty\" yaml:\"default,omitempty\"`\n\tExcept   []string          `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tOverride map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// isEmpty returns true if the config is empty.\nfunc (e externalGoPackagePrefixConfigV1) isEmpty() bool {\n\treturn e.Default == \"\" &&\n\t\tlen(e.Except) == 0 &&\n\t\tlen(e.Override) == 0\n}\n\n// externalCsharpNamespaceConfigV1 represents the external csharp_namespace config in a v1 buf.gen.yaml file.\ntype externalCsharpNamespaceConfigV1 struct {\n\tExcept   []string          `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tOverride map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// isEmpty returns true if the config is empty.\nfunc (e externalCsharpNamespaceConfigV1) isEmpty() bool {\n\treturn len(e.Except) == 0 &&\n\t\tlen(e.Override) == 0\n}\n\n// externalRubyPackageConfigV1 represents the ruby_package config in a v1 buf.gen.yaml file.\ntype externalRubyPackageConfigV1 struct {\n\tExcept   []string          `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tOverride map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// isEmpty returns true is the config is empty.\nfunc (e externalRubyPackageConfigV1) isEmpty() bool {\n\treturn len(e.Except) == 0 && len(e.Override) == 0\n}\n\n// externalSwiftPrefixConfigV1 represents the swift_prefix config in a v1 buf.gen.yaml file.\ntype externalSwiftPrefixConfigV1 struct {\n\tDefault  string            `json:\"default,omitempty\" yaml:\"default,omitempty\"`\n\tExcept   []string          `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tOverride map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// isEmpty returns true is the config is empty.\nfunc (e externalSwiftPrefixConfigV1) isEmpty() bool {\n\treturn e.Default == \"\" &&\n\t\tlen(e.Except) == 0 &&\n\t\tlen(e.Override) == 0\n}\n\n// externalObjcClassPrefixConfigV1 represents the objc_class_prefix config in a v1 buf.gen.yaml file.\ntype externalObjcClassPrefixConfigV1 struct {\n\tDefault  string            `json:\"default,omitempty\" yaml:\"default,omitempty\"`\n\tExcept   []string          `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tOverride map[string]string `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// isEmpty returns true is the config is empty.\nfunc (e externalObjcClassPrefixConfigV1) isEmpty() bool {\n\treturn e.Default == \"\" &&\n\t\tlen(e.Except) == 0 &&\n\t\tlen(e.Override) == 0\n}\n\n// externalTypesConfigV1 represents the types config in a v1 buf.gen.yaml file.\ntype externalTypesConfigV1 struct {\n\tInclude []string `json:\"include,omitempty\" yaml:\"include\"`\n}\n\n// externalBufGenYAMLFileV2 represents the v2 buf.gen.yaml file.\ntype externalBufGenYAMLFileV2 struct {\n\tVersion string                          `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tManaged externalGenerateManagedConfigV2 `json:\"managed\" yaml:\"managed,omitempty\"`\n\t// Clean, if set to true, will delete the output directories, zip files, or jar files\n\t// before generation is run.\n\tClean   bool                             `json:\"clean,omitempty\" yaml:\"clean,omitempty\"`\n\tPlugins []externalGeneratePluginConfigV2 `json:\"plugins,omitempty\" yaml:\"plugins,omitempty\"`\n\tInputs  []externalInputConfigV2          `json:\"inputs,omitempty\" yaml:\"inputs,omitempty\"`\n}\n\n// externalGeneratePluginConfigV2 represents a single plugin config in a v2 buf.gen.yaml file.\ntype externalGeneratePluginConfigV2 struct {\n\t// Exactly one of Remote, Local and ProtocBuiltin is required.\n\tRemote *string `json:\"remote,omitempty\" yaml:\"remote,omitempty\"`\n\t// Revision is only valid with Remote set.\n\tRevision *int `json:\"revision,omitempty\" yaml:\"revision,omitempty\"`\n\t// Local is the local path (either relative or absolute) to a binary or other runnable program which\n\t// implements the protoc plugin interface. This can be one string (the program) or multiple (remaining\n\t// strings are arguments to the program).\n\tLocal any `json:\"local,omitempty\" yaml:\"local,omitempty\"`\n\t// ProtocBuiltin is the protoc built-in plugin name, in the form of 'java' instead of 'protoc-gen-java'.\n\tProtocBuiltin *string `json:\"protoc_builtin,omitempty\" yaml:\"protoc_builtin,omitempty\"`\n\t// ProtocPath is only valid with ProtocBuiltin. This can be one string (the path to protoc) or multiple\n\t// (remaining strings are extra args to pass to protoc).\n\tProtocPath any `json:\"protoc_path,omitempty\" yaml:\"protoc_path,omitempty\"`\n\t// Out is required.\n\tOut string `json:\"out,omitempty\" yaml:\"out,omitempty\"`\n\t// Opt can be one string or multiple strings.\n\tOpt            any  `json:\"opt,omitempty\" yaml:\"opt,omitempty\"`\n\tIncludeImports bool `json:\"include_imports,omitempty\" yaml:\"include_imports,omitempty\"`\n\tIncludeWKT     bool `json:\"include_wkt,omitempty\" yaml:\"include_wkt,omitempty\"`\n\t// Strategy is only valid with ProtoBuiltin and Local.\n\tStrategy *string `json:\"strategy,omitempty\" yaml:\"strategy,omitempty\"`\n\n\t// Types is a list of types to include in the image.\n\tTypes []string `json:\"types,omitempty\" yaml:\"types,omitempty\"`\n\t// ExcludeTypes removes types from the image.\n\tExcludeTypes []string `json:\"exclude_types,omitempty\" yaml:\"exclude_types,omitempty\"`\n}\n\n// externalGenerateManagedConfigV2 represents the managed mode config in a v2 buf.gen.yaml file.\ntype externalGenerateManagedConfigV2 struct {\n\tEnabled  bool                              `json:\"enabled,omitempty\" yaml:\"enabled,omitempty\"`\n\tDisable  []externalManagedDisableConfigV2  `json:\"disable,omitempty\" yaml:\"disable,omitempty\"`\n\tOverride []externalManagedOverrideConfigV2 `json:\"override,omitempty\" yaml:\"override,omitempty\"`\n}\n\n// externalManagedDisableConfigV2 represents a disable rule in managed mode in a v2 buf.gen.yaml file.\ntype externalManagedDisableConfigV2 struct {\n\t// At least one field must be set.\n\t// At most one of FileOption and FieldOption can be set\n\tFileOption  string `json:\"file_option,omitempty\" yaml:\"file_option,omitempty\"`\n\tFieldOption string `json:\"field_option,omitempty\" yaml:\"field_option,omitempty\"`\n\tModule      string `json:\"module,omitempty\" yaml:\"module,omitempty\"`\n\t// Path must be normalized.\n\tPath string `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\t// Field must not be set if FileOption is set.\n\tField string `json:\"field,omitempty\" yaml:\"field,omitempty\"`\n}\n\n// externalManagedOverrideConfigV2 represents an override rule in managed mode in a v2 buf.gen.yaml file.\ntype externalManagedOverrideConfigV2 struct {\n\t// Exactly one of FileOption and FieldOption must be set.\n\tFileOption  string `json:\"file_option,omitempty\" yaml:\"file_option,omitempty\"`\n\tFieldOption string `json:\"field_option,omitempty\" yaml:\"field_option,omitempty\"`\n\tModule      string `json:\"module,omitempty\" yaml:\"module,omitempty\"`\n\t// Path must be normalized.\n\tPath string `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\t// Field must not be set if FileOption is set.\n\tField string `json:\"field,omitempty\" yaml:\"field,omitempty\"`\n\t// Value is required\n\tValue any `json:\"value,omitempty\" yaml:\"value,omitempty\"`\n}\n\n// externalInputConfigV2 is an external input configuration.\ntype externalInputConfigV2 struct {\n\t// One and only one of Module, Directory, ProtoFile, Tarball, ZipArchive, BinaryImage,\n\t// JSONImage and GitRepo must be specified as the format.\n\tModule      *string `json:\"module,omitempty\" yaml:\"module,omitempty\"`\n\tDirectory   *string `json:\"directory,omitempty\" yaml:\"directory,omitempty\"`\n\tProtoFile   *string `json:\"proto_file,omitempty\" yaml:\"proto_file,omitempty\"`\n\tTarball     *string `json:\"tarball,omitempty\" yaml:\"tarball,omitempty\"`\n\tZipArchive  *string `json:\"zip_archive,omitempty\" yaml:\"zip_archive,omitempty\"`\n\tBinaryImage *string `json:\"binary_image,omitempty\" yaml:\"binary_image,omitempty\"`\n\tJSONImage   *string `json:\"json_image,omitempty\" yaml:\"json_image,omitempty\"`\n\tTextImage   *string `json:\"text_image,omitempty\" yaml:\"text_image,omitempty\"`\n\tYAMLImage   *string `json:\"yaml_image,omitempty\" yaml:\"yaml_image,omitempty\"`\n\tGitRepo     *string `json:\"git_repo,omitempty\" yaml:\"git_repo,omitempty\"`\n\t// Types, ExcludeTypes, TargetPaths and ExcludePaths are available for all formats.\n\tTypes        []string `json:\"types,omitempty\" yaml:\"types,omitempty\"`\n\tExcludeTypes []string `json:\"exclude_types,omitempty\" yaml:\"exclude_types,omitempty\"`\n\tTargetPaths  []string `json:\"paths,omitempty\" yaml:\"paths,omitempty\"`\n\tExcludePaths []string `json:\"exclude_paths,omitempty\" yaml:\"exclude_paths,omitempty\"`\n\t// The following options are available depending on input format.\n\tCompression         *string `json:\"compression,omitempty\" yaml:\"compression,omitempty\"`\n\tStripComponents     *uint32 `json:\"strip_components,omitempty\" yaml:\"strip_components,omitempty\"`\n\tSubdir              *string `json:\"subdir,omitempty\" yaml:\"subdir,omitempty\"`\n\tBranch              *string `json:\"branch,omitempty\" yaml:\"branch,omitempty\"`\n\tCommit              *string `json:\"commit,omitempty\" yaml:\"commit,omitempty\"`\n\tTag                 *string `json:\"tag,omitempty\" yaml:\"tag,omitempty\"`\n\tRef                 *string `json:\"ref,omitempty\" yaml:\"ref,omitempty\"`\n\tDepth               *uint32 `json:\"depth,omitempty\" yaml:\"depth,omitempty\"`\n\tRecurseSubmodules   *bool   `json:\"recurse_submodules,omitempty\" yaml:\"recurse_submodules,omitempty\"`\n\tIncludePackageFiles *bool   `json:\"include_package_files,omitempty\" yaml:\"include_package_files,omitempty\"`\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_gen_yaml_file_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestReadWriteBufGenYAMLFileRoundTrip(t *testing.T) {\n\tt.Parallel()\n\n\ttestReadWriteBufGenYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v1\nplugins:\n  - plugin: go\n    out: gen/go\n    opt: paths=source_relative\n    path: custom-gen-go\n    strategy: directory\n  - plugin: java\n    out: gen/java\n  - plugin: buf.build/protocolbuffers/python:v21.9\n    out: gen/python\n`,\n\t\t// expected output\n\t\t`version: v2\nplugins:\n  - local: custom-gen-go\n    out: gen/go\n    opt: paths=source_relative\n    strategy: directory\n  - protoc_builtin: java\n    out: gen/java\n  - remote: buf.build/protocolbuffers/python:v21.9\n    out: gen/python\n`,\n\t)\n\ttestReadWriteBufGenYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\n`,\n\t\t// expected output\n\t\t`version: v2\n`,\n\t)\n\ttestReadWriteBufGenYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nplugins:\n  - local: [\"go\", \"run\", \"google.golang.org/protobuf/cmd/protoc-gen-go\"]\n    out: gen/proto\n`,\n\t\t// expected output\n\t\t`version: v2\nplugins:\n  - local:\n      - go\n      - run\n      - google.golang.org/protobuf/cmd/protoc-gen-go\n    out: gen/proto\n`,\n\t)\n\ttestReadWriteBufGenYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nplugins:\n  - local:\n      - go\n      - run\n      - google.golang.org/protobuf/cmd/protoc-gen-go\n    out: gen/proto\n`,\n\t\t// expected output\n\t\t`version: v2\nplugins:\n  - local:\n      - go\n      - run\n      - google.golang.org/protobuf/cmd/protoc-gen-go\n    out: gen/proto\n`,\n\t)\n\ttestReadWriteBufGenYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nclean: true\nplugins:\n  - local: custom-gen-go\n    out: gen/go\n    opt: paths=source_relative\n    strategy: directory\n`,\n\t\t// expected output\n\t\t`version: v2\nclean: true\nplugins:\n  - local: custom-gen-go\n    out: gen/go\n    opt: paths=source_relative\n    strategy: directory\n`,\n\t)\n\ttestReadWriteBufGenYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmanaged:\n  disable:\n    - module: buf.build/googleapis/googleapis\n    - path: foo/v1\n    - file_option: csharp_namespace\n    - field_option: jstype\n    - module: buf.build/acme/weather\n      path: foo/v1\n      file_option: java_package\n    - module: buf.build/acme/petapis\n      field: foo.bar.Baz.field_name\n      path: foo/v1\n      field_option: jstype\n  override:\n    - file_option: java_package_prefix\n      value: net\n    - file_option: java_package_prefix\n      module: buf.build/acme/petapis\n      value: com\n    - file_option: java_package_suffix\n      module: buf.build/acme/petapis\n      value: com\n    - file_option: java_package\n      path: foo/bar/baz.proto\n      value: com.x.y.z\n    - field_option: jstype\n      value: JS_NORMAL\n      module: buf.build/acme/paymentapis\n    - field_option: jstype\n      value: JS_STRING\n      field: package1.Message2.field3\nplugins:\n  - remote: buf.build/protocolbuffers/go\n    revision: 1\n    out: gen/proto\n  - protoc_builtin: cpp\n    protoc_path: /path/to/protoc\n    out: gen/proto\n  - local: protoc-gen-validate\n    out: gen/proto\n  - local: path/to/protoc-gen-validate\n    out: gen/proto\n  - local: /usr/bin/path/to/protoc-gen-validate\n    out: gen/proto2\n  - local: [\"go\", \"run\", \"google.golang.org/protobuf/cmd/protoc-gen-go\"]\n    out: gen/proto\n    opt:\n      - paths=source_relative\n      - foo=bar\n      - baz\n    strategy: all\n    include_imports: true\n    include_wkt: true\n    types:\n      - \"foo.v1.User\"\n    exclude_types:\n      - buf.validate.oneof\n      - buf.validate.message\n      - buf.validate.field\ninputs:\n  - git_repo: github.com/acme/weather\n    branch: dev\n    subdir: proto\n    depth: 30\n  - module: buf.build/acme/weather\n    types:\n      - \"foo.v1.User\"\n      - \"foo.v1.UserService\"\n    exclude_types:\n      - buf.validate.oneof\n    paths:\n      - a/b/c\n      - a/b/d\n    exclude_paths:\n      - a/b/c/x.proto\n      - a/b/d/y.proto\n  - directory: x/y/z\n  - tarball: a/b/x.tar.gz\n  - tarball: c/d/x.tar.zst\n    compression: zstd\n    strip_components: 2\n    subdir: proto\n  - zip_archive: https://github.com/googleapis/googleapis/archive/master.zip\n    strip_components: 1\n  - proto_file: foo/bar/baz.proto\n    include_package_files: true\n  - binary_image: image.binpb.gz\n    compression: gz\n`,\n\t\t// expected output\n\t\t`version: v2\nmanaged:\n  disable:\n    - module: buf.build/googleapis/googleapis\n    - path: foo/v1\n    - file_option: csharp_namespace\n    - field_option: jstype\n    - file_option: java_package\n      module: buf.build/acme/weather\n      path: foo/v1\n    - field_option: jstype\n      module: buf.build/acme/petapis\n      path: foo/v1\n      field: foo.bar.Baz.field_name\n  override:\n    - file_option: java_package_prefix\n      value: net\n    - file_option: java_package_prefix\n      module: buf.build/acme/petapis\n      value: com\n    - file_option: java_package_suffix\n      module: buf.build/acme/petapis\n      value: com\n    - file_option: java_package\n      path: foo/bar/baz.proto\n      value: com.x.y.z\n    - field_option: jstype\n      module: buf.build/acme/paymentapis\n      value: JS_NORMAL\n    - field_option: jstype\n      field: package1.Message2.field3\n      value: JS_STRING\nplugins:\n  - remote: buf.build/protocolbuffers/go\n    revision: 1\n    out: gen/proto\n  - protoc_builtin: cpp\n    protoc_path: /path/to/protoc\n    out: gen/proto\n  - local: protoc-gen-validate\n    out: gen/proto\n  - local: path/to/protoc-gen-validate\n    out: gen/proto\n  - local: /usr/bin/path/to/protoc-gen-validate\n    out: gen/proto2\n  - local:\n      - go\n      - run\n      - google.golang.org/protobuf/cmd/protoc-gen-go\n    out: gen/proto\n    opt:\n      - paths=source_relative\n      - foo=bar\n      - baz\n    include_imports: true\n    include_wkt: true\n    strategy: all\ninputs:\n  - git_repo: github.com/acme/weather\n    subdir: proto\n    branch: dev\n    depth: 30\n  - module: buf.build/acme/weather\n    types:\n      - foo.v1.User\n      - foo.v1.UserService\n    paths:\n      - a/b/c\n      - a/b/d\n    exclude_paths:\n      - a/b/c/x.proto\n      - a/b/d/y.proto\n  - directory: x/y/z\n  - tarball: a/b/x.tar.gz\n  - tarball: c/d/x.tar.zst\n    compression: zstd\n    strip_components: 2\n    subdir: proto\n  - zip_archive: https://github.com/googleapis/googleapis/archive/master.zip\n    strip_components: 1\n  - proto_file: foo/bar/baz.proto\n    include_package_files: true\n  - binary_image: image.binpb.gz\n    compression: gz\n`,\n\t)\n}\n\nfunc TestBufGenYAMLFileManagedErrors(t *testing.T) {\n\tt.Parallel()\n\n\t_, err := ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nmanaged:\n  enabled: true\n  override:\n    - file_option: csharp_namespace\nplugins:\n  - local: protoc-gen-csharp\n    out: gen\n`),\n\t)\n\trequire.ErrorContains(t, err, \"must set value for an override\")\n\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nmanaged:\n  enabled: true\n  override:\n    - value: \"Override\"\nplugins:\n  - local: protoc-gen-csharp\n    out: gen\n`),\n\t)\n\trequire.ErrorContains(t, err, \"must set file_option or field_option for an override\")\n\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nmanaged:\n  enabled: true\n  override:\n    - file_option: csharp_namespace\n      field_option: jstype\n      value: \"Override\"\nplugins:\n  - local: protoc-gen-csharp\n    out: gen\n`),\n\t)\n\trequire.ErrorContains(t, err, \"exactly one of file_option and field_option must be set for an override\")\n\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nmanaged:\n  enabled: true\n  override:\n    - file_option: csharp_namespace\n      field: a.v1.field # bogus field.\n      value: \"fieldCustomNamespace\"\nplugins:\n  - local: protoc-gen-csharp\n    out: gen\n`),\n\t)\n\trequire.ErrorContains(t, err, \"must not set field for a file_option override\")\n\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nmanaged:\n  disable:\n    - file_option: csharp_namespace\n      field_option: jstype\nplugins:\n  - local: protoc-gen-csharp\n`),\n\t)\n\trequire.ErrorContains(t, err, \"at most one of file_option and field_option can be specified\")\n}\n\nfunc TestBufGenYAMLFilePluginConfigErrors(t *testing.T) {\n\tt.Parallel()\n\n\t_, err := ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - local: protoc-gen-go\n    revision: 1\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"cannot specify revision for local plugin\")\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - protoc_builtin: cpp\n    revision: 1\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"cannot specify revision for protoc built-in plugin\")\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - remote: buf.build/protocolbuffers/go\n    protoc_path: /path/to/protoc\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"cannot specify protoc_path for remote plugin\")\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - local: protoc-gen-go\n    protoc_path: /path/to/protoc\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"cannot specify protoc_path for local plugin\")\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - revision: 1\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"must specify one of remote, local or protoc_builtin\")\n\t// Test that out is required.\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - local: protoc-gen-go\n`),\n\t)\n\trequire.ErrorContains(t, err, \"must specify out\")\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - remote: buf.build/protocolbuffers/go\n    strategy: directory\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"cannot specify strategy for remote plugin\")\n\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - remote: buf.build/protocolbuffers/go\n    local: protoc-gen-go\n    out: .\n`))\n\trequire.ErrorContains(t, err, \"only one of remote, local or protoc_builtin\")\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - remote: buf.build/protocolbuffers/go\n    protoc_builtin: cpp\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"only one of remote, local or protoc_builtin\")\n\t_, err = ReadBufGenYAMLFile(\n\t\tstrings.NewReader(`version: v2\nplugins:\n  - local: protoc-gen-go\n    protoc_builtin: cpp\n    out: .\n`),\n\t)\n\trequire.ErrorContains(t, err, \"only one of remote, local or protoc_builtin\")\n}\n\nfunc testReadBufGenYAMLFile(\n\tt *testing.T,\n\tinputBufGenYAMLFileData string,\n) BufGenYAMLFile {\n\tbufGenYAMLFile, err := ReadBufGenYAMLFile(\n\t\tstrings.NewReader(testCleanYAMLData(inputBufGenYAMLFileData)),\n\t)\n\trequire.NoError(t, err)\n\treturn bufGenYAMLFile\n}\n\nfunc testReadWriteBufGenYAMLFileRoundTrip(\n\tt *testing.T,\n\tinputBufYAMLFileData string,\n\texpectedOutputBufYAMLFileData string,\n) {\n\tbufGenYAMLFile := testReadBufGenYAMLFile(t, inputBufYAMLFileData)\n\tbuffer := bytes.NewBuffer(nil)\n\terr := WriteBufGenYAMLFile(buffer, bufGenYAMLFile)\n\trequire.NoError(t, err)\n\toutputBufGenYAMLData := testCleanYAMLData(buffer.String())\n\tassert.Equal(t, testCleanYAMLData(expectedOutputBufYAMLFileData), outputBufGenYAMLData, \"output:\\n%s\", outputBufGenYAMLData)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_lock_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"maps\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\nconst (\n\t// DefaultBufLockFileName is default buf.lock file name.\n\tDefaultBufLockFileName = \"buf.lock\"\n\n\tdefaultBufLockFileVersion = FileVersionV1Beta1\n)\n\nvar (\n\t// bufLockFileHeader is the header prepended to any lock files.\n\tbufLockFileHeader = []byte(\"# Generated by buf. DO NOT EDIT.\\n\")\n\n\t// ordered\n\tbufLockFileNames                       = []string{DefaultBufLockFileName}\n\tbufLockFileNameToSupportedFileVersions = map[string]map[FileVersion]struct{}{\n\t\tDefaultBufLockFileName: {\n\t\t\tFileVersionV1Beta1: struct{}{},\n\t\t\tFileVersionV1:      struct{}{},\n\t\t\tFileVersionV2:      struct{}{},\n\t\t},\n\t}\n\n\tdeprecatedDigestTypeToPrefix = map[string]string{\n\t\t\"b1\": \"b1-\",\n\t\t\"b3\": \"b3-\",\n\t}\n)\n\n// BufLockFile represents a buf.lock file.\ntype BufLockFile interface {\n\tFile\n\n\t// DepModuleKeys returns the ModuleKeys representing the dependencies as specified in the buf.lock file.\n\t//\n\t// All ModuleKeys will have unique FullNames.\n\t// ModuleKeys are sorted by FullName.\n\t//\n\t// Files with FileVersionV1Beta1 or FileVersionV1 will only have ModuleKeys with Digests of DigestTypeB4,\n\t// while Files with FileVersionV2 will only have ModuleKeys with Digests of DigestTypeB5.\n\tDepModuleKeys() []bufmodule.ModuleKey\n\t// RemotePluginKeys returns the PluginKeys representing the remote plugins as specified in the buf.lock file.\n\t//\n\t// All PluginKeys will have unique FullNames.\n\t// PluginKeys are sorted by FullName.\n\t//\n\t// Files with FileVersionV1Beta1 or FileVersionV1 will not have PluginKeys.\n\t// Only files with FileVersionV2 will have PluginKeys with Digests of DigestTypeP1.\n\tRemotePluginKeys() []bufplugin.PluginKey\n\t// RemotePolicyKeys returns the PolicyKeys representing the remote policies as specified in the buf.lock file.\n\t//\n\t// All PolicyKeys will have unique FullNames.\n\t// PolicyKeys are sorted by FullName.\n\t//\n\t// Files with FileVersionV1Beta1 or FileVersionV1 will not have PolicyKeys.\n\t// Only files with FileVersionV2 will have PolicyKeys with Digests of DigestTypeO1.\n\tRemotePolicyKeys() []bufpolicy.PolicyKey\n\t// PolicyNameToRemotePluginKeys returns the PluginKeys for each Policy\n\t// representing the remote plugins as specified in the buf.lock file.\n\t//\n\t// All PluginKeys will have unique FullNames for each Policy.\n\t// PluginKeys are sorted by FullName for each Policy.\n\t//\n\t// Files with FileVersionV1Beta1 or FileVersionV1 will not have Policies with PluginKeys.\n\t// Only files with FileVersionV2 will have Policies with PluginKeys with Digests of DigestTypeP1.\n\tPolicyNameToRemotePluginKeys() map[string][]bufplugin.PluginKey\n\n\tisBufLockFile()\n}\n\n// NewBufLockFile returns a new validated BufLockFile.\n//\n// Note that digests are lazily-loaded; if you need to ensure that all digests are valid, run\n// ValidateBufLockFileDigests().\nfunc NewBufLockFile(\n\tfileVersion FileVersion,\n\tdepModuleKeys []bufmodule.ModuleKey,\n\tpluginKeys []bufplugin.PluginKey,\n\tpolicyKeys []bufpolicy.PolicyKey,\n\tpolicyNameToPluginKeys map[string][]bufplugin.PluginKey,\n) (BufLockFile, error) {\n\treturn newBufLockFile(fileVersion, nil, depModuleKeys, pluginKeys, policyKeys, policyNameToPluginKeys)\n}\n\n// GetBufLockFileForPrefix gets the buf.lock file at the given bucket prefix.\n//\n// The buf.lock file will be attempted to be read at prefix/buf.lock.\n//\n// Note that digests are lazily-loaded; if you need to ensure that all digests are valid, run\n// ValidateFileDigests().\nfunc GetBufLockFileForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\toptions ...BufLockFileOption,\n) (BufLockFile, error) {\n\treturn getFileForPrefix(\n\t\tctx,\n\t\tbucket,\n\t\tprefix,\n\t\tbufLockFileNames,\n\t\tbufLockFileNameToSupportedFileVersions,\n\t\tfunc(\n\t\t\tdata []byte,\n\t\t\tobjectData ObjectData,\n\t\t\tallowJSON bool,\n\t\t) (BufLockFile, error) {\n\t\t\treturn readBufLockFile(ctx, data, objectData, allowJSON, options...)\n\t\t},\n\t)\n}\n\n// GetBufLockFileVersionForPrefix gets the buf.lock file version at the given bucket prefix.\n//\n// The buf.lock file will be attempted to be read at prefix/buf.lock.\nfunc GetBufLockFileVersionForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (FileVersion, error) {\n\treturn getFileVersionForPrefix(ctx, bucket, prefix, bufLockFileNames, bufLockFileNameToSupportedFileVersions, false, 0, defaultBufLockFileVersion)\n}\n\n// PutBufLockFileForPrefix puts the buf.lock file at the given bucket prefix.\n//\n// The buf.lock file will be attempted to be written to prefix/buf.lock.\n// The buf.lock file will be written atomically.\nfunc PutBufLockFileForPrefix(\n\tctx context.Context,\n\tbucket storage.WriteBucket,\n\tprefix string,\n\tbufLockFile BufLockFile,\n) error {\n\treturn putFileForPrefix(ctx, bucket, prefix, bufLockFile, DefaultBufLockFileName, bufLockFileNameToSupportedFileVersions, writeBufLockFile)\n}\n\n// ReadBufLockFile reads the BufLockFile from the io.Reader.\n//\n// fileName may be empty.\nfunc ReadBufLockFile(ctx context.Context, reader io.Reader, fileName string, options ...BufLockFileOption) (BufLockFile, error) {\n\treturn readFile(\n\t\treader,\n\t\tfileName,\n\t\tfunc(\n\t\t\tdata []byte,\n\t\t\tobjectData ObjectData,\n\t\t\tallowJSON bool,\n\t\t) (BufLockFile, error) {\n\t\t\treturn readBufLockFile(ctx, data, objectData, allowJSON, options...)\n\t\t},\n\t)\n}\n\n// WriteBufLockFile writes the BufLockFile to the io.Writer.\nfunc WriteBufLockFile(writer io.Writer, bufLockFile BufLockFile) error {\n\treturn writeFile(writer, bufLockFile, writeBufLockFile)\n}\n\n// BufLockFileOption is an option for getting a new BufLockFile via Get or Read.\ntype BufLockFileOption func(*bufLockFileOptions)\n\n// BufLockFileWithDigestResolver returns a new BufLockFileOption that will resolve digests from commits.\n//\n// Pre-approximately-v1.10 of the buf CLI, we did not store digests in buf.lock files, we only stored commits.\n// In these situations, we need to get digests from the BSR based on the commit. All of our new code relies\n// on digests being present, but we are able to backfill them via the CommitService. By having this option, this allows\n// us to do this backfill when reading buf.lock files created by any version of the buf CLI.\n//\n// TODO FUTURE: use this for all reads of buf.locks, including migrate, prune, update, etc. This really almost should not\n// be an option.\nfunc BufLockFileWithDigestResolver(\n\tdigestResolver func(ctx context.Context, remote string, commitID uuid.UUID) (bufmodule.Digest, error),\n) BufLockFileOption {\n\treturn func(bufLockFileOptions *bufLockFileOptions) {\n\t\tbufLockFileOptions.digestResolver = digestResolver\n\t}\n}\n\n// *** PRIVATE ***\n\ntype bufLockFile struct {\n\tfileVersion                  FileVersion\n\tobjectData                   ObjectData\n\tdepModuleKeys                []bufmodule.ModuleKey\n\tremotePluginKeys             []bufplugin.PluginKey\n\tremotePolicyKeys             []bufpolicy.PolicyKey\n\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey\n}\n\nfunc newBufLockFile(\n\tfileVersion FileVersion,\n\tobjectData ObjectData,\n\tdepModuleKeys []bufmodule.ModuleKey,\n\tremotePluginKeys []bufplugin.PluginKey,\n\tremotePolicyKeys []bufpolicy.PolicyKey,\n\tpolicyNameToRemotePluginKeys map[string][]bufplugin.PluginKey,\n) (*bufLockFile, error) {\n\tif err := validateNoDuplicateModuleKeysByFullName(depModuleKeys); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := validateNoDuplicatePluginKeysByFullName(remotePluginKeys); err != nil {\n\t\treturn nil, err\n\t}\n\tswitch fileVersion {\n\tcase FileVersionV1Beta1, FileVersionV1:\n\t\tif err := validateModuleExpectedDigestType(depModuleKeys, fileVersion, bufmodule.DigestTypeB4); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(remotePluginKeys) > 0 {\n\t\t\treturn nil, errors.New(\"remote plugins are not supported in v1 or v1beta1 buf.lock files\")\n\t\t}\n\t\tif len(remotePolicyKeys) > 0 || len(policyNameToRemotePluginKeys) > 0 {\n\t\t\treturn nil, errors.New(\"remote policies are not supported in v1 or v1beta1 buf.lock files\")\n\t\t}\n\tcase FileVersionV2:\n\t\tif err := validateModuleExpectedDigestType(depModuleKeys, fileVersion, bufmodule.DigestTypeB5); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := validatePluginExpectedDigestType(remotePluginKeys, fileVersion, bufplugin.DigestTypeP1); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := validatePolicyExpectedDigestType(remotePolicyKeys, fileVersion, bufpolicy.DigestTypeO1); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor policyName, pluginKeys := range policyNameToRemotePluginKeys {\n\t\t\tif err := validateNoDuplicatePluginKeysByFullName(pluginKeys); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"policy %q: %w\", policyName, err)\n\t\t\t}\n\t\t\tif err := validatePluginExpectedDigestType(pluginKeys, fileVersion, bufplugin.DigestTypeP1); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"policy %q: %w\", policyName, err)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n\t// To make sure we aren't editing input.\n\tdepModuleKeys = slices.Clone(depModuleKeys)\n\tsort.Slice(\n\t\tdepModuleKeys,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn depModuleKeys[i].FullName().String() < depModuleKeys[j].FullName().String()\n\t\t},\n\t)\n\tremotePluginKeys = slices.Clone(remotePluginKeys)\n\tsort.Slice(\n\t\tremotePluginKeys,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn remotePluginKeys[i].FullName().String() < remotePluginKeys[j].FullName().String()\n\t\t},\n\t)\n\tbufLockFile := &bufLockFile{\n\t\tfileVersion:                  fileVersion,\n\t\tobjectData:                   objectData,\n\t\tdepModuleKeys:                depModuleKeys,\n\t\tremotePluginKeys:             remotePluginKeys,\n\t\tremotePolicyKeys:             remotePolicyKeys,\n\t\tpolicyNameToRemotePluginKeys: policyNameToRemotePluginKeys,\n\t}\n\tif err := validateV1AndV1Beta1DepsHaveCommits(bufLockFile); err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufLockFile, nil\n}\n\nfunc (l *bufLockFile) FileVersion() FileVersion {\n\treturn l.fileVersion\n}\n\nfunc (*bufLockFile) FileType() FileType {\n\treturn FileTypeBufLock\n}\n\nfunc (l *bufLockFile) ObjectData() ObjectData {\n\treturn l.objectData\n}\n\nfunc (l *bufLockFile) DepModuleKeys() []bufmodule.ModuleKey {\n\treturn l.depModuleKeys\n}\n\nfunc (l *bufLockFile) RemotePluginKeys() []bufplugin.PluginKey {\n\treturn l.remotePluginKeys\n}\n\nfunc (l *bufLockFile) RemotePolicyKeys() []bufpolicy.PolicyKey {\n\treturn l.remotePolicyKeys\n}\n\nfunc (l *bufLockFile) PolicyNameToRemotePluginKeys() map[string][]bufplugin.PluginKey {\n\tif l.policyNameToRemotePluginKeys == nil {\n\t\treturn nil\n\t}\n\treturn l.policyNameToRemotePluginKeys\n}\n\nfunc (*bufLockFile) isBufLockFile() {}\nfunc (*bufLockFile) isFile()        {}\nfunc (*bufLockFile) isFileInfo()    {}\n\nfunc readBufLockFile(\n\tctx context.Context,\n\tdata []byte,\n\tobjectData ObjectData,\n\tallowJSON bool,\n\toptions ...BufLockFileOption,\n) (BufLockFile, error) {\n\tbufLockFileOptions := newBufLockFileOptions()\n\tfor _, option := range options {\n\t\toption(bufLockFileOptions)\n\t}\n\t// We have allowed buf.locks to not have file versions historically. Why we did this, I do not know.\n\tfileVersion, err := getFileVersionForData(data, allowJSON, false, bufLockFileNameToSupportedFileVersions, 0, defaultBufLockFileVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch fileVersion {\n\tcase FileVersionV1Beta1, FileVersionV1:\n\t\tvar externalBufLockFile externalBufLockFileV1Beta1V1\n\t\tif err := getUnmarshalStrict(allowJSON)(data, &externalBufLockFile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdepModuleKeys := make([]bufmodule.ModuleKey, len(externalBufLockFile.Deps))\n\t\tfor i, dep := range externalBufLockFile.Deps {\n\t\t\tif dep.Remote == \"\" {\n\t\t\t\treturn nil, errors.New(\"remote missing\")\n\t\t\t}\n\t\t\tif dep.Owner == \"\" {\n\t\t\t\treturn nil, errors.New(\"owner missing\")\n\t\t\t}\n\t\t\tif dep.Repository == \"\" {\n\t\t\t\treturn nil, errors.New(\"repository missing\")\n\t\t\t}\n\t\t\tmoduleFullName, err := bufparse.NewFullName(\n\t\t\t\tdep.Remote,\n\t\t\t\tdep.Owner,\n\t\t\t\tdep.Repository,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid module name: %w\", err)\n\t\t\t}\n\t\t\tif dep.Commit == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"no commit specified for module %s\", moduleFullName.String())\n\t\t\t}\n\t\t\tcommitID, err := uuidutil.FromDashless(dep.Commit)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tgetDigest := func() (bufmodule.Digest, error) {\n\t\t\t\treturn bufmodule.ParseDigest(dep.Digest)\n\t\t\t}\n\t\t\tif dep.Digest == \"\" || isDeprecatedExternalDigest(dep.Digest) {\n\t\t\t\tif bufLockFileOptions.digestResolver == nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"no digest specified for module %s\", moduleFullName.String())\n\t\t\t\t}\n\t\t\t\tgetDigest = func() (bufmodule.Digest, error) {\n\t\t\t\t\treturn bufLockFileOptions.digestResolver(ctx, dep.Remote, commitID)\n\t\t\t\t}\n\t\t\t}\n\t\t\tdepModuleKey, err := bufmodule.NewModuleKey(\n\t\t\t\tmoduleFullName,\n\t\t\t\tcommitID,\n\t\t\t\tgetDigest,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdepModuleKeys[i] = depModuleKey\n\t\t}\n\t\treturn newBufLockFile(fileVersion, objectData, depModuleKeys, nil /* remotePluginKeys */, nil /* remotePolicyKeys */, nil /* remotePolicyPluginKeys */)\n\tcase FileVersionV2:\n\t\tvar externalBufLockFile externalBufLockFileV2\n\t\tif err := getUnmarshalStrict(allowJSON)(data, &externalBufLockFile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdepModuleKeys := make([]bufmodule.ModuleKey, len(externalBufLockFile.Deps))\n\t\tfor i, dep := range externalBufLockFile.Deps {\n\t\t\tif dep.Name == \"\" {\n\t\t\t\treturn nil, errors.New(\"no module name specified\")\n\t\t\t}\n\t\t\tmoduleFullName, err := bufparse.ParseFullName(dep.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid module name: %w\", err)\n\t\t\t}\n\t\t\tif dep.Commit == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"no commit specified for module %s\", moduleFullName.String())\n\t\t\t}\n\t\t\tif dep.Digest == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"no digest specified for module %s\", moduleFullName.String())\n\t\t\t}\n\t\t\tif deprecatedDigestType := getDeprecatedDigestTypeForExternalDigest(dep.Digest); deprecatedDigestType != \"\" {\n\t\t\t\t// TODO: Add a message about downgrading the buf cli to a version that supports this.\n\t\t\t\treturn nil, fmt.Errorf(`%s digests are no longer supported as of v1.32.0, run \"buf mod update\" to update your buf.lock`, deprecatedDigestType)\n\t\t\t}\n\t\t\tcommitID, err := uuidutil.FromDashless(dep.Commit)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdepModuleKey, err := bufmodule.NewModuleKey(\n\t\t\t\tmoduleFullName,\n\t\t\t\tcommitID,\n\t\t\t\tfunc() (bufmodule.Digest, error) {\n\t\t\t\t\treturn bufmodule.ParseDigest(dep.Digest)\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdepModuleKeys[i] = depModuleKey\n\t\t}\n\t\tremotePluginKeys, err := parseRemotePluginDeps(externalBufLockFile.Plugins)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tremotePolicyKeys := make([]bufpolicy.PolicyKey, 0, len(externalBufLockFile.Policies))\n\t\tpolicyNameToRemotePluginKeys := make(map[string][]bufplugin.PluginKey, len(externalBufLockFile.Policies))\n\t\tfor _, policy := range externalBufLockFile.Policies {\n\t\t\tif policy.Name == \"\" {\n\t\t\t\treturn nil, errors.New(\"no policy name specified\")\n\t\t\t}\n\t\t\t// Parse the plugins for this policy.\n\t\t\tremotePluginKeys, err := parseRemotePluginDeps(policy.Plugins)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid plugins for policy %q: %w\", policy.Name, err)\n\t\t\t}\n\t\t\tif policy.Commit == \"\" {\n\t\t\t\t// Local policies may be specified with remote plugins.\n\t\t\t\t// An empty commit ID indicates that this is a local policy.\n\t\t\t\t// If the policy has a digest, it is a remote policy with a missing commit ID.\n\t\t\t\tif policy.Digest != \"\" {\n\t\t\t\t\treturn nil, fmt.Errorf(\"no commit specified for policy %s\", policy.Name)\n\t\t\t\t}\n\t\t\t\t// This is a local Policy with remote plugins.\n\t\t\t\tpolicyNameToRemotePluginKeys[policy.Name] = remotePluginKeys\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tpolicyFullName, err := bufparse.ParseFullName(policy.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid policy name: %w\", err)\n\t\t\t}\n\t\t\tif policy.Digest == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"no digest specified for policy %s\", policyFullName.String())\n\t\t\t}\n\t\t\tcommitID, err := uuidutil.FromDashless(policy.Commit)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpolicyKey, err := bufpolicy.NewPolicyKey(\n\t\t\t\tpolicyFullName,\n\t\t\t\tcommitID,\n\t\t\t\tfunc() (bufpolicy.Digest, error) {\n\t\t\t\t\treturn bufpolicy.ParseDigest(policy.Digest)\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// Append the policy key rather than index as some policies may not be remote.\n\t\t\tremotePolicyKeys = append(remotePolicyKeys, policyKey)\n\t\t\tpolicyNameToRemotePluginKeys[policy.Name] = remotePluginKeys\n\t\t}\n\t\treturn newBufLockFile(fileVersion, objectData, depModuleKeys, remotePluginKeys, remotePolicyKeys, policyNameToRemotePluginKeys)\n\tdefault:\n\t\t// This is a system error since we've already parsed.\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n}\n\nfunc parseRemotePluginDeps(pluginDeps []externalBufLockFileDepV2) ([]bufplugin.PluginKey, error) {\n\tremotePluginKeys := make([]bufplugin.PluginKey, len(pluginDeps))\n\tfor i, plugin := range pluginDeps {\n\t\tif plugin.Name == \"\" {\n\t\t\treturn nil, errors.New(\"no plugin name specified\")\n\t\t}\n\t\tpluginFullName, err := bufparse.ParseFullName(plugin.Name)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid plugin name: %w\", err)\n\t\t}\n\t\tif plugin.Commit == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"no commit specified for plugin %s\", pluginFullName.String())\n\t\t}\n\t\tif plugin.Digest == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"no digest specified for plugin %s\", pluginFullName.String())\n\t\t}\n\t\tcommitID, err := uuidutil.FromDashless(plugin.Commit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginKey, err := bufplugin.NewPluginKey(\n\t\t\tpluginFullName,\n\t\t\tcommitID,\n\t\t\tfunc() (bufplugin.Digest, error) {\n\t\t\t\treturn bufplugin.ParseDigest(plugin.Digest)\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tremotePluginKeys[i] = pluginKey\n\t}\n\treturn remotePluginKeys, nil\n}\n\nfunc writeBufLockFile(\n\twriter io.Writer,\n\tbufLockFile BufLockFile,\n) error {\n\tif err := validateV1AndV1Beta1DepsHaveCommits(bufLockFile); err != nil {\n\t\treturn err\n\t}\n\tswitch fileVersion := bufLockFile.FileVersion(); fileVersion {\n\tcase FileVersionV1Beta1, FileVersionV1:\n\t\tdepModuleKeys := bufLockFile.DepModuleKeys()\n\t\texternalBufLockFile := externalBufLockFileV1Beta1V1{\n\t\t\tVersion: fileVersion.String(),\n\t\t\tDeps:    make([]externalBufLockFileDepV1Beta1V1, len(depModuleKeys)),\n\t\t}\n\t\tfor i, depModuleKey := range depModuleKeys {\n\t\t\tdigest, err := depModuleKey.Digest()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\texternalBufLockFile.Deps[i] = externalBufLockFileDepV1Beta1V1{\n\t\t\t\tRemote:     depModuleKey.FullName().Registry(),\n\t\t\t\tOwner:      depModuleKey.FullName().Owner(),\n\t\t\t\tRepository: depModuleKey.FullName().Name(),\n\t\t\t\tCommit:     uuidutil.ToDashless(depModuleKey.CommitID()),\n\t\t\t\tDigest:     digest.String(),\n\t\t\t}\n\t\t}\n\t\t// No need to sort - depModuleKeys is already sorted by FullName\n\t\tdata, err := encoding.MarshalYAML(&externalBufLockFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = writer.Write(append(bufLockFileHeader, data...))\n\t\treturn err\n\tcase FileVersionV2:\n\t\tdepModuleKeys := bufLockFile.DepModuleKeys()\n\t\tremotePluginKeys := bufLockFile.RemotePluginKeys()\n\t\tremotePolicyKeys := bufLockFile.RemotePolicyKeys()\n\t\tpolicyNameToRemotePluginKeys := maps.Clone(bufLockFile.PolicyNameToRemotePluginKeys())\n\t\texternalBufLockFile := externalBufLockFileV2{\n\t\t\tVersion:  fileVersion.String(),\n\t\t\tDeps:     make([]externalBufLockFileDepV2, len(depModuleKeys)),\n\t\t\tPlugins:  make([]externalBufLockFileDepV2, len(remotePluginKeys)),\n\t\t\tPolicies: make([]externalBufLockFilePolicyV2, len(remotePolicyKeys)),\n\t\t}\n\t\tfor i, depModuleKey := range depModuleKeys {\n\t\t\tdigest, err := depModuleKey.Digest()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\texternalBufLockFile.Deps[i] = externalBufLockFileDepV2{\n\t\t\t\tName:   depModuleKey.FullName().String(),\n\t\t\t\tCommit: uuidutil.ToDashless(depModuleKey.CommitID()),\n\t\t\t\tDigest: digest.String(),\n\t\t\t}\n\t\t}\n\t\tfor i, remotePluginKey := range remotePluginKeys {\n\t\t\tdigest, err := remotePluginKey.Digest()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\texternalBufLockFile.Plugins[i] = externalBufLockFileDepV2{\n\t\t\t\tName:   remotePluginKey.FullName().String(),\n\t\t\t\tCommit: uuidutil.ToDashless(remotePluginKey.CommitID()),\n\t\t\t\tDigest: digest.String(),\n\t\t\t}\n\t\t}\n\t\tfor i, remotePolicyKey := range remotePolicyKeys {\n\t\t\tdigest, err := remotePolicyKey.Digest()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tremotePluginKeysForPolicy := policyNameToRemotePluginKeys[remotePolicyKey.FullName().String()]\n\t\t\texternalPlugins := make([]externalBufLockFileDepV2, len(remotePluginKeysForPolicy))\n\t\t\tfor j, remotePluginKey := range remotePluginKeysForPolicy {\n\t\t\t\tdigest, err := remotePluginKey.Digest()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\texternalPlugins[j] = externalBufLockFileDepV2{\n\t\t\t\t\tName:   remotePluginKey.FullName().String(),\n\t\t\t\t\tCommit: uuidutil.ToDashless(remotePluginKey.CommitID()),\n\t\t\t\t\tDigest: digest.String(),\n\t\t\t\t}\n\t\t\t}\n\t\t\texternalBufLockFile.Policies[i] = externalBufLockFilePolicyV2{\n\t\t\t\tName:    remotePolicyKey.FullName().String(),\n\t\t\t\tCommit:  uuidutil.ToDashless(remotePolicyKey.CommitID()),\n\t\t\t\tDigest:  digest.String(),\n\t\t\t\tPlugins: externalPlugins,\n\t\t\t}\n\t\t\t// Remove the remote policy key from the map.\n\t\t\tdelete(policyNameToRemotePluginKeys, remotePolicyKey.FullName().String())\n\t\t}\n\t\t// Append any local policies that have remote plugins.\n\t\tfor policyName, remotePluginKeys := range policyNameToRemotePluginKeys {\n\t\t\texternalPlugins := make([]externalBufLockFileDepV2, len(remotePluginKeys))\n\t\t\tfor j, remotePluginKey := range remotePluginKeys {\n\t\t\t\tdigest, err := remotePluginKey.Digest()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\texternalPlugins[j] = externalBufLockFileDepV2{\n\t\t\t\t\tName:   remotePluginKey.FullName().String(),\n\t\t\t\t\tCommit: uuidutil.ToDashless(remotePluginKey.CommitID()),\n\t\t\t\t\tDigest: digest.String(),\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Must append local polcies as only allocate remote policies.\n\t\t\texternalBufLockFile.Policies = append(externalBufLockFile.Policies, externalBufLockFilePolicyV2{\n\t\t\t\tName:    policyName,\n\t\t\t\tPlugins: externalPlugins,\n\t\t\t})\n\t\t}\n\t\t// Sort the policies by name.\n\t\tif len(policyNameToRemotePluginKeys) > 0 {\n\t\t\tsort.Slice(externalBufLockFile.Policies, func(i, j int) bool {\n\t\t\t\treturn externalBufLockFile.Policies[i].Name < externalBufLockFile.Policies[j].Name\n\t\t\t})\n\t\t}\n\n\t\tdata, err := encoding.MarshalYAML(&externalBufLockFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, err = writer.Write(append(bufLockFileHeader, data...))\n\t\treturn err\n\tdefault:\n\t\t// This is a system error since we've already parsed.\n\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n}\n\nfunc isDeprecatedExternalDigest(externalDigest string) bool {\n\treturn getDeprecatedDigestTypeForExternalDigest(externalDigest) != \"\"\n}\n\n// Returns \"\" if the digest is not using a deprecated digest type.\nfunc getDeprecatedDigestTypeForExternalDigest(externalDigest string) string {\n\tfor digestType, prefix := range deprecatedDigestTypeToPrefix {\n\t\tif strings.HasPrefix(externalDigest, prefix) {\n\t\t\treturn digestType\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc validateNoDuplicateModuleKeysByFullName(moduleKeys []bufmodule.ModuleKey) error {\n\tmoduleFullNameStringMap := make(map[string]struct{})\n\tfor _, moduleKey := range moduleKeys {\n\t\tmoduleFullNameString := moduleKey.FullName().String()\n\t\tif _, ok := moduleFullNameStringMap[moduleFullNameString]; ok {\n\t\t\treturn fmt.Errorf(\"duplicate module %q attempted to be added to lock file\", moduleFullNameString)\n\t\t}\n\t\tmoduleFullNameStringMap[moduleFullNameString] = struct{}{}\n\t}\n\treturn nil\n}\n\nfunc validateNoDuplicatePluginKeysByFullName(pluginKeys []bufplugin.PluginKey) error {\n\tpluginFullNameStringMap := make(map[string]struct{})\n\tfor _, pluginKey := range pluginKeys {\n\t\tpluginFullNameString := pluginKey.FullName().String()\n\t\tif _, ok := pluginFullNameStringMap[pluginFullNameString]; ok {\n\t\t\treturn fmt.Errorf(\"duplicate plugin %q attempted to be added to lock file\", pluginFullNameString)\n\t\t}\n\t\tpluginFullNameStringMap[pluginFullNameString] = struct{}{}\n\t}\n\treturn nil\n}\n\nfunc validateV1AndV1Beta1DepsHaveCommits(bufLockFile BufLockFile) error {\n\tswitch fileVersion := bufLockFile.FileVersion(); fileVersion {\n\tcase FileVersionV1Beta1, FileVersionV1:\n\t\tfor _, depModuleKey := range bufLockFile.DepModuleKeys() {\n\t\t\tif depModuleKey.CommitID() == uuid.Nil {\n\t\t\t\t// This is a system error.\n\t\t\t\treturn syserror.Newf(\n\t\t\t\t\t\"%s lock files require commits, however we did not have a commit for module %q\",\n\t\t\t\t\tfileVersion.String(),\n\t\t\t\t\tdepModuleKey.FullName().String(),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tcase FileVersionV2:\n\t\t// We do not need commits in v2.\n\t\treturn nil\n\tdefault:\n\t\t// This is a system error since we've already parsed.\n\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n}\n\nfunc validateModuleExpectedDigestType(\n\tmoduleKeys []bufmodule.ModuleKey,\n\tfileVersion FileVersion,\n\texpectedDigestType bufmodule.DigestType,\n) error {\n\tfor _, moduleKey := range moduleKeys {\n\t\tdigest, err := moduleKey.Digest()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif digest.Type() != expectedDigestType {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"%s lock files must use digest type %v, but dep %s had a digest type of %v\",\n\t\t\t\tfileVersion,\n\t\t\t\texpectedDigestType,\n\t\t\t\tmoduleKey.String(),\n\t\t\t\tdigest.Type(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validatePluginExpectedDigestType(\n\tpluginKeys []bufplugin.PluginKey,\n\tfileVersion FileVersion,\n\texpectedDigestType bufplugin.DigestType,\n) error {\n\tfor _, pluginKey := range pluginKeys {\n\t\tdigest, err := pluginKey.Digest()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif digest.Type() != expectedDigestType {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"%s lock files must use digest type %v, but remote plugin %s had a digest type of %v\",\n\t\t\t\tfileVersion,\n\t\t\t\texpectedDigestType,\n\t\t\t\tpluginKey.String(),\n\t\t\t\tdigest.Type(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validatePolicyExpectedDigestType(\n\tpolicyKeys []bufpolicy.PolicyKey,\n\tfileVersion FileVersion,\n\texpectedDigestType bufpolicy.DigestType,\n) error {\n\tfor _, policyKey := range policyKeys {\n\t\tdigest, err := policyKey.Digest()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif digest.Type() != expectedDigestType {\n\t\t\treturn fmt.Errorf(\n\t\t\t\t\"%s lock files must use digest type %v, but remote policy %s had a digest type of %v\",\n\t\t\t\tfileVersion,\n\t\t\t\texpectedDigestType,\n\t\t\t\tpolicyKey.String(),\n\t\t\t\tdigest.Type(),\n\t\t\t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// externalBufLockFileV1Beta1V1 represents the v1 or v1beta1 buf.lock file,\n// which have the same shape.\ntype externalBufLockFileV1Beta1V1 struct {\n\tVersion string                            `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tDeps    []externalBufLockFileDepV1Beta1V1 `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n}\n\n// externalBufLockFileDepV1Beta1V1 represents a single dep within a v1 or v1beta1 buf.lock file,\n// which have the same shape.\ntype externalBufLockFileDepV1Beta1V1 struct {\n\tRemote     string `json:\"remote,omitempty\" yaml:\"remote,omitempty\"`\n\tOwner      string `json:\"owner,omitempty\" yaml:\"owner,omitempty\"`\n\tRepository string `json:\"repository,omitempty\" yaml:\"repository,omitempty\"`\n\tBranch     string `json:\"branch,omitempty\" yaml:\"branch,omitempty\"`\n\t// Dashless\n\tCommit     string    `json:\"commit,omitempty\" yaml:\"commit,omitempty\"`\n\tDigest     string    `json:\"digest,omitempty\" yaml:\"digest,omitempty\"`\n\tCreateTime time.Time `json:\"create_time\" yaml:\"create_time,omitempty\"`\n}\n\n// externalBufLockFileV2 represents the v2 buf.lock file.\ntype externalBufLockFileV2 struct {\n\tVersion  string                        `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tDeps     []externalBufLockFileDepV2    `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tPlugins  []externalBufLockFileDepV2    `json:\"plugins,omitempty\" yaml:\"plugins,omitempty\"`\n\tPolicies []externalBufLockFilePolicyV2 `json:\"policies,omitempty\" yaml:\"policies,omitempty\"`\n}\n\n// externalBufLockFileDepV2 represents a single dep within a v2 buf.lock file.\ntype externalBufLockFileDepV2 struct {\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\t// Dashless\n\tCommit string `json:\"commit,omitempty\" yaml:\"commit,omitempty\"`\n\tDigest string `json:\"digest,omitempty\" yaml:\"digest,omitempty\"`\n}\n\ntype externalBufLockFilePolicyV2 struct {\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\t// Dashless\n\tCommit  string                     `json:\"commit,omitempty\" yaml:\"commit,omitempty\"`\n\tDigest  string                     `json:\"digest,omitempty\" yaml:\"digest,omitempty\"`\n\tPlugins []externalBufLockFileDepV2 `json:\"plugins,omitempty\" yaml:\"plugins,omitempty\"`\n}\n\ntype bufLockFileOptions struct {\n\tdigestResolver func(\n\t\tctx context.Context,\n\t\tremote string,\n\t\tcommitID uuid.UUID,\n\t) (bufmodule.Digest, error)\n}\n\nfunc newBufLockFileOptions() *bufLockFileOptions {\n\treturn &bufLockFileOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_lock_file_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestReadWriteBufLockFileRoundTrip(t *testing.T) {\n\tt.Parallel()\n\n\ttestReadWriteBufLockFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\n`,\n\t\t// expected output\n\t\t`version: v2\n`,\n\t)\n\n\ttestReadWriteBufLockFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\ndeps:\n  - name: buf.testing/acme/date\n    commit: ffded0b4cf6b47cab74da08d291a3c2f\n    digest: b5:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n  - name: buf.testing/acme/extension\n    commit: 6d880cc6cc8d4131bdb5a51399df8faf\n    digest: b5:d2c1da8f8331c5c75b50549c79fc360394dedfb6a11f5381c4523592018964119f561088fc8aaddfc9f5773ba02692e6fd9661853450f76a3355dec62c1f57b4\nplugins:\n  - name: buf.testing/acme/plugin\n    commit: ffded0b4cf6b47cab74da08d291a3c2f\n    digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\npolicies:\n  - name: buf.testing/acme/policy\n    commit: b8488077ea6d4f6d9562a337b98259c8\n    digest: o1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n    plugins:\n      - name: buf.testing/acme/plugin\n        commit: ffded0b4cf6b47cab74da08d291a3c2f\n        digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n`,\n\t\t// expected output\n\t\t`version: v2\ndeps:\n  - name: buf.testing/acme/date\n    commit: ffded0b4cf6b47cab74da08d291a3c2f\n    digest: b5:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n  - name: buf.testing/acme/extension\n    commit: 6d880cc6cc8d4131bdb5a51399df8faf\n    digest: b5:d2c1da8f8331c5c75b50549c79fc360394dedfb6a11f5381c4523592018964119f561088fc8aaddfc9f5773ba02692e6fd9661853450f76a3355dec62c1f57b4\nplugins:\n  - name: buf.testing/acme/plugin\n    commit: ffded0b4cf6b47cab74da08d291a3c2f\n    digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\npolicies:\n  - name: buf.testing/acme/policy\n    commit: b8488077ea6d4f6d9562a337b98259c8\n    digest: o1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n    plugins:\n      - name: buf.testing/acme/plugin\n        commit: ffded0b4cf6b47cab74da08d291a3c2f\n        digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n`,\n\t)\n\n\t// Test a buf.lock file with a local policy file with remote plugins.\n\ttestReadWriteBufLockFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\npolicies:\n  - name: buf.policy.yaml\n    plugins:\n      - name: buf.testing/acme/plugin\n        commit: ffded0b4cf6b47cab74da08d291a3c2f\n        digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n  - name: buf.testing/acme/policy\n    commit: ffded0b4cf6b47cab74da08d291a3c2f\n    digest: o1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n    plugins:\n      - name: buf.testing/acme/plugin\n        commit: ffded0b4cf6b47cab74da08d291a3c2f\n        digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n`,\n\t\t// expected output\n\t\t`version: v2\npolicies:\n  - name: buf.policy.yaml\n    plugins:\n      - name: buf.testing/acme/plugin\n        commit: ffded0b4cf6b47cab74da08d291a3c2f\n        digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n  - name: buf.testing/acme/policy\n    commit: ffded0b4cf6b47cab74da08d291a3c2f\n    digest: o1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n    plugins:\n      - name: buf.testing/acme/plugin\n        commit: ffded0b4cf6b47cab74da08d291a3c2f\n        digest: p1:24ed4f13925cf89ea0ae0127fa28540704c7ae14750af027270221b737a1ce658f8014ca2555f6f7fcd95ea84e071d33f37f86cc36d07fe0d0963329a5ec2462\n`,\n\t)\n}\n\nfunc testReadBufLockFile(\n\tt *testing.T,\n\tinputBufLockFileData string,\n) BufLockFile {\n\tbufLockFile, err := ReadBufLockFile(\n\t\tt.Context(),\n\t\tstrings.NewReader(testCleanYAMLData(inputBufLockFileData)),\n\t\tDefaultBufLockFileName,\n\t)\n\trequire.NoError(t, err)\n\treturn bufLockFile\n}\n\nfunc testReadWriteBufLockFileRoundTrip(\n\tt *testing.T,\n\tinputBufLockFileData string,\n\texpectedOutputBufLockFileData string,\n) {\n\tbufLockFile := testReadBufLockFile(t, inputBufLockFileData)\n\tbuffer := bytes.NewBuffer(nil)\n\terr := WriteBufLockFile(buffer, bufLockFile)\n\trequire.NoError(t, err)\n\toutputBufLockData := testCleanYAMLData(buffer.String())\n\toutputBufLockData = strings.TrimPrefix(outputBufLockData, \"# Generated by buf. DO NOT EDIT.\\n\")\n\tassert.Equal(t, testCleanYAMLData(expectedOutputBufLockFileData), outputBufLockData, \"output:\\n%s\", outputBufLockData)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_work_yaml_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"slices\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// DefaultBufWorkYAMLFileName is the default buf.work.yaml file name.\n\tDefaultBufWorkYAMLFileName = \"buf.work.yaml\"\n\n\t// Originally we thought we were going to move to buf.work, and had this around for\n\t// a while, but then reverted back to buf.work.yaml. We still need to support buf.work as\n\t// we released with it, however.\n\toldBufWorkYAMLFileName = \"buf.work\"\n\n\tdefaultBufWorkYAMLFileVersion = FileVersionV1\n)\n\nvar (\n\t// ordered\n\tbufWorkYAMLFileNames = []string{DefaultBufWorkYAMLFileName, oldBufWorkYAMLFileName}\n\t// We only supported buf.work.yamls in v1.\n\tbufWorkYAMLFileNameToSupportedFileVersions = map[string]map[FileVersion]struct{}{\n\t\tDefaultBufWorkYAMLFileName: {\n\t\t\tFileVersionV1: struct{}{},\n\t\t},\n\t\toldBufWorkYAMLFileName: {\n\t\t\tFileVersionV1: struct{}{},\n\t\t},\n\t}\n)\n\n// BufWorkYAMLFile represents a buf.work.yaml file.\n//\n// For v2, buf.work.yaml files have been eliminated.\n// There was never a v1beta1 buf.work.yaml.\ntype BufWorkYAMLFile interface {\n\tFile\n\n\t// DirPaths returns all the directory paths specified in buf.work.yaml,\n\t// relative to the directory with buf.work.yaml. The following are guaranteed:\n\t//\n\t// - There is at least one path, i.e. DirPaths() will never be empty..\n\t// - There are no duplicate paths - all values of DirPaths() are unique.\n\t// - No path contains another path, i.e. \"foo\" and \"foo/bar\" will not be in DirPaths().\n\t// - \".\" is not in DirPaths().\n\t// - Each path is normalized and validated, because this is guaranteed at the\n\t//   construction time of a BufWorkYAMLFile.\n\t//\n\t// Returned paths are sorted.\n\tDirPaths() []string\n\n\tisBufWorkYAMLFile()\n}\n\n// NewBufWorkYAMLFile returns a new validated BufWorkYAMLFile.\nfunc NewBufWorkYAMLFile(fileVersion FileVersion, dirPaths []string) (BufWorkYAMLFile, error) {\n\treturn newBufWorkYAMLFile(fileVersion, nil, dirPaths)\n}\n\n// GetBufWorkYAMLFileForPrefix gets the buf.work.yaml file at the given bucket prefix.\n//\n// The buf.work.yaml file will be attempted to be read at prefix/buf.work.yaml.\nfunc GetBufWorkYAMLFileForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (BufWorkYAMLFile, error) {\n\treturn getFileForPrefix(ctx, bucket, prefix, bufWorkYAMLFileNames, bufWorkYAMLFileNameToSupportedFileVersions, readBufWorkYAMLFile)\n}\n\n// GetBufWorkYAMLFileVersionForPrefix gets the buf.work.yaml file version at the given bucket prefix.\n//\n// The buf.work.yaml file will be attempted to be read at prefix/buf.work.yaml.\nfunc GetBufWorkYAMLFileVersionForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (FileVersion, error) {\n\treturn getFileVersionForPrefix(ctx, bucket, prefix, bufWorkYAMLFileNames, bufWorkYAMLFileNameToSupportedFileVersions, true, FileVersionV1, defaultBufWorkYAMLFileVersion)\n}\n\n// PutBufWorkYAMLFileForPrefix puts the buf.work.yaml file at the given bucket prefix.\n//\n// The buf.work.yaml file will be attempted to be written to prefix/buf.work.yaml.\n// The buf.work.yaml file will be written atomically.\nfunc PutBufWorkYAMLFileForPrefix(\n\tctx context.Context,\n\tbucket storage.WriteBucket,\n\tprefix string,\n\tbufYAMLFile BufWorkYAMLFile,\n) error {\n\treturn putFileForPrefix(ctx, bucket, prefix, bufYAMLFile, DefaultBufWorkYAMLFileName, bufWorkYAMLFileNameToSupportedFileVersions, writeBufWorkYAMLFile)\n}\n\n// ReadBufWorkYAMLFile reads the buf.work.yaml file from the io.Reader.\n//\n// fileName may be empty.\nfunc ReadBufWorkYAMLFile(reader io.Reader, fileName string) (BufWorkYAMLFile, error) {\n\treturn readFile(reader, fileName, readBufWorkYAMLFile)\n}\n\n// WriteBufWorkYAMLFile writes the buf.work.yaml to the io.Writer.\nfunc WriteBufWorkYAMLFile(writer io.Writer, bufWorkYAMLFile BufWorkYAMLFile) error {\n\treturn writeFile(writer, bufWorkYAMLFile, writeBufWorkYAMLFile)\n}\n\n// *** PRIVATE ***\n\ntype bufWorkYAMLFile struct {\n\tfileVersion FileVersion\n\tobjectData  ObjectData\n\tdirPaths    []string\n}\n\nfunc newBufWorkYAMLFile(fileVersion FileVersion, objectData ObjectData, dirPaths []string) (*bufWorkYAMLFile, error) {\n\tif fileVersion != FileVersionV1 {\n\t\treturn nil, newUnsupportedFileVersionError(\"\", fileVersion)\n\t}\n\tsortedNormalizedDirPaths, err := validateBufWorkYAMLDirPaths(dirPaths)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &bufWorkYAMLFile{\n\t\tfileVersion: fileVersion,\n\t\tobjectData:  objectData,\n\t\tdirPaths:    sortedNormalizedDirPaths,\n\t}, nil\n}\n\nfunc (w *bufWorkYAMLFile) FileVersion() FileVersion {\n\treturn w.fileVersion\n}\n\nfunc (*bufWorkYAMLFile) FileType() FileType {\n\treturn FileTypeBufWorkYAML\n}\n\nfunc (w *bufWorkYAMLFile) ObjectData() ObjectData {\n\treturn w.objectData\n}\n\nfunc (w *bufWorkYAMLFile) DirPaths() []string {\n\treturn slices.Clone(w.dirPaths)\n}\n\nfunc (*bufWorkYAMLFile) isBufWorkYAMLFile() {}\nfunc (*bufWorkYAMLFile) isFile()            {}\nfunc (*bufWorkYAMLFile) isFileInfo()        {}\n\nfunc readBufWorkYAMLFile(\n\tdata []byte,\n\tobjectData ObjectData,\n\tallowJSON bool,\n) (BufWorkYAMLFile, error) {\n\t// We've always required a file version for buf.work.yamls.\n\tfileVersion, err := getFileVersionForData(data, allowJSON, true, bufWorkYAMLFileNameToSupportedFileVersions, FileVersionV1, defaultBufWorkYAMLFileVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif fileVersion != FileVersionV1 {\n\t\treturn nil, newUnsupportedFileVersionError(objectData.Name(), fileVersion)\n\t}\n\tvar externalBufWorkYAMLFile externalBufWorkYAMLFileV1\n\tif err := getUnmarshalStrict(allowJSON)(data, &externalBufWorkYAMLFile); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newBufWorkYAMLFile(fileVersion, objectData, externalBufWorkYAMLFile.Directories)\n}\n\nfunc writeBufWorkYAMLFile(writer io.Writer, bufWorkYAMLFile BufWorkYAMLFile) error {\n\tfileVersion := bufWorkYAMLFile.FileVersion()\n\tif fileVersion != FileVersionV1 {\n\t\t// This is effectively a system error.\n\t\treturn syserror.Wrap(newUnsupportedFileVersionError(\"\", fileVersion))\n\t}\n\texternalBufWorkYAMLFile := externalBufWorkYAMLFileV1{\n\t\tVersion: fileVersion.String(),\n\t\t// No need to sort - DirPaths() is already sorted per the documentation on BufWorkYAMLFile\n\t\tDirectories: bufWorkYAMLFile.DirPaths(),\n\t}\n\tdata, err := encoding.MarshalYAML(&externalBufWorkYAMLFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = writer.Write(data)\n\treturn err\n}\n\n// validateBufWorkYAMLDirPaths validates dirPaths and returns normalized and\n// sorted dirPaths.\nfunc validateBufWorkYAMLDirPaths(dirPaths []string) ([]string, error) {\n\tif len(dirPaths) == 0 {\n\t\treturn nil, fmt.Errorf(`directories is empty`)\n\t}\n\tnormalizedDirPathToDirPath := make(map[string]string, len(dirPaths))\n\tfor _, dirPath := range dirPaths {\n\t\tnormalizedDirPath, err := normalpath.NormalizeAndValidate(dirPath)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(`directory %q is invalid: %w`, dirPath, err)\n\t\t}\n\t\tif _, ok := normalizedDirPathToDirPath[normalizedDirPath]; ok {\n\t\t\treturn nil, fmt.Errorf(`directory %q is listed more than once`, dirPath)\n\t\t}\n\t\tif normalizedDirPath == \".\" {\n\t\t\treturn nil, fmt.Errorf(`directory \".\" is listed, it is not valid to have \".\" as a workspace directory, as this is no different than not having a workspace at all, see https://buf.build/docs/reference/workspaces/#directories for more details`)\n\t\t}\n\t\tnormalizedDirPathToDirPath[normalizedDirPath] = dirPath\n\t}\n\t// We already know the paths are unique due to above validation.\n\t// We sort to print deterministic errors.\n\tsortedNormalizedDirPaths := xslices.MapKeysToSortedSlice(normalizedDirPathToDirPath)\n\tfor i := range sortedNormalizedDirPaths {\n\t\tfor j := i + 1; j < len(sortedNormalizedDirPaths); j++ {\n\t\t\tleft := sortedNormalizedDirPaths[i]\n\t\t\tright := sortedNormalizedDirPaths[j]\n\t\t\tif normalpath.ContainsPath(left, right, normalpath.Relative) {\n\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t`directory %q contains directory %q`,\n\t\t\t\t\tnormalizedDirPathToDirPath[left],\n\t\t\t\t\tnormalizedDirPathToDirPath[right],\n\t\t\t\t)\n\t\t\t}\n\t\t\tif normalpath.ContainsPath(right, left, normalpath.Relative) {\n\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t`directory %q contains directory %q`,\n\t\t\t\t\tnormalizedDirPathToDirPath[right],\n\t\t\t\t\tnormalizedDirPathToDirPath[left],\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn sortedNormalizedDirPaths, nil\n}\n\n// externalBufWorkYAMLFileV1 represents the v1 buf.work.yaml file.\ntype externalBufWorkYAMLFileV1 struct {\n\tVersion     string   `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tDirectories []string `json:\"directories,omitempty\" yaml:\"directories,omitempty\"`\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_work_yaml_file_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestPutAndGetBufWorkYAMLFileForPrefix(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tbufWorkYAMLFile, err := NewBufWorkYAMLFile(FileVersionV1, []string{\"foo\", \"bar\"})\n\trequire.NoError(t, err)\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\terr = PutBufWorkYAMLFileForPrefix(ctx, readWriteBucket, \"pre\", bufWorkYAMLFile)\n\trequire.NoError(t, err)\n\t_, err = GetBufWorkYAMLFileForPrefix(ctx, readWriteBucket, \".\")\n\trequire.Error(t, err)\n\treadBufWorkYAMLFile, err := GetBufWorkYAMLFileForPrefix(ctx, readWriteBucket, \"pre\")\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\"bar\", \"foo\"},\n\t\treadBufWorkYAMLFile.DirPaths(),\n\t)\n}\n\nfunc TestReadBufWorkYAMLFileValidateVersion(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\ttestcases := []struct {\n\t\tdescription      string\n\t\tprefix           string\n\t\tcontent          string\n\t\tisErr            bool\n\t\texpectedDirPaths []string\n\t}{\n\t\t{\n\t\t\tdescription: \"current_directory\",\n\t\t\tprefix:      \".\",\n\t\t\tcontent: `version: v1\ndirectories:\n  - foo\n  - bar\n`,\n\t\t\texpectedDirPaths: []string{\"bar\", \"foo\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"sub_directory\",\n\t\t\tprefix:      \"path\",\n\t\t\tcontent: `version: v1\ndirectories:\n  - foo\n`,\n\t\t\texpectedDirPaths: []string{\"foo\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"invalid_version\",\n\t\t\tprefix:      \".\",\n\t\t\tcontent: `version: 1\ndirectories:\n  - foo\n`,\n\t\t\tisErr: true,\n\t\t},\n\t}\n\tfor _, testcase := range testcases {\n\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\treadBucket, err := storagemem.NewReadBucket(\n\t\t\t\tmap[string][]byte{\n\t\t\t\t\tfilepath.Join(testcase.prefix, \"buf.work.yaml\"): []byte(testcase.content),\n\t\t\t\t},\n\t\t\t)\n\t\t\trequire.NoError(t, err)\n\t\t\tbufWorkYAMLFile, err := GetBufWorkYAMLFileForPrefix(ctx, readBucket, testcase.prefix)\n\t\t\tif testcase.isErr {\n\t\t\t\trequire.Error(t, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.Equal(t, testcase.expectedDirPaths, bufWorkYAMLFile.DirPaths())\n\t\t})\n\t}\n}\n\nfunc TestNewBufWorkYAMLFile(t *testing.T) {\n\tt.Parallel()\n\ttestcases := []struct {\n\t\tdescription      string\n\t\tversion          FileVersion\n\t\tdirPaths         []string\n\t\texpectedDirPaths []string\n\t}{\n\t\t{\n\t\t\tdescription:      \"one_dir_path\",\n\t\t\tversion:          FileVersionV1,\n\t\t\tdirPaths:         []string{\"foo\"},\n\t\t\texpectedDirPaths: []string{\"foo\"},\n\t\t},\n\t\t{\n\t\t\tdescription:      \"sort\",\n\t\t\tversion:          FileVersionV1,\n\t\t\tdirPaths:         []string{\"foo\", \"baz\", \"bat\", \"bar\"},\n\t\t\texpectedDirPaths: []string{\"bar\", \"bat\", \"baz\", \"foo\"},\n\t\t},\n\t\t{\n\t\t\tdescription:      \"sort_and_normalize\",\n\t\t\tversion:          FileVersionV1,\n\t\t\tdirPaths:         []string{\"bat\", \"./baz\", \"./bar/../bar\", \"foo\"},\n\t\t\texpectedDirPaths: []string{\"bar\", \"bat\", \"baz\", \"foo\"},\n\t\t},\n\t}\n\tfor _, testcase := range testcases {\n\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tbufWorkYAMLFile, err := NewBufWorkYAMLFile(testcase.version, testcase.dirPaths)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.Equal(t, testcase.expectedDirPaths, bufWorkYAMLFile.DirPaths())\n\t\t})\n\t}\n}\n\nfunc TestNewWorkYAMLFileFail(t *testing.T) {\n\tt.Parallel()\n\ttestcases := []struct {\n\t\tdescription string\n\t\tversion     FileVersion\n\t\tdirPaths    []string\n\t}{\n\t\t{\n\t\t\tdescription: \"empty_dirPaths\",\n\t\t\tversion:     FileVersionV1,\n\t\t\tdirPaths:    []string{},\n\t\t},\n\t\t{\n\t\t\tdescription: \"duplicate_dirPaths\",\n\t\t\tversion:     FileVersionV1,\n\t\t\tdirPaths:    []string{\"foo\", \"bar\", \"foo\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"duplicate_dirPaths_different_forms\",\n\t\t\tversion:     FileVersionV1,\n\t\t\tdirPaths:    []string{\"foo\", \"./foo\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"overlapping_dirPaths\",\n\t\t\tversion:     FileVersionV1,\n\t\t\tdirPaths:    []string{\"foo\", \"bar\", \"foo/baz\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"overlapping_dirPaths_with_dot\",\n\t\t\tversion:     FileVersionV1,\n\t\t\tdirPaths:    []string{\"foo\", \"bar\", \"./foo/baz\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"current_directory\",\n\t\t\tversion:     FileVersionV1,\n\t\t\tdirPaths:    []string{\"foo\", \".\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"invalid_version_v1beta1\",\n\t\t\tversion:     FileVersionV1Beta1,\n\t\t\tdirPaths:    []string{\"foo\", \"bar\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"invalid_version_v2\",\n\t\t\tversion:     FileVersionV2,\n\t\t\tdirPaths:    []string{\"foo\", \"bar\"},\n\t\t},\n\t}\n\tfor _, testcase := range testcases {\n\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\t_, err := NewBufWorkYAMLFile(testcase.version, testcase.dirPaths)\n\t\t\trequire.Error(t, err)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_yaml_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\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\"path/filepath\"\n\t\"slices\"\n\t\"sort\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// DefaultBufYAMLFileName is the default buf.yaml file name.\n\tDefaultBufYAMLFileName = \"buf.yaml\"\n\n\t// Originally we thought we were going to move to buf.mod, and had this around for\n\t// a while, but then reverted back to buf.yaml. We still need to support buf.mod as\n\t// we released with it, however.\n\toldBufYAMLFileName        = \"buf.mod\"\n\tdefaultBufYAMLFileVersion = FileVersionV1Beta1\n\tdocsLinkComment           = \"# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/%s/buf-yaml\"\n)\n\nvar (\n\t// ordered\n\tbufYAMLFileNames                       = []string{DefaultBufYAMLFileName, oldBufYAMLFileName}\n\tbufYAMLFileNameToSupportedFileVersions = map[string]map[FileVersion]struct{}{\n\t\tDefaultBufYAMLFileName: {\n\t\t\tFileVersionV1Beta1: struct{}{},\n\t\t\tFileVersionV1:      struct{}{},\n\t\t\tFileVersionV2:      struct{}{},\n\t\t},\n\t\toldBufYAMLFileName: {\n\t\t\tFileVersionV1Beta1: struct{}{},\n\t\t\tFileVersionV1:      struct{}{},\n\t\t},\n\t}\n)\n\n// BufYAMLFile represents a buf.yaml file.\ntype BufYAMLFile interface {\n\tFile\n\n\t// ModuleConfigs returns the ModuleConfigs for the File.\n\t//\n\t// For v1 buf.yaml, this will only have a single ModuleConfig.\n\t//\n\t// This will always be non-empty.\n\t// All ModuleConfigs will have unique FullNames, but not necessarily\n\t// unique DirPaths.\n\t//\n\t// The module configs are sorted by DirPath. If two module configs have the\n\t// same DirPath, the order defined in the external file is used to break the tie.\n\t// For example, if in the buf.yaml there are:\n\t// - path: foo\n\t//   module: buf.build/acme/foobaz\n\t//   ...\n\t// - path: foo\n\t//   module: buf.build/acme/foobar\n\t//   ...\n\t// Then in ModuleConfigs, the config with buf.build/acme/foobaz still comes before buf.build/acme/foobar,\n\t// because it comes earlier in the buf.yaml. This also gives a deterministic order of ModuleConfigs.\n\tModuleConfigs() []ModuleConfig\n\t// TopLevelLintConfig returns the top-level LintConfig for the File.\n\t//\n\t// For v1 buf.yaml files, there is only ever a single LintConfig, so this is returned.\n\t// For v2 buf.yaml files, if a top-level lint config exists, then it will be the top-level\n\t// lint config. Otherwise, this will return nil, so callers should be aware this may be\n\t// empty.\n\tTopLevelLintConfig() LintConfig\n\t// TopLevelBreakingConfig returns the top-level BreakingConfig for the File.\n\t//\n\t// For v1 buf.yaml files, there is only ever a single BreakingConfig, so this is returned.\n\t// For v2 buf.yaml files, if a top-level breaking config exists, then it will be the top-level\n\t// breaking config. Otherwise, this will return nil, so callers should be aware this may be\n\t// empty.\n\tTopLevelBreakingConfig() BreakingConfig\n\t// PluginConfigs returns the PluginConfigs for the File.\n\t//\n\t// For v1 buf.yaml files, this will always return nil.\n\tPluginConfigs() []PluginConfig\n\t// PolicyConfigs returns the PolicyConfigs for the File.\n\t//\n\t// For v1 buf.yaml files, this will always return nil.\n\tPolicyConfigs() []PolicyConfig\n\t// ConfiguredDepModuleRefs returns the configured dependencies of the Workspace as ModuleRefs.\n\t//\n\t// These come from buf.yaml files.\n\t//\n\t// The ModuleRefs in this list will be unique by FullName.\n\t// Sorted by FullName.\n\tConfiguredDepModuleRefs() []bufparse.Ref\n\t//IncludeDocsLink specifies whether a top-level comment with a link to our public docs\n\t// should be included at the top of the buf.yaml file.\n\tIncludeDocsLink() bool\n\n\tisBufYAMLFile()\n}\n\n// NewBufYAMLFile returns a new validated BufYAMLFile.\n//\n// This should generally not be used outside of testing - use GetBufYAMLFileForPrefix instead.\nfunc NewBufYAMLFile(\n\tfileVersion FileVersion,\n\tmoduleConfigs []ModuleConfig,\n\tpluginConfigs []PluginConfig,\n\tpolicyConfigs []PolicyConfig,\n\tconfiguredDepModuleRefs []bufparse.Ref,\n\toptions ...BufYAMLFileOption,\n) (BufYAMLFile, error) {\n\tbufYAMLFileOptions := newBufYAMLFileOptions()\n\tfor _, option := range options {\n\t\toption(bufYAMLFileOptions)\n\t}\n\treturn newBufYAMLFile(\n\t\tfileVersion,\n\t\tnil,\n\t\tmoduleConfigs,\n\t\tnil, // Do not set top-level lint config, use only module configs\n\t\tnil, // Do not set top-level breaking config, use only module configs\n\t\tpluginConfigs,\n\t\tpolicyConfigs,\n\t\tconfiguredDepModuleRefs,\n\t\tbufYAMLFileOptions.includeDocsLink,\n\t)\n}\n\n// BufYAMLFileOption is an option for a new BufYAMLFile\ntype BufYAMLFileOption func(*bufYAMLFileOptions)\n\n// BufYAMLFileWithIncludeDocsLink returns a new BufYAMLFileOption that specifies including\n// a comment with a link to the public docs for the appropriate buf.yaml version at the top\n// of the buf.yaml file.\nfunc BufYAMLFileWithIncludeDocsLink() BufYAMLFileOption {\n\treturn func(bufYAMLFileOptions *bufYAMLFileOptions) {\n\t\tbufYAMLFileOptions.includeDocsLink = true\n\t}\n}\n\n// GetBufYAMLFileForPrefix gets the buf.yaml file at the given bucket prefix.\n//\n// The buf.yaml file will be attempted to be read at prefix/buf.yaml.\nfunc GetBufYAMLFileForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (BufYAMLFile, error) {\n\treturn getFileForPrefix(ctx, bucket, prefix, bufYAMLFileNames, bufYAMLFileNameToSupportedFileVersions, readBufYAMLFile)\n}\n\n// GetBufYAMLFileForOverride get the buf.yaml file for either the usually-flag-based override.\n//\n//   - If the override is set and ends in .json, .yaml, or .yml, the override is treated as a\n//     **direct file path on disk** and read (ie not via buckets).\n//   - If the override is otherwise non-empty, it is treated as raw data.\n//\n// This function is the result of the endlessly annoying and shortsighted design decision that the\n// original author of this repository made to allow overriding configuration files on the command line.\n// Of course, the original author never envisioned buf.work.yamls, merging buf.work.yamls into buf.yamls,\n// buf.gen.yamls, or anything of the like, and was very concentrated on \"because Bazel.\"\nfunc GetBufYAMLFileForOverride(override string) (BufYAMLFile, error) {\n\tvar data []byte\n\tvar fileName string\n\tvar err error\n\tswitch filepath.Ext(override) {\n\tcase \".json\", \".yaml\", \".yml\":\n\t\tdata, err = os.ReadFile(override)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not read file: %v\", err)\n\t\t}\n\t\tfileName = filepath.Base(fileName)\n\tdefault:\n\t\tdata = []byte(override)\n\t}\n\treturn readFile(bytes.NewReader(data), fileName, readBufYAMLFile)\n}\n\n// GetBufYAMLFileForPrefixOrOverride get the buf.yaml file for either the usually-flag-based override,\n// or if the override is not set, falls back to the prefix.\nfunc GetBufYAMLFileForPrefixOrOverride(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\toverride string,\n) (BufYAMLFile, error) {\n\tif override != \"\" {\n\t\treturn GetBufYAMLFileForOverride(override)\n\t}\n\treturn GetBufYAMLFileForPrefix(ctx, bucket, prefix)\n}\n\n// GetBufYAMLFileVersionForPrefix gets the buf.yaml file version at the given bucket prefix.\n//\n// The buf.yaml file will be attempted to be read at prefix/buf.yaml.\nfunc GetBufYAMLFileVersionForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (FileVersion, error) {\n\treturn getFileVersionForPrefix(ctx, bucket, prefix, bufYAMLFileNames, bufYAMLFileNameToSupportedFileVersions, true, FileVersionV2, defaultBufYAMLFileVersion)\n}\n\n// PutBufYAMLFileForPrefix puts the buf.yaml file at the given bucket prefix.\n//\n// The buf.yaml file will be attempted to be written to prefix/buf.yaml.\n// The buf.yaml file will be written atomically.\nfunc PutBufYAMLFileForPrefix(\n\tctx context.Context,\n\tbucket storage.WriteBucket,\n\tprefix string,\n\tbufYAMLFile BufYAMLFile,\n) error {\n\treturn putFileForPrefix(ctx, bucket, prefix, bufYAMLFile, DefaultBufYAMLFileName, bufYAMLFileNameToSupportedFileVersions, writeBufYAMLFile)\n}\n\n// ReadBufYAMLFile reads the BufYAMLFile from the io.Reader.\n//\n// fileName may be empty.\nfunc ReadBufYAMLFile(reader io.Reader, fileName string) (BufYAMLFile, error) {\n\treturn readFile(reader, fileName, readBufYAMLFile)\n}\n\n// WriteBufYAMLFile writes the BufYAMLFile to the io.Writer.\nfunc WriteBufYAMLFile(writer io.Writer, bufYAMLFile BufYAMLFile) error {\n\treturn writeFile(writer, bufYAMLFile, writeBufYAMLFile)\n}\n\n// *** PRIVATE ***\n\ntype bufYAMLFile struct {\n\tfileVersion             FileVersion\n\tobjectData              ObjectData\n\tmoduleConfigs           []ModuleConfig\n\ttopLevelLintConfig      LintConfig\n\ttopLevelBreakingConfig  BreakingConfig\n\tpluginConfigs           []PluginConfig\n\tpolicyConfigs           []PolicyConfig\n\tconfiguredDepModuleRefs []bufparse.Ref\n\tincludeDocsLink         bool\n}\n\nfunc newBufYAMLFile(\n\tfileVersion FileVersion,\n\tobjectData ObjectData,\n\tmoduleConfigs []ModuleConfig,\n\ttopLevelLintConfig LintConfig,\n\ttopLevelBreakingConfig BreakingConfig,\n\tpluginConfigs []PluginConfig,\n\tpolicyConfigs []PolicyConfig,\n\tconfiguredDepModuleRefs []bufparse.Ref,\n\tincludeDocsLink bool,\n) (*bufYAMLFile, error) {\n\tif (fileVersion == FileVersionV1Beta1 || fileVersion == FileVersionV1) && len(moduleConfigs) > 1 {\n\t\treturn nil, fmt.Errorf(\"had %d ModuleConfigs passed to NewBufYAMLFile for FileVersion %v\", len(moduleConfigs), fileVersion)\n\t}\n\t// At this point, if there are multiple moduleConfigs, we know the version must be v2 and we do not\n\t// need to check for duplicate DirPaths because they are allowed in v2.\n\tif len(moduleConfigs) == 0 {\n\t\treturn nil, errors.New(\"had 0 ModuleConfigs passed to NewBufYAMLFile\")\n\t}\n\tfor _, moduleConfig := range moduleConfigs {\n\t\tif (fileVersion == FileVersionV1Beta1 || fileVersion == FileVersionV1) && moduleConfig.DirPath() != \".\" {\n\t\t\treturn nil, fmt.Errorf(\"invalid DirPath %q in NewBufYAMLFile for %v ModuleConfig\", moduleConfig.DirPath(), fileVersion)\n\t\t}\n\t\tif moduleConfig == nil {\n\t\t\treturn nil, errors.New(\"ModuleConfig was nil in NewBufYAMLFile\")\n\t\t}\n\t\tif fileVersion != moduleConfig.LintConfig().FileVersion() {\n\t\t\treturn nil, fmt.Errorf(\"FileVersion %v was passed to NewBufYAMLFile but had LintConfig FileVersion %v\", fileVersion, moduleConfig.LintConfig().FileVersion())\n\t\t}\n\t\tif fileVersion != moduleConfig.BreakingConfig().FileVersion() {\n\t\t\treturn nil, fmt.Errorf(\"FileVersion %v was passed to NewBufYAMLFile but had BreakingConfig FileVersion %v\", fileVersion, moduleConfig.BreakingConfig().FileVersion())\n\t\t}\n\t}\n\t// Zero values are not added to duplicates.\n\tif _, err := bufparse.FullNameStringToUniqueValue(moduleConfigs); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := bufparse.FullNameStringToUniqueValue(configuredDepModuleRefs); err != nil {\n\t\treturn nil, err\n\t}\n\t// Since multiple module configs with the same DirPath are allowed in v2, we need a stable sort\n\t// so that the relative order among module configs with the same DirPath is preserved from the\n\t// external buf.yaml, as specified in BufYAMLFile.ModuleConfigs' doc.\n\tsort.SliceStable(\n\t\tmoduleConfigs,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn moduleConfigs[i].DirPath() < moduleConfigs[j].DirPath()\n\t\t},\n\t)\n\tsort.Slice(\n\t\tconfiguredDepModuleRefs,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn configuredDepModuleRefs[i].FullName().String() <\n\t\t\t\tconfiguredDepModuleRefs[j].FullName().String()\n\t\t},\n\t)\n\treturn &bufYAMLFile{\n\t\tfileVersion:             fileVersion,\n\t\tobjectData:              objectData,\n\t\tmoduleConfigs:           moduleConfigs,\n\t\ttopLevelLintConfig:      topLevelLintConfig,\n\t\ttopLevelBreakingConfig:  topLevelBreakingConfig,\n\t\tpluginConfigs:           pluginConfigs,\n\t\tpolicyConfigs:           policyConfigs,\n\t\tconfiguredDepModuleRefs: configuredDepModuleRefs,\n\t\tincludeDocsLink:         includeDocsLink,\n\t}, nil\n}\n\nfunc (c *bufYAMLFile) FileVersion() FileVersion {\n\treturn c.fileVersion\n}\n\nfunc (*bufYAMLFile) FileType() FileType {\n\treturn FileTypeBufYAML\n}\n\nfunc (c *bufYAMLFile) ObjectData() ObjectData {\n\treturn c.objectData\n}\n\nfunc (c *bufYAMLFile) ModuleConfigs() []ModuleConfig {\n\treturn slices.Clone(c.moduleConfigs)\n}\n\nfunc (c *bufYAMLFile) TopLevelLintConfig() LintConfig {\n\treturn c.topLevelLintConfig\n}\n\nfunc (c *bufYAMLFile) TopLevelBreakingConfig() BreakingConfig {\n\treturn c.topLevelBreakingConfig\n}\n\nfunc (c *bufYAMLFile) PluginConfigs() []PluginConfig {\n\treturn c.pluginConfigs\n}\n\nfunc (c *bufYAMLFile) PolicyConfigs() []PolicyConfig {\n\treturn c.policyConfigs\n}\n\nfunc (c *bufYAMLFile) ConfiguredDepModuleRefs() []bufparse.Ref {\n\treturn slices.Clone(c.configuredDepModuleRefs)\n}\n\nfunc (c *bufYAMLFile) IncludeDocsLink() bool {\n\treturn c.includeDocsLink\n}\n\nfunc (*bufYAMLFile) isBufYAMLFile() {}\nfunc (*bufYAMLFile) isFile()        {}\nfunc (*bufYAMLFile) isFileInfo()    {}\n\ntype bufYAMLFileOptions struct {\n\tincludeDocsLink bool\n}\n\nfunc newBufYAMLFileOptions() *bufYAMLFileOptions {\n\treturn &bufYAMLFileOptions{}\n}\n\nfunc readBufYAMLFile(\n\tdata []byte,\n\tobjectData ObjectData,\n\tallowJSON bool,\n) (BufYAMLFile, error) {\n\t// We've always required a file version for buf.yaml files.\n\tfileVersion, err := getFileVersionForData(data, allowJSON, true, bufYAMLFileNameToSupportedFileVersions, FileVersionV2, defaultBufYAMLFileVersion)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Check if this file has the docs link comment from \"buf config init\" as its first line\n\t// so we can preserve the comment in our round trip.\n\tincludeDocsLink := bytes.HasPrefix(data, fmt.Appendf(nil, docsLinkComment, fileVersion.String()))\n\tswitch fileVersion {\n\tcase FileVersionV1Beta1, FileVersionV1:\n\t\tvar externalBufYAMLFile externalBufYAMLFileV1Beta1V1\n\t\tif err := getUnmarshalStrict(allowJSON)(data, &externalBufYAMLFile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif fileVersion == FileVersionV1 && len(externalBufYAMLFile.Build.Roots) > 0 {\n\t\t\treturn nil, fmt.Errorf(\"build.roots cannot be set on version %v: %v\", fileVersion, externalBufYAMLFile.Build.Roots)\n\t\t}\n\t\tvar moduleFullName bufparse.FullName\n\t\tif externalBufYAMLFile.Name != \"\" {\n\t\t\tmoduleFullName, err = bufparse.ParseFullName(externalBufYAMLFile.Name)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\trootToExcludes, err := getRootToExcludes(externalBufYAMLFile.Build.Roots, externalBufYAMLFile.Build.Excludes)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Keys in rootToExcludes are already normalized, validated and made relative to the module DirPath.\n\t\t// These are exactly the keys that rootToIncludes should have.\n\t\trootToIncludes := make(map[string][]string)\n\t\tfor root := range rootToExcludes {\n\t\t\t// In v1beta1 and v1, includes is not an option and is always empty.\n\t\t\trootToIncludes[root] = []string{}\n\t\t}\n\t\tconfiguredDepModuleRefs, err := getConfiguredDepModuleRefsForExternalDeps(externalBufYAMLFile.Deps)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tlintConfig, err := getLintConfigForExternalLintV1Beta1V1(\n\t\t\tfileVersion,\n\t\t\texternalBufYAMLFile.Lint,\n\t\t\t\".\",\n\t\t\ttrue,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbreakingConfig, err := getBreakingConfigForExternalBreaking(\n\t\t\tfileVersion,\n\t\t\texternalBufYAMLFile.Breaking,\n\t\t\t\".\",\n\t\t\ttrue,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmoduleConfig, err := newModuleConfig(\n\t\t\t\"\",\n\t\t\tmoduleFullName,\n\t\t\trootToIncludes,\n\t\t\trootToExcludes,\n\t\t\tlintConfig,\n\t\t\tbreakingConfig,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newBufYAMLFile(\n\t\t\tfileVersion,\n\t\t\tobjectData,\n\t\t\t[]ModuleConfig{\n\t\t\t\tmoduleConfig,\n\t\t\t},\n\t\t\tlintConfig,\n\t\t\tbreakingConfig,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tconfiguredDepModuleRefs,\n\t\t\tincludeDocsLink,\n\t\t)\n\tcase FileVersionV2:\n\t\tvar externalBufYAMLFile externalBufYAMLFileV2\n\t\tif err := getUnmarshalStrict(allowJSON)(data, &externalBufYAMLFile); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\texternalModules := externalBufYAMLFile.Modules\n\t\tif len(externalModules) == 0 {\n\t\t\texternalModules = []externalBufYAMLFileModuleV2{\n\t\t\t\t{\n\t\t\t\t\tPath: \".\",\n\t\t\t\t\tName: externalBufYAMLFile.Name,\n\t\t\t\t},\n\t\t\t}\n\t\t} else if externalBufYAMLFile.Name != \"\" {\n\t\t\treturn nil, errors.New(\"top-level name key cannot be specified if modules are specified, you must specify the name on each individual module, the top-level name key is only for the default case where you have one module at path \\\".\\\".\")\n\t\t}\n\t\t// If a module does not have its own lint section, then we use this as the default.\n\t\tdefaultExternalLintConfig := externalBufYAMLFile.Lint\n\t\tdefaultExternalBreakingConfig := externalBufYAMLFile.Breaking\n\t\tvar moduleConfigs []ModuleConfig\n\t\tfor _, externalModule := range externalModules {\n\t\t\tdirPath := externalModule.Path\n\t\t\tif dirPath == \"\" {\n\t\t\t\tdirPath = \".\"\n\t\t\t}\n\t\t\tdirPath, err := normalpath.NormalizeAndValidate(dirPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid module path: %w\", err)\n\t\t\t}\n\t\t\tvar moduleFullName bufparse.FullName\n\t\t\tif externalModule.Name != \"\" {\n\t\t\t\tmoduleFullName, err = bufparse.ParseFullName(externalModule.Name)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Makes sure that the given paths are normalized, validated, and contained within dirPath.\n\t\t\t//\n\t\t\t// Run this check for includes, excludes, and lint and breaking change paths.\n\t\t\t//\n\t\t\t// We first check that a given path is within a module before passing it to this function\n\t\t\t// if the path came from defaultExternalLintConfig or defaultExternalBreakingConfig.\n\t\t\tnormalIncludes, err := normalizeAndCheckPaths(externalModule.Includes, \"include\")\n\t\t\tif err != nil {\n\t\t\t\t// user error\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trelIncludes, err := xslices.MapError(\n\t\t\t\tnormalIncludes,\n\t\t\t\tfunc(normalInclude string) (string, error) {\n\t\t\t\t\tif normalInclude == dirPath {\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"include path %q is equal to module directory %q\", normalInclude, dirPath)\n\t\t\t\t\t}\n\t\t\t\t\tif !normalpath.EqualsOrContainsPath(dirPath, normalInclude, normalpath.Relative) {\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"include path %q does not reside within module directory %q\", normalInclude, dirPath)\n\t\t\t\t\t}\n\t\t\t\t\tif normalpath.Ext(normalInclude) == \".proto\" {\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"includes can only be directories but file %q discovered\", normalInclude)\n\t\t\t\t\t}\n\t\t\t\t\t// An include path must be made relative to its moduleDirPath.\n\t\t\t\t\treturn normalpath.Rel(dirPath, normalInclude)\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// The only root for v2 buf.yamls must be \".\" and relIncludes are already relative to the moduleDirPath.\n\t\t\trootToIncludes := map[string][]string{\".\": relIncludes}\n\t\t\trelExcludes, err := xslices.MapError(\n\t\t\t\texternalModule.Excludes,\n\t\t\t\tfunc(normalExclude string) (string, error) {\n\t\t\t\t\tnormalExclude, err := normalpath.NormalizeAndValidate(normalExclude)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t// user error\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"invalid exclude path: %w\", err)\n\t\t\t\t\t}\n\t\t\t\t\tif normalExclude == dirPath {\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"exclude path %q is equal to module directory %q\", normalExclude, dirPath)\n\t\t\t\t\t}\n\t\t\t\t\tif !normalpath.EqualsOrContainsPath(dirPath, normalExclude, normalpath.Relative) {\n\t\t\t\t\t\treturn \"\", fmt.Errorf(\"exclude path %q does not reside within module directory %q\", normalExclude, dirPath)\n\t\t\t\t\t}\n\t\t\t\t\tif len(normalIncludes) > 0 {\n\t\t\t\t\t\t// Each exclude path must be contained in some include path. It is invalid to say include \"proto/foo/v1\"\n\t\t\t\t\t\t// and also exclude \"proto/foo/v2\", because the exclude path is redundant.\n\t\t\t\t\t\tvar foundContainingInclude bool\n\t\t\t\t\t\t// We iterate through normalIncludes instead of relIncludes so that when we compare an exclude\n\t\t\t\t\t\t// path to an include path, they are both relative to the workspace root.\n\t\t\t\t\t\tfor _, normalInclude := range normalIncludes {\n\t\t\t\t\t\t\tif normalInclude == normalExclude {\n\t\t\t\t\t\t\t\treturn \"\", fmt.Errorf(\"%q is both an include path and an exclude path\", normalExclude)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif normalpath.ContainsPath(normalExclude, normalInclude, normalpath.Relative) {\n\t\t\t\t\t\t\t\treturn \"\", fmt.Errorf(\"%q (an include path) is a subdirectory of %q (an exclude path)\", normalInclude, normalExclude)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif normalpath.ContainsPath(normalInclude, normalExclude, normalpath.Relative) {\n\t\t\t\t\t\t\t\tfoundContainingInclude = true\n\t\t\t\t\t\t\t\t// Do not exit early here, continue to validate the exclude path against the rest of include paths,\n\t\t\t\t\t\t\t\t// to make sure the exclude path does not equal to or contains any of the include path.\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif !foundContainingInclude {\n\t\t\t\t\t\t\treturn \"\", fmt.Errorf(\"include paths are specified but %q is not contained within any of them\", normalExclude)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// The only root for v2 buf.yamls must be \".\", so we have to make the excludes relative first.\n\t\t\t\t\treturn normalpath.Rel(dirPath, normalExclude)\n\t\t\t\t},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trootToExcludes, err := getRootToExcludes([]string{\".\"}, relExcludes)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\texternalLintConfig := defaultExternalLintConfig\n\t\t\tlintRequirePathsToBeContainedWithinModuleDirPath := false\n\t\t\tif !externalModule.Lint.isEmpty() {\n\t\t\t\texternalLintConfig = externalModule.Lint\n\t\t\t\t// We have a module-specific configuration, all paths must be within the module.\n\t\t\t\tlintRequirePathsToBeContainedWithinModuleDirPath = true\n\t\t\t}\n\t\t\tlintConfig, err := getLintConfigForExternalLintV2(\n\t\t\t\tfileVersion,\n\t\t\t\texternalLintConfig,\n\t\t\t\tdirPath,\n\t\t\t\tlintRequirePathsToBeContainedWithinModuleDirPath,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\texternalBreakingConfig := defaultExternalBreakingConfig\n\t\t\tbreakingRequirePathsToBeContainedWithinModuleDirPath := false\n\t\t\tif !externalModule.Breaking.isEmpty() {\n\t\t\t\texternalBreakingConfig = externalModule.Breaking\n\t\t\t\t// We have a module-specific configuration, all paths must be within the module.\n\t\t\t\tbreakingRequirePathsToBeContainedWithinModuleDirPath = true\n\t\t\t}\n\t\t\tbreakingConfig, err := getBreakingConfigForExternalBreaking(\n\t\t\t\tfileVersion,\n\t\t\t\texternalBreakingConfig,\n\t\t\t\tdirPath,\n\t\t\t\tbreakingRequirePathsToBeContainedWithinModuleDirPath,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmoduleConfig, err := newModuleConfig(\n\t\t\t\tdirPath,\n\t\t\t\tmoduleFullName,\n\t\t\t\trootToIncludes,\n\t\t\t\trootToExcludes,\n\t\t\t\tlintConfig,\n\t\t\t\tbreakingConfig,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmoduleConfigs = append(moduleConfigs, moduleConfig)\n\t\t}\n\t\tvar topLevelLintConfig LintConfig\n\t\tif !defaultExternalLintConfig.isEmpty() {\n\t\t\ttopLevelLintConfig, err = getLintConfigForExternalLintV2(\n\t\t\t\tfileVersion,\n\t\t\t\tdefaultExternalLintConfig,\n\t\t\t\t\".\",   // The top-level module config always has the root \".\"\n\t\t\t\tfalse, // Not module-specific configuration\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tvar topLevelBreakingConfig BreakingConfig\n\t\tif !defaultExternalBreakingConfig.isEmpty() {\n\t\t\ttopLevelBreakingConfig, err = getBreakingConfigForExternalBreaking(\n\t\t\t\tfileVersion,\n\t\t\t\tdefaultExternalBreakingConfig,\n\t\t\t\t\".\",   // The top-level module config always has the root \".\"\n\t\t\t\tfalse, // Not module-specific configuration\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tvar pluginConfigs []PluginConfig\n\t\tfor _, externalPluginConfig := range externalBufYAMLFile.Plugins {\n\t\t\tpluginConfig, err := newPluginConfigForExternalV2(externalPluginConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpluginConfigs = append(pluginConfigs, pluginConfig)\n\t\t}\n\t\tvar policyConfigs []PolicyConfig\n\t\tfor _, externalPolicyConfig := range externalBufYAMLFile.Policies {\n\t\t\tpolicyConfig, err := newPolicyConfigForExternalV2(externalPolicyConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpolicyConfigs = append(policyConfigs, policyConfig)\n\t\t}\n\t\tconfiguredDepModuleRefs, err := getConfiguredDepModuleRefsForExternalDeps(externalBufYAMLFile.Deps)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newBufYAMLFile(\n\t\t\tfileVersion,\n\t\t\tobjectData,\n\t\t\tmoduleConfigs,\n\t\t\ttopLevelLintConfig,\n\t\t\ttopLevelBreakingConfig,\n\t\t\tpluginConfigs,\n\t\t\tpolicyConfigs,\n\t\t\tconfiguredDepModuleRefs,\n\t\t\tincludeDocsLink,\n\t\t)\n\tdefault:\n\t\t// This is a system error since we've already parsed.\n\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n}\n\nfunc writeBufYAMLFile(writer io.Writer, bufYAMLFile BufYAMLFile) error {\n\tswitch fileVersion := bufYAMLFile.FileVersion(); fileVersion {\n\tcase FileVersionV1Beta1, FileVersionV1:\n\t\tmoduleConfigs := bufYAMLFile.ModuleConfigs()\n\t\t// Just some extra sanity checking that we've properly validated.\n\t\tif len(moduleConfigs) != 1 {\n\t\t\treturn syserror.Newf(\"expected 1 ModuleConfig, got %d\", len(moduleConfigs))\n\t\t}\n\t\tmoduleConfig := moduleConfigs[0]\n\t\t// Just some extra sanity checking that we've properly validated.\n\t\tif moduleConfig.DirPath() != \".\" {\n\t\t\treturn syserror.Newf(\"expected ModuleConfig DirPath to be . but was %q\", moduleConfig.DirPath())\n\t\t}\n\t\texternalBufYAMLFile := externalBufYAMLFileV1Beta1V1{\n\t\t\tVersion: fileVersion.String(),\n\t\t}\n\t\t// Already sorted.\n\t\texternalBufYAMLFile.Deps = xslices.Map(\n\t\t\tbufYAMLFile.ConfiguredDepModuleRefs(),\n\t\t\tfunc(moduleRef bufparse.Ref) string {\n\t\t\t\treturn moduleRef.String()\n\t\t\t},\n\t\t)\n\t\tif moduleFullName := moduleConfig.FullName(); moduleFullName != nil {\n\t\t\texternalBufYAMLFile.Name = moduleFullName.String()\n\t\t}\n\t\trootToExcludes := moduleConfig.RootToExcludes()\n\t\texcludes, ok := rootToExcludes[\".\"]\n\t\tswitch fileVersion {\n\t\tcase FileVersionV1:\n\t\t\tif len(rootToExcludes) != 1 {\n\t\t\t\treturn syserror.Newf(\"had rootToExcludes length %d for NewModuleConfig with FileVersion %v\", len(rootToExcludes), fileVersion)\n\t\t\t}\n\t\t\tif !ok {\n\t\t\t\treturn syserror.Newf(\"had rootToExcludes without key \\\".\\\" for NewModuleConfig with FileVersion %v\", fileVersion)\n\t\t\t}\n\t\t\tfor _, exclude := range excludes {\n\t\t\t\t// Excludes are defined to be sorted.\n\t\t\t\texternalBufYAMLFile.Build.Excludes = append(\n\t\t\t\t\texternalBufYAMLFile.Build.Excludes,\n\t\t\t\t\t// Remember, in buf.yaml files, excludes are not relative to roots.\n\t\t\t\t\tnormalpath.Join(\".\", exclude),\n\t\t\t\t)\n\t\t\t}\n\t\tcase FileVersionV1Beta1:\n\t\t\t// If \".\" -> empty, do not add anything.\n\t\t\tif len(rootToExcludes) != 1 || !(ok && len(excludes) == 0) {\n\t\t\t\troots := xslices.MapKeysToSortedSlice(rootToExcludes)\n\t\t\t\tfor _, root := range roots {\n\t\t\t\t\texternalBufYAMLFile.Build.Roots = append(\n\t\t\t\t\t\texternalBufYAMLFile.Build.Roots,\n\t\t\t\t\t\troot,\n\t\t\t\t\t)\n\t\t\t\t\tfor _, exclude := range rootToExcludes[root] {\n\t\t\t\t\t\t// Excludes are defined to be sorted.\n\t\t\t\t\t\texternalBufYAMLFile.Build.Excludes = append(\n\t\t\t\t\t\t\texternalBufYAMLFile.Build.Excludes,\n\t\t\t\t\t\t\t// Remember, in buf.yaml files, excludes are not relative to roots.\n\t\t\t\t\t\t\tnormalpath.Join(root, exclude),\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\t// Unreachable - we're in a v1/v1beta1 case statement above.\n\t\t\treturn syserror.Newf(\"expected v1 or v1beta1, got FileVersion: %v\", fileVersion)\n\t\t}\n\t\texternalBufYAMLFile.Lint = getExternalLintV1Beta1V1ForLintConfig(moduleConfig.LintConfig(), \".\")\n\t\texternalBufYAMLFile.Breaking = getExternalBreakingForBreakingConfig(moduleConfig.BreakingConfig(), \".\")\n\t\tdata, err := encoding.MarshalYAML(&externalBufYAMLFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif bufYAMLFile.IncludeDocsLink() {\n\t\t\tdata = bytes.Join(\n\t\t\t\t[][]byte{\n\t\t\t\t\tfmt.Appendf(nil, docsLinkComment, fileVersion.String()),\n\t\t\t\t\tdata,\n\t\t\t\t},\n\t\t\t\t[]byte(\"\\n\"),\n\t\t\t)\n\t\t}\n\t\t_, err = writer.Write(data)\n\t\treturn err\n\tcase FileVersionV2:\n\t\texternalBufYAMLFile := externalBufYAMLFileV2{\n\t\t\tVersion: fileVersion.String(),\n\t\t}\n\t\t// Already sorted.\n\t\texternalBufYAMLFile.Deps = xslices.Map(\n\t\t\tbufYAMLFile.ConfiguredDepModuleRefs(),\n\t\t\tfunc(moduleRef bufparse.Ref) string {\n\t\t\t\treturn moduleRef.String()\n\t\t\t},\n\t\t)\n\t\t// Keep maps of the JSON-marshaled data to the external lint and breaking configs.\n\t\t//\n\t\t// If both of these maps are of length 0 or 1, we say that the user really just has a\n\t\t// single configuration for lint and breaking, and we infer that they only want\n\t\t// to have a single top-level lint and breaking config. In this case, we delete\n\t\t// all of the per-module lint and breaking configs, and install the sole value\n\t\t// from each.\n\t\t//\n\t\t// We could make other decisions: if there are two or more matching configs, do a default,\n\t\t// and then just override the non-matching, but this gets complicated. The current logic\n\t\t// takes care of the base case when writing buf.yaml files.\n\t\tstringToExternalLint := make(map[string]externalBufYAMLFileLintV2)\n\t\tstringToExternalBreaking := make(map[string]externalBufYAMLFileBreakingV1Beta1V1V2)\n\n\t\tfor _, moduleConfig := range bufYAMLFile.ModuleConfigs() {\n\t\t\tmoduleDirPath := moduleConfig.DirPath()\n\t\t\tjoinDirPath := func(importPath string) string {\n\t\t\t\treturn normalpath.Join(moduleDirPath, importPath)\n\t\t\t}\n\t\t\texternalModule := externalBufYAMLFileModuleV2{\n\t\t\t\tPath: moduleDirPath,\n\t\t\t}\n\t\t\tif moduleFullName := moduleConfig.FullName(); moduleFullName != nil {\n\t\t\t\texternalModule.Name = moduleFullName.String()\n\t\t\t}\n\t\t\trootToIncludes := moduleConfig.RootToIncludes()\n\t\t\tif len(rootToIncludes) != 1 {\n\t\t\t\treturn syserror.Newf(\"had rootToIncludes length %d for NewModuleConfig with FileVersion %v\", len(rootToIncludes), fileVersion)\n\t\t\t}\n\t\t\tincludes, ok := rootToIncludes[\".\"]\n\t\t\tif !ok {\n\t\t\t\treturn syserror.Newf(\"had rootToIncludes without key \\\".\\\" for NewModuleConfig with FileVersion %v\", fileVersion)\n\t\t\t}\n\t\t\texternalModule.Includes = xslices.Map(includes, joinDirPath)\n\t\t\trootToExcludes := moduleConfig.RootToExcludes()\n\t\t\tif len(rootToExcludes) != 1 {\n\t\t\t\treturn syserror.Newf(\"had rootToExcludes length %d for NewModuleConfig with FileVersion %v\", len(rootToExcludes), fileVersion)\n\t\t\t}\n\t\t\texcludes, ok := rootToExcludes[\".\"]\n\t\t\tif !ok {\n\t\t\t\treturn syserror.Newf(\"had rootToExcludes without key \\\".\\\" for NewModuleConfig with FileVersion %v\", fileVersion)\n\t\t\t}\n\t\t\texternalModule.Excludes = xslices.Map(excludes, joinDirPath)\n\n\t\t\texternalLint := getExternalLintV2ForLintConfig(moduleConfig.LintConfig(), moduleDirPath)\n\t\t\texternalLintData, err := json.Marshal(externalLint)\n\t\t\tif err != nil {\n\t\t\t\treturn syserror.Wrap(err)\n\t\t\t}\n\t\t\tstringToExternalLint[string(externalLintData)] = externalLint\n\t\t\texternalModule.Lint = externalLint\n\n\t\t\texternalBreaking := getExternalBreakingForBreakingConfig(moduleConfig.BreakingConfig(), moduleDirPath)\n\t\t\texternalBreakingData, err := json.Marshal(externalBreaking)\n\t\t\tif err != nil {\n\t\t\t\treturn syserror.Wrap(err)\n\t\t\t}\n\t\t\tstringToExternalBreaking[string(externalBreakingData)] = externalBreaking\n\t\t\texternalModule.Breaking = externalBreaking\n\n\t\t\texternalBufYAMLFile.Modules = append(externalBufYAMLFile.Modules, externalModule)\n\t\t}\n\n\t\tif len(stringToExternalLint) <= 1 && len(stringToExternalBreaking) <= 1 {\n\t\t\texternalLint, err := getZeroOrSingleValueForMap(stringToExternalLint)\n\t\t\tif err != nil {\n\t\t\t\treturn syserror.Wrap(err)\n\t\t\t}\n\t\t\texternalBreaking, err := getZeroOrSingleValueForMap(stringToExternalBreaking)\n\t\t\tif err != nil {\n\t\t\t\treturn syserror.Wrap(err)\n\t\t\t}\n\t\t\texternalBufYAMLFile.Lint = externalLint\n\t\t\texternalBufYAMLFile.Breaking = externalBreaking\n\t\t\tfor i := range externalBufYAMLFile.Modules {\n\t\t\t\texternalBufYAMLFile.Modules[i].Lint = externalBufYAMLFileLintV2{}\n\t\t\t\texternalBufYAMLFile.Modules[i].Breaking = externalBufYAMLFileBreakingV1Beta1V1V2{}\n\t\t\t}\n\t\t}\n\t\tif len(externalBufYAMLFile.Modules) == 1 && externalBufYAMLFile.Modules[0].Path == \".\" && len(externalBufYAMLFile.Modules[0].Excludes) == 0 {\n\t\t\t// We know that lint and breaking will already be top-level from the above if statement.\n\t\t\texternalBufYAMLFile.Name = externalBufYAMLFile.Modules[0].Name\n\t\t\texternalBufYAMLFile.Modules = []externalBufYAMLFileModuleV2{}\n\t\t}\n\n\t\tvar externalPlugins []externalBufYAMLFilePluginV2\n\t\tfor _, pluginConfig := range bufYAMLFile.PluginConfigs() {\n\t\t\texternalPlugin, err := newExternalV2ForPluginConfig(pluginConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn syserror.Wrap(err)\n\t\t\t}\n\t\t\texternalPlugins = append(externalPlugins, externalPlugin)\n\t\t}\n\t\texternalBufYAMLFile.Plugins = externalPlugins\n\n\t\tvar externalPolicies []externalBufYAMLFilePolicyV2\n\t\tfor _, policyConfig := range bufYAMLFile.PolicyConfigs() {\n\t\t\texternalPolicy, err := newExternalV2ForPolicyConfig(policyConfig)\n\t\t\tif err != nil {\n\t\t\t\treturn syserror.Wrap(err)\n\t\t\t}\n\t\t\texternalPolicies = append(externalPolicies, externalPolicy)\n\t\t}\n\t\texternalBufYAMLFile.Policies = externalPolicies\n\n\t\tdata, err := encoding.MarshalYAML(&externalBufYAMLFile)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif bufYAMLFile.IncludeDocsLink() {\n\t\t\tdata = bytes.Join(\n\t\t\t\t[][]byte{\n\t\t\t\t\tfmt.Appendf(nil, docsLinkComment, fileVersion.String()),\n\t\t\t\t\tdata,\n\t\t\t\t},\n\t\t\t\t[]byte(\"\\n\"),\n\t\t\t)\n\t\t}\n\t\t_, err = writer.Write(data)\n\t\treturn err\n\tdefault:\n\t\t// This is a system error since we've already parsed.\n\t\treturn syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t}\n}\n\nfunc getRootToExcludes(roots []string, fullExcludes []string) (map[string][]string, error) {\n\tif len(roots) == 0 {\n\t\troots = []string{\".\"}\n\t}\n\n\trootToExcludes := make(map[string][]string)\n\troots, err := normalizeAndCheckPaths(roots, \"root\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, root := range roots {\n\t\t// we already checked duplicates, but just in case\n\t\tif _, ok := rootToExcludes[root]; ok {\n\t\t\treturn nil, fmt.Errorf(\"unexpected duplicate root: %q\", root)\n\t\t}\n\t\trootToExcludes[root] = []string{}\n\t}\n\tif len(fullExcludes) == 0 {\n\t\treturn rootToExcludes, nil\n\t}\n\n\t// This also verifies that fullExcludes is unique.\n\tfullExcludes, err = normalizeAndCheckPaths(fullExcludes, \"exclude\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Verify that no exclude equals a root directly and only directories are specified.\n\tfor _, fullExclude := range fullExcludes {\n\t\tif normalpath.Ext(fullExclude) == \".proto\" {\n\t\t\treturn nil, fmt.Errorf(\"excludes can only be directories but file %q discovered\", fullExclude)\n\t\t}\n\t\tif _, ok := rootToExcludes[fullExclude]; ok {\n\t\t\treturn nil, fmt.Errorf(\"%q is both a root and exclude, which means the entire root is excluded, which is not valid\", fullExclude)\n\t\t}\n\t}\n\n\t// Verify that all excludes are within a root.\n\trootMap := xslices.ToStructMap(roots)\n\tfor _, fullExclude := range fullExcludes {\n\t\tswitch matchingRoots := normalpath.MapAllEqualOrContainingPaths(rootMap, fullExclude, normalpath.Relative); len(matchingRoots) {\n\t\tcase 0:\n\t\t\treturn nil, fmt.Errorf(\"exclude %q is not contained in any root, which is not valid\", fullExclude)\n\t\tcase 1:\n\t\t\troot := matchingRoots[0]\n\t\t\texclude, err := normalpath.Rel(root, fullExclude)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// Just in case.\n\t\t\texclude, err = normalpath.NormalizeAndValidate(exclude)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trootToExcludes[root] = append(rootToExcludes[root], exclude)\n\t\tdefault:\n\t\t\t// This should never happen, but just in case.\n\t\t\treturn nil, fmt.Errorf(\"exclude %q was in multiple roots %v\", fullExclude, matchingRoots)\n\t\t}\n\t}\n\n\tfor root, excludes := range rootToExcludes {\n\t\tuniqueSortedExcludes := xstrings.SliceToUniqueSortedSliceFilterEmptyStrings(excludes)\n\t\tif len(excludes) != len(uniqueSortedExcludes) {\n\t\t\t// This should never happen, but just in case.\n\t\t\treturn nil, fmt.Errorf(\"excludes %v are not unique\", excludes)\n\t\t}\n\t\trootToExcludes[root] = uniqueSortedExcludes\n\t}\n\treturn rootToExcludes, nil\n}\n\nfunc getConfiguredDepModuleRefsForExternalDeps(\n\texternalDeps []string,\n) ([]bufparse.Ref, error) {\n\tconfiguredDepModuleRefs := make([]bufparse.Ref, len(externalDeps))\n\tfor i, externalDep := range externalDeps {\n\t\tmoduleRef, err := bufparse.ParseRef(externalDep)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid dep: %w\", err)\n\t\t}\n\t\tconfiguredDepModuleRefs[i] = moduleRef\n\t}\n\treturn configuredDepModuleRefs, nil\n}\n\nfunc getLintConfigForExternalLintV1Beta1V1(\n\tfileVersion FileVersion,\n\texternalLint externalBufYAMLFileLintV1Beta1V1,\n\tmoduleDirPath string,\n\trequirePathsToBeContainedWithinModuleDirPath bool,\n) (LintConfig, error) {\n\tvar checkConfig CheckConfig\n\tdisabled, err := isLintOrBreakingDisabledBasedOnIgnores(\"lint.ignore\", externalLint.Ignore, moduleDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif disabled {\n\t\tcheckConfig = newDisabledCheckConfig(fileVersion)\n\t} else {\n\t\tignore, err := getRelPathsForLintOrBreakingExternalPaths(\"lint.ignore\", externalLint.Ignore, moduleDirPath, requirePathsToBeContainedWithinModuleDirPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tignoreOnly := make(map[string][]string)\n\t\tfor idOrCategory, paths := range externalLint.IgnoreOnly {\n\t\t\trelPaths, err := getRelPathsForLintOrBreakingExternalPaths(\"lint.ignore_only\", paths, moduleDirPath, requirePathsToBeContainedWithinModuleDirPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(relPaths) > 0 {\n\t\t\t\tignoreOnly[idOrCategory] = relPaths\n\t\t\t}\n\t\t}\n\t\tcheckConfig, err = newEnabledCheckConfig(\n\t\t\tfileVersion,\n\t\t\texternalLint.Use,\n\t\t\texternalLint.Except,\n\t\t\tignore,\n\t\t\tignoreOnly,\n\t\t\texternalLint.DisableBuiltin,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn newLintConfig(\n\t\tcheckConfig,\n\t\texternalLint.EnumZeroValueSuffix,\n\t\texternalLint.RPCAllowSameRequestResponse,\n\t\texternalLint.RPCAllowGoogleProtobufEmptyRequests,\n\t\texternalLint.RPCAllowGoogleProtobufEmptyResponses,\n\t\texternalLint.ServiceSuffix,\n\t\texternalLint.AllowCommentIgnores,\n\t), nil\n}\n\nfunc getLintConfigForExternalLintV2(\n\tfileVersion FileVersion,\n\texternalLint externalBufYAMLFileLintV2,\n\tmoduleDirPath string,\n\trequirePathsToBeContainedWithinModuleDirPath bool,\n) (LintConfig, error) {\n\tvar checkConfig CheckConfig\n\tdisabled, err := isLintOrBreakingDisabledBasedOnIgnores(\"lint.ignore\", externalLint.Ignore, moduleDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif disabled {\n\t\tcheckConfig = newDisabledCheckConfig(fileVersion)\n\t} else {\n\t\tignore, err := getRelPathsForLintOrBreakingExternalPaths(\"lint.ignore\", externalLint.Ignore, moduleDirPath, requirePathsToBeContainedWithinModuleDirPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tignoreOnly := make(map[string][]string)\n\t\tfor idOrCategory, paths := range externalLint.IgnoreOnly {\n\t\t\trelPaths, err := getRelPathsForLintOrBreakingExternalPaths(\"lint.ignore_only\", paths, moduleDirPath, requirePathsToBeContainedWithinModuleDirPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(relPaths) > 0 {\n\t\t\t\tignoreOnly[idOrCategory] = relPaths\n\t\t\t}\n\t\t}\n\t\tcheckConfig, err = newEnabledCheckConfig(\n\t\t\tfileVersion,\n\t\t\texternalLint.Use,\n\t\t\texternalLint.Except,\n\t\t\tignore,\n\t\t\tignoreOnly,\n\t\t\texternalLint.DisableBuiltin,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn newLintConfig(\n\t\tcheckConfig,\n\t\texternalLint.EnumZeroValueSuffix,\n\t\texternalLint.RPCAllowSameRequestResponse,\n\t\texternalLint.RPCAllowGoogleProtobufEmptyRequests,\n\t\texternalLint.RPCAllowGoogleProtobufEmptyResponses,\n\t\texternalLint.ServiceSuffix,\n\t\t!externalLint.DisallowCommentIgnores,\n\t), nil\n}\n\nfunc getBreakingConfigForExternalBreaking(\n\tfileVersion FileVersion,\n\texternalBreaking externalBufYAMLFileBreakingV1Beta1V1V2,\n\tmoduleDirPath string,\n\trequirePathsToBeContainedWithinModuleDirPath bool,\n) (BreakingConfig, error) {\n\tvar checkConfig CheckConfig\n\tdisabled, err := isLintOrBreakingDisabledBasedOnIgnores(\"breaking.ignore\", externalBreaking.Ignore, moduleDirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif disabled {\n\t\tcheckConfig = newDisabledCheckConfig(fileVersion)\n\t} else {\n\t\tignore, err := getRelPathsForLintOrBreakingExternalPaths(\"breaking.ignore\", externalBreaking.Ignore, moduleDirPath, requirePathsToBeContainedWithinModuleDirPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tignoreOnly := make(map[string][]string)\n\t\tfor idOrCategory, paths := range externalBreaking.IgnoreOnly {\n\t\t\trelPaths, err := getRelPathsForLintOrBreakingExternalPaths(\"breaking.ignore_only\", paths, moduleDirPath, requirePathsToBeContainedWithinModuleDirPath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(relPaths) > 0 {\n\t\t\t\tignoreOnly[idOrCategory] = relPaths\n\t\t\t}\n\t\t}\n\t\tcheckConfig, err = newEnabledCheckConfig(\n\t\t\tfileVersion,\n\t\t\texternalBreaking.Use,\n\t\t\texternalBreaking.Except,\n\t\t\tignore,\n\t\t\tignoreOnly,\n\t\t\texternalBreaking.DisableBuiltin,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn newBreakingConfig(\n\t\tcheckConfig,\n\t\texternalBreaking.IgnoreUnstablePackages,\n\t), nil\n}\n\n// isLintOrBreakingDisabledBasedOnIgnores returns true if lint or breaking should be entirely disabled\n// based on an ignore path equaling moduleDirPath.\n//\n// See comments on CheckConfig.Disabled() for why this is a scenario we want to support.\nfunc isLintOrBreakingDisabledBasedOnIgnores(\n\tfieldName string,\n\tignores []string,\n\tmoduleDirPath string,\n) (bool, error) {\n\tfor _, ignore := range ignores {\n\t\tignore, err := normalpath.NormalizeAndValidate(ignore)\n\t\tif err != nil {\n\t\t\t// user error\n\t\t\treturn false, fmt.Errorf(\"%s: invalid path: %w\", fieldName, err)\n\t\t}\n\t\tif ignore == moduleDirPath {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n\n// getRelPathsForLintOrBreakingExternalPaths performs the following operation for either\n// getLintConfigForExternalLint or getBreakingConfigForExternalBreaking:\n//\n//   - Normalized and validates the path. If the path is invalid, returns error.\n//   - Checks to make sure the path is not equal to the given module directory path. If so, returns error.\n//   - If the path is not contained within the module directory path, the path is not added to the\n//     returned slice if requirePathsToBeContainedWithinModuleDirPath is false. This can happen when we\n//     are transforming a path from the default workspace-wide lint or breaking config. We want to skip these paths.\n//     If requirePathsToBeContainedWithinModuleDirPath is true, return error.\n//   - Otherwise, adds the path relative to the given module directory path to the returned slice.\n//\n// It is important to note that because we are only taking paths that are contained in the module\n// directory and check configurations can only respect paths that are a part of the module. This means\n// that import paths from outside of the module cannot be configured as a part of the check configuration\n// for a module.\n//\n// isLintOrBreakingDisabledBasedOnIgnores should be called before this function.\nfunc getRelPathsForLintOrBreakingExternalPaths(\n\tfieldName string,\n\tpaths []string,\n\tmoduleDirPath string,\n\trequirePathsToBeContainedWithinModuleDirPath bool,\n) ([]string, error) {\n\trelPaths := make([]string, 0, len(paths))\n\tfor _, path := range paths {\n\t\tpath, err := normalpath.NormalizeAndValidate(path)\n\t\tif err != nil {\n\t\t\t// user error\n\t\t\treturn nil, fmt.Errorf(\"%s: invalid path: %w\", fieldName, err)\n\t\t}\n\t\tif !normalpath.EqualsOrContainsPath(moduleDirPath, path, normalpath.Relative) {\n\t\t\tif !requirePathsToBeContainedWithinModuleDirPath {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"%s: path %q is not contained within module directory %q\", fieldName, path, moduleDirPath)\n\t\t}\n\t\trelPath, err := normalpath.Rel(moduleDirPath, path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trelPaths = append(relPaths, relPath)\n\t}\n\treturn relPaths, nil\n}\n\nfunc getExternalLintV1Beta1V1ForLintConfig(lintConfig LintConfig, moduleDirPath string) externalBufYAMLFileLintV1Beta1V1 {\n\tjoinDirPath := func(importPath string) string {\n\t\treturn normalpath.Join(moduleDirPath, importPath)\n\t}\n\texternalLint := externalBufYAMLFileLintV1Beta1V1{}\n\t// All already sorted.\n\texternalLint.Use = lintConfig.UseIDsAndCategories()\n\texternalLint.Except = lintConfig.ExceptIDsAndCategories()\n\texternalLint.Ignore = xslices.Map(lintConfig.IgnorePaths(), joinDirPath)\n\texternalLint.IgnoreOnly = make(map[string][]string, len(lintConfig.IgnoreIDOrCategoryToPaths()))\n\tfor idOrCategory, importPaths := range lintConfig.IgnoreIDOrCategoryToPaths() {\n\t\texternalLint.IgnoreOnly[idOrCategory] = xslices.Map(importPaths, joinDirPath)\n\t}\n\texternalLint.EnumZeroValueSuffix = lintConfig.EnumZeroValueSuffix()\n\texternalLint.RPCAllowSameRequestResponse = lintConfig.RPCAllowSameRequestResponse()\n\texternalLint.RPCAllowGoogleProtobufEmptyRequests = lintConfig.RPCAllowGoogleProtobufEmptyRequests()\n\texternalLint.RPCAllowGoogleProtobufEmptyResponses = lintConfig.RPCAllowGoogleProtobufEmptyResponses()\n\texternalLint.ServiceSuffix = lintConfig.ServiceSuffix()\n\texternalLint.AllowCommentIgnores = lintConfig.AllowCommentIgnores()\n\texternalLint.DisableBuiltin = lintConfig.DisableBuiltin()\n\treturn externalLint\n}\n\nfunc getExternalLintV2ForLintConfig(lintConfig LintConfig, moduleDirPath string) externalBufYAMLFileLintV2 {\n\tjoinDirPath := func(importPath string) string {\n\t\treturn normalpath.Join(moduleDirPath, importPath)\n\t}\n\texternalLint := externalBufYAMLFileLintV2{}\n\t// All already sorted.\n\texternalLint.Use = lintConfig.UseIDsAndCategories()\n\texternalLint.Except = lintConfig.ExceptIDsAndCategories()\n\texternalLint.Ignore = xslices.Map(lintConfig.IgnorePaths(), joinDirPath)\n\texternalLint.IgnoreOnly = make(map[string][]string, len(lintConfig.IgnoreIDOrCategoryToPaths()))\n\tfor idOrCategory, importPaths := range lintConfig.IgnoreIDOrCategoryToPaths() {\n\t\texternalLint.IgnoreOnly[idOrCategory] = xslices.Map(importPaths, joinDirPath)\n\t}\n\texternalLint.EnumZeroValueSuffix = lintConfig.EnumZeroValueSuffix()\n\texternalLint.RPCAllowSameRequestResponse = lintConfig.RPCAllowSameRequestResponse()\n\texternalLint.RPCAllowGoogleProtobufEmptyRequests = lintConfig.RPCAllowGoogleProtobufEmptyRequests()\n\texternalLint.RPCAllowGoogleProtobufEmptyResponses = lintConfig.RPCAllowGoogleProtobufEmptyResponses()\n\texternalLint.ServiceSuffix = lintConfig.ServiceSuffix()\n\texternalLint.DisallowCommentIgnores = !lintConfig.AllowCommentIgnores()\n\texternalLint.DisableBuiltin = lintConfig.DisableBuiltin()\n\treturn externalLint\n}\n\nfunc getExternalBreakingForBreakingConfig(breakingConfig BreakingConfig, moduleDirPath string) externalBufYAMLFileBreakingV1Beta1V1V2 {\n\tjoinDirPath := func(importPath string) string {\n\t\treturn normalpath.Join(moduleDirPath, importPath)\n\t}\n\texternalBreaking := externalBufYAMLFileBreakingV1Beta1V1V2{}\n\t// All already sorted.\n\texternalBreaking.Use = breakingConfig.UseIDsAndCategories()\n\texternalBreaking.Except = breakingConfig.ExceptIDsAndCategories()\n\texternalBreaking.Ignore = xslices.Map(breakingConfig.IgnorePaths(), joinDirPath)\n\texternalBreaking.IgnoreOnly = make(map[string][]string, len(breakingConfig.IgnoreIDOrCategoryToPaths()))\n\tfor idOrCategory, importPaths := range breakingConfig.IgnoreIDOrCategoryToPaths() {\n\t\texternalBreaking.IgnoreOnly[idOrCategory] = xslices.Map(importPaths, joinDirPath)\n\t}\n\texternalBreaking.IgnoreUnstablePackages = breakingConfig.IgnoreUnstablePackages()\n\texternalBreaking.DisableBuiltin = breakingConfig.DisableBuiltin()\n\treturn externalBreaking\n}\n\n// externalBufYAMLFileV1Beta1V1 represents the v1 or v1beta1 buf.yaml file, which have\n// the same shape EXCEPT build.roots.\n//\n// Note that the lint and breaking ids/categories DID change between v1beta1 and v1, make\n// sure to deal with this when parsing what to set as defaults, or how to interpret categories.\ntype externalBufYAMLFileV1Beta1V1 struct {\n\tVersion  string                                 `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tName     string                                 `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tDeps     []string                               `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tBuild    externalBufYAMLFileBuildV1Beta1V1      `json:\"build\" yaml:\"build,omitempty\"`\n\tLint     externalBufYAMLFileLintV1Beta1V1       `json:\"lint\" yaml:\"lint,omitempty\"`\n\tBreaking externalBufYAMLFileBreakingV1Beta1V1V2 `json:\"breaking\" yaml:\"breaking,omitempty\"`\n}\n\n// externalBufYAMLFileV2 represents the v2 buf.yaml file.\n//\n// Note that the lint and breaking ids/categories DID change between versions, make\n// sure to deal with this when parsing what to set as defaults, or how to interpret categories.\ntype externalBufYAMLFileV2 struct {\n\tVersion  string                                 `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tName     string                                 `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tModules  []externalBufYAMLFileModuleV2          `json:\"modules,omitempty\" yaml:\"modules,omitempty\"`\n\tDeps     []string                               `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tLint     externalBufYAMLFileLintV2              `json:\"lint\" yaml:\"lint,omitempty\"`\n\tBreaking externalBufYAMLFileBreakingV1Beta1V1V2 `json:\"breaking\" yaml:\"breaking,omitempty\"`\n\tPlugins  []externalBufYAMLFilePluginV2          `json:\"plugins,omitempty\" yaml:\"plugins,omitempty\"`\n\tPolicies []externalBufYAMLFilePolicyV2          `json:\"policies,omitempty\" yaml:\"policies,omitempty\"`\n}\n\n// externalBufYAMLFileModuleV2 represents a single module configuration within a v2 buf.yaml file.\ntype externalBufYAMLFileModuleV2 struct {\n\tPath     string                                 `json:\"path,omitempty\" yaml:\"path,omitempty\"`\n\tName     string                                 `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tIncludes []string                               `json:\"includes,omitempty\" yaml:\"includes,omitempty\"`\n\tExcludes []string                               `json:\"excludes,omitempty\" yaml:\"excludes,omitempty\"`\n\tLint     externalBufYAMLFileLintV2              `json:\"lint\" yaml:\"lint,omitempty\"`\n\tBreaking externalBufYAMLFileBreakingV1Beta1V1V2 `json:\"breaking\" yaml:\"breaking,omitempty\"`\n}\n\n// externalBufYAMLFileBuildV1Beta1V1 represents build configuration within a v1 or\n// v1beta1 buf.yaml file, which have the same shape except for roots.\ntype externalBufYAMLFileBuildV1Beta1V1 struct {\n\t// Roots are only valid in v1beta! Validate that this is not set for v1.\n\tRoots    []string `json:\"roots,omitempty\" yaml:\"roots,omitempty\"`\n\tExcludes []string `json:\"excludes,omitempty\" yaml:\"excludes,omitempty\"`\n}\n\n// externalBufYAMLFileLintV1Beta1V1 represents lint configuration within a v1beta1 or v1\n// buf.yaml file, which have the same shape.\n//\n// Note that the lint and breaking ids/categories DID change between versions, make\n// sure to deal with this when parsing what to set as defaults, or how to interpret categories.\ntype externalBufYAMLFileLintV1Beta1V1 struct {\n\tUse    []string `json:\"use,omitempty\" yaml:\"use,omitempty\"`\n\tExcept []string `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\t// Ignore are the paths to ignore.\n\tIgnore []string `json:\"ignore,omitempty\" yaml:\"ignore,omitempty\"`\n\t// IgnoreOnly are the ID/category to paths to ignore.\n\tIgnoreOnly                           map[string][]string `json:\"ignore_only,omitempty\" yaml:\"ignore_only,omitempty\"`\n\tEnumZeroValueSuffix                  string              `json:\"enum_zero_value_suffix,omitempty\" yaml:\"enum_zero_value_suffix,omitempty\"`\n\tRPCAllowSameRequestResponse          bool                `json:\"rpc_allow_same_request_response,omitempty\" yaml:\"rpc_allow_same_request_response,omitempty\"`\n\tRPCAllowGoogleProtobufEmptyRequests  bool                `json:\"rpc_allow_google_protobuf_empty_requests,omitempty\" yaml:\"rpc_allow_google_protobuf_empty_requests,omitempty\"`\n\tRPCAllowGoogleProtobufEmptyResponses bool                `json:\"rpc_allow_google_protobuf_empty_responses,omitempty\" yaml:\"rpc_allow_google_protobuf_empty_responses,omitempty\"`\n\tServiceSuffix                        string              `json:\"service_suffix,omitempty\" yaml:\"service_suffix,omitempty\"`\n\tAllowCommentIgnores                  bool                `json:\"allow_comment_ignores,omitempty\" yaml:\"allow_comment_ignores,omitempty\"`\n\tDisableBuiltin                       bool                `json:\"disable_builtin,omitempty\" yaml:\"disable_builtin,omitempty\"`\n}\n\n// Suppressing unused warning. Keeping this function around for now.\nvar _ = externalBufYAMLFileLintV1Beta1V1.isEmpty\n\nfunc (el externalBufYAMLFileLintV1Beta1V1) isEmpty() bool {\n\treturn len(el.Use) == 0 &&\n\t\tlen(el.Except) == 0 &&\n\t\tlen(el.Ignore) == 0 &&\n\t\tlen(el.IgnoreOnly) == 0 &&\n\t\tel.EnumZeroValueSuffix == \"\" &&\n\t\t!el.RPCAllowSameRequestResponse &&\n\t\t!el.RPCAllowGoogleProtobufEmptyRequests &&\n\t\t!el.RPCAllowGoogleProtobufEmptyResponses &&\n\t\tel.ServiceSuffix == \"\" &&\n\t\t!el.AllowCommentIgnores &&\n\t\t!el.DisableBuiltin\n}\n\n// externalBufYAMLFileLintV2 represents lint configuration within a  v2 buf.yaml file.\n//\n// Note that the lint and breaking ids/categories DID change between versions, make\n// sure to deal with this when parsing what to set as defaults, or how to interpret categories.\ntype externalBufYAMLFileLintV2 struct {\n\tUse    []string `json:\"use,omitempty\" yaml:\"use,omitempty\"`\n\tExcept []string `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\t// Ignore are the paths to ignore.\n\tIgnore []string `json:\"ignore,omitempty\" yaml:\"ignore,omitempty\"`\n\t/// IgnoreOnly are the ID/category to paths to ignore.\n\tIgnoreOnly                           map[string][]string `json:\"ignore_only,omitempty\" yaml:\"ignore_only,omitempty\"`\n\tEnumZeroValueSuffix                  string              `json:\"enum_zero_value_suffix,omitempty\" yaml:\"enum_zero_value_suffix,omitempty\"`\n\tRPCAllowSameRequestResponse          bool                `json:\"rpc_allow_same_request_response,omitempty\" yaml:\"rpc_allow_same_request_response,omitempty\"`\n\tRPCAllowGoogleProtobufEmptyRequests  bool                `json:\"rpc_allow_google_protobuf_empty_requests,omitempty\" yaml:\"rpc_allow_google_protobuf_empty_requests,omitempty\"`\n\tRPCAllowGoogleProtobufEmptyResponses bool                `json:\"rpc_allow_google_protobuf_empty_responses,omitempty\" yaml:\"rpc_allow_google_protobuf_empty_responses,omitempty\"`\n\tServiceSuffix                        string              `json:\"service_suffix,omitempty\" yaml:\"service_suffix,omitempty\"`\n\tDisallowCommentIgnores               bool                `json:\"disallow_comment_ignores,omitempty\" yaml:\"disallow_comment_ignores,omitempty\"`\n\tDisableBuiltin                       bool                `json:\"disable_builtin,omitempty\" yaml:\"disable_builtin,omitempty\"`\n}\n\nfunc (el externalBufYAMLFileLintV2) isEmpty() bool {\n\treturn len(el.Use) == 0 &&\n\t\tlen(el.Except) == 0 &&\n\t\tlen(el.Ignore) == 0 &&\n\t\tlen(el.IgnoreOnly) == 0 &&\n\t\tel.EnumZeroValueSuffix == \"\" &&\n\t\t!el.RPCAllowSameRequestResponse &&\n\t\t!el.RPCAllowGoogleProtobufEmptyRequests &&\n\t\t!el.RPCAllowGoogleProtobufEmptyResponses &&\n\t\tel.ServiceSuffix == \"\" &&\n\t\t!el.DisallowCommentIgnores &&\n\t\t!el.DisableBuiltin\n}\n\n// externalBufYAMLFileBreakingV1Beta1V1V2 represents breaking configuration within a v1beta1, v1,\n// or v2 buf.yaml file, which have the same shape.\n//\n// Note that the lint and breaking ids/categories DID change between versions, make\n// sure to deal with this when parsing what to set as defaults, or how to interpret categories.\ntype externalBufYAMLFileBreakingV1Beta1V1V2 struct {\n\tUse    []string `json:\"use,omitempty\" yaml:\"use,omitempty\"`\n\tExcept []string `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\t// Ignore are the paths to ignore.\n\tIgnore []string `json:\"ignore,omitempty\" yaml:\"ignore,omitempty\"`\n\t/// IgnoreOnly are the ID/category to paths to ignore.\n\tIgnoreOnly             map[string][]string `json:\"ignore_only,omitempty\" yaml:\"ignore_only,omitempty\"`\n\tIgnoreUnstablePackages bool                `json:\"ignore_unstable_packages,omitempty\" yaml:\"ignore_unstable_packages,omitempty\"`\n\tDisableBuiltin         bool                `json:\"disable_builtin,omitempty\" yaml:\"disable_builtin,omitempty\"`\n}\n\nfunc (eb externalBufYAMLFileBreakingV1Beta1V1V2) isEmpty() bool {\n\treturn len(eb.Use) == 0 &&\n\t\tlen(eb.Except) == 0 &&\n\t\tlen(eb.Ignore) == 0 &&\n\t\tlen(eb.IgnoreOnly) == 0 &&\n\t\t!eb.IgnoreUnstablePackages &&\n\t\t!eb.DisableBuiltin\n}\n\n// externalBufYAMLFilePluginV2 represents a single plugin config in a v2 buf.yaml file.\ntype externalBufYAMLFilePluginV2 struct {\n\tPlugin  any            `json:\"plugin,omitempty\" yaml:\"plugin,omitempty\"`\n\tOptions map[string]any `json:\"options,omitempty\" yaml:\"options,omitempty\"`\n}\n\n// externalBufYAMLFilePolicyV2 represents a single policy config in a v2 buf.yaml file.\ntype externalBufYAMLFilePolicyV2 struct {\n\tPolicy string `json:\"policy,omitempty\" yaml:\"policy,omitempty\"`\n\t// Ignore are the paths to ignore.\n\tIgnore []string `json:\"ignore,omitempty\" yaml:\"ignore,omitempty\"`\n\t// IgnoreOnly are the ID/category to paths to ignore.\n\tIgnoreOnly map[string][]string `json:\"ignore_only,omitempty\" yaml:\"ignore_only,omitempty\"`\n}\n\nfunc getZeroOrSingleValueForMap[K comparable, V any](m map[K]V) (V, error) {\n\tvar zero V\n\tif len(m) > 1 {\n\t\treturn zero, syserror.Newf(\"map was of length %d empty in getZeroOrSingleValueForMap\", len(m))\n\t}\n\tfor _, v := range m {\n\t\treturn v, nil\n\t}\n\t// len(m) == 0\n\treturn zero, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/buf_yaml_file_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestReadWriteBufYAMLFileRoundTrip(t *testing.T) {\n\tt.Parallel()\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v1\n`,\n\t\t// expected output\n\t\t`version: v1\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v1\nlint:\n  use:\n    - DEFAULT\n  allow_comment_ignores: true\n`,\n\t\t// expected output\n\t\t`version: v1\nlint:\n  use:\n    - DEFAULT\n  allow_comment_ignores: true\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t//input\n\t\t`version: v1\nbuild:\n  excludes:\n    - tests\n`,\n\t\t// expected output\n\t\t`version: v1\nbuild:\n  excludes:\n    - tests\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t//input\n\t\tstrings.Join(\n\t\t\t[]string{\n\t\t\t\tfmt.Sprintf(docsLinkComment, \"v1\"),\n\t\t\t\t`version: v1\nbuild:\n  excludes:\n    - tests\n`,\n\t\t\t},\n\t\t\t\"\\n\",\n\t\t),\n\t\t// expected output\n\t\tstrings.Join(\n\t\t\t[]string{\n\t\t\t\tfmt.Sprintf(docsLinkComment, \"v1\"),\n\t\t\t\t`version: v1\nbuild:\n  excludes:\n    - tests\n`,\n\t\t\t},\n\t\t\t\"\\n\",\n\t\t),\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nlint:\n  use:\n    - DEFAULT\n  disallow_comment_ignores: true\nmodules:\n  - path: .\n`,\n\t\t// expected output\n\t\t`version: v2\nlint:\n  use:\n    - DEFAULT\n  disallow_comment_ignores: true\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: foo\n    lint:\n      use:\n        - DEFAULT\n  - path: bar\n    lint:\n      use:\n        - DEFAULT\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: bar\n  - path: foo\nlint:\n  use:\n    - DEFAULT\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nlint:\n  use:\n    - DEFAULT\n  ignore:\n    - foo/one/one.proto\n    - bar/two/two.proto\nmodules:\n  - path: foo\n  - path: bar\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: bar\n    lint:\n      use:\n        - DEFAULT\n      ignore:\n        - bar/two/two.proto\n  - path: foo\n    lint:\n      use:\n        - DEFAULT\n      ignore:\n        - foo/one/one.proto\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nlint:\n  use:\n    - DEFAULT\n  ignore:\n    - foo/one/one.proto\n    - bar/two/two.proto\nmodules:\n  - path: foo\n    lint:\n      use:\n        - BASIC\n  - path: bar\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: bar\n    lint:\n      use:\n        - DEFAULT\n      ignore:\n        - bar/two/two.proto\n  - path: foo\n    lint:\n      use:\n        - BASIC\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: foo\n  - path: bar\nplugins:\n  - plugin: buf-plugin-foo\n    options:\n      key1: value1\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: bar\n  - path: foo\nplugins:\n  - plugin: buf-plugin-foo\n    options:\n      key1: value1\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: .\n`,\n\t\t// expected output\n\t\t`version: v2\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\n`,\n\t\t// expected output\n\t\t`version: v2\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: .\n`,\n\t\t// expected output\n\t\t`version: v2\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nname: buf.build/foo/bar\n`,\n\t\t// expected output\n\t\t`version: v2\nname: buf.build/foo/bar\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: .\n    name: buf.build/foo/bar\n`,\n\t\t// expected output\n\t\t`version: v2\nname: buf.build/foo/bar\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: .\n    name: buf.build/foo/bar\n`,\n\t\t// expected output\n\t\t`version: v2\nname: buf.build/foo/bar\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: .\n    excludes:\n\t  - foo\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: .\n    excludes:\n      - foo\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: baz\n    name: buf.build/foo/baz\n  - path: bar\n    name: buf.build/foo/bar\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: bar\n    name: buf.build/foo/bar\n  - path: baz\n    name: buf.build/foo/baz\n`,\n\t)\n\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\tstrings.Join(\n\t\t\t[]string{\n\t\t\t\tfmt.Sprintf(docsLinkComment, \"v2\"),\n\t\t\t\t`version: v2\nmodules:\n  - path: baz\n    name: buf.build/foo/baz\n  - path: bar\n    name: buf.build/foo/bar\n`,\n\t\t\t},\n\t\t\t\"\\n\",\n\t\t),\n\t\t// expected output\n\t\tstrings.Join(\n\t\t\t[]string{\n\t\t\t\tfmt.Sprintf(docsLinkComment, \"v2\"),\n\t\t\t\t`version: v2\nmodules:\n  - path: bar\n    name: buf.build/foo/bar\n  - path: baz\n    name: buf.build/foo/baz\n`,\n\t\t\t},\n\t\t\t\"\\n\",\n\t\t),\n\t)\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: baz # no include no exclude\n    name: buf.build/acme/baz\n  - path: bar # includes only\n    name: buf.build/acme/bar\n    includes:\n      - bar/first\n      - bar/second\n  - path: foo #includes and excludes\n    name: buf.build/acme/foo\n    includes:\n      - foo/first\n      - foo/second\n      - foo/third\n      - foo/fourth\n      - foo/fifth\n    excludes:\n      - foo/fourth/path\n      - foo/first/path/dir2\n      - foo/first/path/dir\n  - path: bat #excludes only\n    name: buf.build/acme/bat\n    excludes:\n      - bat/one\n      - bat/two\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: bar\n    name: buf.build/acme/bar\n    includes:\n      - bar/first\n      - bar/second\n  - path: bat\n    name: buf.build/acme/bat\n    excludes:\n      - bat/one\n      - bat/two\n  - path: baz\n    name: buf.build/acme/baz\n  - path: foo\n    name: buf.build/acme/foo\n    includes:\n      - foo/fifth\n      - foo/first\n      - foo/fourth\n      - foo/second\n      - foo/third\n    excludes:\n      - foo/first/path/dir\n      - foo/first/path/dir2\n      - foo/fourth/path\n`,\n\t)\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nmodules:\n  - path: proto\n    name: buf.build/acme/foo\n    includes:\n      - proto/foo\n  - path: proto\n    includes:\n      - proto/bar\n    excludes:\n      - proto/bar/path\n      - proto/bar/dir\n  - path: alpha\n    name: buf.build/acme/alpha\n  - path: proto\n    name: buf.build/acme/baz\n    excludes:\n      - proto/foo\n      - proto/bar\n`,\n\t\t// expected output\n\t\t`version: v2\nmodules:\n  - path: alpha\n    name: buf.build/acme/alpha\n  - path: proto\n    name: buf.build/acme/foo\n    includes:\n      - proto/foo\n  - path: proto\n    includes:\n      - proto/bar\n    excludes:\n      - proto/bar/dir\n      - proto/bar/path\n  - path: proto\n    name: buf.build/acme/baz\n    excludes:\n      - proto/bar\n      - proto/foo\n`,\n\t)\n\ttestReadWriteBufYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\npolicies:\n  - policy: buf.policy.yaml\n  - policy: buf.build/org/policy2:v1\n    ignore:\n      - foo/bar.proto\n    ignore_only:\n      ENUM_PASCAL_CASE:\n        - foo/foo.proto\n`,\n\t\t// expected output\n\t\t`version: v2\npolicies:\n  - policy: buf.policy.yaml\n  - policy: buf.build/org/policy2:v1\n    ignore:\n      - foo/bar.proto\n    ignore_only:\n      ENUM_PASCAL_CASE:\n        - foo/foo.proto\n`,\n\t)\n}\n\nfunc TestBufYAMLFileLintDisabled(t *testing.T) {\n\tt.Parallel()\n\n\tbufYAMLFile := testReadBufYAMLFile(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n  - path: vendor\n`,\n\t)\n\tmoduleConfig0 := bufYAMLFile.ModuleConfigs()[0]\n\tmoduleConfig1 := bufYAMLFile.ModuleConfigs()[1]\n\trequire.Equal(t, moduleConfig0.DirPath(), \"proto\")\n\trequire.Equal(t, moduleConfig1.DirPath(), \"vendor\")\n\trequire.False(t, moduleConfig0.LintConfig().Disabled())\n\trequire.False(t, moduleConfig1.LintConfig().Disabled())\n\n\tbufYAMLFile = testReadBufYAMLFile(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n  - path: vendor\nlint:\n  ignore:\n    - vendor\n`,\n\t)\n\tmoduleConfig0 = bufYAMLFile.ModuleConfigs()[0]\n\tmoduleConfig1 = bufYAMLFile.ModuleConfigs()[1]\n\trequire.Equal(t, moduleConfig0.DirPath(), \"proto\")\n\trequire.Equal(t, moduleConfig1.DirPath(), \"vendor\")\n\trequire.False(t, moduleConfig0.LintConfig().Disabled())\n\trequire.True(t, moduleConfig1.LintConfig().Disabled())\n\n\tbufYAMLFile = testReadBufYAMLFile(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n  - path: vendor\n    lint:\n      ignore:\n        - vendor\n`,\n\t)\n\tmoduleConfig0 = bufYAMLFile.ModuleConfigs()[0]\n\tmoduleConfig1 = bufYAMLFile.ModuleConfigs()[1]\n\trequire.Equal(t, moduleConfig0.DirPath(), \"proto\")\n\trequire.Equal(t, moduleConfig1.DirPath(), \"vendor\")\n\trequire.False(t, moduleConfig0.LintConfig().Disabled())\n\trequire.True(t, moduleConfig1.LintConfig().Disabled())\n}\n\nfunc TestBufYAMLFileBreakingDisabled(t *testing.T) {\n\tt.Parallel()\n\n\tbufYAMLFile := testReadBufYAMLFile(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n  - path: vendor\n`,\n\t)\n\tmoduleConfig0 := bufYAMLFile.ModuleConfigs()[0]\n\tmoduleConfig1 := bufYAMLFile.ModuleConfigs()[1]\n\trequire.Equal(t, moduleConfig0.DirPath(), \"proto\")\n\trequire.Equal(t, moduleConfig1.DirPath(), \"vendor\")\n\trequire.False(t, moduleConfig0.BreakingConfig().Disabled())\n\trequire.False(t, moduleConfig1.BreakingConfig().Disabled())\n\n\tbufYAMLFile = testReadBufYAMLFile(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n  - path: vendor\nbreaking:\n  ignore:\n    - vendor\n`,\n\t)\n\tmoduleConfig0 = bufYAMLFile.ModuleConfigs()[0]\n\tmoduleConfig1 = bufYAMLFile.ModuleConfigs()[1]\n\trequire.Equal(t, moduleConfig0.DirPath(), \"proto\")\n\trequire.Equal(t, moduleConfig1.DirPath(), \"vendor\")\n\trequire.False(t, moduleConfig0.BreakingConfig().Disabled())\n\trequire.True(t, moduleConfig1.BreakingConfig().Disabled())\n\n\tbufYAMLFile = testReadBufYAMLFile(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n  - path: vendor\n    breaking:\n      ignore:\n        - vendor\n`,\n\t)\n\tmoduleConfig0 = bufYAMLFile.ModuleConfigs()[0]\n\tmoduleConfig1 = bufYAMLFile.ModuleConfigs()[1]\n\trequire.Equal(t, moduleConfig0.DirPath(), \"proto\")\n\trequire.Equal(t, moduleConfig1.DirPath(), \"vendor\")\n\trequire.False(t, moduleConfig0.BreakingConfig().Disabled())\n\trequire.True(t, moduleConfig1.BreakingConfig().Disabled())\n}\n\nfunc TestBufYAMLInvalidIncludes(t *testing.T) {\n\tt.Parallel()\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n\t  - outside\n`,\n\t\t`\"outside\" does not reside within module directory`,\n\t)\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n\t  - proto/inside\n\t  - outside\n`,\n\t\t`\"outside\" does not reside within module directory`,\n\t)\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n      - proto/dir\n      - proto/dir\n`,\n\t\t`duplicate include \"proto/dir\"`,\n\t)\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n      - proto\n`,\n\t\t`include path \"proto\" is equal to module directory`,\n\t)\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n      - proto/foo\n      - proto/foo/bar\n`,\n\t\t`\"proto/foo/bar\" is within include \"proto/foo\"`,\n\t)\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n      - proto/foo\n    excludes:\n      - proto/foo/bar\n      - proto/baz\n`,\n\t\t`include paths are specified but \"proto/baz\" is not contained within any of them`,\n\t)\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n      - proto/foo\n      - proto/bar\n    excludes:\n      - proto/foo/dir\n      - proto/bar\n`,\n\t\t`\"proto/bar\" is both an include path and an exclude path`,\n\t)\n\ttestReadBufYAMLFileFail(\n\t\tt,\n\t\t`version: v2\nmodules:\n  - path: proto\n    includes:\n      - proto/foo/bar\n    excludes:\n      - proto/foo\n`,\n\t\t`\"proto/foo/bar\" (an include path) is a subdirectory of \"proto/foo\" (an exclude path)`,\n\t)\n}\n\nfunc testReadWriteBufYAMLFileRoundTrip(\n\tt *testing.T,\n\tinputBufYAMLFileData string,\n\texpectedOutputBufYAMLFileData string,\n) {\n\tbufYAMLFile := testReadBufYAMLFile(t, inputBufYAMLFileData)\n\tbuffer := bytes.NewBuffer(nil)\n\terr := WriteBufYAMLFile(buffer, bufYAMLFile)\n\trequire.NoError(t, err)\n\toutputBufYAMLData := testCleanYAMLData(buffer.String())\n\tassert.Equal(t, testCleanYAMLData(expectedOutputBufYAMLFileData), outputBufYAMLData, \"output:\\n%s\", outputBufYAMLData)\n}\n\nfunc testReadBufYAMLFile(\n\tt *testing.T,\n\tinputBufYAMLFileData string,\n) BufYAMLFile {\n\tbufYAMLFile, err := ReadBufYAMLFile(\n\t\tstrings.NewReader(testCleanYAMLData(inputBufYAMLFileData)),\n\t\tDefaultBufYAMLFileName,\n\t)\n\trequire.NoError(t, err)\n\treturn bufYAMLFile\n}\n\nfunc testReadBufYAMLFileFail(\n\tt *testing.T,\n\tinputBufYAMLFileData string,\n\terrorContains string,\n) {\n\t_, err := ReadBufYAMLFile(\n\t\tstrings.NewReader(testCleanYAMLData(inputBufYAMLFileData)),\n\t\tDefaultBufYAMLFileName,\n\t)\n\trequire.ErrorContains(t, err, errorContains)\n}\n\nfunc testCleanYAMLData(data string) string {\n\t// Just to deal with editor nonsense when writing tests.\n\treturn strings.TrimSpace(strings.ReplaceAll(data, \"\\t\", \"  \"))\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/bufconfig.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n"
  },
  {
    "path": "private/bufpkg/bufconfig/check_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"slices\"\n\n\t\"buf.build/go/standard/xslices\"\n)\n\nvar (\n\tdefaultCheckConfigV1 = newEnabledCheckConfigNoValidate(\n\t\tFileVersionV1,\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tfalse,\n\t)\n\tdefaultCheckConfigV2 = newEnabledCheckConfigNoValidate(\n\t\tFileVersionV2,\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tfalse,\n\t)\n)\n\n// CheckConfig is the common interface for the configuration shared by\n// LintConfig and BreakingConfig.\ntype CheckConfig interface {\n\t// FileVersion returns the file version that this configuration was derived from.\n\t//\n\t// We don't want to have to take FileVersion into account for *Configs, however\n\t// with lint and breaking configurations, the FileVersion changes the interpretation\n\t// of the IDs and categories.\n\tFileVersion() FileVersion\n\n\t// Disabled says whether or not the given check should be entirely disabled.\n\t//\n\t// This happens if an ignore path matches a module directory, which is valid\n\t// in cases such as:\n\t//\n\t//   version: v2\n\t//   modules:\n\t//     - path: proto\n\t//     - path: vendor\n\t//   lint:\n\t//     ignore:\n\t//       - vendor\n\t//\n\t// Or:\n\t//\n\t//   version: v2\n\t//   modules:\n\t//     - path: proto\n\t//     - path: vendor\n\t//       lint:\n\t//         ignore:\n\t//           - vendor\n\t//\n\t// We no longer produce an error in this case. Instead, we set Disabled(), and\n\t// do not run checks. This means that the following is no longer an error:\n\t//\n\t//   version: v1\n\t//   lint:\n\t//     ignore:\n\t//       - .\n\t//\n\t// We could make it so that ignore == moduleDirPath is only allowed for v2, however\n\t// this feels like overkill, so we're just going to keep this consistent for v1\n\t// and v2.\n\tDisabled() bool\n\t// Sorted.\n\tUseIDsAndCategories() []string\n\t// Sorted\n\tExceptIDsAndCategories() []string\n\t// Paths are specific to the Module. Users cannot ignore paths outside of their modules for check\n\t// configs, which includes any imports from outside of the module.\n\t// Paths are relative to roots.\n\t// Paths are sorted.\n\tIgnorePaths() []string\n\t// Paths are specific to the Module. Users cannot ignore paths outside of their modules for\n\t// check configs, which includes any imports from outside of the module.\n\t// Paths are relative to roots.\n\t// Paths are sorted.\n\tIgnoreIDOrCategoryToPaths() map[string][]string\n\t// DisableBuiltin says to disable the Rules and Categories builtin to the Buf CLI and only\n\t// use plugins.\n\t//\n\t// This will make it as if these rules did not exist.\n\tDisableBuiltin() bool\n\n\tisCheckConfig()\n}\n\n// NewEnabledCheckConfig returns a new enabled CheckConfig.\nfunc NewEnabledCheckConfig(\n\tfileVersion FileVersion,\n\tuse []string,\n\texcept []string,\n\tignore []string,\n\tignoreOnly map[string][]string,\n\tdisableBuiltin bool,\n) (CheckConfig, error) {\n\treturn newEnabledCheckConfig(\n\t\tfileVersion,\n\t\tuse,\n\t\texcept,\n\t\tignore,\n\t\tignoreOnly,\n\t\tdisableBuiltin,\n\t)\n}\n\n// NewEnabledCheckConfigForUseIDsAndCategories returns a new enabled CheckConfig for only the use IDs and categories.\nfunc NewEnabledCheckConfigForUseIDsAndCategories(\n\tfileVersion FileVersion,\n\tuse []string,\n\tdisableBuiltin bool,\n) CheckConfig {\n\treturn newEnabledCheckConfigNoValidate(\n\t\tfileVersion,\n\t\txslices.ToUniqueSorted(use),\n\t\tnil,\n\t\tnil,\n\t\tnil,\n\t\tdisableBuiltin,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype checkConfig struct {\n\tfileVersion    FileVersion\n\tdisabled       bool\n\tuse            []string\n\texcept         []string\n\tignore         []string\n\tignoreOnly     map[string][]string\n\tdisableBuiltin bool\n}\n\nfunc newEnabledCheckConfig(\n\tfileVersion FileVersion,\n\tuse []string,\n\texcept []string,\n\tignore []string,\n\tignoreOnly map[string][]string,\n\tdisableBuiltin bool,\n) (*checkConfig, error) {\n\tuse = xslices.ToUniqueSorted(use)\n\texcept = xslices.ToUniqueSorted(except)\n\tignore = xslices.ToUniqueSorted(ignore)\n\tignore, err := normalizeAndCheckPaths(ignore, \"ignore\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewIgnoreOnly := make(map[string][]string, len(ignoreOnly))\n\tfor k, v := range ignoreOnly {\n\t\tv = xslices.ToUniqueSorted(v)\n\t\tv, err := normalizeAndCheckPaths(v, \"ignore_only path\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewIgnoreOnly[k] = v\n\t}\n\tignoreOnly = newIgnoreOnly\n\n\treturn newEnabledCheckConfigNoValidate(fileVersion, use, except, ignore, ignoreOnly, disableBuiltin), nil\n}\n\nfunc newEnabledCheckConfigNoValidate(\n\tfileVersion FileVersion,\n\tuse []string,\n\texcept []string,\n\tignore []string,\n\tignoreOnly map[string][]string,\n\tdisableBuiltin bool,\n) *checkConfig {\n\treturn &checkConfig{\n\t\tfileVersion:    fileVersion,\n\t\tdisabled:       false,\n\t\tuse:            use,\n\t\texcept:         except,\n\t\tignore:         ignore,\n\t\tignoreOnly:     ignoreOnly,\n\t\tdisableBuiltin: disableBuiltin,\n\t}\n}\n\nfunc newDisabledCheckConfig(fileVersion FileVersion) *checkConfig {\n\treturn &checkConfig{\n\t\tfileVersion: fileVersion,\n\t\tdisabled:    true,\n\t}\n}\n\nfunc (c *checkConfig) Disabled() bool {\n\treturn c.disabled\n}\n\nfunc (c *checkConfig) FileVersion() FileVersion {\n\treturn c.fileVersion\n}\n\nfunc (c *checkConfig) UseIDsAndCategories() []string {\n\treturn slices.Clone(c.use)\n}\n\nfunc (c *checkConfig) ExceptIDsAndCategories() []string {\n\treturn slices.Clone(c.except)\n}\n\nfunc (c *checkConfig) IgnorePaths() []string {\n\treturn slices.Clone(c.ignore)\n}\n\nfunc (c *checkConfig) IgnoreIDOrCategoryToPaths() map[string][]string {\n\treturn copyStringToStringSliceMap(c.ignoreOnly)\n}\n\nfunc (c *checkConfig) DisableBuiltin() bool {\n\treturn c.disableBuiltin\n}\n\nfunc (*checkConfig) isCheckConfig() {}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"io/fs\"\n\t\"path/filepath\"\n\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// File is the common interface shared by all config files.\ntype File interface {\n\tFileInfo\n\n\t// ObjectData returns the underlying ObjectData.\n\t//\n\t// This is non-nil on Files if they were created from storage.ReadBuckets. It is nil\n\t// if the File was created via a New constructor or Read method.\n\t//\n\t// This ObjectData is used for digest calculations.\n\tObjectData() ObjectData\n\n\tisFile()\n}\n\n// *** PRIVATE ***\n\nfunc getFileForPrefix[F File](\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\tfileNames []string,\n\tfileNameToSupportedFileVersions map[string]map[FileVersion]struct{},\n\treadFileFunc func(\n\t\tdata []byte,\n\t\tobjectData ObjectData,\n\t\tallowJSON bool,\n\t) (F, error),\n) (F, error) {\n\tfor _, fileName := range fileNames {\n\t\tpath := normalpath.Join(prefix, fileName)\n\t\tdata, err := storage.ReadPath(ctx, bucket, path)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar f F\n\t\t\treturn f, err\n\t\t}\n\t\tf, err := readFileFunc(data, newObjectData(fileName, data), false)\n\t\tif err != nil {\n\t\t\treturn f, newDecodeError(path, err)\n\t\t}\n\t\tif err := validateSupportedFileVersion(fileName, f.FileVersion(), fileNameToSupportedFileVersions); err != nil {\n\t\t\treturn f, newDecodeError(path, err)\n\t\t}\n\t\treturn f, nil\n\t}\n\tvar f F\n\treturn f, &fs.PathError{Op: \"read\", Path: normalpath.Join(prefix, fileNames[0]), Err: fs.ErrNotExist}\n}\n\nfunc getFileVersionForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\tfileNames []string,\n\tfileNameToSupportedFileVersions map[string]map[FileVersion]struct{},\n\tfileVersionRequired bool,\n\tsuggestedFileVersion FileVersion,\n\tdefaultFileVersion FileVersion,\n) (FileVersion, error) {\n\tfor _, fileName := range fileNames {\n\t\tpath := normalpath.Join(prefix, fileName)\n\t\tdata, err := storage.ReadPath(ctx, bucket, path)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn 0, err\n\t\t}\n\t\tfileVersion, err := getFileVersionForData(data, false, fileVersionRequired, fileNameToSupportedFileVersions, suggestedFileVersion, defaultFileVersion)\n\t\tif err != nil {\n\t\t\treturn 0, newDecodeError(path, err)\n\t\t}\n\t\tif err := validateSupportedFileVersion(fileName, fileVersion, fileNameToSupportedFileVersions); err != nil {\n\t\t\treturn 0, newDecodeError(path, err)\n\t\t}\n\t\treturn fileVersion, nil\n\t}\n\treturn 0, &fs.PathError{Op: \"read\", Path: normalpath.Join(prefix, fileNames[0]), Err: fs.ErrNotExist}\n}\n\nfunc putFileForPrefix[F File](\n\tctx context.Context,\n\tbucket storage.WriteBucket,\n\tprefix string,\n\tf F,\n\tfileName string,\n\tfileNameToSupportedFileVersions map[string]map[FileVersion]struct{},\n\twriteFileFunc func(\n\t\twriter io.Writer,\n\t\tf F,\n\t) error,\n) (retErr error) {\n\tif err := validateSupportedFileVersion(fileName, f.FileVersion(), fileNameToSupportedFileVersions); err != nil {\n\t\t// This is effectively a system error. We should be able to write with whatever file name we have.\n\t\treturn syserror.Wrap(newEncodeError(fileName, err))\n\t}\n\tpath := normalpath.Join(prefix, fileName)\n\twriteObjectCloser, err := bucket.Put(ctx, path, storage.PutWithAtomic())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t}()\n\treturn writeFileFunc(writeObjectCloser, f)\n}\n\nfunc readFile[F File](\n\treader io.Reader,\n\tfileName string,\n\treadFileFunc func(\n\t\tdata []byte,\n\t\tobjectData ObjectData,\n\t\tallowJSON bool,\n\t) (F, error),\n) (F, error) {\n\tdata, err := io.ReadAll(reader)\n\tif err != nil {\n\t\tvar f F\n\t\treturn f, err\n\t}\n\tf, err := readFileFunc(data, newObjectData(fileName, data), true)\n\tif err != nil {\n\t\treturn f, newDecodeError(fileName, err)\n\t}\n\treturn f, nil\n}\n\nfunc writeFile[F File](\n\twriter io.Writer,\n\tf F,\n\twriteFileFunc func(\n\t\twriter io.Writer,\n\t\tf F,\n\t) error,\n) error {\n\tif err := writeFileFunc(writer, f); err != nil {\n\t\tvar fileName string\n\t\tif objectData := f.ObjectData(); objectData != nil {\n\t\t\tfileName = objectData.Name()\n\t\t}\n\t\treturn newDecodeError(fileName, err)\n\t}\n\treturn nil\n}\n\nfunc getUnmarshalStrict(allowJSON bool) func([]byte, any) error {\n\tif allowJSON {\n\t\treturn encoding.UnmarshalJSONOrYAMLStrict\n\t}\n\treturn encoding.UnmarshalYAMLStrict\n}\n\nfunc getUnmarshalNonStrict(allowJSON bool) func([]byte, any) error {\n\tif allowJSON {\n\t\treturn encoding.UnmarshalJSONOrYAMLNonStrict\n\t}\n\treturn encoding.UnmarshalYAMLNonStrict\n}\n\nfunc newDecodeError(fileName string, err error) error {\n\tif fileName == \"\" {\n\t\tfileName = \"config file\"\n\t}\n\t// We intercept PathErrors in buffetch to deal with fixing of paths.\n\t// We return a cleaned, unnormalized path in the error for clarity with user's filesystem.\n\treturn &fs.PathError{Op: \"decode\", Path: filepath.Clean(normalpath.Unnormalize(fileName)), Err: err}\n}\n\nfunc newEncodeError(fileName string, err error) error {\n\tif fileName == \"\" {\n\t\tfileName = \"config file\"\n\t}\n\t// We intercept PathErrors in buffetch to deal with fixing of paths.\n\t// We return a cleaned, unnormalized path in the error for clarity with user's filesystem.\n\treturn &fs.PathError{Op: \"encode\", Path: filepath.Clean(normalpath.Unnormalize(fileName)), Err: err}\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/file_info.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\n// FileInfo contains information on a configuration file.\ntype FileInfo interface {\n\t// FileVersion returns the version of the file.\n\tFileVersion() FileVersion\n\t// FileType returns the type of the file.\n\tFileType() FileType\n\n\tisFileInfo()\n}\n\n// *** PRIVATE ***\n\ntype fileInfo struct {\n\tfileVersion FileVersion\n\tfileType    FileType\n}\n\nfunc newFileInfo(fileVersion FileVersion, fileType FileType) *fileInfo {\n\treturn &fileInfo{\n\t\tfileVersion: fileVersion,\n\t\tfileType:    fileType,\n\t}\n}\n\nfunc (f *fileInfo) FileVersion() FileVersion {\n\treturn f.fileVersion\n}\n\nfunc (f *fileInfo) FileType() FileType {\n\treturn f.fileType\n}\n\nfunc (*fileInfo) isFileInfo() {}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/file_type.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nconst (\n\t// FileTypeBufYAML represents buf.yaml files.\n\tFileTypeBufYAML FileType = iota + 1\n\t// FileTypeBufLock represents buf.lock files.\n\tFileTypeBufLock\n\t// FileTypeBufGenYAML represents buf.gen.yaml files.\n\tFileTypeBufGenYAML\n\t// FileTypeBufWorkYAML represents buf.work.yaml files.\n\tFileTypeBufWorkYAML\n)\n\nvar (\n\tfileNameToFileType = map[string]FileType{\n\t\tDefaultBufYAMLFileName:     FileTypeBufYAML,\n\t\toldBufYAMLFileName:         FileTypeBufYAML,\n\t\tDefaultBufLockFileName:     FileTypeBufLock,\n\t\tdefaultBufGenYAMLFileName:  FileTypeBufGenYAML,\n\t\tDefaultBufWorkYAMLFileName: FileTypeBufWorkYAML,\n\t\toldBufWorkYAMLFileName:     FileTypeBufWorkYAML,\n\t}\n\n\tfileTypeToDefaultFileVersion = map[FileType]FileVersion{\n\t\tFileTypeBufYAML:     defaultBufYAMLFileVersion,\n\t\tFileTypeBufLock:     defaultBufLockFileVersion,\n\t\tFileTypeBufGenYAML:  defaultBufGenYAMLFileVersion,\n\t\tFileTypeBufWorkYAML: defaultBufWorkYAMLFileVersion,\n\t}\n\tfileTypeToSupportedFileVersions = map[FileType]map[string]map[FileVersion]struct{}{\n\t\tFileTypeBufYAML:     bufYAMLFileNameToSupportedFileVersions,\n\t\tFileTypeBufLock:     bufLockFileNameToSupportedFileVersions,\n\t\tFileTypeBufGenYAML:  bufGenYAMLFileNameToSupportedFileVersions,\n\t\tFileTypeBufWorkYAML: bufWorkYAMLFileNameToSupportedFileVersions,\n\t}\n)\n\n// FileType is the type of a file.\ntype FileType int\n"
  },
  {
    "path": "private/bufpkg/bufconfig/file_version.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// FileVersionV1Beta1 represents v1beta1 files.\n\tFileVersionV1Beta1 FileVersion = iota + 1\n\t// FileVersionV1 represents v1 files.\n\tFileVersionV1\n\t// FileVersionV2 represents v2 files.\n\tFileVersionV2\n)\n\nvar (\n\t// AllFileVersions are all FileVersions.\n\tAllFileVersions = []FileVersion{\n\t\tFileVersionV1Beta1,\n\t\tFileVersionV1,\n\t\tFileVersionV2,\n\t}\n\n\tfileVersionToString = map[FileVersion]string{\n\t\tFileVersionV1Beta1: \"v1beta1\",\n\t\tFileVersionV1:      \"v1\",\n\t\tFileVersionV2:      \"v2\",\n\t}\n\tstringToFileVersion = map[string]FileVersion{\n\t\t\"v1beta1\": FileVersionV1Beta1,\n\t\t\"v1\":      FileVersionV1,\n\t\t\"v2\":      FileVersionV2,\n\t}\n)\n\n// FileVersion is the version of a file.\ntype FileVersion int\n\n// String prints the string representation of the FileVersion.\n//\n// This is used in buf.yaml, buf.gen.yaml, buf.work.yaml, and buf.lock files on disk.\nfunc (f FileVersion) String() string {\n\ts, ok := fileVersionToString[f]\n\tif !ok {\n\t\treturn strconv.Itoa(int(f))\n\t}\n\treturn s\n}\n\n// *** PRIVATE ***\n\nfunc getFileVersionForData(\n\tdata []byte,\n\tallowJSON bool,\n\tfileVersionRequired bool,\n\tfileNameToSupportedFileVersions map[string]map[FileVersion]struct{},\n\tsuggestedFileVersion FileVersion,\n\tdefaultFileVersion FileVersion,\n) (FileVersion, error) {\n\tvar externalFileVersion externalFileVersion\n\tif err := getUnmarshalNonStrict(allowJSON)(data, &externalFileVersion); err != nil {\n\t\treturn 0, err\n\t}\n\treturn parseFileVersion(\n\t\texternalFileVersion.Version,\n\t\t\"\",\n\t\tfileVersionRequired,\n\t\tfileNameToSupportedFileVersions,\n\t\tsuggestedFileVersion,\n\t\tdefaultFileVersion,\n\t)\n}\n\nfunc parseFileVersion(\n\ts string,\n\t// optional\n\tfileName string,\n\tfileVersionRequired bool,\n\tfileNameToSupportedFileVersions map[string]map[FileVersion]struct{},\n\tsuggestedFileVersion FileVersion,\n\tdefaultFileVersion FileVersion,\n) (FileVersion, error) {\n\tif s == \"\" {\n\t\tif fileVersionRequired {\n\t\t\treturn 0, newNoFileVersionError(suggestedFileVersion)\n\t\t}\n\t\treturn defaultFileVersion, nil\n\t}\n\tc, ok := stringToFileVersion[s]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown file version: %q\", s)\n\t}\n\tif fileName != \"\" {\n\t\tif err := validateSupportedFileVersion(fileName, c, fileNameToSupportedFileVersions); err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\treturn c, nil\n}\n\nfunc validateSupportedFileVersion(fileName string, fileVersion FileVersion, fileNameToSupportedFileVersions map[string]map[FileVersion]struct{}) error {\n\tsupportedFileVersions, ok := fileNameToSupportedFileVersions[fileName]\n\tif !ok {\n\t\t// This should never happen.\n\t\treturn syserror.Newf(\"unknown configuration file name: %q\", fileName)\n\t}\n\tif _, ok := supportedFileVersions[fileVersion]; !ok {\n\t\treturn newUnsupportedFileVersionError(fileName, fileVersion)\n\t}\n\treturn nil\n}\n\n// externalFileVersion represents just the version component of any file.\ntype externalFileVersion struct {\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n}\n\n// newNoFileVersionError returns a new error when a FileVersion is required but was not found.\n//\n// The suggested FileVersion is printed in the error.\nfunc newNoFileVersionError(suggestedFileVersion FileVersion) error {\n\treturn fmt.Errorf(`\"version\" is not set. Please add \"version: %s\"`, suggestedFileVersion.String())\n}\n\nfunc newUnsupportedFileVersionError(name string, fileVersion FileVersion) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"%s is not supported\", fileVersion.String())\n\t}\n\treturn fmt.Errorf(\"%s is not supported for %s files\", fileVersion.String(), name)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/generate_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\n\t\"buf.build/go/standard/xslices\"\n)\n\n// GenerateConfig is a generation configuration.\ntype GenerateConfig interface {\n\t// CleanPluginOuts is whether to delete the output directories, zip files, or jar files before\n\t// generation is run.\n\tCleanPluginOuts() bool\n\t// GeneratePluginConfigs returns the plugin configurations. This will always be\n\t// non-empty. Zero plugin configs will cause an error at construction time.\n\tGeneratePluginConfigs() []GeneratePluginConfig\n\t// GenerateManagedConfig returns the managed mode configuration.\n\t// This may will never be nil.\n\tGenerateManagedConfig() GenerateManagedConfig\n\t// GenerateTypeConfig returns the types to generate code for. This overrides other type\n\t// filters from input configurations, which exist in v2.\n\t// This will always be nil in v2\n\tGenerateTypeConfig() GenerateTypeConfig\n\n\tisGenerateConfig()\n}\n\n// NewGenerateConfig returns a validated GenerateConfig.\nfunc NewGenerateConfig(\n\tcleanPluginOuts bool,\n\tgeneratePluginConfigs []GeneratePluginConfig,\n\tgenerateManagedConfig GenerateManagedConfig,\n\tgenerateTypeConfig GenerateTypeConfig,\n) (GenerateConfig, error) {\n\tif len(generatePluginConfigs) == 0 {\n\t\treturn nil, newNoPluginsError()\n\t}\n\treturn &generateConfig{\n\t\tcleanPluginOuts:       cleanPluginOuts,\n\t\tgeneratePluginConfigs: generatePluginConfigs,\n\t\tgenerateManagedConfig: generateManagedConfig,\n\t\tgenerateTypeConfig:    generateTypeConfig,\n\t}, nil\n}\n\n// *** PRIVATE ***\n\ntype generateConfig struct {\n\tcleanPluginOuts       bool\n\tgeneratePluginConfigs []GeneratePluginConfig\n\tgenerateManagedConfig GenerateManagedConfig\n\tgenerateTypeConfig    GenerateTypeConfig\n}\n\nfunc newGenerateConfigFromExternalFileV1Beta1(\n\texternalFile externalBufGenYAMLFileV1Beta1,\n) (GenerateConfig, error) {\n\tgenerateManagedConfig, err := newGenerateManagedConfigFromExternalV1Beta1(externalFile.Managed, externalFile.Options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(externalFile.Plugins) == 0 {\n\t\treturn nil, newNoPluginsError()\n\t}\n\tgeneratePluginConfigs, err := xslices.MapError(\n\t\texternalFile.Plugins,\n\t\tnewGeneratePluginConfigFromExternalV1Beta1,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &generateConfig{\n\t\tgeneratePluginConfigs: generatePluginConfigs,\n\t\tgenerateManagedConfig: generateManagedConfig,\n\t}, nil\n}\n\nfunc newGenerateConfigFromExternalFileV1(\n\texternalFile externalBufGenYAMLFileV1,\n) (GenerateConfig, error) {\n\tgenerateManagedConfig, err := newGenerateManagedConfigFromExternalV1(externalFile.Managed)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(externalFile.Plugins) == 0 {\n\t\treturn nil, newNoPluginsError()\n\t}\n\tgeneratePluginConfigs, err := xslices.MapError(\n\t\texternalFile.Plugins,\n\t\tnewGeneratePluginConfigFromExternalV1,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &generateConfig{\n\t\tgeneratePluginConfigs: generatePluginConfigs,\n\t\tgenerateManagedConfig: generateManagedConfig,\n\t\tgenerateTypeConfig:    newGenerateTypeConfig(externalFile.Types.Include),\n\t}, nil\n}\n\nfunc newGenerateConfigFromExternalFileV2(\n\texternalFile externalBufGenYAMLFileV2,\n) (GenerateConfig, error) {\n\tgenerateManagedConfig, err := newGenerateManagedConfigFromExternalV2(externalFile.Managed)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgeneratePluginConfigs, err := xslices.MapError(\n\t\texternalFile.Plugins,\n\t\tnewGeneratePluginConfigFromExternalV2,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &generateConfig{\n\t\tcleanPluginOuts:       externalFile.Clean,\n\t\tgenerateManagedConfig: generateManagedConfig,\n\t\tgeneratePluginConfigs: generatePluginConfigs,\n\t}, nil\n}\n\nfunc (g *generateConfig) CleanPluginOuts() bool {\n\treturn g.cleanPluginOuts\n}\n\nfunc (g *generateConfig) GeneratePluginConfigs() []GeneratePluginConfig {\n\treturn g.generatePluginConfigs\n}\n\nfunc (g *generateConfig) GenerateManagedConfig() GenerateManagedConfig {\n\treturn g.generateManagedConfig\n}\n\nfunc (g *generateConfig) GenerateTypeConfig() GenerateTypeConfig {\n\treturn g.generateTypeConfig\n}\n\nfunc (*generateConfig) isGenerateConfig() {}\n\nfunc newNoPluginsError() error {\n\treturn errors.New(\"must specify at least one plugin\")\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/generate_config_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestParseConfigFromExternalV1(t *testing.T) {\n\tt.Parallel()\n\ttestcases := []struct {\n\t\tdescription    string\n\t\texternalConfig externalBufGenYAMLFileV1\n\t\texpectedConfig GenerateConfig\n\t}{\n\t\t{\n\t\t\tdescription: \"name_local_plugin_strategy\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     \"java\",\n\t\t\t\t\t\tOut:      \"java/out\",\n\t\t\t\t\t\tOpt:      \"a=b,c\",\n\t\t\t\t\t\tStrategy: \"all\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"java\",\n\t\t\t\t\t\tout:                      \"java/out\",\n\t\t\t\t\t\t// one string because it's one string in the config\n\t\t\t\t\t\topts:     []string{\"a=b,c\"},\n\t\t\t\t\t\tstrategy: toPointer(GenerateStrategyAll),\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: \"plugin_local_plugin_strategy\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin:   \"java\",\n\t\t\t\t\t\tOut:      \"java/out\",\n\t\t\t\t\t\tOpt:      \"a\",\n\t\t\t\t\t\tStrategy: \"all\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"java\",\n\t\t\t\t\t\tout:                      \"java/out\",\n\t\t\t\t\t\topts:                     []string{\"a\"},\n\t\t\t\t\t\tstrategy:                 toPointer(GenerateStrategyAll),\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: \"name_binary_plugin_with_string_slice_path_and_opts\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     \"go\",\n\t\t\t\t\t\tOut:      \"go/out\",\n\t\t\t\t\t\tPath:     xslices.Map([]string{\"go\", \"run\", \"goplugin\"}, func(s string) any { return s }),\n\t\t\t\t\t\tOpt:      xslices.Map([]string{\"a=b\", \"c\"}, func(s string) any { return s }),\n\t\t\t\t\t\tStrategy: \"directory\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocal,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t\tpath:                     []string{\"go\", \"run\", \"goplugin\"},\n\t\t\t\t\t\topts:                     []string{\"a=b\", \"c\"},\n\t\t\t\t\t\tstrategy:                 toPointer(GenerateStrategyDirectory),\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: \"plugin_binary_plugin_with_string_slice_path_and_opts\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin:   \"go\",\n\t\t\t\t\t\tOut:      \"go/out\",\n\t\t\t\t\t\tPath:     xslices.Map([]string{\"go\", \"run\", \"goplugin\"}, func(s string) any { return s }),\n\t\t\t\t\t\tOpt:      xslices.Map([]string{\"a=b\", \"c\"}, func(s string) any { return s }),\n\t\t\t\t\t\tStrategy: \"directory\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocal,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t\tpath:                     []string{\"go\", \"run\", \"goplugin\"},\n\t\t\t\t\t\topts:                     []string{\"a=b\", \"c\"},\n\t\t\t\t\t\tstrategy:                 toPointer(GenerateStrategyDirectory),\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: \"name_binary_plugin_with_string_path\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: \"go2\",\n\t\t\t\t\t\tOut:  \"go2/out\",\n\t\t\t\t\t\tPath: \"protoc-gen-go\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocal,\n\t\t\t\t\t\tname:                     \"go2\",\n\t\t\t\t\t\tout:                      \"go2/out\",\n\t\t\t\t\t\tpath:                     []string{\"protoc-gen-go\"},\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: \"plugin_binary_plugin_with_string_path\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go2\",\n\t\t\t\t\t\tOut:    \"go2/out\",\n\t\t\t\t\t\tPath:   \"protoc-gen-go\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocal,\n\t\t\t\t\t\tname:                     \"go2\",\n\t\t\t\t\t\tout:                      \"go2/out\",\n\t\t\t\t\t\tpath:                     []string{\"protoc-gen-go\"},\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: \"name_protoc_builtin_plugin\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:       \"cpp\",\n\t\t\t\t\t\tOut:        \"cpp/out\",\n\t\t\t\t\t\tProtocPath: \"path/to/protoc\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeProtocBuiltin,\n\t\t\t\t\t\tname:                     \"cpp\",\n\t\t\t\t\t\tout:                      \"cpp/out\",\n\t\t\t\t\t\tprotocPath:               []string{\"path/to/protoc\"},\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: \"plugin_protoc_builtin_plugin\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin:     \"cpp\",\n\t\t\t\t\t\tOut:        \"cpp/out\",\n\t\t\t\t\t\tProtocPath: []any{\"path/to/protoc\", \"--experimental_editions\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeProtocBuiltin,\n\t\t\t\t\t\tname:                     \"cpp\",\n\t\t\t\t\t\tout:                      \"cpp/out\",\n\t\t\t\t\t\tprotocPath:               []string{\"path/to/protoc\", \"--experimental_editions\"},\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: \"remote_plugin_reference\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin:   \"buf.build/protocolbuffers/go:v1.31.0\",\n\t\t\t\t\t\tOut:      \"go/out\",\n\t\t\t\t\t\tRevision: 1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeRemote,\n\t\t\t\t\t\tremoteHost:               \"buf.build\",\n\t\t\t\t\t\trevision:                 1,\n\t\t\t\t\t\tname:                     \"buf.build/protocolbuffers/go:v1.31.0\",\n\t\t\t\t\t\tout:                      \"go/out\",\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: \"remote_plugin_identity\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin:   \"buf.build/protocolbuffers/go\",\n\t\t\t\t\t\tOut:      \"go/out\",\n\t\t\t\t\t\tRevision: 1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{enabled: false},\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeRemote,\n\t\t\t\t\t\tremoteHost:               \"buf.build\",\n\t\t\t\t\t\trevision:                 1,\n\t\t\t\t\t\tname:                     \"buf.build/protocolbuffers/go\",\n\t\t\t\t\t\tout:                      \"go/out\",\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: \"managed_mode_empty\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t},\n\t\t\t},\n\t\t\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"managed_mode_bools_and_java_package\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled:             true,\n\t\t\t\t\tCcEnableArenas:      proto.Bool(true),\n\t\t\t\t\tJavaMultipleFiles:   proto.Bool(true),\n\t\t\t\t\tJavaStringCheckUtf8: proto.Bool(true),\n\t\t\t\t\tJavaPackagePrefix: externalJavaPackagePrefixConfigV1{\n\t\t\t\t\t\tDefault: \"foo\",\n\t\t\t\t\t\tExcept:  []string{\"buf.build/acme/foo\", \"buf.build/acme/bar\"},\n\t\t\t\t\t\tOverride: map[string]string{\n\t\t\t\t\t\t\t\"buf.build/acme/weatherapis\": \"weather\",\n\t\t\t\t\t\t\t\"buf.build/acme/paymentapis\": \"payment\",\n\t\t\t\t\t\t\t\"buf.build/acme/petapis\":     \"pet\",\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\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tdisables: []ManagedDisableRule{\n\t\t\t\t\t\t&managedDisableRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionJavaPackage,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedDisableRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionJavaPackage,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/bar\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\toverrides: []ManagedOverrideRule{\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionCcEnableArenas,\n\t\t\t\t\t\t\tvalue:      true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionJavaMultipleFiles,\n\t\t\t\t\t\t\tvalue:      true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionJavaStringCheckUtf8,\n\t\t\t\t\t\t\tvalue:      true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionJavaPackagePrefix,\n\t\t\t\t\t\t\tvalue:      \"foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t// the next three rules are ordered by their module names\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionJavaPackagePrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/paymentapis\",\n\t\t\t\t\t\t\tvalue:          \"payment\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionJavaPackagePrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/petapis\",\n\t\t\t\t\t\t\tvalue:          \"pet\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionJavaPackagePrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/weatherapis\",\n\t\t\t\t\t\t\tvalue:          \"weather\",\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\tdescription: \"managed_mode_optimize_for\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t\tOptimizeFor: externalOptimizeForConfigV1{\n\t\t\t\t\t\tDefault: \"LITE_RUNTIME\",\n\t\t\t\t\t\tExcept:  []string{\"buf.build/acme/foo\"},\n\t\t\t\t\t\tOverride: map[string]string{\n\t\t\t\t\t\t\t\"buf.build/acme/petapis\":     \"CODE_SIZE\",\n\t\t\t\t\t\t\t\"buf.build/acme/paymentapis\": \"SPEED\",\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\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tdisables: []ManagedDisableRule{\n\t\t\t\t\t\t&managedDisableRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionOptimizeFor,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\toverrides: []ManagedOverrideRule{\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionOptimizeFor,\n\t\t\t\t\t\t\tvalue:      descriptorpb.FileOptions_LITE_RUNTIME,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionOptimizeFor,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/paymentapis\",\n\t\t\t\t\t\t\tvalue:          descriptorpb.FileOptions_SPEED,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionOptimizeFor,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/petapis\",\n\t\t\t\t\t\t\tvalue:          descriptorpb.FileOptions_CODE_SIZE,\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\tdescription: \"managed_mode_go_package_prefix\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t\tGoPackagePrefix: externalGoPackagePrefixConfigV1{\n\t\t\t\t\t\tDefault: \"foo\",\n\t\t\t\t\t\tExcept:  []string{\"buf.build/acme/foo\"},\n\t\t\t\t\t\tOverride: map[string]string{\n\t\t\t\t\t\t\t\"buf.build/acme/petapis\": \"pet\",\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\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tdisables: []ManagedDisableRule{\n\t\t\t\t\t\t&managedDisableRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionGoPackage,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\toverrides: []ManagedOverrideRule{\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionGoPackagePrefix,\n\t\t\t\t\t\t\tvalue:      \"foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionGoPackagePrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/petapis\",\n\t\t\t\t\t\t\tvalue:          \"pet\",\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\tdescription: \"managed_mode_objc_class_prefix\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t\tObjcClassPrefix: externalObjcClassPrefixConfigV1{\n\t\t\t\t\t\tDefault: \"foo\",\n\t\t\t\t\t\tExcept:  []string{\"buf.build/acme/foo\"},\n\t\t\t\t\t\tOverride: map[string]string{\n\t\t\t\t\t\t\t\"buf.build/acme/petapis\": \"pet\",\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\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tdisables: []ManagedDisableRule{\n\t\t\t\t\t\t&managedDisableRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionObjcClassPrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\toverrides: []ManagedOverrideRule{\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionObjcClassPrefix,\n\t\t\t\t\t\t\tvalue:      \"foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionObjcClassPrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/petapis\",\n\t\t\t\t\t\t\tvalue:          \"pet\",\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\tdescription: \"managed_mode_ruby_package\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t\tRubyPackage: externalRubyPackageConfigV1{\n\t\t\t\t\t\tExcept: []string{\"buf.build/acme/foo\"},\n\t\t\t\t\t\tOverride: map[string]string{\n\t\t\t\t\t\t\t\"buf.build/acme/petapis\": \"pet\",\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\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tdisables: []ManagedDisableRule{\n\t\t\t\t\t\t&managedDisableRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionRubyPackage,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\toverrides: []ManagedOverrideRule{\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionRubyPackage,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/petapis\",\n\t\t\t\t\t\t\tvalue:          \"pet\",\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\tdescription: \"managed_mode_swift_prefix\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t\tSwiftPrefix: externalSwiftPrefixConfigV1{\n\t\t\t\t\t\tDefault: \"foo\",\n\t\t\t\t\t\tExcept:  []string{\"buf.build/acme/foo\"},\n\t\t\t\t\t\tOverride: map[string]string{\n\t\t\t\t\t\t\t\"buf.build/acme/petapis\": \"pet\",\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\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tdisables: []ManagedDisableRule{\n\t\t\t\t\t\t&managedDisableRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionSwiftPrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\toverrides: []ManagedOverrideRule{\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionSwiftPrefix,\n\t\t\t\t\t\t\tvalue:      \"foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption:     FileOptionSwiftPrefix,\n\t\t\t\t\t\t\tmoduleFullName: \"buf.build/acme/petapis\",\n\t\t\t\t\t\t\tvalue:          \"pet\",\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\tdescription: \"managed_mode_per_file_override\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"go\",\n\t\t\t\t\t\tOut:    \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tManaged: externalGenerateManagedConfigV1{\n\t\t\t\t\tEnabled: true,\n\t\t\t\t\tOverride: map[string]map[string]string{\n\t\t\t\t\t\t\"JAVA_PACKAGE\": {\n\t\t\t\t\t\t\t\"foo.proto\": \"foo\",\n\t\t\t\t\t\t\t\"bar.proto\": \"bar\",\n\t\t\t\t\t\t\t\"baz.proto\": \"baz\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"CC_ENABLE_ARENAS\": {\n\t\t\t\t\t\t\t\"foo.proto\": \"false\",\n\t\t\t\t\t\t\t\"baz.proto\": \"true\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"OPTIMIZE_FOR\": {\n\t\t\t\t\t\t\t\"dir/baz.proto\": \"SPEED\",\n\t\t\t\t\t\t\t\"dir/foo.proto\": \"CODE_SIZE\",\n\t\t\t\t\t\t\t\"dir/bar.proto\": \"LITE_RUNTIME\",\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\texpectedConfig: &generateConfig{\n\t\t\t\tgeneratePluginConfigs: []GeneratePluginConfig{\n\t\t\t\t\t&generatePluginConfig{\n\t\t\t\t\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\t\t\t\t\tname:                     \"go\",\n\t\t\t\t\t\tout:                      \"go/out\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tgenerateManagedConfig: &generateManagedConfig{\n\t\t\t\t\tenabled: true,\n\t\t\t\t\toverrides: []ManagedOverrideRule{\n\t\t\t\t\t\t// ordered by file option names and then by file paths\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionCcEnableArenas,\n\t\t\t\t\t\t\tpath:       \"baz.proto\",\n\t\t\t\t\t\t\tvalue:      true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionCcEnableArenas,\n\t\t\t\t\t\t\tpath:       \"foo.proto\",\n\t\t\t\t\t\t\tvalue:      false,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionJavaPackage,\n\t\t\t\t\t\t\tpath:       \"bar.proto\",\n\t\t\t\t\t\t\tvalue:      \"bar\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionJavaPackage,\n\t\t\t\t\t\t\tpath:       \"baz.proto\",\n\t\t\t\t\t\t\tvalue:      \"baz\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionJavaPackage,\n\t\t\t\t\t\t\tpath:       \"foo.proto\",\n\t\t\t\t\t\t\tvalue:      \"foo\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionOptimizeFor,\n\t\t\t\t\t\t\tpath:       \"dir/bar.proto\",\n\t\t\t\t\t\t\tvalue:      descriptorpb.FileOptions_LITE_RUNTIME,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionOptimizeFor,\n\t\t\t\t\t\t\tpath:       \"dir/baz.proto\",\n\t\t\t\t\t\t\tvalue:      descriptorpb.FileOptions_SPEED,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t&managedOverrideRule{\n\t\t\t\t\t\t\tfileOption: FileOptionOptimizeFor,\n\t\t\t\t\t\t\tpath:       \"dir/foo.proto\",\n\t\t\t\t\t\t\tvalue:      descriptorpb.FileOptions_CODE_SIZE,\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\tfor _, testcase := range testcases {\n\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tparsedConfig, err := newGenerateConfigFromExternalFileV1(testcase.externalConfig)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.Equal(t, testcase.expectedConfig, parsedConfig)\n\t\t})\n\t}\n}\n\nfunc TestParseConfigFromExternalV1Fail(t *testing.T) {\n\tt.Parallel()\n\ttestcases := []struct {\n\t\tdescription    string\n\t\texternalConfig externalBufGenYAMLFileV1\n\t}{\n\t\t{\n\t\t\tdescription: \"empty_out\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     \"java\",\n\t\t\t\t\t\tOut:      \"\",\n\t\t\t\t\t\tOpt:      \"a=b,c\",\n\t\t\t\t\t\tStrategy: \"all\",\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: \"both_plugin_and_name\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin: \"java\",\n\t\t\t\t\t\tName:   \"go\",\n\t\t\t\t\t\tOut:    \"java/out\",\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: \"neither_plugin_nor_name\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tOut: \"java/out\",\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: \"no_plugins\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: nil,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"invalid_strategy\",\n\t\t\texternalConfig: externalBufGenYAMLFileV1{\n\t\t\t\tVersion: \"v1\",\n\t\t\t\tPlugins: []externalGeneratePluginConfigV1{\n\t\t\t\t\t{\n\t\t\t\t\t\tPlugin:   \"go\",\n\t\t\t\t\t\tOut:      \"go/out\",\n\t\t\t\t\t\tStrategy: \"invalid\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tfor _, testcase := range testcases {\n\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\t_, err := newGenerateConfigFromExternalFileV1(testcase.externalConfig)\n\t\t\trequire.Error(t, err)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/generate_managed_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// GenerateManagedConfig is a managed mode configuration.\ntype GenerateManagedConfig interface {\n\t// Enabled returns whether managed mode is enabled.\n\tEnabled() bool\n\t// Disables returns the disable rules in the configuration.\n\tDisables() []ManagedDisableRule\n\t// Overrides returns the override rules in the configuration.\n\tOverrides() []ManagedOverrideRule\n\n\tisGenerateManagedConfig()\n}\n\n// NewGenerateManagedConfig returns a new GenerateManagedConfig.\nfunc NewGenerateManagedConfig(\n\tenabled bool,\n\tdisables []ManagedDisableRule,\n\toverrides []ManagedOverrideRule,\n) GenerateManagedConfig {\n\treturn &generateManagedConfig{\n\t\tenabled:   enabled,\n\t\tdisables:  disables,\n\t\toverrides: overrides,\n\t}\n}\n\n// ManagedDisableRule is a disable rule. A disable rule describes:\n//\n//   - The options to not modify. If not specified, it means all options (both\n//     file options and field options) are not modified.\n//   - The files/fields for which these options are not modified. If not specified,\n//     it means for all files/fields the specified options are not modified.\n//\n// A ManagedDisableRule is guaranteed to specify at least one of the two aspects.\n// i.e. At least one of Path, FullName, FieldName, FileOption and\n// FieldOption is not empty. A rule can disable all options for certain files/fields,\n// disable certain options for all files/fields, or disable certain options for\n// certain files/fields. To disable all options for all files/fields, turn off managed mode.\ntype ManagedDisableRule interface {\n\t// Path returns the file path, relative to its module, to disable managed mode for.\n\tPath() string\n\t// FullName returns the full name string of the module to disable\n\t// managed mode for.\n\tFullName() string\n\t// FieldName returns the fully qualified name for the field to disable managed\n\t// mode for. This is guaranteed to be empty if FileOption is not empty.\n\tFieldName() string\n\t// FileOption returns the file option to disable managed mode for. This is\n\t// guaranteed to be empty if FieldName is not empty.\n\tFileOption() FileOption\n\t// FieldOption returns the field option to disable managed mode for.\n\tFieldOption() FieldOption\n\n\tisManagedDisableRule()\n}\n\n// NewManagedDisableRule returns a new ManagedDisableRule.\nfunc NewManagedDisableRule(\n\tpath string,\n\tmoduleFullName string,\n\tfieldName string,\n\tfileOption FileOption,\n\tfieldOption FieldOption,\n) (ManagedDisableRule, error) {\n\treturn newManagedDisableRule(\n\t\tpath,\n\t\tmoduleFullName,\n\t\tfieldName,\n\t\tfileOption,\n\t\tfieldOption,\n\t)\n}\n\n// ManagedOverrideRule is an override rule. An override describes:\n//\n//   - The options to modify. Exactly one of FileOption and FieldOption is not empty.\n//   - The value to modify these options with.\n//   - The files/fields for which the options are modified. If all of Path, FullName\n//   - or FieldName are empty, all files/fields are modified. Otherwise, only\n//     file/fields that match the specified Path, FullName and FieldName\n//     is modified.\ntype ManagedOverrideRule interface {\n\t// Path is the file path, relative to its module, to disable managed mode for.\n\tPath() string\n\t// FullName is the full name string of the module to disable\n\t// managed mode for.\n\tFullName() string\n\t// FieldName is the fully qualified name for the field to disable managed\n\t// mode for. This is guaranteed to be empty is FileOption is not empty.\n\tFieldName() string\n\t// FileOption returns the file option to disable managed mode for. This is\n\t// guaranteed to be empty (FileOptionUnspecified) if FieldName is empty.\n\tFileOption() FileOption\n\t// FieldOption returns the field option to disable managed mode for.\n\tFieldOption() FieldOption\n\t// Value returns the override value.\n\tValue() any\n\n\tisManagedOverrideRule()\n}\n\n// NewManagedOverrideRuleForFileOption returns a new ManagedOverrideRule for a file option.\nfunc NewManagedOverrideRuleForFileOption(\n\tpath string,\n\tmoduleFullName string,\n\tfileOption FileOption,\n\tvalue any,\n) (ManagedOverrideRule, error) {\n\treturn newFileOptionManagedOverrideRule(\n\t\tpath,\n\t\tmoduleFullName,\n\t\tfileOption,\n\t\tvalue,\n\t)\n}\n\n// NewManagedOverrideRuleForFieldOption returns a new ManagedOverrideRule for a field option.\nfunc NewManagedOverrideRuleForFieldOption(\n\tpath string,\n\tmoduleFullName string,\n\tfieldName string,\n\tfieldOption FieldOption,\n\tvalue any,\n) (ManagedOverrideRule, error) {\n\treturn newFieldOptionManagedOverrideRule(\n\t\tpath,\n\t\tmoduleFullName,\n\t\tfieldName,\n\t\tfieldOption,\n\t\tvalue,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype generateManagedConfig struct {\n\tenabled   bool\n\tdisables  []ManagedDisableRule\n\toverrides []ManagedOverrideRule\n}\n\nfunc newGenerateManagedConfigFromExternalV1Beta1(\n\tenabled bool,\n\texternalConfig externalGenerateManagedConfigV1Beta1,\n) (GenerateManagedConfig, error) {\n\tvar (\n\t\toverrides []ManagedOverrideRule\n\t)\n\tif externalCCEnableArenas := externalConfig.CcEnableArenas; externalCCEnableArenas != nil {\n\t\toverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionCcEnableArenas,\n\t\t\t*externalCCEnableArenas,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, override)\n\t}\n\tif externalJavaMultipleFiles := externalConfig.JavaMultipleFiles; externalJavaMultipleFiles != nil {\n\t\toverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionJavaMultipleFiles,\n\t\t\t*externalJavaMultipleFiles,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, override)\n\t}\n\tif externalOptimizeFor := externalConfig.OptimizeFor; externalOptimizeFor != \"\" {\n\t\tdefaultOverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionOptimizeFor,\n\t\t\texternalOptimizeFor,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, defaultOverride)\n\t}\n\treturn &generateManagedConfig{\n\t\tenabled:   enabled,\n\t\toverrides: overrides,\n\t}, nil\n}\n\nfunc newGenerateManagedConfigFromExternalV1(\n\texternalConfig externalGenerateManagedConfigV1,\n) (GenerateManagedConfig, error) {\n\tvar (\n\t\tdisables  []ManagedDisableRule\n\t\toverrides []ManagedOverrideRule\n\t)\n\tif externalCCEnableArenas := externalConfig.CcEnableArenas; externalCCEnableArenas != nil {\n\t\toverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionCcEnableArenas,\n\t\t\t*externalCCEnableArenas,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, override)\n\t}\n\tif externalJavaMultipleFiles := externalConfig.JavaMultipleFiles; externalJavaMultipleFiles != nil {\n\t\toverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionJavaMultipleFiles,\n\t\t\t*externalJavaMultipleFiles,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, override)\n\t}\n\tif externalJavaStringCheckUtf8 := externalConfig.JavaStringCheckUtf8; externalJavaStringCheckUtf8 != nil {\n\t\toverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionJavaStringCheckUtf8,\n\t\t\t*externalJavaStringCheckUtf8,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, override)\n\t}\n\tif externalJavaPackagePrefix := externalConfig.JavaPackagePrefix; !externalJavaPackagePrefix.isEmpty() {\n\t\tif externalJavaPackagePrefix.Default == \"\" {\n\t\t\treturn nil, errors.New(\"java_package_prefix requires a default value\")\n\t\t}\n\t\tdefaultOverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionJavaPackagePrefix,\n\t\t\texternalJavaPackagePrefix.Default,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, defaultOverride)\n\t\tjavaPackagePrefixDisables, javaPackagePrefixOverrides, err := disablesAndOverridesFromExceptAndOverrideV1(\n\t\t\tFileOptionJavaPackage,\n\t\t\texternalJavaPackagePrefix.Except,\n\t\t\tFileOptionJavaPackagePrefix,\n\t\t\texternalJavaPackagePrefix.Override,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, javaPackagePrefixDisables...)\n\t\toverrides = append(overrides, javaPackagePrefixOverrides...)\n\t}\n\tif externalCsharpNamespace := externalConfig.CsharpNamespace; !externalCsharpNamespace.isEmpty() {\n\t\tcsharpNamespaceDisables, csharpNamespaceOverrides, err := disablesAndOverridesFromExceptAndOverrideV1(\n\t\t\tFileOptionCsharpNamespace,\n\t\t\texternalCsharpNamespace.Except,\n\t\t\tFileOptionCsharpNamespace,\n\t\t\texternalCsharpNamespace.Override,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, csharpNamespaceDisables...)\n\t\toverrides = append(overrides, csharpNamespaceOverrides...)\n\t}\n\tif externalOptimizeFor := externalConfig.OptimizeFor; !externalOptimizeFor.isEmpty() {\n\t\tif externalOptimizeFor.Default == \"\" {\n\t\t\treturn nil, errors.New(\"optimize_for requires a default value\")\n\t\t}\n\t\tdefaultOverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionOptimizeFor,\n\t\t\texternalOptimizeFor.Default,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, defaultOverride)\n\t\toptimizeForDisables, optimizeForOverrides, err := disablesAndOverridesFromExceptAndOverrideV1(\n\t\t\tFileOptionOptimizeFor,\n\t\t\texternalOptimizeFor.Except,\n\t\t\tFileOptionOptimizeFor,\n\t\t\texternalOptimizeFor.Override,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, optimizeForDisables...)\n\t\toverrides = append(overrides, optimizeForOverrides...)\n\t}\n\tif externalGoPackagePrefix := externalConfig.GoPackagePrefix; !externalGoPackagePrefix.isEmpty() {\n\t\tif externalGoPackagePrefix.Default == \"\" {\n\t\t\treturn nil, errors.New(\"go_package_prefix requires a default value\")\n\t\t}\n\t\tdefaultOverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\t\"\",\n\t\t\tFileOptionGoPackagePrefix,\n\t\t\texternalGoPackagePrefix.Default,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, defaultOverride)\n\t\tgoPackagePrefixDisables, goPackagePrefixOverrides, err := disablesAndOverridesFromExceptAndOverrideV1(\n\t\t\tFileOptionGoPackage,\n\t\t\texternalGoPackagePrefix.Except,\n\t\t\tFileOptionGoPackagePrefix,\n\t\t\texternalGoPackagePrefix.Override,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, goPackagePrefixDisables...)\n\t\toverrides = append(overrides, goPackagePrefixOverrides...)\n\t}\n\tif externalObjcClassPrefix := externalConfig.ObjcClassPrefix; !externalObjcClassPrefix.isEmpty() {\n\t\tif externalObjcClassPrefix.Default != \"\" {\n\t\t\t// objc class prefix allows empty default\n\t\t\tdefaultOverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\t\"\",\n\t\t\t\t\"\",\n\t\t\t\tFileOptionObjcClassPrefix,\n\t\t\t\texternalObjcClassPrefix.Default,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\toverrides = append(overrides, defaultOverride)\n\t\t}\n\t\tobjcClassPrefixDisables, objcClassPrefixOverrides, err := disablesAndOverridesFromExceptAndOverrideV1(\n\t\t\tFileOptionObjcClassPrefix,\n\t\t\texternalObjcClassPrefix.Except,\n\t\t\tFileOptionObjcClassPrefix,\n\t\t\texternalObjcClassPrefix.Override,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, objcClassPrefixDisables...)\n\t\toverrides = append(overrides, objcClassPrefixOverrides...)\n\t}\n\tif externalRubyPackage := externalConfig.RubyPackage; !externalRubyPackage.isEmpty() {\n\t\trubyPackageDisables, rubyPackageOverrides, err := disablesAndOverridesFromExceptAndOverrideV1(\n\t\t\tFileOptionRubyPackage,\n\t\t\texternalRubyPackage.Except,\n\t\t\tFileOptionRubyPackage,\n\t\t\texternalRubyPackage.Override,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, rubyPackageDisables...)\n\t\toverrides = append(overrides, rubyPackageOverrides...)\n\t}\n\tif externalSwiftPrefix := externalConfig.SwiftPrefix; !externalSwiftPrefix.isEmpty() {\n\t\tif externalSwiftPrefix.Default != \"\" {\n\t\t\t// objc class prefix allows empty default\n\t\t\tdefaultOverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\t\"\",\n\t\t\t\t\"\",\n\t\t\t\tFileOptionSwiftPrefix,\n\t\t\t\texternalSwiftPrefix.Default,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\toverrides = append(overrides, defaultOverride)\n\t\t}\n\t\tswiftPrefixDisables, swiftPrefixOverrides, err := disablesAndOverridesFromExceptAndOverrideV1(\n\t\t\tFileOptionSwiftPrefix,\n\t\t\texternalSwiftPrefix.Except,\n\t\t\tFileOptionSwiftPrefix,\n\t\t\texternalSwiftPrefix.Override,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, swiftPrefixDisables...)\n\t\toverrides = append(overrides, swiftPrefixOverrides...)\n\t}\n\tperFileOverrides, err := overrideRulesForPerFileOverridesV1(externalConfig.Override)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\toverrides = append(overrides, perFileOverrides...)\n\treturn &generateManagedConfig{\n\t\tenabled:   externalConfig.Enabled,\n\t\tdisables:  disables,\n\t\toverrides: overrides,\n\t}, nil\n}\n\nfunc newGenerateManagedConfigFromExternalV2(\n\texternalConfig externalGenerateManagedConfigV2,\n) (GenerateManagedConfig, error) {\n\tvar disables []ManagedDisableRule\n\tvar overrides []ManagedOverrideRule\n\tfor _, externalDisableConfig := range externalConfig.Disable {\n\t\tvar (\n\t\t\tfileOption  FileOption\n\t\t\tfieldOption FieldOption\n\t\t\terr         error\n\t\t)\n\t\tif externalDisableConfig.FileOption != \"\" {\n\t\t\tfileOption, err = parseFileOption(externalDisableConfig.FileOption)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tif externalDisableConfig.FieldOption != \"\" {\n\t\t\tfieldOption, err = parseFieldOption(externalDisableConfig.FieldOption)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tdisable, err := newManagedDisableRule(\n\t\t\texternalDisableConfig.Path,\n\t\t\texternalDisableConfig.Module,\n\t\t\texternalDisableConfig.Field,\n\t\t\tfileOption,\n\t\t\tfieldOption,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdisables = append(disables, disable)\n\t}\n\tfor _, externalOverrideConfig := range externalConfig.Override {\n\t\tif externalOverrideConfig.FileOption == \"\" && externalOverrideConfig.FieldOption == \"\" {\n\t\t\treturn nil, errors.New(\"must set file_option or field_option for an override\")\n\t\t}\n\t\tif externalOverrideConfig.FileOption != \"\" && externalOverrideConfig.FieldOption != \"\" {\n\t\t\treturn nil, errors.New(\"exactly one of file_option and field_option must be set for an override\")\n\t\t}\n\t\tif externalOverrideConfig.Value == nil {\n\t\t\treturn nil, errors.New(\"must set value for an override\")\n\t\t}\n\t\tif externalOverrideConfig.FieldOption != \"\" {\n\t\t\tfieldOption, err := parseFieldOption(externalOverrideConfig.FieldOption)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\toverride, err := NewManagedOverrideRuleForFieldOption(\n\t\t\t\texternalOverrideConfig.Path,\n\t\t\t\texternalOverrideConfig.Module,\n\t\t\t\texternalOverrideConfig.Field,\n\t\t\t\tfieldOption,\n\t\t\t\texternalOverrideConfig.Value,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\toverrides = append(overrides, override)\n\t\t\tcontinue\n\t\t}\n\t\tif externalOverrideConfig.Field != \"\" {\n\t\t\treturn nil, errors.New(\"must not set field for a file_option override\")\n\t\t}\n\t\tfileOption, err := parseFileOption(externalOverrideConfig.FileOption)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\texternalOverrideConfig.Path,\n\t\t\texternalOverrideConfig.Module,\n\t\t\tfileOption,\n\t\t\texternalOverrideConfig.Value,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toverrides = append(overrides, override)\n\t}\n\treturn &generateManagedConfig{\n\t\tenabled:   externalConfig.Enabled,\n\t\tdisables:  disables,\n\t\toverrides: overrides,\n\t}, nil\n}\n\nfunc (g *generateManagedConfig) Enabled() bool {\n\treturn g.enabled\n}\n\nfunc (g *generateManagedConfig) Disables() []ManagedDisableRule {\n\treturn g.disables\n}\n\nfunc (g *generateManagedConfig) Overrides() []ManagedOverrideRule {\n\treturn g.overrides\n}\n\nfunc (g *generateManagedConfig) isGenerateManagedConfig() {}\n\ntype managedDisableRule struct {\n\tpath           string\n\tmoduleFullName string\n\tfieldName      string\n\tfileOption     FileOption\n\tfieldOption    FieldOption\n}\n\nfunc newManagedDisableRule(\n\tpath string,\n\tmoduleFullName string,\n\tfieldName string,\n\tfileOption FileOption,\n\tfieldOption FieldOption,\n) (ManagedDisableRule, error) {\n\tif path == \"\" && moduleFullName == \"\" && fieldName == \"\" && fileOption == FileOptionUnspecified && fieldOption == FieldOptionUnspecified {\n\t\treturn nil, errors.New(\"empty disable rule is not allowed\")\n\t}\n\tif fieldName != \"\" && fileOption != FileOptionUnspecified {\n\t\treturn nil, errors.New(\"cannot disable a file option for a field\")\n\t}\n\tif fileOption != FileOptionUnspecified && fieldOption != FieldOptionUnspecified {\n\t\treturn nil, errors.New(\"at most one of file_option and field_option can be specified\")\n\t}\n\tif path != \"\" {\n\t\tif err := validatePath(path); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid path for disable rule: %w\", err)\n\t\t}\n\t}\n\tif moduleFullName != \"\" {\n\t\tif _, err := bufparse.ParseFullName(moduleFullName); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &managedDisableRule{\n\t\tpath:           path,\n\t\tmoduleFullName: moduleFullName,\n\t\tfieldName:      fieldName,\n\t\tfileOption:     fileOption,\n\t\tfieldOption:    fieldOption,\n\t}, nil\n}\n\nfunc (m *managedDisableRule) Path() string {\n\treturn m.path\n}\n\nfunc (m *managedDisableRule) FullName() string {\n\treturn m.moduleFullName\n}\n\nfunc (m *managedDisableRule) FieldName() string {\n\treturn m.fieldName\n}\n\nfunc (m *managedDisableRule) FileOption() FileOption {\n\treturn m.fileOption\n}\n\nfunc (m *managedDisableRule) FieldOption() FieldOption {\n\treturn m.fieldOption\n}\n\nfunc (m *managedDisableRule) isManagedDisableRule() {}\n\ntype managedOverrideRule struct {\n\tpath           string\n\tmoduleFullName string\n\tfieldName      string\n\tfileOption     FileOption\n\tfieldOption    FieldOption\n\tvalue          any\n}\n\nfunc newFileOptionManagedOverrideRule(\n\tpath string,\n\tmoduleFullName string,\n\tfileOption FileOption,\n\tvalue any,\n) (*managedOverrideRule, error) {\n\t// All valid file options have a parse func. This lookup implicitly validates the option.\n\tparseOverrideValueFunc, ok := fileOptionToParseOverrideValueFunc[fileOption]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid fileOption: %v\", fileOption)\n\t}\n\tif value == nil {\n\t\treturn nil, fmt.Errorf(\"value must be specified for override\")\n\t}\n\tparsedValue, err := parseOverrideValueFunc(value)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid value %v for %v: %w\", value, fileOption, err)\n\t}\n\tif moduleFullName != \"\" {\n\t\tif _, err := bufparse.ParseFullName(moduleFullName); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid module name for %v override: %w\", fileOption, err)\n\t\t}\n\t}\n\tif path != \"\" {\n\t\tif err := validatePath(path); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid path for %v override: %w\", fileOption, err)\n\t\t}\n\t}\n\treturn &managedOverrideRule{\n\t\tpath:           path,\n\t\tmoduleFullName: moduleFullName,\n\t\tfileOption:     fileOption,\n\t\tvalue:          parsedValue,\n\t}, nil\n}\n\nfunc newFieldOptionManagedOverrideRule(\n\tpath string,\n\tmoduleFullName string,\n\tfieldName string,\n\tfieldOption FieldOption,\n\tvalue any,\n) (ManagedOverrideRule, error) {\n\t// All valid field options have a parse func. This lookup implicitly validates the option.\n\tparseOverrideValueFunc, ok := fieldOptionToParseOverrideValueFunc[fieldOption]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid fieldOption: %v\", fieldOption)\n\t}\n\tif value == nil {\n\t\treturn nil, fmt.Errorf(\"value must be specified for override\")\n\t}\n\tparsedValue, err := parseOverrideValueFunc(value)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid value %v for %v: %w\", value, fieldOption, err)\n\t}\n\tif moduleFullName != \"\" {\n\t\tif _, err := bufparse.ParseFullName(moduleFullName); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid module name for %v override: %w\", fieldOption, err)\n\t\t}\n\t}\n\tif path != \"\" {\n\t\tif err := validatePath(path); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid path for %v override: %w\", fieldOption, err)\n\t\t}\n\t}\n\treturn &managedOverrideRule{\n\t\tpath:           path,\n\t\tmoduleFullName: moduleFullName,\n\t\tfieldName:      fieldName,\n\t\tfieldOption:    fieldOption,\n\t\tvalue:          parsedValue,\n\t}, nil\n}\n\nfunc (m *managedOverrideRule) Path() string {\n\treturn m.path\n}\n\nfunc (m *managedOverrideRule) FullName() string {\n\treturn m.moduleFullName\n}\n\nfunc (m *managedOverrideRule) FieldName() string {\n\treturn m.fieldName\n}\n\nfunc (m *managedOverrideRule) FileOption() FileOption {\n\treturn m.fileOption\n}\n\nfunc (m *managedOverrideRule) FieldOption() FieldOption {\n\treturn m.fieldOption\n}\n\nfunc (m *managedOverrideRule) Value() any {\n\treturn m.value\n}\n\nfunc (m *managedOverrideRule) isManagedOverrideRule() {}\n\nfunc disablesAndOverridesFromExceptAndOverrideV1(\n\texceptFileOption FileOption,\n\texceptFullNames []string,\n\toverrideFileOption FileOption,\n\tmoduleFullNameToOverride map[string]string,\n) ([]ManagedDisableRule, []ManagedOverrideRule, error) {\n\tvar (\n\t\tdisables  []ManagedDisableRule\n\t\toverrides []ManagedOverrideRule\n\t)\n\tseenExceptFullNames := make(map[string]struct{}, len(exceptFullNames))\n\tfor _, exceptFullName := range exceptFullNames {\n\t\tif _, err := bufparse.ParseFullName(exceptFullName); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif _, ok := seenExceptFullNames[exceptFullName]; ok {\n\t\t\treturn nil, nil, fmt.Errorf(\"%q is defined multiple times in except\", exceptFullName)\n\t\t}\n\t\tseenExceptFullNames[exceptFullName] = struct{}{}\n\t\tdisable, err := newManagedDisableRule(\n\t\t\t\"\",\n\t\t\texceptFullName,\n\t\t\t\"\",\n\t\t\texceptFileOption,\n\t\t\tFieldOptionUnspecified,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tdisables = append(disables, disable)\n\t}\n\t// Sort by keys for deterministic order.\n\tsortedFullNames := xslices.MapKeysToSortedSlice(moduleFullNameToOverride)\n\tfor _, overrideFullName := range sortedFullNames {\n\t\tif _, err := bufparse.ParseFullName(overrideFullName); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tif _, ok := seenExceptFullNames[overrideFullName]; ok {\n\t\t\treturn nil, nil, fmt.Errorf(\"override %q is already defined as an except\", overrideFullName)\n\t\t}\n\t\toverride, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\"\",\n\t\t\toverrideFullName,\n\t\t\toverrideFileOption,\n\t\t\tmoduleFullNameToOverride[overrideFullName],\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\toverrides = append(overrides, override)\n\t}\n\treturn disables, overrides, nil\n}\n\nfunc overrideRulesForPerFileOverridesV1(\n\tfileOptionToFilePathToOverride map[string]map[string]string,\n) ([]ManagedOverrideRule, error) {\n\tvar overrideRules []ManagedOverrideRule\n\tsortedFileOptionStrings := xslices.MapKeysToSortedSlice(fileOptionToFilePathToOverride)\n\tfor _, fileOptionString := range sortedFileOptionStrings {\n\t\tfileOption, ok := stringToFileOption[strings.ToLower(fileOptionString)]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"%q is not a valid file option\", fileOptionString)\n\t\t}\n\t\tfilePathToOverride := fileOptionToFilePathToOverride[fileOptionString]\n\t\tsortedFilePaths := xslices.MapKeysToSortedSlice(filePathToOverride)\n\t\tfor _, filePath := range sortedFilePaths {\n\t\t\terr := validatePath(filePath)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid import path for override %s: %w\", fileOptionString, err)\n\t\t\t}\n\t\t\toverrideString := filePathToOverride[filePath]\n\t\t\tvar overrideValue any = overrideString\n\t\t\tswitch fileOption {\n\t\t\tcase FileOptionCcEnableArenas, FileOptionJavaMultipleFiles, FileOptionJavaStringCheckUtf8:\n\t\t\t\toverrideValue, err = strconv.ParseBool(overrideString)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"\")\n\t\t\t\t}\n\t\t\t}\n\t\t\toverrideRule, err := NewManagedOverrideRuleForFileOption(\n\t\t\t\tfilePath,\n\t\t\t\t\"\",\n\t\t\t\tfileOption,\n\t\t\t\toverrideValue,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\toverrideRules = append(overrideRules, overrideRule)\n\t\t}\n\t}\n\treturn overrideRules, nil\n}\n\nfunc newExternalManagedConfigV2FromGenerateManagedConfig(\n\tmanagedConfig GenerateManagedConfig,\n) (externalGenerateManagedConfigV2, error) {\n\tif managedConfig == nil {\n\t\treturn externalGenerateManagedConfigV2{}, nil\n\t}\n\tvar externalDisables []externalManagedDisableConfigV2\n\tfor _, disable := range managedConfig.Disables() {\n\t\tvar fileOptionName string\n\t\tif disable.FileOption() != FileOptionUnspecified {\n\t\t\tfileOptionName = disable.FileOption().String()\n\t\t}\n\t\tvar fieldOptionName string\n\t\tif disable.FieldOption() != FieldOptionUnspecified {\n\t\t\tfieldOptionName = disable.FieldOption().String()\n\t\t}\n\t\texternalDisables = append(\n\t\t\texternalDisables,\n\t\t\texternalManagedDisableConfigV2{\n\t\t\t\tFileOption:  fileOptionName,\n\t\t\t\tFieldOption: fieldOptionName,\n\t\t\t\tModule:      disable.FullName(),\n\t\t\t\tPath:        disable.Path(),\n\t\t\t\tField:       disable.FieldName(),\n\t\t\t},\n\t\t)\n\t}\n\tvar externalOverrides []externalManagedOverrideConfigV2\n\tfor _, override := range managedConfig.Overrides() {\n\t\tvar fileOptionName string\n\t\tif override.FileOption() != FileOptionUnspecified {\n\t\t\tfileOptionName = override.FileOption().String()\n\t\t}\n\t\tvar fieldOptionName string\n\t\tif override.FieldOption() != FieldOptionUnspecified {\n\t\t\tfieldOptionName = override.FieldOption().String()\n\t\t}\n\t\tvalue, err := getOverrideValue(fileOptionName, fieldOptionName, override.Value())\n\t\tif err != nil {\n\t\t\treturn externalGenerateManagedConfigV2{}, err\n\t\t}\n\t\texternalOverrides = append(\n\t\t\texternalOverrides,\n\t\t\texternalManagedOverrideConfigV2{\n\t\t\t\tFileOption:  fileOptionName,\n\t\t\t\tFieldOption: fieldOptionName,\n\t\t\t\tModule:      override.FullName(),\n\t\t\t\tPath:        override.Path(),\n\t\t\t\tField:       override.FieldName(),\n\t\t\t\tValue:       value,\n\t\t\t},\n\t\t)\n\t}\n\treturn externalGenerateManagedConfigV2{\n\t\tEnabled:  managedConfig.Enabled(),\n\t\tDisable:  externalDisables,\n\t\tOverride: externalOverrides,\n\t}, nil\n}\n\nfunc validatePath(path string) error {\n\tnormalizedPath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif path != normalizedPath {\n\t\treturn fmt.Errorf(\n\t\t\t\"path %q in your configuration must be relative and use '/' as the path separator\",\n\t\t\tpath,\n\t\t)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/generate_managed_option.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// FileOption is a file option.\ntype FileOption int\n\nconst (\n\t// FileOptionUnspecified is an unspecified file option.\n\tFileOptionUnspecified FileOption = iota\n\t// FileOptionJavaPackage is the file option java_package.\n\tFileOptionJavaPackage\n\t// FileOptionJavaPackagePrefix is the file option java_package_prefix.\n\tFileOptionJavaPackagePrefix\n\t// FileOptionJavaPackageSuffix is the file option java_package_suffix.\n\tFileOptionJavaPackageSuffix\n\t// FileOptionJavaOuterClassname is the file option java_outer_classname.\n\tFileOptionJavaOuterClassname\n\t// FileOptionJavaMultipleFiles is the file option java_multiple_files.\n\tFileOptionJavaMultipleFiles\n\t// FileOptionJavaStringCheckUtf8 is the file option java_string_check_utf8.\n\tFileOptionJavaStringCheckUtf8\n\t// FileOptionOptimizeFor is the file option optimize_for.\n\tFileOptionOptimizeFor\n\t// FileOptionGoPackage is the file option go_package.\n\tFileOptionGoPackage\n\t// FileOptionGoPackagePrefix is the file option go_package_prefix.\n\tFileOptionGoPackagePrefix\n\t// FileOptionCcEnableArenas is the file option cc_enable_arenas.\n\tFileOptionCcEnableArenas\n\t// FileOptionObjcClassPrefix is the file option objc_class_prefix.\n\tFileOptionObjcClassPrefix\n\t// FileOptionCsharpNamespace is the file option csharp_namespace.\n\tFileOptionCsharpNamespace\n\t// FileOptionCsharpNamespacePrefix is the file option csharp_namespace_prefix.\n\tFileOptionCsharpNamespacePrefix\n\t// FileOptionPhpNamespace is the file option php_namespace.\n\tFileOptionPhpNamespace\n\t// FileOptionPhpMetadataNamespace is the file option php_metadata_namespace.\n\tFileOptionPhpMetadataNamespace\n\t// FileOptionPhpMetadataNamespaceSuffix is the file option php_metadata_namespace_suffix.\n\tFileOptionPhpMetadataNamespaceSuffix\n\t// FileOptionRubyPackage is the file option ruby_package.\n\tFileOptionRubyPackage\n\t// FileOptionRubyPackageSuffix is the file option ruby_package_suffix.\n\tFileOptionRubyPackageSuffix\n\t// FileOptionSwiftPrefix is the file option swift_prefix.\n\tFileOptionSwiftPrefix\n)\n\n// String implements fmt.Stringer.\nfunc (f FileOption) String() string {\n\ts, ok := fileOptionToString[f]\n\tif !ok {\n\t\treturn strconv.Itoa(int(f))\n\t}\n\treturn s\n}\n\n// FieldOption is a field option.\ntype FieldOption int\n\nconst (\n\t// FieldOptionUnspecified is an unspecified field option.\n\tFieldOptionUnspecified FieldOption = iota\n\t// FieldOptionJSType is the field option js_type.\n\tFieldOptionJSType\n)\n\n// String implements fmt.Stringer.\nfunc (f FieldOption) String() string {\n\ts, ok := fieldOptionToString[f]\n\tif !ok {\n\t\treturn strconv.Itoa(int(f))\n\t}\n\treturn s\n}\n\n// *** PRIVATE ***\n\nvar (\n\tfileOptionToString = map[FileOption]string{\n\t\tFileOptionJavaPackage:                \"java_package\",\n\t\tFileOptionJavaPackagePrefix:          \"java_package_prefix\",\n\t\tFileOptionJavaPackageSuffix:          \"java_package_suffix\",\n\t\tFileOptionJavaOuterClassname:         \"java_outer_classname\",\n\t\tFileOptionJavaMultipleFiles:          \"java_multiple_files\",\n\t\tFileOptionJavaStringCheckUtf8:        \"java_string_check_utf8\",\n\t\tFileOptionOptimizeFor:                \"optimize_for\",\n\t\tFileOptionGoPackage:                  \"go_package\",\n\t\tFileOptionGoPackagePrefix:            \"go_package_prefix\",\n\t\tFileOptionCcEnableArenas:             \"cc_enable_arenas\",\n\t\tFileOptionObjcClassPrefix:            \"objc_class_prefix\",\n\t\tFileOptionCsharpNamespace:            \"csharp_namespace\",\n\t\tFileOptionCsharpNamespacePrefix:      \"csharp_namespace_prefix\",\n\t\tFileOptionPhpNamespace:               \"php_namespace\",\n\t\tFileOptionPhpMetadataNamespace:       \"php_metadata_namespace\",\n\t\tFileOptionPhpMetadataNamespaceSuffix: \"php_metadata_namespace_suffix\",\n\t\tFileOptionRubyPackage:                \"ruby_package\",\n\t\tFileOptionRubyPackageSuffix:          \"ruby_package_suffix\",\n\t\tFileOptionSwiftPrefix:                \"swift_prefix\",\n\t}\n\tstringToFileOption = map[string]FileOption{\n\t\t\"java_package\":                  FileOptionJavaPackage,\n\t\t\"java_package_prefix\":           FileOptionJavaPackagePrefix,\n\t\t\"java_package_suffix\":           FileOptionJavaPackageSuffix,\n\t\t\"java_outer_classname\":          FileOptionJavaOuterClassname,\n\t\t\"java_multiple_files\":           FileOptionJavaMultipleFiles,\n\t\t\"java_string_check_utf8\":        FileOptionJavaStringCheckUtf8,\n\t\t\"optimize_for\":                  FileOptionOptimizeFor,\n\t\t\"go_package\":                    FileOptionGoPackage,\n\t\t\"go_package_prefix\":             FileOptionGoPackagePrefix,\n\t\t\"cc_enable_arenas\":              FileOptionCcEnableArenas,\n\t\t\"objc_class_prefix\":             FileOptionObjcClassPrefix,\n\t\t\"csharp_namespace\":              FileOptionCsharpNamespace,\n\t\t\"csharp_namespace_prefix\":       FileOptionCsharpNamespacePrefix,\n\t\t\"php_namespace\":                 FileOptionPhpNamespace,\n\t\t\"php_metadata_namespace\":        FileOptionPhpMetadataNamespace,\n\t\t\"php_metadata_namespace_suffix\": FileOptionPhpMetadataNamespaceSuffix,\n\t\t\"ruby_package\":                  FileOptionRubyPackage,\n\t\t\"ruby_package_suffix\":           FileOptionRubyPackageSuffix,\n\t\t\"swift_prefix\":                  FileOptionSwiftPrefix,\n\t}\n\tfileOptionToParseOverrideValueFunc = map[FileOption]func(any) (any, error){\n\t\tFileOptionJavaPackage:                parseOverrideValue[string],\n\t\tFileOptionJavaPackagePrefix:          parseOverrideValue[string],\n\t\tFileOptionJavaPackageSuffix:          parseOverrideValue[string],\n\t\tFileOptionOptimizeFor:                parseOverrideValueOptimizeMode,\n\t\tFileOptionJavaOuterClassname:         parseOverrideValue[string],\n\t\tFileOptionJavaMultipleFiles:          parseOverrideValue[bool],\n\t\tFileOptionJavaStringCheckUtf8:        parseOverrideValue[bool],\n\t\tFileOptionGoPackage:                  parseOverrideValue[string],\n\t\tFileOptionGoPackagePrefix:            parseOverrideValue[string],\n\t\tFileOptionCcEnableArenas:             parseOverrideValue[bool],\n\t\tFileOptionObjcClassPrefix:            parseOverrideValue[string], // objc_class_prefix is in descriptor.proto\n\t\tFileOptionCsharpNamespace:            parseOverrideValue[string],\n\t\tFileOptionCsharpNamespacePrefix:      parseOverrideValue[string],\n\t\tFileOptionPhpNamespace:               parseOverrideValue[string],\n\t\tFileOptionPhpMetadataNamespace:       parseOverrideValue[string],\n\t\tFileOptionPhpMetadataNamespaceSuffix: parseOverrideValue[string],\n\t\tFileOptionRubyPackage:                parseOverrideValue[string],\n\t\tFileOptionRubyPackageSuffix:          parseOverrideValue[string],\n\t\tFileOptionSwiftPrefix:                parseOverrideValue[string],\n\t}\n\tfieldOptionToString = map[FieldOption]string{\n\t\tFieldOptionJSType: \"jstype\",\n\t}\n\tstringToFieldOption = map[string]FieldOption{\n\t\t\"jstype\": FieldOptionJSType,\n\t}\n\tfieldOptionToParseOverrideValueFunc = map[FieldOption]func(any) (any, error){\n\t\tFieldOptionJSType: parseOverrideValueJSType,\n\t}\n)\n\nfunc parseFileOption(s string) (FileOption, error) {\n\ts = strings.ToLower(strings.TrimSpace(s))\n\tif s == \"\" {\n\t\treturn 0, errors.New(\"empty file_option\")\n\t}\n\tf, ok := stringToFileOption[s]\n\tif ok {\n\t\treturn f, nil\n\t}\n\treturn 0, fmt.Errorf(\"unknown file_option: %q\", s)\n}\n\nfunc parseFieldOption(s string) (FieldOption, error) {\n\ts = strings.ToLower(strings.TrimSpace(s))\n\tif s == \"\" {\n\t\treturn 0, errors.New(\"empty field_option\")\n\t}\n\tf, ok := stringToFieldOption[s]\n\tif ok {\n\t\treturn f, nil\n\t}\n\treturn 0, fmt.Errorf(\"unknown field_option: %q\", s)\n}\n\nfunc parseOverrideValue[T string | bool](overrideValue any) (any, error) {\n\tparsedValue, ok := overrideValue.(T)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"expected a %T, got %T\", parsedValue, overrideValue)\n\t}\n\treturn parsedValue, nil\n}\n\nfunc parseOverrideValueOptimizeMode(overrideValue any) (any, error) {\n\toptimizeModeName, ok := overrideValue.(string)\n\tif !ok {\n\t\treturn nil, errors.New(\"must be one of SPEED, CODE_SIZE or LITE_RUNTIME\")\n\t}\n\toptimizeMode, ok := descriptorpb.FileOptions_OptimizeMode_value[optimizeModeName]\n\tif !ok {\n\t\treturn nil, errors.New(\"must be one of SPEED, CODE_SIZE or LITE_RUNTIME\")\n\t}\n\treturn descriptorpb.FileOptions_OptimizeMode(optimizeMode), nil\n}\n\nfunc parseOverrideValueJSType(override any) (any, error) {\n\tjsTypeName, ok := override.(string)\n\tif !ok {\n\t\treturn nil, errors.New(\"must be one of JS_NORMAL, JS_STRING or JS_NUMBER\")\n\t}\n\tjsTypeEnum, ok := descriptorpb.FieldOptions_JSType_value[jsTypeName]\n\tif !ok {\n\t\treturn nil, errors.New(\"must be one of JS_NORMAL, JS_STRING or JS_NUMBER\")\n\t}\n\treturn descriptorpb.FieldOptions_JSType(jsTypeEnum), nil\n}\n\n// If the file or field option override value is one of the supported enum types,\n// then we want to write out the string representation of the enum value, not\n// the corresponding int32.\n// Otherwise we just return the value.\nfunc getOverrideValue(fileOptionName string, fieldOptionName string, value any) (any, error) {\n\tvar optionName string\n\tif fileOptionName != \"\" && fieldOptionName != \"\" {\n\t\treturn externalGenerateManagedConfigV2{}, fmt.Errorf(\"field option %s and file option %s set on the same override\", fileOptionName, fieldOptionName)\n\t}\n\tif fileOptionName != \"\" {\n\t\toptionName = fileOptionName\n\t\tfileOption, err := parseFileOption(fileOptionName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch fileOption {\n\t\tcase\n\t\t\tFileOptionJavaPackage,\n\t\t\tFileOptionJavaPackagePrefix,\n\t\t\tFileOptionJavaPackageSuffix,\n\t\t\tFileOptionJavaOuterClassname,\n\t\t\tFileOptionJavaMultipleFiles,\n\t\t\tFileOptionJavaStringCheckUtf8,\n\t\t\tFileOptionGoPackage,\n\t\t\tFileOptionGoPackagePrefix,\n\t\t\tFileOptionCcEnableArenas,\n\t\t\tFileOptionObjcClassPrefix,\n\t\t\tFileOptionCsharpNamespace,\n\t\t\tFileOptionCsharpNamespacePrefix,\n\t\t\tFileOptionPhpNamespace,\n\t\t\tFileOptionPhpMetadataNamespace,\n\t\t\tFileOptionPhpMetadataNamespaceSuffix,\n\t\t\tFileOptionRubyPackage,\n\t\t\tFileOptionRubyPackageSuffix,\n\t\t\tFileOptionSwiftPrefix:\n\t\t\treturn value, nil\n\n\t\tcase FileOptionOptimizeFor:\n\t\t\tif optimizeModeValue, ok := value.(descriptorpb.FileOptions_OptimizeMode); ok {\n\t\t\t\treturn optimizeModeValue.String(), nil\n\t\t\t}\n\t\t}\n\t}\n\tif fieldOptionName != \"\" {\n\t\toptionName = fieldOptionName\n\t\tfieldOption, err := parseFieldOption(fieldOptionName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch fieldOption {\n\t\tcase FieldOptionJSType:\n\t\t\tif jsTypeValue, ok := value.(descriptorpb.FieldOptions_JSType); ok {\n\t\t\t\treturn jsTypeValue.String(), nil\n\t\t\t}\n\t\t}\n\t}\n\treturn nil, fmt.Errorf(\"unable to get override value for %s: %v\", optionName, value)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/generate_plugin_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// GenerateStrategy is the generation strategy for a protoc plugin.\ntype GenerateStrategy int\n\nconst (\n\t// GenerateStrategyDirectory is the strategy to generate per directory.\n\t//\n\t// This is the default value for local plugins.\n\tGenerateStrategyDirectory GenerateStrategy = 1\n\t// GenerateStrategyAll is the strategy to generate with all files at once.\n\t//\n\t// This is the only strategy for remote plugins.\n\tGenerateStrategyAll GenerateStrategy = 2\n)\n\n// GeneratePluginConfigType is a generate plugin configuration type.\ntype GeneratePluginConfigType int\n\nconst (\n\t// GeneratePluginConfigTypeRemote is the remote plugin config type.\n\tGeneratePluginConfigTypeRemote GeneratePluginConfigType = iota + 1\n\t// GeneratePluginConfigTypeLocal is the local plugin config type.\n\tGeneratePluginConfigTypeLocal\n\t// GeneratePluginConfigTypeProtocBuiltin is the protoc built-in plugin config type.\n\tGeneratePluginConfigTypeProtocBuiltin\n\t// GeneratePluginConfigTypeLocalOrProtocBuiltin is a special plugin config type. This type indicates\n\t// it is to be determined whether the plugin is local or protoc built-in.\n\t// We defer further classification to the plugin executor. In v2 the exact\n\t// plugin config type is always specified and it will never be just local.\n\tGeneratePluginConfigTypeLocalOrProtocBuiltin\n)\n\nvar (\n\t// ProtocProxyPluginNames are the names of the plugins that should be proxied through protoc\n\t// in the absence of a binary.\n\tProtocProxyPluginNames = map[string]struct{}{\n\t\t\"cpp\":    {},\n\t\t\"csharp\": {},\n\t\t\"java\":   {},\n\t\t\"js\":     {},\n\t\t\"objc\":   {},\n\t\t\"php\":    {},\n\t\t\"python\": {},\n\t\t\"pyi\":    {},\n\t\t\"ruby\":   {},\n\t\t\"rbs\":    {},\n\t\t\"kotlin\": {},\n\t\t\"rust\":   {},\n\t}\n)\n\n// GeneratePluginConfig is a configuration for a plugin.\ntype GeneratePluginConfig interface {\n\t// Type returns the plugin type. This is never the zero value.\n\tType() GeneratePluginConfigType\n\t// Name returns the plugin name. This is never empty.\n\tName() string\n\t// Out returns the output directory for generation. This is never empty.\n\tOut() string\n\t// Opt returns the plugin options as a comma separated string.\n\tOpt() string\n\t// IncludeImports returns whether to generate code for imported files. This\n\t// is always false in v1.\n\tIncludeImports() bool\n\t// IncludeWKT returns whether to generate code for the well-known types.\n\t// This returns true only if IncludeImports returns true. This is always\n\t// false in v1.\n\tIncludeWKT() bool\n\t// Strategy returns the generation strategy.\n\t//\n\t// This is not empty only when the plugin is local, binary or protoc builtin.\n\tStrategy() GenerateStrategy\n\t// Path returns the path, including arguments, to invoke the binary plugin.\n\t//\n\t// This is not empty only when the plugin is local.\n\tPath() []string\n\t// ProtocPath returns a path to protoc, including any extra arguments.\n\t//\n\t// This is not empty only when the plugin is protoc-builtin.\n\tProtocPath() []string\n\t// RemoteHost returns the remote host of the remote plugin.\n\t//\n\t// This is not empty only when the plugin is remote.\n\tRemoteHost() string\n\t// Revision returns the revision of the remote plugin.\n\t//\n\t// This is not empty only when the plugin is remote.\n\tRevision() int\n\t// IncludeTypes returns the types to include.\n\tIncludeTypes() []string\n\t// ExcludeTypes returns the types to exclude.\n\tExcludeTypes() []string\n\n\tisGeneratePluginConfig()\n}\n\n// NewRemoteGeneratePluginConfig returns a new GeneratePluginConfig for a remote plugin.\nfunc NewRemoteGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\tincludeTypes []string,\n\texcludeTypes []string,\n\trevision int,\n) (GeneratePluginConfig, error) {\n\treturn newRemoteGeneratePluginConfig(\n\t\tname,\n\t\tout,\n\t\topt,\n\t\tincludeImports,\n\t\tincludeWKT,\n\t\tincludeTypes,\n\t\texcludeTypes,\n\t\trevision,\n\t)\n}\n\n// NewLocalOrProtocBuiltinGeneratePluginConfig returns a new GeneratePluginConfig for a local or protoc builtin plugin.\nfunc NewLocalOrProtocBuiltinGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\tincludeTypes []string,\n\texcludeTypes []string,\n\tstrategy *GenerateStrategy,\n) (GeneratePluginConfig, error) {\n\treturn newLocalOrProtocBuiltinGeneratePluginConfig(\n\t\tname,\n\t\tout,\n\t\topt,\n\t\tincludeImports,\n\t\tincludeWKT,\n\t\tincludeTypes,\n\t\texcludeTypes,\n\t\tstrategy,\n\t)\n}\n\n// NewLocalGeneratePluginConfig returns a new GeneratePluginConfig for a local plugin.\nfunc NewLocalGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\ttypes []string,\n\texcludeTypes []string,\n\tstrategy *GenerateStrategy,\n\tpath []string,\n) (GeneratePluginConfig, error) {\n\treturn newLocalGeneratePluginConfig(\n\t\tname,\n\t\tout,\n\t\topt,\n\t\tincludeImports,\n\t\tincludeWKT,\n\t\ttypes,\n\t\texcludeTypes,\n\t\tstrategy,\n\t\tpath,\n\t)\n}\n\n// NewProtocBuiltinGeneratePluginConfig returns a new GeneratePluginConfig for a protoc\n// builtin plugin.\nfunc NewProtocBuiltinGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\tincludeTypes []string,\n\texcludeTypes []string,\n\tstrategy *GenerateStrategy,\n\tprotocPath []string,\n) (GeneratePluginConfig, error) {\n\treturn newProtocBuiltinGeneratePluginConfig(\n\t\tname,\n\t\tout,\n\t\topt,\n\t\tincludeImports,\n\t\tincludeWKT,\n\t\tincludeTypes,\n\t\texcludeTypes,\n\t\tstrategy,\n\t\tprotocPath,\n\t)\n}\n\n// NewGeneratePluginConfigWithIncludeImportsAndWKT returns a GeneratePluginConfig the\n// same as the input, with include imports and include wkt overridden.\nfunc NewGeneratePluginConfigWithIncludeImportsAndWKT(\n\tconfig GeneratePluginConfig,\n\tincludeImports bool,\n\tincludeWKT bool,\n) (GeneratePluginConfig, error) {\n\toriginalConfig, ok := config.(*generatePluginConfig)\n\tif !ok {\n\t\treturn nil, syserror.Newf(\"unknown implementation of GeneratePluginConfig: %T\", config)\n\t}\n\tgeneratePluginConfig := *originalConfig\n\tif includeImports {\n\t\tgeneratePluginConfig.includeImports = true\n\t}\n\tif includeWKT {\n\t\tgeneratePluginConfig.includeWKT = true\n\t}\n\treturn &generatePluginConfig, nil\n}\n\n// *** PRIVATE ***\n\ntype generatePluginConfig struct {\n\tgeneratePluginConfigType GeneratePluginConfigType\n\tname                     string\n\tout                      string\n\topts                     []string\n\tincludeImports           bool\n\tincludeWKT               bool\n\tincludeTypes             []string\n\texcludeTypes             []string\n\tstrategy                 *GenerateStrategy\n\tpath                     []string\n\tprotocPath               []string\n\tremoteHost               string\n\trevision                 int\n}\n\nfunc newGeneratePluginConfigFromExternalV1Beta1(\n\texternalConfig externalGeneratePluginConfigV1Beta1,\n) (GeneratePluginConfig, error) {\n\tif externalConfig.Name == \"\" {\n\t\treturn nil, errors.New(\"plugin name is required\")\n\t}\n\tif externalConfig.Out == \"\" {\n\t\treturn nil, fmt.Errorf(\"out is required for plugin %s\", externalConfig.Name)\n\t}\n\tstrategy, err := parseStrategy(externalConfig.Strategy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\topt, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.Opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif externalConfig.Path != \"\" {\n\t\treturn newLocalGeneratePluginConfig(\n\t\t\texternalConfig.Name,\n\t\t\texternalConfig.Out,\n\t\t\topt,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tstrategy,\n\t\t\t[]string{externalConfig.Path},\n\t\t)\n\t}\n\treturn newLocalOrProtocBuiltinGeneratePluginConfig(\n\t\texternalConfig.Name,\n\t\texternalConfig.Out,\n\t\topt,\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t\tnil,\n\t\tstrategy,\n\t)\n}\n\nfunc newGeneratePluginConfigFromExternalV1(\n\texternalConfig externalGeneratePluginConfigV1,\n) (GeneratePluginConfig, error) {\n\tif externalConfig.Plugin == \"\" && externalConfig.Name == \"\" {\n\t\treturn nil, fmt.Errorf(\"one of plugin or name is required\")\n\t}\n\tif externalConfig.Plugin != \"\" && externalConfig.Name != \"\" {\n\t\treturn nil, fmt.Errorf(\"only one of plugin or name can be set\")\n\t}\n\tvar pluginIdentifier string\n\tswitch {\n\tcase externalConfig.Plugin != \"\":\n\t\tpluginIdentifier = externalConfig.Plugin\n\tcase externalConfig.Name != \"\":\n\t\tpluginIdentifier = externalConfig.Name\n\t\tif bufremotepluginref.IsPluginReferenceOrIdentity(pluginIdentifier) {\n\t\t\t// A plugin reference is not a valid local plugin name.\n\t\t\treturn nil, fmt.Errorf(\"invalid local plugin name: %s\", pluginIdentifier)\n\t\t}\n\t}\n\tif externalConfig.Out == \"\" {\n\t\treturn nil, fmt.Errorf(\"out is required for plugin %s\", pluginIdentifier)\n\t}\n\tstrategy, err := parseStrategy(externalConfig.Strategy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\topt, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.Opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpath, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.Path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprotocPath, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.ProtocPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif externalConfig.Plugin != \"\" && bufremotepluginref.IsPluginReferenceOrIdentity(pluginIdentifier) {\n\t\tif externalConfig.Path != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify path for remote plugin %s\", externalConfig.Plugin)\n\t\t}\n\t\tif externalConfig.Strategy != \"\" {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify strategy for remote plugin %s\", externalConfig.Plugin)\n\t\t}\n\t\tif externalConfig.ProtocPath != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify protoc_path for remote plugin %s\", externalConfig.Plugin)\n\t\t}\n\t\treturn newRemoteGeneratePluginConfig(\n\t\t\texternalConfig.Plugin,\n\t\t\texternalConfig.Out,\n\t\t\topt,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\texternalConfig.Revision,\n\t\t)\n\t}\n\t// At this point the plugin must be local, regardless whether it's specified\n\t// by key 'plugin' or 'name'.\n\tif len(path) > 0 {\n\t\treturn newLocalGeneratePluginConfig(\n\t\t\tpluginIdentifier,\n\t\t\texternalConfig.Out,\n\t\t\topt,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tstrategy,\n\t\t\tpath,\n\t\t)\n\t}\n\tif externalConfig.ProtocPath != nil {\n\t\treturn newProtocBuiltinGeneratePluginConfig(\n\t\t\tpluginIdentifier,\n\t\t\texternalConfig.Out,\n\t\t\topt,\n\t\t\tfalse,\n\t\t\tfalse,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tstrategy,\n\t\t\tprotocPath,\n\t\t)\n\t}\n\t// It could be either local or protoc built-in. We defer to the plugin executor\n\t// to decide whether the plugin is protoc-builtin or local.\n\treturn newLocalOrProtocBuiltinGeneratePluginConfig(\n\t\tpluginIdentifier,\n\t\texternalConfig.Out,\n\t\topt,\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t\tnil,\n\t\tstrategy,\n\t)\n}\n\nfunc newGeneratePluginConfigFromExternalV2(\n\texternalConfig externalGeneratePluginConfigV2,\n) (GeneratePluginConfig, error) {\n\tvar pluginTypeCount int\n\tif externalConfig.Remote != nil {\n\t\tpluginTypeCount++\n\t}\n\tif externalConfig.Local != nil {\n\t\tpluginTypeCount++\n\t}\n\tif externalConfig.ProtocBuiltin != nil {\n\t\tpluginTypeCount++\n\t}\n\tif pluginTypeCount == 0 {\n\t\treturn nil, errors.New(\"must specify one of remote, local or protoc_builtin\")\n\t}\n\tif pluginTypeCount > 1 {\n\t\treturn nil, errors.New(\"only one of remote, local or protoc_builtin\")\n\t}\n\tif externalConfig.Out == \"\" {\n\t\treturn nil, errors.New(\"must specify out\")\n\t}\n\tvar strategy string\n\tif externalConfig.Strategy != nil {\n\t\tstrategy = *externalConfig.Strategy\n\t}\n\tparsedStrategy, err := parseStrategy(strategy)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\topt, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.Opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch {\n\tcase externalConfig.Remote != nil:\n\t\tvar revision int\n\t\tif externalConfig.Revision != nil {\n\t\t\trevision = *externalConfig.Revision\n\t\t}\n\t\tif externalConfig.Strategy != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify strategy for remote plugin %s\", *externalConfig.Remote)\n\t\t}\n\t\tif externalConfig.ProtocPath != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify protoc_path for remote plugin %s\", *externalConfig.Remote)\n\t\t}\n\t\treturn newRemoteGeneratePluginConfig(\n\t\t\t*externalConfig.Remote,\n\t\t\texternalConfig.Out,\n\t\t\topt,\n\t\t\texternalConfig.IncludeImports,\n\t\t\texternalConfig.IncludeWKT,\n\t\t\texternalConfig.Types,\n\t\t\texternalConfig.ExcludeTypes,\n\t\t\trevision,\n\t\t)\n\tcase externalConfig.Local != nil:\n\t\tpath, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.Local)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tlocalPluginName := strings.Join(path, \" \")\n\t\tif externalConfig.Revision != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify revision for local plugin %s\", localPluginName)\n\t\t}\n\t\tif externalConfig.ProtocPath != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify protoc_path for local plugin %s\", localPluginName)\n\t\t}\n\t\treturn newLocalGeneratePluginConfig(\n\t\t\tstrings.Join(path, \" \"),\n\t\t\texternalConfig.Out,\n\t\t\topt,\n\t\t\texternalConfig.IncludeImports,\n\t\t\texternalConfig.IncludeWKT,\n\t\t\texternalConfig.Types,\n\t\t\texternalConfig.ExcludeTypes,\n\t\t\tparsedStrategy,\n\t\t\tpath,\n\t\t)\n\tcase externalConfig.ProtocBuiltin != nil:\n\t\tprotocPath, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.ProtocPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif externalConfig.Revision != nil {\n\t\t\treturn nil, fmt.Errorf(\"cannot specify revision for protoc built-in plugin %s\", *externalConfig.ProtocBuiltin)\n\t\t}\n\t\treturn newProtocBuiltinGeneratePluginConfig(\n\t\t\t*externalConfig.ProtocBuiltin,\n\t\t\texternalConfig.Out,\n\t\t\topt,\n\t\t\texternalConfig.IncludeImports,\n\t\t\texternalConfig.IncludeWKT,\n\t\t\texternalConfig.Types,\n\t\t\texternalConfig.ExcludeTypes,\n\t\t\tparsedStrategy,\n\t\t\tprotocPath,\n\t\t)\n\tdefault:\n\t\treturn nil, syserror.Newf(\"must specify one of remote, binary and protoc_builtin\")\n\t}\n}\n\nfunc newRemoteGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\tincludeTypes []string,\n\texcludeTypes []string,\n\trevision int,\n) (*generatePluginConfig, error) {\n\tif includeWKT && !includeImports {\n\t\treturn nil, errors.New(\"cannot include well-known types without including imports\")\n\t}\n\tremoteHost, err := parseRemoteHostName(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif revision < 0 || revision > math.MaxInt32 {\n\t\treturn nil, fmt.Errorf(\"revision %d is out of accepted range %d-%d\", revision, 0, math.MaxInt32)\n\t}\n\treturn &generatePluginConfig{\n\t\tgeneratePluginConfigType: GeneratePluginConfigTypeRemote,\n\t\tname:                     name,\n\t\tremoteHost:               remoteHost,\n\t\trevision:                 revision,\n\t\tout:                      out,\n\t\topts:                     opt,\n\t\tincludeImports:           includeImports,\n\t\tincludeWKT:               includeWKT,\n\t\tincludeTypes:             includeTypes,\n\t\texcludeTypes:             excludeTypes,\n\t}, nil\n}\n\nfunc newLocalOrProtocBuiltinGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\tincludeTypes []string,\n\texcludeTypes []string,\n\tstrategy *GenerateStrategy,\n) (*generatePluginConfig, error) {\n\tif includeWKT && !includeImports {\n\t\treturn nil, errors.New(\"cannot include well-known types without including imports\")\n\t}\n\treturn &generatePluginConfig{\n\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocalOrProtocBuiltin,\n\t\tname:                     name,\n\t\tstrategy:                 strategy,\n\t\tout:                      out,\n\t\topts:                     opt,\n\t\tincludeImports:           includeImports,\n\t\tincludeWKT:               includeWKT,\n\t\tincludeTypes:             includeTypes,\n\t\texcludeTypes:             excludeTypes,\n\t}, nil\n}\n\nfunc newLocalGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\tincludeTypes []string,\n\texcludeTypes []string,\n\tstrategy *GenerateStrategy,\n\tpath []string,\n) (*generatePluginConfig, error) {\n\tif len(path) == 0 {\n\t\treturn nil, errors.New(\"must specify a path to the plugin\")\n\t}\n\tif includeWKT && !includeImports {\n\t\treturn nil, errors.New(\"cannot include well-known types without including imports\")\n\t}\n\treturn &generatePluginConfig{\n\t\tgeneratePluginConfigType: GeneratePluginConfigTypeLocal,\n\t\tname:                     name,\n\t\tpath:                     path,\n\t\tstrategy:                 strategy,\n\t\tout:                      out,\n\t\topts:                     opt,\n\t\tincludeImports:           includeImports,\n\t\tincludeWKT:               includeWKT,\n\t\tincludeTypes:             includeTypes,\n\t\texcludeTypes:             excludeTypes,\n\t}, nil\n}\n\nfunc newProtocBuiltinGeneratePluginConfig(\n\tname string,\n\tout string,\n\topt []string,\n\tincludeImports bool,\n\tincludeWKT bool,\n\tincludeTypes []string,\n\texcludeTypes []string,\n\tstrategy *GenerateStrategy,\n\tprotocPath []string,\n) (*generatePluginConfig, error) {\n\tif includeWKT && !includeImports {\n\t\treturn nil, errors.New(\"cannot include well-known types without including imports\")\n\t}\n\treturn &generatePluginConfig{\n\t\tgeneratePluginConfigType: GeneratePluginConfigTypeProtocBuiltin,\n\t\tname:                     name,\n\t\tprotocPath:               protocPath,\n\t\tout:                      out,\n\t\topts:                     opt,\n\t\tstrategy:                 strategy,\n\t\tincludeImports:           includeImports,\n\t\tincludeWKT:               includeWKT,\n\t\tincludeTypes:             includeTypes,\n\t\texcludeTypes:             excludeTypes,\n\t}, nil\n}\n\nfunc (p *generatePluginConfig) Type() GeneratePluginConfigType {\n\treturn p.generatePluginConfigType\n}\n\nfunc (p *generatePluginConfig) Name() string {\n\treturn p.name\n}\n\nfunc (p *generatePluginConfig) Out() string {\n\treturn p.out\n}\n\nfunc (p *generatePluginConfig) Opt() string {\n\treturn strings.Join(p.opts, \",\")\n}\n\nfunc (p *generatePluginConfig) IncludeImports() bool {\n\treturn p.includeImports\n}\n\nfunc (p *generatePluginConfig) IncludeWKT() bool {\n\treturn p.includeWKT\n}\n\nfunc (p *generatePluginConfig) IncludeTypes() []string {\n\treturn p.includeTypes\n}\n\nfunc (p *generatePluginConfig) ExcludeTypes() []string {\n\treturn p.excludeTypes\n}\n\nfunc (p *generatePluginConfig) Strategy() GenerateStrategy {\n\tif p.strategy == nil {\n\t\treturn GenerateStrategyDirectory\n\t}\n\treturn *p.strategy\n}\n\nfunc (p *generatePluginConfig) Path() []string {\n\treturn p.path\n}\n\nfunc (p *generatePluginConfig) ProtocPath() []string {\n\treturn p.protocPath\n}\n\nfunc (p *generatePluginConfig) RemoteHost() string {\n\treturn p.remoteHost\n}\n\nfunc (p *generatePluginConfig) Revision() int {\n\treturn p.revision\n}\n\nfunc (p *generatePluginConfig) isGeneratePluginConfig() {}\n\nfunc newExternalGeneratePluginConfigV2FromPluginConfig(\n\tpluginConfig GeneratePluginConfig,\n) (externalGeneratePluginConfigV2, error) {\n\tgeneratePluginConfig, ok := pluginConfig.(*generatePluginConfig)\n\tif !ok {\n\t\treturn externalGeneratePluginConfigV2{}, syserror.Newf(\"unknown implementation of GeneratePluginConfig: %T\", generatePluginConfig)\n\t}\n\texternalPluginConfigV2 := externalGeneratePluginConfigV2{\n\t\tOut:            generatePluginConfig.Out(),\n\t\tIncludeImports: generatePluginConfig.IncludeImports(),\n\t\tIncludeWKT:     generatePluginConfig.IncludeWKT(),\n\t}\n\topts := generatePluginConfig.opts\n\tswitch {\n\tcase len(opts) == 1:\n\t\texternalPluginConfigV2.Opt = opts[0]\n\tcase len(opts) > 1:\n\t\texternalPluginConfigV2.Opt = opts\n\t}\n\tstrategy := generatePluginConfig.strategy\n\tswitch {\n\tcase strategy != nil && *strategy == GenerateStrategyDirectory:\n\t\texternalPluginConfigV2.Strategy = toPointer(\"directory\")\n\tcase strategy != nil && *strategy == GenerateStrategyAll:\n\t\texternalPluginConfigV2.Strategy = toPointer(\"all\")\n\t}\n\tswitch generatePluginConfig.Type() {\n\tcase GeneratePluginConfigTypeRemote:\n\t\texternalPluginConfigV2.Remote = toPointer(generatePluginConfig.Name())\n\t\tif revision := generatePluginConfig.Revision(); revision != 0 {\n\t\t\texternalPluginConfigV2.Revision = &revision\n\t\t}\n\tcase GeneratePluginConfigTypeLocal:\n\t\tpath := generatePluginConfig.Path()\n\t\tswitch {\n\t\tcase len(path) == 1:\n\t\t\texternalPluginConfigV2.Local = path[0]\n\t\tcase len(path) > 1:\n\t\t\texternalPluginConfigV2.Local = path\n\t\t}\n\tcase GeneratePluginConfigTypeProtocBuiltin:\n\t\texternalPluginConfigV2.ProtocBuiltin = toPointer(generatePluginConfig.Name())\n\t\tif protocPath := generatePluginConfig.ProtocPath(); len(protocPath) > 0 {\n\t\t\tif len(protocPath) == 1 {\n\t\t\t\texternalPluginConfigV2.ProtocPath = protocPath[0]\n\t\t\t} else {\n\t\t\t\texternalPluginConfigV2.ProtocPath = protocPath\n\t\t\t}\n\t\t}\n\tcase GeneratePluginConfigTypeLocalOrProtocBuiltin:\n\t\tbinaryName := \"protoc-gen-\" + generatePluginConfig.Name()\n\t\t// First, check if this is a binary.\n\t\t_, err := exec.LookPath(binaryName)\n\t\tif err == nil || errors.Is(err, exec.ErrDot) {\n\t\t\texternalPluginConfigV2.Local = binaryName\n\t\t\tbreak\n\t\t}\n\t\t// If not, check if it is a protoc plugin.\n\t\tif _, isProtocBuiltin := ProtocProxyPluginNames[generatePluginConfig.Name()]; isProtocBuiltin {\n\t\t\texternalPluginConfigV2.ProtocBuiltin = toPointer(generatePluginConfig.Name())\n\t\t\tbreak\n\t\t}\n\t\t// Otherwise, assume this is a binary.\n\t\texternalPluginConfigV2.Local = binaryName\n\t}\n\treturn externalPluginConfigV2, nil\n}\n\nfunc parseStrategy(s string) (*GenerateStrategy, error) {\n\tvar strategy GenerateStrategy\n\tswitch s {\n\tcase \"\":\n\t\treturn nil, nil\n\tcase \"directory\":\n\t\tstrategy = GenerateStrategyDirectory\n\tcase \"all\":\n\t\tstrategy = GenerateStrategyAll\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown strategy: %s\", s)\n\t}\n\treturn &strategy, nil\n}\n\nfunc parseRemoteHostName(fullName string) (string, error) {\n\tif identity, err := bufremotepluginref.PluginIdentityForString(fullName); err == nil {\n\t\treturn identity.Remote(), nil\n\t}\n\treference, err := bufremotepluginref.PluginReferenceForString(fullName, 0)\n\tif err == nil {\n\t\treturn reference.Remote(), nil\n\t}\n\treturn \"\", err\n}\n\nfunc toPointer[T any](value T) *T {\n\treturn &value\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/generate_type_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\n// GenerateTypeConfig is a type filter configuration.\ntype GenerateTypeConfig interface {\n\t// If IncludeTypes returns a non-empty list, it means that only those types are\n\t// generated. Otherwise all types are generated.\n\tIncludeTypes() []string\n\n\tisGenerateTypeConfig()\n}\n\n// NewGenerateTypeConfig returns a new GenerateTypeConfig.\nfunc NewGenerateTypeConfig(includeTypes []string) GenerateTypeConfig {\n\treturn newGenerateTypeConfig(includeTypes)\n}\n\n// *** PRIVATE ***\n\ntype generateTypeConfig struct {\n\tincludeTypes []string\n}\n\nfunc newGenerateTypeConfig(includeTypes []string) GenerateTypeConfig {\n\tif len(includeTypes) == 0 {\n\t\treturn nil\n\t}\n\treturn &generateTypeConfig{\n\t\tincludeTypes: includeTypes,\n\t}\n}\n\nfunc (g *generateTypeConfig) IncludeTypes() []string {\n\treturn g.includeTypes\n}\n\nfunc (g *generateTypeConfig) isGenerateTypeConfig() {}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/input_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// InputConfigType is an input config's type.\ntype InputConfigType int\n\nconst (\n\t// InputConfigTypeModule is the module input type.\n\tInputConfigTypeModule InputConfigType = iota + 1\n\t// InputConfigTypeDirectory is the directory input type.\n\tInputConfigTypeDirectory\n\t// InputConfigTypeGitRepo is the git repository input type.\n\tInputConfigTypeGitRepo\n\t// InputConfigTypeProtoFile is the proto file input type.\n\tInputConfigTypeProtoFile\n\t// InputConfigTypeTarball is the tarball input type.\n\tInputConfigTypeTarball\n\t// InputConfigTypeZipArchive is the zip archive input type.\n\tInputConfigTypeZipArchive\n\t// InputConfigTypeBinaryImage is the binary image input type.\n\tInputConfigTypeBinaryImage\n\t// InputConfigTypeJSONImage is the JSON image input type.\n\tInputConfigTypeJSONImage\n\t// InputConfigTypeTextImage is the text image input type.\n\tInputConfigTypeTextImage\n\t// InputConfigTypeYAMLImage is the yaml image input type.\n\tInputConfigTypeYAMLImage\n)\n\n// String implements fmt.Stringer.\nfunc (i InputConfigType) String() string {\n\ts, ok := inputConfigTypeToString[i]\n\tif !ok {\n\t\treturn strconv.Itoa(int(i))\n\t}\n\treturn s\n}\n\nconst (\n\tcompressionKey         = \"compression\"\n\tbranchKey              = \"branch\"\n\tcommitKey              = \"commit\"\n\ttagKey                 = \"tag\"\n\trefKey                 = \"ref\"\n\tdepthKey               = \"depth\"\n\trecurseSubmodulesKey   = \"recurse_submodules\"\n\tstripComponentsKey     = \"strip_components\"\n\tsubDirKey              = \"subdir\"\n\tincludePackageFilesKey = \"include_package_files\"\n)\n\nvar (\n\tallowedOptionsForInputConfigType = map[InputConfigType](map[string]struct{}){\n\t\tInputConfigTypeGitRepo: {\n\t\t\tbranchKey:            {},\n\t\t\tcommitKey:            {},\n\t\t\ttagKey:               {},\n\t\t\trefKey:               {},\n\t\t\tdepthKey:             {},\n\t\t\trecurseSubmodulesKey: {},\n\t\t\tsubDirKey:            {},\n\t\t},\n\t\tInputConfigTypeModule:    {},\n\t\tInputConfigTypeDirectory: {},\n\t\tInputConfigTypeProtoFile: {\n\t\t\tincludePackageFilesKey: {},\n\t\t},\n\t\tInputConfigTypeTarball: {\n\t\t\tcompressionKey:     {},\n\t\t\tstripComponentsKey: {},\n\t\t\tsubDirKey:          {},\n\t\t},\n\t\tInputConfigTypeZipArchive: {\n\t\t\tstripComponentsKey: {},\n\t\t\tsubDirKey:          {},\n\t\t},\n\t\tInputConfigTypeBinaryImage: {\n\t\t\tcompressionKey: {},\n\t\t},\n\t\tInputConfigTypeJSONImage: {\n\t\t\tcompressionKey: {},\n\t\t},\n\t\tInputConfigTypeTextImage: {\n\t\t\tcompressionKey: {},\n\t\t},\n\t\tInputConfigTypeYAMLImage: {\n\t\t\tcompressionKey: {},\n\t\t},\n\t}\n\tinputConfigTypeToString = map[InputConfigType]string{\n\t\tInputConfigTypeGitRepo:     \"git_repo\",\n\t\tInputConfigTypeModule:      \"module\",\n\t\tInputConfigTypeDirectory:   \"directory\",\n\t\tInputConfigTypeProtoFile:   \"proto_file\",\n\t\tInputConfigTypeTarball:     \"tarball\",\n\t\tInputConfigTypeZipArchive:  \"zip_archive\",\n\t\tInputConfigTypeBinaryImage: \"binary_image\",\n\t\tInputConfigTypeJSONImage:   \"json_image\",\n\t\tInputConfigTypeTextImage:   \"text_image\",\n\t\tInputConfigTypeYAMLImage:   \"yaml_image\",\n\t}\n\tallInputConfigTypeString = xstrings.SliceToHumanString(\n\t\txslices.MapValuesToSortedSlice(inputConfigTypeToString),\n\t)\n)\n\n// InputConfig is an input configuration for code generation.\ntype InputConfig interface {\n\t// Type returns the input type. This is never the zero value.\n\tType() InputConfigType\n\t// Location returns the location for the input. This is never empty.\n\tLocation() string\n\t// Compression returns the compression scheme, not empty only if format is\n\t// one of tarball, binary image, json image or text image.\n\tCompression() string\n\t// StripComponents returns the number of directories to strip for tar or zip\n\t// inputs, not empty only if format is tarball or zip archive.\n\tStripComponents() uint32\n\t// SubDir returns the subdirectory to use, not empty only if format is one\n\t// git repo, tarball and zip archive.\n\tSubDir() string\n\t// Branch returns the git branch to checkout out, not empty only if format is git.\n\tBranch() string\n\t// CommitOrTag returns the full commit hash or tag to checkout, not empty only if format is git.\n\tCommitOrTag() string\n\t// Ref returns the git ref to checkout, not empty only if format is git.\n\tRef() string\n\t// Depth returns the depth to clone the git repo with, not empty only if format is git.\n\tDepth() *uint32\n\t// RecurseSubmodules returns whether to clone submodules recursively. Not empty\n\t// only if input if git.\n\tRecurseSubmodules() bool\n\t// IncludePackageFiles returns other files in the same package as the proto file,\n\t// not empty only if format is proto file.\n\tIncludePackageFiles() bool\n\t// TargetPaths returns paths to generate for. An empty slice means to generate for all paths.\n\tTargetPaths() []string\n\t// ExcludePaths returns paths not to generate for.\n\tExcludePaths() []string\n\t// IncludeTypes returns the types to generate. An empty slice means to generate for all types.\n\tIncludeTypes() []string\n\t// ExcludeTypes returns the types to exclude. An empty slice means to exclude no types.\n\t// First ExcludeTypes are removed from the image.\n\t// Then IncludeTypes are traversed to compute the full set of types in the schema.\n\t// Not only are the types removed, but all references to the types must also be\n\t// removed in order for the resulting schema to be valid.\n\tExcludeTypes() []string\n\n\tisInputConfig()\n}\n\n// NewGitRepoInputConfig returns an input config for a git repo.\nfunc NewGitRepoInputConfig(\n\tlocation string,\n\tsubDir string,\n\tbranch string,\n\tcommitOrTag string,\n\tref string,\n\tdepth *uint32,\n\trecurseSubModules bool,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for git repository\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType:   InputConfigTypeGitRepo,\n\t\tlocation:          location,\n\t\tsubDir:            subDir,\n\t\tbranch:            branch,\n\t\tcommitOrTag:       commitOrTag,\n\t\tref:               ref,\n\t\tdepth:             depth,\n\t\trecurseSubmodules: recurseSubModules,\n\t}, nil\n}\n\n// NewModuleInputConfig returns an input config for a module.\nfunc NewModuleInputConfig(\n\tlocation string,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for module\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeModule,\n\t\tlocation:        location,\n\t}, nil\n}\n\n// NewDirectoryInputConfig returns an input config for a directory.\nfunc NewDirectoryInputConfig(\n\tlocation string,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for directory\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeDirectory,\n\t\tlocation:        location,\n\t}, nil\n}\n\n// NewProtoFileInputConfig returns an input config for a proto file.\nfunc NewProtoFileInputConfig(\n\tlocation string,\n\tincludePackageFiles bool,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for proto file\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType:     InputConfigTypeProtoFile,\n\t\tlocation:            location,\n\t\tincludePackageFiles: includePackageFiles,\n\t}, nil\n}\n\n// NewTarballInputConfig returns an input config for a tarball.\nfunc NewTarballInputConfig(\n\tlocation string,\n\tsubDir string,\n\tcompression string,\n\tstripComponents uint32,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for tarball\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeTarball,\n\t\tlocation:        location,\n\t\tsubDir:          subDir,\n\t\tcompression:     compression,\n\t\tstripComponents: stripComponents,\n\t}, nil\n}\n\n// NewZipArchiveInputConfig returns an input config for a zip archive.\nfunc NewZipArchiveInputConfig(\n\tlocation string,\n\tsubDir string,\n\tstripComponents uint32,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for zip archive\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeZipArchive,\n\t\tlocation:        location,\n\t\tsubDir:          subDir,\n\t\tstripComponents: stripComponents,\n\t}, nil\n}\n\n// NewBinaryImageInputConfig returns an input config for a binary image.\nfunc NewBinaryImageInputConfig(\n\tlocation string,\n\tcompression string,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for binary image\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeBinaryImage,\n\t\tlocation:        location,\n\t\tcompression:     compression,\n\t}, nil\n}\n\n// NewJSONImageInputConfig returns an input config for a JSON image.\nfunc NewJSONImageInputConfig(\n\tlocation string,\n\tcompression string,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for JSON image\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeJSONImage,\n\t\tlocation:        location,\n\t\tcompression:     compression,\n\t}, nil\n}\n\n// NewTextImageInputConfig returns an input config for a text image.\nfunc NewTextImageInputConfig(\n\tlocation string,\n\tcompression string,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for text image\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeTextImage,\n\t\tlocation:        location,\n\t\tcompression:     compression,\n\t}, nil\n}\n\n// NewYAMLImageInputConfig returns an input config for a yaml image.\nfunc NewYAMLImageInputConfig(\n\tlocation string,\n\tcompression string,\n) (InputConfig, error) {\n\tif location == \"\" {\n\t\treturn nil, errors.New(\"empty location for yaml image\")\n\t}\n\treturn &inputConfig{\n\t\tinputConfigType: InputConfigTypeYAMLImage,\n\t\tlocation:        location,\n\t\tcompression:     compression,\n\t}, nil\n}\n\n// *** PRIVATE ***\n\ntype inputConfig struct {\n\tinputConfigType     InputConfigType\n\tlocation            string\n\tcompression         string\n\tstripComponents     uint32\n\tsubDir              string\n\tbranch              string\n\tcommitOrTag         string\n\tref                 string\n\tdepth               *uint32\n\trecurseSubmodules   bool\n\tincludePackageFiles bool\n\tincludeTypes        []string\n\texcludeTypes        []string\n\ttargetPaths         []string\n\texcludePaths        []string\n}\n\nfunc newInputConfigFromExternalV2(externalConfig externalInputConfigV2) (InputConfig, error) {\n\t// We only allow one of these to be set.\n\tinputConfig := &inputConfig{}\n\tvar inputConfigTypes []InputConfigType\n\tif externalConfig.Module != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeModule)\n\t\tinputConfig.location = *externalConfig.Module\n\t}\n\tif externalConfig.Directory != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeDirectory)\n\t\tinputConfig.location = *externalConfig.Directory\n\t}\n\tif externalConfig.ProtoFile != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeProtoFile)\n\t\tinputConfig.location = *externalConfig.ProtoFile\n\t}\n\tif externalConfig.BinaryImage != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeBinaryImage)\n\t\tinputConfig.location = *externalConfig.BinaryImage\n\t}\n\tif externalConfig.Tarball != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeTarball)\n\t\tinputConfig.location = *externalConfig.Tarball\n\t}\n\tif externalConfig.ZipArchive != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeZipArchive)\n\t\tinputConfig.location = *externalConfig.ZipArchive\n\t}\n\tif externalConfig.JSONImage != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeJSONImage)\n\t\tinputConfig.location = *externalConfig.JSONImage\n\t}\n\tif externalConfig.TextImage != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeTextImage)\n\t\tinputConfig.location = *externalConfig.TextImage\n\t}\n\tif externalConfig.YAMLImage != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeYAMLImage)\n\t\tinputConfig.location = *externalConfig.YAMLImage\n\t}\n\tif externalConfig.GitRepo != nil {\n\t\tinputConfigTypes = append(inputConfigTypes, InputConfigTypeGitRepo)\n\t\tinputConfig.location = *externalConfig.GitRepo\n\t}\n\tif len(inputConfigTypes) == 0 {\n\t\treturn nil, fmt.Errorf(\"must specify one of %s\", allInputConfigTypeString)\n\t}\n\tif len(inputConfigTypes) > 1 {\n\t\treturn nil, fmt.Errorf(\"exactly one of %s must be specified\", allInputConfigTypeString)\n\t}\n\tinputConfigType := inputConfigTypes[0]\n\tinputConfig.inputConfigType = inputConfigType\n\t// Types, TargetPaths, and ExcludePaths.\n\tinputConfig.includeTypes = externalConfig.Types\n\tinputConfig.excludeTypes = externalConfig.ExcludeTypes\n\tinputConfig.targetPaths = externalConfig.TargetPaths\n\tinputConfig.excludePaths = externalConfig.ExcludePaths\n\t// Options depending on input format.\n\tvar options []string\n\tif externalConfig.Compression != nil {\n\t\toptions = append(options, compressionKey)\n\t\tinputConfig.compression = *externalConfig.Compression\n\t}\n\tif externalConfig.StripComponents != nil {\n\t\toptions = append(options, stripComponentsKey)\n\t\tinputConfig.stripComponents = *externalConfig.StripComponents\n\t}\n\tif externalConfig.Subdir != nil {\n\t\toptions = append(options, subDirKey)\n\t\tinputConfig.subDir = *externalConfig.Subdir\n\t}\n\tif externalConfig.Branch != nil {\n\t\toptions = append(options, branchKey)\n\t\tinputConfig.branch = *externalConfig.Branch\n\t}\n\tif externalConfig.Commit != nil && externalConfig.Tag != nil {\n\t\treturn nil, fmt.Errorf(\"commit and tag options cannot be used at the same time; use one or the other\")\n\t}\n\tif externalConfig.Commit != nil {\n\t\toptions = append(options, commitKey)\n\t\tinputConfig.commitOrTag = *externalConfig.Commit\n\t}\n\tif externalConfig.Tag != nil {\n\t\toptions = append(options, tagKey)\n\t\tinputConfig.commitOrTag = *externalConfig.Tag\n\t}\n\tif externalConfig.Ref != nil {\n\t\toptions = append(options, refKey)\n\t\tinputConfig.ref = *externalConfig.Ref\n\t}\n\tif externalConfig.Depth != nil {\n\t\toptions = append(options, depthKey)\n\t\tinputConfig.depth = externalConfig.Depth\n\t}\n\tif externalConfig.RecurseSubmodules != nil {\n\t\toptions = append(options, recurseSubmodulesKey)\n\t\tinputConfig.recurseSubmodules = *externalConfig.RecurseSubmodules\n\t}\n\tif externalConfig.IncludePackageFiles != nil {\n\t\toptions = append(options, includePackageFilesKey)\n\t\tinputConfig.includePackageFiles = *externalConfig.IncludePackageFiles\n\t}\n\tallowedOptions, ok := allowedOptionsForInputConfigType[inputConfigType]\n\tif !ok {\n\t\treturn nil, syserror.Newf(\"unable to find allowed options for InputConfigType %v\", inputConfigType)\n\t}\n\tfor _, option := range options {\n\t\tif _, ok := allowedOptions[option]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"option %s is not allowed for InputConfigType %v\", option, inputConfigType)\n\t\t}\n\t}\n\treturn inputConfig, nil\n}\n\nfunc (i *inputConfig) Type() InputConfigType {\n\treturn i.inputConfigType\n}\n\nfunc (i *inputConfig) Location() string {\n\treturn i.location\n}\n\nfunc (i *inputConfig) Compression() string {\n\treturn i.compression\n}\n\nfunc (i *inputConfig) StripComponents() uint32 {\n\treturn i.stripComponents\n}\n\nfunc (i *inputConfig) SubDir() string {\n\treturn i.subDir\n}\n\nfunc (i *inputConfig) Branch() string {\n\treturn i.branch\n}\n\nfunc (i *inputConfig) CommitOrTag() string {\n\treturn i.commitOrTag\n}\n\nfunc (i *inputConfig) Ref() string {\n\treturn i.ref\n}\n\nfunc (i *inputConfig) Depth() *uint32 {\n\treturn i.depth\n}\n\nfunc (i *inputConfig) RecurseSubmodules() bool {\n\treturn i.recurseSubmodules\n}\n\nfunc (i *inputConfig) IncludePackageFiles() bool {\n\treturn i.includePackageFiles\n}\n\nfunc (i *inputConfig) ExcludePaths() []string {\n\treturn i.excludePaths\n}\n\nfunc (i *inputConfig) TargetPaths() []string {\n\treturn i.targetPaths\n}\n\nfunc (i *inputConfig) IncludeTypes() []string {\n\treturn i.includeTypes\n}\n\nfunc (i *inputConfig) ExcludeTypes() []string {\n\treturn i.excludeTypes\n}\n\nfunc (i *inputConfig) isInputConfig() {}\n\nfunc newExternalInputConfigV2FromInputConfig(\n\tinputConfig InputConfig,\n) (externalInputConfigV2, error) {\n\texternalInputConfigV2 := externalInputConfigV2{}\n\tswitch inputConfig.Type() {\n\tcase InputConfigTypeGitRepo:\n\t\texternalInputConfigV2.GitRepo = toPointer(inputConfig.Location())\n\tcase InputConfigTypeDirectory:\n\t\texternalInputConfigV2.Directory = toPointer(inputConfig.Location())\n\tcase InputConfigTypeModule:\n\t\texternalInputConfigV2.Module = toPointer(inputConfig.Location())\n\tcase InputConfigTypeProtoFile:\n\t\texternalInputConfigV2.ProtoFile = toPointer(inputConfig.Location())\n\tcase InputConfigTypeZipArchive:\n\t\texternalInputConfigV2.ZipArchive = toPointer(inputConfig.Location())\n\tcase InputConfigTypeTarball:\n\t\texternalInputConfigV2.Tarball = toPointer(inputConfig.Location())\n\tcase InputConfigTypeBinaryImage:\n\t\texternalInputConfigV2.BinaryImage = toPointer(inputConfig.Location())\n\tcase InputConfigTypeJSONImage:\n\t\texternalInputConfigV2.JSONImage = toPointer(inputConfig.Location())\n\tcase InputConfigTypeTextImage:\n\t\texternalInputConfigV2.TextImage = toPointer(inputConfig.Location())\n\tcase InputConfigTypeYAMLImage:\n\t\texternalInputConfigV2.YAMLImage = toPointer(inputConfig.Location())\n\tdefault:\n\t\treturn externalInputConfigV2, syserror.Newf(\"unknown input config type: %v\", inputConfig.Type())\n\t}\n\tif inputConfig.Branch() != \"\" {\n\t\texternalInputConfigV2.Branch = toPointer(inputConfig.Branch())\n\t}\n\tif inputConfig.Ref() != \"\" {\n\t\texternalInputConfigV2.Ref = toPointer(inputConfig.Ref())\n\t}\n\tif inputConfig.CommitOrTag() != \"\" {\n\t\texternalInputConfigV2.Commit = toPointer(inputConfig.CommitOrTag())\n\t}\n\texternalInputConfigV2.Depth = inputConfig.Depth()\n\tif inputConfig.RecurseSubmodules() {\n\t\texternalInputConfigV2.RecurseSubmodules = toPointer(inputConfig.RecurseSubmodules())\n\t}\n\tif inputConfig.Compression() != \"\" {\n\t\texternalInputConfigV2.Compression = toPointer(inputConfig.Compression())\n\t}\n\tif inputConfig.StripComponents() != 0 {\n\t\texternalInputConfigV2.StripComponents = toPointer(inputConfig.StripComponents())\n\t}\n\tif inputConfig.SubDir() != \"\" {\n\t\texternalInputConfigV2.Subdir = toPointer(inputConfig.SubDir())\n\t}\n\tif inputConfig.IncludePackageFiles() {\n\t\texternalInputConfigV2.IncludePackageFiles = toPointer(inputConfig.IncludePackageFiles())\n\t}\n\texternalInputConfigV2.TargetPaths = inputConfig.TargetPaths()\n\texternalInputConfigV2.ExcludePaths = inputConfig.ExcludePaths()\n\texternalInputConfigV2.Types = inputConfig.IncludeTypes()\n\treturn externalInputConfigV2, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/lint_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nvar (\n\t// DefaultLintConfigV1 is the default lint config for v1.\n\tDefaultLintConfigV1 LintConfig = NewLintConfig(\n\t\tdefaultCheckConfigV1,\n\t\t\"\",\n\t\tfalse,\n\t\tfalse,\n\t\tfalse,\n\t\t\"\",\n\t\tfalse,\n\t)\n\n\t// DefaultLintConfigV2 is the default lint config for v2.\n\tDefaultLintConfigV2 LintConfig = NewLintConfig(\n\t\tdefaultCheckConfigV2,\n\t\t\"\",\n\t\tfalse,\n\t\tfalse,\n\t\tfalse,\n\t\t\"\",\n\t\ttrue, // We default to allowing comment ignores in v2\n\t)\n)\n\n// LintConfig is lint configuration for a specific Module.\ntype LintConfig interface {\n\tCheckConfig\n\n\tEnumZeroValueSuffix() string\n\tRPCAllowSameRequestResponse() bool\n\tRPCAllowGoogleProtobufEmptyRequests() bool\n\tRPCAllowGoogleProtobufEmptyResponses() bool\n\tServiceSuffix() string\n\tAllowCommentIgnores() bool\n\n\tisLintConfig()\n}\n\n// NewLintConfig returns a new LintConfig.\nfunc NewLintConfig(\n\tcheckConfig CheckConfig,\n\tenumZeroValueSuffix string,\n\trpcAllowSameRequestResponse bool,\n\trpcAllowGoogleProtobufEmptyRequests bool,\n\trpcAllowGoogleProtobufEmptyResponses bool,\n\tserviceSuffix string,\n\tallowCommentIgnores bool,\n) LintConfig {\n\treturn newLintConfig(\n\t\tcheckConfig,\n\t\tenumZeroValueSuffix,\n\t\trpcAllowSameRequestResponse,\n\t\trpcAllowGoogleProtobufEmptyRequests,\n\t\trpcAllowGoogleProtobufEmptyResponses,\n\t\tserviceSuffix,\n\t\tallowCommentIgnores,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype lintConfig struct {\n\tCheckConfig\n\n\tenumZeroValueSuffix                  string\n\trpcAllowSameRequestResponse          bool\n\trpcAllowGoogleProtobuEmptyRequests   bool\n\trpcAllowGoogleProtobufEmptyResponses bool\n\tserviceSuffix                        string\n\tallowCommentIgnores                  bool\n}\n\nfunc newLintConfig(\n\tcheckConfig CheckConfig,\n\tenumZeroValueSuffix string,\n\trpcAllowSameRequestResponse bool,\n\trpcAllowGoogleProtobuEmptyRequests bool,\n\trpcAllowGoogleProtobufEmptyResponses bool,\n\tserviceSuffix string,\n\tallowCommentIgnores bool,\n) *lintConfig {\n\treturn &lintConfig{\n\t\tCheckConfig:                          checkConfig,\n\t\tenumZeroValueSuffix:                  enumZeroValueSuffix,\n\t\trpcAllowSameRequestResponse:          rpcAllowSameRequestResponse,\n\t\trpcAllowGoogleProtobuEmptyRequests:   rpcAllowGoogleProtobuEmptyRequests,\n\t\trpcAllowGoogleProtobufEmptyResponses: rpcAllowGoogleProtobufEmptyResponses,\n\t\tserviceSuffix:                        serviceSuffix,\n\t\tallowCommentIgnores:                  allowCommentIgnores,\n\t}\n}\n\nfunc (l *lintConfig) EnumZeroValueSuffix() string {\n\treturn l.enumZeroValueSuffix\n}\n\nfunc (l *lintConfig) RPCAllowSameRequestResponse() bool {\n\treturn l.rpcAllowSameRequestResponse\n}\n\nfunc (l *lintConfig) RPCAllowGoogleProtobufEmptyRequests() bool {\n\treturn l.rpcAllowGoogleProtobuEmptyRequests\n}\n\nfunc (l *lintConfig) RPCAllowGoogleProtobufEmptyResponses() bool {\n\treturn l.rpcAllowGoogleProtobufEmptyResponses\n}\n\nfunc (l *lintConfig) ServiceSuffix() string {\n\treturn l.serviceSuffix\n}\n\nfunc (l *lintConfig) AllowCommentIgnores() bool {\n\treturn l.allowCommentIgnores\n}\n\nfunc (*lintConfig) isLintConfig() {}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/module_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\nvar (\n\t// DefaultModuleConfigV1 is the default ModuleConfig for v1.\n\tDefaultModuleConfigV1 ModuleConfig\n\n\t// DefaultModuleConfigV2 is the default ModuleConfig for v1.\n\tDefaultModuleConfigV2 ModuleConfig\n)\n\nfunc init() {\n\tvar err error\n\tDefaultModuleConfigV1, err = newModuleConfig(\n\t\t\".\",\n\t\tnil,\n\t\tmap[string][]string{\n\t\t\t\".\": {},\n\t\t},\n\t\tmap[string][]string{\n\t\t\t\".\": {},\n\t\t},\n\t\tDefaultLintConfigV1,\n\t\tDefaultBreakingConfigV1,\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tDefaultModuleConfigV2, err = newModuleConfig(\n\t\t\".\",\n\t\tnil,\n\t\tmap[string][]string{\n\t\t\t\".\": {},\n\t\t},\n\t\tmap[string][]string{\n\t\t\t\".\": {},\n\t\t},\n\t\tDefaultLintConfigV2,\n\t\tDefaultBreakingConfigV2,\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n\n// ModuleConfig is configuration for a specific Module.\n//\n// ModuleConfigs do not expose BucketID or OpaqueID, however DirPath is effectively BucketID,\n// and FullName -> fallback to DirPath effectively is OpaqueID. Given that it is up to\n// the user of this package to decide what to do with these fields, we do not name DirPath as\n// BucketID, and we do not expose OpaqueID.\ntype ModuleConfig interface {\n\t// DirPath returns the path of the Module within the Workspace, if specified.\n\t//\n\t// This is always present. For v1beta1 and v1 buf.yamls, this is always \".\".\n\t//\n\t// In v2, this will be used as the BucketID within Workspaces. For v1, it is up\n\t// to the Workspace constructor to come up with a BucketID (likely the directory name\n\t// within buf.work.yaml).\n\tDirPath() string\n\t// FullName returns the FullName for the Module, if available.\n\t//\n\t// This may be nil.\n\tFullName() bufparse.FullName\n\t// RootToIncludes contains a map from root to the directories to include for that root.\n\t// The keys in RootToIncludes are always the same as those in RooToExcludes.\n\t//\n\t// Roots are the root directories within a bucket to search for Protobuf files.\n\t//\n\t// There will be no between the roots, ie foo/bar and foo are not allowed.\n\t// All Protobuf files must be unique relative to the roots, ie if foo and bar\n\t// are roots, then foo/baz.proto and bar/baz.proto are not allowed.\n\t// All roots will be normalized and validated.\n\t//\n\t// A proto file within a root is considered part of the module when it satisfies both:\n\t//\n\t// - being inside ONE of the include paths for this root (unless includes is empty, which\n\t//   does not filter the proto files)\n\t// - being inside NONE of the exclude paths for this root\n\t//\n\t// There should be no overlap between the includes, ie foo/bar and foo are not allowed.\n\t// All includes must reside within a root, but none will be equal to a root.\n\t// All includes will be normalized and validated.\n\t//\n\t// *** The includes in this map will be relative to the root they map to! ***\n\t// *** Note that root is relative to DirPath! ***\n\t// That is, the actual path to a root within a is DirPath()/root, and the\n\t// actual path to an exclude is DirPath()/root/include (in v1beta1 and v1, this\n\t// is just root and root/exclude).\n\t//\n\t// This will never return a nil or empty value.\n\t// If RootToIncludes is empty in the buf.yaml, this will return \".\" -> []string{}.\n\t//\n\t// For v1beta1, this may contain multiple keys but the values for these keys are empty slices.\n\t// For v1, this will contain a single key \".\" with an empty slice as its value.\n\t// For v2, this will contain a single key \".\", with potentially some includes.\n\tRootToIncludes() map[string][]string\n\t// RootToExcludes contains a map from root to the excludes for that root.\n\t// The keys in RootToExcludes are always the same as those in RootToIncludes.\n\t//\n\t// Excludes are the directories within a bucket to exclude.\n\t// There should be no overlap between the excludes, ie foo/bar and foo are not allowed.\n\t// All excludes must reside within a root, but none will be equal to a root.\n\t// All excludes will be normalized and validated.\n\t//\n\t// *** The excludes in this map will be relative to the root they map to! ***\n\t// *** Note that root is relative to DirPath! ***\n\t// That is, the actual path to a root within a is DirPath()/root, and the\n\t// actual path to an exclude is DirPath()/root/exclude (in v1beta1 and v1, this\n\t// is just root and root/exclude).\n\t//\n\t// This will never return a nil or empty value.\n\t// If RootToExcludes is empty in the buf.yaml, this will return \".\" -> []string{}.\n\t//\n\t// For v1beta1, this may contain multiple keys.\n\t// For v1 and v2, this will contain a single key \".\", with potentially some excludes.\n\tRootToExcludes() map[string][]string\n\t// LintConfig returns the lint configuration.\n\t//\n\t// If this was not set, this will be set to the default lint configuration.\n\tLintConfig() LintConfig\n\t// BreakingConfig returns the breaking configuration.\n\t//\n\t// If this was not set, this will be set to the default breaking configuration.\n\tBreakingConfig() BreakingConfig\n\n\tisModuleConfig()\n}\n\n// NewModuleConfig returns a new ModuleConfig.\nfunc NewModuleConfig(\n\tdirPath string,\n\tmoduleFullName bufparse.FullName,\n\trootToIncludes map[string][]string,\n\trootToExcludes map[string][]string,\n\tlintConfig LintConfig,\n\tbreakingConfig BreakingConfig,\n) (ModuleConfig, error) {\n\treturn newModuleConfig(\n\t\tdirPath,\n\t\tmoduleFullName,\n\t\trootToIncludes,\n\t\trootToExcludes,\n\t\tlintConfig,\n\t\tbreakingConfig,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype moduleConfig struct {\n\tdirPath        string\n\tmoduleFullName bufparse.FullName\n\trootToIncludes map[string][]string\n\trootToExcludes map[string][]string\n\tlintConfig     LintConfig\n\tbreakingConfig BreakingConfig\n}\n\n// All validations are syserrors as we only ever read ModuleConfigs.\nfunc newModuleConfig(\n\tdirPath string,\n\tmoduleFullName bufparse.FullName,\n\trootToIncludes map[string][]string,\n\trootToExcludes map[string][]string,\n\tlintConfig LintConfig,\n\tbreakingConfig BreakingConfig,\n) (*moduleConfig, error) {\n\t// Returns \".\" on empty input.\n\tdirPath, err := normalpath.NormalizeAndValidate(dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif lintConfig == nil {\n\t\treturn nil, errors.New(\"LintConfig was nil\")\n\t}\n\tif breakingConfig == nil {\n\t\treturn nil, errors.New(\"BreakingConfig was nil\")\n\t}\n\tlintFileVersion := lintConfig.FileVersion()\n\tbreakingFileVersion := breakingConfig.FileVersion()\n\tif lintFileVersion != breakingFileVersion {\n\t\treturn nil, fmt.Errorf(\n\t\t\t\"LintConfig FileVersion %v did not match BreakingConfig FileVersion %v\",\n\t\t\tlintFileVersion,\n\t\t\tbreakingFileVersion,\n\t\t)\n\t}\n\tfileVersion := lintFileVersion\n\tif fileVersion == FileVersionV1Beta1 || fileVersion == FileVersionV1 {\n\t\tif dirPath != \".\" {\n\t\t\treturn nil, fmt.Errorf(\"had dirPath %q for NewModuleConfig with FileVersion %v\", dirPath, fileVersion)\n\t\t}\n\t}\n\tif fileVersion == FileVersionV1 || fileVersion == FileVersionV2 {\n\t\tif len(rootToExcludes) != 1 {\n\t\t\treturn nil, fmt.Errorf(\"had rootToExcludes length %d for NewModuleConfig with FileVersion %v\", len(rootToExcludes), fileVersion)\n\t\t}\n\t\tif _, ok := rootToExcludes[\".\"]; !ok {\n\t\t\treturn nil, fmt.Errorf(\"had rootToExcludes without key \\\".\\\" for NewModuleConfig with FileVersion %v\", fileVersion)\n\t\t}\n\t}\n\tnewRootToIncludes := make(map[string][]string)\n\tfor root, includes := range rootToIncludes {\n\t\tincludes, err := xslices.MapError(includes, normalpath.NormalizeAndValidate)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewRootToIncludes[root] = xslices.ToUniqueSorted(includes)\n\t}\n\tnewRootToExcludes := make(map[string][]string)\n\tfor root, excludes := range rootToExcludes {\n\t\texcludes, err := xslices.MapError(excludes, normalpath.NormalizeAndValidate)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewRootToExcludes[root] = xslices.ToUniqueSorted(excludes)\n\t}\n\treturn &moduleConfig{\n\t\tdirPath:        dirPath,\n\t\tmoduleFullName: moduleFullName,\n\t\trootToIncludes: newRootToIncludes,\n\t\trootToExcludes: newRootToExcludes,\n\t\tlintConfig:     lintConfig,\n\t\tbreakingConfig: breakingConfig,\n\t}, nil\n}\n\nfunc (m *moduleConfig) DirPath() string {\n\treturn m.dirPath\n}\n\nfunc (m *moduleConfig) FullName() bufparse.FullName {\n\treturn m.moduleFullName\n}\n\nfunc (m *moduleConfig) RootToIncludes() map[string][]string {\n\treturn copyStringToStringSliceMap(m.rootToIncludes)\n}\n\nfunc (m *moduleConfig) RootToExcludes() map[string][]string {\n\treturn copyStringToStringSliceMap(m.rootToExcludes)\n}\n\nfunc (m *moduleConfig) LintConfig() LintConfig {\n\treturn m.lintConfig\n}\n\nfunc (m *moduleConfig) BreakingConfig() BreakingConfig {\n\treturn m.breakingConfig\n}\n\nfunc (*moduleConfig) isModuleConfig() {}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/object_data.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// ObjectData is the data of the underlying storage.ReadObject that was used to create a Object.\n//\n// This is present on Files if they were created from storage.ReadBuckets. It is not present\n// if the File was created via a New constructor or Read method.\ntype ObjectData interface {\n\t// Name returns the name of the underlying storage.ReadObject.\n\t//\n\t// This will be normalpath.Base(readObject.Path()).\n\tName() string\n\t// Data returns the data from the underlying storage.ReadObject.\n\tData() []byte\n\n\tisObjectData()\n}\n\n// NewObjectData returns a new ObjectData.\nfunc NewObjectData(name string, data []byte) ObjectData {\n\treturn newObjectData(name, data)\n}\n\n// GetBufYAMLV1Beta1OrV1ObjectDataForPrefix is a helper function that gets the ObjectData for the buf.yaml file at\n// the given bucket prefix, if the buf.yaml file was v1beta1 or v1.\n//\n// The file is only parsed for its file version. No additional validation is performed.\n// If the file does not exist, an error that satisfies fs.ErrNotExist is returned.\n//\n// This function is used to help optionally get ObjectData where it is needed for digest calculations.\nfunc GetBufYAMLV1Beta1OrV1ObjectDataForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (ObjectData, error) {\n\treturn getV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, prefix, bufYAMLFileNames, bufYAMLFileNameToSupportedFileVersions)\n}\n\n// GetBufLockV1Beta1OrV1ObjectDataForPrefix is a helper function that gets the ObjectData for the buf.lock file at\n// the given bucket prefix, if the buf.lock file was v1beta1 or v1.\n//\n// The file is only parsed for its file version. No additional validation is performed.\n// If the file does not exist, an error that satisfies fs.ErrNotExist is returned.\n//\n// This function is used to help optionally get ObjectData where it is needed for digest calculations.\nfunc GetBufLockV1Beta1OrV1ObjectDataForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n) (ObjectData, error) {\n\treturn getV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, prefix, bufLockFileNames, bufLockFileNameToSupportedFileVersions)\n}\n\n// *** PRIVATE ***\n\ntype objectData struct {\n\tname string\n\tdata []byte\n}\n\nfunc newObjectData(name string, data []byte) *objectData {\n\treturn &objectData{\n\t\tname: name,\n\t\tdata: data,\n\t}\n}\n\nfunc (f *objectData) Name() string {\n\treturn f.name\n}\n\nfunc (f *objectData) Data() []byte {\n\treturn f.data\n}\n\nfunc (*objectData) isObjectData() {}\n\nfunc getV1Beta1OrV1ObjectDataForPrefix(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tprefix string,\n\tfileNames []string,\n\tfileNameToSupportedFileVersions map[string]map[FileVersion]struct{},\n) (ObjectData, error) {\n\tif len(fileNames) == 0 {\n\t\treturn nil, syserror.New(\"expected at least one file name for getV1Beta1OrV1ObjectDataForPrefix\")\n\t}\n\tfor _, fileName := range fileNames {\n\t\tpath := normalpath.Join(prefix, fileName)\n\t\tdata, err := storage.ReadPath(ctx, bucket, path)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\t// As soon as we find a file with the correct name, we have to roll with that. We don't\n\t\t// then cascade to other file names if there was a parse error.\n\n\t\tif len(data) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\t\tvar externalFileVersion externalFileVersion\n\t\tif err := encoding.UnmarshalYAMLNonStrict(data, &externalFileVersion); err != nil {\n\t\t\t// This could be a source of bugs in the future - we likely just took a buf.yaml/buf.lock\n\t\t\t// as-is for digest calculations pre-refactor, and didn't require a version.\n\t\t\treturn nil, newDecodeError(path, err)\n\t\t}\n\t\tfileVersion, err := parseFileVersion(externalFileVersion.Version, fileName, false, fileNameToSupportedFileVersions, FileVersionV1Beta1, FileVersionV1Beta1)\n\t\tif err != nil {\n\t\t\t// This could be a source of bugs in the future - we likely just took a buf.yaml/buf.lock\n\t\t\t// as-is for digest calculations pre-refactor, and didn't require a version.\n\t\t\treturn nil, newDecodeError(path, err)\n\t\t}\n\t\tswitch fileVersion {\n\t\tcase FileVersionV1Beta1, FileVersionV1:\n\t\t\treturn newObjectData(fileName, data), nil\n\t\tcase FileVersionV2:\n\t\t\treturn nil, nil\n\t\tdefault:\n\t\t\treturn nil, syserror.Newf(\"unknown FileVersion: %v\", fileVersion)\n\t\t}\n\t}\n\treturn nil, &fs.PathError{Op: \"read\", Path: normalpath.Join(prefix, fileNames[0]), Err: fs.ErrNotExist}\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/paths.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// normalizeAndCheckPaths verifies that:\n//\n//   - No paths are empty.\n//   - All paths are normalized and validated.\n//   - All paths are unique.\n//   - No path contains another path.\n//\n// Normalizes and sorts the paths.\nfunc normalizeAndCheckPaths(paths []string, name string) ([]string, error) {\n\tif len(paths) == 0 {\n\t\treturn paths, nil\n\t}\n\toutputs := make([]string, len(paths))\n\tfor i, path := range paths {\n\t\tif path == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"%s contained an empty path\", name)\n\t\t}\n\t\toutput, err := normalpath.NormalizeAndValidate(path)\n\t\tif err != nil {\n\t\t\t// user error\n\t\t\treturn nil, err\n\t\t}\n\t\toutputs[i] = output\n\t}\n\tsort.Strings(outputs)\n\tfor i := range outputs {\n\t\tfor j := i + 1; j < len(outputs); j++ {\n\t\t\toutput1 := outputs[i]\n\t\t\toutput2 := outputs[j]\n\n\t\t\tif output1 == output2 {\n\t\t\t\treturn nil, fmt.Errorf(\"duplicate %s %q\", name, output1)\n\t\t\t}\n\t\t\tif normalpath.EqualsOrContainsPath(output2, output1, normalpath.Relative) {\n\t\t\t\treturn nil, fmt.Errorf(\"%s %q is within %s %q which is not allowed\", name, output1, name, output2)\n\t\t\t}\n\t\t\tif normalpath.EqualsOrContainsPath(output1, output2, normalpath.Relative) {\n\t\t\t\treturn nil, fmt.Errorf(\"%s %q is within %s %q which is not allowed\", name, output2, name, output1)\n\t\t\t}\n\t\t}\n\t}\n\treturn outputs, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/paths_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestNormalizeAndCheckPathsRelSuccess1(t *testing.T) {\n\t// https://github.com/bufbuild/buf/issues/56\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelSuccess(\n\t\tt,\n\t\t[]string{\n\t\t\t\"proto\",\n\t\t\t\"proto-vendor\",\n\t\t},\n\t)\n}\n\nfunc TestNormalizeAndCheckPathsRelError1(t *testing.T) {\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelError(\n\t\tt,\n\t\t[]string{\n\t\t\t\"/a/b\",\n\t\t},\n\t)\n}\n\nfunc TestNormalizeAndCheckPathsRelError2(t *testing.T) {\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelError(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/b\",\n\t\t\t\"a/b\",\n\t\t},\n\t)\n}\n\nfunc TestNormalizeAndCheckPathsRelError3(t *testing.T) {\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelError(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/b\",\n\t\t\t\"a/b/c\",\n\t\t},\n\t)\n}\n\nfunc TestNormalizeAndCheckPathsRelError4(t *testing.T) {\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelError(\n\t\tt,\n\t\t[]string{\n\t\t\t\".\",\n\t\t\t\"a\",\n\t\t},\n\t)\n}\n\nfunc TestNormalizeAndCheckPathsRelError5(t *testing.T) {\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelError(\n\t\tt,\n\t\t[]string{\n\t\t\t\"\",\n\t\t},\n\t)\n}\n\nfunc TestNormalizeAndCheckPathsRelError6(t *testing.T) {\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelError(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/b\",\n\t\t\t\"\",\n\t\t},\n\t)\n}\n\nfunc TestNormalizeAndCheckPathsRelEqual1(t *testing.T) {\n\tt.Parallel()\n\ttestNormalizeAndCheckPathsRelEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"b\",\n\t\t\t\"a/../a\",\n\t\t},\n\t\t[]string{\n\t\t\t\"a\",\n\t\t\t\"b\",\n\t\t},\n\t)\n}\n\nfunc testNormalizeAndCheckPathsRelSuccess(t *testing.T, paths []string) {\n\t_, err := normalizeAndCheckPaths(paths, \"test\")\n\tassert.NoError(t, err, paths)\n}\n\nfunc testNormalizeAndCheckPathsRelError(t *testing.T, paths []string) {\n\t_, err := normalizeAndCheckPaths(paths, \"test\")\n\tassert.Error(t, err, paths)\n}\n\nfunc testNormalizeAndCheckPathsRelEqual(\n\tt *testing.T,\n\tpaths []string,\n\texpected []string,\n) {\n\tactual, err := normalizeAndCheckPaths(paths, \"test\")\n\tassert.NoError(t, err, paths)\n\tassert.Equal(t, expected, actual)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/plugin_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// PluginConfigTypeLocal is the local plugin config type.\n\tPluginConfigTypeLocal PluginConfigType = iota + 1\n\t// PluginConfigTypeLocalWasm is the local Wasm plugin config type.\n\tPluginConfigTypeLocalWasm\n\t// PluginConfigTypeRemoteWasm is the remote Wasm plugin config type.\n\tPluginConfigTypeRemoteWasm\n)\n\n// PluginConfigType is a generate plugin configuration type.\ntype PluginConfigType int\n\n// PluginConfig is a configuration for a plugin.\ntype PluginConfig interface {\n\t// Type returns the plugin type. This is never the zero value.\n\tType() PluginConfigType\n\t// Name returns the plugin name. This is never empty.\n\tName() string\n\t// Options returns the plugin options.\n\t//\n\t// TODO: Will want good validation and good error messages for what this decodes.\n\t// Otherwise we will confuse users. Do QA.\n\tOptions() map[string]any\n\t// Args returns the arguments, excluding the plugin name, to invoke the plugin.\n\t//\n\t// This may be empty.\n\tArgs() []string\n\t// Ref returns the plugin reference.\n\t//\n\t// This is only non-nil when the plugin is remote.\n\tRef() bufparse.Ref\n\n\tisPluginConfig()\n}\n\n// NewLocalPluginConfig returns a new PluginConfig for a local plugin.\nfunc NewLocalPluginConfig(\n\tname string,\n\toptions map[string]any,\n\targs []string,\n) (PluginConfig, error) {\n\treturn newLocalPluginConfig(\n\t\tname,\n\t\toptions,\n\t\targs,\n\t)\n}\n\n// NewLocalWasmPluginConfig returns a new PluginConfig for a local Wasm plugin.\n//\n// The name is the path to the Wasm plugin and must end with .wasm.\n// The args are the arguments to the Wasm plugin. These are passed to the Wasm plugin\n// as command line arguments.\nfunc NewLocalWasmPluginConfig(\n\tname string,\n\toptions map[string]any,\n\targs []string,\n) (PluginConfig, error) {\n\treturn newLocalWasmPluginConfig(\n\t\tname,\n\t\toptions,\n\t\targs,\n\t)\n}\n\n// NewRemoteWasmPluginConfig returns a new PluginConfig for a remote Wasm plugin.\n//\n// The pluginRef is the remote reference to the plugin.\n// The args are the arguments to the remote plugin. These are passed to the remote plugin\n// as command line arguments.\nfunc NewRemoteWasmPluginConfig(\n\tpluginRef bufparse.Ref,\n\toptions map[string]any,\n\targs []string,\n) (PluginConfig, error) {\n\treturn newRemotePluginConfig(\n\t\tpluginRef,\n\t\toptions,\n\t\targs,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype pluginConfig struct {\n\tpluginConfigType PluginConfigType\n\tname             string\n\toptions          map[string]any\n\targs             []string\n\tref              bufparse.Ref\n}\n\nfunc newPluginConfigForExternalV2(\n\texternalConfig externalBufYAMLFilePluginV2,\n) (PluginConfig, error) {\n\toptions := make(map[string]any)\n\tfor key, value := range externalConfig.Options {\n\t\tif len(key) == 0 {\n\t\t\treturn nil, errors.New(\"must specify option key\")\n\t\t}\n\t\t// TODO: Validation here, how to expose from bufplugin?\n\t\tif value == nil {\n\t\t\treturn nil, errors.New(\"must specify option value\")\n\t\t}\n\t\toptions[key] = value\n\t}\n\t// Plugins are specified as a path, remote reference, or Wasm file.\n\tpath, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.Plugin)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(path) == 0 {\n\t\treturn nil, errors.New(\"must specify a path to the plugin\")\n\t}\n\tname, args := path[0], path[1:]\n\t// Remote plugins are specified as plugin references.\n\tif pluginRef, err := bufparse.ParseRef(path[0]); err == nil {\n\t\t// Check if the local filepath exists, if it does presume its\n\t\t// not a remote reference. Okay to use os.Stat instead of\n\t\t// os.Lstat.\n\t\tif _, err := os.Stat(path[0]); os.IsNotExist(err) {\n\t\t\treturn newRemotePluginConfig(\n\t\t\t\tpluginRef,\n\t\t\t\toptions,\n\t\t\t\targs,\n\t\t\t)\n\t\t}\n\t}\n\t// Wasm plugins are suffixed with .wasm. Otherwise, it's a binary.\n\tif filepath.Ext(path[0]) == \".wasm\" {\n\t\treturn newLocalWasmPluginConfig(\n\t\t\tname,\n\t\t\toptions,\n\t\t\targs,\n\t\t)\n\t}\n\treturn newLocalPluginConfig(\n\t\tname,\n\t\toptions,\n\t\targs,\n\t)\n}\n\nfunc newLocalPluginConfig(\n\tname string,\n\toptions map[string]any,\n\targs []string,\n) (*pluginConfig, error) {\n\tif name == \"\" {\n\t\treturn nil, errors.New(\"must specify a name to the plugin\")\n\t}\n\treturn &pluginConfig{\n\t\tpluginConfigType: PluginConfigTypeLocal,\n\t\tname:             name,\n\t\toptions:          options,\n\t\targs:             args,\n\t}, nil\n}\n\nfunc newLocalWasmPluginConfig(\n\tname string,\n\toptions map[string]any,\n\targs []string,\n) (*pluginConfig, error) {\n\tif name == \"\" {\n\t\treturn nil, errors.New(\"must specify a name to the plugin\")\n\t}\n\tif filepath.Ext(name) != \".wasm\" {\n\t\treturn nil, fmt.Errorf(\"must specify a name to the plugin, and the name must end with .wasm\")\n\t}\n\treturn &pluginConfig{\n\t\tpluginConfigType: PluginConfigTypeLocalWasm,\n\t\tname:             name,\n\t\toptions:          options,\n\t\targs:             args,\n\t}, nil\n}\n\nfunc newRemotePluginConfig(\n\tpluginRef bufparse.Ref,\n\toptions map[string]any,\n\targs []string,\n) (*pluginConfig, error) {\n\treturn &pluginConfig{\n\t\tpluginConfigType: PluginConfigTypeRemoteWasm,\n\t\tname:             pluginRef.String(),\n\t\toptions:          options,\n\t\targs:             args,\n\t\tref:              pluginRef,\n\t}, nil\n}\n\nfunc (p *pluginConfig) Type() PluginConfigType {\n\treturn p.pluginConfigType\n}\n\nfunc (p *pluginConfig) Name() string {\n\treturn p.name\n}\n\nfunc (p *pluginConfig) Options() map[string]any {\n\treturn p.options\n}\n\nfunc (p *pluginConfig) Args() []string {\n\treturn p.args\n}\n\nfunc (p *pluginConfig) Ref() bufparse.Ref {\n\treturn p.ref\n}\n\nfunc (p *pluginConfig) isPluginConfig() {}\n\nfunc newExternalV2ForPluginConfig(\n\tconfig PluginConfig,\n) (externalBufYAMLFilePluginV2, error) {\n\tpluginConfig, ok := config.(*pluginConfig)\n\tif !ok {\n\t\treturn externalBufYAMLFilePluginV2{}, syserror.Newf(\"unknown implementation of PluginConfig: %T\", pluginConfig)\n\t}\n\texternalBufYAMLFilePluginV2 := externalBufYAMLFilePluginV2{\n\t\tOptions: pluginConfig.Options(),\n\t}\n\targs := pluginConfig.Args()\n\tif len(args) == 0 {\n\t\texternalBufYAMLFilePluginV2.Plugin = pluginConfig.Name()\n\t} else {\n\t\texternalBufYAMLFilePluginV2.Plugin = append([]string{pluginConfig.Name()}, args...)\n\t}\n\treturn externalBufYAMLFilePluginV2, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/policy_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"slices\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// PolicyConfig is a configuration for a policy.\ntype PolicyConfig interface {\n\t// Name returns the policy name. This is never empty.\n\tName() string\n\t// Paths are specific to the Module. Users cannot ignore paths outside of their modules for check\n\t// configs, which includes any imports from outside of the module.\n\t// Paths are relative to roots.\n\t// Paths are sorted.\n\tIgnorePaths() []string\n\t// Paths are specific to the Module. Users cannot ignore paths outside of their modules for\n\t// check configs, which includes any imports from outside of the module.\n\t// Paths are relative to roots.\n\t// Paths are sorted.\n\tIgnoreIDOrCategoryToPaths() map[string][]string\n\t// Ref returns the policy reference.\n\t//\n\t// This is only non-nil when the plugin is remote.\n\tRef() bufparse.Ref\n\n\tisPolicyConfig()\n}\n\n// NewLocalPolicyConfig returns a new PolicyConfig for a local policy.\nfunc NewLocalPolicyConfig(\n\tname string,\n\tignore []string,\n\tignoreOnly map[string][]string,\n) (PolicyConfig, error) {\n\treturn newPolicyConfig(name, ignore, ignoreOnly, nil)\n}\n\n// NewRemotePolicyConfig returns a new PolicyConfig for a remote policy.\nfunc NewRemotePolicyConfig(\n\tref bufparse.Ref,\n\tignore []string,\n\tignoreOnly map[string][]string,\n) (PolicyConfig, error) {\n\treturn newPolicyConfig(ref.String(), ignore, ignoreOnly, ref)\n}\n\n// *** PRIVATE ***\n\ntype policyConfig struct {\n\tname       string\n\tignore     []string\n\tignoreOnly map[string][]string\n\tref        bufparse.Ref\n}\n\nfunc newPolicyConfigForExternalV2(\n\texternalConfig externalBufYAMLFilePolicyV2,\n) (*policyConfig, error) {\n\tvar policyRef bufparse.Ref\n\tname := externalConfig.Policy\n\tif ref, err := bufparse.ParseRef(name); err == nil {\n\t\t// Check if the local filepath exists, if it does presume its\n\t\t// not a remote reference. Okay to use os.Stat instead of\n\t\t// os.Lstat.\n\t\tif _, err := os.Stat(name); os.IsNotExist(err) {\n\t\t\tpolicyRef = ref\n\t\t}\n\t}\n\treturn newPolicyConfig(\n\t\tname,\n\t\texternalConfig.Ignore,\n\t\texternalConfig.IgnoreOnly,\n\t\tpolicyRef,\n\t)\n}\n\nfunc newPolicyConfig(\n\tname string,\n\tignore []string,\n\tignoreOnly map[string][]string,\n\tpolicyRef bufparse.Ref,\n) (*policyConfig, error) {\n\tif name == \"\" {\n\t\treturn nil, errors.New(\"must specify a name to the policy\")\n\t}\n\tignore = xslices.ToUniqueSorted(ignore)\n\tignore, err := normalizeAndCheckPaths(ignore, \"ignore\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnewIgnoreOnly := make(map[string][]string, len(ignoreOnly))\n\tfor k, v := range ignoreOnly {\n\t\tv = xslices.ToUniqueSorted(v)\n\t\tv, err := normalizeAndCheckPaths(v, \"ignore_only path\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewIgnoreOnly[k] = v\n\t}\n\tignoreOnly = newIgnoreOnly\n\treturn &policyConfig{\n\t\tname:       name,\n\t\tignore:     ignore,\n\t\tignoreOnly: ignoreOnly,\n\t\tref:        policyRef,\n\t}, nil\n}\n\nfunc (p *policyConfig) Name() string {\n\treturn p.name\n}\n\nfunc (p *policyConfig) IgnorePaths() []string {\n\treturn slices.Clone(p.ignore)\n}\n\nfunc (p *policyConfig) IgnoreIDOrCategoryToPaths() map[string][]string {\n\treturn copyStringToStringSliceMap(p.ignoreOnly)\n}\n\nfunc (p *policyConfig) Ref() bufparse.Ref {\n\treturn p.ref\n}\n\nfunc (p *policyConfig) isPolicyConfig() {}\n\nfunc newExternalV2ForPolicyConfig(\n\tconfig PolicyConfig,\n) (externalBufYAMLFilePolicyV2, error) {\n\tpluginConfig, ok := config.(*policyConfig)\n\tif !ok {\n\t\treturn externalBufYAMLFilePolicyV2{}, syserror.Newf(\"unknown implementation of PolicyConfig: %T\", pluginConfig)\n\t}\n\treturn externalBufYAMLFilePolicyV2{\n\t\tPolicy:     pluginConfig.Name(),\n\t\tIgnore:     slices.Clone(pluginConfig.IgnorePaths()),\n\t\tIgnoreOnly: copyStringToStringSliceMap(pluginConfig.IgnoreIDOrCategoryToPaths()),\n\t}, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufconfig\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufconfig/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconfig\n\nimport \"slices\"\n\nfunc copyStringToStringSliceMap(m map[string][]string) map[string][]string {\n\tc := make(map[string][]string)\n\tfor k, v := range m {\n\t\tc[k] = slices.Clone(v)\n\t}\n\treturn c\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/walk.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufconfig\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// WalkFileInfos walks all the FileInfos in the ReadBucket.\n//\n// The path will be normalized.\nfunc WalkFileInfos(\n\tctx context.Context,\n\treadBucket storage.ReadBucket,\n\tf func(path string, fileInfo FileInfo) error,\n) error {\n\treturn readBucket.Walk(\n\t\tctx,\n\t\t\"\",\n\t\tfunc(objectInfo storage.ObjectInfo) error {\n\t\t\tpath := objectInfo.Path()\n\t\t\tfileType, ok := fileNameToFileType[normalpath.Base(path)]\n\t\t\tif !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tdefaultFileVersion, ok := fileTypeToDefaultFileVersion[fileType]\n\t\t\tif !ok {\n\t\t\t\treturn syserror.Newf(\"did not set a default file version for FileType %v\", fileType)\n\t\t\t}\n\t\t\tfileNameToSupportedFileVersions, ok := fileTypeToSupportedFileVersions[fileType]\n\t\t\tif !ok {\n\t\t\t\treturn syserror.Newf(\"did not set a supported file versions map for FileType %v\", fileType)\n\t\t\t}\n\t\t\tdata, err := storage.ReadPath(ctx, readBucket, path)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfileVersion, err := getFileVersionForData(data, false, false, fileNameToSupportedFileVersions, 0, defaultFileVersion)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn f(path, newFileInfo(fileVersion, fileType))\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconfig/walk_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufconfig\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestWalkBasic(t *testing.T) {\n\tt.Parallel()\n\n\ttestWalk(\n\t\tt,\n\t\tmap[string][]byte{\n\t\t\t\"buf.yaml\":      []byte(`version: v1`),\n\t\t\t\"buf.mod\":       []byte(`version: v1`),\n\t\t\t\"buf.lock\":      []byte(`version: v1`),\n\t\t\t\"buf.gen.yaml\":  []byte(`version: v1`),\n\t\t\t\"buf.work.yaml\": []byte(`version: v1`),\n\t\t\t\"buf.work\":      []byte(`version: v1`),\n\t\t\t\"unknown.yaml\":  []byte(`unknown`),\n\t\t},\n\t\tmap[string]FileInfo{\n\t\t\t\"buf.yaml\":      newFileInfo(FileVersionV1, FileTypeBufYAML),\n\t\t\t\"buf.mod\":       newFileInfo(FileVersionV1, FileTypeBufYAML),\n\t\t\t\"buf.lock\":      newFileInfo(FileVersionV1, FileTypeBufLock),\n\t\t\t\"buf.gen.yaml\":  newFileInfo(FileVersionV1, FileTypeBufGenYAML),\n\t\t\t\"buf.work.yaml\": newFileInfo(FileVersionV1, FileTypeBufWorkYAML),\n\t\t\t\"buf.work\":      newFileInfo(FileVersionV1, FileTypeBufWorkYAML),\n\t\t},\n\t)\n}\n\nfunc TestWalkNoVersion(t *testing.T) {\n\tt.Parallel()\n\n\ttestWalk(\n\t\tt,\n\t\tmap[string][]byte{\n\t\t\t\"buf.yaml\":      []byte(``),\n\t\t\t\"buf.mod\":       []byte(``),\n\t\t\t\"buf.lock\":      []byte(``),\n\t\t\t\"buf.gen.yaml\":  []byte(``),\n\t\t\t\"buf.work.yaml\": []byte(``),\n\t\t\t\"buf.work\":      []byte(``),\n\t\t},\n\t\tmap[string]FileInfo{\n\t\t\t\"buf.yaml\":      newFileInfo(FileVersionV1Beta1, FileTypeBufYAML),\n\t\t\t\"buf.mod\":       newFileInfo(FileVersionV1Beta1, FileTypeBufYAML),\n\t\t\t\"buf.lock\":      newFileInfo(FileVersionV1Beta1, FileTypeBufLock),\n\t\t\t\"buf.gen.yaml\":  newFileInfo(FileVersionV1Beta1, FileTypeBufGenYAML),\n\t\t\t\"buf.work.yaml\": newFileInfo(FileVersionV1, FileTypeBufWorkYAML),\n\t\t\t\"buf.work\":      newFileInfo(FileVersionV1, FileTypeBufWorkYAML),\n\t\t},\n\t)\n}\n\nfunc testWalk(t *testing.T, pathToData map[string][]byte, expectedPathToFileInfo map[string]FileInfo) {\n\tctx := context.Background()\n\tbucket, err := storagemem.NewReadBucket(pathToData)\n\trequire.NoError(t, err)\n\tpathToFileInfo, err := testGetPathToFileInfo(ctx, bucket)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expectedPathToFileInfo, pathToFileInfo)\n}\n\nfunc testGetPathToFileInfo(ctx context.Context, bucket storage.ReadBucket) (map[string]FileInfo, error) {\n\tpathToFileInfo := make(map[string]FileInfo)\n\terr := WalkFileInfos(ctx, bucket, func(path string, fileInfo FileInfo) error {\n\t\tpathToFileInfo[path] = fileInfo\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn pathToFileInfo, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/bufconnect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect provides buf-specific Connect functionality.\npackage bufconnect\n\nconst (\n\t// AuthenticationHeader is the standard OAuth header used for authenticating\n\t// a user. Ignore the misnomer.\n\tAuthenticationHeader = \"Authorization\"\n\t// AuthenticationTokenPrefix is the standard OAuth token prefix.\n\t// We use it for familiarity.\n\tAuthenticationTokenPrefix = \"Bearer \"\n\t// CliVersionHeaderName is the name of the header carrying the buf CLI version.\n\tCliVersionHeaderName = \"buf-version\"\n\t// CLIWarningHeaderName is the name of the header carrying a base64-encoded warning message\n\t// from the server to the CLI.\n\tCLIWarningHeaderName = \"buf-warning-bin\"\n\t// DefaultRemote is the default remote if none can be inferred from a module name.\n\tDefaultRemote = \"buf.build\"\n)\n"
  },
  {
    "path": "private/bufpkg/bufconnect/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect\n\nimport \"errors\"\n\n// AuthError wraps the error returned in the auth provider to add additional context.\ntype AuthError struct {\n\tcause       error\n\tremote      string\n\thasToken    bool\n\ttokenEnvKey string\n}\n\n// Unwrap returns the underlying error.\nfunc (e *AuthError) Unwrap() error {\n\treturn e.cause\n}\n\n// Error implements the error interface and returns the error message.\nfunc (e *AuthError) Error() string {\n\tif e.cause == nil {\n\t\treturn \"unknown error\"\n\t}\n\treturn e.cause.Error()\n}\n\n// Remote returns the remote the request was sent to.\nfunc (e *AuthError) Remote() string {\n\treturn e.remote\n}\n\n// HasToken returns whether a token was included in the request.\nfunc (e *AuthError) HasToken() bool {\n\treturn e.hasToken\n}\n\n// TokenEnvKey returns the environment variable used, if any, for authentication.\nfunc (e *AuthError) TokenEnvKey() string {\n\treturn e.tokenEnvKey\n}\n\n// AsAuthError uses errors.As to unwrap any error and look for an *AuthError.\nfunc AsAuthError(err error) (*AuthError, bool) {\n\tvar authErr *AuthError\n\tok := errors.As(err, &authErr)\n\treturn authErr, ok\n}\n\n// AugmentedConnectError wraps an error, providing the Procedure and Addr of\n// the request for introspection in callers.\ntype AugmentedConnectError struct {\n\tcause     error\n\tprocedure string\n\taddr      string\n}\n\n// Error implements the error interface and returns the error message.\nfunc (e *AugmentedConnectError) Error() string {\n\tif e.cause == nil {\n\t\treturn \"unknown error\"\n\t}\n\treturn e.cause.Error()\n}\n\n// Unwrap returns the underlying error.\nfunc (e *AugmentedConnectError) Unwrap() error {\n\treturn e.cause\n}\n\n// Procedure returns the connect.AnyRequest's Spec().Procedure.\nfunc (e *AugmentedConnectError) Procedure() string {\n\treturn e.procedure\n}\n\n// Addr returns the connect.AnyRequest's Peer().Addr.\nfunc (e *AugmentedConnectError) Addr() string {\n\treturn e.addr\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/errors_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestAuthErrorUnwrap(t *testing.T) {\n\tt.Parallel()\n\tcause := errors.New(\"underlying cause\")\n\terr := &AuthError{cause: cause}\n\tassert.Equal(t, cause, err.Unwrap())\n}\n\nfunc TestAuthErrorError(t *testing.T) {\n\tt.Parallel()\n\tcause := errors.New(\"underlying cause\")\n\terr := &AuthError{cause: cause}\n\tassert.Equal(t, \"underlying cause\", err.Error())\n}\n\nfunc TestAuthErrorTokenEnvKey(t *testing.T) {\n\tt.Parallel()\n\tcause := errors.New(\"underlying cause\")\n\terr := &AuthError{cause: cause, tokenEnvKey: \"abcd\"}\n\tassert.Equal(t, \"abcd\", err.TokenEnvKey())\n}\n\nfunc TestAsAuthError(t *testing.T) {\n\tt.Parallel()\n\tcause := errors.New(\"underlying cause\")\n\tauthErr := &AuthError{cause: cause}\n\terr := fmt.Errorf(\"wrapped error: %w\", authErr)\n\n\tunwrapped, ok := AsAuthError(err)\n\tassert.True(t, ok)\n\tassert.Equal(t, authErr, unwrapped)\n\n\tunwrapped, ok = AsAuthError(cause)\n\tassert.False(t, ok)\n\tassert.Nil(t, unwrapped)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/interceptors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"strings\"\n\t\"time\"\n\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\nconst (\n\t// TokenEnvKey is the environment variable key for the auth token\n\tTokenEnvKey = \"BUF_TOKEN\"\n)\n\n// NewAugmentedConnectErrorInterceptor returns a new Connect Interceptor that wraps\n// [connect.Error]s in an [AugmentedConnectError].\nfunc NewAugmentedConnectErrorInterceptor() connect.UnaryInterceptorFunc {\n\tinterceptor := func(next connect.UnaryFunc) connect.UnaryFunc {\n\t\treturn func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\t\tresp, err := next(ctx, req)\n\t\t\tif err != nil {\n\t\t\t\tif connectErr := new(connect.Error); errors.As(err, &connectErr) {\n\t\t\t\t\terr = &AugmentedConnectError{\n\t\t\t\t\t\t// Using the original err to avoid throwing information away.\n\t\t\t\t\t\tcause:     err,\n\t\t\t\t\t\tprocedure: req.Spec().Procedure,\n\t\t\t\t\t\taddr:      req.Peer().Addr,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn resp, err\n\t\t}\n\t}\n\treturn interceptor\n}\n\n// NewSetCLIVersionInterceptor returns a new Connect Interceptor that sets the Buf CLI version into all request headers\nfunc NewSetCLIVersionInterceptor(version string) connect.UnaryInterceptorFunc {\n\tinterceptor := func(next connect.UnaryFunc) connect.UnaryFunc {\n\t\treturn func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\t\treq.Header().Set(CliVersionHeaderName, version)\n\t\t\treturn next(ctx, req)\n\t\t}\n\t}\n\treturn interceptor\n}\n\n// NewCLIWarningInterceptor returns a new Connect Interceptor that logs CLI warnings returned by server responses.\nfunc NewCLIWarningInterceptor(container appext.LoggerContainer) connect.UnaryInterceptorFunc {\n\tinterceptor := func(next connect.UnaryFunc) connect.UnaryFunc {\n\t\treturn func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\t\tresp, err := next(ctx, req)\n\t\t\tif resp != nil {\n\t\t\t\tlogWarningFromHeader(container, resp.Header())\n\t\t\t} else if err != nil {\n\t\t\t\tif connectErr := new(connect.Error); errors.As(err, &connectErr) {\n\t\t\t\t\tlogWarningFromHeader(container, connectErr.Meta())\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn resp, err\n\t\t}\n\t}\n\treturn interceptor\n}\n\nfunc logWarningFromHeader(container appext.LoggerContainer, header http.Header) {\n\tencoded := header.Get(CLIWarningHeaderName)\n\tif encoded != \"\" {\n\t\twarning, err := connect.DecodeBinaryHeader(encoded)\n\t\tif err != nil {\n\t\t\tcontainer.Logger().Debug(fmt.Errorf(\"failed to decode warning header: %w\", err).Error())\n\t\t\treturn\n\t\t}\n\t\tif len(warning) > 0 {\n\t\t\tcontainer.Logger().Warn(string(warning))\n\t\t}\n\t}\n}\n\n// TokenProvider finds the token for NewAuthorizationInterceptorProvider.\ntype TokenProvider interface {\n\t// RemoteToken returns the remote token from the remote address.\n\tRemoteToken(address string) string\n\t// IsFromEnvVar returns true if the TokenProvider is generated from an environment variable.\n\tIsFromEnvVar() bool\n}\n\n// NewAuthorizationInterceptorProvider returns a new provider function which, when invoked, returns an interceptor\n// which will set the auth token into the request header by the provided option.\n//\n// Note that the interceptor returned from this provider is always applied LAST in the series of interceptors added to\n// a client.\nfunc NewAuthorizationInterceptorProvider(tokenProviders ...TokenProvider) func(string) connect.UnaryInterceptorFunc {\n\treturn func(address string) connect.UnaryInterceptorFunc {\n\t\tinterceptor := func(next connect.UnaryFunc) connect.UnaryFunc {\n\t\t\treturn connect.UnaryFunc(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\t\t\tusingTokenEnvKey := false\n\t\t\t\thasToken := false\n\t\t\t\tfor _, tf := range tokenProviders {\n\t\t\t\t\tif token := tf.RemoteToken(address); token != \"\" {\n\t\t\t\t\t\treq.Header().Set(AuthenticationHeader, AuthenticationTokenPrefix+token)\n\t\t\t\t\t\tusingTokenEnvKey = tf.IsFromEnvVar()\n\t\t\t\t\t\thasToken = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresponse, err := next(ctx, req)\n\t\t\t\tif err != nil {\n\t\t\t\t\tvar envKey string\n\t\t\t\t\tif usingTokenEnvKey {\n\t\t\t\t\t\tenvKey = TokenEnvKey\n\t\t\t\t\t}\n\t\t\t\t\terr = &AuthError{\n\t\t\t\t\t\tcause:       err,\n\t\t\t\t\t\tremote:      address,\n\t\t\t\t\t\thasToken:    hasToken,\n\t\t\t\t\t\ttokenEnvKey: envKey,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn response, err\n\t\t\t})\n\t\t}\n\t\treturn interceptor\n\t}\n}\n\n// NewDebugLoggingInterceptor returns a new Connect Interceptor that adds debug log\n// statements for each rpc call.\n//\n// The following information is collected for logging: duration, status code, peer name,\n// rpc system, request size, and response size.\nfunc NewDebugLoggingInterceptor(container appext.LoggerContainer) connect.UnaryInterceptorFunc {\n\tinterceptor := func(next connect.UnaryFunc) connect.UnaryFunc {\n\t\treturn func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\t\tvar requestSize int\n\t\t\tif req.Any() != nil {\n\t\t\t\tmsg, ok := req.Any().(proto.Message)\n\t\t\t\tif ok {\n\t\t\t\t\trequestSize = proto.Size(msg)\n\t\t\t\t}\n\t\t\t}\n\t\t\tstartTime := time.Now()\n\t\t\tresp, err := next(ctx, req)\n\t\t\tduration := time.Since(startTime)\n\t\t\tvar status connect.Code\n\t\t\tif err != nil {\n\t\t\t\tstatus = connect.CodeOf(err)\n\t\t\t}\n\t\t\tvar responseSize int\n\t\t\tif resp != nil && resp.Any() != nil {\n\t\t\t\tmsg, ok := resp.Any().(proto.Message)\n\t\t\t\tif ok {\n\t\t\t\t\tresponseSize = proto.Size(msg)\n\t\t\t\t}\n\t\t\t}\n\t\t\tattrs := []slog.Attr{\n\t\t\t\tslog.Duration(\"duration\", duration),\n\t\t\t\tslog.String(\"status\", status.String()),\n\t\t\t\tslog.String(\"net.peer.name\", req.Peer().Addr),\n\t\t\t\tslog.String(\"rpc.system\", req.Peer().Protocol),\n\t\t\t\tslog.Int(\"message.sent.uncompressed_size\", requestSize),\n\t\t\t\tslog.Int(\"message.received.uncompressed_size\", responseSize),\n\t\t\t}\n\t\t\tcontainer.Logger().LogAttrs(\n\t\t\t\tctx,\n\t\t\t\tslog.LevelDebug,\n\t\t\t\t// Remove the leading \"/\" from Procedure name\n\t\t\t\tstrings.TrimPrefix(req.Spec().Procedure, \"/\"),\n\t\t\t\tattrs...,\n\t\t\t)\n\t\t\treturn resp, err\n\t\t}\n\t}\n\treturn interceptor\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/interceptors_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/base64\"\n\t\"errors\"\n\t\"fmt\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appext\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\ntype testMachine struct{}\n\nfunc (testMachine) Name() string {\n\treturn \"name\"\n}\n\nfunc (testMachine) Login() string {\n\treturn \"login\"\n}\n\nfunc (testMachine) Password() string {\n\treturn \"password\"\n}\n\nfunc TestNewAuthorizationInterceptorProvider(t *testing.T) {\n\tt.Parallel()\n\ttokenSet, err := NewTokenProviderFromString(\"token1@host1,token2@host2\")\n\tassert.NoError(t, err)\n\t_, err = NewAuthorizationInterceptorProvider(tokenSet)(\"host1\")(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\tif req.Header().Get(AuthenticationHeader) != AuthenticationTokenPrefix+\"token1\" {\n\t\t\treturn nil, errors.New(\"error auth token\")\n\t\t}\n\t\treturn nil, nil\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.NoError(t, err)\n\n\tgetMachineForName := func(app.EnvContainer, string) (netrc.Machine, error) {\n\t\treturn testMachine{}, nil\n\t}\n\tnetrcTokens := &netrcTokenProvider{getMachineForName: getMachineForName}\n\tassert.NoError(t, err)\n\t_, err = NewAuthorizationInterceptorProvider(netrcTokens)(\"default\")(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\tif req.Header().Get(AuthenticationHeader) != AuthenticationTokenPrefix+\"password\" {\n\t\t\treturn nil, errors.New(\"error auth token\")\n\t\t}\n\t\treturn nil, nil\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.NoError(t, err)\n\n\t// testing using tokenSet over netrc tokenToAuthKey\n\t_, err = NewAuthorizationInterceptorProvider(tokenSet, netrcTokens)(\"host2\")(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\tif req.Header().Get(AuthenticationHeader) != AuthenticationTokenPrefix+\"token2\" {\n\t\t\treturn nil, errors.New(\"error auth token\")\n\t\t}\n\t\treturn nil, nil\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.NoError(t, err)\n\n\t// testing using netrc tokenToAuthKey over tokenSet\n\t_, err = NewAuthorizationInterceptorProvider(netrcTokens, tokenSet)(\"default\")(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\tif req.Header().Get(AuthenticationHeader) != AuthenticationTokenPrefix+\"password\" {\n\t\t\treturn nil, errors.New(\"error auth token\")\n\t\t}\n\t\treturn nil, nil\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.NoError(t, err)\n\n\t_, err = NewAuthorizationInterceptorProvider()(\"default\")(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\tif req.Header().Get(AuthenticationHeader) != \"\" {\n\t\t\treturn nil, errors.New(\"error auth token\")\n\t\t}\n\t\treturn nil, nil\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.NoError(t, err)\n\n\ttokenSet, err = NewTokenProviderFromContainer(app.NewEnvContainer(map[string]string{\n\t\tTokenEnvKey: \"default\",\n\t}))\n\tassert.NoError(t, err)\n\t_, err = NewAuthorizationInterceptorProvider(tokenSet)(\"default\")(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\treturn nil, errors.New(\"underlying cause\")\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tauthErr, ok := AsAuthError(err)\n\tassert.True(t, ok)\n\tassert.Equal(t, TokenEnvKey, authErr.tokenEnvKey)\n}\n\nfunc TestCLIWarningInterceptor(t *testing.T) {\n\tt.Parallel()\n\twarningMessage := \"This is a warning message from the BSR\"\n\tvar buf bytes.Buffer\n\tlogger, err := slogapp.NewLogger(&buf, appext.LogLevelWarn, appext.LogFormatText)\n\trequire.NoError(t, err)\n\t// testing valid warning message\n\t_, err = NewCLIWarningInterceptor(appext.NewLoggerContainer(logger))(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\tresp := connect.NewResponse(&bytes.Buffer{})\n\t\tresp.Header().Set(CLIWarningHeaderName, base64.StdEncoding.EncodeToString([]byte(warningMessage)))\n\t\treturn resp, nil\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.NoError(t, err)\n\tassert.Equal(t, fmt.Sprintf(\"WARN\\t%s\\n\", warningMessage), buf.String())\n\n\t// testing no warning message in valid response with no header\n\tbuf.Reset()\n\t_, err = NewCLIWarningInterceptor(appext.NewLoggerContainer(logger))(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\treturn connect.NewResponse(&bytes.Buffer{}), nil\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"\", buf.String())\n}\n\nfunc TestCLIWarningInterceptorFromError(t *testing.T) {\n\tt.Parallel()\n\twarningMessage := \"This is a warning message from the BSR\"\n\tvar buf bytes.Buffer\n\tlogger, err := slogapp.NewLogger(&buf, appext.LogLevelWarn, appext.LogFormatText)\n\trequire.NoError(t, err)\n\t// testing valid warning message from error\n\t_, err = NewCLIWarningInterceptor(appext.NewLoggerContainer(logger))(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\terr := connect.NewError(connect.CodeInternal, errors.New(\"error\"))\n\t\terr.Meta().Set(CLIWarningHeaderName, base64.StdEncoding.EncodeToString([]byte(warningMessage)))\n\t\treturn nil, err\n\t})(t.Context(), connect.NewRequest(&bytes.Buffer{}))\n\tassert.Error(t, err)\n\tassert.Equal(t, fmt.Sprintf(\"WARN\\t%s\\n\", warningMessage), buf.String())\n}\n\ntype testRequest[T any] struct {\n\t*connect.Request[T]\n}\n\nfunc (r testRequest[_]) Spec() connect.Spec {\n\treturn connect.Spec{\n\t\tProcedure: \"/service/method\",\n\t}\n}\nfunc (r testRequest[_]) Peer() connect.Peer {\n\treturn connect.Peer{\n\t\tAddr: \"example.com\",\n\t}\n}\n\nfunc TestNewAugmentedConnectErrorInterceptor(t *testing.T) {\n\tt.Parallel()\n\t_, err := NewAugmentedConnectErrorInterceptor()(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) {\n\t\terr := connect.NewError(connect.CodeUnknown, errors.New(\"405 Method Not Allowed\"))\n\t\treturn nil, err\n\t})(t.Context(), testRequest[bytes.Buffer]{Request: connect.NewRequest(&bytes.Buffer{})})\n\tassert.Error(t, err)\n\tvar augmentedConnectError *AugmentedConnectError\n\tassert.ErrorAs(t, err, &augmentedConnectError)\n\tassert.Equal(t, \"example.com\", augmentedConnectError.Addr())\n\tassert.Equal(t, \"/service/method\", augmentedConnectError.Procedure())\n\tvar unwrappedError *connect.Error\n\tassert.ErrorAs(t, errors.Unwrap(err), &unwrappedError)\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/netrc_token_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect\n\nimport (\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n)\n\n// netrcTokenProvider is used to provide remote tokenToAuthKey from .netrc.\ntype netrcTokenProvider struct {\n\tcontainer         app.EnvContainer\n\tgetMachineForName func(app.EnvContainer, string) (netrc.Machine, error)\n}\n\n// NewNetrcTokenProvider returns a TokenProvider for a .netrc in a container.\nfunc NewNetrcTokenProvider(container app.EnvContainer, getMachineForName func(app.EnvContainer, string) (netrc.Machine, error)) TokenProvider {\n\treturn &netrcTokenProvider{container: container, getMachineForName: getMachineForName}\n}\n\nfunc (nt *netrcTokenProvider) RemoteToken(address string) string {\n\tmachine, err := nt.getMachineForName(nt.container, address)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\tif machine != nil {\n\t\treturn machine.Password()\n\t}\n\treturn \"\"\n}\n\nfunc (nt *netrcTokenProvider) IsFromEnvVar() bool {\n\treturn false\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/static_token_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n)\n\n// NewTokenProviderFromContainer creates a singleTokenProvider from the BUF_TOKEN environment variable\nfunc NewTokenProviderFromContainer(container app.EnvContainer) (TokenProvider, error) {\n\treturn newTokenProviderFromString(container.Env(TokenEnvKey), true)\n}\n\n// NewTokenProviderFromString creates a singleTokenProvider by the token provided\nfunc NewTokenProviderFromString(token string) (TokenProvider, error) {\n\treturn newTokenProviderFromString(token, false)\n}\n\n// newTokenProviderFromString returns a TokenProvider with auth keys from the provided token. The\n// remote token is in the format: token1@remote1,token2@remote2.\n// The special characters `@` and `,` are used as the splitters. The tokens and remote addresses\n// do not contain these characters since they are enforced by the rules in BSR.\nfunc newTokenProviderFromString(token string, isFromEnvVar bool) (TokenProvider, error) {\n\tif token == \"\" {\n\t\treturn nopTokenProvider{}, nil\n\t}\n\t// Tokens for different remotes are separated by `,`. Using strings.Split to separate the string into remote tokens.\n\ttokens := strings.Split(token, \",\")\n\tif len(tokens) == 1 {\n\t\tif strings.Contains(tokens[0], \"@\") {\n\t\t\treturn newMultipleTokenProvider(tokens, isFromEnvVar)\n\t\t}\n\t\treturn newSingleTokenProvider(tokens[0], isFromEnvVar)\n\t}\n\treturn newMultipleTokenProvider(tokens, isFromEnvVar)\n}\n\n// singleTokenProvider is used to provide set of authentication tokenToAuthKey.\ntype singleTokenProvider struct {\n\t// true: the tokenSet is generated from environment variable tokenEnvKey\n\t// false: otherwise\n\tsetBufTokenEnvVar bool\n\ttoken             string\n}\n\nfunc newSingleTokenProvider(token string, isFromEnvVar bool) (*singleTokenProvider, error) {\n\tif strings.Contains(token, \"@\") {\n\t\treturn nil, errors.New(\"token cannot contain special character `@`\")\n\t}\n\tif strings.Contains(token, \",\") {\n\t\treturn nil, errors.New(\"token cannot contain special character `,`\")\n\t}\n\tif token == \"\" {\n\t\treturn nil, errors.New(\"single token cannot be empty\")\n\t}\n\treturn &singleTokenProvider{\n\t\tsetBufTokenEnvVar: isFromEnvVar,\n\t\ttoken:             token,\n\t}, nil\n}\n\n// RemoteToken finds the token by the remote address\nfunc (t *singleTokenProvider) RemoteToken(address string) string {\n\treturn t.token\n}\n\nfunc (t *singleTokenProvider) IsFromEnvVar() bool {\n\treturn t.setBufTokenEnvVar\n}\n\ntype multipleTokenProvider struct {\n\taddressToToken map[string]string\n\tisFromEnvVar   bool\n}\n\nfunc newMultipleTokenProvider(tokens []string, isFromEnvVar bool) (*multipleTokenProvider, error) {\n\taddressToToken := make(map[string]string)\n\tfor _, token := range tokens {\n\t\tsplit := strings.Split(token, \"@\")\n\t\tif len(split) != 2 {\n\t\t\treturn nil, fmt.Errorf(\"invalid token: %s\", token)\n\t\t}\n\t\tif split[0] == \"\" || split[1] == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"invalid token: %s\", token)\n\t\t}\n\t\tif strings.Contains(split[0], \":\") {\n\t\t\treturn nil, fmt.Errorf(\"invalid token: %s, token cannot contain special character `:`\", token)\n\t\t}\n\t\tif strings.Contains(split[0], \",\") {\n\t\t\treturn nil, fmt.Errorf(\"invalid token: %s, token cannot contain special character `,`\", token)\n\t\t}\n\t\tif _, ok := addressToToken[split[1]]; ok {\n\t\t\treturn nil, fmt.Errorf(\"invalid token: %s, repeated remote address: %s\", token, split[1])\n\t\t}\n\t\taddressToToken[split[1]] = split[0]\n\t}\n\treturn &multipleTokenProvider{\n\t\taddressToToken: addressToToken,\n\t\tisFromEnvVar:   isFromEnvVar,\n\t}, nil\n}\n\nfunc (m *multipleTokenProvider) RemoteToken(address string) string {\n\treturn m.addressToToken[address]\n}\n\nfunc (m *multipleTokenProvider) IsFromEnvVar() bool {\n\treturn m.isFromEnvVar\n}\n\ntype nopTokenProvider struct{}\n\nfunc (nopTokenProvider) RemoteToken(string) string {\n\treturn \"\"\n}\n\nfunc (nopTokenProvider) IsFromEnvVar() bool {\n\treturn false\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/static_token_provider_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufconnect\n\nimport (\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestNewTokenProviderFromContainer(t *testing.T) {\n\tt.Parallel()\n\ttokenSet, err := NewTokenProviderFromContainer(app.NewEnvContainer(map[string]string{\n\t\tTokenEnvKey: \"default\",\n\t}))\n\tassert.NoError(t, err)\n\ttoken := tokenSet.RemoteToken(\"fake\")\n\tassert.True(t, tokenSet.IsFromEnvVar())\n\tassert.Equal(t, \"default\", token)\n}\n\nfunc TestNewTokenProviderFromString(t *testing.T) {\n\tt.Parallel()\n\ttokenProvider, err := NewTokenProviderFromString(\"default\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"default\", tokenProvider.RemoteToken(\"host\"))\n\ttokenProvider, err = NewTokenProviderFromString(\"token1@host1\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"token1\", tokenProvider.RemoteToken(\"host1\"))\n\ttokenProvider, err = NewTokenProviderFromString(\"token1@remote1,token2@remote2\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"token1\", tokenProvider.RemoteToken(\"remote1\"))\n\tassert.Equal(t, \"token2\", tokenProvider.RemoteToken(\"remote2\"))\n\t_, err = NewTokenProviderFromString(\"\")\n\tassert.NoError(t, err)\n}\n\nfunc TestInvalidTokens(t *testing.T) {\n\tt.Parallel()\n\tinvalidTokens := []string{\n\t\t\"user1@remote1,user2@remote1\",\n\t\t\"user1@remote1,user2@remote2,\",\n\t\t\",token1@host1\",\n\t\t\"token1@host1,\",\n\t\t\"token1@\",\n\t\t\"token1@host1@\",\n\t\t\"@token1\",\n\t\t\"token1@host1,token2\",\n\t\t\",\",\n\t\t\"token,\",\n\t\t\",token\",\n\t}\n\n\tfor _, token := range invalidTokens {\n\t\t_, err := NewTokenProviderFromString(token)\n\t\tassert.Error(t, err, \"expected %s to be an invalid token, but it wasn't\", token)\n\t\t_, err = NewTokenProviderFromContainer(app.NewEnvContainer(map[string]string{\n\t\t\tTokenEnvKey: token,\n\t\t}))\n\t\tassert.Error(t, err, \"expected %s to be an invalid token, but it wasn't\", token)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufconnect/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufconnect\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimage.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"math\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\n// ImageFileInfo is the minimal interface that can be fulfilled by both an ImageFile\n// and (with conversion) a bufmodule.FileInfo.\n//\n// This is used by ls-files.\ntype ImageFileInfo interface {\n\tstorage.ObjectInfo\n\n\t// FullName returns the full name of the Module that this ImageFile came from,\n\t// if the ImageFile came from a Module (as opposed to a serialized Protobuf message),\n\t// and if the FullName was known.\n\t//\n\t// May be nil. Callers should not rely on this value being present.\n\tFullName() bufparse.FullName\n\t// CommitID returns the BSR ID of the Commit of the Module that this ImageFile came from.\n\t// if the ImageFile came from a Module (as opposed to a serialized Protobuf message), and\n\t// if the CommitID was known..\n\t//\n\t// May be empty, that is CommitID() == uuid.Nil may be true. Callers should not rely on this\n\t// value being present. If FullName is nil, this will always be empty.\n\tCommitID() uuid.UUID\n\t// Imports returns the imports for this ImageFile.\n\tImports() ([]string, error)\n\t// IsImport returns true if this file is an import.\n\tIsImport() bool\n\n\tisImageFileInfo()\n}\n\n// ImageFileInfoForModuleFileInfo returns a new ImageFileInfo for the bufmodule.FileInfo.\nfunc ImageFileInfoForModuleFileInfo(moduleFileInfo bufmodule.FileInfo) ImageFileInfo {\n\treturn newModuleImageFileInfo(moduleFileInfo)\n}\n\n// AppendWellKnownTypeImageFileInfos appends any Well-Known Types that are not already present\n// in the input ImageFileInfos.\n//\n// For example, if imageFileInfos contains \"google/protobuf/timestamp.proto\", the returned\n// ImageFileInfos will have all the Well-Known Types except for \"google/protobuf/timestamp.proto\"\n// appended.\n//\n// This function uses the input wktBucket to determine what is a Well-Known Type.\n// This bucket should contain all the Well-Known Types, and nothing else. This is used instead\n// of using datawkt directly so that we can pass in a bucket backed by a cache on-disk with\n// the Well-Known Types, and use its LocalPath information.\n//\n// The appended Well-Known Types will be in sorted order by path, and will all be marked as imports.\nfunc AppendWellKnownTypeImageFileInfos(\n\tctx context.Context,\n\twktBucket storage.ReadBucket,\n\timageFileInfos []ImageFileInfo,\n) ([]ImageFileInfo, error) {\n\tpathToImageFileInfo, err := xslices.ToUniqueValuesMap(imageFileInfos, ImageFileInfo.Path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn appendWellKnownTypeImageFileInfos(ctx, wktBucket, imageFileInfos, pathToImageFileInfo)\n}\n\n// ImageFileInfosWithOnlyTargetsAndTargetImports returns a new slice of ImageFileInfos that only\n// contains the non-imports (ie targets), and the files that those non-imports themselves\n// transitively import.\n//\n// This is used in ls-files.\n//\n// As an example, assume a module has files a.proto, b.proto, and it has a dependency on\n// a module with files c.proto, d.proto. a.proto imports c.proto. We only target the module\n// with a.proto, b.proto. The resulting slice should have a.proto, b.proto, c.proto, but not\n// d.proto.\n//\n// It is assumed that the input ImageFileInfos are self-contained, that is every import should\n// be contained within the input, except for the Well-Known Types. If a Well-Known Type is imported\n// and not present in the input, an ImageFileInfo for the Well-Known Type is automatically added\n// to the result from the given bucket.\n//\n// The result will be sorted by path.\nfunc ImageFileInfosWithOnlyTargetsAndTargetImports(\n\tctx context.Context,\n\twktBucket storage.ReadBucket,\n\timageFileInfos []ImageFileInfo,\n) ([]ImageFileInfo, error) {\n\tpathToImageFileInfo, err := xslices.ToUniqueValuesMap(imageFileInfos, ImageFileInfo.Path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\timageFileInfos, err = appendWellKnownTypeImageFileInfos(ctx, wktBucket, imageFileInfos, pathToImageFileInfo)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresultPaths := make(map[string]struct{}, len(imageFileInfos))\n\tfor _, imageFileInfo := range imageFileInfos {\n\t\tif imageFileInfo.IsImport() {\n\t\t\tcontinue\n\t\t}\n\t\tif err := imageFileInfosWithOnlyTargetsAndTargetImportsRec(imageFileInfo, pathToImageFileInfo, resultPaths); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tresultImageFileInfos := make([]ImageFileInfo, 0, len(resultPaths))\n\tfor resultPath := range resultPaths {\n\t\timageFileInfo, ok := pathToImageFileInfo[resultPath]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"no ImageFileInfo for path %q\", resultPath)\n\t\t}\n\t\tresultImageFileInfos = append(resultImageFileInfos, imageFileInfo)\n\t}\n\tsort.Slice(\n\t\tresultImageFileInfos,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn resultImageFileInfos[i].Path() < resultImageFileInfos[j].Path()\n\t\t},\n\t)\n\treturn resultImageFileInfos, nil\n}\n\n// ImageFile is a Protobuf file within an image.\ntype ImageFile interface {\n\tImageFileInfo\n\n\t// FileDescriptorProto is the backing *descriptorpb.FileDescriptorProto for this File.\n\t//\n\t// This will never be nil.\n\t// The value Path() is equal to FileDescriptorProto().GetName() .\n\tFileDescriptorProto() *descriptorpb.FileDescriptorProto\n\t// IsSyntaxUnspecified will be true if the syntax was not explicitly specified.\n\tIsSyntaxUnspecified() bool\n\t// UnusedDependencyIndexes returns the indexes of the unused dependencies within\n\t// FileDescriptor.GetDependency().\n\t//\n\t// All indexes will be valid.\n\t// Will return nil if empty.\n\tUnusedDependencyIndexes() []int32\n\n\tisImageFile()\n}\n\n// NewImageFile returns a new ImageFile.\n//\n// If externalPath is empty, path is used.\n//\n// TODO FUTURE: moduleFullName and commitID should be options since they are optional.\nfunc NewImageFile(\n\tfileDescriptor protodescriptor.FileDescriptor,\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\texternalPath string,\n\tlocalPath string,\n\tisImport bool,\n\tisSyntaxUnspecified bool,\n\tunusedDependencyIndexes []int32,\n) (ImageFile, error) {\n\treturn newImageFile(\n\t\tfileDescriptor,\n\t\tmoduleFullName,\n\t\tcommitID,\n\t\texternalPath,\n\t\tlocalPath,\n\t\tisImport,\n\t\tisSyntaxUnspecified,\n\t\tunusedDependencyIndexes,\n\t)\n}\n\n// ImageFileWithIsImport returns a copy of the ImageFile with the new ImageFile\n// now marked as an import.\n//\n// If the original ImageFile was already an import, this returns\n// the original ImageFile.\nfunc ImageFileWithIsImport(imageFile ImageFile, isImport bool) ImageFile {\n\tif imageFile.IsImport() == isImport {\n\t\treturn imageFile\n\t}\n\t// No need to validate as ImageFile is already validated.\n\treturn newImageFileNoValidate(\n\t\timageFile.FileDescriptorProto(),\n\t\timageFile.FullName(),\n\t\timageFile.CommitID(),\n\t\timageFile.ExternalPath(),\n\t\timageFile.LocalPath(),\n\t\tisImport,\n\t\timageFile.IsSyntaxUnspecified(),\n\t\timageFile.UnusedDependencyIndexes(),\n\t)\n}\n\n// Image is a buf image.\ntype Image interface {\n\t// Files are the files that comprise the image.\n\t//\n\t// This contains all files, including imports if available.\n\t// The returned files are in correct DAG order.\n\t//\n\t// All files that have the same FullName will also have the same commit, or no commit.\n\t// This is enforced at construction time.\n\tFiles() []ImageFile\n\t// GetFile gets the file for the root relative file path.\n\t//\n\t// If the file does not exist, nil is returned.\n\t// The path is expected to be normalized and validated.\n\t// Note that all values of GetDependency() can be used here.\n\tGetFile(path string) ImageFile\n\t// Resolver returns a resolver backed by this image.\n\tResolver() protoencoding.Resolver\n\n\tisImage()\n}\n\n// NewImage returns a new Image for the given ImageFiles.\n//\n// The input ImageFiles are expected to be in correct DAG order!\n// TODO FUTURE: Consider checking the above, and if not, reordering the Files.\n// If imageFiles is empty, returns error\nfunc NewImage(imageFiles []ImageFile) (Image, error) {\n\treturn newImage(imageFiles, false, nil)\n}\n\n// BuildImage runs compilation.\n//\n// An error of type FileAnnotationSet may be returned. It is up to the caller to parse this if needed.\n// FileAnnotations will use external file paths.\n//\n// The given ModuleReadBucket must be self-contained.\n//\n// A ModuleReadBucket is self-contained if it was constructed from\n// ModuleSetToModuleReadBucketWithOnlyProtoFiles. This is likely the only way you\n// should have a ModuleReadBucket that you pass to BuildImage.\n//\n// The image will contain only files targeted by the input moduleReadBucket,\n// those returned by [bufmodule.GetTargetFileInfos].\nfunc BuildImage(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tmoduleReadBucket bufmodule.ModuleReadBucket,\n\toptions ...BuildImageOption,\n) (Image, error) {\n\tbuildImageOptions := newBuildImageOptions()\n\tfor _, option := range options {\n\t\toption(buildImageOptions)\n\t}\n\treturn buildImage(\n\t\tctx,\n\t\tlogger,\n\t\tmoduleReadBucket,\n\t\tbuildImageOptions.excludeSourceCodeInfo,\n\t\tbuildImageOptions.noParallelism,\n\t)\n}\n\n// BuildImageOption is an option for BuildImage.\ntype BuildImageOption func(*buildImageOptions)\n\n// WithExcludeSourceCodeInfo returns a new BuildImageOption that excludes sourceCodeInfo.\nfunc WithExcludeSourceCodeInfo() BuildImageOption {\n\treturn func(buildImageOptions *buildImageOptions) {\n\t\tbuildImageOptions.excludeSourceCodeInfo = true\n\t}\n}\n\n// WithNoParallelism turns off parallelism for a build.\n//\n// The default is to use thread.Parallelism().\n//\n// Used for testing.\nfunc WithNoParallelism() BuildImageOption {\n\treturn func(buildImageOptions *buildImageOptions) {\n\t\tbuildImageOptions.noParallelism = true\n\t}\n}\n\n// CloneImage returns a deep copy of the given image.\nfunc CloneImage(image Image) (Image, error) {\n\toriginalFiles := image.Files()\n\timageFiles := make([]ImageFile, len(originalFiles))\n\tfor i, originalFile := range originalFiles {\n\t\tclonedFile, err := CloneImageFile(originalFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageFiles[i] = clonedFile\n\t}\n\treturn NewImage(imageFiles)\n}\n\n// CloneImageFile returns a deep copy of the given image file.\nfunc CloneImageFile(imageFile ImageFile) (ImageFile, error) {\n\tclonedDescriptor := proto.CloneOf(imageFile.FileDescriptorProto())\n\toriginalUnusedDeps := imageFile.UnusedDependencyIndexes()\n\tunusedDeps := make([]int32, len(originalUnusedDeps))\n\tcopy(unusedDeps, originalUnusedDeps)\n\t// The other attributes are already immutable, so we don't need to copy them.\n\treturn NewImageFile(\n\t\tclonedDescriptor,\n\t\timageFile.FullName(),\n\t\timageFile.CommitID(),\n\t\timageFile.ExternalPath(),\n\t\timageFile.LocalPath(),\n\t\timageFile.IsImport(),\n\t\timageFile.IsSyntaxUnspecified(),\n\t\tunusedDeps,\n\t)\n}\n\n// NewImageForProto returns a new Image for the given proto Image.\n//\n// The input Files are expected to be in correct DAG order!\n// TODO FUTURE: Consider checking the above, and if not, reordering the Files.\n//\n// TODO FUTURE: do we want to add the ability to do external path resolution here?\nfunc NewImageForProto(protoImage *imagev1.Image, options ...NewImageForProtoOption) (Image, error) {\n\tvar newImageOptions newImageForProtoOptions\n\tfor _, option := range options {\n\t\toption(&newImageOptions)\n\t}\n\tif newImageOptions.noReparse && newImageOptions.computeUnusedImports {\n\t\treturn nil, fmt.Errorf(\"cannot use both WithNoReparse and WithComputeUnusedImports options; they are mutually exclusive\")\n\t}\n\t// TODO FUTURE: right now, NewResolver sets AllowUnresolvable to true all the time\n\t// we want to make this into a check, and we verify if we need this for the individual command\n\tresolver := protoencoding.NewLazyResolver(protoImage.GetFile()...)\n\tif !newImageOptions.noReparse {\n\t\tif err := reparseImageProto(protoImage, resolver, newImageOptions.computeUnusedImports); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif err := validateProtoImage(protoImage); err != nil {\n\t\treturn nil, err\n\t}\n\timageFiles := make([]ImageFile, len(protoImage.GetFile()))\n\tfor i, protoImageFile := range protoImage.GetFile() {\n\t\tvar isImport bool\n\t\tvar isSyntaxUnspecified bool\n\t\tvar unusedDependencyIndexes []int32\n\t\tvar moduleFullName bufparse.FullName\n\t\tvar commitID uuid.UUID\n\t\tvar err error\n\t\tif protoImageFileExtension := protoImageFile.GetBufExtension(); protoImageFileExtension != nil {\n\t\t\tisImport = protoImageFileExtension.GetIsImport()\n\t\t\tisSyntaxUnspecified = protoImageFileExtension.GetIsSyntaxUnspecified()\n\t\t\tunusedDependencyIndexes = protoImageFileExtension.GetUnusedDependency()\n\t\t\tif protoModuleInfo := protoImageFileExtension.GetModuleInfo(); protoModuleInfo != nil {\n\t\t\t\tif protoModuleName := protoModuleInfo.GetName(); protoModuleName != nil {\n\t\t\t\t\tmoduleFullName, err = bufparse.NewFullName(\n\t\t\t\t\t\tprotoModuleName.GetRemote(),\n\t\t\t\t\t\tprotoModuleName.GetOwner(),\n\t\t\t\t\t\tprotoModuleName.GetRepository(),\n\t\t\t\t\t)\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\t// we only want to set this if there is a module name\n\t\t\t\t\tif protoCommitID := protoModuleInfo.GetCommit(); protoCommitID != \"\" {\n\t\t\t\t\t\tcommitID, err = uuidutil.FromDashless(protoCommitID)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn nil, err\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\timageFile, err := NewImageFile(\n\t\t\tprotoImageFile,\n\t\t\tmoduleFullName,\n\t\t\tcommitID,\n\t\t\tprotoImageFile.GetName(),\n\t\t\t\"\",\n\t\t\tisImport,\n\t\t\tisSyntaxUnspecified,\n\t\t\tunusedDependencyIndexes,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\timageFiles[i] = imageFile\n\t}\n\treturn newImage(imageFiles, false, resolver)\n}\n\n// NewImageForCodeGeneratorRequest returns a new Image from a given CodeGeneratorRequest.\n//\n// The input Files are expected to be in correct DAG order!\n// TODO FUTURE: Consider checking the above, and if not, reordering the Files.\nfunc NewImageForCodeGeneratorRequest(request *pluginpb.CodeGeneratorRequest, options ...NewImageForProtoOption) (Image, error) {\n\tprotoImageFiles := make([]*imagev1.ImageFile, len(request.GetProtoFile()))\n\tfor i, fileDescriptorProto := range request.GetProtoFile() {\n\t\t// we filter whether something is an import or not in ImageWithOnlyPaths\n\t\t// we cannot determine if the syntax was unset\n\t\tprotoImageFiles[i] = fileDescriptorProtoToProtoImageFile(fileDescriptorProto, false, false, nil, nil, \"\")\n\t}\n\timage, err := NewImageForProto(\n\t\timagev1.Image_builder{\n\t\t\tFile: protoImageFiles,\n\t\t}.Build(),\n\t\toptions...,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ImageWithOnlyPaths(\n\t\timage,\n\t\trequest.GetFileToGenerate(),\n\t\tnil,\n\t)\n}\n\n// NewImageForProtoOption is an option for use with NewImageForProto.\ntype NewImageForProtoOption func(*newImageForProtoOptions)\n\n// WithNoReparse instructs NewImageForProto to skip the reparse step. The reparse\n// step is usually needed when unmarshalling the image from bytes. It reconstitutes\n// custom options, from unrecognized bytes to known extension fields.\nfunc WithNoReparse() NewImageForProtoOption {\n\treturn func(options *newImageForProtoOptions) {\n\t\toptions.noReparse = true\n\t}\n}\n\n// WithUnusedImportsComputation instructs NewImageForProto to compute unused imports\n// for the files. These are usually computed by the compiler and stored in the image.\n// But some sources of images may not include this information, so this option can be\n// used to ensure that information is present in the image and accurate.\n//\n// This option is NOT compatible with WithNoReparse: the image must be re-parsed for\n// there to be adequate information for computing unused imports.\nfunc WithUnusedImportsComputation() NewImageForProtoOption {\n\treturn func(options *newImageForProtoOptions) {\n\t\toptions.computeUnusedImports = true\n\t}\n}\n\n// ImageWithoutImports returns a copy of the Image without imports.\n//\n// The backing Files are not copied.\nfunc ImageWithoutImports(image Image) Image {\n\timageFiles := image.Files()\n\tnewImageFiles := make([]ImageFile, 0, len(imageFiles))\n\tfor _, imageFile := range imageFiles {\n\t\tif !imageFile.IsImport() {\n\t\t\tnewImageFiles = append(newImageFiles, imageFile)\n\t\t}\n\t}\n\treturn newImageNoValidate(newImageFiles, image.Resolver())\n}\n\n// ImageWithOnlyPaths returns a copy of the Image that only includes the files\n// with the given root relative file paths or directories.\n//\n// Note that paths can be either files or directories - whether or not a path\n// is included is a result of normalpath.EqualsOrContainsPath.\n//\n// If a root relative file path does not exist, this errors.\nfunc ImageWithOnlyPaths(\n\timage Image,\n\tpaths []string,\n\texcludePaths []string,\n) (Image, error) {\n\treturn imageWithOnlyPaths(image, paths, excludePaths, false)\n}\n\n// ImageWithOnlyPathsAllowNotExist returns a copy of the Image that only includes the files\n// with the given root relative file paths.\n//\n// Note that paths can be either files or directories - whether or not a path\n// is included is a result of normalpath.EqualsOrContainsPath.\n//\n// If a root relative file path does not exist, this skips this path.\nfunc ImageWithOnlyPathsAllowNotExist(\n\timage Image,\n\tpaths []string,\n\texcludePaths []string,\n) (Image, error) {\n\treturn imageWithOnlyPaths(image, paths, excludePaths, true)\n}\n\n// ImageByDir returns multiple images that have non-imports split\n// by directory.\n//\n// That is, each Image will only contain a single directory's files\n// as it's non-imports, along with all required imports for the\n// files in that directory.\nfunc ImageByDir(image Image) ([]Image, error) {\n\timageFiles := image.Files()\n\tpaths := make([]string, 0, len(imageFiles))\n\tfor _, imageFile := range imageFiles {\n\t\tif !imageFile.IsImport() {\n\t\t\tpaths = append(paths, imageFile.Path())\n\t\t}\n\t}\n\tdirToPaths := normalpath.ByDir(paths...)\n\t// we need this to produce a deterministic order of the returned Images\n\tdirs := make([]string, 0, len(dirToPaths))\n\tfor dir := range dirToPaths {\n\t\tdirs = append(dirs, dir)\n\t}\n\tsort.Strings(dirs)\n\tnewImages := make([]Image, 0, len(dirToPaths))\n\tfor _, dir := range dirs {\n\t\tpaths, ok := dirToPaths[dir]\n\t\tif !ok {\n\t\t\t// this should never happen\n\t\t\treturn nil, fmt.Errorf(\"no dir for %q in dirToPaths\", dir)\n\t\t}\n\t\tnewImage, err := ImageWithOnlyPaths(image, paths, nil)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnewImages = append(newImages, newImage)\n\t}\n\treturn newImages, nil\n}\n\n// ImageToProtoImage returns a new ProtoImage for the Image.\nfunc ImageToProtoImage(image Image) (*imagev1.Image, error) {\n\timageFiles := image.Files()\n\tprotoImage := imagev1.Image_builder{\n\t\tFile: make([]*imagev1.ImageFile, len(imageFiles)),\n\t}.Build()\n\tfor i, imageFile := range imageFiles {\n\t\tprotoImageFile, err := imageFileToProtoImageFile(imageFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tprotoImage.GetFile()[i] = protoImageFile\n\t}\n\treturn protoImage, nil\n}\n\n// ImageToFileDescriptorSet returns a new FileDescriptorSet for the Image.\nfunc ImageToFileDescriptorSet(image Image) *descriptorpb.FileDescriptorSet {\n\treturn protodescriptor.FileDescriptorSetForFileDescriptors(ImageToFileDescriptorProtos(image)...)\n}\n\n// ImageToFileDescriptorProtos returns the FileDescriptorProtos for the Image.\nfunc ImageToFileDescriptorProtos(image Image) []*descriptorpb.FileDescriptorProto {\n\treturn imageFilesToFileDescriptorProtos(image.Files())\n}\n\n// ImageToCodeGeneratorRequest returns a new CodeGeneratorRequest for the Image.\n//\n// All non-imports are added as files to generate.\n// If includeImports is set, all non-well-known-type imports are also added as files to generate.\n// If includeWellKnownTypes is set, well-known-type imports are also added as files to generate.\n// includeWellKnownTypes has no effect if includeImports is not set.\nfunc ImageToCodeGeneratorRequest(\n\timage Image,\n\tparameter string,\n\tcompilerVersion *pluginpb.Version,\n\tincludeImports bool,\n\tincludeWellKnownTypes bool,\n) (*pluginpb.CodeGeneratorRequest, error) {\n\treturn imageToCodeGeneratorRequest(\n\t\timage,\n\t\tparameter,\n\t\tcompilerVersion,\n\t\tincludeImports,\n\t\tincludeWellKnownTypes,\n\t\tnil,\n\t\tnil,\n\t)\n}\n\n// ImagesToCodeGeneratorRequests converts the Images to CodeGeneratorRequests.\n//\n// All non-imports are added as files to generate.\n// If includeImports is set, all non-well-known-type imports are also added as files to generate.\n// If includeImports is set, only one CodeGeneratorRequest will contain any given file as a FileToGenerate.\n// If includeWellKnownTypes is set, well-known-type imports are also added as files to generate.\n// includeWellKnownTypes has no effect if includeImports is not set.\nfunc ImagesToCodeGeneratorRequests(\n\timages []Image,\n\tparameter string,\n\tcompilerVersion *pluginpb.Version,\n\tincludeImports bool,\n\tincludeWellKnownTypes bool,\n) ([]*pluginpb.CodeGeneratorRequest, error) {\n\trequests := make([]*pluginpb.CodeGeneratorRequest, len(images))\n\t// alreadyUsedPaths is a map of paths that have already been added to an image.\n\t//\n\t// We track this if includeImports is set, so that when we find an import, we can\n\t// see if the import was already added to a CodeGeneratorRequest via another Image\n\t// in the Image slice. If the import was already added, we do not add duplicates\n\t// across CodeGeneratorRequests.\n\tvar alreadyUsedPaths map[string]struct{}\n\t// nonImportPaths is a map of non-import paths.\n\t//\n\t// We track this if includeImports is set. If we find a non-import file in Image A\n\t// and this file is an import in Image B, the file will have already been added to\n\t// a CodeGeneratorRequest via Image A, so do not add the duplicate to any other\n\t// CodeGeneratorRequest.\n\tvar nonImportPaths map[string]struct{}\n\tif includeImports {\n\t\t// We don't need to track these if includeImports is false, so we only populate\n\t\t// the maps if includeImports is true. If includeImports is false, only non-imports\n\t\t// will be added to each CodeGeneratorRequest, so figuring out whether or not\n\t\t// we should add a given import to a given CodeGeneratorRequest is unnecessary.\n\t\t//\n\t\t// imageToCodeGeneratorRequest checks if these maps are nil before every access.\n\t\talreadyUsedPaths = make(map[string]struct{})\n\t\tnonImportPaths = make(map[string]struct{})\n\t\tfor _, image := range images {\n\t\t\tfor _, imageFile := range image.Files() {\n\t\t\t\tif !imageFile.IsImport() {\n\t\t\t\t\tnonImportPaths[imageFile.Path()] = struct{}{}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor i, image := range images {\n\t\tvar err error\n\t\trequests[i], err = imageToCodeGeneratorRequest(\n\t\t\timage,\n\t\t\tparameter,\n\t\t\tcompilerVersion,\n\t\t\tincludeImports,\n\t\t\tincludeWellKnownTypes,\n\t\t\talreadyUsedPaths,\n\t\t\tnonImportPaths,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn requests, nil\n}\n\ntype newImageForProtoOptions struct {\n\tnoReparse            bool\n\tcomputeUnusedImports bool\n}\n\nfunc reparseImageProto(protoImage *imagev1.Image, resolver protoencoding.Resolver, computeUnusedImports bool) error {\n\tif err := protoencoding.ReparseExtensions(resolver, protoImage.ProtoReflect()); err != nil {\n\t\treturn fmt.Errorf(\"could not reparse image: %v\", err)\n\t}\n\tif computeUnusedImports {\n\t\ttracker := &importTracker{\n\t\t\tresolver: resolver,\n\t\t\tused:     map[string]map[string]struct{}{},\n\t\t}\n\t\ttracker.findUsedImports(protoImage)\n\t\t// Now we can populated list of unused dependencies\n\t\tfor _, file := range protoImage.GetFile() {\n\t\t\tbufExt := file.GetBufExtension()\n\t\t\tif bufExt == nil {\n\t\t\t\tbufExt = &imagev1.ImageFileExtension{}\n\t\t\t\tfile.SetBufExtension(bufExt)\n\t\t\t}\n\t\t\tbufExt.SetUnusedDependency(nil) // reset\n\t\t\tusedImports := tracker.used[file.GetName()]\n\t\t\tfor i, dep := range file.GetDependency() {\n\t\t\t\tif _, ok := usedImports[dep]; !ok {\n\t\t\t\t\t// it's fine if it's public\n\t\t\t\t\tisPublic := false\n\t\t\t\t\tfor _, publicDepIndex := range file.GetPublicDependency() {\n\t\t\t\t\t\tif i == int(publicDepIndex) {\n\t\t\t\t\t\t\tisPublic = true\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\tif !isPublic {\n\t\t\t\t\t\t// This should never happen, however we do a bounds check to ensure that we are\n\t\t\t\t\t\t// doing a safe conversion for the index.\n\t\t\t\t\t\tif i > math.MaxInt32 || i < math.MinInt32 {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"unused dependency index out-of-bounds for int32 conversion: %v\", i)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbufExt.SetUnusedDependency(append(bufExt.GetUnusedDependency(), int32(i)))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// We pass in the pathToImageFileInfo here because we also call this in\n// ImageFileInfosWithOnlyTargetsAndTargetImports and we don't want to have to make this map twice.\n//\n// This also modifies the pathToImageFileInfo map if a Well-Known Type is added.\nfunc appendWellKnownTypeImageFileInfos(\n\tctx context.Context,\n\twktBucket storage.ReadBucket,\n\timageFileInfos []ImageFileInfo,\n\tpathToImageFileInfo map[string]ImageFileInfo,\n) ([]ImageFileInfo, error) {\n\t// Sorted.\n\twktObjectInfos, err := storage.AllObjectInfos(ctx, wktBucket, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\twktPaths := xslices.Map(wktObjectInfos, storage.ObjectInfo.Path)\n\tif !slices.Equal(datawkt.AllFilePaths, wktPaths) {\n\t\treturn nil, syserror.Newf(\"wktBucket paths %s are not equal to datawkt.AllFilePaths %s\", strings.Join(wktPaths, \",\"), strings.Join(datawkt.AllFilePaths, \",\"))\n\t}\n\tresultImageFileInfos := slices.Clone(imageFileInfos)\n\tfor _, wktObjectInfo := range wktObjectInfos {\n\t\tif _, ok := pathToImageFileInfo[wktObjectInfo.Path()]; !ok {\n\t\t\tfileImports, ok := datawkt.FileImports(wktObjectInfo.Path())\n\t\t\tif !ok {\n\t\t\t\treturn nil, syserror.Newf(\"datawkt.FileImports returned false for wkt %s\", wktObjectInfo.Path())\n\t\t\t}\n\t\t\timageFileInfo := newWellKnownTypeImageFileInfo(wktObjectInfo, fileImports, true)\n\t\t\tresultImageFileInfos = append(resultImageFileInfos, imageFileInfo)\n\t\t\tpathToImageFileInfo[wktObjectInfo.Path()] = imageFileInfo\n\t\t}\n\t}\n\treturn resultImageFileInfos, nil\n}\n\nfunc imageFileInfosWithOnlyTargetsAndTargetImportsRec(\n\timageFileInfo ImageFileInfo,\n\tpathToImageFileInfo map[string]ImageFileInfo,\n\tresultPaths map[string]struct{},\n) error {\n\tpath := imageFileInfo.Path()\n\tif _, ok := resultPaths[path]; ok {\n\t\treturn nil\n\t}\n\tresultPaths[path] = struct{}{}\n\timports, err := imageFileInfo.Imports()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, imp := range imports {\n\t\timportImageFileInfo, ok := pathToImageFileInfo[imp]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"%s: import %q: %w\", imageFileInfo.ExternalPath(), imp, fs.ErrNotExist)\n\t\t}\n\t\tif err := imageFileInfosWithOnlyTargetsAndTargetImportsRec(importImageFileInfo, pathToImageFileInfo, resultPaths); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/bufimagefuzz.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagefuzz\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/bufimagefuzz_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage bufimagefuzz\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"github.com/bufbuild/buf/private/buf/buftesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/pkg/prototesting\"\n\t\"github.com/bufbuild/buf/private/pkg/tmp\"\n\t\"github.com/stretchr/testify/require\"\n\t\"golang.org/x/tools/txtar\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestCorpus(t *testing.T) {\n\tt.Parallel()\n\t// To focus on just one test in the corpus, put its file name here. Don't forget to revert before committing.\n\tfocus := \"\"\n\tctx := t.Context()\n\trequire.NoError(t, filepath.Walk(\"corpus\", func(path string, info fs.FileInfo, err error) error {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif info.IsDir() {\n\t\t\treturn nil\n\t\t}\n\t\tif focus != \"\" && info.Name() != focus {\n\t\t\treturn nil\n\t\t}\n\t\tt.Run(info.Name(), func(t *testing.T) {\n\t\t\tdata, err := os.ReadFile(filepath.Join(\"corpus\", info.Name()))\n\t\t\trequire.NoError(t, err)\n\t\t\tresult, err := fuzz(ctx, data)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.NoError(t, result.error(ctx))\n\t\t})\n\t\treturn nil\n\t}))\n}\n\n// Fuzz is the entrypoint for the fuzzer.\n// We use https://github.com/dvyukov/go-fuzz for fuzzing.\n// Please follow the instructions\n// in their README for help with running the fuzz targets.\n//\n// Commented out for now, wasn't working for a long time.\n//\n// Will also cause a bandeps error - we would have to move this into private/buf\n// if we want to use it again.\n//\n// From Makefile:\n//\n// .PHONY: gofuzz\n// gofuzz: $(GO_FUZZ)\n//\n//\t@rm -rf $(TMP)/gofuzz\n//\t@mkdir -p $(TMP)/gofuzz $(TMP)/gofuzz/corpus\n//\t# go-fuzz-build requires github.com/dvyukov/go-fuzz be in go.mod, but we don't need that dependency otherwise.\n//\t# This adds go-fuzz-dep to go.mod, runs go-fuzz-build, then restores go.mod.\n//\tcp go.mod $(TMP)/go.mod.bak; cp go.sum $(TMP)/go.sum.bak\n//\tgo get github.com/dvyukov/go-fuzz/go-fuzz-dep@$(GO_FUZZ_VERSION)\n//\tcd ./private/bufpkg/bufimage/bufimagefuzz; go-fuzz-build -o $(abspath $(TMP))/gofuzz/gofuzz.zip\n//\trm go.mod go.sum; mv $(TMP)/go.mod.bak go.mod; mv $(TMP)/go.sum.bak go.sum\n//\tcp private/bufpkg/bufimage/bufimagefuzz/corpus[> $(TMP)/gofuzz/corpus\n//\tgo-fuzz -bin $(TMP)/gofuzz/gofuzz.zip -workdir $(TMP)/gofuzz\n//func Fuzz(data []byte) int {\n//ctx := context.Background()\n//result, err := fuzz(ctx, data)\n//if err != nil {\n//// data was invalid in some way\n//return -1\n//}\n//return result.panicOrN(ctx)\n//}\n\nfunc fuzz(ctx context.Context, data []byte) (_ *fuzzResult, retErr error) {\n\tdir, err := tmp.NewDir(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, dir.Close())\n\t}()\n\tif err := untxtar(data, dir.Path()); err != nil {\n\t\treturn nil, err\n\t}\n\n\tfilePaths, err := buftesting.GetProtocFilePathsErr(ctx, dir.Path(), 0)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tactualProtocFileDescriptorSet, protocErr := prototesting.GetProtocFileDescriptorSet(\n\t\tctx,\n\t\t[]string{dir.Path()},\n\t\tfilePaths,\n\t\tfalse,\n\t\tfalse,\n\t)\n\n\timage, bufErr := fuzzBuild(ctx, dir.Path())\n\treturn newFuzzResult(\n\t\tbufErr,\n\t\tprotocErr,\n\t\tactualProtocFileDescriptorSet,\n\t\timage,\n\t), nil\n}\n\n// fuzzBuild does a builder.Build for a fuzz test.\nfunc fuzzBuild(ctx context.Context, dirPath string) (bufimage.Image, error) {\n\tmoduleSet, err := bufmoduletesting.NewModuleSetForDirPath(dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufimage.BuildImage(\n\t\tctx,\n\t\txslog.NopLogger,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\tbufimage.WithExcludeSourceCodeInfo(),\n\t)\n}\n\n// txtarParse is a wrapper around txtar.Parse that will turn panics into errors.\n// This is necessary because of an issue where txtar.Parse can panic on invalid data. Because data is generated by the\n// fuzzer, it will occasionally generate data that causes this panic.\n// See https://github.com/golang/go/issues/47193\nfunc txtarParse(data []byte) (_ *txtar.Archive, retErr error) {\n\tdefer func() {\n\t\tif p := recover(); p != nil {\n\t\t\tretErr = fmt.Errorf(\"panic from txtar.Parse: %v\", p)\n\t\t}\n\t}()\n\treturn txtar.Parse(data), nil\n}\n\n// untxtar extracts txtar data to destDirPath.\nfunc untxtar(data []byte, destDirPath string) error {\n\tarchive, err := txtarParse(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(archive.Files) == 0 {\n\t\treturn fmt.Errorf(\"txtar contains no files\")\n\t}\n\tfor _, file := range archive.Files {\n\t\tdirPath := filepath.Dir(file.Name)\n\t\tif dirPath != \"\" {\n\t\t\tif err := os.MkdirAll(filepath.Join(destDirPath, dirPath), 0700); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif err := os.WriteFile(\n\t\t\tfilepath.Join(destDirPath, file.Name),\n\t\t\tfile.Data,\n\t\t\t0600,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\ntype fuzzResult struct {\n\tbufErr                        error\n\tprotocErr                     error\n\tactualProtocFileDescriptorSet *descriptorpb.FileDescriptorSet\n\timage                         bufimage.Image\n}\n\nfunc newFuzzResult(\n\tbufErr error,\n\tprotocErr error,\n\tactualProtocFileDescriptorSet *descriptorpb.FileDescriptorSet,\n\timage bufimage.Image,\n) *fuzzResult {\n\treturn &fuzzResult{\n\t\tbufErr:                        bufErr,\n\t\tprotocErr:                     protocErr,\n\t\tactualProtocFileDescriptorSet: actualProtocFileDescriptorSet,\n\t\timage:                         image,\n\t}\n}\n\n// panicOrN panics if there is an error or returns the appropriate value for Fuzz to return.\n//func (f *fuzzResult) panicOrN(ctx context.Context) int {\n//if err := f.error(ctx); err != nil {\n//panic(err.Error())\n//}\n//// This will return 1 for valid protobufs and 0 for invalid in order to encourage the fuzzer to generate more\n//// realistic looking data.\n//if f.protocErr == nil {\n//return 1\n//}\n//return 0\n//}\n\n// error returns an error that should cause Fuzz to panic.\nfunc (f *fuzzResult) error(ctx context.Context) error {\n\tif f.protocErr != nil {\n\t\tif f.bufErr == nil {\n\t\t\treturn fmt.Errorf(\"protoc has error but buf does not: %v\", f.protocErr)\n\t\t}\n\t\treturn nil\n\t}\n\tif f.bufErr != nil {\n\t\treturn fmt.Errorf(\"buf has error but protoc does not: %v\", f.bufErr)\n\t}\n\timage := bufimage.ImageWithoutImports(f.image)\n\tfileDescriptorSet := bufimage.ImageToFileDescriptorSet(image)\n\n\tdiff, err := prototesting.DiffFileDescriptorSetsJSON(\n\t\tctx,\n\t\tfileDescriptorSet,\n\t\tf.actualProtocFileDescriptorSet,\n\t\t\"buf\",\n\t\t\"protoc\",\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error diffing results: %v\", err)\n\t}\n\tif strings.TrimSpace(diff) != \"\" {\n\t\treturn fmt.Errorf(\"protoc and buf have different results: %v\", diff)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/alloptions.txtar",
    "content": "-- a.proto --\noption csharp_namespace = \"foo\";\noption go_package = \"foo\";\noption java_package = \"foo\";\noption java_outer_classname = \"foo\";\noption objc_class_prefix = \"foo\";\noption php_class_prefix = \"foo\";\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n\noption optimize_for = SPEED;\noption cc_enable_arenas = false;\noption cc_generic_services = false;\noption java_generic_services = false;\noption java_multiple_files = false;\noption java_string_check_utf8 = false;\noption php_generic_services = false;\noption py_generic_services = false;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/ccoptions.txtar",
    "content": "-- a.proto --\noption cc_enable_arenas = false;\noption optimize_for = LITE_RUNTIME;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/comment_ignores.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\n// To team members: I am sorry you have to read such a bad file.\n// To others: Do the opposite of whatever this file does.\n\n// buf:lint:ignore PACKAGE_DIRECTORY_MATCH\n// buf:lint:ignore PACKAGE_LOWER_SNAKE_CASE\n// buf:lint:ignore PACKAGE_VERSION_SUFFIX\npackage A;\n\n// buf:lint:ignore IMPORT_NO_PUBLIC\nimport public \"google/protobuf/empty.proto\";\n\n// buf:lint:ignore ENUM_PASCAL_CASE\nenum enumFoo {\n  // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n  option allow_alias = true;\n  // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooNone = 0;\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooOne = 1;\n  // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n  enumFooTwo = 1;\n}\n\n// buf:lint:ignore MESSAGE_PASCAL_CASE\nmessage messageFoo {\n  // buf:lint:ignore MESSAGE_PASCAL_CASE\n  message messageBar {\n    // buf:lint:ignore MESSAGE_PASCAL_CASE\n    message messageBaz {\n      // buf:lint:ignore ENUM_PASCAL_CASE\n      enum enumFoo {\n        // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n        option allow_alias = true;\n        // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooNone = 0;\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooOne = 1;\n        // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n        enumFooTwo = 1;\n      }\n      // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n      int64 Foo = 1;\n      // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n      oneof Bar {\n        // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n        int64 Baz = 2;\n      }\n    }\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    int64 Foo = 1;\n    // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n    oneof Bar {\n      // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n      int64 Baz = 2;\n    }\n  }\n  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  int64 Foo = 1;\n  // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n  oneof Bar {\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    int64 Baz = 2;\n  }\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\nservice serviceFoo {\n  // buf:lint:ignore RPC_PASCAL_CASE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  rpc methodFoo(\n      // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n      google.protobuf.Empty\n    ) returns (\n      // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\n      google.protobuf.Empty\n    ) {}\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n    - PACKAGE_LOWER_SNAKE_CASE\n    - PACKAGE_VERSION_SUFFIX\n    - IMPORT_NO_PUBLIC\n    - ENUM_PASCAL_CASE\n    - ENUM_NO_ALLOW_ALIAS\n    - ENUM_ZERO_VALUE_SUFFIX\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - ONEOF_LOWER_SNAKE_CASE\n    - SERVICE_PASCAL_CASE\n    - RPC_PASCAL_CASE\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/comment_ignores_cascade.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\n// To team members: I am sorry you have to read such a bad file.\n// To others: Do the opposite of whatever this file does.\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\n// buf:lint:ignore ENUM_PASCAL_CASE\n// buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\nenum enumFoo {\n  // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n  option allow_alias = true;\n  // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n  enumFooNone = 0;\n  enumFooOne = 1;\n  enumFooTwo = 1;\n}\n\n// buf:lint:ignore MESSAGE_PASCAL_CASE\n// buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n// buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\nmessage messageFoo {\n  // buf:lint:ignore MESSAGE_PASCAL_CASE\n  // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n  // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n  message messageBar {\n    // buf:lint:ignore MESSAGE_PASCAL_CASE\n    // buf:lint:ignore FIELD_LOWER_SNAKE_CASE\n    // buf:lint:ignore ONEOF_LOWER_SNAKE_CASE\n    message messageBaz {\n      // buf:lint:ignore ENUM_PASCAL_CASE\n      // buf:lint:ignore ENUM_VALUE_UPPER_SNAKE_CASE\n      enum enumFoo {\n        // buf:lint:ignore ENUM_NO_ALLOW_ALIAS\n        option allow_alias = true;\n        // buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX\n        enumFooNone = 0;\n        enumFooOne = 1;\n        enumFooTwo = 1;\n      }\n      int64 Foo = 1;\n      oneof Bar {\n        int64 Baz = 2;\n      }\n    }\n    int64 Foo = 1;\n    oneof Bar {\n      int64 Baz = 2;\n    }\n  }\n  int64 Foo = 1;\n  oneof Bar {\n    int64 Baz = 2;\n  }\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\n// buf:lint:ignore RPC_PASCAL_CASE\n// buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\nservice serviceFoo {\n  rpc methodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\n// buf:lint:ignore SERVICE_PASCAL_CASE\nservice serviceBar {\n  // buf:lint:ignore RPC_PASCAL_CASE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME\n  rpc methodBar(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ENUM_PASCAL_CASE\n    - ENUM_NO_ALLOW_ALIAS\n    - ENUM_ZERO_VALUE_SUFFIX\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n    - MESSAGE_PASCAL_CASE\n    - FIELD_LOWER_SNAKE_CASE\n    - ONEOF_LOWER_SNAKE_CASE\n    - SERVICE_PASCAL_CASE\n    - RPC_PASCAL_CASE\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/comments.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nenum EnumFoo {\n  ENUM_FOO_UNSPECIFIED = 0;\n  ENUM_FOO_ONE = 1;\n}\n\nmessage MessageFoo {\n  message MessageBar {\n    enum Foo {\n      FOO_UNSPECIFIED = 0;\n      FOO_ONE = 1;\n    }\n    message MessageBaz {\n      int64 foo = 1;\n      oneof bar {\n        int64 baz = 2;\n      }\n    }\n    int64 foo = 1;\n    oneof bar {\n      int64 baz = 2;\n    }\n  }\n  enum Foo {\n    FOO_UNSPECIFIED = 0;\n    FOO_ONE = 1;\n  }\n  int64 foo = 1;\n  oneof bar {\n    int64 baz = 2;\n  }\n}\n\nservice ServiceFoo {\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n\n// comment\nenum EnumFoo2 {\n  // comment\n  ENUM_FOO2_UNSPECIFIED = 0;\n  // comment\n  ENUM_FOO2_ONE = 1;\n}\n\n// comment\nmessage MessageFoo2 {\n  // comment\n  message MessageBar {\n  // comment\n    enum Foo {\n  // comment\n      FOO_UNSPECIFIED = 0;\n  // comment\n      FOO_ONE = 1;\n    }\n    // comment\n    message MessageBaz {\n      // comment\n      int64 foo = 1;\n      // comment\n      oneof bar {\n        // comment\n        int64 baz = 2;\n      }\n    }\n        // comment\n    int64 foo = 1;\n        // comment\n    oneof bar {\n        // comment\n      int64 baz = 2;\n    }\n  }\n  // comment\n  enum Foo {\n    // comment\n    FOO_UNSPECIFIED = 0;\n    // comment\n    FOO_ONE = 1;\n  }\n  // comment\n  int64 foo = 1;\n  // comment\n  oneof bar {\n    // comment\n    int64 baz = 2;\n  }\n}\n\n// comment\nservice ServiceFoo2 {\n  // comment\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  // comment\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n\nenum EnumFoo3 {\n  ENUM_FOO3_UNSPECIFIED = 0; // bad comment\n  ENUM_FOO3_ONE = 1; // bad comment\n} // bad comment\n\nmessage MessageFoo3 {\n  message MessageBar {\n    enum Foo {\n      FOO_UNSPECIFIED = 0; // bad comment\n      FOO_ONE = 1; // bad comment\n    } // bad comment\n    message MessageBaz {\n      int64 foo = 1; // bad comment\n      oneof bar { // bad comment\n        int64 baz = 2; // bad comment\n      } // bad comment\n    }\n    int64 foo = 1; // bad comment\n    oneof bar { // bad comment\n      int64 baz = 2; // bad comment\n    } // bad comment\n  } // bad comment\n  enum Foo { // bad comment\n    FOO_UNSPECIFIED = 0; // bad comment\n    FOO_ONE = 1; // bad comment\n  } // bad comment\n  int64 foo = 1; // bad comment\n  oneof bar { // bad comment\n    int64 baz = 2; // bad comment\n  } // bad comment\n}\n\nservice ServiceFoo3 {\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {} // bad comment\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty); // bad comment\n}\n\n//\nenum EnumFoo4 {\n  //\n  ENUM_FOO4_UNSPECIFIED = 0;\n  //\n  ENUM_FOO4_ONE = 1;\n}\n\n//\nmessage MessageFoo4 {\n  //\n  message MessageBar {\n  //\n    enum Foo {\n  //\n      FOO_UNSPECIFIED = 0;\n  //\n      FOO_ONE = 1;\n    }\n    //\n    message MessageBaz {\n      //\n      int64 foo = 1;\n      //\n      oneof bar {\n        //\n        int64 baz = 2;\n      }\n    }\n        //\n    int64 foo = 1;\n        //\n    oneof bar {\n        //\n      int64 baz = 2;\n    }\n  }\n  //\n  enum Foo {\n    //\n    FOO_UNSPECIFIED = 0;\n    //\n    FOO_ONE = 1;\n  }\n  //\n  int64 foo = 1;\n  //\n  oneof bar {\n    //\n    int64 baz = 2;\n  }\n}\n\n//\nservice ServiceFoo4 {\n  //\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  //\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n\n/*   */\nenum EnumFoo5 {\n  /*   */\n  ENUM_FOO5_UNSPECIFIED = 0;\n  /*   */\n  ENUM_FOO5_ONE = 1;\n}\n\n/*   */\nmessage MessageFoo5 {\n  /*   */\n  message MessageBar {\n  /*   */\n    enum Foo {\n  /*   */\n      FOO_UNSPECIFIED = 0;\n  /*   */\n      FOO_ONE = 1;\n    }\n    /*   */\n    message MessageBaz {\n      /*   */\n      int64 foo = 1;\n      /*   */\n      oneof bar {\n        /*   */\n        int64 baz = 2;\n      }\n    }\n        /*   */\n    int64 foo = 1;\n        /*   */\n    oneof bar {\n        /*   */\n      int64 baz = 2;\n    }\n  }\n  /*   */\n  enum Foo {\n    /*   */\n    FOO_UNSPECIFIED = 0;\n    /*   */\n    FOO_ONE = 1;\n  }\n  /*   */\n  int64 foo = 1;\n  /*   */\n  oneof bar {\n    /*   */\n    int64 baz = 2;\n  }\n}\n\n/*   */\nservice ServiceFoo5 {\n  /*   */\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  /*   */\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n\nmessage Baz {\n  map<int64, string> one = 1;\n}\n\n// comment\nservice ServiceFoo6 {\n  // this method should pass lint\n  rpc MethodFoo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  //buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE this method should fail lint\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  rpc MethodBar(google.protobuf.Empty) returns (google.protobuf.Empty);\n  //buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE this method should also fail lint\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  //\n  rpc MethodBaz(google.protobuf.Empty) returns (google.protobuf.Empty);\n  //buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE\n  // buf:lint:ignore RPC_REQUEST_STANDARD_NAME\n  // this method should pass lint\n  rpc MethodBat(google.protobuf.Empty) returns (google.protobuf.Empty);\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - COMMENTS\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/csharpoptions.txtar",
    "content": "-- double/csharp.proto --\npackage acme.weather.v1;\n\noption csharp_namespace = \"foo\";\n-- single/csharp.proto --\npackage acme.v1;\n\noption csharp_namespace = \"foo\";\n-- triple/csharp.proto --\npackage acme.weather.data.v1;\n\noption csharp_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/customoptions1.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FieldOptions {\n  int32 baz = 50007;\n}\n\nmessage Foo {\n  string bar = 1 [(baz) = 42];\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/customoptionserror1.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FieldOptions {\n  Foo foo = 50007;\n}\n\nmessage Foo {\n  string bar = 1;\n}\n-- b.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"a.proto\";\n\nmessage Baz {\n  // the name is actually (a.foo).bar\n  string bat = 1 [(a.foo).bat = 1];\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/directory_same_package.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - DIRECTORY_SAME_PACKAGE\n-- no_package.proto --\nsyntax = \"proto3\";\n-- one/c.proto --\nsyntax = \"proto3\";\n\npackage c;\n-- one/d.proto --\nsyntax = \"proto3\";\n\npackage d;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/empty.txtar",
    "content": "-- 0.proto --\nsyntax = \"proto2\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/emptyoptions.txtar",
    "content": "-- a.proto --\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/enum_first_value_zero.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\n\npackage a;\n\nenum Foo {\n  FOO_UNSPECIFIED = 0;\n  FOO_ONE = 1;\n  FOO_TWO = 2;\n}\n\nenum Bar {\n  BAR_ONE = 1;\n  BAR_UNSPECIFIED = 0;\n  BAR_TWO = 2;\n}\n\nenum Baz {\n  BAZ_ONE = 1;\n  BAZ_UNSPECIFIED = 0;\n  BAZ_TWO = 2;\n}\n\nenum Bat {\n  BAT_UNSPECIFIED = 0;\n  BAT_ONE = 1;\n  BAT_TWO = 2;\n}\n\nmessage One {\n  message Two {\n    enum Foo {\n      FOO_UNSPECIFIED = 0;\n      FOO_ONE = 1;\n      FOO_TWO = 2;\n    }\n\n    enum Bar {\n      BAR_ONE = 1;\n      BAR_UNSPECIFIED = 0;\n      BAR_TWO = 2;\n    }\n\n    enum Baz {\n      BAZ_ONE = 1;\n      BAZ_UNSPECIFIED = 0;\n      BAZ_TWO = 2;\n    }\n\n    enum Bat {\n      BAT_UNSPECIFIED = 0;\n      BAT_ONE = 1;\n      BAT_TWO = 2;\n    }\n  }\n  enum Foo {\n    FOO_UNSPECIFIED = 0;\n    FOO_ONE = 1;\n    FOO_TWO = 2;\n  }\n\n  enum Bar {\n    BAR_ONE = 1;\n    BAR_UNSPECIFIED = 0;\n    BAR_TWO = 2;\n  }\n\n  enum Baz {\n    BAZ_ONE = 1;\n    BAZ_UNSPECIFIED = 0;\n    BAZ_TWO = 2;\n  }\n\n  enum Bat {\n    BAT_UNSPECIFIED = 0;\n    BAT_ONE = 1;\n    BAT_TWO = 2;\n  }\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ENUM_FIRST_VALUE_ZERO\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/enum_pascal_case.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nenum Success {\n  SUCCESS_UNSPECIFIED = 0;\n}\n\nenum SuccessTwo {\n  SUCCESS_TWO_UNSPECIFIED = 0;\n}\n\nenum SuccessFOOThree {\n  SUCCESS_FOO_THREE_UNSPECIFIED = 0;\n}\nenum fail {\n  FAIL_UNSPECIFIED = 0;\n}\nenum failTwo {\n  FAIL_TWO_UNSPECIFIED = 0;\n}\nenum fail_three {\n  FAIL_THREE_UNSPECIFIED = 0;\n}\nenum Fail_four {\n  FAIL_FOUR_UNSPECIFIED = 0;\n}\n\nmessage Foo {\n  message Bar {\n    enum Success {\n      SUCCESS_UNSPECIFIED = 0;\n    }\n\n    enum SuccessTwo {\n      SUCCESS_TWO_UNSPECIFIED = 0;\n    }\n\n    enum SuccessFOOThree {\n      SUCCESS_FOO_THREE_UNSPECIFIED = 0;\n    }\n    enum fail {\n      FAIL_UNSPECIFIED = 0;\n    }\n    enum failTwo {\n      FAIL_TWO_UNSPECIFIED = 0;\n    }\n    enum fail_three {\n      FAIL_THREE_UNSPECIFIED = 0;\n    }\n    enum Fail_four {\n      FAIL_FOUR_UNSPECIFIED = 0;\n    }\n  }\n  enum Success {\n    SUCCESS_UNSPECIFIED = 0;\n  }\n\n  enum SuccessTwo {\n    SUCCESS_TWO_UNSPECIFIED = 0;\n  }\n\n  enum SuccessFOOThree {\n    SUCCESS_FOO_THREE_UNSPECIFIED = 0;\n  }\n  enum fail {\n    FAIL_UNSPECIFIED = 0;\n  }\n  enum failTwo {\n    FAIL_TWO_UNSPECIFIED = 0;\n  }\n  enum fail_three {\n    FAIL_THREE_UNSPECIFIED = 0;\n  }\n  enum Fail_four {\n    FAIL_FOUR_UNSPECIFIED = 0;\n  }\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ENUM_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/enum_value_prefix.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nenum Test {\n  TEST_UNSPECIFIED = 0;\n  TEST_SUCCESS = 1;\n  TEST_SUCCESS_TWO = 2;\n  TEST_SUCCESS_THREE_3 = 3;\n  TESt_FAIL = 4;\n  test_FAIL_5 = 5;\n  test__FAIL_6 = 6;\n}\n\nmessage Foo {\n  message Bar {\n    enum Test1 {\n      TEST1_UNSPECIFIED = 0;\n      TEST1_SUCCESS = 1;\n      TEST1_SUCCESS_TWO = 2;\n      TEST1_SUCCESS_THREE_3 = 3;\n      TESt1_FAIL = 4;\n      test1_FAIL_5 = 5;\n      test1__FAIL_6 = 6;\n      TEST_1_FAIL_7 = 7;\n    }\n  }\n  enum Test1 {\n    TEST1_UNSPECIFIED = 0;\n    TEST1_SUCCESS = 1;\n    TEST1_SUCCESS_TWO = 2;\n    TEST1_SUCCESS_THREE_3 = 3;\n    TESt1_FAIL = 4;\n    test1_FAIL_5 = 5;\n    test1__FAIL_6 = 6;\n    TEST_1_FAIL_7 = 7;\n  }\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ENUM_VALUE_PREFIX\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/enum_value_upper_snake_case.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nenum Test {\n  TEST_UNSPECIFIED = 0;\n  TEST_SUCCESS = 1;\n  TEST_SUCCESS_TWO = 2;\n  TEST_SUCCESS_THREE3 = 3;\n  TEST_FAIl = 4;\n  test_fail_five = 5;\n  testFailSix = 6;\n  TEST_SUCCESS_7 = 7;\n}\n\nmessage Foo {\n  message Bar {\n    enum Test {\n      TEST_UNSPECIFIED = 0;\n      TEST_SUCCESS = 1;\n      TEST_SUCCESS_TWO = 2;\n      TEST_SUCCESS_THREE3 = 3;\n      TEST_FAIl = 4;\n      test_fail_five = 5;\n      testFailSix = 6;\n      TEST_SUCCESS_7 = 7;\n    }\n  }\n  enum Test {\n    TEST_UNSPECIFIED = 0;\n    TEST_SUCCESS = 1;\n    TEST_SUCCESS_TWO = 2;\n    TEST_SUCCESS_THREE3 = 3;\n    TEST_FAIl = 4;\n    test_fail_five = 5;\n    testFailSix = 6;\n    TEST_SUCCESS_7 = 7;\n  }\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ENUM_VALUE_UPPER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/enum_zero_value_suffix.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nenum Success {\n  SUCCESS_UNSPECIFIED = 0;\n}\n\nenum SuccessTwo {\n  SUCCESS_TWO_UNSPECIFIED = 0;\n}\n\nenum Fail {\n  FAILUNSPECIFIED = 0;\n}\n\nenum FailTwo {\n  FAIL_TWO_UNSPECIFIEd = 0;\n}\n\nenum FailThree {\n  FAIL_THREE_OTHER = 0;\n}\n\nmessage Foo {\n  message Bar {\n    enum Success {\n      SUCCESS_UNSPECIFIED = 0;\n    }\n\n    enum SuccessTwo {\n      SUCCESS_TWO_UNSPECIFIED = 0;\n    }\n\n    enum Fail {\n      FAILUNSPECIFIED = 0;\n    }\n\n    enum FailTwo {\n      FAIL_TWO_UNSPECIFIEd = 0;\n    }\n\n    enum FailThree {\n      FAIL_THREE_OTHER = 0;\n    }\n  }\n  enum Success {\n    SUCCESS_UNSPECIFIED = 0;\n  }\n\n  enum SuccessTwo {\n    SUCCESS_TWO_UNSPECIFIED = 0;\n  }\n\n  enum Fail {\n    FAILUNSPECIFIED = 0;\n  }\n\n  enum FailTwo {\n    FAIL_TWO_UNSPECIFIEd = 0;\n  }\n\n  enum FailThree {\n    FAIL_THREE_OTHER = 0;\n  }\n}\n\nenum SuccessThree {\n  SUCCESS_THREE_UNSPECIFIED = 0;\n  SUCCESS_THREE_ONE = 1;\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ENUM_ZERO_VALUE_SUFFIX\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/enum_zero_value_suffix_custom.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nenum Success {\n  SUCCESSOTHER = 0;\n}\n\nenum SuccessTwo {\n  SUCCESS_TWOOTHER = 0;\n}\n\nenum SuccessThree {\n  SUCCESS_THREE_OTHER = 0;\n}\n\nenum FailTwo {\n  FAIL_TWOOTHEr = 0;\n}\n\nenum FailThree {\n  FAIL_TWO_UNSPECIFIED = 0;\n}\n\nmessage Foo {\n  message Bar {\n    enum Success {\n      SUCCESSOTHER = 0;\n    }\n\n    enum SuccessTwo {\n      SUCCESS_TWOOTHER = 0;\n    }\n\n    enum SuccessThree {\n      SUCCESS_THREE_OTHER = 0;\n    }\n\n    enum FailTwo {\n      FAIL_TWOOTHEr = 0;\n    }\n\n    enum FailThree {\n      FAIL_TWO_UNSPECIFIED = 0;\n    }\n  }\n  enum Success {\n    SUCCESSOTHER = 0;\n  }\n\n  enum SuccessTwo {\n    SUCCESS_TWOOTHER = 0;\n  }\n\n  enum SuccessThree {\n    SUCCESS_THREE_OTHER = 0;\n  }\n\n  enum FailTwo {\n    FAIL_TWOOTHEr = 0;\n  }\n\n  enum FailThree {\n    FAIL_TWO_UNSPECIFIED = 0;\n  }\n}\n\nenum SuccessFour {\n  SUCCESS_FOUROTHER = 0;\n  SUCCESS_FOUR_ONE = 1;\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ENUM_ZERO_VALUE_SUFFIX\n  enum_zero_value_suffix: OTHER\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/ex1.txtar",
    "content": "-- 0.proto --\nsyntax = \"proto2\";\nmessage Sensor {\n  required string name = 1;\n  required double temperature = 2;\n  required int32 humidity = 3;\n\n  enum SwitchLevel {\n    CLOSED = 0;\n    OPEN = 1;\n  }\n  required SwitchLevel door = 5;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/ex2.txtar",
    "content": "-- 0.proto --\nsyntax = \"proto2\";\n\nenum MyEnum\n{\n  Default = 0;\n  Variant1 = 1;\n  Variant100 = 100;\n}\n\nmessage Test {\n  required string f1 = 1;\n  required int64 f2 = 2;\n  repeated uint64 fa = 3;\n  repeated int32 fb = 4;\n  repeated int32 fc = 5 [packed = true];\n  repeated Pair pairs = 6;\n  optional bytes bbbb = 7;\n\n  extensions 100 to max;\n}\n\nmessage Pair {\n  required string key = 1;\n  optional string value = 2;\n}\n\nextend Test {\n  optional bool gtt = 100;\n  optional double gtg = 101;\n  repeated MyEnum someEnum = 102;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/ex3.txtar",
    "content": "-- 0.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Input {\n  string name = 1;\n  int32 id = 2;  // Unique ID number for this person.\n  Address add = 3;\n  repeated PhoneNumber phones = 4;  //List\n\n  message PhoneNumber {\n    string number = 1;\n  }\n\n  message Address {\n    string zip = 1;\n    string street = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/field_lower_snake_case.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  int32 success = 1;\n  int32 success_two = 2;\n  int32 Fail = 3;\n  int32 FailTwo = 4;\n  int32 failThree = 5;\n  int32 fail_four_ = 6;\n  int32 _fail_five = 7;\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      int32 success = 1;\n      int32 success_two = 2;\n      int32 Fail = 3;\n      int32 FailTwo = 4;\n      int32 failThree = 5;\n      int32 fail_four_ = 6;\n      int32 _fail_five = 7;\n    }\n    int32 success = 1;\n    int32 success_two = 2;\n    int32 Fail = 3;\n    int32 FailTwo = 4;\n    int32 failThree = 5;\n    int32 fail_four_ = 6;\n    int32 _fail_five = 7;\n  }\n}\n\nmessage Five {\n  int32 success1 = 1;\n  int32 success_2 = 2;\n  int32 success3_1 = 3;\n  int32 success_4_1 = 4;\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - FIELD_LOWER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/field_no_descriptor.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\n\npackage a;\n\nmessage One {\n  optional string descriptor = 1;\n  optional string Descriptor = 2;\n  optional string descRiptor = 3;\n  optional string _descriptor = 4;\n  optional string __descriptor = 5;\n  optional string descriptor_ = 6;\n  optional string descriptor__ = 7;\n  optional string __descriptor__ = 8;\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      optional string descriptor = 1;\n      optional string Descriptor = 2;\n      optional string descRiptor = 3;\n      optional string _descriptor = 4;\n      optional string __descriptor = 5;\n      optional string descriptor_ = 6;\n      optional string descriptor__ = 7;\n      optional string __descriptor__ = 8;\n    }\n    optional string descriptor = 1;\n    optional string Descriptor = 2;\n    optional string descRiptor = 3;\n    optional string _descriptor = 4;\n    optional string __descriptor = 5;\n    optional string descriptor_ = 6;\n    optional string descriptor__ = 7;\n    optional string __descriptor__ = 8;\n  }\n  optional string descriptor = 1;\n  optional string Descriptor = 2;\n  optional string descRiptor = 3;\n  optional string _descriptor = 4;\n  optional string __descriptor = 5;\n  optional string descriptor_ = 6;\n  optional string descriptor__ = 7;\n  optional string __descriptor__ = 8;\n}\n-- buf.yaml --\nversion: v1beta1\nlint:\n  use:\n    - FIELD_NO_DESCRIPTOR\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/file_lower_snake_case.txtar",
    "content": "-- 1.proto --\nsyntax = \"proto3\";\n\npackage a;\n-- B.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- Foo.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- a.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- aBc.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- aBc.txt --\nsyntax = \"proto3\";\n\npackage a.b;\n-- ab.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- ab_c.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- ab_c_.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - FILE_LOWER_SNAKE_CASE\n-- fooBar.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/import_no_public.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"sub/sub1.proto\";\nimport public \"sub/sub2.proto\";\nimport public \"one/one.proto\";\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - IMPORT_NO_PUBLIC\n-- one/one.proto --\nsyntax = \"proto3\";\n\npackage one;\n\nimport \"sub/sub1.proto\";\nimport public \"sub/sub2.proto\";\n-- sub/sub1.proto --\nsyntax = \"proto3\";\n\npackage sub;\n-- sub/sub2.proto --\nsyntax = \"proto3\";\n\npackage sub;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/import_no_weak.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"sub/sub1.proto\";\nimport weak \"sub/sub2.proto\";\nimport weak \"one/one.proto\";\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - IMPORT_NO_WEAK\n-- one/one.proto --\nsyntax = \"proto3\";\n\npackage one;\n\nimport \"sub/sub1.proto\";\nimport weak \"sub/sub2.proto\";\n-- sub/sub1.proto --\nsyntax = \"proto3\";\n\npackage sub;\n-- sub/sub2.proto --\nsyntax = \"proto3\";\n\npackage sub;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/import_used.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"sub/sub1.proto\";\nimport \"sub/sub2.proto\";\nimport \"one/one.proto\";\n\nmessage A {\n  sub.Sub2 sub2 = 1;\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - IMPORT_USED\n-- one/one.proto --\nsyntax = \"proto3\";\n\npackage one;\n\nimport \"sub/sub1.proto\";\nimport \"sub/sub2.proto\";\n\nmessage One {\n  sub.Sub1 sub1 = 1;\n}\n-- sub/sub1.proto --\nsyntax = \"proto3\";\n\npackage sub;\n\nmessage Sub1 {}\n-- sub/sub2.proto --\nsyntax = \"proto3\";\n\npackage sub;\n\nmessage Sub2 {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/javaoptions.txtar",
    "content": "-- java_file.proto --\npackage acme.weather;\n\noption java_multiple_files = true;\noption java_string_check_utf8 = false;\noption java_package = \"foo\";\noption java_outer_classname = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/jsoptions.txtar",
    "content": "-- a.proto --\noption optimize_for = CODE_SIZE;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/message_pascal_case.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nmessage Success {}\nmessage SuccessTwo {}\nmessage SuccessFOOThree {\n  message fail {}\n  message failTwo {\n    message fail_three {}\n  }\n}\n\nmessage fail {}\nmessage failTwo {}\nmessage fail_three {}\nmessage Fail_four {\n  message fail {}\n  message failTwo {\n    message fail_three {}\n  }\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - MESSAGE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/objcoptions.txtar",
    "content": "-- double/objc.proto --\npackage acme.weather.v1;\n\noption objc_class_prefix = \"foo\";\n-- gpb/objc.proto --\npackage google.protobuf.bla.v1;\n\noption objc_class_prefix = \"foo\";\n-- single/objc.proto --\npackage acme.v1;\n\noption objc_class_prefix = \"foo\";\n-- triple/objc.proto --\npackage acme.weather.data.v1;\n\noption objc_class_prefix = \"foo\";\n-- unversioned/objc.proto --\npackage acme.weather.data;\n\noption objc_class_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/oneof_lower_snake_case.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nmessage One {\n  oneof success {\n    int32 one = 1;\n  }\n  oneof success_two {\n    int32 two = 2;\n  }\n  oneof Fail {\n    int32 three = 3;\n  }\n  oneof FailTwo {\n    int32 four = 4;\n  }\n  oneof failThree {\n    int32 five = 5;\n  }\n  oneof fail_four_ {\n    int32 six = 6;\n  }\n  oneof _fail_five {\n    int32 seven = 7;\n  }\n}\n\nmessage Two {\n  message Three {\n    message Four {\n      oneof success {\n        int32 one = 1;\n      }\n      oneof success_two {\n        int32 two = 2;\n      }\n      oneof Fail {\n        int32 three = 3;\n      }\n      oneof FailTwo {\n        int32 four = 4;\n      }\n      oneof failThree {\n        int32 five = 5;\n      }\n      oneof fail_four_ {\n        int32 six = 6;\n      }\n      oneof _fail_five {\n        int32 seven = 7;\n      }\n    }\n    oneof success {\n      int32 one = 1;\n    }\n    oneof success_two {\n      int32 two = 2;\n    }\n    oneof Fail {\n      int32 three = 3;\n    }\n    oneof FailTwo {\n      int32 four = 4;\n    }\n    oneof failThree {\n      int32 five = 5;\n    }\n    oneof fail_four_ {\n      int32 six = 6;\n    }\n    oneof _fail_five {\n      int32 seven = 7;\n    }\n  }\n}\n\n// checking to see if the implicit oneof triggers the linter, which it should not\nmessage Three {\n  message Four {\n    message Five {\n      optional string one = 1;\n    }\n    optional string one = 1;\n  }\n  optional string one = 1;\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - ONEOF_LOWER_SNAKE_CASE\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/optionpanic.txtar",
    "content": "-- options/option.proto --\nsyntax = \"proto3\";\n\npackage options;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FileOptions {\n  MyOption my_option = 9999;\n}\n\nmessage MyOption {\n  repeated MyArray my_array = 1;\n}\n\nmessage MyArray {\n  message TestMessage {\n  }\n  map<string, TestMessage> my_map = 1;\n}\n-- proto/test.proto --\nsyntax = \"proto3\";\n\npackage proto;\n\nimport \"options/option.proto\";\n\noption (options.my_option) = {\n  my_array: {\n    my_map: {\n    }\n  }\n};\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/package_defined.txtar",
    "content": "-- a/no_package.proto --\nsyntax = \"proto3\";\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_DEFINED\n-- no_package.proto --\nsyntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/package_directory_match.txtar",
    "content": "-- a/b/a_b.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- a/b/a_c.proto --\nsyntax = \"proto3\";\n\npackage a.c;\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_DIRECTORY_MATCH\n-- no_package.proto --\nsyntax = \"proto3\";\n-- sub/a/b/a_b.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/package_lower_snake_case.txtar",
    "content": "-- 1.proto --\nsyntax = \"proto3\";\n\npackage a;\n-- 2.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n-- 3.proto --\nsyntax = \"proto3\";\n\npackage a.b_cde;\n-- 4.proto --\nsyntax = \"proto3\";\n\npackage a.b_cde.f;\n-- 5.proto --\nsyntax = \"proto3\";\n\npackage a.b_cdE.f;\n-- 6.proto --\nsyntax = \"proto3\";\n\npackage a.b_cde.F;\n-- 7.proto --\nsyntax = \"proto3\";\n\npackage a.bcde.F;\n-- 8.proto --\nsyntax = \"proto3\";\n\npackage a.b_cde.f_;\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_LOWER_SNAKE_CASE\n-- no_package.proto --\nsyntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/package_same_directory.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_SAME_DIRECTORY\n-- one/a.proto --\nsyntax = \"proto3\";\n\npackage a;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/package_same_directory_no_package.txtar",
    "content": "-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_SAME_DIRECTORY\n-- no_package.proto --\nsyntax = \"proto3\";\n-- one/no_package.proto --\nsyntax = \"proto3\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/package_same_option_value.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\noption csharp_namespace = \"foo\";\noption java_multiple_files = true;\noption java_package = \"foo\";\noption go_package = \"foo\";\noption php_namespace = \"foo\";\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n-- b.proto --\nsyntax = \"proto3\";\n\npackage a;\n\noption csharp_namespace = \"bar\";\noption java_multiple_files = false;\noption java_package = \"bar\";\noption go_package = \"bar\";\noption php_namespace = \"bar\";\noption ruby_package = \"bar\";\noption swift_prefix = \"bar\";\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_SAME_CSHARP_NAMESPACE\n    - PACKAGE_SAME_GO_PACKAGE\n    - PACKAGE_SAME_JAVA_MULTIPLE_FILES\n    - PACKAGE_SAME_JAVA_PACKAGE\n    - PACKAGE_SAME_PHP_NAMESPACE\n    - PACKAGE_SAME_RUBY_PACKAGE\n    - PACKAGE_SAME_SWIFT_PREFIX\n-- sub/a.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n\n// comment\noption csharp_namespace = \"foo\";\noption java_multiple_files = true;\noption java_package = \"foo\";\noption go_package = \"foo\";\noption php_namespace = \"foo\";\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n-- sub/b.proto --\nsyntax = \"proto3\";\n\npackage a.b;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/package_version_suffix.txtar",
    "content": "-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - PACKAGE_VERSION_SUFFIX\n-- foo.proto --\nsyntax = \"proto3\";\n\npackage foo;\n-- foo_bar.proto --\nsyntax = \"proto3\";\n\npackage foo.bar;\n-- foo_bar_v0beta1.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v0beta1;\n-- foo_bar_v1.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v1;\n-- foo_bar_v1beta1.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v1beta1;\n-- foo_bar_v1test.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v1test;\n-- foo_bar_v1test_foo.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v1test.foo;\n-- foo_bar_v1testfoo.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v1testfoo;\n-- foo_bar_v2.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v2;\n-- foo_bar_v2beta0.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.v2beta0;\n-- foo_bar_vv1beta1.proto --\nsyntax = \"proto3\";\n\npackage foo.bar.vv1beta1;\n-- no_package.proto --\nsyntax = \"proto3\";\n-- v1.proto --\nsyntax = \"proto3\";\n\npackage v1;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/packageversion.txtar",
    "content": "-- a.proto --\npackage weather.v1alpha1;\n\noption go_package = \"weather\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/phpoptions.txtar",
    "content": "-- double/php.proto --\npackage acme.weather.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n-- reserved/php.proto --\npackage acme.error.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n-- single/php.proto --\npackage acme.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n-- triple/php.proto --\npackage acme.weather.data.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/proto3optional1.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\nmessage Foo {\n  optional string bar = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/rpc_no_streaming.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc NoStreaming(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc RequestStreaming(stream google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc ResponseStreaming(google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n  rpc BothStreaming(stream google.protobuf.Empty) returns (stream google.protobuf.Empty) {}\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - RPC_NO_CLIENT_STREAMING\n    - RPC_NO_SERVER_STREAMING\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/rpc_pascal_case.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc Success(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc SuccessTwo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc SuccessFOOThree(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc fail(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc failTwo(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc fail_three(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n  rpc Fail_four(google.protobuf.Empty) returns (google.protobuf.Empty) {}\n}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - RPC_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/rpc_standard_name.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc Success(SuccessRequest) returns (SuccessResponse) {}\n  rpc AnotherSuccess(FooAnotherSuccessRequest) returns (FooAnotherSuccessResponse) {}\n  rpc FailRequest(Bar) returns (FailRequestResponse) {}\n  rpc FailResponse(FailResponseRequest) returns (Bar) {}\n  rpc NoAllowEmptyRequest(google.protobuf.Empty) returns (NoAllowEmptyRequestResponse) {}\n  rpc NoAllowEmptyResponse(NoAllowEmptyResponseRequest) returns (google.protobuf.Empty) {}\n}\n\nmessage SuccessRequest {}\nmessage SuccessResponse {}\nmessage FooAnotherSuccessRequest {}\nmessage FooAnotherSuccessResponse {}\nmessage FailRequestResponse {}\nmessage FailResponseRequest {}\nmessage NoAllowEmptyRequestResponse {}\nmessage NoAllowEmptyResponseRequest {}\nmessage Bar {}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/rpc_standard_name_allow_empty.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/empty.proto\";\n\nservice Foo {\n  rpc Success(SuccessRequest) returns (SuccessResponse) {}\n  rpc AnotherSuccess(FooAnotherSuccessRequest) returns (FooAnotherSuccessResponse) {}\n  rpc FailRequest(Bar) returns (FailRequestResponse) {}\n  rpc FailResponse(FailResponseRequest) returns (Bar) {}\n  rpc AllowEmptyRequest(google.protobuf.Empty) returns (AllowEmptyRequestResponse) {}\n  rpc AllowEmptyResponse(AllowEmptyResponseRequest) returns (google.protobuf.Empty) {}\n}\n\nmessage SuccessRequest {}\nmessage SuccessResponse {}\nmessage FooAnotherSuccessRequest {}\nmessage FooAnotherSuccessResponse {}\nmessage FailRequestResponse {}\nmessage FailResponseRequest {}\nmessage AllowEmptyRequestResponse {}\nmessage AllowEmptyResponseRequest {}\nmessage Bar {}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - RPC_REQUEST_STANDARD_NAME\n    - RPC_RESPONSE_STANDARD_NAME\n  rpc_allow_google_protobuf_empty_requests: true\n  rpc_allow_google_protobuf_empty_responses: true\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/rubyoptions.txtar",
    "content": "-- double/ruby.proto --\npackage acme.weather.v1;\n\noption ruby_package = \"foo\";\n-- single/ruby.proto --\npackage acme.v1;\n\noption ruby_package = \"foo\";\n-- triple/ruby.proto --\npackage acme.weather.data.v1;\n\noption ruby_package = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/semicolons.txtar",
    "content": "-- a.proto --\nsyntax=\"proto3\";;;;\n;;;\n;package a;;;;;\n;\n;;;;import \"google/protobuf/descriptor.proto\";\n;;\n;\n;;extend google.protobuf.FileOptions {\n\tbool foo = 9999999;\n}\n;\n;message Bar {\n\t;;;option deprecated = true;;;;\n\t;;;;\n\tint32 one = 1;;;;\n\t;repeated bool two = 2 [deprecated = true];;\n\tmap<string, string> three = 3 [\n\t\tdeprecated = false\n\t];;;;\n};;;;\n;;\n;enum Baz {\n\t;;;;option deprecated = true;;;;\n\n\t;DEFAULT = 0;;;;\n\tONE = 1;;;\n\tTWO = 2;;;;\n};;;\n;;\n;service BatService {\n;\t;option deprecated = true;;;;\n;\n\t;rpc Bam(Bar) returns (Other);;;\n;\n\trpc Ban(Other) returns (Bar) {\n\t;\t;option deprecated = true;;;;\n\t};;;;\n};;;;\n;\n;\n;;;;message Other{;;;};;;;;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/service_pascal_case.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nservice Success {}\nservice SuccessTwo {}\nservice SuccessFOOThree {}\nservice fail {}\nservice failTwo {}\nservice fail_three {}\nservice Fail_four {}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - SERVICE_PASCAL_CASE\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/service_suffix.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nservice SuccessService {}\nservice SuccessTwoService {}\nservice SuccessThree_Service {}\nservice Fail {}\nservice FailAPI {}\nservice FailService_ {}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - SERVICE_SUFFIX\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/service_suffix_custom.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage a;\n\nservice SuccessAPI {}\nservice SuccessTwoAPI {}\nservice SuccessThree_API {}\nservice Fail {}\nservice FailService {}\nservice FailAPI_ {}\nservice FailApi_ {}\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - SERVICE_SUFFIX\n  service_suffix: API\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/simple.txtar",
    "content": "-- .proto --\nmessage A{}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/syntax_specified.txtar",
    "content": "-- a/a.proto --\n// comment\n\npackage a;\n-- a/a2.proto --\n// comment\n\nsyntax = \"proto2\";\n\npackage a;\n-- a/a3.proto --\n// comment\n\nsyntax = \"proto3\";\n\npackage a;\n-- buf.yaml --\nversion: v1\nlint:\n  use:\n    - SYNTAX_SPECIFIED\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/test.txtar",
    "content": "-- 0.proto --\nsyntax = \"proto3\";\n\npackage a.v1;\n\noption go_package = \"av1\";\n\n// ServiceDefinition is a service definition.\nservice ServiceDefinition {\n  // Method does a thing.\n  rpc Method(MethodRequest) returns (MethodResponse) {}\n  rpc OtherMethod(MethodRequest) returns (MethodResponse);\n}\n\nmessage MethodRequest {\n  // field is a protobuf message field\n  string field = 1 [\n    json_name = \"foo\"\n  ];\n}\n\nmessage MethodResponse {\n  // field is a protobuf message field\n  string field = 1;\n}\n-- 1.proto --\nsyntax = \"proto3\";\n\npackage b.v1;\n\nimport \"google/protobuf/timestamp.proto\";\nimport \"2.proto\";\n\noption go_package = \"bv1\";\n\nmessage OtherMessage {\n  bytes other_field = 1 [\n    (c.v1.foo) = \"bar\"\n  ];\n  google.protobuf.Timestamp time_field = 2 [\n    (c.v1.foo) = \"baz\"\n  ];\n}\n\nenum EnumType {\n  ENUM_TYPE_UNSPECIFIED = 0;\n  ENUM_TYPE_ONE = 1;\n}\n-- 2.proto --\nsyntax = \"proto2\";\n\npackage c.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FieldOptions {\n  optional string foo = 50001;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/corpus/wktimport.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\n\npackage acme.weather.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Container {\n    google.protobuf.Timestamp timestamp = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagefuzz/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufimagefuzz\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/bufimagemodify.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagemodify\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/internal\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n)\n\n// Modify modifies the image according to the managed config.\n//\n// The CLI should use this function instead of ModifyXYZ.\nfunc Modify(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImage(\n\t\timage,\n\t\tconfig,\n\t\t[]func(internal.MarkSweeper, bufimage.ImageFile, bufconfig.GenerateManagedConfig, ...ModifyOption) error{\n\t\t\tmodifyCcEnableArenas,\n\t\t\tmodifyCsharpNamespace,\n\t\t\tmodifyGoPackage,\n\t\t\tmodifyJavaMultipleFiles,\n\t\t\tmodifyJavaOuterClass,\n\t\t\tmodifyJavaPackage,\n\t\t\tmodifyJavaStringCheckUtf8,\n\t\t\tmodifyObjcClassPrefix,\n\t\t\tmodifyOptimizeFor,\n\t\t\tmodifyPhpMetadataNamespace,\n\t\t\tmodifyPhpNamespace,\n\t\t\tmodifyRubyPackage,\n\t\t\tmodifySwiftPrefix,\n\t\t\tmodifyJsType,\n\t\t},\n\t\toptions...,\n\t)\n}\n\n// ModifyJavaOuterClass modifies the java_outer_class file option.\nfunc ModifyJavaOuterClass(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyJavaOuterClass,\n\t\toptions...,\n\t)\n}\n\n// ModifyJavaPackage modifies the java_package file option.\nfunc ModifyJavaPackage(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyJavaPackage,\n\t\toptions...,\n\t)\n}\n\n// ModifyGoPackage modifies the go_package file option.\nfunc ModifyGoPackage(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyGoPackage,\n\t\toptions...,\n\t)\n}\n\n// ModifyObjcClassPrefix modifies the objc_class_prefix file option.\nfunc ModifyObjcClassPrefix(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyObjcClassPrefix,\n\t\toptions...,\n\t)\n}\n\n// ModifyCsharpNamespace modifies the csharp_namespace file option.\nfunc ModifyCsharpNamespace(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyCsharpNamespace,\n\t\toptions...,\n\t)\n}\n\n// ModifyPhpNamespace modifies the php_namespace file option.\nfunc ModifyPhpNamespace(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyPhpNamespace,\n\t\toptions...,\n\t)\n}\n\n// ModifyPhpMetadataNamespace modifies the php_metadata_namespace file option.\nfunc ModifyPhpMetadataNamespace(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyPhpMetadataNamespace,\n\t\toptions...,\n\t)\n}\n\n// ModifyRubyPackage modifies the ruby_package file option.\nfunc ModifyRubyPackage(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyRubyPackage,\n\t\toptions...,\n\t)\n}\n\n// ModifySwiftPrefix modifies the swift_prefix file option.\nfunc ModifySwiftPrefix(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifySwiftPrefix,\n\t\toptions...,\n\t)\n}\n\n// ModifyCcEnableArenas modifies the cc_enable_arenas file option.\nfunc ModifyCcEnableArenas(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyCcEnableArenas,\n\t\toptions...,\n\t)\n}\n\n// ModifyJavaMultipleFiles modifies the java_multiple_files file option.\nfunc ModifyJavaMultipleFiles(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyJavaMultipleFiles,\n\t\toptions...,\n\t)\n}\n\n// ModifyJavaStringCheckUtf8 modifies the java_string_check_utf8 file option.\nfunc ModifyJavaStringCheckUtf8(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyJavaStringCheckUtf8,\n\t\toptions...,\n\t)\n}\n\n// ModifyOptimizeFor modifies the optimize_for file option.\nfunc ModifyOptimizeFor(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyOptimizeFor,\n\t\toptions...,\n\t)\n}\n\n// ModifyJsType modifies the js_type field option.\nfunc ModifyJsType(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImageForSingleOption(\n\t\timage,\n\t\tconfig,\n\t\tmodifyJsType,\n\t\toptions...,\n\t)\n}\n\n// ModifyOption is an option for Modify.\ntype ModifyOption func(*modifyOptions)\n\n// ModifyPreserveExisting only modifies an option if it is not defined in the file.\n//\n// Do not use this option in the CLI.\nfunc ModifyPreserveExisting() ModifyOption {\n\treturn func(modifyOptions *modifyOptions) {\n\t\tmodifyOptions.preserveExisting = true\n\t}\n}\n\n// *** PRIVATE ***\n\ntype modifyOptions struct {\n\tpreserveExisting bool\n}\n\nfunc newModifyOptions() *modifyOptions {\n\treturn &modifyOptions{}\n}\n\nfunc modifyImage(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\tmodifyFuncs []func(internal.MarkSweeper, bufimage.ImageFile, bufconfig.GenerateManagedConfig, ...ModifyOption) error,\n\toptions ...ModifyOption,\n) error {\n\tif !config.Enabled() {\n\t\treturn nil\n\t}\n\tsweeper := internal.NewMarkSweeper(image)\n\tfor _, imageFile := range image.Files() {\n\t\tif datawkt.Exists(imageFile.Path()) {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, modifyFunc := range modifyFuncs {\n\t\t\tif err := modifyFunc(sweeper, imageFile, config, options...); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn sweeper.Sweep()\n}\n\nfunc modifyImageForSingleOption(\n\timage bufimage.Image,\n\tconfig bufconfig.GenerateManagedConfig,\n\tmodifyFunc func(internal.MarkSweeper, bufimage.ImageFile, bufconfig.GenerateManagedConfig, ...ModifyOption) error,\n\toptions ...ModifyOption,\n) error {\n\treturn modifyImage(\n\t\timage,\n\t\tconfig,\n\t\t[]func(internal.MarkSweeper, bufimage.ImageFile, bufconfig.GenerateManagedConfig, ...ModifyOption) error{modifyFunc},\n\t\toptions...,\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/bufimagemodify_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagemodify\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/internal\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagetesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/google/uuid\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestModifyImage(t *testing.T) {\n\tt.Parallel()\n\ttestcases := []struct {\n\t\tdescription               string\n\t\tdirPathToFullName         map[string]string\n\t\tconfig                    bufconfig.GenerateManagedConfig\n\t\tfilePathToExpectedOptions map[string]*descriptorpb.FileOptions\n\t}{\n\t\t{\n\t\t\tdescription: \"nil_config\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(false, nil, nil),\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"foo_empty/with_package.proto\": nil,\n\t\t\t\t\"bar_all/with_package.proto\": {\n\t\t\t\t\tCcEnableArenas:       proto.Bool(false),\n\t\t\t\t\tCcGenericServices:    proto.Bool(false),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"bar\"),\n\t\t\t\t\tGoPackage:            proto.String(\"bar\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(false),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(false),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"bar\"),\n\t\t\t\t\tJavaPackage:          proto.String(\"bar\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(false),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"bar\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_SPEED.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"bar\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"bar\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"bar\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(false),\n\t\t\t\t\tRubyPackage:          proto.String(\"bar\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"bar\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"empty_config\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{},\n\t\t\t),\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"foo_empty/with_package.proto\": {\n\t\t\t\t\t// CcEnableArena's default value is true\n\t\t\t\t\tCsharpNamespace: proto.String(\"Foo.Empty\"),\n\t\t\t\t\t// GoPackage is not modified by default\n\t\t\t\t\tJavaMultipleFiles:  proto.Bool(true),\n\t\t\t\t\tJavaOuterClassname: proto.String(\"WithPackageProto\"),\n\t\t\t\t\tJavaPackage:        proto.String(\"com.foo.empty\"),\n\t\t\t\t\t// JavaStringCheckUtf8 is not modified by default\n\t\t\t\t\tObjcClassPrefix: proto.String(\"FEX\"),\n\t\t\t\t\t// OptimizeFor tries to modify this value to SPEED, which is already the default\n\t\t\t\t\t// Empty is a keyword in php\n\t\t\t\t\tPhpMetadataNamespace: proto.String(`Foo\\Empty_\\GPBMetadata`),\n\t\t\t\t\tPhpNamespace:         proto.String(`Foo\\Empty_`),\n\t\t\t\t\tRubyPackage:          proto.String(\"Foo::Empty\"),\n\t\t\t\t},\n\t\t\t\t\"foo_empty/without_package.proto\": {\n\t\t\t\t\t// CcEnableArena's default value is true\n\t\t\t\t\t// GoPackage is not modified by default\n\t\t\t\t\tJavaMultipleFiles:  proto.Bool(true),\n\t\t\t\t\tJavaOuterClassname: proto.String(\"WithoutPackageProto\"),\n\t\t\t\t\t// JavaStringCheckUtf8 is not modified by default\n\t\t\t\t\t// OptimizeFor tries to modify this value to SPEED, which is already the default\n\t\t\t\t},\n\t\t\t\t\"bar_all/with_package.proto\": {\n\t\t\t\t\tCcEnableArenas:       proto.Bool(true),\n\t\t\t\t\tCcGenericServices:    proto.Bool(false),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"Bar.All\"),\n\t\t\t\t\tGoPackage:            proto.String(\"bar\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(false),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(true),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"WithPackageProto\"),\n\t\t\t\t\tJavaPackage:          proto.String(\"com.bar.all\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(false),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"BAX\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_SPEED.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"bar\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(`Bar\\All\\GPBMetadata`),\n\t\t\t\t\tPhpNamespace:         proto.String(`Bar\\All`),\n\t\t\t\t\tPyGenericServices:    proto.Bool(false),\n\t\t\t\t\tRubyPackage:          proto.String(\"Bar::All\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"bar\"),\n\t\t\t\t},\n\t\t\t\t\"bar_all/without_package.proto\": {\n\t\t\t\t\tCcEnableArenas:       proto.Bool(true),\n\t\t\t\t\tCcGenericServices:    proto.Bool(false),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"bar\"),\n\t\t\t\t\tGoPackage:            proto.String(\"bar\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(false),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(true),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"WithoutPackageProto\"),\n\t\t\t\t\tJavaPackage:          proto.String(\"bar\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(false),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"bar\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_SPEED.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"bar\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(`bar`),\n\t\t\t\t\tPhpNamespace:         proto.String(`bar`),\n\t\t\t\t\tPyGenericServices:    proto.Bool(false),\n\t\t\t\t\tRubyPackage:          proto.String(\"bar\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"bar\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tfor _, testcase := range testcases {\n\t\tfor _, includeSourceInfo := range []bool{true, false} {\n\t\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\timage := testGetImageFromDirs(t, testcase.dirPathToFullName, includeSourceInfo)\n\t\t\t\terr := Modify(\n\t\t\t\t\timage,\n\t\t\t\t\ttestcase.config,\n\t\t\t\t)\n\t\t\t\trequire.NoError(t, err)\n\t\t\t\tfor filePath, expectedOptions := range testcase.filePathToExpectedOptions {\n\t\t\t\t\timageFile := image.GetFile(filePath)\n\t\t\t\t\trequire.NotNil(t, imageFile)\n\t\t\t\t\trequire.Empty(\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tcmp.Diff(expectedOptions, imageFile.FileDescriptorProto().GetOptions(), protocmp.Transform()),\n\t\t\t\t\t\timageFile.FileDescriptorProto().GetOptions(),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n\nfunc TestModifyImageFile(\n\tt *testing.T,\n) {\n\tt.Parallel()\n\ttestcases := []struct {\n\t\tdescription                           string\n\t\tdirPathToFullName                     map[string]string\n\t\tconfig                                bufconfig.GenerateManagedConfig\n\t\tmodifyFunc                            func(internal.MarkSweeper, bufimage.ImageFile, bufconfig.GenerateManagedConfig, ...ModifyOption) error\n\t\tfilePathToExpectedOptions             map[string]*descriptorpb.FileOptions\n\t\tfilePathToExpectedMarkedLocationPaths map[string][][]int32\n\t}{\n\t\t{\n\t\t\tdescription: \"cc_enable_arena\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/bar\", bufconfig.FileOptionCcEnableArenas, false),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifyCcEnableArenas,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"foo_empty/without_package.proto\": nil,\n\t\t\t\t\"bar_empty/without_package.proto\": {\n\t\t\t\t\tCcEnableArenas: proto.Bool(false),\n\t\t\t\t},\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"bar_empty/without_package.proto\": {ccEnableArenasPath},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"csharp_namespace\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{\n\t\t\t\t\tnewTestManagedDisableRule(t, \"foo_empty/with_package.proto\", \"\", \"\", bufconfig.FileOptionCsharpNamespacePrefix, bufconfig.FieldOptionUnspecified),\n\t\t\t\t},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"bar_empty\", \"buf.build/acme/bar\", bufconfig.FileOptionCsharpNamespacePrefix, \"BarPrefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"bar_empty/without_package.proto\", \"buf.build/acme/bar\", bufconfig.FileOptionCsharpNamespace, \"BarValue\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/foo\", bufconfig.FileOptionCsharpNamespace, \"FooValue\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"foo_empty\", \"buf.build/acme/foo\", bufconfig.FileOptionCsharpNamespacePrefix, \"FooPrefix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifyCsharpNamespace,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"bar_empty/with_package.proto\": {\n\t\t\t\t\tCsharpNamespace: proto.String(\"BarPrefix.Bar.Empty\"),\n\t\t\t\t},\n\t\t\t\t\"bar_empty/without_package.proto\": {\n\t\t\t\t\tCsharpNamespace: proto.String(\"BarValue\"),\n\t\t\t\t},\n\t\t\t\t\"foo_empty/with_package.proto\": {\n\t\t\t\t\tCsharpNamespace: proto.String(\"FooValue\"),\n\t\t\t\t},\n\t\t\t\t\"foo_empty/without_package.proto\": nil,\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"bar_empty/with_package.proto\":    {csharpNamespacePath},\n\t\t\t\t\"bar_empty/without_package.proto\": {csharpNamespacePath},\n\t\t\t\t\"foo_empty/with_package.proto\":    {csharpNamespacePath},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"go_package\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{\n\t\t\t\t\tnewTestManagedDisableRule(t, \"foo_empty/with_package.proto\", \"\", \"\", bufconfig.FileOptionGoPackagePrefix, bufconfig.FieldOptionUnspecified),\n\t\t\t\t},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"bar_empty\", \"buf.build/acme/bar\", bufconfig.FileOptionGoPackagePrefix, \"barprefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"bar_empty/without_package.proto\", \"buf.build/acme/bar\", bufconfig.FileOptionGoPackage, \"barvalue\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"foo_empty/with_package.proto\", \"buf.build/acme/foo\", bufconfig.FileOptionGoPackage, \"foovalue\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"foo_empty\", \"buf.build/acme/foo\", bufconfig.FileOptionGoPackagePrefix, \"fooprefix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifyGoPackage,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"bar_empty/with_package.proto\": {\n\t\t\t\t\tGoPackage: proto.String(\"barprefix/bar_empty\"),\n\t\t\t\t},\n\t\t\t\t\"bar_empty/without_package.proto\": {\n\t\t\t\t\tGoPackage: proto.String(\"barvalue\"),\n\t\t\t\t},\n\t\t\t\t\"foo_empty/with_package.proto\": {\n\t\t\t\t\tGoPackage: proto.String(\"foovalue\"),\n\t\t\t\t},\n\t\t\t\t\"foo_empty/without_package.proto\": {\n\t\t\t\t\tGoPackage: proto.String(\"fooprefix/foo_empty\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"bar_empty/with_package.proto\":    {goPackagePath},\n\t\t\t\t\"bar_empty/without_package.proto\": {goPackagePath},\n\t\t\t\t\"foo_empty/with_package.proto\":    {goPackagePath},\n\t\t\t\t\"foo_empty/without_package.proto\": {goPackagePath},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"java_package_prefix\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{\n\t\t\t\t\tnewTestManagedDisableRule(t, \"bar_empty\", \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, bufconfig.FieldOptionUnspecified),\n\t\t\t\t},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/bar\", bufconfig.FileOptionJavaPackagePrefix, \"barprefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/foo\", bufconfig.FileOptionJavaPackageSuffix, \"foosuffix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifyJavaPackage,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"foo_empty/with_package.proto\": {\n\t\t\t\t\t// default prefix and override suffix\n\t\t\t\t\tJavaPackage: proto.String(\"com.foo.empty.foosuffix\"),\n\t\t\t\t},\n\t\t\t\t// prefix is disabled\n\t\t\t\t\"bar_empty/with_package.proto\": nil,\n\t\t\t\t// prefix is overridden\n\t\t\t\t\"bar_all/with_package.proto\": {\n\t\t\t\t\tJavaPackage: proto.String(\"barprefix.bar.all\"),\n\t\t\t\t\t// below this point are the values from the file\n\t\t\t\t\tCcEnableArenas:       proto.Bool(false),\n\t\t\t\t\tCcGenericServices:    proto.Bool(false),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"bar\"),\n\t\t\t\t\tGoPackage:            proto.String(\"bar\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(false),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(false),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"bar\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(false),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"bar\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_SPEED.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"bar\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"bar\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"bar\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(false),\n\t\t\t\t\tRubyPackage:          proto.String(\"bar\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"bar\"),\n\t\t\t\t},\n\t\t\t\t// not modified because it doesn't have a package\n\t\t\t\t\"foo_empty/without_package.proto\": nil,\n\t\t\t\t\"bar_empty/without_package.proto\": nil,\n\t\t\t\t\"foo_all/without_package.proto\": {\n\t\t\t\t\t// values are from the file\n\t\t\t\t\tCcEnableArenas:       proto.Bool(true),\n\t\t\t\t\tCcGenericServices:    proto.Bool(true),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"foo\"),\n\t\t\t\t\tGoPackage:            proto.String(\"foo\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(true),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(true),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"foo\"),\n\t\t\t\t\tJavaPackage:          proto.String(\"foo\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(true),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"foo\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_CODE_SIZE.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"foo\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"foo\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"foo\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(true),\n\t\t\t\t\tRubyPackage:          proto.String(\"foo\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"foo\"),\n\t\t\t\t},\n\t\t\t\t\"bar_all/without_package.proto\": {\n\t\t\t\t\t// values are from the file\n\t\t\t\t\tCcEnableArenas:       proto.Bool(false),\n\t\t\t\t\tCcGenericServices:    proto.Bool(false),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"bar\"),\n\t\t\t\t\tGoPackage:            proto.String(\"bar\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(false),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(false),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"bar\"),\n\t\t\t\t\tJavaPackage:          proto.String(\"bar\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(false),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"bar\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_SPEED.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"bar\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"bar\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"bar\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(false),\n\t\t\t\t\tRubyPackage:          proto.String(\"bar\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"bar\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"foo_empty/with_package.proto\": {javaPackagePath},\n\t\t\t\t\"bar_all/with_package.proto\":   {javaPackagePath},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"java_package_suffix\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{\n\t\t\t\t\tnewTestManagedDisableRule(t, \"bar_empty\", \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, bufconfig.FieldOptionUnspecified),\n\t\t\t\t},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, \"suffix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifyJavaPackage,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"foo_empty/with_package.proto\": {\n\t\t\t\t\t// only suffix matches, but apply both prefix and suffix\n\t\t\t\t\tJavaPackage: proto.String(\"com.foo.empty.suffix\"),\n\t\t\t\t},\n\t\t\t\t\"bar_empty/with_package.proto\": {\n\t\t\t\t\t// only prefix because suffix is disabled\n\t\t\t\t\tJavaPackage: proto.String(\"com.bar.empty\"),\n\t\t\t\t},\n\t\t\t\t\"bar_all/with_package.proto\": {\n\t\t\t\t\tJavaPackage: proto.String(\"com.bar.all.suffix\"),\n\t\t\t\t\t// below this point are the values from the file\n\t\t\t\t\tCcEnableArenas:       proto.Bool(false),\n\t\t\t\t\tCcGenericServices:    proto.Bool(false),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"bar\"),\n\t\t\t\t\tGoPackage:            proto.String(\"bar\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(false),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(false),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"bar\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(false),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"bar\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_SPEED.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"bar\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"bar\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"bar\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(false),\n\t\t\t\t\tRubyPackage:          proto.String(\"bar\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"bar\"),\n\t\t\t\t},\n\t\t\t\t// not modified\n\t\t\t\t\"foo_empty/without_package.proto\": nil,\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"foo_empty/with_package.proto\": {javaPackagePath},\n\t\t\t\t\"bar_empty/with_package.proto\": {javaPackagePath},\n\t\t\t\t\"bar_all/with_package.proto\":   {javaPackagePath},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"java_package\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{\n\t\t\t\t\tnewTestManagedDisableRule(t, \"bar_empty\", \"\", \"\", bufconfig.FileOptionJavaPackage, bufconfig.FieldOptionUnspecified),\n\t\t\t\t},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/bar\", bufconfig.FileOptionJavaPackage, \"bar.value\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/foo\", bufconfig.FileOptionJavaPackage, \"foo.value\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifyJavaPackage,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t// bar_empty disabled\n\t\t\t\t\"bar_empty/with_package.proto\":    nil,\n\t\t\t\t\"bar_empty/without_package.proto\": nil,\n\t\t\t\t\"bar_all/with_package.proto\": {\n\t\t\t\t\tJavaPackage:          proto.String(\"bar.value\"),\n\t\t\t\t\tCcEnableArenas:       proto.Bool(false),\n\t\t\t\t\tCcGenericServices:    proto.Bool(false),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"bar\"),\n\t\t\t\t\tGoPackage:            proto.String(\"bar\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(false),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(false),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"bar\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(false),\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"bar\"),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_SPEED.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"bar\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"bar\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"bar\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(false),\n\t\t\t\t\tRubyPackage:          proto.String(\"bar\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"bar\"),\n\t\t\t\t},\n\t\t\t\t\"foo_empty/with_package.proto\": {\n\t\t\t\t\tJavaPackage: proto.String(\"foo.value\"),\n\t\t\t\t},\n\t\t\t\t\"foo_empty/without_package.proto\": {\n\t\t\t\t\tJavaPackage: proto.String(\"foo.value\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"foo_empty/with_package.proto\":    {javaPackagePath},\n\t\t\t\t\"foo_empty/without_package.proto\": {javaPackagePath},\n\t\t\t\t\"bar_all/with_package.proto\":      {javaPackagePath},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"objc_class_prefix\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{\n\t\t\t\t\tnewTestManagedDisableRule(t, \"foo_empty/with_package.proto\", \"\", \"\", bufconfig.FileOptionObjcClassPrefix, bufconfig.FieldOptionUnspecified),\n\t\t\t\t},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/bar\", bufconfig.FileOptionObjcClassPrefix, \"BAR\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/foo\", bufconfig.FileOptionObjcClassPrefix, \"FOO\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"foo_all\", \"buf.build/acme/foo\", bufconfig.FileOptionObjcClassPrefix, \"FOOALL\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifyObjcClassPrefix,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"bar_empty/with_package.proto\": {\n\t\t\t\t\tObjcClassPrefix: proto.String(\"BAR\"),\n\t\t\t\t},\n\t\t\t\t\"bar_empty/without_package.proto\": {\n\t\t\t\t\tObjcClassPrefix: proto.String(\"BAR\"),\n\t\t\t\t},\n\t\t\t\t// disabled\n\t\t\t\t\"foo_empty/with_package.proto\": nil,\n\t\t\t\t// no package\n\t\t\t\t\"foo_empty/without_package.proto\": {\n\t\t\t\t\tObjcClassPrefix: proto.String(\"FOO\"),\n\t\t\t\t},\n\t\t\t\t\"foo_all/with_package.proto\": {\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"FOOALL\"),\n\t\t\t\t\tCcEnableArenas:       proto.Bool(true),\n\t\t\t\t\tCcGenericServices:    proto.Bool(true),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"foo\"),\n\t\t\t\t\tGoPackage:            proto.String(\"foo\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(true),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(true),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"foo\"),\n\t\t\t\t\tJavaPackage:          proto.String(\"foo\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(true),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_CODE_SIZE.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"foo\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"foo\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"foo\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(true),\n\t\t\t\t\tRubyPackage:          proto.String(\"foo\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"foo\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"bar_empty/with_package.proto\":    {objcClassPrefixPath},\n\t\t\t\t\"bar_empty/without_package.proto\": {objcClassPrefixPath},\n\t\t\t\t\"foo_empty/without_package.proto\": {objcClassPrefixPath},\n\t\t\t\t\"foo_all/without_package.proto\":   {objcClassPrefixPath},\n\t\t\t\t\"foo_all/with_package.proto\":      {objcClassPrefixPath},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"swift_prefix\",\n\t\t\tdirPathToFullName: map[string]string{\n\t\t\t\tfilepath.Join(\"testdata\", \"foo\"): \"buf.build/acme/foo\",\n\t\t\t\tfilepath.Join(\"testdata\", \"bar\"): \"buf.build/acme/bar\",\n\t\t\t},\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{\n\t\t\t\t\tnewTestManagedDisableRule(t, \"foo_empty/with_package.proto\", \"\", \"\", bufconfig.FileOptionSwiftPrefix, bufconfig.FieldOptionUnspecified),\n\t\t\t\t},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/bar\", bufconfig.FileOptionSwiftPrefix, \"BAR\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"buf.build/acme/foo\", bufconfig.FileOptionSwiftPrefix, \"FOO\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"foo_all\", \"buf.build/acme/foo\", bufconfig.FileOptionSwiftPrefix, \"FOOALL\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\tmodifyFunc: modifySwiftPrefix,\n\t\t\tfilePathToExpectedOptions: map[string]*descriptorpb.FileOptions{\n\t\t\t\t\"bar_empty/with_package.proto\": {\n\t\t\t\t\tSwiftPrefix: proto.String(\"BAR\"),\n\t\t\t\t},\n\t\t\t\t\"bar_empty/without_package.proto\": {\n\t\t\t\t\tSwiftPrefix: proto.String(\"BAR\"),\n\t\t\t\t},\n\t\t\t\t// disabled\n\t\t\t\t\"foo_empty/with_package.proto\": nil,\n\t\t\t\t// no package\n\t\t\t\t\"foo_empty/without_package.proto\": {\n\t\t\t\t\tSwiftPrefix: proto.String(\"FOO\"),\n\t\t\t\t},\n\t\t\t\t\"foo_all/with_package.proto\": {\n\t\t\t\t\tObjcClassPrefix:      proto.String(\"foo\"),\n\t\t\t\t\tCcEnableArenas:       proto.Bool(true),\n\t\t\t\t\tCcGenericServices:    proto.Bool(true),\n\t\t\t\t\tCsharpNamespace:      proto.String(\"foo\"),\n\t\t\t\t\tGoPackage:            proto.String(\"foo\"),\n\t\t\t\t\tJavaGenericServices:  proto.Bool(true),\n\t\t\t\t\tJavaMultipleFiles:    proto.Bool(true),\n\t\t\t\t\tJavaOuterClassname:   proto.String(\"foo\"),\n\t\t\t\t\tJavaPackage:          proto.String(\"foo\"),\n\t\t\t\t\tJavaStringCheckUtf8:  proto.Bool(true),\n\t\t\t\t\tOptimizeFor:          descriptorpb.FileOptions_CODE_SIZE.Enum(),\n\t\t\t\t\tPhpClassPrefix:       proto.String(\"foo\"),\n\t\t\t\t\tPhpMetadataNamespace: proto.String(\"foo\"),\n\t\t\t\t\tPhpNamespace:         proto.String(\"foo\"),\n\t\t\t\t\tPyGenericServices:    proto.Bool(true),\n\t\t\t\t\tRubyPackage:          proto.String(\"foo\"),\n\t\t\t\t\tSwiftPrefix:          proto.String(\"FOOALL\"),\n\t\t\t\t},\n\t\t\t},\n\t\t\tfilePathToExpectedMarkedLocationPaths: map[string][][]int32{\n\t\t\t\t\"bar_empty/with_package.proto\":    {swiftPrefixPath},\n\t\t\t\t\"bar_empty/without_package.proto\": {swiftPrefixPath},\n\t\t\t\t\"foo_empty/without_package.proto\": {swiftPrefixPath},\n\t\t\t\t\"foo_all/without_package.proto\":   {swiftPrefixPath},\n\t\t\t\t\"foo_all/with_package.proto\":      {swiftPrefixPath},\n\t\t\t},\n\t\t},\n\t}\n\tfor _, testcase := range testcases {\n\t\tfor _, includeSourceInfo := range []bool{true, false} {\n\t\t\t// TODO FUTURE: we are only testing sweep here, no need to test both include and exclude source info\n\t\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\timage := testGetImageFromDirs(t, testcase.dirPathToFullName, includeSourceInfo)\n\t\t\t\tsweeper := internal.NewMarkSweeper(image)\n\t\t\t\t// TODO FUTURE: check include source code info\n\t\t\t\tfor filePath, expectedOptions := range testcase.filePathToExpectedOptions {\n\t\t\t\t\timageFile := image.GetFile(filePath)\n\t\t\t\t\trequire.NoError(\n\t\t\t\t\t\tt,\n\t\t\t\t\t\ttestcase.modifyFunc(\n\t\t\t\t\t\t\tsweeper,\n\t\t\t\t\t\t\timageFile,\n\t\t\t\t\t\t\ttestcase.config,\n\t\t\t\t\t\t),\n\t\t\t\t\t)\n\t\t\t\t\trequire.NotNil(t, imageFile)\n\t\t\t\t\trequire.Empty(\n\t\t\t\t\t\tt,\n\t\t\t\t\t\tcmp.Diff(expectedOptions, imageFile.FileDescriptorProto().GetOptions(), protocmp.Transform()),\n\t\t\t\t\t\t\"incorrect options result for %s\",\n\t\t\t\t\t\tfilePath,\n\t\t\t\t\t)\n\t\t\t\t\t// TODO FUTURE: sweep and check paths gone\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}\n}\n\n// TODO FUTURE: add default values\nfunc TestGetStringOverrideFromConfig(t *testing.T) {\n\tt.Parallel()\n\ttestcases := []struct {\n\t\tdescription            string\n\t\tconfig                 bufconfig.GenerateManagedConfig\n\t\timageFile              bufimage.ImageFile\n\t\tdefaultOverrideOptions stringOverrideOptions\n\t\texpectedOverride       stringOverrideOptions\n\t\texpectedDisable        bool\n\t}{\n\t\t{\n\t\t\tdescription: \"only_value\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackage, \"value\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{value: \"value\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"only_prefix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{prefix: \"prefix\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"only_suffix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, \"suffix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{suffix: \"suffix\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"prefix_then_value\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackage, \"value\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{value: \"value\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"value_then_prefix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackage, \"value\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{prefix: \"prefix\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"prefix_then_suffix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, \"suffix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile: testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{\n\t\t\t\tprefix: \"prefix\",\n\t\t\t\tsuffix: \"suffix\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"value_prefix_then_suffix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackage, \"value\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, \"suffix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile: testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{\n\t\t\t\tprefix: \"prefix\",\n\t\t\t\tsuffix: \"suffix\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdescription: \"prefix_value_then_suffix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackage, \"value\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, \"suffix\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{suffix: \"suffix\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"prefix_then_prefix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackagePrefix, \"prefix2\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{prefix: \"prefix2\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"suffix_then_suffix\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, \"suffix\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackageSuffix, \"suffix2\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{suffix: \"suffix2\"},\n\t\t},\n\t\t{\n\t\t\tdescription: \"value_then_value\",\n\t\t\tconfig: bufconfig.NewGenerateManagedConfig(\n\t\t\t\ttrue,\n\t\t\t\t[]bufconfig.ManagedDisableRule{},\n\t\t\t\t[]bufconfig.ManagedOverrideRule{\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackage, \"value\"),\n\t\t\t\t\tnewTestFileOptionOverrideRule(t, \"\", \"\", bufconfig.FileOptionJavaPackage, \"value2\"),\n\t\t\t\t},\n\t\t\t),\n\t\t\timageFile:        testGetImageFile(t, \"a.proto\", \"buf.build/foo/bar\"),\n\t\t\texpectedOverride: stringOverrideOptions{value: \"value2\"},\n\t\t},\n\t}\n\tfor _, testcase := range testcases {\n\t\tt.Run(testcase.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\toverride, err := stringOverrideFromConfig(\n\t\t\t\ttestcase.imageFile,\n\t\t\t\ttestcase.config,\n\t\t\t\ttestcase.defaultOverrideOptions,\n\t\t\t\tbufconfig.FileOptionJavaPackage,\n\t\t\t\tbufconfig.FileOptionJavaPackagePrefix,\n\t\t\t\tbufconfig.FileOptionJavaPackageSuffix,\n\t\t\t)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.Equal(t, testcase.expectedOverride, override)\n\t\t})\n\t}\n}\n\n// TODO FUTURE in v2\n//func TestModifyFieldOption(t *testing.T) {\n//t.Parallel()\n//}\n\nfunc testGetImageFile(\n\tt *testing.T,\n\tpath string,\n\tmoduleFullName string,\n) bufimage.ImageFile {\n\tparsedFullName, err := bufparse.ParseFullName(moduleFullName)\n\trequire.NoError(t, err)\n\treturn bufimagetesting.NewImageFile(\n\t\tt,\n\t\t&descriptorpb.FileDescriptorProto{\n\t\t\tName:   proto.String(path),\n\t\t\tSyntax: proto.String(\"proto3\"),\n\t\t},\n\t\tparsedFullName,\n\t\tuuid.Nil,\n\t\tpath,\n\t\t\"\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n}\n\nfunc testGetImageFromDirs(\n\tt *testing.T,\n\tdirPathToFullName map[string]string,\n\tincludeSourceInfo bool,\n) bufimage.Image {\n\tmoduleDatas := make([]bufmoduletesting.ModuleData, 0, len(dirPathToFullName))\n\tfor dirPath, moduleFullName := range dirPathToFullName {\n\t\tmoduleDatas = append(\n\t\t\tmoduleDatas,\n\t\t\tbufmoduletesting.ModuleData{\n\t\t\t\tName:    moduleFullName,\n\t\t\t\tDirPath: dirPath,\n\t\t\t},\n\t\t)\n\t}\n\tmoduleSet, err := bufmoduletesting.NewModuleSet(moduleDatas...)\n\trequire.NoError(t, err)\n\tvar options []bufimage.BuildImageOption\n\tif !includeSourceInfo {\n\t\toptions = []bufimage.BuildImageOption{bufimage.WithExcludeSourceCodeInfo()}\n\t}\n\timage, err := bufimage.BuildImage(\n\t\tt.Context(),\n\t\tslogtestext.NewLogger(t),\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\toptions...,\n\t)\n\trequire.NoError(t, err)\n\treturn image\n}\n\nfunc newTestManagedDisableRule(\n\tt *testing.T,\n\tpath string,\n\tmoduleFullName string,\n\tfieldName string,\n\tfileOption bufconfig.FileOption,\n\tfieldOption bufconfig.FieldOption,\n) bufconfig.ManagedDisableRule {\n\tdisable, err := bufconfig.NewManagedDisableRule(\n\t\tpath,\n\t\tmoduleFullName,\n\t\tfieldName,\n\t\tfileOption,\n\t\tfieldOption,\n\t)\n\trequire.NoError(t, err)\n\treturn disable\n}\n\nfunc newTestFileOptionOverrideRule(\n\tt *testing.T,\n\tpath string,\n\tmoduleFullName string,\n\tfileOption bufconfig.FileOption,\n\tvalue any,\n) bufconfig.ManagedOverrideRule {\n\tfileOptionOverride, err := bufconfig.NewManagedOverrideRuleForFileOption(\n\t\tpath,\n\t\tmoduleFullName,\n\t\tfileOption,\n\t\tvalue,\n\t)\n\trequire.NoError(t, err)\n\treturn fileOptionOverride\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/field_option.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagemodify\n\nimport (\n\t\"fmt\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/internal\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/bufbuild/protocompile/walk\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// jsTypeSubPath is the SourceCodeInfo sub path for the jstype field option.\n// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L215\n// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L567\nvar jsTypeSubPath = []int32{8, 6}\n\nfunc modifyJsType(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\toverrideRules := xslices.Filter(\n\t\tconfig.Overrides(),\n\t\tfunc(override bufconfig.ManagedOverrideRule) bool {\n\t\t\treturn override.FieldOption() == bufconfig.FieldOptionJSType &&\n\t\t\t\tfileMatchConfig(imageFile, override.Path(), override.FullName())\n\t\t},\n\t)\n\t// Unless specified, js type is not modified.\n\tif len(overrideRules) == 0 {\n\t\treturn nil\n\t}\n\tdisableRules := xslices.Filter(\n\t\tconfig.Disables(),\n\t\tfunc(disable bufconfig.ManagedDisableRule) bool {\n\t\t\treturn (disable.FieldOption() == bufconfig.FieldOptionJSType ||\n\t\t\t\t(disable.FieldOption() == bufconfig.FieldOptionUnspecified &&\n\t\t\t\t\tdisable.FileOption() == bufconfig.FileOptionUnspecified)) &&\n\t\t\t\tfileMatchConfig(imageFile, disable.Path(), disable.FullName())\n\t\t},\n\t)\n\t// If the entire file is disabled, skip.\n\tfor _, disableRule := range disableRules {\n\t\tif disableRule.FieldName() == \"\" {\n\t\t\treturn nil\n\t\t}\n\t}\n\tif datawkt.Exists(imageFile.Path()) {\n\t\treturn nil\n\t}\n\treturn walk.DescriptorProtosWithPath(\n\t\timageFile.FileDescriptorProto(),\n\t\tfunc(\n\t\t\tfullName protoreflect.FullName,\n\t\t\tpath protoreflect.SourcePath,\n\t\t\tmessage proto.Message,\n\t\t) error {\n\t\t\tfieldDescriptor, ok := message.(*descriptorpb.FieldDescriptorProto)\n\t\t\tif !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\t// If the field is disabled, skip.\n\t\t\tfor _, disableRule := range disableRules {\n\t\t\t\tif disableRule.FieldName() == string(fullName) {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar jsType *descriptorpb.FieldOptions_JSType\n\t\t\tfor _, override := range overrideRules {\n\t\t\t\tif override.FieldName() == \"\" || override.FieldName() == string(fullName) {\n\t\t\t\t\tjsTypeValue, ok := override.Value().(descriptorpb.FieldOptions_JSType)\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\treturn fmt.Errorf(\"invalid js_type override value of type %T\", override.Value())\n\t\t\t\t\t}\n\t\t\t\t\tjsType = &jsTypeValue\n\t\t\t\t}\n\t\t\t}\n\t\t\tif jsType == nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif modifyOptions.preserveExisting && fieldDescriptor.Options != nil && fieldDescriptor.Options.Jstype != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif fieldDescriptor.Type == nil || !isJsTypePermittedForType(*fieldDescriptor.Type) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif options := fieldDescriptor.Options; options != nil {\n\t\t\t\tif existingJSTYpe := options.Jstype; existingJSTYpe != nil && *existingJSTYpe == *jsType {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t\tif fieldDescriptor.Options == nil {\n\t\t\t\tfieldDescriptor.Options = &descriptorpb.FieldOptions{}\n\t\t\t}\n\t\t\tfieldDescriptor.Options.Jstype = jsType\n\t\t\tif len(path) > 0 {\n\t\t\t\tjsTypeOptionPath := append(path, jsTypeSubPath...)\n\t\t\t\tsweeper.Mark(imageFile, jsTypeOptionPath)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// *** PRIVATE ***\n\nfunc isJsTypePermittedForType(fieldType descriptorpb.FieldDescriptorProto_Type) bool {\n\t// https://github.com/protocolbuffers/protobuf/blob/d4db41d395dcbb2c79b7fb1f109086fa04afd8aa/src/google/protobuf/descriptor.proto#L622\n\treturn fieldType == descriptorpb.FieldDescriptorProto_TYPE_INT64 ||\n\t\tfieldType == descriptorpb.FieldDescriptorProto_TYPE_UINT64 ||\n\t\tfieldType == descriptorpb.FieldDescriptorProto_TYPE_SINT64 ||\n\t\tfieldType == descriptorpb.FieldDescriptorProto_TYPE_FIXED64 ||\n\t\tfieldType == descriptorpb.FieldDescriptorProto_TYPE_SFIXED64\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/file_option.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagemodify\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/internal\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nvar (\n\t// ccEnableArenas is the SourceCodeInfo path for the cc_enable_arenas option.\n\t// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L420\n\tccEnableArenasPath = []int32{8, 31}\n\t// csharpNamespacePath is the SourceCodeInfo path for the csharp_namespace option.\n\t// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L428\n\tcsharpNamespacePath = []int32{8, 37}\n\t// goPackagePath is the SourceCodeInfo path for the go_package option.\n\t// https://github.com/protocolbuffers/protobuf/blob/ee04809540c098718121e092107fbc0abc231725/src/google/protobuf/descriptor.proto#L392\n\tgoPackagePath = []int32{8, 11}\n\t// javaMultipleFilesPath is the SourceCodeInfo path for the java_multiple_files option.\n\t// https://github.com/protocolbuffers/protobuf/blob/ee04809540c098718121e092107fbc0abc231725/src/google/protobuf/descriptor.proto#L364\n\tjavaMultipleFilesPath = []int32{8, 10}\n\t// javaOuterClassnamePath is the SourceCodeInfo path for the java_outer_classname option.\n\t// https://github.com/protocolbuffers/protobuf/blob/87d140f851131fb8a6e8a80449cf08e73e568259/src/google/protobuf/descriptor.proto#L356\n\tjavaOuterClassnamePath = []int32{8, 8}\n\t// javaPackagePath is the SourceCodeInfo path for the java_package option.\n\t// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L348\n\tjavaPackagePath = []int32{8, 1}\n\t// javaStringCheckUtf8Path is the SourceCodeInfo path for the java_string_check_utf8 option.\n\t// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L375\n\tjavaStringCheckUtf8Path = []int32{8, 27}\n\t// objcClassPrefixPath is the SourceCodeInfo path for the objc_class_prefix option.\n\t// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L425\n\tobjcClassPrefixPath = []int32{8, 36}\n\t// optimizeFor is the SourceCodeInfo path for the optimize_for option.\n\t// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L385\n\toptimizeForPath = []int32{8, 9}\n\t// phpMetadataNamespacePath is the SourceCodeInfo path for the php_metadata_namespace option.\n\t// Ref: https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L448\n\tphpMetadataNamespacePath = []int32{8, 44}\n\t// phpNamespacePath is the SourceCodeInfo path for the php_namespace option.\n\t// Ref: https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L443\n\tphpNamespacePath = []int32{8, 41}\n\t// rubyPackagePath is the SourceCodeInfo path for the ruby_package option.\n\t// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L453\n\trubyPackagePath = []int32{8, 45}\n\t// swiftPrefixPath is the SourceCodeInfo path for the swift_prefix option.\n\t// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L434\n\tswiftPrefixPath = []int32{8, 39}\n)\n\nfunc modifyJavaOuterClass(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionJavaOuterClassname,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{value: javaOuterClassnameValue(imageFile)}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, _ stringOverrideOptions) string {\n\t\t\treturn javaOuterClassnameValue(imageFile)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetJavaOuterClassname()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.JavaOuterClassname = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.JavaOuterClassname != nil\n\t\t},\n\t\tjavaOuterClassnamePath,\n\t)\n}\n\nfunc modifyJavaPackage(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionJavaPackage,\n\t\tbufconfig.FileOptionJavaPackagePrefix,\n\t\tbufconfig.FileOptionJavaPackageSuffix,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{prefix: \"com\"}\n\t\t},\n\t\tgetJavaPackageValue,\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetJavaPackage()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.JavaPackage = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.JavaPackage != nil\n\t\t},\n\t\tjavaPackagePath,\n\t)\n}\n\nfunc modifyGoPackage(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionGoPackage,\n\t\tbufconfig.FileOptionGoPackagePrefix,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, stringOverrideOptions stringOverrideOptions) string {\n\t\t\tif stringOverrideOptions.prefix == \"\" {\n\t\t\t\treturn \"\"\n\t\t\t}\n\t\t\treturn goPackageImportPathForFile(imageFile, stringOverrideOptions.prefix)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetGoPackage()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.GoPackage = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.GoPackage != nil\n\t\t},\n\t\tgoPackagePath,\n\t)\n}\n\nfunc modifyObjcClassPrefix(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionObjcClassPrefix,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{value: objcClassPrefixValue(imageFile)}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, _ stringOverrideOptions) string {\n\t\t\treturn objcClassPrefixValue(imageFile)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetObjcClassPrefix()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.ObjcClassPrefix = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.ObjcClassPrefix != nil\n\t\t},\n\t\tobjcClassPrefixPath,\n\t)\n}\n\nfunc modifyCsharpNamespace(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionCsharpNamespace,\n\t\tbufconfig.FileOptionCsharpNamespacePrefix,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{value: csharpNamespaceValue(imageFile)}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, stringOverrideOptions stringOverrideOptions) string {\n\t\t\treturn getCsharpNamespaceValue(imageFile, stringOverrideOptions.prefix)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetCsharpNamespace()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.CsharpNamespace = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.CsharpNamespace != nil\n\t\t},\n\t\tcsharpNamespacePath,\n\t)\n}\n\nfunc modifyPhpNamespace(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionPhpNamespace,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{value: phpNamespaceValue(imageFile)}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, _ stringOverrideOptions) string {\n\t\t\treturn phpNamespaceValue(imageFile)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetPhpNamespace()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.PhpNamespace = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.PhpNamespace != nil\n\t\t},\n\t\tphpNamespacePath,\n\t)\n}\n\nfunc modifyPhpMetadataNamespace(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionPhpMetadataNamespace,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tbufconfig.FileOptionPhpMetadataNamespaceSuffix,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{value: phpMetadataNamespaceValue(imageFile)}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, stringOverrideOptions stringOverrideOptions) string {\n\t\t\treturn getPhpMetadataNamespaceValue(imageFile, stringOverrideOptions.suffix)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetPhpMetadataNamespace()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.PhpMetadataNamespace = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.PhpMetadataNamespace != nil\n\t\t},\n\t\tphpMetadataNamespacePath,\n\t)\n}\n\nfunc modifyRubyPackage(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionRubyPackage,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tbufconfig.FileOptionRubyPackageSuffix,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{value: rubyPackageValue(imageFile)}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, stringOverrideOptions stringOverrideOptions) string {\n\t\t\treturn getRubyPackageValue(imageFile, stringOverrideOptions.suffix)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetRubyPackage()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.RubyPackage = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.RubyPackage != nil\n\t\t},\n\t\trubyPackagePath,\n\t)\n}\n\nfunc modifySwiftPrefix(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyStringOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionSwiftPrefix,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tbufconfig.FileOptionUnspecified,\n\t\tfunc(bufimage.ImageFile) stringOverrideOptions {\n\t\t\treturn stringOverrideOptions{}\n\t\t},\n\t\tfunc(imageFile bufimage.ImageFile, stringOverrideOptions stringOverrideOptions) string {\n\t\t\treturn stringOverrideOptions.value\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) string {\n\t\t\treturn options.GetSwiftPrefix()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value string) {\n\t\t\toptions.SwiftPrefix = proto.String(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.SwiftPrefix != nil\n\t\t},\n\t\tswiftPrefixPath,\n\t)\n}\n\nfunc modifyCcEnableArenas(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyFileOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionCcEnableArenas,\n\t\ttrue,\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options.GetCcEnableArenas()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value bool) {\n\t\t\toptions.CcEnableArenas = proto.Bool(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.CcEnableArenas != nil\n\t\t},\n\t\tccEnableArenasPath,\n\t)\n}\n\nfunc modifyJavaMultipleFiles(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyFileOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionJavaMultipleFiles,\n\t\ttrue,\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options.GetJavaMultipleFiles()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value bool) {\n\t\t\toptions.JavaMultipleFiles = proto.Bool(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.JavaMultipleFiles != nil\n\t\t},\n\t\tjavaMultipleFilesPath,\n\t)\n}\n\nfunc modifyJavaStringCheckUtf8(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyFileOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionJavaStringCheckUtf8,\n\t\tfalse,\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options.GetJavaStringCheckUtf8()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value bool) {\n\t\t\toptions.JavaStringCheckUtf8 = proto.Bool(value)\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.JavaStringCheckUtf8 != nil\n\t\t},\n\t\tjavaStringCheckUtf8Path,\n\t)\n}\n\nfunc modifyOptimizeFor(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\toptions ...ModifyOption,\n) error {\n\tmodifyOptions := newModifyOptions()\n\tfor _, option := range options {\n\t\toption(modifyOptions)\n\t}\n\treturn modifyFileOption(\n\t\tsweeper,\n\t\timageFile,\n\t\tconfig,\n\t\tmodifyOptions.preserveExisting,\n\t\tbufconfig.FileOptionOptimizeFor,\n\t\tdescriptorpb.FileOptions_SPEED,\n\t\tfunc(options *descriptorpb.FileOptions) descriptorpb.FileOptions_OptimizeMode {\n\t\t\treturn options.GetOptimizeFor()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions, value descriptorpb.FileOptions_OptimizeMode) {\n\t\t\toptions.OptimizeFor = value.Enum()\n\t\t},\n\t\tfunc(options *descriptorpb.FileOptions) bool {\n\t\t\treturn options != nil && options.OptimizeFor != nil\n\t\t},\n\t\toptimizeForPath,\n\t)\n}\n\n// *** PRIVATE ***\n\nfunc modifyFileOption[T bool | descriptorpb.FileOptions_OptimizeMode](\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\tpreserveExisting bool,\n\tfileOption bufconfig.FileOption,\n\t// You can set this value to the same as protobuf default, in order to not modify a value by default.\n\tdefaultValue T,\n\tgetOptionFunc func(*descriptorpb.FileOptions) T,\n\tsetOptionFunc func(*descriptorpb.FileOptions, T),\n\tcheckOptionSetFunc func(*descriptorpb.FileOptions) bool,\n\tsourceLocationPath []int32,\n) error {\n\tdescriptor := imageFile.FileDescriptorProto()\n\tif preserveExisting && checkOptionSetFunc(descriptor.Options) {\n\t\treturn nil\n\t}\n\tvalue := defaultValue\n\tif isFileOptionDisabledForFile(\n\t\timageFile,\n\t\tfileOption,\n\t\tconfig,\n\t) {\n\t\treturn nil\n\t}\n\toverride, err := overrideFromConfig[T](\n\t\timageFile,\n\t\tconfig,\n\t\tfileOption,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif override != nil {\n\t\tvalue = *override\n\t}\n\tif getOptionFunc(descriptor.Options) == value {\n\t\t// The option is already set to the same value, don't modify or mark it.\n\t\treturn nil\n\t}\n\tif descriptor.Options == nil {\n\t\tdescriptor.Options = &descriptorpb.FileOptions{}\n\t}\n\tsetOptionFunc(descriptor.Options, value)\n\tsweeper.Mark(imageFile, sourceLocationPath)\n\treturn nil\n}\n\nfunc modifyStringOption(\n\tsweeper internal.MarkSweeper,\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\tpreserveExisting bool,\n\tvalueOption bufconfig.FileOption,\n\tprefixOption bufconfig.FileOption,\n\tsuffixOption bufconfig.FileOption,\n\tdefaultOptionsFunc func(bufimage.ImageFile) stringOverrideOptions,\n\tvalueFunc func(bufimage.ImageFile, stringOverrideOptions) string,\n\tgetOptionFunc func(*descriptorpb.FileOptions) string,\n\tsetOptionFunc func(*descriptorpb.FileOptions, string),\n\tcheckOptionSetFunc func(*descriptorpb.FileOptions) bool,\n\tsourceLocationPath []int32,\n) error {\n\tdescriptor := imageFile.FileDescriptorProto()\n\tif preserveExisting && checkOptionSetFunc(descriptor.Options) {\n\t\treturn nil\n\t}\n\toverrideOptions, err := stringOverrideFromConfig(\n\t\timageFile,\n\t\tconfig,\n\t\tdefaultOptionsFunc(imageFile),\n\t\tvalueOption,\n\t\tprefixOption,\n\t\tsuffixOption,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar emptyOverrideOptions stringOverrideOptions\n\t// This means the options are all disabled.\n\tif overrideOptions == emptyOverrideOptions {\n\t\treturn nil\n\t}\n\t// Now either value is set or prefix and/or suffix is set.\n\tvalue := overrideOptions.value\n\tif value == \"\" {\n\t\t// TODO FUTURE: pass in prefix and suffix, instead of just override options\n\t\tvalue = valueFunc(imageFile, overrideOptions)\n\t}\n\tif value == \"\" {\n\t\treturn nil\n\t}\n\tif getOptionFunc(descriptor.Options) == value {\n\t\t// The option is already set to the same value, don't modify or mark it.\n\t\treturn nil\n\t}\n\tif descriptor.Options == nil {\n\t\tdescriptor.Options = &descriptorpb.FileOptions{}\n\t}\n\tsetOptionFunc(descriptor.Options, value)\n\tsweeper.Mark(imageFile, sourceLocationPath)\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/internal/field_options_trie.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"slices\"\n\t\"sort\"\n)\n\n// fieldOptionsTrie stores paths to FieldOptions (tag 8 of a FieldDescriptorProto).\ntype fieldOptionsTrie []*fieldOptionsTrieNode\n\ntype fieldOptionsTrieNode struct {\n\tvalue     int32\n\tisPathEnd bool\n\tchildren  fieldOptionsTrie\n\t// locationIndex is the data attached that we are interested in retrieving.\n\t// This field is irrelevant to traversal or the trie structure.\n\tlocationIndex int\n\t// registeredDescendantCount records how many times a descendant of this node\n\t// is registered. This field is irrelevant to traversal or the trie structure.\n\tregisteredDescendantCount int\n}\n\n// insert inserts a path into the trie. The caller should\n// ensure that the path is for a FieldOptions.\nfunc (p *fieldOptionsTrie) insert(path []int32, locationIndex int) {\n\ttrie := p\n\tfor index, element := range path {\n\t\tisLastElement := index == len(path)-1\n\t\tnodes := *trie\n\t\tpos, found := sort.Find(len(nodes), func(i int) int {\n\t\t\treturn int(element - nodes[i].value)\n\t\t})\n\t\tif found {\n\t\t\tif isLastElement {\n\t\t\t\tnodes[pos].isPathEnd = true\n\t\t\t\tnodes[pos].locationIndex = locationIndex\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttrie = &nodes[pos].children\n\t\t\tcontinue\n\t\t}\n\t\tnewNode := &fieldOptionsTrieNode{\n\t\t\tvalue:    element,\n\t\t\tchildren: fieldOptionsTrie{},\n\t\t}\n\t\tif isLastElement {\n\t\t\tnewNode.isPathEnd = true\n\t\t\tnewNode.locationIndex = locationIndex\n\t\t}\n\t\tnodes = slices.Insert(nodes, pos, newNode)\n\t\t*trie = nodes\n\t\ttrie = &nodes[pos].children\n\t}\n}\n\n// registerDescendant finds if there is an ancestor of the provided\n// path and increments this ancestor's counter if it exists.\nfunc (p *fieldOptionsTrie) registerDescendant(descendant []int32) {\n\ttrie := p\n\tfor i, element := range descendant {\n\t\tnodes := *trie\n\t\tpos, found := sort.Find(len(nodes), func(i int) int {\n\t\t\treturn int(element - nodes[i].value)\n\t\t})\n\t\tif !found {\n\t\t\treturn\n\t\t}\n\t\tancestor := nodes[pos]\n\t\tdescendantContinues := i != len(descendant)-1\n\t\tif ancestor.isPathEnd && descendantContinues {\n\t\t\tancestor.registeredDescendantCount += 1\n\t\t\treturn\n\t\t}\n\t\ttrie = &ancestor.children\n\t}\n}\n\n// indicesWithoutDescendant returns the location indices of\nfunc (p *fieldOptionsTrie) indicesWithoutDescendant() []int {\n\tlocationIndices := []int{}\n\twalkTrie(*p, func(node *fieldOptionsTrieNode) {\n\t\tif node.isPathEnd && node.registeredDescendantCount == 0 {\n\t\t\tlocationIndices = append(locationIndices, node.locationIndex)\n\t\t}\n\t})\n\treturn locationIndices\n}\n\nfunc walkTrie(trie fieldOptionsTrie, enter func(node *fieldOptionsTrieNode)) {\n\tfor _, node := range trie {\n\t\twalkTrieNode(node, enter)\n\t}\n}\n\nfunc walkTrieNode(node *fieldOptionsTrieNode, enter func(node *fieldOptionsTrieNode)) {\n\tenter(node)\n\twalkTrie(node.children, enter)\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/internal/internal.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport \"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\n// fileOptionPath is the path prefix used for FileOptions.\n// All file option locations are preceded by a location\n// with a path set to the fileOptionPath.\n// https://github.com/protocolbuffers/protobuf/blob/053966b4959bdd21e4a24e657bcb97cb9de9e8a4/src/google/protobuf/descriptor.proto#L80\nvar fileOptionPath = []int32{8}\n\n// MarkSweeper is a mark sweeper for an image.\ntype MarkSweeper interface {\n\tMark(imageFile bufimage.ImageFile, path []int32)\n\tSweep() error\n}\n\n// NewMarkSweeper returns a new MarkSweeper.\nfunc NewMarkSweeper(image bufimage.Image) MarkSweeper {\n\treturn newMarkSweeper(image)\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/internal/location_path_dfa.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nconst (\n\tpathTypeNotFieldOption pathType = iota + 1\n\tpathTypeFieldOptionsRoot\n\tpathTypeFieldOption\n\t// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L75\n\tmessageTypeTagInFile int32 = 4\n\t// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L78\n\textensionTagInFile int32 = 7\n\t// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L97\n\tfieldTagInMessage int32 = 2\n\t// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L100\n\tnestedTypeTagInMessage int32 = 3\n\t// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L98\n\textensionTagInMessage int32 = 6\n\t// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L215\n\toptionsTagInField int32 = 8\n)\n\n// pathType is the type of a message pointed to by a location path.\ntype pathType int\n\n// locationPathDFAState takes an input and returns the next state and the path type\n// that ends with the input, which is consistent with the returned next state. The next\n// state is nil if the DFA has finished running.\ntype locationPathDFAState func(int32) (locationPathDFAState, pathType)\n\n// getPathType returns the type of the path. It only accepts one of:\n// empty, messages, message, fields, field, field options and field option.\nfunc getPathType(path []int32) pathType {\n\tpathType := pathTypeNotFieldOption\n\tcurrentState := start\n\tfor _, element := range path {\n\t\tif currentState == nil {\n\t\t\tbreak\n\t\t}\n\t\tcurrentState, pathType = currentState(element)\n\t}\n\treturn pathType\n}\n\nfunc start(input int32) (locationPathDFAState, pathType) {\n\tswitch input {\n\tcase messageTypeTagInFile:\n\t\treturn messages, pathTypeNotFieldOption\n\tcase extensionTagInFile:\n\t\treturn fields, pathTypeNotFieldOption\n\tdefault:\n\t\treturn nil, pathTypeNotFieldOption\n\t}\n}\n\nfunc messages(input int32) (locationPathDFAState, pathType) {\n\t// we are not checking index >= 0, the caller must ensure this\n\treturn message, pathTypeNotFieldOption\n}\n\nfunc message(input int32) (locationPathDFAState, pathType) {\n\tswitch input {\n\tcase nestedTypeTagInMessage:\n\t\treturn messages, pathTypeNotFieldOption\n\tcase fieldTagInMessage, extensionTagInMessage:\n\t\treturn fields, pathTypeNotFieldOption\n\t}\n\treturn nil, pathTypeNotFieldOption\n}\n\nfunc fields(input int32) (locationPathDFAState, pathType) {\n\t// we are not checking index >= 0, the caller must ensure this\n\treturn field, pathTypeNotFieldOption\n}\n\nfunc field(input int32) (locationPathDFAState, pathType) {\n\tswitch input {\n\tcase optionsTagInField:\n\t\treturn fieldOptions, pathTypeFieldOptionsRoot\n\tdefault:\n\t\treturn nil, pathTypeNotFieldOption\n\t}\n}\n\nfunc fieldOptions(input int32) (locationPathDFAState, pathType) {\n\t// We are done here: after this point the path will be for a FieldOption.\n\t// No need for the DFA to keep running.\n\treturn nil, pathTypeFieldOption\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/internal/marksweeper.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype markSweeper struct {\n\timage bufimage.Image\n\t// Filepath -> SourceCodeInfo_Location.Path keys.\n\tsourceCodeInfoPaths map[string]map[string]struct{}\n}\n\nfunc newMarkSweeper(image bufimage.Image) *markSweeper {\n\treturn &markSweeper{\n\t\timage:               image,\n\t\tsourceCodeInfoPaths: make(map[string]map[string]struct{}),\n\t}\n}\n\nfunc (s *markSweeper) Mark(imageFile bufimage.ImageFile, path []int32) {\n\tpaths, ok := s.sourceCodeInfoPaths[imageFile.Path()]\n\tif !ok {\n\t\tpaths = make(map[string]struct{})\n\t\ts.sourceCodeInfoPaths[imageFile.Path()] = paths\n\t}\n\tpaths[getPathKey(path)] = struct{}{}\n}\n\nfunc (s *markSweeper) Sweep() error {\n\tfor _, imageFile := range s.image.Files() {\n\t\tdescriptor := imageFile.FileDescriptorProto()\n\t\tif descriptor.SourceCodeInfo == nil {\n\t\t\tcontinue\n\t\t}\n\t\tpaths, ok := s.sourceCodeInfoPaths[imageFile.Path()]\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\terr := removeLocationsFromSourceCodeInfo(descriptor.SourceCodeInfo, paths)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// removeLocationsFromSourceCodeInfo removes paths from the given sourceCodeInfo.\n// Each path must be for either a file option or a field option.\nfunc removeLocationsFromSourceCodeInfo(\n\tsourceCodeInfo *descriptorpb.SourceCodeInfo,\n\tpathsToRemove map[string]struct{},\n) error {\n\t// TODO FUTURE: in v1 there is no need to check for field options, maybe v1 and v2\n\t// don't need to share this function.\n\n\t// We can't just match on an exact path match because the target\n\t// file option's parent path elements would remain (i.e [8]),\n\t// or the target field option's parent path has no other child left.\n\t// Instead, we perform an initial pass to validate that the paths\n\t// are structured as expected, and collect all of the indices that\n\t// we need to delete.\n\tindices := make(map[int]struct{}, len(pathsToRemove)*2)\n\t// each path in this trie is for a FieldOptions message (not for a singular option)\n\tvar fieldOptionsPaths fieldOptionsTrie\n\tfor i, location := range sourceCodeInfo.Location {\n\t\tpath := location.Path\n\t\tpathType := getPathType(path)\n\t\tif pathType == pathTypeFieldOptionsRoot {\n\t\t\tfieldOptionsPaths.insert(path, i)\n\t\t}\n\t\tif _, ok := pathsToRemove[getPathKey(path)]; !ok {\n\t\t\tif pathType == pathTypeFieldOption {\n\t\t\t\t// This field option path will not be removed, register it to its\n\t\t\t\t// parent FieldOptions.\n\t\t\t\tfieldOptionsPaths.registerDescendant(path)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif i == 0 {\n\t\t\treturn fmt.Errorf(\"path %v must have a preceding parent path\", location.Path)\n\t\t}\n\t\tif isPathForFileOption(location.Path) {\n\t\t\tif !slices.Equal(sourceCodeInfo.Location[i-1].Path, fileOptionPath) {\n\t\t\t\treturn fmt.Errorf(\"file option path %v must have a preceding parent path equal to %v\", location.Path, fileOptionPath)\n\t\t\t}\n\t\t\t// Add the target path and its parent.\n\t\t\tindices[i-1] = struct{}{}\n\t\t\tindices[i] = struct{}{}\n\t\t\tcontinue\n\t\t}\n\t\tif pathType == pathTypeFieldOption {\n\t\t\t// Note that there is a difference between the generated file option paths and field options paths.\n\t\t\t// For example, for:\n\t\t\t// ...\n\t\t\t// option java_package = \"com.example\";\n\t\t\t// option go_package = \"github.com/hello/world\";\n\t\t\t// ...\n\t\t\t// the generated paths are\n\t\t\t// [8], [8,1], [8], [8,11]\n\t\t\t// where each file option declared has a parent.\n\t\t\t// However, for different field options of the same field, they share the same parent. For\n\t\t\t// ...\n\t\t\t// optional string id2 = 2 [jstype = JS_STRING, ctype = CORD];\n\t\t\t// required fixed64 first = 1 [\n\t\t\t//   (foo.bar.baz.aaa).foo = \"hello\",\n\t\t\t//   (foo.bar.baz.bbb).a.foo = \"hey\",\n\t\t\t//   (foo.bar.baz.ccc) = 123, // ccc is a repeated option\n\t\t\t//   jstype = JS_STRING\n\t\t\t// ];\n\t\t\t// ...\n\t\t\t// the generated paths are\n\t\t\t// [4,0,2,0,8],[4,0,2,0,8,50000,1],[4,0,2,0,8,50002,1,1],[4,0,2,0,8,50003,0],[4,0,2,0,8,6]\n\t\t\t// where two field options share the same parent.\n\t\t\t// Therefore, do not remove the parent path yet.\n\t\t\tindices[i] = struct{}{}\n\t\t\tcontinue\n\t\t}\n\t\treturn fmt.Errorf(\"path %v is neither a file option path nor a field option path\", location.Path)\n\t}\n\tfor _, emptyFieldOptions := range fieldOptionsPaths.indicesWithoutDescendant() {\n\t\tindices[emptyFieldOptions] = struct{}{}\n\t}\n\t// Now that we know exactly which indices to exclude, we can\n\t// filter the SourceCodeInfo_Locations as needed.\n\tlocations := make(\n\t\t[]*descriptorpb.SourceCodeInfo_Location,\n\t\t0,\n\t\tlen(sourceCodeInfo.Location)-len(indices),\n\t)\n\tfor i, location := range sourceCodeInfo.Location {\n\t\tif _, ok := indices[i]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tlocations = append(locations, location)\n\t}\n\tsourceCodeInfo.Location = locations\n\treturn nil\n}\n\nfunc isPathForFileOption(path []int32) bool {\n\t// a file option's path is {8, x}\n\tfileOptionPathLen := 2\n\treturn len(path) == fileOptionPathLen && path[0] == fileOptionPath[0]\n}\n\n// getPathKey returns a unique key for the given path.\nfunc getPathKey(path []int32) string {\n\tkey := make([]byte, len(path)*4)\n\tj := 0\n\tfor _, elem := range path {\n\t\tkey[j] = byte(elem)\n\t\tkey[j+1] = byte(elem >> 8)\n\t\tkey[j+2] = byte(elem >> 16)\n\t\tkey[j+3] = byte(elem >> 24)\n\t\tj += 4\n\t}\n\treturn string(key)\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/internal/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage internal\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/override.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagemodify\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protoversion\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// Keywords and classes that could be produced by our heuristic.\n// They must not be used in a php_namespace.\n// Ref: https://www.php.net/manual/en/reserved.php\nvar phpReservedKeywords = map[string]struct{}{\n\t// Reserved classes as per above.\n\t\"directory\":           {},\n\t\"exception\":           {},\n\t\"errorexception\":      {},\n\t\"closure\":             {},\n\t\"generator\":           {},\n\t\"arithmeticerror\":     {},\n\t\"assertionerror\":      {},\n\t\"divisionbyzeroerror\": {},\n\t\"error\":               {},\n\t\"throwable\":           {},\n\t\"parseerror\":          {},\n\t\"typeerror\":           {},\n\t// Keywords avoided by protoc.\n\t// Ref: https://github.com/protocolbuffers/protobuf/blob/66d749188ff2a2e30e932110222d58da7c6a8d49/src/google/protobuf/compiler/php/php_generator.cc#L50-L66\n\t\"abstract\":     {},\n\t\"and\":          {},\n\t\"array\":        {},\n\t\"as\":           {},\n\t\"break\":        {},\n\t\"callable\":     {},\n\t\"case\":         {},\n\t\"catch\":        {},\n\t\"class\":        {},\n\t\"clone\":        {},\n\t\"const\":        {},\n\t\"continue\":     {},\n\t\"declare\":      {},\n\t\"default\":      {},\n\t\"die\":          {},\n\t\"do\":           {},\n\t\"echo\":         {},\n\t\"else\":         {},\n\t\"elseif\":       {},\n\t\"empty\":        {},\n\t\"enddeclare\":   {},\n\t\"endfor\":       {},\n\t\"endforeach\":   {},\n\t\"endif\":        {},\n\t\"endswitch\":    {},\n\t\"endwhile\":     {},\n\t\"eval\":         {},\n\t\"exit\":         {},\n\t\"extends\":      {},\n\t\"final\":        {},\n\t\"finally\":      {},\n\t\"fn\":           {},\n\t\"for\":          {},\n\t\"foreach\":      {},\n\t\"function\":     {},\n\t\"global\":       {},\n\t\"goto\":         {},\n\t\"if\":           {},\n\t\"implements\":   {},\n\t\"include\":      {},\n\t\"include_once\": {},\n\t\"instanceof\":   {},\n\t\"insteadof\":    {},\n\t\"interface\":    {},\n\t\"isset\":        {},\n\t\"list\":         {},\n\t\"match\":        {},\n\t\"namespace\":    {},\n\t\"new\":          {},\n\t\"or\":           {},\n\t\"print\":        {},\n\t\"private\":      {},\n\t\"protected\":    {},\n\t\"public\":       {},\n\t\"require\":      {},\n\t\"require_once\": {},\n\t\"return\":       {},\n\t\"static\":       {},\n\t\"switch\":       {},\n\t\"throw\":        {},\n\t\"trait\":        {},\n\t\"try\":          {},\n\t\"unset\":        {},\n\t\"use\":          {},\n\t\"var\":          {},\n\t\"while\":        {},\n\t\"xor\":          {},\n\t\"yield\":        {},\n\t\"int\":          {},\n\t\"float\":        {},\n\t\"bool\":         {},\n\t\"string\":       {},\n\t\"true\":         {},\n\t\"false\":        {},\n\t\"null\":         {},\n\t\"void\":         {},\n\t\"iterable\":     {},\n}\n\ntype stringOverrideOptions struct {\n\tvalue  string\n\tprefix string\n\tsuffix string\n}\n\nfunc stringOverrideFromConfig(\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\tdefaultOverrideOptions stringOverrideOptions,\n\tvalueFileOption bufconfig.FileOption,\n\tprefixFileOption bufconfig.FileOption,\n\tsuffixFileOption bufconfig.FileOption,\n) (stringOverrideOptions, error) {\n\tif isFileOptionDisabledForFile(\n\t\timageFile,\n\t\tvalueFileOption,\n\t\tconfig,\n\t) {\n\t\treturn stringOverrideOptions{}, nil\n\t}\n\toverrideOptions := defaultOverrideOptions\n\tignorePrefix := prefixFileOption == bufconfig.FileOptionUnspecified || isFileOptionDisabledForFile(imageFile, prefixFileOption, config)\n\tignoreSuffix := suffixFileOption == bufconfig.FileOptionUnspecified || isFileOptionDisabledForFile(imageFile, suffixFileOption, config)\n\tif ignorePrefix {\n\t\toverrideOptions.prefix = \"\"\n\t}\n\tif ignoreSuffix {\n\t\toverrideOptions.suffix = \"\"\n\t}\n\tfor _, overrideRule := range config.Overrides() {\n\t\tif !fileMatchConfig(imageFile, overrideRule.Path(), overrideRule.FullName()) {\n\t\t\tcontinue\n\t\t}\n\t\tswitch overrideRule.FileOption() {\n\t\tcase valueFileOption:\n\t\t\tvalueString, ok := overrideRule.Value().(string)\n\t\t\tif !ok {\n\t\t\t\t// This should never happen, since the override rule has been validated.\n\t\t\t\treturn stringOverrideOptions{}, fmt.Errorf(\"invalid value type for %v override: %T\", valueFileOption, overrideRule.Value())\n\t\t\t}\n\t\t\t// If the latest override matched is a value override (java_package as opposed to java_package_prefix), use the value.\n\t\t\toverrideOptions = stringOverrideOptions{value: valueString}\n\t\tcase prefixFileOption:\n\t\t\tif ignorePrefix {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tprefix, ok := overrideRule.Value().(string)\n\t\t\tif !ok {\n\t\t\t\t// This should never happen, since the override rule has been validated.\n\t\t\t\treturn stringOverrideOptions{}, fmt.Errorf(\"invalid value type for %v override: %T\", prefixFileOption, overrideRule.Value())\n\t\t\t}\n\t\t\t// Keep the suffix if the last two overrides are suffix and prefix.\n\t\t\toverrideOptions = stringOverrideOptions{\n\t\t\t\tprefix: prefix,\n\t\t\t\tsuffix: overrideOptions.suffix,\n\t\t\t}\n\t\tcase suffixFileOption:\n\t\t\tif ignoreSuffix {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsuffix, ok := overrideRule.Value().(string)\n\t\t\tif !ok {\n\t\t\t\t// This should never happen, since the override rule has been validated.\n\t\t\t\treturn stringOverrideOptions{}, fmt.Errorf(\"invalid value type for %v override: %T\", suffixFileOption, overrideRule.Value())\n\t\t\t}\n\t\t\t// Keep the prefix if the last two overrides are suffix and prefix.\n\t\t\toverrideOptions = stringOverrideOptions{\n\t\t\t\tprefix: overrideOptions.prefix,\n\t\t\t\tsuffix: suffix,\n\t\t\t}\n\t\t}\n\t}\n\treturn overrideOptions, nil\n}\n\n// returns the override value and whether managed mode is DISABLED for this file for this file option.\nfunc overrideFromConfig[T bool | descriptorpb.FileOptions_OptimizeMode](\n\timageFile bufimage.ImageFile,\n\tconfig bufconfig.GenerateManagedConfig,\n\tfileOption bufconfig.FileOption,\n) (*T, error) {\n\tvar override *T\n\tfor _, overrideRule := range config.Overrides() {\n\t\tif !fileMatchConfig(imageFile, overrideRule.Path(), overrideRule.FullName()) {\n\t\t\tcontinue\n\t\t}\n\t\tif overrideRule.FileOption() != fileOption {\n\t\t\tcontinue\n\t\t}\n\t\tvalue, ok := overrideRule.Value().(T)\n\t\tif !ok {\n\t\t\t// This should never happen, since the override rule has been validated.\n\t\t\treturn nil, fmt.Errorf(\"invalid value type for %v override: %T\", fileOption, overrideRule.Value())\n\t\t}\n\t\toverride = &value\n\t}\n\treturn override, nil\n}\n\nfunc isFileOptionDisabledForFile(\n\timageFile bufimage.ImageFile,\n\tfileOption bufconfig.FileOption,\n\tconfig bufconfig.GenerateManagedConfig,\n) bool {\n\tfor _, disableRule := range config.Disables() {\n\t\tif disableRule.FileOption() != bufconfig.FileOptionUnspecified && disableRule.FileOption() != fileOption {\n\t\t\tcontinue\n\t\t}\n\t\tif disableRule.FieldOption() != bufconfig.FieldOptionUnspecified {\n\t\t\tcontinue // FieldOption specified, not a matching rule.\n\t\t}\n\t\tif !fileMatchConfig(imageFile, disableRule.Path(), disableRule.FullName()) {\n\t\t\tcontinue\n\t\t}\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc fileMatchConfig(\n\timageFile bufimage.ImageFile,\n\trequiredPath string,\n\trequiredFullName string,\n) bool {\n\tif requiredPath != \"\" && !normalpath.EqualsOrContainsPath(requiredPath, imageFile.Path(), normalpath.Relative) {\n\t\treturn false\n\t}\n\tif requiredFullName != \"\" && (imageFile.FullName() == nil || imageFile.FullName().String() != requiredFullName) {\n\t\treturn false\n\t}\n\treturn true\n}\n\n// TODO FUTURE: unify naming of these helpers\nfunc getJavaPackageValue(imageFile bufimage.ImageFile, stringOverrideOptions stringOverrideOptions) string {\n\tif pkg := imageFile.FileDescriptorProto().GetPackage(); pkg != \"\" {\n\t\tif stringOverrideOptions.prefix != \"\" {\n\t\t\tpkg = stringOverrideOptions.prefix + \".\" + pkg\n\t\t}\n\t\tif stringOverrideOptions.suffix != \"\" {\n\t\t\tpkg = pkg + \".\" + stringOverrideOptions.suffix\n\t\t}\n\t\treturn pkg\n\t}\n\treturn \"\"\n}\n\nfunc getCsharpNamespaceValue(imageFile bufimage.ImageFile, prefix string) string {\n\tnamespace := csharpNamespaceValue(imageFile)\n\tif namespace == \"\" {\n\t\treturn \"\"\n\t}\n\tif prefix == \"\" {\n\t\treturn namespace\n\t}\n\treturn prefix + \".\" + namespace\n}\n\nfunc getPhpMetadataNamespaceValue(imageFile bufimage.ImageFile, suffix string) string {\n\tnamespace := phpNamespaceValue(imageFile)\n\tif namespace == \"\" {\n\t\treturn \"\"\n\t}\n\tif suffix == \"\" {\n\t\treturn namespace\n\t}\n\treturn namespace + `\\` + suffix\n}\n\nfunc getRubyPackageValue(imageFile bufimage.ImageFile, suffix string) string {\n\trubyPackage := rubyPackageValue(imageFile)\n\tif rubyPackage == \"\" {\n\t\treturn \"\"\n\t}\n\tif suffix == \"\" {\n\t\treturn rubyPackage\n\t}\n\treturn rubyPackage + \"::\" + suffix\n}\n\n// TODO FUTURE: is this needed?\n// csharpNamespaceValue returns the csharp_namespace for the given ImageFile based on its\n// package declaration. If the image file doesn't have a package declaration, an\n// empty string is returned.\nfunc csharpNamespaceValue(imageFile bufimage.ImageFile) string {\n\tpkg := imageFile.FileDescriptorProto().GetPackage()\n\tif pkg == \"\" {\n\t\treturn \"\"\n\t}\n\tpackageParts := strings.Split(pkg, \".\")\n\tfor i, part := range packageParts {\n\t\tpackageParts[i] = xstrings.ToPascalCase(part)\n\t}\n\treturn strings.Join(packageParts, \".\")\n}\n\n// goPackageImportPathForFile returns the go_package import path for the given\n// ImageFile. If the package contains a version suffix, and if there are more\n// than two components, concatenate the final two components. Otherwise, we\n// exclude the ';' separator and adopt the default behavior from the import path.\n//\n// For example, an ImageFile with `package acme.weather.v1;` will include `;weatherv1`\n// in the `go_package` declaration so that the generated package is named as such.\nfunc goPackageImportPathForFile(imageFile bufimage.ImageFile, importPathPrefix string) string {\n\tgoPackageImportPath := path.Join(importPathPrefix, path.Dir(imageFile.Path()))\n\tpackageName := imageFile.FileDescriptorProto().GetPackage()\n\tif _, ok := protoversion.NewPackageVersionForPackage(packageName); ok {\n\t\tparts := strings.Split(packageName, \".\")\n\t\tif len(parts) >= 2 {\n\t\t\tgoPackageImportPath += \";\" + parts[len(parts)-2] + parts[len(parts)-1]\n\t\t}\n\t}\n\treturn goPackageImportPath\n}\n\nfunc javaOuterClassnameValue(imageFile bufimage.ImageFile) string {\n\treturn xstrings.ToPascalCase(normalpath.Base(imageFile.Path()))\n}\n\n// objcClassPrefixValue returns the objc_class_prefix for the given ImageFile based on its\n// package declaration. If the image file doesn't have a package declaration, an\n// empty string is returned.\nfunc objcClassPrefixValue(imageFile bufimage.ImageFile) string {\n\tpkg := imageFile.FileDescriptorProto().GetPackage()\n\tif pkg == \"\" {\n\t\treturn \"\"\n\t}\n\t_, hasPackageVersion := protoversion.NewPackageVersionForPackage(pkg)\n\tpackageParts := strings.Split(pkg, \".\")\n\tvar prefixParts []rune\n\tfor i, part := range packageParts {\n\t\t// Check if last part is a version before appending.\n\t\tif i == len(packageParts)-1 && hasPackageVersion {\n\t\t\tcontinue\n\t\t}\n\t\t// Probably should never be a non-ASCII character,\n\t\t// but why not support it just in case?\n\t\truneSlice := []rune(part)\n\t\tprefixParts = append(prefixParts, unicode.ToUpper(runeSlice[0]))\n\t}\n\tfor len(prefixParts) < 3 {\n\t\tprefixParts = append(prefixParts, 'X')\n\t}\n\tprefix := string(prefixParts)\n\tif prefix == \"GPB\" {\n\t\tprefix = \"GPX\"\n\t}\n\treturn prefix\n}\n\n// phpMetadataNamespaceValue returns the php_metadata_namespace for the given ImageFile based on its\n// package declaration. If the image file doesn't have a package declaration, an\n// empty string is returned.\nfunc phpMetadataNamespaceValue(imageFile bufimage.ImageFile) string {\n\tphpNamespace := phpNamespaceValue(imageFile)\n\tif phpNamespace == \"\" {\n\t\treturn \"\"\n\t}\n\treturn phpNamespace + `\\GPBMetadata`\n}\n\n// phpNamespaceValue returns the php_namespace for the given ImageFile based on its\n// package declaration. If the image file doesn't have a package declaration, an\n// empty string is returned.\nfunc phpNamespaceValue(imageFile bufimage.ImageFile) string {\n\tpkg := imageFile.FileDescriptorProto().GetPackage()\n\tif pkg == \"\" {\n\t\treturn \"\"\n\t}\n\tpackageParts := strings.Split(pkg, \".\")\n\tfor i, part := range packageParts {\n\t\tpackagePart := xstrings.ToPascalCase(part)\n\t\tif _, ok := phpReservedKeywords[strings.ToLower(part)]; ok {\n\t\t\t// Append _ to the package part if it is a reserved keyword.\n\t\t\tpackagePart += \"_\"\n\t\t}\n\t\tpackageParts[i] = packagePart\n\t}\n\treturn strings.Join(packageParts, `\\`)\n}\n\n// rubyPackageValue returns the ruby_package for the given ImageFile based on its\n// package declaration. If the image file doesn't have a package declaration, an\n// empty string is returned.\nfunc rubyPackageValue(imageFile bufimage.ImageFile) string {\n\tpkg := imageFile.FileDescriptorProto().GetPackage()\n\tif pkg == \"\" {\n\t\treturn \"\"\n\t}\n\tpackageParts := strings.Split(pkg, \".\")\n\tfor i, part := range packageParts {\n\t\tpackageParts[i] = xstrings.ToPascalCase(part)\n\t}\n\treturn strings.Join(packageParts, \"::\")\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/alloptions/a.proto",
    "content": "option csharp_namespace = \"foo\";\noption go_package = \"foo\";\noption java_package = \"foo\";\noption java_outer_classname = \"foo\";\noption objc_class_prefix = \"foo\";\noption php_class_prefix = \"foo\";\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n\noption optimize_for = SPEED;\noption cc_enable_arenas = false;\noption cc_generic_services = false;\noption java_generic_services = false;\noption java_multiple_files = false;\noption java_string_check_utf8 = false;\n//option php_generic_services = false;\noption py_generic_services = false;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/bar/bar_all/with_package.proto",
    "content": "package bar.all;\n\noption cc_enable_arenas = false;\noption cc_generic_services = false;\noption csharp_namespace = \"bar\";\noption go_package = \"bar\";\noption java_generic_services = false;\noption java_multiple_files = false;\noption java_outer_classname = \"bar\";\noption java_package = \"bar\";\noption java_string_check_utf8 = false;\noption objc_class_prefix = \"bar\";\noption optimize_for = SPEED;\noption php_class_prefix = \"bar\";\n//option php_generic_services = false;\noption php_metadata_namespace = \"bar\";\noption php_namespace = \"bar\";\noption py_generic_services = false;\noption ruby_package = \"bar\";\noption swift_prefix = \"bar\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/bar/bar_all/without_package.proto",
    "content": "option cc_enable_arenas = false;\noption cc_generic_services = false;\noption csharp_namespace = \"bar\";\noption go_package = \"bar\";\noption java_generic_services = false;\noption java_multiple_files = false;\noption java_outer_classname = \"bar\";\noption java_package = \"bar\";\noption java_string_check_utf8 = false;\noption objc_class_prefix = \"bar\";\noption optimize_for = SPEED;\noption php_class_prefix = \"bar\";\n//option php_generic_services = false;\noption php_metadata_namespace = \"bar\";\noption php_namespace = \"bar\";\noption py_generic_services = false;\noption ruby_package = \"bar\";\noption swift_prefix = \"bar\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/bar/bar_empty/with_package.proto",
    "content": "package bar.empty;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/bar/bar_empty/without_package.proto",
    "content": ""
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/ccoptions/a.proto",
    "content": "option cc_enable_arenas = false;\noption optimize_for = LITE_RUNTIME;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/ccoptions/b.proto",
    "content": "option cc_enable_arenas = false;\noption optimize_for = LITE_RUNTIME;\n\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/csharpoptions/double/csharp.proto",
    "content": "package acme.weather.v1;\n\noption csharp_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/csharpoptions/single/csharp.proto",
    "content": "package acme.v1;\n\noption csharp_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/csharpoptions/single/override.proto",
    "content": "package acme.v1;\n\noption csharp_namespace = \"foo\";\n\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/csharpoptions/triple/csharp.proto",
    "content": "package acme.weather.data.v1;\n\noption csharp_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/csharpoptions/underscore/csharp.proto",
    "content": "package acme.weather.foo_bar.v1;\n\noption csharp_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/emptyoptions/a.proto",
    "content": ""
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/foo/foo_all/with_package.proto",
    "content": "package foo.all;\n\noption cc_enable_arenas = true;\noption cc_generic_services = true;\noption csharp_namespace = \"foo\";\noption go_package = \"foo\";\noption java_generic_services = true;\noption java_multiple_files = true;\noption java_outer_classname = \"foo\";\noption java_package = \"foo\";\noption java_string_check_utf8 = true;\noption objc_class_prefix = \"foo\";\noption optimize_for = CODE_SIZE;\noption php_class_prefix = \"foo\";\n//option php_generic_services = true;\noption php_metadata_namespace = \"foo\";\noption php_namespace = \"foo\";\noption py_generic_services = true;\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/foo/foo_all/without_package.proto",
    "content": "option cc_enable_arenas = true;\noption cc_generic_services = true;\noption csharp_namespace = \"foo\";\noption go_package = \"foo\";\noption java_generic_services = true;\noption java_multiple_files = true;\noption java_outer_classname = \"foo\";\noption java_package = \"foo\";\noption java_string_check_utf8 = true;\noption objc_class_prefix = \"foo\";\noption optimize_for = CODE_SIZE;\noption php_class_prefix = \"foo\";\n//option php_generic_services = true;\noption php_metadata_namespace = \"foo\";\noption php_namespace = \"foo\";\noption py_generic_services = true;\noption ruby_package = \"foo\";\noption swift_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/foo/foo_empty/with_package.proto",
    "content": "package foo.empty;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/foo/foo_empty/without_package.proto",
    "content": ""
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/javaemptyoptions/a.proto",
    "content": "package foo;"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/javaoptions/java_file.proto",
    "content": "package acme.weather;\n\noption java_multiple_files = true;\noption java_string_check_utf8 = false;\noption java_package = \"foo\";\noption java_outer_classname = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/javaoptions/override.proto",
    "content": "package acme.weather;\n\noption java_multiple_files = true;\noption java_string_check_utf8 = false;\noption java_package = \"foo\";\noption java_outer_classname = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/jsoptions/a.proto",
    "content": "option optimize_for = CODE_SIZE;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/objcoptions/double/objc.proto",
    "content": "package acme.weather.v1;\n\noption objc_class_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/objcoptions/gpb/objc.proto",
    "content": "package google.protobuf.bla.v1;\n\noption objc_class_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/objcoptions/single/objc.proto",
    "content": "package acme.v1;\n\noption objc_class_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/objcoptions/single/override.proto",
    "content": "package acme.v1;\n\noption objc_class_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/objcoptions/triple/objc.proto",
    "content": "package acme.weather.data.v1;\n\noption objc_class_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/objcoptions/unversioned/objc.proto",
    "content": "package acme.weather.data;\n\noption objc_class_prefix = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/packageversion/a.proto",
    "content": "package weather.v1alpha1;\n\noption go_package = \"weather\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/packageversion/b.proto",
    "content": "package weather.v1alpha1;\n\noption go_package = \"weather\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/phpoptions/double/php.proto",
    "content": "package acme.weather.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/phpoptions/reserved/php.proto",
    "content": "package acme.error.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/phpoptions/single/override.proto",
    "content": "package acme.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/phpoptions/single/php.proto",
    "content": "package acme.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/phpoptions/triple/php.proto",
    "content": "package acme.weather.data.v1;\n\noption php_namespace = \"foo\";\noption php_metadata_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/phpoptions/underscore/php.proto",
    "content": "package acme.weather.foo_bar.v1;\n\noption php_namespace = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/rubyoptions/double/ruby.proto",
    "content": "package acme.weather.v1;\n\noption ruby_package = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/rubyoptions/single/override.proto",
    "content": "package acme.v1;\n\noption ruby_package = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/rubyoptions/single/ruby.proto",
    "content": "package acme.v1;\n\noption ruby_package = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/rubyoptions/triple/ruby.proto",
    "content": "package acme.weather.data.v1;\n\noption ruby_package = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/rubyoptions/underscore/ruby.proto",
    "content": "package acme.weather.foo_bar.v1;\n\noption ruby_package = \"foo\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/testdata/wktimport/a.proto",
    "content": "syntax = \"proto3\";\n\npackage acme.weather.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Container {\n    google.protobuf.Timestamp timestamp = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagemodify/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufimagemodify\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagetesting/bufimagetesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagetesting\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"github.com/google/uuid\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// NewImageFile returns a new ImageFile for testing.\n//\n// TODO FUTURE: moduleFullName and commit should be options.\nfunc NewImageFile(\n\tt testing.TB,\n\tfileDescriptor protodescriptor.FileDescriptor,\n\tmoduleFullName bufparse.FullName,\n\tcommit uuid.UUID,\n\texternalPath string,\n\tlocalPath string,\n\tisImport bool,\n\tisSyntaxUnspecified bool,\n\tunusedDependencyIndexes []int32,\n) bufimage.ImageFile {\n\timageFile, err := bufimage.NewImageFile(\n\t\tfileDescriptor,\n\t\tmoduleFullName,\n\t\tcommit,\n\t\texternalPath,\n\t\tlocalPath,\n\t\tisImport,\n\t\tisSyntaxUnspecified,\n\t\tunusedDependencyIndexes,\n\t)\n\trequire.NoError(t, err)\n\treturn imageFile\n}\n\n// NewProtoImageFile returns a new *imagev1.ImageFile for testing.\n//\n// This is also a protodescriptor.FileDescriptor.\nfunc NewProtoImageFile(\n\tt testing.TB,\n\tpath string,\n\timportPaths ...string,\n) *imagev1.ImageFile {\n\treturn imagev1.ImageFile_builder{\n\t\tName:       proto.String(path),\n\t\tDependency: importPaths,\n\t\tBufExtension: imagev1.ImageFileExtension_builder{\n\t\t\tIsImport:            proto.Bool(false),\n\t\t\tIsSyntaxUnspecified: proto.Bool(false),\n\t\t}.Build(),\n\t}.Build()\n}\n\n// NewProtoImageFileIsImport returns a new *imagev1.ImageFile for testing that is an import.\n//\n// This is also a protodescriptor.FileDescriptor.\nfunc NewProtoImageFileIsImport(\n\tt testing.TB,\n\tpath string,\n\timportPaths ...string,\n) *imagev1.ImageFile {\n\treturn imagev1.ImageFile_builder{\n\t\tName:       proto.String(path),\n\t\tDependency: importPaths,\n\t\tBufExtension: imagev1.ImageFileExtension_builder{\n\t\t\tIsImport:            proto.Bool(true),\n\t\t\tIsSyntaxUnspecified: proto.Bool(false),\n\t\t}.Build(),\n\t}.Build()\n}\n\n// AssertImageFilesEqual asserts the expected ImageFiles equal the actual ImageFiles.\nfunc AssertImageFilesEqual(t testing.TB, expected []bufimage.ImageFile, actual []bufimage.ImageFile) {\n\texpectedNormalizedImageFiles := normalizeImageFiles(t, expected)\n\tactualNormalizedImageFiles := normalizeImageFiles(t, actual)\n\tassert.Equal(t, expectedNormalizedImageFiles, actualNormalizedImageFiles)\n}\n\nfunc normalizeImageFiles(t testing.TB, imageFiles []bufimage.ImageFile) []bufimage.ImageFile {\n\tnormalizedImageFiles := make([]bufimage.ImageFile, len(imageFiles))\n\tfor i, imageFile := range imageFiles {\n\t\tnormalizedImageFiles[i] = NewImageFile(\n\t\t\tt,\n\t\t\tNewProtoImageFile(\n\t\t\t\tt,\n\t\t\t\timageFile.FileDescriptorProto().GetName(),\n\t\t\t\timageFile.FileDescriptorProto().GetDependency()...,\n\t\t\t),\n\t\t\timageFile.FullName(),\n\t\t\timageFile.CommitID(),\n\t\t\timageFile.ExternalPath(),\n\t\t\timageFile.LocalPath(),\n\t\t\timageFile.IsImport(),\n\t\t\timageFile.IsSyntaxUnspecified(),\n\t\t\timageFile.UnusedDependencyIndexes(),\n\t\t)\n\t}\n\treturn normalizedImageFiles\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagetesting/bufimagetesting_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimagetesting\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/google/uuid\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc BenchmarkNewImageWithOnlyPathsAllowNotExistFileOnly(b *testing.B) {\n\tvar imageFiles []bufimage.ImageFile\n\tfor i := range 3000 {\n\t\timageFiles = append(\n\t\t\timageFiles,\n\t\t\tNewImageFile(\n\t\t\t\tb,\n\t\t\t\tNewProtoImageFile(\n\t\t\t\t\tb,\n\t\t\t\t\tfmt.Sprintf(\"a%d.proto/a%d.proto\", i, i),\n\t\t\t\t),\n\t\t\t\tnil,\n\t\t\t\tuuid.Nil,\n\t\t\t\tfmt.Sprintf(\"foo/two/a%d.proto/a%d.proto\", i, i),\n\t\t\t\tfmt.Sprintf(\"foo/two/a%d.proto/a%d.proto\", i, i),\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\tnil,\n\t\t\t),\n\t\t)\n\t}\n\timage, err := bufimage.NewImage(imageFiles)\n\trequire.NoError(b, err)\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tnewImage, err := bufimage.ImageWithOnlyPathsAllowNotExist(image, []string{\"a1.proto/a1.proto\"}, nil)\n\t\t// this does increase the time but we're just looking for order of magnitude\n\t\t// between this and the below benchmark function\n\t\trequire.NoError(b, err)\n\t\trequire.Equal(b, 1, len(newImage.Files()))\n\t}\n}\n\nfunc BenchmarkNewImageWithOnlyPathsAllowNotExistDirOnly(b *testing.B) {\n\tvar imageFiles []bufimage.ImageFile\n\tfor i := range 3000 {\n\t\timageFiles = append(\n\t\t\timageFiles,\n\t\t\tNewImageFile(\n\t\t\t\tb,\n\t\t\t\tNewProtoImageFile(\n\t\t\t\t\tb,\n\t\t\t\t\tfmt.Sprintf(\"a%d.proto/a%d.proto\", i, i),\n\t\t\t\t),\n\t\t\t\tnil,\n\t\t\t\tuuid.Nil,\n\t\t\t\tfmt.Sprintf(\"foo/two/a%d.proto/a%d.proto\", i, i),\n\t\t\t\tfmt.Sprintf(\"foo/two/a%d.proto/a%d.proto\", i, i),\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\tnil,\n\t\t\t),\n\t\t)\n\t}\n\timage, err := bufimage.NewImage(imageFiles)\n\trequire.NoError(b, err)\n\tb.ResetTimer()\n\tfor n := 0; n < b.N; n++ {\n\t\tnewImage, err := bufimage.ImageWithOnlyPathsAllowNotExist(image, []string{\"a1.proto\"}, nil)\n\t\trequire.NoError(b, err)\n\t\trequire.Equal(b, 1, len(newImage.Files()))\n\t}\n}\n\nfunc TestBasic(t *testing.T) {\n\tt.Parallel()\n\n\tprotoImageFileImport := NewProtoImageFileIsImport(\n\t\tt,\n\t\t\"import.proto\",\n\t)\n\tprotoImageFileWellKnownTypeImport := NewProtoImageFileIsImport(\n\t\tt,\n\t\t\"google/protobuf/timestamp.proto\",\n\t)\n\tprotoImageFileAA := NewProtoImageFile(\n\t\tt,\n\t\t\"a/a.proto\",\n\t)\n\tprotoImageFileAB := NewProtoImageFile(\n\t\tt,\n\t\t\"a/b.proto\",\n\t\t\"import.proto\",\n\t\t\"google/protobuf/timestamp.proto\",\n\t)\n\tprotoImageFileBA := NewProtoImageFile(\n\t\tt,\n\t\t\"b/a.proto\",\n\t\t\"a/a.proto\",\n\t\t\"a/b.proto\",\n\t)\n\tprotoImageFileBB := NewProtoImageFile(\n\t\tt,\n\t\t\"b/b.proto\",\n\t\t\"a/a.proto\",\n\t\t\"a/b.proto\",\n\t\t\"b/a.proto\",\n\t)\n\tprotoImageFileOutlandishDirectoryName := NewProtoImageFile(\n\t\tt,\n\t\t\"d/d.proto/d.proto\",\n\t\t\"import.proto\",\n\t)\n\n\tfileImport := NewImageFile(\n\t\tt,\n\t\tprotoImageFileImport,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"some/import/import.proto\",\n\t\t\"some/import/import.proto\",\n\t\ttrue,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileWellKnownTypeImport := NewImageFile(\n\t\tt,\n\t\tprotoImageFileWellKnownTypeImport,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"google/protobuf/timestamp.proto\",\n\t\t\"\",\n\t\ttrue,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileOneAA := NewImageFile(\n\t\tt,\n\t\tprotoImageFileAA,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"foo/one/a/a.proto\",\n\t\t\"foo/one/a/a.proto\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileOneAB := NewImageFile(\n\t\tt,\n\t\tprotoImageFileAB,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"foo/one/a/b.proto\",\n\t\t\"foo/one/a/b.proto\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileTwoBA := NewImageFile(\n\t\tt,\n\t\tprotoImageFileBA,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"foo/two/b/a.proto\",\n\t\t\"foo/two/b/a.proto\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileTwoBB := NewImageFile(\n\t\tt,\n\t\tprotoImageFileBB,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"foo/two/b/b.proto\",\n\t\t\"foo/two/b/b.proto\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileOutlandishDirectoryName := NewImageFile(\n\t\tt,\n\t\tprotoImageFileOutlandishDirectoryName,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"foo/three/d/d.proto/d.proto\",\n\t\t\"foo/three/d/d.proto/d.proto\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\n\timage, err := bufimage.NewImage(\n\t\t[]bufimage.ImageFile{\n\t\t\tfileOneAA,\n\t\t\tfileImport,\n\t\t\tfileWellKnownTypeImport,\n\t\t\tfileOneAB,\n\t\t\tfileTwoBA,\n\t\t\tfileTwoBB,\n\t\t\tfileOutlandishDirectoryName,\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBB, nil, uuid.Nil, \"foo/two/b/b.proto\", \"foo/two/b/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileOutlandishDirectoryName, nil, uuid.Nil, \"foo/three/d/d.proto/d.proto\", \"foo/three/d/d.proto/d.proto\", false, false, nil),\n\t\t},\n\t\timage.Files(),\n\t)\n\trequire.NotNil(t, image.GetFile(\"a/a.proto\"))\n\trequire.Nil(t, image.GetFile(\"one/a/a.proto\"))\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBB, nil, uuid.Nil, \"foo/two/b/b.proto\", \"foo/two/b/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileOutlandishDirectoryName, nil, uuid.Nil, \"foo/three/d/d.proto/d.proto\", \"foo/three/d/d.proto/d.proto\", false, false, nil),\n\t\t},\n\t\tbufimage.ImageWithoutImports(image).Files(),\n\t)\n\n\tnewImage, err := bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"b/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\n\t_, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"b/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"foo.proto\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.Error(t, err)\n\n\tnewImage, err = bufimage.ImageWithOnlyPathsAllowNotExist(\n\t\timage,\n\t\t[]string{\n\t\t\t\"b/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"foo.proto\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\tnewImage, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"a\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\tnewImage, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"b\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBB, nil, uuid.Nil, \"foo/two/b/b.proto\", \"foo/two/b/b.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\tnewImage, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"a\",\n\t\t\t\"b/a.proto\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\t_, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"a\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"c\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.Error(t, err)\n\tnewImage, err = bufimage.ImageWithOnlyPathsAllowNotExist(\n\t\timage,\n\t\t[]string{\n\t\t\t\"a\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"c\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\tnewImage, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"a\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"d/d.proto/d.proto\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileOutlandishDirectoryName, nil, uuid.Nil, \"foo/three/d/d.proto/d.proto\", \"foo/three/d/d.proto/d.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\tnewImage, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"a\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"d/d.proto\",\n\t\t},\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileOutlandishDirectoryName, nil, uuid.Nil, \"foo/three/d/d.proto/d.proto\", \"foo/three/d/d.proto/d.proto\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\n\tprotoImage := imagev1.Image_builder{\n\t\tFile: []*imagev1.ImageFile{\n\t\t\tprotoImageFileAA,\n\t\t\tprotoImageFileImport,\n\t\t\tprotoImageFileWellKnownTypeImport,\n\t\t\tprotoImageFileAB,\n\t\t\tprotoImageFileBA,\n\t\t\tprotoImageFileBB,\n\t\t\tprotoImageFileOutlandishDirectoryName,\n\t\t},\n\t}.Build()\n\tnewImage, err = bufimage.NewImageForProto(protoImage)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\t// Local paths are not set because we created from a Protobuf message.\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"a/a.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"import.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"a/b.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"b/a.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBB, nil, uuid.Nil, \"b/b.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileOutlandishDirectoryName, nil, uuid.Nil, \"d/d.proto/d.proto\", \"\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\tnewProtoImage, err := bufimage.ImageToProtoImage(newImage)\n\trequire.NoError(t, err)\n\tdiff := cmp.Diff(protoImage, newProtoImage, protocmp.Transform())\n\trequire.Empty(t, diff)\n\tfileDescriptorSet := &descriptorpb.FileDescriptorSet{\n\t\tFile: []*descriptorpb.FileDescriptorProto{\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t},\n\t}\n\tdiff = cmp.Diff(fileDescriptorSet, bufimage.ImageToFileDescriptorSet(image), protocmp.Transform())\n\trequire.Empty(t, diff)\n\tcodeGeneratorRequest := &pluginpb.CodeGeneratorRequest{\n\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t},\n\t\tParameter: proto.String(\"foo\"),\n\t\tFileToGenerate: []string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t\t\"d/d.proto/d.proto\",\n\t\t},\n\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t},\n\t}\n\tactualRequest, err := bufimage.ImageToCodeGeneratorRequest(image, \"foo\", nil, false, false)\n\trequire.NoError(t, err)\n\tdiff = cmp.Diff(\n\t\tcodeGeneratorRequest,\n\t\tactualRequest,\n\t\tprotocmp.Transform(),\n\t)\n\trequire.Empty(t, diff)\n\n\t// verify that includeWellKnownTypes is a no-op if includeImports is false\n\tactualRequest, err = bufimage.ImageToCodeGeneratorRequest(image, \"foo\", nil, false, true)\n\trequire.NoError(t, err)\n\tdiff = cmp.Diff(\n\t\tcodeGeneratorRequest,\n\t\tactualRequest,\n\t\tprotocmp.Transform(),\n\t)\n\trequire.Empty(t, diff)\n\n\tcodeGeneratorRequestIncludeImports := &pluginpb.CodeGeneratorRequest{\n\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t},\n\t\tParameter: proto.String(\"foo\"),\n\t\tFileToGenerate: []string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"import.proto\",\n\t\t\t// no WKT\n\t\t\t\"a/b.proto\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t\t\"d/d.proto/d.proto\",\n\t\t},\n\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t},\n\t}\n\tactualRequest, err = bufimage.ImageToCodeGeneratorRequest(image, \"foo\", nil, true, false)\n\trequire.NoError(t, err)\n\tdiff = cmp.Diff(\n\t\tcodeGeneratorRequestIncludeImports,\n\t\tactualRequest,\n\t\tprotocmp.Transform(),\n\t)\n\trequire.Empty(t, diff)\n\tnewImage, err = bufimage.NewImageForCodeGeneratorRequest(codeGeneratorRequest)\n\trequire.NoError(t, err)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"a/a.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"import.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"a/b.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"b/a.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBB, nil, uuid.Nil, \"b/b.proto\", \"\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileOutlandishDirectoryName, nil, uuid.Nil, \"d/d.proto/d.proto\", \"\", false, false, nil),\n\t\t},\n\t\tnewImage.Files(),\n\t)\n\tcodeGeneratorRequestIncludeImportsAndWellKnownTypes := &pluginpb.CodeGeneratorRequest{\n\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t},\n\t\tParameter: proto.String(\"foo\"),\n\t\tFileToGenerate: []string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"import.proto\",\n\t\t\t\"google/protobuf/timestamp.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t\t\"d/d.proto/d.proto\",\n\t\t},\n\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t},\n\t}\n\tactualRequest, err = bufimage.ImageToCodeGeneratorRequest(image, \"foo\", nil, true, true)\n\trequire.NoError(t, err)\n\tdiff = cmp.Diff(\n\t\tcodeGeneratorRequestIncludeImportsAndWellKnownTypes,\n\t\tactualRequest,\n\t\tprotocmp.Transform(),\n\t)\n\trequire.Empty(t, diff)\n\t// imagesByDir and multiple Image tests\n\timagesByDir, err := bufimage.ImageByDir(image)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 3, len(imagesByDir))\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", false, false, nil),\n\t\t},\n\t\timagesByDir[0].Files(),\n\t)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileAA, nil, uuid.Nil, \"foo/one/a/a.proto\", \"foo/one/a/a.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileWellKnownTypeImport, nil, uuid.Nil, \"google/protobuf/timestamp.proto\", \"\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileAB, nil, uuid.Nil, \"foo/one/a/b.proto\", \"foo/one/a/b.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBA, nil, uuid.Nil, \"foo/two/b/a.proto\", \"foo/two/b/a.proto\", false, false, nil),\n\t\t\tNewImageFile(t, protoImageFileBB, nil, uuid.Nil, \"foo/two/b/b.proto\", \"foo/two/b/b.proto\", false, false, nil),\n\t\t},\n\t\timagesByDir[1].Files(),\n\t)\n\tAssertImageFilesEqual(\n\t\tt,\n\t\t[]bufimage.ImageFile{\n\t\t\tNewImageFile(t, protoImageFileImport, nil, uuid.Nil, \"some/import/import.proto\", \"some/import/import.proto\", true, false, nil),\n\t\t\tNewImageFile(t, protoImageFileOutlandishDirectoryName, nil, uuid.Nil, \"foo/three/d/d.proto/d.proto\", \"foo/three/d/d.proto/d.proto\", false, false, nil),\n\t\t},\n\t\timagesByDir[2].Files(),\n\t)\n\tcodeGeneratorRequests := []*pluginpb.CodeGeneratorRequest{\n\t\t{\n\t\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\t},\n\t\t\tParameter: proto.String(\"foo\"),\n\t\t\tFileToGenerate: []string{\n\t\t\t\t\"a/a.proto\",\n\t\t\t\t\"a/b.proto\",\n\t\t\t},\n\t\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\t},\n\t\t\tParameter: proto.String(\"foo\"),\n\t\t\tFileToGenerate: []string{\n\t\t\t\t\"b/a.proto\",\n\t\t\t\t\"b/b.proto\",\n\t\t\t},\n\t\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t\t},\n\t\t\tParameter: proto.String(\"foo\"),\n\t\t\tFileToGenerate: []string{\n\t\t\t\t\"d/d.proto/d.proto\",\n\t\t\t},\n\t\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t\t},\n\t\t},\n\t}\n\trequestsFromImages, err := bufimage.ImagesToCodeGeneratorRequests(imagesByDir, \"foo\", nil, false, false)\n\trequire.NoError(t, err)\n\trequire.Equal(t, len(codeGeneratorRequests), len(requestsFromImages))\n\tfor i := range codeGeneratorRequests {\n\t\tdiff = cmp.Diff(codeGeneratorRequests[i], requestsFromImages[i], protocmp.Transform())\n\t\trequire.Empty(t, diff)\n\t}\n\tcodeGeneratorRequestsIncludeImports := []*pluginpb.CodeGeneratorRequest{\n\t\t{\n\t\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\t},\n\t\t\tParameter: proto.String(\"foo\"),\n\t\t\tFileToGenerate: []string{\n\t\t\t\t\"a/a.proto\",\n\t\t\t\t\"import.proto\",\n\t\t\t\t\"a/b.proto\",\n\t\t\t},\n\t\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileWellKnownTypeImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileAB),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\t},\n\t\t\tParameter: proto.String(\"foo\"),\n\t\t\tFileToGenerate: []string{\n\t\t\t\t\"b/a.proto\",\n\t\t\t\t\"b/b.proto\",\n\t\t\t},\n\t\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBA),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileBB),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tProtoFile: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileImport),\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t\t},\n\t\t\tParameter: proto.String(\"foo\"),\n\t\t\tFileToGenerate: []string{\n\t\t\t\t\"d/d.proto/d.proto\",\n\t\t\t},\n\t\t\tSourceFileDescriptors: []*descriptorpb.FileDescriptorProto{\n\t\t\t\ttestProtoImageFileToFileDescriptorProto(protoImageFileOutlandishDirectoryName),\n\t\t\t},\n\t\t},\n\t}\n\trequestsFromImages, err = bufimage.ImagesToCodeGeneratorRequests(imagesByDir, \"foo\", nil, true, false)\n\trequire.NoError(t, err)\n\trequire.Equal(t, len(codeGeneratorRequestsIncludeImports), len(requestsFromImages))\n\tfor i := range codeGeneratorRequestsIncludeImports {\n\t\tdiff = cmp.Diff(codeGeneratorRequestsIncludeImports[i], requestsFromImages[i], protocmp.Transform())\n\t\trequire.Empty(t, diff)\n\t}\n}\n\nfunc TestImageFileInfosWithOnlyTargetsAndTargetImports(t *testing.T) {\n\tt.Parallel()\n\n\tprotoImageFileC := NewProtoImageFileIsImport(\n\t\tt,\n\t\t\"c.proto\",\n\t)\n\tprotoImageFileD := NewProtoImageFileIsImport(\n\t\tt,\n\t\t\"d.proto\",\n\t)\n\t//protoImageFileTimestamp := NewProtoImageFileIsImport(\n\t//t,\n\t//\"google/protobuf/timestamp.proto\",\n\t//)\n\tprotoImageFileA := NewProtoImageFile(\n\t\tt,\n\t\t\"a.proto\",\n\t\t\"c.proto\",\n\t\t// Should be automatically added.\n\t\t\"google/protobuf/timestamp.proto\",\n\t)\n\tprotoImageFileB := NewProtoImageFile(\n\t\tt,\n\t\t\"b.proto\",\n\t)\n\n\tfileC := NewImageFile(\n\t\tt,\n\t\tprotoImageFileC,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"\",\n\t\t\"\",\n\t\ttrue,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileD := NewImageFile(\n\t\tt,\n\t\tprotoImageFileD,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"\",\n\t\t\"\",\n\t\ttrue,\n\t\tfalse,\n\t\tnil,\n\t)\n\t//fileTimestamp := NewImageFile(\n\t//t,\n\t//protoImageFileTimestamp,\n\t//nil,\n\t//uuid.Nil,\n\t//\"\",\n\t//\"\",\n\t//true,\n\t//false,\n\t//nil,\n\t//)\n\tfileA := NewImageFile(\n\t\tt,\n\t\tprotoImageFileA,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"\",\n\t\t\"\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\tfileB := NewImageFile(\n\t\tt,\n\t\tprotoImageFileB,\n\t\tnil,\n\t\tuuid.Nil,\n\t\t\"\",\n\t\t\"\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\n\timageFileInfos := []bufimage.ImageFileInfo{\n\t\tfileC,\n\t\tfileD,\n\t\tfileA,\n\t\t//fileTimestamp,\n\t\tfileB,\n\t}\n\tresultImageFileInfos, err := bufimage.ImageFileInfosWithOnlyTargetsAndTargetImports(\n\t\tt.Context(),\n\t\tdatawkt.ReadBucket,\n\t\timageFileInfos,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a.proto\",\n\t\t\t\"b.proto\",\n\t\t\t\"c.proto\",\n\t\t\t\"google/protobuf/timestamp.proto\",\n\t\t},\n\t\txslices.Map(resultImageFileInfos, bufimage.ImageFileInfo.Path),\n\t)\n}\n\nfunc testProtoImageFileToFileDescriptorProto(imageFile *imagev1.ImageFile) *descriptorpb.FileDescriptorProto {\n\treturn &descriptorpb.FileDescriptorProto{\n\t\tName:       proto.ValueOrNil(imageFile.HasName(), imageFile.GetName),\n\t\tDependency: imageFile.GetDependency(),\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimagetesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufimagetesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/bufimageutil.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimageutil\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/protoplugin/protopluginutil\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nconst (\n\tanyFullName = \"google.protobuf.Any\"\n\n\tmessageRangeInclusiveMax = 536870911\n)\n\nvar (\n\t// ErrImageFilterTypeNotFound is returned from FilterImage when\n\t// a specified type cannot be found in an image.\n\tErrImageFilterTypeNotFound = errors.New(\"not found\")\n\n\t// ErrImageFilterTypeIsImport is returned from FilterImage when\n\t// a specified type name is declared in a module dependency.\n\tErrImageFilterTypeIsImport = errors.New(\"type declared in imported module\")\n)\n\n// FreeMessageRangeStrings gets the free MessageRange strings for the target files.\n//\n// Recursive.\nfunc FreeMessageRangeStrings(\n\tctx context.Context,\n\tfilePaths []string,\n\timage bufimage.Image,\n) ([]string, error) {\n\tvar s []string\n\tfor _, filePath := range filePaths {\n\t\timageFile := image.GetFile(filePath)\n\t\tif imageFile == nil {\n\t\t\treturn nil, fmt.Errorf(\"unexpected nil image file: %q\", filePath)\n\t\t}\n\t\tprefix := imageFile.FileDescriptorProto().GetPackage()\n\t\tif prefix != \"\" {\n\t\t\tprefix += \".\"\n\t\t}\n\t\tfor _, message := range imageFile.FileDescriptorProto().GetMessageType() {\n\t\t\ts = freeMessageRangeStringsRec(s, prefix+message.GetName(), message)\n\t\t}\n\t}\n\treturn s, nil\n}\n\n// ImageFilterOption is an option that can be passed to FilterImage.\ntype ImageFilterOption func(*imageFilterOptions)\n\n// WithExcludeCustomOptions returns an option that will cause an image filtered via\n// FilterImage to *not* include custom options unless they are\n// explicitly named in the list of filter types.\nfunc WithExcludeCustomOptions() ImageFilterOption {\n\treturn func(opts *imageFilterOptions) {\n\t\topts.includeCustomOptions = false\n\t}\n}\n\n// WithExcludeKnownExtensions returns an option that will cause an image filtered via\n// FilterImage to *not* include the known extensions for included\n// extendable messages unless they are explicitly named in the list of filter types.\nfunc WithExcludeKnownExtensions() ImageFilterOption {\n\treturn func(opts *imageFilterOptions) {\n\t\topts.includeKnownExtensions = false\n\t}\n}\n\n// WithAllowIncludeOfImportedType returns an option for FilterImage\n// that allows a named included type to be in an imported file or module. Without this\n// option, only types defined directly in the image to be filtered are allowed.\n// Excluded types are always allowed to be in imported files or modules.\nfunc WithAllowIncludeOfImportedType() ImageFilterOption {\n\treturn func(opts *imageFilterOptions) {\n\t\topts.allowImportedTypes = true\n\t}\n}\n\n// WithIncludeTypes returns an option for FilterImage that specifies\n// the set of types that should be included in the filtered image.\n//\n// May be provided multiple times. The type names should be fully qualified.\n// For example, \"google.protobuf.Any\" or \"buf.validate\". Types may be nested,\n// and can be any package, message, enum, extension, service or method name.\n//\n// If the  type does not exist in the image, an error wrapping\n// [ErrImageFilterTypeNotFound] will be returned.\nfunc WithIncludeTypes(typeNames ...string) ImageFilterOption {\n\treturn func(opts *imageFilterOptions) {\n\t\tif len(typeNames) > 0 && opts.includeTypes == nil {\n\t\t\topts.includeTypes = make(map[string]struct{}, len(typeNames))\n\t\t}\n\t\tfor _, typeName := range typeNames {\n\t\t\topts.includeTypes[typeName] = struct{}{}\n\t\t}\n\t}\n}\n\n// WithExcludeTypes returns an option for FilterImage that\n// specifies the set of types that should be excluded from the filtered image.\n//\n// May be provided multiple times. The type names should be fully qualified.\n// For example, \"google.protobuf.Any\" or \"buf.validate\". Types may be nested,\n// and can be any package, message, enum, extension, service or method name.\n//\n// If the  type does not exist in the image, an error wrapping\n// [ErrImageFilterTypeNotFound] will be returned.\nfunc WithExcludeTypes(typeNames ...string) ImageFilterOption {\n\treturn func(opts *imageFilterOptions) {\n\t\tif len(typeNames) > 0 && opts.excludeTypes == nil {\n\t\t\topts.excludeTypes = make(map[string]struct{}, len(typeNames))\n\t\t}\n\t\tfor _, typeName := range typeNames {\n\t\t\topts.excludeTypes[typeName] = struct{}{}\n\t\t}\n\t}\n}\n\n// WithMutateInPlace returns an option for FilterImage that specifies\n// that the filtered image should be mutated in place. This option is useful when the\n// unfiltered image is no longer needed and the caller wants to avoid the overhead of\n// copying the image.\nfunc WithMutateInPlace() ImageFilterOption {\n\treturn func(opts *imageFilterOptions) {\n\t\topts.mutateInPlace = true\n\t}\n}\n\n// FilterImage returns a minimal image containing only the descriptors\n// required to define the set of types provided by the filter options. If no\n// filter options are provided, the original image is returned.\n//\n// The filtered image will contain only the files that contain the definitions of\n// the specified types, and their transitive dependencies. If a file is no longer\n// required, it will be removed from the image. Only the minimal set of types\n// required to define the specified types will be included in the filtered image.\n//\n// Excluded types and options are not included in the filtered image. If an\n// included type transitively depends on the excluded type, the descriptor will\n// be altered to remove the dependency.\n//\n// This returns a new [bufimage.Image] that is a shallow copy of the underlying\n// [descriptorpb.FileDescriptorProto]s of the original. The new image may\n// therefore share state with the original image, so it should not be modified.\n// If the original image is no longer needed, it should be discarded. To mutate\n// the original image, use the [WithMutateInPlace] option. Otherwise, to avoid\n// sharing of state clone the image before filtering.\n//\n// A descriptor is said to require another descriptor if the dependent\n// descriptor is needed to accurately and completely describe that descriptor.\n// For the following types that includes:\n//\n//\tMessages\n//\t - messages & enums referenced in fields\n//\t - proto2 extension declarations for this field\n//\t - custom options for the message, its fields, and the file in which the\n//\t   message is defined\n//\t - the parent message if this message is a nested definition\n//\n//\tEnums\n//\t - Custom options used in the enum, enum values, and the file\n//\t   in which the message is defined\n//\t - the parent message if this message is a nested definition\n//\n//\tServices\n//\t - request & response types referenced in methods\n//\t - custom options for the service, its methods, and the file\n//\t   in which the message is defined\n//\n// As an example, consider the following proto structure:\n//\n//\t--- foo.proto ---\n//\tpackage pkg;\n//\tmessage Foo {\n//\t  optional Bar bar = 1;\n//\t  extensions 2 to 3;\n//\t}\n//\tmessage Bar { ... }\n//\tmessage Baz {\n//\t  other.Qux qux = 1 [(other.my_option).field = \"buf\"];\n//\t}\n//\t--- baz.proto ---\n//\tpackage other;\n//\textend Foo {\n//\t  optional Qux baz = 2;\n//\t}\n//\tmessage Qux{ ... }\n//\tmessage Quux{ ... }\n//\textend google.protobuf.FieldOptions {\n//\t  optional Quux my_option = 51234;\n//\t}\n//\n// A filtered image for type `pkg.Foo` would include\n//\n//\tfiles:      [foo.proto, bar.proto]\n//\tmessages:   [pkg.Foo, pkg.Bar, other.Qux]\n//\textensions: [other.baz]\n//\n// A filtered image for type `pkg.Bar` would include\n//\n//\t files:      [foo.proto]\n//\t messages:   [pkg.Bar]\n//\n//\tA filtered image for type `pkg.Baz` would include\n//\t files:      [foo.proto, bar.proto]\n//\t messages:   [pkg.Baz, other.Quux, other.Qux]\n//\t extensions: [other.my_option]\nfunc FilterImage(image bufimage.Image, options ...ImageFilterOption) (bufimage.Image, error) {\n\tif len(options) == 0 {\n\t\treturn image, nil\n\t}\n\tfilterOptions := newImageFilterOptions()\n\tfor _, option := range options {\n\t\toption(filterOptions)\n\t}\n\t// Check for defaults that would result in no filtering.\n\tif len(filterOptions.excludeTypes) == 0 &&\n\t\tlen(filterOptions.includeTypes) == 0 {\n\t\treturn image, nil\n\t}\n\treturn filterImage(image, filterOptions)\n}\n\n// StripSourceRetentionOptions strips any options with a retention of \"source\" from\n// the descriptors in the given image. The image is not mutated but instead a new\n// image is returned. The returned image may share state with the original.\nfunc StripSourceRetentionOptions(image bufimage.Image) (bufimage.Image, error) {\n\tupdatedFiles := make([]bufimage.ImageFile, len(image.Files()))\n\tfor i, inputFile := range image.Files() {\n\t\tupdatedFile, err := stripSourceRetentionOptionsFromFile(inputFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to strip source-retention options from file %q: %w\", inputFile.Path(), err)\n\t\t}\n\t\tupdatedFiles[i] = updatedFile\n\t}\n\treturn bufimage.NewImage(updatedFiles)\n}\n\n// transitiveClosure accumulates the elements, files, and needed imports for a\n// subset of an image. When an element is added to the closure, all of its\n// dependencies are recursively added.\ntype transitiveClosure struct {\n\t// The elements included in the transitive closure.\n\telements map[namedDescriptor]closureInclusionMode\n\t// The set of imports for each file. This allows for re-writing imports\n\t// for files whose contents have been pruned.\n\timports map[string]map[string]struct{}\n}\n\ntype closureInclusionMode int\n\nconst (\n\t// Element is explicitly excluded from the closure.\n\tinclusionModeExcluded = closureInclusionMode(iota - 1)\n\t// Element is not yet known to be included or excluded.\n\tinclusionModeUnknown\n\t// Element is included in closure because it is directly reachable from a root.\n\tinclusionModeExplicit\n\t// Element is included in closure because it is a message or service that\n\t// *contains* an explicitly included element but is not itself directly\n\t// reachable.\n\tinclusionModeEnclosing\n\t// Element is included in closure because it is implied by the presence of a\n\t// custom option. For example, a field element with a custom option implies\n\t// the presence of google.protobuf.FieldOptions. An option type could instead be\n\t// explicitly included if it is also directly reachable (i.e. some type in the\n\t// graph explicitly refers to the option type).\n\tinclusionModeImplicit\n)\n\nfunc newTransitiveClosure() *transitiveClosure {\n\treturn &transitiveClosure{\n\t\telements: map[namedDescriptor]closureInclusionMode{},\n\t\timports:  map[string]map[string]struct{}{},\n\t}\n}\n\nfunc (t *transitiveClosure) hasType(\n\tdescriptor namedDescriptor,\n\toptions *imageFilterOptions,\n) (isIncluded bool) {\n\tswitch mode := t.elements[descriptor]; mode {\n\tcase inclusionModeExplicit, inclusionModeImplicit, inclusionModeEnclosing:\n\t\treturn true\n\tcase inclusionModeExcluded:\n\t\treturn false\n\tcase inclusionModeUnknown:\n\t\t// True if no includes are specified.\n\t\treturn options.includeTypes == nil\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (t *transitiveClosure) hasOption(\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\timageIndex *imageIndex,\n\toptions *imageFilterOptions,\n) (isIncluded bool) {\n\tif !fieldDescriptor.IsExtension() {\n\t\treturn true\n\t}\n\tif !options.includeCustomOptions {\n\t\treturn false\n\t}\n\tfullName := fieldDescriptor.FullName()\n\tdescriptor := imageIndex.ByName[fullName].element\n\tswitch mode := t.elements[descriptor]; mode {\n\tcase inclusionModeExplicit, inclusionModeImplicit, inclusionModeEnclosing:\n\t\treturn true\n\tcase inclusionModeExcluded:\n\t\treturn false\n\tcase inclusionModeUnknown:\n\t\t// True as option type is not explicitly excluded.\n\t\t// Occurs on first traversal when adding included types.\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n\nfunc (t *transitiveClosure) includeType(\n\ttypeName protoreflect.FullName,\n\timageIndex *imageIndex,\n\toptions *imageFilterOptions,\n) error {\n\tdescriptorInfo, ok := imageIndex.ByName[typeName]\n\tif ok {\n\t\t// It's a type name\n\t\tif !options.allowImportedTypes && descriptorInfo.file.IsImport() {\n\t\t\treturn fmt.Errorf(\"inclusion of type %q: %w\", typeName, ErrImageFilterTypeIsImport)\n\t\t}\n\t\t// Check if the type is already excluded.\n\t\tif mode := t.elements[descriptorInfo.element]; mode == inclusionModeExcluded {\n\t\t\treturn fmt.Errorf(\"inclusion of excluded type %q\", typeName)\n\t\t}\n\t\t// If an extension field, check if the extendee is excluded.\n\t\tif field, ok := descriptorInfo.element.(*descriptorpb.FieldDescriptorProto); ok && field.Extendee != nil {\n\t\t\textendeeName := protoreflect.FullName(strings.TrimPrefix(field.GetExtendee(), \".\"))\n\t\t\textendeeInfo, ok := imageIndex.ByName[extendeeName]\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"missing %q\", extendeeName)\n\t\t\t}\n\t\t\tif mode := t.elements[extendeeInfo.element]; mode == inclusionModeExcluded {\n\t\t\t\treturn fmt.Errorf(\"cannot include extension field %q as the extendee type %q is excluded\", typeName, extendeeName)\n\t\t\t}\n\t\t}\n\t\tif err := t.addElement(descriptorInfo.element, \"\", false, imageIndex, options); err != nil {\n\t\t\treturn fmt.Errorf(\"inclusion of type %q: %w\", typeName, err)\n\t\t}\n\t\treturn nil\n\t}\n\t// It could be a package name\n\tpkg, ok := imageIndex.Packages[string(typeName)]\n\tif !ok {\n\t\t// but it's not...\n\t\treturn fmt.Errorf(\"inclusion of type %q: %w\", typeName, ErrImageFilterTypeNotFound)\n\t}\n\tif !options.allowImportedTypes {\n\t\t// if package includes only imported files, then reject\n\t\tonlyImported := true\n\t\tfor _, file := range pkg.files {\n\t\t\tif !file.IsImport() {\n\t\t\t\tonlyImported = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif onlyImported {\n\t\t\treturn fmt.Errorf(\"inclusion of type %q: %w\", typeName, ErrImageFilterTypeIsImport)\n\t\t}\n\t}\n\tfor _, file := range pkg.files {\n\t\tfileDescriptor := file.FileDescriptorProto()\n\t\tif mode := t.elements[fileDescriptor]; mode == inclusionModeExcluded {\n\t\t\treturn fmt.Errorf(\"inclusion of excluded package %q\", typeName)\n\t\t}\n\t\tif err := t.addElement(fileDescriptor, \"\", false, imageIndex, options); err != nil {\n\t\t\treturn fmt.Errorf(\"inclusion of type %q: %w\", typeName, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (t *transitiveClosure) addImport(fromPath, toPath string) {\n\tif _, ok := t.imports[toPath]; !ok {\n\t\tt.imports[toPath] = nil // mark as seen\n\t}\n\tif fromPath == \"\" {\n\t\treturn // the base included type, not imported\n\t}\n\tif fromPath == toPath {\n\t\treturn // no need for a file to import itself\n\t}\n\timps := t.imports[fromPath]\n\tif imps == nil {\n\t\timps = make(map[string]struct{}, 2)\n\t\tt.imports[fromPath] = imps\n\t}\n\timps[toPath] = struct{}{}\n}\n\nfunc (t *transitiveClosure) addElement(\n\tdescriptor namedDescriptor,\n\treferrerFile string,\n\timpliedByCustomOption bool,\n\timageIndex *imageIndex,\n\topts *imageFilterOptions,\n) error {\n\tdescriptorInfo := imageIndex.ByDescriptor[descriptor]\n\tif existingMode, ok := t.elements[descriptor]; ok && existingMode != inclusionModeEnclosing {\n\t\tif existingMode == inclusionModeExcluded {\n\t\t\treturn nil // already excluded\n\t\t}\n\t\tt.addImport(referrerFile, descriptorInfo.file.Path())\n\t\tif existingMode == inclusionModeImplicit && !impliedByCustomOption {\n\t\t\t// upgrade from implied to explicitly part of closure\n\t\t\tt.elements[descriptor] = inclusionModeExplicit\n\t\t}\n\t\treturn nil // already added this element\n\t}\n\tif impliedByCustomOption {\n\t\tt.elements[descriptor] = inclusionModeImplicit\n\t} else {\n\t\tt.elements[descriptor] = inclusionModeExplicit\n\t}\n\n\tswitch typedDescriptor := descriptor.(type) {\n\tcase *descriptorpb.FileDescriptorProto:\n\t\t// If the file we are attempting to include is empty (has no types defined), it is still\n\t\t// valid for inclusion.\n\t\ttypeNames := imageIndex.FileTypes[typedDescriptor.GetName()]\n\t\t// A file includes all elements. The types are resolved in the image index\n\t\t// to ensure all nested types are included.\n\t\tfor _, typeName := range typeNames {\n\t\t\ttypeInfo := imageIndex.ByName[typeName]\n\t\t\tif err := t.addElement(typeInfo.element, \"\", false, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase *descriptorpb.DescriptorProto:\n\t\toneofFieldCounts := make([]int, len(typedDescriptor.GetOneofDecl()))\n\t\t// Options and types for all fields\n\t\tfor _, field := range typedDescriptor.GetField() {\n\t\t\tisIncluded, err := t.addFieldType(field, descriptorInfo.file.Path(), imageIndex, opts)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif !isIncluded {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif index := field.OneofIndex; index != nil {\n\t\t\t\tindex := *index\n\t\t\t\tif index < 0 || int(index) >= len(oneofFieldCounts) {\n\t\t\t\t\treturn fmt.Errorf(\"invalid oneof index %d for field %q\", index, field.GetName())\n\t\t\t\t}\n\t\t\t\toneofFieldCounts[index]++\n\t\t\t}\n\t\t\tif err := t.exploreCustomOptions(field, descriptorInfo.file.Path(), imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// Options for all oneofs in this message\n\t\tfor index, oneOfDescriptor := range typedDescriptor.GetOneofDecl() {\n\t\t\tif oneofFieldCounts[index] == 0 {\n\t\t\t\t// An empty oneof is not a valid protobuf construct, so we can\n\t\t\t\t// safely exclude it.\n\t\t\t\tt.elements[oneOfDescriptor] = inclusionModeExcluded\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := t.exploreCustomOptions(oneOfDescriptor, descriptorInfo.file.Path(), imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// Options for all extension ranges in this message\n\t\tfor _, extRange := range typedDescriptor.GetExtensionRange() {\n\t\t\tif err := t.exploreCustomOptions(extRange, descriptorInfo.file.Path(), imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase *descriptorpb.EnumDescriptorProto:\n\t\tfor _, enumValue := range typedDescriptor.GetValue() {\n\t\t\tif err := t.exploreCustomOptions(enumValue, descriptorInfo.file.Path(), imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase *descriptorpb.ServiceDescriptorProto:\n\t\tfor _, method := range typedDescriptor.GetMethod() {\n\t\t\tinputName := protoreflect.FullName(strings.TrimPrefix(method.GetInputType(), \".\"))\n\t\t\tinputInfo, ok := imageIndex.ByName[inputName]\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"missing %q\", inputName)\n\t\t\t}\n\t\t\toutputName := protoreflect.FullName(strings.TrimPrefix(method.GetOutputType(), \".\"))\n\t\t\toutputInfo, ok := imageIndex.ByName[outputName]\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"missing %q\", outputName)\n\t\t\t}\n\t\t\tinputMode, outputMode := t.elements[inputInfo.element], t.elements[outputInfo.element]\n\t\t\tif inputMode == inclusionModeExcluded || outputMode == inclusionModeExcluded {\n\t\t\t\t// The input or ouptut is excluded, so this method is also excluded.\n\t\t\t\tt.elements[inputInfo.element] = inclusionModeExcluded\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := t.addElement(method, \"\", false, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\tcase *descriptorpb.MethodDescriptorProto:\n\t\tinputName := protoreflect.FullName(strings.TrimPrefix(typedDescriptor.GetInputType(), \".\"))\n\t\tinputInfo, ok := imageIndex.ByName[inputName]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"missing %q\", inputName)\n\t\t}\n\t\toutputName := protoreflect.FullName(strings.TrimPrefix(typedDescriptor.GetOutputType(), \".\"))\n\t\toutputInfo, ok := imageIndex.ByName[outputName]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"missing %q\", outputName)\n\t\t}\n\t\tif inputMode := t.elements[inputInfo.element]; inputMode == inclusionModeExcluded {\n\t\t\t// The input is excluded, it's an error to include the method.\n\t\t\treturn fmt.Errorf(\"cannot include method %q as the input type %q is excluded\", descriptorInfo.fullName, inputInfo.fullName)\n\t\t}\n\t\tif outputMode := t.elements[outputInfo.element]; outputMode == inclusionModeExcluded {\n\t\t\t// The output is excluded, it's an error to include the method.\n\t\t\treturn fmt.Errorf(\"cannot include method %q as the output type %q is excluded\", descriptorInfo.fullName, outputInfo.fullName)\n\t\t}\n\t\tif err := t.addElement(inputInfo.element, descriptorInfo.file.Path(), false, imageIndex, opts); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := t.addElement(outputInfo.element, descriptorInfo.file.Path(), false, imageIndex, opts); err != nil {\n\t\t\treturn err\n\t\t}\n\n\tcase *descriptorpb.FieldDescriptorProto:\n\t\t// Regular fields are handled above in message descriptor case.\n\t\t// We should only find our way here for extensions.\n\t\tif typedDescriptor.Extendee == nil {\n\t\t\treturn errorUnsupportedFilterType(descriptor, descriptorInfo.fullName)\n\t\t}\n\t\tif typedDescriptor.GetExtendee() == \"\" {\n\t\t\treturn fmt.Errorf(\"expected extendee for field %q to not be empty\", descriptorInfo.fullName)\n\t\t}\n\t\textendeeName := protoreflect.FullName(strings.TrimPrefix(typedDescriptor.GetExtendee(), \".\"))\n\t\textendeeInfo, ok := imageIndex.ByName[extendeeName]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"missing %q\", extendeeName)\n\t\t}\n\t\tif mode := t.elements[extendeeInfo.element]; mode == inclusionModeExcluded {\n\t\t\t// The extendee is excluded, so this extension is also excluded.\n\t\t\tt.elements[descriptor] = inclusionModeExcluded\n\t\t\treturn nil\n\t\t}\n\t\tif err := t.addElement(extendeeInfo.element, descriptorInfo.file.Path(), impliedByCustomOption, imageIndex, opts); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tisIncluded, err := t.addFieldType(typedDescriptor, descriptorInfo.file.Path(), imageIndex, opts)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !isIncluded {\n\t\t\tt.elements[descriptor] = inclusionModeExcluded\n\t\t\treturn nil\n\t\t}\n\n\tdefault:\n\t\treturn errorUnsupportedFilterType(descriptor, descriptorInfo.fullName)\n\t}\n\n\t// Add the file to the imports for this file.\n\tt.addImport(referrerFile, descriptorInfo.file.Path())\n\n\t// if this type is enclosed inside another, add enclosing types\n\tif err := t.addEnclosing(descriptorInfo.parent, descriptorInfo.file.Path(), imageIndex, opts); err != nil {\n\t\treturn err\n\t}\n\t// add any custom options and their dependencies\n\tif err := t.exploreCustomOptions(descriptor, descriptorInfo.file.Path(), imageIndex, opts); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}\n\nfunc (t *transitiveClosure) excludeType(\n\ttypeName protoreflect.FullName,\n\timageIndex *imageIndex,\n\toptions *imageFilterOptions,\n) error {\n\tdescriptorInfo, ok := imageIndex.ByName[typeName]\n\tif ok {\n\t\treturn t.excludeElement(descriptorInfo.element, imageIndex, options)\n\t}\n\t// It could be a package name\n\tpkg, ok := imageIndex.Packages[string(typeName)]\n\tif !ok {\n\t\t// but it's not...\n\t\treturn fmt.Errorf(\"exclusion of type %q: %w\", typeName, ErrImageFilterTypeNotFound)\n\t}\n\t// Exclude the package and all of its files.\n\tfor _, file := range pkg.files {\n\t\tfileDescriptor := file.FileDescriptorProto()\n\t\tif err := t.excludeElement(fileDescriptor, imageIndex, options); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (t *transitiveClosure) excludeElement(\n\tdescriptor namedDescriptor,\n\timageIndex *imageIndex,\n\topts *imageFilterOptions,\n) error {\n\tdescriptorInfo := imageIndex.ByDescriptor[descriptor]\n\tif existingMode, ok := t.elements[descriptor]; ok {\n\t\tif existingMode != inclusionModeExcluded {\n\t\t\treturn fmt.Errorf(\"type %q is already included\", descriptorInfo.fullName)\n\t\t}\n\t\treturn nil\n\t}\n\tt.elements[descriptor] = inclusionModeExcluded\n\tswitch descriptor := descriptor.(type) {\n\tcase *descriptorpb.FileDescriptorProto:\n\t\tfor _, descriptor := range descriptor.GetMessageType() {\n\t\t\tif err := t.excludeElement(descriptor, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, descriptor := range descriptor.GetEnumType() {\n\t\t\tif err := t.excludeElement(descriptor, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, descriptor := range descriptor.GetService() {\n\t\t\tif err := t.excludeElement(descriptor, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, extension := range descriptor.GetExtension() {\n\t\t\tif err := t.excludeElement(extension, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase *descriptorpb.DescriptorProto:\n\t\t// Exclude all sub-elements\n\t\tfor _, descriptor := range descriptor.GetNestedType() {\n\t\t\tif err := t.excludeElement(descriptor, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, enumDescriptor := range descriptor.GetEnumType() {\n\t\t\tif err := t.excludeElement(enumDescriptor, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tfor _, extensionDescriptor := range descriptor.GetExtension() {\n\t\t\tif err := t.excludeElement(extensionDescriptor, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase *descriptorpb.EnumDescriptorProto:\n\t\t// Enum values are not included in the closure, so nothing to do here.\n\tcase *descriptorpb.ServiceDescriptorProto:\n\t\tfor _, descriptor := range descriptor.GetMethod() {\n\t\t\tif err := t.excludeElement(descriptor, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\tcase *descriptorpb.MethodDescriptorProto:\n\tcase *descriptorpb.FieldDescriptorProto:\n\t\t// Only extension fields can be excluded.\n\t\tif descriptor.Extendee == nil {\n\t\t\treturn errorUnsupportedFilterType(descriptor, descriptorInfo.fullName)\n\t\t}\n\t\tif descriptor.GetExtendee() == \"\" {\n\t\t\treturn fmt.Errorf(\"expected extendee for field %q to not be empty\", descriptorInfo.fullName)\n\t\t}\n\tdefault:\n\t\treturn errorUnsupportedFilterType(descriptor, descriptorInfo.fullName)\n\t}\n\treturn nil\n}\n\nfunc errorUnsupportedFilterType(descriptor namedDescriptor, fullName protoreflect.FullName) error {\n\tvar descriptorType string\n\tswitch d := descriptor.(type) {\n\tcase *descriptorpb.FileDescriptorProto:\n\t\tdescriptorType = \"file\"\n\tcase *descriptorpb.DescriptorProto:\n\t\tdescriptorType = \"message\"\n\tcase *descriptorpb.FieldDescriptorProto:\n\t\tif d.Extendee != nil {\n\t\t\tdescriptorType = \"extension field\"\n\t\t} else {\n\t\t\tdescriptorType = \"non-extension field\"\n\t\t}\n\tcase *descriptorpb.OneofDescriptorProto:\n\t\tdescriptorType = \"oneof\"\n\tcase *descriptorpb.EnumDescriptorProto:\n\t\tdescriptorType = \"enum\"\n\tcase *descriptorpb.EnumValueDescriptorProto:\n\t\tdescriptorType = \"enum value\"\n\tcase *descriptorpb.ServiceDescriptorProto:\n\t\tdescriptorType = \"service\"\n\tcase *descriptorpb.MethodDescriptorProto:\n\t\tdescriptorType = \"method\"\n\tdefault:\n\t\tdescriptorType = fmt.Sprintf(\"%T\", d)\n\t}\n\treturn fmt.Errorf(\"%s is unsupported filter type: %s\", fullName, descriptorType)\n}\n\nfunc (t *transitiveClosure) addEnclosing(descriptor namedDescriptor, enclosingFile string, imageIndex *imageIndex, opts *imageFilterOptions) error {\n\t// loop through all enclosing parents since nesting level\n\t// could be arbitrarily deep\n\tfor descriptor != nil {\n\t\t_, isMsg := descriptor.(*descriptorpb.DescriptorProto)\n\t\t_, isSvc := descriptor.(*descriptorpb.ServiceDescriptorProto)\n\t\t_, isFile := descriptor.(*descriptorpb.FileDescriptorProto)\n\t\tif !isMsg && !isSvc && !isFile {\n\t\t\tbreak // not an enclosing type\n\t\t}\n\t\tif _, ok := t.elements[descriptor]; ok {\n\t\t\tbreak // already in closure\n\t\t}\n\t\tt.elements[descriptor] = inclusionModeEnclosing\n\t\tif err := t.exploreCustomOptions(descriptor, enclosingFile, imageIndex, opts); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// now move into this element's parent\n\t\tdescriptor = imageIndex.ByDescriptor[descriptor].parent\n\t}\n\treturn nil\n}\n\nfunc (t *transitiveClosure) addFieldType(field *descriptorpb.FieldDescriptorProto, referrerFile string, imageIndex *imageIndex, opts *imageFilterOptions) (bool, error) {\n\tswitch field.GetType() {\n\tcase descriptorpb.FieldDescriptorProto_TYPE_ENUM,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_MESSAGE,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_GROUP:\n\t\ttypeName := protoreflect.FullName(strings.TrimPrefix(field.GetTypeName(), \".\"))\n\t\tinfo, ok := imageIndex.ByName[typeName]\n\t\tif !ok {\n\t\t\treturn false, fmt.Errorf(\"missing %q\", typeName)\n\t\t}\n\t\tif mode := t.elements[info.element]; mode == inclusionModeExcluded {\n\t\t\t// The field's type is excluded, so this field is also excluded.\n\t\t\treturn false, nil\n\t\t}\n\t\terr := t.addElement(info.element, referrerFile, false, imageIndex, opts)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\tcase descriptorpb.FieldDescriptorProto_TYPE_DOUBLE,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_FLOAT,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_INT64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_UINT64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_INT32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_FIXED64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_FIXED32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_BOOL,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_STRING,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_BYTES,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_UINT32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SFIXED32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SFIXED64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SINT32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SINT64:\n\t// nothing to follow, custom options handled below.\n\tdefault:\n\t\treturn false, fmt.Errorf(\"unknown field type %d\", field.GetType())\n\t}\n\treturn true, nil\n}\n\nfunc (t *transitiveClosure) addExtensions(\n\timageIndex *imageIndex,\n\topts *imageFilterOptions,\n) error {\n\tif !opts.includeKnownExtensions {\n\t\treturn nil // nothing to do\n\t}\n\tfor e, mode := range t.elements {\n\t\tif mode != inclusionModeExplicit {\n\t\t\t// we only collect extensions for messages that are directly reachable/referenced.\n\t\t\tcontinue\n\t\t}\n\t\tmsgDescriptor, ok := e.(*descriptorpb.DescriptorProto)\n\t\tif !ok {\n\t\t\t// not a message, nothing to do\n\t\t\tcontinue\n\t\t}\n\t\tdescriptorInfo := imageIndex.ByDescriptor[msgDescriptor]\n\t\tfor _, extendsDescriptor := range imageIndex.NameToExtensions[descriptorInfo.fullName] {\n\t\t\tif mode := t.elements[extendsDescriptor]; mode == inclusionModeExcluded {\n\t\t\t\t// This extension field is excluded.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := t.addElement(extendsDescriptor, \"\", false, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// traverseRetainedImportFiles walks import files that are present in\n// closure.imports but were added only as namespace containers\n// (inclusionModeEnclosing) for extension fields. Such files have not had\n// their own types walked, so their field-type imports are absent from\n// closure.imports. Calling addElement for each such file fills in the missing\n// entries. After processing one file, the function recurses because that\n// traversal may add further enclosing import files.\n//\n// Only used in exclude-only mode (includeTypes == nil).\nfunc (t *transitiveClosure) traverseRetainedImportFiles(\n\timage bufimage.Image,\n\timageIndex *imageIndex,\n\topts *imageFilterOptions,\n) error {\n\tfor _, file := range image.Files() {\n\t\tif !file.IsImport() {\n\t\t\tcontinue\n\t\t}\n\t\tfileDescriptorProto := file.FileDescriptorProto()\n\t\t// Only act on files retained as namespace containers; files already\n\t\t// fully traversed (Explicit/Implicit/Excluded) are skipped.\n\t\tif mode, ok := t.elements[fileDescriptorProto]; !ok || mode != inclusionModeEnclosing {\n\t\t\tcontinue\n\t\t}\n\t\t// Check whether any of this file's declared dependencies are absent\n\t\t// from the tracked import set. If all are accounted for, the closure\n\t\t// is already complete and there is nothing to do.\n\t\timportsRequired := t.imports[file.Path()]\n\t\tneedsTraversal := false\n\t\tfor _, dep := range fileDescriptorProto.GetDependency() {\n\t\t\tif _, ok := importsRequired[dep]; !ok {\n\t\t\t\tneedsTraversal = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !needsTraversal {\n\t\t\tcontinue\n\t\t}\n\t\tif err := t.addElement(fileDescriptorProto, \"\", false, imageIndex, opts); err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Recurse from the top: addElement may have introduced additional\n\t\t// enclosing import files that also need traversal.\n\t\treturn t.traverseRetainedImportFiles(image, imageIndex, opts)\n\t}\n\treturn nil\n}\n\nfunc (t *transitiveClosure) exploreCustomOptions(\n\tdescriptor proto.Message,\n\treferrerFile string,\n\timageIndex *imageIndex,\n\topts *imageFilterOptions,\n) error {\n\tif !opts.includeCustomOptions {\n\t\treturn nil\n\t}\n\n\tvar options protoreflect.Message\n\tswitch descriptor := descriptor.(type) {\n\tcase *descriptorpb.FileDescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.DescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.FieldDescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.OneofDescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.EnumDescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.EnumValueDescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.ServiceDescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.MethodDescriptorProto:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tcase *descriptorpb.DescriptorProto_ExtensionRange:\n\t\toptions = descriptor.GetOptions().ProtoReflect()\n\tdefault:\n\t\treturn fmt.Errorf(\"unexpected type for exploring options %T\", descriptor)\n\t}\n\n\toptionsName := options.Descriptor().FullName()\n\tvar err error\n\toptions.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool {\n\t\tif !t.hasOption(fd, imageIndex, opts) {\n\t\t\treturn true\n\t\t}\n\t\t// If the value contains an Any message, we should add the message type\n\t\t// therein to the closure.\n\t\tif err = t.exploreOptionValueForAny(fd, val, referrerFile, imageIndex, opts); err != nil {\n\t\t\treturn false\n\t\t}\n\n\t\t// Also include custom option definitions (e.g. extensions)\n\t\tif !fd.IsExtension() {\n\t\t\treturn true\n\t\t}\n\t\toptionsByNumber := imageIndex.NameToOptions[optionsName]\n\t\tfield, ok := optionsByNumber[int32(fd.Number())]\n\t\tif !ok {\n\t\t\t// Option is unrecognized, ignore it.\n\t\t\treturn true\n\t\t}\n\t\terr = t.addElement(field, referrerFile, true, imageIndex, opts)\n\t\treturn err == nil\n\t})\n\treturn err\n}\n\nfunc isMessageKind(k protoreflect.Kind) bool {\n\treturn k == protoreflect.MessageKind || k == protoreflect.GroupKind\n}\n\nfunc (t *transitiveClosure) exploreOptionValueForAny(\n\tfd protoreflect.FieldDescriptor,\n\tval protoreflect.Value,\n\treferrerFile string,\n\timageIndex *imageIndex,\n\topts *imageFilterOptions,\n) error {\n\tswitch {\n\tcase fd.IsMap():\n\t\tif isMessageKind(fd.MapValue().Kind()) {\n\t\t\tvar err error\n\t\t\tval.Map().Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool {\n\t\t\t\tif err = t.exploreOptionSingularValueForAny(v.Message(), referrerFile, imageIndex, opts); err != nil {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t})\n\t\t\treturn err\n\t\t}\n\tcase isMessageKind(fd.Kind()):\n\t\tif fd.IsList() {\n\t\t\tlistVal := val.List()\n\t\t\tfor i := range listVal.Len() {\n\t\t\t\tif err := t.exploreOptionSingularValueForAny(listVal.Get(i).Message(), referrerFile, imageIndex, opts); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn t.exploreOptionSingularValueForAny(val.Message(), referrerFile, imageIndex, opts)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (t *transitiveClosure) exploreOptionSingularValueForAny(\n\tmsg protoreflect.Message,\n\treferrerFile string,\n\timageIndex *imageIndex,\n\topts *imageFilterOptions,\n) error {\n\tmd := msg.Descriptor()\n\tif md.FullName() == anyFullName {\n\t\t// Found one!\n\t\ttypeURLFd := md.Fields().ByNumber(1)\n\t\tif typeURLFd.Kind() != protoreflect.StringKind || typeURLFd.IsList() {\n\t\t\t// should not be possible...\n\t\t\treturn nil\n\t\t}\n\t\ttypeURL := msg.Get(typeURLFd).String()\n\t\tpos := strings.LastIndexByte(typeURL, '/')\n\t\tmsgType := protoreflect.FullName(typeURL[pos+1:])\n\t\td, _ := imageIndex.ByName[msgType].element.(*descriptorpb.DescriptorProto)\n\t\tif d != nil {\n\t\t\tif err := t.addElement(d, referrerFile, false, imageIndex, opts); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// TODO: unmarshal the bytes to see if there are any nested Any messages\n\t\treturn nil\n\t}\n\t// keep digging\n\tvar err error\n\tmsg.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool {\n\t\terr = t.exploreOptionValueForAny(fd, val, referrerFile, imageIndex, opts)\n\t\treturn err == nil\n\t})\n\treturn err\n}\n\ntype int32Range struct {\n\tstart, end int32 // both inclusive\n}\n\nfunc freeMessageRangeStringsRec(\n\ts []string,\n\tfullName string,\n\tmessage *descriptorpb.DescriptorProto,\n) []string {\n\tfor _, nestedMessage := range message.GetNestedType() {\n\t\ts = freeMessageRangeStringsRec(s, fullName+\".\"+nestedMessage.GetName(), nestedMessage)\n\t}\n\tfreeRanges := freeMessageRanges(message)\n\tif len(freeRanges) == 0 {\n\t\treturn s\n\t}\n\tsuffixes := make([]string, len(freeRanges))\n\tfor i, freeRange := range freeRanges {\n\t\tstart := freeRange.start\n\t\tend := freeRange.end\n\t\tvar suffix string\n\t\tswitch {\n\t\tcase start == end:\n\t\t\tsuffix = fmt.Sprintf(\"%d\", start)\n\t\tcase freeRange.end == messageRangeInclusiveMax:\n\t\t\tsuffix = fmt.Sprintf(\"%d-INF\", start)\n\t\tdefault:\n\t\t\tsuffix = fmt.Sprintf(\"%d-%d\", start, end)\n\t\t}\n\t\tsuffixes[i] = suffix\n\t}\n\treturn append(s, fmt.Sprintf(\n\t\t\"%- 35s free: %s\",\n\t\tfullName,\n\t\tstrings.Join(suffixes, \" \"),\n\t))\n}\n\n// freeMessageRanges returns the free message ranges for the given message.\n//\n// Not recursive.\nfunc freeMessageRanges(message *descriptorpb.DescriptorProto) []int32Range {\n\tused := make([]int32Range, 0, len(message.GetReservedRange())+len(message.GetExtensionRange())+len(message.GetField()))\n\tfor _, reservedRange := range message.GetReservedRange() {\n\t\t// we subtract one because ranges in the proto have exclusive end\n\t\tused = append(used, int32Range{start: reservedRange.GetStart(), end: reservedRange.GetEnd() - 1})\n\t}\n\tfor _, extensionRange := range message.GetExtensionRange() {\n\t\t// we subtract one because ranges in the proto have exclusive end\n\t\tused = append(used, int32Range{start: extensionRange.GetStart(), end: extensionRange.GetEnd() - 1})\n\t}\n\tfor _, field := range message.GetField() {\n\t\tused = append(used, int32Range{start: field.GetNumber(), end: field.GetNumber()})\n\t}\n\tsort.Slice(used, func(i, j int) bool {\n\t\treturn used[i].start < used[j].start\n\t})\n\t// now compute the inverse (unused ranges)\n\tvar unused []int32Range\n\tvar last int32\n\tfor _, r := range used {\n\t\tif r.start <= last+1 {\n\t\t\tlast = r.end\n\t\t\tcontinue\n\t\t}\n\t\tunused = append(unused, int32Range{start: last + 1, end: r.start - 1})\n\t\tlast = r.end\n\t}\n\tif last < messageRangeInclusiveMax {\n\t\tunused = append(unused, int32Range{start: last + 1, end: messageRangeInclusiveMax})\n\t}\n\treturn unused\n}\n\ntype imageFilterOptions struct {\n\tincludeCustomOptions   bool\n\tincludeKnownExtensions bool\n\tallowImportedTypes     bool\n\tmutateInPlace          bool\n\tincludeTypes           map[string]struct{}\n\texcludeTypes           map[string]struct{}\n}\n\nfunc newImageFilterOptions() *imageFilterOptions {\n\treturn &imageFilterOptions{\n\t\tincludeCustomOptions:   true,\n\t\tincludeKnownExtensions: true,\n\t\tallowImportedTypes:     false,\n\t}\n}\n\nfunc stripSourceRetentionOptionsFromFile(imageFile bufimage.ImageFile) (bufimage.ImageFile, error) {\n\tfileDescriptor := imageFile.FileDescriptorProto()\n\tupdatedFileDescriptor, err := protopluginutil.StripSourceRetentionOptions(fileDescriptor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif updatedFileDescriptor == fileDescriptor {\n\t\treturn imageFile, nil\n\t}\n\treturn bufimage.NewImageFile(\n\t\tupdatedFileDescriptor,\n\t\timageFile.FullName(),\n\t\timageFile.CommitID(),\n\t\timageFile.ExternalPath(),\n\t\timageFile.LocalPath(),\n\t\timageFile.IsImport(),\n\t\timageFile.IsSyntaxUnspecified(),\n\t\timageFile.UnusedDependencyIndexes(),\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/bufimageutil_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimageutil\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"io\"\n\t\"log/slog\"\n\t\"os\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/google/uuid\"\n\t\"github.com/jhump/protoreflect/v2/protoprint\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"golang.org/x/tools/txtar\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// IF YOU HAVE ANY FAILING TESTS IN HERE, ESPECIALLY AFTER A PROTOC UPGRADE,\n// RUN THE FOLLOWING:\n// make bufimageutilupdateexpectations\n\nvar shouldUpdateExpectations = os.Getenv(\"BUFBUILD_BUF_BUFIMAGEUTIL_SHOULD_UPDATE_EXPECTATIONS\")\n\nfunc TestTypes(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"message\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.Foo.txtar\", WithIncludeTypes(\"pkg.Foo\"))\n\t})\n\tt.Run(\"enum\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooEnum.txtar\", WithIncludeTypes(\"pkg.FooEnum\"))\n\t})\n\tt.Run(\"service\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooService.txtar\", WithIncludeTypes(\"pkg.FooService\"))\n\t})\n\tt.Run(\"method\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooService.Do.txtar\", WithIncludeTypes(\"pkg.FooService.Do\"))\n\t})\n\tt.Run(\"all\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"all.txtar\", WithIncludeTypes(\"pkg.Foo\", \"pkg.FooEnum\", \"pkg.FooService\"))\n\t})\n\tt.Run(\"exclude-options\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"all-exclude-options.txtar\", WithIncludeTypes(\"pkg.Foo\", \"pkg.FooEnum\", \"pkg.FooService\"), WithExcludeCustomOptions())\n\t})\n\tt.Run(\"files\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"Files.txtar\", WithIncludeTypes(\"Files\"))\n\t})\n\tt.Run(\"all-with-files\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"all-with-Files.txtar\", WithIncludeTypes(\"pkg.Foo\", \"pkg.FooEnum\", \"pkg.FooService\", \"Files\"))\n\t})\n\n\tt.Run(\"exclude-message\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.Foo.exclude.txtar\", WithExcludeTypes(\"pkg.Foo\"))\n\t})\n\tt.Run(\"exclude-enum\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooEnum.exclude.txtar\", WithExcludeTypes(\"pkg.FooEnum\"))\n\t})\n\tt.Run(\"exclude-service\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooService.exclude.txtar\", WithExcludeTypes(\"pkg.FooService\"))\n\t})\n\tt.Run(\"exclude-method\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooService.Do.exclude.txtar\", WithExcludeTypes(\"pkg.FooService.Do\"))\n\t})\n\tt.Run(\"exclude-package\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.Pkg.exclude.txtar\", WithExcludeTypes(\"pkg\"))\n\t})\n\tt.Run(\"exclude-all\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"all.exclude.txtar\", WithExcludeTypes(\"pkg.Foo\", \"pkg.FooEnum\", \"pkg.FooService\"))\n\t})\n\n\tt.Run(\"mixed-service-method\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooService.mixed.txtar\", WithIncludeTypes(\"pkg.FooService\"), WithExcludeTypes(\"pkg.FooService.Do\"))\n\t})\n\tt.Run(\"include-service-exclude-method-types\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"pkg.FooService.exclude-method-types.txtar\", WithIncludeTypes(\"pkg.FooService\"), WithExcludeTypes(\"pkg.Empty\"))\n\t})\n\tt.Run(\"include-method-exclude-method-types\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\t_, image, err := getImage(t.Context(), slogtestext.NewLogger(t), \"testdata/options\", bufimage.WithExcludeSourceCodeInfo())\n\t\trequire.NoError(t, err)\n\t\t_, err = FilterImage(image, WithIncludeTypes(\"pkg.FooService\", \"pkg.FooService.Do\"), WithExcludeTypes(\"pkg.Empty\"))\n\t\trequire.Error(t, err)\n\t\tassert.ErrorContains(t, err, \"cannot include method \\\"pkg.FooService.Do\\\"\")\n\t})\n\n\tt.Run(\"include-extension-exclude-extendee\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\t_, image, err := getImage(t.Context(), slogtestext.NewLogger(t), \"testdata/options\", bufimage.WithExcludeSourceCodeInfo())\n\t\trequire.NoError(t, err)\n\t\t_, err = FilterImage(image, WithIncludeTypes(\"pkg.extension\"), WithExcludeTypes(\"pkg.Foo\"))\n\t\trequire.Error(t, err)\n\t\tassert.ErrorContains(t, err, \"cannot include extension field \\\"pkg.extension\\\" as the extendee type \\\"pkg.Foo\\\" is excluded\")\n\t})\n}\n\nfunc TestNesting(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"message\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"message.txtar\", WithIncludeTypes(\"pkg.Foo\"))\n\t})\n\tt.Run(\"recursenested\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"recursenested.txtar\", WithIncludeTypes(\"pkg.Foo.NestedFoo.NestedNestedFoo\"))\n\t})\n\tt.Run(\"enum\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"enum.txtar\", WithIncludeTypes(\"pkg.FooEnum\"))\n\t})\n\tt.Run(\"usingother\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"usingother.txtar\", WithIncludeTypes(\"pkg.Baz\"))\n\t})\n\n\tt.Run(\"exclude_message\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"message.exclude.txtar\", WithExcludeTypes(\"pkg.Foo\"))\n\t})\n\tt.Run(\"exclude_recursenested\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"recursenested.exclude.txtar\", WithExcludeTypes(\"pkg.Foo.NestedFoo.NestedNestedFoo\"))\n\t})\n\tt.Run(\"exclude_enum\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"enum.exclude.txtar\", WithExcludeTypes(\"pkg.FooEnum\"))\n\t})\n\tt.Run(\"exclude_usingother\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"usingother.exclude.txtar\", WithExcludeTypes(\"pkg.Baz\"))\n\t})\n\n\tt.Run(\"mixed\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/nesting\", \"mixed.txtar\", WithIncludeTypes(\"pkg.Foo\", \"pkg.FooEnum\"), WithExcludeTypes(\"pkg.Foo.NestedFoo\", \"pkg.Baz\"))\n\t})\n\n\tt.Run(\"include-excluded\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tctx := t.Context()\n\t\t_, image, err := getImage(ctx, slogtestext.NewLogger(t), \"testdata/nesting\", bufimage.WithExcludeSourceCodeInfo())\n\t\trequire.NoError(t, err)\n\t\t_, err = FilterImage(image, WithIncludeTypes(\"pkg.Foo.NestedFoo\"), WithExcludeTypes(\"pkg.Foo\"))\n\t\trequire.ErrorContains(t, err, \"inclusion of excluded type \\\"pkg.Foo.NestedFoo\\\"\")\n\t\t_, err = FilterImage(image, WithIncludeTypes(\"pkg.Foo.NestedButNotUsed\"), WithExcludeTypes(\"pkg.Foo\"))\n\t\trequire.ErrorContains(t, err, \"inclusion of excluded type \\\"pkg.Foo.NestedButNotUsed\\\"\")\n\t})\n}\n\nfunc TestOneof(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"exclude-partial\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/oneofs\", \"pkg.Foo.exclude-partial.txtar\", WithIncludeTypes(\"pkg.Foo\"), WithExcludeTypes(\"pkg.FooEnum\", \"pkg.Bar.BarNested\"))\n\t})\n\tt.Run(\"exclude-bar\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/oneofs\", \"pkg.Foo.exclude-bar.txtar\", WithIncludeTypes(\"pkg.Foo\"), WithExcludeTypes(\"pkg.FooEnum\", \"pkg.Bar\"))\n\t})\n}\n\nfunc TestOptions(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"include_option\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"options.foo.include.txtar\", WithIncludeTypes(\n\t\t\t\"message_foo\",\n\t\t\t\"field_foo\",\n\t\t\t\"oneof_foo\",\n\t\t\t\"enum_foo\",\n\t\t\t\"enum_value_foo\",\n\t\t\t\"service_foo\",\n\t\t\t\"method_foo\",\n\t\t\t\"UsedOption.file_foo\",\n\t\t))\n\t})\n\tt.Run(\"exclude_foo\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"options.foo.exclude.txtar\", WithExcludeTypes(\n\t\t\t\"message_foo\",\n\t\t\t\"field_foo\",\n\t\t\t\"oneof_foo\",\n\t\t\t\"enum_foo\",\n\t\t\t\"enum_value_foo\",\n\t\t\t\"service_foo\",\n\t\t\t\"method_foo\",\n\t\t\t\"UsedOption.file_foo\",\n\t\t))\n\t})\n\tt.Run(\"only_file\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/options\", \"options.only_file.txtar\", WithExcludeTypes(\n\t\t\t\"message_foo\", \"message_bar\", \"message_baz\",\n\t\t\t\"field_foo\", \"field_bar\", \"field_baz\",\n\t\t\t\"oneof_foo\", \"oneof_bar\", \"oneof_baz\",\n\t\t\t\"enum_foo\", \"enum_bar\", \"enum_baz\",\n\t\t\t\"enum_value_foo\", \"enum_value_bar\", \"enum_value_baz\",\n\t\t\t\"service_foo\", \"service_bar\", \"service_baz\",\n\t\t\t\"method_foo\", \"method_bar\", \"method_baz\",\n\t\t))\n\t})\n}\n\nfunc TestOptionImports(t *testing.T) {\n\tt.Parallel()\n\n\t// This checks that when excluding options the imports are correctly dropped.\n\t// For this case when both options are removed only a.proto should be left.\n\ttestdataDir := \"testdata/imports\"\n\tbucket, err := storageos.NewProvider().NewReadWriteBucket(testdataDir)\n\trequire.NoError(t, err)\n\ttestModuleData := []bufmoduletesting.ModuleData{\n\t\t{\n\t\t\tBucket: storage.FilterReadBucket(bucket, storage.MatchPathEqual(\"a.proto\")),\n\t\t},\n\t\t{\n\t\t\tBucket:      storage.FilterReadBucket(bucket, storage.MatchPathEqual(\"options.proto\")),\n\t\t\tNotTargeted: true,\n\t\t},\n\t}\n\tmoduleSet, err := bufmoduletesting.NewModuleSet(testModuleData...)\n\trequire.NoError(t, err)\n\n\t// Safe to filter the image concurrently as its not being modified.\n\timage, err := bufimage.BuildImage(\n\t\tt.Context(),\n\t\tslogtestext.NewLogger(t),\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\tbufimage.WithExcludeSourceCodeInfo(),\n\t)\n\trequire.NoError(t, err)\n\n\tt.Run(\"exclude_foo\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tgenerated, _ := runFilterImage(t, image, WithExcludeTypes(\"message_foo\"))\n\t\tcheckExpectation(t, t.Context(), generated, bucket, \"foo.txtar\")\n\t})\n\tt.Run(\"exclude_foo_bar\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tgenerated, _ := runFilterImage(t, image, WithExcludeTypes(\"message_foo\", \"message_bar\"))\n\t\tcheckExpectation(t, t.Context(), generated, bucket, \"foo_bar.txtar\")\n\t})\n\tt.Run(\"exclude_bar\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tgenerated, _ := runFilterImage(t, image, WithIncludeTypes(\"pkg.Foo\"), WithExcludeTypes(\"message_bar\"))\n\t\tcheckExpectation(t, t.Context(), generated, bucket, \"bar.txtar\")\n\t})\n}\n\nfunc TestImportModifiers(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"regular_weak\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/importmods\", \"regular_weak.txtar\", WithIncludeTypes(\"ImportRegular\", \"ImportWeak\"))\n\t})\n\tt.Run(\"weak_public\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/importmods\", \"weak_public.txtar\", WithIncludeTypes(\"ImportWeak\", \"ImportPublic\"))\n\t})\n\tt.Run(\"regular_public\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/importmods\", \"regular_public.txtar\", WithIncludeTypes(\"ImportRegular\", \"ImportPublic\"))\n\t})\n\tt.Run(\"noimports\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/importmods\", \"noimports.txtar\", WithIncludeTypes(\"NoImports\"))\n\t})\n}\n\nfunc TestExtensions(t *testing.T) {\n\tt.Parallel()\n\trunDiffTest(t, \"testdata/extensions\", \"extensions.txtar\", WithIncludeTypes(\"pkg.Foo\"))\n\trunDiffTest(t, \"testdata/extensions\", \"extensions-excluded.txtar\", WithExcludeKnownExtensions(), WithIncludeTypes(\"pkg.Foo\"))\n}\n\nfunc TestPackages(t *testing.T) {\n\tt.Parallel()\n\trunDiffTest(t, \"testdata/packages\", \"root.txtar\", WithIncludeTypes(\"\"))\n\trunDiffTest(t, \"testdata/packages\", \"foo.txtar\", WithIncludeTypes(\"foo\"))\n\trunDiffTest(t, \"testdata/packages\", \"foo.bar.txtar\", WithIncludeTypes(\"foo.bar\"))\n\trunDiffTest(t, \"testdata/packages\", \"foo.bar.baz.txtar\", WithIncludeTypes(\"foo.bar.baz\"))\n}\n\nfunc TestAny(t *testing.T) {\n\tt.Parallel()\n\trunDiffTest(t, \"testdata/any\", \"c1.txtar\", WithIncludeTypes(\"ExtendedAnySyntax\"))\n\trunDiffTest(t, \"testdata/any\", \"c2.txtar\", WithIncludeTypes(\"ExtendedAnySyntax_InField\"))\n\trunDiffTest(t, \"testdata/any\", \"c3.txtar\", WithIncludeTypes(\"ExtendedAnySyntax_InList\"))\n\trunDiffTest(t, \"testdata/any\", \"c4.txtar\", WithIncludeTypes(\"ExtendedAnySyntax_InMap\"))\n\trunDiffTest(t, \"testdata/any\", \"d.txtar\", WithIncludeTypes(\"NormalMessageSyntaxValidType\"))\n\trunDiffTest(t, \"testdata/any\", \"e.txtar\", WithIncludeTypes(\"NormalMessageSyntaxInvalidType\"))\n}\n\nfunc TestSourceCodeInfo(t *testing.T) {\n\tt.Parallel()\n\tnoExts := []ImageFilterOption{WithExcludeCustomOptions(), WithExcludeKnownExtensions()}\n\trunSourceCodeInfoTest(t, \"foo.bar.Foo\", \"Foo.txtar\", noExts...)\n\trunSourceCodeInfoTest(t, \"foo.bar.Foo\", \"Foo+Ext.txtar\")\n\trunSourceCodeInfoTest(t, \"foo.bar.Foo.NestedFoo\", \"NestedFoo.txtar\", noExts...)\n\trunSourceCodeInfoTest(t, \"foo.bar.Bar\", \"Bar.txtar\", noExts...)\n\trunSourceCodeInfoTest(t, \"foo.bar.Baz\", \"Baz.txtar\", noExts...)\n\trunSourceCodeInfoTest(t, \"foo.bar.Quz\", \"Quz.txtar\", noExts...)\n\trunSourceCodeInfoTest(t, \"foo.bar.Svc\", \"Svc.txtar\", noExts...)\n\trunSourceCodeInfoTest(t, \"foo.bar.Svc.Do\", \"Do.txtar\", noExts...)\n\trunSourceCodeInfoTest(t, \"foo.bar\", \"all.txtar\")\n}\n\nfunc TestUnusedDeps(t *testing.T) {\n\tt.Parallel()\n\trunDiffTest(t, \"testdata/unuseddeps\", \"a.txtar\", WithIncludeTypes(\"a.A\"))\n\trunDiffTest(t, \"testdata/unuseddeps\", \"ab.txtar\", WithIncludeTypes(\"a.A\"), WithExcludeTypes(\"b.B\"))\n}\n\nfunc TestTransitivePublic(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tmoduleSet, err := bufmoduletesting.NewModuleSetForPathToData(\n\t\tmap[string][]byte{\n\t\t\t\"a.proto\": []byte(`syntax = \"proto3\";package a;message Foo{}`),\n\t\t\t\"b.proto\": []byte(`syntax = \"proto3\";package b;import public \"a.proto\";message Bar {}`),\n\t\t\t\"c.proto\": []byte(`syntax = \"proto3\";package c;import \"b.proto\";message Baz{ a.Foo foo = 1; }`),\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\tbufimage.WithExcludeSourceCodeInfo(),\n\t)\n\trequire.NoError(t, err)\n\n\tfilteredImage, err := FilterImage(image, WithIncludeTypes(\"c.Baz\"))\n\trequire.NoError(t, err)\n\n\t_, err = protodesc.NewFiles(bufimage.ImageToFileDescriptorSet(filteredImage))\n\trequire.NoError(t, err)\n}\n\nfunc TestTypesFromMainModule(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\tmoduleSet, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/repo/main\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"a.proto\": []byte(`syntax = \"proto3\";import \"b.proto\";package pkg;message Foo { dependency.Dep bar = 1;}`),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/repo/dep\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"b.proto\": []byte(`syntax = \"proto3\";package dependency; message Dep{}`),\n\t\t\t},\n\t\t\tNotTargeted: true,\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tslogtestext.NewLogger(t),\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\tbufimage.WithExcludeSourceCodeInfo(),\n\t)\n\trequire.NoError(t, err)\n\n\tdep := moduleSet.GetModuleForOpaqueID(\"buf.build/repo/dep\")\n\trequire.NotNil(t, dep)\n\tbProtoFileInfo, err := dep.StatFileInfo(ctx, \"b.proto\")\n\trequire.NoError(t, err)\n\trequire.False(t, bProtoFileInfo.IsTargetFile())\n\t_, err = FilterImage(image, WithIncludeTypes(\"dependency.Dep\"))\n\trequire.Error(t, err)\n\tassert.ErrorIs(t, err, ErrImageFilterTypeIsImport)\n\n\t// allowed if we specify option\n\t_, err = FilterImage(image, WithIncludeTypes(\"dependency.Dep\"), WithAllowIncludeOfImportedType())\n\trequire.NoError(t, err)\n\n\t_, err = FilterImage(image, WithIncludeTypes(\"nonexisting\"))\n\trequire.Error(t, err)\n\tassert.ErrorIs(t, err, ErrImageFilterTypeNotFound)\n}\n\nfunc TestMutateInPlace(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\t_, image, err := getImage(ctx, slogtestext.NewLogger(t), \"testdata/options\")\n\trequire.NoError(t, err)\n\n\taProtoFile := image.GetFile(\"a.proto\")\n\taFileDescriptorProto := aProtoFile.FileDescriptorProto()\n\tassert.Len(t, aFileDescriptorProto.MessageType, 2) // Foo, Empty\n\tassert.Len(t, aFileDescriptorProto.EnumType, 1)    // FooEnum\n\tassert.Len(t, aFileDescriptorProto.Service, 1)\n\n\tlocationLen := len(aFileDescriptorProto.SourceCodeInfo.Location)\n\n\t// Shallow copy\n\tshallowFilteredImage, err := FilterImage(image, WithIncludeTypes(\"pkg.Foo\"))\n\trequire.NoError(t, err)\n\n\tfilteredAFileDescriptorProto := shallowFilteredImage.GetFile(\"a.proto\").FileDescriptorProto()\n\tassert.NotSame(t, aFileDescriptorProto, filteredAFileDescriptorProto)\n\tfilterLocationLen := len(filteredAFileDescriptorProto.SourceCodeInfo.Location)\n\tassert.Less(t, filterLocationLen, locationLen)\n\n\t// Mutate in place\n\tmutateFilteredImage, err := FilterImage(image, WithIncludeTypes(\"pkg.Foo\"), WithMutateInPlace())\n\trequire.NoError(t, err)\n\n\t// Check that the original image was mutated\n\tassert.Same(t, aFileDescriptorProto, mutateFilteredImage.GetFile(\"a.proto\").FileDescriptorProto())\n\tassert.Len(t, aFileDescriptorProto.MessageType, 1) // Foo\n\tif assert.GreaterOrEqual(t, cap(aFileDescriptorProto.MessageType), 2) {\n\t\tslice := aFileDescriptorProto.MessageType[1:cap(aFileDescriptorProto.MessageType)]\n\t\tfor _, elem := range slice {\n\t\t\tassert.Nil(t, elem) // Empty\n\t\t}\n\t}\n\tassert.Nil(t, aFileDescriptorProto.EnumType)\n\tassert.Nil(t, aFileDescriptorProto.Service)\n\tassert.Equal(t, filterLocationLen, len(aFileDescriptorProto.SourceCodeInfo.Location))\n}\n\nfunc TestConsecutiveFilters(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\t_, image, err := getImage(ctx, slogtestext.NewLogger(t), \"testdata/options\")\n\trequire.NoError(t, err)\n\n\tt.Run(\"options\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfilteredImage, err := FilterImage(image, WithIncludeTypes(\"pkg.Foo\"), WithExcludeTypes(\"message_baz\"))\n\t\trequire.NoError(t, err)\n\t\t_, err = FilterImage(filteredImage, WithExcludeTypes(\"message_foo\"))\n\t\trequire.NoError(t, err)\n\t})\n}\n\nfunc TestDependencies(t *testing.T) {\n\tt.Parallel()\n\t// Test referred file for options of imported types.\n\tt.Run(\"FieldA\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/deps\", \"test.FieldA.txtar\", WithIncludeTypes(\"test.FieldA\"))\n\t})\n\tt.Run(\"EnumA\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/deps\", \"test.EnumA.txtar\", WithIncludeTypes(\"test.EnumA\"))\n\t})\n\tt.Run(\"PublicOrder\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/deps\", \"test.PublicOrder.txtar\", WithIncludeTypes(\"test.PublicOrder\"))\n\t})\n\t// Test an included type with implicitly excluded extensions fields.\n\tt.Run(\"IncludeWithExcludeExtensions\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/deps\", \"test.IncludeWithExcludeExt.txtar\", WithIncludeTypes(\"google.protobuf.MessageOptions\"), WithExcludeTypes(\"a\", \"b\", \"c\"), WithAllowIncludeOfImportedType())\n\t})\n}\n\n// TestExcludeImportFileDependencies is a regression test for a bug where\n// excluding a package caused import files that were retained in the image\n// (because their extension fields were used) to lose their own transitive\n// dependencies.\n//\n// Concretely: user.proto uses an extension from opt.proto; opt.proto has a\n// message that references dep.DepMessage from dep.proto. When excluding the\n// \"excluded\" package, dep.proto must still be retained because opt.proto\n// depends on it.\nfunc TestExcludeImportFileDependencies(t *testing.T) {\n\tt.Parallel()\n\n\ttestdataDir := \"testdata/exclude_import_deps\"\n\tbucket, err := storageos.NewProvider().NewReadWriteBucket(testdataDir)\n\trequire.NoError(t, err)\n\ttestModuleData := []bufmoduletesting.ModuleData{\n\t\t{\n\t\t\tBucket: storage.FilterReadBucket(bucket, storage.MatchPathEqual(\"user.proto\")),\n\t\t},\n\t\t{\n\t\t\tBucket:      storage.FilterReadBucket(bucket, storage.MatchNot(storage.MatchPathEqual(\"user.proto\"))),\n\t\t\tNotTargeted: true,\n\t\t},\n\t}\n\tmoduleSet, err := bufmoduletesting.NewModuleSet(testModuleData...)\n\trequire.NoError(t, err)\n\timage, err := bufimage.BuildImage(\n\t\tt.Context(),\n\t\tslogtestext.NewLogger(t),\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\tbufimage.WithExcludeSourceCodeInfo(),\n\t)\n\trequire.NoError(t, err)\n\n\t// Excluding \"excluded\" should not drop dep.proto from the image.\n\t// opt.proto is retained because its extension is used by user.proto.\n\t// opt.proto depends on dep.proto, so dep.proto must also be retained.\n\t// Before the fix, dep.proto was silently dropped and protodesc.NewFiles\n\t// would fail with \"type_name .dep.DepMessage not found\".\n\trunFilterImage(t, image, WithExcludeTypes(\"excluded\"))\n}\n\nfunc TestEmptyFiles(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"include_empty_file\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/empty\", \"empty.include.txtar\", WithIncludeTypes(\"include\"))\n\t})\n\tt.Run(\"exclude_empty_file\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trunDiffTest(t, \"testdata/empty\", \"empty.exclude.txtar\", WithExcludeTypes(\"include\"))\n\t})\n}\n\nfunc getImage(ctx context.Context, logger *slog.Logger, testdataDir string, options ...bufimage.BuildImageOption) (storage.ReadWriteBucket, bufimage.Image, error) {\n\tbucket, err := storageos.NewProvider().NewReadWriteBucket(testdataDir)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tmoduleSet, err := bufmoduletesting.NewModuleSetForBucket(bucket)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\timage, err := bufimage.BuildImage(\n\t\tctx,\n\t\tlogger,\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\toptions...,\n\t)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn bucket, image, nil\n}\n\nfunc runDiffTest(t *testing.T, testdataDir string, expectedFile string, opts ...ImageFilterOption) {\n\tctx := t.Context()\n\tbucket, image, err := getImage(ctx, slogtestext.NewLogger(t), testdataDir, bufimage.WithExcludeSourceCodeInfo())\n\trequire.NoError(t, err)\n\tgenerated, _ := runFilterImage(t, image, opts...)\n\tcheckExpectation(t, ctx, generated, bucket, expectedFile)\n}\n\nfunc runFilterImage(t *testing.T, image bufimage.Image, opts ...ImageFilterOption) ([]byte, bufimage.Image) {\n\tfilteredImage, err := FilterImage(image, opts...)\n\trequire.NoError(t, err)\n\tassert.NotNil(t, filteredImage)\n\tassert.True(t, imageIsDependencyOrdered(filteredImage), \"image files not in dependency order\")\n\n\t// Convert the filtered image back to a proto image and then back to an image to ensure that the\n\t// image is still valid after filtering.\n\tprotoImage, err := bufimage.ImageToProtoImage(filteredImage)\n\trequire.NoError(t, err)\n\t// Clone here as `bufimage.NewImageForProto` mutates protoImage.\n\tprotoImage = proto.CloneOf(protoImage)\n\tfilteredImage, err = bufimage.NewImageForProto(protoImage)\n\trequire.NoError(t, err)\n\n\t// We may have filtered out custom options from the set in the step above. However, the options messages\n\t// still contain extension fields that refer to the custom options, as a result of building the image.\n\t// So we serialize and then de-serialize, and use only the filtered results to parse extensions. That way,\n\t// the result will omit custom options that aren't present in the filtered set (as they will be considered\n\t// unrecognized fields).\n\tfileDescriptorSet := &descriptorpb.FileDescriptorSet{\n\t\tFile: xslices.Map(filteredImage.Files(), func(imageFile bufimage.ImageFile) *descriptorpb.FileDescriptorProto {\n\t\t\treturn imageFile.FileDescriptorProto()\n\t\t}),\n\t}\n\n\tfiles, err := protodesc.NewFiles(fileDescriptorSet)\n\trequire.NoError(t, err)\n\n\tarchive := &txtar.Archive{}\n\tprinter := protoprint.Printer{\n\t\tSortElements: true,\n\t\tCompact:      true,\n\t}\n\tfiles.RangeFiles(func(fileDescriptor protoreflect.FileDescriptor) bool {\n\t\tfileBuilder := &bytes.Buffer{}\n\t\trequire.NoError(t, printer.PrintProtoFile(fileDescriptor, fileBuilder), \"expected no error while printing %q\", fileDescriptor.Path())\n\t\tarchive.Files = append(\n\t\t\tarchive.Files,\n\t\t\ttxtar.File{\n\t\t\t\tName: fileDescriptor.Path(),\n\t\t\t\tData: fileBuilder.Bytes(),\n\t\t\t},\n\t\t)\n\t\treturn true\n\t})\n\tsort.SliceStable(archive.Files, func(i, j int) bool {\n\t\treturn archive.Files[i].Name < archive.Files[j].Name\n\t})\n\tgenerated := txtar.Format(archive)\n\treturn generated, filteredImage\n}\n\nfunc checkExpectation(t *testing.T, ctx context.Context, actual []byte, bucket storage.ReadWriteBucket, expectedFile string) {\n\tif shouldUpdateExpectations != \"\" {\n\t\twriter, err := bucket.Put(ctx, expectedFile)\n\t\trequire.NoError(t, err)\n\t\t_, err = writer.Write(actual)\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, writer.Close())\n\t} else {\n\t\texpectedReader, err := bucket.Get(ctx, expectedFile)\n\t\trequire.NoError(t, err)\n\t\texpected, err := io.ReadAll(expectedReader)\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, string(expected), string(actual))\n\t}\n}\n\nfunc runSourceCodeInfoTest(t *testing.T, typename string, expectedFile string, opts ...ImageFilterOption) {\n\tctx := t.Context()\n\tbucket, image, err := getImage(ctx, slogtestext.NewLogger(t), \"testdata/sourcecodeinfo\")\n\trequire.NoError(t, err)\n\n\topts = append(opts, WithIncludeTypes(typename))\n\tgenerated, image := runFilterImage(t, image, opts...)\n\tfilteredImage, err := FilterImage(image, opts...)\n\trequire.NoError(t, err)\n\n\timageFile := filteredImage.GetFile(\"test.proto\")\n\tsourceCodeInfo := imageFile.FileDescriptorProto().GetSourceCodeInfo()\n\tactual, err := protoencoding.NewJSONMarshaler(nil, protoencoding.JSONMarshalerWithIndent()).Marshal(sourceCodeInfo)\n\trequire.NoError(t, err)\n\tgenerated = append(generated, []byte(\"-- source_code_info.json --\\n\")...)\n\tgenerated = append(generated, actual...)\n\n\tcheckExpectation(t, ctx, generated, bucket, expectedFile)\n\n\tresolver, err := protoencoding.NewResolver(bufimage.ImageToFileDescriptorProtos(filteredImage)...)\n\trequire.NoError(t, err)\n\tfile, err := resolver.FindFileByPath(\"test.proto\")\n\trequire.NoError(t, err)\n\texamineComments(t, file)\n}\n\nfunc imageIsDependencyOrdered(image bufimage.Image) bool {\n\tseen := make(map[string]struct{})\n\tfor _, imageFile := range image.Files() {\n\t\tfor _, importName := range imageFile.FileDescriptorProto().Dependency {\n\t\t\tif _, ok := seen[importName]; !ok {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\tseen[imageFile.Path()] = struct{}{}\n\t}\n\treturn true\n}\n\nfunc examineComments(t *testing.T, file protoreflect.FileDescriptor) {\n\texamineCommentsInTypeContainer(t, file, file)\n\tsvcs := file.Services()\n\tfor i, numSvcs := 0, svcs.Len(); i < numSvcs; i++ {\n\t\tsvc := svcs.Get(i)\n\t\texamineComment(t, file, svc)\n\t\tmethods := svc.Methods()\n\t\tfor j, numMethods := 0, methods.Len(); j < numMethods; j++ {\n\t\t\tmethod := methods.Get(j)\n\t\t\texamineComment(t, file, method)\n\t\t}\n\t}\n}\n\ntype typeContainer interface {\n\tMessages() protoreflect.MessageDescriptors\n\tEnums() protoreflect.EnumDescriptors\n\tExtensions() protoreflect.ExtensionDescriptors\n}\n\nfunc examineCommentsInTypeContainer(t *testing.T, file protoreflect.FileDescriptor, descriptor typeContainer) {\n\tmsgs := descriptor.Messages()\n\tfor i, numMsgs := 0, msgs.Len(); i < numMsgs; i++ {\n\t\tmsg := msgs.Get(i)\n\t\texamineComment(t, file, msg)\n\t\tfields := msg.Fields()\n\t\tfor j, numFields := 0, fields.Len(); j < numFields; j++ {\n\t\t\tfield := fields.Get(j)\n\t\t\texamineComment(t, file, field)\n\t\t}\n\t\toneofs := msg.Oneofs()\n\t\tfor j, numOneofs := 0, oneofs.Len(); j < numOneofs; j++ {\n\t\t\toneof := oneofs.Get(j)\n\t\t\texamineComment(t, file, oneof)\n\t\t}\n\t\texamineCommentsInTypeContainer(t, file, msg)\n\t}\n\tenums := descriptor.Enums()\n\tfor i, numEnums := 0, enums.Len(); i < numEnums; i++ {\n\t\tenum := enums.Get(i)\n\t\texamineComment(t, file, enum)\n\t\tvals := enum.Values()\n\t\tfor j, numVals := 0, vals.Len(); j < numVals; j++ {\n\t\t\tval := vals.Get(j)\n\t\t\texamineComment(t, file, val)\n\t\t}\n\t}\n\texts := descriptor.Extensions()\n\tfor i, numExts := 0, exts.Len(); i < numExts; i++ {\n\t\text := exts.Get(i)\n\t\texamineComment(t, file, ext)\n\t}\n}\n\nfunc examineComment(t *testing.T, file protoreflect.FileDescriptor, descriptor protoreflect.Descriptor) {\n\tloc := file.SourceLocations().ByDescriptor(descriptor)\n\tif loc.LeadingComments == \"\" {\n\t\t// Messages that are only present because they are namespaces that contains a retained\n\t\t// type will not have a comment. So we can skip the comment check for that case.\n\t\tif msg, ok := descriptor.(protoreflect.MessageDescriptor); ok && msg.Fields().Len() == 0 {\n\t\t\treturn\n\t\t}\n\t}\n\t// Verify we got the correct location by checking that the comment contains the element's name\n\trequire.Contains(t, loc.LeadingComments, string(descriptor.Name()))\n}\n\nfunc BenchmarkFilterImage_WithoutSourceCodeInfo(b *testing.B) {\n\tbenchmarkFilterImage(b, bufimage.WithExcludeSourceCodeInfo())\n}\n\nfunc BenchmarkFilterImage_WithSourceCodeInfo(b *testing.B) {\n\tbenchmarkFilterImage(b)\n}\n\nfunc benchmarkFilterImage(b *testing.B, opts ...bufimage.BuildImageOption) {\n\tbenchmarkCases := []*struct {\n\t\tfolder string\n\t\timage  bufimage.Image\n\t\ttypes  []string\n\t}{\n\t\t{\n\t\t\tfolder: \"testdata/extensions\",\n\t\t\ttypes:  []string{\"pkg.Foo\"},\n\t\t},\n\t\t{\n\t\t\tfolder: \"testdata/importmods\",\n\t\t\ttypes:  []string{\"ImportRegular\", \"ImportWeak\", \"ImportPublic\", \"NoImports\"},\n\t\t},\n\t\t{\n\t\t\tfolder: \"testdata/nesting\",\n\t\t\ttypes:  []string{\"pkg.Foo\", \"pkg.Foo.NestedFoo.NestedNestedFoo\", \"pkg.Baz\", \"pkg.FooEnum\"},\n\t\t},\n\t\t{\n\t\t\tfolder: \"testdata/options\",\n\t\t\ttypes:  []string{\"pkg.Foo\", \"pkg.FooEnum\", \"pkg.FooService\", \"pkg.FooService.Do\"},\n\t\t},\n\t}\n\tctx := b.Context()\n\tfor _, benchmarkCase := range benchmarkCases {\n\t\t_, image, err := getImage(ctx, slogtestext.NewLogger(b, slogtestext.WithLogLevel(appext.LogLevelError)), benchmarkCase.folder, opts...)\n\t\trequire.NoError(b, err)\n\t\tbenchmarkCase.image = image\n\t}\n\tb.ResetTimer()\n\n\ti := 0\n\tfor {\n\t\tfor _, benchmarkCase := range benchmarkCases {\n\t\t\tfor _, typeName := range benchmarkCase.types {\n\t\t\t\t// filtering is destructive, so we have to make a copy\n\t\t\t\tb.StopTimer()\n\t\t\t\timageFiles := make([]bufimage.ImageFile, len(benchmarkCase.image.Files()))\n\t\t\t\tfor j, imageFile := range benchmarkCase.image.Files() {\n\t\t\t\t\tclone := proto.CloneOf(imageFile.FileDescriptorProto())\n\t\t\t\t\tvar err error\n\t\t\t\t\timageFiles[j], err = bufimage.NewImageFile(clone, nil, uuid.Nil, \"\", \"\", false, false, nil)\n\t\t\t\t\trequire.NoError(b, err)\n\t\t\t\t}\n\t\t\t\timage, err := bufimage.NewImage(imageFiles)\n\t\t\t\trequire.NoError(b, err)\n\t\t\t\tb.StartTimer()\n\n\t\t\t\t_, err = FilterImage(image, WithIncludeTypes(typeName), WithMutateInPlace())\n\t\t\t\trequire.NoError(b, err)\n\t\t\t\ti++\n\t\t\t\tif i == b.N {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/image_filter.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimageutil\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// filterImage filters the Image for the given options.\nfunc filterImage(image bufimage.Image, options *imageFilterOptions) (bufimage.Image, error) {\n\timageIndex, err := newImageIndexForImage(image, options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tclosure := newTransitiveClosure()\n\t// All excludes are added first, then includes walk included all non excluded types.\n\t// TODO: consider supporting a glob syntax of some kind, to do more advanced pattern\n\t//   matching, such as ability to get a package AND all of its sub-packages.\n\tfor excludeType := range options.excludeTypes {\n\t\texcludeType := protoreflect.FullName(excludeType)\n\t\tif err := closure.excludeType(excludeType, imageIndex, options); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfor includeType := range options.includeTypes {\n\t\tincludeType := protoreflect.FullName(includeType)\n\t\tif err := closure.includeType(includeType, imageIndex, options); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// TODO: No types were included, so include everything. This can be\n\t// removed when we are able to handle finding all required imports\n\t// below, when remapping the descriptor.\n\tif len(options.includeTypes) == 0 {\n\t\tfor _, file := range image.Files() {\n\t\t\tif file.IsImport() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// Check if target package is filtered, this is not an error.\n\t\t\t// These includes are implicitly added to the closure.\n\t\t\tfileDescriptorProto := file.FileDescriptorProto()\n\t\t\tif mode := closure.elements[fileDescriptorProto]; mode == inclusionModeExcluded {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif err := closure.addElement(fileDescriptorProto, \"\", false, imageIndex, options); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\t// Import files that were pulled in only as namespace containers for\n\t\t// extension fields haven't had their own types walked, so their\n\t\t// field-type dependencies are absent from closure.imports. Traverse\n\t\t// those files now, recursing until the closure is stable.\n\t\tif err := closure.traverseRetainedImportFiles(image, imageIndex, options); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// After all types are added, add their known extensions\n\tif err := closure.addExtensions(imageIndex, options); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Loop over image files in revserse DAG order. Imports that are no longer\n\t// imported by a previous file are dropped from the image.\n\tdirty := false\n\tnewImageFiles := make([]bufimage.ImageFile, 0, len(image.Files()))\n\tfor _, imageFile := range slices.Backward(image.Files()) {\n\t\timageFilePath := imageFile.Path()\n\t\t// Check if the file is used.\n\t\tif _, ok := closure.imports[imageFilePath]; !ok {\n\t\t\tcontinue // Filtered out.\n\t\t}\n\t\tnewImageFile, err := filterImageFile(\n\t\t\timageFile,\n\t\t\timageIndex,\n\t\t\tclosure,\n\t\t\toptions,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdirty = dirty || newImageFile != imageFile\n\t\tif newImageFile == nil {\n\t\t\t// The file was filtered out. Check if it was used by another file.\n\t\t\tfor filePath, dependencies := range closure.imports {\n\t\t\t\tif _, isImported := dependencies[imageFilePath]; isImported {\n\t\t\t\t\treturn nil, syserror.Newf(\"file %q was filtered out, but is still used by %q\", imageFilePath, filePath)\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Currently, with an explicitly included type we add the extensions\n\t\t\t// to the import list. If all the extension fields types are excluded,\n\t\t\t// the file may be empty. The import list still contains the empty file.\n\t\t\t// Skip the file. See: TestDeps/IncludeWithExcludeExtensions\n\t\t\tcontinue\n\t\t}\n\t\tnewImageFiles = append(newImageFiles, newImageFile)\n\t}\n\tif !dirty {\n\t\treturn image, nil\n\t}\n\t// Reverse the image files back to DAG order.\n\tslices.Reverse(newImageFiles)\n\treturn bufimage.NewImage(newImageFiles)\n}\n\nfunc filterImageFile(\n\timageFile bufimage.ImageFile,\n\timageIndex *imageIndex,\n\tclosure *transitiveClosure,\n\toptions *imageFilterOptions,\n) (bufimage.ImageFile, error) {\n\tfileDescriptor := imageFile.FileDescriptorProto()\n\tvar sourcePathsRemap sourcePathsRemapTrie\n\tbuilder := sourcePathsBuilder{\n\t\timageIndex: imageIndex,\n\t\tclosure:    closure,\n\t\toptions:    options,\n\t}\n\tnewFileDescriptor, changed, err := builder.remapFileDescriptor(&sourcePathsRemap, fileDescriptor)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif newFileDescriptor == nil {\n\t\treturn nil, nil // Filtered out.\n\t}\n\tif !changed {\n\t\tif len(sourcePathsRemap) > 0 {\n\t\t\treturn nil, syserror.Newf(\"unexpected %d sourcePathsRemaps\", len(sourcePathsRemap))\n\t\t}\n\t\treturn imageFile, nil // No changes required.\n\t}\n\n\t// Remap the source code info.\n\tif locations := fileDescriptor.SourceCodeInfo.GetLocation(); len(locations) > 0 {\n\t\tnewLocations := make([]*descriptorpb.SourceCodeInfo_Location, 0, len(locations))\n\t\tfor _, location := range locations {\n\t\t\toldPath := location.Path\n\t\t\tnewPath, noComment := sourcePathsRemap.newPath(oldPath)\n\t\t\tif newPath == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif noComment || !slices.Equal(oldPath, newPath) {\n\t\t\t\tlocation = maybeClone(location, options)\n\t\t\t\tlocation.Path = newPath\n\t\t\t}\n\t\t\tif noComment {\n\t\t\t\tlocation.LeadingDetachedComments = nil\n\t\t\t\tlocation.LeadingComments = nil\n\t\t\t\tlocation.TrailingComments = nil\n\t\t\t}\n\t\t\tnewLocations = append(newLocations, location)\n\t\t}\n\t\tnewFileDescriptor.SourceCodeInfo = &descriptorpb.SourceCodeInfo{\n\t\t\tLocation: newLocations,\n\t\t}\n\t}\n\treturn bufimage.NewImageFile(\n\t\tnewFileDescriptor,\n\t\timageFile.FullName(),\n\t\timageFile.CommitID(),\n\t\timageFile.ExternalPath(),\n\t\timageFile.LocalPath(),\n\t\timageFile.IsImport(),\n\t\timageFile.IsSyntaxUnspecified(),\n\t\tnil, // There are no unused dependencies.\n\t)\n}\n\n// sourcePathsBuilder is a helper for building the new source paths.\n// Each method return the new value, whether it was changed, and an error if any.\n// The value is nil if it was filtered out.\ntype sourcePathsBuilder struct {\n\timageIndex *imageIndex\n\tclosure    *transitiveClosure\n\toptions    *imageFilterOptions\n}\n\nfunc (b *sourcePathsBuilder) remapFileDescriptor(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tfileDescriptor *descriptorpb.FileDescriptorProto,\n) (*descriptorpb.FileDescriptorProto, bool, error) {\n\tif !b.closure.hasType(fileDescriptor, b.options) {\n\t\treturn nil, true, nil\n\t}\n\n\tsourcePath := make(protoreflect.SourcePath, 0, 8)\n\n\t// Walk the file descriptor.\n\tisDirty := false\n\tnewMessages, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, fileMessagesTag), fileDescriptor.MessageType, b.remapDescriptor, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewEnums, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, fileEnumsTag), fileDescriptor.EnumType, b.remapEnum, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewServices, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, fileServicesTag), fileDescriptor.Service, b.remapService, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewExtensions, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, fileExtensionsTag), fileDescriptor.Extension, b.remapField, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, fileOptionsTag), fileDescriptor.Options, b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewDependencies, newPublicDependencies, newWeakDependencies, changed, err := b.remapDependencies(sourcePathsRemap, sourcePath, fileDescriptor)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tif !isDirty {\n\t\treturn fileDescriptor, false, nil\n\t}\n\n\tnewFileDescriptor := maybeClone(fileDescriptor, b.options)\n\tnewFileDescriptor.MessageType = newMessages\n\tnewFileDescriptor.EnumType = newEnums\n\tnewFileDescriptor.Service = newServices\n\tnewFileDescriptor.Extension = newExtensions\n\tnewFileDescriptor.Options = newOptions\n\tnewFileDescriptor.Dependency = newDependencies\n\tnewFileDescriptor.PublicDependency = newPublicDependencies\n\tnewFileDescriptor.WeakDependency = newWeakDependencies\n\treturn newFileDescriptor, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapDependencies(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tfileDescriptor *descriptorpb.FileDescriptorProto,\n) ([]string, []int32, []int32, bool, error) {\n\tdependencies := fileDescriptor.GetDependency()\n\tpublicDependencies := fileDescriptor.GetPublicDependency()\n\tweakDependencies := fileDescriptor.GetWeakDependency()\n\t// TODO: Add support for option dependencies when buf CLI supports edition 2024.\n\tif len(fileDescriptor.GetOptionDependency()) > 0 {\n\t\treturn nil, nil, nil, false, errors.New(\"edition 2024 not yet supported: cannot filter a file descriptor with option dependencies\")\n\t}\n\n\t// Check if the imports need to be remapped.\n\timportsRequired := b.closure.imports[fileDescriptor.GetName()]\n\timportsCount := len(importsRequired)\n\tfor _, importPath := range dependencies {\n\t\tif _, ok := importsRequired[importPath]; ok {\n\t\t\timportsCount--\n\t\t} else {\n\t\t\timportsCount = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tif importsCount == 0 && len(publicDependencies) == 0 {\n\t\t// Imports match and no public dependencies.\n\t\treturn dependencies, publicDependencies, weakDependencies, false, nil\n\t}\n\n\tvar newDependencies []string\n\tif b.options.mutateInPlace {\n\t\tnewDependencies = dependencies[:0]\n\t}\n\tdependencyPath := append(sourcePath, fileDependencyTag)\n\tdependencyChanges := make([]int32, len(dependencies))\n\tindexTo := int32(0)\n\tfor i, importPath := range dependencies {\n\t\tindexFrom := int32(i)\n\t\tpath := append(dependencyPath, indexFrom)\n\t\tif _, ok := importsRequired[importPath]; ok {\n\t\t\tdependencyChanges[indexFrom] = indexTo\n\t\t\tif indexTo != indexFrom {\n\t\t\t\tsourcePathsRemap.markMoved(path, indexTo)\n\t\t\t}\n\t\t\tnewDependencies = append(newDependencies, importPath)\n\t\t\tindexTo++\n\t\t\t// delete them as we go, so we know which ones weren't in the list\n\t\t\tdelete(importsRequired, importPath)\n\t\t} else {\n\t\t\tsourcePathsRemap.markDeleted(path)\n\t\t\tdependencyChanges[indexFrom] = -1\n\t\t}\n\t}\n\t// Add imports picked up via a public import. The filtered files do not use public imports.\n\tif publicImportCount := len(importsRequired); publicImportCount > 0 {\n\t\tfor importPath := range importsRequired {\n\t\t\tnewDependencies = append(newDependencies, importPath)\n\t\t}\n\t\t// Sort the public imports to ensure the output is deterministic.\n\t\tsort.Strings(newDependencies[len(newDependencies)-publicImportCount:])\n\t}\n\n\t// Public dependencies are always removed on remapping.\n\tpublicDependencyPath := append(sourcePath, filePublicDependencyTag)\n\tsourcePathsRemap.markDeleted(publicDependencyPath)\n\n\tvar newWeakDependencies []int32\n\tif len(weakDependencies) > 0 {\n\t\tif b.options.mutateInPlace {\n\t\t\tnewWeakDependencies = weakDependencies[:0]\n\t\t}\n\t\tweakDependencyPath := append(sourcePath, fileWeakDependencyTag)\n\t\tfor i, indexFrom := range weakDependencies {\n\t\t\tweakFrom := int32(i)\n\t\t\tpath := append(weakDependencyPath, weakFrom)\n\t\t\tindexTo := dependencyChanges[indexFrom]\n\t\t\tif indexTo == -1 {\n\t\t\t\tsourcePathsRemap.markDeleted(path)\n\t\t\t} else {\n\t\t\t\tweakTo := int32(len(newWeakDependencies))\n\t\t\t\tif weakTo != weakFrom {\n\t\t\t\t\tsourcePathsRemap.markMoved(path, weakTo)\n\t\t\t\t}\n\t\t\t\tnewWeakDependencies = append(newWeakDependencies, indexTo)\n\t\t\t}\n\t\t}\n\t}\n\treturn newDependencies, nil, newWeakDependencies, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapDescriptor(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tdescriptor *descriptorpb.DescriptorProto,\n) (*descriptorpb.DescriptorProto, bool, error) {\n\tif !b.closure.hasType(descriptor, b.options) {\n\t\treturn nil, true, nil\n\t}\n\tvar newDescriptor *descriptorpb.DescriptorProto\n\tisDirty := false\n\tif mode := b.closure.elements[descriptor]; mode == inclusionModeEnclosing {\n\t\t// If the type is only enclosing, only the namespace matters.\n\t\tif len(descriptor.Field) > 0 ||\n\t\t\tlen(descriptor.OneofDecl) > 0 ||\n\t\t\tlen(descriptor.ExtensionRange) > 0 ||\n\t\t\tlen(descriptor.ReservedRange) > 0 ||\n\t\t\tlen(descriptor.ReservedName) > 0 {\n\t\t\t// Clear unnecessary fields.\n\t\t\tisDirty = true\n\t\t\tnewDescriptor = maybeClone(descriptor, b.options)\n\t\t\tsourcePathsRemap.markNoComment(sourcePath)\n\t\t\tsourcePathsRemap.markDeleted(append(sourcePath, messageFieldsTag))\n\t\t\tsourcePathsRemap.markDeleted(append(sourcePath, messageOneofsTag))\n\t\t\tsourcePathsRemap.markDeleted(append(sourcePath, messageExtensionRangesTag))\n\t\t\tsourcePathsRemap.markDeleted(append(sourcePath, messageReservedRangesTag))\n\t\t\tsourcePathsRemap.markDeleted(append(sourcePath, messageReservedNamesTag))\n\t\t\tnewDescriptor.Field = nil\n\t\t\tnewDescriptor.OneofDecl = nil\n\t\t\tnewDescriptor.ExtensionRange = nil\n\t\t\tnewDescriptor.ReservedRange = nil\n\t\t\tnewDescriptor.ReservedName = nil\n\t\t}\n\t} else {\n\t\tnewFields, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, messageFieldsTag), descriptor.GetField(), b.remapField, b.options)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\tisDirty = isDirty || changed\n\t\tnewOneofs, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, messageOneofsTag), descriptor.OneofDecl, b.remapOneof, b.options)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\tisDirty = isDirty || changed\n\t\tnewExtensionRange, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, messageExtensionRangesTag), descriptor.ExtensionRange, b.remapExtensionRange, b.options)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\tisDirty = isDirty || changed\n\t\tif isDirty {\n\t\t\tnewDescriptor = maybeClone(descriptor, b.options)\n\t\t\tnewDescriptor.Field = newFields\n\t\t\tnewDescriptor.OneofDecl = newOneofs\n\t\t\tnewDescriptor.ExtensionRange = newExtensionRange\n\t\t}\n\t}\n\tnewExtensions, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, messageExtensionsTag), descriptor.GetExtension(), b.remapField, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewDescriptors, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, messageNestedMessagesTag), descriptor.NestedType, b.remapDescriptor, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewEnums, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, messageEnumsTag), descriptor.EnumType, b.remapEnum, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, messageOptionsTag), descriptor.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\n\tif !isDirty {\n\t\treturn descriptor, false, nil\n\t}\n\tif newDescriptor == nil {\n\t\tnewDescriptor = maybeClone(descriptor, b.options)\n\t}\n\tnewDescriptor.Extension = newExtensions\n\tnewDescriptor.NestedType = newDescriptors\n\tnewDescriptor.EnumType = newEnums\n\tnewDescriptor.Options = newOptions\n\treturn newDescriptor, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapExtensionRange(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\textensionRange *descriptorpb.DescriptorProto_ExtensionRange,\n) (*descriptorpb.DescriptorProto_ExtensionRange, bool, error) {\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, extensionRangeOptionsTag), extensionRange.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tif !changed {\n\t\treturn extensionRange, false, nil\n\t}\n\tnewExtensionRange := maybeClone(extensionRange, b.options)\n\tnewExtensionRange.Options = newOptions\n\treturn newExtensionRange, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapEnum(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tenum *descriptorpb.EnumDescriptorProto,\n) (*descriptorpb.EnumDescriptorProto, bool, error) {\n\tif !b.closure.hasType(enum, b.options) {\n\t\t// The type is excluded, enum values cannot be excluded individually.\n\t\treturn nil, true, nil\n\t}\n\tvar isDirty bool\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, enumOptionsTag), enum.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = changed\n\n\t// Walk the enum values.\n\tnewEnumValues, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, enumValuesTag), enum.Value, b.remapEnumValue, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tif !isDirty {\n\t\treturn enum, true, nil\n\t}\n\tnewEnum := maybeClone(enum, b.options)\n\tnewEnum.Options = newOptions\n\tnewEnum.Value = newEnumValues\n\treturn newEnum, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapEnumValue(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tenumValue *descriptorpb.EnumValueDescriptorProto,\n) (*descriptorpb.EnumValueDescriptorProto, bool, error) {\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, enumValueOptionsTag), enumValue.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tif !changed {\n\t\treturn enumValue, false, nil\n\t}\n\tnewEnumValue := maybeClone(enumValue, b.options)\n\tnewEnumValue.Options = newOptions\n\treturn newEnumValue, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapOneof(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\toneof *descriptorpb.OneofDescriptorProto,\n) (*descriptorpb.OneofDescriptorProto, bool, error) {\n\tif mode, ok := b.closure.elements[oneof]; ok && mode == inclusionModeExcluded {\n\t\t// Oneofs are implicitly excluded when all of its fields types are excluded.\n\t\treturn nil, true, nil\n\t}\n\toptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, oneofOptionsTag), oneof.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tif !changed {\n\t\treturn oneof, false, nil\n\t}\n\tnewOneof := maybeClone(oneof, b.options)\n\tnewOneof.Options = options\n\treturn newOneof, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapService(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tservice *descriptorpb.ServiceDescriptorProto,\n) (*descriptorpb.ServiceDescriptorProto, bool, error) {\n\tif !b.closure.hasType(service, b.options) {\n\t\treturn nil, true, nil\n\t}\n\tisDirty := false\n\t// Walk the service methods.\n\tnewMethods, changed, err := remapSlice(sourcePathsRemap, append(sourcePath, serviceMethodsTag), service.Method, b.remapMethod, b.options)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, serviceOptionsTag), service.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tisDirty = isDirty || changed\n\tif !isDirty {\n\t\treturn service, false, nil\n\t}\n\tnewService := maybeClone(service, b.options)\n\tnewService.Method = newMethods\n\tnewService.Options = newOptions\n\treturn newService, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapMethod(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tmethod *descriptorpb.MethodDescriptorProto,\n) (*descriptorpb.MethodDescriptorProto, bool, error) {\n\tif !b.closure.hasType(method, b.options) {\n\t\treturn nil, true, nil\n\t}\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, methodOptionsTag), method.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tif !changed {\n\t\treturn method, false, nil\n\t}\n\tnewMethod := maybeClone(method, b.options)\n\tnewMethod.Options = newOptions\n\treturn newMethod, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapField(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tfield *descriptorpb.FieldDescriptorProto,\n) (*descriptorpb.FieldDescriptorProto, bool, error) {\n\tif field.Extendee != nil {\n\t\t// Extensions are filtered by type.\n\t\tif !b.closure.hasType(field, b.options) {\n\t\t\treturn nil, true, nil\n\t\t}\n\t}\n\tswitch field.GetType() {\n\tcase descriptorpb.FieldDescriptorProto_TYPE_ENUM,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_MESSAGE,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_GROUP:\n\t\ttypeName := protoreflect.FullName(strings.TrimPrefix(field.GetTypeName(), \".\"))\n\t\ttypeInfo := b.imageIndex.ByName[typeName]\n\t\tif !b.closure.hasType(typeInfo.element, b.options) {\n\t\t\treturn nil, true, nil\n\t\t}\n\tcase descriptorpb.FieldDescriptorProto_TYPE_DOUBLE,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_FLOAT,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_INT64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_UINT64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_INT32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_FIXED64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_FIXED32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_BOOL,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_STRING,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_BYTES,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_UINT32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SFIXED32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SFIXED64,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SINT32,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_SINT64:\n\tdefault:\n\t\treturn nil, false, fmt.Errorf(\"unknown field type %d\", field.GetType())\n\t}\n\tnewOptions, changed, err := remapMessage(sourcePathsRemap, append(sourcePath, fieldOptionsTag), field.GetOptions(), b.remapOptions)\n\tif err != nil {\n\t\treturn nil, false, err\n\t}\n\tif !changed {\n\t\treturn field, false, nil\n\t}\n\tnewField := maybeClone(field, b.options)\n\tnewField.Options = newOptions\n\treturn newField, true, nil\n}\n\nfunc (b *sourcePathsBuilder) remapOptions(\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\toptionsPath protoreflect.SourcePath,\n\toptionsMessage proto.Message,\n) (proto.Message, bool, error) {\n\tif optionsMessage == nil {\n\t\treturn nil, false, nil\n\t}\n\tvar newOptions protoreflect.Message\n\toptions := optionsMessage.ProtoReflect()\n\tnumFieldsToKeep := 0\n\toptions.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool {\n\t\tif !b.closure.hasOption(fd, b.imageIndex, b.options) {\n\t\t\t// Remove this option.\n\t\t\toptionPath := append(optionsPath, int32(fd.Number()))\n\t\t\tsourcePathsRemap.markDeleted(optionPath)\n\t\t\tif newOptions == nil {\n\t\t\t\tnewOptions = maybeClone(optionsMessage, b.options).ProtoReflect()\n\t\t\t}\n\t\t\tnewOptions.Clear(fd)\n\t\t\treturn true\n\t\t}\n\t\tnumFieldsToKeep++\n\t\treturn true\n\t})\n\tif numFieldsToKeep == 0 {\n\t\t// No options to keep.\n\t\tsourcePathsRemap.markDeleted(optionsPath)\n\t\treturn nil, true, nil\n\t}\n\tif newOptions == nil {\n\t\treturn optionsMessage, false, nil\n\t}\n\treturn newOptions.Interface(), true, nil\n}\n\nfunc remapMessage[T proto.Message](\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tmessage T,\n\tremapMessage func(*sourcePathsRemapTrie, protoreflect.SourcePath, proto.Message) (proto.Message, bool, error),\n) (T, bool, error) {\n\tvar zeroValue T\n\tnewMessageOpaque, changed, err := remapMessage(sourcePathsRemap, sourcePath, message)\n\tif err != nil {\n\t\treturn zeroValue, false, err\n\t}\n\tif newMessageOpaque == nil {\n\t\treturn zeroValue, true, nil\n\t}\n\tif !changed {\n\t\treturn message, false, nil\n\t}\n\tnewMessage, _ := newMessageOpaque.(T) // Safe to assert.\n\treturn newMessage, true, nil\n}\n\nfunc remapSlice[T any](\n\tsourcePathsRemap *sourcePathsRemapTrie,\n\tsourcePath protoreflect.SourcePath,\n\tlist []*T,\n\tremapItem func(*sourcePathsRemapTrie, protoreflect.SourcePath, *T) (*T, bool, error),\n\toptions *imageFilterOptions,\n) ([]*T, bool, error) {\n\tisDirty := false\n\tvar newList []*T\n\tfromIndex, toIndex := int32(0), int32(0)\n\tfor int(fromIndex) < len(list) {\n\t\titem := list[fromIndex]\n\t\tsourcePath := append(sourcePath, fromIndex)\n\t\tnewItem, changed, err := remapItem(sourcePathsRemap, sourcePath, item)\n\t\tif err != nil {\n\t\t\treturn nil, false, err\n\t\t}\n\t\tisDirty = isDirty || changed\n\t\tif isDirty && newList == nil {\n\t\t\tif options.mutateInPlace {\n\t\t\t\tnewList = list[:toIndex]\n\t\t\t} else {\n\t\t\t\tnewList = append(newList, list[:toIndex]...)\n\t\t\t}\n\t\t}\n\t\tisIncluded := newItem != nil\n\t\tif isIncluded {\n\t\t\tif fromIndex != toIndex {\n\t\t\t\tsourcePathsRemap.markMoved(sourcePath, toIndex)\n\t\t\t}\n\t\t\tif isDirty {\n\t\t\t\tnewList = append(newList, newItem)\n\t\t\t}\n\t\t\ttoIndex++\n\t\t} else {\n\t\t\tsourcePathsRemap.markDeleted(sourcePath)\n\t\t}\n\t\tfromIndex++\n\t}\n\tif toIndex == 0 {\n\t\tisDirty = true\n\t\tsourcePathsRemap.markDeleted(sourcePath)\n\t}\n\tif isDirty {\n\t\tif len(newList) == 0 {\n\t\t\treturn nil, true, nil\n\t\t}\n\t\tif options.mutateInPlace {\n\t\t\t// Zero out the remaining elements.\n\t\t\tfor i := int(toIndex); i < len(list); i++ {\n\t\t\t\tlist[i] = nil\n\t\t\t}\n\t\t}\n\t\treturn newList, true, nil\n\t}\n\treturn list, false, nil\n}\n\nfunc maybeClone[T proto.Message](value T, options *imageFilterOptions) T {\n\tif !options.mutateInPlace {\n\t\treturn shallowClone(value)\n\t}\n\treturn value\n}\n\nfunc shallowClone[T proto.Message](message T) T {\n\tsrc := message.ProtoReflect()\n\tdst := src.New()\n\tsrc.Range(func(fd protoreflect.FieldDescriptor, v protoreflect.Value) bool {\n\t\tdst.Set(fd, v)\n\t\treturn true\n\t})\n\tvalue, _ := dst.Interface().(T) // Safe to assert.\n\treturn value\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/image_index.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimageutil\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/protocompile/walk\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// imageIndex holds an index that allows for easily navigating a descriptor\n// hierarchy and its relationships.\ntype imageIndex struct {\n\t// ByDescriptor maps descriptor proto pointers to information about the\n\t// element. The info includes the actual descriptor proto, its parent\n\t// element (if it has one), and the file in which it is defined.\n\tByDescriptor map[namedDescriptor]elementInfo\n\t// ByName maps fully qualified type names to information about the named\n\t// element.\n\tByName map[protoreflect.FullName]elementInfo\n\t// NameToExtensions maps fully qualified type names to all known\n\t// extension definitions for a type name.\n\tNameToExtensions map[protoreflect.FullName][]*descriptorpb.FieldDescriptorProto\n\t// NameToOptions maps `google.protobuf.*Options` type names to their\n\t// known extensions by field tag.\n\tNameToOptions map[protoreflect.FullName]map[int32]*descriptorpb.FieldDescriptorProto\n\t// Packages maps package names to package contents.\n\tPackages map[string]*packageInfo\n\t// FileTypes maps file names to the fully qualified type names defined\n\t// in the file.\n\tFileTypes map[string][]protoreflect.FullName\n}\n\ntype namedDescriptor interface {\n\tproto.Message\n\tGetName() string\n}\n\nvar _ namedDescriptor = (*descriptorpb.FileDescriptorProto)(nil)\nvar _ namedDescriptor = (*descriptorpb.DescriptorProto)(nil)\nvar _ namedDescriptor = (*descriptorpb.FieldDescriptorProto)(nil)\nvar _ namedDescriptor = (*descriptorpb.OneofDescriptorProto)(nil)\nvar _ namedDescriptor = (*descriptorpb.EnumDescriptorProto)(nil)\nvar _ namedDescriptor = (*descriptorpb.EnumValueDescriptorProto)(nil)\nvar _ namedDescriptor = (*descriptorpb.ServiceDescriptorProto)(nil)\nvar _ namedDescriptor = (*descriptorpb.MethodDescriptorProto)(nil)\n\ntype elementInfo struct {\n\tfullName protoreflect.FullName\n\tfile     bufimage.ImageFile\n\tparent   namedDescriptor\n\telement  namedDescriptor\n}\n\ntype packageInfo struct {\n\tfullName    protoreflect.FullName\n\tfiles       []bufimage.ImageFile\n\tsubPackages []*packageInfo\n}\n\n// newImageIndexForImage builds an imageIndex for a given image.\nfunc newImageIndexForImage(image bufimage.Image, options *imageFilterOptions) (*imageIndex, error) {\n\tindex := &imageIndex{\n\t\tByName:       make(map[protoreflect.FullName]elementInfo),\n\t\tByDescriptor: make(map[namedDescriptor]elementInfo),\n\t\tPackages:     make(map[string]*packageInfo),\n\t\tFileTypes:    make(map[string][]protoreflect.FullName),\n\t}\n\tif options.includeCustomOptions {\n\t\tindex.NameToOptions = make(map[protoreflect.FullName]map[int32]*descriptorpb.FieldDescriptorProto)\n\t}\n\tif options.includeKnownExtensions {\n\t\tindex.NameToExtensions = make(map[protoreflect.FullName][]*descriptorpb.FieldDescriptorProto)\n\t}\n\n\tfor _, imageFile := range image.Files() {\n\t\tpkg := addPackageToIndex(imageFile.FileDescriptorProto().GetPackage(), index)\n\t\tpkg.files = append(pkg.files, imageFile)\n\t\tfileName := imageFile.Path()\n\t\tfileDescriptorProto := imageFile.FileDescriptorProto()\n\t\tindex.ByDescriptor[fileDescriptorProto] = elementInfo{\n\t\t\tfullName: pkg.fullName,\n\t\t\tfile:     imageFile,\n\t\t\telement:  fileDescriptorProto,\n\t\t\tparent:   nil,\n\t\t}\n\t\terr := walk.DescriptorProtos(fileDescriptorProto, func(name protoreflect.FullName, msg proto.Message) error {\n\t\t\tif _, existing := index.ByName[name]; existing {\n\t\t\t\treturn fmt.Errorf(\"duplicate for %q\", name)\n\t\t\t}\n\t\t\tdescriptor, ok := msg.(namedDescriptor)\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"unexpected descriptor type %T\", msg)\n\t\t\t}\n\t\t\tvar parent namedDescriptor = fileDescriptorProto\n\t\t\tif pos := strings.LastIndexByte(string(name), '.'); pos != -1 {\n\t\t\t\tparent = index.ByName[name[:pos]].element\n\t\t\t\tif parent == nil {\n\t\t\t\t\t// parent name was a package name, not an element name\n\t\t\t\t\tparent = fileDescriptorProto\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// certain descriptor types don't need to be indexed:\n\t\t\t//  enum values, normal (non-extension) fields, and oneofs\n\t\t\tswitch d := descriptor.(type) {\n\t\t\tcase *descriptorpb.EnumValueDescriptorProto, *descriptorpb.OneofDescriptorProto:\n\t\t\t\t// do not add to package elements; these elements are implicitly included by their enclosing type\n\t\t\t\treturn nil\n\t\t\tcase *descriptorpb.FieldDescriptorProto:\n\t\t\t\t// only add to elements if an extension (regular fields implicitly included by containing message)\n\t\t\t\tif d.Extendee == nil {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\textendeeName := protoreflect.FullName(strings.TrimPrefix(d.GetExtendee(), \".\"))\n\t\t\t\tif options.includeCustomOptions && isOptionsTypeName(extendeeName) {\n\t\t\t\t\tif _, ok := index.NameToOptions[extendeeName]; !ok {\n\t\t\t\t\t\tindex.NameToOptions[extendeeName] = make(map[int32]*descriptorpb.FieldDescriptorProto)\n\t\t\t\t\t}\n\t\t\t\t\tindex.NameToOptions[extendeeName][d.GetNumber()] = d\n\t\t\t\t}\n\t\t\t\tif options.includeKnownExtensions {\n\t\t\t\t\tindex.NameToExtensions[extendeeName] = append(index.NameToExtensions[extendeeName], d)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tinfo := elementInfo{\n\t\t\t\tfullName: name,\n\t\t\t\tfile:     imageFile,\n\t\t\t\tparent:   parent,\n\t\t\t\telement:  descriptor,\n\t\t\t}\n\t\t\tindex.ByName[name] = info\n\t\t\tindex.ByDescriptor[descriptor] = info\n\t\t\tindex.FileTypes[fileName] = append(index.FileTypes[fileName], name)\n\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn index, nil\n}\n\nfunc addPackageToIndex(pkgName string, index *imageIndex) *packageInfo {\n\tpkg := index.Packages[pkgName]\n\tif pkg != nil {\n\t\treturn pkg\n\t}\n\tpkg = &packageInfo{\n\t\tfullName: protoreflect.FullName(pkgName),\n\t}\n\tindex.Packages[pkgName] = pkg\n\tif pkgName == \"\" {\n\t\treturn pkg\n\t}\n\tvar parentPkgName string\n\tif pos := strings.LastIndexByte(pkgName, '.'); pos != -1 {\n\t\tparentPkgName = pkgName[:pos]\n\t}\n\tparentPkg := addPackageToIndex(parentPkgName, index)\n\tparentPkg.subPackages = append(parentPkg.subPackages, pkg)\n\treturn pkg\n}\n\nfunc isOptionsTypeName(typeName protoreflect.FullName) bool {\n\tswitch typeName {\n\tcase \"google.protobuf.FileOptions\",\n\t\t\"google.protobuf.MessageOptions\",\n\t\t\"google.protobuf.FieldOptions\",\n\t\t\"google.protobuf.OneofOptions\",\n\t\t\"google.protobuf.ExtensionRangeOptions\",\n\t\t\"google.protobuf.EnumOptions\",\n\t\t\"google.protobuf.EnumValueOptions\",\n\t\t\"google.protobuf.ServiceOptions\",\n\t\t\"google.protobuf.MethodOptions\":\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/source_paths_remap.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimageutil\n\nimport \"sort\"\n\n// sourcePathsRemapTrieNode is a node in a trie. Each node represents the\n// path of a source code location.\ntype sourcePathsRemapTrieNode struct {\n\toldIndex int32\n\t// If == -1, the item at this path is being deleted. Otherwise,\n\t// if != oldIndex, the item at this path is being moved, as well as\n\t// all its descendents in the trie.\n\tnewIndex int32\n\t// If true, the item at this point has its comments omitted. This is\n\t// used to omit comments for messages that, after filtering, are only\n\t// present as a namespace (so the comments likely no longer apply).\n\tnoComment bool\n\t// This node's children. These represent paths for which the current\n\t// node is a path prefix (aka ancestor).\n\tchildren sourcePathsRemapTrie\n}\n\n// sourcePathsRemapTrie is a trie (aka prefix tree) whose children are a\n// sorted slice (more efficient than a map, mainly due to not having to\n// sort it with every addition, in practice, since source code info is\n// mostly sorted).\n//\n// Each node in the trie represents some path of a source code location.\n// This is used to track renumbering and deletions of paths.\ntype sourcePathsRemapTrie []*sourcePathsRemapTrieNode\n\n// markMoved inserts the given path into the trie and marks the last element\n// of oldPath to be replaced with newIndex.\nfunc (t *sourcePathsRemapTrie) markMoved(oldPath []int32, newIndex int32) {\n\tt.doTrieInsert(oldPath, newIndex, false)\n}\n\n// markDeleted marks the given path for deletion.\nfunc (t *sourcePathsRemapTrie) markDeleted(oldPath []int32) {\n\tt.doTrieInsert(oldPath, -1, false)\n}\n\n// markNoComment inserts the given path into the trie and marks the element so\n// its comments will be dropped.\nfunc (t *sourcePathsRemapTrie) markNoComment(oldPath []int32) {\n\tt.doTrieInsert(oldPath, oldPath[len(oldPath)-1], true)\n}\n\nfunc (t *sourcePathsRemapTrie) doTrieInsert(oldPath []int32, newIndex int32, noComment bool) {\n\tif t == nil {\n\t\treturn\n\t}\n\titems := *t\n\tsearchIndex := oldPath[0]\n\tidx, found := sort.Find(len(items), func(i int) int {\n\t\treturn int(searchIndex - items[i].oldIndex)\n\t})\n\tif !found {\n\t\t// shouldn't usually need to sort because incoming items are often in order\n\t\tneedSort := len(items) > 0 && searchIndex < items[len(items)-1].oldIndex\n\t\tidx = len(items)\n\t\titems = append(items, &sourcePathsRemapTrieNode{\n\t\t\toldIndex: searchIndex,\n\t\t\tnewIndex: searchIndex,\n\t\t})\n\t\tif needSort {\n\t\t\tsort.Slice(items, func(i, j int) bool {\n\t\t\t\treturn items[i].oldIndex < items[j].oldIndex\n\t\t\t})\n\t\t\t// find the index of the thing we just added\n\t\t\tidx, _ = sort.Find(len(items), func(i int) int {\n\t\t\t\treturn int(searchIndex - items[i].oldIndex)\n\t\t\t})\n\t\t}\n\t\t*t = items\n\t}\n\tif len(oldPath) > 1 {\n\t\titems[idx].children.doTrieInsert(oldPath[1:], newIndex, noComment)\n\t\treturn\n\t}\n\tif noComment {\n\t\titems[idx].noComment = noComment\n\t} else {\n\t\titems[idx].newIndex = newIndex\n\t}\n}\n\n// newPath returns the corrected path of oldPath, given any moves and\n// deletions inserted into t. If the item at the given oldPath was deleted\n// then nil is returned. Otherwise, the corrected path is returned. If the\n// item at oldPath was not moved or deleted, the returned path has the\n// same values as oldPath.\nfunc (t *sourcePathsRemapTrie) newPath(oldPath []int32) (path []int32, noComment bool) {\n\tif len(oldPath) == 0 {\n\t\t// make sure return value is non-nil, so response doesn't\n\t\t// get confused for \"delete this entry\"\n\t\treturn []int32{}, false\n\t}\n\tif t == nil {\n\t\treturn oldPath, false\n\t}\n\tnewPath := make([]int32, len(oldPath))\n\tkeep, noComment := t.fix(oldPath, newPath)\n\tif !keep {\n\t\treturn nil, false\n\t}\n\treturn newPath, noComment\n}\n\nfunc (t *sourcePathsRemapTrie) fix(oldPath, newPath []int32) (keep, noComment bool) {\n\titems := *t\n\tsearchIndex := oldPath[0]\n\tidx, found := sort.Find(len(items), func(i int) int {\n\t\treturn int(searchIndex - items[i].oldIndex)\n\t})\n\tif !found {\n\t\tcopy(newPath, oldPath)\n\t\treturn true, false\n\t}\n\titem := items[idx]\n\tif item.newIndex == -1 {\n\t\treturn false, false\n\t}\n\tnewPath[0] = item.newIndex\n\tif len(oldPath) > 1 {\n\t\tif item.newIndex == -1 {\n\t\t\tnewPath[0] = item.oldIndex\n\t\t}\n\t\treturn item.children.fix(oldPath[1:], newPath[1:])\n\t}\n\treturn true, item.noComment\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/source_paths_remap_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimageutil\n\nimport (\n\t\"fmt\"\n\t\"math/rand\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestSourcePathsRemapTrie_Insert(t *testing.T) {\n\tt.Parallel()\n\texpectedSlices := [][]string{\n\t\t{\"4\"},\n\t\t{\"4\", \"1 -> -1\"},\n\t\t{\"4\", \"2 -> 1\"},\n\t\t{\"4\", \"2 -> 1\", \"2\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"0 -> -1\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"1 -> 0\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"1 -> 0\", \"8\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"1 -> 0\", \"8\", \"3 -> -1\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"1 -> 0\", \"8\", \"4 -> -1\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"1 -> 0\", \"8\", \"5 -> 3\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"1 -> 0\", \"8\", \"6 -> 4\"},\n\t\t{\"4\", \"2 -> 1\", \"2\", \"1 -> 0\", \"8\", \"7 -> 5\"},\n\t\t{\"4\", \"3 -> 2\"},\n\t\t{\"4\", \"4 -> 3\"},\n\t\t{\"4\", \"5 -> -1\"},\n\t}\n\tt.Run(\"in order\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttrie := createTrie(nil)\n\t\tslices := asSlices(trie)\n\t\trequire.Equal(t, expectedSlices, slices)\n\t})\n\t// shuffle a few times and make sure the trie is always constructed correctly\n\tfor i := range 5 {\n\t\trnd := rand.New(rand.NewSource(int64(i)))\n\t\tt.Run(fmt.Sprintf(\"random order %d\", i), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\ttrie := createTrie(func(ops []insertionOp) []insertionOp {\n\t\t\t\tshuffle(rnd, ops)\n\t\t\t\treturn ops\n\t\t\t})\n\t\t\tslices := asSlices(trie)\n\t\t\trequire.Equal(t, expectedSlices, slices)\n\t\t})\n\t}\n}\n\nfunc TestSourcePathsRemapTrie_NewPath(t *testing.T) {\n\tt.Parallel()\n\ttrie := createTrie(nil)\n\t// make sure the items in the trie construct correct new path\n\tpath, noComment := trie.newPath([]int32{4, 1})\n\trequire.Nil(t, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2})\n\trequire.Equal(t, []int32{4, 1}, path)\n\trequire.True(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 0})\n\trequire.Nil(t, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 1})\n\trequire.Equal(t, []int32{4, 1, 2, 0}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 1, 8, 3})\n\trequire.Nil(t, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 1, 8, 4})\n\trequire.Nil(t, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 1, 8, 5})\n\trequire.Equal(t, []int32{4, 1, 2, 0, 8, 3}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 1, 8, 6})\n\trequire.Equal(t, []int32{4, 1, 2, 0, 8, 4}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 1, 8, 7})\n\trequire.Equal(t, []int32{4, 1, 2, 0, 8, 5}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 3})\n\trequire.Equal(t, []int32{4, 2}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 4})\n\trequire.Equal(t, []int32{4, 3}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 5})\n\trequire.Nil(t, path)\n\trequire.False(t, noComment)\n\n\t// items not in the trie or not re-written remain unchanged\n\tpath, noComment = trie.newPath([]int32{0, 1, 2, 3})\n\trequire.Equal(t, []int32{0, 1, 2, 3}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 0, 3, 2, 8, 5})\n\trequire.Equal(t, []int32{4, 0, 3, 2, 8, 5}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 6})\n\trequire.Equal(t, []int32{4, 6}, path)\n\trequire.False(t, noComment)\n\t// items that are descendants of re-written items are also changed\n\tpath, noComment = trie.newPath([]int32{4, 2, 2, 1, 8, 5, 5, 9, 4, 4})\n\trequire.Equal(t, []int32{4, 1, 2, 0, 8, 3, 5, 9, 4, 4}, path)\n\trequire.False(t, noComment)\n\tpath, noComment = trie.newPath([]int32{4, 4, 9, 4, 3, 5})\n\trequire.Equal(t, []int32{4, 3, 9, 4, 3, 5}, path)\n\trequire.False(t, noComment)\n\t// items that are descendants of deleted items are also deleted\n\tpath, noComment = trie.newPath([]int32{4, 5, 1, 3, 4, 5})\n\trequire.Nil(t, path)\n\trequire.False(t, noComment)\n}\n\ntype insertionOp struct {\n\toldPath  []int32\n\tnewIndex int32\n}\n\nfunc createTrie(permutation func([]insertionOp) []insertionOp) *sourcePathsRemapTrie {\n\t// Test data has the following source info path changes\n\t// \t\t4,1 -> deleted\n\t// \t\t4,2 -> 4,1 *no comment\n\t// \t\t4,2,2,0 -> deleted\n\t// \t\t4,2,2,1 -> 4,1,2,0\n\t// \t\t4,2,2,1,8,3 -> deleted\n\t// \t\t4,2,2,1,8,4 -> deleted\n\t// \t\t4,2,2,1,8,5 -> 4,1,2,0,8,3\n\t// \t\t4,2,2,1,8,6 -> 4,1,2,0,8,4\n\t// \t\t4,2,2,1,8,7 -> 4,1,2,0,8,5\n\t// \t\t4,3 -> 4,2\n\t// \t\t4,4 -> 4,3\n\t// \t\t4,5 -> deleted\n\t// Test data is sorted (unless permutation function rearranges)\n\tops := []insertionOp{\n\t\t{[]int32{4, 1}, -1},\n\t\t{[]int32{4, 2}, 1},\n\t\t{[]int32{4, 2}, -2},\n\t\t{[]int32{4, 2, 2, 0}, -1},\n\t\t{[]int32{4, 2, 2, 1}, 0},\n\t\t{[]int32{4, 2, 2, 1, 8, 3}, -1},\n\t\t{[]int32{4, 2, 2, 1, 8, 4}, -1},\n\t\t{[]int32{4, 2, 2, 1, 8, 5}, 3},\n\t\t{[]int32{4, 2, 2, 1, 8, 6}, 4},\n\t\t{[]int32{4, 2, 2, 1, 8, 7}, 5},\n\t\t{[]int32{4, 3}, 2},\n\t\t{[]int32{4, 4}, 3},\n\t\t{[]int32{4, 5}, -1},\n\t}\n\tif permutation != nil {\n\t\tops = permutation(ops)\n\t}\n\ttrie := &sourcePathsRemapTrie{}\n\tfor _, op := range ops {\n\t\tif op.newIndex == -2 {\n\t\t\ttrie.markNoComment(op.oldPath)\n\t\t\tcontinue\n\t\t}\n\t\ttrie.markMoved(op.oldPath, op.newIndex)\n\t}\n\treturn trie\n}\n\nfunc shuffle[T any](rnd *rand.Rand, slice []T) {\n\tfor i := range slice {\n\t\tpick := rnd.Intn(len(slice)-i) + i\n\t\tif i != pick {\n\t\t\tslice[i], slice[pick] = slice[pick], slice[i]\n\t\t}\n\t}\n}\n\nfunc asSlices(t *sourcePathsRemapTrie) [][]string {\n\tvar result [][]string\n\tfor _, child := range *t {\n\t\ttoSlices(child, nil, &result)\n\t}\n\treturn result\n}\n\nfunc toSlices(t *sourcePathsRemapTrieNode, soFar []string, result *[][]string) {\n\tif t.oldIndex == t.newIndex {\n\t\tsoFar = append(soFar, fmt.Sprintf(\"%d\", t.oldIndex))\n\t} else {\n\t\tsoFar = append(soFar, fmt.Sprintf(\"%d -> %d\", t.oldIndex, t.newIndex))\n\t}\n\tclone := make([]string, len(soFar))\n\tcopy(clone, soFar)\n\t*result = append(*result, clone)\n\tif len(t.children) == 0 {\n\t\treturn\n\t}\n\tfor _, child := range t.children {\n\t\ttoSlices(child, soFar, result)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/tags.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimageutil\n\nconst (\n\t// These constants are tag numbers for fields of messages in descriptor.proto.\n\t// We use them to construct source code info paths, which must be re-written\n\t// when we filter out elements of an image.\n\n\tfileDependencyTag         = 3\n\tfilePublicDependencyTag   = 10\n\tfileWeakDependencyTag     = 11\n\tfileMessagesTag           = 4\n\tfileEnumsTag              = 5\n\tfileServicesTag           = 6\n\tfileExtensionsTag         = 7\n\tfileOptionsTag            = 8\n\tmessageFieldsTag          = 2\n\tmessageNestedMessagesTag  = 3\n\tmessageEnumsTag           = 4\n\tmessageExtensionsTag      = 6\n\tmessageOptionsTag         = 7\n\tmessageOneofsTag          = 8\n\tmessageExtensionRangesTag = 5\n\tmessageReservedRangesTag  = 9\n\tmessageReservedNamesTag   = 10\n\textensionRangeOptionsTag  = 3\n\tfieldOptionsTag           = 8\n\toneofOptionsTag           = 2\n\tenumOptionsTag            = 3\n\tenumValuesTag             = 2\n\tenumValueOptionsTag       = 3\n\tserviceMethodsTag         = 2\n\tserviceOptionsTag         = 3\n\tmethodOptionsTag          = 4\n)\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/a.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  google.protobuf.Any extra = 10101;\n  AnyInField extra_in_field = 10102;\n  AnyInList extra_in_list = 10103;\n  AnyInMap extra_in_map = 10104;\n}\n\nmessage AnyInField {\n  google.protobuf.Any any = 1;\n}\n\nmessage AnyInList {\n  repeated google.protobuf.Any list_any = 1;\n}\n\nmessage AnyInMap {\n  map<string, AnyInField> map = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/b.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.baz;\n\nmessage Foo {\n  string name = 1;\n  int32 id = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c1.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a.proto\";\nimport \"b.proto\";\n\nmessage ExtendedAnySyntax {\n  option (extra) = {\n    [type.googleapis.com/foo.bar.baz.Foo]: {\n      name: \"Bob Loblaw\"\n      id: 42\n    }\n  };\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c1.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nextend google.protobuf.MessageOptions {\n  google.protobuf.Any extra = 10101;\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage foo.bar.baz;\nmessage Foo {\n  string name = 1;\n  int32 id = 2;\n}\n-- c1.proto --\nsyntax = \"proto3\";\nimport \"a.proto\";\nimport \"b.proto\";\nmessage ExtendedAnySyntax {\n  option (extra) = {\n    [type.googleapis.com/foo.bar.baz.Foo]: { name: \"Bob Loblaw\", id: 42 }\n  };\n}\n-- google/protobuf/any.proto --\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\nmessage Any {\n  string type_url = 1;\n  bytes value = 2;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c2.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a.proto\";\nimport \"b.proto\";\n\nmessage ExtendedAnySyntax_InField {\n  option (extra_in_field) = {\n    any: {\n      [type.googleapis.com/foo.bar.baz.Foo]: {\n        name: \"Bob Loblaw\"\n        id: 42\n      }\n    }\n  };\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c2.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nmessage AnyInField {\n  google.protobuf.Any any = 1;\n}\nextend google.protobuf.MessageOptions {\n  AnyInField extra_in_field = 10102;\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage foo.bar.baz;\nmessage Foo {\n  string name = 1;\n  int32 id = 2;\n}\n-- c2.proto --\nsyntax = \"proto3\";\nimport \"a.proto\";\nimport \"b.proto\";\nmessage ExtendedAnySyntax_InField {\n  option (extra_in_field) = {\n    any: {\n      [type.googleapis.com/foo.bar.baz.Foo]: { name: \"Bob Loblaw\", id: 42 }\n    }\n  };\n}\n-- google/protobuf/any.proto --\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\nmessage Any {\n  string type_url = 1;\n  bytes value = 2;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c3.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a.proto\";\nimport \"b.proto\";\n\nmessage ExtendedAnySyntax_InList {\n  option (extra_in_list) = {\n    list_any: {\n      [type.googleapis.com/ExtendedAnySyntax_InList]: {}\n    }\n    list_any: {\n      [type.googleapis.com/foo.bar.baz.Foo]: {\n        name: \"Bob Loblaw\"\n        id: 42\n      }\n    }\n  };\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c3.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nmessage AnyInList {\n  repeated google.protobuf.Any list_any = 1;\n}\nextend google.protobuf.MessageOptions {\n  AnyInList extra_in_list = 10103;\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage foo.bar.baz;\nmessage Foo {\n  string name = 1;\n  int32 id = 2;\n}\n-- c3.proto --\nsyntax = \"proto3\";\nimport \"a.proto\";\nimport \"b.proto\";\nmessage ExtendedAnySyntax_InList {\n  option (extra_in_list) = {\n    list_any: [\n      {\n        [type.googleapis.com/ExtendedAnySyntax_InList]: { }\n      },\n      {\n        [type.googleapis.com/foo.bar.baz.Foo]: { name: \"Bob Loblaw\", id: 42 }\n      }\n    ]\n  };\n}\n-- google/protobuf/any.proto --\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\nmessage Any {\n  string type_url = 1;\n  bytes value = 2;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c4.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a.proto\";\nimport \"b.proto\";\n\nmessage ExtendedAnySyntax_InMap {\n  option (extra_in_map) = {\n    map: [\n      {\n        key: \"foo\"\n        value: {\n          any: {\n            [type.googleapis.com/ExtendedAnySyntax_InMap]: {}\n          }\n        }\n      },\n      {\n        key: \"bar\"\n        value: {\n          any: {\n            [type.googleapis.com/foo.bar.baz.Foo]: {\n              name: \"Bob Loblaw\"\n              id: 42\n            }\n          }\n        }\n      }\n    ]\n  };\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/c4.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nmessage AnyInField {\n  google.protobuf.Any any = 1;\n}\nmessage AnyInMap {\n  map<string, AnyInField> map = 1;\n}\nextend google.protobuf.MessageOptions {\n  AnyInMap extra_in_map = 10104;\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage foo.bar.baz;\nmessage Foo {\n  string name = 1;\n  int32 id = 2;\n}\n-- c4.proto --\nsyntax = \"proto3\";\nimport \"a.proto\";\nimport \"b.proto\";\nmessage ExtendedAnySyntax_InMap {\n  option (extra_in_map) = {\n    map: [\n      {\n        key: \"bar\",\n        value: {\n          any: {\n            [type.googleapis.com/foo.bar.baz.Foo]: { name: \"Bob Loblaw\", id: 42 }\n          }\n        }\n      },\n      {\n        key: \"foo\",\n        value: {\n          any: {\n            [type.googleapis.com/ExtendedAnySyntax_InMap]: { }\n          }\n        }\n      }\n    ]\n  };\n}\n-- google/protobuf/any.proto --\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\nmessage Any {\n  string type_url = 1;\n  bytes value = 2;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/d.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a.proto\";\n\nmessage NormalMessageSyntaxValidType {\n  option (extra) = {\n    type_url: \"type.googleapis.com/foo.bar.baz.Foo\"\n    value: \"\\x0a\\x0a\\x42\\x6f\\x62\\x20\\x4c\\x6f\\x62\\x6c\\x61\\x77\\x10\\x2a\"\n  };\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/d.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nextend google.protobuf.MessageOptions {\n  google.protobuf.Any extra = 10101;\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage foo.bar.baz;\nmessage Foo {\n  string name = 1;\n  int32 id = 2;\n}\n-- d.proto --\nsyntax = \"proto3\";\nimport \"a.proto\";\nimport \"b.proto\";\nmessage NormalMessageSyntaxValidType {\n  option (extra) = {\n    [type.googleapis.com/foo.bar.baz.Foo]: { name: \"Bob Loblaw\", id: 42 }\n  };\n}\n-- google/protobuf/any.proto --\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\nmessage Any {\n  string type_url = 1;\n  bytes value = 2;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/e.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a.proto\";\n\nmessage NormalMessageSyntaxInvalidType {\n  option (extra) = {\n    type_url: \"type.googleapis.com/blah.blah.Blah\"\n    value: \"\\x01\\x02\\x03\\x04\"\n  };\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/any/e.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/descriptor.proto\";\nextend google.protobuf.MessageOptions {\n  google.protobuf.Any extra = 10101;\n}\n-- e.proto --\nsyntax = \"proto3\";\nimport \"a.proto\";\nmessage NormalMessageSyntaxInvalidType {\n  option (extra) = { type_url: \"type.googleapis.com/blah.blah.Blah\", value: \"\\001\\002\\003\\004\" };\n}\n-- google/protobuf/any.proto --\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\nmessage Any {\n  string type_url = 1;\n  bytes value = 2;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/a.proto",
    "content": "syntax = \"proto3\";\npackage a;\n\nimport \"b.proto\";\n\noption (b.B.file_c).c = \"c\";\n\nmessage A {\n  option (b.message_c).c = \"c\";\n\n  string a = 1 [(b.field_c).c = \"c\"];\n\n  oneof oneof_a {\n    option (b.oneof_c).c = \"c\";\n\n    string foo = 2;\n    string bar = 3;\n  }\n\n  enum AEnum {\n    option (b.enum_c).c = \"c\";\n\n    FOO_ENUM_A = 0;\n    FOO_ENUM_B = 1 [(b.enum_value_c).c = \"c\"];\n  }\n}\n\nservice AService {\n  option (b.service_c).c = \"c\";\n\n  rpc Method(A) returns (A) {\n    option (b.method_c).c = \"c\";\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/b.proto",
    "content": "syntax = \"proto3\";\npackage b;\n\nimport \"c.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\nmessage B {\n  extend google.protobuf.FileOptions {\n    optional c.C file_c = 50000;\n  }\n  string b = 1;\n}\n\nextend google.protobuf.MessageOptions {\n  optional c.C message_c = 50000;\n}\nextend google.protobuf.FieldOptions {\n  optional c.C field_c = 50000;\n}\nextend google.protobuf.OneofOptions {\n  optional c.C oneof_c = 50000;\n}\nextend google.protobuf.EnumOptions {\n  optional c.C enum_c = 50000;\n}\nextend google.protobuf.EnumValueOptions {\n  optional c.C enum_value_c = 50000;\n}\nextend google.protobuf.ServiceOptions {\n  optional c.C service_c = 50000;\n}\nextend google.protobuf.MethodOptions {\n  optional c.C method_c = 50000;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/c.proto",
    "content": "syntax = \"proto3\";\npackage c;\n\nmessage C {\n  string c = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/old.proto",
    "content": "syntax = \"proto3\";\npackage old;\n\nimport public \"a.proto\";\nimport public \"b.proto\";\nimport public \"c.proto\";\n\nmessage Old {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/test.EnumA.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage a;\nimport \"b.proto\";\noption (b.B.file_c) = { c: \"c\" };\nmessage A {\n  option (b.message_c) = { c: \"c\" };\n  enum AEnum {\n    option (b.enum_c) = { c: \"c\" };\n    FOO_ENUM_A = 0;\n    FOO_ENUM_B = 1 [(b.enum_value_c) = { c: \"c\" }];\n  }\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage b;\nimport \"c.proto\";\nimport \"google/protobuf/descriptor.proto\";\nmessage B {\n  extend google.protobuf.FileOptions {\n    c.C file_c = 50000;\n  }\n}\nextend google.protobuf.EnumOptions {\n  c.C enum_c = 50000;\n}\nextend google.protobuf.EnumValueOptions {\n  c.C enum_value_c = 50000;\n}\nextend google.protobuf.MessageOptions {\n  c.C message_c = 50000;\n}\n-- c.proto --\nsyntax = \"proto3\";\npackage c;\nmessage C {\n  string c = 1;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldOptions {\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\n-- test.proto --\nsyntax = \"proto3\";\npackage test;\nimport \"a.proto\";\nmessage EnumA {\n  a.A.AEnum a = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/test.FieldA.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage a;\nimport \"b.proto\";\noption (b.B.file_c) = { c: \"c\" };\nmessage A {\n  option (b.message_c) = { c: \"c\" };\n  string a = 1 [(b.field_c) = { c: \"c\" }];\n  oneof oneof_a {\n    option (b.oneof_c) = { c: \"c\" };\n    string foo = 2;\n    string bar = 3;\n  }\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage b;\nimport \"c.proto\";\nimport \"google/protobuf/descriptor.proto\";\nmessage B {\n  extend google.protobuf.FileOptions {\n    c.C file_c = 50000;\n  }\n}\nextend google.protobuf.FieldOptions {\n  c.C field_c = 50000;\n}\nextend google.protobuf.MessageOptions {\n  c.C message_c = 50000;\n}\nextend google.protobuf.OneofOptions {\n  c.C oneof_c = 50000;\n}\n-- c.proto --\nsyntax = \"proto3\";\npackage c;\nmessage C {\n  string c = 1;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\n-- test.proto --\nsyntax = \"proto3\";\npackage test;\nimport \"a.proto\";\nmessage FieldA {\n  a.A a = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/test.IncludeWithExcludeExt.txtar",
    "content": "-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/test.PublicOrder.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage a;\nimport \"b.proto\";\noption (b.B.file_c) = { c: \"c\" };\nmessage A {\n  option (b.message_c) = { c: \"c\" };\n  string a = 1 [(b.field_c) = { c: \"c\" }];\n  oneof oneof_a {\n    option (b.oneof_c) = { c: \"c\" };\n    string foo = 2;\n    string bar = 3;\n  }\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage b;\nimport \"c.proto\";\nimport \"google/protobuf/descriptor.proto\";\nmessage B {\n  string b = 1;\n  extend google.protobuf.FileOptions {\n    c.C file_c = 50000;\n  }\n}\nextend google.protobuf.FieldOptions {\n  c.C field_c = 50000;\n}\nextend google.protobuf.MessageOptions {\n  c.C message_c = 50000;\n}\nextend google.protobuf.OneofOptions {\n  c.C oneof_c = 50000;\n}\n-- c.proto --\nsyntax = \"proto3\";\npackage c;\nmessage C {\n  string c = 1;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\n-- test.proto --\nsyntax = \"proto3\";\npackage test;\nimport \"a.proto\";\nimport \"b.proto\";\nimport \"c.proto\";\nimport \"google/protobuf/descriptor.proto\";\nmessage PublicOrder {\n  option (message_a) = { a: \"a\" };\n  option (message_b) = { b: \"b\" };\n  option (message_c) = { c: \"c\" };\n}\nextend google.protobuf.MessageOptions {\n  a.A message_a = 50001;\n  b.B message_b = 50002;\n  c.C message_c = 50003;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/deps/test.proto",
    "content": "syntax = \"proto3\";\npackage test;\n\nimport \"a.proto\";\nimport \"google/protobuf/descriptor.proto\";\nimport \"old.proto\";\n\nmessage FieldA {\n  a.A a = 1;\n}\n\nmessage EnumA {\n  a.A.AEnum a = 1;\n}\n\nmessage PublicOrder {\n  option (test.message_c).c = \"c\";\n  option (test.message_b).b = \"b\";\n  option (test.message_a).a = \"a\";\n}\n\nextend google.protobuf.MessageOptions {\n  optional a.A message_a = 50001;\n  optional b.B message_b = 50002;\n  optional c.C message_c = 50003;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/empty/a.proto",
    "content": "syntax = \"proto3\";\npackage include;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/empty/b.proto",
    "content": "syntax = \"proto3\";\n\nimport \"a.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/empty/c.proto",
    "content": "syntax = \"proto3\";\npackage pkg;\n\nimport \"a.proto\";\n\nmessage Foo {\n  string name = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/empty/d.proto",
    "content": "syntax = \"proto3\";\npackage pkg;\n\nimport \"google/protobuf/any.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/empty/empty.exclude.txtar",
    "content": "-- b.proto --\nsyntax = \"proto3\";\n-- c.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Foo {\n  string name = 1;\n}\n-- d.proto --\nsyntax = \"proto3\";\npackage pkg;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/empty/empty.include.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage include;\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/exclude_import_deps/dep.proto",
    "content": "syntax = \"proto3\";\n\npackage dep;\n\n// DepMessage is used by OptMessage in opt.proto.\n// When opt.proto is retained in the filtered image (because its extension\n// is used by user.proto), dep.proto must also be retained.\nmessage DepMessage {\n  string value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/exclude_import_deps/excluded.proto",
    "content": "syntax = \"proto3\";\n\npackage excluded;\n\n// ExcludedMessage is referenced by user.proto but excluded from the\n// filtered image via WithExcludeTypes(\"excluded\").\nmessage ExcludedMessage {\n  string value = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/exclude_import_deps/opt.proto",
    "content": "syntax = \"proto3\";\n\npackage opt;\n\nimport \"dep.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\n// my_service_option is used in user.proto, causing opt.proto to be retained\n// in the filtered image. Since opt.proto also imports dep.proto (via\n// OptMessage), dep.proto must also be retained.\nextend google.protobuf.ServiceOptions {\n  optional string my_service_option = 50001;\n}\n\n// OptMessage references dep.DepMessage, so opt.proto depends on dep.proto.\nmessage OptMessage {\n  dep.DepMessage dep_field = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/exclude_import_deps/user.proto",
    "content": "syntax = \"proto3\";\n\npackage user;\n\nimport \"excluded.proto\";\nimport \"opt.proto\";\n\n// UserService uses an extension from opt.proto. This causes opt.proto to be\n// retained in the filtered image. opt.proto also contains OptMessage which\n// references dep.DepMessage from dep.proto. When excluding the \"excluded\"\n// package, dep.proto must still be retained in the image because opt.proto\n// depends on it.\nservice UserService {\n  option (opt.my_service_option) = \"example.com\";\n\n  rpc GetUser(UserRequest) returns (UserResponse);\n}\n\nmessage UserRequest {\n  string name = 1;\n  // This field is excluded (its type is in the excluded package).\n  excluded.ExcludedMessage filter = 2;\n}\n\nmessage UserResponse {\n  string result = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/extensions/a.proto",
    "content": "syntax = \"proto2\";\npackage pkg;\n\nmessage Foo {\n\toptional string a = 1;\n\toptional Foo b = 2;\n\textensions 10 to max;\n}\n\nextend Foo {\n\toptional string ext = 11;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/extensions/b.proto",
    "content": "syntax = \"proto2\";\npackage other;\nimport \"a.proto\";\n\nmessage Embedded {\n\textend pkg.Foo {\n\t\toptional Embedded from_other_file = 12;\n\t}\n\n\toptional string foo = 1;\n}\n\nmessage Referenced {\n\toptional string x = 1;\t\n}\n\nextend pkg.Foo {\n\toptional Referenced from_other_file = 13;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/extensions/extensions-excluded.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nmessage Foo {\n  optional string a = 1;\n  optional Foo b = 2;\n  extensions 10 to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/extensions/extensions.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nmessage Foo {\n  optional string a = 1;\n  optional Foo b = 2;\n  extensions 10 to max;\n}\nextend Foo {\n  optional string ext = 11;\n}\n-- b.proto --\nsyntax = \"proto2\";\npackage other;\nimport \"a.proto\";\nmessage Embedded {\n  optional string foo = 1;\n  extend pkg.Foo {\n    optional Embedded from_other_file = 12;\n  }\n}\nmessage Referenced {\n  optional string x = 1;\n}\nextend pkg.Foo {\n  optional Referenced from_other_file = 13;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/a.proto",
    "content": "syntax = \"proto3\";\n\nimport \"regular.proto\";\nimport weak \"weak.proto\";\nimport public \"public.proto\";\n\nmessage ImportRegular {\n\tRegular x = 1;\n}\n\nmessage ImportWeak {\n\tWeak x = 1;\n}\n\nmessage ImportPublic {\n\tPublic x = 1;\n}\n\nmessage NoImports {\n\tstring x = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/noimports.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nmessage NoImports {\n  string x = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/public.proto",
    "content": "syntax = \"proto3\";\nmessage Public {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/regular.proto",
    "content": "syntax = \"proto3\";\nmessage Regular {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/regular_public.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"public.proto\";\nimport \"regular.proto\";\nmessage ImportPublic {\n  Public x = 1;\n}\nmessage ImportRegular {\n  Regular x = 1;\n}\n-- public.proto --\nsyntax = \"proto3\";\nmessage Public {\n}\n-- regular.proto --\nsyntax = \"proto3\";\nmessage Regular {\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/regular_weak.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"regular.proto\";\nimport \"weak.proto\";\nmessage ImportRegular {\n  Regular x = 1;\n}\nmessage ImportWeak {\n  Weak x = 1;\n}\n-- regular.proto --\nsyntax = \"proto3\";\nmessage Regular {\n}\n-- weak.proto --\nsyntax = \"proto3\";\nmessage Weak {\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/weak.proto",
    "content": "syntax = \"proto3\";\nmessage Weak {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/importmods/weak_public.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\nimport \"public.proto\";\nimport \"weak.proto\";\nmessage ImportPublic {\n  Public x = 1;\n}\nmessage ImportWeak {\n  Weak x = 1;\n}\n-- public.proto --\nsyntax = \"proto3\";\nmessage Public {\n}\n-- weak.proto --\nsyntax = \"proto3\";\nmessage Weak {\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/imports/a.proto",
    "content": "syntax = \"proto3\";\npackage pkg;\nimport \"options.proto\";\n\nmessage Foo {\n\toption (message_foo).foo = \"str\";\n\tmessage Bar {\n\t\toption (message_bar).bar = \"str\";\n\t\tstring bar = 1;\n\t}\n\tBar nested_bar = 2;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/imports/bar.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nimport \"options.proto\";\nmessage Foo {\n  option (message_foo) = { foo: \"str\" };\n  Bar nested_bar = 2;\n  message Bar {\n    string bar = 1;\n  }\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage OptionFoo {\n  string foo = 1;\n}\nextend google.protobuf.MessageOptions {\n  OptionFoo message_foo = 50000;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/imports/foo.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nimport \"options.proto\";\nmessage Foo {\n  Bar nested_bar = 2;\n  message Bar {\n    option (message_bar) = { bar: \"str\" };\n    string bar = 1;\n  }\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage OptionBar {\n  string bar = 1;\n}\nmessage OptionFoo {\n  string foo = 1;\n}\nextend google.protobuf.MessageOptions {\n  OptionBar message_bar = 50001;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/imports/foo_bar.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Foo {\n  Bar nested_bar = 2;\n  message Bar {\n    string bar = 1;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/imports/options.proto",
    "content": "syntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\n\nmessage OptionFoo {\n\tstring foo = 1;\n}\nmessage OptionBar {\n\tstring bar = 1;\n}\n\nextend google.protobuf.MessageOptions {\n\toptional OptionFoo message_foo = 50000;\n\toptional OptionBar message_bar = 50001;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/a.proto",
    "content": "syntax = \"proto3\";\npackage pkg;\n\nmessage Foo {\n\tmessage NestedFoo {\n\t\tmessage NestedNestedFoo {\n\t\t\tstring nested_nested_x = 1;\n\t\t}\n\t\tstring nested_x = 1;\n\t}\n\n\tmessage NestedButNotUsed {\n\t\tstring nested_but_not_used = 1;\n\t}\n\tstring x = 1;\n\tNestedFoo nested_foo = 2;\n}\n\nenum FooEnum {\n\tFOO_ENUM_X = 0;\n\tFOO_ENUM_Y = 1;\n}\n\nmessage Bar {\n\tenum NestedBarEnum {\n\t\tNESTED_BAR_ENUM_X = 0;\n\t\tNESTED_BAR_ENUM_Y = 1;\n\t}\n\tFooEnum foo_enum = 1;\n\tFoo.NestedFoo nested_foo = 2;\n}\n\nmessage Baz {\n\tBar.NestedBarEnum nested_bar_enum = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/enum.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Bar {\n  Foo.NestedFoo nested_foo = 2;\n  enum NestedBarEnum {\n    NESTED_BAR_ENUM_X = 0;\n    NESTED_BAR_ENUM_Y = 1;\n  }\n}\nmessage Baz {\n  Bar.NestedBarEnum nested_bar_enum = 1;\n}\nmessage Foo {\n  string x = 1;\n  NestedFoo nested_foo = 2;\n  message NestedButNotUsed {\n    string nested_but_not_used = 1;\n  }\n  message NestedFoo {\n    string nested_x = 1;\n    message NestedNestedFoo {\n      string nested_nested_x = 1;\n    }\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/enum.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nenum FooEnum {\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/message.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Bar {\n  FooEnum foo_enum = 1;\n  enum NestedBarEnum {\n    NESTED_BAR_ENUM_X = 0;\n    NESTED_BAR_ENUM_Y = 1;\n  }\n}\nmessage Baz {\n  Bar.NestedBarEnum nested_bar_enum = 1;\n}\nenum FooEnum {\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/message.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Foo {\n  string x = 1;\n  NestedFoo nested_foo = 2;\n  message NestedFoo {\n    string nested_x = 1;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/mixed.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Foo {\n  string x = 1;\n}\nenum FooEnum {\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/recursenested.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Bar {\n  FooEnum foo_enum = 1;\n  Foo.NestedFoo nested_foo = 2;\n  enum NestedBarEnum {\n    NESTED_BAR_ENUM_X = 0;\n    NESTED_BAR_ENUM_Y = 1;\n  }\n}\nmessage Baz {\n  Bar.NestedBarEnum nested_bar_enum = 1;\n}\nmessage Foo {\n  string x = 1;\n  NestedFoo nested_foo = 2;\n  message NestedButNotUsed {\n    string nested_but_not_used = 1;\n  }\n  message NestedFoo {\n    string nested_x = 1;\n  }\n}\nenum FooEnum {\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/recursenested.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Foo {\n  message NestedFoo {\n    message NestedNestedFoo {\n      string nested_nested_x = 1;\n    }\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/usingother.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Bar {\n  FooEnum foo_enum = 1;\n  Foo.NestedFoo nested_foo = 2;\n  enum NestedBarEnum {\n    NESTED_BAR_ENUM_X = 0;\n    NESTED_BAR_ENUM_Y = 1;\n  }\n}\nmessage Foo {\n  string x = 1;\n  NestedFoo nested_foo = 2;\n  message NestedButNotUsed {\n    string nested_but_not_used = 1;\n  }\n  message NestedFoo {\n    string nested_x = 1;\n    message NestedNestedFoo {\n      string nested_nested_x = 1;\n    }\n  }\n}\nenum FooEnum {\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/nesting/usingother.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nmessage Bar {\n  enum NestedBarEnum {\n    NESTED_BAR_ENUM_X = 0;\n    NESTED_BAR_ENUM_Y = 1;\n  }\n}\nmessage Baz {\n  Bar.NestedBarEnum nested_bar_enum = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/oneofs/a.proto",
    "content": "syntax = \"proto3\";\npackage pkg;\nimport \"google/protobuf/descriptor.proto\";\n\nmessage Foo {\n  oneof oneofFoo {\n    option (oneof_foo) = \"str\";\n    string foo = 1;\n    FooEnum foo_enum = 2;\n  }\n  oneof oneofBar {\n    option (oneof_bar) = \"str\";\n    Bar bar = 3;\n    Bar.BarNested bar_nested = 4;\n  }\n}\n\nenum FooEnum {\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\nmessage Bar {\n  string bar = 1;\n  message BarNested {\n    string bar = 1;\n  }\n}\nextend google.protobuf.OneofOptions {\n  optional string oneof_foo = 50000;\n  optional string oneof_bar = 50001;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/oneofs/pkg.Foo.exclude-bar.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nimport \"google/protobuf/descriptor.proto\";\nmessage Foo {\n  oneof oneofFoo {\n    option (oneof_foo) = \"str\";\n    string foo = 1;\n  }\n}\nextend google.protobuf.OneofOptions {\n  string oneof_foo = 50000;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/oneofs/pkg.Foo.exclude-partial.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage pkg;\nimport \"google/protobuf/descriptor.proto\";\nmessage Bar {\n  string bar = 1;\n}\nmessage Foo {\n  oneof oneofFoo {\n    option (oneof_foo) = \"str\";\n    string foo = 1;\n  }\n  oneof oneofBar {\n    option (oneof_bar) = \"str\";\n    Bar bar = 3;\n  }\n}\nextend google.protobuf.OneofOptions {\n  string oneof_foo = 50000;\n  string oneof_bar = 50001;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/Files.txtar",
    "content": "-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/a.proto",
    "content": "syntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\n\noption (UsedOption.file_foo).foo = \"str\";\noption (UsedOption.file_baz) = \"str\";\n\nmessage Foo {\n\toption (message_foo).foo = \"str\";\n\toption (message_baz) = \"str\";\n\n\toptional uint64 foo = 1 [\n\t\t(field_foo).foo = \"str\",\n\t\t(field_baz) = \"str\",\n\t\tjstype = JS_STRING\n\t];\n\n\toneof testOneof {\n\t\toption (oneof_foo).foo = \"str\";\n\t\toption (oneof_baz) = \"str\";\n\n\t\tstring bar = 2;\n\t\tbytes baz = 3;\n\t}\n\n\textensions 10 to max;\n}\n\nenum FooEnum {\n\toption (enum_foo).foo = \"str\";\n\toption (enum_baz) = \"str\";\n\toption deprecated = true;\n\t\n\tFOO_ENUM_X = 0;\n\tFOO_ENUM_Y = 1 [\n\t\t(enum_value_foo).foo = \"str\",\n\t\t(enum_value_baz) = \"str\"\n\t];\n}\n\nmessage Empty{}\n\nservice FooService {\n\toption (service_foo).foo = \"str\";\n\toption (service_baz) = \"str\";\n\n\trpc Do(Empty) returns (Empty) {\n\t\toption (method_foo).foo = \"str\";\n\t\toption (method_baz) = \"str\";\n\t};\n\n\trpc DoNot(Empty) returns (Empty) {\n\t\toption (method_foo).foo = \"str\";\n\t\toption (method_baz) = \"str\";\n\t};\n}\n\nextend Foo {\n\toptional string extension = 11 [\n\t\t(field_foo).foo = \"str\",\n\t\t(field_baz) = \"str\"\n\t];\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/all-exclude-options.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nmessage Empty {\n}\nmessage Foo {\n  optional uint64 foo = 1 [jstype = JS_STRING];\n  oneof testOneof {\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nenum FooEnum {\n  option deprecated = true;\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\nservice FooService {\n  rpc Do ( Empty ) returns ( Empty );\n  rpc DoNot ( Empty ) returns ( Empty );\n}\nextend Foo {\n  optional string extension = 11;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/all-with-Files.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nmessage Foo {\n  option (message_baz) = \"str\";\n  option (message_foo) = { foo: \"str\" };\n  optional uint64 foo = 1 [\n    jstype = JS_STRING,\n    (field_baz) = \"str\",\n    (field_foo) = { foo: \"str\" }\n  ];\n  oneof testOneof {\n    option (oneof_baz) = \"str\";\n    option (oneof_foo) = { foo: \"str\" };\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nenum FooEnum {\n  option deprecated = true;\n  option (enum_baz) = \"str\";\n  option (enum_foo) = { foo: \"str\" };\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1 [\n    (enum_value_baz) = \"str\",\n    (enum_value_foo) = { foo: \"str\" }\n  ];\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc Do ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\nextend Foo {\n  optional string extension = 11 [(field_baz) = \"str\", (field_foo) = { foo: \"str\" }];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/all.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/all.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nmessage Foo {\n  option (message_baz) = \"str\";\n  option (message_foo) = { foo: \"str\" };\n  optional uint64 foo = 1 [\n    jstype = JS_STRING,\n    (field_baz) = \"str\",\n    (field_foo) = { foo: \"str\" }\n  ];\n  oneof testOneof {\n    option (oneof_baz) = \"str\";\n    option (oneof_foo) = { foo: \"str\" };\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nenum FooEnum {\n  option deprecated = true;\n  option (enum_baz) = \"str\";\n  option (enum_foo) = { foo: \"str\" };\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1 [\n    (enum_value_baz) = \"str\",\n    (enum_value_foo) = { foo: \"str\" }\n  ];\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc Do ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\nextend Foo {\n  optional string extension = 11 [(field_baz) = \"str\", (field_foo) = { foo: \"str\" }];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/options.foo.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\nmessage Empty {\n}\nmessage Foo {\n  option (message_baz) = \"str\";\n  optional uint64 foo = 1 [jstype = JS_STRING, (field_baz) = \"str\"];\n  oneof testOneof {\n    option (oneof_baz) = \"str\";\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nenum FooEnum {\n  option deprecated = true;\n  option (enum_baz) = \"str\";\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1 [(enum_value_baz) = \"str\"];\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  rpc Do ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n  }\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n  }\n}\nextend Foo {\n  optional string extension = 11 [(field_baz) = \"str\"];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/options.foo.include.txtar",
    "content": "-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/options.only_file.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nmessage Foo {\n  optional uint64 foo = 1 [jstype = JS_STRING];\n  oneof testOneof {\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nenum FooEnum {\n  option deprecated = true;\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1;\n}\nservice FooService {\n  rpc Do ( Empty ) returns ( Empty );\n  rpc DoNot ( Empty ) returns ( Empty );\n}\nextend Foo {\n  optional string extension = 11;\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/options.proto",
    "content": "syntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\n\nmessage UnusedOption {\n\tstring foo = 1;\n}\n\nmessage UsedOption {\n\textend google.protobuf.FileOptions {\n\t\toptional UsedOption   file_foo = 50000;\n\t\toptional UnusedOption file_bar = 50001;\n\t\toptional string       file_baz = 50002;\n\t}\n\n\tstring foo = 1;\n}\n\nextend google.protobuf.MessageOptions {\n\toptional UsedOption   message_foo = 50000;\n\toptional UnusedOption message_bar = 50001;\n\toptional string       message_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n\toptional UsedOption   field_foo = 50000;\n\toptional UnusedOption field_bar = 50001;\n\toptional string       field_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n\toptional UsedOption   oneof_foo = 50000;\n\toptional UnusedOption oneof_bar = 50001;\n\toptional string       oneof_baz = 50002;\n}\nextend google.protobuf.EnumOptions {\n\toptional UsedOption   enum_foo = 50000;\n\toptional UnusedOption enum_bar = 50001;\n\toptional string       enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n\toptional UsedOption   enum_value_foo = 50000;\n\toptional UnusedOption enum_value_bar = 50001;\n\toptional string       enum_value_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n\toptional UsedOption   service_foo = 50000;\n\toptional UnusedOption service_bar = 50001;\n\toptional string       service_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n\toptional UsedOption   method_foo = 50000;\n\toptional UnusedOption method_bar = 50001;\n\toptional string       method_baz = 50002;\n}\n\nmessage Files {\n\tgoogle.protobuf.FileDescriptorSet files = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.Foo.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nenum FooEnum {\n  option deprecated = true;\n  option (enum_baz) = \"str\";\n  option (enum_foo) = { foo: \"str\" };\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1 [\n    (enum_value_baz) = \"str\",\n    (enum_value_foo) = { foo: \"str\" }\n  ];\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc Do ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.Foo.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Foo {\n  option (message_baz) = \"str\";\n  option (message_foo) = { foo: \"str\" };\n  optional uint64 foo = 1 [\n    jstype = JS_STRING,\n    (field_baz) = \"str\",\n    (field_foo) = { foo: \"str\" }\n  ];\n  oneof testOneof {\n    option (oneof_baz) = \"str\";\n    option (oneof_foo) = { foo: \"str\" };\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nextend Foo {\n  optional string extension = 11 [(field_baz) = \"str\", (field_foo) = { foo: \"str\" }];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  string message_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  string oneof_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooEnum.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nmessage Foo {\n  option (message_baz) = \"str\";\n  option (message_foo) = { foo: \"str\" };\n  optional uint64 foo = 1 [\n    jstype = JS_STRING,\n    (field_baz) = \"str\",\n    (field_foo) = { foo: \"str\" }\n  ];\n  oneof testOneof {\n    option (oneof_baz) = \"str\";\n    option (oneof_foo) = { foo: \"str\" };\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc Do ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\nextend Foo {\n  optional string extension = 11 [(field_baz) = \"str\", (field_foo) = { foo: \"str\" }];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooEnum.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nenum FooEnum {\n  option deprecated = true;\n  option (enum_baz) = \"str\";\n  option (enum_foo) = { foo: \"str\" };\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1 [\n    (enum_value_baz) = \"str\",\n    (enum_value_foo) = { foo: \"str\" }\n  ];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FieldOptions {\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  string enum_value_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooService.Do.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nmessage Foo {\n  option (message_baz) = \"str\";\n  option (message_foo) = { foo: \"str\" };\n  optional uint64 foo = 1 [\n    jstype = JS_STRING,\n    (field_baz) = \"str\",\n    (field_foo) = { foo: \"str\" }\n  ];\n  oneof testOneof {\n    option (oneof_baz) = \"str\";\n    option (oneof_foo) = { foo: \"str\" };\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nenum FooEnum {\n  option deprecated = true;\n  option (enum_baz) = \"str\";\n  option (enum_foo) = { foo: \"str\" };\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1 [\n    (enum_value_baz) = \"str\",\n    (enum_value_foo) = { foo: \"str\" }\n  ];\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\nextend Foo {\n  optional string extension = 11 [(field_baz) = \"str\", (field_foo) = { foo: \"str\" }];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooService.Do.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc Do ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  string method_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooService.exclude-method-types.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooService.exclude.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nmessage Foo {\n  option (message_baz) = \"str\";\n  option (message_foo) = { foo: \"str\" };\n  optional uint64 foo = 1 [\n    jstype = JS_STRING,\n    (field_baz) = \"str\",\n    (field_foo) = { foo: \"str\" }\n  ];\n  oneof testOneof {\n    option (oneof_baz) = \"str\";\n    option (oneof_foo) = { foo: \"str\" };\n    string bar = 2;\n    bytes baz = 3;\n  }\n  extensions 10 to max;\n}\nenum FooEnum {\n  option deprecated = true;\n  option (enum_baz) = \"str\";\n  option (enum_foo) = { foo: \"str\" };\n  FOO_ENUM_X = 0;\n  FOO_ENUM_Y = 1 [\n    (enum_value_baz) = \"str\",\n    (enum_value_foo) = { foo: \"str\" }\n  ];\n}\nextend Foo {\n  optional string extension = 11 [(field_baz) = \"str\", (field_foo) = { foo: \"str\" }];\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooService.mixed.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  string method_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.FooService.txtar",
    "content": "-- a.proto --\nsyntax = \"proto2\";\npackage pkg;\nimport \"options.proto\";\noption (UsedOption.file_baz) = \"str\";\noption (UsedOption.file_foo) = { foo: \"str\" };\nmessage Empty {\n}\nservice FooService {\n  option (service_baz) = \"str\";\n  option (service_foo) = { foo: \"str\" };\n  rpc Do ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n  rpc DoNot ( Empty ) returns ( Empty ) {\n    option (method_baz) = \"str\";\n    option (method_foo) = { foo: \"str\" };\n  }\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  string method_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/options/pkg.Pkg.exclude.txtar",
    "content": "-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage DescriptorProto {\n  optional string name = 1;\n  repeated FieldDescriptorProto field = 2;\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n  repeated ExtensionRange extension_range = 5;\n  repeated FieldDescriptorProto extension = 6;\n  optional MessageOptions options = 7;\n  repeated OneofDescriptorProto oneof_decl = 8;\n  repeated ReservedRange reserved_range = 9;\n  repeated string reserved_name = 10;\n  optional SymbolVisibility visibility = 11;\n  message ExtensionRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n    optional ExtensionRangeOptions options = 3;\n  }\n  message ReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumDescriptorProto {\n  optional string name = 1;\n  repeated EnumValueDescriptorProto value = 2;\n  optional EnumOptions options = 3;\n  repeated EnumReservedRange reserved_range = 4;\n  repeated string reserved_name = 5;\n  optional SymbolVisibility visibility = 6;\n  message EnumReservedRange {\n    optional int32 start = 1;\n    optional int32 end = 2;\n  }\n}\nmessage EnumOptions {\n  optional bool allow_alias = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n  optional FeatureSet features = 7;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 5;\n}\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n  optional EnumValueOptions options = 3;\n}\nmessage EnumValueOptions {\n  optional bool deprecated = 1 [default = false];\n  optional FeatureSet features = 2;\n  optional bool debug_redact = 3 [default = false];\n  optional FieldOptions.FeatureSupport feature_support = 4;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FeatureSetDefaults {\n  repeated FeatureSetEditionDefault defaults = 1;\n  optional Edition minimum_edition = 4;\n  optional Edition maximum_edition = 5;\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n    optional FeatureSet overridable_features = 4;\n    optional FeatureSet fixed_features = 5;\n    reserved 1, 2;\n    reserved \"features\";\n  }\n}\nmessage FieldDescriptorProto {\n  optional string name = 1;\n  optional string extendee = 2;\n  optional int32 number = 3;\n  optional Label label = 4;\n  optional Type type = 5;\n  optional string type_name = 6;\n  optional string default_value = 7;\n  optional FieldOptions options = 8;\n  optional int32 oneof_index = 9;\n  optional string json_name = 10;\n  optional bool proto3_optional = 17;\n  enum Label {\n    LABEL_OPTIONAL = 1;\n    LABEL_REQUIRED = 2;\n    LABEL_REPEATED = 3;\n  }\n  enum Type {\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;\n    TYPE_SINT64 = 18;\n  }\n}\nmessage FieldOptions {\n  optional CType ctype = 1 [default = STRING];\n  optional bool packed = 2;\n  optional bool deprecated = 3 [default = false];\n  optional bool lazy = 5 [default = false];\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  optional bool weak = 10 [default = false, deprecated = true];\n  optional bool unverified_lazy = 15 [default = false];\n  optional bool debug_redact = 16 [default = false];\n  optional OptionRetention retention = 17;\n  repeated OptionTargetType targets = 19;\n  repeated EditionDefault edition_defaults = 20;\n  optional FeatureSet features = 21;\n  optional FeatureSupport feature_support = 22;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message EditionDefault {\n    optional string value = 2;\n    optional Edition edition = 3;\n  }\n  message FeatureSupport {\n    optional Edition edition_introduced = 1;\n    optional Edition edition_deprecated = 2;\n    optional string deprecation_warning = 3;\n    optional Edition edition_removed = 4;\n  }\n  enum CType {\n    STRING = 0;\n    CORD = 1;\n    STRING_PIECE = 2;\n  }\n  enum JSType {\n    JS_NORMAL = 0;\n    JS_STRING = 1;\n    JS_NUMBER = 2;\n  }\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n  extensions 1000 to max;\n  reserved 4, 18;\n}\nmessage FileDescriptorProto {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n  optional FileOptions options = 8;\n  optional SourceCodeInfo source_code_info = 9;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  optional string syntax = 12;\n  optional Edition edition = 14;\n  repeated string option_dependency = 15;\n}\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\",\n      type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    }\n  ];\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage GeneratedCodeInfo {\n  repeated Annotation annotation = 1;\n  message Annotation {\n    repeated int32 path = 1 [packed = true];\n    optional string source_file = 2;\n    optional int32 begin = 3;\n    optional int32 end = 4;\n    optional Semantic semantic = 5;\n    enum Semantic {\n      NONE = 0;\n      SET = 1;\n      ALIAS = 2;\n    }\n  }\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage MethodDescriptorProto {\n  optional string name = 1;\n  optional string input_type = 2;\n  optional string output_type = 3;\n  optional MethodOptions options = 4;\n  optional bool client_streaming = 5 [default = false];\n  optional bool server_streaming = 6 [default = false];\n}\nmessage MethodOptions {\n  optional bool deprecated = 33 [default = false];\n  optional IdempotencyLevel idempotency_level = 34 [default = IDEMPOTENCY_UNKNOWN];\n  optional FeatureSet features = 35;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;\n    IDEMPOTENT = 2;\n  }\n  extensions 1000 to max;\n}\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\nmessage OneofOptions {\n  optional FeatureSet features = 1;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n  optional ServiceOptions options = 3;\n  reserved 4;\n  reserved \"stream\";\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage SourceCodeInfo {\n  repeated Location location = 1;\n  message Location {\n    repeated int32 path = 1 [packed = true];\n    repeated int32 span = 2 [packed = true];\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n  extensions 536000000 [\n    declaration = {\n      number: 536000000,\n      full_name: \".buf.descriptor.v1.buf_source_code_info_extension\",\n      type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    }\n  ];\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\nenum Edition {\n  EDITION_UNKNOWN = 0;\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_LEGACY = 900;\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n  EDITION_UNSTABLE = 9999;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n  EDITION_MAX = 2147483647;\n}\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nmessage Files {\n  google.protobuf.FileDescriptorSet files = 1;\n}\nmessage UnusedOption {\n  string foo = 1;\n}\nmessage UsedOption {\n  string foo = 1;\n  extend google.protobuf.FileOptions {\n    UsedOption file_foo = 50000;\n    UnusedOption file_bar = 50001;\n    string file_baz = 50002;\n  }\n}\nextend google.protobuf.EnumOptions {\n  UsedOption enum_foo = 50000;\n  UnusedOption enum_bar = 50001;\n  string enum_baz = 50002;\n}\nextend google.protobuf.EnumValueOptions {\n  UsedOption enum_value_foo = 50000;\n  UnusedOption enum_value_bar = 50001;\n  string enum_value_baz = 50002;\n}\nextend google.protobuf.FieldOptions {\n  UsedOption field_foo = 50000;\n  UnusedOption field_bar = 50001;\n  string field_baz = 50002;\n}\nextend google.protobuf.MessageOptions {\n  UsedOption message_foo = 50000;\n  UnusedOption message_bar = 50001;\n  string message_baz = 50002;\n}\nextend google.protobuf.MethodOptions {\n  UsedOption method_foo = 50000;\n  UnusedOption method_bar = 50001;\n  string method_baz = 50002;\n}\nextend google.protobuf.OneofOptions {\n  UsedOption oneof_foo = 50000;\n  UnusedOption oneof_bar = 50001;\n  string oneof_baz = 50002;\n}\nextend google.protobuf.ServiceOptions {\n  UsedOption service_foo = 50000;\n  UnusedOption service_bar = 50001;\n  string service_baz = 50002;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar;\n\nmessage MessageInBar {\n}\n\nenum EnumInBar {\n  UNSET = 0;\n}\n\nservice ServiceInBar {\n  rpc Bar(MessageInBar) returns (MessageInBar);\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/baz1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.baz;\n\nmessage Foo {\n  enum Enum {\n    VALUE0 = 0; VALUE1 = 1; VALUE2 = 2;\n  }\n  Enum en = 1;\n  string name = 2;\n  oneof loc {\n    string address = 3;\n    uint32 zip_code = 4;\n    uint64 other_xref = 5;\n  }\n}\n\nmessage Bar {\n  map<string, int32> attributes = 1;\n}\n\nservice BazService {\n  rpc GetBaz(Foo) returns (Bar);\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/baz2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo.bar.baz;\n\nimport \"nopackage.proto\";\n\nmessage Empty {}\n\nenum AlmostEmpty {\n  UNSET = 0;\n}\n\nservice NoOp {\n  option (svc_option_str) = \"blah\";\n  rpc Nothing(Empty) returns (Empty);\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/foo.bar.baz.txtar",
    "content": "-- baz1.proto --\nsyntax = \"proto3\";\npackage foo.bar.baz;\nmessage Bar {\n  map<string, int32> attributes = 1;\n}\nmessage Foo {\n  Enum en = 1;\n  string name = 2;\n  oneof loc {\n    string address = 3;\n    uint32 zip_code = 4;\n    uint64 other_xref = 5;\n  }\n  enum Enum {\n    VALUE0 = 0;\n    VALUE1 = 1;\n    VALUE2 = 2;\n  }\n}\nservice BazService {\n  rpc GetBaz ( Foo ) returns ( Bar );\n}\n-- baz2.proto --\nsyntax = \"proto3\";\npackage foo.bar.baz;\nimport \"options.proto\";\nmessage Empty {\n}\nenum AlmostEmpty {\n  UNSET = 0;\n}\nservice NoOp {\n  option (svc_option_str) = \"blah\";\n  rpc Nothing ( Empty ) returns ( Empty );\n}\n-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nextend google.protobuf.ServiceOptions {\n  string svc_option_str = 30000;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/foo.bar.txtar",
    "content": "-- bar.proto --\nsyntax = \"proto3\";\npackage foo.bar;\nmessage MessageInBar {\n}\nenum EnumInBar {\n  UNSET = 0;\n}\nservice ServiceInBar {\n  rpc Bar ( MessageInBar ) returns ( MessageInBar );\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/foo.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nmessage MessageInFoo {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/foo.txtar",
    "content": "-- foo.proto --\nsyntax = \"proto3\";\npackage foo;\nmessage MessageInFoo {\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/nopackage.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/descriptor.proto\";\nimport public \"options.proto\";\n\noption (file_option_str) = \"foo\";\n\nmessage Foo {\n  option (msg_option_str) = \"foo\";\n  oneof x {\n    string bar = 1;\n    string baz = 2;\n  }\n}\n\nextend google.protobuf.ExtensionRangeOptions {\n  int64 rand = 30000;\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/options.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FileOptions {\n  string file_option_str = 30000;\n}\n\nextend google.protobuf.MessageOptions {\n  string msg_option_str = 30000;\n}\n\nextend google.protobuf.ServiceOptions {\n  string svc_option_str = 30000;\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/other.proto",
    "content": "syntax = \"proto3\";\n\npackage other;"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/packages/root.txtar",
    "content": "-- google/protobuf/descriptor.proto --\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\noption optimize_for = SPEED;\nmessage ExtensionRangeOptions {\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n  optional VerificationState verification = 3 [default = UNVERIFIED, retention = RETENTION_SOURCE];\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  message Declaration {\n    optional int32 number = 1;\n    optional string full_name = 2;\n    optional string type = 3;\n    optional bool reserved = 5;\n    optional bool repeated = 6;\n    reserved 4;\n  }\n  enum VerificationState {\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n  extensions 1000 to max;\n}\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      EXPORT_ALL = 1;\n      EXPORT_TOP_LEVEL = 2;\n      LOCAL_ALL = 3;\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage FileOptions {\n  optional string java_package = 1;\n  optional string java_outer_classname = 8;\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n  optional bool java_multiple_files = 10 [default = false];\n  optional string go_package = 11;\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  optional bool java_generate_equals_and_hash = 20 [deprecated = true];\n  optional bool deprecated = 23 [default = false];\n  optional bool java_string_check_utf8 = 27 [default = false];\n  optional bool cc_enable_arenas = 31 [default = true];\n  optional string objc_class_prefix = 36;\n  optional string csharp_namespace = 37;\n  optional string swift_prefix = 39;\n  optional string php_class_prefix = 40;\n  optional string php_namespace = 41;\n  optional string php_metadata_namespace = 44;\n  optional string ruby_package = 45;\n  optional FeatureSet features = 50;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  enum OptimizeMode {\n    SPEED = 1;\n    CODE_SIZE = 2;\n    LITE_RUNTIME = 3;\n  }\n  extensions 1000 to max;\n  reserved 38, 42;\n  reserved \"php_generic_services\";\n}\nmessage MessageOptions {\n  optional bool message_set_wire_format = 1 [default = false];\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  optional bool deprecated = 3 [default = false];\n  optional bool map_entry = 7;\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  optional FeatureSet features = 12;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage ServiceOptions {\n  optional bool deprecated = 33 [default = false];\n  optional FeatureSet features = 34;\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- nopackage.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nimport \"options.proto\";\noption (file_option_str) = \"foo\";\nmessage Foo {\n  option (msg_option_str) = \"foo\";\n  oneof x {\n    string bar = 1;\n    string baz = 2;\n  }\n}\nextend google.protobuf.ExtensionRangeOptions {\n  int64 rand = 30000;\n}\n-- options.proto --\nsyntax = \"proto3\";\nimport \"google/protobuf/descriptor.proto\";\nextend google.protobuf.FileOptions {\n  string file_option_str = 30000;\n}\nextend google.protobuf.MessageOptions {\n  string msg_option_str = 30000;\n}\nextend google.protobuf.ServiceOptions {\n  string svc_option_str = 30000;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/Bar.txtar",
    "content": "-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// \"Keep if Bar\" are also kept for Svc and Svc.Do since those\n// elements depend on Bar.\n// Keep if Bar: comment on message Bar\nmessage Bar {\n  // Keep if Bar: comment on field foo\n  optional Foo foo = 1;\n  // Keep if Bar: comment on oneof status\n  oneof status {\n    // Keep if Bar: comment on field baz\n    Baz baz = 2;\n    // Keep if Bar: comment on field quz\n    Quz quz = 3;\n  }\n}\n// \"Keep if Foo\" are also kept for Bar, Svc, and Svc.Do since those\n// elements depend on Foo.\n// Keep if Foo: comment on message Foo\nmessage Foo {\n  // We keep the following comment for NestedFoo because we don't\n  // discard options or option comments even if we're only retaining\n  // a message as a namespace for another retained element.\n  // Keep if Foo: comment on field name\n  optional string name = 1;\n  // Keep if Foo: comment on field bits\n  repeated int64 bits = 2;\n  extensions 100 to max;\n  reserved 10 to 20;\n  reserved \"abc\", \"def\", \"ghi\";\n}\n// \"Keep if Baz\" and \"Keep if Quz\" are also kept for Bar, Svc, and Svc.Do\n// since those elements depend on Baz and Quz.\n// Keep if Baz: comment on enum Baz\nenum Baz {\n  // Keep if Baz: comment on enum value BAZ_UNSPECIFIED\n  BAZ_UNSPECIFIED = 0;\n}\n// Keep if Quz: comment on enum Quz\nenum Quz {\n  // Keep if Quz: comment on enum value QUZ_UNSPECIFIED\n  QUZ_UNSPECIFIED = 0;\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0\n      ],\n      \"span\": [\n        40,\n        0,\n        89,\n        1\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on message Foo\\n\",\n      \"trailingComments\": \" We keep the following comment for NestedFoo because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Foo\\\" are also kept for Bar, Svc, and Svc.Do since those\\n elements depend on Foo.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        40,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        49,\n        2,\n        27\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field name\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        49,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        49,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        49,\n        18,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        49,\n        25,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        51,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field bits\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        51,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        5\n      ],\n      \"span\": [\n        51,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        51,\n        17,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        51,\n        24,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9\n      ],\n      \"span\": [\n        54,\n        2,\n        20\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0\n      ],\n      \"span\": [\n        54,\n        11,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        1\n      ],\n      \"span\": [\n        54,\n        11,\n        13\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        2\n      ],\n      \"span\": [\n        54,\n        17,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10\n      ],\n      \"span\": [\n        56,\n        2,\n        31\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved names\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        0\n      ],\n      \"span\": [\n        56,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        1\n      ],\n      \"span\": [\n        56,\n        18,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        2\n      ],\n      \"span\": [\n        56,\n        25,\n        30\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5\n      ],\n      \"span\": [\n        58,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on extension range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0\n      ],\n      \"span\": [\n        58,\n        13,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        58,\n        13,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        2\n      ],\n      \"span\": [\n        58,\n        20,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1\n      ],\n      \"span\": [\n        95,\n        0,\n        105,\n        1\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on message Bar\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Bar\\\" are also kept for Svc and Svc.Do since those\\n elements depend on Bar.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        1\n      ],\n      \"span\": [\n        95,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        97,\n        2,\n        23\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field foo\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        97,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        6\n      ],\n      \"span\": [\n        97,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        97,\n        15,\n        18\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        97,\n        21,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        8,\n        0\n      ],\n      \"span\": [\n        99,\n        2,\n        104,\n        3\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on oneof status\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        8,\n        0,\n        1\n      ],\n      \"span\": [\n        99,\n        8,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1\n      ],\n      \"span\": [\n        101,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field baz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        6\n      ],\n      \"span\": [\n        101,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        101,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        101,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2\n      ],\n      \"span\": [\n        103,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field quz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        6\n      ],\n      \"span\": [\n        103,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        1\n      ],\n      \"span\": [\n        103,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        3\n      ],\n      \"span\": [\n        103,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0\n      ],\n      \"span\": [\n        111,\n        0,\n        114,\n        1\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum Baz\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Baz\\\" and \\\"Keep if Quz\\\" are also kept for Bar, Svc, and Svc.Do\\n since those elements depend on Baz and Quz.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        111,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        113,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum value BAZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        113,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        113,\n        20,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1\n      ],\n      \"span\": [\n        117,\n        0,\n        120,\n        1\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum Quz\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        1\n      ],\n      \"span\": [\n        117,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        119,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum value QUZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        119,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        119,\n        20,\n        21\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/Baz.txtar",
    "content": "-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// \"Keep if Baz\" and \"Keep if Quz\" are also kept for Bar, Svc, and Svc.Do\n// since those elements depend on Baz and Quz.\n// Keep if Baz: comment on enum Baz\nenum Baz {\n  // Keep if Baz: comment on enum value BAZ_UNSPECIFIED\n  BAZ_UNSPECIFIED = 0;\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0\n      ],\n      \"span\": [\n        111,\n        0,\n        114,\n        1\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum Baz\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Baz\\\" and \\\"Keep if Quz\\\" are also kept for Bar, Svc, and Svc.Do\\n since those elements depend on Baz and Quz.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        111,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        113,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum value BAZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        113,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        113,\n        20,\n        21\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/Do.txtar",
    "content": "-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// \"Keep if Bar\" are also kept for Svc and Svc.Do since those\n// elements depend on Bar.\n// Keep if Bar: comment on message Bar\nmessage Bar {\n  // Keep if Bar: comment on field foo\n  optional Foo foo = 1;\n  // Keep if Bar: comment on oneof status\n  oneof status {\n    // Keep if Bar: comment on field baz\n    Baz baz = 2;\n    // Keep if Bar: comment on field quz\n    Quz quz = 3;\n  }\n}\n// \"Keep if Foo\" are also kept for Bar, Svc, and Svc.Do since those\n// elements depend on Foo.\n// Keep if Foo: comment on message Foo\nmessage Foo {\n  // We keep the following comment for NestedFoo because we don't\n  // discard options or option comments even if we're only retaining\n  // a message as a namespace for another retained element.\n  // Keep if Foo: comment on field name\n  optional string name = 1;\n  // Keep if Foo: comment on field bits\n  repeated int64 bits = 2;\n  extensions 100 to max;\n  reserved 10 to 20;\n  reserved \"abc\", \"def\", \"ghi\";\n}\n// \"Keep if Baz\" and \"Keep if Quz\" are also kept for Bar, Svc, and Svc.Do\n// since those elements depend on Baz and Quz.\n// Keep if Baz: comment on enum Baz\nenum Baz {\n  // Keep if Baz: comment on enum value BAZ_UNSPECIFIED\n  BAZ_UNSPECIFIED = 0;\n}\n// Keep if Quz: comment on enum Quz\nenum Quz {\n  // Keep if Quz: comment on enum value QUZ_UNSPECIFIED\n  QUZ_UNSPECIFIED = 0;\n}\n// Keep if Svc: comment on service Svc\nservice Svc {\n  // Keep if Svc.Do: comment on rpc Do\n  rpc Do ( Foo ) returns ( Bar ) {\n    // Keep if Svc.Do: comment on option\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0\n      ],\n      \"span\": [\n        40,\n        0,\n        89,\n        1\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on message Foo\\n\",\n      \"trailingComments\": \" We keep the following comment for NestedFoo because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Foo\\\" are also kept for Bar, Svc, and Svc.Do since those\\n elements depend on Foo.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        40,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        49,\n        2,\n        27\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field name\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        49,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        49,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        49,\n        18,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        49,\n        25,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        51,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field bits\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        51,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        5\n      ],\n      \"span\": [\n        51,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        51,\n        17,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        51,\n        24,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9\n      ],\n      \"span\": [\n        54,\n        2,\n        20\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0\n      ],\n      \"span\": [\n        54,\n        11,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        1\n      ],\n      \"span\": [\n        54,\n        11,\n        13\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        2\n      ],\n      \"span\": [\n        54,\n        17,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10\n      ],\n      \"span\": [\n        56,\n        2,\n        31\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved names\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        0\n      ],\n      \"span\": [\n        56,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        1\n      ],\n      \"span\": [\n        56,\n        18,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        2\n      ],\n      \"span\": [\n        56,\n        25,\n        30\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5\n      ],\n      \"span\": [\n        58,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on extension range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0\n      ],\n      \"span\": [\n        58,\n        13,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        58,\n        13,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        2\n      ],\n      \"span\": [\n        58,\n        20,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1\n      ],\n      \"span\": [\n        95,\n        0,\n        105,\n        1\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on message Bar\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Bar\\\" are also kept for Svc and Svc.Do since those\\n elements depend on Bar.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        1\n      ],\n      \"span\": [\n        95,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        97,\n        2,\n        23\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field foo\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        97,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        6\n      ],\n      \"span\": [\n        97,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        97,\n        15,\n        18\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        97,\n        21,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        8,\n        0\n      ],\n      \"span\": [\n        99,\n        2,\n        104,\n        3\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on oneof status\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        8,\n        0,\n        1\n      ],\n      \"span\": [\n        99,\n        8,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1\n      ],\n      \"span\": [\n        101,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field baz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        6\n      ],\n      \"span\": [\n        101,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        101,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        101,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2\n      ],\n      \"span\": [\n        103,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field quz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        6\n      ],\n      \"span\": [\n        103,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        1\n      ],\n      \"span\": [\n        103,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        3\n      ],\n      \"span\": [\n        103,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0\n      ],\n      \"span\": [\n        111,\n        0,\n        114,\n        1\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum Baz\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Baz\\\" and \\\"Keep if Quz\\\" are also kept for Bar, Svc, and Svc.Do\\n since those elements depend on Baz and Quz.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        111,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        113,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum value BAZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        113,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        113,\n        20,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1\n      ],\n      \"span\": [\n        117,\n        0,\n        120,\n        1\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum Quz\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        1\n      ],\n      \"span\": [\n        117,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        119,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum value QUZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        119,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        119,\n        20,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0\n      ],\n      \"span\": [\n        141,\n        0,\n        153,\n        1\n      ],\n      \"leadingComments\": \" Keep if Svc: comment on service Svc\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        1\n      ],\n      \"span\": [\n        141,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        146,\n        2,\n        149,\n        3\n      ],\n      \"leadingComments\": \" Keep if Svc.Do: comment on rpc Do\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        146,\n        6,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        146,\n        9,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        146,\n        23,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        148,\n        4,\n        47\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        4,\n        34\n      ],\n      \"span\": [\n        148,\n        4,\n        47\n      ],\n      \"leadingComments\": \" Keep if Svc.Do: comment on option\\n\"\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/Foo+Ext.txtar",
    "content": "-- google/protobuf/descriptor.proto --\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\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//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// The messages in this file describe the definitions found in .proto files.\n// A valid .proto file can be translated directly to a FileDescriptorProto\n// without any other information (e.g. without reading its imports).\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\n// descriptor.proto must be optimized for speed because reflection-based\n// algorithms don't work during bootstrapping.\noption optimize_for = SPEED;\n// ===================================================================\n// Features\n// TODO Enums in C++ gencode (and potentially other languages) are\n// not well scoped.  This means that each of the feature enums below can clash\n// with each other.  The short names we've chosen maximize call-site\n// readability, but leave us very open to this scenario.  A future feature will\n// be designed and implemented to handle this, hopefully before we ever hit a\n// conflict here.\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      // Default pre-EDITION_2024, all UNSET visibility are export.\n      EXPORT_ALL = 1;\n      // All top-level symbols default to export, nested default to local.\n      EXPORT_TOP_LEVEL = 2;\n      // All symbols default to local.\n      LOCAL_ALL = 3;\n      // All symbols local by default. Nested types cannot be exported.\n      // With special case caveat for message { enum {} reserved 1 to max; }\n      // This is the recommended setting for new protos.\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  // Set true to use the old proto1 MessageSet wire format for extensions.\n  // This is provided for backwards-compatibility with the MessageSet wire\n  // format.  You should not use this for any other reason:  It's less\n  // efficient, has fewer features, and is more complicated.\n  //\n  // The message must be defined exactly as follows:\n  //   message Foo {\n  //     option message_set_wire_format = true;\n  //     extensions 4 to max;\n  //   }\n  // Note that the message cannot have any defined fields; MessageSets only\n  // have extensions.\n  //\n  // All extensions of your type must be singular messages; e.g. they cannot\n  // be int32s, enums, or repeated messages.\n  //\n  // Because this is an option, the above two restrictions are not enforced by\n  // the protocol compiler.\n  optional bool message_set_wire_format = 1 [default = false];\n  // Disables the generation of the standard \"descriptor()\" accessor, which can\n  // conflict with a field of the same name.  This is meant to make migration\n  // from proto1 easier; new code should avoid fields named \"descriptor\".\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  // Is this message deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the message, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating messages.\n  optional bool deprecated = 3 [default = false];\n  // Whether the message is an automatically generated map entry type for the\n  // maps field.\n  //\n  // For maps fields:\n  //     map<KeyType, ValueType> map_field = 1;\n  // The parsed descriptor looks like:\n  //     message MapFieldEntry {\n  //         option map_entry = true;\n  //         optional KeyType key = 1;\n  //         optional ValueType value = 2;\n  //     }\n  //     repeated MapFieldEntry map_field = 1;\n  //\n  // Implementations may choose not to generate the map_entry=true message, but\n  // use a native map in the target language to hold the keys and values.\n  // The reflection APIs in such implementations still need to work as\n  // if the field is a repeated message field.\n  //\n  // NOTE: Do not set the option in .proto files. Always use the maps syntax\n  // instead. The option should only be implicitly set by the proto compiler\n  // parser.\n  optional bool map_entry = 7;\n  // Enable the legacy handling of JSON field name conflicts.  This lowercases\n  // and strips underscored from the fields before comparison in proto3 only.\n  // The new behavior takes `json_name` into account and applies to proto2 as\n  // well.\n  //\n  // This should only be used as a temporary measure against broken builds due\n  // to the change in behavior for JSON field name conflicts.\n  //\n  // TODO This is legacy behavior we plan to remove once downstream\n  // teams have had time to migrate.\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 12;\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\n// A message representing a option the parser does not recognize. This only\n// appears in options protos created by the compiler::Parser class.\n// DescriptorPool resolves these when building Descriptor objects. Therefore,\n// options protos in descriptor objects (e.g. returned by Descriptor::options(),\n// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\n// in them.\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  // The value of the uninterpreted option, in whatever type the tokenizer\n  // identified it as during parsing. Exactly one of these should be set.\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  // The name of the uninterpreted option.  Each string represents a segment in\n  // a dot-separated name.  is_extension is true iff a segment represents an\n  // extension (denoted with parentheses in options specs in .proto files).\n  // E.g.,{ [\"foo\", false], [\"bar.baz\", true], [\"moo\", false] } represents\n  // \"foo.(bar.baz).moo\".\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep if ext: comment on import descriptor.proto\nimport \"google/protobuf/descriptor.proto\";\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// \"Keep if Foo\" are also kept for Bar, Svc, and Svc.Do since those\n// elements depend on Foo.\n// Keep if Foo: comment on message Foo\nmessage Foo {\n  // We keep the following comment for NestedFoo because we don't\n  // discard options or option comments even if we're only retaining\n  // a message as a namespace for another retained element.\n  // Keep if Foo | NestedFoo: comment on option\n  option (bizniz) = \"abc\";\n  // Keep if Foo: comment on field name\n  optional string name = 1;\n  // Keep if Foo: comment on field bits\n  repeated int64 bits = 2;\n  message NestedFoo {\n    // Keep if Foo + ext | NestedFoo: comment on option\n    option (bizniz) = \"abc\";\n    // Keep if Foo + ext: comment on extend block\n    extend Foo {\n      // Keep if Foo + ext: comment on extension blah\n      repeated bytes blah = 101;\n    }\n  }\n  extensions 100 to max;\n  reserved 10 to 20;\n  reserved \"abc\", \"def\", \"ghi\";\n}\n// Keep if ext: comment on extend block\nextend google.protobuf.MessageOptions {\n  // Keep if ext: comment on custom option bizniz\n  optional string bizniz = 10101;\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        3,\n        0\n      ],\n      \"span\": [\n        10,\n        0,\n        42\n      ],\n      \"leadingComments\": \" Keep if ext: comment on import descriptor.proto\\n\"\n    },\n    {\n      \"path\": [\n        7\n      ],\n      \"span\": [\n        19,\n        0,\n        22,\n        1\n      ],\n      \"leadingComments\": \" Keep if ext: comment on extend block\\n\"\n    },\n    {\n      \"path\": [\n        7,\n        0\n      ],\n      \"span\": [\n        21,\n        2,\n        33\n      ],\n      \"leadingComments\": \" Keep if ext: comment on custom option bizniz\\n\"\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        2\n      ],\n      \"span\": [\n        19,\n        7,\n        37\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        4\n      ],\n      \"span\": [\n        21,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        5\n      ],\n      \"span\": [\n        21,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        1\n      ],\n      \"span\": [\n        21,\n        18,\n        24\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        3\n      ],\n      \"span\": [\n        21,\n        27,\n        32\n      ]\n    },\n    {\n      \"path\": [\n        7\n      ],\n      \"span\": [\n        25,\n        0,\n        28,\n        1\n      ],\n      \"leadingComments\": \" Keep if ext: comment on extend block\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0\n      ],\n      \"span\": [\n        40,\n        0,\n        89,\n        1\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on message Foo\\n\",\n      \"trailingComments\": \" We keep the following comment for NestedFoo because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Foo\\\" are also kept for Bar, Svc, and Svc.Do since those\\n elements depend on Foo.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        40,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        7\n      ],\n      \"span\": [\n        46,\n        2,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        7,\n        10101\n      ],\n      \"span\": [\n        46,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo | NestedFoo: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        49,\n        2,\n        27\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field name\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        49,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        49,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        49,\n        18,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        49,\n        25,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        51,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field bits\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        51,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        5\n      ],\n      \"span\": [\n        51,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        51,\n        17,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        51,\n        24,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9\n      ],\n      \"span\": [\n        54,\n        2,\n        20\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0\n      ],\n      \"span\": [\n        54,\n        11,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        1\n      ],\n      \"span\": [\n        54,\n        11,\n        13\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        2\n      ],\n      \"span\": [\n        54,\n        17,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10\n      ],\n      \"span\": [\n        56,\n        2,\n        31\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved names\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        0\n      ],\n      \"span\": [\n        56,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        1\n      ],\n      \"span\": [\n        56,\n        18,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        2\n      ],\n      \"span\": [\n        56,\n        25,\n        30\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5\n      ],\n      \"span\": [\n        58,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on extension range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0\n      ],\n      \"span\": [\n        58,\n        13,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        58,\n        13,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        2\n      ],\n      \"span\": [\n        58,\n        20,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0\n      ],\n      \"span\": [\n        61,\n        2,\n        88,\n        3\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        1\n      ],\n      \"span\": [\n        61,\n        10,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        7\n      ],\n      \"span\": [\n        67,\n        4,\n        28\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        7,\n        10101\n      ],\n      \"span\": [\n        67,\n        4,\n        28\n      ],\n      \"leadingComments\": \" Keep if Foo + ext | NestedFoo: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        6\n      ],\n      \"span\": [\n        84,\n        4,\n        87,\n        5\n      ],\n      \"leadingComments\": \" Keep if Foo + ext: comment on extend block\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        6,\n        0\n      ],\n      \"span\": [\n        86,\n        6,\n        32\n      ],\n      \"leadingComments\": \" Keep if Foo + ext: comment on extension blah\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        6,\n        0,\n        2\n      ],\n      \"span\": [\n        84,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        6,\n        0,\n        4\n      ],\n      \"span\": [\n        86,\n        6,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        6,\n        0,\n        5\n      ],\n      \"span\": [\n        86,\n        15,\n        20\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        6,\n        0,\n        1\n      ],\n      \"span\": [\n        86,\n        21,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        6,\n        0,\n        3\n      ],\n      \"span\": [\n        86,\n        28,\n        31\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/Foo.txtar",
    "content": "-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// \"Keep if Foo\" are also kept for Bar, Svc, and Svc.Do since those\n// elements depend on Foo.\n// Keep if Foo: comment on message Foo\nmessage Foo {\n  // We keep the following comment for NestedFoo because we don't\n  // discard options or option comments even if we're only retaining\n  // a message as a namespace for another retained element.\n  // Keep if Foo: comment on field name\n  optional string name = 1;\n  // Keep if Foo: comment on field bits\n  repeated int64 bits = 2;\n  extensions 100 to max;\n  reserved 10 to 20;\n  reserved \"abc\", \"def\", \"ghi\";\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0\n      ],\n      \"span\": [\n        40,\n        0,\n        89,\n        1\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on message Foo\\n\",\n      \"trailingComments\": \" We keep the following comment for NestedFoo because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Foo\\\" are also kept for Bar, Svc, and Svc.Do since those\\n elements depend on Foo.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        40,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        49,\n        2,\n        27\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field name\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        49,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        49,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        49,\n        18,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        49,\n        25,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        51,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field bits\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        51,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        5\n      ],\n      \"span\": [\n        51,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        51,\n        17,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        51,\n        24,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9\n      ],\n      \"span\": [\n        54,\n        2,\n        20\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0\n      ],\n      \"span\": [\n        54,\n        11,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        1\n      ],\n      \"span\": [\n        54,\n        11,\n        13\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        2\n      ],\n      \"span\": [\n        54,\n        17,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10\n      ],\n      \"span\": [\n        56,\n        2,\n        31\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved names\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        0\n      ],\n      \"span\": [\n        56,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        1\n      ],\n      \"span\": [\n        56,\n        18,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        2\n      ],\n      \"span\": [\n        56,\n        25,\n        30\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5\n      ],\n      \"span\": [\n        58,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on extension range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0\n      ],\n      \"span\": [\n        58,\n        13,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        58,\n        13,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        2\n      ],\n      \"span\": [\n        58,\n        20,\n        23\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/NestedFoo.txtar",
    "content": "-- google/protobuf/any.proto --\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\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//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\n// `Any` contains an arbitrary serialized protocol buffer message along with a\n// URL that describes the type of the serialized message.\n//\n// Protobuf library provides support to pack/unpack Any values in the form\n// of utility functions or additional generated methods of the Any type.\n//\n// Example 1: Pack and unpack a message in C++.\n//\n//     Foo foo = ...;\n//     Any any;\n//     any.PackFrom(foo);\n//     ...\n//     if (any.UnpackTo(&foo)) {\n//       ...\n//     }\n//\n// Example 2: Pack and unpack a message in Java.\n//\n//     Foo foo = ...;\n//     Any any = Any.pack(foo);\n//     ...\n//     if (any.is(Foo.class)) {\n//       foo = any.unpack(Foo.class);\n//     }\n//     // or ...\n//     if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n//       foo = any.unpack(Foo.getDefaultInstance());\n//     }\n//\n//  Example 3: Pack and unpack a message in Python.\n//\n//     foo = Foo(...)\n//     any = Any()\n//     any.Pack(foo)\n//     ...\n//     if any.Is(Foo.DESCRIPTOR):\n//       any.Unpack(foo)\n//       ...\n//\n//  Example 4: Pack and unpack a message in Go\n//\n//      foo := &pb.Foo{...}\n//      any, err := anypb.New(foo)\n//      if err != nil {\n//        ...\n//      }\n//      ...\n//      foo := &pb.Foo{}\n//      if err := any.UnmarshalTo(foo); err != nil {\n//        ...\n//      }\n//\n// The pack methods provided by protobuf library will by default use\n// 'type.googleapis.com/full.type.name' as the type URL and the unpack\n// methods only use the fully qualified type name after the last '/'\n// in the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n// name \"y.z\".\n//\n// JSON\n// ====\n// The JSON representation of an `Any` value uses the regular\n// representation of the deserialized, embedded message, with an\n// additional field `@type` which contains the type URL. Example:\n//\n//     package google.profile;\n//     message Person {\n//       string first_name = 1;\n//       string last_name = 2;\n//     }\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.profile.Person\",\n//       \"firstName\": <string>,\n//       \"lastName\": <string>\n//     }\n//\n// If the embedded message type is well-known and has a custom JSON\n// representation, that representation will be embedded adding a field\n// `value` which holds the custom JSON in addition to the `@type`\n// field. Example (for message [google.protobuf.Duration][]):\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n//       \"value\": \"1.212s\"\n//     }\n//\nmessage Any {\n  // A URL/resource name that uniquely identifies the type of the serialized\n  // protocol buffer message. This string must contain at least\n  // one \"/\" character. The last segment of the URL's path must represent\n  // the fully qualified name of the type (as in\n  // `path/google.protobuf.Duration`). The name should be in a canonical form\n  // (e.g., leading \".\" is not accepted).\n  //\n  // In practice, teams usually precompile into the binary all types that they\n  // expect it to use in the context of Any. However, for URLs which use the\n  // scheme `http`, `https`, or no scheme, one can optionally set up a type\n  // server that maps type URLs to message definitions as follows:\n  //\n  // * If no scheme is provided, `https` is assumed.\n  // * An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  //   value in binary format, or produce an error.\n  // * Applications are allowed to cache lookup results based on the\n  //   URL, or have them precompiled into a binary to avoid any\n  //   lookup. Therefore, binary compatibility needs to be preserved\n  //   on changes to types. (Use versioned type names to manage\n  //   breaking changes.)\n  //\n  // Note: this functionality is not currently available in the official\n  // protobuf release, and it is not used for type URLs beginning with\n  // type.googleapis.com. As of May 2023, there are no widely used type server\n  // implementations and no plans to implement one.\n  //\n  // Schemes other than `http`, `https` (or the empty scheme) might be\n  // used with implementation specific semantics.\n  //\n  string type_url = 1;\n  // Must be a valid serialized protocol buffer of the above specified type.\n  bytes value = 2;\n}\n-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep if NestedFoo: comment on import any.proto\nimport \"google/protobuf/any.proto\";\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\nmessage Foo {\n  // Keep if NestedFoo: comment on message NestedFoo\n  message NestedFoo {\n    // We keep the following comment for Foo + ext because we don't\n    // discard options or option comments even if we're only retaining\n    // a message as a namespace for another retained element.\n    // Keep if NestedFoo: comment on field uid\n    optional uint64 uid = 1;\n    // Keep if NestedFoo: comment on field meta\n    repeated google.protobuf.Any meta = 2;\n    // Keep if NestedFoo: comment on field state\n    optional State state = 3;\n    // Keep if NestedFoo: comment on enum State\n    enum State {\n      // Keep if NestedFoo: comment on enum value STATE_UNSPECIFIED\n      STATE_UNSPECIFIED = 0;\n      // Keep if NestedFoo: comment on enum value STATE_GOOD\n      STATE_GOOD = 1;\n    }\n  }\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        3,\n        0\n      ],\n      \"span\": [\n        16,\n        0,\n        40\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on import any.proto\\n\"\n    },\n    {\n      \"path\": [\n        11,\n        0\n      ],\n      \"span\": [\n        16,\n        7,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0\n      ],\n      \"span\": [\n        40,\n        0,\n        89,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        40,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0\n      ],\n      \"span\": [\n        61,\n        2,\n        88,\n        3\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on message NestedFoo\\n\",\n      \"trailingComments\": \" We keep the following comment for Foo + ext because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        1\n      ],\n      \"span\": [\n        61,\n        10,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        69,\n        4,\n        28\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on field uid\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        69,\n        4,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        69,\n        13,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        69,\n        20,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        69,\n        26,\n        27\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        71,\n        4,\n        42\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on field meta\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        71,\n        4,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        1,\n        6\n      ],\n      \"span\": [\n        71,\n        13,\n        32\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        71,\n        33,\n        37\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        71,\n        40,\n        41\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        2\n      ],\n      \"span\": [\n        73,\n        4,\n        29\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on field state\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        2,\n        4\n      ],\n      \"span\": [\n        73,\n        4,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        2,\n        6\n      ],\n      \"span\": [\n        73,\n        13,\n        18\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        2,\n        1\n      ],\n      \"span\": [\n        73,\n        19,\n        24\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        2,\n        2,\n        3\n      ],\n      \"span\": [\n        73,\n        27,\n        28\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0\n      ],\n      \"span\": [\n        76,\n        4,\n        81,\n        5\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on enum State\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        76,\n        9,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        78,\n        6,\n        28\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on enum value STATE_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        78,\n        6,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        78,\n        26,\n        27\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        80,\n        6,\n        21\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on enum value STATE_GOOD\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        80,\n        6,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        3,\n        0,\n        4,\n        0,\n        2,\n        1,\n        2\n      ],\n      \"span\": [\n        80,\n        19,\n        20\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/Quz.txtar",
    "content": "-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// Keep if Quz: comment on enum Quz\nenum Quz {\n  // Keep if Quz: comment on enum value QUZ_UNSPECIFIED\n  QUZ_UNSPECIFIED = 0;\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0\n      ],\n      \"span\": [\n        117,\n        0,\n        120,\n        1\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum Quz\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        117,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        119,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum value QUZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        119,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        119,\n        20,\n        21\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/Svc.txtar",
    "content": "-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// \"Keep if Bar\" are also kept for Svc and Svc.Do since those\n// elements depend on Bar.\n// Keep if Bar: comment on message Bar\nmessage Bar {\n  // Keep if Bar: comment on field foo\n  optional Foo foo = 1;\n  // Keep if Bar: comment on oneof status\n  oneof status {\n    // Keep if Bar: comment on field baz\n    Baz baz = 2;\n    // Keep if Bar: comment on field quz\n    Quz quz = 3;\n  }\n}\n// \"Keep if Foo\" are also kept for Bar, Svc, and Svc.Do since those\n// elements depend on Foo.\n// Keep if Foo: comment on message Foo\nmessage Foo {\n  // We keep the following comment for NestedFoo because we don't\n  // discard options or option comments even if we're only retaining\n  // a message as a namespace for another retained element.\n  // Keep if Foo: comment on field name\n  optional string name = 1;\n  // Keep if Foo: comment on field bits\n  repeated int64 bits = 2;\n  extensions 100 to max;\n  reserved 10 to 20;\n  reserved \"abc\", \"def\", \"ghi\";\n}\n// \"Keep if Baz\" and \"Keep if Quz\" are also kept for Bar, Svc, and Svc.Do\n// since those elements depend on Baz and Quz.\n// Keep if Baz: comment on enum Baz\nenum Baz {\n  // Keep if Baz: comment on enum value BAZ_UNSPECIFIED\n  BAZ_UNSPECIFIED = 0;\n}\n// Keep if Quz: comment on enum Quz\nenum Quz {\n  // Keep if Quz: comment on enum value QUZ_UNSPECIFIED\n  QUZ_UNSPECIFIED = 0;\n}\n// Keep if Svc: comment on service Svc\nservice Svc {\n  // Keep if Svc.Do: comment on rpc Do\n  rpc Do ( Foo ) returns ( Bar ) {\n    // Keep if Svc.Do: comment on option\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // Keep if Svc: comment on rpc Dont\n  rpc Dont ( Foo ) returns ( Bar );\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0\n      ],\n      \"span\": [\n        40,\n        0,\n        89,\n        1\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on message Foo\\n\",\n      \"trailingComments\": \" We keep the following comment for NestedFoo because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Foo\\\" are also kept for Bar, Svc, and Svc.Do since those\\n elements depend on Foo.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        40,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        49,\n        2,\n        27\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field name\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        49,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        49,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        49,\n        18,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        49,\n        25,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        51,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field bits\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        51,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        5\n      ],\n      \"span\": [\n        51,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        51,\n        17,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        51,\n        24,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9\n      ],\n      \"span\": [\n        54,\n        2,\n        20\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0\n      ],\n      \"span\": [\n        54,\n        11,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        1\n      ],\n      \"span\": [\n        54,\n        11,\n        13\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        9,\n        0,\n        2\n      ],\n      \"span\": [\n        54,\n        17,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10\n      ],\n      \"span\": [\n        56,\n        2,\n        31\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved names\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        0\n      ],\n      \"span\": [\n        56,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        1\n      ],\n      \"span\": [\n        56,\n        18,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        10,\n        2\n      ],\n      \"span\": [\n        56,\n        25,\n        30\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5\n      ],\n      \"span\": [\n        58,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on extension range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0\n      ],\n      \"span\": [\n        58,\n        13,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        58,\n        13,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        5,\n        0,\n        2\n      ],\n      \"span\": [\n        58,\n        20,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1\n      ],\n      \"span\": [\n        95,\n        0,\n        105,\n        1\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on message Bar\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Bar\\\" are also kept for Svc and Svc.Do since those\\n elements depend on Bar.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        1\n      ],\n      \"span\": [\n        95,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        97,\n        2,\n        23\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field foo\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        97,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        6\n      ],\n      \"span\": [\n        97,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        97,\n        15,\n        18\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        97,\n        21,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        8,\n        0\n      ],\n      \"span\": [\n        99,\n        2,\n        104,\n        3\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on oneof status\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        8,\n        0,\n        1\n      ],\n      \"span\": [\n        99,\n        8,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1\n      ],\n      \"span\": [\n        101,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field baz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        6\n      ],\n      \"span\": [\n        101,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        101,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        101,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2\n      ],\n      \"span\": [\n        103,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field quz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        6\n      ],\n      \"span\": [\n        103,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        1\n      ],\n      \"span\": [\n        103,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        2,\n        3\n      ],\n      \"span\": [\n        103,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0\n      ],\n      \"span\": [\n        111,\n        0,\n        114,\n        1\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum Baz\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Baz\\\" and \\\"Keep if Quz\\\" are also kept for Bar, Svc, and Svc.Do\\n since those elements depend on Baz and Quz.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        111,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        113,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum value BAZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        113,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        113,\n        20,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1\n      ],\n      \"span\": [\n        117,\n        0,\n        120,\n        1\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum Quz\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        1\n      ],\n      \"span\": [\n        117,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        119,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum value QUZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        119,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        119,\n        20,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0\n      ],\n      \"span\": [\n        141,\n        0,\n        153,\n        1\n      ],\n      \"leadingComments\": \" Keep if Svc: comment on service Svc\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        1\n      ],\n      \"span\": [\n        141,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        146,\n        2,\n        149,\n        3\n      ],\n      \"leadingComments\": \" Keep if Svc.Do: comment on rpc Do\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        146,\n        6,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        146,\n        9,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        146,\n        23,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        148,\n        4,\n        47\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        4,\n        34\n      ],\n      \"span\": [\n        148,\n        4,\n        47\n      ],\n      \"leadingComments\": \" Keep if Svc.Do: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        152,\n        2,\n        30\n      ],\n      \"leadingComments\": \" Keep if Svc: comment on rpc Dont\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        152,\n        6,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        1,\n        2\n      ],\n      \"span\": [\n        152,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        152,\n        25,\n        28\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/all.txtar",
    "content": "-- google/protobuf/any.proto --\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\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//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\nsyntax = \"proto3\";\npackage google.protobuf;\noption csharp_namespace = \"Google.Protobuf.WellKnownTypes\";\noption go_package = \"google.golang.org/protobuf/types/known/anypb\";\noption java_multiple_files = true;\noption java_outer_classname = \"AnyProto\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\n// `Any` contains an arbitrary serialized protocol buffer message along with a\n// URL that describes the type of the serialized message.\n//\n// Protobuf library provides support to pack/unpack Any values in the form\n// of utility functions or additional generated methods of the Any type.\n//\n// Example 1: Pack and unpack a message in C++.\n//\n//     Foo foo = ...;\n//     Any any;\n//     any.PackFrom(foo);\n//     ...\n//     if (any.UnpackTo(&foo)) {\n//       ...\n//     }\n//\n// Example 2: Pack and unpack a message in Java.\n//\n//     Foo foo = ...;\n//     Any any = Any.pack(foo);\n//     ...\n//     if (any.is(Foo.class)) {\n//       foo = any.unpack(Foo.class);\n//     }\n//     // or ...\n//     if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n//       foo = any.unpack(Foo.getDefaultInstance());\n//     }\n//\n//  Example 3: Pack and unpack a message in Python.\n//\n//     foo = Foo(...)\n//     any = Any()\n//     any.Pack(foo)\n//     ...\n//     if any.Is(Foo.DESCRIPTOR):\n//       any.Unpack(foo)\n//       ...\n//\n//  Example 4: Pack and unpack a message in Go\n//\n//      foo := &pb.Foo{...}\n//      any, err := anypb.New(foo)\n//      if err != nil {\n//        ...\n//      }\n//      ...\n//      foo := &pb.Foo{}\n//      if err := any.UnmarshalTo(foo); err != nil {\n//        ...\n//      }\n//\n// The pack methods provided by protobuf library will by default use\n// 'type.googleapis.com/full.type.name' as the type URL and the unpack\n// methods only use the fully qualified type name after the last '/'\n// in the type URL, for example \"foo.bar.com/x/y.z\" will yield type\n// name \"y.z\".\n//\n// JSON\n// ====\n// The JSON representation of an `Any` value uses the regular\n// representation of the deserialized, embedded message, with an\n// additional field `@type` which contains the type URL. Example:\n//\n//     package google.profile;\n//     message Person {\n//       string first_name = 1;\n//       string last_name = 2;\n//     }\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.profile.Person\",\n//       \"firstName\": <string>,\n//       \"lastName\": <string>\n//     }\n//\n// If the embedded message type is well-known and has a custom JSON\n// representation, that representation will be embedded adding a field\n// `value` which holds the custom JSON in addition to the `@type`\n// field. Example (for message [google.protobuf.Duration][]):\n//\n//     {\n//       \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n//       \"value\": \"1.212s\"\n//     }\n//\nmessage Any {\n  // A URL/resource name that uniquely identifies the type of the serialized\n  // protocol buffer message. This string must contain at least\n  // one \"/\" character. The last segment of the URL's path must represent\n  // the fully qualified name of the type (as in\n  // `path/google.protobuf.Duration`). The name should be in a canonical form\n  // (e.g., leading \".\" is not accepted).\n  //\n  // In practice, teams usually precompile into the binary all types that they\n  // expect it to use in the context of Any. However, for URLs which use the\n  // scheme `http`, `https`, or no scheme, one can optionally set up a type\n  // server that maps type URLs to message definitions as follows:\n  //\n  // * If no scheme is provided, `https` is assumed.\n  // * An HTTP GET on the URL must yield a [google.protobuf.Type][]\n  //   value in binary format, or produce an error.\n  // * Applications are allowed to cache lookup results based on the\n  //   URL, or have them precompiled into a binary to avoid any\n  //   lookup. Therefore, binary compatibility needs to be preserved\n  //   on changes to types. (Use versioned type names to manage\n  //   breaking changes.)\n  //\n  // Note: this functionality is not currently available in the official\n  // protobuf release, and it is not used for type URLs beginning with\n  // type.googleapis.com. As of May 2023, there are no widely used type server\n  // implementations and no plans to implement one.\n  //\n  // Schemes other than `http`, `https` (or the empty scheme) might be\n  // used with implementation specific semantics.\n  //\n  string type_url = 1;\n  // Must be a valid serialized protocol buffer of the above specified type.\n  bytes value = 2;\n}\n-- google/protobuf/descriptor.proto --\n// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\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//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// The messages in this file describe the definitions found in .proto files.\n// A valid .proto file can be translated directly to a FileDescriptorProto\n// without any other information (e.g. without reading its imports).\nsyntax = \"proto2\";\npackage google.protobuf;\noption cc_enable_arenas = true;\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_outer_classname = \"DescriptorProtos\";\noption java_package = \"com.google.protobuf\";\noption objc_class_prefix = \"GPB\";\n// descriptor.proto must be optimized for speed because reflection-based\n// algorithms don't work during bootstrapping.\noption optimize_for = SPEED;\n// ===================================================================\n// Features\n// TODO Enums in C++ gencode (and potentially other languages) are\n// not well scoped.  This means that each of the feature enums below can clash\n// with each other.  The short names we've chosen maximize call-site\n// readability, but leave us very open to this scenario.  A future feature will\n// be designed and implemented to handle this, hopefully before we ever hit a\n// conflict here.\nmessage FeatureSet {\n  optional FieldPresence field_presence = 1 [\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"IMPLICIT\", edition: EDITION_PROTO3 },\n    edition_defaults = { value: \"EXPLICIT\", edition: EDITION_2023 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnumType enum_type = 2 [\n    edition_defaults = { value: \"CLOSED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"OPEN\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    edition_defaults = { value: \"EXPANDED\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"PACKED\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional Utf8Validation utf8_validation = 4 [\n    edition_defaults = { value: \"NONE\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"VERIFY\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional MessageEncoding message_encoding = 5 [\n    edition_defaults = { value: \"LENGTH_PREFIXED\", edition: EDITION_LEGACY },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional JsonFormat json_format = 6 [\n    edition_defaults = { value: \"LEGACY_BEST_EFFORT\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"ALLOW\", edition: EDITION_PROTO3 },\n    feature_support = { edition_introduced: EDITION_2023 },\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE\n  ];\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    edition_defaults = { value: \"STYLE_LEGACY\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"STYLE2024\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD\n  ];\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [\n    edition_defaults = { value: \"EXPORT_ALL\", edition: EDITION_LEGACY },\n    edition_defaults = { value: \"EXPORT_TOP_LEVEL\", edition: EDITION_2024 },\n    feature_support = { edition_introduced: EDITION_2024 },\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE\n  ];\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n      // Default pre-EDITION_2024, all UNSET visibility are export.\n      EXPORT_ALL = 1;\n      // All top-level symbols default to export, nested default to local.\n      EXPORT_TOP_LEVEL = 2;\n      // All symbols default to local.\n      LOCAL_ALL = 3;\n      // All symbols local by default. Nested types cannot be exported.\n      // With special case caveat for message { enum {} reserved 1 to max; }\n      // This is the recommended setting for new protos.\n      STRICT = 4;\n    }\n  }\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = {\n      number: 1002,\n      full_name: \".pb.go\",\n      type: \".pb.GoFeatures\"\n    },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 1100,\n      full_name: \".imp.impress_feature_set\",\n      type: \".imp.ImpressFeatureSet\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n  extensions 9995 to 9999, 10000;\n  reserved 999;\n}\nmessage MessageOptions {\n  // Set true to use the old proto1 MessageSet wire format for extensions.\n  // This is provided for backwards-compatibility with the MessageSet wire\n  // format.  You should not use this for any other reason:  It's less\n  // efficient, has fewer features, and is more complicated.\n  //\n  // The message must be defined exactly as follows:\n  //   message Foo {\n  //     option message_set_wire_format = true;\n  //     extensions 4 to max;\n  //   }\n  // Note that the message cannot have any defined fields; MessageSets only\n  // have extensions.\n  //\n  // All extensions of your type must be singular messages; e.g. they cannot\n  // be int32s, enums, or repeated messages.\n  //\n  // Because this is an option, the above two restrictions are not enforced by\n  // the protocol compiler.\n  optional bool message_set_wire_format = 1 [default = false];\n  // Disables the generation of the standard \"descriptor()\" accessor, which can\n  // conflict with a field of the same name.  This is meant to make migration\n  // from proto1 easier; new code should avoid fields named \"descriptor\".\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n  // Is this message deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the message, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating messages.\n  optional bool deprecated = 3 [default = false];\n  // Whether the message is an automatically generated map entry type for the\n  // maps field.\n  //\n  // For maps fields:\n  //     map<KeyType, ValueType> map_field = 1;\n  // The parsed descriptor looks like:\n  //     message MapFieldEntry {\n  //         option map_entry = true;\n  //         optional KeyType key = 1;\n  //         optional ValueType value = 2;\n  //     }\n  //     repeated MapFieldEntry map_field = 1;\n  //\n  // Implementations may choose not to generate the map_entry=true message, but\n  // use a native map in the target language to hold the keys and values.\n  // The reflection APIs in such implementations still need to work as\n  // if the field is a repeated message field.\n  //\n  // NOTE: Do not set the option in .proto files. Always use the maps syntax\n  // instead. The option should only be implicitly set by the proto compiler\n  // parser.\n  optional bool map_entry = 7;\n  // Enable the legacy handling of JSON field name conflicts.  This lowercases\n  // and strips underscored from the fields before comparison in proto3 only.\n  // The new behavior takes `json_name` into account and applies to proto2 as\n  // well.\n  //\n  // This should only be used as a temporary measure against broken builds due\n  // to the change in behavior for JSON field name conflicts.\n  //\n  // TODO This is legacy behavior we plan to remove once downstream\n  // teams have had time to migrate.\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 12;\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n  reserved 4, 5, 6, 8, 9;\n}\nmessage ServiceOptions {\n  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\n  //   framework.  We apologize for hoarding these numbers to ourselves, but\n  //   we were already using them long before we decided to release Protocol\n  //   Buffers.\n  // Is this service deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the service, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating services.\n  optional bool deprecated = 33 [default = false];\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 34;\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n  extensions 1000 to max;\n}\n// A message representing a option the parser does not recognize. This only\n// appears in options protos created by the compiler::Parser class.\n// DescriptorPool resolves these when building Descriptor objects. Therefore,\n// options protos in descriptor objects (e.g. returned by Descriptor::options(),\n// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\n// in them.\nmessage UninterpretedOption {\n  repeated NamePart name = 2;\n  // The value of the uninterpreted option, in whatever type the tokenizer\n  // identified it as during parsing. Exactly one of these should be set.\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n  // The name of the uninterpreted option.  Each string represents a segment in\n  // a dot-separated name.  is_extension is true iff a segment represents an\n  // extension (denoted with parentheses in options specs in .proto files).\n  // E.g.,{ [\"foo\", false], [\"bar.baz\", true], [\"moo\", false] } represents\n  // \"foo.(bar.baz).moo\".\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n}\n-- test.proto --\n// Keep 1: comment on syntax\nsyntax = \"proto2\";\n// Keep 2: comment on package\npackage foo.bar;\n// Keep if NestedFoo: comment on import any.proto\nimport \"google/protobuf/any.proto\";\n// Keep if ext: comment on import descriptor.proto\nimport \"google/protobuf/descriptor.proto\";\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n// \"Keep if Bar\" are also kept for Svc and Svc.Do since those\n// elements depend on Bar.\n// Keep if Bar: comment on message Bar\nmessage Bar {\n  // Keep if Bar: comment on field foo\n  optional Foo foo = 1;\n  // Keep if Bar: comment on oneof status\n  oneof status {\n    // Keep if Bar: comment on field baz\n    Baz baz = 2;\n    // Keep if Bar: comment on field quz\n    Quz quz = 3;\n  }\n}\n// Keep if all: comment on message Bedazzle\nmessage Bedazzle {\n  // Keep if all: comment on field t\n  optional string t = 1;\n}\n// Keep if all: comment on message Buzz\nmessage Buzz {\n  // Keep if all: comment on field s\n  optional string s = 1;\n}\n// \"Keep if Foo\" are also kept for Bar, Svc, and Svc.Do since those\n// elements depend on Foo.\n// Keep if Foo: comment on message Foo\nmessage Foo {\n  // We keep the following comment for NestedFoo because we don't\n  // discard options or option comments even if we're only retaining\n  // a message as a namespace for another retained element.\n  // Keep if Foo | NestedFoo: comment on option\n  option (bizniz) = \"abc\";\n  // Keep if Foo: comment on field name\n  optional string name = 1;\n  // Keep if Foo: comment on field bits\n  repeated int64 bits = 2;\n  // Keep if NestedFoo: comment on message NestedFoo\n  message NestedFoo {\n    // We keep the following comment for Foo + ext because we don't\n    // discard options or option comments even if we're only retaining\n    // a message as a namespace for another retained element.\n    // Keep if Foo + ext | NestedFoo: comment on option\n    option (bizniz) = \"abc\";\n    // Keep if NestedFoo: comment on field uid\n    optional uint64 uid = 1;\n    // Keep if NestedFoo: comment on field meta\n    repeated google.protobuf.Any meta = 2;\n    // Keep if NestedFoo: comment on field state\n    optional State state = 3;\n    // Keep if NestedFoo: comment on enum State\n    enum State {\n      // Keep if NestedFoo: comment on enum value STATE_UNSPECIFIED\n      STATE_UNSPECIFIED = 0;\n      // Keep if NestedFoo: comment on enum value STATE_GOOD\n      STATE_GOOD = 1;\n    }\n    // Keep if Foo + ext: comment on extend block\n    extend Foo {\n      // Keep if Foo + ext: comment on extension blah\n      repeated bytes blah = 101;\n    }\n  }\n  extensions 100 to max;\n  reserved 10 to 20;\n  reserved \"abc\", \"def\", \"ghi\";\n}\n// Keep if all: comment on message Frobnitz\nmessage Frobnitz {\n  // Keep if all: comment on field xyz\n  optional bytes xyz = 1;\n}\n// \"Keep if Baz\" and \"Keep if Quz\" are also kept for Bar, Svc, and Svc.Do\n// since those elements depend on Baz and Quz.\n// Keep if Baz: comment on enum Baz\nenum Baz {\n  // Keep if Baz: comment on enum value BAZ_UNSPECIFIED\n  BAZ_UNSPECIFIED = 0;\n}\n// Keep if Quz: comment on enum Quz\nenum Quz {\n  // Keep if Quz: comment on enum value QUZ_UNSPECIFIED\n  QUZ_UNSPECIFIED = 0;\n}\n// Keep if all: comment on service BuzzService\nservice BuzzService {\n  // Keep if all: comment on method BuzzyBuzz\n  rpc BuzzyBuzz ( Buzz ) returns ( Bedazzle );\n}\n// Keep if Svc: comment on service Svc\nservice Svc {\n  // Keep if Svc: comment on option\n  option (fizzbuzz) = \"wxyz\";\n  // Keep if Svc.Do: comment on rpc Do\n  rpc Do ( Foo ) returns ( Bar ) {\n    // Keep if Svc.Do: comment on option\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // Keep if Svc: comment on rpc Dont\n  rpc Dont ( Foo ) returns ( Bar );\n}\n// Keep if ext: comment on extend block\nextend google.protobuf.MessageOptions {\n  // Keep if ext: comment on custom option bizniz\n  optional string bizniz = 10101;\n}\n// Keep if ext: comment on extend block\nextend google.protobuf.ServiceOptions {\n  // Keep if ext + Svc: comment on custom option fizzbuzz\n  optional string fizzbuzz = 10101;\n}\n-- source_code_info.json --\n{\n  \"location\": [\n    {\n      \"span\": [\n        1,\n        0,\n        153,\n        1\n      ]\n    },\n    {\n      \"path\": [\n        12\n      ],\n      \"span\": [\n        1,\n        0,\n        18\n      ],\n      \"leadingComments\": \" Keep 1: comment on syntax\\n\"\n    },\n    {\n      \"path\": [\n        2\n      ],\n      \"span\": [\n        4,\n        0,\n        16\n      ],\n      \"leadingComments\": \" Keep 2: comment on package\\n\"\n    },\n    {\n      \"path\": [\n        8\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        8,\n        11\n      ],\n      \"span\": [\n        7,\n        0,\n        34\n      ],\n      \"leadingComments\": \" Keep 3: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        3,\n        0\n      ],\n      \"span\": [\n        10,\n        0,\n        42\n      ],\n      \"leadingComments\": \" Keep if ext: comment on import descriptor.proto\\n\"\n    },\n    {\n      \"path\": [\n        3,\n        1\n      ],\n      \"span\": [\n        16,\n        0,\n        40\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on import any.proto\\n\"\n    },\n    {\n      \"path\": [\n        11,\n        0\n      ],\n      \"span\": [\n        16,\n        7,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        7\n      ],\n      \"span\": [\n        19,\n        0,\n        22,\n        1\n      ],\n      \"leadingComments\": \" Keep if ext: comment on extend block\\n\"\n    },\n    {\n      \"path\": [\n        7,\n        0\n      ],\n      \"span\": [\n        21,\n        2,\n        33\n      ],\n      \"leadingComments\": \" Keep if ext: comment on custom option bizniz\\n\"\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        2\n      ],\n      \"span\": [\n        19,\n        7,\n        37\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        4\n      ],\n      \"span\": [\n        21,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        5\n      ],\n      \"span\": [\n        21,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        1\n      ],\n      \"span\": [\n        21,\n        18,\n        24\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        0,\n        3\n      ],\n      \"span\": [\n        21,\n        27,\n        32\n      ]\n    },\n    {\n      \"path\": [\n        7\n      ],\n      \"span\": [\n        25,\n        0,\n        28,\n        1\n      ],\n      \"leadingComments\": \" Keep if ext: comment on extend block\\n\"\n    },\n    {\n      \"path\": [\n        7,\n        1\n      ],\n      \"span\": [\n        27,\n        2,\n        35\n      ],\n      \"leadingComments\": \" Keep if ext + Svc: comment on custom option fizzbuzz\\n\"\n    },\n    {\n      \"path\": [\n        7,\n        1,\n        2\n      ],\n      \"span\": [\n        25,\n        7,\n        37\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        1,\n        4\n      ],\n      \"span\": [\n        27,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        1,\n        5\n      ],\n      \"span\": [\n        27,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        1,\n        1\n      ],\n      \"span\": [\n        27,\n        18,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        7,\n        1,\n        3\n      ],\n      \"span\": [\n        27,\n        29,\n        34\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0\n      ],\n      \"span\": [\n        31,\n        0,\n        34,\n        1\n      ],\n      \"leadingComments\": \" Keep if all: comment on message Frobnitz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        31,\n        8,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        33,\n        2,\n        25\n      ],\n      \"leadingComments\": \" Keep if all: comment on field xyz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        33,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        33,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        33,\n        17,\n        20\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        33,\n        23,\n        24\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1\n      ],\n      \"span\": [\n        40,\n        0,\n        89,\n        1\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on message Foo\\n\",\n      \"trailingComments\": \" We keep the following comment for NestedFoo because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Foo\\\" are also kept for Bar, Svc, and Svc.Do since those\\n elements depend on Foo.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        1\n      ],\n      \"span\": [\n        40,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        7\n      ],\n      \"span\": [\n        46,\n        2,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        7,\n        10101\n      ],\n      \"span\": [\n        46,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo | NestedFoo: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        49,\n        2,\n        27\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field name\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        49,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        49,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        49,\n        18,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        49,\n        25,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1\n      ],\n      \"span\": [\n        51,\n        2,\n        26\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on field bits\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        51,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        5\n      ],\n      \"span\": [\n        51,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        51,\n        17,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        51,\n        24,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        9\n      ],\n      \"span\": [\n        54,\n        2,\n        20\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        9,\n        0\n      ],\n      \"span\": [\n        54,\n        11,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        9,\n        0,\n        1\n      ],\n      \"span\": [\n        54,\n        11,\n        13\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        9,\n        0,\n        2\n      ],\n      \"span\": [\n        54,\n        17,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        10\n      ],\n      \"span\": [\n        56,\n        2,\n        31\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on reserved names\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        10,\n        0\n      ],\n      \"span\": [\n        56,\n        11,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        10,\n        1\n      ],\n      \"span\": [\n        56,\n        18,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        10,\n        2\n      ],\n      \"span\": [\n        56,\n        25,\n        30\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        5\n      ],\n      \"span\": [\n        58,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if Foo: comment on extension range\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        5,\n        0\n      ],\n      \"span\": [\n        58,\n        13,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        58,\n        13,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        5,\n        0,\n        2\n      ],\n      \"span\": [\n        58,\n        20,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0\n      ],\n      \"span\": [\n        61,\n        2,\n        88,\n        3\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on message NestedFoo\\n\",\n      \"trailingComments\": \" We keep the following comment for Foo + ext because we don't\\n discard options or option comments even if we're only retaining\\n a message as a namespace for another retained element.\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        1\n      ],\n      \"span\": [\n        61,\n        10,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        7\n      ],\n      \"span\": [\n        67,\n        4,\n        28\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        7,\n        10101\n      ],\n      \"span\": [\n        67,\n        4,\n        28\n      ],\n      \"leadingComments\": \" Keep if Foo + ext | NestedFoo: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        69,\n        4,\n        28\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on field uid\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        69,\n        4,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        69,\n        13,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        69,\n        20,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        69,\n        26,\n        27\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        71,\n        4,\n        42\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on field meta\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        1,\n        4\n      ],\n      \"span\": [\n        71,\n        4,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        1,\n        6\n      ],\n      \"span\": [\n        71,\n        13,\n        32\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        71,\n        33,\n        37\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        71,\n        40,\n        41\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        2\n      ],\n      \"span\": [\n        73,\n        4,\n        29\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on field state\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        2,\n        4\n      ],\n      \"span\": [\n        73,\n        4,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        2,\n        6\n      ],\n      \"span\": [\n        73,\n        13,\n        18\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        2,\n        1\n      ],\n      \"span\": [\n        73,\n        19,\n        24\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        2,\n        2,\n        3\n      ],\n      \"span\": [\n        73,\n        27,\n        28\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0\n      ],\n      \"span\": [\n        76,\n        4,\n        81,\n        5\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on enum State\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0,\n        1\n      ],\n      \"span\": [\n        76,\n        9,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        78,\n        6,\n        28\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on enum value STATE_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        78,\n        6,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        78,\n        26,\n        27\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0,\n        2,\n        1\n      ],\n      \"span\": [\n        80,\n        6,\n        21\n      ],\n      \"leadingComments\": \" Keep if NestedFoo: comment on enum value STATE_GOOD\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        80,\n        6,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        4,\n        0,\n        2,\n        1,\n        2\n      ],\n      \"span\": [\n        80,\n        19,\n        20\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        6\n      ],\n      \"span\": [\n        84,\n        4,\n        87,\n        5\n      ],\n      \"leadingComments\": \" Keep if Foo + ext: comment on extend block\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        6,\n        0\n      ],\n      \"span\": [\n        86,\n        6,\n        32\n      ],\n      \"leadingComments\": \" Keep if Foo + ext: comment on extension blah\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        6,\n        0,\n        2\n      ],\n      \"span\": [\n        84,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        6,\n        0,\n        4\n      ],\n      \"span\": [\n        86,\n        6,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        6,\n        0,\n        5\n      ],\n      \"span\": [\n        86,\n        15,\n        20\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        6,\n        0,\n        1\n      ],\n      \"span\": [\n        86,\n        21,\n        25\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        1,\n        3,\n        0,\n        6,\n        0,\n        3\n      ],\n      \"span\": [\n        86,\n        28,\n        31\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2\n      ],\n      \"span\": [\n        95,\n        0,\n        105,\n        1\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on message Bar\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Bar\\\" are also kept for Svc and Svc.Do since those\\n elements depend on Bar.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        1\n      ],\n      \"span\": [\n        95,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        0\n      ],\n      \"span\": [\n        97,\n        2,\n        23\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field foo\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        97,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        0,\n        6\n      ],\n      \"span\": [\n        97,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        97,\n        15,\n        18\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        97,\n        21,\n        22\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        8,\n        0\n      ],\n      \"span\": [\n        99,\n        2,\n        104,\n        3\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on oneof status\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        8,\n        0,\n        1\n      ],\n      \"span\": [\n        99,\n        8,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        1\n      ],\n      \"span\": [\n        101,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field baz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        1,\n        6\n      ],\n      \"span\": [\n        101,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        101,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        101,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        2\n      ],\n      \"span\": [\n        103,\n        4,\n        16\n      ],\n      \"leadingComments\": \" Keep if Bar: comment on field quz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        2,\n        6\n      ],\n      \"span\": [\n        103,\n        4,\n        7\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        2,\n        1\n      ],\n      \"span\": [\n        103,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        2,\n        2,\n        2,\n        3\n      ],\n      \"span\": [\n        103,\n        14,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0\n      ],\n      \"span\": [\n        111,\n        0,\n        114,\n        1\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum Baz\\n\",\n      \"leadingDetachedComments\": [\n        \" \\\"Keep if Baz\\\" and \\\"Keep if Quz\\\" are also kept for Bar, Svc, and Svc.Do\\n since those elements depend on Baz and Quz.\\n\"\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        1\n      ],\n      \"span\": [\n        111,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        113,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Baz: comment on enum value BAZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        113,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        113,\n        20,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1\n      ],\n      \"span\": [\n        117,\n        0,\n        120,\n        1\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum Quz\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        1\n      ],\n      \"span\": [\n        117,\n        5,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        119,\n        2,\n        22\n      ],\n      \"leadingComments\": \" Keep if Quz: comment on enum value QUZ_UNSPECIFIED\\n\"\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        119,\n        2,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        5,\n        1,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        119,\n        20,\n        21\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        3\n      ],\n      \"span\": [\n        123,\n        0,\n        126,\n        1\n      ],\n      \"leadingComments\": \" Keep if all: comment on message Buzz\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        3,\n        1\n      ],\n      \"span\": [\n        123,\n        8,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        3,\n        2,\n        0\n      ],\n      \"span\": [\n        125,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if all: comment on field s\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        3,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        125,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        3,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        125,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        3,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        125,\n        18,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        3,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        125,\n        22,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        4\n      ],\n      \"span\": [\n        129,\n        0,\n        132,\n        1\n      ],\n      \"leadingComments\": \" Keep if all: comment on message Bedazzle\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        4,\n        1\n      ],\n      \"span\": [\n        129,\n        8,\n        16\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        4,\n        2,\n        0\n      ],\n      \"span\": [\n        131,\n        2,\n        24\n      ],\n      \"leadingComments\": \" Keep if all: comment on field t\\n\"\n    },\n    {\n      \"path\": [\n        4,\n        4,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        131,\n        2,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        4,\n        2,\n        0,\n        5\n      ],\n      \"span\": [\n        131,\n        11,\n        17\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        4,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        131,\n        18,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        4,\n        4,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        131,\n        22,\n        23\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0\n      ],\n      \"span\": [\n        135,\n        0,\n        138,\n        1\n      ],\n      \"leadingComments\": \" Keep if all: comment on service BuzzService\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        1\n      ],\n      \"span\": [\n        135,\n        8,\n        19\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0\n      ],\n      \"span\": [\n        137,\n        2,\n        41\n      ],\n      \"leadingComments\": \" Keep if all: comment on method BuzzyBuzz\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        137,\n        6,\n        15\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        137,\n        16,\n        20\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        0,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        137,\n        31,\n        39\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1\n      ],\n      \"span\": [\n        141,\n        0,\n        153,\n        1\n      ],\n      \"leadingComments\": \" Keep if Svc: comment on service Svc\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        1\n      ],\n      \"span\": [\n        141,\n        8,\n        11\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        3\n      ],\n      \"span\": [\n        143,\n        2,\n        29\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        3,\n        10101\n      ],\n      \"span\": [\n        143,\n        2,\n        29\n      ],\n      \"leadingComments\": \" Keep if Svc: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        0\n      ],\n      \"span\": [\n        146,\n        2,\n        149,\n        3\n      ],\n      \"leadingComments\": \" Keep if Svc.Do: comment on rpc Do\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        0,\n        1\n      ],\n      \"span\": [\n        146,\n        6,\n        8\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        0,\n        2\n      ],\n      \"span\": [\n        146,\n        9,\n        12\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        0,\n        3\n      ],\n      \"span\": [\n        146,\n        23,\n        26\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        0,\n        4\n      ],\n      \"span\": [\n        148,\n        4,\n        47\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        0,\n        4,\n        34\n      ],\n      \"span\": [\n        148,\n        4,\n        47\n      ],\n      \"leadingComments\": \" Keep if Svc.Do: comment on option\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        1\n      ],\n      \"span\": [\n        152,\n        2,\n        30\n      ],\n      \"leadingComments\": \" Keep if Svc: comment on rpc Dont\\n\"\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        1,\n        1\n      ],\n      \"span\": [\n        152,\n        6,\n        10\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        1,\n        2\n      ],\n      \"span\": [\n        152,\n        11,\n        14\n      ]\n    },\n    {\n      \"path\": [\n        6,\n        1,\n        2,\n        1,\n        3\n      ],\n      \"span\": [\n        152,\n        25,\n        28\n      ]\n    }\n  ]\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/sourcecodeinfo/test.proto",
    "content": "// Keep 1: comment on syntax\nsyntax = \"proto2\";\n\n// Keep 2: comment on package\npackage foo.bar;\n\n// Keep 3: comment on option\noption go_package = \"foo.bar/baz\";\n\n// Keep if ext: comment on import descriptor.proto\nimport \"google/protobuf/descriptor.proto\";\n\n// No keep\nimport weak \"google/protobuf/struct.proto\";\n\n// Keep if NestedFoo: comment on import any.proto\nimport weak \"google/protobuf/any.proto\";  \n\n// Keep if ext: comment on extend block\nextend google.protobuf.MessageOptions {\n  // Keep if ext: comment on custom option bizniz\n  optional string bizniz = 10101;\n}\n\n// Keep if ext: comment on extend block\nextend google.protobuf.ServiceOptions {\n  // Keep if ext + Svc: comment on custom option fizzbuzz\n  optional string fizzbuzz = 10101;\n}\n\n// Keep if all: comment on message Frobnitz\nmessage Frobnitz {\n  // Keep if all: comment on field xyz\n  optional bytes xyz = 1;\n}\n\n// \"Keep if Foo\" are also kept for Bar, Svc, and Svc.Do since those\n// elements depend on Foo.\n\n// Keep if Foo: comment on message Foo\nmessage Foo {\n  // We keep the following comment for NestedFoo because we don't\n  // discard options or option comments even if we're only retaining\n  // a message as a namespace for another retained element.\n\n  // Keep if Foo | NestedFoo: comment on option\n  option (bizniz) = \"abc\";\n\n  // Keep if Foo: comment on field name\n  optional string name = 1;\n  // Keep if Foo: comment on field bits\n  repeated int64 bits = 2;\n\n  // Keep if Foo: comment on reserved range\n  reserved 10 to 20;\n  // Keep if Foo: comment on reserved names\n  reserved \"abc\", \"def\", \"ghi\";\n  // Keep if Foo: comment on extension range\n  extensions 100 to max;\n\n  // Keep if NestedFoo: comment on message NestedFoo\n  message NestedFoo {\n    // We keep the following comment for Foo + ext because we don't\n    // discard options or option comments even if we're only retaining\n    // a message as a namespace for another retained element.\n\n    // Keep if Foo + ext | NestedFoo: comment on option\n    option (bizniz) = \"abc\";\n    // Keep if NestedFoo: comment on field uid\n    optional uint64 uid = 1;\n    // Keep if NestedFoo: comment on field meta\n    repeated google.protobuf.Any meta = 2;\n    // Keep if NestedFoo: comment on field state\n    optional State state = 3;\n\n    // Keep if NestedFoo: comment on enum State\n    enum State {\n      // Keep if NestedFoo: comment on enum value STATE_UNSPECIFIED\n      STATE_UNSPECIFIED = 0;\n      // Keep if NestedFoo: comment on enum value STATE_GOOD\n      STATE_GOOD = 1;\n    }\n\n    // Keep if Foo + ext: comment on extend block\n    extend Foo {\n      // Keep if Foo + ext: comment on extension blah\n      repeated bytes blah = 101;\n    }\n  }\n}\n\n// \"Keep if Bar\" are also kept for Svc and Svc.Do since those\n// elements depend on Bar.\n\n// Keep if Bar: comment on message Bar\nmessage Bar {\n  // Keep if Bar: comment on field foo\n  optional Foo foo = 1;\n  // Keep if Bar: comment on oneof status\n  oneof status {\n    // Keep if Bar: comment on field baz\n    Baz baz = 2;\n    // Keep if Bar: comment on field quz\n    Quz quz = 3;\n  }\n}\n\n// \"Keep if Baz\" and \"Keep if Quz\" are also kept for Bar, Svc, and Svc.Do\n// since those elements depend on Baz and Quz.\n\n// Keep if Baz: comment on enum Baz\nenum Baz {\n  // Keep if Baz: comment on enum value BAZ_UNSPECIFIED\n  BAZ_UNSPECIFIED = 0;\n}\n\n// Keep if Quz: comment on enum Quz\nenum Quz {\n  // Keep if Quz: comment on enum value QUZ_UNSPECIFIED\n  QUZ_UNSPECIFIED = 0;\n}\n\n// Keep if all: comment on message Buzz\nmessage Buzz {\n  // Keep if all: comment on field s\n  optional string s = 1;\n}\n\n// Keep if all: comment on message Bedazzle\nmessage Bedazzle {\n  // Keep if all: comment on field t\n  optional string t = 1;\n}\n\n// Keep if all: comment on service BuzzService\nservice BuzzService {\n  // Keep if all: comment on method BuzzyBuzz\n  rpc BuzzyBuzz(Buzz) returns (Bedazzle);\n}\n\n// Keep if Svc: comment on service Svc\nservice Svc {\n  // Keep if Svc: comment on option\n  option (fizzbuzz) = \"wxyz\";\n\n  // Keep if Svc.Do: comment on rpc Do\n  rpc Do(Foo) returns (Bar) {\n    // Keep if Svc.Do: comment on option\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n\n  // Keep if Svc: comment on rpc Dont\n  rpc Dont(Foo) returns (Bar);\n}"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/unuseddeps/a.proto",
    "content": "syntax = \"proto3\";\npackage a;\nimport \"b.proto\";\nimport \"c.proto\";\nmessage A{\n\tb.B b = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/unuseddeps/a.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage a;\nimport \"b.proto\";\nmessage A {\n  b.B b = 1;\n}\n-- b.proto --\nsyntax = \"proto3\";\npackage b;\nmessage B {\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/unuseddeps/ab.txtar",
    "content": "-- a.proto --\nsyntax = \"proto3\";\npackage a;\nmessage A {\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/unuseddeps/b.proto",
    "content": "syntax = \"proto3\";\npackage b;\nimport \"c.proto\";\nmessage B {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/testdata/unuseddeps/c.proto",
    "content": "syntax = \"proto3\";\npackage c;\nmessage C {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/bufimageutil/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufimageutil\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufimage/build_image.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"math\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotocompile\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n\t\"github.com/bufbuild/protocompile\"\n\t\"github.com/bufbuild/protocompile/linker\"\n\t\"github.com/bufbuild/protocompile/parser\"\n\t\"github.com/bufbuild/protocompile/protoutil\"\n\t\"github.com/bufbuild/protocompile/reporter\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/reflect/protoregistry\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n)\n\nfunc buildImage(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tmoduleReadBucket bufmodule.ModuleReadBucket,\n\texcludeSourceCodeInfo bool,\n\tnoParallelism bool,\n) (Image, error) {\n\tdefer xslog.DebugProfile(logger)()\n\n\tif !moduleReadBucket.ShouldBeSelfContained() {\n\t\treturn nil, syserror.New(\"passed a ModuleReadBucket to BuildImage that was not expected to be self-contained\")\n\t}\n\tmoduleReadBucket = bufmodule.ModuleReadBucketWithOnlyProtoFiles(moduleReadBucket)\n\tparserAccessorHandler := newParserAccessorHandler(ctx, moduleReadBucket)\n\ttargetFileInfos, err := bufmodule.GetTargetFileInfos(ctx, moduleReadBucket)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(targetFileInfos) == 0 {\n\t\t// If we had no no target files within the module after path filtering, this is an error.\n\t\t// We could have a better user error than this. This gets back to the lack of allowNotExist.\n\t\treturn nil, bufmodule.ErrNoTargetProtoFiles\n\t}\n\tpaths := bufmodule.FileInfoPaths(targetFileInfos)\n\n\tbuildResult := getBuildResult(\n\t\tctx,\n\t\tparserAccessorHandler,\n\t\tpaths,\n\t\texcludeSourceCodeInfo,\n\t\tnoParallelism,\n\t)\n\tif buildResult.Err != nil {\n\t\treturn nil, buildResult.Err\n\t}\n\tsortedFiles, err := checkAndSortFiles(buildResult.Files, paths)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\timage, err := getImage(\n\t\tctx,\n\t\texcludeSourceCodeInfo,\n\t\tsortedFiles,\n\t\tbuildResult.Symbols,\n\t\tparserAccessorHandler,\n\t\tbuildResult.SyntaxUnspecifiedFilenames,\n\t\tbuildResult.FilenameToUnusedDependencyFilenames,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn image, nil\n}\n\nfunc getBuildResult(\n\tctx context.Context,\n\tparserAccessorHandler *parserAccessorHandler,\n\tpaths []string,\n\texcludeSourceCodeInfo bool,\n\tnoParallelism bool,\n) *buildResult {\n\tvar errorsWithPos []reporter.ErrorWithPos\n\tvar warningErrorsWithPos []reporter.ErrorWithPos\n\t// With \"extra option locations\", buf can include more comments\n\t// for an option value than protoc can. In particular, this allows\n\t// it to preserve comments inside of message literals.\n\tsourceInfoMode := protocompile.SourceInfoExtraOptionLocations\n\tif excludeSourceCodeInfo {\n\t\tsourceInfoMode = protocompile.SourceInfoNone\n\t}\n\tparallelism := thread.Parallelism()\n\tif noParallelism {\n\t\tparallelism = 1\n\t}\n\tsymbols := &linker.Symbols{}\n\tcompiler := protocompile.Compiler{\n\t\tMaxParallelism: parallelism,\n\t\tSourceInfoMode: sourceInfoMode,\n\t\tResolver:       &protocompile.SourceResolver{Accessor: parserAccessorHandler.Open},\n\t\tSymbols:        symbols,\n\t\tReporter: reporter.NewReporter(\n\t\t\tfunc(errorWithPos reporter.ErrorWithPos) error {\n\t\t\t\terrorsWithPos = append(errorsWithPos, errorWithPos)\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tfunc(errorWithPos reporter.ErrorWithPos) {\n\t\t\t\twarningErrorsWithPos = append(warningErrorsWithPos, errorWithPos)\n\t\t\t},\n\t\t),\n\t}\n\t// fileDescriptors are in the same order as paths per the documentation\n\tcompiledFiles, err := compiler.Compile(ctx, paths...)\n\tif err != nil {\n\t\tif err == reporter.ErrInvalidSource {\n\t\t\tif len(errorsWithPos) == 0 {\n\t\t\t\treturn newFailedBuildResult(\n\t\t\t\t\terrors.New(\"got invalid source error from parse but no errors reported\"),\n\t\t\t\t)\n\t\t\t}\n\t\t\tfileAnnotationSet, err := bufprotocompile.FileAnnotationSetForErrorsWithPos(\n\t\t\t\terrorsWithPos,\n\t\t\t\tbufprotocompile.WithExternalPathResolver(parserAccessorHandler.ExternalPath),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn newFailedBuildResult(err)\n\t\t\t}\n\t\t\treturn newFailedBuildResult(fileAnnotationSet)\n\t\t}\n\t\tif errorWithPos, ok := err.(reporter.ErrorWithPos); ok {\n\t\t\tfileAnnotation, err := bufprotocompile.FileAnnotationForErrorWithPos(\n\t\t\t\terrorWithPos,\n\t\t\t\tbufprotocompile.WithExternalPathResolver(parserAccessorHandler.ExternalPath),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn newFailedBuildResult(err)\n\t\t\t}\n\t\t\treturn newFailedBuildResult(bufanalysis.NewFileAnnotationSet(fileAnnotation))\n\t\t}\n\t\treturn newFailedBuildResult(err)\n\t} else if len(errorsWithPos) > 0 {\n\t\t// https://github.com/jhump/protoreflect/pull/331\n\t\treturn newFailedBuildResult(\n\t\t\terrors.New(\"got no error from parse but errors reported\"),\n\t\t)\n\t}\n\tif len(compiledFiles) != len(paths) {\n\t\treturn newFailedBuildResult(\n\t\t\tfmt.Errorf(\"expected FileDescriptors to be of length %d but was %d\", len(paths), len(compiledFiles)),\n\t\t)\n\t}\n\tfor i, fileDescriptor := range compiledFiles {\n\t\tpath := paths[i]\n\t\tfilename := fileDescriptor.Path()\n\t\t// doing another rough verification\n\t\t// NO LONGER NEED TO DO SUFFIX SINCE WE KNOW THE ROOT FILE NAME\n\t\tif path != filename {\n\t\t\treturn newFailedBuildResult(\n\t\t\t\tfmt.Errorf(\"expected fileDescriptor name %s to be a equal to %s\", filename, path),\n\t\t\t)\n\t\t}\n\t}\n\tsyntaxUnspecifiedFilenames := make(map[string]struct{})\n\tfilenameToUnusedDependencyFilenames := make(map[string]map[string]struct{})\n\tfor _, warningErrorWithPos := range warningErrorsWithPos {\n\t\tmaybeAddSyntaxUnspecified(syntaxUnspecifiedFilenames, warningErrorWithPos)\n\t\tmaybeAddUnusedImport(filenameToUnusedDependencyFilenames, warningErrorWithPos)\n\t}\n\treturn newBuildResult(\n\t\tcompiledFiles,\n\t\tsymbols,\n\t\tsyntaxUnspecifiedFilenames,\n\t\tfilenameToUnusedDependencyFilenames,\n\t)\n}\n\n// We need to sort the files as they may/probably are out of order\n// relative to input order after concurrent builds. This mimics the output\n// order of protoc.\nfunc checkAndSortFiles(\n\tfileDescriptors linker.Files,\n\trootRelFilePaths []string,\n) (linker.Files, error) {\n\tif len(fileDescriptors) != len(rootRelFilePaths) {\n\t\treturn nil, fmt.Errorf(\"rootRelFilePath length was %d but FileDescriptor length was %d\", len(rootRelFilePaths), len(fileDescriptors))\n\t}\n\tnameToFileDescriptor := make(map[string]linker.File, len(fileDescriptors))\n\tfor _, fileDescriptor := range fileDescriptors {\n\t\tname := fileDescriptor.Path()\n\t\tif name == \"\" {\n\t\t\treturn nil, errors.New(\"no name on FileDescriptor\")\n\t\t}\n\t\tif _, ok := nameToFileDescriptor[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate FileDescriptor: %s\", name)\n\t\t}\n\t\tnameToFileDescriptor[name] = fileDescriptor\n\t}\n\t// We now know that all FileDescriptors had unique names and the number of FileDescriptors\n\t// is equal to the number of rootRelFilePaths. We also verified earlier that rootRelFilePaths\n\t// has only unique values. Now we can put them in order.\n\tsortedFileDescriptors := make(linker.Files, 0, len(fileDescriptors))\n\tfor _, rootRelFilePath := range rootRelFilePaths {\n\t\tfileDescriptor, ok := nameToFileDescriptor[rootRelFilePath]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"no FileDescriptor for rootRelFilePath: %q\", rootRelFilePath)\n\t\t}\n\t\tsortedFileDescriptors = append(sortedFileDescriptors, fileDescriptor)\n\t}\n\treturn sortedFileDescriptors, nil\n}\n\n// getImage gets the Image for the protoreflect.FileDescriptors.\n//\n// This mimics protoc's output order.\n// This assumes checkAndSortFiles was called.\nfunc getImage(\n\tctx context.Context,\n\texcludeSourceCodeInfo bool,\n\tsortedFiles linker.Files,\n\tsymbols *linker.Symbols,\n\tparserAccessorHandler *parserAccessorHandler,\n\tsyntaxUnspecifiedFilenames map[string]struct{},\n\tfilenameToUnusedDependencyFilenames map[string]map[string]struct{},\n) (Image, error) {\n\t// if we aren't including imports, then we need a set of file names that\n\t// are included so we can create a topologically sorted list w/out\n\t// including imports that should not be present.\n\t//\n\t// if we are including imports, then we need to know what filenames\n\t// are imports are what filenames are not\n\t// all input protoreflect.FileDescriptors are not imports, we derive the imports\n\t// from GetDependencies.\n\tnonImportFilenames := map[string]struct{}{}\n\tfor _, fileDescriptor := range sortedFiles {\n\t\tnonImportFilenames[fileDescriptor.Path()] = struct{}{}\n\t}\n\n\tvar imageFiles []ImageFile\n\tvar err error\n\talreadySeen := map[string]struct{}{}\n\tfor _, fileDescriptor := range sortedFiles {\n\t\timageFiles, err = getImageFilesRec(\n\t\t\tctx,\n\t\t\texcludeSourceCodeInfo,\n\t\t\tfileDescriptor,\n\t\t\tparserAccessorHandler,\n\t\t\tsyntaxUnspecifiedFilenames,\n\t\t\tfilenameToUnusedDependencyFilenames,\n\t\t\talreadySeen,\n\t\t\tnonImportFilenames,\n\t\t\timageFiles,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn newImage(imageFiles, false, newResolverForFiles(sortedFiles, symbols))\n}\n\nfunc getImageFilesRec(\n\tctx context.Context,\n\texcludeSourceCodeInfo bool,\n\tfileDescriptor protoreflect.FileDescriptor,\n\tparserAccessorHandler *parserAccessorHandler,\n\tsyntaxUnspecifiedFilenames map[string]struct{},\n\tfilenameToUnusedDependencyFilenames map[string]map[string]struct{},\n\talreadySeen map[string]struct{},\n\tnonImportFilenames map[string]struct{},\n\timageFiles []ImageFile,\n) ([]ImageFile, error) {\n\tif fileDescriptor == nil {\n\t\treturn nil, errors.New(\"nil FileDescriptor\")\n\t}\n\tpath := fileDescriptor.Path()\n\tif _, ok := alreadySeen[path]; ok {\n\t\treturn imageFiles, nil\n\t}\n\talreadySeen[path] = struct{}{}\n\n\tunusedDependencyFilenames, ok := filenameToUnusedDependencyFilenames[path]\n\tvar unusedDependencyIndexes []int32\n\tif ok {\n\t\tunusedDependencyIndexes = make([]int32, 0, len(unusedDependencyFilenames))\n\t}\n\tvar err error\n\tfor i := range fileDescriptor.Imports().Len() {\n\t\tdependency := fileDescriptor.Imports().Get(i).FileDescriptor\n\t\tif unusedDependencyFilenames != nil {\n\t\t\tif _, ok := unusedDependencyFilenames[dependency.Path()]; ok {\n\t\t\t\t// This should never happen, however we do a bounds check to ensure that we are\n\t\t\t\t// doing a safe conversion for the index.\n\t\t\t\tif i > math.MaxInt32 || i < math.MinInt32 {\n\t\t\t\t\treturn nil, fmt.Errorf(\"unused dependency index out-of-bounds for int32 conversion: %v\", i)\n\t\t\t\t}\n\t\t\t\tunusedDependencyIndexes = append(\n\t\t\t\t\tunusedDependencyIndexes,\n\t\t\t\t\tint32(i),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\timageFiles, err = getImageFilesRec(\n\t\t\tctx,\n\t\t\texcludeSourceCodeInfo,\n\t\t\tdependency,\n\t\t\tparserAccessorHandler,\n\t\t\tsyntaxUnspecifiedFilenames,\n\t\t\tfilenameToUnusedDependencyFilenames,\n\t\t\talreadySeen,\n\t\t\tnonImportFilenames,\n\t\t\timageFiles,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tfileDescriptorProto := protoutil.ProtoFromFileDescriptor(fileDescriptor)\n\tif fileDescriptorProto == nil {\n\t\treturn nil, errors.New(\"nil FileDescriptorProto\")\n\t}\n\tif excludeSourceCodeInfo {\n\t\t// need to do this anyways as Parser does not respect this for FileDescriptorProtos\n\t\tfileDescriptorProto.SourceCodeInfo = nil\n\t}\n\t_, isNotImport := nonImportFilenames[path]\n\t_, syntaxUnspecified := syntaxUnspecifiedFilenames[path]\n\timageFile, err := NewImageFile(\n\t\tfileDescriptorProto,\n\t\tparserAccessorHandler.FullName(path),\n\t\tparserAccessorHandler.CommitID(path),\n\t\t// if empty, defaults to path\n\t\tparserAccessorHandler.ExternalPath(path),\n\t\tparserAccessorHandler.LocalPath(path),\n\t\t!isNotImport,\n\t\tsyntaxUnspecified,\n\t\tunusedDependencyIndexes,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn append(imageFiles, imageFile), nil\n}\n\nfunc maybeAddSyntaxUnspecified(\n\tsyntaxUnspecifiedFilenames map[string]struct{},\n\terrorWithPos reporter.ErrorWithPos,\n) {\n\tif errorWithPos.Unwrap() != parser.ErrNoSyntax {\n\t\treturn\n\t}\n\tsyntaxUnspecifiedFilenames[errorWithPos.GetPosition().Filename] = struct{}{}\n}\n\nfunc maybeAddUnusedImport(\n\tfilenameToUnusedImportFilenames map[string]map[string]struct{},\n\terrorWithPos reporter.ErrorWithPos,\n) {\n\terrorUnusedImport, ok := errorWithPos.Unwrap().(linker.ErrorUnusedImport)\n\tif !ok {\n\t\treturn\n\t}\n\tpos := errorWithPos.GetPosition()\n\tunusedImportFilenames, ok := filenameToUnusedImportFilenames[pos.Filename]\n\tif !ok {\n\t\tunusedImportFilenames = make(map[string]struct{})\n\t\tfilenameToUnusedImportFilenames[pos.Filename] = unusedImportFilenames\n\t}\n\tunusedImportFilenames[errorUnusedImport.UnusedImport()] = struct{}{}\n}\n\ntype buildResult struct {\n\tFiles                               linker.Files\n\tSymbols                             *linker.Symbols\n\tSyntaxUnspecifiedFilenames          map[string]struct{}\n\tFilenameToUnusedDependencyFilenames map[string]map[string]struct{}\n\tErr                                 error\n}\n\nfunc newBuildResult(\n\tfileDescriptors linker.Files,\n\tsymbols *linker.Symbols,\n\tsyntaxUnspecifiedFilenames map[string]struct{},\n\tfilenameToUnusedDependencyFilenames map[string]map[string]struct{},\n) *buildResult {\n\treturn &buildResult{\n\t\tFiles:                               fileDescriptors,\n\t\tSymbols:                             symbols,\n\t\tSyntaxUnspecifiedFilenames:          syntaxUnspecifiedFilenames,\n\t\tFilenameToUnusedDependencyFilenames: filenameToUnusedDependencyFilenames,\n\t}\n}\n\nfunc newFailedBuildResult(err error) *buildResult {\n\treturn &buildResult{Err: err}\n}\n\ntype buildImageOptions struct {\n\texcludeSourceCodeInfo bool\n\tnoParallelism         bool\n}\n\nfunc newBuildImageOptions() *buildImageOptions {\n\treturn &buildImageOptions{}\n}\n\n// resolverForFiles implements protoencoding.Resolver and is backed\n// by a linker.Files and the *linker.Symbols symbol table produced\n// when compiling the files. The symbol table is used as an index\n// for more efficient lookup.\ntype resolverForFiles struct {\n\tpathToFile map[string]linker.File\n\tsymbols    *linker.Symbols\n}\n\nfunc newResolverForFiles(files linker.Files, symbols *linker.Symbols) protoencoding.Resolver {\n\t// Expand the set of files so it includes the entire transitive graph\n\tpathToFile := make(map[string]linker.File, len(files))\n\tfor _, file := range files {\n\t\taddFileToMapRec(pathToFile, file)\n\t}\n\treturn &resolverForFiles{pathToFile: pathToFile, symbols: symbols}\n}\n\nfunc (r *resolverForFiles) FindFileByPath(path string) (protoreflect.FileDescriptor, error) {\n\tfileDescriptor, ok := r.pathToFile[path]\n\tif !ok {\n\t\treturn nil, protoregistry.NotFound\n\t}\n\treturn fileDescriptor, nil\n}\n\nfunc (r *resolverForFiles) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) {\n\tspan := r.symbols.Lookup(name)\n\tif span == nil {\n\t\treturn nil, protoregistry.NotFound\n\t}\n\tdescriptor := r.pathToFile[span.Start().Filename].FindDescriptorByName(name)\n\tif descriptor == nil {\n\t\treturn nil, protoregistry.NotFound\n\t}\n\treturn descriptor, nil\n}\n\nfunc (r *resolverForFiles) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {\n\tdescriptor, err := r.FindDescriptorByName(field)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\textensionDescriptor, ok := descriptor.(protoreflect.ExtensionDescriptor)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%s is a %T, not a protoreflect.ExtensionDescriptor\", field, descriptor)\n\t}\n\tif extensionTypeDescriptor, ok := extensionDescriptor.(protoreflect.ExtensionTypeDescriptor); ok {\n\t\treturn extensionTypeDescriptor.Type(), nil\n\t}\n\treturn dynamicpb.NewExtensionType(extensionDescriptor), nil\n}\n\nfunc (r *resolverForFiles) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {\n\tspan := r.symbols.LookupExtension(message, field)\n\tif span == nil {\n\t\treturn nil, protoregistry.NotFound\n\t}\n\textensionDescriptor := findExtension(r.pathToFile[span.Start().Filename], message, field)\n\tif extensionDescriptor == nil {\n\t\treturn nil, protoregistry.NotFound\n\t}\n\tif extensionTypeDescriptor, ok := extensionDescriptor.(protoreflect.ExtensionTypeDescriptor); ok {\n\t\treturn extensionTypeDescriptor.Type(), nil\n\t}\n\treturn dynamicpb.NewExtensionType(extensionDescriptor), nil\n}\n\nfunc (r *resolverForFiles) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {\n\tdescriptor, err := r.FindDescriptorByName(message)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmessageDescriptor, ok := descriptor.(protoreflect.MessageDescriptor)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%s is a %T, not a protoreflect.MessageDescriptor\", message, descriptor)\n\t}\n\treturn dynamicpb.NewMessageType(messageDescriptor), nil\n}\n\nfunc (r *resolverForFiles) FindMessageByURL(url string) (protoreflect.MessageType, error) {\n\tpos := strings.LastIndexByte(url, '/')\n\treturn r.FindMessageByName(protoreflect.FullName(url[pos+1:]))\n}\n\nfunc (r *resolverForFiles) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) {\n\tdescriptor, err := r.FindDescriptorByName(enum)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tenumDescriptor, ok := descriptor.(protoreflect.EnumDescriptor)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"%s is a %T, not a protoreflect.EnumDescriptor\", enum, descriptor)\n\t}\n\treturn dynamicpb.NewEnumType(enumDescriptor), nil\n}\n\ntype container interface {\n\tMessages() protoreflect.MessageDescriptors\n\tExtensions() protoreflect.ExtensionDescriptors\n}\n\nfunc findExtension(d container, message protoreflect.FullName, field protoreflect.FieldNumber) protoreflect.ExtensionDescriptor {\n\textensions := d.Extensions()\n\tfor i, length := 0, extensions.Len(); i < length; i++ {\n\t\textension := extensions.Get(i)\n\t\tif extension.Number() == field && extension.ContainingMessage().FullName() == message {\n\t\t\treturn extension\n\t\t}\n\t}\n\tfor i := range d.Messages().Len() {\n\t\tif ext := findExtension(d.Messages().Get(i), message, field); ext != nil {\n\t\t\treturn ext\n\t\t}\n\t}\n\treturn nil // could not be found\n}\n\nfunc addFileToMapRec(pathToFile map[string]linker.File, file linker.File) {\n\tif _, alreadyAdded := pathToFile[file.Path()]; alreadyAdded {\n\t\treturn\n\t}\n\tpathToFile[file.Path()] = file\n\timports := file.Imports()\n\tfor i, length := 0, imports.Len(); i < length; i++ {\n\t\timportedFile := file.FindImportByPath(imports.Get(i).Path())\n\t\taddFileToMapRec(pathToFile, importedFile)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/build_image_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage_test\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xtesting\"\n\t\"github.com/bufbuild/buf/private/buf/buftesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotosource\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/prototesting\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nvar buftestingDirPath = filepath.Join(\n\t\"..\",\n\t\"..\",\n\t\"buf\",\n\t\"buftesting\",\n)\n\nfunc TestGoogleapis(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\tt.Parallel()\n\timage := testBuildGoogleapis(t, true)\n\tassert.Equal(t, buftesting.NumGoogleapisFilesWithImports, len(image.Files()))\n\tassert.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"google/protobuf/any.proto\",\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/protobuf/duration.proto\",\n\t\t\t\"google/protobuf/empty.proto\",\n\t\t\t\"google/protobuf/field_mask.proto\",\n\t\t\t\"google/protobuf/source_context.proto\",\n\t\t\t\"google/protobuf/struct.proto\",\n\t\t\t\"google/protobuf/timestamp.proto\",\n\t\t\t\"google/protobuf/type.proto\",\n\t\t\t\"google/protobuf/wrappers.proto\",\n\t\t},\n\t\ttestGetImageImportPaths(image),\n\t)\n\n\timageWithoutImports := bufimage.ImageWithoutImports(image)\n\tassert.Equal(t, buftesting.NumGoogleapisFiles, len(imageWithoutImports.Files()))\n\timageWithoutImports = bufimage.ImageWithoutImports(imageWithoutImports)\n\tassert.Equal(t, buftesting.NumGoogleapisFiles, len(imageWithoutImports.Files()))\n\n\timageWithSpecificNames, err := bufimage.ImageWithOnlyPathsAllowNotExist(\n\t\timage,\n\t\t[]string{\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/type/date.proto\",\n\t\t\t\"google/foo/nonsense.proto\",\n\t\t},\n\t\tnil,\n\t)\n\tassert.NoError(t, err)\n\tassert.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"google/protobuf/any.proto\",\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/protobuf/source_context.proto\",\n\t\t\t\"google/protobuf/type.proto\",\n\t\t\t\"google/type/date.proto\",\n\t\t},\n\t\ttestGetImageFilePaths(imageWithSpecificNames),\n\t)\n\timageWithSpecificNames, err = bufimage.ImageWithOnlyPathsAllowNotExist(\n\t\timage,\n\t\t[]string{\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/type\",\n\t\t\t\"google/foo\",\n\t\t},\n\t\tnil,\n\t)\n\tassert.NoError(t, err)\n\tassert.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"google/protobuf/any.proto\",\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/protobuf/source_context.proto\",\n\t\t\t\"google/protobuf/type.proto\",\n\t\t\t\"google/protobuf/wrappers.proto\",\n\t\t\t\"google/type/calendar_period.proto\",\n\t\t\t\"google/type/color.proto\",\n\t\t\t\"google/type/date.proto\",\n\t\t\t\"google/type/dayofweek.proto\",\n\t\t\t\"google/type/expr.proto\",\n\t\t\t\"google/type/fraction.proto\",\n\t\t\t\"google/type/latlng.proto\",\n\t\t\t\"google/type/money.proto\",\n\t\t\t\"google/type/postal_address.proto\",\n\t\t\t\"google/type/quaternion.proto\",\n\t\t\t\"google/type/timeofday.proto\",\n\t\t},\n\t\ttestGetImageFilePaths(imageWithSpecificNames),\n\t)\n\timageWithoutImports = bufimage.ImageWithoutImports(imageWithSpecificNames)\n\tassert.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/type/calendar_period.proto\",\n\t\t\t\"google/type/color.proto\",\n\t\t\t\"google/type/date.proto\",\n\t\t\t\"google/type/dayofweek.proto\",\n\t\t\t\"google/type/expr.proto\",\n\t\t\t\"google/type/fraction.proto\",\n\t\t\t\"google/type/latlng.proto\",\n\t\t\t\"google/type/money.proto\",\n\t\t\t\"google/type/postal_address.proto\",\n\t\t\t\"google/type/quaternion.proto\",\n\t\t\t\"google/type/timeofday.proto\",\n\t\t},\n\t\ttestGetImageFilePaths(imageWithoutImports),\n\t)\n\t_, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/type/date.proto\",\n\t\t\t\"google/foo/nonsense.proto\",\n\t\t},\n\t\tnil,\n\t)\n\tassert.Equal(t, errors.New(`path \"google/foo/nonsense.proto\" has no matching file in the image`), err)\n\t_, err = bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t\t\"google/protobuf/api.proto\",\n\t\t\t\"google/type/date.proto\",\n\t\t\t\"google/foo\",\n\t\t},\n\t\tnil,\n\t)\n\tassert.Equal(t, errors.New(`path \"google/foo\" has no matching file in the image`), err)\n\n\timageWithPathsAndExcludes, err := bufimage.ImageWithOnlyPaths(\n\t\timage,\n\t\t[]string{\n\t\t\t\"google/type\",\n\t\t},\n\t\t[]string{\n\t\t\t\"google/type/calendar_period.proto\",\n\t\t\t\"google/type/date.proto\",\n\t\t},\n\t)\n\tassert.NoError(t, err)\n\tassert.Equal(t,\n\t\t[]string{\n\t\t\t\"google/protobuf/wrappers.proto\",\n\t\t\t\"google/type/color.proto\",\n\t\t\t\"google/type/dayofweek.proto\",\n\t\t\t\"google/type/expr.proto\",\n\t\t\t\"google/type/fraction.proto\",\n\t\t\t\"google/type/latlng.proto\",\n\t\t\t\"google/type/money.proto\",\n\t\t\t\"google/type/postal_address.proto\",\n\t\t\t\"google/type/quaternion.proto\",\n\t\t\t\"google/type/timeofday.proto\",\n\t\t},\n\t\ttestGetImageFilePaths(imageWithPathsAndExcludes),\n\t)\n\n\texcludePaths := []string{\n\t\t\"google/type/calendar_period.proto\",\n\t\t\"google/type/quaternion.proto\",\n\t\t\"google/type/money.proto\",\n\t\t\"google/type/color.proto\",\n\t\t\"google/type/date.proto\",\n\t}\n\timageWithExcludes, err := bufimage.ImageWithOnlyPaths(image, []string{}, excludePaths)\n\tassert.NoError(t, err)\n\ttestImageWithExcludedFilePaths(t, imageWithExcludes, excludePaths)\n\n\tassert.Equal(t, buftesting.NumGoogleapisFilesWithImports, len(image.Files()))\n\t// basic check to make sure there is no error at this scale\n\t_, err = bufprotosource.NewFiles(t.Context(), image.Files(), image.Resolver())\n\tassert.NoError(t, err)\n}\n\nfunc TestCompareCustomOptions1(t *testing.T) {\n\tt.Parallel()\n\ttestCompare(t, \"customoptions1\")\n}\n\nfunc TestCompareProto3Optional1(t *testing.T) {\n\tt.Parallel()\n\ttestCompare(t, \"proto3optional1\")\n}\n\nfunc TestCompareTrailingComments(t *testing.T) {\n\tt.Parallel()\n\ttestCompare(t, \"trailingcomments\")\n}\n\nfunc TestCustomOptionsError1(t *testing.T) {\n\tt.Parallel()\n\ttestFileAnnotations(\n\t\tt,\n\t\t\"customoptionserror1\",\n\t\ttrue,\n\t\tfilepath.FromSlash(\"testdata/customoptionserror1/b.proto:9:27:field a.Baz.bat: option (a.foo).bat: field bat of a.Foo does not exist\"),\n\t)\n}\n\nfunc TestNotAMessageType(t *testing.T) {\n\tt.Parallel()\n\ttestFileAnnotations(\n\t\tt,\n\t\t\"notamessagetype\",\n\t\ttrue,\n\t\tfilepath.FromSlash(\"testdata/notamessagetype/a.proto:9:11:method a.MyService.Foo: invalid request type: a.MyService.Foo is a method, not a message\"),\n\t)\n}\n\nfunc TestSpaceBetweenNumberAndID(t *testing.T) {\n\tt.Parallel()\n\ttestFileAnnotations(\n\t\tt,\n\t\t\"spacebetweennumberandid\",\n\t\ttrue,\n\t\tfilepath.FromSlash(\"testdata/spacebetweennumberandid/a.proto:6:14:invalid syntax in integer value: 10to\"),\n\t\tfilepath.FromSlash(\"testdata/spacebetweennumberandid/a.proto:6:14:syntax error: unexpected error, expecting int literal\"),\n\t)\n}\n\nfunc TestCyclicImport(t *testing.T) {\n\tt.Parallel()\n\ttestFileAnnotations(\n\t\tt,\n\t\t\"cyclicimport\",\n\t\tfalse,\n\t\t// Since the compiler is multi-threaded, order of file compilation can happen one of two ways\n\t\tfmt.Sprintf(`%s:5:8:cycle found in imports: \"a/a.proto\" -> \"b/b.proto\" -> \"a/a.proto\"\n\t\t\t\t|| %s:5:8:cycle found in imports: \"b/b.proto\" -> \"a/a.proto\" -> \"b/b.proto\"`,\n\t\t\tfilepath.FromSlash(\"testdata/cyclicimport/a/a.proto\"),\n\t\t\tfilepath.FromSlash(\"testdata/cyclicimport/b/b.proto\"),\n\t\t),\n\t)\n}\n\nfunc TestDuplicateSyntheticOneofs(t *testing.T) {\n\t// https://github.com/bufbuild/buf/issues/1071\n\tt.Parallel()\n\ttestFileAnnotations(\n\t\tt,\n\t\t\"duplicatesyntheticoneofs\",\n\t\t// Since the compiler is multi-threaded, order of file compilation can happen one of two ways\n\t\tfalse,\n\t\tfilepath.FromSlash(`testdata/duplicatesyntheticoneofs/a1.proto:5:9:symbol \"a.Foo\" already defined at a2.proto:5:9\n\t\t\t\t|| testdata/duplicatesyntheticoneofs/a2.proto:5:9:symbol \"a.Foo\" already defined at a1.proto:5:9`),\n\t\tfilepath.FromSlash(`testdata/duplicatesyntheticoneofs/a1.proto:6:19:symbol \"a.Foo._bar\" already defined at a2.proto:6:19\n\t\t\t\t|| testdata/duplicatesyntheticoneofs/a2.proto:6:19:symbol \"a.Foo._bar\" already defined at a1.proto:6:19`),\n\t\tfilepath.FromSlash(`testdata/duplicatesyntheticoneofs/a1.proto:6:19:symbol \"a.Foo.bar\" already defined at a2.proto:6:19\n\t\t\t\t|| testdata/duplicatesyntheticoneofs/a2.proto:6:19:symbol \"a.Foo.bar\" already defined at a1.proto:6:19`),\n\t)\n}\n\nfunc TestOptionPanic(t *testing.T) {\n\tt.Parallel()\n\trequire.NotPanics(t, func() {\n\t\tmoduleSet, err := bufmoduletesting.NewModuleSetForDirPath(filepath.Join(\"testdata\", \"optionpanic\"))\n\t\trequire.NoError(t, err)\n\t\t_, err = bufimage.BuildImage(\n\t\t\tt.Context(),\n\t\t\tslogtestext.NewLogger(t),\n\t\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\t)\n\t\trequire.NoError(t, err)\n\t})\n}\n\nfunc TestCompareSemicolons(t *testing.T) {\n\tt.Parallel()\n\ttestCompare(t, \"semicolons\")\n}\n\nfunc TestModuleTargetFiles(t *testing.T) {\n\tt.Parallel()\n\tmoduleSet, err := bufmoduletesting.NewModuleSet(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/a\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"a.proto\": []byte(\n\t\t\t\t\t`syntax = \"proto3\"; package a; import \"b.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/b\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"b.proto\": []byte(\n\t\t\t\t\t`syntax = \"proto3\"; package b; import \"c.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/c\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"c.proto\": []byte(\n\t\t\t\t\t`syntax = \"proto3\"; package c;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\ttestTargetImageFiles := func(t *testing.T, want []string, opaqueID ...string) {\n\t\ttargetModuleSet := moduleSet\n\t\tif len(opaqueID) > 0 {\n\t\t\tvar err error\n\t\t\ttargetModuleSet, err = moduleSet.WithTargetOpaqueIDs(opaqueID...)\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t\timage, err := bufimage.BuildImage(\n\t\t\tt.Context(),\n\t\t\tslogtestext.NewLogger(t),\n\t\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(targetModuleSet),\n\t\t)\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, want, testGetImageFilePaths(image))\n\t}\n\ttestTargetImageFiles(t, []string{\"a.proto\", \"b.proto\", \"c.proto\"})\n\ttestTargetImageFiles(t, []string{\"a.proto\", \"b.proto\", \"c.proto\"}, \"buf.build/foo/a\")\n\ttestTargetImageFiles(t, []string{\"b.proto\", \"c.proto\"}, \"buf.build/foo/b\")\n\ttestTargetImageFiles(t, []string{\"c.proto\"}, \"buf.build/foo/c\")\n\ttestTargetImageFiles(t, []string{\"b.proto\", \"c.proto\"}, \"buf.build/foo/b\", \"buf.build/foo/c\")\n}\n\nfunc testCompare(t *testing.T, relDirPath string) {\n\tdirPath := filepath.Join(\"testdata\", relDirPath)\n\timage, fileAnnotations := testBuild(t, false, dirPath, false)\n\trequire.Equal(t, 0, len(fileAnnotations), fileAnnotations)\n\timage = bufimage.ImageWithoutImports(image)\n\tfileDescriptorSet := bufimage.ImageToFileDescriptorSet(image)\n\tfilePaths := buftesting.GetProtocFilePaths(t, dirPath, 0)\n\tactualProtocFileDescriptorSet := buftesting.GetActualProtocFileDescriptorSet(t, false, false, dirPath, filePaths)\n\tprototesting.AssertFileDescriptorSetsEqual(t, fileDescriptorSet, actualProtocFileDescriptorSet)\n}\n\nfunc testBuildGoogleapis(t *testing.T, includeSourceInfo bool) bufimage.Image {\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\timage, fileAnnotations := testBuild(t, includeSourceInfo, googleapisDirPath, true)\n\trequire.Equal(t, 0, len(fileAnnotations), fileAnnotations)\n\treturn image\n}\n\nfunc testBuild(t *testing.T, includeSourceInfo bool, dirPath string, parallelism bool) (bufimage.Image, []bufanalysis.FileAnnotation) {\n\tmoduleSet, err := bufmoduletesting.NewModuleSetForDirPath(dirPath)\n\trequire.NoError(t, err)\n\tvar options []bufimage.BuildImageOption\n\tif !includeSourceInfo {\n\t\toptions = append(options, bufimage.WithExcludeSourceCodeInfo())\n\t}\n\tif !parallelism {\n\t\toptions = append(options, bufimage.WithNoParallelism())\n\t}\n\timage, err := bufimage.BuildImage(\n\t\tt.Context(),\n\t\tslogtestext.NewLogger(t),\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t\toptions...,\n\t)\n\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\tif errors.As(err, &fileAnnotationSet) {\n\t\treturn image, fileAnnotationSet.FileAnnotations()\n\t}\n\trequire.NoError(t, err)\n\treturn image, nil\n}\n\nfunc testGetImageFilePaths(image bufimage.Image) []string {\n\tvar fileNames []string\n\tfor _, file := range image.Files() {\n\t\tfileNames = append(fileNames, file.Path())\n\t}\n\tsort.Strings(fileNames)\n\treturn fileNames\n}\n\nfunc testGetImageImportPaths(image bufimage.Image) []string {\n\tvar importNames []string\n\tfor _, file := range image.Files() {\n\t\tif file.IsImport() {\n\t\t\timportNames = append(importNames, file.Path())\n\t\t}\n\t}\n\tsort.Strings(importNames)\n\treturn importNames\n}\n\nfunc testFileAnnotations(t *testing.T, relDirPath string, parallelism bool, want ...string) {\n\tt.Helper()\n\n\t_, fileAnnotations := testBuild(t, false, filepath.Join(\"testdata\", filepath.FromSlash(relDirPath)), parallelism)\n\tgot := make([]string, len(fileAnnotations))\n\tfor i, annotation := range fileAnnotations {\n\t\tgot[i] = annotation.String()\n\t}\n\trequire.Equal(t, len(want), len(got))\n\tfor i := range want {\n\t\toptions := strings.Split(want[i], \"||\")\n\t\tmatched := false\n\t\tfor _, option := range options {\n\t\t\toption = strings.TrimSpace(option)\n\t\t\tif got[i] == option {\n\t\t\t\tmatched = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\trequire.True(t, matched, \"annotation at index %d: wanted %q ; got %q\", i, want[i], got[i])\n\t}\n}\n\nfunc testImageWithExcludedFilePaths(t *testing.T, image bufimage.Image, excludePaths []string) {\n\tt.Helper()\n\tfor _, imageFile := range image.Files() {\n\t\tif !imageFile.IsImport() {\n\t\t\tfor _, excludePath := range excludePaths {\n\t\t\t\tassert.False(t, normalpath.EqualsOrContainsPath(excludePath, imageFile.Path(), normalpath.Relative), \"paths: %s, %s\", imageFile.Path(), excludePath)\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/build_image_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage bufimage_test\n\nimport (\n\t\"testing\"\n\n\t\"buf.build/go/standard/xtesting\"\n\t\"github.com/bufbuild/buf/private/buf/buftesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/pkg/prototesting\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestCompareGoogleapis(t *testing.T) {\n\txtesting.SkipIfShort(t)\n\t// Don't run in parallel as it allocates a lot of memory\n\t// cannot directly compare with source code info as buf alpha protoc creates additional source\n\t// code infos that protoc does not\n\timage := testBuildGoogleapis(t, false)\n\tfileDescriptorSet := bufimage.ImageToFileDescriptorSet(image)\n\tactualProtocFileDescriptorSet := testBuildActualProtocGoogleapis(t, false)\n\tprototesting.AssertFileDescriptorSetsEqual(\n\t\tt,\n\t\tfileDescriptorSet,\n\t\tactualProtocFileDescriptorSet,\n\t)\n}\n\nfunc testBuildActualProtocGoogleapis(t *testing.T, includeSourceInfo bool) *descriptorpb.FileDescriptorSet {\n\tgoogleapisDirPath := buftesting.GetGoogleapisDirPath(t, buftestingDirPath)\n\tfilePaths := buftesting.GetProtocFilePaths(t, googleapisDirPath, 0)\n\tfileDescriptorSet := buftesting.GetActualProtocFileDescriptorSet(t, true, includeSourceInfo, googleapisDirPath, filePaths)\n\tassert.Equal(t, buftesting.NumGoogleapisFilesWithImports, len(fileDescriptorSet.GetFile()))\n\n\treturn fileDescriptorSet\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/image.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nvar _ Image = &image{}\n\ntype image struct {\n\tfiles           []ImageFile\n\tpathToImageFile map[string]ImageFile\n\tresolver        protoencoding.Resolver\n}\n\nfunc newImage(files []ImageFile, reorder bool, resolver protoencoding.Resolver) (*image, error) {\n\tif len(files) == 0 {\n\t\treturn nil, errors.New(\"image contains no files\")\n\t}\n\tpathToImageFile := make(map[string]ImageFile, len(files))\n\ttype commitIDAndFilePath struct {\n\t\tcommitID uuid.UUID\n\t\tfilePath string\n\t}\n\tmoduleFullNameStringToCommitIDAndFilePath := make(map[string]commitIDAndFilePath)\n\tfor _, file := range files {\n\t\tpath := file.Path()\n\t\tif _, ok := pathToImageFile[path]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate file: %s\", path)\n\t\t}\n\t\tpathToImageFile[path] = file\n\t\tif moduleFullName := file.FullName(); moduleFullName != nil {\n\t\t\tmoduleFullNameString := moduleFullName.String()\n\t\t\texisting, ok := moduleFullNameStringToCommitIDAndFilePath[moduleFullNameString]\n\t\t\tif ok {\n\t\t\t\tif existing.commitID != file.CommitID() {\n\t\t\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\t\t\"files with different commits for the same module %s: %s:%s and %s:%s\",\n\t\t\t\t\t\tmoduleFullNameString,\n\t\t\t\t\t\texisting.filePath,\n\t\t\t\t\t\tuuidutil.ToDashless(existing.commitID),\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tuuidutil.ToDashless(file.CommitID()),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tmoduleFullNameStringToCommitIDAndFilePath[moduleFullNameString] = commitIDAndFilePath{\n\t\t\t\t\tcommitID: file.CommitID(),\n\t\t\t\t\tfilePath: path,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif reorder {\n\t\tfiles = orderImageFiles(files, pathToImageFile)\n\t}\n\tif resolver == nil {\n\t\tfileDescriptorProtos := make([]*descriptorpb.FileDescriptorProto, len(files))\n\t\tfor i := range files {\n\t\t\tfileDescriptorProtos[i] = files[i].FileDescriptorProto()\n\t\t}\n\t\tresolver = protoencoding.NewLazyResolver(fileDescriptorProtos...)\n\t}\n\treturn &image{\n\t\tfiles:           files,\n\t\tpathToImageFile: pathToImageFile,\n\t\tresolver:        resolver,\n\t}, nil\n}\n\nfunc newImageNoValidate(files []ImageFile, resolver protoencoding.Resolver) *image {\n\tpathToImageFile := make(map[string]ImageFile, len(files))\n\tfor _, file := range files {\n\t\tpath := file.Path()\n\t\tpathToImageFile[path] = file\n\t}\n\treturn &image{\n\t\tfiles:           files,\n\t\tpathToImageFile: pathToImageFile,\n\t\tresolver:        resolver,\n\t}\n}\n\nfunc (i *image) Files() []ImageFile {\n\treturn i.files\n}\n\nfunc (i *image) GetFile(path string) ImageFile {\n\treturn i.pathToImageFile[path]\n}\n\nfunc (i *image) Resolver() protoencoding.Resolver {\n\treturn i.resolver\n}\n\nfunc (*image) isImage() {}\n\n// orderImageFiles re-orders the ImageFiles in DAG order.\nfunc orderImageFiles(\n\tinputImageFiles []ImageFile,\n\tpathToImageFile map[string]ImageFile,\n) []ImageFile {\n\toutputImageFiles := make([]ImageFile, 0, len(inputImageFiles))\n\talreadySeen := map[string]struct{}{}\n\tfor _, inputImageFile := range inputImageFiles {\n\t\toutputImageFiles = orderImageFilesRec(\n\t\t\tinputImageFile,\n\t\t\toutputImageFiles,\n\t\t\tpathToImageFile,\n\t\t\talreadySeen,\n\t\t)\n\t}\n\treturn outputImageFiles\n}\n\nfunc orderImageFilesRec(\n\tinputImageFile ImageFile,\n\toutputImageFiles []ImageFile,\n\tpathToImageFile map[string]ImageFile,\n\talreadySeen map[string]struct{},\n) []ImageFile {\n\tpath := inputImageFile.Path()\n\tif _, ok := alreadySeen[path]; ok {\n\t\treturn outputImageFiles\n\t}\n\talreadySeen[path] = struct{}{}\n\tfor _, dependency := range inputImageFile.FileDescriptorProto().GetDependency() {\n\t\tdependencyImageFile, ok := pathToImageFile[dependency]\n\t\tif ok {\n\t\t\toutputImageFiles = orderImageFilesRec(\n\t\t\t\tdependencyImageFile,\n\t\t\t\toutputImageFiles,\n\t\t\t\tpathToImageFile,\n\t\t\t\talreadySeen,\n\t\t\t)\n\t\t}\n\t}\n\treturn append(outputImageFiles, inputImageFile)\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/image_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"slices\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"github.com/google/uuid\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nvar _ ImageFile = &imageFile{}\n\ntype imageFile struct {\n\tfileDescriptorProto     *descriptorpb.FileDescriptorProto\n\tmoduleFullName          bufparse.FullName\n\tcommitID                uuid.UUID\n\texternalPath            string\n\tlocalPath               string\n\tisImport                bool\n\tisSyntaxUnspecified     bool\n\tunusedDependencyIndexes []int32\n}\n\nfunc newImageFile(\n\tfileDescriptor protodescriptor.FileDescriptor,\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\texternalPath string,\n\tlocalPath string,\n\tisImport bool,\n\tisSyntaxUnspecified bool,\n\tunusedDependencyIndexes []int32,\n) (*imageFile, error) {\n\tif err := protodescriptor.ValidateFileDescriptor(fileDescriptor); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newImageFileNoValidate(\n\t\tfileDescriptor,\n\t\tmoduleFullName,\n\t\tcommitID,\n\t\texternalPath,\n\t\tlocalPath,\n\t\tisImport,\n\t\tisSyntaxUnspecified,\n\t\tunusedDependencyIndexes,\n\t), nil\n}\n\nfunc newImageFileNoValidate(\n\tfileDescriptor protodescriptor.FileDescriptor,\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\texternalPath string,\n\tlocalPath string,\n\tisImport bool,\n\tisSyntaxUnspecified bool,\n\tunusedDependencyIndexes []int32,\n) *imageFile {\n\t// just to normalize in other places between empty and unset\n\tif len(unusedDependencyIndexes) == 0 {\n\t\tunusedDependencyIndexes = nil\n\t}\n\treturn &imageFile{\n\t\t// protodescriptor.FileDescriptorProtoForFileDescriptor is a no-op if fileDescriptor\n\t\t// is already a *descriptorpb.FileDescriptorProto\n\t\tfileDescriptorProto:     protodescriptor.FileDescriptorProtoForFileDescriptor(fileDescriptor),\n\t\tmoduleFullName:          moduleFullName,\n\t\tcommitID:                commitID,\n\t\texternalPath:            externalPath,\n\t\tlocalPath:               localPath,\n\t\tisImport:                isImport,\n\t\tisSyntaxUnspecified:     isSyntaxUnspecified,\n\t\tunusedDependencyIndexes: unusedDependencyIndexes,\n\t}\n}\n\nfunc (f *imageFile) Path() string {\n\treturn f.fileDescriptorProto.GetName()\n}\n\nfunc (f *imageFile) ExternalPath() string {\n\tif f.externalPath == \"\" {\n\t\treturn f.Path()\n\t}\n\treturn f.externalPath\n}\n\nfunc (f *imageFile) LocalPath() string {\n\treturn f.localPath\n}\n\nfunc (f *imageFile) FullName() bufparse.FullName {\n\treturn f.moduleFullName\n}\n\nfunc (f *imageFile) CommitID() uuid.UUID {\n\treturn f.commitID\n}\n\nfunc (f *imageFile) Imports() ([]string, error) {\n\treturn slices.Clone(f.fileDescriptorProto.GetDependency()), nil\n}\n\nfunc (f *imageFile) IsImport() bool {\n\treturn f.isImport\n}\n\nfunc (f *imageFile) FileDescriptorProto() *descriptorpb.FileDescriptorProto {\n\treturn f.fileDescriptorProto\n}\n\nfunc (f *imageFile) IsSyntaxUnspecified() bool {\n\treturn f.isSyntaxUnspecified\n}\n\nfunc (f *imageFile) UnusedDependencyIndexes() []int32 {\n\treturn f.unusedDependencyIndexes\n}\n\nfunc (*imageFile) isImageFileInfo() {}\nfunc (*imageFile) isImageFile()     {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/image_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestCloneImage(t *testing.T) {\n\tt.Parallel()\n\tprotoImage := imagev1.Image_builder{\n\t\tFile: []*imagev1.ImageFile{\n\t\t\timagev1.ImageFile_builder{\n\t\t\t\tSyntax:     proto.String(\"proto3\"),\n\t\t\t\tName:       proto.String(\"a.proto\"),\n\t\t\t\tDependency: []string{\"b.proto\", \"c.proto\"},\n\t\t\t\tPackage:    proto.String(\"abc.def\"),\n\t\t\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Msg\"),\n\t\t\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:     proto.String(\"id\"),\n\t\t\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\t\t\tNumber:   proto.Int32(1),\n\t\t\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\t\t\tJsonName: proto.String(\"id\"),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:     proto.String(\"en\"),\n\t\t\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_REPEATED.Enum(),\n\t\t\t\t\t\t\t\tNumber:   proto.Int32(2),\n\t\t\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_ENUM.Enum(),\n\t\t\t\t\t\t\t\tTypeName: proto.String(\".abc.def.Enum\"),\n\t\t\t\t\t\t\t\tJsonName: proto.String(\"en\"),\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\tBufExtension: imagev1.ImageFileExtension_builder{\n\t\t\t\t\tIsImport:            proto.Bool(false),\n\t\t\t\t\tIsSyntaxUnspecified: proto.Bool(false),\n\t\t\t\t\tUnusedDependency:    []int32{1},\n\t\t\t\t\tModuleInfo: imagev1.ModuleInfo_builder{\n\t\t\t\t\t\tName: imagev1.ModuleName_builder{\n\t\t\t\t\t\t\tRemote:     proto.String(\"buf.build\"),\n\t\t\t\t\t\t\tOwner:      proto.String(\"foo\"),\n\t\t\t\t\t\t\tRepository: proto.String(\"bar\"),\n\t\t\t\t\t\t}.Build(),\n\t\t\t\t\t\tCommit: proto.String(\"9876543210fedcba9876543210fedcba\"),\n\t\t\t\t\t}.Build(),\n\t\t\t\t}.Build(),\n\t\t\t}.Build(),\n\t\t\timagev1.ImageFile_builder{\n\t\t\t\tSyntax:  proto.String(\"proto3\"),\n\t\t\t\tName:    proto.String(\"b.proto\"),\n\t\t\t\tPackage: proto.String(\"abc.def\"),\n\t\t\t\tEnumType: []*descriptorpb.EnumDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Enum\"),\n\t\t\t\t\t\tValue: []*descriptorpb.EnumValueDescriptorProto{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:   proto.String(\"ZERO\"),\n\t\t\t\t\t\t\t\tNumber: proto.Int32(0),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:   proto.String(\"ONE\"),\n\t\t\t\t\t\t\t\tNumber: proto.Int32(1),\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\tBufExtension: imagev1.ImageFileExtension_builder{\n\t\t\t\t\tIsImport:            proto.Bool(true),\n\t\t\t\t\tIsSyntaxUnspecified: proto.Bool(false),\n\t\t\t\t\tModuleInfo: imagev1.ModuleInfo_builder{\n\t\t\t\t\t\tName: imagev1.ModuleName_builder{\n\t\t\t\t\t\t\tRemote:     proto.String(\"buf.build\"),\n\t\t\t\t\t\t\tOwner:      proto.String(\"foo\"),\n\t\t\t\t\t\t\tRepository: proto.String(\"baz\"),\n\t\t\t\t\t\t}.Build(),\n\t\t\t\t\t\tCommit: proto.String(\"0123456789abcdef0123456789abcdef\"),\n\t\t\t\t\t}.Build(),\n\t\t\t\t}.Build(),\n\t\t\t}.Build(),\n\t\t\timagev1.ImageFile_builder{\n\t\t\t\tSyntax: proto.String(\"proto2\"),\n\t\t\t\tName:   proto.String(\"c.proto\"),\n\t\t\t\tBufExtension: imagev1.ImageFileExtension_builder{\n\t\t\t\t\tIsImport:            proto.Bool(true),\n\t\t\t\t\tIsSyntaxUnspecified: proto.Bool(true),\n\t\t\t\t\tModuleInfo: imagev1.ModuleInfo_builder{\n\t\t\t\t\t\tName: imagev1.ModuleName_builder{\n\t\t\t\t\t\t\tRemote:     proto.String(\"buf.build\"),\n\t\t\t\t\t\t\tOwner:      proto.String(\"foo\"),\n\t\t\t\t\t\t\tRepository: proto.String(\"baz\"),\n\t\t\t\t\t\t}.Build(),\n\t\t\t\t\t\tCommit: proto.String(\"0123456789abcdef0123456789abcdef\"),\n\t\t\t\t\t}.Build(),\n\t\t\t\t}.Build(),\n\t\t\t}.Build(),\n\t\t},\n\t}.Build()\n\n\timage, err := NewImageForProto(protoImage)\n\trequire.NoError(t, err)\n\n\tclone, err := CloneImage(image)\n\trequire.NoError(t, err)\n\n\t// Test that they are equal by comparing their proto versions\n\tprotoClone, err := ImageToProtoImage(clone)\n\trequire.NoError(t, err)\n\n\trequire.Empty(t, cmp.Diff(protoImage, protoClone, protocmp.Transform()))\n\n\t// Verify the pointer values are different\n\tfor _, imageFile := range image.Files() {\n\t\tcloneFile := clone.GetFile(imageFile.Path())\n\t\trequire.NotSame(t, imageFile.FileDescriptorProto(), cloneFile.FileDescriptorProto())\n\t\tunused := reflect.ValueOf(imageFile.UnusedDependencyIndexes()).Pointer()\n\t\tcloneUnused := reflect.ValueOf(cloneFile.UnusedDependencyIndexes()).Pointer()\n\t\tif unused != 0 || cloneUnused != 0 {\n\t\t\t// They can both be nil. But otherwise must not be equal since that\n\t\t\t// means the backing arrays are shared.\n\t\t\trequire.NotEqual(t, unused, cloneUnused)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/import_tracker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"strings\"\n\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/known/anypb\"\n)\n\nvar anyMessageName = (*anypb.Any)(nil).ProtoReflect().Descriptor().FullName()\n\ntype importTracker struct {\n\tresolver protoencoding.Resolver\n\tused     map[string]map[string]struct{}\n}\n\nfunc (t *importTracker) markUsed(importer *imagev1.ImageFile, element string) {\n\tdesc, err := t.resolver.FindDescriptorByName(protoreflect.FullName(strings.TrimPrefix(element, \".\")))\n\tif err != nil {\n\t\t// TODO: Shouldn't be possible. If this happens, element is not in\n\t\t//       the resolved files, so nothing to mark anyway...\n\t\treturn\n\t}\n\timportedFile := desc.ParentFile().Path()\n\n\tfileImports := t.used[importer.GetName()]\n\tif fileImports == nil {\n\t\tfileImports = map[string]struct{}{}\n\t\tt.used[importer.GetName()] = fileImports\n\t}\n\tfor _, depPath := range importer.GetDependency() {\n\t\tif importedFile == depPath {\n\t\t\t// Found it!\n\t\t\tfileImports[depPath] = struct{}{}\n\t\t\treturn\n\t\t}\n\t}\n\t// Not in any imports. So see if it is publicly imported.\n\tfor _, depPath := range importer.GetDependency() {\n\t\tdepFile, err := t.resolver.FindFileByPath(depPath)\n\t\tif err != nil {\n\t\t\t// Shouldn't be possible... bail.\n\t\t\tcontinue\n\t\t}\n\t\tif t.publiclyImports(depFile, importedFile) {\n\t\t\t// Found it!\n\t\t\tfileImports[depPath] = struct{}{}\n\t\t\treturn\n\t\t}\n\t}\n}\n\nfunc (t *importTracker) publiclyImports(file protoreflect.FileDescriptor, importedFile string) bool {\n\tdeps := file.Imports()\n\tfor i, depsLen := 0, deps.Len(); i < depsLen; i++ {\n\t\tdep := deps.Get(i)\n\t\tif !dep.IsPublic {\n\t\t\tcontinue\n\t\t}\n\t\tif dep.Path() == importedFile {\n\t\t\treturn true\n\t\t}\n\t\tif t.publiclyImports(dep, importedFile) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (t *importTracker) findUsedImports(protoImage *imagev1.Image) {\n\tfor _, file := range protoImage.GetFile() {\n\t\tif len(file.GetDependency()) == 0 {\n\t\t\t// no imports so nothing to do\n\t\t\tcontinue\n\t\t}\n\t\tt.findUsedImportsInOptions(file, file.GetOptions())\n\t\tfor _, msg := range file.GetMessageType() {\n\t\t\tt.findUsedImportsInMessage(file, msg)\n\t\t}\n\t\tfor _, enum := range file.GetEnumType() {\n\t\t\tt.findUsedImportsInEnum(file, enum)\n\t\t}\n\t\tfor _, ext := range file.GetExtension() {\n\t\t\tt.findUsedImportsInField(file, ext)\n\t\t}\n\t\tfor _, svc := range file.GetService() {\n\t\t\tt.findUsedImportsInOptions(file, svc.Options)\n\t\t\tfor _, method := range svc.Method {\n\t\t\t\tt.findUsedImportsInOptions(file, method.Options)\n\t\t\t\tt.markUsed(file, method.GetInputType())\n\t\t\t\tt.markUsed(file, method.GetOutputType())\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (t *importTracker) findUsedImportsInMessage(file *imagev1.ImageFile, msg *descriptorpb.DescriptorProto) {\n\tt.findUsedImportsInOptions(file, msg.Options)\n\tfor _, field := range msg.Field {\n\t\tt.findUsedImportsInField(file, field)\n\t}\n\tfor _, oneof := range msg.OneofDecl {\n\t\tt.findUsedImportsInOptions(file, oneof.Options)\n\t}\n\tfor _, extRange := range msg.ExtensionRange {\n\t\tt.findUsedImportsInOptions(file, extRange.Options)\n\t}\n\n\tfor _, nestedMsg := range msg.NestedType {\n\t\tt.findUsedImportsInMessage(file, nestedMsg)\n\t}\n\tfor _, enum := range msg.EnumType {\n\t\tt.findUsedImportsInEnum(file, enum)\n\t}\n\tfor _, ext := range msg.Extension {\n\t\tt.findUsedImportsInField(file, ext)\n\t}\n}\n\nfunc (t *importTracker) findUsedImportsInEnum(file *imagev1.ImageFile, enum *descriptorpb.EnumDescriptorProto) {\n\tt.findUsedImportsInOptions(file, enum.Options)\n\tfor _, value := range enum.Value {\n\t\tt.findUsedImportsInOptions(file, value.Options)\n\t}\n}\n\nfunc (t *importTracker) findUsedImportsInField(file *imagev1.ImageFile, field *descriptorpb.FieldDescriptorProto) {\n\tt.findUsedImportsInOptions(file, field.Options)\n\tswitch field.GetType() {\n\tcase descriptorpb.FieldDescriptorProto_TYPE_MESSAGE,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_GROUP,\n\t\tdescriptorpb.FieldDescriptorProto_TYPE_ENUM:\n\t\tt.markUsed(file, field.GetTypeName())\n\t}\n\textendee := field.GetExtendee()\n\tif extendee != \"\" {\n\t\tt.markUsed(file, extendee)\n\t}\n}\n\nfunc (t *importTracker) findUsedImportsInOptions(file *imagev1.ImageFile, optionMessage proto.Message) {\n\toptionMessage.ProtoReflect().Range(func(field protoreflect.FieldDescriptor, val protoreflect.Value) bool {\n\t\tt.findUsedImportsInOptionValue(file, field, val)\n\t\treturn true\n\t})\n}\n\nfunc (t *importTracker) findUsedImportsInOptionValue(file *imagev1.ImageFile, optionField protoreflect.FieldDescriptor, val protoreflect.Value) {\n\tif optionField.IsExtension() {\n\t\tt.markUsed(file, string(optionField.FullName()))\n\t}\n\tswitch {\n\tcase optionField.IsMap():\n\t\tif optionField.MapValue().Message() == nil {\n\t\t\treturn // no messages to examine\n\t\t}\n\t\tval.Map().Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {\n\t\t\tt.findUsedImportsInMessageValue(file, v.Message())\n\t\t\treturn true\n\t\t})\n\tcase optionField.IsList():\n\t\tif optionField.Message() == nil {\n\t\t\treturn // no messages to examine\n\t\t}\n\t\tlist := val.List()\n\t\tfor i, l := 0, list.Len(); i < l; i++ {\n\t\t\tt.findUsedImportsInMessageValue(file, list.Get(i).Message())\n\t\t}\n\tcase optionField.Message() != nil:\n\t\tt.findUsedImportsInMessageValue(file, val.Message())\n\t}\n}\n\nfunc (t *importTracker) findUsedImportsInMessageValue(file *imagev1.ImageFile, msg protoreflect.Message) {\n\tif msg.Descriptor().FullName() == anyMessageName {\n\t\ttypeURLField := msg.Descriptor().Fields().ByNumber(1)\n\t\tif typeURLField == nil || typeURLField.Kind() != protoreflect.StringKind || typeURLField.IsList() {\n\t\t\t// ruh-roh... this should not happen\n\t\t\treturn\n\t\t}\n\t\tvalueField := msg.Descriptor().Fields().ByNumber(2)\n\t\tif valueField == nil || valueField.Kind() != protoreflect.BytesKind || valueField.IsList() {\n\t\t\t// oof, this should not happen\n\t\t\treturn\n\t\t}\n\n\t\ttypeURL := msg.Get(typeURLField).String()\n\t\tmsgType, err := t.resolver.FindMessageByURL(typeURL)\n\t\tif err != nil {\n\t\t\t// message is not present in the image\n\t\t\treturn\n\t\t}\n\t\tt.markUsed(file, string(msgType.Descriptor().FullName()))\n\t\t// process Any messages that might be nested inside this one\n\t\tvalue := msg.Get(valueField).Bytes()\n\t\tnestedMessage := msgType.New()\n\t\tif err := protoencoding.NewWireUnmarshaler(t.resolver).Unmarshal(value, nestedMessage.Interface()); err != nil {\n\t\t\t// bytes are not valid; skip it\n\t\t\treturn\n\t\t}\n\t\tmsg = nestedMessage // fall-through to recurse into this message\n\t}\n\tmsg.Range(func(field protoreflect.FieldDescriptor, val protoreflect.Value) bool {\n\t\tt.findUsedImportsInOptionValue(file, field, val)\n\t\treturn true\n\t})\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/module_image_file_info.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/google/uuid\"\n)\n\ntype moduleImageFileInfo struct {\n\tbufmodule.FileInfo\n}\n\nfunc newModuleImageFileInfo(fileInfo bufmodule.FileInfo) *moduleImageFileInfo {\n\treturn &moduleImageFileInfo{\n\t\tFileInfo: fileInfo,\n\t}\n}\n\nfunc (p *moduleImageFileInfo) FullName() bufparse.FullName {\n\treturn p.FileInfo.Module().FullName()\n}\n\nfunc (p *moduleImageFileInfo) CommitID() uuid.UUID {\n\treturn p.FileInfo.Module().CommitID()\n}\n\nfunc (p *moduleImageFileInfo) Imports() ([]string, error) {\n\treturn p.FileInfo.ProtoFileImports()\n}\n\nfunc (p *moduleImageFileInfo) IsImport() bool {\n\treturn !p.FileInfo.IsTargetFile()\n}\n\nfunc (*moduleImageFileInfo) isImageFileInfo() {}\n"
  },
  {
    "path": "private/bufpkg/bufimage/parser_accessor_handler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/google/uuid\"\n)\n\ntype parserAccessorHandler struct {\n\tctx                context.Context\n\tmoduleReadBucket   bufmodule.ModuleReadBucket\n\tpathToExternalPath map[string]string\n\tpathToLocalPath    map[string]string\n\tnonImportPaths     map[string]struct{}\n\tpathToFullName     map[string]bufparse.FullName\n\tpathToCommitID     map[string]uuid.UUID\n\tlock               sync.RWMutex\n}\n\nfunc newParserAccessorHandler(\n\tctx context.Context,\n\tmoduleReadBucket bufmodule.ModuleReadBucket,\n) *parserAccessorHandler {\n\treturn &parserAccessorHandler{\n\t\tctx:                ctx,\n\t\tmoduleReadBucket:   moduleReadBucket,\n\t\tpathToExternalPath: make(map[string]string),\n\t\tpathToLocalPath:    make(map[string]string),\n\t\tnonImportPaths:     make(map[string]struct{}),\n\t\tpathToFullName:     make(map[string]bufparse.FullName),\n\t\tpathToCommitID:     make(map[string]uuid.UUID),\n\t}\n}\n\n// Open opens the given path, and tracks the external path and import status.\n//\n// This function can be used as the accessor function for a protocompile.SourceResolver.\nfunc (p *parserAccessorHandler) Open(path string) (_ io.ReadCloser, retErr error) {\n\tmoduleFile, moduleErr := p.moduleReadBucket.GetFile(p.ctx, path)\n\tif moduleErr != nil {\n\t\tif !errors.Is(moduleErr, fs.ErrNotExist) {\n\t\t\treturn nil, moduleErr\n\t\t}\n\t\tif wktModuleFile, wktErr := datawkt.ReadBucket.Get(p.ctx, path); wktErr == nil {\n\t\t\tif wktModuleFile.Path() != path {\n\t\t\t\t// this should never happen, but just in case\n\t\t\t\treturn nil, fmt.Errorf(\"parser accessor requested path %q but got %q\", path, wktModuleFile.Path())\n\t\t\t}\n\t\t\tif err := p.addPath(path, path, \"\", nil, uuid.Nil); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn wktModuleFile, nil\n\t\t}\n\t\treturn nil, moduleErr\n\t}\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = errors.Join(retErr, moduleFile.Close())\n\t\t}\n\t}()\n\tif moduleFile.Path() != path {\n\t\t// this should never happen, but just in case\n\t\treturn nil, fmt.Errorf(\"parser accessor requested path %q but got %q\", path, moduleFile.Path())\n\t}\n\tif err := p.addPath(\n\t\tpath,\n\t\tmoduleFile.ExternalPath(),\n\t\tmoduleFile.LocalPath(),\n\t\tmoduleFile.Module().FullName(),\n\t\tmoduleFile.Module().CommitID(),\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn moduleFile, nil\n}\n\n// ExternalPath returns the external path for the input path.\n//\n// Returns the input path if the external path is not known.\nfunc (p *parserAccessorHandler) ExternalPath(path string) string {\n\tp.lock.RLock()\n\tdefer p.lock.RUnlock()\n\tif externalPath := p.pathToExternalPath[path]; externalPath != \"\" {\n\t\treturn externalPath\n\t}\n\treturn path\n}\n\n// LocalPath returns the local path for the input path if present.\nfunc (p *parserAccessorHandler) LocalPath(path string) string {\n\tp.lock.RLock()\n\tdefer p.lock.RUnlock()\n\treturn p.pathToLocalPath[path]\n}\n\n// FullName returns nil if not available.\nfunc (p *parserAccessorHandler) FullName(path string) bufparse.FullName {\n\tp.lock.RLock()\n\tdefer p.lock.RUnlock()\n\treturn p.pathToFullName[path] // nil is a valid value.\n}\n\n// CommitID returns empty if not available.\nfunc (p *parserAccessorHandler) CommitID(path string) uuid.UUID {\n\tp.lock.RLock()\n\tdefer p.lock.RUnlock()\n\treturn p.pathToCommitID[path] // empty is a valid value.\n}\n\nfunc (p *parserAccessorHandler) addPath(\n\tpath string,\n\texternalPath string,\n\tlocalPath string,\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n) error {\n\tp.lock.Lock()\n\tdefer p.lock.Unlock()\n\texistingExternalPath, ok := p.pathToExternalPath[path]\n\tif ok {\n\t\tif existingExternalPath != externalPath {\n\t\t\treturn fmt.Errorf(\"parser accessor had external paths %q and %q for path %q\", existingExternalPath, externalPath, path)\n\t\t}\n\t} else {\n\t\tp.pathToExternalPath[path] = externalPath\n\t}\n\tif localPath != \"\" {\n\t\texistingLocalPath, ok := p.pathToLocalPath[path]\n\t\tif ok {\n\t\t\tif existingLocalPath != localPath {\n\t\t\t\treturn fmt.Errorf(\"parser accessor had local paths %q and %q for path %q\", existingLocalPath, localPath, path)\n\t\t\t}\n\t\t} else {\n\t\t\tp.pathToLocalPath[path] = localPath\n\t\t}\n\t}\n\tif moduleFullName != nil {\n\t\tp.pathToFullName[path] = moduleFullName\n\t}\n\tif commitID != uuid.Nil {\n\t\tp.pathToCommitID[path] = commitID\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/customoptions1/a.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FieldOptions {\n  int32 baz = 50007;\n}\n\nmessage Foo {\n  string bar = 1 [(baz) = 42];\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/customoptionserror1/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FieldOptions {\n  Foo foo = 50007;\n}\n\nmessage Foo {\n  string bar = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/customoptionserror1/b.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"a.proto\";\n\nmessage Baz {\n  // the name is actually (a.foo).bar\n  string bat = 1 [(a.foo).bat = 1];\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/cyclicimport/a/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nimport \"b/b.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/cyclicimport/b/b.proto",
    "content": "syntax = \"proto3\";\n\npackage b;\n\nimport \"a/a.proto\";\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/duplicatesyntheticoneofs/a1.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Foo {\n  optional string bar = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/duplicatesyntheticoneofs/a2.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\nmessage Foo {\n  optional string bar = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/notamessagetype/a.proto",
    "content": "syntax=\"proto3\";\n\npackage a;\n\nmessage Foo{}\nmessage Bar{}\n\nservice MyService{\n  rpc Foo(Foo) returns (Bar);\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/optionpanic/options/option.proto",
    "content": "syntax = \"proto3\";\n\npackage options;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.FileOptions {\n  MyOption my_option = 9999;\n}\n\nmessage MyOption {\n  repeated MyArray my_array = 1;\n}\n\nmessage MyArray {\n  message TestMessage {\n  }\n  map<string, TestMessage> my_map = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/optionpanic/proto/test.proto",
    "content": "syntax = \"proto3\";\n\npackage proto;\n\nimport \"options/option.proto\";\n\noption (options.my_option) = {\n  my_array: {\n    my_map: {\n    }\n  }\n};\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/proto3optional1/a.proto",
    "content": "syntax = \"proto3\";\n\nmessage Foo {\n  optional string bar = 1;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/semicolons/a.proto",
    "content": "syntax=\"proto3\";;;;\n;;;\n;package a;;;;;\n;\n;;;;import \"google/protobuf/descriptor.proto\";\n;;\n;\n;;extend google.protobuf.FileOptions {\n\tbool foo = 9999999;\n}\n;\n;message Bar {\n\t;;;option deprecated = true;;;;\n\t;;;;\n\tint32 one = 1;;;;\n\t;repeated bool two = 2 [deprecated = true];;\n\tmap<string, string> three = 3 [\n\t\tdeprecated = false\n\t];;;;\n};;;;\n;;\n;enum Baz {\n\t;;;;option deprecated = true;;;;\n\n\t;DEFAULT = 0;;;;\n\tONE = 1;;;\n\tTWO = 2;;;;\n};;;\n;;\n;service BatService {\n;\t;option deprecated = true;;;;\n;\n\t;rpc Bam(Bar) returns (Other);;;\n;\n\trpc Ban(Other) returns (Bar) {\n\t;\t;option deprecated = true;;;;\n\t};;;;\n};;;;\n;\n;\n;;;;message Other{;;;};;;;;\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/spacebetweennumberandid/a.proto",
    "content": "syntax=\"proto2\";\n\npackage a;\n\nmessage Test{\n  extensions 10to max;\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/testdata/trailingcomments/a.proto",
    "content": "syntax = \"proto3\";\n\npackage a;\n\n// https://github.com/bufbuild/buf/issues/798\n\nenum Foo { // first comment\n  FOO_UNSPECIFIED = 0;\n} // second comment\n"
  },
  {
    "path": "private/bufpkg/bufimage/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufimage\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufimage/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/bufbuild/protoplugin/protopluginutil\"\n\t\"github.com/google/uuid\"\n\t\"google.golang.org/protobuf/encoding/protowire\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\n// Must match the tag number for ImageFile.buf_extensions defined in proto/buf/alpha/image/v1/image.proto.\nconst bufExtensionFieldNumber = 8042\n\n// paths can be either files (ending in .proto) or directories\n// paths must be normalized and validated, and not duplicated\n// if a directory, all .proto files underneath will be included\nfunc imageWithOnlyPaths(image Image, fileOrDirPaths []string, excludeFileOrDirPaths []string, allowNotExist bool) (Image, error) {\n\tif err := normalpath.ValidatePathsNormalizedValidatedUnique(fileOrDirPaths); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := normalpath.ValidatePathsNormalizedValidatedUnique(excludeFileOrDirPaths); err != nil {\n\t\treturn nil, err\n\t}\n\texcludeFileOrDirPathMap := xslices.ToStructMap(excludeFileOrDirPaths)\n\t// These are the files that fileOrDirPaths actually reference and will\n\t// result in the non-imports in our resulting Image. The Image will also include\n\t// the ImageFiles that the nonImportImageFiles import\n\tnonImportPaths := make(map[string]struct{})\n\tvar nonImportImageFiles []ImageFile\n\t// We have only exclude paths, and therefore all other paths are target paths.\n\tif len(fileOrDirPaths) == 0 && len(excludeFileOrDirPaths) > 0 {\n\t\tfor _, imageFile := range image.Files() {\n\t\t\tif !imageFile.IsImport() {\n\t\t\t\tif !normalpath.MapHasEqualOrContainingPath(excludeFileOrDirPathMap, imageFile.Path(), normalpath.Relative) {\n\t\t\t\t\tnonImportPaths[imageFile.Path()] = struct{}{}\n\t\t\t\t\tnonImportImageFiles = append(nonImportImageFiles, imageFile)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Finally, before we construct the image, we need to validate that all exclude paths\n\t\t// provided adhere to the allowNotExist flag.\n\t\tif !allowNotExist {\n\t\t\tif err := checkExcludePathsExistInImage(image, excludeFileOrDirPaths); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn getImageWithImports(image, nonImportPaths, nonImportImageFiles)\n\t}\n\t// We do a check here to ensure that no paths are duplicated as a target and an exclude.\n\tfor _, fileOrDirPath := range fileOrDirPaths {\n\t\tif _, ok := excludeFileOrDirPathMap[fileOrDirPath]; ok {\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"cannot set the same path for both --path and --exclude-path flags: %s\",\n\t\t\t\tnormalpath.Unnormalize(fileOrDirPath),\n\t\t\t)\n\t\t}\n\t}\n\t// potentialDirPaths are paths that we need to check if they are directories\n\t// these are any files that do not end in .proto, as well as files that\n\t// end in .proto but do not have a corresponding ImageFile - if there\n\t// is not an ImageFile, the path ending in .proto could be a directory\n\t// that itself contains ImageFiles, i.e. a/b.proto/c.proto is valid if not dumb\n\tvar potentialDirPaths []string\n\tfor _, fileOrDirPath := range fileOrDirPaths {\n\t\t// this is not allowed, this is the equivalent of a root\n\t\tif fileOrDirPath == \".\" {\n\t\t\treturn nil, errors.New(`\".\" is not a valid path value`)\n\t\t}\n\t\tif normalpath.Ext(fileOrDirPath) != \".proto\" {\n\t\t\t// not a .proto file, therefore must be a directory\n\t\t\tpotentialDirPaths = append(potentialDirPaths, fileOrDirPath)\n\t\t} else {\n\t\t\tif imageFile := image.GetFile(fileOrDirPath); imageFile != nil {\n\t\t\t\t// We do not need to check excludes here, since we already checked for duplicated\n\t\t\t\t// paths, and target files that resolve to a specific image file are always a leaf,\n\t\t\t\t// thus, we would always include it if it's specified.\n\t\t\t\t// We have an ImageFile, therefore the fileOrDirPath was a file path\n\t\t\t\t// add to the nonImportImageFiles if does not already exist\n\t\t\t\tif _, ok := nonImportPaths[fileOrDirPath]; !ok {\n\t\t\t\t\tnonImportPaths[fileOrDirPath] = struct{}{}\n\t\t\t\t\tnonImportImageFiles = append(nonImportImageFiles, imageFile)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we do not have an image file, so even though this path ends\n\t\t\t\t// in .proto,  this could be a directory - we need to check it\n\t\t\t\tpotentialDirPaths = append(potentialDirPaths, fileOrDirPath)\n\t\t\t}\n\t\t}\n\t}\n\tif len(potentialDirPaths) == 0 {\n\t\t// We had no potential directory paths as we were able to get\n\t\t// an ImageFile for all fileOrDirPaths, so we can return an Image now.\n\t\t// This means we do not have to do the expensive O(image.Files()) operation\n\t\t// to check to see if each file is within a potential directory path.\n\t\t//\n\t\t// We do not need to check the excluded paths for the allowNotExist flag because all target\n\t\t// paths were image files, therefore the exclude paths would not apply in this case.\n\t\t//\n\t\t// Unfortunately, we need to do the expensive operation of checking to make sure the exclude\n\t\t// paths exist in the case where `allowNotExist == false`.\n\t\tif !allowNotExist {\n\t\t\tif err := checkExcludePathsExistInImage(image, excludeFileOrDirPaths); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\treturn getImageWithImports(image, nonImportPaths, nonImportImageFiles)\n\t}\n\t// we have potential directory paths, do the expensive operation\n\t// make a map of the directory paths\n\t// note that we do not make this a map to begin with as maps are unordered,\n\t// and we want to make sure we iterate over the paths in a deterministic order\n\tpotentialDirPathMap := xslices.ToStructMap(potentialDirPaths)\n\n\t// map of all paths based on the imageFiles\n\t// the map of paths within potentialDirPath that matches a file in image.Files()\n\t// this needs to contain all paths in potentialDirPathMap at the end for us to\n\t// have had matches for every inputted fileOrDirPath\n\tmatchingPotentialDirPathMap := make(map[string]struct{})\n\t// the same thing is done for exclude paths\n\tmatchingPotentialExcludePathMap := make(map[string]struct{})\n\tfor _, imageFile := range image.Files() {\n\t\timageFilePath := imageFile.Path()\n\t\tfileMatchingExcludePathMap := normalpath.MapAllEqualOrContainingPathMap(\n\t\t\texcludeFileOrDirPathMap,\n\t\t\timageFilePath,\n\t\t\tnormalpath.Relative,\n\t\t)\n\t\tif len(fileMatchingExcludePathMap) > 0 {\n\t\t\tfor key := range fileMatchingExcludePathMap {\n\t\t\t\tmatchingPotentialExcludePathMap[key] = struct{}{}\n\t\t\t}\n\t\t}\n\t\t// get the paths in potentialDirPathMap that match this imageFilePath\n\t\tfileMatchingPathMap := normalpath.MapAllEqualOrContainingPathMap(\n\t\t\tpotentialDirPathMap,\n\t\t\timageFilePath,\n\t\t\tnormalpath.Relative,\n\t\t)\n\t\tif shouldExcludeFile(fileMatchingPathMap, fileMatchingExcludePathMap) {\n\t\t\tcontinue\n\t\t}\n\t\tif len(fileMatchingPathMap) > 0 {\n\t\t\t// we had a match, this means that some path in potentialDirPaths matched\n\t\t\t// the imageFilePath, add all the paths in potentialDirPathMap that\n\t\t\t// matched to matchingPotentialDirPathMap\n\t\t\tfor key := range fileMatchingPathMap {\n\t\t\t\tmatchingPotentialDirPathMap[key] = struct{}{}\n\t\t\t}\n\t\t\t// then, add the file to non-imports if it is not added\n\t\t\tif _, ok := nonImportPaths[imageFilePath]; !ok {\n\t\t\t\tnonImportPaths[imageFilePath] = struct{}{}\n\t\t\t\tnonImportImageFiles = append(nonImportImageFiles, imageFile)\n\t\t\t}\n\t\t}\n\t}\n\t// if !allowNotExist, i.e. if all fileOrDirPaths must have a matching ImageFile,\n\t// we check the matchingPotentialDirPathMap against the potentialDirPathMap\n\t// to make sure that potentialDirPathMap is covered\n\tif !allowNotExist {\n\t\tfor potentialDirPath := range potentialDirPathMap {\n\t\t\tif _, ok := matchingPotentialDirPathMap[potentialDirPath]; !ok {\n\t\t\t\t// no match, this is an error given that allowNotExist is false\n\t\t\t\treturn nil, fmt.Errorf(\"path %q has no matching file in the image\", potentialDirPath)\n\t\t\t}\n\t\t}\n\t\tfor excludeFileOrDirPath := range excludeFileOrDirPathMap {\n\t\t\tif _, ok := matchingPotentialExcludePathMap[excludeFileOrDirPath]; !ok {\n\t\t\t\t// no match, this is an error given that allowNotExist is false\n\t\t\t\treturn nil, fmt.Errorf(\"path %q has no matching file in the image\", excludeFileOrDirPath)\n\t\t\t}\n\t\t}\n\t}\n\t// we finally have all files that match fileOrDirPath that we can find, make the image\n\treturn getImageWithImports(image, nonImportPaths, nonImportImageFiles)\n}\n\n// shouldExcludeFile takes the map of all the matching target paths and the map of all the matching\n// exclude paths for an image file and takes the union of the two sets of matches to return\n// a bool on whether or not we should exclude the file from the image.\nfunc shouldExcludeFile(\n\tfileMatchingPathMap map[string]struct{},\n\tfileMatchingExcludePathMap map[string]struct{},\n) bool {\n\tfor fileMatchingPath := range fileMatchingPathMap {\n\t\tfor fileMatchingExcludePath := range fileMatchingExcludePathMap {\n\t\t\tif normalpath.EqualsOrContainsPath(fileMatchingPath, fileMatchingExcludePath, normalpath.Relative) {\n\t\t\t\tdelete(fileMatchingPathMap, fileMatchingPath)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\t// If there are no potential paths remaining,\n\t// then the file should be excluded.\n\treturn len(fileMatchingPathMap) == 0\n}\n\nfunc getImageWithImports(\n\timage Image,\n\tnonImportPaths map[string]struct{},\n\tnonImportImageFiles []ImageFile,\n) (Image, error) {\n\tvar imageFiles []ImageFile\n\tseenPaths := make(map[string]struct{})\n\tfor _, nonImportImageFile := range nonImportImageFiles {\n\t\timageFiles = addFileWithImports(\n\t\t\timageFiles,\n\t\t\timage,\n\t\t\tnonImportPaths,\n\t\t\tseenPaths,\n\t\t\tnonImportImageFile,\n\t\t)\n\t}\n\treturn NewImage(imageFiles)\n}\n\n// returns accumulated files in correct order\nfunc addFileWithImports(\n\taccumulator []ImageFile,\n\timage Image,\n\tnonImportPaths map[string]struct{},\n\tseenPaths map[string]struct{},\n\timageFile ImageFile,\n) []ImageFile {\n\tpath := imageFile.Path()\n\t// if seen already, skip\n\tif _, ok := seenPaths[path]; ok {\n\t\treturn accumulator\n\t}\n\tseenPaths[path] = struct{}{}\n\n\t// then, add imports first, for proper ordering\n\tfor _, importPath := range imageFile.FileDescriptorProto().GetDependency() {\n\t\tif importFile := image.GetFile(importPath); importFile != nil {\n\t\t\taccumulator = addFileWithImports(\n\t\t\t\taccumulator,\n\t\t\t\timage,\n\t\t\t\tnonImportPaths,\n\t\t\t\tseenPaths,\n\t\t\t\timportFile,\n\t\t\t)\n\t\t}\n\t}\n\n\t// finally, add this file\n\t// check if this is an import or not\n\t_, isNotImport := nonImportPaths[path]\n\taccumulator = append(\n\t\taccumulator,\n\t\tImageFileWithIsImport(imageFile, !isNotImport),\n\t)\n\treturn accumulator\n}\n\nfunc checkExcludePathsExistInImage(image Image, excludeFileOrDirPaths []string) error {\n\tfor _, excludeFileOrDirPath := range excludeFileOrDirPaths {\n\t\tvar foundPath bool\n\t\tfor _, imageFile := range image.Files() {\n\t\t\tif normalpath.EqualsOrContainsPath(excludeFileOrDirPath, imageFile.Path(), normalpath.Relative) {\n\t\t\t\tfoundPath = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !foundPath {\n\t\t\t// no match, this is an error given that allowNotExist is false\n\t\t\treturn fmt.Errorf(\"path %q has no matching file in the image\", excludeFileOrDirPath)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc imageFilesToFileDescriptorProtos(imageFiles []ImageFile) []*descriptorpb.FileDescriptorProto {\n\tfileDescriptorProtos := make([]*descriptorpb.FileDescriptorProto, len(imageFiles))\n\tfor i, imageFile := range imageFiles {\n\t\tfileDescriptorProtos[i] = imageFile.FileDescriptorProto()\n\t}\n\treturn fileDescriptorProtos\n}\n\nfunc imageFileToProtoImageFile(imageFile ImageFile) (*imagev1.ImageFile, error) {\n\tvar protoCommitID string\n\tif imageFile.CommitID() != uuid.Nil {\n\t\tprotoCommitID = uuidutil.ToDashless(imageFile.CommitID())\n\t}\n\treturn fileDescriptorProtoToProtoImageFile(\n\t\timageFile.FileDescriptorProto(),\n\t\timageFile.IsImport(),\n\t\timageFile.IsSyntaxUnspecified(),\n\t\timageFile.UnusedDependencyIndexes(),\n\t\timageFile.FullName(),\n\t\tprotoCommitID,\n\t), nil\n}\n\nfunc fileDescriptorProtoToProtoImageFile(\n\tfileDescriptorProto *descriptorpb.FileDescriptorProto,\n\tisImport bool,\n\tisSyntaxUnspecified bool,\n\tunusedDependencyIndexes []int32,\n\tmoduleFullName bufparse.FullName,\n\t// Dashless\n\tmoduleProtoCommitID string,\n) *imagev1.ImageFile {\n\tvar protoModuleInfo *imagev1.ModuleInfo\n\tif moduleFullName != nil {\n\t\tprotoModuleInfo = imagev1.ModuleInfo_builder{\n\t\t\tName: imagev1.ModuleName_builder{\n\t\t\t\tRemote:     proto.String(moduleFullName.Registry()),\n\t\t\t\tOwner:      proto.String(moduleFullName.Owner()),\n\t\t\t\tRepository: proto.String(moduleFullName.Name()),\n\t\t\t}.Build(),\n\t\t}.Build()\n\t\tif moduleProtoCommitID != \"\" {\n\t\t\tprotoModuleInfo.SetCommit(moduleProtoCommitID)\n\t\t}\n\t}\n\tif len(unusedDependencyIndexes) == 0 {\n\t\tunusedDependencyIndexes = nil\n\t}\n\tresultFile := imagev1.ImageFile_builder{\n\t\tName:             fileDescriptorProto.Name,\n\t\tPackage:          fileDescriptorProto.Package,\n\t\tSyntax:           fileDescriptorProto.Syntax,\n\t\tDependency:       fileDescriptorProto.GetDependency(),\n\t\tPublicDependency: fileDescriptorProto.GetPublicDependency(),\n\t\tWeakDependency:   fileDescriptorProto.GetWeakDependency(),\n\t\tMessageType:      fileDescriptorProto.GetMessageType(),\n\t\tEnumType:         fileDescriptorProto.GetEnumType(),\n\t\tService:          fileDescriptorProto.GetService(),\n\t\tExtension:        fileDescriptorProto.GetExtension(),\n\t\tOptions:          fileDescriptorProto.GetOptions(),\n\t\tSourceCodeInfo:   fileDescriptorProto.GetSourceCodeInfo(),\n\t\tEdition:          fileDescriptorProto.Edition,\n\t\tBufExtension: imagev1.ImageFileExtension_builder{\n\t\t\t// we might actually want to differentiate between unset and false\n\t\t\tIsImport: proto.Bool(isImport),\n\t\t\t// we might actually want to differentiate between unset and false\n\t\t\tIsSyntaxUnspecified: proto.Bool(isSyntaxUnspecified),\n\t\t\tUnusedDependency:    unusedDependencyIndexes,\n\t\t\tModuleInfo:          protoModuleInfo,\n\t\t}.Build(),\n\t}.Build()\n\tresultFile.ProtoReflect().SetUnknown(stripBufExtensionField(fileDescriptorProto.ProtoReflect().GetUnknown()))\n\treturn resultFile\n}\n\nfunc stripBufExtensionField(unknownFields protoreflect.RawFields) protoreflect.RawFields {\n\t// We accumulate the new bytes in result. However, for efficiency, we don't do any\n\t// allocation/copying until we have to (i.e. until we actually see the field we're\n\t// trying to strip). So result will be left nil and initialized lazily if-and-only-if\n\t// we actually need to strip data from unknownFields.\n\tvar result protoreflect.RawFields\n\tbytesRemaining := unknownFields\n\tfor len(bytesRemaining) > 0 {\n\t\tnum, wireType, n := protowire.ConsumeTag(bytesRemaining)\n\t\tif n < 0 {\n\t\t\t// shouldn't be possible unless explicitly set to invalid bytes via reflection\n\t\t\treturn unknownFields\n\t\t}\n\t\tvar skip bool\n\t\tif num == bufExtensionFieldNumber {\n\t\t\t// We need to strip this field.\n\t\t\tskip = true\n\t\t\tif result == nil {\n\t\t\t\t// Lazily initialize result to the preface that we've already examined.\n\t\t\t\tresult = append(\n\t\t\t\t\tmake(protoreflect.RawFields, 0, len(unknownFields)),\n\t\t\t\t\tunknownFields[:len(unknownFields)-len(bytesRemaining)]...,\n\t\t\t\t)\n\t\t\t}\n\t\t} else if result != nil {\n\t\t\t// accumulate data in result as we go\n\t\t\tresult = append(result, bytesRemaining[:n]...)\n\t\t}\n\t\tbytesRemaining = bytesRemaining[n:]\n\t\tn = protowire.ConsumeFieldValue(num, wireType, bytesRemaining)\n\t\tif n < 0 {\n\t\t\treturn unknownFields\n\t\t}\n\t\tif !skip && result != nil {\n\t\t\tresult = append(result, bytesRemaining[:n]...)\n\t\t}\n\t\tbytesRemaining = bytesRemaining[n:]\n\t}\n\tif result == nil {\n\t\t// we did not have to remove anything\n\t\treturn unknownFields\n\t}\n\treturn result\n}\n\nfunc imageToCodeGeneratorRequest(\n\timage Image,\n\tparameter string,\n\tcompilerVersion *pluginpb.Version,\n\tincludeImports bool,\n\tincludeWellKnownTypes bool,\n\talreadyUsedPaths map[string]struct{},\n\tnonImportPaths map[string]struct{},\n) (*pluginpb.CodeGeneratorRequest, error) {\n\timageFiles := image.Files()\n\trequest := &pluginpb.CodeGeneratorRequest{\n\t\tProtoFile:       make([]*descriptorpb.FileDescriptorProto, len(imageFiles)),\n\t\tCompilerVersion: compilerVersion,\n\t}\n\tif parameter != \"\" {\n\t\trequest.Parameter = proto.String(parameter)\n\t}\n\tfor i, imageFile := range imageFiles {\n\t\tfileDescriptorProto := imageFile.FileDescriptorProto()\n\t\t// ProtoFile should include only runtime-retained options for files to generate.\n\t\tif isFileToGenerate(\n\t\t\timageFile,\n\t\t\talreadyUsedPaths,\n\t\t\tnonImportPaths,\n\t\t\tincludeImports,\n\t\t\tincludeWellKnownTypes,\n\t\t) {\n\t\t\trequest.FileToGenerate = append(request.FileToGenerate, imageFile.Path())\n\t\t\t// Source-retention options for items in FileToGenerate are provided in SourceFileDescriptors.\n\t\t\trequest.SourceFileDescriptors = append(request.SourceFileDescriptors, fileDescriptorProto)\n\t\t\t// And the corresponding descriptor in ProtoFile will have source-retention options stripped.\n\t\t\tvar err error\n\t\t\tfileDescriptorProto, err = protopluginutil.StripSourceRetentionOptions(fileDescriptorProto)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to strip source-retention options for file %q when constructing a CodeGeneratorRequest: %w\", imageFile.Path(), err)\n\t\t\t}\n\t\t}\n\t\trequest.ProtoFile[i] = fileDescriptorProto\n\t}\n\treturn request, nil\n}\n\nfunc isFileToGenerate(\n\timageFile ImageFile,\n\talreadyUsedPaths map[string]struct{},\n\tnonImportPaths map[string]struct{},\n\tincludeImports bool,\n\tincludeWellKnownTypes bool,\n) bool {\n\tpath := imageFile.Path()\n\tif !imageFile.IsImport() {\n\t\tif alreadyUsedPaths != nil {\n\t\t\t// set as already used\n\t\t\talreadyUsedPaths[path] = struct{}{}\n\t\t}\n\t\t// this is a non-import in this image, we always want to generate\n\t\treturn true\n\t}\n\tif !includeImports {\n\t\t// we don't want to include imports\n\t\treturn false\n\t}\n\tif !includeWellKnownTypes && datawkt.Exists(path) {\n\t\t// we don't want to generate wkt even if includeImports is set unless\n\t\t// includeWellKnownTypes is set\n\t\treturn false\n\t}\n\tif alreadyUsedPaths != nil {\n\t\tif _, ok := alreadyUsedPaths[path]; ok {\n\t\t\t// this was already added for generate to another image\n\t\t\treturn false\n\t\t}\n\t}\n\tif nonImportPaths != nil {\n\t\tif _, ok := nonImportPaths[path]; ok {\n\t\t\t// this is a non-import in another image so it will be generated\n\t\t\t// from another image\n\t\t\treturn false\n\t\t}\n\t}\n\t// includeImports is set, this isn't a wkt, and it won't be generated in another image\n\tif alreadyUsedPaths != nil {\n\t\t// set as already used\n\t\talreadyUsedPaths[path] = struct{}{}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/util_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"bytes\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/encoding/protowire\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestStripBufExtensionField(t *testing.T) {\n\tt.Parallel()\n\tfile := imagev1.ImageFile_builder{\n\t\tBufExtension: imagev1.ImageFileExtension_builder{\n\t\t\tIsImport:         proto.Bool(true),\n\t\t\tUnusedDependency: []int32{1, 3, 5},\n\t\t\tModuleInfo: imagev1.ModuleInfo_builder{\n\t\t\t\tName: imagev1.ModuleName_builder{\n\t\t\t\t\tRemote:     proto.String(\"buf.build\"),\n\t\t\t\t\tOwner:      proto.String(\"foo\"),\n\t\t\t\t\tRepository: proto.String(\"bar\"),\n\t\t\t\t}.Build(),\n\t\t\t\tCommit: proto.String(\"1234981234123412341234\"),\n\t\t\t}.Build(),\n\t\t}.Build(),\n\t}.Build()\n\tdataToBeStripped, err := protoencoding.NewWireMarshaler().Marshal(file)\n\trequire.NoError(t, err)\n\n\totherData := protowire.AppendTag(nil, 122, protowire.BytesType)\n\totherData = protowire.AppendBytes(otherData, []byte{1, 18, 28, 123, 5, 3, 1})\n\totherData = protowire.AppendTag(otherData, 123, protowire.VarintType)\n\totherData = protowire.AppendVarint(otherData, 23456)\n\totherData = protowire.AppendTag(otherData, 124, protowire.Fixed32Type)\n\totherData = protowire.AppendFixed32(otherData, 23456)\n\totherData = protowire.AppendTag(otherData, 125, protowire.Fixed64Type)\n\totherData = protowire.AppendFixed64(otherData, 23456)\n\totherData = protowire.AppendTag(otherData, 126, protowire.StartGroupType)\n\t{\n\t\totherData = protowire.AppendTag(otherData, 1, protowire.VarintType)\n\t\totherData = protowire.AppendVarint(otherData, 123)\n\t\totherData = protowire.AppendTag(otherData, 2, protowire.BytesType)\n\t\totherData = protowire.AppendBytes(otherData, []byte(\"foo-bar-baz\"))\n\t}\n\totherData = protowire.AppendTag(otherData, 126, protowire.EndGroupType)\n\n\ttestCases := []struct {\n\t\tname           string\n\t\tinput          []byte\n\t\texpectedOutput []byte\n\t}{\n\t\t{\n\t\t\tname:           \"nothing to strip\",\n\t\t\tinput:          otherData,\n\t\t\texpectedOutput: otherData,\n\t\t},\n\t\t{\n\t\t\tname:           \"nothing left after strip\",\n\t\t\tinput:          dataToBeStripped,\n\t\t\texpectedOutput: []byte{},\n\t\t},\n\t\t{\n\t\t\tname:           \"stripped field at start\",\n\t\t\tinput:          bytes.Join([][]byte{dataToBeStripped, otherData}, nil),\n\t\t\texpectedOutput: otherData,\n\t\t},\n\t\t{\n\t\t\tname:           \"stripped field at end\",\n\t\t\tinput:          bytes.Join([][]byte{otherData, dataToBeStripped}, nil),\n\t\t\texpectedOutput: otherData,\n\t\t},\n\t\t{\n\t\t\tname:           \"stripped field in the middle\",\n\t\t\tinput:          bytes.Join([][]byte{otherData, dataToBeStripped, otherData}, nil),\n\t\t\texpectedOutput: bytes.Repeat(otherData, 2),\n\t\t},\n\t}\n\tfor i := range testCases {\n\t\ttestCase := testCases[i]\n\t\tt.Run(testCase.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tstripped := stripBufExtensionField(testCase.input)\n\t\t\trequire.Equal(t, testCase.expectedOutput, []byte(stripped))\n\t\t})\n\t}\n}\n\nfunc TestImageToProtoPreservesUnrecognizedFields(t *testing.T) {\n\tt.Parallel()\n\tfileDescriptor := &descriptorpb.FileDescriptorProto{\n\t\tName:    proto.String(\"foo/bar/baz.proto\"),\n\t\tPackage: proto.String(\"foo.bar.baz\"),\n\t\tSyntax:  proto.String(\"proto3\"),\n\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Foo\"),\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     proto.String(\"id\"),\n\t\t\t\t\t\tNumber:   proto.Int32(1),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_INT64.Enum(),\n\t\t\t\t\t\tJsonName: proto.String(\"id\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     proto.String(\"name\"),\n\t\t\t\t\t\tNumber:   proto.Int32(2),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\tJsonName: proto.String(\"name\"),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\totherData := protowire.AppendTag(nil, 122, protowire.BytesType)\n\totherData = protowire.AppendBytes(otherData, []byte{1, 18, 28, 123, 5, 3, 1})\n\totherData = protowire.AppendTag(otherData, 123, protowire.VarintType)\n\totherData = protowire.AppendVarint(otherData, 23456)\n\totherData = protowire.AppendTag(otherData, 124, protowire.Fixed32Type)\n\totherData = protowire.AppendFixed32(otherData, 23456)\n\tfileDescriptor.ProtoReflect().SetUnknown(otherData)\n\n\tmoduleFullName, err := bufparse.ParseFullName(\"buf.build/foo/bar\")\n\trequire.NoError(t, err)\n\tcommitID, err := uuidutil.New()\n\trequire.NoError(t, err)\n\timageFile, err := NewImageFile(\n\t\tfileDescriptor,\n\t\tmoduleFullName,\n\t\tcommitID,\n\t\t\"foo/bar/baz.proto\",\n\t\t\"\",\n\t\tfalse,\n\t\tfalse,\n\t\tnil,\n\t)\n\trequire.NoError(t, err)\n\n\tprotoImageFile, err := imageFileToProtoImageFile(imageFile)\n\trequire.NoError(t, err)\n\t// make sure unrecognized bytes survived\n\trequire.Equal(t, otherData, []byte(protoImageFile.ProtoReflect().GetUnknown()))\n\n\t// now round-trip it back through\n\timageFileBytes, err := protoencoding.NewWireMarshaler().Marshal(protoImageFile)\n\trequire.NoError(t, err)\n\n\troundTrippedFileDescriptor := &descriptorpb.FileDescriptorProto{}\n\terr = protoencoding.NewWireUnmarshaler(nil).Unmarshal(imageFileBytes, roundTrippedFileDescriptor)\n\trequire.NoError(t, err)\n\t// unrecognized now includes image file's buf extension\n\trequire.Greater(t, len(roundTrippedFileDescriptor.ProtoReflect().GetUnknown()), len(otherData))\n\n\t// if we go back through an image file, we should strip out the\n\t// buf extension unknown bytes but preserve the rest\n\tmoduleFullName, err = bufparse.ParseFullName(\"buf.build/abc/def\")\n\trequire.NoError(t, err)\n\t// NB: intentionally different metadata\n\tcommitID2, err := uuidutil.New()\n\trequire.NoError(t, err)\n\timageFile, err = NewImageFile(\n\t\tfileDescriptor,\n\t\tmoduleFullName,\n\t\tcommitID2,\n\t\t\"abc/def/xyz.proto\",\n\t\t\"\",\n\t\tfalse,\n\t\ttrue,\n\t\t[]int32{1, 2, 3},\n\t)\n\trequire.NoError(t, err)\n\n\tprotoImageFile, err = imageFileToProtoImageFile(imageFile)\n\trequire.NoError(t, err)\n\t// make sure unrecognized bytes survived and extraneous buf extension is not present\n\trequire.Equal(t, otherData, []byte(protoImageFile.ProtoReflect().GetUnknown()))\n\n\t// double-check via round-trip, to make sure resulting image file equals the input\n\t// (to verify that the original unknown bytes byf extension didn't interfere)\n\timageFileBytes, err = protoencoding.NewWireMarshaler().Marshal(protoImageFile)\n\trequire.NoError(t, err)\n\n\troundTrippedImageFile := &imagev1.ImageFile{}\n\terr = protoencoding.NewWireUnmarshaler(nil).Unmarshal(imageFileBytes, roundTrippedImageFile)\n\trequire.NoError(t, err)\n\n\tdiff := cmp.Diff(protoImageFile, roundTrippedImageFile, protocmp.Transform())\n\trequire.Empty(t, diff)\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/validate.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\timagev1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n)\n\n// we validate the actual fields of the FileDescriptorProtos as part of newImageFile\nfunc validateProtoImage(protoImage *imagev1.Image) error {\n\tif protoImage == nil {\n\t\treturn errors.New(\"nil Image\")\n\t}\n\tif len(protoImage.GetFile()) == 0 {\n\t\treturn errors.New(\"image contains no files\")\n\t}\n\tfor _, protoImageFile := range protoImage.GetFile() {\n\t\tif err := validateProtoImageFile(protoImageFile); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateProtoImageFile(protoImageFile *imagev1.ImageFile) error {\n\tif protoImageFileExtension := protoImageFile.GetBufExtension(); protoImageFileExtension != nil {\n\t\tlenDependencies := len(protoImageFile.GetDependency())\n\t\tfor _, index := range protoImageFileExtension.GetUnusedDependency() {\n\t\t\tif int(index) >= lenDependencies || int(index) < 0 {\n\t\t\t\treturn fmt.Errorf(\"unused dependency index %d is out of range\", index)\n\t\t\t}\n\t\t}\n\t\tif protoModuleInfo := protoImageFileExtension.GetModuleInfo(); protoModuleInfo != nil {\n\t\t\treturn validateProtoModuleInfo(protoModuleInfo)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateProtoModuleInfo(protoModuleInfo *imagev1.ModuleInfo) error {\n\tif protoModuleName := protoModuleInfo.GetName(); protoModuleName != nil {\n\t\treturn validateProtoModuleName(protoModuleInfo.GetName())\n\t}\n\treturn nil\n}\n\nfunc validateProtoModuleName(protoModuleName *imagev1.ModuleName) error {\n\tif protoModuleName.GetRemote() == \"\" {\n\t\treturn errors.New(\"empty ModuleName.Remote\")\n\t}\n\tif protoModuleName.GetOwner() == \"\" {\n\t\treturn errors.New(\"empty ModuleName.Owner\")\n\t}\n\tif protoModuleName.GetRepository() == \"\" {\n\t\treturn errors.New(\"empty ModuleName.Repository\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufimage/well_known_type_image_file_info.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufimage\n\nimport (\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/google/uuid\"\n)\n\ntype wellKnownTypeImageFileInfo struct {\n\tstorage.ObjectInfo\n\timports  []string\n\tisImport bool\n}\n\nfunc newWellKnownTypeImageFileInfo(\n\tobjectInfo storage.ObjectInfo,\n\timports []string,\n\tisImport bool,\n) *wellKnownTypeImageFileInfo {\n\treturn &wellKnownTypeImageFileInfo{\n\t\tObjectInfo: objectInfo,\n\t\timports:    imports,\n\t\tisImport:   isImport,\n\t}\n}\n\nfunc (p *wellKnownTypeImageFileInfo) FullName() bufparse.FullName {\n\treturn nil\n}\n\nfunc (p *wellKnownTypeImageFileInfo) CommitID() uuid.UUID {\n\treturn uuid.Nil\n}\n\nfunc (p *wellKnownTypeImageFileInfo) Imports() ([]string, error) {\n\treturn p.imports, nil\n}\n\nfunc (p *wellKnownTypeImageFileInfo) IsImport() bool {\n\treturn p.isImport\n}\n\nfunc (*wellKnownTypeImageFileInfo) isImageFileInfo() {}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/added_module.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\n// addedModule represents a Module that was added in moduleSetBuilder.\n//\n// It either represents a local Module, or a remote Module.\n//\n// This is needed because when we add a remote Module, we make\n// a call out to the API to get the ModuleData by ModuleKey. However, if we are in\n// a situation where we have a v1 workspace with named modules, but those modules\n// do not actually exist in the BSR, and only in the workspace, AND we have a buf.lock\n// that represents those modules, we don't want to actually do the work to retrieve\n// the Module from the BSR, as in the end, the local Module in the workspace will win out\n// when get deduplicated.\n//\n// Even if this weren't the case, we don't want to make unnecessary BSR calls. So, instead of\n// making the call, we store the information that we will need to deduplicate, and once we've\n// filtered out the modules we don't need, we actually create the remote Module. At this point,\n// any modules that were both local (in the workspace) and remote (via a buf.lock) will have the\n// buf.lock-added Modules filtered out, and no BSR call will be made.\ntype addedModule struct {\n\tlocalModule              Module\n\tremoteModuleKey          ModuleKey\n\tremoteTargetPaths        []string\n\tremoteTargetExcludePaths []string\n\tisTarget                 bool\n}\n\nfunc newLocalAddedModule(\n\tlocalModule Module,\n\tisTarget bool,\n) *addedModule {\n\treturn &addedModule{\n\t\tlocalModule: localModule,\n\t\tisTarget:    isTarget,\n\t}\n}\n\nfunc newRemoteAddedModule(\n\tremoteModuleKey ModuleKey,\n\tremoteTargetPaths []string,\n\tremoteTargetExcludePaths []string,\n\tisTarget bool,\n) *addedModule {\n\treturn &addedModule{\n\t\tremoteModuleKey:          remoteModuleKey,\n\t\tremoteTargetPaths:        remoteTargetPaths,\n\t\tremoteTargetExcludePaths: remoteTargetExcludePaths,\n\t\tisTarget:                 isTarget,\n\t}\n}\n\n// IsLocal returns true if the addedModule is a local Module.\nfunc (a *addedModule) IsLocal() bool {\n\treturn a.localModule != nil\n}\n\n// IsTarget returns true if the addedModule was targeted.\nfunc (a *addedModule) IsTarget() bool {\n\treturn a.isTarget\n}\n\n// OpaqueID returns the OpaqueID of the addedModule.\nfunc (a *addedModule) OpaqueID() string {\n\tif a.remoteModuleKey != nil {\n\t\treturn a.remoteModuleKey.FullName().String()\n\t}\n\treturn a.localModule.OpaqueID()\n}\n\n// ToModule converts the addedModule to a Module.\n//\n// If the addedModule is a local Module, this is just returned.\n// If the addedModule is a remote Module, the ModuleDataProvider and CommitProvider are queried to get the Module.\nfunc (a *addedModule) ToModule(\n\tctx context.Context,\n\tmoduleDataProvider ModuleDataProvider,\n\tcommitProvider CommitProvider,\n) (Module, error) {\n\t// If the addedModule is a local Module, just return it.\n\tif a.localModule != nil {\n\t\treturn a.localModule, nil\n\t}\n\t// Else, get the remote Module.\n\tgetModuleData := sync.OnceValues(\n\t\tfunc() (ModuleData, error) {\n\t\t\tmoduleDatas, err := moduleDataProvider.GetModuleDatasForModuleKeys(\n\t\t\t\tctx,\n\t\t\t\t[]ModuleKey{a.remoteModuleKey},\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"could not get module data for remote module %q: %w\", a.remoteModuleKey.FullName().String(), err)\n\t\t\t}\n\t\t\tif len(moduleDatas) != 1 {\n\t\t\t\treturn nil, syserror.Newf(\"expected 1 ModuleData, got %d\", len(moduleDatas))\n\t\t\t}\n\t\t\tmoduleData := moduleDatas[0]\n\t\t\tif moduleData.ModuleKey().FullName() == nil {\n\t\t\t\treturn nil, syserror.New(\"got nil FullName for a ModuleKey returned from a ModuleDataProvider\")\n\t\t\t}\n\t\t\tif a.remoteModuleKey.FullName().String() != moduleData.ModuleKey().FullName().String() {\n\t\t\t\treturn nil, syserror.Newf(\n\t\t\t\t\t\"mismatched FullName from ModuleDataProvider: input %q, output %q\",\n\t\t\t\t\ta.remoteModuleKey.FullName().String(),\n\t\t\t\t\tmoduleData.ModuleKey().FullName().String(),\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn moduleData, nil\n\t\t},\n\t)\n\tgetBucket := sync.OnceValues(\n\t\tfunc() (storage.ReadBucket, error) {\n\t\t\tmoduleData, err := getModuleData()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// ModuleData.Bucket has sync.OnceValues and getStorageMatchers applied since it can\n\t\t\t// only be constructed via NewModuleData.\n\t\t\t//\n\t\t\t// TODO FUTURE: This is a bit shady.\n\t\t\treturn moduleData.Bucket()\n\t\t},\n\t)\n\tgetV1BufYAMLObjectData := func() (ObjectData, error) {\n\t\tmoduleData, err := getModuleData()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn moduleData.V1Beta1OrV1BufYAMLObjectData()\n\t}\n\tgetV1BufLockObjectData := func() (ObjectData, error) {\n\t\tmoduleData, err := getModuleData()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn moduleData.V1Beta1OrV1BufLockObjectData()\n\t}\n\t// getDepModuleKeysB5 gets the dependencies for the specific Module.\n\t//\n\t// This is needed to calculate the digest for the Module. A Module constructed from this\n\t// ModuleData as the target will require all Modules referenced by its DepModuleKeys to\n\t// be present in the ModuleSet.\n\t//\n\t// Modules that depend on this remote Module will include this Module and its data.\n\t// However all the dependencies of the remote Module may not be present in the parents ModuleSet.\n\t// As the target Module will use its direct dependencies to resolve the dependencies required.\n\t// The digest of the remote Module is however, unchanged. It is calculated based on the contents\n\t// and its dependencies, not the dependencies of the parent ModuleSet.\n\t//\n\t// In contrast, a local Module dependency can be thought of as a ModuleKey at the latest commit.\n\t// It will always use the bucket and dependencies, which may be resolved recursively for\n\t// dependencies on other local Modules, to calculate its digest.\n\t// This is the difference between the ModuleData digest calculation and the Module\n\t// digest calculation. As remote Modules are required to have all their dependencies as\n\t// ModuleKeys, they can calculate their digest directly from the contents and dependencies,\n\t// without needing to recursively resolve the digest as local Modules do.\n\t//\n\t// For example, consider the following modules at commits with their dependencies:\n\t// ```\n\t// X:C1\t\t\t(X has no dependencies)\n\t// A:C1 -> X:C1\t\t(A depends on X)\n\t// B:C1 -> A:C1 ~> X:C1 (B depends on A, transitive dependency on X)\n\t// A:C2\t\t\t(A removes the dependency on X)\n\t// C:C1 -> A:C2, B:C1\t(C depends on A and B, X is not a dependency)\n\t// ```\n\t// The ModuleSet for C:C1 will include B:C1 and A:C2, but not A:C1 or X:C1.\n\t// This is because for C:C1 it will use the direct dependencies to resolve its dependencies.\n\t// A is required by both B:C1 and C:C1, the latest A:C2 is chosen.\n\t//\n\t// The ModuleSet for B:C1 will include A:C1 and X:C1.\n\t// When calculating the digest for B:C1 in the ModuleSet of C:C1, the ModuleSet\n\t// ModuleDeps cannot be used to resolve the dependencies of B:C1. It must use\n\t// the dependencies of B:C1, which are A:C1 and X:C1, not A:C2.\n\t//\n\t// This is used for digest calculations. It is not used otherwise.\n\tgetDepModuleKeysB5 := func() ([]ModuleKey, error) {\n\t\tmoduleData, err := getModuleData()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdepModuleKeys, err := moduleData.DepModuleKeys()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(depModuleKeys) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\t\tvar digestType DigestType\n\t\tfor i, moduleKey := range depModuleKeys {\n\t\t\tdigest, err := moduleKey.Digest()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif i == 0 {\n\t\t\t\tdigestType = digest.Type()\n\t\t\t} else if digestType != digest.Type() {\n\t\t\t\treturn nil, syserror.Newf(\"multiple digest types found in DepModuleKeys: %v, %v\", digestType, digest.Type())\n\t\t\t}\n\t\t}\n\t\tswitch digestType {\n\t\tcase DigestTypeB4:\n\t\t\t// The ModuleKey dependencies for a commit may be stored in v1 buf.lock file,\n\t\t\t// in which case they will use B4 digests. B4 digests aren't allowed to be used as\n\t\t\t// input to the B5 digest calculation, so we perform a call to convert all ModuleKeys\n\t\t\t// from B4 to B5 by using the commit provider.\n\t\t\tcommitKeysToFetch := make([]CommitKey, len(depModuleKeys))\n\t\t\tfor i, depModuleKey := range depModuleKeys {\n\t\t\t\tcommitKey, err := NewCommitKey(depModuleKey.FullName().Registry(), depModuleKey.CommitID(), DigestTypeB5)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tcommitKeysToFetch[i] = commitKey\n\t\t\t}\n\t\t\tcommits, err := commitProvider.GetCommitsForCommitKeys(ctx, commitKeysToFetch)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(commits) != len(commitKeysToFetch) {\n\t\t\t\treturn nil, syserror.Newf(\"expected %d commit(s), got %d\", commitKeysToFetch, len(commits))\n\t\t\t}\n\t\t\treturn xslices.Map(commits, func(commit Commit) ModuleKey {\n\t\t\t\treturn commit.ModuleKey()\n\t\t\t}), nil\n\t\tcase DigestTypeB5:\n\t\t\t// No need to fetch b5 digests - we've already got them stored in the module's dependencies.\n\t\t\treturn depModuleKeys, nil\n\t\tdefault:\n\t\t\treturn nil, syserror.Newf(\"unsupported digest type: %v\", digestType)\n\t\t}\n\t}\n\treturn newModule(\n\t\tctx,\n\t\tgetBucket,\n\t\t\"\",\n\t\t\"\",\n\t\ta.remoteModuleKey.FullName(),\n\t\ta.remoteModuleKey.CommitID(),\n\t\ta.isTarget,\n\t\tfalse,\n\t\tgetV1BufYAMLObjectData,\n\t\tgetV1BufLockObjectData,\n\t\tgetDepModuleKeysB5,\n\t\ta.remoteTargetPaths,\n\t\ta.remoteTargetExcludePaths,\n\t\t\"\",\n\t\tfalse,\n\t)\n}\n\n// getUniqueSortedModulesByOpaqueID deduplicates and sorts the addedModule list.\n//\n// Modules that are targets are preferred, followed by Modules that are local.\n// Otherwise, remote Modules with later create times are preferred.\n//\n// Duplication determined based opaqueID, that is if a Module has an equal\n// opaqueID, it is considered a duplicate.\n//\n// We want to account for Modules with the same name but different digests, that is a dep in a workspace\n// that has the same name as something in a buf.lock file, we prefer the local dep in the workspace.\n//\n// When returned, all modules have unique opaqueIDs and Digests.\n//\n// Note: Modules with the same FullName will automatically have the same commit and Digest after this,\n// as there will be exactly one Module with a given FullName, given that an OpaqueID will be equal\n// for Modules with equal FullNames.\nfunc getUniqueSortedAddedModulesByOpaqueID(\n\tctx context.Context,\n\tcommitProvider CommitProvider,\n\taddedModules []*addedModule,\n) ([]*addedModule, error) {\n\topaqueIDToAddedModules := xslices.ToValuesMap(addedModules, (*addedModule).OpaqueID)\n\tresultAddedModules := make([]*addedModule, 0, len(opaqueIDToAddedModules))\n\tfor _, addedModulesForOpaqueID := range opaqueIDToAddedModules {\n\t\tresultAddedModule, err := selectAddedModuleForOpaqueID(ctx, commitProvider, addedModulesForOpaqueID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tresultAddedModules = append(resultAddedModules, resultAddedModule)\n\t}\n\tsort.Slice(\n\t\tresultAddedModules,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn resultAddedModules[i].OpaqueID() < resultAddedModules[j].OpaqueID()\n\t\t},\n\t)\n\treturn resultAddedModules, nil\n}\n\n// selectAddedModuleForOpaqueID selects the single addedModule that should be used for a list\n// of addedModules that all have the same OpaqueID.\n//\n// Note from earlier, not deleting:\n//\n// Digest *cannot* be used here - it's a chicken or egg problem. Computing the digest requires the cache,\n// the cache requires the unique Modules, the unique Modules require this function. This is OK though -\n// we want to add all Modules that we *think* are unique to the cache. If there is a duplicate, it\n// will be detected via cache usage.\nfunc selectAddedModuleForOpaqueID(\n\tctx context.Context,\n\tcommitProvider CommitProvider,\n\taddedModules []*addedModule,\n) (*addedModule, error) {\n\t// First, we see if there are any target Modules. If so, we prefer those.\n\ttargetAddedModules := xslices.Filter(addedModules, (*addedModule).IsTarget)\n\tswitch len(targetAddedModules) {\n\tcase 0:\n\t\t// We have no target Modules. We will select a non-target Module via\n\t\t// selectAddedModuleForOpaqueIDIgnoreTargeting\n\t\treturn selectAddedModuleForOpaqueIDIgnoreTargeting(ctx, commitProvider, addedModules)\n\tcase 1:\n\t\t// We have one target Module. Use this Module.\n\t\treturn targetAddedModules[0], nil\n\tdefault:\n\t\t// We have multiple target Modules. We will select one of them, but go to the next step\n\t\t// within selectAddedModuleForOpaqueIDIgnoreTargeting.\n\t\treturn selectAddedModuleForOpaqueIDIgnoreTargeting(ctx, commitProvider, targetAddedModules)\n\t}\n}\n\n// selectAddedModuleForOpaqueIDIgnoreTargeting is a child function of selectAddedModuleForOpaqueID\n// that assumes targeting has already been taken into account.\n//\n// This function will just take into account local vs remote, and then resolution between\n// remote Modules.\nfunc selectAddedModuleForOpaqueIDIgnoreTargeting(\n\tctx context.Context,\n\tcommitProvider CommitProvider,\n\taddedModules []*addedModule,\n) (*addedModule, error) {\n\t// Now, we see if there are any local Modules. If so, we prefer those\n\tlocalAddedModules := xslices.Filter(addedModules, (*addedModule).IsLocal)\n\tswitch len(localAddedModules) {\n\tcase 0:\n\t\t// We have no local Modules. We will select a remote Module.\n\t\treturn selectRemoteAddedModuleForOpaqueIDIgnoreTargeting(ctx, commitProvider, addedModules)\n\tdefault:\n\t\t// We have one or more added Modules. We just return the first one - we have\n\t\t// no way to differentiate between local Modules. Note that this will result\n\t\t// in the first Module added with AddLocalModule to be used, given that we\n\t\t// have not messed with ordering.\n\t\treturn localAddedModules[0], nil\n\t}\n}\n\n// selectRemoteAddedModuleForOpaqueIDIgnoreTargeting is a child function of\n// selectAddedModuleForOpaqueIDIgnoreTargeting that assumes targeting and local vs remote\n// has already been taken into account.\n//\n// All addedModules are assumed to have the same OpaqueID, and therefore the same\n// FullName, since they are remote Modules. We validate this.\n//\n// Note that there may be straight duplicates, ie two modules with the same FullName and CommitID! This\n// function deduplicates these.\n//\n// The ModuleKey with the latest create time is used.\nfunc selectRemoteAddedModuleForOpaqueIDIgnoreTargeting(\n\tctx context.Context,\n\tcommitProvider CommitProvider,\n\taddedModules []*addedModule,\n) (*addedModule, error) {\n\tif len(addedModules) == 0 {\n\t\treturn nil, syserror.New(\"expected at least one remote addedModule in selectRemoteAddedModuleForOpaqueIDIgnoreTargeting\")\n\t}\n\tfor _, addedModule := range addedModules {\n\t\t// Just a sanity check.\n\t\tif addedModule.remoteModuleKey == nil {\n\t\t\treturn nil, syserror.Newf(\"got nil remoteModuleKey in selectRemoteAddedModuleForOpaqueIDIgnoreTargeting for addedModule %q\", addedModule.OpaqueID())\n\t\t}\n\t}\n\tif len(addedModules) == 1 {\n\t\treturn addedModules[0], nil\n\t}\n\tif moduleFullNameStrings := xslices.ToUniqueSorted(\n\t\txslices.Map(\n\t\t\taddedModules,\n\t\t\tfunc(addedModule *addedModule) string { return addedModule.remoteModuleKey.FullName().String() },\n\t\t),\n\t); len(moduleFullNameStrings) > 1 {\n\t\treturn nil, syserror.Newf(\"multiple FullNames detected in selectRemoteAddedModuleForOpaqueIDIgnoreTargeting: %s\", strings.Join(moduleFullNameStrings, \", \"))\n\t}\n\n\t// We now know that we have >1 addedModules, and all of them have a remoteModuleKey, and all the remoteModuleKeys have the same FullName.\n\n\t// Now, we deduplicate by commit ID. If we end up with a single Module, we return that, otherwise we select exactly one Module\n\t// based on the create time of the corresponding commit ID.\n\tcommitIDToAddedModules := xslices.ToValuesMap(\n\t\taddedModules,\n\t\tfunc(addedModule *addedModule) uuid.UUID { return addedModule.remoteModuleKey.CommitID() },\n\t)\n\tuniqueAddedModules := make([]*addedModule, 0, len(commitIDToAddedModules))\n\tfor _, addedModules := range commitIDToAddedModules {\n\t\tuniqueAddedModules = append(uniqueAddedModules, addedModules[0])\n\t}\n\tif len(uniqueAddedModules) == 1 {\n\t\treturn uniqueAddedModules[0], nil\n\t}\n\n\t// We now know that we have non-unique remote added Modules, and have selected exactly one addedModule per commit ID.\n\n\tuniqueModuleKeys := xslices.Map(\n\t\tuniqueAddedModules,\n\t\tfunc(addedModule *addedModule) ModuleKey {\n\t\t\treturn addedModule.remoteModuleKey\n\t\t},\n\t)\n\t// Returned commits are in same order as input ModuleKeys\n\tcommits, err := commitProvider.GetCommitsForModuleKeys(ctx, uniqueModuleKeys)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not resolve modules from buf.lock: %w\", err)\n\t}\n\tcreateTime, err := commits[0].CreateTime()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tuniqueAddedModule := uniqueAddedModules[0]\n\t// i+1 is index inside moduleKeys and addedModules.\n\t//\n\t// Find the commit with the latest CreateTime, this is the addedModule you want to return.\n\tfor i, commit := range commits[1:] {\n\t\tiCreateTime, err := commit.CreateTime()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif iCreateTime.After(createTime) {\n\t\t\tuniqueAddedModule = uniqueAddedModules[i+1]\n\t\t\tcreateTime = iCreateTime\n\t\t}\n\t}\n\treturn uniqueAddedModule, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodule.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodule_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule_test\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/dag/dagtest\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestBasic(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\t// This represents some external dependencies from the BSR.\n\tbsrProvider, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/extdep1\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"extdep1.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package extdep1;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/extdep2\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"extdep2.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package extdep2; import \"extdep1.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/extdep3\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"extdep3.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package extdep3; import \"extdep4.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\t// This module is only a transitive remote dependency. It is only depended on by extdep3.\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/extdep4\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"extdep4.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package extdep4;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\t// Adding in a module that exists remotely but we'll also have in the workspace.\n\t\t//\n\t\t// This one will import from extdep2 instead of the workspace importing from extdep1.\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/bar/module2\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"module2.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package module2; import \"extdep2.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\n\t// This is the ModuleSetBuilder that will build the modules that we are going to test.\n\t// This is replicating how a workspace would be built from remote dependencies and\n\t// local sources.\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, slogtestext.NewLogger(t), bsrProvider, bsrProvider)\n\n\t// First, we add the remote dependences (adding order doesn't matter).\n\t//\n\t// Remember, the bsrProvider is just acting like a BSR; if we actually want to\n\t// say dependencies are part of our workspace, we need to add them! We do so now.\n\tmoduleRefExtdep1, err := bufparse.NewRef(\"buf.build\", \"foo\", \"extdep1\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefExtdep2, err := bufparse.NewRef(\"buf.build\", \"foo\", \"extdep2\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefExtdep3, err := bufparse.NewRef(\"buf.build\", \"foo\", \"extdep3\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefExtdep4, err := bufparse.NewRef(\"buf.build\", \"foo\", \"extdep4\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefModule2, err := bufparse.NewRef(\"buf.build\", \"bar\", \"module2\", \"\")\n\trequire.NoError(t, err)\n\tmoduleKeys, err := bsrProvider.GetModuleKeysForModuleRefs(\n\t\tctx,\n\t\t[]bufparse.Ref{\n\t\t\tmoduleRefExtdep1,\n\t\t\tmoduleRefExtdep2,\n\t\t\tmoduleRefExtdep3,\n\t\t\tmoduleRefExtdep4,\n\t\t\tmoduleRefModule2,\n\t\t},\n\t\tbufmodule.DigestTypeB5,\n\t)\n\trequire.NoError(t, err)\n\tfor _, moduleKey := range moduleKeys {\n\t\tmoduleSetBuilder.AddRemoteModule(moduleKey, false)\n\t}\n\n\t// Next, we add the local sources.\n\n\t// This module has no name but is part of the workspace.\n\tmoduleSetBuilder.AddLocalModule(\n\t\ttestNewBucketForPathToData(\n\t\t\tt,\n\t\t\tmap[string][]byte{\n\t\t\t\t\"module1.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package module1; import \"extdep2.proto\"; import \"google/protobuf/timestamp.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t),\n\t\t\"path/to/module1\",\n\t\ttrue,\n\t)\n\n\t// This module has a name and is part of the workspace.\n\t//\n\t// This module is also in the BSR, but we'll prefer the local sources when\n\t// we do ModuleSetBuilder.Build().\n\tmoduleFullName, err := bufparse.NewFullName(\"buf.build\", \"bar\", \"module2\")\n\trequire.NoError(t, err)\n\tmoduleSetBuilder.AddLocalModule(\n\t\ttestNewBucketForPathToData(\n\t\t\tt,\n\t\t\tmap[string][]byte{\n\t\t\t\t\"module2.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package module2; import \"module1.proto\"; import \"extdep1.proto\";`,\n\t\t\t\t),\n\t\t\t\t// module2 is excluded by path, but imports a Module that is not imported anywhere\n\t\t\t\t// else. We want to make sure this path is not targeted, but extdep3 is still\n\t\t\t\t// a dependency of the Module.\n\t\t\t\t\"foo/module2_excluded.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package module2; import \"extdep3.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t),\n\t\t\"path/to/module2\",\n\t\ttrue,\n\t\tbufmodule.LocalModuleWithFullName(moduleFullName),\n\t\t// We're going to exclude the files in the foo directory from targeting,\n\t\t// ie foo/module2_excluded.proto. This file will still be in the module,\n\t\t// but will not be marked as a target.\n\t\tbufmodule.LocalModuleWithTargetPaths(nil, []string{\"foo\"}),\n\t)\n\n\t// Build our module set!\n\tmoduleSet, err := moduleSetBuilder.Build()\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/bar/module2\",\n\t\t\t\"buf.build/foo/extdep1\",\n\t\t\t\"buf.build/foo/extdep2\",\n\t\t\t\"buf.build/foo/extdep3\",\n\t\t\t\"buf.build/foo/extdep4\",\n\t\t\t\"path/to/module1\",\n\t\t},\n\t\tbufmodule.ModuleSetOpaqueIDs(moduleSet),\n\t)\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/bar/module2\",\n\t\t\t\"path/to/module1\",\n\t\t},\n\t\tbufmodule.ModuleSetTargetOpaqueIDs(moduleSet),\n\t)\n\n\tmodule2 := moduleSet.GetModuleForOpaqueID(\"buf.build/bar/module2\")\n\trequire.NotNil(t, module2)\n\t// module2 depends on all these modules transitively. extdep1,\n\t// extdep3, and module1 are direct.\n\trequire.Equal(\n\t\tt,\n\t\tmap[string]bool{\n\t\t\t\"buf.build/foo/extdep1\": true,\n\t\t\t\"buf.build/foo/extdep2\": false,\n\t\t\t\"buf.build/foo/extdep3\": true,\n\t\t\t\"buf.build/foo/extdep4\": false,\n\t\t\t\"path/to/module1\":       true,\n\t\t},\n\t\ttestGetDepOpaqueIDToDirect(t, module2),\n\t)\n\t// These are the files in the in the module.\n\ttestFilePaths(\n\t\tt,\n\t\tmodule2,\n\t\t\"foo/module2_excluded.proto\",\n\t\t\"module2.proto\",\n\t)\n\t// These are the target files. We excluded foo, so we only have module2.proto.\n\ttestTargetFilePaths(\n\t\tt,\n\t\tmodule2,\n\t\t\"module2.proto\",\n\t)\n\t//module2ProtoFileInfo, err := module2.StatFileInfo(ctx, \"module2.proto\")\n\t//require.NoError(t, err)\n\t//imports, err := module2ProtoFileInfo.protoFileImports()\n\t//require.NoError(t, err)\n\t//require.Equal(t, []string{\"extdep1.proto\", \"module1.proto\"}, imports)\n\t//pkg, err := module2ProtoFileInfo.protoFilePackage()\n\t//require.NoError(t, err)\n\t//require.Equal(t, \"module2\", pkg)\n\n\textdep1 := moduleSet.GetModuleForOpaqueID(\"buf.build/foo/extdep1\")\n\trequire.NotNil(t, extdep1)\n\n\textdep2 := moduleSet.GetModuleForOpaqueID(\"buf.build/foo/extdep2\")\n\trequire.NotNil(t, extdep2)\n\trequire.Equal(\n\t\tt,\n\t\tmap[string]bool{\n\t\t\t\"buf.build/foo/extdep1\": true,\n\t\t},\n\t\ttestGetDepOpaqueIDToDirect(t, extdep2),\n\t)\n\textdep2Deps, err := extdep2.ModuleDeps()\n\trequire.NoError(t, err)\n\trequire.Equal(t, 1, len(extdep2Deps))\n\trequire.Equal(t, \"buf.build/foo/extdep1\", extdep2Deps[0].OpaqueID())\n\trequire.Equal(t, extdep2.OpaqueID(), extdep2Deps[0].Parent().OpaqueID())\n\n\tmodule1 := moduleSet.GetModuleForOpaqueID(\"path/to/module1\")\n\trequire.NotNil(t, extdep2)\n\trequire.Equal(\n\t\tt,\n\t\tmap[string]bool{\n\t\t\t\"buf.build/foo/extdep2\": true,\n\t\t\t\"buf.build/foo/extdep1\": false,\n\t\t},\n\t\ttestGetDepOpaqueIDToDirect(t, module1),\n\t)\n\tmodule1Deps, err := module1.ModuleDeps()\n\trequire.NoError(t, err)\n\trequire.Equal(t, 2, len(module1Deps))\n\trequire.Equal(t, \"buf.build/foo/extdep1\", module1Deps[0].OpaqueID())\n\trequire.Equal(t, extdep2.OpaqueID(), module1Deps[0].Parent().OpaqueID())\n\trequire.Equal(t, \"buf.build/foo/extdep2\", module1Deps[1].OpaqueID())\n\trequire.Equal(t, module1.OpaqueID(), module1Deps[1].Parent().OpaqueID())\n\n\t// This is a graph of OpaqueIDs. This tests that we have the full dependency tree\n\t// that we expect.\n\tgraph, err := bufmodule.ModuleSetToDAG(moduleSet)\n\trequire.NoError(t, err)\n\tdagtest.RequireGraphEqual(\n\t\tt,\n\t\t[]dagtest.ExpectedNode[string]{\n\t\t\t{\n\t\t\t\tKey: \"buf.build/bar/module2\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.build/foo/extdep1\",\n\t\t\t\t\t\"buf.build/foo/extdep3\",\n\t\t\t\t\t\"path/to/module1\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"buf.build/foo/extdep1\",\n\t\t\t\tOutbound: []string{},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.build/foo/extdep3\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.build/foo/extdep4\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"buf.build/foo/extdep4\",\n\t\t\t\tOutbound: []string{},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"path/to/module1\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.build/foo/extdep2\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.build/foo/extdep2\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.build/foo/extdep1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tgraph,\n\t\tbufmodule.Module.OpaqueID,\n\t)\n\tgraphRemoteOnly, err := bufmodule.ModuleSetToDAG(moduleSet, bufmodule.ModuleSetToDAGWithRemoteOnly())\n\trequire.NoError(t, err)\n\tdagtest.RequireGraphEqual(\n\t\tt,\n\t\t[]dagtest.ExpectedNode[string]{\n\t\t\t{\n\t\t\t\tKey:      \"buf.build/foo/extdep1\",\n\t\t\t\tOutbound: []string{},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.build/foo/extdep3\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.build/foo/extdep4\",\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"buf.build/foo/extdep4\",\n\t\t\t\tOutbound: []string{},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"buf.build/foo/extdep2\",\n\t\t\t\tOutbound: []string{\n\t\t\t\t\t\"buf.build/foo/extdep1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tgraphRemoteOnly,\n\t\tbufmodule.Module.OpaqueID,\n\t)\n\tremoteDeps, err := bufmodule.RemoteDepsForModuleSet(moduleSet)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/extdep1\",\n\t\t\t\"buf.build/foo/extdep2\",\n\t\t\t\"buf.build/foo/extdep3\",\n\t\t\t\"buf.build/foo/extdep4\",\n\t\t},\n\t\txslices.Map(remoteDeps, func(remoteDep bufmodule.RemoteDep) string { return remoteDep.OpaqueID() }),\n\t)\n\ttransitiveRemoteDeps := xslices.Filter(remoteDeps, func(remoteDep bufmodule.RemoteDep) bool { return !remoteDep.IsDirect() })\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/extdep4\",\n\t\t},\n\t\txslices.Map(transitiveRemoteDeps, func(remoteDep bufmodule.RemoteDep) string { return remoteDep.OpaqueID() }),\n\t)\n}\n\nfunc TestModuleCycleError(t *testing.T) {\n\tt.Parallel()\n\n\tmoduleSet, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/a\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"a.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package a; import \"b.proto\";`,\n\t\t\t\t),\n\t\t\t\t\"a1.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package a;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/b\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"b.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package b; import \"c.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/c\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"c.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package b; import \"a1.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\n\tmoduleA := moduleSet.GetModuleForOpaqueID(\"buf.build/foo/a\")\n\trequire.NotNil(t, moduleA)\n\t_, err = moduleA.ModuleDeps()\n\trequire.Error(t, err)\n\tmoduleCycleError := &bufmodule.ModuleCycleError{}\n\trequire.True(t, errors.As(err, &moduleCycleError), err.Error())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/a\",\n\t\t\t\"buf.build/foo/b\",\n\t\t\t\"buf.build/foo/c\",\n\t\t\t\"buf.build/foo/a\",\n\t\t},\n\t\tmoduleCycleError.Descriptions,\n\t)\n\n\tmoduleB := moduleSet.GetModuleForOpaqueID(\"buf.build/foo/b\")\n\trequire.NotNil(t, moduleB)\n\t_, err = moduleB.ModuleDeps()\n\trequire.Error(t, err)\n\tmoduleCycleError = &bufmodule.ModuleCycleError{}\n\trequire.True(t, errors.As(err, &moduleCycleError), err.Error())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/b\",\n\t\t\t\"buf.build/foo/c\",\n\t\t\t\"buf.build/foo/a\",\n\t\t\t\"buf.build/foo/b\",\n\t\t},\n\t\tmoduleCycleError.Descriptions,\n\t)\n\n\tmoduleC := moduleSet.GetModuleForOpaqueID(\"buf.build/foo/c\")\n\trequire.NotNil(t, moduleC)\n\t_, err = moduleC.ModuleDeps()\n\trequire.Error(t, err)\n\tmoduleCycleError = &bufmodule.ModuleCycleError{}\n\trequire.True(t, errors.As(err, &moduleCycleError), err.Error())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/c\",\n\t\t\t\"buf.build/foo/a\",\n\t\t\t\"buf.build/foo/b\",\n\t\t\t\"buf.build/foo/c\",\n\t\t},\n\t\tmoduleCycleError.Descriptions,\n\t)\n}\n\nfunc TestDuplicateProtoPathError(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\tmoduleSet, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/a\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"a.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package a; import \"b.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/b\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"a.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package b;`,\n\t\t\t\t),\n\t\t\t\t\"b.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package b;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\n\tmoduleA := moduleSet.GetModuleForOpaqueID(\"buf.build/foo/a\")\n\trequire.NotNil(t, moduleA)\n\n\tcheckError := func(err error) {\n\t\trequire.Error(t, err)\n\t\tduplicateProtoPathError := &bufmodule.DuplicateProtoPathError{}\n\t\trequire.True(t, errors.As(err, &duplicateProtoPathError), err.Error())\n\t\trequire.Equal(\n\t\t\tt,\n\t\t\t\"a.proto\",\n\t\t\tduplicateProtoPathError.ProtoPath,\n\t\t)\n\t\trequire.Equal(\n\t\t\tt,\n\t\t\t[]string{\n\t\t\t\t\"buf.build/foo/a\",\n\t\t\t\t\"buf.build/foo/b\",\n\t\t\t},\n\t\t\tduplicateProtoPathError.ModuleDescriptions,\n\t\t)\n\t}\n\t_, err = moduleA.ModuleDeps()\n\tcheckError(err)\n\tmoduleReadBucket := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet)\n\t_, err = moduleReadBucket.StatFileInfo(ctx, \"a.proto\")\n\tcheckError(err)\n\terr = moduleReadBucket.WalkFileInfos(ctx, func(bufmodule.FileInfo) error { return nil })\n\tcheckError(err)\n}\n\nfunc TestNoProtoFilesError(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\tmoduleSet, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/a\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"a.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package a;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/b\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"LICENSE\": []byte(\n\t\t\t\t\t\"fake license\",\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\n\tmoduleA := moduleSet.GetModuleForOpaqueID(\"buf.build/foo/a\")\n\trequire.NotNil(t, moduleA)\n\n\tcheckError := func(err error) {\n\t\trequire.Error(t, err)\n\t\tnoProtoFilesError := &bufmodule.NoProtoFilesError{}\n\t\trequire.True(t, errors.As(err, &noProtoFilesError), err.Error())\n\t\trequire.Contains(\n\t\t\tt,\n\t\t\t\"buf.build/foo/b\",\n\t\t\tnoProtoFilesError.ModuleDescription,\n\t\t)\n\t}\n\tmoduleReadBucket := bufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet)\n\terr = moduleReadBucket.WalkFileInfos(ctx, func(bufmodule.FileInfo) error { return nil })\n\tcheckError(err)\n}\n\nfunc TestProtoFileTargetPath(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\tbucket := testNewBucketForPathToData(\n\t\tt,\n\t\tmap[string][]byte{\n\t\t\t\"a/1.proto\": []byte(\n\t\t\t\t`syntax = proto3; package a;`,\n\t\t\t),\n\t\t\t\"a/2.proto\": []byte(\n\t\t\t\t`syntax = proto3; package a;`,\n\t\t\t),\n\t\t\t\"also_a/1.proto\": []byte(\n\t\t\t\t`syntax = proto3; package a;`,\n\t\t\t),\n\t\t\t\"b/1.proto\": []byte(\n\t\t\t\t`syntax = proto3; package b;`,\n\t\t\t),\n\t\t\t\"b/2.proto\": []byte(\n\t\t\t\t`syntax = proto3; package b;`,\n\t\t\t),\n\t\t},\n\t)\n\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, slogtestext.NewLogger(t), bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\tmoduleSetBuilder.AddLocalModule(bucket, \"module1\", true)\n\tmoduleSet, err := moduleSetBuilder.Build()\n\trequire.NoError(t, err)\n\tmodule1 := moduleSet.GetModuleForOpaqueID(\"module1\")\n\trequire.NotNil(t, module1)\n\ttestFilePaths(\n\t\tt,\n\t\tmodule1,\n\t\t\"a/1.proto\",\n\t\t\"a/2.proto\",\n\t\t\"also_a/1.proto\",\n\t\t\"b/1.proto\",\n\t\t\"b/2.proto\",\n\t)\n\ttestTargetFilePaths(\n\t\tt,\n\t\tmodule1,\n\t\t\"a/1.proto\",\n\t\t\"a/2.proto\",\n\t\t\"also_a/1.proto\",\n\t\t\"b/1.proto\",\n\t\t\"b/2.proto\",\n\t)\n\n\t// The single file a/1.proto\n\tmoduleSetBuilder = bufmodule.NewModuleSetBuilder(ctx, slogtestext.NewLogger(t), bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\tmoduleSetBuilder.AddLocalModule(\n\t\tbucket,\n\t\t\"module1\",\n\t\ttrue,\n\t\tbufmodule.LocalModuleWithProtoFileTargetPath(\n\t\t\t\"a/1.proto\",\n\t\t\tfalse,\n\t\t),\n\t)\n\tmoduleSet, err = moduleSetBuilder.Build()\n\trequire.NoError(t, err)\n\tmodule1 = moduleSet.GetModuleForOpaqueID(\"module1\")\n\trequire.NotNil(t, module1)\n\ttestFilePaths(\n\t\tt,\n\t\tmodule1,\n\t\t\"a/1.proto\",\n\t\t\"a/2.proto\",\n\t\t\"also_a/1.proto\",\n\t\t\"b/1.proto\",\n\t\t\"b/2.proto\",\n\t)\n\ttestTargetFilePaths(\n\t\tt,\n\t\tmodule1,\n\t\t\"a/1.proto\",\n\t)\n\n\t// The single file a/1.proto with package files\n\tmoduleSetBuilder = bufmodule.NewModuleSetBuilder(ctx, slogtestext.NewLogger(t), bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\tmoduleSetBuilder.AddLocalModule(\n\t\tbucket,\n\t\t\"module1\",\n\t\ttrue,\n\t\tbufmodule.LocalModuleWithProtoFileTargetPath(\n\t\t\t\"a/1.proto\",\n\t\t\ttrue,\n\t\t),\n\t)\n\tmoduleSet, err = moduleSetBuilder.Build()\n\trequire.NoError(t, err)\n\tmodule1 = moduleSet.GetModuleForOpaqueID(\"module1\")\n\trequire.NotNil(t, module1)\n\ttestFilePaths(\n\t\tt,\n\t\tmodule1,\n\t\t\"a/1.proto\",\n\t\t\"a/2.proto\",\n\t\t\"also_a/1.proto\",\n\t\t\"b/1.proto\",\n\t\t\"b/2.proto\",\n\t)\n\ttestTargetFilePaths(\n\t\tt,\n\t\tmodule1,\n\t\t\"a/1.proto\",\n\t\t\"a/2.proto\",\n\t\t\"also_a/1.proto\",\n\t)\n}\n\nfunc testNewBucketForPathToData(t *testing.T, pathToData map[string][]byte) storage.ReadBucket {\n\tbucket, err := storagemem.NewReadBucket(pathToData)\n\trequire.NoError(t, err)\n\treturn bucket\n}\n\nfunc testGetDepOpaqueIDToDirect(t *testing.T, module bufmodule.Module) map[string]bool {\n\tmoduleDeps, err := module.ModuleDeps()\n\trequire.NoError(t, err)\n\tdepOpaqueIDToDirect := make(map[string]bool)\n\tfor _, moduleDep := range moduleDeps {\n\t\tdepOpaqueIDToDirect[moduleDep.OpaqueID()] = moduleDep.IsDirect()\n\t}\n\treturn depOpaqueIDToDirect\n}\n\nfunc testFilePaths(t *testing.T, module bufmodule.Module, expectedFilePaths ...string) {\n\tctx := t.Context()\n\tfileInfos, err := bufmodule.GetFileInfos(ctx, module)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\texpectedFilePaths,\n\t\tbufmodule.FileInfoPaths(fileInfos),\n\t)\n}\n\nfunc testTargetFilePaths(t *testing.T, module bufmodule.Module, expectedFilePaths ...string) {\n\tctx := t.Context()\n\tfileInfos, err := bufmodule.GetTargetFileInfos(ctx, module)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\texpectedFilePaths,\n\t\tbufmodule.FileInfoPaths(fileInfos),\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/bufmoduleapi.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/cmd/buf-legacyfederation-go-data/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/hex\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/pkg/shake256\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tprogramName = \"buf-legacyfederation-go-data\"\n\tpkgFlagName = \"package\"\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\tflags := newFlags()\n\tbuilder := appext.NewBuilder(\n\t\tprogramName,\n\t\tappext.BuilderWithLoggerProvider(slogapp.LoggerProvider),\n\t)\n\treturn &appcmd.Command{\n\t\tUse:   programName,\n\t\tShort: \"Send a newline-separated file via stdin\",\n\t\tArgs:  appcmd.NoArgs,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tPkg string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Pkg,\n\t\tpkgFlagName,\n\t\t\"\",\n\t\t\"The name of the generated package.\",\n\t)\n}\n\nfunc run(ctx context.Context, container appext.Container, flags *flags) error {\n\tif flags.Pkg == \"\" {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s is required\", pkgFlagName)\n\t}\n\tdata, err := io.ReadAll(container.Stdin())\n\tif err != nil {\n\t\treturn err\n\t}\n\thexEncodedDigests, err := getSortedHexEncodedDigests(data)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgolangFileData, err := getGolangFileData(\n\t\tflags.Pkg,\n\t\thexEncodedDigests,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = container.Stdout().Write(golangFileData)\n\treturn err\n}\n\nfunc getSortedHexEncodedDigests(data []byte) ([]string, error) {\n\tlines := make(map[string]struct{})\n\tfor line := range strings.SplitSeq(string(data), \"\\n\") {\n\t\tline = strings.TrimSpace(line)\n\t\tif line != \"\" {\n\t\t\tlines[line] = struct{}{}\n\t\t}\n\t}\n\thexEncodedDigests := make([]string, 0, len(lines))\n\tfor line := range lines {\n\t\tdigest, err := shake256.NewDigestForContent(strings.NewReader(line))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\thexEncodedDigests = append(hexEncodedDigests, hex.EncodeToString(digest.Value()))\n\t}\n\tsort.Strings(hexEncodedDigests)\n\treturn hexEncodedDigests, nil\n}\n\nfunc getGolangFileData(\n\tpackageName string,\n\thexEncodedDigests []string,\n) ([]byte, error) {\n\tbuffer := bytes.NewBuffer(nil)\n\tp := func(s string) {\n\t\t_, _ = buffer.WriteString(s)\n\t}\n\n\tp(`// Code generated by `)\n\tp(programName)\n\tp(`. DO NOT EDIT.`)\n\tp(\"\\n\\n\")\n\tp(`package `)\n\tp(packageName)\n\tp(\"\\n\\n\")\n\tp(`import (\n\t\"encoding/hex\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/shake256\"\n)`)\n\tp(\"\\n\\n\")\n\tp(`var (`)\n\tp(\"\\n\")\n\tp(`// hostnameHexEncodedDigests are the shake256 digests of the hostnames that are allowed to use legacy federation.\n\thostnameHexEncodedDigests = map[string]struct{}{`)\n\tp(\"\\n\")\n\tfor _, hexEncodedDigest := range hexEncodedDigests {\n\t\tp(`\"`)\n\t\tp(hexEncodedDigest)\n\t\tp(`\": {},`)\n\t\tp(\"\\n\")\n\t}\n\tp(`}`)\n\tp(`)`)\n\tp(\"\\n\\n\")\n\tp(`// Exists returns true if the hostname is allowed to use legacy federation.\nfunc Exists(hostname string) (bool, error) {\n\tif hostname == \"\" {\n\t\treturn false, nil\n\t}\n\tdigest, err := shake256.NewDigestForContent(strings.NewReader(hostname))\n\tif err != nil {\n\t\treturn false, err\n\t}\n\thexEncodedDigest := hex.EncodeToString(digest.Value())\n\t_, ok := hostnameHexEncodedDigests[hexEncodedDigest]\n\treturn ok, nil\n}`)\n\tformatted, err := format.Source(buffer.Bytes())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not format: %w\\n%s\", err, buffer.String())\n\t}\n\treturn formatted, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/cmd/buf-legacyfederation-go-data/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/commit_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\t\"time\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// NewCommitProvider returns a new CommitProvider for the given API client.\nfunc NewCommitProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n\townerClientProvider bufregistryapiowner.V1OwnerServiceClientProvider,\n) bufmodule.CommitProvider {\n\treturn newCommitProvider(logger, moduleClientProvider, ownerClientProvider)\n}\n\n// *** PRIVATE ***\n\ntype commitProvider struct {\n\tlogger               *slog.Logger\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t}\n\townerClientProvider bufregistryapiowner.V1OwnerServiceClientProvider\n}\n\nfunc newCommitProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n\townerClientProvider bufregistryapiowner.V1OwnerServiceClientProvider,\n) *commitProvider {\n\treturn &commitProvider{\n\t\tlogger:               logger,\n\t\tmoduleClientProvider: moduleClientProvider,\n\t\townerClientProvider:  ownerClientProvider,\n\t}\n}\n\nfunc (a *commitProvider) GetCommitsForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.Commit, error) {\n\tif len(moduleKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tdigestType, err := bufmodule.UniqueDigestTypeForModuleKeys(moduleKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tregistryToIndexedModuleKeys := xslices.ToIndexedValuesMap(\n\t\tmoduleKeys,\n\t\tfunc(moduleKey bufmodule.ModuleKey) string {\n\t\t\treturn moduleKey.FullName().Registry()\n\t\t},\n\t)\n\tindexedCommits := make([]xslices.Indexed[bufmodule.Commit], 0, len(moduleKeys))\n\tfor registry, indexedModuleKeys := range registryToIndexedModuleKeys {\n\t\tregistryIndexedCommits, err := a.getIndexedCommitsForRegistryAndIndexedModuleKeys(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedModuleKeys,\n\t\t\tdigestType,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedCommits = append(indexedCommits, registryIndexedCommits...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedCommits), nil\n}\n\nfunc (a *commitProvider) GetCommitsForCommitKeys(\n\tctx context.Context,\n\tcommitKeys []bufmodule.CommitKey,\n) ([]bufmodule.Commit, error) {\n\tif len(commitKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tdigestType, err := bufmodule.UniqueDigestTypeForCommitKeys(commitKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// We don't want to persist these across calls - this could grow over time and this cache\n\t// isn't an LRU cache, and the information also may change over time.\n\tv1ProtoModuleProvider := newV1ProtoModuleProvider(a.logger, a.moduleClientProvider)\n\tv1ProtoOwnerProvider := newV1ProtoOwnerProvider(a.logger, a.ownerClientProvider)\n\n\tregistryToIndexedCommitKeys := xslices.ToIndexedValuesMap(\n\t\tcommitKeys,\n\t\tfunc(commitKey bufmodule.CommitKey) string {\n\t\t\treturn commitKey.Registry()\n\t\t},\n\t)\n\tindexedCommits := make([]xslices.Indexed[bufmodule.Commit], 0, len(commitKeys))\n\tfor registry, indexedCommitKeys := range registryToIndexedCommitKeys {\n\t\tregistryIndexedCommits, err := a.getIndexedCommitsForRegistryAndIndexedCommitKeys(\n\t\t\tctx,\n\t\t\tv1ProtoModuleProvider,\n\t\t\tv1ProtoOwnerProvider,\n\t\t\tregistry,\n\t\t\tindexedCommitKeys,\n\t\t\tdigestType,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedCommits = append(indexedCommits, registryIndexedCommits...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedCommits), nil\n}\n\nfunc (a *commitProvider) getIndexedCommitsForRegistryAndIndexedModuleKeys(\n\tctx context.Context,\n\tregistry string,\n\tindexedModuleKeys []xslices.Indexed[bufmodule.ModuleKey],\n\tdigestType bufmodule.DigestType,\n) ([]xslices.Indexed[bufmodule.Commit], error) {\n\tcommitIDToIndexedModuleKey, err := xslices.ToUniqueValuesMapError(\n\t\tindexedModuleKeys,\n\t\tfunc(indexedModuleKey xslices.Indexed[bufmodule.ModuleKey]) (uuid.UUID, error) {\n\t\t\treturn indexedModuleKey.Value.CommitID(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitIDs := xslices.MapKeysToSlice(commitIDToIndexedModuleKey)\n\tuniversalProtoCommits, err := getUniversalProtoCommitsForRegistryAndCommitIDs(ctx, a.moduleClientProvider, registry, commitIDs, digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.MapError(\n\t\tuniversalProtoCommits,\n\t\tfunc(universalProtoCommit *universalProtoCommit) (xslices.Indexed[bufmodule.Commit], error) {\n\t\t\tcommitID, err := uuidutil.FromDashless(universalProtoCommit.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn xslices.Indexed[bufmodule.Commit]{}, err\n\t\t\t}\n\t\t\tindexedModuleKey, ok := commitIDToIndexedModuleKey[commitID]\n\t\t\tif !ok {\n\t\t\t\treturn xslices.Indexed[bufmodule.Commit]{}, syserror.Newf(\"no ModuleKey for proto commit ID %q\", commitID)\n\t\t\t}\n\t\t\t// This is actually backwards - this is not the expected digest, this is the actual digest.\n\t\t\t// TODO FUTURE: It doesn't matter too much, but we should switch around CommitWithExpectedDigest\n\t\t\t// to be CommitWithActualDigest.\n\t\t\texpectedDigest := universalProtoCommit.Digest\n\t\t\treturn xslices.Indexed[bufmodule.Commit]{\n\t\t\t\tValue: bufmodule.NewCommit(\n\t\t\t\t\tindexedModuleKey.Value,\n\t\t\t\t\tfunc() (time.Time, error) {\n\t\t\t\t\t\treturn universalProtoCommit.CreateTime, nil\n\t\t\t\t\t},\n\t\t\t\t\tbufmodule.CommitWithExpectedDigest(expectedDigest),\n\t\t\t\t),\n\t\t\t\tIndex: indexedModuleKey.Index,\n\t\t\t}, nil\n\t\t},\n\t)\n}\n\nfunc (a *commitProvider) getIndexedCommitsForRegistryAndIndexedCommitKeys(\n\tctx context.Context,\n\tv1ProtoModuleProvider *v1ProtoModuleProvider,\n\tv1ProtoOwnerProvider *v1ProtoOwnerProvider,\n\tregistry string,\n\tindexedCommitKeys []xslices.Indexed[bufmodule.CommitKey],\n\tdigestType bufmodule.DigestType,\n) ([]xslices.Indexed[bufmodule.Commit], error) {\n\tcommitIDToIndexedCommitKey, err := xslices.ToUniqueValuesMapError(\n\t\tindexedCommitKeys,\n\t\tfunc(indexedCommitKey xslices.Indexed[bufmodule.CommitKey]) (uuid.UUID, error) {\n\t\t\treturn indexedCommitKey.Value.CommitID(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitIDs := xslices.MapKeysToSlice(commitIDToIndexedCommitKey)\n\tuniversalProtoCommits, err := getUniversalProtoCommitsForRegistryAndCommitIDs(ctx, a.moduleClientProvider, registry, commitIDs, digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.MapError(\n\t\tuniversalProtoCommits,\n\t\tfunc(universalProtoCommit *universalProtoCommit) (xslices.Indexed[bufmodule.Commit], error) {\n\t\t\tcommitID, err := uuidutil.FromDashless(universalProtoCommit.ID)\n\t\t\tif err != nil {\n\t\t\t\treturn xslices.Indexed[bufmodule.Commit]{}, err\n\t\t\t}\n\t\t\tindexedCommitKey, ok := commitIDToIndexedCommitKey[commitID]\n\t\t\tif !ok {\n\t\t\t\treturn xslices.Indexed[bufmodule.Commit]{}, syserror.Newf(\"no CommitKey for proto commit ID %q\", commitID)\n\t\t\t}\n\t\t\tmoduleKey, err := getModuleKeyForUniversalProtoCommit(\n\t\t\t\tctx,\n\t\t\t\tv1ProtoModuleProvider,\n\t\t\t\tv1ProtoOwnerProvider,\n\t\t\t\tregistry,\n\t\t\t\tuniversalProtoCommit,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn xslices.Indexed[bufmodule.Commit]{}, err\n\t\t\t}\n\t\t\treturn xslices.Indexed[bufmodule.Commit]{\n\t\t\t\t// No digest to compare against to add as CommitOption.\n\t\t\t\tValue: bufmodule.NewCommit(\n\t\t\t\t\tmoduleKey,\n\t\t\t\t\tfunc() (time.Time, error) {\n\t\t\t\t\t\treturn universalProtoCommit.CreateTime, nil\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\tIndex: indexedCommitKey.Index,\n\t\t\t}, nil\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/convert.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\tmodulev1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\nvar (\n\tdigestTypeToV1ProtoDigestType = map[bufmodule.DigestType]modulev1.DigestType{\n\t\tbufmodule.DigestTypeB5: modulev1.DigestType_DIGEST_TYPE_B5,\n\t}\n\tv1ProtoDigestTypeToDigestType = map[modulev1.DigestType]bufmodule.DigestType{\n\t\tmodulev1.DigestType_DIGEST_TYPE_B5: bufmodule.DigestTypeB5,\n\t}\n\tdigestTypeToV1Beta1ProtoDigestType = map[bufmodule.DigestType]modulev1beta1.DigestType{\n\t\tbufmodule.DigestTypeB4: modulev1beta1.DigestType_DIGEST_TYPE_B4,\n\t\tbufmodule.DigestTypeB5: modulev1beta1.DigestType_DIGEST_TYPE_B5,\n\t}\n\tv1beta1ProtoDigestTypeToDigestType = map[modulev1beta1.DigestType]bufmodule.DigestType{\n\t\tmodulev1beta1.DigestType_DIGEST_TYPE_B4: bufmodule.DigestTypeB4,\n\t\tmodulev1beta1.DigestType_DIGEST_TYPE_B5: bufmodule.DigestTypeB5,\n\t}\n\tv1ProtoDigestTypeToV1Beta1ProtoDigestType = map[modulev1.DigestType]modulev1beta1.DigestType{\n\t\tmodulev1.DigestType_DIGEST_TYPE_B5: modulev1beta1.DigestType_DIGEST_TYPE_B5,\n\t}\n)\n\n// DigestToV1Proto converts the given Digest to a proto Digest.\nfunc DigestToV1Proto(digest bufmodule.Digest) (*modulev1.Digest, error) {\n\tprotoDigestType, err := digestTypeToV1Proto(digest.Type())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &modulev1.Digest{\n\t\tType:  protoDigestType,\n\t\tValue: digest.Value(),\n\t}, nil\n}\n\n// V1ProtoToDigest converts the given proto Digest to a Digest.\n//\n// Validation is performed to ensure the DigestType is known, and the value\n// is a valid digest value for the given DigestType.\nfunc V1ProtoToDigest(protoDigest *modulev1.Digest) (bufmodule.Digest, error) {\n\tdigestType, err := v1ProtoToDigestType(protoDigest.Type)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcasDigest, err := cas.NewDigest(protoDigest.Value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmodule.NewDigest(digestType, casDigest)\n}\n\n// DigestToV1Beta1Proto converts the given Digest to a proto Digest.\nfunc DigestToV1Beta1Proto(digest bufmodule.Digest) (*modulev1beta1.Digest, error) {\n\tprotoDigestType, err := digestTypeToV1Beta1Proto(digest.Type())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &modulev1beta1.Digest{\n\t\tType:  protoDigestType,\n\t\tValue: digest.Value(),\n\t}, nil\n}\n\n// V1Beta1ProtoToDigest converts the given proto Digest to a Digest.\n//\n// Validation is performed to ensure the DigestType is known, and the value\n// is a valid digest value for the given DigestType.\nfunc V1Beta1ProtoToDigest(protoDigest *modulev1beta1.Digest) (bufmodule.Digest, error) {\n\tdigestType, err := v1beta1ProtoToDigestType(protoDigest.Type)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcasDigest, err := cas.NewDigest(protoDigest.Value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmodule.NewDigest(digestType, casDigest)\n}\n\n// *** PRIVATE ***\n\nfunc moduleVisibilityToV1Proto(moduleVisibility bufmodule.ModuleVisibility) (modulev1.ModuleVisibility, error) {\n\tswitch moduleVisibility {\n\tcase bufmodule.ModuleVisibilityPublic:\n\t\treturn modulev1.ModuleVisibility_MODULE_VISIBILITY_PUBLIC, nil\n\tcase bufmodule.ModuleVisibilityPrivate:\n\t\treturn modulev1.ModuleVisibility_MODULE_VISIBILITY_PRIVATE, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown ModuleVisibility: %v\", moduleVisibility)\n\t}\n}\n\nfunc digestTypeToV1Proto(digestType bufmodule.DigestType) (modulev1.DigestType, error) {\n\tprotoDigestType, ok := digestTypeToV1ProtoDigestType[digestType]\n\t// Technically we have already done this validation but just to be safe.\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown DigestType: %v\", digestType)\n\t}\n\treturn protoDigestType, nil\n}\n\nfunc v1ProtoToDigestType(protoDigestType modulev1.DigestType) (bufmodule.DigestType, error) {\n\tdigestType, ok := v1ProtoDigestTypeToDigestType[protoDigestType]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown modulev1.DigestType: %v\", protoDigestType)\n\t}\n\treturn digestType, nil\n}\n\nfunc digestTypeToV1Beta1Proto(digestType bufmodule.DigestType) (modulev1beta1.DigestType, error) {\n\tprotoDigestType, ok := digestTypeToV1Beta1ProtoDigestType[digestType]\n\t// Technically we have already done this validation but just to be safe.\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown DigestType: %v\", digestType)\n\t}\n\treturn protoDigestType, nil\n}\n\nfunc v1beta1ProtoToDigestType(protoDigestType modulev1beta1.DigestType) (bufmodule.DigestType, error) {\n\tdigestType, ok := v1beta1ProtoDigestTypeToDigestType[protoDigestType]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown modulev1beta1.DigestType: %v\", protoDigestType)\n\t}\n\treturn digestType, nil\n}\n\n// It is assumed that the bucket is already filtered to just module files.\nfunc bucketToV1Beta1ProtoFiles(ctx context.Context, bucket storage.ReadBucket) ([]*modulev1beta1.File, error) {\n\tvar protoFiles []*modulev1beta1.File\n\tif err := storage.WalkReadObjects(\n\t\tctx,\n\t\tbucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdata, err := io.ReadAll(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tprotoFiles = append(\n\t\t\t\tprotoFiles,\n\t\t\t\t&modulev1beta1.File{\n\t\t\t\t\tPath:    readObject.Path(),\n\t\t\t\t\tContent: data,\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn protoFiles, nil\n}\n\nfunc labelNameToV1Beta1ProtoScopedLabelRef(labelName string) *modulev1beta1.ScopedLabelRef {\n\treturn &modulev1beta1.ScopedLabelRef{\n\t\tValue: &modulev1beta1.ScopedLabelRef_Name{\n\t\t\tName: labelName,\n\t\t},\n\t}\n}\n\nfunc commitIDToV1ProtoResourceRef(commitID uuid.UUID) *modulev1.ResourceRef {\n\treturn &modulev1.ResourceRef{\n\t\tValue: &modulev1.ResourceRef_Id{\n\t\t\tId: uuidutil.ToDashless(commitID),\n\t\t},\n\t}\n}\n\nfunc commitIDsToV1ProtoResourceRefs(commitIDs []uuid.UUID) []*modulev1.ResourceRef {\n\treturn xslices.Map(commitIDs, commitIDToV1ProtoResourceRef)\n}\n\nfunc commitIDToV1Beta1ProtoResourceRef(commitID uuid.UUID) *modulev1beta1.ResourceRef {\n\treturn &modulev1beta1.ResourceRef{\n\t\tValue: &modulev1beta1.ResourceRef_Id{\n\t\t\tId: uuidutil.ToDashless(commitID),\n\t\t},\n\t}\n}\n\nfunc commitIDsToV1Beta1ProtoResourceRefs(commitIDs []uuid.UUID) []*modulev1beta1.ResourceRef {\n\treturn xslices.Map(commitIDs, commitIDToV1Beta1ProtoResourceRef)\n}\n\nfunc moduleRefToV1ProtoResourceRef(moduleRef bufparse.Ref) *modulev1.ResourceRef {\n\treturn &modulev1.ResourceRef{\n\t\tValue: &modulev1.ResourceRef_Name_{\n\t\t\tName: &modulev1.ResourceRef_Name{\n\t\t\t\tOwner:  moduleRef.FullName().Owner(),\n\t\t\t\tModule: moduleRef.FullName().Name(),\n\t\t\t\tChild: &modulev1.ResourceRef_Name_Ref{\n\t\t\t\t\tRef: moduleRef.Ref(),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n\nfunc moduleRefsToV1ProtoResourceRefs(moduleRefs []bufparse.Ref) []*modulev1.ResourceRef {\n\treturn xslices.Map(moduleRefs, moduleRefToV1ProtoResourceRef)\n}\n\nfunc moduleRefToV1Beta1ProtoResourceRef(moduleRef bufparse.Ref) *modulev1beta1.ResourceRef {\n\treturn &modulev1beta1.ResourceRef{\n\t\tValue: &modulev1beta1.ResourceRef_Name_{\n\t\t\tName: &modulev1beta1.ResourceRef_Name{\n\t\t\t\tOwner:  moduleRef.FullName().Owner(),\n\t\t\t\tModule: moduleRef.FullName().Name(),\n\t\t\t\tChild: &modulev1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\tRef: moduleRef.Ref(),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n\nfunc moduleRefsToV1Beta1ProtoResourceRefs(moduleRefs []bufparse.Ref) []*modulev1beta1.ResourceRef {\n\treturn xslices.Map(moduleRefs, moduleRefToV1Beta1ProtoResourceRef)\n}\n\nfunc moduleKeyToV1ProtoResourceRef(moduleKey bufmodule.ModuleKey) *modulev1.ResourceRef {\n\treturn &modulev1.ResourceRef{\n\t\tValue: &modulev1.ResourceRef_Name_{\n\t\t\tName: &modulev1.ResourceRef_Name{\n\t\t\t\tOwner:  moduleKey.FullName().Owner(),\n\t\t\t\tModule: moduleKey.FullName().Name(),\n\t\t\t\tChild: &modulev1.ResourceRef_Name_Ref{\n\t\t\t\t\tRef: uuidutil.ToDashless(moduleKey.CommitID()),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n\nfunc moduleKeysToV1ProtoResourceRefs(moduleKeys []bufmodule.ModuleKey) []*modulev1.ResourceRef {\n\treturn xslices.Map(moduleKeys, moduleKeyToV1ProtoResourceRef)\n}\n\nfunc moduleKeyToV1Beta1ProtoGetGraphRequestResourceRef(moduleKey bufmodule.ModuleKey) *modulev1beta1.GetGraphRequest_ResourceRef {\n\treturn &modulev1beta1.GetGraphRequest_ResourceRef{\n\t\tResourceRef: &modulev1beta1.ResourceRef{\n\t\t\tValue: &modulev1beta1.ResourceRef_Name_{\n\t\t\t\tName: &modulev1beta1.ResourceRef_Name{\n\t\t\t\t\tOwner:  moduleKey.FullName().Owner(),\n\t\t\t\t\tModule: moduleKey.FullName().Name(),\n\t\t\t\t\tChild: &modulev1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\tRef: uuidutil.ToDashless(moduleKey.CommitID()),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tRegistry: moduleKey.FullName().Registry(),\n\t}\n}\n\nfunc moduleKeysToV1Beta1ProtoGetGraphRequestResourceRefs(moduleKeys []bufmodule.ModuleKey) []*modulev1beta1.GetGraphRequest_ResourceRef {\n\treturn xslices.Map(moduleKeys, moduleKeyToV1Beta1ProtoGetGraphRequestResourceRef)\n}\n\n// We have to make sure all the below is updated if a field is added.\n// This is enforced via exhaustruct using golangci-lint.\n// Search .golangci.yml for convert.go to see where this is enabled.\n\nfunc v1ProtoDigestToV1Beta1ProtoDigest(\n\tv1ProtoDigest *modulev1.Digest,\n) (*modulev1beta1.Digest, error) {\n\tif v1ProtoDigest == nil {\n\t\treturn nil, nil\n\t}\n\tv1beta1ProtoDigestType, ok := v1ProtoDigestTypeToV1Beta1ProtoDigestType[v1ProtoDigest.Type]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"unknown modulev1.DigestType: %v\", v1ProtoDigest.Type)\n\t}\n\treturn &modulev1beta1.Digest{\n\t\tType:  v1beta1ProtoDigestType,\n\t\tValue: v1ProtoDigest.Value,\n\t}, nil\n}\n\nfunc v1ProtoCommitToV1Beta1ProtoCommit(\n\tv1ProtoCommit *modulev1.Commit,\n) (*modulev1beta1.Commit, error) {\n\tif v1ProtoCommit == nil {\n\t\treturn nil, nil\n\t}\n\tv1beta1ProtoDigest, err := v1ProtoDigestToV1Beta1ProtoDigest(v1ProtoCommit.Digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &modulev1beta1.Commit{\n\t\tId:               v1ProtoCommit.Id,\n\t\tCreateTime:       v1ProtoCommit.CreateTime,\n\t\tOwnerId:          v1ProtoCommit.OwnerId,\n\t\tModuleId:         v1ProtoCommit.ModuleId,\n\t\tDigest:           v1beta1ProtoDigest,\n\t\tCreatedByUserId:  v1ProtoCommit.CreatedByUserId,\n\t\tSourceControlUrl: v1ProtoCommit.SourceControlUrl,\n\t}, nil\n}\n\nfunc v1ProtoGraphToV1Beta1ProtoGraph(\n\tregistry string,\n\tv1ProtoGraph *modulev1.Graph,\n) (*modulev1beta1.Graph, error) {\n\tif v1ProtoGraph == nil {\n\t\treturn nil, nil\n\t}\n\tv1beta1ProtoGraph := &modulev1beta1.Graph{\n\t\tCommits: make([]*modulev1beta1.Graph_Commit, len(v1ProtoGraph.Commits)),\n\t\tEdges:   make([]*modulev1beta1.Graph_Edge, len(v1ProtoGraph.Edges)),\n\t}\n\tfor i, v1ProtoCommit := range v1ProtoGraph.Commits {\n\t\tv1beta1ProtoCommit, err := v1ProtoCommitToV1Beta1ProtoCommit(v1ProtoCommit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tv1beta1ProtoGraph.Commits[i] = &modulev1beta1.Graph_Commit{\n\t\t\tCommit:   v1beta1ProtoCommit,\n\t\t\tRegistry: registry,\n\t\t}\n\t}\n\tfor i, v1ProtoEdge := range v1ProtoGraph.Edges {\n\t\tv1beta1ProtoGraph.Edges[i] = &modulev1beta1.Graph_Edge{\n\t\t\tFromNode: &modulev1beta1.Graph_Node{\n\t\t\t\tCommitId: v1ProtoEdge.FromNode.CommitId,\n\t\t\t\tRegistry: registry,\n\t\t\t},\n\t\t\tToNode: &modulev1beta1.Graph_Node{\n\t\t\t\tCommitId: v1ProtoEdge.ToNode.CommitId,\n\t\t\t\tRegistry: registry,\n\t\t\t},\n\t\t}\n\t}\n\treturn v1beta1ProtoGraph, nil\n}\n\nfunc v1beta1ProtoModuleRefToV1ProtoModuleRef(\n\tv1beta1ProtoModuleRef *modulev1beta1.ModuleRef,\n) *modulev1.ModuleRef {\n\tif v1beta1ProtoModuleRef == nil {\n\t\treturn nil\n\t}\n\tif id := v1beta1ProtoModuleRef.GetId(); id != \"\" {\n\t\treturn &modulev1.ModuleRef{\n\t\t\tValue: &modulev1.ModuleRef_Id{\n\t\t\t\tId: id,\n\t\t\t},\n\t\t}\n\t}\n\tif name := v1beta1ProtoModuleRef.GetName(); name != nil {\n\t\treturn &modulev1.ModuleRef{\n\t\t\tValue: &modulev1.ModuleRef_Name_{\n\t\t\t\tName: &modulev1.ModuleRef_Name{\n\t\t\t\t\tOwner:  name.Owner,\n\t\t\t\t\tModule: name.Module,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc v1beta1ProtoFileToV1ProtoFile(\n\tv1beta1ProtoFile *modulev1beta1.File,\n) *modulev1.File {\n\tif v1beta1ProtoFile == nil {\n\t\treturn nil\n\t}\n\treturn &modulev1.File{\n\t\tPath:    v1beta1ProtoFile.Path,\n\t\tContent: v1beta1ProtoFile.Content,\n\t}\n}\n\nfunc v1beta1ProtoFilesToV1ProtoFiles(\n\tv1beta1ProtoFiles []*modulev1beta1.File,\n) []*modulev1.File {\n\treturn xslices.Map(v1beta1ProtoFiles, v1beta1ProtoFileToV1ProtoFile)\n}\n\nfunc v1beta1ProtoScopedLabelRefToV1ProtoScopedLabelRef(\n\tv1beta1ProtoScopedLabelRef *modulev1beta1.ScopedLabelRef,\n) *modulev1.ScopedLabelRef {\n\tif v1beta1ProtoScopedLabelRef == nil {\n\t\treturn nil\n\t}\n\tif id := v1beta1ProtoScopedLabelRef.GetId(); id != \"\" {\n\t\treturn &modulev1.ScopedLabelRef{\n\t\t\tValue: &modulev1.ScopedLabelRef_Id{\n\t\t\t\tId: id,\n\t\t\t},\n\t\t}\n\t}\n\tif name := v1beta1ProtoScopedLabelRef.GetName(); name != \"\" {\n\t\treturn &modulev1.ScopedLabelRef{\n\t\t\tValue: &modulev1.ScopedLabelRef_Name{\n\t\t\t\tName: name,\n\t\t\t},\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc v1beta1ProtoScopedLabelRefsToV1ProtoScopedLabelRefs(\n\tv1beta1ProtoScopedLabelRefs []*modulev1beta1.ScopedLabelRef,\n) []*modulev1.ScopedLabelRef {\n\treturn xslices.Map(v1beta1ProtoScopedLabelRefs, v1beta1ProtoScopedLabelRefToV1ProtoScopedLabelRef)\n}\n\nfunc v1beta1ProtoUploadRequestContentToV1ProtoUploadRequestContent(\n\tv1beta1ProtoUploadRequestContent *modulev1beta1.UploadRequest_Content,\n) *modulev1.UploadRequest_Content {\n\treturn &modulev1.UploadRequest_Content{\n\t\tModuleRef:        v1beta1ProtoModuleRefToV1ProtoModuleRef(v1beta1ProtoUploadRequestContent.ModuleRef),\n\t\tFiles:            v1beta1ProtoFilesToV1ProtoFiles(v1beta1ProtoUploadRequestContent.Files),\n\t\tScopedLabelRefs:  v1beta1ProtoScopedLabelRefsToV1ProtoScopedLabelRefs(v1beta1ProtoUploadRequestContent.ScopedLabelRefs),\n\t\tSourceControlUrl: v1beta1ProtoUploadRequestContent.SourceControlUrl,\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/digest_for_commit_id.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/google/uuid\"\n)\n\n// DigestForCommitID resolves the commit ID by calling the CommitService to get\n// the Digest for the Commit.\nfunc DigestForCommitID(\n\tctx context.Context,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n\tregistry string,\n\tcommitID uuid.UUID,\n\tdigestType bufmodule.DigestType,\n) (bufmodule.Digest, error) {\n\tuniversalProtoCommit, err := getUniversalProtoCommitForRegistryAndCommitID(ctx, moduleClientProvider, registry, commitID, digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn universalProtoCommit.Digest, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"errors\"\n\t\"io/fs\"\n\n\t\"connectrpc.com/connect\"\n)\n\n// notFoundError represents when a resource was not found.\n//\n// The underlying error will always be fs.ErrNotExist, to fulfill the bufmodule Provider contracts.\ntype notFoundError struct {\n\tmessage string\n}\n\n// Error implements error.\nfunc (n *notFoundError) Error() string {\n\tif n == nil {\n\t\treturn \"\"\n\t}\n\tif n.message == \"\" {\n\t\treturn \"not found\"\n\t}\n\treturn n.message\n}\n\n// Unwrap implements errors.Unwrap for Error.\n//\n// It always returns fs.ErrNotExist if n is not nil.\nfunc (n *notFoundError) Unwrap() error {\n\tif n == nil {\n\t\treturn nil\n\t}\n\treturn fs.ErrNotExist\n}\n\n// maybeNewNotFoundError will convert the error into a NotFoundError if it is a connect Error with code NotFound.\n//\n// It is assumed that the underlying connect Error contains a formatted error message including that the resource was not found.\nfunc maybeNewNotFoundError(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\tvar connectError *connect.Error\n\tif !errors.As(err, &connectError) {\n\t\treturn err\n\t}\n\tif connectError.Code() != connect.CodeNotFound {\n\t\treturn err\n\t}\n\treturn &notFoundError{\n\t\tmessage: connectError.Message(),\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/graph_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\tmodulev1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/pkg/dag\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// NewGraphProvider returns a new GraphProvider for the given API client.\nfunc NewGraphProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1GraphServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1GraphServiceClientProvider\n\t},\n\townerClientProvider bufregistryapiowner.V1OwnerServiceClientProvider,\n\toptions ...GraphProviderOption,\n) bufmodule.GraphProvider {\n\treturn newGraphProvider(logger, moduleClientProvider, ownerClientProvider, options...)\n}\n\n// GraphProviderOption is an option for a new GraphProvider.\ntype GraphProviderOption func(*graphProvider)\n\n// GraphProviderWithLegacyFederationRegistry returns a new GraphProviderOption that specifies\n// the hostname of an additional registry that is allowed to use legacy federation. This should\n// only be used in testing.\nfunc GraphProviderWithLegacyFederationRegistry(legacyFederationRegistry string) GraphProviderOption {\n\treturn func(graphProvider *graphProvider) {\n\t\tif legacyFederationRegistry != \"\" {\n\t\t\tgraphProvider.legacyFederationRegistry = legacyFederationRegistry\n\t\t}\n\t}\n}\n\n// GraphProviderWithPublicRegistry returns a new GraphProviderOption that specifies\n// the hostname of the public registry. By default this is \"buf.build\", however in testing,\n// this may be something else. This is needed to discern which which registry to make calls\n// against in the case where there is >1 registries represented in the ModuleKeys - we always\n// want to call the non-public registry.\nfunc GraphProviderWithPublicRegistry(publicRegistry string) GraphProviderOption {\n\treturn func(graphProvider *graphProvider) {\n\t\tif publicRegistry != \"\" {\n\t\t\tgraphProvider.publicRegistry = publicRegistry\n\t\t}\n\t}\n}\n\n// *** PRIVATE ***\n\ntype graphProvider struct {\n\tlogger               *slog.Logger\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1GraphServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1GraphServiceClientProvider\n\t}\n\townerClientProvider      bufregistryapiowner.V1OwnerServiceClientProvider\n\tlegacyFederationRegistry string\n\tpublicRegistry           string\n}\n\nfunc newGraphProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1GraphServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1GraphServiceClientProvider\n\t},\n\townerClientProvider bufregistryapiowner.V1OwnerServiceClientProvider,\n\toptions ...GraphProviderOption,\n) *graphProvider {\n\tgraphProvider := &graphProvider{\n\t\tlogger:               logger,\n\t\tmoduleClientProvider: moduleClientProvider,\n\t\townerClientProvider:  ownerClientProvider,\n\t\tpublicRegistry:       defaultPublicRegistry,\n\t}\n\tfor _, option := range options {\n\t\toption(graphProvider)\n\t}\n\treturn graphProvider\n}\n\nfunc (a *graphProvider) GetGraphForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) (*dag.Graph[bufmodule.RegistryCommitID, bufmodule.ModuleKey], error) {\n\tgraph := dag.NewGraph(bufmodule.ModuleKeyToRegistryCommitID)\n\tif len(moduleKeys) == 0 {\n\t\treturn graph, nil\n\t}\n\tdigestType, err := bufmodule.UniqueDigestTypeForModuleKeys(moduleKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// We don't want to persist these across calls - this could grow over time and this cache\n\t// isn't an LRU cache, and the information also may change over time.\n\tv1ProtoModuleProvider := newV1ProtoModuleProvider(a.logger, a.moduleClientProvider)\n\tv1ProtoOwnerProvider := newV1ProtoOwnerProvider(a.logger, a.ownerClientProvider)\n\tv1beta1ProtoGraph, err := a.getV1Beta1ProtoGraphForModuleKeys(ctx, moduleKeys, digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tregistryCommitIDToModuleKey, err := xslices.ToUniqueValuesMapError(\n\t\tmoduleKeys,\n\t\tfunc(moduleKey bufmodule.ModuleKey) (bufmodule.RegistryCommitID, error) {\n\t\t\treturn bufmodule.ModuleKeyToRegistryCommitID(moduleKey), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, v1beta1ProtoGraphCommit := range v1beta1ProtoGraph.Commits {\n\t\tv1beta1ProtoCommit := v1beta1ProtoGraphCommit.Commit\n\t\tregistry := v1beta1ProtoGraphCommit.Registry\n\t\tcommitID, err := uuidutil.FromDashless(v1beta1ProtoCommit.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryCommitID := bufmodule.NewRegistryCommitID(registry, commitID)\n\t\tmoduleKey, ok := registryCommitIDToModuleKey[registryCommitID]\n\t\tif !ok {\n\t\t\tuniversalProtoCommit, err := newUniversalProtoCommitForV1Beta1(v1beta1ProtoCommit)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// This may be a transitive dependency that we don't have. In this case,\n\t\t\t// go out to the API and get the transitive dependency.\n\t\t\tmoduleKey, err = getModuleKeyForUniversalProtoCommit(\n\t\t\t\tctx,\n\t\t\t\tv1ProtoModuleProvider,\n\t\t\t\tv1ProtoOwnerProvider,\n\t\t\t\tregistry,\n\t\t\t\tuniversalProtoCommit,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tregistryCommitIDToModuleKey[registryCommitID] = moduleKey\n\t\t}\n\t\tgraph.AddNode(moduleKey)\n\t}\n\tfor _, v1beta1ProtoEdge := range v1beta1ProtoGraph.Edges {\n\t\tfromRegistry := v1beta1ProtoEdge.FromNode.Registry\n\t\tfromCommitID, err := uuidutil.FromDashless(v1beta1ProtoEdge.FromNode.CommitId)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfromRegistryCommitID := bufmodule.NewRegistryCommitID(fromRegistry, fromCommitID)\n\t\tfromModuleKey, ok := registryCommitIDToModuleKey[fromRegistryCommitID]\n\t\tif !ok {\n\t\t\t// We should always have this after our previous iteration.\n\t\t\t// This could be an API error, but regardless we consider it a system error here.\n\t\t\treturn nil, syserror.Newf(\"did not have RegistryCommitID %v in registryCommitIDToModuleKey\", fromRegistryCommitID)\n\t\t}\n\t\ttoRegistry := v1beta1ProtoEdge.ToNode.Registry\n\t\ttoCommitID, err := uuidutil.FromDashless(v1beta1ProtoEdge.ToNode.CommitId)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ttoRegistryCommitID := bufmodule.NewRegistryCommitID(toRegistry, toCommitID)\n\t\ttoModuleKey, ok := registryCommitIDToModuleKey[toRegistryCommitID]\n\t\tif !ok {\n\t\t\t// We should always have this after our previous iteration.\n\t\t\t// This could be an API error, but regardless we consider it a system error here.\n\t\t\treturn nil, syserror.Newf(\"did not have RegistryCommitID %v in registryCommitIDToModuleKey\", toRegistryCommitID)\n\t\t}\n\t\tgraph.AddEdge(fromModuleKey, toModuleKey)\n\t}\n\treturn graph, nil\n}\n\nfunc (a *graphProvider) getV1Beta1ProtoGraphForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n\tdigestType bufmodule.DigestType,\n) (*modulev1beta1.Graph, error) {\n\tprimaryRegistry, legacyFederationAllowed, err := getPrimaryRegistryAndLegacyFederationAllowed(\n\t\tmoduleKeys,\n\t\ta.publicRegistry,\n\t\ta.legacyFederationRegistry,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !legacyFederationAllowed && digestType == bufmodule.DigestTypeB5 {\n\t\t// Legacy federation is not allowed, and we are using b5. Call the v1 API.\n\t\tgraph, err := a.getV1ProtoGraphForRegistryAndModuleKeys(ctx, primaryRegistry, moduleKeys)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn v1ProtoGraphToV1Beta1ProtoGraph(primaryRegistry, graph)\n\t}\n\n\t// Legacy federation is allowed, or we are using b4. We may have dependencies on modules from other registries, or we\n\t// are using a digest type not supported by the v1 API. Fall back to the v1beta1 API.\n\n\tv1beta1ProtoDigestType, err := digestTypeToV1Beta1Proto(digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := a.moduleClientProvider.V1Beta1GraphServiceClient(primaryRegistry).GetGraph(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1beta1.GetGraphRequest{\n\t\t\t\t// TODO FUTURE: chunking\n\t\t\t\tResourceRefs: moduleKeysToV1Beta1ProtoGetGraphRequestResourceRefs(moduleKeys),\n\t\t\t\tDigestType:   v1beta1ProtoDigestType,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, maybeNewNotFoundError(err)\n\t}\n\n\treturn response.Msg.Graph, nil\n}\n\nfunc (a *graphProvider) getV1ProtoGraphForRegistryAndModuleKeys(\n\tctx context.Context,\n\tregistry string,\n\tmoduleKeys []bufmodule.ModuleKey,\n) (*modulev1.Graph, error) {\n\tresponse, err := a.moduleClientProvider.V1GraphServiceClient(registry).GetGraph(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetGraphRequest{\n\t\t\t\t// TODO FUTURE: chunking\n\t\t\t\tResourceRefs: moduleKeysToV1ProtoResourceRefs(moduleKeys),\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, maybeNewNotFoundError(err)\n\t}\n\treturn response.Msg.Graph, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/module_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"sort\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// NewModuleDataProvider returns a new ModuleDataProvider for the given API client.\n//\n// A warning is printed to the logger if a given Module is deprecated.\nfunc NewModuleDataProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1DownloadServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1DownloadServiceClientProvider\n\t},\n\tgraphProvider bufmodule.GraphProvider,\n) bufmodule.ModuleDataProvider {\n\treturn newModuleDataProvider(logger, moduleClientProvider, graphProvider)\n}\n\n// *** PRIVATE ***\n\ntype moduleDataProvider struct {\n\tlogger               *slog.Logger\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1DownloadServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1DownloadServiceClientProvider\n\t}\n\tgraphProvider bufmodule.GraphProvider\n}\n\nfunc newModuleDataProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1DownloadServiceClientProvider\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1DownloadServiceClientProvider\n\t},\n\tgraphProvider bufmodule.GraphProvider,\n) *moduleDataProvider {\n\treturn &moduleDataProvider{\n\t\tlogger:               logger,\n\t\tmoduleClientProvider: moduleClientProvider,\n\t\tgraphProvider:        graphProvider,\n\t}\n}\n\nfunc (a *moduleDataProvider) GetModuleDatasForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.ModuleData, error) {\n\tif len(moduleKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tdigestType, err := bufmodule.UniqueDigestTypeForModuleKeys(moduleKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := bufparse.FullNameStringToUniqueValue(moduleKeys); err != nil {\n\t\treturn nil, err\n\t}\n\n\t// We don't want to persist this across calls - this could grow over time and this cache\n\t// isn't an LRU cache, and the information also may change over time.\n\tv1ProtoModuleProvider := newV1ProtoModuleProvider(a.logger, a.moduleClientProvider)\n\n\tregistryToIndexedModuleKeys := xslices.ToIndexedValuesMap(\n\t\tmoduleKeys,\n\t\tfunc(moduleKey bufmodule.ModuleKey) string {\n\t\t\treturn moduleKey.FullName().Registry()\n\t\t},\n\t)\n\tindexedModuleDatas := make([]xslices.Indexed[bufmodule.ModuleData], 0, len(moduleKeys))\n\tfor registry, indexedModuleKeys := range registryToIndexedModuleKeys {\n\t\t// registryModuleDatas are in the same order as indexedModuleKeys.\n\t\tindexedRegistryModuleDatas, err := a.getIndexedModuleDatasForRegistryAndIndexedModuleKeys(\n\t\t\tctx,\n\t\t\tv1ProtoModuleProvider,\n\t\t\tregistry,\n\t\t\tindexedModuleKeys,\n\t\t\tdigestType,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedModuleDatas = append(indexedModuleDatas, indexedRegistryModuleDatas...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedModuleDatas), nil\n}\n\n// Returns ModuleDatas in the same order as the input ModuleKeys\nfunc (a *moduleDataProvider) getIndexedModuleDatasForRegistryAndIndexedModuleKeys(\n\tctx context.Context,\n\tv1ProtoModuleProvider *v1ProtoModuleProvider,\n\tregistry string,\n\tindexedModuleKeys []xslices.Indexed[bufmodule.ModuleKey],\n\tdigestType bufmodule.DigestType,\n) ([]xslices.Indexed[bufmodule.ModuleData], error) {\n\tgraph, err := a.graphProvider.GetGraphForModuleKeys(ctx, xslices.IndexedToValues(indexedModuleKeys))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitIDToIndexedModuleKey, err := xslices.ToUniqueValuesMapError(\n\t\tindexedModuleKeys,\n\t\tfunc(indexedModuleKey xslices.Indexed[bufmodule.ModuleKey]) (uuid.UUID, error) {\n\t\t\treturn indexedModuleKey.Value.CommitID(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitIDToUniversalProtoContent, err := a.getCommitIDToUniversalProtoContentForRegistryAndIndexedModuleKeys(\n\t\tctx,\n\t\tv1ProtoModuleProvider,\n\t\tregistry,\n\t\tcommitIDToIndexedModuleKey,\n\t\tdigestType,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tindexedModuleDatas := make([]xslices.Indexed[bufmodule.ModuleData], 0, len(indexedModuleKeys))\n\tfor _, indexedModuleKey := range indexedModuleKeys {\n\t\tmoduleKey := indexedModuleKey.Value\n\t\t// TopoSort will get us both the direct and transitive dependencies for the key.\n\t\tdepModuleKeys, err := graph.TopoSort(bufmodule.ModuleKeyToRegistryCommitID(moduleKey))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Remove this moduleKey from the depModuleKeys.\n\t\tdepModuleKeys = depModuleKeys[:len(depModuleKeys)-1]\n\t\tsort.Slice(\n\t\t\tdepModuleKeys,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn depModuleKeys[i].FullName().String() < depModuleKeys[j].FullName().String()\n\t\t\t},\n\t\t)\n\n\t\tuniversalProtoContent, ok := commitIDToUniversalProtoContent[moduleKey.CommitID()]\n\t\tif !ok {\n\t\t\treturn nil, syserror.Newf(\"could not find universalProtoContent for commit ID %q\", moduleKey.CommitID())\n\t\t}\n\t\tindexedModuleData := xslices.Indexed[bufmodule.ModuleData]{\n\t\t\tValue: bufmodule.NewModuleData(\n\t\t\t\tctx,\n\t\t\t\tmoduleKey,\n\t\t\t\tfunc() (storage.ReadBucket, error) {\n\t\t\t\t\treturn universalProtoFilesToBucket(universalProtoContent.Files)\n\t\t\t\t},\n\t\t\t\tfunc() ([]bufmodule.ModuleKey, error) { return depModuleKeys, nil },\n\t\t\t\tfunc() (bufmodule.ObjectData, error) {\n\t\t\t\t\treturn universalProtoFileToObjectData(universalProtoContent.V1BufYAMLFile)\n\t\t\t\t},\n\t\t\t\tfunc() (bufmodule.ObjectData, error) {\n\t\t\t\t\treturn universalProtoFileToObjectData(universalProtoContent.V1BufLockFile)\n\t\t\t\t},\n\t\t\t),\n\t\t\tIndex: indexedModuleKey.Index,\n\t\t}\n\t\tindexedModuleDatas = append(indexedModuleDatas, indexedModuleData)\n\t}\n\treturn indexedModuleDatas, nil\n}\n\nfunc (a *moduleDataProvider) getCommitIDToUniversalProtoContentForRegistryAndIndexedModuleKeys(\n\tctx context.Context,\n\tv1ProtoModuleProvider *v1ProtoModuleProvider,\n\tregistry string,\n\tcommitIDToIndexedModuleKey map[uuid.UUID]xslices.Indexed[bufmodule.ModuleKey],\n\tdigestType bufmodule.DigestType,\n) (map[uuid.UUID]*universalProtoContent, error) {\n\tcommitIDs := xslices.MapKeysToSlice(commitIDToIndexedModuleKey)\n\tuniversalProtoContents, err := getUniversalProtoContentsForRegistryAndCommitIDs(\n\t\tctx,\n\t\ta.moduleClientProvider,\n\t\tregistry,\n\t\tcommitIDs,\n\t\tdigestType,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitIDToUniversalProtoContent, err := xslices.ToUniqueValuesMapError(\n\t\tuniversalProtoContents,\n\t\tfunc(universalProtoContent *universalProtoContent) (uuid.UUID, error) {\n\t\t\treturn uuidutil.FromDashless(universalProtoContent.CommitID)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor commitID, indexedModuleKey := range commitIDToIndexedModuleKey {\n\t\tuniversalProtoContent, ok := commitIDToUniversalProtoContent[commitID]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"no content returned for commit ID %s\", commitID)\n\t\t}\n\t\tif err := a.warnIfDeprecated(\n\t\t\tctx,\n\t\t\tv1ProtoModuleProvider,\n\t\t\tregistry,\n\t\t\tuniversalProtoContent.ModuleID,\n\t\t\tindexedModuleKey.Value,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn commitIDToUniversalProtoContent, nil\n}\n\n// In the future, we might want to add State, Visibility, etc as parameters to bufmodule.Module, to\n// match what we are doing with Commit and Graph to some degree, and then bring this warning\n// out of the ModuleDataProvider. However, if we did this, this has unintended consequences - right now,\n// by this being here, we only warn when we don't have the module in the cache, which we sort of want?\n// State is a property only on the BSR, it's not a property on a per-commit basis, so this gets into\n// weird territory.\nfunc (a *moduleDataProvider) warnIfDeprecated(\n\tctx context.Context,\n\tv1ProtoModuleProvider *v1ProtoModuleProvider,\n\tregistry string,\n\t// Dashless\n\tprotoModuleID string,\n\tmoduleKey bufmodule.ModuleKey,\n) error {\n\tv1ProtoModule, err := v1ProtoModuleProvider.getV1ProtoModuleForProtoModuleID(\n\t\tctx,\n\t\tregistry,\n\t\tprotoModuleID,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif v1ProtoModule.State == modulev1.ModuleState_MODULE_STATE_DEPRECATED {\n\t\ta.logger.Warn(fmt.Sprintf(\"%s is deprecated\", moduleKey.FullName().String()))\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/module_key_for_universal_proto_commit.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\nfunc getModuleKeyForUniversalProtoCommit(\n\tctx context.Context,\n\tv1ProtoModuleProvider *v1ProtoModuleProvider,\n\tv1ProtoOwnerProvider *v1ProtoOwnerProvider,\n\tregistry string,\n\tuniversalProtoCommit *universalProtoCommit,\n) (bufmodule.ModuleKey, error) {\n\tmoduleFullName, err := getFullNameForRegistryProtoOwnerIDProtoModuleID(\n\t\tctx,\n\t\tv1ProtoModuleProvider,\n\t\tv1ProtoOwnerProvider,\n\t\tregistry,\n\t\tuniversalProtoCommit.OwnerID,\n\t\tuniversalProtoCommit.ModuleID,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitID, err := uuidutil.FromDashless(universalProtoCommit.ID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmodule.NewModuleKey(\n\t\tmoduleFullName,\n\t\tcommitID,\n\t\tfunc() (bufmodule.Digest, error) {\n\t\t\treturn universalProtoCommit.Digest, nil\n\t\t},\n\t)\n}\n\nfunc getFullNameForRegistryProtoOwnerIDProtoModuleID(\n\tctx context.Context,\n\tv1ProtoModuleProvider *v1ProtoModuleProvider,\n\tv1ProtoOwnerProvider *v1ProtoOwnerProvider,\n\tregistry string,\n\t// Dashless\n\tprotoOwnerID string,\n\t// Dashless\n\tprotoModuleID string,\n) (bufparse.FullName, error) {\n\tv1ProtoModule, err := v1ProtoModuleProvider.getV1ProtoModuleForProtoModuleID(\n\t\tctx,\n\t\tregistry,\n\t\tprotoModuleID,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tv1ProtoOwner, err := v1ProtoOwnerProvider.getV1ProtoOwnerForProtoOwnerID(\n\t\tctx,\n\t\tregistry,\n\t\tprotoOwnerID,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar ownerName string\n\tswitch {\n\tcase v1ProtoOwner.GetUser() != nil:\n\t\townerName = v1ProtoOwner.GetUser().Name\n\tcase v1ProtoOwner.GetOrganization() != nil:\n\t\townerName = v1ProtoOwner.GetOrganization().Name\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"proto Owner did not have a User or Organization: %v\", v1ProtoOwner)\n\t}\n\treturn bufparse.NewFullName(\n\t\tregistry,\n\t\townerName,\n\t\tv1ProtoModule.Name,\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/module_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// NewModuleKeyProvider returns a new ModuleKeyProvider for the given API clients.\nfunc NewModuleKeyProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n) bufmodule.ModuleKeyProvider {\n\treturn newModuleKeyProvider(logger, moduleClientProvider)\n}\n\n// *** PRIVATE ***\n\ntype moduleKeyProvider struct {\n\tlogger               *slog.Logger\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t}\n}\n\nfunc newModuleKeyProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n) *moduleKeyProvider {\n\treturn &moduleKeyProvider{\n\t\tlogger:               logger,\n\t\tmoduleClientProvider: moduleClientProvider,\n\t}\n}\n\nfunc (a *moduleKeyProvider) GetModuleKeysForModuleRefs(\n\tctx context.Context,\n\tmoduleRefs []bufparse.Ref,\n\tdigestType bufmodule.DigestType,\n) ([]bufmodule.ModuleKey, error) {\n\t// Check unique.\n\tif _, err := xslices.ToUniqueValuesMapError(\n\t\tmoduleRefs,\n\t\tfunc(moduleRef bufparse.Ref) (string, error) {\n\t\t\treturn moduleRef.String(), nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\n\tregistryToIndexedModuleRefs := xslices.ToIndexedValuesMap(\n\t\tmoduleRefs,\n\t\tfunc(moduleRef bufparse.Ref) string {\n\t\t\treturn moduleRef.FullName().Registry()\n\t\t},\n\t)\n\tindexedModuleKeys := make([]xslices.Indexed[bufmodule.ModuleKey], 0, len(moduleRefs))\n\tfor registry, indexedModuleRefs := range registryToIndexedModuleRefs {\n\t\tindexedRegistryModuleKeys, err := a.getIndexedModuleKeysForRegistryAndIndexedModuleRefs(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedModuleRefs,\n\t\t\tdigestType,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedModuleKeys = append(indexedModuleKeys, indexedRegistryModuleKeys...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedModuleKeys), nil\n}\n\nfunc (a *moduleKeyProvider) getIndexedModuleKeysForRegistryAndIndexedModuleRefs(\n\tctx context.Context,\n\tregistry string,\n\tindexedModuleRefs []xslices.Indexed[bufparse.Ref],\n\tdigestType bufmodule.DigestType,\n) ([]xslices.Indexed[bufmodule.ModuleKey], error) {\n\tuniversalProtoCommits, err := getUniversalProtoCommitsForRegistryAndModuleRefs(ctx, a.moduleClientProvider, registry, xslices.IndexedToValues(indexedModuleRefs), digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tindexedModuleKeys := make([]xslices.Indexed[bufmodule.ModuleKey], len(indexedModuleRefs))\n\tfor i, universalProtoCommit := range universalProtoCommits {\n\t\tcommitID, err := uuidutil.FromDashless(universalProtoCommit.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmoduleKey, err := bufmodule.NewModuleKey(\n\t\t\t// Note we don't have to resolve owner_name and module_name since we already have them.\n\t\t\tindexedModuleRefs[i].Value.FullName(),\n\t\t\tcommitID,\n\t\t\tfunc() (bufmodule.Digest, error) {\n\t\t\t\t// Do not call getModuleKeyForProtoCommit, we already have the owner and module names.\n\t\t\t\treturn universalProtoCommit.Digest, nil\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedModuleKeys[i] = xslices.Indexed[bufmodule.ModuleKey]{\n\t\t\tValue: moduleKey,\n\t\t\tIndex: indexedModuleRefs[i].Index,\n\t\t}\n\t}\n\treturn indexedModuleKeys, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/registry.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/gen/data/datalegacyfederation\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// If we ever get to a case where we're supporting legacy federation, and we're moving buf.build,\n// we have way bigger problems than this hardcoded variable.\nconst defaultPublicRegistry = \"buf.build\"\n\ntype hasFullName interface {\n\tFullName() bufparse.FullName\n}\n\n// getPrimaryRegistryAndLegacyFederationAllowed returns the primary registry and whether\n// legacyFederation is allowed.\n//\n// If there is only a single registry for all the input values, this registry is returned as\n// the primary.\n//\n// If there is more than one registry, in the case where legacy federation is not allowed,\n// we return an error to the user.\n//\n// If legacy federation is allowed, a check is made on the number of registries parsed\n// among input values.\n//\n// If there are two registries, the primary will be the non-public registry, and we validate\n// the secondary is the public registry (buf.build).\n//\n// If there are more than two registries, an error is returned - we have never supported\n// federation beyond a single non-public registry depending on the public registry (buf.build).\n//\n// This is used to support legacy federation.\nfunc getPrimaryRegistryAndLegacyFederationAllowed[T hasFullName](\n\ts []T,\n\tpublicRegistry string,\n\tadditionalLegacyFederationRegistry string,\n) (string, bool, error) {\n\tif len(s) == 0 {\n\t\treturn \"\", false, syserror.New(\"must have at least one value in getPrimarySecondaryRegistry\")\n\t}\n\tregistries, err := getRegistries(s)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tlegacyFederationAllowed, err := isLegacyFederationAllowed(registries, additionalLegacyFederationRegistry)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tswitch len(registries) {\n\tcase 0:\n\t\treturn \"\", false, syserror.New(\"no registries detected in getPrimarySecondaryRegistry\")\n\tcase 1:\n\t\treturn registries[0], legacyFederationAllowed, nil\n\tcase 2:\n\t\tif legacyFederationAllowed {\n\t\t\tif registries[0] != publicRegistry && registries[1] != publicRegistry {\n\t\t\t\treturn \"\", legacyFederationAllowed, fmt.Errorf(\"cannot use federation between two non-public registries: %s, %s\", registries[0], registries[1])\n\t\t\t}\n\t\t\tif registries[0] == publicRegistry {\n\t\t\t\treturn registries[1], legacyFederationAllowed, nil\n\t\t\t}\n\t\t\treturn registries[0], legacyFederationAllowed, nil\n\t\t}\n\t\tfallthrough\n\tdefault:\n\t\treturn \"\", false, fmt.Errorf(\"dependencies across multiple registries are not allowed: %s\", strings.Join(registries, \", \"))\n\t}\n}\n\nfunc isLegacyFederationAllowed(registries []string, additionalLegacyFederationRegistry string) (bool, error) {\n\tfor _, registry := range registries {\n\t\texists, err := datalegacyfederation.Exists(registry)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif exists {\n\t\t\treturn true, nil\n\t\t}\n\t\t// Checking that additionalLegacyFederationRegistry != \"\" just as a defensive measure, even though\n\t\t// nothing in registries should be empty.\n\t\tif additionalLegacyFederationRegistry != \"\" && registry == additionalLegacyFederationRegistry {\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n\nfunc getRegistries[T hasFullName](s []T) ([]string, error) {\n\tregistryMap, err := xslices.ToValuesMapError(\n\t\ts,\n\t\tfunc(e T) (string, error) {\n\t\t\tmoduleFullName := e.FullName()\n\t\t\tif moduleFullName == nil {\n\t\t\t\treturn \"\", syserror.Newf(\"no FullName for %v\", e)\n\t\t\t}\n\t\t\tregistry := moduleFullName.Registry()\n\t\t\tif registry == \"\" {\n\t\t\t\treturn \"\", syserror.Newf(\"no registry for %v\", e)\n\t\t\t}\n\t\t\treturn registry, nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.MapKeysToSortedSlice(registryMap), nil\n}\n\n// getSingleRegistryForContentModules returns the single registry for the content modules in Upload.\n//\n// Returns error if there is more than one module.\nfunc getSingleRegistryForContentModules(contentModules []bufmodule.Module) (string, error) {\n\tif len(contentModules) == 0 {\n\t\treturn \"\", syserror.New(\"requires at least one module to resolve registry\")\n\t}\n\tvar registry string\n\tfor _, module := range contentModules {\n\t\tmoduleFullName := module.FullName()\n\t\tif moduleFullName == nil {\n\t\t\treturn \"\", syserror.Newf(\"expected module name for %s\", module.Description())\n\t\t}\n\t\tmoduleRegistry := moduleFullName.Registry()\n\t\tif registry != \"\" && moduleRegistry != registry {\n\t\t\t// We don't allow the upload of content across multiple registries, but in the legacy federation\n\t\t\t// case, we DO allow for depending on other registries.\n\t\t\treturn \"\", fmt.Errorf(\n\t\t\t\t\"cannot upload content for multiple registries at once: %s, %s\",\n\t\t\t\tregistry,\n\t\t\t\tmoduleRegistry,\n\t\t\t)\n\t\t}\n\t\tregistry = moduleRegistry\n\t}\n\treturn registry, nil\n}\n\nfunc validateDepRegistries(primaryRegistry string, depRegistries []string, publicRegistry string) error {\n\tswitch len(depRegistries) {\n\tcase 0:\n\t\treturn nil\n\tcase 1, 2:\n\t\tfor _, depRegistry := range depRegistries {\n\t\t\tif depRegistry != publicRegistry && depRegistry != primaryRegistry {\n\t\t\t\treturn fmt.Errorf(\"dependency must be on either %s or %s but was on %s\", publicRegistry, primaryRegistry, depRegistry)\n\t\t\t}\n\t\t\tif primaryRegistry == publicRegistry && depRegistry != publicRegistry {\n\t\t\t\t// Public to private was never allowed.\n\t\t\t\treturn fmt.Errorf(\"cannot have dependencies on %s modules from %s modules\", primaryRegistry, depRegistry)\n\t\t\t}\n\t\t}\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"dependencies across multiple registries are not allowed: %s\", strings.Join(depRegistries, \", \"))\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/universal_proto_commit.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\tmodulev1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\ntype universalProtoCommit struct {\n\t// Dashless\n\tID string\n\t// Dashless\n\tOwnerID string\n\t// Dashless\n\tModuleID   string\n\tCreateTime time.Time\n\tDigest     bufmodule.Digest\n}\n\nfunc newUniversalProtoCommitForV1(v1ProtoCommit *modulev1.Commit) (*universalProtoCommit, error) {\n\tdigest, err := V1ProtoToDigest(v1ProtoCommit.Digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &universalProtoCommit{\n\t\tID:         v1ProtoCommit.Id,\n\t\tOwnerID:    v1ProtoCommit.OwnerId,\n\t\tModuleID:   v1ProtoCommit.ModuleId,\n\t\tCreateTime: v1ProtoCommit.CreateTime.AsTime(),\n\t\tDigest:     digest,\n\t}, nil\n}\n\nfunc newUniversalProtoCommitForV1Beta1(v1beta1ProtoCommit *modulev1beta1.Commit) (*universalProtoCommit, error) {\n\tdigest, err := V1Beta1ProtoToDigest(v1beta1ProtoCommit.Digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &universalProtoCommit{\n\t\tID:         v1beta1ProtoCommit.Id,\n\t\tOwnerID:    v1beta1ProtoCommit.OwnerId,\n\t\tModuleID:   v1beta1ProtoCommit.ModuleId,\n\t\tCreateTime: v1beta1ProtoCommit.CreateTime.AsTime(),\n\t\tDigest:     digest,\n\t}, nil\n}\n\nfunc getUniversalProtoCommitForRegistryAndCommitID(\n\tctx context.Context,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n\tregistry string,\n\tcommitID uuid.UUID,\n\tdigestType bufmodule.DigestType,\n) (*universalProtoCommit, error) {\n\tuniversalProtoCommits, err := getUniversalProtoCommitsForRegistryAndCommitIDs(ctx, moduleClientProvider, registry, []uuid.UUID{commitID}, digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// We already do length checking in getUniversalProtoCommitsForRegistryAndCommitIDs.\n\treturn universalProtoCommits[0], nil\n}\n\nfunc getUniversalProtoCommitsForRegistryAndCommitIDs(\n\tctx context.Context,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n\tregistry string,\n\tcommitIDs []uuid.UUID,\n\tdigestType bufmodule.DigestType,\n) ([]*universalProtoCommit, error) {\n\tswitch digestType {\n\tcase bufmodule.DigestTypeB4:\n\t\tv1beta1ProtoResourceRefs := commitIDsToV1Beta1ProtoResourceRefs(commitIDs)\n\t\tv1beta1ProtoCommits, err := getV1Beta1ProtoCommitsForRegistryAndResourceRefs(ctx, moduleClientProvider, registry, v1beta1ProtoResourceRefs, digestType)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn xslices.MapError(v1beta1ProtoCommits, newUniversalProtoCommitForV1Beta1)\n\tcase bufmodule.DigestTypeB5:\n\t\tv1ProtoResourceRefs := commitIDsToV1ProtoResourceRefs(commitIDs)\n\t\tv1ProtoCommits, err := getV1ProtoCommitsForRegistryAndResourceRefs(ctx, moduleClientProvider, registry, v1ProtoResourceRefs)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn xslices.MapError(v1ProtoCommits, newUniversalProtoCommitForV1)\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\nfunc getUniversalProtoCommitsForRegistryAndModuleRefs(\n\tctx context.Context,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1CommitServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1CommitServiceClientProvider\n\t},\n\tregistry string,\n\tmoduleRefs []bufparse.Ref,\n\tdigestType bufmodule.DigestType,\n) ([]*universalProtoCommit, error) {\n\tswitch digestType {\n\tcase bufmodule.DigestTypeB4:\n\t\tv1beta1ProtoResourceRefs := moduleRefsToV1Beta1ProtoResourceRefs(moduleRefs)\n\t\tv1beta1ProtoCommits, err := getV1Beta1ProtoCommitsForRegistryAndResourceRefs(ctx, moduleClientProvider, registry, v1beta1ProtoResourceRefs, digestType)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn xslices.MapError(v1beta1ProtoCommits, newUniversalProtoCommitForV1Beta1)\n\tcase bufmodule.DigestTypeB5:\n\t\tv1ProtoResourceRefs := moduleRefsToV1ProtoResourceRefs(moduleRefs)\n\t\tv1ProtoCommits, err := getV1ProtoCommitsForRegistryAndResourceRefs(ctx, moduleClientProvider, registry, v1ProtoResourceRefs)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn xslices.MapError(v1ProtoCommits, newUniversalProtoCommitForV1)\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\nfunc getV1ProtoCommitsForRegistryAndResourceRefs(\n\tctx context.Context,\n\tmoduleClientProvider bufregistryapimodule.V1CommitServiceClientProvider,\n\tregistry string,\n\tv1ProtoResourceRefs []*modulev1.ResourceRef,\n) ([]*modulev1.Commit, error) {\n\tresponse, err := moduleClientProvider.V1CommitServiceClient(registry).GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetCommitsRequest{\n\t\t\t\t// TODO FUTURE: chunking\n\t\t\t\tResourceRefs: v1ProtoResourceRefs,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, maybeNewNotFoundError(err)\n\t}\n\tif len(response.Msg.Commits) != len(v1ProtoResourceRefs) {\n\t\treturn nil, fmt.Errorf(\"expected %d Commits, got %d\", len(v1ProtoResourceRefs), len(response.Msg.Commits))\n\t}\n\treturn response.Msg.Commits, nil\n}\n\nfunc getV1Beta1ProtoCommitsForRegistryAndResourceRefs(\n\tctx context.Context,\n\tmoduleClientProvider bufregistryapimodule.V1Beta1CommitServiceClientProvider,\n\tregistry string,\n\tv1beta1ProtoResourceRefs []*modulev1beta1.ResourceRef,\n\tdigestType bufmodule.DigestType,\n) ([]*modulev1beta1.Commit, error) {\n\tv1beta1ProtoDigestType, err := digestTypeToV1Beta1Proto(digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := moduleClientProvider.V1Beta1CommitServiceClient(registry).GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1beta1.GetCommitsRequest{\n\t\t\t\t// TODO FUTURE: chunking\n\t\t\t\tResourceRefs: v1beta1ProtoResourceRefs,\n\t\t\t\tDigestType:   v1beta1ProtoDigestType,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, maybeNewNotFoundError(err)\n\t}\n\tif len(response.Msg.Commits) != len(v1beta1ProtoResourceRefs) {\n\t\treturn nil, fmt.Errorf(\"expected %d Commits, got %d\", len(v1beta1ProtoResourceRefs), len(response.Msg.Commits))\n\t}\n\treturn response.Msg.Commits, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/universal_proto_content.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\tmodulev1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\ntype universalProtoContent struct {\n\t// Dashless\n\tCommitID string\n\t// Dashless\n\tModuleID      string\n\tFiles         []*universalProtoFile\n\tV1BufYAMLFile *universalProtoFile\n\tV1BufLockFile *universalProtoFile\n}\n\nfunc newUniversalProtoContentForV1(v1ProtoContent *modulev1.DownloadResponse_Content) *universalProtoContent {\n\treturn &universalProtoContent{\n\t\tCommitID: v1ProtoContent.Commit.Id,\n\t\tModuleID: v1ProtoContent.Commit.ModuleId,\n\t\tFiles:    xslices.Map(v1ProtoContent.Files, newUniversalProtoFileForV1),\n\t}\n}\n\nfunc newUniversalProtoContentForV1Beta1(v1beta1ProtoContent *modulev1beta1.DownloadResponse_Content) *universalProtoContent {\n\tvar (\n\t\tv1BufYAMLFile *universalProtoFile\n\t\tv1BufLockFile *universalProtoFile\n\t)\n\tif v1beta1ProtoContent.V1BufYamlFile != nil {\n\t\tv1BufYAMLFile = newUniversalProtoFileForV1Beta1(v1beta1ProtoContent.V1BufYamlFile)\n\t}\n\tif v1beta1ProtoContent.V1BufLockFile != nil {\n\t\tv1BufLockFile = newUniversalProtoFileForV1Beta1(v1beta1ProtoContent.V1BufLockFile)\n\t}\n\treturn &universalProtoContent{\n\t\tCommitID:      v1beta1ProtoContent.Commit.Id,\n\t\tModuleID:      v1beta1ProtoContent.Commit.ModuleId,\n\t\tFiles:         xslices.Map(v1beta1ProtoContent.Files, newUniversalProtoFileForV1Beta1),\n\t\tV1BufYAMLFile: v1BufYAMLFile,\n\t\tV1BufLockFile: v1BufLockFile,\n\t}\n}\n\nfunc getUniversalProtoContentsForRegistryAndCommitIDs(\n\tctx context.Context,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1DownloadServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1DownloadServiceClientProvider\n\t},\n\tregistry string,\n\tcommitIDs []uuid.UUID,\n\tdigestType bufmodule.DigestType,\n) ([]*universalProtoContent, error) {\n\tswitch digestType {\n\tcase bufmodule.DigestTypeB4:\n\t\tv1beta1ProtoResourceRefs := commitIDsToV1Beta1ProtoResourceRefs(commitIDs)\n\t\tv1beta1ProtoContents, err := getV1Beta1ProtoContentsForRegistryAndResourceRefs(ctx, moduleClientProvider, registry, v1beta1ProtoResourceRefs, digestType)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn xslices.Map(v1beta1ProtoContents, newUniversalProtoContentForV1Beta1), nil\n\tcase bufmodule.DigestTypeB5:\n\t\tv1ProtoResourceRefs := commitIDsToV1ProtoResourceRefs(commitIDs)\n\t\tv1ProtoContents, err := getV1ProtoContentsForRegistryAndResourceRefs(ctx, moduleClientProvider, registry, v1ProtoResourceRefs)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn xslices.Map(v1ProtoContents, newUniversalProtoContentForV1), nil\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\nfunc getV1ProtoContentsForRegistryAndResourceRefs(\n\tctx context.Context,\n\tmoduleClientProvider bufregistryapimodule.V1DownloadServiceClientProvider,\n\tregistry string,\n\tv1ProtoResourceRefs []*modulev1.ResourceRef,\n) ([]*modulev1.DownloadResponse_Content, error) {\n\tresponse, err := moduleClientProvider.V1DownloadServiceClient(registry).Download(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.DownloadRequest{\n\t\t\t\t// TODO FUTURE: chunking\n\t\t\t\tValues: xslices.Map(\n\t\t\t\t\tv1ProtoResourceRefs,\n\t\t\t\t\tfunc(v1ProtoResourceRef *modulev1.ResourceRef) *modulev1.DownloadRequest_Value {\n\t\t\t\t\t\treturn &modulev1.DownloadRequest_Value{\n\t\t\t\t\t\t\tResourceRef: v1ProtoResourceRef,\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 err != nil {\n\t\treturn nil, maybeNewNotFoundError(err)\n\t}\n\tif len(response.Msg.Contents) != len(v1ProtoResourceRefs) {\n\t\treturn nil, fmt.Errorf(\"expected %d Contents, got %d\", len(v1ProtoResourceRefs), len(response.Msg.Contents))\n\t}\n\treturn response.Msg.Contents, nil\n}\n\nfunc getV1Beta1ProtoContentsForRegistryAndResourceRefs(\n\tctx context.Context,\n\tmoduleClientProvider bufregistryapimodule.V1Beta1DownloadServiceClientProvider,\n\tregistry string,\n\tv1beta1ProtoResourceRefs []*modulev1beta1.ResourceRef,\n\tdigestType bufmodule.DigestType,\n) ([]*modulev1beta1.DownloadResponse_Content, error) {\n\tv1beta1ProtoDigestType, err := digestTypeToV1Beta1Proto(digestType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := moduleClientProvider.V1Beta1DownloadServiceClient(registry).Download(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1beta1.DownloadRequest{\n\t\t\t\t// TODO FUTURE: chunking\n\t\t\t\tValues: xslices.Map(\n\t\t\t\t\tv1beta1ProtoResourceRefs,\n\t\t\t\t\tfunc(v1beta1ProtoResourceRef *modulev1beta1.ResourceRef) *modulev1beta1.DownloadRequest_Value {\n\t\t\t\t\t\treturn &modulev1beta1.DownloadRequest_Value{\n\t\t\t\t\t\t\tResourceRef: v1beta1ProtoResourceRef,\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t\tDigestType: v1beta1ProtoDigestType,\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, maybeNewNotFoundError(err)\n\t}\n\tif len(response.Msg.Contents) != len(v1beta1ProtoResourceRefs) {\n\t\treturn nil, fmt.Errorf(\"expected %d Contents, got %d\", len(v1beta1ProtoResourceRefs), len(response.Msg.Contents))\n\t}\n\treturn response.Msg.Contents, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/universal_proto_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\tmodulev1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1beta1\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n)\n\ntype universalProtoFile struct {\n\tPath    string\n\tContent []byte\n}\n\nfunc newUniversalProtoFileForV1(v1File *modulev1.File) *universalProtoFile {\n\treturn &universalProtoFile{\n\t\tPath:    v1File.Path,\n\t\tContent: v1File.Content,\n\t}\n}\n\nfunc newUniversalProtoFileForV1Beta1(v1beta1File *modulev1beta1.File) *universalProtoFile {\n\treturn &universalProtoFile{\n\t\tPath:    v1beta1File.Path,\n\t\tContent: v1beta1File.Content,\n\t}\n}\n\nfunc universalProtoFilesToBucket(universalProtoFiles []*universalProtoFile) (storage.ReadBucket, error) {\n\tpathToData := make(map[string][]byte, len(universalProtoFiles))\n\tfor _, universalProtoFile := range universalProtoFiles {\n\t\tpathToData[universalProtoFile.Path] = universalProtoFile.Content\n\t}\n\treturn storagemem.NewReadBucket(pathToData)\n}\n\nfunc universalProtoFileToObjectData(universalProtoFile *universalProtoFile) (bufmodule.ObjectData, error) {\n\tif universalProtoFile == nil {\n\t\treturn nil, nil\n\t}\n\treturn bufmodule.NewObjectData(normalpath.Base(universalProtoFile.Path), universalProtoFile.Content)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/uploader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"strings\"\n\t\"time\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\tmodulev1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1beta1\"\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// NewUploader returns a new Uploader for the given API client.\nfunc NewUploader(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1UploadServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1UploadServiceClientProvider\n\t},\n\toptions ...UploaderOption,\n) bufmodule.Uploader {\n\treturn newUploader(logger, moduleClientProvider, options...)\n}\n\n// UploaderOption is an option for a new Uploader.\ntype UploaderOption func(*uploader)\n\n// UploaderWithPublicRegistry returns a new UploaderOption that specifies\n// the hostname of the public registry. By default this is \"buf.build\", however in testing,\n// this may be something else. This is needed to discern which which registry to make calls\n// against in the case where there is >1 registries represented in the ModuleKeys - we always\n// want to call the non-public registry.\nfunc UploaderWithPublicRegistry(publicRegistry string) UploaderOption {\n\treturn func(uploader *uploader) {\n\t\tif publicRegistry != \"\" {\n\t\t\tuploader.publicRegistry = publicRegistry\n\t\t}\n\t}\n}\n\n// *** PRIVATE ***\n\ntype uploader struct {\n\tlogger               *slog.Logger\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1UploadServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1UploadServiceClientProvider\n\t}\n\tpublicRegistry string\n}\n\nfunc newUploader(\n\tlogger *slog.Logger,\n\tmoduleClientProvider interface {\n\t\tbufregistryapimodule.V1ModuleServiceClientProvider\n\t\tbufregistryapimodule.V1UploadServiceClientProvider\n\t\tbufregistryapimodule.V1Beta1UploadServiceClientProvider\n\t},\n\toptions ...UploaderOption,\n) *uploader {\n\tuploader := &uploader{\n\t\tlogger:               logger,\n\t\tmoduleClientProvider: moduleClientProvider,\n\t\tpublicRegistry:       defaultPublicRegistry,\n\t}\n\tfor _, option := range options {\n\t\toption(uploader)\n\t}\n\treturn uploader\n}\n\nfunc (a *uploader) Upload(\n\tctx context.Context,\n\tmoduleSet bufmodule.ModuleSet,\n\toptions ...bufmodule.UploadOption,\n) ([]bufmodule.Commit, error) {\n\tuploadOptions, err := bufmodule.NewUploadOptions(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontentModules, err := bufmodule.ModuleSetTargetLocalModulesAndTransitiveLocalDeps(moduleSet)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Only push named modules to the registry. Any dependencies for named modules must have a name.\n\t// Local unnamed modules can be excluded if the UploadWithExcludeUnnamed option is set.\n\tcontentModules, err = xslices.FilterError(contentModules, func(module bufmodule.Module) (bool, error) {\n\t\tmoduleName := module.FullName()\n\t\tif moduleName == nil {\n\t\t\tmoduleDescription := module.Description()\n\t\t\tif uploadOptions.ExcludeUnnamed() {\n\t\t\t\ta.logger.Warn(\"Excluding unnamed module\", slog.String(\"module\", moduleDescription))\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\treturn false, fmt.Errorf(\"a name must be specified in buf.yaml to push module: %s\", moduleDescription)\n\t\t}\n\t\tdeps, err := module.ModuleDeps()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif allDepModuleDescriptions := xslices.Reduce(deps, func(allDepModuleDescriptions []string, dep bufmodule.ModuleDep) []string {\n\t\t\tif moduleName := dep.FullName(); moduleName == nil {\n\t\t\t\treturn append(allDepModuleDescriptions, dep.Description())\n\t\t\t}\n\t\t\treturn allDepModuleDescriptions\n\t\t}, nil); len(allDepModuleDescriptions) > 0 {\n\t\t\treturn false, fmt.Errorf(\n\t\t\t\t\"all dependencies for module %q must be named but these modules are not:\\n%s\",\n\t\t\t\tmoduleName.String(),\n\t\t\t\tstrings.Join(\n\t\t\t\t\txslices.Map(allDepModuleDescriptions, func(moduleDescription string) string { return \"  \" + moduleDescription }),\n\t\t\t\t\t\"\\n\",\n\t\t\t\t),\n\t\t\t)\n\t\t}\n\t\treturn true, nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(contentModules) == 0 {\n\t\t// Nothing to upload.\n\t\treturn nil, nil\n\t}\n\tprimaryRegistry, err := getSingleRegistryForContentModules(contentModules)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// This must be in the same order as contentModules.\n\tvar modules []*modulev1.Module\n\tif uploadOptions.CreateIfNotExist() {\n\t\t// We must attempt to create each module one at a time, since CreateModules will return\n\t\t// an `AlreadyExists` if any of the modules we are attempting to create already exists,\n\t\t// and no new modules will be created.\n\t\tmodules = make([]*modulev1.Module, len(contentModules))\n\t\tfor i, contentModule := range contentModules {\n\t\t\tmodule, err := a.createContentModuleIfNotExist(\n\t\t\t\tctx,\n\t\t\t\tprimaryRegistry,\n\t\t\t\tcontentModule,\n\t\t\t\tuploadOptions.CreateModuleVisibility(),\n\t\t\t\tuploadOptions.CreateDefaultLabel(),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmodules[i] = module\n\t\t}\n\t} else {\n\t\t// The modules retrieved by GetModules retains the same order as the request, so\n\t\t// this matches the order of contentModules.\n\t\tmodules, err = a.validateContentModulesExist(\n\t\t\tctx,\n\t\t\tprimaryRegistry,\n\t\t\tcontentModules,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tvar v1beta1ProtoScopedLabelRefs []*modulev1beta1.ScopedLabelRef\n\tif len(uploadOptions.Tags()) > 0 {\n\t\tcontentModuleSortedDefaultLabels := xslices.ToUniqueSorted(\n\t\t\txslices.Map(\n\t\t\t\tmodules,\n\t\t\t\tfunc(module *modulev1.Module) string {\n\t\t\t\t\treturn module.DefaultLabelName\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t\tif len(contentModuleSortedDefaultLabels) > 1 {\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t`--tag was used, but modules %q had multiple default tags %q. If multiple modules are being pushed and --tag is used, all modules must have the same default label.`,\n\t\t\t\tstrings.Join(xslices.Map(\n\t\t\t\t\tcontentModules,\n\t\t\t\t\tfunc(module bufmodule.Module) string {\n\t\t\t\t\t\treturn module.FullName().String()\n\t\t\t\t\t},\n\t\t\t\t), \", \"),\n\t\t\t\tstrings.Join(contentModuleSortedDefaultLabels, \", \"),\n\t\t\t)\n\t\t}\n\t\tif len(contentModuleSortedDefaultLabels) < 1 {\n\t\t\t// This should never happen, every module should have a default label, so we return\n\t\t\t// a syserror.\n\t\t\treturn nil, syserror.New(\"no default labels for modules\")\n\t\t}\n\t\t// While the API allows different labels per reference, we don't expose this through\n\t\t// the use of the `--label` flag, so all references will have the same labels.\n\t\t// We just pre-compute them now.\n\t\tlabelNames := append(uploadOptions.Tags(), contentModuleSortedDefaultLabels[0])\n\t\tv1beta1ProtoScopedLabelRefs = xslices.Map(\n\t\t\tlabelNames,\n\t\t\tlabelNameToV1Beta1ProtoScopedLabelRef,\n\t\t)\n\t} else {\n\t\t// While the API allows different labels per reference, we don't expose this through\n\t\t// the use of the `--label` flag, so all references will have the same labels.\n\t\t// We just pre-compute them now.\n\t\tif len(uploadOptions.Labels()) > 0 {\n\t\t\tv1beta1ProtoScopedLabelRefs = xslices.Map(\n\t\t\t\tuploadOptions.Labels(),\n\t\t\t\tlabelNameToV1Beta1ProtoScopedLabelRef,\n\t\t\t)\n\t\t}\n\t}\n\t// Maintains ordering, important for when we create bufmodule.Commit objects below.\n\tv1beta1ProtoUploadRequestContents, err := xslices.MapError(\n\t\tcontentModules,\n\t\tfunc(module bufmodule.Module) (*modulev1beta1.UploadRequest_Content, error) {\n\t\t\treturn getV1Beta1ProtoUploadRequestContent(\n\t\t\t\tctx,\n\t\t\t\tv1beta1ProtoScopedLabelRefs,\n\t\t\t\tprimaryRegistry,\n\t\t\t\tmodule,\n\t\t\t\tuploadOptions.SourceControlURL(),\n\t\t\t)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tremoteDeps, err := bufmodule.RemoteDepsForModules(contentModules)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tv1beta1ProtoUploadRequestDepRefs, err := xslices.MapError(\n\t\tremoteDeps,\n\t\tremoteDepToV1Beta1ProtoUploadRequestDepRef,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// A sorted slice of unique registries for the RemoteDeps.\n\tremoteDepRegistries := xslices.MapKeysToSortedSlice(\n\t\t// A map from registry to RemoteDeps for that registry.\n\t\txslices.ToValuesMap(\n\t\t\tremoteDeps,\n\t\t\tfunc(remoteDep bufmodule.RemoteDep) string {\n\t\t\t\t// We've already validated two or three times that FullName is present here.\n\t\t\t\treturn remoteDep.FullName().Registry()\n\t\t\t},\n\t\t),\n\t)\n\tif err := validateDepRegistries(primaryRegistry, remoteDepRegistries, a.publicRegistry); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar universalProtoCommits []*universalProtoCommit\n\tif len(remoteDepRegistries) > 0 && (len(remoteDepRegistries) > 1 || remoteDepRegistries[0] != primaryRegistry) {\n\t\t// If we have dependencies on other registries, or we have multiple registries we depend on, we have\n\t\t// to use legacy federation.\n\t\tresponse, err := a.moduleClientProvider.V1Beta1UploadServiceClient(primaryRegistry).Upload(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\t&modulev1beta1.UploadRequest{\n\t\t\t\t\tContents: v1beta1ProtoUploadRequestContents,\n\t\t\t\t\tDepRefs:  v1beta1ProtoUploadRequestDepRefs,\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tuniversalProtoCommits, err = xslices.MapError(response.Msg.Commits, newUniversalProtoCommitForV1Beta1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\t// If we only have a single registry, invoke the new API endpoint that does not allow\n\t\t// for federation. Do this so that we can maintain federated API endpoint metrics.\n\t\t//\n\t\t// Maintains ordering, important for when we create bufmodule.Commit objects below.\n\t\tv1ProtoUploadRequestContents := xslices.Map(\n\t\t\tv1beta1ProtoUploadRequestContents,\n\t\t\tv1beta1ProtoUploadRequestContentToV1ProtoUploadRequestContent,\n\t\t)\n\t\tprotoDepCommitIds := xslices.Map(\n\t\t\tv1beta1ProtoUploadRequestDepRefs,\n\t\t\tfunc(v1beta1ProtoDepRef *modulev1beta1.UploadRequest_DepRef) string {\n\t\t\t\treturn v1beta1ProtoDepRef.CommitId\n\t\t\t},\n\t\t)\n\t\tresponse, err := a.moduleClientProvider.V1UploadServiceClient(primaryRegistry).Upload(\n\t\t\tctx,\n\t\t\tconnect.NewRequest(\n\t\t\t\t&modulev1.UploadRequest{\n\t\t\t\t\tContents:     v1ProtoUploadRequestContents,\n\t\t\t\t\tDepCommitIds: protoDepCommitIds,\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tuniversalProtoCommits, err = xslices.MapError(response.Msg.Commits, newUniversalProtoCommitForV1)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif len(universalProtoCommits) != len(v1beta1ProtoUploadRequestContents) {\n\t\treturn nil, fmt.Errorf(\"expected %d Commits, got %d\", len(v1beta1ProtoUploadRequestContents), len(universalProtoCommits))\n\t}\n\tcommits := make([]bufmodule.Commit, len(universalProtoCommits))\n\tfor i, universalProtoCommit := range universalProtoCommits {\n\t\t// This is how we get the FullName without calling the ModuleService or OwnerService.\n\t\t//\n\t\t// We've maintained ordering throughout this function, so we can do this.\n\t\t// The API returns Commits in the same order as the Contents.\n\t\tmoduleFullName := contentModules[i].FullName()\n\t\tcommitID, err := uuidutil.FromDashless(universalProtoCommit.ID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmoduleKey, err := bufmodule.NewModuleKey(\n\t\t\tmoduleFullName,\n\t\t\tcommitID,\n\t\t\tfunc() (bufmodule.Digest, error) {\n\t\t\t\treturn universalProtoCommit.Digest, nil\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcommits[i] = bufmodule.NewCommit(\n\t\t\tmoduleKey,\n\t\t\tfunc() (time.Time, error) {\n\t\t\t\treturn universalProtoCommit.CreateTime, nil\n\t\t\t},\n\t\t)\n\t}\n\treturn commits, nil\n}\n\nfunc (a *uploader) createContentModuleIfNotExist(\n\tctx context.Context,\n\tprimaryRegistry string,\n\tcontentModule bufmodule.Module,\n\tcreateModuleVisibility bufmodule.ModuleVisibility,\n\tcreateDefaultLabel string,\n) (*modulev1.Module, error) {\n\t// We first check if a module already exists on the registry, if so, we do not need to\n\t// attempt to create it.\n\tmodules, err := a.validateContentModulesExist(ctx, primaryRegistry, []bufmodule.Module{contentModule})\n\tif err != nil {\n\t\t// The module is not found, attempt to create\n\t\tif connect.CodeOf(err) == connect.CodeNotFound {\n\t\t\tv1ProtoCreateModuleVisibility, err := moduleVisibilityToV1Proto(createModuleVisibility)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tresponse, err := a.moduleClientProvider.V1ModuleServiceClient(primaryRegistry).CreateModules(\n\t\t\t\tctx,\n\t\t\t\tconnect.NewRequest(\n\t\t\t\t\t&modulev1.CreateModulesRequest{\n\t\t\t\t\t\tValues: []*modulev1.CreateModulesRequest_Value{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tOwnerRef: &ownerv1.OwnerRef{\n\t\t\t\t\t\t\t\t\tValue: &ownerv1.OwnerRef_Name{\n\t\t\t\t\t\t\t\t\t\tName: contentModule.FullName().Owner(),\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\tName:             contentModule.FullName().Name(),\n\t\t\t\t\t\t\t\tVisibility:       v1ProtoCreateModuleVisibility,\n\t\t\t\t\t\t\t\tDefaultLabelName: createDefaultLabel,\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 err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// Check that we only created a single module\n\t\t\tif len(response.Msg.Modules) != 1 {\n\t\t\t\treturn nil, syserror.Newf(\"expected 1 Module, found %d\", len(response.Msg.Modules))\n\t\t\t}\n\t\t\t// Return the created module.\n\t\t\treturn response.Msg.Modules[0], nil\n\t\t}\n\t\treturn nil, err\n\t}\n\tif len(modules) != 1 {\n\t\treturn nil, syserror.Newf(\"expected 1 Module, found %d\", len(modules))\n\t}\n\treturn modules[0], nil\n}\n\nfunc (a *uploader) validateContentModulesExist(\n\tctx context.Context,\n\tprimaryRegistry string,\n\tcontentModules []bufmodule.Module,\n) ([]*modulev1.Module, error) {\n\tresponse, err := a.moduleClientProvider.V1ModuleServiceClient(primaryRegistry).GetModules(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&modulev1.GetModulesRequest{\n\t\t\t\tModuleRefs: xslices.Map(\n\t\t\t\t\tcontentModules,\n\t\t\t\t\tfunc(module bufmodule.Module) *modulev1.ModuleRef {\n\t\t\t\t\t\treturn &modulev1.ModuleRef{\n\t\t\t\t\t\t\tValue: &modulev1.ModuleRef_Name_{\n\t\t\t\t\t\t\t\tName: &modulev1.ModuleRef_Name{\n\t\t\t\t\t\t\t\t\tOwner:  module.FullName().Owner(),\n\t\t\t\t\t\t\t\t\tModule: module.FullName().Name(),\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\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn response.Msg.Modules, nil\n}\n\nfunc getV1Beta1ProtoUploadRequestContent(\n\tctx context.Context,\n\tv1beta1ProtoScopedLabelRefs []*modulev1beta1.ScopedLabelRef,\n\tprimaryRegistry string,\n\tmodule bufmodule.Module,\n\tsourceControlURL string,\n) (*modulev1beta1.UploadRequest_Content, error) {\n\tif !module.IsLocal() {\n\t\treturn nil, syserror.New(\"expected local Module in getProtoLegacyFederationUploadRequestContent\")\n\t}\n\tif module.FullName() == nil {\n\t\treturn nil, syserror.Newf(\"expected module name for local module: %s\", module.Description())\n\t}\n\tif module.FullName().Registry() != primaryRegistry {\n\t\t// This should never happen - the upload Modules should already be verified above to come from one registry.\n\t\treturn nil, syserror.Newf(\"attempting to upload content for registry other than %s in getProtoLegacyFederationUploadRequestContent\", primaryRegistry)\n\t}\n\n\tv1beta1ProtoFiles, err := bucketToV1Beta1ProtoFiles(ctx, bufmodule.ModuleReadBucketToStorageReadBucket(module))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuploadRequestContent := &modulev1beta1.UploadRequest_Content{\n\t\tModuleRef: &modulev1beta1.ModuleRef{\n\t\t\tValue: &modulev1beta1.ModuleRef_Name_{\n\t\t\t\tName: &modulev1beta1.ModuleRef_Name{\n\t\t\t\t\tOwner:  module.FullName().Owner(),\n\t\t\t\t\tModule: module.FullName().Name(),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tFiles:           v1beta1ProtoFiles,\n\t\tScopedLabelRefs: v1beta1ProtoScopedLabelRefs,\n\t}\n\tif sourceControlURL != \"\" {\n\t\tuploadRequestContent.SourceControlUrl = sourceControlURL\n\t}\n\treturn uploadRequestContent, nil\n}\n\nfunc remoteDepToV1Beta1ProtoUploadRequestDepRef(\n\tremoteDep bufmodule.RemoteDep,\n) (*modulev1beta1.UploadRequest_DepRef, error) {\n\tif remoteDep.FullName() == nil {\n\t\treturn nil, syserror.Newf(\"expected module name for remote module dependency %q\", remoteDep.OpaqueID())\n\t}\n\tdepCommitID := remoteDep.CommitID()\n\tif depCommitID == uuid.Nil {\n\t\treturn nil, syserror.Newf(\"did not have a commit ID for a remote module dependency %q\", remoteDep.OpaqueID())\n\t}\n\treturn &modulev1beta1.UploadRequest_DepRef{\n\t\tCommitId: uuidutil.ToDashless(depCommitID),\n\t\tRegistry: remoteDep.FullName().Registry(),\n\t}, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufmoduleapi\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/v1_proto_module_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\tmodulev1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/module/v1\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapimodule\"\n\t\"github.com/bufbuild/buf/private/pkg/cache\"\n)\n\n// v1ProtoModuleProvider provides a per-call provider of proto Modules.\n//\n// We don't want to persist these across calls - this could grow over time and this cache\n// isn't an LRU cache, and the information also may change over time.\ntype v1ProtoModuleProvider struct {\n\tlogger               *slog.Logger\n\tmoduleClientProvider bufregistryapimodule.V1ModuleServiceClientProvider\n\tprotoModuleCache     cache.Cache[string, *modulev1.Module]\n}\n\nfunc newV1ProtoModuleProvider(\n\tlogger *slog.Logger,\n\tmoduleClientProvider bufregistryapimodule.V1ModuleServiceClientProvider,\n) *v1ProtoModuleProvider {\n\treturn &v1ProtoModuleProvider{\n\t\tlogger:               logger,\n\t\tmoduleClientProvider: moduleClientProvider,\n\t}\n}\n\nfunc (a *v1ProtoModuleProvider) getV1ProtoModuleForProtoModuleID(\n\tctx context.Context,\n\tregistry string,\n\t// Dashless\n\tprotoModuleID string,\n) (*modulev1.Module, error) {\n\treturn a.protoModuleCache.GetOrAdd(\n\t\tregistry+\"/\"+protoModuleID,\n\t\tfunc() (*modulev1.Module, error) {\n\t\t\tresponse, err := a.moduleClientProvider.V1ModuleServiceClient(registry).GetModules(\n\t\t\t\tctx,\n\t\t\t\tconnect.NewRequest(\n\t\t\t\t\t&modulev1.GetModulesRequest{\n\t\t\t\t\t\tModuleRefs: []*modulev1.ModuleRef{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tValue: &modulev1.ModuleRef_Id{\n\t\t\t\t\t\t\t\t\tId: protoModuleID,\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\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(response.Msg.Modules) != 1 {\n\t\t\t\treturn nil, fmt.Errorf(\"expected 1 Module, got %d\", len(response.Msg.Modules))\n\t\t\t}\n\t\t\treturn response.Msg.Modules[0], nil\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduleapi/v1_proto_owner_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduleapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiowner\"\n\t\"github.com/bufbuild/buf/private/pkg/cache\"\n)\n\n// v1ProtoOwnerProvider provides a per-call provider of proto Modules.\n//\n// We don't want to persist these across calls - this could grow over time and this cache\n// isn't an LRU cache, and the information also may change over time.\ntype v1ProtoOwnerProvider struct {\n\tlogger              *slog.Logger\n\townerClientProvider bufregistryapiowner.V1OwnerServiceClientProvider\n\tprotoOwnerCache     cache.Cache[string, *ownerv1.Owner]\n}\n\nfunc newV1ProtoOwnerProvider(\n\tlogger *slog.Logger,\n\townerClientProvider bufregistryapiowner.V1OwnerServiceClientProvider,\n) *v1ProtoOwnerProvider {\n\treturn &v1ProtoOwnerProvider{\n\t\tlogger:              logger,\n\t\townerClientProvider: ownerClientProvider,\n\t}\n}\n\nfunc (a *v1ProtoOwnerProvider) getV1ProtoOwnerForProtoOwnerID(\n\tctx context.Context,\n\tregistry string,\n\t// Dashless\n\tprotoOwnerID string,\n) (*ownerv1.Owner, error) {\n\treturn a.protoOwnerCache.GetOrAdd(\n\t\tregistry+\"/\"+protoOwnerID,\n\t\tfunc() (*ownerv1.Owner, error) {\n\t\t\tresponse, err := a.ownerClientProvider.V1OwnerServiceClient(registry).GetOwners(\n\t\t\t\tctx,\n\t\t\t\tconnect.NewRequest(\n\t\t\t\t\t&ownerv1.GetOwnersRequest{\n\t\t\t\t\t\tOwnerRefs: []*ownerv1.OwnerRef{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tValue: &ownerv1.OwnerRef_Id{\n\t\t\t\t\t\t\t\t\tId: protoOwnerID,\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\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(response.Msg.Owners) != 1 {\n\t\t\t\treturn nil, fmt.Errorf(\"expected 1 Owner, got %d\", len(response.Msg.Owners))\n\t\t\t}\n\t\t\treturn response.Msg.Owners[0], nil\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulecache/base_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulecache\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\t\"sync/atomic\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\ntype baseProvider[K any, V any] struct {\n\tlogger                   *slog.Logger\n\tdelegateGetValuesForKeys func(context.Context, []K) ([]V, error)\n\tstoreGetValuesForKeys    func(context.Context, []K) ([]V, []K, error)\n\tstorePutValues           func(context.Context, []V) error\n\tkeyToCommitID            func(K) uuid.UUID\n\tvalueToCommitID          func(V) uuid.UUID\n\n\tkeysRetrieved atomic.Int64\n\tkeysHit       atomic.Int64\n}\n\nfunc newBaseProvider[K any, V any](\n\tlogger *slog.Logger,\n\tdelegateGetValuesForKeys func(context.Context, []K) ([]V, error),\n\tstoreGetValuesForKeys func(context.Context, []K) ([]V, []K, error),\n\tstorePutValues func(context.Context, []V) error,\n\tkeyToCommitID func(K) uuid.UUID,\n\tvalueToCommitID func(V) uuid.UUID,\n) *baseProvider[K, V] {\n\treturn &baseProvider[K, V]{\n\t\tlogger:                   logger,\n\t\tdelegateGetValuesForKeys: delegateGetValuesForKeys,\n\t\tstoreGetValuesForKeys:    storeGetValuesForKeys,\n\t\tstorePutValues:           storePutValues,\n\t\tkeyToCommitID:            keyToCommitID,\n\t\tvalueToCommitID:          valueToCommitID,\n\t}\n}\n\nfunc (p *baseProvider[K, V]) getValuesForKeys(ctx context.Context, keys []K) ([]V, error) {\n\tcommitIDToIndexedKey, err := xslices.ToUniqueIndexedValuesMap(\n\t\tkeys,\n\t\tp.keyToCommitID,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfoundValues, notFoundKeys, err := p.storeGetValuesForKeys(ctx, keys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdelegateValues, err := p.delegateGetValuesForKeys(\n\t\tctx,\n\t\tnotFoundKeys,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := p.storePutValues(\n\t\tctx,\n\t\tdelegateValues,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\t// We are getting the values again so that we retrieve the values from the cache directly.\n\t// This matters for ie ModuleDatas where the storage.Bucket attached will have local paths\n\t// instead of empty local paths if read from the cache. We document NewModuleDataProvider\n\t// to return a ModuleDataProvider that will always have local paths for returned storage.Buckets,\n\t// if the cache is an on-disk cache.\n\tvar delegateNotFoundKeys []K\n\tdelegateValues, delegateNotFoundKeys, err = p.storeGetValuesForKeys(ctx, notFoundKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// We need to ensure that all the delegate values can be retrieved from the store. If there\n\t// are unfound keys, we return an error.\n\tif len(delegateNotFoundKeys) > 0 {\n\t\treturn nil, syserror.Newf(\n\t\t\t\"delegate keys %v not found in the store after putting in the store\",\n\t\t\tdelegateNotFoundKeys,\n\t\t)\n\t}\n\n\tp.keysRetrieved.Add(int64(len(keys)))\n\tp.keysHit.Add(int64(len(foundValues)))\n\n\tindexedValues, err := xslices.MapError(\n\t\tappend(foundValues, delegateValues...),\n\t\tfunc(value V) (xslices.Indexed[V], error) {\n\t\t\tcommitID := p.valueToCommitID(value)\n\t\t\tindexedKey, ok := commitIDToIndexedKey[commitID]\n\t\t\tif !ok {\n\t\t\t\treturn xslices.Indexed[V]{}, syserror.Newf(\"did not get value from store with commitID %q\", uuidutil.ToDashless(commitID))\n\t\t\t}\n\t\t\treturn xslices.Indexed[V]{\n\t\t\t\tValue: value,\n\t\t\t\tIndex: indexedKey.Index,\n\t\t\t}, nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.IndexedToSortedValues(indexedValues), nil\n}\n\nfunc (p *baseProvider[K, V]) getKeysRetrieved() int {\n\treturn int(p.keysRetrieved.Load())\n}\n\nfunc (p *baseProvider[K, V]) getKeysHit() int {\n\treturn int(p.keysHit.Load())\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulecache/bufmodulecache.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulecache\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulecache/bufmodulecache_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulecache\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestore\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/filelock\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCommitProviderForModuleKeyBasic(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\tbsrProvider, moduleKeys := testGetBSRProviderAndModuleKeys(t, ctx)\n\tlogger := slogtestext.NewLogger(t)\n\n\tcacheProvider := newCommitProvider(\n\t\tlogger,\n\t\tbsrProvider,\n\t\tbufmodulestore.NewCommitStore(\n\t\t\tlogger,\n\t\t\tstoragemem.NewReadWriteBucket(),\n\t\t\tfilelock.NewNopLocker(),\n\t\t),\n\t)\n\n\tcommits, err := cacheProvider.GetCommitsForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 3, cacheProvider.byModuleKey.getKeysRetrieved())\n\trequire.Equal(t, 0, cacheProvider.byModuleKey.getKeysHit())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\txslices.Map(\n\t\t\tcommits,\n\t\t\tfunc(commit bufmodule.Commit) string {\n\t\t\t\treturn commit.ModuleKey().FullName().String()\n\t\t\t},\n\t\t),\n\t)\n\n\tmoduleKeys[0], moduleKeys[1] = moduleKeys[1], moduleKeys[0]\n\tcommits, err = cacheProvider.GetCommitsForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 6, cacheProvider.byModuleKey.getKeysRetrieved())\n\trequire.Equal(t, 3, cacheProvider.byModuleKey.getKeysHit())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\txslices.Map(\n\t\t\tcommits,\n\t\t\tfunc(commit bufmodule.Commit) string {\n\t\t\t\treturn commit.ModuleKey().FullName().String()\n\t\t\t},\n\t\t),\n\t)\n}\n\nfunc TestCommitProviderForCommitKeyBasic(t *testing.T) {\n\tt.Parallel()\n\n\tctx := t.Context()\n\n\tbsrProvider, moduleKeys := testGetBSRProviderAndModuleKeys(t, ctx)\n\tlogger := slogtestext.NewLogger(t)\n\tcommitKeys, err := xslices.MapError(moduleKeys, bufmodule.ModuleKeyToCommitKey)\n\trequire.NoError(t, err)\n\n\tcacheProvider := newCommitProvider(\n\t\tlogger,\n\t\tbsrProvider,\n\t\tbufmodulestore.NewCommitStore(\n\t\t\tlogger,\n\t\t\tstoragemem.NewReadWriteBucket(),\n\t\t\tfilelock.NewNopLocker(),\n\t\t),\n\t)\n\n\tcommits, err := cacheProvider.GetCommitsForCommitKeys(\n\t\tctx,\n\t\tcommitKeys,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 3, cacheProvider.byCommitKey.getKeysRetrieved())\n\trequire.Equal(t, 0, cacheProvider.byCommitKey.getKeysHit())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\txslices.Map(\n\t\t\tcommits,\n\t\t\tfunc(commit bufmodule.Commit) string {\n\t\t\t\treturn commit.ModuleKey().FullName().String()\n\t\t\t},\n\t\t),\n\t)\n\n\tcommitKeys[0], commitKeys[1] = commitKeys[1], commitKeys[0]\n\tcommits, err = cacheProvider.GetCommitsForCommitKeys(\n\t\tctx,\n\t\tcommitKeys,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 6, cacheProvider.byCommitKey.getKeysRetrieved())\n\trequire.Equal(t, 3, cacheProvider.byCommitKey.getKeysHit())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\txslices.Map(\n\t\t\tcommits,\n\t\t\tfunc(commit bufmodule.Commit) string {\n\t\t\t\treturn commit.ModuleKey().FullName().String()\n\t\t\t},\n\t\t),\n\t)\n}\n\nfunc TestModuleDataProviderBasic(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\n\tbsrProvider, moduleKeys := testGetBSRProviderAndModuleKeys(t, ctx)\n\tlogger := slogtestext.NewLogger(t)\n\n\tcacheProvider := newModuleDataProvider(\n\t\tlogger,\n\t\tbsrProvider,\n\t\tbufmodulestore.NewModuleDataStore(\n\t\t\tlogger,\n\t\t\tstoragemem.NewReadWriteBucket(),\n\t\t\tfilelock.NewNopLocker(),\n\t\t),\n\t)\n\n\tmoduleDatas, err := cacheProvider.GetModuleDatasForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 3, cacheProvider.getKeysRetrieved())\n\trequire.Equal(t, 0, cacheProvider.getKeysHit())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\txslices.Map(\n\t\t\tmoduleDatas,\n\t\t\tfunc(moduleData bufmodule.ModuleData) string {\n\t\t\t\treturn moduleData.ModuleKey().FullName().String()\n\t\t\t},\n\t\t),\n\t)\n\n\tmoduleKeys[0], moduleKeys[1] = moduleKeys[1], moduleKeys[0]\n\tmoduleDatas, err = cacheProvider.GetModuleDatasForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 6, cacheProvider.getKeysRetrieved())\n\trequire.Equal(t, 3, cacheProvider.getKeysHit())\n\trequire.Equal(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\txslices.Map(\n\t\t\tmoduleDatas,\n\t\t\tfunc(moduleData bufmodule.ModuleData) string {\n\t\t\t\treturn moduleData.ModuleKey().FullName().String()\n\t\t\t},\n\t\t),\n\t)\n}\n\nfunc TestConcurrentCacheReadWrite(t *testing.T) {\n\tt.Parallel()\n\n\tbsrProvider, moduleKeys := testGetBSRProviderAndModuleKeys(t, t.Context())\n\ttempDir := t.TempDir()\n\tcacheDir := filepath.Join(tempDir, \"cache\")\n\tlogger := slogtestext.NewLogger(t)\n\n\tfor range 20 {\n\t\trequire.NoError(t, os.MkdirAll(cacheDir, 0755))\n\t\tjobs, err := xslices.MapError(\n\t\t\t[]int{0, 1, 2, 3, 4},\n\t\t\tfunc(i int) (func(ctx context.Context) error, error) {\n\t\t\t\tbucket, err := storageos.NewProvider().NewReadWriteBucket(cacheDir)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tfilelocker, err := filelock.NewLocker(\n\t\t\t\t\tcacheDir,\n\t\t\t\t\tfilelock.LockerWithLockRetryDelay(10*time.Millisecond), // Drops test time from ~16s to ~1s\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\tcacheProvider := newModuleDataProvider(\n\t\t\t\t\tlogger,\n\t\t\t\t\tbsrProvider,\n\t\t\t\t\tbufmodulestore.NewModuleDataStore(\n\t\t\t\t\t\tlogger,\n\t\t\t\t\t\tbucket,\n\t\t\t\t\t\tfilelocker,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\treturn func(ctx context.Context) error {\n\t\t\t\t\tmoduleDatas, err := cacheProvider.GetModuleDatasForModuleKeys(\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\tmoduleKeys,\n\t\t\t\t\t)\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\tfor _, moduleData := range moduleDatas {\n\t\t\t\t\t\t// Calling moduleData.Bucket() checks the digest\n\t\t\t\t\t\tif _, err := moduleData.Bucket(); err != nil {\n\t\t\t\t\t\t\treturn err\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn nil\n\t\t\t\t}, nil\n\t\t\t},\n\t\t)\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, thread.Parallelize(t.Context(), jobs))\n\t\trequire.NoError(t, os.RemoveAll(cacheDir))\n\t}\n}\n\nfunc testGetBSRProviderAndModuleKeys(t *testing.T, ctx context.Context) (bufmoduletesting.OmniProvider, []bufmodule.ModuleKey) {\n\tbsrProvider, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod1\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod1.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package mod1;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod2\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod2.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package mod2; import \"mod1.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod3\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod3a.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package mod3;`,\n\t\t\t\t),\n\t\t\t\t\"mod3b.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package mod3;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\tmoduleRefMod1, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod1\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefMod2, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod2\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefMod3, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod3\", \"\")\n\trequire.NoError(t, err)\n\tmoduleKeys, err := bsrProvider.GetModuleKeysForModuleRefs(\n\t\tctx,\n\t\t[]bufparse.Ref{\n\t\t\tmoduleRefMod1,\n\t\t\t// Switching order on purpose.\n\t\t\tmoduleRefMod3,\n\t\t\tmoduleRefMod2,\n\t\t},\n\t\tbufmodule.DigestTypeB5,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 3, len(moduleKeys))\n\treturn bsrProvider, moduleKeys\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulecache/commit_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulecache\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestore\"\n\t\"github.com/google/uuid\"\n)\n\n// NewCommitProvider returns a new CommitProvider that caches the results of the delegate.\n//\n// The CommitStore is used as a cache.\nfunc NewCommitProvider(\n\tlogger *slog.Logger,\n\tdelegate bufmodule.CommitProvider,\n\tstore bufmodulestore.CommitStore,\n) bufmodule.CommitProvider {\n\treturn newCommitProvider(logger, delegate, store)\n}\n\n/// *** PRIVATE ***\n\ntype commitProvider struct {\n\tbyModuleKey *baseProvider[bufmodule.ModuleKey, bufmodule.Commit]\n\tbyCommitKey *baseProvider[bufmodule.CommitKey, bufmodule.Commit]\n}\n\nfunc newCommitProvider(\n\tlogger *slog.Logger,\n\tdelegate bufmodule.CommitProvider,\n\tstore bufmodulestore.CommitStore,\n) *commitProvider {\n\treturn &commitProvider{\n\t\tbyModuleKey: newBaseProvider(\n\t\t\tlogger,\n\t\t\tdelegate.GetCommitsForModuleKeys,\n\t\t\tstore.GetCommitsForModuleKeys,\n\t\t\tstore.PutCommits,\n\t\t\tbufmodule.ModuleKey.CommitID,\n\t\t\tfunc(commit bufmodule.Commit) uuid.UUID {\n\t\t\t\treturn commit.ModuleKey().CommitID()\n\t\t\t},\n\t\t),\n\t\tbyCommitKey: newBaseProvider(\n\t\t\tlogger,\n\t\t\tdelegate.GetCommitsForCommitKeys,\n\t\t\tstore.GetCommitsForCommitKeys,\n\t\t\tstore.PutCommits,\n\t\t\tbufmodule.CommitKey.CommitID,\n\t\t\tfunc(commit bufmodule.Commit) uuid.UUID {\n\t\t\t\treturn commit.ModuleKey().CommitID()\n\t\t\t},\n\t\t),\n\t}\n}\n\nfunc (p *commitProvider) GetCommitsForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.Commit, error) {\n\treturn p.byModuleKey.getValuesForKeys(ctx, moduleKeys)\n}\n\nfunc (p *commitProvider) GetCommitsForCommitKeys(\n\tctx context.Context,\n\tcommitKeys []bufmodule.CommitKey,\n) ([]bufmodule.Commit, error) {\n\treturn p.byCommitKey.getValuesForKeys(ctx, commitKeys)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulecache/module_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulecache\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestore\"\n\t\"github.com/google/uuid\"\n)\n\n// NewModuleDataProvider returns a new ModuleDataProvider that caches the results of the delegate.\n//\n// The ModuleDataStore is used as a cache.\n//\n// All files in returned [storage.Bucket]s will have local paths if the cache is on-disk.\nfunc NewModuleDataProvider(\n\tlogger *slog.Logger,\n\tdelegate bufmodule.ModuleDataProvider,\n\tstore bufmodulestore.ModuleDataStore,\n) bufmodule.ModuleDataProvider {\n\treturn newModuleDataProvider(logger, delegate, store)\n}\n\n/// *** PRIVATE ***\n\ntype moduleDataProvider struct {\n\t*baseProvider[bufmodule.ModuleKey, bufmodule.ModuleData]\n}\n\nfunc newModuleDataProvider(\n\tlogger *slog.Logger,\n\tdelegate bufmodule.ModuleDataProvider,\n\tstore bufmodulestore.ModuleDataStore,\n) *moduleDataProvider {\n\treturn &moduleDataProvider{\n\t\tbaseProvider: newBaseProvider(\n\t\t\tlogger,\n\t\t\tdelegate.GetModuleDatasForModuleKeys,\n\t\t\tstore.GetModuleDatasForModuleKeys,\n\t\t\tstore.PutModuleDatas,\n\t\t\tbufmodule.ModuleKey.CommitID,\n\t\t\tfunc(moduleData bufmodule.ModuleData) uuid.UUID {\n\t\t\t\treturn moduleData.ModuleKey().CommitID()\n\t\t\t},\n\t\t),\n\t}\n}\n\nfunc (p *moduleDataProvider) GetModuleDatasForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.ModuleData, error) {\n\treturn p.baseProvider.getValuesForKeys(ctx, moduleKeys)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulecache/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufmodulecache\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduledebug/bufmoduledebug.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduledebug\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/indent\"\n)\n\n// ModuleSetDebugString gets a debug string with ModuleSet information.\n//\n// This can be printed to stderr, debug logged, etc, while debugging.\nfunc ModuleSetDebugString(ctx context.Context, moduleSet bufmodule.ModuleSet) (string, error) {\n\tprinter := indent.NewPrinter(\"  \")\n\tprinter.Pf(\"module_set:\")\n\tprinter.In()\n\tfor _, module := range moduleSet.Modules() {\n\t\tif err := printModule(ctx, printer, module); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t}\n\tprinter.Out()\n\treturn printer.String()\n}\n\n// ModuleDebugString gets a debug string with Module information.\n//\n// This can be printed to stderr, debug logged, etc, while debugging.\nfunc ModuleDebugString(ctx context.Context, module bufmodule.Module) (string, error) {\n\tprinter := indent.NewPrinter(\"  \")\n\tif err := printModule(ctx, printer, module); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn printer.String()\n}\n\n// ModuleReadBucketDebugString gets a debug string with ModuleReadBucket information.\n//\n// This can be printed to stderr, debug logged, etc, while debugging.\nfunc ModuleReadBucketDebugString(ctx context.Context, moduleReadBucket bufmodule.ModuleReadBucket) (string, error) {\n\tprinter := indent.NewPrinter(\"  \")\n\tprinter.Pf(\"module_read_bucket:\")\n\tprinter.In()\n\tfileInfos, err := bufmodule.GetFileInfos(ctx, moduleReadBucket)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tprinter.P(\"files:\")\n\tprinter.In()\n\tfor _, fileInfo := range fileInfos {\n\t\tprinter.Pf(\"%s:\", fileInfo.Path())\n\t\tprinter.In()\n\t\tprinter.Pf(\"target: %v\", fileInfo.IsTargetFile())\n\t\tprinter.Pf(\"external_path: %s\", fileInfo.ExternalPath())\n\t\tprinter.Out()\n\t}\n\tprinter.Out()\n\tprinter.Out()\n\treturn printer.String()\n}\n\nfunc printModule(ctx context.Context, printer indent.Printer, module bufmodule.Module) error {\n\tfileInfos, err := bufmodule.GetFileInfos(ctx, module)\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleDeps, err := module.ModuleDeps()\n\tif err != nil {\n\t\treturn err\n\t}\n\tprinter.P(\"module:\")\n\tprinter.In()\n\tprinter.Pf(\"name: %s\", module.OpaqueID())\n\tprinter.Pf(\"target: %v\", module.IsTarget())\n\tprinter.Pf(\"local: %v\", module.IsLocal())\n\tprinter.P(\"deps:\")\n\tprinter.In()\n\tfor _, moduleDep := range moduleDeps {\n\t\tprinter.Pf(\"name:\", moduleDep.OpaqueID())\n\t\tprinter.Pf(\"direct: %v\", moduleDep.IsDirect())\n\t}\n\tprinter.Out()\n\tprinter.P(\"files:\")\n\tprinter.In()\n\tfor _, fileInfo := range fileInfos {\n\t\tprinter.Pf(\"%s:\", fileInfo.Path())\n\t\tprinter.In()\n\t\tprinter.Pf(\"target: %v\", fileInfo.IsTargetFile())\n\t\tprinter.Pf(\"external_path: %s\", fileInfo.ExternalPath())\n\t\tprinter.Out()\n\t}\n\tprinter.Out()\n\tprinter.Out()\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduledebug/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufmoduledebug\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulestore/bufmodulestore.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulestore\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulestore/commit_store.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulestore\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"time\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/filelock\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\nvar (\n\texternalCommitVersion     = \"v1\"\n\texternalCommitLockFileExt = \".lock\"\n)\n\n// CommitStore reads and writes Commits.\ntype CommitStore interface {\n\t// GetCommitsForModuleKeys gets the Commits from the store for the ModuleKeys.\n\t//\n\t// Returns the found Commits, and the input IDs that were not found, each\n\t// ordered by the order of the input IDs.\n\tGetCommitsForModuleKeys(ctx context.Context, moduleKeys []bufmodule.ModuleKey) (\n\t\tfoundCommits []bufmodule.Commit,\n\t\tnotFoundModuleKeys []bufmodule.ModuleKey,\n\t\terr error,\n\t)\n\t// GetCommitsForCommitKeys gets the Commits from the store for the CommitKeys.\n\t//\n\t// Returns the found Commits, and the input IDs that were not found, each\n\t// ordered by the order of the input IDs.\n\tGetCommitsForCommitKeys(ctx context.Context, commitKeys []bufmodule.CommitKey) (\n\t\tfoundCommits []bufmodule.Commit,\n\t\tnotFoundCommitKeys []bufmodule.CommitKey,\n\t\terr error,\n\t)\n\t// PutCommits puts the Commits to the store.\n\tPutCommits(ctx context.Context, commits []bufmodule.Commit) error\n}\n\n// NewCommitStore returns a new CommitStore for the given bucket.\n//\n// It is assumed that the CommitStore has complete control of the bucket.\n//\n// This is typically used to interact with a cache directory.\nfunc NewCommitStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n\tlocker filelock.Locker,\n) CommitStore {\n\treturn newCommitStore(logger, bucket, locker)\n}\n\n/// *** PRIVATE ***\n\ntype commitStore struct {\n\tlogger *slog.Logger\n\tbucket storage.ReadWriteBucket\n\tlocker filelock.Locker\n}\n\nfunc newCommitStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n\tlocker filelock.Locker,\n) *commitStore {\n\treturn &commitStore{\n\t\tlogger: logger,\n\t\tbucket: bucket,\n\t\tlocker: locker,\n\t}\n}\n\nfunc (p *commitStore) GetCommitsForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.Commit, []bufmodule.ModuleKey, error) {\n\tvar foundCommits []bufmodule.Commit\n\tvar notFoundModuleKeys []bufmodule.ModuleKey\n\tfor _, moduleKey := range moduleKeys {\n\t\texpectedDigest, err := moduleKey.Digest()\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tcommitKey, err := bufmodule.ModuleKeyToCommitKey(moduleKey)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tcommit, err := p.getCommitForCommitKey(ctx, commitKey, expectedDigest)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tnotFoundModuleKeys = append(notFoundModuleKeys, moduleKey)\n\t\t} else {\n\t\t\tfoundCommits = append(foundCommits, commit)\n\t\t}\n\t}\n\treturn foundCommits, notFoundModuleKeys, nil\n}\n\nfunc (p *commitStore) GetCommitsForCommitKeys(\n\tctx context.Context,\n\tcommitKeys []bufmodule.CommitKey,\n) ([]bufmodule.Commit, []bufmodule.CommitKey, error) {\n\tvar foundCommits []bufmodule.Commit\n\tvar notFoundCommitKeys []bufmodule.CommitKey\n\tfor _, commitKey := range commitKeys {\n\t\tcommit, err := p.getCommitForCommitKey(ctx, commitKey, nil)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tnotFoundCommitKeys = append(notFoundCommitKeys, commitKey)\n\t\t} else {\n\t\t\tfoundCommits = append(foundCommits, commit)\n\t\t}\n\t}\n\treturn foundCommits, notFoundCommitKeys, nil\n}\n\nfunc (p *commitStore) PutCommits(\n\tctx context.Context,\n\tcommits []bufmodule.Commit,\n) error {\n\tfor _, commit := range commits {\n\t\tif err := p.putCommit(ctx, commit); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (p *commitStore) getCommitForCommitKey(\n\tctx context.Context,\n\tcommitKey bufmodule.CommitKey,\n\t// may be nil\n\texpectedDigest bufmodule.Digest,\n) (_ bufmodule.Commit, retErr error) {\n\tbucket := p.getReadWriteBucketForDir(ctx, commitKey)\n\tpath := getCommitStoreFilePath(commitKey)\n\tregistryLockPath := getCommitStoreLockPath(commitKey)\n\tdata, err := p.readCommitData(ctx, bucket, path, registryLockPath)\n\tp.logDebugCommitKey(\n\t\tctx,\n\t\tcommitKey,\n\t\t\"commit store get file\",\n\t\tslog.Bool(\"found\", err == nil),\n\t\txslog.ErrorAttr(err),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar invalidReason string\n\tdefer func() {\n\t\tif retErr != nil {\n\t\t\tretErr = p.deleteInvalidCommitFile(ctx, commitKey, bucket, path, invalidReason, retErr)\n\t\t}\n\t}()\n\tvar externalCommit externalCommit\n\tif err := json.Unmarshal(data, &externalCommit); err != nil {\n\t\tinvalidReason = \"corrupted\"\n\t\treturn nil, err\n\t}\n\tif !externalCommit.isValid() {\n\t\tinvalidReason = \"invalid\"\n\t\treturn nil, fmt.Errorf(\"invalid commit cache entry for %s\", path)\n\t}\n\tdigest, err := bufmodule.ParseDigest(externalCommit.Digest)\n\tif err != nil {\n\t\tinvalidReason = \"invalid digest\"\n\t\treturn nil, err\n\t}\n\tif commitKey.DigestType() != digest.Type() {\n\t\tinvalidReason = \"mismatched digest type\"\n\t\treturn nil, fmt.Errorf(\"mismatched digest type for %s: got %s, expected %s\", path, digest.Type(), commitKey.DigestType())\n\t}\n\tmoduleFullName, err := bufparse.NewFullName(\n\t\tcommitKey.Registry(),\n\t\texternalCommit.Owner,\n\t\texternalCommit.Module,\n\t)\n\tif err != nil {\n\t\tinvalidReason = \"invalid module name\"\n\t\treturn nil, err\n\t}\n\tmoduleKey, err := bufmodule.NewModuleKey(\n\t\tmoduleFullName,\n\t\tcommitKey.CommitID(),\n\t\tfunc() (bufmodule.Digest, error) {\n\t\t\treturn digest, nil\n\t\t},\n\t)\n\tif err != nil {\n\t\tinvalidReason = \"invalid module key\"\n\t\treturn nil, err\n\t}\n\treturn bufmodule.NewCommit(\n\t\tmoduleKey,\n\t\tfunc() (time.Time, error) {\n\t\t\treturn externalCommit.CreateTime, nil\n\t\t},\n\t\tbufmodule.CommitWithExpectedDigest(expectedDigest),\n\t), nil\n}\n\nfunc (p *commitStore) putCommit(\n\tctx context.Context,\n\tcommit bufmodule.Commit,\n) (retErr error) {\n\tcreateTime, err := commit.CreateTime()\n\tif err != nil {\n\t\treturn err\n\t}\n\tmoduleKey := commit.ModuleKey()\n\tdigest, err := moduleKey.Digest()\n\tif err != nil {\n\t\treturn err\n\t}\n\tcommitKey, err := bufmodule.ModuleKeyToCommitKey(moduleKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbucket := p.getReadWriteBucketForDir(ctx, commitKey)\n\tpath := getCommitStoreFilePath(commitKey)\n\tregistryLockPath := getCommitStoreLockPath(commitKey)\n\t// Check if the commit already exists under a shared lock before acquiring\n\t// an exclusive lock.\n\texists, err := p.commitExistsUnderRLock(ctx, bucket, path, registryLockPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif exists {\n\t\treturn nil\n\t}\n\tunlocker, err := p.locker.Lock(ctx, registryLockPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, unlocker.Unlock())\n\t}()\n\t// Re-check after acquiring the exclusive lock, as another process may have\n\t// written the commit between releasing the shared lock and acquiring the\n\t// exclusive lock.\n\tif _, err := bucket.Stat(ctx, path); err == nil {\n\t\treturn nil\n\t}\n\texternalCommit := externalCommit{\n\t\tVersion:    externalCommitVersion,\n\t\tOwner:      moduleKey.FullName().Owner(),\n\t\tModule:     moduleKey.FullName().Name(),\n\t\tCreateTime: createTime,\n\t\tDigest:     digest.String(),\n\t}\n\tif !externalCommit.isValid() {\n\t\treturn syserror.Newf(\"external commit is invalid: %+v\", externalCommit)\n\t}\n\tdata, err := json.Marshal(externalCommit)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn storage.PutPath(ctx, bucket, path, data, storage.PutWithAtomic())\n}\n\nfunc (p *commitStore) getReadWriteBucketForDir(ctx context.Context, commitKey bufmodule.CommitKey) storage.ReadWriteBucket {\n\tdirPath := getCommitStoreDirPath(commitKey)\n\tp.logDebugCommitKey(\n\t\tctx,\n\t\tcommitKey,\n\t\t\"commit store dir read write bucket\",\n\t\tslog.String(\"dirPath\", dirPath),\n\t)\n\treturn storage.MapReadWriteBucket(p.bucket, storage.MapOnPrefix(dirPath))\n}\n\nfunc (p *commitStore) readCommitData(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tpath string,\n\tregistryLockPath string,\n) (_ []byte, retErr error) {\n\tunlocker, err := p.locker.RLock(ctx, registryLockPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, unlocker.Unlock())\n\t}()\n\treturn storage.ReadPath(ctx, bucket, path)\n}\n\nfunc (p *commitStore) commitExistsUnderRLock(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tpath string,\n\tregistryLockPath string,\n) (_ bool, retErr error) {\n\tunlocker, err := p.locker.RLock(ctx, registryLockPath)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, unlocker.Unlock())\n\t}()\n\tif _, err := bucket.Stat(ctx, path); err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\nfunc (p *commitStore) deleteInvalidCommitFile(\n\tctx context.Context,\n\tcommitKey bufmodule.CommitKey,\n\tbucket storage.WriteBucket,\n\tpath string,\n\tinvalidReason string,\n\tinvalidErr error,\n) error {\n\tp.logDebugCommitKey(\n\t\tctx,\n\t\tcommitKey,\n\t\tfmt.Sprintf(\"commit store %s commit file\", invalidReason),\n\t\tslog.Any(\"error\", invalidErr),\n\t)\n\t// Attempt to delete file as it is missing information.\n\tif err := bucket.Delete(ctx, path); err != nil {\n\t\t// Otherwise ignore error.\n\t\tp.logDebugCommitKey(\n\t\t\tctx,\n\t\t\tcommitKey,\n\t\t\tfmt.Sprintf(\"commit store could not delete %s commit file\", invalidReason),\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t}\n\t// This will act as if the file is not found\n\treturn &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n}\n\nfunc (p *commitStore) logDebugCommitKey(ctx context.Context, commitKey bufmodule.CommitKey, message string, fields ...any) {\n\tlogDebugCommitKey(ctx, p.logger, commitKey, message, fields...)\n}\n\n// Returns the directory path within the store for the Commit.\n//\n// This is \"digestType/registry, i.e. \"b5/buf.build\".\nfunc getCommitStoreDirPath(\n\tcommitKey bufmodule.CommitKey,\n) string {\n\treturn normalpath.Join(\n\t\tcommitKey.DigestType().String(),\n\t\tcommitKey.Registry(),\n\t)\n}\n\n// Returns the file path within the directory.\n//\n// This is \"dashlessCommitID.json\", e.g. the commit \"12345-abcde\" will return \"12345abcde.json\".\nfunc getCommitStoreFilePath(commitKey bufmodule.CommitKey) string {\n\treturn uuidutil.ToDashless(commitKey.CommitID()) + \".json\"\n}\n\n// Returns the lock file path for the commit's registry.\n//\n// This is \"digestType/registry.lock\", e.g. \"shake256/buf.build.lock\".\nfunc getCommitStoreLockPath(commitKey bufmodule.CommitKey) string {\n\treturn normalpath.Join(\n\t\tcommitKey.DigestType().String(),\n\t\tcommitKey.Registry()+externalCommitLockFileExt,\n\t)\n}\n\n// externalCommit is the store representation of a Commit.\n//\n// We could use a protobuf Message for this.\n//\n// Note that we do not want to use registry-proto Commits. This would hard-link the API\n// and persistence layers, and a bufmodule.Commit does not have all the information that\n// a registry-proto Commit has.\ntype externalCommit struct {\n\tVersion    string    `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tOwner      string    `json:\"owner,omitempty\" yaml:\"owner,omitempty\"`\n\tModule     string    `json:\"module,omitempty\" yaml:\"module,omitempty\"`\n\tCreateTime time.Time `json:\"create_time\" yaml:\"create_time,omitempty\"`\n\tDigest     string    `json:\"digest,omitempty\" yaml:\"digest,omitempty\"`\n}\n\n// isValid returns true if all the information we currently expect to be on\n// an externalCommit is present, and the version matches.\n//\n// If we add to externalCommit over time or change the version, old values will be\n// incomplete, and we will auto-evict them from the store.\nfunc (e externalCommit) isValid() bool {\n\treturn e.Version == externalCommitVersion &&\n\t\te.Owner != \"\" &&\n\t\te.Module != \"\" &&\n\t\t!e.CreateTime.IsZero() &&\n\t\te.Digest != \"\"\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulestore/commit_store_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulestore\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/filelock\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCommitStoreBasic(t *testing.T) {\n\tt.Parallel()\n\tbucket := storagemem.NewReadWriteBucket()\n\tlocker := filelock.NewNopLocker()\n\ttestCommitStore(t, bucket, locker)\n}\n\nfunc TestCommitStoreOS(t *testing.T) {\n\tt.Parallel()\n\ttempDir := t.TempDir()\n\tbucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tlocker, err := filelock.NewLocker(tempDir)\n\trequire.NoError(t, err)\n\ttestCommitStore(t, bucket, locker)\n}\n\nfunc TestCommitStoreCorruptedEntry(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"invalid_json\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\ttestCommitStoreCorruptedEntry(\n\t\t\tt,\n\t\t\t[]byte(\"invalid_json\"),\n\t\t)\n\t})\n\tt.Run(\"invalid_fields\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\t// Valid JSON but missing required fields, so isValid() returns false.\n\t\ttestCommitStoreCorruptedEntry(\n\t\t\tt,\n\t\t\t[]byte(`{\"version\":\"v1\",\"owner\":\"\",\"module\":\"mod1\",\"digest\":\"b5:fake\"}`),\n\t\t)\n\t})\n\tt.Run(\"mismatched_digest_type\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\t// Valid JSON with all fields present, but digest type shake256 (B4) does not\n\t\t// match the b5 digest type used by the commit key.\n\t\ttestCommitStoreCorruptedEntry(\n\t\t\tt,\n\t\t\t[]byte(`{\"version\":\"v1\",\"owner\":\"foo\",\"module\":\"mod1\",\"create_time\":\"2024-01-01T00:00:00Z\",\"digest\":\"shake256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789\"}`),\n\t\t)\n\t})\n}\n\nfunc testCommitStoreCorruptedEntry(\n\tt *testing.T,\n\tcorruptData []byte,\n) {\n\tbucket := storagemem.NewReadWriteBucket()\n\tlocker := filelock.NewNopLocker()\n\tctx := t.Context()\n\tlogger := slogtestext.NewLogger(t)\n\tcommitStore := NewCommitStore(logger, bucket, locker)\n\tmoduleKeys, commits := testGetModuleKeysAndCommits(t, ctx)\n\n\terr := commitStore.PutCommits(ctx, commits)\n\trequire.NoError(t, err)\n\n\t// Corrupt the first entry.\n\tcommitKey, err := bufmodule.ModuleKeyToCommitKey(moduleKeys[0])\n\trequire.NoError(t, err)\n\tcorruptPath := normalpath.Join(\n\t\tgetCommitStoreDirPath(commitKey),\n\t\tgetCommitStoreFilePath(commitKey),\n\t)\n\trequire.NoError(t, storage.PutPath(ctx, bucket, corruptPath, corruptData))\n\n\tfoundCommits, notFoundModuleKeys, err := commitStore.GetCommitsForModuleKeys(ctx, moduleKeys)\n\trequire.NoError(t, err)\n\ttestRequireCommitNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tfoundCommits,\n\t)\n\ttestRequireModuleKeyNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t},\n\t\tnotFoundModuleKeys,\n\t)\n}\n\nfunc TestCommitStorePutIdempotent(t *testing.T) {\n\tt.Parallel()\n\tbucket := storagemem.NewReadWriteBucket()\n\tlocker := filelock.NewNopLocker()\n\tctx := t.Context()\n\tlogger := slogtestext.NewLogger(t)\n\tcommitStore := NewCommitStore(logger, bucket, locker)\n\t_, commits := testGetModuleKeysAndCommits(t, ctx)\n\n\t// Put twice -- second put should be a no-op.\n\trequire.NoError(t, commitStore.PutCommits(ctx, commits))\n\trequire.NoError(t, commitStore.PutCommits(ctx, commits))\n}\n\nfunc testCommitStore(\n\tt *testing.T,\n\tbucket storage.ReadWriteBucket,\n\tfilelocker filelock.Locker,\n) {\n\tctx := t.Context()\n\tlogger := slogtestext.NewLogger(t)\n\tcommitStore := NewCommitStore(logger, bucket, filelocker)\n\tmoduleKeys, commits := testGetModuleKeysAndCommits(t, ctx)\n\n\t// Nothing in cache yet.\n\tfoundCommits, notFoundModuleKeys, err := commitStore.GetCommitsForModuleKeys(ctx, moduleKeys)\n\trequire.NoError(t, err)\n\ttestRequireCommitNamesEqual(t, nil, foundCommits)\n\ttestRequireModuleKeyNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tnotFoundModuleKeys,\n\t)\n\n\t// Put commits.\n\terr = commitStore.PutCommits(ctx, commits)\n\trequire.NoError(t, err)\n\n\t// All should be found now via module keys.\n\tfoundCommits, notFoundModuleKeys, err = commitStore.GetCommitsForModuleKeys(ctx, moduleKeys)\n\trequire.NoError(t, err)\n\ttestRequireCommitNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tfoundCommits,\n\t)\n\ttestRequireModuleKeyNamesEqual(t, nil, notFoundModuleKeys)\n\n\t// All should be found via commit keys.\n\tcommitKeys, err := xslices.MapError(moduleKeys, bufmodule.ModuleKeyToCommitKey)\n\trequire.NoError(t, err)\n\tfoundCommits, notFoundCommitKeys, err := commitStore.GetCommitsForCommitKeys(ctx, commitKeys)\n\trequire.NoError(t, err)\n\ttestRequireCommitNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tfoundCommits,\n\t)\n\trequire.Empty(t, notFoundCommitKeys)\n}\n\nfunc testGetModuleKeysAndCommits(t *testing.T, ctx context.Context) ([]bufmodule.ModuleKey, []bufmodule.Commit) {\n\tbsrProvider, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod1\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod1.proto\": []byte(\n\t\t\t\t\t`syntax = \"proto3\"; package mod1;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod2\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod2.proto\": []byte(\n\t\t\t\t\t`syntax = \"proto3\"; package mod2; import \"mod1.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod3\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod3.proto\": []byte(\n\t\t\t\t\t`syntax = \"proto3\"; package mod3;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\tmoduleRefMod1, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod1\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefMod2, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod2\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefMod3, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod3\", \"\")\n\trequire.NoError(t, err)\n\tmoduleKeys, err := bsrProvider.GetModuleKeysForModuleRefs(\n\t\tctx,\n\t\t[]bufparse.Ref{\n\t\t\tmoduleRefMod1,\n\t\t\t// Switching order on purpose.\n\t\t\tmoduleRefMod3,\n\t\t\tmoduleRefMod2,\n\t\t},\n\t\tbufmodule.DigestTypeB5,\n\t)\n\trequire.NoError(t, err)\n\ttestRequireModuleKeyNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tmoduleKeys,\n\t)\n\tcommits, err := bsrProvider.GetCommitsForModuleKeys(ctx, moduleKeys)\n\trequire.NoError(t, err)\n\ttestRequireCommitNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tcommits,\n\t)\n\treturn moduleKeys, commits\n}\n\nfunc testRequireCommitNamesEqual(t *testing.T, expected []string, actual []bufmodule.Commit) {\n\tif len(expected) == 0 {\n\t\trequire.Empty(t, actual)\n\t} else {\n\t\trequire.Equal(\n\t\t\tt,\n\t\t\texpected,\n\t\t\txslices.Map(\n\t\t\t\tactual,\n\t\t\t\tfunc(value bufmodule.Commit) string {\n\t\t\t\t\treturn value.ModuleKey().FullName().String()\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulestore/module_data_store.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulestore\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"log/slog\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/filelock\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\nvar (\n\texternalModuleDataVersion      = \"v1\"\n\texternalModuleDataFileName     = \"module.yaml\"\n\texternalModuleDataFilesDir     = \"files\"\n\texternalModuleDataV1BufYAMLDir = \"v1_buf_yaml\"\n\texternalModuleDataV1BufLockDir = \"v1_buf_lock\"\n\texternalModuleDataLockFileExt  = \".lock\"\n)\n\n// ModuleDatasResult is a result for a get of ModuleDatas.\ntype ModuleDatasResult interface {\n\t// FoundModuleDatas is the ModuleDatas that were found.\n\t//\n\t// Ordered by the order of input ModuleKeys.\n\tFoundModuleDatas() []bufmodule.ModuleData\n\t// NotFoundModuleKeys is the input ModuleKeys that were not found.\n\t//\n\t// Ordered by the order of input ModuleKeys.\n\tNotFoundModuleKeys() []bufmodule.ModuleKey\n\n\tisModuleDatasResult()\n}\n\n// ModuleDataStore reads and writes ModulesDatas.\ntype ModuleDataStore interface {\n\t// GetModuleDatasForModuleKeys gets the ModuleDatas from the store for the ModuleKeys.\n\t//\n\t// Returns the found ModuleDatas, and the input ModuleKeys that were not found, each\n\t// ordered by the order of the input ModuleKeys.\n\tGetModuleDatasForModuleKeys(context.Context, []bufmodule.ModuleKey) (\n\t\tfoundModuleDatas []bufmodule.ModuleData,\n\t\tnotFoundModuleKeys []bufmodule.ModuleKey,\n\t\terr error,\n\t)\n\n\t// PutModuleDatas puts the ModuleDatas to the store.\n\tPutModuleDatas(ctx context.Context, moduleDatas []bufmodule.ModuleData) error\n}\n\n// NewModuleDataStore returns a new ModuleDataStore for the given bucket.\n//\n// It is assumed that the ModuleDataStore has complete control of the bucket.\n//\n// This is typically used to interact with a cache directory.\nfunc NewModuleDataStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n\tlocker filelock.Locker,\n\toptions ...ModuleDataStoreOption,\n) ModuleDataStore {\n\treturn newModuleDataStore(logger, bucket, locker, options...)\n}\n\n// ModuleDataStoreOption is an option for a new ModuleDataStore.\ntype ModuleDataStoreOption func(*moduleDataStore)\n\n// ModuleDataStoreWithTar returns a new ModuleDataStoreOption that reads and stores\n// tar files instead of storing individual files in a directory in the bucket.\n//\n// The default is to store individual files in a directory.\nfunc ModuleDataStoreWithTar() ModuleDataStoreOption {\n\treturn func(moduleDataStore *moduleDataStore) {\n\t\tmoduleDataStore.tar = true\n\t}\n}\n\n/// *** PRIVATE ***\n\ntype moduleDataStore struct {\n\tlogger *slog.Logger\n\tbucket storage.ReadWriteBucket\n\tlocker filelock.Locker\n\n\ttar bool\n}\n\nfunc newModuleDataStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n\tlocker filelock.Locker,\n\toptions ...ModuleDataStoreOption,\n) *moduleDataStore {\n\tmoduleDataStore := &moduleDataStore{\n\t\tlogger: logger,\n\t\tbucket: bucket,\n\t\tlocker: locker,\n\t}\n\tfor _, option := range options {\n\t\toption(moduleDataStore)\n\t}\n\treturn moduleDataStore\n}\n\nfunc (p *moduleDataStore) GetModuleDatasForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.ModuleData, []bufmodule.ModuleKey, error) {\n\tvar foundModuleDatas []bufmodule.ModuleData\n\tvar notFoundModuleKeys []bufmodule.ModuleKey\n\tfor _, moduleKey := range moduleKeys {\n\t\tmoduleData, err := p.getModuleDataForModuleKey(ctx, moduleKey)\n\t\tif err != nil {\n\t\t\t// Any error returned from getModuleDataForModuleKey means that no module data is read\n\t\t\t// from the cache, and is treated as a cache miss so we can fetch new module data and\n\t\t\t// repopulate the cache.\n\t\t\tnotFoundModuleKeys = append(notFoundModuleKeys, moduleKey)\n\t\t} else {\n\t\t\tfoundModuleDatas = append(foundModuleDatas, moduleData)\n\t\t}\n\t}\n\treturn foundModuleDatas, notFoundModuleKeys, nil\n}\n\nfunc (p *moduleDataStore) PutModuleDatas(\n\tctx context.Context,\n\tmoduleDatas []bufmodule.ModuleData,\n) error {\n\tfor _, moduleData := range moduleDatas {\n\t\tif err := p.putModuleData(ctx, moduleData); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// getModuleDataForModuleKey reads the module data for the module key from the cache.\n//\n// If moduleDataStore is configured to store the module data as tarballs, then we read a\n// single tar for all module data stored under the module key.\n//\n// If moduleDataStore is configured to store module data as individual files, then it\n// takes the following steps to read the module data:\n//\n//  1. Acquire a shared lock on the module data lock file for the module key.\n//  2. Attempt to read the module.yaml file for the module key.\n//  3. If no valid module.yaml is present, then return an error and no data is read from\n//     the cache. The module.yaml is always written to the cache last, so we consider valid\n//     module data to be present if module.yaml is present.\n//  4. If a valid module.yaml is found, then attempt to read the module data files from the\n//     cache.\n//  5. If an error occurs while reading the files and/or an invalid config file is found,\n//     then no module data is read from the cache.\n//  6. Once all files have been read from the cache, release the shared lock on the module\n//     data lock file.\n//\n// It is important to note that when we read from the cache, we use the presence and contents\n// of module.yaml to determine if module data exists in the cache. If there is manual intervention\n// that corrupts the contents of the cache, but leaves module.yaml in-tact, then we read\n// the files as valid module data at this layer, and it fails tamper-proofing digest checks\n// when the module data is accessed.\nfunc (p *moduleDataStore) getModuleDataForModuleKey(\n\tctx context.Context,\n\tmoduleKey bufmodule.ModuleKey,\n) (retValue bufmodule.ModuleData, retErr error) {\n\tvar moduleCacheBucket storage.ReadBucket\n\tvar err error\n\tif p.tar {\n\t\tmoduleCacheBucket, err = p.getReadBucketForTar(ctx, moduleKey)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\t// If there is an error fetching the tar bucket that is not because the path does\n\t\t\t\t// not exist, we assume this is corrupted and delete the tar.\n\t\t\t\ttarPath, err := getModuleDataStoreTarPath(moduleKey)\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 err := p.bucket.Delete(ctx, tarPath); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\t// Return a path error indicating the module data was not found\n\t\t\t\treturn nil, &fs.PathError{Op: \"read\", Path: tarPath, Err: fs.ErrNotExist}\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t} else {\n\t\tdirPath, err := getModuleDataStoreDirPath(moduleKey)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tp.logDebugModuleKey(\n\t\t\tctx,\n\t\t\tmoduleKey,\n\t\t\t\"module data store dir read write bucket\",\n\t\t\tslog.String(\"dirPath\", dirPath),\n\t\t)\n\t\tmoduleCacheBucket = storage.MapReadWriteBucket(p.bucket, storage.MapOnPrefix(dirPath))\n\t\tmoduleDataStoreDirLockPath, err := getModuleDataStoreDirLockPath(moduleKey)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Acquire a shared lock for module data lock file for reading module data from the cache.\n\t\tunlocker, err := p.locker.RLock(ctx, moduleDataStoreDirLockPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer func() {\n\t\t\t// Release lock on the module data lock file.\n\t\t\tif err := unlocker.Unlock(); err != nil {\n\t\t\t\tretErr = errors.Join(retErr, err)\n\t\t\t}\n\t\t}()\n\t}\n\t// Attempt to read module.yaml from cache. The module.yaml file is always written last,\n\t// so if a valid module.yaml file is present, then we proceed to read the rest of the\n\t// the module data.\n\tdata, err := storage.ReadPath(ctx, moduleCacheBucket, externalModuleDataFileName)\n\tp.logDebugModuleKey(\n\t\tctx,\n\t\tmoduleKey,\n\t\tfmt.Sprintf(\"module data store get %s\", externalModuleDataFileName),\n\t\tslog.Bool(\"found\", err == nil),\n\t\txslog.ErrorAttr(err),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar externalModuleData externalModuleData\n\tif err := encoding.UnmarshalYAMLNonStrict(data, &externalModuleData); err != nil {\n\t\treturn nil, err\n\t}\n\tif !externalModuleData.isValid() {\n\t\treturn nil, fmt.Errorf(\"invalid %s from cache for %s: %+v\", externalModuleDataFileName, moduleKey.String(), externalModuleData)\n\t}\n\t// A valid module.yaml was found, we proceed to reading module data.\n\n\t// We don't want to do this lazily (or anything else in this function) as we want to\n\t// make sure everything we have is valid before returning so we can auto-correct\n\t// the cache if necessary.\n\tdepModuleKeys, err := xslices.MapError(\n\t\texternalModuleData.Deps,\n\t\tgetDepModuleKeyForExternalModuleDataDep,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar v1BufYAMLObjectData bufmodule.ObjectData\n\tif externalModuleData.V1BufYAMLFile != \"\" {\n\t\t// We do not want to use bufconfig.GetBufYAMLFileForPrefix as this validates the\n\t\t// buf.yaml, and potentially calls out to i.e. resolve digests. We just want to raw data.\n\t\tv1BufYAMLFileData, err := storage.ReadPath(ctx, moduleCacheBucket, externalModuleData.V1BufYAMLFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tv1BufYAMLObjectData, err = bufmodule.NewObjectData(\n\t\t\tnormalpath.Base(externalModuleData.V1BufYAMLFile),\n\t\t\tv1BufYAMLFileData,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar v1BufLockObjectData bufmodule.ObjectData\n\tif externalModuleData.V1BufLockFile != \"\" {\n\t\t// We do not want to use bufconfig.GetBufLockFileForPrefix as this validates the\n\t\t// buf.lock, and potentially calls out to i.e. resolve digests. We just want to raw data.\n\t\tv1BufLockFileData, err := storage.ReadPath(ctx, moduleCacheBucket, externalModuleData.V1BufLockFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tv1BufLockObjectData, err = bufmodule.NewObjectData(\n\t\t\tnormalpath.Base(externalModuleData.V1BufLockFile),\n\t\t\tv1BufLockFileData,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\t// We rely on the module.yaml file being the last file to be written in the store.\n\t// If module.yaml does not exist, we act as if there is no value in the store, which will\n\t// result in bad data being overwritten.\n\treturn bufmodule.NewModuleData(\n\t\tctx,\n\t\tmoduleKey,\n\t\tfunc() (storage.ReadBucket, error) {\n\t\t\treturn storage.StripReadBucketExternalPaths(\n\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\tmoduleCacheBucket,\n\t\t\t\t\tstorage.MapOnPrefix(externalModuleData.FilesDir),\n\t\t\t\t),\n\t\t\t), nil\n\t\t},\n\t\tfunc() ([]bufmodule.ModuleKey, error) {\n\t\t\treturn depModuleKeys, nil\n\t\t},\n\t\tfunc() (bufmodule.ObjectData, error) {\n\t\t\treturn v1BufYAMLObjectData, nil\n\t\t},\n\t\tfunc() (bufmodule.ObjectData, error) {\n\t\t\treturn v1BufLockObjectData, nil\n\t\t},\n\t), nil\n}\n\n// putModuleData puts the module data into the module cache.\n//\n// If moduleDataStore is configured to store the module data as tarballs, then a single tar\n// for all module data is stored under the module key.\n//\n// If moduleDataStore is configured to store individual files, then it takes the following steps:\n//\n//  1. Acquire a shared lock on the module lock file for the module key.\n//  2. Attempt to read the module.yaml file to ensure that there is no valid module already\n//     stored in the cache. The module.yaml file is always written last in the cache, so if\n//     it is present, then valid module data is present, and no new module data is written.\n//  3. If no module.yaml is present, then we release the shared lock and acquire an exclusive\n//     lock on the module lock file for writing module data.\n//  4. Once the exclusive lock is acquired, we do another check to ensure that there is no\n//     module.yaml present. This is because the shared lock is not upgraded to an exclusive\n//     lock, we released the shared lock before acquiring the exclusive lock, so to ensure\n//     there are absolutely no race conditions, we do another check.\n//  5. Once we determine there is no module.yaml present, we proceed to writing the module\n//     data to the cache.\n//  6. We write the module.yaml after we've written all other module data files.\nfunc (p *moduleDataStore) putModuleData(\n\tctx context.Context,\n\tmoduleData bufmodule.ModuleData,\n) (retErr error) {\n\tmoduleKey := moduleData.ModuleKey()\n\tvar moduleCacheBucket storage.ReadWriteBucket\n\tvar err error\n\tif p.tar {\n\t\tvar callback func(ctx context.Context) error\n\t\tmoduleCacheBucket, callback = p.getWriteBucketAndCallbackForTar(moduleKey)\n\t\tdefer func() {\n\t\t\tif retErr == nil {\n\t\t\t\t// Only call the callback if we have had no error.\n\t\t\t\tretErr = errors.Join(retErr, callback(ctx))\n\t\t\t}\n\t\t}()\n\t} else {\n\t\tdirPath, err := getModuleDataStoreDirPath(moduleKey)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tp.logDebugModuleKey(\n\t\t\tctx,\n\t\t\tmoduleKey,\n\t\t\t\"module data store dir read write bucket\",\n\t\t\tslog.String(\"dirPath\", dirPath),\n\t\t)\n\t\tmoduleCacheBucket = storage.MapReadWriteBucket(p.bucket, storage.MapOnPrefix(dirPath))\n\t\tmoduleDataStoreDirLockPath, err := getModuleDataStoreDirLockPath(moduleKey)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Acquire shared lock to check for a valid module.yaml before writing to the module cache.\n\t\treadUnlocker, err := p.locker.RLock(ctx, moduleDataStoreDirLockPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tif readUnlocker != nil {\n\t\t\t\tif err := readUnlocker.Unlock(); err != nil {\n\t\t\t\t\tretErr = errors.Join(retErr, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t\tdata, err := storage.ReadPath(ctx, moduleCacheBucket, externalModuleDataFileName)\n\t\tp.logDebugModuleKey(\n\t\t\tctx,\n\t\t\tmoduleKey,\n\t\t\tfmt.Sprintf(\"module data store put read check %s\", externalModuleDataFileName),\n\t\t\tslog.Bool(\"found\", err == nil),\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn err\n\t\t}\n\t\tif err == nil {\n\t\t\tvar externalModuleData externalModuleData\n\t\t\tif err := encoding.UnmarshalYAMLNonStrict(data, &externalModuleData); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// If a valid module.yaml is present, since module.yaml is always written last, we\n\t\t\t// assume that there is valid module data, and we do not attempt to write new data here.\n\t\t\tif externalModuleData.isValid() {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t\t// Otherwise, release shared lock and set readUnlocker to nil in order to acquire an\n\t\t// exclusive lock for writing module data to the cache. filelock does not allow us to\n\t\t// upgrade the shared lock to an exclusive lock, so we need to release the shared lock\n\t\t// before acquiring an exclusive lock.\n\t\tif readUnlocker != nil {\n\t\t\terr := readUnlocker.Unlock()\n\t\t\treadUnlocker = nil // unset the readUnlocker since we are upgrading the lock\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// Acquire exclusive lock on module lock file for writing module data to the cache.\n\t\tunlocker, err := p.locker.Lock(ctx, moduleDataStoreDirLockPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tif err := unlocker.Unlock(); err != nil {\n\t\t\t\tretErr = errors.Join(retErr, err)\n\t\t\t}\n\t\t}()\n\t\t// Before we start writing module data to the cache, we first check to see if module.yaml\n\t\t// is present again after acquiring the exclusive lock.\n\t\t// This is because the shared lock was released before acquiring the exclusive lock,\n\t\t// and we need to make sure no valid module data was written in the interim.\n\t\tdata, err = storage.ReadPath(ctx, moduleCacheBucket, externalModuleDataFileName)\n\t\tp.logDebugModuleKey(\n\t\t\tctx,\n\t\t\tmoduleKey,\n\t\t\tfmt.Sprintf(\"module data store put check %s\", externalModuleDataFileName),\n\t\t\tslog.Bool(\"found\", err == nil),\n\t\t\txslog.ErrorAttr(err),\n\t\t)\n\t\tif err != nil && !errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn err\n\t\t}\n\t\tif err == nil {\n\t\t\tvar externalModuleData externalModuleData\n\t\t\tif err := encoding.UnmarshalYAMLNonStrict(data, &externalModuleData); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// If a valid module.yaml is present, then we do not overwrite with new data.\n\t\t\tif externalModuleData.isValid() {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t}\n\t}\n\t// Proceed to writing module data.\n\tdepModuleKeys, err := moduleData.DepModuleKeys()\n\tif err != nil {\n\t\treturn err\n\t}\n\texternalModuleData := externalModuleData{\n\t\tVersion: externalModuleDataVersion,\n\t\tDeps:    make([]externalModuleDataDep, len(depModuleKeys)),\n\t}\n\n\tfor i, depModuleKey := range depModuleKeys {\n\t\tdigest, err := depModuleKey.Digest()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texternalModuleData.Deps[i] = externalModuleDataDep{\n\t\t\tName:   depModuleKey.FullName().String(),\n\t\t\tCommit: uuidutil.ToDashless(depModuleKey.CommitID()),\n\t\t\tDigest: digest.String(),\n\t\t}\n\t}\n\n\tfilesBucket, err := moduleData.Bucket()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := storage.Copy(\n\t\tctx,\n\t\tfilesBucket,\n\t\tstorage.MapWriteBucket(moduleCacheBucket, storage.MapOnPrefix(externalModuleDataFilesDir)),\n\t); err != nil {\n\t\treturn err\n\t}\n\texternalModuleData.FilesDir = externalModuleDataFilesDir\n\n\tv1BufYAMLObjectData, err := moduleData.V1Beta1OrV1BufYAMLObjectData()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif v1BufYAMLObjectData != nil {\n\t\tv1BufYAMLFilePath := normalpath.Join(externalModuleDataV1BufYAMLDir, v1BufYAMLObjectData.Name())\n\t\tif err := storage.PutPath(ctx, moduleCacheBucket, v1BufYAMLFilePath, v1BufYAMLObjectData.Data()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\texternalModuleData.V1BufYAMLFile = v1BufYAMLFilePath\n\t}\n\n\tv1BufLockObjectData, err := moduleData.V1Beta1OrV1BufLockObjectData()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif v1BufLockObjectData != nil {\n\t\tv1BufLockFilePath := normalpath.Join(externalModuleDataV1BufLockDir, v1BufLockObjectData.Name())\n\t\tif err := storage.PutPath(ctx, moduleCacheBucket, v1BufLockFilePath, v1BufLockObjectData.Data()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\texternalModuleData.V1BufLockFile = v1BufLockFilePath\n\t}\n\n\tdata, err := encoding.MarshalYAML(externalModuleData)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Put the module.yaml last, so that we only have a module.yaml if the cache is finished writing.\n\t// We can use the existence of the module.yaml file to say whether or not the cache contains a\n\t// given ModuleKey, otherwise we overwrite any contents in the cache.\n\treturn storage.PutPath(\n\t\tctx,\n\t\tmoduleCacheBucket,\n\t\texternalModuleDataFileName,\n\t\tdata,\n\t\tstorage.PutWithAtomic(),\n\t)\n}\n\n// May return fs.ErrNotExist error if tar not found.\nfunc (p *moduleDataStore) getReadBucketForTar(\n\tctx context.Context,\n\tmoduleKey bufmodule.ModuleKey,\n) (_ storage.ReadBucket, retErr error) {\n\ttarPath, err := getModuleDataStoreTarPath(moduleKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tp.logDebugModuleKey(\n\t\t\tctx,\n\t\t\tmoduleKey,\n\t\t\t\"module data store get tar read bucket\",\n\t\t\tslog.String(\"tarPath\", tarPath),\n\t\t\tslog.Bool(\"found\", retErr == nil),\n\t\t\tslog.Any(\"error\", retErr),\n\t\t)\n\t}()\n\treadObjectCloser, err := p.bucket.Get(ctx, tarPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readObjectCloser.Close())\n\t}()\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\tif err := storagearchive.Untar(\n\t\tctx,\n\t\treadObjectCloser,\n\t\treadWriteBucket,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn readWriteBucket, nil\n}\n\nfunc (p *moduleDataStore) getWriteBucketAndCallbackForTar(\n\tmoduleKey bufmodule.ModuleKey,\n) (storage.ReadWriteBucket, func(context.Context) error) {\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\treturn readWriteBucket, func(ctx context.Context) (retErr error) {\n\t\ttarPath, err := getModuleDataStoreTarPath(moduleKey)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tp.logDebugModuleKey(\n\t\t\t\tctx,\n\t\t\t\tmoduleKey,\n\t\t\t\t\"module data store put tar to write bucket\",\n\t\t\t\tslog.String(\"tarPath\", tarPath),\n\t\t\t\tslog.Bool(\"found\", retErr == nil),\n\t\t\t\tslog.Any(\"error\", retErr),\n\t\t\t)\n\t\t}()\n\t\twriteObjectCloser, err := p.bucket.Put(\n\t\t\tctx,\n\t\t\ttarPath,\n\t\t\t// Not needed since single file, but doing for now.\n\t\t\tstorage.PutWithAtomic(),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t\t}()\n\t\treturn storagearchive.Tar(\n\t\t\tctx,\n\t\t\treadWriteBucket,\n\t\t\twriteObjectCloser,\n\t\t)\n\t}\n}\n\nfunc (p *moduleDataStore) logDebugModuleKey(ctx context.Context, moduleKey bufmodule.ModuleKey, message string, fields ...any) {\n\tlogDebugModuleKey(ctx, p.logger, moduleKey, message, fields...)\n}\n\n// Returns the module's path within the store if storing individual files.\n//\n// This is \"digestType/registry/owner/name/dashlessCommitID\",\n// e.g. the module \"buf.build/acme/weather\" with commit \"12345-abcde\" and digest\n// type \"b5\" will return \"b5/buf.build/acme/weather/12345abcde\".\nfunc getModuleDataStoreDirPath(moduleKey bufmodule.ModuleKey) (string, error) {\n\tdigest, err := moduleKey.Digest()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn normalpath.Join(\n\t\tdigest.Type().String(),\n\t\tmoduleKey.FullName().Registry(),\n\t\tmoduleKey.FullName().Owner(),\n\t\tmoduleKey.FullName().Name(),\n\t\tuuidutil.ToDashless(moduleKey.CommitID()),\n\t), nil\n}\n\n// Returns the module's path within the store if storing tar files.\n//\n// This is \"registry/owner/name/dashlessCommitID.tar\",\n// e.g. the module \"buf.build/acme/weather\" with commit \"12345-abcde\" and digest\n// type \"b5\" will return \"b5/buf.build/acme/weather/12345abcde.tar\".\nfunc getModuleDataStoreTarPath(moduleKey bufmodule.ModuleKey) (string, error) {\n\tdigest, err := moduleKey.Digest()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn normalpath.Join(\n\t\tdigest.Type().String(),\n\t\tmoduleKey.FullName().Registry(),\n\t\tmoduleKey.FullName().Owner(),\n\t\tmoduleKey.FullName().Name(),\n\t\tuuidutil.ToDashless(moduleKey.CommitID())+\".tar\",\n\t), nil\n}\n\nfunc getDepModuleKeyForExternalModuleDataDep(dep externalModuleDataDep) (bufmodule.ModuleKey, error) {\n\tif dep.Name == \"\" {\n\t\treturn nil, errors.New(\"no module name specified\")\n\t}\n\tmoduleFullName, err := bufparse.ParseFullName(dep.Name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid module name: %w\", err)\n\t}\n\tif dep.Commit == \"\" {\n\t\treturn nil, fmt.Errorf(\"no commit specified for module %s\", moduleFullName.String())\n\t}\n\tif dep.Digest == \"\" {\n\t\treturn nil, fmt.Errorf(\"no digest specified for module %s\", moduleFullName.String())\n\t}\n\tdigest, err := bufmodule.ParseDigest(dep.Digest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommitID, err := uuidutil.FromDashless(dep.Commit)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmodule.NewModuleKey(\n\t\tmoduleFullName,\n\t\tcommitID,\n\t\tfunc() (bufmodule.Digest, error) {\n\t\t\treturn digest, nil\n\t\t},\n\t)\n}\n\nfunc getModuleDataStoreDirLockPath(moduleKey bufmodule.ModuleKey) (string, error) {\n\tmoduleDataStoreDirPath, err := getModuleDataStoreDirPath(moduleKey)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn moduleDataStoreDirPath + externalModuleDataLockFileExt, nil\n}\n\n// externalModuleData is the store representation of a ModuleData.\n//\n// We could use a protobuf Message for this.\n//\n// Note that we do not want to use bufconfig.BufLockFile. This would hard-link the API\n// and persistence layers, and a bufconfig.BufLockFile does not have all the information that\n// a bufmodule.ModuleData has.\ntype externalModuleData struct {\n\tVersion       string                  `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tFilesDir      string                  `json:\"files_dir,omitempty\" yaml:\"files_dir,omitempty\"`\n\tDeps          []externalModuleDataDep `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tV1BufYAMLFile string                  `json:\"v1_buf_yaml_file,omitempty\" yaml:\"v1_buf_yaml_file,omitempty\"`\n\tV1BufLockFile string                  `json:\"v1_buf_lock_file,omitempty\" yaml:\"v1_buf_lock_file,omitempty\"`\n}\n\n// isValid returns true if all the information we currently expect to be on\n// an externalModuleData is present, and the version matches.\n//\n// If we add to externalModuleData over time or change the version, old values will be\n// incomplete, and we will auto-evict them from the store.\nfunc (e externalModuleData) isValid() bool {\n\tfor _, dep := range e.Deps {\n\t\tif !dep.isValid() {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn e.Version == externalModuleDataVersion &&\n\t\tlen(e.FilesDir) > 0\n}\n\n// externalModuleDataDep represents a dependency.\ntype externalModuleDataDep struct {\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\t// Dashless\n\tCommit string `json:\"commit,omitempty\" yaml:\"commit,omitempty\"`\n\tDigest string `json:\"digest,omitempty\" yaml:\"digest,omitempty\"`\n}\n\nfunc (e externalModuleDataDep) isValid() bool {\n\treturn len(e.Name) > 0 &&\n\t\tlen(e.Commit) > 0 &&\n\t\tlen(e.Digest) > 0\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulestore/module_data_store_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulestore\n\nimport (\n\t\"context\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/filelock\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestModuleDataStoreBasicDir(t *testing.T) {\n\tt.Parallel()\n\ttestModuleDataStoreBasic(t, false)\n}\n\nfunc TestModuleDataStoreBasicTar(t *testing.T) {\n\tt.Parallel()\n\ttestModuleDataStoreBasic(t, true)\n}\n\nfunc TestModuleDataStoreOS(t *testing.T) {\n\tt.Parallel()\n\ttestModuleDataStoreOS(t)\n}\n\nfunc testModuleDataStoreBasic(t *testing.T, tar bool) {\n\tbucket := storagemem.NewReadWriteBucket()\n\tfilelocker := filelock.NewNopLocker()\n\tvar moduleDataStoreOptions []ModuleDataStoreOption\n\tif tar {\n\t\tmoduleDataStoreOptions = append(moduleDataStoreOptions, ModuleDataStoreWithTar())\n\t}\n\ttestModuleDataStore(t, bucket, filelocker, moduleDataStoreOptions, tar)\n}\n\nfunc testModuleDataStoreOS(t *testing.T) {\n\ttempDir := t.TempDir()\n\tbucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\trequire.NoError(t, err)\n\tfilelocker, err := filelock.NewLocker(tempDir)\n\trequire.NoError(t, err)\n\ttestModuleDataStore(t, bucket, filelocker, nil, false)\n}\n\nfunc testModuleDataStore(\n\tt *testing.T,\n\tbucket storage.ReadWriteBucket,\n\tfilelocker filelock.Locker,\n\tmoduleDataStoreOptions []ModuleDataStoreOption,\n\ttar bool,\n) {\n\tctx := t.Context()\n\tlogger := slogtestext.NewLogger(t)\n\tmoduleDataStore := NewModuleDataStore(logger, bucket, filelocker, moduleDataStoreOptions...)\n\tmoduleKeys, moduleDatas := testGetModuleKeysAndModuleDatas(t, ctx)\n\tfoundModuleDatas, notFoundModuleKeys, err := moduleDataStore.GetModuleDatasForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\ttestRequireModuleDataNamesEqual(t, nil, foundModuleDatas)\n\ttestRequireModuleKeyNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tnotFoundModuleKeys,\n\t)\n\n\terr = moduleDataStore.PutModuleDatas(ctx, moduleDatas)\n\trequire.NoError(t, err)\n\n\tfoundModuleDatas, notFoundModuleKeys, err = moduleDataStore.GetModuleDatasForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\ttestRequireModuleDataNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tfoundModuleDatas,\n\t)\n\ttestRequireModuleKeyNamesEqual(t, nil, notFoundModuleKeys)\n\n\t// Corrupt the cache.\n\tif tar {\n\t\ttarPath, err := getModuleDataStoreTarPath(moduleKeys[0])\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, storage.PutPath(ctx, bucket, tarPath, []byte(\"invalid_tar\")))\n\t} else {\n\t\tdirPath, err := getModuleDataStoreDirPath(moduleKeys[0])\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(\n\t\t\tt,\n\t\t\tstorage.PutPath(\n\t\t\t\tctx,\n\t\t\t\tbucket,\n\t\t\t\tnormalpath.Join(\n\t\t\t\t\tdirPath,\n\t\t\t\t\texternalModuleDataFileName,\n\t\t\t\t),\n\t\t\t\t[]byte(\"invalid_info_json\"),\n\t\t\t),\n\t\t)\n\t}\n\tfoundModuleDatas, notFoundModuleKeys, err = moduleDataStore.GetModuleDatasForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\ttestRequireModuleDataNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tfoundModuleDatas,\n\t)\n\ttestRequireModuleKeyNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t},\n\t\tnotFoundModuleKeys,\n\t)\n}\n\nfunc testGetModuleKeysAndModuleDatas(t *testing.T, ctx context.Context) ([]bufmodule.ModuleKey, []bufmodule.ModuleData) {\n\tbsrProvider, err := bufmoduletesting.NewOmniProvider(\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod1\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod1.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package mod1;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod2\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod2.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package mod2; import \"mod1.proto\";`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t\tbufmoduletesting.ModuleData{\n\t\t\tName: \"buf.build/foo/mod3\",\n\t\t\tPathToData: map[string][]byte{\n\t\t\t\t\"mod3.proto\": []byte(\n\t\t\t\t\t`syntax = proto3; package mod3;`,\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\tmoduleRefMod1, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod1\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefMod2, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod2\", \"\")\n\trequire.NoError(t, err)\n\tmoduleRefMod3, err := bufparse.NewRef(\"buf.build\", \"foo\", \"mod3\", \"\")\n\trequire.NoError(t, err)\n\tmoduleKeys, err := bsrProvider.GetModuleKeysForModuleRefs(\n\t\tctx,\n\t\t[]bufparse.Ref{\n\t\t\tmoduleRefMod1,\n\t\t\t// Switching order on purpose.\n\t\t\tmoduleRefMod3,\n\t\t\tmoduleRefMod2,\n\t\t},\n\t\tbufmodule.DigestTypeB5,\n\t)\n\trequire.NoError(t, err)\n\ttestRequireModuleKeyNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tmoduleKeys,\n\t)\n\tmoduleDatas, err := bsrProvider.GetModuleDatasForModuleKeys(\n\t\tctx,\n\t\tmoduleKeys,\n\t)\n\trequire.NoError(t, err)\n\ttestRequireModuleDataNamesEqual(\n\t\tt,\n\t\t[]string{\n\t\t\t\"buf.build/foo/mod1\",\n\t\t\t\"buf.build/foo/mod3\",\n\t\t\t\"buf.build/foo/mod2\",\n\t\t},\n\t\tmoduleDatas,\n\t)\n\treturn moduleKeys, moduleDatas\n}\n\nfunc testRequireModuleKeyNamesEqual(t *testing.T, expected []string, actual []bufmodule.ModuleKey) {\n\tif len(expected) == 0 {\n\t\trequire.Equal(t, 0, len(actual))\n\t} else {\n\t\trequire.Equal(\n\t\t\tt,\n\t\t\texpected,\n\t\t\txslices.Map(\n\t\t\t\tactual,\n\t\t\t\tfunc(value bufmodule.ModuleKey) string {\n\t\t\t\t\treturn value.FullName().String()\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t}\n}\n\nfunc testRequireModuleDataNamesEqual(t *testing.T, expected []string, actual []bufmodule.ModuleData) {\n\tif len(expected) == 0 {\n\t\trequire.Equal(t, 0, len(actual))\n\t} else {\n\t\trequire.Equal(\n\t\t\tt,\n\t\t\texpected,\n\t\t\txslices.Map(\n\t\t\t\tactual,\n\t\t\t\tfunc(value bufmodule.ModuleData) string {\n\t\t\t\t\treturn value.ModuleKey().FullName().String()\n\t\t\t\t},\n\t\t\t),\n\t\t)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulestore/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufmodulestore\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmodulestore/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodulestore\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\nfunc logDebugModuleKey(ctx context.Context, logger *slog.Logger, moduleKey bufmodule.ModuleKey, message string, fields ...any) {\n\tlogger.DebugContext(\n\t\tctx,\n\t\tmessage,\n\t\tappend(\n\t\t\t[]any{\n\t\t\t\tslog.String(\"moduleFullName\", moduleKey.FullName().String()),\n\t\t\t\tslog.String(\"commitID\", uuidutil.ToDashless(moduleKey.CommitID())),\n\t\t\t},\n\t\t\tfields...,\n\t\t)...,\n\t)\n}\n\nfunc logDebugCommitKey(ctx context.Context, logger *slog.Logger, commitKey bufmodule.CommitKey, message string, fields ...any) {\n\tlogger.DebugContext(\n\t\tctx,\n\t\tmessage,\n\t\tappend(\n\t\t\t[]any{\n\t\t\t\tslog.String(\"digestType\", commitKey.DigestType().String()),\n\t\t\t\tslog.String(\"registry\", commitKey.Registry()),\n\t\t\t\tslog.String(\"commitID\", uuidutil.ToDashless(commitKey.CommitID())),\n\t\t\t},\n\t\t\tfields...,\n\t\t)...,\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduletesting/bufmoduletesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmoduletesting\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"time\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/dag\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\nvar (\n\t// 2023-01-01 at 12:00 UTC\n\tmockTime = time.Unix(1672574400, 0)\n)\n\n// ModuleData is the data needed to construct a Module in test.\n//\n// Exactly one of PathToData, Bucket, DirPath must be set.\n//\n// Name is the FullName string. When creating an OmniProvider, Name is required.\n//\n// CommitID is optional, but it must be unique across all ModuleDatas. If CommitID is not set,\n// a mock commitID is created if Name is set.\n//\n// CreateTime is optional. If CreateTime is not set, a mock create Time is created. This create\n// time is the same for all data without a Time.\n//\n// If ReadObjectDataFromBucket is true, buf.yamls and buf.locks will attempt to be read from\n// PathToData, Bucket, or DirPath. Otherwise, BufYAMLObjectData and BufLockObjectData will be\n// used. It is an error to both set ReadObjectDataFromBucket and set Buf.*ObjectData.\ntype ModuleData struct {\n\tName                     string\n\tCommitID                 uuid.UUID\n\tCreateTime               time.Time\n\tDirPath                  string\n\tPathToData               map[string][]byte\n\tBucket                   storage.ReadBucket\n\tNotTargeted              bool\n\tBufYAMLObjectData        bufmodule.ObjectData\n\tBufLockObjectData        bufmodule.ObjectData\n\tReadObjectDataFromBucket bool\n}\n\n// OmniProvider is a ModuleKeyProvider, ModuleDataProvider, GraphProvider, CommitProvider, and ModuleSet for testing.\ntype OmniProvider interface {\n\tbufmodule.ModuleKeyProvider\n\tbufmodule.ModuleDataProvider\n\tbufmodule.GraphProvider\n\tbufmodule.CommitProvider\n\tbufmodule.ModuleSet\n}\n\n// NewOmniProvider returns a new OmniProvider.\n//\n// Note the ModuleDatas must be self-contained, that is they only import from each other.\nfunc NewOmniProvider(\n\tmoduleDatas ...ModuleData,\n) (OmniProvider, error) {\n\treturn newOmniProvider(moduleDatas)\n}\n\n// NewModuleSet returns a new ModuleSet.\n//\n// This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed,\n// and when FullNames do not matter.\n//\n// Note the ModuleDatas must be self-contained, that is they only import from each other.\nfunc NewModuleSet(\n\tmoduleDatas ...ModuleData,\n) (bufmodule.ModuleSet, error) {\n\treturn newModuleSet(moduleDatas, false, nil)\n}\n\n// NewModuleSetForDirPath returns a new ModuleSet for the directory path.\n//\n// This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed,\n// and when FullNames do not matter.\n//\n// Note that this Module cannot have any dependencies.\nfunc NewModuleSetForDirPath(\n\tdirPath string,\n) (bufmodule.ModuleSet, error) {\n\treturn NewModuleSet(\n\t\tModuleData{\n\t\t\tDirPath: dirPath,\n\t\t},\n\t)\n}\n\n// NewModuleSetForPathToData returns a new ModuleSet for the path to data map.\n//\n// This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed,\n// and when FullNames do not matter.\n//\n// Note that this Module cannot have any dependencies.\nfunc NewModuleSetForPathToData(\n\tpathToData map[string][]byte,\n) (bufmodule.ModuleSet, error) {\n\treturn NewModuleSet(\n\t\tModuleData{\n\t\t\tPathToData: pathToData,\n\t\t},\n\t)\n}\n\n// NewModuleSetForBucket returns a new ModuleSet for the Bucket.\n//\n// This can be used in cases where ModuleKeyProviders and ModuleDataProviders are not needed,\n// and when FullNames do not matter.\n//\n// Note that this Module cannot have any dependencies.\nfunc NewModuleSetForBucket(\n\tbucket storage.ReadBucket,\n) (bufmodule.ModuleSet, error) {\n\treturn NewModuleSet(\n\t\tModuleData{\n\t\t\tBucket: bucket,\n\t\t},\n\t)\n}\n\n// *** PRIVATE ***\n\ntype omniProvider struct {\n\tbufmodule.ModuleSet\n\tcommitIDToCreateTime map[uuid.UUID]time.Time\n}\n\nfunc newOmniProvider(\n\tmoduleDatas []ModuleData,\n) (*omniProvider, error) {\n\tcommitIDToCreateTime := make(map[uuid.UUID]time.Time)\n\tmoduleSet, err := newModuleSet(moduleDatas, true, commitIDToCreateTime)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &omniProvider{\n\t\tModuleSet:            moduleSet,\n\t\tcommitIDToCreateTime: commitIDToCreateTime,\n\t}, nil\n}\n\nfunc (o *omniProvider) GetModuleKeysForModuleRefs(\n\tctx context.Context,\n\tmoduleRefs []bufparse.Ref,\n\tdigestType bufmodule.DigestType,\n) ([]bufmodule.ModuleKey, error) {\n\tmoduleKeys := make([]bufmodule.ModuleKey, len(moduleRefs))\n\tfor i, moduleRef := range moduleRefs {\n\t\tmodule := o.GetModuleForFullName(moduleRef.FullName())\n\t\tif module == nil {\n\t\t\treturn nil, &fs.PathError{Op: \"read\", Path: moduleRef.String(), Err: fs.ErrNotExist}\n\t\t}\n\t\tmoduleKey, err := bufmodule.ModuleToModuleKey(module, digestType)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmoduleKeys[i] = moduleKey\n\t}\n\treturn moduleKeys, nil\n}\n\nfunc (o *omniProvider) GetModuleDatasForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.ModuleData, error) {\n\tif len(moduleKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tif _, err := bufmodule.UniqueDigestTypeForModuleKeys(moduleKeys); err != nil {\n\t\treturn nil, err\n\t}\n\tif _, err := bufparse.FullNameStringToUniqueValue(moduleKeys); err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.MapError(\n\t\tmoduleKeys,\n\t\tfunc(moduleKey bufmodule.ModuleKey) (bufmodule.ModuleData, error) {\n\t\t\treturn o.getModuleDataForModuleKey(ctx, moduleKey)\n\t\t},\n\t)\n}\n\nfunc (o *omniProvider) GetCommitsForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) ([]bufmodule.Commit, error) {\n\tif len(moduleKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tif _, err := bufmodule.UniqueDigestTypeForModuleKeys(moduleKeys); err != nil {\n\t\treturn nil, err\n\t}\n\tcommits := make([]bufmodule.Commit, len(moduleKeys))\n\tfor i, moduleKey := range moduleKeys {\n\t\tcreateTime, ok := o.commitIDToCreateTime[moduleKey.CommitID()]\n\t\tif !ok {\n\t\t\treturn nil, &fs.PathError{Op: \"read\", Path: moduleKey.String(), Err: fs.ErrNotExist}\n\t\t}\n\t\tcommits[i] = bufmodule.NewCommit(\n\t\t\tmoduleKey,\n\t\t\tfunc() (time.Time, error) {\n\t\t\t\treturn createTime, nil\n\t\t\t},\n\t\t)\n\t}\n\treturn commits, nil\n}\n\nfunc (o *omniProvider) GetCommitsForCommitKeys(\n\tctx context.Context,\n\tcommitKeys []bufmodule.CommitKey,\n) ([]bufmodule.Commit, error) {\n\tif len(commitKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tif _, err := bufmodule.UniqueDigestTypeForCommitKeys(commitKeys); err != nil {\n\t\treturn nil, err\n\t}\n\tcommits := make([]bufmodule.Commit, len(commitKeys))\n\tfor i, commitKey := range commitKeys {\n\t\tmodule := o.GetModuleForCommitID(commitKey.CommitID())\n\t\tif module == nil {\n\t\t\treturn nil, &fs.PathError{Op: \"read\", Path: uuidutil.ToDashless(commitKey.CommitID()), Err: fs.ErrNotExist}\n\t\t}\n\t\tcreateTime, ok := o.commitIDToCreateTime[commitKey.CommitID()]\n\t\tif !ok {\n\t\t\treturn nil, &fs.PathError{Op: \"read\", Path: uuidutil.ToDashless(commitKey.CommitID()), Err: fs.ErrNotExist}\n\t\t}\n\t\tmoduleKey, err := bufmodule.ModuleToModuleKey(module, commitKey.DigestType())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcommits[i] = bufmodule.NewCommit(\n\t\t\tmoduleKey,\n\t\t\tfunc() (time.Time, error) {\n\t\t\t\treturn createTime, nil\n\t\t\t},\n\t\t)\n\t}\n\treturn commits, nil\n}\n\nfunc (o *omniProvider) GetGraphForModuleKeys(\n\tctx context.Context,\n\tmoduleKeys []bufmodule.ModuleKey,\n) (*dag.Graph[bufmodule.RegistryCommitID, bufmodule.ModuleKey], error) {\n\tgraph := dag.NewGraph[bufmodule.RegistryCommitID, bufmodule.ModuleKey](bufmodule.ModuleKeyToRegistryCommitID)\n\tif len(moduleKeys) == 0 {\n\t\treturn graph, nil\n\t}\n\tdigestType, err := bufmodule.UniqueDigestTypeForModuleKeys(moduleKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmodules := make([]bufmodule.Module, len(moduleKeys))\n\tfor i, moduleKey := range moduleKeys {\n\t\tmodule := o.GetModuleForFullName(moduleKey.FullName())\n\t\tif module == nil {\n\t\t\treturn nil, &fs.PathError{Op: \"read\", Path: moduleKey.String(), Err: fs.ErrNotExist}\n\t\t}\n\t\tmodules[i] = module\n\t}\n\tfor _, module := range modules {\n\t\tif err := addModuleToGraphRec(module, graph, digestType); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn graph, nil\n}\n\nfunc (o *omniProvider) getModuleDataForModuleKey(\n\tctx context.Context,\n\tmoduleKey bufmodule.ModuleKey,\n) (bufmodule.ModuleData, error) {\n\tmodule := o.GetModuleForFullName(moduleKey.FullName())\n\tif module == nil {\n\t\treturn nil, &fs.PathError{Op: \"read\", Path: moduleKey.String(), Err: fs.ErrNotExist}\n\t}\n\tmoduleDeps, err := module.ModuleDeps()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdigest, err := moduleKey.Digest()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdepModuleKeys, err := xslices.MapError(\n\t\tmoduleDeps,\n\t\tfunc(moduleDep bufmodule.ModuleDep) (bufmodule.ModuleKey, error) {\n\t\t\treturn bufmodule.ModuleToModuleKey(moduleDep, digest.Type())\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufmodule.NewModuleData(\n\t\tctx,\n\t\tmoduleKey,\n\t\tfunc() (storage.ReadBucket, error) {\n\t\t\treturn bufmodule.ModuleReadBucketToStorageReadBucket(module), nil\n\t\t},\n\t\tfunc() ([]bufmodule.ModuleKey, error) {\n\t\t\treturn depModuleKeys, nil\n\t\t},\n\t\tfunc() (bufmodule.ObjectData, error) {\n\t\t\treturn module.V1Beta1OrV1BufYAMLObjectData()\n\t\t},\n\t\tfunc() (bufmodule.ObjectData, error) {\n\t\t\treturn module.V1Beta1OrV1BufLockObjectData()\n\t\t},\n\t), nil\n}\n\nfunc newModuleSet(\n\tmoduleDatas []ModuleData,\n\trequireName bool,\n\t// may be nil\n\tcommitIDToCreateTime map[uuid.UUID]time.Time,\n) (bufmodule.ModuleSet, error) {\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(context.Background(), xslog.NopLogger, bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\tfor i, moduleData := range moduleDatas {\n\t\tif err := addModuleDataToModuleSetBuilder(\n\t\t\tmoduleSetBuilder,\n\t\t\tmoduleData,\n\t\t\trequireName,\n\t\t\tcommitIDToCreateTime,\n\t\t\ti,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn moduleSetBuilder.Build()\n}\n\nfunc addModuleDataToModuleSetBuilder(\n\tmoduleSetBuilder bufmodule.ModuleSetBuilder,\n\tmoduleData ModuleData,\n\trequireName bool,\n\t// may be nil\n\tcommitIDToCreateTime map[uuid.UUID]time.Time,\n\tindex int,\n) error {\n\tif boolCount(\n\t\tmoduleData.DirPath != \"\",\n\t\tmoduleData.PathToData != nil,\n\t\tmoduleData.Bucket != nil,\n\t) != 1 {\n\t\treturn errors.New(\"exactly one of Bucket, PathToData, DirPath must be set on ModuleData\")\n\t}\n\tif boolCount(\n\t\tmoduleData.ReadObjectDataFromBucket,\n\t\tmoduleData.BufYAMLObjectData != nil,\n\t) > 1 || boolCount(\n\t\tmoduleData.ReadObjectDataFromBucket,\n\t\tmoduleData.BufLockObjectData != nil,\n\t) > 1 {\n\t\treturn errors.New(\"cannot set ReadObjectDataFromBucket alongside BufYAMLObjectData or BufLockObjectData\")\n\t}\n\n\tvar bucket storage.ReadBucket\n\tvar bucketID string\n\tvar err error\n\tswitch {\n\tcase moduleData.DirPath != \"\":\n\t\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\t\tbucket, err = storageosProvider.NewReadWriteBucket(\n\t\t\tmoduleData.DirPath,\n\t\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Since it's possible to that there are multiple modules at the same DirPath, we append the\n\t\t// index to make sure the bucketID is unique. This does not need to have to same format as\n\t\t// bucketIDs of modules built in non-test code paths.\n\t\tbucketID = fmt.Sprintf(\"%s-%d\", moduleData.DirPath, index)\n\tcase moduleData.PathToData != nil:\n\t\tbucket, err = storagemem.NewReadBucket(moduleData.PathToData)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tbucketID = fmt.Sprintf(\"omniProviderBucket-%d\", index)\n\tcase moduleData.Bucket != nil:\n\t\tbucket = moduleData.Bucket\n\t\tbucketID = fmt.Sprintf(\"omniProviderBucket-%d\", index)\n\tdefault:\n\t\t// Should never get here.\n\t\treturn errors.New(\"boolCount returned 1 but all ModuleData fields were nil\")\n\t}\n\tvar localModuleOptions []bufmodule.LocalModuleOption\n\tif moduleData.Name != \"\" {\n\t\tmoduleFullName, err := bufparse.ParseFullName(moduleData.Name)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcommitID := moduleData.CommitID\n\t\tif commitID == uuid.Nil {\n\t\t\tcommitID, err = uuidutil.New()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tif commitIDToCreateTime != nil {\n\t\t\tcreateTime := moduleData.CreateTime\n\t\t\tif createTime.IsZero() {\n\t\t\t\tcreateTime = mockTime\n\t\t\t}\n\t\t\tcommitIDToCreateTime[commitID] = createTime\n\t\t}\n\t\tlocalModuleOptions = []bufmodule.LocalModuleOption{\n\t\t\tbufmodule.LocalModuleWithFullNameAndCommitID(moduleFullName, commitID),\n\t\t}\n\t} else if requireName {\n\t\treturn errors.New(\"ModuleData.Name was required in this context\")\n\t}\n\tif moduleData.ReadObjectDataFromBucket {\n\t\tctx := context.Background()\n\t\tbufYAMLObjectData, err := bufconfig.GetBufYAMLV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, \".\")\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tbufLockObjectData, err := bufconfig.GetBufLockV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, \".\")\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tlocalModuleOptions = append(\n\t\t\tlocalModuleOptions,\n\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufYAMLObjectData(bufYAMLObjectData),\n\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufLockObjectData(bufLockObjectData),\n\t\t)\n\t} else {\n\t\tif moduleData.BufYAMLObjectData != nil {\n\t\t\tlocalModuleOptions = append(\n\t\t\t\tlocalModuleOptions,\n\t\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufYAMLObjectData(moduleData.BufYAMLObjectData),\n\t\t\t)\n\t\t}\n\t\tif moduleData.BufLockObjectData != nil {\n\t\t\tlocalModuleOptions = append(\n\t\t\t\tlocalModuleOptions,\n\t\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufLockObjectData(moduleData.BufLockObjectData),\n\t\t\t)\n\t\t}\n\t}\n\tmoduleSetBuilder.AddLocalModule(\n\t\tbucket,\n\t\tbucketID,\n\t\t!moduleData.NotTargeted,\n\t\tlocalModuleOptions...,\n\t)\n\treturn nil\n}\n\nfunc addModuleToGraphRec(\n\tmodule bufmodule.Module,\n\tgraph *dag.Graph[bufmodule.RegistryCommitID, bufmodule.ModuleKey],\n\tdigestType bufmodule.DigestType,\n) error {\n\tmoduleKey, err := bufmodule.ModuleToModuleKey(module, digestType)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgraph.AddNode(moduleKey)\n\tdirectModuleDeps, err := bufmodule.ModuleDirectModuleDeps(module)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, directModuleDep := range directModuleDeps {\n\t\tdirectDepModuleKey, err := bufmodule.ModuleToModuleKey(module, digestType)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgraph.AddEdge(moduleKey, directDepModuleKey)\n\t\tif err := addModuleToGraphRec(directModuleDep, graph, digestType); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc boolCount(bools ...bool) int {\n\treturn xslices.Count(bools, func(value bool) bool { return value })\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-digest/digest.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"time\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tname               = \"buf-digest\"\n\tdigestTypeFlagName = \"digest-type\"\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\tbuilder := appext.NewBuilder(\n\t\tname,\n\t\tappext.BuilderWithTimeout(120*time.Second),\n\t\tappext.BuilderWithLoggerProvider(slogapp.LoggerProvider),\n\t)\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name + \" <path/to/module1> <path/to/module2> ...\",\n\t\tShort: \"Produce a digest for a set of self-contained modules.\",\n\t\tLong: `This is a low-level command used to generate digests for modules on disk.\nThe modules given must be self-contained, i.e. all dependencies must be represented.\nThis is not intended to be used outside of development of the buf codebase.\n\nIf a given module contains a v1 buf.yaml and/or buf.lock, they will be included\nin the B4 digest calculations.`,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags:           flags.Bind,\n\t\tBindPersistentFlags: builder.BindRoot,\n\t}\n}\n\ntype flags struct {\n\tDigestType string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.DigestType,\n\t\tdigestTypeFlagName,\n\t\tbufmodule.DigestTypeB5.String(),\n\t\tfmt.Sprintf(\n\t\t\t\"The digest type. Must be one of %s\",\n\t\t\txstrings.SliceToString(xslices.Map(bufmodule.AllDigestTypes, bufmodule.DigestType.String)),\n\t\t),\n\t)\n}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tdigestType, err := bufmodule.ParseDigestType(flags.DigestType)\n\tif err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s: %w\", digestTypeFlagName, err)\n\t}\n\tdirPaths := app.Args(container)\n\tif len(dirPaths) == 0 {\n\t\tdirPaths = []string{\".\"}\n\t}\n\tmoduleSetBuilder := bufmodule.NewModuleSetBuilder(ctx, container.Logger(), bufmodule.NopModuleDataProvider, bufmodule.NopCommitProvider)\n\tstorageosProvider := storageos.NewProvider()\n\tfor _, dirPath := range dirPaths {\n\t\tbucket, err := storageosProvider.NewReadWriteBucket(dirPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tv1BufYAMLObjectData, err := bufconfig.GetBufYAMLV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, \".\")\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tv1BufLockObjectData, err := bufconfig.GetBufLockV1Beta1OrV1ObjectDataForPrefix(ctx, bucket, \".\")\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\tmoduleSetBuilder.AddLocalModule(\n\t\t\tbucket,\n\t\t\tdirPath,\n\t\t\ttrue,\n\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufYAMLObjectData(v1BufYAMLObjectData),\n\t\t\tbufmodule.LocalModuleWithV1Beta1OrV1BufLockObjectData(v1BufLockObjectData),\n\t\t)\n\t}\n\tmoduleSet, err := moduleSetBuilder.Build()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, module := range moduleSet.Modules() {\n\t\tdigest, err := module.Digest(digestType)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := container.Stdout().Write([]byte(module.OpaqueID() + \" \" + digest.String() + \"\\n\")); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-digest/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-new-commit-id/newcommitid.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tname = \"buf-new-commit-id\"\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\tbuilder := appext.NewBuilder(\n\t\tname,\n\t\tappext.BuilderWithTimeout(120*time.Second),\n\t\tappext.BuilderWithLoggerProvider(slogapp.LoggerProvider),\n\t)\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:   name,\n\t\tShort: \"Produce a new commit ID for testing.\",\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindFlags:           flags.Bind,\n\t\tBindPersistentFlags: builder.BindRoot,\n\t}\n}\n\ntype flags struct{}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {}\n\nfunc run(\n\tctx context.Context,\n\tcontainer appext.Container,\n\tflags *flags,\n) error {\n\tcommitID, err := uuidutil.New()\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = container.Stdout().Write([]byte(uuidutil.ToDashless(commitID) + \"\\n\"))\n\treturn err\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduletesting/cmd/buf-new-commit-id/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/bufmoduletesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufmoduletesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufmodule/commit.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\n// Commit represents a Commit for a Module on the BSR.\ntype Commit interface {\n\t// ModuleKey returns the ModuleKey for the Commit.\n\tModuleKey() ModuleKey\n\t// CreateTime returns the time the Commit was created on the BSR.\n\tCreateTime() (time.Time, error)\n\n\tisCommit()\n}\n\n// NewCommit returns a new Commit.\nfunc NewCommit(\n\tmoduleKey ModuleKey,\n\tgetCreateTime func() (time.Time, error),\n\toptions ...CommitOption,\n) Commit {\n\treturn newCommit(\n\t\tmoduleKey,\n\t\tgetCreateTime,\n\t\toptions...,\n\t)\n}\n\n// CommitOption is an option for a new Commit.\ntype CommitOption func(*commitOptions)\n\n// CommitWithExpectedDigest returns a new CommitOption that will compare the Digest\n// of the ModuleKey provided at construction with this digest whenever any lazy method is called.\n// If the digests do not match, an error is returned\n//\n// This is used in situations where we have a Digest from our read location (such as the BSR\n// or the cache), and we want to compare it with a ModuleKey we were provided from a local location.\nfunc CommitWithExpectedDigest(expectedDigest Digest) CommitOption {\n\treturn func(commitOptions *commitOptions) {\n\t\tcommitOptions.expectedDigest = expectedDigest\n\t}\n}\n\n// *** PRIVATE ***\n\ntype commit struct {\n\tmoduleKey     ModuleKey\n\tgetCreateTime func() (time.Time, error)\n}\n\nfunc newCommit(\n\tmoduleKey ModuleKey,\n\tgetCreateTime func() (time.Time, error),\n\toptions ...CommitOption,\n) *commit {\n\tcommitOptions := newCommitOptions()\n\tfor _, option := range options {\n\t\toption(commitOptions)\n\t}\n\tif commitOptions.expectedDigest != nil {\n\t\t// We need to preserve this, as if we do not, the new value for moduleKey\n\t\t// will end up recursively calling itself when moduleKey.Digest() is called\n\t\t// in the anonymous function. We could just extract moduleKeyDigestFunc := moduleKey.Digest\n\t\t// and call that, but we make a variable to reference the original ModuleKey just for consistency.\n\t\toriginalModuleKey := moduleKey\n\t\tmoduleKey = newModuleKeyNoValidate(\n\t\t\toriginalModuleKey.FullName(),\n\t\t\toriginalModuleKey.CommitID(),\n\t\t\tfunc() (Digest, error) {\n\t\t\t\tmoduleKeyDigest, err := originalModuleKey.Digest()\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 !DigestEqual(commitOptions.expectedDigest, moduleKeyDigest) {\n\t\t\t\t\treturn nil, &DigestMismatchError{\n\t\t\t\t\t\tFullName:       originalModuleKey.FullName(),\n\t\t\t\t\t\tCommitID:       originalModuleKey.CommitID(),\n\t\t\t\t\t\tExpectedDigest: commitOptions.expectedDigest,\n\t\t\t\t\t\tActualDigest:   moduleKeyDigest,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn moduleKeyDigest, nil\n\t\t\t},\n\t\t)\n\t}\n\treturn &commit{\n\t\tmoduleKey:     moduleKey,\n\t\tgetCreateTime: sync.OnceValues(getCreateTime),\n\t}\n}\n\nfunc (c *commit) ModuleKey() ModuleKey {\n\treturn c.moduleKey\n}\n\nfunc (c *commit) CreateTime() (time.Time, error) {\n\t// This may invoke tamper-proofing per newCommit construction.\n\tif _, err := c.moduleKey.Digest(); err != nil {\n\t\treturn time.Time{}, err\n\t}\n\treturn c.getCreateTime()\n}\n\nfunc (*commit) isCommit() {}\n\ntype commitOptions struct {\n\texpectedDigest Digest\n}\n\nfunc newCommitOptions() *commitOptions {\n\treturn &commitOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/commit_key.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// CommitKey provides identifying information for a Commit when calling the CommitProvider.\ntype CommitKey interface {\n\t// String returns \"digestType/registry:dashlessCommitID\".\n\tfmt.Stringer\n\n\t// Registry returns the registry of the Commit.\n\t//\n\t// Always present.\n\tRegistry() string\n\t// CommitID returns the ID of the Commit.\n\t//\n\t// It is up to the caller to convert this to a dashless ID when necessary.\n\t//\n\t// Always present, that is CommitID() == uuid.Nil will always be false.\n\tCommitID() uuid.UUID\n\t// DigestType returns the DigestType of the Commit.\n\t//\n\t// Note this is *not* a cas.Digest - this is a Digest. cas.Digests are a lower-level\n\t// type that just deal in terms of files and content. A ModuleDigest is a specific algorithm\n\t// applied to a set of files and dependencies.\n\tDigestType() DigestType\n\n\tisCommitKey()\n}\n\n// NewCommitKey returns a new CommitKey.\nfunc NewCommitKey(\n\tregistry string,\n\tcommitID uuid.UUID,\n\tdigestType DigestType,\n) (CommitKey, error) {\n\treturn newCommitKey(\n\t\tregistry,\n\t\tcommitID,\n\t\tdigestType,\n\t)\n}\n\n// UniqueDigestTypeForCommitKeys returns the single DigestType for the Digests on the CommitKeys.\n//\n// If the CommitKeys have different DigestTypes, an error is returned.\n// If the CommitKeys slice is empty, an error is returned.\nfunc UniqueDigestTypeForCommitKeys(commitKeys []CommitKey) (DigestType, error) {\n\tif len(commitKeys) == 0 {\n\t\treturn 0, syserror.New(\"empty commitKeys passed to UniqueDigestTypeForCommitKeys\")\n\t}\n\tdigestTypes := xslices.Map(commitKeys, CommitKey.DigestType)\n\tdigestType := digestTypes[0]\n\tfor _, otherDigestType := range digestTypes[1:] {\n\t\tif otherDigestType != digestType {\n\t\t\treturn 0, fmt.Errorf(\n\t\t\t\t\"different digest types detected where the same digest type must be used: %v, %v\\n%s\",\n\t\t\t\totherDigestType,\n\t\t\t\tdigestType,\n\t\t\t\tstrings.Join(xslices.Map(commitKeys, CommitKey.String), \"\\n\"),\n\t\t\t)\n\t\t}\n\t}\n\treturn digestType, nil\n}\n\n// *** PRIVATE ***\n\ntype commitKey struct {\n\tregistry   string\n\tcommitID   uuid.UUID\n\tdigestType DigestType\n}\n\nfunc newCommitKey(\n\tregistry string,\n\tcommitID uuid.UUID,\n\tdigestType DigestType,\n) (*commitKey, error) {\n\tif registry == \"\" {\n\t\treturn nil, errors.New(\"empty registry when constructing CommitKey\")\n\t}\n\tif commitID == uuid.Nil {\n\t\treturn nil, errors.New(\"empty commitID when constructing CommitKey\")\n\t}\n\tif _, ok := digestTypeToString[digestType]; !ok {\n\t\treturn nil, fmt.Errorf(\"unknown DigestType when constructing CommitKey: %v\", digestType)\n\t}\n\treturn &commitKey{\n\t\tregistry:   registry,\n\t\tcommitID:   commitID,\n\t\tdigestType: digestType,\n\t}, nil\n}\n\nfunc (m *commitKey) Registry() string {\n\treturn m.registry\n}\n\nfunc (m *commitKey) CommitID() uuid.UUID {\n\treturn m.commitID\n}\n\nfunc (m *commitKey) DigestType() DigestType {\n\treturn m.digestType\n}\n\nfunc (m *commitKey) String() string {\n\treturn m.digestType.String() + \"/\" + m.registry + \":\" + uuidutil.ToDashless(m.commitID)\n}\n\nfunc (*commitKey) isCommitKey() {}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/commit_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n)\n\nvar (\n\t// NopCommitProvider is a no-op CommitProvider.\n\tNopCommitProvider CommitProvider = nopCommitProvider{}\n)\n\n// CommitProvider provides Commits for ModuleKeys or CommitIDs.\n//\n// Use GetCommitForModuleKeys if you already have the ModuleKey, as it should perform better\n// for most implementations, and the ModuleKey Digest will be checked against the retrieved\n// Commit Digest.\n//\n// The CommitProvider relies on the fact that we don't allow renames for Modules at this point\n// in the BSR. If this were to change, our underlying cache would have to change. Keep this\n// in mind, however so much would have to change in the BSR to allow renames that the local\n// CLI cache is the least of our problems.\ntype CommitProvider interface {\n\t// GetCommitsForModuleKeys gets the Commits for the given ModuleKeys.\n\t//\n\t// Returned Commits will be in the same order as the input ModuleKeys.\n\t//\n\t// The input ModuleKeys are expected to have the same DigestType. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the Commits returned will match the length of the ModuleKeys.\n\t// If there is an error, no Commits will be returned.\n\t// If any ModuleKey is not found, an error with fs.ErrNotExist will be returned.\n\tGetCommitsForModuleKeys(context.Context, []ModuleKey) ([]Commit, error)\n\t// GetCommitsForCommitKeys gets the Commits for the given CommitKeys.\n\t//\n\t// Returned Commits will be in the same order as the input CommitKeys.\n\t//\n\t// The input CommitKeys are expected to have the same DigestType. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the Commits returned will match the length of the CommitKeys.\n\t// If there is an error, no Commits will be returned.\n\t// If any CommitKey is not found, an error with fs.ErrNotExist will be returned.\n\tGetCommitsForCommitKeys(context.Context, []CommitKey) ([]Commit, error)\n}\n\n// *** PRIVATE ***\n\ntype nopCommitProvider struct{}\n\nfunc (nopCommitProvider) GetCommitsForModuleKeys(\n\tcontext.Context,\n\t[]ModuleKey,\n) ([]Commit, error) {\n\treturn nil, fs.ErrNotExist\n}\n\nfunc (nopCommitProvider) GetCommitsForCommitKeys(\n\tcontext.Context,\n\t[]CommitKey,\n) ([]Commit, error) {\n\treturn nil, fs.ErrNotExist\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/digest.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// DigestTypeB4 represents the b4 module digest type.\n\t//\n\t// This represents the pre-refactor shake256 digest type, and the string value of\n\t// this is \"shake256\" for backwards-compatibility reasons.\n\tDigestTypeB4 DigestType = iota + 1\n\t// DigestTypeB5 represents the b5 digest type.\n\t//\n\t// This is the newest digest type, and should generally be used. The string value\n\t// of this is \"b5\".\n\tDigestTypeB5\n)\n\nvar (\n\t// AllDigestTypes are all known DigestTypes.\n\tAllDigestTypes = []DigestType{\n\t\tDigestTypeB4,\n\t\tDigestTypeB5,\n\t}\n\tdigestTypeToString = map[DigestType]string{\n\t\tDigestTypeB4: \"shake256\",\n\t\tDigestTypeB5: \"b5\",\n\t}\n\tstringToDigestType = map[string]DigestType{\n\t\t\"shake256\": DigestTypeB4,\n\t\t\"b5\":       DigestTypeB5,\n\t}\n)\n\n// DigestType is a type of digest.\ntype DigestType int\n\n// String prints the string representation of the DigestType.\nfunc (d DigestType) String() string {\n\ts, ok := digestTypeToString[d]\n\tif !ok {\n\t\treturn strconv.Itoa(int(d))\n\t}\n\treturn s\n}\n\n// ParseDigestType parses a DigestType from its string representation.\n//\n// This reverses DigestType.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseDigestType(s string) (DigestType, error) {\n\td, ok := stringToDigestType[s]\n\tif !ok {\n\t\treturn 0, bufparse.NewParseError(\n\t\t\t\"module digest type\",\n\t\t\ts,\n\t\t\tfmt.Errorf(\"unknown type: %q\", s),\n\t\t)\n\t}\n\treturn d, nil\n}\n\n// Digest is a digest of some content.\n//\n// It consists of a DigestType and a digest value.\ntype Digest interface {\n\t// String() prints typeString:hexValue.\n\tfmt.Stringer\n\n\t// Type returns the type of digest.\n\t//\n\t// Always a valid value.\n\tType() DigestType\n\t// Value returns the digest value.\n\t//\n\t// Always non-empty.\n\tValue() []byte\n\n\tisDigest()\n}\n\n// NewDigest creates a new Digest.\nfunc NewDigest(digestType DigestType, casDigest cas.Digest) (Digest, error) {\n\tswitch digestType {\n\tcase DigestTypeB4, DigestTypeB5:\n\t\tif casDigest.Type() != cas.DigestTypeShake256 {\n\t\t\treturn nil, syserror.Newf(\n\t\t\t\t\"trying to create a %v Digest for a cas Digest of type %v\",\n\t\t\t\tdigestType,\n\t\t\t\tcasDigest.Type(),\n\t\t\t)\n\t\t}\n\t\treturn newDigest(digestType, casDigest), nil\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\n// ParseDigest parses a Digest from its string representation.\n//\n// A Digest string is of the form typeString:hexValue.\n// The string is expected to be non-empty, If not, an error is returned.\n//\n// This reverses Digest.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseDigest(s string) (Digest, error) {\n\tif s == \"\" {\n\t\t// This should be considered a system error.\n\t\treturn nil, errors.New(\"empty string passed to ParseDigest\")\n\t}\n\tdigestTypeString, hexValue, ok := strings.Cut(s, \":\")\n\tif !ok {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"module digest\",\n\t\t\ts,\n\t\t\terrors.New(`must in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tdigestType, err := ParseDigestType(digestTypeString)\n\tif err != nil {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"module digest\",\n\t\t\ts,\n\t\t\terr,\n\t\t)\n\t}\n\tvalue, err := hex.DecodeString(hexValue)\n\tif err != nil {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"module digest\",\n\t\t\ts,\n\t\t\terrors.New(`could not parse hex: must in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tswitch digestType {\n\tcase DigestTypeB4, DigestTypeB5:\n\t\tcasDigest, err := cas.NewDigest(value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn NewDigest(digestType, casDigest)\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\n// DigestEqual returns true if the given Digests are considered equal.\n//\n// If both Digests are nil, this returns true.\n//\n// This checks both the DigestType and Digest value.\nfunc DigestEqual(a Digest, b Digest) bool {\n\tif (a == nil) != (b == nil) {\n\t\treturn false\n\t}\n\tif a == nil {\n\t\treturn true\n\t}\n\tif a.Type() != b.Type() {\n\t\treturn false\n\t}\n\treturn bytes.Equal(a.Value(), b.Value())\n}\n\n/// *** PRIVATE ***\n\ntype digest struct {\n\tdigestType DigestType\n\tcasDigest  cas.Digest\n\t// Cache as we call String pretty often.\n\t// We could do this lazily but not worth it.\n\tstringValue string\n}\n\n// validation should occur outside of this function.\nfunc newDigest(digestType DigestType, casDigest cas.Digest) *digest {\n\treturn &digest{\n\t\tdigestType:  digestType,\n\t\tcasDigest:   casDigest,\n\t\tstringValue: digestType.String() + \":\" + hex.EncodeToString(casDigest.Value()),\n\t}\n}\n\nfunc (d *digest) Type() DigestType {\n\treturn d.digestType\n}\n\nfunc (d *digest) Value() []byte {\n\treturn d.casDigest.Value()\n}\n\nfunc (d *digest) String() string {\n\treturn d.stringValue\n}\n\nfunc (*digest) isDigest() {}\n\nfunc getB4Digest(\n\tctx context.Context,\n\tbucketWithStorageMatcherApplied storage.ReadBucket,\n\tv1BufYAMLObjectData ObjectData,\n\tv1BufLockObjectData ObjectData,\n) (Digest, error) {\n\tvar fileNodes []cas.FileNode\n\tif err := storage.WalkReadObjects(\n\t\tctx,\n\t\t// This is extreme defensive programming. We've gone out of our way to make sure\n\t\t// that the bucket is already filtered, but it's just too important to mess up here.\n\t\tstorage.FilterReadBucket(bucketWithStorageMatcherApplied, getStorageMatcher(ctx, bucketWithStorageMatcherApplied)),\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdigest, err := cas.NewDigestForContent(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfileNode, err := cas.NewFileNode(readObject.Path(), digest)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfileNodes = append(fileNodes, fileNode)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, objectData := range []ObjectData{\n\t\tv1BufYAMLObjectData,\n\t\tv1BufLockObjectData,\n\t} {\n\t\tif objectData == nil {\n\t\t\t// We may not have object data for one of these files, this is valid.\n\t\t\tcontinue\n\t\t}\n\t\tdigest, err := cas.NewDigestForContent(bytes.NewReader(objectData.Data()))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfileNode, err := cas.NewFileNode(objectData.Name(), digest)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfileNodes = append(fileNodes, fileNode)\n\t}\n\tmanifest, err := cas.NewManifest(fileNodes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcasDigest, err := cas.ManifestToDigest(manifest, cas.DigestTypeShake256)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewDigest(DigestTypeB4, casDigest)\n}\n\nfunc getB5DigestForBucketAndModuleDeps(\n\tctx context.Context,\n\tbucketWithStorageMatcherApplied storage.ReadBucket,\n\tmoduleDeps []ModuleDep,\n) (Digest, error) {\n\tdepDigests, err := xslices.MapError(\n\t\tmoduleDeps,\n\t\tfunc(moduleDep ModuleDep) (Digest, error) {\n\t\t\treturn moduleDep.Digest(DigestTypeB5)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn getB5DigestForBucketAndDepDigests(ctx, bucketWithStorageMatcherApplied, depDigests)\n}\n\nfunc getB5DigestForBucketAndDepModuleKeys(\n\tctx context.Context,\n\tbucketWithStorageMatcherApplied storage.ReadBucket,\n\tdepModuleKeys []ModuleKey,\n) (Digest, error) {\n\tdepDigests, err := xslices.MapError(\n\t\tdepModuleKeys,\n\t\tfunc(moduleKey ModuleKey) (Digest, error) {\n\t\t\treturn moduleKey.Digest()\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn getB5DigestForBucketAndDepDigests(ctx, bucketWithStorageMatcherApplied, depDigests)\n}\n\n// getB5Digest computes a b5 Digest for the given set of module files and dependencies.\n//\n// A Digest is a composite digest of all Module Files, and all Module dependencies.\n//\n// All Files are added to a cas.Manifest, which is then turned into a cas.Digest.\n// The file cas.Digest, along with all Digests of the dependencies, are then sorted,\n// and then digested themselves as content.\n//\n// Note that the name of the Module and any of its dependencies has no effect on the Digest.\nfunc getB5DigestForBucketAndDepDigests(\n\tctx context.Context,\n\tbucketWithStorageMatcherApplied storage.ReadBucket,\n\tdepDigests []Digest,\n) (Digest, error) {\n\t// First, compute the shake256 cas.Digest of the files. This will include a\n\t// sorted list of file names and their digests.\n\tfilesDigest, err := getFilesDigestForB5Digest(ctx, bucketWithStorageMatcherApplied)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif filesDigest.Type() != cas.DigestTypeShake256 {\n\t\treturn nil, syserror.Newf(\"trying to compute b5 Digest with files digest of type %v\", filesDigest.Type())\n\t}\n\t// Next, we get the b5 digests of all the dependencies and sort their string representations.\n\tdepDigestStrings, err := xslices.MapError(\n\t\tdepDigests,\n\t\tfunc(digest Digest) (string, error) {\n\t\t\tif digest.Type() != DigestTypeB5 {\n\t\t\t\t// Even if the buf.lock file had a b4 digest, we should still end up retrieving the b5\n\t\t\t\t// digest from the BSR, we should never have a b5 digest here.\n\t\t\t\treturn \"\", syserror.Newf(\"trying to compute b5 Digest with dependency digest of type %v\", digest.Type())\n\t\t\t}\n\t\t\treturn digest.String(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Strings(depDigestStrings)\n\t// Now, place the file digest first, then the sorted dependency digests afterwards.\n\tdigestStrings := append([]string{filesDigest.String()}, depDigestStrings...)\n\t// Join these strings together with newlines, and make a new shake256 digest.\n\tdigestOfDigests, err := cas.NewDigestForContent(strings.NewReader(strings.Join(digestStrings, \"\\n\")))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// The resulting digest is a b5 digest.\n\treturn NewDigest(DigestTypeB5, digestOfDigests)\n}\n\n// The bucket should have already been filtered to just module files.\nfunc getFilesDigestForB5Digest(\n\tctx context.Context,\n\tbucketWithStorageMatcherApplied storage.ReadBucket,\n) (cas.Digest, error) {\n\treturn cas.BucketToDigest(\n\t\tctx,\n\t\t// This is extreme defensive programming. We've gone out of our way to make sure\n\t\t// that the bucket is already filtered, but it's just too important to mess up here.\n\t\tstorage.FilterReadBucket(bucketWithStorageMatcherApplied, getStorageMatcher(ctx, bucketWithStorageMatcherApplied)),\n\t\tcas.DigestTypeShake256,\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"errors\"\n\t\"io/fs\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\nvar (\n\t// ErrNoTargetProtoFiles is the error to return if no target .proto files were found in situations where\n\t// they were expected to be found.\n\t//\n\t// Pre-refactor, we had extremely exacting logic that determined if --path and --exclude-path were valid\n\t// paths, which almost no CLI tool does. This logic had a heavy burden, when typically this error message\n\t// is enough (and again, is more than almost any other CLI does - most CLIs silently move on if invalid\n\t// paths are specified). The pre-refactor logic was the \"allowNotExist\" logic. Removing the allowNotExist\n\t// logic was not a breaking change - we do not error in any place that we previously did not.\n\t//\n\t// This is used by bufctl.Controller.GetTargetImageWithConfigs, bufworkspace.WorkspaceProvider.GetWorkspaceForBucket, and bufimage.BuildImage.\n\t//\n\t// We do assume flag names here, but we're just going with reality.\n\tErrNoTargetProtoFiles = errors.New(\"no .proto files were targeted. This can occur if no .proto files are found in your input, --path points to files that do not exist, or --exclude-path excludes all files.\")\n)\n\n// ImportNotExistError is the error returned from ModuleDeps() if an import does not exist.\n//\n// Unwrap() always returns fs.ErrNotExist.\ntype ImportNotExistError struct {\n\tfileInfo   FileInfo\n\timportPath string\n}\n\n// Error implements the error interface.\nfunc (i *ImportNotExistError) Error() string {\n\tif i == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\tif i.fileInfo != nil {\n\t\tif externalPath := i.fileInfo.ExternalPath(); externalPath != \"\" {\n\t\t\t_, _ = builder.WriteString(externalPath)\n\t\t\t_, _ = builder.WriteString(`: `)\n\t\t}\n\t}\n\tif i.importPath != \"\" {\n\t\t_, _ = builder.WriteString(`import \"`)\n\t\t_, _ = builder.WriteString(i.importPath)\n\t\t_, _ = builder.WriteString(`\": `)\n\t}\n\t_, _ = builder.WriteString(i.Unwrap().Error())\n\treturn builder.String()\n}\n\n// Unwrap returns fs.ErrNotExist.\nfunc (i *ImportNotExistError) Unwrap() error {\n\tif i == nil {\n\t\treturn nil\n\t}\n\treturn fs.ErrNotExist\n}\n\n// ModuleCycleError is the error returned if a cycle is detected in module dependencies.\ntype ModuleCycleError struct {\n\t// Descriptions are the module descriptions that represent the cycle.\n\tDescriptions []string\n}\n\n// Error implements the error interface.\nfunc (m *ModuleCycleError) Error() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t_, _ = builder.WriteString(\"cycle detected in module dependencies:\\n\")\n\tfor i, description := range m.Descriptions {\n\t\tif i == 0 {\n\t\t\t_, _ = builder.WriteString(\"    \")\n\t\t} else {\n\t\t\t_, _ = builder.WriteString(\" -> \")\n\t\t}\n\t\t_, _ = builder.WriteString(description)\n\t\tif i != len(m.Descriptions)-1 {\n\t\t\t_, _ = builder.WriteString(\"\\n\")\n\t\t}\n\t}\n\treturn builder.String()\n}\n\n// DuplicateProtoPathError is the error returned if a .proto file with the same path\n// is detected in two or more Modules.\n//\n// This check is done as part of ModuleReadBucket.Walks, and Module.ModuleDeps.\ntype DuplicateProtoPathError struct {\n\t// ProtoPath is the path of the .proto that is duplicated.\n\t//\n\t// A well-formed DuplicateProtoPathError will have a normalized and non-empty ProtoPath.\n\tProtoPath string\n\t// ModuleDescriptions are the Module descriptions that contain the ProtoPath.\n\t//\n\t// A well-formed DuplicateProtoPathError will have two or more Module descriptions.\n\tModuleDescriptions []string\n}\n\n// Error implements the error interface.\nfunc (d *DuplicateProtoPathError) Error() string {\n\tif d == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t// Writing even if the error is malformed via d.Path being empty.\n\t_, _ = builder.WriteString(d.ProtoPath)\n\t_, _ = builder.WriteString(\" is contained in multiple modules:\\n\")\n\tfor i, moduleDescription := range d.ModuleDescriptions {\n\t\t_, _ = builder.WriteString(\"  \")\n\t\t_, _ = builder.WriteString(moduleDescription)\n\t\tif i != len(d.ModuleDescriptions)-1 {\n\t\t\t_, _ = builder.WriteString(\"\\n\")\n\t\t}\n\t}\n\treturn builder.String()\n}\n\n// NoProtoFilesError is the error returned if a Module has no .proto files.\n//\n// This check is done as part of ModuleReadBucket.Walks.\ntype NoProtoFilesError struct {\n\t// ModuleDescription is the description of the Module that has no .proto files.\n\t//\n\t// A well-formed NoProtoFilesError will have a non-empty ModuleDescription.\n\tModuleDescription string\n}\n\n// Error implements the error interface.\nfunc (n *NoProtoFilesError) Error() string {\n\tif n == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t_, _ = builder.WriteString(`Module \"`)\n\t// Writing even if the error is malformed via d.ModuleDescription being empty.\n\t_, _ = builder.WriteString(n.ModuleDescription)\n\t_, _ = builder.WriteString(`\" had no .proto files`)\n\treturn builder.String()\n}\n\n// DigestMismatchError is the error returned if the Digest of a downloaded Module or Commit\n// does not match the expected digest in a buf.lock file.\ntype DigestMismatchError struct {\n\tFullName       bufparse.FullName\n\tCommitID       uuid.UUID\n\tExpectedDigest Digest\n\tActualDigest   Digest\n}\n\n// Error implements the error interface.\nfunc (m *DigestMismatchError) Error() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t_, _ = builder.WriteString(`*** Digest verification failed`)\n\tif m.FullName != nil {\n\t\t_, _ = builder.WriteString(` for \"`)\n\t\t_, _ = builder.WriteString(m.FullName.String())\n\t\tif m.CommitID != uuid.Nil {\n\t\t\t_, _ = builder.WriteString(`:`)\n\t\t\t_, _ = builder.WriteString(uuidutil.ToDashless(m.CommitID))\n\t\t}\n\t\t_, _ = builder.WriteString(`\"`)\n\t}\n\t_, _ = builder.WriteString(` ***`)\n\t_, _ = builder.WriteString(\"\\n\")\n\tif m.ExpectedDigest != nil && m.ActualDigest != nil {\n\t\t_, _ = builder.WriteString(\"\\t\")\n\t\t_, _ = builder.WriteString(`Expected digest (from buf.lock): \"`)\n\t\t_, _ = builder.WriteString(m.ExpectedDigest.String())\n\t\t_, _ = builder.WriteString(`\"`)\n\t\t_, _ = builder.WriteString(\"\\n\")\n\t\t_, _ = builder.WriteString(\"\\t\")\n\t\t_, _ = builder.WriteString(`Actual digest: \"`)\n\t\t_, _ = builder.WriteString(m.ActualDigest.String())\n\t\t_, _ = builder.WriteString(`\"`)\n\t\t_, _ = builder.WriteString(\"\\n\")\n\t}\n\t_, _ = builder.WriteString(\"\\t\")\n\t_, _ = builder.WriteString(`This may be the result of a hand-edited or corrupted buf.lock file, a corrupted local cache, and/or an attack.`)\n\t_, _ = builder.WriteString(\"\\n\")\n\t_, _ = builder.WriteString(\"\\t\")\n\t_, _ = builder.WriteString(`To clear your local cache, run \"buf registry cc\".`)\n\treturn builder.String()\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport \"io\"\n\n// File is a file within a Module.\ntype File interface {\n\tFileInfo\n\tio.ReadCloser\n\n\tisFile()\n}\n\n// *** PRIVATE ***\n\ntype file struct {\n\tFileInfo\n\tio.ReadCloser\n}\n\nfunc newFile(fileInfo FileInfo, readCloser io.ReadCloser) *file {\n\treturn &file{\n\t\tFileInfo:   fileInfo,\n\t\tReadCloser: readCloser,\n\t}\n}\n\nfunc (*file) isFile() {}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/file_info.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// FileInfo is the file info for a Module file.\n//\n// It comprises the typical storage.ObjectInfo, along with a pointer back to the Module.\n// This allows callers to figure out i.e. the FullName, Commit, as well as any other\n// data it may need.\ntype FileInfo interface {\n\tstorage.ObjectInfo\n\n\t// Module returns the Module that contains this file.\n\tModule() Module\n\t// FileType returns the FileType of the file.\n\t//\n\t// This denotes if the File is a .proto file, documentation file, or license file.\n\tFileType() FileType\n\t// IsTargetFile returns true if the File is targeted.\n\t//\n\t// Files are either targets or imports.\n\t// If Module.IsTarget() is false, this will always be false.\n\t//\n\t// If specific Files were not targeted but Module.IsTarget() is true, all Files in\n\t// the Module will have IsTargetFile() set to true.\n\tIsTargetFile() bool\n\n\t// ProtoFileImports returns the file's declared .proto imports, if any.\n\t//\n\t// Always returns empty if this file is not a .proto file.\n\tProtoFileImports() ([]string, error)\n\n\t// protoFilePackage returns the file's declared Protobuf package, any.\n\t//\n\t// Always returns empty if this file is not a .proto file.\n\t//\n\t// Not exposing this function publicly yet as we don't have a use case.\n\tprotoFilePackage() (string, error)\n\n\tisFileInfo()\n}\n\n// FileInfoPaths is a convenience function that returns the paths of the FileInfos.\nfunc FileInfoPaths(fileInfos []FileInfo) []string {\n\treturn xslices.Map(fileInfos, func(fileInfo FileInfo) string { return fileInfo.Path() })\n}\n\n// *** PRIVATE ***\n\ntype fileInfo struct {\n\tstorage.ObjectInfo\n\n\tmodule              Module\n\tfileType            FileType\n\tisTargetFile        bool\n\tgetProtoFileImports func() ([]string, error)\n\tgetProtoFilePackage func() (string, error)\n}\n\nfunc newFileInfo(\n\tobjectInfo storage.ObjectInfo,\n\tmodule Module,\n\tfileType FileType,\n\tisTargetFile bool,\n\tgetProtoFileImports func() ([]string, error),\n\tgetProtoFilePackage func() (string, error),\n) *fileInfo {\n\treturn &fileInfo{\n\t\tObjectInfo:          objectInfo,\n\t\tmodule:              module,\n\t\tfileType:            fileType,\n\t\tisTargetFile:        isTargetFile,\n\t\tgetProtoFileImports: sync.OnceValues(getProtoFileImports),\n\t\tgetProtoFilePackage: sync.OnceValues(getProtoFilePackage),\n\t}\n}\n\nfunc (f *fileInfo) Module() Module {\n\treturn f.module\n}\n\nfunc (f *fileInfo) FileType() FileType {\n\treturn f.fileType\n}\n\nfunc (f *fileInfo) IsTargetFile() bool {\n\treturn f.isTargetFile\n}\n\nfunc (f *fileInfo) ProtoFileImports() ([]string, error) {\n\treturn f.getProtoFileImports()\n}\n\nfunc (f *fileInfo) protoFilePackage() (string, error) {\n\treturn f.getProtoFilePackage()\n}\n\nfunc (*fileInfo) isFileInfo() {}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/file_type.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\nconst (\n\t// FileTypeProto is the file type for .proto files.\n\tFileTypeProto FileType = iota + 1\n\t// FileTypeDoc is the file type for documentation files.\n\tFileTypeDoc\n\t// FileTypeLicense is the file type for license files.\n\tFileTypeLicense\n)\n\nvar (\n\tfileTypeToString = map[FileType]string{\n\t\tFileTypeProto:   \"proto\",\n\t\tFileTypeDoc:     \"doc\",\n\t\tFileTypeLicense: \"license\",\n\t}\n\tstringToFileType = map[string]FileType{\n\t\t\"proto\":   FileTypeProto,\n\t\t\"doc\":     FileTypeDoc,\n\t\t\"license\": FileTypeLicense,\n\t}\n)\n\n// FileType is a tile type within a module.\ntype FileType int\n\n// String implements fmt.Stringer.\nfunc (c FileType) String() string {\n\ts, ok := fileTypeToString[c]\n\tif !ok {\n\t\treturn strconv.Itoa(int(c))\n\t}\n\treturn s\n}\n\n// ParseFileType parses the file type from its string representation.\n//\n// This reverses FileType.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseFileType(s string) (FileType, error) {\n\tc, ok := stringToFileType[s]\n\tif !ok {\n\t\treturn 0, bufparse.NewParseError(\n\t\t\t\"module file type\",\n\t\t\ts,\n\t\t\tfmt.Errorf(\"unknown type: %q\", s),\n\t\t)\n\t}\n\treturn c, nil\n}\n\n// FileTypeForPath returns the FileType for the given path.\n//\n// Returns error if the path cannot be classified as a FileType, that is if it is not a\n// .proto file, license file, or documentation file.\n//\n// Note that license and documentation files must be at the root, and cannot be in subdirectories. That is,\n// subdir/LICENSE will not be classified as a FileTypeLicense, but LICENSE will be.\nfunc FileTypeForPath(path string) (FileType, error) {\n\tif normalpath.Ext(path) == \".proto\" {\n\t\treturn FileTypeProto, nil\n\t}\n\tif path == licenseFilePath {\n\t\treturn FileTypeLicense, nil\n\t}\n\tif _, ok := docFilePathMap[path]; ok {\n\t\treturn FileTypeDoc, nil\n\t}\n\treturn 0, fmt.Errorf(\"could not classify FileType for path %q\", path)\n}\n\n// IsValidModuleFilePath returns true if the given file path is a valid Module file path.\n//\n// This will be true if the file path represents a .proto file, license file, or documentation file.\n//\n// Note that license and documentation files must be at the root, and cannot be in subdirectories. That is,\n// subdir/LICENSE is not a valid module file (including on push), but LICENSE is.\nfunc IsValidModuleFilePath(filePath string) bool {\n\t_, err := FileTypeForPath(filePath)\n\treturn err == nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/graph_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/pkg/dag\"\n)\n\nvar (\n\t// NopGraphProvider is a no-op GraphProvider.\n\tNopGraphProvider GraphProvider = nopGraphProvider{}\n)\n\n// GraphProvider provides directed acyclic graphs for ModuleKeys.\ntype GraphProvider interface {\n\t// GetGraphForModuleKeys gets the Graph for the given ModuleKeys.\n\t//\n\t// The key will be the ModuleKey.CommitID().\n\t//\n\t// The input ModuleKeys are expected to be unique by FullName. The implementation\n\t// may error if this is not the case.\n\t//\n\t// The input ModuleKeys are expected to have the same DigestType. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If any ModuleKey is not found, an error with fs.ErrNotExist will be returned.\n\tGetGraphForModuleKeys(context.Context, []ModuleKey) (*dag.Graph[RegistryCommitID, ModuleKey], error)\n}\n\n// *** PRIVATE ***\n\ntype nopGraphProvider struct{}\n\nfunc (nopGraphProvider) GetGraphForModuleKeys(\n\tcontext.Context,\n\t[]ModuleKey,\n) (*dag.Graph[RegistryCommitID, ModuleKey], error) {\n\treturn nil, fs.ErrNotExist\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\n// Module presents a BSR module.\ntype Module interface {\n\t// ModuleReadBucket allows for reading of a Module's files.\n\t//\n\t// A Module consists of .proto files, documentation file(s), and license file(s). All of these\n\t// are accessible via the functions on ModuleReadBucket.\n\t//\n\t// This bucket is not self-contained - it requires the files from dependencies to be so.\n\t//\n\t// A ModuleReadBucket directly derived from a Module will always have at least one .proto file.\n\t// If this is not the case, WalkFileInfos will return an error when called.\n\tModuleReadBucket\n\n\t// OpaqueID returns an unstructured ID that can uniquely identify a Module relative\n\t// to other Modules it was built with from a ModuleSetBuilder.\n\t//\n\t// Always present, regardless of whether a Module was provided by a ModuleProvider,\n\t// or built with a ModuleSetBuilder.\n\t//\n\t// An OpaqueID can be used to denote expected uniqueness of content; if two Modules\n\t// have different IDs, they should be expected to be logically different Modules.\n\t//\n\t// An OpaqueID can be used as a human-readable identifier of the Module, suitable for printing\n\t// to a console. However, the OpaqueID may contain information on local directory structure, so\n\t// do not log or print it in contexts where such information may be sensitive.\n\t//\n\t// An OpaqueID's structure should not be relied upon, and is not a globally-unique identifier.\n\t// It's uniqueness property only applies to the lifetime of the Module, and only within\n\t// Modules commonly built from a ModuleSetBuilder.\n\t//\n\t// If two Modules have the same FullName, they will have the same OpaqueID.\n\tOpaqueID() string\n\t// BucketID is an unstructured ID that represents the Bucket that this Module was constructed\n\t// with via ModuleSetProvider.\n\t//\n\t// A BucketID will be unique within a given ModuleSet.\n\t//\n\t// A BucketID's structure should not be relied upon, and is not a globally-unique identifier.\n\t// It's uniqueness property only applies to the lifetime of the Module, and only within\n\t// Modules commonly built from a ModuleSetBuilder.\n\t//\n\t// A BucketID may contain information on local directory structure, so do not log or print it\n\t// in contexts where such information may be sensitive.\n\t//\n\t// May be empty if a Module was not constructed with a Bucket via a ModuleSetProvider.\n\tBucketID() string\n\t// FullName returns the full name of the Module.\n\t//\n\t// May be nil. Callers should not rely on this value being present.\n\t// However, this is always present for remote Modules.\n\t//\n\t// At least one of FullName and BucketID will always be present. Use OpaqueID\n\t// as an always-present identifier.\n\tFullName() bufparse.FullName\n\t// CommitID returns the BSR ID of the Commit.\n\t//\n\t// It is up to the caller to convert this to a dashless ID when necessary.\n\t//\n\t// May be empty, that is CommitID() == uuid.Nil may be true.\n\t// Callers should not rely on this value being present.\n\t//\n\t// If FullName is nil, this will always be empty.\n\tCommitID() uuid.UUID\n\t// Description returns a human-readable description of the Module.\n\t//\n\t// This can be manually set by a constructor of a Module. In practice, the only current way\n\t// to specifically set this string is by calling LocalModuleWithDescription when constructing\n\t// a ModuleSet.\n\t//\n\t// This is used to construct descriptive error messages pointing to configured modules.\n\t// For example, this may return something along the lines of:\n\t//\n\t//   path: proto/foo, includes; [\"a\", \"b\"], excludes: \"c\"\n\t//\n\t// The shape of this field should not be relied upon.\n\t// This field will be unique within a given ModuleSet.\n\t//\n\t// This will never be empty. If a description was not explicitly set, this falls back to\n\t// OpaqueID.\n\tDescription() string\n\n\t// Digest returns the Module digest for the given DigestType.\n\t//\n\t// Note this is *not* a cas.Digest - this is a Digest. cas.Digests are a lower-level\n\t// type that just deal in terms of files and content. A Digest is a specific algorithm\n\t// applied to a set of files and dependencies.\n\tDigest(DigestType) (Digest, error)\n\n\t// ModuleDeps returns the dependencies for this specific Module.\n\t//\n\t// Includes transitive dependencies. Use ModuleDep.IsDirect() to determine if a dependency is direct\n\t// or transitive.\n\t//\n\t// This list is pruned - only Modules that this Module actually depends on (either directly or transitively)\n\t// via import statements within its .proto files will be returned.\n\t//\n\t// Dependencies with the same FullName will always have the same Commits and Digests.\n\t//\n\t// Sorted by OpaqueID.\n\tModuleDeps() ([]ModuleDep, error)\n\n\t// IsTarget returns true if the Module is a targeted Module.\n\t//\n\t// Modules are either targets or non-targets.\n\t// Modules directly returned from a ModuleProvider will always be marked as targets.\n\t// Modules created file ModuleSetBuilders may or may not be marked as targets.\n\t//\n\t// Files within a targeted Module can be targets or non-targets themselves (non-target = import).\n\t// FileInfos have a function FileInfo.IsTargetFile() to denote if they are targets.\n\t// Note that no Files from a Module will have IsTargetFile() set to true if\n\t// IsTarget() is false.\n\t//\n\t// If specific Files were not targeted but the Module was targeted, all Files in the Module\n\t// will have FileInfo.IsTargetFile() set to true, and this function will return all Files\n\t// that WalkFileInfos does.\n\t//\n\t// Note that a Module may be targeted but have none of its files targeted - this can occur\n\t// when path filtering occurs, but no paths given matched any paths in the Module, but\n\t// the Module itself was targeted.\n\tIsTarget() bool\n\n\t// IsLocal return true if the Module is a local Module.\n\t//\n\t// Modules are either local or remote.\n\t//\n\t// A local Module is one which was built from sources from the \"local context\", such\n\t// a Workspace containing Modules, or a ModuleNode in a CreateCommitRequest. Local\n\t// Modules are important for understanding what Modules to push, and what modules to\n\t// check declared dependencies for unused dependencies.\n\t//\n\t// A remote Module is one which was not contained in the local context, such as\n\t// dependencies specified in a buf.lock (with no corresponding Module in the Workspace),\n\t// or a DepNode in a CreateCommitRequest with no corresponding ModuleNode.\n\t//\n\t// Remote Modules will always have FullNames.\n\tIsLocal() bool\n\n\t// V1Beta1OrV1BufYAMLObjectData returns the original source buf.yaml associated with this Module, if the\n\t// Module was backed with a v1beta1 or v1 buf.yaml.\n\t//\n\t// This may not be set, in the cases where a v1 Module was built with no buf.yaml (ie the defaults),\n\t// or with a v2 Module.\n\t//\n\t// This file content is just used for dependency calculations. It is not parsed.\n\tV1Beta1OrV1BufYAMLObjectData() (ObjectData, error)\n\t// V1Beta1OrV1BufLockObjectData returns the original source buf.lock associated with this Module, if the\n\t// Module was backed with a v1beta1 or v1 buf.lock.\n\t//\n\t// This may not be set, in the cases where a buf.lock was not present due to no dependencies, or\n\t// with a v2 Module.\n\t//\n\t// This file content is just used for dependency calculations. It is not parsed.\n\tV1Beta1OrV1BufLockObjectData() (ObjectData, error)\n\n\t// ModuleSet returns the ModuleSet that this Module is contained within.\n\t//\n\t// Always present.\n\tModuleSet() ModuleSet\n\n\t// Called in newModuleSet.\n\tsetModuleSet(ModuleSet)\n\n\t// withIsTarget returns a copy of the Module with the specified target value.\n\t//\n\t// Do not expose publicly! This should only be called by ModuleSet.WithTargetOpaqueIDs.\n\t// Exposing this directly publicly can have unintended consequences - Modules have a\n\t// parent ModuleSet, which is self-contained, and a copy of a Module inside a ModuleSet\n\t// that itself has the same ModuleSet will break the expected pattern of the references.\n\twithIsTarget(isTarget bool) (Module, error)\n\tisModule()\n}\n\n// ModuleToModuleKey returns a new ModuleKey for the given Module.\n//\n// The given Module must have a FullName and CommitID, otherwise this will return error.\nfunc ModuleToModuleKey(module Module, digestType DigestType) (ModuleKey, error) {\n\treturn newModuleKey(\n\t\tmodule.FullName(),\n\t\tmodule.CommitID(),\n\t\tfunc() (Digest, error) {\n\t\t\treturn module.Digest(digestType)\n\t\t},\n\t)\n}\n\n// ModuleDirectModuleDeps is a convenience function that returns only the direct dependencies of the Module.\nfunc ModuleDirectModuleDeps(module Module) ([]ModuleDep, error) {\n\tmoduleDeps, err := module.ModuleDeps()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.Filter(\n\t\tmoduleDeps,\n\t\tfunc(moduleDep ModuleDep) bool { return moduleDep.IsDirect() },\n\t), nil\n}\n\n// *** PRIVATE ***\n\n// module\n\ntype module struct {\n\tModuleReadBucket\n\n\tctx                    context.Context\n\tgetBucket              func() (storage.ReadBucket, error)\n\tbucketID               string\n\tdescription            string\n\tmoduleFullName         bufparse.FullName\n\tcommitID               uuid.UUID\n\tisTarget               bool\n\tisLocal                bool\n\tgetV1BufYAMLObjectData func() (ObjectData, error)\n\tgetV1BufLockObjectData func() (ObjectData, error)\n\tgetDepModuleKeysB5     func() ([]ModuleKey, error)\n\n\tmoduleSet ModuleSet\n\n\tdigestTypeToGetDigest map[DigestType]func() (Digest, error)\n\tgetModuleDeps         func() ([]ModuleDep, error)\n}\n\n// must set ModuleReadBucket after constructor via setModuleReadBucket\nfunc newModule(\n\tctx context.Context,\n\t// This function must already be filtered to include only module files and must be sync.OnceValues wrapped!\n\tsyncOnceValuesGetBucketWithStorageMatcherApplied func() (storage.ReadBucket, error),\n\tbucketID string,\n\tdescription string,\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tisTarget bool,\n\tisLocal bool,\n\tgetV1BufYAMLObjectData func() (ObjectData, error),\n\tgetV1BufLockObjectData func() (ObjectData, error),\n\tgetDepModuleKeysB5 func() ([]ModuleKey, error),\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tprotoFileTargetPath string,\n\tincludePackageFiles bool,\n) (*module, error) {\n\t// TODO FUTURE: get these validations into a common place\n\tif protoFileTargetPath != \"\" && (len(targetPaths) > 0 || len(targetExcludePaths) > 0) {\n\t\treturn nil, syserror.Newf(\"cannot set both protoFileTargetPath %q and either targetPaths %v or targetExcludePaths %v\", protoFileTargetPath, targetPaths, targetExcludePaths)\n\t}\n\tif protoFileTargetPath != \"\" && normalpath.Ext(protoFileTargetPath) != \".proto\" {\n\t\treturn nil, syserror.Newf(\"protoFileTargetPath %q is not a .proto file\", protoFileTargetPath)\n\t}\n\tif bucketID == \"\" && moduleFullName == nil {\n\t\treturn nil, syserror.New(\"bucketID was empty and moduleFullName was nil when constructing a Module, one of these must be set\")\n\t}\n\tif !isLocal && moduleFullName == nil {\n\t\treturn nil, syserror.New(\"moduleFullName not present when constructing a remote Module\")\n\t}\n\tif moduleFullName == nil && commitID != uuid.Nil {\n\t\treturn nil, syserror.New(\"moduleFullName not present and commitID present when constructing a remote Module\")\n\t}\n\n\tnormalizeAndValidateIfNotEmpty := func(path string) (string, error) {\n\t\tif path == \"\" {\n\t\t\treturn path, nil\n\t\t}\n\t\treturn normalpath.NormalizeAndValidate(path)\n\t}\n\ttargetPaths, err := xslices.MapError(targetPaths, normalizeAndValidateIfNotEmpty)\n\tif err != nil {\n\t\treturn nil, syserror.Wrap(err)\n\t}\n\ttargetExcludePaths, err = xslices.MapError(targetExcludePaths, normalizeAndValidateIfNotEmpty)\n\tif err != nil {\n\t\treturn nil, syserror.Wrap(err)\n\t}\n\tprotoFileTargetPath, err = normalizeAndValidateIfNotEmpty(protoFileTargetPath)\n\tif err != nil {\n\t\treturn nil, syserror.Wrap(err)\n\t}\n\n\tmodule := &module{\n\t\tctx:                    ctx,\n\t\tgetBucket:              syncOnceValuesGetBucketWithStorageMatcherApplied,\n\t\tbucketID:               bucketID,\n\t\tdescription:            description,\n\t\tmoduleFullName:         moduleFullName,\n\t\tcommitID:               commitID,\n\t\tisTarget:               isTarget,\n\t\tisLocal:                isLocal,\n\t\tgetV1BufYAMLObjectData: sync.OnceValues(getV1BufYAMLObjectData),\n\t\tgetV1BufLockObjectData: sync.OnceValues(getV1BufLockObjectData),\n\t\tgetDepModuleKeysB5:     sync.OnceValues(getDepModuleKeysB5),\n\t}\n\tmoduleReadBucket, err := newModuleReadBucketForModule(\n\t\tctx,\n\t\tsyncOnceValuesGetBucketWithStorageMatcherApplied,\n\t\tmodule,\n\t\ttargetPaths,\n\t\ttargetExcludePaths,\n\t\tprotoFileTargetPath,\n\t\tincludePackageFiles,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmodule.ModuleReadBucket = moduleReadBucket\n\tmodule.digestTypeToGetDigest = newSyncOnceValueDigestTypeToGetDigestFuncForModule(module)\n\tmodule.getModuleDeps = sync.OnceValues(newGetModuleDepsFuncForModule(module))\n\treturn module, nil\n}\n\nfunc (m *module) OpaqueID() string {\n\t// We know that one of bucketID and moduleFullName are present via construction.\n\t//\n\t// Prefer moduleFullName since modules with the same FullName should have the same OpaqueID.\n\tif m.moduleFullName != nil {\n\t\treturn m.moduleFullName.String()\n\t}\n\treturn m.bucketID\n}\n\nfunc (m *module) BucketID() string {\n\treturn m.bucketID\n}\n\nfunc (m *module) FullName() bufparse.FullName {\n\treturn m.moduleFullName\n}\n\nfunc (m *module) CommitID() uuid.UUID {\n\treturn m.commitID\n}\n\nfunc (m *module) Description() string {\n\tif m.description != \"\" {\n\t\treturn m.description\n\t}\n\treturn m.OpaqueID()\n}\n\nfunc (m *module) Digest(digestType DigestType) (Digest, error) {\n\tgetDigest, ok := m.digestTypeToGetDigest[digestType]\n\tif !ok {\n\t\treturn nil, syserror.Newf(\"DigestType %v was not in module.digestTypeToGetDigest\", digestType)\n\t}\n\treturn getDigest()\n}\n\nfunc (m *module) ModuleDeps() ([]ModuleDep, error) {\n\treturn m.getModuleDeps()\n}\n\nfunc (m *module) IsTarget() bool {\n\treturn m.isTarget\n}\n\nfunc (m *module) IsLocal() bool {\n\treturn m.isLocal\n}\n\nfunc (m *module) V1Beta1OrV1BufYAMLObjectData() (ObjectData, error) {\n\treturn m.getV1BufYAMLObjectData()\n}\n\nfunc (m *module) V1Beta1OrV1BufLockObjectData() (ObjectData, error) {\n\treturn m.getV1BufLockObjectData()\n}\n\nfunc (m *module) ModuleSet() ModuleSet {\n\treturn m.moduleSet\n}\n\nfunc (m *module) withIsTarget(isTarget bool) (Module, error) {\n\t// We don't just call newModule directly as we don't want to double sync.OnceValues stuff.\n\tnewModule := &module{\n\t\tctx:                    m.ctx,\n\t\tgetBucket:              m.getBucket,\n\t\tbucketID:               m.bucketID,\n\t\tdescription:            m.description,\n\t\tmoduleFullName:         m.moduleFullName,\n\t\tcommitID:               m.commitID,\n\t\tisTarget:               isTarget,\n\t\tisLocal:                m.isLocal,\n\t\tgetV1BufYAMLObjectData: m.getV1BufYAMLObjectData,\n\t\tgetV1BufLockObjectData: m.getV1BufLockObjectData,\n\t\tgetDepModuleKeysB5:     m.getDepModuleKeysB5,\n\t}\n\tmoduleReadBucket, ok := m.ModuleReadBucket.(*moduleReadBucket)\n\tif !ok {\n\t\treturn nil, syserror.Newf(\"expected ModuleReadBucket to be a *moduleReadBucket but was a %T\", m.ModuleReadBucket)\n\t}\n\tnewModule.ModuleReadBucket = moduleReadBucket.withModule(newModule)\n\tnewModule.digestTypeToGetDigest = newSyncOnceValueDigestTypeToGetDigestFuncForModule(newModule)\n\tnewModule.getModuleDeps = sync.OnceValues(newGetModuleDepsFuncForModule(newModule))\n\treturn newModule, nil\n}\n\nfunc (m *module) setModuleSet(moduleSet ModuleSet) {\n\tm.moduleSet = moduleSet\n}\n\nfunc (*module) isModule() {}\n\nfunc newSyncOnceValueDigestTypeToGetDigestFuncForModule(module *module) map[DigestType]func() (Digest, error) {\n\tm := make(map[DigestType]func() (Digest, error))\n\tfor digestType := range digestTypeToString {\n\t\tm[digestType] = sync.OnceValues(newGetDigestFuncForModuleAndDigestType(module, digestType))\n\t}\n\treturn m\n}\n\nfunc newGetDigestFuncForModuleAndDigestType(module *module, digestType DigestType) func() (Digest, error) {\n\treturn func() (Digest, error) {\n\t\tbucket, err := module.getBucket()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tswitch digestType {\n\t\tcase DigestTypeB4:\n\t\t\tv1BufYAMLObjectData, err := module.getV1BufYAMLObjectData()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tv1BufLockObjectData, err := module.getV1BufLockObjectData()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn getB4Digest(module.ctx, bucket, v1BufYAMLObjectData, v1BufLockObjectData)\n\t\tcase DigestTypeB5:\n\t\t\t// B5 digests are calculated from the Module's content and its dependencies.\n\t\t\t//\n\t\t\t// Dependencies are all direct and transitive dependencies of the Module.\n\t\t\t// For local Modules, the dependencies are resolved to the current ModuleSet.\n\t\t\t// For remote Modules, the dependencies are the ModuleKeys of\n\t\t\t// the direct and transitive dependencies of the Module at the specific commit.\n\t\t\t//\n\t\t\t// This is effectively the same. The local Modules have a dependency at the current commit,\n\t\t\t// and the remote Modules have a dependency at a specific commit. Pushing up a local Module\n\t\t\t// as a remote Module will result in the same Digest.\n\t\t\t//\n\t\t\t// See the comment on getDepModuleKeysB5 for more information.\n\t\t\tif !module.isLocal {\n\t\t\t\tdepModuleKeys, err := module.getDepModuleKeysB5()\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 getB5DigestForBucketAndDepModuleKeys(module.ctx, bucket, depModuleKeys)\n\t\t\t}\n\t\t\t// ModuleDeps returns the dependent Modules resolved for the target Module in the ModuleSet.\n\t\t\t// A local Module will recursively resolve the Digest of other dependent local Modules.\n\t\t\t// This is done by calling Module.Digest(DigestTypeB5) on each ModuleDep.\n\t\t\tmoduleDeps, err := module.ModuleDeps()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn getB5DigestForBucketAndModuleDeps(module.ctx, bucket, moduleDeps)\n\t\tdefault:\n\t\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t\t}\n\t}\n}\n\nfunc newGetModuleDepsFuncForModule(module *module) func() ([]ModuleDep, error) {\n\treturn func() ([]ModuleDep, error) {\n\t\treturn getModuleDeps(module.ctx, module)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_data.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// ModuleData presents raw Module data read by ModuleKey.\n//\n// It is not a fully-formed Module; only ModuleSetBuilders (and ModuleSets) can provide Modules.\n//\n// A ModuleData generally represents the data on a Module read from the BSR API or a cache.\n//\n// Tamper-proofing is done as part of every function.\ntype ModuleData interface {\n\t// ModuleKey contains the ModuleKey that was used to download this ModuleData.\n\t//\n\t// The Digest from this ModuleKey is used for tamper-proofing. It will be checked against\n\t// the actual data downloaded before Bucket() or DepModuleKeys() returns.\n\tModuleKey() ModuleKey\n\t// Bucket returns a Bucket of the Module's files.\n\t//\n\t// This bucket is not self-contained - it requires the files from dependencies to be so.\n\t//\n\t// This bucket will only contain module files - it will be filtered via NewModuleData.\n\tBucket() (storage.ReadBucket, error)\n\t// DepModuleKeys returns the dependencies for this specific Module.\n\t//\n\t// The dependencies are the same as that would appear in the v1 buf.lock file.\n\t// These include all direct and transitive dependencies. A Module constructed\n\t// from this ModuleData as the target will require all Modules referenced by\n\t// its DepModuleKeys to be present in the ModuleSet.\n\t//\n\t// This is used for digest calculations.\n\tDepModuleKeys() ([]ModuleKey, error)\n\n\t// V1Beta1OrV1BufYAMLObjectData gets the v1beta1 or v1 buf.yaml ObjectData.\n\t//\n\t// This may not be present. It will only be potentially present for v1 buf.yaml files.\n\t//\n\t// This is used for digest calculations. It is not used otherwise.\n\tV1Beta1OrV1BufYAMLObjectData() (ObjectData, error)\n\t// V1Beta1OrV1BufLockObjectData gets the v1beta1 or v1 buf.lock ObjectData.\n\t//\n\t// This may not be present. It will only be potentially present for v1 buf.lock files.\n\t//\n\t// This is used for digest calculations. It is not used otherwise.\n\tV1Beta1OrV1BufLockObjectData() (ObjectData, error)\n\n\tisModuleData()\n}\n\n// NewModuleData returns a new ModuleData.\n//\n// getBucket and getDepModuleKeys are meant to be lazily-loaded functions where possible.\n//\n// It is OK for getBucket to return a bucket that has extra files that are not part of the Module, this\n// bucket will be filtered as part of this function.\nfunc NewModuleData(\n\tctx context.Context,\n\tmoduleKey ModuleKey,\n\tgetBucket func() (storage.ReadBucket, error),\n\tgetDepModuleKeys func() ([]ModuleKey, error),\n\tgetV1BufYAMLObjectData func() (ObjectData, error),\n\tgetV1BufLockObjectData func() (ObjectData, error),\n) ModuleData {\n\treturn newModuleData(\n\t\tctx,\n\t\tmoduleKey,\n\t\tgetBucket,\n\t\tgetDepModuleKeys,\n\t\tgetV1BufYAMLObjectData,\n\t\tgetV1BufLockObjectData,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype moduleData struct {\n\tmoduleKey              ModuleKey\n\tgetBucket              func() (storage.ReadBucket, error)\n\tgetDepModuleKeys       func() ([]ModuleKey, error)\n\tgetV1BufYAMLObjectData func() (ObjectData, error)\n\tgetV1BufLockObjectData func() (ObjectData, error)\n\n\tcheckDigest func() error\n}\n\nfunc newModuleData(\n\tctx context.Context,\n\tmoduleKey ModuleKey,\n\tgetBucket func() (storage.ReadBucket, error),\n\tgetDepModuleKeys func() ([]ModuleKey, error),\n\tgetV1BufYAMLObjectData func() (ObjectData, error),\n\tgetV1BufLockObjectData func() (ObjectData, error),\n) *moduleData {\n\tmoduleData := &moduleData{\n\t\tmoduleKey:              moduleKey,\n\t\tgetBucket:              getSyncOnceValuesGetBucketWithStorageMatcherApplied(ctx, getBucket),\n\t\tgetDepModuleKeys:       sync.OnceValues(getDepModuleKeys),\n\t\tgetV1BufYAMLObjectData: sync.OnceValues(getV1BufYAMLObjectData),\n\t\tgetV1BufLockObjectData: sync.OnceValues(getV1BufLockObjectData),\n\t}\n\tmoduleData.checkDigest = sync.OnceValue(\n\t\tfunc() error {\n\t\t\t// We have to use the get.* functions so that we don't invoke checkDigest.\n\t\t\tbucket, err := moduleData.getBucket()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\texpectedDigest, err := moduleKey.Digest()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tvar actualDigest Digest\n\t\t\tswitch expectedDigest.Type() {\n\t\t\tcase DigestTypeB4:\n\t\t\t\t// Call unexported func instead of exported method to avoid deadlocking on checking the digest again.\n\t\t\t\tv1BufYAMLObjectData, err := moduleData.getV1BufYAMLObjectData()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// Call unexported func instead of exported method to avoid deadlocking on checking the digest again.\n\t\t\t\tv1BufLockObjectData, err := moduleData.getV1BufLockObjectData()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tactualDigest, err = getB4Digest(ctx, bucket, v1BufYAMLObjectData, v1BufLockObjectData)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\tcase DigestTypeB5:\n\t\t\t\t// Call unexported func instead of exported method to avoid deadlocking on checking the digest again.\n\t\t\t\tdepModuleKeys, err := moduleData.getDepModuleKeys()\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// The B5 digest is calculated based on the dependencies.\n\t\t\t\t// The dependencies are not required to be resolved to a Module to calculate this Digest.\n\t\t\t\t// Each ModuleKey includes the expected Digest which is validated when loading that dependencies ModuleData, if needed.\n\t\t\t\tactualDigest, err = getB5DigestForBucketAndDepModuleKeys(ctx, bucket, depModuleKeys)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !DigestEqual(expectedDigest, actualDigest) {\n\t\t\t\treturn &DigestMismatchError{\n\t\t\t\t\tFullName:       moduleKey.FullName(),\n\t\t\t\t\tCommitID:       moduleKey.CommitID(),\n\t\t\t\t\tExpectedDigest: expectedDigest,\n\t\t\t\t\tActualDigest:   actualDigest,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n\treturn moduleData\n}\n\nfunc (m *moduleData) ModuleKey() ModuleKey {\n\treturn m.moduleKey\n}\n\nfunc (m *moduleData) Bucket() (storage.ReadBucket, error) {\n\tif err := m.checkDigest(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m.getBucket()\n}\n\nfunc (m *moduleData) DepModuleKeys() ([]ModuleKey, error) {\n\t// Do we need to tamper-proof when getting deps? Probably yes - this is data that could be tampered with.\n\t//\n\t// Note that doing so kills some of our lazy-loading, as we call DepModuleKeys\n\t// in ModuleSetBuilder right away. However, we still do the lazy-loading here, in the case\n\t// where ModuleData is loaded outside of a ModuleSetBuilder and users may defer calling this\n\t// function if it is not needed.\n\tif err := m.checkDigest(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m.getDepModuleKeys()\n}\n\nfunc (m *moduleData) V1Beta1OrV1BufYAMLObjectData() (ObjectData, error) {\n\tif err := m.checkDigest(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m.getV1BufYAMLObjectData()\n}\n\nfunc (m *moduleData) V1Beta1OrV1BufLockObjectData() (ObjectData, error) {\n\tif err := m.checkDigest(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn m.getV1BufLockObjectData()\n}\n\nfunc (*moduleData) isModuleData() {}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n)\n\nvar (\n\t// NopModuleDataProvider is a no-op ModuleDataProvider.\n\tNopModuleDataProvider ModuleDataProvider = nopModuleDataProvider{}\n)\n\n// ModuleDataProvider provides ModulesDatas.\ntype ModuleDataProvider interface {\n\t// GetModuleDatasForModuleKeys gets the ModuleDatas for the ModuleKeys.\n\t//\n\t// Returned ModuleDatas will be in the same order as the input ModuleKeys.\n\t//\n\t// The input ModuleKeys are expected to be unique by FullName. The implementation\n\t// may error if this is not the case.\n\t//\n\t// The input ModuleKeys are expected to have the same DigestType. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the ModuleDatas returned will match the length of the ModuleKeys.\n\t// If there is an error, no ModuleDatas will be returned.\n\t// If any ModuleKey is not found, an error with fs.ErrNotExist will be returned.\n\tGetModuleDatasForModuleKeys(\n\t\tcontext.Context,\n\t\t[]ModuleKey,\n\t) ([]ModuleData, error)\n}\n\n// *** PRIVATE ***\n\ntype nopModuleDataProvider struct{}\n\nfunc (nopModuleDataProvider) GetModuleDatasForModuleKeys(\n\tcontext.Context,\n\t[]ModuleKey,\n) ([]ModuleData, error) {\n\treturn nil, fs.ErrNotExist\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_dep.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"sort\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/gen/data/datawkt\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// ModuleDep is the dependency of a Module.\n//\n// It's just a Module as well as whether or not the dependency is direct.\ntype ModuleDep interface {\n\tModule\n\n\t// Parent returns the Module that this ModuleDep is a dependency of.\n\t//\n\t// Note this is not recursive - this points of the top-level Module that dependencies\n\t// were created for. That is, if a -> b -> c, then a will have ModuleDeps b and c, both\n\t// of which have a as a parent.\n\tParent() Module\n\t// IsDirect returns true if the Module is a direct dependency of this Module.\n\tIsDirect() bool\n\n\tisModuleDep()\n}\n\n// *** PRIVATE ***\n\ntype moduleDep struct {\n\tModule\n\n\tparent   Module\n\tisDirect bool\n}\n\nfunc newModuleDep(\n\tmodule Module,\n\tparent Module,\n\tisDirect bool,\n) *moduleDep {\n\treturn &moduleDep{\n\t\tModule:   module,\n\t\tparent:   parent,\n\t\tisDirect: isDirect,\n\t}\n}\n\nfunc (m *moduleDep) Parent() Module {\n\treturn m.parent\n}\n\nfunc (m *moduleDep) IsDirect() bool {\n\treturn m.isDirect\n}\n\nfunc (*moduleDep) isModuleDep() {}\n\n// getModuleDeps gets the actual dependencies for the Module.\nfunc getModuleDeps(\n\tctx context.Context,\n\tmodule Module,\n) ([]ModuleDep, error) {\n\tdepOpaqueIDToModuleDep := make(map[string]ModuleDep)\n\tprotoFileTracker := newProtoFileTracker()\n\tif err := getModuleDepsRec(\n\t\tctx,\n\t\tmodule,\n\t\tmake(map[string]string),\n\t\tmake(map[string]struct{}),\n\t\tnil,\n\t\tdepOpaqueIDToModuleDep,\n\t\tprotoFileTracker,\n\t\ttrue,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := protoFileTracker.validate(); err != nil {\n\t\treturn nil, err\n\t}\n\tmoduleDeps := make([]ModuleDep, 0, len(depOpaqueIDToModuleDep))\n\tfor _, moduleDep := range depOpaqueIDToModuleDep {\n\t\tmoduleDeps = append(moduleDeps, moduleDep)\n\t}\n\t// Sorting by at least Opaque ID to get a consistent return order for a given call.\n\tsort.Slice(\n\t\tmoduleDeps,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn moduleDeps[i].OpaqueID() < moduleDeps[j].OpaqueID()\n\t\t},\n\t)\n\treturn moduleDeps, nil\n}\n\nfunc getModuleDepsRec(\n\tctx context.Context,\n\tmodule Module,\n\tvisitedOpaqueIDToDescription map[string]string,\n\t// Changes as we go down the stack.\n\tparentOpaqueIDs map[string]struct{},\n\t// Ordered (by dependency relationship) version of parentOpaqueIDs so we can print a cycle error.\n\torderedParentOpaqueIDs []string,\n\t// Already discovered deps.\n\tdepOpaqueIDToModuleDep map[string]ModuleDep,\n\tprotoFileTracker *protoFileTracker,\n\tisDirect bool,\n) error {\n\topaqueID := module.OpaqueID()\n\tif _, ok := parentOpaqueIDs[opaqueID]; ok {\n\t\treturn &ModuleCycleError{\n\t\t\tDescriptions: append(\n\t\t\t\txslices.Map(orderedParentOpaqueIDs, func(parentOpaqueID string) string {\n\t\t\t\t\treturn visitedOpaqueIDToDescription[parentOpaqueID]\n\t\t\t\t}),\n\t\t\t\tmodule.Description(),\n\t\t\t),\n\t\t}\n\t}\n\tif _, ok := visitedOpaqueIDToDescription[opaqueID]; ok {\n\t\treturn nil\n\t}\n\tvisitedOpaqueIDToDescription[opaqueID] = module.Description()\n\tmoduleSet := module.ModuleSet()\n\tif moduleSet == nil {\n\t\t// This should never happen.\n\t\treturn syserror.New(\"moduleSet never set on module\")\n\t}\n\n\tprotoFileTracker.trackModule(module)\n\t// Doing this BFS so we add all the direct deps to the map first, then if we\n\t// see a dep later, it will still be a direct dep in the map, but will be ignored\n\t// on recursive calls.\n\tvar newModuleDeps []ModuleDep\n\tif err := module.WalkFileInfos(\n\t\tctx,\n\t\tfunc(fileInfo FileInfo) error {\n\t\t\tif fileInfo.FileType() != FileTypeProto {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tprotoFileTracker.trackFileInfo(fileInfo)\n\n\t\t\tfastscanResult, err := module.getFastscanResultForPath(ctx, fileInfo.Path())\n\t\t\tif err != nil {\n\t\t\t\tvar fileAnnotationSet bufanalysis.FileAnnotationSet\n\t\t\t\tif errors.As(err, &fileAnnotationSet) {\n\t\t\t\t\t// If a FileAnnotationSet, the error already contains path information, just return directly.\n\t\t\t\t\t//\n\t\t\t\t\t// We also specially handle FileAnnotationSets for exit code 100.\n\t\t\t\t\treturn fileAnnotationSet\n\t\t\t\t}\n\t\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\t\t// Strip any PathError and just get to the point.\n\t\t\t\t\terr = fs.ErrNotExist\n\t\t\t\t}\n\t\t\t\treturn fmt.Errorf(\"%s: %w\", fileInfo.Path(), err)\n\t\t\t}\n\t\t\tfor _, imp := range fastscanResult.Imports {\n\t\t\t\tpotentialModuleDep, err := moduleSet.getModuleForFilePath(ctx, imp.Path)\n\t\t\t\tif err != nil {\n\t\t\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\t\t\t// It is OK to not have a module with the WKT specified as a dependency. In this case,\n\t\t\t\t\t\t// we do not include WKTs in our digest calculations. We've determined this is OK since\n\t\t\t\t\t\t// WKTs are not downloaded and not subject to supply-side attacks.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// It is also OK for a module to have the WKT, such as buf.build/protocolbuffers/wellknowntypes.\n\t\t\t\t\t\t// In this case, we want this to be recognized.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Note that if someone checks in a WKT as part of their module, this will result in this module\n\t\t\t\t\t\t// being a dependency for all other modules that import that WKT.\n\t\t\t\t\t\t// This could result in unintended module cycles.\n\t\t\t\t\t\tif datawkt.Exists(imp.Path) {\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// We specifically handle ImportNotExistErrors with exit code 100 in buf.go.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// We don't want to return a FileAnnotationSet here as we never have line\n\t\t\t\t\t\t// and column information, and the FileAnnotation will get printed out as 1:1.\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// This isn't a FileAnnotation, it's a not exist error, semantically it's different.\n\t\t\t\t\t\treturn &ImportNotExistError{\n\t\t\t\t\t\t\tfileInfo:   fileInfo,\n\t\t\t\t\t\t\timportPath: imp.Path,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tpotentialDepOpaqueID := potentialModuleDep.OpaqueID()\n\t\t\t\t// If this is in the same module, it's not a dep\n\t\t\t\tif potentialDepOpaqueID != opaqueID {\n\t\t\t\t\t// No longer just potential, now real dep.\n\t\t\t\t\tif _, ok := depOpaqueIDToModuleDep[potentialDepOpaqueID]; !ok {\n\t\t\t\t\t\tmoduleDep := newModuleDep(\n\t\t\t\t\t\t\tpotentialModuleDep,\n\t\t\t\t\t\t\tmodule,\n\t\t\t\t\t\t\tisDirect,\n\t\t\t\t\t\t)\n\t\t\t\t\t\tdepOpaqueIDToModuleDep[potentialDepOpaqueID] = moduleDep\n\t\t\t\t\t\tnewModuleDeps = append(newModuleDeps, moduleDep)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn err\n\t}\n\tparentOpaqueIDs[opaqueID] = struct{}{}\n\tnewOrderedParentOpaqueIDs := append(orderedParentOpaqueIDs, opaqueID)\n\t// Triple-check to make sure newModuleDeps order is deterministic. This is just defensive.\n\tsort.Slice(\n\t\tnewModuleDeps,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn newModuleDeps[i].OpaqueID() < newModuleDeps[j].OpaqueID()\n\t\t},\n\t)\n\tfor _, newModuleDep := range newModuleDeps {\n\t\tif err := getModuleDepsRec(\n\t\t\tctx,\n\t\t\tnewModuleDep,\n\t\t\tvisitedOpaqueIDToDescription,\n\t\t\tparentOpaqueIDs,\n\t\t\tnewOrderedParentOpaqueIDs,\n\t\t\tdepOpaqueIDToModuleDep,\n\t\t\tprotoFileTracker,\n\t\t\t// Always not direct on recursive calls.\n\t\t\t// We've already added all the direct deps.\n\t\t\tfalse,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tdelete(parentOpaqueIDs, opaqueID)\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_key.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// ModuleKey provides identifying information for a Module.\n//\n// ModuleKeys are returned from ModuleKeyProvider, and represent a Module's complete identity.\n// They also match to what we store in buf.lock files. ModuleKeys can be used to get Modules\n// via a ModuleProvider.\ntype ModuleKey interface {\n\t// String returns \"registry/owner/name:dashlessCommitID\".\n\tfmt.Stringer\n\n\t// FullName returns the full name of the Module.\n\t//\n\t// Always present.\n\tFullName() bufparse.FullName\n\t// CommitID returns the ID of the Commit.\n\t//\n\t// It is up to the caller to convert this to a dashless ID when necessary.\n\t//\n\t// Always present, that is CommitID() == uuid.Nil will always be false.\n\tCommitID() uuid.UUID\n\t// Digest returns the Module digest.\n\t//\n\t// Note this is *not* a cas.Digest - this is a Digest. cas.Digests are a lower-level\n\t// type that just deal in terms of files and content. A ModuleDigest is a specific algorithm\n\t// applied to a set of files and dependencies.\n\tDigest() (Digest, error)\n\n\tisModuleKey()\n}\n\n// NewModuleKey returns a new ModuleKey.\n//\n// The Digest will be loaded lazily if needed. Note this means that NewModuleKey does\n// *not* validate the digest. If you need to validate the digest, call Digest() and evaluate\n// the returned error.\nfunc NewModuleKey(\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tgetDigest func() (Digest, error),\n) (ModuleKey, error) {\n\treturn newModuleKey(\n\t\tmoduleFullName,\n\t\tcommitID,\n\t\tgetDigest,\n\t)\n}\n\n// UniqueDigestTypeForModuleKeys returns the single DigestType for the Digests on the ModuleKeys.\n//\n// If the ModuleKeys have different DigestTypes, an error is returned.\n// If the ModuleKeys slice is empty, an error is returned.\nfunc UniqueDigestTypeForModuleKeys(moduleKeys []ModuleKey) (DigestType, error) {\n\tif len(moduleKeys) == 0 {\n\t\treturn 0, syserror.New(\"empty moduleKeys passed to UniqueDigestTypeForModuleKeys\")\n\t}\n\tdigests, err := xslices.MapError(moduleKeys, ModuleKey.Digest)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdigestType := digests[0].Type()\n\tfor _, digest := range digests[1:] {\n\t\tif digestType != digest.Type() {\n\t\t\treturn 0, fmt.Errorf(\n\t\t\t\t\"different digest types detected where the same digest type must be used: %v, %v\\n%s\",\n\t\t\t\tdigestType,\n\t\t\t\tdigest.Type(),\n\t\t\t\tstrings.Join(xslices.Map(moduleKeys, ModuleKey.String), \"\\n\"),\n\t\t\t)\n\t\t}\n\t}\n\treturn digestType, nil\n}\n\n// ModuleKeyToCommitKey converts a ModuleKey to a CommitKey.\n//\n// This is purely lossy - a ModuleKey has more information than a CommitKey, and a\n// CommitKey does not have any information that a ModuleKey does not have.\nfunc ModuleKeyToCommitKey(moduleKey ModuleKey) (CommitKey, error) {\n\tdigest, err := moduleKey.Digest()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newCommitKey(moduleKey.FullName().Registry(), moduleKey.CommitID(), digest.Type())\n}\n\n// *** PRIVATE ***\n\ntype moduleKey struct {\n\tmoduleFullName bufparse.FullName\n\tcommitID       uuid.UUID\n\n\tgetDigest func() (Digest, error)\n}\n\nfunc newModuleKey(\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tgetDigest func() (Digest, error),\n) (*moduleKey, error) {\n\tif moduleFullName == nil {\n\t\treturn nil, errors.New(\"nil FullName when constructing ModuleKey\")\n\t}\n\tif commitID == uuid.Nil {\n\t\treturn nil, errors.New(\"empty commitID when constructing ModuleKey\")\n\t}\n\treturn newModuleKeyNoValidate(moduleFullName, commitID, getDigest), nil\n}\n\nfunc newModuleKeyNoValidate(\n\tmoduleFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tgetDigest func() (Digest, error),\n) *moduleKey {\n\treturn &moduleKey{\n\t\tmoduleFullName: moduleFullName,\n\t\tcommitID:       commitID,\n\t\tgetDigest:      sync.OnceValues(getDigest),\n\t}\n}\n\nfunc (m *moduleKey) FullName() bufparse.FullName {\n\treturn m.moduleFullName\n}\n\nfunc (m *moduleKey) CommitID() uuid.UUID {\n\treturn m.commitID\n}\n\nfunc (m *moduleKey) Digest() (Digest, error) {\n\treturn m.getDigest()\n}\n\nfunc (m *moduleKey) String() string {\n\treturn m.moduleFullName.String() + \":\" + uuidutil.ToDashless(m.commitID)\n}\n\nfunc (*moduleKey) isModuleKey() {}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n)\n\n// ModuleKeyProvider provides ModuleKeys for ModuleRefs.\ntype ModuleKeyProvider interface {\n\t// GetModuleKeysForModuleRefs gets the ModuleKeys for the given ModuleRefs.\n\t//\n\t// Returned ModuleKeys will be in the same order as the input ModuleRefs.\n\t//\n\t// The input ModuleRefs are expected to be unique by FullName. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the ModuleKeys returned will match the length of the ModuleRefs.\n\t// If there is an error, no ModuleKeys will be returned.\n\t// If any ModuleRef is not found, an error with fs.ErrNotExist will be returned.\n\tGetModuleKeysForModuleRefs(context.Context, []bufparse.Ref, DigestType) ([]ModuleKey, error)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_read_bucket.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotocompile\"\n\t\"github.com/bufbuild/buf/private/pkg/cache\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/protocompile/parser/fastscan\"\n)\n\n// ModuleReadBucket is an object analogous to storage.ReadBucket that supplements ObjectInfos\n// and Objects with the data on the Module that supplied them.\n//\n// ModuleReadBuckets talk in terms of Files and FileInfos. They are easily converted into\n// storage.ReadBuckets.\n//\n// The contents of a ModuleReadBucket are specific to its context. In the context of a Module,\n// a ModuleReadBucket will return .proto files, documentation file(s), and license file(s). However,\n// in the context of converting a Workspace into its corresponding .proto files, a ModuleReadBucket\n// will only contain .proto files.\ntype ModuleReadBucket interface {\n\t// GetFile gets the File within the Module as specified by the path.\n\t//\n\t// Returns an error with fs.ErrNotExist if the path is not part of the Module.\n\tGetFile(ctx context.Context, path string) (File, error)\n\t// StatFileInfo gets the FileInfo for the File within the Module as specified by the path.\n\t//\n\t// Returns an error with fs.ErrNotExist if the path is not part of the Module.\n\tStatFileInfo(ctx context.Context, path string) (FileInfo, error)\n\t// WalkFileInfos walks all Files in the Module, passing the FileInfo to a specified function.\n\t//\n\t// This will walk the .proto files, documentation file(s), and license files(s). This package\n\t// currently exposes functionality to walk just the .proto files, and get the singular\n\t// documentation and license files, via WalkProtoFileInfos, GetDocFile, and GetLicenseFile.\n\t//\n\t// GetDocFile and GetLicenseFile may change in the future if other paths are accepted for\n\t// documentation or licenses, or if we allow multiple documentation or license files to\n\t// exist within a Module (currently, only one of each is allowed).\n\t//\n\t// A ModuleReadBucket directly derived from a Module will always have at least one .proto file.\n\t// If this is not the case, WalkFileInfos will return an error when called.\n\tWalkFileInfos(ctx context.Context, f func(FileInfo) error, options ...WalkFileInfosOption) error\n\n\t// ShouldBeSelfContained returns true if the ModuleReadBucket was constructed with the intention\n\t// that it would be self-contained with respect to its .proto files. That is, every .proto\n\t// file in the ModuleReadBucket only imports other files from the ModuleReadBucket.\n\t//\n\t// It is possible for a bucket to be marked as ShouldBeSelfContained without it actually\n\t// being self-contained.\n\t//\n\t// A ModuleReadBucket is self-contained if it was constructed from\n\t// ModuleSetToModuleReadBucketWithOnlyProtoFiles.\n\t//\n\t// A ModuleReadBucket as inherited from a Module is not self-contained.\n\t//\n\t// A ModuleReadBucket filtered to anything but FileTypeProto is not self-contained.\n\tShouldBeSelfContained() bool\n\n\t// getFastscanResultForPath gets the fastscan.Result for the File path of a File within the ModuleReadBucket.\n\t//\n\t// This should only be used by Modules and FileInfos.\n\t//\n\t// returns errIsWKT if the filePath is a WKT.\n\t// returns an error with fs.ErrNotExist if the file is not found.\n\tgetFastscanResultForPath(ctx context.Context, path string) (fastscan.Result, error)\n\n\tisModuleReadBucket()\n}\n\n// WalkFileInfosOption is an option for WalkFileInfos\ntype WalkFileInfosOption func(*walkFileInfosOptions)\n\n// WalkFileInfosWithOnlyTargetFiles returns a new WalkFileInfosOption that only walks the target files.\nfunc WalkFileInfosWithOnlyTargetFiles() WalkFileInfosOption {\n\treturn func(walkFileInfosOptions *walkFileInfosOptions) {\n\t\twalkFileInfosOptions.onlyTargetFiles = true\n\t}\n}\n\n// ModuleReadBucketToStorageReadBucket converts the given ModuleReadBucket to a storage.ReadBucket.\n//\n// All Files (whether targets or non-targets) are added.\nfunc ModuleReadBucketToStorageReadBucket(bucket ModuleReadBucket) storage.ReadBucket {\n\treturn newStorageReadBucket(bucket)\n}\n\n// ModuleReadBucketWithOnlyTargetFiles returns a new ModuleReadBucket that only contains\n// target Files.\nfunc ModuleReadBucketWithOnlyTargetFiles(moduleReadBucket ModuleReadBucket) ModuleReadBucket {\n\treturn newTargetedModuleReadBucket(moduleReadBucket)\n}\n\n// ModuleReadBucketWithOnlyFileTypes returns a new ModuleReadBucket that only contains the given\n// FileTypes.\n//\n// Common use case is to get only the .proto files.\nfunc ModuleReadBucketWithOnlyFileTypes(\n\tmoduleReadBucket ModuleReadBucket,\n\tfileTypes ...FileType,\n) ModuleReadBucket {\n\treturn newFilteredModuleReadBucket(moduleReadBucket, fileTypes)\n}\n\n// ModuleReadBucketWithOnlyProtoFiles is a convenience function that returns a new\n// ModuleReadBucket that only contains the .proto files.\nfunc ModuleReadBucketWithOnlyProtoFiles(moduleReadBucket ModuleReadBucket) ModuleReadBucket {\n\treturn ModuleReadBucketWithOnlyFileTypes(moduleReadBucket, FileTypeProto)\n}\n\n// GetFileInfos is a convenience function that walks the ModuleReadBucket and gets\n// all the FileInfos.\n//\n// Sorted by path.\nfunc GetFileInfos(ctx context.Context, moduleReadBucket ModuleReadBucket) ([]FileInfo, error) {\n\tvar fileInfos []FileInfo\n\tif err := moduleReadBucket.WalkFileInfos(\n\t\tctx,\n\t\tfunc(fileInfo FileInfo) error {\n\t\t\tfileInfos = append(fileInfos, fileInfo)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Slice(\n\t\tfileInfos,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn fileInfos[i].Path() < fileInfos[j].Path()\n\t\t},\n\t)\n\treturn fileInfos, nil\n}\n\n// GetTargetFileInfos is a convenience function that walks the ModuleReadBucket and gets\n// all the FileInfos where IsTargetFile() is set to true.\n//\n// Sorted by path.\nfunc GetTargetFileInfos(ctx context.Context, moduleReadBucket ModuleReadBucket) ([]FileInfo, error) {\n\tvar fileInfos []FileInfo\n\tif err := moduleReadBucket.WalkFileInfos(\n\t\tctx,\n\t\tfunc(fileInfo FileInfo) error {\n\t\t\tfileInfos = append(fileInfos, fileInfo)\n\t\t\treturn nil\n\t\t},\n\t\tWalkFileInfosWithOnlyTargetFiles(),\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Slice(\n\t\tfileInfos,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn fileInfos[i].Path() < fileInfos[j].Path()\n\t\t},\n\t)\n\treturn fileInfos, nil\n}\n\n// GetFilePaths is a convenience function that gets all the target and non-target\n// file paths for the ModuleReadBucket.\n//\n// Sorted.\nfunc GetFilePaths(ctx context.Context, moduleReadBucket ModuleReadBucket) ([]string, error) {\n\tfileInfos, err := GetFileInfos(ctx, moduleReadBucket)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.Map(fileInfos, func(fileInfo FileInfo) string { return fileInfo.Path() }), nil\n}\n\n// GetTargetFilePaths is a convenience function that gets all the target\n// file paths for the ModuleReadBucket.\n//\n// Sorted.\nfunc GetTargetFilePaths(ctx context.Context, moduleReadBucket ModuleReadBucket) ([]string, error) {\n\tfileInfos, err := GetTargetFileInfos(ctx, moduleReadBucket)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.Map(fileInfos, func(fileInfo FileInfo) string { return fileInfo.Path() }), nil\n}\n\n// GetDocFile gets the singular documentation File for the Module, if it exists.\n//\n// When creating a Module from a Bucket, we check the file paths buf.md, README.md, and README.markdown\n// to exist, in that order. The first one to exist is chosen as the documentation File that is considered\n// part of the Module, and any others are discarded. This function will return that File that was chosen.\n//\n// Returns an error with fs.ErrNotExist if no documentation file exists.\nfunc GetDocFile(ctx context.Context, moduleReadBucket ModuleReadBucket) (File, error) {\n\tif docFilePath := getDocFilePathForModuleReadBucket(ctx, moduleReadBucket); docFilePath != \"\" {\n\t\treturn moduleReadBucket.GetFile(ctx, docFilePath)\n\t}\n\treturn nil, fs.ErrNotExist\n}\n\n// GetLicenseFile gets the license File for the Module, if it exists.\n//\n// Returns an error with fs.ErrNotExist if the license File does not exist.\nfunc GetLicenseFile(ctx context.Context, moduleReadBucket ModuleReadBucket) (File, error) {\n\treturn moduleReadBucket.GetFile(ctx, licenseFilePath)\n}\n\n// GetDocStorageReadBucket gets a storage.ReadBucket that just contains the documentation file(s).\n//\n// This is needed for i.e. using RootToExcludes in NewWorkspaceForBucket.\nfunc GetDocStorageReadBucket(ctx context.Context, bucket storage.ReadBucket) (storage.ReadBucket, error) {\n\t// Store the documentation file in a new memory bucket for performance reasons.\n\tdocFilePath := getDocFilePathForStorageReadBucket(ctx, bucket)\n\tif docFilePath == \"\" {\n\t\treturn storage.MultiReadBucket(), nil // nop bucket\n\t}\n\tcontent, err := storage.ReadPath(ctx, bucket, docFilePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn storagemem.NewReadBucket(\n\t\tmap[string][]byte{\n\t\t\tdocFilePath: content,\n\t\t},\n\t)\n}\n\n// GetLicenseStorageReadBucket gets a storage.ReadBucket that just contains the license file(s).\n//\n// This is needed for i.e. using RootToExcludes in NewWorkspaceForBucket.\nfunc GetLicenseStorageReadBucket(ctx context.Context, bucket storage.ReadBucket) (storage.ReadBucket, error) {\n\t// Store the license file in a new memory bucket for performance reasons.\n\tcontent, err := storage.ReadPath(ctx, bucket, licenseFilePath)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn storage.MultiReadBucket(), nil // nop bucket\n\t\t}\n\t\treturn nil, err\n\t}\n\treturn storagemem.NewReadBucket(\n\t\tmap[string][]byte{\n\t\t\tlicenseFilePath: content,\n\t\t},\n\t)\n}\n\n// *** PRIVATE ***\n\n// moduleReadBucket\n\ntype moduleReadBucket struct {\n\tgetBucket func() (storage.ReadBucket, error)\n\tmodule    Module\n\t// We have to store a deterministic ordering of targetPaths so that Walk\n\t// has the same iteration order every time. We could have a different iteration order,\n\t// as storage.ReadBucket.Walk doesn't guarantee any iteration order, but that seems wonky.\n\ttargetPaths          []string\n\ttargetPathMap        map[string]struct{}\n\ttargetExcludePathMap map[string]struct{}\n\tprotoFileTargetPath  string\n\tincludePackageFiles  bool\n\n\tpathToFileInfoCache       cache.Cache[string, FileInfo]\n\tpathToFastscanResultCache cache.Cache[string, fastscan.Result]\n}\n\n// module cannot be assumed to be functional yet.\n// Do not call any functions on module.\nfunc newModuleReadBucketForModule(\n\tctx context.Context,\n\t// This function must already be filtered to include only module files and must be sync.OnceValues wrapped!\n\tsyncOnceValuesGetBucketWithStorageMatcherApplied func() (storage.ReadBucket, error),\n\tmodule Module,\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n\tprotoFileTargetPath string,\n\tincludePackageFiles bool,\n) (*moduleReadBucket, error) {\n\t// TODO FUTURE: get these validations into a common place\n\tif protoFileTargetPath != \"\" && (len(targetPaths) > 0 || len(targetExcludePaths) > 0) {\n\t\treturn nil, syserror.Newf(\"cannot set both protoFileTargetPath %q and either targetPaths %v or targetExcludePaths %v\", protoFileTargetPath, targetPaths, targetExcludePaths)\n\t}\n\tif protoFileTargetPath != \"\" && normalpath.Ext(protoFileTargetPath) != \".proto\" {\n\t\treturn nil, syserror.Newf(\"protoFileTargetPath %q is not a .proto file\", protoFileTargetPath)\n\t}\n\treturn &moduleReadBucket{\n\t\tgetBucket:            syncOnceValuesGetBucketWithStorageMatcherApplied,\n\t\tmodule:               module,\n\t\ttargetPaths:          targetPaths,\n\t\ttargetPathMap:        xslices.ToStructMap(targetPaths),\n\t\ttargetExcludePathMap: xslices.ToStructMap(targetExcludePaths),\n\t\tprotoFileTargetPath:  protoFileTargetPath,\n\t\tincludePackageFiles:  includePackageFiles,\n\t}, nil\n}\n\nfunc (b *moduleReadBucket) GetFile(ctx context.Context, path string) (File, error) {\n\tfileInfo, err := b.StatFileInfo(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbucket, err := b.getBucket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treadObjectCloser, err := bucket.Get(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newFile(fileInfo, readObjectCloser), nil\n}\n\nfunc (b *moduleReadBucket) StatFileInfo(ctx context.Context, path string) (FileInfo, error) {\n\tbucket, err := b.getBucket()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tobjectInfo, err := bucket.Stat(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn b.getFileInfo(ctx, objectInfo)\n}\n\nfunc (b *moduleReadBucket) WalkFileInfos(\n\tctx context.Context,\n\tfn func(FileInfo) error,\n\toptions ...WalkFileInfosOption,\n) error {\n\t// Note that we must verify that at least one file in this ModuleReadBucket is\n\t// a .proto file, per the documentation on Module.\n\tprotoFileTracker := newProtoFileTracker()\n\n\twalkFileInfosOptions := newWalkFileInfosOptions()\n\tfor _, option := range options {\n\t\toption(walkFileInfosOptions)\n\t}\n\tbucket, err := b.getBucket()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !walkFileInfosOptions.onlyTargetFiles {\n\t\t// We only want to call trackModule if we are walking all the files, not just\n\t\t// the target files. By not calling trackModule outside of this if statement,\n\t\t// we will not produce NoProtoFilesErrors, per the documentation on trackModule.\n\t\tprotoFileTracker.trackModule(b.module)\n\t\tif err := bucket.Walk(\n\t\t\tctx,\n\t\t\t\"\",\n\t\t\tfunc(objectInfo storage.ObjectInfo) error {\n\t\t\t\tfileInfo, err := b.getFileInfo(ctx, objectInfo)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tprotoFileTracker.trackFileInfo(fileInfo)\n\t\t\t\treturn fn(fileInfo)\n\t\t\t},\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn protoFileTracker.validate()\n\t}\n\n\t// If we are walking all files, then we track the module if it is the target module\n\tif b.module.IsTarget() {\n\t\tprotoFileTracker.trackModule(b.module)\n\t}\n\n\ttargetFileWalkFunc := func(objectInfo storage.ObjectInfo) error {\n\t\tfileInfo, err := b.getFileInfo(ctx, objectInfo)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tprotoFileTracker.trackFileInfo(fileInfo)\n\t\tif !fileInfo.IsTargetFile() {\n\t\t\treturn nil\n\t\t}\n\t\treturn fn(fileInfo)\n\t}\n\n\t// If we have target paths, we do not want to walk the whole bucket.\n\t// For example, we do --path path/to/file.proto for googleapis, we don't want to\n\t// walk all of googleapis to find the single file.\n\t//\n\t// Instead, we walk the specific targets.\n\t// Note that storage.ReadBucket.Walk allows calling a file path as a prefix.\n\t//\n\t// Use targetPaths instead of targetPathMap to have a deterministic iteration order at this level.\n\tif len(b.targetPaths) > 0 {\n\t\t// Target paths may have overlapping files, for example if you do --path a --path a/b,\n\t\t// you get the union of the files. We need to make sure that we only walk a given\n\t\t// file path once.\n\t\tseenPaths := make(map[string]struct{})\n\t\tmultiTargetFileWalkFunc := func(objectInfo storage.ObjectInfo) error {\n\t\t\tpath := objectInfo.Path()\n\t\t\tif _, ok := seenPaths[path]; ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tseenPaths[path] = struct{}{}\n\t\t\treturn targetFileWalkFunc(objectInfo)\n\t\t}\n\t\tfor _, targetPath := range b.targetPaths {\n\t\t\t// Still need to determine IsTargetFile as a file could be excluded with excludeTargetPaths.\n\t\t\tif err := bucket.Walk(ctx, targetPath, multiTargetFileWalkFunc); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// We can't determine if the Module had any .proto file paths, as we only walked\n\t\t// the target paths. We don't return any value from protoFileTracker.validate().\n\t\treturn nil\n\t}\n\tif err := bucket.Walk(ctx, \"\", targetFileWalkFunc); err != nil {\n\t\treturn err\n\t}\n\treturn protoFileTracker.validate()\n}\n\nfunc (b *moduleReadBucket) withModule(module Module) *moduleReadBucket {\n\t// We want to avoid sync.OnceValueing getBucket Twice, so we have a special copy function here\n\t// instead of calling newModuleReadBucket.\n\t//\n\t// This technically doesn't matter anymore since we don't sync.OnceValue getBucket inside newModuleReadBucket\n\t// anymore, but we keep this around in case we change that back.\n\treturn &moduleReadBucket{\n\t\tgetBucket:            b.getBucket,\n\t\tmodule:               module,\n\t\ttargetPaths:          b.targetPaths,\n\t\ttargetPathMap:        b.targetPathMap,\n\t\ttargetExcludePathMap: b.targetExcludePathMap,\n\t\tprotoFileTargetPath:  b.protoFileTargetPath,\n\t\tincludePackageFiles:  b.includePackageFiles,\n\t}\n}\n\nfunc (b *moduleReadBucket) ShouldBeSelfContained() bool {\n\treturn false\n}\n\nfunc (*moduleReadBucket) isModuleReadBucket() {}\n\nfunc (b *moduleReadBucket) getFileInfo(ctx context.Context, objectInfo storage.ObjectInfo) (FileInfo, error) {\n\treturn b.pathToFileInfoCache.GetOrAdd(\n\t\t// We know that storage.ObjectInfo will always have the same values for the same\n\t\t// ObjectInfo returned from a common bucket, this is documented. Therefore, we\n\t\t// can cache based on just the path.\n\t\tobjectInfo.Path(),\n\t\tfunc() (FileInfo, error) {\n\t\t\treturn b.getFileInfoUncached(ctx, objectInfo)\n\t\t},\n\t)\n}\n\nfunc (b *moduleReadBucket) getFileInfoUncached(ctx context.Context, objectInfo storage.ObjectInfo) (FileInfo, error) {\n\tfileType, err := FileTypeForPath(objectInfo.Path())\n\tif err != nil {\n\t\t// Given our matching in the constructor, all file paths should be classified.\n\t\t// A lack of classification is a system error.\n\t\treturn nil, syserror.Wrap(err)\n\t}\n\tisTargetFile, err := b.getIsTargetFileForPathUncached(ctx, objectInfo.Path())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newFileInfo(\n\t\tobjectInfo,\n\t\tb.module,\n\t\tfileType,\n\t\tisTargetFile,\n\t\tfunc() ([]string, error) {\n\t\t\tif fileType != FileTypeProto {\n\t\t\t\treturn nil, nil\n\t\t\t}\n\t\t\tfastscanResult, err := b.getFastscanResultForPath(ctx, objectInfo.Path())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// This also has the effect of copying the slice.\n\t\t\treturn xslices.ToUniqueSorted(xslices.Map(fastscanResult.Imports, func(imp fastscan.Import) string { return imp.Path })), nil\n\t\t},\n\t\tfunc() (string, error) {\n\t\t\tif fileType != FileTypeProto {\n\t\t\t\treturn \"\", nil\n\t\t\t}\n\t\t\tfastscanResult, err := b.getFastscanResultForPath(ctx, objectInfo.Path())\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", err\n\t\t\t}\n\t\t\treturn fastscanResult.PackageName, nil\n\t\t},\n\t), nil\n}\n\nfunc (b *moduleReadBucket) getIsTargetFileForPathUncached(ctx context.Context, path string) (bool, error) {\n\tif !b.module.IsTarget() {\n\t\t// If the Module is not targeted, the file is automatically not targeted.\n\t\t//\n\t\t// Note we can change IsTarget via setIsTarget during ModuleSetBuilder building,\n\t\t// so we do not want to cache this value.\n\t\treturn false, nil\n\t}\n\t// We already validate that we don't set this alongside targetPaths and targetExcludePaths\n\tif b.protoFileTargetPath != \"\" {\n\t\tfileType, err := FileTypeForPath(path)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\tif fileType != FileTypeProto {\n\t\t\t// We are targeting a .proto file and this file is not a .proto file, therefore\n\t\t\t// this file is not targeted.\n\t\t\treturn false, nil\n\t\t}\n\t\tisProtoFileTargetPath := path == b.protoFileTargetPath\n\t\tif isProtoFileTargetPath {\n\t\t\t// Regardless of includePackageFiles, we always return true.\n\t\t\treturn true, nil\n\t\t}\n\t\tif !b.includePackageFiles {\n\t\t\t// If we don't include package files, then we don't have a match, return false.\n\t\t\treturn false, nil\n\t\t}\n\t\t// We now need to see if we have the same package as the protoFileTargetPath file.\n\t\t//\n\t\t// We've now deferred having to get fastscan.Results as much as we can.\n\t\tprotoFileTargetFastscanResult, err := b.getFastscanResultForPath(ctx, b.protoFileTargetPath)\n\t\tif err != nil {\n\t\t\t// In the case where multiple modules may have shared module roots through the includes key\n\t\t\t// in the module configs, the protoFileTargetPath may not exist in the target module.\n\t\t\t// In that case, we just return false.\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn false, nil\n\t\t\t}\n\t\t\treturn false, err\n\t\t}\n\t\tif protoFileTargetFastscanResult.PackageName == \"\" {\n\t\t\t// Don't do anything if the target file does not have a package.\n\t\t\treturn false, nil\n\t\t}\n\t\tfastscanResult, err := b.getFastscanResultForPath(ctx, path)\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t// If the package is the same, this is a target.\n\t\treturn protoFileTargetFastscanResult.PackageName == fastscanResult.PackageName, nil\n\t}\n\tswitch {\n\tcase len(b.targetPathMap) == 0 && len(b.targetExcludePathMap) == 0:\n\t\t// If we did not target specific Files, all Files in a targeted Module are targeted.\n\t\treturn true, nil\n\tcase len(b.targetPathMap) == 0 && len(b.targetExcludePathMap) != 0:\n\t\t// We only have exclude paths, no paths.\n\t\treturn !normalpath.MapHasEqualOrContainingPath(b.targetExcludePathMap, path, normalpath.Relative), nil\n\tcase len(b.targetPathMap) != 0 && len(b.targetExcludePathMap) == 0:\n\t\t// We only have paths, no exclude paths.\n\t\treturn normalpath.MapHasEqualOrContainingPath(b.targetPathMap, path, normalpath.Relative), nil\n\tdefault:\n\t\t// We have both paths and exclude paths.\n\t\treturn normalpath.MapHasEqualOrContainingPath(b.targetPathMap, path, normalpath.Relative) &&\n\t\t\t!normalpath.MapHasEqualOrContainingPath(b.targetExcludePathMap, path, normalpath.Relative), nil\n\t}\n}\n\n// Only will work for .proto files.\nfunc (b *moduleReadBucket) getFastscanResultForPath(ctx context.Context, path string) (fastscan.Result, error) {\n\treturn b.pathToFastscanResultCache.GetOrAdd(\n\t\tpath,\n\t\tfunc() (fastscan.Result, error) {\n\t\t\treturn b.getFastscanResultForPathUncached(ctx, path)\n\t\t},\n\t)\n}\n\nfunc (b *moduleReadBucket) getFastscanResultForPathUncached(\n\tctx context.Context,\n\tpath string,\n) (fastscanResult fastscan.Result, retErr error) {\n\tfileType, err := FileTypeForPath(path)\n\tif err != nil {\n\t\treturn fastscan.Result{}, err\n\t}\n\tif fileType != FileTypeProto {\n\t\t// We should have validated this WAY before.\n\t\treturn fastscan.Result{}, syserror.Newf(\"cannot get fastscan.Result for non-proto file %q\", path)\n\t}\n\t// We *cannot* use GetFile here, because getFileInfo -> getFastscanResultForPath -> getFileInfo,\n\t// and this causes a circular wait with the cache locks.\n\tbucket, err := b.getBucket()\n\tif err != nil {\n\t\treturn fastscan.Result{}, err\n\t}\n\treadObjectCloser, err := bucket.Get(ctx, path)\n\tif err != nil {\n\t\treturn fastscan.Result{}, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readObjectCloser.Close())\n\t}()\n\tfastscanResult, err = fastscan.Scan(path, readObjectCloser)\n\tif err != nil {\n\t\tvar syntaxError fastscan.SyntaxError\n\t\tif errors.As(err, &syntaxError) {\n\t\t\tfileAnnotationSet, err := bufprotocompile.FileAnnotationSetForErrorsWithPos(\n\t\t\t\tsyntaxError,\n\t\t\t\tbufprotocompile.WithExternalPathResolver(\n\t\t\t\t\tfunc(path string) string {\n\t\t\t\t\t\tfileInfo, err := bucket.Stat(ctx, path)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn path\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn fileInfo.ExternalPath()\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn fastscan.Result{}, err\n\t\t\t}\n\t\t\treturn fastscan.Result{}, fileAnnotationSet\n\t\t}\n\t\treturn fastscan.Result{}, err\n\t}\n\treturn fastscanResult, nil\n}\n\n// targetedModuleReadBucket\n\ntype targetedModuleReadBucket struct {\n\tdelegate ModuleReadBucket\n}\n\nfunc newTargetedModuleReadBucket(delegate ModuleReadBucket) *targetedModuleReadBucket {\n\treturn &targetedModuleReadBucket{\n\t\tdelegate: delegate,\n\t}\n}\n\nfunc (t *targetedModuleReadBucket) GetFile(ctx context.Context, path string) (File, error) {\n\t// Stat'ing the targeted bucket, not the delegate.\n\tif _, err := t.StatFileInfo(ctx, path); err != nil {\n\t\treturn nil, err\n\t}\n\treturn t.delegate.GetFile(ctx, path)\n}\n\nfunc (t *targetedModuleReadBucket) StatFileInfo(ctx context.Context, path string) (FileInfo, error) {\n\tfileInfo, err := t.delegate.StatFileInfo(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !fileInfo.IsTargetFile() {\n\t\treturn nil, &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn fileInfo, nil\n}\n\nfunc (t *targetedModuleReadBucket) WalkFileInfos(\n\tctx context.Context,\n\tfn func(FileInfo) error,\n\toptions ...WalkFileInfosOption,\n) error {\n\treturn t.delegate.WalkFileInfos(\n\t\tctx,\n\t\tfunc(fileInfo FileInfo) error {\n\t\t\treturn fn(fileInfo)\n\t\t},\n\t\tslices.Concat(\n\t\t\toptions,\n\t\t\t[]WalkFileInfosOption{WalkFileInfosWithOnlyTargetFiles()},\n\t\t)...,\n\t)\n}\n\nfunc (*targetedModuleReadBucket) ShouldBeSelfContained() bool {\n\t// We've filtered out non-target files, this should not be considered self-contained.\n\treturn false\n}\n\nfunc (t *targetedModuleReadBucket) getFastscanResultForPath(ctx context.Context, path string) (fastscan.Result, error) {\n\tif _, err := t.StatFileInfo(ctx, path); err != nil {\n\t\treturn fastscan.Result{}, err\n\t}\n\treturn t.delegate.getFastscanResultForPath(ctx, path)\n}\n\nfunc (*targetedModuleReadBucket) isModuleReadBucket() {}\n\n// filteredModuleReadBucket\n\ntype filteredModuleReadBucket struct {\n\tdelegate              ModuleReadBucket\n\tfileTypeMap           map[FileType]struct{}\n\tshouldBeSelfContained bool\n}\n\nfunc newFilteredModuleReadBucket(\n\tdelegate ModuleReadBucket,\n\tfileTypes []FileType,\n) *filteredModuleReadBucket {\n\tfileTypeMap := xslices.ToStructMap(fileTypes)\n\t_, containsFileTypeProto := fileTypeMap[FileTypeProto]\n\treturn &filteredModuleReadBucket{\n\t\tdelegate:              delegate,\n\t\tfileTypeMap:           fileTypeMap,\n\t\tshouldBeSelfContained: delegate.ShouldBeSelfContained() && containsFileTypeProto,\n\t}\n}\n\nfunc (f *filteredModuleReadBucket) GetFile(ctx context.Context, path string) (File, error) {\n\t// Stat'ing the filtered bucket, not the delegate.\n\tif _, err := f.StatFileInfo(ctx, path); err != nil {\n\t\treturn nil, err\n\t}\n\treturn f.delegate.GetFile(ctx, path)\n}\n\nfunc (f *filteredModuleReadBucket) StatFileInfo(ctx context.Context, path string) (FileInfo, error) {\n\tfileInfo, err := f.delegate.StatFileInfo(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif _, ok := f.fileTypeMap[fileInfo.FileType()]; !ok {\n\t\treturn nil, &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn fileInfo, nil\n}\n\nfunc (f *filteredModuleReadBucket) WalkFileInfos(\n\tctx context.Context,\n\tfn func(FileInfo) error,\n\toptions ...WalkFileInfosOption,\n) error {\n\treturn f.delegate.WalkFileInfos(\n\t\tctx,\n\t\tfunc(fileInfo FileInfo) error {\n\t\t\tif _, ok := f.fileTypeMap[fileInfo.FileType()]; !ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn fn(fileInfo)\n\t\t},\n\t\toptions...,\n\t)\n}\n\nfunc (f *filteredModuleReadBucket) ShouldBeSelfContained() bool {\n\treturn f.shouldBeSelfContained\n}\n\nfunc (f *filteredModuleReadBucket) getFastscanResultForPath(ctx context.Context, path string) (fastscan.Result, error) {\n\tif _, err := f.StatFileInfo(ctx, path); err != nil {\n\t\treturn fastscan.Result{}, err\n\t}\n\treturn f.delegate.getFastscanResultForPath(ctx, path)\n}\n\nfunc (*filteredModuleReadBucket) isModuleReadBucket() {}\n\n// multiProtoFileModuleReadBucket\n\ntype multiProtoFileModuleReadBucket[T ModuleReadBucket, S []T] struct {\n\tdelegates             S\n\tshouldBeSelfContained bool\n}\n\nfunc newMultiProtoFileModuleReadBucket[T ModuleReadBucket, S []T](\n\tdelegates S,\n\tshouldBeSelfContained bool,\n) *multiProtoFileModuleReadBucket[T, S] {\n\treturn &multiProtoFileModuleReadBucket[T, S]{\n\t\tdelegates:             delegates,\n\t\tshouldBeSelfContained: shouldBeSelfContained,\n\t}\n}\n\nfunc (m *multiProtoFileModuleReadBucket[T, S]) GetFile(ctx context.Context, path string) (File, error) {\n\t_, delegateIndex, err := m.getFileInfoAndDelegateIndex(ctx, \"read\", path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn m.delegates[delegateIndex].GetFile(ctx, path)\n}\n\nfunc (m *multiProtoFileModuleReadBucket[T, S]) StatFileInfo(ctx context.Context, path string) (FileInfo, error) {\n\tfileInfo, _, err := m.getFileInfoAndDelegateIndex(ctx, \"stat\", path)\n\treturn fileInfo, err\n}\n\nfunc (m *multiProtoFileModuleReadBucket[T, S]) WalkFileInfos(\n\tctx context.Context,\n\tfn func(FileInfo) error,\n\toptions ...WalkFileInfosOption,\n) error {\n\tseenPathToFileInfo := make(map[string]FileInfo)\n\tprotoFileTracker := newProtoFileTracker()\n\tfor _, delegate := range m.delegates {\n\t\tif err := delegate.WalkFileInfos(\n\t\t\tctx,\n\t\t\tfunc(fileInfo FileInfo) error {\n\t\t\t\tif fileInfo.FileType() != FileTypeProto {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\tpath := fileInfo.Path()\n\t\t\t\tprotoFileTracker.trackFileInfo(fileInfo)\n\t\t\t\tif existingFileInfo, ok := seenPathToFileInfo[path]; ok {\n\t\t\t\t\t// If we detected the same .proto file, this is an error.\n\t\t\t\t\tif err := protoFileTracker.validate(); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\t// If we detected a non-proto file duplicate, this means we constructed the multiProtoFileModuleReadBucket\n\t\t\t\t\t// incorrectly, as we should not do union buckets for non-proto files. It is totally valid\n\t\t\t\t\t// for LICENSE and README.md to be duplicated.\n\t\t\t\t\t//\n\t\t\t\t\t// This does not return all paths that are matching, unlike GetFile and StatFileInfo.\n\t\t\t\t\t// We do not want to continue iterating, as calling WalkFileInfos on the same path\n\t\t\t\t\t// could cause errors downstream as callers expect a single call per path.\n\t\t\t\t\treturn newExistsMultipleModulesError(path, existingFileInfo, fileInfo)\n\t\t\t\t}\n\t\t\t\tseenPathToFileInfo[path] = fileInfo\n\t\t\t\treturn fn(fileInfo)\n\t\t\t},\n\t\t\toptions...,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *multiProtoFileModuleReadBucket[T, S]) ShouldBeSelfContained() bool {\n\treturn m.shouldBeSelfContained\n}\n\nfunc (m *multiProtoFileModuleReadBucket[T, S]) getFastscanResultForPath(ctx context.Context, path string) (fastscan.Result, error) {\n\t_, delegateIndex, err := m.getFileInfoAndDelegateIndex(ctx, \"stat\", path)\n\tif err != nil {\n\t\treturn fastscan.Result{}, err\n\t}\n\treturn m.delegates[delegateIndex].getFastscanResultForPath(ctx, path)\n}\n\nfunc (m *multiProtoFileModuleReadBucket[T, S]) getFileInfoAndDelegateIndex(\n\tctx context.Context,\n\top string,\n\tpath string,\n) (FileInfo, int, error) {\n\tvar fileInfos []FileInfo\n\tvar delegateIndexes []int\n\tprotoFileTracker := newProtoFileTracker()\n\tfor i, delegate := range m.delegates {\n\t\tfileInfo, err := delegate.StatFileInfo(ctx, path)\n\t\tif err != nil {\n\t\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, 0, err\n\t\t}\n\t\tif fileInfo.FileType() != FileTypeProto {\n\t\t\tcontinue\n\t\t}\n\t\tprotoFileTracker.trackFileInfo(fileInfo)\n\t\tfileInfos = append(fileInfos, fileInfo)\n\t\tdelegateIndexes = append(delegateIndexes, i)\n\t}\n\t// If we detected the same .proto file, this is an error.\n\tif err := protoFileTracker.validate(); err != nil {\n\t\treturn nil, 0, err\n\t}\n\tswitch len(fileInfos) {\n\tcase 0:\n\t\treturn nil, 0, &fs.PathError{Op: op, Path: path, Err: fs.ErrNotExist}\n\tcase 1:\n\t\treturn fileInfos[0], delegateIndexes[0], nil\n\tdefault:\n\t\t// If we detected a non-proto file duplicate, this means we constructed the multiProtoFileModuleReadBucket\n\t\t// incorrectly, as we should not do union buckets for non-proto files. It is totally valid\n\t\t// for LICENSE and README.md to be duplicated.\n\t\treturn nil, 0, newExistsMultipleModulesError(path, fileInfos...)\n\t}\n}\n\nfunc (*multiProtoFileModuleReadBucket[T, S]) isModuleReadBucket() {}\n\n// storageReadBucket\n\ntype storageReadBucket struct {\n\tdelegate ModuleReadBucket\n}\n\nfunc newStorageReadBucket(delegate ModuleReadBucket) *storageReadBucket {\n\treturn &storageReadBucket{\n\t\tdelegate: delegate,\n\t}\n}\n\nfunc (s *storageReadBucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) {\n\treturn s.delegate.GetFile(ctx, path)\n}\n\nfunc (s *storageReadBucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) {\n\treturn s.delegate.StatFileInfo(ctx, path)\n}\n\nfunc (s *storageReadBucket) Walk(ctx context.Context, prefix string, f func(storage.ObjectInfo) error) error {\n\tprefix, err := normalpath.NormalizeAndValidate(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn s.delegate.WalkFileInfos(\n\t\tctx,\n\t\tfunc(fileInfo FileInfo) error {\n\t\t\tif !normalpath.EqualsOrContainsPath(prefix, fileInfo.Path(), normalpath.Relative) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn f(fileInfo)\n\t\t},\n\t)\n}\n\nfunc newExistsMultipleModulesError(path string, fileInfos ...FileInfo) error {\n\treturn syserror.Newf(\n\t\t\"%s was detected as part of a multiProtoFileModuleReadBucket exists in multiple locations: %v. This should only happen if the multiProtoFileModuleReadBucket was incorrectly constructed\",\n\t\tpath,\n\t\tstrings.Join(\n\t\t\txslices.Map(\n\t\t\t\tfileInfos,\n\t\t\t\tfunc(fileInfo FileInfo) string {\n\t\t\t\t\treturn fileInfo.ExternalPath()\n\t\t\t\t},\n\t\t\t),\n\t\t\t\" \",\n\t\t),\n\t)\n}\n\ntype walkFileInfosOptions struct {\n\tonlyTargetFiles bool\n}\n\nfunc newWalkFileInfosOptions() *walkFileInfosOptions {\n\treturn &walkFileInfosOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_set.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\t\"sort\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/cache\"\n\t\"github.com/bufbuild/buf/private/pkg/dag\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// ModuleSet is a set of Modules constructed by a ModuleBuilder.\n//\n// A ModuleSet is expected to be self-contained, that is Modules only import\n// from other Modules in this ModuleSet.\n//\n// A ModuleSet may be empty and have no Modules. This is primarily done in testing.\ntype ModuleSet interface {\n\t// Modules returns the Modules in the ModuleSet.\n\t//\n\t// This will consist of both targets and non-targets.\n\t// All dependencies of all Modules will be in this list, that is this list is self-contained.\n\t//\n\t// All Modules will have unique Digests and CommitIDs.\n\t//\n\t// These will be sorted by OpaqueID.\n\tModules() []Module\n\n\t// GetModuleForFullName gets the Module for the FullName, if it exists.\n\t//\n\t// Returns nil if there is no Module with the given FullName.\n\tGetModuleForFullName(moduleFullName bufparse.FullName) Module\n\t// GetModuleForOpaqueID gets the Module for the OpaqueID, if it exists.\n\t//\n\t// Returns nil if there is no Module with the given OpaqueID. However, as long\n\t// as the OpaqueID came from a Module contained within Modules(), this will always\n\t// return a non-nil value.\n\tGetModuleForOpaqueID(opaqueID string) Module\n\t// GetModuleForBucketID gets the Module for the BucketID, if it exists.\n\t//\n\t// Returns nil if there is no Module with the given BucketID.\n\tGetModuleForBucketID(bucketID string) Module\n\t// GetModuleForCommitID gets the Module for the CommitID, if it exists.\n\t//\n\t// Returns nil if there is no Module with the given CommitID.\n\tGetModuleForCommitID(commitID uuid.UUID) Module\n\n\t// WithTargetOpaqueIDs returns a new ModuleSet that changes the targeted Modules to\n\t// the Modules with the specified OpaqueIDs.\n\tWithTargetOpaqueIDs(opaqueIDs ...string) (ModuleSet, error)\n\n\t// getModuleForFilePath gets the Module for the File path of a File within the ModuleSet.\n\t//\n\t// This should only be used by Modules, and only for dependency calculations. Any used of this outside\n\t// of getModuleDeps will result in nasty bugs down the line - we effectively ignore WKTs in this function,\n\t// but WKTs may be included in one of the Modules as files.\n\t//\n\t// returns an error with fs.ErrNotExist if the file is not found.\n\tgetModuleForFilePath(ctx context.Context, filePath string) (Module, error)\n\n\tisModuleSet()\n}\n\n// ModuleSetToModuleReadBucketWithOnlyProtoFiles converts the ModuleSet to a\n// ModuleReadBucket that contains all the .proto files of the target and non-target\n// Modules of the ModuleSet.\n//\n// Targeting information will remain the same.\nfunc ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet ModuleSet) ModuleReadBucket {\n\treturn newMultiProtoFileModuleReadBucket(moduleSet.Modules(), true)\n}\n\n// ModuleSetToModuleReadBucketWithOnlyProtoFilesForTargetModules converts the ModuleSet to a\n// ModuleReadBucket that contains all the .proto files of the target\n// Modules of the ModuleSet.\n//\n// Targeting information will remain the same.\nfunc ModuleSetToModuleReadBucketWithOnlyProtoFilesForTargetModules(moduleSet ModuleSet) ModuleReadBucket {\n\treturn newMultiProtoFileModuleReadBucket(ModuleSetTargetModules(moduleSet), true)\n}\n\n// ModuleSetTargetModules is a convenience function that returns the target Modules\n// from a ModuleSet.\nfunc ModuleSetTargetModules(moduleSet ModuleSet) []Module {\n\treturn xslices.Filter(\n\t\tmoduleSet.Modules(),\n\t\tfunc(module Module) bool { return module.IsTarget() },\n\t)\n}\n\n// ModuleSetNonTargetModules is a convenience function that returns the non-target Modules\n// from a ModuleSet.\nfunc ModuleSetNonTargetModules(moduleSet ModuleSet) []Module {\n\treturn xslices.Filter(\n\t\tmoduleSet.Modules(),\n\t\tfunc(module Module) bool { return !module.IsTarget() },\n\t)\n}\n\n// ModuleSetLocalModules is a convenience function that returns the local Modules\n// from a ModuleSet.\nfunc ModuleSetLocalModules(moduleSet ModuleSet) []Module {\n\treturn xslices.Filter(\n\t\tmoduleSet.Modules(),\n\t\tfunc(module Module) bool { return module.IsLocal() },\n\t)\n}\n\n// ModuleSetRemoteModules is a convenience function that returns the remote Modules\n// from a ModuleSet.\nfunc ModuleSetRemoteModules(moduleSet ModuleSet) []Module {\n\treturn xslices.Filter(\n\t\tmoduleSet.Modules(),\n\t\tfunc(module Module) bool { return !module.IsLocal() },\n\t)\n}\n\n// ModuleSetTargetLocalModulesAndTransitiveLocalDeps is a convenience function that returns\n// the targeted local Modules of the ModuleSet, and their transitive local dependencies.\n//\n// This is used by push to determine what Modules should be uploaded.\n//\n// Sorted by OpaqueID.\nfunc ModuleSetTargetLocalModulesAndTransitiveLocalDeps(moduleSet ModuleSet) ([]Module, error) {\n\ttargetLocalModules := xslices.Filter(\n\t\tmoduleSet.Modules(),\n\t\tfunc(module Module) bool { return module.IsTarget() && module.IsLocal() },\n\t)\n\t// It is technically possible for us to have a targeted local Module depend on a\n\t// Remote dep, which depends on a local dep. In this case, we want to also\n\t// include this transitive local dep. The resultOpaqueIDToLocalModule map only\n\t// includes our result Modules, but we want the visited map to include everything\n\t// we have visited so we can stop recursion.\n\tvisitedOpaqueIDs := make(map[string]struct{})\n\tresultOpaqueIDToLocalModule := make(map[string]Module)\n\tfor _, module := range targetLocalModules {\n\t\tif err := moduleSetTargetLocalModulesAndTransitiveLocalDepsRec(\n\t\t\tvisitedOpaqueIDs,\n\t\t\tresultOpaqueIDToLocalModule,\n\t\t\tmodule,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tresultLocalModules := xslices.MapValuesToSlice(resultOpaqueIDToLocalModule)\n\tsort.Slice(\n\t\tresultLocalModules,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn resultLocalModules[i].OpaqueID() < resultLocalModules[j].OpaqueID()\n\t\t},\n\t)\n\treturn resultLocalModules, nil\n}\n\n// ModuleSetOpaqueIDs is a convenience function that returns a slice of the OpaqueIDs of the\n// Modules in the ModuleSet.\n//\n// Sorted.\nfunc ModuleSetOpaqueIDs(moduleSet ModuleSet) []string {\n\treturn modulesOpaqueIDs(moduleSet.Modules())\n}\n\n// ModuleSetTargetOpaqueIDs is a convenience function that returns a slice of the OpaqueIDs of the\n// target Modules in the ModuleSet.\n//\n// Sorted.\nfunc ModuleSetTargetOpaqueIDs(moduleSet ModuleSet) []string {\n\treturn modulesOpaqueIDs(ModuleSetTargetModules(moduleSet))\n}\n\n// ModuleSetNonTargetOpaqueIDs is a convenience function that returns a slice of the OpaqueIDs of the\n// non-target Modules in the ModuleSet.\n//\n// Sorted.\nfunc ModuleSetNonTargetOpaqueIDs(moduleSet ModuleSet) []string {\n\treturn modulesOpaqueIDs(ModuleSetNonTargetModules(moduleSet))\n}\n\n// ModuleSetLocalOpaqueIDs is a convenience function that returns a slice of the OpaqueIDs of the\n// local Modules in the ModuleSet.\n//\n// Sorted.\nfunc ModuleSetLocalOpaqueIDs(moduleSet ModuleSet) []string {\n\treturn modulesOpaqueIDs(ModuleSetLocalModules(moduleSet))\n}\n\n// ModuleSetRemoteOpaqueIDs is a convenience function that returns a slice of the OpaqueIDs of the\n// remote Modules in the ModuleSet.\n//\n// Sorted.\nfunc ModuleSetRemoteOpaqueIDs(moduleSet ModuleSet) []string {\n\treturn modulesOpaqueIDs(ModuleSetRemoteModules(moduleSet))\n}\n\n// ModuleSetToDAG gets a DAG of the given ModuleSet.\n//\n// This only starts at target Modules. If a Module is not part of a graph\n// with a target Module as a source, it will not be added.\nfunc ModuleSetToDAG(moduleSet ModuleSet, options ...ModuleSetToDAGOption) (*dag.Graph[string, Module], error) {\n\tmoduleSetToDAGOptions := newModuleSetToDAGOptions()\n\tfor _, option := range options {\n\t\toption(moduleSetToDAGOptions)\n\t}\n\tgraph := dag.NewGraph[string, Module](Module.OpaqueID)\n\tfor _, module := range ModuleSetTargetModules(moduleSet) {\n\t\tif err := moduleSetToDAGRec(module, graph, moduleSetToDAGOptions.remoteOnly); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn graph, nil\n}\n\n// ModuleSetToDAGOption is an option for ModuleSetToDAG.\ntype ModuleSetToDAGOption func(*moduleSetToDAGOptions)\n\n// ModuleSetToDAGWithRemoteOnly returns a new ModuleSetToDAGOption that specifies the graph\n// should be built with only remote modules.\nfunc ModuleSetToDAGWithRemoteOnly() ModuleSetToDAGOption {\n\treturn func(moduleSetToDAGOptions *moduleSetToDAGOptions) {\n\t\tmoduleSetToDAGOptions.remoteOnly = true\n\t}\n}\n\n// *** PRIVATE ***\n\n// moduleSet\n\ntype moduleSet struct {\n\tmodules                      []Module\n\tmoduleFullNameStringToModule map[string]Module\n\topaqueIDToModule             map[string]Module\n\tbucketIDToModule             map[string]Module\n\tcommitIDToModule             map[uuid.UUID]Module\n\n\t// filePathToModule is a cache of filePath -> module.\n\t//\n\t// If you are calling both the imports and module caches, you must call the imports cache first,\n\t// i.e. lock ordering.\n\tfilePathToModuleCache cache.Cache[string, Module]\n}\n\nfunc newModuleSet(\n\tmodules []Module,\n) (*moduleSet, error) {\n\tmoduleFullNameStringToModule := make(map[string]Module, len(modules))\n\topaqueIDToModule := make(map[string]Module, len(modules))\n\tdescriptionToModule := make(map[string]Module, len(modules))\n\tbucketIDToModule := make(map[string]Module, len(modules))\n\tcommitIDToModule := make(map[uuid.UUID]Module, len(modules))\n\tfor _, module := range modules {\n\t\tif moduleFullName := module.FullName(); moduleFullName != nil {\n\t\t\tmoduleFullNameString := moduleFullName.String()\n\t\t\tif _, ok := moduleFullNameStringToModule[moduleFullNameString]; ok {\n\t\t\t\t// This should never happen.\n\t\t\t\treturn nil, syserror.Newf(\"duplicate FullName %q when constructing ModuleSet\", moduleFullNameString)\n\t\t\t}\n\t\t\tmoduleFullNameStringToModule[moduleFullNameString] = module\n\t\t}\n\t\topaqueID := module.OpaqueID()\n\t\tif _, ok := opaqueIDToModule[opaqueID]; ok {\n\t\t\t// This should never happen.\n\t\t\treturn nil, syserror.Newf(\"duplicate OpaqueID %q when constructing ModuleSet\", opaqueID)\n\t\t}\n\t\topaqueIDToModule[opaqueID] = module\n\t\tdescription := module.Description()\n\t\tif _, ok := descriptionToModule[description]; ok {\n\t\t\t// This should never happen if we construct descriptions appropriately.\n\t\t\treturn nil, syserror.Newf(\"duplicate Description %q when constructing ModuleSet\", description)\n\t\t}\n\t\tdescriptionToModule[description] = module\n\t\tbucketID := module.BucketID()\n\t\tif bucketID != \"\" {\n\t\t\tif _, ok := bucketIDToModule[bucketID]; ok {\n\t\t\t\t// This should never happen.\n\t\t\t\treturn nil, syserror.Newf(\"duplicate BucketID %q when constructing ModuleSet\", bucketID)\n\t\t\t}\n\t\t\tbucketIDToModule[bucketID] = module\n\t\t}\n\t\tcommitID := module.CommitID()\n\t\tif commitID != uuid.Nil {\n\t\t\tif _, ok := commitIDToModule[commitID]; ok {\n\t\t\t\t// This should never happen.\n\t\t\t\treturn nil, syserror.Newf(\"duplicate CommitID %q when constructing ModuleSet\", uuidutil.ToDashless(commitID))\n\t\t\t}\n\t\t\tcommitIDToModule[commitID] = module\n\t\t}\n\t}\n\tmoduleSet := &moduleSet{\n\t\tmodules:                      modules,\n\t\tmoduleFullNameStringToModule: moduleFullNameStringToModule,\n\t\topaqueIDToModule:             opaqueIDToModule,\n\t\tbucketIDToModule:             bucketIDToModule,\n\t\tcommitIDToModule:             commitIDToModule,\n\t}\n\tfor _, module := range modules {\n\t\tmodule.setModuleSet(moduleSet)\n\t}\n\treturn moduleSet, nil\n}\n\nfunc (m *moduleSet) Modules() []Module {\n\tc := make([]Module, len(m.modules))\n\tcopy(c, m.modules)\n\treturn c\n}\n\nfunc (m *moduleSet) GetModuleForFullName(moduleFullName bufparse.FullName) Module {\n\treturn m.moduleFullNameStringToModule[moduleFullName.String()]\n}\n\nfunc (m *moduleSet) GetModuleForOpaqueID(opaqueID string) Module {\n\treturn m.opaqueIDToModule[opaqueID]\n}\n\nfunc (m *moduleSet) GetModuleForBucketID(bucketID string) Module {\n\treturn m.bucketIDToModule[bucketID]\n}\n\nfunc (m *moduleSet) GetModuleForCommitID(commitID uuid.UUID) Module {\n\treturn m.commitIDToModule[commitID]\n}\n\nfunc (m *moduleSet) WithTargetOpaqueIDs(opaqueIDs ...string) (ModuleSet, error) {\n\tif len(opaqueIDs) == 0 {\n\t\treturn nil, errors.New(\"at least one Module must be targeted\")\n\t}\n\topaqueIDMap := xslices.ToStructMap(opaqueIDs)\n\tmodules := make([]Module, len(m.modules))\n\tfor i, module := range m.modules {\n\t\t_, isTarget := opaqueIDMap[module.OpaqueID()]\n\t\t// Always make a copy regardless of if targeting changes. We're going to set a new ModuleSet on the Module.\n\t\tmodule, err := module.withIsTarget(isTarget)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmodules[i] = module\n\t}\n\treturn newModuleSet(modules)\n}\n\n// This should only be used by Modules and FileInfos.\nfunc (m *moduleSet) getModuleForFilePath(ctx context.Context, filePath string) (Module, error) {\n\treturn m.filePathToModuleCache.GetOrAdd(\n\t\tfilePath,\n\t\tfunc() (Module, error) {\n\t\t\treturn m.getModuleForFilePathUncached(ctx, filePath)\n\t\t},\n\t)\n}\n\nfunc (m *moduleSet) getModuleForFilePathUncached(ctx context.Context, filePath string) (_ Module, retErr error) {\n\tmatchingOpaqueIDToModule := make(map[string]Module)\n\t// Note that we're effectively doing an O(num_modules * num_files) operation here, which could be prohibitive.\n\tfor _, module := range m.Modules() {\n\t\t_, err := module.StatFileInfo(ctx, filePath)\n\t\tif err == nil {\n\t\t\tmatchingOpaqueIDToModule[module.OpaqueID()] = module\n\t\t} else if !errors.Is(err, fs.ErrNotExist) {\n\t\t\t// This is important! If we have any error other than fs.ErrNotExist, make sure we return that error.\n\t\t\t// Not doing so results in important errors not being propagated. In the case where this was found,\n\t\t\t// we ended up returning a fs.ErrNotExist when the underlying error was a digest verification error\n\t\t\t// that we expected. We want to return the verification error up the stack.\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tswitch len(matchingOpaqueIDToModule) {\n\tcase 0:\n\t\t// This will happen if there is a file path we cannot find in our modules, which will result\n\t\t// in an error on ModuleDeps() or Digest().\n\t\t//\n\t\t// Note that we will commonly call getModuleForFilePathUncached for a WKT, which will result\n\t\t// in this error (this is desired).\n\t\treturn nil, &fs.PathError{Op: \"stat\", Path: filePath, Err: fs.ErrNotExist}\n\tcase 1:\n\t\tvar matchingOpaqueID string\n\t\tfor matchingOpaqueID = range matchingOpaqueIDToModule {\n\t\t}\n\t\treturn m.GetModuleForOpaqueID(matchingOpaqueID), nil\n\tdefault:\n\t\t// This actually could happen, and we will want to make this error message as clear as possible.\n\t\t// The addition of opaqueID should give us clearer error messages than we have today.\n\t\treturn nil, &DuplicateProtoPathError{\n\t\t\tProtoPath: filePath,\n\t\t\tModuleDescriptions: xslices.ToUniqueSorted(\n\t\t\t\txslices.Map(\n\t\t\t\t\txslices.MapValuesToSlice(matchingOpaqueIDToModule),\n\t\t\t\t\tModule.Description,\n\t\t\t\t),\n\t\t\t),\n\t\t}\n\t}\n}\n\nfunc (*moduleSet) isModuleSet() {}\n\ntype moduleSetToDAGOptions struct {\n\tremoteOnly bool\n}\n\nfunc newModuleSetToDAGOptions() *moduleSetToDAGOptions {\n\treturn &moduleSetToDAGOptions{}\n}\n\n// utils\n\nfunc moduleSetTargetLocalModulesAndTransitiveLocalDepsRec(\n\tvisitedOpaqueIDs map[string]struct{},\n\tresultOpaqueIDToLocalModule map[string]Module,\n\tmodule Module,\n) error {\n\topaqueID := module.OpaqueID()\n\tif _, ok := visitedOpaqueIDs[opaqueID]; ok {\n\t\treturn nil\n\t}\n\tvisitedOpaqueIDs[opaqueID] = struct{}{}\n\tif module.IsLocal() {\n\t\tresultOpaqueIDToLocalModule[opaqueID] = module\n\t}\n\tmoduleDeps, err := module.ModuleDeps()\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, moduleDep := range moduleDeps {\n\t\t// We want to recurse on both local and remote deps.\n\t\t//\n\t\t// It is technically possible for us to have a targeted local Module depend on a\n\t\t// Remote dep, which depends on a local dep. In this case, we want to also\n\t\t// include this transitive local dep.\n\t\tif err := moduleSetTargetLocalModulesAndTransitiveLocalDepsRec(\n\t\t\tvisitedOpaqueIDs,\n\t\t\tresultOpaqueIDToLocalModule,\n\t\t\tmoduleDep,\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc moduleSetToDAGRec(\n\tmodule Module,\n\tgraph *dag.Graph[string, Module],\n\tremoteOnly bool,\n) error {\n\t// If remoteOnly is set, then we only want to add remote modules as nodes. However, we do\n\t// not want to return necessarily, because we want to capture all remote dependencies.\n\t//\n\t// We do not return early and ignore local modules entirely, because we still want to check\n\t// for remote dependencies from local modules.\n\tif !remoteOnly || !module.IsLocal() {\n\t\tgraph.AddNode(module)\n\t}\n\tdirectModuleDeps, err := ModuleDirectModuleDeps(module)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, directModuleDep := range directModuleDeps {\n\t\t// If remoteOnly is set, then we only want to add the edge if both the module _and_ the\n\t\t// dependency are remote.\n\t\tif !remoteOnly || (!module.IsLocal() && !directModuleDep.IsLocal()) {\n\t\t\tgraph.AddEdge(module, directModuleDep)\n\t\t}\n\t\t// We still want to check all transitive dependencies for all modules.\n\t\tif err := moduleSetToDAGRec(directModuleDep, graph, remoteOnly); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc modulesOpaqueIDs(modules []Module) []string {\n\treturn xslices.Map(\n\t\tmodules,\n\t\tfunc(module Module) string { return module.OpaqueID() },\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_set_builder.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"log/slog\"\n\t\"sync/atomic\"\n\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\nvar (\n\terrBuildAlreadyCalled = syserror.New(\"ModuleSetBuilder.Build has already been called\")\n)\n\n// ModuleSetBuilder builds ModuleSets.\n//\n// It is the effective primary entrypoint for this package.\n//\n// Modules are either targets or non-targets.\n// A target Module is a module that we are directly targeting for operations.\n// Targets the specific Modules within a Workspace that you are targeting.\n//\n// Modules are also either local or remote.\n//\n// A local Module is one which was built from sources from the \"local context\", such\n// a Workspace containing Modules, or a ModuleNode in a CreateCommitRequest. Local\n// Modules are important for understanding what Modules to push, and what modules to\n// check declared dependencies for unused dependencies.\n//\n// A remote Module is one which was not contained in the local context, such as\n// dependencies specified in a buf.lock (with no corresponding Module in the Workspace),\n// or a DepNode in a CreateCommitRequest with no corresponding ModuleNode. A module\n// retrieved from a ModuleDataProvider via a ModuleKey is always remote.\ntype ModuleSetBuilder interface {\n\t// AddLocalModule adds a new local Module for the given Bucket.\n\t//\n\t// The Bucket used to construct the module will only be read for .proto files,\n\t// license file(s), and documentation file(s).\n\t//\n\t// The BucketID is required. If LocalModuleWithFullName.* is used, the OpaqueID will\n\t// use this FullName, otherwise the OpaqueID will be the BucketID.\n\t//\n\t// The dependencies of the Module are unknown, since bufmodule does not parse configuration,\n\t// and therefore the dependencies of the Module are *not* automatically added to the ModuleSet.\n\t//\n\t// If you are using a v1 buf.yaml-backed Module, be sure to use LocalModuleWithBufYAMLObjectData and\n\t// LocalModuleWithBufLockObjectData!\n\t//\n\t// Returns the same ModuleSetBuilder.\n\tAddLocalModule(\n\t\tbucket storage.ReadBucket,\n\t\tbucketID string,\n\t\tisTarget bool,\n\t\toptions ...LocalModuleOption,\n\t) ModuleSetBuilder\n\t// AddRemoteModule adds a new remote Module for the given ModuleKey.\n\t//\n\t// The ModuleDataProvider given to the ModuleSetBuilder at construction time will be used to\n\t// retrieve this Module.\n\t//\n\t// The resulting Module will not have a BucketID but will always have a FullName.\n\t//\n\t// The dependencies of the Module will are *not* automatically added to the ModuleSet.\n\t// It is the caller's responsibility to add transitive dependencies.\n\t//\n\t// Modules added with AddLocalModule always take precedence,\n\t// so if there are local bucket-based dependencies, these will be used.\n\t//\n\t// Remote modules are rarely targets. However, if we are reading a ModuleSet from a\n\t// ModuleProvider for example with a buf build buf.build/foo/bar call, then this\n\t// specific Module will be targeted, while its dependencies will not be.\n\t//\n\t// Returns the same ModuleSetBuilder.\n\tAddRemoteModule(\n\t\tmoduleKey ModuleKey,\n\t\tisTarget bool,\n\t\toptions ...RemoteModuleOption,\n\t) ModuleSetBuilder\n\t// Build builds the Modules into a ModuleSet.\n\t//\n\t// Any errors from Add* calls will be returned here as well.\n\t//\n\t// For future consideration, `Build` can take ...buildOption. A use case for this\n\t// would be for workspaces to have a unified/top-level README and/or LICENSE file.\n\t// The workspace at build time can pass `BuildWithREADME` and/or `BuildWithLicense` for\n\t// the module set. Then each module in the module set can refer to this through the module\n\t// set as needed.\n\tBuild() (ModuleSet, error)\n\n\tisModuleSetBuilder()\n}\n\n// NewModuleSetBuilder returns a new ModuleSetBuilder.\nfunc NewModuleSetBuilder(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tmoduleDataProvider ModuleDataProvider,\n\tcommitProvider CommitProvider,\n) ModuleSetBuilder {\n\treturn newModuleSetBuilder(ctx, logger, moduleDataProvider, commitProvider)\n}\n\n// NewModuleSetForRemoteModule is a convenience function that build a ModuleSet for for a single\n// remote Module based on ModuleKey.\n//\n// The remote Module is targeted.\n// All of the remote Module's transitive dependencies are automatically added as non-targets.\nfunc NewModuleSetForRemoteModule(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tgraphProvider GraphProvider,\n\tmoduleDataProvider ModuleDataProvider,\n\tcommitProvider CommitProvider,\n\tmoduleKey ModuleKey,\n\toptions ...RemoteModuleOption,\n) (ModuleSet, error) {\n\tmoduleSetBuilder := NewModuleSetBuilder(ctx, logger, moduleDataProvider, commitProvider)\n\tmoduleSetBuilder.AddRemoteModule(moduleKey, true, options...)\n\tgraph, err := graphProvider.GetGraphForModuleKeys(ctx, []ModuleKey{moduleKey})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := graph.WalkNodes(\n\t\tfunc(node ModuleKey, _ []ModuleKey, _ []ModuleKey) error {\n\t\t\tif node.CommitID() != moduleKey.CommitID() {\n\t\t\t\t// Add the dependency ModuleKey with no path filters.\n\t\t\t\tmoduleSetBuilder.AddRemoteModule(node, false)\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn moduleSetBuilder.Build()\n}\n\n// LocalModuleOption is an option for AddLocalModule.\ntype LocalModuleOption func(*localModuleOptions)\n\n// LocalModuleWithFullName returns a new LocalModuleOption that adds the given FullName to the result Module.\n//\n// Use LocalModuleWithFullNameAndCommitID if you'd also like to add a CommitID.\nfunc LocalModuleWithFullName(moduleFullName bufparse.FullName) LocalModuleOption {\n\treturn func(localModuleOptions *localModuleOptions) {\n\t\tlocalModuleOptions.moduleFullName = moduleFullName\n\t}\n}\n\n// LocalModuleWithFullNameAndCommitID returns a new LocalModuleOption that adds the given FullName and CommitID\n// to the result Module.\nfunc LocalModuleWithFullNameAndCommitID(moduleFullName bufparse.FullName, commitID uuid.UUID) LocalModuleOption {\n\treturn func(localModuleOptions *localModuleOptions) {\n\t\tlocalModuleOptions.moduleFullName = moduleFullName\n\t\tlocalModuleOptions.commitID = commitID\n\t}\n}\n\n// LocalModuleWithDescription returns a new LocalModuleOption that adds the given description to the Module.\n//\n// This is used to construct descriptive error messages pointing to configured modules.\n// For example, this may return something along the lines of:\n//\n//\tpath: \"proto/foo\", includes; [\"a\", \"b\"], excludes: \"c\"\n//\n// This field must be unique within a given ModuleSet.\n//\n// This value must be unique for all Modules constructed in a ModuleSet.\nfunc LocalModuleWithDescription(description string) LocalModuleOption {\n\treturn func(localModuleOptions *localModuleOptions) {\n\t\tlocalModuleOptions.description = description\n\t}\n}\n\n// LocalModuleWithTargetPaths returns a new LocalModuleOption that specifically targets the given paths, and\n// specifically excludes the given paths.\n//\n// Only valid for a targeted Module. If this option is given to a non-target Module, this will\n// result in an error during Build().\nfunc LocalModuleWithTargetPaths(\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n) LocalModuleOption {\n\treturn func(localModuleOptions *localModuleOptions) {\n\t\tlocalModuleOptions.targetPaths = targetPaths\n\t\tlocalModuleOptions.targetExcludePaths = targetExcludePaths\n\t}\n}\n\n// LocalModuleWithProtoFileTargetPath returns a new LocalModuleOption that specifically targets\n// a single .proto file, and optionally targets all other .proto files that are in the same package.\n//\n// If targetPath is empty, includePackageFiles is ignored.\n// Exclusive with LocalModuleWithTargetPaths - only one of these can have a non-empty value.\n//\n// This is used for ProtoFileRefs only. Do not use this otherwise.\nfunc LocalModuleWithProtoFileTargetPath(\n\tprotoFileTargetPath string,\n\tincludePackageFiles bool,\n) LocalModuleOption {\n\treturn func(localModuleOptions *localModuleOptions) {\n\t\tlocalModuleOptions.protoFileTargetPath = protoFileTargetPath\n\t\tlocalModuleOptions.includePackageFiles = includePackageFiles\n\t}\n}\n\n// LocalModuleWithV1Beta1OrV1BufYAMLObjectData returns a new LocalModuleOption that attaches the original\n// source buf.yaml file associated with this module for v1 or v1beta1 buf.yaml-backed Modules.\n//\n// If a buf.yaml exists on disk, should be set for Modules backed with a v1beta1 or v1 buf.yaml. It is possible\n// that a Module has no buf.yaml (if it was built from defaults), in which case this will not be set.\n//\n// For Modules backed with v2 buf.yamls, this should not be set.\n//\n// This file content is just used for dependency calculations. It is not parsed.\nfunc LocalModuleWithV1Beta1OrV1BufYAMLObjectData(v1BufYAMLObjectData ObjectData) LocalModuleOption {\n\treturn func(localModuleOptions *localModuleOptions) {\n\t\tlocalModuleOptions.v1BufYAMLObjectData = v1BufYAMLObjectData\n\t}\n}\n\n// LocalModuleWithV1Beta1OrV1BufLockObjectData returns a new LocalModuleOption that attaches the original\n// source buf.local file associated with this Module for v1 or v1beta1 buf.lock-backed Modules.\n//\n// If a buf.lock exists on disk, should be set for Modules backed with a v1beta1 or v1 buf.lock.\n// Note that a buf.lock may not exist for a v1 Module, if there are no dependencies, and in this\n// case, this is not set. However, if there is a buf.lock file that was generated, even if it\n// had no dependencies, this is set.\n//\n// For Modules backed with v2 buf.locks, this should not be set.\n//\n// This file content is just used for dependency calculations. It is not parsed.\nfunc LocalModuleWithV1Beta1OrV1BufLockObjectData(v1BufLockObjectData ObjectData) LocalModuleOption {\n\treturn func(localModuleOptions *localModuleOptions) {\n\t\tlocalModuleOptions.v1BufLockObjectData = v1BufLockObjectData\n\t}\n}\n\n// RemoteModuleOption is an option for AddRemoteModule.\ntype RemoteModuleOption func(*remoteModuleOptions)\n\n// RemoteModuleWithTargetPaths returns a new RemoteModuleOption that specifically targets the given paths, and\n// specifically excludes the given paths.\n//\n// Only valid for a targeted Module. If this option is given to a non-target Module, this will\n// result in an error during Build().\nfunc RemoteModuleWithTargetPaths(\n\ttargetPaths []string,\n\ttargetExcludePaths []string,\n) RemoteModuleOption {\n\treturn func(remoteModuleOptions *remoteModuleOptions) {\n\t\tremoteModuleOptions.targetPaths = targetPaths\n\t\tremoteModuleOptions.targetExcludePaths = targetExcludePaths\n\t}\n}\n\n/// *** PRIVATE ***\n\n// moduleSetBuilder\n\ntype moduleSetBuilder struct {\n\tctx                context.Context\n\tlogger             *slog.Logger\n\tmoduleDataProvider ModuleDataProvider\n\tcommitProvider     CommitProvider\n\n\taddedModules []*addedModule\n\terrs         []error\n\tbuildCalled  atomic.Bool\n}\n\nfunc newModuleSetBuilder(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tmoduleDataProvider ModuleDataProvider,\n\tcommitProvider CommitProvider,\n) *moduleSetBuilder {\n\treturn &moduleSetBuilder{\n\t\tctx:                ctx,\n\t\tlogger:             logger,\n\t\tmoduleDataProvider: moduleDataProvider,\n\t\tcommitProvider:     commitProvider,\n\t}\n}\n\nfunc (b *moduleSetBuilder) AddLocalModule(\n\tbucket storage.ReadBucket,\n\tbucketID string,\n\tisTarget bool,\n\toptions ...LocalModuleOption,\n) ModuleSetBuilder {\n\tif b.buildCalled.Load() {\n\t\treturn b.addError(errBuildAlreadyCalled)\n\t}\n\tif bucketID == \"\" {\n\t\treturn b.addError(syserror.New(\"bucketID is required when calling AddLocalModule\"))\n\t}\n\tlocalModuleOptions := newLocalModuleOptions()\n\tfor _, option := range options {\n\t\toption(localModuleOptions)\n\t}\n\tif localModuleOptions.moduleFullName == nil && localModuleOptions.commitID != uuid.Nil {\n\t\treturn b.addError(syserror.New(\"cannot set commitID without FullName when calling AddLocalModule\"))\n\t}\n\tif !isTarget && (len(localModuleOptions.targetPaths) > 0 || len(localModuleOptions.targetExcludePaths) > 0) {\n\t\treturn b.addError(syserror.Newf(\"cannot set TargetPaths for a non-target Module when calling AddLocalModule, bucketID=%q, targetPaths=%v, targetExcludePaths=%v\", bucketID, localModuleOptions.targetPaths, localModuleOptions.targetExcludePaths))\n\t}\n\tif !isTarget && localModuleOptions.protoFileTargetPath != \"\" {\n\t\treturn b.addError(syserror.Newf(\"cannot set ProtoFileTargetPath for a non-target Module when calling AddLocalModule, bucketID=%q, protoFileTargetPath=%q\", bucketID, localModuleOptions.protoFileTargetPath))\n\t}\n\tif localModuleOptions.protoFileTargetPath != \"\" &&\n\t\t(len(localModuleOptions.targetPaths) > 0 || len(localModuleOptions.targetExcludePaths) > 0) {\n\t\treturn b.addError(syserror.Newf(\"cannot set TargetPaths and ProtoFileTargetPath when calling AddLocalModule, bucketID=%q, protoFileTargetPath=%q, targetPaths=%v, targetExcludePaths=%v\", bucketID, localModuleOptions.protoFileTargetPath, localModuleOptions.targetPaths, localModuleOptions.targetExcludePaths))\n\t}\n\tif localModuleOptions.protoFileTargetPath != \"\" &&\n\t\tnormalpath.Ext(localModuleOptions.protoFileTargetPath) != \".proto\" {\n\t\treturn b.addError(syserror.Newf(\"proto file target %q is not a .proto file\", localModuleOptions.protoFileTargetPath))\n\t}\n\n\tmodule, err := newModule(\n\t\tb.ctx,\n\t\tgetSyncOnceValuesGetBucketWithStorageMatcherApplied(\n\t\t\tb.ctx,\n\t\t\tfunc() (storage.ReadBucket, error) {\n\t\t\t\treturn bucket, nil\n\t\t\t},\n\t\t),\n\t\tbucketID,\n\t\tlocalModuleOptions.description,\n\t\tlocalModuleOptions.moduleFullName,\n\t\tlocalModuleOptions.commitID,\n\t\tisTarget,\n\t\ttrue,\n\t\tfunc() (ObjectData, error) { return localModuleOptions.v1BufYAMLObjectData, nil },\n\t\tfunc() (ObjectData, error) { return localModuleOptions.v1BufLockObjectData, nil },\n\t\tfunc() ([]ModuleKey, error) {\n\t\t\t// See comment in added_module.go when we construct remote Modules for why\n\t\t\t// we have this function in the first place.\n\t\t\treturn nil, syserror.Newf(\"getDepModuleKeysB5 should never be called for a local Module\")\n\t\t},\n\t\tlocalModuleOptions.targetPaths,\n\t\tlocalModuleOptions.targetExcludePaths,\n\t\tlocalModuleOptions.protoFileTargetPath,\n\t\tlocalModuleOptions.includePackageFiles,\n\t)\n\tif err != nil {\n\t\treturn b.addError(err)\n\t}\n\tb.addedModules = append(\n\t\tb.addedModules,\n\t\tnewLocalAddedModule(\n\t\t\tmodule,\n\t\t\tisTarget,\n\t\t),\n\t)\n\treturn b\n}\n\nfunc (b *moduleSetBuilder) AddRemoteModule(\n\tmoduleKey ModuleKey,\n\tisTarget bool,\n\toptions ...RemoteModuleOption,\n) ModuleSetBuilder {\n\tif b.buildCalled.Load() {\n\t\treturn b.addError(errBuildAlreadyCalled)\n\t}\n\tremoteModuleOptions := newRemoteModuleOptions()\n\tfor _, option := range options {\n\t\toption(remoteModuleOptions)\n\t}\n\tif !isTarget && (len(remoteModuleOptions.targetPaths) > 0 || len(remoteModuleOptions.targetExcludePaths) > 0) {\n\t\treturn b.addError(syserror.New(\"cannot set TargetPaths for a non-target Module when calling AddRemoteModule\"))\n\t}\n\n\tb.addedModules = append(\n\t\tb.addedModules,\n\t\tnewRemoteAddedModule(\n\t\t\tmoduleKey,\n\t\t\tremoteModuleOptions.targetPaths,\n\t\t\tremoteModuleOptions.targetExcludePaths,\n\t\t\tisTarget,\n\t\t),\n\t)\n\treturn b\n}\n\nfunc (b *moduleSetBuilder) Build() (ModuleSet, error) {\n\tdefer xslog.DebugProfile(b.logger)()\n\n\tif !b.buildCalled.CompareAndSwap(false, true) {\n\t\treturn nil, errBuildAlreadyCalled\n\t}\n\tif len(b.errs) > 0 {\n\t\treturn nil, errors.Join(b.errs...)\n\t}\n\tif len(b.addedModules) == 0 {\n\t\t// Allow an empty ModuleSet.\n\t\treturn newModuleSet(nil)\n\t}\n\t// If not empty, we need at least one target Module.\n\tif xslices.Count(b.addedModules, func(m *addedModule) bool { return m.IsTarget() }) < 1 {\n\t\treturn nil, syserror.New(\"no Modules were targeted in ModuleSetBuilder\")\n\t}\n\n\t// Get the unique modules, preferring targets over non-targets, and local over remote.\n\taddedModules, err := getUniqueSortedAddedModulesByOpaqueID(b.ctx, b.commitProvider, b.addedModules)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmodules, err := xslices.MapError(\n\t\taddedModules,\n\t\tfunc(addedModule *addedModule) (Module, error) {\n\t\t\treturn addedModule.ToModule(b.ctx, b.moduleDataProvider, b.commitProvider)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newModuleSet(modules)\n}\n\nfunc (b *moduleSetBuilder) addError(err error) *moduleSetBuilder {\n\tb.errs = append(b.errs, err)\n\treturn b\n}\n\nfunc (*moduleSetBuilder) isModuleSetBuilder() {}\n\ntype localModuleOptions struct {\n\tmoduleFullName      bufparse.FullName\n\tcommitID            uuid.UUID\n\tdescription         string\n\ttargetPaths         []string\n\ttargetExcludePaths  []string\n\tprotoFileTargetPath string\n\tincludePackageFiles bool\n\tv1BufYAMLObjectData ObjectData\n\tv1BufLockObjectData ObjectData\n}\n\nfunc newLocalModuleOptions() *localModuleOptions {\n\treturn &localModuleOptions{}\n}\n\ntype remoteModuleOptions struct {\n\ttargetPaths        []string\n\ttargetExcludePaths []string\n}\n\nfunc newRemoteModuleOptions() *remoteModuleOptions {\n\treturn &remoteModuleOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/module_visibility.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\t// ModuleVisibilityPublic says the Module is public on the registry.\n\tModuleVisibilityPublic = iota + 1\n\t// ModuleVisibilityPrivate says the Module is private on the registry.\n\tModuleVisibilityPrivate\n)\n\n// ModuleVisibility is the visibility of a Module on a registry.\n//\n// Only used for Upload for now.\ntype ModuleVisibility int\n\n// ParseModuleVisibility parses the ModuleVisibility from the string.\nfunc ParseModuleVisibility(s string) (ModuleVisibility, error) {\n\tswitch s {\n\tcase \"public\":\n\t\treturn ModuleVisibilityPublic, nil\n\tcase \"private\":\n\t\treturn ModuleVisibilityPrivate, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown ModuleVisibility: %q\", s)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/object_data.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// ObjectData is individual file data.\n//\n// It matches bufconfig.ObjectData, but is also defined here to avoid circular dependencies.\n// As opposed to most of our interfaces, it does not have a private method limiting its implementation\n// to this package.\n//\n// registry-proto Files can be converted into ObjectDatas.\ntype ObjectData interface {\n\t// Name returns the file name.\n\t//\n\t// Always non-empty.\n\tName() string\n\t// Data returns the file data.\n\tData() []byte\n}\n\n// NewObjectData returns a new ObjectData.\nfunc NewObjectData(name string, data []byte) (ObjectData, error) {\n\treturn newObjectData(name, data)\n}\n\n/// *** PRIVATE ***\n\ntype objectData struct {\n\tname string\n\tdata []byte\n}\n\nfunc newObjectData(name string, data []byte) (*objectData, error) {\n\tif name == \"\" {\n\t\treturn nil, errors.New(\"name is empty when constructing an ObjectData\")\n\t}\n\tif normalpath.Base(name) != name {\n\t\treturn nil, fmt.Errorf(\"expected file name but got file path %q\", name)\n\t}\n\treturn &objectData{\n\t\tname: name,\n\t\tdata: data,\n\t}, nil\n}\n\nfunc (o *objectData) Name() string {\n\treturn o.name\n}\n\nfunc (o *objectData) Data() []byte {\n\treturn o.data\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/paths.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\nconst (\n\t// licenseFilePath is the path of the license file within a Module.\n\tlicenseFilePath = \"LICENSE\"\n)\n\nvar (\n\t// orderedDocFilePaths are the potential documentation file paths for a Module.\n\t//\n\t// When creating a Module from a Bucket, we check the file paths buf.md, README.md, and README.markdown\n\t// to exist, in that order. The first one to exist is chosen as the documentation file that is considered\n\t// part of the Module, and any others are discarded.\n\torderedDocFilePaths = []string{\n\t\t\"buf.md\",\n\t\t\"README.md\",\n\t\t\"README.markdown\",\n\t}\n\n\t// docFilePathMap is a map of all valid documentation file paths.\n\tdocFilePathMap map[string]struct{}\n)\n\nfunc init() {\n\tdocFilePathMap = xslices.ToStructMap(orderedDocFilePaths)\n}\n\nfunc getDocFilePathForStorageReadBucket(ctx context.Context, bucket storage.ReadBucket) string {\n\tfor _, docFilePath := range orderedDocFilePaths {\n\t\tif _, err := bucket.Stat(ctx, docFilePath); err == nil {\n\t\t\treturn docFilePath\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc getDocFilePathForModuleReadBucket(ctx context.Context, bucket ModuleReadBucket) string {\n\tfor _, docFilePath := range orderedDocFilePaths {\n\t\tif _, err := bucket.StatFileInfo(ctx, docFilePath); err == nil {\n\t\t\treturn docFilePath\n\t\t}\n\t}\n\treturn \"\"\n}\n\n// getStorageMatcher gets the storage.Matcher that will filter the storage.ReadBucket down to specifically\n// the files that are relevant to a module.\nfunc getStorageMatcher(ctx context.Context, bucket storage.ReadBucket) storage.Matcher {\n\treturn storage.MatchOr(\n\t\tstorage.MatchPathExt(\".proto\"),\n\t\tstorage.MatchPathEqual(licenseFilePath),\n\t\tstorage.MatchPathEqual(getDocFilePathForStorageReadBucket(ctx, bucket)),\n\t)\n}\n\n// getSyncOnceValuesGetBucketWithStorageMatcherApplied wraps the getBucket function with sync.OnceValues\n// and getStorageMatcher applied.\n//\n// This is used when constructing moduleReadBuckets in moduleSetBuilder, and when getting a bucket for\n// module digest calculations in moduleData.\nfunc getSyncOnceValuesGetBucketWithStorageMatcherApplied(\n\tctx context.Context,\n\tgetBucket func() (storage.ReadBucket, error),\n) func() (storage.ReadBucket, error) {\n\treturn sync.OnceValues(\n\t\tfunc() (storage.ReadBucket, error) {\n\t\t\tbucket, err := getBucket()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn storage.FilterReadBucket(bucket, getStorageMatcher(ctx, bucket)), nil\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/proto_file_tracker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"errors\"\n\t\"sort\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// protoFileTracker tracks if we found a .proto file for each Module tracked, and what the OpaqueIDs\n// are for each unique .proto file path tracked are.\n//\n// This allows us to fulfill the documentation for ModuleReadBucket on Module where at least\n// one .proto file will exist in a ModuleReadBucket, and lets us discover if there are duplicate\n// paths across Modules.\ntype protoFileTracker struct {\n\topaqueIDToProtoFileExists map[string]bool\n\tprotoPathToOpaqueIDMap    map[string]map[string]struct{}\n\topaqueIDToDescription     map[string]string\n}\n\nfunc newProtoFileTracker() *protoFileTracker {\n\treturn &protoFileTracker{\n\t\topaqueIDToProtoFileExists: make(map[string]bool),\n\t\tprotoPathToOpaqueIDMap:    make(map[string]map[string]struct{}),\n\t\topaqueIDToDescription:     make(map[string]string),\n\t}\n}\n\n// trackModule says to track the Module to see if it has any .proto files.\n//\n// If this is never called, it will simply result in no NoProtoFilesErrors being produced.\nfunc (t *protoFileTracker) trackModule(module Module) {\n\topaqueID := module.OpaqueID()\n\tif _, ok := t.opaqueIDToProtoFileExists[opaqueID]; !ok {\n\t\tt.opaqueIDToProtoFileExists[opaqueID] = false\n\t}\n\tt.opaqueIDToDescription[opaqueID] = module.Description()\n}\n\n// trackFileInfo says to track the FileInfo to mark its associated Module as having .proto files\n// if the FileInfo represents a .proto file, and to mark its path as having the associated Module's\n// opaqueID.\nfunc (t *protoFileTracker) trackFileInfo(fileInfo FileInfo) {\n\tif fileInfo.FileType() != FileTypeProto {\n\t\treturn\n\t}\n\tmodule := fileInfo.Module()\n\topaqueID := module.OpaqueID()\n\tt.opaqueIDToProtoFileExists[opaqueID] = true\n\tprotoPathOpaqueIDMap, ok := t.protoPathToOpaqueIDMap[fileInfo.Path()]\n\tif !ok {\n\t\tprotoPathOpaqueIDMap = make(map[string]struct{})\n\t\tt.protoPathToOpaqueIDMap[fileInfo.Path()] = protoPathOpaqueIDMap\n\t}\n\tprotoPathOpaqueIDMap[opaqueID] = struct{}{}\n\tt.opaqueIDToDescription[opaqueID] = module.Description()\n}\n\n// validate validates. This should be called when all tracking is complete.\nfunc (t *protoFileTracker) validate() error {\n\tvar noProtoFilesErrors []*NoProtoFilesError\n\tfor opaqueID, protoFileExists := range t.opaqueIDToProtoFileExists {\n\t\tif !protoFileExists {\n\t\t\tdescription, ok := t.opaqueIDToDescription[opaqueID]\n\t\t\tif !ok {\n\t\t\t\t// This should never happen, but we want to make sure we return an error.\n\t\t\t\tdescription = opaqueID\n\t\t\t}\n\t\t\tnoProtoFilesErrors = append(\n\t\t\t\tnoProtoFilesErrors,\n\t\t\t\t&NoProtoFilesError{\n\t\t\t\t\tModuleDescription: description,\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\t}\n\tvar duplicateProtoPathErrors []*DuplicateProtoPathError\n\tfor protoPath, opaqueIDMap := range t.protoPathToOpaqueIDMap {\n\t\tif len(opaqueIDMap) > 1 {\n\t\t\tmoduleDescriptions := xslices.Map(\n\t\t\t\txslices.MapKeysToSortedSlice(opaqueIDMap),\n\t\t\t\tfunc(opaqueID string) string {\n\t\t\t\t\treturn t.opaqueIDToDescription[opaqueID]\n\t\t\t\t},\n\t\t\t)\n\t\t\tif len(moduleDescriptions) <= 1 {\n\t\t\t\treturn syserror.Newf(\"only got %d Module descriptions for opaque IDs %v\", len(moduleDescriptions), opaqueIDMap)\n\t\t\t}\n\t\t\tduplicateProtoPathErrors = append(\n\t\t\t\tduplicateProtoPathErrors,\n\t\t\t\t&DuplicateProtoPathError{\n\t\t\t\t\tProtoPath:          protoPath,\n\t\t\t\t\tModuleDescriptions: moduleDescriptions,\n\t\t\t\t},\n\t\t\t)\n\t\t}\n\t}\n\tif len(noProtoFilesErrors) != 0 || len(duplicateProtoPathErrors) != 0 {\n\t\tsort.Slice(\n\t\t\tnoProtoFilesErrors,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn noProtoFilesErrors[i].ModuleDescription < noProtoFilesErrors[j].ModuleDescription\n\t\t\t},\n\t\t)\n\t\tsort.Slice(\n\t\t\tduplicateProtoPathErrors,\n\t\t\tfunc(i int, j int) bool {\n\t\t\t\treturn duplicateProtoPathErrors[i].ProtoPath < duplicateProtoPathErrors[j].ProtoPath\n\t\t\t},\n\t\t)\n\t\terrs := make([]error, 0, len(noProtoFilesErrors)+len(duplicateProtoPathErrors))\n\t\tfor _, noProtoFilesError := range noProtoFilesErrors {\n\t\t\terrs = append(errs, noProtoFilesError)\n\t\t}\n\t\tfor _, duplicateProtoPathError := range duplicateProtoPathErrors {\n\t\t\terrs = append(errs, duplicateProtoPathError)\n\t\t}\n\t\treturn errors.Join(errs...)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/registry_commit_id.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport \"github.com/google/uuid\"\n\n// RegistryCommitID is the pair of a Commit ID with the registry the commit belongs to.\n//\n// We need this to be a public, comparable type, as we use it in the GraphProvider.\ntype RegistryCommitID struct {\n\tRegistry string\n\tCommitID uuid.UUID\n}\n\n// NewRegistryCommitID returns a new RegistryCommitID.\nfunc NewRegistryCommitID(registry string, commitID uuid.UUID) RegistryCommitID {\n\treturn RegistryCommitID{\n\t\tRegistry: registry,\n\t\tCommitID: commitID,\n\t}\n}\n\n// ModuleKeyToRegistryCommitID converts the ModuleKey to a RegistryCommitID.\nfunc ModuleKeyToRegistryCommitID(moduleKey ModuleKey) RegistryCommitID {\n\treturn NewRegistryCommitID(\n\t\tmoduleKey.FullName().Registry(),\n\t\tmoduleKey.CommitID(),\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/remote_dep.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"sort\"\n\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// RemoteDep is a remote dependency of some local Module in a ModuleSet.\n//\n// This is different than ModuleDep in that it doesn't specify the parent Module.\n// There could be multiple modules that are the parents of a given RemoteDep.\n//\n// We don't care about targeting here - we want to know the remote dependencies for\n// purposes such as figuring out what dependencies are unused and can be pruned.\ntype RemoteDep interface {\n\t// All RemoteDeps will have a FullName, as they are remote.\n\tModule\n\n\t// IsDirect returns true if the remote dependency is a direct dependency of a Module in the ModuleSet.\n\tIsDirect() bool\n\n\tisRemoteDep()\n}\n\n// RemoteDepsForModuleSet returns the remote dependencies of the local Modules in the ModuleSet.\n//\n// Sorted by FullName.\n//\n// TODO FUTURE: This needs a LOT of testing.\nfunc RemoteDepsForModuleSet(moduleSet ModuleSet) ([]RemoteDep, error) {\n\treturn RemoteDepsForModules(moduleSet.Modules())\n}\n\n// RemoteDepsForModules returns the remote dependencies of the local Modules.\n//\n// Sorted by FullName.\n//\n// This is used in situations where we have already filtered a ModuleSet down to a specific\n// set of modules, such as in the Uploader. Generally, you want to use RemoteDepsForModuleSet.\n//\n// This function may validate that all Modules are from the same ModuleSet, although it\n// currently does not.\n//\n// TODO FUTURE: This needs a LOT of testing.\nfunc RemoteDepsForModules(modules []Module) ([]RemoteDep, error) {\n\tvisitedOpaqueIDs := make(map[string]struct{})\n\tremoteDepFullNameStringsThatAreDirectDepsOfLocal := make(map[string]struct{})\n\tvar remoteDepModules []Module\n\tfor _, module := range modules {\n\t\tif !module.IsLocal() {\n\t\t\tcontinue\n\t\t}\n\t\tmoduleDeps, err := module.ModuleDeps()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfor _, moduleDep := range moduleDeps {\n\t\t\tif moduleDep.IsLocal() {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmoduleDepFullName := moduleDep.FullName()\n\t\t\tif moduleDepFullName == nil {\n\t\t\t\t// Just a sanity check.\n\t\t\t\treturn nil, syserror.New(\"remote module did not have a FullName\")\n\t\t\t}\n\t\t\tif moduleDep.IsDirect() {\n\t\t\t\tremoteDepFullNameStringsThatAreDirectDepsOfLocal[moduleDepFullName.String()] = struct{}{}\n\t\t\t}\n\t\t\tiRemoteDepModules, err := remoteDepsForModuleSetRec(\n\t\t\t\tmoduleDep,\n\t\t\t\tvisitedOpaqueIDs,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tremoteDepModules = append(remoteDepModules, iRemoteDepModules...)\n\t\t}\n\t}\n\tremoteDeps := make([]RemoteDep, len(remoteDepModules))\n\tfor i, remoteDepModule := range remoteDepModules {\n\t\tmoduleFullName := remoteDepModule.FullName()\n\t\tif moduleFullName == nil {\n\t\t\t// Just a sanity check.\n\t\t\treturn nil, syserror.New(\"remote module did not have a FullName\")\n\t\t}\n\t\t_, isDirect := remoteDepFullNameStringsThatAreDirectDepsOfLocal[moduleFullName.String()]\n\t\tremoteDeps[i] = newRemoteDep(remoteDepModule, isDirect)\n\t}\n\tsort.Slice(\n\t\tremoteDeps,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn remoteDeps[i].OpaqueID() < remoteDeps[j].OpaqueID()\n\t\t},\n\t)\n\treturn remoteDeps, nil\n}\n\n// *** PRIVATE ***\n\ntype remoteDep struct {\n\tModule\n\n\tisDirect bool\n}\n\nfunc newRemoteDep(module Module, isDirect bool) *remoteDep {\n\treturn &remoteDep{\n\t\tModule:   module,\n\t\tisDirect: isDirect,\n\t}\n}\n\nfunc (l *remoteDep) IsDirect() bool {\n\treturn l.isDirect\n}\n\nfunc (*remoteDep) isRemoteDep() {}\n\nfunc remoteDepsForModuleSetRec(\n\tremoteModule Module,\n\tvisitedOpaqueIDs map[string]struct{},\n) ([]Module, error) {\n\tif remoteModule.IsLocal() {\n\t\treturn nil, syserror.New(\"only pass remote modules to remoteDepsForModuleSetRec\")\n\t}\n\tif remoteModule.FullName() == nil {\n\t\t// Just a sanity check.\n\t\treturn nil, syserror.New(\"FullName is nil for a remote Module\")\n\t}\n\topaqueID := remoteModule.OpaqueID()\n\tif _, ok := visitedOpaqueIDs[opaqueID]; ok {\n\t\treturn nil, nil\n\t}\n\tvisitedOpaqueIDs[opaqueID] = struct{}{}\n\trecModuleDeps, err := remoteModule.ModuleDeps()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trecDeps := make([]Module, 0, len(recModuleDeps)+1)\n\trecDeps = append(recDeps, remoteModule)\n\tfor _, recModuleDep := range recModuleDeps {\n\t\tif recModuleDep.IsLocal() {\n\t\t\tcontinue\n\t\t}\n\t\t// We deal with local vs remote in the recursive call.\n\t\tiRecDeps, err := remoteDepsForModuleSetRec(\n\t\t\trecModuleDep,\n\t\t\tvisitedOpaqueIDs,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trecDeps = append(recDeps, iRecDeps...)\n\t}\n\treturn recDeps, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/uploader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufmodule\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nvar (\n\t// NopUploader is a no-op Uploader.\n\tNopUploader Uploader = nopUploader{}\n)\n\n// Uploader uploads ModuleSets.\ntype Uploader interface {\n\t// Upload uploads the given ModuleSet.\n\tUpload(ctx context.Context, moduleSet ModuleSet, options ...UploadOption) ([]Commit, error)\n}\n\n// UploadOption is an option for an Upload.\ntype UploadOption func(*uploadOptions)\n\n// UploadWithLabels returns a new UploadOption that adds the given labels.\n//\n// This can be called multiple times. The unique result set of labels will be used.\n// We only ever allow one of labels or tags to be set.\nfunc UploadWithLabels(labels ...string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.labels = append(uploadOptions.labels, labels...)\n\t}\n}\n\n// UploadWithTags returns a new UploadOption that adds the given tags. This is handled\n// separately from labels because we need to resolve the default label(s) when uploading.\n//\n// This can be called multiple times. The unique result set of tags will be used.\n// We only ever allow one of labels or tags to be set.\nfunc UploadWithTags(tags ...string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.tags = append(uploadOptions.tags, tags...)\n\t}\n}\n\n// UploadWithCreateIfNotExist returns a new UploadOption that will result in the\n// Modules being created on the registry with the given visibility and default label if they do not exist.\n// If the default label name is not provided, the module will be created with the default label \"main\".\nfunc UploadWithCreateIfNotExist(createModuleVisibility ModuleVisibility, createDefaultLabel string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.createIfNotExist = true\n\t\tuploadOptions.createModuleVisibility = createModuleVisibility\n\t\tuploadOptions.createDefaultLabel = createDefaultLabel\n\t}\n}\n\n// UploadWithSourceControlURL returns a new UploadOption that will set the source control\n// url for the module contents uploaded.\nfunc UploadWithSourceControlURL(sourceControlURL string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.sourceControlURL = sourceControlURL\n\t}\n}\n\n// UploadWithExcludeUnnamed returns a new UploadOption that will exclude unnamed modules.\nfunc UploadWithExcludeUnnamed() UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.excludeUnnamed = true\n\t}\n}\n\n// UploadOptions are the possible options for upload.\n//\n// This is used by Uploader implementations.\ntype UploadOptions interface {\n\t// Labels returns the unique and sorted set of labels to add.\n\t// Labels are set using the `--label` flag when calling `buf push` and represent the\n\t// labels that are set when uploading module content.\n\tLabels() []string\n\t// CreateIfNotExist says to create Modules if they do not exist on the registry.\n\tCreateIfNotExist() bool\n\t// CreateModuleVisibility returns the visibility to create Modules with.\n\t//\n\t// Will always be present if CreateIfNotExist() is true.\n\tCreateModuleVisibility() ModuleVisibility\n\t// CreateDefaultLabel returns the default label to create Modules with. If this is an\n\t// empty string, then the Modules will be created with default label \"main\".\n\tCreateDefaultLabel() string\n\t// Tags returns unique and sorted set of tags to be added as labels.\n\t// Tags are set using the `--tag` flag when calling `buf push`, and represent labels\n\t// that are set **in addition to** the default label when uploading module content.\n\t//\n\t// The `--tag` flag is a legacy flag that we are continuing supporting. We need to\n\t// handle tags differently from labels when uploading because we need to resolve the\n\t// default label for each module.\n\t//\n\t// We disallow the use of `--tag` when the modules we are uploading to do not all have\n\t// the same default label.\n\tTags() []string\n\t// SourceControlURL returns the source control URL set by the user for the module\n\t// contents uploaded. We set the same source control URL for all module contents.\n\tSourceControlURL() string\n\t// ExcludeUnnamed returns whether to exclude unnamed modules.\n\tExcludeUnnamed() bool\n\n\tisUploadOptions()\n}\n\n// NewUploadOptions returns a new UploadOptions.\nfunc NewUploadOptions(options []UploadOption) (UploadOptions, error) {\n\tuploadOptions := newUploadOptions()\n\tfor _, option := range options {\n\t\toption(uploadOptions)\n\t}\n\tif err := uploadOptions.validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn uploadOptions, nil\n}\n\n// *** PRIVATE ***\n\ntype nopUploader struct{}\n\nfunc (nopUploader) Upload(context.Context, ModuleSet, ...UploadOption) ([]Commit, error) {\n\treturn nil, errors.New(\"unimplemented: no-op Uploader called\")\n}\n\ntype uploadOptions struct {\n\tlabels                 []string\n\ttags                   []string\n\tcreateIfNotExist       bool\n\tcreateModuleVisibility ModuleVisibility\n\tcreateDefaultLabel     string\n\tsourceControlURL       string\n\texcludeUnnamed         bool\n}\n\nfunc newUploadOptions() *uploadOptions {\n\treturn &uploadOptions{}\n}\n\nfunc (u *uploadOptions) Labels() []string {\n\treturn xslices.ToUniqueSorted(u.labels)\n}\n\nfunc (u *uploadOptions) Tags() []string {\n\treturn xslices.ToUniqueSorted(u.tags)\n}\n\nfunc (u *uploadOptions) CreateIfNotExist() bool {\n\treturn u.createIfNotExist\n}\n\nfunc (u *uploadOptions) CreateModuleVisibility() ModuleVisibility {\n\treturn u.createModuleVisibility\n}\n\nfunc (u *uploadOptions) CreateDefaultLabel() string {\n\treturn u.createDefaultLabel\n}\n\nfunc (u *uploadOptions) SourceControlURL() string {\n\treturn u.sourceControlURL\n}\n\nfunc (u *uploadOptions) ExcludeUnnamed() bool {\n\treturn u.excludeUnnamed\n}\n\nfunc (u *uploadOptions) validate() error {\n\tif u.createIfNotExist && u.createModuleVisibility == 0 {\n\t\treturn errors.New(\"must set a valid ModuleVisibility if CreateIfNotExist was specified\")\n\t}\n\t// We validate that only one of labels or tags is set.\n\t// This is enforced at the flag level, so if more than one is set, we return a syserror.\n\tif len(u.labels) > 0 && len(u.tags) > 0 {\n\t\treturn syserror.New(\"cannot set both labels and tags\")\n\t}\n\tif u.sourceControlURL != \"\" {\n\t\tif _, err := url.Parse(u.sourceControlURL); err != nil {\n\t\t\treturn fmt.Errorf(\"must set a valid url for the source control url: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (*uploadOptions) isUploadOptions() {}\n"
  },
  {
    "path": "private/bufpkg/bufmodule/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufmodule\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufparse/bufparse.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufparse\n"
  },
  {
    "path": "private/bufpkg/bufparse/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufparse\n\nimport \"strings\"\n\n// ParseError is an error that occurred during parsing.\n//\n// This is returned by all Parse.* functions in this package.\ntype ParseError struct {\n\t// typeString is the user-consumable string representing of the type that was attempted to be parsed.\n\t//\n\t// Users cannot rely on this data being structured.\n\t// Examples: \"digest\", \"digest type\".\n\ttypeString string\n\t// input is the input string that was attempted to be parsed.\n\tinput string\n\t// err is the underlying error.\n\t//\n\t// Err may be a *ParseError itself.\n\t//\n\t// This is an error we may give back to the user, use pretty strings that should\n\t// be read.\n\terr error\n}\n\n// NewParseError returns a new ParseError.\n//\n// typeString is the user-consumable string representing of the type that was attempted to be parsed.\n// input is the input string that was attempted to be parsed.\n// err is the underlying error.\nfunc NewParseError(typeString string, input string, err error) *ParseError {\n\treturn &ParseError{\n\t\ttypeString: typeString,\n\t\tinput:      input,\n\t\terr:        err,\n\t}\n}\n\n// Error implements the error interface.\nfunc (p *ParseError) Error() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t_, _ = builder.WriteString(`could not parse`)\n\tif p.typeString != \"\" {\n\t\t_, _ = builder.WriteString(` `)\n\t\t_, _ = builder.WriteString(p.typeString)\n\t}\n\tif p.input != \"\" {\n\t\t_, _ = builder.WriteString(` \"`)\n\t\t_, _ = builder.WriteString(p.input)\n\t\t_, _ = builder.WriteString(`\"`)\n\t}\n\tif p.err != nil {\n\t\t_, _ = builder.WriteString(`: `)\n\t\t_, _ = builder.WriteString(p.err.Error())\n\t}\n\treturn builder.String()\n}\n\n// Unwrap returns the underlying error.\nfunc (p *ParseError) Unwrap() error {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.err\n}\n\n// Input returns the input string that was attempted to be parsed.\nfunc (p *ParseError) Input() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.input\n}\n"
  },
  {
    "path": "private/bufpkg/bufparse/full_name.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufparse\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n)\n\n// FullName represents the full name of the entity, including its registry, owner, and name.\ntype FullName interface {\n\t// String returns \"registry/owner/name\".\n\tfmt.Stringer\n\n\t// Registry returns the hostname of the BSR instance that this entity is contained within.\n\tRegistry() string\n\t// Owner returns the name of the user or organization that owns this entity.\n\tOwner() string\n\t// Name returns the name of the entity.\n\tName() string\n\n\tisFullName()\n}\n\n// NewFullName returns a new FullName for the given components.\nfunc NewFullName(\n\tregistry string,\n\towner string,\n\tname string,\n) (FullName, error) {\n\treturn newFullName(\n\t\tregistry,\n\t\towner,\n\t\tname,\n\t)\n}\n\n// ParseFullName parses a FullName from a string in the form \"registry/owner/name\".\n//\n// Returns an error of type *ParseError if the string could not be parsed.\nfunc ParseFullName(fullNameString string) (FullName, error) {\n\t// parseFullNameComponents returns ParseErrors.\n\tregistry, owner, name, err := parseFullNameComponents(fullNameString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := validateFullNameParameters(registry, owner, name); err != nil {\n\t\treturn nil, NewParseError(\n\t\t\t\"full name\",\n\t\t\tfullNameString,\n\t\t\terr,\n\t\t)\n\t}\n\t// We don't rely on constructors for ParseErrors.\n\treturn NewFullName(registry, owner, name)\n}\n\n// FullNameEqual returns true if the FullNames are equal.\nfunc FullNameEqual(one FullName, two FullName) bool {\n\tif (one == nil) != (two == nil) {\n\t\treturn false\n\t}\n\tif one == nil {\n\t\treturn true\n\t}\n\treturn one.String() == two.String()\n}\n\n// HasFullName is any type that has a FullName() function.\ntype HasFullName interface {\n\t// FullName returns the ullName.\n\t//\n\t// May be empty.\n\tFullName() FullName\n}\n\n// FullNameStringToUniqueValue maps the values that implement HasFullName to a map\n// from FullName string to the unique value that has this FullName.\n//\n// If any value has a nil FullName, this value is not added to the map. Therefore,\n// for types that potentially have a nil FullName, you cannot reply on this function\n// returning a map of the same length as the input values.\n//\n// Returns error if there are values with duplicate FullNames.\nfunc FullNameStringToUniqueValue[T HasFullName, S ~[]T](values S) (map[string]T, error) {\n\tm := make(map[string]T, len(values))\n\tfor _, value := range values {\n\t\tfullName := value.FullName()\n\t\tif fullName == nil {\n\t\t\tcontinue\n\t\t}\n\t\texistingValue, ok := m[fullName.String()]\n\t\tif ok {\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"duplicate full names in input: %q, %q\",\n\t\t\t\texistingValue.FullName().String(),\n\t\t\t\tfullName.String(),\n\t\t\t)\n\t\t}\n\t\tm[fullName.String()] = value\n\t}\n\treturn m, nil\n}\n\n// *** PRIVATE ***\n\ntype fullName struct {\n\tregistry string\n\towner    string\n\tname     string\n}\n\nfunc newFullName(\n\tregistry string,\n\towner string,\n\tname string,\n) (*fullName, error) {\n\tif err := validateFullNameParameters(registry, owner, name); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &fullName{\n\t\tregistry: registry,\n\t\towner:    owner,\n\t\tname:     name,\n\t}, nil\n}\n\nfunc (m *fullName) Registry() string {\n\treturn m.registry\n}\n\nfunc (m *fullName) Owner() string {\n\treturn m.owner\n}\n\nfunc (m *fullName) Name() string {\n\treturn m.name\n}\n\nfunc (m *fullName) String() string {\n\treturn m.registry + \"/\" + m.owner + \"/\" + m.name\n}\n\nfunc (*fullName) isFullName() {}\n\nfunc validateFullNameParameters(\n\tregistry string,\n\towner string,\n\tname string,\n) error {\n\tif registry == \"\" {\n\t\treturn errors.New(\"registry is empty\")\n\t}\n\tif _, err := netext.ValidateHostname(registry); err != nil {\n\t\treturn fmt.Errorf(\"registry %q is not a valid hostname: %w\", registry, err)\n\t}\n\tif owner == \"\" {\n\t\treturn errors.New(\"owner is empty\")\n\t}\n\tif strings.Contains(owner, \"/\") {\n\t\treturn fmt.Errorf(\"owner %q cannot contain slashes\", owner)\n\t}\n\tif name == \"\" {\n\t\treturn errors.New(\"name is empty\")\n\t}\n\tif strings.Contains(name, \"/\") {\n\t\treturn fmt.Errorf(\"name %q cannot contain slashes\", name)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufparse/parse.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufparse\n\nimport (\n\t\"errors\"\n\t\"strings\"\n)\n\nfunc parseFullNameComponents(path string) (registry string, owner string, name string, err error) {\n\tslashSplit := strings.Split(path, \"/\")\n\tif len(slashSplit) != 3 {\n\t\treturn \"\", \"\", \"\", newInvalidFullNameStringError(path)\n\t}\n\tregistry = strings.TrimSpace(slashSplit[0])\n\tif registry == \"\" {\n\t\treturn \"\", \"\", \"\", newInvalidFullNameStringError(path)\n\t}\n\towner = strings.TrimSpace(slashSplit[1])\n\tif owner == \"\" {\n\t\treturn \"\", \"\", \"\", newInvalidFullNameStringError(path)\n\t}\n\tname = strings.TrimSpace(slashSplit[2])\n\tif name == \"\" {\n\t\treturn \"\", \"\", \"\", newInvalidFullNameStringError(path)\n\t}\n\treturn registry, owner, name, nil\n}\n\nfunc parseRefComponents(path string) (registry string, owner string, name string, ref string, err error) {\n\t// split by the first \"/\" to separate the registry and remaining part\n\tslashSplit := strings.SplitN(path, \"/\", 2)\n\tif len(slashSplit) != 2 {\n\t\treturn \"\", \"\", \"\", \"\", newInvalidRefStringError(path)\n\t}\n\tregistry, rest := slashSplit[0], slashSplit[1]\n\t// split the remaining part by \":\" to separate the reference\n\tcolonSplit := strings.Split(rest, \":\")\n\tswitch len(colonSplit) {\n\tcase 1:\n\t\t// path excluding registry has no colon, no need to handle its ref\n\tcase 2:\n\t\tref = strings.TrimSpace(colonSplit[1])\n\t\tif ref == \"\" {\n\t\t\treturn \"\", \"\", \"\", \"\", newInvalidRefStringError(path)\n\t\t}\n\tdefault:\n\t\treturn \"\", \"\", \"\", \"\", newInvalidRefStringError(path)\n\t}\n\tregistry, owner, name, err = parseFullNameComponents(registry + \"/\" + colonSplit[0])\n\tif err != nil {\n\t\treturn \"\", \"\", \"\", \"\", newInvalidRefStringError(path)\n\t}\n\treturn registry, owner, name, ref, nil\n}\n\nfunc newInvalidFullNameStringError(s string) error {\n\treturn NewParseError(\n\t\t\"full name\",\n\t\ts,\n\t\terrors.New(\"must be in the form registry/owner/name\"),\n\t)\n}\n\nfunc newInvalidRefStringError(s string) error {\n\treturn NewParseError(\n\t\t\"reference\",\n\t\ts,\n\t\terrors.New(\"must be in the form registry/owner/name[:ref]\"),\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufparse/ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufparse\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\n// Ref is an unresolved reference to an entity.\ntype Ref interface {\n\t// String returns \"registry/owner/name[:ref]\".\n\tfmt.Stringer\n\n\t// FullName returns the full name of the .\n\t//\n\t// Always present.\n\tFullName() FullName\n\t// Ref returns the reference within the .\n\t//\n\t// May be a label or dashless commitID.\n\t//\n\t// May be empty, in which case this references the commit of the default label of the .\n\tRef() string\n\n\tisRef()\n}\n\n// NewRef returns a new Ref for the given components.\nfunc NewRef(\n\tregistry string,\n\towner string,\n\tname string,\n\tref string,\n) (Ref, error) {\n\tfullName, err := NewFullName(registry, owner, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newRef(fullName, ref)\n}\n\n// ParseRef parses a Ref from a string in the form \"registry/owner/name[:ref]\".\n//\n// Returns an error of type *ParseError if the string could not be parsed.\nfunc ParseRef(refString string) (Ref, error) {\n\t// Returns ParseErrors.\n\tregistry, owner, name, ref, err := parseRefComponents(refString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// We don't rely on constructors for ParseErrors.\n\treturn NewRef(registry, owner, name, ref)\n}\n\n// *** PRIVATE ***\n\ntype ref struct {\n\tfullName  FullName\n\treference string\n}\n\nfunc newRef(\n\tfullName FullName,\n\treference string,\n) (*ref, error) {\n\tif fullName == nil {\n\t\treturn nil, errors.New(\"nil FullName when constructing Ref\")\n\t}\n\treturn &ref{\n\t\tfullName:  fullName,\n\t\treference: reference,\n\t}, nil\n}\n\nfunc (m *ref) FullName() FullName {\n\treturn m.fullName\n}\n\nfunc (m *ref) Ref() string {\n\treturn m.reference\n}\n\nfunc (m *ref) String() string {\n\tif m.reference == \"\" {\n\t\treturn m.fullName.String()\n\t}\n\treturn m.fullName.String() + \":\" + m.reference\n}\n\nfunc (*ref) isRef() {}\n"
  },
  {
    "path": "private/bufpkg/bufparse/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufparse\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufplugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginapi/bufpluginapi.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginapi\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginapi/convert.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginapi\n\nimport (\n\t\"fmt\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n)\n\nvar (\n\tv1beta1ProtoDigestTypeToDigestType = map[pluginv1beta1.DigestType]bufplugin.DigestType{\n\t\tpluginv1beta1.DigestType_DIGEST_TYPE_P1: bufplugin.DigestTypeP1,\n\t}\n)\n\n// V1Beta1ProtoToDigest converts the given proto Digest to a Digest.\n//\n// Validation is performed to ensure the DigestType is known, and the value\n// is a valid digest value for the given DigestType.\nfunc V1Beta1ProtoToDigest(protoDigest *pluginv1beta1.Digest) (bufplugin.Digest, error) {\n\tdigestType, err := v1beta1ProtoToDigestType(protoDigest.Type)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcasDigest, err := cas.NewDigest(protoDigest.Value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufplugin.NewDigest(digestType, casDigest)\n}\n\n// *** PRIVATE ***\n\nfunc pluginVisibilityToV1Beta1Proto(pluginVisibility bufplugin.PluginVisibility) (pluginv1beta1.PluginVisibility, error) {\n\tswitch pluginVisibility {\n\tcase bufplugin.PluginVisibilityPublic:\n\t\treturn pluginv1beta1.PluginVisibility_PLUGIN_VISIBILITY_PUBLIC, nil\n\tcase bufplugin.PluginVisibilityPrivate:\n\t\treturn pluginv1beta1.PluginVisibility_PLUGIN_VISIBILITY_PRIVATE, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown PluginVisibility: %v\", pluginVisibility)\n\t}\n}\n\nfunc pluginTypeToV1Beta1Proto(pluginType bufplugin.PluginType) (pluginv1beta1.PluginType, error) {\n\tswitch pluginType {\n\tcase bufplugin.PluginTypeCheck:\n\t\treturn pluginv1beta1.PluginType_PLUGIN_TYPE_CHECK, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown PluginType: %v\", pluginType)\n\t}\n}\n\nfunc v1beta1ProtoToDigestType(protoDigestType pluginv1beta1.DigestType) (bufplugin.DigestType, error) {\n\tdigestType, ok := v1beta1ProtoDigestTypeToDigestType[protoDigestType]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown pluginv1beta1.DigestType: %v\", protoDigestType)\n\t}\n\treturn digestType, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginapi/plugin_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n\t\"github.com/klauspost/compress/zstd\"\n)\n\n// NewPluginDataProvider returns a new PluginDataProvider for the given API client.\n//\n// A warning is printed to the logger if a given Plugin is deprecated.\nfunc NewPluginDataProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1DownloadServiceClientProvider\n\t},\n) bufplugin.PluginDataProvider {\n\treturn newPluginDataProvider(logger, clientProvider)\n}\n\n// *** PRIVATE ***\n\ntype pluginDataProvider struct {\n\tlogger         *slog.Logger\n\tclientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1DownloadServiceClientProvider\n\t}\n}\n\nfunc newPluginDataProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1DownloadServiceClientProvider\n\t},\n) *pluginDataProvider {\n\treturn &pluginDataProvider{\n\t\tlogger:         logger,\n\t\tclientProvider: clientProvider,\n\t}\n}\n\nfunc (p *pluginDataProvider) GetPluginDatasForPluginKeys(\n\tctx context.Context,\n\tpluginKeys []bufplugin.PluginKey,\n) ([]bufplugin.PluginData, error) {\n\tif len(pluginKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tdigestType, err := bufplugin.UniqueDigestTypeForPluginKeys(pluginKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif digestType != bufplugin.DigestTypeP1 {\n\t\treturn nil, syserror.Newf(\"unsupported digest type: %v\", digestType)\n\t}\n\tif _, err := bufparse.FullNameStringToUniqueValue(pluginKeys); err != nil {\n\t\treturn nil, err\n\t}\n\n\tregistryToIndexedPluginKeys := xslices.ToIndexedValuesMap(\n\t\tpluginKeys,\n\t\tfunc(pluginKey bufplugin.PluginKey) string {\n\t\t\treturn pluginKey.FullName().Registry()\n\t\t},\n\t)\n\tindexedPluginDatas := make([]xslices.Indexed[bufplugin.PluginData], 0, len(pluginKeys))\n\tfor registry, indexedPluginKeys := range registryToIndexedPluginKeys {\n\t\tindexedRegistryPluginDatas, err := p.getIndexedPluginDatasForRegistryAndIndexedPluginKeys(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedPluginKeys,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPluginDatas = append(indexedPluginDatas, indexedRegistryPluginDatas...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedPluginDatas), nil\n}\n\nfunc (p *pluginDataProvider) getIndexedPluginDatasForRegistryAndIndexedPluginKeys(\n\tctx context.Context,\n\tregistry string,\n\tindexedPluginKeys []xslices.Indexed[bufplugin.PluginKey],\n) ([]xslices.Indexed[bufplugin.PluginData], error) {\n\tvalues := xslices.Map(indexedPluginKeys, func(indexedPluginKey xslices.Indexed[bufplugin.PluginKey]) *pluginv1beta1.DownloadRequest_Value {\n\t\treturn &pluginv1beta1.DownloadRequest_Value{\n\t\t\tResourceRef: &pluginv1beta1.ResourceRef{\n\t\t\t\tValue: &pluginv1beta1.ResourceRef_Name_{\n\t\t\t\t\tName: &pluginv1beta1.ResourceRef_Name{\n\t\t\t\t\t\tOwner:  indexedPluginKey.Value.FullName().Owner(),\n\t\t\t\t\t\tPlugin: indexedPluginKey.Value.FullName().Name(),\n\t\t\t\t\t\tChild: &pluginv1beta1.ResourceRef_Name_Ref{\n\t\t\t\t\t\t\tRef: uuidutil.ToDashless(indexedPluginKey.Value.CommitID()),\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\tpluginResponse, err := p.clientProvider.V1Beta1DownloadServiceClient(registry).Download(\n\t\tctx,\n\t\tconnect.NewRequest(&pluginv1beta1.DownloadRequest{\n\t\t\tValues: values,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginContents := pluginResponse.Msg.Contents\n\tif len(pluginContents) != len(indexedPluginKeys) {\n\t\treturn nil, syserror.New(\"did not get the expected number of plugin datas\")\n\t}\n\n\tcommitIDToIndexedPluginKeys, err := xslices.ToUniqueValuesMapError(\n\t\tindexedPluginKeys,\n\t\tfunc(indexedPluginKey xslices.Indexed[bufplugin.PluginKey]) (uuid.UUID, error) {\n\t\t\treturn indexedPluginKey.Value.CommitID(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tindexedPluginDatas := make([]xslices.Indexed[bufplugin.PluginData], 0, len(indexedPluginKeys))\n\tfor _, pluginContent := range pluginContents {\n\t\tcommitID, err := uuid.Parse(pluginContent.Commit.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPluginKey, ok := commitIDToIndexedPluginKeys[commitID]\n\t\tif !ok {\n\t\t\treturn nil, syserror.Newf(\"did not get plugin key from store with commitID %q\", commitID)\n\t\t}\n\t\tvar getData func() ([]byte, error)\n\t\tswitch compressionType := pluginContent.CompressionType; compressionType {\n\t\tcase pluginv1beta1.CompressionType_COMPRESSION_TYPE_NONE:\n\t\t\tgetData = func() ([]byte, error) {\n\t\t\t\treturn pluginContent.Content, nil\n\t\t\t}\n\t\tcase pluginv1beta1.CompressionType_COMPRESSION_TYPE_ZSTD:\n\t\t\tgetData = func() ([]byte, error) {\n\t\t\t\tzstdDecoder, err := zstd.NewReader(nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t\tdefer zstdDecoder.Close() // Does not return an error.\n\t\t\t\treturn zstdDecoder.DecodeAll(pluginContent.Content, nil)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown CompressionType: %v\", compressionType)\n\t\t}\n\t\tpluginData, err := bufplugin.NewPluginData(ctx, indexedPluginKey.Value, getData)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPluginDatas = append(\n\t\t\tindexedPluginDatas,\n\t\t\txslices.Indexed[bufplugin.PluginData]{\n\t\t\t\tValue: pluginData,\n\t\t\t\tIndex: indexedPluginKey.Index,\n\t\t\t},\n\t\t)\n\t}\n\treturn indexedPluginDatas, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginapi/plugin_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginapi\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// NewPluginKeyProvider returns a new PluginKeyProvider for the given API clients.\nfunc NewPluginKeyProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1CommitServiceClientProvider\n\t\tbufregistryapiplugin.V1Beta1PluginServiceClientProvider\n\t},\n) bufplugin.PluginKeyProvider {\n\treturn newPluginKeyProvider(logger, clientProvider)\n}\n\n// *** PRIVATE ***\n\ntype pluginKeyProvider struct {\n\tlogger         *slog.Logger\n\tclientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1CommitServiceClientProvider\n\t\tbufregistryapiplugin.V1Beta1PluginServiceClientProvider\n\t}\n}\n\nfunc newPluginKeyProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1CommitServiceClientProvider\n\t\tbufregistryapiplugin.V1Beta1PluginServiceClientProvider\n\t},\n) *pluginKeyProvider {\n\treturn &pluginKeyProvider{\n\t\tlogger:         logger,\n\t\tclientProvider: clientProvider,\n\t}\n}\n\nfunc (p *pluginKeyProvider) GetPluginKeysForPluginRefs(\n\tctx context.Context,\n\tpluginRefs []bufparse.Ref,\n\tdigestType bufplugin.DigestType,\n) ([]bufplugin.PluginKey, error) {\n\tif len(pluginRefs) == 0 {\n\t\treturn nil, nil\n\t}\n\t// Check unique pluginRefs.\n\tif _, err := xslices.ToUniqueValuesMapError(\n\t\tpluginRefs,\n\t\tfunc(pluginRef bufparse.Ref) (string, error) {\n\t\t\treturn pluginRef.String(), nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tregistryToIndexedPluginRefs := xslices.ToIndexedValuesMap(\n\t\tpluginRefs,\n\t\tfunc(pluginRef bufparse.Ref) string {\n\t\t\treturn pluginRef.FullName().Registry()\n\t\t},\n\t)\n\tindexedPluginKeys := make([]xslices.Indexed[bufplugin.PluginKey], 0, len(pluginRefs))\n\tfor registry, indexedPluginRefs := range registryToIndexedPluginRefs {\n\t\tindexedRegistryPluginKeys, err := p.getIndexedPluginKeysForRegistryAndIndexedPluginRefs(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedPluginRefs,\n\t\t\tdigestType,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPluginKeys = append(indexedPluginKeys, indexedRegistryPluginKeys...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedPluginKeys), nil\n}\n\nfunc (p *pluginKeyProvider) getIndexedPluginKeysForRegistryAndIndexedPluginRefs(\n\tctx context.Context,\n\tregistry string,\n\tindexedPluginRefs []xslices.Indexed[bufparse.Ref],\n\tdigestType bufplugin.DigestType,\n) ([]xslices.Indexed[bufplugin.PluginKey], error) {\n\tresourceRefs := xslices.Map(indexedPluginRefs, func(indexedPluginRef xslices.Indexed[bufparse.Ref]) *pluginv1beta1.ResourceRef {\n\t\tresourceRefName := &pluginv1beta1.ResourceRef_Name{\n\t\t\tOwner:  indexedPluginRef.Value.FullName().Owner(),\n\t\t\tPlugin: indexedPluginRef.Value.FullName().Name(),\n\t\t}\n\t\tif ref := indexedPluginRef.Value.Ref(); ref != \"\" {\n\t\t\tresourceRefName.Child = &pluginv1beta1.ResourceRef_Name_Ref{\n\t\t\t\tRef: ref,\n\t\t\t}\n\t\t}\n\t\treturn &pluginv1beta1.ResourceRef{\n\t\t\tValue: &pluginv1beta1.ResourceRef_Name_{\n\t\t\t\tName: resourceRefName,\n\t\t\t},\n\t\t}\n\t})\n\n\tpluginResponse, err := p.clientProvider.V1Beta1CommitServiceClient(registry).GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(&pluginv1beta1.GetCommitsRequest{\n\t\t\tResourceRefs: resourceRefs,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommits := pluginResponse.Msg.Commits\n\tif len(commits) != len(indexedPluginRefs) {\n\t\treturn nil, syserror.New(\"did not get the expected number of plugin datas\")\n\t}\n\n\tindexedPluginKeys := make([]xslices.Indexed[bufplugin.PluginKey], len(commits))\n\tfor i, commit := range commits {\n\t\tcommitID, err := uuidutil.FromDashless(commit.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdigest, err := V1Beta1ProtoToDigest(commit.Digest)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginKey, err := bufplugin.NewPluginKey(\n\t\t\t// Note we don't have to resolve owner_name and plugin_name since we already have them.\n\t\t\tindexedPluginRefs[i].Value.FullName(),\n\t\t\tcommitID,\n\t\t\tfunc() (bufplugin.Digest, error) {\n\t\t\t\treturn digest, nil\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPluginKeys[i] = xslices.Indexed[bufplugin.PluginKey]{\n\t\t\tValue: pluginKey,\n\t\t\tIndex: indexedPluginRefs[i].Index,\n\t\t}\n\t}\n\treturn indexedPluginKeys, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginapi/uploader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"time\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\tpluginv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/plugin/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapiplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/klauspost/compress/zstd\"\n)\n\n// NewUploader returns a new Uploader for the given API client.\nfunc NewUploader(\n\tlogger *slog.Logger,\n\tpluginClientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1PluginServiceClientProvider\n\t\tbufregistryapiplugin.V1Beta1UploadServiceClientProvider\n\t},\n\toptions ...UploaderOption,\n) bufplugin.Uploader {\n\treturn newUploader(logger, pluginClientProvider, options...)\n}\n\n// UploaderOption is an option for a new Uploader.\ntype UploaderOption func(*uploader)\n\n// *** PRIVATE ***\n\ntype uploader struct {\n\tlogger               *slog.Logger\n\tpluginClientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1PluginServiceClientProvider\n\t\tbufregistryapiplugin.V1Beta1UploadServiceClientProvider\n\t}\n}\n\nfunc newUploader(\n\tlogger *slog.Logger,\n\tpluginClientProvider interface {\n\t\tbufregistryapiplugin.V1Beta1PluginServiceClientProvider\n\t\tbufregistryapiplugin.V1Beta1UploadServiceClientProvider\n\t},\n\toptions ...UploaderOption,\n) *uploader {\n\tuploader := &uploader{\n\t\tlogger:               logger,\n\t\tpluginClientProvider: pluginClientProvider,\n\t}\n\tfor _, option := range options {\n\t\toption(uploader)\n\t}\n\treturn uploader\n}\n\nfunc (u *uploader) Upload(\n\tctx context.Context,\n\tplugins []bufplugin.Plugin,\n\toptions ...bufplugin.UploadOption,\n) ([]bufplugin.Commit, error) {\n\tuploadOptions, err := bufplugin.NewUploadOptions(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tregistryToIndexedPluginKeys := xslices.ToIndexedValuesMap(\n\t\tplugins,\n\t\tfunc(plugin bufplugin.Plugin) string {\n\t\t\treturn plugin.FullName().Registry()\n\t\t},\n\t)\n\tindexedCommits := make([]xslices.Indexed[bufplugin.Commit], 0, len(plugins))\n\tfor registry, indexedPluginKeys := range registryToIndexedPluginKeys {\n\t\tindexedRegistryPluginDatas, err := u.uploadIndexedPluginsForRegistry(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedPluginKeys,\n\t\t\tuploadOptions,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedCommits = append(indexedCommits, indexedRegistryPluginDatas...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedCommits), nil\n}\n\nfunc (u *uploader) uploadIndexedPluginsForRegistry(\n\tctx context.Context,\n\tregistry string,\n\tindexedPlugins []xslices.Indexed[bufplugin.Plugin],\n\tuploadOptions bufplugin.UploadOptions,\n) ([]xslices.Indexed[bufplugin.Commit], error) {\n\tif uploadOptions.CreateIfNotExist() {\n\t\t// We must attempt to create each Plugin one at a time, since CreatePlugins will return\n\t\t// an `AlreadyExists` if any of the Plugins we are attempting to create already exists,\n\t\t// and no new Plugins will be created.\n\t\tfor _, indexedPlugin := range indexedPlugins {\n\t\t\tplugin := indexedPlugin.Value\n\t\t\tif _, err := u.createPluginIfNotExist(\n\t\t\t\tctx,\n\t\t\t\tregistry,\n\t\t\t\tplugin,\n\t\t\t\tuploadOptions.CreatePluginVisibility(),\n\t\t\t\tuploadOptions.CreatePluginType(),\n\t\t\t); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\tcontents, err := xslices.MapError(indexedPlugins, func(indexedPlugin xslices.Indexed[bufplugin.Plugin]) (*pluginv1beta1.UploadRequest_Content, error) {\n\t\tplugin := indexedPlugin.Value\n\t\tif !plugin.IsLocal() {\n\t\t\treturn nil, syserror.New(\"expected local Plugin in uploadIndexedPluginsForRegistry\")\n\t\t}\n\t\tif plugin.FullName() == nil {\n\t\t\treturn nil, syserror.Newf(\"expected Plugin name for local Plugin: %s\", plugin.Description())\n\t\t}\n\t\tdata, err := plugin.Data()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcompressedWasmBinary, err := zstdCompress(data)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not compress Plugin data %q: %w\", plugin.OpaqueID(), err)\n\t\t}\n\t\treturn &pluginv1beta1.UploadRequest_Content{\n\t\t\tPluginRef: &pluginv1beta1.PluginRef{\n\t\t\t\tValue: &pluginv1beta1.PluginRef_Name_{\n\t\t\t\t\tName: &pluginv1beta1.PluginRef_Name{\n\t\t\t\t\t\tOwner:  plugin.FullName().Owner(),\n\t\t\t\t\t\tPlugin: plugin.FullName().Name(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tCompressionType: pluginv1beta1.CompressionType_COMPRESSION_TYPE_ZSTD,\n\t\t\tContent:         compressedWasmBinary,\n\t\t\tScopedLabelRefs: xslices.Map(uploadOptions.Labels(), func(label string) *pluginv1beta1.ScopedLabelRef {\n\t\t\t\treturn &pluginv1beta1.ScopedLabelRef{\n\t\t\t\t\tValue: &pluginv1beta1.ScopedLabelRef_Name{\n\t\t\t\t\t\tName: label,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}),\n\t\t\tSourceControlUrl: uploadOptions.SourceControlURL(),\n\t\t}, nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuploadResponse, err := u.pluginClientProvider.V1Beta1UploadServiceClient(registry).Upload(\n\t\tctx,\n\t\tconnect.NewRequest(&pluginv1beta1.UploadRequest{\n\t\t\tContents: contents,\n\t\t}))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginCommits := uploadResponse.Msg.Commits\n\tif len(pluginCommits) != len(indexedPlugins) {\n\t\treturn nil, syserror.Newf(\"expected %d Commits, found %d\", len(indexedPlugins), len(pluginCommits))\n\t}\n\n\tindexedCommits := make([]xslices.Indexed[bufplugin.Commit], 0, len(indexedPlugins))\n\tfor i, pluginCommit := range pluginCommits {\n\t\tpluginFullName := indexedPlugins[i].Value.FullName()\n\t\tcommitID, err := uuidutil.FromDashless(pluginCommit.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginKey, err := bufplugin.NewPluginKey(\n\t\t\tpluginFullName,\n\t\t\tcommitID,\n\t\t\tfunc() (bufplugin.Digest, error) {\n\t\t\t\treturn V1Beta1ProtoToDigest(pluginCommit.Digest)\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcommit := bufplugin.NewCommit(\n\t\t\tpluginKey,\n\t\t\tfunc() (time.Time, error) {\n\t\t\t\treturn pluginCommit.CreateTime.AsTime(), nil\n\t\t\t},\n\t\t)\n\t\tindexedCommits = append(\n\t\t\tindexedCommits,\n\t\t\txslices.Indexed[bufplugin.Commit]{\n\t\t\t\tValue: commit,\n\t\t\t\tIndex: i,\n\t\t\t},\n\t\t)\n\t}\n\treturn indexedCommits, nil\n}\n\nfunc (u *uploader) createPluginIfNotExist(\n\tctx context.Context,\n\tprimaryRegistry string,\n\tplugin bufplugin.Plugin,\n\tcreatePluginVisibility bufplugin.PluginVisibility,\n\tcreatePluginType bufplugin.PluginType,\n) (*pluginv1beta1.Plugin, error) {\n\tv1Beta1ProtoCreatePluginVisibility, err := pluginVisibilityToV1Beta1Proto(createPluginVisibility)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tv1Beta1ProtoCreatePluginType, err := pluginTypeToV1Beta1Proto(createPluginType)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := u.pluginClientProvider.V1Beta1PluginServiceClient(primaryRegistry).CreatePlugins(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.CreatePluginsRequest{\n\t\t\t\tValues: []*pluginv1beta1.CreatePluginsRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tOwnerRef: &ownerv1.OwnerRef{\n\t\t\t\t\t\t\tValue: &ownerv1.OwnerRef_Name{\n\t\t\t\t\t\t\t\tName: plugin.FullName().Owner(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tName:       plugin.FullName().Name(),\n\t\t\t\t\t\tVisibility: v1Beta1ProtoCreatePluginVisibility,\n\t\t\t\t\t\tType:       v1Beta1ProtoCreatePluginType,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeAlreadyExists {\n\t\t\t// If a plugin already existed, then we check validate its contents.\n\t\t\tplugins, err := u.validatePluginsExist(ctx, primaryRegistry, []bufplugin.Plugin{plugin})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(plugins) != 1 {\n\t\t\t\treturn nil, syserror.Newf(\"expected 1 Plugin, found %d\", len(plugins))\n\t\t\t}\n\t\t\treturn plugins[0], nil\n\t\t}\n\t\treturn nil, err\n\t}\n\tif len(response.Msg.Plugins) != 1 {\n\t\treturn nil, syserror.Newf(\"expected 1 Plugin, found %d\", len(response.Msg.Plugins))\n\t}\n\t// Otherwise we return the plugin we created.\n\treturn response.Msg.Plugins[0], nil\n}\n\nfunc (u *uploader) validatePluginsExist(\n\tctx context.Context,\n\tprimaryRegistry string,\n\tplugins []bufplugin.Plugin,\n) ([]*pluginv1beta1.Plugin, error) {\n\tresponse, err := u.pluginClientProvider.V1Beta1PluginServiceClient(primaryRegistry).GetPlugins(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&pluginv1beta1.GetPluginsRequest{\n\t\t\t\tPluginRefs: xslices.Map(\n\t\t\t\t\tplugins,\n\t\t\t\t\tfunc(plugin bufplugin.Plugin) *pluginv1beta1.PluginRef {\n\t\t\t\t\t\treturn &pluginv1beta1.PluginRef{\n\t\t\t\t\t\t\tValue: &pluginv1beta1.PluginRef_Name_{\n\t\t\t\t\t\t\t\tName: &pluginv1beta1.PluginRef_Name{\n\t\t\t\t\t\t\t\t\tOwner:  plugin.FullName().Owner(),\n\t\t\t\t\t\t\t\t\tPlugin: plugin.FullName().Name(),\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\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn response.Msg.Plugins, nil\n}\n\nfunc zstdCompress(data []byte) ([]byte, error) {\n\tencoder, err := zstd.NewWriter(nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer encoder.Close()\n\treturn encoder.EncodeAll(data, nil), nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginapi/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufpluginapi\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufplugincache/bufplugincache.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugincache\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufplugincache/plugin_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugincache\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\t\"sync/atomic\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginstore\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// NewPluginDataProvider returns a new PluginDataProvider that caches the results of the delegate.\n//\n// The PluginDataStore is used as a cache.\nfunc NewPluginDataProvider(\n\tlogger *slog.Logger,\n\tdelegate bufplugin.PluginDataProvider,\n\tstore bufpluginstore.PluginDataStore,\n) bufplugin.PluginDataProvider {\n\treturn newPluginDataProvider(logger, delegate, store)\n}\n\n/// *** PRIVATE ***\n\ntype pluginDataProvider struct {\n\tlogger   *slog.Logger\n\tdelegate bufplugin.PluginDataProvider\n\tstore    bufpluginstore.PluginDataStore\n\n\tkeysRetrieved atomic.Int64\n\tkeysHit       atomic.Int64\n}\n\nfunc newPluginDataProvider(\n\tlogger *slog.Logger,\n\tdelegate bufplugin.PluginDataProvider,\n\tstore bufpluginstore.PluginDataStore,\n) *pluginDataProvider {\n\treturn &pluginDataProvider{\n\t\tlogger:   logger,\n\t\tdelegate: delegate,\n\t\tstore:    store,\n\t}\n}\n\nfunc (p *pluginDataProvider) GetPluginDatasForPluginKeys(\n\tctx context.Context,\n\tpluginKeys []bufplugin.PluginKey,\n) ([]bufplugin.PluginData, error) {\n\tfoundValues, notFoundKeys, err := p.store.GetPluginDatasForPluginKeys(ctx, pluginKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdelegateValues, err := p.delegate.GetPluginDatasForPluginKeys(ctx, notFoundKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := p.store.PutPluginDatas(ctx, delegateValues); err != nil {\n\t\treturn nil, err\n\t}\n\n\tp.keysRetrieved.Add(int64(len(pluginKeys)))\n\tp.keysHit.Add(int64(len(foundValues)))\n\n\tcommitIDToIndexedKey, err := xslices.ToUniqueIndexedValuesMap(\n\t\tpluginKeys,\n\t\tfunc(pluginKey bufplugin.PluginKey) uuid.UUID {\n\t\t\treturn pluginKey.CommitID()\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tindexedValues, err := xslices.MapError(\n\t\tappend(foundValues, delegateValues...),\n\t\tfunc(value bufplugin.PluginData) (xslices.Indexed[bufplugin.PluginData], error) {\n\t\t\tcommitID := value.PluginKey().CommitID()\n\t\t\tindexedKey, ok := commitIDToIndexedKey[commitID]\n\t\t\tif !ok {\n\t\t\t\treturn xslices.Indexed[bufplugin.PluginData]{}, syserror.Newf(\"did not get value from store with commitID %q\", uuidutil.ToDashless(commitID))\n\t\t\t}\n\t\t\treturn xslices.Indexed[bufplugin.PluginData]{\n\t\t\t\tValue: value,\n\t\t\t\tIndex: indexedKey.Index,\n\t\t\t}, nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.IndexedToSortedValues(indexedValues), nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufplugincache/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufplugincache\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginstore/bufpluginstore.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginstore\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginstore/policy_data_store.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpluginstore\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// PluginDataStore reads and writes PluginsDatas.\ntype PluginDataStore interface {\n\t// GetPluginDatasForPluginKeys gets the PluginDatas from the store for the PluginKeys.\n\t//\n\t// Returns the found PluginDatas, and the input PluginKeys that were not found, each\n\t// ordered by the order of the input PluginKeys.\n\tGetPluginDatasForPluginKeys(context.Context, []bufplugin.PluginKey) (\n\t\tfoundPluginDatas []bufplugin.PluginData,\n\t\tnotFoundPluginKeys []bufplugin.PluginKey,\n\t\terr error,\n\t)\n\t// PutPluginDatas puts the PluginDatas to the store.\n\tPutPluginDatas(ctx context.Context, moduleDatas []bufplugin.PluginData) error\n}\n\n// NewPluginDataStore returns a new PluginDataStore for the given bucket.\n//\n// It is assumed that the PluginDataStore has complete control of the bucket.\n//\n// This is typically used to interact with a cache directory.\nfunc NewPluginDataStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n) PluginDataStore {\n\treturn newPluginDataStore(logger, bucket)\n}\n\n/// *** PRIVATE ***\n\ntype pluginDataStore struct {\n\tlogger *slog.Logger\n\tbucket storage.ReadWriteBucket\n}\n\nfunc newPluginDataStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n) *pluginDataStore {\n\treturn &pluginDataStore{\n\t\tlogger: logger,\n\t\tbucket: bucket,\n\t}\n}\n\nfunc (p *pluginDataStore) GetPluginDatasForPluginKeys(\n\tctx context.Context,\n\tpluginKeys []bufplugin.PluginKey,\n) ([]bufplugin.PluginData, []bufplugin.PluginKey, error) {\n\tvar foundPluginDatas []bufplugin.PluginData\n\tvar notFoundPluginKeys []bufplugin.PluginKey\n\tfor _, pluginKey := range pluginKeys {\n\t\tpluginData, err := p.getPluginDataForPluginKey(ctx, pluginKey)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tnotFoundPluginKeys = append(notFoundPluginKeys, pluginKey)\n\t\t} else {\n\t\t\tfoundPluginDatas = append(foundPluginDatas, pluginData)\n\t\t}\n\t}\n\treturn foundPluginDatas, notFoundPluginKeys, nil\n}\n\nfunc (p *pluginDataStore) PutPluginDatas(\n\tctx context.Context,\n\tpluginDatas []bufplugin.PluginData,\n) error {\n\tfor _, pluginData := range pluginDatas {\n\t\tif err := p.putPluginData(ctx, pluginData); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// getPluginDataForPluginKey reads the plugin data for the plugin key from the cache.\nfunc (p *pluginDataStore) getPluginDataForPluginKey(\n\tctx context.Context,\n\tpluginKey bufplugin.PluginKey,\n) (bufplugin.PluginData, error) {\n\tpluginDataStorePath, err := getPluginDataStorePath(pluginKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif exists, err := storage.Exists(ctx, p.bucket, pluginDataStorePath); err != nil {\n\t\treturn nil, err\n\t} else if !exists {\n\t\treturn nil, fs.ErrNotExist\n\t}\n\treturn bufplugin.NewPluginData(\n\t\tctx,\n\t\tpluginKey,\n\t\tfunc() ([]byte, error) {\n\t\t\t// Data is stored uncompressed.\n\t\t\treturn storage.ReadPath(ctx, p.bucket, pluginDataStorePath)\n\t\t},\n\t)\n}\n\n// putPluginData puts the plugin data into the plugin cache.\nfunc (p *pluginDataStore) putPluginData(\n\tctx context.Context,\n\tpluginData bufplugin.PluginData,\n) error {\n\tpluginKey := pluginData.PluginKey()\n\tpluginDataStorePath, err := getPluginDataStorePath(pluginKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdata, err := pluginData.Data()\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Data is stored uncompressed.\n\treturn storage.PutPath(ctx, p.bucket, pluginDataStorePath, data)\n}\n\n// getPluginDataStorePath returns the path for the plugin data store for the plugin key.\n//\n// This is \"digestType/registry/owner/name/dashlessCommitID\", e.g. the plugin\n// \"buf.build/acme/check-plugin\" with commit \"12345-abcde\" and digest type \"p1\"\n// will return \"p1/buf.build/acme/check-plugin/12345abcde.wasm\".\nfunc getPluginDataStorePath(pluginKey bufplugin.PluginKey) (string, error) {\n\tdigest, err := pluginKey.Digest()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfullName := pluginKey.FullName()\n\treturn normalpath.Join(\n\t\tdigest.Type().String(),\n\t\tfullName.Registry(),\n\t\tfullName.Owner(),\n\t\tfullName.Name(),\n\t\tuuidutil.ToDashless(pluginKey.CommitID())+\".wasm\",\n\t), nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/bufpluginstore/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufpluginstore\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufplugin/commit.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\n// Commit represents a Commit for a Plugin on the BSR.\ntype Commit interface {\n\t// PluginKey returns the PluginKey for the Commit.\n\tPluginKey() PluginKey\n\t// CreateTime returns the time the Commit was created on the BSR.\n\tCreateTime() (time.Time, error)\n\n\tisCommit()\n}\n\n// NewCommit returns a new Commit.\nfunc NewCommit(\n\tpluginKey PluginKey,\n\tgetCreateTime func() (time.Time, error),\n) Commit {\n\treturn newCommit(\n\t\tpluginKey,\n\t\tgetCreateTime,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype commit struct {\n\tpluginKey     PluginKey\n\tgetCreateTime func() (time.Time, error)\n}\n\nfunc newCommit(\n\tpluginKey PluginKey,\n\tgetCreateTime func() (time.Time, error),\n) *commit {\n\treturn &commit{\n\t\tpluginKey:     pluginKey,\n\t\tgetCreateTime: sync.OnceValues(getCreateTime),\n\t}\n}\n\nfunc (c *commit) PluginKey() PluginKey {\n\treturn c.pluginKey\n}\n\nfunc (c *commit) CreateTime() (time.Time, error) {\n\t// This may invoke tamper-proofing per newCommit construction.\n\tif _, err := c.pluginKey.Digest(); err != nil {\n\t\treturn time.Time{}, err\n\t}\n\treturn c.getCreateTime()\n}\n\nfunc (*commit) isCommit() {}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/digest.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// DigestTypeP1 represents the p1 plugin digest type.\n\t//\n\t// The string value of this is \"p1\".\n\tDigestTypeP1 DigestType = iota + 1\n)\n\nvar (\n\t// AllDigestTypes are all known DigestTypes.\n\tAllDigestTypes = []DigestType{\n\t\tDigestTypeP1,\n\t}\n\tdigestTypeToString = map[DigestType]string{\n\t\tDigestTypeP1: \"p1\",\n\t}\n\tstringToDigestType = map[string]DigestType{\n\t\t\"p1\": DigestTypeP1,\n\t}\n)\n\n// DigestType is a type of digest.\ntype DigestType int\n\n// ParseDigestType parses a DigestType from its string representation.\n//\n// This reverses DigestType.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseDigestType(s string) (DigestType, error) {\n\td, ok := stringToDigestType[s]\n\tif !ok {\n\t\treturn 0, bufparse.NewParseError(\n\t\t\t\"plugin digest type\",\n\t\t\ts,\n\t\t\tfmt.Errorf(\"unknown type: %q\", s),\n\t\t)\n\t}\n\treturn d, nil\n}\n\n// String prints the string representation of the DigestType.\nfunc (d DigestType) String() string {\n\ts, ok := digestTypeToString[d]\n\tif !ok {\n\t\treturn strconv.Itoa(int(d))\n\t}\n\treturn s\n}\n\n// Digest is a digest of some content.\n//\n// It consists of a DigestType and a digest value.\ntype Digest interface {\n\t// String() prints typeString:hexValue.\n\tfmt.Stringer\n\n\t// Type returns the type of digest.\n\t//\n\t// Always a valid value.\n\tType() DigestType\n\t// Value returns the digest value.\n\t//\n\t// Always non-empty.\n\tValue() []byte\n\n\tisDigest()\n}\n\n// NewDigest creates a new Digest.\nfunc NewDigest(digestType DigestType, casDigest cas.Digest) (Digest, error) {\n\tswitch digestType {\n\tcase DigestTypeP1:\n\t\tif casDigest.Type() != cas.DigestTypeShake256 {\n\t\t\treturn nil, syserror.Newf(\n\t\t\t\t\"trying to create a %v Digest for a cas Digest of type %v\",\n\t\t\t\tdigestType,\n\t\t\t\tcasDigest.Type(),\n\t\t\t)\n\t\t}\n\t\treturn newDigest(digestType, casDigest), nil\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\n// ParseDigest parses a Digest from its string representation.\n//\n// A Digest string is of the form typeString:hexValue.\n// The string is expected to be non-empty, If not, an error is returned.\n//\n// This reverses Digest.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseDigest(s string) (Digest, error) {\n\tif s == \"\" {\n\t\t// This should be considered a system error.\n\t\treturn nil, errors.New(\"empty string passed to ParseDigest\")\n\t}\n\tdigestTypeString, hexValue, ok := strings.Cut(s, \":\")\n\tif !ok {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"plugin digest\",\n\t\t\ts,\n\t\t\terrors.New(`must be in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tdigestType, err := ParseDigestType(digestTypeString)\n\tif err != nil {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"plugin digest\",\n\t\t\tdigestTypeString,\n\t\t\terr,\n\t\t)\n\t}\n\tvalue, err := hex.DecodeString(hexValue)\n\tif err != nil {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"plugin digest\",\n\t\t\ts,\n\t\t\terrors.New(`could not parse hex: must in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tswitch digestType {\n\tcase DigestTypeP1:\n\t\tcasDigest, err := cas.NewDigest(value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn NewDigest(digestType, casDigest)\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\n// DigestEqual returns true if the given Digests are considered equal.\n//\n// If both Digests are nil, this returns true.\n//\n// This checks both the DigestType and Digest value.\nfunc DigestEqual(a Digest, b Digest) bool {\n\tif (a == nil) != (b == nil) {\n\t\treturn false\n\t}\n\tif a == nil {\n\t\treturn true\n\t}\n\tif a.Type() != b.Type() {\n\t\treturn false\n\t}\n\treturn bytes.Equal(a.Value(), b.Value())\n}\n\n/// *** PRIVATE ***\n\ntype digest struct {\n\tdigestType DigestType\n\tcasDigest  cas.Digest\n\t// Cache as we call String pretty often.\n\t// We could do this lazily but not worth it.\n\tstringValue string\n}\n\n// validation should occur outside of this function.\nfunc newDigest(digestType DigestType, casDigest cas.Digest) *digest {\n\treturn &digest{\n\t\tdigestType:  digestType,\n\t\tcasDigest:   casDigest,\n\t\tstringValue: digestType.String() + \":\" + hex.EncodeToString(casDigest.Value()),\n\t}\n}\n\nfunc (d *digest) Type() DigestType {\n\treturn d.digestType\n}\n\nfunc (d *digest) Value() []byte {\n\treturn d.casDigest.Value()\n}\n\nfunc (d *digest) String() string {\n\treturn d.stringValue\n}\n\nfunc (*digest) isDigest() {}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// DigestMismatchError is the error returned if the Digest of a downloaded Plugin or Commit\n// does not match the expected digest in a buf.lock file.\ntype DigestMismatchError struct {\n\tFullName       bufparse.FullName\n\tCommitID       uuid.UUID\n\tExpectedDigest Digest\n\tActualDigest   Digest\n}\n\n// Error implements the error interface.\nfunc (m *DigestMismatchError) Error() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t_, _ = builder.WriteString(`*** Digest verification failed`)\n\tif m.FullName != nil {\n\t\t_, _ = builder.WriteString(` for \"`)\n\t\t_, _ = builder.WriteString(m.FullName.String())\n\t\tif m.CommitID != uuid.Nil {\n\t\t\t_, _ = builder.WriteString(`:`)\n\t\t\t_, _ = builder.WriteString(uuidutil.ToDashless(m.CommitID))\n\t\t}\n\t\t_, _ = builder.WriteString(`\"`)\n\t}\n\t_, _ = builder.WriteString(` ***`)\n\t_, _ = builder.WriteString(\"\\n\")\n\tif m.ExpectedDigest != nil && m.ActualDigest != nil {\n\t\t_, _ = builder.WriteString(\"\\t\")\n\t\t_, _ = builder.WriteString(`Expected digest (from buf.lock): \"`)\n\t\t_, _ = builder.WriteString(m.ExpectedDigest.String())\n\t\t_, _ = builder.WriteString(`\"`)\n\t\t_, _ = builder.WriteString(\"\\n\")\n\t\t_, _ = builder.WriteString(\"\\t\")\n\t\t_, _ = builder.WriteString(`Actual digest: \"`)\n\t\t_, _ = builder.WriteString(m.ActualDigest.String())\n\t\t_, _ = builder.WriteString(`\"`)\n\t\t_, _ = builder.WriteString(\"\\n\")\n\t}\n\t_, _ = builder.WriteString(\"\\t\")\n\t_, _ = builder.WriteString(`This may be the result of a hand-edited or corrupted buf.lock file, a corrupted local cache, and/or an attack.`)\n\t_, _ = builder.WriteString(\"\\n\")\n\t_, _ = builder.WriteString(\"\\t\")\n\t_, _ = builder.WriteString(`To clear your local cache, run \"buf registry cc\".`)\n\treturn builder.String()\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/plugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\n// Plugin presents a BSR plugin.\ntype Plugin interface {\n\t// OpaqueID returns an unstructured ID that can uniquely identify a Plugin\n\t// relative to the Workspace.\n\t//\n\t// An OpaqueID's structure should not be relied upon, and is not a\n\t// globally-unique identifier. It's uniqueness property only applies to\n\t// the lifetime of the Plugin, and only within the Workspace the Plugin\n\t// is defined in.\n\t//\n\t// If two Plugins have the same Name and Args, they will have the same OpaqueID.\n\tOpaqueID() string\n\t// Name returns the name of the Plugin.\n\t//  - For local Plugins, this is the path to the executable binary.\n\t//  - For local Wasm Plugins, this is the path to the Wasm binary.\n\t//  - For remote Plugins, this is the FullName of the Plugin in the form\n\t//    remote/owner/name.\n\t//\n\t// This is never empty.\n\tName() string\n\t// Args returns the arguments to invoke the Plugin.\n\t//\n\t// May be nil.\n\tArgs() []string\n\t// FullName returns the full name of the Plugin.\n\t//\n\t// May be nil. Callers should not rely on this value being present.\n\t// However, this is always present for remote Plugins.\n\t//\n\t// Use OpaqueID as an always-present identifier.\n\tFullName() bufparse.FullName\n\t// CommitID returns the BSR ID of the Commit.\n\t//\n\t// It is up to the caller to convert this to a dashless ID when necessary.\n\t//\n\t// May be empty, that is CommitID() == uuid.Nil may be true.\n\t// Callers should not rely on this value being present.\n\t//\n\t// If FullName is nil, this will always be empty.\n\tCommitID() uuid.UUID\n\t// Description returns a human-readable description of the Plugin.\n\t//\n\t// This is used to construct descriptive error messages pointing to configured plugins.\n\t//\n\t// This will never be empty. If a description was not explicitly set, this falls back to\n\t// OpaqueID.\n\tDescription() string\n\t// Digest returns the Plugin digest for the given DigestType.\n\t//\n\t// Note this is *not* a cas.Digest - this is a Digest.\n\t// cas.Digests are a lower-level type that just deal in terms of\n\t// files and content. A Digest is a specific algorithm applied to the\n\t// content of a Plugin.\n\t//\n\t// Will return an error if the Plugin is not a Wasm Plugin.\n\tDigest(DigestType) (Digest, error)\n\t// Data returns the bytes of the Plugin as a Wasm module.\n\t//\n\t// This is the raw bytes of the Wasm module in an uncompressed form.\n\t//\n\t// Will return an error if the Plugin is not a Wasm Plugin.\n\tData() ([]byte, error)\n\t// IsWasm returns true if the Plugin is a Wasm Plugin.\n\t//\n\t// Plugins are either Wasm or local.\n\t//\n\t// A Wasm Plugin is a Plugin that is a Wasm module. Wasm Plugins are invoked\n\t// with the wasm.Runtime. The Plugin will have Data and will be able to\n\t// calculate Digests.\n\t//\n\t// Wasm Plugins will always have Data.\n\tIsWasm() bool\n\t// IsLocal returns true if the Plugin is a local Plugin.\n\t//\n\t// Plugins are either local or remote.\n\t//\n\t// A local Plugin is one that is built from sources from the \"local context\",\n\t// such as a Workspace. Local Plugins are important for understanding what Plugins\n\t// to push.\n\t//\n\t// Remote Plugins will always have FullNames.\n\tIsLocal() bool\n\n\tisPlugin()\n}\n\n// NewLocalPlugin returns a new Plugin for a local plugin.\n//\n// The name is the path to the executable binary.\n// The args are the arguments to invoke the Plugin. These are passed to the Plugin\n// as command line arguments.\nfunc NewLocalPlugin(\n\tname string,\n\targs []string,\n) (Plugin, error) {\n\treturn newPlugin(\n\t\t\"\", // description\n\t\tnil,\n\t\tname,\n\t\targs,\n\t\tuuid.Nil, // commitID\n\t\tfalse,    // isWasm\n\t\ttrue,     // isLocal\n\t\tnil,      // getData\n\t)\n}\n\n// NewLocalWasmPlugin returns a new Plugin for a local Wasm plugin.\n//\n// The pluginFullName may be nil.\n// The name is the path to the Wasm plugin and must end with .wasm.\n// The args are the arguments to the Wasm plugin. These are passed to the Wasm plugin\n// as command line arguments.\n// The getData function is called to get the bytes of the Wasm plugin.\n// This is the raw bytes of the Wasm module in an uncompressed form.\nfunc NewLocalWasmPlugin(\n\tpluginFullName bufparse.FullName,\n\tname string,\n\targs []string,\n\tgetData func() ([]byte, error),\n) (Plugin, error) {\n\treturn newPlugin(\n\t\t\"\", // description\n\t\tpluginFullName,\n\t\tname,\n\t\targs,\n\t\tuuid.Nil, // commitID\n\t\ttrue,     // isWasm\n\t\ttrue,     // isLocal\n\t\tgetData,\n\t)\n}\n\n// NewRemoteWasmPlugin returns a new Plugin for a remote Wasm plugin.\n//\n// The pluginFullName is the remote reference to the plugin.\n// The args are the arguments to the remote plugin. These are passed to the remote plugin\n// as command line arguments.\n// The commitID is the BSR ID of the Commit.\n// It is up to the caller to convert this to a dashless ID when necessary.\n// The getData function is called to get the bytes of the Wasm plugin.\n// This is the raw bytes of the Wasm module in an uncompressed form.\nfunc NewRemoteWasmPlugin(\n\tpluginFullName bufparse.FullName,\n\targs []string,\n\tcommitID uuid.UUID,\n\tgetData func() ([]byte, error),\n) (Plugin, error) {\n\treturn newPlugin(\n\t\t\"\", // description\n\t\tpluginFullName,\n\t\tpluginFullName.String(),\n\t\targs,\n\t\tcommitID,\n\t\ttrue,  // isWasm\n\t\tfalse, // isLocal\n\t\tgetData,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype plugin struct {\n\tdescription    string\n\tpluginFullName bufparse.FullName\n\tname           string\n\targs           []string\n\tcommitID       uuid.UUID\n\tisWasm         bool\n\tisLocal        bool\n\tgetData        func() ([]byte, error)\n\n\tdigestTypeToGetDigest map[DigestType]func() (Digest, error)\n}\n\nfunc newPlugin(\n\tdescription string,\n\tpluginFullName bufparse.FullName,\n\tname string,\n\targs []string,\n\tcommitID uuid.UUID,\n\tisWasm bool,\n\tisLocal bool,\n\tgetData func() ([]byte, error),\n) (*plugin, error) {\n\tif name == \"\" {\n\t\treturn nil, syserror.New(\"name not present when constructing a Plugin\")\n\t}\n\tif isWasm && getData == nil {\n\t\treturn nil, syserror.Newf(\"getData not present when constructing a Wasm Plugin\")\n\t}\n\tif !isLocal && pluginFullName == nil {\n\t\treturn nil, syserror.New(\"pluginFullName not present when constructing a remote Plugin\")\n\t}\n\tif !isLocal && !isWasm {\n\t\treturn nil, syserror.New(\"remote non-Wasm Plugins are not supported\")\n\t}\n\tif isLocal && commitID != uuid.Nil {\n\t\treturn nil, syserror.New(\"commitID present when constructing a local Plugin\")\n\t}\n\tif pluginFullName == nil && commitID != uuid.Nil {\n\t\treturn nil, syserror.New(\"pluginFullName not present and commitID present when constructing a remote Plugin\")\n\t}\n\tplugin := &plugin{\n\t\tdescription:    description,\n\t\tpluginFullName: pluginFullName,\n\t\tname:           name,\n\t\targs:           args,\n\t\tcommitID:       commitID,\n\t\tisWasm:         isWasm,\n\t\tisLocal:        isLocal,\n\t\tgetData:        sync.OnceValues(getData),\n\t}\n\tplugin.digestTypeToGetDigest = newSyncOnceValueDigestTypeToGetDigestFuncForPlugin(plugin)\n\treturn plugin, nil\n}\n\nfunc (p *plugin) OpaqueID() string {\n\treturn strings.Join(append([]string{p.name}, p.args...), \" \")\n}\n\nfunc (p *plugin) Name() string {\n\treturn p.name\n}\n\nfunc (p *plugin) Args() []string {\n\treturn p.args\n}\n\nfunc (p *plugin) FullName() bufparse.FullName {\n\treturn p.pluginFullName\n}\n\nfunc (p *plugin) CommitID() uuid.UUID {\n\treturn p.commitID\n}\n\nfunc (p *plugin) Description() string {\n\tif p.description != \"\" {\n\t\treturn p.description\n\t}\n\treturn p.OpaqueID()\n}\n\nfunc (p *plugin) Data() ([]byte, error) {\n\tif !p.isWasm {\n\t\treturn nil, fmt.Errorf(\"Plugin is not a Wasm Plugin\")\n\t}\n\treturn p.getData()\n}\n\nfunc (p *plugin) Digest(digestType DigestType) (Digest, error) {\n\tgetDigest, ok := p.digestTypeToGetDigest[digestType]\n\tif !ok {\n\t\treturn nil, syserror.Newf(\"DigestType %v was not in plugin.digestTypeToGetDigest\", digestType)\n\t}\n\treturn getDigest()\n}\n\nfunc (p *plugin) IsWasm() bool {\n\treturn p.isWasm\n}\n\nfunc (p *plugin) IsLocal() bool {\n\treturn p.isLocal\n}\n\nfunc (p *plugin) isPlugin() {}\n\nfunc newSyncOnceValueDigestTypeToGetDigestFuncForPlugin(plugin *plugin) map[DigestType]func() (Digest, error) {\n\tm := make(map[DigestType]func() (Digest, error))\n\tfor digestType := range digestTypeToString {\n\t\tm[digestType] = sync.OnceValues(newGetDigestFuncForPluginAndDigestType(plugin, digestType))\n\t}\n\treturn m\n}\n\nfunc newGetDigestFuncForPluginAndDigestType(plugin *plugin, digestType DigestType) func() (Digest, error) {\n\treturn func() (Digest, error) {\n\t\tdata, err := plugin.getData()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcasDigest, err := cas.NewDigestForContent(bytes.NewReader(data))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn NewDigest(digestType, casDigest)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/plugin_data.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n)\n\n// PluginData presents the raw Plugin data read by PluginKey.\n//\n// A PluginData generally represents the data on a Plugin read from the BSR API\n// or a cache.\n//\n// Tamper-proofing is done as part of every function.\ntype PluginData interface {\n\t// PluginKey used to download this PluginData.\n\t//\n\t// The Digest from this PluginKey is used for tamper-proofing. It will be checked\n\t// against the actual data downloaded before Data() returns.\n\tPluginKey() PluginKey\n\t// Data returns the bytes of the Plugin as a Wasm module.\n\t//\n\t// This is the raw bytes of the Wasm module in an uncompressed form.\n\tData() ([]byte, error)\n\n\tisPluginData()\n}\n\n// NewPluginData returns a new PluginData.\n//\n// getData is expected to be lazily-loaded function where possible.\nfunc NewPluginData(\n\tctx context.Context,\n\tpluginKey PluginKey,\n\tgetData func() ([]byte, error),\n) (PluginData, error) {\n\treturn newPluginData(\n\t\tctx,\n\t\tpluginKey,\n\t\tgetData,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype pluginData struct {\n\tpluginKey PluginKey\n\tgetData   func() ([]byte, error)\n\n\tcheckDigest func() error\n}\n\nfunc newPluginData(\n\tctx context.Context,\n\tpluginKey PluginKey,\n\tgetData func() ([]byte, error),\n) (*pluginData, error) {\n\tpluginData := &pluginData{\n\t\tpluginKey: pluginKey,\n\t\tgetData:   getData,\n\t}\n\tpluginData.checkDigest = sync.OnceValue(func() error {\n\t\tpluginData, err := pluginData.getData()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tcasDigest, err := cas.NewDigestForContent(\n\t\t\tbytes.NewReader(pluginData),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tactualDigest, err := NewDigest(DigestTypeP1, casDigest)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texpectedDigest, err := pluginKey.Digest()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !DigestEqual(actualDigest, expectedDigest) {\n\t\t\treturn &DigestMismatchError{\n\t\t\t\tFullName:       pluginKey.FullName(),\n\t\t\t\tCommitID:       pluginKey.CommitID(),\n\t\t\t\tExpectedDigest: expectedDigest,\n\t\t\t\tActualDigest:   actualDigest,\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\treturn pluginData, nil\n}\n\nfunc (p *pluginData) PluginKey() PluginKey {\n\treturn p.pluginKey\n}\n\nfunc (p *pluginData) Data() ([]byte, error) {\n\tif err := p.checkDigest(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn p.getData()\n}\n\nfunc (*pluginData) isPluginData() {}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/plugin_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n)\n\nvar (\n\t// NopPluginDataProvider is a no-op PluginDataProvider.\n\tNopPluginDataProvider PluginDataProvider = nopPluginDataProvider{}\n)\n\n// PluginDataProvider provides PluginDatas.\ntype PluginDataProvider interface {\n\t// GetPluginDatasForPluginKeys gets the PluginDatas for the PluginKeys.\n\t//\n\t// Returned PluginDatas will be in the same order as the input PluginKeys.\n\t//\n\t// The input PluginKeys are expected to be unique by FullName. The implementation\n\t// may error if this is not the case.\n\t//\n\t// The input PluginKeys are expected to have the same DigestType. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the PluginDatas returned will match the length of the PluginKeys.\n\t// If there is an error, no PluginDatas will be returned.\n\t// If any PluginKey is not found, an error with fs.ErrNotExist will be returned.\n\tGetPluginDatasForPluginKeys(\n\t\tcontext.Context,\n\t\t[]PluginKey,\n\t) ([]PluginData, error)\n}\n\n// *** PRIVATE ***\n\ntype nopPluginDataProvider struct{}\n\nfunc (nopPluginDataProvider) GetPluginDatasForPluginKeys(\n\tcontext.Context,\n\t[]PluginKey,\n) ([]PluginData, error) {\n\treturn nil, fs.ErrNotExist\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/plugin_key.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// PluginKey provides identifying information for a Plugin.\n//\n// PluginKeys are returned from PluginKeyProviders, and represent a Plugin's complete\n// identity. They also match to what we store in buf.lock files. PluginKeys can be used\n// to get Plugins via a PluginProvider.\ntype PluginKey interface {\n\t// String returns \"registry/owner/name:dashlessCommitID\".\n\tfmt.Stringer\n\n\t// FullName returns the full name of the Plugin.\n\t//\n\t// Always present.\n\tFullName() bufparse.FullName\n\t// CommitID returns the ID of the Commit.\n\t//\n\t// It is up to the caller to convert this to a dashless ID when necessary.\n\t//\n\t// Always present, that is CommitID() == uuid.Nil will always be false.\n\tCommitID() uuid.UUID\n\t// Digest returns the Plugin digest.\n\t//\n\t// Note this is *not* a cas.Digest - this is a Digest.\n\t// cas.Digests are a lower-level type that just deal in terms of\n\t// files and content. A PluginDigest is a specific algorithm applied to\n\t// the Plugin data.\n\tDigest() (Digest, error)\n\n\tisPluginKey()\n}\n\n// NewPluginKey returns a new PluginKey.\n//\n// The Digest will be loaded lazily if needed. Note this means that NewPluginKey does\n// *not* validate the digest. If you need to validate the digest, call Digest() and evaluate\n// the returned error.\nfunc NewPluginKey(\n\tpluginFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tgetDigest func() (Digest, error),\n) (PluginKey, error) {\n\treturn newPluginKey(\n\t\tpluginFullName,\n\t\tcommitID,\n\t\tgetDigest,\n\t)\n}\n\n// UniqueDigestTypeForPluginKeys returns the unique DigestType for the given PluginKeys.\n//\n// If the PluginKeys have different DigestTypes, an error is returned.\n// If the PluginKeys slice is empty, an error is returned.\nfunc UniqueDigestTypeForPluginKeys(pluginKeys []PluginKey) (DigestType, error) {\n\tif len(pluginKeys) == 0 {\n\t\treturn 0, syserror.New(\"empty pluginKeys passed to UniqueDigestTypeForPluginKeys\")\n\t}\n\tdigests, err := xslices.MapError(pluginKeys, PluginKey.Digest)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdigestType := digests[0].Type()\n\tfor _, digest := range digests[1:] {\n\t\tif digestType != digest.Type() {\n\t\t\treturn 0, fmt.Errorf(\n\t\t\t\t\"different digest types detected where the same digest type must be used: %v, %v\\n%s\",\n\t\t\t\tdigestType,\n\t\t\t\tdigest.Type(),\n\t\t\t\tstrings.Join(xslices.Map(pluginKeys, PluginKey.String), \"\\n\"),\n\t\t\t)\n\t\t}\n\t}\n\treturn digestType, nil\n}\n\n// ** PRIVATE **\n\ntype pluginKey struct {\n\tpluginFullName bufparse.FullName\n\tcommitID       uuid.UUID\n\n\tgetDigest func() (Digest, error)\n}\n\nfunc newPluginKey(\n\tpluginFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tgetDigest func() (Digest, error),\n) (*pluginKey, error) {\n\tif pluginFullName == nil {\n\t\treturn nil, errors.New(\"nil FullName when constructing PluginKey\")\n\t}\n\tif commitID == uuid.Nil {\n\t\treturn nil, errors.New(\"empty commitID when constructing PluginKey\")\n\t}\n\treturn &pluginKey{\n\t\tpluginFullName: pluginFullName,\n\t\tcommitID:       commitID,\n\t\tgetDigest:      sync.OnceValues(getDigest),\n\t}, nil\n}\n\nfunc (p *pluginKey) FullName() bufparse.FullName {\n\treturn p.pluginFullName\n}\n\nfunc (p *pluginKey) CommitID() uuid.UUID {\n\treturn p.commitID\n}\n\nfunc (p *pluginKey) Digest() (Digest, error) {\n\treturn p.getDigest()\n}\n\nfunc (p *pluginKey) String() string {\n\treturn p.pluginFullName.String() + \":\" + uuidutil.ToDashless(p.commitID)\n}\n\nfunc (*pluginKey) isPluginKey() {}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/plugin_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n)\n\nvar (\n\t// NopPluginKeyProvider is a no-op PluginKeyProvider.\n\tNopPluginKeyProvider PluginKeyProvider = nopPluginKeyProvider{}\n)\n\n// PluginKeyProvider provides PluginKeys for bufparse.Refs.\ntype PluginKeyProvider interface {\n\t// GetPluginKeysForPluginRefs gets the PluginKeys for the given PluginRefs.\n\t//\n\t// Returned PluginKeys will be in the same order as the input PluginRefs.\n\t//\n\t// The input PluginRefs are expected to be unique by FullName. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the PluginKeys returned will match the length of the Refs.\n\t// If there is an error, no PluginKeys will be returned.\n\t// If any PluginRef is not found, an error with fs.ErrNotExist will be returned.\n\tGetPluginKeysForPluginRefs(context.Context, []bufparse.Ref, DigestType) ([]PluginKey, error)\n}\n\n// NewStaticPluginKeyProvider returns a new PluginKeyProvider for a static set of PluginKeys.\n//\n// The set of PluginKeys must be unique by FullName. If there are duplicates,\n// an error will be returned.\n//\n// When resolving Refs, the Ref will be matched to the PluginKey by FullName.\n// If the Ref is not found in the set of provided keys, an fs.ErrNotExist will be returned.\nfunc NewStaticPluginKeyProvider(pluginKeys []PluginKey) (PluginKeyProvider, error) {\n\treturn newStaticPluginKeyProvider(pluginKeys)\n}\n\n// *** PRIVATE ***\n\ntype nopPluginKeyProvider struct{}\n\nfunc (nopPluginKeyProvider) GetPluginKeysForPluginRefs(\n\tcontext.Context,\n\t[]bufparse.Ref,\n\tDigestType,\n) ([]PluginKey, error) {\n\treturn nil, fs.ErrNotExist\n}\n\ntype staticPluginKeyProvider struct {\n\tpluginKeysByFullName map[string]PluginKey\n}\n\nfunc newStaticPluginKeyProvider(pluginKeys []PluginKey) (*staticPluginKeyProvider, error) {\n\tvar pluginKeysByFullName map[string]PluginKey\n\tif len(pluginKeys) > 0 {\n\t\tvar err error\n\t\tpluginKeysByFullName, err = xslices.ToUniqueValuesMap(pluginKeys, func(pluginKey PluginKey) string {\n\t\t\treturn pluginKey.FullName().String()\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &staticPluginKeyProvider{\n\t\tpluginKeysByFullName: pluginKeysByFullName,\n\t}, nil\n}\n\nfunc (s staticPluginKeyProvider) GetPluginKeysForPluginRefs(\n\t_ context.Context,\n\trefs []bufparse.Ref,\n\tdigestType DigestType,\n) ([]PluginKey, error) {\n\tpluginKeys := make([]PluginKey, len(refs))\n\tfor i, ref := range refs {\n\t\t// Only the FullName is used to match the PluginKey. The Ref is not\n\t\t// validated to match the PluginKey as there is not enough information\n\t\t// to do so.\n\t\tpluginKey, ok := s.pluginKeysByFullName[ref.FullName().String()]\n\t\tif !ok {\n\t\t\treturn nil, fs.ErrNotExist\n\t\t}\n\t\tdigest, err := pluginKey.Digest()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif digest.Type() != digestType {\n\t\t\treturn nil, fmt.Errorf(\"expected DigestType %v, got %v\", digestType, digest.Type())\n\t\t}\n\t\tpluginKeys[i] = pluginKey\n\t}\n\treturn pluginKeys, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/plugin_type.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\t// PluginTypeCheck says the Plugin is a check plugin.\n\tPluginTypeCheck = iota + 1\n)\n\nvar (\n\t// AllPluginTypeStrings is all format strings without aliases.\n\t//\n\t// Sorted in the order we want to display them.\n\tAllPluginTypeStrings = []string{\n\t\t\"check\",\n\t}\n)\n\n// PluginType is the type of a Plugin.\ntype PluginType int\n\n// ParsePluginType parses the PluginType from the string.\nfunc ParsePluginType(s string) (PluginType, error) {\n\tswitch s {\n\tcase \"check\":\n\t\treturn PluginVisibilityPublic, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown PluginType: %q\", s)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/plugin_visibility.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\t// PluginVisibilityPublic says the Plugin is public on the registry.\n\tPluginVisibilityPublic = iota + 1\n\t// PluginVisibilityPrivate says the Plugin is private on the registry.\n\tPluginVisibilityPrivate\n)\n\n// PluginVisibility is the visibility of a Plugin on a registry.\n//\n// Only used for Upload for now.\ntype PluginVisibility int\n\n// ParsePluginVisibility parses the PluginVisibility from the string.\nfunc ParsePluginVisibility(s string) (PluginVisibility, error) {\n\tswitch s {\n\tcase \"public\":\n\t\treturn PluginVisibilityPublic, nil\n\tcase \"private\":\n\t\treturn PluginVisibilityPrivate, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown PluginVisibility: %q\", s)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/uploader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufplugin\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"buf.build/go/standard/xslices\"\n)\n\nvar (\n\t// NopUploader is a no-op Uploader.\n\tNopUploader Uploader = nopUploader{}\n)\n\n// Uploader uploads Plugins.\ntype Uploader interface {\n\t// Upload uploads the given Plugins.\n\tUpload(ctx context.Context, plugins []Plugin, options ...UploadOption) ([]Commit, error)\n}\n\n// UploadOption is an option for an Upload.\ntype UploadOption func(*uploadOptions)\n\n// UploadWithLabels returns a new UploadOption that adds the given labels.\n//\n// This can be called multiple times. The unique result set of labels will be used.\nfunc UploadWithLabels(labels ...string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.labels = append(uploadOptions.labels, labels...)\n\t}\n}\n\n// UploadWithCreateIfNotExist returns a new UploadOption that will result in the\n// Plugins being created on the registry with the given visibility if they do not exist.\nfunc UploadWithCreateIfNotExist(createPluginVisibility PluginVisibility, createPluginType PluginType) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.createIfNotExist = true\n\t\tuploadOptions.createPluginVisibility = createPluginVisibility\n\t\tuploadOptions.createPluginType = createPluginType\n\t}\n}\n\n// UploadWithSourceControlURL returns a new UploadOption that will set the source control\n// url for the plugin contents uploaded.\nfunc UploadWithSourceControlURL(sourceControlURL string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.sourceControlURL = sourceControlURL\n\t}\n}\n\n// UploadOptions are the possible options for upload.\n//\n// This is used by Uploader implementations.\ntype UploadOptions interface {\n\t// Labels returns the unique and sorted set of labels to add. Labels\n\t// are set using the `--label` flag when calling `buf plugin upload`\n\t// and represent the labels that are set when uploading plugin data.\n\tLabels() []string\n\t// CreateIfNotExist says to create Plugins if they do not exist on the registry.\n\tCreateIfNotExist() bool\n\t// CreatePluginVisibility returns the visibility to create Plugins with.\n\t//\n\t// Will always be present if CreateIfNotExist() is true.\n\tCreatePluginVisibility() PluginVisibility\n\t// CreatePluginType returns the type to create Plugins with.\n\t//\n\t// Will always be present if CreateIfNotExist() is true.\n\tCreatePluginType() PluginType\n\t// SourceControlURL returns the source control URL set by the user for the plugin\n\t// contents uploaded. We set the same source control URL for all plugin contents.\n\tSourceControlURL() string\n\n\tisUploadOptions()\n}\n\n// NewUploadOptions returns a new UploadOptions.\nfunc NewUploadOptions(options []UploadOption) (UploadOptions, error) {\n\tuploadOptions := newUploadOptions()\n\tfor _, option := range options {\n\t\toption(uploadOptions)\n\t}\n\tif err := uploadOptions.validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn uploadOptions, nil\n}\n\n// *** PRIVATE ***\n\ntype nopUploader struct{}\n\nfunc (nopUploader) Upload(context.Context, []Plugin, ...UploadOption) ([]Commit, error) {\n\treturn nil, errors.New(\"unimplemented: no-op Uploader called\")\n}\n\ntype uploadOptions struct {\n\tlabels                 []string\n\tcreateIfNotExist       bool\n\tcreatePluginVisibility PluginVisibility\n\tcreatePluginType       PluginType\n\tsourceControlURL       string\n}\n\nfunc newUploadOptions() *uploadOptions {\n\treturn &uploadOptions{}\n}\n\nfunc (u *uploadOptions) Labels() []string {\n\treturn xslices.ToUniqueSorted(u.labels)\n}\n\nfunc (u *uploadOptions) CreateIfNotExist() bool {\n\treturn u.createIfNotExist\n}\n\nfunc (u *uploadOptions) CreatePluginVisibility() PluginVisibility {\n\treturn u.createPluginVisibility\n}\n\nfunc (u *uploadOptions) CreatePluginType() PluginType {\n\treturn u.createPluginType\n}\n\nfunc (u *uploadOptions) SourceControlURL() string {\n\treturn u.sourceControlURL\n}\n\nfunc (u *uploadOptions) isUploadOptions() {}\n\nfunc (u *uploadOptions) validate() error {\n\tif u.createIfNotExist && u.createPluginVisibility == 0 {\n\t\treturn errors.New(\"must set a valid PluginVisibility if CreateIfNotExist was specified\")\n\t}\n\tif u.sourceControlURL != \"\" {\n\t\tif _, err := url.Parse(u.sourceControlURL); err != nil {\n\t\t\treturn fmt.Errorf(\"must set a valid url for the source control url: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufplugin/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufplugin\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicy.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyapi/bufpolicyapi.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyapi\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyapi/convert.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyapi\n\nimport (\n\t\"fmt\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n)\n\nvar (\n\tv1beta1ProtoDigestTypeToDigestType = map[policyv1beta1.DigestType]bufpolicy.DigestType{\n\t\tpolicyv1beta1.DigestType_DIGEST_TYPE_O1: bufpolicy.DigestTypeO1,\n\t}\n)\n\n// V1Beta1ProtoToDigest converts the given proto Digest to a Digest.\n//\n// Validation is performed to ensure the DigestType is known, and the value\n// is a valid digest value for the given DigestType.\nfunc V1Beta1ProtoToDigest(protoDigest *policyv1beta1.Digest) (bufpolicy.Digest, error) {\n\tdigestType, err := v1beta1ProtoToDigestType(protoDigest.Type)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcasDigest, err := cas.NewDigest(protoDigest.Value)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufpolicy.NewDigest(digestType, casDigest)\n}\n\n// V1Beta1ProtoToPolicyConfig converts the given proto PolicyConfig to a PolicyConfig.\n// The registry is used to resolve plugin references.\nfunc V1Beta1ProtoToPolicyConfig(registry string, policyConfigV1Beta1 *policyv1beta1.PolicyConfig) (bufpolicy.PolicyConfig, error) {\n\tlintConfig, err := getLintConfigForV1Beta1LintConfig(policyConfigV1Beta1.GetLint())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbreakingConfig, err := getBreakingConfigForV1Beta1BreakingConfig(policyConfigV1Beta1.GetBreaking())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginConfigs, err := xslices.MapError(\n\t\tpolicyConfigV1Beta1.GetPlugins(),\n\t\tfunc(pluginConfigV1Beta1 *policyv1beta1.PolicyConfig_CheckPluginConfig) (bufpolicy.PluginConfig, error) {\n\t\t\treturn getPluginConfigForV1Beta1PluginConfig(registry, pluginConfigV1Beta1)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufpolicy.NewPolicyConfig(\n\t\tlintConfig,\n\t\tbreakingConfig,\n\t\tpluginConfigs,\n\t)\n}\n\n// PolicyConfigToV1Beta1Proto converts the given PolicyConfig to a proto PolicyConfig.\nfunc PolicyConfigToV1Beta1Proto(policyConfig bufpolicy.PolicyConfig) (*policyv1beta1.PolicyConfig, error) {\n\tpluginConfigs, err := xslices.MapError(\n\t\tpolicyConfig.PluginConfigs(),\n\t\tfunc(pluginConfig bufpolicy.PluginConfig) (*policyv1beta1.PolicyConfig_CheckPluginConfig, error) {\n\t\t\tpluginRef := pluginConfig.Ref()\n\t\t\tif pluginRef == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"plugin config %q has no reference\", pluginConfig.Name())\n\t\t\t}\n\t\t\tpluginOptions, err := pluginConfig.Options().ToProto()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn &policyv1beta1.PolicyConfig_CheckPluginConfig{\n\t\t\t\tName: &policyv1beta1.PolicyConfig_CheckPluginConfig_Name{\n\t\t\t\t\tOwner:  pluginRef.FullName().Owner(),\n\t\t\t\t\tPlugin: pluginRef.FullName().Name(),\n\t\t\t\t\tRef:    pluginRef.Ref(),\n\t\t\t\t},\n\t\t\t\tOptions: pluginOptions,\n\t\t\t\tArgs:    pluginConfig.Args(),\n\t\t\t}, nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &policyv1beta1.PolicyConfig{\n\t\tLint: &policyv1beta1.PolicyConfig_LintConfig{\n\t\t\tUse:                                  policyConfig.LintConfig().UseIDsAndCategories(),\n\t\t\tExcept:                               policyConfig.LintConfig().ExceptIDsAndCategories(),\n\t\t\tEnumZeroValueSuffix:                  policyConfig.LintConfig().EnumZeroValueSuffix(),\n\t\t\tRpcAllowSameRequestResponse:          policyConfig.LintConfig().RPCAllowSameRequestResponse(),\n\t\t\tRpcAllowGoogleProtobufEmptyRequests:  policyConfig.LintConfig().RPCAllowGoogleProtobufEmptyRequests(),\n\t\t\tRpcAllowGoogleProtobufEmptyResponses: policyConfig.LintConfig().RPCAllowGoogleProtobufEmptyResponses(),\n\t\t\tServiceSuffix:                        policyConfig.LintConfig().ServiceSuffix(),\n\t\t},\n\t\tBreaking: &policyv1beta1.PolicyConfig_BreakingConfig{\n\t\t\tUse:                    policyConfig.BreakingConfig().UseIDsAndCategories(),\n\t\t\tExcept:                 policyConfig.BreakingConfig().ExceptIDsAndCategories(),\n\t\t\tIgnoreUnstablePackages: policyConfig.BreakingConfig().IgnoreUnstablePackages(),\n\t\t},\n\t\tPlugins: pluginConfigs,\n\t}, nil\n}\n\n// *** PRIVATE ***\n\nfunc policyVisibilityToV1Beta1Proto(policyVisibility bufpolicy.PolicyVisibility) (policyv1beta1.PolicyVisibility, error) {\n\tswitch policyVisibility {\n\tcase bufpolicy.PolicyVisibilityPublic:\n\t\treturn policyv1beta1.PolicyVisibility_POLICY_VISIBILITY_PUBLIC, nil\n\tcase bufpolicy.PolicyVisibilityPrivate:\n\t\treturn policyv1beta1.PolicyVisibility_POLICY_VISIBILITY_PRIVATE, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown PolicyVisibility: %v\", policyVisibility)\n\t}\n}\n\nfunc v1beta1ProtoToDigestType(protoDigestType policyv1beta1.DigestType) (bufpolicy.DigestType, error) {\n\tdigestType, ok := v1beta1ProtoDigestTypeToDigestType[protoDigestType]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown policyv1beta1.DigestType: %v\", protoDigestType)\n\t}\n\treturn digestType, nil\n}\n\nfunc getLintConfigForV1Beta1LintConfig(\n\tlintConfigV1Beta1 *policyv1beta1.PolicyConfig_LintConfig,\n) (bufpolicy.LintConfig, error) {\n\treturn bufpolicy.NewLintConfig(\n\t\tlintConfigV1Beta1.GetUse(),\n\t\tlintConfigV1Beta1.GetExcept(),\n\t\tlintConfigV1Beta1.GetEnumZeroValueSuffix(),\n\t\tlintConfigV1Beta1.GetRpcAllowSameRequestResponse(),\n\t\tlintConfigV1Beta1.GetRpcAllowGoogleProtobufEmptyRequests(),\n\t\tlintConfigV1Beta1.GetRpcAllowGoogleProtobufEmptyResponses(),\n\t\tlintConfigV1Beta1.GetServiceSuffix(),\n\t\tlintConfigV1Beta1.GetDisableBuiltin(),\n\t)\n}\n\nfunc getBreakingConfigForV1Beta1BreakingConfig(\n\tbreakingConfigV1Beta1 *policyv1beta1.PolicyConfig_BreakingConfig,\n) (bufpolicy.BreakingConfig, error) {\n\treturn bufpolicy.NewBreakingConfig(\n\t\tbreakingConfigV1Beta1.GetUse(),\n\t\tbreakingConfigV1Beta1.GetExcept(),\n\t\tbreakingConfigV1Beta1.GetIgnoreUnstablePackages(),\n\t\tbreakingConfigV1Beta1.GetDisableBuiltin(),\n\t)\n}\n\nfunc getPluginConfigForV1Beta1PluginConfig(\n\tregistry string,\n\tpluginConfigV1Beta1 *policyv1beta1.PolicyConfig_CheckPluginConfig,\n) (bufpolicy.PluginConfig, error) {\n\tnameV1Beta1 := pluginConfigV1Beta1.GetName()\n\tpluginRef, err := bufparse.NewRef(\n\t\tregistry,\n\t\tnameV1Beta1.GetOwner(),\n\t\tnameV1Beta1.GetPlugin(),\n\t\tnameV1Beta1.GetRef(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginOptions, err := option.OptionsForProtoOptions(pluginConfigV1Beta1.GetOptions())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufpolicy.NewPluginConfig(\n\t\tnameV1Beta1.String(),\n\t\tpluginRef,\n\t\tpluginOptions,\n\t\tpluginConfigV1Beta1.GetArgs(),\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyapi/policy_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyapi\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// NewPolicyDataProvider returns a new PolicyDataProvider for the given API client.\n//\n// A warning is printed to the logger if a given Policy is deprecated.\nfunc NewPolicyDataProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1DownloadServiceClientProvider\n\t},\n) bufpolicy.PolicyDataProvider {\n\treturn newPolicyDataProvider(logger, clientProvider)\n}\n\n// *** PRIVATE ***\n\ntype policyDataProvider struct {\n\tlogger         *slog.Logger\n\tclientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1DownloadServiceClientProvider\n\t}\n}\n\nfunc newPolicyDataProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1DownloadServiceClientProvider\n\t},\n) *policyDataProvider {\n\treturn &policyDataProvider{\n\t\tlogger:         logger,\n\t\tclientProvider: clientProvider,\n\t}\n}\n\nfunc (p *policyDataProvider) GetPolicyDatasForPolicyKeys(\n\tctx context.Context,\n\tpolicyKeys []bufpolicy.PolicyKey,\n) ([]bufpolicy.PolicyData, error) {\n\tif len(policyKeys) == 0 {\n\t\treturn nil, nil\n\t}\n\tdigestType, err := bufpolicy.UniqueDigestTypeForPolicyKeys(policyKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif digestType != bufpolicy.DigestTypeO1 {\n\t\treturn nil, syserror.Newf(\"unsupported digest type: %v\", digestType)\n\t}\n\tif _, err := bufparse.FullNameStringToUniqueValue(policyKeys); err != nil {\n\t\treturn nil, err\n\t}\n\n\tregistryToIndexedPolicyKeys := xslices.ToIndexedValuesMap(\n\t\tpolicyKeys,\n\t\tfunc(policyKey bufpolicy.PolicyKey) string {\n\t\t\treturn policyKey.FullName().Registry()\n\t\t},\n\t)\n\tindexedPolicyDatas := make([]xslices.Indexed[bufpolicy.PolicyData], 0, len(policyKeys))\n\tfor registry, indexedPolicyKeys := range registryToIndexedPolicyKeys {\n\t\tindexedRegistryPolicyDatas, err := p.getIndexedPolicyDatasForRegistryAndIndexedPolicyKeys(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedPolicyKeys,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPolicyDatas = append(indexedPolicyDatas, indexedRegistryPolicyDatas...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedPolicyDatas), nil\n}\n\nfunc (p *policyDataProvider) getIndexedPolicyDatasForRegistryAndIndexedPolicyKeys(\n\tctx context.Context,\n\tregistry string,\n\tindexedPolicyKeys []xslices.Indexed[bufpolicy.PolicyKey],\n) ([]xslices.Indexed[bufpolicy.PolicyData], error) {\n\tvalues := xslices.Map(indexedPolicyKeys, func(indexedPolicyKey xslices.Indexed[bufpolicy.PolicyKey]) *policyv1beta1.DownloadRequest_Value {\n\t\treturn &policyv1beta1.DownloadRequest_Value{\n\t\t\tResourceRef: &policyv1beta1.ResourceRef{\n\t\t\t\tValue: &policyv1beta1.ResourceRef_Id{\n\t\t\t\t\tId: uuidutil.ToDashless(indexedPolicyKey.Value.CommitID()),\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t})\n\n\tpolicyResponse, err := p.clientProvider.V1Beta1DownloadServiceClient(registry).Download(\n\t\tctx,\n\t\tconnect.NewRequest(&policyv1beta1.DownloadRequest{\n\t\t\tValues: values,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyContents := policyResponse.Msg.Contents\n\tif len(policyContents) != len(indexedPolicyKeys) {\n\t\treturn nil, syserror.New(\"did not get the expected number of policy datas\")\n\t}\n\n\tcommitIDToIndexedPolicyKeys, err := xslices.ToUniqueValuesMapError(\n\t\tindexedPolicyKeys,\n\t\tfunc(indexedPolicyKey xslices.Indexed[bufpolicy.PolicyKey]) (uuid.UUID, error) {\n\t\t\treturn indexedPolicyKey.Value.CommitID(), nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tindexedPolicyDatas := make([]xslices.Indexed[bufpolicy.PolicyData], 0, len(indexedPolicyKeys))\n\tfor _, policyContent := range policyContents {\n\t\tcommitID, err := uuid.Parse(policyContent.Commit.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPolicyKey, ok := commitIDToIndexedPolicyKeys[commitID]\n\t\tif !ok {\n\t\t\treturn nil, syserror.Newf(\"did not get policy key from store with commitID %q\", commitID)\n\t\t}\n\t\tgetContent := func() (bufpolicy.PolicyConfig, error) {\n\t\t\treturn V1Beta1ProtoToPolicyConfig(registry, policyContent.GetConfig())\n\t\t}\n\t\tpolicyData, err := bufpolicy.NewPolicyData(ctx, indexedPolicyKey.Value, getContent)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPolicyDatas = append(\n\t\t\tindexedPolicyDatas,\n\t\t\txslices.Indexed[bufpolicy.PolicyData]{\n\t\t\t\tValue: policyData,\n\t\t\t\tIndex: indexedPolicyKey.Index,\n\t\t\t},\n\t\t)\n\t}\n\treturn indexedPolicyDatas, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyapi/policy_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyapi\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// NewPolicyKeyProvider returns a new PolicyKeyProvider for the given API clients.\nfunc NewPolicyKeyProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1CommitServiceClientProvider\n\t\tbufregistryapipolicy.V1Beta1PolicyServiceClientProvider\n\t},\n) bufpolicy.PolicyKeyProvider {\n\treturn newPolicyKeyProvider(logger, clientProvider)\n}\n\n// *** PRIVATE ***\n\ntype policyKeyProvider struct {\n\tlogger         *slog.Logger\n\tclientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1CommitServiceClientProvider\n\t\tbufregistryapipolicy.V1Beta1PolicyServiceClientProvider\n\t}\n}\n\nfunc newPolicyKeyProvider(\n\tlogger *slog.Logger,\n\tclientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1CommitServiceClientProvider\n\t\tbufregistryapipolicy.V1Beta1PolicyServiceClientProvider\n\t},\n) *policyKeyProvider {\n\treturn &policyKeyProvider{\n\t\tlogger:         logger,\n\t\tclientProvider: clientProvider,\n\t}\n}\n\nfunc (p *policyKeyProvider) GetPolicyKeysForPolicyRefs(\n\tctx context.Context,\n\tpolicyRefs []bufparse.Ref,\n\tdigestType bufpolicy.DigestType,\n) ([]bufpolicy.PolicyKey, error) {\n\tif len(policyRefs) == 0 {\n\t\treturn nil, nil\n\t}\n\t// Check unique policyRefs.\n\tif _, err := xslices.ToUniqueValuesMapError(\n\t\tpolicyRefs,\n\t\tfunc(policyRef bufparse.Ref) (string, error) {\n\t\t\treturn policyRef.String(), nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tregistryToIndexedPolicyRefs := xslices.ToIndexedValuesMap(\n\t\tpolicyRefs,\n\t\tfunc(policyRef bufparse.Ref) string {\n\t\t\treturn policyRef.FullName().Registry()\n\t\t},\n\t)\n\tindexedPolicyKeys := make([]xslices.Indexed[bufpolicy.PolicyKey], 0, len(policyRefs))\n\tfor registry, indexedPolicyRefs := range registryToIndexedPolicyRefs {\n\t\tindexedRegistryPolicyKeys, err := p.getIndexedPolicyKeysForRegistryAndIndexedPolicyRefs(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedPolicyRefs,\n\t\t\tdigestType,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPolicyKeys = append(indexedPolicyKeys, indexedRegistryPolicyKeys...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedPolicyKeys), nil\n}\n\nfunc (p *policyKeyProvider) getIndexedPolicyKeysForRegistryAndIndexedPolicyRefs(\n\tctx context.Context,\n\tregistry string,\n\tindexedPolicyRefs []xslices.Indexed[bufparse.Ref],\n\tdigestType bufpolicy.DigestType,\n) ([]xslices.Indexed[bufpolicy.PolicyKey], error) {\n\tresourceRefs := xslices.Map(indexedPolicyRefs, func(indexedPolicyRef xslices.Indexed[bufparse.Ref]) *policyv1beta1.ResourceRef {\n\t\tresourceRefName := &policyv1beta1.ResourceRef_Name{\n\t\t\tOwner:  indexedPolicyRef.Value.FullName().Owner(),\n\t\t\tPolicy: indexedPolicyRef.Value.FullName().Name(),\n\t\t}\n\t\tif ref := indexedPolicyRef.Value.Ref(); ref != \"\" {\n\t\t\tresourceRefName.Child = &policyv1beta1.ResourceRef_Name_Ref{\n\t\t\t\tRef: ref,\n\t\t\t}\n\t\t}\n\t\treturn &policyv1beta1.ResourceRef{\n\t\t\tValue: &policyv1beta1.ResourceRef_Name_{\n\t\t\t\tName: resourceRefName,\n\t\t\t},\n\t\t}\n\t})\n\tpolicyResponse, err := p.clientProvider.V1Beta1CommitServiceClient(registry).GetCommits(\n\t\tctx,\n\t\tconnect.NewRequest(&policyv1beta1.GetCommitsRequest{\n\t\t\tResourceRefs: resourceRefs,\n\t\t}),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcommits := policyResponse.Msg.Commits\n\tif len(commits) != len(indexedPolicyRefs) {\n\t\treturn nil, syserror.New(\"did not get the expected number of policy datas\")\n\t}\n\n\tindexedPolicyKeys := make([]xslices.Indexed[bufpolicy.PolicyKey], len(commits))\n\tfor i, commit := range commits {\n\t\tcommitID, err := uuidutil.FromDashless(commit.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdigest, err := V1Beta1ProtoToDigest(commit.Digest)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicyKey, err := bufpolicy.NewPolicyKey(\n\t\t\t// Note we don't have to resolve owner_name and policy_name since we already have them.\n\t\t\tindexedPolicyRefs[i].Value.FullName(),\n\t\t\tcommitID,\n\t\t\tfunc() (bufpolicy.Digest, error) {\n\t\t\t\treturn digest, nil\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedPolicyKeys[i] = xslices.Indexed[bufpolicy.PolicyKey]{\n\t\t\tValue: policyKey,\n\t\t\tIndex: indexedPolicyRefs[i].Index,\n\t\t}\n\t}\n\treturn indexedPolicyKeys, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyapi/uploader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyapi\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"time\"\n\n\townerv1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/owner/v1\"\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/standard/xslices\"\n\t\"connectrpc.com/connect\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufregistryapi/bufregistryapipolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// NewUploader returns a new Uploader for the given API client.\nfunc NewUploader(\n\tlogger *slog.Logger,\n\tpolicyClientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1PolicyServiceClientProvider\n\t\tbufregistryapipolicy.V1Beta1UploadServiceClientProvider\n\t},\n\toptions ...UploaderOption,\n) bufpolicy.Uploader {\n\treturn newUploader(logger, policyClientProvider, options...)\n}\n\n// UploaderOption is an option for a new Uploader.\ntype UploaderOption func(*uploader)\n\n// *** PRIVATE ***\n\ntype uploader struct {\n\tlogger               *slog.Logger\n\tpolicyClientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1PolicyServiceClientProvider\n\t\tbufregistryapipolicy.V1Beta1UploadServiceClientProvider\n\t}\n}\n\nfunc newUploader(\n\tlogger *slog.Logger,\n\tpolicyClientProvider interface {\n\t\tbufregistryapipolicy.V1Beta1PolicyServiceClientProvider\n\t\tbufregistryapipolicy.V1Beta1UploadServiceClientProvider\n\t},\n\toptions ...UploaderOption,\n) *uploader {\n\tuploader := &uploader{\n\t\tlogger:               logger,\n\t\tpolicyClientProvider: policyClientProvider,\n\t}\n\tfor _, option := range options {\n\t\toption(uploader)\n\t}\n\treturn uploader\n}\n\nfunc (u *uploader) Upload(\n\tctx context.Context,\n\tpolicies []bufpolicy.Policy,\n\toptions ...bufpolicy.UploadOption,\n) ([]bufpolicy.Commit, error) {\n\tuploadOptions, err := bufpolicy.NewUploadOptions(options)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tregistryToIndexedPolicyKeys := xslices.ToIndexedValuesMap(\n\t\tpolicies,\n\t\tfunc(policy bufpolicy.Policy) string {\n\t\t\treturn policy.FullName().Registry()\n\t\t},\n\t)\n\tindexedCommits := make([]xslices.Indexed[bufpolicy.Commit], 0, len(policies))\n\tfor registry, indexedPolicyKeys := range registryToIndexedPolicyKeys {\n\t\tindexedRegistryPolicyDatas, err := u.uploadIndexedPoliciesForRegistry(\n\t\t\tctx,\n\t\t\tregistry,\n\t\t\tindexedPolicyKeys,\n\t\t\tuploadOptions,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tindexedCommits = append(indexedCommits, indexedRegistryPolicyDatas...)\n\t}\n\treturn xslices.IndexedToSortedValues(indexedCommits), nil\n}\n\nfunc (u *uploader) uploadIndexedPoliciesForRegistry(\n\tctx context.Context,\n\tregistry string,\n\tindexedPolicies []xslices.Indexed[bufpolicy.Policy],\n\tuploadOptions bufpolicy.UploadOptions,\n) ([]xslices.Indexed[bufpolicy.Commit], error) {\n\tif uploadOptions.CreateIfNotExist() {\n\t\t// We must attempt to create each Policy one at a time, since CreatePolicies will return\n\t\t// an `AlreadyExists` if any of the Policies we are attempting to create already exists,\n\t\t// and no new Policies will be created.\n\t\tfor _, indexedPolicy := range indexedPolicies {\n\t\t\tpolicy := indexedPolicy.Value\n\t\t\tif _, err := u.createPolicyIfNotExist(\n\t\t\t\tctx,\n\t\t\t\tregistry,\n\t\t\t\tpolicy,\n\t\t\t\tuploadOptions.CreatePolicyVisibility(),\n\t\t\t); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\tcontents, err := xslices.MapError(indexedPolicies, func(indexedPolicy xslices.Indexed[bufpolicy.Policy]) (*policyv1beta1.UploadRequest_Content, error) {\n\t\tpolicy := indexedPolicy.Value\n\t\tif !policy.IsLocal() {\n\t\t\treturn nil, syserror.New(\"expected local Policy in uploadIndexedPoliciesForRegistry\")\n\t\t}\n\t\tif policy.FullName() == nil {\n\t\t\treturn nil, syserror.Newf(\"expected Policy name for local Policy: %s\", policy.Description())\n\t\t}\n\t\tconfig, err := policy.Config()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tlintConfig := config.LintConfig()\n\t\tbreakingConfig := config.BreakingConfig()\n\t\tpluginConfigs := config.PluginConfigs()\n\t\tpluginConfigsProto, err := xslices.MapError(pluginConfigs, func(pluginConfig bufpolicy.PluginConfig) (*policyv1beta1.PolicyConfig_CheckPluginConfig, error) {\n\t\t\toptionsProto, err := pluginConfig.Options().ToProto()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tref := pluginConfig.Ref()\n\t\t\tif ref == nil {\n\t\t\t\treturn nil, fmt.Errorf(\"expected remote PluginConfig to have a Ref\")\n\t\t\t}\n\t\t\treturn &policyv1beta1.PolicyConfig_CheckPluginConfig{\n\t\t\t\tName: &policyv1beta1.PolicyConfig_CheckPluginConfig_Name{\n\t\t\t\t\tOwner:  ref.FullName().Owner(),\n\t\t\t\t\tPlugin: ref.FullName().Name(),\n\t\t\t\t\tRef:    ref.Ref(),\n\t\t\t\t},\n\t\t\t\tOptions: optionsProto,\n\t\t\t\tArgs:    pluginConfig.Args(),\n\t\t\t}, nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &policyv1beta1.UploadRequest_Content{\n\t\t\tPolicyRef: &policyv1beta1.PolicyRef{\n\t\t\t\tValue: &policyv1beta1.PolicyRef_Name_{\n\t\t\t\t\tName: &policyv1beta1.PolicyRef_Name{\n\t\t\t\t\t\tOwner:  policy.FullName().Owner(),\n\t\t\t\t\t\tPolicy: policy.FullName().Name(),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tConfig: &policyv1beta1.PolicyConfig{\n\t\t\t\tLint: &policyv1beta1.PolicyConfig_LintConfig{\n\t\t\t\t\tUse:                                  lintConfig.UseIDsAndCategories(),\n\t\t\t\t\tExcept:                               lintConfig.ExceptIDsAndCategories(),\n\t\t\t\t\tEnumZeroValueSuffix:                  lintConfig.EnumZeroValueSuffix(),\n\t\t\t\t\tRpcAllowSameRequestResponse:          lintConfig.RPCAllowSameRequestResponse(),\n\t\t\t\t\tRpcAllowGoogleProtobufEmptyRequests:  lintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\t\t\t\tRpcAllowGoogleProtobufEmptyResponses: lintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\t\t\t\tServiceSuffix:                        lintConfig.ServiceSuffix(),\n\t\t\t\t},\n\t\t\t\tBreaking: &policyv1beta1.PolicyConfig_BreakingConfig{\n\t\t\t\t\tUse:                    breakingConfig.UseIDsAndCategories(),\n\t\t\t\t\tExcept:                 breakingConfig.ExceptIDsAndCategories(),\n\t\t\t\t\tIgnoreUnstablePackages: breakingConfig.IgnoreUnstablePackages(),\n\t\t\t\t},\n\t\t\t\tPlugins: pluginConfigsProto,\n\t\t\t},\n\t\t\tScopedLabelRefs: xslices.Map(uploadOptions.Labels(), func(label string) *policyv1beta1.ScopedLabelRef {\n\t\t\t\treturn &policyv1beta1.ScopedLabelRef{\n\t\t\t\t\tValue: &policyv1beta1.ScopedLabelRef_Name{\n\t\t\t\t\t\tName: label,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}),\n\t\t}, nil\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tuploadResponse, err := u.policyClientProvider.V1Beta1UploadServiceClient(registry).Upload(\n\t\tctx,\n\t\tconnect.NewRequest(&policyv1beta1.UploadRequest{\n\t\t\tContents: contents,\n\t\t}))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpolicyCommits := uploadResponse.Msg.Commits\n\tif len(policyCommits) != len(indexedPolicies) {\n\t\treturn nil, syserror.Newf(\"expected %d Commits, found %d\", len(indexedPolicies), len(policyCommits))\n\t}\n\n\tindexedCommits := make([]xslices.Indexed[bufpolicy.Commit], 0, len(indexedPolicies))\n\tfor i, policyCommit := range policyCommits {\n\t\tpolicyFullName := indexedPolicies[i].Value.FullName()\n\t\tcommitID, err := uuidutil.FromDashless(policyCommit.Id)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpolicyKey, err := bufpolicy.NewPolicyKey(\n\t\t\tpolicyFullName,\n\t\t\tcommitID,\n\t\t\tfunc() (bufpolicy.Digest, error) {\n\t\t\t\treturn V1Beta1ProtoToDigest(policyCommit.Digest)\n\t\t\t},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tcommit := bufpolicy.NewCommit(\n\t\t\tpolicyKey,\n\t\t\tfunc() (time.Time, error) {\n\t\t\t\treturn policyCommit.CreateTime.AsTime(), nil\n\t\t\t},\n\t\t)\n\t\tindexedCommits = append(\n\t\t\tindexedCommits,\n\t\t\txslices.Indexed[bufpolicy.Commit]{\n\t\t\t\tValue: commit,\n\t\t\t\tIndex: i,\n\t\t\t},\n\t\t)\n\t}\n\treturn indexedCommits, nil\n}\n\nfunc (u *uploader) createPolicyIfNotExist(\n\tctx context.Context,\n\tprimaryRegistry string,\n\tpolicy bufpolicy.Policy,\n\tcreatePolicyVisibility bufpolicy.PolicyVisibility,\n) (*policyv1beta1.Policy, error) {\n\tv1Beta1ProtoCreatePolicyVisibility, err := policyVisibilityToV1Beta1Proto(createPolicyVisibility)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tresponse, err := u.policyClientProvider.V1Beta1PolicyServiceClient(primaryRegistry).CreatePolicies(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.CreatePoliciesRequest{\n\t\t\t\tValues: []*policyv1beta1.CreatePoliciesRequest_Value{\n\t\t\t\t\t{\n\t\t\t\t\t\tOwnerRef: &ownerv1.OwnerRef{\n\t\t\t\t\t\t\tValue: &ownerv1.OwnerRef_Name{\n\t\t\t\t\t\t\t\tName: policy.FullName().Owner(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tName:       policy.FullName().Name(),\n\t\t\t\t\t\tVisibility: v1Beta1ProtoCreatePolicyVisibility,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t),\n\t)\n\tif err != nil {\n\t\tif connect.CodeOf(err) == connect.CodeAlreadyExists {\n\t\t\t// If a policy already existed, then we check validate its contents.\n\t\t\tpolicies, err := u.validatePoliciesExist(ctx, primaryRegistry, []bufpolicy.Policy{policy})\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(policies) != 1 {\n\t\t\t\treturn nil, syserror.Newf(\"expected 1 Policy, found %d\", len(policies))\n\t\t\t}\n\t\t\treturn policies[0], nil\n\t\t}\n\t\treturn nil, err\n\t}\n\tif len(response.Msg.Policies) != 1 {\n\t\treturn nil, syserror.Newf(\"expected 1 Policy, found %d\", len(response.Msg.Policies))\n\t}\n\t// Otherwise we return the policy we created.\n\treturn response.Msg.Policies[0], nil\n}\n\nfunc (u *uploader) validatePoliciesExist(\n\tctx context.Context,\n\tprimaryRegistry string,\n\tpolicies []bufpolicy.Policy,\n) ([]*policyv1beta1.Policy, error) {\n\tresponse, err := u.policyClientProvider.V1Beta1PolicyServiceClient(primaryRegistry).GetPolicies(\n\t\tctx,\n\t\tconnect.NewRequest(\n\t\t\t&policyv1beta1.GetPoliciesRequest{\n\t\t\t\tPolicyRefs: xslices.Map(\n\t\t\t\t\tpolicies,\n\t\t\t\t\tfunc(policy bufpolicy.Policy) *policyv1beta1.PolicyRef {\n\t\t\t\t\t\treturn &policyv1beta1.PolicyRef{\n\t\t\t\t\t\t\tValue: &policyv1beta1.PolicyRef_Name_{\n\t\t\t\t\t\t\t\tName: &policyv1beta1.PolicyRef_Name{\n\t\t\t\t\t\t\t\t\tOwner:  policy.FullName().Owner(),\n\t\t\t\t\t\t\t\t\tPolicy: policy.FullName().Name(),\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\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn response.Msg.Policies, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyapi/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufpolicyapi\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicycache/bufpolicycache.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicycache\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicycache/policy_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicycache\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\t\"sync/atomic\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicystore\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// NewPolicyDataProvider returns a new PolicyDataProvider that caches the results of the delegate.\n//\n// The PolicyDataStore is used as a cache.\nfunc NewPolicyDataProvider(\n\tlogger *slog.Logger,\n\tdelegate bufpolicy.PolicyDataProvider,\n\tstore bufpolicystore.PolicyDataStore,\n) bufpolicy.PolicyDataProvider {\n\treturn newPolicyDataProvider(logger, delegate, store)\n}\n\n/// *** PRIVATE ***\n\ntype policyDataProvider struct {\n\tlogger   *slog.Logger\n\tdelegate bufpolicy.PolicyDataProvider\n\tstore    bufpolicystore.PolicyDataStore\n\n\tkeysRetrieved atomic.Int64\n\tkeysHit       atomic.Int64\n}\n\nfunc newPolicyDataProvider(\n\tlogger *slog.Logger,\n\tdelegate bufpolicy.PolicyDataProvider,\n\tstore bufpolicystore.PolicyDataStore,\n) *policyDataProvider {\n\treturn &policyDataProvider{\n\t\tlogger:   logger,\n\t\tdelegate: delegate,\n\t\tstore:    store,\n\t}\n}\n\nfunc (p *policyDataProvider) GetPolicyDatasForPolicyKeys(\n\tctx context.Context,\n\tpolicyKeys []bufpolicy.PolicyKey,\n) ([]bufpolicy.PolicyData, error) {\n\tfoundValues, notFoundKeys, err := p.store.GetPolicyDatasForPolicyKeys(ctx, policyKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdelegateValues, err := p.delegate.GetPolicyDatasForPolicyKeys(ctx, notFoundKeys)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := p.store.PutPolicyDatas(ctx, delegateValues); err != nil {\n\t\treturn nil, err\n\t}\n\n\tp.keysRetrieved.Add(int64(len(policyKeys)))\n\tp.keysHit.Add(int64(len(foundValues)))\n\n\tcommitIDToIndexedKey, err := xslices.ToUniqueIndexedValuesMap(\n\t\tpolicyKeys,\n\t\tfunc(policyKey bufpolicy.PolicyKey) uuid.UUID {\n\t\t\treturn policyKey.CommitID()\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tindexedValues, err := xslices.MapError(\n\t\tappend(foundValues, delegateValues...),\n\t\tfunc(value bufpolicy.PolicyData) (xslices.Indexed[bufpolicy.PolicyData], error) {\n\t\t\tcommitID := value.PolicyKey().CommitID()\n\t\t\tindexedKey, ok := commitIDToIndexedKey[commitID]\n\t\t\tif !ok {\n\t\t\t\treturn xslices.Indexed[bufpolicy.PolicyData]{}, syserror.Newf(\"did not get value from store with commitID %q\", uuidutil.ToDashless(commitID))\n\t\t\t}\n\t\t\treturn xslices.Indexed[bufpolicy.PolicyData]{\n\t\t\t\tValue: value,\n\t\t\t\tIndex: indexedKey.Index,\n\t\t\t}, nil\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.IndexedToSortedValues(indexedValues), nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicycache/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufpolicycache\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyconfig/buf_policy_yaml_file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyconfig\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"slices\"\n\n\t\"buf.build/go/bufplugin/option\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// BufPolicyYAMLFile represents a Policy config file.\ntype BufPolicyYAMLFile interface {\n\tFile\n\n\t// Name returns the name for the File.\n\tName() string\n\t// PolicyConfig returns the PolicyConfig for the File.\n\tPolicyConfig() (bufpolicy.PolicyConfig, error)\n\t// LintConfig returns the LintConfig for the File.\n\tLintConfig() bufpolicy.LintConfig\n\t// BreakingConfig returns the BreakingConfig for the File.\n\tBreakingConfig() bufpolicy.BreakingConfig\n\t// PluginConfigs returns the PluginConfigs for the File.\n\tPluginConfigs() []bufpolicy.PluginConfig\n\n\tisBufPolicyYAMLFile()\n}\n\n// NewBufPolicyYAMLFile returns a new validated BufPolicyYAMLFile.\nfunc NewBufPolicyYAMLFile(\n\tname string,\n\tlintConfig bufpolicy.LintConfig,\n\tbreakingConfig bufpolicy.BreakingConfig,\n\tpluginConfigs []bufpolicy.PluginConfig,\n) (BufPolicyYAMLFile, error) {\n\treturn newBufPolicyYAMLFile(\n\t\tnil,\n\t\tname,\n\t\tlintConfig,\n\t\tbreakingConfig,\n\t\tpluginConfigs,\n\t)\n}\n\n// GetBufPolicyYAMLFile gets the PolicyYAMLFile at the given bucket path.\nfunc GetBufPolicyYAMLFile(\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tpath string,\n) (BufPolicyYAMLFile, error) {\n\treturn getFile(ctx, bucket, path, readBufPolicyYAMLFile)\n}\n\n// PutBufPolicyYAMLFile puts the PolicyYAMLFile at the given bucket path.\n//\n// The PolicyYAMLFile file will be attempted to be written to filePath.\n// The PolicyYAMLFile file will be written atomically.\nfunc PutBufPolicyYAMLFile(\n\tctx context.Context,\n\tbucket storage.WriteBucket,\n\tpath string,\n\tbufYAMLFile BufPolicyYAMLFile,\n) error {\n\treturn putFile(ctx, bucket, path, bufYAMLFile, writeBufPolicyYAMLFile)\n}\n\n// ReadBufPolicyYAMLFile reads the BufPolicyYAMLFile from the io.Reader.\nfunc ReadBufPolicyYAMLFile(reader io.Reader, fileName string) (BufPolicyYAMLFile, error) {\n\treturn readFile(reader, fileName, readBufPolicyYAMLFile)\n}\n\n// WriteBufPolicyYAMLFile writes the BufPolicyYAMLFile to the io.Writer.\nfunc WriteBufPolicyYAMLFile(writer io.Writer, bufPolicyYAMLFile BufPolicyYAMLFile) error {\n\treturn writeFile(writer, bufPolicyYAMLFile, writeBufPolicyYAMLFile)\n}\n\n// *** PRIVATE ***\n\ntype bufPolicyYAMLFile struct {\n\tfileVersion    bufconfig.FileVersion\n\tobjectData     bufconfig.ObjectData\n\tname           string\n\tlintConfig     bufpolicy.LintConfig\n\tbreakingConfig bufpolicy.BreakingConfig\n\tpluginConfigs  []bufpolicy.PluginConfig\n}\n\nfunc newBufPolicyYAMLFile(\n\tobjectData bufconfig.ObjectData,\n\tname string,\n\tlintConfig bufpolicy.LintConfig,\n\tbreakingConfig bufpolicy.BreakingConfig,\n\tpluginConfigs []bufpolicy.PluginConfig,\n) (*bufPolicyYAMLFile, error) {\n\tvar err error\n\tif lintConfig == nil {\n\t\tlintConfig, err = getDefaultLintConfigV2()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get default lint config: %w\", err)\n\t\t}\n\t}\n\tif breakingConfig == nil {\n\t\tbreakingConfig, err = getDefaultBreakingConfigV2()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get default breaking config: %w\", err)\n\t\t}\n\t}\n\treturn &bufPolicyYAMLFile{\n\t\tfileVersion:    bufconfig.FileVersionV2,\n\t\tobjectData:     objectData,\n\t\tname:           name,\n\t\tlintConfig:     lintConfig,\n\t\tbreakingConfig: breakingConfig,\n\t\tpluginConfigs:  slices.Clone(pluginConfigs),\n\t}, nil\n}\n\nfunc (p *bufPolicyYAMLFile) FileVersion() bufconfig.FileVersion {\n\treturn p.fileVersion\n}\n\nfunc (p *bufPolicyYAMLFile) ObjectData() bufconfig.ObjectData {\n\treturn p.objectData\n}\n\nfunc (p *bufPolicyYAMLFile) Name() string {\n\treturn p.name\n}\n\nfunc (p *bufPolicyYAMLFile) PolicyConfig() (bufpolicy.PolicyConfig, error) {\n\treturn bufpolicy.NewPolicyConfig(\n\t\tp.lintConfig,\n\t\tp.breakingConfig,\n\t\tp.pluginConfigs,\n\t)\n}\n\nfunc (p *bufPolicyYAMLFile) LintConfig() bufpolicy.LintConfig {\n\treturn p.lintConfig\n}\n\nfunc (p *bufPolicyYAMLFile) BreakingConfig() bufpolicy.BreakingConfig {\n\treturn p.breakingConfig\n}\n\nfunc (p *bufPolicyYAMLFile) PluginConfigs() []bufpolicy.PluginConfig {\n\treturn slices.Clone(p.pluginConfigs)\n}\n\nfunc (*bufPolicyYAMLFile) isBufPolicyYAMLFile() {}\nfunc (*bufPolicyYAMLFile) isFile()              {}\n\n// externalBufPolicyYAMLFileV2 represents the v2 buf.policy.yaml file.\ntype externalBufPolicyYAMLFileV2 struct {\n\tVersion  string                              `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tName     string                              `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tLint     externalBufPolicyYAMLFileLintV2     `json:\"lint\" yaml:\"lint,omitempty\"`\n\tBreaking externalBufPolicyYAMLFileBreakingV2 `json:\"breaking\" yaml:\"breaking,omitempty\"`\n\tPlugins  []externalBufPolicyYAMLFilePluginV2 `json:\"plugins,omitempty\" yaml:\"plugins,omitempty\"`\n}\n\nfunc readBufPolicyYAMLFile(\n\tdata []byte,\n\tobjectData bufconfig.ObjectData,\n\tallowJSON bool,\n) (BufPolicyYAMLFile, error) {\n\tfileVersion, err := getFileVersionForData(data, allowJSON)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif objectData != nil {\n\t\tif err := validateSupportedFileVersion(objectData.Name(), fileVersion); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar externalBufPolicyYAMLFile externalBufPolicyYAMLFileV2\n\tif err := getUnmarshalStrict(allowJSON)(data, &externalBufPolicyYAMLFile); err != nil {\n\t\treturn nil, err\n\t}\n\tvar lintConfig bufpolicy.LintConfig\n\tif !externalBufPolicyYAMLFile.Lint.isEmpty() {\n\t\tlintConfig, err = getLintConfigForExternalLintV2(\n\t\t\texternalBufPolicyYAMLFile.Lint,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar breakingConfig bufpolicy.BreakingConfig\n\tif !externalBufPolicyYAMLFile.Breaking.isEmpty() {\n\t\tbreakingConfig, err = getBreakingConfigForExternalBreaking(\n\t\t\texternalBufPolicyYAMLFile.Breaking,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tvar pluginConfigs []bufpolicy.PluginConfig\n\tfor _, externalPluginConfig := range externalBufPolicyYAMLFile.Plugins {\n\t\tpluginConfig, err := newPluginConfigForExternalPluginV2(externalPluginConfig)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpluginConfigs = append(pluginConfigs, pluginConfig)\n\t}\n\treturn newBufPolicyYAMLFile(\n\t\tobjectData,\n\t\texternalBufPolicyYAMLFile.Name,\n\t\tlintConfig,\n\t\tbreakingConfig,\n\t\tpluginConfigs,\n\t)\n}\n\nfunc writeBufPolicyYAMLFile(writer io.Writer, bufPolicyYAMLFile BufPolicyYAMLFile) error {\n\tfileVersion := bufPolicyYAMLFile.FileVersion()\n\tif fileVersion != bufconfig.FileVersionV2 {\n\t\t// This is effectively a system error.\n\t\treturn syserror.Wrap(newUnsupportedFileVersionError(\"\", fileVersion))\n\t}\n\tvar externalLint externalBufPolicyYAMLFileLintV2\n\tif lintConfig := bufPolicyYAMLFile.LintConfig(); lintConfig != nil {\n\t\texternalLint = getExternalLintForLintConfig(lintConfig)\n\t}\n\tvar externalBreaking externalBufPolicyYAMLFileBreakingV2\n\tif breakingConfig := bufPolicyYAMLFile.BreakingConfig(); breakingConfig != nil {\n\t\texternalBreaking = getExternalBreakingForBreakingConfig(breakingConfig)\n\t}\n\tvar externalPlugins []externalBufPolicyYAMLFilePluginV2\n\tfor _, pluginConfig := range bufPolicyYAMLFile.PluginConfigs() {\n\t\texternalPlugin, err := newExternalPluginV2ForPluginConfig(pluginConfig)\n\t\tif err != nil {\n\t\t\treturn syserror.Wrap(err)\n\t\t}\n\t\texternalPlugins = append(externalPlugins, externalPlugin)\n\t}\n\texternalBufPolicyYAMLFile := externalBufPolicyYAMLFileV2{\n\t\tVersion:  fileVersion.String(),\n\t\tName:     bufPolicyYAMLFile.Name(),\n\t\tLint:     externalLint,\n\t\tBreaking: externalBreaking,\n\t\tPlugins:  externalPlugins,\n\t}\n\tdata, err := encoding.MarshalYAML(&externalBufPolicyYAMLFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = writer.Write(data)\n\treturn err\n}\n\n// externalBufPolicyYAMLFileLintV2 represents lint configuration within a v2 buf.policy.yaml file.\n//\n// It is a subset of the v2 buf.yaml lint configuration.\ntype externalBufPolicyYAMLFileLintV2 struct {\n\tUse    []string `json:\"use,omitempty\" yaml:\"use,omitempty\"`\n\tExcept []string `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\t// Ignore are the paths to ignore.\n\tEnumZeroValueSuffix                  string `json:\"enum_zero_value_suffix,omitempty\" yaml:\"enum_zero_value_suffix,omitempty\"`\n\tRPCAllowSameRequestResponse          bool   `json:\"rpc_allow_same_request_response,omitempty\" yaml:\"rpc_allow_same_request_response,omitempty\"`\n\tRPCAllowGoogleProtobufEmptyRequests  bool   `json:\"rpc_allow_google_protobuf_empty_requests,omitempty\" yaml:\"rpc_allow_google_protobuf_empty_requests,omitempty\"`\n\tRPCAllowGoogleProtobufEmptyResponses bool   `json:\"rpc_allow_google_protobuf_empty_responses,omitempty\" yaml:\"rpc_allow_google_protobuf_empty_responses,omitempty\"`\n\tServiceSuffix                        string `json:\"service_suffix,omitempty\" yaml:\"service_suffix,omitempty\"`\n\tDisableBuiltin                       bool   `json:\"disable_builtin,omitempty\" yaml:\"disable_builtin,omitempty\"`\n}\n\nfunc (el externalBufPolicyYAMLFileLintV2) isEmpty() bool {\n\treturn len(el.Use) == 0 &&\n\t\tlen(el.Except) == 0 &&\n\t\tel.EnumZeroValueSuffix == \"\" &&\n\t\t!el.RPCAllowSameRequestResponse &&\n\t\t!el.RPCAllowGoogleProtobufEmptyRequests &&\n\t\t!el.RPCAllowGoogleProtobufEmptyResponses &&\n\t\tel.ServiceSuffix == \"\" &&\n\t\t!el.DisableBuiltin\n}\n\n// externalBufPolicyYAMLFileBreakingV2 represents breaking configuration within a v2 buf.policy.yaml file.\n//\n// It is a subset of the v2 buf.yaml breaking configuration.\ntype externalBufPolicyYAMLFileBreakingV2 struct {\n\tUse                    []string `json:\"use,omitempty\" yaml:\"use,omitempty\"`\n\tExcept                 []string `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n\tIgnoreUnstablePackages bool     `json:\"ignore_unstable_packages,omitempty\" yaml:\"ignore_unstable_packages,omitempty\"`\n\tDisableBuiltin         bool     `json:\"disable_builtin,omitempty\" yaml:\"disable_builtin,omitempty\"`\n}\n\nfunc (eb externalBufPolicyYAMLFileBreakingV2) isEmpty() bool {\n\treturn len(eb.Use) == 0 &&\n\t\tlen(eb.Except) == 0 &&\n\t\t!eb.IgnoreUnstablePackages &&\n\t\t!eb.DisableBuiltin\n}\n\n// externalBufPolicyYAMLFilePluginV2 represents a single plugin config in a v2 buf.yaml file.\ntype externalBufPolicyYAMLFilePluginV2 struct {\n\tPlugin  any            `json:\"plugin,omitempty\" yaml:\"plugin,omitempty\"`\n\tOptions map[string]any `json:\"options,omitempty\" yaml:\"options,omitempty\"`\n}\n\nfunc getLintConfigForExternalLintV2(externalLint externalBufPolicyYAMLFileLintV2) (bufpolicy.LintConfig, error) {\n\treturn bufpolicy.NewLintConfig(\n\t\texternalLint.Use,\n\t\texternalLint.Except,\n\t\texternalLint.EnumZeroValueSuffix,\n\t\texternalLint.RPCAllowSameRequestResponse,\n\t\texternalLint.RPCAllowGoogleProtobufEmptyRequests,\n\t\texternalLint.RPCAllowGoogleProtobufEmptyResponses,\n\t\texternalLint.ServiceSuffix,\n\t\texternalLint.DisableBuiltin,\n\t)\n}\n\nfunc getExternalLintForLintConfig(lintConfig bufpolicy.LintConfig) externalBufPolicyYAMLFileLintV2 {\n\treturn externalBufPolicyYAMLFileLintV2{\n\t\t// Use and Except are already sorted.\n\t\tUse:                                  lintConfig.UseIDsAndCategories(),\n\t\tExcept:                               lintConfig.ExceptIDsAndCategories(),\n\t\tEnumZeroValueSuffix:                  lintConfig.EnumZeroValueSuffix(),\n\t\tRPCAllowSameRequestResponse:          lintConfig.RPCAllowSameRequestResponse(),\n\t\tRPCAllowGoogleProtobufEmptyRequests:  lintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\tRPCAllowGoogleProtobufEmptyResponses: lintConfig.RPCAllowGoogleProtobufEmptyResponses(),\n\t\tServiceSuffix:                        lintConfig.ServiceSuffix(),\n\t\tDisableBuiltin:                       lintConfig.DisableBuiltin(),\n\t}\n}\n\nfunc getBreakingConfigForExternalBreaking(externalBreaking externalBufPolicyYAMLFileBreakingV2) (bufpolicy.BreakingConfig, error) {\n\treturn bufpolicy.NewBreakingConfig(\n\t\texternalBreaking.Use,\n\t\texternalBreaking.Except,\n\t\texternalBreaking.IgnoreUnstablePackages,\n\t\texternalBreaking.DisableBuiltin,\n\t)\n}\n\nfunc getExternalBreakingForBreakingConfig(breakingConfig bufpolicy.BreakingConfig) externalBufPolicyYAMLFileBreakingV2 {\n\treturn externalBufPolicyYAMLFileBreakingV2{\n\t\t// Use and Except are already sorted.\n\t\tUse:                    breakingConfig.UseIDsAndCategories(),\n\t\tExcept:                 breakingConfig.ExceptIDsAndCategories(),\n\t\tIgnoreUnstablePackages: breakingConfig.IgnoreUnstablePackages(),\n\t\tDisableBuiltin:         breakingConfig.DisableBuiltin(),\n\t}\n}\n\nfunc newPluginConfigForExternalPluginV2(externalConfig externalBufPolicyYAMLFilePluginV2) (bufpolicy.PluginConfig, error) {\n\tkeyToValue := make(map[string]any)\n\tfor key, value := range externalConfig.Options {\n\t\tif len(key) == 0 {\n\t\t\treturn nil, errors.New(\"must specify option key\")\n\t\t}\n\t\t// TODO: Validation here, how to expose from bufplugin?\n\t\tif value == nil {\n\t\t\treturn nil, errors.New(\"must specify option value\")\n\t\t}\n\t\tkeyToValue[key] = value\n\t}\n\tpluginOptions, err := option.NewOptions(keyToValue)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid plugin options: %w\", err)\n\t}\n\t// Plugins are specified as a path, remote reference, or Wasm file.\n\tpath, err := encoding.InterfaceSliceOrStringToStringSlice(externalConfig.Plugin)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(path) == 0 {\n\t\treturn nil, errors.New(\"must specify a path to the plugin\")\n\t}\n\tname, args := path[0], path[1:]\n\t// Remote plugins are specified as plugin references.\n\tvar pluginRef bufparse.Ref\n\tif ref, err := bufparse.ParseRef(name); err == nil {\n\t\t// Check if the local filepath exists, if it does presume its\n\t\t// not a remote reference. Okay to use os.Stat instead of\n\t\t// os.Lstat.\n\t\tif _, err := os.Stat(path[0]); os.IsNotExist(err) {\n\t\t\tpluginRef = ref\n\t\t}\n\t}\n\treturn bufpolicy.NewPluginConfig(\n\t\tname,\n\t\tpluginRef,\n\t\tpluginOptions,\n\t\targs,\n\t)\n}\n\nfunc newExternalPluginV2ForPluginConfig(\n\tconfig bufpolicy.PluginConfig,\n) (externalBufPolicyYAMLFilePluginV2, error) {\n\tkeyToValues := make(map[string]any)\n\tconfig.Options().Range(func(key string, value any) {\n\t\tkeyToValues[key] = value\n\t})\n\texternalBufYAMLFilePluginV2 := externalBufPolicyYAMLFilePluginV2{\n\t\tOptions: keyToValues,\n\t}\n\tif args := config.Args(); len(args) > 0 {\n\t\texternalBufYAMLFilePluginV2.Plugin = append([]string{config.Name()}, args...)\n\t} else {\n\t\texternalBufYAMLFilePluginV2.Plugin = config.Name()\n\t}\n\treturn externalBufYAMLFilePluginV2, nil\n}\n\nfunc validateSupportedFileVersion(fileName string, fileVersion bufconfig.FileVersion) error {\n\tswitch fileVersion {\n\tcase bufconfig.FileVersionV2:\n\t\treturn nil\n\tdefault:\n\t\treturn newUnsupportedFileVersionError(fileName, fileVersion)\n\t}\n}\n\nfunc newUnsupportedFileVersionError(name string, fileVersion bufconfig.FileVersion) error {\n\tif name == \"\" {\n\t\treturn fmt.Errorf(\"%s is not supported\", fileVersion)\n\t}\n\treturn fmt.Errorf(\"%s is not supported for %s files\", fileVersion, name)\n}\n\ntype externalFileVersion struct {\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n}\n\nfunc getFileVersionForData(\n\tdata []byte,\n\tallowJSON bool,\n) (bufconfig.FileVersion, error) {\n\tvar externalFileVersion externalFileVersion\n\tif err := getUnmarshalNonStrict(allowJSON)(data, &externalFileVersion); err != nil {\n\t\treturn 0, err\n\t}\n\tswitch externalFileVersion.Version {\n\tcase bufconfig.FileVersionV1Beta1.String():\n\t\treturn bufconfig.FileVersionV1Beta1, nil\n\tcase bufconfig.FileVersionV1.String():\n\t\treturn bufconfig.FileVersionV1, nil\n\tcase bufconfig.FileVersionV2.String():\n\t\treturn bufconfig.FileVersionV2, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown file version: %q\", externalFileVersion.Version)\n\t}\n}\n\n// getDefaultLintConfigV2 returns the default LintConfig for v2.\nfunc getDefaultLintConfigV2() (bufpolicy.LintConfig, error) {\n\treturn bufpolicy.NewLintConfig(\n\t\tnil,\n\t\tnil,\n\t\t\"\",\n\t\tfalse,\n\t\tfalse,\n\t\tfalse,\n\t\t\"\",\n\t\tfalse,\n\t)\n}\n\n// getDefaultBreakingConfigV2 is the default breaking config for v2.\nfunc getDefaultBreakingConfigV2() (bufpolicy.BreakingConfig, error) {\n\treturn bufpolicy.NewBreakingConfig(\n\t\tnil,\n\t\tnil,\n\t\tfalse,\n\t\tfalse,\n\t)\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyconfig/buf_policy_yaml_file_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyconfig\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestReadWriteBufPolicyYAMLFileRoundTrip(t *testing.T) {\n\tt.Parallel()\n\n\ttestReadWriteBufPolicyYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nlint:\n  disable_builtin: true\nbreaking:\n  disable_builtin: true\n`,\n\t\t// expected output\n\t\t`version: v2\nlint:\n  disable_builtin: true\nbreaking:\n  disable_builtin: true\n`,\n\t)\n\n\ttestReadWriteBufPolicyYAMLFileRoundTrip(\n\t\tt,\n\t\t// input\n\t\t`version: v2\nbreaking:\n  use:\n    - FILE\n  except:\n    - FILE_NO_DELETE\n  ignore_unstable_packages: true\nlint:\n  use:\n    - DIRECTORY_SAME_PACKAGE\n    - ENUM_FIRST_VALUE_ZERO\n    - TIMESTAMP_SUFFIX\n  enum_zero_value_suffix: _UNSPECIFIED\n  rpc_allow_same_request_response: false\n  rpc_allow_google_protobuf_empty_requests: false\n  rpc_allow_google_protobuf_empty_responses: false\n  service_suffix: Service\nplugins:\n  - plugin: plugin-timestamp-suffix\n    options:\n      # The TIMESTAMP_SUFFIX rule specified above allows the user to change the suffix by providing a\n      # new value here.\n      timestamp_suffix: _time\n  - plugin: buf.build/bufbuild/buf-lint\n`,\n\t\t// expected output\n\t\t`version: v2\nlint:\n  use:\n    - DIRECTORY_SAME_PACKAGE\n    - ENUM_FIRST_VALUE_ZERO\n    - TIMESTAMP_SUFFIX\n  enum_zero_value_suffix: _UNSPECIFIED\n  service_suffix: Service\nbreaking:\n  use:\n    - FILE\n  except:\n    - FILE_NO_DELETE\n  ignore_unstable_packages: true\nplugins:\n  - plugin: plugin-timestamp-suffix\n    options:\n      timestamp_suffix: _time\n  - plugin: buf.build/bufbuild/buf-lint\n`,\n\t)\n}\n\nfunc testReadBufPolicyYAMLFile(\n\tt *testing.T,\n\tinputBufPolicyYAMLFileData string,\n) BufPolicyYAMLFile {\n\tbufPolicyYAMLFile, err := ReadBufPolicyYAMLFile(\n\t\tstrings.NewReader(testCleanYAMLData(inputBufPolicyYAMLFileData)),\n\t\t\"buf.policy.yaml\",\n\t)\n\trequire.NoError(t, err)\n\treturn bufPolicyYAMLFile\n}\n\nfunc testReadWriteBufPolicyYAMLFileRoundTrip(\n\tt *testing.T,\n\tinputBufYAMLFileData string,\n\texpectedOutputBufYAMLFileData string,\n) {\n\tbufPolicyYAMLFile := testReadBufPolicyYAMLFile(t, inputBufYAMLFileData)\n\tbuffer := bytes.NewBuffer(nil)\n\terr := WriteBufPolicyYAMLFile(buffer, bufPolicyYAMLFile)\n\trequire.NoError(t, err)\n\toutputBufPolicyYAMLData := testCleanYAMLData(buffer.String())\n\tassert.Equal(t, testCleanYAMLData(expectedOutputBufYAMLFileData), outputBufPolicyYAMLData, \"output:\\n%s\", outputBufPolicyYAMLData)\n}\n\nfunc testCleanYAMLData(data string) string {\n\t// Just to deal with editor nonsense when writing tests.\n\treturn strings.TrimSpace(strings.ReplaceAll(data, \"\\t\", \"  \"))\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyconfig/bufpolicyconfig.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyconfig\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyconfig/convert.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyconfig\n\nimport (\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n)\n\n// LintConfigToBufConfig converts the given LintConfig to a bufconfig.LintConfig.\nfunc LintConfigToBufConfig(lintConfig bufpolicy.LintConfig) (bufconfig.LintConfig, error) {\n\tcheckConfig, err := bufconfig.NewEnabledCheckConfig(\n\t\tbufconfig.FileVersionV2,\n\t\tlintConfig.UseIDsAndCategories(),\n\t\tlintConfig.ExceptIDsAndCategories(),\n\t\tnil,\n\t\tnil,\n\t\tlintConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.NewLintConfig(\n\t\tcheckConfig,\n\t\tlintConfig.EnumZeroValueSuffix(),\n\t\tlintConfig.RPCAllowSameRequestResponse(),\n\t\tlintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\tlintConfig.RPCAllowGoogleProtobufEmptyResponses(),\n\t\tlintConfig.ServiceSuffix(),\n\t\tfalse, // Comment ignores are not allowed in Policy files.\n\t), nil\n}\n\n// BreakingConfigToBufConfig converts the given BreakingConfig to a bufconfig.BreakingConfig.\nfunc BreakingConfigToBufConfig(breakingConfig bufpolicy.BreakingConfig) (bufconfig.BreakingConfig, error) {\n\tcheckConfig, err := bufconfig.NewEnabledCheckConfig(\n\t\tbufconfig.FileVersionV2,\n\t\tbreakingConfig.UseIDsAndCategories(),\n\t\tbreakingConfig.ExceptIDsAndCategories(),\n\t\tnil,\n\t\tnil,\n\t\tbreakingConfig.DisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufconfig.NewBreakingConfig(\n\t\tcheckConfig,\n\t\tbreakingConfig.IgnoreUnstablePackages(),\n\t), nil\n}\n\n// PluginConfigsToBufConfig converts the given plugin configs to bufconfig.PluginConfig.\nfunc PluginConfigsToBufConfig(pluginConfigs []bufpolicy.PluginConfig) ([]bufconfig.PluginConfig, error) {\n\treturn xslices.MapError(pluginConfigs, func(pluginConfig bufpolicy.PluginConfig) (bufconfig.PluginConfig, error) {\n\t\toptions := make(map[string]any)\n\t\tpluginConfig.Options().Range(func(key string, value any) {\n\t\t\toptions[key] = value\n\t\t})\n\t\targs := pluginConfig.Args()\n\t\tswitch {\n\t\tcase pluginConfig.Ref() != nil:\n\t\t\treturn bufconfig.NewRemoteWasmPluginConfig(\n\t\t\t\tpluginConfig.Ref(),\n\t\t\t\toptions,\n\t\t\t\targs,\n\t\t\t)\n\t\tcase strings.HasSuffix(pluginConfig.Name(), \".wasm\"):\n\t\t\treturn bufconfig.NewLocalWasmPluginConfig(\n\t\t\t\tpluginConfig.Name(),\n\t\t\t\toptions,\n\t\t\t\targs,\n\t\t\t)\n\t\tdefault:\n\t\t\treturn bufconfig.NewLocalPluginConfig(\n\t\t\t\tpluginConfig.Name(),\n\t\t\t\toptions,\n\t\t\t\targs,\n\t\t\t)\n\t\t}\n\t})\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyconfig/file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicyconfig\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"io/fs\"\n\t\"path/filepath\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufconfig\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// File is a file.\ntype File interface {\n\t// FileVersion returns the file version.\n\tFileVersion() bufconfig.FileVersion\n\t// ObjectData returns the underlying ObjectData.\n\t//\n\t// This is non-nil on Files if they were created from storage.ReadBuckets. It is nil\n\t// if the File was created via a New constructor or Read method.\n\t//\n\t// This ObjectData is used for digest calculations.\n\tObjectData() bufconfig.ObjectData\n\n\tisFile()\n}\n\n// *** PRIVATE ***\n\nfunc getFile[F File](\n\tctx context.Context,\n\tbucket storage.ReadBucket,\n\tpath string,\n\treadFileFunc func(\n\t\tdata []byte,\n\t\tobjectData bufconfig.ObjectData,\n\t\tallowJSON bool,\n\t) (F, error),\n) (F, error) {\n\tvar f F\n\tdata, err := storage.ReadPath(ctx, bucket, path)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn f, &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n\t\t}\n\t\tvar f F\n\t\treturn f, err\n\t}\n\tf, err = readFileFunc(data, bufconfig.NewObjectData(path, data), false)\n\tif err != nil {\n\t\treturn f, newDecodeError(path, err)\n\t}\n\tif err := validateSupportedFileVersion(path, f.FileVersion()); err != nil {\n\t\treturn f, newDecodeError(path, err)\n\t}\n\treturn f, nil\n}\n\nfunc putFile[F File](\n\tctx context.Context,\n\tbucket storage.WriteBucket,\n\tpath string,\n\tf F,\n\twriteFileFunc func(\n\t\twriter io.Writer,\n\t\tf F,\n\t) error,\n) (retErr error) {\n\tif err := validateSupportedFileVersion(path, f.FileVersion()); err != nil {\n\t\t// This is effectively a system error. We should be able to write with whatever file name we have.\n\t\treturn syserror.Wrap(newEncodeError(path, err))\n\t}\n\twriteObjectCloser, err := bucket.Put(ctx, path, storage.PutWithAtomic())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t}()\n\treturn writeFileFunc(writeObjectCloser, f)\n}\n\nfunc readFile[F File](\n\treader io.Reader,\n\tfileName string,\n\treadFileFunc func(\n\t\tdata []byte,\n\t\tobjectData bufconfig.ObjectData,\n\t\tallowJSON bool,\n\t) (F, error),\n) (F, error) {\n\tdata, err := io.ReadAll(reader)\n\tif err != nil {\n\t\tvar f F\n\t\treturn f, err\n\t}\n\tobjectData := bufconfig.NewObjectData(fileName, data)\n\tf, err := readFileFunc(data, objectData, true)\n\tif err != nil {\n\t\treturn f, newDecodeError(fileName, err)\n\t}\n\treturn f, nil\n}\n\nfunc writeFile[F File](\n\twriter io.Writer,\n\tf F,\n\twriteFileFunc func(\n\t\twriter io.Writer,\n\t\tf F,\n\t) error,\n) error {\n\tif err := writeFileFunc(writer, f); err != nil {\n\t\tvar fileName string\n\t\tif objectData := f.ObjectData(); objectData != nil {\n\t\t\tfileName = objectData.Name()\n\t\t}\n\t\treturn newDecodeError(fileName, err)\n\t}\n\treturn nil\n}\n\nfunc getUnmarshalStrict(allowJSON bool) func([]byte, any) error {\n\tif allowJSON {\n\t\treturn encoding.UnmarshalJSONOrYAMLStrict\n\t}\n\treturn encoding.UnmarshalYAMLStrict\n}\n\nfunc getUnmarshalNonStrict(allowJSON bool) func([]byte, any) error {\n\tif allowJSON {\n\t\treturn encoding.UnmarshalJSONOrYAMLNonStrict\n\t}\n\treturn encoding.UnmarshalYAMLNonStrict\n}\n\nfunc newDecodeError(fileName string, err error) error {\n\tif fileName == \"\" {\n\t\tfileName = \"policy file\"\n\t}\n\t// We intercept PathErrors in buffetch to deal with fixing of paths.\n\t// We return a cleaned, unnormalized path in the error for clarity with user's filesystem.\n\treturn &fs.PathError{Op: \"decode\", Path: filepath.Clean(normalpath.Unnormalize(fileName)), Err: err}\n}\n\nfunc newEncodeError(fileName string, err error) error {\n\tif fileName == \"\" {\n\t\tfileName = \"policy file\"\n\t}\n\t// We intercept PathErrors in buffetch to deal with fixing of paths.\n\t// We return a cleaned, unnormalized path in the error for clarity with user's filesystem.\n\treturn &fs.PathError{Op: \"encode\", Path: filepath.Clean(normalpath.Unnormalize(fileName)), Err: err}\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicyconfig/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufpolicyconfig\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicystore/buf_policy_store.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicystore\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\t\"log/slog\"\n\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyapi\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// PolicyDataStore reads and writes PolicysDatas.\ntype PolicyDataStore interface {\n\t// GetPolicyDatasForPolicyKeys gets the PolicyDatas from the store for the PolicyKeys.\n\t//\n\t// Returns the found PolicyDatas, and the input PolicyKeys that were not found, each\n\t// ordered by the order of the input PolicyKeys.\n\tGetPolicyDatasForPolicyKeys(context.Context, []bufpolicy.PolicyKey) (\n\t\tfoundPolicyDatas []bufpolicy.PolicyData,\n\t\tnotFoundPolicyKeys []bufpolicy.PolicyKey,\n\t\terr error,\n\t)\n\t// PutPolicyDatas puts the PolicyDatas to the store.\n\tPutPolicyDatas(ctx context.Context, moduleDatas []bufpolicy.PolicyData) error\n}\n\n// NewPolicyDataStore returns a new PolicyDataStore for the given bucket.\n//\n// It is assumed that the PolicyDataStore has complete control of the bucket.\n//\n// This is typically used to interact with a cache directory.\nfunc NewPolicyDataStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n) PolicyDataStore {\n\treturn newPolicyDataStore(logger, bucket)\n}\n\n/// *** PRIVATE ***\n\ntype policyDataStore struct {\n\tlogger *slog.Logger\n\tbucket storage.ReadWriteBucket\n}\n\nfunc newPolicyDataStore(\n\tlogger *slog.Logger,\n\tbucket storage.ReadWriteBucket,\n) *policyDataStore {\n\treturn &policyDataStore{\n\t\tlogger: logger,\n\t\tbucket: bucket,\n\t}\n}\n\nfunc (p *policyDataStore) GetPolicyDatasForPolicyKeys(\n\tctx context.Context,\n\tpolicyKeys []bufpolicy.PolicyKey,\n) ([]bufpolicy.PolicyData, []bufpolicy.PolicyKey, error) {\n\tvar foundPolicyDatas []bufpolicy.PolicyData\n\tvar notFoundPolicyKeys []bufpolicy.PolicyKey\n\tfor _, policyKey := range policyKeys {\n\t\tpolicyData, err := p.getPolicyDataForPolicyKey(ctx, policyKey)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, nil, err\n\t\t\t}\n\t\t\tnotFoundPolicyKeys = append(notFoundPolicyKeys, policyKey)\n\t\t} else {\n\t\t\tfoundPolicyDatas = append(foundPolicyDatas, policyData)\n\t\t}\n\t}\n\treturn foundPolicyDatas, notFoundPolicyKeys, nil\n}\n\nfunc (p *policyDataStore) PutPolicyDatas(\n\tctx context.Context,\n\tpolicyDatas []bufpolicy.PolicyData,\n) error {\n\tfor _, policyData := range policyDatas {\n\t\tif err := p.putPolicyData(ctx, policyData); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// getPolicyDataForPolicyKey reads the policy data for the policy key from the cache.\nfunc (p *policyDataStore) getPolicyDataForPolicyKey(\n\tctx context.Context,\n\tpolicyKey bufpolicy.PolicyKey,\n) (bufpolicy.PolicyData, error) {\n\tpolicyDataStorePath, err := getPolicyDataStorePath(policyKey)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif exists, err := storage.Exists(ctx, p.bucket, policyDataStorePath); err != nil {\n\t\treturn nil, err\n\t} else if !exists {\n\t\treturn nil, fs.ErrNotExist\n\t}\n\tgetConfig := func() (bufpolicy.PolicyConfig, error) {\n\t\tdata, err := storage.ReadPath(ctx, p.bucket, policyDataStorePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Validate the digest, before parsing the config.\n\t\tcasDigest, err := cas.NewDigestForContent(bytes.NewReader(data))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\texpectedDigest, err := policyKey.Digest()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tactualDigest, err := bufpolicy.NewDigest(expectedDigest.Type(), casDigest)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif !bufpolicy.DigestEqual(actualDigest, expectedDigest) {\n\t\t\treturn nil, &bufpolicy.DigestMismatchError{\n\t\t\t\tFullName:       policyKey.FullName(),\n\t\t\t\tCommitID:       policyKey.CommitID(),\n\t\t\t\tExpectedDigest: expectedDigest,\n\t\t\t\tActualDigest:   actualDigest,\n\t\t\t}\n\t\t}\n\t\t// Create the policy config from the data.\n\t\tvar configProto policyv1beta1.PolicyConfig\n\t\tif err := protoencoding.NewJSONUnmarshaler(nil).Unmarshal(data, &configProto); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn bufpolicyapi.V1Beta1ProtoToPolicyConfig(policyKey.FullName().Registry(), &configProto)\n\t}\n\treturn bufpolicy.NewPolicyData(\n\t\tctx,\n\t\tpolicyKey,\n\t\tgetConfig,\n\t)\n}\n\n// putPolicyData puts the policy data into the policy cache.\nfunc (p *policyDataStore) putPolicyData(\n\tctx context.Context,\n\tpolicyData bufpolicy.PolicyData,\n) error {\n\tpolicyKey := policyData.PolicyKey()\n\tpolicyDataStorePath, err := getPolicyDataStorePath(policyKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\tconfig, err := policyData.Config()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdata, err := bufpolicy.MarshalPolicyConfigAsJSON(config)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Data is stored uncompressed.\n\treturn storage.PutPath(ctx, p.bucket, policyDataStorePath, data)\n}\n\n// getPolicyDataStorePath returns the path for the policy data store for the policy key.\n//\n// This is \"digestType/registry/owner/name/dashlessCommitID\", e.g. the policy\n// \"buf.build/acme/check-policy\" with commit \"12345-abcde\" and digest type \"o1\"\n// will return \"o1/buf.build/acme/check-policy/12345abcde.yaml\".\nfunc getPolicyDataStorePath(policyKey bufpolicy.PolicyKey) (string, error) {\n\tdigest, err := policyKey.Digest()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tfullName := policyKey.FullName()\n\treturn normalpath.Join(\n\t\tdigest.Type().String(),\n\t\tfullName.Registry(),\n\t\tfullName.Owner(),\n\t\tfullName.Name(),\n\t\tuuidutil.ToDashless(policyKey.CommitID())+\".json\",\n\t), nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicystore/bufpolicystore.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicystore\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/bufpolicystore/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufpolicystore\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/commit.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"sync\"\n\t\"time\"\n)\n\n// Commit represents a Commit for a Policy on the BSR.\ntype Commit interface {\n\t// PolicyKey returns the PolicyKey for the Commit.\n\tPolicyKey() PolicyKey\n\t// CreateTime returns the time the Commit was created on the BSR.\n\tCreateTime() (time.Time, error)\n\n\tisCommit()\n}\n\n// NewCommit returns a new Commit.\nfunc NewCommit(\n\tpolicyKey PolicyKey,\n\tgetCreateTime func() (time.Time, error),\n) Commit {\n\treturn newCommit(\n\t\tpolicyKey,\n\t\tgetCreateTime,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype commit struct {\n\tpolicyKey     PolicyKey\n\tgetCreateTime func() (time.Time, error)\n}\n\nfunc newCommit(\n\tpolicyKey PolicyKey,\n\tgetCreateTime func() (time.Time, error),\n) *commit {\n\treturn &commit{\n\t\tpolicyKey:     policyKey,\n\t\tgetCreateTime: sync.OnceValues(getCreateTime),\n\t}\n}\n\nfunc (c *commit) PolicyKey() PolicyKey {\n\treturn c.policyKey\n}\n\nfunc (c *commit) CreateTime() (time.Time, error) {\n\t// This may invoke tamper-proofing per newCommit construction.\n\tif _, err := c.policyKey.Digest(); err != nil {\n\t\treturn time.Time{}, err\n\t}\n\treturn c.getCreateTime()\n}\n\nfunc (*commit) isCommit() {}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/digest.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// DigestTypeO1 represents the o1 policy digest type.\n\t//\n\t// The string value of this is \"o1\".\n\tDigestTypeO1 DigestType = iota + 1\n)\n\nvar (\n\t// AllDigestTypes are all known DigestTypes.\n\tAllDigestTypes = []DigestType{\n\t\tDigestTypeO1,\n\t}\n\tdigestTypeToString = map[DigestType]string{\n\t\tDigestTypeO1: \"o1\",\n\t}\n\tstringToDigestType = map[string]DigestType{\n\t\t\"o1\": DigestTypeO1,\n\t}\n)\n\n// DigestType is a type of digest.\ntype DigestType int\n\n// ParseDigestType parses a DigestType from its string representation.\n//\n// This reverses DigestType.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseDigestType(s string) (DigestType, error) {\n\td, ok := stringToDigestType[s]\n\tif !ok {\n\t\treturn 0, bufparse.NewParseError(\n\t\t\t\"policy digest type\",\n\t\t\ts,\n\t\t\tfmt.Errorf(\"unknown type: %q\", s),\n\t\t)\n\t}\n\treturn d, nil\n}\n\n// String prints the string representation of the DigestType.\nfunc (d DigestType) String() string {\n\ts, ok := digestTypeToString[d]\n\tif !ok {\n\t\treturn strconv.Itoa(int(d))\n\t}\n\treturn s\n}\n\n// Digest is a digest of some content.\n//\n// It consists of a DigestType and a digest value.\ntype Digest interface {\n\t// String() prints typeString:hexValue.\n\tfmt.Stringer\n\n\t// Type returns the type of digest.\n\t//\n\t// Always a valid value.\n\tType() DigestType\n\t// Value returns the digest value.\n\t//\n\t// Always non-empty.\n\tValue() []byte\n\n\tisDigest()\n}\n\n// NewDigest creates a new Digest.\nfunc NewDigest(digestType DigestType, casDigest cas.Digest) (Digest, error) {\n\tswitch digestType {\n\tcase DigestTypeO1:\n\t\tif casDigest.Type() != cas.DigestTypeShake256 {\n\t\t\treturn nil, syserror.Newf(\n\t\t\t\t\"trying to create a %v Digest for a cas Digest of type %v\",\n\t\t\t\tdigestType,\n\t\t\t\tcasDigest.Type(),\n\t\t\t)\n\t\t}\n\t\treturn newDigest(digestType, casDigest), nil\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\n// ParseDigest parses a Digest from its string representation.\n//\n// A Digest string is of the form typeString:hexValue.\n// The string is expected to be non-empty, If not, an error is returned.\n//\n// This reverses Digest.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseDigest(s string) (Digest, error) {\n\tif s == \"\" {\n\t\t// This should be considered a system error.\n\t\treturn nil, errors.New(\"empty string passed to ParseDigest\")\n\t}\n\tdigestTypeString, hexValue, ok := strings.Cut(s, \":\")\n\tif !ok {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"policy digest\",\n\t\t\ts,\n\t\t\terrors.New(`must be in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tdigestType, err := ParseDigestType(digestTypeString)\n\tif err != nil {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"policy digest\",\n\t\t\tdigestTypeString,\n\t\t\terr,\n\t\t)\n\t}\n\tvalue, err := hex.DecodeString(hexValue)\n\tif err != nil {\n\t\treturn nil, bufparse.NewParseError(\n\t\t\t\"policy digest\",\n\t\t\ts,\n\t\t\terrors.New(`could not parse hex: must in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tswitch digestType {\n\tcase DigestTypeO1:\n\t\tcasDigest, err := cas.NewDigest(value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn NewDigest(digestType, casDigest)\n\tdefault:\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t}\n}\n\n// DigestEqual returns true if the given Digests are considered equal.\n//\n// If both Digests are nil, this returns true.\n//\n// This checks both the DigestType and Digest value.\nfunc DigestEqual(a Digest, b Digest) bool {\n\tif (a == nil) != (b == nil) {\n\t\treturn false\n\t}\n\tif a == nil {\n\t\treturn true\n\t}\n\tif a.Type() != b.Type() {\n\t\treturn false\n\t}\n\treturn bytes.Equal(a.Value(), b.Value())\n}\n\n/// *** PRIVATE ***\n\ntype digest struct {\n\tdigestType DigestType\n\tcasDigest  cas.Digest\n\t// Cache as we call String pretty often.\n\t// We could do this lazily but not worth it.\n\tstringValue string\n}\n\n// validation should occur outside of this function.\nfunc newDigest(digestType DigestType, casDigest cas.Digest) *digest {\n\treturn &digest{\n\t\tdigestType:  digestType,\n\t\tcasDigest:   casDigest,\n\t\tstringValue: digestType.String() + \":\" + hex.EncodeToString(casDigest.Value()),\n\t}\n}\n\nfunc (d *digest) Type() DigestType {\n\treturn d.digestType\n}\n\nfunc (d *digest) Value() []byte {\n\treturn d.casDigest.Value()\n}\n\nfunc (d *digest) String() string {\n\treturn d.stringValue\n}\n\nfunc (*digest) isDigest() {}\n\n// getO1Digest returns the O1 digest for the given PolicyConfig.\nfunc getO1Digest(policyConfig PolicyConfig) (Digest, error) {\n\tpolicyDataJSON, err := marshalPolicyConfigAsJSON(policyConfig)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcasDigest, err := cas.NewDigestForContent(bytes.NewReader(policyDataJSON))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewDigest(DigestTypeO1, casDigest)\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/digest_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"testing\"\n\n\t\"buf.build/go/bufplugin/option\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestO1Digest(t *testing.T) {\n\tt.Parallel()\n\tlintConfig, err := newLintConfig(\n\t\t[]string{\"LINT_ID_1\", \"LINT_ID_2\"},\n\t\t[]string{},\n\t\t\"enumZeroValueSuffix\",\n\t\ttrue,\n\t\ttrue,\n\t\ttrue,\n\t\t\"serviceSuffix\",\n\t\tfalse,\n\t)\n\trequire.NoError(t, err)\n\tbreakingConfig, err := newBreakingConfig(\n\t\t[]string{\"BREAKING_ID_1\", \"BREAKING_ID_2\"},\n\t\tnil,\n\t\ttrue,\n\t\tfalse,\n\t)\n\trequire.NoError(t, err)\n\tpolicyConfig, err := newPolicyConfig(lintConfig, breakingConfig, nil)\n\trequire.NoError(t, err)\n\n\tconst policyConfigDigest = \"o1:960327c2f0e3382b3e2caee5a5b8043b7a17287e82dc06a5c3a5ed76773e8622c18ddeead96bb5abe44b340965b49103462f4e5a1c11dbd05d1188d9afd7cff8\"\n\ttestPolicyConfigO1Digest(\n\t\tt,\n\t\tpolicyConfig,\n\t\tpolicyConfigDigest,\n\t)\n\n\t// Add a remote plugin config.\n\toptions, err := option.NewOptions(map[string]any{\n\t\t\"a\": \"b\",\n\t\t\"c\": 3,\n\t\t\"d\": 1.2,\n\t\t\"e\": []string{\"a\", \"b\", \"c\"},\n\t})\n\trequire.NoError(t, err)\n\targs := []string{\"arg1\", \"arg2\"}\n\tremotePluginRef, err := bufparse.NewRef(\"buf.build\", \"acme\", \"my-plugin\", \"v1.0.0\")\n\trequire.NoError(t, err)\n\tpluginConfig1, err := newPluginConfig(\n\t\tremotePluginRef.String(),\n\t\tremotePluginRef,\n\t\toptions,\n\t\targs,\n\t)\n\trequire.NoError(t, err)\n\n\tpolicyConfig, err = newPolicyConfig(lintConfig, breakingConfig, []PluginConfig{pluginConfig1})\n\trequire.NoError(t, err)\n\ttestPolicyConfigO1Digest(\n\t\tt,\n\t\tpolicyConfig,\n\t\t\"o1:dee43e33da2570aa194ab5a3abe427c0c98012690bebe4e70540fb520e096a9a84b2272b3df85eeebf39d8f839b671d466517639a2495e325d619c1a9fe4eda3\",\n\t)\n\n\tremotePluginRef2, err := bufparse.NewRef(\"buf.build\", \"acme\", \"a-plugin\", \"\")\n\trequire.NoError(t, err)\n\tpluginConfig2, err := newPluginConfig(\n\t\tremotePluginRef2.String(),\n\t\tremotePluginRef2,\n\t\toptions,\n\t\targs,\n\t)\n\trequire.NoError(t, err)\n\n\t// We should get the same digest regardless of the order of the remote plugins.\n\tconst multiPluginDigest = \"o1:d2c302094a3884a7e6afef19e774ce814308dcc0c52e3ad8f5e0ff6b5b7ec412cc61a93a39063db7418d6f7965ac7800bb41cc4f7d6eca6ac7dd5a0ee786fc70\"\n\tpolicyConfig2, err := newPolicyConfig(lintConfig, breakingConfig, []PluginConfig{pluginConfig2, pluginConfig1})\n\trequire.NoError(t, err)\n\tpolicyConfig3, err := newPolicyConfig(lintConfig, breakingConfig, []PluginConfig{pluginConfig1, pluginConfig2})\n\trequire.NoError(t, err)\n\ttestPolicyConfigO1Digest(t, policyConfig2, multiPluginDigest)\n\ttestPolicyConfigO1Digest(t, policyConfig3, multiPluginDigest)\n\n\t// Check the new added disable_builtin affects the digest.\n\tlintConfigDisableBuiltin, err := newLintConfig(\n\t\tlintConfig.UseIDsAndCategories(),\n\t\tlintConfig.ExceptIDsAndCategories(),\n\t\tlintConfig.EnumZeroValueSuffix(),\n\t\tlintConfig.RPCAllowSameRequestResponse(),\n\t\tlintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\tlintConfig.RPCAllowGoogleProtobufEmptyResponses(),\n\t\tlintConfig.ServiceSuffix(),\n\t\ttrue, // Disable builtin\n\t)\n\trequire.NoError(t, err)\n\tbreakingConfigDisableBuiltin, err := newBreakingConfig(\n\t\tbreakingConfig.UseIDsAndCategories(),\n\t\tbreakingConfig.ExceptIDsAndCategories(),\n\t\tbreakingConfig.IgnoreUnstablePackages(),\n\t\ttrue, // Disable builtin\n\t)\n\trequire.NoError(t, err)\n\t// The digest should change if we disable builtins, for lint.\n\tpolicyConfigLintDisableBuiltin, err := newPolicyConfig(lintConfigDisableBuiltin, breakingConfig, nil)\n\trequire.NoError(t, err)\n\tconst lintDisableBuiltinDigest = \"o1:35ecbf9c4da28e11314d548096722d6fccb41a8f0e7e05c8624d7b137cf55a6113070ad74b82b6d9abf59a6850b18aeb6dacee07d309ba36b4092f6c17720ac1\"\n\tassert.NotEqual(t, lintDisableBuiltinDigest, policyConfigDigest)\n\ttestPolicyConfigO1Digest(t, policyConfigLintDisableBuiltin, lintDisableBuiltinDigest)\n\t// And disable for breaking.\n\tpolicyConfigBreakingDisableBuiltin, err := newPolicyConfig(lintConfig, breakingConfigDisableBuiltin, nil)\n\trequire.NoError(t, err)\n\tconst breakingDisableBuiltinDigest = \"o1:b2ab151374efa2df978583cbc8615f0fc601ed12998a3dcf1acb389712869adea57fdb7776c72e2ed0b03742913be80c14dde68b42fece8b6cf5484ed6c42338\"\n\tassert.NotEqual(t, lintDisableBuiltinDigest, policyConfigDigest)\n\ttestPolicyConfigO1Digest(t, policyConfigBreakingDisableBuiltin, breakingDisableBuiltinDigest)\n\t// And disable both.\n\tpolicyConfigBothDisableBuiltin, err := newPolicyConfig(lintConfigDisableBuiltin, breakingConfigDisableBuiltin, nil)\n\trequire.NoError(t, err)\n\tconst bothDisableBuiltinDigest = \"o1:8588a08057e59f9b446efe60b7b782397acd37d87fa13734793b5d05c414b7e8569459b993217895e34f7985ad8ed2283fa03900b6d4a7b86789521408d13715\"\n\tassert.NotEqual(t, bothDisableBuiltinDigest, lintDisableBuiltinDigest)\n\tassert.NotEqual(t, bothDisableBuiltinDigest, breakingDisableBuiltinDigest)\n\tassert.NotEqual(t, bothDisableBuiltinDigest, policyConfigDigest)\n\ttestPolicyConfigO1Digest(t, policyConfigBothDisableBuiltin, bothDisableBuiltinDigest)\n}\n\nfunc testPolicyConfigO1Digest(t *testing.T, policyConfig PolicyConfig, expectDigest string) {\n\tdigestFromPolicyConfig, err := getO1Digest(policyConfig)\n\trequire.NoError(t, err)\n\texpectedDigest, err := ParseDigest(expectDigest)\n\trequire.NoError(t, err)\n\tassert.True(t, DigestEqual(expectedDigest, digestFromPolicyConfig), \"Digest mismatch, expected %q got %q\", expectedDigest.String(), digestFromPolicyConfig.String())\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// DigestMismatchError is the error returned if the Digest of a downloaded Policy\n// does not match the expected digest in a buf.lock file.\ntype DigestMismatchError struct {\n\tFullName       bufparse.FullName\n\tCommitID       uuid.UUID\n\tExpectedDigest Digest\n\tActualDigest   Digest\n}\n\n// Error implements the error interface.\nfunc (m *DigestMismatchError) Error() string {\n\tif m == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t_, _ = builder.WriteString(`*** Digest verification failed`)\n\tif m.FullName != nil {\n\t\t_, _ = builder.WriteString(` for \"`)\n\t\t_, _ = builder.WriteString(m.FullName.String())\n\t\tif m.CommitID != uuid.Nil {\n\t\t\t_, _ = builder.WriteString(`:`)\n\t\t\t_, _ = builder.WriteString(uuidutil.ToDashless(m.CommitID))\n\t\t}\n\t\t_, _ = builder.WriteString(`\"`)\n\t}\n\t_, _ = builder.WriteString(` ***`)\n\t_, _ = builder.WriteString(\"\\n\")\n\tif m.ExpectedDigest != nil && m.ActualDigest != nil {\n\t\t_, _ = builder.WriteString(\"\\t\")\n\t\t_, _ = builder.WriteString(`Expected digest (from buf.lock): \"`)\n\t\t_, _ = builder.WriteString(m.ExpectedDigest.String())\n\t\t_, _ = builder.WriteString(`\"`)\n\t\t_, _ = builder.WriteString(\"\\n\")\n\t\t_, _ = builder.WriteString(\"\\t\")\n\t\t_, _ = builder.WriteString(`Actual digest: \"`)\n\t\t_, _ = builder.WriteString(m.ActualDigest.String())\n\t\t_, _ = builder.WriteString(`\"`)\n\t\t_, _ = builder.WriteString(\"\\n\")\n\t}\n\t_, _ = builder.WriteString(\"\\t\")\n\t_, _ = builder.WriteString(`This may be the result of a hand-edited or corrupted buf.lock file, a corrupted local cache, and/or an attack.`)\n\t_, _ = builder.WriteString(\"\\n\")\n\t_, _ = builder.WriteString(\"\\t\")\n\t_, _ = builder.WriteString(`To clear your local cache, run \"buf registry cc\".`)\n\treturn builder.String()\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/google/uuid\"\n)\n\n// Policy presents a BSR policy.\ntype Policy interface {\n\t// OpaqueID returns an unstructured ID that can uniquely identify a Policy\n\t// relative to the Workspace.\n\t//\n\t// An OpaqueID's structure should not be relied upon, and is not a\n\t// globally-unique identifier. It's uniqueness property only applies to\n\t// the lifetime of the Policy, and only within the Workspace the Policy\n\t// is defined in.\n\t//\n\t// If two Policies have the same Name, they will have the same OpaqueID.\n\tOpaqueID() string\n\t// Name returns the name of the Policy.\n\t//  - For local Policies, this is the path to the policy yaml file.\n\t//  - For remote Policies, this is the FullName of the Policy in the form\n\t//    remote/owner/name.\n\t//\n\t// This is never empty.\n\tName() string\n\t// FullName returns the full name of the Policy.\n\t//\n\t// May be nil. Callers should not rely on this value being present.\n\t// However, this is always present for remote Policies.\n\t//\n\t// Use OpaqueID as an always-present identifier.\n\tFullName() bufparse.FullName\n\t// CommitID returns the BSR ID of the Commit.\n\t//\n\t// It is up to the caller to convert this to a dashless ID when necessary.\n\t//\n\t// May be empty, that is CommitID() == uuid.Nil may be true.\n\t// Callers should not rely on this value being present.\n\t//\n\t// If FullName is nil, this will always be empty.\n\tCommitID() uuid.UUID\n\t// Description returns a human-readable description of the Policy.\n\t//\n\t// This is used to construct descriptive error messages pointing to configured policies.\n\t//\n\t// This will never be empty. If a description was not explicitly set, this falls back to\n\t// OpaqueID.\n\tDescription() string\n\t// Digest returns the Policy digest for the given DigestType.\n\tDigest(DigestType) (Digest, error)\n\t// Config returns the PolicyConfig for the Policy.\n\tConfig() (PolicyConfig, error)\n\t// IsLocal return true if the Policy is a local Policy.\n\t//\n\t// Policies are either local or remote.\n\t//\n\t// A local Policy is one which was contained in the local context.\n\t//\n\t// A remote Policy is one which was not contained in the local context,\n\t// and is a remote reference to a Policy.\n\t//\n\t// Remote Policies will always have FullNames.\n\tIsLocal() bool\n\n\tisPolicy()\n}\n\n// NewPolicy creates a new Policy.\nfunc NewPolicy(\n\tdescription string,\n\tfullName bufparse.FullName,\n\tname string,\n\tcommitID uuid.UUID,\n\tgetConfig func() (PolicyConfig, error),\n) (Policy, error) {\n\treturn newPolicy(description, fullName, name, commitID, getConfig)\n}\n\n// *** PRIVATE ***\n\ntype policy struct {\n\tdescription           string\n\tfullName              bufparse.FullName\n\tname                  string\n\tcommitID              uuid.UUID\n\tgetConfig             func() (PolicyConfig, error)\n\tdigestTypeToGetDigest map[DigestType]func() (Digest, error)\n}\n\nfunc newPolicy(\n\tdescription string,\n\tfullName bufparse.FullName,\n\tname string,\n\tcommitID uuid.UUID,\n\tgetConfig func() (PolicyConfig, error),\n) (*policy, error) {\n\tif name == \"\" {\n\t\treturn nil, syserror.New(\"name not present when constructing a Policy\")\n\t}\n\tif fullName == nil && commitID != uuid.Nil {\n\t\treturn nil, syserror.New(\"commitID present when constructing a local Policy\")\n\t}\n\tpolicy := &policy{\n\t\tdescription: description,\n\t\tfullName:    fullName,\n\t\tname:        name,\n\t\tcommitID:    commitID,\n\t\tgetConfig:   sync.OnceValues(getConfig),\n\t}\n\tpolicy.digestTypeToGetDigest = newSyncOnceValueDigestTypeToGetDigestFuncForPolicy(policy)\n\treturn policy, nil\n}\n\nfunc (p *policy) OpaqueID() string {\n\treturn p.name\n}\n\nfunc (p *policy) Name() string {\n\treturn p.name\n}\n\nfunc (p *policy) FullName() bufparse.FullName {\n\treturn p.fullName\n}\n\nfunc (p *policy) CommitID() uuid.UUID {\n\treturn p.commitID\n}\n\nfunc (p *policy) Description() string {\n\tif p.description != \"\" {\n\t\treturn p.description\n\t}\n\treturn p.OpaqueID()\n}\n\nfunc (p *policy) Config() (PolicyConfig, error) {\n\treturn p.getConfig()\n}\n\nfunc (p *policy) Digest(digestType DigestType) (Digest, error) {\n\tgetDigest, ok := p.digestTypeToGetDigest[digestType]\n\tif !ok {\n\t\treturn nil, syserror.Newf(\"DigestType %v was not in policy.digestTypeToGetDigest\", digestType)\n\t}\n\treturn getDigest()\n}\n\nfunc (p *policy) IsLocal() bool {\n\treturn p.commitID == uuid.Nil\n}\n\nfunc (p *policy) isPolicy() {}\n\nfunc newSyncOnceValueDigestTypeToGetDigestFuncForPolicy(policy *policy) map[DigestType]func() (Digest, error) {\n\tm := make(map[DigestType]func() (Digest, error))\n\tfor digestType := range digestTypeToString {\n\t\tm[digestType] = sync.OnceValues(newGetDigestFuncForPolicyAndDigestType(policy, digestType))\n\t}\n\treturn m\n}\n\nfunc newGetDigestFuncForPolicyAndDigestType(policy *policy, digestType DigestType) func() (Digest, error) {\n\treturn func() (Digest, error) {\n\t\tswitch digestType {\n\t\tcase DigestTypeO1:\n\t\t\tpolicyConfig, err := policy.getConfig()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn getO1Digest(policyConfig)\n\t\tdefault:\n\t\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestType)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\n\tpluginoptionv1 \"buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go/buf/plugin/option/v1\"\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"buf.build/go/bufplugin/option\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// PolicyConfig is the configuration for a Policy.\ntype PolicyConfig interface {\n\t// LintConfig returns the LintConfig for the Policy.\n\tLintConfig() LintConfig\n\t// BreakingConfig returns the BreakingConfig for the Policy.\n\tBreakingConfig() BreakingConfig\n\t// PluginConfigs returns an iterator over PluginConfig for the Policy.\n\t//\n\t// Sorted by plugin name.\n\tPluginConfigs() []PluginConfig\n\n\tisPolicyConfig()\n}\n\n// LintConfig is the configuration for a Policy Lint.\ntype LintConfig interface {\n\t// The list of check rules and/or categories used for the Policy.\n\t//\n\t// Sorted.\n\tUseIDsAndCategories() []string\n\t// The list of check rules and/or categories to exclude for the Policy.\n\t//\n\t// Sorted.\n\tExceptIDsAndCategories() []string\n\t// EnumZeroValueSuffix returns the suffix that controls the behavior of the\n\t// ENUM_ZERO_VALUE_SUFFIX lint rule. By default, this rule verifies that the zero value of all\n\t// enums ends in `_UNSPECIFIED`, however, this allows organizations to choose a different\n\t// suffix.\n\tEnumZeroValueSuffix() string\n\t// RPCAllowSameRequestResponse returns true to allow the same message type to be used for a\n\t// single RPC's request and response type.\n\tRPCAllowSameRequestResponse() bool\n\t// RPCAllowGoogleProtobufEmptyRequests returns true to allow RPC requests to be\n\t// google.protobuf.Empty messages.\n\tRPCAllowGoogleProtobufEmptyRequests() bool\n\t// RPCAllowGoogleProtobufEmptyResponses returns true to allow RPC responses to be\n\t// google.protobuf.Empty messages.\n\tRPCAllowGoogleProtobufEmptyResponses() bool\n\t// ServiceSuffix returns the suffix that controls the behavior of the SERVICE_SUFFIX lint rule.\n\t// By default, this rule verifies that all service names are suffixed with `Service`, however\n\t// this allows organizations to choose a different suffix.\n\tServiceSuffix() string\n\t// DisableBuiltin says to disable the Rules and Categories builtin to the Buf CLI and only\n\t// use plugins.\n\t//\n\t// This will make it as if these rules did not exist.\n\tDisableBuiltin() bool\n\n\tisLintConfig()\n}\n\n// BreakingConfig is the configuration for a Policy Breaking.\ntype BreakingConfig interface {\n\t// The list of check rules and/or categories used for the Policy.\n\t//\n\t// Sorted.\n\tUseIDsAndCategories() []string\n\t// The list of check rules and/or categories to exclude for the Policy.\n\t//\n\t// Sorted.\n\tExceptIDsAndCategories() []string\n\t// IgnoreUnstablePackages returns true if unstable packages should be ignored:\n\t//   - v\\d+test.*\n\t//   - v\\d+(alpha|beta)\\d*\n\t//   - v\\d+p\\d+(alpha|beta)\\d*\n\tIgnoreUnstablePackages() bool\n\t// DisableBuiltin says to disable the Rules and Categories builtin to the Buf CLI and only\n\t// use plugins.\n\t//\n\t// This will make it as if these rules did not exist.\n\tDisableBuiltin() bool\n\n\tisBreakingConfig()\n}\n\n// PluginConfig is a configuration for a Policy Plugin.\ntype PluginConfig interface {\n\t// Name returns the name of the plugin.\n\tName() string\n\t// Ref returns the reference to the plugin, may be nil.\n\tRef() bufparse.Ref\n\t// Options returns the options for the plugin, which may be empty.\n\tOptions() option.Options\n\t// Args returns the arguments for the plugin, which may be empty.\n\tArgs() []string\n\n\tisPluginConfig()\n}\n\n// NewPolicyConfig creates a new PolicyConfig.\nfunc NewPolicyConfig(\n\tlintConfig LintConfig,\n\tbreakingConfig BreakingConfig,\n\tpluginConfigs []PluginConfig,\n) (PolicyConfig, error) {\n\treturn newPolicyConfig(\n\t\tlintConfig,\n\t\tbreakingConfig,\n\t\tpluginConfigs,\n\t)\n}\n\n// NewLintConfig creates a new LintConfig.\nfunc NewLintConfig(\n\tuse []string,\n\texcept []string,\n\tenumZeroValueSuffix string,\n\trpcAllowSameRequestResponse bool,\n\trpcAllowGoogleProtobufEmptyRequests bool,\n\trpcAllowGoogleProtobufEmptyResponses bool,\n\tserviceSuffix string,\n\tdisableBuiltin bool,\n) (LintConfig, error) {\n\treturn newLintConfig(\n\t\tuse,\n\t\texcept,\n\t\tenumZeroValueSuffix,\n\t\trpcAllowSameRequestResponse,\n\t\trpcAllowGoogleProtobufEmptyRequests,\n\t\trpcAllowGoogleProtobufEmptyResponses,\n\t\tserviceSuffix,\n\t\tdisableBuiltin,\n\t)\n}\n\n// NewBreakingConfig creates a new BreakingConfig.\nfunc NewBreakingConfig(\n\tuse []string,\n\texcept []string,\n\tignoreUnstablePackages bool,\n\tdisableBuiltin bool,\n) (BreakingConfig, error) {\n\treturn newBreakingConfig(\n\t\tuse,\n\t\texcept,\n\t\tignoreUnstablePackages,\n\t\tdisableBuiltin,\n\t)\n}\n\n// NewPluginConfig creates a new PluginConfig.\nfunc NewPluginConfig(\n\tname string,\n\tref bufparse.Ref,\n\toptions option.Options,\n\targs []string,\n) (PluginConfig, error) {\n\treturn newPluginConfig(\n\t\tname,\n\t\tref,\n\t\toptions,\n\t\targs,\n\t)\n}\n\n// MarshalPolicyConfigAsJSON marshals the PolicyConfig to a stable JSON representation.\n//\n// It is a valid JSON encoding of the type buf.registry.policy.v1beta1.PolicyConfig.\n// This is used to calculate the O1 digest.\nfunc MarshalPolicyConfigAsJSON(policyConfig PolicyConfig) ([]byte, error) {\n\treturn marshalPolicyConfigAsJSON(policyConfig)\n}\n\n// UnmarshalJSONPolicyConfig unmarshals the given JSON data into a PolicyConfig.\n//\n// Data is a valid JSON encoding of the type buf.registry.policy.v1beta1.PolicyConfig.\nfunc UnmarshalJSONPolicyConfig(registry string, data []byte) (PolicyConfig, error) {\n\treturn unmarshalJSONPolicyConfig(registry, data)\n}\n\n// *** PRIVATE ***\n\ntype policyConfig struct {\n\tlintConfig     LintConfig\n\tbreakingConfig BreakingConfig\n\tpluginConfigs  []PluginConfig\n}\n\nfunc newPolicyConfig(\n\tlintConfig LintConfig,\n\tbreakingConfig BreakingConfig,\n\tpluginConfigs []PluginConfig,\n) (PolicyConfig, error) {\n\tpluginConfigs = slices.Clone(pluginConfigs)\n\tsort.Slice(pluginConfigs, func(i, j int) bool {\n\t\treturn pluginConfigs[i].Name() < pluginConfigs[j].Name()\n\t})\n\tvar registry string\n\tfor _, pluginConfig := range pluginConfigs {\n\t\tref := pluginConfig.Ref()\n\t\tif ref == nil {\n\t\t\tcontinue // Local plugin, no need to validate.\n\t\t}\n\t\tif ref.FullName().Registry() == \"\" {\n\t\t\treturn nil, syserror.Newf(\"plugin config %q must have a non-empty registry\", pluginConfig.Name())\n\t\t}\n\t\tif registry != \"\" && ref.FullName().Registry() != registry {\n\t\t\treturn nil, fmt.Errorf(\"all plugin configs must have the same registry, got %q and %q\", registry, ref.FullName().Registry())\n\t\t}\n\t}\n\treturn &policyConfig{\n\t\tlintConfig:     lintConfig,\n\t\tbreakingConfig: breakingConfig,\n\t\tpluginConfigs:  pluginConfigs,\n\t}, nil\n}\n\nfunc (p *policyConfig) LintConfig() LintConfig         { return p.lintConfig }\nfunc (p *policyConfig) BreakingConfig() BreakingConfig { return p.breakingConfig }\nfunc (p *policyConfig) PluginConfigs() []PluginConfig  { return slices.Clone(p.pluginConfigs) }\nfunc (p *policyConfig) isPolicyConfig()                {}\n\ntype lintConfig struct {\n\tuse                                  []string\n\texcept                               []string\n\tenumZeroValueSuffix                  string\n\trpcAllowSameRequestResponse          bool\n\trpcAllowGoogleProtobufEmptyRequests  bool\n\trpcAllowGoogleProtobufEmptyResponses bool\n\tserviceSuffix                        string\n\tdisableBuiltin                       bool\n}\n\nfunc newLintConfig(\n\tuse []string,\n\texcept []string,\n\tenumZeroValueSuffix string,\n\trpcAllowSameRequestResponse bool,\n\trpcAllowGoogleProtobufEmptyRequests bool,\n\trpcAllowGoogleProtobufEmptyResponses bool,\n\tserviceSuffix string,\n\tdisableBuiltin bool,\n) (*lintConfig, error) {\n\tuse = slices.Clone(use)\n\tsort.Strings(use)\n\texcept = slices.Clone(except)\n\tsort.Strings(except)\n\treturn &lintConfig{\n\t\tuse:                                  use,\n\t\texcept:                               except,\n\t\tenumZeroValueSuffix:                  enumZeroValueSuffix,\n\t\trpcAllowSameRequestResponse:          rpcAllowSameRequestResponse,\n\t\trpcAllowGoogleProtobufEmptyRequests:  rpcAllowGoogleProtobufEmptyRequests,\n\t\trpcAllowGoogleProtobufEmptyResponses: rpcAllowGoogleProtobufEmptyResponses,\n\t\tserviceSuffix:                        serviceSuffix,\n\t\tdisableBuiltin:                       disableBuiltin,\n\t}, nil\n}\n\nfunc (c *lintConfig) UseIDsAndCategories() []string     { return slices.Clone(c.use) }\nfunc (c *lintConfig) ExceptIDsAndCategories() []string  { return slices.Clone(c.except) }\nfunc (c *lintConfig) EnumZeroValueSuffix() string       { return c.enumZeroValueSuffix }\nfunc (c *lintConfig) RPCAllowSameRequestResponse() bool { return c.rpcAllowSameRequestResponse }\nfunc (c *lintConfig) RPCAllowGoogleProtobufEmptyRequests() bool {\n\treturn c.rpcAllowGoogleProtobufEmptyRequests\n}\nfunc (c *lintConfig) RPCAllowGoogleProtobufEmptyResponses() bool {\n\treturn c.rpcAllowGoogleProtobufEmptyResponses\n}\nfunc (c *lintConfig) ServiceSuffix() string { return c.serviceSuffix }\nfunc (c *lintConfig) DisableBuiltin() bool  { return c.disableBuiltin }\nfunc (c *lintConfig) isLintConfig()         {}\n\ntype breakingConfig struct {\n\tuse                    []string\n\texcept                 []string\n\tignoreUnstablePackages bool\n\tdisableBuiltin         bool\n}\n\nfunc newBreakingConfig(\n\tuse []string,\n\texcept []string,\n\tignoreUnstablePackages bool,\n\tdisableBuiltin bool,\n) (*breakingConfig, error) {\n\tuse = slices.Clone(use)\n\tsort.Strings(use)\n\texcept = slices.Clone(except)\n\tsort.Strings(except)\n\treturn &breakingConfig{\n\t\tuse:                    use,\n\t\texcept:                 except,\n\t\tignoreUnstablePackages: ignoreUnstablePackages,\n\t\tdisableBuiltin:         disableBuiltin,\n\t}, nil\n}\n\nfunc (c *breakingConfig) UseIDsAndCategories() []string    { return slices.Clone(c.use) }\nfunc (c *breakingConfig) ExceptIDsAndCategories() []string { return slices.Clone(c.except) }\nfunc (c *breakingConfig) IgnoreUnstablePackages() bool     { return c.ignoreUnstablePackages }\nfunc (c *breakingConfig) DisableBuiltin() bool             { return c.disableBuiltin }\nfunc (c *breakingConfig) isBreakingConfig()                {}\n\ntype pluginConfig struct {\n\tname    string\n\tref     bufparse.Ref\n\toptions option.Options\n\targs    []string\n}\n\nfunc newPluginConfig(\n\tname string,\n\tref bufparse.Ref,\n\toptions option.Options,\n\targs []string,\n) (*pluginConfig, error) {\n\treturn &pluginConfig{\n\t\tname:    name,\n\t\tref:     ref,\n\t\toptions: options,\n\t\targs:    args,\n\t}, nil\n}\n\nfunc (p *pluginConfig) Name() string            { return p.name }\nfunc (p *pluginConfig) Ref() bufparse.Ref       { return p.ref }\nfunc (p *pluginConfig) Options() option.Options { return p.options }\nfunc (p *pluginConfig) Args() []string          { return slices.Clone(p.args) }\nfunc (p *pluginConfig) isPluginConfig()         {}\n\nfunc marshalPolicyConfigAsJSON(policyConfig PolicyConfig) ([]byte, error) {\n\tvar lintConfigV1Beta1 *policyV1Beta1PolicyConfig_LintConfig\n\tif lintConfig := policyConfig.LintConfig(); lintConfig != nil {\n\t\tlintConfigV1Beta1 = &policyV1Beta1PolicyConfig_LintConfig{\n\t\t\tUse:                                  lintConfig.UseIDsAndCategories(),\n\t\t\tExcept:                               lintConfig.ExceptIDsAndCategories(),\n\t\t\tEnumZeroValueSuffix:                  lintConfig.EnumZeroValueSuffix(),\n\t\t\tRpcAllowSameRequestResponse:          lintConfig.RPCAllowSameRequestResponse(),\n\t\t\tRpcAllowGoogleProtobufEmptyRequests:  lintConfig.RPCAllowGoogleProtobufEmptyRequests(),\n\t\t\tRpcAllowGoogleProtobufEmptyResponses: lintConfig.RPCAllowGoogleProtobufEmptyResponses(),\n\t\t\tServiceSuffix:                        lintConfig.ServiceSuffix(),\n\t\t\tDisableBuiltin:                       lintConfig.DisableBuiltin(),\n\t\t}\n\t}\n\tvar breakingConfigV1Beta1 *policyV1Beta1PolicyConfig_BreakingConfig\n\tif breakingConfig := policyConfig.BreakingConfig(); breakingConfig != nil {\n\t\tbreakingConfigV1Beta1 = &policyV1Beta1PolicyConfig_BreakingConfig{\n\t\t\tUse:                    breakingConfig.UseIDsAndCategories(),\n\t\t\tExcept:                 breakingConfig.ExceptIDsAndCategories(),\n\t\t\tIgnoreUnstablePackages: breakingConfig.IgnoreUnstablePackages(),\n\t\t\tDisableBuiltin:         breakingConfig.DisableBuiltin(),\n\t\t}\n\t}\n\tpluginConfigs, err := xslices.MapError(policyConfig.PluginConfigs(), func(pluginConfig PluginConfig) (*policyV1Beta1PolicyConfig_PluginConfig, error) {\n\t\tref := pluginConfig.Ref()\n\t\tif ref == nil {\n\t\t\treturn nil, fmt.Errorf(\"PluginConfig must have a non-nil Ref\")\n\t\t}\n\t\toptionsConfig, err := optionsToOptionConfig(pluginConfig.Options())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &policyV1Beta1PolicyConfig_PluginConfig{\n\t\t\tName: policyV1Beta1PolicyConfig_PluginConfig_Name{\n\t\t\t\tOwner:  ref.FullName().Owner(),\n\t\t\t\tPlugin: ref.FullName().Name(),\n\t\t\t\tRef:    ref.Ref(),\n\t\t\t},\n\t\t\tOptions: optionsConfig,\n\t\t\tArgs:    pluginConfig.Args(),\n\t\t}, nil\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to convert plugin configs: %w\", err)\n\t}\n\tslices.SortFunc(pluginConfigs, func(a, b *policyV1Beta1PolicyConfig_PluginConfig) int {\n\t\t// Sort by owner, plugin, and ref.\n\t\treturn strings.Compare(\n\t\t\tfmt.Sprintf(\"%s/%s:%s\", a.Name.Owner, a.Name.Plugin, a.Name.Ref),\n\t\t\tfmt.Sprintf(\"%s/%s:%s\", b.Name.Owner, b.Name.Plugin, b.Name.Ref),\n\t\t)\n\t})\n\tconfig := policyV1Beta1PolicyConfig{\n\t\tLint:     lintConfigV1Beta1,\n\t\tBreaking: breakingConfigV1Beta1,\n\t\tPlugins:  pluginConfigs,\n\t}\n\tdata, err := json.Marshal(config)\n\tif err != nil {\n\t\treturn nil, syserror.Newf(\"failed to marshal PolicyConfig as JSON: %w\", err)\n\t}\n\t// Assert the data is a valid JSON representation of the type\n\t// buf.registry.policy.v1beta1.PolicyConfig.\n\tvar policyConfigProto policyv1beta1.PolicyConfig\n\tif err := protoencoding.NewJSONUnmarshaler(nil, protoencoding.JSONUnmarshalerWithDisallowUnknown()).Unmarshal(data, &policyConfigProto); err != nil {\n\t\treturn nil, syserror.Newf(\"not a valid JSON representation of type buf.registry.policy.v1beta1.PolicyConfig: %w\", err)\n\t}\n\treturn data, nil\n}\n\nfunc unmarshalJSONPolicyConfig(registry string, data []byte) (PolicyConfig, error) {\n\tvar policyConfigV1Beta1 policyv1beta1.PolicyConfig\n\tif err := protoencoding.NewJSONUnmarshaler(nil, protoencoding.JSONUnmarshalerWithDisallowUnknown()).Unmarshal(data, &policyConfigV1Beta1); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to unmarshal JSON as PolicyConfig: %w\", err)\n\t}\n\tlintConfigV1Beta1 := policyConfigV1Beta1.GetLint()\n\tlintConfig, err := newLintConfig(\n\t\tlintConfigV1Beta1.GetUse(),\n\t\tlintConfigV1Beta1.GetExcept(),\n\t\tlintConfigV1Beta1.GetEnumZeroValueSuffix(),\n\t\tlintConfigV1Beta1.GetRpcAllowSameRequestResponse(),\n\t\tlintConfigV1Beta1.GetRpcAllowGoogleProtobufEmptyRequests(),\n\t\tlintConfigV1Beta1.GetRpcAllowGoogleProtobufEmptyResponses(),\n\t\tlintConfigV1Beta1.GetServiceSuffix(),\n\t\tlintConfigV1Beta1.GetDisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbreakingConfigV1Beta1 := policyConfigV1Beta1.GetBreaking()\n\tbreakingConfig, err := newBreakingConfig(\n\t\tbreakingConfigV1Beta1.GetUse(),\n\t\tbreakingConfigV1Beta1.GetExcept(),\n\t\tbreakingConfigV1Beta1.GetIgnoreUnstablePackages(),\n\t\tbreakingConfigV1Beta1.GetDisableBuiltin(),\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginConfigs, err := xslices.MapError(\n\t\tpolicyConfigV1Beta1.GetPlugins(),\n\t\tfunc(pluginConfigV1Beta1 *policyv1beta1.PolicyConfig_CheckPluginConfig) (PluginConfig, error) {\n\t\t\tnameV1Beta1 := pluginConfigV1Beta1.GetName()\n\t\t\tpluginRef, err := bufparse.NewRef(\n\t\t\t\tregistry,\n\t\t\t\tnameV1Beta1.GetOwner(),\n\t\t\t\tnameV1Beta1.GetPlugin(),\n\t\t\t\tnameV1Beta1.GetRef(),\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpluginOptions, err := option.OptionsForProtoOptions(pluginConfigV1Beta1.GetOptions())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treturn newPluginConfig(\n\t\t\t\tnameV1Beta1.String(),\n\t\t\t\tpluginRef,\n\t\t\t\tpluginOptions,\n\t\t\t\tpluginConfigV1Beta1.GetArgs(),\n\t\t\t)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newPolicyConfig(\n\t\tlintConfig,\n\t\tbreakingConfig,\n\t\tpluginConfigs,\n\t)\n}\n\n// policyV1Beta1PolicyConfig is a stable JSON representation of the buf.registry.policy.v1beta1.PolicyConfig.\ntype policyV1Beta1PolicyConfig struct {\n\tLint     *policyV1Beta1PolicyConfig_LintConfig     `json:\"lint,omitempty\"`\n\tBreaking *policyV1Beta1PolicyConfig_BreakingConfig `json:\"breaking,omitempty\"`\n\tPlugins  []*policyV1Beta1PolicyConfig_PluginConfig `json:\"plugins,omitempty\"`\n}\n\n// policyV1Beta1PolicyConfig_LintConfig is a stable JSON representation of the buf.registry.policy.v1beta1.PolicyConfig.LintConfig.\ntype policyV1Beta1PolicyConfig_LintConfig struct {\n\tUse                                  []string `json:\"use,omitempty\"`\n\tExcept                               []string `json:\"except,omitempty\"`\n\tEnumZeroValueSuffix                  string   `json:\"enumZeroValueSuffix,omitempty\"`\n\tRpcAllowSameRequestResponse          bool     `json:\"rpcAllowSameRequestResponse,omitempty\"`\n\tRpcAllowGoogleProtobufEmptyRequests  bool     `json:\"rpcAllowGoogleProtobufEmptyRequests,omitempty\"`\n\tRpcAllowGoogleProtobufEmptyResponses bool     `json:\"rpcAllowGoogleProtobufEmptyResponses,omitempty\"`\n\tServiceSuffix                        string   `json:\"serviceSuffix,omitempty\"`\n\tDisableBuiltin                       bool     `json:\"disableBuiltin,omitempty\"`\n}\n\n// policyV1Beta1PolicyConfig_BreakingConfig is a stable JSON representation of the buf.registry.policy.v1beta1.PolicyConfig.BreakingConfig.\ntype policyV1Beta1PolicyConfig_BreakingConfig struct {\n\tUse                    []string `json:\"use,omitempty\"`\n\tExcept                 []string `json:\"except,omitempty\"`\n\tIgnoreUnstablePackages bool     `json:\"ignoreUnstablePackages,omitempty\"`\n\tDisableBuiltin         bool     `json:\"disableBuiltin,omitempty\"`\n}\n\n// policyV1Beta1PolicyConfig_PluginConfig is a stable JSON representation of the buf.registry.policy.v1beta1.PolicyConfig.PluginConfig.\ntype policyV1Beta1PolicyConfig_PluginConfig struct {\n\tName    policyV1Beta1PolicyConfig_PluginConfig_Name `json:\"name\"`\n\tOptions []*optionV1Option                           `json:\"options,omitempty\"`\n\tArgs    []string                                    `json:\"args,omitempty\"`\n}\n\n// policyV1Beta1PolicyConfig_PluginConfig_Name is a stable JSON representation of the buf.registry.policy.v1beta1.PolicyConfig.PluginConfig.Name.\ntype policyV1Beta1PolicyConfig_PluginConfig_Name struct {\n\tOwner  string `json:\"owner,omitempty\"`\n\tPlugin string `json:\"plugin,omitempty\"`\n\tRef    string `json:\"ref,omitempty\"`\n}\n\n// optionV1Option is a stable JSON representation of the buf.plugin.option.v1.Option.\ntype optionV1Option struct {\n\tKey   string         `json:\"key,omitempty\"`\n\tValue *optionV1Value `json:\"value,omitempty\"`\n}\n\n// optionV1Value is a stable JSON representation of the buf.plugin.option.v1.Value.\ntype optionV1Value struct {\n\tBoolValue   bool               `json:\"boolValue,omitempty\"`\n\tInt64Value  int64              `json:\"int64Value,omitempty\"`\n\tDoubleValue float64            `json:\"doubleValue,omitempty\"`\n\tStringValue string             `json:\"stringValue,omitempty\"`\n\tBytesValue  []byte             `json:\"bytesValue,omitempty\"`\n\tListValue   *optionV1ListValue `json:\"listValue,omitempty\"`\n}\n\n// optionV1ListValue is a stable JSON representation of the buf.plugin.option.v1.ListValue.\ntype optionV1ListValue struct {\n\tValues []*optionV1Value `json:\"values,omitempty\"`\n}\n\n// optionsToOptionsV1Options converts a set of options to a slice of optionV1Option.\nfunc optionsToOptionConfig(options option.Options) ([]*optionV1Option, error) {\n\toptionsProto, err := options.ToProto()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to convert options to proto: %w\", err)\n\t}\n\t// Sort the options by key to ensure a stable order.\n\tslices.SortFunc(optionsProto, func(a, b *pluginoptionv1.Option) int {\n\t\treturn strings.Compare(a.Key, b.Key)\n\t})\n\toptionsV1Options := make([]*optionV1Option, len(optionsProto))\n\tfor i, optionProto := range optionsProto {\n\t\toptionValue, err := optionV1ValueProtoToOptionValue(optionProto.Value)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to convert option value: %w\", err)\n\t\t}\n\t\toptionsV1Options[i] = &optionV1Option{\n\t\t\tKey:   optionProto.Key,\n\t\t\tValue: optionValue,\n\t\t}\n\t}\n\treturn optionsV1Options, nil\n}\n\nfunc optionV1ValueProtoToOptionValue(optionValue *pluginoptionv1.Value) (*optionV1Value, error) {\n\tif optionValue == nil {\n\t\treturn nil, nil\n\t}\n\tswitch optionValue.Type.(type) {\n\tcase *pluginoptionv1.Value_BoolValue:\n\t\treturn &optionV1Value{BoolValue: optionValue.GetBoolValue()}, nil\n\tcase *pluginoptionv1.Value_Int64Value:\n\t\treturn &optionV1Value{Int64Value: optionValue.GetInt64Value()}, nil\n\tcase *pluginoptionv1.Value_DoubleValue:\n\t\treturn &optionV1Value{DoubleValue: optionValue.GetDoubleValue()}, nil\n\tcase *pluginoptionv1.Value_StringValue:\n\t\treturn &optionV1Value{StringValue: optionValue.GetStringValue()}, nil\n\tcase *pluginoptionv1.Value_BytesValue:\n\t\treturn &optionV1Value{BytesValue: optionValue.GetBytesValue()}, nil\n\tcase *pluginoptionv1.Value_ListValue:\n\t\tlistValue, err := optionV1ListValueProtoToOptionListValue(optionValue.GetListValue())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &optionV1Value{ListValue: listValue}, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown option value type: %T\", optionValue.Type)\n\t}\n}\n\nfunc optionV1ListValueProtoToOptionListValue(listValue *pluginoptionv1.ListValue) (*optionV1ListValue, error) {\n\tif listValue == nil {\n\t\treturn nil, nil\n\t}\n\tvalues := make([]*optionV1Value, len(listValue.Values))\n\tfor i, value := range listValue.Values {\n\t\toptionValue, err := optionV1ValueProtoToOptionValue(value)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to convert option value: %w\", err)\n\t\t}\n\t\tvalues[i] = optionValue\n\t}\n\treturn &optionV1ListValue{Values: values}, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_config_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy_test\n\nimport (\n\t\"testing\"\n\n\toptionv1 \"buf.build/gen/go/bufbuild/bufplugin/protocolbuffers/go/buf/plugin/option/v1\"\n\tpolicyv1beta1 \"buf.build/gen/go/bufbuild/registry/protocolbuffers/go/buf/registry/policy/v1beta1\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufpolicy/bufpolicyapi\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n)\n\nfunc TestMarshalPolicyConfigAsJSON(t *testing.T) {\n\tt.Parallel()\n\n\ttestRoundTripPolicyConfigAsJSON(t, &policyv1beta1.PolicyConfig{\n\t\tLint: &policyv1beta1.PolicyConfig_LintConfig{\n\t\t\tDisableBuiltin: true,\n\t\t},\n\t\tBreaking: &policyv1beta1.PolicyConfig_BreakingConfig{\n\t\t\tDisableBuiltin: true,\n\t\t},\n\t})\n\ttestRoundTripPolicyConfigAsJSON(t, &policyv1beta1.PolicyConfig{\n\t\tLint: &policyv1beta1.PolicyConfig_LintConfig{\n\t\t\tUse:                                  []string{\"USE_ID\"},\n\t\t\tExcept:                               []string{\"EXCEPT_ID\"},\n\t\t\tEnumZeroValueSuffix:                  \"EnumZeroValue\",\n\t\t\tRpcAllowSameRequestResponse:          true,\n\t\t\tRpcAllowGoogleProtobufEmptyRequests:  true,\n\t\t\tRpcAllowGoogleProtobufEmptyResponses: true,\n\t\t\tServiceSuffix:                        \"ServiceSuffix\",\n\t\t},\n\t\tBreaking: &policyv1beta1.PolicyConfig_BreakingConfig{\n\t\t\tUse:                    []string{\"BREAKING_ID_1\", \"BREAKING_ID_2\"},\n\t\t\tExcept:                 []string{\"BREAKING_EXCEPT_ID\"},\n\t\t\tIgnoreUnstablePackages: true,\n\t\t},\n\t\t// Plugins are sorted by owner, plugin, and ref.\n\t\tPlugins: []*policyv1beta1.PolicyConfig_CheckPluginConfig{\n\t\t\t{\n\t\t\t\tName: &policyv1beta1.PolicyConfig_CheckPluginConfig_Name{\n\t\t\t\t\tOwner:  \"PluginOwner\",\n\t\t\t\t\tPlugin: \"PluginName\",\n\t\t\t\t\tRef:    \"PluginRef1\",\n\t\t\t\t},\n\t\t\t\t// Option keys are sorted in the JSON output.\n\t\t\t\tOptions: []*optionv1.Option{\n\t\t\t\t\t{\n\t\t\t\t\t\tKey: \"boolOption\",\n\t\t\t\t\t\tValue: &optionv1.Value{\n\t\t\t\t\t\t\tType: &optionv1.Value_BoolValue{\n\t\t\t\t\t\t\t\tBoolValue: 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\t{\n\t\t\t\t\t\tKey: \"bytesValue\",\n\t\t\t\t\t\tValue: &optionv1.Value{\n\t\t\t\t\t\t\tType: &optionv1.Value_BytesValue{\n\t\t\t\t\t\t\t\tBytesValue: []byte{0, 1, 2, 3, 4},\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\t{\n\t\t\t\t\t\tKey: \"doubleOption\",\n\t\t\t\t\t\tValue: &optionv1.Value{\n\t\t\t\t\t\t\tType: &optionv1.Value_DoubleValue{\n\t\t\t\t\t\t\t\tDoubleValue: 3.14159,\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\t{\n\t\t\t\t\t\tKey: \"int64Option\",\n\t\t\t\t\t\tValue: &optionv1.Value{\n\t\t\t\t\t\t\tType: &optionv1.Value_Int64Value{\n\t\t\t\t\t\t\t\tInt64Value: 1234567890,\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\t{\n\t\t\t\t\t\tKey: \"listOption\",\n\t\t\t\t\t\tValue: &optionv1.Value{\n\t\t\t\t\t\t\tType: &optionv1.Value_ListValue{\n\t\t\t\t\t\t\t\tListValue: &optionv1.ListValue{\n\t\t\t\t\t\t\t\t\tValues: []*optionv1.Value{\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tType: &optionv1.Value_StringValue{\n\t\t\t\t\t\t\t\t\t\t\t\tStringValue: \"listValue1\",\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\t{\n\t\t\t\t\t\t\t\t\t\t\tType: &optionv1.Value_StringValue{\n\t\t\t\t\t\t\t\t\t\t\t\tStringValue: \"listValue2\",\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},\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\t{\n\t\t\t\t\t\tKey: \"stringOption\",\n\t\t\t\t\t\tValue: &optionv1.Value{\n\t\t\t\t\t\t\tType: &optionv1.Value_StringValue{\n\t\t\t\t\t\t\t\tStringValue: \"value1\",\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\tArgs: []string{\"arg1\", \"arg2\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: &policyv1beta1.PolicyConfig_CheckPluginConfig_Name{\n\t\t\t\t\tOwner:  \"PluginOwner\",\n\t\t\t\t\tPlugin: \"PluginName\",\n\t\t\t\t\tRef:    \"PluginRef2\",\n\t\t\t\t},\n\t\t\t\tOptions: []*optionv1.Option{},\n\t\t\t\tArgs:    []string{\"arg1\", \"arg2\"},\n\t\t\t},\n\t\t},\n\t})\n}\n\nfunc testRoundTripPolicyConfigAsJSON(t *testing.T, policyConfigV1Beta1 *policyv1beta1.PolicyConfig) {\n\tconst registry = \"bufbuild.test\"\n\tpolicyConfig, err := bufpolicyapi.V1Beta1ProtoToPolicyConfig(registry, policyConfigV1Beta1)\n\trequire.NoError(t, err)\n\tdata, err := bufpolicy.MarshalPolicyConfigAsJSON(policyConfig)\n\trequire.NoError(t, err)\n\trequire.NotEmpty(t, data)\n\tvar policyConfigV1Beta1Copy policyv1beta1.PolicyConfig\n\trequire.NoError(t, protoencoding.NewJSONUnmarshaler(nil, protoencoding.JSONUnmarshalerWithDisallowUnknown()).Unmarshal(data, &policyConfigV1Beta1Copy))\n\tdiff := cmp.Diff(policyConfigV1Beta1, &policyConfigV1Beta1Copy, protocmp.Transform())\n\trequire.Empty(t, diff)\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_data.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"context\"\n\t\"sync\"\n)\n\n// PolicyData presents the raw Policy data read by PolicyKey.\n//\n// A PolicyData generally represents the data on a Policy read from the BSR API\n// or a cache.\n//\n// Tamper-proofing is done as part of every function.\ntype PolicyData interface {\n\t// PolicyKey used to download this PolicyData.\n\t//\n\t// The Digest from this PolicyKey is used for tamper-proofing. It will be checked\n\t// against the actual data downloaded before Data() returns.\n\tPolicyKey() PolicyKey\n\t// Config returns the PolicyConfig for the Policy.\n\tConfig() (PolicyConfig, error)\n\n\tisPolicyData()\n}\n\n// NewPolicyData returns a new PolicyData.\n//\n// getData is expected to be lazily-loaded function where possible.\nfunc NewPolicyData(\n\tctx context.Context,\n\tpolicyKey PolicyKey,\n\tgetConfig func() (PolicyConfig, error),\n) (PolicyData, error) {\n\treturn newPolicyData(\n\t\tctx,\n\t\tpolicyKey,\n\t\tgetConfig,\n\t)\n}\n\n// *** PRIVATE ***\n\ntype policyData struct {\n\tpolicyKey PolicyKey\n\tgetConfig func() (PolicyConfig, error)\n\n\tcheckDigest func() error\n}\n\nfunc newPolicyData(\n\tctx context.Context,\n\tpolicyKey PolicyKey,\n\tgetConfig func() (PolicyConfig, error),\n) (*policyData, error) {\n\tpolicyData := &policyData{\n\t\tpolicyKey: policyKey,\n\t\tgetConfig: getConfig,\n\t}\n\tpolicyData.checkDigest = sync.OnceValue(func() error {\n\t\tpolicyConfig, err := policyData.getConfig()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tactualDigest, err := getO1Digest(policyConfig)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\texpectedDigest, err := policyKey.Digest()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !DigestEqual(actualDigest, expectedDigest) {\n\t\t\treturn &DigestMismatchError{\n\t\t\t\tFullName:       policyKey.FullName(),\n\t\t\t\tCommitID:       policyKey.CommitID(),\n\t\t\t\tExpectedDigest: expectedDigest,\n\t\t\t\tActualDigest:   actualDigest,\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\treturn policyData, nil\n}\n\nfunc (p *policyData) PolicyKey() PolicyKey {\n\treturn p.policyKey\n}\n\nfunc (p *policyData) Config() (PolicyConfig, error) {\n\tif err := p.checkDigest(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn p.getConfig()\n}\n\nfunc (*policyData) isPolicyData() {}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n)\n\nvar (\n\t// NopPolicyDataProvider is a no-op PolicyDataProvider.\n\tNopPolicyDataProvider PolicyDataProvider = nopPolicyDataProvider{}\n)\n\n// PolicyDataProvider provides PolicyDatas.\ntype PolicyDataProvider interface {\n\t// GetPolicyDatasForPolicyKeys gets the PolicyDatas for the PolicyKeys.\n\t//\n\t// Returned PolicyDatas will be in the same order as the input PolicyKeys.\n\t//\n\t// The input PolicyKeys are expected to be unique by FullName. The implementation\n\t// may error if this is not the case.\n\t//\n\t// The input PolicyKeys are expected to have the same DigestType. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the PolicyDatas returned will match the length of the PolicyKeys.\n\t// If there is an error, no PolicyDatas will be returned.\n\t// If any PolicyKey is not found, an error with fs.ErrNotExist will be returned.\n\tGetPolicyDatasForPolicyKeys(context.Context, []PolicyKey) ([]PolicyData, error)\n}\n\n// *** PRIVATE ***\n\ntype nopPolicyDataProvider struct{}\n\nfunc (nopPolicyDataProvider) GetPolicyDatasForPolicyKeys(\n\tcontext.Context,\n\t[]PolicyKey,\n) ([]PolicyData, error) {\n\treturn nil, fs.ErrNotExist\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_key.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n\t\"github.com/google/uuid\"\n)\n\n// PolicyKey provides identifying information for a Policy.\n//\n// PolicyKeys are returned from PolicyKeyProviders, and represent a Policy's complete\n// identity. They also match to what we store in buf.lock files. PolicyKeys can be used\n// to get Policies via a PolicyProvider.\ntype PolicyKey interface {\n\t// String returns \"registry/owner/name:dashlessCommitID\".\n\tfmt.Stringer\n\n\t// FullName returns the full name of the Policy.\n\t//\n\t// Always present.\n\tFullName() bufparse.FullName\n\t// CommitID returns the ID of the Commit.\n\t//\n\t// It is up to the caller to convert this to a dashless ID when necessary.\n\t//\n\t// Always present, that is CommitID() == uuid.Nil will always be false.\n\tCommitID() uuid.UUID\n\t// Digest returns the Policy digest.\n\tDigest() (Digest, error)\n\n\tisPolicyKey()\n}\n\n// NewPolicyKey returns a new PolicyKey.\n//\n// The Digest will be loaded lazily if needed. Note this means that NewPolicyKey does\n// *not* validate the digest. If you need to validate the digest, call Digest() and evaluate\n// the returned error.\nfunc NewPolicyKey(\n\tpolicyFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tgetDigest func() (Digest, error),\n) (PolicyKey, error) {\n\treturn newPolicyKey(\n\t\tpolicyFullName,\n\t\tcommitID,\n\t\tgetDigest,\n\t)\n}\n\n// UniqueDigestTypeForPolicyKeys returns the unique DigestType for the given PolicyKeys.\n//\n// If the PolicyKeys have different DigestTypes, an error is returned.\n// If the PolicyKeys slice is empty, an error is returned.\nfunc UniqueDigestTypeForPolicyKeys(policyKeys []PolicyKey) (DigestType, error) {\n\tif len(policyKeys) == 0 {\n\t\treturn 0, syserror.New(\"empty policyKeys passed to UniqueDigestTypeForPolicyKeys\")\n\t}\n\tdigests, err := xslices.MapError(policyKeys, PolicyKey.Digest)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tdigestType := digests[0].Type()\n\tfor _, digest := range digests[1:] {\n\t\tif digestType != digest.Type() {\n\t\t\treturn 0, fmt.Errorf(\n\t\t\t\t\"different digest types detected where the same digest type must be used: %v, %v\\n%s\",\n\t\t\t\tdigestType,\n\t\t\t\tdigest.Type(),\n\t\t\t\tstrings.Join(xslices.Map(policyKeys, PolicyKey.String), \"\\n\"),\n\t\t\t)\n\t\t}\n\t}\n\treturn digestType, nil\n}\n\n// ** PRIVATE **\n\ntype policyKey struct {\n\tpolicyFullName bufparse.FullName\n\tcommitID       uuid.UUID\n\n\tgetDigest func() (Digest, error)\n}\n\nfunc newPolicyKey(\n\tpolicyFullName bufparse.FullName,\n\tcommitID uuid.UUID,\n\tgetDigest func() (Digest, error),\n) (*policyKey, error) {\n\tif policyFullName == nil {\n\t\treturn nil, errors.New(\"nil FullName when constructing PolicyKey\")\n\t}\n\tif commitID == uuid.Nil {\n\t\treturn nil, errors.New(\"empty commitID when constructing PolicyKey\")\n\t}\n\treturn &policyKey{\n\t\tpolicyFullName: policyFullName,\n\t\tcommitID:       commitID,\n\t\tgetDigest:      sync.OnceValues(getDigest),\n\t}, nil\n}\n\nfunc (p *policyKey) FullName() bufparse.FullName {\n\treturn p.policyFullName\n}\n\nfunc (p *policyKey) CommitID() uuid.UUID {\n\treturn p.commitID\n}\n\nfunc (p *policyKey) Digest() (Digest, error) {\n\treturn p.getDigest()\n}\n\nfunc (p *policyKey) String() string {\n\treturn p.policyFullName.String() + \":\" + uuidutil.ToDashless(p.commitID)\n}\n\nfunc (*policyKey) isPolicyKey() {}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n)\n\nvar (\n\t// NopPolicyKeyProvider is a no-op PolicyKeyProvider.\n\tNopPolicyKeyProvider PolicyKeyProvider = nopPolicyKeyProvider{}\n)\n\n// PolicyKeyProvider provides PolicyKeys for bufparse.Refs.\ntype PolicyKeyProvider interface {\n\t// GetPolicyKeysForPolicyRefs gets the PolicyKets for the given PolicyRefs.\n\t//\n\t// Returned PolicyKeys will be in the same order as the input PolicyRefs.\n\t//\n\t// The input PolicyRefs are expected to be unique by FullName. The implementation\n\t// may error if this is not the case.\n\t//\n\t// If there is no error, the length of the PolicyKeys returned will match the length of the Refs.\n\t// If there is an error, no PolicyKeys will be returned.\n\t// If any PolicyRef is not found, an error with fs.ErrNotExist will be returned.\n\tGetPolicyKeysForPolicyRefs(context.Context, []bufparse.Ref, DigestType) ([]PolicyKey, error)\n}\n\n// NewStaticPolicyKeyProvider returns a new PolicyKeyProvider for a static set of PolicyKeys.\n//\n// The set of PolicyKeys must be unique by FullName. If there are duplicates,\n// an error will be returned.\n//\n// When resolving Refs, the Ref will be matched to the PolicyKey by FullName.\n// If the Ref is not found in the set of provided keys, an fs.ErrNotExist will be returned.\nfunc NewStaticPolicyKeyProvider(policyKeys []PolicyKey) (PolicyKeyProvider, error) {\n\treturn newStaticPolicyKeyProvider(policyKeys)\n}\n\n// *** PRIVATE ***\n\ntype nopPolicyKeyProvider struct{}\n\nfunc (nopPolicyKeyProvider) GetPolicyKeysForPolicyRefs(\n\tcontext.Context,\n\t[]bufparse.Ref,\n\tDigestType,\n) ([]PolicyKey, error) {\n\treturn nil, fs.ErrNotExist\n}\n\ntype staticPolicyKeyProvider struct {\n\tpolicyKeysByFullName map[string]PolicyKey\n}\n\nfunc newStaticPolicyKeyProvider(policyKeys []PolicyKey) (*staticPolicyKeyProvider, error) {\n\tvar policyKeysByFullName map[string]PolicyKey\n\tif len(policyKeys) > 0 {\n\t\tvar err error\n\t\tpolicyKeysByFullName, err = xslices.ToUniqueValuesMap(policyKeys, func(policyKey PolicyKey) string {\n\t\t\treturn policyKey.FullName().String()\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &staticPolicyKeyProvider{\n\t\tpolicyKeysByFullName: policyKeysByFullName,\n\t}, nil\n}\n\nfunc (s staticPolicyKeyProvider) GetPolicyKeysForPolicyRefs(\n\t_ context.Context,\n\trefs []bufparse.Ref,\n\tdigestType DigestType,\n) ([]PolicyKey, error) {\n\tpolicyKeys := make([]PolicyKey, len(refs))\n\tfor i, ref := range refs {\n\t\t// Only the FullName is used to match the PolicyKey. The Ref is not\n\t\t// validated to match the PolicyKey as there is not enough information\n\t\t// to do so.\n\t\tpolicyKey, ok := s.policyKeysByFullName[ref.FullName().String()]\n\t\tif !ok {\n\t\t\treturn nil, fs.ErrNotExist\n\t\t}\n\t\tdigest, err := policyKey.Digest()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif digest.Type() != digestType {\n\t\t\treturn nil, fmt.Errorf(\"expected DigestType %v, got %v\", digestType, digest.Type())\n\t\t}\n\t\tpolicyKeys[i] = policyKey\n\t}\n\treturn policyKeys, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_plugin_data_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n)\n\nvar (\n\t// NopPolicyPluginDataProvider is a no-op PolicyDataProvider.\n\tNopPolicyPluginDataProvider PolicyPluginDataProvider = nopPolicyPluginDataProvider{}\n)\n\n// PolicyPluginDataProvider provides PluginData for a specific Policy.\ntype PolicyPluginDataProvider interface {\n\t// GetPluginDataProviderForPolicy returns the PluginDataProvider for the given policy name.\n\t//\n\t// The PluginDataProvider returned will be used to resolve the PluginData for the given policy.\n\t// If the Policy is not found a bufplugin.NopPluginDataProvider will be returned.\n\tGetPluginDataProviderForPolicy(policyName string) bufplugin.PluginDataProvider\n}\n\n// NewStaticPolicyPluginDataProvider returns a new PolicyPluginDataProvider for a static set of\n// PolicyNames to PluginData.\n//\n// Each set of PluginDatas must be unique by FullName. If there are duplicates,\n// an error will be returned.\n//\n// When resolving Refs, the Ref will be matched to the PolicyPluginData by FullName.\n// If the Ref is not found in the set of provided keys, an fs.ErrNotExist will be returned.\nfunc NewStaticPolicyPluginDataProvider(policyNameToPluginDataProvider map[string]bufplugin.PluginDataProvider) (PolicyPluginDataProvider, error) {\n\treturn newStaticPolicyPluginDataProvider(policyNameToPluginDataProvider)\n}\n\n// *** PRIVATE ***\n\ntype nopPolicyPluginDataProvider struct{}\n\nvar _ PolicyPluginDataProvider = nopPolicyPluginDataProvider{}\n\nfunc (nopPolicyPluginDataProvider) GetPluginDataProviderForPolicy(policyName string) bufplugin.PluginDataProvider {\n\treturn bufplugin.NopPluginDataProvider\n}\n\ntype staticPolicyPluginDataProvider struct {\n\tpolicyNameToPluginDataProvider map[string]bufplugin.PluginDataProvider\n}\n\nfunc newStaticPolicyPluginDataProvider(policyNameToPluginDataProvider map[string]bufplugin.PluginDataProvider) (*staticPolicyPluginDataProvider, error) {\n\treturn &staticPolicyPluginDataProvider{\n\t\tpolicyNameToPluginDataProvider: policyNameToPluginDataProvider,\n\t}, nil\n}\n\nfunc (s staticPolicyPluginDataProvider) GetPluginDataProviderForPolicy(policyName string) bufplugin.PluginDataProvider {\n\tif pluginDataProvider, ok := s.policyNameToPluginDataProvider[policyName]; ok {\n\t\treturn pluginDataProvider\n\t}\n\t// Check if the policyName is a valid ref. If so, also check by full name.\n\t// Remote policies are cached by full name in the buf.lock file.\n\tif ref, err := bufparse.ParseRef(policyName); err == nil && ref.Ref() != \"\" {\n\t\tif pluginDataProvider, ok := s.policyNameToPluginDataProvider[ref.FullName().String()]; ok {\n\t\t\treturn pluginDataProvider\n\t\t}\n\t}\n\treturn newNopPluginDataProviderForPolicy(policyName)\n}\n\ntype nopPluginDataProviderForPolicy struct {\n\tpolicyName string\n}\n\nfunc newNopPluginDataProviderForPolicy(policyName string) bufplugin.PluginDataProvider {\n\treturn &nopPluginDataProviderForPolicy{\n\t\tpolicyName: policyName,\n\t}\n}\n\nfunc (p *nopPluginDataProviderForPolicy) GetPluginDatasForPluginKeys(\n\tcontext.Context,\n\t[]bufplugin.PluginKey,\n) ([]bufplugin.PluginData, error) {\n\treturn nil, fmt.Errorf(\"no plugins configured for policy %q: %w\", p.policyName, fs.ErrNotExist)\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_plugin_key_provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufplugin\"\n)\n\nvar (\n\t// NopPolicyPluginKeyProvider is a no-op PolicyPluginKeyProvider.\n\tNopPolicyPluginKeyProvider PolicyPluginKeyProvider = nopPolicyPluginKeyProvider{}\n)\n\n// PolicyPluginKeyProvider provides PluginKeys for a specific Policy.\ntype PolicyPluginKeyProvider interface {\n\t// GetPluginKeyProviderForPolicy returns the PluginKeyProvider for the given policy name.\n\t//\n\t// The PluginKeyProvider returned will be used to resolve the PluginKeys for the given policy.\n\t// If the Policy is not found a bufplugin.NopPluginKeyProvider will be returned.\n\tGetPluginKeyProviderForPolicy(policyName string) bufplugin.PluginKeyProvider\n}\n\n// NewStaticPolicyPluginKeyProvider returns a new PolicyPluginKeyProvider for a static set of\n// PolicyNames to PluginKeys.\n//\n// Each set of PluginKeys must be unique by FullName. If there are duplicates,\n// an error will be returned.\n//\n// When resolving Refs, the Ref will be matched to the PolicyPluginKey by FullName.\n// If the Ref is not found in the set of provided keys, an fs.ErrNotExist will be returned.\nfunc NewStaticPolicyPluginKeyProvider(policyNameToPluginKeys map[string][]bufplugin.PluginKey) (PolicyPluginKeyProvider, error) {\n\treturn newStaticPolicyPluginKeyProvider(policyNameToPluginKeys)\n}\n\n// *** PRIVATE ***\n\ntype nopPolicyPluginKeyProvider struct{}\n\nvar _ PolicyPluginKeyProvider = nopPolicyPluginKeyProvider{}\n\nfunc (nopPolicyPluginKeyProvider) GetPluginKeyProviderForPolicy(policyName string) bufplugin.PluginKeyProvider {\n\treturn bufplugin.NopPluginKeyProvider\n}\n\ntype staticPolicyPluginKeyProvider struct {\n\tpolicyNameToPluginKeyProvider map[string]bufplugin.PluginKeyProvider\n}\n\nfunc newStaticPolicyPluginKeyProvider(policyNameToPluginKeys map[string][]bufplugin.PluginKey) (*staticPolicyPluginKeyProvider, error) {\n\tpolicyNameToPluginKeyProvider := make(map[string]bufplugin.PluginKeyProvider)\n\tfor policyName, pluginKeys := range policyNameToPluginKeys {\n\t\tpluginKeyProvider, err := bufplugin.NewStaticPluginKeyProvider(pluginKeys)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create PluginKeyProvider for policy %q: %w\", policyName, err)\n\t\t}\n\t\tpolicyNameToPluginKeyProvider[policyName] = pluginKeyProvider\n\t}\n\treturn &staticPolicyPluginKeyProvider{\n\t\tpolicyNameToPluginKeyProvider: policyNameToPluginKeyProvider,\n\t}, nil\n}\n\nfunc (s staticPolicyPluginKeyProvider) GetPluginKeyProviderForPolicy(policyName string) bufplugin.PluginKeyProvider {\n\tif pluginKeyProvider, ok := s.policyNameToPluginKeyProvider[policyName]; ok {\n\t\treturn pluginKeyProvider\n\t}\n\t// Check if the policyName is a valid ref. If so, also check by full name.\n\t// Remote policies are cached by full name in the buf.lock file.\n\tif ref, err := bufparse.ParseRef(policyName); err == nil && ref.Ref() != \"\" {\n\t\tif pluginKeyProvider, ok := s.policyNameToPluginKeyProvider[ref.FullName().String()]; ok {\n\t\t\treturn pluginKeyProvider\n\t\t}\n\t}\n\treturn newNopPluginKeyProviderForPolicy(policyName)\n}\n\ntype nopPluginKeyProviderForPolicy struct {\n\tpolicyName string\n}\n\nfunc newNopPluginKeyProviderForPolicy(policyName string) bufplugin.PluginKeyProvider {\n\treturn &nopPluginKeyProviderForPolicy{\n\t\tpolicyName: policyName,\n\t}\n}\n\nfunc (p *nopPluginKeyProviderForPolicy) GetPluginKeysForPluginRefs(\n\tcontext.Context,\n\t[]bufparse.Ref,\n\tbufplugin.DigestType,\n) ([]bufplugin.PluginKey, error) {\n\treturn nil, fmt.Errorf(\"no plugins configured for policy %q: %w\", p.policyName, fs.ErrNotExist)\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/policy_visibility.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"fmt\"\n)\n\nconst (\n\t// PolicyVisibilityPublic says the Policy is public on the registry.\n\tPolicyVisibilityPublic = iota + 1\n\t// PolicyVisibilityPrivate says the Policy is private on the registry.\n\tPolicyVisibilityPrivate\n)\n\n// PolicyVisibility is the visibility of a Policy on a registry.\n//\n// Only used for Upload for now.\ntype PolicyVisibility int\n\n// ParsePolicyVisibility parses the PolicyVisibility from the string.\nfunc ParsePolicyVisibility(s string) (PolicyVisibility, error) {\n\tswitch s {\n\tcase \"public\":\n\t\treturn PolicyVisibilityPublic, nil\n\tcase \"private\":\n\t\treturn PolicyVisibilityPrivate, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown PolicyVisibility: %q\", s)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/uploader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufpolicy\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\n\t\"buf.build/go/standard/xslices\"\n)\n\nvar (\n\t// NopUploader is a no-op Uploader.\n\tNopUploader Uploader = nopUploader{}\n)\n\n// Uploader uploads Policies.\ntype Uploader interface {\n\t// Upload uploads the given Policies.\n\tUpload(ctx context.Context, policies []Policy, options ...UploadOption) ([]Commit, error)\n}\n\n// UploadOption is an option for an Upload.\ntype UploadOption func(*uploadOptions)\n\n// UploadWithLabels returns a new UploadOption that adds the given labels.\n//\n// This can be called multiple times. The unique result set of labels will be used.\nfunc UploadWithLabels(labels ...string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.labels = append(uploadOptions.labels, labels...)\n\t}\n}\n\n// UploadWithCreateIfNotExist returns a new UploadOption that will result in the\n// Policies being created on the registry with the given visibility if they do not exist.\nfunc UploadWithCreateIfNotExist(createPolicyVisibility PolicyVisibility) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.createIfNotExist = true\n\t\tuploadOptions.createPolicyVisibility = createPolicyVisibility\n\t}\n}\n\n// UploadWithSourceControlURL returns a new UploadOption that will set the source control\n// url for the policy contents uploaded.\nfunc UploadWithSourceControlURL(sourceControlURL string) UploadOption {\n\treturn func(uploadOptions *uploadOptions) {\n\t\tuploadOptions.sourceControlURL = sourceControlURL\n\t}\n}\n\n// UploadOptions are the possible options for upload.\n//\n// This is used by Uploader implementations.\ntype UploadOptions interface {\n\t// Labels returns the unique and sorted set of labels to add. Labels\n\t// are set using the `--label` flag when calling `buf policy upload`\n\t// and represent the labels that are set when uploading policy data.\n\tLabels() []string\n\t// CreateIfNotExist says to create Policies if they do not exist on the registry.\n\tCreateIfNotExist() bool\n\t// CreatePolicyVisibility returns the visibility to create Policies with.\n\t//\n\t// Will always be present if CreateIfNotExist() is true.\n\tCreatePolicyVisibility() PolicyVisibility\n\t// SourceControlURL returns the source control URL set by the user for the policy\n\t// contents uploaded. We set the same source control URL for all policy contents.\n\tSourceControlURL() string\n\n\tisUploadOptions()\n}\n\n// NewUploadOptions returns a new UploadOptions.\nfunc NewUploadOptions(options []UploadOption) (UploadOptions, error) {\n\tuploadOptions := newUploadOptions()\n\tfor _, option := range options {\n\t\toption(uploadOptions)\n\t}\n\tif err := uploadOptions.validate(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn uploadOptions, nil\n}\n\n// *** PRIVATE ***\n\ntype nopUploader struct{}\n\nfunc (nopUploader) Upload(context.Context, []Policy, ...UploadOption) ([]Commit, error) {\n\treturn nil, errors.New(\"unimplemented: no-op Uploader called\")\n}\n\ntype uploadOptions struct {\n\tlabels                 []string\n\tcreateIfNotExist       bool\n\tcreatePolicyVisibility PolicyVisibility\n\tsourceControlURL       string\n}\n\nfunc newUploadOptions() *uploadOptions {\n\treturn &uploadOptions{}\n}\n\nfunc (u *uploadOptions) Labels() []string {\n\treturn xslices.ToUniqueSorted(u.labels)\n}\n\nfunc (u *uploadOptions) CreateIfNotExist() bool {\n\treturn u.createIfNotExist\n}\n\nfunc (u *uploadOptions) CreatePolicyVisibility() PolicyVisibility {\n\treturn u.createPolicyVisibility\n}\n\nfunc (u *uploadOptions) SourceControlURL() string {\n\treturn u.sourceControlURL\n}\n\nfunc (u *uploadOptions) isUploadOptions() {}\n\nfunc (u *uploadOptions) validate() error {\n\tif u.createIfNotExist && u.createPolicyVisibility == 0 {\n\t\treturn errors.New(\"must set a valid PolicyVisibility if CreateIfNotExist was specified\")\n\t}\n\tif u.sourceControlURL != \"\" {\n\t\tif _, err := url.Parse(u.sourceControlURL); err != nil {\n\t\t\treturn fmt.Errorf(\"must set a valid url for the source control url: %w\", err)\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufpolicy/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufpolicy\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufprotocompile/bufprotocompile.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotocompile\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufanalysis\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/protocompile/reporter\"\n)\n\n// FileAnnotationForErrorWithPos returns a new FileAnnotation for the ErrorWithPos.\n//\n// This special-cases fs.PathErrors if there is FileInfo information. We know that if there\n// is FileInfo information, and there is a fs.PathError, this can only happen due to import\n// errors. Therefore, we print out a special message saying that the error is for an import.\nfunc FileAnnotationForErrorWithPos(\n\terrorWithPos reporter.ErrorWithPos,\n\toptions ...FileAnnotationOption,\n) (bufanalysis.FileAnnotation, error) {\n\tfileAnnotationOptions := newFileAnnotationOptions()\n\tfor _, option := range options {\n\t\toption(fileAnnotationOptions)\n\t}\n\n\tvar fileInfo bufanalysis.FileInfo\n\tvar startLine int\n\tvar startColumn int\n\tvar endLine int\n\tvar endColumn int\n\tsourcePos := errorWithPos.GetPosition()\n\tif sourcePos.Filename != \"\" {\n\t\tpath, err := normalpath.NormalizeAndValidate(sourcePos.Filename)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\texternalPath := path\n\t\tif fileAnnotationOptions.externalPathResolver != nil {\n\t\t\texternalPath = fileAnnotationOptions.externalPathResolver(path)\n\t\t}\n\t\tfileInfo = newFileInfo(path, externalPath)\n\t}\n\tif sourcePos.Line > 0 {\n\t\tstartLine = sourcePos.Line\n\t\tendLine = sourcePos.Line\n\t}\n\tif sourcePos.Col > 0 {\n\t\tstartColumn = sourcePos.Col\n\t\tendColumn = sourcePos.Col\n\t}\n\n\ttypeString := \"COMPILE\"\n\tmessage := \"Compile error.\"\n\t// this should never happen\n\t// maybe we should error\n\tif err := errorWithPos.Unwrap(); err != nil {\n\t\tvar pathError *fs.PathError\n\t\tif fileInfo != nil && errors.As(err, &pathError) {\n\t\t\t// Special-case path errors as being for imports, as we know that they are for\n\t\t\t// an import if we had a fileInfo.\n\t\t\tmessage = fmt.Sprintf(\"import %q: %s\", pathError.Path, pathError.Err)\n\t\t} else {\n\t\t\tmessage = err.Error()\n\t\t}\n\t}\n\n\treturn bufanalysis.NewFileAnnotation(\n\t\tfileInfo,\n\t\tstartLine,\n\t\tstartColumn,\n\t\tendLine,\n\t\tendColumn,\n\t\ttypeString,\n\t\tmessage,\n\t\t\"\", // pluginName\n\t\t\"\", // policyName\n\t), nil\n}\n\n// FileAnnotationSetForErrorsWithPos returns new FileAnnotations for the ErrorsWithPos.\n//\n// This special-cases fs.PathErrors if there is FileInfo information. We know that if there\n// is FileInfo information, and there is a fs.PathError, this can only happen due to import\n// errors. Therefore, we print out a special message saying that the error is for an import.\nfunc FileAnnotationSetForErrorsWithPos(\n\terrorsWithPos []reporter.ErrorWithPos,\n\toptions ...FileAnnotationOption,\n) (bufanalysis.FileAnnotationSet, error) {\n\tfileAnnotations, err := xslices.MapError(\n\t\terrorsWithPos,\n\t\tfunc(errorWithPos reporter.ErrorWithPos) (bufanalysis.FileAnnotation, error) {\n\t\t\treturn FileAnnotationForErrorWithPos(errorWithPos, options...)\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufanalysis.NewFileAnnotationSet(fileAnnotations...), nil\n}\n\n// FileAnnotationOption is an option when creating a FileAnnotation.\ntype FileAnnotationOption func(*fileAnnotationOptions)\n\n// WithExternalPathResolver returns a new FileAnnotationOption that will map the given\n// path to an external path.\nfunc WithExternalPathResolver(externalPathResolver func(path string) string) FileAnnotationOption {\n\treturn func(fileAnnotationOptions *fileAnnotationOptions) {\n\t\tfileAnnotationOptions.externalPathResolver = externalPathResolver\n\t}\n}\n\n// *** PRIVATE ***\n\ntype fileInfo struct {\n\tpath         string\n\texternalPath string\n}\n\nfunc newFileInfo(path string, externalPath string) *fileInfo {\n\treturn &fileInfo{\n\t\tpath:         path,\n\t\texternalPath: externalPath,\n\t}\n}\n\nfunc (f *fileInfo) Path() string {\n\treturn f.path\n}\n\nfunc (f *fileInfo) ExternalPath() string {\n\treturn f.externalPath\n}\n\ntype fileAnnotationOptions struct {\n\texternalPathResolver func(path string) string\n}\n\nfunc newFileAnnotationOptions() *fileAnnotationOptions {\n\treturn &fileAnnotationOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotocompile/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufprotocompile\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/bufprotoplugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotoplugin contains helper functionality for protoc plugins.\n//\n// Note this is currently implicitly tested through buf's protoc command.\n// If this were split out into a separate package, testing would need to be\n// moved to this package.\npackage bufprotoplugin\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nconst (\n\t// Our generated files in `private/gen/proto` are on average 15KB which isn't\n\t// an unreasonable amount of memory to reserve each time we process an insertion\n\t// point and will save a significant number of allocations.\n\taverageGeneratedFileSize = 15 * 1024\n)\n\n// Generator executes the Handler using protoc's plugin execution logic.\n//\n// If multiple requests are specified, these are executed in parallel and the\n// result is combined into one response that is written.\ntype Generator interface {\n\t// Generate generates a CodeGeneratorResponse for the given CodeGeneratorRequests.\n\t//\n\t// A new ResponseBuilder is constructed for every invocation of Generate and is\n\t// used to consolidate all of the CodeGeneratorResponse_Files returned from a single\n\t// plugin into a single CodeGeneratorResponse.\n\tGenerate(\n\t\tctx context.Context,\n\t\tcontainer app.EnvStderrContainer,\n\t\trequests []*pluginpb.CodeGeneratorRequest,\n\t) (*pluginpb.CodeGeneratorResponse, error)\n}\n\n// NewGenerator returns a new Generator.\nfunc NewGenerator(\n\tlogger *slog.Logger,\n\thandler protoplugin.Handler,\n) Generator {\n\treturn newGenerator(logger, handler)\n}\n\n// ResponseWriter handles the response and writes it to the given storage.WriteBucket\n// without executing any plugins and handles insertion points as needed.\ntype ResponseWriter interface {\n\t// WriteResponse writes to the bucket with the given response. In practice, the\n\t// WriteBucket is most often an in-memory bucket.\n\t//\n\t// CodeGeneratorResponses are consolidated into the bucket, and insertion points\n\t// are applied in-place so that they can only access the files created in a single\n\t// generation invocation (just like protoc).\n\tWriteResponse(\n\t\tctx context.Context,\n\t\twriteBucket storage.WriteBucket,\n\t\tresponse *pluginpb.CodeGeneratorResponse,\n\t\toptions ...WriteResponseOption,\n\t) error\n}\n\n// NewResponseWriter returns a new ResponseWriter.\nfunc NewResponseWriter(logger *slog.Logger) ResponseWriter {\n\treturn newResponseWriter(logger)\n}\n\n// WriteResponseOption is an option for WriteResponse.\ntype WriteResponseOption func(*writeResponseOptions)\n\n// WriteResponseWithInsertionPointReadBucket returns a new WriteResponseOption that uses the given\n// ReadBucket to read from for insertion points.\n//\n// If this is not specified, insertion points are not supported.\nfunc WriteResponseWithInsertionPointReadBucket(\n\tinsertionPointReadBucket storage.ReadBucket,\n) WriteResponseOption {\n\treturn func(writeResponseOptions *writeResponseOptions) {\n\t\twriteResponseOptions.insertionPointReadBucket = insertionPointReadBucket\n\t}\n}\n\n// PluginResponse encapsulates a CodeGeneratorResponse,\n// along with the name of the plugin that created it.\ntype PluginResponse struct {\n\tResponse   *pluginpb.CodeGeneratorResponse\n\tPluginName string\n\tPluginOut  string\n}\n\n// NewPluginResponse returns a new *PluginResponse.\nfunc NewPluginResponse(\n\tresponse *pluginpb.CodeGeneratorResponse,\n\tpluginName string,\n\tpluginOut string,\n) *PluginResponse {\n\treturn &PluginResponse{\n\t\tResponse:   response,\n\t\tPluginName: pluginName,\n\t\tPluginOut:  pluginOut,\n\t}\n}\n\n// ValidatePluginResponses validates that each file is only defined by a single *PluginResponse.\nfunc ValidatePluginResponses(pluginResponses []*PluginResponse) error {\n\tseen := make(map[string]string)\n\tfor _, pluginResponse := range pluginResponses {\n\t\tfor _, file := range pluginResponse.Response.File {\n\t\t\tif file.GetInsertionPoint() != \"\" {\n\t\t\t\t// We expect insertion points to write\n\t\t\t\t// to files that already exist.\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfileName := filepath.Join(pluginResponse.PluginOut, file.GetName())\n\t\t\tif pluginName, ok := seen[fileName]; ok {\n\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\"file %q was generated multiple times: once by plugin %q and again by plugin %q\",\n\t\t\t\t\tfileName,\n\t\t\t\t\tpluginName,\n\t\t\t\t\tpluginResponse.PluginName,\n\t\t\t\t)\n\t\t\t}\n\t\t\tseen[fileName] = pluginResponse.PluginName\n\t\t}\n\t\t// Note: we used to verify that the plugin set min/max edition correctly if it set the\n\t\t// SUPPORTS_EDITIONS feature. But some plugins in the protoc codebase, from when editions\n\t\t// were still experimental, advertise SUPPORTS_EDITIONS but did not set those fields. So\n\t\t// we defer the check and only complain if/when the input actually contains Editions files.\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/bufprotoplugin_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotoplugin\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\nfunc TestWriteInsertionPoint(t *testing.T) {\n\tt.Parallel()\n\t// \\u205F is \"Medium Mathematical Space\"\n\twhitespacePrefix := \"\\u205F\\t\\t\\t\"\n\ttargetFileContent := `This is a test file\n// @@protoc_insertion_point(ip1)\n\nthat has more than one insertion point\n    // @@protoc_insertion_point(ip2)\n\nat varied indentation levels\n` + whitespacePrefix + \"// @@protoc_insertion_point(ip3)\\n\"\n\ttargetFileName := \"test.proto\"\n\tinsertionPointContent := \"!!! this content was inserted; こんにちは\"\n\n\tt.Run(\"basic\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tinsertionPointName := \"ip1\"\n\t\tinsertionPointConsumer := &pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           &targetFileName,\n\t\t\tInsertionPoint: &insertionPointName,\n\t\t\tContent:        &insertionPointContent,\n\t\t}\n\n\t\tpostInsertionContent, err := writeInsertionPoint(\n\t\t\tt.Context(),\n\t\t\tinsertionPointConsumer,\n\t\t\tstrings.NewReader(targetFileContent),\n\t\t)\n\t\trequire.NoError(t, err)\n\t\texpectContent := []byte(`This is a test file\n!!! this content was inserted; こんにちは\n// @@protoc_insertion_point(ip1)\n\nthat has more than one insertion point\n    // @@protoc_insertion_point(ip2)\n\nat varied indentation levels\n` + whitespacePrefix + \"// @@protoc_insertion_point(ip3)\")\n\n\t\tassert.Equal(t, expectContent, postInsertionContent)\n\t})\n\tt.Run(\"basic_indent\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tinsertionPointName := \"ip2\"\n\t\tinsertionPointConsumer := &pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           &targetFileName,\n\t\t\tInsertionPoint: &insertionPointName,\n\t\t\tContent:        &insertionPointContent,\n\t\t}\n\n\t\tpostInsertionContent, err := writeInsertionPoint(\n\t\t\tt.Context(),\n\t\t\tinsertionPointConsumer,\n\t\t\tstrings.NewReader(targetFileContent),\n\t\t)\n\t\trequire.NoError(t, err)\n\t\texpectContent := []byte(`This is a test file\n// @@protoc_insertion_point(ip1)\n\nthat has more than one insertion point\n    !!! this content was inserted; こんにちは\n    // @@protoc_insertion_point(ip2)\n\nat varied indentation levels\n` + whitespacePrefix + \"// @@protoc_insertion_point(ip3)\")\n\n\t\tassert.Equal(t, expectContent, postInsertionContent)\n\t})\n\tt.Run(\"basic_unicode_indent\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tinsertionPointName := \"ip3\"\n\t\tinsertionPointConsumer := &pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           &targetFileName,\n\t\t\tInsertionPoint: &insertionPointName,\n\t\t\tContent:        &insertionPointContent,\n\t\t}\n\n\t\tpostInsertionContent, err := writeInsertionPoint(\n\t\t\tt.Context(),\n\t\t\tinsertionPointConsumer,\n\t\t\tstrings.NewReader(targetFileContent),\n\t\t)\n\t\trequire.NoError(t, err)\n\t\texpectContent := []byte(`This is a test file\n// @@protoc_insertion_point(ip1)\n\nthat has more than one insertion point\n    // @@protoc_insertion_point(ip2)\n\nat varied indentation levels\n` +\n\t\t\twhitespacePrefix +\n\t\t\t\"!!! this content was inserted; こんにちは\" + \"\\n\" +\n\t\t\twhitespacePrefix +\n\t\t\t\"// @@protoc_insertion_point(ip3)\")\n\n\t\tassert.Equal(t, expectContent, postInsertionContent)\n\t})\n\tt.Run(\"invalid_empty\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tinsertionPointName := \"missing\"\n\t\tinsertionPointContent := \"\"\n\t\tinsertionPointConsumer := &pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           &targetFileName,\n\t\t\tInsertionPoint: &insertionPointName,\n\t\t\tContent:        &insertionPointContent,\n\t\t}\n\t\t_, err := writeInsertionPoint(\n\t\t\tt.Context(),\n\t\t\tinsertionPointConsumer,\n\t\t\tstrings.NewReader(targetFileContent),\n\t\t)\n\t\trequire.ErrorContains(t, err, \"could not find insertion point\")\n\t})\n\tt.Run(\"invalid_not_found\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tinsertionPointName := \"not_found\"\n\t\tinsertionPointConsumer := &pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           &targetFileName,\n\t\t\tInsertionPoint: &insertionPointName,\n\t\t\tContent:        &insertionPointContent,\n\t\t}\n\t\t_, err := writeInsertionPoint(\n\t\t\tt.Context(),\n\t\t\tinsertionPointConsumer,\n\t\t\tstrings.NewReader(targetFileContent),\n\t\t)\n\t\trequire.ErrorContains(t, err, \"could not find insertion point\")\n\t})\n}\n\nfunc BenchmarkWriteInsertionPoint(b *testing.B) {\n\t// \\u205F is \"Medium Mathematical Space\"\n\twhitespacePrefix := \"\\u205F\\t\\t\\t\"\n\ttargetFileContent := `This is a test file\n// @@protoc_insertion_point(ip1)\n\nthat has more than one insertion point\n    // @@protoc_insertion_point(ip2)\n\nat varied indentation levels` + whitespacePrefix + \"// @@protoc_insertion_point(ip3)\\n\"\n\ttargetFileName := \"test.proto\"\n\tinsertionPointContent := \"!!! this content was inserted; こんにちは\"\n\t// Our generated files in private/gen/proto are on average 1100 lines.\n\tinflatedLines := 1100\n\n\tvar inflatedTargetFileContent strings.Builder\n\tinflatedTargetFileContent.WriteString(targetFileContent)\n\tfor range inflatedLines - 1 {\n\t\tinflatedTargetFileContent.WriteString(\"// this is just extra garbage\\n\")\n\t}\n\t// no trailing newline\n\tinflatedTargetFileContent.WriteString(\"// this is just extra garbage\")\n\n\tb.Run(\"basic\", func(b *testing.B) {\n\t\tvar postInsertionContent []byte\n\t\tinsertionPointName := \"ip1\"\n\t\tinsertionPointConsumer := &pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           &targetFileName,\n\t\t\tInsertionPoint: &insertionPointName,\n\t\t\tContent:        &insertionPointContent,\n\t\t}\n\t\texpectContent := []byte(`This is a test file\n!!! this content was inserted; こんにちは\n// @@protoc_insertion_point(ip1)\n\nthat has more than one insertion point\n    // @@protoc_insertion_point(ip2)\n\nat varied indentation levels` + whitespacePrefix + \"// @@protoc_insertion_point(ip3)\")\n\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\tb.ReportAllocs()\n\n\t\t\tpostInsertionContent, _ = writeInsertionPoint(\n\t\t\t\tb.Context(),\n\t\t\t\tinsertionPointConsumer,\n\t\t\t\tstrings.NewReader(targetFileContent),\n\t\t\t)\n\t\t}\n\t\tassert.Equal(b, expectContent, postInsertionContent)\n\t})\n\n\tb.Run(\"inflated\", func(b *testing.B) {\n\t\tinsertionPointName := \"ip1\"\n\t\tinsertionPointConsumer := &pluginpb.CodeGeneratorResponse_File{\n\t\t\tName:           &targetFileName,\n\t\t\tInsertionPoint: &insertionPointName,\n\t\t\tContent:        &insertionPointContent,\n\t\t}\n\t\tinflatedExpectContent := []byte(`This is a test file\n!!! this content was inserted; こんにちは\n// @@protoc_insertion_point(ip1)\n\nthat has more than one insertion point\n    // @@protoc_insertion_point(ip2)\n\nat varied indentation levels` + whitespacePrefix + \"// @@protoc_insertion_point(ip3)\\n\")\n\t\tfor range inflatedLines - 1 {\n\t\t\tinflatedExpectContent = append(inflatedExpectContent, []byte(\"// this is just extra garbage\\n\")...)\n\t\t}\n\t\t// no trailing newline\n\t\tinflatedExpectContent = append(inflatedExpectContent, []byte(\"// this is just extra garbage\")...)\n\n\t\tvar postInsertionContent []byte\n\t\tfor i := 0; i < b.N; i++ {\n\t\t\tb.ReportAllocs()\n\n\t\t\tpostInsertionContent, _ = writeInsertionPoint(\n\t\t\t\tb.Context(),\n\t\t\t\tinsertionPointConsumer,\n\t\t\t\tstrings.NewReader(inflatedTargetFileContent.String()),\n\t\t\t)\n\t\t}\n\t\tassert.Equal(b, inflatedExpectContent, postInsertionContent)\n\t})\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/bufprotopluginos/bufprotopluginos.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginos does OS-specific generation.\npackage bufprotopluginos\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"log/slog\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\n// ResponseWriter writes CodeGeneratorResponses to the OS filesystem.\ntype ResponseWriter interface {\n\t// Close writes all of the responses to disk. No further calls can be\n\t// made to the ResponseWriter after this call.\n\tio.Closer\n\n\t// AddResponse adds the response to the writer, switching on the file extension.\n\t// If there is a .jar extension, this generates a jar. If there is a .zip\n\t// extension, this generates a zip. If there is no extension, this outputs\n\t// to the directory.\n\t//\n\t// pluginOut will be unnormalized within this function.\n\tAddResponse(\n\t\tctx context.Context,\n\t\tresponse *pluginpb.CodeGeneratorResponse,\n\t\tpluginOut string,\n\t) error\n}\n\n// NewResponseWriter returns a new ResponseWriter.\nfunc NewResponseWriter(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\toptions ...ResponseWriterOption,\n) ResponseWriter {\n\treturn newResponseWriter(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\toptions...,\n\t)\n}\n\n// ResponseWriterOption is an option for the ResponseWriter.\ntype ResponseWriterOption func(*responseWriterOptions)\n\n// ResponseWriterWithCreateOutDirIfNotExists returns a new ResponseWriterOption that creates\n// the directory if it does not exist.\nfunc ResponseWriterWithCreateOutDirIfNotExists() ResponseWriterOption {\n\treturn func(responseWriterOptions *responseWriterOptions) {\n\t\tresponseWriterOptions.createOutDirIfNotExists = true\n\t}\n}\n\n// Cleaner deletes output locations prior to generation.\n//\n// This must be done before any interaction with  ResponseWriters, as multiple plugins may output to a single\n// location.\ntype Cleaner interface {\n\tDeleteOuts(ctx context.Context, pluginOuts []string) error\n}\n\n// NewCleaner returns a new Cleaner.\nfunc NewCleaner(storageosProvider storageos.Provider) Cleaner {\n\treturn newCleaner(storageosProvider)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/bufprotopluginos/cleaner.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginos\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/standard/xpath/xfilepath\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/osext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\ntype cleaner struct {\n\tstorageosProvider storageos.Provider\n}\n\nfunc newCleaner(\n\tstorageosProvider storageos.Provider,\n) *cleaner {\n\treturn &cleaner{\n\t\tstorageosProvider: storageosProvider,\n\t}\n}\n\nfunc (c *cleaner) DeleteOuts(\n\tctx context.Context,\n\tpluginOuts []string,\n) error {\n\tpwd, err := osext.Getwd()\n\tif err != nil {\n\t\treturn err\n\t}\n\tpwd, err = reallyCleanPath(pwd)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, pluginOut := range pluginOuts {\n\t\tif err := validatePluginOut(pwd, pluginOut); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor _, pluginOut := range pluginOuts {\n\t\tif err := c.deleteOut(ctx, pluginOut); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (c *cleaner) deleteOut(\n\tctx context.Context,\n\tpluginOut string,\n) error {\n\tdirPath := pluginOut\n\tremovePath := \".\"\n\tswitch filepath.Ext(pluginOut) {\n\tcase \".jar\", \".zip\":\n\t\tdirPath = normalpath.Dir(pluginOut)\n\t\tremovePath = normalpath.Base(pluginOut)\n\tdefault:\n\t\t// Assume output is a directory.\n\t}\n\tbucket, err := c.storageosProvider.NewReadWriteBucket(\n\t\tdirPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn bucket.DeleteAll(ctx, removePath)\n}\n\nfunc validatePluginOut(pwd string, pluginOut string) error {\n\tif pluginOut == \"\" {\n\t\t// This is just triple-making sure.\n\t\treturn syserror.New(\"got empty pluginOut in bufprotopluginos.Cleaner\")\n\t}\n\tif pluginOut == \".\" {\n\t\t// This is just a really defensive safety check. We can't see a reason you'd want to delete\n\t\t// your current working directory other than something like a (cd proto && buf generate), so\n\t\t// until and unless someone complains, we're just going to outlaw this.\n\t\treturn errors.New(\"cannot use --clean if your plugin will output to the current directory\")\n\t}\n\tcleanedPluginOut, err := reallyCleanPath(pluginOut)\n\tif err != nil {\n\t\tif errors.Is(err, fs.ErrNotExist) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\tif cleanedPluginOut == pwd {\n\t\t// Same thing, more defense for now.\n\t\treturn errors.New(\"cannot use --clean if your plugin will output to the current directory\")\n\t}\n\treturn nil\n}\n\nfunc reallyCleanPath(path string) (string, error) {\n\tpath, err := xfilepath.RealClean(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn filepath.EvalSymlinks(path)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/bufprotopluginos/response_writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotopluginos\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufprotoplugin\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\n// Constants used to create .jar files.\nvar (\n\tmanifestPath    = normalpath.Join(\"META-INF\", \"MANIFEST.MF\")\n\tmanifestContent = []byte(`Manifest-Version: 1.0\nCreated-By: 1.6.0 (protoc)\n\n`)\n)\n\ntype responseWriter struct {\n\tlogger            *slog.Logger\n\tstorageosProvider storageos.Provider\n\tresponseWriter    bufprotoplugin.ResponseWriter\n\t// If set, create directories if they don't already exist.\n\tcreateOutDirIfNotExists bool\n\t// Cache the readWriteBuckets by their respective output paths.\n\t// These builders are transformed to storage.ReadBuckets and written\n\t// to disk once the responseWriter is flushed.\n\t//\n\t// Note that output paths are used as-is with respect to the\n\t// caller's configuration. It's possible that a single invocation\n\t// will specify the same filepath in multiple ways, e.g. \".\" and\n\t// \"$(pwd)\". However, we intentionally treat these as distinct paths\n\t// to mirror protoc's insertion point behavior.\n\t//\n\t// For example, the following command will fail because protoc treats\n\t// \".\" and \"$(pwd)\" as distinct paths:\n\t//\n\t// $ protoc example.proto --insertion-point-receiver_out=. --insertion-point-writer_out=$(pwd)\n\t//\n\treadWriteBuckets map[string]storage.ReadWriteBucket\n\t// Cache the functions used to flush all of the responses to disk.\n\t// This holds all of the buckets in-memory so that we only write\n\t// the results to disk if all of the responses are successful.\n\tclosers []func() error\n\tlock    sync.RWMutex\n}\n\nfunc newResponseWriter(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\toptions ...ResponseWriterOption,\n) *responseWriter {\n\tresponseWriterOptions := newResponseWriterOptions()\n\tfor _, option := range options {\n\t\toption(responseWriterOptions)\n\t}\n\treturn &responseWriter{\n\t\tlogger:                  logger,\n\t\tstorageosProvider:       storageosProvider,\n\t\tresponseWriter:          bufprotoplugin.NewResponseWriter(logger),\n\t\tcreateOutDirIfNotExists: responseWriterOptions.createOutDirIfNotExists,\n\t\treadWriteBuckets:        make(map[string]storage.ReadWriteBucket),\n\t}\n}\n\nfunc (w *responseWriter) AddResponse(\n\tctx context.Context,\n\tresponse *pluginpb.CodeGeneratorResponse,\n\tpluginOut string,\n) error {\n\t// It's important that we get a consistent output path\n\t// so that we use the same in-memory bucket for paths\n\t// set to the same directory.\n\t//\n\t// filepath.Abs calls filepath.Clean.\n\t//\n\t// For example:\n\t//\n\t// --insertion-point-receiver_out=insertion --insertion-point-writer_out=./insertion/ --insertion-point_writer_out=/foo/insertion\n\tabsPluginOut, err := filepath.Abs(normalpath.Unnormalize(pluginOut))\n\tif err != nil {\n\t\treturn err\n\t}\n\tw.lock.Lock()\n\tdefer w.lock.Unlock()\n\treturn w.addResponse(\n\t\tctx,\n\t\tresponse,\n\t\tabsPluginOut,\n\t\tw.createOutDirIfNotExists,\n\t)\n}\n\nfunc (w *responseWriter) Close() error {\n\tw.lock.Lock()\n\tdefer w.lock.Unlock()\n\tfor _, closeFunc := range w.closers {\n\t\tif err := closeFunc(); err != nil {\n\t\t\t// Although unlikely, if an error happens here,\n\t\t\t// some generated files could be written to disk,\n\t\t\t// whereas others aren't.\n\t\t\t//\n\t\t\t// Regardless, we stop at the first error so that\n\t\t\t// we don't unnecessarily write more results.\n\t\t\treturn err\n\t\t}\n\t}\n\t// Re-initialize the cached values to be safe.\n\tw.readWriteBuckets = make(map[string]storage.ReadWriteBucket)\n\tw.closers = nil\n\treturn nil\n}\n\nfunc (w *responseWriter) addResponse(\n\tctx context.Context,\n\tresponse *pluginpb.CodeGeneratorResponse,\n\tpluginOut string,\n\tcreateOutDirIfNotExists bool,\n) error {\n\tswitch filepath.Ext(pluginOut) {\n\tcase \".jar\":\n\t\treturn w.writeZip(\n\t\t\tctx,\n\t\t\tresponse,\n\t\t\tpluginOut,\n\t\t\ttrue,\n\t\t\tcreateOutDirIfNotExists,\n\t\t)\n\tcase \".zip\":\n\t\treturn w.writeZip(\n\t\t\tctx,\n\t\t\tresponse,\n\t\t\tpluginOut,\n\t\t\tfalse,\n\t\t\tcreateOutDirIfNotExists,\n\t\t)\n\tdefault:\n\t\treturn w.writeDirectory(\n\t\t\tctx,\n\t\t\tresponse,\n\t\t\tpluginOut,\n\t\t\tcreateOutDirIfNotExists,\n\t\t)\n\t}\n}\n\nfunc (w *responseWriter) writeZip(\n\tctx context.Context,\n\tresponse *pluginpb.CodeGeneratorResponse,\n\toutFilePath string,\n\tincludeManifest bool,\n\tcreateOutDirIfNotExists bool,\n) (retErr error) {\n\toutDirPath := filepath.Dir(outFilePath)\n\tif readWriteBucket, ok := w.readWriteBuckets[outFilePath]; ok {\n\t\t// We already have a readWriteBucket for this outFilePath, so\n\t\t// we can write to the same bucket.\n\t\tif err := w.responseWriter.WriteResponse(\n\t\t\tctx,\n\t\t\treadWriteBucket,\n\t\t\tresponse,\n\t\t\tbufprotoplugin.WriteResponseWithInsertionPointReadBucket(readWriteBucket),\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\t// OK to use os.Stat instead of os.Lstat here.\n\tfileInfo, err := os.Stat(outDirPath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tif createOutDirIfNotExists {\n\t\t\t\tif err := os.MkdirAll(outDirPath, 0755); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn err\n\t} else if !fileInfo.IsDir() {\n\t\treturn fmt.Errorf(\"not a directory: %s\", outDirPath)\n\t}\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\tif includeManifest {\n\t\tif err := storage.PutPath(ctx, readWriteBucket, manifestPath, manifestContent); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tif err := w.responseWriter.WriteResponse(\n\t\tctx,\n\t\treadWriteBucket,\n\t\tresponse,\n\t\tbufprotoplugin.WriteResponseWithInsertionPointReadBucket(readWriteBucket),\n\t); err != nil {\n\t\treturn err\n\t}\n\t// Add this readWriteBucket to the set so that other plugins\n\t// can write to the same files (re: insertion points).\n\tw.readWriteBuckets[outFilePath] = readWriteBucket\n\tw.closers = append(w.closers, func() (retErr error) {\n\t\t// We're done writing all of the content into this\n\t\t// readWriteBucket, so we zip it when we flush.\n\t\tfile, err := os.Create(outFilePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer func() {\n\t\t\tretErr = errors.Join(retErr, file.Close())\n\t\t}()\n\t\t// protoc does not compress.\n\t\treturn storagearchive.Zip(ctx, readWriteBucket, file, false)\n\t})\n\treturn nil\n}\n\nfunc (w *responseWriter) writeDirectory(\n\tctx context.Context,\n\tresponse *pluginpb.CodeGeneratorResponse,\n\toutDirPath string,\n\tcreateOutDirIfNotExists bool,\n) error {\n\tif readWriteBucket, ok := w.readWriteBuckets[outDirPath]; ok {\n\t\t// We already have a readWriteBucket for this outDirPath, so\n\t\t// we can write to the same bucket.\n\t\tif err := w.responseWriter.WriteResponse(\n\t\t\tctx,\n\t\t\treadWriteBucket,\n\t\t\tresponse,\n\t\t\tbufprotoplugin.WriteResponseWithInsertionPointReadBucket(readWriteBucket),\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t}\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\tif err := w.responseWriter.WriteResponse(\n\t\tctx,\n\t\treadWriteBucket,\n\t\tresponse,\n\t\tbufprotoplugin.WriteResponseWithInsertionPointReadBucket(readWriteBucket),\n\t); err != nil {\n\t\treturn err\n\t}\n\t// Add this readWriteBucket to the set so that other plugins\n\t// can write to the same files (re: insertion points).\n\tw.readWriteBuckets[outDirPath] = readWriteBucket\n\tw.closers = append(w.closers, func() error {\n\t\tif createOutDirIfNotExists {\n\t\t\tif err := os.MkdirAll(outDirPath, 0755); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t// This checks that the directory exists.\n\t\tosReadWriteBucket, err := w.storageosProvider.NewReadWriteBucket(\n\t\t\toutDirPath,\n\t\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif _, err := storage.Copy(ctx, readWriteBucket, osReadWriteBucket); err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn nil\n\t})\n\treturn nil\n}\n\ntype responseWriterOptions struct {\n\tcreateOutDirIfNotExists bool\n}\n\nfunc newResponseWriterOptions() *responseWriterOptions {\n\treturn &responseWriterOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/bufprotopluginos/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufprotopluginos\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/generator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotoplugin\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\ntype generator struct {\n\tlogger  *slog.Logger\n\thandler protoplugin.Handler\n}\n\nfunc newGenerator(\n\tlogger *slog.Logger,\n\thandler protoplugin.Handler,\n) *generator {\n\treturn &generator{\n\t\tlogger:  logger,\n\t\thandler: handler,\n\t}\n}\n\nfunc (g *generator) Generate(\n\tctx context.Context,\n\tcontainer app.EnvStderrContainer,\n\tcodeGeneratorRequests []*pluginpb.CodeGeneratorRequest,\n) (*pluginpb.CodeGeneratorResponse, error) {\n\tprotopluginResponseWriter := protoplugin.NewResponseWriter(\n\t\tprotoplugin.ResponseWriterWithLenientValidation(\n\t\t\tfunc(err error) {\n\t\t\t\t_, _ = fmt.Fprintln(container.Stderr(), err.Error())\n\t\t\t},\n\t\t),\n\t)\n\tjobs := make([]func(context.Context) error, len(codeGeneratorRequests))\n\tfor i, codeGeneratorRequest := range codeGeneratorRequests {\n\t\tjobs[i] = func(ctx context.Context) error {\n\t\t\tprotopluginRequest, err := protoplugin.NewRequest(codeGeneratorRequest)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn g.handler.Handle(\n\t\t\t\tctx,\n\t\t\t\tprotoplugin.PluginEnv{\n\t\t\t\t\tEnviron: app.Environ(container),\n\t\t\t\t\tStderr:  container.Stderr(),\n\t\t\t\t},\n\t\t\t\tprotopluginResponseWriter,\n\t\t\t\tprotopluginRequest,\n\t\t\t)\n\t\t}\n\t}\n\tif err := thread.Parallelize(ctx, jobs, thread.ParallelizeWithCancelOnFailure()); err != nil {\n\t\treturn nil, err\n\t}\n\tcodeGeneratorResponse, err := protopluginResponseWriter.ToCodeGeneratorResponse()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif errString := codeGeneratorResponse.GetError(); errString != \"\" {\n\t\treturn nil, errors.New(errString)\n\t}\n\treturn codeGeneratorResponse, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/response_writer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotoplugin\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"log/slog\"\n\t\"strings\"\n\t\"unicode\"\n\t\"unicode/utf8\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"google.golang.org/protobuf/types/pluginpb\"\n)\n\ntype responseWriter struct {\n\tlogger *slog.Logger\n}\n\nfunc newResponseWriter(\n\tlogger *slog.Logger,\n) *responseWriter {\n\treturn &responseWriter{\n\t\tlogger: logger,\n\t}\n}\n\nfunc (h *responseWriter) WriteResponse(\n\tctx context.Context,\n\twriteBucket storage.WriteBucket,\n\tresponse *pluginpb.CodeGeneratorResponse,\n\toptions ...WriteResponseOption,\n) error {\n\twriteResponseOptions := newWriteResponseOptions()\n\tfor _, option := range options {\n\t\toption(writeResponseOptions)\n\t}\n\tfor _, file := range response.File {\n\t\tif file.GetInsertionPoint() != \"\" {\n\t\t\tif writeResponseOptions.insertionPointReadBucket == nil {\n\t\t\t\treturn &fs.PathError{Op: \"stat\", Path: file.GetName(), Err: fs.ErrNotExist}\n\t\t\t}\n\t\t\tif err := applyInsertionPoint(ctx, file, writeResponseOptions.insertionPointReadBucket, writeBucket); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else if err := storage.PutPath(ctx, writeBucket, file.GetName(), []byte(file.GetContent())); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// applyInsertionPoint inserts the content of the given file at the insertion point that it specifies.\n// For more details on insertion points, see the following:\n//\n// https://github.com/protocolbuffers/protobuf/blob/f5bdd7cd56aa86612e166706ed8ef139db06edf2/src/google/protobuf/compiler/plugin.proto#L135-L171\nfunc applyInsertionPoint(\n\tctx context.Context,\n\tfile *pluginpb.CodeGeneratorResponse_File,\n\treadBucket storage.ReadBucket,\n\twriteBucket storage.WriteBucket,\n) (retErr error) {\n\ttargetReadObjectCloser, err := readBucket.Get(ctx, file.GetName())\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, targetReadObjectCloser.Close())\n\t}()\n\tresultData, err := writeInsertionPoint(ctx, file, targetReadObjectCloser)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// This relies on storageos buckets maintaining existing file permissions\n\treturn storage.PutPath(ctx, writeBucket, file.GetName(), resultData)\n}\n\n// writeInsertionPoint writes the insertion point defined in insertionPointFile\n// to the targetFile and returns the result as []byte. The caller must ensure the\n// provided targetFile matches the file requested in insertionPointFile.Name.\nfunc writeInsertionPoint(\n\tctx context.Context,\n\tinsertionPointFile *pluginpb.CodeGeneratorResponse_File,\n\ttargetFile io.Reader,\n) (_ []byte, retErr error) {\n\ttargetScanner := bufio.NewScanner(targetFile)\n\tmatch := []byte(\"@@protoc_insertion_point(\" + insertionPointFile.GetInsertionPoint() + \")\")\n\tpostInsertionContent := bytes.NewBuffer(nil)\n\tpostInsertionContent.Grow(averageGeneratedFileSize)\n\t// TODO: We should respect the line endings in the generated file. This would\n\t// require either targetFile being an io.ReadSeeker and in the worst case\n\t// doing 2 full scans of the file (if it is a single line), or implementing\n\t// bufio.Scanner.Scan() inline\n\tnewline := []byte{'\\n'}\n\tvar found bool\n\tfor i := 0; targetScanner.Scan(); i++ {\n\t\tif i > 0 {\n\t\t\t// These writes cannot fail, they will panic if they cannot allocate.\n\t\t\t_, _ = postInsertionContent.Write(newline)\n\t\t}\n\t\ttargetLine := targetScanner.Bytes()\n\t\tif !bytes.Contains(targetLine, match) {\n\t\t\t// These writes cannot fail, they will panic if they cannot allocate.\n\t\t\t_, _ = postInsertionContent.Write(targetLine)\n\t\t\tcontinue\n\t\t}\n\t\t// For each line in then new content, apply the\n\t\t// same amount of whitespace. This is important\n\t\t// for specific languages, e.g. Python.\n\t\twhitespace := leadingWhitespace(targetLine)\n\n\t\t// Insert the content from the insertion point file. Handle newlines in\n\t\t// a platform-agnostic manner.\n\t\tinsertedContentReader := strings.NewReader(insertionPointFile.GetContent())\n\t\twriteWithPrefixAndLineEnding(postInsertionContent, insertedContentReader, whitespace, newline)\n\n\t\t// Code inserted at this point is placed immediately\n\t\t// above the line containing the insertion point, so\n\t\t// we include it last.\n\t\t// These writes cannot fail, they will panic if they cannot\n\t\t// allocate\n\t\t_, _ = postInsertionContent.Write(targetLine)\n\t\tfound = true\n\t}\n\tif err := targetScanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\tif !found {\n\t\treturn nil, fmt.Errorf(\"could not find insertion point %q in %q\", insertionPointFile.GetInsertionPoint(), insertionPointFile.GetName())\n\t}\n\treturn postInsertionContent.Bytes(), nil\n}\n\n// leadingWhitespace iterates through the given string,\n// and returns the leading whitespace substring, if any,\n// respecting utf-8 encoding.\n//\n//\tleadingWhitespace(\"\\u205F   foo \") -> \"\\u205F   \"\nfunc leadingWhitespace(buf []byte) []byte {\n\tleadingSize := 0\n\titerBuf := buf\n\tfor len(iterBuf) > 0 {\n\t\tr, size := utf8.DecodeRune(iterBuf)\n\t\t// protobuf strings must always be valid UTF8\n\t\t// https://developers.google.com/protocol-buffers/docs/proto3#scalar\n\t\t// Additionally, utf8.RuneError is not a space so we'll terminate\n\t\t// and return the leading, valid, UTF8 whitespace sequence.\n\t\tif !unicode.IsSpace(r) {\n\t\t\tout := make([]byte, leadingSize)\n\t\t\tcopy(out, buf)\n\t\t\treturn out\n\t\t}\n\t\tleadingSize += size\n\t\titerBuf = iterBuf[size:]\n\t}\n\treturn buf\n}\n\n// writeWithPrefixAndLineEnding iterates over each of the given reader's lines\n// prepends prefix, and appends the newline sequence.\nfunc writeWithPrefixAndLineEnding(dst *bytes.Buffer, src io.Reader, prefix, newline []byte) {\n\tscanner := bufio.NewScanner(src)\n\tfor scanner.Scan() {\n\t\t// These writes cannot fail, they will panic if they cannot allocate.\n\t\t_, _ = dst.Write(prefix)\n\t\t_, _ = dst.Write(scanner.Bytes())\n\t\t_, _ = dst.Write(newline)\n\t}\n}\n\ntype writeResponseOptions struct {\n\tinsertionPointReadBucket storage.ReadBucket\n}\n\nfunc newWriteResponseOptions() *writeResponseOptions {\n\treturn &writeResponseOptions{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotoplugin/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufprotoplugin\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/bufprotosource.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource defines minimal interfaces for Protobuf descriptor types.\n//\n// This is done so that the backing package can be swapped out easily.\n//\n// All values that return SourceLocation can be nil.\n//\n// Testing is currently implicitly done through the bufcheck packages, however\n// if this were to be split out into a separate library, it would need a separate\n// testing suite.\npackage bufprotosource\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strconv\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufparse\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"github.com/google/uuid\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nconst (\n\t// SyntaxUnspecified represents no syntax being specified.\n\t//\n\t// This is functionally equivalent to SyntaxProto2.\n\tSyntaxUnspecified Syntax = iota + 1\n\t// SyntaxProto2 represents the proto2 syntax.\n\tSyntaxProto2\n\t// SyntaxProto3 represents the proto3 syntax.\n\tSyntaxProto3\n\t// SyntaxEditions represents the editions syntax.\n\tSyntaxEditions\n)\n\n// Syntax is the syntax of a file.\ntype Syntax int\n\n// String returns the string representation of s\nfunc (s Syntax) String() string {\n\tswitch s {\n\tcase SyntaxUnspecified:\n\t\treturn \"unspecified\"\n\tcase SyntaxProto2:\n\t\treturn \"proto2\"\n\tcase SyntaxProto3:\n\t\treturn \"proto3\"\n\tcase SyntaxEditions:\n\t\treturn \"editions\"\n\tdefault:\n\t\treturn strconv.Itoa(int(s))\n\t}\n}\n\n// Descriptor is the base interface for a descriptor type.\ntype Descriptor interface {\n\t// File returns the associated File.\n\t//\n\t// Always non-nil.\n\tFile() File\n}\n\n// LocationDescriptor is the base interface for a descriptor type with a location.\ntype LocationDescriptor interface {\n\tDescriptor\n\n\t// Location returns the location of the entire descriptor.\n\t//\n\t// Can return nil, although will generally not be nil.\n\tLocation() Location\n}\n\n// NamedDescriptor is the base interface for a named descriptor type.\ntype NamedDescriptor interface {\n\tLocationDescriptor\n\n\t// FullName returns the fully-qualified name, i.e. some.pkg.Nested.ParentMessage.FooEnum.ENUM_VALUE.\n\t//\n\t// Always non-empty.\n\tFullName() string\n\t// NestedName returns the full nested name without the package, i.e. Nested.ParentMessage.FooEnum\n\t// or Nested.ParentMessage.FooEnum.ENUM_VALUE.\n\t//\n\t// Always non-empty.\n\tNestedName() string\n\t// Name returns the short name, or the name of a value or field, i.e. FooEnum or ENUM_VALUE.\n\t//\n\t// Always non-empty.\n\tName() string\n\t// NameLocation returns the location of the name of the descriptor.\n\t//\n\t// If the backing descriptor does not have name-level resolution, this will\n\t// attempt to return a location of the entire descriptor.\n\t//\n\t// If the backing descriptor has comments for the entire descriptor, these\n\t// will be added to the named location.\n\t//\n\t// Can return nil.\n\tNameLocation() Location\n}\n\n// ContainerDescriptor contains Enums and Messages.\ntype ContainerDescriptor interface {\n\tEnums() []Enum\n\tMessages() []Message\n\tExtensions() []Field\n}\n\n// OptionExtensionDescriptor contains options and option extensions.\ntype OptionExtensionDescriptor interface {\n\t// Features returns information about any features present in the\n\t// options. It only provides information about standard features,\n\t// not custom features (i.e. extensions of google.protobuf.FeatureSet).\n\t//\n\t// Never returns nil.\n\tFeatures() FeaturesDescriptor\n\n\t// OptionExtension returns the value for an options extension field.\n\t//\n\t// Returns false if the extension is not set.\n\t//\n\t// See https://pkg.go.dev/google.golang.org/protobuf/proto#HasExtension\n\t// See https://pkg.go.dev/google.golang.org/protobuf/proto#GetExtension\n\tOptionExtension(extensionType protoreflect.ExtensionType) (any, bool)\n\n\t// OptionExtensionLocation returns the source location where the given extension\n\t// field value is defined. This is the same as OptionLocation, but specific to\n\t// extension fields.\n\tOptionExtensionLocation(extensionType protoreflect.ExtensionType, extraPath ...int32) Location\n\t// TODO: Should we just delete OptionExtensionLocation?\n\n\t// OptionLocation returns the source location where the given option field\n\t// value is defined. The extra path can be additional path elements, for getting\n\t// getting the location of specific elements inside the field, for message\n\t// and repeated values.\n\t//\n\t// If a precise location cannot be found, but a general one can be, the general\n\t// location will be returned. For example, if a specific field inside a message\n\t// field is requested but the source code info only includes information\n\t// about the message itself (and not that particular field), the location of the\n\t// message value is returned. Conversely, if a message location is requested but\n\t// the source code info only has information about specific fields inside that\n\t// message, the first such location is returned. Similarly, if multiple locations\n\t// are in source code info for the requested value, the first one is returned.\n\t//\n\t// If no relevant location is found in source code info, this returns nil.\n\tOptionLocation(field protoreflect.FieldDescriptor, extraPath ...int32) Location\n\n\t// PresentExtensionNumbers returns field numbers for all extensions/custom options\n\t// that have a set value on this descriptor.\n\tPresentExtensionNumbers() []int32\n\n\t// ForEachPresentOption iterates through all options that have a set value on this\n\t// descriptor, invoking fn for each present option.\n\t//\n\t// If fn returns false, the iteration is terminated and ForEachPresentOption\n\t// immediately returns.\n\tForEachPresentOption(fn func(protoreflect.FieldDescriptor, protoreflect.Value) bool)\n}\n\n// FeaturesDescriptor contains information about features, which are\n// special options in Protobuf Editions.\ntype FeaturesDescriptor interface {\n\t// FieldPresenceLocation returns the location for the field_presence\n\t// feature, if it is present in the options of the containing element.\n\tFieldPresenceLocation() Location\n\t// EnumTypeLocation returns the location for the enum_type\n\t// feature, if it is present in the options of the containing element.\n\tEnumTypeLocation() Location\n\t// RepeatedFieldEncodingLocation returns the location for the repeated_field_encoding\n\t// feature, if it is present in the options of the containing element.\n\tRepeatedFieldEncodingLocation() Location\n\t// UTF8ValidationLocation returns the location for the utf8_validation\n\t// feature, if it is present in the options of the containing element.\n\tUTF8ValidationLocation() Location\n\t// MessageEncodingLocation returns the location for the message_encoding\n\t// feature, if it is present in the options of the containing element.\n\tMessageEncodingLocation() Location\n\t// JSONFormatLocation returns the location for the json_format\n\t// feature, if it is present in the options of the containing element.\n\tJSONFormatLocation() Location\n}\n\n// Location defines source code info location information.\n//\n// May be extended in the future to include comments.\n//\n// Note that unlike SourceCodeInfo_Location, these are not zero-indexed.\ntype Location interface {\n\t// FilePath returns the path of the File associated with this Location.\n\t//\n\t// This is the same as doing File().Path() on the Descriptor that this Location came from.\n\t// We additionally store this information on the Location for convenience.\n\tFilePath() string\n\tStartLine() int\n\tStartColumn() int\n\tEndLine() int\n\tEndColumn() int\n\tLeadingComments() string\n\tTrailingComments() string\n\t// NOT a copy. Do not modify.\n\tLeadingDetachedComments() []string\n\t// NOT a copy. Do not modify.\n\tSourcePath() protoreflect.SourcePath\n}\n\n// ModuleFullName is a module full name.\ntype ModuleFullName interface {\n\tRegistry() string\n\tOwner() string\n\tName() string\n}\n\n// FileInfo contains Protobuf file info.\ntype FileInfo interface {\n\t// Path is the path of the file relative to the root it is contained within.\n\t// This will be normalized, validated and never empty,\n\t// This will be unique within a given Image.\n\tPath() string\n\t// ExternalPath returns the path that identifies this file externally.\n\t//\n\t// This will be unnormalized.\n\t// Never empty. Falls back to Path if there is not an external path.\n\t//\n\t// Example:\n\t//\n\t// Assume we had the input path /foo/bar which is a local directory.\n\t//   Path: one/one.proto\n\t//   RootDirPath: proto\n\t//   ExternalPath: /foo/bar/proto/one/one.proto\n\tExternalPath() string\n\t// FullName is the module that this file came from.\n\t//\n\t// Note this *can* be nil if we did not build from a named module.\n\t// All code must assume this can be nil.\n\t// Note that nil checking should work since the backing type is always a pointer.\n\tFullName() bufparse.FullName\n\t// CommitID is the commit for the module that this file came from.\n\t//\n\t// This will only be set if FullName is set, but may not be set\n\t// even if FullName is set, that is commit is optional information\n\t// even if we know what module this file came from.\n\tCommitID() uuid.UUID\n\t// IsImport returns true if this file is an import.\n\tIsImport() bool\n}\n\n// File is a file descriptor.\ntype File interface {\n\tDescriptor\n\tFileInfo\n\n\t// Top-level only.\n\tContainerDescriptor\n\tOptionExtensionDescriptor\n\n\tSyntax() Syntax\n\tPackage() string\n\tFileImports() []FileImport\n\tServices() []Service\n\tExtensions() []Field\n\tEdition() descriptorpb.Edition\n\n\tCsharpNamespace() string\n\tGoPackage() string\n\tJavaMultipleFiles() bool\n\tJavaOuterClassname() string\n\tJavaPackage() string\n\tJavaStringCheckUtf8() bool\n\tObjcClassPrefix() string\n\tPhpClassPrefix() string\n\tPhpNamespace() string\n\tPhpMetadataNamespace() string\n\tRubyPackage() string\n\tSwiftPrefix() string\n\tDeprecated() bool\n\n\tOptimizeFor() descriptorpb.FileOptions_OptimizeMode\n\tCcGenericServices() bool\n\tJavaGenericServices() bool\n\tPyGenericServices() bool\n\tCcEnableArenas() bool\n\n\tSyntaxLocation() Location\n\tPackageLocation() Location\n\tCsharpNamespaceLocation() Location\n\tGoPackageLocation() Location\n\tJavaMultipleFilesLocation() Location\n\tJavaOuterClassnameLocation() Location\n\tJavaPackageLocation() Location\n\tJavaStringCheckUtf8Location() Location\n\tObjcClassPrefixLocation() Location\n\tPhpClassPrefixLocation() Location\n\tPhpNamespaceLocation() Location\n\tPhpMetadataNamespaceLocation() Location\n\tRubyPackageLocation() Location\n\tSwiftPrefixLocation() Location\n\n\tOptimizeForLocation() Location\n\tCcGenericServicesLocation() Location\n\tJavaGenericServicesLocation() Location\n\tPyGenericServicesLocation() Location\n\tCcEnableArenasLocation() Location\n\n\t// FileDescriptor returns the backing FileDescriptor for this File.\n\t//\n\t// Users should prefer to use the core protosource API to read properties of the File as opposed\n\t// to using the FileDescriptor directly, however we needed to add this to be able to build\n\t// Resolvers, and did not want to rewrite the whole API.\n\tFileDescriptor() protodescriptor.FileDescriptor\n}\n\n// FileImport is a file import descriptor.\ntype FileImport interface {\n\tLocationDescriptor\n\n\tImport() string\n\tIsPublic() bool\n\tIsWeak() bool\n\tIsUnused() bool\n}\n\n// TagRange is a tag range from start to end.\ntype TagRange interface {\n\tLocationDescriptor\n\n\t// Start is the start of the range.\n\tStart() int\n\t// End is the end of the range.\n\t// Inclusive.\n\tEnd() int\n\t// Max says that the End is the max.\n\tMax() bool\n}\n\n// ReservedName is a reserved name for an enum or message.\ntype ReservedName interface {\n\tLocationDescriptor\n\n\tValue() string\n}\n\n// ReservedDescriptor has reserved ranges and names.\ntype ReservedDescriptor interface {\n\tReservedTagRanges() []TagRange\n\tReservedNames() []ReservedName\n}\n\n// EnumRange is a TagRange for Enums.\ntype EnumRange interface {\n\tTagRange\n\n\tEnum() Enum\n}\n\n// MessageRange is a TagRange for Messages.\ntype MessageRange interface {\n\tTagRange\n\n\tMessage() Message\n}\n\n// ExtensionRange represents an extension range in Messages.\ntype ExtensionRange interface {\n\tMessageRange\n\tOptionExtensionDescriptor\n}\n\n// Enum is an enum descriptor.\ntype Enum interface {\n\tNamedDescriptor\n\tReservedDescriptor\n\tOptionExtensionDescriptor\n\n\tValues() []EnumValue\n\tReservedEnumRanges() []EnumRange\n\n\tAllowAlias() bool\n\tDeprecatedLegacyJSONFieldConflicts() bool\n\tDeprecated() bool\n\tAllowAliasLocation() Location\n\n\t// Will return nil if this is a top-level Enum\n\tParent() Message\n\n\t// AsDescriptor returns a [protoreflect.Descriptor] that\n\t// corresponds to this message. This should only be needed\n\t// for reflection usages.\n\tAsDescriptor() (protoreflect.EnumDescriptor, error)\n}\n\n// EnumValue is an enum value descriptor.\ntype EnumValue interface {\n\tNamedDescriptor\n\tOptionExtensionDescriptor\n\n\tEnum() Enum\n\tNumber() int\n\n\tDeprecated() bool\n\tNumberLocation() Location\n}\n\n// Message is a message descriptor.\ntype Message interface {\n\tNamedDescriptor\n\t// Only those directly nested under this message.\n\tContainerDescriptor\n\tReservedDescriptor\n\tOptionExtensionDescriptor\n\n\t// Includes fields in oneofs.\n\tFields() []Field\n\tExtensions() []Field\n\tOneofs() []Oneof\n\tExtensionRanges() []ExtensionRange\n\tExtensionMessageRanges() []MessageRange\n\tReservedMessageRanges() []MessageRange\n\n\t// Will return nil if this is a top-level message\n\tParent() Message\n\tIsMapEntry() bool\n\n\tMessageSetWireFormat() bool\n\tNoStandardDescriptorAccessor() bool\n\tDeprecatedLegacyJSONFieldConflicts() bool\n\tDeprecated() bool\n\tMessageSetWireFormatLocation() Location\n\tNoStandardDescriptorAccessorLocation() Location\n\n\t// AsDescriptor returns a [protoreflect.Descriptor] that\n\t// corresponds to this message. This should only be needed\n\t// for reflection usages.\n\tAsDescriptor() (protoreflect.MessageDescriptor, error)\n}\n\n// Field is a field descriptor.\ntype Field interface {\n\tNamedDescriptor\n\tOptionExtensionDescriptor\n\n\t// May be nil if this is attached to a file.\n\tParentMessage() Message\n\tNumber() int\n\tLabel() descriptorpb.FieldDescriptorProto_Label\n\tType() descriptorpb.FieldDescriptorProto_Type\n\tTypeName() string\n\t// may be nil\n\tOneof() Oneof\n\tProto3Optional() bool\n\tJSONName() string\n\tJSType() descriptorpb.FieldOptions_JSType\n\tCType() descriptorpb.FieldOptions_CType\n\tRetention() descriptorpb.FieldOptions_OptionRetention\n\tTargets() []descriptorpb.FieldOptions_OptionTargetType\n\tDebugRedact() bool\n\t// Set vs unset matters for packed\n\t// See the comments on descriptor.proto\n\tPacked() *bool\n\tDeprecated() bool\n\t// Default is the field's default value, encoded as a string.\n\t// Instead of trying to interpret or decode this string, it is\n\t// typically better to instead use AsDescriptor() and query the\n\t// Default() method of the resulting protoreflect.FieldDescriptor.\n\t// If empty, the default value is a zero value for the field's\n\t// type. Defaults cannot be set for repeated or message fields\n\t// (which also means it cannot be set for map fields).\n\tDefault() string\n\t// Empty string unless the field is part of an extension\n\tExtendee() string\n\n\tNumberLocation() Location\n\tTypeLocation() Location\n\tTypeNameLocation() Location\n\tJSONNameLocation() Location\n\tJSTypeLocation() Location\n\tCTypeLocation() Location\n\tPackedLocation() Location\n\tDefaultLocation() Location\n\tExtendeeLocation() Location\n\n\t// AsDescriptor returns a [protoreflect.Descriptor] that\n\t// corresponds to this message. This should only be needed\n\t// for reflection usages.\n\tAsDescriptor() (protoreflect.FieldDescriptor, error)\n}\n\n// Oneof is a oneof descriptor.\ntype Oneof interface {\n\tNamedDescriptor\n\tOptionExtensionDescriptor\n\n\tMessage() Message\n\tFields() []Field\n\n\t// AsDescriptor returns a [protoreflect.Descriptor] that\n\t// corresponds to this message. This should only be needed\n\t// for reflection usages.\n\tAsDescriptor() (protoreflect.OneofDescriptor, error)\n}\n\n// Service is a service descriptor.\ntype Service interface {\n\tNamedDescriptor\n\tOptionExtensionDescriptor\n\n\tMethods() []Method\n\tDeprecated() bool\n}\n\n// Method is a method descriptor.\ntype Method interface {\n\tNamedDescriptor\n\tOptionExtensionDescriptor\n\n\tService() Service\n\tInputTypeName() string\n\tOutputTypeName() string\n\tClientStreaming() bool\n\tServerStreaming() bool\n\tInputTypeLocation() Location\n\tOutputTypeLocation() Location\n\n\tDeprecated() bool\n\tIdempotencyLevel() descriptorpb.MethodOptions_IdempotencyLevel\n\tIdempotencyLevelLocation() Location\n}\n\n// InputFile is a file used as input when building Files.\ntype InputFile interface {\n\tFileInfo\n\n\t// FileDescriptorProto is the backing *descriptorpb.FileDescriptorProto.\n\t//\n\t// This will never be nil.\n\t// The value Path() is equal to FileDescriptorProto().GetName() .\n\tFileDescriptorProto() *descriptorpb.FileDescriptorProto\n\t// IsSyntaxUnspecified will be true if the syntax was not explicitly specified.\n\tIsSyntaxUnspecified() bool\n\t// UnusedDependencyIndexes returns the indexes of the unused dependencies within\n\t// FileDescriptorProto().GetDependency().\n\t//\n\t// All indexes will be valid.\n\t// Will return nil if empty.\n\tUnusedDependencyIndexes() []int32\n}\n\n// NewFiles converts the input Image into Files.\nfunc NewFiles[F InputFile](\n\tctx context.Context,\n\tinputFiles []F,\n\tresolver protodesc.Resolver,\n) ([]File, error) {\n\treturn newFiles(ctx, inputFiles, resolver)\n}\n\n// SortFiles sorts the Files by FilePath.\nfunc SortFiles(files []File) {\n\tsort.Slice(files, func(i int, j int) bool { return files[i].Path() < files[j].Path() })\n}\n\n// FilePathToFile maps the Files to a map from Path() to File.\n//\n// Returns error if file paths are not unique.\nfunc FilePathToFile(files ...File) (map[string]File, error) {\n\tfilePathToFile := make(map[string]File, len(files))\n\tfor _, file := range files {\n\t\tfilePath := file.Path()\n\t\tif _, ok := filePathToFile[filePath]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate filePath: %q\", filePath)\n\t\t}\n\t\tfilePathToFile[filePath] = file\n\t}\n\treturn filePathToFile, nil\n}\n\n// DirPathToFiles maps the Files to a map from directory\n// to the slice of Files in that directory.\n//\n// Returns error if file paths are not unique.\n// Directories are normalized.\n//\n// Files will be sorted by FilePath.\nfunc DirPathToFiles(files ...File) (map[string][]File, error) {\n\treturn mapFiles(files, func(file File) string { return normalpath.Dir(file.Path()) })\n}\n\n// PackageToFiles maps the Files to a map from Protobuf package\n// to the slice of Files in that package.\n//\n// Returns error if file paths are not unique.\n//\n// Files will be sorted by Path.\nfunc PackageToFiles(files ...File) (map[string][]File, error) {\n\t// works for no package since \"\" is a valid map key\n\treturn mapFiles(files, File.Package)\n}\n\n// ForEachEnum calls f on each Enum in the given ContainerDescriptor, including nested Enums.\n//\n// Returns error and stops iterating if f returns error.\n// Never returns error unless f returns error.\nfunc ForEachEnum(f func(Enum) error, containerDescriptor ContainerDescriptor) error {\n\tfor _, enum := range containerDescriptor.Enums() {\n\t\tif err := f(enum); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor _, message := range containerDescriptor.Messages() {\n\t\tif err := ForEachEnum(f, message); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// ForEachExtension calls f on each extension Field in the given ContainerDescriptor,\n// including nested extensions.\n//\n// Returns error and stops iterating if f returns error.\n// Never returns error unless f returns error.\nfunc ForEachExtension(f func(Field) error, containerDescriptor ContainerDescriptor) error {\n\tfor _, extension := range containerDescriptor.Extensions() {\n\t\tif err := f(extension); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor _, message := range containerDescriptor.Messages() {\n\t\tif err := ForEachExtension(f, message); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// ForEachMessage calls f on each Message in the given ContainerDescriptor, including nested Messages.\n//\n// Returns error and stops iterating if f returns error\n// Never returns error unless f returns error.\nfunc ForEachMessage(f func(Message) error, containerDescriptor ContainerDescriptor) error {\n\tfor _, message := range containerDescriptor.Messages() {\n\t\tif err := f(message); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := ForEachMessage(f, message); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// NestedNameToEnum maps the Enums in the ContainerDescriptor to a map from\n// nested name to Enum.\n//\n// Returns error if Enums do not have unique nested names within the ContainerDescriptor,\n// which should generally never happen for properly-formed ContainerDescriptors.\nfunc NestedNameToEnum(containerDescriptor ContainerDescriptor) (map[string]Enum, error) {\n\tnestedNameToEnum := make(map[string]Enum)\n\tif err := ForEachEnum(\n\t\tfunc(enum Enum) error {\n\t\t\tnestedName := enum.NestedName()\n\t\t\tif _, ok := nestedNameToEnum[nestedName]; ok {\n\t\t\t\treturn fmt.Errorf(\"duplicate enum: %q\", nestedName)\n\t\t\t}\n\t\t\tnestedNameToEnum[nestedName] = enum\n\t\t\treturn nil\n\t\t},\n\t\tcontainerDescriptor,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn nestedNameToEnum, nil\n}\n\n// NestedNameToExtension maps the Enums in the ContainerDescriptor to a map from\n// nested name to extension Field.\n//\n// Returns error if extensions do not have unique nested names within the\n// ContainerDescriptor, which should generally never happen for properly-formed\n// ContainerDescriptors.\nfunc NestedNameToExtension(containerDescriptor ContainerDescriptor) (map[string]Field, error) {\n\tnestedNameToExtension := make(map[string]Field)\n\tif err := ForEachExtension(\n\t\tfunc(extension Field) error {\n\t\t\tnestedName := extension.NestedName()\n\t\t\tif _, ok := nestedNameToExtension[nestedName]; ok {\n\t\t\t\treturn fmt.Errorf(\"duplicate extension: %q\", nestedName)\n\t\t\t}\n\t\t\tnestedNameToExtension[nestedName] = extension\n\t\t\treturn nil\n\t\t},\n\t\tcontainerDescriptor,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn nestedNameToExtension, nil\n}\n\n// FullNameToEnum maps the Enums in the Files to a map from full name to enum.\n//\n// Returns error if the Enums do not have unique full names within the Files,\n// which should generally never happen for properly-formed Files.\nfunc FullNameToEnum(files ...File) (map[string]Enum, error) {\n\tfullNameToEnum := make(map[string]Enum)\n\tfor _, file := range files {\n\t\tif err := ForEachEnum(\n\t\t\tfunc(enum Enum) error {\n\t\t\t\tfullName := enum.FullName()\n\t\t\t\tif _, ok := fullNameToEnum[fullName]; ok {\n\t\t\t\t\treturn fmt.Errorf(\"duplicate enum: %q\", fullName)\n\t\t\t\t}\n\t\t\t\tfullNameToEnum[fullName] = enum\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tfile,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn fullNameToEnum, nil\n}\n\n// PackageToNestedNameToEnum maps the Enums in the Files to a map from\n// package to nested name to Enum.\n//\n// Returns error if the Enums do not have unique nested names within the packages,\n// which should generally never happen for properly-formed Files.\nfunc PackageToNestedNameToEnum(files ...File) (map[string]map[string]Enum, error) {\n\tpackageToNestedNameToEnum := make(map[string]map[string]Enum)\n\tfor _, file := range files {\n\t\tif err := ForEachEnum(\n\t\t\tfunc(enum Enum) error {\n\t\t\t\tpkg := enum.File().Package()\n\t\t\t\tnestedName := enum.NestedName()\n\t\t\t\tnestedNameToEnum, ok := packageToNestedNameToEnum[pkg]\n\t\t\t\tif !ok {\n\t\t\t\t\tnestedNameToEnum = make(map[string]Enum)\n\t\t\t\t\tpackageToNestedNameToEnum[pkg] = nestedNameToEnum\n\t\t\t\t}\n\t\t\t\tif _, ok := nestedNameToEnum[nestedName]; ok {\n\t\t\t\t\treturn fmt.Errorf(\"duplicate enum in package %q: %q\", pkg, nestedName)\n\t\t\t\t}\n\t\t\t\tnestedNameToEnum[nestedName] = enum\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tfile,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn packageToNestedNameToEnum, nil\n}\n\n// PackageToNestedNameToExtension maps the extension Fields in the Files to a map\n// from package to nested name to Field.\n//\n// Returns error if the extension do not have unique nested names within the packages,\n// which should generally never happen for properly-formed Files.\nfunc PackageToNestedNameToExtension(files ...File) (map[string]map[string]Field, error) {\n\tpackageToNestedNameToExtension := make(map[string]map[string]Field)\n\tfor _, file := range files {\n\t\tif err := ForEachExtension(\n\t\t\tfunc(enum Field) error {\n\t\t\t\tpkg := enum.File().Package()\n\t\t\t\tnestedName := enum.NestedName()\n\t\t\t\tnestedNameToExtension, ok := packageToNestedNameToExtension[pkg]\n\t\t\t\tif !ok {\n\t\t\t\t\tnestedNameToExtension = make(map[string]Field)\n\t\t\t\t\tpackageToNestedNameToExtension[pkg] = nestedNameToExtension\n\t\t\t\t}\n\t\t\t\tif _, ok := nestedNameToExtension[nestedName]; ok {\n\t\t\t\t\treturn fmt.Errorf(\"duplicate extension in package %q: %q\", pkg, nestedName)\n\t\t\t\t}\n\t\t\t\tnestedNameToExtension[nestedName] = enum\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tfile,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn packageToNestedNameToExtension, nil\n}\n\n// NameToEnumValue maps the EnumValues in the Enum to a map from name to EnumValue.\n//\n// Returns error if the EnumValues do not have unique names within the Enum,\n// which should generally never happen for properly-formed Enums.\nfunc NameToEnumValue(enum Enum) (map[string]EnumValue, error) {\n\tnameToEnumValue := make(map[string]EnumValue)\n\tfor _, enumValue := range enum.Values() {\n\t\tname := enumValue.Name()\n\t\tif _, ok := nameToEnumValue[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate enum value name for enum %q: %q\", enum.NestedName(), name)\n\t\t}\n\t\tnameToEnumValue[name] = enumValue\n\t}\n\treturn nameToEnumValue, nil\n}\n\n// NumberToNameToEnumValue maps the EnumValues in the Enum to a map from number to name to EnumValue.\n//\n// Duplicates by number may occur if allow_alias = true.\n//\n// Returns error if the EnumValues do not have unique names within the Enum for a given number,\n// which should generally never happen for properly-formed Enums.\nfunc NumberToNameToEnumValue(enum Enum) (map[int]map[string]EnumValue, error) {\n\tnumberToNameToEnumValue := make(map[int]map[string]EnumValue)\n\tfor _, enumValue := range enum.Values() {\n\t\tnumber := enumValue.Number()\n\t\tnameToEnumValue, ok := numberToNameToEnumValue[number]\n\t\tif !ok {\n\t\t\tnameToEnumValue = make(map[string]EnumValue)\n\t\t\tnumberToNameToEnumValue[number] = nameToEnumValue\n\t\t}\n\t\tname := enumValue.Name()\n\t\tif _, ok := nameToEnumValue[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate enum value name for enum %q: %q\", enum.NestedName(), name)\n\t\t}\n\t\tnameToEnumValue[name] = enumValue\n\t}\n\treturn numberToNameToEnumValue, nil\n}\n\n// NestedNameToMessage maps the Messages in the ContainerDescriptor to a map from\n// nested name to Message.\n//\n// Returns error if Messages do not have unique nested names within the ContainerDescriptor,\n// which should generally never happen for properly-formed files.\nfunc NestedNameToMessage(containerDescriptor ContainerDescriptor) (map[string]Message, error) {\n\tnestedNameToMessage := make(map[string]Message)\n\tif err := ForEachMessage(\n\t\tfunc(message Message) error {\n\t\t\tnestedName := message.NestedName()\n\t\t\tif _, ok := nestedNameToMessage[nestedName]; ok {\n\t\t\t\treturn fmt.Errorf(\"duplicate message: %q\", nestedName)\n\t\t\t}\n\t\t\tnestedNameToMessage[nestedName] = message\n\t\t\treturn nil\n\t\t},\n\t\tcontainerDescriptor,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn nestedNameToMessage, nil\n}\n\n// FullNameToMessage maps the Messages in the Files to a map from full name to message.\n//\n// Returns error if the Messages do not have unique full names within the Files,\n// which should generally never happen for properly-formed Files.\nfunc FullNameToMessage(files ...File) (map[string]Message, error) {\n\tfullNameToMessage := make(map[string]Message)\n\tfor _, file := range files {\n\t\tif err := ForEachMessage(\n\t\t\tfunc(message Message) error {\n\t\t\t\tfullName := message.FullName()\n\t\t\t\tif _, ok := fullNameToMessage[fullName]; ok {\n\t\t\t\t\treturn fmt.Errorf(\"duplicate message: %q\", fullName)\n\t\t\t\t}\n\t\t\t\tfullNameToMessage[fullName] = message\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tfile,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn fullNameToMessage, nil\n}\n\n// PackageToNestedNameToMessage maps the Messages in the Files to a map from\n// package to nested name to Message.\n//\n// Returns error if the Messages do not have unique nested names within the packages,\n// which should generally never happen for properly-formed Files.\nfunc PackageToNestedNameToMessage(files ...File) (map[string]map[string]Message, error) {\n\tpackageToNestedNameToMessage := make(map[string]map[string]Message)\n\tfor _, file := range files {\n\t\tif err := ForEachMessage(\n\t\t\tfunc(message Message) error {\n\t\t\t\tpkg := message.File().Package()\n\t\t\t\tnestedName := message.NestedName()\n\t\t\t\tnestedNameToMessage, ok := packageToNestedNameToMessage[pkg]\n\t\t\t\tif !ok {\n\t\t\t\t\tnestedNameToMessage = make(map[string]Message)\n\t\t\t\t\tpackageToNestedNameToMessage[pkg] = nestedNameToMessage\n\t\t\t\t}\n\t\t\t\tif _, ok := nestedNameToMessage[nestedName]; ok {\n\t\t\t\t\treturn fmt.Errorf(\"duplicate message in package %q: %q\", pkg, nestedName)\n\t\t\t\t}\n\t\t\t\tnestedNameToMessage[nestedName] = message\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tfile,\n\t\t); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn packageToNestedNameToMessage, nil\n}\n\n// NumberToMessageField maps the Fields in the Message to a map from number to Field.\n//\n// Does not includes extensions.\n//\n// Returns error if the Fields do not have unique numbers within the Message,\n// which should generally never happen for properly-formed Messages.\nfunc NumberToMessageField(message Message) (map[int]Field, error) {\n\tnumberToMessageField := make(map[int]Field)\n\tfor _, messageField := range message.Fields() {\n\t\tnumber := messageField.Number()\n\t\tif _, ok := numberToMessageField[number]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate message field: %d\", number)\n\t\t}\n\t\tnumberToMessageField[number] = messageField\n\t}\n\treturn numberToMessageField, nil\n}\n\n// NumberToMessageFieldForLabel maps the Fields with the given label in the message\n// to a map from number to Field.\n//\n// Does not includes extensions.\n//\n// Returns error if the Fields do not have unique numbers within the Message,\n// which should generally never happen for properly-formed Messages.\nfunc NumberToMessageFieldForLabel(message Message, label descriptorpb.FieldDescriptorProto_Label) (map[int]Field, error) {\n\tnumberToField, err := NumberToMessageField(message)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor number, field := range numberToField {\n\t\tif field.Label() != label {\n\t\t\tdelete(numberToField, number)\n\t\t}\n\t}\n\treturn numberToField, nil\n}\n\n// NameToMessageOneof maps the Oneofs in the Message to a map from name to Oneof.\n//\n// Returns error if the Oneofs do not have unique names within the Message,\n// which should generally never happen for properly-formed Messages.\nfunc NameToMessageOneof(message Message) (map[string]Oneof, error) {\n\tnameToMessageOneof := make(map[string]Oneof)\n\tfor _, messageOneof := range message.Oneofs() {\n\t\tname := messageOneof.Name()\n\t\tif _, ok := nameToMessageOneof[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate message oneof: %q\", name)\n\t\t}\n\t\tnameToMessageOneof[name] = messageOneof\n\t}\n\treturn nameToMessageOneof, nil\n}\n\n// NameToService maps the Services in the File to a map from name to Service.\n//\n// Returns error if Services do not have unique names within the File, which should\n// generally never happen for properly-formed Files.\nfunc NameToService(file File) (map[string]Service, error) {\n\tnameToService := make(map[string]Service)\n\tfor _, service := range file.Services() {\n\t\tname := service.Name()\n\t\tif _, ok := nameToService[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate service: %q\", name)\n\t\t}\n\t\tnameToService[name] = service\n\t}\n\treturn nameToService, nil\n}\n\n// FullNameToService maps the Services in the Files to a map from full name to Service.\n//\n// Returns error if Services do not have unique full names within the Files, which should\n// generally never happen for properly-formed Files.\nfunc FullNameToService(files ...File) (map[string]Service, error) {\n\tfullNameToService := make(map[string]Service)\n\tfor _, file := range files {\n\t\tfor _, service := range file.Services() {\n\t\t\tfullName := service.FullName()\n\t\t\tif _, ok := fullNameToService[fullName]; ok {\n\t\t\t\treturn nil, fmt.Errorf(\"duplicate service: %q\", fullName)\n\t\t\t}\n\t\t\tfullNameToService[fullName] = service\n\t\t}\n\t}\n\treturn fullNameToService, nil\n}\n\n// PackageToNameToService maps the Services in the Files to a map from\n// package to name to Service.\n//\n// Returns error if the Services do not have unique names within the packages,\n// which should generally never happen for properly-formed Files.\nfunc PackageToNameToService(files ...File) (map[string]map[string]Service, error) {\n\tpackageToNameToService := make(map[string]map[string]Service)\n\tfor _, file := range files {\n\t\tpkg := file.Package()\n\t\tnameToService, ok := packageToNameToService[pkg]\n\t\tif !ok {\n\t\t\tnameToService = make(map[string]Service)\n\t\t\tpackageToNameToService[pkg] = nameToService\n\t\t}\n\t\tfor _, service := range file.Services() {\n\t\t\tname := service.Name()\n\t\t\tif _, ok := nameToService[name]; ok {\n\t\t\t\treturn nil, fmt.Errorf(\"duplicate service in package %q: %q\", pkg, name)\n\t\t\t}\n\t\t\tnameToService[name] = service\n\t\t}\n\t}\n\treturn packageToNameToService, nil\n}\n\n// PackageToDirectlyImportedPackageToFileImports maps packages to directly imported packages\n// to the FileImports that import this package.\n//\n// For example, if package a imports package b via c/d.proto and c/e.proto, this will have\n// a -> b -> [c/d.proto, c/e.proto].\n//\n// A directly imported package will not be equal to the package, i.e. there will be no a -> a.\n//\n// Files with no packages are included with key \"\" to be consistent with other functions.\nfunc PackageToDirectlyImportedPackageToFileImports(files ...File) (map[string]map[string][]FileImport, error) {\n\tfilePathToFile, err := FilePathToFile(files...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpackageToDirectlyImportedPackageToFileImports := make(map[string]map[string][]FileImport)\n\tfor _, file := range files {\n\t\tpkg := file.Package()\n\t\tdirectlyImportedPackageToFileImports, ok := packageToDirectlyImportedPackageToFileImports[pkg]\n\t\tif !ok {\n\t\t\tdirectlyImportedPackageToFileImports = make(map[string][]FileImport)\n\t\t\tpackageToDirectlyImportedPackageToFileImports[pkg] = directlyImportedPackageToFileImports\n\t\t}\n\t\tfor _, fileImport := range file.FileImports() {\n\t\t\tif importedFile, ok := filePathToFile[fileImport.Import()]; ok {\n\t\t\t\timportedPkg := importedFile.Package()\n\t\t\t\tif importedPkg != pkg {\n\t\t\t\t\tdirectlyImportedPackageToFileImports[importedFile.Package()] = append(\n\t\t\t\t\t\tdirectlyImportedPackageToFileImports[importedPkg],\n\t\t\t\t\t\tfileImport,\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn packageToDirectlyImportedPackageToFileImports, nil\n}\n\n// NameToMethod maps the Methods in the Service to a map from name to Method.\n//\n// Returns error if Methods do not have unique names within the Service, which should\n// generally never happen for properly-formed Services.\nfunc NameToMethod(service Service) (map[string]Method, error) {\n\tnameToMethod := make(map[string]Method)\n\tfor _, method := range service.Methods() {\n\t\tname := method.Name()\n\t\tif _, ok := nameToMethod[name]; ok {\n\t\t\treturn nil, fmt.Errorf(\"duplicate method: %q\", name)\n\t\t}\n\t\tnameToMethod[name] = method\n\t}\n\treturn nameToMethod, nil\n}\n\n// FullNameToMethod maps the Methods in the Files to a map from full name to Method.\n//\n// Returns error if Methods do not have unique full names within the Files, which should\n// generally never happen for properly-formed Files.\nfunc FullNameToMethod(files ...File) (map[string]Method, error) {\n\tfullNameToMethod := make(map[string]Method)\n\tfor _, file := range files {\n\t\tfor _, service := range file.Services() {\n\t\t\tfor _, method := range service.Methods() {\n\t\t\t\tfullName := method.FullName()\n\t\t\t\tif _, ok := fullNameToMethod[fullName]; ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"duplicate method: %q\", fullName)\n\t\t\t\t}\n\t\t\t\tfullNameToMethod[fullName] = method\n\t\t\t}\n\t\t}\n\t}\n\treturn fullNameToMethod, nil\n}\n\n// StringToReservedTagRange maps the ReservedTagRanges in the ReservedDescriptor to a map\n// from string string to reserved TagRange.\n//\n// Ignores duplicates.\nfunc StringToReservedTagRange(reservedDescriptor ReservedDescriptor) map[string]TagRange {\n\tstringToReservedTagRange := make(map[string]TagRange)\n\tfor _, reservedTagRange := range reservedDescriptor.ReservedTagRanges() {\n\t\tstringToReservedTagRange[TagRangeString(reservedTagRange)] = reservedTagRange\n\t}\n\treturn stringToReservedTagRange\n}\n\n// ValueToReservedName maps the ReservedNames in the ReservedDescriptor to a map\n// from string value to ReservedName.\n//\n// Ignores duplicates.\nfunc ValueToReservedName(reservedDescriptor ReservedDescriptor) map[string]ReservedName {\n\tvalueToReservedName := make(map[string]ReservedName)\n\tfor _, reservedName := range reservedDescriptor.ReservedNames() {\n\t\tvalueToReservedName[reservedName.Value()] = reservedName\n\t}\n\treturn valueToReservedName\n}\n\n// StringToExtensionMessageRange maps the ExtensionMessageRanges in the Message to a map\n// from string string to ExtensionMessageRange.\n//\n// Ignores duplicates.\nfunc StringToExtensionMessageRange(message Message) map[string]MessageRange {\n\tstringToExtensionMessageRange := make(map[string]MessageRange)\n\tfor _, extensionMessageRange := range message.ExtensionMessageRanges() {\n\t\tstringToExtensionMessageRange[TagRangeString(extensionMessageRange)] = extensionMessageRange\n\t}\n\treturn stringToExtensionMessageRange\n}\n\n// NumberInReservedRanges returns true if the number is in one of the Ranges.\nfunc NumberInReservedRanges(number int, reservedRanges ...TagRange) bool {\n\tfor _, reservedRange := range reservedRanges {\n\t\tstart := reservedRange.Start()\n\t\tend := reservedRange.End()\n\t\tif number >= start && number <= end {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// NameInReservedNames returns true if the name is in one of the ReservedNames.\nfunc NameInReservedNames(name string, reservedNames ...ReservedName) bool {\n\tfor _, reservedName := range reservedNames {\n\t\tif name == reservedName.Value() {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// EnumIsSubset checks if subsetEnum is a subset of supersetEnum.\nfunc EnumIsSubset(supersetEnum Enum, subsetEnum Enum) (bool, error) {\n\tsupersetNameToEnumValue, err := NameToEnumValue(supersetEnum)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tsubsetNameToEnumValue, err := NameToEnumValue(subsetEnum)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tfor subsetName, subsetEnumValue := range subsetNameToEnumValue {\n\t\tsupersetEnumValue, ok := supersetNameToEnumValue[subsetName]\n\t\tif !ok {\n\t\t\t// The enum value does not exist by name, this is not a superset.\n\t\t\treturn false, nil\n\t\t}\n\t\tif subsetEnumValue.Number() != supersetEnumValue.Number() {\n\t\t\t// The enum values are not equal, this is not a superset.\n\t\t\treturn false, nil\n\t\t}\n\t}\n\t// All enum values by name exist in the superset and have the same number,\n\t// subsetEnum is a subset of supersetEnum.\n\treturn true, nil\n}\n\n// TagRangeString returns the string representation of the range.\nfunc TagRangeString(tagRange TagRange) string {\n\tstart := tagRange.Start()\n\tend := tagRange.End()\n\tif start == end {\n\t\treturn fmt.Sprintf(\"[%d]\", start)\n\t}\n\tif tagRange.Max() {\n\t\treturn fmt.Sprintf(\"[%d,max]\", start)\n\t}\n\treturn fmt.Sprintf(\"[%d,%d]\", start, end)\n}\n\n// CheckTagRangeIsSubset checks if supersetRanges is a superset of subsetRanges.\n// If so, it returns true and nil. If not, it returns false with a slice of failing ranges from subsetRanges.\nfunc CheckTagRangeIsSubset(supersetRanges []TagRange, subsetRanges []TagRange) (bool, []TagRange) {\n\tif len(subsetRanges) == 0 {\n\t\treturn true, nil\n\t}\n\n\tif len(supersetRanges) == 0 {\n\t\treturn false, subsetRanges\n\t}\n\n\tsupersetTagRangeGroups := groupAdjacentTagRanges(supersetRanges)\n\tsubsetTagRanges := sortTagRanges(subsetRanges)\n\tmissingTagRanges := []TagRange{}\n\n\tfor i, j := 0, 0; j < len(subsetTagRanges); j++ {\n\t\tfor supersetTagRangeGroups[i].end < subsetTagRanges[j].Start() {\n\t\t\tif i++; i == len(supersetTagRangeGroups) {\n\t\t\t\tmissingTagRanges = append(missingTagRanges, subsetTagRanges[j:]...)\n\t\t\t\treturn false, missingTagRanges\n\t\t\t}\n\t\t}\n\t\tif supersetTagRangeGroups[i].start > subsetTagRanges[j].Start() ||\n\t\t\tsupersetTagRangeGroups[i].end < subsetTagRanges[j].End() {\n\t\t\tmissingTagRanges = append(missingTagRanges, subsetTagRanges[j])\n\t\t}\n\t}\n\n\tif len(missingTagRanges) != 0 {\n\t\treturn false, missingTagRanges\n\t}\n\n\treturn true, nil\n}\n\n// groupAdjacentTagRanges sorts and groups adjacent tag ranges.\nfunc groupAdjacentTagRanges(ranges []TagRange) []tagRangeGroup {\n\tif len(ranges) == 0 {\n\t\treturn []tagRangeGroup{}\n\t}\n\n\tsortedTagRanges := sortTagRanges(ranges)\n\n\tj := 0\n\tgroupedTagRanges := make([]tagRangeGroup, 1, len(ranges))\n\tgroupedTagRanges[j] = tagRangeGroup{\n\t\tranges: sortedTagRanges[0:1],\n\t\tstart:  sortedTagRanges[0].Start(),\n\t\tend:    sortedTagRanges[0].End(),\n\t}\n\n\tfor i := 1; i < len(sortedTagRanges); i++ {\n\t\tif sortedTagRanges[i].Start() <= sortedTagRanges[i-1].End()+1 {\n\t\t\tif sortedTagRanges[i].End() > groupedTagRanges[j].end {\n\t\t\t\tgroupedTagRanges[j].end = sortedTagRanges[i].End()\n\t\t\t}\n\t\t\tgroupedTagRanges[j].ranges = groupedTagRanges[j].ranges[0 : len(groupedTagRanges[j].ranges)+1]\n\t\t} else {\n\t\t\tgroupedTagRanges = append(groupedTagRanges, tagRangeGroup{\n\t\t\t\tranges: sortedTagRanges[i : i+1],\n\t\t\t\tstart:  sortedTagRanges[i].Start(),\n\t\t\t\tend:    sortedTagRanges[i].End(),\n\t\t\t})\n\t\t\tj++\n\t\t}\n\t}\n\n\treturn groupedTagRanges\n}\n\n// sortTagRanges sorts tag ranges by their start, end components.\nfunc sortTagRanges(ranges []TagRange) []TagRange {\n\trangesCopy := make([]TagRange, len(ranges))\n\tcopy(rangesCopy, ranges)\n\n\tsort.Slice(rangesCopy, func(i, j int) bool {\n\t\treturn rangesCopy[i].Start() < rangesCopy[j].Start() ||\n\t\t\t(rangesCopy[i].Start() == rangesCopy[j].Start() &&\n\t\t\t\trangesCopy[i].End() < rangesCopy[j].End())\n\t})\n\n\treturn rangesCopy\n}\n\nfunc mapFiles(files []File, getKey func(File) string) (map[string][]File, error) {\n\tkeyToFilePathToFile := make(map[string]map[string]File)\n\tfor _, file := range files {\n\t\tif err := addUniqueFileToMap(keyToFilePathToFile, getKey(file), file); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn mapToSortedFiles(keyToFilePathToFile), nil\n}\n\nfunc addUniqueFileToMap(keyToFilePathToFile map[string]map[string]File, key string, file File) error {\n\tfilePathToFile, ok := keyToFilePathToFile[key]\n\tif !ok {\n\t\tfilePathToFile = make(map[string]File)\n\t\tkeyToFilePathToFile[key] = filePathToFile\n\t}\n\tif _, ok := filePathToFile[file.Path()]; ok {\n\t\treturn fmt.Errorf(\"duplicate file: %s\", file.Path())\n\t}\n\tfilePathToFile[file.Path()] = file\n\treturn nil\n}\n\nfunc mapToSortedFiles(keyToFileMap map[string]map[string]File) map[string][]File {\n\tkeyToSortedFiles := make(map[string][]File, len(keyToFileMap))\n\tfor key, fileMap := range keyToFileMap {\n\t\tfiles := make([]File, 0, len(fileMap))\n\t\tfor _, file := range fileMap {\n\t\t\tfiles = append(files, file)\n\t\t}\n\t\tSortFiles(files)\n\t\tkeyToSortedFiles[key] = files\n\t}\n\treturn keyToSortedFiles\n}\n\ntype tagRangeGroup struct {\n\tranges []TagRange\n\tstart  int\n\tend    int\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/bufprotosource_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduletesting\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNewFiles(t *testing.T) {\n\tt.Parallel()\n\tmoduleSet, err := bufmoduletesting.NewModuleSetForDirPath(\"testdata/nested\")\n\trequire.NoError(t, err)\n\timage, err := bufimage.BuildImage(\n\t\tt.Context(),\n\t\tslogtestext.NewLogger(t),\n\t\tbufmodule.ModuleSetToModuleReadBucketWithOnlyProtoFiles(moduleSet),\n\t)\n\trequire.NoError(t, err)\n\tfiles, err := NewFiles(t.Context(), image.Files(), image.Resolver())\n\trequire.NoError(t, err)\n\trequire.Len(t, files, 1)\n\tfile := files[0]\n\tfor _, message := range file.Messages() {\n\t\ttestMessageName(\n\t\t\tt,\n\t\t\tmap[string]string{\n\t\t\t\t\"A\":         \"A\",\n\t\t\t\t\"B\":         \"A.B\",\n\t\t\t\t\"C\":         \"A.B.C\",\n\t\t\t\t\"D\":         \"A.B.C.D\",\n\t\t\t\t\"E\":         \"A.B.C.D.E\",\n\t\t\t\t\"F\":         \"A.B.C.D.E.F\",\n\t\t\t\t\"Message10\": \"A.B.C.D.E.F.Message10\",\n\t\t\t\t\"Message11\": \"A.B.C.D.E.F.Message10.Message11\",\n\t\t\t\t\"Message20\": \"A.B.C.D.E.F.Message20\",\n\t\t\t\t\"Message21\": \"A.B.C.D.E.F.Message20.Message21\",\n\t\t\t},\n\t\t\tmessage,\n\t\t)\n\t}\n}\n\nfunc testMessageName(t *testing.T, nameToExpectedNestedName map[string]string, message Message) {\n\texpectedName, ok := nameToExpectedNestedName[message.Name()]\n\trequire.True(t, ok)\n\trequire.Equal(t, expectedName, message.NestedName())\n\tfor _, nestedMessage := range message.Messages() {\n\t\ttestMessageName(t, nameToExpectedNestedName, nestedMessage)\n\t\t_, err := message.AsDescriptor()\n\t\trequire.NoError(t, err)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/descriptor.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\ntype descriptor struct {\n\tfile          *file\n\tlocationStore *locationStore\n}\n\nfunc newDescriptor(\n\tfile *file,\n\tlocationStore *locationStore,\n) descriptor {\n\treturn descriptor{\n\t\tfile:          file,\n\t\tlocationStore: locationStore,\n\t}\n}\n\nfunc (d *descriptor) File() File {\n\treturn d.file\n}\n\nfunc (d *descriptor) getLocation(path []int32) Location {\n\tif d.locationStore == nil || len(path) == 0 {\n\t\treturn nil\n\t}\n\treturn d.locationStore.getLocation(path)\n}\n\nfunc (d *descriptor) getLocationByPathKey(pathKey string) Location {\n\tif d.locationStore == nil || pathKey == \"\" {\n\t\treturn nil\n\t}\n\treturn d.locationStore.getLocationByPathKey(pathKey)\n}\n\nfunc asDescriptor[T protoreflect.Descriptor](d *descriptor, fullName string, kind string) (T, error) {\n\tvar zero T\n\tdesc, err := d.file.resolver.FindDescriptorByName(protoreflect.FullName(fullName))\n\tif err != nil {\n\t\treturn zero, err\n\t}\n\ttypedDesc, ok := desc.(T)\n\tif !ok {\n\t\treturn zero, fmt.Errorf(\"%s is a %T, which is not %s\", fullName, desc, kind)\n\t}\n\treturn typedDesc, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/enum.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport \"google.golang.org/protobuf/reflect/protoreflect\"\n\ntype enum struct {\n\tnamedDescriptor\n\toptionExtensionDescriptor\n\n\tvalues                             []EnumValue\n\tallowAlias                         bool\n\tdeprecatedLegacyJSONFieldConflicts bool\n\tdeprecated                         bool\n\tallowAliasPath                     []int32\n\treservedEnumRanges                 []EnumRange\n\treservedNames                      []ReservedName\n\tparent                             Message\n}\n\nfunc newEnum(\n\tnamedDescriptor namedDescriptor,\n\toptionExtensionDescriptor optionExtensionDescriptor,\n\tallowAlias bool,\n\tdeprecatedLegacyJSONFieldConflicts bool,\n\tdeprecated bool,\n\tallowAliasPath []int32,\n\tparent Message,\n) *enum {\n\treturn &enum{\n\t\tnamedDescriptor:                    namedDescriptor,\n\t\toptionExtensionDescriptor:          optionExtensionDescriptor,\n\t\tallowAlias:                         allowAlias,\n\t\tdeprecatedLegacyJSONFieldConflicts: deprecatedLegacyJSONFieldConflicts,\n\t\tdeprecated:                         deprecated,\n\t\tallowAliasPath:                     allowAliasPath,\n\t\tparent:                             parent,\n\t}\n}\n\nfunc (e *enum) Values() []EnumValue {\n\treturn e.values\n}\n\nfunc (e *enum) AllowAlias() bool {\n\treturn e.allowAlias\n}\n\nfunc (e *enum) DeprecatedLegacyJSONFieldConflicts() bool {\n\treturn e.deprecatedLegacyJSONFieldConflicts\n}\n\nfunc (e *enum) Deprecated() bool {\n\treturn e.deprecated\n}\n\nfunc (e *enum) AllowAliasLocation() Location {\n\treturn e.getLocation(e.allowAliasPath)\n}\n\nfunc (e *enum) ReservedEnumRanges() []EnumRange {\n\treturn e.reservedEnumRanges\n}\n\nfunc (e *enum) ReservedTagRanges() []TagRange {\n\ttagRanges := make([]TagRange, len(e.reservedEnumRanges))\n\tfor i, reservedEnumRange := range e.reservedEnumRanges {\n\t\ttagRanges[i] = reservedEnumRange\n\t}\n\treturn tagRanges\n}\n\nfunc (e *enum) ReservedNames() []ReservedName {\n\treturn e.reservedNames\n}\n\nfunc (e *enum) Parent() Message {\n\treturn e.parent\n}\n\nfunc (e *enum) AsDescriptor() (protoreflect.EnumDescriptor, error) {\n\treturn asDescriptor[protoreflect.EnumDescriptor](&e.descriptor, e.FullName(), \"an enum\")\n}\n\nfunc (e *enum) addValue(value EnumValue) {\n\te.values = append(e.values, value)\n}\n\nfunc (e *enum) addReservedEnumRange(reservedEnumRange EnumRange) {\n\te.reservedEnumRanges = append(e.reservedEnumRanges, reservedEnumRange)\n}\n\nfunc (e *enum) addReservedName(reservedName ReservedName) {\n\te.reservedNames = append(e.reservedNames, reservedName)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/enum_range.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport \"math\"\n\nconst (\n\t// EnumRangeInclusiveMax is the maximum allowed number for an enum value.\n\tEnumRangeInclusiveMax = math.MaxInt32\n)\n\ntype enumRange struct {\n\tlocationDescriptor\n\n\tenum  Enum\n\tstart int\n\tend   int\n}\n\nfunc newEnumRange(\n\tlocationDescriptor locationDescriptor,\n\tenum Enum,\n\tstart int,\n\t// end is inclusive for enums\n\tend int,\n) *enumRange {\n\treturn &enumRange{\n\t\tlocationDescriptor: locationDescriptor,\n\t\tenum:               enum,\n\t\tstart:              start,\n\t\tend:                end,\n\t}\n}\n\nfunc (r *enumRange) Enum() Enum {\n\treturn r.enum\n}\n\nfunc (r *enumRange) Start() int {\n\treturn r.start\n}\n\nfunc (r *enumRange) End() int {\n\treturn r.end\n}\n\nfunc (r *enumRange) Max() bool {\n\treturn r.end == EnumRangeInclusiveMax\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/enum_value.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\ntype enumValue struct {\n\tnamedDescriptor\n\toptionExtensionDescriptor\n\n\tenum       Enum\n\tnumber     int\n\tdeprecated bool\n\tnumberPath []int32\n}\n\nfunc newEnumValue(\n\tnamedDescriptor namedDescriptor,\n\toptionExtensionDescriptor optionExtensionDescriptor,\n\tenum Enum,\n\tnumber int,\n\tdeprecated bool,\n\tnumberPath []int32,\n) *enumValue {\n\treturn &enumValue{\n\t\tnamedDescriptor:           namedDescriptor,\n\t\toptionExtensionDescriptor: optionExtensionDescriptor,\n\t\tenum:                      enum,\n\t\tnumber:                    number,\n\t\tdeprecated:                deprecated,\n\t\tnumberPath:                numberPath,\n\t}\n}\n\nfunc (e *enumValue) Enum() Enum {\n\treturn e.enum\n}\n\nfunc (e *enumValue) Number() int {\n\treturn e.number\n}\n\nfunc (e *enumValue) Deprecated() bool {\n\treturn e.deprecated\n}\n\nfunc (e *enumValue) NumberLocation() Location {\n\treturn e.getLocation(e.numberPath)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/field.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype field struct {\n\tnamedDescriptor\n\toptionExtensionDescriptor\n\n\tparentMessage Message\n\tnumber        int\n\tlabel         descriptorpb.FieldDescriptorProto_Label\n\ttyp           descriptorpb.FieldDescriptorProto_Type\n\ttypeName      string\n\t// if the field is an extension, this is the type being extended\n\textendee string\n\t// this has to be the pointer to the private struct or you have the bug where the\n\t// interface is nil but value == nil is false\n\toneof          *oneof\n\tproto3Optional bool\n\tjsonName       string\n\tjsType         descriptorpb.FieldOptions_JSType\n\tcType          descriptorpb.FieldOptions_CType\n\tretention      descriptorpb.FieldOptions_OptionRetention\n\ttargets        []descriptorpb.FieldOptions_OptionTargetType\n\tdebugRedact    bool\n\tpacked         *bool\n\tdefaultVal     string\n\tdeprecated     bool\n\tnumberPath     []int32\n\ttypePath       []int32\n\ttypeNamePath   []int32\n\tjsonNamePath   []int32\n\tjsTypePath     []int32\n\tcTypePath      []int32\n\tpackedPath     []int32\n\tdefaultPath    []int32\n\textendeePath   []int32\n}\n\nfunc newField(\n\tnamedDescriptor namedDescriptor,\n\toptionExtensionDescriptor optionExtensionDescriptor,\n\tparentMessage Message,\n\tnumber int,\n\tlabel descriptorpb.FieldDescriptorProto_Label,\n\ttyp descriptorpb.FieldDescriptorProto_Type,\n\ttypeName string,\n\textendee string,\n\toneof *oneof,\n\tproto3Optional bool,\n\tjsonName string,\n\tjsType descriptorpb.FieldOptions_JSType,\n\tcType descriptorpb.FieldOptions_CType,\n\tretention descriptorpb.FieldOptions_OptionRetention,\n\ttargets []descriptorpb.FieldOptions_OptionTargetType,\n\tdebugRedact bool,\n\tpacked *bool,\n\tdefaultVal string,\n\tdeprecated bool,\n\tnumberPath []int32,\n\ttypePath []int32,\n\ttypeNamePath []int32,\n\tjsonNamePath []int32,\n\tjsTypePath []int32,\n\tcTypePath []int32,\n\tpackedPath []int32,\n\tdefaultPath []int32,\n\textendeePath []int32,\n) *field {\n\treturn &field{\n\t\tnamedDescriptor:           namedDescriptor,\n\t\toptionExtensionDescriptor: optionExtensionDescriptor,\n\t\tparentMessage:             parentMessage,\n\t\tnumber:                    number,\n\t\tlabel:                     label,\n\t\ttyp:                       typ,\n\t\ttypeName:                  typeName,\n\t\textendee:                  extendee,\n\t\toneof:                     oneof,\n\t\tproto3Optional:            proto3Optional,\n\t\tjsonName:                  jsonName,\n\t\tjsType:                    jsType,\n\t\tcType:                     cType,\n\t\tretention:                 retention,\n\t\ttargets:                   targets,\n\t\tdebugRedact:               debugRedact,\n\t\tpacked:                    packed,\n\t\tdefaultVal:                defaultVal,\n\t\tdeprecated:                deprecated,\n\t\tnumberPath:                numberPath,\n\t\ttypePath:                  typePath,\n\t\ttypeNamePath:              typeNamePath,\n\t\tjsonNamePath:              jsonNamePath,\n\t\tjsTypePath:                jsTypePath,\n\t\tcTypePath:                 cTypePath,\n\t\tpackedPath:                packedPath,\n\t\tdefaultPath:               defaultPath,\n\t\textendeePath:              extendeePath,\n\t}\n}\n\nfunc (f *field) ParentMessage() Message {\n\treturn f.parentMessage\n}\n\nfunc (f *field) Number() int {\n\treturn f.number\n}\n\nfunc (f *field) Label() descriptorpb.FieldDescriptorProto_Label {\n\treturn f.label\n}\n\nfunc (f *field) Type() descriptorpb.FieldDescriptorProto_Type {\n\treturn f.typ\n}\n\nfunc (f *field) TypeName() string {\n\treturn f.typeName\n}\n\nfunc (f *field) Extendee() string {\n\treturn f.extendee\n}\n\nfunc (f *field) Oneof() Oneof {\n\t// this has to be done or you have the bug where the interface is nil\n\t// but value == nil is false\n\tif f.oneof == nil {\n\t\treturn nil\n\t}\n\treturn f.oneof\n}\n\nfunc (f *field) Proto3Optional() bool {\n\treturn f.proto3Optional\n}\n\nfunc (f *field) JSONName() string {\n\treturn f.jsonName\n}\n\nfunc (f *field) JSType() descriptorpb.FieldOptions_JSType {\n\treturn f.jsType\n}\n\nfunc (f *field) CType() descriptorpb.FieldOptions_CType {\n\treturn f.cType\n}\n\nfunc (f *field) Retention() descriptorpb.FieldOptions_OptionRetention {\n\treturn f.retention\n}\n\nfunc (f *field) Targets() []descriptorpb.FieldOptions_OptionTargetType {\n\treturn f.targets\n}\n\nfunc (f *field) DebugRedact() bool {\n\treturn f.debugRedact\n}\n\nfunc (f *field) Packed() *bool {\n\treturn f.packed\n}\n\nfunc (f *field) Deprecated() bool {\n\treturn f.deprecated\n}\n\nfunc (f *field) Default() string {\n\treturn f.defaultVal\n}\n\nfunc (f *field) NumberLocation() Location {\n\treturn f.getLocation(f.numberPath)\n}\n\nfunc (f *field) TypeLocation() Location {\n\tloc := f.getLocation(f.typePath)\n\tif loc == nil {\n\t\treturn f.maybeMapEntryLocation()\n\t}\n\treturn loc\n}\n\nfunc (f *field) TypeNameLocation() Location {\n\tloc := f.getLocation(f.typeNamePath)\n\tif loc == nil {\n\t\treturn f.maybeMapEntryLocation()\n\t}\n\treturn loc\n}\n\nfunc (f *field) JSONNameLocation() Location {\n\treturn f.getLocation(f.jsonNamePath)\n}\n\nfunc (f *field) JSTypeLocation() Location {\n\treturn f.getLocation(f.jsTypePath)\n}\n\nfunc (f *field) CTypeLocation() Location {\n\treturn f.getLocation(f.cTypePath)\n}\n\nfunc (f *field) PackedLocation() Location {\n\treturn f.getLocation(f.packedPath)\n}\n\nfunc (f *field) DefaultLocation() Location {\n\treturn f.getLocation(f.defaultPath)\n}\n\nfunc (f *field) ExtendeeLocation() Location {\n\treturn f.getLocation(f.extendeePath)\n}\n\nfunc (f *field) AsDescriptor() (protoreflect.FieldDescriptor, error) {\n\treturn asDescriptor[protoreflect.FieldDescriptor](&f.descriptor, f.FullName(), \"a field\")\n}\n\nfunc (f *field) Location() Location {\n\tloc := f.namedDescriptor.Location()\n\tif loc == nil {\n\t\treturn f.maybeMapEntryLocation()\n\t}\n\treturn loc\n}\n\nfunc (f *field) NameLocation() Location {\n\tloc := f.namedDescriptor.NameLocation()\n\tif loc == nil {\n\t\treturn f.maybeMapEntryLocation()\n\t}\n\treturn loc\n}\n\nfunc (f *field) maybeMapEntryLocation() Location {\n\tif message, _ := f.parentMessage.(*message); message != nil {\n\t\treturn message.maybeMapEntryLocation()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/file.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype file struct {\n\tFileInfo\n\tdescriptor\n\toptionExtensionDescriptor\n\n\tresolver       protodesc.Resolver\n\tfileDescriptor protodescriptor.FileDescriptor\n\tsyntax         Syntax\n\tfileImports    []FileImport\n\tmessages       []Message\n\tenums          []Enum\n\tservices       []Service\n\textensions     []Field\n\tedition        descriptorpb.Edition\n\toptimizeMode   descriptorpb.FileOptions_OptimizeMode\n}\n\nfunc (f *file) FileDescriptor() protodescriptor.FileDescriptor {\n\treturn f.fileDescriptor\n}\n\nfunc (f *file) Syntax() Syntax {\n\treturn f.syntax\n}\n\nfunc (f *file) Package() string {\n\treturn f.fileDescriptor.GetPackage()\n}\n\nfunc (f *file) FileImports() []FileImport {\n\treturn f.fileImports\n}\n\nfunc (f *file) Messages() []Message {\n\treturn f.messages\n}\n\nfunc (f *file) Enums() []Enum {\n\treturn f.enums\n}\n\nfunc (f *file) Services() []Service {\n\treturn f.services\n}\n\nfunc (f *file) Extensions() []Field {\n\treturn f.extensions\n}\n\nfunc (f *file) Edition() descriptorpb.Edition {\n\treturn f.edition\n}\n\nfunc (f *file) CsharpNamespace() string {\n\treturn f.fileDescriptor.GetOptions().GetCsharpNamespace()\n}\n\nfunc (f *file) Deprecated() bool {\n\treturn f.fileDescriptor.GetOptions().GetDeprecated()\n}\n\nfunc (f *file) GoPackage() string {\n\treturn f.fileDescriptor.GetOptions().GetGoPackage()\n}\n\nfunc (f *file) JavaMultipleFiles() bool {\n\treturn f.fileDescriptor.GetOptions().GetJavaMultipleFiles()\n}\n\nfunc (f *file) JavaOuterClassname() string {\n\treturn f.fileDescriptor.GetOptions().GetJavaOuterClassname()\n}\n\nfunc (f *file) JavaPackage() string {\n\treturn f.fileDescriptor.GetOptions().GetJavaPackage()\n}\n\nfunc (f *file) JavaStringCheckUtf8() bool {\n\treturn f.fileDescriptor.GetOptions().GetJavaStringCheckUtf8()\n}\n\nfunc (f *file) ObjcClassPrefix() string {\n\treturn f.fileDescriptor.GetOptions().GetObjcClassPrefix()\n}\n\nfunc (f *file) PhpClassPrefix() string {\n\treturn f.fileDescriptor.GetOptions().GetPhpClassPrefix()\n}\n\nfunc (f *file) PhpNamespace() string {\n\treturn f.fileDescriptor.GetOptions().GetPhpNamespace()\n}\n\nfunc (f *file) PhpMetadataNamespace() string {\n\treturn f.fileDescriptor.GetOptions().GetPhpMetadataNamespace()\n}\n\nfunc (f *file) RubyPackage() string {\n\treturn f.fileDescriptor.GetOptions().GetRubyPackage()\n}\n\nfunc (f *file) SwiftPrefix() string {\n\treturn f.fileDescriptor.GetOptions().GetSwiftPrefix()\n}\n\nfunc (f *file) OptimizeFor() descriptorpb.FileOptions_OptimizeMode {\n\treturn f.optimizeMode\n}\n\nfunc (f *file) CcGenericServices() bool {\n\treturn f.fileDescriptor.GetOptions().GetCcGenericServices()\n}\n\nfunc (f *file) JavaGenericServices() bool {\n\treturn f.fileDescriptor.GetOptions().GetJavaGenericServices()\n}\n\nfunc (f *file) PyGenericServices() bool {\n\treturn f.fileDescriptor.GetOptions().GetPyGenericServices()\n}\n\nfunc (f *file) CcEnableArenas() bool {\n\treturn f.fileDescriptor.GetOptions().GetCcEnableArenas()\n}\n\nfunc (f *file) PackageLocation() Location {\n\treturn f.getLocationByPathKey(packagePathKey)\n}\n\nfunc (f *file) CsharpNamespaceLocation() Location {\n\treturn f.getLocationByPathKey(csharpNamespacePathKey)\n}\n\nfunc (f *file) GoPackageLocation() Location {\n\treturn f.getLocationByPathKey(goPackagePathKey)\n}\n\nfunc (f *file) JavaMultipleFilesLocation() Location {\n\treturn f.getLocationByPathKey(javaMultipleFilesPathKey)\n}\n\nfunc (f *file) JavaOuterClassnameLocation() Location {\n\treturn f.getLocationByPathKey(javaOuterClassnamePathKey)\n}\n\nfunc (f *file) JavaPackageLocation() Location {\n\treturn f.getLocationByPathKey(javaPackagePathKey)\n}\n\nfunc (f *file) JavaStringCheckUtf8Location() Location {\n\treturn f.getLocationByPathKey(javaStringCheckUtf8PathKey)\n}\n\nfunc (f *file) ObjcClassPrefixLocation() Location {\n\treturn f.getLocationByPathKey(objcClassPrefixPathKey)\n}\n\nfunc (f *file) PhpClassPrefixLocation() Location {\n\treturn f.getLocationByPathKey(phpClassPrefixPathKey)\n}\n\nfunc (f *file) PhpNamespaceLocation() Location {\n\treturn f.getLocationByPathKey(phpNamespacePathKey)\n}\n\nfunc (f *file) PhpMetadataNamespaceLocation() Location {\n\treturn f.getLocationByPathKey(phpMetadataNamespacePathKey)\n}\n\nfunc (f *file) RubyPackageLocation() Location {\n\treturn f.getLocationByPathKey(rubyPackagePathKey)\n}\n\nfunc (f *file) SwiftPrefixLocation() Location {\n\treturn f.getLocationByPathKey(swiftPrefixPathKey)\n}\n\nfunc (f *file) OptimizeForLocation() Location {\n\treturn f.getLocationByPathKey(optimizeForPathKey)\n}\n\nfunc (f *file) CcGenericServicesLocation() Location {\n\treturn f.getLocationByPathKey(ccGenericServicesPathKey)\n}\n\nfunc (f *file) JavaGenericServicesLocation() Location {\n\treturn f.getLocationByPathKey(javaGenericServicesPathKey)\n}\n\nfunc (f *file) PyGenericServicesLocation() Location {\n\treturn f.getLocationByPathKey(pyGenericServicesPathKey)\n}\n\nfunc (f *file) CcEnableArenasLocation() Location {\n\treturn f.getLocationByPathKey(ccEnableArenasPathKey)\n}\n\nfunc (f *file) SyntaxLocation() Location {\n\treturn f.getLocationByPathKey(syntaxPathKey)\n}\n\n// does not validation of the fileDescriptorProto - this is assumed to be done elsewhere\n// does no duplicate checking by name - could just have maps ie importToFileImport, enumNameToEnum, etc\nfunc newFile(inputFile InputFile, resolver protodesc.Resolver) (*file, error) {\n\tlocationStore := newLocationStore(inputFile.FileDescriptorProto())\n\tf := &file{\n\t\tFileInfo:       inputFile,\n\t\tresolver:       resolver,\n\t\tfileDescriptor: inputFile.FileDescriptorProto(),\n\t\toptionExtensionDescriptor: newOptionExtensionDescriptor(\n\t\t\tinputFile.FileDescriptorProto().GetOptions(),\n\t\t\t[]int32{8},\n\t\t\tlocationStore,\n\t\t\t50,\n\t\t),\n\t\tedition: inputFile.FileDescriptorProto().GetEdition(),\n\t}\n\tdescriptor := newDescriptor(\n\t\tf,\n\t\tlocationStore,\n\t)\n\tf.descriptor = descriptor\n\n\tif inputFile.IsSyntaxUnspecified() {\n\t\t// if the syntax is \"proto2\", protoc and buf will not set the syntax\n\t\t// field even if it was explicitly set, this is why we have\n\t\t// IsSyntaxUnspecified\n\t\tf.syntax = SyntaxUnspecified\n\t} else {\n\t\tswitch syntaxString := f.fileDescriptor.GetSyntax(); syntaxString {\n\t\tcase \"\", \"proto2\":\n\t\t\tf.syntax = SyntaxProto2\n\t\tcase \"proto3\":\n\t\t\tf.syntax = SyntaxProto3\n\t\tcase \"editions\":\n\t\t\tf.syntax = SyntaxEditions\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"unknown syntax: %q\", syntaxString)\n\t\t}\n\t}\n\n\tfor dependencyIndex, dependency := range f.fileDescriptor.GetDependency() {\n\t\tfileImport, err := newFileImport(\n\t\t\tf.descriptor,\n\t\t\tdependency,\n\t\t\tgetDependencyPath(dependencyIndex),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tf.fileImports = append(f.fileImports, fileImport)\n\t}\n\tfor _, dependencyIndex := range f.fileDescriptor.GetPublicDependency() {\n\t\tif int(dependencyIndex) < 0 || len(f.fileImports) <= int(dependencyIndex) {\n\t\t\treturn nil, fmt.Errorf(\"got dependency index of %d but length of imports is %d\", dependencyIndex, len(f.fileImports))\n\t\t}\n\t\tfileImport, ok := f.fileImports[dependencyIndex].(*fileImport)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"could not cast %T to a *fileImport\", f.fileImports[dependencyIndex])\n\t\t}\n\t\tfileImport.setIsPublic()\n\t}\n\tfor _, dependencyIndex := range f.fileDescriptor.GetWeakDependency() {\n\t\tif int(dependencyIndex) < 0 || len(f.fileImports) <= int(dependencyIndex) {\n\t\t\treturn nil, fmt.Errorf(\"got dependency index of %d but length of imports is %d\", dependencyIndex, len(f.fileImports))\n\t\t}\n\t\tfileImport, ok := f.fileImports[dependencyIndex].(*fileImport)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"could not cast %T to a *fileImport\", f.fileImports[dependencyIndex])\n\t\t}\n\t\tfileImport.setIsWeak()\n\t}\n\tfor _, dependencyIndex := range inputFile.UnusedDependencyIndexes() {\n\t\tif int(dependencyIndex) < 0 || len(f.fileImports) <= int(dependencyIndex) {\n\t\t\treturn nil, fmt.Errorf(\"got dependency index of %d but length of imports is %d\", dependencyIndex, len(f.fileImports))\n\t\t}\n\t\tfileImport, ok := f.fileImports[dependencyIndex].(*fileImport)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"could not cast %T to a *fileImport\", f.fileImports[dependencyIndex])\n\t\t}\n\t\tfileImport.setIsUnused()\n\t}\n\tfor enumIndex, enumDescriptorProto := range f.fileDescriptor.GetEnumType() {\n\t\tenum, err := f.populateEnum(\n\t\t\tenumDescriptorProto,\n\t\t\tenumIndex,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tnil,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tf.enums = append(f.enums, enum)\n\t}\n\tfor messageIndex, descriptorProto := range f.fileDescriptor.GetMessageType() {\n\t\tmessage, err := f.populateMessage(\n\t\t\tdescriptorProto,\n\t\t\tmessageIndex,\n\t\t\tnil,\n\t\t\tnil,\n\t\t\tnil,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tf.messages = append(f.messages, message)\n\t}\n\tfor serviceIndex, serviceDescriptorProto := range f.fileDescriptor.GetService() {\n\t\tservice, err := f.populateService(\n\t\t\tserviceDescriptorProto,\n\t\t\tserviceIndex,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tf.services = append(f.services, service)\n\t}\n\tfor extensionIndex, extensionDescriptorProto := range f.fileDescriptor.GetExtension() {\n\t\textension, err := f.populateExtension(\n\t\t\textensionDescriptorProto,\n\t\t\textensionIndex,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tf.extensions = append(f.extensions, extension)\n\t}\n\tf.optimizeMode = f.fileDescriptor.GetOptions().GetOptimizeFor()\n\treturn f, nil\n}\n\nfunc (f *file) populateEnum(\n\tenumDescriptorProto *descriptorpb.EnumDescriptorProto,\n\tenumIndex int,\n\t// all message indexes leading to this enum\n\tnestedMessageIndexes []int,\n\t// all message names leading to this enum\n\tnestedMessageNames []string,\n\tparent Message,\n) (Enum, error) {\n\tenumNamedDescriptor, err := newNamedDescriptor(\n\t\tnewLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetEnumPath(enumIndex, nestedMessageIndexes...),\n\t\t),\n\t\tenumDescriptorProto.GetName(),\n\t\tgetEnumNamePath(enumIndex, nestedMessageIndexes...),\n\t\tnestedMessageNames,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tenum := newEnum(\n\t\tenumNamedDescriptor,\n\t\tnewOptionExtensionDescriptor(\n\t\t\tenumDescriptorProto.GetOptions(),\n\t\t\tgetEnumOptionsPath(enumIndex, nestedMessageIndexes...),\n\t\t\tf.descriptor.locationStore,\n\t\t\t7,\n\t\t),\n\t\tenumDescriptorProto.GetOptions().GetAllowAlias(),\n\t\tenumDescriptorProto.GetOptions().GetDeprecatedLegacyJsonFieldConflicts(),\n\t\tenumDescriptorProto.GetOptions().GetDeprecated(),\n\t\tgetEnumAllowAliasPath(enumIndex, nestedMessageIndexes...),\n\t\tparent,\n\t)\n\n\tfor enumValueIndex, enumValueDescriptorProto := range enumDescriptorProto.GetValue() {\n\t\tenumValueNamedDescriptor, err := newNamedDescriptor(\n\t\t\tnewLocationDescriptor(\n\t\t\t\tf.descriptor,\n\t\t\t\tgetEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...),\n\t\t\t),\n\t\t\tenumValueDescriptorProto.GetName(),\n\t\t\tgetEnumValueNamePath(enumIndex, enumValueIndex, nestedMessageIndexes...),\n\t\t\tslices.Concat(nestedMessageNames, []string{enum.Name()}),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tenumValue := newEnumValue(\n\t\t\tenumValueNamedDescriptor,\n\t\t\tnewOptionExtensionDescriptor(\n\t\t\t\tenumValueDescriptorProto.GetOptions(),\n\t\t\t\tgetEnumValueOptionsPath(enumIndex, enumValueIndex, nestedMessageIndexes...),\n\t\t\t\tf.descriptor.locationStore,\n\t\t\t\t2,\n\t\t\t),\n\t\t\tenum,\n\t\t\tint(enumValueDescriptorProto.GetNumber()),\n\t\t\tenumValueDescriptorProto.GetOptions().GetDeprecated(),\n\t\t\tgetEnumValueNumberPath(enumIndex, enumValueIndex, nestedMessageIndexes...),\n\t\t)\n\t\tenum.addValue(enumValue)\n\t}\n\n\tfor reservedRangeIndex, reservedRangeDescriptorProto := range enumDescriptorProto.GetReservedRange() {\n\t\treservedRangeLocationDescriptor := newLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetEnumReservedRangePath(enumIndex, reservedRangeIndex, nestedMessageIndexes...),\n\t\t)\n\t\treservedEnumRange := newEnumRange(\n\t\t\treservedRangeLocationDescriptor,\n\t\t\tenum,\n\t\t\tint(reservedRangeDescriptorProto.GetStart()),\n\t\t\tint(reservedRangeDescriptorProto.GetEnd()),\n\t\t)\n\t\tenum.addReservedEnumRange(reservedEnumRange)\n\t}\n\tfor reservedNameIndex, reservedNameValue := range enumDescriptorProto.GetReservedName() {\n\t\treservedNameLocationDescriptor := newLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetEnumReservedNamePath(enumIndex, reservedNameIndex, nestedMessageIndexes...),\n\t\t)\n\t\treservedName, err := newReservedName(\n\t\t\treservedNameLocationDescriptor,\n\t\t\treservedNameValue,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tenum.addReservedName(reservedName)\n\t}\n\treturn enum, nil\n}\n\nfunc (f *file) populateMessage(\n\tdescriptorProto *descriptorpb.DescriptorProto,\n\t// always stays the same on every recursive call\n\ttopLevelMessageIndex int,\n\t// includes descriptorProto index\n\tnestedMessageIndexes []int,\n\t// does NOT include descriptorProto.GetName()\n\tnestedMessageNames []string,\n\tparent Message,\n) (Message, error) {\n\tmessageNamedDescriptor, err := newNamedDescriptor(\n\t\tnewLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetMessagePath(topLevelMessageIndex, nestedMessageIndexes...),\n\t\t),\n\t\tdescriptorProto.GetName(),\n\t\tgetMessageNamePath(topLevelMessageIndex, nestedMessageIndexes...),\n\t\tnestedMessageNames,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tmessage := newMessage(\n\t\tmessageNamedDescriptor,\n\t\tnewOptionExtensionDescriptor(\n\t\t\tdescriptorProto.GetOptions(),\n\t\t\tgetMessageOptionsPath(topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tf.descriptor.locationStore,\n\t\t\t12,\n\t\t),\n\t\tparent,\n\t\tdescriptorProto.GetOptions().GetMapEntry(),\n\t\tdescriptorProto.GetOptions().GetMessageSetWireFormat(),\n\t\tdescriptorProto.GetOptions().GetNoStandardDescriptorAccessor(),\n\t\tdescriptorProto.GetOptions().GetDeprecatedLegacyJsonFieldConflicts(),\n\t\tdescriptorProto.GetOptions().GetDeprecated(),\n\t\tgetMessageMessageSetWireFormatPath(topLevelMessageIndex, nestedMessageIndexes...),\n\t\tgetMessageNoStandardDescriptorAccessorPath(topLevelMessageIndex, nestedMessageIndexes...),\n\t)\n\toneofIndexToOneof := make(map[int]*oneof)\n\tfor oneofIndex, oneofDescriptorProto := range descriptorProto.GetOneofDecl() {\n\t\toneofNamedDescriptor, err := newNamedDescriptor(\n\t\t\tnewLocationDescriptor(\n\t\t\t\tf.descriptor,\n\t\t\t\tgetMessageOneofPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\t),\n\t\t\toneofDescriptorProto.GetName(),\n\t\t\tgetMessageOneofNamePath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tslices.Concat(nestedMessageNames, []string{message.Name()}),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toneof := newOneof(\n\t\t\toneofNamedDescriptor,\n\t\t\tnewOptionExtensionDescriptor(\n\t\t\t\toneofDescriptorProto.GetOptions(),\n\t\t\t\tgetMessageOneofOptionsPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\t\tf.descriptor.locationStore,\n\t\t\t\t1,\n\t\t\t),\n\t\t\tmessage,\n\t\t)\n\t\tmessage.addOneof(oneof)\n\t\toneofIndexToOneof[oneofIndex] = oneof\n\t}\n\tfor fieldIndex, fieldDescriptorProto := range descriptorProto.GetField() {\n\t\t// TODO: not working for map entries\n\t\tfieldNamedDescriptor, err := newNamedDescriptor(\n\t\t\tnewLocationDescriptor(\n\t\t\t\tf.descriptor,\n\t\t\t\tgetMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\t),\n\t\t\tfieldDescriptorProto.GetName(),\n\t\t\tgetMessageFieldNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tslices.Concat(nestedMessageNames, []string{message.Name()}),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvar packed *bool\n\t\tif fieldDescriptorProto.Options != nil {\n\t\t\tpacked = fieldDescriptorProto.GetOptions().Packed\n\t\t}\n\t\tvar oneof *oneof\n\t\tvar ok bool\n\t\tif fieldDescriptorProto.OneofIndex != nil {\n\t\t\toneofIndex := int(*fieldDescriptorProto.OneofIndex)\n\t\t\toneof, ok = oneofIndexToOneof[oneofIndex]\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"no oneof for index %d\", oneofIndex)\n\t\t\t}\n\t\t}\n\t\tfield := newField(\n\t\t\tfieldNamedDescriptor,\n\t\t\tnewOptionExtensionDescriptor(\n\t\t\t\tfieldDescriptorProto.GetOptions(),\n\t\t\t\tgetMessageFieldOptionsPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\t\tf.descriptor.locationStore,\n\t\t\t\t21,\n\t\t\t),\n\t\t\tmessage,\n\t\t\tint(fieldDescriptorProto.GetNumber()),\n\t\t\tfieldDescriptorProto.GetLabel(),\n\t\t\tfieldDescriptorProto.GetType(),\n\t\t\tstrings.TrimPrefix(fieldDescriptorProto.GetTypeName(), \".\"),\n\t\t\tstrings.TrimPrefix(fieldDescriptorProto.GetExtendee(), \".\"),\n\t\t\toneof,\n\t\t\tfieldDescriptorProto.GetProto3Optional(),\n\t\t\tfieldDescriptorProto.GetJsonName(),\n\t\t\tfieldDescriptorProto.GetOptions().GetJstype(),\n\t\t\tfieldDescriptorProto.GetOptions().GetCtype(),\n\t\t\tfieldDescriptorProto.GetOptions().GetRetention(),\n\t\t\tfieldDescriptorProto.GetOptions().GetTargets(),\n\t\t\tfieldDescriptorProto.GetOptions().GetDebugRedact(),\n\t\t\tpacked,\n\t\t\tfieldDescriptorProto.GetDefaultValue(),\n\t\t\tfieldDescriptorProto.GetOptions().GetDeprecated(),\n\t\t\tgetMessageFieldNumberPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldTypeNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldJSONNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldJSTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldCTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldPackedPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldDefaultPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageFieldExtendeePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t)\n\t\tmessage.addField(field)\n\t\tif oneof != nil {\n\t\t\toneof.addField(field)\n\t\t}\n\t}\n\tfor fieldIndex, fieldDescriptorProto := range descriptorProto.GetExtension() {\n\t\tfieldNamedDescriptor, err := newNamedDescriptor(\n\t\t\tnewLocationDescriptor(\n\t\t\t\tf.descriptor,\n\t\t\t\tgetMessageExtensionPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\t),\n\t\t\tfieldDescriptorProto.GetName(),\n\t\t\tgetMessageExtensionNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tslices.Concat(nestedMessageNames, []string{message.Name()}),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvar packed *bool\n\t\tif fieldDescriptorProto.Options != nil {\n\t\t\tpacked = fieldDescriptorProto.GetOptions().Packed\n\t\t}\n\t\tvar oneof *oneof\n\t\tvar ok bool\n\t\tif fieldDescriptorProto.OneofIndex != nil {\n\t\t\toneofIndex := int(*fieldDescriptorProto.OneofIndex)\n\t\t\toneof, ok = oneofIndexToOneof[oneofIndex]\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"no oneof for index %d\", oneofIndex)\n\t\t\t}\n\t\t}\n\t\tfield := newField(\n\t\t\tfieldNamedDescriptor,\n\t\t\tnewOptionExtensionDescriptor(\n\t\t\t\tfieldDescriptorProto.GetOptions(),\n\t\t\t\tgetMessageExtensionOptionsPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\t\tf.descriptor.locationStore,\n\t\t\t\t21,\n\t\t\t),\n\t\t\tmessage,\n\t\t\tint(fieldDescriptorProto.GetNumber()),\n\t\t\tfieldDescriptorProto.GetLabel(),\n\t\t\tfieldDescriptorProto.GetType(),\n\t\t\tstrings.TrimPrefix(fieldDescriptorProto.GetTypeName(), \".\"),\n\t\t\tstrings.TrimPrefix(fieldDescriptorProto.GetExtendee(), \".\"),\n\t\t\toneof,\n\t\t\tfieldDescriptorProto.GetProto3Optional(),\n\t\t\tfieldDescriptorProto.GetJsonName(),\n\t\t\tfieldDescriptorProto.GetOptions().GetJstype(),\n\t\t\tfieldDescriptorProto.GetOptions().GetCtype(),\n\t\t\tfieldDescriptorProto.GetOptions().GetRetention(),\n\t\t\tfieldDescriptorProto.GetOptions().GetTargets(),\n\t\t\tfieldDescriptorProto.GetOptions().GetDebugRedact(),\n\t\t\tpacked,\n\t\t\tfieldDescriptorProto.GetDefaultValue(),\n\t\t\tfieldDescriptorProto.GetOptions().GetDeprecated(),\n\t\t\tgetMessageExtensionNumberPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionTypeNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionJSONNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionJSTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionCTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionPackedPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionDefaultPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\tgetMessageExtensionExtendeePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t)\n\t\tmessage.addExtension(field)\n\t\tif oneof != nil {\n\t\t\toneof.addField(field)\n\t\t}\n\t}\n\tfor reservedRangeIndex, reservedRangeDescriptorProto := range descriptorProto.GetReservedRange() {\n\t\treservedRangeLocationDescriptor := newLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetMessageReservedRangePath(reservedRangeIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t)\n\t\treservedMessageRange := newMessageRange(\n\t\t\treservedRangeLocationDescriptor,\n\t\t\tmessage,\n\t\t\tint(reservedRangeDescriptorProto.GetStart()),\n\t\t\tint(reservedRangeDescriptorProto.GetEnd()),\n\t\t)\n\t\tmessage.addReservedMessageRange(reservedMessageRange)\n\t}\n\tfor reservedNameIndex, reservedNameValue := range descriptorProto.GetReservedName() {\n\t\treservedNameLocationDescriptor := newLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetMessageReservedNamePath(reservedNameIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t)\n\t\treservedName, err := newReservedName(\n\t\t\treservedNameLocationDescriptor,\n\t\t\treservedNameValue,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmessage.addReservedName(reservedName)\n\t}\n\tfor extensionRangeIndex, extensionRangeDescriptorProto := range descriptorProto.GetExtensionRange() {\n\t\textensionRangeLocationDescriptor := newLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetMessageExtensionRangePath(extensionRangeIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t)\n\t\textensionMessageRange := newExtensionRange(\n\t\t\textensionRangeLocationDescriptor,\n\t\t\tmessage,\n\t\t\tint(extensionRangeDescriptorProto.GetStart()),\n\t\t\tint(extensionRangeDescriptorProto.GetEnd()),\n\t\t\tnewOptionExtensionDescriptor(\n\t\t\t\textensionRangeDescriptorProto.GetOptions(),\n\t\t\t\tgetMessageExtensionRangeOptionsPath(extensionRangeIndex, topLevelMessageIndex, nestedMessageIndexes...),\n\t\t\t\tf.descriptor.locationStore,\n\t\t\t\t50,\n\t\t\t),\n\t\t)\n\t\tmessage.addExtensionRange(extensionMessageRange)\n\t}\n\tfor enumIndex, enumDescriptorProto := range descriptorProto.GetEnumType() {\n\t\tnestedEnum, err := f.populateEnum(\n\t\t\tenumDescriptorProto,\n\t\t\tenumIndex,\n\t\t\t// this is all of the message indexes including this one\n\t\t\t// TODO we should refactor get.*Path messages to be more consistent\n\t\t\tappend([]int{topLevelMessageIndex}, nestedMessageIndexes...),\n\t\t\tslices.Concat(nestedMessageNames, []string{message.Name()}),\n\t\t\tmessage,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmessage.addNestedEnum(nestedEnum)\n\t}\n\tfor nestedMessageIndex, nestedMessageDescriptorProto := range descriptorProto.GetNestedType() {\n\t\tnestedMessage, err := f.populateMessage(\n\t\t\tnestedMessageDescriptorProto,\n\t\t\ttopLevelMessageIndex,\n\t\t\tslices.Concat(nestedMessageIndexes, []int{nestedMessageIndex}),\n\t\t\tslices.Concat(nestedMessageNames, []string{message.Name()}),\n\t\t\tmessage,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmessage.addNestedMessage(nestedMessage)\n\t}\n\treturn message, nil\n}\n\nfunc (f *file) populateService(\n\tserviceDescriptorProto *descriptorpb.ServiceDescriptorProto,\n\tserviceIndex int,\n) (Service, error) {\n\tserviceNamedDescriptor, err := newNamedDescriptor(\n\t\tnewLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetServicePath(serviceIndex),\n\t\t),\n\t\tserviceDescriptorProto.GetName(),\n\t\tgetServiceNamePath(serviceIndex),\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tservice := newService(\n\t\tserviceNamedDescriptor,\n\t\tnewOptionExtensionDescriptor(\n\t\t\tserviceDescriptorProto.GetOptions(),\n\t\t\tgetServiceOptionsPath(serviceIndex),\n\t\t\tf.descriptor.locationStore,\n\t\t\t34,\n\t\t),\n\t\tserviceDescriptorProto.GetOptions().GetDeprecated(),\n\t)\n\tfor methodIndex, methodDescriptorProto := range serviceDescriptorProto.GetMethod() {\n\t\tmethodNamedDescriptor, err := newNamedDescriptor(\n\t\t\tnewLocationDescriptor(\n\t\t\t\tf.descriptor,\n\t\t\t\tgetMethodPath(serviceIndex, methodIndex),\n\t\t\t),\n\t\t\tmethodDescriptorProto.GetName(),\n\t\t\tgetMethodNamePath(serviceIndex, methodIndex),\n\t\t\t[]string{service.Name()},\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmethod, err := newMethod(\n\t\t\tmethodNamedDescriptor,\n\t\t\tnewOptionExtensionDescriptor(\n\t\t\t\tmethodDescriptorProto.GetOptions(),\n\t\t\t\tgetMethodOptionsPath(serviceIndex, methodIndex),\n\t\t\t\tf.descriptor.locationStore,\n\t\t\t\t35,\n\t\t\t),\n\t\t\tservice,\n\t\t\tstrings.TrimPrefix(methodDescriptorProto.GetInputType(), \".\"),\n\t\t\tstrings.TrimPrefix(methodDescriptorProto.GetOutputType(), \".\"),\n\t\t\tmethodDescriptorProto.GetClientStreaming(),\n\t\t\tmethodDescriptorProto.GetServerStreaming(),\n\t\t\tmethodDescriptorProto.GetOptions().GetDeprecated(),\n\t\t\tgetMethodInputTypePath(serviceIndex, methodIndex),\n\t\t\tgetMethodOutputTypePath(serviceIndex, methodIndex),\n\t\t\tmethodDescriptorProto.GetOptions().GetIdempotencyLevel(),\n\t\t\tgetMethodIdempotencyLevelPath(serviceIndex, methodIndex),\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tservice.addMethod(method)\n\t}\n\treturn service, nil\n}\n\nfunc (f *file) populateExtension(\n\tfieldDescriptorProto *descriptorpb.FieldDescriptorProto,\n\tfieldIndex int,\n) (Field, error) {\n\tfieldNamedDescriptor, err := newNamedDescriptor(\n\t\tnewLocationDescriptor(\n\t\t\tf.descriptor,\n\t\t\tgetFileExtensionPath(fieldIndex),\n\t\t),\n\t\tfieldDescriptorProto.GetName(),\n\t\tgetFileExtensionNamePath(fieldIndex),\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar packed *bool\n\tif fieldDescriptorProto.Options != nil {\n\t\tpacked = fieldDescriptorProto.GetOptions().Packed\n\t}\n\treturn newField(\n\t\tfieldNamedDescriptor,\n\t\tnewOptionExtensionDescriptor(\n\t\t\tfieldDescriptorProto.GetOptions(),\n\t\t\tgetFileExtensionOptionsPath(fieldIndex),\n\t\t\tf.descriptor.locationStore,\n\t\t\t21,\n\t\t),\n\t\tnil,\n\t\tint(fieldDescriptorProto.GetNumber()),\n\t\tfieldDescriptorProto.GetLabel(),\n\t\tfieldDescriptorProto.GetType(),\n\t\tstrings.TrimPrefix(fieldDescriptorProto.GetTypeName(), \".\"),\n\t\tstrings.TrimPrefix(fieldDescriptorProto.GetExtendee(), \".\"),\n\t\tnil,\n\t\tfieldDescriptorProto.GetProto3Optional(),\n\t\tfieldDescriptorProto.GetJsonName(),\n\t\tfieldDescriptorProto.GetOptions().GetJstype(),\n\t\tfieldDescriptorProto.GetOptions().GetCtype(),\n\t\tfieldDescriptorProto.GetOptions().GetRetention(),\n\t\tfieldDescriptorProto.GetOptions().GetTargets(),\n\t\tfieldDescriptorProto.GetOptions().GetDebugRedact(),\n\t\tpacked,\n\t\tfieldDescriptorProto.GetDefaultValue(),\n\t\tfieldDescriptorProto.GetOptions().GetDeprecated(),\n\t\tgetFileExtensionNumberPath(fieldIndex),\n\t\tgetFileExtensionTypePath(fieldIndex),\n\t\tgetFileExtensionTypeNamePath(fieldIndex),\n\t\tgetFileExtensionJSONNamePath(fieldIndex),\n\t\tgetFileExtensionJSTypePath(fieldIndex),\n\t\tgetFileExtensionCTypePath(fieldIndex),\n\t\tgetFileExtensionPackedPath(fieldIndex),\n\t\tgetFileExtensionDefaultPath(fieldIndex),\n\t\tgetFileExtensionExtendeePath(fieldIndex),\n\t), nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/file_import.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport \"fmt\"\n\ntype fileImport struct {\n\tdescriptor\n\n\timp      string\n\tisPublic bool\n\tisWeak   bool\n\tisUnused bool\n\tpath     []int32\n}\n\nfunc newFileImport(\n\tdescriptor descriptor,\n\timp string,\n\tpath []int32,\n) (*fileImport, error) {\n\tif imp == \"\" {\n\t\treturn nil, fmt.Errorf(\"no dependency value in %q\", descriptor.File().Path())\n\t}\n\treturn &fileImport{\n\t\tdescriptor: descriptor,\n\t\timp:        imp,\n\t\tpath:       path,\n\t}, nil\n}\n\nfunc (f *fileImport) Import() string {\n\treturn f.imp\n}\n\nfunc (f *fileImport) IsPublic() bool {\n\treturn f.isPublic\n}\n\nfunc (f *fileImport) IsWeak() bool {\n\treturn f.isWeak\n}\n\nfunc (f *fileImport) IsUnused() bool {\n\treturn f.isUnused\n}\n\nfunc (f *fileImport) Location() Location {\n\treturn f.getLocation(f.path)\n}\n\nfunc (f *fileImport) setIsPublic() {\n\tf.isPublic = true\n}\n\nfunc (f *fileImport) setIsWeak() {\n\tf.isWeak = true\n}\n\nfunc (f *fileImport) setIsUnused() {\n\tf.isUnused = true\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/files.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"context\"\n\t\"sync\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n)\n\nconst defaultChunkSizeThreshold = 8\n\nfunc newFiles[F InputFile](\n\tctx context.Context,\n\tinputFiles []F,\n\tresolver protodesc.Resolver,\n) ([]File, error) {\n\tindexedInputFiles := xslices.ToIndexed(inputFiles)\n\tif len(indexedInputFiles) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Why were we chunking this? We could just send each individual call to thread.Parallelize\n\t// and let thread.Parallelize deal with what to do.\n\n\tchunkSize := len(indexedInputFiles) / thread.Parallelism()\n\tif chunkSize < defaultChunkSizeThreshold {\n\t\tfiles := make([]File, 0, len(indexedInputFiles))\n\t\tfor _, indexedInputFile := range indexedInputFiles {\n\t\t\tfile, err := newFile(indexedInputFile.Value, resolver)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tfiles = append(files, file)\n\t\t}\n\t\treturn files, nil\n\t}\n\tchunks := xslices.ToChunks(indexedInputFiles, chunkSize)\n\tindexedFiles := make([]xslices.Indexed[File], 0, len(indexedInputFiles))\n\tjobs := make([]func(context.Context) error, len(chunks))\n\tvar lock sync.Mutex\n\tfor i, indexedInputFileChunk := range chunks {\n\t\tjobs[i] = func(ctx context.Context) error {\n\t\t\tiIndexedFiles := make([]xslices.Indexed[File], 0, len(indexedInputFileChunk))\n\t\t\tfor _, indexedInputFile := range indexedInputFileChunk {\n\t\t\t\tfile, err := newFile(indexedInputFile.Value, resolver)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tiIndexedFiles = append(iIndexedFiles, xslices.Indexed[File]{Value: file, Index: indexedInputFile.Index})\n\t\t\t}\n\t\t\tlock.Lock()\n\t\t\tindexedFiles = append(indexedFiles, iIndexedFiles...)\n\t\t\tlock.Unlock()\n\t\t\treturn nil\n\t\t}\n\t}\n\tif err := thread.Parallelize(ctx, jobs); err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.IndexedToSortedValues(indexedFiles), nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/location.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype location struct {\n\tfilePath               string\n\tsourceCodeInfoLocation *descriptorpb.SourceCodeInfo_Location\n}\n\nfunc newLocation(\n\tfilePath string,\n\tsourceCodeInfoLocation *descriptorpb.SourceCodeInfo_Location,\n) *location {\n\treturn &location{\n\t\tfilePath:               filePath,\n\t\tsourceCodeInfoLocation: sourceCodeInfoLocation,\n\t}\n}\n\nfunc (l *location) FilePath() string {\n\treturn l.filePath\n}\n\nfunc (l *location) StartLine() int {\n\tswitch len(l.sourceCodeInfoLocation.Span) {\n\tcase 3, 4:\n\t\treturn int(l.sourceCodeInfoLocation.Span[0]) + 1\n\tdefault:\n\t\t// since we are not erroring, making this and others 1 so that other code isn't messed up by assuming\n\t\t// this is >= 1\n\t\treturn 1\n\t}\n}\n\nfunc (l *location) StartColumn() int {\n\tswitch len(l.sourceCodeInfoLocation.Span) {\n\tcase 3, 4:\n\t\treturn int(l.sourceCodeInfoLocation.Span[1]) + 1\n\tdefault:\n\t\t// since we are not erroring, making this and others 1 so that other code isn't messed up by assuming\n\t\t// this is >= 1\n\t\treturn 1\n\t}\n}\n\nfunc (l *location) EndLine() int {\n\tswitch len(l.sourceCodeInfoLocation.Span) {\n\tcase 3:\n\t\treturn int(l.sourceCodeInfoLocation.Span[0]) + 1\n\tcase 4:\n\t\treturn int(l.sourceCodeInfoLocation.Span[2]) + 1\n\tdefault:\n\t\t// since we are not erroring, making this and others 1 so that other code isn't messed up by assuming\n\t\t// this is >= 1\n\t\treturn 1\n\t}\n}\n\nfunc (l *location) EndColumn() int {\n\tswitch len(l.sourceCodeInfoLocation.Span) {\n\tcase 3:\n\t\treturn int(l.sourceCodeInfoLocation.Span[2]) + 1\n\tcase 4:\n\t\treturn int(l.sourceCodeInfoLocation.Span[3]) + 1\n\tdefault:\n\t\t// since we are not erroring, making this and others 1 so that other code isn't messed up by assuming\n\t\t// this is >= 1\n\t\treturn 1\n\t}\n}\n\nfunc (l *location) LeadingComments() string {\n\tif l.sourceCodeInfoLocation.LeadingComments == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.sourceCodeInfoLocation.LeadingComments\n}\n\nfunc (l *location) TrailingComments() string {\n\tif l.sourceCodeInfoLocation.TrailingComments == nil {\n\t\treturn \"\"\n\t}\n\treturn *l.sourceCodeInfoLocation.TrailingComments\n}\n\nfunc (l *location) LeadingDetachedComments() []string {\n\treturn l.sourceCodeInfoLocation.LeadingDetachedComments\n}\n\nfunc (l *location) SourcePath() protoreflect.SourcePath {\n\treturn protoreflect.SourcePath(l.sourceCodeInfoLocation.Path)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/location_descriptor.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\ntype locationDescriptor struct {\n\tdescriptor\n\n\tpath []int32\n}\n\nfunc newLocationDescriptor(\n\tdescriptor descriptor,\n\tpath []int32,\n) locationDescriptor {\n\treturn locationDescriptor{\n\t\tdescriptor: descriptor,\n\t\tpath:       path,\n\t}\n}\n\nfunc (l *locationDescriptor) Location() Location {\n\treturn l.getLocation(l.path)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/location_store.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"sync\"\n\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype locationStore struct {\n\tfilePath                string\n\tsourceCodeInfoLocations []*descriptorpb.SourceCodeInfo_Location\n\tgetPathToLocation       func() map[string]Location\n}\n\nfunc newLocationStore(fileDescriptorProto *descriptorpb.FileDescriptorProto) *locationStore {\n\tlocationStore := &locationStore{\n\t\tfilePath:                fileDescriptorProto.GetName(),\n\t\tsourceCodeInfoLocations: fileDescriptorProto.GetSourceCodeInfo().GetLocation(),\n\t}\n\tlocationStore.getPathToLocation = sync.OnceValue(locationStore.getPathToLocationUncached)\n\treturn locationStore\n}\n\nfunc (l *locationStore) isEmpty() bool {\n\treturn len(l.getPathToLocation()) == 0\n}\n\nfunc (l *locationStore) getLocation(path []int32) Location {\n\treturn l.getLocationByPathKey(getPathKey(path))\n}\n\nfunc (l *locationStore) getLocationByPathKey(pathKey string) Location {\n\treturn l.getPathToLocation()[pathKey]\n}\n\n// Expensive - not cached.\n//\n// This is specific to optionExtensionDescriptor.OptionLocation.\nfunc (l *locationStore) getBestMatchOptionExtensionLocation(path []int32, extensionPathLen int) Location {\n\t// \"Fuzzy\" search: find a location whose path is at least extensionPathLen long,\n\t// preferring the longest matching ancestor path (i.e. as many extraPath elements\n\t// as can be found). If we find a *sub*path (a descendant path, that points INTO\n\t// the path we are trying to find), use the first such one encountered.\n\tvar bestMatch *descriptorpb.SourceCodeInfo_Location\n\tvar bestMatchPathLen int\n\tfor _, loc := range l.sourceCodeInfoLocations {\n\t\tif len(loc.Path) >= extensionPathLen &&\n\t\t\tisDescendantPath(path, loc.Path) &&\n\t\t\tlen(loc.Path) > bestMatchPathLen {\n\t\t\tbestMatch = loc\n\t\t\tbestMatchPathLen = len(loc.Path)\n\t\t} else if isDescendantPath(loc.Path, path) {\n\t\t\treturn newLocation(l.filePath, loc)\n\t\t}\n\t}\n\tif bestMatch != nil {\n\t\treturn newLocation(l.filePath, bestMatch)\n\t}\n\treturn nil\n}\n\n// Do not use outside of locationStore!\nfunc (l *locationStore) getPathToLocationUncached() map[string]Location {\n\tpathToLocation := make(map[string]Location, len(l.sourceCodeInfoLocations))\n\tfor _, sourceCodeInfoLocation := range l.sourceCodeInfoLocations {\n\t\tpathKey := getPathKey(sourceCodeInfoLocation.Path)\n\t\t// - Multiple locations may have the same path.  This happens when a single\n\t\t//   logical declaration is spread out across multiple places.  The most\n\t\t//   obvious example is the \"extend\" block again -- there may be multiple\n\t\t//   extend blocks in the same scope, each of which will have the same path.\n\t\tif _, ok := pathToLocation[pathKey]; !ok {\n\t\t\tpathToLocation[pathKey] = newLocation(l.filePath, sourceCodeInfoLocation)\n\t\t}\n\t}\n\treturn pathToLocation\n}\n\nfunc getPathKey(path []int32) string {\n\tkey := make([]byte, len(path)*4)\n\tj := 0\n\tfor _, elem := range path {\n\t\tkey[j] = byte(elem)\n\t\tkey[j+1] = byte(elem >> 8)\n\t\tkey[j+2] = byte(elem >> 16)\n\t\tkey[j+3] = byte(elem >> 24)\n\t\tj += 4\n\t}\n\treturn string(key)\n}\n\nfunc isDescendantPath(descendant, ancestor []int32) bool {\n\tif len(descendant) < len(ancestor) {\n\t\treturn false\n\t}\n\tfor i := range ancestor {\n\t\tif descendant[i] != ancestor[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/merge_comment_location.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport \"google.golang.org/protobuf/reflect/protoreflect\"\n\ntype mergeCommentLocation struct {\n\tbase            Location\n\tdelegate        Location\n\tbaseHasComments bool\n}\n\nfunc newMergeCommentLocation(base Location, delegate Location) *mergeCommentLocation {\n\treturn &mergeCommentLocation{\n\t\tbase:            base,\n\t\tdelegate:        delegate,\n\t\tbaseHasComments: base.LeadingComments() != \"\" || base.TrailingComments() != \"\" || len(base.LeadingDetachedComments()) > 0,\n\t}\n}\n\nfunc (l *mergeCommentLocation) FilePath() string {\n\treturn l.base.FilePath()\n}\n\nfunc (l *mergeCommentLocation) StartLine() int {\n\treturn l.base.StartLine()\n}\n\nfunc (l *mergeCommentLocation) StartColumn() int {\n\treturn l.base.StartColumn()\n}\n\nfunc (l *mergeCommentLocation) EndLine() int {\n\treturn l.base.EndLine()\n}\n\nfunc (l *mergeCommentLocation) EndColumn() int {\n\treturn l.base.EndColumn()\n}\n\nfunc (l *mergeCommentLocation) LeadingComments() string {\n\tif l.baseHasComments {\n\t\treturn l.base.LeadingComments()\n\t}\n\treturn l.delegate.LeadingComments()\n}\n\nfunc (l *mergeCommentLocation) TrailingComments() string {\n\tif l.baseHasComments {\n\t\treturn l.base.TrailingComments()\n\t}\n\treturn l.delegate.TrailingComments()\n}\n\nfunc (l *mergeCommentLocation) LeadingDetachedComments() []string {\n\tif l.baseHasComments {\n\t\treturn l.base.LeadingDetachedComments()\n\t}\n\treturn l.delegate.LeadingDetachedComments()\n}\n\nfunc (l *mergeCommentLocation) SourcePath() protoreflect.SourcePath {\n\treturn l.base.SourcePath()\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/message.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype message struct {\n\tnamedDescriptor\n\toptionExtensionDescriptor\n\n\tfields                             []Field\n\textensions                         []Field\n\tnestedMessages                     []Message\n\tnestedEnums                        []Enum\n\toneofs                             []Oneof\n\treservedMessageRanges              []MessageRange\n\treservedNames                      []ReservedName\n\textensionRanges                    []ExtensionRange\n\tparent                             Message\n\tisMapEntry                         bool\n\tmessageSetWireFormat               bool\n\tnoStandardDescriptorAccessor       bool\n\tdeprecatedLegacyJSONFieldConflicts bool\n\tdeprecated                         bool\n\tmessageSetWireFormatPath           []int32\n\tnoStandardDescriptorAccessorPath   []int32\n}\n\nfunc newMessage(\n\tnamedDescriptor namedDescriptor,\n\toptionExtensionDescriptor optionExtensionDescriptor,\n\tparent Message,\n\tisMapEntry bool,\n\tmessageSetWireFormat bool,\n\tnoStandardDescriptorAccessor bool,\n\tdeprecatedLegacyJSONFieldConflicts bool,\n\tdeprecated bool,\n\tmessageSetWireFormatPath []int32,\n\tnoStandardDescriptorAccessorPath []int32,\n) *message {\n\treturn &message{\n\t\tnamedDescriptor:                    namedDescriptor,\n\t\toptionExtensionDescriptor:          optionExtensionDescriptor,\n\t\tparent:                             parent,\n\t\tisMapEntry:                         isMapEntry,\n\t\tmessageSetWireFormat:               messageSetWireFormat,\n\t\tnoStandardDescriptorAccessor:       noStandardDescriptorAccessor,\n\t\tdeprecatedLegacyJSONFieldConflicts: deprecatedLegacyJSONFieldConflicts,\n\t\tdeprecated:                         deprecated,\n\t\tmessageSetWireFormatPath:           messageSetWireFormatPath,\n\t\tnoStandardDescriptorAccessorPath:   noStandardDescriptorAccessorPath,\n\t}\n}\n\nfunc (m *message) Fields() []Field {\n\treturn m.fields\n}\n\nfunc (m *message) Extensions() []Field {\n\treturn m.extensions\n}\n\nfunc (m *message) Messages() []Message {\n\treturn m.nestedMessages\n}\n\nfunc (m *message) Enums() []Enum {\n\treturn m.nestedEnums\n}\n\nfunc (m *message) Oneofs() []Oneof {\n\treturn m.oneofs\n}\n\nfunc (m *message) ReservedMessageRanges() []MessageRange {\n\treturn m.reservedMessageRanges\n}\n\nfunc (m *message) ReservedTagRanges() []TagRange {\n\ttagRanges := make([]TagRange, len(m.reservedMessageRanges))\n\tfor i, reservedMessageRange := range m.reservedMessageRanges {\n\t\ttagRanges[i] = reservedMessageRange\n\t}\n\treturn tagRanges\n}\n\nfunc (m *message) ReservedNames() []ReservedName {\n\treturn m.reservedNames\n}\n\nfunc (m *message) ExtensionRanges() []ExtensionRange {\n\treturn m.extensionRanges\n}\n\nfunc (m *message) ExtensionMessageRanges() []MessageRange {\n\textMsgRanges := make([]MessageRange, len(m.extensionRanges))\n\tfor i, extensionRange := range m.extensionRanges {\n\t\textMsgRanges[i] = extensionRange\n\t}\n\treturn extMsgRanges\n}\n\nfunc (m *message) Parent() Message {\n\treturn m.parent\n}\n\nfunc (m *message) IsMapEntry() bool {\n\treturn m.isMapEntry\n}\n\nfunc (m *message) MessageSetWireFormat() bool {\n\treturn m.messageSetWireFormat\n}\n\nfunc (m *message) NoStandardDescriptorAccessor() bool {\n\treturn m.noStandardDescriptorAccessor\n}\n\nfunc (m *message) DeprecatedLegacyJSONFieldConflicts() bool {\n\treturn m.deprecatedLegacyJSONFieldConflicts\n}\n\nfunc (m *message) Deprecated() bool {\n\treturn m.deprecated\n}\n\nfunc (m *message) MessageSetWireFormatLocation() Location {\n\treturn m.getLocation(m.messageSetWireFormatPath)\n}\n\nfunc (m *message) NoStandardDescriptorAccessorLocation() Location {\n\treturn m.getLocation(m.noStandardDescriptorAccessorPath)\n}\n\nfunc (m *message) Location() Location {\n\tloc := m.namedDescriptor.Location()\n\tif loc == nil {\n\t\treturn m.maybeMapEntryLocation()\n\t}\n\treturn loc\n}\n\nfunc (m *message) NameLocation() Location {\n\tloc := m.namedDescriptor.NameLocation()\n\tif loc == nil {\n\t\treturn m.maybeMapEntryLocation()\n\t}\n\treturn loc\n}\n\nfunc (m *message) maybeMapEntryLocation() Location {\n\tparent, _ := m.parent.(*message)\n\tif !m.isMapEntry || parent == nil || m.namedDescriptor.locationStore.isEmpty() {\n\t\t// not a map entry\n\t\treturn nil\n\t}\n\t// Synthetic map messages come from the type of the corresponding\n\t// map field. So report that location.\n\tif field := parent.findMapField(m.FullName()); field != nil {\n\t\treturn field.TypeNameLocation()\n\t}\n\treturn nil\n}\n\nfunc (m *message) findMapField(entryName string) Field {\n\tfor _, field := range m.fields {\n\t\tif field.Type() == descriptorpb.FieldDescriptorProto_TYPE_MESSAGE &&\n\t\t\tfield.Label() == descriptorpb.FieldDescriptorProto_LABEL_REPEATED &&\n\t\t\tfield.TypeName() == entryName {\n\t\t\treturn field\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *message) addField(field Field) {\n\tm.fields = append(m.fields, field)\n}\n\nfunc (m *message) addExtension(extension Field) {\n\tm.extensions = append(m.extensions, extension)\n}\n\nfunc (m *message) addNestedMessage(nestedMessage Message) {\n\tm.nestedMessages = append(m.nestedMessages, nestedMessage)\n}\n\nfunc (m *message) addNestedEnum(nestedEnum Enum) {\n\tm.nestedEnums = append(m.nestedEnums, nestedEnum)\n}\n\nfunc (m *message) addOneof(oneof Oneof) {\n\tm.oneofs = append(m.oneofs, oneof)\n}\n\nfunc (m *message) addReservedMessageRange(reservedMessageRange MessageRange) {\n\tm.reservedMessageRanges = append(m.reservedMessageRanges, reservedMessageRange)\n}\n\nfunc (m *message) addReservedName(reservedName ReservedName) {\n\tm.reservedNames = append(m.reservedNames, reservedName)\n}\n\nfunc (m *message) addExtensionRange(extensionRange ExtensionRange) {\n\tm.extensionRanges = append(m.extensionRanges, extensionRange)\n}\n\nfunc (m *message) AsDescriptor() (protoreflect.MessageDescriptor, error) {\n\treturn asDescriptor[protoreflect.MessageDescriptor](&m.descriptor, m.FullName(), \"a message\")\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/message_range.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport \"math\"\n\nconst (\n\t// MessageRangeInclusiveMax is the maximum allowed tag for a message field.\n\tMessageRangeInclusiveMax = 536870911 // 2^29 - 1\n\t// MessageSetRangeInclusiveMax is the maximum allowed tag for a message\n\t// field for a message that uses the message-set wire format.\n\tMessageSetRangeInclusiveMax = math.MaxInt32 - 1\n)\n\ntype messageRange struct {\n\tlocationDescriptor\n\n\tmessage Message\n\tstart   int\n\tend     int\n}\n\nfunc newMessageRange(\n\tlocationDescriptor locationDescriptor,\n\tmessage Message,\n\tstart int,\n\tend int,\n) *messageRange {\n\treturn &messageRange{\n\t\tlocationDescriptor: locationDescriptor,\n\t\tmessage:            message,\n\t\tstart:              start,\n\t\t// end is exclusive for messages\n\t\tend: end - 1,\n\t}\n}\n\nfunc (r *messageRange) Message() Message {\n\treturn r.message\n}\n\nfunc (r *messageRange) Start() int {\n\treturn r.start\n}\n\nfunc (r *messageRange) End() int {\n\treturn r.end\n}\n\nfunc (r *messageRange) Max() bool {\n\tif r.message.MessageSetWireFormat() {\n\t\treturn r.end == MessageSetRangeInclusiveMax\n\t}\n\treturn r.end == MessageRangeInclusiveMax\n}\n\ntype extensionRange struct {\n\t*messageRange\n\toptionExtensionDescriptor\n}\n\nfunc newExtensionRange(\n\tlocationDescriptor locationDescriptor,\n\tmessage Message,\n\tstart int,\n\tend int,\n\topts optionExtensionDescriptor,\n) *extensionRange {\n\treturn &extensionRange{\n\t\tmessageRange: newMessageRange(\n\t\t\tlocationDescriptor, message, start, end,\n\t\t),\n\t\toptionExtensionDescriptor: opts,\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/method.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\ntype method struct {\n\tnamedDescriptor\n\toptionExtensionDescriptor\n\n\tservice              Service\n\tinputTypeName        string\n\toutputTypeName       string\n\tclientStreaming      bool\n\tserverStreaming      bool\n\tdeprecated           bool\n\tinputTypePath        []int32\n\toutputTypePath       []int32\n\tidempotencyLevel     descriptorpb.MethodOptions_IdempotencyLevel\n\tidempotencyLevelPath []int32\n}\n\nfunc newMethod(\n\tnamedDescriptor namedDescriptor,\n\toptionExtensionDescriptor optionExtensionDescriptor,\n\tservice Service,\n\tinputTypeName string,\n\toutputTypeName string,\n\tclientStreaming bool,\n\tserverStreaming bool,\n\tdeprecated bool,\n\tinputTypePath []int32,\n\toutputTypePath []int32,\n\tidempotencyLevel descriptorpb.MethodOptions_IdempotencyLevel,\n\tidempotencyLevelPath []int32,\n) (*method, error) {\n\tif inputTypeName == \"\" {\n\t\treturn nil, fmt.Errorf(\"no inputTypeName on %q\", namedDescriptor.name)\n\t}\n\tif outputTypeName == \"\" {\n\t\treturn nil, fmt.Errorf(\"no outputTypeName on %q\", namedDescriptor.name)\n\t}\n\treturn &method{\n\t\tnamedDescriptor:           namedDescriptor,\n\t\toptionExtensionDescriptor: optionExtensionDescriptor,\n\t\tservice:                   service,\n\t\tinputTypeName:             inputTypeName,\n\t\toutputTypeName:            outputTypeName,\n\t\tclientStreaming:           clientStreaming,\n\t\tserverStreaming:           serverStreaming,\n\t\tdeprecated:                deprecated,\n\t\tinputTypePath:             inputTypePath,\n\t\toutputTypePath:            outputTypePath,\n\t\tidempotencyLevel:          idempotencyLevel,\n\t\tidempotencyLevelPath:      idempotencyLevelPath,\n\t}, nil\n}\n\nfunc (m *method) Service() Service {\n\treturn m.service\n}\n\nfunc (m *method) InputTypeName() string {\n\treturn m.inputTypeName\n}\n\nfunc (m *method) OutputTypeName() string {\n\treturn m.outputTypeName\n}\n\nfunc (m *method) ClientStreaming() bool {\n\treturn m.clientStreaming\n}\n\nfunc (m *method) ServerStreaming() bool {\n\treturn m.serverStreaming\n}\n\nfunc (m *method) Deprecated() bool {\n\treturn m.deprecated\n}\n\nfunc (m *method) InputTypeLocation() Location {\n\treturn m.getLocation(m.inputTypePath)\n}\n\nfunc (m *method) OutputTypeLocation() Location {\n\treturn m.getLocation(m.outputTypePath)\n}\n\nfunc (m *method) IdempotencyLevel() descriptorpb.MethodOptions_IdempotencyLevel {\n\treturn m.idempotencyLevel\n}\n\nfunc (m *method) IdempotencyLevelLocation() Location {\n\treturn m.getLocation(m.idempotencyLevelPath)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/named_descriptor.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\ntype namedDescriptor struct {\n\tlocationDescriptor\n\n\tname        string\n\tnamePath    []int32\n\tnestedNames []string\n}\n\nfunc newNamedDescriptor(\n\tlocationDescriptor locationDescriptor,\n\tname string,\n\tnamePath []int32,\n\tnestedNames []string,\n) (namedDescriptor, error) {\n\tif name == \"\" {\n\t\treturn namedDescriptor{}, fmt.Errorf(\"no name in %q\", locationDescriptor.File().Path())\n\t}\n\treturn namedDescriptor{\n\t\tlocationDescriptor: locationDescriptor,\n\t\tname:               name,\n\t\tnamePath:           namePath,\n\t\tnestedNames:        nestedNames,\n\t}, nil\n}\n\nfunc (n *namedDescriptor) FullName() string {\n\tif n.File().Package() != \"\" {\n\t\treturn n.File().Package() + \".\" + n.NestedName()\n\t}\n\treturn n.NestedName()\n}\n\nfunc (n *namedDescriptor) NestedName() string {\n\tif len(n.nestedNames) == 0 {\n\t\treturn n.Name()\n\t}\n\treturn strings.Join(n.nestedNames, \".\") + \".\" + n.Name()\n}\n\nfunc (n *namedDescriptor) Name() string {\n\treturn n.name\n}\n\nfunc (n *namedDescriptor) NameLocation() Location {\n\tnameLocation := n.getLocation(n.namePath)\n\tlocation := n.getLocation(n.path)\n\tif nameLocation != nil {\n\t\tif location != nil {\n\t\t\treturn newMergeCommentLocation(nameLocation, location)\n\t\t}\n\t\treturn nameLocation\n\t}\n\treturn location\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/oneof.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport \"google.golang.org/protobuf/reflect/protoreflect\"\n\ntype oneof struct {\n\tnamedDescriptor\n\toptionExtensionDescriptor\n\n\tmessage Message\n\tfields  []Field\n}\n\nfunc newOneof(\n\tnamedDescriptor namedDescriptor,\n\toptionExtensionDescriptor optionExtensionDescriptor,\n\tmessage Message,\n) *oneof {\n\treturn &oneof{\n\t\tnamedDescriptor:           namedDescriptor,\n\t\toptionExtensionDescriptor: optionExtensionDescriptor,\n\t\tmessage:                   message,\n\t}\n}\n\nfunc (o *oneof) Message() Message {\n\treturn o.message\n}\n\nfunc (o *oneof) Fields() []Field {\n\treturn o.fields\n}\n\nfunc (o *oneof) addField(field Field) {\n\to.fields = append(o.fields, field)\n}\n\nfunc (o *oneof) AsDescriptor() (protoreflect.OneofDescriptor, error) {\n\treturn asDescriptor[protoreflect.OneofDescriptor](&o.descriptor, o.FullName(), \"a oneof\")\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/option_extension_descriptor.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"google.golang.org/protobuf/encoding/protowire\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\ntype optionExtensionDescriptor struct {\n\tmessage       proto.Message\n\toptionsPath   []int32\n\tlocationStore *locationStore\n\tfeaturesTag   protoreflect.FieldNumber\n}\n\nfunc newOptionExtensionDescriptor(message proto.Message, optionsPath []int32, locationStore *locationStore, featuresTag protoreflect.FieldNumber) optionExtensionDescriptor {\n\treturn optionExtensionDescriptor{\n\t\tmessage:       message,\n\t\toptionsPath:   optionsPath,\n\t\tlocationStore: locationStore,\n\t\tfeaturesTag:   featuresTag,\n\t}\n}\n\nfunc (o *optionExtensionDescriptor) OptionExtension(extensionType protoreflect.ExtensionType) (any, bool) {\n\tif extensionType.TypeDescriptor().ContainingMessage().FullName() != o.message.ProtoReflect().Descriptor().FullName() {\n\t\treturn nil, false\n\t}\n\tif !proto.HasExtension(o.message, extensionType) {\n\t\treturn nil, false\n\t}\n\treturn proto.GetExtension(o.message, extensionType), true\n}\n\nfunc (o *optionExtensionDescriptor) OptionExtensionLocation(extensionType protoreflect.ExtensionType, extraPath ...int32) Location {\n\treturn o.OptionLocation(extensionType.TypeDescriptor(), extraPath...)\n}\n\nfunc (o *optionExtensionDescriptor) OptionLocation(field protoreflect.FieldDescriptor, extraPath ...int32) Location {\n\tif field.ContainingMessage().FullName() != o.message.ProtoReflect().Descriptor().FullName() {\n\t\treturn nil\n\t}\n\tif o.locationStore == nil {\n\t\treturn nil\n\t}\n\tpath := make([]int32, len(o.optionsPath), len(o.optionsPath)+1+len(extraPath))\n\tcopy(path, o.optionsPath)\n\tpath = append(path, int32(field.Number()))\n\textensionPathLen := len(path) // length of path to extension (without extraPath)\n\tpath = append(path, extraPath...)\n\tloc := o.locationStore.getLocation(path)\n\tif loc != nil {\n\t\t// Found an exact match!\n\t\treturn loc\n\t}\n\treturn o.locationStore.getBestMatchOptionExtensionLocation(path, extensionPathLen)\n}\n\nfunc (o *optionExtensionDescriptor) PresentExtensionNumbers() []int32 {\n\tfieldNumbersSet := map[int32]struct{}{}\n\tvar fieldNumbers []int32\n\taddFieldNumber := func(fieldNo int32) {\n\t\tif _, ok := fieldNumbersSet[fieldNo]; !ok {\n\t\t\tfieldNumbersSet[fieldNo] = struct{}{}\n\t\t\tfieldNumbers = append(fieldNumbers, fieldNo)\n\t\t}\n\t}\n\tmsg := o.message.ProtoReflect()\n\textensionRanges := msg.Descriptor().ExtensionRanges()\n\tfor b := msg.GetUnknown(); len(b) > 0; {\n\t\tfieldNo, _, n := protowire.ConsumeField(b)\n\t\tif extensionRanges.Has(fieldNo) {\n\t\t\taddFieldNumber(int32(fieldNo))\n\t\t}\n\t\tb = b[n:]\n\t}\n\t// Extensions for google.protobuf.*Options are a bit of a special case\n\t// as the extensions in a FileDescriptorSet message may differ with\n\t// the extensions defined in the proto with which buf is compiled.\n\t//\n\t// Also loop through known extensions here to get extension numbers.\n\tmsg.Range(func(fieldDescriptor protoreflect.FieldDescriptor, _ protoreflect.Value) bool {\n\t\tif fieldDescriptor.IsExtension() {\n\t\t\taddFieldNumber(int32(fieldDescriptor.Number()))\n\t\t}\n\t\treturn true\n\t})\n\n\treturn fieldNumbers\n}\n\nfunc (o *optionExtensionDescriptor) ForEachPresentOption(fn func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {\n\t// Note: This does not bother to handle unrecognized fields.\n\t// Should not be a problem since descriptors models in the buf CLI codebase should have them\n\t// all correctly parsed and known.\n\to.message.ProtoReflect().Range(fn)\n}\n\nfunc (o *optionExtensionDescriptor) Features() FeaturesDescriptor {\n\treturn o\n}\n\nfunc (o *optionExtensionDescriptor) FieldPresenceLocation() Location {\n\tfeatures := o.message.ProtoReflect().Descriptor().Fields().ByNumber(o.featuresTag)\n\treturn o.OptionLocation(features, 1)\n}\n\nfunc (o *optionExtensionDescriptor) EnumTypeLocation() Location {\n\tfeatures := o.message.ProtoReflect().Descriptor().Fields().ByNumber(o.featuresTag)\n\treturn o.OptionLocation(features, 2)\n}\n\nfunc (o *optionExtensionDescriptor) RepeatedFieldEncodingLocation() Location {\n\tfeatures := o.message.ProtoReflect().Descriptor().Fields().ByNumber(o.featuresTag)\n\treturn o.OptionLocation(features, 3)\n}\n\nfunc (o *optionExtensionDescriptor) UTF8ValidationLocation() Location {\n\tfeatures := o.message.ProtoReflect().Descriptor().Fields().ByNumber(o.featuresTag)\n\treturn o.OptionLocation(features, 4)\n}\n\nfunc (o *optionExtensionDescriptor) MessageEncodingLocation() Location {\n\tfeatures := o.message.ProtoReflect().Descriptor().Fields().ByNumber(o.featuresTag)\n\treturn o.OptionLocation(features, 5)\n}\n\nfunc (o *optionExtensionDescriptor) JSONFormatLocation() Location {\n\tfeatures := o.message.ProtoReflect().Descriptor().Fields().ByNumber(o.featuresTag)\n\treturn o.OptionLocation(features, 6)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/option_extension_descriptor_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"math\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/reflect/protoregistry\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n)\n\nfunc TestOptionExtensionLocation(t *testing.T) {\n\tt.Parallel()\n\tlocations := []*descriptorpb.SourceCodeInfo_Location{\n\t\t{\n\t\t\tPath:            []int32{1, 2, 3, 4, 5, 1099, 100, 101, 102},\n\t\t\tSpan:            []int32{99, 100, 101},\n\t\t\tLeadingComments: proto.String(\"inside custom option 1099 (100)\"),\n\t\t},\n\t\t{\n\t\t\tPath:            []int32{1, 2, 3, 4, 5, 1099, 100, 102, 103},\n\t\t\tSpan:            []int32{99, 100, 102},\n\t\t\tLeadingComments: proto.String(\"inside custom option 1099 (100 again)\"),\n\t\t},\n\t\t{\n\t\t\tPath:            []int32{1, 2, 3, 4, 5, 1099, 200},\n\t\t\tSpan:            []int32{99, 200, 201},\n\t\t\tLeadingComments: proto.String(\"inside custom option 1099 (200)\"),\n\t\t},\n\t\t{\n\t\t\tPath:            []int32{1, 2, 3, 4, 5, 1089},\n\t\t\tSpan:            []int32{89, 1, 2},\n\t\t\tLeadingComments: proto.String(\"custom option 1089\"),\n\t\t},\n\t\t{\n\t\t\tPath:            []int32{1, 2, 3, 4, 5, 1079},\n\t\t\tSpan:            []int32{79, 1, 2},\n\t\t\tLeadingComments: proto.String(\"custom option 1079\"),\n\t\t},\n\t\t{\n\t\t\tPath:            []int32{1, 2, 3, 4, 5, 1079},\n\t\t\tSpan:            []int32{79, 11, 12},\n\t\t\tLeadingComments: proto.String(\"custom option 1079 (again)\"),\n\t\t},\n\t\t{\n\t\t\tPath:            []int32{1, 2, 3, 4, 5},\n\t\t\tSpan:            []int32{5, 1, 2},\n\t\t\tLeadingComments: proto.String(\"options\"),\n\t\t},\n\t}\n\tlocationStore := newLocationStore(\n\t\t&descriptorpb.FileDescriptorProto{\n\t\t\tName: proto.String(\"foo.proto\"),\n\t\t\tSourceCodeInfo: &descriptorpb.SourceCodeInfo{\n\t\t\t\tLocation: locations,\n\t\t\t},\n\t\t},\n\t)\n\tdescriptor := newOptionExtensionDescriptor(&descriptorpb.MessageOptions{}, []int32{1, 2, 3, 4, 5}, locationStore, 12)\n\tcustomOption1079 := makeCustomOption(t, 1079)\n\tcustomOption1089 := makeCustomOption(t, 1089)\n\tcustomOption1099 := makeCustomOption(t, 1099)\n\tcustomOption1109 := makeCustomOption(t, 1109)\n\n\tassert.Nil(t, descriptor.OptionExtensionLocation(customOption1109))\n\tassert.Nil(t, descriptor.OptionExtensionLocation(customOption1099, 100, 103))\n\tassert.Nil(t, descriptor.OptionExtensionLocation(customOption1099, 300))\n\n\tloc := descriptor.OptionExtensionLocation(customOption1099)\n\tcheckLocation(t, loc, locations[0])\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 100)\n\tcheckLocation(t, loc, locations[0])\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 100, 101)\n\tcheckLocation(t, loc, locations[0])\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 100, 101, 102)\n\tcheckLocation(t, loc, locations[0])\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 100, 101, 102, 103)\n\tcheckLocation(t, loc, locations[0])\n\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 100, 102)\n\tcheckLocation(t, loc, locations[1])\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 100, 102, 103)\n\tcheckLocation(t, loc, locations[1])\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 100, 102, 103, 1, 2, 3, 4)\n\tcheckLocation(t, loc, locations[1])\n\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 200)\n\tcheckLocation(t, loc, locations[2])\n\tloc = descriptor.OptionExtensionLocation(customOption1099, 200, 0)\n\tcheckLocation(t, loc, locations[2])\n\n\tloc = descriptor.OptionExtensionLocation(customOption1089)\n\tcheckLocation(t, loc, locations[3])\n\tloc = descriptor.OptionExtensionLocation(customOption1089, 10)\n\tcheckLocation(t, loc, locations[3])\n\n\tloc = descriptor.OptionExtensionLocation(customOption1079)\n\tcheckLocation(t, loc, locations[4])\n\tloc = descriptor.OptionExtensionLocation(customOption1079, 1, 2, 3)\n\tcheckLocation(t, loc, locations[4])\n}\n\nfunc checkLocation(t *testing.T, loc Location, sourceCodeInfoLoc *descriptorpb.SourceCodeInfo_Location) {\n\tt.Helper()\n\tassert.Equal(t, sourceCodeInfoLoc.GetLeadingComments(), loc.LeadingComments())\n\t// Bounds assertions for int -> int32 conversion\n\tassert.Less(t, loc.StartLine(), math.MaxInt32)\n\tassert.Greater(t, loc.StartLine(), math.MinInt32)\n\tassert.Less(t, loc.StartColumn(), math.MaxInt32)\n\tassert.Greater(t, loc.StartLine(), math.MinInt32)\n\tspan := []int32{int32(loc.StartLine() - 1), int32(loc.StartColumn() - 1)}\n\tif loc.EndLine() != loc.StartLine() {\n\t\tassert.Less(t, loc.EndLine(), math.MaxInt32)\n\t\tassert.Greater(t, loc.EndLine(), math.MinInt32)\n\t\tspan = append(span, int32(loc.EndLine()-1))\n\t}\n\tassert.Less(t, loc.EndColumn(), math.MaxInt32)\n\tassert.Greater(t, loc.EndColumn(), math.MinInt32)\n\tspan = append(span, int32(loc.EndColumn()-1))\n\tassert.Equal(t, sourceCodeInfoLoc.Span, span)\n}\n\nfunc makeCustomOption(t *testing.T, tag int32) protoreflect.ExtensionType {\n\tt.Helper()\n\tfileDescriptorProto := &descriptorpb.FileDescriptorProto{\n\t\tName:       proto.String(\"test.proto\"),\n\t\tSyntax:     proto.String(\"proto2\"),\n\t\tDependency: []string{\"google/protobuf/descriptor.proto\"},\n\t\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t{\n\t\t\t\tName:     proto.String(\"test\"),\n\t\t\t\tNumber:   proto.Int32(tag),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tExtendee: proto.String(\".google.protobuf.MessageOptions\"),\n\t\t\t},\n\t\t},\n\t}\n\tfileDescriptor, err := protodesc.NewFile(fileDescriptorProto, protoregistry.GlobalFiles)\n\trequire.NoError(t, err)\n\treturn dynamicpb.NewExtensionType(fileDescriptor.Extensions().Get(0))\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/paths.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nvar (\n\tcsharpNamespacePathKey      = getPathKey([]int32{8, 37})\n\tgoPackagePathKey            = getPathKey([]int32{8, 11})\n\tjavaMultipleFilesPathKey    = getPathKey([]int32{8, 10})\n\tjavaOuterClassnamePathKey   = getPathKey([]int32{8, 8})\n\tjavaPackagePathKey          = getPathKey([]int32{8, 1})\n\tjavaStringCheckUtf8PathKey  = getPathKey([]int32{8, 27})\n\tobjcClassPrefixPathKey      = getPathKey([]int32{8, 36})\n\tpackagePathKey              = getPathKey([]int32{2})\n\tphpClassPrefixPathKey       = getPathKey([]int32{8, 40})\n\tphpNamespacePathKey         = getPathKey([]int32{8, 41})\n\tphpMetadataNamespacePathKey = getPathKey([]int32{8, 44})\n\trubyPackagePathKey          = getPathKey([]int32{8, 45})\n\tswiftPrefixPathKey          = getPathKey([]int32{8, 39})\n\toptimizeForPathKey          = getPathKey([]int32{8, 9})\n\tccGenericServicesPathKey    = getPathKey([]int32{8, 16})\n\tjavaGenericServicesPathKey  = getPathKey([]int32{8, 17})\n\tpyGenericServicesPathKey    = getPathKey([]int32{8, 18})\n\tccEnableArenasPathKey       = getPathKey([]int32{8, 31})\n\tsyntaxPathKey               = getPathKey([]int32{12})\n)\n\nfunc getDependencyPath(dependencyIndex int) []int32 {\n\treturn []int32{3, int32(dependencyIndex)}\n}\n\nfunc getMessagePath(topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\tpath := []int32{4, int32(topLevelMessageIndex)}\n\tfor _, nestedMessageIndex := range nestedMessageIndexes {\n\t\tpath = append(path, 3, int32(nestedMessageIndex))\n\t}\n\treturn path\n}\n\nfunc getMessageNamePath(messageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(messageIndex, nestedMessageIndexes...), 1)\n}\n\nfunc getMessageOptionsPath(messageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(messageIndex, nestedMessageIndexes...), 7)\n}\n\nfunc getMessageMessageSetWireFormatPath(messageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(messageIndex, nestedMessageIndexes...), 7, 1)\n}\n\nfunc getMessageNoStandardDescriptorAccessorPath(messageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(messageIndex, nestedMessageIndexes...), 7, 2)\n}\n\nfunc getMessageFieldPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 2, int32(fieldIndex))\n}\n\nfunc getMessageFieldNamePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 1)\n}\n\nfunc getMessageFieldNumberPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 3)\n}\n\nfunc getMessageFieldTypePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 5)\n}\n\nfunc getMessageFieldTypeNamePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 6)\n}\n\nfunc getMessageFieldJSONNamePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 10)\n}\n\nfunc getMessageFieldOptionsPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8)\n}\n\nfunc getMessageFieldJSTypePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 6)\n}\n\nfunc getMessageFieldCTypePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 1)\n}\n\nfunc getMessageFieldPackedPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 2)\n}\n\nfunc getMessageFieldDefaultPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 7)\n}\n\nfunc getMessageFieldExtendeePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 2)\n}\n\nfunc getMessageExtensionPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 6, int32(extensionIndex))\n}\n\nfunc getMessageExtensionNamePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 1)\n}\n\nfunc getMessageExtensionNumberPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 3)\n}\n\nfunc getMessageExtensionTypePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 5)\n}\n\nfunc getMessageExtensionTypeNamePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 6)\n}\n\nfunc getMessageExtensionJSONNamePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 10)\n}\n\nfunc getMessageExtensionOptionsPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8)\n}\n\nfunc getMessageExtensionJSTypePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 6)\n}\n\nfunc getMessageExtensionCTypePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 1)\n}\n\nfunc getMessageExtensionPackedPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 2)\n}\n\nfunc getMessageExtensionDefaultPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 7)\n}\n\nfunc getMessageExtensionExtendeePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 2)\n}\n\nfunc getMessageOneofPath(oneofIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 8, int32(oneofIndex))\n}\n\nfunc getMessageOneofNamePath(oneofIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageOneofPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...), 1)\n}\n\nfunc getMessageOneofOptionsPath(oneofIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessageOneofPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...), 2)\n}\n\nfunc getMessageReservedRangePath(reservedRangeIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 9, int32(reservedRangeIndex))\n}\n\nfunc getMessageReservedNamePath(reservedNameIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 10, int32(reservedNameIndex))\n}\n\nfunc getMessageExtensionRangePath(extensionRangeIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 5, int32(extensionRangeIndex))\n}\n\nfunc getMessageExtensionRangeOptionsPath(extensionRangeIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 5, int32(extensionRangeIndex), 3)\n}\n\nfunc getEnumPath(enumIndex int, nestedMessageIndexes ...int) []int32 {\n\tif len(nestedMessageIndexes) == 0 {\n\t\treturn []int32{5, int32(enumIndex)}\n\t}\n\tpath := []int32{4, int32(nestedMessageIndexes[0])}\n\tfor _, nestedMessageIndex := range nestedMessageIndexes[1:] {\n\t\tpath = append(path, 3, int32(nestedMessageIndex))\n\t}\n\treturn append(path, 4, int32(enumIndex))\n}\n\nfunc getEnumNamePath(enumIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumPath(enumIndex, nestedMessageIndexes...), 1)\n}\n\nfunc getEnumOptionsPath(enumIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumPath(enumIndex, nestedMessageIndexes...), 3)\n}\n\nfunc getEnumAllowAliasPath(enumIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumPath(enumIndex, nestedMessageIndexes...), 3, 2)\n}\n\nfunc getEnumValuePath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumPath(enumIndex, nestedMessageIndexes...), 2, int32(enumValueIndex))\n}\n\nfunc getEnumValueNamePath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...), 1)\n}\n\nfunc getEnumValueNumberPath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...), 2)\n}\n\nfunc getEnumValueOptionsPath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...), 3)\n}\n\nfunc getEnumReservedRangePath(enumIndex int, reservedRangeIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumPath(enumIndex, nestedMessageIndexes...), 4, int32(reservedRangeIndex))\n}\n\nfunc getEnumReservedNamePath(enumIndex int, reservedNameIndex int, nestedMessageIndexes ...int) []int32 {\n\treturn append(getEnumPath(enumIndex, nestedMessageIndexes...), 5, int32(reservedNameIndex))\n}\n\nfunc getServicePath(serviceIndex int) []int32 {\n\treturn []int32{6, int32(serviceIndex)}\n}\n\nfunc getServiceNamePath(serviceIndex int) []int32 {\n\treturn append(getServicePath(serviceIndex), 1)\n}\n\nfunc getServiceOptionsPath(serviceIndex int) []int32 {\n\treturn append(getServicePath(serviceIndex), 3)\n}\n\nfunc getMethodPath(serviceIndex int, methodIndex int) []int32 {\n\treturn []int32{6, int32(serviceIndex), 2, int32(methodIndex)}\n}\n\nfunc getMethodNamePath(serviceIndex int, methodIndex int) []int32 {\n\treturn append(getMethodPath(serviceIndex, methodIndex), 1)\n}\n\nfunc getMethodInputTypePath(serviceIndex int, methodIndex int) []int32 {\n\treturn append(getMethodPath(serviceIndex, methodIndex), 2)\n}\n\nfunc getMethodOutputTypePath(serviceIndex int, methodIndex int) []int32 {\n\treturn append(getMethodPath(serviceIndex, methodIndex), 3)\n}\n\nfunc getMethodOptionsPath(serviceIndex int, methodIndex int) []int32 {\n\treturn append(getMethodPath(serviceIndex, methodIndex), 4)\n}\n\nfunc getMethodIdempotencyLevelPath(serviceIndex int, methodIndex int) []int32 {\n\treturn append(getMethodPath(serviceIndex, methodIndex), 4, 34)\n}\n\nfunc getFileExtensionPath(fieldIndex int) []int32 {\n\treturn []int32{7, int32(fieldIndex)}\n}\n\nfunc getFileExtensionNamePath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 1)\n}\n\nfunc getFileExtensionNumberPath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 3)\n}\n\nfunc getFileExtensionTypePath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 5)\n}\n\nfunc getFileExtensionTypeNamePath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 6)\n}\n\nfunc getFileExtensionJSONNamePath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 10)\n}\n\nfunc getFileExtensionOptionsPath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 8)\n}\n\nfunc getFileExtensionJSTypePath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 8, 6)\n}\n\nfunc getFileExtensionCTypePath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 8, 1)\n}\n\nfunc getFileExtensionPackedPath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 8, 2)\n}\n\nfunc getFileExtensionDefaultPath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 7)\n}\n\nfunc getFileExtensionExtendeePath(fieldIndex int) []int32 {\n\treturn append(getFileExtensionPath(fieldIndex), 2)\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/reserved_name.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport \"fmt\"\n\ntype reservedName struct {\n\tlocationDescriptor\n\n\tvalue string\n}\n\nfunc newReservedName(\n\tlocationDescriptor locationDescriptor,\n\tvalue string,\n) (*reservedName, error) {\n\tif value == \"\" {\n\t\treturn nil, fmt.Errorf(\"no value for reserved name in %q\", locationDescriptor.File().Path())\n\t}\n\treturn &reservedName{\n\t\tlocationDescriptor: locationDescriptor,\n\t\tvalue:              value,\n\t}, nil\n}\n\nfunc (r *reservedName) Value() string {\n\treturn r.value\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/service.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\ntype service struct {\n\tnamedDescriptor\n\toptionExtensionDescriptor\n\n\tmethods    []Method\n\tdeprecated bool\n}\n\nfunc newService(\n\tnamedDescriptor namedDescriptor,\n\toptionExtensionDescriptor optionExtensionDescriptor,\n\tdeprecated bool,\n) *service {\n\treturn &service{\n\t\tnamedDescriptor:           namedDescriptor,\n\t\toptionExtensionDescriptor: optionExtensionDescriptor,\n\t\tdeprecated:                deprecated,\n\t}\n}\n\nfunc (m *service) Methods() []Method {\n\treturn m.methods\n}\n\nfunc (m *service) addMethod(method Method) {\n\tm.methods = append(m.methods, method)\n}\n\nfunc (m *service) Deprecated() bool {\n\treturn m.deprecated\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/tag_range_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufprotosource\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestCheckTagRangeIsSubset(t *testing.T) {\n\tt.Parallel()\n\ttestExpectedSubset(t, \"1\", \"1\", \"\")\n\ttestExpectedSubset(t, \"1-2\", \"1\", \"\")\n\ttestExpectedSubset(t, \"1\", \"1-2\", \"1-2\")\n\ttestExpectedSubset(t, \"5,4,3,2,1\", \"1-5\", \"\")\n\ttestExpectedSubset(t, \"1-5\", \"1,2,4,5,3\", \"\")\n\ttestExpectedSubset(t, \"90-199,200\", \"100-200\", \"\")\n\ttestExpectedSubset(t, \"100-200\", \"90-199,200\", \"90-199\")\n\ttestExpectedSubset(t, \"1-5,200,1000-1001,2000\", \"1-3,5,1001,3000\", \"3000\")\n\ttestExpectedSubset(t, \"1-92,93-95,96-99,100\", \"1-93,3-100,5-200\", \"5-200\")\n\ttestExpectedSubset(t, \"1-92,3-50,5-75,10-90,15-30\", \"1-20,5-10,30-75,91,92,93\", \"93\")\n}\n\nfunc testExpectedSubset(\n\tt *testing.T,\n\tsupersetRangesString string,\n\tsubsetRangesString string,\n\texpectedMissingString string,\n) {\n\tsupersetRanges := stringToTestRanges(supersetRangesString)\n\tsubsetRanges := stringToTestRanges(subsetRangesString)\n\texpectedMissing := stringToTestRanges(expectedMissingString)\n\tisSubset, actualMissing := CheckTagRangeIsSubset(supersetRanges, subsetRanges)\n\n\tif isSubset && len(actualMissing) > 0 {\n\t\tt.Error(\"Subset flag should be cleared when missing ranges are found\")\n\t} else if !isSubset && len(actualMissing) == 0 {\n\t\tt.Error(\"Subset flag should be set when missing ranges aren't found\")\n\t}\n\n\tassert.Equal(t, len(expectedMissing), len(actualMissing), fmt.Sprint(actualMissing))\n\tif len(expectedMissing) == len(actualMissing) {\n\t\tfor i := range actualMissing {\n\t\t\tassert.Equal(t, expectedMissing[i], actualMissing[i])\n\t\t}\n\t}\n}\n\n// Parses a string like 5-10,12 into test ranges.\nfunc stringToTestRanges(rangesString string) []TagRange {\n\tresults := []TagRange{}\n\tif rangesString == \"\" {\n\t\treturn results\n\t}\n\trangeStrings := strings.SplitSeq(rangesString, \",\")\n\tfor rangeString := range rangeStrings {\n\t\tbeginString, endString, hasEnd := strings.Cut(rangeString, \"-\")\n\t\tif !hasEnd {\n\t\t\tendString = beginString\n\t\t}\n\t\tbegin, err := strconv.Atoi(beginString)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tend, err := strconv.Atoi(endString)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tresults = append(results, testTagRange{begin, end})\n\t}\n\treturn results\n}\n\n// Implementation of TagRange for testing.\ntype testTagRange struct {\n\tstart, end int\n}\n\nfunc (testTagRange) File() File { return nil }\n\nfunc (testTagRange) Location() Location { return nil }\n\nfunc (r testTagRange) Start() int { return r.start }\n\nfunc (r testTagRange) End() int { return r.end }\n\nfunc (testTagRange) Max() bool { return false }\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/testdata/nested/foo.proto",
    "content": "syntax = \"proto3\";\n\nmessage A {\n  message B {\n    message C {\n      message D {\n        message E {\n          message F {\n            message Message10 {\n              message Message11 {}\n            }\n            message Message20 {\n              message Message21 {}\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "private/bufpkg/bufprotosource/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufprotosource\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufreflect/bufreflect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufreflect\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufimage\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\n// NewMessage returns a new dynamic proto.Message for the fully qualified typeName\n// in the bufimage.Image.\nfunc NewMessage(\n\tctx context.Context,\n\timage bufimage.Image,\n\ttypeName string,\n) (proto.Message, error) {\n\tif err := ValidateTypeName(typeName); err != nil {\n\t\treturn nil, err\n\t}\n\tmessageType, err := image.Resolver().FindMessageByName(protoreflect.FullName(typeName))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn messageType.New().Interface(), nil\n}\n\n// ValidateTypeName validates that the typeName is well-formed, such that it has one or more\n// '.'-delimited package components and no '/' elements.\nfunc ValidateTypeName(typeName string) error {\n\tif fullName := protoreflect.FullName(typeName); !fullName.IsValid() {\n\t\treturn fmt.Errorf(\"%q is not a valid fully qualified type name\", fullName)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufreflect/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufreflect\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapimodule/bufregistryapimodule.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufregistryapimodule\n\nimport (\n\t\"buf.build/gen/go/bufbuild/registry/connectrpc/go/buf/registry/module/v1/modulev1connect\"\n\t\"buf.build/gen/go/bufbuild/registry/connectrpc/go/buf/registry/module/v1beta1/modulev1beta1connect\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n)\n\nvar (\n\t// NopV1CommitServiceClientProvider is a V1CommitServiceClientProvider that provides unimplemented services for testing.\n\tNopV1CommitServiceClientProvider V1CommitServiceClientProvider = nopClientProvider{}\n\t// NopV1DownloadServiceClientProvider is a V1DownloadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1DownloadServiceClientProvider V1DownloadServiceClientProvider = nopClientProvider{}\n\t// NopV1GraphServiceClientProvider is a V1GraphServiceClientProvider that provides unimplemented services for testing.\n\tNopV1GraphServiceClientProvider V1GraphServiceClientProvider = nopClientProvider{}\n\t// NopV1LabelServiceClientProvider is a V1LabelServiceClientProvider that provides unimplemented services for testing.\n\tNopV1LabelServiceClientProvider V1LabelServiceClientProvider = nopClientProvider{}\n\t// NopV1ModuleServiceClientProvider is a V1ModuleServiceClientProvider that provides unimplemented services for testing.\n\tNopV1ModuleServiceClientProvider V1ModuleServiceClientProvider = nopClientProvider{}\n\t// NopV1UploadServiceClientProvider is a V1UploadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1UploadServiceClientProvider V1UploadServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1CommitServiceClientProvider is a V1Beta1CommitServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1CommitServiceClientProvider V1Beta1CommitServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1DownloadServiceClientProvider is a V1Beta1DownloadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1DownloadServiceClientProvider V1Beta1DownloadServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1GraphServiceClientProvider is a V1Beta1GraphServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1GraphServiceClientProvider V1Beta1GraphServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1LabelServiceClientProvider is a V1Beta1LabelServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1LabelServiceClientProvider V1Beta1LabelServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1ModuleServiceClientProvider is a V1Beta1ModuleServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1ModuleServiceClientProvider V1Beta1ModuleServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1UploadServiceClientProvider is a V1Beta1UploadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1UploadServiceClientProvider V1Beta1UploadServiceClientProvider = nopClientProvider{}\n\t// NopClientProvider is a ClientProvider that provides unimplemented services for testing.\n\tNopClientProvider ClientProvider = nopClientProvider{}\n)\n\n// V1CommitServiceClientProvider provides CommitServiceClients.\ntype V1CommitServiceClientProvider interface {\n\tV1CommitServiceClient(registry string) modulev1connect.CommitServiceClient\n}\n\n// V1DownloadServiceClientProvider provides DownloadServiceClients.\ntype V1DownloadServiceClientProvider interface {\n\tV1DownloadServiceClient(registry string) modulev1connect.DownloadServiceClient\n}\n\n// V1GraphServiceClientProvider provides GraphServiceClients.\ntype V1GraphServiceClientProvider interface {\n\tV1GraphServiceClient(registry string) modulev1connect.GraphServiceClient\n}\n\n// V1LabelServiceClientProvider provides LabelServiceClients.\ntype V1LabelServiceClientProvider interface {\n\tV1LabelServiceClient(registry string) modulev1connect.LabelServiceClient\n}\n\n// V1ModuleServiceClientProvider provides ModuleServiceClients.\ntype V1ModuleServiceClientProvider interface {\n\tV1ModuleServiceClient(registry string) modulev1connect.ModuleServiceClient\n}\n\n// V1ResourceServiceClientProvider provides ResourceServiceClients.\ntype V1ResourceServiceClientProvider interface {\n\tV1ResourceServiceClient(registry string) modulev1connect.ResourceServiceClient\n}\n\n// V1UploadServiceClientProvider provides UploadServiceClients.\ntype V1UploadServiceClientProvider interface {\n\tV1UploadServiceClient(registry string) modulev1connect.UploadServiceClient\n}\n\n// V1Beta1CommitServiceClientProvider provides CommitServiceClients.\ntype V1Beta1CommitServiceClientProvider interface {\n\tV1Beta1CommitServiceClient(registry string) modulev1beta1connect.CommitServiceClient\n}\n\n// V1Beta1DownloadServiceClientProvider provides DownloadServiceClients.\ntype V1Beta1DownloadServiceClientProvider interface {\n\tV1Beta1DownloadServiceClient(registry string) modulev1beta1connect.DownloadServiceClient\n}\n\n// V1Beta1GraphServiceClientProvider provides GraphServiceClients.\ntype V1Beta1GraphServiceClientProvider interface {\n\tV1Beta1GraphServiceClient(registry string) modulev1beta1connect.GraphServiceClient\n}\n\n// V1Beta1LabelServiceClientProvider provides LabelServiceClients.\ntype V1Beta1LabelServiceClientProvider interface {\n\tV1Beta1LabelServiceClient(registry string) modulev1beta1connect.LabelServiceClient\n}\n\n// V1Beta1ModuleServiceClientProvider provides ModuleServiceClients.\ntype V1Beta1ModuleServiceClientProvider interface {\n\tV1Beta1ModuleServiceClient(registry string) modulev1beta1connect.ModuleServiceClient\n}\n\n// V1Beta1UploadServiceClientProvider provides UploadServiceClients.\ntype V1Beta1UploadServiceClientProvider interface {\n\tV1Beta1UploadServiceClient(registry string) modulev1beta1connect.UploadServiceClient\n}\n\n// ClientProvider provides API clients for BSR services.\ntype ClientProvider interface {\n\tV1CommitServiceClientProvider\n\tV1DownloadServiceClientProvider\n\tV1GraphServiceClientProvider\n\tV1LabelServiceClientProvider\n\tV1ModuleServiceClientProvider\n\tV1ResourceServiceClientProvider\n\tV1UploadServiceClientProvider\n\tV1Beta1CommitServiceClientProvider\n\tV1Beta1DownloadServiceClientProvider\n\tV1Beta1GraphServiceClientProvider\n\tV1Beta1LabelServiceClientProvider\n\tV1Beta1ModuleServiceClientProvider\n\tV1Beta1UploadServiceClientProvider\n}\n\n// NewClientProvider returns a new ClientProvider.\nfunc NewClientProvider(clientConfig *connectclient.Config) ClientProvider {\n\treturn newClientProvider(clientConfig)\n}\n\n// *** PRIVATE ***\n\ntype clientProvider struct {\n\tclientConfig *connectclient.Config\n}\n\nfunc newClientProvider(clientConfig *connectclient.Config) *clientProvider {\n\treturn &clientProvider{\n\t\tclientConfig: clientConfig,\n\t}\n}\n\nfunc (c *clientProvider) V1CommitServiceClient(registry string) modulev1connect.CommitServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1connect.NewCommitServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1DownloadServiceClient(registry string) modulev1connect.DownloadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1connect.NewDownloadServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1GraphServiceClient(registry string) modulev1connect.GraphServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1connect.NewGraphServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1LabelServiceClient(registry string) modulev1connect.LabelServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1connect.NewLabelServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1ModuleServiceClient(registry string) modulev1connect.ModuleServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1connect.NewModuleServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1ResourceServiceClient(registry string) modulev1connect.ResourceServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1connect.NewResourceServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1UploadServiceClient(registry string) modulev1connect.UploadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1connect.NewUploadServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1CommitServiceClient(registry string) modulev1beta1connect.CommitServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1beta1connect.NewCommitServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1DownloadServiceClient(registry string) modulev1beta1connect.DownloadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1beta1connect.NewDownloadServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1GraphServiceClient(registry string) modulev1beta1connect.GraphServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1beta1connect.NewGraphServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1LabelServiceClient(registry string) modulev1beta1connect.LabelServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1beta1connect.NewLabelServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1ModuleServiceClient(registry string) modulev1beta1connect.ModuleServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1beta1connect.NewModuleServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1UploadServiceClient(registry string) modulev1beta1connect.UploadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tmodulev1beta1connect.NewUploadServiceClient,\n\t)\n}\n\ntype nopClientProvider struct{}\n\nfunc (nopClientProvider) V1CommitServiceClient(registry string) modulev1connect.CommitServiceClient {\n\treturn modulev1connect.UnimplementedCommitServiceHandler{}\n}\n\nfunc (nopClientProvider) V1DownloadServiceClient(registry string) modulev1connect.DownloadServiceClient {\n\treturn modulev1connect.UnimplementedDownloadServiceHandler{}\n}\n\nfunc (nopClientProvider) V1GraphServiceClient(registry string) modulev1connect.GraphServiceClient {\n\treturn modulev1connect.UnimplementedGraphServiceHandler{}\n}\n\nfunc (nopClientProvider) V1LabelServiceClient(registry string) modulev1connect.LabelServiceClient {\n\treturn modulev1connect.UnimplementedLabelServiceHandler{}\n}\n\nfunc (nopClientProvider) V1ModuleServiceClient(registry string) modulev1connect.ModuleServiceClient {\n\treturn modulev1connect.UnimplementedModuleServiceHandler{}\n}\n\nfunc (nopClientProvider) V1ResourceServiceClient(registry string) modulev1connect.ResourceServiceClient {\n\treturn modulev1connect.UnimplementedResourceServiceHandler{}\n}\n\nfunc (nopClientProvider) V1UploadServiceClient(registry string) modulev1connect.UploadServiceClient {\n\treturn modulev1connect.UnimplementedUploadServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1CommitServiceClient(registry string) modulev1beta1connect.CommitServiceClient {\n\treturn modulev1beta1connect.UnimplementedCommitServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1DownloadServiceClient(registry string) modulev1beta1connect.DownloadServiceClient {\n\treturn modulev1beta1connect.UnimplementedDownloadServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1GraphServiceClient(registry string) modulev1beta1connect.GraphServiceClient {\n\treturn modulev1beta1connect.UnimplementedGraphServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1LabelServiceClient(registry string) modulev1beta1connect.LabelServiceClient {\n\treturn modulev1beta1connect.UnimplementedLabelServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1ModuleServiceClient(registry string) modulev1beta1connect.ModuleServiceClient {\n\treturn modulev1beta1connect.UnimplementedModuleServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1UploadServiceClient(registry string) modulev1beta1connect.UploadServiceClient {\n\treturn modulev1beta1connect.UnimplementedUploadServiceHandler{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapimodule/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufregistryapimodule\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapiowner/bufregistryapiowner.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufregistryapiowner\n\nimport (\n\t\"buf.build/gen/go/bufbuild/registry/connectrpc/go/buf/registry/owner/v1/ownerv1connect\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n)\n\nvar (\n\t// NopV1OrganizationServiceClientProvider is a V1OrganizationServiceClientProvider that provides unimplemented services for testing.\n\tNopV1OrganizationServiceClientProvider V1OrganizationServiceClientProvider = nopClientProvider{}\n\t// NopV1OwnerServiceClientProvider is a V1OwnerServiceClientProvider that provides unimplemented services for testing.\n\tNopV1OwnerServiceClientProvider V1OwnerServiceClientProvider = nopClientProvider{}\n\t// NopV1UserServiceClientProvider is a V1UserServiceClientProvider that provides unimplemented services for testing.\n\tNopV1UserServiceClientProvider V1UserServiceClientProvider = nopClientProvider{}\n\t// NopClientProvider is a ClientProvider that provides unimplemented services for testing.\n\tNopClientProvider ClientProvider = nopClientProvider{}\n)\n\n// V1OrganizationServiceClientProvider provides OrganizationServiceClients.\ntype V1OrganizationServiceClientProvider interface {\n\tV1OrganizationServiceClient(registry string) ownerv1connect.OrganizationServiceClient\n}\n\n// V1OwnerServiceClientProvider provides OwnerServiceClients.\ntype V1OwnerServiceClientProvider interface {\n\tV1OwnerServiceClient(registry string) ownerv1connect.OwnerServiceClient\n}\n\n// V1UserServiceClientProvider provides UserServiceClients.\ntype V1UserServiceClientProvider interface {\n\tV1UserServiceClient(registry string) ownerv1connect.UserServiceClient\n}\n\n// ClientProvider provides API clients for BSR services.\ntype ClientProvider interface {\n\tV1OrganizationServiceClientProvider\n\tV1OwnerServiceClientProvider\n\tV1UserServiceClientProvider\n}\n\n// NewClientProvider returns a new ClientProvider.\nfunc NewClientProvider(clientConfig *connectclient.Config) ClientProvider {\n\treturn newClientProvider(clientConfig)\n}\n\n// *** PRIVATE ***\n\ntype clientProvider struct {\n\tclientConfig *connectclient.Config\n}\n\nfunc newClientProvider(clientConfig *connectclient.Config) *clientProvider {\n\treturn &clientProvider{\n\t\tclientConfig: clientConfig,\n\t}\n}\n\nfunc (c *clientProvider) V1OrganizationServiceClient(registry string) ownerv1connect.OrganizationServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\townerv1connect.NewOrganizationServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1OwnerServiceClient(registry string) ownerv1connect.OwnerServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\townerv1connect.NewOwnerServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1UserServiceClient(registry string) ownerv1connect.UserServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\townerv1connect.NewUserServiceClient,\n\t)\n}\n\ntype nopClientProvider struct{}\n\nfunc (nopClientProvider) V1OrganizationServiceClient(registry string) ownerv1connect.OrganizationServiceClient {\n\treturn ownerv1connect.UnimplementedOrganizationServiceHandler{}\n}\n\nfunc (nopClientProvider) V1OwnerServiceClient(registry string) ownerv1connect.OwnerServiceClient {\n\treturn ownerv1connect.UnimplementedOwnerServiceHandler{}\n}\n\nfunc (nopClientProvider) V1UserServiceClient(registry string) ownerv1connect.UserServiceClient {\n\treturn ownerv1connect.UnimplementedUserServiceHandler{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapiowner/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufregistryapiowner\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapiplugin/bufregistryapiplugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufregistryapiplugin\n\nimport (\n\t\"buf.build/gen/go/bufbuild/registry/connectrpc/go/buf/registry/plugin/v1beta1/pluginv1beta1connect\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n)\n\nvar (\n\t// NopV1Beta1CollectionServiceClientProvider is a V1Beta1CollectionServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1CollectionServiceClientProvider V1Beta1CollectionServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1CommitServiceClientProvider is a V1Beta1CommitServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1CommitServiceClientProvider V1Beta1CommitServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1DownloadServiceClientProvider is a V1Beta1DownloadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1DownloadServiceClientProvider V1Beta1DownloadServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1LabelServiceClientProvider is a V1Beta1LabelServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1LabelServiceClientProvider V1Beta1LabelServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1PluginServiceClientProvider is a V1Beta1PluginServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1PluginServiceClientProvider V1Beta1PluginServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1ResourceServiceClientProvider is a V1Beta1ResourceServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1ResourceServiceClientProvider V1Beta1ResourceServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1UploadServiceClientProvider is a V1Beta1UploadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1UploadServiceClientProvider V1Beta1UploadServiceClientProvider = nopClientProvider{}\n\t// NopClientProvider is a ClientProvider that provides unimplemented services for testing.\n\tNopClientProvider ClientProvider = nopClientProvider{}\n)\n\n// V1Beta1CollectionServiceClientProvider provides CollectionServiceClients.\ntype V1Beta1CollectionServiceClientProvider interface {\n\tV1Beta1CollectionServiceClient(registry string) pluginv1beta1connect.CollectionServiceClient\n}\n\n// V1Beta1CommitServiceClientProvider provides CommitServiceClients.\ntype V1Beta1CommitServiceClientProvider interface {\n\tV1Beta1CommitServiceClient(registry string) pluginv1beta1connect.CommitServiceClient\n}\n\n// V1Beta1DownloadServiceClientProvider provides DownloadServiceClients.\ntype V1Beta1DownloadServiceClientProvider interface {\n\tV1Beta1DownloadServiceClient(registry string) pluginv1beta1connect.DownloadServiceClient\n}\n\n// V1Beta1LabelServiceClientProvider provides LabelServiceClients.\ntype V1Beta1LabelServiceClientProvider interface {\n\tV1Beta1LabelServiceClient(registry string) pluginv1beta1connect.LabelServiceClient\n}\n\n// V1Beta1ResourceServiceClientProvider provides ResourceServiceClients.\ntype V1Beta1ResourceServiceClientProvider interface {\n\tV1Beta1ResourceServiceClient(registry string) pluginv1beta1connect.ResourceServiceClient\n}\n\n// V1Beta1PluginServiceClientProvider provides PluginServiceClients.\ntype V1Beta1PluginServiceClientProvider interface {\n\tV1Beta1PluginServiceClient(registry string) pluginv1beta1connect.PluginServiceClient\n}\n\n// V1Beta1UploadServiceClientProvider provides UploadServiceClients.\ntype V1Beta1UploadServiceClientProvider interface {\n\tV1Beta1UploadServiceClient(registry string) pluginv1beta1connect.UploadServiceClient\n}\n\n// ClientProvider provides API clients for BSR services.\ntype ClientProvider interface {\n\tV1Beta1CollectionServiceClientProvider\n\tV1Beta1CommitServiceClientProvider\n\tV1Beta1DownloadServiceClientProvider\n\tV1Beta1LabelServiceClientProvider\n\tV1Beta1ResourceServiceClientProvider\n\tV1Beta1PluginServiceClientProvider\n\tV1Beta1UploadServiceClientProvider\n}\n\n// NewClientProvider returns a new ClientProvider.\nfunc NewClientProvider(clientConfig *connectclient.Config) ClientProvider {\n\treturn newClientProvider(clientConfig)\n}\n\n// *** PRIVATE ***\n\ntype clientProvider struct {\n\tclientConfig *connectclient.Config\n}\n\nfunc newClientProvider(clientConfig *connectclient.Config) *clientProvider {\n\treturn &clientProvider{\n\t\tclientConfig: clientConfig,\n\t}\n}\n\nfunc (c *clientProvider) V1Beta1CollectionServiceClient(registry string) pluginv1beta1connect.CollectionServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpluginv1beta1connect.NewCollectionServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1CommitServiceClient(registry string) pluginv1beta1connect.CommitServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpluginv1beta1connect.NewCommitServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1DownloadServiceClient(registry string) pluginv1beta1connect.DownloadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpluginv1beta1connect.NewDownloadServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1LabelServiceClient(registry string) pluginv1beta1connect.LabelServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpluginv1beta1connect.NewLabelServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1ResourceServiceClient(registry string) pluginv1beta1connect.ResourceServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpluginv1beta1connect.NewResourceServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1PluginServiceClient(registry string) pluginv1beta1connect.PluginServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpluginv1beta1connect.NewPluginServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1UploadServiceClient(registry string) pluginv1beta1connect.UploadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpluginv1beta1connect.NewUploadServiceClient,\n\t)\n}\n\ntype nopClientProvider struct{}\n\nfunc (nopClientProvider) V1Beta1CollectionServiceClient(registry string) pluginv1beta1connect.CollectionServiceClient {\n\treturn pluginv1beta1connect.UnimplementedCollectionServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1CommitServiceClient(registry string) pluginv1beta1connect.CommitServiceClient {\n\treturn pluginv1beta1connect.UnimplementedCommitServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1DownloadServiceClient(registry string) pluginv1beta1connect.DownloadServiceClient {\n\treturn pluginv1beta1connect.UnimplementedDownloadServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1LabelServiceClient(registry string) pluginv1beta1connect.LabelServiceClient {\n\treturn pluginv1beta1connect.UnimplementedLabelServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1ResourceServiceClient(registry string) pluginv1beta1connect.ResourceServiceClient {\n\treturn pluginv1beta1connect.UnimplementedResourceServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1PluginServiceClient(registry string) pluginv1beta1connect.PluginServiceClient {\n\treturn pluginv1beta1connect.UnimplementedPluginServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1UploadServiceClient(registry string) pluginv1beta1connect.UploadServiceClient {\n\treturn pluginv1beta1connect.UnimplementedUploadServiceHandler{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapiplugin/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufregistryapiplugin\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapipolicy/bufregistryapipolicy.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufregistryapipolicy\n\nimport (\n\t\"buf.build/gen/go/bufbuild/registry/connectrpc/go/buf/registry/policy/v1beta1/policyv1beta1connect\"\n\t\"github.com/bufbuild/buf/private/pkg/connectclient\"\n)\n\nvar (\n\t// NopV1Beta1CommitServiceClientProvider is a V1Beta1CommitServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1CommitServiceClientProvider V1Beta1CommitServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1DownloadServiceClientProvider is a V1Beta1DownloadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1DownloadServiceClientProvider V1Beta1DownloadServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1LabelServiceClientProvider is a V1Beta1LabelServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1LabelServiceClientProvider V1Beta1LabelServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1PolicyServiceClientProvider is a V1Beta1PolicyServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1PolicyServiceClientProvider V1Beta1PolicyServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1ResourceServiceClientProvider is a V1Beta1ResourceServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1ResourceServiceClientProvider V1Beta1ResourceServiceClientProvider = nopClientProvider{}\n\t// NopV1Beta1UploadServiceClientProvider is a V1Beta1UploadServiceClientProvider that provides unimplemented services for testing.\n\tNopV1Beta1UploadServiceClientProvider V1Beta1UploadServiceClientProvider = nopClientProvider{}\n\t// NopClientProvider is a ClientProvider that provides unimplemented services for testing.\n\tNopClientProvider ClientProvider = nopClientProvider{}\n)\n\n// V1Beta1CommitServiceClientProvider provides CommitServiceClients.\ntype V1Beta1CommitServiceClientProvider interface {\n\tV1Beta1CommitServiceClient(registry string) policyv1beta1connect.CommitServiceClient\n}\n\n// V1Beta1DownloadServiceClientProvider provides DownloadServiceClients.\ntype V1Beta1DownloadServiceClientProvider interface {\n\tV1Beta1DownloadServiceClient(registry string) policyv1beta1connect.DownloadServiceClient\n}\n\n// V1Beta1LabelServiceClientProvider provides LabelServiceClients.\ntype V1Beta1LabelServiceClientProvider interface {\n\tV1Beta1LabelServiceClient(registry string) policyv1beta1connect.LabelServiceClient\n}\n\n// V1Beta1ResourceServiceClientProvider provides ResourceServiceClients.\ntype V1Beta1ResourceServiceClientProvider interface {\n\tV1Beta1ResourceServiceClient(registry string) policyv1beta1connect.ResourceServiceClient\n}\n\n// V1Beta1PolicyServiceClientProvider provides PolicyServiceClients.\ntype V1Beta1PolicyServiceClientProvider interface {\n\tV1Beta1PolicyServiceClient(registry string) policyv1beta1connect.PolicyServiceClient\n}\n\n// V1Beta1UploadServiceClientProvider provides UploadServiceClients.\ntype V1Beta1UploadServiceClientProvider interface {\n\tV1Beta1UploadServiceClient(registry string) policyv1beta1connect.UploadServiceClient\n}\n\n// ClientProvider provides API clients for BSR services.\ntype ClientProvider interface {\n\tV1Beta1CommitServiceClientProvider\n\tV1Beta1DownloadServiceClientProvider\n\tV1Beta1LabelServiceClientProvider\n\tV1Beta1ResourceServiceClientProvider\n\tV1Beta1PolicyServiceClientProvider\n\tV1Beta1UploadServiceClientProvider\n}\n\n// NewClientProvider returns a new ClientProvider.\nfunc NewClientProvider(clientConfig *connectclient.Config) ClientProvider {\n\treturn newClientProvider(clientConfig)\n}\n\n// *** PRIVATE ***\n\ntype clientProvider struct {\n\tclientConfig *connectclient.Config\n}\n\nfunc newClientProvider(clientConfig *connectclient.Config) *clientProvider {\n\treturn &clientProvider{\n\t\tclientConfig: clientConfig,\n\t}\n}\n\nfunc (c *clientProvider) V1Beta1CommitServiceClient(registry string) policyv1beta1connect.CommitServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpolicyv1beta1connect.NewCommitServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1DownloadServiceClient(registry string) policyv1beta1connect.DownloadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpolicyv1beta1connect.NewDownloadServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1LabelServiceClient(registry string) policyv1beta1connect.LabelServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpolicyv1beta1connect.NewLabelServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1ResourceServiceClient(registry string) policyv1beta1connect.ResourceServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpolicyv1beta1connect.NewResourceServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1PolicyServiceClient(registry string) policyv1beta1connect.PolicyServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpolicyv1beta1connect.NewPolicyServiceClient,\n\t)\n}\n\nfunc (c *clientProvider) V1Beta1UploadServiceClient(registry string) policyv1beta1connect.UploadServiceClient {\n\treturn connectclient.Make(\n\t\tc.clientConfig,\n\t\tregistry,\n\t\tpolicyv1beta1connect.NewUploadServiceClient,\n\t)\n}\n\ntype nopClientProvider struct{}\n\nfunc (nopClientProvider) V1Beta1CommitServiceClient(registry string) policyv1beta1connect.CommitServiceClient {\n\treturn policyv1beta1connect.UnimplementedCommitServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1DownloadServiceClient(registry string) policyv1beta1connect.DownloadServiceClient {\n\treturn policyv1beta1connect.UnimplementedDownloadServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1LabelServiceClient(registry string) policyv1beta1connect.LabelServiceClient {\n\treturn policyv1beta1connect.UnimplementedLabelServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1ResourceServiceClient(registry string) policyv1beta1connect.ResourceServiceClient {\n\treturn policyv1beta1connect.UnimplementedResourceServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1PolicyServiceClient(registry string) policyv1beta1connect.PolicyServiceClient {\n\treturn policyv1beta1connect.UnimplementedPolicyServiceHandler{}\n}\n\nfunc (nopClientProvider) V1Beta1UploadServiceClient(registry string) policyv1beta1connect.UploadServiceClient {\n\treturn policyv1beta1connect.UnimplementedUploadServiceHandler{}\n}\n"
  },
  {
    "path": "private/bufpkg/bufregistryapi/bufregistryapipolicy/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufregistryapipolicy\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugin\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\n// Plugin represents a plugin defined by a buf.plugin.yaml.\ntype Plugin interface {\n\t// Version is the version of the plugin's implementation\n\t// (e.g. the protoc-gen-connect-go implementation is v0.2.0).\n\tVersion() string\n\t// SourceURL is an optional attribute used to specify where the source\n\t// for the plugin can be found.\n\tSourceURL() string\n\t// Description is an optional attribute to provide a more detailed\n\t// description for the plugin.\n\tDescription() string\n\t// Dependencies are the dependencies this plugin has on other plugins.\n\t//\n\t// An example of a dependency might be a 'protoc-gen-go-grpc' plugin\n\t// which depends on the 'protoc-gen-go' generated code.\n\tDependencies() []bufremotepluginref.PluginReference\n\t// Registry is the registry configuration, which lets the user specify\n\t// registry dependencies, and other metadata that applies to a specific\n\t// remote generation registry (e.g. the Go module proxy, NPM registry,\n\t// etc).\n\tRegistry() *bufremotepluginconfig.RegistryConfig\n\t// ContainerImageDigest returns the plugin's source image digest.\n\t//\n\t// For now, we only support docker image sources, but this\n\t// might evolve to support others later on.\n\tContainerImageDigest() string\n}\n\n// NewPlugin creates a new plugin from the given configuration and image digest.\nfunc NewPlugin(\n\tversion string,\n\tdependencies []bufremotepluginref.PluginReference,\n\tregistryConfig *bufremotepluginconfig.RegistryConfig,\n\timageDigest string,\n\tsourceURL string,\n\tdescription string,\n) (Plugin, error) {\n\treturn newPlugin(version, dependencies, registryConfig, imageDigest, sourceURL, description)\n}\n\n// PluginToProtoPluginRegistryType determines the appropriate registryv1alpha1.PluginRegistryType for the plugin.\nfunc PluginToProtoPluginRegistryType(plugin Plugin) registryv1alpha1.PluginRegistryType {\n\tregistryType := registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED\n\tif registry := plugin.Registry(); registry != nil {\n\t\tswitch {\n\t\tcase registry.Go != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_GO\n\t\tcase registry.NPM != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_NPM\n\t\tcase registry.Maven != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_MAVEN\n\t\tcase registry.Swift != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_SWIFT\n\t\tcase registry.Python != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_PYTHON\n\t\tcase registry.Cargo != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_CARGO\n\t\tcase registry.Nuget != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_NUGET\n\t\tcase registry.Cmake != nil:\n\t\t\tregistryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_CMAKE\n\t\t}\n\t}\n\treturn registryType\n}\n\n// OutputLanguagesToProtoLanguages determines the appropriate registryv1alpha1.PluginRegistryType for the plugin.\nfunc OutputLanguagesToProtoLanguages(languages []string) ([]registryv1alpha1.PluginLanguage, error) {\n\tlanguageToEnum := make(map[string]registryv1alpha1.PluginLanguage)\n\tvar supportedLanguages []string\n\tfor pluginLanguageKey, pluginLanguage := range registryv1alpha1.PluginLanguage_value {\n\t\tif pluginLanguage == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tpluginLanguageKey := strings.TrimPrefix(pluginLanguageKey, \"PLUGIN_LANGUAGE_\")\n\t\tpluginLanguageKey = strings.ToLower(pluginLanguageKey)\n\t\t// Example:\n\t\t// { go: 1, javascript: 2 }\n\t\tlanguageToEnum[pluginLanguageKey] = registryv1alpha1.PluginLanguage(pluginLanguage)\n\t\tsupportedLanguages = append(supportedLanguages, pluginLanguageKey)\n\t}\n\tsort.Strings(supportedLanguages)\n\tvar protoLanguages []registryv1alpha1.PluginLanguage\n\tfor _, language := range languages {\n\t\tif pluginLanguage, ok := languageToEnum[language]; ok {\n\t\t\tprotoLanguages = append(protoLanguages, pluginLanguage)\n\t\t\tcontinue\n\t\t}\n\t\treturn nil, fmt.Errorf(\"invalid plugin output language: %q\\nsupported languages: %s\", language, strings.Join(supportedLanguages, \", \"))\n\t}\n\tslices.Sort(protoLanguages)\n\treturn protoLanguages, nil\n}\n\n// PluginRegistryToProtoRegistryConfig converts a bufremotepluginconfig.RegistryConfig to a registryv1alpha1.RegistryConfig.\nfunc PluginRegistryToProtoRegistryConfig(pluginRegistry *bufremotepluginconfig.RegistryConfig) (*registryv1alpha1.RegistryConfig, error) {\n\tif pluginRegistry == nil {\n\t\treturn nil, nil\n\t}\n\tregistryConfig := registryv1alpha1.RegistryConfig_builder{\n\t\tOptions: bufremotepluginconfig.PluginOptionsToOptionsSlice(pluginRegistry.Options),\n\t}.Build()\n\tswitch {\n\tcase pluginRegistry.Go != nil:\n\t\tgoConfig := &registryv1alpha1.GoConfig{}\n\t\tgoConfig.SetMinimumVersion(pluginRegistry.Go.MinVersion)\n\t\tif pluginRegistry.Go.BasePlugin != nil {\n\t\t\tgoConfig.SetBasePlugin(pluginRegistry.Go.BasePlugin.IdentityString())\n\t\t}\n\t\tif pluginRegistry.Go.Deps != nil {\n\t\t\tgoConfig.SetRuntimeLibraries(make([]*registryv1alpha1.GoConfig_RuntimeLibrary, 0, len(pluginRegistry.Go.Deps)))\n\t\t\tfor _, dependency := range pluginRegistry.Go.Deps {\n\t\t\t\tgoConfig.SetRuntimeLibraries(append(goConfig.GetRuntimeLibraries(), goRuntimeDependencyToProtoGoRuntimeLibrary(dependency)))\n\t\t\t}\n\t\t}\n\t\tregistryConfig.SetGoConfig(proto.ValueOrDefault(goConfig))\n\tcase pluginRegistry.NPM != nil:\n\t\timportStyle, err := npmImportStyleToNPMProtoImportStyle(pluginRegistry.NPM.ImportStyle)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnpmConfig := registryv1alpha1.NPMConfig_builder{\n\t\t\tRewriteImportPathSuffix: pluginRegistry.NPM.RewriteImportPathSuffix,\n\t\t\tImportStyle:             importStyle,\n\t\t}.Build()\n\t\tif pluginRegistry.NPM.Deps != nil {\n\t\t\tnpmConfig.SetRuntimeLibraries(make([]*registryv1alpha1.NPMConfig_RuntimeLibrary, 0, len(pluginRegistry.NPM.Deps)))\n\t\t\tfor _, dependency := range pluginRegistry.NPM.Deps {\n\t\t\t\tnpmConfig.SetRuntimeLibraries(append(npmConfig.GetRuntimeLibraries(), npmRuntimeDependencyToProtoNPMRuntimeLibrary(dependency)))\n\t\t\t}\n\t\t}\n\t\tregistryConfig.SetNpmConfig(proto.ValueOrDefault(npmConfig))\n\tcase pluginRegistry.Maven != nil:\n\t\tmavenConfig := &registryv1alpha1.MavenConfig{}\n\t\tvar javaCompilerConfig *registryv1alpha1.MavenConfig_CompilerJavaConfig\n\t\tif compiler := pluginRegistry.Maven.Compiler.Java; compiler != (bufremotepluginconfig.MavenCompilerJavaConfig{}) {\n\t\t\tjavaCompilerConfig = registryv1alpha1.MavenConfig_CompilerJavaConfig_builder{\n\t\t\t\tEncoding: compiler.Encoding,\n\t\t\t\tRelease:  int32(compiler.Release),\n\t\t\t\tSource:   int32(compiler.Source),\n\t\t\t\tTarget:   int32(compiler.Target),\n\t\t\t}.Build()\n\t\t}\n\t\tvar kotlinCompilerConfig *registryv1alpha1.MavenConfig_CompilerKotlinConfig\n\t\tif compiler := pluginRegistry.Maven.Compiler.Kotlin; compiler != (bufremotepluginconfig.MavenCompilerKotlinConfig{}) {\n\t\t\tkotlinCompilerConfig = registryv1alpha1.MavenConfig_CompilerKotlinConfig_builder{\n\t\t\t\tVersion:         compiler.Version,\n\t\t\t\tApiVersion:      compiler.APIVersion,\n\t\t\t\tJvmTarget:       compiler.JVMTarget,\n\t\t\t\tLanguageVersion: compiler.LanguageVersion,\n\t\t\t}.Build()\n\t\t}\n\t\tif javaCompilerConfig != nil || kotlinCompilerConfig != nil {\n\t\t\tmavenConfig.SetCompiler(registryv1alpha1.MavenConfig_CompilerConfig_builder{\n\t\t\t\tJava:   javaCompilerConfig,\n\t\t\t\tKotlin: kotlinCompilerConfig,\n\t\t\t}.Build())\n\t\t}\n\t\tif pluginRegistry.Maven.Deps != nil {\n\t\t\tmavenConfig.SetRuntimeLibraries(make([]*registryv1alpha1.MavenConfig_RuntimeLibrary, len(pluginRegistry.Maven.Deps)))\n\t\t\tfor i, dependency := range pluginRegistry.Maven.Deps {\n\t\t\t\tmavenConfig.GetRuntimeLibraries()[i] = MavenDependencyConfigToProtoRuntimeLibrary(dependency)\n\t\t\t}\n\t\t}\n\t\tif pluginRegistry.Maven.AdditionalRuntimes != nil {\n\t\t\tmavenConfig.SetAdditionalRuntimes(make([]*registryv1alpha1.MavenConfig_RuntimeConfig, len(pluginRegistry.Maven.AdditionalRuntimes)))\n\t\t\tfor i, runtime := range pluginRegistry.Maven.AdditionalRuntimes {\n\t\t\t\tmavenConfig.GetAdditionalRuntimes()[i] = MavenRuntimeConfigToProtoRuntimeConfig(runtime)\n\t\t\t}\n\t\t}\n\t\tregistryConfig.SetMavenConfig(proto.ValueOrDefault(mavenConfig))\n\tcase pluginRegistry.Swift != nil:\n\t\tswiftConfig := SwiftRegistryConfigToProtoSwiftConfig(pluginRegistry.Swift)\n\t\tregistryConfig.SetSwiftConfig(proto.ValueOrDefault(swiftConfig))\n\tcase pluginRegistry.Python != nil:\n\t\tpythonConfig, err := PythonRegistryConfigToProtoPythonConfig(pluginRegistry.Python)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.SetPythonConfig(proto.ValueOrDefault(pythonConfig))\n\tcase pluginRegistry.Cargo != nil:\n\t\tcargoConfig, err := CargoRegistryConfigToProtoCargoConfig(pluginRegistry.Cargo)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.SetCargoConfig(proto.ValueOrDefault(cargoConfig))\n\tcase pluginRegistry.Nuget != nil:\n\t\tnugetConfig, err := NugetRegistryConfigToProtoNugetConfig(pluginRegistry.Nuget)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.SetNugetConfig(proto.ValueOrDefault(nugetConfig))\n\tcase pluginRegistry.Cmake != nil:\n\t\tcmakeConfig, err := CmakeRegistryConfigToProtoCmakeConfig(pluginRegistry.Cmake)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.SetCmakeConfig(proto.ValueOrDefault(cmakeConfig))\n\t}\n\treturn registryConfig, nil\n}\n\n// MavenDependencyConfigToProtoRuntimeLibrary converts a bufremotepluginconfig.MavenDependencyConfig to an equivalent registryv1alpha1.MavenConfig_RuntimeLibrary.\nfunc MavenDependencyConfigToProtoRuntimeLibrary(dependency bufremotepluginconfig.MavenDependencyConfig) *registryv1alpha1.MavenConfig_RuntimeLibrary {\n\treturn registryv1alpha1.MavenConfig_RuntimeLibrary_builder{\n\t\tGroupId:    dependency.GroupID,\n\t\tArtifactId: dependency.ArtifactID,\n\t\tVersion:    dependency.Version,\n\t\tClassifier: dependency.Classifier,\n\t\tExtension:  dependency.Extension,\n\t}.Build()\n}\n\n// ProtoRegistryConfigToPluginRegistry converts a registryv1alpha1.RegistryConfig to a bufremotepluginconfig.RegistryConfig .\nfunc ProtoRegistryConfigToPluginRegistry(config *registryv1alpha1.RegistryConfig) (*bufremotepluginconfig.RegistryConfig, error) {\n\tif config == nil {\n\t\treturn nil, nil\n\t}\n\tregistryConfig := &bufremotepluginconfig.RegistryConfig{\n\t\tOptions: bufremotepluginconfig.OptionsSliceToPluginOptions(config.GetOptions()),\n\t}\n\tswitch {\n\tcase config.GetGoConfig() != nil:\n\t\tgoConfig := &bufremotepluginconfig.GoRegistryConfig{}\n\t\tgoConfig.MinVersion = config.GetGoConfig().GetMinimumVersion()\n\t\tif config.GetGoConfig().GetBasePlugin() != \"\" {\n\t\t\tbasePluginIdentity, err := bufremotepluginref.PluginIdentityForString(config.GetGoConfig().GetBasePlugin())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tgoConfig.BasePlugin = basePluginIdentity\n\t\t}\n\t\truntimeLibraries := config.GetGoConfig().GetRuntimeLibraries()\n\t\tif runtimeLibraries != nil {\n\t\t\tgoConfig.Deps = make([]*bufremotepluginconfig.GoRegistryDependencyConfig, 0, len(runtimeLibraries))\n\t\t\tfor _, library := range runtimeLibraries {\n\t\t\t\tgoConfig.Deps = append(goConfig.Deps, protoGoRuntimeLibraryToGoRuntimeDependency(library))\n\t\t\t}\n\t\t}\n\t\tregistryConfig.Go = goConfig\n\tcase config.GetNpmConfig() != nil:\n\t\timportStyle, err := npmProtoImportStyleToNPMImportStyle(config.GetNpmConfig().GetImportStyle())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnpmConfig := &bufremotepluginconfig.NPMRegistryConfig{\n\t\t\tRewriteImportPathSuffix: config.GetNpmConfig().GetRewriteImportPathSuffix(),\n\t\t\tImportStyle:             importStyle,\n\t\t}\n\t\truntimeLibraries := config.GetNpmConfig().GetRuntimeLibraries()\n\t\tif runtimeLibraries != nil {\n\t\t\tnpmConfig.Deps = make([]*bufremotepluginconfig.NPMRegistryDependencyConfig, 0, len(runtimeLibraries))\n\t\t\tfor _, library := range runtimeLibraries {\n\t\t\t\tnpmConfig.Deps = append(npmConfig.Deps, protoNPMRuntimeLibraryToNPMRuntimeDependency(library))\n\t\t\t}\n\t\t}\n\t\tregistryConfig.NPM = npmConfig\n\tcase config.GetMavenConfig() != nil:\n\t\tmavenConfig, err := ProtoMavenConfigToMavenRegistryConfig(config.GetMavenConfig())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.Maven = mavenConfig\n\tcase config.GetSwiftConfig() != nil:\n\t\tswiftConfig, err := ProtoSwiftConfigToSwiftRegistryConfig(config.GetSwiftConfig())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.Swift = swiftConfig\n\tcase config.GetPythonConfig() != nil:\n\t\tpythonConfig, err := ProtoPythonConfigToPythonRegistryConfig(config.GetPythonConfig())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.Python = pythonConfig\n\tcase config.GetCargoConfig() != nil:\n\t\tcargoConfig, err := ProtoCargoConfigToCargoRegistryConfig(config.GetCargoConfig())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.Cargo = cargoConfig\n\tcase config.GetNugetConfig() != nil:\n\t\tnugetConfig, err := ProtoNugetConfigToNugetRegistryConfig(config.GetNugetConfig())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.Nuget = nugetConfig\n\tcase config.GetCmakeConfig() != nil:\n\t\tcmakeConfig, err := ProtoCmakeConfigToCmakeRegistryConfig(config.GetCmakeConfig())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tregistryConfig.Cmake = cmakeConfig\n\t}\n\treturn registryConfig, nil\n}\n\n// ProtoCargoConfigToCargoRegistryConfig converts protoCargoConfig to an equivalent [*bufremotepluginconfig.CargoRegistryConfig].\nfunc ProtoCargoConfigToCargoRegistryConfig(protoCargoConfig *registryv1alpha1.CargoConfig) (*bufremotepluginconfig.CargoRegistryConfig, error) {\n\tcargoConfig := &bufremotepluginconfig.CargoRegistryConfig{\n\t\tRustVersion: protoCargoConfig.GetRustVersion(),\n\t}\n\tfor _, dependency := range protoCargoConfig.GetRuntimeLibraries() {\n\t\tcargoConfig.Deps = append(cargoConfig.Deps, bufremotepluginconfig.CargoRegistryDependency{\n\t\t\tName:               dependency.GetName(),\n\t\t\tVersionRequirement: dependency.GetVersionRequirement(),\n\t\t\tDefaultFeatures:    dependency.GetDefaultFeatures(),\n\t\t\tFeatures:           dependency.GetFeatures(),\n\t\t})\n\t}\n\treturn cargoConfig, nil\n}\n\n// ProtoNugetConfigToNugetRegistryConfig converts protoConfig to an equivalent [*bufremotepluginconfig.NugetRegistryConfig].\nfunc ProtoNugetConfigToNugetRegistryConfig(protoConfig *registryv1alpha1.NugetConfig) (*bufremotepluginconfig.NugetRegistryConfig, error) {\n\ttargetFrameworks, err := xslices.MapError(protoConfig.GetTargetFrameworks(), DotnetTargetFrameworkToString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig := &bufremotepluginconfig.NugetRegistryConfig{\n\t\tTargetFrameworks: targetFrameworks,\n\t}\n\tfor _, dependency := range protoConfig.GetRuntimeLibraries() {\n\t\tvar depTargetFrameworks []string\n\t\tif len(dependency.GetTargetFrameworks()) > 0 {\n\t\t\tdepTargetFrameworks, err = xslices.MapError(dependency.GetTargetFrameworks(), DotnetTargetFrameworkToString)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tconfig.Deps = append(config.Deps, bufremotepluginconfig.NugetDependencyConfig{\n\t\t\tName:             dependency.GetName(),\n\t\t\tVersion:          dependency.GetVersion(),\n\t\t\tTargetFrameworks: depTargetFrameworks,\n\t\t})\n\t}\n\treturn config, err\n}\n\n// ProtoCmakeConfigToCmakeRegistryConfig converts protoCmakeConfig to an equivalent [*bufremotepluginconfig.CmakeRegistryConfig].\nfunc ProtoCmakeConfigToCmakeRegistryConfig(protoCmakeConfig *registryv1alpha1.CmakeConfig) (*bufremotepluginconfig.CmakeRegistryConfig, error) {\n\treturn &bufremotepluginconfig.CmakeRegistryConfig{}, nil\n}\n\n// CargoRegistryConfigToProtoCargoConfig converts cargoConfig to an equivalent [*registryv1alpha1.CargoConfig].\nfunc CargoRegistryConfigToProtoCargoConfig(cargoConfig *bufremotepluginconfig.CargoRegistryConfig) (*registryv1alpha1.CargoConfig, error) {\n\tprotoCargoConfig := registryv1alpha1.CargoConfig_builder{\n\t\tRustVersion: cargoConfig.RustVersion,\n\t}.Build()\n\tfor _, dependency := range cargoConfig.Deps {\n\t\tprotoCargoConfig.SetRuntimeLibraries(append(protoCargoConfig.GetRuntimeLibraries(), registryv1alpha1.CargoConfig_RuntimeLibrary_builder{\n\t\t\tName:               dependency.Name,\n\t\t\tVersionRequirement: dependency.VersionRequirement,\n\t\t\tDefaultFeatures:    dependency.DefaultFeatures,\n\t\t\tFeatures:           dependency.Features,\n\t\t}.Build()))\n\t}\n\treturn protoCargoConfig, nil\n}\n\n// NugetRegistryConfigToProtoNugetConfig converts nugetConfig to an equivalent [*registryv1alpha1.NugetConfig].\nfunc NugetRegistryConfigToProtoNugetConfig(nugetConfig *bufremotepluginconfig.NugetRegistryConfig) (*registryv1alpha1.NugetConfig, error) {\n\ttargetFrameworks, err := xslices.MapError(nugetConfig.TargetFrameworks, DotnetTargetFrameworkFromString)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprotoNugetConfig := registryv1alpha1.NugetConfig_builder{\n\t\tTargetFrameworks: targetFrameworks,\n\t}.Build()\n\tfor _, dependency := range nugetConfig.Deps {\n\t\tvar depTargetFrameworks []registryv1alpha1.DotnetTargetFramework\n\t\tif len(dependency.TargetFrameworks) > 0 {\n\t\t\tdepTargetFrameworks, err = xslices.MapError(dependency.TargetFrameworks, DotnetTargetFrameworkFromString)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tprotoNugetConfig.SetRuntimeLibraries(append(protoNugetConfig.GetRuntimeLibraries(), registryv1alpha1.NugetConfig_RuntimeLibrary_builder{\n\t\t\tName:             dependency.Name,\n\t\t\tVersion:          dependency.Version,\n\t\t\tTargetFrameworks: depTargetFrameworks,\n\t\t}.Build()))\n\t}\n\treturn protoNugetConfig, nil\n}\n\n// CmakeRegistryConfigToProtoCmakeConfig converts cmakeConfig to an equivalent [*registryv1alpha1.CmakeConfig].\nfunc CmakeRegistryConfigToProtoCmakeConfig(cmakeConfig *bufremotepluginconfig.CmakeRegistryConfig) (*registryv1alpha1.CmakeConfig, error) {\n\treturn &registryv1alpha1.CmakeConfig{}, nil\n}\n\n// ProtoPythonConfigToPythonRegistryConfig converts protoPythonConfig to an equivalent [*bufremotepluginconfig.PythonRegistryConfig].\nfunc ProtoPythonConfigToPythonRegistryConfig(protoPythonConfig *registryv1alpha1.PythonConfig) (*bufremotepluginconfig.PythonRegistryConfig, error) {\n\tpythonConfig := &bufremotepluginconfig.PythonRegistryConfig{\n\t\tRequiresPython: protoPythonConfig.GetRequiresPython(),\n\t}\n\tswitch protoPythonConfig.GetPackageType() {\n\tcase registryv1alpha1.PythonPackageType_PYTHON_PACKAGE_TYPE_RUNTIME:\n\t\tpythonConfig.PackageType = \"runtime\"\n\tcase registryv1alpha1.PythonPackageType_PYTHON_PACKAGE_TYPE_STUB_ONLY:\n\t\tpythonConfig.PackageType = \"stub-only\"\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown package type: %v\", protoPythonConfig.GetPackageType())\n\t}\n\tfor _, runtimeLibrary := range protoPythonConfig.GetRuntimeLibraries() {\n\t\tpythonConfig.Deps = append(pythonConfig.Deps, runtimeLibrary.GetDependencySpecification())\n\t}\n\treturn pythonConfig, nil\n}\n\n// PythonRegistryConfigToProtoPythonConfig converts pythonConfig to an equivalent [*registryv1alpha1.PythonConfig].\nfunc PythonRegistryConfigToProtoPythonConfig(pythonConfig *bufremotepluginconfig.PythonRegistryConfig) (*registryv1alpha1.PythonConfig, error) {\n\tprotoPythonConfig := registryv1alpha1.PythonConfig_builder{\n\t\tRequiresPython: pythonConfig.RequiresPython,\n\t}.Build()\n\tswitch pythonConfig.PackageType {\n\tcase \"runtime\":\n\t\tprotoPythonConfig.SetPackageType(registryv1alpha1.PythonPackageType_PYTHON_PACKAGE_TYPE_RUNTIME)\n\tcase \"stub-only\":\n\t\tprotoPythonConfig.SetPackageType(registryv1alpha1.PythonPackageType_PYTHON_PACKAGE_TYPE_STUB_ONLY)\n\tdefault:\n\t\treturn nil, fmt.Errorf(`invalid python config package_type; expecting one of \"runtime\" or \"stub-only\", got %q`, pythonConfig.PackageType)\n\t}\n\tfor _, dependencySpecification := range pythonConfig.Deps {\n\t\tprotoPythonConfig.SetRuntimeLibraries(append(protoPythonConfig.GetRuntimeLibraries(), registryv1alpha1.PythonConfig_RuntimeLibrary_builder{\n\t\t\tDependencySpecification: dependencySpecification,\n\t\t}.Build()))\n\t}\n\treturn protoPythonConfig, nil\n}\n\n// ProtoSwiftConfigToSwiftRegistryConfig converts protoSwiftConfig to an equivalent [*bufremotepluginconfig.SwiftRegistryConfig].\nfunc ProtoSwiftConfigToSwiftRegistryConfig(protoSwiftConfig *registryv1alpha1.SwiftConfig) (*bufremotepluginconfig.SwiftRegistryConfig, error) {\n\tswiftConfig := &bufremotepluginconfig.SwiftRegistryConfig{}\n\truntimeLibs := protoSwiftConfig.GetRuntimeLibraries()\n\tif runtimeLibs != nil {\n\t\tswiftConfig.Dependencies = make([]bufremotepluginconfig.SwiftRegistryDependencyConfig, 0, len(runtimeLibs))\n\t\tfor _, runtimeLib := range runtimeLibs {\n\t\t\tdependencyConfig := bufremotepluginconfig.SwiftRegistryDependencyConfig{\n\t\t\t\tSource:        runtimeLib.GetSource(),\n\t\t\t\tPackage:       runtimeLib.GetPackage(),\n\t\t\t\tVersion:       runtimeLib.GetVersion(),\n\t\t\t\tProducts:      runtimeLib.GetProducts(),\n\t\t\t\tSwiftVersions: runtimeLib.GetSwiftVersions(),\n\t\t\t}\n\t\t\tplatforms := runtimeLib.GetPlatforms()\n\t\t\tfor _, platform := range platforms {\n\t\t\t\tswitch platform.GetName() {\n\t\t\t\tcase registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_MACOS:\n\t\t\t\t\tdependencyConfig.Platforms.MacOS = platform.GetVersion()\n\t\t\t\tcase registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_IOS:\n\t\t\t\t\tdependencyConfig.Platforms.IOS = platform.GetVersion()\n\t\t\t\tcase registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_TVOS:\n\t\t\t\t\tdependencyConfig.Platforms.TVOS = platform.GetVersion()\n\t\t\t\tcase registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_WATCHOS:\n\t\t\t\t\tdependencyConfig.Platforms.WatchOS = platform.GetVersion()\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, fmt.Errorf(\"unknown platform type: %v\", platform.GetName())\n\t\t\t\t}\n\t\t\t}\n\t\t\tswiftConfig.Dependencies = append(swiftConfig.Dependencies, dependencyConfig)\n\t\t}\n\t}\n\treturn swiftConfig, nil\n}\n\n// SwiftRegistryConfigToProtoSwiftConfig converts swiftConfig to an equivalent [*registryv1alpha1.SwiftConfig].\nfunc SwiftRegistryConfigToProtoSwiftConfig(swiftConfig *bufremotepluginconfig.SwiftRegistryConfig) *registryv1alpha1.SwiftConfig {\n\tprotoSwiftConfig := &registryv1alpha1.SwiftConfig{}\n\tif swiftConfig.Dependencies != nil {\n\t\tprotoSwiftConfig.SetRuntimeLibraries(make([]*registryv1alpha1.SwiftConfig_RuntimeLibrary, 0, len(swiftConfig.Dependencies)))\n\t\tfor _, dependency := range swiftConfig.Dependencies {\n\t\t\tdepConfig := registryv1alpha1.SwiftConfig_RuntimeLibrary_builder{\n\t\t\t\tSource:        dependency.Source,\n\t\t\t\tPackage:       dependency.Package,\n\t\t\t\tVersion:       dependency.Version,\n\t\t\t\tProducts:      dependency.Products,\n\t\t\t\tSwiftVersions: dependency.SwiftVersions,\n\t\t\t}.Build()\n\t\t\tif dependency.Platforms.MacOS != \"\" {\n\t\t\t\tdepConfig.SetPlatforms(append(depConfig.GetPlatforms(), registryv1alpha1.SwiftConfig_RuntimeLibrary_Platform_builder{\n\t\t\t\t\tName:    registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_MACOS,\n\t\t\t\t\tVersion: dependency.Platforms.MacOS,\n\t\t\t\t}.Build()))\n\t\t\t}\n\t\t\tif dependency.Platforms.IOS != \"\" {\n\t\t\t\tdepConfig.SetPlatforms(append(depConfig.GetPlatforms(), registryv1alpha1.SwiftConfig_RuntimeLibrary_Platform_builder{\n\t\t\t\t\tName:    registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_IOS,\n\t\t\t\t\tVersion: dependency.Platforms.IOS,\n\t\t\t\t}.Build()))\n\t\t\t}\n\t\t\tif dependency.Platforms.TVOS != \"\" {\n\t\t\t\tdepConfig.SetPlatforms(append(depConfig.GetPlatforms(), registryv1alpha1.SwiftConfig_RuntimeLibrary_Platform_builder{\n\t\t\t\t\tName:    registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_TVOS,\n\t\t\t\t\tVersion: dependency.Platforms.TVOS,\n\t\t\t\t}.Build()))\n\t\t\t}\n\t\t\tif dependency.Platforms.WatchOS != \"\" {\n\t\t\t\tdepConfig.SetPlatforms(append(depConfig.GetPlatforms(), registryv1alpha1.SwiftConfig_RuntimeLibrary_Platform_builder{\n\t\t\t\t\tName:    registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_WATCHOS,\n\t\t\t\t\tVersion: dependency.Platforms.WatchOS,\n\t\t\t\t}.Build()))\n\t\t\t}\n\t\t\tprotoSwiftConfig.SetRuntimeLibraries(append(protoSwiftConfig.GetRuntimeLibraries(), depConfig))\n\t\t}\n\t}\n\treturn protoSwiftConfig\n}\n\n// ProtoMavenConfigToMavenRegistryConfig converts a registryv1alpha1.MavenConfig to a bufremotepluginconfig.MavenRegistryConfig.\nfunc ProtoMavenConfigToMavenRegistryConfig(protoMavenConfig *registryv1alpha1.MavenConfig) (*bufremotepluginconfig.MavenRegistryConfig, error) {\n\tmavenConfig := &bufremotepluginconfig.MavenRegistryConfig{}\n\tif protoCompiler := protoMavenConfig.GetCompiler(); protoCompiler != nil {\n\t\tmavenConfig.Compiler = bufremotepluginconfig.MavenCompilerConfig{}\n\t\tif protoJavaCompiler := protoCompiler.GetJava(); protoJavaCompiler != nil {\n\t\t\tmavenConfig.Compiler.Java = bufremotepluginconfig.MavenCompilerJavaConfig{\n\t\t\t\tEncoding: protoJavaCompiler.GetEncoding(),\n\t\t\t\tRelease:  int(protoJavaCompiler.GetRelease()),\n\t\t\t\tSource:   int(protoJavaCompiler.GetSource()),\n\t\t\t\tTarget:   int(protoJavaCompiler.GetTarget()),\n\t\t\t}\n\t\t}\n\t\tif protoKotlinCompiler := protoCompiler.GetKotlin(); protoKotlinCompiler != nil {\n\t\t\tmavenConfig.Compiler.Kotlin = bufremotepluginconfig.MavenCompilerKotlinConfig{\n\t\t\t\tAPIVersion:      protoKotlinCompiler.GetApiVersion(),\n\t\t\t\tJVMTarget:       protoKotlinCompiler.GetJvmTarget(),\n\t\t\t\tLanguageVersion: protoKotlinCompiler.GetLanguageVersion(),\n\t\t\t\tVersion:         protoKotlinCompiler.GetVersion(),\n\t\t\t}\n\t\t}\n\t}\n\truntimeLibraries := protoMavenConfig.GetRuntimeLibraries()\n\tif runtimeLibraries != nil {\n\t\tmavenConfig.Deps = make([]bufremotepluginconfig.MavenDependencyConfig, len(runtimeLibraries))\n\t\tfor i, library := range runtimeLibraries {\n\t\t\tmavenConfig.Deps[i] = ProtoMavenRuntimeLibraryToDependencyConfig(library)\n\t\t}\n\t}\n\tadditionalRuntimes := protoMavenConfig.GetAdditionalRuntimes()\n\tif additionalRuntimes != nil {\n\t\tmavenConfig.AdditionalRuntimes = make([]bufremotepluginconfig.MavenRuntimeConfig, len(additionalRuntimes))\n\t\tfor i, additionalRuntime := range additionalRuntimes {\n\t\t\truntime, err := MavenProtoRuntimeConfigToRuntimeConfig(additionalRuntime)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tmavenConfig.AdditionalRuntimes[i] = runtime\n\t\t}\n\t}\n\treturn mavenConfig, nil\n}\n\n// MavenProtoRuntimeConfigToRuntimeConfig converts a registryv1alpha1.MavenConfig_RuntimeConfig to a bufremotepluginconfig.MavenRuntimeConfig.\nfunc MavenProtoRuntimeConfigToRuntimeConfig(proto *registryv1alpha1.MavenConfig_RuntimeConfig) (bufremotepluginconfig.MavenRuntimeConfig, error) {\n\tlibraries := proto.GetRuntimeLibraries()\n\tvar dependencies []bufremotepluginconfig.MavenDependencyConfig\n\tfor _, library := range libraries {\n\t\tdependencies = append(dependencies, ProtoMavenRuntimeLibraryToDependencyConfig(library))\n\t}\n\treturn bufremotepluginconfig.MavenRuntimeConfig{\n\t\tName:    proto.GetName(),\n\t\tDeps:    dependencies,\n\t\tOptions: proto.GetOptions(),\n\t}, nil\n}\n\n// MavenRuntimeConfigToProtoRuntimeConfig converts a bufremotepluginconfig.MavenRuntimeConfig to a registryv1alpha1.MavenConfig_RuntimeLibrary.\nfunc MavenRuntimeConfigToProtoRuntimeConfig(runtime bufremotepluginconfig.MavenRuntimeConfig) *registryv1alpha1.MavenConfig_RuntimeConfig {\n\tvar libraries []*registryv1alpha1.MavenConfig_RuntimeLibrary\n\tfor _, dependency := range runtime.Deps {\n\t\tlibraries = append(libraries, MavenDependencyConfigToProtoRuntimeLibrary(dependency))\n\t}\n\treturn registryv1alpha1.MavenConfig_RuntimeConfig_builder{\n\t\tName:             runtime.Name,\n\t\tRuntimeLibraries: libraries,\n\t\tOptions:          runtime.Options,\n\t}.Build()\n}\n\n// ProtoMavenRuntimeLibraryToDependencyConfig converts a registryv1alpha1 to a bufremotepluginconfig.MavenDependencyConfig.\nfunc ProtoMavenRuntimeLibraryToDependencyConfig(proto *registryv1alpha1.MavenConfig_RuntimeLibrary) bufremotepluginconfig.MavenDependencyConfig {\n\treturn bufremotepluginconfig.MavenDependencyConfig{\n\t\tGroupID:    proto.GetGroupId(),\n\t\tArtifactID: proto.GetArtifactId(),\n\t\tVersion:    proto.GetVersion(),\n\t\tClassifier: proto.GetClassifier(),\n\t\tExtension:  proto.GetExtension(),\n\t}\n}\n\nfunc npmImportStyleToNPMProtoImportStyle(importStyle string) (registryv1alpha1.NPMImportStyle, error) {\n\tswitch importStyle {\n\tcase \"commonjs\":\n\t\treturn registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_COMMONJS, nil\n\tcase \"module\":\n\t\treturn registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_MODULE, nil\n\t}\n\treturn 0, fmt.Errorf(`invalid import style %q: must be one of \"module\" or \"commonjs\"`, importStyle)\n}\n\nfunc npmProtoImportStyleToNPMImportStyle(importStyle registryv1alpha1.NPMImportStyle) (string, error) {\n\tswitch importStyle {\n\tcase registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_COMMONJS:\n\t\treturn \"commonjs\", nil\n\tcase registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_MODULE:\n\t\treturn \"module\", nil\n\t}\n\treturn \"\", fmt.Errorf(\"unknown import style: %v\", importStyle)\n}\n\n// goRuntimeDependencyToProtoGoRuntimeLibrary converts a bufremotepluginconfig.GoRegistryDependencyConfig to a registryv1alpha1.GoConfig_RuntimeLibrary.\nfunc goRuntimeDependencyToProtoGoRuntimeLibrary(config *bufremotepluginconfig.GoRegistryDependencyConfig) *registryv1alpha1.GoConfig_RuntimeLibrary {\n\treturn registryv1alpha1.GoConfig_RuntimeLibrary_builder{\n\t\tModule:  config.Module,\n\t\tVersion: config.Version,\n\t}.Build()\n}\n\n// protoGoRuntimeLibraryToGoRuntimeDependency converts a registryv1alpha1.GoConfig_RuntimeLibrary to a bufremotepluginconfig.GoRegistryDependencyConfig.\nfunc protoGoRuntimeLibraryToGoRuntimeDependency(config *registryv1alpha1.GoConfig_RuntimeLibrary) *bufremotepluginconfig.GoRegistryDependencyConfig {\n\treturn &bufremotepluginconfig.GoRegistryDependencyConfig{\n\t\tModule:  config.GetModule(),\n\t\tVersion: config.GetVersion(),\n\t}\n}\n\n// npmRuntimeDependencyToProtoNPMRuntimeLibrary converts a bufremotepluginconfig.NPMRegistryConfig to a registryv1alpha1.NPMConfig_RuntimeLibrary.\nfunc npmRuntimeDependencyToProtoNPMRuntimeLibrary(config *bufremotepluginconfig.NPMRegistryDependencyConfig) *registryv1alpha1.NPMConfig_RuntimeLibrary {\n\treturn registryv1alpha1.NPMConfig_RuntimeLibrary_builder{\n\t\tPackage: config.Package,\n\t\tVersion: config.Version,\n\t}.Build()\n}\n\n// protoNPMRuntimeLibraryToNPMRuntimeDependency converts a registryv1alpha1.NPMConfig_RuntimeLibrary to a bufremotepluginconfig.NPMRegistryDependencyConfig.\nfunc protoNPMRuntimeLibraryToNPMRuntimeDependency(config *registryv1alpha1.NPMConfig_RuntimeLibrary) *bufremotepluginconfig.NPMRegistryDependencyConfig {\n\treturn &bufremotepluginconfig.NPMRegistryDependencyConfig{\n\t\tPackage: config.GetPackage(),\n\t\tVersion: config.GetVersion(),\n\t}\n}\n\n// PluginReferencesToCuratedProtoPluginReferences converts a slice of bufremotepluginref.PluginReference to a slice of registryv1alpha1.CuratedPluginReference.\nfunc PluginReferencesToCuratedProtoPluginReferences(references []bufremotepluginref.PluginReference) []*registryv1alpha1.CuratedPluginReference {\n\tif references == nil {\n\t\treturn nil\n\t}\n\tprotoReferences := make([]*registryv1alpha1.CuratedPluginReference, 0, len(references))\n\tfor _, reference := range references {\n\t\tprotoReferences = append(protoReferences, PluginReferenceToProtoCuratedPluginReference(reference))\n\t}\n\treturn protoReferences\n}\n\n// PluginReferenceToProtoCuratedPluginReference converts a bufremotepluginref.PluginReference to a registryv1alpha1.CuratedPluginReference.\nfunc PluginReferenceToProtoCuratedPluginReference(reference bufremotepluginref.PluginReference) *registryv1alpha1.CuratedPluginReference {\n\tif reference == nil {\n\t\treturn nil\n\t}\n\treturn registryv1alpha1.CuratedPluginReference_builder{\n\t\tOwner:    reference.Owner(),\n\t\tName:     reference.Plugin(),\n\t\tVersion:  reference.Version(),\n\t\tRevision: uint32(reference.Revision()),\n\t}.Build()\n}\n\n// PluginIdentityToProtoCuratedPluginReference converts a bufremotepluginref.PluginIdentity to a registryv1alpha1.CuratedPluginReference.\n//\n// The returned CuratedPluginReference contains no Version/Revision information.\nfunc PluginIdentityToProtoCuratedPluginReference(identity bufremotepluginref.PluginIdentity) *registryv1alpha1.CuratedPluginReference {\n\tif identity == nil {\n\t\treturn nil\n\t}\n\treturn registryv1alpha1.CuratedPluginReference_builder{\n\t\tOwner: identity.Owner(),\n\t\tName:  identity.Plugin(),\n\t}.Build()\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugin_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugin\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginconfig\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestPluginToProtoPluginRegistryType(t *testing.T) {\n\tt.Parallel()\n\tassertPluginToPluginRegistryType(t, nil, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{Go: &bufremotepluginconfig.GoRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_GO)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{NPM: &bufremotepluginconfig.NPMRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_NPM)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{Maven: &bufremotepluginconfig.MavenRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_MAVEN)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{Swift: &bufremotepluginconfig.SwiftRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_SWIFT)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{Python: &bufremotepluginconfig.PythonRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_PYTHON)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{Cargo: &bufremotepluginconfig.CargoRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_CARGO)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{Nuget: &bufremotepluginconfig.NugetRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_NUGET)\n\tassertPluginToPluginRegistryType(t, &bufremotepluginconfig.RegistryConfig{Cmake: &bufremotepluginconfig.CmakeRegistryConfig{}}, registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_CMAKE)\n}\n\nfunc assertPluginToPluginRegistryType(t testing.TB, config *bufremotepluginconfig.RegistryConfig, registryType registryv1alpha1.PluginRegistryType) {\n\tplugin, err := NewPlugin(\"v1.0.0\", nil, config, \"sha256:digest\", \"\", \"\")\n\trequire.Nil(t, err)\n\tassert.Equal(t, registryType, PluginToProtoPluginRegistryType(plugin))\n}\n\nfunc TestPluginRegistryRoundTrip(t *testing.T) {\n\tt.Parallel()\n\tassertPluginRegistryRoundTrip(t, nil)\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tGo: &bufremotepluginconfig.GoRegistryConfig{},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tGo: &bufremotepluginconfig.GoRegistryConfig{\n\t\t\tMinVersion: \"1.18\",\n\t\t\tDeps: []*bufremotepluginconfig.GoRegistryDependencyConfig{\n\t\t\t\t{\n\t\t\t\t\tModule:  \"connectrpc.com/connect\",\n\t\t\t\t\tVersion: \"v0.1.1\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tNPM: &bufremotepluginconfig.NPMRegistryConfig{\n\t\t\tImportStyle: \"commonjs\",\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tNPM: &bufremotepluginconfig.NPMRegistryConfig{\n\t\t\tImportStyle:             \"module\",\n\t\t\tRewriteImportPathSuffix: \"connectweb.js\",\n\t\t\tDeps: []*bufremotepluginconfig.NPMRegistryDependencyConfig{\n\t\t\t\t{\n\t\t\t\t\tPackage: \"@bufbuild/protobuf\",\n\t\t\t\t\tVersion: \"^0.0.4\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tGo: &bufremotepluginconfig.GoRegistryConfig{\n\t\t\tMinVersion: \"1.18\",\n\t\t\tDeps: []*bufremotepluginconfig.GoRegistryDependencyConfig{\n\t\t\t\t{\n\t\t\t\t\tModule:  \"connectrpc.com/connect\",\n\t\t\t\t\tVersion: \"v0.4.0\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tOptions: map[string]string{\n\t\t\t\"separate_package\": \"true\",\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tMaven: &bufremotepluginconfig.MavenRegistryConfig{},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tMaven: &bufremotepluginconfig.MavenRegistryConfig{\n\t\t\tCompiler: bufremotepluginconfig.MavenCompilerConfig{\n\t\t\t\tJava: bufremotepluginconfig.MavenCompilerJavaConfig{\n\t\t\t\t\tEncoding: \"UTF-8\",\n\t\t\t\t\tRelease:  7,\n\t\t\t\t\tSource:   8,\n\t\t\t\t\tTarget:   9,\n\t\t\t\t},\n\t\t\t\tKotlin: bufremotepluginconfig.MavenCompilerKotlinConfig{\n\t\t\t\t\tAPIVersion:      \"7\",\n\t\t\t\t\tJVMTarget:       \"8\",\n\t\t\t\t\tLanguageVersion: \"9\",\n\t\t\t\t\tVersion:         \"1.8.0\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tDeps: []bufremotepluginconfig.MavenDependencyConfig{\n\t\t\t\t{\n\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\tArtifactID: \"grpc-core\",\n\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\tArtifactID: \"grpc-protobuf\",\n\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\tArtifactID: \"protoc-gen-grpc-java\",\n\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\tClassifier: \"linux-x86_64\",\n\t\t\t\t\tExtension:  \"exe\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tAdditionalRuntimes: []bufremotepluginconfig.MavenRuntimeConfig{\n\t\t\t\t{\n\t\t\t\t\tName: \"lite\",\n\t\t\t\t\tDeps: []bufremotepluginconfig.MavenDependencyConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\tArtifactID: \"grpc-core\",\n\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\tArtifactID: \"grpc-protobuflite\",\n\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\tArtifactID: \"protoc-gen-grpc-java\",\n\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t\tClassifier: \"linux-x86_64\",\n\t\t\t\t\t\t\tExtension:  \"exe\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tOptions: []string{\"lite\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tSwift: &bufremotepluginconfig.SwiftRegistryConfig{},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tSwift: &bufremotepluginconfig.SwiftRegistryConfig{\n\t\t\tDependencies: []bufremotepluginconfig.SwiftRegistryDependencyConfig{\n\t\t\t\t{\n\t\t\t\t\tSource:        \"https://github.com/apple/swift-protobuf.git\",\n\t\t\t\t\tPackage:       \"swift-protobuf\",\n\t\t\t\t\tVersion:       \"1.12.0\",\n\t\t\t\t\tProducts:      []string{\"SwiftProtobuf\"},\n\t\t\t\t\tSwiftVersions: []string{\".v5\"},\n\t\t\t\t\tPlatforms: bufremotepluginconfig.SwiftRegistryDependencyPlatformConfig{\n\t\t\t\t\t\tMacOS:   \"v10_15\",\n\t\t\t\t\t\tIOS:     \"v10_15\",\n\t\t\t\t\t\tTVOS:    \"v10_15\",\n\t\t\t\t\t\tWatchOS: \"v10_15\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tCargo: &bufremotepluginconfig.CargoRegistryConfig{\n\t\t\tRustVersion: \"1.60\",\n\t\t\tDeps: []bufremotepluginconfig.CargoRegistryDependency{\n\t\t\t\t{\n\t\t\t\t\tName:               \"prost\",\n\t\t\t\t\tVersionRequirement: \"0.12.3\",\n\t\t\t\t\tDefaultFeatures:    true,\n\t\t\t\t\tFeatures:           []string{\"some/feature\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tNuget: &bufremotepluginconfig.NugetRegistryConfig{\n\t\t\tTargetFrameworks: []string{\"netstandard2.0\", \"netstandard2.1\"},\n\t\t\tDeps: []bufremotepluginconfig.NugetDependencyConfig{\n\t\t\t\t{\n\t\t\t\t\tName:    \"Grpc.Core.Api\",\n\t\t\t\t\tVersion: \"1.2.3\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tName:             \"Grpc.Other.Api\",\n\t\t\t\t\tVersion:          \"4.5.6\",\n\t\t\t\t\tTargetFrameworks: []string{\"netstandard2.1\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t})\n\tassertPluginRegistryRoundTrip(t, &bufremotepluginconfig.RegistryConfig{\n\t\tCmake: &bufremotepluginconfig.CmakeRegistryConfig{},\n\t})\n}\n\nfunc assertPluginRegistryRoundTrip(t testing.TB, config *bufremotepluginconfig.RegistryConfig) {\n\tprotoRegistryConfig, err := PluginRegistryToProtoRegistryConfig(config)\n\trequire.NoError(t, err)\n\tregistryConfig, err := ProtoRegistryConfigToPluginRegistry(protoRegistryConfig)\n\trequire.NoError(t, err)\n\tassert.Equal(t, config, registryConfig)\n}\n\nfunc TestLanguagesToProtoLanguages(t *testing.T) {\n\tt.Parallel()\n\tprotoLanguages, err := OutputLanguagesToProtoLanguages([]string{\"go\"})\n\trequire.NoError(t, err)\n\tassert.Equal(t,\n\t\t[]registryv1alpha1.PluginLanguage{\n\t\t\tregistryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_GO,\n\t\t},\n\t\tprotoLanguages,\n\t)\n\tprotoLanguages, err = OutputLanguagesToProtoLanguages([]string{\"typescript\", \"javascript\"})\n\trequire.NoError(t, err)\n\tassert.Equal(t,\n\t\t[]registryv1alpha1.PluginLanguage{\n\t\t\tregistryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_JAVASCRIPT,\n\t\t\tregistryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_TYPESCRIPT,\n\t\t},\n\t\tprotoLanguages,\n\t)\n\tprotoLanguages, err = OutputLanguagesToProtoLanguages([]string{\"java\", \"kotlin\", \"c\"})\n\trequire.NoError(t, err)\n\tassert.Equal(t,\n\t\t[]registryv1alpha1.PluginLanguage{\n\t\t\tregistryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_JAVA,\n\t\t\tregistryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_KOTLIN,\n\t\t\tregistryv1alpha1.PluginLanguage_PLUGIN_LANGUAGE_C,\n\t\t},\n\t\tprotoLanguages,\n\t)\n\t_, err = OutputLanguagesToProtoLanguages([]string{\"unknown_language\", \"another_unknown_language\"})\n\trequire.Error(t, err)\n\tprotoLanguages, err = OutputLanguagesToProtoLanguages(nil)\n\trequire.NoError(t, err)\n\tassert.Equal(t, 0, len(protoLanguages))\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/bufremotepluginconfig.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginconfig defines the buf.plugin.yaml file.\npackage bufremotepluginconfig\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\nconst (\n\t// ExternalConfigFilePath is the default configuration file path for v1.\n\tExternalConfigFilePath = \"buf.plugin.yaml\"\n\t// V1Version is the version string used to indicate the v1 version of the buf.plugin.yaml file.\n\tV1Version = \"v1\"\n)\n\nvar (\n\t// AllConfigFilePaths are all acceptable config file paths without overrides.\n\t//\n\t// These are in the order we should check.\n\tAllConfigFilePaths = []string{\n\t\tExternalConfigFilePath,\n\t}\n)\n\n// Config is the plugin config.\ntype Config struct {\n\t// Name is the name of the plugin (e.g. 'buf.build/protocolbuffers/go').\n\tName bufremotepluginref.PluginIdentity\n\t// PluginVersion is the version of the plugin's implementation\n\t// (e.g. the protoc-gen-connect-go implementation is v0.2.0).\n\t//\n\t// This excludes any other details found in the buf.plugin.yaml\n\t// or plugin source (e.g. Dockerfile) that would otherwise influence\n\t// the plugin's behavior.\n\tPluginVersion string\n\t// SourceURL is an optional attribute used to specify where the source\n\t// for the plugin can be found.\n\tSourceURL string\n\t// Description is an optional attribute to provide a more detailed\n\t// description for the plugin.\n\tDescription string\n\t// Dependencies are the dependencies this plugin has on other plugins.\n\t//\n\t// An example of a dependency might be a 'protoc-gen-go-grpc' plugin\n\t// which depends on the 'protoc-gen-go' generated code.\n\tDependencies []bufremotepluginref.PluginReference\n\t// OutputLanguages is a list of output languages the plugin supports.\n\tOutputLanguages []string\n\t// Registry is the registry configuration, which lets the user specify\n\t// dependencies and other metadata that applies to a specific\n\t// remote generation registry (e.g. the Go module proxy, NPM registry,\n\t// etc).\n\tRegistry *RegistryConfig\n\t// SPDXLicenseID is the license of the plugin, which should be one of\n\t// the identifiers defined in https://spdx.org/licenses\n\tSPDXLicenseID string\n\t// LicenseURL specifies where the plugin's license can be found.\n\tLicenseURL string\n\t// IntegrationGuideURL is an optional attribute used to specify where\n\t// the plugin integration guide can be found.\n\tIntegrationGuideURL string\n\t// Deprecated specifies whether the plugin is deprecated.\n\tDeprecated bool\n}\n\n// RegistryConfig is the configuration for the registry of a plugin.\n//\n// Only one field will be set.\ntype RegistryConfig struct {\n\tGo     *GoRegistryConfig\n\tNPM    *NPMRegistryConfig\n\tMaven  *MavenRegistryConfig\n\tSwift  *SwiftRegistryConfig\n\tPython *PythonRegistryConfig\n\tCargo  *CargoRegistryConfig\n\tNuget  *NugetRegistryConfig\n\tCmake  *CmakeRegistryConfig\n\t// Options is the set of options passed into the plugin for the\n\t// remote registry.\n\t//\n\t// For now, all options are string values. This could eventually\n\t// support other types (like JSON Schema and Terraform variables),\n\t// where strings are the default value unless otherwise specified.\n\t//\n\t// Note that some legacy plugins don't always express their options\n\t// as key value pairs. For example, protoc-gen-java has an option\n\t// that can be passed like so:\n\t//\n\t//  java_opt=annotate_code\n\t//\n\t// In those cases, the option value in this map will be set to\n\t// the empty string, and the option will be propagated to the\n\t// compiler without the '=' delimiter.\n\tOptions map[string]string\n}\n\n// GoRegistryConfig is the registry configuration for a Go plugin.\ntype GoRegistryConfig struct {\n\tMinVersion string\n\tDeps       []*GoRegistryDependencyConfig\n\tBasePlugin bufremotepluginref.PluginIdentity\n}\n\n// GoRegistryDependencyConfig is the go registry dependency configuration.\ntype GoRegistryDependencyConfig struct {\n\tModule  string\n\tVersion string\n}\n\n// NPMRegistryConfig is the registry configuration for a JavaScript NPM plugin.\ntype NPMRegistryConfig struct {\n\tRewriteImportPathSuffix string\n\tDeps                    []*NPMRegistryDependencyConfig\n\tImportStyle             string\n}\n\n// NPMRegistryDependencyConfig is the npm registry dependency configuration.\ntype NPMRegistryDependencyConfig struct {\n\tPackage string\n\tVersion string\n}\n\n// MavenRegistryConfig is the registry configuration for a Maven plugin.\ntype MavenRegistryConfig struct {\n\t// Compiler specifies Java and/or Kotlin compiler settings for remote packages.\n\tCompiler MavenCompilerConfig\n\t// Deps are dependencies for the remote package.\n\tDeps []MavenDependencyConfig\n\t// AdditionalRuntimes tracks additional runtimes (like the 'lite' runtime).\n\t// This is used to support multiple artifacts targeting different runtimes, plugin options, and dependencies.\n\tAdditionalRuntimes []MavenRuntimeConfig\n}\n\n// MavenCompilerConfig specifies compiler settings for Java and/or Kotlin.\ntype MavenCompilerConfig struct {\n\tJava   MavenCompilerJavaConfig\n\tKotlin MavenCompilerKotlinConfig\n}\n\n// MavenCompilerJavaConfig specifies compiler settings for Java code.\ntype MavenCompilerJavaConfig struct {\n\t// Encoding specifies the encoding of the source files (default: UTF-8).\n\tEncoding string\n\t// Release specifies the target Java release (default: 8).\n\tRelease int\n\t// Source specifies the source bytecode level (default: 8).\n\tSource int\n\t// Target specifies the target bytecode level (default: 8).\n\tTarget int\n}\n\n// MavenCompilerKotlinConfig specifies compiler settings for Kotlin code.\ntype MavenCompilerKotlinConfig struct {\n\t// APIVersion specifies the Kotlin API version to target.\n\tAPIVersion string\n\t// JVMTarget specifies the target version of the JVM bytecode (default: 1.8)\n\tJVMTarget string\n\t// LanguageVersion is used to provide source compatibility with the specified Kotlin version.\n\tLanguageVersion string\n\t// Version of the Kotlin compiler to use (required for Kotlin plugins).\n\tVersion string\n}\n\n// MavenDependencyConfig defines a runtime dependency for a remote package artifact.\ntype MavenDependencyConfig struct {\n\tGroupID    string\n\tArtifactID string\n\tVersion    string\n\tClassifier string\n\t// Extension is the file extension, also known as the Maven type.\n\tExtension string\n}\n\n// MavenRuntimeConfig is used to specify additional runtimes for a given plugin.\ntype MavenRuntimeConfig struct {\n\t// Name is the required, unique name for the runtime in MavenRegistryConfig.AdditionalRuntimes.\n\tName string\n\t// Deps contains the Maven dependencies for the runtime. Overrides MavenRegistryConfig.Deps.\n\tDeps []MavenDependencyConfig\n\t// Options contains the Maven plugin options for the runtime. Overrides RegistryConfig.Options.\n\tOptions []string\n}\n\n// SwiftRegistryConfig is the registry configuration for a Swift plugin.\ntype SwiftRegistryConfig struct {\n\t// Dependencies are dependencies for the remote package.\n\tDependencies []SwiftRegistryDependencyConfig\n}\n\n// SwiftRegistryDependencyConfig is the swift registry dependency configuration.\ntype SwiftRegistryDependencyConfig struct {\n\t// Source specifies the source of the dependency.\n\tSource string\n\t// Package is the name of the Swift package.\n\tPackage string\n\t// Version is the version of the Swift package.\n\tVersion string\n\t// Products are the names of the products available to import.\n\tProducts []string\n\t// Platforms are the minimum versions for platforms the package supports.\n\tPlatforms SwiftRegistryDependencyPlatformConfig\n\t// SwiftVersions are the versions of Swift the package supports.\n\tSwiftVersions []string\n}\n\n// SwiftRegistryDependencyPlatformConfig is the swift registry dependency platform configuration.\ntype SwiftRegistryDependencyPlatformConfig struct {\n\t// macOS specifies the version of the macOS platform.\n\tMacOS string\n\t// iOS specifies the version of the iOS platform.\n\tIOS string\n\t// TVOS specifies the version of the tvOS platform.\n\tTVOS string\n\t// WatchOS specifies the version of the watchOS platform.\n\tWatchOS string\n}\n\n// PythonRegistryConfig is the registry configuration for a Python plugin.\ntype PythonRegistryConfig struct {\n\t// Deps are the dependency specifications for the generated SDK.\n\tDeps []string\n\t// RequiresPython is the `Requires-Python` for the generated SDK.\n\tRequiresPython string\n\t// PackageType is the package type for the generated SDK.\n\tPackageType string\n}\n\n// CargoRegistryDependency defines a runtime dependency for a generated crate.\n// It is the subset of a full Cargo dependency specification, which contains\n// fields that are currently irrelevant for Generated SDKs.\n// Ref: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html\ntype CargoRegistryDependency struct {\n\t// Name specifies the name of the dependency.\n\tName string\n\t// VersionRequirement specifies the version requirement of the dependency.\n\tVersionRequirement string\n\t// DefaultFeatures specifies whether or not the default features will\n\t// be enabled for the dependency.\n\tDefaultFeatures bool\n\t// Features specifies the features enabled for the dependency.\n\tFeatures []string\n}\n\n// CargoRegistryConfig is the registry configuration for a Cargo plugin.\ntype CargoRegistryConfig struct {\n\t// RustVersion specifies the minimum supported Rust version (MSRV) for the generated crate.\n\t// Ref: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field\n\tRustVersion string\n\t// Deps specifies the runtime dependencies of the crate.\n\tDeps []CargoRegistryDependency\n}\n\n// NugetDependencyConfig defines a runtime dependency for a generated nuget package.\ntype NugetDependencyConfig struct {\n\t// Name specifies the name of the dependency.\n\tName string\n\t// Version specifies the version of the dependency.\n\t// This can be an exact version or a version range.\n\tVersion string\n\t// TargetFrameworks specify the optional target frameworks for the dependency.\n\t// If specified, the dependency will be added only for the specified framework.\n\tTargetFrameworks []string\n}\n\n// NugetRegistryConfig defines the configuration for a nuget registry.\ntype NugetRegistryConfig struct {\n\t// TargetFrameworks specify the frameworks to build.\n\t// At least one target framework must be specified.\n\tTargetFrameworks []string\n\t// Deps specifies the dependencies for the generated SDK.\n\tDeps []NugetDependencyConfig\n}\n\n// CmakeRegistryConfig defines the configuration for a cmake registry.\ntype CmakeRegistryConfig struct{}\n\n// ConfigOption is an optional option used when loading a Config.\ntype ConfigOption func(*configOptions)\n\n// WithOverrideRemote will update the remote found in the plugin name and dependencies.\nfunc WithOverrideRemote(remote string) ConfigOption {\n\treturn func(options *configOptions) {\n\t\toptions.overrideRemote = remote\n\t}\n}\n\n// GetConfigForBucket gets the Config for the YAML data at ConfigFilePath.\n//\n// If the data is of length 0, returns the default config.\nfunc GetConfigForBucket(ctx context.Context, readBucket storage.ReadBucket, options ...ConfigOption) (*Config, error) {\n\treturn getConfigForBucket(ctx, readBucket, options)\n}\n\n// GetConfigForData gets the Config for the given JSON or YAML data.\n//\n// If the data is of length 0, returns the default config.\nfunc GetConfigForData(ctx context.Context, data []byte, options ...ConfigOption) (*Config, error) {\n\treturn getConfigForData(ctx, data, options)\n}\n\n// ExistingConfigFilePath checks if a configuration file exists, and if so, returns the path\n// within the ReadBucket of this configuration file.\n//\n// Returns empty string and no error if no configuration file exists.\nfunc ExistingConfigFilePath(ctx context.Context, readBucket storage.ReadBucket) (string, error) {\n\tfor _, configFilePath := range AllConfigFilePaths {\n\t\texists, err := storage.Exists(ctx, readBucket, configFilePath)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tif exists {\n\t\t\treturn configFilePath, nil\n\t\t}\n\t}\n\treturn \"\", nil\n}\n\n// ParseConfig parses the file at the given path as a Config.\nfunc ParseConfig(config string, options ...ConfigOption) (*Config, error) {\n\tvar data []byte\n\tvar err error\n\tswitch filepath.Ext(config) {\n\tcase \".json\", \".yaml\", \".yml\":\n\t\tdata, err = os.ReadFile(config)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not read file: %w\", err)\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid extension %s, must be .json, .yaml or .yml\", filepath.Ext(config))\n\t}\n\tvar externalConfig ExternalConfig\n\tif err := encoding.UnmarshalJSONOrYAMLStrict(data, &externalConfig); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to unmarshal plugin config: %w\", err)\n\t}\n\tswitch externalConfig.Version {\n\tcase V1Version:\n\t\treturn newConfig(externalConfig, options)\n\t}\n\treturn nil, fmt.Errorf(\"invalid plugin configuration version: must be one of %v\", AllConfigFilePaths)\n}\n\n// PluginOptionsToOptionsSlice converts a map representation of plugin options to a slice of the form '<key>=<value>' or '<key>' for empty values.\nfunc PluginOptionsToOptionsSlice(pluginOptions map[string]string) []string {\n\tif pluginOptions == nil {\n\t\treturn nil\n\t}\n\toptions := make([]string, 0, len(pluginOptions))\n\tfor key, value := range pluginOptions {\n\t\tif len(value) > 0 {\n\t\t\toptions = append(options, key+\"=\"+value)\n\t\t} else {\n\t\t\toptions = append(options, key)\n\t\t}\n\t}\n\tsort.Strings(options)\n\treturn options\n}\n\n// OptionsSliceToPluginOptions converts a slice of plugin options to a map (using the first '=' as a delimiter between key and value).\n// If no '=' is found, the option will be stored in the map with an empty string value.\nfunc OptionsSliceToPluginOptions(options []string) map[string]string {\n\tif options == nil {\n\t\treturn nil\n\t}\n\tpluginOptions := make(map[string]string, len(options))\n\tfor _, option := range options {\n\t\tfields := strings.SplitN(option, \"=\", 2)\n\t\tif len(fields) == 2 {\n\t\t\tpluginOptions[fields[0]] = fields[1]\n\t\t} else {\n\t\t\tpluginOptions[option] = \"\"\n\t\t}\n\t}\n\treturn pluginOptions\n}\n\n// ExternalConfig represents the on-disk representation\n// of the plugin configuration at version v1.\ntype ExternalConfig struct {\n\tVersion             string                 `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\tName                string                 `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\tPluginVersion       string                 `json:\"plugin_version,omitempty\" yaml:\"plugin_version,omitempty\"`\n\tSourceURL           string                 `json:\"source_url,omitempty\" yaml:\"source_url,omitempty\"`\n\tDescription         string                 `json:\"description,omitempty\" yaml:\"description,omitempty\"`\n\tDeps                []ExternalDependency   `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tOutputLanguages     []string               `json:\"output_languages,omitempty\" yaml:\"output_languages,omitempty\"`\n\tRegistry            ExternalRegistryConfig `json:\"registry\" yaml:\"registry,omitempty\"`\n\tSPDXLicenseID       string                 `json:\"spdx_license_id,omitempty\" yaml:\"spdx_license_id,omitempty\"`\n\tLicenseURL          string                 `json:\"license_url,omitempty\" yaml:\"license_url,omitempty\"`\n\tIntegrationGuideURL string                 `json:\"integration_guide_url,omitempty\" yaml:\"integration_guide_url,omitempty\"`\n\tDeprecated          bool                   `json:\"deprecated,omitempty\" yaml:\"deprecated,omitempty\"`\n}\n\n// ExternalDependency represents a dependency on another plugin.\ntype ExternalDependency struct {\n\tPlugin   string `json:\"plugin,omitempty\" yaml:\"plugin,omitempty\"`\n\tRevision int    `json:\"revision,omitempty\" yaml:\"revision,omitempty\"`\n}\n\n// ExternalRegistryConfig is the external configuration for the registry\n// of a plugin.\ntype ExternalRegistryConfig struct {\n\tGo     *ExternalGoRegistryConfig     `json:\"go,omitempty\" yaml:\"go,omitempty\"`\n\tNPM    *ExternalNPMRegistryConfig    `json:\"npm,omitempty\" yaml:\"npm,omitempty\"`\n\tMaven  *ExternalMavenRegistryConfig  `json:\"maven,omitempty\" yaml:\"maven,omitempty\"`\n\tSwift  *ExternalSwiftRegistryConfig  `json:\"swift,omitempty\" yaml:\"swift,omitempty\"`\n\tPython *ExternalPythonRegistryConfig `json:\"python,omitempty\" yaml:\"python,omitempty\"`\n\tCargo  *ExternalCargoRegistryConfig  `json:\"cargo,omitempty\" yaml:\"cargo,omitempty\"`\n\tNuget  *ExternalNugetRegistryConfig  `json:\"nuget,omitempty\" yaml:\"nuget,omitempty\"`\n\tCmake  *ExternalCmakeRegistryConfig  `json:\"cmake,omitempty\" yaml:\"cmake,omitempty\"`\n\tOpts   []string                      `json:\"opts,omitempty\" yaml:\"opts,omitempty\"`\n}\n\n// ExternalGoRegistryConfig is the external registry configuration for a Go plugin.\ntype ExternalGoRegistryConfig struct {\n\t// The minimum Go version required by the plugin.\n\tMinVersion string `json:\"min_version,omitempty\" yaml:\"min_version,omitempty\"`\n\tDeps       []struct {\n\t\tModule  string `json:\"module,omitempty\" yaml:\"module,omitempty\"`\n\t\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\t} `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tBasePlugin string `json:\"base_plugin,omitempty\" yaml:\"base_plugin,omitempty\"`\n}\n\n// ExternalNPMRegistryConfig is the external registry configuration for a JavaScript NPM plugin.\ntype ExternalNPMRegistryConfig struct {\n\tRewriteImportPathSuffix string `json:\"rewrite_import_path_suffix,omitempty\" yaml:\"rewrite_import_path_suffix,omitempty\"`\n\tDeps                    []struct {\n\t\tPackage string `json:\"package,omitempty\" yaml:\"package,omitempty\"`\n\t\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\t} `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\t// The import style used for the \"type\" field in the package.json file.\n\t// Must be one of \"module\" or \"commonjs\".\n\tImportStyle string `json:\"import_style,omitempty\" yaml:\"import_style,omitempty\"`\n}\n\n// ExternalMavenRegistryConfig is the external registry configuration for a Maven plugin.\ntype ExternalMavenRegistryConfig struct {\n\tCompiler           ExternalMavenCompilerConfig  `json:\"compiler\" yaml:\"compiler\"`\n\tDeps               []string                     `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\tAdditionalRuntimes []ExternalMavenRuntimeConfig `json:\"additional_runtimes,omitempty\" yaml:\"additional_runtimes,omitempty\"`\n}\n\n// ExternalMavenCompilerConfig configures compiler settings for Maven remote packages.\ntype ExternalMavenCompilerConfig struct {\n\tJava   ExternalMavenCompilerJavaConfig   `json:\"java\" yaml:\"java\"`\n\tKotlin ExternalMavenCompilerKotlinConfig `json:\"kotlin\" yaml:\"kotlin\"`\n}\n\n// ExternalMavenCompilerJavaConfig configures the Java compiler settings for remote packages.\ntype ExternalMavenCompilerJavaConfig struct {\n\t// Encoding specifies the encoding of the source files (default: UTF-8).\n\tEncoding string `json:\"encoding\" yaml:\"encoding\"`\n\t// Release specifies the target Java release (default: 8).\n\tRelease int `json:\"release\" yaml:\"release\"`\n\t// Source specifies the source bytecode level (default: 8).\n\tSource int `json:\"source\" yaml:\"source\"`\n\t// Target specifies the target bytecode level (default: 8).\n\tTarget int `json:\"target\" yaml:\"target\"`\n}\n\n// ExternalMavenCompilerKotlinConfig configures the Kotlin compiler settings for remote packages.\ntype ExternalMavenCompilerKotlinConfig struct {\n\t// APIVersion specifies the Kotlin API version to target.\n\tAPIVersion string `json:\"api_version\" yaml:\"api_version\"`\n\t// JVMTarget specifies the target version of the JVM bytecode (default: 1.8)\n\tJVMTarget string `json:\"jvm_target\" yaml:\"jvm_target\"`\n\t// LanguageVersion is used to provide source compatibility with the specified Kotlin version.\n\tLanguageVersion string `json:\"language_version\" yaml:\"language_version\"`\n\t// Version of the Kotlin compiler to use (required for Kotlin plugins).\n\tVersion string `json:\"version\" yaml:\"version\"`\n}\n\n// ExternalMavenRuntimeConfig allows configuring additional runtimes for remote packages.\n// These can specify different dependencies and compiler options than the default runtime.\n// This is used to support a single plugin supporting both full and lite Protobuf runtimes.\ntype ExternalMavenRuntimeConfig struct {\n\t// Name contains the Maven runtime name (e.g. 'lite').\n\tName string `json:\"name\" yaml:\"name\"`\n\t// Deps contains the Maven dependencies for the runtime. Overrides ExternalMavenRuntimeConfig.Deps.\n\tDeps []string `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\t// Opts contains the Maven plugin options for the runtime. Overrides ExternalRegistryConfig.Opts.\n\tOpts []string `json:\"opts,omitempty\" yaml:\"opts,omitempty\"`\n}\n\n// ExternalSwiftRegistryConfig is the registry configuration for a Swift plugin.\ntype ExternalSwiftRegistryConfig struct {\n\t// Deps are dependencies for the remote package.\n\tDeps []ExternalSwiftRegistryDependencyConfig `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n}\n\n// ExternalSwiftRegistryDependencyConfig is the swift registry dependency configuration.\ntype ExternalSwiftRegistryDependencyConfig struct {\n\t// Source is the URL of the Swift package.\n\tSource string `json:\"source,omitempty\" yaml:\"source,omitempty\"`\n\t// Package is the name of the Swift package.\n\tPackage string `json:\"package,omitempty\" yaml:\"package,omitempty\"`\n\t// Version is the version of the Swift package.\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\t// Products are the names of the products available to import.\n\tProducts []string `json:\"products,omitempty\" yaml:\"products,omitempty\"`\n\t// Platforms are the minimum versions for platforms the package supports.\n\tPlatforms ExternalSwiftRegistryDependencyPlatformConfig `json:\"platforms\" yaml:\"platforms,omitempty\"`\n\t// SwiftVersions are the versions of Swift the package supports.\n\tSwiftVersions []string `json:\"swift_versions,omitempty\" yaml:\"swift_versions,omitempty\"`\n}\n\n// ExternalSwiftRegistryDependencyPlatformConfig is the swift registry dependency platform configuration.\ntype ExternalSwiftRegistryDependencyPlatformConfig struct {\n\t// macOS specifies the version of the macOS platform.\n\tMacOS string `json:\"macos,omitempty\" yaml:\"macos,omitempty\"`\n\t// iOS specifies the version of the iOS platform.\n\tIOS string `json:\"ios,omitempty\" yaml:\"ios,omitempty\"`\n\t// TVOS specifies the version of the tvOS platform.\n\tTVOS string `json:\"tvos,omitempty\" yaml:\"tvos,omitempty\"`\n\t// WatchOS specifies the version of the watchOS platform.\n\tWatchOS string `json:\"watchos,omitempty\" yaml:\"watchos,omitempty\"`\n}\n\n// ExternalPythonRegistryConfig is the registry configuration for a Python plugin.\ntype ExternalPythonRegistryConfig struct {\n\t// Deps are dependency specifications for the generated SDK.\n\tDeps []string `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n\t// RequiresPython specifies the `Requires-Python` of the generated metadata file.\n\tRequiresPython string `json:\"requires_python,omitempty\" yaml:\"requires_python,omitempty\"`\n\t// PackageType is the type of package generated.\n\t// Must be one of \"runtime\" or \"stub-only\".\n\tPackageType string `json:\"package_type,omitempty\" yaml:\"package_type,omitempty\"`\n}\n\n// ExternalCargoDependency specifies a runtime dependency for a Cargo generated SDK.\ntype ExternalCargoDependency struct {\n\t// Name specifies the name of the dependency.\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\t// VersionRequirement specifies the version requirement of the dependency.\n\tVersionRequirement string `json:\"req,omitempty\" yaml:\"req,omitempty\"`\n\t// DefaultFeatures specifies whether or not the default features will\n\t// be enabled for the dependency.\n\tDefaultFeatures bool `json:\"default_features,omitempty\" yaml:\"default_features,omitempty\"`\n\t// Features specifies the features enabled for the dependency.\n\tFeatures []string `json:\"features,omitempty\" yaml:\"features,omitempty\"`\n}\n\n// ExternalCargoRegistryConfig is the registry configuration for a Rust plugin.\ntype ExternalCargoRegistryConfig struct {\n\t// RustVersion specifies the minimum supported Rust version (MSRV) for the generated crate.\n\t// Ref: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field\n\tRustVersion string `json:\"rust_version,omitempty\" yaml:\"rust_version,omitempty\"`\n\t// Deps specifies the dependencies for the generated SDK.\n\tDeps []ExternalCargoDependency `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n}\n\n// ExternalNugetDependency defines a nuget package dependency.\ntype ExternalNugetDependency struct {\n\t// Name specifies the name of the dependency.\n\tName string `json:\"name,omitempty\" yaml:\"name,omitempty\"`\n\t// Version specifies the version of the dependency.\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n\t// TargetFrameworks specify the optional target frameworks for the dependency.\n\tTargetFrameworks []string `json:\"target_frameworks\" yaml:\"target_frameworks,omitempty\"`\n}\n\n// ExternalNugetRegistryConfig defines the configuration for a nuget registry.\ntype ExternalNugetRegistryConfig struct {\n\t// TargetFrameworks specify the frameworks to build.\n\tTargetFrameworks []string `json:\"target_frameworks\" yaml:\"target_frameworks,omitempty\"`\n\t// Deps specifies the dependencies for the generated SDK.\n\tDeps []ExternalNugetDependency `json:\"deps,omitempty\" yaml:\"deps,omitempty\"`\n}\n\n// ExternalCmakeRegistryConfig defines the configuration for a cmake registry.\ntype ExternalCmakeRegistryConfig struct{}\n\ntype externalConfigVersion struct {\n\tVersion string `json:\"version,omitempty\" yaml:\"version,omitempty\"`\n}\n\ntype configOptions struct {\n\toverrideRemote string\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/bufremotepluginconfig_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginconfig\n\nimport (\n\t\"math\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"gopkg.in/yaml.v3\"\n)\n\nfunc TestGetConfigForBucket(t *testing.T) {\n\tt.Parallel()\n\tstorageosProvider := storageos.NewProvider()\n\treadWriteBucket, err := storageosProvider.NewReadWriteBucket(filepath.Join(\"testdata\", \"success\", \"go\"))\n\trequire.NoError(t, err)\n\tpluginConfig, err := GetConfigForBucket(t.Context(), readWriteBucket)\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/library/go-grpc\")\n\trequire.NoError(t, err)\n\tpluginDependency, err := bufremotepluginref.PluginReferenceForString(\"buf.build/library/go:v1.28.0\", 1)\n\trequire.NoError(t, err)\n\tbasePluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/library/go\")\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:          pluginIdentity,\n\t\t\tPluginVersion: \"v1.2.0\",\n\t\t\tSourceURL:     \"https://github.com/grpc/grpc-go\",\n\t\t\tDescription:   \"Generates Go language bindings of services in protobuf definition files for gRPC.\",\n\t\t\tDependencies: []bufremotepluginref.PluginReference{\n\t\t\t\tpluginDependency,\n\t\t\t},\n\t\t\tOutputLanguages: []string{\"go\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tGo: &GoRegistryConfig{\n\t\t\t\t\tMinVersion: \"1.18\",\n\t\t\t\t\tBasePlugin: basePluginIdentity,\n\t\t\t\t\tDeps: []*GoRegistryDependencyConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tModule:  \"google.golang.org/grpc\",\n\t\t\t\t\t\t\tVersion: \"v1.32.0\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tOptions: map[string]string{\n\t\t\t\t\t\"separate_package\": \"true\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tSPDXLicenseID:       \"Apache-2.0\",\n\t\t\tLicenseURL:          \"https://github.com/grpc/grpc-go/blob/master/LICENSE\",\n\t\t\tIntegrationGuideURL: \"https://grpc.io/docs/languages/go/quickstart\",\n\t\t\tDeprecated:          true,\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigGoYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"go\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/library/go-grpc\")\n\trequire.NoError(t, err)\n\tpluginDependency, err := bufremotepluginref.PluginReferenceForString(\"buf.build/library/go:v1.28.0\", 1)\n\trequire.NoError(t, err)\n\tbasePluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/library/go\")\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:          pluginIdentity,\n\t\t\tPluginVersion: \"v1.2.0\",\n\t\t\tSourceURL:     \"https://github.com/grpc/grpc-go\",\n\t\t\tDescription:   \"Generates Go language bindings of services in protobuf definition files for gRPC.\",\n\t\t\tDependencies: []bufremotepluginref.PluginReference{\n\t\t\t\tpluginDependency,\n\t\t\t},\n\t\t\tOutputLanguages: []string{\"go\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tGo: &GoRegistryConfig{\n\t\t\t\t\tMinVersion: \"1.18\",\n\t\t\t\t\tBasePlugin: basePluginIdentity,\n\t\t\t\t\tDeps: []*GoRegistryDependencyConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tModule:  \"google.golang.org/grpc\",\n\t\t\t\t\t\t\tVersion: \"v1.32.0\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tOptions: map[string]string{\n\t\t\t\t\t\"separate_package\": \"true\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tSPDXLicenseID:       \"Apache-2.0\",\n\t\t\tLicenseURL:          \"https://github.com/grpc/grpc-go/blob/master/LICENSE\",\n\t\t\tIntegrationGuideURL: \"https://grpc.io/docs/languages/go/quickstart\",\n\t\t\tDeprecated:          true,\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigGoYAMLOverrideRemote(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"go\", \"buf.plugin.yaml\"), WithOverrideRemote(\"buf.mydomain.com\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.mydomain.com/library/go-grpc\")\n\trequire.NoError(t, err)\n\tpluginDependency, err := bufremotepluginref.PluginReferenceForString(\"buf.mydomain.com/library/go:v1.28.0\", 1)\n\trequire.NoError(t, err)\n\tassert.Equal(t, pluginIdentity, pluginConfig.Name)\n\trequire.Len(t, pluginConfig.Dependencies, 1)\n\tassert.Equal(t, pluginDependency, pluginConfig.Dependencies[0])\n}\n\nfunc TestParsePluginConfigNPMYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"npm\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/protocolbuffers/js\")\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:            pluginIdentity,\n\t\t\tPluginVersion:   \"v1.0.0\",\n\t\t\tOutputLanguages: []string{\"typescript\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tNPM: &NPMRegistryConfig{\n\t\t\t\t\tImportStyle: \"commonjs\",\n\t\t\t\t\tDeps: []*NPMRegistryDependencyConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPackage: \"grpc-web\",\n\t\t\t\t\t\t\tVersion: \"^1.3.1\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPackage: \"@types/google-protobuf\",\n\t\t\t\t\t\t\tVersion: \"^3.15.6\",\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\tSPDXLicenseID: \"BSD-3-Clause\",\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigMavenYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"maven\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/grpc/java\")\n\trequire.NoError(t, err)\n\tpluginDep, err := bufremotepluginref.PluginReferenceForString(\"buf.build/protocolbuffers/java:v22.2\", 0)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:            pluginIdentity,\n\t\t\tDependencies:    []bufremotepluginref.PluginReference{pluginDep},\n\t\t\tPluginVersion:   \"v1.0.0\",\n\t\t\tOutputLanguages: []string{\"java\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tMaven: &MavenRegistryConfig{\n\t\t\t\t\tCompiler: MavenCompilerConfig{\n\t\t\t\t\t\tJava: MavenCompilerJavaConfig{\n\t\t\t\t\t\t\tEncoding: \"UTF-8\",\n\t\t\t\t\t\t\tRelease:  11,\n\t\t\t\t\t\t\tSource:   8,\n\t\t\t\t\t\t\tTarget:   17,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tKotlin: MavenCompilerKotlinConfig{\n\t\t\t\t\t\t\tAPIVersion:      \"1.8\",\n\t\t\t\t\t\t\tJVMTarget:       \"9\",\n\t\t\t\t\t\t\tLanguageVersion: \"1.7\",\n\t\t\t\t\t\t\tVersion:         \"1.8.0\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tDeps: []MavenDependencyConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\tArtifactID: \"grpc-core\",\n\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\tArtifactID: \"grpc-protobuf\",\n\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\tArtifactID: \"grpc-stub\",\n\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\tArtifactID: \"protoc-gen-grpc-java\",\n\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t\tClassifier: \"linux-x86_64\",\n\t\t\t\t\t\t\tExtension:  \"exe\",\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tAdditionalRuntimes: []MavenRuntimeConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: \"lite\",\n\t\t\t\t\t\t\tDeps: []MavenDependencyConfig{\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\t\t\tArtifactID: \"grpc-core\",\n\t\t\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\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\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\t\t\tArtifactID: \"grpc-protobuf-lite\",\n\t\t\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\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\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\t\t\tArtifactID: \"grpc-stub\",\n\t\t\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\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\t\tGroupID:    \"io.grpc\",\n\t\t\t\t\t\t\t\t\tArtifactID: \"protoc-gen-grpc-java\",\n\t\t\t\t\t\t\t\t\tVersion:    \"1.52.1\",\n\t\t\t\t\t\t\t\t\tClassifier: \"linux-x86_64\",\n\t\t\t\t\t\t\t\t\tExtension:  \"exe\",\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tOptions: []string{\n\t\t\t\t\t\t\t\t\"lite\",\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\tSPDXLicenseID: \"BSD-3-Clause\",\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigSwiftYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"swift\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/connectrpc/swift\")\n\trequire.NoError(t, err)\n\tpluginDep, err := bufremotepluginref.PluginReferenceForString(\"buf.build/apple/swift:v1.23.0\", 0)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:            pluginIdentity,\n\t\t\tPluginVersion:   \"v0.8.0\",\n\t\t\tSourceURL:       \"https://github.com/connectrpc/connect-swift\",\n\t\t\tDescription:     \"Idiomatic gRPC & Connect RPCs for Swift.\",\n\t\t\tDependencies:    []bufremotepluginref.PluginReference{pluginDep},\n\t\t\tOutputLanguages: []string{\"swift\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tSwift: &SwiftRegistryConfig{\n\t\t\t\t\tDependencies: []SwiftRegistryDependencyConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSource:        \"https://github.com/connectrpc/connect-swift.git\",\n\t\t\t\t\t\t\tPackage:       \"connect-swift\",\n\t\t\t\t\t\t\tVersion:       \"0.8.0\",\n\t\t\t\t\t\t\tProducts:      []string{\"Connect\"},\n\t\t\t\t\t\t\tSwiftVersions: []string{\".v5\"},\n\t\t\t\t\t\t\tPlatforms: SwiftRegistryDependencyPlatformConfig{\n\t\t\t\t\t\t\t\tMacOS: \"v10_15\",\n\t\t\t\t\t\t\t\tIOS:   \"v12\",\n\t\t\t\t\t\t\t\tTVOS:  \"v13\",\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\tSPDXLicenseID: \"Apache-2.0\",\n\t\t\tLicenseURL:    \"https://github.com/connectrpc/connect-swift/blob/0.8.0/LICENSE\",\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigPythonYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"python\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/community/nipunn1313-mypy\")\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:            pluginIdentity,\n\t\t\tPluginVersion:   \"v3.5.0\",\n\t\t\tSourceURL:       \"https://github.com/nipunn1313/mypy-protobuf\",\n\t\t\tDescription:     \"Generate mypy stub files from Protobuf definitions.\",\n\t\t\tSPDXLicenseID:   \"Apache-2.0\",\n\t\t\tLicenseURL:      \"https://github.com/nipunn1313/mypy-protobuf/blob/v3.5.0/LICENSE\",\n\t\t\tOutputLanguages: []string{\"python\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tPython: &PythonRegistryConfig{\n\t\t\t\t\tPackageType:    \"stub-only\",\n\t\t\t\t\tRequiresPython: \">=3.8\",\n\t\t\t\t\tDeps: []string{\n\t\t\t\t\t\t\"protobuf>=4.23.4\",\n\t\t\t\t\t\t\"types-protobuf>=4.23.0.2\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigCargoYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"cargo\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/community/neoeinstein-prost\")\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:            pluginIdentity,\n\t\t\tPluginVersion:   \"v0.3.1\",\n\t\t\tSourceURL:       \"https://github.com/neoeinstein/protoc-gen-prost\",\n\t\t\tDescription:     \"Generates code using the Prost! code generation engine.\",\n\t\t\tSPDXLicenseID:   \"Apache-2.0\",\n\t\t\tLicenseURL:      \"https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-v0.3.1/LICENSE\",\n\t\t\tOutputLanguages: []string{\"rust\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tCargo: &CargoRegistryConfig{\n\t\t\t\t\tRustVersion: \"1.60\",\n\t\t\t\t\tDeps: []CargoRegistryDependency{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName:               \"prost\",\n\t\t\t\t\t\t\tVersionRequirement: \"0.12.3\",\n\t\t\t\t\t\t\tDefaultFeatures:    true,\n\t\t\t\t\t\t\tFeatures:           []string{\"a-feature\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tOptions: map[string]string{\"enable_type_names\": \"true\"},\n\t\t\t},\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigNugetYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"nuget\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/grpc/csharp\")\n\trequire.NoError(t, err)\n\tdepPluginRef, err := bufremotepluginref.PluginReferenceForString(\"buf.build/protocolbuffers/csharp:v26.1\", 0)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:            pluginIdentity,\n\t\t\tPluginVersion:   \"v1.65.0\",\n\t\t\tDependencies:    []bufremotepluginref.PluginReference{depPluginRef},\n\t\t\tSourceURL:       \"https://github.com/grpc/grpc\",\n\t\t\tDescription:     \"Generates C# client and server stubs for the gRPC framework.\",\n\t\t\tSPDXLicenseID:   \"Apache-2.0\",\n\t\t\tLicenseURL:      \"https://github.com/grpc/grpc/blob/v1.65.0/LICENSE\",\n\t\t\tOutputLanguages: []string{\"csharp\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tNuget: &NugetRegistryConfig{\n\t\t\t\t\tTargetFrameworks: []string{\"netstandard2.0\", \"netstandard2.1\"},\n\t\t\t\t\tDeps: []NugetDependencyConfig{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName:    \"Grpc.Core.Api\",\n\t\t\t\t\t\t\tVersion: \"2.63.0\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName:             \"Grpc.Other.Api\",\n\t\t\t\t\t\t\tVersion:          \"1.0.31\",\n\t\t\t\t\t\t\tTargetFrameworks: []string{\"netstandard2.1\"},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tOptions: map[string]string{\"base_namespace\": \"\"},\n\t\t\t},\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigCmakeYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"cmake\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/grpc/cpp\")\n\trequire.NoError(t, err)\n\tdepPluginRef, err := bufremotepluginref.PluginReferenceForString(\"buf.build/protocolbuffers/cpp:v26.1\", 0)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:            pluginIdentity,\n\t\t\tPluginVersion:   \"v1.65.0\",\n\t\t\tDependencies:    []bufremotepluginref.PluginReference{depPluginRef},\n\t\t\tSourceURL:       \"https://github.com/grpc/grpc\",\n\t\t\tDescription:     \"Generates C++ client and server stubs for the gRPC framework.\",\n\t\t\tSPDXLicenseID:   \"Apache-2.0\",\n\t\t\tLicenseURL:      \"https://github.com/grpc/grpc/blob/v1.65.0/LICENSE\",\n\t\t\tOutputLanguages: []string{\"cpp\"},\n\t\t\tRegistry: &RegistryConfig{\n\t\t\t\tCmake:   &CmakeRegistryConfig{},\n\t\t\t\tOptions: nil,\n\t\t\t},\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigOptionsYAML(t *testing.T) {\n\tt.Parallel()\n\tpluginConfig, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"options\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tpluginIdentity, err := bufremotepluginref.PluginIdentityForString(\"buf.build/protocolbuffers/java\")\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t&Config{\n\t\t\tName:          pluginIdentity,\n\t\t\tPluginVersion: \"v2.0.0\",\n\t\t},\n\t\tpluginConfig,\n\t)\n}\n\nfunc TestParsePluginConfigMultipleRegistryConfigsYAML(t *testing.T) {\n\tt.Parallel()\n\t_, err := ParseConfig(filepath.Join(\"testdata\", \"failure\", \"invalid-multiple-registries.yaml\"))\n\trequire.Error(t, err)\n}\n\nfunc TestParsePluginConfigEmptyVersionYAML(t *testing.T) {\n\tt.Parallel()\n\t_, err := ParseConfig(filepath.Join(\"testdata\", \"failure\", \"invalid-empty-version.yaml\"))\n\trequire.Error(t, err)\n}\n\nfunc TestParsePluginConfigGoNoDepsOrMinVersion(t *testing.T) {\n\tt.Parallel()\n\tcfg, err := ParseConfig(filepath.Join(\"testdata\", \"success\", \"go-empty-registry\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\tassert.NotNil(t, cfg.Registry)\n\tassert.NotNil(t, cfg.Registry.Go)\n\tassert.Equal(t, &GoRegistryConfig{}, cfg.Registry.Go)\n}\n\nfunc TestPluginOptionsRoundTrip(t *testing.T) {\n\tt.Parallel()\n\tassertPluginOptionsRoundTrip(t, nil)\n\tassertPluginOptionsRoundTrip(t, map[string]string{})\n\tassertPluginOptionsRoundTrip(t, map[string]string{\n\t\t\"option-1\":          \"value-1\",\n\t\t\"option-2\":          \"value-2\",\n\t\t\"option-no-value-3\": \"\",\n\t})\n}\n\nfunc assertPluginOptionsRoundTrip(t testing.TB, options map[string]string) {\n\toptionsSlice := PluginOptionsToOptionsSlice(options)\n\tassert.True(t, sort.SliceIsSorted(optionsSlice, func(i, j int) bool {\n\t\treturn optionsSlice[i] < optionsSlice[j]\n\t}))\n\tassert.Equal(t, options, OptionsSliceToPluginOptions(optionsSlice))\n}\n\nfunc TestGetConfigForDataInvalidDependency(t *testing.T) {\n\tt.Parallel()\n\tvalidConfig, err := os.ReadFile(filepath.Join(\"testdata\", \"success\", \"go\", \"buf.plugin.yaml\"))\n\trequire.NoError(t, err)\n\t// Valid dependencies\n\tverifyDependencies(t, validConfig, false, ExternalDependency{Plugin: \"buf.build/library/go:v1.27.1\"})\n\tverifyDependencies(t, validConfig, false, ExternalDependency{Plugin: \"buf.build/library/go:v1.27.1-rc.1\"})\n\t// Invalid dependencies\n\tverifyDependencies(t, validConfig, true, ExternalDependency{Plugin: \"library/go:v1.28.0\"})\n\tverifyDependencies(t, validConfig, true, ExternalDependency{Plugin: \"buf.build/library/go\"})\n\tverifyDependencies(t, validConfig, true, ExternalDependency{Plugin: \"other.buf.build/library/go:v1.28.0\"})\n\tverifyDependencies(t, validConfig, true, ExternalDependency{Plugin: \"buf.build/library/go:1.28.0\"})\n\tverifyDependencies(t, validConfig, true, ExternalDependency{Plugin: \"buf.build/library/go:v1.28.0\", Revision: -1})\n\tverifyDependencies(t, validConfig, true, ExternalDependency{Plugin: \"buf.build/library/go:v1.28.0\", Revision: math.MaxInt32 + 1})\n\t// duplicate dependencies (doesn't matter if version differs)\n\tverifyDependencies(t, validConfig, true, ExternalDependency{Plugin: \"buf.build/library/go:v1.28.0\"}, ExternalDependency{Plugin: \"buf.build/library/go:v1.27.0\", Revision: 1})\n}\n\nfunc verifyDependencies(t testing.TB, validConfigBytes []byte, fail bool, invalidDependencies ...ExternalDependency) {\n\tt.Helper()\n\t// make a defensive copy of a valid parsed config\n\tvar cloned *ExternalConfig\n\terr := yaml.Unmarshal(validConfigBytes, &cloned)\n\trequire.NoError(t, err)\n\tcloned.Deps = slices.Clone(invalidDependencies)\n\tyamlBytes, err := yaml.Marshal(cloned)\n\trequire.NoError(t, err)\n\t_, err = GetConfigForData(t.Context(), yamlBytes)\n\tif fail {\n\t\tassert.Error(t, err)\n\t} else {\n\t\tassert.NoError(t, err)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginconfig\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"slices\"\n\t\"strings\"\n\n\t\"buf.build/go/spdx\"\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"golang.org/x/mod/modfile\"\n\t\"golang.org/x/mod/semver\"\n)\n\nfunc newConfig(externalConfig ExternalConfig, options []ConfigOption) (*Config, error) {\n\topts := &configOptions{}\n\tfor _, option := range options {\n\t\toption(opts)\n\t}\n\tpluginIdentity, err := pluginIdentityForStringWithOverrideRemote(externalConfig.Name, opts.overrideRemote)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpluginVersion := externalConfig.PluginVersion\n\tif pluginVersion == \"\" {\n\t\treturn nil, errors.New(\"a plugin_version is required\")\n\t}\n\tif !semver.IsValid(pluginVersion) {\n\t\treturn nil, fmt.Errorf(\"plugin_version %q must be a valid semantic version\", externalConfig.PluginVersion)\n\t}\n\tvar dependencies []bufremotepluginref.PluginReference\n\tif len(externalConfig.Deps) > 0 {\n\t\texistingDeps := make(map[string]struct{})\n\t\tfor _, dependency := range externalConfig.Deps {\n\t\t\treference, err := pluginReferenceForStringWithOverrideRemote(dependency.Plugin, dependency.Revision, opts.overrideRemote)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif reference.Remote() != pluginIdentity.Remote() {\n\t\t\t\treturn nil, fmt.Errorf(\"plugin dependency %q must use same remote as plugin %q\", dependency, pluginIdentity.Remote())\n\t\t\t}\n\t\t\tif _, ok := existingDeps[reference.IdentityString()]; ok {\n\t\t\t\treturn nil, fmt.Errorf(\"plugin dependency %q was specified more than once\", dependency)\n\t\t\t}\n\t\t\texistingDeps[reference.IdentityString()] = struct{}{}\n\t\t\tdependencies = append(dependencies, reference)\n\t\t}\n\t}\n\tregistryConfig, err := newRegistryConfig(externalConfig.Registry, dependencies, opts.overrideRemote)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tspdxLicenseID := externalConfig.SPDXLicenseID\n\tif spdxLicenseID != \"\" {\n\t\tif license, ok := spdx.LicenseForID(spdxLicenseID); ok {\n\t\t\tspdxLicenseID = license.ID\n\t\t} else {\n\t\t\treturn nil, fmt.Errorf(\"unknown SPDX License ID %q\", spdxLicenseID)\n\t\t}\n\t}\n\treturn &Config{\n\t\tName:                pluginIdentity,\n\t\tPluginVersion:       pluginVersion,\n\t\tDependencies:        dependencies,\n\t\tRegistry:            registryConfig,\n\t\tSourceURL:           externalConfig.SourceURL,\n\t\tDescription:         externalConfig.Description,\n\t\tOutputLanguages:     externalConfig.OutputLanguages,\n\t\tSPDXLicenseID:       spdxLicenseID,\n\t\tLicenseURL:          externalConfig.LicenseURL,\n\t\tIntegrationGuideURL: externalConfig.IntegrationGuideURL,\n\t\tDeprecated:          externalConfig.Deprecated,\n\t}, nil\n}\n\nfunc newRegistryConfig(\n\texternalRegistryConfig ExternalRegistryConfig,\n\tpluginDependencies []bufremotepluginref.PluginReference,\n\toverrideRemote string,\n) (*RegistryConfig, error) {\n\tvar (\n\t\tisGoEmpty     = externalRegistryConfig.Go == nil\n\t\tisNPMEmpty    = externalRegistryConfig.NPM == nil\n\t\tisMavenEmpty  = externalRegistryConfig.Maven == nil\n\t\tisSwiftEmpty  = externalRegistryConfig.Swift == nil\n\t\tisPythonEmpty = externalRegistryConfig.Python == nil\n\t\tisCargoEmpty  = externalRegistryConfig.Cargo == nil\n\t\tisNugetEmpty  = externalRegistryConfig.Nuget == nil\n\t\tisCmakeEmpty  = externalRegistryConfig.Cmake == nil\n\t)\n\tvar registryCount int\n\tfor _, isEmpty := range []bool{\n\t\tisGoEmpty,\n\t\tisNPMEmpty,\n\t\tisMavenEmpty,\n\t\tisSwiftEmpty,\n\t\tisPythonEmpty,\n\t\tisCargoEmpty,\n\t\tisNugetEmpty,\n\t\tisCmakeEmpty,\n\t} {\n\t\tif !isEmpty {\n\t\t\tregistryCount++\n\t\t}\n\t\tif registryCount > 1 {\n\t\t\t// We might eventually want to support multiple runtime configuration,\n\t\t\t// but it's safe to start with an error for now.\n\t\t\treturn nil, fmt.Errorf(\"%s configuration contains multiple registry configurations\", ExternalConfigFilePath)\n\t\t}\n\t}\n\tif registryCount == 0 {\n\t\t// It's possible that the plugin doesn't have any runtime dependencies.\n\t\treturn nil, nil\n\t}\n\toptions := OptionsSliceToPluginOptions(externalRegistryConfig.Opts)\n\tswitch {\n\tcase !isGoEmpty:\n\t\tgoRegistryConfig, err := newGoRegistryConfig(externalRegistryConfig.Go, pluginDependencies, overrideRemote)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tGo:      goRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tcase !isNPMEmpty:\n\t\tnpmRegistryConfig, err := newNPMRegistryConfig(externalRegistryConfig.NPM)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tNPM:     npmRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tcase !isMavenEmpty:\n\t\tmavenRegistryConfig, err := newMavenRegistryConfig(externalRegistryConfig.Maven)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tMaven:   mavenRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tcase !isSwiftEmpty:\n\t\tswiftRegistryConfig, err := newSwiftRegistryConfig(externalRegistryConfig.Swift)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tSwift:   swiftRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tcase !isPythonEmpty:\n\t\tpythonRegistryConfig, err := newPythonRegistryConfig(externalRegistryConfig.Python)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tPython:  pythonRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tcase !isCargoEmpty:\n\t\tcargoRegistryConfig, err := newCargoRegistryConfig(externalRegistryConfig.Cargo)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tCargo:   cargoRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tcase !isNugetEmpty:\n\t\tnugetRegistryConfig, err := newNugetRegistryConfig(externalRegistryConfig.Nuget)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tNuget:   nugetRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tcase !isCmakeEmpty:\n\t\tcmakeRegistryConfig, err := newCmakeRegistryConfig(externalRegistryConfig.Cmake)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn &RegistryConfig{\n\t\t\tCmake:   cmakeRegistryConfig,\n\t\t\tOptions: options,\n\t\t}, nil\n\tdefault:\n\t\treturn nil, errors.New(\"unknown registry configuration\")\n\t}\n}\n\nfunc newNPMRegistryConfig(externalNPMRegistryConfig *ExternalNPMRegistryConfig) (*NPMRegistryConfig, error) {\n\tif externalNPMRegistryConfig == nil {\n\t\treturn nil, nil\n\t}\n\tvar dependencies []*NPMRegistryDependencyConfig\n\tfor _, dep := range externalNPMRegistryConfig.Deps {\n\t\tif dep.Package == \"\" {\n\t\t\treturn nil, errors.New(\"npm runtime dependency requires a non-empty package name\")\n\t\t}\n\t\tif dep.Version == \"\" {\n\t\t\treturn nil, errors.New(\"npm runtime dependency requires a non-empty version name\")\n\t\t}\n\t\t// TODO: Note that we don't have NPM-specific validation yet - any\n\t\t// non-empty string will work for the package and version.\n\t\t//\n\t\t// For a complete set of the version syntax we need to support, see\n\t\t// https://docs.npmjs.com/cli/v6/using-npm/semver\n\t\t//\n\t\t// https://github.com/Masterminds/semver might be a good candidate for\n\t\t// this, but it might not support all of the constraints supported\n\t\t// by NPM.\n\t\tdependencies = append(\n\t\t\tdependencies,\n\t\t\t&NPMRegistryDependencyConfig{\n\t\t\t\tPackage: dep.Package,\n\t\t\t\tVersion: dep.Version,\n\t\t\t},\n\t\t)\n\t}\n\tswitch externalNPMRegistryConfig.ImportStyle {\n\tcase \"module\", \"commonjs\":\n\tdefault:\n\t\treturn nil, errors.New(`npm registry config import_style must be one of: \"module\" or \"commonjs\"`)\n\t}\n\treturn &NPMRegistryConfig{\n\t\tRewriteImportPathSuffix: externalNPMRegistryConfig.RewriteImportPathSuffix,\n\t\tDeps:                    dependencies,\n\t\tImportStyle:             externalNPMRegistryConfig.ImportStyle,\n\t}, nil\n}\n\nfunc newGoRegistryConfig(\n\texternalGoRegistryConfig *ExternalGoRegistryConfig,\n\tpluginDependencies []bufremotepluginref.PluginReference,\n\toverrideRemote string,\n) (*GoRegistryConfig, error) {\n\tif externalGoRegistryConfig == nil {\n\t\treturn nil, nil\n\t}\n\tif externalGoRegistryConfig.MinVersion != \"\" && !modfile.GoVersionRE.MatchString(externalGoRegistryConfig.MinVersion) {\n\t\treturn nil, fmt.Errorf(\"the go minimum version %q must be a valid semantic version in the form of <major>.<minor>\", externalGoRegistryConfig.MinVersion)\n\t}\n\tvar runtimeDependencies []*GoRegistryDependencyConfig\n\tfor _, dep := range externalGoRegistryConfig.Deps {\n\t\tif dep.Module == \"\" {\n\t\t\treturn nil, errors.New(\"go runtime dependency requires a non-empty module name\")\n\t\t}\n\t\tif dep.Version == \"\" {\n\t\t\treturn nil, errors.New(\"go runtime dependency requires a non-empty version name\")\n\t\t}\n\t\tif !semver.IsValid(dep.Version) {\n\t\t\treturn nil, fmt.Errorf(\"go runtime dependency %s:%s does not have a valid semantic version\", dep.Module, dep.Version)\n\t\t}\n\t\truntimeDependencies = append(\n\t\t\truntimeDependencies,\n\t\t\t&GoRegistryDependencyConfig{\n\t\t\t\tModule:  dep.Module,\n\t\t\t\tVersion: dep.Version,\n\t\t\t},\n\t\t)\n\t}\n\tvar basePlugin bufremotepluginref.PluginIdentity\n\tif externalGoRegistryConfig.BasePlugin != \"\" {\n\t\tvar err error\n\t\tbasePlugin, err = pluginIdentityForStringWithOverrideRemote(externalGoRegistryConfig.BasePlugin, overrideRemote)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse base plugin: %w\", err)\n\t\t}\n\t\t// Validate the base plugin is included as one of the plugin dependencies when both are\n\t\t// specified. This ensures there's exactly one base type and it has a known dependency to\n\t\t// generate imports correctly and build a correct Go mod file.\n\t\tif len(pluginDependencies) > 0 {\n\t\t\tok := slices.ContainsFunc(pluginDependencies, func(ref bufremotepluginref.PluginReference) bool {\n\t\t\t\treturn ref.IdentityString() == basePlugin.IdentityString()\n\t\t\t})\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"base plugin %q not found in plugin dependencies\", externalGoRegistryConfig.BasePlugin)\n\t\t\t}\n\t\t}\n\t}\n\treturn &GoRegistryConfig{\n\t\tMinVersion: externalGoRegistryConfig.MinVersion,\n\t\tDeps:       runtimeDependencies,\n\t\tBasePlugin: basePlugin,\n\t}, nil\n}\n\nfunc newMavenRegistryConfig(externalMavenRegistryConfig *ExternalMavenRegistryConfig) (*MavenRegistryConfig, error) {\n\tif externalMavenRegistryConfig == nil {\n\t\treturn nil, nil\n\t}\n\tvar dependencies []MavenDependencyConfig\n\tfor _, externalDep := range externalMavenRegistryConfig.Deps {\n\t\tdep, err := mavenExternalDependencyToDependencyConfig(externalDep)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdependencies = append(dependencies, dep)\n\t}\n\tvar additionalRuntimes []MavenRuntimeConfig\n\tfor _, runtime := range externalMavenRegistryConfig.AdditionalRuntimes {\n\t\tvar deps []MavenDependencyConfig\n\t\tfor _, externalDep := range runtime.Deps {\n\t\t\tdep, err := mavenExternalDependencyToDependencyConfig(externalDep)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdeps = append(deps, dep)\n\t\t}\n\t\tconfig := MavenRuntimeConfig{\n\t\t\tName:    runtime.Name,\n\t\t\tDeps:    deps,\n\t\t\tOptions: runtime.Opts,\n\t\t}\n\t\tadditionalRuntimes = append(additionalRuntimes, config)\n\t}\n\treturn &MavenRegistryConfig{\n\t\tCompiler: MavenCompilerConfig{\n\t\t\tJava: MavenCompilerJavaConfig{\n\t\t\t\tEncoding: externalMavenRegistryConfig.Compiler.Java.Encoding,\n\t\t\t\tRelease:  externalMavenRegistryConfig.Compiler.Java.Release,\n\t\t\t\tSource:   externalMavenRegistryConfig.Compiler.Java.Source,\n\t\t\t\tTarget:   externalMavenRegistryConfig.Compiler.Java.Target,\n\t\t\t},\n\t\t\tKotlin: MavenCompilerKotlinConfig{\n\t\t\t\tAPIVersion:      externalMavenRegistryConfig.Compiler.Kotlin.APIVersion,\n\t\t\t\tJVMTarget:       externalMavenRegistryConfig.Compiler.Kotlin.JVMTarget,\n\t\t\t\tLanguageVersion: externalMavenRegistryConfig.Compiler.Kotlin.LanguageVersion,\n\t\t\t\tVersion:         externalMavenRegistryConfig.Compiler.Kotlin.Version,\n\t\t\t},\n\t\t},\n\t\tDeps:               dependencies,\n\t\tAdditionalRuntimes: additionalRuntimes,\n\t}, nil\n}\n\nfunc newSwiftRegistryConfig(externalSwiftRegistryConfig *ExternalSwiftRegistryConfig) (*SwiftRegistryConfig, error) {\n\tif externalSwiftRegistryConfig == nil {\n\t\treturn nil, nil\n\t}\n\tvar dependencies []SwiftRegistryDependencyConfig\n\tfor _, externalDependency := range externalSwiftRegistryConfig.Deps {\n\t\tdependency, err := swiftExternalDependencyToDependencyConfig(externalDependency)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdependencies = append(dependencies, dependency)\n\t}\n\treturn &SwiftRegistryConfig{\n\t\tDependencies: dependencies,\n\t}, nil\n}\n\nfunc swiftExternalDependencyToDependencyConfig(externalDep ExternalSwiftRegistryDependencyConfig) (SwiftRegistryDependencyConfig, error) {\n\tif externalDep.Source == \"\" {\n\t\treturn SwiftRegistryDependencyConfig{}, errors.New(\"swift runtime dependency requires a non-empty source\")\n\t}\n\tif externalDep.Package == \"\" {\n\t\treturn SwiftRegistryDependencyConfig{}, errors.New(\"swift runtime dependency requires a non-empty package name\")\n\t}\n\tif externalDep.Version == \"\" {\n\t\treturn SwiftRegistryDependencyConfig{}, errors.New(\"swift runtime dependency requires a non-empty version name\")\n\t}\n\t// Swift SemVers are typically not prefixed with a \"v\". The Golang semver library requires a \"v\" prefix.\n\tif !semver.IsValid(fmt.Sprintf(\"v%s\", externalDep.Version)) {\n\t\treturn SwiftRegistryDependencyConfig{}, fmt.Errorf(\"swift runtime dependency %s:%s does not have a valid semantic version\", externalDep.Package, externalDep.Version)\n\t}\n\treturn SwiftRegistryDependencyConfig{\n\t\tSource:        externalDep.Source,\n\t\tPackage:       externalDep.Package,\n\t\tVersion:       externalDep.Version,\n\t\tProducts:      externalDep.Products,\n\t\tSwiftVersions: externalDep.SwiftVersions,\n\t\tPlatforms: SwiftRegistryDependencyPlatformConfig{\n\t\t\tMacOS:   externalDep.Platforms.MacOS,\n\t\t\tIOS:     externalDep.Platforms.IOS,\n\t\t\tTVOS:    externalDep.Platforms.TVOS,\n\t\t\tWatchOS: externalDep.Platforms.WatchOS,\n\t\t},\n\t}, nil\n}\n\nfunc newPythonRegistryConfig(externalPythonRegistryConfig *ExternalPythonRegistryConfig) (*PythonRegistryConfig, error) {\n\tif externalPythonRegistryConfig == nil {\n\t\treturn nil, nil\n\t}\n\tvar dependencySpecifications []string\n\tfor _, externalDependencySpecification := range externalPythonRegistryConfig.Deps {\n\t\tif externalDependencySpecification == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"python registry config cannot have an empty dependency specification\")\n\t\t}\n\t\tdependencySpecifications = append(dependencySpecifications, externalDependencySpecification)\n\t}\n\tswitch externalPythonRegistryConfig.PackageType {\n\tcase \"runtime\", \"stub-only\":\n\tdefault:\n\t\treturn nil, errors.New(`python registry config package_type must be one of: \"runtime\" or \"stub-only\"`)\n\t}\n\treturn &PythonRegistryConfig{\n\t\tDeps:           dependencySpecifications,\n\t\tRequiresPython: externalPythonRegistryConfig.RequiresPython,\n\t\tPackageType:    externalPythonRegistryConfig.PackageType,\n\t}, nil\n}\n\nfunc newCargoRegistryConfig(externalCargoRegistryConfig *ExternalCargoRegistryConfig) (*CargoRegistryConfig, error) {\n\tif externalCargoRegistryConfig == nil {\n\t\treturn nil, nil\n\t}\n\tconfig := &CargoRegistryConfig{\n\t\tRustVersion: externalCargoRegistryConfig.RustVersion,\n\t}\n\tfor _, dependency := range externalCargoRegistryConfig.Deps {\n\t\tif dependency.Name == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"cargo registry dependency cannot have empty name\")\n\t\t}\n\t\tif dependency.VersionRequirement == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"cargo registry dependency cannot have empty req\")\n\t\t}\n\t\tconfig.Deps = append(config.Deps, CargoRegistryDependency(dependency))\n\t}\n\treturn config, nil\n}\n\nfunc newNugetRegistryConfig(externalConfig *ExternalNugetRegistryConfig) (*NugetRegistryConfig, error) {\n\tif len(externalConfig.TargetFrameworks) == 0 {\n\t\treturn nil, errors.New(\"nuget registry target frameworks required\")\n\t}\n\ttargetFrameworks, err := validateNugetTargetFrameworks(externalConfig.TargetFrameworks)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"nuget registry: %w\", err)\n\t}\n\tvar deps []NugetDependencyConfig\n\tif len(externalConfig.Deps) > 0 {\n\t\tdeps = make([]NugetDependencyConfig, 0, len(externalConfig.Deps))\n\t\tfor i, externalDep := range externalConfig.Deps {\n\t\t\tif externalDep.Name == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"nuget registry dependency %d: empty name\", i)\n\t\t\t}\n\t\t\tif externalDep.Version == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"nuget registry dependency %d: empty version\", i)\n\t\t\t}\n\t\t\tdepTargetFrameworks, err := validateNugetTargetFrameworks(externalDep.TargetFrameworks)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"nuget registry dependency %d: %w\", i, err)\n\t\t\t}\n\t\t\tdeps = append(deps, NugetDependencyConfig{\n\t\t\t\tName:             externalDep.Name,\n\t\t\t\tVersion:          externalDep.Version,\n\t\t\t\tTargetFrameworks: depTargetFrameworks,\n\t\t\t})\n\t\t}\n\t}\n\treturn &NugetRegistryConfig{\n\t\tTargetFrameworks: targetFrameworks,\n\t\tDeps:             deps,\n\t}, nil\n}\n\nfunc validateNugetTargetFrameworks(targetFrameworks []string) ([]string, error) {\n\tif len(targetFrameworks) == 0 {\n\t\treturn nil, nil\n\t}\n\tif dups := xslices.Duplicates(targetFrameworks); len(dups) > 0 {\n\t\treturn nil, fmt.Errorf(\"duplicate target frameworks: %v\", dups)\n\t}\n\tfor i, targetFramework := range targetFrameworks {\n\t\tif err := validateNugetTargetFramework(targetFramework); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"target framework %d: %w\", i, err)\n\t\t}\n\t}\n\treturn slices.Clone(targetFrameworks), nil\n}\n\nfunc validateNugetTargetFramework(targetFramework string) error {\n\tswitch targetFramework {\n\tcase \"netstandard1.0\":\n\tcase \"netstandard1.1\":\n\tcase \"netstandard1.2\":\n\tcase \"netstandard1.3\":\n\tcase \"netstandard1.4\":\n\tcase \"netstandard1.5\":\n\tcase \"netstandard1.6\":\n\tcase \"netstandard2.0\":\n\tcase \"netstandard2.1\":\n\tcase \"net5.0\":\n\tcase \"net6.0\":\n\tcase \"net7.0\":\n\tcase \"net8.0\":\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid target framework: %q\", targetFramework)\n\t}\n\treturn nil\n}\n\nfunc newCmakeRegistryConfig(externalCmakeRegistryConfig *ExternalCmakeRegistryConfig) (*CmakeRegistryConfig, error) {\n\tif externalCmakeRegistryConfig == nil {\n\t\treturn nil, nil\n\t}\n\treturn &CmakeRegistryConfig{}, nil\n}\n\nfunc pluginIdentityForStringWithOverrideRemote(identityStr string, overrideRemote string) (bufremotepluginref.PluginIdentity, error) {\n\tidentity, err := bufremotepluginref.PluginIdentityForString(identityStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(overrideRemote) == 0 {\n\t\treturn identity, nil\n\t}\n\treturn bufremotepluginref.NewPluginIdentity(overrideRemote, identity.Owner(), identity.Plugin())\n}\n\nfunc pluginReferenceForStringWithOverrideRemote(\n\treferenceStr string,\n\trevision int,\n\toverrideRemote string,\n) (bufremotepluginref.PluginReference, error) {\n\treference, err := bufremotepluginref.PluginReferenceForString(referenceStr, revision)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(overrideRemote) == 0 {\n\t\treturn reference, nil\n\t}\n\toverrideIdentity, err := pluginIdentityForStringWithOverrideRemote(reference.IdentityString(), overrideRemote)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn bufremotepluginref.NewPluginReference(overrideIdentity, reference.Version(), reference.Revision())\n}\n\nfunc mavenExternalDependencyToDependencyConfig(dependency string) (MavenDependencyConfig, error) {\n\t// <groupId>:<artifactId>:<version>[:<classifier>][@<type>]\n\tdependencyWithoutExtension, extension, _ := strings.Cut(dependency, \"@\")\n\tcomponents := strings.Split(dependencyWithoutExtension, \":\")\n\tif len(components) < 3 {\n\t\treturn MavenDependencyConfig{}, fmt.Errorf(\"invalid dependency %q: missing required groupId:artifactId:version fields\", dependency)\n\t}\n\tif len(components) > 4 {\n\t\treturn MavenDependencyConfig{}, fmt.Errorf(\"invalid dependency %q: maximum 4 fields before optional type\", dependency)\n\t}\n\tconfig := MavenDependencyConfig{\n\t\tGroupID:    components[0],\n\t\tArtifactID: components[1],\n\t\tVersion:    components[2],\n\t\tExtension:  extension,\n\t}\n\tif len(components) == 4 {\n\t\tconfig.Classifier = components[3]\n\t}\n\treturn config, nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/get.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginconfig\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\n\t\"buf.build/go/standard/xstrings\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\nfunc getConfigForBucket(ctx context.Context, readBucket storage.ReadBucket, options []ConfigOption) (_ *Config, retErr error) {\n\t// This will be in the order of precedence.\n\tvar foundConfigFilePaths []string\n\t// Go through all valid config file paths and see which ones are present.\n\t// If none are present, return the default config.\n\t// If multiple are present, error.\n\tfor _, configFilePath := range AllConfigFilePaths {\n\t\texists, err := storage.Exists(ctx, readBucket, configFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif exists {\n\t\t\tfoundConfigFilePaths = append(foundConfigFilePaths, configFilePath)\n\t\t}\n\t}\n\tswitch len(foundConfigFilePaths) {\n\tcase 0:\n\t\t// Did not find anything, return the default.\n\t\treturn newConfig(ExternalConfig{}, options)\n\tcase 1:\n\t\treadObjectCloser, err := readBucket.Get(ctx, foundConfigFilePaths[0])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tdefer func() {\n\t\t\tretErr = errors.Join(retErr, readObjectCloser.Close())\n\t\t}()\n\t\tdata, err := io.ReadAll(readObjectCloser)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn getConfigForDataInternal(\n\t\t\tctx,\n\t\t\tencoding.UnmarshalYAMLNonStrict,\n\t\t\tencoding.UnmarshalYAMLStrict,\n\t\t\tdata,\n\t\t\treadObjectCloser.ExternalPath(),\n\t\t\toptions,\n\t\t)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"only one plugin file can exist but found multiple plugin files: %s\", xstrings.SliceToString(foundConfigFilePaths))\n\t}\n}\n\nfunc getConfigForData(ctx context.Context, data []byte, options []ConfigOption) (_ *Config, retErr error) {\n\treturn getConfigForDataInternal(\n\t\tctx,\n\t\tencoding.UnmarshalJSONOrYAMLNonStrict,\n\t\tencoding.UnmarshalJSONOrYAMLStrict,\n\t\tdata,\n\t\t\"Plugin configuration data\",\n\t\toptions,\n\t)\n}\n\nfunc getConfigForDataInternal(\n\tctx context.Context,\n\tunmarshalNonStrict func([]byte, any) error,\n\tunmarshalStrict func([]byte, any) error,\n\tdata []byte,\n\tid string,\n\toptions []ConfigOption,\n) (*Config, error) {\n\tvar externalConfigVersion externalConfigVersion\n\tif err := unmarshalNonStrict(data, &externalConfigVersion); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := validateExternalConfigVersion(externalConfigVersion, id); err != nil {\n\t\treturn nil, err\n\t}\n\tvar externalConfig ExternalConfig\n\tif err := unmarshalStrict(data, &externalConfig); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newConfig(externalConfig, options)\n}\n\nfunc validateExternalConfigVersion(externalConfigVersion externalConfigVersion, id string) error {\n\tswitch externalConfigVersion.Version {\n\tcase \"\":\n\t\treturn fmt.Errorf(\n\t\t\t`%s has no version set. Please add \"version: %s\"`,\n\t\t\tid,\n\t\t\tV1Version,\n\t\t)\n\tcase V1Version:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\n\t\t\t`%s has an invalid \"version: %s\" set. Please add \"version: %s\"`,\n\t\t\tid,\n\t\t\texternalConfigVersion.Version,\n\t\t\tV1Version,\n\t\t)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/failure/invalid-empty-plugin-version.yaml",
    "content": "version: v1\nname: buf.build/protocolbuffers/go\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/failure/invalid-empty-version.yaml",
    "content": "version:\nname: buf.build/protocolbuffers/go\nplugin_version: v1.5.0\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/failure/invalid-multiple-registries.yaml",
    "content": "version: v1\nname: buf.build/protocolbuffers/go\nplugin_version: v1.5.0\nregistry:\n  npm:\n    deps:\n      - package: @types/google-protobuf\n        version: ^3.15.6\n  go:\n    min_version: 1.18\n  maven:\n    deps:\n      - group_id: \"io.grpc\"\n        artifact_id: \"grpc-protobuf\"\n        version: \"1.52.1\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/failure/invalid-plugin-version.yaml",
    "content": "version: v1\nname: buf.build/protocolbuffers/go\nplugin_version: foo\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/cargo/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/community/neoeinstein-prost\nplugin_version: v0.3.1\nsource_url: https://github.com/neoeinstein/protoc-gen-prost\ndescription: Generates code using the Prost! code generation engine.\noutput_languages:\n  - rust\nspdx_license_id: Apache-2.0\nlicense_url: https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-v0.3.1/LICENSE\nregistry:\n  # NOTE: This configuration does not perfectly match with the version in\n  # plugins, because we want values to be set to check for round-tripping.\n  cargo:\n    # https://github.com/neoeinstein/protoc-gen-prost/blob/protoc-gen-prost-v0.3.1/protoc-gen-prost/Cargo.toml#L21\n    # https://github.com/tokio-rs/prost/blob/v0.12.3/prost-build/Cargo.toml#L15\n    rust_version: \"1.60\"\n    deps:\n      # https://github.com/tokio-rs/prost/blob/v0.12.3/prost-build/Cargo.toml#L30\n      - name: prost\n        req: \"0.12.3\"\n        default_features: true\n        features: [\"a-feature\"]\n  # https://github.com/neoeinstein/protoc-gen-prost/tree/protoc-gen-prost-v0.3.1/protoc-gen-prost#options\n  opts:\n    # `Any` support.\n    - enable_type_names=true\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/cmake/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/grpc/cpp\nplugin_version: v1.65.0\nsource_url: https://github.com/grpc/grpc\ndescription: Generates C++ client and server stubs for the gRPC framework.\ndeps:\n  - plugin: buf.build/protocolbuffers/cpp:v26.1\noutput_languages:\n  - cpp\nspdx_license_id: Apache-2.0\nlicense_url: https://github.com/grpc/grpc/blob/v1.65.0/LICENSE\nregistry:\n  cmake: {}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/go/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/library/go-grpc\nplugin_version: v1.2.0\nsource_url: https://github.com/grpc/grpc-go\ndescription: Generates Go language bindings of services in protobuf definition files for gRPC.\ndeps:\n  - plugin: buf.build/library/go:v1.28.0\n    revision: 1\noutput_languages: [go]\nregistry:\n  go:\n    base_plugin: buf.build/library/go\n    min_version: 1.18\n    deps:\n      - module: google.golang.org/grpc\n        version: v1.32.0\n  opts:\n    - separate_package=true\nspdx_license_id: Apache-2.0\nlicense_url: https://github.com/grpc/grpc-go/blob/master/LICENSE\nintegration_guide_url: https://grpc.io/docs/languages/go/quickstart\ndeprecated: true\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/go-empty-registry/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/library/go\nplugin_version: v1.28.1\noutput_languages: [go]\nregistry:\n  go: {}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/maven/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/grpc/java\nplugin_version: v1.0.0\noutput_languages: [java]\ndeps:\n  - plugin: buf.build/protocolbuffers/java:v22.2\nregistry:\n  maven:\n    compiler:\n      java:\n        encoding: UTF-8\n        release: 11\n        source: 8\n        target: 17\n      kotlin:\n        api_version: 1.8\n        jvm_target: 9\n        language_version: 1.7\n        version: 1.8.0\n    deps:\n      - \"io.grpc:grpc-core:1.52.1\"\n      - \"io.grpc:grpc-protobuf:1.52.1\"\n      - \"io.grpc:grpc-stub:1.52.1\"\n      - \"io.grpc:protoc-gen-grpc-java:1.52.1:linux-x86_64@exe\"\n    additional_runtimes:\n      - name: lite\n        deps:\n          - \"io.grpc:grpc-core:1.52.1\"\n          - \"io.grpc:grpc-protobuf-lite:1.52.1\"\n          - \"io.grpc:grpc-stub:1.52.1\"\n          - \"io.grpc:protoc-gen-grpc-java:1.52.1:linux-x86_64@exe\"\n        opts:\n          - lite\nspdx_license_id: bsd-3-clause\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/npm/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/protocolbuffers/js\nplugin_version: v1.0.0\noutput_languages: [typescript]\nregistry:\n  npm:\n    import_style: commonjs\n    deps:\n      - package: \"grpc-web\"\n        version: \"^1.3.1\"\n      - package: \"@types/google-protobuf\"\n        version: \"^3.15.6\"\nspdx_license_id: bsd-3-clause\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/nuget/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/grpc/csharp\nplugin_version: v1.65.0\nsource_url: https://github.com/grpc/grpc\ndescription: Generates C# client and server stubs for the gRPC framework.\ndeps:\n  - plugin: buf.build/protocolbuffers/csharp:v26.1\noutput_languages:\n  - csharp\nspdx_license_id: Apache-2.0\nlicense_url: https://github.com/grpc/grpc/blob/v1.65.0/LICENSE\nregistry:\n  nuget:\n    target_frameworks:\n      - netstandard2.0\n      - netstandard2.1\n    deps:\n      - name: Grpc.Core.Api\n        version: 2.63.0\n      - name: Grpc.Other.Api\n        version: 1.0.31\n        target_frameworks:\n          - netstandard2.1\n  opts:\n    - base_namespace=\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/options/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/protocolbuffers/java\nplugin_version: v2.0.0\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/python/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/community/nipunn1313-mypy\nplugin_version: v3.5.0\nsource_url: https://github.com/nipunn1313/mypy-protobuf\ndescription: Generate mypy stub files from Protobuf definitions.\nspdx_license_id: Apache-2.0\nlicense_url: https://github.com/nipunn1313/mypy-protobuf/blob/v3.5.0/LICENSE\noutput_languages:\n  - python\nregistry:\n  python:\n    package_type: \"stub-only\"\n    requires_python: \">=3.8\"\n    deps:\n      - \"protobuf>=4.23.4\"\n      - \"types-protobuf>=4.23.0.2\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/testdata/success/swift/buf.plugin.yaml",
    "content": "version: v1\nname: buf.build/connectrpc/swift\nplugin_version: v0.8.0\nsource_url: https://github.com/connectrpc/connect-swift\ndescription: Idiomatic gRPC & Connect RPCs for Swift.\ndeps:\n  - plugin: buf.build/apple/swift:v1.23.0\noutput_languages:\n  - swift\nregistry:\n  swift:\n    deps:\n      - source: https://github.com/connectrpc/connect-swift.git\n        package: connect-swift\n        products: [ Connect ]\n        swift_versions: [ \".v5\" ]\n        version: 0.8.0\n        platforms:\n          macos: v10_15\n          ios: v12\n          tvos: v13\nspdx_license_id: Apache-2.0\nlicense_url: https://github.com/connectrpc/connect-swift/blob/0.8.0/LICENSE\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginconfig/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufremotepluginconfig\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugindocker/bufremoteplugindocker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugindocker contains utilities for building Buf plugins using the Docker API.\npackage bufremoteplugindocker\n\n// ImagePath is the default location for the Docker image archive in a plugin zip file.\nconst ImagePath = \"image.tar\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugindocker/docker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugindocker\n\nimport (\n\t\"bufio\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginconfig\"\n\t\"github.com/moby/moby/api/types/jsonstream\"\n\t\"github.com/moby/moby/client\"\n\t\"github.com/moby/moby/client/pkg/stringid\"\n)\n\nconst (\n\t// BufUpstreamClientUserAgentPrefix is the user-agent prefix.\n\t//\n\t// Setting this value on the buf docker client allows us to propagate a custom\n\t// value to the OCI registry. This is a useful property that enables registries\n\t// to differentiate between the buf cli vs other tools like docker cli.\n\t// Note, this does not override the final User-Agent entirely, but instead adds\n\t// the value to the final outgoing User-Agent value in the form: [docker client's UA] UpstreamClient(buf-cli-1.11.0)\n\t//\n\t// Example: User-Agent = [docker/20.10.21 go/go1.18.7 git-commit/3056208 kernel/5.15.49-linuxkit os/linux arch/arm64 UpstreamClient(buf-cli-1.11.0)]\n\tBufUpstreamClientUserAgentPrefix = \"buf-cli-\"\n)\n\n// imageDigestRe is a regular expression for extracting the image digest from the output of a docker\n// push command. It is tightly coupled to the string representation because the stream response\n// itself is not very well defined.\n//\n// https://github.com/moby/moby/blob/1c282d1f1b90ff188a1b46f48548ac3151ca2ddf/daemon/containerd/image_push.go#L130\nvar imageDigestRe = regexp.MustCompile(`digest:\\s*(\\S+)`)\n\n// Client is a small abstraction over a Docker API client, providing the basic APIs we need to build plugins.\n// It ensures that we pass the appropriate parameters to build images (i.e. platform 'linux/amd64').\ntype Client interface {\n\t// Load imports a Docker image into the local Docker Engine.\n\tLoad(ctx context.Context, image io.Reader) (*LoadResponse, error)\n\t// Push the Docker image to the remote registry.\n\tPush(ctx context.Context, image string, auth *RegistryAuthConfig) (*PushResponse, error)\n\t// Delete removes the Docker image from local Docker Engine.\n\tDelete(ctx context.Context, image string) (*DeleteResponse, error)\n\t// Tag creates a Docker image tag from an existing image and plugin config.\n\tTag(ctx context.Context, image string, config *bufremotepluginconfig.Config) (*TagResponse, error)\n\t// Inspect inspects an image and returns the image id.\n\tInspect(ctx context.Context, image string) (*InspectResponse, error)\n\t// Close releases any resources used by the underlying Docker client.\n\tClose() error\n}\n\n// LoadResponse returns details of a successful load image call.\ntype LoadResponse struct {\n\t// ImageID specifies the Docker image id in the format <hash_algorithm>:<hash>.\n\t// Example: sha256:65001659f150f085e0b37b697a465a95cbfd885d9315b61960883b9ac588744e\n\tImageID string\n}\n\n// PushResponse is a placeholder for data to be returned from a successful image push call.\ntype PushResponse struct {\n\t// Digest specifies the Docker image digest in the format <hash_algorithm>:<hash>.\n\t// The digest returned from Client.Push differs from the image id returned in Client.Build.\n\tDigest string\n}\n\n// TagResponse returns details of a successful image tag call.\ntype TagResponse struct {\n\t// Image contains the Docker image name in the local Docker engine including the tag.\n\t// It is created from the bufremotepluginconfig.Config's Name.IdentityString() and a unique id.\n\tImage string\n}\n\n// DeleteResponse is a placeholder for data to be returned from a successful image delete call.\ntype DeleteResponse struct{}\n\n// InspectResponse returns the image id for a given image.\ntype InspectResponse struct {\n\t// ImageID contains the Docker image's ID.\n\tImageID string\n}\n\ntype dockerAPIClient struct {\n\tcli    *client.Client\n\tlogger *slog.Logger\n}\n\nvar _ Client = (*dockerAPIClient)(nil)\n\nfunc (d *dockerAPIClient) Load(ctx context.Context, image io.Reader) (_ *LoadResponse, retErr error) {\n\tresponse, err := d.cli.ImageLoad(ctx, image, client.ImageLoadWithQuiet(true))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tif err := response.Close(); err != nil {\n\t\t\tretErr = errors.Join(retErr, fmt.Errorf(\"docker load response body close error: %w\", err))\n\t\t}\n\t}()\n\timageID := \"\"\n\tresponseScanner := bufio.NewScanner(response)\n\tfor responseScanner.Scan() {\n\t\tvar jsonMessage jsonstream.Message\n\t\tif err := json.Unmarshal(responseScanner.Bytes(), &jsonMessage); err == nil {\n\t\t\t_, loadedImageID, found := strings.Cut(strings.TrimSpace(jsonMessage.Stream), \"Loaded image ID: \")\n\t\t\tif !found {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif !strings.HasPrefix(loadedImageID, \"sha256:\") {\n\t\t\t\td.logger.Warn(\"Unsupported image digest\", slog.String(\"imageID\", loadedImageID))\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\timageID = loadedImageID\n\t\t}\n\t}\n\tif err := responseScanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\tif imageID == \"\" {\n\t\treturn nil, fmt.Errorf(\"failed to determine image ID of loaded image\")\n\t}\n\treturn &LoadResponse{ImageID: imageID}, nil\n}\n\nfunc (d *dockerAPIClient) Tag(ctx context.Context, image string, config *bufremotepluginconfig.Config) (*TagResponse, error) {\n\tbuildID := stringid.GenerateRandomID()\n\timageName := config.Name.IdentityString() + \":\" + buildID\n\tif _, err := d.cli.ImageTag(ctx, client.ImageTagOptions{Source: image, Target: imageName}); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TagResponse{Image: imageName}, nil\n}\n\nfunc (d *dockerAPIClient) Push(ctx context.Context, image string, auth *RegistryAuthConfig) (response *PushResponse, retErr error) {\n\tregistryAuth, err := auth.ToHeader()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpushResponse, err := d.cli.ImagePush(ctx, image, client.ImagePushOptions{\n\t\tRegistryAuth: registryAuth,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, pushResponse.Close())\n\t}()\n\tvar imageDigest string\n\tpushScanner := bufio.NewScanner(pushResponse)\n\tfor pushScanner.Scan() {\n\t\td.logger.DebugContext(ctx, pushScanner.Text())\n\t\tvar message jsonstream.Message\n\t\tif err := json.Unmarshal([]byte(pushScanner.Text()), &message); err == nil {\n\t\t\tif message.Error != nil {\n\t\t\t\treturn nil, errors.New(message.Error.Message)\n\t\t\t}\n\t\t\timageDigest = getImageDigestFromMessage(message)\n\t\t}\n\t}\n\tif err := pushScanner.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\tif imageDigest == \"\" {\n\t\treturn nil, fmt.Errorf(\"failed to determine image digest after push\")\n\t}\n\td.logger.DebugContext(ctx, \"docker image digest\", slog.String(\"imageDigest\", imageDigest))\n\treturn &PushResponse{Digest: imageDigest}, nil\n}\n\nfunc getImageDigestFromMessage(message jsonstream.Message) string {\n\tif message.Aux != nil {\n\t\tvar pushResult struct{ Digest string }\n\t\tif err := json.Unmarshal(*message.Aux, &pushResult); err == nil {\n\t\t\treturn pushResult.Digest\n\t\t}\n\t}\n\t// If the message has no aux field, we fall back to parsing the status field.\n\tif message.Status != \"\" {\n\t\tif match := imageDigestRe.FindStringSubmatch(message.Status); len(match) > 1 {\n\t\t\treturn match[1]\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (d *dockerAPIClient) Delete(ctx context.Context, image string) (*DeleteResponse, error) {\n\t_, err := d.cli.ImageRemove(ctx, image, client.ImageRemoveOptions{})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &DeleteResponse{}, nil\n}\n\nfunc (d *dockerAPIClient) Inspect(ctx context.Context, image string) (*InspectResponse, error) {\n\tinspect, err := d.cli.ImageInspect(ctx, image)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &InspectResponse{ImageID: inspect.ID}, nil\n}\n\nfunc (d *dockerAPIClient) Close() error {\n\treturn d.cli.Close()\n}\n\n// NewClient creates a new Client to use to build Docker plugins.\nfunc NewClient(logger *slog.Logger, cliVersion string, options ...ClientOption) (Client, error) {\n\tif logger == nil {\n\t\treturn nil, errors.New(\"logger required\")\n\t}\n\topts := &clientOptions{}\n\tfor _, option := range options {\n\t\toption(opts)\n\t}\n\tdockerClientOpts := []client.Opt{\n\t\tclient.FromEnv,\n\t\tclient.WithHTTPHeaders(map[string]string{\n\t\t\t\"User-Agent\": BufUpstreamClientUserAgentPrefix + cliVersion,\n\t\t}),\n\t}\n\tif len(opts.host) > 0 {\n\t\tdockerClientOpts = append(dockerClientOpts, client.WithHost(opts.host))\n\t}\n\tif len(opts.version) > 0 {\n\t\tdockerClientOpts = append(dockerClientOpts, client.WithAPIVersion(opts.version))\n\t}\n\tcli, err := client.New(dockerClientOpts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &dockerAPIClient{\n\t\tcli:    cli,\n\t\tlogger: logger,\n\t}, nil\n}\n\ntype clientOptions struct {\n\thost    string\n\tversion string\n}\n\n// ClientOption defines options for the NewClient call to customize the underlying Docker client.\ntype ClientOption func(options *clientOptions)\n\n// WithHost allows specifying a Docker engine host to connect to (instead of the default lookup using DOCKER_HOST env var).\n// This makes it suitable for use by parallel tests.\nfunc WithHost(host string) ClientOption {\n\treturn func(options *clientOptions) {\n\t\toptions.host = host\n\t}\n}\n\n// WithVersion allows specifying a Docker API client version instead of using the default version negotiation algorithm.\n// This allows tests to implement the Docker engine API using stable URLs.\nfunc WithVersion(version string) ClientOption {\n\treturn func(options *clientOptions) {\n\t\toptions.version = version\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugindocker/docker_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugindocker\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"runtime\"\n\t\"slices\"\n\t\"strings\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\tdockerimage \"github.com/moby/moby/api/types/image\"\n\t\"github.com/moby/moby/api/types/jsonstream\"\n\t\"github.com/moby/moby/client\"\n\t\"github.com/moby/moby/client/pkg/stringid\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nconst (\n\tdockerVersion = \"1.41\"\n)\n\nvar imagePattern = regexp.MustCompile(\"^(?P<image>[^/]+/[^/]+/[^/:]+)(?::(?P<tag>[^/]+))?(?:/(?P<op>[^/]+))?$\")\n\nfunc TestPushSuccess(t *testing.T) {\n\tt.Parallel()\n\tserver := newDockerServer(t, dockerVersion)\n\tlistenerAddr := server.httpServer.Listener.Addr().String()\n\tdockerClient := createClient(t, WithHost(\"tcp://\"+listenerAddr), WithVersion(dockerVersion))\n\timage, err := buildDockerPlugin(t, \"testdata/success/Dockerfile\", listenerAddr+\"/library/go\")\n\trequire.Nilf(t, err, \"failed to build docker plugin\")\n\trequire.NotEmpty(t, image)\n\tpushResponse, err := dockerClient.Push(t.Context(), image, &RegistryAuthConfig{})\n\trequire.Nilf(t, err, \"failed to push docker plugin\")\n\trequire.NotNil(t, pushResponse)\n\tassert.NotEmpty(t, pushResponse.Digest)\n}\n\nfunc TestPushError(t *testing.T) {\n\tt.Parallel()\n\tserver := newDockerServer(t, dockerVersion)\n\t// Send back an error on ImagePush (still return 200 OK).\n\tserver.pushErr = errors.New(\"failed to push image\")\n\tlistenerAddr := server.httpServer.Listener.Addr().String()\n\tdockerClient := createClient(t, WithHost(\"tcp://\"+listenerAddr), WithVersion(dockerVersion))\n\timage, err := buildDockerPlugin(t, \"testdata/success/Dockerfile\", listenerAddr+\"/library/go\")\n\trequire.Nilf(t, err, \"failed to build docker plugin\")\n\trequire.NotEmpty(t, image)\n\t_, err = dockerClient.Push(t.Context(), image, &RegistryAuthConfig{})\n\trequire.NotNil(t, err, \"expected error\")\n\tassert.Equal(t, server.pushErr.Error(), err.Error())\n}\n\nfunc TestMain(m *testing.M) {\n\tvar dockerEnabled bool\n\tif cli, err := client.New(client.FromEnv); err == nil {\n\t\tctx, cancel := context.WithTimeout(context.Background(), time.Second)\n\t\tdefer cancel()\n\t\tif _, err := cli.Ping(ctx, client.PingOptions{}); err == nil {\n\t\t\tdockerEnabled = true\n\t\t}\n\t\t_ = cli.Close()\n\t}\n\tif dockerEnabled && runtime.GOOS == \"windows\" {\n\t\t// Windows runners don't support building Linux images - need to disable for now.\n\t\tdockerEnabled = false\n\t}\n\tif dockerEnabled {\n\t\tos.Exit(m.Run())\n\t}\n}\n\nfunc TestGetImageDigestFromMessage(t *testing.T) {\n\tt.Parallel()\n\tassertImageDigestFromStatusString(t,\n\t\t\"v1.4.0: digest: sha256:83189bf0fa178c5947af0bcfcf8b9e955c67bf13c4bea0eee145fbfc3e8398d8 size: 855\",\n\t\t\"sha256:83189bf0fa178c5947af0bcfcf8b9e955c67bf13c4bea0eee145fbfc3e8398d8\",\n\t)\n\tassertImageDigestFromStatusString(t,\n\t\t\"v1.4.0: digest: sha512:4b230b5e4e3518cf1f16e0a5d3293245cd6f27df350aed72c9eb59fc4b5b5ef764cb0aaea201ea70eab68ca7388533384c4d0e690eaba7f2cd7a0e8939db986f size: 855\", \"sha512:4b230b5e4e3518cf1f16e0a5d3293245cd6f27df350aed72c9eb59fc4b5b5ef764cb0aaea201ea70eab68ca7388533384c4d0e690eaba7f2cd7a0e8939db986f\",\n\t)\n\tassertImageDigestFromStatusString(t,\n\t\t\"digest: sha256:83189bf0fa178c5947af0bcfcf8b9e955c67bf13c4bea0eee145fbfc3e8398d8\",\n\t\t\"sha256:83189bf0fa178c5947af0bcfcf8b9e955c67bf13c4bea0eee145fbfc3e8398d8\",\n\t)\n\t// malformed, missing \"digest:\"\n\tassertImageDigestFromStatusString(t,\n\t\t\"sha256:83189bf0fa178c5947af0bcfcf8b9e955c67bf13c4bea0eee145fbfc3e8398d8\",\n\t\t\"\",\n\t)\n}\n\nfunc assertImageDigestFromStatusString(t *testing.T, status string, expectedDigest string) {\n\tt.Helper()\n\tdigest := getImageDigestFromMessage(jsonstream.Message{Status: status})\n\tassert.Equal(t, expectedDigest, digest)\n}\n\nfunc createClient(t testing.TB, options ...ClientOption) Client {\n\tt.Helper()\n\tdockerClient, err := NewClient(slogtestext.NewLogger(t), \"buf-cli-1.11.0\", options...)\n\trequire.Nilf(t, err, \"failed to create client\")\n\tt.Cleanup(func() {\n\t\tif err := dockerClient.Close(); err != nil {\n\t\t\tt.Errorf(\"failed to close client: %v\", err)\n\t\t}\n\t})\n\treturn dockerClient\n}\n\nfunc buildDockerPlugin(t testing.TB, dockerfilePath string, pluginIdentity string) (string, error) {\n\tt.Helper()\n\tdocker, err := exec.LookPath(\"docker\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\timageName := fmt.Sprintf(\"%s:%s\", pluginIdentity, stringid.GenerateRandomID())\n\tenvContainer, err := app.NewEnvContainerForOS()\n\trequire.NoError(t, err)\n\tif err := xexec.Run(\n\t\tt.Context(),\n\t\tdocker,\n\t\txexec.WithArgs(\"build\", \"-t\", imageName, \".\"),\n\t\txexec.WithDir(filepath.Dir(dockerfilePath)),\n\t\txexec.WithStdout(os.Stdout),\n\t\txexec.WithStderr(os.Stderr),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\treturn \"\", err\n\t}\n\tt.Logf(\"created image: %s\", imageName)\n\tt.Cleanup(func() {\n\t\tif err := xexec.Run(\n\t\t\tt.Context(),\n\t\t\tdocker,\n\t\t\txexec.WithArgs(\"rmi\", \"--force\", imageName),\n\t\t\txexec.WithDir(filepath.Dir(dockerfilePath)),\n\t\t\txexec.WithStdout(os.Stdout),\n\t\t\txexec.WithStderr(os.Stderr),\n\t\t); err != nil {\n\t\t\tt.Logf(\"failed to remove temporary docker image: %v\", err)\n\t\t}\n\t})\n\treturn imageName, nil\n}\n\n// dockerServer allows testing some failure flows by simulating the responses to Docker CLI commands.\ntype dockerServer struct {\n\thttpServer    *httptest.Server\n\tt             testing.TB\n\tversionPrefix string\n\tpushErr       error\n\t// protects builtImages\n\tmu           sync.RWMutex\n\tpushedImages map[string]*pushedImage\n}\n\ntype pushedImage struct {\n\ttags []string\n}\n\nfunc newDockerServer(t testing.TB, version string) *dockerServer {\n\tt.Helper()\n\tversionPrefix := \"/v\" + version\n\tdockerServer := &dockerServer{\n\t\tt:             t,\n\t\tpushedImages:  make(map[string]*pushedImage),\n\t\tversionPrefix: versionPrefix,\n\t}\n\tmux := http.NewServeMux()\n\tmux.HandleFunc(versionPrefix+\"/images/\", dockerServer.imagesHandler)\n\tmux.HandleFunc(\"/_ping\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"Api-Version\", version)\n\t\tw.WriteHeader(http.StatusOK)\n\t\tif _, err := w.Write([]byte(\"OK\")); err != nil {\n\t\t\tt.Fatalf(\"failed to write ping response: %v\", err)\n\t\t}\n\t})\n\tprotocols := new(http.Protocols)\n\tprotocols.SetHTTP1(true)\n\tprotocols.SetUnencryptedHTTP2(true)\n\tserver := httptest.NewUnstartedServer(mux)\n\tserver.Config.Protocols = protocols\n\tserver.Start()\n\tdockerServer.httpServer = server\n\tt.Cleanup(server.Close)\n\treturn dockerServer\n}\n\nfunc (d *dockerServer) imagesHandler(w http.ResponseWriter, r *http.Request) {\n\tif _, err := io.Copy(io.Discard, r.Body); err != nil {\n\t\td.t.Error(\"failed to discard body:\", err)\n\t}\n\tpathSuffix := strings.TrimPrefix(r.URL.Path, d.versionPrefix+\"/images/\")\n\tsubmatches := imagePattern.FindStringSubmatch(pathSuffix)\n\tif len(submatches) == 0 {\n\t\tw.WriteHeader(http.StatusBadRequest)\n\t\treturn\n\t}\n\timage, tag, operation := submatches[1], submatches[2], submatches[3]\n\t// ImageInspect\n\tif r.Method == http.MethodGet && operation == \"json\" {\n\t\td.mu.RLock()\n\t\tdefer d.mu.RUnlock()\n\t\tfoundImageID := d.findImageIDFromName(image + \":\" + tag)\n\t\tif len(foundImageID) == 0 {\n\t\t\thttp.NotFound(w, r)\n\t\t\treturn\n\t\t}\n\t\tif err := json.NewEncoder(w).Encode(&dockerimage.InspectResponse{\n\t\t\tID:       \"sha256:\" + foundImageID,\n\t\t\tRepoTags: d.pushedImages[foundImageID].tags,\n\t\t}); err != nil {\n\t\t\td.t.Error(\"failed to encode image inspect response:\", err)\n\t\t}\n\t\treturn\n\t}\n\t// ImageRemove\n\tif r.Method == http.MethodDelete {\n\t\td.mu.Lock()\n\t\tdefer d.mu.Unlock()\n\t\tfoundImageID := d.findImageIDFromName(image + \":\" + tag)\n\t\tif len(foundImageID) == 0 {\n\t\t\thttp.NotFound(w, r)\n\t\t\treturn\n\t\t}\n\t\tdelete(d.pushedImages, foundImageID)\n\t\tif err := json.NewEncoder(w).Encode([]dockerimage.DeleteResponse{\n\t\t\t{Deleted: \"sha256:\" + foundImageID},\n\t\t}); err != nil {\n\t\t\td.t.Error(\"failed to encode image delete response:\", err)\n\t\t}\n\t\treturn\n\t}\n\t// ImagePush\n\tw.WriteHeader(http.StatusOK)\n\tif d.pushErr != nil {\n\t\td.writeError(w, d.pushErr)\n\t\treturn\n\t}\n\td.mu.Lock()\n\tdefer d.mu.Unlock()\n\tif _, ok := d.pushedImages[image]; !ok {\n\t\td.pushedImages[image] = &pushedImage{}\n\t}\n\timageTag := r.URL.Query()[\"tag\"][0]\n\td.pushedImages[image].tags = append(d.pushedImages[image].tags, imageTag)\n\tauxJSON, err := json.Marshal(map[string]any{\n\t\t\"Tag\":    imageTag,\n\t\t\"Digest\": \"sha256:\" + stringid.GenerateRandomID(),\n\t\t\"Size\":   123,\n\t})\n\tif err != nil {\n\t\td.writeError(w, err)\n\t\treturn\n\t}\n\tif err := json.NewEncoder(w).Encode(&jsonstream.Message{\n\t\tProgress: &jsonstream.Progress{},\n\t\tAux:      (*json.RawMessage)(&auxJSON),\n\t}); err != nil {\n\t\td.t.Error(\"failed to write JSON:\", err)\n\t}\n\tif _, err := w.Write([]byte(\"\\r\\n\")); err != nil {\n\t\td.t.Error(\"failed to write CRLF:\", err)\n\t}\n}\n\nfunc (d *dockerServer) findImageIDFromName(name string) string {\n\tfor imageID, builtImageInfo := range d.pushedImages {\n\t\tif slices.Contains(builtImageInfo.tags, name) {\n\t\t\treturn imageID\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (d *dockerServer) writeError(w http.ResponseWriter, err error) {\n\tif err := json.NewEncoder(w).Encode(&jsonstream.Message{Error: &jsonstream.Error{Message: err.Error()}}); err != nil {\n\t\td.t.Error(\"failed to write json message:\", err)\n\t}\n\tif _, err := w.Write([]byte{'\\r', '\\n'}); err != nil {\n\t\td.t.Error(\"failed to write CRLF\", err)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugindocker/registry_auth_config.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugindocker\n\nimport (\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"strings\"\n)\n\n// RegistryAuthConfig represents the fields required to authenticate with the Docker Engine API.\n// Ref: https://docs.docker.com/engine/api/v1.41/#section/Authentication\ntype RegistryAuthConfig struct {\n\tUsername      string `json:\"username,omitempty\"`\n\tPassword      string `json:\"password,omitempty\"`\n\tEmail         string `json:\"email,omitempty\"`\n\tServerAddress string `json:\"serveraddress,omitempty\"` // domain/ip without a protocol\n}\n\n// ToHeader marshals the auth information as a base64 encoded JSON object.\n// This is suitable for passing to the Docker API as the X-Registry-Auth header.\nfunc (r *RegistryAuthConfig) ToHeader() (string, error) {\n\tvar buffer strings.Builder\n\twriter := base64.NewEncoder(base64.URLEncoding, &buffer)\n\terr := json.NewEncoder(writer).Encode(r)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := writer.Close(); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buffer.String(), nil\n}\n\n// fromHeader decodes auth information from a base64 encoded JSON object (see ToHeader).\nfunc (r *RegistryAuthConfig) fromHeader(encoded string) error {\n\tbase64Reader := base64.NewDecoder(base64.URLEncoding, strings.NewReader(encoded))\n\tif err := json.NewDecoder(base64Reader).Decode(r); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugindocker/registry_auth_config_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugindocker\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestRegistryAuthMarshalJSON(t *testing.T) {\n\tt.Parallel()\n\tauth := RegistryAuthConfig{\n\t\tUsername:      \"someuser\",\n\t\tPassword:      \"somepass\",\n\t\tEmail:         \"someemail@buf.build\",\n\t\tServerAddress: \"buf.build\",\n\t}\n\tencoded, err := json.Marshal(auth)\n\trequire.NoError(t, err)\n\tvar decoded RegistryAuthConfig\n\terr = json.Unmarshal(encoded, &decoded)\n\trequire.NoError(t, err)\n\tassert.Equal(t, auth, decoded)\n}\n\nfunc TestRegistryAuthToFromHeader(t *testing.T) {\n\tt.Parallel()\n\tauth := RegistryAuthConfig{\n\t\tUsername:      \"someuser\",\n\t\tPassword:      \"somepass\",\n\t\tEmail:         \"someemail@buf.build\",\n\t\tServerAddress: \"buf.build\",\n\t}\n\tencoded, err := auth.ToHeader()\n\trequire.NoError(t, err)\n\tvar decoded RegistryAuthConfig\n\terr = decoded.fromHeader(encoded)\n\trequire.NoError(t, err)\n\tassert.Equal(t, auth, decoded)\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugindocker/testdata/success/Dockerfile",
    "content": "FROM alpine:3.23.3\n\nRUN echo \"success\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremoteplugindocker/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufremoteplugindocker\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginref/bufremotepluginref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginref\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// PluginIdentity is a plugin identity.\n//\n// It just contains remote, owner, plugin.\ntype PluginIdentity interface {\n\tRemote() string\n\tOwner() string\n\tPlugin() string\n\n\t// IdentityString is the string remote/owner/plugin.\n\tIdentityString() string\n\n\t// Prevents this type from being implemented by\n\t// another package.\n\tisPluginIdentity()\n}\n\n// NewPluginIdentity returns a new PluginIdentity.\nfunc NewPluginIdentity(\n\tremote string,\n\towner string,\n\tplugin string,\n) (PluginIdentity, error) {\n\treturn newPluginIdentity(remote, owner, plugin)\n}\n\n// PluginIdentityForString returns a new PluginIdentity for the given string.\n//\n// This parses the path in the form remote/owner/plugin.\nfunc PluginIdentityForString(path string) (PluginIdentity, error) {\n\tremote, owner, plugin, err := parsePluginIdentityComponents(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewPluginIdentity(remote, owner, plugin)\n}\n\n// PluginReference uniquely references a plugin (including version and revision information).\n//\n// It can be used to identify dependencies on other plugins.\ntype PluginReference interface {\n\tPluginIdentity\n\n\t// ReferenceString is the string representation of identity:version:revision.\n\tReferenceString() string\n\n\t// Version is the plugin's semantic version.\n\tVersion() string\n\n\t// Revision is the plugin's revision number.\n\t//\n\t// The accepted range for this value is 0 - math.MaxInt32.\n\tRevision() int\n\n\t// Prevents this type from being implemented by\n\t// another package.\n\tisPluginReference()\n}\n\n// NewPluginReference returns a new PluginReference.\nfunc NewPluginReference(\n\tidentity PluginIdentity,\n\tversion string,\n\trevision int,\n) (PluginReference, error) {\n\treturn newPluginReference(identity, version, revision)\n}\n\n// PluginReferenceForString returns a new PluginReference for the given string.\n//\n// This parses the path in the form remote/owner/plugin:version.\nfunc PluginReferenceForString(reference string, revision int) (PluginReference, error) {\n\treturn parsePluginReference(reference, revision)\n}\n\n// ParsePluginIdentityOptionalVersion returns the PluginIdentity and version for the given string.\n// If the string does not contain a version, the version is assumed to be an empty string.\n// This parses the path in the form remote/owner/plugin:version.\nfunc ParsePluginIdentityOptionalVersion(rawReference string) (PluginIdentity, string, error) {\n\tif reference, err := PluginReferenceForString(rawReference, 0); err == nil {\n\t\treturn reference, reference.Version(), nil\n\t}\n\t// Try parsing as a plugin identity (no version information)\n\tidentity, err := PluginIdentityForString(rawReference)\n\tif err != nil {\n\t\treturn nil, \"\", fmt.Errorf(\"invalid remote plugin %s\", rawReference)\n\t}\n\treturn identity, \"\", nil\n}\n\n// IsPluginReferenceOrIdentity returns true if the argument matches a plugin\n// reference (with version) or a plugin identity (without version).\nfunc IsPluginReferenceOrIdentity(plugin string) bool {\n\tif _, err := PluginReferenceForString(plugin, 0); err == nil {\n\t\treturn true\n\t}\n\tif _, err := PluginIdentityForString(plugin); err == nil {\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc parsePluginIdentityComponents(path string) (remote string, owner string, plugin string, err error) {\n\tslashSplit := strings.Split(path, \"/\")\n\tif len(slashSplit) != 3 {\n\t\treturn \"\", \"\", \"\", newInvalidPluginIdentityStringError(path)\n\t}\n\tremote = strings.TrimSpace(slashSplit[0])\n\tif remote == \"\" {\n\t\treturn \"\", \"\", \"\", newInvalidPluginIdentityStringError(path)\n\t}\n\towner = strings.TrimSpace(slashSplit[1])\n\tif owner == \"\" {\n\t\treturn \"\", \"\", \"\", newInvalidPluginIdentityStringError(path)\n\t}\n\tplugin = strings.TrimSpace(slashSplit[2])\n\tif plugin == \"\" || strings.ContainsRune(plugin, ':') {\n\t\treturn \"\", \"\", \"\", newInvalidPluginIdentityStringError(path)\n\t}\n\treturn remote, owner, plugin, nil\n}\n\nfunc newInvalidPluginIdentityStringError(s string) error {\n\treturn fmt.Errorf(\"plugin identity %q is invalid: must be in the form remote/owner/plugin\", s)\n}\n\nfunc parsePluginReference(reference string, revision int) (PluginReference, error) {\n\tindex := strings.LastIndex(reference, \":\")\n\tif index == -1 {\n\t\treturn nil, fmt.Errorf(\"plugin references must be specified as \\\"<name>:<version>\\\" strings\")\n\t}\n\tname, version := reference[:index], reference[index+1:]\n\tidentity, err := PluginIdentityForString(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn NewPluginReference(identity, version, revision)\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginref/bufremotepluginref_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginref\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestPluginIdentityForString(t *testing.T) {\n\tt.Parallel()\n\texpectedPluginIdentity, err := NewPluginIdentity(\"foo.com\", \"bar\", \"baz\")\n\trequire.NoError(t, err)\n\tassert.Equal(t, \"foo.com\", expectedPluginIdentity.Remote())\n\tassert.Equal(t, \"bar\", expectedPluginIdentity.Owner())\n\tassert.Equal(t, \"baz\", expectedPluginIdentity.Plugin())\n\tpluginIdentity, err := PluginIdentityForString(\"foo.com/bar/baz\")\n\trequire.NoError(t, err)\n\tassert.Equal(t, expectedPluginIdentity, pluginIdentity)\n}\n\nfunc TestPluginIdentityForStringError(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tName  string\n\t\tInput string\n\t}{\n\t\t{\n\t\t\tName:  \"no remote\",\n\t\t\tInput: \"/bar\",\n\t\t},\n\t\t{\n\t\t\tName:  \"no owner\",\n\t\t\tInput: \"foo.com\",\n\t\t},\n\t\t{\n\t\t\tName:  \"empty owner\",\n\t\t\tInput: \"foo.com//baz\",\n\t\t},\n\t\t{\n\t\t\tName:  \"no plugin\",\n\t\t\tInput: \"foo.com/bar\",\n\t\t},\n\t\t{\n\t\t\tName:  \"empty plugin\",\n\t\t\tInput: \"foo.com/bar/\",\n\t\t},\n\t\t{\n\t\t\tName:  \"version separator\",\n\t\t\tInput: \"foo.com/bar/baz:\",\n\t\t},\n\t\t{\n\t\t\tName:  \"version separator with version\",\n\t\t\tInput: \"foo.com/bar/baz:v1.0.0\",\n\t\t},\n\t}\n\tfor _, testCase := range testCases {\n\t\tt.Run(testCase.Name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\t_, err := PluginIdentityForString(testCase.Input)\n\t\t\trequire.Error(t, err)\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginref/plugin_identity.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginref\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/pkg/netext\"\n)\n\ntype pluginIdentity struct {\n\tremote string\n\towner  string\n\tplugin string\n}\n\nfunc newPluginIdentity(\n\tremote string,\n\towner string,\n\tplugin string,\n) (*pluginIdentity, error) {\n\tpluginIdentity := &pluginIdentity{\n\t\tremote: remote,\n\t\towner:  owner,\n\t\tplugin: plugin,\n\t}\n\tif err := ValidatePluginIdentity(pluginIdentity); err != nil {\n\t\treturn nil, err\n\t}\n\treturn pluginIdentity, nil\n}\n\nfunc (m *pluginIdentity) Remote() string {\n\treturn m.remote\n}\n\nfunc (m *pluginIdentity) Owner() string {\n\treturn m.owner\n}\n\nfunc (m *pluginIdentity) Plugin() string {\n\treturn m.plugin\n}\n\nfunc (m *pluginIdentity) IdentityString() string {\n\treturn m.remote + \"/\" + m.owner + \"/\" + m.plugin\n}\n\nfunc (*pluginIdentity) isPluginIdentity() {}\n\n// ValidatePluginIdentity validates the PluginIdentity.\nfunc ValidatePluginIdentity(pluginIdentity PluginIdentity) error {\n\tif pluginIdentity == nil {\n\t\treturn errors.New(\"plugin identity is required\")\n\t}\n\tif err := ValidateRemote(pluginIdentity.Remote()); err != nil {\n\t\treturn err\n\t}\n\tif pluginIdentity.Owner() == \"\" {\n\t\treturn errors.New(\"owner name is required\")\n\t}\n\tif pluginIdentity.Plugin() == \"\" {\n\t\treturn errors.New(\"plugin name is required\")\n\t}\n\treturn nil\n}\n\n// ValidateRemote validates the remote.\nfunc ValidateRemote(remote string) error {\n\tif remote == \"\" {\n\t\treturn errors.New(\"remote name is required\")\n\t}\n\tif _, err := netext.ValidateHostname(remote); err != nil {\n\t\treturn fmt.Errorf(\"invalid remote %q: %w\", remote, err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginref/plugin_reference.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremotepluginref\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n\n\t\"golang.org/x/mod/semver\"\n)\n\ntype pluginReference struct {\n\tidentity PluginIdentity\n\tversion  string\n\trevision int\n}\n\nfunc (p *pluginReference) Remote() string {\n\treturn p.identity.Remote()\n}\n\nfunc (p *pluginReference) Owner() string {\n\treturn p.identity.Owner()\n}\n\nfunc (p *pluginReference) Plugin() string {\n\treturn p.identity.Plugin()\n}\n\nfunc (p *pluginReference) IdentityString() string {\n\treturn p.identity.IdentityString()\n}\n\nfunc (p *pluginReference) isPluginIdentity() {}\n\nfunc (p *pluginReference) ReferenceString() string {\n\treturn p.identity.IdentityString() + \":\" + p.version + \":\" + strconv.Itoa(p.revision)\n}\n\nfunc (p *pluginReference) Version() string {\n\treturn p.version\n}\n\nfunc (p *pluginReference) Revision() int {\n\treturn p.revision\n}\n\nfunc (p *pluginReference) isPluginReference() {}\n\nfunc newPluginReference(identity PluginIdentity, version string, revision int) (*pluginReference, error) {\n\tif err := ValidatePluginIdentity(identity); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := ValidatePluginVersion(version); err != nil {\n\t\treturn nil, err\n\t}\n\tif err := validatePluginRevision(revision); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &pluginReference{\n\t\tidentity: identity,\n\t\tversion:  version,\n\t\trevision: revision,\n\t}, nil\n}\n\n// ValidatePluginVersion validates the plugin version.\nfunc ValidatePluginVersion(version string) error {\n\tif !semver.IsValid(version) {\n\t\treturn fmt.Errorf(\"plugin version %q is not a valid semantic version\", version)\n\t}\n\treturn nil\n}\n\nfunc validatePluginRevision(revision int) error {\n\tif revision < 0 || revision > math.MaxInt32 {\n\t\treturn fmt.Errorf(\"revision %d is out of accepted range %d-%d\", revision, 0, math.MaxInt32)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/bufremotepluginref/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufremotepluginref\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/dotnet_target_framework.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugin\n\nimport (\n\t\"fmt\"\n\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n)\n\nvar (\n\tstringToDotnetTargetFramework = map[string]registryv1alpha1.DotnetTargetFramework{\n\t\t\"netstandard1.0\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_0,\n\t\t\"netstandard1.1\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_1,\n\t\t\"netstandard1.2\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_2,\n\t\t\"netstandard1.3\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_3,\n\t\t\"netstandard1.4\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_4,\n\t\t\"netstandard1.5\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_5,\n\t\t\"netstandard1.6\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_6,\n\t\t\"netstandard2.0\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_0,\n\t\t\"netstandard2.1\": registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_1,\n\t\t\"net5.0\":         registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_5_0,\n\t\t\"net6.0\":         registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_6_0,\n\t\t\"net7.0\":         registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_7_0,\n\t\t\"net8.0\":         registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_8_0,\n\t}\n)\n\n// DotnetTargetFrameworkFromString converts the target framework name to the equivalent enum.\n// It returns an error if the specified string is unknown.\nfunc DotnetTargetFrameworkFromString(framework string) (registryv1alpha1.DotnetTargetFramework, error) {\n\tframeworkEnum, ok := stringToDotnetTargetFramework[framework]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"unknown target framework %q\", framework)\n\t}\n\treturn frameworkEnum, nil\n}\n\n// DotnetTargetFrameworkToString converts the target framework enum to the equivalent string.\n// It returns an error if the specified enum is unspecified or unknown.\nfunc DotnetTargetFrameworkToString(framework registryv1alpha1.DotnetTargetFramework) (string, error) {\n\t// This isn't performance critical code - just scan the existing mapping instead of storing in both directions.\n\tfor frameworkStr, frameworkEnum := range stringToDotnetTargetFramework {\n\t\tif frameworkEnum == framework {\n\t\t\treturn frameworkStr, nil\n\t\t}\n\t}\n\treturn \"\", fmt.Errorf(\"unknown target framework %v\", framework)\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/dotnet_target_platform_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugin\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginconfig\"\n\tregistryv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestDotnetTargetPlatformMapping(t *testing.T) {\n\tt.Parallel()\n\tassert.Len(t, stringToDotnetTargetFramework, len(registryv1alpha1.DotnetTargetFramework_name)-1)\n\tfor value := range registryv1alpha1.DotnetTargetFramework_name {\n\t\ttargetFramework := registryv1alpha1.DotnetTargetFramework(value)\n\t\tif targetFramework == registryv1alpha1.DotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_UNSPECIFIED {\n\t\t\tcontinue\n\t\t}\n\t\t// Verify round trip\n\t\tstrTargetFramework, err := DotnetTargetFrameworkToString(targetFramework)\n\t\trequire.NoErrorf(t, err, \"missing mapping for target framework %v\", targetFramework)\n\t\ttargetFrameworkFromStr, err := DotnetTargetFrameworkFromString(strTargetFramework)\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, targetFramework, targetFrameworkFromStr)\n\t}\n}\n\nfunc TestDotnetTargetPlatformExternalConfigMapping(t *testing.T) {\n\t// We validate the string values for target frameworks in bufremoteconfig.\n\t// This test will fail if we add a new target framework to the proto and didn't update the validation.\n\tt.Parallel()\n\tctx := t.Context()\n\tfor targetFrameworkStr := range stringToDotnetTargetFramework {\n\t\texternalCfg := fmt.Sprintf(\n\t\t\t`version: v1\nname: buf.build/grpc/csharp\nplugin_version: v1.0.0\nregistry:\n  nuget:\n    target_frameworks:\n      - %s\n`, targetFrameworkStr)\n\t\t_, err := bufremotepluginconfig.GetConfigForData(ctx, []byte(externalCfg))\n\t\trequire.NoErrorf(t, err, \"bufremotepluginconfig.validateNugetTargetFramework needs updating for %s\", targetFrameworkStr)\n\t}\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/plugin.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bufremoteplugin\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginconfig\"\n\t\"github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremotepluginref\"\n\t\"golang.org/x/mod/semver\"\n)\n\ntype plugin struct {\n\tversion              string\n\tdependencies         []bufremotepluginref.PluginReference\n\tregistry             *bufremotepluginconfig.RegistryConfig\n\tcontainerImageDigest string\n\tsourceURL            string\n\tdescription          string\n}\n\nvar _ Plugin = (*plugin)(nil)\n\nfunc newPlugin(\n\tversion string,\n\tdependencies []bufremotepluginref.PluginReference,\n\tregistryConfig *bufremotepluginconfig.RegistryConfig,\n\tcontainerImageDigest string,\n\tsourceURL string,\n\tdescription string,\n) (*plugin, error) {\n\tif version == \"\" {\n\t\treturn nil, errors.New(\"plugin version is required\")\n\t}\n\tif !semver.IsValid(version) {\n\t\t// This will probably already be validated in other call-sites\n\t\t// (e.g. when we construct a *bufremotepluginconfig.Config or when we\n\t\t// map from the Protobuf representation), but we may as well\n\t\t// include it at the lowest common denominator, too.\n\t\treturn nil, fmt.Errorf(\"plugin version %q must be a valid semantic version\", version)\n\t}\n\tif containerImageDigest == \"\" {\n\t\treturn nil, errors.New(\"plugin image digest is required\")\n\t}\n\treturn &plugin{\n\t\tversion:              version,\n\t\tdependencies:         dependencies,\n\t\tregistry:             registryConfig,\n\t\tcontainerImageDigest: containerImageDigest,\n\t\tsourceURL:            sourceURL,\n\t\tdescription:          description,\n\t}, nil\n}\n\n// Version returns the plugin's version.\nfunc (p *plugin) Version() string {\n\treturn p.version\n}\n\n// Dependencies returns the plugin's dependencies on other plugins.\nfunc (p *plugin) Dependencies() []bufremotepluginref.PluginReference {\n\treturn p.dependencies\n}\n\n// Registry returns the plugin's registry configuration.\nfunc (p *plugin) Registry() *bufremotepluginconfig.RegistryConfig {\n\treturn p.registry\n}\n\n// ContainerImageDigest returns the plugin's image digest.\nfunc (p *plugin) ContainerImageDigest() string {\n\treturn p.containerImageDigest\n}\n\n// SourceURL is an optional attribute used to specify where the source for the plugin can be found.\nfunc (p *plugin) SourceURL() string {\n\treturn p.sourceURL\n}\n\n// Description is an optional attribute to provide a more detailed description for the plugin.\nfunc (p *plugin) Description() string {\n\treturn p.description\n}\n"
  },
  {
    "path": "private/bufpkg/bufremoteplugin/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bufremoteplugin\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/bufpkg/buftransport/buftransport.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buftransport\n\nconst (\n\tschemeHTTP  = \"http\"\n\tschemeHTTPS = \"https\"\n)\n\n// PrependHTTP prepends an http scheme to the given address\nfunc PrependHTTP(address string) string {\n\treturn schemeHTTP + \"://\" + address\n}\n\n// PrependHTTPS prepends an https scheme to the given address\nfunc PrependHTTPS(address string) string {\n\treturn schemeHTTPS + \"://\" + address\n}\n"
  },
  {
    "path": "private/bufpkg/buftransport/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage buftransport\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/data/datalegacyfederation/datalegacyfederation.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 buf-legacyfederation-go-data. DO NOT EDIT.\n\npackage datalegacyfederation\n\nimport (\n\t\"encoding/hex\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/shake256\"\n)\n\nvar (\n\t// hostnameHexEncodedDigests are the shake256 digests of the hostnames that are allowed to use legacy federation.\n\thostnameHexEncodedDigests = map[string]struct{}{\n\t\t\"a9dcb9abaac3a9c1a21a5e2e3aa709133c26136cdeda5e112d8fd6f60629671ff900c23c26d24c4558f265ba4d520daaffc2f69e7f9523c4f26bc2b7d98be607\": {},\n\t\t\"ae726fef74c38124ebb06526dbc533d9fa4b975cdbefb697be18e02e94e57b0d44680a73e7a7f1378e83fb71efcccfe950992d641f7b2286430713ed817d4fdd\": {},\n\t}\n)\n\n// Exists returns true if the hostname is allowed to use legacy federation.\nfunc Exists(hostname string) (bool, error) {\n\tif hostname == \"\" {\n\t\treturn false, nil\n\t}\n\tdigest, err := shake256.NewDigestForContent(strings.NewReader(hostname))\n\tif err != nil {\n\t\treturn false, err\n\t}\n\thexEncodedDigest := hex.EncodeToString(digest.Value())\n\t_, ok := hostnameHexEncodedDigests[hexEncodedDigest]\n\treturn ok, nil\n}\n"
  },
  {
    "path": "private/gen/data/datalegacyfederation/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage datalegacyfederation\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/data/datawkt/datawkt.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 wkt-go-data. DO NOT EDIT.\n\n// Package datawkt stores the sources of the Well-Known Types, and provides helper functionality around them.\npackage datawkt\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n)\n\n// Version is the version of github.com/protocolbuffers/protobuf used to extract the Well-Known Types.\nconst Version = \"33.3\"\n\nvar (\n\t// ReadBucket is the storage.ReadBucket with the static data generated for this package.\n\tReadBucket storage.ReadBucket\n\n\t// AllFilePaths are all Well-Known Type file paths in sorted order.\n\tAllFilePaths = []string{\n\t\t\"google/protobuf/any.proto\",\n\t\t\"google/protobuf/api.proto\",\n\t\t\"google/protobuf/compiler/plugin.proto\",\n\t\t\"google/protobuf/cpp_features.proto\",\n\t\t\"google/protobuf/descriptor.proto\",\n\t\t\"google/protobuf/duration.proto\",\n\t\t\"google/protobuf/empty.proto\",\n\t\t\"google/protobuf/field_mask.proto\",\n\t\t\"google/protobuf/go_features.proto\",\n\t\t\"google/protobuf/java_features.proto\",\n\t\t\"google/protobuf/source_context.proto\",\n\t\t\"google/protobuf/struct.proto\",\n\t\t\"google/protobuf/timestamp.proto\",\n\t\t\"google/protobuf/type.proto\",\n\t\t\"google/protobuf/wrappers.proto\",\n\t}\n\n\tfilePathToData = map[string][]byte{\n\t\t\"google/protobuf/any.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,\n\t\t\t0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f,\n\t\t\t0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x61, 0x6e, 0x79, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d,\n\t\t\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61,\n\t\t\t0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x41, 0x6e, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b,\n\t\t\t0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c,\n\t\t\t0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78,\n\t\t\t0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x73, 0x68,\n\t\t\t0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x6f, 0x6f,\n\t\t\t0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f,\n\t\t\t0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x41, 0x6e, 0x79, 0x60, 0x20,\n\t\t\t0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x62, 0x69, 0x74, 0x72, 0x61, 0x72,\n\t\t\t0x79, 0x20, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f,\n\t\t\t0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x6c, 0x6f,\n\t\t\t0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20, 0x55, 0x52, 0x4c, 0x20, 0x74, 0x68, 0x61,\n\t\t\t0x74, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t\t\t0x75, 0x66, 0x20, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x73, 0x20,\n\t\t\t0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x2f, 0x75, 0x6e, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x74, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20,\n\t\t\t0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,\n\t\t\t0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x31, 0x3a, 0x20, 0x50, 0x61, 0x63, 0x6b,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x69, 0x6e, 0x20, 0x43, 0x2b, 0x2b, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x46, 0x6f, 0x6f, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x61, 0x6e, 0x79, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e,\n\t\t\t0x79, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x46, 0x72, 0x6f, 0x6d, 0x28, 0x66, 0x6f, 0x6f, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x61,\n\t\t\t0x6e, 0x79, 0x2e, 0x55, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x54, 0x6f, 0x28, 0x26, 0x66, 0x6f, 0x6f, 0x29, 0x29, 0x20, 0x7b,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x32, 0x3a, 0x20,\n\t\t\t0x50, 0x61, 0x63, 0x6b, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x61, 0x20, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x6f, 0x6f, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x3d, 0x20, 0x41, 0x6e, 0x79,\n\t\t\t0x2e, 0x70, 0x61, 0x63, 0x6b, 0x28, 0x66, 0x6f, 0x6f, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e,\n\t\t\t0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x61, 0x6e, 0x79, 0x2e, 0x69, 0x73,\n\t\t\t0x28, 0x46, 0x6f, 0x6f, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x61, 0x6e, 0x79, 0x2e, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b,\n\t\t\t0x28, 0x46, 0x6f, 0x6f, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x72, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x61, 0x6e, 0x79, 0x2e, 0x69, 0x73, 0x53, 0x61, 0x6d, 0x65,\n\t\t\t0x54, 0x79, 0x70, 0x65, 0x41, 0x73, 0x28, 0x46, 0x6f, 0x6f, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c,\n\t\t\t0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x28, 0x29, 0x29, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x61, 0x6e, 0x79, 0x2e, 0x75, 0x6e, 0x70, 0x61, 0x63,\n\t\t\t0x6b, 0x28, 0x46, 0x6f, 0x6f, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x49, 0x6e, 0x73, 0x74,\n\t\t\t0x61, 0x6e, 0x63, 0x65, 0x28, 0x29, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x33, 0x3a, 0x20, 0x50, 0x61, 0x63, 0x6b,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x69, 0x6e, 0x20, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x46, 0x6f, 0x6f, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x3d, 0x20, 0x41, 0x6e, 0x79, 0x28, 0x29, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x79, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x28, 0x66, 0x6f, 0x6f, 0x29, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x61,\n\t\t\t0x6e, 0x79, 0x2e, 0x49, 0x73, 0x28, 0x46, 0x6f, 0x6f, 0x2e, 0x44, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x4f, 0x52,\n\t\t\t0x29, 0x3a, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x79, 0x2e, 0x55, 0x6e, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x28, 0x66, 0x6f, 0x6f, 0x29, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e,\n\t\t\t0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x34, 0x3a, 0x20, 0x50,\n\t\t\t0x61, 0x63, 0x6b, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x47, 0x6f, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3a, 0x3d, 0x20, 0x26, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x7b, 0x2e, 0x2e, 0x2e,\n\t\t\t0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x6e, 0x79, 0x2c, 0x20, 0x65, 0x72, 0x72, 0x20, 0x3a,\n\t\t\t0x3d, 0x20, 0x61, 0x6e, 0x79, 0x70, 0x62, 0x2e, 0x4e, 0x65, 0x77, 0x28, 0x66, 0x6f, 0x6f, 0x29, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x65, 0x72, 0x72, 0x20, 0x21, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x20, 0x7b,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3a, 0x3d, 0x20, 0x26, 0x70, 0x62, 0x2e, 0x46, 0x6f, 0x6f, 0x7b,\n\t\t\t0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x65, 0x72, 0x72, 0x20, 0x3a, 0x3d, 0x20,\n\t\t\t0x61, 0x6e, 0x79, 0x2e, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x54, 0x6f, 0x28, 0x66, 0x6f, 0x6f, 0x29,\n\t\t\t0x3b, 0x20, 0x65, 0x72, 0x72, 0x20, 0x21, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,\n\t\t\t0x73, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t\t\t0x75, 0x66, 0x20, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x79, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x75, 0x73, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x27, 0x74, 0x79, 0x70, 0x65, 0x2e,\n\t\t\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x75, 0x6c, 0x6c, 0x2e,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x27, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x6e, 0x70, 0x61, 0x63,\n\t\t\t0x6b, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65,\n\t\t\t0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x27, 0x2f, 0x27, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70,\n\t\t\t0x6c, 0x65, 0x20, 0x22, 0x66, 0x6f, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x78, 0x2f, 0x79, 0x2e,\n\t\t\t0x7a, 0x22, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x22, 0x79, 0x2e, 0x7a, 0x22, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4a, 0x53, 0x4f, 0x4e, 0x0a, 0x2f, 0x2f, 0x20, 0x3d, 0x3d, 0x3d, 0x3d, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x60, 0x41, 0x6e, 0x79, 0x60, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x64, 0x65, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x2c, 0x20, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64,\n\t\t\t0x65, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6e, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20,\n\t\t\t0x60, 0x40, 0x74, 0x79, 0x70, 0x65, 0x60, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t\t\t0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x2e, 0x20, 0x45, 0x78, 0x61,\n\t\t\t0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x63, 0x6b,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x3b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x50, 0x65, 0x72, 0x73, 0x6f,\n\t\t\t0x6e, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x40, 0x74,\n\t\t\t0x79, 0x70, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,\n\t\t\t0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c,\n\t\t\t0x65, 0x2e, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x22, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x20, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n\t\t\t0x3e, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d,\n\t\t\t0x65, 0x22, 0x3a, 0x20, 0x3c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6d, 0x62, 0x65, 0x64,\n\t\t\t0x64, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x77, 0x65, 0x6c, 0x6c, 0x2d, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61,\n\t\t\t0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x0a, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x70, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x65, 0x70,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x20, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68,\n\t\t\t0x20, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x4a, 0x53,\n\t\t\t0x4f, 0x4e, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x60, 0x40, 0x74, 0x79, 0x70, 0x65, 0x60, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20,\n\t\t\t0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x5b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75,\n\t\t\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5b, 0x5d, 0x29, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x40, 0x74, 0x79, 0x70, 0x65, 0x22,\n\t\t\t0x3a, 0x20, 0x22, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63,\n\t\t\t0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,\n\t\t\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3a, 0x20, 0x22, 0x31, 0x2e, 0x32, 0x31, 0x32, 0x73, 0x22, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6e, 0x79,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x55, 0x52, 0x4c, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,\n\t\t\t0x63, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6c,\n\t\t\t0x79, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72,\n\t\t\t0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x61, 0x74, 0x20, 0x6c, 0x65,\n\t\t\t0x61, 0x73, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x22, 0x2f, 0x22, 0x20, 0x63, 0x68, 0x61,\n\t\t\t0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x73, 0x65, 0x67,\n\t\t\t0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x27, 0x73, 0x20, 0x70, 0x61,\n\t\t\t0x74, 0x68, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69,\n\t\t\t0x65, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20,\n\t\t\t0x28, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x60, 0x70, 0x61, 0x74, 0x68, 0x2f, 0x67, 0x6f,\n\t\t\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x60, 0x29, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c,\n\t\t\t0x64, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x63, 0x61, 0x6e, 0x6f, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x6c, 0x65, 0x61,\n\t\t\t0x64, 0x69, 0x6e, 0x67, 0x20, 0x22, 0x2e, 0x22, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x63, 0x63, 0x65,\n\t\t\t0x70, 0x74, 0x65, 0x64, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x20,\n\t\t\t0x70, 0x72, 0x61, 0x63, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x20, 0x75, 0x73, 0x75, 0x61,\n\t\t\t0x6c, 0x6c, 0x79, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73,\n\t\t\t0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x78, 0x70, 0x65,\n\t\t\t0x63, 0x74, 0x20, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x41, 0x6e, 0x79, 0x2e, 0x20, 0x48, 0x6f, 0x77, 0x65,\n\t\t\t0x76, 0x65, 0x72, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x55, 0x52, 0x4c, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20,\n\t\t\t0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x20,\n\t\t\t0x60, 0x68, 0x74, 0x74, 0x70, 0x60, 0x2c, 0x20, 0x60, 0x68, 0x74, 0x74, 0x70, 0x73, 0x60, 0x2c, 0x20, 0x6f, 0x72, 0x20,\n\t\t\t0x6e, 0x6f, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2c, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x74, 0x20, 0x75, 0x70, 0x20, 0x61, 0x20, 0x74,\n\t\t\t0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74,\n\t\t\t0x20, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61,\n\t\t\t0x73, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x2a, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x2c, 0x20, 0x60, 0x68, 0x74, 0x74, 0x70, 0x73, 0x60, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2a, 0x20, 0x41, 0x6e, 0x20, 0x48,\n\t\t\t0x54, 0x54, 0x50, 0x20, 0x47, 0x45, 0x54, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x20, 0x6d,\n\t\t\t0x75, 0x73, 0x74, 0x20, 0x79, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x61, 0x20, 0x5b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x5d, 0x5b, 0x5d, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x61,\n\t\t\t0x6e, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2a, 0x20, 0x41, 0x70, 0x70, 0x6c,\n\t\t\t0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x63, 0x61, 0x63, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x75, 0x6c, 0x74, 0x73, 0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x55, 0x52, 0x4c, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x6d, 0x20, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20,\n\t\t\t0x61, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x61, 0x6e,\n\t\t\t0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x2e, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x2c, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61,\n\t\t\t0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65,\n\t\t\t0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6f, 0x6e,\n\t\t\t0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x20, 0x28,\n\t\t\t0x55, 0x73, 0x65, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x2e, 0x29,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x3a, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x69, 0x73, 0x20, 0x6e,\n\t\t\t0x6f, 0x74, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,\n\t\t\t0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x73, 0x65, 0x64,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x73, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e,\n\t\t\t0x6e, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e,\n\t\t\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2e, 0x20, 0x41, 0x73, 0x20, 0x6f,\n\t\t\t0x66, 0x20, 0x4d, 0x61, 0x79, 0x20, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x72,\n\t\t\t0x65, 0x20, 0x6e, 0x6f, 0x20, 0x77, 0x69, 0x64, 0x65, 0x6c, 0x79, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d,\n\t\t\t0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61,\n\t\t\t0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x65, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x20, 0x6f,\n\t\t\t0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x60, 0x68, 0x74, 0x74, 0x70, 0x60, 0x2c, 0x20, 0x60, 0x68,\n\t\t\t0x74, 0x74, 0x70, 0x73, 0x60, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x20,\n\t\t\t0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x29, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e,\n\t\t\t0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x73, 0x65, 0x6d, 0x61,\n\t\t\t0x6e, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x4d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x73, 0x65, 0x72,\n\t\t\t0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66,\n\t\t\t0x66, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x73, 0x70, 0x65,\n\t\t\t0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/api.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t\t\t0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e,\n\t\t\t0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20,\n\t\t\t0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61,\n\t\t\t0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,\n\t\t\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66,\n\t\t\t0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x3d, 0x20,\n\t\t\t0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70,\n\t\t\t0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t\t\t0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54,\n\t\t\t0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63,\n\t\t\t0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e,\n\t\t\t0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,\n\t\t\t0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41,\n\t\t\t0x70, 0x69, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74,\n\t\t\t0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x41,\n\t\t\t0x50, 0x49, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20,\n\t\t\t0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,\n\t\t\t0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x2c, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x73, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x73, 0x65, 0x72,\n\t\t\t0x76, 0x69, 0x63, 0x65, 0x22, 0x20, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x2e,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x79,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x72,\n\t\t\t0x6f, 0x6d, 0x20, 0x41, 0x50, 0x49, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2c, 0x20, 0x77, 0x68, 0x69,\n\t\t\t0x63, 0x68, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x72,\n\t\t\t0x65, 0x74, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f,\n\t\t\t0x66, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x73,\n\t\t\t0x20, 0x6f, 0x70, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x20, 0x61,\n\t\t\t0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x6d, 0x65, 0x74, 0x68,\n\t\t\t0x6f, 0x64, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x20, 0x54, 0x68,\n\t\t\t0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x74,\n\t\t\t0x69, 0x6d, 0x65, 0x73, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x61, 0x73, 0x20, 0x22, 0x41, 0x50, 0x49, 0x73, 0x22, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x74, 0x68,\n\t\t\t0x65, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x2c, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x73,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x74, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x20, 0x53, 0x65, 0x65,\n\t\t\t0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,\n\t\t\t0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x2f, 0x67, 0x6c,\n\t\t\t0x6f, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c,\n\t\t\t0x65, 0x64, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x79, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72,\n\t\t\t0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64,\n\t\t\t0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x70, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x64,\n\t\t\t0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x20, 0x49, 0x6e,\n\t\t\t0x73, 0x74, 0x65, 0x61, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x20, 0x77,\n\t\t\t0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e,\n\t\t\t0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x41, 0x70, 0x69, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64,\n\t\t\t0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66,\n\t\t\t0x61, 0x63, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61,\n\t\t\t0x67, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65,\n\t\t\t0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x27, 0x73,\n\t\t\t0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69,\n\t\t\t0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x75, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69,\n\t\t\t0x66, 0x69, 0x65, 0x64, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,\n\t\t\t0x61, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e,\n\t\t\t0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63,\n\t\t\t0x65, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20, 0x6d, 0x75, 0x73,\n\t\t\t0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x60, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x2d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x6d, 0x69, 0x6e, 0x6f,\n\t\t\t0x72, 0x2d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x60, 0x2c, 0x20, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x60, 0x31,\n\t\t\t0x2e, 0x31, 0x30, 0x60, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x20, 0x76,\n\t\t\t0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x6d, 0x69, 0x74, 0x74,\n\t\t\t0x65, 0x64, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x7a,\n\t\t\t0x65, 0x72, 0x6f, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x20, 0x76,\n\t\t\t0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74,\n\t\t\t0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x76, 0x65,\n\t\t\t0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f,\n\t\t\t0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20,\n\t\t\t0x61, 0x73, 0x20, 0x6f, 0x75, 0x74, 0x6c, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x20, 0x49,\n\t\t\t0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x6e, 0x61,\n\t\t\t0x6d, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e,\n\t\t\t0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69,\n\t\t\t0x64, 0x65, 0x64, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d,\n\t\t\t0x61, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x5b, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x5d, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f,\n\t\t\t0x2f, 0x73, 0x65, 0x6d, 0x76, 0x65, 0x72, 0x2e, 0x6f, 0x72, 0x67, 0x29, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d,\n\t\t\t0x62, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x61,\n\t\t\t0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x76, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x6e,\n\t\t\t0x2d, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x20, 0x42, 0x6f,\n\t\t\t0x74, 0x68, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x61,\n\t\t\t0x72, 0x65, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x20,\n\t\t\t0x66, 0x72, 0x6f, 0x6d, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69,\n\t\t\t0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x63,\n\t\t\t0x61, 0x72, 0x65, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x68, 0x6f, 0x73, 0x65, 0x6e,\n\t\t\t0x20, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,\n\t\t\t0x74, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68,\n\t\t\t0x65, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61,\n\t\t\t0x6c, 0x73, 0x6f, 0x20, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x77, 0x68, 0x69,\n\t\t\t0x63, 0x68, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x60, 0x76, 0x3c, 0x6d, 0x61,\n\t\t\t0x6a, 0x6f, 0x72, 0x2d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3e, 0x60, 0x2c, 0x20, 0x61, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x60, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72,\n\t\t\t0x65, 0x2e, 0x76, 0x31, 0x60, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72,\n\t\t\t0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x30, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x31, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73,\n\t\t\t0x75, 0x66, 0x66, 0x69, 0x78, 0x20, 0x63, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x6d,\n\t\t\t0x69, 0x74, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x5a, 0x65, 0x72, 0x6f, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x76, 0x65,\n\t\t\t0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69,\n\t\t\t0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x2c, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x47, 0x41, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72,\n\t\t\t0x66, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x62,\n\t\t\t0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x73, 0x6f, 0x75,\n\t\t\t0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63,\n\t\t\t0x65, 0x73, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x5b, 0x4d, 0x69, 0x78, 0x69, 0x6e, 0x5d, 0x5b, 0x5d, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4d, 0x69, 0x78, 0x69, 0x6e, 0x20, 0x6d, 0x69, 0x78, 0x69,\n\t\t\t0x6e, 0x73, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x6f,\n\t\t\t0x75, 0x72, 0x63, 0x65, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x73, 0x79, 0x6e,\n\t\t\t0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73,\n\t\t\t0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n\t\t\t0x2c, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x79,\n\t\t\t0x6e, 0x74, 0x61, 0x78, 0x20, 0x69, 0x73, 0x20, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x49,\n\t\t\t0x4f, 0x4e, 0x53, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x50, 0x49, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e,\n\t\t\t0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20,\n\t\t\t0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f,\n\t\t\t0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x61, 0x72, 0x65,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72,\n\t\t\t0x61, 0x67, 0x65, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64,\n\t\t\t0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20,\n\t\t\t0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x66, 0x6f,\n\t\t\t0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x61, 0x6e,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x73,\n\t\t\t0x2e, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x20, 0x6f, 0x66, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53,\n\t\t\t0x65, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x73, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x55, 0x52, 0x4c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e,\n\t\t\t0x70, 0x75, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f,\n\t\t\t0x75, 0x72, 0x6c, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x72,\n\t\t\t0x75, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x65, 0x61, 0x6d, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x72, 0x65, 0x71, 0x75,\n\t\t\t0x65, 0x73, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x74,\n\t\t\t0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49,\n\t\t\t0x66, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,\n\t\t\t0x20, 0x69, 0x73, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c,\n\t\t\t0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64,\n\t\t\t0x61, 0x74, 0x61, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x73, 0x79, 0x6e, 0x74,\n\t\t\t0x61, 0x78, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20,\n\t\t\t0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x2c, 0x20, 0x69,\n\t\t\t0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x73, 0x68,\n\t\t\t0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x20, 0x66, 0x72,\n\t\t\t0x6f, 0x6d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x70, 0x69, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x61, 0x6e,\n\t\t\t0x64, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x61,\n\t\t\t0x78, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x37, 0x20, 0x5b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x77, 0x68,\n\t\t\t0x65, 0x6e, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x69, 0x73, 0x20, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f,\n\t\t\t0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65,\n\t\t\t0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x2c, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x41, 0x70, 0x69, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x3d, 0x20, 0x38, 0x20, 0x5b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20,\n\t\t\t0x74, 0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65,\n\t\t\t0x73, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x50, 0x49, 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x63,\n\t\t\t0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x20,\n\t\t\t0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2c, 0x20,\n\t\t\t0x62, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x68,\n\t\t\t0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x3a, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x2d, 0x20, 0x49, 0x66, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x6d,\n\t\t\t0x65, 0x6e, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,\n\t\t\t0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x20, 0x6d, 0x65,\n\t\t\t0x74, 0x68, 0x6f, 0x64, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69,\n\t\t\t0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x6d,\n\t\t\t0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x2d, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20,\n\t\t\t0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66,\n\t\t\t0x69, 0x67, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x76, 0x69, 0x73, 0x69, 0x62,\n\t\t\t0x69, 0x6c, 0x69, 0x74, 0x79, 0x29, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20,\n\t\t\t0x73, 0x65, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65,\n\t\t\t0x64, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x2d,\n\t\t\t0x20, 0x49, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x68, 0x74, 0x74, 0x70, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62,\n\t\t\t0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x66,\n\t\t\t0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x2e, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61,\n\t\t\t0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x76, 0x65, 0x72, 0x73,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x70, 0x6c, 0x75, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x5b, 0x72, 0x6f, 0x6f, 0x74, 0x5d, 0x5b, 0x5d, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x69, 0x66, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45,\n\t\t\t0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6d,\n\t\t\t0x69, 0x78, 0x69, 0x6e, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x63, 0x6b,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x76, 0x31, 0x3b, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,\n\t\t\t0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x47, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x6c, 0x79, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x41, 0x43, 0x4c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x72, 0x70, 0x63, 0x20, 0x47, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x28, 0x47, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x52,\n\t\t\t0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x29, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x28, 0x41, 0x63, 0x6c,\n\t\t\t0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x29, 0x2e,\n\t\t\t0x67, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,\n\t\t\t0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x22, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73,\n\t\t\t0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65,\n\t\t\t0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x70, 0x63, 0x20, 0x47, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x28, 0x47, 0x65, 0x74, 0x41,\n\t\t\t0x63, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x29, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x28,\n\t\t\t0x41, 0x63, 0x6c, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x47, 0x65, 0x74, 0x20, 0x61, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x2e, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x70, 0x63, 0x20, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61,\n\t\t\t0x28, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x29, 0x20, 0x72, 0x65, 0x74,\n\t\t\t0x75, 0x72, 0x6e, 0x73, 0x20, 0x28, 0x44, 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t\t\t0x61, 0x70, 0x69, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x22, 0x2f, 0x76, 0x32,\n\t\t\t0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x22, 0x3b, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x6d, 0x69, 0x78, 0x69,\n\t\t\t0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x70, 0x69, 0x73, 0x3a, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2d, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61,\n\t\t\t0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x6d, 0x69, 0x78, 0x69, 0x6e, 0x73, 0x3a, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2d, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x76,\n\t\t\t0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x69, 0x78, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63,\n\t\t\t0x74, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6d,\n\t\t\t0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x60, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e,\n\t\t\t0x74, 0x72, 0x6f, 0x6c, 0x60, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x64, 0x65,\n\t\t\t0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,\n\t\t\t0x73, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x53, 0x74, 0x6f, 0x72,\n\t\t\t0x61, 0x67, 0x65, 0x60, 0x2e, 0x20, 0x41, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76,\n\t\t\t0x65, 0x20, 0x60, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x60, 0x20, 0x6d,\n\t\t\t0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x69,\n\t\t\t0x6e, 0x67, 0x0a, 0x2f, 0x2f, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x73, 0x20, 0x66,\n\t\t\t0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65,\n\t\t\t0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x6e, 0x64, 0x65,\n\t\t\t0x72, 0x6c, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x43, 0x4c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x70, 0x63, 0x20, 0x47, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x28, 0x47,\n\t\t\t0x65, 0x74, 0x41, 0x63, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x29, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,\n\t\t\t0x73, 0x20, 0x28, 0x41, 0x63, 0x6c, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e,\n\t\t\t0x68, 0x74, 0x74, 0x70, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x22, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x72, 0x65,\n\t\t\t0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x22, 0x3b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e,\n\t\t\t0x6f, 0x74, 0x65, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x70, 0x61, 0x74, 0x74, 0x65, 0x72, 0x6e, 0x20,\n\t\t\t0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x60, 0x76, 0x31, 0x60, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x60, 0x76, 0x32, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x60, 0x72, 0x6f, 0x6f, 0x74, 0x60, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6d, 0x69, 0x78, 0x69, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2c, 0x20,\n\t\t\t0x69, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20, 0x72, 0x65,\n\t\t\t0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x77, 0x68,\n\t\t\t0x69, 0x63, 0x68, 0x20, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x70,\n\t\t\t0x61, 0x74, 0x68, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x2e, 0x20, 0x45, 0x78, 0x61,\n\t\t\t0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x70, 0x69, 0x73,\n\t\t\t0x3a, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x67, 0x6f, 0x6f,\n\t\t\t0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x61,\n\t\t\t0x67, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x69, 0x78, 0x69, 0x6e, 0x73, 0x3a, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x67, 0x6f, 0x6f,\n\t\t\t0x67, 0x6c, 0x65, 0x2e, 0x61, 0x63, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e,\n\t\t\t0x74, 0x72, 0x6f, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x6f, 0x6f, 0x74,\n\t\t\t0x3a, 0x20, 0x61, 0x63, 0x6c, 0x73, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6d,\n\t\t\t0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x72,\n\t\t\t0x76, 0x69, 0x63, 0x65, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72,\n\t\t\t0x6c, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x41, 0x43, 0x4c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x70, 0x63, 0x20, 0x47, 0x65, 0x74, 0x41, 0x63, 0x6c, 0x28, 0x47, 0x65,\n\t\t\t0x74, 0x41, 0x63, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x29, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73,\n\t\t\t0x20, 0x28, 0x41, 0x63, 0x6c, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x68,\n\t\t\t0x74, 0x74, 0x70, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x20, 0x3d, 0x20, 0x22, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x6c, 0x73,\n\t\t\t0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x74, 0x41, 0x63,\n\t\t\t0x6c, 0x22, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2e, 0x2e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x69, 0x78, 0x69, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68,\n\t\t\t0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6e, 0x61,\n\t\t\t0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x20,\n\t\t\t0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x73, 0x70, 0x65,\n\t\t\t0x63, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x61, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x20,\n\t\t\t0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x65, 0x64, 0x20, 0x48, 0x54, 0x54, 0x50,\n\t\t\t0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x6f, 0x6f, 0x74,\n\t\t\t0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x20, 0x3d, 0x20,\n\t\t\t0x32, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/compiler/plugin.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x42, 0x53, 0x44, 0x2d, 0x73, 0x74,\n\t\t\t0x79, 0x6c, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x74, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73,\n\t\t\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x73, 0x6f, 0x75,\n\t\t\t0x72, 0x63, 0x65, 0x2f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2f, 0x62, 0x73, 0x64, 0x0a, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x3a, 0x20, 0x6b, 0x65, 0x6e, 0x74, 0x6f, 0x6e, 0x40, 0x67, 0x6f, 0x6f, 0x67,\n\t\t\t0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x28, 0x4b, 0x65, 0x6e, 0x74, 0x6f, 0x6e, 0x20, 0x56, 0x61, 0x72, 0x64, 0x61,\n\t\t\t0x29, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x20, 0x28, 0x61, 0x6b, 0x61, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65,\n\t\t\t0x72, 0x29, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x76,\n\t\t\t0x69, 0x61, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69,\n\t\t\t0x6e, 0x20, 0x69, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72,\n\t\t\t0x61, 0x6d, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x65, 0x61, 0x64, 0x73, 0x20, 0x61, 0x20, 0x43, 0x6f, 0x64, 0x65,\n\t\t\t0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x66, 0x72, 0x6f,\n\t\t\t0x6d, 0x20, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x73, 0x20, 0x61,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73,\n\t\t\t0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x75,\n\t\t\t0x73, 0x69, 0x6e, 0x67, 0x20, 0x43, 0x2b, 0x2b, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x20, 0x67, 0x6f, 0x6f,\n\t\t\t0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65,\n\t\t\t0x72, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x68, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x65, 0x61, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x72, 0x61, 0x77, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e,\n\t\t\t0x65, 0x64, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x70, 0x6c, 0x75,\n\t\t\t0x67, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x20, 0x73,\n\t\t\t0x6f, 0x6d, 0x65, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68,\n\t\t\t0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x20, 0x73, 0x68, 0x6f,\n\t\t\t0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,\n\t\t\t0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x24, 0x4e, 0x41, 0x4d, 0x45, 0x22, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c,\n\t\t\t0x6c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x20, 0x22, 0x2d, 0x2d, 0x24, 0x7b, 0x4e, 0x41, 0x4d,\n\t\t\t0x45, 0x7d, 0x5f, 0x6f, 0x75, 0x74, 0x22, 0x20, 0x69, 0x73, 0x20, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2e, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x22, 0x3b, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f,\n\t\t\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c,\n\t\t\t0x65, 0x72, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73,\n\t\t\t0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x73, 0x22, 0x3b, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x73, 0x68, 0x61,\n\t\t\t0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x6f, 0x6f, 0x67,\n\t\t\t0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72,\n\t\t\t0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72,\n\t\t\t0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x6c, 0x75,\n\t\t\t0x67, 0x69, 0x6e, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x73,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,\n\t\t\t0x6f, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,\n\t\t\t0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6d, 0x69, 0x6e, 0x6f,\n\t\t\t0x72, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e,\n\t\t\t0x74, 0x33, 0x32, 0x20, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x41, 0x20, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2c, 0x20,\n\t\t\t0x62, 0x65, 0x74, 0x61, 0x20, 0x6f, 0x72, 0x20, 0x72, 0x63, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2c, 0x20,\n\t\t\t0x65, 0x2e, 0x67, 0x2e, 0x2c, 0x20, 0x22, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2d, 0x31, 0x22, 0x2c, 0x20, 0x22, 0x72, 0x63,\n\t\t\t0x32, 0x22, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65,\n\t\t\t0x20, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x75, 0x66, 0x66,\n\t\t\t0x69, 0x78, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x65, 0x6e, 0x63,\n\t\t\t0x6f, 0x64, 0x65, 0x64, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65,\n\t\t\t0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x27, 0x73, 0x20, 0x73, 0x74, 0x64, 0x69, 0x6e, 0x2e, 0x0a,\n\t\t\t0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f,\n\t\t\t0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x77, 0x65,\n\t\t\t0x72, 0x65, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2d, 0x6c, 0x69, 0x6e, 0x65,\n\t\t\t0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e,\n\t\t\t0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,\n\t\t\t0x74, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x73, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x66, 0x69, 0x6c, 0x65,\n\t\t\t0x27, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x20, 0x77,\n\t\t\t0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65,\n\t\t\t0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x70, 0x61,\n\t\t\t0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x20, 0x70, 0x61, 0x73, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2d, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65,\n\t\t\t0x74, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44,\n\t\t\t0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x61, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x74,\n\t\t\t0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79,\n\t\t\t0x74, 0x68, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x69, 0x6d, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20,\n\t\t\t0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x6f, 0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x63, 0x61,\n\t\t\t0x6c, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x66, 0x69, 0x6c,\n\t\t\t0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72,\n\t\t\t0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x6d, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x73, 0x20, 0x69, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f,\n\t\t\t0x74, 0x65, 0x3a, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,\n\t\t\t0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x72, 0x75, 0x6e, 0x74, 0x69,\n\t\t\t0x6d, 0x65, 0x2d, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20,\n\t\t\t0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x69, 0x6e, 0x63,\n\t\t\t0x6c, 0x75, 0x64, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,\n\t\t\t0x6f, 0x72, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x20, 0x69, 0x73, 0x20, 0x61,\n\t\t\t0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x79, 0x6f, 0x75,\n\t\t\t0x20, 0x6e, 0x65, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2d, 0x72, 0x65,\n\t\t\t0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x74, 0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x20, 0x67, 0x75, 0x61, 0x72,\n\t\t\t0x61, 0x6e, 0x74, 0x65, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x77, 0x72, 0x69, 0x74,\n\t\t\t0x74, 0x65, 0x6e, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2c, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x6f, 0x75, 0x67, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x65, 0x63,\n\t\t\t0x68, 0x6e, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x67, 0x75, 0x61, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x65, 0x64, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t\t\t0x20, 0x77, 0x69, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x6f, 0x72, 0x65, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x20,\n\t\t\t0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x61, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x65, 0x61, 0x6d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x69, 0x6c,\n\t\t\t0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x20, 0x61, 0x6e,\n\t\t\t0x64, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x62, 0x79,\n\t\t\t0x20, 0x6f, 0x6e, 0x65, 0x20, 0x72, 0x61, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x61,\n\t\t\t0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x20, 0x73, 0x65,\n\t\t\t0x74, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x61, 0x74, 0x20, 0x6f, 0x6e, 0x63,\n\t\t\t0x65, 0x2e, 0x20, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x20, 0x61, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x77, 0x72, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x69, 0x6d, 0x69, 0x6c, 0x61, 0x72, 0x6c, 0x79, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x27,\n\t\t\t0x73, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x2d, 0x2d, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x74, 0x6f,\n\t\t\t0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x61, 0x74, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x62, 0x65, 0x66,\n\t\t\t0x6f, 0x72, 0x65, 0x20, 0x73, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,\n\t\t\t0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x6f, 0x75,\n\t\t\t0x72, 0x63, 0x65, 0x2d, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69,\n\t\t\t0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x6c, 0x69,\n\t\t\t0x73, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x5f, 0x74,\n\t\t\t0x6f, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x63,\n\t\t\t0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x33, 0x3b,\n\t\t\t0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x20, 0x77, 0x72,\n\t\t\t0x69, 0x74, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20, 0x43, 0x6f, 0x64, 0x65,\n\t\t\t0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x43, 0x6f, 0x64,\n\t\t\t0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x7b,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,\n\t\t\t0x20, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2c, 0x20, 0x63, 0x6f, 0x64, 0x65,\n\t\t\t0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x2e, 0x20,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x65, 0x78, 0x69, 0x74, 0x20, 0x77, 0x69, 0x74,\n\t\t\t0x68, 0x20, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x20, 0x65,\n\t\t\t0x76, 0x65, 0x6e, 0x20, 0x69, 0x66, 0x20, 0x69, 0x74, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x20, 0x61, 0x6e,\n\t\t\t0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x77, 0x61, 0x79, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c,\n\t\t\t0x64, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66,\n\t\t\t0x69, 0x6c, 0x65, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,\n\t\t\t0x6f, 0x72, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x63,\n\t\t\t0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x20, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73,\n\t\t\t0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x61, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x6c, 0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,\n\t\t\t0x20, 0x69, 0x74, 0x73, 0x65, 0x6c, 0x66, 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x73, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,\n\t\t\t0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x75, 0x6e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x68, 0x6f, 0x75,\n\t\t\t0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x77, 0x72,\n\t\t\t0x69, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73,\n\t\t\t0x74, 0x64, 0x65, 0x72, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x78, 0x69, 0x74, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x7a, 0x65, 0x72, 0x6f, 0x20, 0x73,\n\t\t\t0x74, 0x61, 0x74, 0x75, 0x73, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x31, 0x3b,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x62, 0x69, 0x74, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x74,\n\t\t\t0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,\n\t\t\t0x6f, 0x72, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x62, 0x69, 0x74, 0x77, 0x69, 0x73, 0x65, 0x20, 0x22, 0x6f, 0x72, 0x22,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65,\n\t\t\t0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x53, 0x79, 0x6e, 0x63, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x67, 0x65, 0x6e,\n\t\t\t0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x68, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x46, 0x65, 0x61,\n\t\t\t0x74, 0x75, 0x72, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x4e,\n\t\t\t0x4f, 0x4e, 0x45, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45,\n\t\t\t0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x20, 0x3d, 0x20, 0x31,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52,\n\t\t\t0x54, 0x53, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x20, 0x73,\n\t\t\t0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x74, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20,\n\t\t\t0x77, 0x65, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x75, 0x6e, 0x6b,\n\t\t\t0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x20, 0x73, 0x68, 0x6f,\n\t\t\t0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x20, 0x2a, 0x6e, 0x6f, 0x74,\n\t\t\t0x2a, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,\n\t\t\t0x2e, 0x20, 0x20, 0x4f, 0x6e, 0x6c, 0x79, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65,\n\t\t\t0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x61, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x55, 0x50, 0x50,\n\t\t\t0x4f, 0x52, 0x54, 0x53, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x20, 0x73, 0x65, 0x74, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6d, 0x69, 0x6e, 0x69,\n\t\t\t0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x74,\n\t\t\t0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x77, 0x65, 0x20, 0x77,\n\t\t\t0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x63,\n\t\t\t0x63, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x65, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x20, 0x2a, 0x6e, 0x6f, 0x74, 0x2a, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x4f,\n\t\t\t0x6e, 0x6c, 0x79, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63,\n\t\t\t0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x68,\n\t\t\t0x61, 0x76, 0x65, 0x20, 0x46, 0x45, 0x41, 0x54, 0x55, 0x52, 0x45, 0x5f, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x53,\n\t\t\t0x5f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x20, 0x73, 0x65, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f,\n\t\t\t0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52,\n\t\t\t0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x67,\n\t\t\t0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69,\n\t\t\t0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x64, 0x69, 0x72,\n\t\t\t0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x75,\n\t\t\t0x73, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t\t\t0x6e, 0x20, 0x22, 0x2e, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x22, 0x2e, 0x2e, 0x22, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e,\n\t\t\t0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6c,\n\t\t\t0x61, 0x74, 0x69, 0x76, 0x65, 0x2c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75,\n\t\t\t0x74, 0x65, 0x20, 0x28, 0x73, 0x6f, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66,\n\t\t\t0x69, 0x6c, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x69, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x73, 0x69,\n\t\t\t0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74,\n\t\t\t0x6f, 0x72, 0x79, 0x29, 0x2e, 0x20, 0x20, 0x22, 0x2f, 0x22, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x61, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61,\n\t\t\t0x74, 0x68, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x22, 0x5c,\n\t\t\t0x22, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x2c,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65,\n\t\t\t0x20, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x65,\n\t\t\t0x76, 0x69, 0x6f, 0x75, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x20, 0x20,\n\t\t\t0x54, 0x68, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65,\n\t\t\t0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65,\n\t\t\t0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x20, 0x63, 0x68,\n\t\t\t0x75, 0x6e, 0x6b, 0x73, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6c, 0x6c,\n\t\t\t0x6f, 0x77, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x74, 0x65,\n\t\t\t0x78, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x65, 0x64, 0x20, 0x62, 0x61,\n\t\t\t0x63, 0x6b, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x20, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x61, 0x74,\n\t\t\t0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20,\n\t\t\t0x6e, 0x65, 0x65, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x73, 0x69, 0x64, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70,\n\t\t\t0x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x20, 0x61, 0x74, 0x20,\n\t\t\t0x6f, 0x6e, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74,\n\t\t\t0x20, 0x61, 0x73, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x77,\n\t\t\t0x72, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e,\n\t\t\t0x6f, 0x74, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x2d, 0x2d, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x47,\n\t\t\t0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x62, 0x65, 0x66,\n\t\t\t0x6f, 0x72, 0x65, 0x20, 0x77, 0x72, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x6b, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2c, 0x20, 0x69,\n\t\t\t0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61,\n\t\t\t0x6d, 0x65, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x61, 0x6c, 0x72, 0x65,\n\t\t\t0x61, 0x64, 0x79, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69,\n\t\t\t0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74,\n\t\t\t0x6f, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x61, 0x74, 0x20, 0x61, 0x20, 0x64, 0x65, 0x66,\n\t\t\t0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75,\n\t\t\t0x72, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e,\n\t\t\t0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75,\n\t\t\t0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x6e, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20,\n\t\t\t0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67,\n\t\t\t0x69, 0x6e, 0x61, 0x6c, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x79, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x6c,\n\t\t\t0x6f, 0x6f, 0x6b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x3a, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x40, 0x40, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x5f, 0x69, 0x6e, 0x73, 0x65, 0x72,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x4e, 0x41, 0x4d, 0x45, 0x29, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,\n\t\t\t0x61, 0x6e, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x72, 0x62, 0x69, 0x74, 0x72, 0x61, 0x72, 0x79, 0x20, 0x74, 0x65,\n\t\t\t0x78, 0x74, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20,\n\t\t\t0x69, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x20, 0x69, 0x74, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x62, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x20, 0x20, 0x4e, 0x41, 0x4d, 0x45, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x20, 0x6e, 0x61, 0x6d,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x69, 0x73, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x67, 0x65, 0x6e, 0x65,\n\t\t\t0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f,\n\t\t\t0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x20, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c,\n\t\t\t0x20, 0x62, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6d,\n\t\t\t0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6c, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x28, 0x74, 0x68, 0x75,\n\t\t\t0x73, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e,\n\t\t\t0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65,\n\t\t\t0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x6f, 0x75, 0x74,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x77,\n\t\t\t0x65, 0x72, 0x65, 0x20, 0x61, 0x64, 0x64, 0x65, 0x64, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x2d, 0x40, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e,\n\t\t\t0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x69, 0x74, 0x20, 0x75, 0x6e, 0x6c, 0x69, 0x6b,\n\t\t\t0x65, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64,\n\t\t\t0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74,\n\t\t\t0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x62, 0x79, 0x20, 0x61, 0x63, 0x63, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65,\n\t\t\t0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x2b, 0x2b, 0x20, 0x63, 0x6f, 0x64, 0x65,\n\t\t\t0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x68, 0x20, 0x66, 0x69, 0x6c,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73,\n\t\t\t0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x40, 0x40, 0x70, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x63, 0x5f, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73,\n\t\t\t0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x61, 0x72,\n\t\t\t0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x20, 0x20, 0x41, 0x6e, 0x6f, 0x74,\n\t\t\t0x68, 0x65, 0x72, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20,\n\t\t\t0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69,\n\t\t\t0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65,\n\t\t\t0x73, 0x70, 0x61, 0x63, 0x65, 0x5f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x22, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x6e, 0x65,\n\t\t\t0x72, 0x61, 0x74, 0x65, 0x20, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x63, 0x6c, 0x61, 0x73,\n\t\t\t0x73, 0x65, 0x73, 0x20, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20,\n\t\t\t0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x68,\n\t\t\t0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x62, 0x65, 0x67,\n\t\t\t0x69, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x68, 0x69, 0x74,\n\t\t\t0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x77, 0x68, 0x69,\n\t\t\t0x74, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, 0x64, 0x65,\n\t\t\t0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x65, 0x64, 0x20, 0x74,\n\t\t\t0x65, 0x78, 0x74, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20,\n\t\t\t0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x73,\n\t\t\t0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65,\n\t\t\t0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x6f, 0x69,\n\t\t\t0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x68,\n\t\t\t0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20,\n\t\t\t0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e,\n\t\t\t0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63,\n\t\t\t0x74, 0x6c, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x63,\n\t\t\t0x6f, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x67,\n\t\t\t0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c,\n\t\t\t0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x77, 0x68,\n\t\t\t0x69, 0x63, 0x68, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x73, 0x20, 0x69,\n\t\t\t0x6e, 0x74, 0x6f, 0x20, 0x69, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x6f, 0x74, 0x68, 0x20, 0x72, 0x75, 0x6e,\n\t\t\t0x20, 0x61, 0x73, 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65,\n\t\t\t0x20, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x63, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72,\n\t\t\t0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x64, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x7c, 0x69,\n\t\t\t0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x7c, 0x20, 0x69, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x7c, 0x6e, 0x61, 0x6d, 0x65, 0x7c, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20,\n\t\t\t0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, 0x73,\n\t\t\t0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65,\n\t\t\t0x6e, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64,\n\t\t\t0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x65,\n\t\t\t0x64, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2c,\n\t\t\t0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69,\n\t\t\t0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20,\n\t\t\t0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x65, 0x64, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65,\n\t\t\t0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66,\n\t\t\t0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x47,\n\t\t\t0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x20, 0x67, 0x65, 0x6e,\n\t\t\t0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x20, 0x3d, 0x20, 0x31,\n\t\t\t0x36, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x69,\n\t\t\t0x6c, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/cpp_features.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x32, 0x33, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x42, 0x53, 0x44, 0x2d, 0x73, 0x74,\n\t\t\t0x79, 0x6c, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x74, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73,\n\t\t\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x73, 0x6f, 0x75,\n\t\t\t0x72, 0x63, 0x65, 0x2f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2f, 0x62, 0x73, 0x64, 0x0a, 0x0a, 0x73, 0x79,\n\t\t\t0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x22, 0x3b, 0x0a, 0x0a, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x70, 0x62, 0x3b, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x22, 0x67,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e,\n\t\t\t0x64, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65,\n\t\t\t0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,\n\t\t\t0x6c, 0x20, 0x43, 0x70, 0x70, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x63, 0x70, 0x70, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x30, 0x30, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x43, 0x70, 0x70,\n\t\t\t0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x68, 0x65, 0x74,\n\t\t\t0x68, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x65, 0x61, 0x74, 0x20,\n\t\t\t0x61, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x61, 0x73, 0x20, 0x63, 0x6c, 0x6f,\n\t\t\t0x73, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x62, 0x6c,\n\t\t\t0x65, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x61, 0x6e,\n\t\t\t0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x20, 0x69, 0x73, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x65, 0x6e, 0x75,\n\t\t\t0x6d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6c, 0x6f, 0x73, 0x65,\n\t\t\t0x64, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x3d, 0x20, 0x31, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74,\n\t\t\t0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52,\n\t\t\t0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x2c,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45,\n\t\t\t0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61,\n\t\t\t0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65,\n\t\t\t0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69,\n\t\t\t0x6e, 0x67, 0x3a, 0x20, 0x22, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x63, 0x6c, 0x6f, 0x73,\n\t\t\t0x65, 0x64, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x43, 0x2b, 0x2b, 0x20, 0x69, 0x73, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x65, 0x70,\n\t\t\t0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x73, 0x63, 0x68, 0x65, 0x64,\n\t\t\t0x75, 0x6c, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x32, 0x30, 0x32, 0x35, 0x2e, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x69,\n\t\t\t0x6e, 0x67, 0x2d, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x2f, 0x23, 0x63, 0x70, 0x70, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x69,\n\t\t\t0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f,\n\t\t\t0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x74, 0x72,\n\t\t\t0x75, 0x65, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a,\n\t\t\t0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x2c, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x3a, 0x20, 0x22, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e,\n\t\t\t0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x56, 0x49, 0x45, 0x57, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x43, 0x4f, 0x52, 0x44, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x5b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54,\n\t\t\t0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72,\n\t\t\t0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46,\n\t\t\t0x49, 0x45, 0x4c, 0x44, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20,\n\t\t\t0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72,\n\t\t\t0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d,\n\t\t\t0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x32, 0x30, 0x32, 0x34, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x56, 0x49, 0x45, 0x57, 0x22, 0x20,\n\t\t\t0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62,\n\t\t\t0x6f, 0x6f, 0x6c, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x73, 0x5f, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x69, 0x65, 0x77, 0x20, 0x3d, 0x20, 0x33, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49,\n\t\t\t0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67,\n\t\t\t0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e,\n\t\t\t0x55, 0x4d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41,\n\t\t\t0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64,\n\t\t\t0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a,\n\t\t\t0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x3a, 0x20, 0x22, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20,\n\t\t\t0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32,\n\t\t\t0x34, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x74, 0x72, 0x75, 0x65, 0x22, 0x20, 0x7d, 0x0a, 0x20,\n\t\t\t0x20, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/descriptor.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x3a, 0x20, 0x6b, 0x65, 0x6e, 0x74, 0x6f, 0x6e, 0x40, 0x67, 0x6f,\n\t\t\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x28, 0x4b, 0x65, 0x6e, 0x74, 0x6f, 0x6e, 0x20, 0x56, 0x61, 0x72,\n\t\t\t0x64, 0x61, 0x29, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x42, 0x61, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x6f, 0x72, 0x69,\n\t\t\t0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65,\n\t\t\t0x72, 0x73, 0x20, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x62, 0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x53, 0x61, 0x6e,\n\t\t\t0x6a, 0x61, 0x79, 0x20, 0x47, 0x68, 0x65, 0x6d, 0x61, 0x77, 0x61, 0x74, 0x2c, 0x20, 0x4a, 0x65, 0x66, 0x66, 0x20, 0x44,\n\t\t\t0x65, 0x61, 0x6e, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x41, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x64, 0x69,\n\t\t\t0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63,\n\t\t\t0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f,\n\t\t\t0x75, 0x74, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x72,\n\t\t\t0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x73, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x29, 0x2e,\n\t\t\t0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x22, 0x3b,\n\t\t\t0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61,\n\t\t\t0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22,\n\t\t\t0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22,\n\t\t\t0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f,\n\t\t\t0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,\n\t\t\t0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,\n\t\t\t0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65,\n\t\t\t0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f,\n\t\t\t0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22,\n\t\t\t0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61,\n\t\t\t0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x64, 0x65,\n\t\t\t0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d,\n\t\t\t0x73, 0x20, 0x64, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x62, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x53, 0x50, 0x45,\n\t\t\t0x45, 0x44, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,\n\t\t\t0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74,\n\t\t\t0x20, 0x61, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74,\n\t\t\t0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x74, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65,\n\t\t\t0x73, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x78,\n\t\t\t0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x69, 0x6e, 0x67,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x35, 0x33, 0x36, 0x30, 0x30,\n\t\t\t0x30, 0x30, 0x30, 0x30, 0x20, 0x5b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20,\n\t\t\t0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x20, 0x35, 0x33, 0x36, 0x30, 0x30, 0x30,\n\t\t\t0x30, 0x30, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e,\n\t\t\t0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65,\n\t\t\t0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t\t\t0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x62,\n\t\t\t0x75, 0x66, 0x2e, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x75, 0x66,\n\t\t\t0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x73, 0x65, 0x74,\n\t\t\t0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x0a, 0x20, 0x20, 0x7d, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x65, 0x6e, 0x75, 0x6d,\n\t\t\t0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x70, 0x6c,\n\t\t\t0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x75, 0x6e, 0x6b,\n\t\t\t0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20,\n\t\t\t0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c, 0x64,\n\t\t\t0x65, 0x72, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69,\n\t\t\t0x66, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69,\n\t\t\t0x6f, 0x72, 0x73, 0x20, 0x2a, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x2a, 0x20, 0x61, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75,\n\t\t\t0x72, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x61, 0x73, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x69, 0x6e,\n\t\t\t0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x65,\n\t\t\t0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x20, 0x61, 0x6e, 0x20, 0x22, 0x69, 0x6e, 0x66, 0x69, 0x6e,\n\t\t\t0x69, 0x74, 0x65, 0x20, 0x70, 0x61, 0x73, 0x74, 0x22, 0x2e, 0x0a, 0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x20, 0x3d, 0x20, 0x39, 0x30, 0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x22, 0x65, 0x64, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x70, 0x72, 0x65, 0x2d, 0x64, 0x61,\n\t\t\t0x74, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x62, 0x65, 0x68,\n\t\t\t0x61, 0x76, 0x65, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64,\n\t\t\t0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x20, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x73, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x27, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x6c, 0x65,\n\t\t\t0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x32, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,\n\t\t\t0x73, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x73,\n\t\t\t0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x45, 0x44,\n\t\t\t0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x38, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x20, 0x3d, 0x20, 0x39,\n\t\t\t0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x74,\n\t\t\t0x68, 0x61, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x62, 0x65, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,\n\t\t\t0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x72, 0x62, 0x69, 0x74, 0x72, 0x61, 0x72, 0x79, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x79, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x62, 0x65, 0x20, 0x74,\n\t\t\t0x69, 0x6d, 0x65, 0x2d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x73, 0x79,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x30, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x30,\n\t\t\t0x30, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x68, 0x6f, 0x6c,\n\t\t\t0x64, 0x65, 0x72, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x76, 0x65,\n\t\t\t0x6c, 0x6f, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x75,\n\t\t\t0x6e, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x20,\n\t\t\t0x3d, 0x20, 0x39, 0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x68,\n\t\t\t0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c,\n\t\t\t0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,\n\t\t\t0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x6f, 0x72,\n\t\t\t0x20, 0x72, 0x65, 0x6c, 0x69, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x73, 0x69, 0x64, 0x65, 0x20, 0x6f,\n\t\t\t0x66, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x31,\n\t\t\t0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x45, 0x44,\n\t\t\t0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x20, 0x3d, 0x20,\n\t\t\t0x32, 0x3b, 0x0a, 0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x37, 0x5f, 0x54,\n\t\t\t0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x39, 0x39, 0x37, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x38, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f,\n\t\t\t0x4e, 0x4c, 0x59, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x39, 0x39, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49,\n\t\t\t0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x20, 0x3d,\n\t\t\t0x20, 0x39, 0x39, 0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x68,\n\t\t\t0x6f, 0x6c, 0x64, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x75, 0x6e, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73,\n\t\t\t0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x76, 0x65, 0x72, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20,\n\t\t\t0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20,\n\t\t\t0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x61, 0x20, 0x6e, 0x65,\n\t\t\t0x77, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x4d, 0x41, 0x58, 0x20, 0x3d, 0x20, 0x30, 0x78, 0x37, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x3b, 0x0a, 0x7d,\n\t\t\t0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,\n\t\t\t0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74,\n\t\t\t0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63,\n\t\t\t0x65, 0x20, 0x74, 0x72, 0x65, 0x65, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x22, 0x66, 0x6f, 0x6f, 0x22, 0x2c, 0x20, 0x22, 0x66, 0x6f, 0x6f, 0x2e, 0x62,\n\t\t\t0x61, 0x72, 0x22, 0x2c, 0x20, 0x65, 0x74, 0x63, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x61, 0x6d, 0x65,\n\t\t\t0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e,\n\t\t\t0x63, 0x79, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x70,\n\t\t\t0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x70, 0x75, 0x62,\n\t\t\t0x6c, 0x69, 0x63, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x77, 0x65, 0x61, 0x6b, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x6c,\n\t\t\t0x69, 0x73, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t\t\t0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x6f, 0x6e, 0x6c, 0x79, 0x2e, 0x20, 0x44, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x73, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x77, 0x65, 0x61, 0x6b, 0x5f,\n\t\t\t0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x6d,\n\t\t\t0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20,\n\t\t\t0x70, 0x75, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x72, 0x70, 0x6f,\n\t\t\t0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x66,\n\t\t\t0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x6c,\n\t\t\t0x69, 0x73, 0x74, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x65,\n\t\t\t0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41,\n\t\t\t0x6c, 0x6c, 0x20, 0x74, 0x6f, 0x70, 0x2d, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72,\n\t\t\t0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d,\n\t\t\t0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x44,\n\t\t\t0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x5f,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x72,\n\t\t\t0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,\n\t\t\t0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d,\n\t\t\t0x20, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x69, 0x6c, 0x65,\n\t\t\t0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x38, 0x3b,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x63, 0x6f,\n\t\t\t0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x66, 0x6f,\n\t\t\t0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72,\n\t\t\t0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x73, 0x61, 0x66, 0x65, 0x6c, 0x79, 0x20,\n\t\t\t0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x68, 0x61, 0x72, 0x6d, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79,\n\t\t\t0x20, 0x62, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x6d, 0x65, 0x6e, 0x74,\n\t\t\t0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x53,\n\t\t\t0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,\n\t\t\t0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x20, 0x3d, 0x20, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x61, 0x72,\n\t\t\t0x65, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x22, 0x2c, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22,\n\t\t\t0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x22, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x60, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x60,\n\t\t\t0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x22, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x22, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79,\n\t\t\t0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t\t\t0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65,\n\t\t\t0x72, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67,\n\t\t\t0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65,\n\t\t\t0x72, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e,\n\t\t\t0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20,\n\t\t\t0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65,\n\t\t\t0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72,\n\t\t\t0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,\n\t\t\t0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65,\n\t\t\t0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72,\n\t\t\t0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x64, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,\n\t\t\t0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x3d, 0x20, 0x32, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x6e, 0x65, 0x73, 0x74,\n\t\t\t0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52,\n\t\t\t0x61, 0x6e, 0x67, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t\t\t0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65,\n\t\t\t0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x64, 0x65, 0x63, 0x6c,\n\t\t\t0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x74, 0x61, 0x67, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,\n\t\t\t0x73, 0x2e, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x74, 0x61, 0x67, 0x20, 0x6e, 0x75, 0x6d, 0x62,\n\t\t\t0x65, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20,\n\t\t\t0x62, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x78,\n\t\t\t0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x52, 0x65, 0x73, 0x65,\n\t\t\t0x72, 0x76, 0x65, 0x64, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x73,\n\t\t\t0x74, 0x61, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73,\n\t\t\t0x69, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e,\n\t\t\t0x74, 0x33, 0x32, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45,\n\t\t\t0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x39, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x73, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x61, 0x79,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x6f, 0x6e,\n\t\t\t0x63, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x30,\n\t\t\t0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x60, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x60, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x60, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x60,\n\t\t\t0x20, 0x6b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x56, 0x69, 0x73,\n\t\t\t0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x78, 0x74, 0x65,\n\t\t\t0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73, 0x74, 0x6f, 0x72,\n\t\t\t0x65, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27,\n\t\t\t0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x20, 0x53, 0x65,\n\t\t\t0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x3d, 0x20, 0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x44,\n\t\t\t0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,\n\t\t\t0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6e, 0x75, 0x6d,\n\t\t\t0x62, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x61, 0x20, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x6f, 0x74,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x66, 0x72, 0x6f, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c,\n\t\t\t0x6c, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20,\n\t\t\t0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79,\n\t\t\t0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x2e, 0x20, 0x55, 0x6e, 0x6c, 0x69, 0x6b, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4d,\n\t\t\t0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65,\n\t\t\t0x20, 0x61, 0x20, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65,\n\t\t\t0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x69,\n\t\t\t0x73, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78,\n\t\t\t0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65,\n\t\t\t0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69,\n\t\t\t0x6c, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x20, 0x65, 0x78, 0x74, 0x65,\n\t\t\t0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74,\n\t\t\t0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f,\n\t\t\t0x6c, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x61, 0x73,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x74,\n\t\t\t0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x61, 0x73,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20,\n\t\t\t0x36, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x34, 0x3b, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78,\n\t\t\t0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x72, 0x73, 0x3a, 0x20, 0x44, 0x4f, 0x20, 0x4e, 0x4f, 0x54,\n\t\t\t0x20, 0x55, 0x53, 0x45, 0x2e, 0x20, 0x57, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72,\n\t\t\t0x63, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x78, 0x65, 0x63,\n\t\t\t0x75, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x63, 0x6c, 0x65, 0x61, 0x6e,\n\t\t\t0x75, 0x70, 0x73, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c,\n\t\t\t0x79, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20,\n\t\t\t0x32, 0x20, 0x5b, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e,\n\t\t\t0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x41, 0x6e, 0x79, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61,\n\t\t\t0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x35,\n\t\t\t0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65,\n\t\t\t0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e,\n\t\t\t0x75, 0x6d, 0x20, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78,\n\t\t\t0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x61, 0x6e, 0x67,\n\t\t\t0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66,\n\t\t\t0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x66,\n\t\t\t0x6c, 0x69, 0x70, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x44,\n\t\t\t0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x20,\n\t\t\t0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x72,\n\t\t\t0x65, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49,\n\t\t\t0x45, 0x44, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x56, 0x65, 0x72, 0x69, 0x66,\n\t\t\t0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x33, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5b, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x2c, 0x20, 0x72,\n\t\t\t0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65,\n\t\t\t0x6e, 0x74, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f,\n\t\t\t0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,\n\t\t\t0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e,\n\t\t\t0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30, 0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x0a,\n\t\t\t0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,\n\t\t\t0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x54, 0x79,\n\t\t\t0x70, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x30, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x77, 0x65, 0x69, 0x72, 0x64, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f,\n\t\t\t0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x20,\n\t\t\t0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x5a, 0x69, 0x67, 0x5a,\n\t\t\t0x61, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x4e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76,\n\t\t\t0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x31, 0x30, 0x20, 0x62, 0x79,\n\t\t\t0x74, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x55, 0x73, 0x65, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x36,\n\t\t\t0x34, 0x20, 0x69, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x79, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x34, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x5a, 0x69, 0x67, 0x5a, 0x61, 0x67, 0x20, 0x65,\n\t\t\t0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x4e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6e, 0x75,\n\t\t\t0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x31, 0x30, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e,\n\t\t\t0x20, 0x20, 0x55, 0x73, 0x65, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x20, 0x69, 0x66,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x20, 0x3d, 0x20, 0x39, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x61, 0x67, 0x2d, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47,\n\t\t\t0x72, 0x6f, 0x75, 0x70, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x2e, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x72,\n\t\t\t0x6f, 0x75, 0x70, 0x20, 0x77, 0x69, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x72, 0x65, 0x61, 0x74, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x73, 0x20, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x20, 0x77, 0x69, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c,\n\t\t\t0x65, 0x64, 0x20, 0x76, 0x69, 0x61, 0x20, 0x74, 0x68, 0x65, 0x20, 0x60, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f,\n\t\t\t0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x60, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x20, 0x3d, 0x20, 0x31,\n\t\t\t0x31, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x69, 0x6e, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x20, 0x3d, 0x20, 0x31, 0x32,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33,\n\t\t\t0x32, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49,\n\t\t\t0x58, 0x45, 0x44, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45,\n\t\t\t0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x31, 0x37, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73,\n\t\t\t0x65, 0x73, 0x20, 0x5a, 0x69, 0x67, 0x5a, 0x61, 0x67, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x38,\n\t\t\t0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x73, 0x20, 0x5a, 0x69, 0x67, 0x5a, 0x61, 0x67, 0x20, 0x65, 0x6e,\n\t\t\t0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20,\n\t\t\t0x4c, 0x61, 0x62, 0x65, 0x6c, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x30, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54,\n\t\t\t0x45, 0x44, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x72,\n\t\t\t0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x6c,\n\t\t\t0x79, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x69, 0x74, 0x27, 0x73, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x20, 0x70, 0x72, 0x6f,\n\t\t\t0x68, 0x69, 0x62, 0x69, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x60, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,\n\t\t\t0x63, 0x65, 0x60, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x41, 0x42,\n\t\t\t0x45, 0x4c, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,\n\t\t\t0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x20, 0x6c, 0x61, 0x62, 0x65,\n\t\t\t0x6c, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x73, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6e,\n\t\t\t0x65, 0x65, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20,\n\t\t\t0x62, 0x6f, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x54, 0x59,\n\t\t\t0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x2c, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47,\n\t\t\t0x45, 0x20, 0x6f, 0x72, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x2e, 0x0a, 0x20, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x54, 0x79, 0x70, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20,\n\t\t\t0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x27,\n\t\t\t0x2e, 0x27, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x2d, 0x71, 0x75, 0x61, 0x6c,\n\t\t\t0x69, 0x66, 0x69, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x2c, 0x20, 0x43,\n\t\t\t0x2b, 0x2b, 0x2d, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x73, 0x63, 0x6f, 0x70, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x66,\n\t\t\t0x69, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x20, 0x66,\n\t\t\t0x69, 0x72, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x65, 0x64, 0x2c,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72,\n\t\t\t0x65, 0x6e, 0x74, 0x2c, 0x20, 0x6f, 0x6e, 0x20, 0x75, 0x70, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f,\n\t\t\t0x6f, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x29, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46,\n\t\t\t0x6f, 0x72, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,\n\t\t\t0x79, 0x70, 0x65, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x2e, 0x20,\n\t\t\t0x20, 0x49, 0x74, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x20,\n\t\t\t0x61, 0x73, 0x20, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65,\n\t\t\t0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6e, 0x75, 0x6d, 0x65,\n\t\t\t0x72, 0x69, 0x63, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x62, 0x6f, 0x6f, 0x6c,\n\t\t\t0x65, 0x61, 0x6e, 0x73, 0x2c, 0x20, 0x22, 0x74, 0x72, 0x75, 0x65, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x22, 0x66, 0x61, 0x6c,\n\t\t\t0x73, 0x65, 0x22, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n\t\t\t0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x28, 0x6e,\n\t\t\t0x6f, 0x74, 0x20, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x77, 0x61,\n\t\t\t0x79, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2c, 0x20,\n\t\t\t0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x20, 0x65, 0x73, 0x63, 0x61, 0x70,\n\t\t\t0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73,\n\t\t\t0x20, 0x3e, 0x3d, 0x20, 0x31, 0x32, 0x38, 0x20, 0x61, 0x72, 0x65, 0x20, 0x65, 0x73, 0x63, 0x61, 0x70, 0x65, 0x64, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x27, 0x73, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x6c, 0x69, 0x73, 0x74, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x61, 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x6f, 0x6e,\n\t\t\t0x65, 0x6f, 0x66, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33,\n\t\t\t0x32, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x3d, 0x20, 0x39, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x73, 0x65, 0x74, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x63,\n\t\t\t0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x68, 0x61, 0x73, 0x20, 0x73, 0x65, 0x74, 0x20, 0x61, 0x20, 0x22, 0x6a, 0x73, 0x6f,\n\t\t\t0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x27, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x2c, 0x20,\n\t\t\t0x69, 0x74, 0x27, 0x73, 0x20, 0x64, 0x65, 0x64, 0x75, 0x63, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x27, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x62, 0x79, 0x20, 0x63, 0x6f,\n\t\t\t0x6e, 0x76, 0x65, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x63, 0x61, 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,\n\t\t\t0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x38, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x2e, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2c, 0x20,\n\t\t\t0x69, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65,\n\t\t\t0x6e, 0x63, 0x65, 0x20, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x57, 0x68, 0x65, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,\n\t\t\t0x20, 0x69, 0x73, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x6f, 0x6e,\n\t\t\t0x65, 0x6f, 0x66, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x6f, 0x6c, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73,\n\t\t\t0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x72,\n\t\t\t0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x22, 0x73, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74,\n\t\t\t0x69, 0x63, 0x22, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20,\n\t\t\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x69, 0x74, 0x73, 0x20, 0x73, 0x6f,\n\t\t\t0x6c, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x28, 0x65, 0x61, 0x63, 0x68,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x20, 0x67, 0x65, 0x74, 0x73, 0x20, 0x69, 0x74, 0x73, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x73, 0x79, 0x6e, 0x74,\n\t\t\t0x68, 0x65, 0x74, 0x69, 0x63, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x29, 0x2e, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x68, 0x65,\n\t\t\t0x74, 0x69, 0x63, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x78, 0x69, 0x73,\n\t\t\t0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x20,\n\t\t\t0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x67, 0x65, 0x6e,\n\t\t\t0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x41, 0x50, 0x49, 0x2e, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x68,\n\t\t\t0x65, 0x74, 0x69, 0x63, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d, 0x75, 0x73,\n\t\t\t0x74, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x61,\n\t\t\t0x6c, 0x6c, 0x20, 0x22, 0x72, 0x65, 0x61, 0x6c, 0x22, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x73, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61,\n\t\t\t0x6e, 0x79, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x72, 0x65, 0x70, 0x65, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61,\n\t\t\t0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65,\n\t\t\t0x2e, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x20, 0x69, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65,\n\t\t\t0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x68, 0x65,\n\t\t\t0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x77, 0x72, 0x6f, 0x74, 0x65, 0x20,\n\t\t\t0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x66,\n\t\t\t0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x74, 0x72, 0x69, 0x70, 0x70, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x20, 0x46,\n\t\t\t0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x20, 0x77, 0x65, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x67, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x73, 0x20, 0x61, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x68, 0x65, 0x74, 0x69, 0x63, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66,\n\t\t\t0x20, 0x61, 0x6c, 0x73, 0x6f, 0x2c, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x69,\n\t\t\t0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65,\n\t\t\t0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x65, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x6c, 0x79,\n\t\t\t0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x27, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x74, 0x65, 0x6c, 0x6c, 0x20, 0x69, 0x66, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d,\n\t\t\t0x2c, 0x20, 0x73, 0x6f, 0x20, 0x69, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20,\n\t\t\t0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x68, 0x65,\n\t\t\t0x74, 0x69, 0x63, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x73, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20,\n\t\t\t0x66, 0x6c, 0x61, 0x67, 0x2c, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61,\n\t\t\t0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x60, 0x4c, 0x41, 0x42, 0x45,\n\t\t\t0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x60, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x31, 0x37, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65,\n\t\t\t0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a,\n\t\t\t0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75,\n\t\t\t0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x73, 0x2e, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,\n\t\t\t0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x73, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20,\n\t\t\t0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x6c,\n\t\t\t0x61, 0x70, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x63, 0x74,\n\t\t\t0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74,\n\t\t\t0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75,\n\t\t\t0x73, 0x69, 0x76, 0x65, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x20, 0x63, 0x61,\n\t\t\t0x6e, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x70, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x20, 0x69, 0x6e, 0x74,\n\t\t\t0x33, 0x32, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61,\n\t\t\t0x6e, 0x67, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69,\n\t\t\t0x6e, 0x74, 0x33, 0x32, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x7d, 0x0a,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72,\n\t\t\t0x76, 0x65, 0x64, 0x20, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x20,\n\t\t\t0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x79, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x64, 0x65, 0x63,\n\t\t\t0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x72,\n\t\t\t0x61, 0x6e, 0x67, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f,\n\t\t\t0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x45,\n\t\t\t0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x79, 0x20,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x20, 0x41, 0x20, 0x67, 0x69, 0x76,\n\t\t\t0x65, 0x6e, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65,\n\t\t\t0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x65, 0x78, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x60, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x60, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x60, 0x20, 0x6b, 0x65, 0x79, 0x77,\n\t\t\t0x6f, 0x72, 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69,\n\t\t\t0x74, 0x79, 0x20, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x7d,\n\t\t\t0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x0a, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63,\n\t\t\t0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6e,\n\t\t\t0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44,\n\t\t\t0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x0a,\n\t\t\t0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65,\n\t\t\t0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,\n\t\t\t0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65,\n\t\t\t0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x34, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x22, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22,\n\t\t\t0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x61, 0x20,\n\t\t\t0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,\n\t\t\t0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x75, 0x74,\n\t\t\t0x70, 0x75, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x73, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x77, 0x61, 0x79, 0x20, 0x61, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x2e, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x75,\n\t\t\t0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x69, 0x66, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x63, 0x6c,\n\t\t\t0x69, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72,\n\t\t\t0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x35, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20,\n\t\t\t0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x64, 0x65, 0x6e, 0x74,\n\t\t\t0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x69, 0x66, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x74, 0x72, 0x65,\n\t\t\t0x61, 0x6d, 0x73, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20,\n\t\t\t0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x3d, 0x20, 0x36, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c,\n\t\t\t0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x6f,\n\t\t\t0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x62,\n\t\t\t0x6f, 0x76, 0x65, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x22, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20,\n\t\t\t0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20,\n\t\t\t0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x73, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x6c, 0x79, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x6c,\n\t\t\t0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20,\n\t\t\t0x68, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20,\n\t\t\t0x6d, 0x61, 0x6e, 0x69, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,\n\t\t\t0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69,\n\t\t\t0x65, 0x6e, 0x74, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74,\n\t\t\t0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x73, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x2a, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20,\n\t\t\t0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x79,\n\t\t\t0x65, 0x74, 0x20, 0x62, 0x65, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x61, 0x74, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73,\n\t\t\t0x65, 0x72, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x2e, 0x20, 0x20,\n\t\t\t0x49, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x69, 0x74, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x2a, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65,\n\t\t\t0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x2a,\n\t\t\t0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x20, 0x57, 0x65,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x77, 0x65, 0x20, 0x62,\n\t\t\t0x75, 0x69, 0x6c, 0x64, 0x20, 0x61, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2c, 0x20, 0x61,\n\t\t\t0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x62, 0x65, 0x65, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x70, 0x61,\n\t\t\t0x72, 0x73, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x65, 0x78, 0x74, 0x65,\n\t\t\t0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,\n\t\t\t0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x63, 0x68, 0x6f, 0x73, 0x65, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x66, 0x6f,\n\t\t\t0x6c, 0x6c, 0x6f, 0x77, 0x73, 0x3a, 0x0a, 0x2f, 0x2f, 0x20, 0x2a, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e,\n\t\t\t0x67, 0x6c, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x72, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x6f, 0x72,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x75, 0x6d,\n\t\t\t0x62, 0x65, 0x72, 0x73, 0x20, 0x35, 0x30, 0x30, 0x30, 0x30, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x74, 0x68, 0x72, 0x6f,\n\t\t\t0x75, 0x67, 0x68, 0x20, 0x39, 0x39, 0x39, 0x39, 0x39, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x20, 0x69, 0x73, 0x20, 0x75, 0x70,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x20, 0x74, 0x68,\n\t\t\t0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x2a, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x68,\n\t\t\t0x69, 0x63, 0x68, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65,\n\t\t\t0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x6c, 0x79, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x69, 0x6e, 0x64,\n\t\t\t0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x65,\n\t\t\t0x2d, 0x6d, 0x61, 0x69, 0x6c, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x67, 0x6c, 0x6f, 0x62, 0x61,\n\t\t\t0x6c, 0x2d, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79,\n\t\t\t0x40, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75,\n\t\t\t0x6d, 0x62, 0x65, 0x72, 0x73, 0x2e, 0x20, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64,\n\t\t\t0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x28, 0x65, 0x2e, 0x67, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65,\n\t\t\t0x2d, 0x43, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x29, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x20, 0x28, 0x69, 0x66, 0x20,\n\t\t\t0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x29, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x27,\n\t\t\t0x73, 0x20, 0x6e, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x78,\n\t\t\t0x70, 0x6c, 0x61, 0x69, 0x6e, 0x20, 0x68, 0x6f, 0x77, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x6e, 0x64,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x2e, 0x20, 0x55, 0x73, 0x75, 0x61, 0x6c, 0x6c,\n\t\t\t0x79, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x65, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65,\n\t\t\t0x72, 0x2e, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x65, 0x20, 0x6d,\n\t\t\t0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x70, 0x75, 0x74, 0x74, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x73, 0x75, 0x62, 0x2d, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d,\n\t\t\t0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x78,\n\t\t\t0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x3a, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f,\n\t\t\t0x2f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63,\n\t\t\t0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f,\n\t\t\t0x64, 0x6f, 0x63, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x23, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x6f, 0x75,\n\t\t\t0x74, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x72, 0x2c, 0x20, 0x61, 0x20, 0x77,\n\t\t\t0x65, 0x62, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x73,\n\t\t\t0x65, 0x74, 0x20, 0x75, 0x70, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61,\n\t\t\t0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x2e, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x53, 0x65, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x65,\n\t\t\t0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x2e, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x6c, 0x61, 0x63,\n\t\t\t0x65, 0x64, 0x2e, 0x20, 0x20, 0x42, 0x79, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x64, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x66, 0x74, 0x65,\n\t\t\t0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65,\n\t\t\t0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61,\n\t\t\t0x67, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c, 0x79, 0x20,\n\t\t\t0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x73,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6a, 0x61,\n\t\t\t0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x20,\n\t\t\t0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x61, 0x74, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x6c,\n\t\t\t0x77, 0x61, 0x79, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x67, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x28, 0x29, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x61, 0x73, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x77, 0x65, 0x6c, 0x6c, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x74, 0x6f, 0x70, 0x2d, 0x6c, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e,\n\t\t\t0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c,\n\t\t\t0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74,\n\t\t\t0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c,\n\t\t\t0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x74, 0x68,\n\t\t\t0x65, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x6c,\n\t\t\t0x6c, 0x20, 0x62, 0x65, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x6f, 0x75,\n\t\t\t0x74, 0x65, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,\n\t\t\t0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f,\n\t\t\t0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x49, 0x66, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f,\n\t\t\t0x72, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x61, 0x20, 0x73, 0x65,\n\t\t\t0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x20, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69,\n\t\t\t0x6c, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x74, 0x6f, 0x70, 0x2d, 0x6c, 0x65, 0x76, 0x65,\n\t\t\t0x6c, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2c, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x6c, 0x65,\n\t\t\t0x2e, 0x20, 0x20, 0x54, 0x68, 0x75, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73,\n\t\t\t0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x2a, 0x6e, 0x6f, 0x74, 0x2a, 0x20, 0x62, 0x65, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72,\n\t\t\t0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x20, 0x62, 0x79,\n\t\t\t0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x2e, 0x20, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x72, 0x61,\n\t\t\t0x70, 0x70, 0x65, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x73, 0x74, 0x69, 0x6c,\n\t\t\t0x6c, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x27,\n\t\t\t0x73, 0x20, 0x67, 0x65, 0x74, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x28, 0x29, 0x20, 0x6d, 0x65,\n\t\t\t0x74, 0x68, 0x6f, 0x64, 0x20, 0x61, 0x73, 0x20, 0x77, 0x65, 0x6c, 0x6c, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x79, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x70, 0x2d, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e,\n\t\t\t0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f,\n\t\t\t0x6f, 0x6c, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c,\n\t\t\t0x65, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66,\n\t\t\t0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f,\n\t\t\t0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f,\n\t\t\t0x68, 0x61, 0x73, 0x68, 0x20, 0x3d, 0x20, 0x32, 0x30, 0x20, 0x5b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x32, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x70, 0x74, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77,\n\t\t\t0x69, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x69, 0x66, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x55, 0x54, 0x46, 0x2d, 0x38, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77,\n\t\t\t0x69, 0x72, 0x65, 0x20, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x63, 0x6c, 0x61, 0x72,\n\t\t\t0x69, 0x66, 0x79, 0x20, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x77, 0x68, 0x61, 0x74, 0x20, 0x6b, 0x69, 0x6e,\n\t\t\t0x64, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x6f, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x6c, 0x79,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x66,\n\t\t\t0x69, 0x6c, 0x65, 0x73, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2e, 0x20, 0x53, 0x65, 0x74, 0x74, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63,\n\t\t\t0x69, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x20, 0x68,\n\t\t\t0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x69, 0x74, 0x20, 0x63, 0x61, 0x6e,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x70, 0x74, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x55,\n\t\t\t0x54, 0x46, 0x2d, 0x38, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x75, 0x74, 0x66, 0x38, 0x20, 0x3d, 0x20, 0x32,\n\t\t\t0x37, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x61,\n\t\t\t0x73, 0x73, 0x65, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65,\n\t\t\t0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20,\n\t\t\t0x73, 0x69, 0x7a, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a,\n\t\t\t0x65, 0x4d, 0x6f, 0x64, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53, 0x50, 0x45, 0x45, 0x44, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x3b, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,\n\t\t\t0x74, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x66, 0x6f, 0x72,\n\t\t\t0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x74, 0x63, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x73, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x6d,\n\t\t\t0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x49, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e,\n\t\t\t0x54, 0x49, 0x4d, 0x45, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,\n\t\t\t0x74, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x4c, 0x69, 0x74, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x74, 0x65, 0x20, 0x72,\n\t\t\t0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x39, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,\n\t\t\t0x74, 0x20, 0x3d, 0x20, 0x53, 0x50, 0x45, 0x45, 0x44, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x65,\n\t\t\t0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x6f, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x77, 0x68,\n\t\t\t0x65, 0x72, 0x65, 0x20, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x77,\n\t\t\t0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x2e, 0x20,\n\t\t\t0x49, 0x66, 0x20, 0x6f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x6f, 0x20, 0x70,\n\t\t\t0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e,\n\t\t\t0x67, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x54, 0x68, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x70, 0x61, 0x74, 0x68, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x70, 0x72, 0x6f, 0x76,\n\t\t\t0x69, 0x64, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72,\n\t\t\t0x77, 0x69, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x73, 0x74,\n\t\t\t0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x69, 0x66, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x2c, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x62, 0x61, 0x73, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74,\n\t\t\t0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x3d, 0x20, 0x31, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20,\n\t\t\t0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x6c, 0x61,\n\t\t\t0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x3f, 0x20, 0x20, 0x22, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x22, 0x20, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74,\n\t\t\t0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x61, 0x72,\n\t\t\t0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x52, 0x50, 0x43, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x20,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x63, 0x6f, 0x64,\n\t\t\t0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x61, 0x63, 0x68,\n\t\t\t0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x20, 0x28, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x61,\n\t\t\t0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x29, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,\n\t\t\t0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6b, 0x69, 0x6e, 0x64,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x67,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,\n\t\t\t0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x65,\n\t\t\t0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x66, 0x61, 0x76, 0x6f,\n\t\t\t0x72, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x64, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20,\n\t\t\t0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x52, 0x50, 0x43, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65,\n\t\t\t0x6d, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x66, 0x61, 0x6c,\n\t\t\t0x73, 0x65, 0x2e, 0x20, 0x20, 0x4f, 0x6c, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20,\n\t\t\t0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76,\n\t\t\t0x69, 0x63, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x36, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d,\n\t\t\t0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65,\n\t\t\t0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x37, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,\n\t\t\t0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,\n\t\t\t0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x70, 0x79, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65,\n\t\t\t0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x38, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,\n\t\t\t0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,\n\t\t\t0x64, 0x20, 0x34, 0x32, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x70, 0x68,\n\t\t\t0x70, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x0a, 0x20,\n\t\t\t0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x22, 0x70, 0x68, 0x70, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72,\n\t\t\t0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x49, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x3f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f,\n\t\t\t0x72, 0x6d, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x69, 0x74, 0x20, 0x44, 0x65,\n\t\t\t0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x74, 0x20,\n\t\t\t0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x69,\n\t\t\t0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x79, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x61, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65,\n\t\t\t0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x32, 0x33, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20,\n\t\t\t0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x72, 0x65, 0x6e, 0x61,\n\t\t\t0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x20, 0x54,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x6e, 0x6c,\n\t\t\t0x79, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73,\n\t\t\t0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x43, 0x2b, 0x2b, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72,\n\t\t\t0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x31, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d,\n\t\t\t0x20, 0x74, 0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x65, 0x74, 0x73, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x63, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73,\n\t\t\t0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x65,\n\t\t\t0x70, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,\n\t\t\t0x69, 0x76, 0x65, 0x20, 0x63, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x2e,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65,\n\t\t\t0x66, 0x69, 0x78, 0x20, 0x3d, 0x20, 0x33, 0x36, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x61, 0x6d, 0x65,\n\t\t\t0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x3b, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x33, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x42, 0x79, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x53, 0x77, 0x69, 0x66, 0x74, 0x20, 0x67, 0x65,\n\t\t\t0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x43, 0x61, 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x20, 0x69, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72,\n\t\t\t0x65, 0x70, 0x6c, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x20, 0x27, 0x2e, 0x27, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x75, 0x6e,\n\t\t\t0x64, 0x65, 0x72, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61,\n\t\t\t0x74, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x73, 0x2f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e,\n\t\t\t0x65, 0x64, 0x2e, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20,\n\t\t\t0x77, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20,\n\t\t\t0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x65, 0x66,\n\t\t\t0x69, 0x78, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73,\n\t\t\t0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78,\n\t\t\t0x20, 0x3d, 0x20, 0x33, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x65, 0x74, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x70, 0x68, 0x70, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x77,\n\t\t\t0x68, 0x69, 0x63, 0x68, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x68, 0x70, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63,\n\t\t\t0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x68, 0x70, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66,\n\t\t\t0x69, 0x78, 0x20, 0x3d, 0x20, 0x34, 0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x68,\n\t\t\t0x70, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2e,\n\t\t\t0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70,\n\t\t\t0x74, 0x79, 0x2e, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61,\n\t\t\t0x67, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x68, 0x70, 0x5f, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x70, 0x68, 0x70, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6d, 0x65,\n\t\t\t0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x20, 0x57,\n\t\t\t0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x65,\n\t\t\t0x6d, 0x70, 0x74, 0x79, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65,\n\t\t\t0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x68, 0x70, 0x5f, 0x6d, 0x65, 0x74,\n\t\t\t0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x34,\n\t\t\t0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x75, 0x62, 0x79, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2e, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x20, 0x57, 0x68, 0x65, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20,\n\t\t\t0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x72, 0x75, 0x62, 0x79, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x70, 0x61, 0x63,\n\t\t\t0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79,\n\t\t\t0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20,\n\t\t\t0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65,\n\t\t\t0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72,\n\t\t\t0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67,\n\t\t\t0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61,\n\t\t\t0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x35,\n\t\t\t0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20,\n\t\t\t0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f,\n\t\t\t0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d,\n\t\t\t0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x4f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72,\n\t\t\t0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72,\n\t\t\t0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x39, 0x3b,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x65, 0x65,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x73, 0x65, 0x63,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30, 0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x33, 0x38, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x6c, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x31, 0x20, 0x4d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x20, 0x77, 0x69, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x73, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69,\n\t\t\t0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x20, 0x77, 0x69, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72,\n\t\t\t0x6d, 0x61, 0x74, 0x2e, 0x20, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f, 0x74,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6f, 0x74,\n\t\t\t0x68, 0x65, 0x72, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x3a, 0x20, 0x20, 0x49, 0x74, 0x27, 0x73, 0x20, 0x6c, 0x65,\n\t\t\t0x73, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x68,\n\t\t\t0x61, 0x73, 0x20, 0x66, 0x65, 0x77, 0x65, 0x72, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2c, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,\n\t\t\t0x64, 0x20, 0x65, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x61, 0x73, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x73,\n\t\t\t0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x6f, 0x6f,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d,\n\t\t\t0x61, 0x74, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x34, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20,\n\t\t\t0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x63, 0x61, 0x6e,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x3b, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x73,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65,\n\t\t\t0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6c,\n\t\t\t0x6c, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x72,\n\t\t\t0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x75, 0x6c,\n\t\t\t0x61, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x3b, 0x20, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x79, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e,\n\t\t\t0x74, 0x33, 0x32, 0x73, 0x2c, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x70, 0x65,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x42, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x61, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76,\n\t\t\t0x65, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x61,\n\t\t\t0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f,\n\t\t\t0x6f, 0x6c, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20,\n\t\t\t0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x69, 0x73, 0x61,\n\t\t\t0x62, 0x6c, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x22, 0x64, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x28, 0x29, 0x22, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x2c,\n\t\t\t0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x66,\n\t\t\t0x6c, 0x69, 0x63, 0x74, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x6d,\n\t\t\t0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x31, 0x20, 0x65, 0x61, 0x73, 0x69, 0x65, 0x72, 0x3b, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x63, 0x6f,\n\t\t\t0x64, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x61, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x64, 0x20, 0x22, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72,\n\t\t\t0x22, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6e,\n\t\t\t0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f,\n\t\t\t0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x49, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64, 0x65, 0x70, 0x72,\n\t\t\t0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x70, 0x6c, 0x61,\n\t\t\t0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x69, 0x74,\n\t\t\t0x20, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x3b, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c,\n\t\t\t0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x3d, 0x20, 0x33, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73,\n\t\t\t0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x34, 0x2c, 0x20, 0x35,\n\t\t\t0x2c, 0x20, 0x36, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x75, 0x74,\n\t\t\t0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x6d, 0x61, 0x70, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6d, 0x61, 0x70, 0x73, 0x20,\n\t\t\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x70,\n\t\t\t0x3c, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3e,\n\t\t\t0x20, 0x6d, 0x61, 0x70, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,\n\t\t\t0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4d, 0x61, 0x70, 0x46, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x45, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x3d, 0x20,\n\t\t\t0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4d, 0x61, 0x70,\n\t\t\t0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x20, 0x6d, 0x61, 0x70, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6d, 0x70, 0x6c,\n\t\t\t0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x68, 0x6f, 0x6f,\n\t\t\t0x73, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x20, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x73, 0x65, 0x20,\n\t\t\t0x61, 0x20, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6d, 0x61, 0x70, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x68,\n\t\t\t0x6f, 0x6c, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6b, 0x65, 0x79, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x69, 0x6d,\n\t\t\t0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20,\n\t\t\t0x6e, 0x65, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x61, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x72,\n\t\t\t0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x4f, 0x54, 0x45, 0x3a, 0x20, 0x44,\n\t\t\t0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x20, 0x41, 0x6c,\n\t\t\t0x77, 0x61, 0x79, 0x73, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x70, 0x73, 0x20, 0x73, 0x79,\n\t\t\t0x6e, 0x74, 0x61, 0x78, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c,\n\t\t\t0x79, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x74, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65,\n\t\t\t0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79,\n\t\t\t0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x38, 0x3b,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x6c, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c,\n\t\t\t0x69, 0x7a, 0x61, 0x62, 0x6c, 0x65, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x39, 0x3b,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x6e, 0x61, 0x6e, 0x6f, 0x5f, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x74,\n\t\t\t0x65, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c,\n\t\t\t0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x4a, 0x53,\n\t\t\t0x4f, 0x4e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69,\n\t\t\t0x63, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x63, 0x61, 0x73, 0x65,\n\t\t\t0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x70, 0x73, 0x20, 0x75, 0x6e,\n\t\t\t0x64, 0x65, 0x72, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x69,\n\t\t\t0x73, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f,\n\t\t\t0x72, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x20, 0x60, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x60, 0x20,\n\t\t\t0x69, 0x6e, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x70, 0x70,\n\t\t\t0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x20, 0x61, 0x73, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x77, 0x65, 0x6c, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x20, 0x6d,\n\t\t\t0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x73, 0x74, 0x20, 0x62, 0x72, 0x6f, 0x6b, 0x65,\n\t\t\t0x6e, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x73, 0x20, 0x64, 0x75, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76,\n\t\t\t0x69, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6c, 0x65,\n\t\t\t0x67, 0x61, 0x63, 0x79, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x65, 0x20, 0x70, 0x6c, 0x61,\n\t\t\t0x6e, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x77,\n\t\t\t0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x20, 0x68,\n\t\t\t0x61, 0x76, 0x65, 0x20, 0x68, 0x61, 0x64, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x69, 0x67, 0x72,\n\t\t\t0x61, 0x74, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c,\n\t\t\t0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a,\n\t\t\t0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x31, 0x20, 0x5b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74,\n\t\t\t0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x66, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69,\n\t\t\t0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x61, 0x73, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20,\n\t\t\t0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x75, 0x73, 0x65, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x20, 0x73, 0x68, 0x6f,\n\t\t\t0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x69, 0x72, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53,\n\t\t\t0x65, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65,\n\t\t\t0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65,\n\t\t\t0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55,\n\t\t\t0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75,\n\t\t\t0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x3d, 0x20, 0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73,\n\t\t\t0x20, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x53, 0x65,\n\t\t\t0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x31, 0x30, 0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x4f, 0x54, 0x45, 0x3a, 0x20, 0x63, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x55, 0x73, 0x65, 0x20, 0x60, 0x66, 0x65,\n\t\t\t0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x28, 0x70, 0x62, 0x2e, 0x63, 0x70, 0x70, 0x29, 0x2e, 0x73, 0x74, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x60, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x63, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x69, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x43, 0x2b, 0x2b, 0x20, 0x63, 0x6f,\n\t\t\t0x64, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20,\n\t\t\t0x61, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x70,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x69, 0x74, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x6c,\n\t\t\t0x79, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x2e, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70,\n\t\t\t0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x5b, 0x63, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x43, 0x4f, 0x52, 0x44, 0x5d, 0x20, 0x61, 0x6e, 0x64, 0x20,\n\t\t\t0x5b, 0x63, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5d, 0x20, 0x28, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x29, 0x20, 0x6f, 0x6e, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x72, 0x65, 0x70, 0x65,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x6f, 0x66, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x20, 0x22, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6f, 0x70, 0x65, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x63, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x54, 0x79, 0x70, 0x65,\n\t\t\t0x20, 0x63, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x20, 0x5b, 0x2f, 0x2a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x2a, 0x2f, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75,\n\t\t\t0x6c, 0x74, 0x20, 0x3d, 0x20, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d,\n\t\t\t0x20, 0x43, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x63, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x43, 0x4f, 0x52, 0x44, 0x5d, 0x20, 0x6d, 0x61,\n\t\t\t0x79, 0x20, 0x62, 0x65, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x6e, 0x6f,\n\t\t\t0x6e, 0x2d, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x22, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x2e,\n\t\t\t0x20, 0x49, 0x74, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x43, 0x2b, 0x2b, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x73, 0x68, 0x6f, 0x75,\n\t\t\t0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x43, 0x6f,\n\t\t\t0x72, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x61, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x76, 0x65, 0x72, 0x79,\n\t\t\t0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x6d, 0x61, 0x79, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,\n\t\t\t0x20, 0x49, 0x74, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x20, 0x62,\n\t\t\t0x65, 0x74, 0x74, 0x65, 0x72, 0x20, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x77, 0x68,\n\t\t\t0x65, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x70,\n\t\t\t0x61, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x43, 0x6f, 0x72, 0x64, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x43, 0x4f, 0x52, 0x44,\n\t\t\t0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x49,\n\t\t\t0x45, 0x43, 0x45, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68,\n\t\t\t0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x6e, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x20, 0x6d, 0x6f,\n\t\t\t0x72, 0x65, 0x20, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65,\n\t\t\t0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77, 0x69, 0x72, 0x65, 0x2e,\n\t\t\t0x20, 0x52, 0x61, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x72, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x74, 0x61, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x61,\n\t\t\t0x63, 0x68, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x74, 0x69,\n\t\t\t0x72, 0x65, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20,\n\t\t\t0x61, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x6c, 0x65, 0x6e,\n\t\t\t0x67, 0x74, 0x68, 0x2d, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x62, 0x6c, 0x6f, 0x62, 0x2e, 0x20,\n\t\t\t0x49, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x2c, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x65, 0x78, 0x70, 0x6c,\n\t\t\t0x69, 0x63, 0x69, 0x74, 0x20, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x76, 0x6f, 0x69, 0x64,\n\t\t\t0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69,\n\t\t\t0x6e, 0x67, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x68, 0x69, 0x62, 0x69, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x60, 0x72, 0x65,\n\t\t\t0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e,\n\t\t\t0x67, 0x60, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x32, 0x3b,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x36, 0x34, 0x20, 0x62, 0x69, 0x74, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69, 0x78, 0x65, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x28, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x2c, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x2c, 0x20, 0x73, 0x69,\n\t\t\t0x6e, 0x74, 0x36, 0x34, 0x2c, 0x20, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x2c, 0x20, 0x73, 0x66, 0x69, 0x78, 0x65,\n\t\t\t0x64, 0x36, 0x34, 0x29, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x20, 0x4a, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20,\n\t\t\t0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x77,\n\t\t\t0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x76, 0x6f, 0x69, 0x64, 0x73, 0x20, 0x6c, 0x6f, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x68, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x61, 0x20, 0x6c, 0x61,\n\t\t\t0x72, 0x67, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x6f, 0x69,\n\t\t\t0x6e, 0x74, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x53, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x20, 0x63, 0x61, 0x75, 0x73,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4a, 0x61, 0x76,\n\t\t\t0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20,\n\t\t\t0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4a, 0x53, 0x5f, 0x4e,\n\t\t\t0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x61, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x20, 0x61, 0x64,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65,\n\t\t\t0x20, 0x61, 0x64, 0x64, 0x65, 0x64, 0x2c, 0x20, 0x65, 0x2e, 0x67, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x67, 0x6f,\n\t\t\t0x6f, 0x67, 0x2e, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x20, 0x6a, 0x73, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x20, 0x3d, 0x20, 0x36, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x4a, 0x53, 0x5f,\n\t\t\t0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4a, 0x53, 0x54, 0x79,\n\t\t\t0x70, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4a, 0x53,\n\t\t\t0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x55, 0x73, 0x65, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x73, 0x74, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4a, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x4a, 0x61, 0x76, 0x61,\n\t\t\t0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x20, 0x6c, 0x61, 0x7a, 0x69, 0x6c, 0x79, 0x3f,\n\t\t\t0x20, 0x20, 0x4c, 0x61, 0x7a, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x74,\n\t\t\t0x68, 0x61, 0x74, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x20, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x6c, 0x79, 0x20,\n\t\t\t0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x6e,\n\t\t\t0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x27, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,\n\t\t\t0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64,\n\t\t\t0x20, 0x62, 0x75, 0x74, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x6d,\n\t\t\t0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x70, 0x61,\n\t\t\t0x72, 0x73, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x66, 0x69, 0x72, 0x73,\n\t\t\t0x74, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x61, 0x20, 0x68, 0x69, 0x6e,\n\t\t\t0x74, 0x2e, 0x20, 0x20, 0x49, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x61, 0x72, 0x65, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x20, 0x77,\n\t\t\t0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65,\n\t\t\t0x61, 0x67, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x6c, 0x61, 0x7a, 0x79, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x72, 0x65, 0x67, 0x61, 0x72, 0x64, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e,\n\t\t\t0x20, 0x20, 0x48, 0x6f, 0x77, 0x65, 0x76, 0x65, 0x72, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x74, 0x74,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x72, 0x75, 0x65,\n\t\t\t0x20, 0x73, 0x75, 0x67, 0x67, 0x65, 0x73, 0x74, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x6c, 0x69, 0x65,\n\t\t\t0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6c, 0x61, 0x7a, 0x79, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x77, 0x6f, 0x72, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6b, 0x6b, 0x65, 0x65, 0x70, 0x69,\n\t\t\t0x6e, 0x67, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x68, 0x65, 0x61, 0x64, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6d, 0x70,\n\t\t\t0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f,\n\t\t\t0x74, 0x20, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20,\n\t\t\t0x69, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x67, 0x65, 0x6e,\n\t\t\t0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6c,\n\t\t\t0x6c, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20,\n\t\t\t0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x46, 0x75,\n\t\t\t0x72, 0x74, 0x68, 0x65, 0x72, 0x6d, 0x6f, 0x72, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x2d, 0x73, 0x61,\n\t\t\t0x66, 0x65, 0x74, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x74,\n\t\t\t0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x61, 0x69, 0x6e, 0x20,\n\t\t\t0x73, 0x61, 0x66, 0x65, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x20, 0x66, 0x72,\n\t\t\t0x6f, 0x6d, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x73, 0x20,\n\t\t\t0x63, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20,\n\t\t\t0x6e, 0x6f, 0x6e, 0x2d, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x20, 0x63, 0x6f,\n\t\t\t0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69,\n\t\t\t0x72, 0x65, 0x20, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74,\n\t\t\t0x20, 0x6c, 0x61, 0x7a, 0x79, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x65, 0x61, 0x67, 0x65, 0x72, 0x6c, 0x79, 0x20, 0x76,\n\t\t\t0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x69, 0x6c, 0x6c, 0x2d, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x64, 0x20, 0x77, 0x69, 0x72, 0x65, 0x66, 0x6f, 0x72,\n\t\t\t0x6d, 0x61, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69,\n\t\t\t0x72, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x43, 0x61, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x49, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x69, 0x6e, 0x6e, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6d, 0x69,\n\t\t\t0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x76, 0x65, 0x72, 0x69, 0x66,\n\t\t\t0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x20,\n\t\t\t0x28, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e,\n\t\t\t0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x29, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6c, 0x61, 0x7a, 0x79, 0x20, 0x3d,\n\t\t\t0x20, 0x35, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d,\n\t\t\t0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6c,\n\t\t\t0x61, 0x7a, 0x79, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6e,\n\t\t\t0x65, 0x73, 0x73, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x79,\n\t\t\t0x74, 0x65, 0x20, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75,\n\t\t\t0x6c, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64,\n\t\t\t0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x6c, 0x61, 0x7a, 0x79, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x76, 0x65, 0x72,\n\t\t\t0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x68, 0x69, 0x62, 0x69,\n\t\t\t0x74, 0x69, 0x76, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x63, 0x65,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65,\n\t\t\t0x64, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x35, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,\n\t\t\t0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x73, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x3f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,\n\t\t\t0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x69, 0x74, 0x20, 0x44, 0x65, 0x70, 0x72,\n\t\t\t0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x73, 0x2c, 0x20, 0x6f,\n\t\t\t0x72, 0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74,\n\t\t\t0x65, 0x6c, 0x79, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x76, 0x65, 0x72, 0x79, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c,\n\t\t\t0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x33, 0x20, 0x5b, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x44, 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x2e, 0x20, 0x44, 0x4f, 0x20, 0x4e, 0x4f, 0x54, 0x20,\n\t\t\t0x55, 0x53, 0x45, 0x21, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t\t\t0x2d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x6f, 0x6e, 0x6c, 0x79, 0x2e, 0x20, 0x44, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x73, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x77, 0x65, 0x61, 0x6b, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x30, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65,\n\t\t\t0x2c, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x5d,\n\t\t\t0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61,\n\t\t\t0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x73, 0x68,\n\t\t\t0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x6f, 0x75, 0x74, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x2c, 0x20, 0x65, 0x2e, 0x67, 0x2e, 0x20,\n\t\t\t0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61,\n\t\t\t0x69, 0x6e, 0x73, 0x20, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e,\n\t\t\t0x74, 0x69, 0x61, 0x6c, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f,\n\t\t\t0x6f, 0x6c, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x36,\n\t\t\t0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x52, 0x45, 0x54, 0x45,\n\t\t\t0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b,\n\t\t\t0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54,\n\t\t\t0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x20, 0x3d, 0x20,\n\t\t\t0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x31, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x73, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x73, 0x20,\n\t\t\t0x61, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x75, 0x6e, 0x73, 0x65, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x66, 0x72, 0x65, 0x65, 0x6c, 0x79, 0x20, 0x75, 0x73, 0x65, 0x64,\n\t\t\t0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f,\n\t\t\t0x6e, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65,\n\t\t\t0x74, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54,\n\t\t\t0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45,\n\t\t\t0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53,\n\t\t\t0x41, 0x47, 0x45, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f,\n\t\t\t0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x20, 0x3d, 0x20,\n\t\t\t0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45,\n\t\t\t0x4e, 0x55, 0x4d, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f,\n\t\t\t0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x20, 0x3d, 0x20, 0x37, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52,\n\t\t\t0x56, 0x49, 0x43, 0x45, 0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54,\n\t\t\t0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x20, 0x3d, 0x20, 0x39, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x64, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x65, 0x78, 0x74, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x7d, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e,\n\t\t\t0x79, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79,\n\t\t\t0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t\t\t0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65,\n\t\t\t0x72, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67,\n\t\t\t0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65,\n\t\t\t0x72, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e,\n\t\t\t0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65,\n\t\t\t0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x32, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20,\n\t\t\t0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75,\n\t\t\t0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x65, 0x61,\n\t\t\t0x74, 0x75, 0x72, 0x65, 0x20, 0x77, 0x61, 0x73, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c,\n\t\t\t0x61, 0x62, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x45, 0x44, 0x49, 0x54,\n\t\t\t0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x20, 0x69, 0x74, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64,\n\t\t\t0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x62,\n\t\t\t0x65, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x2e, 0x20, 0x20, 0x55, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x6d, 0x61, 0x79, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x20, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x64,\n\t\t\t0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x74,\n\t\t\t0x65, 0x78, 0x74, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x61, 0x73, 0x20,\n\t\t\t0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x65, 0x72, 0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x20, 0x69, 0x6e, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x61, 0x66, 0x74, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x6e,\n\t\t\t0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20,\n\t\t\t0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65,\n\t\t\t0x64, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x77,\n\t\t\t0x69, 0x6c, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x20, 0x69, 0x74, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x34, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73,\n\t\t\t0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x32, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f,\n\t\t\t0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76,\n\t\t\t0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x39,\n\t\t\t0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20,\n\t\t\t0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f,\n\t\t\t0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30, 0x30,\n\t\t\t0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,\n\t\t\t0x64, 0x20, 0x34, 0x3b, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x6a, 0x74,\n\t\t\t0x79, 0x70, 0x65, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x31, 0x38, 0x3b, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2c, 0x20, 0x74,\n\t\t\t0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6f, 0x62, 0x73, 0x6f, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x64, 0x6f, 0x5f, 0x6e, 0x6f,\n\t\t\t0x74, 0x5f, 0x75, 0x73, 0x65, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4f, 0x6e, 0x65,\n\t\t\t0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79,\n\t\t\t0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20,\n\t\t\t0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65,\n\t\t\t0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72,\n\t\t\t0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67,\n\t\t\t0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61,\n\t\t\t0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x31,\n\t\t\t0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73,\n\t\t\t0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65,\n\t\t\t0x73, 0x6e, 0x27, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e,\n\t\t\t0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69,\n\t\t\t0x65, 0x6e, 0x74, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74,\n\t\t\t0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e,\n\t\t\t0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30, 0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x7d,\n\t\t\t0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x7b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x65, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c,\n\t\t\t0x6f, 0x77, 0x20, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74,\n\t\t\t0x20, 0x74, 0x61, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61,\n\t\t\t0x6d, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69,\n\t\t\t0x61, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x73, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3f, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x69, 0x74, 0x20, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x74, 0x20,\n\t\t\t0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x69,\n\t\t\t0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20,\n\t\t\t0x6c, 0x65, 0x61, 0x73, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x61, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65,\n\t\t\t0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x33, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d,\n\t\t\t0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64,\n\t\t\t0x20, 0x35, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x6e, 0x61, 0x6e, 0x6f, 0x5f, 0x61, 0x73, 0x5f,\n\t\t\t0x6c, 0x69, 0x74, 0x65, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e,\n\t\t\t0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x63,\n\t\t\t0x61, 0x73, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x70, 0x73,\n\t\t\t0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70,\n\t\t\t0x61, 0x72, 0x69, 0x73, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x6f, 0x6e, 0x6c,\n\t\t\t0x79, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x62, 0x65, 0x68, 0x61,\n\t\t\t0x76, 0x69, 0x6f, 0x72, 0x20, 0x74, 0x61, 0x6b, 0x65, 0x73, 0x20, 0x60, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x60, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x61, 0x6e, 0x64, 0x20,\n\t\t\t0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x20, 0x61, 0x73,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x65, 0x6c, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x4f, 0x44,\n\t\t\t0x4f, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79,\n\t\t\t0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x77, 0x6e, 0x73,\n\t\t\t0x74, 0x72, 0x65, 0x61, 0x6d, 0x20, 0x74, 0x65, 0x61, 0x6d, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x68, 0x61, 0x64, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74,\n\t\t\t0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x64,\n\t\t\t0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f,\n\t\t\t0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x36, 0x20, 0x5b, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65,\n\t\t\t0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,\n\t\t\t0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65,\n\t\t\t0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20,\n\t\t\t0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65,\n\t\t\t0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72,\n\t\t\t0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64,\n\t\t\t0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65,\n\t\t\t0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72,\n\t\t\t0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20,\n\t\t\t0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x72, 0x65, 0x63,\n\t\t\t0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f,\n\t\t\t0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74,\n\t\t\t0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74,\n\t\t\t0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x39, 0x39,\n\t\t\t0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x63, 0x61, 0x6e,\n\t\t\t0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62,\n\t\t\t0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30,\n\t\t\t0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3f, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,\n\t\t\t0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x63, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x69, 0x74, 0x20, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x20, 0x6f, 0x72,\n\t\t\t0x20, 0x69, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65,\n\t\t\t0x6c, 0x79, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76,\n\t\t\t0x65, 0x72, 0x79, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x75, 0x6d,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x31, 0x20,\n\t\t\t0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x64, 0x65,\n\t\t\t0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e,\n\t\t\t0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75,\n\t\t\t0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x73,\n\t\t\t0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6c, 0x69,\n\t\t\t0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65,\n\t\t\t0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69,\n\t\t\t0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64,\n\t\t\t0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x6c,\n\t\t\t0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63,\n\t\t\t0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x6c, 0x69,\n\t\t\t0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x64, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x6e, 0x6e,\n\t\t\t0x6f, 0x74, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x75,\n\t\t\t0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x77,\n\t\t\t0x68, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x65, 0x62, 0x75, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x6d,\n\t\t\t0x61, 0x74, 0x73, 0x2c, 0x20, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x73, 0x65, 0x6e, 0x73, 0x69, 0x74,\n\t\t\t0x69, 0x76, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x64, 0x65,\n\t\t\t0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x33, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x61, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20,\n\t\t\t0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20,\n\t\t\t0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e,\n\t\t\t0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x6e,\n\t\t\t0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d,\n\t\t\t0x20, 0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65,\n\t\t\t0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x31, 0x30, 0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x7b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73,\n\t\t\t0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63,\n\t\t\t0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57,\n\t\t\t0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73,\n\t\t\t0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62,\n\t\t\t0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x6f,\n\t\t\t0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73,\n\t\t\t0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70,\n\t\t\t0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20,\n\t\t\t0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66,\n\t\t\t0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20,\n\t\t\t0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x66,\n\t\t\t0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x4e, 0x6f, 0x74, 0x65, 0x3a, 0x20, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73,\n\t\t\t0x20, 0x31, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x33, 0x32, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65,\n\t\t\t0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20,\n\t\t\t0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x52, 0x50, 0x43, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x20, 0x61, 0x70, 0x6f, 0x6c, 0x6f,\n\t\t\t0x67, 0x69, 0x7a, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x68, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x73, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x75, 0x72, 0x73, 0x65,\n\t\t\t0x6c, 0x76, 0x65, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x77, 0x65, 0x20,\n\t\t\t0x77, 0x65, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x6d, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x77, 0x65, 0x20, 0x64,\n\t\t\t0x65, 0x63, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x50, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72,\n\t\t\t0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x65, 0x72,\n\t\t\t0x76, 0x69, 0x63, 0x65, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3f, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74,\n\t\t\t0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x63, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x69, 0x74, 0x20, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x74,\n\t\t\t0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x6c, 0x79, 0x20,\n\t\t\t0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65, 0x72, 0x79,\n\t\t\t0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72,\n\t\t\t0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,\n\t\t\t0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x64,\n\t\t\t0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x33, 0x33, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x72, 0x65, 0x63,\n\t\t\t0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f,\n\t\t\t0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74,\n\t\t\t0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74,\n\t\t\t0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x39, 0x39,\n\t\t\t0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x63, 0x61, 0x6e,\n\t\t\t0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62,\n\t\t\t0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30,\n\t\t\t0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x7b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x3a, 0x20, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x75, 0x6d,\n\t\t\t0x62, 0x65, 0x72, 0x73, 0x20, 0x31, 0x20, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x20, 0x33, 0x32, 0x20, 0x61, 0x72,\n\t\t\t0x65, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c,\n\t\t\t0x65, 0x27, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x52, 0x50, 0x43, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x20, 0x20, 0x57, 0x65, 0x20, 0x61,\n\t\t\t0x70, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x7a, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x68, 0x6f, 0x61, 0x72, 0x64, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x6f,\n\t\t\t0x75, 0x72, 0x73, 0x65, 0x6c, 0x76, 0x65, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x77, 0x65, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x75, 0x73, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20,\n\t\t\t0x77, 0x65, 0x20, 0x64, 0x65, 0x63, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,\n\t\t\t0x65, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x42, 0x75,\n\t\t\t0x66, 0x66, 0x65, 0x72, 0x73, 0x2e, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3f, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x65, 0x6d, 0x69, 0x74, 0x20, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x20, 0x6f, 0x72, 0x20,\n\t\t\t0x69, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x6c,\n\t\t\t0x79, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x3b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x65,\n\t\t\t0x72, 0x79, 0x20, 0x6c, 0x65, 0x61, 0x73, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f,\n\t\t\t0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20,\n\t\t\t0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x33, 0x33, 0x20, 0x5b, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x49, 0x73, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x73, 0x69, 0x64, 0x65,\n\t\t\t0x2d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x2d, 0x66, 0x72, 0x65, 0x65, 0x20, 0x28, 0x6f, 0x72, 0x20, 0x73, 0x61, 0x66,\n\t\t\t0x65, 0x20, 0x69, 0x6e, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x70, 0x61, 0x72, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x29, 0x2c,\n\t\t\t0x20, 0x6f, 0x72, 0x20, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x6f, 0x72, 0x20, 0x6e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x3f, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x62, 0x61,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x52, 0x50, 0x43, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x68, 0x6f, 0x6f, 0x73, 0x65, 0x20, 0x47, 0x45, 0x54, 0x20, 0x76, 0x65,\n\t\t\t0x72, 0x62, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x61, 0x66, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74,\n\t\t\t0x68, 0x6f, 0x64, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x50, 0x55, 0x54, 0x20, 0x76, 0x65, 0x72, 0x62, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,\n\t\t\t0x73, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x20, 0x50, 0x4f, 0x53, 0x54, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x49, 0x64,\n\t\t\t0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e,\n\t\t\t0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x4f, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x45, 0x46,\n\t\t\t0x46, 0x45, 0x43, 0x54, 0x53, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69,\n\t\t\t0x65, 0x73, 0x20, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x49, 0x44,\n\t\t\t0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x54, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6d,\n\t\t\t0x61, 0x79, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x73, 0x69, 0x64, 0x65, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73,\n\t\t\t0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x49, 0x64, 0x65, 0x6d,\n\t\t\t0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74,\n\t\t\t0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x3d, 0x20, 0x33, 0x34, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x5b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54,\n\t\t\t0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x41, 0x6e, 0x79, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,\n\t\t\t0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x3a,\n\t\t\t0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6f,\n\t\t\t0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x20, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69,\n\t\t\t0x61, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x61, 0x73, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x20, 0x4f,\n\t\t\t0x74, 0x68, 0x65, 0x72, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75,\n\t\t\t0x72, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x76, 0x65, 0x6c,\n\t\t\t0x6f, 0x70, 0x65, 0x72, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x72, 0x65, 0x6c, 0x79, 0x20, 0x6f, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x41, 0x50,\n\t\t\t0x49, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20,\n\t\t\t0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,\n\t\t\t0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x33, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72,\n\t\t\t0x73, 0x65, 0x72, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69,\n\t\t\t0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x20,\n\t\t\t0x68, 0x65, 0x72, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72,\n\t\t\t0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65,\n\t\t\t0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65,\n\t\t\t0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,\n\t\t\t0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x65,\n\t\t\t0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x53, 0x65, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30, 0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x6d,\n\t\t\t0x61, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f,\n\t\t\t0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x6e,\n\t\t\t0x6c, 0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x3a, 0x3a, 0x50, 0x61, 0x72,\n\t\t\t0x73, 0x65, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x6f, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x73, 0x65, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x44, 0x65,\n\t\t\t0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2e, 0x20, 0x54, 0x68,\n\t\t\t0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72,\n\t\t\t0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72,\n\t\t\t0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x3a, 0x3a, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x28, 0x29, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x64,\n\t\t\t0x75, 0x63, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x3a, 0x3a,\n\t\t\t0x43, 0x6f, 0x70, 0x79, 0x54, 0x6f, 0x28, 0x29, 0x29, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x65, 0x76, 0x65, 0x72,\n\t\t\t0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x6d, 0x2e, 0x0a, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64,\n\t\t\t0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6e, 0x61,\n\t\t\t0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65,\n\t\t\t0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x20, 0x64, 0x6f, 0x74, 0x2d,\n\t\t\t0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x20, 0x69, 0x73, 0x5f,\n\t\t\t0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x69, 0x66,\n\t\t\t0x66, 0x20, 0x61, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,\n\t\t\t0x74, 0x73, 0x20, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x28, 0x64, 0x65, 0x6e, 0x6f, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x70, 0x61, 0x72, 0x65, 0x6e,\n\t\t\t0x74, 0x68, 0x65, 0x73, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x73, 0x70,\n\t\t\t0x65, 0x63, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x29,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x2e, 0x67, 0x2e, 0x2c, 0x7b, 0x20, 0x5b, 0x22, 0x66, 0x6f, 0x6f, 0x22,\n\t\t\t0x2c, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x5d, 0x2c, 0x20, 0x5b, 0x22, 0x62, 0x61, 0x72, 0x2e, 0x62, 0x61, 0x7a, 0x22,\n\t\t\t0x2c, 0x20, 0x74, 0x72, 0x75, 0x65, 0x5d, 0x2c, 0x20, 0x5b, 0x22, 0x6d, 0x6f, 0x6f, 0x22, 0x2c, 0x20, 0x66, 0x61, 0x6c,\n\t\t\t0x73, 0x65, 0x5d, 0x20, 0x7d, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x22, 0x66, 0x6f, 0x6f, 0x2e, 0x28, 0x62, 0x61, 0x72, 0x2e, 0x62, 0x61, 0x7a, 0x29, 0x2e, 0x6d, 0x6f, 0x6f,\n\t\t\t0x22, 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72,\n\t\t\t0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x69, 0x73, 0x5f,\n\t\t\t0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x20, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70,\n\t\t\t0x72, 0x65, 0x74, 0x65, 0x64, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x77, 0x68, 0x61,\n\t\t\t0x74, 0x65, 0x76, 0x65, 0x72, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e,\n\t\t\t0x69, 0x7a, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64,\n\t\t\t0x20, 0x69, 0x74, 0x20, 0x61, 0x73, 0x20, 0x64, 0x75, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e,\n\t\t\t0x67, 0x2e, 0x20, 0x45, 0x78, 0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x73, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x64, 0x65,\n\t\t\t0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x20, 0x70, 0x6f, 0x73,\n\t\t\t0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x20, 0x6e, 0x65,\n\t\t\t0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x35,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x20,\n\t\t\t0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65,\n\t\t\t0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x0a, 0x2f, 0x2f, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x0a, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x43, 0x2b, 0x2b, 0x20,\n\t\t\t0x67, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x28, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x69,\n\t\t\t0x61, 0x6c, 0x6c, 0x79, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73,\n\t\t\t0x29, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x77, 0x65, 0x6c, 0x6c, 0x20, 0x73, 0x63,\n\t\t\t0x6f, 0x70, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x73, 0x20, 0x74, 0x68,\n\t\t\t0x61, 0x74, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75,\n\t\t\t0x72, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63,\n\t\t\t0x6c, 0x61, 0x73, 0x68, 0x0a, 0x2f, 0x2f, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x6f, 0x74,\n\t\t\t0x68, 0x65, 0x72, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x20, 0x6e, 0x61, 0x6d, 0x65,\n\t\t\t0x73, 0x20, 0x77, 0x65, 0x27, 0x76, 0x65, 0x20, 0x63, 0x68, 0x6f, 0x73, 0x65, 0x6e, 0x20, 0x6d, 0x61, 0x78, 0x69, 0x6d,\n\t\t\t0x69, 0x7a, 0x65, 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x2d, 0x73, 0x69, 0x74, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x61,\n\t\t\t0x64, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x20,\n\t\t\t0x75, 0x73, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x73, 0x63, 0x65, 0x6e, 0x61, 0x72, 0x69, 0x6f, 0x2e, 0x20, 0x20, 0x41, 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65,\n\t\t\t0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65,\n\t\t\t0x6e, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2c,\n\t\t\t0x20, 0x68, 0x6f, 0x70, 0x65, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x77, 0x65,\n\t\t\t0x20, 0x65, 0x76, 0x65, 0x72, 0x20, 0x68, 0x69, 0x74, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x6c,\n\t\t\t0x69, 0x63, 0x74, 0x20, 0x68, 0x65, 0x72, 0x65, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x65,\n\t\t\t0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x46, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x46, 0x49,\n\t\t\t0x45, 0x4c, 0x44, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e,\n\t\t\t0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x20, 0x3d, 0x20, 0x32,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45,\n\t\t\t0x44, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,\n\t\t\t0x6c, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49,\n\t\t\t0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67,\n\t\t\t0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49,\n\t\t\t0x45, 0x4c, 0x44, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54,\n\t\t\t0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f,\n\t\t\t0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f,\n\t\t\t0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x49, 0x4d, 0x50,\n\t\t\t0x4c, 0x49, 0x43, 0x49, 0x54, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20,\n\t\t\t0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x20,\n\t\t\t0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e,\n\t\t\t0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4f, 0x50, 0x45, 0x4e, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79,\n\t\t\t0x70, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x5b, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e,\n\t\t\t0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61,\n\t\t\t0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,\n\t\t\t0x45, 0x4e, 0x55, 0x4d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20,\n\t\t\t0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72,\n\t\t\t0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d,\n\t\t\t0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x4f, 0x50, 0x45, 0x4e,\n\t\t\t0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x52, 0x65, 0x70,\n\t\t\t0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x7b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f,\n\t\t\t0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x45, 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x33,\n\t\t\t0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52,\n\t\t\t0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54,\n\t\t\t0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65,\n\t\t\t0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c,\n\t\t\t0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41,\n\t\t\t0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x45, 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44,\n\t\t\t0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45,\n\t\t\t0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x3a, 0x20, 0x22, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x55, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x55, 0x54, 0x46, 0x38, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49,\n\t\t\t0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x4f, 0x4e, 0x45,\n\t\t\t0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x31,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x55, 0x74, 0x66,\n\t\t\t0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, 0x6c,\n\t\t\t0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x34, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65,\n\t\t\t0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47,\n\t\t\t0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65,\n\t\t\t0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63,\n\t\t\t0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45,\n\t\t\t0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x3a, 0x20, 0x22, 0x4e, 0x4f, 0x4e, 0x45, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33,\n\t\t\t0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x22, 0x20, 0x7d, 0x0a,\n\t\t\t0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4d, 0x45, 0x53, 0x53, 0x41,\n\t\t\t0x47, 0x45, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20,\n\t\t\t0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46,\n\t\t\t0x49, 0x58, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x44, 0x45, 0x4c, 0x49, 0x4d, 0x49,\n\t\t\t0x54, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x35,\n\t\t\t0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52,\n\t\t\t0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54,\n\t\t\t0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65,\n\t\t\t0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c,\n\t\t\t0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41,\n\t\t\t0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50,\n\t\t\t0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x65,\n\t\t\t0x6e, 0x75, 0x6d, 0x20, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e,\n\t\t\t0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x20, 0x3d, 0x20, 0x31, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46,\n\t\t\t0x4f, 0x52, 0x54, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x5f,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x3d, 0x20, 0x36, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74,\n\t\t\t0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52,\n\t\t\t0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47,\n\t\t\t0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52,\n\t\t\t0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74,\n\t\t\t0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45,\n\t\t\t0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73,\n\t\t\t0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49,\n\t\t\t0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d,\n\t\t\t0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x4c, 0x45, 0x47, 0x41,\n\t\t\t0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x41, 0x4c, 0x4c,\n\t\t\t0x4f, 0x57, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x45,\n\t\t\t0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x45, 0x4e, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x5f, 0x4e, 0x41, 0x4d, 0x49, 0x4e, 0x47, 0x5f, 0x53,\n\t\t\t0x54, 0x59, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x32, 0x30, 0x32, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63,\n\t\t\t0x65, 0x4e, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x20, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65,\n\t\t\t0x5f, 0x6e, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x37, 0x20, 0x5b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45,\n\t\t\t0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61,\n\t\t\t0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,\n\t\t\t0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f,\n\t\t\t0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41,\n\t\t\t0x47, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41,\n\t\t\t0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x2c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59,\n\t\t\t0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,\n\t\t\t0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47,\n\t\t\t0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54,\n\t\t\t0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74,\n\t\t\t0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45,\n\t\t\t0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,\n\t\t\t0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45,\n\t\t\t0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f,\n\t\t\t0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x53, 0x54,\n\t\t\t0x59, 0x4c, 0x45, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20,\n\t\t\t0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32,\n\t\t\t0x34, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x32, 0x30, 0x32, 0x34,\n\t\t\t0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x79, 0x6d, 0x62,\n\t\t\t0x6f, 0x6c, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x53, 0x59, 0x4d, 0x42, 0x4f, 0x4c, 0x5f, 0x56, 0x49, 0x53, 0x49,\n\t\t\t0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x70, 0x72,\n\t\t\t0x65, 0x2d, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x20, 0x61, 0x6c, 0x6c, 0x20,\n\t\t\t0x55, 0x4e, 0x53, 0x45, 0x54, 0x20, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x61, 0x72, 0x65,\n\t\t\t0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x58, 0x50, 0x4f, 0x52,\n\t\t\t0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x41, 0x6c, 0x6c, 0x20, 0x74, 0x6f, 0x70, 0x2d, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x73, 0x79, 0x6d, 0x62, 0x6f,\n\t\t\t0x6c, 0x73, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74,\n\t\t\t0x2c, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x5f,\n\t\t\t0x54, 0x4f, 0x50, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x20, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x5f, 0x41, 0x4c, 0x4c, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x20, 0x6c, 0x6f,\n\t\t\t0x63, 0x61, 0x6c, 0x20, 0x62, 0x79, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x20, 0x4e, 0x65, 0x73, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x65,\n\t\t\t0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x69,\n\t\t\t0x74, 0x68, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x63, 0x61, 0x76, 0x65,\n\t\t\t0x61, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x20, 0x65, 0x6e, 0x75,\n\t\t\t0x6d, 0x20, 0x7b, 0x7d, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x31, 0x20, 0x74, 0x6f, 0x20, 0x6d,\n\t\t\t0x61, 0x78, 0x3b, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x73,\n\t\t\t0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x3d, 0x20, 0x34, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20,\n\t\t\t0x31, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x46, 0x65, 0x61, 0x74, 0x75,\n\t\t\t0x72, 0x65, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x56, 0x69, 0x73, 0x69,\n\t\t\t0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f,\n\t\t\t0x6c, 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x3d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x38, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43,\n\t\t\t0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d,\n\t\t\t0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49,\n\t\t\t0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65,\n\t\t\t0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20,\n\t\t\t0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75,\n\t\t\t0x65, 0x3a, 0x20, 0x22, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x41, 0x4c, 0x4c, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75,\n\t\t\t0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49,\n\t\t\t0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x45,\n\t\t\t0x58, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x54, 0x4f, 0x50, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x22, 0x20, 0x7d, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20,\n\t\t\t0x39, 0x39, 0x39, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31,\n\t\t\t0x30, 0x30, 0x30, 0x20, 0x74, 0x6f, 0x20, 0x39, 0x39, 0x39, 0x34, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65,\n\t\t\t0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x70, 0x70, 0x22,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x43,\n\t\t\t0x70, 0x70, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x31, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62,\n\t\t\t0x2e, 0x6a, 0x61, 0x76, 0x61, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20,\n\t\t\t0x22, 0x2e, 0x70, 0x62, 0x2e, 0x4a, 0x61, 0x76, 0x61, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x32, 0x2c, 0x20,\n\t\t\t0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x67, 0x6f, 0x22, 0x2c,\n\t\t\t0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72,\n\t\t\t0x65, 0x73, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a,\n\t\t\t0x20, 0x31, 0x30, 0x30, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61,\n\t\t\t0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x22, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x79, 0x74, 0x68, 0x6f,\n\t\t\t0x6e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x31, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x69, 0x6d, 0x70,\n\t\t\t0x2e, 0x69, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x65, 0x74,\n\t\t\t0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x69, 0x6d, 0x70,\n\t\t\t0x2e, 0x49, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x22, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a,\n\t\t\t0x20, 0x39, 0x39, 0x38, 0x39, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61,\n\t\t\t0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x74, 0x61, 0x62, 0x6c,\n\t\t\t0x65, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62,\n\t\t\t0x2e, 0x4a, 0x61, 0x76, 0x61, 0x4d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73,\n\t\t\t0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65,\n\t\t\t0x72, 0x3a, 0x20, 0x39, 0x39, 0x39, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x31, 0x22, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x31, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20,\n\t\t\t0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x39, 0x39,\n\t\t\t0x39, 0x35, 0x20, 0x74, 0x6f, 0x20, 0x39, 0x39, 0x39, 0x39, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20,\n\t\t\t0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x0a, 0x20, 0x20, 0x65,\n\t\t\t0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x3b, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f,\n\t\t\t0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x65, 0x73, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20,\n\t\t\t0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x64, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x61, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73,\n\t\t\t0x2e, 0x20, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20,\n\t\t\t0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x73, 0x65, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,\n\t\t\t0x20, 0x62, 0x65, 0x63, 0x6f, 0x6d, 0x65, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x73, 0x65,\n\t\t\t0x61, 0x72, 0x63, 0x68, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x6f, 0x73,\n\t\t\t0x65, 0x73, 0x74, 0x20, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x2c, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20,\n\t\t\t0x6d, 0x65, 0x72, 0x67, 0x65, 0x73, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x41, 0x20, 0x6d, 0x61, 0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x65, 0x76, 0x65, 0x72, 0x79, 0x20, 0x6b,\n\t\t\t0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20,\n\t\t\t0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,\n\t\t\t0x74, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75,\n\t\t\t0x6c, 0x74, 0x73, 0x2e, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x68,\n\t\t\t0x65, 0x72, 0x65, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x67, 0x69, 0x76, 0x65, 0x6e, 0x20, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x73, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x20,\n\t\t\t0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x72, 0x64,\n\t\t\t0x65, 0x72, 0x65, 0x64, 0x20, 0x61, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x69, 0x74,\n\t\t\t0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64,\n\t\t\t0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x20, 0x61, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x62, 0x79, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74,\n\t\t\t0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20,\n\t\t\t0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x64,\n\t\t\t0x65, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,\n\t\t\t0x53, 0x65, 0x74, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x66, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65,\n\t\t\t0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x74,\n\t\t\t0x68, 0x61, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x27, 0x74, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64,\n\t\t\t0x64, 0x65, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72,\n\t\t\t0x65, 0x53, 0x65, 0x74, 0x20, 0x66, 0x69, 0x78, 0x65, 0x64, 0x5f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x31,\n\t\t\t0x2c, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x22, 0x66,\n\t\t\t0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75,\n\t\t\t0x6d, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x29, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x77, 0x61, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6d,\n\t\t\t0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x28, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x29, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x77, 0x61, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x65, 0x64, 0x2e, 0x20,\n\t\t\t0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72,\n\t\t\t0x65, 0x6c, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x78,\n\t\t\t0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d,\n\t\t\t0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f,\n\t\t\t0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x63, 0x61, 0x70, 0x73, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65,\n\t\t\t0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x6c,\n\t\t\t0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x77, 0x61, 0x73,\n\t\t\t0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x41, 0x20, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66,\n\t\t\t0x69, 0x65, 0x73, 0x20, 0x61, 0x20, 0x70, 0x69, 0x65, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63,\n\t\t\t0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66,\n\t\t\t0x69, 0x6c, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65,\n\t\t\t0x73, 0x70, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x75, 0x6c,\n\t\t\t0x61, 0x72, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x6e, 0x64, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x66,\n\t\t\t0x75, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x49, 0x44, 0x45, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x6e, 0x64,\n\t\t\t0x65, 0x78, 0x65, 0x72, 0x73, 0x2c, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x69, 0x6d,\n\t\t\t0x69, 0x6c, 0x61, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20,\n\t\t\t0x73, 0x61, 0x79, 0x20, 0x77, 0x65, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6c,\n\t\t\t0x69, 0x6b, 0x65, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x46, 0x6f, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4c, 0x65, 0x74, 0x27, 0x73, 0x20,\n\t\t\t0x6c, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x74, 0x20, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f,\n\t\t\t0x6f, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x5e, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x5e, 0x5e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5e, 0x5e, 0x20, 0x20, 0x5e, 0x20, 0x20, 0x5e, 0x5e, 0x5e, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x61, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x63, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x64, 0x65, 0x20, 0x20, 0x66, 0x20, 0x20, 0x67, 0x68, 0x69, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x65,\n\t\t\t0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x73, 0x70,\n\t\t\t0x61, 0x6e, 0x20, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x5b, 0x61, 0x2c, 0x69, 0x29, 0x20, 0x20, 0x5b, 0x20, 0x34, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x32, 0x2c, 0x20,\n\t\t\t0x30, 0x20, 0x5d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x77, 0x68, 0x6f, 0x6c, 0x65, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x5b, 0x61, 0x2c, 0x62, 0x29, 0x20, 0x20, 0x5b, 0x20, 0x34, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x32, 0x2c,\n\t\t\t0x20, 0x30, 0x2c, 0x20, 0x34, 0x20, 0x5d, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x20, 0x28,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x5b, 0x63,\n\t\t\t0x2c, 0x64, 0x29, 0x20, 0x20, 0x5b, 0x20, 0x34, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x35,\n\t\t\t0x20, 0x5d, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x28, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n\t\t\t0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x5b, 0x65, 0x2c, 0x66, 0x29, 0x20, 0x20, 0x5b, 0x20, 0x34,\n\t\t\t0x2c, 0x20, 0x30, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x31, 0x20, 0x5d, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x20, 0x28, 0x66, 0x6f, 0x6f, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x5b,\n\t\t\t0x67, 0x2c, 0x68, 0x29, 0x20, 0x20, 0x5b, 0x20, 0x34, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x30, 0x2c, 0x20,\n\t\t\t0x33, 0x20, 0x5d, 0x20, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x28, 0x31, 0x29, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x73, 0x3a, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x2d, 0x20, 0x41, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x79, 0x20,\n\t\t\t0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x74, 0x73, 0x65, 0x6c, 0x66, 0x20, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x20, 0x6e,\n\t\t\t0x6f, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x70, 0x61, 0x72,\n\t\t\t0x74, 0x69, 0x63, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e,\n\t\t\t0x20, 0x69, 0x74, 0x29, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20,\n\t\t\t0x77, 0x68, 0x65, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20, 0x61, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x6c,\n\t\t\t0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6c, 0x6f,\n\t\t\t0x67, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x65, 0x6e, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x73, 0x65, 0x67, 0x6d, 0x65, 0x6e,\n\t\t\t0x74, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x20,\n\t\t\t0x65, 0x6e, 0x74, 0x69, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x28, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x79, 0x20, 0x63, 0x6f, 0x6e,\n\t\t\t0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x65, 0x78, 0x74,\n\t\t\t0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x29, 0x20,\n\t\t\t0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x6e, 0x20,\n\t\t\t0x6f, 0x75, 0x74, 0x65, 0x72, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x68, 0x6f, 0x73, 0x65,\n\t\t\t0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x22, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f,\n\t\t\t0x75, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2d, 0x20,\n\t\t\t0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d,\n\t\t\t0x61, 0x79, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x74,\n\t\t\t0x68, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x68, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x73, 0x20, 0x77, 0x68, 0x65,\n\t\t\t0x6e, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6c, 0x6f,\n\t\t\t0x67, 0x69, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x73, 0x70, 0x72, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x20, 0x6d,\n\t\t\t0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x73, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x20, 0x6d, 0x6f, 0x73, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6f, 0x62, 0x76, 0x69, 0x6f, 0x75, 0x73,\n\t\t\t0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x65, 0x78, 0x74,\n\t\t\t0x65, 0x6e, 0x64, 0x22, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x61, 0x67, 0x61, 0x69, 0x6e, 0x20, 0x2d, 0x2d, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c,\n\t\t\t0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x20, 0x62, 0x6c, 0x6f, 0x63,\n\t\t\t0x6b, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x73, 0x63, 0x6f, 0x70, 0x65,\n\t\t\t0x2c, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x6f, 0x66, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x77, 0x69, 0x6c, 0x6c,\n\t\t\t0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2d, 0x20, 0x41, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x27, 0x73,\n\t\t\t0x20, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20,\n\t\t\t0x61, 0x20, 0x73, 0x75, 0x62, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x20, 0x70, 0x61, 0x72, 0x65,\n\t\t\t0x6e, 0x74, 0x27, 0x73, 0x20, 0x73, 0x70, 0x61, 0x6e, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x65, 0x78, 0x74,\n\t\t\t0x65, 0x6e, 0x64, 0x65, 0x65, 0x22, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61,\n\t\t\t0x72, 0x73, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x62, 0x65, 0x67,\n\t\t\t0x69, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x22, 0x65, 0x78, 0x74, 0x65, 0x6e,\n\t\t\t0x64, 0x22, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x73, 0x68, 0x61, 0x72,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62,\n\t\t\t0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x2d, 0x20, 0x4a, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65,\n\t\t\t0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x61, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x27, 0x73, 0x20, 0x73,\n\t\t\t0x70, 0x61, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x75, 0x62, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73,\n\t\t\t0x6f, 0x6d, 0x65, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x27, 0x73,\n\t\t\t0x20, 0x73, 0x70, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f,\n\t\t\t0x74, 0x20, 0x6d, 0x65, 0x61, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20,\n\t\t\t0x64, 0x65, 0x73, 0x63, 0x65, 0x6e, 0x64, 0x61, 0x6e, 0x74, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61,\n\t\t\t0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x61, 0x20, 0x22, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x20, 0x64, 0x65, 0x66, 0x69,\n\t\t\t0x6e, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x74, 0x68, 0x20, 0x61, 0x20, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20,\n\t\t\t0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20,\n\t\t\t0x20, 0x54, 0x68, 0x75, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e,\n\t\t\t0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x61, 0x70, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x2d, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x74, 0x72, 0x69,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x20, 0x6c, 0x6f, 0x63, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x70, 0x72, 0x6f, 0x62, 0x61, 0x62, 0x6c,\n\t\t\t0x79, 0x20, 0x62, 0x65, 0x20, 0x64, 0x65, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61,\n\t\t\t0x74, 0x20, 0x69, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x75, 0x6e, 0x64, 0x65, 0x72, 0x73, 0x74,\n\t\t\t0x61, 0x6e, 0x64, 0x2c, 0x20, 0x61, 0x73, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x6f,\n\t\t\t0x66, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4c, 0x6f, 0x63, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69,\n\t\t\t0x66, 0x69, 0x65, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x61, 0x72, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x20, 0x77, 0x61, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x61, 0x63, 0x68, 0x20, 0x65,\n\t\t\t0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x75,\n\t\t\t0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x20, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x61, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x66, 0x72, 0x6f, 0x6d,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x20, 0x46, 0x69, 0x6c,\n\t\t\t0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x73, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x5b, 0x20, 0x34, 0x2c, 0x20, 0x33, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x37, 0x2c, 0x20, 0x31, 0x20, 0x5d, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x28, 0x33, 0x29, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x34, 0x2c, 0x20, 0x33, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x28, 0x37, 0x29, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x32, 0x2c, 0x20, 0x37, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x28, 0x29, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x31, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x69,\n\t\t\t0x73, 0x20, 0x69, 0x73, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x68, 0x61, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x75, 0x6d, 0x62,\n\t\t\t0x65, 0x72, 0x20, 0x34, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20,\n\t\t\t0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x68, 0x61, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x32, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x3d, 0x20, 0x32, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x68, 0x61,\n\t\t\t0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x31, 0x3a, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x75, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f,\n\t\t\t0x76, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x67, 0x69, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e, 0x61,\n\t\t\t0x6d, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x66, 0x20, 0x77, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65,\n\t\t\t0x6e, 0x74, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x5b, 0x20, 0x34, 0x2c, 0x20, 0x33, 0x2c,\n\t\t\t0x20, 0x32, 0x2c, 0x20, 0x37, 0x20, 0x5d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20,\n\t\t\t0x70, 0x61, 0x74, 0x68, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x77,\n\t\t\t0x68, 0x6f, 0x6c, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x28, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x6e, 0x69,\n\t\t\t0x6e, 0x67, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x62,\n\t\t\t0x65, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x73, 0x65, 0x6d, 0x69, 0x63, 0x6f, 0x6c, 0x6f, 0x6e, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x20, 0x5b, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x68, 0x61, 0x73, 0x20, 0x65, 0x78,\n\t\t\t0x61, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x68, 0x72, 0x65, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x75, 0x72, 0x20,\n\t\t\t0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x65,\n\t\t\t0x2c, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x28, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61,\n\t\t\t0x6c, 0x2c, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x20, 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64,\n\t\t\t0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x73, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x29,\n\t\t\t0x2c, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x74, 0x6f, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x65, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x63, 0x79, 0x2e, 0x20, 0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20,\n\t\t\t0x74, 0x68, 0x61, 0x74, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20,\n\t\t\t0x7a, 0x65, 0x72, 0x6f, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20, 0x2d, 0x2d, 0x20, 0x74, 0x79, 0x70, 0x69, 0x63, 0x61,\n\t\t\t0x6c, 0x6c, 0x79, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x61, 0x64, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x31, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x61, 0x63,\n\t\t\t0x68, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x61, 0x20, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x5b,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f,\n\t\t\t0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20,\n\t\t\t0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x2c, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x79, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68,\n\t\t\t0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x63,\n\t\t\t0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x6c, 0x69, 0x6e, 0x65,\n\t\t\t0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x63, 0x75, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x73,\n\t\t\t0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6e, 0x6f, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6f, 0x6e, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x6c, 0x6c,\n\t\t\t0x20, 0x62, 0x65, 0x20, 0x74, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e,\n\t\t\t0x67, 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63,\n\t\t\t0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6b, 0x65,\n\t\t\t0x65, 0x70, 0x20, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x28, 0x62, 0x75, 0x74, 0x20, 0x6e, 0x6f, 0x74,\n\t\t\t0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x29, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63,\n\t\t\t0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x20, 0x45, 0x61, 0x63, 0x68,\n\t\t\t0x20, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73,\n\t\t\t0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x6c, 0x69,\n\t\t\t0x6e, 0x65, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x6d, 0x65, 0x6e, 0x74, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4f, 0x6e, 0x6c,\n\t\t\t0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,\n\t\t\t0x74, 0x20, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x3b, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65,\n\t\t\t0x6e, 0x74, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x73, 0x20, 0x28, 0x65, 0x2e, 0x67, 0x2e, 0x20, 0x2f, 0x2f, 0x29,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x74, 0x72, 0x69, 0x70, 0x70, 0x65, 0x64,\n\t\t\t0x20, 0x6f, 0x75, 0x74, 0x2e, 0x20, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x63, 0x6f, 0x6d,\n\t\t\t0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x20, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65,\n\t\t\t0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x73, 0x74, 0x65, 0x72, 0x69, 0x73,\n\t\t\t0x6b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x70, 0x70, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x62, 0x65, 0x67, 0x69, 0x6e,\n\t\t\t0x6e, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x6f, 0x74,\n\t\t\t0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x77, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20,\n\t\t\t0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x70,\n\t\t\t0x75, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x78,\n\t\t\t0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x3a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x66,\n\t\t\t0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20,\n\t\t\t0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x66, 0x6f, 0x6f, 0x2e, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x74, 0x74,\n\t\t\t0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x61, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x62, 0x61,\n\t\t\t0x72, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x62,\n\t\t\t0x61, 0x7a, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x62, 0x61, 0x7a, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x6f,\n\t\t\t0x74, 0x68, 0x65, 0x72, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x62, 0x61, 0x7a, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68,\n\t\t\t0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x6f, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x6f, 0x74, 0x68,\n\t\t\t0x65, 0x72, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x6d, 0x6f, 0x6f, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x61, 0x6c, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x20, 0x6d, 0x6f, 0x6f, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x65,\n\t\t\t0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63,\n\t\t\t0x6f, 0x72, 0x67, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x65,\n\t\t\t0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f,\n\t\t\t0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x6d, 0x6f, 0x6f, 0x20, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x72, 0x67, 0x65, 0x20, 0x62, 0x65, 0x63, 0x61, 0x75,\n\t\t\t0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x6c,\n\t\t\t0x69, 0x6e, 0x65, 0x73, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x74, 0x20, 0x66,\n\t\t\t0x72, 0x6f, 0x6d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x6f, 0x74, 0x68,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x63, 0x6f, 0x72, 0x67, 0x65, 0x20, 0x70, 0x61, 0x72, 0x61, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x32, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x72, 0x67, 0x65, 0x20, 0x3d,\n\t\t\t0x20, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2a, 0x20, 0x42, 0x6c, 0x6f, 0x63,\n\t\t\t0x6b, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x6f, 0x72, 0x67, 0x65, 0x2e,\n\t\t\t0x20, 0x20, 0x4c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x73, 0x74, 0x65, 0x72, 0x69, 0x73, 0x6b, 0x73, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x2a, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x2e, 0x20, 0x2a, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2a, 0x20, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x61, 0x74,\n\t\t\t0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x67, 0x72, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x20, 0x2a, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x67, 0x72, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x64, 0x65, 0x74, 0x61,\n\t\t\t0x63, 0x68, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x65, 0x61, 0x64, 0x69,\n\t\t\t0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x72, 0x61,\n\t\t\t0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d,\n\t\t\t0x6d, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x6f, 0x6f, 0x6c,\n\t\t\t0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x35, 0x33,\n\t\t\t0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x5b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x20, 0x35, 0x33, 0x36,\n\t\t\t0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x62,\n\t\t\t0x75, 0x66, 0x2e, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x75,\n\t\t\t0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,\n\t\t\t0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x22, 0x2e, 0x62,\n\t\t\t0x75, 0x66, 0x2e, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x62, 0x75, 0x66,\n\t\t\t0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x65, 0x78,\n\t\t\t0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x0a, 0x20, 0x20, 0x7d, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x20, 0x67, 0x65, 0x6e, 0x65,\n\t\t\t0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x74, 0x73, 0x20, 0x6f,\n\t\t\t0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x69,\n\t\t\t0x6c, 0x65, 0x2e, 0x20, 0x41, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49,\n\t\t\t0x6e, 0x66, 0x6f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63,\n\t\t\t0x69, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20,\n\t\t\t0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20,\n\t\t\t0x66, 0x69, 0x6c, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,\n\t\t\t0x6e, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x69, 0x66, 0x66,\n\t\t\t0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20,\n\t\t\t0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x41, 0x6e, 0x20, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,\n\t\t\t0x74, 0x73, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x65, 0x78, 0x74,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x69, 0x74, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x2e, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x41, 0x6e, 0x6e,\n\t\t\t0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x64, 0x65,\n\t\t\t0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x75, 0x72,\n\t\t\t0x63, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20, 0x66, 0x6f, 0x72,\n\t\t\t0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x73, 0x20, 0x53,\n\t\t\t0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x31, 0x20, 0x5b, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c,\n\t\t\t0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b,\n\t\t\t0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65,\n\t\t\t0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x68,\n\t\t\t0x61, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x64,\n\t\t\t0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x62, 0x65, 0x67, 0x69,\n\t\t\t0x6e, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x64, 0x65, 0x6e, 0x74,\n\t\t\t0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x66,\n\t\t\t0x73, 0x65, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x75,\n\t\t\t0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x70, 0x61, 0x73, 0x74, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20,\n\t\t\t0x62, 0x79, 0x74, 0x65, 0x20, 0x28, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x3d, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x2d, 0x20,\n\t\t\t0x62, 0x65, 0x67, 0x69, 0x6e, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,\n\t\t\t0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69,\n\t\t\t0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x27, 0x73, 0x20, 0x65,\n\t\t\t0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x65, 0x66,\n\t\t\t0x66, 0x65, 0x63, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x69,\n\t\t\t0x73, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x4e, 0x4f, 0x4e, 0x45, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x73, 0x65, 0x74,\n\t\t\t0x20, 0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x77, 0x69, 0x73, 0x65, 0x20, 0x6d, 0x75, 0x74, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x53, 0x45, 0x54, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,\n\t\t\t0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x4c, 0x49, 0x41, 0x53, 0x20, 0x3d, 0x20, 0x32, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x20, 0x3d, 0x20,\n\t\t\t0x35, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x27, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x27, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x61, 0x20, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x70, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x69, 0x6d,\n\t\t\t0x70, 0x6f, 0x72, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x20, 0x53, 0x79, 0x6d, 0x62,\n\t\t\t0x6f, 0x6c, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69,\n\t\t\t0x6c, 0x69, 0x74, 0x79, 0x20, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x72,\n\t\t\t0x65, 0x76, 0x65, 0x6e, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x74, 0x20, 0x28, 0x65, 0x78, 0x3a, 0x20, 0x6c, 0x6f, 0x63,\n\t\t\t0x61, 0x6c, 0x20, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65,\n\t\t\t0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x29, 0x2e, 0x20, 0x20, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c,\n\t\t\t0x69, 0x74, 0x79, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x72, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6f, 0x6e,\n\t\t\t0x6c, 0x79, 0x20, 0x73, 0x65, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x6e, 0x20, 0x60, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x60, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x60, 0x65, 0x6e, 0x75, 0x6d, 0x60, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x79, 0x20, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73,\n\t\t\t0x20, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x66,\n\t\t\t0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x6f, 0x74, 0x68, 0x65,\n\t\t\t0x72, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x2e, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c,\n\t\t\t0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x56, 0x49, 0x53, 0x49, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x45, 0x54, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x56,\n\t\t\t0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x20, 0x3d, 0x20, 0x31, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x45, 0x58, 0x50, 0x4f, 0x52, 0x54,\n\t\t\t0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/duration.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x64, 0x75,\n\t\t\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61,\n\t\t\t0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f,\n\t\t\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69,\n\t\t\t0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66,\n\t\t\t0x69, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,\n\t\t\t0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b,\n\t\t\t0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x44, 0x75,\n\t\t\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20,\n\t\t\t0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x2c, 0x20, 0x66, 0x69, 0x78, 0x65, 0x64, 0x2d, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,\n\t\t\t0x20, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x6e, 0x74, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66, 0x72, 0x61, 0x63, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x74, 0x20, 0x6e,\n\t\t\t0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x49, 0x74, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65,\n\t\t\t0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x65, 0x70, 0x74, 0x73, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x22, 0x64, 0x61,\n\t\t\t0x79, 0x22, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x72, 0x20, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x2e, 0x20, 0x49, 0x74,\n\t\t\t0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73,\n\t\t\t0x74, 0x61, 0x6d, 0x70, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x66,\n\t\t\t0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x74,\n\t\t\t0x77, 0x6f, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x61, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x74,\n\t\t\t0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x61, 0x64, 0x64, 0x65, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x75, 0x62,\n\t\t\t0x74, 0x72, 0x61, 0x63, 0x74, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x20, 0x54, 0x69,\n\t\t\t0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x20, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x70,\n\t\t\t0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x6c, 0x79, 0x20, 0x2b, 0x2d, 0x31, 0x30, 0x2c, 0x30, 0x30, 0x30,\n\t\t\t0x20, 0x79, 0x65, 0x61, 0x72, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x45, 0x78, 0x61, 0x6d,\n\t\t\t0x70, 0x6c, 0x65, 0x73, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x31,\n\t\t\t0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66,\n\t\t\t0x72, 0x6f, 0x6d, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x73, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74,\n\t\t\t0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73,\n\t\t\t0x74, 0x61, 0x6d, 0x70, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x75,\n\t\t\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x3d, 0x20, 0x65, 0x6e, 0x64,\n\t\t\t0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x2d, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2e, 0x73, 0x65, 0x63,\n\t\t\t0x6f, 0x6e, 0x64, 0x73, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x65, 0x6e, 0x64, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65,\n\t\t\t0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x3c, 0x20, 0x30, 0x20, 0x26, 0x26, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x3e, 0x20, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,\n\t\t\t0x20, 0x2b, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x75, 0x72, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x2d, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30,\n\t\t\t0x30, 0x30, 0x30, 0x30, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20,\n\t\t\t0x69, 0x66, 0x20, 0x28, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,\n\t\t\t0x20, 0x3e, 0x20, 0x30, 0x20, 0x26, 0x26, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6e, 0x61, 0x6e,\n\t\t\t0x6f, 0x73, 0x20, 0x3c, 0x20, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64,\n\t\t\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x2d, 0x3d, 0x20, 0x31,\n\t\t\t0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,\n\t\t\t0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x2b, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3b,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d,\n\t\t\t0x70, 0x6c, 0x65, 0x20, 0x32, 0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73,\n\t\t\t0x74, 0x61, 0x6d, 0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20,\n\t\t\t0x2b, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f,\n\t\t\t0x20, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d,\n\t\t\t0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x75, 0x72, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54,\n\t\t\t0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x2e, 0x2e, 0x2e, 0x3b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,\n\t\t\t0x73, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x2b, 0x20,\n\t\t\t0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3b, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61,\n\t\t\t0x72, 0x74, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x2b, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e,\n\t\t\t0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20,\n\t\t\t0x28, 0x65, 0x6e, 0x64, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x3c, 0x20, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x2d,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2e, 0x6e, 0x61,\n\t\t\t0x6e, 0x6f, 0x73, 0x20, 0x2b, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3b, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x20, 0x28, 0x65, 0x6e, 0x64,\n\t\t\t0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x3e, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,\n\t\t\t0x29, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x2e, 0x73, 0x65, 0x63,\n\t\t\t0x6f, 0x6e, 0x64, 0x73, 0x20, 0x2b, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x65, 0x6e, 0x64, 0x2e, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x2d, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,\n\t\t\t0x30, 0x30, 0x30, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x33, 0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x44,\n\t\t\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,\n\t\t\t0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x20, 0x50, 0x79, 0x74, 0x68, 0x6f,\n\t\t\t0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x64, 0x20, 0x3d, 0x20, 0x64, 0x61,\n\t\t\t0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x28, 0x64, 0x61, 0x79,\n\t\t\t0x73, 0x3d, 0x33, 0x2c, 0x20, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x3d, 0x31, 0x30, 0x29, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2e, 0x46, 0x72, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x28, 0x74, 0x64, 0x29, 0x0a,\n\t\t\t0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67,\n\t\t\t0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61,\n\t\t\t0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x72, 0x61, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x61, 0x6e, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73,\n\t\t\t0x75, 0x66, 0x66, 0x69, 0x78, 0x20, 0x22, 0x73, 0x22, 0x20, 0x28, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x70, 0x72, 0x65, 0x63, 0x65, 0x64, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6d,\n\t\t\t0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68,\n\t\t\t0x20, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73,\n\t\t\t0x65, 0x64, 0x20, 0x61, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,\n\t\t\t0x2c, 0x20, 0x33, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x30, 0x20, 0x6e,\n\t\t\t0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x61, 0x73, 0x20, 0x22, 0x33, 0x73, 0x22, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x6c,\n\t\t\t0x65, 0x20, 0x33, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x31, 0x20, 0x6e, 0x61,\n\t\t\t0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x61, 0x73, 0x20, 0x22, 0x33, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,\n\t\t\t0x30, 0x31, 0x73, 0x22, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x33, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20,\n\t\t\t0x61, 0x6e, 0x64, 0x20, 0x31, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,\n\t\t\t0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x61, 0x73, 0x20, 0x22,\n\t\t\t0x33, 0x2e, 0x30, 0x30, 0x30, 0x30, 0x30, 0x31, 0x73, 0x22, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61,\n\t\t\t0x67, 0x65, 0x20, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53,\n\t\t\t0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x20, 0x4d, 0x75, 0x73, 0x74, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x2d, 0x33, 0x31, 0x35, 0x2c, 0x35, 0x37, 0x36, 0x2c, 0x30, 0x30, 0x30,\n\t\t\t0x2c, 0x30, 0x30, 0x30, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x2b, 0x33, 0x31, 0x35, 0x2c, 0x35, 0x37,\n\t\t\t0x36, 0x2c, 0x30, 0x30, 0x30, 0x2c, 0x30, 0x30, 0x30, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e,\n\t\t\t0x20, 0x4e, 0x6f, 0x74, 0x65, 0x3a, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x20,\n\t\t\t0x61, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x36, 0x30, 0x20, 0x73, 0x65, 0x63, 0x2f, 0x6d, 0x69, 0x6e, 0x20, 0x2a, 0x20, 0x36, 0x30, 0x20,\n\t\t\t0x6d, 0x69, 0x6e, 0x2f, 0x68, 0x72, 0x20, 0x2a, 0x20, 0x32, 0x34, 0x20, 0x68, 0x72, 0x2f, 0x64, 0x61, 0x79, 0x20, 0x2a,\n\t\t\t0x20, 0x33, 0x36, 0x35, 0x2e, 0x32, 0x35, 0x20, 0x64, 0x61, 0x79, 0x73, 0x2f, 0x79, 0x65, 0x61, 0x72, 0x20, 0x2a, 0x20,\n\t\t\t0x31, 0x30, 0x30, 0x30, 0x30, 0x20, 0x79, 0x65, 0x61, 0x72, 0x73, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x20,\n\t\t\t0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53,\n\t\t\t0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61,\n\t\t\t0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e,\n\t\t\t0x64, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x73, 0x70, 0x61, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x20, 0x44,\n\t\t\t0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x6f,\n\t\t\t0x6e, 0x65, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x65, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x30, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x60, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x60, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20,\n\t\t\t0x61, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69,\n\t\t\t0x76, 0x65, 0x20, 0x60, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x60, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x46, 0x6f,\n\t\t\t0x72, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x6f, 0x6e, 0x65, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x72, 0x65, 0x2c, 0x20,\n\t\t\t0x61, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x7a, 0x65, 0x72, 0x6f, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x66, 0x6f, 0x72,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x60, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x60, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d,\n\t\t\t0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73,\n\t\t\t0x61, 0x6d, 0x65, 0x20, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x60, 0x73, 0x65, 0x63,\n\t\t\t0x6f, 0x6e, 0x64, 0x73, 0x60, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x4d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65,\n\t\t\t0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x2d, 0x39, 0x39, 0x39, 0x2c, 0x39, 0x39, 0x39, 0x2c, 0x39, 0x39, 0x39, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x2b, 0x39, 0x39, 0x39, 0x2c, 0x39, 0x39, 0x39, 0x2c, 0x39, 0x39, 0x39, 0x20,\n\t\t\t0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6e,\n\t\t\t0x61, 0x6e, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/empty.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67,\n\t\t\t0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f,\n\t\t\t0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63,\n\t\t\t0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b,\n\t\t\t0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63,\n\t\t\t0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x50, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c,\n\t\t\t0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72,\n\t\t\t0x65, 0x66, 0x69, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20,\n\t\t\t0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c,\n\t\t\t0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20,\n\t\t\t0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79,\n\t\t\t0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x72, 0x65, 0x2d, 0x75, 0x73, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x76, 0x6f,\n\t\t\t0x69, 0x64, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2e, 0x20, 0x41, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x69, 0x63, 0x61, 0x6c, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x20, 0x69, 0x74, 0x20, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x50, 0x49, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f,\n\t\t\t0x64, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x46, 0x6f, 0x6f, 0x20, 0x7b,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x70, 0x63, 0x20, 0x42, 0x61, 0x72, 0x28, 0x67, 0x6f,\n\t\t\t0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x29,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x20,\n\t\t\t0x7b, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/field_mask.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61,\n\t\t\t0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d,\n\t\t\t0x20, 0x22, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f,\n\t\t\t0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x3d,\n\t\t\t0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x73, 0x68, 0x61, 0x72,\n\t\t\t0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c,\n\t\t\t0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e,\n\t\t\t0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61,\n\t\t\t0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, 0x73, 0x6b, 0x70, 0x62, 0x22,\n\t\t\t0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61,\n\t\t\t0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x46,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x60, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73,\n\t\t\t0x20, 0x61, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x69, 0x63, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d,\n\t\t\t0x70, 0x6c, 0x65, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73,\n\t\t\t0x3a, 0x20, 0x22, 0x66, 0x2e, 0x61, 0x22, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73,\n\t\t\t0x3a, 0x20, 0x22, 0x66, 0x2e, 0x62, 0x2e, 0x64, 0x22, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x48, 0x65, 0x72, 0x65,\n\t\t\t0x20, 0x60, 0x66, 0x60, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x60, 0x61, 0x60, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x60, 0x62, 0x60, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61,\n\t\t\t0x67, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x60, 0x66, 0x60, 0x2c, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x60, 0x64, 0x60, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x60, 0x66, 0x2e, 0x62, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d,\n\t\t\t0x61, 0x73, 0x6b, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x65,\n\t\t\t0x63, 0x69, 0x66, 0x79, 0x20, 0x61, 0x20, 0x73, 0x75, 0x62, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x73, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x67, 0x65, 0x74, 0x20,\n\t\t\t0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x72, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65,\n\t\t\t0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x6e, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x73,\n\t\t\t0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20,\n\t\t\t0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x28, 0x73, 0x65, 0x65, 0x20, 0x62,\n\t\t\t0x65, 0x6c, 0x6f, 0x77, 0x29, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x20, 0x4d, 0x61, 0x73, 0x6b, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x68, 0x65, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,\n\t\t\t0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x75, 0x62, 0x2d, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x62,\n\t\t\t0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x50, 0x49, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x63, 0x6f,\n\t\t\t0x6e, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x6f, 0x73, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61,\n\t\t\t0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c,\n\t\t\t0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x72, 0x65, 0x73, 0x70,\n\t\t\t0x6f, 0x6e, 0x73, 0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x66, 0x6f, 0x6c, 0x6c,\n\t\t\t0x6f, 0x77, 0x73, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x20, 0x7b, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3a, 0x20, 0x32, 0x32, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64,\n\t\t\t0x20, 0x3a, 0x20, 0x31, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x20, 0x3a, 0x20,\n\t\t\t0x32, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x79, 0x20, 0x3a, 0x20, 0x31, 0x33, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x7a, 0x3a, 0x20, 0x38, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74,\n\t\t\t0x61, 0x69, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x78, 0x2c, 0x79, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x7a,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x77, 0x69, 0x6c,\n\t\t\t0x6c, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x74, 0x65, 0x78, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74,\n\t\t\t0x29, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x20, 0x7b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x61, 0x20, 0x3a, 0x20, 0x32, 0x32, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x64, 0x20, 0x3a, 0x20, 0x31, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x6f,\n\t\t\t0x77, 0x65, 0x64, 0x20, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x20, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61,\n\t\t\t0x73, 0x74, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x49, 0x66, 0x20, 0x61, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63,\n\t\t\t0x74, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x61, 0x20, 0x67, 0x65, 0x74, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65,\n\t\t\t0x73, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x28, 0x61, 0x73, 0x20,\n\t\t\t0x69, 0x66, 0x20, 0x61, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c,\n\t\t\t0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x64, 0x20, 0x62, 0x65, 0x65, 0x6e,\n\t\t\t0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x29, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e,\n\t\t\t0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73,\n\t\t\t0x6b, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x69,\n\t\t\t0x6c, 0x79, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x74,\n\t\t\t0x6f, 0x70, 0x2d, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x20, 0x49, 0x6e, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20,\n\t\t\t0x52, 0x45, 0x53, 0x54, 0x20, 0x67, 0x65, 0x74, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x61, 0x70,\n\t\t\t0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x63,\n\t\t\t0x61, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x52, 0x45, 0x53, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x6c, 0x69, 0x73,\n\t\t\t0x74, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x73,\n\t\t\t0x6b, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72,\n\t\t\t0x6e, 0x65, 0x64, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x20, 0x49,\n\t\t\t0x6e, 0x20, 0x63, 0x61, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x52, 0x45, 0x53, 0x54, 0x20, 0x63, 0x75, 0x73,\n\t\t\t0x74, 0x6f, 0x6d, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72,\n\t\t\t0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x75, 0x73, 0x65, 0x64, 0x2e, 0x20, 0x57, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x73, 0x6b,\n\t\t\t0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x63, 0x6c, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x74,\n\t\t\t0x6f, 0x67, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x69, 0x74, 0x73, 0x20, 0x64, 0x65, 0x63,\n\t\t\t0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x50, 0x49, 0x2e,\n\t\t\t0x20, 0x20, 0x49, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x63, 0x61, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x74, 0x75,\n\t\t\t0x72, 0x6e, 0x65, 0x64, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,\n\t\t\t0x63, 0x65, 0x73, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x62,\n\t\t\t0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x4d, 0x61, 0x73, 0x6b, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x73,\n\t\t\t0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x72, 0x65, 0x20, 0x67, 0x6f, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x41,\n\t\t\t0x50, 0x49, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61, 0x73,\n\t\t\t0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61,\n\t\t\t0x73, 0x6b, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x20, 0x75, 0x6e, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x64, 0x2e, 0x20, 0x49, 0x66,\n\t\t\t0x20, 0x61, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x69, 0x73, 0x20, 0x70, 0x61, 0x73, 0x73, 0x65,\n\t\t\t0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2c, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x41, 0x50, 0x49, 0x20, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65,\n\t\t\t0x6c, 0x64, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x61, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x73, 0x70,\n\t\t\t0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74,\n\t\t\t0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20, 0x61, 0x70, 0x70, 0x65, 0x6e,\n\t\t\t0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x20, 0x4e,\n\t\t\t0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x61, 0x6c, 0x6c,\n\t\t\t0x6f, 0x77, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x70, 0x6f, 0x73,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x60, 0x70, 0x61, 0x74, 0x68, 0x73, 0x60, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x66, 0x20, 0x61, 0x20, 0x73, 0x75,\n\t\t\t0x62, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73,\n\t\t\t0x6b, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6f,\n\t\t\t0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x20,\n\t\t\t0x69, 0x6e, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x75,\n\t\t\t0x62, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x67, 0x69, 0x76, 0x65,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x64, 0x3a, 0x20, 0x31, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x3a, 0x20, 0x32,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x63, 0x3a, 0x20, 0x5b, 0x31, 0x5d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x64, 0x20, 0x61, 0x6e, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x20, 0x7b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x64, 0x3a, 0x20, 0x31, 0x30, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x3a, 0x20, 0x5b, 0x32, 0x5d, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x69, 0x66, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x69, 0x73, 0x3a, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0x20, 0x5b, 0x22, 0x66, 0x2e, 0x62, 0x22, 0x2c,\n\t\t\t0x20, 0x22, 0x66, 0x2e, 0x63, 0x22, 0x5d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x3a, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x62, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x3a, 0x20,\n\t\t\t0x31, 0x30, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x78, 0x3a, 0x20, 0x32, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63,\n\t\t\t0x3a, 0x20, 0x5b, 0x31, 0x2c, 0x20, 0x32, 0x5d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6e, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x6e,\n\t\t\t0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x73, 0x65, 0x74, 0x20, 0x61, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x27, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x75,\n\t\t\t0x73, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6d, 0x61, 0x73, 0x6b,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f,\n\t\t\t0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x48,\n\t\t\t0x65, 0x6e, 0x63, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65,\n\t\t\t0x73, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20,\n\t\t\t0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x61, 0x20,\n\t\t\t0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20,\n\t\t\t0x73, 0x65, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x64, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x20, 0x61, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x61, 0x73, 0x20, 0x64,\n\t\t\t0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x62, 0x65, 0x6c, 0x6f, 0x77, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x49, 0x66, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x6e, 0x6f, 0x74, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x6e, 0x20, 0x75, 0x70, 0x64, 0x61,\n\t\t\t0x74, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x70,\n\t\t\t0x70, 0x6c, 0x69, 0x65, 0x73, 0x20, 0x74, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x73, 0x20, 0x28, 0x61, 0x73, 0x20, 0x69, 0x66, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61,\n\t\t\t0x73, 0x6b, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x68, 0x61, 0x73,\n\t\t\t0x20, 0x62, 0x65, 0x65, 0x6e, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x29, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x65, 0x76, 0x6f,\n\t\t\t0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6d, 0x65, 0x61,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6b, 0x6e, 0x6f,\n\t\t\t0x77, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x68, 0x61, 0x73, 0x20, 0x74, 0x68, 0x65, 0x72, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x66, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x74, 0x6f, 0x0a, 0x2f, 0x2f, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x69, 0x72, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,\n\t\t\t0x74, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x75, 0x6e, 0x77, 0x61, 0x6e, 0x74,\n\t\t\t0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2c, 0x20, 0x61, 0x20, 0x73, 0x70,\n\t\t\t0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x72,\n\t\t\t0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x20, 0x61, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61,\n\t\t\t0x6c, 0x77, 0x61, 0x79, 0x73, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x2c, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x61, 0x6e, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x67, 0x65, 0x74, 0x20, 0x6f, 0x70, 0x65, 0x72,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x77, 0x68, 0x69,\n\t\t\t0x63, 0x68, 0x0a, 0x2f, 0x2f, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64, 0x65,\n\t\t\t0x70, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x70, 0x65, 0x72,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x2e, 0x20, 0x49, 0x6e, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x63,\n\t\t\t0x61, 0x73, 0x65, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x69, 0x73, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x68, 0x6f, 0x6e, 0x6f, 0x72,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x50, 0x49, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x23, 0x23, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x52, 0x45, 0x53, 0x54, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x48, 0x54, 0x54, 0x50, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x20, 0x75,\n\t\t\t0x70, 0x64, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x68, 0x69, 0x63,\n\t\t\t0x68, 0x20, 0x75, 0x73, 0x65, 0x73, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20,\n\t\t\t0x6d, 0x75, 0x73, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x50, 0x41,\n\t\t\t0x54, 0x43, 0x48, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x50, 0x55, 0x54, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x79, 0x20, 0x48,\n\t\t\t0x54, 0x54, 0x50, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x50, 0x55,\n\t\t\t0x54, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x73, 0x29, 0x2e, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x4d, 0x61, 0x73, 0x6b, 0x73, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x49, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x2c, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d,\n\t\t\t0x61, 0x73, 0x6b, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20,\n\t\t\t0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20,\n\t\t\t0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x2e, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x65, 0x61, 0x63, 0x68, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20,\n\t\t\t0x61, 0x72, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x2f,\n\t\t\t0x66, 0x72, 0x6f, 0x6d, 0x20, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x2d, 0x63, 0x61, 0x6d, 0x65, 0x6c, 0x20, 0x6e, 0x61, 0x6d,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x41, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x63, 0x6f,\n\t\t\t0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x73, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x20, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x55, 0x73, 0x65, 0x72, 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x20, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x20, 0x3d, 0x20, 0x32, 0x3b,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x55, 0x73, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65,\n\t\t\t0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x61,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x50, 0x72, 0x6f,\n\t\t\t0x66, 0x69, 0x6c, 0x65, 0x60, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x6c, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x73, 0x20, 0x73, 0x75,\n\t\t\t0x63, 0x68, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x7b,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0x20, 0x22, 0x75, 0x73,\n\t\t\t0x65, 0x72, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0x20, 0x22, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x22,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x20, 0x4a,\n\t\t\t0x53, 0x4f, 0x4e, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x69,\n\t\t\t0x73, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x62, 0x65, 0x6c,\n\t\t\t0x6f, 0x77, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x3a, 0x20, 0x22, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x64, 0x69, 0x73,\n\t\t\t0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x70, 0x68, 0x6f, 0x74, 0x6f, 0x22, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x4d,\n\t\t\t0x61, 0x73, 0x6b, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x73, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x73, 0x20,\n\t\t\t0x74, 0x72, 0x65, 0x61, 0x74, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x6e, 0x65, 0x6f,\n\t\t\t0x66, 0x73, 0x20, 0x6a, 0x75, 0x73, 0x74, 0x20, 0x61, 0x73, 0x20, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x65, 0x6f,\n\t\t\t0x66, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x73, 0x75, 0x62, 0x5f, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x39, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x7d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x3a, 0x0a,\n\t\t\t0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0x20, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x72, 0x3a, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x7b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0x20, 0x22, 0x73, 0x75, 0x62, 0x5f, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x22, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x4e, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x28, 0x22, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x65, 0x6f, 0x66,\n\t\t\t0x22, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x63, 0x61, 0x73, 0x65, 0x29, 0x20, 0x63, 0x61, 0x6e, 0x6e,\n\t\t\t0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x70, 0x61, 0x74,\n\t\t\t0x68, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x23, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x4d,\n\t\t\t0x61, 0x73, 0x6b, 0x20, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x41, 0x50, 0x49, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20,\n\t\t\t0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x68, 0x61, 0x73, 0x20, 0x61, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73,\n\t\t\t0x6b, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x76, 0x65,\n\t\t\t0x72, 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72,\n\t\t\t0x6e, 0x20, 0x61, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x41, 0x52, 0x47,\n\t\t\t0x55, 0x4d, 0x45, 0x4e, 0x54, 0x60, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x69, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20,\n\t\t\t0x70, 0x61, 0x74, 0x68, 0x20, 0x69, 0x73, 0x20, 0x75, 0x6e, 0x6d, 0x61, 0x70, 0x70, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x0a,\n\t\t\t0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x6d, 0x61, 0x73, 0x6b, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x61, 0x74, 0x68, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/go_features.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x32, 0x33, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x42, 0x53, 0x44, 0x2d, 0x73, 0x74,\n\t\t\t0x79, 0x6c, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x74, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73,\n\t\t\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x73, 0x6f, 0x75,\n\t\t\t0x72, 0x63, 0x65, 0x2f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2f, 0x62, 0x73, 0x64, 0x0a, 0x0a, 0x73, 0x79,\n\t\t\t0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x22, 0x3b, 0x0a, 0x0a, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x70, 0x62, 0x3b, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x22, 0x67,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67,\n\t\t\t0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,\n\t\t\t0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x67, 0x6f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x70,\n\t\t\t0x62, 0x22, 0x3b, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x7b,\n\t\t\t0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72,\n\t\t\t0x65, 0x73, 0x20, 0x67, 0x6f, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x32, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x47, 0x6f, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x57, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x6d,\n\t\t\t0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x43, 0x61, 0x6e, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x62, 0x65, 0x20, 0x74, 0x72, 0x75, 0x65, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4f,\n\t\t\t0x70, 0x65, 0x6e, 0x20, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x61, 0x70, 0x69, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x75,\n\t\t\t0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x3d,\n\t\t\t0x20, 0x31, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d,\n\t\t\t0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54,\n\t\t\t0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67,\n\t\t\t0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49,\n\t\t\t0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70,\n\t\t\t0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f,\n\t\t\t0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f,\n\t\t\t0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x22, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x4a, 0x53, 0x4f, 0x4e,\n\t\t\t0x20, 0x41, 0x50, 0x49, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65,\n\t\t\t0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65,\n\t\t\t0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x74, 0x72, 0x75,\n\t\t\t0x65, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65,\n\t\t\t0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20,\n\t\t\t0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75,\n\t\t\t0x65, 0x3a, 0x20, 0x22, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20,\n\t\t\t0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x41, 0x50, 0x49, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x41, 0x50, 0x49, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,\n\t\t\t0x49, 0x46, 0x49, 0x45, 0x44, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x65, 0x6c,\n\t\t\t0x65, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4f, 0x50, 0x45, 0x4e, 0x20, 0x41, 0x50, 0x49, 0x2c,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x64, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x75, 0x69, 0x73, 0x68, 0x20, 0x62, 0x65, 0x74, 0x77,\n\t\t\t0x65, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63,\n\t\t\t0x69, 0x74, 0x6c, 0x79, 0x20, 0x73, 0x65, 0x74, 0x20, 0x61, 0x70, 0x69, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x6f,\n\t\t\t0x72, 0x20, 0x61, 0x20, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x70, 0x69, 0x20, 0x6c, 0x65, 0x76, 0x65,\n\t\t\t0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x41, 0x50, 0x49, 0x5f, 0x4c, 0x45, 0x56, 0x45, 0x4c, 0x5f, 0x55, 0x4e, 0x53,\n\t\t\t0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x41, 0x50,\n\t\t\t0x49, 0x5f, 0x4f, 0x50, 0x45, 0x4e, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x41, 0x50, 0x49, 0x5f,\n\t\t\t0x48, 0x59, 0x42, 0x52, 0x49, 0x44, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x41, 0x50, 0x49, 0x5f,\n\t\t\t0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x4f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x4f, 0x50, 0x45, 0x4e, 0x2c, 0x20, 0x48, 0x59, 0x42, 0x52, 0x49,\n\t\t\t0x44, 0x20, 0x6f, 0x72, 0x20, 0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x41, 0x50, 0x49, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x20, 0x61, 0x70, 0x69, 0x5f, 0x6c, 0x65, 0x76,\n\t\t\t0x65, 0x6c, 0x20, 0x3d, 0x20, 0x32, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49,\n\t\t\t0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41,\n\t\t\t0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f,\n\t\t\t0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75,\n\t\t\t0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a,\n\t\t\t0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,\n\t\t\t0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x41, 0x50, 0x49, 0x5f, 0x4c, 0x45, 0x56, 0x45,\n\t\t\t0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,\n\t\t\t0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54,\n\t\t\t0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x41, 0x50,\n\t\t\t0x49, 0x5f, 0x4f, 0x50, 0x41, 0x51, 0x55, 0x45, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20,\n\t\t\t0x65, 0x6e, 0x75, 0x6d, 0x20, 0x53, 0x74, 0x72, 0x69, 0x70, 0x45, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53, 0x54, 0x52, 0x49, 0x50, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x50, 0x52,\n\t\t\t0x45, 0x46, 0x49, 0x58, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x30,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53, 0x54, 0x52, 0x49, 0x50, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x50, 0x52, 0x45,\n\t\t\t0x46, 0x49, 0x58, 0x5f, 0x4b, 0x45, 0x45, 0x50, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53, 0x54,\n\t\t\t0x52, 0x49, 0x50, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x5f, 0x47, 0x45, 0x4e, 0x45,\n\t\t\t0x52, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x4f, 0x54, 0x48, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53,\n\t\t\t0x54, 0x52, 0x49, 0x50, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x5f, 0x53, 0x54, 0x52,\n\t\t\t0x49, 0x50, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x53, 0x74, 0x72, 0x69, 0x70, 0x45, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x70, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x3d, 0x20,\n\t\t\t0x33, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20,\n\t\t\t0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f,\n\t\t\t0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65,\n\t\t\t0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55,\n\t\t\t0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74,\n\t\t\t0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69,\n\t\t\t0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32,\n\t\t\t0x30, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x53, 0x54, 0x52, 0x49, 0x50, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x50, 0x52,\n\t\t\t0x45, 0x46, 0x49, 0x58, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x50, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x32, 0x30, 0x32, 0x35, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47,\n\t\t\t0x41, 0x43, 0x59, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x53,\n\t\t\t0x54, 0x52, 0x49, 0x50, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x5f, 0x4b, 0x45, 0x45,\n\t\t\t0x50, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/java_features.proto\": {\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73,\n\t\t\t0x20, 0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74,\n\t\t\t0x65, 0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43,\n\t\t\t0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x32, 0x33, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t\t\t0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65,\n\t\t\t0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x67, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x42, 0x53, 0x44, 0x2d, 0x73,\n\t\t\t0x74, 0x79, 0x6c, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74,\n\t\t\t0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x4c, 0x49, 0x43, 0x45, 0x4e, 0x53, 0x45, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x74, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72,\n\t\t\t0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x73, 0x6f,\n\t\t\t0x75, 0x72, 0x63, 0x65, 0x2f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x73, 0x2f, 0x62, 0x73, 0x64, 0x0a, 0x0a, 0x73,\n\t\t\t0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x22, 0x3b, 0x0a, 0x0a, 0x70,\n\t\t\t0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x70, 0x62, 0x3b, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x22,\n\t\t\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63,\n\t\t\t0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63,\n\t\t\t0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b,\n\t\t\t0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63,\n\t\t\t0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x4a, 0x61, 0x76, 0x61, 0x46, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x20,\n\t\t\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20,\n\t\t\t0x4a, 0x61, 0x76, 0x61, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x30, 0x30, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4a, 0x61, 0x76,\n\t\t\t0x61, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x68, 0x65,\n\t\t\t0x74, 0x68, 0x65, 0x72, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x72, 0x65, 0x61, 0x74,\n\t\t\t0x20, 0x61, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x61, 0x73, 0x20, 0x63, 0x6c,\n\t\t\t0x6f, 0x73, 0x65, 0x64, 0x2e, 0x20, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69,\n\t\t\t0x73, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x20, 0x20, 0x49, 0x74, 0x20, 0x69, 0x73,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x74,\n\t\t\t0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f,\n\t\t\t0x72, 0x20, 0x6f, 0x66, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x65, 0x6e,\n\t\t\t0x75, 0x6d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6c, 0x6f, 0x73,\n\t\t\t0x65, 0x64, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x3d, 0x20, 0x31, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65,\n\t\t\t0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73,\n\t\t\t0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47,\n\t\t\t0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65,\n\t\t\t0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63,\n\t\t\t0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x61, 0x72, 0x6e,\n\t\t\t0x69, 0x6e, 0x67, 0x3a, 0x20, 0x22, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x63, 0x6c, 0x6f,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x4a, 0x61, 0x76, 0x61, 0x20, 0x69, 0x73, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64,\n\t\t\t0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x73, 0x63, 0x68,\n\t\t\t0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64,\n\t\t\t0x20, 0x69, 0x6e, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x32, 0x30, 0x32, 0x35, 0x2e, 0x20, 0x20, 0x53, 0x65, 0x65, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d,\n\t\t\t0x6d, 0x69, 0x6e, 0x67, 0x2d, 0x67, 0x75, 0x69, 0x64, 0x65, 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x2f, 0x23, 0x6a, 0x61,\n\t\t\t0x76, 0x61, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x6d, 0x6f, 0x72,\n\t\t\t0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61,\n\t\t\t0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44,\n\t\t\t0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,\n\t\t\t0x20, 0x22, 0x74, 0x72, 0x75, 0x65, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x2c,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20,\n\t\t\t0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x55, 0x54, 0x46, 0x38, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x55, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c,\n\t\t\t0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x76,\n\t\t\t0x61, 0x6c, 0x69, 0x64, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20,\n\t\t\t0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x55, 0x54, 0x46, 0x38, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f,\n\t\t\t0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x52, 0x65, 0x73, 0x70, 0x65, 0x63, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x55, 0x54, 0x46, 0x38, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x20, 0x73,\n\t\t\t0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6c, 0x6f, 0x62,\n\t\t\t0x61, 0x6c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64,\n\t\t\t0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x44,\n\t\t\t0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x56,\n\t\t\t0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x73, 0x20, 0x55, 0x54, 0x46, 0x38, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x69, 0x74,\n\t\t\t0x79, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6c, 0x6f,\n\t\t\t0x62, 0x61, 0x6c, 0x20, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x67, 0x61,\n\t\t\t0x63, 0x79, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b,\n\t\t\t0x5f, 0x75, 0x74, 0x66, 0x38, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x56, 0x45,\n\t\t\t0x52, 0x49, 0x46, 0x59, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x55, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x32, 0x20,\n\t\t\t0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45,\n\t\t\t0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59,\n\t\t\t0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,\n\t\t\t0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72,\n\t\t\t0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f,\n\t\t\t0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x32, 0x30, 0x32, 0x33, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f,\n\t\t\t0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x32, 0x30, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x5f, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x22, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x61,\n\t\t\t0x76, 0x61, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x20, 0x75, 0x74, 0x66, 0x38, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x22,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x61, 0x6e, 0x64, 0x20, 0x69, 0x73, 0x20, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x22, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x30, 0x32, 0x35, 0x2e, 0x20, 0x20, 0x55,\n\t\t\t0x74, 0x66, 0x38, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x68, 0x61, 0x76,\n\t\t\t0x69, 0x6f, 0x72, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x22, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x63, 0x72, 0x6f, 0x73,\n\t\t\t0x73, 0x2d, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x20, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, 0x6c, 0x69,\n\t\t\t0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x22, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x22, 0x66, 0x65, 0x61,\n\t\t\t0x74, 0x75, 0x72, 0x65, 0x2e, 0x22, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20,\n\t\t\t0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47,\n\t\t\t0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54,\n\t\t\t0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x6c, 0x6c, 0x6f, 0x77,\n\t\t\t0x73, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x20,\n\t\t\t0x4a, 0x61, 0x76, 0x61, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2c, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x62, 0x65, 0x79, 0x6f, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72,\n\t\t\t0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x6c, 0x69, 0x6d, 0x69,\n\t\t\t0x74, 0x73, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4a, 0x61,\n\t\t\t0x76, 0x61, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x6c, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x20,\n\t\t\t0x3d, 0x20, 0x33, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20,\n\t\t\t0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45,\n\t\t\t0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72,\n\t\t\t0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46,\n\t\t\t0x49, 0x4c, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70,\n\t\t\t0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49,\n\t\t\t0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b,\n\t\t\t0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45,\n\t\t\t0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22,\n\t\t\t0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x68, 0x65, 0x74, 0x68, 0x65,\n\t\t\t0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x6c, 0x64, 0x20, 0x64, 0x65, 0x66,\n\t\t\t0x61, 0x75, 0x6c, 0x74, 0x20, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x77,\n\t\t\t0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20,\n\t\t\t0x61, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x22, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x20, 0x73, 0x75, 0x66, 0x66, 0x69,\n\t\t\t0x78, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73,\n\t\t\t0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65,\n\t\t\t0x72, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x62, 0x6c, 0x65, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20,\n\t\t\t0x62, 0x65, 0x63, 0x61, 0x75, 0x73, 0x65, 0x20, 0x77, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x69,\n\t\t\t0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x61, 0x6d, 0x65, 0x20, 0x65,\n\t\t\t0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x74, 0x20, 0x77, 0x61, 0x73, 0x20, 0x69,\n\t\t\t0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x2e, 0x20, 0x42, 0x75, 0x74, 0x20, 0x77, 0x65, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x20, 0x69, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x65, 0x20, 0x77, 0x68,\n\t\t\t0x69, 0x63, 0x68, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6e, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x63, 0x68, 0x65,\n\t\t\t0x6d, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x20,\n\t\t\t0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x75, 0x73, 0x65,\n\t\t\t0x5f, 0x6f, 0x6c, 0x64, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65,\n\t\t\t0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x3d, 0x20, 0x34, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72,\n\t\t\t0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,\n\t\t\t0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45,\n\t\t\t0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72,\n\t\t\t0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f,\n\t\t\t0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x32, 0x30, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f,\n\t\t\t0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32,\n\t\t\t0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x74, 0x72, 0x75, 0x65, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20,\n\t\t\t0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32,\n\t\t\t0x30, 0x32, 0x34, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22, 0x20,\n\t\t\t0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4e, 0x65,\n\t\t\t0x73, 0x74, 0x49, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4e, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x46, 0x69,\n\t\t\t0x6c, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x49,\n\t\t\t0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63,\n\t\t\t0x68, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x6e, 0x65, 0x76, 0x65, 0x72, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x45, 0x53, 0x54, 0x5f, 0x49, 0x4e, 0x5f, 0x46, 0x49,\n\t\t\t0x4c, 0x45, 0x5f, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x44, 0x6f, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6e, 0x65,\n\t\t\t0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x61,\n\t\t\t0x73, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4e, 0x4f, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c,\n\t\t\t0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x59, 0x45, 0x53, 0x20, 0x3d,\n\t\t\t0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x61, 0x6c, 0x6c, 0x20, 0x62, 0x61,\n\t\t\t0x63, 0x6b, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x60, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74,\n\t\t\t0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x60, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20,\n\t\t\t0x55, 0x73, 0x65, 0x72, 0x73, 0x20, 0x77, 0x6f, 0x6e, 0x27, 0x74, 0x20, 0x62, 0x65, 0x20, 0x61, 0x62, 0x6c, 0x65, 0x20,\n\t\t\t0x74, 0x6f, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x74, 0x20, 0x74, 0x68, 0x69, 0x73,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x45, 0x47, 0x41, 0x43,\n\t\t\t0x59, 0x20, 0x3d, 0x20, 0x33, 0x20, 0x5b, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6f,\n\t\t\t0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49,\n\t\t\t0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e,\n\t\t\t0x5f, 0x32, 0x30, 0x32, 0x34, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x31, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x6d, 0x61, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x57, 0x68, 0x65, 0x74, 0x68,\n\t\t\t0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x65,\n\t\t\t0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x20,\n\t\t\t0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x61, 0x70,\n\t\t\t0x70, 0x6c, 0x69, 0x63, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x2a, 0x74, 0x6f, 0x70, 0x2d, 0x6c, 0x65, 0x76,\n\t\t\t0x65, 0x6c, 0x2a, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2c,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x20, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x4e, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x43, 0x6c, 0x61, 0x73,\n\t\t\t0x73, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x4e, 0x65, 0x73, 0x74, 0x49, 0x6e, 0x46, 0x69, 0x6c, 0x65, 0x43,\n\t\t\t0x6c, 0x61, 0x73, 0x73, 0x20, 0x6e, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6c,\n\t\t\t0x61, 0x73, 0x73, 0x20, 0x3d, 0x20, 0x35, 0x20, 0x5b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54,\n\t\t\t0x49, 0x4d, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54,\n\t\t\t0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x2c, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54,\n\t\t\t0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61, 0x72, 0x67,\n\t\t\t0x65, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45,\n\t\t\t0x52, 0x56, 0x49, 0x43, 0x45, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x73,\n\t\t\t0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x3d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x64, 0x3a, 0x20, 0x45, 0x44, 0x49,\n\t\t\t0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d,\n\t\t\t0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f,\n\t\t\t0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x20, 0x22, 0x4c, 0x45, 0x47, 0x41,\n\t\t\t0x43, 0x59, 0x22, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a,\n\t\t\t0x20, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, 0x32, 0x34, 0x2c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x3a, 0x20, 0x22, 0x4e, 0x4f, 0x22, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x20, 0x36, 0x3b, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x60,\n\t\t\t0x6d, 0x75, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x6e, 0x5f, 0x66, 0x69, 0x6c, 0x65,\n\t\t\t0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x60, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/source_context.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61,\n\t\t\t0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61,\n\t\t\t0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d,\n\t\t\t0x20, 0x22, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69,\n\t\t\t0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66,\n\t\t\t0x69, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,\n\t\t\t0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b,\n\t\t\t0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67,\n\t\t\t0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,\n\t\t\t0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x63, 0x6f,\n\t\t\t0x6e, 0x74, 0x65, 0x78, 0x74, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x53, 0x6f, 0x75, 0x72, 0x63,\n\t\t\t0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x60, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73,\n\t\t\t0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x62, 0x6f, 0x75, 0x74, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x20, 0x6c, 0x69, 0x6b, 0x65,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x69,\n\t\t\t0x74, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65,\n\t\t\t0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x64,\n\t\t\t0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x73, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x20, 0x20,\n\t\t\t0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x20, 0x60, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c,\n\t\t\t0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f,\n\t\t\t0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x60, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x6e, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d,\n\t\t\t0x0a,\n\t\t},\n\t\t\"google/protobuf/struct.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x73, 0x74,\n\t\t\t0x72, 0x75, 0x63, 0x74, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61,\n\t\t\t0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,\n\t\t\t0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x20, 0x3d, 0x20, 0x22, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f,\n\t\t\t0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x3d,\n\t\t\t0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x73, 0x68, 0x61, 0x72,\n\t\t\t0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c,\n\t\t\t0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e,\n\t\t\t0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x60,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x64, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x20, 0x63, 0x6f, 0x6e,\n\t\t\t0x73, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x6d, 0x61, 0x70, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69,\n\t\t\t0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x20,\n\t\t\t0x49, 0x6e, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x2c, 0x20, 0x60,\n\t\t\t0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x60, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x62, 0x65, 0x20,\n\t\t\t0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x20, 0x6e, 0x61, 0x74, 0x69, 0x76,\n\t\t\t0x65, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x46, 0x6f,\n\t\t\t0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x20, 0x6c, 0x69, 0x6b,\n\t\t\t0x65, 0x20, 0x4a, 0x53, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x70,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x6f, 0x62,\n\t\t\t0x6a, 0x65, 0x63, 0x74, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x67, 0x65, 0x74,\n\t\t\t0x68, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61,\n\t\t\t0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53,\n\t\t\t0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x60, 0x53, 0x74, 0x72, 0x75, 0x63, 0x74, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x6f,\n\t\t\t0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x53, 0x74, 0x72, 0x75, 0x63,\n\t\t\t0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x6e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x20, 0x6d,\n\t\t\t0x61, 0x70, 0x20, 0x6f, 0x66, 0x20, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x6d, 0x61, 0x70, 0x3c, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3e, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x72,\n\t\t\t0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x61,\n\t\t\t0x6c, 0x6c, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63,\n\t\t\t0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x6e,\n\t\t\t0x75, 0x6c, 0x6c, 0x2c, 0x20, 0x61, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x6e, 0x67, 0x2c, 0x20, 0x61, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x2c, 0x20, 0x61, 0x20, 0x72, 0x65,\n\t\t\t0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x20, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x2c, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x0a, 0x2f, 0x2f, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x73, 0x2e, 0x20, 0x41, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x73, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x73, 0x65, 0x74, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x73, 0x2e, 0x20, 0x41, 0x62, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x6f,\n\t\t\t0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x76, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61,\n\t\t\t0x74, 0x65, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a,\n\t\t\t0x53, 0x4f, 0x4e, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x56,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6b, 0x69, 0x6e, 0x64,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x20, 0x6b,\n\t\t\t0x69, 0x6e, 0x64, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65,\n\t\t\t0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x5f, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x70, 0x72, 0x65,\n\t\t\t0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5f,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65,\n\t\t\t0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x74, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61,\n\t\t\t0x6e, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x62, 0x6f,\n\t\t\t0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,\n\t\t\t0x75, 0x72, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x53, 0x74, 0x72, 0x75,\n\t\t\t0x63, 0x74, 0x20, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x35, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x61,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x60, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x76, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x60,\n\t\t\t0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67,\n\t\t\t0x6c, 0x65, 0x74, 0x6f, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x20,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x56, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x60, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,\n\t\t\t0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75,\n\t\t\t0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x60, 0x6e, 0x75, 0x6c, 0x6c, 0x60, 0x2e, 0x0a, 0x65,\n\t\t\t0x6e, 0x75, 0x6d, 0x20, 0x4e, 0x75, 0x6c, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x4e, 0x75, 0x6c, 0x6c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x4e, 0x55, 0x4c, 0x4c, 0x5f,\n\t\t\t0x56, 0x41, 0x4c, 0x55, 0x45, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x60, 0x4c, 0x69,\n\t\t\t0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65,\n\t\t\t0x72, 0x20, 0x61, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20,\n\t\t\t0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6f, 0x66, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,\n\t\t\t0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75,\n\t\t\t0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x0a, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74, 0x79, 0x70, 0x65, 0x64, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x56, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/timestamp.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62,\n\t\t\t0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x67,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x74, 0x69,\n\t\t\t0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a,\n\t\t\t0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67,\n\t\t\t0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x50, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c,\n\t\t\t0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a,\n\t\t\t0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72,\n\t\t\t0x65, 0x66, 0x69, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20,\n\t\t\t0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65, 0x6c,\n\t\t\t0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20,\n\t\t\t0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73,\n\t\t\t0x20, 0x61, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x69, 0x6e, 0x64,\n\t\t\t0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x74, 0x69, 0x6d, 0x65,\n\t\t\t0x20, 0x7a, 0x6f, 0x6e, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x63, 0x61,\n\t\t\t0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x2c, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61,\n\t\t\t0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x6e,\n\t\t\t0x64, 0x20, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e,\n\t\t\t0x64, 0x73, 0x20, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20,\n\t\t\t0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x75, 0x6e,\n\t\t\t0x74, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x20,\n\t\t\t0x65, 0x70, 0x6f, 0x63, 0x68, 0x20, 0x61, 0x74, 0x20, 0x55, 0x54, 0x43, 0x20, 0x6d, 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68,\n\t\t\t0x74, 0x20, 0x6f, 0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x79, 0x20, 0x31, 0x2c, 0x20, 0x31,\n\t\t\t0x39, 0x37, 0x30, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x6c, 0x65, 0x70, 0x74, 0x69,\n\t\t\t0x63, 0x20, 0x47, 0x72, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72,\n\t\t\t0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x47, 0x72, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x61, 0x6e, 0x20, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72,\n\t\t\t0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x79, 0x65, 0x61, 0x72, 0x20, 0x6f,\n\t\t\t0x6e, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65,\n\t\t\t0x73, 0x20, 0x61, 0x72, 0x65, 0x20, 0x36, 0x30, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x6c, 0x6f, 0x6e,\n\t\t\t0x67, 0x2e, 0x20, 0x4c, 0x65, 0x61, 0x70, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x61, 0x72, 0x65, 0x20,\n\t\t\t0x22, 0x73, 0x6d, 0x65, 0x61, 0x72, 0x65, 0x64, 0x22, 0x20, 0x73, 0x6f, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x6e, 0x6f,\n\t\t\t0x20, 0x6c, 0x65, 0x61, 0x70, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x74, 0x61, 0x62, 0x6c,\n\t\t\t0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x70, 0x72, 0x65, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x20,\n\t\t\t0x5b, 0x32, 0x34, 0x2d, 0x68, 0x6f, 0x75, 0x72, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x73,\n\t\t\t0x6d, 0x65, 0x61, 0x72, 0x5d, 0x28, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65, 0x76, 0x65, 0x6c, 0x6f,\n\t\t\t0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x69, 0x6d, 0x65,\n\t\t\t0x2f, 0x73, 0x6d, 0x65, 0x61, 0x72, 0x29, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x72,\n\t\t\t0x61, 0x6e, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x30, 0x30, 0x30, 0x31, 0x2d, 0x30, 0x31,\n\t\t\t0x2d, 0x30, 0x31, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x20, 0x74, 0x6f, 0x20, 0x39, 0x39, 0x39,\n\t\t\t0x39, 0x2d, 0x31, 0x32, 0x2d, 0x33, 0x31, 0x54, 0x32, 0x33, 0x3a, 0x35, 0x39, 0x3a, 0x35, 0x39, 0x2e, 0x39, 0x39, 0x39,\n\t\t\t0x39, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5a, 0x2e, 0x20, 0x42, 0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x72, 0x65, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x63, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65,\n\t\t\t0x2c, 0x20, 0x77, 0x65, 0x20, 0x65, 0x6e, 0x73, 0x75, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x77, 0x65, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x66,\n\t\t\t0x72, 0x6f, 0x6d, 0x20, 0x5b, 0x52, 0x46, 0x43, 0x0a, 0x2f, 0x2f, 0x20, 0x33, 0x33, 0x33, 0x39, 0x5d, 0x28, 0x68, 0x74,\n\t\t\t0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x65, 0x74, 0x66, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x72,\n\t\t\t0x66, 0x63, 0x2f, 0x72, 0x66, 0x63, 0x33, 0x33, 0x33, 0x39, 0x2e, 0x74, 0x78, 0x74, 0x29, 0x20, 0x64, 0x61, 0x74, 0x65,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x45, 0x78,\n\t\t\t0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,\n\t\t\t0x20, 0x31, 0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,\n\t\t\t0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x50, 0x4f, 0x53, 0x49, 0x58, 0x20, 0x60, 0x74, 0x69, 0x6d, 0x65, 0x28, 0x29,\n\t\t\t0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,\n\t\t\t0x6d, 0x70, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e,\n\t\t\t0x64, 0x73, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x28, 0x4e, 0x55, 0x4c, 0x4c, 0x29, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x73, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6e,\n\t\t\t0x6f, 0x73, 0x28, 0x30, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,\n\t\t\t0x20, 0x32, 0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,\n\t\t\t0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x50, 0x4f, 0x53, 0x49, 0x58, 0x20, 0x60, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6d,\n\t\t\t0x65, 0x6f, 0x66, 0x64, 0x61, 0x79, 0x28, 0x29, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x76, 0x61, 0x6c, 0x20, 0x74, 0x76, 0x3b, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x65, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x66, 0x64, 0x61, 0x79, 0x28,\n\t\t\t0x26, 0x74, 0x76, 0x2c, 0x20, 0x4e, 0x55, 0x4c, 0x4c, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,\n\t\t\t0x70, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e,\n\t\t\t0x73, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x74, 0x76, 0x2e, 0x74, 0x76, 0x5f, 0x73, 0x65,\n\t\t\t0x63, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,\n\t\t\t0x2e, 0x73, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x28, 0x74, 0x76, 0x2e, 0x74, 0x76, 0x5f, 0x75, 0x73, 0x65,\n\t\t\t0x63, 0x20, 0x2a, 0x20, 0x31, 0x30, 0x30, 0x30, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61,\n\t\t\t0x6d, 0x70, 0x6c, 0x65, 0x20, 0x33, 0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65,\n\t\t\t0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x57, 0x69, 0x6e, 0x33, 0x32, 0x20, 0x60, 0x47, 0x65,\n\t\t\t0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x41, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x69, 0x6d,\n\t\t\t0x65, 0x28, 0x29, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x46, 0x49, 0x4c, 0x45,\n\t\t\t0x54, 0x49, 0x4d, 0x45, 0x20, 0x66, 0x74, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x47, 0x65, 0x74, 0x53,\n\t\t\t0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x41, 0x73, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x28,\n\t\t\t0x26, 0x66, 0x74, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x20,\n\t\t\t0x74, 0x69, 0x63, 0x6b, 0x73, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x28, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x29, 0x66, 0x74,\n\t\t\t0x2e, 0x64, 0x77, 0x48, 0x69, 0x67, 0x68, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x29, 0x20, 0x3c, 0x3c, 0x20,\n\t\t\t0x33, 0x32, 0x29, 0x20, 0x7c, 0x20, 0x66, 0x74, 0x2e, 0x64, 0x77, 0x4c, 0x6f, 0x77, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69,\n\t\t\t0x6d, 0x65, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x57,\n\t\t\t0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x20, 0x74, 0x69, 0x63, 0x6b, 0x20, 0x69, 0x73, 0x20, 0x31, 0x30, 0x30, 0x20, 0x6e,\n\t\t\t0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2e, 0x20, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x20,\n\t\t\t0x65, 0x70, 0x6f, 0x63, 0x68, 0x20, 0x31, 0x36, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x54, 0x30, 0x30, 0x3a,\n\t\t\t0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x31, 0x31, 0x36, 0x34, 0x34, 0x34, 0x37, 0x33, 0x36, 0x30, 0x30, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20,\n\t\t\t0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x78, 0x20, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x20, 0x31, 0x39,\n\t\t\t0x37, 0x30, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x2e, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x74, 0x69, 0x6d,\n\t\t\t0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73,\n\t\t\t0x74, 0x61, 0x6d, 0x70, 0x2e, 0x73, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x28, 0x49, 0x4e,\n\t\t\t0x54, 0x36, 0x34, 0x29, 0x20, 0x28, 0x28, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x20, 0x2f, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30,\n\t\t\t0x30, 0x30, 0x30, 0x29, 0x20, 0x2d, 0x20, 0x31, 0x31, 0x36, 0x34, 0x34, 0x34, 0x37, 0x33, 0x36, 0x30, 0x30, 0x4c, 0x4c,\n\t\t\t0x29, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,\n\t\t\t0x2e, 0x73, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x28, 0x28, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x29, 0x20, 0x28,\n\t\t\t0x28, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x20, 0x25, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x29, 0x20, 0x2a,\n\t\t\t0x20, 0x31, 0x30, 0x30, 0x29, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,\n\t\t\t0x65, 0x20, 0x34, 0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,\n\t\t\t0x6d, 0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x20, 0x60, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,\n\t\t\t0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x28, 0x29,\n\t\t\t0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x6f, 0x6e, 0x67, 0x20, 0x6d, 0x69,\n\t\t\t0x6c, 0x6c, 0x69, 0x73, 0x20, 0x3d, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,\n\t\t\t0x74, 0x54, 0x69, 0x6d, 0x65, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x28, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73,\n\t\t\t0x74, 0x61, 0x6d, 0x70, 0x20, 0x3d, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x6e, 0x65, 0x77,\n\t\t\t0x42, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,\n\t\t\t0x28, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x20, 0x2f, 0x20, 0x31, 0x30, 0x30, 0x30, 0x29, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x28, 0x28, 0x69, 0x6e,\n\t\t\t0x74, 0x29, 0x20, 0x28, 0x28, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x20, 0x25, 0x20, 0x31, 0x30, 0x30, 0x30, 0x29, 0x20,\n\t\t\t0x2a, 0x20, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x29, 0x29, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x28, 0x29, 0x3b,\n\t\t\t0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x35, 0x3a, 0x20, 0x43, 0x6f,\n\t\t\t0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d,\n\t\t\t0x20, 0x4a, 0x61, 0x76, 0x61, 0x20, 0x60, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x6e, 0x6f, 0x77, 0x28, 0x29,\n\t\t\t0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74,\n\t\t\t0x20, 0x6e, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x2e, 0x6e, 0x6f, 0x77, 0x28, 0x29,\n\t\t\t0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,\n\t\t\t0x70, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x3d, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x6e, 0x65, 0x77, 0x42, 0x75,\n\t\t\t0x69, 0x6c, 0x64, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x6e,\n\t\t\t0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x28, 0x29, 0x29,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2e, 0x73, 0x65, 0x74,\n\t\t\t0x4e, 0x61, 0x6e, 0x6f, 0x73, 0x28, 0x6e, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6e, 0x6f, 0x28, 0x29, 0x29,\n\t\t\t0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x28, 0x29, 0x3b, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x78, 0x61, 0x6d,\n\t\t\t0x70, 0x6c, 0x65, 0x20, 0x36, 0x3a, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73,\n\t\t\t0x74, 0x61, 0x6d, 0x70, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x69,\n\t\t\t0x6d, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x3d, 0x20, 0x54, 0x69, 0x6d, 0x65,\n\t\t\t0x73, 0x74, 0x61, 0x6d, 0x70, 0x28, 0x29, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73,\n\t\t\t0x74, 0x61, 0x6d, 0x70, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28,\n\t\t\t0x29, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x23, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x4d, 0x61, 0x70, 0x70, 0x69,\n\t\t\t0x6e, 0x67, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x66, 0x6f, 0x72,\n\t\t\t0x6d, 0x61, 0x74, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x74,\n\t\t\t0x79, 0x70, 0x65, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x5b, 0x52, 0x46,\n\t\t\t0x43, 0x20, 0x33, 0x33, 0x33, 0x39, 0x5d, 0x28, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e,\n\t\t\t0x69, 0x65, 0x74, 0x66, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x72, 0x66, 0x63, 0x2f, 0x72, 0x66, 0x63, 0x33, 0x33, 0x33, 0x39,\n\t\t\t0x2e, 0x74, 0x78, 0x74, 0x29, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x20, 0x54, 0x68, 0x61, 0x74, 0x20, 0x69,\n\t\t\t0x73, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x22, 0x7b, 0x79, 0x65, 0x61, 0x72, 0x7d, 0x2d, 0x7b, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x7d, 0x2d, 0x7b, 0x64, 0x61, 0x79,\n\t\t\t0x7d, 0x54, 0x7b, 0x68, 0x6f, 0x75, 0x72, 0x7d, 0x3a, 0x7b, 0x6d, 0x69, 0x6e, 0x7d, 0x3a, 0x7b, 0x73, 0x65, 0x63, 0x7d,\n\t\t\t0x5b, 0x2e, 0x7b, 0x66, 0x72, 0x61, 0x63, 0x5f, 0x73, 0x65, 0x63, 0x7d, 0x5d, 0x5a, 0x22, 0x0a, 0x2f, 0x2f, 0x20, 0x77,\n\t\t\t0x68, 0x65, 0x72, 0x65, 0x20, 0x7b, 0x79, 0x65, 0x61, 0x72, 0x7d, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79,\n\t\t\t0x73, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x6f,\n\t\t\t0x75, 0x72, 0x20, 0x64, 0x69, 0x67, 0x69, 0x74, 0x73, 0x20, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x7b, 0x6d, 0x6f, 0x6e,\n\t\t\t0x74, 0x68, 0x7d, 0x2c, 0x20, 0x7b, 0x64, 0x61, 0x79, 0x7d, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x7b, 0x68, 0x6f, 0x75, 0x72,\n\t\t\t0x7d, 0x2c, 0x20, 0x7b, 0x6d, 0x69, 0x6e, 0x7d, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x7b, 0x73, 0x65, 0x63, 0x7d, 0x20,\n\t\t\t0x61, 0x72, 0x65, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x2d, 0x70, 0x61, 0x64, 0x64, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x74,\n\t\t\t0x77, 0x6f, 0x20, 0x64, 0x69, 0x67, 0x69, 0x74, 0x73, 0x20, 0x65, 0x61, 0x63, 0x68, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,\n\t\t\t0x73, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x67, 0x6f, 0x20, 0x75, 0x70, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x39, 0x20, 0x64, 0x69, 0x67, 0x69, 0x74, 0x73, 0x20, 0x28, 0x69, 0x2e, 0x65, 0x2e, 0x20, 0x75, 0x70, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x31, 0x20, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x73, 0x6f,\n\t\t\t0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x61, 0x6c, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x22, 0x5a, 0x22, 0x20, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78,\n\t\t\t0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x7a,\n\t\t\t0x6f, 0x6e, 0x65, 0x20, 0x28, 0x22, 0x55, 0x54, 0x43, 0x22, 0x29, 0x3b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x69, 0x6d,\n\t\t\t0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64,\n\t\t\t0x2e, 0x20, 0x41, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x73, 0x65, 0x72, 0x69,\n\t\t\t0x61, 0x6c, 0x69, 0x7a, 0x65, 0x72, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x20, 0x55, 0x54, 0x43, 0x20, 0x28, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x5a, 0x22, 0x29, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x70,\n\t\t\t0x72, 0x69, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,\n\t\t\t0x70, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20,\n\t\t\t0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62,\n\t\t\t0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x20,\n\t\t\t0x62, 0x6f, 0x74, 0x68, 0x20, 0x55, 0x54, 0x43, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74,\n\t\t\t0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x73, 0x20, 0x28, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63, 0x61, 0x74,\n\t\t\t0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x29, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x22, 0x32, 0x30,\n\t\t\t0x31, 0x37, 0x2d, 0x30, 0x31, 0x2d, 0x31, 0x35, 0x54, 0x30, 0x31, 0x3a, 0x33, 0x30, 0x3a, 0x31, 0x35, 0x2e, 0x30, 0x31,\n\t\t\t0x5a, 0x22, 0x20, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x20, 0x31, 0x35, 0x2e, 0x30, 0x31, 0x20, 0x73, 0x65, 0x63,\n\t\t\t0x6f, 0x6e, 0x64, 0x73, 0x20, 0x70, 0x61, 0x73, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x30, 0x31, 0x3a, 0x33, 0x30, 0x20, 0x55,\n\t\t\t0x54, 0x43, 0x20, 0x6f, 0x6e, 0x20, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x79, 0x20, 0x31, 0x35, 0x2c, 0x20, 0x32, 0x30,\n\t\t\t0x31, 0x37, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x49, 0x6e, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x53, 0x63, 0x72,\n\t\t\t0x69, 0x70, 0x74, 0x2c, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74,\n\t\t\t0x20, 0x61, 0x20, 0x44, 0x61, 0x74, 0x65, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x5b, 0x74, 0x6f, 0x49, 0x53,\n\t\t\t0x4f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x5d, 0x28, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64,\n\t\t\t0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x2e, 0x6d, 0x6f, 0x7a, 0x69, 0x6c, 0x6c, 0x61, 0x2e, 0x6f, 0x72, 0x67,\n\t\t\t0x2f, 0x65, 0x6e, 0x2d, 0x55, 0x53, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x57, 0x65, 0x62, 0x2f, 0x4a, 0x61, 0x76, 0x61,\n\t\t\t0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2f, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2f, 0x47, 0x6c, 0x6f,\n\t\t\t0x62, 0x61, 0x6c, 0x5f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x44, 0x61, 0x74, 0x65, 0x2f, 0x74, 0x6f, 0x49,\n\t\t\t0x53, 0x4f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e,\n\t\t\t0x20, 0x49, 0x6e, 0x20, 0x50, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61,\n\t\t\t0x72, 0x64, 0x20, 0x60, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,\n\t\t\t0x65, 0x60, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x63, 0x6f, 0x6e,\n\t\t\t0x76, 0x65, 0x72, 0x74, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x6d, 0x61, 0x74, 0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x0a, 0x2f, 0x2f, 0x20, 0x5b, 0x60, 0x73, 0x74, 0x72, 0x66,\n\t\t\t0x74, 0x69, 0x6d, 0x65, 0x60, 0x5d, 0x28, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2e,\n\t\t\t0x70, 0x79, 0x74, 0x68, 0x6f, 0x6e, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x32, 0x2f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79,\n\t\t\t0x2f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x23, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x66,\n\t\t\t0x74, 0x69, 0x6d, 0x65, 0x29, 0x20, 0x77, 0x69, 0x74, 0x68, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x69,\n\t\t\t0x6d, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x20, 0x27, 0x25, 0x59, 0x2d, 0x25,\n\t\t\t0x6d, 0x2d, 0x25, 0x64, 0x54, 0x25, 0x48, 0x3a, 0x25, 0x4d, 0x3a, 0x25, 0x53, 0x2e, 0x25, 0x66, 0x5a, 0x27, 0x2e, 0x20,\n\t\t\t0x4c, 0x69, 0x6b, 0x65, 0x77, 0x69, 0x73, 0x65, 0x2c, 0x20, 0x69, 0x6e, 0x20, 0x4a, 0x61, 0x76, 0x61, 0x2c, 0x20, 0x6f,\n\t\t\t0x6e, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x75, 0x73, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4a, 0x6f,\n\t\t\t0x64, 0x61, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x27, 0x73, 0x20, 0x5b, 0x60, 0x49, 0x53, 0x4f, 0x44, 0x61, 0x74, 0x65, 0x54,\n\t\t\t0x69, 0x6d, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29,\n\t\t\t0x60, 0x5d, 0x28, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6a, 0x6f, 0x64, 0x61, 0x2d, 0x74,\n\t\t\t0x69, 0x6d, 0x65, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x66, 0x6f, 0x72, 0x67, 0x65, 0x2e, 0x6e, 0x65, 0x74, 0x2f,\n\t\t\t0x61, 0x70, 0x69, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x6f, 0x72, 0x67, 0x2f, 0x6a, 0x6f, 0x64, 0x61, 0x2f, 0x74, 0x69, 0x6d,\n\t\t\t0x65, 0x2f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2f, 0x49, 0x53, 0x4f, 0x44, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,\n\t\t\t0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x23, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,\n\t\t\t0x28, 0x29, 0x0a, 0x2f, 0x2f, 0x20, 0x29, 0x20, 0x74, 0x6f, 0x20, 0x6f, 0x62, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x61, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x20, 0x63, 0x61, 0x70, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,\n\t\t\t0x70, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x20,\n\t\t\t0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x73, 0x65,\n\t\t\t0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x55, 0x54, 0x43, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x20, 0x73, 0x69,\n\t\t\t0x6e, 0x63, 0x65, 0x20, 0x55, 0x6e, 0x69, 0x78, 0x20, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x20, 0x31, 0x39, 0x37, 0x30, 0x2d,\n\t\t\t0x30, 0x31, 0x2d, 0x30, 0x31, 0x54, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x2e, 0x20, 0x4d, 0x75, 0x73,\n\t\t\t0x74, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x62, 0x65, 0x20, 0x62, 0x65, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x20, 0x2d, 0x33,\n\t\t\t0x31, 0x35, 0x35, 0x37, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x33, 0x31, 0x35, 0x35,\n\t\t\t0x37, 0x36, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x20, 0x28,\n\t\t\t0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x74, 0x6f,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x30, 0x30, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x2d, 0x30, 0x31, 0x54, 0x30, 0x30, 0x3a,\n\t\t\t0x30, 0x30, 0x3a, 0x30, 0x30, 0x5a, 0x20, 0x74, 0x6f, 0x20, 0x39, 0x39, 0x39, 0x39, 0x2d, 0x31, 0x32, 0x2d, 0x33, 0x31,\n\t\t\t0x54, 0x32, 0x33, 0x3a, 0x35, 0x39, 0x3a, 0x35, 0x39, 0x5a, 0x29, 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x36, 0x34,\n\t\t\t0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x4e, 0x6f, 0x6e, 0x2d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x74, 0x20, 0x6e, 0x61,\n\t\t\t0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e,\n\t\t\t0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x70, 0x6f, 0x72, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74,\n\t\t\t0x6f, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x67, 0x61,\n\t\t\t0x74, 0x69, 0x76, 0x65, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x20, 0x77,\n\t\t\t0x69, 0x74, 0x68, 0x20, 0x66, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x73,\n\t\t\t0x74, 0x69, 0x6c, 0x6c, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69,\n\t\t\t0x76, 0x65, 0x20, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,\n\t\t\t0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x20,\n\t\t\t0x69, 0x6e, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x20, 0x4d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x62, 0x65, 0x74,\n\t\t\t0x77, 0x65, 0x65, 0x6e, 0x20, 0x30, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x39, 0x39, 0x39, 0x2c, 0x39, 0x39, 0x39, 0x2c, 0x39,\n\t\t\t0x39, 0x39, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x76, 0x65, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6e, 0x61, 0x6e, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/type.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x0a,\n\t\t\t0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22, 0x3b, 0x0a, 0x0a,\n\t\t\t0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,\n\t\t\t0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,\n\t\t\t0x3b, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,\n\t\t\t0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,\n\t\t\t0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x5f,\n\t\t\t0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65,\n\t\t\t0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f,\n\t\t\t0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x54, 0x79,\n\t\t\t0x70, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76,\n\t\t\t0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74,\n\t\t\t0x72, 0x75, 0x65, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61,\n\t\t\t0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,\n\t\t\t0x63, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,\n\t\t\t0x66, 0x2e, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22,\n\t\t\t0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x74,\n\t\t\t0x79, 0x70, 0x65, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63,\n\t\t\t0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20,\n\t\t\t0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x44, 0x65,\n\t\t\t0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x0a, 0x2f, 0x2f, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65,\n\t\t\t0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73,\n\t\t\t0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x70, 0x72, 0x65,\n\t\t\t0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f,\n\t\t\t0x64, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x20, 0x49,\n\t\t\t0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x20,\n\t\t\t0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x54, 0x79, 0x70, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69,\n\t\t\t0x65, 0x64, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x73,\n\t\t\t0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x66, 0x69,\n\t\t\t0x65, 0x6c, 0x64, 0x73, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6c,\n\t\t\t0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x20, 0x61, 0x70, 0x70, 0x65, 0x61, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x60, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x60, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e,\n\t\t\t0x65, 0x6f, 0x66, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x73, 0x6f, 0x75, 0x72,\n\t\t\t0x63, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x36, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x65, 0x64, 0x69,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x76, 0x61,\n\t\t\t0x6c, 0x69, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x69, 0x73, 0x20, 0x53,\n\t\t\t0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6f,\n\t\t\t0x66, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74,\n\t\t\t0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73,\n\t\t\t0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64,\n\t\t\t0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20,\n\t\t\t0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x70, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x64,\n\t\t\t0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x20, 0x49, 0x6e,\n\t\t\t0x73, 0x74, 0x65, 0x61, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66,\n\t\t\t0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x20, 0x77,\n\t\t\t0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e,\n\t\t\t0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x7b, 0x0a, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x42, 0x61, 0x73, 0x69, 0x63, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77,\n\t\t\t0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x20,\n\t\t\t0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f,\n\t\t\t0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x36, 0x34,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x33,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20,\n\t\t\t0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e,\n\t\t\t0x54, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59,\n\t\t\t0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x20, 0x3d, 0x20,\n\t\t\t0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65,\n\t\t\t0x20, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46,\n\t\t\t0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x20, 0x3d, 0x20, 0x39,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20,\n\t\t\t0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78,\n\t\t\t0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65,\n\t\t\t0x64, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f,\n\t\t\t0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x20, 0x3d, 0x20, 0x31, 0x32, 0x3b, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x75, 0x69,\n\t\t\t0x6e, 0x74, 0x33, 0x32, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x33,\n\t\t\t0x32, 0x20, 0x3d, 0x20, 0x31, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45,\n\t\t\t0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x20, 0x3d, 0x20, 0x31, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x33, 0x32, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x20, 0x73, 0x66, 0x69, 0x78, 0x65, 0x64, 0x36, 0x34, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45,\n\t\t\t0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x73, 0x69, 0x6e, 0x74, 0x33, 0x32,\n\t\t\t0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x20, 0x73, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53,\n\t\t\t0x49, 0x4e, 0x54, 0x36, 0x34, 0x20, 0x3d, 0x20, 0x31, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x57, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x61, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x2c, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2c,\n\t\t\t0x20, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x75, 0x6d,\n\t\t\t0x20, 0x43, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x75, 0x6e,\n\t\t\t0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x43, 0x41, 0x52, 0x44, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f,\n\t\t\t0x57, 0x4e, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x43, 0x41, 0x52, 0x44, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c,\n\t\t\t0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x71,\n\t\t\t0x75, 0x69, 0x72, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x32,\n\t\t\t0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x43, 0x41,\n\t\t\t0x52, 0x44, 0x49, 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x20, 0x3d,\n\t\t\t0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61,\n\t\t\t0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x43, 0x41, 0x52, 0x44,\n\t\t\t0x49, 0x4e, 0x41, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, 0x44, 0x20, 0x3d, 0x20, 0x33,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x4b, 0x69, 0x6e, 0x64, 0x20, 0x6b, 0x69, 0x6e, 0x64, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20,\n\t\t\t0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x43, 0x61, 0x72, 0x64, 0x69,\n\t\t\t0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x3d,\n\t\t\t0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x6e,\n\t\t\t0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65,\n\t\t\t0x72, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d,\n\t\t\t0x65, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x55, 0x52, 0x4c, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x20,\n\t\t\t0x60, 0x22, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f,\n\t\t\t0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,\n\t\t\t0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x60, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20,\n\t\t\t0x74, 0x79, 0x70, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c,\n\t\t\t0x64, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x60, 0x54, 0x79, 0x70, 0x65, 0x2e, 0x6f, 0x6e, 0x65, 0x6f,\n\t\t\t0x66, 0x73, 0x60, 0x2c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x6f, 0x72, 0x20,\n\t\t\t0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74, 0x79, 0x70,\n\t\t\t0x65, 0x73, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x68,\n\t\t\t0x61, 0x73, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x31, 0x3b, 0x20, 0x7a, 0x65, 0x72, 0x6f, 0x20, 0x6d, 0x65, 0x61,\n\t\t\t0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69,\n\t\t\t0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20,\n\t\t\t0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x3d, 0x20, 0x37, 0x3b, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x57, 0x68, 0x65, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x61, 0x6c, 0x74,\n\t\t\t0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x77, 0x69, 0x72, 0x65,\n\t\t\t0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x20, 0x20, 0x62,\n\t\t\t0x6f, 0x6f, 0x6c, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x3d, 0x20, 0x38, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64,\n\t\t\t0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x39, 0x3b,\n\t\t\t0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x4a, 0x53, 0x4f, 0x4e,\n\t\t\t0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6a, 0x73, 0x6f, 0x6e,\n\t\t\t0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65,\n\t\t\t0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68,\n\t\t\t0x69, 0x73, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2e, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x20, 0x73, 0x79, 0x6e,\n\t\t\t0x74, 0x61, 0x78, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x64,\n\t\t\t0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x31, 0x3b, 0x0a, 0x7d,\n\t\t\t0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x75, 0x73, 0x61,\n\t\t\t0x67, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x6f,\n\t\t\t0x20, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x64, 0x69, 0x73,\n\t\t\t0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61,\n\t\t\t0x67, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x62, 0x69, 0x6c,\n\t\t\t0x69, 0x74, 0x79, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72,\n\t\t\t0x79, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d,\n\t\t\t0x61, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x73, 0x65, 0x6d, 0x61, 0x6e,\n\t\t\t0x74, 0x69, 0x63, 0x73, 0x2e, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x61, 0x6b,\n\t\t\t0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,\n\t\t\t0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76,\n\t\t\t0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x69, 0x6e, 0x66,\n\t\t\t0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x6e,\n\t\t\t0x75, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20,\n\t\t\t0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65,\n\t\t\t0x61, 0x74, 0x65, 0x64, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20,\n\t\t\t0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x0a, 0x20, 0x20, 0x53, 0x6f,\n\t\t\t0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x20, 0x3d, 0x20, 0x34, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x0a, 0x20, 0x20, 0x53, 0x79,\n\t\t\t0x6e, 0x74, 0x61, 0x78, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20,\n\t\t\t0x77, 0x68, 0x65, 0x6e, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x69, 0x73, 0x20, 0x53, 0x59, 0x4e, 0x54, 0x41,\n\t\t\t0x58, 0x5f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x36, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x45, 0x6e, 0x75, 0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x65, 0x77, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x61,\n\t\t\t0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x45, 0x6e, 0x75,\n\t\t\t0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74,\n\t\t\t0x6f, 0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x64, 0x69,\n\t\t\t0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x62, 0x69,\n\t\t\t0x6c, 0x69, 0x74, 0x79, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x61, 0x6c, 0x6c, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61,\n\t\t\t0x72, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x63, 0x68, 0x65,\n\t\t\t0x6d, 0x61, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x20, 0x73, 0x65, 0x6d, 0x61,\n\t\t\t0x6e, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x61,\n\t\t\t0x6b, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69,\n\t\t\t0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72,\n\t\t\t0x76, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x65, 0x63, 0x65, 0x73, 0x73, 0x61, 0x72, 0x79, 0x20, 0x69, 0x6e,\n\t\t\t0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45,\n\t\t\t0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x75, 0x6d,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e,\n\t\t\t0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x45, 0x6e, 0x75,\n\t\t\t0x6d, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e,\n\t\t\t0x74, 0x33, 0x32, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f,\n\t\t\t0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x6f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x33, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a,\n\t\t\t0x2f, 0x2f, 0x20, 0x41, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72,\n\t\t\t0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x2c, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x65,\n\t\t\t0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x65, 0x74, 0x63, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e,\n\t\t\t0x65, 0x77, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x61, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74,\n\t\t\t0x69, 0x76, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20,\n\t\t\t0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x46,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74,\n\t\t\t0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x2c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x61, 0x72, 0x65, 0x20, 0x73, 0x74, 0x72, 0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72,\n\t\t\t0x61, 0x67, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x27, 0x73,\n\t\t\t0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x20,\n\t\t\t0x62, 0x75, 0x69, 0x6c, 0x74, 0x2d, 0x69, 0x6e, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x28, 0x6f, 0x70,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x29, 0x2c,\n\t\t\t0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x20, 0x6e,\n\t\t\t0x61, 0x6d, 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x60, 0x22,\n\t\t\t0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, 0x60, 0x2e, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x46, 0x6f,\n\t\t\t0x72, 0x20, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x69, 0x74,\n\t\t\t0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79,\n\t\t\t0x2d, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x20, 0x46, 0x6f, 0x72,\n\t\t\t0x20, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x60, 0x22, 0x67, 0x6f, 0x6f,\n\t\t\t0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x22, 0x60, 0x2e, 0x0a, 0x20, 0x20, 0x73, 0x74,\n\t\t\t0x72, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20,\n\t\t\t0x54, 0x68, 0x65, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x27, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x70,\n\t\t\t0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x6e, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x61, 0x20, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x72, 0x61,\n\t\t\t0x70, 0x70, 0x65, 0x72, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61,\n\t\t\t0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x73, 0x68, 0x6f,\n\t\t\t0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6e, 0x75, 0x6d, 0x2c, 0x20, 0x69, 0x74,\n\t\t\t0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x64, 0x20, 0x61, 0x73,\n\t\t\t0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x20, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x74, 0x79,\n\t\t\t0x70, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x41, 0x6e, 0x79, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x32, 0x3b,\n\t\t\t0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x62, 0x75,\n\t\t\t0x66, 0x66, 0x65, 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69,\n\t\t\t0x6e, 0x65, 0x64, 0x2e, 0x0a, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x7b, 0x0a, 0x20,\n\t\t\t0x20, 0x2f, 0x2f, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x60, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x60, 0x2e,\n\t\t\t0x0a, 0x20, 0x20, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x20, 0x3d, 0x20, 0x30,\n\t\t\t0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x60, 0x70, 0x72, 0x6f, 0x74, 0x6f,\n\t\t\t0x33, 0x60, 0x2e, 0x0a, 0x20, 0x20, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x60, 0x65, 0x64,\n\t\t\t0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x60, 0x2e, 0x0a, 0x20, 0x20, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, 0x44,\n\t\t\t0x49, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x20, 0x3d, 0x20, 0x32, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t\t\"google/protobuf/wrappers.proto\": {\n\t\t\t0x2f, 0x2f, 0x20, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x20, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x20,\n\t\t\t0x2d, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x27, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x6e, 0x74, 0x65,\n\t\t\t0x72, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x43, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20,\n\t\t\t0x49, 0x6e, 0x63, 0x2e, 0x20, 0x20, 0x41, 0x6c, 0x6c, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x73, 0x20, 0x72, 0x65, 0x73,\n\t\t\t0x65, 0x72, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x64, 0x65,\n\t\t\t0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2d, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61,\n\t\t\t0x6e, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20,\n\t\t\t0x6f, 0x72, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x61, 0x72, 0x65, 0x20, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x74, 0x65,\n\t\t\t0x64, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x61, 0x72, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x74, 0x3a, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x20,\n\t\t\t0x20, 0x20, 0x20, 0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73,\n\t\t\t0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74,\n\t\t\t0x20, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x20, 0x63, 0x6f,\n\t\t\t0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x0a, 0x2f, 0x2f, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x2a, 0x20, 0x52, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x63, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x2c, 0x20, 0x74,\n\t\t\t0x68, 0x69, 0x73, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67,\n\t\t\t0x20, 0x64, 0x69, 0x73, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,\n\t\t\t0x65, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x2f,\n\t\t\t0x6f, 0x72, 0x20, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x73, 0x20, 0x70,\n\t\t\t0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x65, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20,\n\t\t\t0x20, 0x2a, 0x20, 0x4e, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20,\n\t\t\t0x6f, 0x66, 0x20, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x6e, 0x6f, 0x72, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x73, 0x0a, 0x2f, 0x2f, 0x20, 0x63,\n\t\t\t0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74,\n\t\t\t0x77, 0x61, 0x72, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69,\n\t\t\t0x63, 0x20, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x20, 0x70, 0x65, 0x72, 0x6d,\n\t\t\t0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53,\n\t\t\t0x4f, 0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x20, 0x49, 0x53, 0x20, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x44, 0x20,\n\t\t\t0x42, 0x59, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x20, 0x48, 0x4f, 0x4c,\n\t\t\t0x44, 0x45, 0x52, 0x53, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52,\n\t\t\t0x53, 0x0a, 0x2f, 0x2f, 0x20, 0x22, 0x41, 0x53, 0x20, 0x49, 0x53, 0x22, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x41, 0x4e, 0x59,\n\t\t\t0x20, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20,\n\t\t\t0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x2c, 0x20, 0x49, 0x4e, 0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e,\n\t\t\t0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45,\n\t\t\t0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x45, 0x44, 0x20, 0x57, 0x41,\n\t\t\t0x52, 0x52, 0x41, 0x4e, 0x54, 0x49, 0x45, 0x53, 0x20, 0x4f, 0x46, 0x20, 0x4d, 0x45, 0x52, 0x43, 0x48, 0x41, 0x4e, 0x54,\n\t\t\t0x41, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x46, 0x49, 0x54, 0x4e, 0x45, 0x53, 0x53, 0x20,\n\t\t\t0x46, 0x4f, 0x52, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x50, 0x41, 0x52, 0x54, 0x49, 0x43, 0x55, 0x4c, 0x41, 0x52, 0x20,\n\t\t\t0x50, 0x55, 0x52, 0x50, 0x4f, 0x53, 0x45, 0x20, 0x41, 0x52, 0x45, 0x20, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x41, 0x49, 0x4d,\n\t\t\t0x45, 0x44, 0x2e, 0x20, 0x49, 0x4e, 0x20, 0x4e, 0x4f, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x20, 0x53, 0x48, 0x41, 0x4c,\n\t\t\t0x4c, 0x20, 0x54, 0x48, 0x45, 0x20, 0x43, 0x4f, 0x50, 0x59, 0x52, 0x49, 0x47, 0x48, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x4f,\n\t\t\t0x57, 0x4e, 0x45, 0x52, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x4f, 0x52, 0x53,\n\t\t\t0x20, 0x42, 0x45, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x20, 0x46, 0x4f, 0x52, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x44,\n\t\t\t0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x2c, 0x20, 0x49, 0x4e, 0x43,\n\t\t\t0x49, 0x44, 0x45, 0x4e, 0x54, 0x41, 0x4c, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x53, 0x50, 0x45, 0x43, 0x49, 0x41, 0x4c, 0x2c,\n\t\t\t0x20, 0x45, 0x58, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x52, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x43, 0x4f, 0x4e, 0x53, 0x45,\n\t\t\t0x51, 0x55, 0x45, 0x4e, 0x54, 0x49, 0x41, 0x4c, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x53, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x2c, 0x20, 0x42, 0x55, 0x54, 0x20, 0x4e, 0x4f, 0x54, 0x0a, 0x2f, 0x2f, 0x20,\n\t\t\t0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x20, 0x54, 0x4f, 0x2c, 0x20, 0x50, 0x52, 0x4f, 0x43, 0x55, 0x52, 0x45, 0x4d,\n\t\t\t0x45, 0x4e, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x42, 0x53, 0x54, 0x49, 0x54, 0x55, 0x54, 0x45, 0x20, 0x47, 0x4f,\n\t\t\t0x4f, 0x44, 0x53, 0x20, 0x4f, 0x52, 0x20, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x3b, 0x20, 0x4c, 0x4f, 0x53,\n\t\t\t0x53, 0x20, 0x4f, 0x46, 0x20, 0x55, 0x53, 0x45, 0x2c, 0x0a, 0x2f, 0x2f, 0x20, 0x44, 0x41, 0x54, 0x41, 0x2c, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x50, 0x52, 0x4f, 0x46, 0x49, 0x54, 0x53, 0x3b, 0x20, 0x4f, 0x52, 0x20, 0x42, 0x55, 0x53, 0x49, 0x4e, 0x45,\n\t\t\t0x53, 0x53, 0x20, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x29, 0x20, 0x48, 0x4f, 0x57,\n\t\t\t0x45, 0x56, 0x45, 0x52, 0x20, 0x43, 0x41, 0x55, 0x53, 0x45, 0x44, 0x20, 0x41, 0x4e, 0x44, 0x20, 0x4f, 0x4e, 0x20, 0x41,\n\t\t\t0x4e, 0x59, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x48, 0x45, 0x4f, 0x52, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x4c, 0x49, 0x41, 0x42,\n\t\t\t0x49, 0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x57, 0x48, 0x45, 0x54, 0x48, 0x45, 0x52, 0x20, 0x49, 0x4e, 0x20, 0x43, 0x4f,\n\t\t\t0x4e, 0x54, 0x52, 0x41, 0x43, 0x54, 0x2c, 0x20, 0x53, 0x54, 0x52, 0x49, 0x43, 0x54, 0x20, 0x4c, 0x49, 0x41, 0x42, 0x49,\n\t\t\t0x4c, 0x49, 0x54, 0x59, 0x2c, 0x20, 0x4f, 0x52, 0x20, 0x54, 0x4f, 0x52, 0x54, 0x0a, 0x2f, 0x2f, 0x20, 0x28, 0x49, 0x4e,\n\t\t\t0x43, 0x4c, 0x55, 0x44, 0x49, 0x4e, 0x47, 0x20, 0x4e, 0x45, 0x47, 0x4c, 0x49, 0x47, 0x45, 0x4e, 0x43, 0x45, 0x20, 0x4f,\n\t\t\t0x52, 0x20, 0x4f, 0x54, 0x48, 0x45, 0x52, 0x57, 0x49, 0x53, 0x45, 0x29, 0x20, 0x41, 0x52, 0x49, 0x53, 0x49, 0x4e, 0x47,\n\t\t\t0x20, 0x49, 0x4e, 0x20, 0x41, 0x4e, 0x59, 0x20, 0x57, 0x41, 0x59, 0x20, 0x4f, 0x55, 0x54, 0x20, 0x4f, 0x46, 0x20, 0x54,\n\t\t\t0x48, 0x45, 0x20, 0x55, 0x53, 0x45, 0x0a, 0x2f, 0x2f, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x49, 0x53, 0x20, 0x53, 0x4f,\n\t\t\t0x46, 0x54, 0x57, 0x41, 0x52, 0x45, 0x2c, 0x20, 0x45, 0x56, 0x45, 0x4e, 0x20, 0x49, 0x46, 0x20, 0x41, 0x44, 0x56, 0x49,\n\t\t\t0x53, 0x45, 0x44, 0x20, 0x4f, 0x46, 0x20, 0x54, 0x48, 0x45, 0x20, 0x50, 0x4f, 0x53, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,\n\t\t\t0x54, 0x59, 0x20, 0x4f, 0x46, 0x20, 0x53, 0x55, 0x43, 0x48, 0x20, 0x44, 0x41, 0x4d, 0x41, 0x47, 0x45, 0x2e, 0x0a, 0x2f,\n\t\t\t0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72,\n\t\t\t0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, 0x28, 0x6e, 0x6f, 0x6e, 0x2d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,\n\t\t\t0x29, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x74, 0x79, 0x70, 0x65, 0x73,\n\t\t\t0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x61,\n\t\t\t0x72, 0x65, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2e, 0x0a,\n\t\t\t0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x74,\n\t\t\t0x68, 0x65, 0x73, 0x65, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x20, 0x77, 0x65, 0x72, 0x65, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,\n\t\t\t0x63, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69,\n\t\t\t0x76, 0x65, 0x0a, 0x2f, 0x2f, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x33, 0x20, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x68, 0x61, 0x73, 0x20, 0x62, 0x65, 0x65, 0x6e,\n\t\t\t0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x60, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x60, 0x20, 0x6b, 0x65, 0x79, 0x77, 0x6f,\n\t\t\t0x72, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x6b, 0x65,\n\t\t\t0x79, 0x77, 0x6f, 0x72, 0x64, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x6f, 0x6e, 0x67, 0x6c, 0x79, 0x20, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x20, 0x77, 0x61, 0x79, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x61, 0x64, 0x64, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x20, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x20, 0x66,\n\t\t\t0x69, 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x41, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e,\n\t\t\t0x64, 0x61, 0x72, 0x79, 0x20, 0x75, 0x73, 0x65, 0x63, 0x61, 0x73, 0x65, 0x20, 0x77, 0x61, 0x73, 0x20, 0x74, 0x6f, 0x20,\n\t\t\t0x65, 0x6d, 0x62, 0x65, 0x64, 0x20, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x20,\n\t\t\t0x74, 0x68, 0x65, 0x20, 0x60, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,\n\t\t\t0x2e, 0x41, 0x6e, 0x79, 0x60, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x69, 0x74, 0x20, 0x69, 0x73,\n\t\t\t0x20, 0x6e, 0x6f, 0x77, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x74, 0x68, 0x61,\n\t\t\t0x74, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70,\n\t\t\t0x65, 0x72, 0x0a, 0x2f, 0x2f, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20,\n\t\t\t0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x63, 0x61, 0x6c, 0x6c, 0x79, 0x20,\n\t\t\t0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68,\n\t\t\t0x65, 0x73, 0x65, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6e, 0x6f,\n\t\t\t0x20, 0x6d, 0x65, 0x61, 0x6e, 0x69, 0x6e, 0x67, 0x66, 0x75, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68,\n\t\t\t0x69, 0x6e, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x20, 0x61,\n\t\t\t0x73, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x6c, 0x61, 0x63, 0x6b, 0x0a, 0x2f, 0x2f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61,\n\t\t\t0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x74, 0x6f, 0x20, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x20, 0x70, 0x72, 0x65,\n\t\t\t0x73, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x20,\n\t\t\t0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x73, 0x65, 0x20, 0x77,\n\t\t\t0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x6e, 0x6f, 0x20, 0x6d, 0x65, 0x61, 0x6e,\n\t\t\t0x69, 0x6e, 0x67, 0x66, 0x75, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x69, 0x6e, 0x20, 0x61, 0x20,\n\t\t\t0x6d, 0x61, 0x70, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x20, 0x73, 0x69, 0x6e, 0x63, 0x65,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x76, 0x69, 0x64, 0x75, 0x61, 0x6c, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x69,\n\t\t\t0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x6d, 0x61, 0x70, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64,\n\t\t\t0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x61, 0x6c, 0x72,\n\t\t\t0x65, 0x61, 0x64, 0x79, 0x20, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65,\n\t\t\t0x2e, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x22,\n\t\t\t0x3b, 0x0a, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x3b, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x5f, 0x65,\n\t\t\t0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b,\n\t\t\t0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d,\n\t\t\t0x20, 0x22, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f,\n\t\t\t0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,\n\t\t\t0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x70, 0x62, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,\n\t\t\t0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x63, 0x6f, 0x6d,\n\t\t\t0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x22, 0x3b, 0x0a, 0x6f,\n\t\t\t0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61,\n\t\t\t0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x22, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x50, 0x72,\n\t\t\t0x6f, 0x74, 0x6f, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75,\n\t\t\t0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x3b,\n\t\t\t0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70,\n\t\t\t0x72, 0x65, 0x66, 0x69, 0x78, 0x20, 0x3d, 0x20, 0x22, 0x47, 0x50, 0x42, 0x22, 0x3b, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f,\n\t\t\t0x6e, 0x20, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d,\n\t\t\t0x20, 0x22, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x57, 0x65,\n\t\t\t0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57,\n\t\t\t0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60,\n\t\t\t0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a,\n\t\t\t0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x60, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e,\n\t\t\t0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20,\n\t\t\t0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x65, 0x67,\n\t\t\t0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x73, 0x20,\n\t\t\t0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,\n\t\t\t0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65,\n\t\t\t0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x66, 0x6c, 0x6f, 0x61, 0x74,\n\t\t\t0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65,\n\t\t\t0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x46, 0x6c,\n\t\t\t0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x6e, 0x75,\n\t\t\t0x6d, 0x62, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f,\n\t\t\t0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e,\n\t\t\t0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49,\n\t\t\t0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e,\n\t\t\t0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73,\n\t\t\t0x61, 0x67, 0x65, 0x20, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20,\n\t\t\t0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x60, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54,\n\t\t\t0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69,\n\t\t\t0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20,\n\t\t\t0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c, 0x20, 0x62,\n\t\t\t0x75, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x68,\n\t\t\t0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d,\n\t\t\t0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x36,\n\t\t\t0x34, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65,\n\t\t\t0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x75, 0x69, 0x6e, 0x74, 0x36,\n\t\t\t0x34, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72,\n\t\t\t0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x55,\n\t\t\t0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20,\n\t\t\t0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x72, 0x65,\n\t\t\t0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e,\n\t\t\t0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c,\n\t\t\t0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x41,\n\t\t\t0x50, 0x49, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c,\n\t\t\t0x61, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65,\n\t\t\t0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x55, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a,\n\t\t\t0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x20, 0x76, 0x61, 0x6c, 0x75,\n\t\t\t0x65, 0x2e, 0x0a, 0x20, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20,\n\t\t\t0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73,\n\t\t\t0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x60, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65,\n\t\t\t0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e,\n\t\t\t0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64,\n\t\t\t0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50,\n\t\t\t0x49, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c,\n\t\t\t0x20, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x61, 0x6e, 0x64,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62,\n\t\t\t0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x49,\n\t\t\t0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65,\n\t\t\t0x20, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x69, 0x6e, 0x74, 0x33,\n\t\t\t0x32, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57,\n\t\t\t0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60,\n\t\t\t0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a,\n\t\t\t0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66,\n\t\t\t0x6f, 0x72, 0x20, 0x60, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20,\n\t\t\t0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e,\n\t\t\t0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75,\n\t\t\t0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20,\n\t\t\t0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x65, 0x67,\n\t\t\t0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x73, 0x20,\n\t\t\t0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,\n\t\t\t0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32,\n\t\t\t0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x20, 0x76, 0x61, 0x6c,\n\t\t\t0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65,\n\t\t\t0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x62, 0x6f, 0x6f, 0x6c, 0x60,\n\t\t\t0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70,\n\t\t\t0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x42, 0x6f, 0x6f,\n\t\t\t0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x60, 0x74, 0x72, 0x75,\n\t\t\t0x65, 0x60, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x60, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f,\n\t\t\t0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c, 0x20, 0x62,\n\t\t\t0x75, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20,\n\t\t\t0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x68,\n\t\t\t0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d,\n\t\t\t0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61,\n\t\t\t0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20,\n\t\t\t0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x6f, 0x6f, 0x6c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20,\n\t\t\t0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x6d,\n\t\t\t0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x60, 0x2e,\n\t\t\t0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72,\n\t\t\t0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x53, 0x74, 0x72, 0x69,\n\t\t\t0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x73, 0x74, 0x72,\n\t\t\t0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d,\n\t\t\t0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65,\n\t\t\t0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73,\n\t\t\t0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49, 0x73,\n\t\t\t0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f, 0x20, 0x68, 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20,\n\t\t\t0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61,\n\t\t\t0x67, 0x65, 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f,\n\t\t\t0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a,\n\t\t\t0x20, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a,\n\t\t\t0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x57, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x20, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,\n\t\t\t0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x62, 0x79, 0x74, 0x65, 0x73, 0x60, 0x2e, 0x0a, 0x2f, 0x2f, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x54, 0x68, 0x65, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61,\n\t\t\t0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x60, 0x42, 0x79, 0x74, 0x65, 0x73, 0x56, 0x61, 0x6c, 0x75, 0x65,\n\t\t\t0x60, 0x20, 0x69, 0x73, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x2f, 0x2f,\n\t\t\t0x0a, 0x2f, 0x2f, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20,\n\t\t\t0x66, 0x6f, 0x72, 0x20, 0x75, 0x73, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x50, 0x49, 0x73, 0x2c,\n\t\t\t0x20, 0x62, 0x75, 0x74, 0x20, 0x73, 0x74, 0x69, 0x6c, 0x6c, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x20, 0x66, 0x6f,\n\t\t\t0x72, 0x20, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x20, 0x41, 0x50, 0x49, 0x73, 0x20, 0x61, 0x6e, 0x64, 0x0a, 0x2f, 0x2f,\n\t\t\t0x20, 0x68, 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x20, 0x70, 0x6c, 0x61, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x72,\n\t\t\t0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x2e, 0x0a, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x20, 0x42, 0x79, 0x74, 0x65,\n\t\t\t0x73, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x68, 0x65, 0x20, 0x62, 0x79,\n\t\t\t0x74, 0x65, 0x73, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x0a, 0x20, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x20, 0x76,\n\t\t\t0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a,\n\t\t},\n\t}\n\n\tfilePathToImports = map[string][]string{\n\t\t\"google/protobuf/any.proto\": {},\n\t\t\"google/protobuf/api.proto\": {\n\t\t\t\"google/protobuf/source_context.proto\",\n\t\t\t\"google/protobuf/type.proto\",\n\t\t},\n\t\t\"google/protobuf/compiler/plugin.proto\": {\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t},\n\t\t\"google/protobuf/cpp_features.proto\": {\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t},\n\t\t\"google/protobuf/descriptor.proto\": {},\n\t\t\"google/protobuf/duration.proto\":   {},\n\t\t\"google/protobuf/empty.proto\":      {},\n\t\t\"google/protobuf/field_mask.proto\": {},\n\t\t\"google/protobuf/go_features.proto\": {\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t},\n\t\t\"google/protobuf/java_features.proto\": {\n\t\t\t\"google/protobuf/descriptor.proto\",\n\t\t},\n\t\t\"google/protobuf/source_context.proto\": {},\n\t\t\"google/protobuf/struct.proto\":         {},\n\t\t\"google/protobuf/timestamp.proto\":      {},\n\t\t\"google/protobuf/type.proto\": {\n\t\t\t\"google/protobuf/any.proto\",\n\t\t\t\"google/protobuf/source_context.proto\",\n\t\t},\n\t\t\"google/protobuf/wrappers.proto\": {},\n\t}\n\n\tmessageNameToFilePath = map[string]string{\n\t\t\"google.protobuf.Any\":                                         \"google/protobuf/any.proto\",\n\t\t\"google.protobuf.Api\":                                         \"google/protobuf/api.proto\",\n\t\t\"google.protobuf.BoolValue\":                                   \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.BytesValue\":                                  \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.DescriptorProto\":                             \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.DescriptorProto.ExtensionRange\":              \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.DescriptorProto.ReservedRange\":               \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.DoubleValue\":                                 \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.Duration\":                                    \"google/protobuf/duration.proto\",\n\t\t\"google.protobuf.Empty\":                                       \"google/protobuf/empty.proto\",\n\t\t\"google.protobuf.Enum\":                                        \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.EnumDescriptorProto\":                         \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.EnumDescriptorProto.EnumReservedRange\":       \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.EnumOptions\":                                 \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.EnumValue\":                                   \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.EnumValueDescriptorProto\":                    \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.EnumValueOptions\":                            \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.ExtensionRangeOptions\":                       \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.ExtensionRangeOptions.Declaration\":           \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet\":                                  \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.VisibilityFeature\":                \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSetDefaults\":                          \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault\": \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Field\":                                       \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.FieldDescriptorProto\":                        \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldMask\":                                   \"google/protobuf/field_mask.proto\",\n\t\t\"google.protobuf.FieldOptions\":                                \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldOptions.EditionDefault\":                 \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldOptions.FeatureSupport\":                 \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FileDescriptorProto\":                         \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FileDescriptorSet\":                           \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FileOptions\":                                 \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FloatValue\":                                  \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.GeneratedCodeInfo\":                           \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.GeneratedCodeInfo.Annotation\":                \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Int32Value\":                                  \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.Int64Value\":                                  \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.ListValue\":                                   \"google/protobuf/struct.proto\",\n\t\t\"google.protobuf.MessageOptions\":                              \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Method\":                                      \"google/protobuf/api.proto\",\n\t\t\"google.protobuf.MethodDescriptorProto\":                       \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.MethodOptions\":                               \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Mixin\":                                       \"google/protobuf/api.proto\",\n\t\t\"google.protobuf.OneofDescriptorProto\":                        \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.OneofOptions\":                                \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Option\":                                      \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.ServiceDescriptorProto\":                      \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.ServiceOptions\":                              \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.SourceCodeInfo\":                              \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.SourceCodeInfo.Location\":                     \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.SourceContext\":                               \"google/protobuf/source_context.proto\",\n\t\t\"google.protobuf.StringValue\":                                 \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.Struct\":                                      \"google/protobuf/struct.proto\",\n\t\t\"google.protobuf.Struct.FieldsEntry\":                          \"google/protobuf/struct.proto\",\n\t\t\"google.protobuf.Timestamp\":                                   \"google/protobuf/timestamp.proto\",\n\t\t\"google.protobuf.Type\":                                        \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.UInt32Value\":                                 \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.UInt64Value\":                                 \"google/protobuf/wrappers.proto\",\n\t\t\"google.protobuf.UninterpretedOption\":                         \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.UninterpretedOption.NamePart\":                \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Value\":                                       \"google/protobuf/struct.proto\",\n\t\t\"google.protobuf.compiler.CodeGeneratorRequest\":               \"google/protobuf/compiler/plugin.proto\",\n\t\t\"google.protobuf.compiler.CodeGeneratorResponse\":              \"google/protobuf/compiler/plugin.proto\",\n\t\t\"google.protobuf.compiler.CodeGeneratorResponse.File\":         \"google/protobuf/compiler/plugin.proto\",\n\t\t\"google.protobuf.compiler.Version\":                            \"google/protobuf/compiler/plugin.proto\",\n\t\t\"pb.CppFeatures\":                                              \"google/protobuf/cpp_features.proto\",\n\t\t\"pb.GoFeatures\":                                               \"google/protobuf/go_features.proto\",\n\t\t\"pb.JavaFeatures\":                                             \"google/protobuf/java_features.proto\",\n\t\t\"pb.JavaFeatures.NestInFileClassFeature\":                      \"google/protobuf/java_features.proto\",\n\t}\n\n\tenumNameToFilePath = map[string]string{\n\t\t\"google.protobuf.Edition\":                                              \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.ExtensionRangeOptions.VerificationState\":              \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.EnforceNamingStyle\":                        \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.EnumType\":                                  \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.FieldPresence\":                             \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.JsonFormat\":                                \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.MessageEncoding\":                           \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.RepeatedFieldEncoding\":                     \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.Utf8Validation\":                            \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility\": \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Field.Cardinality\":                                    \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.Field.Kind\":                                           \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.FieldDescriptorProto.Label\":                           \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldDescriptorProto.Type\":                            \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldOptions.CType\":                                   \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldOptions.JSType\":                                  \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldOptions.OptionRetention\":                         \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FieldOptions.OptionTargetType\":                        \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.FileOptions.OptimizeMode\":                             \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.GeneratedCodeInfo.Annotation.Semantic\":                \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.MethodOptions.IdempotencyLevel\":                       \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.NullValue\":                                            \"google/protobuf/struct.proto\",\n\t\t\"google.protobuf.SymbolVisibility\":                                     \"google/protobuf/descriptor.proto\",\n\t\t\"google.protobuf.Syntax\":                                               \"google/protobuf/type.proto\",\n\t\t\"google.protobuf.compiler.CodeGeneratorResponse.Feature\":               \"google/protobuf/compiler/plugin.proto\",\n\t\t\"pb.CppFeatures.StringType\":                                            \"google/protobuf/cpp_features.proto\",\n\t\t\"pb.GoFeatures.APILevel\":                                               \"google/protobuf/go_features.proto\",\n\t\t\"pb.GoFeatures.StripEnumPrefix\":                                        \"google/protobuf/go_features.proto\",\n\t\t\"pb.JavaFeatures.NestInFileClassFeature.NestInFileClass\":               \"google/protobuf/java_features.proto\",\n\t\t\"pb.JavaFeatures.Utf8Validation\":                                       \"google/protobuf/java_features.proto\",\n\t}\n)\n\nfunc init() {\n\treadBucket, err := storagemem.NewReadBucket(filePathToData)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tReadBucket = readBucket\n}\n\n// Exists returns true if the given path exists in the static data.\n//\n// The path is normalized within this function.\nfunc Exists(filePath string) bool {\n\t_, ok := filePathToData[normalpath.Normalize(filePath)]\n\treturn ok\n}\n\n// FileImports gets the imports for the given file path, if the file path exists.\nfunc FileImports(filePath string) ([]string, bool) {\n\timports, ok := filePathToImports[filePath]\n\tif !ok {\n\t\treturn nil, false\n\t}\n\tc := make([]string, len(imports))\n\tcopy(c, imports)\n\treturn c, true\n}\n\n// MessageFilePath gets the file path for the given message, if the message exists.\nfunc MessageFilePath(messageName string) (string, bool) {\n\tfilePath, ok := messageNameToFilePath[messageName]\n\treturn filePath, ok\n}\n\n// EnumFilePath gets the file path for the given enum, if the enum exists.\nfunc EnumFilePath(enumName string) (string, bool) {\n\tfilePath, ok := enumNameToFilePath[enumName]\n\treturn filePath, ok\n}\n"
  },
  {
    "path": "private/gen/data/datawkt/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage datawkt\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/audit/v1alpha1/auditv1alpha1connect/service.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/audit/v1alpha1/service.proto\n\npackage auditv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/audit/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// AuditServiceName is the fully-qualified name of the AuditService service.\n\tAuditServiceName = \"buf.alpha.audit.v1alpha1.AuditService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// AuditServiceListAuditedEventsProcedure is the fully-qualified name of the AuditService's\n\t// ListAuditedEvents RPC.\n\tAuditServiceListAuditedEventsProcedure = \"/buf.alpha.audit.v1alpha1.AuditService/ListAuditedEvents\"\n)\n\n// AuditServiceClient is a client for the buf.alpha.audit.v1alpha1.AuditService service.\ntype AuditServiceClient interface {\n\t// ListAuditedEvents lists audited events recorded in the BSR instance.\n\tListAuditedEvents(context.Context, *connect.Request[v1alpha1.ListAuditedEventsRequest]) (*connect.Response[v1alpha1.ListAuditedEventsResponse], error)\n}\n\n// NewAuditServiceClient constructs a client for the buf.alpha.audit.v1alpha1.AuditService service.\n// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped\n// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the\n// connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewAuditServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuditServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tauditServiceMethods := v1alpha1.File_buf_alpha_audit_v1alpha1_service_proto.Services().ByName(\"AuditService\").Methods()\n\treturn &auditServiceClient{\n\t\tlistAuditedEvents: connect.NewClient[v1alpha1.ListAuditedEventsRequest, v1alpha1.ListAuditedEventsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuditServiceListAuditedEventsProcedure,\n\t\t\tconnect.WithSchema(auditServiceMethods.ByName(\"ListAuditedEvents\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// auditServiceClient implements AuditServiceClient.\ntype auditServiceClient struct {\n\tlistAuditedEvents *connect.Client[v1alpha1.ListAuditedEventsRequest, v1alpha1.ListAuditedEventsResponse]\n}\n\n// ListAuditedEvents calls buf.alpha.audit.v1alpha1.AuditService.ListAuditedEvents.\nfunc (c *auditServiceClient) ListAuditedEvents(ctx context.Context, req *connect.Request[v1alpha1.ListAuditedEventsRequest]) (*connect.Response[v1alpha1.ListAuditedEventsResponse], error) {\n\treturn c.listAuditedEvents.CallUnary(ctx, req)\n}\n\n// AuditServiceHandler is an implementation of the buf.alpha.audit.v1alpha1.AuditService service.\ntype AuditServiceHandler interface {\n\t// ListAuditedEvents lists audited events recorded in the BSR instance.\n\tListAuditedEvents(context.Context, *connect.Request[v1alpha1.ListAuditedEventsRequest]) (*connect.Response[v1alpha1.ListAuditedEventsResponse], error)\n}\n\n// NewAuditServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewAuditServiceHandler(svc AuditServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tauditServiceMethods := v1alpha1.File_buf_alpha_audit_v1alpha1_service_proto.Services().ByName(\"AuditService\").Methods()\n\tauditServiceListAuditedEventsHandler := connect.NewUnaryHandler(\n\t\tAuditServiceListAuditedEventsProcedure,\n\t\tsvc.ListAuditedEvents,\n\t\tconnect.WithSchema(auditServiceMethods.ByName(\"ListAuditedEvents\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.audit.v1alpha1.AuditService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase AuditServiceListAuditedEventsProcedure:\n\t\t\tauditServiceListAuditedEventsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedAuditServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedAuditServiceHandler struct{}\n\nfunc (UnimplementedAuditServiceHandler) ListAuditedEvents(context.Context, *connect.Request[v1alpha1.ListAuditedEventsRequest]) (*connect.Response[v1alpha1.ListAuditedEventsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.audit.v1alpha1.AuditService.ListAuditedEvents is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/audit/v1alpha1/auditv1alpha1connect/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage auditv1alpha1connect\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/admin.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/admin.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// AdminServiceName is the fully-qualified name of the AdminService service.\n\tAdminServiceName = \"buf.alpha.registry.v1alpha1.AdminService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// AdminServiceForceDeleteUserProcedure is the fully-qualified name of the AdminService's\n\t// ForceDeleteUser RPC.\n\tAdminServiceForceDeleteUserProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/ForceDeleteUser\"\n\t// AdminServiceUpdateUserVerificationStatusProcedure is the fully-qualified name of the\n\t// AdminService's UpdateUserVerificationStatus RPC.\n\tAdminServiceUpdateUserVerificationStatusProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/UpdateUserVerificationStatus\"\n\t// AdminServiceUpdateOrganizationVerificationStatusProcedure is the fully-qualified name of the\n\t// AdminService's UpdateOrganizationVerificationStatus RPC.\n\tAdminServiceUpdateOrganizationVerificationStatusProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/UpdateOrganizationVerificationStatus\"\n\t// AdminServiceCreateMachineUserProcedure is the fully-qualified name of the AdminService's\n\t// CreateMachineUser RPC.\n\tAdminServiceCreateMachineUserProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/CreateMachineUser\"\n\t// AdminServiceGetBreakingChangePolicyProcedure is the fully-qualified name of the AdminService's\n\t// GetBreakingChangePolicy RPC.\n\tAdminServiceGetBreakingChangePolicyProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/GetBreakingChangePolicy\"\n\t// AdminServiceUpdateBreakingChangePolicyProcedure is the fully-qualified name of the AdminService's\n\t// UpdateBreakingChangePolicy RPC.\n\tAdminServiceUpdateBreakingChangePolicyProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/UpdateBreakingChangePolicy\"\n\t// AdminServiceGetUniquenessPolicyProcedure is the fully-qualified name of the AdminService's\n\t// GetUniquenessPolicy RPC.\n\tAdminServiceGetUniquenessPolicyProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/GetUniquenessPolicy\"\n\t// AdminServiceUpdateUniquenessPolicyProcedure is the fully-qualified name of the AdminService's\n\t// UpdateUniquenessPolicy RPC.\n\tAdminServiceUpdateUniquenessPolicyProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/UpdateUniquenessPolicy\"\n\t// AdminServiceListServerUniquenessCollisionsProcedure is the fully-qualified name of the\n\t// AdminService's ListServerUniquenessCollisions RPC.\n\tAdminServiceListServerUniquenessCollisionsProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/ListServerUniquenessCollisions\"\n\t// AdminServiceRunServerUniquenessBackfillTaskProcedure is the fully-qualified name of the\n\t// AdminService's RunServerUniquenessBackfillTask RPC.\n\tAdminServiceRunServerUniquenessBackfillTaskProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/RunServerUniquenessBackfillTask\"\n\t// AdminServiceGetClusterUsageProcedure is the fully-qualified name of the AdminService's\n\t// GetClusterUsage RPC.\n\tAdminServiceGetClusterUsageProcedure = \"/buf.alpha.registry.v1alpha1.AdminService/GetClusterUsage\"\n)\n\n// AdminServiceClient is a client for the buf.alpha.registry.v1alpha1.AdminService service.\ntype AdminServiceClient interface {\n\t// ForceDeleteUser forces to delete a user. Resources and organizations that are\n\t// solely owned by the user will also be deleted.\n\tForceDeleteUser(context.Context, *connect.Request[v1alpha1.ForceDeleteUserRequest]) (*connect.Response[v1alpha1.ForceDeleteUserResponse], error)\n\t// Update a user's verification status.\n\tUpdateUserVerificationStatus(context.Context, *connect.Request[v1alpha1.UpdateUserVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateUserVerificationStatusResponse], error)\n\t// Update a organization's verification.\n\tUpdateOrganizationVerificationStatus(context.Context, *connect.Request[v1alpha1.UpdateOrganizationVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateOrganizationVerificationStatusResponse], error)\n\t// Create a new machine user on the server.\n\tCreateMachineUser(context.Context, *connect.Request[v1alpha1.CreateMachineUserRequest]) (*connect.Response[v1alpha1.CreateMachineUserResponse], error)\n\t// Get breaking change policy for the server.\n\tGetBreakingChangePolicy(context.Context, *connect.Request[v1alpha1.GetBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.GetBreakingChangePolicyResponse], error)\n\t// Update breaking change policy for the server.\n\tUpdateBreakingChangePolicy(context.Context, *connect.Request[v1alpha1.UpdateBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.UpdateBreakingChangePolicyResponse], error)\n\t// Get uniqueness policy for the server.\n\tGetUniquenessPolicy(context.Context, *connect.Request[v1alpha1.GetUniquenessPolicyRequest]) (*connect.Response[v1alpha1.GetUniquenessPolicyResponse], error)\n\t// Update uniqueness policy enforcement for the server.\n\tUpdateUniquenessPolicy(context.Context, *connect.Request[v1alpha1.UpdateUniquenessPolicyRequest]) (*connect.Response[v1alpha1.UpdateUniquenessPolicyResponse], error)\n\t// Get state of uniqueness collisions for the server\n\tListServerUniquenessCollisions(context.Context, *connect.Request[v1alpha1.ListServerUniquenessCollisionsRequest]) (*connect.Response[v1alpha1.ListServerUniquenessCollisionsResponse], error)\n\t// Run a back-fill task to fill unique identifiers on the server.\n\t// This is a potentially long-running operation, and should only be triggered by the administrator of the server,\n\t// if they intend to enable uniqueness policy enforcement.\n\t// Successful completion of this operation is a pre-requisite for enabling uniqueness policy enforcement.\n\tRunServerUniquenessBackfillTask(context.Context, *connect.Request[v1alpha1.RunServerUniquenessBackfillTaskRequest]) (*connect.Response[v1alpha1.RunServerUniquenessBackfillTaskResponse], error)\n\t// GetClusterUsage returns the summation of total message, enum and service types usage\n\t// for every repository in each organization within a single tenant BSR instance.\n\tGetClusterUsage(context.Context, *connect.Request[v1alpha1.GetClusterUsageRequest]) (*connect.Response[v1alpha1.GetClusterUsageResponse], error)\n}\n\n// NewAdminServiceClient constructs a client for the buf.alpha.registry.v1alpha1.AdminService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewAdminServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AdminServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tadminServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_admin_proto.Services().ByName(\"AdminService\").Methods()\n\treturn &adminServiceClient{\n\t\tforceDeleteUser: connect.NewClient[v1alpha1.ForceDeleteUserRequest, v1alpha1.ForceDeleteUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceForceDeleteUserProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"ForceDeleteUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateUserVerificationStatus: connect.NewClient[v1alpha1.UpdateUserVerificationStatusRequest, v1alpha1.UpdateUserVerificationStatusResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceUpdateUserVerificationStatusProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateUserVerificationStatus\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateOrganizationVerificationStatus: connect.NewClient[v1alpha1.UpdateOrganizationVerificationStatusRequest, v1alpha1.UpdateOrganizationVerificationStatusResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceUpdateOrganizationVerificationStatusProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateOrganizationVerificationStatus\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tcreateMachineUser: connect.NewClient[v1alpha1.CreateMachineUserRequest, v1alpha1.CreateMachineUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceCreateMachineUserProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"CreateMachineUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetBreakingChangePolicy: connect.NewClient[v1alpha1.GetBreakingChangePolicyRequest, v1alpha1.GetBreakingChangePolicyResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceGetBreakingChangePolicyProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"GetBreakingChangePolicy\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateBreakingChangePolicy: connect.NewClient[v1alpha1.UpdateBreakingChangePolicyRequest, v1alpha1.UpdateBreakingChangePolicyResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceUpdateBreakingChangePolicyProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateBreakingChangePolicy\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetUniquenessPolicy: connect.NewClient[v1alpha1.GetUniquenessPolicyRequest, v1alpha1.GetUniquenessPolicyResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceGetUniquenessPolicyProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"GetUniquenessPolicy\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateUniquenessPolicy: connect.NewClient[v1alpha1.UpdateUniquenessPolicyRequest, v1alpha1.UpdateUniquenessPolicyResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceUpdateUniquenessPolicyProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateUniquenessPolicy\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistServerUniquenessCollisions: connect.NewClient[v1alpha1.ListServerUniquenessCollisionsRequest, v1alpha1.ListServerUniquenessCollisionsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceListServerUniquenessCollisionsProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"ListServerUniquenessCollisions\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\trunServerUniquenessBackfillTask: connect.NewClient[v1alpha1.RunServerUniquenessBackfillTaskRequest, v1alpha1.RunServerUniquenessBackfillTaskResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceRunServerUniquenessBackfillTaskProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"RunServerUniquenessBackfillTask\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetClusterUsage: connect.NewClient[v1alpha1.GetClusterUsageRequest, v1alpha1.GetClusterUsageResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AdminServiceGetClusterUsageProcedure,\n\t\t\tconnect.WithSchema(adminServiceMethods.ByName(\"GetClusterUsage\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// adminServiceClient implements AdminServiceClient.\ntype adminServiceClient struct {\n\tforceDeleteUser                      *connect.Client[v1alpha1.ForceDeleteUserRequest, v1alpha1.ForceDeleteUserResponse]\n\tupdateUserVerificationStatus         *connect.Client[v1alpha1.UpdateUserVerificationStatusRequest, v1alpha1.UpdateUserVerificationStatusResponse]\n\tupdateOrganizationVerificationStatus *connect.Client[v1alpha1.UpdateOrganizationVerificationStatusRequest, v1alpha1.UpdateOrganizationVerificationStatusResponse]\n\tcreateMachineUser                    *connect.Client[v1alpha1.CreateMachineUserRequest, v1alpha1.CreateMachineUserResponse]\n\tgetBreakingChangePolicy              *connect.Client[v1alpha1.GetBreakingChangePolicyRequest, v1alpha1.GetBreakingChangePolicyResponse]\n\tupdateBreakingChangePolicy           *connect.Client[v1alpha1.UpdateBreakingChangePolicyRequest, v1alpha1.UpdateBreakingChangePolicyResponse]\n\tgetUniquenessPolicy                  *connect.Client[v1alpha1.GetUniquenessPolicyRequest, v1alpha1.GetUniquenessPolicyResponse]\n\tupdateUniquenessPolicy               *connect.Client[v1alpha1.UpdateUniquenessPolicyRequest, v1alpha1.UpdateUniquenessPolicyResponse]\n\tlistServerUniquenessCollisions       *connect.Client[v1alpha1.ListServerUniquenessCollisionsRequest, v1alpha1.ListServerUniquenessCollisionsResponse]\n\trunServerUniquenessBackfillTask      *connect.Client[v1alpha1.RunServerUniquenessBackfillTaskRequest, v1alpha1.RunServerUniquenessBackfillTaskResponse]\n\tgetClusterUsage                      *connect.Client[v1alpha1.GetClusterUsageRequest, v1alpha1.GetClusterUsageResponse]\n}\n\n// ForceDeleteUser calls buf.alpha.registry.v1alpha1.AdminService.ForceDeleteUser.\nfunc (c *adminServiceClient) ForceDeleteUser(ctx context.Context, req *connect.Request[v1alpha1.ForceDeleteUserRequest]) (*connect.Response[v1alpha1.ForceDeleteUserResponse], error) {\n\treturn c.forceDeleteUser.CallUnary(ctx, req)\n}\n\n// UpdateUserVerificationStatus calls\n// buf.alpha.registry.v1alpha1.AdminService.UpdateUserVerificationStatus.\nfunc (c *adminServiceClient) UpdateUserVerificationStatus(ctx context.Context, req *connect.Request[v1alpha1.UpdateUserVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateUserVerificationStatusResponse], error) {\n\treturn c.updateUserVerificationStatus.CallUnary(ctx, req)\n}\n\n// UpdateOrganizationVerificationStatus calls\n// buf.alpha.registry.v1alpha1.AdminService.UpdateOrganizationVerificationStatus.\nfunc (c *adminServiceClient) UpdateOrganizationVerificationStatus(ctx context.Context, req *connect.Request[v1alpha1.UpdateOrganizationVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateOrganizationVerificationStatusResponse], error) {\n\treturn c.updateOrganizationVerificationStatus.CallUnary(ctx, req)\n}\n\n// CreateMachineUser calls buf.alpha.registry.v1alpha1.AdminService.CreateMachineUser.\nfunc (c *adminServiceClient) CreateMachineUser(ctx context.Context, req *connect.Request[v1alpha1.CreateMachineUserRequest]) (*connect.Response[v1alpha1.CreateMachineUserResponse], error) {\n\treturn c.createMachineUser.CallUnary(ctx, req)\n}\n\n// GetBreakingChangePolicy calls buf.alpha.registry.v1alpha1.AdminService.GetBreakingChangePolicy.\nfunc (c *adminServiceClient) GetBreakingChangePolicy(ctx context.Context, req *connect.Request[v1alpha1.GetBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.GetBreakingChangePolicyResponse], error) {\n\treturn c.getBreakingChangePolicy.CallUnary(ctx, req)\n}\n\n// UpdateBreakingChangePolicy calls\n// buf.alpha.registry.v1alpha1.AdminService.UpdateBreakingChangePolicy.\nfunc (c *adminServiceClient) UpdateBreakingChangePolicy(ctx context.Context, req *connect.Request[v1alpha1.UpdateBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.UpdateBreakingChangePolicyResponse], error) {\n\treturn c.updateBreakingChangePolicy.CallUnary(ctx, req)\n}\n\n// GetUniquenessPolicy calls buf.alpha.registry.v1alpha1.AdminService.GetUniquenessPolicy.\nfunc (c *adminServiceClient) GetUniquenessPolicy(ctx context.Context, req *connect.Request[v1alpha1.GetUniquenessPolicyRequest]) (*connect.Response[v1alpha1.GetUniquenessPolicyResponse], error) {\n\treturn c.getUniquenessPolicy.CallUnary(ctx, req)\n}\n\n// UpdateUniquenessPolicy calls buf.alpha.registry.v1alpha1.AdminService.UpdateUniquenessPolicy.\nfunc (c *adminServiceClient) UpdateUniquenessPolicy(ctx context.Context, req *connect.Request[v1alpha1.UpdateUniquenessPolicyRequest]) (*connect.Response[v1alpha1.UpdateUniquenessPolicyResponse], error) {\n\treturn c.updateUniquenessPolicy.CallUnary(ctx, req)\n}\n\n// ListServerUniquenessCollisions calls\n// buf.alpha.registry.v1alpha1.AdminService.ListServerUniquenessCollisions.\nfunc (c *adminServiceClient) ListServerUniquenessCollisions(ctx context.Context, req *connect.Request[v1alpha1.ListServerUniquenessCollisionsRequest]) (*connect.Response[v1alpha1.ListServerUniquenessCollisionsResponse], error) {\n\treturn c.listServerUniquenessCollisions.CallUnary(ctx, req)\n}\n\n// RunServerUniquenessBackfillTask calls\n// buf.alpha.registry.v1alpha1.AdminService.RunServerUniquenessBackfillTask.\nfunc (c *adminServiceClient) RunServerUniquenessBackfillTask(ctx context.Context, req *connect.Request[v1alpha1.RunServerUniquenessBackfillTaskRequest]) (*connect.Response[v1alpha1.RunServerUniquenessBackfillTaskResponse], error) {\n\treturn c.runServerUniquenessBackfillTask.CallUnary(ctx, req)\n}\n\n// GetClusterUsage calls buf.alpha.registry.v1alpha1.AdminService.GetClusterUsage.\nfunc (c *adminServiceClient) GetClusterUsage(ctx context.Context, req *connect.Request[v1alpha1.GetClusterUsageRequest]) (*connect.Response[v1alpha1.GetClusterUsageResponse], error) {\n\treturn c.getClusterUsage.CallUnary(ctx, req)\n}\n\n// AdminServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.AdminService service.\ntype AdminServiceHandler interface {\n\t// ForceDeleteUser forces to delete a user. Resources and organizations that are\n\t// solely owned by the user will also be deleted.\n\tForceDeleteUser(context.Context, *connect.Request[v1alpha1.ForceDeleteUserRequest]) (*connect.Response[v1alpha1.ForceDeleteUserResponse], error)\n\t// Update a user's verification status.\n\tUpdateUserVerificationStatus(context.Context, *connect.Request[v1alpha1.UpdateUserVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateUserVerificationStatusResponse], error)\n\t// Update a organization's verification.\n\tUpdateOrganizationVerificationStatus(context.Context, *connect.Request[v1alpha1.UpdateOrganizationVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateOrganizationVerificationStatusResponse], error)\n\t// Create a new machine user on the server.\n\tCreateMachineUser(context.Context, *connect.Request[v1alpha1.CreateMachineUserRequest]) (*connect.Response[v1alpha1.CreateMachineUserResponse], error)\n\t// Get breaking change policy for the server.\n\tGetBreakingChangePolicy(context.Context, *connect.Request[v1alpha1.GetBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.GetBreakingChangePolicyResponse], error)\n\t// Update breaking change policy for the server.\n\tUpdateBreakingChangePolicy(context.Context, *connect.Request[v1alpha1.UpdateBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.UpdateBreakingChangePolicyResponse], error)\n\t// Get uniqueness policy for the server.\n\tGetUniquenessPolicy(context.Context, *connect.Request[v1alpha1.GetUniquenessPolicyRequest]) (*connect.Response[v1alpha1.GetUniquenessPolicyResponse], error)\n\t// Update uniqueness policy enforcement for the server.\n\tUpdateUniquenessPolicy(context.Context, *connect.Request[v1alpha1.UpdateUniquenessPolicyRequest]) (*connect.Response[v1alpha1.UpdateUniquenessPolicyResponse], error)\n\t// Get state of uniqueness collisions for the server\n\tListServerUniquenessCollisions(context.Context, *connect.Request[v1alpha1.ListServerUniquenessCollisionsRequest]) (*connect.Response[v1alpha1.ListServerUniquenessCollisionsResponse], error)\n\t// Run a back-fill task to fill unique identifiers on the server.\n\t// This is a potentially long-running operation, and should only be triggered by the administrator of the server,\n\t// if they intend to enable uniqueness policy enforcement.\n\t// Successful completion of this operation is a pre-requisite for enabling uniqueness policy enforcement.\n\tRunServerUniquenessBackfillTask(context.Context, *connect.Request[v1alpha1.RunServerUniquenessBackfillTaskRequest]) (*connect.Response[v1alpha1.RunServerUniquenessBackfillTaskResponse], error)\n\t// GetClusterUsage returns the summation of total message, enum and service types usage\n\t// for every repository in each organization within a single tenant BSR instance.\n\tGetClusterUsage(context.Context, *connect.Request[v1alpha1.GetClusterUsageRequest]) (*connect.Response[v1alpha1.GetClusterUsageResponse], error)\n}\n\n// NewAdminServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewAdminServiceHandler(svc AdminServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tadminServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_admin_proto.Services().ByName(\"AdminService\").Methods()\n\tadminServiceForceDeleteUserHandler := connect.NewUnaryHandler(\n\t\tAdminServiceForceDeleteUserProcedure,\n\t\tsvc.ForceDeleteUser,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"ForceDeleteUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceUpdateUserVerificationStatusHandler := connect.NewUnaryHandler(\n\t\tAdminServiceUpdateUserVerificationStatusProcedure,\n\t\tsvc.UpdateUserVerificationStatus,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateUserVerificationStatus\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceUpdateOrganizationVerificationStatusHandler := connect.NewUnaryHandler(\n\t\tAdminServiceUpdateOrganizationVerificationStatusProcedure,\n\t\tsvc.UpdateOrganizationVerificationStatus,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateOrganizationVerificationStatus\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceCreateMachineUserHandler := connect.NewUnaryHandler(\n\t\tAdminServiceCreateMachineUserProcedure,\n\t\tsvc.CreateMachineUser,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"CreateMachineUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceGetBreakingChangePolicyHandler := connect.NewUnaryHandler(\n\t\tAdminServiceGetBreakingChangePolicyProcedure,\n\t\tsvc.GetBreakingChangePolicy,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"GetBreakingChangePolicy\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceUpdateBreakingChangePolicyHandler := connect.NewUnaryHandler(\n\t\tAdminServiceUpdateBreakingChangePolicyProcedure,\n\t\tsvc.UpdateBreakingChangePolicy,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateBreakingChangePolicy\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceGetUniquenessPolicyHandler := connect.NewUnaryHandler(\n\t\tAdminServiceGetUniquenessPolicyProcedure,\n\t\tsvc.GetUniquenessPolicy,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"GetUniquenessPolicy\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceUpdateUniquenessPolicyHandler := connect.NewUnaryHandler(\n\t\tAdminServiceUpdateUniquenessPolicyProcedure,\n\t\tsvc.UpdateUniquenessPolicy,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"UpdateUniquenessPolicy\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceListServerUniquenessCollisionsHandler := connect.NewUnaryHandler(\n\t\tAdminServiceListServerUniquenessCollisionsProcedure,\n\t\tsvc.ListServerUniquenessCollisions,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"ListServerUniquenessCollisions\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceRunServerUniquenessBackfillTaskHandler := connect.NewUnaryHandler(\n\t\tAdminServiceRunServerUniquenessBackfillTaskProcedure,\n\t\tsvc.RunServerUniquenessBackfillTask,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"RunServerUniquenessBackfillTask\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tadminServiceGetClusterUsageHandler := connect.NewUnaryHandler(\n\t\tAdminServiceGetClusterUsageProcedure,\n\t\tsvc.GetClusterUsage,\n\t\tconnect.WithSchema(adminServiceMethods.ByName(\"GetClusterUsage\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.AdminService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase AdminServiceForceDeleteUserProcedure:\n\t\t\tadminServiceForceDeleteUserHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceUpdateUserVerificationStatusProcedure:\n\t\t\tadminServiceUpdateUserVerificationStatusHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceUpdateOrganizationVerificationStatusProcedure:\n\t\t\tadminServiceUpdateOrganizationVerificationStatusHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceCreateMachineUserProcedure:\n\t\t\tadminServiceCreateMachineUserHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceGetBreakingChangePolicyProcedure:\n\t\t\tadminServiceGetBreakingChangePolicyHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceUpdateBreakingChangePolicyProcedure:\n\t\t\tadminServiceUpdateBreakingChangePolicyHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceGetUniquenessPolicyProcedure:\n\t\t\tadminServiceGetUniquenessPolicyHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceUpdateUniquenessPolicyProcedure:\n\t\t\tadminServiceUpdateUniquenessPolicyHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceListServerUniquenessCollisionsProcedure:\n\t\t\tadminServiceListServerUniquenessCollisionsHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceRunServerUniquenessBackfillTaskProcedure:\n\t\t\tadminServiceRunServerUniquenessBackfillTaskHandler.ServeHTTP(w, r)\n\t\tcase AdminServiceGetClusterUsageProcedure:\n\t\t\tadminServiceGetClusterUsageHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedAdminServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedAdminServiceHandler struct{}\n\nfunc (UnimplementedAdminServiceHandler) ForceDeleteUser(context.Context, *connect.Request[v1alpha1.ForceDeleteUserRequest]) (*connect.Response[v1alpha1.ForceDeleteUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.ForceDeleteUser is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) UpdateUserVerificationStatus(context.Context, *connect.Request[v1alpha1.UpdateUserVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateUserVerificationStatusResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.UpdateUserVerificationStatus is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) UpdateOrganizationVerificationStatus(context.Context, *connect.Request[v1alpha1.UpdateOrganizationVerificationStatusRequest]) (*connect.Response[v1alpha1.UpdateOrganizationVerificationStatusResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.UpdateOrganizationVerificationStatus is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) CreateMachineUser(context.Context, *connect.Request[v1alpha1.CreateMachineUserRequest]) (*connect.Response[v1alpha1.CreateMachineUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.CreateMachineUser is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) GetBreakingChangePolicy(context.Context, *connect.Request[v1alpha1.GetBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.GetBreakingChangePolicyResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.GetBreakingChangePolicy is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) UpdateBreakingChangePolicy(context.Context, *connect.Request[v1alpha1.UpdateBreakingChangePolicyRequest]) (*connect.Response[v1alpha1.UpdateBreakingChangePolicyResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.UpdateBreakingChangePolicy is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) GetUniquenessPolicy(context.Context, *connect.Request[v1alpha1.GetUniquenessPolicyRequest]) (*connect.Response[v1alpha1.GetUniquenessPolicyResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.GetUniquenessPolicy is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) UpdateUniquenessPolicy(context.Context, *connect.Request[v1alpha1.UpdateUniquenessPolicyRequest]) (*connect.Response[v1alpha1.UpdateUniquenessPolicyResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.UpdateUniquenessPolicy is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) ListServerUniquenessCollisions(context.Context, *connect.Request[v1alpha1.ListServerUniquenessCollisionsRequest]) (*connect.Response[v1alpha1.ListServerUniquenessCollisionsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.ListServerUniquenessCollisions is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) RunServerUniquenessBackfillTask(context.Context, *connect.Request[v1alpha1.RunServerUniquenessBackfillTaskRequest]) (*connect.Response[v1alpha1.RunServerUniquenessBackfillTaskResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.RunServerUniquenessBackfillTask is not implemented\"))\n}\n\nfunc (UnimplementedAdminServiceHandler) GetClusterUsage(context.Context, *connect.Request[v1alpha1.GetClusterUsageRequest]) (*connect.Response[v1alpha1.GetClusterUsageResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AdminService.GetClusterUsage is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/authn.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/authn.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// AuthnServiceName is the fully-qualified name of the AuthnService service.\n\tAuthnServiceName = \"buf.alpha.registry.v1alpha1.AuthnService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// AuthnServiceGetCurrentUserProcedure is the fully-qualified name of the AuthnService's\n\t// GetCurrentUser RPC.\n\tAuthnServiceGetCurrentUserProcedure = \"/buf.alpha.registry.v1alpha1.AuthnService/GetCurrentUser\"\n\t// AuthnServiceGetCurrentUserSubjectProcedure is the fully-qualified name of the AuthnService's\n\t// GetCurrentUserSubject RPC.\n\tAuthnServiceGetCurrentUserSubjectProcedure = \"/buf.alpha.registry.v1alpha1.AuthnService/GetCurrentUserSubject\"\n)\n\n// AuthnServiceClient is a client for the buf.alpha.registry.v1alpha1.AuthnService service.\ntype AuthnServiceClient interface {\n\t// GetCurrentUser gets information associated with the current user.\n\t//\n\t// The user's ID is retrieved from the request's authentication header.\n\tGetCurrentUser(context.Context, *connect.Request[v1alpha1.GetCurrentUserRequest]) (*connect.Response[v1alpha1.GetCurrentUserResponse], error)\n\t// GetCurrentUserSubject gets the currently logged in users subject.\n\t//\n\t// The user's ID is retrieved from the request's authentication header.\n\tGetCurrentUserSubject(context.Context, *connect.Request[v1alpha1.GetCurrentUserSubjectRequest]) (*connect.Response[v1alpha1.GetCurrentUserSubjectResponse], error)\n}\n\n// NewAuthnServiceClient constructs a client for the buf.alpha.registry.v1alpha1.AuthnService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewAuthnServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthnServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tauthnServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_authn_proto.Services().ByName(\"AuthnService\").Methods()\n\treturn &authnServiceClient{\n\t\tgetCurrentUser: connect.NewClient[v1alpha1.GetCurrentUserRequest, v1alpha1.GetCurrentUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthnServiceGetCurrentUserProcedure,\n\t\t\tconnect.WithSchema(authnServiceMethods.ByName(\"GetCurrentUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetCurrentUserSubject: connect.NewClient[v1alpha1.GetCurrentUserSubjectRequest, v1alpha1.GetCurrentUserSubjectResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthnServiceGetCurrentUserSubjectProcedure,\n\t\t\tconnect.WithSchema(authnServiceMethods.ByName(\"GetCurrentUserSubject\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// authnServiceClient implements AuthnServiceClient.\ntype authnServiceClient struct {\n\tgetCurrentUser        *connect.Client[v1alpha1.GetCurrentUserRequest, v1alpha1.GetCurrentUserResponse]\n\tgetCurrentUserSubject *connect.Client[v1alpha1.GetCurrentUserSubjectRequest, v1alpha1.GetCurrentUserSubjectResponse]\n}\n\n// GetCurrentUser calls buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUser.\nfunc (c *authnServiceClient) GetCurrentUser(ctx context.Context, req *connect.Request[v1alpha1.GetCurrentUserRequest]) (*connect.Response[v1alpha1.GetCurrentUserResponse], error) {\n\treturn c.getCurrentUser.CallUnary(ctx, req)\n}\n\n// GetCurrentUserSubject calls buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUserSubject.\nfunc (c *authnServiceClient) GetCurrentUserSubject(ctx context.Context, req *connect.Request[v1alpha1.GetCurrentUserSubjectRequest]) (*connect.Response[v1alpha1.GetCurrentUserSubjectResponse], error) {\n\treturn c.getCurrentUserSubject.CallUnary(ctx, req)\n}\n\n// AuthnServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.AuthnService service.\ntype AuthnServiceHandler interface {\n\t// GetCurrentUser gets information associated with the current user.\n\t//\n\t// The user's ID is retrieved from the request's authentication header.\n\tGetCurrentUser(context.Context, *connect.Request[v1alpha1.GetCurrentUserRequest]) (*connect.Response[v1alpha1.GetCurrentUserResponse], error)\n\t// GetCurrentUserSubject gets the currently logged in users subject.\n\t//\n\t// The user's ID is retrieved from the request's authentication header.\n\tGetCurrentUserSubject(context.Context, *connect.Request[v1alpha1.GetCurrentUserSubjectRequest]) (*connect.Response[v1alpha1.GetCurrentUserSubjectResponse], error)\n}\n\n// NewAuthnServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewAuthnServiceHandler(svc AuthnServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tauthnServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_authn_proto.Services().ByName(\"AuthnService\").Methods()\n\tauthnServiceGetCurrentUserHandler := connect.NewUnaryHandler(\n\t\tAuthnServiceGetCurrentUserProcedure,\n\t\tsvc.GetCurrentUser,\n\t\tconnect.WithSchema(authnServiceMethods.ByName(\"GetCurrentUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthnServiceGetCurrentUserSubjectHandler := connect.NewUnaryHandler(\n\t\tAuthnServiceGetCurrentUserSubjectProcedure,\n\t\tsvc.GetCurrentUserSubject,\n\t\tconnect.WithSchema(authnServiceMethods.ByName(\"GetCurrentUserSubject\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.AuthnService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase AuthnServiceGetCurrentUserProcedure:\n\t\t\tauthnServiceGetCurrentUserHandler.ServeHTTP(w, r)\n\t\tcase AuthnServiceGetCurrentUserSubjectProcedure:\n\t\t\tauthnServiceGetCurrentUserSubjectHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedAuthnServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedAuthnServiceHandler struct{}\n\nfunc (UnimplementedAuthnServiceHandler) GetCurrentUser(context.Context, *connect.Request[v1alpha1.GetCurrentUserRequest]) (*connect.Response[v1alpha1.GetCurrentUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUser is not implemented\"))\n}\n\nfunc (UnimplementedAuthnServiceHandler) GetCurrentUserSubject(context.Context, *connect.Request[v1alpha1.GetCurrentUserSubjectRequest]) (*connect.Response[v1alpha1.GetCurrentUserSubjectResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUserSubject is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/authz.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/authz.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// AuthzServiceName is the fully-qualified name of the AuthzService service.\n\tAuthzServiceName = \"buf.alpha.registry.v1alpha1.AuthzService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// AuthzServiceUserCanCreateOrganizationRepositoryProcedure is the fully-qualified name of the\n\t// AuthzService's UserCanCreateOrganizationRepository RPC.\n\tAuthzServiceUserCanCreateOrganizationRepositoryProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanCreateOrganizationRepository\"\n\t// AuthzServiceUserCanSeeRepositorySettingsProcedure is the fully-qualified name of the\n\t// AuthzService's UserCanSeeRepositorySettings RPC.\n\tAuthzServiceUserCanSeeRepositorySettingsProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanSeeRepositorySettings\"\n\t// AuthzServiceUserCanSeeOrganizationSettingsProcedure is the fully-qualified name of the\n\t// AuthzService's UserCanSeeOrganizationSettings RPC.\n\tAuthzServiceUserCanSeeOrganizationSettingsProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanSeeOrganizationSettings\"\n\t// AuthzServiceUserCanAddOrganizationMemberProcedure is the fully-qualified name of the\n\t// AuthzService's UserCanAddOrganizationMember RPC.\n\tAuthzServiceUserCanAddOrganizationMemberProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanAddOrganizationMember\"\n\t// AuthzServiceUserCanUpdateOrganizationMemberProcedure is the fully-qualified name of the\n\t// AuthzService's UserCanUpdateOrganizationMember RPC.\n\tAuthzServiceUserCanUpdateOrganizationMemberProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanUpdateOrganizationMember\"\n\t// AuthzServiceUserCanRemoveOrganizationMemberProcedure is the fully-qualified name of the\n\t// AuthzService's UserCanRemoveOrganizationMember RPC.\n\tAuthzServiceUserCanRemoveOrganizationMemberProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanRemoveOrganizationMember\"\n\t// AuthzServiceUserCanDeleteOrganizationProcedure is the fully-qualified name of the AuthzService's\n\t// UserCanDeleteOrganization RPC.\n\tAuthzServiceUserCanDeleteOrganizationProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanDeleteOrganization\"\n\t// AuthzServiceUserCanDeleteRepositoryProcedure is the fully-qualified name of the AuthzService's\n\t// UserCanDeleteRepository RPC.\n\tAuthzServiceUserCanDeleteRepositoryProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanDeleteRepository\"\n\t// AuthzServiceUserCanDeleteUserProcedure is the fully-qualified name of the AuthzService's\n\t// UserCanDeleteUser RPC.\n\tAuthzServiceUserCanDeleteUserProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanDeleteUser\"\n\t// AuthzServiceUserCanSeeServerAdminPanelProcedure is the fully-qualified name of the AuthzService's\n\t// UserCanSeeServerAdminPanel RPC.\n\tAuthzServiceUserCanSeeServerAdminPanelProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanSeeServerAdminPanel\"\n\t// AuthzServiceUserCanManageRepositoryContributorsProcedure is the fully-qualified name of the\n\t// AuthzService's UserCanManageRepositoryContributors RPC.\n\tAuthzServiceUserCanManageRepositoryContributorsProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanManageRepositoryContributors\"\n\t// AuthzServiceUserCanReviewCommitsProcedure is the fully-qualified name of the AuthzService's\n\t// UserCanReviewCommits RPC.\n\tAuthzServiceUserCanReviewCommitsProcedure = \"/buf.alpha.registry.v1alpha1.AuthzService/UserCanReviewCommits\"\n)\n\n// AuthzServiceClient is a client for the buf.alpha.registry.v1alpha1.AuthzService service.\ntype AuthzServiceClient interface {\n\t// UserCanCreateOrganizationRepository returns whether the user is authorized\n\t// to create repositories in an organization.\n\tUserCanCreateOrganizationRepository(context.Context, *connect.Request[v1alpha1.UserCanCreateOrganizationRepositoryRequest]) (*connect.Response[v1alpha1.UserCanCreateOrganizationRepositoryResponse], error)\n\t// UserCanSeeRepositorySettings returns whether the user is authorized\n\t// to see repository settings.\n\tUserCanSeeRepositorySettings(context.Context, *connect.Request[v1alpha1.UserCanSeeRepositorySettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeRepositorySettingsResponse], error)\n\t// UserCanSeeOrganizationSettings returns whether the user is authorized\n\t// to see organization settings.\n\tUserCanSeeOrganizationSettings(context.Context, *connect.Request[v1alpha1.UserCanSeeOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeOrganizationSettingsResponse], error)\n\t// UserCanAddOrganizationMember returns whether the user is authorized to add\n\t// any members to the organization and the list of roles they can add.\n\tUserCanAddOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanAddOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanAddOrganizationMemberResponse], error)\n\t// UserCanUpdateOrganizationMember returns whether the user is authorized to update\n\t// any members' membership information in the organization and the list of roles they can update.\n\tUserCanUpdateOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanUpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanUpdateOrganizationMemberResponse], error)\n\t// UserCanRemoveOrganizationMember returns whether the user is authorized to remove\n\t// any members from the organization and the list of roles they can remove.\n\tUserCanRemoveOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanRemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanRemoveOrganizationMemberResponse], error)\n\t// UserCanDeleteOrganization returns whether the user is authorized\n\t// to delete an organization.\n\tUserCanDeleteOrganization(context.Context, *connect.Request[v1alpha1.UserCanDeleteOrganizationRequest]) (*connect.Response[v1alpha1.UserCanDeleteOrganizationResponse], error)\n\t// UserCanDeleteRepository returns whether the user is authorized\n\t// to delete a repository.\n\tUserCanDeleteRepository(context.Context, *connect.Request[v1alpha1.UserCanDeleteRepositoryRequest]) (*connect.Response[v1alpha1.UserCanDeleteRepositoryResponse], error)\n\t// UserCanDeleteUser returns whether the user is authorized\n\t// to delete a user.\n\tUserCanDeleteUser(context.Context, *connect.Request[v1alpha1.UserCanDeleteUserRequest]) (*connect.Response[v1alpha1.UserCanDeleteUserResponse], error)\n\t// UserCanSeeServerAdminPanel returns whether the user is authorized\n\t// to see server admin panel.\n\tUserCanSeeServerAdminPanel(context.Context, *connect.Request[v1alpha1.UserCanSeeServerAdminPanelRequest]) (*connect.Response[v1alpha1.UserCanSeeServerAdminPanelResponse], error)\n\t// UserCanManageRepositoryContributors returns whether the user is authorized to manage\n\t// any contributors to the repository and the list of roles they can manage.\n\tUserCanManageRepositoryContributors(context.Context, *connect.Request[v1alpha1.UserCanManageRepositoryContributorsRequest]) (*connect.Response[v1alpha1.UserCanManageRepositoryContributorsResponse], error)\n\t// UserCanReviewCommits returns whether the user is authorized to review\n\t// commits within a repository.\n\tUserCanReviewCommits(context.Context, *connect.Request[v1alpha1.UserCanReviewCommitsRequest]) (*connect.Response[v1alpha1.UserCanReviewCommitsResponse], error)\n}\n\n// NewAuthzServiceClient constructs a client for the buf.alpha.registry.v1alpha1.AuthzService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewAuthzServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthzServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tauthzServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_authz_proto.Services().ByName(\"AuthzService\").Methods()\n\treturn &authzServiceClient{\n\t\tuserCanCreateOrganizationRepository: connect.NewClient[v1alpha1.UserCanCreateOrganizationRepositoryRequest, v1alpha1.UserCanCreateOrganizationRepositoryResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanCreateOrganizationRepositoryProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanCreateOrganizationRepository\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanSeeRepositorySettings: connect.NewClient[v1alpha1.UserCanSeeRepositorySettingsRequest, v1alpha1.UserCanSeeRepositorySettingsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanSeeRepositorySettingsProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanSeeRepositorySettings\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanSeeOrganizationSettings: connect.NewClient[v1alpha1.UserCanSeeOrganizationSettingsRequest, v1alpha1.UserCanSeeOrganizationSettingsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanSeeOrganizationSettingsProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanSeeOrganizationSettings\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanAddOrganizationMember: connect.NewClient[v1alpha1.UserCanAddOrganizationMemberRequest, v1alpha1.UserCanAddOrganizationMemberResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanAddOrganizationMemberProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanAddOrganizationMember\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanUpdateOrganizationMember: connect.NewClient[v1alpha1.UserCanUpdateOrganizationMemberRequest, v1alpha1.UserCanUpdateOrganizationMemberResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanUpdateOrganizationMemberProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanUpdateOrganizationMember\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanRemoveOrganizationMember: connect.NewClient[v1alpha1.UserCanRemoveOrganizationMemberRequest, v1alpha1.UserCanRemoveOrganizationMemberResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanRemoveOrganizationMemberProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanRemoveOrganizationMember\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanDeleteOrganization: connect.NewClient[v1alpha1.UserCanDeleteOrganizationRequest, v1alpha1.UserCanDeleteOrganizationResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanDeleteOrganizationProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanDeleteOrganization\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanDeleteRepository: connect.NewClient[v1alpha1.UserCanDeleteRepositoryRequest, v1alpha1.UserCanDeleteRepositoryResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanDeleteRepositoryProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanDeleteRepository\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanDeleteUser: connect.NewClient[v1alpha1.UserCanDeleteUserRequest, v1alpha1.UserCanDeleteUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanDeleteUserProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanDeleteUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanSeeServerAdminPanel: connect.NewClient[v1alpha1.UserCanSeeServerAdminPanelRequest, v1alpha1.UserCanSeeServerAdminPanelResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanSeeServerAdminPanelProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanSeeServerAdminPanel\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanManageRepositoryContributors: connect.NewClient[v1alpha1.UserCanManageRepositoryContributorsRequest, v1alpha1.UserCanManageRepositoryContributorsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanManageRepositoryContributorsProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanManageRepositoryContributors\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tuserCanReviewCommits: connect.NewClient[v1alpha1.UserCanReviewCommitsRequest, v1alpha1.UserCanReviewCommitsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+AuthzServiceUserCanReviewCommitsProcedure,\n\t\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanReviewCommits\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// authzServiceClient implements AuthzServiceClient.\ntype authzServiceClient struct {\n\tuserCanCreateOrganizationRepository *connect.Client[v1alpha1.UserCanCreateOrganizationRepositoryRequest, v1alpha1.UserCanCreateOrganizationRepositoryResponse]\n\tuserCanSeeRepositorySettings        *connect.Client[v1alpha1.UserCanSeeRepositorySettingsRequest, v1alpha1.UserCanSeeRepositorySettingsResponse]\n\tuserCanSeeOrganizationSettings      *connect.Client[v1alpha1.UserCanSeeOrganizationSettingsRequest, v1alpha1.UserCanSeeOrganizationSettingsResponse]\n\tuserCanAddOrganizationMember        *connect.Client[v1alpha1.UserCanAddOrganizationMemberRequest, v1alpha1.UserCanAddOrganizationMemberResponse]\n\tuserCanUpdateOrganizationMember     *connect.Client[v1alpha1.UserCanUpdateOrganizationMemberRequest, v1alpha1.UserCanUpdateOrganizationMemberResponse]\n\tuserCanRemoveOrganizationMember     *connect.Client[v1alpha1.UserCanRemoveOrganizationMemberRequest, v1alpha1.UserCanRemoveOrganizationMemberResponse]\n\tuserCanDeleteOrganization           *connect.Client[v1alpha1.UserCanDeleteOrganizationRequest, v1alpha1.UserCanDeleteOrganizationResponse]\n\tuserCanDeleteRepository             *connect.Client[v1alpha1.UserCanDeleteRepositoryRequest, v1alpha1.UserCanDeleteRepositoryResponse]\n\tuserCanDeleteUser                   *connect.Client[v1alpha1.UserCanDeleteUserRequest, v1alpha1.UserCanDeleteUserResponse]\n\tuserCanSeeServerAdminPanel          *connect.Client[v1alpha1.UserCanSeeServerAdminPanelRequest, v1alpha1.UserCanSeeServerAdminPanelResponse]\n\tuserCanManageRepositoryContributors *connect.Client[v1alpha1.UserCanManageRepositoryContributorsRequest, v1alpha1.UserCanManageRepositoryContributorsResponse]\n\tuserCanReviewCommits                *connect.Client[v1alpha1.UserCanReviewCommitsRequest, v1alpha1.UserCanReviewCommitsResponse]\n}\n\n// UserCanCreateOrganizationRepository calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationRepository.\nfunc (c *authzServiceClient) UserCanCreateOrganizationRepository(ctx context.Context, req *connect.Request[v1alpha1.UserCanCreateOrganizationRepositoryRequest]) (*connect.Response[v1alpha1.UserCanCreateOrganizationRepositoryResponse], error) {\n\treturn c.userCanCreateOrganizationRepository.CallUnary(ctx, req)\n}\n\n// UserCanSeeRepositorySettings calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeRepositorySettings.\nfunc (c *authzServiceClient) UserCanSeeRepositorySettings(ctx context.Context, req *connect.Request[v1alpha1.UserCanSeeRepositorySettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeRepositorySettingsResponse], error) {\n\treturn c.userCanSeeRepositorySettings.CallUnary(ctx, req)\n}\n\n// UserCanSeeOrganizationSettings calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeOrganizationSettings.\nfunc (c *authzServiceClient) UserCanSeeOrganizationSettings(ctx context.Context, req *connect.Request[v1alpha1.UserCanSeeOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeOrganizationSettingsResponse], error) {\n\treturn c.userCanSeeOrganizationSettings.CallUnary(ctx, req)\n}\n\n// UserCanAddOrganizationMember calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanAddOrganizationMember.\nfunc (c *authzServiceClient) UserCanAddOrganizationMember(ctx context.Context, req *connect.Request[v1alpha1.UserCanAddOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanAddOrganizationMemberResponse], error) {\n\treturn c.userCanAddOrganizationMember.CallUnary(ctx, req)\n}\n\n// UserCanUpdateOrganizationMember calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanUpdateOrganizationMember.\nfunc (c *authzServiceClient) UserCanUpdateOrganizationMember(ctx context.Context, req *connect.Request[v1alpha1.UserCanUpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanUpdateOrganizationMemberResponse], error) {\n\treturn c.userCanUpdateOrganizationMember.CallUnary(ctx, req)\n}\n\n// UserCanRemoveOrganizationMember calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanRemoveOrganizationMember.\nfunc (c *authzServiceClient) UserCanRemoveOrganizationMember(ctx context.Context, req *connect.Request[v1alpha1.UserCanRemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanRemoveOrganizationMemberResponse], error) {\n\treturn c.userCanRemoveOrganizationMember.CallUnary(ctx, req)\n}\n\n// UserCanDeleteOrganization calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteOrganization.\nfunc (c *authzServiceClient) UserCanDeleteOrganization(ctx context.Context, req *connect.Request[v1alpha1.UserCanDeleteOrganizationRequest]) (*connect.Response[v1alpha1.UserCanDeleteOrganizationResponse], error) {\n\treturn c.userCanDeleteOrganization.CallUnary(ctx, req)\n}\n\n// UserCanDeleteRepository calls buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteRepository.\nfunc (c *authzServiceClient) UserCanDeleteRepository(ctx context.Context, req *connect.Request[v1alpha1.UserCanDeleteRepositoryRequest]) (*connect.Response[v1alpha1.UserCanDeleteRepositoryResponse], error) {\n\treturn c.userCanDeleteRepository.CallUnary(ctx, req)\n}\n\n// UserCanDeleteUser calls buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteUser.\nfunc (c *authzServiceClient) UserCanDeleteUser(ctx context.Context, req *connect.Request[v1alpha1.UserCanDeleteUserRequest]) (*connect.Response[v1alpha1.UserCanDeleteUserResponse], error) {\n\treturn c.userCanDeleteUser.CallUnary(ctx, req)\n}\n\n// UserCanSeeServerAdminPanel calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeServerAdminPanel.\nfunc (c *authzServiceClient) UserCanSeeServerAdminPanel(ctx context.Context, req *connect.Request[v1alpha1.UserCanSeeServerAdminPanelRequest]) (*connect.Response[v1alpha1.UserCanSeeServerAdminPanelResponse], error) {\n\treturn c.userCanSeeServerAdminPanel.CallUnary(ctx, req)\n}\n\n// UserCanManageRepositoryContributors calls\n// buf.alpha.registry.v1alpha1.AuthzService.UserCanManageRepositoryContributors.\nfunc (c *authzServiceClient) UserCanManageRepositoryContributors(ctx context.Context, req *connect.Request[v1alpha1.UserCanManageRepositoryContributorsRequest]) (*connect.Response[v1alpha1.UserCanManageRepositoryContributorsResponse], error) {\n\treturn c.userCanManageRepositoryContributors.CallUnary(ctx, req)\n}\n\n// UserCanReviewCommits calls buf.alpha.registry.v1alpha1.AuthzService.UserCanReviewCommits.\nfunc (c *authzServiceClient) UserCanReviewCommits(ctx context.Context, req *connect.Request[v1alpha1.UserCanReviewCommitsRequest]) (*connect.Response[v1alpha1.UserCanReviewCommitsResponse], error) {\n\treturn c.userCanReviewCommits.CallUnary(ctx, req)\n}\n\n// AuthzServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.AuthzService service.\ntype AuthzServiceHandler interface {\n\t// UserCanCreateOrganizationRepository returns whether the user is authorized\n\t// to create repositories in an organization.\n\tUserCanCreateOrganizationRepository(context.Context, *connect.Request[v1alpha1.UserCanCreateOrganizationRepositoryRequest]) (*connect.Response[v1alpha1.UserCanCreateOrganizationRepositoryResponse], error)\n\t// UserCanSeeRepositorySettings returns whether the user is authorized\n\t// to see repository settings.\n\tUserCanSeeRepositorySettings(context.Context, *connect.Request[v1alpha1.UserCanSeeRepositorySettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeRepositorySettingsResponse], error)\n\t// UserCanSeeOrganizationSettings returns whether the user is authorized\n\t// to see organization settings.\n\tUserCanSeeOrganizationSettings(context.Context, *connect.Request[v1alpha1.UserCanSeeOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeOrganizationSettingsResponse], error)\n\t// UserCanAddOrganizationMember returns whether the user is authorized to add\n\t// any members to the organization and the list of roles they can add.\n\tUserCanAddOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanAddOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanAddOrganizationMemberResponse], error)\n\t// UserCanUpdateOrganizationMember returns whether the user is authorized to update\n\t// any members' membership information in the organization and the list of roles they can update.\n\tUserCanUpdateOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanUpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanUpdateOrganizationMemberResponse], error)\n\t// UserCanRemoveOrganizationMember returns whether the user is authorized to remove\n\t// any members from the organization and the list of roles they can remove.\n\tUserCanRemoveOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanRemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanRemoveOrganizationMemberResponse], error)\n\t// UserCanDeleteOrganization returns whether the user is authorized\n\t// to delete an organization.\n\tUserCanDeleteOrganization(context.Context, *connect.Request[v1alpha1.UserCanDeleteOrganizationRequest]) (*connect.Response[v1alpha1.UserCanDeleteOrganizationResponse], error)\n\t// UserCanDeleteRepository returns whether the user is authorized\n\t// to delete a repository.\n\tUserCanDeleteRepository(context.Context, *connect.Request[v1alpha1.UserCanDeleteRepositoryRequest]) (*connect.Response[v1alpha1.UserCanDeleteRepositoryResponse], error)\n\t// UserCanDeleteUser returns whether the user is authorized\n\t// to delete a user.\n\tUserCanDeleteUser(context.Context, *connect.Request[v1alpha1.UserCanDeleteUserRequest]) (*connect.Response[v1alpha1.UserCanDeleteUserResponse], error)\n\t// UserCanSeeServerAdminPanel returns whether the user is authorized\n\t// to see server admin panel.\n\tUserCanSeeServerAdminPanel(context.Context, *connect.Request[v1alpha1.UserCanSeeServerAdminPanelRequest]) (*connect.Response[v1alpha1.UserCanSeeServerAdminPanelResponse], error)\n\t// UserCanManageRepositoryContributors returns whether the user is authorized to manage\n\t// any contributors to the repository and the list of roles they can manage.\n\tUserCanManageRepositoryContributors(context.Context, *connect.Request[v1alpha1.UserCanManageRepositoryContributorsRequest]) (*connect.Response[v1alpha1.UserCanManageRepositoryContributorsResponse], error)\n\t// UserCanReviewCommits returns whether the user is authorized to review\n\t// commits within a repository.\n\tUserCanReviewCommits(context.Context, *connect.Request[v1alpha1.UserCanReviewCommitsRequest]) (*connect.Response[v1alpha1.UserCanReviewCommitsResponse], error)\n}\n\n// NewAuthzServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewAuthzServiceHandler(svc AuthzServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tauthzServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_authz_proto.Services().ByName(\"AuthzService\").Methods()\n\tauthzServiceUserCanCreateOrganizationRepositoryHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanCreateOrganizationRepositoryProcedure,\n\t\tsvc.UserCanCreateOrganizationRepository,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanCreateOrganizationRepository\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanSeeRepositorySettingsHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanSeeRepositorySettingsProcedure,\n\t\tsvc.UserCanSeeRepositorySettings,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanSeeRepositorySettings\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanSeeOrganizationSettingsHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanSeeOrganizationSettingsProcedure,\n\t\tsvc.UserCanSeeOrganizationSettings,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanSeeOrganizationSettings\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanAddOrganizationMemberHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanAddOrganizationMemberProcedure,\n\t\tsvc.UserCanAddOrganizationMember,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanAddOrganizationMember\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanUpdateOrganizationMemberHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanUpdateOrganizationMemberProcedure,\n\t\tsvc.UserCanUpdateOrganizationMember,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanUpdateOrganizationMember\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanRemoveOrganizationMemberHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanRemoveOrganizationMemberProcedure,\n\t\tsvc.UserCanRemoveOrganizationMember,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanRemoveOrganizationMember\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanDeleteOrganizationHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanDeleteOrganizationProcedure,\n\t\tsvc.UserCanDeleteOrganization,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanDeleteOrganization\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanDeleteRepositoryHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanDeleteRepositoryProcedure,\n\t\tsvc.UserCanDeleteRepository,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanDeleteRepository\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanDeleteUserHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanDeleteUserProcedure,\n\t\tsvc.UserCanDeleteUser,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanDeleteUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanSeeServerAdminPanelHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanSeeServerAdminPanelProcedure,\n\t\tsvc.UserCanSeeServerAdminPanel,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanSeeServerAdminPanel\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanManageRepositoryContributorsHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanManageRepositoryContributorsProcedure,\n\t\tsvc.UserCanManageRepositoryContributors,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanManageRepositoryContributors\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tauthzServiceUserCanReviewCommitsHandler := connect.NewUnaryHandler(\n\t\tAuthzServiceUserCanReviewCommitsProcedure,\n\t\tsvc.UserCanReviewCommits,\n\t\tconnect.WithSchema(authzServiceMethods.ByName(\"UserCanReviewCommits\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.AuthzService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase AuthzServiceUserCanCreateOrganizationRepositoryProcedure:\n\t\t\tauthzServiceUserCanCreateOrganizationRepositoryHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanSeeRepositorySettingsProcedure:\n\t\t\tauthzServiceUserCanSeeRepositorySettingsHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanSeeOrganizationSettingsProcedure:\n\t\t\tauthzServiceUserCanSeeOrganizationSettingsHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanAddOrganizationMemberProcedure:\n\t\t\tauthzServiceUserCanAddOrganizationMemberHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanUpdateOrganizationMemberProcedure:\n\t\t\tauthzServiceUserCanUpdateOrganizationMemberHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanRemoveOrganizationMemberProcedure:\n\t\t\tauthzServiceUserCanRemoveOrganizationMemberHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanDeleteOrganizationProcedure:\n\t\t\tauthzServiceUserCanDeleteOrganizationHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanDeleteRepositoryProcedure:\n\t\t\tauthzServiceUserCanDeleteRepositoryHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanDeleteUserProcedure:\n\t\t\tauthzServiceUserCanDeleteUserHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanSeeServerAdminPanelProcedure:\n\t\t\tauthzServiceUserCanSeeServerAdminPanelHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanManageRepositoryContributorsProcedure:\n\t\t\tauthzServiceUserCanManageRepositoryContributorsHandler.ServeHTTP(w, r)\n\t\tcase AuthzServiceUserCanReviewCommitsProcedure:\n\t\t\tauthzServiceUserCanReviewCommitsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedAuthzServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedAuthzServiceHandler struct{}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanCreateOrganizationRepository(context.Context, *connect.Request[v1alpha1.UserCanCreateOrganizationRepositoryRequest]) (*connect.Response[v1alpha1.UserCanCreateOrganizationRepositoryResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationRepository is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanSeeRepositorySettings(context.Context, *connect.Request[v1alpha1.UserCanSeeRepositorySettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeRepositorySettingsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeRepositorySettings is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanSeeOrganizationSettings(context.Context, *connect.Request[v1alpha1.UserCanSeeOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UserCanSeeOrganizationSettingsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeOrganizationSettings is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanAddOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanAddOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanAddOrganizationMemberResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanAddOrganizationMember is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanUpdateOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanUpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanUpdateOrganizationMemberResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanUpdateOrganizationMember is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanRemoveOrganizationMember(context.Context, *connect.Request[v1alpha1.UserCanRemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.UserCanRemoveOrganizationMemberResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanRemoveOrganizationMember is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanDeleteOrganization(context.Context, *connect.Request[v1alpha1.UserCanDeleteOrganizationRequest]) (*connect.Response[v1alpha1.UserCanDeleteOrganizationResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteOrganization is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanDeleteRepository(context.Context, *connect.Request[v1alpha1.UserCanDeleteRepositoryRequest]) (*connect.Response[v1alpha1.UserCanDeleteRepositoryResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteRepository is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanDeleteUser(context.Context, *connect.Request[v1alpha1.UserCanDeleteUserRequest]) (*connect.Response[v1alpha1.UserCanDeleteUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteUser is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanSeeServerAdminPanel(context.Context, *connect.Request[v1alpha1.UserCanSeeServerAdminPanelRequest]) (*connect.Response[v1alpha1.UserCanSeeServerAdminPanelResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeServerAdminPanel is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanManageRepositoryContributors(context.Context, *connect.Request[v1alpha1.UserCanManageRepositoryContributorsRequest]) (*connect.Response[v1alpha1.UserCanManageRepositoryContributorsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanManageRepositoryContributors is not implemented\"))\n}\n\nfunc (UnimplementedAuthzServiceHandler) UserCanReviewCommits(context.Context, *connect.Request[v1alpha1.UserCanReviewCommitsRequest]) (*connect.Response[v1alpha1.UserCanReviewCommitsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.AuthzService.UserCanReviewCommits is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/convert.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/convert.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// ConvertServiceName is the fully-qualified name of the ConvertService service.\n\tConvertServiceName = \"buf.alpha.registry.v1alpha1.ConvertService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// ConvertServiceConvertProcedure is the fully-qualified name of the ConvertService's Convert RPC.\n\tConvertServiceConvertProcedure = \"/buf.alpha.registry.v1alpha1.ConvertService/Convert\"\n)\n\n// ConvertServiceClient is a client for the buf.alpha.registry.v1alpha1.ConvertService service.\ntype ConvertServiceClient interface {\n\t// Convert converts a serialized message according to\n\t// the provided type name using an image.\n\tConvert(context.Context, *connect.Request[v1alpha1.ConvertRequest]) (*connect.Response[v1alpha1.ConvertResponse], error)\n}\n\n// NewConvertServiceClient constructs a client for the buf.alpha.registry.v1alpha1.ConvertService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewConvertServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ConvertServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tconvertServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_convert_proto.Services().ByName(\"ConvertService\").Methods()\n\treturn &convertServiceClient{\n\t\tconvert: connect.NewClient[v1alpha1.ConvertRequest, v1alpha1.ConvertResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ConvertServiceConvertProcedure,\n\t\t\tconnect.WithSchema(convertServiceMethods.ByName(\"Convert\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// convertServiceClient implements ConvertServiceClient.\ntype convertServiceClient struct {\n\tconvert *connect.Client[v1alpha1.ConvertRequest, v1alpha1.ConvertResponse]\n}\n\n// Convert calls buf.alpha.registry.v1alpha1.ConvertService.Convert.\nfunc (c *convertServiceClient) Convert(ctx context.Context, req *connect.Request[v1alpha1.ConvertRequest]) (*connect.Response[v1alpha1.ConvertResponse], error) {\n\treturn c.convert.CallUnary(ctx, req)\n}\n\n// ConvertServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.ConvertService\n// service.\ntype ConvertServiceHandler interface {\n\t// Convert converts a serialized message according to\n\t// the provided type name using an image.\n\tConvert(context.Context, *connect.Request[v1alpha1.ConvertRequest]) (*connect.Response[v1alpha1.ConvertResponse], error)\n}\n\n// NewConvertServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewConvertServiceHandler(svc ConvertServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tconvertServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_convert_proto.Services().ByName(\"ConvertService\").Methods()\n\tconvertServiceConvertHandler := connect.NewUnaryHandler(\n\t\tConvertServiceConvertProcedure,\n\t\tsvc.Convert,\n\t\tconnect.WithSchema(convertServiceMethods.ByName(\"Convert\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.ConvertService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase ConvertServiceConvertProcedure:\n\t\t\tconvertServiceConvertHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedConvertServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedConvertServiceHandler struct{}\n\nfunc (UnimplementedConvertServiceHandler) Convert(context.Context, *connect.Request[v1alpha1.ConvertRequest]) (*connect.Response[v1alpha1.ConvertResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ConvertService.Convert is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/display.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/display.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// DisplayServiceName is the fully-qualified name of the DisplayService service.\n\tDisplayServiceName = \"buf.alpha.registry.v1alpha1.DisplayService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// DisplayServiceDisplayOrganizationElementsProcedure is the fully-qualified name of the\n\t// DisplayService's DisplayOrganizationElements RPC.\n\tDisplayServiceDisplayOrganizationElementsProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/DisplayOrganizationElements\"\n\t// DisplayServiceDisplayRepositoryElementsProcedure is the fully-qualified name of the\n\t// DisplayService's DisplayRepositoryElements RPC.\n\tDisplayServiceDisplayRepositoryElementsProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/DisplayRepositoryElements\"\n\t// DisplayServiceDisplayPluginElementsProcedure is the fully-qualified name of the DisplayService's\n\t// DisplayPluginElements RPC.\n\tDisplayServiceDisplayPluginElementsProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/DisplayPluginElements\"\n\t// DisplayServiceDisplayUserElementsProcedure is the fully-qualified name of the DisplayService's\n\t// DisplayUserElements RPC.\n\tDisplayServiceDisplayUserElementsProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/DisplayUserElements\"\n\t// DisplayServiceDisplayServerElementsProcedure is the fully-qualified name of the DisplayService's\n\t// DisplayServerElements RPC.\n\tDisplayServiceDisplayServerElementsProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/DisplayServerElements\"\n\t// DisplayServiceDisplayOwnerEntitledElementsProcedure is the fully-qualified name of the\n\t// DisplayService's DisplayOwnerEntitledElements RPC.\n\tDisplayServiceDisplayOwnerEntitledElementsProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/DisplayOwnerEntitledElements\"\n\t// DisplayServiceDisplayRepositoryEntitledElementsProcedure is the fully-qualified name of the\n\t// DisplayService's DisplayRepositoryEntitledElements RPC.\n\tDisplayServiceDisplayRepositoryEntitledElementsProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/DisplayRepositoryEntitledElements\"\n\t// DisplayServiceListManageableRepositoryRolesProcedure is the fully-qualified name of the\n\t// DisplayService's ListManageableRepositoryRoles RPC.\n\tDisplayServiceListManageableRepositoryRolesProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/ListManageableRepositoryRoles\"\n\t// DisplayServiceListManageableUserRepositoryRolesProcedure is the fully-qualified name of the\n\t// DisplayService's ListManageableUserRepositoryRoles RPC.\n\tDisplayServiceListManageableUserRepositoryRolesProcedure = \"/buf.alpha.registry.v1alpha1.DisplayService/ListManageableUserRepositoryRoles\"\n)\n\n// DisplayServiceClient is a client for the buf.alpha.registry.v1alpha1.DisplayService service.\ntype DisplayServiceClient interface {\n\t// DisplayOrganizationElements returns which organization elements should be displayed to the user.\n\tDisplayOrganizationElements(context.Context, *connect.Request[v1alpha1.DisplayOrganizationElementsRequest]) (*connect.Response[v1alpha1.DisplayOrganizationElementsResponse], error)\n\t// DisplayRepositoryElements returns which repository elements should be displayed to the user.\n\tDisplayRepositoryElements(context.Context, *connect.Request[v1alpha1.DisplayRepositoryElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryElementsResponse], error)\n\t// DisplayPluginElements returns which plugin elements should be displayed to the user.\n\tDisplayPluginElements(context.Context, *connect.Request[v1alpha1.DisplayPluginElementsRequest]) (*connect.Response[v1alpha1.DisplayPluginElementsResponse], error)\n\t// DisplayUserElements returns which user elements should be displayed to the user.\n\tDisplayUserElements(context.Context, *connect.Request[v1alpha1.DisplayUserElementsRequest]) (*connect.Response[v1alpha1.DisplayUserElementsResponse], error)\n\t// DisplayServerElements returns which server elements should be displayed to the user.\n\tDisplayServerElements(context.Context, *connect.Request[v1alpha1.DisplayServerElementsRequest]) (*connect.Response[v1alpha1.DisplayServerElementsResponse], error)\n\t// DisplayOwnerEntitledElements returns which owner elements are entitled to be displayed to the user.\n\tDisplayOwnerEntitledElements(context.Context, *connect.Request[v1alpha1.DisplayOwnerEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayOwnerEntitledElementsResponse], error)\n\t// DisplayRepositoryEntitledElements returns which repository elements are entitled to be displayed to the user.\n\tDisplayRepositoryEntitledElements(context.Context, *connect.Request[v1alpha1.DisplayRepositoryEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryEntitledElementsResponse], error)\n\t// ListManageableRepositoryRoles returns which roles should be displayed\n\t// to the user when they are managing contributors on the repository.\n\tListManageableRepositoryRoles(context.Context, *connect.Request[v1alpha1.ListManageableRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableRepositoryRolesResponse], error)\n\t// ListManageableUserRepositoryRoles returns which roles should be displayed\n\t// to the user when they are managing a specific contributor on the repository.\n\tListManageableUserRepositoryRoles(context.Context, *connect.Request[v1alpha1.ListManageableUserRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableUserRepositoryRolesResponse], error)\n}\n\n// NewDisplayServiceClient constructs a client for the buf.alpha.registry.v1alpha1.DisplayService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewDisplayServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DisplayServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tdisplayServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_display_proto.Services().ByName(\"DisplayService\").Methods()\n\treturn &displayServiceClient{\n\t\tdisplayOrganizationElements: connect.NewClient[v1alpha1.DisplayOrganizationElementsRequest, v1alpha1.DisplayOrganizationElementsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceDisplayOrganizationElementsProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayOrganizationElements\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdisplayRepositoryElements: connect.NewClient[v1alpha1.DisplayRepositoryElementsRequest, v1alpha1.DisplayRepositoryElementsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceDisplayRepositoryElementsProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayRepositoryElements\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdisplayPluginElements: connect.NewClient[v1alpha1.DisplayPluginElementsRequest, v1alpha1.DisplayPluginElementsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceDisplayPluginElementsProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayPluginElements\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdisplayUserElements: connect.NewClient[v1alpha1.DisplayUserElementsRequest, v1alpha1.DisplayUserElementsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceDisplayUserElementsProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayUserElements\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdisplayServerElements: connect.NewClient[v1alpha1.DisplayServerElementsRequest, v1alpha1.DisplayServerElementsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceDisplayServerElementsProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayServerElements\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdisplayOwnerEntitledElements: connect.NewClient[v1alpha1.DisplayOwnerEntitledElementsRequest, v1alpha1.DisplayOwnerEntitledElementsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceDisplayOwnerEntitledElementsProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayOwnerEntitledElements\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdisplayRepositoryEntitledElements: connect.NewClient[v1alpha1.DisplayRepositoryEntitledElementsRequest, v1alpha1.DisplayRepositoryEntitledElementsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceDisplayRepositoryEntitledElementsProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayRepositoryEntitledElements\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistManageableRepositoryRoles: connect.NewClient[v1alpha1.ListManageableRepositoryRolesRequest, v1alpha1.ListManageableRepositoryRolesResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceListManageableRepositoryRolesProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"ListManageableRepositoryRoles\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistManageableUserRepositoryRoles: connect.NewClient[v1alpha1.ListManageableUserRepositoryRolesRequest, v1alpha1.ListManageableUserRepositoryRolesResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DisplayServiceListManageableUserRepositoryRolesProcedure,\n\t\t\tconnect.WithSchema(displayServiceMethods.ByName(\"ListManageableUserRepositoryRoles\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// displayServiceClient implements DisplayServiceClient.\ntype displayServiceClient struct {\n\tdisplayOrganizationElements       *connect.Client[v1alpha1.DisplayOrganizationElementsRequest, v1alpha1.DisplayOrganizationElementsResponse]\n\tdisplayRepositoryElements         *connect.Client[v1alpha1.DisplayRepositoryElementsRequest, v1alpha1.DisplayRepositoryElementsResponse]\n\tdisplayPluginElements             *connect.Client[v1alpha1.DisplayPluginElementsRequest, v1alpha1.DisplayPluginElementsResponse]\n\tdisplayUserElements               *connect.Client[v1alpha1.DisplayUserElementsRequest, v1alpha1.DisplayUserElementsResponse]\n\tdisplayServerElements             *connect.Client[v1alpha1.DisplayServerElementsRequest, v1alpha1.DisplayServerElementsResponse]\n\tdisplayOwnerEntitledElements      *connect.Client[v1alpha1.DisplayOwnerEntitledElementsRequest, v1alpha1.DisplayOwnerEntitledElementsResponse]\n\tdisplayRepositoryEntitledElements *connect.Client[v1alpha1.DisplayRepositoryEntitledElementsRequest, v1alpha1.DisplayRepositoryEntitledElementsResponse]\n\tlistManageableRepositoryRoles     *connect.Client[v1alpha1.ListManageableRepositoryRolesRequest, v1alpha1.ListManageableRepositoryRolesResponse]\n\tlistManageableUserRepositoryRoles *connect.Client[v1alpha1.ListManageableUserRepositoryRolesRequest, v1alpha1.ListManageableUserRepositoryRolesResponse]\n}\n\n// DisplayOrganizationElements calls\n// buf.alpha.registry.v1alpha1.DisplayService.DisplayOrganizationElements.\nfunc (c *displayServiceClient) DisplayOrganizationElements(ctx context.Context, req *connect.Request[v1alpha1.DisplayOrganizationElementsRequest]) (*connect.Response[v1alpha1.DisplayOrganizationElementsResponse], error) {\n\treturn c.displayOrganizationElements.CallUnary(ctx, req)\n}\n\n// DisplayRepositoryElements calls\n// buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryElements.\nfunc (c *displayServiceClient) DisplayRepositoryElements(ctx context.Context, req *connect.Request[v1alpha1.DisplayRepositoryElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryElementsResponse], error) {\n\treturn c.displayRepositoryElements.CallUnary(ctx, req)\n}\n\n// DisplayPluginElements calls buf.alpha.registry.v1alpha1.DisplayService.DisplayPluginElements.\nfunc (c *displayServiceClient) DisplayPluginElements(ctx context.Context, req *connect.Request[v1alpha1.DisplayPluginElementsRequest]) (*connect.Response[v1alpha1.DisplayPluginElementsResponse], error) {\n\treturn c.displayPluginElements.CallUnary(ctx, req)\n}\n\n// DisplayUserElements calls buf.alpha.registry.v1alpha1.DisplayService.DisplayUserElements.\nfunc (c *displayServiceClient) DisplayUserElements(ctx context.Context, req *connect.Request[v1alpha1.DisplayUserElementsRequest]) (*connect.Response[v1alpha1.DisplayUserElementsResponse], error) {\n\treturn c.displayUserElements.CallUnary(ctx, req)\n}\n\n// DisplayServerElements calls buf.alpha.registry.v1alpha1.DisplayService.DisplayServerElements.\nfunc (c *displayServiceClient) DisplayServerElements(ctx context.Context, req *connect.Request[v1alpha1.DisplayServerElementsRequest]) (*connect.Response[v1alpha1.DisplayServerElementsResponse], error) {\n\treturn c.displayServerElements.CallUnary(ctx, req)\n}\n\n// DisplayOwnerEntitledElements calls\n// buf.alpha.registry.v1alpha1.DisplayService.DisplayOwnerEntitledElements.\nfunc (c *displayServiceClient) DisplayOwnerEntitledElements(ctx context.Context, req *connect.Request[v1alpha1.DisplayOwnerEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayOwnerEntitledElementsResponse], error) {\n\treturn c.displayOwnerEntitledElements.CallUnary(ctx, req)\n}\n\n// DisplayRepositoryEntitledElements calls\n// buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryEntitledElements.\nfunc (c *displayServiceClient) DisplayRepositoryEntitledElements(ctx context.Context, req *connect.Request[v1alpha1.DisplayRepositoryEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryEntitledElementsResponse], error) {\n\treturn c.displayRepositoryEntitledElements.CallUnary(ctx, req)\n}\n\n// ListManageableRepositoryRoles calls\n// buf.alpha.registry.v1alpha1.DisplayService.ListManageableRepositoryRoles.\nfunc (c *displayServiceClient) ListManageableRepositoryRoles(ctx context.Context, req *connect.Request[v1alpha1.ListManageableRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableRepositoryRolesResponse], error) {\n\treturn c.listManageableRepositoryRoles.CallUnary(ctx, req)\n}\n\n// ListManageableUserRepositoryRoles calls\n// buf.alpha.registry.v1alpha1.DisplayService.ListManageableUserRepositoryRoles.\nfunc (c *displayServiceClient) ListManageableUserRepositoryRoles(ctx context.Context, req *connect.Request[v1alpha1.ListManageableUserRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableUserRepositoryRolesResponse], error) {\n\treturn c.listManageableUserRepositoryRoles.CallUnary(ctx, req)\n}\n\n// DisplayServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.DisplayService\n// service.\ntype DisplayServiceHandler interface {\n\t// DisplayOrganizationElements returns which organization elements should be displayed to the user.\n\tDisplayOrganizationElements(context.Context, *connect.Request[v1alpha1.DisplayOrganizationElementsRequest]) (*connect.Response[v1alpha1.DisplayOrganizationElementsResponse], error)\n\t// DisplayRepositoryElements returns which repository elements should be displayed to the user.\n\tDisplayRepositoryElements(context.Context, *connect.Request[v1alpha1.DisplayRepositoryElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryElementsResponse], error)\n\t// DisplayPluginElements returns which plugin elements should be displayed to the user.\n\tDisplayPluginElements(context.Context, *connect.Request[v1alpha1.DisplayPluginElementsRequest]) (*connect.Response[v1alpha1.DisplayPluginElementsResponse], error)\n\t// DisplayUserElements returns which user elements should be displayed to the user.\n\tDisplayUserElements(context.Context, *connect.Request[v1alpha1.DisplayUserElementsRequest]) (*connect.Response[v1alpha1.DisplayUserElementsResponse], error)\n\t// DisplayServerElements returns which server elements should be displayed to the user.\n\tDisplayServerElements(context.Context, *connect.Request[v1alpha1.DisplayServerElementsRequest]) (*connect.Response[v1alpha1.DisplayServerElementsResponse], error)\n\t// DisplayOwnerEntitledElements returns which owner elements are entitled to be displayed to the user.\n\tDisplayOwnerEntitledElements(context.Context, *connect.Request[v1alpha1.DisplayOwnerEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayOwnerEntitledElementsResponse], error)\n\t// DisplayRepositoryEntitledElements returns which repository elements are entitled to be displayed to the user.\n\tDisplayRepositoryEntitledElements(context.Context, *connect.Request[v1alpha1.DisplayRepositoryEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryEntitledElementsResponse], error)\n\t// ListManageableRepositoryRoles returns which roles should be displayed\n\t// to the user when they are managing contributors on the repository.\n\tListManageableRepositoryRoles(context.Context, *connect.Request[v1alpha1.ListManageableRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableRepositoryRolesResponse], error)\n\t// ListManageableUserRepositoryRoles returns which roles should be displayed\n\t// to the user when they are managing a specific contributor on the repository.\n\tListManageableUserRepositoryRoles(context.Context, *connect.Request[v1alpha1.ListManageableUserRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableUserRepositoryRolesResponse], error)\n}\n\n// NewDisplayServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewDisplayServiceHandler(svc DisplayServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tdisplayServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_display_proto.Services().ByName(\"DisplayService\").Methods()\n\tdisplayServiceDisplayOrganizationElementsHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceDisplayOrganizationElementsProcedure,\n\t\tsvc.DisplayOrganizationElements,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayOrganizationElements\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceDisplayRepositoryElementsHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceDisplayRepositoryElementsProcedure,\n\t\tsvc.DisplayRepositoryElements,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayRepositoryElements\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceDisplayPluginElementsHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceDisplayPluginElementsProcedure,\n\t\tsvc.DisplayPluginElements,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayPluginElements\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceDisplayUserElementsHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceDisplayUserElementsProcedure,\n\t\tsvc.DisplayUserElements,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayUserElements\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceDisplayServerElementsHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceDisplayServerElementsProcedure,\n\t\tsvc.DisplayServerElements,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayServerElements\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceDisplayOwnerEntitledElementsHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceDisplayOwnerEntitledElementsProcedure,\n\t\tsvc.DisplayOwnerEntitledElements,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayOwnerEntitledElements\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceDisplayRepositoryEntitledElementsHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceDisplayRepositoryEntitledElementsProcedure,\n\t\tsvc.DisplayRepositoryEntitledElements,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"DisplayRepositoryEntitledElements\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceListManageableRepositoryRolesHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceListManageableRepositoryRolesProcedure,\n\t\tsvc.ListManageableRepositoryRoles,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"ListManageableRepositoryRoles\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdisplayServiceListManageableUserRepositoryRolesHandler := connect.NewUnaryHandler(\n\t\tDisplayServiceListManageableUserRepositoryRolesProcedure,\n\t\tsvc.ListManageableUserRepositoryRoles,\n\t\tconnect.WithSchema(displayServiceMethods.ByName(\"ListManageableUserRepositoryRoles\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.DisplayService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase DisplayServiceDisplayOrganizationElementsProcedure:\n\t\t\tdisplayServiceDisplayOrganizationElementsHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceDisplayRepositoryElementsProcedure:\n\t\t\tdisplayServiceDisplayRepositoryElementsHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceDisplayPluginElementsProcedure:\n\t\t\tdisplayServiceDisplayPluginElementsHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceDisplayUserElementsProcedure:\n\t\t\tdisplayServiceDisplayUserElementsHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceDisplayServerElementsProcedure:\n\t\t\tdisplayServiceDisplayServerElementsHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceDisplayOwnerEntitledElementsProcedure:\n\t\t\tdisplayServiceDisplayOwnerEntitledElementsHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceDisplayRepositoryEntitledElementsProcedure:\n\t\t\tdisplayServiceDisplayRepositoryEntitledElementsHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceListManageableRepositoryRolesProcedure:\n\t\t\tdisplayServiceListManageableRepositoryRolesHandler.ServeHTTP(w, r)\n\t\tcase DisplayServiceListManageableUserRepositoryRolesProcedure:\n\t\t\tdisplayServiceListManageableUserRepositoryRolesHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedDisplayServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedDisplayServiceHandler struct{}\n\nfunc (UnimplementedDisplayServiceHandler) DisplayOrganizationElements(context.Context, *connect.Request[v1alpha1.DisplayOrganizationElementsRequest]) (*connect.Response[v1alpha1.DisplayOrganizationElementsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.DisplayOrganizationElements is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) DisplayRepositoryElements(context.Context, *connect.Request[v1alpha1.DisplayRepositoryElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryElementsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryElements is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) DisplayPluginElements(context.Context, *connect.Request[v1alpha1.DisplayPluginElementsRequest]) (*connect.Response[v1alpha1.DisplayPluginElementsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.DisplayPluginElements is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) DisplayUserElements(context.Context, *connect.Request[v1alpha1.DisplayUserElementsRequest]) (*connect.Response[v1alpha1.DisplayUserElementsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.DisplayUserElements is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) DisplayServerElements(context.Context, *connect.Request[v1alpha1.DisplayServerElementsRequest]) (*connect.Response[v1alpha1.DisplayServerElementsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.DisplayServerElements is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) DisplayOwnerEntitledElements(context.Context, *connect.Request[v1alpha1.DisplayOwnerEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayOwnerEntitledElementsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.DisplayOwnerEntitledElements is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) DisplayRepositoryEntitledElements(context.Context, *connect.Request[v1alpha1.DisplayRepositoryEntitledElementsRequest]) (*connect.Response[v1alpha1.DisplayRepositoryEntitledElementsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryEntitledElements is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) ListManageableRepositoryRoles(context.Context, *connect.Request[v1alpha1.ListManageableRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableRepositoryRolesResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.ListManageableRepositoryRoles is not implemented\"))\n}\n\nfunc (UnimplementedDisplayServiceHandler) ListManageableUserRepositoryRoles(context.Context, *connect.Request[v1alpha1.ListManageableUserRepositoryRolesRequest]) (*connect.Response[v1alpha1.ListManageableUserRepositoryRolesResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DisplayService.ListManageableUserRepositoryRoles is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/doc.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/doc.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// DocServiceName is the fully-qualified name of the DocService service.\n\tDocServiceName = \"buf.alpha.registry.v1alpha1.DocService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// DocServiceGetSourceDirectoryInfoProcedure is the fully-qualified name of the DocService's\n\t// GetSourceDirectoryInfo RPC.\n\tDocServiceGetSourceDirectoryInfoProcedure = \"/buf.alpha.registry.v1alpha1.DocService/GetSourceDirectoryInfo\"\n\t// DocServiceGetSourceFileProcedure is the fully-qualified name of the DocService's GetSourceFile\n\t// RPC.\n\tDocServiceGetSourceFileProcedure = \"/buf.alpha.registry.v1alpha1.DocService/GetSourceFile\"\n\t// DocServiceGetModulePackagesProcedure is the fully-qualified name of the DocService's\n\t// GetModulePackages RPC.\n\tDocServiceGetModulePackagesProcedure = \"/buf.alpha.registry.v1alpha1.DocService/GetModulePackages\"\n\t// DocServiceGetModuleDocumentationProcedure is the fully-qualified name of the DocService's\n\t// GetModuleDocumentation RPC.\n\tDocServiceGetModuleDocumentationProcedure = \"/buf.alpha.registry.v1alpha1.DocService/GetModuleDocumentation\"\n\t// DocServiceGetPackageDocumentationProcedure is the fully-qualified name of the DocService's\n\t// GetPackageDocumentation RPC.\n\tDocServiceGetPackageDocumentationProcedure = \"/buf.alpha.registry.v1alpha1.DocService/GetPackageDocumentation\"\n)\n\n// DocServiceClient is a client for the buf.alpha.registry.v1alpha1.DocService service.\ntype DocServiceClient interface {\n\t// GetSourceDirectoryInfo retrieves the directory and file structure for the\n\t// given owner, repository and reference.\n\t//\n\t// The purpose of this is to get a representation of the file tree for a given\n\t// module to enable exploring the module by navigating through its contents.\n\tGetSourceDirectoryInfo(context.Context, *connect.Request[v1alpha1.GetSourceDirectoryInfoRequest]) (*connect.Response[v1alpha1.GetSourceDirectoryInfoResponse], error)\n\t// GetSourceFile retrieves the source contents for the given owner, repository,\n\t// reference, and path.\n\tGetSourceFile(context.Context, *connect.Request[v1alpha1.GetSourceFileRequest]) (*connect.Response[v1alpha1.GetSourceFileResponse], error)\n\t// GetModulePackages retrieves the list of packages for the module based on the given\n\t// owner, repository, and reference.\n\tGetModulePackages(context.Context, *connect.Request[v1alpha1.GetModulePackagesRequest]) (*connect.Response[v1alpha1.GetModulePackagesResponse], error)\n\t// GetModuleDocumentation retrieves the documentations including buf.md and LICENSE files\n\t// for module based on the given owner, repository, and reference.\n\tGetModuleDocumentation(context.Context, *connect.Request[v1alpha1.GetModuleDocumentationRequest]) (*connect.Response[v1alpha1.GetModuleDocumentationResponse], error)\n\t// GetPackageDocumentation retrieves a a slice of documentation structures\n\t// for the given owner, repository, reference, and package name.\n\tGetPackageDocumentation(context.Context, *connect.Request[v1alpha1.GetPackageDocumentationRequest]) (*connect.Response[v1alpha1.GetPackageDocumentationResponse], error)\n}\n\n// NewDocServiceClient constructs a client for the buf.alpha.registry.v1alpha1.DocService service.\n// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped\n// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the\n// connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewDocServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DocServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tdocServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_doc_proto.Services().ByName(\"DocService\").Methods()\n\treturn &docServiceClient{\n\t\tgetSourceDirectoryInfo: connect.NewClient[v1alpha1.GetSourceDirectoryInfoRequest, v1alpha1.GetSourceDirectoryInfoResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DocServiceGetSourceDirectoryInfoProcedure,\n\t\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetSourceDirectoryInfo\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetSourceFile: connect.NewClient[v1alpha1.GetSourceFileRequest, v1alpha1.GetSourceFileResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DocServiceGetSourceFileProcedure,\n\t\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetSourceFile\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetModulePackages: connect.NewClient[v1alpha1.GetModulePackagesRequest, v1alpha1.GetModulePackagesResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DocServiceGetModulePackagesProcedure,\n\t\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetModulePackages\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetModuleDocumentation: connect.NewClient[v1alpha1.GetModuleDocumentationRequest, v1alpha1.GetModuleDocumentationResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DocServiceGetModuleDocumentationProcedure,\n\t\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetModuleDocumentation\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetPackageDocumentation: connect.NewClient[v1alpha1.GetPackageDocumentationRequest, v1alpha1.GetPackageDocumentationResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DocServiceGetPackageDocumentationProcedure,\n\t\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetPackageDocumentation\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// docServiceClient implements DocServiceClient.\ntype docServiceClient struct {\n\tgetSourceDirectoryInfo  *connect.Client[v1alpha1.GetSourceDirectoryInfoRequest, v1alpha1.GetSourceDirectoryInfoResponse]\n\tgetSourceFile           *connect.Client[v1alpha1.GetSourceFileRequest, v1alpha1.GetSourceFileResponse]\n\tgetModulePackages       *connect.Client[v1alpha1.GetModulePackagesRequest, v1alpha1.GetModulePackagesResponse]\n\tgetModuleDocumentation  *connect.Client[v1alpha1.GetModuleDocumentationRequest, v1alpha1.GetModuleDocumentationResponse]\n\tgetPackageDocumentation *connect.Client[v1alpha1.GetPackageDocumentationRequest, v1alpha1.GetPackageDocumentationResponse]\n}\n\n// GetSourceDirectoryInfo calls buf.alpha.registry.v1alpha1.DocService.GetSourceDirectoryInfo.\nfunc (c *docServiceClient) GetSourceDirectoryInfo(ctx context.Context, req *connect.Request[v1alpha1.GetSourceDirectoryInfoRequest]) (*connect.Response[v1alpha1.GetSourceDirectoryInfoResponse], error) {\n\treturn c.getSourceDirectoryInfo.CallUnary(ctx, req)\n}\n\n// GetSourceFile calls buf.alpha.registry.v1alpha1.DocService.GetSourceFile.\nfunc (c *docServiceClient) GetSourceFile(ctx context.Context, req *connect.Request[v1alpha1.GetSourceFileRequest]) (*connect.Response[v1alpha1.GetSourceFileResponse], error) {\n\treturn c.getSourceFile.CallUnary(ctx, req)\n}\n\n// GetModulePackages calls buf.alpha.registry.v1alpha1.DocService.GetModulePackages.\nfunc (c *docServiceClient) GetModulePackages(ctx context.Context, req *connect.Request[v1alpha1.GetModulePackagesRequest]) (*connect.Response[v1alpha1.GetModulePackagesResponse], error) {\n\treturn c.getModulePackages.CallUnary(ctx, req)\n}\n\n// GetModuleDocumentation calls buf.alpha.registry.v1alpha1.DocService.GetModuleDocumentation.\nfunc (c *docServiceClient) GetModuleDocumentation(ctx context.Context, req *connect.Request[v1alpha1.GetModuleDocumentationRequest]) (*connect.Response[v1alpha1.GetModuleDocumentationResponse], error) {\n\treturn c.getModuleDocumentation.CallUnary(ctx, req)\n}\n\n// GetPackageDocumentation calls buf.alpha.registry.v1alpha1.DocService.GetPackageDocumentation.\nfunc (c *docServiceClient) GetPackageDocumentation(ctx context.Context, req *connect.Request[v1alpha1.GetPackageDocumentationRequest]) (*connect.Response[v1alpha1.GetPackageDocumentationResponse], error) {\n\treturn c.getPackageDocumentation.CallUnary(ctx, req)\n}\n\n// DocServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.DocService service.\ntype DocServiceHandler interface {\n\t// GetSourceDirectoryInfo retrieves the directory and file structure for the\n\t// given owner, repository and reference.\n\t//\n\t// The purpose of this is to get a representation of the file tree for a given\n\t// module to enable exploring the module by navigating through its contents.\n\tGetSourceDirectoryInfo(context.Context, *connect.Request[v1alpha1.GetSourceDirectoryInfoRequest]) (*connect.Response[v1alpha1.GetSourceDirectoryInfoResponse], error)\n\t// GetSourceFile retrieves the source contents for the given owner, repository,\n\t// reference, and path.\n\tGetSourceFile(context.Context, *connect.Request[v1alpha1.GetSourceFileRequest]) (*connect.Response[v1alpha1.GetSourceFileResponse], error)\n\t// GetModulePackages retrieves the list of packages for the module based on the given\n\t// owner, repository, and reference.\n\tGetModulePackages(context.Context, *connect.Request[v1alpha1.GetModulePackagesRequest]) (*connect.Response[v1alpha1.GetModulePackagesResponse], error)\n\t// GetModuleDocumentation retrieves the documentations including buf.md and LICENSE files\n\t// for module based on the given owner, repository, and reference.\n\tGetModuleDocumentation(context.Context, *connect.Request[v1alpha1.GetModuleDocumentationRequest]) (*connect.Response[v1alpha1.GetModuleDocumentationResponse], error)\n\t// GetPackageDocumentation retrieves a a slice of documentation structures\n\t// for the given owner, repository, reference, and package name.\n\tGetPackageDocumentation(context.Context, *connect.Request[v1alpha1.GetPackageDocumentationRequest]) (*connect.Response[v1alpha1.GetPackageDocumentationResponse], error)\n}\n\n// NewDocServiceHandler builds an HTTP handler from the service implementation. It returns the path\n// on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewDocServiceHandler(svc DocServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tdocServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_doc_proto.Services().ByName(\"DocService\").Methods()\n\tdocServiceGetSourceDirectoryInfoHandler := connect.NewUnaryHandler(\n\t\tDocServiceGetSourceDirectoryInfoProcedure,\n\t\tsvc.GetSourceDirectoryInfo,\n\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetSourceDirectoryInfo\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdocServiceGetSourceFileHandler := connect.NewUnaryHandler(\n\t\tDocServiceGetSourceFileProcedure,\n\t\tsvc.GetSourceFile,\n\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetSourceFile\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdocServiceGetModulePackagesHandler := connect.NewUnaryHandler(\n\t\tDocServiceGetModulePackagesProcedure,\n\t\tsvc.GetModulePackages,\n\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetModulePackages\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdocServiceGetModuleDocumentationHandler := connect.NewUnaryHandler(\n\t\tDocServiceGetModuleDocumentationProcedure,\n\t\tsvc.GetModuleDocumentation,\n\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetModuleDocumentation\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdocServiceGetPackageDocumentationHandler := connect.NewUnaryHandler(\n\t\tDocServiceGetPackageDocumentationProcedure,\n\t\tsvc.GetPackageDocumentation,\n\t\tconnect.WithSchema(docServiceMethods.ByName(\"GetPackageDocumentation\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.DocService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase DocServiceGetSourceDirectoryInfoProcedure:\n\t\t\tdocServiceGetSourceDirectoryInfoHandler.ServeHTTP(w, r)\n\t\tcase DocServiceGetSourceFileProcedure:\n\t\t\tdocServiceGetSourceFileHandler.ServeHTTP(w, r)\n\t\tcase DocServiceGetModulePackagesProcedure:\n\t\t\tdocServiceGetModulePackagesHandler.ServeHTTP(w, r)\n\t\tcase DocServiceGetModuleDocumentationProcedure:\n\t\t\tdocServiceGetModuleDocumentationHandler.ServeHTTP(w, r)\n\t\tcase DocServiceGetPackageDocumentationProcedure:\n\t\t\tdocServiceGetPackageDocumentationHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedDocServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedDocServiceHandler struct{}\n\nfunc (UnimplementedDocServiceHandler) GetSourceDirectoryInfo(context.Context, *connect.Request[v1alpha1.GetSourceDirectoryInfoRequest]) (*connect.Response[v1alpha1.GetSourceDirectoryInfoResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DocService.GetSourceDirectoryInfo is not implemented\"))\n}\n\nfunc (UnimplementedDocServiceHandler) GetSourceFile(context.Context, *connect.Request[v1alpha1.GetSourceFileRequest]) (*connect.Response[v1alpha1.GetSourceFileResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DocService.GetSourceFile is not implemented\"))\n}\n\nfunc (UnimplementedDocServiceHandler) GetModulePackages(context.Context, *connect.Request[v1alpha1.GetModulePackagesRequest]) (*connect.Response[v1alpha1.GetModulePackagesResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DocService.GetModulePackages is not implemented\"))\n}\n\nfunc (UnimplementedDocServiceHandler) GetModuleDocumentation(context.Context, *connect.Request[v1alpha1.GetModuleDocumentationRequest]) (*connect.Response[v1alpha1.GetModuleDocumentationResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DocService.GetModuleDocumentation is not implemented\"))\n}\n\nfunc (UnimplementedDocServiceHandler) GetPackageDocumentation(context.Context, *connect.Request[v1alpha1.GetPackageDocumentationRequest]) (*connect.Response[v1alpha1.GetPackageDocumentationResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DocService.GetPackageDocumentation is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/download.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/download.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// DownloadServiceName is the fully-qualified name of the DownloadService service.\n\tDownloadServiceName = \"buf.alpha.registry.v1alpha1.DownloadService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// DownloadServiceDownloadProcedure is the fully-qualified name of the DownloadService's Download\n\t// RPC.\n\tDownloadServiceDownloadProcedure = \"/buf.alpha.registry.v1alpha1.DownloadService/Download\"\n\t// DownloadServiceDownloadManifestAndBlobsProcedure is the fully-qualified name of the\n\t// DownloadService's DownloadManifestAndBlobs RPC.\n\tDownloadServiceDownloadManifestAndBlobsProcedure = \"/buf.alpha.registry.v1alpha1.DownloadService/DownloadManifestAndBlobs\"\n)\n\n// DownloadServiceClient is a client for the buf.alpha.registry.v1alpha1.DownloadService service.\ntype DownloadServiceClient interface {\n\t// Download downloads a BSR module.\n\t// NOTE: Newer clients should use DownloadManifestAndBlobs instead.\n\tDownload(context.Context, *connect.Request[v1alpha1.DownloadRequest]) (*connect.Response[v1alpha1.DownloadResponse], error)\n\t// DownloadManifestAndBlobs downloads a module in the manifest+blobs encoding format.\n\tDownloadManifestAndBlobs(context.Context, *connect.Request[v1alpha1.DownloadManifestAndBlobsRequest]) (*connect.Response[v1alpha1.DownloadManifestAndBlobsResponse], error)\n}\n\n// NewDownloadServiceClient constructs a client for the buf.alpha.registry.v1alpha1.DownloadService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewDownloadServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) DownloadServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tdownloadServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_download_proto.Services().ByName(\"DownloadService\").Methods()\n\treturn &downloadServiceClient{\n\t\tdownload: connect.NewClient[v1alpha1.DownloadRequest, v1alpha1.DownloadResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DownloadServiceDownloadProcedure,\n\t\t\tconnect.WithSchema(downloadServiceMethods.ByName(\"Download\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdownloadManifestAndBlobs: connect.NewClient[v1alpha1.DownloadManifestAndBlobsRequest, v1alpha1.DownloadManifestAndBlobsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+DownloadServiceDownloadManifestAndBlobsProcedure,\n\t\t\tconnect.WithSchema(downloadServiceMethods.ByName(\"DownloadManifestAndBlobs\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// downloadServiceClient implements DownloadServiceClient.\ntype downloadServiceClient struct {\n\tdownload                 *connect.Client[v1alpha1.DownloadRequest, v1alpha1.DownloadResponse]\n\tdownloadManifestAndBlobs *connect.Client[v1alpha1.DownloadManifestAndBlobsRequest, v1alpha1.DownloadManifestAndBlobsResponse]\n}\n\n// Download calls buf.alpha.registry.v1alpha1.DownloadService.Download.\nfunc (c *downloadServiceClient) Download(ctx context.Context, req *connect.Request[v1alpha1.DownloadRequest]) (*connect.Response[v1alpha1.DownloadResponse], error) {\n\treturn c.download.CallUnary(ctx, req)\n}\n\n// DownloadManifestAndBlobs calls\n// buf.alpha.registry.v1alpha1.DownloadService.DownloadManifestAndBlobs.\nfunc (c *downloadServiceClient) DownloadManifestAndBlobs(ctx context.Context, req *connect.Request[v1alpha1.DownloadManifestAndBlobsRequest]) (*connect.Response[v1alpha1.DownloadManifestAndBlobsResponse], error) {\n\treturn c.downloadManifestAndBlobs.CallUnary(ctx, req)\n}\n\n// DownloadServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.DownloadService\n// service.\ntype DownloadServiceHandler interface {\n\t// Download downloads a BSR module.\n\t// NOTE: Newer clients should use DownloadManifestAndBlobs instead.\n\tDownload(context.Context, *connect.Request[v1alpha1.DownloadRequest]) (*connect.Response[v1alpha1.DownloadResponse], error)\n\t// DownloadManifestAndBlobs downloads a module in the manifest+blobs encoding format.\n\tDownloadManifestAndBlobs(context.Context, *connect.Request[v1alpha1.DownloadManifestAndBlobsRequest]) (*connect.Response[v1alpha1.DownloadManifestAndBlobsResponse], error)\n}\n\n// NewDownloadServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewDownloadServiceHandler(svc DownloadServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tdownloadServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_download_proto.Services().ByName(\"DownloadService\").Methods()\n\tdownloadServiceDownloadHandler := connect.NewUnaryHandler(\n\t\tDownloadServiceDownloadProcedure,\n\t\tsvc.Download,\n\t\tconnect.WithSchema(downloadServiceMethods.ByName(\"Download\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tdownloadServiceDownloadManifestAndBlobsHandler := connect.NewUnaryHandler(\n\t\tDownloadServiceDownloadManifestAndBlobsProcedure,\n\t\tsvc.DownloadManifestAndBlobs,\n\t\tconnect.WithSchema(downloadServiceMethods.ByName(\"DownloadManifestAndBlobs\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.DownloadService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase DownloadServiceDownloadProcedure:\n\t\t\tdownloadServiceDownloadHandler.ServeHTTP(w, r)\n\t\tcase DownloadServiceDownloadManifestAndBlobsProcedure:\n\t\t\tdownloadServiceDownloadManifestAndBlobsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedDownloadServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedDownloadServiceHandler struct{}\n\nfunc (UnimplementedDownloadServiceHandler) Download(context.Context, *connect.Request[v1alpha1.DownloadRequest]) (*connect.Response[v1alpha1.DownloadResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DownloadService.Download is not implemented\"))\n}\n\nfunc (UnimplementedDownloadServiceHandler) DownloadManifestAndBlobs(context.Context, *connect.Request[v1alpha1.DownloadManifestAndBlobsRequest]) (*connect.Response[v1alpha1.DownloadManifestAndBlobsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.DownloadService.DownloadManifestAndBlobs is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/github.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/github.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// GithubServiceName is the fully-qualified name of the GithubService service.\n\tGithubServiceName = \"buf.alpha.registry.v1alpha1.GithubService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// GithubServiceGetGithubAppConfigProcedure is the fully-qualified name of the GithubService's\n\t// GetGithubAppConfig RPC.\n\tGithubServiceGetGithubAppConfigProcedure = \"/buf.alpha.registry.v1alpha1.GithubService/GetGithubAppConfig\"\n)\n\n// GithubServiceClient is a client for the buf.alpha.registry.v1alpha1.GithubService service.\ntype GithubServiceClient interface {\n\t// GetGithubAppConfig returns a Github Application Configuration.\n\tGetGithubAppConfig(context.Context, *connect.Request[v1alpha1.GetGithubAppConfigRequest]) (*connect.Response[v1alpha1.GetGithubAppConfigResponse], error)\n}\n\n// NewGithubServiceClient constructs a client for the buf.alpha.registry.v1alpha1.GithubService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewGithubServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) GithubServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tgithubServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_github_proto.Services().ByName(\"GithubService\").Methods()\n\treturn &githubServiceClient{\n\t\tgetGithubAppConfig: connect.NewClient[v1alpha1.GetGithubAppConfigRequest, v1alpha1.GetGithubAppConfigResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+GithubServiceGetGithubAppConfigProcedure,\n\t\t\tconnect.WithSchema(githubServiceMethods.ByName(\"GetGithubAppConfig\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// githubServiceClient implements GithubServiceClient.\ntype githubServiceClient struct {\n\tgetGithubAppConfig *connect.Client[v1alpha1.GetGithubAppConfigRequest, v1alpha1.GetGithubAppConfigResponse]\n}\n\n// GetGithubAppConfig calls buf.alpha.registry.v1alpha1.GithubService.GetGithubAppConfig.\nfunc (c *githubServiceClient) GetGithubAppConfig(ctx context.Context, req *connect.Request[v1alpha1.GetGithubAppConfigRequest]) (*connect.Response[v1alpha1.GetGithubAppConfigResponse], error) {\n\treturn c.getGithubAppConfig.CallUnary(ctx, req)\n}\n\n// GithubServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.GithubService\n// service.\ntype GithubServiceHandler interface {\n\t// GetGithubAppConfig returns a Github Application Configuration.\n\tGetGithubAppConfig(context.Context, *connect.Request[v1alpha1.GetGithubAppConfigRequest]) (*connect.Response[v1alpha1.GetGithubAppConfigResponse], error)\n}\n\n// NewGithubServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewGithubServiceHandler(svc GithubServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tgithubServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_github_proto.Services().ByName(\"GithubService\").Methods()\n\tgithubServiceGetGithubAppConfigHandler := connect.NewUnaryHandler(\n\t\tGithubServiceGetGithubAppConfigProcedure,\n\t\tsvc.GetGithubAppConfig,\n\t\tconnect.WithSchema(githubServiceMethods.ByName(\"GetGithubAppConfig\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.GithubService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase GithubServiceGetGithubAppConfigProcedure:\n\t\t\tgithubServiceGetGithubAppConfigHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedGithubServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedGithubServiceHandler struct{}\n\nfunc (UnimplementedGithubServiceHandler) GetGithubAppConfig(context.Context, *connect.Request[v1alpha1.GetGithubAppConfigRequest]) (*connect.Response[v1alpha1.GetGithubAppConfigResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.GithubService.GetGithubAppConfig is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/image.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/image.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// ImageServiceName is the fully-qualified name of the ImageService service.\n\tImageServiceName = \"buf.alpha.registry.v1alpha1.ImageService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// ImageServiceGetImageProcedure is the fully-qualified name of the ImageService's GetImage RPC.\n\tImageServiceGetImageProcedure = \"/buf.alpha.registry.v1alpha1.ImageService/GetImage\"\n)\n\n// ImageServiceClient is a client for the buf.alpha.registry.v1alpha1.ImageService service.\ntype ImageServiceClient interface {\n\t// GetImage serves a compiled image for the local module. It automatically\n\t// downloads dependencies if necessary.\n\tGetImage(context.Context, *connect.Request[v1alpha1.GetImageRequest]) (*connect.Response[v1alpha1.GetImageResponse], error)\n}\n\n// NewImageServiceClient constructs a client for the buf.alpha.registry.v1alpha1.ImageService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewImageServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ImageServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\timageServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_image_proto.Services().ByName(\"ImageService\").Methods()\n\treturn &imageServiceClient{\n\t\tgetImage: connect.NewClient[v1alpha1.GetImageRequest, v1alpha1.GetImageResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ImageServiceGetImageProcedure,\n\t\t\tconnect.WithSchema(imageServiceMethods.ByName(\"GetImage\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// imageServiceClient implements ImageServiceClient.\ntype imageServiceClient struct {\n\tgetImage *connect.Client[v1alpha1.GetImageRequest, v1alpha1.GetImageResponse]\n}\n\n// GetImage calls buf.alpha.registry.v1alpha1.ImageService.GetImage.\nfunc (c *imageServiceClient) GetImage(ctx context.Context, req *connect.Request[v1alpha1.GetImageRequest]) (*connect.Response[v1alpha1.GetImageResponse], error) {\n\treturn c.getImage.CallUnary(ctx, req)\n}\n\n// ImageServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.ImageService service.\ntype ImageServiceHandler interface {\n\t// GetImage serves a compiled image for the local module. It automatically\n\t// downloads dependencies if necessary.\n\tGetImage(context.Context, *connect.Request[v1alpha1.GetImageRequest]) (*connect.Response[v1alpha1.GetImageResponse], error)\n}\n\n// NewImageServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewImageServiceHandler(svc ImageServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\timageServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_image_proto.Services().ByName(\"ImageService\").Methods()\n\timageServiceGetImageHandler := connect.NewUnaryHandler(\n\t\tImageServiceGetImageProcedure,\n\t\tsvc.GetImage,\n\t\tconnect.WithSchema(imageServiceMethods.ByName(\"GetImage\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.ImageService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase ImageServiceGetImageProcedure:\n\t\t\timageServiceGetImageHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedImageServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedImageServiceHandler struct{}\n\nfunc (UnimplementedImageServiceHandler) GetImage(context.Context, *connect.Request[v1alpha1.GetImageRequest]) (*connect.Response[v1alpha1.GetImageResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ImageService.GetImage is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/jsonschema.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/jsonschema.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// JSONSchemaServiceName is the fully-qualified name of the JSONSchemaService service.\n\tJSONSchemaServiceName = \"buf.alpha.registry.v1alpha1.JSONSchemaService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// JSONSchemaServiceGetJSONSchemaProcedure is the fully-qualified name of the JSONSchemaService's\n\t// GetJSONSchema RPC.\n\tJSONSchemaServiceGetJSONSchemaProcedure = \"/buf.alpha.registry.v1alpha1.JSONSchemaService/GetJSONSchema\"\n)\n\n// JSONSchemaServiceClient is a client for the buf.alpha.registry.v1alpha1.JSONSchemaService\n// service.\ntype JSONSchemaServiceClient interface {\n\t// GetJSONSchema allows users to get an (approximate) json schema for a\n\t// protobuf type.\n\tGetJSONSchema(context.Context, *connect.Request[v1alpha1.GetJSONSchemaRequest]) (*connect.Response[v1alpha1.GetJSONSchemaResponse], error)\n}\n\n// NewJSONSchemaServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.JSONSchemaService service. By default, it uses the Connect protocol\n// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To\n// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()\n// options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewJSONSchemaServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) JSONSchemaServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tjSONSchemaServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_jsonschema_proto.Services().ByName(\"JSONSchemaService\").Methods()\n\treturn &jSONSchemaServiceClient{\n\t\tgetJSONSchema: connect.NewClient[v1alpha1.GetJSONSchemaRequest, v1alpha1.GetJSONSchemaResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+JSONSchemaServiceGetJSONSchemaProcedure,\n\t\t\tconnect.WithSchema(jSONSchemaServiceMethods.ByName(\"GetJSONSchema\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// jSONSchemaServiceClient implements JSONSchemaServiceClient.\ntype jSONSchemaServiceClient struct {\n\tgetJSONSchema *connect.Client[v1alpha1.GetJSONSchemaRequest, v1alpha1.GetJSONSchemaResponse]\n}\n\n// GetJSONSchema calls buf.alpha.registry.v1alpha1.JSONSchemaService.GetJSONSchema.\nfunc (c *jSONSchemaServiceClient) GetJSONSchema(ctx context.Context, req *connect.Request[v1alpha1.GetJSONSchemaRequest]) (*connect.Response[v1alpha1.GetJSONSchemaResponse], error) {\n\treturn c.getJSONSchema.CallUnary(ctx, req)\n}\n\n// JSONSchemaServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.JSONSchemaService service.\ntype JSONSchemaServiceHandler interface {\n\t// GetJSONSchema allows users to get an (approximate) json schema for a\n\t// protobuf type.\n\tGetJSONSchema(context.Context, *connect.Request[v1alpha1.GetJSONSchemaRequest]) (*connect.Response[v1alpha1.GetJSONSchemaResponse], error)\n}\n\n// NewJSONSchemaServiceHandler builds an HTTP handler from the service implementation. It returns\n// the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewJSONSchemaServiceHandler(svc JSONSchemaServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tjSONSchemaServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_jsonschema_proto.Services().ByName(\"JSONSchemaService\").Methods()\n\tjSONSchemaServiceGetJSONSchemaHandler := connect.NewUnaryHandler(\n\t\tJSONSchemaServiceGetJSONSchemaProcedure,\n\t\tsvc.GetJSONSchema,\n\t\tconnect.WithSchema(jSONSchemaServiceMethods.ByName(\"GetJSONSchema\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.JSONSchemaService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase JSONSchemaServiceGetJSONSchemaProcedure:\n\t\t\tjSONSchemaServiceGetJSONSchemaHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedJSONSchemaServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedJSONSchemaServiceHandler struct{}\n\nfunc (UnimplementedJSONSchemaServiceHandler) GetJSONSchema(context.Context, *connect.Request[v1alpha1.GetJSONSchemaRequest]) (*connect.Response[v1alpha1.GetJSONSchemaResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.JSONSchemaService.GetJSONSchema is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/organization.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/organization.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// OrganizationServiceName is the fully-qualified name of the OrganizationService service.\n\tOrganizationServiceName = \"buf.alpha.registry.v1alpha1.OrganizationService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// OrganizationServiceGetOrganizationProcedure is the fully-qualified name of the\n\t// OrganizationService's GetOrganization RPC.\n\tOrganizationServiceGetOrganizationProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/GetOrganization\"\n\t// OrganizationServiceGetOrganizationByNameProcedure is the fully-qualified name of the\n\t// OrganizationService's GetOrganizationByName RPC.\n\tOrganizationServiceGetOrganizationByNameProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/GetOrganizationByName\"\n\t// OrganizationServiceListOrganizationsProcedure is the fully-qualified name of the\n\t// OrganizationService's ListOrganizations RPC.\n\tOrganizationServiceListOrganizationsProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/ListOrganizations\"\n\t// OrganizationServiceListUserOrganizationsProcedure is the fully-qualified name of the\n\t// OrganizationService's ListUserOrganizations RPC.\n\tOrganizationServiceListUserOrganizationsProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/ListUserOrganizations\"\n\t// OrganizationServiceGetUserOrganizationProcedure is the fully-qualified name of the\n\t// OrganizationService's GetUserOrganization RPC.\n\tOrganizationServiceGetUserOrganizationProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/GetUserOrganization\"\n\t// OrganizationServiceCreateOrganizationProcedure is the fully-qualified name of the\n\t// OrganizationService's CreateOrganization RPC.\n\tOrganizationServiceCreateOrganizationProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/CreateOrganization\"\n\t// OrganizationServiceDeleteOrganizationProcedure is the fully-qualified name of the\n\t// OrganizationService's DeleteOrganization RPC.\n\tOrganizationServiceDeleteOrganizationProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/DeleteOrganization\"\n\t// OrganizationServiceDeleteOrganizationByNameProcedure is the fully-qualified name of the\n\t// OrganizationService's DeleteOrganizationByName RPC.\n\tOrganizationServiceDeleteOrganizationByNameProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/DeleteOrganizationByName\"\n\t// OrganizationServiceAddOrganizationMemberProcedure is the fully-qualified name of the\n\t// OrganizationService's AddOrganizationMember RPC.\n\tOrganizationServiceAddOrganizationMemberProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/AddOrganizationMember\"\n\t// OrganizationServiceUpdateOrganizationMemberProcedure is the fully-qualified name of the\n\t// OrganizationService's UpdateOrganizationMember RPC.\n\tOrganizationServiceUpdateOrganizationMemberProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/UpdateOrganizationMember\"\n\t// OrganizationServiceRemoveOrganizationMemberProcedure is the fully-qualified name of the\n\t// OrganizationService's RemoveOrganizationMember RPC.\n\tOrganizationServiceRemoveOrganizationMemberProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/RemoveOrganizationMember\"\n\t// OrganizationServiceGetOrganizationSettingsProcedure is the fully-qualified name of the\n\t// OrganizationService's GetOrganizationSettings RPC.\n\tOrganizationServiceGetOrganizationSettingsProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/GetOrganizationSettings\"\n\t// OrganizationServiceUpdateOrganizationSettingsProcedure is the fully-qualified name of the\n\t// OrganizationService's UpdateOrganizationSettings RPC.\n\tOrganizationServiceUpdateOrganizationSettingsProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/UpdateOrganizationSettings\"\n\t// OrganizationServiceAddOrganizationGroupProcedure is the fully-qualified name of the\n\t// OrganizationService's AddOrganizationGroup RPC.\n\tOrganizationServiceAddOrganizationGroupProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/AddOrganizationGroup\"\n\t// OrganizationServiceUpdateOrganizationGroupProcedure is the fully-qualified name of the\n\t// OrganizationService's UpdateOrganizationGroup RPC.\n\tOrganizationServiceUpdateOrganizationGroupProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/UpdateOrganizationGroup\"\n\t// OrganizationServiceRemoveOrganizationGroupProcedure is the fully-qualified name of the\n\t// OrganizationService's RemoveOrganizationGroup RPC.\n\tOrganizationServiceRemoveOrganizationGroupProcedure = \"/buf.alpha.registry.v1alpha1.OrganizationService/RemoveOrganizationGroup\"\n)\n\n// OrganizationServiceClient is a client for the buf.alpha.registry.v1alpha1.OrganizationService\n// service.\ntype OrganizationServiceClient interface {\n\t// GetOrganization gets a organization by ID.\n\tGetOrganization(context.Context, *connect.Request[v1alpha1.GetOrganizationRequest]) (*connect.Response[v1alpha1.GetOrganizationResponse], error)\n\t// GetOrganizationByName gets a organization by name.\n\tGetOrganizationByName(context.Context, *connect.Request[v1alpha1.GetOrganizationByNameRequest]) (*connect.Response[v1alpha1.GetOrganizationByNameResponse], error)\n\t// ListOrganizations lists all organizations.\n\tListOrganizations(context.Context, *connect.Request[v1alpha1.ListOrganizationsRequest]) (*connect.Response[v1alpha1.ListOrganizationsResponse], error)\n\t// ListUserOrganizations lists all organizations a user is member of.\n\tListUserOrganizations(context.Context, *connect.Request[v1alpha1.ListUserOrganizationsRequest]) (*connect.Response[v1alpha1.ListUserOrganizationsResponse], error)\n\tGetUserOrganization(context.Context, *connect.Request[v1alpha1.GetUserOrganizationRequest]) (*connect.Response[v1alpha1.GetUserOrganizationResponse], error)\n\t// CreateOrganization creates a new organization.\n\tCreateOrganization(context.Context, *connect.Request[v1alpha1.CreateOrganizationRequest]) (*connect.Response[v1alpha1.CreateOrganizationResponse], error)\n\t// DeleteOrganization deletes a organization.\n\tDeleteOrganization(context.Context, *connect.Request[v1alpha1.DeleteOrganizationRequest]) (*connect.Response[v1alpha1.DeleteOrganizationResponse], error)\n\t// DeleteOrganizationByName deletes a organization by name.\n\tDeleteOrganizationByName(context.Context, *connect.Request[v1alpha1.DeleteOrganizationByNameRequest]) (*connect.Response[v1alpha1.DeleteOrganizationByNameResponse], error)\n\t// AddOrganizationMember add a role to an user in the organization.\n\tAddOrganizationMember(context.Context, *connect.Request[v1alpha1.AddOrganizationMemberRequest]) (*connect.Response[v1alpha1.AddOrganizationMemberResponse], error)\n\t// UpdateOrganizationMember update the user's membership information in the organization.\n\tUpdateOrganizationMember(context.Context, *connect.Request[v1alpha1.UpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UpdateOrganizationMemberResponse], error)\n\t// RemoveOrganizationMember remove the role of an user in the organization.\n\tRemoveOrganizationMember(context.Context, *connect.Request[v1alpha1.RemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.RemoveOrganizationMemberResponse], error)\n\t// GetOrganizationSettings gets the settings of an organization, including organization base roles.\n\tGetOrganizationSettings(context.Context, *connect.Request[v1alpha1.GetOrganizationSettingsRequest]) (*connect.Response[v1alpha1.GetOrganizationSettingsResponse], error)\n\t// UpdateOrganizationSettings update the organization settings including base roles.\n\tUpdateOrganizationSettings(context.Context, *connect.Request[v1alpha1.UpdateOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UpdateOrganizationSettingsResponse], error)\n\t// AddOrganizationGroup adds an IdP Group to the organization.\n\tAddOrganizationGroup(context.Context, *connect.Request[v1alpha1.AddOrganizationGroupRequest]) (*connect.Response[v1alpha1.AddOrganizationGroupResponse], error)\n\t// UpdateOrganizationGroup updates an IdP Group for the organization.\n\tUpdateOrganizationGroup(context.Context, *connect.Request[v1alpha1.UpdateOrganizationGroupRequest]) (*connect.Response[v1alpha1.UpdateOrganizationGroupResponse], error)\n\t// RemoveOrganizationGroup removes an IdP Group from the organization.\n\tRemoveOrganizationGroup(context.Context, *connect.Request[v1alpha1.RemoveOrganizationGroupRequest]) (*connect.Response[v1alpha1.RemoveOrganizationGroupResponse], error)\n}\n\n// NewOrganizationServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.OrganizationService service. By default, it uses the Connect protocol\n// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To\n// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()\n// options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewOrganizationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) OrganizationServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\torganizationServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_organization_proto.Services().ByName(\"OrganizationService\").Methods()\n\treturn &organizationServiceClient{\n\t\tgetOrganization: connect.NewClient[v1alpha1.GetOrganizationRequest, v1alpha1.GetOrganizationResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceGetOrganizationProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetOrganization\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetOrganizationByName: connect.NewClient[v1alpha1.GetOrganizationByNameRequest, v1alpha1.GetOrganizationByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceGetOrganizationByNameProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetOrganizationByName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistOrganizations: connect.NewClient[v1alpha1.ListOrganizationsRequest, v1alpha1.ListOrganizationsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceListOrganizationsProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"ListOrganizations\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistUserOrganizations: connect.NewClient[v1alpha1.ListUserOrganizationsRequest, v1alpha1.ListUserOrganizationsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceListUserOrganizationsProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"ListUserOrganizations\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetUserOrganization: connect.NewClient[v1alpha1.GetUserOrganizationRequest, v1alpha1.GetUserOrganizationResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceGetUserOrganizationProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetUserOrganization\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tcreateOrganization: connect.NewClient[v1alpha1.CreateOrganizationRequest, v1alpha1.CreateOrganizationResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceCreateOrganizationProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"CreateOrganization\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteOrganization: connect.NewClient[v1alpha1.DeleteOrganizationRequest, v1alpha1.DeleteOrganizationResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceDeleteOrganizationProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"DeleteOrganization\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteOrganizationByName: connect.NewClient[v1alpha1.DeleteOrganizationByNameRequest, v1alpha1.DeleteOrganizationByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceDeleteOrganizationByNameProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"DeleteOrganizationByName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\taddOrganizationMember: connect.NewClient[v1alpha1.AddOrganizationMemberRequest, v1alpha1.AddOrganizationMemberResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceAddOrganizationMemberProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"AddOrganizationMember\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateOrganizationMember: connect.NewClient[v1alpha1.UpdateOrganizationMemberRequest, v1alpha1.UpdateOrganizationMemberResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceUpdateOrganizationMemberProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"UpdateOrganizationMember\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tremoveOrganizationMember: connect.NewClient[v1alpha1.RemoveOrganizationMemberRequest, v1alpha1.RemoveOrganizationMemberResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceRemoveOrganizationMemberProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"RemoveOrganizationMember\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetOrganizationSettings: connect.NewClient[v1alpha1.GetOrganizationSettingsRequest, v1alpha1.GetOrganizationSettingsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceGetOrganizationSettingsProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetOrganizationSettings\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateOrganizationSettings: connect.NewClient[v1alpha1.UpdateOrganizationSettingsRequest, v1alpha1.UpdateOrganizationSettingsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceUpdateOrganizationSettingsProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"UpdateOrganizationSettings\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\taddOrganizationGroup: connect.NewClient[v1alpha1.AddOrganizationGroupRequest, v1alpha1.AddOrganizationGroupResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceAddOrganizationGroupProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"AddOrganizationGroup\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateOrganizationGroup: connect.NewClient[v1alpha1.UpdateOrganizationGroupRequest, v1alpha1.UpdateOrganizationGroupResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceUpdateOrganizationGroupProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"UpdateOrganizationGroup\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tremoveOrganizationGroup: connect.NewClient[v1alpha1.RemoveOrganizationGroupRequest, v1alpha1.RemoveOrganizationGroupResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OrganizationServiceRemoveOrganizationGroupProcedure,\n\t\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"RemoveOrganizationGroup\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// organizationServiceClient implements OrganizationServiceClient.\ntype organizationServiceClient struct {\n\tgetOrganization            *connect.Client[v1alpha1.GetOrganizationRequest, v1alpha1.GetOrganizationResponse]\n\tgetOrganizationByName      *connect.Client[v1alpha1.GetOrganizationByNameRequest, v1alpha1.GetOrganizationByNameResponse]\n\tlistOrganizations          *connect.Client[v1alpha1.ListOrganizationsRequest, v1alpha1.ListOrganizationsResponse]\n\tlistUserOrganizations      *connect.Client[v1alpha1.ListUserOrganizationsRequest, v1alpha1.ListUserOrganizationsResponse]\n\tgetUserOrganization        *connect.Client[v1alpha1.GetUserOrganizationRequest, v1alpha1.GetUserOrganizationResponse]\n\tcreateOrganization         *connect.Client[v1alpha1.CreateOrganizationRequest, v1alpha1.CreateOrganizationResponse]\n\tdeleteOrganization         *connect.Client[v1alpha1.DeleteOrganizationRequest, v1alpha1.DeleteOrganizationResponse]\n\tdeleteOrganizationByName   *connect.Client[v1alpha1.DeleteOrganizationByNameRequest, v1alpha1.DeleteOrganizationByNameResponse]\n\taddOrganizationMember      *connect.Client[v1alpha1.AddOrganizationMemberRequest, v1alpha1.AddOrganizationMemberResponse]\n\tupdateOrganizationMember   *connect.Client[v1alpha1.UpdateOrganizationMemberRequest, v1alpha1.UpdateOrganizationMemberResponse]\n\tremoveOrganizationMember   *connect.Client[v1alpha1.RemoveOrganizationMemberRequest, v1alpha1.RemoveOrganizationMemberResponse]\n\tgetOrganizationSettings    *connect.Client[v1alpha1.GetOrganizationSettingsRequest, v1alpha1.GetOrganizationSettingsResponse]\n\tupdateOrganizationSettings *connect.Client[v1alpha1.UpdateOrganizationSettingsRequest, v1alpha1.UpdateOrganizationSettingsResponse]\n\taddOrganizationGroup       *connect.Client[v1alpha1.AddOrganizationGroupRequest, v1alpha1.AddOrganizationGroupResponse]\n\tupdateOrganizationGroup    *connect.Client[v1alpha1.UpdateOrganizationGroupRequest, v1alpha1.UpdateOrganizationGroupResponse]\n\tremoveOrganizationGroup    *connect.Client[v1alpha1.RemoveOrganizationGroupRequest, v1alpha1.RemoveOrganizationGroupResponse]\n}\n\n// GetOrganization calls buf.alpha.registry.v1alpha1.OrganizationService.GetOrganization.\nfunc (c *organizationServiceClient) GetOrganization(ctx context.Context, req *connect.Request[v1alpha1.GetOrganizationRequest]) (*connect.Response[v1alpha1.GetOrganizationResponse], error) {\n\treturn c.getOrganization.CallUnary(ctx, req)\n}\n\n// GetOrganizationByName calls\n// buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationByName.\nfunc (c *organizationServiceClient) GetOrganizationByName(ctx context.Context, req *connect.Request[v1alpha1.GetOrganizationByNameRequest]) (*connect.Response[v1alpha1.GetOrganizationByNameResponse], error) {\n\treturn c.getOrganizationByName.CallUnary(ctx, req)\n}\n\n// ListOrganizations calls buf.alpha.registry.v1alpha1.OrganizationService.ListOrganizations.\nfunc (c *organizationServiceClient) ListOrganizations(ctx context.Context, req *connect.Request[v1alpha1.ListOrganizationsRequest]) (*connect.Response[v1alpha1.ListOrganizationsResponse], error) {\n\treturn c.listOrganizations.CallUnary(ctx, req)\n}\n\n// ListUserOrganizations calls\n// buf.alpha.registry.v1alpha1.OrganizationService.ListUserOrganizations.\nfunc (c *organizationServiceClient) ListUserOrganizations(ctx context.Context, req *connect.Request[v1alpha1.ListUserOrganizationsRequest]) (*connect.Response[v1alpha1.ListUserOrganizationsResponse], error) {\n\treturn c.listUserOrganizations.CallUnary(ctx, req)\n}\n\n// GetUserOrganization calls buf.alpha.registry.v1alpha1.OrganizationService.GetUserOrganization.\nfunc (c *organizationServiceClient) GetUserOrganization(ctx context.Context, req *connect.Request[v1alpha1.GetUserOrganizationRequest]) (*connect.Response[v1alpha1.GetUserOrganizationResponse], error) {\n\treturn c.getUserOrganization.CallUnary(ctx, req)\n}\n\n// CreateOrganization calls buf.alpha.registry.v1alpha1.OrganizationService.CreateOrganization.\nfunc (c *organizationServiceClient) CreateOrganization(ctx context.Context, req *connect.Request[v1alpha1.CreateOrganizationRequest]) (*connect.Response[v1alpha1.CreateOrganizationResponse], error) {\n\treturn c.createOrganization.CallUnary(ctx, req)\n}\n\n// DeleteOrganization calls buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganization.\nfunc (c *organizationServiceClient) DeleteOrganization(ctx context.Context, req *connect.Request[v1alpha1.DeleteOrganizationRequest]) (*connect.Response[v1alpha1.DeleteOrganizationResponse], error) {\n\treturn c.deleteOrganization.CallUnary(ctx, req)\n}\n\n// DeleteOrganizationByName calls\n// buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganizationByName.\nfunc (c *organizationServiceClient) DeleteOrganizationByName(ctx context.Context, req *connect.Request[v1alpha1.DeleteOrganizationByNameRequest]) (*connect.Response[v1alpha1.DeleteOrganizationByNameResponse], error) {\n\treturn c.deleteOrganizationByName.CallUnary(ctx, req)\n}\n\n// AddOrganizationMember calls\n// buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationMember.\nfunc (c *organizationServiceClient) AddOrganizationMember(ctx context.Context, req *connect.Request[v1alpha1.AddOrganizationMemberRequest]) (*connect.Response[v1alpha1.AddOrganizationMemberResponse], error) {\n\treturn c.addOrganizationMember.CallUnary(ctx, req)\n}\n\n// UpdateOrganizationMember calls\n// buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationMember.\nfunc (c *organizationServiceClient) UpdateOrganizationMember(ctx context.Context, req *connect.Request[v1alpha1.UpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UpdateOrganizationMemberResponse], error) {\n\treturn c.updateOrganizationMember.CallUnary(ctx, req)\n}\n\n// RemoveOrganizationMember calls\n// buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationMember.\nfunc (c *organizationServiceClient) RemoveOrganizationMember(ctx context.Context, req *connect.Request[v1alpha1.RemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.RemoveOrganizationMemberResponse], error) {\n\treturn c.removeOrganizationMember.CallUnary(ctx, req)\n}\n\n// GetOrganizationSettings calls\n// buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationSettings.\nfunc (c *organizationServiceClient) GetOrganizationSettings(ctx context.Context, req *connect.Request[v1alpha1.GetOrganizationSettingsRequest]) (*connect.Response[v1alpha1.GetOrganizationSettingsResponse], error) {\n\treturn c.getOrganizationSettings.CallUnary(ctx, req)\n}\n\n// UpdateOrganizationSettings calls\n// buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationSettings.\nfunc (c *organizationServiceClient) UpdateOrganizationSettings(ctx context.Context, req *connect.Request[v1alpha1.UpdateOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UpdateOrganizationSettingsResponse], error) {\n\treturn c.updateOrganizationSettings.CallUnary(ctx, req)\n}\n\n// AddOrganizationGroup calls buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationGroup.\nfunc (c *organizationServiceClient) AddOrganizationGroup(ctx context.Context, req *connect.Request[v1alpha1.AddOrganizationGroupRequest]) (*connect.Response[v1alpha1.AddOrganizationGroupResponse], error) {\n\treturn c.addOrganizationGroup.CallUnary(ctx, req)\n}\n\n// UpdateOrganizationGroup calls\n// buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationGroup.\nfunc (c *organizationServiceClient) UpdateOrganizationGroup(ctx context.Context, req *connect.Request[v1alpha1.UpdateOrganizationGroupRequest]) (*connect.Response[v1alpha1.UpdateOrganizationGroupResponse], error) {\n\treturn c.updateOrganizationGroup.CallUnary(ctx, req)\n}\n\n// RemoveOrganizationGroup calls\n// buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationGroup.\nfunc (c *organizationServiceClient) RemoveOrganizationGroup(ctx context.Context, req *connect.Request[v1alpha1.RemoveOrganizationGroupRequest]) (*connect.Response[v1alpha1.RemoveOrganizationGroupResponse], error) {\n\treturn c.removeOrganizationGroup.CallUnary(ctx, req)\n}\n\n// OrganizationServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.OrganizationService service.\ntype OrganizationServiceHandler interface {\n\t// GetOrganization gets a organization by ID.\n\tGetOrganization(context.Context, *connect.Request[v1alpha1.GetOrganizationRequest]) (*connect.Response[v1alpha1.GetOrganizationResponse], error)\n\t// GetOrganizationByName gets a organization by name.\n\tGetOrganizationByName(context.Context, *connect.Request[v1alpha1.GetOrganizationByNameRequest]) (*connect.Response[v1alpha1.GetOrganizationByNameResponse], error)\n\t// ListOrganizations lists all organizations.\n\tListOrganizations(context.Context, *connect.Request[v1alpha1.ListOrganizationsRequest]) (*connect.Response[v1alpha1.ListOrganizationsResponse], error)\n\t// ListUserOrganizations lists all organizations a user is member of.\n\tListUserOrganizations(context.Context, *connect.Request[v1alpha1.ListUserOrganizationsRequest]) (*connect.Response[v1alpha1.ListUserOrganizationsResponse], error)\n\tGetUserOrganization(context.Context, *connect.Request[v1alpha1.GetUserOrganizationRequest]) (*connect.Response[v1alpha1.GetUserOrganizationResponse], error)\n\t// CreateOrganization creates a new organization.\n\tCreateOrganization(context.Context, *connect.Request[v1alpha1.CreateOrganizationRequest]) (*connect.Response[v1alpha1.CreateOrganizationResponse], error)\n\t// DeleteOrganization deletes a organization.\n\tDeleteOrganization(context.Context, *connect.Request[v1alpha1.DeleteOrganizationRequest]) (*connect.Response[v1alpha1.DeleteOrganizationResponse], error)\n\t// DeleteOrganizationByName deletes a organization by name.\n\tDeleteOrganizationByName(context.Context, *connect.Request[v1alpha1.DeleteOrganizationByNameRequest]) (*connect.Response[v1alpha1.DeleteOrganizationByNameResponse], error)\n\t// AddOrganizationMember add a role to an user in the organization.\n\tAddOrganizationMember(context.Context, *connect.Request[v1alpha1.AddOrganizationMemberRequest]) (*connect.Response[v1alpha1.AddOrganizationMemberResponse], error)\n\t// UpdateOrganizationMember update the user's membership information in the organization.\n\tUpdateOrganizationMember(context.Context, *connect.Request[v1alpha1.UpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UpdateOrganizationMemberResponse], error)\n\t// RemoveOrganizationMember remove the role of an user in the organization.\n\tRemoveOrganizationMember(context.Context, *connect.Request[v1alpha1.RemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.RemoveOrganizationMemberResponse], error)\n\t// GetOrganizationSettings gets the settings of an organization, including organization base roles.\n\tGetOrganizationSettings(context.Context, *connect.Request[v1alpha1.GetOrganizationSettingsRequest]) (*connect.Response[v1alpha1.GetOrganizationSettingsResponse], error)\n\t// UpdateOrganizationSettings update the organization settings including base roles.\n\tUpdateOrganizationSettings(context.Context, *connect.Request[v1alpha1.UpdateOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UpdateOrganizationSettingsResponse], error)\n\t// AddOrganizationGroup adds an IdP Group to the organization.\n\tAddOrganizationGroup(context.Context, *connect.Request[v1alpha1.AddOrganizationGroupRequest]) (*connect.Response[v1alpha1.AddOrganizationGroupResponse], error)\n\t// UpdateOrganizationGroup updates an IdP Group for the organization.\n\tUpdateOrganizationGroup(context.Context, *connect.Request[v1alpha1.UpdateOrganizationGroupRequest]) (*connect.Response[v1alpha1.UpdateOrganizationGroupResponse], error)\n\t// RemoveOrganizationGroup removes an IdP Group from the organization.\n\tRemoveOrganizationGroup(context.Context, *connect.Request[v1alpha1.RemoveOrganizationGroupRequest]) (*connect.Response[v1alpha1.RemoveOrganizationGroupResponse], error)\n}\n\n// NewOrganizationServiceHandler builds an HTTP handler from the service implementation. It returns\n// the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewOrganizationServiceHandler(svc OrganizationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\torganizationServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_organization_proto.Services().ByName(\"OrganizationService\").Methods()\n\torganizationServiceGetOrganizationHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceGetOrganizationProcedure,\n\t\tsvc.GetOrganization,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetOrganization\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceGetOrganizationByNameHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceGetOrganizationByNameProcedure,\n\t\tsvc.GetOrganizationByName,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetOrganizationByName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceListOrganizationsHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceListOrganizationsProcedure,\n\t\tsvc.ListOrganizations,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"ListOrganizations\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceListUserOrganizationsHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceListUserOrganizationsProcedure,\n\t\tsvc.ListUserOrganizations,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"ListUserOrganizations\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceGetUserOrganizationHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceGetUserOrganizationProcedure,\n\t\tsvc.GetUserOrganization,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetUserOrganization\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceCreateOrganizationHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceCreateOrganizationProcedure,\n\t\tsvc.CreateOrganization,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"CreateOrganization\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceDeleteOrganizationHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceDeleteOrganizationProcedure,\n\t\tsvc.DeleteOrganization,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"DeleteOrganization\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceDeleteOrganizationByNameHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceDeleteOrganizationByNameProcedure,\n\t\tsvc.DeleteOrganizationByName,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"DeleteOrganizationByName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceAddOrganizationMemberHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceAddOrganizationMemberProcedure,\n\t\tsvc.AddOrganizationMember,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"AddOrganizationMember\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceUpdateOrganizationMemberHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceUpdateOrganizationMemberProcedure,\n\t\tsvc.UpdateOrganizationMember,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"UpdateOrganizationMember\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceRemoveOrganizationMemberHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceRemoveOrganizationMemberProcedure,\n\t\tsvc.RemoveOrganizationMember,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"RemoveOrganizationMember\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceGetOrganizationSettingsHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceGetOrganizationSettingsProcedure,\n\t\tsvc.GetOrganizationSettings,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"GetOrganizationSettings\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceUpdateOrganizationSettingsHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceUpdateOrganizationSettingsProcedure,\n\t\tsvc.UpdateOrganizationSettings,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"UpdateOrganizationSettings\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceAddOrganizationGroupHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceAddOrganizationGroupProcedure,\n\t\tsvc.AddOrganizationGroup,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"AddOrganizationGroup\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceUpdateOrganizationGroupHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceUpdateOrganizationGroupProcedure,\n\t\tsvc.UpdateOrganizationGroup,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"UpdateOrganizationGroup\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\torganizationServiceRemoveOrganizationGroupHandler := connect.NewUnaryHandler(\n\t\tOrganizationServiceRemoveOrganizationGroupProcedure,\n\t\tsvc.RemoveOrganizationGroup,\n\t\tconnect.WithSchema(organizationServiceMethods.ByName(\"RemoveOrganizationGroup\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.OrganizationService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase OrganizationServiceGetOrganizationProcedure:\n\t\t\torganizationServiceGetOrganizationHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceGetOrganizationByNameProcedure:\n\t\t\torganizationServiceGetOrganizationByNameHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceListOrganizationsProcedure:\n\t\t\torganizationServiceListOrganizationsHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceListUserOrganizationsProcedure:\n\t\t\torganizationServiceListUserOrganizationsHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceGetUserOrganizationProcedure:\n\t\t\torganizationServiceGetUserOrganizationHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceCreateOrganizationProcedure:\n\t\t\torganizationServiceCreateOrganizationHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceDeleteOrganizationProcedure:\n\t\t\torganizationServiceDeleteOrganizationHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceDeleteOrganizationByNameProcedure:\n\t\t\torganizationServiceDeleteOrganizationByNameHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceAddOrganizationMemberProcedure:\n\t\t\torganizationServiceAddOrganizationMemberHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceUpdateOrganizationMemberProcedure:\n\t\t\torganizationServiceUpdateOrganizationMemberHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceRemoveOrganizationMemberProcedure:\n\t\t\torganizationServiceRemoveOrganizationMemberHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceGetOrganizationSettingsProcedure:\n\t\t\torganizationServiceGetOrganizationSettingsHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceUpdateOrganizationSettingsProcedure:\n\t\t\torganizationServiceUpdateOrganizationSettingsHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceAddOrganizationGroupProcedure:\n\t\t\torganizationServiceAddOrganizationGroupHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceUpdateOrganizationGroupProcedure:\n\t\t\torganizationServiceUpdateOrganizationGroupHandler.ServeHTTP(w, r)\n\t\tcase OrganizationServiceRemoveOrganizationGroupProcedure:\n\t\t\torganizationServiceRemoveOrganizationGroupHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedOrganizationServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedOrganizationServiceHandler struct{}\n\nfunc (UnimplementedOrganizationServiceHandler) GetOrganization(context.Context, *connect.Request[v1alpha1.GetOrganizationRequest]) (*connect.Response[v1alpha1.GetOrganizationResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.GetOrganization is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) GetOrganizationByName(context.Context, *connect.Request[v1alpha1.GetOrganizationByNameRequest]) (*connect.Response[v1alpha1.GetOrganizationByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationByName is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) ListOrganizations(context.Context, *connect.Request[v1alpha1.ListOrganizationsRequest]) (*connect.Response[v1alpha1.ListOrganizationsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.ListOrganizations is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) ListUserOrganizations(context.Context, *connect.Request[v1alpha1.ListUserOrganizationsRequest]) (*connect.Response[v1alpha1.ListUserOrganizationsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.ListUserOrganizations is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) GetUserOrganization(context.Context, *connect.Request[v1alpha1.GetUserOrganizationRequest]) (*connect.Response[v1alpha1.GetUserOrganizationResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.GetUserOrganization is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) CreateOrganization(context.Context, *connect.Request[v1alpha1.CreateOrganizationRequest]) (*connect.Response[v1alpha1.CreateOrganizationResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.CreateOrganization is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) DeleteOrganization(context.Context, *connect.Request[v1alpha1.DeleteOrganizationRequest]) (*connect.Response[v1alpha1.DeleteOrganizationResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganization is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) DeleteOrganizationByName(context.Context, *connect.Request[v1alpha1.DeleteOrganizationByNameRequest]) (*connect.Response[v1alpha1.DeleteOrganizationByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganizationByName is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) AddOrganizationMember(context.Context, *connect.Request[v1alpha1.AddOrganizationMemberRequest]) (*connect.Response[v1alpha1.AddOrganizationMemberResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationMember is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) UpdateOrganizationMember(context.Context, *connect.Request[v1alpha1.UpdateOrganizationMemberRequest]) (*connect.Response[v1alpha1.UpdateOrganizationMemberResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationMember is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) RemoveOrganizationMember(context.Context, *connect.Request[v1alpha1.RemoveOrganizationMemberRequest]) (*connect.Response[v1alpha1.RemoveOrganizationMemberResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationMember is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) GetOrganizationSettings(context.Context, *connect.Request[v1alpha1.GetOrganizationSettingsRequest]) (*connect.Response[v1alpha1.GetOrganizationSettingsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationSettings is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) UpdateOrganizationSettings(context.Context, *connect.Request[v1alpha1.UpdateOrganizationSettingsRequest]) (*connect.Response[v1alpha1.UpdateOrganizationSettingsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationSettings is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) AddOrganizationGroup(context.Context, *connect.Request[v1alpha1.AddOrganizationGroupRequest]) (*connect.Response[v1alpha1.AddOrganizationGroupResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationGroup is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) UpdateOrganizationGroup(context.Context, *connect.Request[v1alpha1.UpdateOrganizationGroupRequest]) (*connect.Response[v1alpha1.UpdateOrganizationGroupResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationGroup is not implemented\"))\n}\n\nfunc (UnimplementedOrganizationServiceHandler) RemoveOrganizationGroup(context.Context, *connect.Request[v1alpha1.RemoveOrganizationGroupRequest]) (*connect.Response[v1alpha1.RemoveOrganizationGroupResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationGroup is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/owner.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/owner.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// OwnerServiceName is the fully-qualified name of the OwnerService service.\n\tOwnerServiceName = \"buf.alpha.registry.v1alpha1.OwnerService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// OwnerServiceGetOwnerByNameProcedure is the fully-qualified name of the OwnerService's\n\t// GetOwnerByName RPC.\n\tOwnerServiceGetOwnerByNameProcedure = \"/buf.alpha.registry.v1alpha1.OwnerService/GetOwnerByName\"\n)\n\n// OwnerServiceClient is a client for the buf.alpha.registry.v1alpha1.OwnerService service.\ntype OwnerServiceClient interface {\n\t// GetOwnerByName takes an owner name and returns the owner as\n\t// either a user or organization.\n\tGetOwnerByName(context.Context, *connect.Request[v1alpha1.GetOwnerByNameRequest]) (*connect.Response[v1alpha1.GetOwnerByNameResponse], error)\n}\n\n// NewOwnerServiceClient constructs a client for the buf.alpha.registry.v1alpha1.OwnerService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewOwnerServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) OwnerServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\townerServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_owner_proto.Services().ByName(\"OwnerService\").Methods()\n\treturn &ownerServiceClient{\n\t\tgetOwnerByName: connect.NewClient[v1alpha1.GetOwnerByNameRequest, v1alpha1.GetOwnerByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+OwnerServiceGetOwnerByNameProcedure,\n\t\t\tconnect.WithSchema(ownerServiceMethods.ByName(\"GetOwnerByName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// ownerServiceClient implements OwnerServiceClient.\ntype ownerServiceClient struct {\n\tgetOwnerByName *connect.Client[v1alpha1.GetOwnerByNameRequest, v1alpha1.GetOwnerByNameResponse]\n}\n\n// GetOwnerByName calls buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName.\nfunc (c *ownerServiceClient) GetOwnerByName(ctx context.Context, req *connect.Request[v1alpha1.GetOwnerByNameRequest]) (*connect.Response[v1alpha1.GetOwnerByNameResponse], error) {\n\treturn c.getOwnerByName.CallUnary(ctx, req)\n}\n\n// OwnerServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.OwnerService service.\ntype OwnerServiceHandler interface {\n\t// GetOwnerByName takes an owner name and returns the owner as\n\t// either a user or organization.\n\tGetOwnerByName(context.Context, *connect.Request[v1alpha1.GetOwnerByNameRequest]) (*connect.Response[v1alpha1.GetOwnerByNameResponse], error)\n}\n\n// NewOwnerServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewOwnerServiceHandler(svc OwnerServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\townerServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_owner_proto.Services().ByName(\"OwnerService\").Methods()\n\townerServiceGetOwnerByNameHandler := connect.NewUnaryHandler(\n\t\tOwnerServiceGetOwnerByNameProcedure,\n\t\tsvc.GetOwnerByName,\n\t\tconnect.WithSchema(ownerServiceMethods.ByName(\"GetOwnerByName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.OwnerService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase OwnerServiceGetOwnerByNameProcedure:\n\t\t\townerServiceGetOwnerByNameHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedOwnerServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedOwnerServiceHandler struct{}\n\nfunc (UnimplementedOwnerServiceHandler) GetOwnerByName(context.Context, *connect.Request[v1alpha1.GetOwnerByNameRequest]) (*connect.Response[v1alpha1.GetOwnerByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/plugin_curation.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/plugin_curation.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// PluginCurationServiceName is the fully-qualified name of the PluginCurationService service.\n\tPluginCurationServiceName = \"buf.alpha.registry.v1alpha1.PluginCurationService\"\n\t// CodeGenerationServiceName is the fully-qualified name of the CodeGenerationService service.\n\tCodeGenerationServiceName = \"buf.alpha.registry.v1alpha1.CodeGenerationService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// PluginCurationServiceListCuratedPluginsProcedure is the fully-qualified name of the\n\t// PluginCurationService's ListCuratedPlugins RPC.\n\tPluginCurationServiceListCuratedPluginsProcedure = \"/buf.alpha.registry.v1alpha1.PluginCurationService/ListCuratedPlugins\"\n\t// PluginCurationServiceCreateCuratedPluginProcedure is the fully-qualified name of the\n\t// PluginCurationService's CreateCuratedPlugin RPC.\n\tPluginCurationServiceCreateCuratedPluginProcedure = \"/buf.alpha.registry.v1alpha1.PluginCurationService/CreateCuratedPlugin\"\n\t// PluginCurationServiceGetLatestCuratedPluginProcedure is the fully-qualified name of the\n\t// PluginCurationService's GetLatestCuratedPlugin RPC.\n\tPluginCurationServiceGetLatestCuratedPluginProcedure = \"/buf.alpha.registry.v1alpha1.PluginCurationService/GetLatestCuratedPlugin\"\n\t// PluginCurationServiceDeleteCuratedPluginProcedure is the fully-qualified name of the\n\t// PluginCurationService's DeleteCuratedPlugin RPC.\n\tPluginCurationServiceDeleteCuratedPluginProcedure = \"/buf.alpha.registry.v1alpha1.PluginCurationService/DeleteCuratedPlugin\"\n\t// CodeGenerationServiceGenerateCodeProcedure is the fully-qualified name of the\n\t// CodeGenerationService's GenerateCode RPC.\n\tCodeGenerationServiceGenerateCodeProcedure = \"/buf.alpha.registry.v1alpha1.CodeGenerationService/GenerateCode\"\n)\n\n// PluginCurationServiceClient is a client for the buf.alpha.registry.v1alpha1.PluginCurationService\n// service.\ntype PluginCurationServiceClient interface {\n\t// ListCuratedPlugins returns all the curated plugins available.\n\tListCuratedPlugins(context.Context, *connect.Request[v1alpha1.ListCuratedPluginsRequest]) (*connect.Response[v1alpha1.ListCuratedPluginsResponse], error)\n\t// CreateCuratedPlugin creates a new curated plugin.\n\tCreateCuratedPlugin(context.Context, *connect.Request[v1alpha1.CreateCuratedPluginRequest]) (*connect.Response[v1alpha1.CreateCuratedPluginResponse], error)\n\t// GetLatestCuratedPlugin returns the latest version of a plugin matching given parameters.\n\tGetLatestCuratedPlugin(context.Context, *connect.Request[v1alpha1.GetLatestCuratedPluginRequest]) (*connect.Response[v1alpha1.GetLatestCuratedPluginResponse], error)\n\t// DeleteCuratedPlugin deletes a curated plugin based on the given parameters.\n\tDeleteCuratedPlugin(context.Context, *connect.Request[v1alpha1.DeleteCuratedPluginRequest]) (*connect.Response[v1alpha1.DeleteCuratedPluginResponse], error)\n}\n\n// NewPluginCurationServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.PluginCurationService service. By default, it uses the Connect\n// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed\n// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or\n// connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewPluginCurationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PluginCurationServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tpluginCurationServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_plugin_curation_proto.Services().ByName(\"PluginCurationService\").Methods()\n\treturn &pluginCurationServiceClient{\n\t\tlistCuratedPlugins: connect.NewClient[v1alpha1.ListCuratedPluginsRequest, v1alpha1.ListCuratedPluginsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+PluginCurationServiceListCuratedPluginsProcedure,\n\t\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"ListCuratedPlugins\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tcreateCuratedPlugin: connect.NewClient[v1alpha1.CreateCuratedPluginRequest, v1alpha1.CreateCuratedPluginResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+PluginCurationServiceCreateCuratedPluginProcedure,\n\t\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"CreateCuratedPlugin\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetLatestCuratedPlugin: connect.NewClient[v1alpha1.GetLatestCuratedPluginRequest, v1alpha1.GetLatestCuratedPluginResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+PluginCurationServiceGetLatestCuratedPluginProcedure,\n\t\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"GetLatestCuratedPlugin\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteCuratedPlugin: connect.NewClient[v1alpha1.DeleteCuratedPluginRequest, v1alpha1.DeleteCuratedPluginResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+PluginCurationServiceDeleteCuratedPluginProcedure,\n\t\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"DeleteCuratedPlugin\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// pluginCurationServiceClient implements PluginCurationServiceClient.\ntype pluginCurationServiceClient struct {\n\tlistCuratedPlugins     *connect.Client[v1alpha1.ListCuratedPluginsRequest, v1alpha1.ListCuratedPluginsResponse]\n\tcreateCuratedPlugin    *connect.Client[v1alpha1.CreateCuratedPluginRequest, v1alpha1.CreateCuratedPluginResponse]\n\tgetLatestCuratedPlugin *connect.Client[v1alpha1.GetLatestCuratedPluginRequest, v1alpha1.GetLatestCuratedPluginResponse]\n\tdeleteCuratedPlugin    *connect.Client[v1alpha1.DeleteCuratedPluginRequest, v1alpha1.DeleteCuratedPluginResponse]\n}\n\n// ListCuratedPlugins calls buf.alpha.registry.v1alpha1.PluginCurationService.ListCuratedPlugins.\nfunc (c *pluginCurationServiceClient) ListCuratedPlugins(ctx context.Context, req *connect.Request[v1alpha1.ListCuratedPluginsRequest]) (*connect.Response[v1alpha1.ListCuratedPluginsResponse], error) {\n\treturn c.listCuratedPlugins.CallUnary(ctx, req)\n}\n\n// CreateCuratedPlugin calls buf.alpha.registry.v1alpha1.PluginCurationService.CreateCuratedPlugin.\nfunc (c *pluginCurationServiceClient) CreateCuratedPlugin(ctx context.Context, req *connect.Request[v1alpha1.CreateCuratedPluginRequest]) (*connect.Response[v1alpha1.CreateCuratedPluginResponse], error) {\n\treturn c.createCuratedPlugin.CallUnary(ctx, req)\n}\n\n// GetLatestCuratedPlugin calls\n// buf.alpha.registry.v1alpha1.PluginCurationService.GetLatestCuratedPlugin.\nfunc (c *pluginCurationServiceClient) GetLatestCuratedPlugin(ctx context.Context, req *connect.Request[v1alpha1.GetLatestCuratedPluginRequest]) (*connect.Response[v1alpha1.GetLatestCuratedPluginResponse], error) {\n\treturn c.getLatestCuratedPlugin.CallUnary(ctx, req)\n}\n\n// DeleteCuratedPlugin calls buf.alpha.registry.v1alpha1.PluginCurationService.DeleteCuratedPlugin.\nfunc (c *pluginCurationServiceClient) DeleteCuratedPlugin(ctx context.Context, req *connect.Request[v1alpha1.DeleteCuratedPluginRequest]) (*connect.Response[v1alpha1.DeleteCuratedPluginResponse], error) {\n\treturn c.deleteCuratedPlugin.CallUnary(ctx, req)\n}\n\n// PluginCurationServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.PluginCurationService service.\ntype PluginCurationServiceHandler interface {\n\t// ListCuratedPlugins returns all the curated plugins available.\n\tListCuratedPlugins(context.Context, *connect.Request[v1alpha1.ListCuratedPluginsRequest]) (*connect.Response[v1alpha1.ListCuratedPluginsResponse], error)\n\t// CreateCuratedPlugin creates a new curated plugin.\n\tCreateCuratedPlugin(context.Context, *connect.Request[v1alpha1.CreateCuratedPluginRequest]) (*connect.Response[v1alpha1.CreateCuratedPluginResponse], error)\n\t// GetLatestCuratedPlugin returns the latest version of a plugin matching given parameters.\n\tGetLatestCuratedPlugin(context.Context, *connect.Request[v1alpha1.GetLatestCuratedPluginRequest]) (*connect.Response[v1alpha1.GetLatestCuratedPluginResponse], error)\n\t// DeleteCuratedPlugin deletes a curated plugin based on the given parameters.\n\tDeleteCuratedPlugin(context.Context, *connect.Request[v1alpha1.DeleteCuratedPluginRequest]) (*connect.Response[v1alpha1.DeleteCuratedPluginResponse], error)\n}\n\n// NewPluginCurationServiceHandler builds an HTTP handler from the service implementation. It\n// returns the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewPluginCurationServiceHandler(svc PluginCurationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tpluginCurationServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_plugin_curation_proto.Services().ByName(\"PluginCurationService\").Methods()\n\tpluginCurationServiceListCuratedPluginsHandler := connect.NewUnaryHandler(\n\t\tPluginCurationServiceListCuratedPluginsProcedure,\n\t\tsvc.ListCuratedPlugins,\n\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"ListCuratedPlugins\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tpluginCurationServiceCreateCuratedPluginHandler := connect.NewUnaryHandler(\n\t\tPluginCurationServiceCreateCuratedPluginProcedure,\n\t\tsvc.CreateCuratedPlugin,\n\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"CreateCuratedPlugin\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tpluginCurationServiceGetLatestCuratedPluginHandler := connect.NewUnaryHandler(\n\t\tPluginCurationServiceGetLatestCuratedPluginProcedure,\n\t\tsvc.GetLatestCuratedPlugin,\n\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"GetLatestCuratedPlugin\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tpluginCurationServiceDeleteCuratedPluginHandler := connect.NewUnaryHandler(\n\t\tPluginCurationServiceDeleteCuratedPluginProcedure,\n\t\tsvc.DeleteCuratedPlugin,\n\t\tconnect.WithSchema(pluginCurationServiceMethods.ByName(\"DeleteCuratedPlugin\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.PluginCurationService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase PluginCurationServiceListCuratedPluginsProcedure:\n\t\t\tpluginCurationServiceListCuratedPluginsHandler.ServeHTTP(w, r)\n\t\tcase PluginCurationServiceCreateCuratedPluginProcedure:\n\t\t\tpluginCurationServiceCreateCuratedPluginHandler.ServeHTTP(w, r)\n\t\tcase PluginCurationServiceGetLatestCuratedPluginProcedure:\n\t\t\tpluginCurationServiceGetLatestCuratedPluginHandler.ServeHTTP(w, r)\n\t\tcase PluginCurationServiceDeleteCuratedPluginProcedure:\n\t\t\tpluginCurationServiceDeleteCuratedPluginHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedPluginCurationServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedPluginCurationServiceHandler struct{}\n\nfunc (UnimplementedPluginCurationServiceHandler) ListCuratedPlugins(context.Context, *connect.Request[v1alpha1.ListCuratedPluginsRequest]) (*connect.Response[v1alpha1.ListCuratedPluginsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.PluginCurationService.ListCuratedPlugins is not implemented\"))\n}\n\nfunc (UnimplementedPluginCurationServiceHandler) CreateCuratedPlugin(context.Context, *connect.Request[v1alpha1.CreateCuratedPluginRequest]) (*connect.Response[v1alpha1.CreateCuratedPluginResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.PluginCurationService.CreateCuratedPlugin is not implemented\"))\n}\n\nfunc (UnimplementedPluginCurationServiceHandler) GetLatestCuratedPlugin(context.Context, *connect.Request[v1alpha1.GetLatestCuratedPluginRequest]) (*connect.Response[v1alpha1.GetLatestCuratedPluginResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.PluginCurationService.GetLatestCuratedPlugin is not implemented\"))\n}\n\nfunc (UnimplementedPluginCurationServiceHandler) DeleteCuratedPlugin(context.Context, *connect.Request[v1alpha1.DeleteCuratedPluginRequest]) (*connect.Response[v1alpha1.DeleteCuratedPluginResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.PluginCurationService.DeleteCuratedPlugin is not implemented\"))\n}\n\n// CodeGenerationServiceClient is a client for the buf.alpha.registry.v1alpha1.CodeGenerationService\n// service.\ntype CodeGenerationServiceClient interface {\n\t// GenerateCode generates code using the specified remote plugins.\n\tGenerateCode(context.Context, *connect.Request[v1alpha1.GenerateCodeRequest]) (*connect.Response[v1alpha1.GenerateCodeResponse], error)\n}\n\n// NewCodeGenerationServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.CodeGenerationService service. By default, it uses the Connect\n// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed\n// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or\n// connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewCodeGenerationServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CodeGenerationServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tcodeGenerationServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_plugin_curation_proto.Services().ByName(\"CodeGenerationService\").Methods()\n\treturn &codeGenerationServiceClient{\n\t\tgenerateCode: connect.NewClient[v1alpha1.GenerateCodeRequest, v1alpha1.GenerateCodeResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+CodeGenerationServiceGenerateCodeProcedure,\n\t\t\tconnect.WithSchema(codeGenerationServiceMethods.ByName(\"GenerateCode\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// codeGenerationServiceClient implements CodeGenerationServiceClient.\ntype codeGenerationServiceClient struct {\n\tgenerateCode *connect.Client[v1alpha1.GenerateCodeRequest, v1alpha1.GenerateCodeResponse]\n}\n\n// GenerateCode calls buf.alpha.registry.v1alpha1.CodeGenerationService.GenerateCode.\nfunc (c *codeGenerationServiceClient) GenerateCode(ctx context.Context, req *connect.Request[v1alpha1.GenerateCodeRequest]) (*connect.Response[v1alpha1.GenerateCodeResponse], error) {\n\treturn c.generateCode.CallUnary(ctx, req)\n}\n\n// CodeGenerationServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.CodeGenerationService service.\ntype CodeGenerationServiceHandler interface {\n\t// GenerateCode generates code using the specified remote plugins.\n\tGenerateCode(context.Context, *connect.Request[v1alpha1.GenerateCodeRequest]) (*connect.Response[v1alpha1.GenerateCodeResponse], error)\n}\n\n// NewCodeGenerationServiceHandler builds an HTTP handler from the service implementation. It\n// returns the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewCodeGenerationServiceHandler(svc CodeGenerationServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tcodeGenerationServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_plugin_curation_proto.Services().ByName(\"CodeGenerationService\").Methods()\n\tcodeGenerationServiceGenerateCodeHandler := connect.NewUnaryHandler(\n\t\tCodeGenerationServiceGenerateCodeProcedure,\n\t\tsvc.GenerateCode,\n\t\tconnect.WithSchema(codeGenerationServiceMethods.ByName(\"GenerateCode\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.CodeGenerationService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase CodeGenerationServiceGenerateCodeProcedure:\n\t\t\tcodeGenerationServiceGenerateCodeHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedCodeGenerationServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedCodeGenerationServiceHandler struct{}\n\nfunc (UnimplementedCodeGenerationServiceHandler) GenerateCode(context.Context, *connect.Request[v1alpha1.GenerateCodeRequest]) (*connect.Response[v1alpha1.GenerateCodeResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.CodeGenerationService.GenerateCode is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/push.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/push.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// PushServiceName is the fully-qualified name of the PushService service.\n\tPushServiceName = \"buf.alpha.registry.v1alpha1.PushService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// PushServicePushProcedure is the fully-qualified name of the PushService's Push RPC.\n\tPushServicePushProcedure = \"/buf.alpha.registry.v1alpha1.PushService/Push\"\n\t// PushServicePushManifestAndBlobsProcedure is the fully-qualified name of the PushService's\n\t// PushManifestAndBlobs RPC.\n\tPushServicePushManifestAndBlobsProcedure = \"/buf.alpha.registry.v1alpha1.PushService/PushManifestAndBlobs\"\n)\n\n// PushServiceClient is a client for the buf.alpha.registry.v1alpha1.PushService service.\ntype PushServiceClient interface {\n\t// Push pushes.\n\t// NOTE: Newer clients should use PushManifestAndBlobs.\n\tPush(context.Context, *connect.Request[v1alpha1.PushRequest]) (*connect.Response[v1alpha1.PushResponse], error)\n\t// PushManifestAndBlobs pushes a module by encoding it in a manifest and blobs format.\n\tPushManifestAndBlobs(context.Context, *connect.Request[v1alpha1.PushManifestAndBlobsRequest]) (*connect.Response[v1alpha1.PushManifestAndBlobsResponse], error)\n}\n\n// NewPushServiceClient constructs a client for the buf.alpha.registry.v1alpha1.PushService service.\n// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped\n// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the\n// connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewPushServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) PushServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tpushServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_push_proto.Services().ByName(\"PushService\").Methods()\n\treturn &pushServiceClient{\n\t\tpush: connect.NewClient[v1alpha1.PushRequest, v1alpha1.PushResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+PushServicePushProcedure,\n\t\t\tconnect.WithSchema(pushServiceMethods.ByName(\"Push\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tpushManifestAndBlobs: connect.NewClient[v1alpha1.PushManifestAndBlobsRequest, v1alpha1.PushManifestAndBlobsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+PushServicePushManifestAndBlobsProcedure,\n\t\t\tconnect.WithSchema(pushServiceMethods.ByName(\"PushManifestAndBlobs\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// pushServiceClient implements PushServiceClient.\ntype pushServiceClient struct {\n\tpush                 *connect.Client[v1alpha1.PushRequest, v1alpha1.PushResponse]\n\tpushManifestAndBlobs *connect.Client[v1alpha1.PushManifestAndBlobsRequest, v1alpha1.PushManifestAndBlobsResponse]\n}\n\n// Push calls buf.alpha.registry.v1alpha1.PushService.Push.\nfunc (c *pushServiceClient) Push(ctx context.Context, req *connect.Request[v1alpha1.PushRequest]) (*connect.Response[v1alpha1.PushResponse], error) {\n\treturn c.push.CallUnary(ctx, req)\n}\n\n// PushManifestAndBlobs calls buf.alpha.registry.v1alpha1.PushService.PushManifestAndBlobs.\nfunc (c *pushServiceClient) PushManifestAndBlobs(ctx context.Context, req *connect.Request[v1alpha1.PushManifestAndBlobsRequest]) (*connect.Response[v1alpha1.PushManifestAndBlobsResponse], error) {\n\treturn c.pushManifestAndBlobs.CallUnary(ctx, req)\n}\n\n// PushServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.PushService service.\ntype PushServiceHandler interface {\n\t// Push pushes.\n\t// NOTE: Newer clients should use PushManifestAndBlobs.\n\tPush(context.Context, *connect.Request[v1alpha1.PushRequest]) (*connect.Response[v1alpha1.PushResponse], error)\n\t// PushManifestAndBlobs pushes a module by encoding it in a manifest and blobs format.\n\tPushManifestAndBlobs(context.Context, *connect.Request[v1alpha1.PushManifestAndBlobsRequest]) (*connect.Response[v1alpha1.PushManifestAndBlobsResponse], error)\n}\n\n// NewPushServiceHandler builds an HTTP handler from the service implementation. It returns the path\n// on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewPushServiceHandler(svc PushServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tpushServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_push_proto.Services().ByName(\"PushService\").Methods()\n\tpushServicePushHandler := connect.NewUnaryHandler(\n\t\tPushServicePushProcedure,\n\t\tsvc.Push,\n\t\tconnect.WithSchema(pushServiceMethods.ByName(\"Push\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tpushServicePushManifestAndBlobsHandler := connect.NewUnaryHandler(\n\t\tPushServicePushManifestAndBlobsProcedure,\n\t\tsvc.PushManifestAndBlobs,\n\t\tconnect.WithSchema(pushServiceMethods.ByName(\"PushManifestAndBlobs\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.PushService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase PushServicePushProcedure:\n\t\t\tpushServicePushHandler.ServeHTTP(w, r)\n\t\tcase PushServicePushManifestAndBlobsProcedure:\n\t\t\tpushServicePushManifestAndBlobsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedPushServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedPushServiceHandler struct{}\n\nfunc (UnimplementedPushServiceHandler) Push(context.Context, *connect.Request[v1alpha1.PushRequest]) (*connect.Response[v1alpha1.PushResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.PushService.Push is not implemented\"))\n}\n\nfunc (UnimplementedPushServiceHandler) PushManifestAndBlobs(context.Context, *connect.Request[v1alpha1.PushManifestAndBlobsRequest]) (*connect.Response[v1alpha1.PushManifestAndBlobsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.PushService.PushManifestAndBlobs is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/reference.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/reference.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// ReferenceServiceName is the fully-qualified name of the ReferenceService service.\n\tReferenceServiceName = \"buf.alpha.registry.v1alpha1.ReferenceService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// ReferenceServiceGetReferenceByNameProcedure is the fully-qualified name of the ReferenceService's\n\t// GetReferenceByName RPC.\n\tReferenceServiceGetReferenceByNameProcedure = \"/buf.alpha.registry.v1alpha1.ReferenceService/GetReferenceByName\"\n)\n\n// ReferenceServiceClient is a client for the buf.alpha.registry.v1alpha1.ReferenceService service.\ntype ReferenceServiceClient interface {\n\t// GetReferenceByName takes a reference name and returns the\n\t// reference either as main, a tag, or a commit.\n\tGetReferenceByName(context.Context, *connect.Request[v1alpha1.GetReferenceByNameRequest]) (*connect.Response[v1alpha1.GetReferenceByNameResponse], error)\n}\n\n// NewReferenceServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.ReferenceService service. By default, it uses the Connect protocol\n// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To\n// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()\n// options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewReferenceServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ReferenceServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\treferenceServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_reference_proto.Services().ByName(\"ReferenceService\").Methods()\n\treturn &referenceServiceClient{\n\t\tgetReferenceByName: connect.NewClient[v1alpha1.GetReferenceByNameRequest, v1alpha1.GetReferenceByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ReferenceServiceGetReferenceByNameProcedure,\n\t\t\tconnect.WithSchema(referenceServiceMethods.ByName(\"GetReferenceByName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// referenceServiceClient implements ReferenceServiceClient.\ntype referenceServiceClient struct {\n\tgetReferenceByName *connect.Client[v1alpha1.GetReferenceByNameRequest, v1alpha1.GetReferenceByNameResponse]\n}\n\n// GetReferenceByName calls buf.alpha.registry.v1alpha1.ReferenceService.GetReferenceByName.\nfunc (c *referenceServiceClient) GetReferenceByName(ctx context.Context, req *connect.Request[v1alpha1.GetReferenceByNameRequest]) (*connect.Response[v1alpha1.GetReferenceByNameResponse], error) {\n\treturn c.getReferenceByName.CallUnary(ctx, req)\n}\n\n// ReferenceServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.ReferenceService\n// service.\ntype ReferenceServiceHandler interface {\n\t// GetReferenceByName takes a reference name and returns the\n\t// reference either as main, a tag, or a commit.\n\tGetReferenceByName(context.Context, *connect.Request[v1alpha1.GetReferenceByNameRequest]) (*connect.Response[v1alpha1.GetReferenceByNameResponse], error)\n}\n\n// NewReferenceServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewReferenceServiceHandler(svc ReferenceServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\treferenceServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_reference_proto.Services().ByName(\"ReferenceService\").Methods()\n\treferenceServiceGetReferenceByNameHandler := connect.NewUnaryHandler(\n\t\tReferenceServiceGetReferenceByNameProcedure,\n\t\tsvc.GetReferenceByName,\n\t\tconnect.WithSchema(referenceServiceMethods.ByName(\"GetReferenceByName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.ReferenceService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase ReferenceServiceGetReferenceByNameProcedure:\n\t\t\treferenceServiceGetReferenceByNameHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedReferenceServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedReferenceServiceHandler struct{}\n\nfunc (UnimplementedReferenceServiceHandler) GetReferenceByName(context.Context, *connect.Request[v1alpha1.GetReferenceByNameRequest]) (*connect.Response[v1alpha1.GetReferenceByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ReferenceService.GetReferenceByName is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/repository.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// RepositoryServiceName is the fully-qualified name of the RepositoryService service.\n\tRepositoryServiceName = \"buf.alpha.registry.v1alpha1.RepositoryService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// RepositoryServiceGetRepositoryProcedure is the fully-qualified name of the RepositoryService's\n\t// GetRepository RPC.\n\tRepositoryServiceGetRepositoryProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/GetRepository\"\n\t// RepositoryServiceGetRepositoryByFullNameProcedure is the fully-qualified name of the\n\t// RepositoryService's GetRepositoryByFullName RPC.\n\tRepositoryServiceGetRepositoryByFullNameProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/GetRepositoryByFullName\"\n\t// RepositoryServiceListRepositoriesProcedure is the fully-qualified name of the RepositoryService's\n\t// ListRepositories RPC.\n\tRepositoryServiceListRepositoriesProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/ListRepositories\"\n\t// RepositoryServiceListUserRepositoriesProcedure is the fully-qualified name of the\n\t// RepositoryService's ListUserRepositories RPC.\n\tRepositoryServiceListUserRepositoriesProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/ListUserRepositories\"\n\t// RepositoryServiceListRepositoriesUserCanAccessProcedure is the fully-qualified name of the\n\t// RepositoryService's ListRepositoriesUserCanAccess RPC.\n\tRepositoryServiceListRepositoriesUserCanAccessProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/ListRepositoriesUserCanAccess\"\n\t// RepositoryServiceListOrganizationRepositoriesProcedure is the fully-qualified name of the\n\t// RepositoryService's ListOrganizationRepositories RPC.\n\tRepositoryServiceListOrganizationRepositoriesProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/ListOrganizationRepositories\"\n\t// RepositoryServiceCreateRepositoryByFullNameProcedure is the fully-qualified name of the\n\t// RepositoryService's CreateRepositoryByFullName RPC.\n\tRepositoryServiceCreateRepositoryByFullNameProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/CreateRepositoryByFullName\"\n\t// RepositoryServiceDeleteRepositoryProcedure is the fully-qualified name of the RepositoryService's\n\t// DeleteRepository RPC.\n\tRepositoryServiceDeleteRepositoryProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/DeleteRepository\"\n\t// RepositoryServiceDeleteRepositoryByFullNameProcedure is the fully-qualified name of the\n\t// RepositoryService's DeleteRepositoryByFullName RPC.\n\tRepositoryServiceDeleteRepositoryByFullNameProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/DeleteRepositoryByFullName\"\n\t// RepositoryServiceDeprecateRepositoryByNameProcedure is the fully-qualified name of the\n\t// RepositoryService's DeprecateRepositoryByName RPC.\n\tRepositoryServiceDeprecateRepositoryByNameProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/DeprecateRepositoryByName\"\n\t// RepositoryServiceUndeprecateRepositoryByNameProcedure is the fully-qualified name of the\n\t// RepositoryService's UndeprecateRepositoryByName RPC.\n\tRepositoryServiceUndeprecateRepositoryByNameProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/UndeprecateRepositoryByName\"\n\t// RepositoryServiceGetRepositoriesByFullNameProcedure is the fully-qualified name of the\n\t// RepositoryService's GetRepositoriesByFullName RPC.\n\tRepositoryServiceGetRepositoriesByFullNameProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/GetRepositoriesByFullName\"\n\t// RepositoryServiceSetRepositoryContributorProcedure is the fully-qualified name of the\n\t// RepositoryService's SetRepositoryContributor RPC.\n\tRepositoryServiceSetRepositoryContributorProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/SetRepositoryContributor\"\n\t// RepositoryServiceListRepositoryContributorsProcedure is the fully-qualified name of the\n\t// RepositoryService's ListRepositoryContributors RPC.\n\tRepositoryServiceListRepositoryContributorsProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/ListRepositoryContributors\"\n\t// RepositoryServiceGetRepositorySettingsProcedure is the fully-qualified name of the\n\t// RepositoryService's GetRepositorySettings RPC.\n\tRepositoryServiceGetRepositorySettingsProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/GetRepositorySettings\"\n\t// RepositoryServiceUpdateRepositorySettingsByNameProcedure is the fully-qualified name of the\n\t// RepositoryService's UpdateRepositorySettingsByName RPC.\n\tRepositoryServiceUpdateRepositorySettingsByNameProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/UpdateRepositorySettingsByName\"\n\t// RepositoryServiceGetRepositoriesMetadataProcedure is the fully-qualified name of the\n\t// RepositoryService's GetRepositoriesMetadata RPC.\n\tRepositoryServiceGetRepositoriesMetadataProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/GetRepositoriesMetadata\"\n\t// RepositoryServiceGetRepositoryDependencyDOTStringProcedure is the fully-qualified name of the\n\t// RepositoryService's GetRepositoryDependencyDOTString RPC.\n\tRepositoryServiceGetRepositoryDependencyDOTStringProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/GetRepositoryDependencyDOTString\"\n\t// RepositoryServiceAddRepositoryGroupProcedure is the fully-qualified name of the\n\t// RepositoryService's AddRepositoryGroup RPC.\n\tRepositoryServiceAddRepositoryGroupProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/AddRepositoryGroup\"\n\t// RepositoryServiceUpdateRepositoryGroupProcedure is the fully-qualified name of the\n\t// RepositoryService's UpdateRepositoryGroup RPC.\n\tRepositoryServiceUpdateRepositoryGroupProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/UpdateRepositoryGroup\"\n\t// RepositoryServiceRemoveRepositoryGroupProcedure is the fully-qualified name of the\n\t// RepositoryService's RemoveRepositoryGroup RPC.\n\tRepositoryServiceRemoveRepositoryGroupProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryService/RemoveRepositoryGroup\"\n)\n\n// RepositoryServiceClient is a client for the buf.alpha.registry.v1alpha1.RepositoryService\n// service.\ntype RepositoryServiceClient interface {\n\t// GetRepository gets a repository by ID.\n\tGetRepository(context.Context, *connect.Request[v1alpha1.GetRepositoryRequest]) (*connect.Response[v1alpha1.GetRepositoryResponse], error)\n\t// GetRepositoryByFullName gets a repository by full name.\n\tGetRepositoryByFullName(context.Context, *connect.Request[v1alpha1.GetRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoryByFullNameResponse], error)\n\t// ListRepositories lists all repositories.\n\tListRepositories(context.Context, *connect.Request[v1alpha1.ListRepositoriesRequest]) (*connect.Response[v1alpha1.ListRepositoriesResponse], error)\n\t// ListUserRepositories lists all repositories belonging to a user.\n\tListUserRepositories(context.Context, *connect.Request[v1alpha1.ListUserRepositoriesRequest]) (*connect.Response[v1alpha1.ListUserRepositoriesResponse], error)\n\t// ListRepositoriesUserCanAccess lists all repositories a user can access.\n\tListRepositoriesUserCanAccess(context.Context, *connect.Request[v1alpha1.ListRepositoriesUserCanAccessRequest]) (*connect.Response[v1alpha1.ListRepositoriesUserCanAccessResponse], error)\n\t// ListOrganizationRepositories lists all repositories for an organization.\n\tListOrganizationRepositories(context.Context, *connect.Request[v1alpha1.ListOrganizationRepositoriesRequest]) (*connect.Response[v1alpha1.ListOrganizationRepositoriesResponse], error)\n\t// CreateRepositoryByFullName creates a new repository by full name.\n\tCreateRepositoryByFullName(context.Context, *connect.Request[v1alpha1.CreateRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.CreateRepositoryByFullNameResponse], error)\n\t// DeleteRepository deletes a repository.\n\tDeleteRepository(context.Context, *connect.Request[v1alpha1.DeleteRepositoryRequest]) (*connect.Response[v1alpha1.DeleteRepositoryResponse], error)\n\t// DeleteRepositoryByFullName deletes a repository by full name.\n\tDeleteRepositoryByFullName(context.Context, *connect.Request[v1alpha1.DeleteRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.DeleteRepositoryByFullNameResponse], error)\n\t// DeprecateRepositoryByName deprecates the repository.\n\tDeprecateRepositoryByName(context.Context, *connect.Request[v1alpha1.DeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.DeprecateRepositoryByNameResponse], error)\n\t// UndeprecateRepositoryByName makes the repository not deprecated and removes any deprecation_message.\n\tUndeprecateRepositoryByName(context.Context, *connect.Request[v1alpha1.UndeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.UndeprecateRepositoryByNameResponse], error)\n\t// GetRepositoriesByFullName gets repositories by full name. Response order is unspecified.\n\t// Errors if any of the repositories don't exist or the caller does not have access to any of the repositories.\n\tGetRepositoriesByFullName(context.Context, *connect.Request[v1alpha1.GetRepositoriesByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoriesByFullNameResponse], error)\n\t// SetRepositoryContributor sets the role of a user in the repository.\n\tSetRepositoryContributor(context.Context, *connect.Request[v1alpha1.SetRepositoryContributorRequest]) (*connect.Response[v1alpha1.SetRepositoryContributorResponse], error)\n\t// ListRepositoryContributors returns the list of contributors that has an explicit role against the repository.\n\t// This does not include users who have implicit roles against the repository, unless they have also been\n\t// assigned a role explicitly.\n\tListRepositoryContributors(context.Context, *connect.Request[v1alpha1.ListRepositoryContributorsRequest]) (*connect.Response[v1alpha1.ListRepositoryContributorsResponse], error)\n\t// GetRepositorySettings gets the settings of a repository.\n\tGetRepositorySettings(context.Context, *connect.Request[v1alpha1.GetRepositorySettingsRequest]) (*connect.Response[v1alpha1.GetRepositorySettingsResponse], error)\n\t// UpdateRepositorySettingsByName updates the settings of a repository.\n\tUpdateRepositorySettingsByName(context.Context, *connect.Request[v1alpha1.UpdateRepositorySettingsByNameRequest]) (*connect.Response[v1alpha1.UpdateRepositorySettingsByNameResponse], error)\n\t// GetRepositoriesMetadata gets the metadata of the repositories in the request, the length of repositories in the\n\t// request should match the length of the metadata in the response, and the order of repositories in the response\n\t// should match the order of the metadata in the request.\n\tGetRepositoriesMetadata(context.Context, *connect.Request[v1alpha1.GetRepositoriesMetadataRequest]) (*connect.Response[v1alpha1.GetRepositoriesMetadataResponse], error)\n\t// GetRepositoryDependencyDOTString gets the dependency graph DOT string for the repository.\n\tGetRepositoryDependencyDOTString(context.Context, *connect.Request[v1alpha1.GetRepositoryDependencyDOTStringRequest]) (*connect.Response[v1alpha1.GetRepositoryDependencyDOTStringResponse], error)\n\t// AddRepositoryGroup adds an IdP Group to the repository.\n\t//\n\t// Only repositories owned by an organization can have groups.\n\tAddRepositoryGroup(context.Context, *connect.Request[v1alpha1.AddRepositoryGroupRequest]) (*connect.Response[v1alpha1.AddRepositoryGroupResponse], error)\n\t// UpdateRepositoryGroup updates an IdP Group for the repository.\n\tUpdateRepositoryGroup(context.Context, *connect.Request[v1alpha1.UpdateRepositoryGroupRequest]) (*connect.Response[v1alpha1.UpdateRepositoryGroupResponse], error)\n\t// RemoveRepositoryGroup removes an IdP Group from the repository.\n\tRemoveRepositoryGroup(context.Context, *connect.Request[v1alpha1.RemoveRepositoryGroupRequest]) (*connect.Response[v1alpha1.RemoveRepositoryGroupResponse], error)\n}\n\n// NewRepositoryServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.RepositoryService service. By default, it uses the Connect protocol\n// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To\n// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()\n// options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewRepositoryServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RepositoryServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\trepositoryServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_proto.Services().ByName(\"RepositoryService\").Methods()\n\treturn &repositoryServiceClient{\n\t\tgetRepository: connect.NewClient[v1alpha1.GetRepositoryRequest, v1alpha1.GetRepositoryResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceGetRepositoryProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepository\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetRepositoryByFullName: connect.NewClient[v1alpha1.GetRepositoryByFullNameRequest, v1alpha1.GetRepositoryByFullNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceGetRepositoryByFullNameProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoryByFullName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositories: connect.NewClient[v1alpha1.ListRepositoriesRequest, v1alpha1.ListRepositoriesResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceListRepositoriesProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListRepositories\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistUserRepositories: connect.NewClient[v1alpha1.ListUserRepositoriesRequest, v1alpha1.ListUserRepositoriesResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceListUserRepositoriesProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListUserRepositories\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoriesUserCanAccess: connect.NewClient[v1alpha1.ListRepositoriesUserCanAccessRequest, v1alpha1.ListRepositoriesUserCanAccessResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceListRepositoriesUserCanAccessProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListRepositoriesUserCanAccess\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistOrganizationRepositories: connect.NewClient[v1alpha1.ListOrganizationRepositoriesRequest, v1alpha1.ListOrganizationRepositoriesResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceListOrganizationRepositoriesProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListOrganizationRepositories\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tcreateRepositoryByFullName: connect.NewClient[v1alpha1.CreateRepositoryByFullNameRequest, v1alpha1.CreateRepositoryByFullNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceCreateRepositoryByFullNameProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"CreateRepositoryByFullName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteRepository: connect.NewClient[v1alpha1.DeleteRepositoryRequest, v1alpha1.DeleteRepositoryResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceDeleteRepositoryProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"DeleteRepository\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteRepositoryByFullName: connect.NewClient[v1alpha1.DeleteRepositoryByFullNameRequest, v1alpha1.DeleteRepositoryByFullNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceDeleteRepositoryByFullNameProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"DeleteRepositoryByFullName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeprecateRepositoryByName: connect.NewClient[v1alpha1.DeprecateRepositoryByNameRequest, v1alpha1.DeprecateRepositoryByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceDeprecateRepositoryByNameProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"DeprecateRepositoryByName\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tundeprecateRepositoryByName: connect.NewClient[v1alpha1.UndeprecateRepositoryByNameRequest, v1alpha1.UndeprecateRepositoryByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceUndeprecateRepositoryByNameProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"UndeprecateRepositoryByName\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetRepositoriesByFullName: connect.NewClient[v1alpha1.GetRepositoriesByFullNameRequest, v1alpha1.GetRepositoriesByFullNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceGetRepositoriesByFullNameProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoriesByFullName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tsetRepositoryContributor: connect.NewClient[v1alpha1.SetRepositoryContributorRequest, v1alpha1.SetRepositoryContributorResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceSetRepositoryContributorProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"SetRepositoryContributor\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoryContributors: connect.NewClient[v1alpha1.ListRepositoryContributorsRequest, v1alpha1.ListRepositoryContributorsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceListRepositoryContributorsProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListRepositoryContributors\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetRepositorySettings: connect.NewClient[v1alpha1.GetRepositorySettingsRequest, v1alpha1.GetRepositorySettingsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceGetRepositorySettingsProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositorySettings\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateRepositorySettingsByName: connect.NewClient[v1alpha1.UpdateRepositorySettingsByNameRequest, v1alpha1.UpdateRepositorySettingsByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceUpdateRepositorySettingsByNameProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"UpdateRepositorySettingsByName\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetRepositoriesMetadata: connect.NewClient[v1alpha1.GetRepositoriesMetadataRequest, v1alpha1.GetRepositoriesMetadataResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceGetRepositoriesMetadataProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoriesMetadata\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetRepositoryDependencyDOTString: connect.NewClient[v1alpha1.GetRepositoryDependencyDOTStringRequest, v1alpha1.GetRepositoryDependencyDOTStringResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceGetRepositoryDependencyDOTStringProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoryDependencyDOTString\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\taddRepositoryGroup: connect.NewClient[v1alpha1.AddRepositoryGroupRequest, v1alpha1.AddRepositoryGroupResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceAddRepositoryGroupProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"AddRepositoryGroup\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateRepositoryGroup: connect.NewClient[v1alpha1.UpdateRepositoryGroupRequest, v1alpha1.UpdateRepositoryGroupResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceUpdateRepositoryGroupProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"UpdateRepositoryGroup\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tremoveRepositoryGroup: connect.NewClient[v1alpha1.RemoveRepositoryGroupRequest, v1alpha1.RemoveRepositoryGroupResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryServiceRemoveRepositoryGroupProcedure,\n\t\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"RemoveRepositoryGroup\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// repositoryServiceClient implements RepositoryServiceClient.\ntype repositoryServiceClient struct {\n\tgetRepository                    *connect.Client[v1alpha1.GetRepositoryRequest, v1alpha1.GetRepositoryResponse]\n\tgetRepositoryByFullName          *connect.Client[v1alpha1.GetRepositoryByFullNameRequest, v1alpha1.GetRepositoryByFullNameResponse]\n\tlistRepositories                 *connect.Client[v1alpha1.ListRepositoriesRequest, v1alpha1.ListRepositoriesResponse]\n\tlistUserRepositories             *connect.Client[v1alpha1.ListUserRepositoriesRequest, v1alpha1.ListUserRepositoriesResponse]\n\tlistRepositoriesUserCanAccess    *connect.Client[v1alpha1.ListRepositoriesUserCanAccessRequest, v1alpha1.ListRepositoriesUserCanAccessResponse]\n\tlistOrganizationRepositories     *connect.Client[v1alpha1.ListOrganizationRepositoriesRequest, v1alpha1.ListOrganizationRepositoriesResponse]\n\tcreateRepositoryByFullName       *connect.Client[v1alpha1.CreateRepositoryByFullNameRequest, v1alpha1.CreateRepositoryByFullNameResponse]\n\tdeleteRepository                 *connect.Client[v1alpha1.DeleteRepositoryRequest, v1alpha1.DeleteRepositoryResponse]\n\tdeleteRepositoryByFullName       *connect.Client[v1alpha1.DeleteRepositoryByFullNameRequest, v1alpha1.DeleteRepositoryByFullNameResponse]\n\tdeprecateRepositoryByName        *connect.Client[v1alpha1.DeprecateRepositoryByNameRequest, v1alpha1.DeprecateRepositoryByNameResponse]\n\tundeprecateRepositoryByName      *connect.Client[v1alpha1.UndeprecateRepositoryByNameRequest, v1alpha1.UndeprecateRepositoryByNameResponse]\n\tgetRepositoriesByFullName        *connect.Client[v1alpha1.GetRepositoriesByFullNameRequest, v1alpha1.GetRepositoriesByFullNameResponse]\n\tsetRepositoryContributor         *connect.Client[v1alpha1.SetRepositoryContributorRequest, v1alpha1.SetRepositoryContributorResponse]\n\tlistRepositoryContributors       *connect.Client[v1alpha1.ListRepositoryContributorsRequest, v1alpha1.ListRepositoryContributorsResponse]\n\tgetRepositorySettings            *connect.Client[v1alpha1.GetRepositorySettingsRequest, v1alpha1.GetRepositorySettingsResponse]\n\tupdateRepositorySettingsByName   *connect.Client[v1alpha1.UpdateRepositorySettingsByNameRequest, v1alpha1.UpdateRepositorySettingsByNameResponse]\n\tgetRepositoriesMetadata          *connect.Client[v1alpha1.GetRepositoriesMetadataRequest, v1alpha1.GetRepositoriesMetadataResponse]\n\tgetRepositoryDependencyDOTString *connect.Client[v1alpha1.GetRepositoryDependencyDOTStringRequest, v1alpha1.GetRepositoryDependencyDOTStringResponse]\n\taddRepositoryGroup               *connect.Client[v1alpha1.AddRepositoryGroupRequest, v1alpha1.AddRepositoryGroupResponse]\n\tupdateRepositoryGroup            *connect.Client[v1alpha1.UpdateRepositoryGroupRequest, v1alpha1.UpdateRepositoryGroupResponse]\n\tremoveRepositoryGroup            *connect.Client[v1alpha1.RemoveRepositoryGroupRequest, v1alpha1.RemoveRepositoryGroupResponse]\n}\n\n// GetRepository calls buf.alpha.registry.v1alpha1.RepositoryService.GetRepository.\nfunc (c *repositoryServiceClient) GetRepository(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoryRequest]) (*connect.Response[v1alpha1.GetRepositoryResponse], error) {\n\treturn c.getRepository.CallUnary(ctx, req)\n}\n\n// GetRepositoryByFullName calls\n// buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryByFullName.\nfunc (c *repositoryServiceClient) GetRepositoryByFullName(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoryByFullNameResponse], error) {\n\treturn c.getRepositoryByFullName.CallUnary(ctx, req)\n}\n\n// ListRepositories calls buf.alpha.registry.v1alpha1.RepositoryService.ListRepositories.\nfunc (c *repositoryServiceClient) ListRepositories(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoriesRequest]) (*connect.Response[v1alpha1.ListRepositoriesResponse], error) {\n\treturn c.listRepositories.CallUnary(ctx, req)\n}\n\n// ListUserRepositories calls buf.alpha.registry.v1alpha1.RepositoryService.ListUserRepositories.\nfunc (c *repositoryServiceClient) ListUserRepositories(ctx context.Context, req *connect.Request[v1alpha1.ListUserRepositoriesRequest]) (*connect.Response[v1alpha1.ListUserRepositoriesResponse], error) {\n\treturn c.listUserRepositories.CallUnary(ctx, req)\n}\n\n// ListRepositoriesUserCanAccess calls\n// buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoriesUserCanAccess.\nfunc (c *repositoryServiceClient) ListRepositoriesUserCanAccess(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoriesUserCanAccessRequest]) (*connect.Response[v1alpha1.ListRepositoriesUserCanAccessResponse], error) {\n\treturn c.listRepositoriesUserCanAccess.CallUnary(ctx, req)\n}\n\n// ListOrganizationRepositories calls\n// buf.alpha.registry.v1alpha1.RepositoryService.ListOrganizationRepositories.\nfunc (c *repositoryServiceClient) ListOrganizationRepositories(ctx context.Context, req *connect.Request[v1alpha1.ListOrganizationRepositoriesRequest]) (*connect.Response[v1alpha1.ListOrganizationRepositoriesResponse], error) {\n\treturn c.listOrganizationRepositories.CallUnary(ctx, req)\n}\n\n// CreateRepositoryByFullName calls\n// buf.alpha.registry.v1alpha1.RepositoryService.CreateRepositoryByFullName.\nfunc (c *repositoryServiceClient) CreateRepositoryByFullName(ctx context.Context, req *connect.Request[v1alpha1.CreateRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.CreateRepositoryByFullNameResponse], error) {\n\treturn c.createRepositoryByFullName.CallUnary(ctx, req)\n}\n\n// DeleteRepository calls buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepository.\nfunc (c *repositoryServiceClient) DeleteRepository(ctx context.Context, req *connect.Request[v1alpha1.DeleteRepositoryRequest]) (*connect.Response[v1alpha1.DeleteRepositoryResponse], error) {\n\treturn c.deleteRepository.CallUnary(ctx, req)\n}\n\n// DeleteRepositoryByFullName calls\n// buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepositoryByFullName.\nfunc (c *repositoryServiceClient) DeleteRepositoryByFullName(ctx context.Context, req *connect.Request[v1alpha1.DeleteRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.DeleteRepositoryByFullNameResponse], error) {\n\treturn c.deleteRepositoryByFullName.CallUnary(ctx, req)\n}\n\n// DeprecateRepositoryByName calls\n// buf.alpha.registry.v1alpha1.RepositoryService.DeprecateRepositoryByName.\nfunc (c *repositoryServiceClient) DeprecateRepositoryByName(ctx context.Context, req *connect.Request[v1alpha1.DeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.DeprecateRepositoryByNameResponse], error) {\n\treturn c.deprecateRepositoryByName.CallUnary(ctx, req)\n}\n\n// UndeprecateRepositoryByName calls\n// buf.alpha.registry.v1alpha1.RepositoryService.UndeprecateRepositoryByName.\nfunc (c *repositoryServiceClient) UndeprecateRepositoryByName(ctx context.Context, req *connect.Request[v1alpha1.UndeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.UndeprecateRepositoryByNameResponse], error) {\n\treturn c.undeprecateRepositoryByName.CallUnary(ctx, req)\n}\n\n// GetRepositoriesByFullName calls\n// buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesByFullName.\nfunc (c *repositoryServiceClient) GetRepositoriesByFullName(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoriesByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoriesByFullNameResponse], error) {\n\treturn c.getRepositoriesByFullName.CallUnary(ctx, req)\n}\n\n// SetRepositoryContributor calls\n// buf.alpha.registry.v1alpha1.RepositoryService.SetRepositoryContributor.\nfunc (c *repositoryServiceClient) SetRepositoryContributor(ctx context.Context, req *connect.Request[v1alpha1.SetRepositoryContributorRequest]) (*connect.Response[v1alpha1.SetRepositoryContributorResponse], error) {\n\treturn c.setRepositoryContributor.CallUnary(ctx, req)\n}\n\n// ListRepositoryContributors calls\n// buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoryContributors.\nfunc (c *repositoryServiceClient) ListRepositoryContributors(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryContributorsRequest]) (*connect.Response[v1alpha1.ListRepositoryContributorsResponse], error) {\n\treturn c.listRepositoryContributors.CallUnary(ctx, req)\n}\n\n// GetRepositorySettings calls buf.alpha.registry.v1alpha1.RepositoryService.GetRepositorySettings.\nfunc (c *repositoryServiceClient) GetRepositorySettings(ctx context.Context, req *connect.Request[v1alpha1.GetRepositorySettingsRequest]) (*connect.Response[v1alpha1.GetRepositorySettingsResponse], error) {\n\treturn c.getRepositorySettings.CallUnary(ctx, req)\n}\n\n// UpdateRepositorySettingsByName calls\n// buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositorySettingsByName.\nfunc (c *repositoryServiceClient) UpdateRepositorySettingsByName(ctx context.Context, req *connect.Request[v1alpha1.UpdateRepositorySettingsByNameRequest]) (*connect.Response[v1alpha1.UpdateRepositorySettingsByNameResponse], error) {\n\treturn c.updateRepositorySettingsByName.CallUnary(ctx, req)\n}\n\n// GetRepositoriesMetadata calls\n// buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesMetadata.\nfunc (c *repositoryServiceClient) GetRepositoriesMetadata(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoriesMetadataRequest]) (*connect.Response[v1alpha1.GetRepositoriesMetadataResponse], error) {\n\treturn c.getRepositoriesMetadata.CallUnary(ctx, req)\n}\n\n// GetRepositoryDependencyDOTString calls\n// buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryDependencyDOTString.\nfunc (c *repositoryServiceClient) GetRepositoryDependencyDOTString(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoryDependencyDOTStringRequest]) (*connect.Response[v1alpha1.GetRepositoryDependencyDOTStringResponse], error) {\n\treturn c.getRepositoryDependencyDOTString.CallUnary(ctx, req)\n}\n\n// AddRepositoryGroup calls buf.alpha.registry.v1alpha1.RepositoryService.AddRepositoryGroup.\nfunc (c *repositoryServiceClient) AddRepositoryGroup(ctx context.Context, req *connect.Request[v1alpha1.AddRepositoryGroupRequest]) (*connect.Response[v1alpha1.AddRepositoryGroupResponse], error) {\n\treturn c.addRepositoryGroup.CallUnary(ctx, req)\n}\n\n// UpdateRepositoryGroup calls buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositoryGroup.\nfunc (c *repositoryServiceClient) UpdateRepositoryGroup(ctx context.Context, req *connect.Request[v1alpha1.UpdateRepositoryGroupRequest]) (*connect.Response[v1alpha1.UpdateRepositoryGroupResponse], error) {\n\treturn c.updateRepositoryGroup.CallUnary(ctx, req)\n}\n\n// RemoveRepositoryGroup calls buf.alpha.registry.v1alpha1.RepositoryService.RemoveRepositoryGroup.\nfunc (c *repositoryServiceClient) RemoveRepositoryGroup(ctx context.Context, req *connect.Request[v1alpha1.RemoveRepositoryGroupRequest]) (*connect.Response[v1alpha1.RemoveRepositoryGroupResponse], error) {\n\treturn c.removeRepositoryGroup.CallUnary(ctx, req)\n}\n\n// RepositoryServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.RepositoryService service.\ntype RepositoryServiceHandler interface {\n\t// GetRepository gets a repository by ID.\n\tGetRepository(context.Context, *connect.Request[v1alpha1.GetRepositoryRequest]) (*connect.Response[v1alpha1.GetRepositoryResponse], error)\n\t// GetRepositoryByFullName gets a repository by full name.\n\tGetRepositoryByFullName(context.Context, *connect.Request[v1alpha1.GetRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoryByFullNameResponse], error)\n\t// ListRepositories lists all repositories.\n\tListRepositories(context.Context, *connect.Request[v1alpha1.ListRepositoriesRequest]) (*connect.Response[v1alpha1.ListRepositoriesResponse], error)\n\t// ListUserRepositories lists all repositories belonging to a user.\n\tListUserRepositories(context.Context, *connect.Request[v1alpha1.ListUserRepositoriesRequest]) (*connect.Response[v1alpha1.ListUserRepositoriesResponse], error)\n\t// ListRepositoriesUserCanAccess lists all repositories a user can access.\n\tListRepositoriesUserCanAccess(context.Context, *connect.Request[v1alpha1.ListRepositoriesUserCanAccessRequest]) (*connect.Response[v1alpha1.ListRepositoriesUserCanAccessResponse], error)\n\t// ListOrganizationRepositories lists all repositories for an organization.\n\tListOrganizationRepositories(context.Context, *connect.Request[v1alpha1.ListOrganizationRepositoriesRequest]) (*connect.Response[v1alpha1.ListOrganizationRepositoriesResponse], error)\n\t// CreateRepositoryByFullName creates a new repository by full name.\n\tCreateRepositoryByFullName(context.Context, *connect.Request[v1alpha1.CreateRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.CreateRepositoryByFullNameResponse], error)\n\t// DeleteRepository deletes a repository.\n\tDeleteRepository(context.Context, *connect.Request[v1alpha1.DeleteRepositoryRequest]) (*connect.Response[v1alpha1.DeleteRepositoryResponse], error)\n\t// DeleteRepositoryByFullName deletes a repository by full name.\n\tDeleteRepositoryByFullName(context.Context, *connect.Request[v1alpha1.DeleteRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.DeleteRepositoryByFullNameResponse], error)\n\t// DeprecateRepositoryByName deprecates the repository.\n\tDeprecateRepositoryByName(context.Context, *connect.Request[v1alpha1.DeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.DeprecateRepositoryByNameResponse], error)\n\t// UndeprecateRepositoryByName makes the repository not deprecated and removes any deprecation_message.\n\tUndeprecateRepositoryByName(context.Context, *connect.Request[v1alpha1.UndeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.UndeprecateRepositoryByNameResponse], error)\n\t// GetRepositoriesByFullName gets repositories by full name. Response order is unspecified.\n\t// Errors if any of the repositories don't exist or the caller does not have access to any of the repositories.\n\tGetRepositoriesByFullName(context.Context, *connect.Request[v1alpha1.GetRepositoriesByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoriesByFullNameResponse], error)\n\t// SetRepositoryContributor sets the role of a user in the repository.\n\tSetRepositoryContributor(context.Context, *connect.Request[v1alpha1.SetRepositoryContributorRequest]) (*connect.Response[v1alpha1.SetRepositoryContributorResponse], error)\n\t// ListRepositoryContributors returns the list of contributors that has an explicit role against the repository.\n\t// This does not include users who have implicit roles against the repository, unless they have also been\n\t// assigned a role explicitly.\n\tListRepositoryContributors(context.Context, *connect.Request[v1alpha1.ListRepositoryContributorsRequest]) (*connect.Response[v1alpha1.ListRepositoryContributorsResponse], error)\n\t// GetRepositorySettings gets the settings of a repository.\n\tGetRepositorySettings(context.Context, *connect.Request[v1alpha1.GetRepositorySettingsRequest]) (*connect.Response[v1alpha1.GetRepositorySettingsResponse], error)\n\t// UpdateRepositorySettingsByName updates the settings of a repository.\n\tUpdateRepositorySettingsByName(context.Context, *connect.Request[v1alpha1.UpdateRepositorySettingsByNameRequest]) (*connect.Response[v1alpha1.UpdateRepositorySettingsByNameResponse], error)\n\t// GetRepositoriesMetadata gets the metadata of the repositories in the request, the length of repositories in the\n\t// request should match the length of the metadata in the response, and the order of repositories in the response\n\t// should match the order of the metadata in the request.\n\tGetRepositoriesMetadata(context.Context, *connect.Request[v1alpha1.GetRepositoriesMetadataRequest]) (*connect.Response[v1alpha1.GetRepositoriesMetadataResponse], error)\n\t// GetRepositoryDependencyDOTString gets the dependency graph DOT string for the repository.\n\tGetRepositoryDependencyDOTString(context.Context, *connect.Request[v1alpha1.GetRepositoryDependencyDOTStringRequest]) (*connect.Response[v1alpha1.GetRepositoryDependencyDOTStringResponse], error)\n\t// AddRepositoryGroup adds an IdP Group to the repository.\n\t//\n\t// Only repositories owned by an organization can have groups.\n\tAddRepositoryGroup(context.Context, *connect.Request[v1alpha1.AddRepositoryGroupRequest]) (*connect.Response[v1alpha1.AddRepositoryGroupResponse], error)\n\t// UpdateRepositoryGroup updates an IdP Group for the repository.\n\tUpdateRepositoryGroup(context.Context, *connect.Request[v1alpha1.UpdateRepositoryGroupRequest]) (*connect.Response[v1alpha1.UpdateRepositoryGroupResponse], error)\n\t// RemoveRepositoryGroup removes an IdP Group from the repository.\n\tRemoveRepositoryGroup(context.Context, *connect.Request[v1alpha1.RemoveRepositoryGroupRequest]) (*connect.Response[v1alpha1.RemoveRepositoryGroupResponse], error)\n}\n\n// NewRepositoryServiceHandler builds an HTTP handler from the service implementation. It returns\n// the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewRepositoryServiceHandler(svc RepositoryServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\trepositoryServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_proto.Services().ByName(\"RepositoryService\").Methods()\n\trepositoryServiceGetRepositoryHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceGetRepositoryProcedure,\n\t\tsvc.GetRepository,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepository\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceGetRepositoryByFullNameHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceGetRepositoryByFullNameProcedure,\n\t\tsvc.GetRepositoryByFullName,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoryByFullName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceListRepositoriesHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceListRepositoriesProcedure,\n\t\tsvc.ListRepositories,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListRepositories\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceListUserRepositoriesHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceListUserRepositoriesProcedure,\n\t\tsvc.ListUserRepositories,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListUserRepositories\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceListRepositoriesUserCanAccessHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceListRepositoriesUserCanAccessProcedure,\n\t\tsvc.ListRepositoriesUserCanAccess,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListRepositoriesUserCanAccess\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceListOrganizationRepositoriesHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceListOrganizationRepositoriesProcedure,\n\t\tsvc.ListOrganizationRepositories,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListOrganizationRepositories\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceCreateRepositoryByFullNameHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceCreateRepositoryByFullNameProcedure,\n\t\tsvc.CreateRepositoryByFullName,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"CreateRepositoryByFullName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceDeleteRepositoryHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceDeleteRepositoryProcedure,\n\t\tsvc.DeleteRepository,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"DeleteRepository\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceDeleteRepositoryByFullNameHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceDeleteRepositoryByFullNameProcedure,\n\t\tsvc.DeleteRepositoryByFullName,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"DeleteRepositoryByFullName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceDeprecateRepositoryByNameHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceDeprecateRepositoryByNameProcedure,\n\t\tsvc.DeprecateRepositoryByName,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"DeprecateRepositoryByName\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceUndeprecateRepositoryByNameHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceUndeprecateRepositoryByNameProcedure,\n\t\tsvc.UndeprecateRepositoryByName,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"UndeprecateRepositoryByName\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceGetRepositoriesByFullNameHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceGetRepositoriesByFullNameProcedure,\n\t\tsvc.GetRepositoriesByFullName,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoriesByFullName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceSetRepositoryContributorHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceSetRepositoryContributorProcedure,\n\t\tsvc.SetRepositoryContributor,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"SetRepositoryContributor\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceListRepositoryContributorsHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceListRepositoryContributorsProcedure,\n\t\tsvc.ListRepositoryContributors,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"ListRepositoryContributors\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceGetRepositorySettingsHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceGetRepositorySettingsProcedure,\n\t\tsvc.GetRepositorySettings,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositorySettings\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceUpdateRepositorySettingsByNameHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceUpdateRepositorySettingsByNameProcedure,\n\t\tsvc.UpdateRepositorySettingsByName,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"UpdateRepositorySettingsByName\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceGetRepositoriesMetadataHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceGetRepositoriesMetadataProcedure,\n\t\tsvc.GetRepositoriesMetadata,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoriesMetadata\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceGetRepositoryDependencyDOTStringHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceGetRepositoryDependencyDOTStringProcedure,\n\t\tsvc.GetRepositoryDependencyDOTString,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"GetRepositoryDependencyDOTString\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceAddRepositoryGroupHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceAddRepositoryGroupProcedure,\n\t\tsvc.AddRepositoryGroup,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"AddRepositoryGroup\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceUpdateRepositoryGroupHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceUpdateRepositoryGroupProcedure,\n\t\tsvc.UpdateRepositoryGroup,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"UpdateRepositoryGroup\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryServiceRemoveRepositoryGroupHandler := connect.NewUnaryHandler(\n\t\tRepositoryServiceRemoveRepositoryGroupProcedure,\n\t\tsvc.RemoveRepositoryGroup,\n\t\tconnect.WithSchema(repositoryServiceMethods.ByName(\"RemoveRepositoryGroup\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.RepositoryService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase RepositoryServiceGetRepositoryProcedure:\n\t\t\trepositoryServiceGetRepositoryHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceGetRepositoryByFullNameProcedure:\n\t\t\trepositoryServiceGetRepositoryByFullNameHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceListRepositoriesProcedure:\n\t\t\trepositoryServiceListRepositoriesHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceListUserRepositoriesProcedure:\n\t\t\trepositoryServiceListUserRepositoriesHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceListRepositoriesUserCanAccessProcedure:\n\t\t\trepositoryServiceListRepositoriesUserCanAccessHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceListOrganizationRepositoriesProcedure:\n\t\t\trepositoryServiceListOrganizationRepositoriesHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceCreateRepositoryByFullNameProcedure:\n\t\t\trepositoryServiceCreateRepositoryByFullNameHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceDeleteRepositoryProcedure:\n\t\t\trepositoryServiceDeleteRepositoryHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceDeleteRepositoryByFullNameProcedure:\n\t\t\trepositoryServiceDeleteRepositoryByFullNameHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceDeprecateRepositoryByNameProcedure:\n\t\t\trepositoryServiceDeprecateRepositoryByNameHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceUndeprecateRepositoryByNameProcedure:\n\t\t\trepositoryServiceUndeprecateRepositoryByNameHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceGetRepositoriesByFullNameProcedure:\n\t\t\trepositoryServiceGetRepositoriesByFullNameHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceSetRepositoryContributorProcedure:\n\t\t\trepositoryServiceSetRepositoryContributorHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceListRepositoryContributorsProcedure:\n\t\t\trepositoryServiceListRepositoryContributorsHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceGetRepositorySettingsProcedure:\n\t\t\trepositoryServiceGetRepositorySettingsHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceUpdateRepositorySettingsByNameProcedure:\n\t\t\trepositoryServiceUpdateRepositorySettingsByNameHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceGetRepositoriesMetadataProcedure:\n\t\t\trepositoryServiceGetRepositoriesMetadataHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceGetRepositoryDependencyDOTStringProcedure:\n\t\t\trepositoryServiceGetRepositoryDependencyDOTStringHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceAddRepositoryGroupProcedure:\n\t\t\trepositoryServiceAddRepositoryGroupHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceUpdateRepositoryGroupProcedure:\n\t\t\trepositoryServiceUpdateRepositoryGroupHandler.ServeHTTP(w, r)\n\t\tcase RepositoryServiceRemoveRepositoryGroupProcedure:\n\t\t\trepositoryServiceRemoveRepositoryGroupHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedRepositoryServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedRepositoryServiceHandler struct{}\n\nfunc (UnimplementedRepositoryServiceHandler) GetRepository(context.Context, *connect.Request[v1alpha1.GetRepositoryRequest]) (*connect.Response[v1alpha1.GetRepositoryResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.GetRepository is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) GetRepositoryByFullName(context.Context, *connect.Request[v1alpha1.GetRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoryByFullNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryByFullName is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) ListRepositories(context.Context, *connect.Request[v1alpha1.ListRepositoriesRequest]) (*connect.Response[v1alpha1.ListRepositoriesResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.ListRepositories is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) ListUserRepositories(context.Context, *connect.Request[v1alpha1.ListUserRepositoriesRequest]) (*connect.Response[v1alpha1.ListUserRepositoriesResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.ListUserRepositories is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) ListRepositoriesUserCanAccess(context.Context, *connect.Request[v1alpha1.ListRepositoriesUserCanAccessRequest]) (*connect.Response[v1alpha1.ListRepositoriesUserCanAccessResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoriesUserCanAccess is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) ListOrganizationRepositories(context.Context, *connect.Request[v1alpha1.ListOrganizationRepositoriesRequest]) (*connect.Response[v1alpha1.ListOrganizationRepositoriesResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.ListOrganizationRepositories is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) CreateRepositoryByFullName(context.Context, *connect.Request[v1alpha1.CreateRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.CreateRepositoryByFullNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.CreateRepositoryByFullName is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) DeleteRepository(context.Context, *connect.Request[v1alpha1.DeleteRepositoryRequest]) (*connect.Response[v1alpha1.DeleteRepositoryResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepository is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) DeleteRepositoryByFullName(context.Context, *connect.Request[v1alpha1.DeleteRepositoryByFullNameRequest]) (*connect.Response[v1alpha1.DeleteRepositoryByFullNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepositoryByFullName is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) DeprecateRepositoryByName(context.Context, *connect.Request[v1alpha1.DeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.DeprecateRepositoryByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.DeprecateRepositoryByName is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) UndeprecateRepositoryByName(context.Context, *connect.Request[v1alpha1.UndeprecateRepositoryByNameRequest]) (*connect.Response[v1alpha1.UndeprecateRepositoryByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.UndeprecateRepositoryByName is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) GetRepositoriesByFullName(context.Context, *connect.Request[v1alpha1.GetRepositoriesByFullNameRequest]) (*connect.Response[v1alpha1.GetRepositoriesByFullNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesByFullName is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) SetRepositoryContributor(context.Context, *connect.Request[v1alpha1.SetRepositoryContributorRequest]) (*connect.Response[v1alpha1.SetRepositoryContributorResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.SetRepositoryContributor is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) ListRepositoryContributors(context.Context, *connect.Request[v1alpha1.ListRepositoryContributorsRequest]) (*connect.Response[v1alpha1.ListRepositoryContributorsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoryContributors is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) GetRepositorySettings(context.Context, *connect.Request[v1alpha1.GetRepositorySettingsRequest]) (*connect.Response[v1alpha1.GetRepositorySettingsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.GetRepositorySettings is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) UpdateRepositorySettingsByName(context.Context, *connect.Request[v1alpha1.UpdateRepositorySettingsByNameRequest]) (*connect.Response[v1alpha1.UpdateRepositorySettingsByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositorySettingsByName is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) GetRepositoriesMetadata(context.Context, *connect.Request[v1alpha1.GetRepositoriesMetadataRequest]) (*connect.Response[v1alpha1.GetRepositoriesMetadataResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesMetadata is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) GetRepositoryDependencyDOTString(context.Context, *connect.Request[v1alpha1.GetRepositoryDependencyDOTStringRequest]) (*connect.Response[v1alpha1.GetRepositoryDependencyDOTStringResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryDependencyDOTString is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) AddRepositoryGroup(context.Context, *connect.Request[v1alpha1.AddRepositoryGroupRequest]) (*connect.Response[v1alpha1.AddRepositoryGroupResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.AddRepositoryGroup is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) UpdateRepositoryGroup(context.Context, *connect.Request[v1alpha1.UpdateRepositoryGroupRequest]) (*connect.Response[v1alpha1.UpdateRepositoryGroupResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositoryGroup is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryServiceHandler) RemoveRepositoryGroup(context.Context, *connect.Request[v1alpha1.RemoveRepositoryGroupRequest]) (*connect.Response[v1alpha1.RemoveRepositoryGroupResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryService.RemoveRepositoryGroup is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository_branch.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/repository_branch.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// RepositoryBranchServiceName is the fully-qualified name of the RepositoryBranchService service.\n\tRepositoryBranchServiceName = \"buf.alpha.registry.v1alpha1.RepositoryBranchService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// RepositoryBranchServiceGetRepositoryBranchProcedure is the fully-qualified name of the\n\t// RepositoryBranchService's GetRepositoryBranch RPC.\n\tRepositoryBranchServiceGetRepositoryBranchProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryBranchService/GetRepositoryBranch\"\n\t// RepositoryBranchServiceListRepositoryBranchesProcedure is the fully-qualified name of the\n\t// RepositoryBranchService's ListRepositoryBranches RPC.\n\tRepositoryBranchServiceListRepositoryBranchesProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryBranchService/ListRepositoryBranches\"\n\t// RepositoryBranchServiceListRepositoryBranchesByReferenceProcedure is the fully-qualified name of\n\t// the RepositoryBranchService's ListRepositoryBranchesByReference RPC.\n\tRepositoryBranchServiceListRepositoryBranchesByReferenceProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryBranchService/ListRepositoryBranchesByReference\"\n\t// RepositoryBranchServiceGetCurrentDefaultBranchProcedure is the fully-qualified name of the\n\t// RepositoryBranchService's GetCurrentDefaultBranch RPC.\n\tRepositoryBranchServiceGetCurrentDefaultBranchProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryBranchService/GetCurrentDefaultBranch\"\n)\n\n// RepositoryBranchServiceClient is a client for the\n// buf.alpha.registry.v1alpha1.RepositoryBranchService service.\ntype RepositoryBranchServiceClient interface {\n\t// GetRepositoryBranch gets a repository branch associated with a Repository by name\n\tGetRepositoryBranch(context.Context, *connect.Request[v1alpha1.GetRepositoryBranchRequest]) (*connect.Response[v1alpha1.GetRepositoryBranchResponse], error)\n\t// ListRepositoryBranches lists the repository branches associated with a Repository.\n\tListRepositoryBranches(context.Context, *connect.Request[v1alpha1.ListRepositoryBranchesRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesResponse], error)\n\t// ListRepositoryBranchesByReference lists the repository branches associated with a Repository,\n\t// filtered by a reference.\n\tListRepositoryBranchesByReference(context.Context, *connect.Request[v1alpha1.ListRepositoryBranchesByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesByReferenceResponse], error)\n\t// GetCurrentDefaultBranch returns the branch that is mapped to the repository's `default_branch` field.\n\tGetCurrentDefaultBranch(context.Context, *connect.Request[v1alpha1.GetCurrentDefaultBranchRequest]) (*connect.Response[v1alpha1.GetCurrentDefaultBranchResponse], error)\n}\n\n// NewRepositoryBranchServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.RepositoryBranchService service. By default, it uses the Connect\n// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed\n// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or\n// connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewRepositoryBranchServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RepositoryBranchServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\trepositoryBranchServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_branch_proto.Services().ByName(\"RepositoryBranchService\").Methods()\n\treturn &repositoryBranchServiceClient{\n\t\tgetRepositoryBranch: connect.NewClient[v1alpha1.GetRepositoryBranchRequest, v1alpha1.GetRepositoryBranchResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryBranchServiceGetRepositoryBranchProcedure,\n\t\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"GetRepositoryBranch\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoryBranches: connect.NewClient[v1alpha1.ListRepositoryBranchesRequest, v1alpha1.ListRepositoryBranchesResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryBranchServiceListRepositoryBranchesProcedure,\n\t\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"ListRepositoryBranches\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoryBranchesByReference: connect.NewClient[v1alpha1.ListRepositoryBranchesByReferenceRequest, v1alpha1.ListRepositoryBranchesByReferenceResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryBranchServiceListRepositoryBranchesByReferenceProcedure,\n\t\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"ListRepositoryBranchesByReference\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetCurrentDefaultBranch: connect.NewClient[v1alpha1.GetCurrentDefaultBranchRequest, v1alpha1.GetCurrentDefaultBranchResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryBranchServiceGetCurrentDefaultBranchProcedure,\n\t\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"GetCurrentDefaultBranch\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// repositoryBranchServiceClient implements RepositoryBranchServiceClient.\ntype repositoryBranchServiceClient struct {\n\tgetRepositoryBranch               *connect.Client[v1alpha1.GetRepositoryBranchRequest, v1alpha1.GetRepositoryBranchResponse]\n\tlistRepositoryBranches            *connect.Client[v1alpha1.ListRepositoryBranchesRequest, v1alpha1.ListRepositoryBranchesResponse]\n\tlistRepositoryBranchesByReference *connect.Client[v1alpha1.ListRepositoryBranchesByReferenceRequest, v1alpha1.ListRepositoryBranchesByReferenceResponse]\n\tgetCurrentDefaultBranch           *connect.Client[v1alpha1.GetCurrentDefaultBranchRequest, v1alpha1.GetCurrentDefaultBranchResponse]\n}\n\n// GetRepositoryBranch calls\n// buf.alpha.registry.v1alpha1.RepositoryBranchService.GetRepositoryBranch.\nfunc (c *repositoryBranchServiceClient) GetRepositoryBranch(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoryBranchRequest]) (*connect.Response[v1alpha1.GetRepositoryBranchResponse], error) {\n\treturn c.getRepositoryBranch.CallUnary(ctx, req)\n}\n\n// ListRepositoryBranches calls\n// buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranches.\nfunc (c *repositoryBranchServiceClient) ListRepositoryBranches(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryBranchesRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesResponse], error) {\n\treturn c.listRepositoryBranches.CallUnary(ctx, req)\n}\n\n// ListRepositoryBranchesByReference calls\n// buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranchesByReference.\nfunc (c *repositoryBranchServiceClient) ListRepositoryBranchesByReference(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryBranchesByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesByReferenceResponse], error) {\n\treturn c.listRepositoryBranchesByReference.CallUnary(ctx, req)\n}\n\n// GetCurrentDefaultBranch calls\n// buf.alpha.registry.v1alpha1.RepositoryBranchService.GetCurrentDefaultBranch.\nfunc (c *repositoryBranchServiceClient) GetCurrentDefaultBranch(ctx context.Context, req *connect.Request[v1alpha1.GetCurrentDefaultBranchRequest]) (*connect.Response[v1alpha1.GetCurrentDefaultBranchResponse], error) {\n\treturn c.getCurrentDefaultBranch.CallUnary(ctx, req)\n}\n\n// RepositoryBranchServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.RepositoryBranchService service.\ntype RepositoryBranchServiceHandler interface {\n\t// GetRepositoryBranch gets a repository branch associated with a Repository by name\n\tGetRepositoryBranch(context.Context, *connect.Request[v1alpha1.GetRepositoryBranchRequest]) (*connect.Response[v1alpha1.GetRepositoryBranchResponse], error)\n\t// ListRepositoryBranches lists the repository branches associated with a Repository.\n\tListRepositoryBranches(context.Context, *connect.Request[v1alpha1.ListRepositoryBranchesRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesResponse], error)\n\t// ListRepositoryBranchesByReference lists the repository branches associated with a Repository,\n\t// filtered by a reference.\n\tListRepositoryBranchesByReference(context.Context, *connect.Request[v1alpha1.ListRepositoryBranchesByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesByReferenceResponse], error)\n\t// GetCurrentDefaultBranch returns the branch that is mapped to the repository's `default_branch` field.\n\tGetCurrentDefaultBranch(context.Context, *connect.Request[v1alpha1.GetCurrentDefaultBranchRequest]) (*connect.Response[v1alpha1.GetCurrentDefaultBranchResponse], error)\n}\n\n// NewRepositoryBranchServiceHandler builds an HTTP handler from the service implementation. It\n// returns the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewRepositoryBranchServiceHandler(svc RepositoryBranchServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\trepositoryBranchServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_branch_proto.Services().ByName(\"RepositoryBranchService\").Methods()\n\trepositoryBranchServiceGetRepositoryBranchHandler := connect.NewUnaryHandler(\n\t\tRepositoryBranchServiceGetRepositoryBranchProcedure,\n\t\tsvc.GetRepositoryBranch,\n\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"GetRepositoryBranch\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryBranchServiceListRepositoryBranchesHandler := connect.NewUnaryHandler(\n\t\tRepositoryBranchServiceListRepositoryBranchesProcedure,\n\t\tsvc.ListRepositoryBranches,\n\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"ListRepositoryBranches\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryBranchServiceListRepositoryBranchesByReferenceHandler := connect.NewUnaryHandler(\n\t\tRepositoryBranchServiceListRepositoryBranchesByReferenceProcedure,\n\t\tsvc.ListRepositoryBranchesByReference,\n\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"ListRepositoryBranchesByReference\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryBranchServiceGetCurrentDefaultBranchHandler := connect.NewUnaryHandler(\n\t\tRepositoryBranchServiceGetCurrentDefaultBranchProcedure,\n\t\tsvc.GetCurrentDefaultBranch,\n\t\tconnect.WithSchema(repositoryBranchServiceMethods.ByName(\"GetCurrentDefaultBranch\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.RepositoryBranchService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase RepositoryBranchServiceGetRepositoryBranchProcedure:\n\t\t\trepositoryBranchServiceGetRepositoryBranchHandler.ServeHTTP(w, r)\n\t\tcase RepositoryBranchServiceListRepositoryBranchesProcedure:\n\t\t\trepositoryBranchServiceListRepositoryBranchesHandler.ServeHTTP(w, r)\n\t\tcase RepositoryBranchServiceListRepositoryBranchesByReferenceProcedure:\n\t\t\trepositoryBranchServiceListRepositoryBranchesByReferenceHandler.ServeHTTP(w, r)\n\t\tcase RepositoryBranchServiceGetCurrentDefaultBranchProcedure:\n\t\t\trepositoryBranchServiceGetCurrentDefaultBranchHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedRepositoryBranchServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedRepositoryBranchServiceHandler struct{}\n\nfunc (UnimplementedRepositoryBranchServiceHandler) GetRepositoryBranch(context.Context, *connect.Request[v1alpha1.GetRepositoryBranchRequest]) (*connect.Response[v1alpha1.GetRepositoryBranchResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryBranchService.GetRepositoryBranch is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryBranchServiceHandler) ListRepositoryBranches(context.Context, *connect.Request[v1alpha1.ListRepositoryBranchesRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranches is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryBranchServiceHandler) ListRepositoryBranchesByReference(context.Context, *connect.Request[v1alpha1.ListRepositoryBranchesByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryBranchesByReferenceResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranchesByReference is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryBranchServiceHandler) GetCurrentDefaultBranch(context.Context, *connect.Request[v1alpha1.GetCurrentDefaultBranchRequest]) (*connect.Response[v1alpha1.GetCurrentDefaultBranchResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryBranchService.GetCurrentDefaultBranch is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository_commit.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/repository_commit.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// RepositoryCommitServiceName is the fully-qualified name of the RepositoryCommitService service.\n\tRepositoryCommitServiceName = \"buf.alpha.registry.v1alpha1.RepositoryCommitService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// RepositoryCommitServiceListRepositoryCommitsByBranchProcedure is the fully-qualified name of the\n\t// RepositoryCommitService's ListRepositoryCommitsByBranch RPC.\n\tRepositoryCommitServiceListRepositoryCommitsByBranchProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryCommitService/ListRepositoryCommitsByBranch\"\n\t// RepositoryCommitServiceListRepositoryCommitsByReferenceProcedure is the fully-qualified name of\n\t// the RepositoryCommitService's ListRepositoryCommitsByReference RPC.\n\tRepositoryCommitServiceListRepositoryCommitsByReferenceProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryCommitService/ListRepositoryCommitsByReference\"\n\t// RepositoryCommitServiceGetRepositoryCommitByReferenceProcedure is the fully-qualified name of the\n\t// RepositoryCommitService's GetRepositoryCommitByReference RPC.\n\tRepositoryCommitServiceGetRepositoryCommitByReferenceProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryCommitService/GetRepositoryCommitByReference\"\n\t// RepositoryCommitServiceListRepositoryDraftCommitsProcedure is the fully-qualified name of the\n\t// RepositoryCommitService's ListRepositoryDraftCommits RPC.\n\tRepositoryCommitServiceListRepositoryDraftCommitsProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryCommitService/ListRepositoryDraftCommits\"\n\t// RepositoryCommitServiceDeleteRepositoryDraftCommitProcedure is the fully-qualified name of the\n\t// RepositoryCommitService's DeleteRepositoryDraftCommit RPC.\n\tRepositoryCommitServiceDeleteRepositoryDraftCommitProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryCommitService/DeleteRepositoryDraftCommit\"\n)\n\n// RepositoryCommitServiceClient is a client for the\n// buf.alpha.registry.v1alpha1.RepositoryCommitService service.\ntype RepositoryCommitServiceClient interface {\n\t// ListRepositoryCommitsByBranch lists the repository commits associated\n\t// with a repository branch on a repository, ordered by their create time.\n\t//\n\t// Deprecated: do not use.\n\tListRepositoryCommitsByBranch(context.Context, *connect.Request[v1alpha1.ListRepositoryCommitsByBranchRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByBranchResponse], error)\n\t// ListRepositoryCommitsByReference returns repository commits up-to and including\n\t// the provided reference.\n\tListRepositoryCommitsByReference(context.Context, *connect.Request[v1alpha1.ListRepositoryCommitsByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByReferenceResponse], error)\n\t// GetRepositoryCommitByReference returns the repository commit matching\n\t// the provided reference, if it exists.\n\tGetRepositoryCommitByReference(context.Context, *connect.Request[v1alpha1.GetRepositoryCommitByReferenceRequest]) (*connect.Response[v1alpha1.GetRepositoryCommitByReferenceResponse], error)\n\t// ListRepositoryDraftCommits lists draft commits in a repository.\n\tListRepositoryDraftCommits(context.Context, *connect.Request[v1alpha1.ListRepositoryDraftCommitsRequest]) (*connect.Response[v1alpha1.ListRepositoryDraftCommitsResponse], error)\n\t// DeleteRepositoryDraftCommit deletes a draft.\n\tDeleteRepositoryDraftCommit(context.Context, *connect.Request[v1alpha1.DeleteRepositoryDraftCommitRequest]) (*connect.Response[v1alpha1.DeleteRepositoryDraftCommitResponse], error)\n}\n\n// NewRepositoryCommitServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.RepositoryCommitService service. By default, it uses the Connect\n// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed\n// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or\n// connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewRepositoryCommitServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RepositoryCommitServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\trepositoryCommitServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_commit_proto.Services().ByName(\"RepositoryCommitService\").Methods()\n\treturn &repositoryCommitServiceClient{\n\t\tlistRepositoryCommitsByBranch: connect.NewClient[v1alpha1.ListRepositoryCommitsByBranchRequest, v1alpha1.ListRepositoryCommitsByBranchResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryCommitServiceListRepositoryCommitsByBranchProcedure,\n\t\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"ListRepositoryCommitsByBranch\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoryCommitsByReference: connect.NewClient[v1alpha1.ListRepositoryCommitsByReferenceRequest, v1alpha1.ListRepositoryCommitsByReferenceResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryCommitServiceListRepositoryCommitsByReferenceProcedure,\n\t\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"ListRepositoryCommitsByReference\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetRepositoryCommitByReference: connect.NewClient[v1alpha1.GetRepositoryCommitByReferenceRequest, v1alpha1.GetRepositoryCommitByReferenceResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryCommitServiceGetRepositoryCommitByReferenceProcedure,\n\t\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"GetRepositoryCommitByReference\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoryDraftCommits: connect.NewClient[v1alpha1.ListRepositoryDraftCommitsRequest, v1alpha1.ListRepositoryDraftCommitsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryCommitServiceListRepositoryDraftCommitsProcedure,\n\t\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"ListRepositoryDraftCommits\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteRepositoryDraftCommit: connect.NewClient[v1alpha1.DeleteRepositoryDraftCommitRequest, v1alpha1.DeleteRepositoryDraftCommitResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryCommitServiceDeleteRepositoryDraftCommitProcedure,\n\t\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"DeleteRepositoryDraftCommit\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// repositoryCommitServiceClient implements RepositoryCommitServiceClient.\ntype repositoryCommitServiceClient struct {\n\tlistRepositoryCommitsByBranch    *connect.Client[v1alpha1.ListRepositoryCommitsByBranchRequest, v1alpha1.ListRepositoryCommitsByBranchResponse]\n\tlistRepositoryCommitsByReference *connect.Client[v1alpha1.ListRepositoryCommitsByReferenceRequest, v1alpha1.ListRepositoryCommitsByReferenceResponse]\n\tgetRepositoryCommitByReference   *connect.Client[v1alpha1.GetRepositoryCommitByReferenceRequest, v1alpha1.GetRepositoryCommitByReferenceResponse]\n\tlistRepositoryDraftCommits       *connect.Client[v1alpha1.ListRepositoryDraftCommitsRequest, v1alpha1.ListRepositoryDraftCommitsResponse]\n\tdeleteRepositoryDraftCommit      *connect.Client[v1alpha1.DeleteRepositoryDraftCommitRequest, v1alpha1.DeleteRepositoryDraftCommitResponse]\n}\n\n// ListRepositoryCommitsByBranch calls\n// buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByBranch.\n//\n// Deprecated: do not use.\nfunc (c *repositoryCommitServiceClient) ListRepositoryCommitsByBranch(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryCommitsByBranchRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByBranchResponse], error) {\n\treturn c.listRepositoryCommitsByBranch.CallUnary(ctx, req)\n}\n\n// ListRepositoryCommitsByReference calls\n// buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByReference.\nfunc (c *repositoryCommitServiceClient) ListRepositoryCommitsByReference(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryCommitsByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByReferenceResponse], error) {\n\treturn c.listRepositoryCommitsByReference.CallUnary(ctx, req)\n}\n\n// GetRepositoryCommitByReference calls\n// buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitByReference.\nfunc (c *repositoryCommitServiceClient) GetRepositoryCommitByReference(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoryCommitByReferenceRequest]) (*connect.Response[v1alpha1.GetRepositoryCommitByReferenceResponse], error) {\n\treturn c.getRepositoryCommitByReference.CallUnary(ctx, req)\n}\n\n// ListRepositoryDraftCommits calls\n// buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryDraftCommits.\nfunc (c *repositoryCommitServiceClient) ListRepositoryDraftCommits(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryDraftCommitsRequest]) (*connect.Response[v1alpha1.ListRepositoryDraftCommitsResponse], error) {\n\treturn c.listRepositoryDraftCommits.CallUnary(ctx, req)\n}\n\n// DeleteRepositoryDraftCommit calls\n// buf.alpha.registry.v1alpha1.RepositoryCommitService.DeleteRepositoryDraftCommit.\nfunc (c *repositoryCommitServiceClient) DeleteRepositoryDraftCommit(ctx context.Context, req *connect.Request[v1alpha1.DeleteRepositoryDraftCommitRequest]) (*connect.Response[v1alpha1.DeleteRepositoryDraftCommitResponse], error) {\n\treturn c.deleteRepositoryDraftCommit.CallUnary(ctx, req)\n}\n\n// RepositoryCommitServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.RepositoryCommitService service.\ntype RepositoryCommitServiceHandler interface {\n\t// ListRepositoryCommitsByBranch lists the repository commits associated\n\t// with a repository branch on a repository, ordered by their create time.\n\t//\n\t// Deprecated: do not use.\n\tListRepositoryCommitsByBranch(context.Context, *connect.Request[v1alpha1.ListRepositoryCommitsByBranchRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByBranchResponse], error)\n\t// ListRepositoryCommitsByReference returns repository commits up-to and including\n\t// the provided reference.\n\tListRepositoryCommitsByReference(context.Context, *connect.Request[v1alpha1.ListRepositoryCommitsByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByReferenceResponse], error)\n\t// GetRepositoryCommitByReference returns the repository commit matching\n\t// the provided reference, if it exists.\n\tGetRepositoryCommitByReference(context.Context, *connect.Request[v1alpha1.GetRepositoryCommitByReferenceRequest]) (*connect.Response[v1alpha1.GetRepositoryCommitByReferenceResponse], error)\n\t// ListRepositoryDraftCommits lists draft commits in a repository.\n\tListRepositoryDraftCommits(context.Context, *connect.Request[v1alpha1.ListRepositoryDraftCommitsRequest]) (*connect.Response[v1alpha1.ListRepositoryDraftCommitsResponse], error)\n\t// DeleteRepositoryDraftCommit deletes a draft.\n\tDeleteRepositoryDraftCommit(context.Context, *connect.Request[v1alpha1.DeleteRepositoryDraftCommitRequest]) (*connect.Response[v1alpha1.DeleteRepositoryDraftCommitResponse], error)\n}\n\n// NewRepositoryCommitServiceHandler builds an HTTP handler from the service implementation. It\n// returns the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewRepositoryCommitServiceHandler(svc RepositoryCommitServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\trepositoryCommitServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_commit_proto.Services().ByName(\"RepositoryCommitService\").Methods()\n\trepositoryCommitServiceListRepositoryCommitsByBranchHandler := connect.NewUnaryHandler(\n\t\tRepositoryCommitServiceListRepositoryCommitsByBranchProcedure,\n\t\tsvc.ListRepositoryCommitsByBranch,\n\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"ListRepositoryCommitsByBranch\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryCommitServiceListRepositoryCommitsByReferenceHandler := connect.NewUnaryHandler(\n\t\tRepositoryCommitServiceListRepositoryCommitsByReferenceProcedure,\n\t\tsvc.ListRepositoryCommitsByReference,\n\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"ListRepositoryCommitsByReference\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryCommitServiceGetRepositoryCommitByReferenceHandler := connect.NewUnaryHandler(\n\t\tRepositoryCommitServiceGetRepositoryCommitByReferenceProcedure,\n\t\tsvc.GetRepositoryCommitByReference,\n\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"GetRepositoryCommitByReference\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryCommitServiceListRepositoryDraftCommitsHandler := connect.NewUnaryHandler(\n\t\tRepositoryCommitServiceListRepositoryDraftCommitsProcedure,\n\t\tsvc.ListRepositoryDraftCommits,\n\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"ListRepositoryDraftCommits\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryCommitServiceDeleteRepositoryDraftCommitHandler := connect.NewUnaryHandler(\n\t\tRepositoryCommitServiceDeleteRepositoryDraftCommitProcedure,\n\t\tsvc.DeleteRepositoryDraftCommit,\n\t\tconnect.WithSchema(repositoryCommitServiceMethods.ByName(\"DeleteRepositoryDraftCommit\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.RepositoryCommitService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase RepositoryCommitServiceListRepositoryCommitsByBranchProcedure:\n\t\t\trepositoryCommitServiceListRepositoryCommitsByBranchHandler.ServeHTTP(w, r)\n\t\tcase RepositoryCommitServiceListRepositoryCommitsByReferenceProcedure:\n\t\t\trepositoryCommitServiceListRepositoryCommitsByReferenceHandler.ServeHTTP(w, r)\n\t\tcase RepositoryCommitServiceGetRepositoryCommitByReferenceProcedure:\n\t\t\trepositoryCommitServiceGetRepositoryCommitByReferenceHandler.ServeHTTP(w, r)\n\t\tcase RepositoryCommitServiceListRepositoryDraftCommitsProcedure:\n\t\t\trepositoryCommitServiceListRepositoryDraftCommitsHandler.ServeHTTP(w, r)\n\t\tcase RepositoryCommitServiceDeleteRepositoryDraftCommitProcedure:\n\t\t\trepositoryCommitServiceDeleteRepositoryDraftCommitHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedRepositoryCommitServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedRepositoryCommitServiceHandler struct{}\n\nfunc (UnimplementedRepositoryCommitServiceHandler) ListRepositoryCommitsByBranch(context.Context, *connect.Request[v1alpha1.ListRepositoryCommitsByBranchRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByBranchResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByBranch is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryCommitServiceHandler) ListRepositoryCommitsByReference(context.Context, *connect.Request[v1alpha1.ListRepositoryCommitsByReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryCommitsByReferenceResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByReference is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryCommitServiceHandler) GetRepositoryCommitByReference(context.Context, *connect.Request[v1alpha1.GetRepositoryCommitByReferenceRequest]) (*connect.Response[v1alpha1.GetRepositoryCommitByReferenceResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitByReference is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryCommitServiceHandler) ListRepositoryDraftCommits(context.Context, *connect.Request[v1alpha1.ListRepositoryDraftCommitsRequest]) (*connect.Response[v1alpha1.ListRepositoryDraftCommitsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryDraftCommits is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryCommitServiceHandler) DeleteRepositoryDraftCommit(context.Context, *connect.Request[v1alpha1.DeleteRepositoryDraftCommitRequest]) (*connect.Response[v1alpha1.DeleteRepositoryDraftCommitResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryCommitService.DeleteRepositoryDraftCommit is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository_tag.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/repository_tag.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// RepositoryTagServiceName is the fully-qualified name of the RepositoryTagService service.\n\tRepositoryTagServiceName = \"buf.alpha.registry.v1alpha1.RepositoryTagService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// RepositoryTagServiceGetRepositoryTagProcedure is the fully-qualified name of the\n\t// RepositoryTagService's GetRepositoryTag RPC.\n\tRepositoryTagServiceGetRepositoryTagProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryTagService/GetRepositoryTag\"\n\t// RepositoryTagServiceCreateRepositoryTagProcedure is the fully-qualified name of the\n\t// RepositoryTagService's CreateRepositoryTag RPC.\n\tRepositoryTagServiceCreateRepositoryTagProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryTagService/CreateRepositoryTag\"\n\t// RepositoryTagServiceUpdateRepositoryTagProcedure is the fully-qualified name of the\n\t// RepositoryTagService's UpdateRepositoryTag RPC.\n\tRepositoryTagServiceUpdateRepositoryTagProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryTagService/UpdateRepositoryTag\"\n\t// RepositoryTagServiceListRepositoryTagsProcedure is the fully-qualified name of the\n\t// RepositoryTagService's ListRepositoryTags RPC.\n\tRepositoryTagServiceListRepositoryTagsProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryTagService/ListRepositoryTags\"\n\t// RepositoryTagServiceListRepositoryTagsForReferenceProcedure is the fully-qualified name of the\n\t// RepositoryTagService's ListRepositoryTagsForReference RPC.\n\tRepositoryTagServiceListRepositoryTagsForReferenceProcedure = \"/buf.alpha.registry.v1alpha1.RepositoryTagService/ListRepositoryTagsForReference\"\n)\n\n// RepositoryTagServiceClient is a client for the buf.alpha.registry.v1alpha1.RepositoryTagService\n// service.\ntype RepositoryTagServiceClient interface {\n\t// GetRepositoryTag gets an existing repository tag.\n\tGetRepositoryTag(context.Context, *connect.Request[v1alpha1.GetRepositoryTagRequest]) (*connect.Response[v1alpha1.GetRepositoryTagResponse], error)\n\t// CreateRepositoryTag creates a new repository tag.\n\tCreateRepositoryTag(context.Context, *connect.Request[v1alpha1.CreateRepositoryTagRequest]) (*connect.Response[v1alpha1.CreateRepositoryTagResponse], error)\n\t// UpdateRepositoryTag update an existing repository tag.\n\tUpdateRepositoryTag(context.Context, *connect.Request[v1alpha1.UpdateRepositoryTagRequest]) (*connect.Response[v1alpha1.UpdateRepositoryTagResponse], error)\n\t// ListRepositoryTags lists the repository tags associated with a Repository.\n\tListRepositoryTags(context.Context, *connect.Request[v1alpha1.ListRepositoryTagsRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsResponse], error)\n\t// ListRepositoryTagsForReference lists the repository tags associated with a repository\n\t// reference name.\n\tListRepositoryTagsForReference(context.Context, *connect.Request[v1alpha1.ListRepositoryTagsForReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsForReferenceResponse], error)\n}\n\n// NewRepositoryTagServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.RepositoryTagService service. By default, it uses the Connect\n// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed\n// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or\n// connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewRepositoryTagServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) RepositoryTagServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\trepositoryTagServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_tag_proto.Services().ByName(\"RepositoryTagService\").Methods()\n\treturn &repositoryTagServiceClient{\n\t\tgetRepositoryTag: connect.NewClient[v1alpha1.GetRepositoryTagRequest, v1alpha1.GetRepositoryTagResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryTagServiceGetRepositoryTagProcedure,\n\t\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"GetRepositoryTag\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tcreateRepositoryTag: connect.NewClient[v1alpha1.CreateRepositoryTagRequest, v1alpha1.CreateRepositoryTagResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryTagServiceCreateRepositoryTagProcedure,\n\t\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"CreateRepositoryTag\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateRepositoryTag: connect.NewClient[v1alpha1.UpdateRepositoryTagRequest, v1alpha1.UpdateRepositoryTagResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryTagServiceUpdateRepositoryTagProcedure,\n\t\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"UpdateRepositoryTag\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoryTags: connect.NewClient[v1alpha1.ListRepositoryTagsRequest, v1alpha1.ListRepositoryTagsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryTagServiceListRepositoryTagsProcedure,\n\t\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"ListRepositoryTags\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistRepositoryTagsForReference: connect.NewClient[v1alpha1.ListRepositoryTagsForReferenceRequest, v1alpha1.ListRepositoryTagsForReferenceResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+RepositoryTagServiceListRepositoryTagsForReferenceProcedure,\n\t\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"ListRepositoryTagsForReference\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// repositoryTagServiceClient implements RepositoryTagServiceClient.\ntype repositoryTagServiceClient struct {\n\tgetRepositoryTag               *connect.Client[v1alpha1.GetRepositoryTagRequest, v1alpha1.GetRepositoryTagResponse]\n\tcreateRepositoryTag            *connect.Client[v1alpha1.CreateRepositoryTagRequest, v1alpha1.CreateRepositoryTagResponse]\n\tupdateRepositoryTag            *connect.Client[v1alpha1.UpdateRepositoryTagRequest, v1alpha1.UpdateRepositoryTagResponse]\n\tlistRepositoryTags             *connect.Client[v1alpha1.ListRepositoryTagsRequest, v1alpha1.ListRepositoryTagsResponse]\n\tlistRepositoryTagsForReference *connect.Client[v1alpha1.ListRepositoryTagsForReferenceRequest, v1alpha1.ListRepositoryTagsForReferenceResponse]\n}\n\n// GetRepositoryTag calls buf.alpha.registry.v1alpha1.RepositoryTagService.GetRepositoryTag.\nfunc (c *repositoryTagServiceClient) GetRepositoryTag(ctx context.Context, req *connect.Request[v1alpha1.GetRepositoryTagRequest]) (*connect.Response[v1alpha1.GetRepositoryTagResponse], error) {\n\treturn c.getRepositoryTag.CallUnary(ctx, req)\n}\n\n// CreateRepositoryTag calls buf.alpha.registry.v1alpha1.RepositoryTagService.CreateRepositoryTag.\nfunc (c *repositoryTagServiceClient) CreateRepositoryTag(ctx context.Context, req *connect.Request[v1alpha1.CreateRepositoryTagRequest]) (*connect.Response[v1alpha1.CreateRepositoryTagResponse], error) {\n\treturn c.createRepositoryTag.CallUnary(ctx, req)\n}\n\n// UpdateRepositoryTag calls buf.alpha.registry.v1alpha1.RepositoryTagService.UpdateRepositoryTag.\nfunc (c *repositoryTagServiceClient) UpdateRepositoryTag(ctx context.Context, req *connect.Request[v1alpha1.UpdateRepositoryTagRequest]) (*connect.Response[v1alpha1.UpdateRepositoryTagResponse], error) {\n\treturn c.updateRepositoryTag.CallUnary(ctx, req)\n}\n\n// ListRepositoryTags calls buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTags.\nfunc (c *repositoryTagServiceClient) ListRepositoryTags(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryTagsRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsResponse], error) {\n\treturn c.listRepositoryTags.CallUnary(ctx, req)\n}\n\n// ListRepositoryTagsForReference calls\n// buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTagsForReference.\nfunc (c *repositoryTagServiceClient) ListRepositoryTagsForReference(ctx context.Context, req *connect.Request[v1alpha1.ListRepositoryTagsForReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsForReferenceResponse], error) {\n\treturn c.listRepositoryTagsForReference.CallUnary(ctx, req)\n}\n\n// RepositoryTagServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.RepositoryTagService service.\ntype RepositoryTagServiceHandler interface {\n\t// GetRepositoryTag gets an existing repository tag.\n\tGetRepositoryTag(context.Context, *connect.Request[v1alpha1.GetRepositoryTagRequest]) (*connect.Response[v1alpha1.GetRepositoryTagResponse], error)\n\t// CreateRepositoryTag creates a new repository tag.\n\tCreateRepositoryTag(context.Context, *connect.Request[v1alpha1.CreateRepositoryTagRequest]) (*connect.Response[v1alpha1.CreateRepositoryTagResponse], error)\n\t// UpdateRepositoryTag update an existing repository tag.\n\tUpdateRepositoryTag(context.Context, *connect.Request[v1alpha1.UpdateRepositoryTagRequest]) (*connect.Response[v1alpha1.UpdateRepositoryTagResponse], error)\n\t// ListRepositoryTags lists the repository tags associated with a Repository.\n\tListRepositoryTags(context.Context, *connect.Request[v1alpha1.ListRepositoryTagsRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsResponse], error)\n\t// ListRepositoryTagsForReference lists the repository tags associated with a repository\n\t// reference name.\n\tListRepositoryTagsForReference(context.Context, *connect.Request[v1alpha1.ListRepositoryTagsForReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsForReferenceResponse], error)\n}\n\n// NewRepositoryTagServiceHandler builds an HTTP handler from the service implementation. It returns\n// the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewRepositoryTagServiceHandler(svc RepositoryTagServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\trepositoryTagServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_repository_tag_proto.Services().ByName(\"RepositoryTagService\").Methods()\n\trepositoryTagServiceGetRepositoryTagHandler := connect.NewUnaryHandler(\n\t\tRepositoryTagServiceGetRepositoryTagProcedure,\n\t\tsvc.GetRepositoryTag,\n\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"GetRepositoryTag\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryTagServiceCreateRepositoryTagHandler := connect.NewUnaryHandler(\n\t\tRepositoryTagServiceCreateRepositoryTagProcedure,\n\t\tsvc.CreateRepositoryTag,\n\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"CreateRepositoryTag\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryTagServiceUpdateRepositoryTagHandler := connect.NewUnaryHandler(\n\t\tRepositoryTagServiceUpdateRepositoryTagProcedure,\n\t\tsvc.UpdateRepositoryTag,\n\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"UpdateRepositoryTag\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryTagServiceListRepositoryTagsHandler := connect.NewUnaryHandler(\n\t\tRepositoryTagServiceListRepositoryTagsProcedure,\n\t\tsvc.ListRepositoryTags,\n\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"ListRepositoryTags\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\trepositoryTagServiceListRepositoryTagsForReferenceHandler := connect.NewUnaryHandler(\n\t\tRepositoryTagServiceListRepositoryTagsForReferenceProcedure,\n\t\tsvc.ListRepositoryTagsForReference,\n\t\tconnect.WithSchema(repositoryTagServiceMethods.ByName(\"ListRepositoryTagsForReference\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.RepositoryTagService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase RepositoryTagServiceGetRepositoryTagProcedure:\n\t\t\trepositoryTagServiceGetRepositoryTagHandler.ServeHTTP(w, r)\n\t\tcase RepositoryTagServiceCreateRepositoryTagProcedure:\n\t\t\trepositoryTagServiceCreateRepositoryTagHandler.ServeHTTP(w, r)\n\t\tcase RepositoryTagServiceUpdateRepositoryTagProcedure:\n\t\t\trepositoryTagServiceUpdateRepositoryTagHandler.ServeHTTP(w, r)\n\t\tcase RepositoryTagServiceListRepositoryTagsProcedure:\n\t\t\trepositoryTagServiceListRepositoryTagsHandler.ServeHTTP(w, r)\n\t\tcase RepositoryTagServiceListRepositoryTagsForReferenceProcedure:\n\t\t\trepositoryTagServiceListRepositoryTagsForReferenceHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedRepositoryTagServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedRepositoryTagServiceHandler struct{}\n\nfunc (UnimplementedRepositoryTagServiceHandler) GetRepositoryTag(context.Context, *connect.Request[v1alpha1.GetRepositoryTagRequest]) (*connect.Response[v1alpha1.GetRepositoryTagResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryTagService.GetRepositoryTag is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryTagServiceHandler) CreateRepositoryTag(context.Context, *connect.Request[v1alpha1.CreateRepositoryTagRequest]) (*connect.Response[v1alpha1.CreateRepositoryTagResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryTagService.CreateRepositoryTag is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryTagServiceHandler) UpdateRepositoryTag(context.Context, *connect.Request[v1alpha1.UpdateRepositoryTagRequest]) (*connect.Response[v1alpha1.UpdateRepositoryTagResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryTagService.UpdateRepositoryTag is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryTagServiceHandler) ListRepositoryTags(context.Context, *connect.Request[v1alpha1.ListRepositoryTagsRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTags is not implemented\"))\n}\n\nfunc (UnimplementedRepositoryTagServiceHandler) ListRepositoryTagsForReference(context.Context, *connect.Request[v1alpha1.ListRepositoryTagsForReferenceRequest]) (*connect.Response[v1alpha1.ListRepositoryTagsForReferenceResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTagsForReference is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/resolve.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/resolve.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// ResolveServiceName is the fully-qualified name of the ResolveService service.\n\tResolveServiceName = \"buf.alpha.registry.v1alpha1.ResolveService\"\n\t// LocalResolveServiceName is the fully-qualified name of the LocalResolveService service.\n\tLocalResolveServiceName = \"buf.alpha.registry.v1alpha1.LocalResolveService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// ResolveServiceGetModulePinsProcedure is the fully-qualified name of the ResolveService's\n\t// GetModulePins RPC.\n\tResolveServiceGetModulePinsProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetModulePins\"\n\t// ResolveServiceGetSDKInfoProcedure is the fully-qualified name of the ResolveService's GetSDKInfo\n\t// RPC.\n\tResolveServiceGetSDKInfoProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetSDKInfo\"\n\t// ResolveServiceGetGoVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetGoVersion RPC.\n\tResolveServiceGetGoVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetGoVersion\"\n\t// ResolveServiceGetSwiftVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetSwiftVersion RPC.\n\tResolveServiceGetSwiftVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetSwiftVersion\"\n\t// ResolveServiceGetMavenVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetMavenVersion RPC.\n\tResolveServiceGetMavenVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetMavenVersion\"\n\t// ResolveServiceGetNPMVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetNPMVersion RPC.\n\tResolveServiceGetNPMVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetNPMVersion\"\n\t// ResolveServiceGetPythonVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetPythonVersion RPC.\n\tResolveServiceGetPythonVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetPythonVersion\"\n\t// ResolveServiceGetCargoVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetCargoVersion RPC.\n\tResolveServiceGetCargoVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetCargoVersion\"\n\t// ResolveServiceGetNugetVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetNugetVersion RPC.\n\tResolveServiceGetNugetVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetNugetVersion\"\n\t// ResolveServiceGetCmakeVersionProcedure is the fully-qualified name of the ResolveService's\n\t// GetCmakeVersion RPC.\n\tResolveServiceGetCmakeVersionProcedure = \"/buf.alpha.registry.v1alpha1.ResolveService/GetCmakeVersion\"\n\t// LocalResolveServiceGetLocalModulePinsProcedure is the fully-qualified name of the\n\t// LocalResolveService's GetLocalModulePins RPC.\n\tLocalResolveServiceGetLocalModulePinsProcedure = \"/buf.alpha.registry.v1alpha1.LocalResolveService/GetLocalModulePins\"\n)\n\n// ResolveServiceClient is a client for the buf.alpha.registry.v1alpha1.ResolveService service.\ntype ResolveServiceClient interface {\n\t// GetModulePins finds all the latest digests and respective dependencies of\n\t// the provided module references and picks a set of distinct modules pins.\n\t//\n\t// Note that module references with commits should still be passed to this function\n\t// to make sure this function can do dependency resolution.\n\t//\n\t// This function also deals with tiebreaking what ModulePin wins for the same repository.\n\tGetModulePins(context.Context, *connect.Request[v1alpha1.GetModulePinsRequest]) (*connect.Response[v1alpha1.GetModulePinsResponse], error)\n\t// GetSDKInfo takes a module, plugin, and optionally SDK version, and returns the SDK\n\t// info. The SDK info includes the module, module commit, module commit create time, plugin,\n\t// plugin version, plugin revision, and the SDK version string\n\t// for the SDK.\n\t//\n\t// If the module reference and/or plugin version is included, then the SDK at the\n\t// specified version will be resolved. If the SDK version is included, then it will be\n\t// validated with the module and plugin information provided.\n\t//\n\t// This replaces the need for all subsequent RPCs, which requires the caller to resolve\n\t// the registry type first. Instead, the registry type will be resolved based on the plugin\n\t// information provided.\n\tGetSDKInfo(context.Context, *connect.Request[v1alpha1.GetSDKInfoRequest]) (*connect.Response[v1alpha1.GetSDKInfoResponse], error)\n\t// GetGoVersion resolves the given plugin and module references to a version.\n\tGetGoVersion(context.Context, *connect.Request[v1alpha1.GetGoVersionRequest]) (*connect.Response[v1alpha1.GetGoVersionResponse], error)\n\t// GetSwiftVersion resolves the given plugin and module references to a version.\n\tGetSwiftVersion(context.Context, *connect.Request[v1alpha1.GetSwiftVersionRequest]) (*connect.Response[v1alpha1.GetSwiftVersionResponse], error)\n\t// GetMavenVersion resolves the given plugin and module references to a version.\n\tGetMavenVersion(context.Context, *connect.Request[v1alpha1.GetMavenVersionRequest]) (*connect.Response[v1alpha1.GetMavenVersionResponse], error)\n\t// GetNPMVersion resolves the given plugin and module references to a version.\n\tGetNPMVersion(context.Context, *connect.Request[v1alpha1.GetNPMVersionRequest]) (*connect.Response[v1alpha1.GetNPMVersionResponse], error)\n\t// GetPythonVersion resolves the given plugin and module references to a version.\n\tGetPythonVersion(context.Context, *connect.Request[v1alpha1.GetPythonVersionRequest]) (*connect.Response[v1alpha1.GetPythonVersionResponse], error)\n\t// GetCargoVersion resolves the given plugin and module references to a version.\n\tGetCargoVersion(context.Context, *connect.Request[v1alpha1.GetCargoVersionRequest]) (*connect.Response[v1alpha1.GetCargoVersionResponse], error)\n\t// GetNugetVersion resolves the given plugin and module references to a version.\n\tGetNugetVersion(context.Context, *connect.Request[v1alpha1.GetNugetVersionRequest]) (*connect.Response[v1alpha1.GetNugetVersionResponse], error)\n\t// GetCmakeVersion resolves the given plugin and module references to a version.\n\tGetCmakeVersion(context.Context, *connect.Request[v1alpha1.GetCmakeVersionRequest]) (*connect.Response[v1alpha1.GetCmakeVersionResponse], error)\n}\n\n// NewResolveServiceClient constructs a client for the buf.alpha.registry.v1alpha1.ResolveService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewResolveServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ResolveServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tresolveServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_resolve_proto.Services().ByName(\"ResolveService\").Methods()\n\treturn &resolveServiceClient{\n\t\tgetModulePins: connect.NewClient[v1alpha1.GetModulePinsRequest, v1alpha1.GetModulePinsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetModulePinsProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetModulePins\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetSDKInfo: connect.NewClient[v1alpha1.GetSDKInfoRequest, v1alpha1.GetSDKInfoResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetSDKInfoProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetSDKInfo\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetGoVersion: connect.NewClient[v1alpha1.GetGoVersionRequest, v1alpha1.GetGoVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetGoVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetGoVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetSwiftVersion: connect.NewClient[v1alpha1.GetSwiftVersionRequest, v1alpha1.GetSwiftVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetSwiftVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetSwiftVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetMavenVersion: connect.NewClient[v1alpha1.GetMavenVersionRequest, v1alpha1.GetMavenVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetMavenVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetMavenVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetNPMVersion: connect.NewClient[v1alpha1.GetNPMVersionRequest, v1alpha1.GetNPMVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetNPMVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetNPMVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetPythonVersion: connect.NewClient[v1alpha1.GetPythonVersionRequest, v1alpha1.GetPythonVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetPythonVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetPythonVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetCargoVersion: connect.NewClient[v1alpha1.GetCargoVersionRequest, v1alpha1.GetCargoVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetCargoVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetCargoVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetNugetVersion: connect.NewClient[v1alpha1.GetNugetVersionRequest, v1alpha1.GetNugetVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetNugetVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetNugetVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetCmakeVersion: connect.NewClient[v1alpha1.GetCmakeVersionRequest, v1alpha1.GetCmakeVersionResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResolveServiceGetCmakeVersionProcedure,\n\t\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetCmakeVersion\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// resolveServiceClient implements ResolveServiceClient.\ntype resolveServiceClient struct {\n\tgetModulePins    *connect.Client[v1alpha1.GetModulePinsRequest, v1alpha1.GetModulePinsResponse]\n\tgetSDKInfo       *connect.Client[v1alpha1.GetSDKInfoRequest, v1alpha1.GetSDKInfoResponse]\n\tgetGoVersion     *connect.Client[v1alpha1.GetGoVersionRequest, v1alpha1.GetGoVersionResponse]\n\tgetSwiftVersion  *connect.Client[v1alpha1.GetSwiftVersionRequest, v1alpha1.GetSwiftVersionResponse]\n\tgetMavenVersion  *connect.Client[v1alpha1.GetMavenVersionRequest, v1alpha1.GetMavenVersionResponse]\n\tgetNPMVersion    *connect.Client[v1alpha1.GetNPMVersionRequest, v1alpha1.GetNPMVersionResponse]\n\tgetPythonVersion *connect.Client[v1alpha1.GetPythonVersionRequest, v1alpha1.GetPythonVersionResponse]\n\tgetCargoVersion  *connect.Client[v1alpha1.GetCargoVersionRequest, v1alpha1.GetCargoVersionResponse]\n\tgetNugetVersion  *connect.Client[v1alpha1.GetNugetVersionRequest, v1alpha1.GetNugetVersionResponse]\n\tgetCmakeVersion  *connect.Client[v1alpha1.GetCmakeVersionRequest, v1alpha1.GetCmakeVersionResponse]\n}\n\n// GetModulePins calls buf.alpha.registry.v1alpha1.ResolveService.GetModulePins.\nfunc (c *resolveServiceClient) GetModulePins(ctx context.Context, req *connect.Request[v1alpha1.GetModulePinsRequest]) (*connect.Response[v1alpha1.GetModulePinsResponse], error) {\n\treturn c.getModulePins.CallUnary(ctx, req)\n}\n\n// GetSDKInfo calls buf.alpha.registry.v1alpha1.ResolveService.GetSDKInfo.\nfunc (c *resolveServiceClient) GetSDKInfo(ctx context.Context, req *connect.Request[v1alpha1.GetSDKInfoRequest]) (*connect.Response[v1alpha1.GetSDKInfoResponse], error) {\n\treturn c.getSDKInfo.CallUnary(ctx, req)\n}\n\n// GetGoVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetGoVersion.\nfunc (c *resolveServiceClient) GetGoVersion(ctx context.Context, req *connect.Request[v1alpha1.GetGoVersionRequest]) (*connect.Response[v1alpha1.GetGoVersionResponse], error) {\n\treturn c.getGoVersion.CallUnary(ctx, req)\n}\n\n// GetSwiftVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetSwiftVersion.\nfunc (c *resolveServiceClient) GetSwiftVersion(ctx context.Context, req *connect.Request[v1alpha1.GetSwiftVersionRequest]) (*connect.Response[v1alpha1.GetSwiftVersionResponse], error) {\n\treturn c.getSwiftVersion.CallUnary(ctx, req)\n}\n\n// GetMavenVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetMavenVersion.\nfunc (c *resolveServiceClient) GetMavenVersion(ctx context.Context, req *connect.Request[v1alpha1.GetMavenVersionRequest]) (*connect.Response[v1alpha1.GetMavenVersionResponse], error) {\n\treturn c.getMavenVersion.CallUnary(ctx, req)\n}\n\n// GetNPMVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetNPMVersion.\nfunc (c *resolveServiceClient) GetNPMVersion(ctx context.Context, req *connect.Request[v1alpha1.GetNPMVersionRequest]) (*connect.Response[v1alpha1.GetNPMVersionResponse], error) {\n\treturn c.getNPMVersion.CallUnary(ctx, req)\n}\n\n// GetPythonVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetPythonVersion.\nfunc (c *resolveServiceClient) GetPythonVersion(ctx context.Context, req *connect.Request[v1alpha1.GetPythonVersionRequest]) (*connect.Response[v1alpha1.GetPythonVersionResponse], error) {\n\treturn c.getPythonVersion.CallUnary(ctx, req)\n}\n\n// GetCargoVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetCargoVersion.\nfunc (c *resolveServiceClient) GetCargoVersion(ctx context.Context, req *connect.Request[v1alpha1.GetCargoVersionRequest]) (*connect.Response[v1alpha1.GetCargoVersionResponse], error) {\n\treturn c.getCargoVersion.CallUnary(ctx, req)\n}\n\n// GetNugetVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetNugetVersion.\nfunc (c *resolveServiceClient) GetNugetVersion(ctx context.Context, req *connect.Request[v1alpha1.GetNugetVersionRequest]) (*connect.Response[v1alpha1.GetNugetVersionResponse], error) {\n\treturn c.getNugetVersion.CallUnary(ctx, req)\n}\n\n// GetCmakeVersion calls buf.alpha.registry.v1alpha1.ResolveService.GetCmakeVersion.\nfunc (c *resolveServiceClient) GetCmakeVersion(ctx context.Context, req *connect.Request[v1alpha1.GetCmakeVersionRequest]) (*connect.Response[v1alpha1.GetCmakeVersionResponse], error) {\n\treturn c.getCmakeVersion.CallUnary(ctx, req)\n}\n\n// ResolveServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.ResolveService\n// service.\ntype ResolveServiceHandler interface {\n\t// GetModulePins finds all the latest digests and respective dependencies of\n\t// the provided module references and picks a set of distinct modules pins.\n\t//\n\t// Note that module references with commits should still be passed to this function\n\t// to make sure this function can do dependency resolution.\n\t//\n\t// This function also deals with tiebreaking what ModulePin wins for the same repository.\n\tGetModulePins(context.Context, *connect.Request[v1alpha1.GetModulePinsRequest]) (*connect.Response[v1alpha1.GetModulePinsResponse], error)\n\t// GetSDKInfo takes a module, plugin, and optionally SDK version, and returns the SDK\n\t// info. The SDK info includes the module, module commit, module commit create time, plugin,\n\t// plugin version, plugin revision, and the SDK version string\n\t// for the SDK.\n\t//\n\t// If the module reference and/or plugin version is included, then the SDK at the\n\t// specified version will be resolved. If the SDK version is included, then it will be\n\t// validated with the module and plugin information provided.\n\t//\n\t// This replaces the need for all subsequent RPCs, which requires the caller to resolve\n\t// the registry type first. Instead, the registry type will be resolved based on the plugin\n\t// information provided.\n\tGetSDKInfo(context.Context, *connect.Request[v1alpha1.GetSDKInfoRequest]) (*connect.Response[v1alpha1.GetSDKInfoResponse], error)\n\t// GetGoVersion resolves the given plugin and module references to a version.\n\tGetGoVersion(context.Context, *connect.Request[v1alpha1.GetGoVersionRequest]) (*connect.Response[v1alpha1.GetGoVersionResponse], error)\n\t// GetSwiftVersion resolves the given plugin and module references to a version.\n\tGetSwiftVersion(context.Context, *connect.Request[v1alpha1.GetSwiftVersionRequest]) (*connect.Response[v1alpha1.GetSwiftVersionResponse], error)\n\t// GetMavenVersion resolves the given plugin and module references to a version.\n\tGetMavenVersion(context.Context, *connect.Request[v1alpha1.GetMavenVersionRequest]) (*connect.Response[v1alpha1.GetMavenVersionResponse], error)\n\t// GetNPMVersion resolves the given plugin and module references to a version.\n\tGetNPMVersion(context.Context, *connect.Request[v1alpha1.GetNPMVersionRequest]) (*connect.Response[v1alpha1.GetNPMVersionResponse], error)\n\t// GetPythonVersion resolves the given plugin and module references to a version.\n\tGetPythonVersion(context.Context, *connect.Request[v1alpha1.GetPythonVersionRequest]) (*connect.Response[v1alpha1.GetPythonVersionResponse], error)\n\t// GetCargoVersion resolves the given plugin and module references to a version.\n\tGetCargoVersion(context.Context, *connect.Request[v1alpha1.GetCargoVersionRequest]) (*connect.Response[v1alpha1.GetCargoVersionResponse], error)\n\t// GetNugetVersion resolves the given plugin and module references to a version.\n\tGetNugetVersion(context.Context, *connect.Request[v1alpha1.GetNugetVersionRequest]) (*connect.Response[v1alpha1.GetNugetVersionResponse], error)\n\t// GetCmakeVersion resolves the given plugin and module references to a version.\n\tGetCmakeVersion(context.Context, *connect.Request[v1alpha1.GetCmakeVersionRequest]) (*connect.Response[v1alpha1.GetCmakeVersionResponse], error)\n}\n\n// NewResolveServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewResolveServiceHandler(svc ResolveServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tresolveServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_resolve_proto.Services().ByName(\"ResolveService\").Methods()\n\tresolveServiceGetModulePinsHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetModulePinsProcedure,\n\t\tsvc.GetModulePins,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetModulePins\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetSDKInfoHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetSDKInfoProcedure,\n\t\tsvc.GetSDKInfo,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetSDKInfo\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetGoVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetGoVersionProcedure,\n\t\tsvc.GetGoVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetGoVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetSwiftVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetSwiftVersionProcedure,\n\t\tsvc.GetSwiftVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetSwiftVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetMavenVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetMavenVersionProcedure,\n\t\tsvc.GetMavenVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetMavenVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetNPMVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetNPMVersionProcedure,\n\t\tsvc.GetNPMVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetNPMVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetPythonVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetPythonVersionProcedure,\n\t\tsvc.GetPythonVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetPythonVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetCargoVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetCargoVersionProcedure,\n\t\tsvc.GetCargoVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetCargoVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetNugetVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetNugetVersionProcedure,\n\t\tsvc.GetNugetVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetNugetVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tresolveServiceGetCmakeVersionHandler := connect.NewUnaryHandler(\n\t\tResolveServiceGetCmakeVersionProcedure,\n\t\tsvc.GetCmakeVersion,\n\t\tconnect.WithSchema(resolveServiceMethods.ByName(\"GetCmakeVersion\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.ResolveService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase ResolveServiceGetModulePinsProcedure:\n\t\t\tresolveServiceGetModulePinsHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetSDKInfoProcedure:\n\t\t\tresolveServiceGetSDKInfoHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetGoVersionProcedure:\n\t\t\tresolveServiceGetGoVersionHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetSwiftVersionProcedure:\n\t\t\tresolveServiceGetSwiftVersionHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetMavenVersionProcedure:\n\t\t\tresolveServiceGetMavenVersionHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetNPMVersionProcedure:\n\t\t\tresolveServiceGetNPMVersionHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetPythonVersionProcedure:\n\t\t\tresolveServiceGetPythonVersionHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetCargoVersionProcedure:\n\t\t\tresolveServiceGetCargoVersionHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetNugetVersionProcedure:\n\t\t\tresolveServiceGetNugetVersionHandler.ServeHTTP(w, r)\n\t\tcase ResolveServiceGetCmakeVersionProcedure:\n\t\t\tresolveServiceGetCmakeVersionHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedResolveServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedResolveServiceHandler struct{}\n\nfunc (UnimplementedResolveServiceHandler) GetModulePins(context.Context, *connect.Request[v1alpha1.GetModulePinsRequest]) (*connect.Response[v1alpha1.GetModulePinsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetModulePins is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetSDKInfo(context.Context, *connect.Request[v1alpha1.GetSDKInfoRequest]) (*connect.Response[v1alpha1.GetSDKInfoResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetSDKInfo is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetGoVersion(context.Context, *connect.Request[v1alpha1.GetGoVersionRequest]) (*connect.Response[v1alpha1.GetGoVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetGoVersion is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetSwiftVersion(context.Context, *connect.Request[v1alpha1.GetSwiftVersionRequest]) (*connect.Response[v1alpha1.GetSwiftVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetSwiftVersion is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetMavenVersion(context.Context, *connect.Request[v1alpha1.GetMavenVersionRequest]) (*connect.Response[v1alpha1.GetMavenVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetMavenVersion is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetNPMVersion(context.Context, *connect.Request[v1alpha1.GetNPMVersionRequest]) (*connect.Response[v1alpha1.GetNPMVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetNPMVersion is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetPythonVersion(context.Context, *connect.Request[v1alpha1.GetPythonVersionRequest]) (*connect.Response[v1alpha1.GetPythonVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetPythonVersion is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetCargoVersion(context.Context, *connect.Request[v1alpha1.GetCargoVersionRequest]) (*connect.Response[v1alpha1.GetCargoVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetCargoVersion is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetNugetVersion(context.Context, *connect.Request[v1alpha1.GetNugetVersionRequest]) (*connect.Response[v1alpha1.GetNugetVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetNugetVersion is not implemented\"))\n}\n\nfunc (UnimplementedResolveServiceHandler) GetCmakeVersion(context.Context, *connect.Request[v1alpha1.GetCmakeVersionRequest]) (*connect.Response[v1alpha1.GetCmakeVersionResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResolveService.GetCmakeVersion is not implemented\"))\n}\n\n// LocalResolveServiceClient is a client for the buf.alpha.registry.v1alpha1.LocalResolveService\n// service.\ntype LocalResolveServiceClient interface {\n\t// GetLocalModulePins gets the latest pins for the specified local module references.\n\t// It also includes all of the modules transitive dependencies for the specified references.\n\t//\n\t// We want this for two reasons:\n\t//\n\t//  1. It makes it easy to say \"we know we're looking for owner/repo on this specific remote\".\n\t//     While we could just do this in GetModulePins by being aware of what our remote is\n\t//     (something we probably still need to know, DNS problems aside, which are more\n\t//     theoretical), this helps.\n\t//  2. Having a separate method makes us able to say \"do not make decisions about what\n\t//     wins between competing pins for the same repo\". This should only be done in\n\t//     GetModulePins, not in this function, i.e. only done at the top level.\n\tGetLocalModulePins(context.Context, *connect.Request[v1alpha1.GetLocalModulePinsRequest]) (*connect.Response[v1alpha1.GetLocalModulePinsResponse], error)\n}\n\n// NewLocalResolveServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.LocalResolveService service. By default, it uses the Connect protocol\n// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To\n// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()\n// options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewLocalResolveServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) LocalResolveServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tlocalResolveServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_resolve_proto.Services().ByName(\"LocalResolveService\").Methods()\n\treturn &localResolveServiceClient{\n\t\tgetLocalModulePins: connect.NewClient[v1alpha1.GetLocalModulePinsRequest, v1alpha1.GetLocalModulePinsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+LocalResolveServiceGetLocalModulePinsProcedure,\n\t\t\tconnect.WithSchema(localResolveServiceMethods.ByName(\"GetLocalModulePins\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// localResolveServiceClient implements LocalResolveServiceClient.\ntype localResolveServiceClient struct {\n\tgetLocalModulePins *connect.Client[v1alpha1.GetLocalModulePinsRequest, v1alpha1.GetLocalModulePinsResponse]\n}\n\n// GetLocalModulePins calls buf.alpha.registry.v1alpha1.LocalResolveService.GetLocalModulePins.\nfunc (c *localResolveServiceClient) GetLocalModulePins(ctx context.Context, req *connect.Request[v1alpha1.GetLocalModulePinsRequest]) (*connect.Response[v1alpha1.GetLocalModulePinsResponse], error) {\n\treturn c.getLocalModulePins.CallUnary(ctx, req)\n}\n\n// LocalResolveServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.LocalResolveService service.\ntype LocalResolveServiceHandler interface {\n\t// GetLocalModulePins gets the latest pins for the specified local module references.\n\t// It also includes all of the modules transitive dependencies for the specified references.\n\t//\n\t// We want this for two reasons:\n\t//\n\t//  1. It makes it easy to say \"we know we're looking for owner/repo on this specific remote\".\n\t//     While we could just do this in GetModulePins by being aware of what our remote is\n\t//     (something we probably still need to know, DNS problems aside, which are more\n\t//     theoretical), this helps.\n\t//  2. Having a separate method makes us able to say \"do not make decisions about what\n\t//     wins between competing pins for the same repo\". This should only be done in\n\t//     GetModulePins, not in this function, i.e. only done at the top level.\n\tGetLocalModulePins(context.Context, *connect.Request[v1alpha1.GetLocalModulePinsRequest]) (*connect.Response[v1alpha1.GetLocalModulePinsResponse], error)\n}\n\n// NewLocalResolveServiceHandler builds an HTTP handler from the service implementation. It returns\n// the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewLocalResolveServiceHandler(svc LocalResolveServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tlocalResolveServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_resolve_proto.Services().ByName(\"LocalResolveService\").Methods()\n\tlocalResolveServiceGetLocalModulePinsHandler := connect.NewUnaryHandler(\n\t\tLocalResolveServiceGetLocalModulePinsProcedure,\n\t\tsvc.GetLocalModulePins,\n\t\tconnect.WithSchema(localResolveServiceMethods.ByName(\"GetLocalModulePins\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.LocalResolveService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase LocalResolveServiceGetLocalModulePinsProcedure:\n\t\t\tlocalResolveServiceGetLocalModulePinsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedLocalResolveServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedLocalResolveServiceHandler struct{}\n\nfunc (UnimplementedLocalResolveServiceHandler) GetLocalModulePins(context.Context, *connect.Request[v1alpha1.GetLocalModulePinsRequest]) (*connect.Response[v1alpha1.GetLocalModulePinsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.LocalResolveService.GetLocalModulePins is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/resource.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/resource.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// ResourceServiceName is the fully-qualified name of the ResourceService service.\n\tResourceServiceName = \"buf.alpha.registry.v1alpha1.ResourceService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// ResourceServiceGetResourceByNameProcedure is the fully-qualified name of the ResourceService's\n\t// GetResourceByName RPC.\n\tResourceServiceGetResourceByNameProcedure = \"/buf.alpha.registry.v1alpha1.ResourceService/GetResourceByName\"\n)\n\n// ResourceServiceClient is a client for the buf.alpha.registry.v1alpha1.ResourceService service.\ntype ResourceServiceClient interface {\n\t// GetResourceByName takes a resource name and returns the\n\t// resource either as a repository or a plugin.\n\tGetResourceByName(context.Context, *connect.Request[v1alpha1.GetResourceByNameRequest]) (*connect.Response[v1alpha1.GetResourceByNameResponse], error)\n}\n\n// NewResourceServiceClient constructs a client for the buf.alpha.registry.v1alpha1.ResourceService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewResourceServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ResourceServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tresourceServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_resource_proto.Services().ByName(\"ResourceService\").Methods()\n\treturn &resourceServiceClient{\n\t\tgetResourceByName: connect.NewClient[v1alpha1.GetResourceByNameRequest, v1alpha1.GetResourceByNameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+ResourceServiceGetResourceByNameProcedure,\n\t\t\tconnect.WithSchema(resourceServiceMethods.ByName(\"GetResourceByName\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// resourceServiceClient implements ResourceServiceClient.\ntype resourceServiceClient struct {\n\tgetResourceByName *connect.Client[v1alpha1.GetResourceByNameRequest, v1alpha1.GetResourceByNameResponse]\n}\n\n// GetResourceByName calls buf.alpha.registry.v1alpha1.ResourceService.GetResourceByName.\nfunc (c *resourceServiceClient) GetResourceByName(ctx context.Context, req *connect.Request[v1alpha1.GetResourceByNameRequest]) (*connect.Response[v1alpha1.GetResourceByNameResponse], error) {\n\treturn c.getResourceByName.CallUnary(ctx, req)\n}\n\n// ResourceServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.ResourceService\n// service.\ntype ResourceServiceHandler interface {\n\t// GetResourceByName takes a resource name and returns the\n\t// resource either as a repository or a plugin.\n\tGetResourceByName(context.Context, *connect.Request[v1alpha1.GetResourceByNameRequest]) (*connect.Response[v1alpha1.GetResourceByNameResponse], error)\n}\n\n// NewResourceServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewResourceServiceHandler(svc ResourceServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tresourceServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_resource_proto.Services().ByName(\"ResourceService\").Methods()\n\tresourceServiceGetResourceByNameHandler := connect.NewUnaryHandler(\n\t\tResourceServiceGetResourceByNameProcedure,\n\t\tsvc.GetResourceByName,\n\t\tconnect.WithSchema(resourceServiceMethods.ByName(\"GetResourceByName\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.ResourceService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase ResourceServiceGetResourceByNameProcedure:\n\t\t\tresourceServiceGetResourceByNameHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedResourceServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedResourceServiceHandler struct{}\n\nfunc (UnimplementedResourceServiceHandler) GetResourceByName(context.Context, *connect.Request[v1alpha1.GetResourceByNameRequest]) (*connect.Response[v1alpha1.GetResourceByNameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.ResourceService.GetResourceByName is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/schema.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/schema.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// SchemaServiceName is the fully-qualified name of the SchemaService service.\n\tSchemaServiceName = \"buf.alpha.registry.v1alpha1.SchemaService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// SchemaServiceGetSchemaProcedure is the fully-qualified name of the SchemaService's GetSchema RPC.\n\tSchemaServiceGetSchemaProcedure = \"/buf.alpha.registry.v1alpha1.SchemaService/GetSchema\"\n\t// SchemaServiceConvertMessageProcedure is the fully-qualified name of the SchemaService's\n\t// ConvertMessage RPC.\n\tSchemaServiceConvertMessageProcedure = \"/buf.alpha.registry.v1alpha1.SchemaService/ConvertMessage\"\n)\n\n// SchemaServiceClient is a client for the buf.alpha.registry.v1alpha1.SchemaService service.\ntype SchemaServiceClient interface {\n\t// GetSchema allows the caller to download a schema for one or more requested\n\t// types, RPC services, or RPC methods.\n\tGetSchema(context.Context, *connect.Request[v1alpha1.GetSchemaRequest]) (*connect.Response[v1alpha1.GetSchemaResponse], error)\n\t// ConvertMessage allows the caller to convert a given message data blob from\n\t// one format to another by referring to a type schema for the blob.\n\tConvertMessage(context.Context, *connect.Request[v1alpha1.ConvertMessageRequest]) (*connect.Response[v1alpha1.ConvertMessageResponse], error)\n}\n\n// NewSchemaServiceClient constructs a client for the buf.alpha.registry.v1alpha1.SchemaService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewSchemaServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SchemaServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tschemaServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_schema_proto.Services().ByName(\"SchemaService\").Methods()\n\treturn &schemaServiceClient{\n\t\tgetSchema: connect.NewClient[v1alpha1.GetSchemaRequest, v1alpha1.GetSchemaResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SchemaServiceGetSchemaProcedure,\n\t\t\tconnect.WithSchema(schemaServiceMethods.ByName(\"GetSchema\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tconvertMessage: connect.NewClient[v1alpha1.ConvertMessageRequest, v1alpha1.ConvertMessageResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SchemaServiceConvertMessageProcedure,\n\t\t\tconnect.WithSchema(schemaServiceMethods.ByName(\"ConvertMessage\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// schemaServiceClient implements SchemaServiceClient.\ntype schemaServiceClient struct {\n\tgetSchema      *connect.Client[v1alpha1.GetSchemaRequest, v1alpha1.GetSchemaResponse]\n\tconvertMessage *connect.Client[v1alpha1.ConvertMessageRequest, v1alpha1.ConvertMessageResponse]\n}\n\n// GetSchema calls buf.alpha.registry.v1alpha1.SchemaService.GetSchema.\nfunc (c *schemaServiceClient) GetSchema(ctx context.Context, req *connect.Request[v1alpha1.GetSchemaRequest]) (*connect.Response[v1alpha1.GetSchemaResponse], error) {\n\treturn c.getSchema.CallUnary(ctx, req)\n}\n\n// ConvertMessage calls buf.alpha.registry.v1alpha1.SchemaService.ConvertMessage.\nfunc (c *schemaServiceClient) ConvertMessage(ctx context.Context, req *connect.Request[v1alpha1.ConvertMessageRequest]) (*connect.Response[v1alpha1.ConvertMessageResponse], error) {\n\treturn c.convertMessage.CallUnary(ctx, req)\n}\n\n// SchemaServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.SchemaService\n// service.\ntype SchemaServiceHandler interface {\n\t// GetSchema allows the caller to download a schema for one or more requested\n\t// types, RPC services, or RPC methods.\n\tGetSchema(context.Context, *connect.Request[v1alpha1.GetSchemaRequest]) (*connect.Response[v1alpha1.GetSchemaResponse], error)\n\t// ConvertMessage allows the caller to convert a given message data blob from\n\t// one format to another by referring to a type schema for the blob.\n\tConvertMessage(context.Context, *connect.Request[v1alpha1.ConvertMessageRequest]) (*connect.Response[v1alpha1.ConvertMessageResponse], error)\n}\n\n// NewSchemaServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewSchemaServiceHandler(svc SchemaServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tschemaServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_schema_proto.Services().ByName(\"SchemaService\").Methods()\n\tschemaServiceGetSchemaHandler := connect.NewUnaryHandler(\n\t\tSchemaServiceGetSchemaProcedure,\n\t\tsvc.GetSchema,\n\t\tconnect.WithSchema(schemaServiceMethods.ByName(\"GetSchema\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tschemaServiceConvertMessageHandler := connect.NewUnaryHandler(\n\t\tSchemaServiceConvertMessageProcedure,\n\t\tsvc.ConvertMessage,\n\t\tconnect.WithSchema(schemaServiceMethods.ByName(\"ConvertMessage\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.SchemaService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase SchemaServiceGetSchemaProcedure:\n\t\t\tschemaServiceGetSchemaHandler.ServeHTTP(w, r)\n\t\tcase SchemaServiceConvertMessageProcedure:\n\t\t\tschemaServiceConvertMessageHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedSchemaServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedSchemaServiceHandler struct{}\n\nfunc (UnimplementedSchemaServiceHandler) GetSchema(context.Context, *connect.Request[v1alpha1.GetSchemaRequest]) (*connect.Response[v1alpha1.GetSchemaResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SchemaService.GetSchema is not implemented\"))\n}\n\nfunc (UnimplementedSchemaServiceHandler) ConvertMessage(context.Context, *connect.Request[v1alpha1.ConvertMessageRequest]) (*connect.Response[v1alpha1.ConvertMessageResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SchemaService.ConvertMessage is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/scim_token.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/scim_token.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// SCIMTokenServiceName is the fully-qualified name of the SCIMTokenService service.\n\tSCIMTokenServiceName = \"buf.alpha.registry.v1alpha1.SCIMTokenService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// SCIMTokenServiceCreateSCIMTokenProcedure is the fully-qualified name of the SCIMTokenService's\n\t// CreateSCIMToken RPC.\n\tSCIMTokenServiceCreateSCIMTokenProcedure = \"/buf.alpha.registry.v1alpha1.SCIMTokenService/CreateSCIMToken\"\n\t// SCIMTokenServiceListSCIMTokensProcedure is the fully-qualified name of the SCIMTokenService's\n\t// ListSCIMTokens RPC.\n\tSCIMTokenServiceListSCIMTokensProcedure = \"/buf.alpha.registry.v1alpha1.SCIMTokenService/ListSCIMTokens\"\n\t// SCIMTokenServiceDeleteSCIMTokenProcedure is the fully-qualified name of the SCIMTokenService's\n\t// DeleteSCIMToken RPC.\n\tSCIMTokenServiceDeleteSCIMTokenProcedure = \"/buf.alpha.registry.v1alpha1.SCIMTokenService/DeleteSCIMToken\"\n)\n\n// SCIMTokenServiceClient is a client for the buf.alpha.registry.v1alpha1.SCIMTokenService service.\ntype SCIMTokenServiceClient interface {\n\t// CreateToken creates a new token suitable for authentication to the SCIM API.\n\t//\n\t// This method requires authentication.\n\tCreateSCIMToken(context.Context, *connect.Request[v1alpha1.CreateSCIMTokenRequest]) (*connect.Response[v1alpha1.CreateSCIMTokenResponse], error)\n\t// ListTokens lists all active SCIM tokens.\n\t//\n\t// This method requires authentication.\n\tListSCIMTokens(context.Context, *connect.Request[v1alpha1.ListSCIMTokensRequest]) (*connect.Response[v1alpha1.ListSCIMTokensResponse], error)\n\t// DeleteToken deletes an existing token.\n\t//\n\t// This method requires authentication.\n\tDeleteSCIMToken(context.Context, *connect.Request[v1alpha1.DeleteSCIMTokenRequest]) (*connect.Response[v1alpha1.DeleteSCIMTokenResponse], error)\n}\n\n// NewSCIMTokenServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.SCIMTokenService service. By default, it uses the Connect protocol\n// with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To\n// use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb()\n// options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewSCIMTokenServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SCIMTokenServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tsCIMTokenServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_scim_token_proto.Services().ByName(\"SCIMTokenService\").Methods()\n\treturn &sCIMTokenServiceClient{\n\t\tcreateSCIMToken: connect.NewClient[v1alpha1.CreateSCIMTokenRequest, v1alpha1.CreateSCIMTokenResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SCIMTokenServiceCreateSCIMTokenProcedure,\n\t\t\tconnect.WithSchema(sCIMTokenServiceMethods.ByName(\"CreateSCIMToken\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistSCIMTokens: connect.NewClient[v1alpha1.ListSCIMTokensRequest, v1alpha1.ListSCIMTokensResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SCIMTokenServiceListSCIMTokensProcedure,\n\t\t\tconnect.WithSchema(sCIMTokenServiceMethods.ByName(\"ListSCIMTokens\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteSCIMToken: connect.NewClient[v1alpha1.DeleteSCIMTokenRequest, v1alpha1.DeleteSCIMTokenResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SCIMTokenServiceDeleteSCIMTokenProcedure,\n\t\t\tconnect.WithSchema(sCIMTokenServiceMethods.ByName(\"DeleteSCIMToken\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// sCIMTokenServiceClient implements SCIMTokenServiceClient.\ntype sCIMTokenServiceClient struct {\n\tcreateSCIMToken *connect.Client[v1alpha1.CreateSCIMTokenRequest, v1alpha1.CreateSCIMTokenResponse]\n\tlistSCIMTokens  *connect.Client[v1alpha1.ListSCIMTokensRequest, v1alpha1.ListSCIMTokensResponse]\n\tdeleteSCIMToken *connect.Client[v1alpha1.DeleteSCIMTokenRequest, v1alpha1.DeleteSCIMTokenResponse]\n}\n\n// CreateSCIMToken calls buf.alpha.registry.v1alpha1.SCIMTokenService.CreateSCIMToken.\nfunc (c *sCIMTokenServiceClient) CreateSCIMToken(ctx context.Context, req *connect.Request[v1alpha1.CreateSCIMTokenRequest]) (*connect.Response[v1alpha1.CreateSCIMTokenResponse], error) {\n\treturn c.createSCIMToken.CallUnary(ctx, req)\n}\n\n// ListSCIMTokens calls buf.alpha.registry.v1alpha1.SCIMTokenService.ListSCIMTokens.\nfunc (c *sCIMTokenServiceClient) ListSCIMTokens(ctx context.Context, req *connect.Request[v1alpha1.ListSCIMTokensRequest]) (*connect.Response[v1alpha1.ListSCIMTokensResponse], error) {\n\treturn c.listSCIMTokens.CallUnary(ctx, req)\n}\n\n// DeleteSCIMToken calls buf.alpha.registry.v1alpha1.SCIMTokenService.DeleteSCIMToken.\nfunc (c *sCIMTokenServiceClient) DeleteSCIMToken(ctx context.Context, req *connect.Request[v1alpha1.DeleteSCIMTokenRequest]) (*connect.Response[v1alpha1.DeleteSCIMTokenResponse], error) {\n\treturn c.deleteSCIMToken.CallUnary(ctx, req)\n}\n\n// SCIMTokenServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.SCIMTokenService\n// service.\ntype SCIMTokenServiceHandler interface {\n\t// CreateToken creates a new token suitable for authentication to the SCIM API.\n\t//\n\t// This method requires authentication.\n\tCreateSCIMToken(context.Context, *connect.Request[v1alpha1.CreateSCIMTokenRequest]) (*connect.Response[v1alpha1.CreateSCIMTokenResponse], error)\n\t// ListTokens lists all active SCIM tokens.\n\t//\n\t// This method requires authentication.\n\tListSCIMTokens(context.Context, *connect.Request[v1alpha1.ListSCIMTokensRequest]) (*connect.Response[v1alpha1.ListSCIMTokensResponse], error)\n\t// DeleteToken deletes an existing token.\n\t//\n\t// This method requires authentication.\n\tDeleteSCIMToken(context.Context, *connect.Request[v1alpha1.DeleteSCIMTokenRequest]) (*connect.Response[v1alpha1.DeleteSCIMTokenResponse], error)\n}\n\n// NewSCIMTokenServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewSCIMTokenServiceHandler(svc SCIMTokenServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tsCIMTokenServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_scim_token_proto.Services().ByName(\"SCIMTokenService\").Methods()\n\tsCIMTokenServiceCreateSCIMTokenHandler := connect.NewUnaryHandler(\n\t\tSCIMTokenServiceCreateSCIMTokenProcedure,\n\t\tsvc.CreateSCIMToken,\n\t\tconnect.WithSchema(sCIMTokenServiceMethods.ByName(\"CreateSCIMToken\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tsCIMTokenServiceListSCIMTokensHandler := connect.NewUnaryHandler(\n\t\tSCIMTokenServiceListSCIMTokensProcedure,\n\t\tsvc.ListSCIMTokens,\n\t\tconnect.WithSchema(sCIMTokenServiceMethods.ByName(\"ListSCIMTokens\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tsCIMTokenServiceDeleteSCIMTokenHandler := connect.NewUnaryHandler(\n\t\tSCIMTokenServiceDeleteSCIMTokenProcedure,\n\t\tsvc.DeleteSCIMToken,\n\t\tconnect.WithSchema(sCIMTokenServiceMethods.ByName(\"DeleteSCIMToken\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.SCIMTokenService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase SCIMTokenServiceCreateSCIMTokenProcedure:\n\t\t\tsCIMTokenServiceCreateSCIMTokenHandler.ServeHTTP(w, r)\n\t\tcase SCIMTokenServiceListSCIMTokensProcedure:\n\t\t\tsCIMTokenServiceListSCIMTokensHandler.ServeHTTP(w, r)\n\t\tcase SCIMTokenServiceDeleteSCIMTokenProcedure:\n\t\t\tsCIMTokenServiceDeleteSCIMTokenHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedSCIMTokenServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedSCIMTokenServiceHandler struct{}\n\nfunc (UnimplementedSCIMTokenServiceHandler) CreateSCIMToken(context.Context, *connect.Request[v1alpha1.CreateSCIMTokenRequest]) (*connect.Response[v1alpha1.CreateSCIMTokenResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SCIMTokenService.CreateSCIMToken is not implemented\"))\n}\n\nfunc (UnimplementedSCIMTokenServiceHandler) ListSCIMTokens(context.Context, *connect.Request[v1alpha1.ListSCIMTokensRequest]) (*connect.Response[v1alpha1.ListSCIMTokensResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SCIMTokenService.ListSCIMTokens is not implemented\"))\n}\n\nfunc (UnimplementedSCIMTokenServiceHandler) DeleteSCIMToken(context.Context, *connect.Request[v1alpha1.DeleteSCIMTokenRequest]) (*connect.Response[v1alpha1.DeleteSCIMTokenResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SCIMTokenService.DeleteSCIMToken is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/search.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/search.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// SearchServiceName is the fully-qualified name of the SearchService service.\n\tSearchServiceName = \"buf.alpha.registry.v1alpha1.SearchService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// SearchServiceSearchProcedure is the fully-qualified name of the SearchService's Search RPC.\n\tSearchServiceSearchProcedure = \"/buf.alpha.registry.v1alpha1.SearchService/Search\"\n\t// SearchServiceSearchTagProcedure is the fully-qualified name of the SearchService's SearchTag RPC.\n\tSearchServiceSearchTagProcedure = \"/buf.alpha.registry.v1alpha1.SearchService/SearchTag\"\n\t// SearchServiceSearchDraftProcedure is the fully-qualified name of the SearchService's SearchDraft\n\t// RPC.\n\tSearchServiceSearchDraftProcedure = \"/buf.alpha.registry.v1alpha1.SearchService/SearchDraft\"\n\t// SearchServiceSearchModuleContentProcedure is the fully-qualified name of the SearchService's\n\t// SearchModuleContent RPC.\n\tSearchServiceSearchModuleContentProcedure = \"/buf.alpha.registry.v1alpha1.SearchService/SearchModuleContent\"\n)\n\n// SearchServiceClient is a client for the buf.alpha.registry.v1alpha1.SearchService service.\ntype SearchServiceClient interface {\n\t// Search searches the BSR.\n\tSearch(context.Context, *connect.Request[v1alpha1.SearchRequest]) (*connect.Response[v1alpha1.SearchResponse], error)\n\t// SearchTag searches for tags in a repository\n\tSearchTag(context.Context, *connect.Request[v1alpha1.SearchTagRequest]) (*connect.Response[v1alpha1.SearchTagResponse], error)\n\t// SearchDraft searches for drafts in a repository\n\tSearchDraft(context.Context, *connect.Request[v1alpha1.SearchDraftRequest]) (*connect.Response[v1alpha1.SearchDraftResponse], error)\n\t// SearchModuleContent searches for module contents on the BSR.\n\tSearchModuleContent(context.Context, *connect.Request[v1alpha1.SearchModuleContentRequest]) (*connect.Response[v1alpha1.SearchModuleContentResponse], error)\n}\n\n// NewSearchServiceClient constructs a client for the buf.alpha.registry.v1alpha1.SearchService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewSearchServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SearchServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tsearchServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_search_proto.Services().ByName(\"SearchService\").Methods()\n\treturn &searchServiceClient{\n\t\tsearch: connect.NewClient[v1alpha1.SearchRequest, v1alpha1.SearchResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SearchServiceSearchProcedure,\n\t\t\tconnect.WithSchema(searchServiceMethods.ByName(\"Search\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tsearchTag: connect.NewClient[v1alpha1.SearchTagRequest, v1alpha1.SearchTagResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SearchServiceSearchTagProcedure,\n\t\t\tconnect.WithSchema(searchServiceMethods.ByName(\"SearchTag\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tsearchDraft: connect.NewClient[v1alpha1.SearchDraftRequest, v1alpha1.SearchDraftResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SearchServiceSearchDraftProcedure,\n\t\t\tconnect.WithSchema(searchServiceMethods.ByName(\"SearchDraft\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tsearchModuleContent: connect.NewClient[v1alpha1.SearchModuleContentRequest, v1alpha1.SearchModuleContentResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+SearchServiceSearchModuleContentProcedure,\n\t\t\tconnect.WithSchema(searchServiceMethods.ByName(\"SearchModuleContent\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// searchServiceClient implements SearchServiceClient.\ntype searchServiceClient struct {\n\tsearch              *connect.Client[v1alpha1.SearchRequest, v1alpha1.SearchResponse]\n\tsearchTag           *connect.Client[v1alpha1.SearchTagRequest, v1alpha1.SearchTagResponse]\n\tsearchDraft         *connect.Client[v1alpha1.SearchDraftRequest, v1alpha1.SearchDraftResponse]\n\tsearchModuleContent *connect.Client[v1alpha1.SearchModuleContentRequest, v1alpha1.SearchModuleContentResponse]\n}\n\n// Search calls buf.alpha.registry.v1alpha1.SearchService.Search.\nfunc (c *searchServiceClient) Search(ctx context.Context, req *connect.Request[v1alpha1.SearchRequest]) (*connect.Response[v1alpha1.SearchResponse], error) {\n\treturn c.search.CallUnary(ctx, req)\n}\n\n// SearchTag calls buf.alpha.registry.v1alpha1.SearchService.SearchTag.\nfunc (c *searchServiceClient) SearchTag(ctx context.Context, req *connect.Request[v1alpha1.SearchTagRequest]) (*connect.Response[v1alpha1.SearchTagResponse], error) {\n\treturn c.searchTag.CallUnary(ctx, req)\n}\n\n// SearchDraft calls buf.alpha.registry.v1alpha1.SearchService.SearchDraft.\nfunc (c *searchServiceClient) SearchDraft(ctx context.Context, req *connect.Request[v1alpha1.SearchDraftRequest]) (*connect.Response[v1alpha1.SearchDraftResponse], error) {\n\treturn c.searchDraft.CallUnary(ctx, req)\n}\n\n// SearchModuleContent calls buf.alpha.registry.v1alpha1.SearchService.SearchModuleContent.\nfunc (c *searchServiceClient) SearchModuleContent(ctx context.Context, req *connect.Request[v1alpha1.SearchModuleContentRequest]) (*connect.Response[v1alpha1.SearchModuleContentResponse], error) {\n\treturn c.searchModuleContent.CallUnary(ctx, req)\n}\n\n// SearchServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.SearchService\n// service.\ntype SearchServiceHandler interface {\n\t// Search searches the BSR.\n\tSearch(context.Context, *connect.Request[v1alpha1.SearchRequest]) (*connect.Response[v1alpha1.SearchResponse], error)\n\t// SearchTag searches for tags in a repository\n\tSearchTag(context.Context, *connect.Request[v1alpha1.SearchTagRequest]) (*connect.Response[v1alpha1.SearchTagResponse], error)\n\t// SearchDraft searches for drafts in a repository\n\tSearchDraft(context.Context, *connect.Request[v1alpha1.SearchDraftRequest]) (*connect.Response[v1alpha1.SearchDraftResponse], error)\n\t// SearchModuleContent searches for module contents on the BSR.\n\tSearchModuleContent(context.Context, *connect.Request[v1alpha1.SearchModuleContentRequest]) (*connect.Response[v1alpha1.SearchModuleContentResponse], error)\n}\n\n// NewSearchServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewSearchServiceHandler(svc SearchServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tsearchServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_search_proto.Services().ByName(\"SearchService\").Methods()\n\tsearchServiceSearchHandler := connect.NewUnaryHandler(\n\t\tSearchServiceSearchProcedure,\n\t\tsvc.Search,\n\t\tconnect.WithSchema(searchServiceMethods.ByName(\"Search\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tsearchServiceSearchTagHandler := connect.NewUnaryHandler(\n\t\tSearchServiceSearchTagProcedure,\n\t\tsvc.SearchTag,\n\t\tconnect.WithSchema(searchServiceMethods.ByName(\"SearchTag\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tsearchServiceSearchDraftHandler := connect.NewUnaryHandler(\n\t\tSearchServiceSearchDraftProcedure,\n\t\tsvc.SearchDraft,\n\t\tconnect.WithSchema(searchServiceMethods.ByName(\"SearchDraft\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tsearchServiceSearchModuleContentHandler := connect.NewUnaryHandler(\n\t\tSearchServiceSearchModuleContentProcedure,\n\t\tsvc.SearchModuleContent,\n\t\tconnect.WithSchema(searchServiceMethods.ByName(\"SearchModuleContent\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.SearchService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase SearchServiceSearchProcedure:\n\t\t\tsearchServiceSearchHandler.ServeHTTP(w, r)\n\t\tcase SearchServiceSearchTagProcedure:\n\t\t\tsearchServiceSearchTagHandler.ServeHTTP(w, r)\n\t\tcase SearchServiceSearchDraftProcedure:\n\t\t\tsearchServiceSearchDraftHandler.ServeHTTP(w, r)\n\t\tcase SearchServiceSearchModuleContentProcedure:\n\t\t\tsearchServiceSearchModuleContentHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedSearchServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedSearchServiceHandler struct{}\n\nfunc (UnimplementedSearchServiceHandler) Search(context.Context, *connect.Request[v1alpha1.SearchRequest]) (*connect.Response[v1alpha1.SearchResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SearchService.Search is not implemented\"))\n}\n\nfunc (UnimplementedSearchServiceHandler) SearchTag(context.Context, *connect.Request[v1alpha1.SearchTagRequest]) (*connect.Response[v1alpha1.SearchTagResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SearchService.SearchTag is not implemented\"))\n}\n\nfunc (UnimplementedSearchServiceHandler) SearchDraft(context.Context, *connect.Request[v1alpha1.SearchDraftRequest]) (*connect.Response[v1alpha1.SearchDraftResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SearchService.SearchDraft is not implemented\"))\n}\n\nfunc (UnimplementedSearchServiceHandler) SearchModuleContent(context.Context, *connect.Request[v1alpha1.SearchModuleContentRequest]) (*connect.Response[v1alpha1.SearchModuleContentResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.SearchService.SearchModuleContent is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/studio.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/studio.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// StudioServiceName is the fully-qualified name of the StudioService service.\n\tStudioServiceName = \"buf.alpha.registry.v1alpha1.StudioService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// StudioServiceListStudioAgentPresetsProcedure is the fully-qualified name of the StudioService's\n\t// ListStudioAgentPresets RPC.\n\tStudioServiceListStudioAgentPresetsProcedure = \"/buf.alpha.registry.v1alpha1.StudioService/ListStudioAgentPresets\"\n\t// StudioServiceSetStudioAgentPresetsProcedure is the fully-qualified name of the StudioService's\n\t// SetStudioAgentPresets RPC.\n\tStudioServiceSetStudioAgentPresetsProcedure = \"/buf.alpha.registry.v1alpha1.StudioService/SetStudioAgentPresets\"\n)\n\n// StudioServiceClient is a client for the buf.alpha.registry.v1alpha1.StudioService service.\ntype StudioServiceClient interface {\n\t// ListStudioAgentPresets returns a list of agent presets in the server.\n\tListStudioAgentPresets(context.Context, *connect.Request[v1alpha1.ListStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.ListStudioAgentPresetsResponse], error)\n\t// SetStudioAgentPresets sets the list of agent presets in the server.\n\tSetStudioAgentPresets(context.Context, *connect.Request[v1alpha1.SetStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.SetStudioAgentPresetsResponse], error)\n}\n\n// NewStudioServiceClient constructs a client for the buf.alpha.registry.v1alpha1.StudioService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewStudioServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) StudioServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tstudioServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_studio_proto.Services().ByName(\"StudioService\").Methods()\n\treturn &studioServiceClient{\n\t\tlistStudioAgentPresets: connect.NewClient[v1alpha1.ListStudioAgentPresetsRequest, v1alpha1.ListStudioAgentPresetsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+StudioServiceListStudioAgentPresetsProcedure,\n\t\t\tconnect.WithSchema(studioServiceMethods.ByName(\"ListStudioAgentPresets\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tsetStudioAgentPresets: connect.NewClient[v1alpha1.SetStudioAgentPresetsRequest, v1alpha1.SetStudioAgentPresetsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+StudioServiceSetStudioAgentPresetsProcedure,\n\t\t\tconnect.WithSchema(studioServiceMethods.ByName(\"SetStudioAgentPresets\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// studioServiceClient implements StudioServiceClient.\ntype studioServiceClient struct {\n\tlistStudioAgentPresets *connect.Client[v1alpha1.ListStudioAgentPresetsRequest, v1alpha1.ListStudioAgentPresetsResponse]\n\tsetStudioAgentPresets  *connect.Client[v1alpha1.SetStudioAgentPresetsRequest, v1alpha1.SetStudioAgentPresetsResponse]\n}\n\n// ListStudioAgentPresets calls buf.alpha.registry.v1alpha1.StudioService.ListStudioAgentPresets.\nfunc (c *studioServiceClient) ListStudioAgentPresets(ctx context.Context, req *connect.Request[v1alpha1.ListStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.ListStudioAgentPresetsResponse], error) {\n\treturn c.listStudioAgentPresets.CallUnary(ctx, req)\n}\n\n// SetStudioAgentPresets calls buf.alpha.registry.v1alpha1.StudioService.SetStudioAgentPresets.\nfunc (c *studioServiceClient) SetStudioAgentPresets(ctx context.Context, req *connect.Request[v1alpha1.SetStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.SetStudioAgentPresetsResponse], error) {\n\treturn c.setStudioAgentPresets.CallUnary(ctx, req)\n}\n\n// StudioServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.StudioService\n// service.\ntype StudioServiceHandler interface {\n\t// ListStudioAgentPresets returns a list of agent presets in the server.\n\tListStudioAgentPresets(context.Context, *connect.Request[v1alpha1.ListStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.ListStudioAgentPresetsResponse], error)\n\t// SetStudioAgentPresets sets the list of agent presets in the server.\n\tSetStudioAgentPresets(context.Context, *connect.Request[v1alpha1.SetStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.SetStudioAgentPresetsResponse], error)\n}\n\n// NewStudioServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewStudioServiceHandler(svc StudioServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tstudioServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_studio_proto.Services().ByName(\"StudioService\").Methods()\n\tstudioServiceListStudioAgentPresetsHandler := connect.NewUnaryHandler(\n\t\tStudioServiceListStudioAgentPresetsProcedure,\n\t\tsvc.ListStudioAgentPresets,\n\t\tconnect.WithSchema(studioServiceMethods.ByName(\"ListStudioAgentPresets\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tstudioServiceSetStudioAgentPresetsHandler := connect.NewUnaryHandler(\n\t\tStudioServiceSetStudioAgentPresetsProcedure,\n\t\tsvc.SetStudioAgentPresets,\n\t\tconnect.WithSchema(studioServiceMethods.ByName(\"SetStudioAgentPresets\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.StudioService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase StudioServiceListStudioAgentPresetsProcedure:\n\t\t\tstudioServiceListStudioAgentPresetsHandler.ServeHTTP(w, r)\n\t\tcase StudioServiceSetStudioAgentPresetsProcedure:\n\t\t\tstudioServiceSetStudioAgentPresetsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedStudioServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedStudioServiceHandler struct{}\n\nfunc (UnimplementedStudioServiceHandler) ListStudioAgentPresets(context.Context, *connect.Request[v1alpha1.ListStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.ListStudioAgentPresetsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.StudioService.ListStudioAgentPresets is not implemented\"))\n}\n\nfunc (UnimplementedStudioServiceHandler) SetStudioAgentPresets(context.Context, *connect.Request[v1alpha1.SetStudioAgentPresetsRequest]) (*connect.Response[v1alpha1.SetStudioAgentPresetsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.StudioService.SetStudioAgentPresets is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/studio_request.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/studio_request.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// StudioRequestServiceName is the fully-qualified name of the StudioRequestService service.\n\tStudioRequestServiceName = \"buf.alpha.registry.v1alpha1.StudioRequestService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// StudioRequestServiceCreateStudioRequestProcedure is the fully-qualified name of the\n\t// StudioRequestService's CreateStudioRequest RPC.\n\tStudioRequestServiceCreateStudioRequestProcedure = \"/buf.alpha.registry.v1alpha1.StudioRequestService/CreateStudioRequest\"\n\t// StudioRequestServiceRenameStudioRequestProcedure is the fully-qualified name of the\n\t// StudioRequestService's RenameStudioRequest RPC.\n\tStudioRequestServiceRenameStudioRequestProcedure = \"/buf.alpha.registry.v1alpha1.StudioRequestService/RenameStudioRequest\"\n\t// StudioRequestServiceDeleteStudioRequestProcedure is the fully-qualified name of the\n\t// StudioRequestService's DeleteStudioRequest RPC.\n\tStudioRequestServiceDeleteStudioRequestProcedure = \"/buf.alpha.registry.v1alpha1.StudioRequestService/DeleteStudioRequest\"\n\t// StudioRequestServiceListStudioRequestsProcedure is the fully-qualified name of the\n\t// StudioRequestService's ListStudioRequests RPC.\n\tStudioRequestServiceListStudioRequestsProcedure = \"/buf.alpha.registry.v1alpha1.StudioRequestService/ListStudioRequests\"\n)\n\n// StudioRequestServiceClient is a client for the buf.alpha.registry.v1alpha1.StudioRequestService\n// service.\ntype StudioRequestServiceClient interface {\n\t// CreateStudioRequest registers a favorite Studio Requests to the caller's\n\t// BSR profile.\n\tCreateStudioRequest(context.Context, *connect.Request[v1alpha1.CreateStudioRequestRequest]) (*connect.Response[v1alpha1.CreateStudioRequestResponse], error)\n\t// RenameStudioRequest renames an existing Studio Request.\n\tRenameStudioRequest(context.Context, *connect.Request[v1alpha1.RenameStudioRequestRequest]) (*connect.Response[v1alpha1.RenameStudioRequestResponse], error)\n\t// DeleteStudioRequest removes a favorite Studio Request from the caller's BSR\n\t// profile.\n\tDeleteStudioRequest(context.Context, *connect.Request[v1alpha1.DeleteStudioRequestRequest]) (*connect.Response[v1alpha1.DeleteStudioRequestResponse], error)\n\t// ListStudioRequests shows the caller's favorited Studio Requests.\n\tListStudioRequests(context.Context, *connect.Request[v1alpha1.ListStudioRequestsRequest]) (*connect.Response[v1alpha1.ListStudioRequestsResponse], error)\n}\n\n// NewStudioRequestServiceClient constructs a client for the\n// buf.alpha.registry.v1alpha1.StudioRequestService service. By default, it uses the Connect\n// protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed\n// requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or\n// connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewStudioRequestServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) StudioRequestServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tstudioRequestServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_studio_request_proto.Services().ByName(\"StudioRequestService\").Methods()\n\treturn &studioRequestServiceClient{\n\t\tcreateStudioRequest: connect.NewClient[v1alpha1.CreateStudioRequestRequest, v1alpha1.CreateStudioRequestResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+StudioRequestServiceCreateStudioRequestProcedure,\n\t\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"CreateStudioRequest\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\trenameStudioRequest: connect.NewClient[v1alpha1.RenameStudioRequestRequest, v1alpha1.RenameStudioRequestResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+StudioRequestServiceRenameStudioRequestProcedure,\n\t\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"RenameStudioRequest\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteStudioRequest: connect.NewClient[v1alpha1.DeleteStudioRequestRequest, v1alpha1.DeleteStudioRequestResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+StudioRequestServiceDeleteStudioRequestProcedure,\n\t\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"DeleteStudioRequest\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistStudioRequests: connect.NewClient[v1alpha1.ListStudioRequestsRequest, v1alpha1.ListStudioRequestsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+StudioRequestServiceListStudioRequestsProcedure,\n\t\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"ListStudioRequests\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// studioRequestServiceClient implements StudioRequestServiceClient.\ntype studioRequestServiceClient struct {\n\tcreateStudioRequest *connect.Client[v1alpha1.CreateStudioRequestRequest, v1alpha1.CreateStudioRequestResponse]\n\trenameStudioRequest *connect.Client[v1alpha1.RenameStudioRequestRequest, v1alpha1.RenameStudioRequestResponse]\n\tdeleteStudioRequest *connect.Client[v1alpha1.DeleteStudioRequestRequest, v1alpha1.DeleteStudioRequestResponse]\n\tlistStudioRequests  *connect.Client[v1alpha1.ListStudioRequestsRequest, v1alpha1.ListStudioRequestsResponse]\n}\n\n// CreateStudioRequest calls buf.alpha.registry.v1alpha1.StudioRequestService.CreateStudioRequest.\nfunc (c *studioRequestServiceClient) CreateStudioRequest(ctx context.Context, req *connect.Request[v1alpha1.CreateStudioRequestRequest]) (*connect.Response[v1alpha1.CreateStudioRequestResponse], error) {\n\treturn c.createStudioRequest.CallUnary(ctx, req)\n}\n\n// RenameStudioRequest calls buf.alpha.registry.v1alpha1.StudioRequestService.RenameStudioRequest.\nfunc (c *studioRequestServiceClient) RenameStudioRequest(ctx context.Context, req *connect.Request[v1alpha1.RenameStudioRequestRequest]) (*connect.Response[v1alpha1.RenameStudioRequestResponse], error) {\n\treturn c.renameStudioRequest.CallUnary(ctx, req)\n}\n\n// DeleteStudioRequest calls buf.alpha.registry.v1alpha1.StudioRequestService.DeleteStudioRequest.\nfunc (c *studioRequestServiceClient) DeleteStudioRequest(ctx context.Context, req *connect.Request[v1alpha1.DeleteStudioRequestRequest]) (*connect.Response[v1alpha1.DeleteStudioRequestResponse], error) {\n\treturn c.deleteStudioRequest.CallUnary(ctx, req)\n}\n\n// ListStudioRequests calls buf.alpha.registry.v1alpha1.StudioRequestService.ListStudioRequests.\nfunc (c *studioRequestServiceClient) ListStudioRequests(ctx context.Context, req *connect.Request[v1alpha1.ListStudioRequestsRequest]) (*connect.Response[v1alpha1.ListStudioRequestsResponse], error) {\n\treturn c.listStudioRequests.CallUnary(ctx, req)\n}\n\n// StudioRequestServiceHandler is an implementation of the\n// buf.alpha.registry.v1alpha1.StudioRequestService service.\ntype StudioRequestServiceHandler interface {\n\t// CreateStudioRequest registers a favorite Studio Requests to the caller's\n\t// BSR profile.\n\tCreateStudioRequest(context.Context, *connect.Request[v1alpha1.CreateStudioRequestRequest]) (*connect.Response[v1alpha1.CreateStudioRequestResponse], error)\n\t// RenameStudioRequest renames an existing Studio Request.\n\tRenameStudioRequest(context.Context, *connect.Request[v1alpha1.RenameStudioRequestRequest]) (*connect.Response[v1alpha1.RenameStudioRequestResponse], error)\n\t// DeleteStudioRequest removes a favorite Studio Request from the caller's BSR\n\t// profile.\n\tDeleteStudioRequest(context.Context, *connect.Request[v1alpha1.DeleteStudioRequestRequest]) (*connect.Response[v1alpha1.DeleteStudioRequestResponse], error)\n\t// ListStudioRequests shows the caller's favorited Studio Requests.\n\tListStudioRequests(context.Context, *connect.Request[v1alpha1.ListStudioRequestsRequest]) (*connect.Response[v1alpha1.ListStudioRequestsResponse], error)\n}\n\n// NewStudioRequestServiceHandler builds an HTTP handler from the service implementation. It returns\n// the path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewStudioRequestServiceHandler(svc StudioRequestServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tstudioRequestServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_studio_request_proto.Services().ByName(\"StudioRequestService\").Methods()\n\tstudioRequestServiceCreateStudioRequestHandler := connect.NewUnaryHandler(\n\t\tStudioRequestServiceCreateStudioRequestProcedure,\n\t\tsvc.CreateStudioRequest,\n\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"CreateStudioRequest\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tstudioRequestServiceRenameStudioRequestHandler := connect.NewUnaryHandler(\n\t\tStudioRequestServiceRenameStudioRequestProcedure,\n\t\tsvc.RenameStudioRequest,\n\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"RenameStudioRequest\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tstudioRequestServiceDeleteStudioRequestHandler := connect.NewUnaryHandler(\n\t\tStudioRequestServiceDeleteStudioRequestProcedure,\n\t\tsvc.DeleteStudioRequest,\n\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"DeleteStudioRequest\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tstudioRequestServiceListStudioRequestsHandler := connect.NewUnaryHandler(\n\t\tStudioRequestServiceListStudioRequestsProcedure,\n\t\tsvc.ListStudioRequests,\n\t\tconnect.WithSchema(studioRequestServiceMethods.ByName(\"ListStudioRequests\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.StudioRequestService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase StudioRequestServiceCreateStudioRequestProcedure:\n\t\t\tstudioRequestServiceCreateStudioRequestHandler.ServeHTTP(w, r)\n\t\tcase StudioRequestServiceRenameStudioRequestProcedure:\n\t\t\tstudioRequestServiceRenameStudioRequestHandler.ServeHTTP(w, r)\n\t\tcase StudioRequestServiceDeleteStudioRequestProcedure:\n\t\t\tstudioRequestServiceDeleteStudioRequestHandler.ServeHTTP(w, r)\n\t\tcase StudioRequestServiceListStudioRequestsProcedure:\n\t\t\tstudioRequestServiceListStudioRequestsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedStudioRequestServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedStudioRequestServiceHandler struct{}\n\nfunc (UnimplementedStudioRequestServiceHandler) CreateStudioRequest(context.Context, *connect.Request[v1alpha1.CreateStudioRequestRequest]) (*connect.Response[v1alpha1.CreateStudioRequestResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.StudioRequestService.CreateStudioRequest is not implemented\"))\n}\n\nfunc (UnimplementedStudioRequestServiceHandler) RenameStudioRequest(context.Context, *connect.Request[v1alpha1.RenameStudioRequestRequest]) (*connect.Response[v1alpha1.RenameStudioRequestResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.StudioRequestService.RenameStudioRequest is not implemented\"))\n}\n\nfunc (UnimplementedStudioRequestServiceHandler) DeleteStudioRequest(context.Context, *connect.Request[v1alpha1.DeleteStudioRequestRequest]) (*connect.Response[v1alpha1.DeleteStudioRequestResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.StudioRequestService.DeleteStudioRequest is not implemented\"))\n}\n\nfunc (UnimplementedStudioRequestServiceHandler) ListStudioRequests(context.Context, *connect.Request[v1alpha1.ListStudioRequestsRequest]) (*connect.Response[v1alpha1.ListStudioRequestsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.StudioRequestService.ListStudioRequests is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/token.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/token.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// TokenServiceName is the fully-qualified name of the TokenService service.\n\tTokenServiceName = \"buf.alpha.registry.v1alpha1.TokenService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// TokenServiceCreateTokenProcedure is the fully-qualified name of the TokenService's CreateToken\n\t// RPC.\n\tTokenServiceCreateTokenProcedure = \"/buf.alpha.registry.v1alpha1.TokenService/CreateToken\"\n\t// TokenServiceGetTokenProcedure is the fully-qualified name of the TokenService's GetToken RPC.\n\tTokenServiceGetTokenProcedure = \"/buf.alpha.registry.v1alpha1.TokenService/GetToken\"\n\t// TokenServiceListTokensProcedure is the fully-qualified name of the TokenService's ListTokens RPC.\n\tTokenServiceListTokensProcedure = \"/buf.alpha.registry.v1alpha1.TokenService/ListTokens\"\n\t// TokenServiceDeleteTokenProcedure is the fully-qualified name of the TokenService's DeleteToken\n\t// RPC.\n\tTokenServiceDeleteTokenProcedure = \"/buf.alpha.registry.v1alpha1.TokenService/DeleteToken\"\n)\n\n// TokenServiceClient is a client for the buf.alpha.registry.v1alpha1.TokenService service.\ntype TokenServiceClient interface {\n\t// CreateToken creates a new token suitable for machine-to-machine authentication.\n\tCreateToken(context.Context, *connect.Request[v1alpha1.CreateTokenRequest]) (*connect.Response[v1alpha1.CreateTokenResponse], error)\n\t// GetToken gets the specific token for the user\n\t//\n\t// This method requires authentication.\n\tGetToken(context.Context, *connect.Request[v1alpha1.GetTokenRequest]) (*connect.Response[v1alpha1.GetTokenResponse], error)\n\t// ListTokens lists the users active tokens\n\t//\n\t// This method requires authentication.\n\tListTokens(context.Context, *connect.Request[v1alpha1.ListTokensRequest]) (*connect.Response[v1alpha1.ListTokensResponse], error)\n\t// DeleteToken deletes an existing token.\n\t//\n\t// This method requires authentication.\n\tDeleteToken(context.Context, *connect.Request[v1alpha1.DeleteTokenRequest]) (*connect.Response[v1alpha1.DeleteTokenResponse], error)\n}\n\n// NewTokenServiceClient constructs a client for the buf.alpha.registry.v1alpha1.TokenService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewTokenServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) TokenServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\ttokenServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_token_proto.Services().ByName(\"TokenService\").Methods()\n\treturn &tokenServiceClient{\n\t\tcreateToken: connect.NewClient[v1alpha1.CreateTokenRequest, v1alpha1.CreateTokenResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+TokenServiceCreateTokenProcedure,\n\t\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"CreateToken\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetToken: connect.NewClient[v1alpha1.GetTokenRequest, v1alpha1.GetTokenResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+TokenServiceGetTokenProcedure,\n\t\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"GetToken\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistTokens: connect.NewClient[v1alpha1.ListTokensRequest, v1alpha1.ListTokensResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+TokenServiceListTokensProcedure,\n\t\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"ListTokens\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteToken: connect.NewClient[v1alpha1.DeleteTokenRequest, v1alpha1.DeleteTokenResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+TokenServiceDeleteTokenProcedure,\n\t\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"DeleteToken\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// tokenServiceClient implements TokenServiceClient.\ntype tokenServiceClient struct {\n\tcreateToken *connect.Client[v1alpha1.CreateTokenRequest, v1alpha1.CreateTokenResponse]\n\tgetToken    *connect.Client[v1alpha1.GetTokenRequest, v1alpha1.GetTokenResponse]\n\tlistTokens  *connect.Client[v1alpha1.ListTokensRequest, v1alpha1.ListTokensResponse]\n\tdeleteToken *connect.Client[v1alpha1.DeleteTokenRequest, v1alpha1.DeleteTokenResponse]\n}\n\n// CreateToken calls buf.alpha.registry.v1alpha1.TokenService.CreateToken.\nfunc (c *tokenServiceClient) CreateToken(ctx context.Context, req *connect.Request[v1alpha1.CreateTokenRequest]) (*connect.Response[v1alpha1.CreateTokenResponse], error) {\n\treturn c.createToken.CallUnary(ctx, req)\n}\n\n// GetToken calls buf.alpha.registry.v1alpha1.TokenService.GetToken.\nfunc (c *tokenServiceClient) GetToken(ctx context.Context, req *connect.Request[v1alpha1.GetTokenRequest]) (*connect.Response[v1alpha1.GetTokenResponse], error) {\n\treturn c.getToken.CallUnary(ctx, req)\n}\n\n// ListTokens calls buf.alpha.registry.v1alpha1.TokenService.ListTokens.\nfunc (c *tokenServiceClient) ListTokens(ctx context.Context, req *connect.Request[v1alpha1.ListTokensRequest]) (*connect.Response[v1alpha1.ListTokensResponse], error) {\n\treturn c.listTokens.CallUnary(ctx, req)\n}\n\n// DeleteToken calls buf.alpha.registry.v1alpha1.TokenService.DeleteToken.\nfunc (c *tokenServiceClient) DeleteToken(ctx context.Context, req *connect.Request[v1alpha1.DeleteTokenRequest]) (*connect.Response[v1alpha1.DeleteTokenResponse], error) {\n\treturn c.deleteToken.CallUnary(ctx, req)\n}\n\n// TokenServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.TokenService service.\ntype TokenServiceHandler interface {\n\t// CreateToken creates a new token suitable for machine-to-machine authentication.\n\tCreateToken(context.Context, *connect.Request[v1alpha1.CreateTokenRequest]) (*connect.Response[v1alpha1.CreateTokenResponse], error)\n\t// GetToken gets the specific token for the user\n\t//\n\t// This method requires authentication.\n\tGetToken(context.Context, *connect.Request[v1alpha1.GetTokenRequest]) (*connect.Response[v1alpha1.GetTokenResponse], error)\n\t// ListTokens lists the users active tokens\n\t//\n\t// This method requires authentication.\n\tListTokens(context.Context, *connect.Request[v1alpha1.ListTokensRequest]) (*connect.Response[v1alpha1.ListTokensResponse], error)\n\t// DeleteToken deletes an existing token.\n\t//\n\t// This method requires authentication.\n\tDeleteToken(context.Context, *connect.Request[v1alpha1.DeleteTokenRequest]) (*connect.Response[v1alpha1.DeleteTokenResponse], error)\n}\n\n// NewTokenServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewTokenServiceHandler(svc TokenServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\ttokenServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_token_proto.Services().ByName(\"TokenService\").Methods()\n\ttokenServiceCreateTokenHandler := connect.NewUnaryHandler(\n\t\tTokenServiceCreateTokenProcedure,\n\t\tsvc.CreateToken,\n\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"CreateToken\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\ttokenServiceGetTokenHandler := connect.NewUnaryHandler(\n\t\tTokenServiceGetTokenProcedure,\n\t\tsvc.GetToken,\n\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"GetToken\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\ttokenServiceListTokensHandler := connect.NewUnaryHandler(\n\t\tTokenServiceListTokensProcedure,\n\t\tsvc.ListTokens,\n\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"ListTokens\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\ttokenServiceDeleteTokenHandler := connect.NewUnaryHandler(\n\t\tTokenServiceDeleteTokenProcedure,\n\t\tsvc.DeleteToken,\n\t\tconnect.WithSchema(tokenServiceMethods.ByName(\"DeleteToken\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.TokenService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase TokenServiceCreateTokenProcedure:\n\t\t\ttokenServiceCreateTokenHandler.ServeHTTP(w, r)\n\t\tcase TokenServiceGetTokenProcedure:\n\t\t\ttokenServiceGetTokenHandler.ServeHTTP(w, r)\n\t\tcase TokenServiceListTokensProcedure:\n\t\t\ttokenServiceListTokensHandler.ServeHTTP(w, r)\n\t\tcase TokenServiceDeleteTokenProcedure:\n\t\t\ttokenServiceDeleteTokenHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedTokenServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedTokenServiceHandler struct{}\n\nfunc (UnimplementedTokenServiceHandler) CreateToken(context.Context, *connect.Request[v1alpha1.CreateTokenRequest]) (*connect.Response[v1alpha1.CreateTokenResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.TokenService.CreateToken is not implemented\"))\n}\n\nfunc (UnimplementedTokenServiceHandler) GetToken(context.Context, *connect.Request[v1alpha1.GetTokenRequest]) (*connect.Response[v1alpha1.GetTokenResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.TokenService.GetToken is not implemented\"))\n}\n\nfunc (UnimplementedTokenServiceHandler) ListTokens(context.Context, *connect.Request[v1alpha1.ListTokensRequest]) (*connect.Response[v1alpha1.ListTokensResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.TokenService.ListTokens is not implemented\"))\n}\n\nfunc (UnimplementedTokenServiceHandler) DeleteToken(context.Context, *connect.Request[v1alpha1.DeleteTokenRequest]) (*connect.Response[v1alpha1.DeleteTokenResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.TokenService.DeleteToken is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage registryv1alpha1connect\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/user.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/user.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// UserServiceName is the fully-qualified name of the UserService service.\n\tUserServiceName = \"buf.alpha.registry.v1alpha1.UserService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// UserServiceCreateUserProcedure is the fully-qualified name of the UserService's CreateUser RPC.\n\tUserServiceCreateUserProcedure = \"/buf.alpha.registry.v1alpha1.UserService/CreateUser\"\n\t// UserServiceGetUserProcedure is the fully-qualified name of the UserService's GetUser RPC.\n\tUserServiceGetUserProcedure = \"/buf.alpha.registry.v1alpha1.UserService/GetUser\"\n\t// UserServiceGetUserByUsernameProcedure is the fully-qualified name of the UserService's\n\t// GetUserByUsername RPC.\n\tUserServiceGetUserByUsernameProcedure = \"/buf.alpha.registry.v1alpha1.UserService/GetUserByUsername\"\n\t// UserServiceListUsersProcedure is the fully-qualified name of the UserService's ListUsers RPC.\n\tUserServiceListUsersProcedure = \"/buf.alpha.registry.v1alpha1.UserService/ListUsers\"\n\t// UserServiceListOrganizationUsersProcedure is the fully-qualified name of the UserService's\n\t// ListOrganizationUsers RPC.\n\tUserServiceListOrganizationUsersProcedure = \"/buf.alpha.registry.v1alpha1.UserService/ListOrganizationUsers\"\n\t// UserServiceDeleteUserProcedure is the fully-qualified name of the UserService's DeleteUser RPC.\n\tUserServiceDeleteUserProcedure = \"/buf.alpha.registry.v1alpha1.UserService/DeleteUser\"\n\t// UserServiceDeactivateUserProcedure is the fully-qualified name of the UserService's\n\t// DeactivateUser RPC.\n\tUserServiceDeactivateUserProcedure = \"/buf.alpha.registry.v1alpha1.UserService/DeactivateUser\"\n\t// UserServiceUpdateUserServerRoleProcedure is the fully-qualified name of the UserService's\n\t// UpdateUserServerRole RPC.\n\tUserServiceUpdateUserServerRoleProcedure = \"/buf.alpha.registry.v1alpha1.UserService/UpdateUserServerRole\"\n\t// UserServiceCountUsersProcedure is the fully-qualified name of the UserService's CountUsers RPC.\n\tUserServiceCountUsersProcedure = \"/buf.alpha.registry.v1alpha1.UserService/CountUsers\"\n\t// UserServiceUpdateUserSettingsProcedure is the fully-qualified name of the UserService's\n\t// UpdateUserSettings RPC.\n\tUserServiceUpdateUserSettingsProcedure = \"/buf.alpha.registry.v1alpha1.UserService/UpdateUserSettings\"\n)\n\n// UserServiceClient is a client for the buf.alpha.registry.v1alpha1.UserService service.\ntype UserServiceClient interface {\n\t// CreateUser creates a new user with the given username.\n\tCreateUser(context.Context, *connect.Request[v1alpha1.CreateUserRequest]) (*connect.Response[v1alpha1.CreateUserResponse], error)\n\t// GetUser gets a user by ID.\n\tGetUser(context.Context, *connect.Request[v1alpha1.GetUserRequest]) (*connect.Response[v1alpha1.GetUserResponse], error)\n\t// GetUserByUsername gets a user by username.\n\tGetUserByUsername(context.Context, *connect.Request[v1alpha1.GetUserByUsernameRequest]) (*connect.Response[v1alpha1.GetUserByUsernameResponse], error)\n\t// ListUsers lists all users.\n\tListUsers(context.Context, *connect.Request[v1alpha1.ListUsersRequest]) (*connect.Response[v1alpha1.ListUsersResponse], error)\n\t// ListOrganizationUsers lists all users for an organization.\n\t// TODO: #663 move this to organization service\n\tListOrganizationUsers(context.Context, *connect.Request[v1alpha1.ListOrganizationUsersRequest]) (*connect.Response[v1alpha1.ListOrganizationUsersResponse], error)\n\t// DeleteUser deletes a user.\n\tDeleteUser(context.Context, *connect.Request[v1alpha1.DeleteUserRequest]) (*connect.Response[v1alpha1.DeleteUserResponse], error)\n\t// Deactivate user deactivates a user.\n\tDeactivateUser(context.Context, *connect.Request[v1alpha1.DeactivateUserRequest]) (*connect.Response[v1alpha1.DeactivateUserResponse], error)\n\t// UpdateUserServerRole update the role of an user in the server.\n\tUpdateUserServerRole(context.Context, *connect.Request[v1alpha1.UpdateUserServerRoleRequest]) (*connect.Response[v1alpha1.UpdateUserServerRoleResponse], error)\n\t// CountUsers returns the number of users in the server by the user state provided.\n\tCountUsers(context.Context, *connect.Request[v1alpha1.CountUsersRequest]) (*connect.Response[v1alpha1.CountUsersResponse], error)\n\t// UpdateUserSettings update the user settings including description.\n\tUpdateUserSettings(context.Context, *connect.Request[v1alpha1.UpdateUserSettingsRequest]) (*connect.Response[v1alpha1.UpdateUserSettingsResponse], error)\n}\n\n// NewUserServiceClient constructs a client for the buf.alpha.registry.v1alpha1.UserService service.\n// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped\n// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the\n// connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewUserServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) UserServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\tuserServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_user_proto.Services().ByName(\"UserService\").Methods()\n\treturn &userServiceClient{\n\t\tcreateUser: connect.NewClient[v1alpha1.CreateUserRequest, v1alpha1.CreateUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceCreateUserProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"CreateUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetUser: connect.NewClient[v1alpha1.GetUserRequest, v1alpha1.GetUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceGetUserProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"GetUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tgetUserByUsername: connect.NewClient[v1alpha1.GetUserByUsernameRequest, v1alpha1.GetUserByUsernameResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceGetUserByUsernameProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"GetUserByUsername\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistUsers: connect.NewClient[v1alpha1.ListUsersRequest, v1alpha1.ListUsersResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceListUsersProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"ListUsers\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistOrganizationUsers: connect.NewClient[v1alpha1.ListOrganizationUsersRequest, v1alpha1.ListOrganizationUsersResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceListOrganizationUsersProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"ListOrganizationUsers\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteUser: connect.NewClient[v1alpha1.DeleteUserRequest, v1alpha1.DeleteUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceDeleteUserProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"DeleteUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeactivateUser: connect.NewClient[v1alpha1.DeactivateUserRequest, v1alpha1.DeactivateUserResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceDeactivateUserProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"DeactivateUser\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateUserServerRole: connect.NewClient[v1alpha1.UpdateUserServerRoleRequest, v1alpha1.UpdateUserServerRoleResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceUpdateUserServerRoleProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"UpdateUserServerRole\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tcountUsers: connect.NewClient[v1alpha1.CountUsersRequest, v1alpha1.CountUsersResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceCountUsersProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"CountUsers\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tupdateUserSettings: connect.NewClient[v1alpha1.UpdateUserSettingsRequest, v1alpha1.UpdateUserSettingsResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+UserServiceUpdateUserSettingsProcedure,\n\t\t\tconnect.WithSchema(userServiceMethods.ByName(\"UpdateUserSettings\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// userServiceClient implements UserServiceClient.\ntype userServiceClient struct {\n\tcreateUser            *connect.Client[v1alpha1.CreateUserRequest, v1alpha1.CreateUserResponse]\n\tgetUser               *connect.Client[v1alpha1.GetUserRequest, v1alpha1.GetUserResponse]\n\tgetUserByUsername     *connect.Client[v1alpha1.GetUserByUsernameRequest, v1alpha1.GetUserByUsernameResponse]\n\tlistUsers             *connect.Client[v1alpha1.ListUsersRequest, v1alpha1.ListUsersResponse]\n\tlistOrganizationUsers *connect.Client[v1alpha1.ListOrganizationUsersRequest, v1alpha1.ListOrganizationUsersResponse]\n\tdeleteUser            *connect.Client[v1alpha1.DeleteUserRequest, v1alpha1.DeleteUserResponse]\n\tdeactivateUser        *connect.Client[v1alpha1.DeactivateUserRequest, v1alpha1.DeactivateUserResponse]\n\tupdateUserServerRole  *connect.Client[v1alpha1.UpdateUserServerRoleRequest, v1alpha1.UpdateUserServerRoleResponse]\n\tcountUsers            *connect.Client[v1alpha1.CountUsersRequest, v1alpha1.CountUsersResponse]\n\tupdateUserSettings    *connect.Client[v1alpha1.UpdateUserSettingsRequest, v1alpha1.UpdateUserSettingsResponse]\n}\n\n// CreateUser calls buf.alpha.registry.v1alpha1.UserService.CreateUser.\nfunc (c *userServiceClient) CreateUser(ctx context.Context, req *connect.Request[v1alpha1.CreateUserRequest]) (*connect.Response[v1alpha1.CreateUserResponse], error) {\n\treturn c.createUser.CallUnary(ctx, req)\n}\n\n// GetUser calls buf.alpha.registry.v1alpha1.UserService.GetUser.\nfunc (c *userServiceClient) GetUser(ctx context.Context, req *connect.Request[v1alpha1.GetUserRequest]) (*connect.Response[v1alpha1.GetUserResponse], error) {\n\treturn c.getUser.CallUnary(ctx, req)\n}\n\n// GetUserByUsername calls buf.alpha.registry.v1alpha1.UserService.GetUserByUsername.\nfunc (c *userServiceClient) GetUserByUsername(ctx context.Context, req *connect.Request[v1alpha1.GetUserByUsernameRequest]) (*connect.Response[v1alpha1.GetUserByUsernameResponse], error) {\n\treturn c.getUserByUsername.CallUnary(ctx, req)\n}\n\n// ListUsers calls buf.alpha.registry.v1alpha1.UserService.ListUsers.\nfunc (c *userServiceClient) ListUsers(ctx context.Context, req *connect.Request[v1alpha1.ListUsersRequest]) (*connect.Response[v1alpha1.ListUsersResponse], error) {\n\treturn c.listUsers.CallUnary(ctx, req)\n}\n\n// ListOrganizationUsers calls buf.alpha.registry.v1alpha1.UserService.ListOrganizationUsers.\nfunc (c *userServiceClient) ListOrganizationUsers(ctx context.Context, req *connect.Request[v1alpha1.ListOrganizationUsersRequest]) (*connect.Response[v1alpha1.ListOrganizationUsersResponse], error) {\n\treturn c.listOrganizationUsers.CallUnary(ctx, req)\n}\n\n// DeleteUser calls buf.alpha.registry.v1alpha1.UserService.DeleteUser.\nfunc (c *userServiceClient) DeleteUser(ctx context.Context, req *connect.Request[v1alpha1.DeleteUserRequest]) (*connect.Response[v1alpha1.DeleteUserResponse], error) {\n\treturn c.deleteUser.CallUnary(ctx, req)\n}\n\n// DeactivateUser calls buf.alpha.registry.v1alpha1.UserService.DeactivateUser.\nfunc (c *userServiceClient) DeactivateUser(ctx context.Context, req *connect.Request[v1alpha1.DeactivateUserRequest]) (*connect.Response[v1alpha1.DeactivateUserResponse], error) {\n\treturn c.deactivateUser.CallUnary(ctx, req)\n}\n\n// UpdateUserServerRole calls buf.alpha.registry.v1alpha1.UserService.UpdateUserServerRole.\nfunc (c *userServiceClient) UpdateUserServerRole(ctx context.Context, req *connect.Request[v1alpha1.UpdateUserServerRoleRequest]) (*connect.Response[v1alpha1.UpdateUserServerRoleResponse], error) {\n\treturn c.updateUserServerRole.CallUnary(ctx, req)\n}\n\n// CountUsers calls buf.alpha.registry.v1alpha1.UserService.CountUsers.\nfunc (c *userServiceClient) CountUsers(ctx context.Context, req *connect.Request[v1alpha1.CountUsersRequest]) (*connect.Response[v1alpha1.CountUsersResponse], error) {\n\treturn c.countUsers.CallUnary(ctx, req)\n}\n\n// UpdateUserSettings calls buf.alpha.registry.v1alpha1.UserService.UpdateUserSettings.\nfunc (c *userServiceClient) UpdateUserSettings(ctx context.Context, req *connect.Request[v1alpha1.UpdateUserSettingsRequest]) (*connect.Response[v1alpha1.UpdateUserSettingsResponse], error) {\n\treturn c.updateUserSettings.CallUnary(ctx, req)\n}\n\n// UserServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.UserService service.\ntype UserServiceHandler interface {\n\t// CreateUser creates a new user with the given username.\n\tCreateUser(context.Context, *connect.Request[v1alpha1.CreateUserRequest]) (*connect.Response[v1alpha1.CreateUserResponse], error)\n\t// GetUser gets a user by ID.\n\tGetUser(context.Context, *connect.Request[v1alpha1.GetUserRequest]) (*connect.Response[v1alpha1.GetUserResponse], error)\n\t// GetUserByUsername gets a user by username.\n\tGetUserByUsername(context.Context, *connect.Request[v1alpha1.GetUserByUsernameRequest]) (*connect.Response[v1alpha1.GetUserByUsernameResponse], error)\n\t// ListUsers lists all users.\n\tListUsers(context.Context, *connect.Request[v1alpha1.ListUsersRequest]) (*connect.Response[v1alpha1.ListUsersResponse], error)\n\t// ListOrganizationUsers lists all users for an organization.\n\t// TODO: #663 move this to organization service\n\tListOrganizationUsers(context.Context, *connect.Request[v1alpha1.ListOrganizationUsersRequest]) (*connect.Response[v1alpha1.ListOrganizationUsersResponse], error)\n\t// DeleteUser deletes a user.\n\tDeleteUser(context.Context, *connect.Request[v1alpha1.DeleteUserRequest]) (*connect.Response[v1alpha1.DeleteUserResponse], error)\n\t// Deactivate user deactivates a user.\n\tDeactivateUser(context.Context, *connect.Request[v1alpha1.DeactivateUserRequest]) (*connect.Response[v1alpha1.DeactivateUserResponse], error)\n\t// UpdateUserServerRole update the role of an user in the server.\n\tUpdateUserServerRole(context.Context, *connect.Request[v1alpha1.UpdateUserServerRoleRequest]) (*connect.Response[v1alpha1.UpdateUserServerRoleResponse], error)\n\t// CountUsers returns the number of users in the server by the user state provided.\n\tCountUsers(context.Context, *connect.Request[v1alpha1.CountUsersRequest]) (*connect.Response[v1alpha1.CountUsersResponse], error)\n\t// UpdateUserSettings update the user settings including description.\n\tUpdateUserSettings(context.Context, *connect.Request[v1alpha1.UpdateUserSettingsRequest]) (*connect.Response[v1alpha1.UpdateUserSettingsResponse], error)\n}\n\n// NewUserServiceHandler builds an HTTP handler from the service implementation. It returns the path\n// on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\tuserServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_user_proto.Services().ByName(\"UserService\").Methods()\n\tuserServiceCreateUserHandler := connect.NewUnaryHandler(\n\t\tUserServiceCreateUserProcedure,\n\t\tsvc.CreateUser,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"CreateUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceGetUserHandler := connect.NewUnaryHandler(\n\t\tUserServiceGetUserProcedure,\n\t\tsvc.GetUser,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"GetUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceGetUserByUsernameHandler := connect.NewUnaryHandler(\n\t\tUserServiceGetUserByUsernameProcedure,\n\t\tsvc.GetUserByUsername,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"GetUserByUsername\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceListUsersHandler := connect.NewUnaryHandler(\n\t\tUserServiceListUsersProcedure,\n\t\tsvc.ListUsers,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"ListUsers\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceListOrganizationUsersHandler := connect.NewUnaryHandler(\n\t\tUserServiceListOrganizationUsersProcedure,\n\t\tsvc.ListOrganizationUsers,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"ListOrganizationUsers\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceDeleteUserHandler := connect.NewUnaryHandler(\n\t\tUserServiceDeleteUserProcedure,\n\t\tsvc.DeleteUser,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"DeleteUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceDeactivateUserHandler := connect.NewUnaryHandler(\n\t\tUserServiceDeactivateUserProcedure,\n\t\tsvc.DeactivateUser,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"DeactivateUser\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceUpdateUserServerRoleHandler := connect.NewUnaryHandler(\n\t\tUserServiceUpdateUserServerRoleProcedure,\n\t\tsvc.UpdateUserServerRole,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"UpdateUserServerRole\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceCountUsersHandler := connect.NewUnaryHandler(\n\t\tUserServiceCountUsersProcedure,\n\t\tsvc.CountUsers,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"CountUsers\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\tuserServiceUpdateUserSettingsHandler := connect.NewUnaryHandler(\n\t\tUserServiceUpdateUserSettingsProcedure,\n\t\tsvc.UpdateUserSettings,\n\t\tconnect.WithSchema(userServiceMethods.ByName(\"UpdateUserSettings\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.UserService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase UserServiceCreateUserProcedure:\n\t\t\tuserServiceCreateUserHandler.ServeHTTP(w, r)\n\t\tcase UserServiceGetUserProcedure:\n\t\t\tuserServiceGetUserHandler.ServeHTTP(w, r)\n\t\tcase UserServiceGetUserByUsernameProcedure:\n\t\t\tuserServiceGetUserByUsernameHandler.ServeHTTP(w, r)\n\t\tcase UserServiceListUsersProcedure:\n\t\t\tuserServiceListUsersHandler.ServeHTTP(w, r)\n\t\tcase UserServiceListOrganizationUsersProcedure:\n\t\t\tuserServiceListOrganizationUsersHandler.ServeHTTP(w, r)\n\t\tcase UserServiceDeleteUserProcedure:\n\t\t\tuserServiceDeleteUserHandler.ServeHTTP(w, r)\n\t\tcase UserServiceDeactivateUserProcedure:\n\t\t\tuserServiceDeactivateUserHandler.ServeHTTP(w, r)\n\t\tcase UserServiceUpdateUserServerRoleProcedure:\n\t\t\tuserServiceUpdateUserServerRoleHandler.ServeHTTP(w, r)\n\t\tcase UserServiceCountUsersProcedure:\n\t\t\tuserServiceCountUsersHandler.ServeHTTP(w, r)\n\t\tcase UserServiceUpdateUserSettingsProcedure:\n\t\t\tuserServiceUpdateUserSettingsHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedUserServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedUserServiceHandler struct{}\n\nfunc (UnimplementedUserServiceHandler) CreateUser(context.Context, *connect.Request[v1alpha1.CreateUserRequest]) (*connect.Response[v1alpha1.CreateUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.CreateUser is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) GetUser(context.Context, *connect.Request[v1alpha1.GetUserRequest]) (*connect.Response[v1alpha1.GetUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.GetUser is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) GetUserByUsername(context.Context, *connect.Request[v1alpha1.GetUserByUsernameRequest]) (*connect.Response[v1alpha1.GetUserByUsernameResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.GetUserByUsername is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) ListUsers(context.Context, *connect.Request[v1alpha1.ListUsersRequest]) (*connect.Response[v1alpha1.ListUsersResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.ListUsers is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) ListOrganizationUsers(context.Context, *connect.Request[v1alpha1.ListOrganizationUsersRequest]) (*connect.Response[v1alpha1.ListOrganizationUsersResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.ListOrganizationUsers is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) DeleteUser(context.Context, *connect.Request[v1alpha1.DeleteUserRequest]) (*connect.Response[v1alpha1.DeleteUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.DeleteUser is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) DeactivateUser(context.Context, *connect.Request[v1alpha1.DeactivateUserRequest]) (*connect.Response[v1alpha1.DeactivateUserResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.DeactivateUser is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) UpdateUserServerRole(context.Context, *connect.Request[v1alpha1.UpdateUserServerRoleRequest]) (*connect.Response[v1alpha1.UpdateUserServerRoleResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.UpdateUserServerRole is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) CountUsers(context.Context, *connect.Request[v1alpha1.CountUsersRequest]) (*connect.Response[v1alpha1.CountUsersResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.CountUsers is not implemented\"))\n}\n\nfunc (UnimplementedUserServiceHandler) UpdateUserSettings(context.Context, *connect.Request[v1alpha1.UpdateUserSettingsRequest]) (*connect.Response[v1alpha1.UpdateUserSettingsResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.UserService.UpdateUserSettings is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/webhook.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/registry/v1alpha1/webhook.proto\n\npackage registryv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// WebhookServiceName is the fully-qualified name of the WebhookService service.\n\tWebhookServiceName = \"buf.alpha.registry.v1alpha1.WebhookService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// WebhookServiceCreateWebhookProcedure is the fully-qualified name of the WebhookService's\n\t// CreateWebhook RPC.\n\tWebhookServiceCreateWebhookProcedure = \"/buf.alpha.registry.v1alpha1.WebhookService/CreateWebhook\"\n\t// WebhookServiceDeleteWebhookProcedure is the fully-qualified name of the WebhookService's\n\t// DeleteWebhook RPC.\n\tWebhookServiceDeleteWebhookProcedure = \"/buf.alpha.registry.v1alpha1.WebhookService/DeleteWebhook\"\n\t// WebhookServiceListWebhooksProcedure is the fully-qualified name of the WebhookService's\n\t// ListWebhooks RPC.\n\tWebhookServiceListWebhooksProcedure = \"/buf.alpha.registry.v1alpha1.WebhookService/ListWebhooks\"\n)\n\n// WebhookServiceClient is a client for the buf.alpha.registry.v1alpha1.WebhookService service.\ntype WebhookServiceClient interface {\n\t// Create a webhook, subscribes to a given repository event for a callback URL\n\t// invocation.\n\tCreateWebhook(context.Context, *connect.Request[v1alpha1.CreateWebhookRequest]) (*connect.Response[v1alpha1.CreateWebhookResponse], error)\n\t// Delete a webhook removes the event subscription.\n\tDeleteWebhook(context.Context, *connect.Request[v1alpha1.DeleteWebhookRequest]) (*connect.Response[v1alpha1.DeleteWebhookResponse], error)\n\t// Lists the webhooks subscriptions for a given repository.\n\tListWebhooks(context.Context, *connect.Request[v1alpha1.ListWebhooksRequest]) (*connect.Response[v1alpha1.ListWebhooksResponse], error)\n}\n\n// NewWebhookServiceClient constructs a client for the buf.alpha.registry.v1alpha1.WebhookService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewWebhookServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) WebhookServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\twebhookServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_webhook_proto.Services().ByName(\"WebhookService\").Methods()\n\treturn &webhookServiceClient{\n\t\tcreateWebhook: connect.NewClient[v1alpha1.CreateWebhookRequest, v1alpha1.CreateWebhookResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+WebhookServiceCreateWebhookProcedure,\n\t\t\tconnect.WithSchema(webhookServiceMethods.ByName(\"CreateWebhook\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tdeleteWebhook: connect.NewClient[v1alpha1.DeleteWebhookRequest, v1alpha1.DeleteWebhookResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+WebhookServiceDeleteWebhookProcedure,\n\t\t\tconnect.WithSchema(webhookServiceMethods.ByName(\"DeleteWebhook\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t\tlistWebhooks: connect.NewClient[v1alpha1.ListWebhooksRequest, v1alpha1.ListWebhooksResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+WebhookServiceListWebhooksProcedure,\n\t\t\tconnect.WithSchema(webhookServiceMethods.ByName(\"ListWebhooks\")),\n\t\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// webhookServiceClient implements WebhookServiceClient.\ntype webhookServiceClient struct {\n\tcreateWebhook *connect.Client[v1alpha1.CreateWebhookRequest, v1alpha1.CreateWebhookResponse]\n\tdeleteWebhook *connect.Client[v1alpha1.DeleteWebhookRequest, v1alpha1.DeleteWebhookResponse]\n\tlistWebhooks  *connect.Client[v1alpha1.ListWebhooksRequest, v1alpha1.ListWebhooksResponse]\n}\n\n// CreateWebhook calls buf.alpha.registry.v1alpha1.WebhookService.CreateWebhook.\nfunc (c *webhookServiceClient) CreateWebhook(ctx context.Context, req *connect.Request[v1alpha1.CreateWebhookRequest]) (*connect.Response[v1alpha1.CreateWebhookResponse], error) {\n\treturn c.createWebhook.CallUnary(ctx, req)\n}\n\n// DeleteWebhook calls buf.alpha.registry.v1alpha1.WebhookService.DeleteWebhook.\nfunc (c *webhookServiceClient) DeleteWebhook(ctx context.Context, req *connect.Request[v1alpha1.DeleteWebhookRequest]) (*connect.Response[v1alpha1.DeleteWebhookResponse], error) {\n\treturn c.deleteWebhook.CallUnary(ctx, req)\n}\n\n// ListWebhooks calls buf.alpha.registry.v1alpha1.WebhookService.ListWebhooks.\nfunc (c *webhookServiceClient) ListWebhooks(ctx context.Context, req *connect.Request[v1alpha1.ListWebhooksRequest]) (*connect.Response[v1alpha1.ListWebhooksResponse], error) {\n\treturn c.listWebhooks.CallUnary(ctx, req)\n}\n\n// WebhookServiceHandler is an implementation of the buf.alpha.registry.v1alpha1.WebhookService\n// service.\ntype WebhookServiceHandler interface {\n\t// Create a webhook, subscribes to a given repository event for a callback URL\n\t// invocation.\n\tCreateWebhook(context.Context, *connect.Request[v1alpha1.CreateWebhookRequest]) (*connect.Response[v1alpha1.CreateWebhookResponse], error)\n\t// Delete a webhook removes the event subscription.\n\tDeleteWebhook(context.Context, *connect.Request[v1alpha1.DeleteWebhookRequest]) (*connect.Response[v1alpha1.DeleteWebhookResponse], error)\n\t// Lists the webhooks subscriptions for a given repository.\n\tListWebhooks(context.Context, *connect.Request[v1alpha1.ListWebhooksRequest]) (*connect.Response[v1alpha1.ListWebhooksResponse], error)\n}\n\n// NewWebhookServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewWebhookServiceHandler(svc WebhookServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\twebhookServiceMethods := v1alpha1.File_buf_alpha_registry_v1alpha1_webhook_proto.Services().ByName(\"WebhookService\").Methods()\n\twebhookServiceCreateWebhookHandler := connect.NewUnaryHandler(\n\t\tWebhookServiceCreateWebhookProcedure,\n\t\tsvc.CreateWebhook,\n\t\tconnect.WithSchema(webhookServiceMethods.ByName(\"CreateWebhook\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\twebhookServiceDeleteWebhookHandler := connect.NewUnaryHandler(\n\t\tWebhookServiceDeleteWebhookProcedure,\n\t\tsvc.DeleteWebhook,\n\t\tconnect.WithSchema(webhookServiceMethods.ByName(\"DeleteWebhook\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyIdempotent),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\twebhookServiceListWebhooksHandler := connect.NewUnaryHandler(\n\t\tWebhookServiceListWebhooksProcedure,\n\t\tsvc.ListWebhooks,\n\t\tconnect.WithSchema(webhookServiceMethods.ByName(\"ListWebhooks\")),\n\t\tconnect.WithIdempotency(connect.IdempotencyNoSideEffects),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.registry.v1alpha1.WebhookService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase WebhookServiceCreateWebhookProcedure:\n\t\t\twebhookServiceCreateWebhookHandler.ServeHTTP(w, r)\n\t\tcase WebhookServiceDeleteWebhookProcedure:\n\t\t\twebhookServiceDeleteWebhookHandler.ServeHTTP(w, r)\n\t\tcase WebhookServiceListWebhooksProcedure:\n\t\t\twebhookServiceListWebhooksHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedWebhookServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedWebhookServiceHandler struct{}\n\nfunc (UnimplementedWebhookServiceHandler) CreateWebhook(context.Context, *connect.Request[v1alpha1.CreateWebhookRequest]) (*connect.Response[v1alpha1.CreateWebhookResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.WebhookService.CreateWebhook is not implemented\"))\n}\n\nfunc (UnimplementedWebhookServiceHandler) DeleteWebhook(context.Context, *connect.Request[v1alpha1.DeleteWebhookRequest]) (*connect.Response[v1alpha1.DeleteWebhookResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.WebhookService.DeleteWebhook is not implemented\"))\n}\n\nfunc (UnimplementedWebhookServiceHandler) ListWebhooks(context.Context, *connect.Request[v1alpha1.ListWebhooksRequest]) (*connect.Response[v1alpha1.ListWebhooksResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.registry.v1alpha1.WebhookService.ListWebhooks is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/webhook/v1alpha1/webhookv1alpha1connect/event.connect.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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-connect-go. DO NOT EDIT.\n//\n// Source: buf/alpha/webhook/v1alpha1/event.proto\n\npackage webhookv1alpha1connect\n\nimport (\n\tconnect \"connectrpc.com/connect\"\n\tcontext \"context\"\n\terrors \"errors\"\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/webhook/v1alpha1\"\n\thttp \"net/http\"\n\tstrings \"strings\"\n)\n\n// This is a compile-time assertion to ensure that this generated file and the connect package are\n// compatible. If you get a compiler error that this constant is not defined, this code was\n// generated with a version of connect newer than the one compiled into your binary. You can fix the\n// problem by either regenerating this code with an older version of connect or updating the connect\n// version compiled into your binary.\nconst _ = connect.IsAtLeastVersion1_13_0\n\nconst (\n\t// EventServiceName is the fully-qualified name of the EventService service.\n\tEventServiceName = \"buf.alpha.webhook.v1alpha1.EventService\"\n)\n\n// These constants are the fully-qualified names of the RPCs defined in this package. They're\n// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.\n//\n// Note that these are different from the fully-qualified method names used by\n// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to\n// reflection-formatted method names, remove the leading slash and convert the remaining slash to a\n// period.\nconst (\n\t// EventServiceEventProcedure is the fully-qualified name of the EventService's Event RPC.\n\tEventServiceEventProcedure = \"/buf.alpha.webhook.v1alpha1.EventService/Event\"\n)\n\n// EventServiceClient is a client for the buf.alpha.webhook.v1alpha1.EventService service.\ntype EventServiceClient interface {\n\t// Event is the rpc which receives webhook events.\n\tEvent(context.Context, *connect.Request[v1alpha1.EventRequest]) (*connect.Response[v1alpha1.EventResponse], error)\n}\n\n// NewEventServiceClient constructs a client for the buf.alpha.webhook.v1alpha1.EventService\n// service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for\n// gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply\n// the connect.WithGRPC() or connect.WithGRPCWeb() options.\n//\n// The URL supplied here should be the base URL for the Connect or gRPC server (for example,\n// http://api.acme.com or https://acme.com/grpc).\nfunc NewEventServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) EventServiceClient {\n\tbaseURL = strings.TrimRight(baseURL, \"/\")\n\teventServiceMethods := v1alpha1.File_buf_alpha_webhook_v1alpha1_event_proto.Services().ByName(\"EventService\").Methods()\n\treturn &eventServiceClient{\n\t\tevent: connect.NewClient[v1alpha1.EventRequest, v1alpha1.EventResponse](\n\t\t\thttpClient,\n\t\t\tbaseURL+EventServiceEventProcedure,\n\t\t\tconnect.WithSchema(eventServiceMethods.ByName(\"Event\")),\n\t\t\tconnect.WithClientOptions(opts...),\n\t\t),\n\t}\n}\n\n// eventServiceClient implements EventServiceClient.\ntype eventServiceClient struct {\n\tevent *connect.Client[v1alpha1.EventRequest, v1alpha1.EventResponse]\n}\n\n// Event calls buf.alpha.webhook.v1alpha1.EventService.Event.\nfunc (c *eventServiceClient) Event(ctx context.Context, req *connect.Request[v1alpha1.EventRequest]) (*connect.Response[v1alpha1.EventResponse], error) {\n\treturn c.event.CallUnary(ctx, req)\n}\n\n// EventServiceHandler is an implementation of the buf.alpha.webhook.v1alpha1.EventService service.\ntype EventServiceHandler interface {\n\t// Event is the rpc which receives webhook events.\n\tEvent(context.Context, *connect.Request[v1alpha1.EventRequest]) (*connect.Response[v1alpha1.EventResponse], error)\n}\n\n// NewEventServiceHandler builds an HTTP handler from the service implementation. It returns the\n// path on which to mount the handler and the handler itself.\n//\n// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf\n// and JSON codecs. They also support gzip compression.\nfunc NewEventServiceHandler(svc EventServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {\n\teventServiceMethods := v1alpha1.File_buf_alpha_webhook_v1alpha1_event_proto.Services().ByName(\"EventService\").Methods()\n\teventServiceEventHandler := connect.NewUnaryHandler(\n\t\tEventServiceEventProcedure,\n\t\tsvc.Event,\n\t\tconnect.WithSchema(eventServiceMethods.ByName(\"Event\")),\n\t\tconnect.WithHandlerOptions(opts...),\n\t)\n\treturn \"/buf.alpha.webhook.v1alpha1.EventService/\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tswitch r.URL.Path {\n\t\tcase EventServiceEventProcedure:\n\t\t\teventServiceEventHandler.ServeHTTP(w, r)\n\t\tdefault:\n\t\t\thttp.NotFound(w, r)\n\t\t}\n\t})\n}\n\n// UnimplementedEventServiceHandler returns CodeUnimplemented from all methods.\ntype UnimplementedEventServiceHandler struct{}\n\nfunc (UnimplementedEventServiceHandler) Event(context.Context, *connect.Request[v1alpha1.EventRequest]) (*connect.Response[v1alpha1.EventResponse], error) {\n\treturn nil, connect.NewError(connect.CodeUnimplemented, errors.New(\"buf.alpha.webhook.v1alpha1.EventService.Event is not implemented\"))\n}\n"
  },
  {
    "path": "private/gen/proto/connect/buf/alpha/webhook/v1alpha1/webhookv1alpha1connect/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage webhookv1alpha1connect\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/audit/v1alpha1/event.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/audit/v1alpha1/event.proto\n\npackage auditv1alpha1\n\nimport (\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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\n// ActorType is the type of actor that caused the audited event.\ntype ActorType int32\n\nconst (\n\tActorType_ACTOR_TYPE_UNSPECIFIED ActorType = 0\n\tActorType_ACTOR_TYPE_USER        ActorType = 1\n\tActorType_ACTOR_TYPE_SYSTEM      ActorType = 2\n)\n\n// Enum value maps for ActorType.\nvar (\n\tActorType_name = map[int32]string{\n\t\t0: \"ACTOR_TYPE_UNSPECIFIED\",\n\t\t1: \"ACTOR_TYPE_USER\",\n\t\t2: \"ACTOR_TYPE_SYSTEM\",\n\t}\n\tActorType_value = map[string]int32{\n\t\t\"ACTOR_TYPE_UNSPECIFIED\": 0,\n\t\t\"ACTOR_TYPE_USER\":        1,\n\t\t\"ACTOR_TYPE_SYSTEM\":      2,\n\t}\n)\n\nfunc (x ActorType) Enum() *ActorType {\n\tp := new(ActorType)\n\t*p = x\n\treturn p\n}\n\nfunc (x ActorType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ActorType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[0].Descriptor()\n}\n\nfunc (ActorType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[0]\n}\n\nfunc (x ActorType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// ResourceType is the type of the resource that was affected by the audited event.\n//\n// [#next-free-field: 23]\ntype ResourceType int32\n\nconst (\n\tResourceType_RESOURCE_TYPE_UNSPECIFIED                ResourceType = 0\n\tResourceType_RESOURCE_TYPE_USER                       ResourceType = 1\n\tResourceType_RESOURCE_TYPE_ORGANIZATION               ResourceType = 2\n\tResourceType_RESOURCE_TYPE_ORGANIZATION_MEMBER        ResourceType = 3\n\tResourceType_RESOURCE_TYPE_ORGANIZATION_IDP_GROUP     ResourceType = 9\n\tResourceType_RESOURCE_TYPE_REPOSITORY                 ResourceType = 4\n\tResourceType_RESOURCE_TYPE_REPOSITORY_CONTRIBUTOR     ResourceType = 5\n\tResourceType_RESOURCE_TYPE_REPOSITORY_COMMIT          ResourceType = 6\n\tResourceType_RESOURCE_TYPE_REPOSITORY_IDP_GROUP       ResourceType = 18\n\tResourceType_RESOURCE_TYPE_POLICY                     ResourceType = 17\n\tResourceType_RESOURCE_TYPE_POLICY_COMMIT              ResourceType = 19\n\tResourceType_RESOURCE_TYPE_POLICY_LABEL               ResourceType = 20\n\tResourceType_RESOURCE_TYPE_POLICY_ENFORCEMENT         ResourceType = 22\n\tResourceType_RESOURCE_TYPE_PLUGIN                     ResourceType = 7\n\tResourceType_RESOURCE_TYPE_PLUGIN_COMMIT              ResourceType = 15\n\tResourceType_RESOURCE_TYPE_CURATED_PLUGIN             ResourceType = 8\n\tResourceType_RESOURCE_TYPE_TOKEN                      ResourceType = 10\n\tResourceType_RESOURCE_TYPE_SCIM_TOKEN                 ResourceType = 11\n\tResourceType_RESOURCE_TYPE_REPOSITORY_LABEL           ResourceType = 12\n\tResourceType_RESOURCE_TYPE_SERVER                     ResourceType = 13\n\tResourceType_RESOURCE_TYPE_DEVICE_AUTHORIZATION_GRANT ResourceType = 14\n\tResourceType_RESOURCE_TYPE_PLUGIN_LABEL               ResourceType = 16\n\tResourceType_RESOURCE_TYPE_SDK_PLUGIN_CONSTRAINT      ResourceType = 21\n)\n\n// Enum value maps for ResourceType.\nvar (\n\tResourceType_name = map[int32]string{\n\t\t0:  \"RESOURCE_TYPE_UNSPECIFIED\",\n\t\t1:  \"RESOURCE_TYPE_USER\",\n\t\t2:  \"RESOURCE_TYPE_ORGANIZATION\",\n\t\t3:  \"RESOURCE_TYPE_ORGANIZATION_MEMBER\",\n\t\t9:  \"RESOURCE_TYPE_ORGANIZATION_IDP_GROUP\",\n\t\t4:  \"RESOURCE_TYPE_REPOSITORY\",\n\t\t5:  \"RESOURCE_TYPE_REPOSITORY_CONTRIBUTOR\",\n\t\t6:  \"RESOURCE_TYPE_REPOSITORY_COMMIT\",\n\t\t18: \"RESOURCE_TYPE_REPOSITORY_IDP_GROUP\",\n\t\t17: \"RESOURCE_TYPE_POLICY\",\n\t\t19: \"RESOURCE_TYPE_POLICY_COMMIT\",\n\t\t20: \"RESOURCE_TYPE_POLICY_LABEL\",\n\t\t22: \"RESOURCE_TYPE_POLICY_ENFORCEMENT\",\n\t\t7:  \"RESOURCE_TYPE_PLUGIN\",\n\t\t15: \"RESOURCE_TYPE_PLUGIN_COMMIT\",\n\t\t8:  \"RESOURCE_TYPE_CURATED_PLUGIN\",\n\t\t10: \"RESOURCE_TYPE_TOKEN\",\n\t\t11: \"RESOURCE_TYPE_SCIM_TOKEN\",\n\t\t12: \"RESOURCE_TYPE_REPOSITORY_LABEL\",\n\t\t13: \"RESOURCE_TYPE_SERVER\",\n\t\t14: \"RESOURCE_TYPE_DEVICE_AUTHORIZATION_GRANT\",\n\t\t16: \"RESOURCE_TYPE_PLUGIN_LABEL\",\n\t\t21: \"RESOURCE_TYPE_SDK_PLUGIN_CONSTRAINT\",\n\t}\n\tResourceType_value = map[string]int32{\n\t\t\"RESOURCE_TYPE_UNSPECIFIED\":                0,\n\t\t\"RESOURCE_TYPE_USER\":                       1,\n\t\t\"RESOURCE_TYPE_ORGANIZATION\":               2,\n\t\t\"RESOURCE_TYPE_ORGANIZATION_MEMBER\":        3,\n\t\t\"RESOURCE_TYPE_ORGANIZATION_IDP_GROUP\":     9,\n\t\t\"RESOURCE_TYPE_REPOSITORY\":                 4,\n\t\t\"RESOURCE_TYPE_REPOSITORY_CONTRIBUTOR\":     5,\n\t\t\"RESOURCE_TYPE_REPOSITORY_COMMIT\":          6,\n\t\t\"RESOURCE_TYPE_REPOSITORY_IDP_GROUP\":       18,\n\t\t\"RESOURCE_TYPE_POLICY\":                     17,\n\t\t\"RESOURCE_TYPE_POLICY_COMMIT\":              19,\n\t\t\"RESOURCE_TYPE_POLICY_LABEL\":               20,\n\t\t\"RESOURCE_TYPE_POLICY_ENFORCEMENT\":         22,\n\t\t\"RESOURCE_TYPE_PLUGIN\":                     7,\n\t\t\"RESOURCE_TYPE_PLUGIN_COMMIT\":              15,\n\t\t\"RESOURCE_TYPE_CURATED_PLUGIN\":             8,\n\t\t\"RESOURCE_TYPE_TOKEN\":                      10,\n\t\t\"RESOURCE_TYPE_SCIM_TOKEN\":                 11,\n\t\t\"RESOURCE_TYPE_REPOSITORY_LABEL\":           12,\n\t\t\"RESOURCE_TYPE_SERVER\":                     13,\n\t\t\"RESOURCE_TYPE_DEVICE_AUTHORIZATION_GRANT\": 14,\n\t\t\"RESOURCE_TYPE_PLUGIN_LABEL\":               16,\n\t\t\"RESOURCE_TYPE_SDK_PLUGIN_CONSTRAINT\":      21,\n\t}\n)\n\nfunc (x ResourceType) Enum() *ResourceType {\n\tp := new(ResourceType)\n\t*p = x\n\treturn p\n}\n\nfunc (x ResourceType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ResourceType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[1].Descriptor()\n}\n\nfunc (ResourceType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[1]\n}\n\nfunc (x ResourceType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// EventType is the type of audited event.\n//\n// [#next-free-field: 84]\ntype EventType int32\n\nconst (\n\tEventType_EVENT_TYPE_UNSPECIFIED               EventType = 0\n\tEventType_EVENT_TYPE_ORGANIZATION_CREATED      EventType = 1\n\tEventType_EVENT_TYPE_ORGANIZATION_DELETED      EventType = 2\n\tEventType_EVENT_TYPE_ORGANIZATION_MEMBER_ADDED EventType = 3\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tEventType_EVENT_TYPE_ORGANIZATION_MEMBER_ROLE_CHANGED                 EventType = 4\n\tEventType_EVENT_TYPE_ORGANIZATION_MEMBER_ROLES_CHANGED                EventType = 50\n\tEventType_EVENT_TYPE_ORGANIZATION_MEMBER_REMOVED                      EventType = 5\n\tEventType_EVENT_TYPE_ORGANIZATION_IDP_GROUP_ADDED                     EventType = 21\n\tEventType_EVENT_TYPE_ORGANIZATION_IDP_GROUP_UPDATED                   EventType = 59\n\tEventType_EVENT_TYPE_ORGANIZATION_IDP_GROUP_REMOVED                   EventType = 22\n\tEventType_EVENT_TYPE_ORGANIZATION_RESOURCE_VISIBILITY_CONTROL_CHANGED EventType = 81\n\tEventType_EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_ENABLED           EventType = 82\n\tEventType_EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_DISABLED          EventType = 83\n\tEventType_EVENT_TYPE_REPOSITORY_CREATED                               EventType = 6\n\tEventType_EVENT_TYPE_REPOSITORY_DEPRECATED                            EventType = 48\n\tEventType_EVENT_TYPE_REPOSITORY_UNDEPRECATED                          EventType = 49\n\tEventType_EVENT_TYPE_REPOSITORY_DELETED                               EventType = 7\n\tEventType_EVENT_TYPE_REPOSITORY_COMMIT_PUSHED                         EventType = 8\n\tEventType_EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ADDED                     EventType = 9\n\tEventType_EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLE_CHANGED              EventType = 10\n\tEventType_EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLES_CHANGED             EventType = 63\n\tEventType_EVENT_TYPE_REPOSITORY_CONTRIBUTOR_REMOVED                   EventType = 11\n\tEventType_EVENT_TYPE_REPOSITORY_VISIBILITY_CHANGED                    EventType = 12\n\tEventType_EVENT_TYPE_REPOSITORY_DEFAULT_LABEL_NAME_CHANGED            EventType = 40\n\tEventType_EVENT_TYPE_REPOSITORY_IDP_GROUP_ADDED                       EventType = 60\n\tEventType_EVENT_TYPE_REPOSITORY_IDP_GROUP_UPDATED                     EventType = 61\n\tEventType_EVENT_TYPE_REPOSITORY_IDP_GROUP_REMOVED                     EventType = 62\n\tEventType_EVENT_TYPE_POLICY_CREATED                                   EventType = 54\n\tEventType_EVENT_TYPE_POLICY_DELETED                                   EventType = 55\n\tEventType_EVENT_TYPE_POLICY_DEPRECATED                                EventType = 56\n\tEventType_EVENT_TYPE_POLICY_UNDEPRECATED                              EventType = 57\n\tEventType_EVENT_TYPE_POLICY_VISIBILITY_CHANGED                        EventType = 58\n\tEventType_EVENT_TYPE_POLICY_COMMIT_PUSHED                             EventType = 64\n\tEventType_EVENT_TYPE_POLICY_LABEL_CREATED                             EventType = 65\n\tEventType_EVENT_TYPE_POLICY_LABEL_MOVED                               EventType = 66\n\tEventType_EVENT_TYPE_POLICY_LABEL_ARCHIVED                            EventType = 67\n\tEventType_EVENT_TYPE_POLICY_LABEL_UNARCHIVED                          EventType = 68\n\tEventType_EVENT_TYPE_PLUGIN_CREATED                                   EventType = 13\n\tEventType_EVENT_TYPE_PLUGIN_DELETED                                   EventType = 14\n\tEventType_EVENT_TYPE_PLUGIN_DEPRECATED                                EventType = 51\n\tEventType_EVENT_TYPE_PLUGIN_UNDEPRECATED                              EventType = 52\n\tEventType_EVENT_TYPE_PLUGIN_VISIBILITY_CHANGED                        EventType = 53\n\tEventType_EVENT_TYPE_PLUGIN_COMMIT_PUSHED                             EventType = 43\n\tEventType_EVENT_TYPE_CURATED_PLUGIN_CREATED                           EventType = 20\n\tEventType_EVENT_TYPE_CURATED_PLUGIN_DELETED                           EventType = 31\n\tEventType_EVENT_TYPE_CURATED_PLUGIN_STATUS_UPDATED                    EventType = 78\n\tEventType_EVENT_TYPE_USER_CREATED                                     EventType = 15\n\tEventType_EVENT_TYPE_USER_DELETED                                     EventType = 16\n\tEventType_EVENT_TYPE_USER_DEACTIVATED                                 EventType = 17\n\tEventType_EVENT_TYPE_USER_LOGGED_IN                                   EventType = 18\n\tEventType_EVENT_TYPE_USER_LOGGED_OUT                                  EventType = 19\n\tEventType_EVENT_TYPE_TOKEN_CREATED                                    EventType = 23\n\tEventType_EVENT_TYPE_TOKEN_DELETED                                    EventType = 24\n\tEventType_EVENT_TYPE_USER_REACTIVATED                                 EventType = 25\n\tEventType_EVENT_TYPE_SCIM_TOKEN_CREATED                               EventType = 26\n\tEventType_EVENT_TYPE_SCIM_TOKEN_DELETED                               EventType = 27\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tEventType_EVENT_TYPE_REPOSITORY_COMMIT_DELETED                    EventType = 28\n\tEventType_EVENT_TYPE_REPOSITORY_LABEL_CREATED                     EventType = 29\n\tEventType_EVENT_TYPE_REPOSITORY_LABEL_MOVED                       EventType = 30\n\tEventType_EVENT_TYPE_REPOSITORY_LABEL_ARCHIVED                    EventType = 38\n\tEventType_EVENT_TYPE_REPOSITORY_LABEL_UNARCHIVED                  EventType = 39\n\tEventType_EVENT_TYPE_REPOSITORY_LABEL_ENFORCEMENT_IGNORES_CHANGED EventType = 79\n\tEventType_EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_ENABLED        EventType = 32\n\tEventType_EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_DISABLED       EventType = 33\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tEventType_EVENT_TYPE_REPOSITORY_DEFAULT_BRANCH_CHANGED          EventType = 34\n\tEventType_EVENT_TYPE_SERVER_UNIQUENESS_POLICY_ENABLED           EventType = 35\n\tEventType_EVENT_TYPE_SERVER_UNIQUENESS_POLICY_DISABLED          EventType = 36\n\tEventType_EVENT_TYPE_SERVER_RESOURCE_VISIBILITY_CONTROL_CHANGED EventType = 80\n\tEventType_EVENT_TYPE_USER_AUTO_MERGED_FROM_NEW_IDP              EventType = 37\n\tEventType_EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_APPROVED        EventType = 41\n\tEventType_EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_DENIED          EventType = 42\n\tEventType_EVENT_TYPE_PLUGIN_LABEL_CREATED                       EventType = 44\n\tEventType_EVENT_TYPE_PLUGIN_LABEL_MOVED                         EventType = 45\n\tEventType_EVENT_TYPE_PLUGIN_LABEL_ARCHIVED                      EventType = 46\n\tEventType_EVENT_TYPE_PLUGIN_LABEL_UNARCHIVED                    EventType = 47\n\tEventType_EVENT_TYPE_SERVER_REVIEW_FLOW_ENABLED                 EventType = 69\n\tEventType_EVENT_TYPE_SERVER_REVIEW_FLOW_DISABLED                EventType = 70\n\tEventType_EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_CREATED              EventType = 71\n\tEventType_EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_UPDATED              EventType = 72\n\tEventType_EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_DELETED              EventType = 73\n\tEventType_EVENT_TYPE_POLICY_ENFORCEMENT_CREATED                 EventType = 74\n\tEventType_EVENT_TYPE_POLICY_ENFORCEMENT_DELETED                 EventType = 75\n\tEventType_EVENT_TYPE_POLICY_ENFORCEMENT_POLICY_CHANGED          EventType = 76\n\tEventType_EVENT_TYPE_POLICY_ENFORCEMENT_TARGETS_CHANGED         EventType = 77\n)\n\n// Enum value maps for EventType.\nvar (\n\tEventType_name = map[int32]string{\n\t\t0:  \"EVENT_TYPE_UNSPECIFIED\",\n\t\t1:  \"EVENT_TYPE_ORGANIZATION_CREATED\",\n\t\t2:  \"EVENT_TYPE_ORGANIZATION_DELETED\",\n\t\t3:  \"EVENT_TYPE_ORGANIZATION_MEMBER_ADDED\",\n\t\t4:  \"EVENT_TYPE_ORGANIZATION_MEMBER_ROLE_CHANGED\",\n\t\t50: \"EVENT_TYPE_ORGANIZATION_MEMBER_ROLES_CHANGED\",\n\t\t5:  \"EVENT_TYPE_ORGANIZATION_MEMBER_REMOVED\",\n\t\t21: \"EVENT_TYPE_ORGANIZATION_IDP_GROUP_ADDED\",\n\t\t59: \"EVENT_TYPE_ORGANIZATION_IDP_GROUP_UPDATED\",\n\t\t22: \"EVENT_TYPE_ORGANIZATION_IDP_GROUP_REMOVED\",\n\t\t81: \"EVENT_TYPE_ORGANIZATION_RESOURCE_VISIBILITY_CONTROL_CHANGED\",\n\t\t82: \"EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_ENABLED\",\n\t\t83: \"EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_DISABLED\",\n\t\t6:  \"EVENT_TYPE_REPOSITORY_CREATED\",\n\t\t48: \"EVENT_TYPE_REPOSITORY_DEPRECATED\",\n\t\t49: \"EVENT_TYPE_REPOSITORY_UNDEPRECATED\",\n\t\t7:  \"EVENT_TYPE_REPOSITORY_DELETED\",\n\t\t8:  \"EVENT_TYPE_REPOSITORY_COMMIT_PUSHED\",\n\t\t9:  \"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ADDED\",\n\t\t10: \"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLE_CHANGED\",\n\t\t63: \"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLES_CHANGED\",\n\t\t11: \"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_REMOVED\",\n\t\t12: \"EVENT_TYPE_REPOSITORY_VISIBILITY_CHANGED\",\n\t\t40: \"EVENT_TYPE_REPOSITORY_DEFAULT_LABEL_NAME_CHANGED\",\n\t\t60: \"EVENT_TYPE_REPOSITORY_IDP_GROUP_ADDED\",\n\t\t61: \"EVENT_TYPE_REPOSITORY_IDP_GROUP_UPDATED\",\n\t\t62: \"EVENT_TYPE_REPOSITORY_IDP_GROUP_REMOVED\",\n\t\t54: \"EVENT_TYPE_POLICY_CREATED\",\n\t\t55: \"EVENT_TYPE_POLICY_DELETED\",\n\t\t56: \"EVENT_TYPE_POLICY_DEPRECATED\",\n\t\t57: \"EVENT_TYPE_POLICY_UNDEPRECATED\",\n\t\t58: \"EVENT_TYPE_POLICY_VISIBILITY_CHANGED\",\n\t\t64: \"EVENT_TYPE_POLICY_COMMIT_PUSHED\",\n\t\t65: \"EVENT_TYPE_POLICY_LABEL_CREATED\",\n\t\t66: \"EVENT_TYPE_POLICY_LABEL_MOVED\",\n\t\t67: \"EVENT_TYPE_POLICY_LABEL_ARCHIVED\",\n\t\t68: \"EVENT_TYPE_POLICY_LABEL_UNARCHIVED\",\n\t\t13: \"EVENT_TYPE_PLUGIN_CREATED\",\n\t\t14: \"EVENT_TYPE_PLUGIN_DELETED\",\n\t\t51: \"EVENT_TYPE_PLUGIN_DEPRECATED\",\n\t\t52: \"EVENT_TYPE_PLUGIN_UNDEPRECATED\",\n\t\t53: \"EVENT_TYPE_PLUGIN_VISIBILITY_CHANGED\",\n\t\t43: \"EVENT_TYPE_PLUGIN_COMMIT_PUSHED\",\n\t\t20: \"EVENT_TYPE_CURATED_PLUGIN_CREATED\",\n\t\t31: \"EVENT_TYPE_CURATED_PLUGIN_DELETED\",\n\t\t78: \"EVENT_TYPE_CURATED_PLUGIN_STATUS_UPDATED\",\n\t\t15: \"EVENT_TYPE_USER_CREATED\",\n\t\t16: \"EVENT_TYPE_USER_DELETED\",\n\t\t17: \"EVENT_TYPE_USER_DEACTIVATED\",\n\t\t18: \"EVENT_TYPE_USER_LOGGED_IN\",\n\t\t19: \"EVENT_TYPE_USER_LOGGED_OUT\",\n\t\t23: \"EVENT_TYPE_TOKEN_CREATED\",\n\t\t24: \"EVENT_TYPE_TOKEN_DELETED\",\n\t\t25: \"EVENT_TYPE_USER_REACTIVATED\",\n\t\t26: \"EVENT_TYPE_SCIM_TOKEN_CREATED\",\n\t\t27: \"EVENT_TYPE_SCIM_TOKEN_DELETED\",\n\t\t28: \"EVENT_TYPE_REPOSITORY_COMMIT_DELETED\",\n\t\t29: \"EVENT_TYPE_REPOSITORY_LABEL_CREATED\",\n\t\t30: \"EVENT_TYPE_REPOSITORY_LABEL_MOVED\",\n\t\t38: \"EVENT_TYPE_REPOSITORY_LABEL_ARCHIVED\",\n\t\t39: \"EVENT_TYPE_REPOSITORY_LABEL_UNARCHIVED\",\n\t\t79: \"EVENT_TYPE_REPOSITORY_LABEL_ENFORCEMENT_IGNORES_CHANGED\",\n\t\t32: \"EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_ENABLED\",\n\t\t33: \"EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_DISABLED\",\n\t\t34: \"EVENT_TYPE_REPOSITORY_DEFAULT_BRANCH_CHANGED\",\n\t\t35: \"EVENT_TYPE_SERVER_UNIQUENESS_POLICY_ENABLED\",\n\t\t36: \"EVENT_TYPE_SERVER_UNIQUENESS_POLICY_DISABLED\",\n\t\t80: \"EVENT_TYPE_SERVER_RESOURCE_VISIBILITY_CONTROL_CHANGED\",\n\t\t37: \"EVENT_TYPE_USER_AUTO_MERGED_FROM_NEW_IDP\",\n\t\t41: \"EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_APPROVED\",\n\t\t42: \"EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_DENIED\",\n\t\t44: \"EVENT_TYPE_PLUGIN_LABEL_CREATED\",\n\t\t45: \"EVENT_TYPE_PLUGIN_LABEL_MOVED\",\n\t\t46: \"EVENT_TYPE_PLUGIN_LABEL_ARCHIVED\",\n\t\t47: \"EVENT_TYPE_PLUGIN_LABEL_UNARCHIVED\",\n\t\t69: \"EVENT_TYPE_SERVER_REVIEW_FLOW_ENABLED\",\n\t\t70: \"EVENT_TYPE_SERVER_REVIEW_FLOW_DISABLED\",\n\t\t71: \"EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_CREATED\",\n\t\t72: \"EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_UPDATED\",\n\t\t73: \"EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_DELETED\",\n\t\t74: \"EVENT_TYPE_POLICY_ENFORCEMENT_CREATED\",\n\t\t75: \"EVENT_TYPE_POLICY_ENFORCEMENT_DELETED\",\n\t\t76: \"EVENT_TYPE_POLICY_ENFORCEMENT_POLICY_CHANGED\",\n\t\t77: \"EVENT_TYPE_POLICY_ENFORCEMENT_TARGETS_CHANGED\",\n\t}\n\tEventType_value = map[string]int32{\n\t\t\"EVENT_TYPE_UNSPECIFIED\":                                      0,\n\t\t\"EVENT_TYPE_ORGANIZATION_CREATED\":                             1,\n\t\t\"EVENT_TYPE_ORGANIZATION_DELETED\":                             2,\n\t\t\"EVENT_TYPE_ORGANIZATION_MEMBER_ADDED\":                        3,\n\t\t\"EVENT_TYPE_ORGANIZATION_MEMBER_ROLE_CHANGED\":                 4,\n\t\t\"EVENT_TYPE_ORGANIZATION_MEMBER_ROLES_CHANGED\":                50,\n\t\t\"EVENT_TYPE_ORGANIZATION_MEMBER_REMOVED\":                      5,\n\t\t\"EVENT_TYPE_ORGANIZATION_IDP_GROUP_ADDED\":                     21,\n\t\t\"EVENT_TYPE_ORGANIZATION_IDP_GROUP_UPDATED\":                   59,\n\t\t\"EVENT_TYPE_ORGANIZATION_IDP_GROUP_REMOVED\":                   22,\n\t\t\"EVENT_TYPE_ORGANIZATION_RESOURCE_VISIBILITY_CONTROL_CHANGED\": 81,\n\t\t\"EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_ENABLED\":           82,\n\t\t\"EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_DISABLED\":          83,\n\t\t\"EVENT_TYPE_REPOSITORY_CREATED\":                               6,\n\t\t\"EVENT_TYPE_REPOSITORY_DEPRECATED\":                            48,\n\t\t\"EVENT_TYPE_REPOSITORY_UNDEPRECATED\":                          49,\n\t\t\"EVENT_TYPE_REPOSITORY_DELETED\":                               7,\n\t\t\"EVENT_TYPE_REPOSITORY_COMMIT_PUSHED\":                         8,\n\t\t\"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ADDED\":                     9,\n\t\t\"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLE_CHANGED\":              10,\n\t\t\"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLES_CHANGED\":             63,\n\t\t\"EVENT_TYPE_REPOSITORY_CONTRIBUTOR_REMOVED\":                   11,\n\t\t\"EVENT_TYPE_REPOSITORY_VISIBILITY_CHANGED\":                    12,\n\t\t\"EVENT_TYPE_REPOSITORY_DEFAULT_LABEL_NAME_CHANGED\":            40,\n\t\t\"EVENT_TYPE_REPOSITORY_IDP_GROUP_ADDED\":                       60,\n\t\t\"EVENT_TYPE_REPOSITORY_IDP_GROUP_UPDATED\":                     61,\n\t\t\"EVENT_TYPE_REPOSITORY_IDP_GROUP_REMOVED\":                     62,\n\t\t\"EVENT_TYPE_POLICY_CREATED\":                                   54,\n\t\t\"EVENT_TYPE_POLICY_DELETED\":                                   55,\n\t\t\"EVENT_TYPE_POLICY_DEPRECATED\":                                56,\n\t\t\"EVENT_TYPE_POLICY_UNDEPRECATED\":                              57,\n\t\t\"EVENT_TYPE_POLICY_VISIBILITY_CHANGED\":                        58,\n\t\t\"EVENT_TYPE_POLICY_COMMIT_PUSHED\":                             64,\n\t\t\"EVENT_TYPE_POLICY_LABEL_CREATED\":                             65,\n\t\t\"EVENT_TYPE_POLICY_LABEL_MOVED\":                               66,\n\t\t\"EVENT_TYPE_POLICY_LABEL_ARCHIVED\":                            67,\n\t\t\"EVENT_TYPE_POLICY_LABEL_UNARCHIVED\":                          68,\n\t\t\"EVENT_TYPE_PLUGIN_CREATED\":                                   13,\n\t\t\"EVENT_TYPE_PLUGIN_DELETED\":                                   14,\n\t\t\"EVENT_TYPE_PLUGIN_DEPRECATED\":                                51,\n\t\t\"EVENT_TYPE_PLUGIN_UNDEPRECATED\":                              52,\n\t\t\"EVENT_TYPE_PLUGIN_VISIBILITY_CHANGED\":                        53,\n\t\t\"EVENT_TYPE_PLUGIN_COMMIT_PUSHED\":                             43,\n\t\t\"EVENT_TYPE_CURATED_PLUGIN_CREATED\":                           20,\n\t\t\"EVENT_TYPE_CURATED_PLUGIN_DELETED\":                           31,\n\t\t\"EVENT_TYPE_CURATED_PLUGIN_STATUS_UPDATED\":                    78,\n\t\t\"EVENT_TYPE_USER_CREATED\":                                     15,\n\t\t\"EVENT_TYPE_USER_DELETED\":                                     16,\n\t\t\"EVENT_TYPE_USER_DEACTIVATED\":                                 17,\n\t\t\"EVENT_TYPE_USER_LOGGED_IN\":                                   18,\n\t\t\"EVENT_TYPE_USER_LOGGED_OUT\":                                  19,\n\t\t\"EVENT_TYPE_TOKEN_CREATED\":                                    23,\n\t\t\"EVENT_TYPE_TOKEN_DELETED\":                                    24,\n\t\t\"EVENT_TYPE_USER_REACTIVATED\":                                 25,\n\t\t\"EVENT_TYPE_SCIM_TOKEN_CREATED\":                               26,\n\t\t\"EVENT_TYPE_SCIM_TOKEN_DELETED\":                               27,\n\t\t\"EVENT_TYPE_REPOSITORY_COMMIT_DELETED\":                        28,\n\t\t\"EVENT_TYPE_REPOSITORY_LABEL_CREATED\":                         29,\n\t\t\"EVENT_TYPE_REPOSITORY_LABEL_MOVED\":                           30,\n\t\t\"EVENT_TYPE_REPOSITORY_LABEL_ARCHIVED\":                        38,\n\t\t\"EVENT_TYPE_REPOSITORY_LABEL_UNARCHIVED\":                      39,\n\t\t\"EVENT_TYPE_REPOSITORY_LABEL_ENFORCEMENT_IGNORES_CHANGED\":     79,\n\t\t\"EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_ENABLED\":            32,\n\t\t\"EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_DISABLED\":           33,\n\t\t\"EVENT_TYPE_REPOSITORY_DEFAULT_BRANCH_CHANGED\":                34,\n\t\t\"EVENT_TYPE_SERVER_UNIQUENESS_POLICY_ENABLED\":                 35,\n\t\t\"EVENT_TYPE_SERVER_UNIQUENESS_POLICY_DISABLED\":                36,\n\t\t\"EVENT_TYPE_SERVER_RESOURCE_VISIBILITY_CONTROL_CHANGED\":       80,\n\t\t\"EVENT_TYPE_USER_AUTO_MERGED_FROM_NEW_IDP\":                    37,\n\t\t\"EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_APPROVED\":              41,\n\t\t\"EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_DENIED\":                42,\n\t\t\"EVENT_TYPE_PLUGIN_LABEL_CREATED\":                             44,\n\t\t\"EVENT_TYPE_PLUGIN_LABEL_MOVED\":                               45,\n\t\t\"EVENT_TYPE_PLUGIN_LABEL_ARCHIVED\":                            46,\n\t\t\"EVENT_TYPE_PLUGIN_LABEL_UNARCHIVED\":                          47,\n\t\t\"EVENT_TYPE_SERVER_REVIEW_FLOW_ENABLED\":                       69,\n\t\t\"EVENT_TYPE_SERVER_REVIEW_FLOW_DISABLED\":                      70,\n\t\t\"EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_CREATED\":                    71,\n\t\t\"EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_UPDATED\":                    72,\n\t\t\"EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_DELETED\":                    73,\n\t\t\"EVENT_TYPE_POLICY_ENFORCEMENT_CREATED\":                       74,\n\t\t\"EVENT_TYPE_POLICY_ENFORCEMENT_DELETED\":                       75,\n\t\t\"EVENT_TYPE_POLICY_ENFORCEMENT_POLICY_CHANGED\":                76,\n\t\t\"EVENT_TYPE_POLICY_ENFORCEMENT_TARGETS_CHANGED\":               77,\n\t}\n)\n\nfunc (x EventType) Enum() *EventType {\n\tp := new(EventType)\n\t*p = x\n\treturn p\n}\n\nfunc (x EventType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (EventType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[2].Descriptor()\n}\n\nfunc (EventType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[2]\n}\n\nfunc (x EventType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Possible visibility that a resource can have.\ntype ResourceVisibilityControl_Visibility int32\n\nconst (\n\tResourceVisibilityControl_VISIBILITY_UNSPECIFIED ResourceVisibilityControl_Visibility = 0\n\tResourceVisibilityControl_VISIBILITY_PUBLIC      ResourceVisibilityControl_Visibility = 1\n\tResourceVisibilityControl_VISIBILITY_PRIVATE     ResourceVisibilityControl_Visibility = 2\n)\n\n// Enum value maps for ResourceVisibilityControl_Visibility.\nvar (\n\tResourceVisibilityControl_Visibility_name = map[int32]string{\n\t\t0: \"VISIBILITY_UNSPECIFIED\",\n\t\t1: \"VISIBILITY_PUBLIC\",\n\t\t2: \"VISIBILITY_PRIVATE\",\n\t}\n\tResourceVisibilityControl_Visibility_value = map[string]int32{\n\t\t\"VISIBILITY_UNSPECIFIED\": 0,\n\t\t\"VISIBILITY_PUBLIC\":      1,\n\t\t\"VISIBILITY_PRIVATE\":     2,\n\t}\n)\n\nfunc (x ResourceVisibilityControl_Visibility) Enum() *ResourceVisibilityControl_Visibility {\n\tp := new(ResourceVisibilityControl_Visibility)\n\t*p = x\n\treturn p\n}\n\nfunc (x ResourceVisibilityControl_Visibility) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ResourceVisibilityControl_Visibility) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[3].Descriptor()\n}\n\nfunc (ResourceVisibilityControl_Visibility) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_audit_v1alpha1_event_proto_enumTypes[3]\n}\n\nfunc (x ResourceVisibilityControl_Visibility) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Actor is the actor who caused the audited event.\ntype Actor struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Type ActorType              `protobuf:\"varint,1,opt,name=type,proto3,enum=buf.alpha.audit.v1alpha1.ActorType\"`\n\txxx_hidden_Id   string                 `protobuf:\"bytes,2,opt,name=id,proto3\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,3,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *Actor) Reset() {\n\t*x = Actor{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Actor) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Actor) ProtoMessage() {}\n\nfunc (x *Actor) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\nfunc (x *Actor) GetType() ActorType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Type\n\t}\n\treturn ActorType_ACTOR_TYPE_UNSPECIFIED\n}\n\nfunc (x *Actor) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *Actor) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Actor) SetType(v ActorType) {\n\tx.xxx_hidden_Type = v\n}\n\nfunc (x *Actor) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *Actor) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype Actor_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Type of actor who caused the audited event.\n\tType ActorType\n\t// Id of the actor who caused the audited event.\n\tId string\n\t// Name of the actor who caused the audited event.\n\tName string\n}\n\nfunc (b0 Actor_builder) Build() *Actor {\n\tm0 := &Actor{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Type = b.Type\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\n// Resource is the affected resource by the audited event.\ntype Resource struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Type ResourceType           `protobuf:\"varint,1,opt,name=type,proto3,enum=buf.alpha.audit.v1alpha1.ResourceType\"`\n\txxx_hidden_Id   string                 `protobuf:\"bytes,2,opt,name=id,proto3\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,3,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *Resource) Reset() {\n\t*x = Resource{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Resource) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Resource) ProtoMessage() {}\n\nfunc (x *Resource) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\nfunc (x *Resource) GetType() ResourceType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Type\n\t}\n\treturn ResourceType_RESOURCE_TYPE_UNSPECIFIED\n}\n\nfunc (x *Resource) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *Resource) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Resource) SetType(v ResourceType) {\n\tx.xxx_hidden_Type = v\n}\n\nfunc (x *Resource) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *Resource) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype Resource_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Type of resource that was affected by the audited event.\n\tType ResourceType\n\t// Id of the affected resource by the audited event.\n\tId string\n\t// Name of the affected resource by the audited event.\n\tName string\n}\n\nfunc (b0 Resource_builder) Build() *Resource {\n\tm0 := &Resource{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Type = b.Type\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\n// EventMetadata provides additional details about the audited event.\ntype EventMetadata struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserAgent string                 `protobuf:\"bytes,1,opt,name=user_agent,json=userAgent,proto3\"`\n\txxx_hidden_Ip        string                 `protobuf:\"bytes,2,opt,name=ip,proto3\"`\n\txxx_hidden_TraceId   string                 `protobuf:\"bytes,3,opt,name=trace_id,json=traceId,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *EventMetadata) Reset() {\n\t*x = EventMetadata{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *EventMetadata) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EventMetadata) ProtoMessage() {}\n\nfunc (x *EventMetadata) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\nfunc (x *EventMetadata) GetUserAgent() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserAgent\n\t}\n\treturn \"\"\n}\n\nfunc (x *EventMetadata) GetIp() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Ip\n\t}\n\treturn \"\"\n}\n\nfunc (x *EventMetadata) GetTraceId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TraceId\n\t}\n\treturn \"\"\n}\n\nfunc (x *EventMetadata) SetUserAgent(v string) {\n\tx.xxx_hidden_UserAgent = v\n}\n\nfunc (x *EventMetadata) SetIp(v string) {\n\tx.xxx_hidden_Ip = v\n}\n\nfunc (x *EventMetadata) SetTraceId(v string) {\n\tx.xxx_hidden_TraceId = v\n}\n\ntype EventMetadata_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// UserAgent is the User-Agent header associated with the request that triggered the audited event, if any.\n\tUserAgent string\n\t// IP is the IP address associated with the request that triggered the audited event, if any.\n\tIp string\n\t// TraceID is the ID of the trace associated with the audited event, if any.\n\tTraceId string\n}\n\nfunc (b0 EventMetadata_builder) Build() *EventMetadata {\n\tm0 := &EventMetadata{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserAgent = b.UserAgent\n\tx.xxx_hidden_Ip = b.Ip\n\tx.xxx_hidden_TraceId = b.TraceId\n\treturn m0\n}\n\n// Event is an audited action that happened in the BSR, with the information of what happened, when\n// it happened, who did it, which resource was affected, and more contextual information on the\n// event.\n//\n// [#next-free-field: 90]\ntype Event struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_EventId   string                 `protobuf:\"bytes,1,opt,name=event_id,json=eventId,proto3\"`\n\txxx_hidden_Type      EventType              `protobuf:\"varint,2,opt,name=type,proto3,enum=buf.alpha.audit.v1alpha1.EventType\"`\n\txxx_hidden_Actor     *Actor                 `protobuf:\"bytes,3,opt,name=actor,proto3\"`\n\txxx_hidden_Resource  *Resource              `protobuf:\"bytes,4,opt,name=resource,proto3\"`\n\txxx_hidden_EventTime *timestamppb.Timestamp `protobuf:\"bytes,5,opt,name=event_time,json=eventTime,proto3\"`\n\txxx_hidden_Metadata  *EventMetadata         `protobuf:\"bytes,6,opt,name=metadata,proto3\"`\n\txxx_hidden_Payload   isEvent_Payload        `protobuf_oneof:\"payload\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *Event) Reset() {\n\t*x = Event{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Event) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Event) ProtoMessage() {}\n\nfunc (x *Event) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\nfunc (x *Event) GetEventId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EventId\n\t}\n\treturn \"\"\n}\n\nfunc (x *Event) GetType() EventType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Type\n\t}\n\treturn EventType_EVENT_TYPE_UNSPECIFIED\n}\n\nfunc (x *Event) GetActor() *Actor {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Actor\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetResource() *Resource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Resource\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetEventTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EventTime\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetMetadata() *EventMetadata {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Metadata\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationCreated() *PayloadOrganizationCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationCreated); ok {\n\t\t\treturn x.OrganizationCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationDeleted() *PayloadOrganizationDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationDeleted); ok {\n\t\t\treturn x.OrganizationDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationMemberAdded() *PayloadOrganizationMemberAdded {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberAdded); ok {\n\t\t\treturn x.OrganizationMemberAdded\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationMemberRoleChanged() *PayloadOrganizationMemberRoleChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRoleChanged); ok {\n\t\t\treturn x.OrganizationMemberRoleChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationMemberRolesChanged() *PayloadOrganizationMemberRolesChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRolesChanged); ok {\n\t\t\treturn x.OrganizationMemberRolesChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationMemberRemoved() *PayloadOrganizationMemberRemoved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRemoved); ok {\n\t\t\treturn x.OrganizationMemberRemoved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationResourceVisibilityControlChanged() *PayloadOrganizationResourceVisibilityControlChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationResourceVisibilityControlChanged); ok {\n\t\t\treturn x.OrganizationResourceVisibilityControlChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationUniquenessPolicyEnabled() *PayloadOrganizationUniquenessPolicyEnabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationUniquenessPolicyEnabled); ok {\n\t\t\treturn x.OrganizationUniquenessPolicyEnabled\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetOrganizationUniquenessPolicyDisabled() *PayloadOrganizationUniquenessPolicyDisabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_OrganizationUniquenessPolicyDisabled); ok {\n\t\t\treturn x.OrganizationUniquenessPolicyDisabled\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryCreated() *PayloadRepositoryCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryCreated); ok {\n\t\t\treturn x.RepositoryCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryDeprecated() *PayloadRepositoryDeprecated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryDeprecated); ok {\n\t\t\treturn x.RepositoryDeprecated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryUndeprecated() *PayloadRepositoryUndeprecated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryUndeprecated); ok {\n\t\t\treturn x.RepositoryUndeprecated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryDeleted() *PayloadRepositoryDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryDeleted); ok {\n\t\t\treturn x.RepositoryDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryCommitPushed() *PayloadRepositoryCommitPushed {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryCommitPushed); ok {\n\t\t\treturn x.RepositoryCommitPushed\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryContributorAdded() *PayloadRepositoryContributorAdded {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorAdded); ok {\n\t\t\treturn x.RepositoryContributorAdded\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryContributorRoleChanged() *PayloadRepositoryContributorRoleChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRoleChanged); ok {\n\t\t\treturn x.RepositoryContributorRoleChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryContributorRolesChanged() *PayloadRepositoryContributorRolesChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRolesChanged); ok {\n\t\t\treturn x.RepositoryContributorRolesChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryContributorRemoved() *PayloadRepositoryContributorRemoved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRemoved); ok {\n\t\t\treturn x.RepositoryContributorRemoved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryVisibilityChanged() *PayloadRepositoryVisibilityChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryVisibilityChanged); ok {\n\t\t\treturn x.RepositoryVisibilityChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryDefaultLabelNameChanged() *PayloadRepositoryDefaultLabelNameChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryDefaultLabelNameChanged); ok {\n\t\t\treturn x.RepositoryDefaultLabelNameChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryIdpGroupAdded() *PayloadRepositoryIDPGroupAdded {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupAdded); ok {\n\t\t\treturn x.RepositoryIdpGroupAdded\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryIdpGroupUpdated() *PayloadRepositoryIDPGroupUpdated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupUpdated); ok {\n\t\t\treturn x.RepositoryIdpGroupUpdated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryIdpGroupRemoved() *PayloadRepositoryIDPGroupRemoved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupRemoved); ok {\n\t\t\treturn x.RepositoryIdpGroupRemoved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyCreated() *PayloadPolicyCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyCreated); ok {\n\t\t\treturn x.PolicyCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyDeleted() *PayloadPolicyDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyDeleted); ok {\n\t\t\treturn x.PolicyDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyDeprecated() *PayloadPolicyDeprecated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyDeprecated); ok {\n\t\t\treturn x.PolicyDeprecated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyUndeprecated() *PayloadPolicyUndeprecated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyUndeprecated); ok {\n\t\t\treturn x.PolicyUndeprecated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyVisibilityChanged() *PayloadPolicyVisibilityChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyVisibilityChanged); ok {\n\t\t\treturn x.PolicyVisibilityChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyCommitPushed() *PayloadPolicyCommitPushed {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyCommitPushed); ok {\n\t\t\treturn x.PolicyCommitPushed\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyLabelCreated() *PayloadPolicyLabelCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyLabelCreated); ok {\n\t\t\treturn x.PolicyLabelCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyLabelMoved() *PayloadPolicyLabelMoved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyLabelMoved); ok {\n\t\t\treturn x.PolicyLabelMoved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyLabelArchived() *PayloadPolicyLabelArchived {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyLabelArchived); ok {\n\t\t\treturn x.PolicyLabelArchived\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyLabelUnarchived() *PayloadPolicyLabelUnarchived {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyLabelUnarchived); ok {\n\t\t\treturn x.PolicyLabelUnarchived\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginCreated() *PayloadPluginCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginCreated); ok {\n\t\t\treturn x.PluginCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginDeleted() *PayloadPluginDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginDeleted); ok {\n\t\t\treturn x.PluginDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginDeprecated() *PayloadPluginDeprecated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginDeprecated); ok {\n\t\t\treturn x.PluginDeprecated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginUndeprecated() *PayloadPluginUndeprecated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginUndeprecated); ok {\n\t\t\treturn x.PluginUndeprecated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginVisibilityChanged() *PayloadPluginVisibilityChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginVisibilityChanged); ok {\n\t\t\treturn x.PluginVisibilityChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginCommitPushed() *PayloadPluginCommitPushed {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginCommitPushed); ok {\n\t\t\treturn x.PluginCommitPushed\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetUserCreated() *PayloadUserCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_UserCreated); ok {\n\t\t\treturn x.UserCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetUserDeactivated() *PayloadUserDeactivated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_UserDeactivated); ok {\n\t\t\treturn x.UserDeactivated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetUserDeleted() *PayloadUserDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_UserDeleted); ok {\n\t\t\treturn x.UserDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetUserLoggedIn() *PayloadUserLoggedIn {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_UserLoggedIn); ok {\n\t\t\treturn x.UserLoggedIn\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetUserLoggedOut() *PayloadUserLoggedOut {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_UserLoggedOut); ok {\n\t\t\treturn x.UserLoggedOut\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetCuratedPluginCreated() *PayloadCuratedPluginCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_CuratedPluginCreated); ok {\n\t\t\treturn x.CuratedPluginCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetIdpGroupAdded() *PayloadOrganizationIDPGroupAdded {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_IdpGroupAdded); ok {\n\t\t\treturn x.IdpGroupAdded\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetIdpGroupUpdated() *PayloadOrganizationIDPGroupUpdated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_IdpGroupUpdated); ok {\n\t\t\treturn x.IdpGroupUpdated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetIdpGroupRemoved() *PayloadOrganizationIDPGroupRemoved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_IdpGroupRemoved); ok {\n\t\t\treturn x.IdpGroupRemoved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetTokenCreated() *PayloadTokenCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_TokenCreated); ok {\n\t\t\treturn x.TokenCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetTokenDeleted() *PayloadTokenDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_TokenDeleted); ok {\n\t\t\treturn x.TokenDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetUserReactivated() *PayloadUserReactivated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_UserReactivated); ok {\n\t\t\treturn x.UserReactivated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetScimTokenCreated() *PayloadSCIMTokenCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_ScimTokenCreated); ok {\n\t\t\treturn x.ScimTokenCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetScimTokenDeleted() *PayloadSCIMTokenDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_ScimTokenDeleted); ok {\n\t\t\treturn x.ScimTokenDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) GetRepositoryCommitDeleted() *PayloadRepositoryCommitDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryCommitDeleted); ok {\n\t\t\treturn x.RepositoryCommitDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryLabelCreated() *PayloadRepositoryLabelCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelCreated); ok {\n\t\t\treturn x.RepositoryLabelCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryLabelMoved() *PayloadRepositoryLabelMoved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelMoved); ok {\n\t\t\treturn x.RepositoryLabelMoved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryLabelArchived() *PayloadRepositoryLabelArchived {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelArchived); ok {\n\t\t\treturn x.RepositoryLabelArchived\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryLabelUnarchived() *PayloadRepositoryLabelUnarchived {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelUnarchived); ok {\n\t\t\treturn x.RepositoryLabelUnarchived\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetRepositoryLabelEnforcementIgnoresChanged() *PayloadRepositoryLabelEnforcementIgnoresChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelEnforcementIgnoresChanged); ok {\n\t\t\treturn x.RepositoryLabelEnforcementIgnoresChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetCuratedPluginDeleted() *PayloadCuratedPluginDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_CuratedPluginDeleted); ok {\n\t\t\treturn x.CuratedPluginDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetCuratedPluginStatusUpdated() *PayloadCuratedPluginStatusUpdated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_CuratedPluginStatusUpdated); ok {\n\t\t\treturn x.CuratedPluginStatusUpdated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPayloadServerBreakingChangePolicyEnabled() *PayloadServerBreakingChangePolicyEnabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PayloadServerBreakingChangePolicyEnabled); ok {\n\t\t\treturn x.PayloadServerBreakingChangePolicyEnabled\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPayloadServerBreakingChangePolicyDisabled() *PayloadServerBreakingChangePolicyDisabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PayloadServerBreakingChangePolicyDisabled); ok {\n\t\t\treturn x.PayloadServerBreakingChangePolicyDisabled\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) GetRepositoryDefaultBranchChanged() *PayloadRepositoryDefaultBranchChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_RepositoryDefaultBranchChanged); ok {\n\t\t\treturn x.RepositoryDefaultBranchChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPayloadServerUniquenessPolicyEnabled() *PayloadServerUniquenessPolicyEnabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PayloadServerUniquenessPolicyEnabled); ok {\n\t\t\treturn x.PayloadServerUniquenessPolicyEnabled\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPayloadServerUniquenessPolicyDisabled() *PayloadServerUniquenessPolicyDisabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PayloadServerUniquenessPolicyDisabled); ok {\n\t\t\treturn x.PayloadServerUniquenessPolicyDisabled\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetServerResourceVisibilityControlChanged() *PayloadServerResourceVisibilityControlChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_ServerResourceVisibilityControlChanged); ok {\n\t\t\treturn x.ServerResourceVisibilityControlChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetUserAutoMergedFromNewIdp() *PayloadUserAutoMergedFromNewIdP {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_UserAutoMergedFromNewIdp); ok {\n\t\t\treturn x.UserAutoMergedFromNewIdp\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetDeviceAuthorizationGrantApproved() *PayloadDeviceAuthorizationGrantApproved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_DeviceAuthorizationGrantApproved); ok {\n\t\t\treturn x.DeviceAuthorizationGrantApproved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetDeviceAuthorizationGrantDenied() *PayloadDeviceAuthorizationGrantDenied {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_DeviceAuthorizationGrantDenied); ok {\n\t\t\treturn x.DeviceAuthorizationGrantDenied\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginLabelCreated() *PayloadPluginLabelCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginLabelCreated); ok {\n\t\t\treturn x.PluginLabelCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginLabelMoved() *PayloadPluginLabelMoved {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginLabelMoved); ok {\n\t\t\treturn x.PluginLabelMoved\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginLabelArchived() *PayloadPluginLabelArchived {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginLabelArchived); ok {\n\t\t\treturn x.PluginLabelArchived\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPluginLabelUnarchived() *PayloadPluginLabelUnarchived {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PluginLabelUnarchived); ok {\n\t\t\treturn x.PluginLabelUnarchived\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetServerReviewFlowEnabled() *PayloadServerReviewFlowEnabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_ServerReviewFlowEnabled); ok {\n\t\t\treturn x.ServerReviewFlowEnabled\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetServerReviewFlowDisabled() *PayloadServerReviewFlowDisabled {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_ServerReviewFlowDisabled); ok {\n\t\t\treturn x.ServerReviewFlowDisabled\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetSdkPluginConstraintCreated() *PayloadSDKPluginConstraintCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintCreated); ok {\n\t\t\treturn x.SdkPluginConstraintCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetSdkPluginConstraintUpdated() *PayloadSDKPluginConstraintUpdated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintUpdated); ok {\n\t\t\treturn x.SdkPluginConstraintUpdated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetSdkPluginConstraintDeleted() *PayloadSDKPluginConstraintDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintDeleted); ok {\n\t\t\treturn x.SdkPluginConstraintDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyEnforcementCreated() *PayloadPolicyEnforcementCreated {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementCreated); ok {\n\t\t\treturn x.PolicyEnforcementCreated\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyEnforcementDeleted() *PayloadPolicyEnforcementDeleted {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementDeleted); ok {\n\t\t\treturn x.PolicyEnforcementDeleted\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyEnforcementPolicyChanged() *PayloadPolicyEnforcementPolicyChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementPolicyChanged); ok {\n\t\t\treturn x.PolicyEnforcementPolicyChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) GetPolicyEnforcementTargetsChanged() *PayloadPolicyEnforcementTargetsChanged {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementTargetsChanged); ok {\n\t\t\treturn x.PolicyEnforcementTargetsChanged\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Event) SetEventId(v string) {\n\tx.xxx_hidden_EventId = v\n}\n\nfunc (x *Event) SetType(v EventType) {\n\tx.xxx_hidden_Type = v\n}\n\nfunc (x *Event) SetActor(v *Actor) {\n\tx.xxx_hidden_Actor = v\n}\n\nfunc (x *Event) SetResource(v *Resource) {\n\tx.xxx_hidden_Resource = v\n}\n\nfunc (x *Event) SetEventTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_EventTime = v\n}\n\nfunc (x *Event) SetMetadata(v *EventMetadata) {\n\tx.xxx_hidden_Metadata = v\n}\n\nfunc (x *Event) SetOrganizationCreated(v *PayloadOrganizationCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationCreated{v}\n}\n\nfunc (x *Event) SetOrganizationDeleted(v *PayloadOrganizationDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationDeleted{v}\n}\n\nfunc (x *Event) SetOrganizationMemberAdded(v *PayloadOrganizationMemberAdded) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationMemberAdded{v}\n}\n\nfunc (x *Event) SetOrganizationMemberRoleChanged(v *PayloadOrganizationMemberRoleChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationMemberRoleChanged{v}\n}\n\nfunc (x *Event) SetOrganizationMemberRolesChanged(v *PayloadOrganizationMemberRolesChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationMemberRolesChanged{v}\n}\n\nfunc (x *Event) SetOrganizationMemberRemoved(v *PayloadOrganizationMemberRemoved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationMemberRemoved{v}\n}\n\nfunc (x *Event) SetOrganizationResourceVisibilityControlChanged(v *PayloadOrganizationResourceVisibilityControlChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationResourceVisibilityControlChanged{v}\n}\n\nfunc (x *Event) SetOrganizationUniquenessPolicyEnabled(v *PayloadOrganizationUniquenessPolicyEnabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationUniquenessPolicyEnabled{v}\n}\n\nfunc (x *Event) SetOrganizationUniquenessPolicyDisabled(v *PayloadOrganizationUniquenessPolicyDisabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_OrganizationUniquenessPolicyDisabled{v}\n}\n\nfunc (x *Event) SetRepositoryCreated(v *PayloadRepositoryCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryCreated{v}\n}\n\nfunc (x *Event) SetRepositoryDeprecated(v *PayloadRepositoryDeprecated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryDeprecated{v}\n}\n\nfunc (x *Event) SetRepositoryUndeprecated(v *PayloadRepositoryUndeprecated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryUndeprecated{v}\n}\n\nfunc (x *Event) SetRepositoryDeleted(v *PayloadRepositoryDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryDeleted{v}\n}\n\nfunc (x *Event) SetRepositoryCommitPushed(v *PayloadRepositoryCommitPushed) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryCommitPushed{v}\n}\n\nfunc (x *Event) SetRepositoryContributorAdded(v *PayloadRepositoryContributorAdded) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryContributorAdded{v}\n}\n\nfunc (x *Event) SetRepositoryContributorRoleChanged(v *PayloadRepositoryContributorRoleChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryContributorRoleChanged{v}\n}\n\nfunc (x *Event) SetRepositoryContributorRolesChanged(v *PayloadRepositoryContributorRolesChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryContributorRolesChanged{v}\n}\n\nfunc (x *Event) SetRepositoryContributorRemoved(v *PayloadRepositoryContributorRemoved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryContributorRemoved{v}\n}\n\nfunc (x *Event) SetRepositoryVisibilityChanged(v *PayloadRepositoryVisibilityChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryVisibilityChanged{v}\n}\n\nfunc (x *Event) SetRepositoryDefaultLabelNameChanged(v *PayloadRepositoryDefaultLabelNameChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryDefaultLabelNameChanged{v}\n}\n\nfunc (x *Event) SetRepositoryIdpGroupAdded(v *PayloadRepositoryIDPGroupAdded) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryIdpGroupAdded{v}\n}\n\nfunc (x *Event) SetRepositoryIdpGroupUpdated(v *PayloadRepositoryIDPGroupUpdated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryIdpGroupUpdated{v}\n}\n\nfunc (x *Event) SetRepositoryIdpGroupRemoved(v *PayloadRepositoryIDPGroupRemoved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryIdpGroupRemoved{v}\n}\n\nfunc (x *Event) SetPolicyCreated(v *PayloadPolicyCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyCreated{v}\n}\n\nfunc (x *Event) SetPolicyDeleted(v *PayloadPolicyDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyDeleted{v}\n}\n\nfunc (x *Event) SetPolicyDeprecated(v *PayloadPolicyDeprecated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyDeprecated{v}\n}\n\nfunc (x *Event) SetPolicyUndeprecated(v *PayloadPolicyUndeprecated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyUndeprecated{v}\n}\n\nfunc (x *Event) SetPolicyVisibilityChanged(v *PayloadPolicyVisibilityChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyVisibilityChanged{v}\n}\n\nfunc (x *Event) SetPolicyCommitPushed(v *PayloadPolicyCommitPushed) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyCommitPushed{v}\n}\n\nfunc (x *Event) SetPolicyLabelCreated(v *PayloadPolicyLabelCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyLabelCreated{v}\n}\n\nfunc (x *Event) SetPolicyLabelMoved(v *PayloadPolicyLabelMoved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyLabelMoved{v}\n}\n\nfunc (x *Event) SetPolicyLabelArchived(v *PayloadPolicyLabelArchived) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyLabelArchived{v}\n}\n\nfunc (x *Event) SetPolicyLabelUnarchived(v *PayloadPolicyLabelUnarchived) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyLabelUnarchived{v}\n}\n\nfunc (x *Event) SetPluginCreated(v *PayloadPluginCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginCreated{v}\n}\n\nfunc (x *Event) SetPluginDeleted(v *PayloadPluginDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginDeleted{v}\n}\n\nfunc (x *Event) SetPluginDeprecated(v *PayloadPluginDeprecated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginDeprecated{v}\n}\n\nfunc (x *Event) SetPluginUndeprecated(v *PayloadPluginUndeprecated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginUndeprecated{v}\n}\n\nfunc (x *Event) SetPluginVisibilityChanged(v *PayloadPluginVisibilityChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginVisibilityChanged{v}\n}\n\nfunc (x *Event) SetPluginCommitPushed(v *PayloadPluginCommitPushed) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginCommitPushed{v}\n}\n\nfunc (x *Event) SetUserCreated(v *PayloadUserCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_UserCreated{v}\n}\n\nfunc (x *Event) SetUserDeactivated(v *PayloadUserDeactivated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_UserDeactivated{v}\n}\n\nfunc (x *Event) SetUserDeleted(v *PayloadUserDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_UserDeleted{v}\n}\n\nfunc (x *Event) SetUserLoggedIn(v *PayloadUserLoggedIn) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_UserLoggedIn{v}\n}\n\nfunc (x *Event) SetUserLoggedOut(v *PayloadUserLoggedOut) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_UserLoggedOut{v}\n}\n\nfunc (x *Event) SetCuratedPluginCreated(v *PayloadCuratedPluginCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_CuratedPluginCreated{v}\n}\n\nfunc (x *Event) SetIdpGroupAdded(v *PayloadOrganizationIDPGroupAdded) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_IdpGroupAdded{v}\n}\n\nfunc (x *Event) SetIdpGroupUpdated(v *PayloadOrganizationIDPGroupUpdated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_IdpGroupUpdated{v}\n}\n\nfunc (x *Event) SetIdpGroupRemoved(v *PayloadOrganizationIDPGroupRemoved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_IdpGroupRemoved{v}\n}\n\nfunc (x *Event) SetTokenCreated(v *PayloadTokenCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_TokenCreated{v}\n}\n\nfunc (x *Event) SetTokenDeleted(v *PayloadTokenDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_TokenDeleted{v}\n}\n\nfunc (x *Event) SetUserReactivated(v *PayloadUserReactivated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_UserReactivated{v}\n}\n\nfunc (x *Event) SetScimTokenCreated(v *PayloadSCIMTokenCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_ScimTokenCreated{v}\n}\n\nfunc (x *Event) SetScimTokenDeleted(v *PayloadSCIMTokenDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_ScimTokenDeleted{v}\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) SetRepositoryCommitDeleted(v *PayloadRepositoryCommitDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryCommitDeleted{v}\n}\n\nfunc (x *Event) SetRepositoryLabelCreated(v *PayloadRepositoryLabelCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryLabelCreated{v}\n}\n\nfunc (x *Event) SetRepositoryLabelMoved(v *PayloadRepositoryLabelMoved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryLabelMoved{v}\n}\n\nfunc (x *Event) SetRepositoryLabelArchived(v *PayloadRepositoryLabelArchived) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryLabelArchived{v}\n}\n\nfunc (x *Event) SetRepositoryLabelUnarchived(v *PayloadRepositoryLabelUnarchived) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryLabelUnarchived{v}\n}\n\nfunc (x *Event) SetRepositoryLabelEnforcementIgnoresChanged(v *PayloadRepositoryLabelEnforcementIgnoresChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryLabelEnforcementIgnoresChanged{v}\n}\n\nfunc (x *Event) SetCuratedPluginDeleted(v *PayloadCuratedPluginDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_CuratedPluginDeleted{v}\n}\n\nfunc (x *Event) SetCuratedPluginStatusUpdated(v *PayloadCuratedPluginStatusUpdated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_CuratedPluginStatusUpdated{v}\n}\n\nfunc (x *Event) SetPayloadServerBreakingChangePolicyEnabled(v *PayloadServerBreakingChangePolicyEnabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PayloadServerBreakingChangePolicyEnabled{v}\n}\n\nfunc (x *Event) SetPayloadServerBreakingChangePolicyDisabled(v *PayloadServerBreakingChangePolicyDisabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PayloadServerBreakingChangePolicyDisabled{v}\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) SetRepositoryDefaultBranchChanged(v *PayloadRepositoryDefaultBranchChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_RepositoryDefaultBranchChanged{v}\n}\n\nfunc (x *Event) SetPayloadServerUniquenessPolicyEnabled(v *PayloadServerUniquenessPolicyEnabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PayloadServerUniquenessPolicyEnabled{v}\n}\n\nfunc (x *Event) SetPayloadServerUniquenessPolicyDisabled(v *PayloadServerUniquenessPolicyDisabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PayloadServerUniquenessPolicyDisabled{v}\n}\n\nfunc (x *Event) SetServerResourceVisibilityControlChanged(v *PayloadServerResourceVisibilityControlChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_ServerResourceVisibilityControlChanged{v}\n}\n\nfunc (x *Event) SetUserAutoMergedFromNewIdp(v *PayloadUserAutoMergedFromNewIdP) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_UserAutoMergedFromNewIdp{v}\n}\n\nfunc (x *Event) SetDeviceAuthorizationGrantApproved(v *PayloadDeviceAuthorizationGrantApproved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_DeviceAuthorizationGrantApproved{v}\n}\n\nfunc (x *Event) SetDeviceAuthorizationGrantDenied(v *PayloadDeviceAuthorizationGrantDenied) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_DeviceAuthorizationGrantDenied{v}\n}\n\nfunc (x *Event) SetPluginLabelCreated(v *PayloadPluginLabelCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginLabelCreated{v}\n}\n\nfunc (x *Event) SetPluginLabelMoved(v *PayloadPluginLabelMoved) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginLabelMoved{v}\n}\n\nfunc (x *Event) SetPluginLabelArchived(v *PayloadPluginLabelArchived) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginLabelArchived{v}\n}\n\nfunc (x *Event) SetPluginLabelUnarchived(v *PayloadPluginLabelUnarchived) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PluginLabelUnarchived{v}\n}\n\nfunc (x *Event) SetServerReviewFlowEnabled(v *PayloadServerReviewFlowEnabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_ServerReviewFlowEnabled{v}\n}\n\nfunc (x *Event) SetServerReviewFlowDisabled(v *PayloadServerReviewFlowDisabled) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_ServerReviewFlowDisabled{v}\n}\n\nfunc (x *Event) SetSdkPluginConstraintCreated(v *PayloadSDKPluginConstraintCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_SdkPluginConstraintCreated{v}\n}\n\nfunc (x *Event) SetSdkPluginConstraintUpdated(v *PayloadSDKPluginConstraintUpdated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_SdkPluginConstraintUpdated{v}\n}\n\nfunc (x *Event) SetSdkPluginConstraintDeleted(v *PayloadSDKPluginConstraintDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_SdkPluginConstraintDeleted{v}\n}\n\nfunc (x *Event) SetPolicyEnforcementCreated(v *PayloadPolicyEnforcementCreated) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyEnforcementCreated{v}\n}\n\nfunc (x *Event) SetPolicyEnforcementDeleted(v *PayloadPolicyEnforcementDeleted) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyEnforcementDeleted{v}\n}\n\nfunc (x *Event) SetPolicyEnforcementPolicyChanged(v *PayloadPolicyEnforcementPolicyChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyEnforcementPolicyChanged{v}\n}\n\nfunc (x *Event) SetPolicyEnforcementTargetsChanged(v *PayloadPolicyEnforcementTargetsChanged) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &event_PolicyEnforcementTargetsChanged{v}\n}\n\nfunc (x *Event) HasActor() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Actor != nil\n}\n\nfunc (x *Event) HasResource() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Resource != nil\n}\n\nfunc (x *Event) HasEventTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_EventTime != nil\n}\n\nfunc (x *Event) HasMetadata() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Metadata != nil\n}\n\nfunc (x *Event) HasPayload() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Payload != nil\n}\n\nfunc (x *Event) HasOrganizationCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationMemberAdded() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberAdded)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationMemberRoleChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRoleChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationMemberRolesChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRolesChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationMemberRemoved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRemoved)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationResourceVisibilityControlChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationResourceVisibilityControlChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationUniquenessPolicyEnabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationUniquenessPolicyEnabled)\n\treturn ok\n}\n\nfunc (x *Event) HasOrganizationUniquenessPolicyDisabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_OrganizationUniquenessPolicyDisabled)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryDeprecated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryDeprecated)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryUndeprecated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryUndeprecated)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryCommitPushed() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryCommitPushed)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryContributorAdded() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorAdded)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryContributorRoleChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRoleChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryContributorRolesChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRolesChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryContributorRemoved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRemoved)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryVisibilityChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryVisibilityChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryDefaultLabelNameChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryDefaultLabelNameChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryIdpGroupAdded() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupAdded)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryIdpGroupUpdated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupUpdated)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryIdpGroupRemoved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupRemoved)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyDeprecated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyDeprecated)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyUndeprecated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyUndeprecated)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyVisibilityChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyVisibilityChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyCommitPushed() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyCommitPushed)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyLabelCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyLabelCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyLabelMoved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyLabelMoved)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyLabelArchived() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyLabelArchived)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyLabelUnarchived() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyLabelUnarchived)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginDeprecated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginDeprecated)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginUndeprecated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginUndeprecated)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginVisibilityChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginVisibilityChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginCommitPushed() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginCommitPushed)\n\treturn ok\n}\n\nfunc (x *Event) HasUserCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_UserCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasUserDeactivated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_UserDeactivated)\n\treturn ok\n}\n\nfunc (x *Event) HasUserDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_UserDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasUserLoggedIn() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_UserLoggedIn)\n\treturn ok\n}\n\nfunc (x *Event) HasUserLoggedOut() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_UserLoggedOut)\n\treturn ok\n}\n\nfunc (x *Event) HasCuratedPluginCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_CuratedPluginCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasIdpGroupAdded() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_IdpGroupAdded)\n\treturn ok\n}\n\nfunc (x *Event) HasIdpGroupUpdated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_IdpGroupUpdated)\n\treturn ok\n}\n\nfunc (x *Event) HasIdpGroupRemoved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_IdpGroupRemoved)\n\treturn ok\n}\n\nfunc (x *Event) HasTokenCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_TokenCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasTokenDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_TokenDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasUserReactivated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_UserReactivated)\n\treturn ok\n}\n\nfunc (x *Event) HasScimTokenCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_ScimTokenCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasScimTokenDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_ScimTokenDeleted)\n\treturn ok\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) HasRepositoryCommitDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryCommitDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryLabelCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryLabelMoved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelMoved)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryLabelArchived() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelArchived)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryLabelUnarchived() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelUnarchived)\n\treturn ok\n}\n\nfunc (x *Event) HasRepositoryLabelEnforcementIgnoresChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelEnforcementIgnoresChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasCuratedPluginDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_CuratedPluginDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasCuratedPluginStatusUpdated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_CuratedPluginStatusUpdated)\n\treturn ok\n}\n\nfunc (x *Event) HasPayloadServerBreakingChangePolicyEnabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PayloadServerBreakingChangePolicyEnabled)\n\treturn ok\n}\n\nfunc (x *Event) HasPayloadServerBreakingChangePolicyDisabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PayloadServerBreakingChangePolicyDisabled)\n\treturn ok\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) HasRepositoryDefaultBranchChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_RepositoryDefaultBranchChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasPayloadServerUniquenessPolicyEnabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PayloadServerUniquenessPolicyEnabled)\n\treturn ok\n}\n\nfunc (x *Event) HasPayloadServerUniquenessPolicyDisabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PayloadServerUniquenessPolicyDisabled)\n\treturn ok\n}\n\nfunc (x *Event) HasServerResourceVisibilityControlChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_ServerResourceVisibilityControlChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasUserAutoMergedFromNewIdp() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_UserAutoMergedFromNewIdp)\n\treturn ok\n}\n\nfunc (x *Event) HasDeviceAuthorizationGrantApproved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_DeviceAuthorizationGrantApproved)\n\treturn ok\n}\n\nfunc (x *Event) HasDeviceAuthorizationGrantDenied() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_DeviceAuthorizationGrantDenied)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginLabelCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginLabelCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginLabelMoved() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginLabelMoved)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginLabelArchived() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginLabelArchived)\n\treturn ok\n}\n\nfunc (x *Event) HasPluginLabelUnarchived() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PluginLabelUnarchived)\n\treturn ok\n}\n\nfunc (x *Event) HasServerReviewFlowEnabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_ServerReviewFlowEnabled)\n\treturn ok\n}\n\nfunc (x *Event) HasServerReviewFlowDisabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_ServerReviewFlowDisabled)\n\treturn ok\n}\n\nfunc (x *Event) HasSdkPluginConstraintCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasSdkPluginConstraintUpdated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintUpdated)\n\treturn ok\n}\n\nfunc (x *Event) HasSdkPluginConstraintDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyEnforcementCreated() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementCreated)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyEnforcementDeleted() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementDeleted)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyEnforcementPolicyChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementPolicyChanged)\n\treturn ok\n}\n\nfunc (x *Event) HasPolicyEnforcementTargetsChanged() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementTargetsChanged)\n\treturn ok\n}\n\nfunc (x *Event) ClearActor() {\n\tx.xxx_hidden_Actor = nil\n}\n\nfunc (x *Event) ClearResource() {\n\tx.xxx_hidden_Resource = nil\n}\n\nfunc (x *Event) ClearEventTime() {\n\tx.xxx_hidden_EventTime = nil\n}\n\nfunc (x *Event) ClearMetadata() {\n\tx.xxx_hidden_Metadata = nil\n}\n\nfunc (x *Event) ClearPayload() {\n\tx.xxx_hidden_Payload = nil\n}\n\nfunc (x *Event) ClearOrganizationCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationMemberAdded() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberAdded); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationMemberRoleChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRoleChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationMemberRolesChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRolesChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationMemberRemoved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationMemberRemoved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationResourceVisibilityControlChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationResourceVisibilityControlChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationUniquenessPolicyEnabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationUniquenessPolicyEnabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearOrganizationUniquenessPolicyDisabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_OrganizationUniquenessPolicyDisabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryDeprecated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryDeprecated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryUndeprecated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryUndeprecated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryCommitPushed() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryCommitPushed); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryContributorAdded() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorAdded); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryContributorRoleChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRoleChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryContributorRolesChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRolesChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryContributorRemoved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryContributorRemoved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryVisibilityChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryVisibilityChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryDefaultLabelNameChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryDefaultLabelNameChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryIdpGroupAdded() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupAdded); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryIdpGroupUpdated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupUpdated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryIdpGroupRemoved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryIdpGroupRemoved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyDeprecated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyDeprecated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyUndeprecated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyUndeprecated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyVisibilityChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyVisibilityChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyCommitPushed() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyCommitPushed); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyLabelCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyLabelCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyLabelMoved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyLabelMoved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyLabelArchived() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyLabelArchived); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyLabelUnarchived() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyLabelUnarchived); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginDeprecated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginDeprecated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginUndeprecated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginUndeprecated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginVisibilityChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginVisibilityChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginCommitPushed() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginCommitPushed); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearUserCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_UserCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearUserDeactivated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_UserDeactivated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearUserDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_UserDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearUserLoggedIn() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_UserLoggedIn); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearUserLoggedOut() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_UserLoggedOut); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearCuratedPluginCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_CuratedPluginCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearIdpGroupAdded() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_IdpGroupAdded); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearIdpGroupUpdated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_IdpGroupUpdated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearIdpGroupRemoved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_IdpGroupRemoved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearTokenCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_TokenCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearTokenDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_TokenDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearUserReactivated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_UserReactivated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearScimTokenCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_ScimTokenCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearScimTokenDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_ScimTokenDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) ClearRepositoryCommitDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryCommitDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryLabelCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryLabelMoved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelMoved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryLabelArchived() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelArchived); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryLabelUnarchived() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelUnarchived); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearRepositoryLabelEnforcementIgnoresChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryLabelEnforcementIgnoresChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearCuratedPluginDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_CuratedPluginDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearCuratedPluginStatusUpdated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_CuratedPluginStatusUpdated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPayloadServerBreakingChangePolicyEnabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PayloadServerBreakingChangePolicyEnabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPayloadServerBreakingChangePolicyDisabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PayloadServerBreakingChangePolicyDisabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *Event) ClearRepositoryDefaultBranchChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_RepositoryDefaultBranchChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPayloadServerUniquenessPolicyEnabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PayloadServerUniquenessPolicyEnabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPayloadServerUniquenessPolicyDisabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PayloadServerUniquenessPolicyDisabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearServerResourceVisibilityControlChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_ServerResourceVisibilityControlChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearUserAutoMergedFromNewIdp() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_UserAutoMergedFromNewIdp); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearDeviceAuthorizationGrantApproved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_DeviceAuthorizationGrantApproved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearDeviceAuthorizationGrantDenied() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_DeviceAuthorizationGrantDenied); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginLabelCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginLabelCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginLabelMoved() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginLabelMoved); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginLabelArchived() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginLabelArchived); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPluginLabelUnarchived() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PluginLabelUnarchived); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearServerReviewFlowEnabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_ServerReviewFlowEnabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearServerReviewFlowDisabled() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_ServerReviewFlowDisabled); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearSdkPluginConstraintCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearSdkPluginConstraintUpdated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintUpdated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearSdkPluginConstraintDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_SdkPluginConstraintDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyEnforcementCreated() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementCreated); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyEnforcementDeleted() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementDeleted); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyEnforcementPolicyChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementPolicyChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nfunc (x *Event) ClearPolicyEnforcementTargetsChanged() {\n\tif _, ok := x.xxx_hidden_Payload.(*event_PolicyEnforcementTargetsChanged); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nconst Event_Payload_not_set_case case_Event_Payload = 0\nconst Event_OrganizationCreated_case case_Event_Payload = 7\nconst Event_OrganizationDeleted_case case_Event_Payload = 8\nconst Event_OrganizationMemberAdded_case case_Event_Payload = 9\nconst Event_OrganizationMemberRoleChanged_case case_Event_Payload = 10\nconst Event_OrganizationMemberRolesChanged_case case_Event_Payload = 56\nconst Event_OrganizationMemberRemoved_case case_Event_Payload = 11\nconst Event_OrganizationResourceVisibilityControlChanged_case case_Event_Payload = 87\nconst Event_OrganizationUniquenessPolicyEnabled_case case_Event_Payload = 88\nconst Event_OrganizationUniquenessPolicyDisabled_case case_Event_Payload = 89\nconst Event_RepositoryCreated_case case_Event_Payload = 12\nconst Event_RepositoryDeprecated_case case_Event_Payload = 54\nconst Event_RepositoryUndeprecated_case case_Event_Payload = 55\nconst Event_RepositoryDeleted_case case_Event_Payload = 13\nconst Event_RepositoryCommitPushed_case case_Event_Payload = 14\nconst Event_RepositoryContributorAdded_case case_Event_Payload = 15\nconst Event_RepositoryContributorRoleChanged_case case_Event_Payload = 16\nconst Event_RepositoryContributorRolesChanged_case case_Event_Payload = 69\nconst Event_RepositoryContributorRemoved_case case_Event_Payload = 17\nconst Event_RepositoryVisibilityChanged_case case_Event_Payload = 18\nconst Event_RepositoryDefaultLabelNameChanged_case case_Event_Payload = 46\nconst Event_RepositoryIdpGroupAdded_case case_Event_Payload = 66\nconst Event_RepositoryIdpGroupUpdated_case case_Event_Payload = 67\nconst Event_RepositoryIdpGroupRemoved_case case_Event_Payload = 68\nconst Event_PolicyCreated_case case_Event_Payload = 60\nconst Event_PolicyDeleted_case case_Event_Payload = 61\nconst Event_PolicyDeprecated_case case_Event_Payload = 62\nconst Event_PolicyUndeprecated_case case_Event_Payload = 63\nconst Event_PolicyVisibilityChanged_case case_Event_Payload = 64\nconst Event_PolicyCommitPushed_case case_Event_Payload = 70\nconst Event_PolicyLabelCreated_case case_Event_Payload = 71\nconst Event_PolicyLabelMoved_case case_Event_Payload = 72\nconst Event_PolicyLabelArchived_case case_Event_Payload = 73\nconst Event_PolicyLabelUnarchived_case case_Event_Payload = 74\nconst Event_PluginCreated_case case_Event_Payload = 19\nconst Event_PluginDeleted_case case_Event_Payload = 20\nconst Event_PluginDeprecated_case case_Event_Payload = 57\nconst Event_PluginUndeprecated_case case_Event_Payload = 58\nconst Event_PluginVisibilityChanged_case case_Event_Payload = 59\nconst Event_PluginCommitPushed_case case_Event_Payload = 49\nconst Event_UserCreated_case case_Event_Payload = 21\nconst Event_UserDeactivated_case case_Event_Payload = 22\nconst Event_UserDeleted_case case_Event_Payload = 23\nconst Event_UserLoggedIn_case case_Event_Payload = 24\nconst Event_UserLoggedOut_case case_Event_Payload = 25\nconst Event_CuratedPluginCreated_case case_Event_Payload = 26\nconst Event_IdpGroupAdded_case case_Event_Payload = 27\nconst Event_IdpGroupUpdated_case case_Event_Payload = 65\nconst Event_IdpGroupRemoved_case case_Event_Payload = 28\nconst Event_TokenCreated_case case_Event_Payload = 29\nconst Event_TokenDeleted_case case_Event_Payload = 30\nconst Event_UserReactivated_case case_Event_Payload = 31\nconst Event_ScimTokenCreated_case case_Event_Payload = 32\nconst Event_ScimTokenDeleted_case case_Event_Payload = 33\nconst Event_RepositoryCommitDeleted_case case_Event_Payload = 34\nconst Event_RepositoryLabelCreated_case case_Event_Payload = 35\nconst Event_RepositoryLabelMoved_case case_Event_Payload = 36\nconst Event_RepositoryLabelArchived_case case_Event_Payload = 44\nconst Event_RepositoryLabelUnarchived_case case_Event_Payload = 45\nconst Event_RepositoryLabelEnforcementIgnoresChanged_case case_Event_Payload = 85\nconst Event_CuratedPluginDeleted_case case_Event_Payload = 37\nconst Event_CuratedPluginStatusUpdated_case case_Event_Payload = 84\nconst Event_PayloadServerBreakingChangePolicyEnabled_case case_Event_Payload = 38\nconst Event_PayloadServerBreakingChangePolicyDisabled_case case_Event_Payload = 39\nconst Event_RepositoryDefaultBranchChanged_case case_Event_Payload = 40\nconst Event_PayloadServerUniquenessPolicyEnabled_case case_Event_Payload = 41\nconst Event_PayloadServerUniquenessPolicyDisabled_case case_Event_Payload = 42\nconst Event_ServerResourceVisibilityControlChanged_case case_Event_Payload = 86\nconst Event_UserAutoMergedFromNewIdp_case case_Event_Payload = 43\nconst Event_DeviceAuthorizationGrantApproved_case case_Event_Payload = 47\nconst Event_DeviceAuthorizationGrantDenied_case case_Event_Payload = 48\nconst Event_PluginLabelCreated_case case_Event_Payload = 50\nconst Event_PluginLabelMoved_case case_Event_Payload = 51\nconst Event_PluginLabelArchived_case case_Event_Payload = 52\nconst Event_PluginLabelUnarchived_case case_Event_Payload = 53\nconst Event_ServerReviewFlowEnabled_case case_Event_Payload = 75\nconst Event_ServerReviewFlowDisabled_case case_Event_Payload = 76\nconst Event_SdkPluginConstraintCreated_case case_Event_Payload = 77\nconst Event_SdkPluginConstraintUpdated_case case_Event_Payload = 78\nconst Event_SdkPluginConstraintDeleted_case case_Event_Payload = 79\nconst Event_PolicyEnforcementCreated_case case_Event_Payload = 80\nconst Event_PolicyEnforcementDeleted_case case_Event_Payload = 81\nconst Event_PolicyEnforcementPolicyChanged_case case_Event_Payload = 82\nconst Event_PolicyEnforcementTargetsChanged_case case_Event_Payload = 83\n\nfunc (x *Event) WhichPayload() case_Event_Payload {\n\tif x == nil {\n\t\treturn Event_Payload_not_set_case\n\t}\n\tswitch x.xxx_hidden_Payload.(type) {\n\tcase *event_OrganizationCreated:\n\t\treturn Event_OrganizationCreated_case\n\tcase *event_OrganizationDeleted:\n\t\treturn Event_OrganizationDeleted_case\n\tcase *event_OrganizationMemberAdded:\n\t\treturn Event_OrganizationMemberAdded_case\n\tcase *event_OrganizationMemberRoleChanged:\n\t\treturn Event_OrganizationMemberRoleChanged_case\n\tcase *event_OrganizationMemberRolesChanged:\n\t\treturn Event_OrganizationMemberRolesChanged_case\n\tcase *event_OrganizationMemberRemoved:\n\t\treturn Event_OrganizationMemberRemoved_case\n\tcase *event_OrganizationResourceVisibilityControlChanged:\n\t\treturn Event_OrganizationResourceVisibilityControlChanged_case\n\tcase *event_OrganizationUniquenessPolicyEnabled:\n\t\treturn Event_OrganizationUniquenessPolicyEnabled_case\n\tcase *event_OrganizationUniquenessPolicyDisabled:\n\t\treturn Event_OrganizationUniquenessPolicyDisabled_case\n\tcase *event_RepositoryCreated:\n\t\treturn Event_RepositoryCreated_case\n\tcase *event_RepositoryDeprecated:\n\t\treturn Event_RepositoryDeprecated_case\n\tcase *event_RepositoryUndeprecated:\n\t\treturn Event_RepositoryUndeprecated_case\n\tcase *event_RepositoryDeleted:\n\t\treturn Event_RepositoryDeleted_case\n\tcase *event_RepositoryCommitPushed:\n\t\treturn Event_RepositoryCommitPushed_case\n\tcase *event_RepositoryContributorAdded:\n\t\treturn Event_RepositoryContributorAdded_case\n\tcase *event_RepositoryContributorRoleChanged:\n\t\treturn Event_RepositoryContributorRoleChanged_case\n\tcase *event_RepositoryContributorRolesChanged:\n\t\treturn Event_RepositoryContributorRolesChanged_case\n\tcase *event_RepositoryContributorRemoved:\n\t\treturn Event_RepositoryContributorRemoved_case\n\tcase *event_RepositoryVisibilityChanged:\n\t\treturn Event_RepositoryVisibilityChanged_case\n\tcase *event_RepositoryDefaultLabelNameChanged:\n\t\treturn Event_RepositoryDefaultLabelNameChanged_case\n\tcase *event_RepositoryIdpGroupAdded:\n\t\treturn Event_RepositoryIdpGroupAdded_case\n\tcase *event_RepositoryIdpGroupUpdated:\n\t\treturn Event_RepositoryIdpGroupUpdated_case\n\tcase *event_RepositoryIdpGroupRemoved:\n\t\treturn Event_RepositoryIdpGroupRemoved_case\n\tcase *event_PolicyCreated:\n\t\treturn Event_PolicyCreated_case\n\tcase *event_PolicyDeleted:\n\t\treturn Event_PolicyDeleted_case\n\tcase *event_PolicyDeprecated:\n\t\treturn Event_PolicyDeprecated_case\n\tcase *event_PolicyUndeprecated:\n\t\treturn Event_PolicyUndeprecated_case\n\tcase *event_PolicyVisibilityChanged:\n\t\treturn Event_PolicyVisibilityChanged_case\n\tcase *event_PolicyCommitPushed:\n\t\treturn Event_PolicyCommitPushed_case\n\tcase *event_PolicyLabelCreated:\n\t\treturn Event_PolicyLabelCreated_case\n\tcase *event_PolicyLabelMoved:\n\t\treturn Event_PolicyLabelMoved_case\n\tcase *event_PolicyLabelArchived:\n\t\treturn Event_PolicyLabelArchived_case\n\tcase *event_PolicyLabelUnarchived:\n\t\treturn Event_PolicyLabelUnarchived_case\n\tcase *event_PluginCreated:\n\t\treturn Event_PluginCreated_case\n\tcase *event_PluginDeleted:\n\t\treturn Event_PluginDeleted_case\n\tcase *event_PluginDeprecated:\n\t\treturn Event_PluginDeprecated_case\n\tcase *event_PluginUndeprecated:\n\t\treturn Event_PluginUndeprecated_case\n\tcase *event_PluginVisibilityChanged:\n\t\treturn Event_PluginVisibilityChanged_case\n\tcase *event_PluginCommitPushed:\n\t\treturn Event_PluginCommitPushed_case\n\tcase *event_UserCreated:\n\t\treturn Event_UserCreated_case\n\tcase *event_UserDeactivated:\n\t\treturn Event_UserDeactivated_case\n\tcase *event_UserDeleted:\n\t\treturn Event_UserDeleted_case\n\tcase *event_UserLoggedIn:\n\t\treturn Event_UserLoggedIn_case\n\tcase *event_UserLoggedOut:\n\t\treturn Event_UserLoggedOut_case\n\tcase *event_CuratedPluginCreated:\n\t\treturn Event_CuratedPluginCreated_case\n\tcase *event_IdpGroupAdded:\n\t\treturn Event_IdpGroupAdded_case\n\tcase *event_IdpGroupUpdated:\n\t\treturn Event_IdpGroupUpdated_case\n\tcase *event_IdpGroupRemoved:\n\t\treturn Event_IdpGroupRemoved_case\n\tcase *event_TokenCreated:\n\t\treturn Event_TokenCreated_case\n\tcase *event_TokenDeleted:\n\t\treturn Event_TokenDeleted_case\n\tcase *event_UserReactivated:\n\t\treturn Event_UserReactivated_case\n\tcase *event_ScimTokenCreated:\n\t\treturn Event_ScimTokenCreated_case\n\tcase *event_ScimTokenDeleted:\n\t\treturn Event_ScimTokenDeleted_case\n\tcase *event_RepositoryCommitDeleted:\n\t\treturn Event_RepositoryCommitDeleted_case\n\tcase *event_RepositoryLabelCreated:\n\t\treturn Event_RepositoryLabelCreated_case\n\tcase *event_RepositoryLabelMoved:\n\t\treturn Event_RepositoryLabelMoved_case\n\tcase *event_RepositoryLabelArchived:\n\t\treturn Event_RepositoryLabelArchived_case\n\tcase *event_RepositoryLabelUnarchived:\n\t\treturn Event_RepositoryLabelUnarchived_case\n\tcase *event_RepositoryLabelEnforcementIgnoresChanged:\n\t\treturn Event_RepositoryLabelEnforcementIgnoresChanged_case\n\tcase *event_CuratedPluginDeleted:\n\t\treturn Event_CuratedPluginDeleted_case\n\tcase *event_CuratedPluginStatusUpdated:\n\t\treturn Event_CuratedPluginStatusUpdated_case\n\tcase *event_PayloadServerBreakingChangePolicyEnabled:\n\t\treturn Event_PayloadServerBreakingChangePolicyEnabled_case\n\tcase *event_PayloadServerBreakingChangePolicyDisabled:\n\t\treturn Event_PayloadServerBreakingChangePolicyDisabled_case\n\tcase *event_RepositoryDefaultBranchChanged:\n\t\treturn Event_RepositoryDefaultBranchChanged_case\n\tcase *event_PayloadServerUniquenessPolicyEnabled:\n\t\treturn Event_PayloadServerUniquenessPolicyEnabled_case\n\tcase *event_PayloadServerUniquenessPolicyDisabled:\n\t\treturn Event_PayloadServerUniquenessPolicyDisabled_case\n\tcase *event_ServerResourceVisibilityControlChanged:\n\t\treturn Event_ServerResourceVisibilityControlChanged_case\n\tcase *event_UserAutoMergedFromNewIdp:\n\t\treturn Event_UserAutoMergedFromNewIdp_case\n\tcase *event_DeviceAuthorizationGrantApproved:\n\t\treturn Event_DeviceAuthorizationGrantApproved_case\n\tcase *event_DeviceAuthorizationGrantDenied:\n\t\treturn Event_DeviceAuthorizationGrantDenied_case\n\tcase *event_PluginLabelCreated:\n\t\treturn Event_PluginLabelCreated_case\n\tcase *event_PluginLabelMoved:\n\t\treturn Event_PluginLabelMoved_case\n\tcase *event_PluginLabelArchived:\n\t\treturn Event_PluginLabelArchived_case\n\tcase *event_PluginLabelUnarchived:\n\t\treturn Event_PluginLabelUnarchived_case\n\tcase *event_ServerReviewFlowEnabled:\n\t\treturn Event_ServerReviewFlowEnabled_case\n\tcase *event_ServerReviewFlowDisabled:\n\t\treturn Event_ServerReviewFlowDisabled_case\n\tcase *event_SdkPluginConstraintCreated:\n\t\treturn Event_SdkPluginConstraintCreated_case\n\tcase *event_SdkPluginConstraintUpdated:\n\t\treturn Event_SdkPluginConstraintUpdated_case\n\tcase *event_SdkPluginConstraintDeleted:\n\t\treturn Event_SdkPluginConstraintDeleted_case\n\tcase *event_PolicyEnforcementCreated:\n\t\treturn Event_PolicyEnforcementCreated_case\n\tcase *event_PolicyEnforcementDeleted:\n\t\treturn Event_PolicyEnforcementDeleted_case\n\tcase *event_PolicyEnforcementPolicyChanged:\n\t\treturn Event_PolicyEnforcementPolicyChanged_case\n\tcase *event_PolicyEnforcementTargetsChanged:\n\t\treturn Event_PolicyEnforcementTargetsChanged_case\n\tdefault:\n\t\treturn Event_Payload_not_set_case\n\t}\n}\n\ntype Event_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Unique id of the audited event.\n\tEventId string\n\t// Type of the audited event. It specifies \"what\" happened.\n\tType EventType\n\t// Actor of the audited event. It specifies \"who\" did it.\n\tActor *Actor\n\t// Resource of the audited event. It specifies \"which resource\" was affected.\n\tResource *Resource\n\t// Time of the audited event. It specifies \"when\" it happened.\n\tEventTime *timestamppb.Timestamp\n\t// Metadata about the audited event. It specifies any additional details about the audited event.\n\tMetadata *EventMetadata\n\t// Payload of the audited event. It specifies additional context on the event.\n\n\t// Fields of oneof xxx_hidden_Payload:\n\tOrganizationCreated                          *PayloadOrganizationCreated\n\tOrganizationDeleted                          *PayloadOrganizationDeleted\n\tOrganizationMemberAdded                      *PayloadOrganizationMemberAdded\n\tOrganizationMemberRoleChanged                *PayloadOrganizationMemberRoleChanged\n\tOrganizationMemberRolesChanged               *PayloadOrganizationMemberRolesChanged\n\tOrganizationMemberRemoved                    *PayloadOrganizationMemberRemoved\n\tOrganizationResourceVisibilityControlChanged *PayloadOrganizationResourceVisibilityControlChanged\n\tOrganizationUniquenessPolicyEnabled          *PayloadOrganizationUniquenessPolicyEnabled\n\tOrganizationUniquenessPolicyDisabled         *PayloadOrganizationUniquenessPolicyDisabled\n\tRepositoryCreated                            *PayloadRepositoryCreated\n\tRepositoryDeprecated                         *PayloadRepositoryDeprecated\n\tRepositoryUndeprecated                       *PayloadRepositoryUndeprecated\n\tRepositoryDeleted                            *PayloadRepositoryDeleted\n\tRepositoryCommitPushed                       *PayloadRepositoryCommitPushed\n\tRepositoryContributorAdded                   *PayloadRepositoryContributorAdded\n\tRepositoryContributorRoleChanged             *PayloadRepositoryContributorRoleChanged\n\tRepositoryContributorRolesChanged            *PayloadRepositoryContributorRolesChanged\n\tRepositoryContributorRemoved                 *PayloadRepositoryContributorRemoved\n\tRepositoryVisibilityChanged                  *PayloadRepositoryVisibilityChanged\n\tRepositoryDefaultLabelNameChanged            *PayloadRepositoryDefaultLabelNameChanged\n\tRepositoryIdpGroupAdded                      *PayloadRepositoryIDPGroupAdded\n\tRepositoryIdpGroupUpdated                    *PayloadRepositoryIDPGroupUpdated\n\tRepositoryIdpGroupRemoved                    *PayloadRepositoryIDPGroupRemoved\n\tPolicyCreated                                *PayloadPolicyCreated\n\tPolicyDeleted                                *PayloadPolicyDeleted\n\tPolicyDeprecated                             *PayloadPolicyDeprecated\n\tPolicyUndeprecated                           *PayloadPolicyUndeprecated\n\tPolicyVisibilityChanged                      *PayloadPolicyVisibilityChanged\n\tPolicyCommitPushed                           *PayloadPolicyCommitPushed\n\tPolicyLabelCreated                           *PayloadPolicyLabelCreated\n\tPolicyLabelMoved                             *PayloadPolicyLabelMoved\n\tPolicyLabelArchived                          *PayloadPolicyLabelArchived\n\tPolicyLabelUnarchived                        *PayloadPolicyLabelUnarchived\n\tPluginCreated                                *PayloadPluginCreated\n\tPluginDeleted                                *PayloadPluginDeleted\n\tPluginDeprecated                             *PayloadPluginDeprecated\n\tPluginUndeprecated                           *PayloadPluginUndeprecated\n\tPluginVisibilityChanged                      *PayloadPluginVisibilityChanged\n\tPluginCommitPushed                           *PayloadPluginCommitPushed\n\tUserCreated                                  *PayloadUserCreated\n\tUserDeactivated                              *PayloadUserDeactivated\n\tUserDeleted                                  *PayloadUserDeleted\n\tUserLoggedIn                                 *PayloadUserLoggedIn\n\tUserLoggedOut                                *PayloadUserLoggedOut\n\tCuratedPluginCreated                         *PayloadCuratedPluginCreated\n\tIdpGroupAdded                                *PayloadOrganizationIDPGroupAdded\n\tIdpGroupUpdated                              *PayloadOrganizationIDPGroupUpdated\n\tIdpGroupRemoved                              *PayloadOrganizationIDPGroupRemoved\n\tTokenCreated                                 *PayloadTokenCreated\n\tTokenDeleted                                 *PayloadTokenDeleted\n\tUserReactivated                              *PayloadUserReactivated\n\tScimTokenCreated                             *PayloadSCIMTokenCreated\n\tScimTokenDeleted                             *PayloadSCIMTokenDeleted\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tRepositoryCommitDeleted                   *PayloadRepositoryCommitDeleted\n\tRepositoryLabelCreated                    *PayloadRepositoryLabelCreated\n\tRepositoryLabelMoved                      *PayloadRepositoryLabelMoved\n\tRepositoryLabelArchived                   *PayloadRepositoryLabelArchived\n\tRepositoryLabelUnarchived                 *PayloadRepositoryLabelUnarchived\n\tRepositoryLabelEnforcementIgnoresChanged  *PayloadRepositoryLabelEnforcementIgnoresChanged\n\tCuratedPluginDeleted                      *PayloadCuratedPluginDeleted\n\tCuratedPluginStatusUpdated                *PayloadCuratedPluginStatusUpdated\n\tPayloadServerBreakingChangePolicyEnabled  *PayloadServerBreakingChangePolicyEnabled\n\tPayloadServerBreakingChangePolicyDisabled *PayloadServerBreakingChangePolicyDisabled\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tRepositoryDefaultBranchChanged         *PayloadRepositoryDefaultBranchChanged\n\tPayloadServerUniquenessPolicyEnabled   *PayloadServerUniquenessPolicyEnabled\n\tPayloadServerUniquenessPolicyDisabled  *PayloadServerUniquenessPolicyDisabled\n\tServerResourceVisibilityControlChanged *PayloadServerResourceVisibilityControlChanged\n\tUserAutoMergedFromNewIdp               *PayloadUserAutoMergedFromNewIdP\n\tDeviceAuthorizationGrantApproved       *PayloadDeviceAuthorizationGrantApproved\n\tDeviceAuthorizationGrantDenied         *PayloadDeviceAuthorizationGrantDenied\n\tPluginLabelCreated                     *PayloadPluginLabelCreated\n\tPluginLabelMoved                       *PayloadPluginLabelMoved\n\tPluginLabelArchived                    *PayloadPluginLabelArchived\n\tPluginLabelUnarchived                  *PayloadPluginLabelUnarchived\n\tServerReviewFlowEnabled                *PayloadServerReviewFlowEnabled\n\tServerReviewFlowDisabled               *PayloadServerReviewFlowDisabled\n\tSdkPluginConstraintCreated             *PayloadSDKPluginConstraintCreated\n\tSdkPluginConstraintUpdated             *PayloadSDKPluginConstraintUpdated\n\tSdkPluginConstraintDeleted             *PayloadSDKPluginConstraintDeleted\n\tPolicyEnforcementCreated               *PayloadPolicyEnforcementCreated\n\tPolicyEnforcementDeleted               *PayloadPolicyEnforcementDeleted\n\tPolicyEnforcementPolicyChanged         *PayloadPolicyEnforcementPolicyChanged\n\tPolicyEnforcementTargetsChanged        *PayloadPolicyEnforcementTargetsChanged\n\t// -- end of xxx_hidden_Payload\n}\n\nfunc (b0 Event_builder) Build() *Event {\n\tm0 := &Event{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_EventId = b.EventId\n\tx.xxx_hidden_Type = b.Type\n\tx.xxx_hidden_Actor = b.Actor\n\tx.xxx_hidden_Resource = b.Resource\n\tx.xxx_hidden_EventTime = b.EventTime\n\tx.xxx_hidden_Metadata = b.Metadata\n\tif b.OrganizationCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationCreated{b.OrganizationCreated}\n\t}\n\tif b.OrganizationDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationDeleted{b.OrganizationDeleted}\n\t}\n\tif b.OrganizationMemberAdded != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationMemberAdded{b.OrganizationMemberAdded}\n\t}\n\tif b.OrganizationMemberRoleChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationMemberRoleChanged{b.OrganizationMemberRoleChanged}\n\t}\n\tif b.OrganizationMemberRolesChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationMemberRolesChanged{b.OrganizationMemberRolesChanged}\n\t}\n\tif b.OrganizationMemberRemoved != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationMemberRemoved{b.OrganizationMemberRemoved}\n\t}\n\tif b.OrganizationResourceVisibilityControlChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationResourceVisibilityControlChanged{b.OrganizationResourceVisibilityControlChanged}\n\t}\n\tif b.OrganizationUniquenessPolicyEnabled != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationUniquenessPolicyEnabled{b.OrganizationUniquenessPolicyEnabled}\n\t}\n\tif b.OrganizationUniquenessPolicyDisabled != nil {\n\t\tx.xxx_hidden_Payload = &event_OrganizationUniquenessPolicyDisabled{b.OrganizationUniquenessPolicyDisabled}\n\t}\n\tif b.RepositoryCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryCreated{b.RepositoryCreated}\n\t}\n\tif b.RepositoryDeprecated != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryDeprecated{b.RepositoryDeprecated}\n\t}\n\tif b.RepositoryUndeprecated != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryUndeprecated{b.RepositoryUndeprecated}\n\t}\n\tif b.RepositoryDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryDeleted{b.RepositoryDeleted}\n\t}\n\tif b.RepositoryCommitPushed != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryCommitPushed{b.RepositoryCommitPushed}\n\t}\n\tif b.RepositoryContributorAdded != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryContributorAdded{b.RepositoryContributorAdded}\n\t}\n\tif b.RepositoryContributorRoleChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryContributorRoleChanged{b.RepositoryContributorRoleChanged}\n\t}\n\tif b.RepositoryContributorRolesChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryContributorRolesChanged{b.RepositoryContributorRolesChanged}\n\t}\n\tif b.RepositoryContributorRemoved != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryContributorRemoved{b.RepositoryContributorRemoved}\n\t}\n\tif b.RepositoryVisibilityChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryVisibilityChanged{b.RepositoryVisibilityChanged}\n\t}\n\tif b.RepositoryDefaultLabelNameChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryDefaultLabelNameChanged{b.RepositoryDefaultLabelNameChanged}\n\t}\n\tif b.RepositoryIdpGroupAdded != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryIdpGroupAdded{b.RepositoryIdpGroupAdded}\n\t}\n\tif b.RepositoryIdpGroupUpdated != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryIdpGroupUpdated{b.RepositoryIdpGroupUpdated}\n\t}\n\tif b.RepositoryIdpGroupRemoved != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryIdpGroupRemoved{b.RepositoryIdpGroupRemoved}\n\t}\n\tif b.PolicyCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyCreated{b.PolicyCreated}\n\t}\n\tif b.PolicyDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyDeleted{b.PolicyDeleted}\n\t}\n\tif b.PolicyDeprecated != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyDeprecated{b.PolicyDeprecated}\n\t}\n\tif b.PolicyUndeprecated != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyUndeprecated{b.PolicyUndeprecated}\n\t}\n\tif b.PolicyVisibilityChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyVisibilityChanged{b.PolicyVisibilityChanged}\n\t}\n\tif b.PolicyCommitPushed != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyCommitPushed{b.PolicyCommitPushed}\n\t}\n\tif b.PolicyLabelCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyLabelCreated{b.PolicyLabelCreated}\n\t}\n\tif b.PolicyLabelMoved != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyLabelMoved{b.PolicyLabelMoved}\n\t}\n\tif b.PolicyLabelArchived != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyLabelArchived{b.PolicyLabelArchived}\n\t}\n\tif b.PolicyLabelUnarchived != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyLabelUnarchived{b.PolicyLabelUnarchived}\n\t}\n\tif b.PluginCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginCreated{b.PluginCreated}\n\t}\n\tif b.PluginDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginDeleted{b.PluginDeleted}\n\t}\n\tif b.PluginDeprecated != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginDeprecated{b.PluginDeprecated}\n\t}\n\tif b.PluginUndeprecated != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginUndeprecated{b.PluginUndeprecated}\n\t}\n\tif b.PluginVisibilityChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginVisibilityChanged{b.PluginVisibilityChanged}\n\t}\n\tif b.PluginCommitPushed != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginCommitPushed{b.PluginCommitPushed}\n\t}\n\tif b.UserCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_UserCreated{b.UserCreated}\n\t}\n\tif b.UserDeactivated != nil {\n\t\tx.xxx_hidden_Payload = &event_UserDeactivated{b.UserDeactivated}\n\t}\n\tif b.UserDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_UserDeleted{b.UserDeleted}\n\t}\n\tif b.UserLoggedIn != nil {\n\t\tx.xxx_hidden_Payload = &event_UserLoggedIn{b.UserLoggedIn}\n\t}\n\tif b.UserLoggedOut != nil {\n\t\tx.xxx_hidden_Payload = &event_UserLoggedOut{b.UserLoggedOut}\n\t}\n\tif b.CuratedPluginCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_CuratedPluginCreated{b.CuratedPluginCreated}\n\t}\n\tif b.IdpGroupAdded != nil {\n\t\tx.xxx_hidden_Payload = &event_IdpGroupAdded{b.IdpGroupAdded}\n\t}\n\tif b.IdpGroupUpdated != nil {\n\t\tx.xxx_hidden_Payload = &event_IdpGroupUpdated{b.IdpGroupUpdated}\n\t}\n\tif b.IdpGroupRemoved != nil {\n\t\tx.xxx_hidden_Payload = &event_IdpGroupRemoved{b.IdpGroupRemoved}\n\t}\n\tif b.TokenCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_TokenCreated{b.TokenCreated}\n\t}\n\tif b.TokenDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_TokenDeleted{b.TokenDeleted}\n\t}\n\tif b.UserReactivated != nil {\n\t\tx.xxx_hidden_Payload = &event_UserReactivated{b.UserReactivated}\n\t}\n\tif b.ScimTokenCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_ScimTokenCreated{b.ScimTokenCreated}\n\t}\n\tif b.ScimTokenDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_ScimTokenDeleted{b.ScimTokenDeleted}\n\t}\n\tif b.RepositoryCommitDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryCommitDeleted{b.RepositoryCommitDeleted}\n\t}\n\tif b.RepositoryLabelCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryLabelCreated{b.RepositoryLabelCreated}\n\t}\n\tif b.RepositoryLabelMoved != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryLabelMoved{b.RepositoryLabelMoved}\n\t}\n\tif b.RepositoryLabelArchived != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryLabelArchived{b.RepositoryLabelArchived}\n\t}\n\tif b.RepositoryLabelUnarchived != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryLabelUnarchived{b.RepositoryLabelUnarchived}\n\t}\n\tif b.RepositoryLabelEnforcementIgnoresChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryLabelEnforcementIgnoresChanged{b.RepositoryLabelEnforcementIgnoresChanged}\n\t}\n\tif b.CuratedPluginDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_CuratedPluginDeleted{b.CuratedPluginDeleted}\n\t}\n\tif b.CuratedPluginStatusUpdated != nil {\n\t\tx.xxx_hidden_Payload = &event_CuratedPluginStatusUpdated{b.CuratedPluginStatusUpdated}\n\t}\n\tif b.PayloadServerBreakingChangePolicyEnabled != nil {\n\t\tx.xxx_hidden_Payload = &event_PayloadServerBreakingChangePolicyEnabled{b.PayloadServerBreakingChangePolicyEnabled}\n\t}\n\tif b.PayloadServerBreakingChangePolicyDisabled != nil {\n\t\tx.xxx_hidden_Payload = &event_PayloadServerBreakingChangePolicyDisabled{b.PayloadServerBreakingChangePolicyDisabled}\n\t}\n\tif b.RepositoryDefaultBranchChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_RepositoryDefaultBranchChanged{b.RepositoryDefaultBranchChanged}\n\t}\n\tif b.PayloadServerUniquenessPolicyEnabled != nil {\n\t\tx.xxx_hidden_Payload = &event_PayloadServerUniquenessPolicyEnabled{b.PayloadServerUniquenessPolicyEnabled}\n\t}\n\tif b.PayloadServerUniquenessPolicyDisabled != nil {\n\t\tx.xxx_hidden_Payload = &event_PayloadServerUniquenessPolicyDisabled{b.PayloadServerUniquenessPolicyDisabled}\n\t}\n\tif b.ServerResourceVisibilityControlChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_ServerResourceVisibilityControlChanged{b.ServerResourceVisibilityControlChanged}\n\t}\n\tif b.UserAutoMergedFromNewIdp != nil {\n\t\tx.xxx_hidden_Payload = &event_UserAutoMergedFromNewIdp{b.UserAutoMergedFromNewIdp}\n\t}\n\tif b.DeviceAuthorizationGrantApproved != nil {\n\t\tx.xxx_hidden_Payload = &event_DeviceAuthorizationGrantApproved{b.DeviceAuthorizationGrantApproved}\n\t}\n\tif b.DeviceAuthorizationGrantDenied != nil {\n\t\tx.xxx_hidden_Payload = &event_DeviceAuthorizationGrantDenied{b.DeviceAuthorizationGrantDenied}\n\t}\n\tif b.PluginLabelCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginLabelCreated{b.PluginLabelCreated}\n\t}\n\tif b.PluginLabelMoved != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginLabelMoved{b.PluginLabelMoved}\n\t}\n\tif b.PluginLabelArchived != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginLabelArchived{b.PluginLabelArchived}\n\t}\n\tif b.PluginLabelUnarchived != nil {\n\t\tx.xxx_hidden_Payload = &event_PluginLabelUnarchived{b.PluginLabelUnarchived}\n\t}\n\tif b.ServerReviewFlowEnabled != nil {\n\t\tx.xxx_hidden_Payload = &event_ServerReviewFlowEnabled{b.ServerReviewFlowEnabled}\n\t}\n\tif b.ServerReviewFlowDisabled != nil {\n\t\tx.xxx_hidden_Payload = &event_ServerReviewFlowDisabled{b.ServerReviewFlowDisabled}\n\t}\n\tif b.SdkPluginConstraintCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_SdkPluginConstraintCreated{b.SdkPluginConstraintCreated}\n\t}\n\tif b.SdkPluginConstraintUpdated != nil {\n\t\tx.xxx_hidden_Payload = &event_SdkPluginConstraintUpdated{b.SdkPluginConstraintUpdated}\n\t}\n\tif b.SdkPluginConstraintDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_SdkPluginConstraintDeleted{b.SdkPluginConstraintDeleted}\n\t}\n\tif b.PolicyEnforcementCreated != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyEnforcementCreated{b.PolicyEnforcementCreated}\n\t}\n\tif b.PolicyEnforcementDeleted != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyEnforcementDeleted{b.PolicyEnforcementDeleted}\n\t}\n\tif b.PolicyEnforcementPolicyChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyEnforcementPolicyChanged{b.PolicyEnforcementPolicyChanged}\n\t}\n\tif b.PolicyEnforcementTargetsChanged != nil {\n\t\tx.xxx_hidden_Payload = &event_PolicyEnforcementTargetsChanged{b.PolicyEnforcementTargetsChanged}\n\t}\n\treturn m0\n}\n\ntype case_Event_Payload protoreflect.FieldNumber\n\nfunc (x case_Event_Payload) String() string {\n\tmd := file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[3].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isEvent_Payload interface {\n\tisEvent_Payload()\n}\n\ntype event_OrganizationCreated struct {\n\tOrganizationCreated *PayloadOrganizationCreated `protobuf:\"bytes,7,opt,name=organization_created,json=organizationCreated,proto3,oneof\"`\n}\n\ntype event_OrganizationDeleted struct {\n\tOrganizationDeleted *PayloadOrganizationDeleted `protobuf:\"bytes,8,opt,name=organization_deleted,json=organizationDeleted,proto3,oneof\"`\n}\n\ntype event_OrganizationMemberAdded struct {\n\tOrganizationMemberAdded *PayloadOrganizationMemberAdded `protobuf:\"bytes,9,opt,name=organization_member_added,json=organizationMemberAdded,proto3,oneof\"`\n}\n\ntype event_OrganizationMemberRoleChanged struct {\n\tOrganizationMemberRoleChanged *PayloadOrganizationMemberRoleChanged `protobuf:\"bytes,10,opt,name=organization_member_role_changed,json=organizationMemberRoleChanged,proto3,oneof\"`\n}\n\ntype event_OrganizationMemberRolesChanged struct {\n\tOrganizationMemberRolesChanged *PayloadOrganizationMemberRolesChanged `protobuf:\"bytes,56,opt,name=organization_member_roles_changed,json=organizationMemberRolesChanged,proto3,oneof\"`\n}\n\ntype event_OrganizationMemberRemoved struct {\n\tOrganizationMemberRemoved *PayloadOrganizationMemberRemoved `protobuf:\"bytes,11,opt,name=organization_member_removed,json=organizationMemberRemoved,proto3,oneof\"`\n}\n\ntype event_OrganizationResourceVisibilityControlChanged struct {\n\tOrganizationResourceVisibilityControlChanged *PayloadOrganizationResourceVisibilityControlChanged `protobuf:\"bytes,87,opt,name=organization_resource_visibility_control_changed,json=organizationResourceVisibilityControlChanged,proto3,oneof\"`\n}\n\ntype event_OrganizationUniquenessPolicyEnabled struct {\n\tOrganizationUniquenessPolicyEnabled *PayloadOrganizationUniquenessPolicyEnabled `protobuf:\"bytes,88,opt,name=organization_uniqueness_policy_enabled,json=organizationUniquenessPolicyEnabled,proto3,oneof\"`\n}\n\ntype event_OrganizationUniquenessPolicyDisabled struct {\n\tOrganizationUniquenessPolicyDisabled *PayloadOrganizationUniquenessPolicyDisabled `protobuf:\"bytes,89,opt,name=organization_uniqueness_policy_disabled,json=organizationUniquenessPolicyDisabled,proto3,oneof\"`\n}\n\ntype event_RepositoryCreated struct {\n\tRepositoryCreated *PayloadRepositoryCreated `protobuf:\"bytes,12,opt,name=repository_created,json=repositoryCreated,proto3,oneof\"`\n}\n\ntype event_RepositoryDeprecated struct {\n\tRepositoryDeprecated *PayloadRepositoryDeprecated `protobuf:\"bytes,54,opt,name=repository_deprecated,json=repositoryDeprecated,proto3,oneof\"`\n}\n\ntype event_RepositoryUndeprecated struct {\n\tRepositoryUndeprecated *PayloadRepositoryUndeprecated `protobuf:\"bytes,55,opt,name=repository_undeprecated,json=repositoryUndeprecated,proto3,oneof\"`\n}\n\ntype event_RepositoryDeleted struct {\n\tRepositoryDeleted *PayloadRepositoryDeleted `protobuf:\"bytes,13,opt,name=repository_deleted,json=repositoryDeleted,proto3,oneof\"`\n}\n\ntype event_RepositoryCommitPushed struct {\n\tRepositoryCommitPushed *PayloadRepositoryCommitPushed `protobuf:\"bytes,14,opt,name=repository_commit_pushed,json=repositoryCommitPushed,proto3,oneof\"`\n}\n\ntype event_RepositoryContributorAdded struct {\n\tRepositoryContributorAdded *PayloadRepositoryContributorAdded `protobuf:\"bytes,15,opt,name=repository_contributor_added,json=repositoryContributorAdded,proto3,oneof\"`\n}\n\ntype event_RepositoryContributorRoleChanged struct {\n\tRepositoryContributorRoleChanged *PayloadRepositoryContributorRoleChanged `protobuf:\"bytes,16,opt,name=repository_contributor_role_changed,json=repositoryContributorRoleChanged,proto3,oneof\"`\n}\n\ntype event_RepositoryContributorRolesChanged struct {\n\tRepositoryContributorRolesChanged *PayloadRepositoryContributorRolesChanged `protobuf:\"bytes,69,opt,name=repository_contributor_roles_changed,json=repositoryContributorRolesChanged,proto3,oneof\"`\n}\n\ntype event_RepositoryContributorRemoved struct {\n\tRepositoryContributorRemoved *PayloadRepositoryContributorRemoved `protobuf:\"bytes,17,opt,name=repository_contributor_removed,json=repositoryContributorRemoved,proto3,oneof\"`\n}\n\ntype event_RepositoryVisibilityChanged struct {\n\tRepositoryVisibilityChanged *PayloadRepositoryVisibilityChanged `protobuf:\"bytes,18,opt,name=repository_visibility_changed,json=repositoryVisibilityChanged,proto3,oneof\"`\n}\n\ntype event_RepositoryDefaultLabelNameChanged struct {\n\tRepositoryDefaultLabelNameChanged *PayloadRepositoryDefaultLabelNameChanged `protobuf:\"bytes,46,opt,name=repository_default_label_name_changed,json=repositoryDefaultLabelNameChanged,proto3,oneof\"`\n}\n\ntype event_RepositoryIdpGroupAdded struct {\n\tRepositoryIdpGroupAdded *PayloadRepositoryIDPGroupAdded `protobuf:\"bytes,66,opt,name=repository_idp_group_added,json=repositoryIdpGroupAdded,proto3,oneof\"`\n}\n\ntype event_RepositoryIdpGroupUpdated struct {\n\tRepositoryIdpGroupUpdated *PayloadRepositoryIDPGroupUpdated `protobuf:\"bytes,67,opt,name=repository_idp_group_updated,json=repositoryIdpGroupUpdated,proto3,oneof\"`\n}\n\ntype event_RepositoryIdpGroupRemoved struct {\n\tRepositoryIdpGroupRemoved *PayloadRepositoryIDPGroupRemoved `protobuf:\"bytes,68,opt,name=repository_idp_group_removed,json=repositoryIdpGroupRemoved,proto3,oneof\"`\n}\n\ntype event_PolicyCreated struct {\n\tPolicyCreated *PayloadPolicyCreated `protobuf:\"bytes,60,opt,name=policy_created,json=policyCreated,proto3,oneof\"`\n}\n\ntype event_PolicyDeleted struct {\n\tPolicyDeleted *PayloadPolicyDeleted `protobuf:\"bytes,61,opt,name=policy_deleted,json=policyDeleted,proto3,oneof\"`\n}\n\ntype event_PolicyDeprecated struct {\n\tPolicyDeprecated *PayloadPolicyDeprecated `protobuf:\"bytes,62,opt,name=policy_deprecated,json=policyDeprecated,proto3,oneof\"`\n}\n\ntype event_PolicyUndeprecated struct {\n\tPolicyUndeprecated *PayloadPolicyUndeprecated `protobuf:\"bytes,63,opt,name=policy_undeprecated,json=policyUndeprecated,proto3,oneof\"`\n}\n\ntype event_PolicyVisibilityChanged struct {\n\tPolicyVisibilityChanged *PayloadPolicyVisibilityChanged `protobuf:\"bytes,64,opt,name=policy_visibility_changed,json=policyVisibilityChanged,proto3,oneof\"`\n}\n\ntype event_PolicyCommitPushed struct {\n\tPolicyCommitPushed *PayloadPolicyCommitPushed `protobuf:\"bytes,70,opt,name=policy_commit_pushed,json=policyCommitPushed,proto3,oneof\"`\n}\n\ntype event_PolicyLabelCreated struct {\n\tPolicyLabelCreated *PayloadPolicyLabelCreated `protobuf:\"bytes,71,opt,name=policy_label_created,json=policyLabelCreated,proto3,oneof\"`\n}\n\ntype event_PolicyLabelMoved struct {\n\tPolicyLabelMoved *PayloadPolicyLabelMoved `protobuf:\"bytes,72,opt,name=policy_label_moved,json=policyLabelMoved,proto3,oneof\"`\n}\n\ntype event_PolicyLabelArchived struct {\n\tPolicyLabelArchived *PayloadPolicyLabelArchived `protobuf:\"bytes,73,opt,name=policy_label_archived,json=policyLabelArchived,proto3,oneof\"`\n}\n\ntype event_PolicyLabelUnarchived struct {\n\tPolicyLabelUnarchived *PayloadPolicyLabelUnarchived `protobuf:\"bytes,74,opt,name=policy_label_unarchived,json=policyLabelUnarchived,proto3,oneof\"`\n}\n\ntype event_PluginCreated struct {\n\tPluginCreated *PayloadPluginCreated `protobuf:\"bytes,19,opt,name=plugin_created,json=pluginCreated,proto3,oneof\"`\n}\n\ntype event_PluginDeleted struct {\n\tPluginDeleted *PayloadPluginDeleted `protobuf:\"bytes,20,opt,name=plugin_deleted,json=pluginDeleted,proto3,oneof\"`\n}\n\ntype event_PluginDeprecated struct {\n\tPluginDeprecated *PayloadPluginDeprecated `protobuf:\"bytes,57,opt,name=plugin_deprecated,json=pluginDeprecated,proto3,oneof\"`\n}\n\ntype event_PluginUndeprecated struct {\n\tPluginUndeprecated *PayloadPluginUndeprecated `protobuf:\"bytes,58,opt,name=plugin_undeprecated,json=pluginUndeprecated,proto3,oneof\"`\n}\n\ntype event_PluginVisibilityChanged struct {\n\tPluginVisibilityChanged *PayloadPluginVisibilityChanged `protobuf:\"bytes,59,opt,name=plugin_visibility_changed,json=pluginVisibilityChanged,proto3,oneof\"`\n}\n\ntype event_PluginCommitPushed struct {\n\tPluginCommitPushed *PayloadPluginCommitPushed `protobuf:\"bytes,49,opt,name=plugin_commit_pushed,json=pluginCommitPushed,proto3,oneof\"`\n}\n\ntype event_UserCreated struct {\n\tUserCreated *PayloadUserCreated `protobuf:\"bytes,21,opt,name=user_created,json=userCreated,proto3,oneof\"`\n}\n\ntype event_UserDeactivated struct {\n\tUserDeactivated *PayloadUserDeactivated `protobuf:\"bytes,22,opt,name=user_deactivated,json=userDeactivated,proto3,oneof\"`\n}\n\ntype event_UserDeleted struct {\n\tUserDeleted *PayloadUserDeleted `protobuf:\"bytes,23,opt,name=user_deleted,json=userDeleted,proto3,oneof\"`\n}\n\ntype event_UserLoggedIn struct {\n\tUserLoggedIn *PayloadUserLoggedIn `protobuf:\"bytes,24,opt,name=user_logged_in,json=userLoggedIn,proto3,oneof\"`\n}\n\ntype event_UserLoggedOut struct {\n\tUserLoggedOut *PayloadUserLoggedOut `protobuf:\"bytes,25,opt,name=user_logged_out,json=userLoggedOut,proto3,oneof\"`\n}\n\ntype event_CuratedPluginCreated struct {\n\tCuratedPluginCreated *PayloadCuratedPluginCreated `protobuf:\"bytes,26,opt,name=curated_plugin_created,json=curatedPluginCreated,proto3,oneof\"`\n}\n\ntype event_IdpGroupAdded struct {\n\tIdpGroupAdded *PayloadOrganizationIDPGroupAdded `protobuf:\"bytes,27,opt,name=idp_group_added,json=idpGroupAdded,proto3,oneof\"`\n}\n\ntype event_IdpGroupUpdated struct {\n\tIdpGroupUpdated *PayloadOrganizationIDPGroupUpdated `protobuf:\"bytes,65,opt,name=idp_group_updated,json=idpGroupUpdated,proto3,oneof\"`\n}\n\ntype event_IdpGroupRemoved struct {\n\tIdpGroupRemoved *PayloadOrganizationIDPGroupRemoved `protobuf:\"bytes,28,opt,name=idp_group_removed,json=idpGroupRemoved,proto3,oneof\"`\n}\n\ntype event_TokenCreated struct {\n\tTokenCreated *PayloadTokenCreated `protobuf:\"bytes,29,opt,name=token_created,json=tokenCreated,proto3,oneof\"`\n}\n\ntype event_TokenDeleted struct {\n\tTokenDeleted *PayloadTokenDeleted `protobuf:\"bytes,30,opt,name=token_deleted,json=tokenDeleted,proto3,oneof\"`\n}\n\ntype event_UserReactivated struct {\n\tUserReactivated *PayloadUserReactivated `protobuf:\"bytes,31,opt,name=user_reactivated,json=userReactivated,proto3,oneof\"`\n}\n\ntype event_ScimTokenCreated struct {\n\tScimTokenCreated *PayloadSCIMTokenCreated `protobuf:\"bytes,32,opt,name=scim_token_created,json=scimTokenCreated,proto3,oneof\"`\n}\n\ntype event_ScimTokenDeleted struct {\n\tScimTokenDeleted *PayloadSCIMTokenDeleted `protobuf:\"bytes,33,opt,name=scim_token_deleted,json=scimTokenDeleted,proto3,oneof\"`\n}\n\ntype event_RepositoryCommitDeleted struct {\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tRepositoryCommitDeleted *PayloadRepositoryCommitDeleted `protobuf:\"bytes,34,opt,name=repository_commit_deleted,json=repositoryCommitDeleted,proto3,oneof\"`\n}\n\ntype event_RepositoryLabelCreated struct {\n\tRepositoryLabelCreated *PayloadRepositoryLabelCreated `protobuf:\"bytes,35,opt,name=repository_label_created,json=repositoryLabelCreated,proto3,oneof\"`\n}\n\ntype event_RepositoryLabelMoved struct {\n\tRepositoryLabelMoved *PayloadRepositoryLabelMoved `protobuf:\"bytes,36,opt,name=repository_label_moved,json=repositoryLabelMoved,proto3,oneof\"`\n}\n\ntype event_RepositoryLabelArchived struct {\n\tRepositoryLabelArchived *PayloadRepositoryLabelArchived `protobuf:\"bytes,44,opt,name=repository_label_archived,json=repositoryLabelArchived,proto3,oneof\"`\n}\n\ntype event_RepositoryLabelUnarchived struct {\n\tRepositoryLabelUnarchived *PayloadRepositoryLabelUnarchived `protobuf:\"bytes,45,opt,name=repository_label_unarchived,json=repositoryLabelUnarchived,proto3,oneof\"`\n}\n\ntype event_RepositoryLabelEnforcementIgnoresChanged struct {\n\tRepositoryLabelEnforcementIgnoresChanged *PayloadRepositoryLabelEnforcementIgnoresChanged `protobuf:\"bytes,85,opt,name=repository_label_enforcement_ignores_changed,json=repositoryLabelEnforcementIgnoresChanged,proto3,oneof\"`\n}\n\ntype event_CuratedPluginDeleted struct {\n\tCuratedPluginDeleted *PayloadCuratedPluginDeleted `protobuf:\"bytes,37,opt,name=curated_plugin_deleted,json=curatedPluginDeleted,proto3,oneof\"`\n}\n\ntype event_CuratedPluginStatusUpdated struct {\n\tCuratedPluginStatusUpdated *PayloadCuratedPluginStatusUpdated `protobuf:\"bytes,84,opt,name=curated_plugin_status_updated,json=curatedPluginStatusUpdated,proto3,oneof\"`\n}\n\ntype event_PayloadServerBreakingChangePolicyEnabled struct {\n\tPayloadServerBreakingChangePolicyEnabled *PayloadServerBreakingChangePolicyEnabled `protobuf:\"bytes,38,opt,name=payload_server_breaking_change_policy_enabled,json=payloadServerBreakingChangePolicyEnabled,proto3,oneof\"`\n}\n\ntype event_PayloadServerBreakingChangePolicyDisabled struct {\n\tPayloadServerBreakingChangePolicyDisabled *PayloadServerBreakingChangePolicyDisabled `protobuf:\"bytes,39,opt,name=payload_server_breaking_change_policy_disabled,json=payloadServerBreakingChangePolicyDisabled,proto3,oneof\"`\n}\n\ntype event_RepositoryDefaultBranchChanged struct {\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tRepositoryDefaultBranchChanged *PayloadRepositoryDefaultBranchChanged `protobuf:\"bytes,40,opt,name=repository_default_branch_changed,json=repositoryDefaultBranchChanged,proto3,oneof\"`\n}\n\ntype event_PayloadServerUniquenessPolicyEnabled struct {\n\tPayloadServerUniquenessPolicyEnabled *PayloadServerUniquenessPolicyEnabled `protobuf:\"bytes,41,opt,name=payload_server_uniqueness_policy_enabled,json=payloadServerUniquenessPolicyEnabled,proto3,oneof\"`\n}\n\ntype event_PayloadServerUniquenessPolicyDisabled struct {\n\tPayloadServerUniquenessPolicyDisabled *PayloadServerUniquenessPolicyDisabled `protobuf:\"bytes,42,opt,name=payload_server_uniqueness_policy_disabled,json=payloadServerUniquenessPolicyDisabled,proto3,oneof\"`\n}\n\ntype event_ServerResourceVisibilityControlChanged struct {\n\tServerResourceVisibilityControlChanged *PayloadServerResourceVisibilityControlChanged `protobuf:\"bytes,86,opt,name=server_resource_visibility_control_changed,json=serverResourceVisibilityControlChanged,proto3,oneof\"`\n}\n\ntype event_UserAutoMergedFromNewIdp struct {\n\tUserAutoMergedFromNewIdp *PayloadUserAutoMergedFromNewIdP `protobuf:\"bytes,43,opt,name=user_auto_merged_from_new_idp,json=userAutoMergedFromNewIdp,proto3,oneof\"`\n}\n\ntype event_DeviceAuthorizationGrantApproved struct {\n\tDeviceAuthorizationGrantApproved *PayloadDeviceAuthorizationGrantApproved `protobuf:\"bytes,47,opt,name=device_authorization_grant_approved,json=deviceAuthorizationGrantApproved,proto3,oneof\"`\n}\n\ntype event_DeviceAuthorizationGrantDenied struct {\n\tDeviceAuthorizationGrantDenied *PayloadDeviceAuthorizationGrantDenied `protobuf:\"bytes,48,opt,name=device_authorization_grant_denied,json=deviceAuthorizationGrantDenied,proto3,oneof\"`\n}\n\ntype event_PluginLabelCreated struct {\n\tPluginLabelCreated *PayloadPluginLabelCreated `protobuf:\"bytes,50,opt,name=plugin_label_created,json=pluginLabelCreated,proto3,oneof\"`\n}\n\ntype event_PluginLabelMoved struct {\n\tPluginLabelMoved *PayloadPluginLabelMoved `protobuf:\"bytes,51,opt,name=plugin_label_moved,json=pluginLabelMoved,proto3,oneof\"`\n}\n\ntype event_PluginLabelArchived struct {\n\tPluginLabelArchived *PayloadPluginLabelArchived `protobuf:\"bytes,52,opt,name=plugin_label_archived,json=pluginLabelArchived,proto3,oneof\"`\n}\n\ntype event_PluginLabelUnarchived struct {\n\tPluginLabelUnarchived *PayloadPluginLabelUnarchived `protobuf:\"bytes,53,opt,name=plugin_label_unarchived,json=pluginLabelUnarchived,proto3,oneof\"`\n}\n\ntype event_ServerReviewFlowEnabled struct {\n\tServerReviewFlowEnabled *PayloadServerReviewFlowEnabled `protobuf:\"bytes,75,opt,name=server_review_flow_enabled,json=serverReviewFlowEnabled,proto3,oneof\"`\n}\n\ntype event_ServerReviewFlowDisabled struct {\n\tServerReviewFlowDisabled *PayloadServerReviewFlowDisabled `protobuf:\"bytes,76,opt,name=server_review_flow_disabled,json=serverReviewFlowDisabled,proto3,oneof\"`\n}\n\ntype event_SdkPluginConstraintCreated struct {\n\tSdkPluginConstraintCreated *PayloadSDKPluginConstraintCreated `protobuf:\"bytes,77,opt,name=sdk_plugin_constraint_created,json=sdkPluginConstraintCreated,proto3,oneof\"`\n}\n\ntype event_SdkPluginConstraintUpdated struct {\n\tSdkPluginConstraintUpdated *PayloadSDKPluginConstraintUpdated `protobuf:\"bytes,78,opt,name=sdk_plugin_constraint_updated,json=sdkPluginConstraintUpdated,proto3,oneof\"`\n}\n\ntype event_SdkPluginConstraintDeleted struct {\n\tSdkPluginConstraintDeleted *PayloadSDKPluginConstraintDeleted `protobuf:\"bytes,79,opt,name=sdk_plugin_constraint_deleted,json=sdkPluginConstraintDeleted,proto3,oneof\"`\n}\n\ntype event_PolicyEnforcementCreated struct {\n\tPolicyEnforcementCreated *PayloadPolicyEnforcementCreated `protobuf:\"bytes,80,opt,name=policy_enforcement_created,json=policyEnforcementCreated,proto3,oneof\"`\n}\n\ntype event_PolicyEnforcementDeleted struct {\n\tPolicyEnforcementDeleted *PayloadPolicyEnforcementDeleted `protobuf:\"bytes,81,opt,name=policy_enforcement_deleted,json=policyEnforcementDeleted,proto3,oneof\"`\n}\n\ntype event_PolicyEnforcementPolicyChanged struct {\n\tPolicyEnforcementPolicyChanged *PayloadPolicyEnforcementPolicyChanged `protobuf:\"bytes,82,opt,name=policy_enforcement_policy_changed,json=policyEnforcementPolicyChanged,proto3,oneof\"`\n}\n\ntype event_PolicyEnforcementTargetsChanged struct {\n\tPolicyEnforcementTargetsChanged *PayloadPolicyEnforcementTargetsChanged `protobuf:\"bytes,83,opt,name=policy_enforcement_targets_changed,json=policyEnforcementTargetsChanged,proto3,oneof\"`\n}\n\nfunc (*event_OrganizationCreated) isEvent_Payload() {}\n\nfunc (*event_OrganizationDeleted) isEvent_Payload() {}\n\nfunc (*event_OrganizationMemberAdded) isEvent_Payload() {}\n\nfunc (*event_OrganizationMemberRoleChanged) isEvent_Payload() {}\n\nfunc (*event_OrganizationMemberRolesChanged) isEvent_Payload() {}\n\nfunc (*event_OrganizationMemberRemoved) isEvent_Payload() {}\n\nfunc (*event_OrganizationResourceVisibilityControlChanged) isEvent_Payload() {}\n\nfunc (*event_OrganizationUniquenessPolicyEnabled) isEvent_Payload() {}\n\nfunc (*event_OrganizationUniquenessPolicyDisabled) isEvent_Payload() {}\n\nfunc (*event_RepositoryCreated) isEvent_Payload() {}\n\nfunc (*event_RepositoryDeprecated) isEvent_Payload() {}\n\nfunc (*event_RepositoryUndeprecated) isEvent_Payload() {}\n\nfunc (*event_RepositoryDeleted) isEvent_Payload() {}\n\nfunc (*event_RepositoryCommitPushed) isEvent_Payload() {}\n\nfunc (*event_RepositoryContributorAdded) isEvent_Payload() {}\n\nfunc (*event_RepositoryContributorRoleChanged) isEvent_Payload() {}\n\nfunc (*event_RepositoryContributorRolesChanged) isEvent_Payload() {}\n\nfunc (*event_RepositoryContributorRemoved) isEvent_Payload() {}\n\nfunc (*event_RepositoryVisibilityChanged) isEvent_Payload() {}\n\nfunc (*event_RepositoryDefaultLabelNameChanged) isEvent_Payload() {}\n\nfunc (*event_RepositoryIdpGroupAdded) isEvent_Payload() {}\n\nfunc (*event_RepositoryIdpGroupUpdated) isEvent_Payload() {}\n\nfunc (*event_RepositoryIdpGroupRemoved) isEvent_Payload() {}\n\nfunc (*event_PolicyCreated) isEvent_Payload() {}\n\nfunc (*event_PolicyDeleted) isEvent_Payload() {}\n\nfunc (*event_PolicyDeprecated) isEvent_Payload() {}\n\nfunc (*event_PolicyUndeprecated) isEvent_Payload() {}\n\nfunc (*event_PolicyVisibilityChanged) isEvent_Payload() {}\n\nfunc (*event_PolicyCommitPushed) isEvent_Payload() {}\n\nfunc (*event_PolicyLabelCreated) isEvent_Payload() {}\n\nfunc (*event_PolicyLabelMoved) isEvent_Payload() {}\n\nfunc (*event_PolicyLabelArchived) isEvent_Payload() {}\n\nfunc (*event_PolicyLabelUnarchived) isEvent_Payload() {}\n\nfunc (*event_PluginCreated) isEvent_Payload() {}\n\nfunc (*event_PluginDeleted) isEvent_Payload() {}\n\nfunc (*event_PluginDeprecated) isEvent_Payload() {}\n\nfunc (*event_PluginUndeprecated) isEvent_Payload() {}\n\nfunc (*event_PluginVisibilityChanged) isEvent_Payload() {}\n\nfunc (*event_PluginCommitPushed) isEvent_Payload() {}\n\nfunc (*event_UserCreated) isEvent_Payload() {}\n\nfunc (*event_UserDeactivated) isEvent_Payload() {}\n\nfunc (*event_UserDeleted) isEvent_Payload() {}\n\nfunc (*event_UserLoggedIn) isEvent_Payload() {}\n\nfunc (*event_UserLoggedOut) isEvent_Payload() {}\n\nfunc (*event_CuratedPluginCreated) isEvent_Payload() {}\n\nfunc (*event_IdpGroupAdded) isEvent_Payload() {}\n\nfunc (*event_IdpGroupUpdated) isEvent_Payload() {}\n\nfunc (*event_IdpGroupRemoved) isEvent_Payload() {}\n\nfunc (*event_TokenCreated) isEvent_Payload() {}\n\nfunc (*event_TokenDeleted) isEvent_Payload() {}\n\nfunc (*event_UserReactivated) isEvent_Payload() {}\n\nfunc (*event_ScimTokenCreated) isEvent_Payload() {}\n\nfunc (*event_ScimTokenDeleted) isEvent_Payload() {}\n\nfunc (*event_RepositoryCommitDeleted) isEvent_Payload() {}\n\nfunc (*event_RepositoryLabelCreated) isEvent_Payload() {}\n\nfunc (*event_RepositoryLabelMoved) isEvent_Payload() {}\n\nfunc (*event_RepositoryLabelArchived) isEvent_Payload() {}\n\nfunc (*event_RepositoryLabelUnarchived) isEvent_Payload() {}\n\nfunc (*event_RepositoryLabelEnforcementIgnoresChanged) isEvent_Payload() {}\n\nfunc (*event_CuratedPluginDeleted) isEvent_Payload() {}\n\nfunc (*event_CuratedPluginStatusUpdated) isEvent_Payload() {}\n\nfunc (*event_PayloadServerBreakingChangePolicyEnabled) isEvent_Payload() {}\n\nfunc (*event_PayloadServerBreakingChangePolicyDisabled) isEvent_Payload() {}\n\nfunc (*event_RepositoryDefaultBranchChanged) isEvent_Payload() {}\n\nfunc (*event_PayloadServerUniquenessPolicyEnabled) isEvent_Payload() {}\n\nfunc (*event_PayloadServerUniquenessPolicyDisabled) isEvent_Payload() {}\n\nfunc (*event_ServerResourceVisibilityControlChanged) isEvent_Payload() {}\n\nfunc (*event_UserAutoMergedFromNewIdp) isEvent_Payload() {}\n\nfunc (*event_DeviceAuthorizationGrantApproved) isEvent_Payload() {}\n\nfunc (*event_DeviceAuthorizationGrantDenied) isEvent_Payload() {}\n\nfunc (*event_PluginLabelCreated) isEvent_Payload() {}\n\nfunc (*event_PluginLabelMoved) isEvent_Payload() {}\n\nfunc (*event_PluginLabelArchived) isEvent_Payload() {}\n\nfunc (*event_PluginLabelUnarchived) isEvent_Payload() {}\n\nfunc (*event_ServerReviewFlowEnabled) isEvent_Payload() {}\n\nfunc (*event_ServerReviewFlowDisabled) isEvent_Payload() {}\n\nfunc (*event_SdkPluginConstraintCreated) isEvent_Payload() {}\n\nfunc (*event_SdkPluginConstraintUpdated) isEvent_Payload() {}\n\nfunc (*event_SdkPluginConstraintDeleted) isEvent_Payload() {}\n\nfunc (*event_PolicyEnforcementCreated) isEvent_Payload() {}\n\nfunc (*event_PolicyEnforcementDeleted) isEvent_Payload() {}\n\nfunc (*event_PolicyEnforcementPolicyChanged) isEvent_Payload() {}\n\nfunc (*event_PolicyEnforcementTargetsChanged) isEvent_Payload() {}\n\ntype PayloadOrganizationCreated struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationCreated) Reset() {\n\t*x = PayloadOrganizationCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationCreated) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\ntype PayloadOrganizationCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadOrganizationCreated_builder) Build() *PayloadOrganizationCreated {\n\tm0 := &PayloadOrganizationCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadOrganizationDeleted struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationDeleted) Reset() {\n\t*x = PayloadOrganizationDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationDeleted) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\ntype PayloadOrganizationDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadOrganizationDeleted_builder) Build() *PayloadOrganizationDeleted {\n\tm0 := &PayloadOrganizationDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadOrganizationMemberAdded struct {\n\tstate                       protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                          `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationName string                          `protobuf:\"bytes,2,opt,name=organization_name,json=organizationName,proto3\"`\n\txxx_hidden_MemberRole       v1alpha1.OrganizationRole       `protobuf:\"varint,3,opt,name=member_role,json=memberRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\txxx_hidden_MemberRoleSource v1alpha1.OrganizationRoleSource `protobuf:\"varint,4,opt,name=member_role_source,json=memberRoleSource,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRoleSource\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationMemberAdded) Reset() {\n\t*x = PayloadOrganizationMemberAdded{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationMemberAdded) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationMemberAdded) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationMemberAdded) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\nfunc (x *PayloadOrganizationMemberAdded) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberAdded) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberAdded) GetMemberRole() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MemberRole\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationMemberAdded) GetMemberRoleSource() v1alpha1.OrganizationRoleSource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MemberRoleSource\n\t}\n\treturn v1alpha1.OrganizationRoleSource(0)\n}\n\nfunc (x *PayloadOrganizationMemberAdded) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *PayloadOrganizationMemberAdded) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\nfunc (x *PayloadOrganizationMemberAdded) SetMemberRole(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_MemberRole = v\n}\n\nfunc (x *PayloadOrganizationMemberAdded) SetMemberRoleSource(v v1alpha1.OrganizationRoleSource) {\n\tx.xxx_hidden_MemberRoleSource = v\n}\n\ntype PayloadOrganizationMemberAdded_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// organization_id is the id of the organization with the new member.\n\tOrganizationId string\n\t// organization_name is the name of the organization with the new member.\n\tOrganizationName string\n\t// member_role is the role granted to the member added to the organization.\n\tMemberRole v1alpha1.OrganizationRole\n\t// member_role_source is the source of the role granted to the member.\n\tMemberRoleSource v1alpha1.OrganizationRoleSource\n}\n\nfunc (b0 PayloadOrganizationMemberAdded_builder) Build() *PayloadOrganizationMemberAdded {\n\tm0 := &PayloadOrganizationMemberAdded{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\tx.xxx_hidden_MemberRole = b.MemberRole\n\tx.xxx_hidden_MemberRoleSource = b.MemberRoleSource\n\treturn m0\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadOrganizationMemberRoleChanged struct {\n\tstate                          protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId      string                          `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationName    string                          `protobuf:\"bytes,2,opt,name=organization_name,json=organizationName,proto3\"`\n\txxx_hidden_OldRole             v1alpha1.OrganizationRole       `protobuf:\"varint,3,opt,name=old_role,json=oldRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\txxx_hidden_NewRole             v1alpha1.OrganizationRole       `protobuf:\"varint,4,opt,name=new_role,json=newRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\txxx_hidden_OldMemberRoleSource v1alpha1.OrganizationRoleSource `protobuf:\"varint,5,opt,name=old_member_role_source,json=oldMemberRoleSource,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRoleSource\"`\n\txxx_hidden_NewMemberRoleSource v1alpha1.OrganizationRoleSource `protobuf:\"varint,6,opt,name=new_member_role_source,json=newMemberRoleSource,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRoleSource\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) Reset() {\n\t*x = PayloadOrganizationMemberRoleChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationMemberRoleChanged) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\nfunc (x *PayloadOrganizationMemberRoleChanged) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) GetOldRole() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldRole\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) GetNewRole() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewRole\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) GetOldMemberRoleSource() v1alpha1.OrganizationRoleSource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldMemberRoleSource\n\t}\n\treturn v1alpha1.OrganizationRoleSource(0)\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) GetNewMemberRoleSource() v1alpha1.OrganizationRoleSource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewMemberRoleSource\n\t}\n\treturn v1alpha1.OrganizationRoleSource(0)\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) SetOldRole(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_OldRole = v\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) SetNewRole(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_NewRole = v\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) SetOldMemberRoleSource(v v1alpha1.OrganizationRoleSource) {\n\tx.xxx_hidden_OldMemberRoleSource = v\n}\n\nfunc (x *PayloadOrganizationMemberRoleChanged) SetNewMemberRoleSource(v v1alpha1.OrganizationRoleSource) {\n\tx.xxx_hidden_NewMemberRoleSource = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadOrganizationMemberRoleChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// organization_id is the id of the organization within which the role was changed.\n\tOrganizationId string\n\t// organization_name is the name of the organization within which the role was changed.\n\tOrganizationName string\n\t// old_role is the old role of the member whose role was changed.\n\tOldRole v1alpha1.OrganizationRole\n\t// new_role is the new role of the member whose role was changed.\n\tNewRole v1alpha1.OrganizationRole\n\t// old_member_role_source is the old source of the role granted to the member.\n\tOldMemberRoleSource v1alpha1.OrganizationRoleSource\n\t// new_member_role_source is the new source of the role granted to the member.\n\tNewMemberRoleSource v1alpha1.OrganizationRoleSource\n}\n\nfunc (b0 PayloadOrganizationMemberRoleChanged_builder) Build() *PayloadOrganizationMemberRoleChanged {\n\tm0 := &PayloadOrganizationMemberRoleChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\tx.xxx_hidden_OldRole = b.OldRole\n\tx.xxx_hidden_NewRole = b.NewRole\n\tx.xxx_hidden_OldMemberRoleSource = b.OldMemberRoleSource\n\tx.xxx_hidden_NewMemberRoleSource = b.NewMemberRoleSource\n\treturn m0\n}\n\ntype PayloadOrganizationMemberRolesChanged struct {\n\tstate                       protoimpl.MessageState                                     `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                                                     `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationName string                                                     `protobuf:\"bytes,2,opt,name=organization_name,json=organizationName,proto3\"`\n\txxx_hidden_OldRoles         *[]*PayloadOrganizationMemberRolesChanged_OrganizationRole `protobuf:\"bytes,3,rep,name=old_roles,json=oldRoles,proto3\"`\n\txxx_hidden_NewRoles         *[]*PayloadOrganizationMemberRolesChanged_OrganizationRole `protobuf:\"bytes,4,rep,name=new_roles,json=newRoles,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) Reset() {\n\t*x = PayloadOrganizationMemberRolesChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationMemberRolesChanged) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_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\nfunc (x *PayloadOrganizationMemberRolesChanged) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) GetOldRoles() []*PayloadOrganizationMemberRolesChanged_OrganizationRole {\n\tif x != nil {\n\t\tif x.xxx_hidden_OldRoles != nil {\n\t\t\treturn *x.xxx_hidden_OldRoles\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) GetNewRoles() []*PayloadOrganizationMemberRolesChanged_OrganizationRole {\n\tif x != nil {\n\t\tif x.xxx_hidden_NewRoles != nil {\n\t\t\treturn *x.xxx_hidden_NewRoles\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) SetOldRoles(v []*PayloadOrganizationMemberRolesChanged_OrganizationRole) {\n\tx.xxx_hidden_OldRoles = &v\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged) SetNewRoles(v []*PayloadOrganizationMemberRolesChanged_OrganizationRole) {\n\tx.xxx_hidden_NewRoles = &v\n}\n\ntype PayloadOrganizationMemberRolesChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// organization_id is the id of the organization within which the roles was changed.\n\tOrganizationId string\n\t// organization_name is the name of the organization within which the roles was changed.\n\tOrganizationName string\n\t// old_roles are the old roles of the member.\n\tOldRoles []*PayloadOrganizationMemberRolesChanged_OrganizationRole\n\t// new_roles are the new roles of the member.\n\tNewRoles []*PayloadOrganizationMemberRolesChanged_OrganizationRole\n}\n\nfunc (b0 PayloadOrganizationMemberRolesChanged_builder) Build() *PayloadOrganizationMemberRolesChanged {\n\tm0 := &PayloadOrganizationMemberRolesChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\tx.xxx_hidden_OldRoles = &b.OldRoles\n\tx.xxx_hidden_NewRoles = &b.NewRoles\n\treturn m0\n}\n\ntype PayloadOrganizationMemberRemoved struct {\n\tstate                       protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                          `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationName string                          `protobuf:\"bytes,2,opt,name=organization_name,json=organizationName,proto3\"`\n\txxx_hidden_MemberRole       v1alpha1.OrganizationRole       `protobuf:\"varint,3,opt,name=member_role,json=memberRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\txxx_hidden_MemberRoleSource v1alpha1.OrganizationRoleSource `protobuf:\"varint,4,opt,name=member_role_source,json=memberRoleSource,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRoleSource\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) Reset() {\n\t*x = PayloadOrganizationMemberRemoved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationMemberRemoved) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationMemberRemoved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[9]\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\nfunc (x *PayloadOrganizationMemberRemoved) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) GetMemberRole() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MemberRole\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) GetMemberRoleSource() v1alpha1.OrganizationRoleSource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MemberRoleSource\n\t}\n\treturn v1alpha1.OrganizationRoleSource(0)\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) SetMemberRole(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_MemberRole = v\n}\n\nfunc (x *PayloadOrganizationMemberRemoved) SetMemberRoleSource(v v1alpha1.OrganizationRoleSource) {\n\tx.xxx_hidden_MemberRoleSource = v\n}\n\ntype PayloadOrganizationMemberRemoved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// organization_id is the id of the organization that the member was removed from.\n\tOrganizationId string\n\t// organization_name is the name of the organization that the member was removed from.\n\tOrganizationName string\n\t// member_role is the role that the member had when removed from the organization.\n\tMemberRole v1alpha1.OrganizationRole\n\t// member_role_source is the source of the role granted to the member.\n\tMemberRoleSource v1alpha1.OrganizationRoleSource\n}\n\nfunc (b0 PayloadOrganizationMemberRemoved_builder) Build() *PayloadOrganizationMemberRemoved {\n\tm0 := &PayloadOrganizationMemberRemoved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\tx.xxx_hidden_MemberRole = b.MemberRole\n\tx.xxx_hidden_MemberRoleSource = b.MemberRoleSource\n\treturn m0\n}\n\ntype PayloadOrganizationIDPGroupAdded struct {\n\tstate                       protoimpl.MessageState    `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                    `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationName string                    `protobuf:\"bytes,2,opt,name=organization_name,json=organizationName,proto3\"`\n\txxx_hidden_RoleOverride     v1alpha1.OrganizationRole `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) Reset() {\n\t*x = PayloadOrganizationIDPGroupAdded{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationIDPGroupAdded) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[10]\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\nfunc (x *PayloadOrganizationIDPGroupAdded) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) GetRoleOverride() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RoleOverride\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\nfunc (x *PayloadOrganizationIDPGroupAdded) SetRoleOverride(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_RoleOverride = v\n}\n\ntype PayloadOrganizationIDPGroupAdded_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// organization_id is the id of the organization with the new IDP group.\n\tOrganizationId string\n\t// organization_name is the name of the organization with the new IDP group.\n\tOrganizationName string\n\t// role_override is the role override associated with the new IDP group.\n\tRoleOverride v1alpha1.OrganizationRole\n}\n\nfunc (b0 PayloadOrganizationIDPGroupAdded_builder) Build() *PayloadOrganizationIDPGroupAdded {\n\tm0 := &PayloadOrganizationIDPGroupAdded{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\tx.xxx_hidden_RoleOverride = b.RoleOverride\n\treturn m0\n}\n\ntype PayloadOrganizationIDPGroupUpdated struct {\n\tstate                       protoimpl.MessageState    `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                    `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationName string                    `protobuf:\"bytes,2,opt,name=organization_name,json=organizationName,proto3\"`\n\txxx_hidden_OldRoleOverride  v1alpha1.OrganizationRole `protobuf:\"varint,3,opt,name=old_role_override,json=oldRoleOverride,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\txxx_hidden_NewRoleOverride  v1alpha1.OrganizationRole `protobuf:\"varint,4,opt,name=new_role_override,json=newRoleOverride,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) Reset() {\n\t*x = PayloadOrganizationIDPGroupUpdated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationIDPGroupUpdated) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[11]\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\nfunc (x *PayloadOrganizationIDPGroupUpdated) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) GetOldRoleOverride() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldRoleOverride\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) GetNewRoleOverride() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewRoleOverride\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) SetOldRoleOverride(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_OldRoleOverride = v\n}\n\nfunc (x *PayloadOrganizationIDPGroupUpdated) SetNewRoleOverride(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_NewRoleOverride = v\n}\n\ntype PayloadOrganizationIDPGroupUpdated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// organization_id is the id of the organization with the updated IDP group.\n\tOrganizationId string\n\t// organization_name is the name of the organization with the updated IDP group.\n\tOrganizationName string\n\t// old_role_override is the role override associated with the IDP updated group. Only set if the\n\t// role override was changed.\n\tOldRoleOverride v1alpha1.OrganizationRole\n\t// new_role_override is the role override associated with the IDP updated group. Only set if the\n\t// role override was changed.\n\tNewRoleOverride v1alpha1.OrganizationRole\n}\n\nfunc (b0 PayloadOrganizationIDPGroupUpdated_builder) Build() *PayloadOrganizationIDPGroupUpdated {\n\tm0 := &PayloadOrganizationIDPGroupUpdated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\tx.xxx_hidden_OldRoleOverride = b.OldRoleOverride\n\tx.xxx_hidden_NewRoleOverride = b.NewRoleOverride\n\treturn m0\n}\n\ntype PayloadOrganizationIDPGroupRemoved struct {\n\tstate                       protoimpl.MessageState    `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                    `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationName string                    `protobuf:\"bytes,2,opt,name=organization_name,json=organizationName,proto3\"`\n\txxx_hidden_RoleOverride     v1alpha1.OrganizationRole `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) Reset() {\n\t*x = PayloadOrganizationIDPGroupRemoved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationIDPGroupRemoved) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[12]\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\nfunc (x *PayloadOrganizationIDPGroupRemoved) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) GetRoleOverride() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RoleOverride\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\nfunc (x *PayloadOrganizationIDPGroupRemoved) SetRoleOverride(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_RoleOverride = v\n}\n\ntype PayloadOrganizationIDPGroupRemoved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// organization_id is the id of the organization with the removed IDP group.\n\tOrganizationId string\n\t// organization_name is the name of the organization with the removed IDP group.\n\tOrganizationName string\n\t// role_override is the role override associated with the removed IDP group.\n\tRoleOverride v1alpha1.OrganizationRole\n}\n\nfunc (b0 PayloadOrganizationIDPGroupRemoved_builder) Build() *PayloadOrganizationIDPGroupRemoved {\n\tm0 := &PayloadOrganizationIDPGroupRemoved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\tx.xxx_hidden_RoleOverride = b.RoleOverride\n\treturn m0\n}\n\ntype PayloadRepositoryCreated struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId          string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName        string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility       v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_DefaultLabelName string                 `protobuf:\"bytes,4,opt,name=default_label_name,json=defaultLabelName,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryCreated) Reset() {\n\t*x = PayloadRepositoryCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryCreated) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[13]\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\nfunc (x *PayloadRepositoryCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCreated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCreated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadRepositoryCreated) GetDefaultLabelName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DefaultLabelName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryCreated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryCreated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *PayloadRepositoryCreated) SetDefaultLabelName(v string) {\n\tx.xxx_hidden_DefaultLabelName = v\n}\n\ntype PayloadRepositoryCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// visibility is the visibility of the repository.\n\tVisibility v1alpha1.Visibility\n\t// default_label_name is the name of the default label for the repository.\n\t// If empty, the repository was created with the default label name of 'main'.\n\tDefaultLabelName string\n}\n\nfunc (b0 PayloadRepositoryCreated_builder) Build() *PayloadRepositoryCreated {\n\tm0 := &PayloadRepositoryCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\tx.xxx_hidden_DefaultLabelName = b.DefaultLabelName\n\treturn m0\n}\n\ntype PayloadRepositoryDeleted struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryDeleted) Reset() {\n\t*x = PayloadRepositoryDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryDeleted) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[14]\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\nfunc (x *PayloadRepositoryDeleted) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDeleted) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDeleted) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadRepositoryDeleted) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryDeleted) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryDeleted) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadRepositoryDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// visibility is the visibility of the repository.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadRepositoryDeleted_builder) Build() *PayloadRepositoryDeleted {\n\tm0 := &PayloadRepositoryDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadRepositoryDeprecated struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId            string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName          string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility         v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_DeprecationMessage string                 `protobuf:\"bytes,4,opt,name=deprecation_message,json=deprecationMessage,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryDeprecated) Reset() {\n\t*x = PayloadRepositoryDeprecated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryDeprecated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryDeprecated) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryDeprecated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[15]\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\nfunc (x *PayloadRepositoryDeprecated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDeprecated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDeprecated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadRepositoryDeprecated) GetDeprecationMessage() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DeprecationMessage\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDeprecated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryDeprecated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryDeprecated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *PayloadRepositoryDeprecated) SetDeprecationMessage(v string) {\n\tx.xxx_hidden_DeprecationMessage = v\n}\n\ntype PayloadRepositoryDeprecated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// visibility is the visibility of the repository.\n\tVisibility v1alpha1.Visibility\n\t// deprecation_message is the deprecation message set by the deprecation actor.\n\tDeprecationMessage string\n}\n\nfunc (b0 PayloadRepositoryDeprecated_builder) Build() *PayloadRepositoryDeprecated {\n\tm0 := &PayloadRepositoryDeprecated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\tx.xxx_hidden_DeprecationMessage = b.DeprecationMessage\n\treturn m0\n}\n\ntype PayloadRepositoryUndeprecated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryUndeprecated) Reset() {\n\t*x = PayloadRepositoryUndeprecated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryUndeprecated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryUndeprecated) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryUndeprecated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[16]\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\nfunc (x *PayloadRepositoryUndeprecated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryUndeprecated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryUndeprecated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadRepositoryUndeprecated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryUndeprecated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryUndeprecated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadRepositoryUndeprecated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// visibility is the visibility of the repository.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadRepositoryUndeprecated_builder) Build() *PayloadRepositoryUndeprecated {\n\tm0 := &PayloadRepositoryUndeprecated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadRepositoryCommitPushed struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Tags           []string               `protobuf:\"bytes,5,rep,name=tags,proto3\"`\n\txxx_hidden_DraftName      string                 `protobuf:\"bytes,6,opt,name=draft_name,json=draftName,proto3\"`\n\txxx_hidden_ManifestDigest string                 `protobuf:\"bytes,7,opt,name=manifest_digest,json=manifestDigest,proto3\"`\n\txxx_hidden_B5Digest       string                 `protobuf:\"bytes,8,opt,name=b5_digest,json=b5Digest,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryCommitPushed) Reset() {\n\t*x = PayloadRepositoryCommitPushed{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryCommitPushed) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryCommitPushed) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryCommitPushed) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[17]\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\nfunc (x *PayloadRepositoryCommitPushed) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitPushed) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitPushed) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitPushed) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitPushed) GetTags() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Tags\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadRepositoryCommitPushed) GetDraftName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DraftName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitPushed) GetManifestDigest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ManifestDigest\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitPushed) GetB5Digest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_B5Digest\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetTags(v []string) {\n\tx.xxx_hidden_Tags = v\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetDraftName(v string) {\n\tx.xxx_hidden_DraftName = v\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetManifestDigest(v string) {\n\tx.xxx_hidden_ManifestDigest = v\n}\n\nfunc (x *PayloadRepositoryCommitPushed) SetB5Digest(v string) {\n\tx.xxx_hidden_B5Digest = v\n}\n\ntype PayloadRepositoryCommitPushed_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// repository_id is the id of the repository within which the commit was created.\n\tRepositoryId string\n\t// repository_name is the name of the repository within which the commit was created.\n\tRepositoryName string\n\t// tags are the tags included in the push. Optional.\n\tTags []string\n\t// draft_name is the name of the draft. Optional.\n\tDraftName string\n\t// manifest_digest is the module's manifest digest.\n\tManifestDigest string\n\t// b5_digest is the module's b5 digest.\n\tB5Digest string\n}\n\nfunc (b0 PayloadRepositoryCommitPushed_builder) Build() *PayloadRepositoryCommitPushed {\n\tm0 := &PayloadRepositoryCommitPushed{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Tags = b.Tags\n\tx.xxx_hidden_DraftName = b.DraftName\n\tx.xxx_hidden_ManifestDigest = b.ManifestDigest\n\tx.xxx_hidden_B5Digest = b.B5Digest\n\treturn m0\n}\n\ntype PayloadRepositoryContributorAdded struct {\n\tstate                      protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId         string                  `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName       string                  `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId    string                  `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName  string                  `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_ContributorRole v1alpha1.RepositoryRole `protobuf:\"varint,5,opt,name=contributor_role,json=contributorRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryContributorAdded) Reset() {\n\t*x = PayloadRepositoryContributorAdded{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryContributorAdded) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryContributorAdded) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryContributorAdded) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[18]\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\nfunc (x *PayloadRepositoryContributorAdded) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorAdded) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorAdded) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorAdded) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorAdded) GetContributorRole() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ContributorRole\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryContributorAdded) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryContributorAdded) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryContributorAdded) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryContributorAdded) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryContributorAdded) SetContributorRole(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_ContributorRole = v\n}\n\ntype PayloadRepositoryContributorAdded_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// repository_id is the id of the repository with the new contributor.\n\tRepositoryId string\n\t// repository_name is the name of the repository with the new contributor.\n\tRepositoryName string\n\t// contributor_role is the role granted to the contributor added to the repository.\n\tContributorRole v1alpha1.RepositoryRole\n}\n\nfunc (b0 PayloadRepositoryContributorAdded_builder) Build() *PayloadRepositoryContributorAdded {\n\tm0 := &PayloadRepositoryContributorAdded{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_ContributorRole = b.ContributorRole\n\treturn m0\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadRepositoryContributorRoleChanged struct {\n\tstate                     protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                  `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                  `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                  `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                  `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_OldRole        v1alpha1.RepositoryRole `protobuf:\"varint,5,opt,name=old_role,json=oldRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\txxx_hidden_NewRole        v1alpha1.RepositoryRole `protobuf:\"varint,6,opt,name=new_role,json=newRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) Reset() {\n\t*x = PayloadRepositoryContributorRoleChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryContributorRoleChanged) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[19]\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\nfunc (x *PayloadRepositoryContributorRoleChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) GetOldRole() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldRole\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) GetNewRole() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewRole\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) SetOldRole(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_OldRole = v\n}\n\nfunc (x *PayloadRepositoryContributorRoleChanged) SetNewRole(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_NewRole = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadRepositoryContributorRoleChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// repository_id is the id of the repository within which the role was changed.\n\tRepositoryId string\n\t// repository_name is the name of the repository within which the role was changed.\n\tRepositoryName string\n\t// old_role is the old role of the contributor whose role was changed.\n\tOldRole v1alpha1.RepositoryRole\n\t// new_role is the new role of the contributor whose role was changed.\n\tNewRole v1alpha1.RepositoryRole\n}\n\nfunc (b0 PayloadRepositoryContributorRoleChanged_builder) Build() *PayloadRepositoryContributorRoleChanged {\n\tm0 := &PayloadRepositoryContributorRoleChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_OldRole = b.OldRole\n\tx.xxx_hidden_NewRole = b.NewRole\n\treturn m0\n}\n\ntype PayloadRepositoryContributorRolesChanged struct {\n\tstate                     protoimpl.MessageState                                      `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                                                      `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                                                      `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                                                      `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                                                      `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_OldRoles       *[]*PayloadRepositoryContributorRolesChanged_RepositoryRole `protobuf:\"bytes,5,rep,name=old_roles,json=oldRoles,proto3\"`\n\txxx_hidden_NewRoles       *[]*PayloadRepositoryContributorRolesChanged_RepositoryRole `protobuf:\"bytes,6,rep,name=new_roles,json=newRoles,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) Reset() {\n\t*x = PayloadRepositoryContributorRolesChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryContributorRolesChanged) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[20]\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\nfunc (x *PayloadRepositoryContributorRolesChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) GetOldRoles() []*PayloadRepositoryContributorRolesChanged_RepositoryRole {\n\tif x != nil {\n\t\tif x.xxx_hidden_OldRoles != nil {\n\t\t\treturn *x.xxx_hidden_OldRoles\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) GetNewRoles() []*PayloadRepositoryContributorRolesChanged_RepositoryRole {\n\tif x != nil {\n\t\tif x.xxx_hidden_NewRoles != nil {\n\t\t\treturn *x.xxx_hidden_NewRoles\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) SetOldRoles(v []*PayloadRepositoryContributorRolesChanged_RepositoryRole) {\n\tx.xxx_hidden_OldRoles = &v\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged) SetNewRoles(v []*PayloadRepositoryContributorRolesChanged_RepositoryRole) {\n\tx.xxx_hidden_NewRoles = &v\n}\n\ntype PayloadRepositoryContributorRolesChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// repository_id is the id of the repository within which the role was changed.\n\tRepositoryId string\n\t// repository_name is the name of the repository within which the role was changed.\n\tRepositoryName string\n\t// old_roles are the old roles of the contributor.\n\tOldRoles []*PayloadRepositoryContributorRolesChanged_RepositoryRole\n\t// new_roles are the new roles of the contributor.\n\tNewRoles []*PayloadRepositoryContributorRolesChanged_RepositoryRole\n}\n\nfunc (b0 PayloadRepositoryContributorRolesChanged_builder) Build() *PayloadRepositoryContributorRolesChanged {\n\tm0 := &PayloadRepositoryContributorRolesChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_OldRoles = &b.OldRoles\n\tx.xxx_hidden_NewRoles = &b.NewRoles\n\treturn m0\n}\n\ntype PayloadRepositoryContributorRemoved struct {\n\tstate                      protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId         string                  `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName       string                  `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId    string                  `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName  string                  `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_ContributorRole v1alpha1.RepositoryRole `protobuf:\"varint,5,opt,name=contributor_role,json=contributorRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) Reset() {\n\t*x = PayloadRepositoryContributorRemoved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryContributorRemoved) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryContributorRemoved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[21]\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\nfunc (x *PayloadRepositoryContributorRemoved) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) GetContributorRole() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ContributorRole\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryContributorRemoved) SetContributorRole(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_ContributorRole = v\n}\n\ntype PayloadRepositoryContributorRemoved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// repository_id is the id of the repository that the contributor was removed from.\n\tRepositoryId string\n\t// repository_name is the name of the repository that the contributor was removed from.\n\tRepositoryName string\n\t// contributor_role is the role that the contributor had when removed from the repository.\n\tContributorRole v1alpha1.RepositoryRole\n}\n\nfunc (b0 PayloadRepositoryContributorRemoved_builder) Build() *PayloadRepositoryContributorRemoved {\n\tm0 := &PayloadRepositoryContributorRemoved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_ContributorRole = b.ContributorRole\n\treturn m0\n}\n\ntype PayloadRepositoryVisibilityChanged struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId       string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName     string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_OldVisibility v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=old_visibility,json=oldVisibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_NewVisibility v1alpha1.Visibility    `protobuf:\"varint,4,opt,name=new_visibility,json=newVisibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) Reset() {\n\t*x = PayloadRepositoryVisibilityChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryVisibilityChanged) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryVisibilityChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[22]\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\nfunc (x *PayloadRepositoryVisibilityChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) GetOldVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldVisibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) GetNewVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewVisibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) SetOldVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_OldVisibility = v\n}\n\nfunc (x *PayloadRepositoryVisibilityChanged) SetNewVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_NewVisibility = v\n}\n\ntype PayloadRepositoryVisibilityChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// old_visibility is the old visibility of the repository.\n\tOldVisibility v1alpha1.Visibility\n\t// new_visibility is the new visibility of the repository.\n\tNewVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadRepositoryVisibilityChanged_builder) Build() *PayloadRepositoryVisibilityChanged {\n\tm0 := &PayloadRepositoryVisibilityChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_OldVisibility = b.OldVisibility\n\tx.xxx_hidden_NewVisibility = b.NewVisibility\n\treturn m0\n}\n\ntype PayloadRepositoryDefaultLabelNameChanged struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId             string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName           string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_OldDefaultLabelName string                 `protobuf:\"bytes,3,opt,name=old_default_label_name,json=oldDefaultLabelName,proto3\"`\n\txxx_hidden_NewDefaultLabelName string                 `protobuf:\"bytes,4,opt,name=new_default_label_name,json=newDefaultLabelName,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) Reset() {\n\t*x = PayloadRepositoryDefaultLabelNameChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryDefaultLabelNameChanged) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[23]\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\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) GetOldDefaultLabelName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldDefaultLabelName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) GetNewDefaultLabelName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewDefaultLabelName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) SetOldDefaultLabelName(v string) {\n\tx.xxx_hidden_OldDefaultLabelName = v\n}\n\nfunc (x *PayloadRepositoryDefaultLabelNameChanged) SetNewDefaultLabelName(v string) {\n\tx.xxx_hidden_NewDefaultLabelName = v\n}\n\ntype PayloadRepositoryDefaultLabelNameChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// old_default_label_name is the old default label name of the repository.\n\tOldDefaultLabelName string\n\t// new_default_label_name is the new default label name of the repository.\n\tNewDefaultLabelName string\n}\n\nfunc (b0 PayloadRepositoryDefaultLabelNameChanged_builder) Build() *PayloadRepositoryDefaultLabelNameChanged {\n\tm0 := &PayloadRepositoryDefaultLabelNameChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_OldDefaultLabelName = b.OldDefaultLabelName\n\tx.xxx_hidden_NewDefaultLabelName = b.NewDefaultLabelName\n\treturn m0\n}\n\n// PayloadRepositoryDefaultBranchChanged is deprecated.\n//\n// Use PayloadRepositoryDefaultLabelNameChanged instead.\n//\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadRepositoryDefaultBranchChanged struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId          string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName        string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_OldDefaultBranch string                 `protobuf:\"bytes,3,opt,name=old_default_branch,json=oldDefaultBranch,proto3\"`\n\txxx_hidden_NewDefaultBranch string                 `protobuf:\"bytes,4,opt,name=new_default_branch,json=newDefaultBranch,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) Reset() {\n\t*x = PayloadRepositoryDefaultBranchChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[24]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryDefaultBranchChanged) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[24]\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\nfunc (x *PayloadRepositoryDefaultBranchChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) GetOldDefaultBranch() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldDefaultBranch\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) GetNewDefaultBranch() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewDefaultBranch\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) SetOldDefaultBranch(v string) {\n\tx.xxx_hidden_OldDefaultBranch = v\n}\n\nfunc (x *PayloadRepositoryDefaultBranchChanged) SetNewDefaultBranch(v string) {\n\tx.xxx_hidden_NewDefaultBranch = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadRepositoryDefaultBranchChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository.\n\tOwnerName string\n\t// old_default_branch is the old default branch of the repository.\n\tOldDefaultBranch string\n\t// new_default_branch is the new default branch of the repository.\n\tNewDefaultBranch string\n}\n\nfunc (b0 PayloadRepositoryDefaultBranchChanged_builder) Build() *PayloadRepositoryDefaultBranchChanged {\n\tm0 := &PayloadRepositoryDefaultBranchChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_OldDefaultBranch = b.OldDefaultBranch\n\tx.xxx_hidden_NewDefaultBranch = b.NewDefaultBranch\n\treturn m0\n}\n\ntype PayloadRepositoryIDPGroupAdded struct {\n\tstate                     protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId   string                  `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                  `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_RoleOverride   v1alpha1.RepositoryRole `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) Reset() {\n\t*x = PayloadRepositoryIDPGroupAdded{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[25]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryIDPGroupAdded) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[25]\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\nfunc (x *PayloadRepositoryIDPGroupAdded) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) GetRoleOverride() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RoleOverride\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryIDPGroupAdded) SetRoleOverride(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_RoleOverride = v\n}\n\ntype PayloadRepositoryIDPGroupAdded_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// repository_id is the id of the repository with the new IDP group.\n\tRepositoryId string\n\t// repository_name is the name of the repository with the new IDP group.\n\tRepositoryName string\n\t// role_override is the role override associated with the new IDP group.\n\tRoleOverride v1alpha1.RepositoryRole\n}\n\nfunc (b0 PayloadRepositoryIDPGroupAdded_builder) Build() *PayloadRepositoryIDPGroupAdded {\n\tm0 := &PayloadRepositoryIDPGroupAdded{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_RoleOverride = b.RoleOverride\n\treturn m0\n}\n\ntype PayloadRepositoryIDPGroupUpdated struct {\n\tstate                      protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId    string                  `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName  string                  `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_OldRoleOverride v1alpha1.RepositoryRole `protobuf:\"varint,3,opt,name=old_role_override,json=oldRoleOverride,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\txxx_hidden_NewRoleOverride v1alpha1.RepositoryRole `protobuf:\"varint,4,opt,name=new_role_override,json=newRoleOverride,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) Reset() {\n\t*x = PayloadRepositoryIDPGroupUpdated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[26]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryIDPGroupUpdated) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[26]\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\nfunc (x *PayloadRepositoryIDPGroupUpdated) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) GetOldRoleOverride() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldRoleOverride\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) GetNewRoleOverride() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewRoleOverride\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) SetOldRoleOverride(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_OldRoleOverride = v\n}\n\nfunc (x *PayloadRepositoryIDPGroupUpdated) SetNewRoleOverride(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_NewRoleOverride = v\n}\n\ntype PayloadRepositoryIDPGroupUpdated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// repository_id is the id of the repository with the updated IDP group.\n\tRepositoryId string\n\t// repository_name is the name of the repository with the updated IDP group.\n\tRepositoryName string\n\t// old_role_override is the role override associated with the IDP updated group. Only set if the\n\t// role override was changed.\n\tOldRoleOverride v1alpha1.RepositoryRole\n\t// new_role_override is the role override associated with the IDP updated group. Only set if the\n\t// role override was changed.\n\tNewRoleOverride v1alpha1.RepositoryRole\n}\n\nfunc (b0 PayloadRepositoryIDPGroupUpdated_builder) Build() *PayloadRepositoryIDPGroupUpdated {\n\tm0 := &PayloadRepositoryIDPGroupUpdated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_OldRoleOverride = b.OldRoleOverride\n\tx.xxx_hidden_NewRoleOverride = b.NewRoleOverride\n\treturn m0\n}\n\ntype PayloadRepositoryIDPGroupRemoved struct {\n\tstate                     protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId   string                  `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                  `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_RoleOverride   v1alpha1.RepositoryRole `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) Reset() {\n\t*x = PayloadRepositoryIDPGroupRemoved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[27]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryIDPGroupRemoved) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[27]\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\nfunc (x *PayloadRepositoryIDPGroupRemoved) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) GetRoleOverride() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RoleOverride\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryIDPGroupRemoved) SetRoleOverride(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_RoleOverride = v\n}\n\ntype PayloadRepositoryIDPGroupRemoved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// repository_id is the id of the repository with the removed IDP group.\n\tRepositoryId string\n\t// repository_name is the name of the repository with the removed IDP group.\n\tRepositoryName string\n\t// role_override is the role override associated with the removed IDP group.\n\tRoleOverride v1alpha1.RepositoryRole\n}\n\nfunc (b0 PayloadRepositoryIDPGroupRemoved_builder) Build() *PayloadRepositoryIDPGroupRemoved {\n\tm0 := &PayloadRepositoryIDPGroupRemoved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_RoleOverride = b.RoleOverride\n\treturn m0\n}\n\ntype PayloadPolicyCreated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyCreated) Reset() {\n\t*x = PayloadPolicyCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[28]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyCreated) ProtoMessage() {}\n\nfunc (x *PayloadPolicyCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[28]\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\nfunc (x *PayloadPolicyCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyCreated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyCreated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPolicyCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyCreated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyCreated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPolicyCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy.\n\tOwnerName string\n\t// visibility is the visibility of the policy.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPolicyCreated_builder) Build() *PayloadPolicyCreated {\n\tm0 := &PayloadPolicyCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPolicyDeleted struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyDeleted) Reset() {\n\t*x = PayloadPolicyDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[29]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyDeleted) ProtoMessage() {}\n\nfunc (x *PayloadPolicyDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[29]\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\nfunc (x *PayloadPolicyDeleted) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyDeleted) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyDeleted) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPolicyDeleted) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyDeleted) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyDeleted) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPolicyDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy.\n\tOwnerName string\n\t// visibility is the visibility of the policy.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPolicyDeleted_builder) Build() *PayloadPolicyDeleted {\n\tm0 := &PayloadPolicyDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPolicyDeprecated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyDeprecated) Reset() {\n\t*x = PayloadPolicyDeprecated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[30]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyDeprecated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyDeprecated) ProtoMessage() {}\n\nfunc (x *PayloadPolicyDeprecated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[30]\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\nfunc (x *PayloadPolicyDeprecated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyDeprecated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyDeprecated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPolicyDeprecated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyDeprecated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyDeprecated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPolicyDeprecated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy.\n\tOwnerName string\n\t// visibility is the visibility of the policy.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPolicyDeprecated_builder) Build() *PayloadPolicyDeprecated {\n\tm0 := &PayloadPolicyDeprecated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPolicyUndeprecated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyUndeprecated) Reset() {\n\t*x = PayloadPolicyUndeprecated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[31]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyUndeprecated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyUndeprecated) ProtoMessage() {}\n\nfunc (x *PayloadPolicyUndeprecated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[31]\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\nfunc (x *PayloadPolicyUndeprecated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyUndeprecated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyUndeprecated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPolicyUndeprecated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyUndeprecated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyUndeprecated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPolicyUndeprecated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy.\n\tOwnerName string\n\t// visibility is the visibility of the policy.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPolicyUndeprecated_builder) Build() *PayloadPolicyUndeprecated {\n\tm0 := &PayloadPolicyUndeprecated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPolicyVisibilityChanged struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId       string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName     string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_OldVisibility v1alpha1.Visibility    `protobuf:\"varint,4,opt,name=old_visibility,json=oldVisibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_NewVisibility v1alpha1.Visibility    `protobuf:\"varint,5,opt,name=new_visibility,json=newVisibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) Reset() {\n\t*x = PayloadPolicyVisibilityChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[32]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyVisibilityChanged) ProtoMessage() {}\n\nfunc (x *PayloadPolicyVisibilityChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[32]\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\nfunc (x *PayloadPolicyVisibilityChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) GetOldVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldVisibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) GetNewVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewVisibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) SetOldVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_OldVisibility = v\n}\n\nfunc (x *PayloadPolicyVisibilityChanged) SetNewVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_NewVisibility = v\n}\n\ntype PayloadPolicyVisibilityChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy.\n\tOwnerName string\n\t// old_visibility is the old visibility of the policy.\n\tOldVisibility v1alpha1.Visibility\n\t// new_visibility is the new visibility of the policy.\n\tNewVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPolicyVisibilityChanged_builder) Build() *PayloadPolicyVisibilityChanged {\n\tm0 := &PayloadPolicyVisibilityChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_OldVisibility = b.OldVisibility\n\tx.xxx_hidden_NewVisibility = b.NewVisibility\n\treturn m0\n}\n\ntype PayloadPolicyCommitPushed struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PolicyId   string                 `protobuf:\"bytes,3,opt,name=policy_id,json=policyId,proto3\"`\n\txxx_hidden_PolicyName string                 `protobuf:\"bytes,4,opt,name=policy_name,json=policyName,proto3\"`\n\txxx_hidden_O1Digest   string                 `protobuf:\"bytes,5,opt,name=o1_digest,json=o1Digest,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyCommitPushed) Reset() {\n\t*x = PayloadPolicyCommitPushed{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[33]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyCommitPushed) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyCommitPushed) ProtoMessage() {}\n\nfunc (x *PayloadPolicyCommitPushed) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[33]\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\nfunc (x *PayloadPolicyCommitPushed) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyCommitPushed) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyCommitPushed) GetPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyCommitPushed) GetPolicyName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyCommitPushed) GetO1Digest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_O1Digest\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyCommitPushed) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyCommitPushed) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyCommitPushed) SetPolicyId(v string) {\n\tx.xxx_hidden_PolicyId = v\n}\n\nfunc (x *PayloadPolicyCommitPushed) SetPolicyName(v string) {\n\tx.xxx_hidden_PolicyName = v\n}\n\nfunc (x *PayloadPolicyCommitPushed) SetO1Digest(v string) {\n\tx.xxx_hidden_O1Digest = v\n}\n\ntype PayloadPolicyCommitPushed_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy.\n\tOwnerName string\n\t// policy_id is the id of the policy within which the commit was created.\n\tPolicyId string\n\t// policy_name is the name of the policy within which the commit was created.\n\tPolicyName string\n\t// o1_digest is the o1 digest of the pushed policy commit.\n\tO1Digest string\n}\n\nfunc (b0 PayloadPolicyCommitPushed_builder) Build() *PayloadPolicyCommitPushed {\n\tm0 := &PayloadPolicyCommitPushed{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PolicyId = b.PolicyId\n\tx.xxx_hidden_PolicyName = b.PolicyName\n\tx.xxx_hidden_O1Digest = b.O1Digest\n\treturn m0\n}\n\ntype PayloadPluginCreated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginType string                 `protobuf:\"bytes,3,opt,name=plugin_type,json=pluginType,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginCreated) Reset() {\n\t*x = PayloadPluginCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[34]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginCreated) ProtoMessage() {}\n\nfunc (x *PayloadPluginCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[34]\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\nfunc (x *PayloadPluginCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCreated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCreated) GetPluginType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginType\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCreated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPluginCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginCreated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginCreated) SetPluginType(v string) {\n\tx.xxx_hidden_PluginType = v\n}\n\nfunc (x *PayloadPluginCreated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPluginCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin.\n\tOwnerName string\n\t// plugin_type is the type of the plugin.\n\tPluginType string\n\t// visibility is the visibility of the plugin.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPluginCreated_builder) Build() *PayloadPluginCreated {\n\tm0 := &PayloadPluginCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginType = b.PluginType\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPluginDeleted struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginType string                 `protobuf:\"bytes,3,opt,name=plugin_type,json=pluginType,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginDeleted) Reset() {\n\t*x = PayloadPluginDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[35]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginDeleted) ProtoMessage() {}\n\nfunc (x *PayloadPluginDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[35]\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\nfunc (x *PayloadPluginDeleted) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginDeleted) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginDeleted) GetPluginType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginType\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginDeleted) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPluginDeleted) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginDeleted) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginDeleted) SetPluginType(v string) {\n\tx.xxx_hidden_PluginType = v\n}\n\nfunc (x *PayloadPluginDeleted) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPluginDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the check plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the check plugin.\n\tOwnerName string\n\t// plugin_type is the type of the plugin.\n\tPluginType string\n\t// visibility is the visibility of the plugin.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPluginDeleted_builder) Build() *PayloadPluginDeleted {\n\tm0 := &PayloadPluginDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginType = b.PluginType\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPluginDeprecated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginType string                 `protobuf:\"bytes,3,opt,name=plugin_type,json=pluginType,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginDeprecated) Reset() {\n\t*x = PayloadPluginDeprecated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[36]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginDeprecated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginDeprecated) ProtoMessage() {}\n\nfunc (x *PayloadPluginDeprecated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[36]\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\nfunc (x *PayloadPluginDeprecated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginDeprecated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginDeprecated) GetPluginType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginType\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginDeprecated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPluginDeprecated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginDeprecated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginDeprecated) SetPluginType(v string) {\n\tx.xxx_hidden_PluginType = v\n}\n\nfunc (x *PayloadPluginDeprecated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPluginDeprecated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the check plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the check plugin.\n\tOwnerName string\n\t// plugin_type is the type of the plugin.\n\tPluginType string\n\t// visibility is the visibility of the plugin.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPluginDeprecated_builder) Build() *PayloadPluginDeprecated {\n\tm0 := &PayloadPluginDeprecated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginType = b.PluginType\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPluginUndeprecated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginType string                 `protobuf:\"bytes,3,opt,name=plugin_type,json=pluginType,proto3\"`\n\txxx_hidden_Visibility v1alpha1.Visibility    `protobuf:\"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginUndeprecated) Reset() {\n\t*x = PayloadPluginUndeprecated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[37]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginUndeprecated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginUndeprecated) ProtoMessage() {}\n\nfunc (x *PayloadPluginUndeprecated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[37]\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\nfunc (x *PayloadPluginUndeprecated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginUndeprecated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginUndeprecated) GetPluginType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginType\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginUndeprecated) GetVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPluginUndeprecated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginUndeprecated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginUndeprecated) SetPluginType(v string) {\n\tx.xxx_hidden_PluginType = v\n}\n\nfunc (x *PayloadPluginUndeprecated) SetVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype PayloadPluginUndeprecated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the check plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the check plugin.\n\tOwnerName string\n\t// plugin_type is the type of the plugin.\n\tPluginType string\n\t// visibility is the visibility of the plugin.\n\tVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPluginUndeprecated_builder) Build() *PayloadPluginUndeprecated {\n\tm0 := &PayloadPluginUndeprecated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginType = b.PluginType\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype PayloadPluginVisibilityChanged struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId       string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName     string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginType    string                 `protobuf:\"bytes,3,opt,name=plugin_type,json=pluginType,proto3\"`\n\txxx_hidden_OldVisibility v1alpha1.Visibility    `protobuf:\"varint,4,opt,name=old_visibility,json=oldVisibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_NewVisibility v1alpha1.Visibility    `protobuf:\"varint,5,opt,name=new_visibility,json=newVisibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginVisibilityChanged) Reset() {\n\t*x = PayloadPluginVisibilityChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[38]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginVisibilityChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginVisibilityChanged) ProtoMessage() {}\n\nfunc (x *PayloadPluginVisibilityChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[38]\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\nfunc (x *PayloadPluginVisibilityChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginVisibilityChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginVisibilityChanged) GetPluginType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginType\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginVisibilityChanged) GetOldVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldVisibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPluginVisibilityChanged) GetNewVisibility() v1alpha1.Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewVisibility\n\t}\n\treturn v1alpha1.Visibility(0)\n}\n\nfunc (x *PayloadPluginVisibilityChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginVisibilityChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginVisibilityChanged) SetPluginType(v string) {\n\tx.xxx_hidden_PluginType = v\n}\n\nfunc (x *PayloadPluginVisibilityChanged) SetOldVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_OldVisibility = v\n}\n\nfunc (x *PayloadPluginVisibilityChanged) SetNewVisibility(v v1alpha1.Visibility) {\n\tx.xxx_hidden_NewVisibility = v\n}\n\ntype PayloadPluginVisibilityChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the check plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the check plugin.\n\tOwnerName string\n\t// plugin_type is the type of the plugin.\n\tPluginType string\n\t// old_visibility is the old visibility of the plugin.\n\tOldVisibility v1alpha1.Visibility\n\t// new_visibility is the new visibility of the plugin.\n\tNewVisibility v1alpha1.Visibility\n}\n\nfunc (b0 PayloadPluginVisibilityChanged_builder) Build() *PayloadPluginVisibilityChanged {\n\tm0 := &PayloadPluginVisibilityChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginType = b.PluginType\n\tx.xxx_hidden_OldVisibility = b.OldVisibility\n\tx.xxx_hidden_NewVisibility = b.NewVisibility\n\treturn m0\n}\n\ntype PayloadPluginCommitPushed struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginId   string                 `protobuf:\"bytes,3,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName string                 `protobuf:\"bytes,4,opt,name=plugin_name,json=pluginName,proto3\"`\n\txxx_hidden_P1Digest   string                 `protobuf:\"bytes,5,opt,name=p1_digest,json=p1Digest,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginCommitPushed) Reset() {\n\t*x = PayloadPluginCommitPushed{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[39]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginCommitPushed) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginCommitPushed) ProtoMessage() {}\n\nfunc (x *PayloadPluginCommitPushed) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[39]\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\nfunc (x *PayloadPluginCommitPushed) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCommitPushed) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCommitPushed) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCommitPushed) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCommitPushed) GetP1Digest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_P1Digest\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginCommitPushed) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginCommitPushed) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginCommitPushed) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadPluginCommitPushed) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\nfunc (x *PayloadPluginCommitPushed) SetP1Digest(v string) {\n\tx.xxx_hidden_P1Digest = v\n}\n\ntype PayloadPluginCommitPushed_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin.\n\tOwnerName string\n\t// plugin_id is the id of the plugin.\n\tPluginId string\n\t// plugin_name is the name of the plugin.\n\tPluginName string\n\t// p1_digest is the p1 digest of the pushed plugin commit.\n\tP1Digest string\n}\n\nfunc (b0 PayloadPluginCommitPushed_builder) Build() *PayloadPluginCommitPushed {\n\tm0 := &PayloadPluginCommitPushed{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\tx.xxx_hidden_P1Digest = b.P1Digest\n\treturn m0\n}\n\ntype PayloadUserCreated struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadUserCreated) Reset() {\n\t*x = PayloadUserCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[40]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadUserCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadUserCreated) ProtoMessage() {}\n\nfunc (x *PayloadUserCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[40]\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\ntype PayloadUserCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadUserCreated_builder) Build() *PayloadUserCreated {\n\tm0 := &PayloadUserCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadUserReactivated struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadUserReactivated) Reset() {\n\t*x = PayloadUserReactivated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[41]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadUserReactivated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadUserReactivated) ProtoMessage() {}\n\nfunc (x *PayloadUserReactivated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[41]\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\ntype PayloadUserReactivated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadUserReactivated_builder) Build() *PayloadUserReactivated {\n\tm0 := &PayloadUserReactivated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadUserDeactivated struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadUserDeactivated) Reset() {\n\t*x = PayloadUserDeactivated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[42]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadUserDeactivated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadUserDeactivated) ProtoMessage() {}\n\nfunc (x *PayloadUserDeactivated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[42]\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\ntype PayloadUserDeactivated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadUserDeactivated_builder) Build() *PayloadUserDeactivated {\n\tm0 := &PayloadUserDeactivated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadUserDeleted struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadUserDeleted) Reset() {\n\t*x = PayloadUserDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[43]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadUserDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadUserDeleted) ProtoMessage() {}\n\nfunc (x *PayloadUserDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[43]\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\ntype PayloadUserDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadUserDeleted_builder) Build() *PayloadUserDeleted {\n\tm0 := &PayloadUserDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadUserLoggedIn struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadUserLoggedIn) Reset() {\n\t*x = PayloadUserLoggedIn{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[44]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadUserLoggedIn) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadUserLoggedIn) ProtoMessage() {}\n\nfunc (x *PayloadUserLoggedIn) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[44]\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\ntype PayloadUserLoggedIn_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadUserLoggedIn_builder) Build() *PayloadUserLoggedIn {\n\tm0 := &PayloadUserLoggedIn{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadUserLoggedOut struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadUserLoggedOut) Reset() {\n\t*x = PayloadUserLoggedOut{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[45]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadUserLoggedOut) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadUserLoggedOut) ProtoMessage() {}\n\nfunc (x *PayloadUserLoggedOut) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[45]\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\ntype PayloadUserLoggedOut_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadUserLoggedOut_builder) Build() *PayloadUserLoggedOut {\n\tm0 := &PayloadUserLoggedOut{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\n// PayloadUserAutoMergedFromNewIdP is the payload for the audit event\n// EVENT_TYPE_USER_AUTO_MERGED_FROM_NEW_IDP. It has no additional information\n// to be included, since the new user is automatically merged to an existing user\n// without the new user being created.\ntype PayloadUserAutoMergedFromNewIdP struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadUserAutoMergedFromNewIdP) Reset() {\n\t*x = PayloadUserAutoMergedFromNewIdP{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[46]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadUserAutoMergedFromNewIdP) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadUserAutoMergedFromNewIdP) ProtoMessage() {}\n\nfunc (x *PayloadUserAutoMergedFromNewIdP) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[46]\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\ntype PayloadUserAutoMergedFromNewIdP_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadUserAutoMergedFromNewIdP_builder) Build() *PayloadUserAutoMergedFromNewIdP {\n\tm0 := &PayloadUserAutoMergedFromNewIdP{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadCuratedPluginCreated struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId   string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *PayloadCuratedPluginCreated) Reset() {\n\t*x = PayloadCuratedPluginCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[47]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadCuratedPluginCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadCuratedPluginCreated) ProtoMessage() {}\n\nfunc (x *PayloadCuratedPluginCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[47]\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\nfunc (x *PayloadCuratedPluginCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadCuratedPluginCreated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadCuratedPluginCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadCuratedPluginCreated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\ntype PayloadCuratedPluginCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin.\n\tOwnerName string\n}\n\nfunc (b0 PayloadCuratedPluginCreated_builder) Build() *PayloadCuratedPluginCreated {\n\tm0 := &PayloadCuratedPluginCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\treturn m0\n}\n\ntype PayloadCuratedPluginDeleted struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId   string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *PayloadCuratedPluginDeleted) Reset() {\n\t*x = PayloadCuratedPluginDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[48]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadCuratedPluginDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadCuratedPluginDeleted) ProtoMessage() {}\n\nfunc (x *PayloadCuratedPluginDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[48]\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\nfunc (x *PayloadCuratedPluginDeleted) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadCuratedPluginDeleted) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadCuratedPluginDeleted) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadCuratedPluginDeleted) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\ntype PayloadCuratedPluginDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin.\n\tOwnerName string\n}\n\nfunc (b0 PayloadCuratedPluginDeleted_builder) Build() *PayloadCuratedPluginDeleted {\n\tm0 := &PayloadCuratedPluginDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\treturn m0\n}\n\ntype PayloadCuratedPluginStatusUpdated struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId   string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_NewStatus string                 `protobuf:\"bytes,3,opt,name=new_status,json=newStatus,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) Reset() {\n\t*x = PayloadCuratedPluginStatusUpdated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[49]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadCuratedPluginStatusUpdated) ProtoMessage() {}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[49]\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\nfunc (x *PayloadCuratedPluginStatusUpdated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) GetNewStatus() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewStatus\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadCuratedPluginStatusUpdated) SetNewStatus(v string) {\n\tx.xxx_hidden_NewStatus = v\n}\n\ntype PayloadCuratedPluginStatusUpdated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin.\n\tOwnerName string\n\t// new_status is the new status of the plugin.\n\tNewStatus string\n}\n\nfunc (b0 PayloadCuratedPluginStatusUpdated_builder) Build() *PayloadCuratedPluginStatusUpdated {\n\tm0 := &PayloadCuratedPluginStatusUpdated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_NewStatus = b.NewStatus\n\treturn m0\n}\n\ntype PayloadTokenCreated struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId         string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_TokenExpiryTime *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=token_expiry_time,json=tokenExpiryTime,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *PayloadTokenCreated) Reset() {\n\t*x = PayloadTokenCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[50]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadTokenCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadTokenCreated) ProtoMessage() {}\n\nfunc (x *PayloadTokenCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[50]\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\nfunc (x *PayloadTokenCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadTokenCreated) GetTokenExpiryTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TokenExpiryTime\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadTokenCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadTokenCreated) SetTokenExpiryTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_TokenExpiryTime = v\n}\n\nfunc (x *PayloadTokenCreated) HasTokenExpiryTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_TokenExpiryTime != nil\n}\n\nfunc (x *PayloadTokenCreated) ClearTokenExpiryTime() {\n\tx.xxx_hidden_TokenExpiryTime = nil\n}\n\ntype PayloadTokenCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the token.\n\tOwnerId string\n\t// token_expiry_time is the expiry time of the token.\n\tTokenExpiryTime *timestamppb.Timestamp\n}\n\nfunc (b0 PayloadTokenCreated_builder) Build() *PayloadTokenCreated {\n\tm0 := &PayloadTokenCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_TokenExpiryTime = b.TokenExpiryTime\n\treturn m0\n}\n\ntype PayloadTokenDeleted struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *PayloadTokenDeleted) Reset() {\n\t*x = PayloadTokenDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[51]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadTokenDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadTokenDeleted) ProtoMessage() {}\n\nfunc (x *PayloadTokenDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[51]\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\nfunc (x *PayloadTokenDeleted) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadTokenDeleted) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\ntype PayloadTokenDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the token.\n\tOwnerId string\n}\n\nfunc (b0 PayloadTokenDeleted_builder) Build() *PayloadTokenDeleted {\n\tm0 := &PayloadTokenDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\treturn m0\n}\n\ntype PayloadSCIMTokenCreated struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_TokenExpiryTime *timestamppb.Timestamp `protobuf:\"bytes,1,opt,name=token_expiry_time,json=tokenExpiryTime,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *PayloadSCIMTokenCreated) Reset() {\n\t*x = PayloadSCIMTokenCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[52]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadSCIMTokenCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadSCIMTokenCreated) ProtoMessage() {}\n\nfunc (x *PayloadSCIMTokenCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[52]\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\nfunc (x *PayloadSCIMTokenCreated) GetTokenExpiryTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TokenExpiryTime\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadSCIMTokenCreated) SetTokenExpiryTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_TokenExpiryTime = v\n}\n\nfunc (x *PayloadSCIMTokenCreated) HasTokenExpiryTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_TokenExpiryTime != nil\n}\n\nfunc (x *PayloadSCIMTokenCreated) ClearTokenExpiryTime() {\n\tx.xxx_hidden_TokenExpiryTime = nil\n}\n\ntype PayloadSCIMTokenCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// token_expiry_time is the expiry time of the token.\n\tTokenExpiryTime *timestamppb.Timestamp\n}\n\nfunc (b0 PayloadSCIMTokenCreated_builder) Build() *PayloadSCIMTokenCreated {\n\tm0 := &PayloadSCIMTokenCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TokenExpiryTime = b.TokenExpiryTime\n\treturn m0\n}\n\ntype PayloadSCIMTokenDeleted struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadSCIMTokenDeleted) Reset() {\n\t*x = PayloadSCIMTokenDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[53]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadSCIMTokenDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadSCIMTokenDeleted) ProtoMessage() {}\n\nfunc (x *PayloadSCIMTokenDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[53]\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\ntype PayloadSCIMTokenDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadSCIMTokenDeleted_builder) Build() *PayloadSCIMTokenDeleted {\n\tm0 := &PayloadSCIMTokenDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\n// PayloadRepositoryCommitDeleted is deprecated.\n//\n// Individual repository commits cannot be deleted.\n//\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadRepositoryCommitDeleted struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_DraftName      string                 `protobuf:\"bytes,5,opt,name=draft_name,json=draftName,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) Reset() {\n\t*x = PayloadRepositoryCommitDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[54]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryCommitDeleted) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryCommitDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[54]\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\nfunc (x *PayloadRepositoryCommitDeleted) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) GetDraftName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DraftName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryCommitDeleted) SetDraftName(v string) {\n\tx.xxx_hidden_DraftName = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\ntype PayloadRepositoryCommitDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository from which the commit will be deleted.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository from which the commit will be deleted.\n\tOwnerName string\n\t// repository_id is the id of the repository from which the commit will be deleted.\n\tRepositoryId string\n\t// repository_name is the name of the repository from which the commit will be deleted.\n\tRepositoryName string\n\t// draft_name is the name of the draft. Optional.\n\tDraftName string\n}\n\nfunc (b0 PayloadRepositoryCommitDeleted_builder) Build() *PayloadRepositoryCommitDeleted {\n\tm0 := &PayloadRepositoryCommitDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_DraftName = b.DraftName\n\treturn m0\n}\n\ntype PayloadRepositoryLabelCreated struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_LabelNamespace string                 `protobuf:\"bytes,5,opt,name=label_namespace,json=labelNamespace,proto3\"`\n\txxx_hidden_CommitId       string                 `protobuf:\"bytes,6,opt,name=commit_id,json=commitId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryLabelCreated) Reset() {\n\t*x = PayloadRepositoryLabelCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[55]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryLabelCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryLabelCreated) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryLabelCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[55]\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\nfunc (x *PayloadRepositoryLabelCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelCreated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelCreated) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelCreated) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *PayloadRepositoryLabelCreated) GetLabelNamespace() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LabelNamespace\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelCreated) GetCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryLabelCreated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryLabelCreated) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryLabelCreated) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *PayloadRepositoryLabelCreated) SetLabelNamespace(v string) {\n\tx.xxx_hidden_LabelNamespace = v\n}\n\nfunc (x *PayloadRepositoryLabelCreated) SetCommitId(v string) {\n\tx.xxx_hidden_CommitId = v\n}\n\ntype PayloadRepositoryLabelCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository on which the label was created.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository on which the label was created.\n\tOwnerName string\n\t// repository_id is the id of the repository on which the label was created.\n\tRepositoryId string\n\t// repository_name is the name of the repository from which the label was created.\n\tRepositoryName string\n\t// label_namespace is the namespace of the label that was created.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tLabelNamespace string\n\t// commit_id is the id of the commit on which the label was created.\n\tCommitId string\n}\n\nfunc (b0 PayloadRepositoryLabelCreated_builder) Build() *PayloadRepositoryLabelCreated {\n\tm0 := &PayloadRepositoryLabelCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_LabelNamespace = b.LabelNamespace\n\tx.xxx_hidden_CommitId = b.CommitId\n\treturn m0\n}\n\ntype PayloadRepositoryLabelMoved struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_LabelNamespace string                 `protobuf:\"bytes,5,opt,name=label_namespace,json=labelNamespace,proto3\"`\n\txxx_hidden_ToCommitId     string                 `protobuf:\"bytes,6,opt,name=to_commit_id,json=toCommitId,proto3\"`\n\txxx_hidden_FromCommitId   string                 `protobuf:\"bytes,7,opt,name=from_commit_id,json=fromCommitId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryLabelMoved) Reset() {\n\t*x = PayloadRepositoryLabelMoved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[56]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryLabelMoved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryLabelMoved) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryLabelMoved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[56]\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\nfunc (x *PayloadRepositoryLabelMoved) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelMoved) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelMoved) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelMoved) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *PayloadRepositoryLabelMoved) GetLabelNamespace() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LabelNamespace\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelMoved) GetToCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ToCommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelMoved) GetFromCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FromCommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelMoved) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryLabelMoved) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryLabelMoved) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryLabelMoved) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\nfunc (x *PayloadRepositoryLabelMoved) SetLabelNamespace(v string) {\n\tx.xxx_hidden_LabelNamespace = v\n}\n\nfunc (x *PayloadRepositoryLabelMoved) SetToCommitId(v string) {\n\tx.xxx_hidden_ToCommitId = v\n}\n\nfunc (x *PayloadRepositoryLabelMoved) SetFromCommitId(v string) {\n\tx.xxx_hidden_FromCommitId = v\n}\n\ntype PayloadRepositoryLabelMoved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository on which the label was moved.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository on which the label was moved.\n\tOwnerName string\n\t// repository_id is the id of the repository on which the label was moved.\n\tRepositoryId string\n\t// repository_name is the name of the repository from which the label was moved.\n\tRepositoryName string\n\t// label_namespace is the namespace of the label that was moved.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/audit/v1alpha1/event.proto.\n\tLabelNamespace string\n\t// to_commit_id is the id of the commit on which the label was moved to.\n\tToCommitId string\n\t// from_commit_id is the id of the commit on which the label was moved from.\n\tFromCommitId string\n}\n\nfunc (b0 PayloadRepositoryLabelMoved_builder) Build() *PayloadRepositoryLabelMoved {\n\tm0 := &PayloadRepositoryLabelMoved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_LabelNamespace = b.LabelNamespace\n\tx.xxx_hidden_ToCommitId = b.ToCommitId\n\tx.xxx_hidden_FromCommitId = b.FromCommitId\n\treturn m0\n}\n\ntype PayloadRepositoryLabelArchived struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryLabelArchived) Reset() {\n\t*x = PayloadRepositoryLabelArchived{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[57]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryLabelArchived) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryLabelArchived) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryLabelArchived) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[57]\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\nfunc (x *PayloadRepositoryLabelArchived) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelArchived) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelArchived) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelArchived) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelArchived) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryLabelArchived) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryLabelArchived) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryLabelArchived) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\ntype PayloadRepositoryLabelArchived_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository on which the label was archived.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository on which the label was archived.\n\tOwnerName string\n\t// repository_id is the id of the repository on which the label was archived.\n\tRepositoryId string\n\t// repository_name is the name of the repository from which the label was archived.\n\tRepositoryName string\n}\n\nfunc (b0 PayloadRepositoryLabelArchived_builder) Build() *PayloadRepositoryLabelArchived {\n\tm0 := &PayloadRepositoryLabelArchived{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\treturn m0\n}\n\ntype PayloadRepositoryLabelUnarchived struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId        string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId   string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) Reset() {\n\t*x = PayloadRepositoryLabelUnarchived{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[58]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryLabelUnarchived) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryLabelUnarchived) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[58]\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\nfunc (x *PayloadRepositoryLabelUnarchived) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryLabelUnarchived) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\ntype PayloadRepositoryLabelUnarchived_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the repository on which the label was unarchived.\n\tOwnerId string\n\t// owner_name is the name of the owner of the repository on which the label was unarchived.\n\tOwnerName string\n\t// repository_id is the id of the repository on which the label was unarchived.\n\tRepositoryId string\n\t// repository_name is the name of the repository from which the label was unarchived.\n\tRepositoryName string\n}\n\nfunc (b0 PayloadRepositoryLabelUnarchived_builder) Build() *PayloadRepositoryLabelUnarchived {\n\tm0 := &PayloadRepositoryLabelUnarchived{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\treturn m0\n}\n\ntype PayloadRepositoryLabelEnforcementIgnoresChanged struct {\n\tstate                       protoimpl.MessageState                                          `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId          string                                                          `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName        string                                                          `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryId     string                                                          `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName   string                                                          `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_EnforcementId    string                                                          `protobuf:\"bytes,5,opt,name=enforcement_id,json=enforcementId,proto3\"`\n\txxx_hidden_OldIgnoreEntries *[]*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry `protobuf:\"bytes,6,rep,name=old_ignore_entries,json=oldIgnoreEntries,proto3\"`\n\txxx_hidden_NewIgnoreEntries *[]*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry `protobuf:\"bytes,7,rep,name=new_ignore_entries,json=newIgnoreEntries,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) Reset() {\n\t*x = PayloadRepositoryLabelEnforcementIgnoresChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[59]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryLabelEnforcementIgnoresChanged) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[59]\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\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) GetEnforcementId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EnforcementId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) GetOldIgnoreEntries() []*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry {\n\tif x != nil {\n\t\tif x.xxx_hidden_OldIgnoreEntries != nil {\n\t\t\treturn *x.xxx_hidden_OldIgnoreEntries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) GetNewIgnoreEntries() []*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry {\n\tif x != nil {\n\t\tif x.xxx_hidden_NewIgnoreEntries != nil {\n\t\t\treturn *x.xxx_hidden_NewIgnoreEntries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) SetEnforcementId(v string) {\n\tx.xxx_hidden_EnforcementId = v\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) SetOldIgnoreEntries(v []*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) {\n\tx.xxx_hidden_OldIgnoreEntries = &v\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged) SetNewIgnoreEntries(v []*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) {\n\tx.xxx_hidden_NewIgnoreEntries = &v\n}\n\ntype PayloadRepositoryLabelEnforcementIgnoresChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the repository owner.\n\tOwnerId string\n\t// owner_name is the name of the repository owner.\n\tOwnerName string\n\t// repository_id is the id of the repository.\n\tRepositoryId string\n\t// repository_name is the name of the repository.\n\tRepositoryName string\n\t// enforcement_id is the id of the enforcement.\n\tEnforcementId string\n\t// old ignore entries configured for the repository label and the enforcement.\n\tOldIgnoreEntries []*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry\n\t// new ignore entries configured for the repository label and the enforcement.\n\tNewIgnoreEntries []*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry\n}\n\nfunc (b0 PayloadRepositoryLabelEnforcementIgnoresChanged_builder) Build() *PayloadRepositoryLabelEnforcementIgnoresChanged {\n\tm0 := &PayloadRepositoryLabelEnforcementIgnoresChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_EnforcementId = b.EnforcementId\n\tx.xxx_hidden_OldIgnoreEntries = &b.OldIgnoreEntries\n\tx.xxx_hidden_NewIgnoreEntries = &b.NewIgnoreEntries\n\treturn m0\n}\n\ntype PayloadServerBreakingChangePolicyEnabled struct {\n\tstate                             protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_Category               v1alpha1.BreakingChangeCategory `protobuf:\"varint,1,opt,name=category,proto3,enum=buf.alpha.registry.v1alpha1.BreakingChangeCategory\"`\n\txxx_hidden_IgnoreUnstablePackages bool                            `protobuf:\"varint,2,opt,name=ignore_unstable_packages,json=ignoreUnstablePackages,proto3,oneof\"`\n\tXXX_raceDetectHookData            protoimpl.RaceDetectHookData\n\tXXX_presence                      [1]uint32\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) Reset() {\n\t*x = PayloadServerBreakingChangePolicyEnabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[60]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadServerBreakingChangePolicyEnabled) ProtoMessage() {}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[60]\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\nfunc (x *PayloadServerBreakingChangePolicyEnabled) GetCategory() v1alpha1.BreakingChangeCategory {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Category\n\t}\n\treturn v1alpha1.BreakingChangeCategory(0)\n}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) GetIgnoreUnstablePackages() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IgnoreUnstablePackages\n\t}\n\treturn false\n}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) SetCategory(v v1alpha1.BreakingChangeCategory) {\n\tx.xxx_hidden_Category = v\n}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) SetIgnoreUnstablePackages(v bool) {\n\tx.xxx_hidden_IgnoreUnstablePackages = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)\n}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) HasIgnoreUnstablePackages() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *PayloadServerBreakingChangePolicyEnabled) ClearIgnoreUnstablePackages() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_IgnoreUnstablePackages = false\n}\n\ntype PayloadServerBreakingChangePolicyEnabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// category is the category of breaking changes.\n\tCategory v1alpha1.BreakingChangeCategory\n\t// ignore_unstable_packages tracks breaking change enforcement for unstable packages.\n\tIgnoreUnstablePackages *bool\n}\n\nfunc (b0 PayloadServerBreakingChangePolicyEnabled_builder) Build() *PayloadServerBreakingChangePolicyEnabled {\n\tm0 := &PayloadServerBreakingChangePolicyEnabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Category = b.Category\n\tif b.IgnoreUnstablePackages != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)\n\t\tx.xxx_hidden_IgnoreUnstablePackages = *b.IgnoreUnstablePackages\n\t}\n\treturn m0\n}\n\ntype PayloadServerBreakingChangePolicyDisabled struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadServerBreakingChangePolicyDisabled) Reset() {\n\t*x = PayloadServerBreakingChangePolicyDisabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[61]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadServerBreakingChangePolicyDisabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadServerBreakingChangePolicyDisabled) ProtoMessage() {}\n\nfunc (x *PayloadServerBreakingChangePolicyDisabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[61]\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\ntype PayloadServerBreakingChangePolicyDisabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadServerBreakingChangePolicyDisabled_builder) Build() *PayloadServerBreakingChangePolicyDisabled {\n\tm0 := &PayloadServerBreakingChangePolicyDisabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadServerReviewFlowEnabled struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadServerReviewFlowEnabled) Reset() {\n\t*x = PayloadServerReviewFlowEnabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[62]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadServerReviewFlowEnabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadServerReviewFlowEnabled) ProtoMessage() {}\n\nfunc (x *PayloadServerReviewFlowEnabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[62]\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\ntype PayloadServerReviewFlowEnabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadServerReviewFlowEnabled_builder) Build() *PayloadServerReviewFlowEnabled {\n\tm0 := &PayloadServerReviewFlowEnabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadServerReviewFlowDisabled struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadServerReviewFlowDisabled) Reset() {\n\t*x = PayloadServerReviewFlowDisabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[63]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadServerReviewFlowDisabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadServerReviewFlowDisabled) ProtoMessage() {}\n\nfunc (x *PayloadServerReviewFlowDisabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[63]\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\ntype PayloadServerReviewFlowDisabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadServerReviewFlowDisabled_builder) Build() *PayloadServerReviewFlowDisabled {\n\tm0 := &PayloadServerReviewFlowDisabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadServerUniquenessPolicyEnabled struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadServerUniquenessPolicyEnabled) Reset() {\n\t*x = PayloadServerUniquenessPolicyEnabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[64]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadServerUniquenessPolicyEnabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadServerUniquenessPolicyEnabled) ProtoMessage() {}\n\nfunc (x *PayloadServerUniquenessPolicyEnabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[64]\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\ntype PayloadServerUniquenessPolicyEnabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadServerUniquenessPolicyEnabled_builder) Build() *PayloadServerUniquenessPolicyEnabled {\n\tm0 := &PayloadServerUniquenessPolicyEnabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadServerUniquenessPolicyDisabled struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadServerUniquenessPolicyDisabled) Reset() {\n\t*x = PayloadServerUniquenessPolicyDisabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[65]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadServerUniquenessPolicyDisabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadServerUniquenessPolicyDisabled) ProtoMessage() {}\n\nfunc (x *PayloadServerUniquenessPolicyDisabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[65]\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\ntype PayloadServerUniquenessPolicyDisabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadServerUniquenessPolicyDisabled_builder) Build() *PayloadServerUniquenessPolicyDisabled {\n\tm0 := &PayloadServerUniquenessPolicyDisabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadDeviceAuthorizationGrantApproved struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ClientId string                 `protobuf:\"bytes,1,opt,name=client_id,json=clientId,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *PayloadDeviceAuthorizationGrantApproved) Reset() {\n\t*x = PayloadDeviceAuthorizationGrantApproved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[66]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadDeviceAuthorizationGrantApproved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadDeviceAuthorizationGrantApproved) ProtoMessage() {}\n\nfunc (x *PayloadDeviceAuthorizationGrantApproved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[66]\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\nfunc (x *PayloadDeviceAuthorizationGrantApproved) GetClientId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ClientId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadDeviceAuthorizationGrantApproved) SetClientId(v string) {\n\tx.xxx_hidden_ClientId = v\n}\n\ntype PayloadDeviceAuthorizationGrantApproved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// client_id is the id of the registered oauth2 client of the grant.\n\tClientId string\n}\n\nfunc (b0 PayloadDeviceAuthorizationGrantApproved_builder) Build() *PayloadDeviceAuthorizationGrantApproved {\n\tm0 := &PayloadDeviceAuthorizationGrantApproved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ClientId = b.ClientId\n\treturn m0\n}\n\ntype PayloadDeviceAuthorizationGrantDenied struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ClientId string                 `protobuf:\"bytes,1,opt,name=client_id,json=clientId,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *PayloadDeviceAuthorizationGrantDenied) Reset() {\n\t*x = PayloadDeviceAuthorizationGrantDenied{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[67]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadDeviceAuthorizationGrantDenied) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadDeviceAuthorizationGrantDenied) ProtoMessage() {}\n\nfunc (x *PayloadDeviceAuthorizationGrantDenied) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[67]\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\nfunc (x *PayloadDeviceAuthorizationGrantDenied) GetClientId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ClientId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadDeviceAuthorizationGrantDenied) SetClientId(v string) {\n\tx.xxx_hidden_ClientId = v\n}\n\ntype PayloadDeviceAuthorizationGrantDenied_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// client_id is the id of the registered oauth2 client of the grant.\n\tClientId string\n}\n\nfunc (b0 PayloadDeviceAuthorizationGrantDenied_builder) Build() *PayloadDeviceAuthorizationGrantDenied {\n\tm0 := &PayloadDeviceAuthorizationGrantDenied{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ClientId = b.ClientId\n\treturn m0\n}\n\ntype PayloadPluginLabelCreated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginId   string                 `protobuf:\"bytes,3,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName string                 `protobuf:\"bytes,4,opt,name=plugin_name,json=pluginName,proto3\"`\n\txxx_hidden_CommitId   string                 `protobuf:\"bytes,6,opt,name=commit_id,json=commitId,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginLabelCreated) Reset() {\n\t*x = PayloadPluginLabelCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[68]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginLabelCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginLabelCreated) ProtoMessage() {}\n\nfunc (x *PayloadPluginLabelCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[68]\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\nfunc (x *PayloadPluginLabelCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelCreated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelCreated) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelCreated) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelCreated) GetCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginLabelCreated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginLabelCreated) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadPluginLabelCreated) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\nfunc (x *PayloadPluginLabelCreated) SetCommitId(v string) {\n\tx.xxx_hidden_CommitId = v\n}\n\ntype PayloadPluginLabelCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin on which the label was created.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin on which the label was created.\n\tOwnerName string\n\t// plugin_id is the id of the plugin on which the label was created.\n\tPluginId string\n\t// plugin_name is the name of the plugin from which the label was created.\n\tPluginName string\n\t// commit_id is the id of the commit on which the label was created.\n\tCommitId string\n}\n\nfunc (b0 PayloadPluginLabelCreated_builder) Build() *PayloadPluginLabelCreated {\n\tm0 := &PayloadPluginLabelCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\tx.xxx_hidden_CommitId = b.CommitId\n\treturn m0\n}\n\ntype PayloadPluginLabelMoved struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId      string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName    string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginId     string                 `protobuf:\"bytes,3,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName   string                 `protobuf:\"bytes,4,opt,name=plugin_name,json=pluginName,proto3\"`\n\txxx_hidden_ToCommitId   string                 `protobuf:\"bytes,6,opt,name=to_commit_id,json=toCommitId,proto3\"`\n\txxx_hidden_FromCommitId string                 `protobuf:\"bytes,7,opt,name=from_commit_id,json=fromCommitId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginLabelMoved) Reset() {\n\t*x = PayloadPluginLabelMoved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[69]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginLabelMoved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginLabelMoved) ProtoMessage() {}\n\nfunc (x *PayloadPluginLabelMoved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[69]\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\nfunc (x *PayloadPluginLabelMoved) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelMoved) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelMoved) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelMoved) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelMoved) GetToCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ToCommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelMoved) GetFromCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FromCommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelMoved) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginLabelMoved) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginLabelMoved) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadPluginLabelMoved) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\nfunc (x *PayloadPluginLabelMoved) SetToCommitId(v string) {\n\tx.xxx_hidden_ToCommitId = v\n}\n\nfunc (x *PayloadPluginLabelMoved) SetFromCommitId(v string) {\n\tx.xxx_hidden_FromCommitId = v\n}\n\ntype PayloadPluginLabelMoved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin on which the label was moved.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin on which the label was moved.\n\tOwnerName string\n\t// plugin_id is the id of the plugin on which the label was moved.\n\tPluginId string\n\t// plugin_name is the name of the plugin from which the label was moved.\n\tPluginName string\n\t// to_commit_id is the id of the commit on which the label was moved to.\n\tToCommitId string\n\t// from_commit_id is the id of the commit on which the label was moved from.\n\tFromCommitId string\n}\n\nfunc (b0 PayloadPluginLabelMoved_builder) Build() *PayloadPluginLabelMoved {\n\tm0 := &PayloadPluginLabelMoved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\tx.xxx_hidden_ToCommitId = b.ToCommitId\n\tx.xxx_hidden_FromCommitId = b.FromCommitId\n\treturn m0\n}\n\ntype PayloadPluginLabelArchived struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginId   string                 `protobuf:\"bytes,3,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName string                 `protobuf:\"bytes,4,opt,name=plugin_name,json=pluginName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginLabelArchived) Reset() {\n\t*x = PayloadPluginLabelArchived{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[70]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginLabelArchived) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginLabelArchived) ProtoMessage() {}\n\nfunc (x *PayloadPluginLabelArchived) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[70]\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\nfunc (x *PayloadPluginLabelArchived) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelArchived) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelArchived) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelArchived) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelArchived) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginLabelArchived) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginLabelArchived) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadPluginLabelArchived) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\ntype PayloadPluginLabelArchived_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin on which the label was archived.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin on which the label was archived.\n\tOwnerName string\n\t// plugin_id is the id of the plugin on which the label was archived.\n\tPluginId string\n\t// plugin_name is the name of the plugin from which the label was archived.\n\tPluginName string\n}\n\nfunc (b0 PayloadPluginLabelArchived_builder) Build() *PayloadPluginLabelArchived {\n\tm0 := &PayloadPluginLabelArchived{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\treturn m0\n}\n\ntype PayloadPluginLabelUnarchived struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PluginId   string                 `protobuf:\"bytes,3,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName string                 `protobuf:\"bytes,4,opt,name=plugin_name,json=pluginName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPluginLabelUnarchived) Reset() {\n\t*x = PayloadPluginLabelUnarchived{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[71]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPluginLabelUnarchived) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPluginLabelUnarchived) ProtoMessage() {}\n\nfunc (x *PayloadPluginLabelUnarchived) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[71]\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\nfunc (x *PayloadPluginLabelUnarchived) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelUnarchived) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelUnarchived) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelUnarchived) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPluginLabelUnarchived) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPluginLabelUnarchived) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPluginLabelUnarchived) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadPluginLabelUnarchived) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\ntype PayloadPluginLabelUnarchived_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the plugin on which the label was unarchived.\n\tOwnerId string\n\t// owner_name is the name of the owner of the plugin on which the label was unarchived.\n\tOwnerName string\n\t// plugin_id is the id of the plugin on which the label was unarchived.\n\tPluginId string\n\t// plugin_name is the name of the plugin from which the label was unarchived.\n\tPluginName string\n}\n\nfunc (b0 PayloadPluginLabelUnarchived_builder) Build() *PayloadPluginLabelUnarchived {\n\tm0 := &PayloadPluginLabelUnarchived{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\treturn m0\n}\n\ntype PayloadPolicyLabelCreated struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PolicyId   string                 `protobuf:\"bytes,3,opt,name=policy_id,json=policyId,proto3\"`\n\txxx_hidden_PolicyName string                 `protobuf:\"bytes,4,opt,name=policy_name,json=policyName,proto3\"`\n\txxx_hidden_CommitId   string                 `protobuf:\"bytes,6,opt,name=commit_id,json=commitId,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyLabelCreated) Reset() {\n\t*x = PayloadPolicyLabelCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[72]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyLabelCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyLabelCreated) ProtoMessage() {}\n\nfunc (x *PayloadPolicyLabelCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[72]\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\nfunc (x *PayloadPolicyLabelCreated) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelCreated) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelCreated) GetPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelCreated) GetPolicyName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelCreated) GetCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelCreated) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyLabelCreated) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyLabelCreated) SetPolicyId(v string) {\n\tx.xxx_hidden_PolicyId = v\n}\n\nfunc (x *PayloadPolicyLabelCreated) SetPolicyName(v string) {\n\tx.xxx_hidden_PolicyName = v\n}\n\nfunc (x *PayloadPolicyLabelCreated) SetCommitId(v string) {\n\tx.xxx_hidden_CommitId = v\n}\n\ntype PayloadPolicyLabelCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy on which the label was created.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy on which the label was created.\n\tOwnerName string\n\t// policy_id is the id of the policy on which the label was created.\n\tPolicyId string\n\t// policy_name is the name of the policy from which the label was created.\n\tPolicyName string\n\t// commit_id is the id of the commit on which the label was created.\n\tCommitId string\n}\n\nfunc (b0 PayloadPolicyLabelCreated_builder) Build() *PayloadPolicyLabelCreated {\n\tm0 := &PayloadPolicyLabelCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PolicyId = b.PolicyId\n\tx.xxx_hidden_PolicyName = b.PolicyName\n\tx.xxx_hidden_CommitId = b.CommitId\n\treturn m0\n}\n\ntype PayloadPolicyLabelMoved struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId      string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName    string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PolicyId     string                 `protobuf:\"bytes,3,opt,name=policy_id,json=policyId,proto3\"`\n\txxx_hidden_PolicyName   string                 `protobuf:\"bytes,4,opt,name=policy_name,json=policyName,proto3\"`\n\txxx_hidden_ToCommitId   string                 `protobuf:\"bytes,6,opt,name=to_commit_id,json=toCommitId,proto3\"`\n\txxx_hidden_FromCommitId string                 `protobuf:\"bytes,7,opt,name=from_commit_id,json=fromCommitId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyLabelMoved) Reset() {\n\t*x = PayloadPolicyLabelMoved{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[73]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyLabelMoved) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyLabelMoved) ProtoMessage() {}\n\nfunc (x *PayloadPolicyLabelMoved) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[73]\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\nfunc (x *PayloadPolicyLabelMoved) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelMoved) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelMoved) GetPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelMoved) GetPolicyName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelMoved) GetToCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ToCommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelMoved) GetFromCommitId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FromCommitId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelMoved) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyLabelMoved) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyLabelMoved) SetPolicyId(v string) {\n\tx.xxx_hidden_PolicyId = v\n}\n\nfunc (x *PayloadPolicyLabelMoved) SetPolicyName(v string) {\n\tx.xxx_hidden_PolicyName = v\n}\n\nfunc (x *PayloadPolicyLabelMoved) SetToCommitId(v string) {\n\tx.xxx_hidden_ToCommitId = v\n}\n\nfunc (x *PayloadPolicyLabelMoved) SetFromCommitId(v string) {\n\tx.xxx_hidden_FromCommitId = v\n}\n\ntype PayloadPolicyLabelMoved_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy on which the label was moved.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy on which the label was moved.\n\tOwnerName string\n\t// policy_id is the id of the policy on which the label was moved.\n\tPolicyId string\n\t// policy_name is the name of the policy from which the label was moved.\n\tPolicyName string\n\t// to_commit_id is the id of the commit on which the label was moved to.\n\tToCommitId string\n\t// from_commit_id is the id of the commit on which the label was moved from.\n\tFromCommitId string\n}\n\nfunc (b0 PayloadPolicyLabelMoved_builder) Build() *PayloadPolicyLabelMoved {\n\tm0 := &PayloadPolicyLabelMoved{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PolicyId = b.PolicyId\n\tx.xxx_hidden_PolicyName = b.PolicyName\n\tx.xxx_hidden_ToCommitId = b.ToCommitId\n\tx.xxx_hidden_FromCommitId = b.FromCommitId\n\treturn m0\n}\n\ntype PayloadPolicyLabelArchived struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PolicyId   string                 `protobuf:\"bytes,3,opt,name=policy_id,json=policyId,proto3\"`\n\txxx_hidden_PolicyName string                 `protobuf:\"bytes,4,opt,name=policy_name,json=policyName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyLabelArchived) Reset() {\n\t*x = PayloadPolicyLabelArchived{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[74]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyLabelArchived) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyLabelArchived) ProtoMessage() {}\n\nfunc (x *PayloadPolicyLabelArchived) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[74]\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\nfunc (x *PayloadPolicyLabelArchived) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelArchived) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelArchived) GetPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelArchived) GetPolicyName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelArchived) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyLabelArchived) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyLabelArchived) SetPolicyId(v string) {\n\tx.xxx_hidden_PolicyId = v\n}\n\nfunc (x *PayloadPolicyLabelArchived) SetPolicyName(v string) {\n\tx.xxx_hidden_PolicyName = v\n}\n\ntype PayloadPolicyLabelArchived_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy on which the label was archived.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy on which the label was archived.\n\tOwnerName string\n\t// policy_id is the id of the policy on which the label was archived.\n\tPolicyId string\n\t// policy_name is the name of the policy from which the label was archived.\n\tPolicyName string\n}\n\nfunc (b0 PayloadPolicyLabelArchived_builder) Build() *PayloadPolicyLabelArchived {\n\tm0 := &PayloadPolicyLabelArchived{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PolicyId = b.PolicyId\n\tx.xxx_hidden_PolicyName = b.PolicyName\n\treturn m0\n}\n\ntype PayloadPolicyLabelUnarchived struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId    string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName  string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PolicyId   string                 `protobuf:\"bytes,3,opt,name=policy_id,json=policyId,proto3\"`\n\txxx_hidden_PolicyName string                 `protobuf:\"bytes,4,opt,name=policy_name,json=policyName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) Reset() {\n\t*x = PayloadPolicyLabelUnarchived{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[75]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyLabelUnarchived) ProtoMessage() {}\n\nfunc (x *PayloadPolicyLabelUnarchived) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[75]\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\nfunc (x *PayloadPolicyLabelUnarchived) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) GetPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) GetPolicyName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) SetPolicyId(v string) {\n\tx.xxx_hidden_PolicyId = v\n}\n\nfunc (x *PayloadPolicyLabelUnarchived) SetPolicyName(v string) {\n\tx.xxx_hidden_PolicyName = v\n}\n\ntype PayloadPolicyLabelUnarchived_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner of the policy on which the label was unarchived.\n\tOwnerId string\n\t// owner_name is the name of the owner of the policy on which the label was unarchived.\n\tOwnerName string\n\t// policy_id is the id of the policy on which the label was unarchived.\n\tPolicyId string\n\t// policy_name is the name of the policy from which the label was unarchived.\n\tPolicyName string\n}\n\nfunc (b0 PayloadPolicyLabelUnarchived_builder) Build() *PayloadPolicyLabelUnarchived {\n\tm0 := &PayloadPolicyLabelUnarchived{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PolicyId = b.PolicyId\n\tx.xxx_hidden_PolicyName = b.PolicyName\n\treturn m0\n}\n\ntype PayloadSDKPluginConstraintCreated struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwnerId   string                 `protobuf:\"bytes,1,opt,name=repository_owner_id,json=repositoryOwnerId,proto3\"`\n\txxx_hidden_RepositoryOwnerName string                 `protobuf:\"bytes,2,opt,name=repository_owner_name,json=repositoryOwnerName,proto3\"`\n\txxx_hidden_RepositoryId        string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName      string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_PluginOwnerId       string                 `protobuf:\"bytes,5,opt,name=plugin_owner_id,json=pluginOwnerId,proto3\"`\n\txxx_hidden_PluginOwnerName     string                 `protobuf:\"bytes,6,opt,name=plugin_owner_name,json=pluginOwnerName,proto3\"`\n\txxx_hidden_PluginId            string                 `protobuf:\"bytes,7,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName          string                 `protobuf:\"bytes,8,opt,name=plugin_name,json=pluginName,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) Reset() {\n\t*x = PayloadSDKPluginConstraintCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[76]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadSDKPluginConstraintCreated) ProtoMessage() {}\n\nfunc (x *PayloadSDKPluginConstraintCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[76]\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\nfunc (x *PayloadSDKPluginConstraintCreated) GetRepositoryOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) GetRepositoryOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) GetPluginOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginOwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) GetPluginOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginOwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetRepositoryOwnerId(v string) {\n\tx.xxx_hidden_RepositoryOwnerId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetRepositoryOwnerName(v string) {\n\tx.xxx_hidden_RepositoryOwnerName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetPluginOwnerId(v string) {\n\tx.xxx_hidden_PluginOwnerId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetPluginOwnerName(v string) {\n\tx.xxx_hidden_PluginOwnerName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintCreated) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\ntype PayloadSDKPluginConstraintCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// repository_owner_id is the id of the owner of the repository of the SDK constraint.\n\tRepositoryOwnerId string\n\t// repository_owner_name is the name of the owner of the repository of the SDK constraint.\n\tRepositoryOwnerName string\n\t// repository_id is the id of the repository of the SDK constraint.\n\tRepositoryId string\n\t// repository_name is the name of the repository of the SDK constraint.\n\tRepositoryName string\n\t// plugin_owner_id is the id of the owner of the plugin of the SDK constraint.\n\tPluginOwnerId string\n\t// plugin_owner_name is the name of the owner of the plugin of the SDK constraint.\n\tPluginOwnerName string\n\t// plugin_id is the id of the plugin of the SDK constraint.\n\tPluginId string\n\t// plugin_name is the name of the plugin of the SDK constraint.\n\tPluginName string\n}\n\nfunc (b0 PayloadSDKPluginConstraintCreated_builder) Build() *PayloadSDKPluginConstraintCreated {\n\tm0 := &PayloadSDKPluginConstraintCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwnerId = b.RepositoryOwnerId\n\tx.xxx_hidden_RepositoryOwnerName = b.RepositoryOwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_PluginOwnerId = b.PluginOwnerId\n\tx.xxx_hidden_PluginOwnerName = b.PluginOwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\treturn m0\n}\n\ntype PayloadSDKPluginConstraintUpdated struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwnerId   string                 `protobuf:\"bytes,1,opt,name=repository_owner_id,json=repositoryOwnerId,proto3\"`\n\txxx_hidden_RepositoryOwnerName string                 `protobuf:\"bytes,2,opt,name=repository_owner_name,json=repositoryOwnerName,proto3\"`\n\txxx_hidden_RepositoryId        string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName      string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_PluginOwnerId       string                 `protobuf:\"bytes,5,opt,name=plugin_owner_id,json=pluginOwnerId,proto3\"`\n\txxx_hidden_PluginOwnerName     string                 `protobuf:\"bytes,6,opt,name=plugin_owner_name,json=pluginOwnerName,proto3\"`\n\txxx_hidden_PluginId            string                 `protobuf:\"bytes,7,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName          string                 `protobuf:\"bytes,8,opt,name=plugin_name,json=pluginName,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) Reset() {\n\t*x = PayloadSDKPluginConstraintUpdated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[77]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadSDKPluginConstraintUpdated) ProtoMessage() {}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[77]\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\nfunc (x *PayloadSDKPluginConstraintUpdated) GetRepositoryOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) GetRepositoryOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) GetPluginOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginOwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) GetPluginOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginOwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetRepositoryOwnerId(v string) {\n\tx.xxx_hidden_RepositoryOwnerId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetRepositoryOwnerName(v string) {\n\tx.xxx_hidden_RepositoryOwnerName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetPluginOwnerId(v string) {\n\tx.xxx_hidden_PluginOwnerId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetPluginOwnerName(v string) {\n\tx.xxx_hidden_PluginOwnerName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintUpdated) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\ntype PayloadSDKPluginConstraintUpdated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// repository_owner_id is the id of the owner of the repository of the SDK constraint.\n\tRepositoryOwnerId string\n\t// repository_owner_name is the name of the owner of the repository of the SDK constraint.\n\tRepositoryOwnerName string\n\t// repository_id is the id of the repository of the SDK constraint.\n\tRepositoryId string\n\t// repository_name is the name of the repository of the SDK constraint.\n\tRepositoryName string\n\t// plugin_owner_id is the id of the owner of the plugin of the SDK constraint.\n\tPluginOwnerId string\n\t// plugin_owner_name is the name of the owner of the plugin of the SDK constraint.\n\tPluginOwnerName string\n\t// plugin_id is the id of the plugin of the SDK constraint.\n\tPluginId string\n\t// plugin_name is the name of the plugin of the SDK constraint.\n\tPluginName string\n}\n\nfunc (b0 PayloadSDKPluginConstraintUpdated_builder) Build() *PayloadSDKPluginConstraintUpdated {\n\tm0 := &PayloadSDKPluginConstraintUpdated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwnerId = b.RepositoryOwnerId\n\tx.xxx_hidden_RepositoryOwnerName = b.RepositoryOwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_PluginOwnerId = b.PluginOwnerId\n\tx.xxx_hidden_PluginOwnerName = b.PluginOwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\treturn m0\n}\n\ntype PayloadSDKPluginConstraintDeleted struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwnerId   string                 `protobuf:\"bytes,1,opt,name=repository_owner_id,json=repositoryOwnerId,proto3\"`\n\txxx_hidden_RepositoryOwnerName string                 `protobuf:\"bytes,2,opt,name=repository_owner_name,json=repositoryOwnerName,proto3\"`\n\txxx_hidden_RepositoryId        string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName      string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_PluginOwnerId       string                 `protobuf:\"bytes,5,opt,name=plugin_owner_id,json=pluginOwnerId,proto3\"`\n\txxx_hidden_PluginOwnerName     string                 `protobuf:\"bytes,6,opt,name=plugin_owner_name,json=pluginOwnerName,proto3\"`\n\txxx_hidden_PluginId            string                 `protobuf:\"bytes,7,opt,name=plugin_id,json=pluginId,proto3\"`\n\txxx_hidden_PluginName          string                 `protobuf:\"bytes,8,opt,name=plugin_name,json=pluginName,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) Reset() {\n\t*x = PayloadSDKPluginConstraintDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[78]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadSDKPluginConstraintDeleted) ProtoMessage() {}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[78]\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\nfunc (x *PayloadSDKPluginConstraintDeleted) GetRepositoryOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) GetRepositoryOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) GetPluginOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginOwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) GetPluginOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginOwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) GetPluginName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetRepositoryOwnerId(v string) {\n\tx.xxx_hidden_RepositoryOwnerId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetRepositoryOwnerName(v string) {\n\tx.xxx_hidden_RepositoryOwnerName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetPluginOwnerId(v string) {\n\tx.xxx_hidden_PluginOwnerId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetPluginOwnerName(v string) {\n\tx.xxx_hidden_PluginOwnerName = v\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\nfunc (x *PayloadSDKPluginConstraintDeleted) SetPluginName(v string) {\n\tx.xxx_hidden_PluginName = v\n}\n\ntype PayloadSDKPluginConstraintDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// repository_owner_id is the id of the owner of the repository of the SDK constraint.\n\tRepositoryOwnerId string\n\t// repository_owner_name is the name of the owner of the repository of the SDK constraint.\n\tRepositoryOwnerName string\n\t// repository_id is the id of the repository of the SDK constraint.\n\tRepositoryId string\n\t// repository_name is the name of the repository of the SDK constraint.\n\tRepositoryName string\n\t// plugin_owner_id is the id of the owner of the plugin of the SDK constraint.\n\tPluginOwnerId string\n\t// plugin_owner_name is the name of the owner of the plugin of the SDK constraint.\n\tPluginOwnerName string\n\t// plugin_id is the id of the plugin of the SDK constraint.\n\tPluginId string\n\t// plugin_name is the name of the plugin of the SDK constraint.\n\tPluginName string\n}\n\nfunc (b0 PayloadSDKPluginConstraintDeleted_builder) Build() *PayloadSDKPluginConstraintDeleted {\n\tm0 := &PayloadSDKPluginConstraintDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwnerId = b.RepositoryOwnerId\n\tx.xxx_hidden_RepositoryOwnerName = b.RepositoryOwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_PluginOwnerId = b.PluginOwnerId\n\tx.xxx_hidden_PluginOwnerName = b.PluginOwnerName\n\tx.xxx_hidden_PluginId = b.PluginId\n\tx.xxx_hidden_PluginName = b.PluginName\n\treturn m0\n}\n\n// PolicyEnforcementScope is the scope to which a policy enforcement applies.\ntype PolicyEnforcementScope struct {\n\tstate            protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_Scope isPolicyEnforcementScope_Scope `protobuf_oneof:\"scope\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *PolicyEnforcementScope) Reset() {\n\t*x = PolicyEnforcementScope{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[79]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PolicyEnforcementScope) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PolicyEnforcementScope) ProtoMessage() {}\n\nfunc (x *PolicyEnforcementScope) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[79]\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\nfunc (x *PolicyEnforcementScope) GetInstance() *PolicyEnforcementScope_PolicyEnforcementScopeInstance {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Instance); ok {\n\t\t\treturn x.Instance\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PolicyEnforcementScope) GetOwner() *PolicyEnforcementScope_PolicyEnforcementScopeOwner {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Owner); ok {\n\t\t\treturn x.Owner\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PolicyEnforcementScope) GetRepository() *PolicyEnforcementScope_PolicyEnforcementScopeRepository {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Repository); ok {\n\t\t\treturn x.Repository\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PolicyEnforcementScope) SetInstance(v *PolicyEnforcementScope_PolicyEnforcementScopeInstance) {\n\tif v == nil {\n\t\tx.xxx_hidden_Scope = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Scope = &policyEnforcementScope_Instance{v}\n}\n\nfunc (x *PolicyEnforcementScope) SetOwner(v *PolicyEnforcementScope_PolicyEnforcementScopeOwner) {\n\tif v == nil {\n\t\tx.xxx_hidden_Scope = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Scope = &policyEnforcementScope_Owner{v}\n}\n\nfunc (x *PolicyEnforcementScope) SetRepository(v *PolicyEnforcementScope_PolicyEnforcementScopeRepository) {\n\tif v == nil {\n\t\tx.xxx_hidden_Scope = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Scope = &policyEnforcementScope_Repository{v}\n}\n\nfunc (x *PolicyEnforcementScope) HasScope() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Scope != nil\n}\n\nfunc (x *PolicyEnforcementScope) HasInstance() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Instance)\n\treturn ok\n}\n\nfunc (x *PolicyEnforcementScope) HasOwner() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Owner)\n\treturn ok\n}\n\nfunc (x *PolicyEnforcementScope) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Repository)\n\treturn ok\n}\n\nfunc (x *PolicyEnforcementScope) ClearScope() {\n\tx.xxx_hidden_Scope = nil\n}\n\nfunc (x *PolicyEnforcementScope) ClearInstance() {\n\tif _, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Instance); ok {\n\t\tx.xxx_hidden_Scope = nil\n\t}\n}\n\nfunc (x *PolicyEnforcementScope) ClearOwner() {\n\tif _, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Owner); ok {\n\t\tx.xxx_hidden_Scope = nil\n\t}\n}\n\nfunc (x *PolicyEnforcementScope) ClearRepository() {\n\tif _, ok := x.xxx_hidden_Scope.(*policyEnforcementScope_Repository); ok {\n\t\tx.xxx_hidden_Scope = nil\n\t}\n}\n\nconst PolicyEnforcementScope_Scope_not_set_case case_PolicyEnforcementScope_Scope = 0\nconst PolicyEnforcementScope_Instance_case case_PolicyEnforcementScope_Scope = 1\nconst PolicyEnforcementScope_Owner_case case_PolicyEnforcementScope_Scope = 2\nconst PolicyEnforcementScope_Repository_case case_PolicyEnforcementScope_Scope = 3\n\nfunc (x *PolicyEnforcementScope) WhichScope() case_PolicyEnforcementScope_Scope {\n\tif x == nil {\n\t\treturn PolicyEnforcementScope_Scope_not_set_case\n\t}\n\tswitch x.xxx_hidden_Scope.(type) {\n\tcase *policyEnforcementScope_Instance:\n\t\treturn PolicyEnforcementScope_Instance_case\n\tcase *policyEnforcementScope_Owner:\n\t\treturn PolicyEnforcementScope_Owner_case\n\tcase *policyEnforcementScope_Repository:\n\t\treturn PolicyEnforcementScope_Repository_case\n\tdefault:\n\t\treturn PolicyEnforcementScope_Scope_not_set_case\n\t}\n}\n\ntype PolicyEnforcementScope_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Scope:\n\tInstance   *PolicyEnforcementScope_PolicyEnforcementScopeInstance\n\tOwner      *PolicyEnforcementScope_PolicyEnforcementScopeOwner\n\tRepository *PolicyEnforcementScope_PolicyEnforcementScopeRepository\n\t// -- end of xxx_hidden_Scope\n}\n\nfunc (b0 PolicyEnforcementScope_builder) Build() *PolicyEnforcementScope {\n\tm0 := &PolicyEnforcementScope{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Instance != nil {\n\t\tx.xxx_hidden_Scope = &policyEnforcementScope_Instance{b.Instance}\n\t}\n\tif b.Owner != nil {\n\t\tx.xxx_hidden_Scope = &policyEnforcementScope_Owner{b.Owner}\n\t}\n\tif b.Repository != nil {\n\t\tx.xxx_hidden_Scope = &policyEnforcementScope_Repository{b.Repository}\n\t}\n\treturn m0\n}\n\ntype case_PolicyEnforcementScope_Scope protoreflect.FieldNumber\n\nfunc (x case_PolicyEnforcementScope_Scope) String() string {\n\tmd := file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[79].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isPolicyEnforcementScope_Scope interface {\n\tisPolicyEnforcementScope_Scope()\n}\n\ntype policyEnforcementScope_Instance struct {\n\tInstance *PolicyEnforcementScope_PolicyEnforcementScopeInstance `protobuf:\"bytes,1,opt,name=instance,proto3,oneof\"`\n}\n\ntype policyEnforcementScope_Owner struct {\n\tOwner *PolicyEnforcementScope_PolicyEnforcementScopeOwner `protobuf:\"bytes,2,opt,name=owner,proto3,oneof\"`\n}\n\ntype policyEnforcementScope_Repository struct {\n\tRepository *PolicyEnforcementScope_PolicyEnforcementScopeRepository `protobuf:\"bytes,3,opt,name=repository,proto3,oneof\"`\n}\n\nfunc (*policyEnforcementScope_Instance) isPolicyEnforcementScope_Scope() {}\n\nfunc (*policyEnforcementScope_Owner) isPolicyEnforcementScope_Scope() {}\n\nfunc (*policyEnforcementScope_Repository) isPolicyEnforcementScope_Scope() {}\n\ntype PayloadPolicyEnforcementCreated struct {\n\tstate                     protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_Scope          *PolicyEnforcementScope `protobuf:\"bytes,1,opt,name=scope,proto3\"`\n\txxx_hidden_PolicyId       string                  `protobuf:\"bytes,2,opt,name=policy_id,json=policyId,proto3\"`\n\txxx_hidden_PolicyRef      string                  `protobuf:\"bytes,3,opt,name=policy_ref,json=policyRef,proto3\"`\n\txxx_hidden_IncludeTargets []string                `protobuf:\"bytes,4,rep,name=include_targets,json=includeTargets,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) Reset() {\n\t*x = PayloadPolicyEnforcementCreated{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[80]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyEnforcementCreated) ProtoMessage() {}\n\nfunc (x *PayloadPolicyEnforcementCreated) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[80]\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\nfunc (x *PayloadPolicyEnforcementCreated) GetScope() *PolicyEnforcementScope {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Scope\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) GetPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) GetPolicyRef() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyRef\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) GetIncludeTargets() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeTargets\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) SetScope(v *PolicyEnforcementScope) {\n\tx.xxx_hidden_Scope = v\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) SetPolicyId(v string) {\n\tx.xxx_hidden_PolicyId = v\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) SetPolicyRef(v string) {\n\tx.xxx_hidden_PolicyRef = v\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) SetIncludeTargets(v []string) {\n\tx.xxx_hidden_IncludeTargets = v\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) HasScope() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Scope != nil\n}\n\nfunc (x *PayloadPolicyEnforcementCreated) ClearScope() {\n\tx.xxx_hidden_Scope = nil\n}\n\ntype PayloadPolicyEnforcementCreated_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// scope is the scope to which the policy is enforced.\n\tScope *PolicyEnforcementScope\n\t// policy_id is the id of the policy that is enforced.\n\tPolicyId string\n\t// policy_ref is the reference of the policy that is enforced.\n\tPolicyRef string\n\t// include_targets are the include targets of the policy enforcement.\n\tIncludeTargets []string\n}\n\nfunc (b0 PayloadPolicyEnforcementCreated_builder) Build() *PayloadPolicyEnforcementCreated {\n\tm0 := &PayloadPolicyEnforcementCreated{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Scope = b.Scope\n\tx.xxx_hidden_PolicyId = b.PolicyId\n\tx.xxx_hidden_PolicyRef = b.PolicyRef\n\tx.xxx_hidden_IncludeTargets = b.IncludeTargets\n\treturn m0\n}\n\ntype PayloadPolicyEnforcementDeleted struct {\n\tstate                     protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_Scope          *PolicyEnforcementScope `protobuf:\"bytes,1,opt,name=scope,proto3\"`\n\txxx_hidden_PolicyId       string                  `protobuf:\"bytes,2,opt,name=policy_id,json=policyId,proto3\"`\n\txxx_hidden_PolicyRef      string                  `protobuf:\"bytes,3,opt,name=policy_ref,json=policyRef,proto3\"`\n\txxx_hidden_IncludeTargets []string                `protobuf:\"bytes,4,rep,name=include_targets,json=includeTargets,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) Reset() {\n\t*x = PayloadPolicyEnforcementDeleted{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[81]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyEnforcementDeleted) ProtoMessage() {}\n\nfunc (x *PayloadPolicyEnforcementDeleted) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[81]\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\nfunc (x *PayloadPolicyEnforcementDeleted) GetScope() *PolicyEnforcementScope {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Scope\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) GetPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) GetPolicyRef() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PolicyRef\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) GetIncludeTargets() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeTargets\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) SetScope(v *PolicyEnforcementScope) {\n\tx.xxx_hidden_Scope = v\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) SetPolicyId(v string) {\n\tx.xxx_hidden_PolicyId = v\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) SetPolicyRef(v string) {\n\tx.xxx_hidden_PolicyRef = v\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) SetIncludeTargets(v []string) {\n\tx.xxx_hidden_IncludeTargets = v\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) HasScope() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Scope != nil\n}\n\nfunc (x *PayloadPolicyEnforcementDeleted) ClearScope() {\n\tx.xxx_hidden_Scope = nil\n}\n\ntype PayloadPolicyEnforcementDeleted_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// scope is the scope to which the policy was enforced.\n\tScope *PolicyEnforcementScope\n\t// policy_id is the id of the policy that was enforced.\n\tPolicyId string\n\t// policy_ref is the reference of the policy that was enforced.\n\tPolicyRef string\n\t// include_targets were the include targets of the policy enforcement.\n\tIncludeTargets []string\n}\n\nfunc (b0 PayloadPolicyEnforcementDeleted_builder) Build() *PayloadPolicyEnforcementDeleted {\n\tm0 := &PayloadPolicyEnforcementDeleted{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Scope = b.Scope\n\tx.xxx_hidden_PolicyId = b.PolicyId\n\tx.xxx_hidden_PolicyRef = b.PolicyRef\n\tx.xxx_hidden_IncludeTargets = b.IncludeTargets\n\treturn m0\n}\n\ntype PayloadPolicyEnforcementPolicyChanged struct {\n\tstate                   protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_Scope        *PolicyEnforcementScope `protobuf:\"bytes,1,opt,name=scope,proto3\"`\n\txxx_hidden_OldPolicyId  string                  `protobuf:\"bytes,2,opt,name=old_policy_id,json=oldPolicyId,proto3\"`\n\txxx_hidden_NewPolicyId  string                  `protobuf:\"bytes,3,opt,name=new_policy_id,json=newPolicyId,proto3\"`\n\txxx_hidden_OldPolicyRef string                  `protobuf:\"bytes,4,opt,name=old_policy_ref,json=oldPolicyRef,proto3\"`\n\txxx_hidden_NewPolicyRef string                  `protobuf:\"bytes,5,opt,name=new_policy_ref,json=newPolicyRef,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) Reset() {\n\t*x = PayloadPolicyEnforcementPolicyChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[82]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyEnforcementPolicyChanged) ProtoMessage() {}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[82]\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\nfunc (x *PayloadPolicyEnforcementPolicyChanged) GetScope() *PolicyEnforcementScope {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Scope\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) GetOldPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldPolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) GetNewPolicyId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewPolicyId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) GetOldPolicyRef() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldPolicyRef\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) GetNewPolicyRef() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewPolicyRef\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) SetScope(v *PolicyEnforcementScope) {\n\tx.xxx_hidden_Scope = v\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) SetOldPolicyId(v string) {\n\tx.xxx_hidden_OldPolicyId = v\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) SetNewPolicyId(v string) {\n\tx.xxx_hidden_NewPolicyId = v\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) SetOldPolicyRef(v string) {\n\tx.xxx_hidden_OldPolicyRef = v\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) SetNewPolicyRef(v string) {\n\tx.xxx_hidden_NewPolicyRef = v\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) HasScope() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Scope != nil\n}\n\nfunc (x *PayloadPolicyEnforcementPolicyChanged) ClearScope() {\n\tx.xxx_hidden_Scope = nil\n}\n\ntype PayloadPolicyEnforcementPolicyChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// scope is the scope to which the policy is enforced. An enforcement cannot change its scope.\n\tScope *PolicyEnforcementScope\n\t// old_policy_id is the id of the old policy.\n\tOldPolicyId string\n\t// new_policy_id is the id of the new policy.\n\tNewPolicyId string\n\t// old_policy_ref is the reference of the old policy.\n\tOldPolicyRef string\n\t// new_policy_ref is the reference of the new policy.\n\tNewPolicyRef string\n}\n\nfunc (b0 PayloadPolicyEnforcementPolicyChanged_builder) Build() *PayloadPolicyEnforcementPolicyChanged {\n\tm0 := &PayloadPolicyEnforcementPolicyChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Scope = b.Scope\n\tx.xxx_hidden_OldPolicyId = b.OldPolicyId\n\tx.xxx_hidden_NewPolicyId = b.NewPolicyId\n\tx.xxx_hidden_OldPolicyRef = b.OldPolicyRef\n\tx.xxx_hidden_NewPolicyRef = b.NewPolicyRef\n\treturn m0\n}\n\ntype PayloadPolicyEnforcementTargetsChanged struct {\n\tstate                        protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_Scope             *PolicyEnforcementScope `protobuf:\"bytes,1,opt,name=scope,proto3\"`\n\txxx_hidden_OldIncludeTargets []string                `protobuf:\"bytes,2,rep,name=old_include_targets,json=oldIncludeTargets,proto3\"`\n\txxx_hidden_NewIncludeTargets []string                `protobuf:\"bytes,3,rep,name=new_include_targets,json=newIncludeTargets,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) Reset() {\n\t*x = PayloadPolicyEnforcementTargetsChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[83]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadPolicyEnforcementTargetsChanged) ProtoMessage() {}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[83]\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\nfunc (x *PayloadPolicyEnforcementTargetsChanged) GetScope() *PolicyEnforcementScope {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Scope\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) GetOldIncludeTargets() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldIncludeTargets\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) GetNewIncludeTargets() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewIncludeTargets\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) SetScope(v *PolicyEnforcementScope) {\n\tx.xxx_hidden_Scope = v\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) SetOldIncludeTargets(v []string) {\n\tx.xxx_hidden_OldIncludeTargets = v\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) SetNewIncludeTargets(v []string) {\n\tx.xxx_hidden_NewIncludeTargets = v\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) HasScope() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Scope != nil\n}\n\nfunc (x *PayloadPolicyEnforcementTargetsChanged) ClearScope() {\n\tx.xxx_hidden_Scope = nil\n}\n\ntype PayloadPolicyEnforcementTargetsChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// scope is the scope to which the policy is enforced. An enforcement cannot change its scope.\n\tScope *PolicyEnforcementScope\n\t// old_include_targets are the old include targets of the policy enforcement.\n\tOldIncludeTargets []string\n\t// new_include_targets are the new include targets of the policy enforcement.\n\tNewIncludeTargets []string\n}\n\nfunc (b0 PayloadPolicyEnforcementTargetsChanged_builder) Build() *PayloadPolicyEnforcementTargetsChanged {\n\tm0 := &PayloadPolicyEnforcementTargetsChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Scope = b.Scope\n\tx.xxx_hidden_OldIncludeTargets = b.OldIncludeTargets\n\tx.xxx_hidden_NewIncludeTargets = b.NewIncludeTargets\n\treturn m0\n}\n\ntype ResourceVisibilityControl struct {\n\tstate                 protoimpl.MessageState               `protogen:\"opaque.v1\"`\n\txxx_hidden_Visibility ResourceVisibilityControl_Visibility `protobuf:\"varint,1,opt,name=visibility,proto3,enum=buf.alpha.audit.v1alpha1.ResourceVisibilityControl_Visibility\"`\n\txxx_hidden_Strict     bool                                 `protobuf:\"varint,2,opt,name=strict,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *ResourceVisibilityControl) Reset() {\n\t*x = ResourceVisibilityControl{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[84]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ResourceVisibilityControl) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ResourceVisibilityControl) ProtoMessage() {}\n\nfunc (x *ResourceVisibilityControl) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[84]\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\nfunc (x *ResourceVisibilityControl) GetVisibility() ResourceVisibilityControl_Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn ResourceVisibilityControl_VISIBILITY_UNSPECIFIED\n}\n\nfunc (x *ResourceVisibilityControl) GetStrict() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Strict\n\t}\n\treturn false\n}\n\nfunc (x *ResourceVisibilityControl) SetVisibility(v ResourceVisibilityControl_Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *ResourceVisibilityControl) SetStrict(v bool) {\n\tx.xxx_hidden_Strict = v\n}\n\ntype ResourceVisibilityControl_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The visibility that is being controlled.\n\tVisibility ResourceVisibilityControl_Visibility\n\t// Strict defines if the controlled visibility behaves like a restriction or a default value.\n\tStrict bool\n}\n\nfunc (b0 ResourceVisibilityControl_builder) Build() *ResourceVisibilityControl {\n\tm0 := &ResourceVisibilityControl{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Visibility = b.Visibility\n\tx.xxx_hidden_Strict = b.Strict\n\treturn m0\n}\n\ntype PayloadServerResourceVisibilityControlChanged struct {\n\tstate                           protoimpl.MessageState     `protogen:\"opaque.v1\"`\n\txxx_hidden_ResourceType         ResourceType               `protobuf:\"varint,1,opt,name=resource_type,json=resourceType,proto3,enum=buf.alpha.audit.v1alpha1.ResourceType\"`\n\txxx_hidden_OldVisibilityControl *ResourceVisibilityControl `protobuf:\"bytes,2,opt,name=old_visibility_control,json=oldVisibilityControl,proto3,oneof\"`\n\txxx_hidden_NewVisibilityControl *ResourceVisibilityControl `protobuf:\"bytes,3,opt,name=new_visibility_control,json=newVisibilityControl,proto3,oneof\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) Reset() {\n\t*x = PayloadServerResourceVisibilityControlChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[85]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadServerResourceVisibilityControlChanged) ProtoMessage() {}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[85]\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\nfunc (x *PayloadServerResourceVisibilityControlChanged) GetResourceType() ResourceType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ResourceType\n\t}\n\treturn ResourceType_RESOURCE_TYPE_UNSPECIFIED\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) GetOldVisibilityControl() *ResourceVisibilityControl {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldVisibilityControl\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) GetNewVisibilityControl() *ResourceVisibilityControl {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewVisibilityControl\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) SetResourceType(v ResourceType) {\n\tx.xxx_hidden_ResourceType = v\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) SetOldVisibilityControl(v *ResourceVisibilityControl) {\n\tx.xxx_hidden_OldVisibilityControl = v\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) SetNewVisibilityControl(v *ResourceVisibilityControl) {\n\tx.xxx_hidden_NewVisibilityControl = v\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) HasOldVisibilityControl() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_OldVisibilityControl != nil\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) HasNewVisibilityControl() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_NewVisibilityControl != nil\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) ClearOldVisibilityControl() {\n\tx.xxx_hidden_OldVisibilityControl = nil\n}\n\nfunc (x *PayloadServerResourceVisibilityControlChanged) ClearNewVisibilityControl() {\n\tx.xxx_hidden_NewVisibilityControl = nil\n}\n\ntype PayloadServerResourceVisibilityControlChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The resource type that had its visibility control changed.\n\tResourceType ResourceType\n\t// The old visibility control for resources of that type under the server instance. If not\n\t// present, then this visibility control was just created.\n\tOldVisibilityControl *ResourceVisibilityControl\n\t// The new visibility control for resources of that type under the server instance. If not\n\t// present, then this visibility control was just deleted.\n\tNewVisibilityControl *ResourceVisibilityControl\n}\n\nfunc (b0 PayloadServerResourceVisibilityControlChanged_builder) Build() *PayloadServerResourceVisibilityControlChanged {\n\tm0 := &PayloadServerResourceVisibilityControlChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ResourceType = b.ResourceType\n\tx.xxx_hidden_OldVisibilityControl = b.OldVisibilityControl\n\tx.xxx_hidden_NewVisibilityControl = b.NewVisibilityControl\n\treturn m0\n}\n\ntype PayloadOrganizationResourceVisibilityControlChanged struct {\n\tstate                           protoimpl.MessageState     `protogen:\"opaque.v1\"`\n\txxx_hidden_ResourceType         ResourceType               `protobuf:\"varint,1,opt,name=resource_type,json=resourceType,proto3,enum=buf.alpha.audit.v1alpha1.ResourceType\"`\n\txxx_hidden_OldVisibilityControl *ResourceVisibilityControl `protobuf:\"bytes,2,opt,name=old_visibility_control,json=oldVisibilityControl,proto3,oneof\"`\n\txxx_hidden_NewVisibilityControl *ResourceVisibilityControl `protobuf:\"bytes,3,opt,name=new_visibility_control,json=newVisibilityControl,proto3,oneof\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) Reset() {\n\t*x = PayloadOrganizationResourceVisibilityControlChanged{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[86]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationResourceVisibilityControlChanged) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[86]\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\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) GetResourceType() ResourceType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ResourceType\n\t}\n\treturn ResourceType_RESOURCE_TYPE_UNSPECIFIED\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) GetOldVisibilityControl() *ResourceVisibilityControl {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OldVisibilityControl\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) GetNewVisibilityControl() *ResourceVisibilityControl {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewVisibilityControl\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) SetResourceType(v ResourceType) {\n\tx.xxx_hidden_ResourceType = v\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) SetOldVisibilityControl(v *ResourceVisibilityControl) {\n\tx.xxx_hidden_OldVisibilityControl = v\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) SetNewVisibilityControl(v *ResourceVisibilityControl) {\n\tx.xxx_hidden_NewVisibilityControl = v\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) HasOldVisibilityControl() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_OldVisibilityControl != nil\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) HasNewVisibilityControl() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_NewVisibilityControl != nil\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) ClearOldVisibilityControl() {\n\tx.xxx_hidden_OldVisibilityControl = nil\n}\n\nfunc (x *PayloadOrganizationResourceVisibilityControlChanged) ClearNewVisibilityControl() {\n\tx.xxx_hidden_NewVisibilityControl = nil\n}\n\ntype PayloadOrganizationResourceVisibilityControlChanged_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The resource type that had its visibility control changed.\n\tResourceType ResourceType\n\t// The old visibility control for resources of that type under the organization. If not present,\n\t// then this visibility control was just created.\n\tOldVisibilityControl *ResourceVisibilityControl\n\t// The new visibility control for resources of that type under the organization. If not present,\n\t// then this visibility control was just deleted.\n\tNewVisibilityControl *ResourceVisibilityControl\n}\n\nfunc (b0 PayloadOrganizationResourceVisibilityControlChanged_builder) Build() *PayloadOrganizationResourceVisibilityControlChanged {\n\tm0 := &PayloadOrganizationResourceVisibilityControlChanged{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ResourceType = b.ResourceType\n\tx.xxx_hidden_OldVisibilityControl = b.OldVisibilityControl\n\tx.xxx_hidden_NewVisibilityControl = b.NewVisibilityControl\n\treturn m0\n}\n\ntype PayloadOrganizationUniquenessPolicyEnabled struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationUniquenessPolicyEnabled) Reset() {\n\t*x = PayloadOrganizationUniquenessPolicyEnabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[87]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationUniquenessPolicyEnabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationUniquenessPolicyEnabled) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationUniquenessPolicyEnabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[87]\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\ntype PayloadOrganizationUniquenessPolicyEnabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadOrganizationUniquenessPolicyEnabled_builder) Build() *PayloadOrganizationUniquenessPolicyEnabled {\n\tm0 := &PayloadOrganizationUniquenessPolicyEnabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadOrganizationUniquenessPolicyDisabled struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationUniquenessPolicyDisabled) Reset() {\n\t*x = PayloadOrganizationUniquenessPolicyDisabled{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[88]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationUniquenessPolicyDisabled) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationUniquenessPolicyDisabled) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationUniquenessPolicyDisabled) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[88]\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\ntype PayloadOrganizationUniquenessPolicyDisabled_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PayloadOrganizationUniquenessPolicyDisabled_builder) Build() *PayloadOrganizationUniquenessPolicyDisabled {\n\tm0 := &PayloadOrganizationUniquenessPolicyDisabled{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PayloadOrganizationMemberRolesChanged_OrganizationRole struct {\n\tstate             protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_Role   v1alpha1.OrganizationRole       `protobuf:\"varint,1,opt,name=role,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\txxx_hidden_Source v1alpha1.OrganizationRoleSource `protobuf:\"varint,2,opt,name=source,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRoleSource\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged_OrganizationRole) Reset() {\n\t*x = PayloadOrganizationMemberRolesChanged_OrganizationRole{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[89]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged_OrganizationRole) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadOrganizationMemberRolesChanged_OrganizationRole) ProtoMessage() {}\n\nfunc (x *PayloadOrganizationMemberRolesChanged_OrganizationRole) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[89]\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\nfunc (x *PayloadOrganizationMemberRolesChanged_OrganizationRole) GetRole() v1alpha1.OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Role\n\t}\n\treturn v1alpha1.OrganizationRole(0)\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged_OrganizationRole) GetSource() v1alpha1.OrganizationRoleSource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Source\n\t}\n\treturn v1alpha1.OrganizationRoleSource(0)\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged_OrganizationRole) SetRole(v v1alpha1.OrganizationRole) {\n\tx.xxx_hidden_Role = v\n}\n\nfunc (x *PayloadOrganizationMemberRolesChanged_OrganizationRole) SetSource(v v1alpha1.OrganizationRoleSource) {\n\tx.xxx_hidden_Source = v\n}\n\ntype PayloadOrganizationMemberRolesChanged_OrganizationRole_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// role is the role of the member.\n\tRole v1alpha1.OrganizationRole\n\t// source is the source of the role granted to the member.\n\tSource v1alpha1.OrganizationRoleSource\n}\n\nfunc (b0 PayloadOrganizationMemberRolesChanged_OrganizationRole_builder) Build() *PayloadOrganizationMemberRolesChanged_OrganizationRole {\n\tm0 := &PayloadOrganizationMemberRolesChanged_OrganizationRole{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Role = b.Role\n\tx.xxx_hidden_Source = b.Source\n\treturn m0\n}\n\ntype PayloadRepositoryContributorRolesChanged_RepositoryRole struct {\n\tstate             protoimpl.MessageState        `protogen:\"opaque.v1\"`\n\txxx_hidden_Role   v1alpha1.RepositoryRole       `protobuf:\"varint,1,opt,name=role,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\txxx_hidden_Source v1alpha1.RepositoryRoleSource `protobuf:\"varint,2,opt,name=source,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRoleSource\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged_RepositoryRole) Reset() {\n\t*x = PayloadRepositoryContributorRolesChanged_RepositoryRole{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[90]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged_RepositoryRole) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryContributorRolesChanged_RepositoryRole) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryContributorRolesChanged_RepositoryRole) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[90]\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\nfunc (x *PayloadRepositoryContributorRolesChanged_RepositoryRole) GetRole() v1alpha1.RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Role\n\t}\n\treturn v1alpha1.RepositoryRole(0)\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged_RepositoryRole) GetSource() v1alpha1.RepositoryRoleSource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Source\n\t}\n\treturn v1alpha1.RepositoryRoleSource(0)\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged_RepositoryRole) SetRole(v v1alpha1.RepositoryRole) {\n\tx.xxx_hidden_Role = v\n}\n\nfunc (x *PayloadRepositoryContributorRolesChanged_RepositoryRole) SetSource(v v1alpha1.RepositoryRoleSource) {\n\tx.xxx_hidden_Source = v\n}\n\ntype PayloadRepositoryContributorRolesChanged_RepositoryRole_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// role is the role of the member.\n\tRole v1alpha1.RepositoryRole\n\t// source is the source of the role granted to the member.\n\tSource v1alpha1.RepositoryRoleSource\n}\n\nfunc (b0 PayloadRepositoryContributorRolesChanged_RepositoryRole_builder) Build() *PayloadRepositoryContributorRolesChanged_RepositoryRole {\n\tm0 := &PayloadRepositoryContributorRolesChanged_RepositoryRole{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Role = b.Role\n\tx.xxx_hidden_Source = b.Source\n\treturn m0\n}\n\n// IgnoreEntry is an entry of the ignore configuration applied to the repository label, for a\n// specific enforcement id.\ntype PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RuleOrCategoryId string                 `protobuf:\"bytes,1,opt,name=rule_or_category_id,json=ruleOrCategoryId,proto3\"`\n\txxx_hidden_Paths            []string               `protobuf:\"bytes,2,rep,name=paths,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) Reset() {\n\t*x = PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[91]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) ProtoMessage() {}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[91]\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\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) GetRuleOrCategoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RuleOrCategoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) GetPaths() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Paths\n\t}\n\treturn nil\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) SetRuleOrCategoryId(v string) {\n\tx.xxx_hidden_RuleOrCategoryId = v\n}\n\nfunc (x *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry) SetPaths(v []string) {\n\tx.xxx_hidden_Paths = v\n}\n\ntype PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ignored rule or category id.\n\t//\n\t// If empty, this is an `ignore` entry. If populated, this is an `ignore_only` entry.\n\tRuleOrCategoryId string\n\t// The ignored file or directory paths.\n\tPaths []string\n}\n\nfunc (b0 PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry_builder) Build() *PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry {\n\tm0 := &PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RuleOrCategoryId = b.RuleOrCategoryId\n\tx.xxx_hidden_Paths = b.Paths\n\treturn m0\n}\n\ntype PolicyEnforcementScope_PolicyEnforcementScopeInstance struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeInstance) Reset() {\n\t*x = PolicyEnforcementScope_PolicyEnforcementScopeInstance{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[92]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeInstance) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PolicyEnforcementScope_PolicyEnforcementScopeInstance) ProtoMessage() {}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeInstance) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[92]\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\ntype PolicyEnforcementScope_PolicyEnforcementScopeInstance_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 PolicyEnforcementScope_PolicyEnforcementScopeInstance_builder) Build() *PolicyEnforcementScope_PolicyEnforcementScopeInstance {\n\tm0 := &PolicyEnforcementScope_PolicyEnforcementScopeInstance{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype PolicyEnforcementScope_PolicyEnforcementScopeOwner struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerId   string                 `protobuf:\"bytes,1,opt,name=owner_id,json=ownerId,proto3\"`\n\txxx_hidden_OwnerName string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeOwner) Reset() {\n\t*x = PolicyEnforcementScope_PolicyEnforcementScopeOwner{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[93]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeOwner) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PolicyEnforcementScope_PolicyEnforcementScopeOwner) ProtoMessage() {}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeOwner) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[93]\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\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeOwner) GetOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeOwner) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeOwner) SetOwnerId(v string) {\n\tx.xxx_hidden_OwnerId = v\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeOwner) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\ntype PolicyEnforcementScope_PolicyEnforcementScopeOwner_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// owner_id is the id of the owner (organization or user).\n\tOwnerId string\n\t// owner_name is the name of the owner (organization or user).\n\tOwnerName string\n}\n\nfunc (b0 PolicyEnforcementScope_PolicyEnforcementScopeOwner_builder) Build() *PolicyEnforcementScope_PolicyEnforcementScopeOwner {\n\tm0 := &PolicyEnforcementScope_PolicyEnforcementScopeOwner{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerId = b.OwnerId\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\treturn m0\n}\n\ntype PolicyEnforcementScope_PolicyEnforcementScopeRepository struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwnerId   string                 `protobuf:\"bytes,1,opt,name=repository_owner_id,json=repositoryOwnerId,proto3\"`\n\txxx_hidden_RepositoryOwnerName string                 `protobuf:\"bytes,2,opt,name=repository_owner_name,json=repositoryOwnerName,proto3\"`\n\txxx_hidden_RepositoryId        string                 `protobuf:\"bytes,3,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryName      string                 `protobuf:\"bytes,4,opt,name=repository_name,json=repositoryName,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) Reset() {\n\t*x = PolicyEnforcementScope_PolicyEnforcementScopeRepository{}\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[94]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PolicyEnforcementScope_PolicyEnforcementScopeRepository) ProtoMessage() {}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_event_proto_msgTypes[94]\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\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) GetRepositoryOwnerId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) GetRepositoryOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) SetRepositoryOwnerId(v string) {\n\tx.xxx_hidden_RepositoryOwnerId = v\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) SetRepositoryOwnerName(v string) {\n\tx.xxx_hidden_RepositoryOwnerName = v\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *PolicyEnforcementScope_PolicyEnforcementScopeRepository) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\ntype PolicyEnforcementScope_PolicyEnforcementScopeRepository_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// repository_owner_id is the id of the owner of the repository.\n\tRepositoryOwnerId string\n\t// repository_owner_name is the name of the owner of the repository.\n\tRepositoryOwnerName string\n\t// repository_id is the id of the repository.\n\tRepositoryId string\n\t// repository_name is the name of the repository.\n\tRepositoryName string\n}\n\nfunc (b0 PolicyEnforcementScope_PolicyEnforcementScopeRepository_builder) Build() *PolicyEnforcementScope_PolicyEnforcementScopeRepository {\n\tm0 := &PolicyEnforcementScope_PolicyEnforcementScopeRepository{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwnerId = b.RepositoryOwnerId\n\tx.xxx_hidden_RepositoryOwnerName = b.RepositoryOwnerName\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\treturn m0\n}\n\nvar File_buf_alpha_audit_v1alpha1_event_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_audit_v1alpha1_event_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"$buf/alpha/audit/v1alpha1/event.proto\\x12\\x18buf.alpha.audit.v1alpha1\\x1a'buf/alpha/registry/v1alpha1/admin.proto\\x1a,buf/alpha/registry/v1alpha1/repository.proto\\x1a&buf/alpha/registry/v1alpha1/role.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"d\\n\" +\n\t\"\\x05Actor\\x127\\n\" +\n\t\"\\x04type\\x18\\x01 \\x01(\\x0e2#.buf.alpha.audit.v1alpha1.ActorTypeR\\x04type\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x02 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x03 \\x01(\\tR\\x04name\\\"j\\n\" +\n\t\"\\bResource\\x12:\\n\" +\n\t\"\\x04type\\x18\\x01 \\x01(\\x0e2&.buf.alpha.audit.v1alpha1.ResourceTypeR\\x04type\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x02 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x03 \\x01(\\tR\\x04name\\\"Y\\n\" +\n\t\"\\rEventMetadata\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"user_agent\\x18\\x01 \\x01(\\tR\\tuserAgent\\x12\\x0e\\n\" +\n\t\"\\x02ip\\x18\\x02 \\x01(\\tR\\x02ip\\x12\\x19\\n\" +\n\t\"\\btrace_id\\x18\\x03 \\x01(\\tR\\atraceId\\\"\\xdfP\\n\" +\n\t\"\\x05Event\\x12\\x19\\n\" +\n\t\"\\bevent_id\\x18\\x01 \\x01(\\tR\\aeventId\\x127\\n\" +\n\t\"\\x04type\\x18\\x02 \\x01(\\x0e2#.buf.alpha.audit.v1alpha1.EventTypeR\\x04type\\x125\\n\" +\n\t\"\\x05actor\\x18\\x03 \\x01(\\v2\\x1f.buf.alpha.audit.v1alpha1.ActorR\\x05actor\\x12>\\n\" +\n\t\"\\bresource\\x18\\x04 \\x01(\\v2\\\".buf.alpha.audit.v1alpha1.ResourceR\\bresource\\x129\\n\" +\n\t\"\\n\" +\n\t\"event_time\\x18\\x05 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\teventTime\\x12C\\n\" +\n\t\"\\bmetadata\\x18\\x06 \\x01(\\v2'.buf.alpha.audit.v1alpha1.EventMetadataR\\bmetadata\\x12i\\n\" +\n\t\"\\x14organization_created\\x18\\a \\x01(\\v24.buf.alpha.audit.v1alpha1.PayloadOrganizationCreatedH\\x00R\\x13organizationCreated\\x12i\\n\" +\n\t\"\\x14organization_deleted\\x18\\b \\x01(\\v24.buf.alpha.audit.v1alpha1.PayloadOrganizationDeletedH\\x00R\\x13organizationDeleted\\x12v\\n\" +\n\t\"\\x19organization_member_added\\x18\\t \\x01(\\v28.buf.alpha.audit.v1alpha1.PayloadOrganizationMemberAddedH\\x00R\\x17organizationMemberAdded\\x12\\x89\\x01\\n\" +\n\t\" organization_member_role_changed\\x18\\n\" +\n\t\" \\x01(\\v2>.buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRoleChangedH\\x00R\\x1dorganizationMemberRoleChanged\\x12\\x8c\\x01\\n\" +\n\t\"!organization_member_roles_changed\\x188 \\x01(\\v2?.buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChangedH\\x00R\\x1eorganizationMemberRolesChanged\\x12|\\n\" +\n\t\"\\x1borganization_member_removed\\x18\\v \\x01(\\v2:.buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRemovedH\\x00R\\x19organizationMemberRemoved\\x12\\xb7\\x01\\n\" +\n\t\"0organization_resource_visibility_control_changed\\x18W \\x01(\\v2M.buf.alpha.audit.v1alpha1.PayloadOrganizationResourceVisibilityControlChangedH\\x00R,organizationResourceVisibilityControlChanged\\x12\\x9b\\x01\\n\" +\n\t\"&organization_uniqueness_policy_enabled\\x18X \\x01(\\v2D.buf.alpha.audit.v1alpha1.PayloadOrganizationUniquenessPolicyEnabledH\\x00R#organizationUniquenessPolicyEnabled\\x12\\x9e\\x01\\n\" +\n\t\"'organization_uniqueness_policy_disabled\\x18Y \\x01(\\v2E.buf.alpha.audit.v1alpha1.PayloadOrganizationUniquenessPolicyDisabledH\\x00R$organizationUniquenessPolicyDisabled\\x12c\\n\" +\n\t\"\\x12repository_created\\x18\\f \\x01(\\v22.buf.alpha.audit.v1alpha1.PayloadRepositoryCreatedH\\x00R\\x11repositoryCreated\\x12l\\n\" +\n\t\"\\x15repository_deprecated\\x186 \\x01(\\v25.buf.alpha.audit.v1alpha1.PayloadRepositoryDeprecatedH\\x00R\\x14repositoryDeprecated\\x12r\\n\" +\n\t\"\\x17repository_undeprecated\\x187 \\x01(\\v27.buf.alpha.audit.v1alpha1.PayloadRepositoryUndeprecatedH\\x00R\\x16repositoryUndeprecated\\x12c\\n\" +\n\t\"\\x12repository_deleted\\x18\\r \\x01(\\v22.buf.alpha.audit.v1alpha1.PayloadRepositoryDeletedH\\x00R\\x11repositoryDeleted\\x12s\\n\" +\n\t\"\\x18repository_commit_pushed\\x18\\x0e \\x01(\\v27.buf.alpha.audit.v1alpha1.PayloadRepositoryCommitPushedH\\x00R\\x16repositoryCommitPushed\\x12\\x7f\\n\" +\n\t\"\\x1crepository_contributor_added\\x18\\x0f \\x01(\\v2;.buf.alpha.audit.v1alpha1.PayloadRepositoryContributorAddedH\\x00R\\x1arepositoryContributorAdded\\x12\\x92\\x01\\n\" +\n\t\"#repository_contributor_role_changed\\x18\\x10 \\x01(\\v2A.buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRoleChangedH\\x00R repositoryContributorRoleChanged\\x12\\x95\\x01\\n\" +\n\t\"$repository_contributor_roles_changed\\x18E \\x01(\\v2B.buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChangedH\\x00R!repositoryContributorRolesChanged\\x12\\x85\\x01\\n\" +\n\t\"\\x1erepository_contributor_removed\\x18\\x11 \\x01(\\v2=.buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRemovedH\\x00R\\x1crepositoryContributorRemoved\\x12\\x82\\x01\\n\" +\n\t\"\\x1drepository_visibility_changed\\x18\\x12 \\x01(\\v2<.buf.alpha.audit.v1alpha1.PayloadRepositoryVisibilityChangedH\\x00R\\x1brepositoryVisibilityChanged\\x12\\x96\\x01\\n\" +\n\t\"%repository_default_label_name_changed\\x18. \\x01(\\v2B.buf.alpha.audit.v1alpha1.PayloadRepositoryDefaultLabelNameChangedH\\x00R!repositoryDefaultLabelNameChanged\\x12w\\n\" +\n\t\"\\x1arepository_idp_group_added\\x18B \\x01(\\v28.buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupAddedH\\x00R\\x17repositoryIdpGroupAdded\\x12}\\n\" +\n\t\"\\x1crepository_idp_group_updated\\x18C \\x01(\\v2:.buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupUpdatedH\\x00R\\x19repositoryIdpGroupUpdated\\x12}\\n\" +\n\t\"\\x1crepository_idp_group_removed\\x18D \\x01(\\v2:.buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupRemovedH\\x00R\\x19repositoryIdpGroupRemoved\\x12W\\n\" +\n\t\"\\x0epolicy_created\\x18< \\x01(\\v2..buf.alpha.audit.v1alpha1.PayloadPolicyCreatedH\\x00R\\rpolicyCreated\\x12W\\n\" +\n\t\"\\x0epolicy_deleted\\x18= \\x01(\\v2..buf.alpha.audit.v1alpha1.PayloadPolicyDeletedH\\x00R\\rpolicyDeleted\\x12`\\n\" +\n\t\"\\x11policy_deprecated\\x18> \\x01(\\v21.buf.alpha.audit.v1alpha1.PayloadPolicyDeprecatedH\\x00R\\x10policyDeprecated\\x12f\\n\" +\n\t\"\\x13policy_undeprecated\\x18? \\x01(\\v23.buf.alpha.audit.v1alpha1.PayloadPolicyUndeprecatedH\\x00R\\x12policyUndeprecated\\x12v\\n\" +\n\t\"\\x19policy_visibility_changed\\x18@ \\x01(\\v28.buf.alpha.audit.v1alpha1.PayloadPolicyVisibilityChangedH\\x00R\\x17policyVisibilityChanged\\x12g\\n\" +\n\t\"\\x14policy_commit_pushed\\x18F \\x01(\\v23.buf.alpha.audit.v1alpha1.PayloadPolicyCommitPushedH\\x00R\\x12policyCommitPushed\\x12g\\n\" +\n\t\"\\x14policy_label_created\\x18G \\x01(\\v23.buf.alpha.audit.v1alpha1.PayloadPolicyLabelCreatedH\\x00R\\x12policyLabelCreated\\x12a\\n\" +\n\t\"\\x12policy_label_moved\\x18H \\x01(\\v21.buf.alpha.audit.v1alpha1.PayloadPolicyLabelMovedH\\x00R\\x10policyLabelMoved\\x12j\\n\" +\n\t\"\\x15policy_label_archived\\x18I \\x01(\\v24.buf.alpha.audit.v1alpha1.PayloadPolicyLabelArchivedH\\x00R\\x13policyLabelArchived\\x12p\\n\" +\n\t\"\\x17policy_label_unarchived\\x18J \\x01(\\v26.buf.alpha.audit.v1alpha1.PayloadPolicyLabelUnarchivedH\\x00R\\x15policyLabelUnarchived\\x12W\\n\" +\n\t\"\\x0eplugin_created\\x18\\x13 \\x01(\\v2..buf.alpha.audit.v1alpha1.PayloadPluginCreatedH\\x00R\\rpluginCreated\\x12W\\n\" +\n\t\"\\x0eplugin_deleted\\x18\\x14 \\x01(\\v2..buf.alpha.audit.v1alpha1.PayloadPluginDeletedH\\x00R\\rpluginDeleted\\x12`\\n\" +\n\t\"\\x11plugin_deprecated\\x189 \\x01(\\v21.buf.alpha.audit.v1alpha1.PayloadPluginDeprecatedH\\x00R\\x10pluginDeprecated\\x12f\\n\" +\n\t\"\\x13plugin_undeprecated\\x18: \\x01(\\v23.buf.alpha.audit.v1alpha1.PayloadPluginUndeprecatedH\\x00R\\x12pluginUndeprecated\\x12v\\n\" +\n\t\"\\x19plugin_visibility_changed\\x18; \\x01(\\v28.buf.alpha.audit.v1alpha1.PayloadPluginVisibilityChangedH\\x00R\\x17pluginVisibilityChanged\\x12g\\n\" +\n\t\"\\x14plugin_commit_pushed\\x181 \\x01(\\v23.buf.alpha.audit.v1alpha1.PayloadPluginCommitPushedH\\x00R\\x12pluginCommitPushed\\x12Q\\n\" +\n\t\"\\fuser_created\\x18\\x15 \\x01(\\v2,.buf.alpha.audit.v1alpha1.PayloadUserCreatedH\\x00R\\vuserCreated\\x12]\\n\" +\n\t\"\\x10user_deactivated\\x18\\x16 \\x01(\\v20.buf.alpha.audit.v1alpha1.PayloadUserDeactivatedH\\x00R\\x0fuserDeactivated\\x12Q\\n\" +\n\t\"\\fuser_deleted\\x18\\x17 \\x01(\\v2,.buf.alpha.audit.v1alpha1.PayloadUserDeletedH\\x00R\\vuserDeleted\\x12U\\n\" +\n\t\"\\x0euser_logged_in\\x18\\x18 \\x01(\\v2-.buf.alpha.audit.v1alpha1.PayloadUserLoggedInH\\x00R\\fuserLoggedIn\\x12X\\n\" +\n\t\"\\x0fuser_logged_out\\x18\\x19 \\x01(\\v2..buf.alpha.audit.v1alpha1.PayloadUserLoggedOutH\\x00R\\ruserLoggedOut\\x12m\\n\" +\n\t\"\\x16curated_plugin_created\\x18\\x1a \\x01(\\v25.buf.alpha.audit.v1alpha1.PayloadCuratedPluginCreatedH\\x00R\\x14curatedPluginCreated\\x12d\\n\" +\n\t\"\\x0fidp_group_added\\x18\\x1b \\x01(\\v2:.buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupAddedH\\x00R\\ridpGroupAdded\\x12j\\n\" +\n\t\"\\x11idp_group_updated\\x18A \\x01(\\v2<.buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupUpdatedH\\x00R\\x0fidpGroupUpdated\\x12j\\n\" +\n\t\"\\x11idp_group_removed\\x18\\x1c \\x01(\\v2<.buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupRemovedH\\x00R\\x0fidpGroupRemoved\\x12T\\n\" +\n\t\"\\rtoken_created\\x18\\x1d \\x01(\\v2-.buf.alpha.audit.v1alpha1.PayloadTokenCreatedH\\x00R\\ftokenCreated\\x12T\\n\" +\n\t\"\\rtoken_deleted\\x18\\x1e \\x01(\\v2-.buf.alpha.audit.v1alpha1.PayloadTokenDeletedH\\x00R\\ftokenDeleted\\x12]\\n\" +\n\t\"\\x10user_reactivated\\x18\\x1f \\x01(\\v20.buf.alpha.audit.v1alpha1.PayloadUserReactivatedH\\x00R\\x0fuserReactivated\\x12a\\n\" +\n\t\"\\x12scim_token_created\\x18  \\x01(\\v21.buf.alpha.audit.v1alpha1.PayloadSCIMTokenCreatedH\\x00R\\x10scimTokenCreated\\x12a\\n\" +\n\t\"\\x12scim_token_deleted\\x18! \\x01(\\v21.buf.alpha.audit.v1alpha1.PayloadSCIMTokenDeletedH\\x00R\\x10scimTokenDeleted\\x12z\\n\" +\n\t\"\\x19repository_commit_deleted\\x18\\\" \\x01(\\v28.buf.alpha.audit.v1alpha1.PayloadRepositoryCommitDeletedB\\x02\\x18\\x01H\\x00R\\x17repositoryCommitDeleted\\x12s\\n\" +\n\t\"\\x18repository_label_created\\x18# \\x01(\\v27.buf.alpha.audit.v1alpha1.PayloadRepositoryLabelCreatedH\\x00R\\x16repositoryLabelCreated\\x12m\\n\" +\n\t\"\\x16repository_label_moved\\x18$ \\x01(\\v25.buf.alpha.audit.v1alpha1.PayloadRepositoryLabelMovedH\\x00R\\x14repositoryLabelMoved\\x12v\\n\" +\n\t\"\\x19repository_label_archived\\x18, \\x01(\\v28.buf.alpha.audit.v1alpha1.PayloadRepositoryLabelArchivedH\\x00R\\x17repositoryLabelArchived\\x12|\\n\" +\n\t\"\\x1brepository_label_unarchived\\x18- \\x01(\\v2:.buf.alpha.audit.v1alpha1.PayloadRepositoryLabelUnarchivedH\\x00R\\x19repositoryLabelUnarchived\\x12\\xab\\x01\\n\" +\n\t\",repository_label_enforcement_ignores_changed\\x18U \\x01(\\v2I.buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChangedH\\x00R(repositoryLabelEnforcementIgnoresChanged\\x12m\\n\" +\n\t\"\\x16curated_plugin_deleted\\x18% \\x01(\\v25.buf.alpha.audit.v1alpha1.PayloadCuratedPluginDeletedH\\x00R\\x14curatedPluginDeleted\\x12\\x80\\x01\\n\" +\n\t\"\\x1dcurated_plugin_status_updated\\x18T \\x01(\\v2;.buf.alpha.audit.v1alpha1.PayloadCuratedPluginStatusUpdatedH\\x00R\\x1acuratedPluginStatusUpdated\\x12\\xa5\\x01\\n\" +\n\t\"-payload_server_breaking_change_policy_enabled\\x18& \\x01(\\v2B.buf.alpha.audit.v1alpha1.PayloadServerBreakingChangePolicyEnabledH\\x00R(payloadServerBreakingChangePolicyEnabled\\x12\\xa8\\x01\\n\" +\n\t\".payload_server_breaking_change_policy_disabled\\x18' \\x01(\\v2C.buf.alpha.audit.v1alpha1.PayloadServerBreakingChangePolicyDisabledH\\x00R)payloadServerBreakingChangePolicyDisabled\\x12\\x90\\x01\\n\" +\n\t\"!repository_default_branch_changed\\x18( \\x01(\\v2?.buf.alpha.audit.v1alpha1.PayloadRepositoryDefaultBranchChangedB\\x02\\x18\\x01H\\x00R\\x1erepositoryDefaultBranchChanged\\x12\\x98\\x01\\n\" +\n\t\"(payload_server_uniqueness_policy_enabled\\x18) \\x01(\\v2>.buf.alpha.audit.v1alpha1.PayloadServerUniquenessPolicyEnabledH\\x00R$payloadServerUniquenessPolicyEnabled\\x12\\x9b\\x01\\n\" +\n\t\")payload_server_uniqueness_policy_disabled\\x18* \\x01(\\v2?.buf.alpha.audit.v1alpha1.PayloadServerUniquenessPolicyDisabledH\\x00R%payloadServerUniquenessPolicyDisabled\\x12\\xa5\\x01\\n\" +\n\t\"*server_resource_visibility_control_changed\\x18V \\x01(\\v2G.buf.alpha.audit.v1alpha1.PayloadServerResourceVisibilityControlChangedH\\x00R&serverResourceVisibilityControlChanged\\x12|\\n\" +\n\t\"\\x1duser_auto_merged_from_new_idp\\x18+ \\x01(\\v29.buf.alpha.audit.v1alpha1.PayloadUserAutoMergedFromNewIdPH\\x00R\\x18userAutoMergedFromNewIdp\\x12\\x92\\x01\\n\" +\n\t\"#device_authorization_grant_approved\\x18/ \\x01(\\v2A.buf.alpha.audit.v1alpha1.PayloadDeviceAuthorizationGrantApprovedH\\x00R deviceAuthorizationGrantApproved\\x12\\x8c\\x01\\n\" +\n\t\"!device_authorization_grant_denied\\x180 \\x01(\\v2?.buf.alpha.audit.v1alpha1.PayloadDeviceAuthorizationGrantDeniedH\\x00R\\x1edeviceAuthorizationGrantDenied\\x12g\\n\" +\n\t\"\\x14plugin_label_created\\x182 \\x01(\\v23.buf.alpha.audit.v1alpha1.PayloadPluginLabelCreatedH\\x00R\\x12pluginLabelCreated\\x12a\\n\" +\n\t\"\\x12plugin_label_moved\\x183 \\x01(\\v21.buf.alpha.audit.v1alpha1.PayloadPluginLabelMovedH\\x00R\\x10pluginLabelMoved\\x12j\\n\" +\n\t\"\\x15plugin_label_archived\\x184 \\x01(\\v24.buf.alpha.audit.v1alpha1.PayloadPluginLabelArchivedH\\x00R\\x13pluginLabelArchived\\x12p\\n\" +\n\t\"\\x17plugin_label_unarchived\\x185 \\x01(\\v26.buf.alpha.audit.v1alpha1.PayloadPluginLabelUnarchivedH\\x00R\\x15pluginLabelUnarchived\\x12w\\n\" +\n\t\"\\x1aserver_review_flow_enabled\\x18K \\x01(\\v28.buf.alpha.audit.v1alpha1.PayloadServerReviewFlowEnabledH\\x00R\\x17serverReviewFlowEnabled\\x12z\\n\" +\n\t\"\\x1bserver_review_flow_disabled\\x18L \\x01(\\v29.buf.alpha.audit.v1alpha1.PayloadServerReviewFlowDisabledH\\x00R\\x18serverReviewFlowDisabled\\x12\\x80\\x01\\n\" +\n\t\"\\x1dsdk_plugin_constraint_created\\x18M \\x01(\\v2;.buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintCreatedH\\x00R\\x1asdkPluginConstraintCreated\\x12\\x80\\x01\\n\" +\n\t\"\\x1dsdk_plugin_constraint_updated\\x18N \\x01(\\v2;.buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintUpdatedH\\x00R\\x1asdkPluginConstraintUpdated\\x12\\x80\\x01\\n\" +\n\t\"\\x1dsdk_plugin_constraint_deleted\\x18O \\x01(\\v2;.buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintDeletedH\\x00R\\x1asdkPluginConstraintDeleted\\x12y\\n\" +\n\t\"\\x1apolicy_enforcement_created\\x18P \\x01(\\v29.buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementCreatedH\\x00R\\x18policyEnforcementCreated\\x12y\\n\" +\n\t\"\\x1apolicy_enforcement_deleted\\x18Q \\x01(\\v29.buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementDeletedH\\x00R\\x18policyEnforcementDeleted\\x12\\x8c\\x01\\n\" +\n\t\"!policy_enforcement_policy_changed\\x18R \\x01(\\v2?.buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementPolicyChangedH\\x00R\\x1epolicyEnforcementPolicyChanged\\x12\\x8f\\x01\\n\" +\n\t\"\\\"policy_enforcement_targets_changed\\x18S \\x01(\\v2@.buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementTargetsChangedH\\x00R\\x1fpolicyEnforcementTargetsChangedB\\t\\n\" +\n\t\"\\apayload\\\"\\x1c\\n\" +\n\t\"\\x1aPayloadOrganizationCreated\\\"\\x1c\\n\" +\n\t\"\\x1aPayloadOrganizationDeleted\\\"\\xa9\\x02\\n\" +\n\t\"\\x1ePayloadOrganizationMemberAdded\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x02 \\x01(\\tR\\x10organizationName\\x12N\\n\" +\n\t\"\\vmember_role\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\n\" +\n\t\"memberRole\\x12a\\n\" +\n\t\"\\x12member_role_source\\x18\\x04 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.OrganizationRoleSourceR\\x10memberRoleSource\\\"\\xe8\\x03\\n\" +\n\t\"$PayloadOrganizationMemberRoleChanged\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x02 \\x01(\\tR\\x10organizationName\\x12H\\n\" +\n\t\"\\bold_role\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\aoldRole\\x12H\\n\" +\n\t\"\\bnew_role\\x18\\x04 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\anewRole\\x12h\\n\" +\n\t\"\\x16old_member_role_source\\x18\\x05 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.OrganizationRoleSourceR\\x13oldMemberRoleSource\\x12h\\n\" +\n\t\"\\x16new_member_role_source\\x18\\x06 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.OrganizationRoleSourceR\\x13newMemberRoleSource:\\x02\\x18\\x01\\\"\\x80\\x04\\n\" +\n\t\"%PayloadOrganizationMemberRolesChanged\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x02 \\x01(\\tR\\x10organizationName\\x12m\\n\" +\n\t\"\\told_roles\\x18\\x03 \\x03(\\v2P.buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.OrganizationRoleR\\boldRoles\\x12m\\n\" +\n\t\"\\tnew_roles\\x18\\x04 \\x03(\\v2P.buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.OrganizationRoleR\\bnewRoles\\x1a\\xa2\\x01\\n\" +\n\t\"\\x10OrganizationRole\\x12A\\n\" +\n\t\"\\x04role\\x18\\x01 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x04role\\x12K\\n\" +\n\t\"\\x06source\\x18\\x02 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.OrganizationRoleSourceR\\x06source\\\"\\xab\\x02\\n\" +\n\t\" PayloadOrganizationMemberRemoved\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x02 \\x01(\\tR\\x10organizationName\\x12N\\n\" +\n\t\"\\vmember_role\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\n\" +\n\t\"memberRole\\x12a\\n\" +\n\t\"\\x12member_role_source\\x18\\x04 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.OrganizationRoleSourceR\\x10memberRoleSource\\\"\\xcc\\x01\\n\" +\n\t\" PayloadOrganizationIDPGroupAdded\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x02 \\x01(\\tR\\x10organizationName\\x12R\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\froleOverride\\\"\\xb0\\x02\\n\" +\n\t\"\\\"PayloadOrganizationIDPGroupUpdated\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x02 \\x01(\\tR\\x10organizationName\\x12Y\\n\" +\n\t\"\\x11old_role_override\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x0foldRoleOverride\\x12Y\\n\" +\n\t\"\\x11new_role_override\\x18\\x04 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x0fnewRoleOverride\\\"\\xce\\x01\\n\" +\n\t\"\\\"PayloadOrganizationIDPGroupRemoved\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x02 \\x01(\\tR\\x10organizationName\\x12R\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\froleOverride\\\"\\xcb\\x01\\n\" +\n\t\"\\x18PayloadRepositoryCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\x12,\\n\" +\n\t\"\\x12default_label_name\\x18\\x04 \\x01(\\tR\\x10defaultLabelName\\\"\\x9d\\x01\\n\" +\n\t\"\\x18PayloadRepositoryDeleted\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\xd1\\x01\\n\" +\n\t\"\\x1bPayloadRepositoryDeprecated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\x12/\\n\" +\n\t\"\\x13deprecation_message\\x18\\x04 \\x01(\\tR\\x12deprecationMessage\\\"\\xa2\\x01\\n\" +\n\t\"\\x1dPayloadRepositoryUndeprecated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\xa0\\x02\\n\" +\n\t\"\\x1dPayloadRepositoryCommitPushed\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12\\x12\\n\" +\n\t\"\\x04tags\\x18\\x05 \\x03(\\tR\\x04tags\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"draft_name\\x18\\x06 \\x01(\\tR\\tdraftName\\x12'\\n\" +\n\t\"\\x0fmanifest_digest\\x18\\a \\x01(\\tR\\x0emanifestDigest\\x12\\x1b\\n\" +\n\t\"\\tb5_digest\\x18\\b \\x01(\\tR\\bb5Digest\\\"\\x83\\x02\\n\" +\n\t\"!PayloadRepositoryContributorAdded\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12V\\n\" +\n\t\"\\x10contributor_role\\x18\\x05 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x0fcontributorRole\\\"\\xc5\\x02\\n\" +\n\t\"'PayloadRepositoryContributorRoleChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12F\\n\" +\n\t\"\\bold_role\\x18\\x05 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\aoldRole\\x12F\\n\" +\n\t\"\\bnew_role\\x18\\x06 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\anewRole:\\x02\\x18\\x01\\\"\\xb1\\x04\\n\" +\n\t\"(PayloadRepositoryContributorRolesChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12n\\n\" +\n\t\"\\told_roles\\x18\\x05 \\x03(\\v2Q.buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.RepositoryRoleR\\boldRoles\\x12n\\n\" +\n\t\"\\tnew_roles\\x18\\x06 \\x03(\\v2Q.buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.RepositoryRoleR\\bnewRoles\\x1a\\x9c\\x01\\n\" +\n\t\"\\x0eRepositoryRole\\x12?\\n\" +\n\t\"\\x04role\\x18\\x01 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x04role\\x12I\\n\" +\n\t\"\\x06source\\x18\\x02 \\x01(\\x0e21.buf.alpha.registry.v1alpha1.RepositoryRoleSourceR\\x06source\\\"\\x85\\x02\\n\" +\n\t\"#PayloadRepositoryContributorRemoved\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12V\\n\" +\n\t\"\\x10contributor_role\\x18\\x05 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x0fcontributorRole\\\"\\xfe\\x01\\n\" +\n\t\"\\\"PayloadRepositoryVisibilityChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12N\\n\" +\n\t\"\\x0eold_visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\roldVisibility\\x12N\\n\" +\n\t\"\\x0enew_visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\rnewVisibility\\\"\\xce\\x01\\n\" +\n\t\"(PayloadRepositoryDefaultLabelNameChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x123\\n\" +\n\t\"\\x16old_default_label_name\\x18\\x03 \\x01(\\tR\\x13oldDefaultLabelName\\x123\\n\" +\n\t\"\\x16new_default_label_name\\x18\\x04 \\x01(\\tR\\x13newDefaultLabelName\\\"\\xc1\\x01\\n\" +\n\t\"%PayloadRepositoryDefaultBranchChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12,\\n\" +\n\t\"\\x12old_default_branch\\x18\\x03 \\x01(\\tR\\x10oldDefaultBranch\\x12,\\n\" +\n\t\"\\x12new_default_branch\\x18\\x04 \\x01(\\tR\\x10newDefaultBranch:\\x02\\x18\\x01\\\"\\xc0\\x01\\n\" +\n\t\"\\x1ePayloadRepositoryIDPGroupAdded\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12P\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\froleOverride\\\"\\xa2\\x02\\n\" +\n\t\" PayloadRepositoryIDPGroupUpdated\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12W\\n\" +\n\t\"\\x11old_role_override\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x0foldRoleOverride\\x12W\\n\" +\n\t\"\\x11new_role_override\\x18\\x04 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x0fnewRoleOverride\\\"\\xc2\\x01\\n\" +\n\t\" PayloadRepositoryIDPGroupRemoved\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12P\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\froleOverride\\\"\\x99\\x01\\n\" +\n\t\"\\x14PayloadPolicyCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\x99\\x01\\n\" +\n\t\"\\x14PayloadPolicyDeleted\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\x9c\\x01\\n\" +\n\t\"\\x17PayloadPolicyDeprecated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\x9e\\x01\\n\" +\n\t\"\\x19PayloadPolicyUndeprecated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\xfa\\x01\\n\" +\n\t\"\\x1ePayloadPolicyVisibilityChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12N\\n\" +\n\t\"\\x0eold_visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\roldVisibility\\x12N\\n\" +\n\t\"\\x0enew_visibility\\x18\\x05 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\rnewVisibility\\\"\\xb0\\x01\\n\" +\n\t\"\\x19PayloadPolicyCommitPushed\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tpolicy_id\\x18\\x03 \\x01(\\tR\\bpolicyId\\x12\\x1f\\n\" +\n\t\"\\vpolicy_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"policyName\\x12\\x1b\\n\" +\n\t\"\\to1_digest\\x18\\x05 \\x01(\\tR\\bo1Digest\\\"\\xba\\x01\\n\" +\n\t\"\\x14PayloadPluginCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1f\\n\" +\n\t\"\\vplugin_type\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"pluginType\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\xba\\x01\\n\" +\n\t\"\\x14PayloadPluginDeleted\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1f\\n\" +\n\t\"\\vplugin_type\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"pluginType\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\xbd\\x01\\n\" +\n\t\"\\x17PayloadPluginDeprecated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1f\\n\" +\n\t\"\\vplugin_type\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"pluginType\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\xbf\\x01\\n\" +\n\t\"\\x19PayloadPluginUndeprecated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1f\\n\" +\n\t\"\\vplugin_type\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"pluginType\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"\\x9b\\x02\\n\" +\n\t\"\\x1ePayloadPluginVisibilityChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1f\\n\" +\n\t\"\\vplugin_type\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"pluginType\\x12N\\n\" +\n\t\"\\x0eold_visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\roldVisibility\\x12N\\n\" +\n\t\"\\x0enew_visibility\\x18\\x05 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\rnewVisibility\\\"\\xb0\\x01\\n\" +\n\t\"\\x19PayloadPluginCommitPushed\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\x03 \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"pluginName\\x12\\x1b\\n\" +\n\t\"\\tp1_digest\\x18\\x05 \\x01(\\tR\\bp1Digest\\\"\\x14\\n\" +\n\t\"\\x12PayloadUserCreated\\\"\\x18\\n\" +\n\t\"\\x16PayloadUserReactivated\\\"\\x18\\n\" +\n\t\"\\x16PayloadUserDeactivated\\\"\\x14\\n\" +\n\t\"\\x12PayloadUserDeleted\\\"\\x15\\n\" +\n\t\"\\x13PayloadUserLoggedIn\\\"\\x16\\n\" +\n\t\"\\x14PayloadUserLoggedOut\\\"!\\n\" +\n\t\"\\x1fPayloadUserAutoMergedFromNewIdP\\\"W\\n\" +\n\t\"\\x1bPayloadCuratedPluginCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\\"W\\n\" +\n\t\"\\x1bPayloadCuratedPluginDeleted\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\\"|\\n\" +\n\t\"!PayloadCuratedPluginStatusUpdated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"new_status\\x18\\x03 \\x01(\\tR\\tnewStatus\\\"x\\n\" +\n\t\"\\x13PayloadTokenCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12F\\n\" +\n\t\"\\x11token_expiry_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x0ftokenExpiryTime\\\"0\\n\" +\n\t\"\\x13PayloadTokenDeleted\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\\"a\\n\" +\n\t\"\\x17PayloadSCIMTokenCreated\\x12F\\n\" +\n\t\"\\x11token_expiry_time\\x18\\x01 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x0ftokenExpiryTime\\\"\\x19\\n\" +\n\t\"\\x17PayloadSCIMTokenDeleted\\\"\\xcb\\x01\\n\" +\n\t\"\\x1ePayloadRepositoryCommitDeleted\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"draft_name\\x18\\x05 \\x01(\\tR\\tdraftName:\\x02\\x18\\x01\\\"\\xf1\\x01\\n\" +\n\t\"\\x1dPayloadRepositoryLabelCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12+\\n\" +\n\t\"\\x0flabel_namespace\\x18\\x05 \\x01(\\tB\\x02\\x18\\x01R\\x0elabelNamespace\\x12\\x1b\\n\" +\n\t\"\\tcommit_id\\x18\\x06 \\x01(\\tR\\bcommitId\\\"\\x9a\\x02\\n\" +\n\t\"\\x1bPayloadRepositoryLabelMoved\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12+\\n\" +\n\t\"\\x0flabel_namespace\\x18\\x05 \\x01(\\tB\\x02\\x18\\x01R\\x0elabelNamespace\\x12 \\n\" +\n\t\"\\fto_commit_id\\x18\\x06 \\x01(\\tR\\n\" +\n\t\"toCommitId\\x12$\\n\" +\n\t\"\\x0efrom_commit_id\\x18\\a \\x01(\\tR\\ffromCommitId\\\"\\xa8\\x01\\n\" +\n\t\"\\x1ePayloadRepositoryLabelArchived\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\\"\\xaa\\x01\\n\" +\n\t\" PayloadRepositoryLabelUnarchived\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\\"\\xc0\\x04\\n\" +\n\t\"/PayloadRepositoryLabelEnforcementIgnoresChanged\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12%\\n\" +\n\t\"\\x0eenforcement_id\\x18\\x05 \\x01(\\tR\\renforcementId\\x12\\x83\\x01\\n\" +\n\t\"\\x12old_ignore_entries\\x18\\x06 \\x03(\\v2U.buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged.IgnoreEntryR\\x10oldIgnoreEntries\\x12\\x83\\x01\\n\" +\n\t\"\\x12new_ignore_entries\\x18\\a \\x03(\\v2U.buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged.IgnoreEntryR\\x10newIgnoreEntries\\x1aR\\n\" +\n\t\"\\vIgnoreEntry\\x12-\\n\" +\n\t\"\\x13rule_or_category_id\\x18\\x01 \\x01(\\tR\\x10ruleOrCategoryId\\x12\\x14\\n\" +\n\t\"\\x05paths\\x18\\x02 \\x03(\\tR\\x05paths\\\"\\xd7\\x01\\n\" +\n\t\"(PayloadServerBreakingChangePolicyEnabled\\x12O\\n\" +\n\t\"\\bcategory\\x18\\x01 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.BreakingChangeCategoryR\\bcategory\\x12=\\n\" +\n\t\"\\x18ignore_unstable_packages\\x18\\x02 \\x01(\\bH\\x00R\\x16ignoreUnstablePackages\\x88\\x01\\x01B\\x1b\\n\" +\n\t\"\\x19_ignore_unstable_packages\\\"+\\n\" +\n\t\")PayloadServerBreakingChangePolicyDisabled\\\" \\n\" +\n\t\"\\x1ePayloadServerReviewFlowEnabled\\\"!\\n\" +\n\t\"\\x1fPayloadServerReviewFlowDisabled\\\"&\\n\" +\n\t\"$PayloadServerUniquenessPolicyEnabled\\\"'\\n\" +\n\t\"%PayloadServerUniquenessPolicyDisabled\\\"F\\n\" +\n\t\"'PayloadDeviceAuthorizationGrantApproved\\x12\\x1b\\n\" +\n\t\"\\tclient_id\\x18\\x01 \\x01(\\tR\\bclientId\\\"D\\n\" +\n\t\"%PayloadDeviceAuthorizationGrantDenied\\x12\\x1b\\n\" +\n\t\"\\tclient_id\\x18\\x01 \\x01(\\tR\\bclientId\\\"\\xb0\\x01\\n\" +\n\t\"\\x19PayloadPluginLabelCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\x03 \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"pluginName\\x12\\x1b\\n\" +\n\t\"\\tcommit_id\\x18\\x06 \\x01(\\tR\\bcommitId\\\"\\xd9\\x01\\n\" +\n\t\"\\x17PayloadPluginLabelMoved\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\x03 \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"pluginName\\x12 \\n\" +\n\t\"\\fto_commit_id\\x18\\x06 \\x01(\\tR\\n\" +\n\t\"toCommitId\\x12$\\n\" +\n\t\"\\x0efrom_commit_id\\x18\\a \\x01(\\tR\\ffromCommitId\\\"\\x94\\x01\\n\" +\n\t\"\\x1aPayloadPluginLabelArchived\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\x03 \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"pluginName\\\"\\x96\\x01\\n\" +\n\t\"\\x1cPayloadPluginLabelUnarchived\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\x03 \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"pluginName\\\"\\xb0\\x01\\n\" +\n\t\"\\x19PayloadPolicyLabelCreated\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tpolicy_id\\x18\\x03 \\x01(\\tR\\bpolicyId\\x12\\x1f\\n\" +\n\t\"\\vpolicy_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"policyName\\x12\\x1b\\n\" +\n\t\"\\tcommit_id\\x18\\x06 \\x01(\\tR\\bcommitId\\\"\\xd9\\x01\\n\" +\n\t\"\\x17PayloadPolicyLabelMoved\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tpolicy_id\\x18\\x03 \\x01(\\tR\\bpolicyId\\x12\\x1f\\n\" +\n\t\"\\vpolicy_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"policyName\\x12 \\n\" +\n\t\"\\fto_commit_id\\x18\\x06 \\x01(\\tR\\n\" +\n\t\"toCommitId\\x12$\\n\" +\n\t\"\\x0efrom_commit_id\\x18\\a \\x01(\\tR\\ffromCommitId\\\"\\x94\\x01\\n\" +\n\t\"\\x1aPayloadPolicyLabelArchived\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tpolicy_id\\x18\\x03 \\x01(\\tR\\bpolicyId\\x12\\x1f\\n\" +\n\t\"\\vpolicy_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"policyName\\\"\\x96\\x01\\n\" +\n\t\"\\x1cPayloadPolicyLabelUnarchived\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1b\\n\" +\n\t\"\\tpolicy_id\\x18\\x03 \\x01(\\tR\\bpolicyId\\x12\\x1f\\n\" +\n\t\"\\vpolicy_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"policyName\\\"\\xe7\\x02\\n\" +\n\t\"!PayloadSDKPluginConstraintCreated\\x12.\\n\" +\n\t\"\\x13repository_owner_id\\x18\\x01 \\x01(\\tR\\x11repositoryOwnerId\\x122\\n\" +\n\t\"\\x15repository_owner_name\\x18\\x02 \\x01(\\tR\\x13repositoryOwnerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12&\\n\" +\n\t\"\\x0fplugin_owner_id\\x18\\x05 \\x01(\\tR\\rpluginOwnerId\\x12*\\n\" +\n\t\"\\x11plugin_owner_name\\x18\\x06 \\x01(\\tR\\x0fpluginOwnerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\a \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\b \\x01(\\tR\\n\" +\n\t\"pluginName\\\"\\xe7\\x02\\n\" +\n\t\"!PayloadSDKPluginConstraintUpdated\\x12.\\n\" +\n\t\"\\x13repository_owner_id\\x18\\x01 \\x01(\\tR\\x11repositoryOwnerId\\x122\\n\" +\n\t\"\\x15repository_owner_name\\x18\\x02 \\x01(\\tR\\x13repositoryOwnerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12&\\n\" +\n\t\"\\x0fplugin_owner_id\\x18\\x05 \\x01(\\tR\\rpluginOwnerId\\x12*\\n\" +\n\t\"\\x11plugin_owner_name\\x18\\x06 \\x01(\\tR\\x0fpluginOwnerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\a \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\b \\x01(\\tR\\n\" +\n\t\"pluginName\\\"\\xe7\\x02\\n\" +\n\t\"!PayloadSDKPluginConstraintDeleted\\x12.\\n\" +\n\t\"\\x13repository_owner_id\\x18\\x01 \\x01(\\tR\\x11repositoryOwnerId\\x122\\n\" +\n\t\"\\x15repository_owner_name\\x18\\x02 \\x01(\\tR\\x13repositoryOwnerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryName\\x12&\\n\" +\n\t\"\\x0fplugin_owner_id\\x18\\x05 \\x01(\\tR\\rpluginOwnerId\\x12*\\n\" +\n\t\"\\x11plugin_owner_name\\x18\\x06 \\x01(\\tR\\x0fpluginOwnerName\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\a \\x01(\\tR\\bpluginId\\x12\\x1f\\n\" +\n\t\"\\vplugin_name\\x18\\b \\x01(\\tR\\n\" +\n\t\"pluginName\\\"\\xbd\\x05\\n\" +\n\t\"\\x16PolicyEnforcementScope\\x12m\\n\" +\n\t\"\\binstance\\x18\\x01 \\x01(\\v2O.buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeInstanceH\\x00R\\binstance\\x12d\\n\" +\n\t\"\\x05owner\\x18\\x02 \\x01(\\v2L.buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeOwnerH\\x00R\\x05owner\\x12s\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x03 \\x01(\\v2Q.buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeRepositoryH\\x00R\\n\" +\n\t\"repository\\x1a \\n\" +\n\t\"\\x1ePolicyEnforcementScopeInstance\\x1aW\\n\" +\n\t\"\\x1bPolicyEnforcementScopeOwner\\x12\\x19\\n\" +\n\t\"\\bowner_id\\x18\\x01 \\x01(\\tR\\aownerId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x1a\\xd4\\x01\\n\" +\n\t\" PolicyEnforcementScopeRepository\\x12.\\n\" +\n\t\"\\x13repository_owner_id\\x18\\x01 \\x01(\\tR\\x11repositoryOwnerId\\x122\\n\" +\n\t\"\\x15repository_owner_name\\x18\\x02 \\x01(\\tR\\x13repositoryOwnerName\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x03 \\x01(\\tR\\frepositoryId\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x04 \\x01(\\tR\\x0erepositoryNameB\\a\\n\" +\n\t\"\\x05scope\\\"\\xce\\x01\\n\" +\n\t\"\\x1fPayloadPolicyEnforcementCreated\\x12F\\n\" +\n\t\"\\x05scope\\x18\\x01 \\x01(\\v20.buf.alpha.audit.v1alpha1.PolicyEnforcementScopeR\\x05scope\\x12\\x1b\\n\" +\n\t\"\\tpolicy_id\\x18\\x02 \\x01(\\tR\\bpolicyId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"policy_ref\\x18\\x03 \\x01(\\tR\\tpolicyRef\\x12'\\n\" +\n\t\"\\x0finclude_targets\\x18\\x04 \\x03(\\tR\\x0eincludeTargets\\\"\\xce\\x01\\n\" +\n\t\"\\x1fPayloadPolicyEnforcementDeleted\\x12F\\n\" +\n\t\"\\x05scope\\x18\\x01 \\x01(\\v20.buf.alpha.audit.v1alpha1.PolicyEnforcementScopeR\\x05scope\\x12\\x1b\\n\" +\n\t\"\\tpolicy_id\\x18\\x02 \\x01(\\tR\\bpolicyId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"policy_ref\\x18\\x03 \\x01(\\tR\\tpolicyRef\\x12'\\n\" +\n\t\"\\x0finclude_targets\\x18\\x04 \\x03(\\tR\\x0eincludeTargets\\\"\\x83\\x02\\n\" +\n\t\"%PayloadPolicyEnforcementPolicyChanged\\x12F\\n\" +\n\t\"\\x05scope\\x18\\x01 \\x01(\\v20.buf.alpha.audit.v1alpha1.PolicyEnforcementScopeR\\x05scope\\x12\\\"\\n\" +\n\t\"\\rold_policy_id\\x18\\x02 \\x01(\\tR\\voldPolicyId\\x12\\\"\\n\" +\n\t\"\\rnew_policy_id\\x18\\x03 \\x01(\\tR\\vnewPolicyId\\x12$\\n\" +\n\t\"\\x0eold_policy_ref\\x18\\x04 \\x01(\\tR\\foldPolicyRef\\x12$\\n\" +\n\t\"\\x0enew_policy_ref\\x18\\x05 \\x01(\\tR\\fnewPolicyRef\\\"\\xd0\\x01\\n\" +\n\t\"&PayloadPolicyEnforcementTargetsChanged\\x12F\\n\" +\n\t\"\\x05scope\\x18\\x01 \\x01(\\v20.buf.alpha.audit.v1alpha1.PolicyEnforcementScopeR\\x05scope\\x12.\\n\" +\n\t\"\\x13old_include_targets\\x18\\x02 \\x03(\\tR\\x11oldIncludeTargets\\x12.\\n\" +\n\t\"\\x13new_include_targets\\x18\\x03 \\x03(\\tR\\x11newIncludeTargets\\\"\\xec\\x01\\n\" +\n\t\"\\x19ResourceVisibilityControl\\x12^\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x01 \\x01(\\x0e2>.buf.alpha.audit.v1alpha1.ResourceVisibilityControl.VisibilityR\\n\" +\n\t\"visibility\\x12\\x16\\n\" +\n\t\"\\x06strict\\x18\\x02 \\x01(\\bR\\x06strict\\\"W\\n\" +\n\t\"\\n\" +\n\t\"Visibility\\x12\\x1a\\n\" +\n\t\"\\x16VISIBILITY_UNSPECIFIED\\x10\\x00\\x12\\x15\\n\" +\n\t\"\\x11VISIBILITY_PUBLIC\\x10\\x01\\x12\\x16\\n\" +\n\t\"\\x12VISIBILITY_PRIVATE\\x10\\x02\\\"\\x92\\x03\\n\" +\n\t\"-PayloadServerResourceVisibilityControlChanged\\x12K\\n\" +\n\t\"\\rresource_type\\x18\\x01 \\x01(\\x0e2&.buf.alpha.audit.v1alpha1.ResourceTypeR\\fresourceType\\x12n\\n\" +\n\t\"\\x16old_visibility_control\\x18\\x02 \\x01(\\v23.buf.alpha.audit.v1alpha1.ResourceVisibilityControlH\\x00R\\x14oldVisibilityControl\\x88\\x01\\x01\\x12n\\n\" +\n\t\"\\x16new_visibility_control\\x18\\x03 \\x01(\\v23.buf.alpha.audit.v1alpha1.ResourceVisibilityControlH\\x01R\\x14newVisibilityControl\\x88\\x01\\x01B\\x19\\n\" +\n\t\"\\x17_old_visibility_controlB\\x19\\n\" +\n\t\"\\x17_new_visibility_control\\\"\\x98\\x03\\n\" +\n\t\"3PayloadOrganizationResourceVisibilityControlChanged\\x12K\\n\" +\n\t\"\\rresource_type\\x18\\x01 \\x01(\\x0e2&.buf.alpha.audit.v1alpha1.ResourceTypeR\\fresourceType\\x12n\\n\" +\n\t\"\\x16old_visibility_control\\x18\\x02 \\x01(\\v23.buf.alpha.audit.v1alpha1.ResourceVisibilityControlH\\x00R\\x14oldVisibilityControl\\x88\\x01\\x01\\x12n\\n\" +\n\t\"\\x16new_visibility_control\\x18\\x03 \\x01(\\v23.buf.alpha.audit.v1alpha1.ResourceVisibilityControlH\\x01R\\x14newVisibilityControl\\x88\\x01\\x01B\\x19\\n\" +\n\t\"\\x17_old_visibility_controlB\\x19\\n\" +\n\t\"\\x17_new_visibility_control\\\",\\n\" +\n\t\"*PayloadOrganizationUniquenessPolicyEnabled\\\"-\\n\" +\n\t\"+PayloadOrganizationUniquenessPolicyDisabled*S\\n\" +\n\t\"\\tActorType\\x12\\x1a\\n\" +\n\t\"\\x16ACTOR_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x13\\n\" +\n\t\"\\x0fACTOR_TYPE_USER\\x10\\x01\\x12\\x15\\n\" +\n\t\"\\x11ACTOR_TYPE_SYSTEM\\x10\\x02*\\x95\\x06\\n\" +\n\t\"\\fResourceType\\x12\\x1d\\n\" +\n\t\"\\x19RESOURCE_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x16\\n\" +\n\t\"\\x12RESOURCE_TYPE_USER\\x10\\x01\\x12\\x1e\\n\" +\n\t\"\\x1aRESOURCE_TYPE_ORGANIZATION\\x10\\x02\\x12%\\n\" +\n\t\"!RESOURCE_TYPE_ORGANIZATION_MEMBER\\x10\\x03\\x12(\\n\" +\n\t\"$RESOURCE_TYPE_ORGANIZATION_IDP_GROUP\\x10\\t\\x12\\x1c\\n\" +\n\t\"\\x18RESOURCE_TYPE_REPOSITORY\\x10\\x04\\x12(\\n\" +\n\t\"$RESOURCE_TYPE_REPOSITORY_CONTRIBUTOR\\x10\\x05\\x12#\\n\" +\n\t\"\\x1fRESOURCE_TYPE_REPOSITORY_COMMIT\\x10\\x06\\x12&\\n\" +\n\t\"\\\"RESOURCE_TYPE_REPOSITORY_IDP_GROUP\\x10\\x12\\x12\\x18\\n\" +\n\t\"\\x14RESOURCE_TYPE_POLICY\\x10\\x11\\x12\\x1f\\n\" +\n\t\"\\x1bRESOURCE_TYPE_POLICY_COMMIT\\x10\\x13\\x12\\x1e\\n\" +\n\t\"\\x1aRESOURCE_TYPE_POLICY_LABEL\\x10\\x14\\x12$\\n\" +\n\t\" RESOURCE_TYPE_POLICY_ENFORCEMENT\\x10\\x16\\x12\\x18\\n\" +\n\t\"\\x14RESOURCE_TYPE_PLUGIN\\x10\\a\\x12\\x1f\\n\" +\n\t\"\\x1bRESOURCE_TYPE_PLUGIN_COMMIT\\x10\\x0f\\x12 \\n\" +\n\t\"\\x1cRESOURCE_TYPE_CURATED_PLUGIN\\x10\\b\\x12\\x17\\n\" +\n\t\"\\x13RESOURCE_TYPE_TOKEN\\x10\\n\" +\n\t\"\\x12\\x1c\\n\" +\n\t\"\\x18RESOURCE_TYPE_SCIM_TOKEN\\x10\\v\\x12\\\"\\n\" +\n\t\"\\x1eRESOURCE_TYPE_REPOSITORY_LABEL\\x10\\f\\x12\\x18\\n\" +\n\t\"\\x14RESOURCE_TYPE_SERVER\\x10\\r\\x12,\\n\" +\n\t\"(RESOURCE_TYPE_DEVICE_AUTHORIZATION_GRANT\\x10\\x0e\\x12\\x1e\\n\" +\n\t\"\\x1aRESOURCE_TYPE_PLUGIN_LABEL\\x10\\x10\\x12'\\n\" +\n\t\"#RESOURCE_TYPE_SDK_PLUGIN_CONSTRAINT\\x10\\x15*\\xe1\\x1b\\n\" +\n\t\"\\tEventType\\x12\\x1a\\n\" +\n\t\"\\x16EVENT_TYPE_UNSPECIFIED\\x10\\x00\\x12#\\n\" +\n\t\"\\x1fEVENT_TYPE_ORGANIZATION_CREATED\\x10\\x01\\x12#\\n\" +\n\t\"\\x1fEVENT_TYPE_ORGANIZATION_DELETED\\x10\\x02\\x12(\\n\" +\n\t\"$EVENT_TYPE_ORGANIZATION_MEMBER_ADDED\\x10\\x03\\x123\\n\" +\n\t\"+EVENT_TYPE_ORGANIZATION_MEMBER_ROLE_CHANGED\\x10\\x04\\x1a\\x02\\b\\x01\\x120\\n\" +\n\t\",EVENT_TYPE_ORGANIZATION_MEMBER_ROLES_CHANGED\\x102\\x12*\\n\" +\n\t\"&EVENT_TYPE_ORGANIZATION_MEMBER_REMOVED\\x10\\x05\\x12+\\n\" +\n\t\"'EVENT_TYPE_ORGANIZATION_IDP_GROUP_ADDED\\x10\\x15\\x12-\\n\" +\n\t\")EVENT_TYPE_ORGANIZATION_IDP_GROUP_UPDATED\\x10;\\x12-\\n\" +\n\t\")EVENT_TYPE_ORGANIZATION_IDP_GROUP_REMOVED\\x10\\x16\\x12?\\n\" +\n\t\";EVENT_TYPE_ORGANIZATION_RESOURCE_VISIBILITY_CONTROL_CHANGED\\x10Q\\x125\\n\" +\n\t\"1EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_ENABLED\\x10R\\x126\\n\" +\n\t\"2EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_DISABLED\\x10S\\x12!\\n\" +\n\t\"\\x1dEVENT_TYPE_REPOSITORY_CREATED\\x10\\x06\\x12$\\n\" +\n\t\" EVENT_TYPE_REPOSITORY_DEPRECATED\\x100\\x12&\\n\" +\n\t\"\\\"EVENT_TYPE_REPOSITORY_UNDEPRECATED\\x101\\x12!\\n\" +\n\t\"\\x1dEVENT_TYPE_REPOSITORY_DELETED\\x10\\a\\x12'\\n\" +\n\t\"#EVENT_TYPE_REPOSITORY_COMMIT_PUSHED\\x10\\b\\x12+\\n\" +\n\t\"'EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ADDED\\x10\\t\\x122\\n\" +\n\t\".EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLE_CHANGED\\x10\\n\" +\n\t\"\\x123\\n\" +\n\t\"/EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLES_CHANGED\\x10?\\x12-\\n\" +\n\t\")EVENT_TYPE_REPOSITORY_CONTRIBUTOR_REMOVED\\x10\\v\\x12,\\n\" +\n\t\"(EVENT_TYPE_REPOSITORY_VISIBILITY_CHANGED\\x10\\f\\x124\\n\" +\n\t\"0EVENT_TYPE_REPOSITORY_DEFAULT_LABEL_NAME_CHANGED\\x10(\\x12)\\n\" +\n\t\"%EVENT_TYPE_REPOSITORY_IDP_GROUP_ADDED\\x10<\\x12+\\n\" +\n\t\"'EVENT_TYPE_REPOSITORY_IDP_GROUP_UPDATED\\x10=\\x12+\\n\" +\n\t\"'EVENT_TYPE_REPOSITORY_IDP_GROUP_REMOVED\\x10>\\x12\\x1d\\n\" +\n\t\"\\x19EVENT_TYPE_POLICY_CREATED\\x106\\x12\\x1d\\n\" +\n\t\"\\x19EVENT_TYPE_POLICY_DELETED\\x107\\x12 \\n\" +\n\t\"\\x1cEVENT_TYPE_POLICY_DEPRECATED\\x108\\x12\\\"\\n\" +\n\t\"\\x1eEVENT_TYPE_POLICY_UNDEPRECATED\\x109\\x12(\\n\" +\n\t\"$EVENT_TYPE_POLICY_VISIBILITY_CHANGED\\x10:\\x12#\\n\" +\n\t\"\\x1fEVENT_TYPE_POLICY_COMMIT_PUSHED\\x10@\\x12#\\n\" +\n\t\"\\x1fEVENT_TYPE_POLICY_LABEL_CREATED\\x10A\\x12!\\n\" +\n\t\"\\x1dEVENT_TYPE_POLICY_LABEL_MOVED\\x10B\\x12$\\n\" +\n\t\" EVENT_TYPE_POLICY_LABEL_ARCHIVED\\x10C\\x12&\\n\" +\n\t\"\\\"EVENT_TYPE_POLICY_LABEL_UNARCHIVED\\x10D\\x12\\x1d\\n\" +\n\t\"\\x19EVENT_TYPE_PLUGIN_CREATED\\x10\\r\\x12\\x1d\\n\" +\n\t\"\\x19EVENT_TYPE_PLUGIN_DELETED\\x10\\x0e\\x12 \\n\" +\n\t\"\\x1cEVENT_TYPE_PLUGIN_DEPRECATED\\x103\\x12\\\"\\n\" +\n\t\"\\x1eEVENT_TYPE_PLUGIN_UNDEPRECATED\\x104\\x12(\\n\" +\n\t\"$EVENT_TYPE_PLUGIN_VISIBILITY_CHANGED\\x105\\x12#\\n\" +\n\t\"\\x1fEVENT_TYPE_PLUGIN_COMMIT_PUSHED\\x10+\\x12%\\n\" +\n\t\"!EVENT_TYPE_CURATED_PLUGIN_CREATED\\x10\\x14\\x12%\\n\" +\n\t\"!EVENT_TYPE_CURATED_PLUGIN_DELETED\\x10\\x1f\\x12,\\n\" +\n\t\"(EVENT_TYPE_CURATED_PLUGIN_STATUS_UPDATED\\x10N\\x12\\x1b\\n\" +\n\t\"\\x17EVENT_TYPE_USER_CREATED\\x10\\x0f\\x12\\x1b\\n\" +\n\t\"\\x17EVENT_TYPE_USER_DELETED\\x10\\x10\\x12\\x1f\\n\" +\n\t\"\\x1bEVENT_TYPE_USER_DEACTIVATED\\x10\\x11\\x12\\x1d\\n\" +\n\t\"\\x19EVENT_TYPE_USER_LOGGED_IN\\x10\\x12\\x12\\x1e\\n\" +\n\t\"\\x1aEVENT_TYPE_USER_LOGGED_OUT\\x10\\x13\\x12\\x1c\\n\" +\n\t\"\\x18EVENT_TYPE_TOKEN_CREATED\\x10\\x17\\x12\\x1c\\n\" +\n\t\"\\x18EVENT_TYPE_TOKEN_DELETED\\x10\\x18\\x12\\x1f\\n\" +\n\t\"\\x1bEVENT_TYPE_USER_REACTIVATED\\x10\\x19\\x12!\\n\" +\n\t\"\\x1dEVENT_TYPE_SCIM_TOKEN_CREATED\\x10\\x1a\\x12!\\n\" +\n\t\"\\x1dEVENT_TYPE_SCIM_TOKEN_DELETED\\x10\\x1b\\x12,\\n\" +\n\t\"$EVENT_TYPE_REPOSITORY_COMMIT_DELETED\\x10\\x1c\\x1a\\x02\\b\\x01\\x12'\\n\" +\n\t\"#EVENT_TYPE_REPOSITORY_LABEL_CREATED\\x10\\x1d\\x12%\\n\" +\n\t\"!EVENT_TYPE_REPOSITORY_LABEL_MOVED\\x10\\x1e\\x12(\\n\" +\n\t\"$EVENT_TYPE_REPOSITORY_LABEL_ARCHIVED\\x10&\\x12*\\n\" +\n\t\"&EVENT_TYPE_REPOSITORY_LABEL_UNARCHIVED\\x10'\\x12;\\n\" +\n\t\"7EVENT_TYPE_REPOSITORY_LABEL_ENFORCEMENT_IGNORES_CHANGED\\x10O\\x124\\n\" +\n\t\"0EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_ENABLED\\x10 \\x125\\n\" +\n\t\"1EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_DISABLED\\x10!\\x124\\n\" +\n\t\",EVENT_TYPE_REPOSITORY_DEFAULT_BRANCH_CHANGED\\x10\\\"\\x1a\\x02\\b\\x01\\x12/\\n\" +\n\t\"+EVENT_TYPE_SERVER_UNIQUENESS_POLICY_ENABLED\\x10#\\x120\\n\" +\n\t\",EVENT_TYPE_SERVER_UNIQUENESS_POLICY_DISABLED\\x10$\\x129\\n\" +\n\t\"5EVENT_TYPE_SERVER_RESOURCE_VISIBILITY_CONTROL_CHANGED\\x10P\\x12,\\n\" +\n\t\"(EVENT_TYPE_USER_AUTO_MERGED_FROM_NEW_IDP\\x10%\\x122\\n\" +\n\t\".EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_APPROVED\\x10)\\x120\\n\" +\n\t\",EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_DENIED\\x10*\\x12#\\n\" +\n\t\"\\x1fEVENT_TYPE_PLUGIN_LABEL_CREATED\\x10,\\x12!\\n\" +\n\t\"\\x1dEVENT_TYPE_PLUGIN_LABEL_MOVED\\x10-\\x12$\\n\" +\n\t\" EVENT_TYPE_PLUGIN_LABEL_ARCHIVED\\x10.\\x12&\\n\" +\n\t\"\\\"EVENT_TYPE_PLUGIN_LABEL_UNARCHIVED\\x10/\\x12)\\n\" +\n\t\"%EVENT_TYPE_SERVER_REVIEW_FLOW_ENABLED\\x10E\\x12*\\n\" +\n\t\"&EVENT_TYPE_SERVER_REVIEW_FLOW_DISABLED\\x10F\\x12,\\n\" +\n\t\"(EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_CREATED\\x10G\\x12,\\n\" +\n\t\"(EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_UPDATED\\x10H\\x12,\\n\" +\n\t\"(EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_DELETED\\x10I\\x12)\\n\" +\n\t\"%EVENT_TYPE_POLICY_ENFORCEMENT_CREATED\\x10J\\x12)\\n\" +\n\t\"%EVENT_TYPE_POLICY_ENFORCEMENT_DELETED\\x10K\\x120\\n\" +\n\t\",EVENT_TYPE_POLICY_ENFORCEMENT_POLICY_CHANGED\\x10L\\x121\\n\" +\n\t\"-EVENT_TYPE_POLICY_ENFORCEMENT_TARGETS_CHANGED\\x10MB\\x82\\x02\\n\" +\n\t\"\\x1ccom.buf.alpha.audit.v1alpha1B\\n\" +\n\t\"EventProtoP\\x01ZSgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/audit/v1alpha1;auditv1alpha1\\xa2\\x02\\x03BAA\\xaa\\x02\\x18Buf.Alpha.Audit.V1alpha1\\xca\\x02\\x18Buf\\\\Alpha\\\\Audit\\\\V1alpha1\\xe2\\x02$Buf\\\\Alpha\\\\Audit\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1bBuf::Alpha::Audit::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_audit_v1alpha1_event_proto_enumTypes = make([]protoimpl.EnumInfo, 4)\nvar file_buf_alpha_audit_v1alpha1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 95)\nvar file_buf_alpha_audit_v1alpha1_event_proto_goTypes = []any{\n\t(ActorType)(0),    // 0: buf.alpha.audit.v1alpha1.ActorType\n\t(ResourceType)(0), // 1: buf.alpha.audit.v1alpha1.ResourceType\n\t(EventType)(0),    // 2: buf.alpha.audit.v1alpha1.EventType\n\t(ResourceVisibilityControl_Visibility)(0), // 3: buf.alpha.audit.v1alpha1.ResourceVisibilityControl.Visibility\n\t(*Actor)(nil),                                                       // 4: buf.alpha.audit.v1alpha1.Actor\n\t(*Resource)(nil),                                                    // 5: buf.alpha.audit.v1alpha1.Resource\n\t(*EventMetadata)(nil),                                               // 6: buf.alpha.audit.v1alpha1.EventMetadata\n\t(*Event)(nil),                                                       // 7: buf.alpha.audit.v1alpha1.Event\n\t(*PayloadOrganizationCreated)(nil),                                  // 8: buf.alpha.audit.v1alpha1.PayloadOrganizationCreated\n\t(*PayloadOrganizationDeleted)(nil),                                  // 9: buf.alpha.audit.v1alpha1.PayloadOrganizationDeleted\n\t(*PayloadOrganizationMemberAdded)(nil),                              // 10: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberAdded\n\t(*PayloadOrganizationMemberRoleChanged)(nil),                        // 11: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRoleChanged\n\t(*PayloadOrganizationMemberRolesChanged)(nil),                       // 12: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged\n\t(*PayloadOrganizationMemberRemoved)(nil),                            // 13: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRemoved\n\t(*PayloadOrganizationIDPGroupAdded)(nil),                            // 14: buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupAdded\n\t(*PayloadOrganizationIDPGroupUpdated)(nil),                          // 15: buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupUpdated\n\t(*PayloadOrganizationIDPGroupRemoved)(nil),                          // 16: buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupRemoved\n\t(*PayloadRepositoryCreated)(nil),                                    // 17: buf.alpha.audit.v1alpha1.PayloadRepositoryCreated\n\t(*PayloadRepositoryDeleted)(nil),                                    // 18: buf.alpha.audit.v1alpha1.PayloadRepositoryDeleted\n\t(*PayloadRepositoryDeprecated)(nil),                                 // 19: buf.alpha.audit.v1alpha1.PayloadRepositoryDeprecated\n\t(*PayloadRepositoryUndeprecated)(nil),                               // 20: buf.alpha.audit.v1alpha1.PayloadRepositoryUndeprecated\n\t(*PayloadRepositoryCommitPushed)(nil),                               // 21: buf.alpha.audit.v1alpha1.PayloadRepositoryCommitPushed\n\t(*PayloadRepositoryContributorAdded)(nil),                           // 22: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorAdded\n\t(*PayloadRepositoryContributorRoleChanged)(nil),                     // 23: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRoleChanged\n\t(*PayloadRepositoryContributorRolesChanged)(nil),                    // 24: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged\n\t(*PayloadRepositoryContributorRemoved)(nil),                         // 25: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRemoved\n\t(*PayloadRepositoryVisibilityChanged)(nil),                          // 26: buf.alpha.audit.v1alpha1.PayloadRepositoryVisibilityChanged\n\t(*PayloadRepositoryDefaultLabelNameChanged)(nil),                    // 27: buf.alpha.audit.v1alpha1.PayloadRepositoryDefaultLabelNameChanged\n\t(*PayloadRepositoryDefaultBranchChanged)(nil),                       // 28: buf.alpha.audit.v1alpha1.PayloadRepositoryDefaultBranchChanged\n\t(*PayloadRepositoryIDPGroupAdded)(nil),                              // 29: buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupAdded\n\t(*PayloadRepositoryIDPGroupUpdated)(nil),                            // 30: buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupUpdated\n\t(*PayloadRepositoryIDPGroupRemoved)(nil),                            // 31: buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupRemoved\n\t(*PayloadPolicyCreated)(nil),                                        // 32: buf.alpha.audit.v1alpha1.PayloadPolicyCreated\n\t(*PayloadPolicyDeleted)(nil),                                        // 33: buf.alpha.audit.v1alpha1.PayloadPolicyDeleted\n\t(*PayloadPolicyDeprecated)(nil),                                     // 34: buf.alpha.audit.v1alpha1.PayloadPolicyDeprecated\n\t(*PayloadPolicyUndeprecated)(nil),                                   // 35: buf.alpha.audit.v1alpha1.PayloadPolicyUndeprecated\n\t(*PayloadPolicyVisibilityChanged)(nil),                              // 36: buf.alpha.audit.v1alpha1.PayloadPolicyVisibilityChanged\n\t(*PayloadPolicyCommitPushed)(nil),                                   // 37: buf.alpha.audit.v1alpha1.PayloadPolicyCommitPushed\n\t(*PayloadPluginCreated)(nil),                                        // 38: buf.alpha.audit.v1alpha1.PayloadPluginCreated\n\t(*PayloadPluginDeleted)(nil),                                        // 39: buf.alpha.audit.v1alpha1.PayloadPluginDeleted\n\t(*PayloadPluginDeprecated)(nil),                                     // 40: buf.alpha.audit.v1alpha1.PayloadPluginDeprecated\n\t(*PayloadPluginUndeprecated)(nil),                                   // 41: buf.alpha.audit.v1alpha1.PayloadPluginUndeprecated\n\t(*PayloadPluginVisibilityChanged)(nil),                              // 42: buf.alpha.audit.v1alpha1.PayloadPluginVisibilityChanged\n\t(*PayloadPluginCommitPushed)(nil),                                   // 43: buf.alpha.audit.v1alpha1.PayloadPluginCommitPushed\n\t(*PayloadUserCreated)(nil),                                          // 44: buf.alpha.audit.v1alpha1.PayloadUserCreated\n\t(*PayloadUserReactivated)(nil),                                      // 45: buf.alpha.audit.v1alpha1.PayloadUserReactivated\n\t(*PayloadUserDeactivated)(nil),                                      // 46: buf.alpha.audit.v1alpha1.PayloadUserDeactivated\n\t(*PayloadUserDeleted)(nil),                                          // 47: buf.alpha.audit.v1alpha1.PayloadUserDeleted\n\t(*PayloadUserLoggedIn)(nil),                                         // 48: buf.alpha.audit.v1alpha1.PayloadUserLoggedIn\n\t(*PayloadUserLoggedOut)(nil),                                        // 49: buf.alpha.audit.v1alpha1.PayloadUserLoggedOut\n\t(*PayloadUserAutoMergedFromNewIdP)(nil),                             // 50: buf.alpha.audit.v1alpha1.PayloadUserAutoMergedFromNewIdP\n\t(*PayloadCuratedPluginCreated)(nil),                                 // 51: buf.alpha.audit.v1alpha1.PayloadCuratedPluginCreated\n\t(*PayloadCuratedPluginDeleted)(nil),                                 // 52: buf.alpha.audit.v1alpha1.PayloadCuratedPluginDeleted\n\t(*PayloadCuratedPluginStatusUpdated)(nil),                           // 53: buf.alpha.audit.v1alpha1.PayloadCuratedPluginStatusUpdated\n\t(*PayloadTokenCreated)(nil),                                         // 54: buf.alpha.audit.v1alpha1.PayloadTokenCreated\n\t(*PayloadTokenDeleted)(nil),                                         // 55: buf.alpha.audit.v1alpha1.PayloadTokenDeleted\n\t(*PayloadSCIMTokenCreated)(nil),                                     // 56: buf.alpha.audit.v1alpha1.PayloadSCIMTokenCreated\n\t(*PayloadSCIMTokenDeleted)(nil),                                     // 57: buf.alpha.audit.v1alpha1.PayloadSCIMTokenDeleted\n\t(*PayloadRepositoryCommitDeleted)(nil),                              // 58: buf.alpha.audit.v1alpha1.PayloadRepositoryCommitDeleted\n\t(*PayloadRepositoryLabelCreated)(nil),                               // 59: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelCreated\n\t(*PayloadRepositoryLabelMoved)(nil),                                 // 60: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelMoved\n\t(*PayloadRepositoryLabelArchived)(nil),                              // 61: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelArchived\n\t(*PayloadRepositoryLabelUnarchived)(nil),                            // 62: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelUnarchived\n\t(*PayloadRepositoryLabelEnforcementIgnoresChanged)(nil),             // 63: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged\n\t(*PayloadServerBreakingChangePolicyEnabled)(nil),                    // 64: buf.alpha.audit.v1alpha1.PayloadServerBreakingChangePolicyEnabled\n\t(*PayloadServerBreakingChangePolicyDisabled)(nil),                   // 65: buf.alpha.audit.v1alpha1.PayloadServerBreakingChangePolicyDisabled\n\t(*PayloadServerReviewFlowEnabled)(nil),                              // 66: buf.alpha.audit.v1alpha1.PayloadServerReviewFlowEnabled\n\t(*PayloadServerReviewFlowDisabled)(nil),                             // 67: buf.alpha.audit.v1alpha1.PayloadServerReviewFlowDisabled\n\t(*PayloadServerUniquenessPolicyEnabled)(nil),                        // 68: buf.alpha.audit.v1alpha1.PayloadServerUniquenessPolicyEnabled\n\t(*PayloadServerUniquenessPolicyDisabled)(nil),                       // 69: buf.alpha.audit.v1alpha1.PayloadServerUniquenessPolicyDisabled\n\t(*PayloadDeviceAuthorizationGrantApproved)(nil),                     // 70: buf.alpha.audit.v1alpha1.PayloadDeviceAuthorizationGrantApproved\n\t(*PayloadDeviceAuthorizationGrantDenied)(nil),                       // 71: buf.alpha.audit.v1alpha1.PayloadDeviceAuthorizationGrantDenied\n\t(*PayloadPluginLabelCreated)(nil),                                   // 72: buf.alpha.audit.v1alpha1.PayloadPluginLabelCreated\n\t(*PayloadPluginLabelMoved)(nil),                                     // 73: buf.alpha.audit.v1alpha1.PayloadPluginLabelMoved\n\t(*PayloadPluginLabelArchived)(nil),                                  // 74: buf.alpha.audit.v1alpha1.PayloadPluginLabelArchived\n\t(*PayloadPluginLabelUnarchived)(nil),                                // 75: buf.alpha.audit.v1alpha1.PayloadPluginLabelUnarchived\n\t(*PayloadPolicyLabelCreated)(nil),                                   // 76: buf.alpha.audit.v1alpha1.PayloadPolicyLabelCreated\n\t(*PayloadPolicyLabelMoved)(nil),                                     // 77: buf.alpha.audit.v1alpha1.PayloadPolicyLabelMoved\n\t(*PayloadPolicyLabelArchived)(nil),                                  // 78: buf.alpha.audit.v1alpha1.PayloadPolicyLabelArchived\n\t(*PayloadPolicyLabelUnarchived)(nil),                                // 79: buf.alpha.audit.v1alpha1.PayloadPolicyLabelUnarchived\n\t(*PayloadSDKPluginConstraintCreated)(nil),                           // 80: buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintCreated\n\t(*PayloadSDKPluginConstraintUpdated)(nil),                           // 81: buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintUpdated\n\t(*PayloadSDKPluginConstraintDeleted)(nil),                           // 82: buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintDeleted\n\t(*PolicyEnforcementScope)(nil),                                      // 83: buf.alpha.audit.v1alpha1.PolicyEnforcementScope\n\t(*PayloadPolicyEnforcementCreated)(nil),                             // 84: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementCreated\n\t(*PayloadPolicyEnforcementDeleted)(nil),                             // 85: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementDeleted\n\t(*PayloadPolicyEnforcementPolicyChanged)(nil),                       // 86: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementPolicyChanged\n\t(*PayloadPolicyEnforcementTargetsChanged)(nil),                      // 87: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementTargetsChanged\n\t(*ResourceVisibilityControl)(nil),                                   // 88: buf.alpha.audit.v1alpha1.ResourceVisibilityControl\n\t(*PayloadServerResourceVisibilityControlChanged)(nil),               // 89: buf.alpha.audit.v1alpha1.PayloadServerResourceVisibilityControlChanged\n\t(*PayloadOrganizationResourceVisibilityControlChanged)(nil),         // 90: buf.alpha.audit.v1alpha1.PayloadOrganizationResourceVisibilityControlChanged\n\t(*PayloadOrganizationUniquenessPolicyEnabled)(nil),                  // 91: buf.alpha.audit.v1alpha1.PayloadOrganizationUniquenessPolicyEnabled\n\t(*PayloadOrganizationUniquenessPolicyDisabled)(nil),                 // 92: buf.alpha.audit.v1alpha1.PayloadOrganizationUniquenessPolicyDisabled\n\t(*PayloadOrganizationMemberRolesChanged_OrganizationRole)(nil),      // 93: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.OrganizationRole\n\t(*PayloadRepositoryContributorRolesChanged_RepositoryRole)(nil),     // 94: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.RepositoryRole\n\t(*PayloadRepositoryLabelEnforcementIgnoresChanged_IgnoreEntry)(nil), // 95: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged.IgnoreEntry\n\t(*PolicyEnforcementScope_PolicyEnforcementScopeInstance)(nil),       // 96: buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeInstance\n\t(*PolicyEnforcementScope_PolicyEnforcementScopeOwner)(nil),          // 97: buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeOwner\n\t(*PolicyEnforcementScope_PolicyEnforcementScopeRepository)(nil),     // 98: buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeRepository\n\t(*timestamppb.Timestamp)(nil),                                       // 99: google.protobuf.Timestamp\n\t(v1alpha1.OrganizationRole)(0),                                      // 100: buf.alpha.registry.v1alpha1.OrganizationRole\n\t(v1alpha1.OrganizationRoleSource)(0),                                // 101: buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t(v1alpha1.Visibility)(0),                                            // 102: buf.alpha.registry.v1alpha1.Visibility\n\t(v1alpha1.RepositoryRole)(0),                                        // 103: buf.alpha.registry.v1alpha1.RepositoryRole\n\t(v1alpha1.BreakingChangeCategory)(0),                                // 104: buf.alpha.registry.v1alpha1.BreakingChangeCategory\n\t(v1alpha1.RepositoryRoleSource)(0),                                  // 105: buf.alpha.registry.v1alpha1.RepositoryRoleSource\n}\nvar file_buf_alpha_audit_v1alpha1_event_proto_depIdxs = []int32{\n\t0,   // 0: buf.alpha.audit.v1alpha1.Actor.type:type_name -> buf.alpha.audit.v1alpha1.ActorType\n\t1,   // 1: buf.alpha.audit.v1alpha1.Resource.type:type_name -> buf.alpha.audit.v1alpha1.ResourceType\n\t2,   // 2: buf.alpha.audit.v1alpha1.Event.type:type_name -> buf.alpha.audit.v1alpha1.EventType\n\t4,   // 3: buf.alpha.audit.v1alpha1.Event.actor:type_name -> buf.alpha.audit.v1alpha1.Actor\n\t5,   // 4: buf.alpha.audit.v1alpha1.Event.resource:type_name -> buf.alpha.audit.v1alpha1.Resource\n\t99,  // 5: buf.alpha.audit.v1alpha1.Event.event_time:type_name -> google.protobuf.Timestamp\n\t6,   // 6: buf.alpha.audit.v1alpha1.Event.metadata:type_name -> buf.alpha.audit.v1alpha1.EventMetadata\n\t8,   // 7: buf.alpha.audit.v1alpha1.Event.organization_created:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationCreated\n\t9,   // 8: buf.alpha.audit.v1alpha1.Event.organization_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationDeleted\n\t10,  // 9: buf.alpha.audit.v1alpha1.Event.organization_member_added:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationMemberAdded\n\t11,  // 10: buf.alpha.audit.v1alpha1.Event.organization_member_role_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRoleChanged\n\t12,  // 11: buf.alpha.audit.v1alpha1.Event.organization_member_roles_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged\n\t13,  // 12: buf.alpha.audit.v1alpha1.Event.organization_member_removed:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRemoved\n\t90,  // 13: buf.alpha.audit.v1alpha1.Event.organization_resource_visibility_control_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationResourceVisibilityControlChanged\n\t91,  // 14: buf.alpha.audit.v1alpha1.Event.organization_uniqueness_policy_enabled:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationUniquenessPolicyEnabled\n\t92,  // 15: buf.alpha.audit.v1alpha1.Event.organization_uniqueness_policy_disabled:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationUniquenessPolicyDisabled\n\t17,  // 16: buf.alpha.audit.v1alpha1.Event.repository_created:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryCreated\n\t19,  // 17: buf.alpha.audit.v1alpha1.Event.repository_deprecated:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryDeprecated\n\t20,  // 18: buf.alpha.audit.v1alpha1.Event.repository_undeprecated:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryUndeprecated\n\t18,  // 19: buf.alpha.audit.v1alpha1.Event.repository_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryDeleted\n\t21,  // 20: buf.alpha.audit.v1alpha1.Event.repository_commit_pushed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryCommitPushed\n\t22,  // 21: buf.alpha.audit.v1alpha1.Event.repository_contributor_added:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryContributorAdded\n\t23,  // 22: buf.alpha.audit.v1alpha1.Event.repository_contributor_role_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRoleChanged\n\t24,  // 23: buf.alpha.audit.v1alpha1.Event.repository_contributor_roles_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged\n\t25,  // 24: buf.alpha.audit.v1alpha1.Event.repository_contributor_removed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRemoved\n\t26,  // 25: buf.alpha.audit.v1alpha1.Event.repository_visibility_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryVisibilityChanged\n\t27,  // 26: buf.alpha.audit.v1alpha1.Event.repository_default_label_name_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryDefaultLabelNameChanged\n\t29,  // 27: buf.alpha.audit.v1alpha1.Event.repository_idp_group_added:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupAdded\n\t30,  // 28: buf.alpha.audit.v1alpha1.Event.repository_idp_group_updated:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupUpdated\n\t31,  // 29: buf.alpha.audit.v1alpha1.Event.repository_idp_group_removed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupRemoved\n\t32,  // 30: buf.alpha.audit.v1alpha1.Event.policy_created:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyCreated\n\t33,  // 31: buf.alpha.audit.v1alpha1.Event.policy_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyDeleted\n\t34,  // 32: buf.alpha.audit.v1alpha1.Event.policy_deprecated:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyDeprecated\n\t35,  // 33: buf.alpha.audit.v1alpha1.Event.policy_undeprecated:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyUndeprecated\n\t36,  // 34: buf.alpha.audit.v1alpha1.Event.policy_visibility_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyVisibilityChanged\n\t37,  // 35: buf.alpha.audit.v1alpha1.Event.policy_commit_pushed:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyCommitPushed\n\t76,  // 36: buf.alpha.audit.v1alpha1.Event.policy_label_created:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyLabelCreated\n\t77,  // 37: buf.alpha.audit.v1alpha1.Event.policy_label_moved:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyLabelMoved\n\t78,  // 38: buf.alpha.audit.v1alpha1.Event.policy_label_archived:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyLabelArchived\n\t79,  // 39: buf.alpha.audit.v1alpha1.Event.policy_label_unarchived:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyLabelUnarchived\n\t38,  // 40: buf.alpha.audit.v1alpha1.Event.plugin_created:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginCreated\n\t39,  // 41: buf.alpha.audit.v1alpha1.Event.plugin_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginDeleted\n\t40,  // 42: buf.alpha.audit.v1alpha1.Event.plugin_deprecated:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginDeprecated\n\t41,  // 43: buf.alpha.audit.v1alpha1.Event.plugin_undeprecated:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginUndeprecated\n\t42,  // 44: buf.alpha.audit.v1alpha1.Event.plugin_visibility_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginVisibilityChanged\n\t43,  // 45: buf.alpha.audit.v1alpha1.Event.plugin_commit_pushed:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginCommitPushed\n\t44,  // 46: buf.alpha.audit.v1alpha1.Event.user_created:type_name -> buf.alpha.audit.v1alpha1.PayloadUserCreated\n\t46,  // 47: buf.alpha.audit.v1alpha1.Event.user_deactivated:type_name -> buf.alpha.audit.v1alpha1.PayloadUserDeactivated\n\t47,  // 48: buf.alpha.audit.v1alpha1.Event.user_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadUserDeleted\n\t48,  // 49: buf.alpha.audit.v1alpha1.Event.user_logged_in:type_name -> buf.alpha.audit.v1alpha1.PayloadUserLoggedIn\n\t49,  // 50: buf.alpha.audit.v1alpha1.Event.user_logged_out:type_name -> buf.alpha.audit.v1alpha1.PayloadUserLoggedOut\n\t51,  // 51: buf.alpha.audit.v1alpha1.Event.curated_plugin_created:type_name -> buf.alpha.audit.v1alpha1.PayloadCuratedPluginCreated\n\t14,  // 52: buf.alpha.audit.v1alpha1.Event.idp_group_added:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupAdded\n\t15,  // 53: buf.alpha.audit.v1alpha1.Event.idp_group_updated:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupUpdated\n\t16,  // 54: buf.alpha.audit.v1alpha1.Event.idp_group_removed:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupRemoved\n\t54,  // 55: buf.alpha.audit.v1alpha1.Event.token_created:type_name -> buf.alpha.audit.v1alpha1.PayloadTokenCreated\n\t55,  // 56: buf.alpha.audit.v1alpha1.Event.token_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadTokenDeleted\n\t45,  // 57: buf.alpha.audit.v1alpha1.Event.user_reactivated:type_name -> buf.alpha.audit.v1alpha1.PayloadUserReactivated\n\t56,  // 58: buf.alpha.audit.v1alpha1.Event.scim_token_created:type_name -> buf.alpha.audit.v1alpha1.PayloadSCIMTokenCreated\n\t57,  // 59: buf.alpha.audit.v1alpha1.Event.scim_token_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadSCIMTokenDeleted\n\t58,  // 60: buf.alpha.audit.v1alpha1.Event.repository_commit_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryCommitDeleted\n\t59,  // 61: buf.alpha.audit.v1alpha1.Event.repository_label_created:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryLabelCreated\n\t60,  // 62: buf.alpha.audit.v1alpha1.Event.repository_label_moved:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryLabelMoved\n\t61,  // 63: buf.alpha.audit.v1alpha1.Event.repository_label_archived:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryLabelArchived\n\t62,  // 64: buf.alpha.audit.v1alpha1.Event.repository_label_unarchived:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryLabelUnarchived\n\t63,  // 65: buf.alpha.audit.v1alpha1.Event.repository_label_enforcement_ignores_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged\n\t52,  // 66: buf.alpha.audit.v1alpha1.Event.curated_plugin_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadCuratedPluginDeleted\n\t53,  // 67: buf.alpha.audit.v1alpha1.Event.curated_plugin_status_updated:type_name -> buf.alpha.audit.v1alpha1.PayloadCuratedPluginStatusUpdated\n\t64,  // 68: buf.alpha.audit.v1alpha1.Event.payload_server_breaking_change_policy_enabled:type_name -> buf.alpha.audit.v1alpha1.PayloadServerBreakingChangePolicyEnabled\n\t65,  // 69: buf.alpha.audit.v1alpha1.Event.payload_server_breaking_change_policy_disabled:type_name -> buf.alpha.audit.v1alpha1.PayloadServerBreakingChangePolicyDisabled\n\t28,  // 70: buf.alpha.audit.v1alpha1.Event.repository_default_branch_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryDefaultBranchChanged\n\t68,  // 71: buf.alpha.audit.v1alpha1.Event.payload_server_uniqueness_policy_enabled:type_name -> buf.alpha.audit.v1alpha1.PayloadServerUniquenessPolicyEnabled\n\t69,  // 72: buf.alpha.audit.v1alpha1.Event.payload_server_uniqueness_policy_disabled:type_name -> buf.alpha.audit.v1alpha1.PayloadServerUniquenessPolicyDisabled\n\t89,  // 73: buf.alpha.audit.v1alpha1.Event.server_resource_visibility_control_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadServerResourceVisibilityControlChanged\n\t50,  // 74: buf.alpha.audit.v1alpha1.Event.user_auto_merged_from_new_idp:type_name -> buf.alpha.audit.v1alpha1.PayloadUserAutoMergedFromNewIdP\n\t70,  // 75: buf.alpha.audit.v1alpha1.Event.device_authorization_grant_approved:type_name -> buf.alpha.audit.v1alpha1.PayloadDeviceAuthorizationGrantApproved\n\t71,  // 76: buf.alpha.audit.v1alpha1.Event.device_authorization_grant_denied:type_name -> buf.alpha.audit.v1alpha1.PayloadDeviceAuthorizationGrantDenied\n\t72,  // 77: buf.alpha.audit.v1alpha1.Event.plugin_label_created:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginLabelCreated\n\t73,  // 78: buf.alpha.audit.v1alpha1.Event.plugin_label_moved:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginLabelMoved\n\t74,  // 79: buf.alpha.audit.v1alpha1.Event.plugin_label_archived:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginLabelArchived\n\t75,  // 80: buf.alpha.audit.v1alpha1.Event.plugin_label_unarchived:type_name -> buf.alpha.audit.v1alpha1.PayloadPluginLabelUnarchived\n\t66,  // 81: buf.alpha.audit.v1alpha1.Event.server_review_flow_enabled:type_name -> buf.alpha.audit.v1alpha1.PayloadServerReviewFlowEnabled\n\t67,  // 82: buf.alpha.audit.v1alpha1.Event.server_review_flow_disabled:type_name -> buf.alpha.audit.v1alpha1.PayloadServerReviewFlowDisabled\n\t80,  // 83: buf.alpha.audit.v1alpha1.Event.sdk_plugin_constraint_created:type_name -> buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintCreated\n\t81,  // 84: buf.alpha.audit.v1alpha1.Event.sdk_plugin_constraint_updated:type_name -> buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintUpdated\n\t82,  // 85: buf.alpha.audit.v1alpha1.Event.sdk_plugin_constraint_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadSDKPluginConstraintDeleted\n\t84,  // 86: buf.alpha.audit.v1alpha1.Event.policy_enforcement_created:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementCreated\n\t85,  // 87: buf.alpha.audit.v1alpha1.Event.policy_enforcement_deleted:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementDeleted\n\t86,  // 88: buf.alpha.audit.v1alpha1.Event.policy_enforcement_policy_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementPolicyChanged\n\t87,  // 89: buf.alpha.audit.v1alpha1.Event.policy_enforcement_targets_changed:type_name -> buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementTargetsChanged\n\t100, // 90: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberAdded.member_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t101, // 91: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberAdded.member_role_source:type_name -> buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t100, // 92: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRoleChanged.old_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t100, // 93: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRoleChanged.new_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t101, // 94: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRoleChanged.old_member_role_source:type_name -> buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t101, // 95: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRoleChanged.new_member_role_source:type_name -> buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t93,  // 96: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.old_roles:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.OrganizationRole\n\t93,  // 97: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.new_roles:type_name -> buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.OrganizationRole\n\t100, // 98: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRemoved.member_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t101, // 99: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRemoved.member_role_source:type_name -> buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t100, // 100: buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupAdded.role_override:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t100, // 101: buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupUpdated.old_role_override:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t100, // 102: buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupUpdated.new_role_override:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t100, // 103: buf.alpha.audit.v1alpha1.PayloadOrganizationIDPGroupRemoved.role_override:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t102, // 104: buf.alpha.audit.v1alpha1.PayloadRepositoryCreated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 105: buf.alpha.audit.v1alpha1.PayloadRepositoryDeleted.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 106: buf.alpha.audit.v1alpha1.PayloadRepositoryDeprecated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 107: buf.alpha.audit.v1alpha1.PayloadRepositoryUndeprecated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t103, // 108: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorAdded.contributor_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t103, // 109: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRoleChanged.old_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t103, // 110: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRoleChanged.new_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t94,  // 111: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.old_roles:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.RepositoryRole\n\t94,  // 112: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.new_roles:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.RepositoryRole\n\t103, // 113: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRemoved.contributor_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t102, // 114: buf.alpha.audit.v1alpha1.PayloadRepositoryVisibilityChanged.old_visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 115: buf.alpha.audit.v1alpha1.PayloadRepositoryVisibilityChanged.new_visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t103, // 116: buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupAdded.role_override:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t103, // 117: buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupUpdated.old_role_override:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t103, // 118: buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupUpdated.new_role_override:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t103, // 119: buf.alpha.audit.v1alpha1.PayloadRepositoryIDPGroupRemoved.role_override:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t102, // 120: buf.alpha.audit.v1alpha1.PayloadPolicyCreated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 121: buf.alpha.audit.v1alpha1.PayloadPolicyDeleted.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 122: buf.alpha.audit.v1alpha1.PayloadPolicyDeprecated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 123: buf.alpha.audit.v1alpha1.PayloadPolicyUndeprecated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 124: buf.alpha.audit.v1alpha1.PayloadPolicyVisibilityChanged.old_visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 125: buf.alpha.audit.v1alpha1.PayloadPolicyVisibilityChanged.new_visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 126: buf.alpha.audit.v1alpha1.PayloadPluginCreated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 127: buf.alpha.audit.v1alpha1.PayloadPluginDeleted.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 128: buf.alpha.audit.v1alpha1.PayloadPluginDeprecated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 129: buf.alpha.audit.v1alpha1.PayloadPluginUndeprecated.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 130: buf.alpha.audit.v1alpha1.PayloadPluginVisibilityChanged.old_visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t102, // 131: buf.alpha.audit.v1alpha1.PayloadPluginVisibilityChanged.new_visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t99,  // 132: buf.alpha.audit.v1alpha1.PayloadTokenCreated.token_expiry_time:type_name -> google.protobuf.Timestamp\n\t99,  // 133: buf.alpha.audit.v1alpha1.PayloadSCIMTokenCreated.token_expiry_time:type_name -> google.protobuf.Timestamp\n\t95,  // 134: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged.old_ignore_entries:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged.IgnoreEntry\n\t95,  // 135: buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged.new_ignore_entries:type_name -> buf.alpha.audit.v1alpha1.PayloadRepositoryLabelEnforcementIgnoresChanged.IgnoreEntry\n\t104, // 136: buf.alpha.audit.v1alpha1.PayloadServerBreakingChangePolicyEnabled.category:type_name -> buf.alpha.registry.v1alpha1.BreakingChangeCategory\n\t96,  // 137: buf.alpha.audit.v1alpha1.PolicyEnforcementScope.instance:type_name -> buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeInstance\n\t97,  // 138: buf.alpha.audit.v1alpha1.PolicyEnforcementScope.owner:type_name -> buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeOwner\n\t98,  // 139: buf.alpha.audit.v1alpha1.PolicyEnforcementScope.repository:type_name -> buf.alpha.audit.v1alpha1.PolicyEnforcementScope.PolicyEnforcementScopeRepository\n\t83,  // 140: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementCreated.scope:type_name -> buf.alpha.audit.v1alpha1.PolicyEnforcementScope\n\t83,  // 141: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementDeleted.scope:type_name -> buf.alpha.audit.v1alpha1.PolicyEnforcementScope\n\t83,  // 142: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementPolicyChanged.scope:type_name -> buf.alpha.audit.v1alpha1.PolicyEnforcementScope\n\t83,  // 143: buf.alpha.audit.v1alpha1.PayloadPolicyEnforcementTargetsChanged.scope:type_name -> buf.alpha.audit.v1alpha1.PolicyEnforcementScope\n\t3,   // 144: buf.alpha.audit.v1alpha1.ResourceVisibilityControl.visibility:type_name -> buf.alpha.audit.v1alpha1.ResourceVisibilityControl.Visibility\n\t1,   // 145: buf.alpha.audit.v1alpha1.PayloadServerResourceVisibilityControlChanged.resource_type:type_name -> buf.alpha.audit.v1alpha1.ResourceType\n\t88,  // 146: buf.alpha.audit.v1alpha1.PayloadServerResourceVisibilityControlChanged.old_visibility_control:type_name -> buf.alpha.audit.v1alpha1.ResourceVisibilityControl\n\t88,  // 147: buf.alpha.audit.v1alpha1.PayloadServerResourceVisibilityControlChanged.new_visibility_control:type_name -> buf.alpha.audit.v1alpha1.ResourceVisibilityControl\n\t1,   // 148: buf.alpha.audit.v1alpha1.PayloadOrganizationResourceVisibilityControlChanged.resource_type:type_name -> buf.alpha.audit.v1alpha1.ResourceType\n\t88,  // 149: buf.alpha.audit.v1alpha1.PayloadOrganizationResourceVisibilityControlChanged.old_visibility_control:type_name -> buf.alpha.audit.v1alpha1.ResourceVisibilityControl\n\t88,  // 150: buf.alpha.audit.v1alpha1.PayloadOrganizationResourceVisibilityControlChanged.new_visibility_control:type_name -> buf.alpha.audit.v1alpha1.ResourceVisibilityControl\n\t100, // 151: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.OrganizationRole.role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t101, // 152: buf.alpha.audit.v1alpha1.PayloadOrganizationMemberRolesChanged.OrganizationRole.source:type_name -> buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t103, // 153: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.RepositoryRole.role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t105, // 154: buf.alpha.audit.v1alpha1.PayloadRepositoryContributorRolesChanged.RepositoryRole.source:type_name -> buf.alpha.registry.v1alpha1.RepositoryRoleSource\n\t155, // [155:155] is the sub-list for method output_type\n\t155, // [155:155] is the sub-list for method input_type\n\t155, // [155:155] is the sub-list for extension type_name\n\t155, // [155:155] is the sub-list for extension extendee\n\t0,   // [0:155] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_audit_v1alpha1_event_proto_init() }\nfunc file_buf_alpha_audit_v1alpha1_event_proto_init() {\n\tif File_buf_alpha_audit_v1alpha1_event_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_audit_v1alpha1_event_proto_msgTypes[3].OneofWrappers = []any{\n\t\t(*event_OrganizationCreated)(nil),\n\t\t(*event_OrganizationDeleted)(nil),\n\t\t(*event_OrganizationMemberAdded)(nil),\n\t\t(*event_OrganizationMemberRoleChanged)(nil),\n\t\t(*event_OrganizationMemberRolesChanged)(nil),\n\t\t(*event_OrganizationMemberRemoved)(nil),\n\t\t(*event_OrganizationResourceVisibilityControlChanged)(nil),\n\t\t(*event_OrganizationUniquenessPolicyEnabled)(nil),\n\t\t(*event_OrganizationUniquenessPolicyDisabled)(nil),\n\t\t(*event_RepositoryCreated)(nil),\n\t\t(*event_RepositoryDeprecated)(nil),\n\t\t(*event_RepositoryUndeprecated)(nil),\n\t\t(*event_RepositoryDeleted)(nil),\n\t\t(*event_RepositoryCommitPushed)(nil),\n\t\t(*event_RepositoryContributorAdded)(nil),\n\t\t(*event_RepositoryContributorRoleChanged)(nil),\n\t\t(*event_RepositoryContributorRolesChanged)(nil),\n\t\t(*event_RepositoryContributorRemoved)(nil),\n\t\t(*event_RepositoryVisibilityChanged)(nil),\n\t\t(*event_RepositoryDefaultLabelNameChanged)(nil),\n\t\t(*event_RepositoryIdpGroupAdded)(nil),\n\t\t(*event_RepositoryIdpGroupUpdated)(nil),\n\t\t(*event_RepositoryIdpGroupRemoved)(nil),\n\t\t(*event_PolicyCreated)(nil),\n\t\t(*event_PolicyDeleted)(nil),\n\t\t(*event_PolicyDeprecated)(nil),\n\t\t(*event_PolicyUndeprecated)(nil),\n\t\t(*event_PolicyVisibilityChanged)(nil),\n\t\t(*event_PolicyCommitPushed)(nil),\n\t\t(*event_PolicyLabelCreated)(nil),\n\t\t(*event_PolicyLabelMoved)(nil),\n\t\t(*event_PolicyLabelArchived)(nil),\n\t\t(*event_PolicyLabelUnarchived)(nil),\n\t\t(*event_PluginCreated)(nil),\n\t\t(*event_PluginDeleted)(nil),\n\t\t(*event_PluginDeprecated)(nil),\n\t\t(*event_PluginUndeprecated)(nil),\n\t\t(*event_PluginVisibilityChanged)(nil),\n\t\t(*event_PluginCommitPushed)(nil),\n\t\t(*event_UserCreated)(nil),\n\t\t(*event_UserDeactivated)(nil),\n\t\t(*event_UserDeleted)(nil),\n\t\t(*event_UserLoggedIn)(nil),\n\t\t(*event_UserLoggedOut)(nil),\n\t\t(*event_CuratedPluginCreated)(nil),\n\t\t(*event_IdpGroupAdded)(nil),\n\t\t(*event_IdpGroupUpdated)(nil),\n\t\t(*event_IdpGroupRemoved)(nil),\n\t\t(*event_TokenCreated)(nil),\n\t\t(*event_TokenDeleted)(nil),\n\t\t(*event_UserReactivated)(nil),\n\t\t(*event_ScimTokenCreated)(nil),\n\t\t(*event_ScimTokenDeleted)(nil),\n\t\t(*event_RepositoryCommitDeleted)(nil),\n\t\t(*event_RepositoryLabelCreated)(nil),\n\t\t(*event_RepositoryLabelMoved)(nil),\n\t\t(*event_RepositoryLabelArchived)(nil),\n\t\t(*event_RepositoryLabelUnarchived)(nil),\n\t\t(*event_RepositoryLabelEnforcementIgnoresChanged)(nil),\n\t\t(*event_CuratedPluginDeleted)(nil),\n\t\t(*event_CuratedPluginStatusUpdated)(nil),\n\t\t(*event_PayloadServerBreakingChangePolicyEnabled)(nil),\n\t\t(*event_PayloadServerBreakingChangePolicyDisabled)(nil),\n\t\t(*event_RepositoryDefaultBranchChanged)(nil),\n\t\t(*event_PayloadServerUniquenessPolicyEnabled)(nil),\n\t\t(*event_PayloadServerUniquenessPolicyDisabled)(nil),\n\t\t(*event_ServerResourceVisibilityControlChanged)(nil),\n\t\t(*event_UserAutoMergedFromNewIdp)(nil),\n\t\t(*event_DeviceAuthorizationGrantApproved)(nil),\n\t\t(*event_DeviceAuthorizationGrantDenied)(nil),\n\t\t(*event_PluginLabelCreated)(nil),\n\t\t(*event_PluginLabelMoved)(nil),\n\t\t(*event_PluginLabelArchived)(nil),\n\t\t(*event_PluginLabelUnarchived)(nil),\n\t\t(*event_ServerReviewFlowEnabled)(nil),\n\t\t(*event_ServerReviewFlowDisabled)(nil),\n\t\t(*event_SdkPluginConstraintCreated)(nil),\n\t\t(*event_SdkPluginConstraintUpdated)(nil),\n\t\t(*event_SdkPluginConstraintDeleted)(nil),\n\t\t(*event_PolicyEnforcementCreated)(nil),\n\t\t(*event_PolicyEnforcementDeleted)(nil),\n\t\t(*event_PolicyEnforcementPolicyChanged)(nil),\n\t\t(*event_PolicyEnforcementTargetsChanged)(nil),\n\t}\n\tfile_buf_alpha_audit_v1alpha1_event_proto_msgTypes[60].OneofWrappers = []any{}\n\tfile_buf_alpha_audit_v1alpha1_event_proto_msgTypes[79].OneofWrappers = []any{\n\t\t(*policyEnforcementScope_Instance)(nil),\n\t\t(*policyEnforcementScope_Owner)(nil),\n\t\t(*policyEnforcementScope_Repository)(nil),\n\t}\n\tfile_buf_alpha_audit_v1alpha1_event_proto_msgTypes[85].OneofWrappers = []any{}\n\tfile_buf_alpha_audit_v1alpha1_event_proto_msgTypes[86].OneofWrappers = []any{}\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_buf_alpha_audit_v1alpha1_event_proto_rawDesc), len(file_buf_alpha_audit_v1alpha1_event_proto_rawDesc)),\n\t\t\tNumEnums:      4,\n\t\t\tNumMessages:   95,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_audit_v1alpha1_event_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_audit_v1alpha1_event_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_audit_v1alpha1_event_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_audit_v1alpha1_event_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_audit_v1alpha1_event_proto = out.File\n\tfile_buf_alpha_audit_v1alpha1_event_proto_goTypes = nil\n\tfile_buf_alpha_audit_v1alpha1_event_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/audit/v1alpha1/service.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/audit/v1alpha1/service.proto\n\npackage auditv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 ListAuditedEventsRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Start     *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=start,proto3\"`\n\txxx_hidden_End       *timestamppb.Timestamp `protobuf:\"bytes,4,opt,name=end,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListAuditedEventsRequest) Reset() {\n\t*x = ListAuditedEventsRequest{}\n\tmi := &file_buf_alpha_audit_v1alpha1_service_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListAuditedEventsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListAuditedEventsRequest) ProtoMessage() {}\n\nfunc (x *ListAuditedEventsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_service_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\nfunc (x *ListAuditedEventsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListAuditedEventsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListAuditedEventsRequest) GetStart() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Start\n\t}\n\treturn nil\n}\n\nfunc (x *ListAuditedEventsRequest) GetEnd() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_End\n\t}\n\treturn nil\n}\n\nfunc (x *ListAuditedEventsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListAuditedEventsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListAuditedEventsRequest) SetStart(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_Start = v\n}\n\nfunc (x *ListAuditedEventsRequest) SetEnd(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_End = v\n}\n\nfunc (x *ListAuditedEventsRequest) HasStart() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Start != nil\n}\n\nfunc (x *ListAuditedEventsRequest) HasEnd() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_End != nil\n}\n\nfunc (x *ListAuditedEventsRequest) ClearStart() {\n\tx.xxx_hidden_Start = nil\n}\n\nfunc (x *ListAuditedEventsRequest) ClearEnd() {\n\tx.xxx_hidden_End = nil\n}\n\ntype ListAuditedEventsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The page size for listing audited events, values between 1-250.\n\tPageSize uint32\n\t// The page token for paginating. The first page is returned if this is empty.\n\tPageToken string\n\t// The start timestamp to filter events from.\n\tStart *timestamppb.Timestamp\n\t// The end timestamp to filter events to.\n\tEnd *timestamppb.Timestamp\n}\n\nfunc (b0 ListAuditedEventsRequest_builder) Build() *ListAuditedEventsRequest {\n\tm0 := &ListAuditedEventsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Start = b.Start\n\tx.xxx_hidden_End = b.End\n\treturn m0\n}\n\ntype ListAuditedEventsResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Events        *[]*Event              `protobuf:\"bytes,1,rep,name=events,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListAuditedEventsResponse) Reset() {\n\t*x = ListAuditedEventsResponse{}\n\tmi := &file_buf_alpha_audit_v1alpha1_service_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListAuditedEventsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListAuditedEventsResponse) ProtoMessage() {}\n\nfunc (x *ListAuditedEventsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_audit_v1alpha1_service_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\nfunc (x *ListAuditedEventsResponse) GetEvents() []*Event {\n\tif x != nil {\n\t\tif x.xxx_hidden_Events != nil {\n\t\t\treturn *x.xxx_hidden_Events\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListAuditedEventsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListAuditedEventsResponse) SetEvents(v []*Event) {\n\tx.xxx_hidden_Events = &v\n}\n\nfunc (x *ListAuditedEventsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListAuditedEventsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of audited events in the current page.\n\tEvents []*Event\n\t// The token for the next page of audited events. There are no more pages if\n\t// this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListAuditedEventsResponse_builder) Build() *ListAuditedEventsResponse {\n\tm0 := &ListAuditedEventsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Events = &b.Events\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\nvar File_buf_alpha_audit_v1alpha1_service_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_audit_v1alpha1_service_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"&buf/alpha/audit/v1alpha1/service.proto\\x12\\x18buf.alpha.audit.v1alpha1\\x1a$buf/alpha/audit/v1alpha1/event.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xb6\\x01\\n\" +\n\t\"\\x18ListAuditedEventsRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x120\\n\" +\n\t\"\\x05start\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x05start\\x12,\\n\" +\n\t\"\\x03end\\x18\\x04 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x03end\\\"|\\n\" +\n\t\"\\x19ListAuditedEventsResponse\\x127\\n\" +\n\t\"\\x06events\\x18\\x01 \\x03(\\v2\\x1f.buf.alpha.audit.v1alpha1.EventR\\x06events\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken2\\x92\\x01\\n\" +\n\t\"\\fAuditService\\x12\\x81\\x01\\n\" +\n\t\"\\x11ListAuditedEvents\\x122.buf.alpha.audit.v1alpha1.ListAuditedEventsRequest\\x1a3.buf.alpha.audit.v1alpha1.ListAuditedEventsResponse\\\"\\x03\\x90\\x02\\x01B\\x84\\x02\\n\" +\n\t\"\\x1ccom.buf.alpha.audit.v1alpha1B\\fServiceProtoP\\x01ZSgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/audit/v1alpha1;auditv1alpha1\\xa2\\x02\\x03BAA\\xaa\\x02\\x18Buf.Alpha.Audit.V1alpha1\\xca\\x02\\x18Buf\\\\Alpha\\\\Audit\\\\V1alpha1\\xe2\\x02$Buf\\\\Alpha\\\\Audit\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1bBuf::Alpha::Audit::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_audit_v1alpha1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_audit_v1alpha1_service_proto_goTypes = []any{\n\t(*ListAuditedEventsRequest)(nil),  // 0: buf.alpha.audit.v1alpha1.ListAuditedEventsRequest\n\t(*ListAuditedEventsResponse)(nil), // 1: buf.alpha.audit.v1alpha1.ListAuditedEventsResponse\n\t(*timestamppb.Timestamp)(nil),     // 2: google.protobuf.Timestamp\n\t(*Event)(nil),                     // 3: buf.alpha.audit.v1alpha1.Event\n}\nvar file_buf_alpha_audit_v1alpha1_service_proto_depIdxs = []int32{\n\t2, // 0: buf.alpha.audit.v1alpha1.ListAuditedEventsRequest.start:type_name -> google.protobuf.Timestamp\n\t2, // 1: buf.alpha.audit.v1alpha1.ListAuditedEventsRequest.end:type_name -> google.protobuf.Timestamp\n\t3, // 2: buf.alpha.audit.v1alpha1.ListAuditedEventsResponse.events:type_name -> buf.alpha.audit.v1alpha1.Event\n\t0, // 3: buf.alpha.audit.v1alpha1.AuditService.ListAuditedEvents:input_type -> buf.alpha.audit.v1alpha1.ListAuditedEventsRequest\n\t1, // 4: buf.alpha.audit.v1alpha1.AuditService.ListAuditedEvents:output_type -> buf.alpha.audit.v1alpha1.ListAuditedEventsResponse\n\t4, // [4:5] is the sub-list for method output_type\n\t3, // [3:4] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_audit_v1alpha1_service_proto_init() }\nfunc file_buf_alpha_audit_v1alpha1_service_proto_init() {\n\tif File_buf_alpha_audit_v1alpha1_service_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_audit_v1alpha1_event_proto_init()\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_buf_alpha_audit_v1alpha1_service_proto_rawDesc), len(file_buf_alpha_audit_v1alpha1_service_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_audit_v1alpha1_service_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_audit_v1alpha1_service_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_audit_v1alpha1_service_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_audit_v1alpha1_service_proto = out.File\n\tfile_buf_alpha_audit_v1alpha1_service_proto_goTypes = nil\n\tfile_buf_alpha_audit_v1alpha1_service_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/audit/v1alpha1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage auditv1alpha1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/breaking/v1/config.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/breaking/v1/config.proto\n\npackage breakingv1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// Config represents the breaking change configuration for a module. The rule and category IDs are defined\n// by the version and apply across the config. The version is independent of the version of\n// the package. The package version refers to the config shape, the version encoded in the Config message\n// indicates which rule and category IDs should be used.\n//\n// The rule and category IDs are not encoded as enums in this package because we may want to support custom rule\n// and category IDs in the future. Callers will need to resolve the rule and category ID strings.\ntype Config struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version                string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\txxx_hidden_UseIds                 []string               `protobuf:\"bytes,2,rep,name=use_ids,json=useIds,proto3\"`\n\txxx_hidden_ExceptIds              []string               `protobuf:\"bytes,3,rep,name=except_ids,json=exceptIds,proto3\"`\n\txxx_hidden_IgnorePaths            []string               `protobuf:\"bytes,4,rep,name=ignore_paths,json=ignorePaths,proto3\"`\n\txxx_hidden_IgnoreIdPaths          *[]*IDPaths            `protobuf:\"bytes,5,rep,name=ignore_id_paths,json=ignoreIdPaths,proto3\"`\n\txxx_hidden_IgnoreUnstablePackages bool                   `protobuf:\"varint,6,opt,name=ignore_unstable_packages,json=ignoreUnstablePackages,proto3\"`\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *Config) Reset() {\n\t*x = Config{}\n\tmi := &file_buf_alpha_breaking_v1_config_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Config) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Config) ProtoMessage() {}\n\nfunc (x *Config) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_breaking_v1_config_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\nfunc (x *Config) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *Config) GetUseIds() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UseIds\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetExceptIds() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExceptIds\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetIgnorePaths() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IgnorePaths\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetIgnoreIdPaths() []*IDPaths {\n\tif x != nil {\n\t\tif x.xxx_hidden_IgnoreIdPaths != nil {\n\t\t\treturn *x.xxx_hidden_IgnoreIdPaths\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetIgnoreUnstablePackages() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IgnoreUnstablePackages\n\t}\n\treturn false\n}\n\nfunc (x *Config) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *Config) SetUseIds(v []string) {\n\tx.xxx_hidden_UseIds = v\n}\n\nfunc (x *Config) SetExceptIds(v []string) {\n\tx.xxx_hidden_ExceptIds = v\n}\n\nfunc (x *Config) SetIgnorePaths(v []string) {\n\tx.xxx_hidden_IgnorePaths = v\n}\n\nfunc (x *Config) SetIgnoreIdPaths(v []*IDPaths) {\n\tx.xxx_hidden_IgnoreIdPaths = &v\n}\n\nfunc (x *Config) SetIgnoreUnstablePackages(v bool) {\n\tx.xxx_hidden_IgnoreUnstablePackages = v\n}\n\ntype Config_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version represents the version of the breaking change rule and category IDs that should be used with this config.\n\tVersion string\n\t// use_ids lists the rule and/or category IDs that are included in the breaking change check.\n\tUseIds []string\n\t// except_ids lists the rule and/or category IDs that are excluded from the breaking change check.\n\tExceptIds []string\n\t// ignore_paths lists the paths of directories and/or files that should be ignored by the breaking change check.\n\t// All paths are relative to the root of the module.\n\tIgnorePaths []string\n\t// ignore_id_paths is a map of rule and/or category IDs to directory and/or file paths to exclude from the\n\t// breaking change check. This corresponds with the ignore_only configuration key.\n\tIgnoreIdPaths []*IDPaths\n\t// ignore_unstable_packages ignores packages with a last component that is one of the unstable forms recognised\n\t// by the PACKAGE_VERSION_SUFFIX:\n\t//\n\t//\tv\\d+test.*\n\t//\tv\\d+(alpha|beta)\\d+\n\t//\tv\\d+p\\d+(alpha|beta)\\d+\n\tIgnoreUnstablePackages bool\n}\n\nfunc (b0 Config_builder) Build() *Config {\n\tm0 := &Config{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_UseIds = b.UseIds\n\tx.xxx_hidden_ExceptIds = b.ExceptIds\n\tx.xxx_hidden_IgnorePaths = b.IgnorePaths\n\tx.xxx_hidden_IgnoreIdPaths = &b.IgnoreIdPaths\n\tx.xxx_hidden_IgnoreUnstablePackages = b.IgnoreUnstablePackages\n\treturn m0\n}\n\n// IDPaths represents a rule or category ID and the file and/or directory paths that are ignored for the rule.\ntype IDPaths struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id    string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Paths []string               `protobuf:\"bytes,2,rep,name=paths,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *IDPaths) Reset() {\n\t*x = IDPaths{}\n\tmi := &file_buf_alpha_breaking_v1_config_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *IDPaths) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*IDPaths) ProtoMessage() {}\n\nfunc (x *IDPaths) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_breaking_v1_config_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\nfunc (x *IDPaths) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *IDPaths) GetPaths() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Paths\n\t}\n\treturn nil\n}\n\nfunc (x *IDPaths) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *IDPaths) SetPaths(v []string) {\n\tx.xxx_hidden_Paths = v\n}\n\ntype IDPaths_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId    string\n\tPaths []string\n}\n\nfunc (b0 IDPaths_builder) Build() *IDPaths {\n\tm0 := &IDPaths{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Paths = b.Paths\n\treturn m0\n}\n\nvar File_buf_alpha_breaking_v1_config_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_breaking_v1_config_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"\\\"buf/alpha/breaking/v1/config.proto\\x12\\x15buf.alpha.breaking.v1\\\"\\xff\\x01\\n\" +\n\t\"\\x06Config\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\x12\\x17\\n\" +\n\t\"\\ause_ids\\x18\\x02 \\x03(\\tR\\x06useIds\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"except_ids\\x18\\x03 \\x03(\\tR\\texceptIds\\x12!\\n\" +\n\t\"\\fignore_paths\\x18\\x04 \\x03(\\tR\\vignorePaths\\x12F\\n\" +\n\t\"\\x0fignore_id_paths\\x18\\x05 \\x03(\\v2\\x1e.buf.alpha.breaking.v1.IDPathsR\\rignoreIdPaths\\x128\\n\" +\n\t\"\\x18ignore_unstable_packages\\x18\\x06 \\x01(\\bR\\x16ignoreUnstablePackages\\\"/\\n\" +\n\t\"\\aIDPaths\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x14\\n\" +\n\t\"\\x05paths\\x18\\x02 \\x03(\\tR\\x05pathsB\\xee\\x01\\n\" +\n\t\"\\x19com.buf.alpha.breaking.v1B\\vConfigProtoP\\x01ZMgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1;breakingv1\\xa2\\x02\\x03BAB\\xaa\\x02\\x15Buf.Alpha.Breaking.V1\\xca\\x02\\x15Buf\\\\Alpha\\\\Breaking\\\\V1\\xe2\\x02!Buf\\\\Alpha\\\\Breaking\\\\V1\\\\GPBMetadata\\xea\\x02\\x18Buf::Alpha::Breaking::V1b\\x06proto3\"\n\nvar file_buf_alpha_breaking_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_breaking_v1_config_proto_goTypes = []any{\n\t(*Config)(nil),  // 0: buf.alpha.breaking.v1.Config\n\t(*IDPaths)(nil), // 1: buf.alpha.breaking.v1.IDPaths\n}\nvar file_buf_alpha_breaking_v1_config_proto_depIdxs = []int32{\n\t1, // 0: buf.alpha.breaking.v1.Config.ignore_id_paths:type_name -> buf.alpha.breaking.v1.IDPaths\n\t1, // [1:1] is the sub-list for method output_type\n\t1, // [1:1] 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_buf_alpha_breaking_v1_config_proto_init() }\nfunc file_buf_alpha_breaking_v1_config_proto_init() {\n\tif File_buf_alpha_breaking_v1_config_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_buf_alpha_breaking_v1_config_proto_rawDesc), len(file_buf_alpha_breaking_v1_config_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_buf_alpha_breaking_v1_config_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_breaking_v1_config_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_breaking_v1_config_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_breaking_v1_config_proto = out.File\n\tfile_buf_alpha_breaking_v1_config_proto_goTypes = nil\n\tfile_buf_alpha_breaking_v1_config_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/breaking/v1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage breakingv1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/image/v1/image.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/image/v1/image.proto\n\npackage imagev1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdescriptorpb \"google.golang.org/protobuf/types/descriptorpb\"\n\treflect \"reflect\"\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\n// Image is an ext FileDescriptorSet.\n//\n// See https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto\ntype Image struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_File *[]*ImageFile          `protobuf:\"bytes,1,rep,name=file\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *Image) Reset() {\n\t*x = Image{}\n\tmi := &file_buf_alpha_image_v1_image_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Image) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Image) ProtoMessage() {}\n\nfunc (x *Image) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_image_v1_image_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\nfunc (x *Image) GetFile() []*ImageFile {\n\tif x != nil {\n\t\tif x.xxx_hidden_File != nil {\n\t\t\treturn *x.xxx_hidden_File\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Image) SetFile(v []*ImageFile) {\n\tx.xxx_hidden_File = &v\n}\n\ntype Image_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tFile []*ImageFile\n}\n\nfunc (b0 Image_builder) Build() *Image {\n\tm0 := &Image{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_File = &b.File\n\treturn m0\n}\n\n// ImageFile is an extended FileDescriptorProto.\n//\n// Since FileDescriptorProto does not have extensions, we copy the fields from\n// FileDescriptorProto, and then add our own extensions via the buf_extension\n// field. This is compatible with a FileDescriptorProto.\n//\n// See https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto\ntype ImageFile struct {\n\tstate                       protoimpl.MessageState                  `protogen:\"opaque.v1\"`\n\txxx_hidden_Name             *string                                 `protobuf:\"bytes,1,opt,name=name\"`\n\txxx_hidden_Package          *string                                 `protobuf:\"bytes,2,opt,name=package\"`\n\txxx_hidden_Dependency       []string                                `protobuf:\"bytes,3,rep,name=dependency\"`\n\txxx_hidden_PublicDependency []int32                                 `protobuf:\"varint,10,rep,name=public_dependency,json=publicDependency\"`\n\txxx_hidden_WeakDependency   []int32                                 `protobuf:\"varint,11,rep,name=weak_dependency,json=weakDependency\"`\n\txxx_hidden_MessageType      *[]*descriptorpb.DescriptorProto        `protobuf:\"bytes,4,rep,name=message_type,json=messageType\"`\n\txxx_hidden_EnumType         *[]*descriptorpb.EnumDescriptorProto    `protobuf:\"bytes,5,rep,name=enum_type,json=enumType\"`\n\txxx_hidden_Service          *[]*descriptorpb.ServiceDescriptorProto `protobuf:\"bytes,6,rep,name=service\"`\n\txxx_hidden_Extension        *[]*descriptorpb.FieldDescriptorProto   `protobuf:\"bytes,7,rep,name=extension\"`\n\txxx_hidden_Options          *descriptorpb.FileOptions               `protobuf:\"bytes,8,opt,name=options\"`\n\txxx_hidden_SourceCodeInfo   *descriptorpb.SourceCodeInfo            `protobuf:\"bytes,9,opt,name=source_code_info,json=sourceCodeInfo\"`\n\txxx_hidden_Syntax           *string                                 `protobuf:\"bytes,12,opt,name=syntax\"`\n\txxx_hidden_Edition          descriptorpb.Edition                    `protobuf:\"varint,14,opt,name=edition,enum=google.protobuf.Edition\"`\n\txxx_hidden_BufExtension     *ImageFileExtension                     `protobuf:\"bytes,8042,opt,name=buf_extension,json=bufExtension\"`\n\tXXX_raceDetectHookData      protoimpl.RaceDetectHookData\n\tXXX_presence                [1]uint32\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *ImageFile) Reset() {\n\t*x = ImageFile{}\n\tmi := &file_buf_alpha_image_v1_image_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ImageFile) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ImageFile) ProtoMessage() {}\n\nfunc (x *ImageFile) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_image_v1_image_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\nfunc (x *ImageFile) GetName() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Name != nil {\n\t\t\treturn *x.xxx_hidden_Name\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImageFile) GetPackage() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Package != nil {\n\t\t\treturn *x.xxx_hidden_Package\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImageFile) GetDependency() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Dependency\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetPublicDependency() []int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PublicDependency\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetWeakDependency() []int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_WeakDependency\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetMessageType() []*descriptorpb.DescriptorProto {\n\tif x != nil {\n\t\tif x.xxx_hidden_MessageType != nil {\n\t\t\treturn *x.xxx_hidden_MessageType\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetEnumType() []*descriptorpb.EnumDescriptorProto {\n\tif x != nil {\n\t\tif x.xxx_hidden_EnumType != nil {\n\t\t\treturn *x.xxx_hidden_EnumType\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetService() []*descriptorpb.ServiceDescriptorProto {\n\tif x != nil {\n\t\tif x.xxx_hidden_Service != nil {\n\t\t\treturn *x.xxx_hidden_Service\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetExtension() []*descriptorpb.FieldDescriptorProto {\n\tif x != nil {\n\t\tif x.xxx_hidden_Extension != nil {\n\t\t\treturn *x.xxx_hidden_Extension\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetOptions() *descriptorpb.FileOptions {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Options\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetSourceCodeInfo() *descriptorpb.SourceCodeInfo {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SourceCodeInfo\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) GetSyntax() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Syntax != nil {\n\t\t\treturn *x.xxx_hidden_Syntax\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImageFile) GetEdition() descriptorpb.Edition {\n\tif x != nil {\n\t\tif protoimpl.X.Present(&(x.XXX_presence[0]), 12) {\n\t\t\treturn x.xxx_hidden_Edition\n\t\t}\n\t}\n\treturn descriptorpb.Edition(0)\n}\n\nfunc (x *ImageFile) GetBufExtension() *ImageFileExtension {\n\tif x != nil {\n\t\treturn x.xxx_hidden_BufExtension\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFile) SetName(v string) {\n\tx.xxx_hidden_Name = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 14)\n}\n\nfunc (x *ImageFile) SetPackage(v string) {\n\tx.xxx_hidden_Package = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 14)\n}\n\nfunc (x *ImageFile) SetDependency(v []string) {\n\tx.xxx_hidden_Dependency = v\n}\n\nfunc (x *ImageFile) SetPublicDependency(v []int32) {\n\tx.xxx_hidden_PublicDependency = v\n}\n\nfunc (x *ImageFile) SetWeakDependency(v []int32) {\n\tx.xxx_hidden_WeakDependency = v\n}\n\nfunc (x *ImageFile) SetMessageType(v []*descriptorpb.DescriptorProto) {\n\tx.xxx_hidden_MessageType = &v\n}\n\nfunc (x *ImageFile) SetEnumType(v []*descriptorpb.EnumDescriptorProto) {\n\tx.xxx_hidden_EnumType = &v\n}\n\nfunc (x *ImageFile) SetService(v []*descriptorpb.ServiceDescriptorProto) {\n\tx.xxx_hidden_Service = &v\n}\n\nfunc (x *ImageFile) SetExtension(v []*descriptorpb.FieldDescriptorProto) {\n\tx.xxx_hidden_Extension = &v\n}\n\nfunc (x *ImageFile) SetOptions(v *descriptorpb.FileOptions) {\n\tx.xxx_hidden_Options = v\n}\n\nfunc (x *ImageFile) SetSourceCodeInfo(v *descriptorpb.SourceCodeInfo) {\n\tx.xxx_hidden_SourceCodeInfo = v\n}\n\nfunc (x *ImageFile) SetSyntax(v string) {\n\tx.xxx_hidden_Syntax = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 11, 14)\n}\n\nfunc (x *ImageFile) SetEdition(v descriptorpb.Edition) {\n\tx.xxx_hidden_Edition = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 12, 14)\n}\n\nfunc (x *ImageFile) SetBufExtension(v *ImageFileExtension) {\n\tx.xxx_hidden_BufExtension = v\n}\n\nfunc (x *ImageFile) HasName() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 0)\n}\n\nfunc (x *ImageFile) HasPackage() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *ImageFile) HasOptions() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Options != nil\n}\n\nfunc (x *ImageFile) HasSourceCodeInfo() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_SourceCodeInfo != nil\n}\n\nfunc (x *ImageFile) HasSyntax() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 11)\n}\n\nfunc (x *ImageFile) HasEdition() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 12)\n}\n\nfunc (x *ImageFile) HasBufExtension() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_BufExtension != nil\n}\n\nfunc (x *ImageFile) ClearName() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)\n\tx.xxx_hidden_Name = nil\n}\n\nfunc (x *ImageFile) ClearPackage() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_Package = nil\n}\n\nfunc (x *ImageFile) ClearOptions() {\n\tx.xxx_hidden_Options = nil\n}\n\nfunc (x *ImageFile) ClearSourceCodeInfo() {\n\tx.xxx_hidden_SourceCodeInfo = nil\n}\n\nfunc (x *ImageFile) ClearSyntax() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 11)\n\tx.xxx_hidden_Syntax = nil\n}\n\nfunc (x *ImageFile) ClearEdition() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 12)\n\tx.xxx_hidden_Edition = descriptorpb.Edition_EDITION_UNKNOWN\n}\n\nfunc (x *ImageFile) ClearBufExtension() {\n\tx.xxx_hidden_BufExtension = nil\n}\n\ntype ImageFile_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName             *string\n\tPackage          *string\n\tDependency       []string\n\tPublicDependency []int32\n\tWeakDependency   []int32\n\tMessageType      []*descriptorpb.DescriptorProto\n\tEnumType         []*descriptorpb.EnumDescriptorProto\n\tService          []*descriptorpb.ServiceDescriptorProto\n\tExtension        []*descriptorpb.FieldDescriptorProto\n\tOptions          *descriptorpb.FileOptions\n\tSourceCodeInfo   *descriptorpb.SourceCodeInfo\n\tSyntax           *string\n\tEdition          *descriptorpb.Edition\n\t// buf_extension contains buf-specific extensions to FileDescriptorProtos.\n\t//\n\t// The prefixed name and high tag value is used to all but guarantee there\n\t// will never be any conflict with Google's FileDescriptorProto definition.\n\t// The definition of a FileDescriptorProto has not changed in years, so\n\t// we're not too worried about a conflict here.\n\tBufExtension *ImageFileExtension\n}\n\nfunc (b0 ImageFile_builder) Build() *ImageFile {\n\tm0 := &ImageFile{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Name != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 14)\n\t\tx.xxx_hidden_Name = b.Name\n\t}\n\tif b.Package != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 14)\n\t\tx.xxx_hidden_Package = b.Package\n\t}\n\tx.xxx_hidden_Dependency = b.Dependency\n\tx.xxx_hidden_PublicDependency = b.PublicDependency\n\tx.xxx_hidden_WeakDependency = b.WeakDependency\n\tx.xxx_hidden_MessageType = &b.MessageType\n\tx.xxx_hidden_EnumType = &b.EnumType\n\tx.xxx_hidden_Service = &b.Service\n\tx.xxx_hidden_Extension = &b.Extension\n\tx.xxx_hidden_Options = b.Options\n\tx.xxx_hidden_SourceCodeInfo = b.SourceCodeInfo\n\tif b.Syntax != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 11, 14)\n\t\tx.xxx_hidden_Syntax = b.Syntax\n\t}\n\tif b.Edition != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 12, 14)\n\t\tx.xxx_hidden_Edition = *b.Edition\n\t}\n\tx.xxx_hidden_BufExtension = b.BufExtension\n\treturn m0\n}\n\n// ImageFileExtension contains extensions to ImageFiles.\n//\n// The fields are not included directly on the ImageFile so that we can both\n// detect if extensions exist, which signifies this was created by buf and not\n// by protoc, and so that we can add fields in a freeform manner without\n// worrying about conflicts with FileDescriptorProto.\ntype ImageFileExtension struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_IsImport            bool                   `protobuf:\"varint,1,opt,name=is_import,json=isImport\"`\n\txxx_hidden_ModuleInfo          *ModuleInfo            `protobuf:\"bytes,2,opt,name=module_info,json=moduleInfo\"`\n\txxx_hidden_IsSyntaxUnspecified bool                   `protobuf:\"varint,3,opt,name=is_syntax_unspecified,json=isSyntaxUnspecified\"`\n\txxx_hidden_UnusedDependency    []int32                `protobuf:\"varint,4,rep,name=unused_dependency,json=unusedDependency\"`\n\tXXX_raceDetectHookData         protoimpl.RaceDetectHookData\n\tXXX_presence                   [1]uint32\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *ImageFileExtension) Reset() {\n\t*x = ImageFileExtension{}\n\tmi := &file_buf_alpha_image_v1_image_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ImageFileExtension) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ImageFileExtension) ProtoMessage() {}\n\nfunc (x *ImageFileExtension) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_image_v1_image_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\nfunc (x *ImageFileExtension) GetIsImport() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IsImport\n\t}\n\treturn false\n}\n\nfunc (x *ImageFileExtension) GetModuleInfo() *ModuleInfo {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleInfo\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFileExtension) GetIsSyntaxUnspecified() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IsSyntaxUnspecified\n\t}\n\treturn false\n}\n\nfunc (x *ImageFileExtension) GetUnusedDependency() []int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UnusedDependency\n\t}\n\treturn nil\n}\n\nfunc (x *ImageFileExtension) SetIsImport(v bool) {\n\tx.xxx_hidden_IsImport = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 4)\n}\n\nfunc (x *ImageFileExtension) SetModuleInfo(v *ModuleInfo) {\n\tx.xxx_hidden_ModuleInfo = v\n}\n\nfunc (x *ImageFileExtension) SetIsSyntaxUnspecified(v bool) {\n\tx.xxx_hidden_IsSyntaxUnspecified = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4)\n}\n\nfunc (x *ImageFileExtension) SetUnusedDependency(v []int32) {\n\tx.xxx_hidden_UnusedDependency = v\n}\n\nfunc (x *ImageFileExtension) HasIsImport() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 0)\n}\n\nfunc (x *ImageFileExtension) HasModuleInfo() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleInfo != nil\n}\n\nfunc (x *ImageFileExtension) HasIsSyntaxUnspecified() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *ImageFileExtension) ClearIsImport() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)\n\tx.xxx_hidden_IsImport = false\n}\n\nfunc (x *ImageFileExtension) ClearModuleInfo() {\n\tx.xxx_hidden_ModuleInfo = nil\n}\n\nfunc (x *ImageFileExtension) ClearIsSyntaxUnspecified() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_IsSyntaxUnspecified = false\n}\n\ntype ImageFileExtension_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// is_import denotes whether this file is considered an \"import\".\n\t//\n\t// An import is a file which was not derived from the local source files.\n\t// There are two cases where this could be true:\n\t//\n\t// 1. A Well-Known Type included from the compiler.\n\t// 2. A file that was included from a Buf module dependency.\n\t//\n\t// We use \"import\" as this matches with the protoc concept of\n\t// --include_imports, however import is a bit of an overloaded term.\n\t//\n\t// This will always be set.\n\tIsImport *bool\n\t// ModuleInfo contains information about the Buf module this file belongs to.\n\t//\n\t// This field is optional and will not be set if the module is not known.\n\tModuleInfo *ModuleInfo\n\t// is_syntax_unspecified denotes whether the file did not have a syntax\n\t// explicitly specified.\n\t//\n\t// Per the FileDescriptorProto spec, it would be fine in this case to just\n\t// leave the syntax field unset to denote this and to set the syntax field\n\t// to \"proto2\" if it is specified. However, protoc does not set the syntax\n\t// field if it was \"proto2\", and plugins may (incorrectly) depend on this.\n\t// We also want to maintain consistency with protoc as much as possible.\n\t// So instead, we have this field which will denote whether syntax was not\n\t// specified.\n\t//\n\t// This will always be set.\n\tIsSyntaxUnspecified *bool\n\t// unused_dependency are the indexes within the dependency field on\n\t// FileDescriptorProto for those dependencies that are not used.\n\t//\n\t// This matches the shape of the public_dependency and weak_dependency\n\t// fields.\n\tUnusedDependency []int32\n}\n\nfunc (b0 ImageFileExtension_builder) Build() *ImageFileExtension {\n\tm0 := &ImageFileExtension{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.IsImport != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 4)\n\t\tx.xxx_hidden_IsImport = *b.IsImport\n\t}\n\tx.xxx_hidden_ModuleInfo = b.ModuleInfo\n\tif b.IsSyntaxUnspecified != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4)\n\t\tx.xxx_hidden_IsSyntaxUnspecified = *b.IsSyntaxUnspecified\n\t}\n\tx.xxx_hidden_UnusedDependency = b.UnusedDependency\n\treturn m0\n}\n\n// ModuleInfo contains information about a Buf module that an ImageFile\n// belongs to.\ntype ModuleInfo struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name        *ModuleName            `protobuf:\"bytes,1,opt,name=name\"`\n\txxx_hidden_Commit      *string                `protobuf:\"bytes,2,opt,name=commit\"`\n\tXXX_raceDetectHookData protoimpl.RaceDetectHookData\n\tXXX_presence           [1]uint32\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *ModuleInfo) Reset() {\n\t*x = ModuleInfo{}\n\tmi := &file_buf_alpha_image_v1_image_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModuleInfo) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModuleInfo) ProtoMessage() {}\n\nfunc (x *ModuleInfo) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_image_v1_image_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\nfunc (x *ModuleInfo) GetName() *ModuleName {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn nil\n}\n\nfunc (x *ModuleInfo) GetCommit() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Commit != nil {\n\t\t\treturn *x.xxx_hidden_Commit\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleInfo) SetName(v *ModuleName) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *ModuleInfo) SetCommit(v string) {\n\tx.xxx_hidden_Commit = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)\n}\n\nfunc (x *ModuleInfo) HasName() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Name != nil\n}\n\nfunc (x *ModuleInfo) HasCommit() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *ModuleInfo) ClearName() {\n\tx.xxx_hidden_Name = nil\n}\n\nfunc (x *ModuleInfo) ClearCommit() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_Commit = nil\n}\n\ntype ModuleInfo_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// name is the name of the Buf module.\n\t//\n\t// This will always be set.\n\tName *ModuleName\n\t// commit is the repository commit.\n\t//\n\t// This field is optional and will not be set if the commit is not known.\n\tCommit *string\n}\n\nfunc (b0 ModuleInfo_builder) Build() *ModuleInfo {\n\tm0 := &ModuleInfo{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tif b.Commit != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)\n\t\tx.xxx_hidden_Commit = b.Commit\n\t}\n\treturn m0\n}\n\n// ModuleName is a module name.\n//\n// All fields will always be set.\ntype ModuleName struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Remote      *string                `protobuf:\"bytes,1,opt,name=remote\"`\n\txxx_hidden_Owner       *string                `protobuf:\"bytes,2,opt,name=owner\"`\n\txxx_hidden_Repository  *string                `protobuf:\"bytes,3,opt,name=repository\"`\n\tXXX_raceDetectHookData protoimpl.RaceDetectHookData\n\tXXX_presence           [1]uint32\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *ModuleName) Reset() {\n\t*x = ModuleName{}\n\tmi := &file_buf_alpha_image_v1_image_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModuleName) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModuleName) ProtoMessage() {}\n\nfunc (x *ModuleName) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_image_v1_image_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\nfunc (x *ModuleName) GetRemote() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Remote != nil {\n\t\t\treturn *x.xxx_hidden_Remote\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleName) GetOwner() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Owner != nil {\n\t\t\treturn *x.xxx_hidden_Owner\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleName) GetRepository() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Repository != nil {\n\t\t\treturn *x.xxx_hidden_Repository\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleName) SetRemote(v string) {\n\tx.xxx_hidden_Remote = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3)\n}\n\nfunc (x *ModuleName) SetOwner(v string) {\n\tx.xxx_hidden_Owner = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3)\n}\n\nfunc (x *ModuleName) SetRepository(v string) {\n\tx.xxx_hidden_Repository = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3)\n}\n\nfunc (x *ModuleName) HasRemote() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 0)\n}\n\nfunc (x *ModuleName) HasOwner() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *ModuleName) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *ModuleName) ClearRemote() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)\n\tx.xxx_hidden_Remote = nil\n}\n\nfunc (x *ModuleName) ClearOwner() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_Owner = nil\n}\n\nfunc (x *ModuleName) ClearRepository() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_Repository = nil\n}\n\ntype ModuleName_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRemote     *string\n\tOwner      *string\n\tRepository *string\n}\n\nfunc (b0 ModuleName_builder) Build() *ModuleName {\n\tm0 := &ModuleName{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Remote != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3)\n\t\tx.xxx_hidden_Remote = b.Remote\n\t}\n\tif b.Owner != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3)\n\t\tx.xxx_hidden_Owner = b.Owner\n\t}\n\tif b.Repository != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3)\n\t\tx.xxx_hidden_Repository = b.Repository\n\t}\n\treturn m0\n}\n\nvar File_buf_alpha_image_v1_image_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_image_v1_image_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"\\x1ebuf/alpha/image/v1/image.proto\\x12\\x12buf.alpha.image.v1\\x1a google/protobuf/descriptor.proto\\\":\\n\" +\n\t\"\\x05Image\\x121\\n\" +\n\t\"\\x04file\\x18\\x01 \\x03(\\v2\\x1d.buf.alpha.image.v1.ImageFileR\\x04file\\\"\\xdc\\x05\\n\" +\n\t\"\\tImageFile\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x18\\n\" +\n\t\"\\apackage\\x18\\x02 \\x01(\\tR\\apackage\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"dependency\\x18\\x03 \\x03(\\tR\\n\" +\n\t\"dependency\\x12+\\n\" +\n\t\"\\x11public_dependency\\x18\\n\" +\n\t\" \\x03(\\x05R\\x10publicDependency\\x12'\\n\" +\n\t\"\\x0fweak_dependency\\x18\\v \\x03(\\x05R\\x0eweakDependency\\x12C\\n\" +\n\t\"\\fmessage_type\\x18\\x04 \\x03(\\v2 .google.protobuf.DescriptorProtoR\\vmessageType\\x12A\\n\" +\n\t\"\\tenum_type\\x18\\x05 \\x03(\\v2$.google.protobuf.EnumDescriptorProtoR\\benumType\\x12A\\n\" +\n\t\"\\aservice\\x18\\x06 \\x03(\\v2'.google.protobuf.ServiceDescriptorProtoR\\aservice\\x12C\\n\" +\n\t\"\\textension\\x18\\a \\x03(\\v2%.google.protobuf.FieldDescriptorProtoR\\textension\\x126\\n\" +\n\t\"\\aoptions\\x18\\b \\x01(\\v2\\x1c.google.protobuf.FileOptionsR\\aoptions\\x12I\\n\" +\n\t\"\\x10source_code_info\\x18\\t \\x01(\\v2\\x1f.google.protobuf.SourceCodeInfoR\\x0esourceCodeInfo\\x12\\x16\\n\" +\n\t\"\\x06syntax\\x18\\f \\x01(\\tR\\x06syntax\\x122\\n\" +\n\t\"\\aedition\\x18\\x0e \\x01(\\x0e2\\x18.google.protobuf.EditionR\\aedition\\x12L\\n\" +\n\t\"\\rbuf_extension\\x18\\xea> \\x01(\\v2&.buf.alpha.image.v1.ImageFileExtensionR\\fbufExtension\\\"\\xd3\\x01\\n\" +\n\t\"\\x12ImageFileExtension\\x12\\x1b\\n\" +\n\t\"\\tis_import\\x18\\x01 \\x01(\\bR\\bisImport\\x12?\\n\" +\n\t\"\\vmodule_info\\x18\\x02 \\x01(\\v2\\x1e.buf.alpha.image.v1.ModuleInfoR\\n\" +\n\t\"moduleInfo\\x122\\n\" +\n\t\"\\x15is_syntax_unspecified\\x18\\x03 \\x01(\\bR\\x13isSyntaxUnspecified\\x12+\\n\" +\n\t\"\\x11unused_dependency\\x18\\x04 \\x03(\\x05R\\x10unusedDependency\\\"X\\n\" +\n\t\"\\n\" +\n\t\"ModuleInfo\\x122\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\v2\\x1e.buf.alpha.image.v1.ModuleNameR\\x04name\\x12\\x16\\n\" +\n\t\"\\x06commit\\x18\\x02 \\x01(\\tR\\x06commit\\\"Z\\n\" +\n\t\"\\n\" +\n\t\"ModuleName\\x12\\x16\\n\" +\n\t\"\\x06remote\\x18\\x01 \\x01(\\tR\\x06remote\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x02 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"repositoryB\\xdd\\x01\\n\" +\n\t\"\\x16com.buf.alpha.image.v1B\\n\" +\n\t\"ImageProtoH\\x01P\\x01ZGgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1;imagev1\\xf8\\x01\\x01\\xa2\\x02\\x03BAI\\xaa\\x02\\x12Buf.Alpha.Image.V1\\xca\\x02\\x12Buf\\\\Alpha\\\\Image\\\\V1\\xe2\\x02\\x1eBuf\\\\Alpha\\\\Image\\\\V1\\\\GPBMetadata\\xea\\x02\\x15Buf::Alpha::Image::V1\"\n\nvar file_buf_alpha_image_v1_image_proto_msgTypes = make([]protoimpl.MessageInfo, 5)\nvar file_buf_alpha_image_v1_image_proto_goTypes = []any{\n\t(*Image)(nil),                               // 0: buf.alpha.image.v1.Image\n\t(*ImageFile)(nil),                           // 1: buf.alpha.image.v1.ImageFile\n\t(*ImageFileExtension)(nil),                  // 2: buf.alpha.image.v1.ImageFileExtension\n\t(*ModuleInfo)(nil),                          // 3: buf.alpha.image.v1.ModuleInfo\n\t(*ModuleName)(nil),                          // 4: buf.alpha.image.v1.ModuleName\n\t(*descriptorpb.DescriptorProto)(nil),        // 5: google.protobuf.DescriptorProto\n\t(*descriptorpb.EnumDescriptorProto)(nil),    // 6: google.protobuf.EnumDescriptorProto\n\t(*descriptorpb.ServiceDescriptorProto)(nil), // 7: google.protobuf.ServiceDescriptorProto\n\t(*descriptorpb.FieldDescriptorProto)(nil),   // 8: google.protobuf.FieldDescriptorProto\n\t(*descriptorpb.FileOptions)(nil),            // 9: google.protobuf.FileOptions\n\t(*descriptorpb.SourceCodeInfo)(nil),         // 10: google.protobuf.SourceCodeInfo\n\t(descriptorpb.Edition)(0),                   // 11: google.protobuf.Edition\n}\nvar file_buf_alpha_image_v1_image_proto_depIdxs = []int32{\n\t1,  // 0: buf.alpha.image.v1.Image.file:type_name -> buf.alpha.image.v1.ImageFile\n\t5,  // 1: buf.alpha.image.v1.ImageFile.message_type:type_name -> google.protobuf.DescriptorProto\n\t6,  // 2: buf.alpha.image.v1.ImageFile.enum_type:type_name -> google.protobuf.EnumDescriptorProto\n\t7,  // 3: buf.alpha.image.v1.ImageFile.service:type_name -> google.protobuf.ServiceDescriptorProto\n\t8,  // 4: buf.alpha.image.v1.ImageFile.extension:type_name -> google.protobuf.FieldDescriptorProto\n\t9,  // 5: buf.alpha.image.v1.ImageFile.options:type_name -> google.protobuf.FileOptions\n\t10, // 6: buf.alpha.image.v1.ImageFile.source_code_info:type_name -> google.protobuf.SourceCodeInfo\n\t11, // 7: buf.alpha.image.v1.ImageFile.edition:type_name -> google.protobuf.Edition\n\t2,  // 8: buf.alpha.image.v1.ImageFile.buf_extension:type_name -> buf.alpha.image.v1.ImageFileExtension\n\t3,  // 9: buf.alpha.image.v1.ImageFileExtension.module_info:type_name -> buf.alpha.image.v1.ModuleInfo\n\t4,  // 10: buf.alpha.image.v1.ModuleInfo.name:type_name -> buf.alpha.image.v1.ModuleName\n\t11, // [11:11] is the sub-list for method output_type\n\t11, // [11:11] is the sub-list for method input_type\n\t11, // [11:11] is the sub-list for extension type_name\n\t11, // [11:11] is the sub-list for extension extendee\n\t0,  // [0:11] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_image_v1_image_proto_init() }\nfunc file_buf_alpha_image_v1_image_proto_init() {\n\tif File_buf_alpha_image_v1_image_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_buf_alpha_image_v1_image_proto_rawDesc), len(file_buf_alpha_image_v1_image_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_buf_alpha_image_v1_image_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_image_v1_image_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_image_v1_image_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_image_v1_image_proto = out.File\n\tfile_buf_alpha_image_v1_image_proto_goTypes = nil\n\tfile_buf_alpha_image_v1_image_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/image/v1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage imagev1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/lint/v1/config.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/lint/v1/config.proto\n\npackage lintv1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// Config represents the lint configuration for a module. The rule and category IDs are defined\n// by the version and apply across the config. The version is independent of the version of\n// the package. The package version refers to the config shape, the version encoded in the Config message\n// indicates which rule and category IDs should be used.\n//\n// The rule and category IDs are not encoded as enums in this package because we may want to support custom rule\n// and category IDs in the future. Callers will need to resolve the rule and category ID strings.\ntype Config struct {\n\tstate                                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version                              string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\txxx_hidden_UseIds                               []string               `protobuf:\"bytes,2,rep,name=use_ids,json=useIds,proto3\"`\n\txxx_hidden_ExceptIds                            []string               `protobuf:\"bytes,3,rep,name=except_ids,json=exceptIds,proto3\"`\n\txxx_hidden_IgnorePaths                          []string               `protobuf:\"bytes,4,rep,name=ignore_paths,json=ignorePaths,proto3\"`\n\txxx_hidden_IgnoreIdPaths                        *[]*IDPaths            `protobuf:\"bytes,5,rep,name=ignore_id_paths,json=ignoreIdPaths,proto3\"`\n\txxx_hidden_EnumZeroValueSuffix                  string                 `protobuf:\"bytes,6,opt,name=enum_zero_value_suffix,json=enumZeroValueSuffix,proto3\"`\n\txxx_hidden_RpcAllowSameRequestResponse          bool                   `protobuf:\"varint,7,opt,name=rpc_allow_same_request_response,json=rpcAllowSameRequestResponse,proto3\"`\n\txxx_hidden_RpcAllowGoogleProtobufEmptyRequests  bool                   `protobuf:\"varint,8,opt,name=rpc_allow_google_protobuf_empty_requests,json=rpcAllowGoogleProtobufEmptyRequests,proto3\"`\n\txxx_hidden_RpcAllowGoogleProtobufEmptyResponses bool                   `protobuf:\"varint,9,opt,name=rpc_allow_google_protobuf_empty_responses,json=rpcAllowGoogleProtobufEmptyResponses,proto3\"`\n\txxx_hidden_ServiceSuffix                        string                 `protobuf:\"bytes,10,opt,name=service_suffix,json=serviceSuffix,proto3\"`\n\txxx_hidden_AllowCommentIgnores                  bool                   `protobuf:\"varint,11,opt,name=allow_comment_ignores,json=allowCommentIgnores,proto3\"`\n\tunknownFields                                   protoimpl.UnknownFields\n\tsizeCache                                       protoimpl.SizeCache\n}\n\nfunc (x *Config) Reset() {\n\t*x = Config{}\n\tmi := &file_buf_alpha_lint_v1_config_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Config) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Config) ProtoMessage() {}\n\nfunc (x *Config) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_lint_v1_config_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\nfunc (x *Config) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *Config) GetUseIds() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UseIds\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetExceptIds() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExceptIds\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetIgnorePaths() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IgnorePaths\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetIgnoreIdPaths() []*IDPaths {\n\tif x != nil {\n\t\tif x.xxx_hidden_IgnoreIdPaths != nil {\n\t\t\treturn *x.xxx_hidden_IgnoreIdPaths\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Config) GetEnumZeroValueSuffix() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EnumZeroValueSuffix\n\t}\n\treturn \"\"\n}\n\nfunc (x *Config) GetRpcAllowSameRequestResponse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RpcAllowSameRequestResponse\n\t}\n\treturn false\n}\n\nfunc (x *Config) GetRpcAllowGoogleProtobufEmptyRequests() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RpcAllowGoogleProtobufEmptyRequests\n\t}\n\treturn false\n}\n\nfunc (x *Config) GetRpcAllowGoogleProtobufEmptyResponses() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RpcAllowGoogleProtobufEmptyResponses\n\t}\n\treturn false\n}\n\nfunc (x *Config) GetServiceSuffix() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ServiceSuffix\n\t}\n\treturn \"\"\n}\n\nfunc (x *Config) GetAllowCommentIgnores() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AllowCommentIgnores\n\t}\n\treturn false\n}\n\nfunc (x *Config) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *Config) SetUseIds(v []string) {\n\tx.xxx_hidden_UseIds = v\n}\n\nfunc (x *Config) SetExceptIds(v []string) {\n\tx.xxx_hidden_ExceptIds = v\n}\n\nfunc (x *Config) SetIgnorePaths(v []string) {\n\tx.xxx_hidden_IgnorePaths = v\n}\n\nfunc (x *Config) SetIgnoreIdPaths(v []*IDPaths) {\n\tx.xxx_hidden_IgnoreIdPaths = &v\n}\n\nfunc (x *Config) SetEnumZeroValueSuffix(v string) {\n\tx.xxx_hidden_EnumZeroValueSuffix = v\n}\n\nfunc (x *Config) SetRpcAllowSameRequestResponse(v bool) {\n\tx.xxx_hidden_RpcAllowSameRequestResponse = v\n}\n\nfunc (x *Config) SetRpcAllowGoogleProtobufEmptyRequests(v bool) {\n\tx.xxx_hidden_RpcAllowGoogleProtobufEmptyRequests = v\n}\n\nfunc (x *Config) SetRpcAllowGoogleProtobufEmptyResponses(v bool) {\n\tx.xxx_hidden_RpcAllowGoogleProtobufEmptyResponses = v\n}\n\nfunc (x *Config) SetServiceSuffix(v string) {\n\tx.xxx_hidden_ServiceSuffix = v\n}\n\nfunc (x *Config) SetAllowCommentIgnores(v bool) {\n\tx.xxx_hidden_AllowCommentIgnores = v\n}\n\ntype Config_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version represents the version of the lint rule and category IDs that should be used with this config.\n\tVersion string\n\t// use_ids lists the rule and/or category IDs that are included in the lint check.\n\tUseIds []string\n\t// except_ids lists the rule and/or category IDs that are excluded from the lint check.\n\tExceptIds []string\n\t// ignore_paths lists the paths of directories and/or files that should be ignored by the lint check.\n\t// All paths are relative to the root of the module.\n\tIgnorePaths []string\n\t// ignore_id_paths is a map of rule and/or category IDs to directory and/or file paths to exclude from the\n\t// lint check. This corresponds with the ignore_only configuration key.\n\tIgnoreIdPaths []*IDPaths\n\t// enum_zero_value_suffix controls the behavior of the ENUM_ZERO_VALUE lint rule ID. By default, this rule\n\t// verifies that the zero value of all enums ends in _UNSPECIFIED. This config allows the user to override\n\t// this value with the given string.\n\tEnumZeroValueSuffix string\n\t// rpc_allow_same_request_response allows the same message type for both the request and response of an RPC.\n\tRpcAllowSameRequestResponse bool\n\t// rpc_allow_google_protobuf_empty_requests allows the RPC requests to use the google.protobuf.Empty message.\n\tRpcAllowGoogleProtobufEmptyRequests bool\n\t// rpc_allow_google_protobuf_empty_responses allows the RPC responses to use the google.protobuf.Empty message.\n\tRpcAllowGoogleProtobufEmptyResponses bool\n\t// service_suffix applies to the SERVICE_SUFFIX rule ID. By default, the rule verifies that all service names\n\t// end with the suffix Service. This allows users to override the value with the given string.\n\tServiceSuffix string\n\t// allow_comment_ignores turns on comment-driven ignores.\n\tAllowCommentIgnores bool\n}\n\nfunc (b0 Config_builder) Build() *Config {\n\tm0 := &Config{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_UseIds = b.UseIds\n\tx.xxx_hidden_ExceptIds = b.ExceptIds\n\tx.xxx_hidden_IgnorePaths = b.IgnorePaths\n\tx.xxx_hidden_IgnoreIdPaths = &b.IgnoreIdPaths\n\tx.xxx_hidden_EnumZeroValueSuffix = b.EnumZeroValueSuffix\n\tx.xxx_hidden_RpcAllowSameRequestResponse = b.RpcAllowSameRequestResponse\n\tx.xxx_hidden_RpcAllowGoogleProtobufEmptyRequests = b.RpcAllowGoogleProtobufEmptyRequests\n\tx.xxx_hidden_RpcAllowGoogleProtobufEmptyResponses = b.RpcAllowGoogleProtobufEmptyResponses\n\tx.xxx_hidden_ServiceSuffix = b.ServiceSuffix\n\tx.xxx_hidden_AllowCommentIgnores = b.AllowCommentIgnores\n\treturn m0\n}\n\n// IDPaths represents a rule or category ID and the file and/or directory paths that are ignored for the rule.\ntype IDPaths struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id    string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Paths []string               `protobuf:\"bytes,2,rep,name=paths,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *IDPaths) Reset() {\n\t*x = IDPaths{}\n\tmi := &file_buf_alpha_lint_v1_config_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *IDPaths) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*IDPaths) ProtoMessage() {}\n\nfunc (x *IDPaths) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_lint_v1_config_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\nfunc (x *IDPaths) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *IDPaths) GetPaths() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Paths\n\t}\n\treturn nil\n}\n\nfunc (x *IDPaths) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *IDPaths) SetPaths(v []string) {\n\tx.xxx_hidden_Paths = v\n}\n\ntype IDPaths_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId    string\n\tPaths []string\n}\n\nfunc (b0 IDPaths_builder) Build() *IDPaths {\n\tm0 := &IDPaths{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Paths = b.Paths\n\treturn m0\n}\n\nvar File_buf_alpha_lint_v1_config_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_lint_v1_config_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"\\x1ebuf/alpha/lint/v1/config.proto\\x12\\x11buf.alpha.lint.v1\\\"\\xc7\\x04\\n\" +\n\t\"\\x06Config\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\x12\\x17\\n\" +\n\t\"\\ause_ids\\x18\\x02 \\x03(\\tR\\x06useIds\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"except_ids\\x18\\x03 \\x03(\\tR\\texceptIds\\x12!\\n\" +\n\t\"\\fignore_paths\\x18\\x04 \\x03(\\tR\\vignorePaths\\x12B\\n\" +\n\t\"\\x0fignore_id_paths\\x18\\x05 \\x03(\\v2\\x1a.buf.alpha.lint.v1.IDPathsR\\rignoreIdPaths\\x123\\n\" +\n\t\"\\x16enum_zero_value_suffix\\x18\\x06 \\x01(\\tR\\x13enumZeroValueSuffix\\x12D\\n\" +\n\t\"\\x1frpc_allow_same_request_response\\x18\\a \\x01(\\bR\\x1brpcAllowSameRequestResponse\\x12U\\n\" +\n\t\"(rpc_allow_google_protobuf_empty_requests\\x18\\b \\x01(\\bR#rpcAllowGoogleProtobufEmptyRequests\\x12W\\n\" +\n\t\")rpc_allow_google_protobuf_empty_responses\\x18\\t \\x01(\\bR$rpcAllowGoogleProtobufEmptyResponses\\x12%\\n\" +\n\t\"\\x0eservice_suffix\\x18\\n\" +\n\t\" \\x01(\\tR\\rserviceSuffix\\x122\\n\" +\n\t\"\\x15allow_comment_ignores\\x18\\v \\x01(\\bR\\x13allowCommentIgnores\\\"/\\n\" +\n\t\"\\aIDPaths\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x14\\n\" +\n\t\"\\x05paths\\x18\\x02 \\x03(\\tR\\x05pathsB\\xd2\\x01\\n\" +\n\t\"\\x15com.buf.alpha.lint.v1B\\vConfigProtoP\\x01ZEgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1;lintv1\\xa2\\x02\\x03BAL\\xaa\\x02\\x11Buf.Alpha.Lint.V1\\xca\\x02\\x11Buf\\\\Alpha\\\\Lint\\\\V1\\xe2\\x02\\x1dBuf\\\\Alpha\\\\Lint\\\\V1\\\\GPBMetadata\\xea\\x02\\x14Buf::Alpha::Lint::V1b\\x06proto3\"\n\nvar file_buf_alpha_lint_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_lint_v1_config_proto_goTypes = []any{\n\t(*Config)(nil),  // 0: buf.alpha.lint.v1.Config\n\t(*IDPaths)(nil), // 1: buf.alpha.lint.v1.IDPaths\n}\nvar file_buf_alpha_lint_v1_config_proto_depIdxs = []int32{\n\t1, // 0: buf.alpha.lint.v1.Config.ignore_id_paths:type_name -> buf.alpha.lint.v1.IDPaths\n\t1, // [1:1] is the sub-list for method output_type\n\t1, // [1:1] 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_buf_alpha_lint_v1_config_proto_init() }\nfunc file_buf_alpha_lint_v1_config_proto_init() {\n\tif File_buf_alpha_lint_v1_config_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_buf_alpha_lint_v1_config_proto_rawDesc), len(file_buf_alpha_lint_v1_config_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_buf_alpha_lint_v1_config_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_lint_v1_config_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_lint_v1_config_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_lint_v1_config_proto = out.File\n\tfile_buf_alpha_lint_v1_config_proto_goTypes = nil\n\tfile_buf_alpha_lint_v1_config_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/lint/v1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage lintv1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/module/v1alpha1/module.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/module/v1alpha1/module.proto\n\npackage modulev1alpha1\n\nimport (\n\tv1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1\"\n\tv11 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 DigestType int32\n\nconst (\n\tDigestType_DIGEST_TYPE_UNSPECIFIED DigestType = 0\n\tDigestType_DIGEST_TYPE_SHAKE256    DigestType = 1\n)\n\n// Enum value maps for DigestType.\nvar (\n\tDigestType_name = map[int32]string{\n\t\t0: \"DIGEST_TYPE_UNSPECIFIED\",\n\t\t1: \"DIGEST_TYPE_SHAKE256\",\n\t}\n\tDigestType_value = map[string]int32{\n\t\t\"DIGEST_TYPE_UNSPECIFIED\": 0,\n\t\t\"DIGEST_TYPE_SHAKE256\":    1,\n\t}\n)\n\nfunc (x DigestType) Enum() *DigestType {\n\tp := new(DigestType)\n\t*p = x\n\treturn p\n}\n\nfunc (x DigestType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (DigestType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_module_v1alpha1_module_proto_enumTypes[0].Descriptor()\n}\n\nfunc (DigestType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_module_v1alpha1_module_proto_enumTypes[0]\n}\n\nfunc (x DigestType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// Digest represents a hash function's value.\ntype Digest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_DigestType DigestType             `protobuf:\"varint,1,opt,name=digest_type,json=digestType,proto3,enum=buf.alpha.module.v1alpha1.DigestType\"`\n\txxx_hidden_Digest     []byte                 `protobuf:\"bytes,2,opt,name=digest,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *Digest) Reset() {\n\t*x = Digest{}\n\tmi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Digest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Digest) ProtoMessage() {}\n\nfunc (x *Digest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_module_v1alpha1_module_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\nfunc (x *Digest) GetDigestType() DigestType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DigestType\n\t}\n\treturn DigestType_DIGEST_TYPE_UNSPECIFIED\n}\n\nfunc (x *Digest) GetDigest() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Digest\n\t}\n\treturn nil\n}\n\nfunc (x *Digest) SetDigestType(v DigestType) {\n\tx.xxx_hidden_DigestType = v\n}\n\nfunc (x *Digest) SetDigest(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Digest = v\n}\n\ntype Digest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// digest_type describes the hash algorithm. e.g. \"SHAKE256\"\n\tDigestType DigestType\n\t// digest is the hash's output without encoding.\n\tDigest []byte\n}\n\nfunc (b0 Digest_builder) Build() *Digest {\n\tm0 := &Digest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_DigestType = b.DigestType\n\tx.xxx_hidden_Digest = b.Digest\n\treturn m0\n}\n\n// Blob represents some module content with an associated digest.\ntype Blob struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Digest  *Digest                `protobuf:\"bytes,1,opt,name=digest,proto3\"`\n\txxx_hidden_Content []byte                 `protobuf:\"bytes,2,opt,name=content,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *Blob) Reset() {\n\t*x = Blob{}\n\tmi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Blob) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Blob) ProtoMessage() {}\n\nfunc (x *Blob) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_module_v1alpha1_module_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\nfunc (x *Blob) GetDigest() *Digest {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Digest\n\t}\n\treturn nil\n}\n\nfunc (x *Blob) GetContent() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Content\n\t}\n\treturn nil\n}\n\nfunc (x *Blob) SetDigest(v *Digest) {\n\tx.xxx_hidden_Digest = v\n}\n\nfunc (x *Blob) SetContent(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Content = v\n}\n\nfunc (x *Blob) HasDigest() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Digest != nil\n}\n\nfunc (x *Blob) ClearDigest() {\n\tx.xxx_hidden_Digest = nil\n}\n\ntype Blob_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Digest of the content.\n\tDigest *Digest\n\t// Content of the blob.\n\tContent []byte\n}\n\nfunc (b0 Blob_builder) Build() *Blob {\n\tm0 := &Blob{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Digest = b.Digest\n\tx.xxx_hidden_Content = b.Content\n\treturn m0\n}\n\n// Module is a module.\ntype Module struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Files             *[]*ModuleFile         `protobuf:\"bytes,1,rep,name=files,proto3\"`\n\txxx_hidden_Dependencies      *[]*ModulePin          `protobuf:\"bytes,2,rep,name=dependencies,proto3\"`\n\txxx_hidden_Documentation     string                 `protobuf:\"bytes,3,opt,name=documentation,proto3\"`\n\txxx_hidden_BreakingConfig    *v1.Config             `protobuf:\"bytes,4,opt,name=breaking_config,json=breakingConfig,proto3\"`\n\txxx_hidden_LintConfig        *v11.Config            `protobuf:\"bytes,5,opt,name=lint_config,json=lintConfig,proto3\"`\n\txxx_hidden_License           string                 `protobuf:\"bytes,6,opt,name=license,proto3\"`\n\txxx_hidden_DocumentationPath string                 `protobuf:\"bytes,7,opt,name=documentation_path,json=documentationPath,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *Module) Reset() {\n\t*x = Module{}\n\tmi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Module) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Module) ProtoMessage() {}\n\nfunc (x *Module) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_module_v1alpha1_module_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\nfunc (x *Module) GetFiles() []*ModuleFile {\n\tif x != nil {\n\t\tif x.xxx_hidden_Files != nil {\n\t\t\treturn *x.xxx_hidden_Files\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Module) GetDependencies() []*ModulePin {\n\tif x != nil {\n\t\tif x.xxx_hidden_Dependencies != nil {\n\t\t\treturn *x.xxx_hidden_Dependencies\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Module) GetDocumentation() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Documentation\n\t}\n\treturn \"\"\n}\n\nfunc (x *Module) GetBreakingConfig() *v1.Config {\n\tif x != nil {\n\t\treturn x.xxx_hidden_BreakingConfig\n\t}\n\treturn nil\n}\n\nfunc (x *Module) GetLintConfig() *v11.Config {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LintConfig\n\t}\n\treturn nil\n}\n\nfunc (x *Module) GetLicense() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_License\n\t}\n\treturn \"\"\n}\n\nfunc (x *Module) GetDocumentationPath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DocumentationPath\n\t}\n\treturn \"\"\n}\n\nfunc (x *Module) SetFiles(v []*ModuleFile) {\n\tx.xxx_hidden_Files = &v\n}\n\nfunc (x *Module) SetDependencies(v []*ModulePin) {\n\tx.xxx_hidden_Dependencies = &v\n}\n\nfunc (x *Module) SetDocumentation(v string) {\n\tx.xxx_hidden_Documentation = v\n}\n\nfunc (x *Module) SetBreakingConfig(v *v1.Config) {\n\tx.xxx_hidden_BreakingConfig = v\n}\n\nfunc (x *Module) SetLintConfig(v *v11.Config) {\n\tx.xxx_hidden_LintConfig = v\n}\n\nfunc (x *Module) SetLicense(v string) {\n\tx.xxx_hidden_License = v\n}\n\nfunc (x *Module) SetDocumentationPath(v string) {\n\tx.xxx_hidden_DocumentationPath = v\n}\n\nfunc (x *Module) HasBreakingConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_BreakingConfig != nil\n}\n\nfunc (x *Module) HasLintConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_LintConfig != nil\n}\n\nfunc (x *Module) ClearBreakingConfig() {\n\tx.xxx_hidden_BreakingConfig = nil\n}\n\nfunc (x *Module) ClearLintConfig() {\n\tx.xxx_hidden_LintConfig = nil\n}\n\ntype Module_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// files are the files that make up the set.\n\t//\n\t// Sorted by path.\n\t// Path must be unique.\n\t// Only the target files. No imports.\n\t//\n\t// Maximum total size of all content: 32MB.\n\tFiles []*ModuleFile\n\t// dependencies are the dependencies.\n\tDependencies []*ModulePin\n\t// documentation is the string representation of the contents of the file at documentation_path.\n\t//\n\t// string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n\tDocumentation string\n\t// breaking_config is the breaking change detection configuration set for the module.\n\tBreakingConfig *v1.Config\n\t// lint_config is the lint configuration set for the module.\n\tLintConfig *v11.Config\n\t// license is the string representation of the contents of the `LICENSE` file.\n\t//\n\t// string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n\tLicense string\n\t// documentation_path is the path of the file which contains the module documentation.\n\t//\n\t// either `buf.md`, `README.md` or `README.markdown`.\n\t// if empty, assumes buf.md.\n\tDocumentationPath string\n}\n\nfunc (b0 Module_builder) Build() *Module {\n\tm0 := &Module{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Files = &b.Files\n\tx.xxx_hidden_Dependencies = &b.Dependencies\n\tx.xxx_hidden_Documentation = b.Documentation\n\tx.xxx_hidden_BreakingConfig = b.BreakingConfig\n\tx.xxx_hidden_LintConfig = b.LintConfig\n\tx.xxx_hidden_License = b.License\n\tx.xxx_hidden_DocumentationPath = b.DocumentationPath\n\treturn m0\n}\n\n// ModuleFile is a file within a FileSet.\ntype ModuleFile struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Path    string                 `protobuf:\"bytes,1,opt,name=path,proto3\"`\n\txxx_hidden_Content []byte                 `protobuf:\"bytes,2,opt,name=content,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *ModuleFile) Reset() {\n\t*x = ModuleFile{}\n\tmi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModuleFile) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModuleFile) ProtoMessage() {}\n\nfunc (x *ModuleFile) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_module_v1alpha1_module_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\nfunc (x *ModuleFile) GetPath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Path\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleFile) GetContent() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Content\n\t}\n\treturn nil\n}\n\nfunc (x *ModuleFile) SetPath(v string) {\n\tx.xxx_hidden_Path = v\n}\n\nfunc (x *ModuleFile) SetContent(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Content = v\n}\n\ntype ModuleFile_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// path is the relative path of the file.\n\t// Path can only use '/' as the separator character, and includes no \"..\" components.\n\tPath string\n\t// content is the content of the file.\n\tContent []byte\n}\n\nfunc (b0 ModuleFile_builder) Build() *ModuleFile {\n\tm0 := &ModuleFile{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Path = b.Path\n\tx.xxx_hidden_Content = b.Content\n\treturn m0\n}\n\n// ModuleReference is a module reference.\ntype ModuleReference struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Remote     string                 `protobuf:\"bytes,1,opt,name=remote,proto3\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,2,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,3,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,4,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *ModuleReference) Reset() {\n\t*x = ModuleReference{}\n\tmi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModuleReference) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModuleReference) ProtoMessage() {}\n\nfunc (x *ModuleReference) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_module_v1alpha1_module_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\nfunc (x *ModuleReference) GetRemote() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Remote\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleReference) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleReference) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleReference) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleReference) SetRemote(v string) {\n\tx.xxx_hidden_Remote = v\n}\n\nfunc (x *ModuleReference) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *ModuleReference) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *ModuleReference) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype ModuleReference_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRemote     string\n\tOwner      string\n\tRepository string\n\t// either tag, or commit\n\tReference string\n}\n\nfunc (b0 ModuleReference_builder) Build() *ModuleReference {\n\tm0 := &ModuleReference{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Remote = b.Remote\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\n// ModulePin is a module pin.\ntype ModulePin struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Remote         string                 `protobuf:\"bytes,1,opt,name=remote,proto3\"`\n\txxx_hidden_Owner          string                 `protobuf:\"bytes,2,opt,name=owner,proto3\"`\n\txxx_hidden_Repository     string                 `protobuf:\"bytes,3,opt,name=repository,proto3\"`\n\txxx_hidden_Commit         string                 `protobuf:\"bytes,5,opt,name=commit,proto3\"`\n\txxx_hidden_ManifestDigest string                 `protobuf:\"bytes,8,opt,name=manifest_digest,json=manifestDigest,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ModulePin) Reset() {\n\t*x = ModulePin{}\n\tmi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModulePin) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModulePin) ProtoMessage() {}\n\nfunc (x *ModulePin) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_module_v1alpha1_module_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\nfunc (x *ModulePin) GetRemote() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Remote\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModulePin) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModulePin) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModulePin) GetCommit() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModulePin) GetManifestDigest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ManifestDigest\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModulePin) SetRemote(v string) {\n\tx.xxx_hidden_Remote = v\n}\n\nfunc (x *ModulePin) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *ModulePin) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *ModulePin) SetCommit(v string) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *ModulePin) SetManifestDigest(v string) {\n\tx.xxx_hidden_ManifestDigest = v\n}\n\ntype ModulePin_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRemote     string\n\tOwner      string\n\tRepository string\n\tCommit     string\n\t// Module's manifest digest. Replacement for previous b1/b3 digests.\n\t// This is in the format '<digest_type>:<digest>`, where '<digest_type>' is the lowercase digest name ('shake256'),\n\t// and '<digest>' is the lowercase hex-encoded digest.\n\t// This value is persisted directly to the buf.lock file (https://buf.build/docs/configuration/v1/buf-lock) as the 'digest' key.\n\tManifestDigest string\n}\n\nfunc (b0 ModulePin_builder) Build() *ModulePin {\n\tm0 := &ModulePin{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Remote = b.Remote\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Commit = b.Commit\n\tx.xxx_hidden_ManifestDigest = b.ManifestDigest\n\treturn m0\n}\n\nvar File_buf_alpha_module_v1alpha1_module_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_module_v1alpha1_module_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"&buf/alpha/module/v1alpha1/module.proto\\x12\\x19buf.alpha.module.v1alpha1\\x1a\\\"buf/alpha/breaking/v1/config.proto\\x1a\\x1ebuf/alpha/lint/v1/config.proto\\\"h\\n\" +\n\t\"\\x06Digest\\x12F\\n\" +\n\t\"\\vdigest_type\\x18\\x01 \\x01(\\x0e2%.buf.alpha.module.v1alpha1.DigestTypeR\\n\" +\n\t\"digestType\\x12\\x16\\n\" +\n\t\"\\x06digest\\x18\\x02 \\x01(\\fR\\x06digest\\\"[\\n\" +\n\t\"\\x04Blob\\x129\\n\" +\n\t\"\\x06digest\\x18\\x01 \\x01(\\v2!.buf.alpha.module.v1alpha1.DigestR\\x06digest\\x12\\x18\\n\" +\n\t\"\\acontent\\x18\\x02 \\x01(\\fR\\acontent\\\"\\x82\\x03\\n\" +\n\t\"\\x06Module\\x12;\\n\" +\n\t\"\\x05files\\x18\\x01 \\x03(\\v2%.buf.alpha.module.v1alpha1.ModuleFileR\\x05files\\x12H\\n\" +\n\t\"\\fdependencies\\x18\\x02 \\x03(\\v2$.buf.alpha.module.v1alpha1.ModulePinR\\fdependencies\\x12$\\n\" +\n\t\"\\rdocumentation\\x18\\x03 \\x01(\\tR\\rdocumentation\\x12F\\n\" +\n\t\"\\x0fbreaking_config\\x18\\x04 \\x01(\\v2\\x1d.buf.alpha.breaking.v1.ConfigR\\x0ebreakingConfig\\x12:\\n\" +\n\t\"\\vlint_config\\x18\\x05 \\x01(\\v2\\x19.buf.alpha.lint.v1.ConfigR\\n\" +\n\t\"lintConfig\\x12\\x18\\n\" +\n\t\"\\alicense\\x18\\x06 \\x01(\\tR\\alicense\\x12-\\n\" +\n\t\"\\x12documentation_path\\x18\\a \\x01(\\tR\\x11documentationPath\\\":\\n\" +\n\t\"\\n\" +\n\t\"ModuleFile\\x12\\x12\\n\" +\n\t\"\\x04path\\x18\\x01 \\x01(\\tR\\x04path\\x12\\x18\\n\" +\n\t\"\\acontent\\x18\\x02 \\x01(\\fR\\acontent\\\"}\\n\" +\n\t\"\\x0fModuleReference\\x12\\x16\\n\" +\n\t\"\\x06remote\\x18\\x01 \\x01(\\tR\\x06remote\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x02 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x04 \\x01(\\tR\\treference\\\"\\xc9\\x01\\n\" +\n\t\"\\tModulePin\\x12\\x16\\n\" +\n\t\"\\x06remote\\x18\\x01 \\x01(\\tR\\x06remote\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x02 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x16\\n\" +\n\t\"\\x06commit\\x18\\x05 \\x01(\\tR\\x06commit\\x12'\\n\" +\n\t\"\\x0fmanifest_digest\\x18\\b \\x01(\\tR\\x0emanifestDigestJ\\x04\\b\\x04\\x10\\x05J\\x04\\b\\x06\\x10\\aJ\\x04\\b\\a\\x10\\bR\\x06branchR\\vcreate_timeR\\x06digest*C\\n\" +\n\t\"\\n\" +\n\t\"DigestType\\x12\\x1b\\n\" +\n\t\"\\x17DIGEST_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x18\\n\" +\n\t\"\\x14DIGEST_TYPE_SHAKE256\\x10\\x01B\\x8a\\x02\\n\" +\n\t\"\\x1dcom.buf.alpha.module.v1alpha1B\\vModuleProtoP\\x01ZUgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1;modulev1alpha1\\xa2\\x02\\x03BAM\\xaa\\x02\\x19Buf.Alpha.Module.V1alpha1\\xca\\x02\\x19Buf\\\\Alpha\\\\Module\\\\V1alpha1\\xe2\\x02%Buf\\\\Alpha\\\\Module\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1cBuf::Alpha::Module::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_module_v1alpha1_module_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_module_v1alpha1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 6)\nvar file_buf_alpha_module_v1alpha1_module_proto_goTypes = []any{\n\t(DigestType)(0),         // 0: buf.alpha.module.v1alpha1.DigestType\n\t(*Digest)(nil),          // 1: buf.alpha.module.v1alpha1.Digest\n\t(*Blob)(nil),            // 2: buf.alpha.module.v1alpha1.Blob\n\t(*Module)(nil),          // 3: buf.alpha.module.v1alpha1.Module\n\t(*ModuleFile)(nil),      // 4: buf.alpha.module.v1alpha1.ModuleFile\n\t(*ModuleReference)(nil), // 5: buf.alpha.module.v1alpha1.ModuleReference\n\t(*ModulePin)(nil),       // 6: buf.alpha.module.v1alpha1.ModulePin\n\t(*v1.Config)(nil),       // 7: buf.alpha.breaking.v1.Config\n\t(*v11.Config)(nil),      // 8: buf.alpha.lint.v1.Config\n}\nvar file_buf_alpha_module_v1alpha1_module_proto_depIdxs = []int32{\n\t0, // 0: buf.alpha.module.v1alpha1.Digest.digest_type:type_name -> buf.alpha.module.v1alpha1.DigestType\n\t1, // 1: buf.alpha.module.v1alpha1.Blob.digest:type_name -> buf.alpha.module.v1alpha1.Digest\n\t4, // 2: buf.alpha.module.v1alpha1.Module.files:type_name -> buf.alpha.module.v1alpha1.ModuleFile\n\t6, // 3: buf.alpha.module.v1alpha1.Module.dependencies:type_name -> buf.alpha.module.v1alpha1.ModulePin\n\t7, // 4: buf.alpha.module.v1alpha1.Module.breaking_config:type_name -> buf.alpha.breaking.v1.Config\n\t8, // 5: buf.alpha.module.v1alpha1.Module.lint_config:type_name -> buf.alpha.lint.v1.Config\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_buf_alpha_module_v1alpha1_module_proto_init() }\nfunc file_buf_alpha_module_v1alpha1_module_proto_init() {\n\tif File_buf_alpha_module_v1alpha1_module_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_buf_alpha_module_v1alpha1_module_proto_rawDesc), len(file_buf_alpha_module_v1alpha1_module_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   6,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_module_v1alpha1_module_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_module_v1alpha1_module_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_module_v1alpha1_module_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_module_v1alpha1_module_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_module_v1alpha1_module_proto = out.File\n\tfile_buf_alpha_module_v1alpha1_module_proto_goTypes = nil\n\tfile_buf_alpha_module_v1alpha1_module_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/module/v1alpha1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage modulev1alpha1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/admin.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/admin.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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\n// BreakingChangeCategory is the allowed list of categories for breaking rule settings.\ntype BreakingChangeCategory int32\n\nconst (\n\tBreakingChangeCategory_BREAKING_CHANGE_CATEGORY_UNSPECIFIED BreakingChangeCategory = 0\n\tBreakingChangeCategory_BREAKING_CHANGE_CATEGORY_FILE        BreakingChangeCategory = 1\n\tBreakingChangeCategory_BREAKING_CHANGE_CATEGORY_WIRE_JSON   BreakingChangeCategory = 2\n)\n\n// Enum value maps for BreakingChangeCategory.\nvar (\n\tBreakingChangeCategory_name = map[int32]string{\n\t\t0: \"BREAKING_CHANGE_CATEGORY_UNSPECIFIED\",\n\t\t1: \"BREAKING_CHANGE_CATEGORY_FILE\",\n\t\t2: \"BREAKING_CHANGE_CATEGORY_WIRE_JSON\",\n\t}\n\tBreakingChangeCategory_value = map[string]int32{\n\t\t\"BREAKING_CHANGE_CATEGORY_UNSPECIFIED\": 0,\n\t\t\"BREAKING_CHANGE_CATEGORY_FILE\":        1,\n\t\t\"BREAKING_CHANGE_CATEGORY_WIRE_JSON\":   2,\n\t}\n)\n\nfunc (x BreakingChangeCategory) Enum() *BreakingChangeCategory {\n\tp := new(BreakingChangeCategory)\n\t*p = x\n\treturn p\n}\n\nfunc (x BreakingChangeCategory) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (BreakingChangeCategory) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[0].Descriptor()\n}\n\nfunc (BreakingChangeCategory) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[0]\n}\n\nfunc (x BreakingChangeCategory) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// CollisionType is the type of collisions that can occur.\ntype CollisionType int32\n\nconst (\n\t// Unspecified collision type.\n\tCollisionType_COLLISION_TYPE_UNSPECIFIED CollisionType = 0\n\t// A fully qualified proto name\n\tCollisionType_COLLISION_TYPE_FULLY_QUALIFIED_NAME CollisionType = 1\n\t// A proto file path\n\tCollisionType_COLLISION_TYPE_PATH CollisionType = 2\n)\n\n// Enum value maps for CollisionType.\nvar (\n\tCollisionType_name = map[int32]string{\n\t\t0: \"COLLISION_TYPE_UNSPECIFIED\",\n\t\t1: \"COLLISION_TYPE_FULLY_QUALIFIED_NAME\",\n\t\t2: \"COLLISION_TYPE_PATH\",\n\t}\n\tCollisionType_value = map[string]int32{\n\t\t\"COLLISION_TYPE_UNSPECIFIED\":          0,\n\t\t\"COLLISION_TYPE_FULLY_QUALIFIED_NAME\": 1,\n\t\t\"COLLISION_TYPE_PATH\":                 2,\n\t}\n)\n\nfunc (x CollisionType) Enum() *CollisionType {\n\tp := new(CollisionType)\n\t*p = x\n\treturn p\n}\n\nfunc (x CollisionType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (CollisionType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[1].Descriptor()\n}\n\nfunc (CollisionType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[1]\n}\n\nfunc (x CollisionType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype BreakingChangePolicy struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Enabled                bool                   `protobuf:\"varint,1,opt,name=enabled,proto3,oneof\"`\n\txxx_hidden_IgnoreUnstablePackages bool                   `protobuf:\"varint,2,opt,name=ignore_unstable_packages,json=ignoreUnstablePackages,proto3,oneof\"`\n\txxx_hidden_Category               BreakingChangeCategory `protobuf:\"varint,3,opt,name=category,proto3,enum=buf.alpha.registry.v1alpha1.BreakingChangeCategory\"`\n\tXXX_raceDetectHookData            protoimpl.RaceDetectHookData\n\tXXX_presence                      [1]uint32\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *BreakingChangePolicy) Reset() {\n\t*x = BreakingChangePolicy{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *BreakingChangePolicy) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*BreakingChangePolicy) ProtoMessage() {}\n\nfunc (x *BreakingChangePolicy) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *BreakingChangePolicy) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Enabled\n\t}\n\treturn false\n}\n\nfunc (x *BreakingChangePolicy) GetIgnoreUnstablePackages() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IgnoreUnstablePackages\n\t}\n\treturn false\n}\n\nfunc (x *BreakingChangePolicy) GetCategory() BreakingChangeCategory {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Category\n\t}\n\treturn BreakingChangeCategory_BREAKING_CHANGE_CATEGORY_UNSPECIFIED\n}\n\nfunc (x *BreakingChangePolicy) SetEnabled(v bool) {\n\tx.xxx_hidden_Enabled = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3)\n}\n\nfunc (x *BreakingChangePolicy) SetIgnoreUnstablePackages(v bool) {\n\tx.xxx_hidden_IgnoreUnstablePackages = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3)\n}\n\nfunc (x *BreakingChangePolicy) SetCategory(v BreakingChangeCategory) {\n\tx.xxx_hidden_Category = v\n}\n\nfunc (x *BreakingChangePolicy) HasEnabled() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 0)\n}\n\nfunc (x *BreakingChangePolicy) HasIgnoreUnstablePackages() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *BreakingChangePolicy) ClearEnabled() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)\n\tx.xxx_hidden_Enabled = false\n}\n\nfunc (x *BreakingChangePolicy) ClearIgnoreUnstablePackages() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_IgnoreUnstablePackages = false\n}\n\ntype BreakingChangePolicy_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tEnabled                *bool\n\tIgnoreUnstablePackages *bool\n\tCategory               BreakingChangeCategory\n}\n\nfunc (b0 BreakingChangePolicy_builder) Build() *BreakingChangePolicy {\n\tm0 := &BreakingChangePolicy{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Enabled != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3)\n\t\tx.xxx_hidden_Enabled = *b.Enabled\n\t}\n\tif b.IgnoreUnstablePackages != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3)\n\t\tx.xxx_hidden_IgnoreUnstablePackages = *b.IgnoreUnstablePackages\n\t}\n\tx.xxx_hidden_Category = b.Category\n\treturn m0\n}\n\n// UniquenessPolicy is the policy for uniqueness on the server.\ntype UniquenessPolicy struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Enabled bool                   `protobuf:\"varint,1,opt,name=enabled,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *UniquenessPolicy) Reset() {\n\t*x = UniquenessPolicy{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UniquenessPolicy) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UniquenessPolicy) ProtoMessage() {}\n\nfunc (x *UniquenessPolicy) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *UniquenessPolicy) GetEnabled() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Enabled\n\t}\n\treturn false\n}\n\nfunc (x *UniquenessPolicy) SetEnabled(v bool) {\n\tx.xxx_hidden_Enabled = v\n}\n\ntype UniquenessPolicy_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Whether uniqueness policy is enforced.\n\tEnabled bool\n}\n\nfunc (b0 UniquenessPolicy_builder) Build() *UniquenessPolicy {\n\tm0 := &UniquenessPolicy{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Enabled = b.Enabled\n\treturn m0\n}\n\n// Collision is a collision that has occurred.\ntype Collision struct {\n\tstate                               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Reference                string                 `protobuf:\"bytes,1,opt,name=reference,proto3\"`\n\txxx_hidden_Type                     CollisionType          `protobuf:\"varint,2,opt,name=type,proto3,enum=buf.alpha.registry.v1alpha1.CollisionType\"`\n\txxx_hidden_Sources                  *[]*CollisionSource    `protobuf:\"bytes,3,rep,name=sources,proto3\"`\n\txxx_hidden_HasOtherCollisionSources bool                   `protobuf:\"varint,4,opt,name=has_other_collision_sources,json=hasOtherCollisionSources,proto3\"`\n\tunknownFields                       protoimpl.UnknownFields\n\tsizeCache                           protoimpl.SizeCache\n}\n\nfunc (x *Collision) Reset() {\n\t*x = Collision{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Collision) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Collision) ProtoMessage() {}\n\nfunc (x *Collision) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *Collision) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *Collision) GetType() CollisionType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Type\n\t}\n\treturn CollisionType_COLLISION_TYPE_UNSPECIFIED\n}\n\nfunc (x *Collision) GetSources() []*CollisionSource {\n\tif x != nil {\n\t\tif x.xxx_hidden_Sources != nil {\n\t\t\treturn *x.xxx_hidden_Sources\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Collision) GetHasOtherCollisionSources() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_HasOtherCollisionSources\n\t}\n\treturn false\n}\n\nfunc (x *Collision) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *Collision) SetType(v CollisionType) {\n\tx.xxx_hidden_Type = v\n}\n\nfunc (x *Collision) SetSources(v []*CollisionSource) {\n\tx.xxx_hidden_Sources = &v\n}\n\nfunc (x *Collision) SetHasOtherCollisionSources(v bool) {\n\tx.xxx_hidden_HasOtherCollisionSources = v\n}\n\ntype Collision_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The reference that has collisions.\n\tReference string\n\t// The type of collision.\n\tType CollisionType\n\t// The sources of the collision that the user is authorized to see.\n\tSources []*CollisionSource\n\t// Whether there are other collision sources that the user is not authorized to see.\n\t// The user should contact a server admin for more information about these collisions.\n\tHasOtherCollisionSources bool\n}\n\nfunc (b0 Collision_builder) Build() *Collision {\n\tm0 := &Collision{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_Type = b.Type\n\tx.xxx_hidden_Sources = &b.Sources\n\tx.xxx_hidden_HasOtherCollisionSources = b.HasOtherCollisionSources\n\treturn m0\n}\n\n// CollisionSource is the source of a collision\ntype CollisionSource struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,1,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Path           string                 `protobuf:\"bytes,3,opt,name=path,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *CollisionSource) Reset() {\n\t*x = CollisionSource{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CollisionSource) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CollisionSource) ProtoMessage() {}\n\nfunc (x *CollisionSource) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *CollisionSource) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *CollisionSource) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *CollisionSource) GetPath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Path\n\t}\n\treturn \"\"\n}\n\nfunc (x *CollisionSource) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *CollisionSource) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *CollisionSource) SetPath(v string) {\n\tx.xxx_hidden_Path = v\n}\n\ntype CollisionSource_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the owner of the source.\n\tOwnerName string\n\t// The name of the repository of the source.\n\tRepositoryName string\n\t// The path of the file that is the source of the collision.\n\tPath string\n}\n\nfunc (b0 CollisionSource_builder) Build() *CollisionSource {\n\tm0 := &CollisionSource{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Path = b.Path\n\treturn m0\n}\n\n// MonthlyUsage contains the total amount of message, enum and services types\n// for every organizations repositories within a single tenant BSR instance\n// for a given month and year.\ntype MonthlyUsage struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Month             uint32                 `protobuf:\"varint,1,opt,name=month,proto3\"`\n\txxx_hidden_Year              uint32                 `protobuf:\"varint,2,opt,name=year,proto3\"`\n\txxx_hidden_TotalMessageTypes uint32                 `protobuf:\"varint,3,opt,name=total_message_types,json=totalMessageTypes,proto3\"`\n\txxx_hidden_TotalEnumTypes    uint32                 `protobuf:\"varint,4,opt,name=total_enum_types,json=totalEnumTypes,proto3\"`\n\txxx_hidden_TotalMethodTypes  uint32                 `protobuf:\"varint,5,opt,name=total_method_types,json=totalMethodTypes,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *MonthlyUsage) Reset() {\n\t*x = MonthlyUsage{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MonthlyUsage) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MonthlyUsage) ProtoMessage() {}\n\nfunc (x *MonthlyUsage) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *MonthlyUsage) GetMonth() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Month\n\t}\n\treturn 0\n}\n\nfunc (x *MonthlyUsage) GetYear() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Year\n\t}\n\treturn 0\n}\n\nfunc (x *MonthlyUsage) GetTotalMessageTypes() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TotalMessageTypes\n\t}\n\treturn 0\n}\n\nfunc (x *MonthlyUsage) GetTotalEnumTypes() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TotalEnumTypes\n\t}\n\treturn 0\n}\n\nfunc (x *MonthlyUsage) GetTotalMethodTypes() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TotalMethodTypes\n\t}\n\treturn 0\n}\n\nfunc (x *MonthlyUsage) SetMonth(v uint32) {\n\tx.xxx_hidden_Month = v\n}\n\nfunc (x *MonthlyUsage) SetYear(v uint32) {\n\tx.xxx_hidden_Year = v\n}\n\nfunc (x *MonthlyUsage) SetTotalMessageTypes(v uint32) {\n\tx.xxx_hidden_TotalMessageTypes = v\n}\n\nfunc (x *MonthlyUsage) SetTotalEnumTypes(v uint32) {\n\tx.xxx_hidden_TotalEnumTypes = v\n}\n\nfunc (x *MonthlyUsage) SetTotalMethodTypes(v uint32) {\n\tx.xxx_hidden_TotalMethodTypes = v\n}\n\ntype MonthlyUsage_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The month, between 1 and 12.\n\tMonth uint32\n\t// The year, between 2020 and the current year.\n\tYear uint32\n\t// The total amount of message types for the month and year.\n\tTotalMessageTypes uint32\n\t// The total amount of enum types for the month and year.\n\tTotalEnumTypes uint32\n\t// The total amount of method types for the month and year.\n\tTotalMethodTypes uint32\n}\n\nfunc (b0 MonthlyUsage_builder) Build() *MonthlyUsage {\n\tm0 := &MonthlyUsage{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Month = b.Month\n\tx.xxx_hidden_Year = b.Year\n\tx.xxx_hidden_TotalMessageTypes = b.TotalMessageTypes\n\tx.xxx_hidden_TotalEnumTypes = b.TotalEnumTypes\n\tx.xxx_hidden_TotalMethodTypes = b.TotalMethodTypes\n\treturn m0\n}\n\ntype ForceDeleteUserRequest struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserId string                 `protobuf:\"bytes,1,opt,name=user_id,json=userId,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *ForceDeleteUserRequest) Reset() {\n\t*x = ForceDeleteUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ForceDeleteUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ForceDeleteUserRequest) ProtoMessage() {}\n\nfunc (x *ForceDeleteUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *ForceDeleteUserRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ForceDeleteUserRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\ntype ForceDeleteUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUserId string\n}\n\nfunc (b0 ForceDeleteUserRequest_builder) Build() *ForceDeleteUserRequest {\n\tm0 := &ForceDeleteUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserId = b.UserId\n\treturn m0\n}\n\ntype ForceDeleteUserResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User          *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\txxx_hidden_Organizations *[]*Organization       `protobuf:\"bytes,2,rep,name=organizations,proto3\"`\n\txxx_hidden_Repositories  *[]*Repository         `protobuf:\"bytes,3,rep,name=repositories,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ForceDeleteUserResponse) Reset() {\n\t*x = ForceDeleteUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ForceDeleteUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ForceDeleteUserResponse) ProtoMessage() {}\n\nfunc (x *ForceDeleteUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *ForceDeleteUserResponse) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *ForceDeleteUserResponse) GetOrganizations() []*Organization {\n\tif x != nil {\n\t\tif x.xxx_hidden_Organizations != nil {\n\t\t\treturn *x.xxx_hidden_Organizations\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ForceDeleteUserResponse) GetRepositories() []*Repository {\n\tif x != nil {\n\t\tif x.xxx_hidden_Repositories != nil {\n\t\t\treturn *x.xxx_hidden_Repositories\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ForceDeleteUserResponse) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *ForceDeleteUserResponse) SetOrganizations(v []*Organization) {\n\tx.xxx_hidden_Organizations = &v\n}\n\nfunc (x *ForceDeleteUserResponse) SetRepositories(v []*Repository) {\n\tx.xxx_hidden_Repositories = &v\n}\n\nfunc (x *ForceDeleteUserResponse) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *ForceDeleteUserResponse) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype ForceDeleteUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The deleted user.\n\tUser *User\n\t// The deleted organizations.\n\tOrganizations []*Organization\n\t// The deleted repositories.\n\tRepositories []*Repository\n}\n\nfunc (b0 ForceDeleteUserResponse_builder) Build() *ForceDeleteUserResponse {\n\tm0 := &ForceDeleteUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\tx.xxx_hidden_Organizations = &b.Organizations\n\tx.xxx_hidden_Repositories = &b.Repositories\n\treturn m0\n}\n\ntype UpdateUserVerificationStatusRequest struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserId             string                 `protobuf:\"bytes,1,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_VerificationStatus VerificationStatus     `protobuf:\"varint,2,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *UpdateUserVerificationStatusRequest) Reset() {\n\t*x = UpdateUserVerificationStatusRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUserVerificationStatusRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUserVerificationStatusRequest) ProtoMessage() {}\n\nfunc (x *UpdateUserVerificationStatusRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\nfunc (x *UpdateUserVerificationStatusRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateUserVerificationStatusRequest) GetVerificationStatus() VerificationStatus {\n\tif x != nil {\n\t\treturn x.xxx_hidden_VerificationStatus\n\t}\n\treturn VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED\n}\n\nfunc (x *UpdateUserVerificationStatusRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *UpdateUserVerificationStatusRequest) SetVerificationStatus(v VerificationStatus) {\n\tx.xxx_hidden_VerificationStatus = v\n}\n\ntype UpdateUserVerificationStatusRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUserId             string\n\tVerificationStatus VerificationStatus\n}\n\nfunc (b0 UpdateUserVerificationStatusRequest_builder) Build() *UpdateUserVerificationStatusRequest {\n\tm0 := &UpdateUserVerificationStatusRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_VerificationStatus = b.VerificationStatus\n\treturn m0\n}\n\ntype UpdateUserVerificationStatusResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateUserVerificationStatusResponse) Reset() {\n\t*x = UpdateUserVerificationStatusResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUserVerificationStatusResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUserVerificationStatusResponse) ProtoMessage() {}\n\nfunc (x *UpdateUserVerificationStatusResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_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\ntype UpdateUserVerificationStatusResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateUserVerificationStatusResponse_builder) Build() *UpdateUserVerificationStatusResponse {\n\tm0 := &UpdateUserVerificationStatusResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype UpdateOrganizationVerificationStatusRequest struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId     string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_VerificationStatus VerificationStatus     `protobuf:\"varint,2,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationVerificationStatusRequest) Reset() {\n\t*x = UpdateOrganizationVerificationStatusRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationVerificationStatusRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationVerificationStatusRequest) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationVerificationStatusRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[9]\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\nfunc (x *UpdateOrganizationVerificationStatusRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationVerificationStatusRequest) GetVerificationStatus() VerificationStatus {\n\tif x != nil {\n\t\treturn x.xxx_hidden_VerificationStatus\n\t}\n\treturn VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED\n}\n\nfunc (x *UpdateOrganizationVerificationStatusRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *UpdateOrganizationVerificationStatusRequest) SetVerificationStatus(v VerificationStatus) {\n\tx.xxx_hidden_VerificationStatus = v\n}\n\ntype UpdateOrganizationVerificationStatusRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganizationId     string\n\tVerificationStatus VerificationStatus\n}\n\nfunc (b0 UpdateOrganizationVerificationStatusRequest_builder) Build() *UpdateOrganizationVerificationStatusRequest {\n\tm0 := &UpdateOrganizationVerificationStatusRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_VerificationStatus = b.VerificationStatus\n\treturn m0\n}\n\ntype UpdateOrganizationVerificationStatusResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationVerificationStatusResponse) Reset() {\n\t*x = UpdateOrganizationVerificationStatusResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationVerificationStatusResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationVerificationStatusResponse) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationVerificationStatusResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[10]\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\ntype UpdateOrganizationVerificationStatusResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateOrganizationVerificationStatusResponse_builder) Build() *UpdateOrganizationVerificationStatusResponse {\n\tm0 := &UpdateOrganizationVerificationStatusResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype CreateMachineUserRequest struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Username string                 `protobuf:\"bytes,1,opt,name=username,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *CreateMachineUserRequest) Reset() {\n\t*x = CreateMachineUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateMachineUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateMachineUserRequest) ProtoMessage() {}\n\nfunc (x *CreateMachineUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[11]\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\nfunc (x *CreateMachineUserRequest) GetUsername() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateMachineUserRequest) SetUsername(v string) {\n\tx.xxx_hidden_Username = v\n}\n\ntype CreateMachineUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUsername string\n}\n\nfunc (b0 CreateMachineUserRequest_builder) Build() *CreateMachineUserRequest {\n\tm0 := &CreateMachineUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Username = b.Username\n\treturn m0\n}\n\ntype CreateMachineUserResponse struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *CreateMachineUserResponse) Reset() {\n\t*x = CreateMachineUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateMachineUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateMachineUserResponse) ProtoMessage() {}\n\nfunc (x *CreateMachineUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[12]\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\nfunc (x *CreateMachineUserResponse) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *CreateMachineUserResponse) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *CreateMachineUserResponse) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *CreateMachineUserResponse) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype CreateMachineUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUser *User\n}\n\nfunc (b0 CreateMachineUserResponse_builder) Build() *CreateMachineUserResponse {\n\tm0 := &CreateMachineUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\treturn m0\n}\n\ntype GetBreakingChangePolicyRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetBreakingChangePolicyRequest) Reset() {\n\t*x = GetBreakingChangePolicyRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetBreakingChangePolicyRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetBreakingChangePolicyRequest) ProtoMessage() {}\n\nfunc (x *GetBreakingChangePolicyRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[13]\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\ntype GetBreakingChangePolicyRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 GetBreakingChangePolicyRequest_builder) Build() *GetBreakingChangePolicyRequest {\n\tm0 := &GetBreakingChangePolicyRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetBreakingChangePolicyResponse struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Policy *BreakingChangePolicy  `protobuf:\"bytes,1,opt,name=policy,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *GetBreakingChangePolicyResponse) Reset() {\n\t*x = GetBreakingChangePolicyResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetBreakingChangePolicyResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetBreakingChangePolicyResponse) ProtoMessage() {}\n\nfunc (x *GetBreakingChangePolicyResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[14]\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\nfunc (x *GetBreakingChangePolicyResponse) GetPolicy() *BreakingChangePolicy {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Policy\n\t}\n\treturn nil\n}\n\nfunc (x *GetBreakingChangePolicyResponse) SetPolicy(v *BreakingChangePolicy) {\n\tx.xxx_hidden_Policy = v\n}\n\nfunc (x *GetBreakingChangePolicyResponse) HasPolicy() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Policy != nil\n}\n\nfunc (x *GetBreakingChangePolicyResponse) ClearPolicy() {\n\tx.xxx_hidden_Policy = nil\n}\n\ntype GetBreakingChangePolicyResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPolicy *BreakingChangePolicy\n}\n\nfunc (b0 GetBreakingChangePolicyResponse_builder) Build() *GetBreakingChangePolicyResponse {\n\tm0 := &GetBreakingChangePolicyResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Policy = b.Policy\n\treturn m0\n}\n\ntype UpdateBreakingChangePolicyRequest struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Policy *BreakingChangePolicy  `protobuf:\"bytes,1,opt,name=policy,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *UpdateBreakingChangePolicyRequest) Reset() {\n\t*x = UpdateBreakingChangePolicyRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateBreakingChangePolicyRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateBreakingChangePolicyRequest) ProtoMessage() {}\n\nfunc (x *UpdateBreakingChangePolicyRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[15]\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\nfunc (x *UpdateBreakingChangePolicyRequest) GetPolicy() *BreakingChangePolicy {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Policy\n\t}\n\treturn nil\n}\n\nfunc (x *UpdateBreakingChangePolicyRequest) SetPolicy(v *BreakingChangePolicy) {\n\tx.xxx_hidden_Policy = v\n}\n\nfunc (x *UpdateBreakingChangePolicyRequest) HasPolicy() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Policy != nil\n}\n\nfunc (x *UpdateBreakingChangePolicyRequest) ClearPolicy() {\n\tx.xxx_hidden_Policy = nil\n}\n\ntype UpdateBreakingChangePolicyRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPolicy *BreakingChangePolicy\n}\n\nfunc (b0 UpdateBreakingChangePolicyRequest_builder) Build() *UpdateBreakingChangePolicyRequest {\n\tm0 := &UpdateBreakingChangePolicyRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Policy = b.Policy\n\treturn m0\n}\n\ntype UpdateBreakingChangePolicyResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateBreakingChangePolicyResponse) Reset() {\n\t*x = UpdateBreakingChangePolicyResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateBreakingChangePolicyResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateBreakingChangePolicyResponse) ProtoMessage() {}\n\nfunc (x *UpdateBreakingChangePolicyResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[16]\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\ntype UpdateBreakingChangePolicyResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateBreakingChangePolicyResponse_builder) Build() *UpdateBreakingChangePolicyResponse {\n\tm0 := &UpdateBreakingChangePolicyResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetUniquenessPolicyRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetUniquenessPolicyRequest) Reset() {\n\t*x = GetUniquenessPolicyRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUniquenessPolicyRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUniquenessPolicyRequest) ProtoMessage() {}\n\nfunc (x *GetUniquenessPolicyRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[17]\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\ntype GetUniquenessPolicyRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 GetUniquenessPolicyRequest_builder) Build() *GetUniquenessPolicyRequest {\n\tm0 := &GetUniquenessPolicyRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetUniquenessPolicyResponse struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Policy               *UniquenessPolicy      `protobuf:\"bytes,1,opt,name=policy,proto3\"`\n\txxx_hidden_BackfillTaskComplete bool                   `protobuf:\"varint,2,opt,name=backfill_task_complete,json=backfillTaskComplete,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *GetUniquenessPolicyResponse) Reset() {\n\t*x = GetUniquenessPolicyResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUniquenessPolicyResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUniquenessPolicyResponse) ProtoMessage() {}\n\nfunc (x *GetUniquenessPolicyResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[18]\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\nfunc (x *GetUniquenessPolicyResponse) GetPolicy() *UniquenessPolicy {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Policy\n\t}\n\treturn nil\n}\n\nfunc (x *GetUniquenessPolicyResponse) GetBackfillTaskComplete() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_BackfillTaskComplete\n\t}\n\treturn false\n}\n\nfunc (x *GetUniquenessPolicyResponse) SetPolicy(v *UniquenessPolicy) {\n\tx.xxx_hidden_Policy = v\n}\n\nfunc (x *GetUniquenessPolicyResponse) SetBackfillTaskComplete(v bool) {\n\tx.xxx_hidden_BackfillTaskComplete = v\n}\n\nfunc (x *GetUniquenessPolicyResponse) HasPolicy() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Policy != nil\n}\n\nfunc (x *GetUniquenessPolicyResponse) ClearPolicy() {\n\tx.xxx_hidden_Policy = nil\n}\n\ntype GetUniquenessPolicyResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The current uniqueness policy settings.\n\tPolicy *UniquenessPolicy\n\t// Reports the status of the backfill task, which can be executed by the server admin with the\n\t// RunServerUniquenessBackfillTask RPC.\n\tBackfillTaskComplete bool\n}\n\nfunc (b0 GetUniquenessPolicyResponse_builder) Build() *GetUniquenessPolicyResponse {\n\tm0 := &GetUniquenessPolicyResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Policy = b.Policy\n\tx.xxx_hidden_BackfillTaskComplete = b.BackfillTaskComplete\n\treturn m0\n}\n\ntype UpdateUniquenessPolicyRequest struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Policy *UniquenessPolicy      `protobuf:\"bytes,1,opt,name=policy,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *UpdateUniquenessPolicyRequest) Reset() {\n\t*x = UpdateUniquenessPolicyRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUniquenessPolicyRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUniquenessPolicyRequest) ProtoMessage() {}\n\nfunc (x *UpdateUniquenessPolicyRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[19]\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\nfunc (x *UpdateUniquenessPolicyRequest) GetPolicy() *UniquenessPolicy {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Policy\n\t}\n\treturn nil\n}\n\nfunc (x *UpdateUniquenessPolicyRequest) SetPolicy(v *UniquenessPolicy) {\n\tx.xxx_hidden_Policy = v\n}\n\nfunc (x *UpdateUniquenessPolicyRequest) HasPolicy() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Policy != nil\n}\n\nfunc (x *UpdateUniquenessPolicyRequest) ClearPolicy() {\n\tx.xxx_hidden_Policy = nil\n}\n\ntype UpdateUniquenessPolicyRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPolicy *UniquenessPolicy\n}\n\nfunc (b0 UpdateUniquenessPolicyRequest_builder) Build() *UpdateUniquenessPolicyRequest {\n\tm0 := &UpdateUniquenessPolicyRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Policy = b.Policy\n\treturn m0\n}\n\ntype UpdateUniquenessPolicyResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateUniquenessPolicyResponse) Reset() {\n\t*x = UpdateUniquenessPolicyResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUniquenessPolicyResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUniquenessPolicyResponse) ProtoMessage() {}\n\nfunc (x *UpdateUniquenessPolicyResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[20]\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\ntype UpdateUniquenessPolicyResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateUniquenessPolicyResponse_builder) Build() *UpdateUniquenessPolicyResponse {\n\tm0 := &UpdateUniquenessPolicyResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype ListServerUniquenessCollisionsRequest struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageToken     string                 `protobuf:\"bytes,1,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_PageSize      uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_CollisionType CollisionType          `protobuf:\"varint,3,opt,name=collision_type,json=collisionType,proto3,enum=buf.alpha.registry.v1alpha1.CollisionType\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListServerUniquenessCollisionsRequest) Reset() {\n\t*x = ListServerUniquenessCollisionsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListServerUniquenessCollisionsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListServerUniquenessCollisionsRequest) ProtoMessage() {}\n\nfunc (x *ListServerUniquenessCollisionsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[21]\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\nfunc (x *ListServerUniquenessCollisionsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListServerUniquenessCollisionsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListServerUniquenessCollisionsRequest) GetCollisionType() CollisionType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CollisionType\n\t}\n\treturn CollisionType_COLLISION_TYPE_UNSPECIFIED\n}\n\nfunc (x *ListServerUniquenessCollisionsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListServerUniquenessCollisionsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListServerUniquenessCollisionsRequest) SetCollisionType(v CollisionType) {\n\tx.xxx_hidden_CollisionType = v\n}\n\ntype ListServerUniquenessCollisionsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Token of the page to retrieve. If not specified, the first page of\n\t// results will be returned. Use the value obtained from `next_page_token`\n\t// in the previous response in order to request the next page of results.\n\tPageToken string\n\t// Number of elements to retrieve in a single page.\n\t// When too large a page is requested, the server may decide to further\n\t// limit the number of returned resources.\n\tPageSize uint32\n\t// The desired collision type to filter by.\n\t// This must be specified. Only collisions of the specified type will be returned,\n\t// continue to page through results until no more collisions of the specified\n\t// type are returned.\n\tCollisionType CollisionType\n}\n\nfunc (b0 ListServerUniquenessCollisionsRequest_builder) Build() *ListServerUniquenessCollisionsRequest {\n\tm0 := &ListServerUniquenessCollisionsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_CollisionType = b.CollisionType\n\treturn m0\n}\n\ntype ListServerUniquenessCollisionsResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Collisions    *[]*Collision          `protobuf:\"bytes,1,rep,name=collisions,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListServerUniquenessCollisionsResponse) Reset() {\n\t*x = ListServerUniquenessCollisionsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListServerUniquenessCollisionsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListServerUniquenessCollisionsResponse) ProtoMessage() {}\n\nfunc (x *ListServerUniquenessCollisionsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[22]\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\nfunc (x *ListServerUniquenessCollisionsResponse) GetCollisions() []*Collision {\n\tif x != nil {\n\t\tif x.xxx_hidden_Collisions != nil {\n\t\t\treturn *x.xxx_hidden_Collisions\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListServerUniquenessCollisionsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListServerUniquenessCollisionsResponse) SetCollisions(v []*Collision) {\n\tx.xxx_hidden_Collisions = &v\n}\n\nfunc (x *ListServerUniquenessCollisionsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListServerUniquenessCollisionsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The collisions.\n\tCollisions []*Collision\n\t// Pagination token used to retrieve the next page of results.\n\t// Pass the content of this string as the `page_token` attribute of\n\t// the next request. `next_page_token` is not returned for the last\n\t// page.\n\tNextPageToken string\n}\n\nfunc (b0 ListServerUniquenessCollisionsResponse_builder) Build() *ListServerUniquenessCollisionsResponse {\n\tm0 := &ListServerUniquenessCollisionsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Collisions = &b.Collisions\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype RunServerUniquenessBackfillTaskRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *RunServerUniquenessBackfillTaskRequest) Reset() {\n\t*x = RunServerUniquenessBackfillTaskRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RunServerUniquenessBackfillTaskRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RunServerUniquenessBackfillTaskRequest) ProtoMessage() {}\n\nfunc (x *RunServerUniquenessBackfillTaskRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[23]\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\ntype RunServerUniquenessBackfillTaskRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 RunServerUniquenessBackfillTaskRequest_builder) Build() *RunServerUniquenessBackfillTaskRequest {\n\tm0 := &RunServerUniquenessBackfillTaskRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype RunServerUniquenessBackfillTaskResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *RunServerUniquenessBackfillTaskResponse) Reset() {\n\t*x = RunServerUniquenessBackfillTaskResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[24]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RunServerUniquenessBackfillTaskResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RunServerUniquenessBackfillTaskResponse) ProtoMessage() {}\n\nfunc (x *RunServerUniquenessBackfillTaskResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[24]\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\ntype RunServerUniquenessBackfillTaskResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 RunServerUniquenessBackfillTaskResponse_builder) Build() *RunServerUniquenessBackfillTaskResponse {\n\tm0 := &RunServerUniquenessBackfillTaskResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetClusterUsageRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_StartTime *timestamppb.Timestamp `protobuf:\"bytes,1,opt,name=start_time,json=startTime,proto3\"`\n\txxx_hidden_EndTime   *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=end_time,json=endTime,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *GetClusterUsageRequest) Reset() {\n\t*x = GetClusterUsageRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[25]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetClusterUsageRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetClusterUsageRequest) ProtoMessage() {}\n\nfunc (x *GetClusterUsageRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[25]\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\nfunc (x *GetClusterUsageRequest) GetStartTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_StartTime\n\t}\n\treturn nil\n}\n\nfunc (x *GetClusterUsageRequest) GetEndTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EndTime\n\t}\n\treturn nil\n}\n\nfunc (x *GetClusterUsageRequest) SetStartTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_StartTime = v\n}\n\nfunc (x *GetClusterUsageRequest) SetEndTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_EndTime = v\n}\n\nfunc (x *GetClusterUsageRequest) HasStartTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_StartTime != nil\n}\n\nfunc (x *GetClusterUsageRequest) HasEndTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_EndTime != nil\n}\n\nfunc (x *GetClusterUsageRequest) ClearStartTime() {\n\tx.xxx_hidden_StartTime = nil\n}\n\nfunc (x *GetClusterUsageRequest) ClearEndTime() {\n\tx.xxx_hidden_EndTime = nil\n}\n\ntype GetClusterUsageRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The timestamp of the beginning time of a date range.\n\tStartTime *timestamppb.Timestamp\n\t// The timestamp of the ending time of a date range.\n\tEndTime *timestamppb.Timestamp\n}\n\nfunc (b0 GetClusterUsageRequest_builder) Build() *GetClusterUsageRequest {\n\tm0 := &GetClusterUsageRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_StartTime = b.StartTime\n\tx.xxx_hidden_EndTime = b.EndTime\n\treturn m0\n}\n\ntype GetClusterUsageResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Usage *[]*MonthlyUsage       `protobuf:\"bytes,1,rep,name=usage,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *GetClusterUsageResponse) Reset() {\n\t*x = GetClusterUsageResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[26]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetClusterUsageResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetClusterUsageResponse) ProtoMessage() {}\n\nfunc (x *GetClusterUsageResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[26]\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\nfunc (x *GetClusterUsageResponse) GetUsage() []*MonthlyUsage {\n\tif x != nil {\n\t\tif x.xxx_hidden_Usage != nil {\n\t\t\treturn *x.xxx_hidden_Usage\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetClusterUsageResponse) SetUsage(v []*MonthlyUsage) {\n\tx.xxx_hidden_Usage = &v\n}\n\ntype GetClusterUsageResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUsage []*MonthlyUsage\n}\n\nfunc (b0 GetClusterUsageResponse_builder) Build() *GetClusterUsageResponse {\n\tm0 := &GetClusterUsageResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Usage = &b.Usage\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_admin_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_admin_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"'buf/alpha/registry/v1alpha1/admin.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a.buf/alpha/registry/v1alpha1/organization.proto\\x1a,buf/alpha/registry/v1alpha1/repository.proto\\x1a&buf/alpha/registry/v1alpha1/user.proto\\x1a5buf/alpha/registry/v1alpha1/verification_status.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xee\\x01\\n\" +\n\t\"\\x14BreakingChangePolicy\\x12\\x1d\\n\" +\n\t\"\\aenabled\\x18\\x01 \\x01(\\bH\\x00R\\aenabled\\x88\\x01\\x01\\x12=\\n\" +\n\t\"\\x18ignore_unstable_packages\\x18\\x02 \\x01(\\bH\\x01R\\x16ignoreUnstablePackages\\x88\\x01\\x01\\x12O\\n\" +\n\t\"\\bcategory\\x18\\x03 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.BreakingChangeCategoryR\\bcategoryB\\n\" +\n\t\"\\n\" +\n\t\"\\b_enabledB\\x1b\\n\" +\n\t\"\\x19_ignore_unstable_packages\\\",\\n\" +\n\t\"\\x10UniquenessPolicy\\x12\\x18\\n\" +\n\t\"\\aenabled\\x18\\x01 \\x01(\\bR\\aenabled\\\"\\xf0\\x01\\n\" +\n\t\"\\tCollision\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x01 \\x01(\\tR\\treference\\x12>\\n\" +\n\t\"\\x04type\\x18\\x02 \\x01(\\x0e2*.buf.alpha.registry.v1alpha1.CollisionTypeR\\x04type\\x12F\\n\" +\n\t\"\\asources\\x18\\x03 \\x03(\\v2,.buf.alpha.registry.v1alpha1.CollisionSourceR\\asources\\x12=\\n\" +\n\t\"\\x1bhas_other_collision_sources\\x18\\x04 \\x01(\\bR\\x18hasOtherCollisionSources\\\"m\\n\" +\n\t\"\\x0fCollisionSource\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x01 \\x01(\\tR\\townerName\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x12\\n\" +\n\t\"\\x04path\\x18\\x03 \\x01(\\tR\\x04path\\\"\\xc0\\x01\\n\" +\n\t\"\\fMonthlyUsage\\x12\\x14\\n\" +\n\t\"\\x05month\\x18\\x01 \\x01(\\rR\\x05month\\x12\\x12\\n\" +\n\t\"\\x04year\\x18\\x02 \\x01(\\rR\\x04year\\x12.\\n\" +\n\t\"\\x13total_message_types\\x18\\x03 \\x01(\\rR\\x11totalMessageTypes\\x12(\\n\" +\n\t\"\\x10total_enum_types\\x18\\x04 \\x01(\\rR\\x0etotalEnumTypes\\x12,\\n\" +\n\t\"\\x12total_method_types\\x18\\x05 \\x01(\\rR\\x10totalMethodTypes\\\"1\\n\" +\n\t\"\\x16ForceDeleteUserRequest\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x01 \\x01(\\tR\\x06userId\\\"\\x8e\\x02\\n\" +\n\t\"\\x17ForceDeleteUserResponse\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\x12O\\n\" +\n\t\"\\rorganizations\\x18\\x02 \\x03(\\v2).buf.alpha.registry.v1alpha1.OrganizationR\\rorganizations\\x12K\\n\" +\n\t\"\\frepositories\\x18\\x03 \\x03(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\frepositoriesJ\\x04\\b\\x04\\x10\\x05J\\x04\\b\\x05\\x10\\x06R\\apluginsR\\ttemplates\\\"\\xa0\\x01\\n\" +\n\t\"#UpdateUserVerificationStatusRequest\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x01 \\x01(\\tR\\x06userId\\x12`\\n\" +\n\t\"\\x13verification_status\\x18\\x02 \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.VerificationStatusR\\x12verificationStatus\\\"&\\n\" +\n\t\"$UpdateUserVerificationStatusResponse\\\"\\xb8\\x01\\n\" +\n\t\"+UpdateOrganizationVerificationStatusRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12`\\n\" +\n\t\"\\x13verification_status\\x18\\x02 \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.VerificationStatusR\\x12verificationStatus\\\".\\n\" +\n\t\",UpdateOrganizationVerificationStatusResponse\\\"6\\n\" +\n\t\"\\x18CreateMachineUserRequest\\x12\\x1a\\n\" +\n\t\"\\busername\\x18\\x01 \\x01(\\tR\\busername\\\"R\\n\" +\n\t\"\\x19CreateMachineUserResponse\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\\" \\n\" +\n\t\"\\x1eGetBreakingChangePolicyRequest\\\"l\\n\" +\n\t\"\\x1fGetBreakingChangePolicyResponse\\x12I\\n\" +\n\t\"\\x06policy\\x18\\x01 \\x01(\\v21.buf.alpha.registry.v1alpha1.BreakingChangePolicyR\\x06policy\\\"n\\n\" +\n\t\"!UpdateBreakingChangePolicyRequest\\x12I\\n\" +\n\t\"\\x06policy\\x18\\x01 \\x01(\\v21.buf.alpha.registry.v1alpha1.BreakingChangePolicyR\\x06policy\\\"$\\n\" +\n\t\"\\\"UpdateBreakingChangePolicyResponse\\\"\\x1c\\n\" +\n\t\"\\x1aGetUniquenessPolicyRequest\\\"\\x9a\\x01\\n\" +\n\t\"\\x1bGetUniquenessPolicyResponse\\x12E\\n\" +\n\t\"\\x06policy\\x18\\x01 \\x01(\\v2-.buf.alpha.registry.v1alpha1.UniquenessPolicyR\\x06policy\\x124\\n\" +\n\t\"\\x16backfill_task_complete\\x18\\x02 \\x01(\\bR\\x14backfillTaskComplete\\\"f\\n\" +\n\t\"\\x1dUpdateUniquenessPolicyRequest\\x12E\\n\" +\n\t\"\\x06policy\\x18\\x01 \\x01(\\v2-.buf.alpha.registry.v1alpha1.UniquenessPolicyR\\x06policy\\\" \\n\" +\n\t\"\\x1eUpdateUniquenessPolicyResponse\\\"\\xb6\\x01\\n\" +\n\t\"%ListServerUniquenessCollisionsRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x01 \\x01(\\tR\\tpageToken\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12Q\\n\" +\n\t\"\\x0ecollision_type\\x18\\x03 \\x01(\\x0e2*.buf.alpha.registry.v1alpha1.CollisionTypeR\\rcollisionType\\\"\\x98\\x01\\n\" +\n\t\"&ListServerUniquenessCollisionsResponse\\x12F\\n\" +\n\t\"\\n\" +\n\t\"collisions\\x18\\x01 \\x03(\\v2&.buf.alpha.registry.v1alpha1.CollisionR\\n\" +\n\t\"collisions\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"(\\n\" +\n\t\"&RunServerUniquenessBackfillTaskRequest\\\")\\n\" +\n\t\"'RunServerUniquenessBackfillTaskResponse\\\"\\x8a\\x01\\n\" +\n\t\"\\x16GetClusterUsageRequest\\x129\\n\" +\n\t\"\\n\" +\n\t\"start_time\\x18\\x01 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\tstartTime\\x125\\n\" +\n\t\"\\bend_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\aendTime\\\"Z\\n\" +\n\t\"\\x17GetClusterUsageResponse\\x12?\\n\" +\n\t\"\\x05usage\\x18\\x01 \\x03(\\v2).buf.alpha.registry.v1alpha1.MonthlyUsageR\\x05usage*\\x8d\\x01\\n\" +\n\t\"\\x16BreakingChangeCategory\\x12(\\n\" +\n\t\"$BREAKING_CHANGE_CATEGORY_UNSPECIFIED\\x10\\x00\\x12!\\n\" +\n\t\"\\x1dBREAKING_CHANGE_CATEGORY_FILE\\x10\\x01\\x12&\\n\" +\n\t\"\\\"BREAKING_CHANGE_CATEGORY_WIRE_JSON\\x10\\x02*q\\n\" +\n\t\"\\rCollisionType\\x12\\x1e\\n\" +\n\t\"\\x1aCOLLISION_TYPE_UNSPECIFIED\\x10\\x00\\x12'\\n\" +\n\t\"#COLLISION_TYPE_FULLY_QUALIFIED_NAME\\x10\\x01\\x12\\x17\\n\" +\n\t\"\\x13COLLISION_TYPE_PATH\\x10\\x022\\xc3\\r\\n\" +\n\t\"\\fAdminService\\x12\\x81\\x01\\n\" +\n\t\"\\x0fForceDeleteUser\\x123.buf.alpha.registry.v1alpha1.ForceDeleteUserRequest\\x1a4.buf.alpha.registry.v1alpha1.ForceDeleteUserResponse\\\"\\x03\\x90\\x02\\x02\\x12\\xa3\\x01\\n\" +\n\t\"\\x1cUpdateUserVerificationStatus\\x12@.buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusRequest\\x1aA.buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusResponse\\x12\\xbb\\x01\\n\" +\n\t\"$UpdateOrganizationVerificationStatus\\x12H.buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusRequest\\x1aI.buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusResponse\\x12\\x87\\x01\\n\" +\n\t\"\\x11CreateMachineUser\\x125.buf.alpha.registry.v1alpha1.CreateMachineUserRequest\\x1a6.buf.alpha.registry.v1alpha1.CreateMachineUserResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x99\\x01\\n\" +\n\t\"\\x17GetBreakingChangePolicy\\x12;.buf.alpha.registry.v1alpha1.GetBreakingChangePolicyRequest\\x1a<.buf.alpha.registry.v1alpha1.GetBreakingChangePolicyResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x9d\\x01\\n\" +\n\t\"\\x1aUpdateBreakingChangePolicy\\x12>.buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyRequest\\x1a?.buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyResponse\\x12\\x8d\\x01\\n\" +\n\t\"\\x13GetUniquenessPolicy\\x127.buf.alpha.registry.v1alpha1.GetUniquenessPolicyRequest\\x1a8.buf.alpha.registry.v1alpha1.GetUniquenessPolicyResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x91\\x01\\n\" +\n\t\"\\x16UpdateUniquenessPolicy\\x12:.buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyRequest\\x1a;.buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyResponse\\x12\\xae\\x01\\n\" +\n\t\"\\x1eListServerUniquenessCollisions\\x12B.buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsRequest\\x1aC.buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xb1\\x01\\n\" +\n\t\"\\x1fRunServerUniquenessBackfillTask\\x12C.buf.alpha.registry.v1alpha1.RunServerUniquenessBackfillTaskRequest\\x1aD.buf.alpha.registry.v1alpha1.RunServerUniquenessBackfillTaskResponse\\\"\\x03\\x90\\x02\\x02\\x12|\\n\" +\n\t\"\\x0fGetClusterUsage\\x123.buf.alpha.registry.v1alpha1.GetClusterUsageRequest\\x1a4.buf.alpha.registry.v1alpha1.GetClusterUsageResponseB\\x97\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\n\" +\n\t\"AdminProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 2)\nvar file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 27)\nvar file_buf_alpha_registry_v1alpha1_admin_proto_goTypes = []any{\n\t(BreakingChangeCategory)(0),                          // 0: buf.alpha.registry.v1alpha1.BreakingChangeCategory\n\t(CollisionType)(0),                                   // 1: buf.alpha.registry.v1alpha1.CollisionType\n\t(*BreakingChangePolicy)(nil),                         // 2: buf.alpha.registry.v1alpha1.BreakingChangePolicy\n\t(*UniquenessPolicy)(nil),                             // 3: buf.alpha.registry.v1alpha1.UniquenessPolicy\n\t(*Collision)(nil),                                    // 4: buf.alpha.registry.v1alpha1.Collision\n\t(*CollisionSource)(nil),                              // 5: buf.alpha.registry.v1alpha1.CollisionSource\n\t(*MonthlyUsage)(nil),                                 // 6: buf.alpha.registry.v1alpha1.MonthlyUsage\n\t(*ForceDeleteUserRequest)(nil),                       // 7: buf.alpha.registry.v1alpha1.ForceDeleteUserRequest\n\t(*ForceDeleteUserResponse)(nil),                      // 8: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse\n\t(*UpdateUserVerificationStatusRequest)(nil),          // 9: buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusRequest\n\t(*UpdateUserVerificationStatusResponse)(nil),         // 10: buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusResponse\n\t(*UpdateOrganizationVerificationStatusRequest)(nil),  // 11: buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusRequest\n\t(*UpdateOrganizationVerificationStatusResponse)(nil), // 12: buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusResponse\n\t(*CreateMachineUserRequest)(nil),                     // 13: buf.alpha.registry.v1alpha1.CreateMachineUserRequest\n\t(*CreateMachineUserResponse)(nil),                    // 14: buf.alpha.registry.v1alpha1.CreateMachineUserResponse\n\t(*GetBreakingChangePolicyRequest)(nil),               // 15: buf.alpha.registry.v1alpha1.GetBreakingChangePolicyRequest\n\t(*GetBreakingChangePolicyResponse)(nil),              // 16: buf.alpha.registry.v1alpha1.GetBreakingChangePolicyResponse\n\t(*UpdateBreakingChangePolicyRequest)(nil),            // 17: buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyRequest\n\t(*UpdateBreakingChangePolicyResponse)(nil),           // 18: buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyResponse\n\t(*GetUniquenessPolicyRequest)(nil),                   // 19: buf.alpha.registry.v1alpha1.GetUniquenessPolicyRequest\n\t(*GetUniquenessPolicyResponse)(nil),                  // 20: buf.alpha.registry.v1alpha1.GetUniquenessPolicyResponse\n\t(*UpdateUniquenessPolicyRequest)(nil),                // 21: buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyRequest\n\t(*UpdateUniquenessPolicyResponse)(nil),               // 22: buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyResponse\n\t(*ListServerUniquenessCollisionsRequest)(nil),        // 23: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsRequest\n\t(*ListServerUniquenessCollisionsResponse)(nil),       // 24: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsResponse\n\t(*RunServerUniquenessBackfillTaskRequest)(nil),       // 25: buf.alpha.registry.v1alpha1.RunServerUniquenessBackfillTaskRequest\n\t(*RunServerUniquenessBackfillTaskResponse)(nil),      // 26: buf.alpha.registry.v1alpha1.RunServerUniquenessBackfillTaskResponse\n\t(*GetClusterUsageRequest)(nil),                       // 27: buf.alpha.registry.v1alpha1.GetClusterUsageRequest\n\t(*GetClusterUsageResponse)(nil),                      // 28: buf.alpha.registry.v1alpha1.GetClusterUsageResponse\n\t(*User)(nil),                                         // 29: buf.alpha.registry.v1alpha1.User\n\t(*Organization)(nil),                                 // 30: buf.alpha.registry.v1alpha1.Organization\n\t(*Repository)(nil),                                   // 31: buf.alpha.registry.v1alpha1.Repository\n\t(VerificationStatus)(0),                              // 32: buf.alpha.registry.v1alpha1.VerificationStatus\n\t(*timestamppb.Timestamp)(nil),                        // 33: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_admin_proto_depIdxs = []int32{\n\t0,  // 0: buf.alpha.registry.v1alpha1.BreakingChangePolicy.category:type_name -> buf.alpha.registry.v1alpha1.BreakingChangeCategory\n\t1,  // 1: buf.alpha.registry.v1alpha1.Collision.type:type_name -> buf.alpha.registry.v1alpha1.CollisionType\n\t5,  // 2: buf.alpha.registry.v1alpha1.Collision.sources:type_name -> buf.alpha.registry.v1alpha1.CollisionSource\n\t29, // 3: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t30, // 4: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.organizations:type_name -> buf.alpha.registry.v1alpha1.Organization\n\t31, // 5: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t32, // 6: buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusRequest.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus\n\t32, // 7: buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusRequest.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus\n\t29, // 8: buf.alpha.registry.v1alpha1.CreateMachineUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t2,  // 9: buf.alpha.registry.v1alpha1.GetBreakingChangePolicyResponse.policy:type_name -> buf.alpha.registry.v1alpha1.BreakingChangePolicy\n\t2,  // 10: buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyRequest.policy:type_name -> buf.alpha.registry.v1alpha1.BreakingChangePolicy\n\t3,  // 11: buf.alpha.registry.v1alpha1.GetUniquenessPolicyResponse.policy:type_name -> buf.alpha.registry.v1alpha1.UniquenessPolicy\n\t3,  // 12: buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyRequest.policy:type_name -> buf.alpha.registry.v1alpha1.UniquenessPolicy\n\t1,  // 13: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsRequest.collision_type:type_name -> buf.alpha.registry.v1alpha1.CollisionType\n\t4,  // 14: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsResponse.collisions:type_name -> buf.alpha.registry.v1alpha1.Collision\n\t33, // 15: buf.alpha.registry.v1alpha1.GetClusterUsageRequest.start_time:type_name -> google.protobuf.Timestamp\n\t33, // 16: buf.alpha.registry.v1alpha1.GetClusterUsageRequest.end_time:type_name -> google.protobuf.Timestamp\n\t6,  // 17: buf.alpha.registry.v1alpha1.GetClusterUsageResponse.usage:type_name -> buf.alpha.registry.v1alpha1.MonthlyUsage\n\t7,  // 18: buf.alpha.registry.v1alpha1.AdminService.ForceDeleteUser:input_type -> buf.alpha.registry.v1alpha1.ForceDeleteUserRequest\n\t9,  // 19: buf.alpha.registry.v1alpha1.AdminService.UpdateUserVerificationStatus:input_type -> buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusRequest\n\t11, // 20: buf.alpha.registry.v1alpha1.AdminService.UpdateOrganizationVerificationStatus:input_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusRequest\n\t13, // 21: buf.alpha.registry.v1alpha1.AdminService.CreateMachineUser:input_type -> buf.alpha.registry.v1alpha1.CreateMachineUserRequest\n\t15, // 22: buf.alpha.registry.v1alpha1.AdminService.GetBreakingChangePolicy:input_type -> buf.alpha.registry.v1alpha1.GetBreakingChangePolicyRequest\n\t17, // 23: buf.alpha.registry.v1alpha1.AdminService.UpdateBreakingChangePolicy:input_type -> buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyRequest\n\t19, // 24: buf.alpha.registry.v1alpha1.AdminService.GetUniquenessPolicy:input_type -> buf.alpha.registry.v1alpha1.GetUniquenessPolicyRequest\n\t21, // 25: buf.alpha.registry.v1alpha1.AdminService.UpdateUniquenessPolicy:input_type -> buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyRequest\n\t23, // 26: buf.alpha.registry.v1alpha1.AdminService.ListServerUniquenessCollisions:input_type -> buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsRequest\n\t25, // 27: buf.alpha.registry.v1alpha1.AdminService.RunServerUniquenessBackfillTask:input_type -> buf.alpha.registry.v1alpha1.RunServerUniquenessBackfillTaskRequest\n\t27, // 28: buf.alpha.registry.v1alpha1.AdminService.GetClusterUsage:input_type -> buf.alpha.registry.v1alpha1.GetClusterUsageRequest\n\t8,  // 29: buf.alpha.registry.v1alpha1.AdminService.ForceDeleteUser:output_type -> buf.alpha.registry.v1alpha1.ForceDeleteUserResponse\n\t10, // 30: buf.alpha.registry.v1alpha1.AdminService.UpdateUserVerificationStatus:output_type -> buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusResponse\n\t12, // 31: buf.alpha.registry.v1alpha1.AdminService.UpdateOrganizationVerificationStatus:output_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusResponse\n\t14, // 32: buf.alpha.registry.v1alpha1.AdminService.CreateMachineUser:output_type -> buf.alpha.registry.v1alpha1.CreateMachineUserResponse\n\t16, // 33: buf.alpha.registry.v1alpha1.AdminService.GetBreakingChangePolicy:output_type -> buf.alpha.registry.v1alpha1.GetBreakingChangePolicyResponse\n\t18, // 34: buf.alpha.registry.v1alpha1.AdminService.UpdateBreakingChangePolicy:output_type -> buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyResponse\n\t20, // 35: buf.alpha.registry.v1alpha1.AdminService.GetUniquenessPolicy:output_type -> buf.alpha.registry.v1alpha1.GetUniquenessPolicyResponse\n\t22, // 36: buf.alpha.registry.v1alpha1.AdminService.UpdateUniquenessPolicy:output_type -> buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyResponse\n\t24, // 37: buf.alpha.registry.v1alpha1.AdminService.ListServerUniquenessCollisions:output_type -> buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsResponse\n\t26, // 38: buf.alpha.registry.v1alpha1.AdminService.RunServerUniquenessBackfillTask:output_type -> buf.alpha.registry.v1alpha1.RunServerUniquenessBackfillTaskResponse\n\t28, // 39: buf.alpha.registry.v1alpha1.AdminService.GetClusterUsage:output_type -> buf.alpha.registry.v1alpha1.GetClusterUsageResponse\n\t29, // [29:40] is the sub-list for method output_type\n\t18, // [18:29] is the sub-list for method input_type\n\t18, // [18:18] is the sub-list for extension type_name\n\t18, // [18:18] is the sub-list for extension extendee\n\t0,  // [0:18] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_admin_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_admin_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_admin_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_organization_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_user_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_verification_status_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[0].OneofWrappers = []any{}\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_buf_alpha_registry_v1alpha1_admin_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_admin_proto_rawDesc)),\n\t\t\tNumEnums:      2,\n\t\t\tNumMessages:   27,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_admin_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_admin_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_admin_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_admin_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_admin_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/authn.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/authn.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 GetCurrentUserRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetCurrentUserRequest) Reset() {\n\t*x = GetCurrentUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCurrentUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCurrentUserRequest) ProtoMessage() {}\n\nfunc (x *GetCurrentUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_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\ntype GetCurrentUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 GetCurrentUserRequest_builder) Build() *GetCurrentUserRequest {\n\tm0 := &GetCurrentUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetCurrentUserResponse struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *GetCurrentUserResponse) Reset() {\n\t*x = GetCurrentUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCurrentUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCurrentUserResponse) ProtoMessage() {}\n\nfunc (x *GetCurrentUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_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\nfunc (x *GetCurrentUserResponse) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *GetCurrentUserResponse) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *GetCurrentUserResponse) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *GetCurrentUserResponse) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype GetCurrentUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUser *User\n}\n\nfunc (b0 GetCurrentUserResponse_builder) Build() *GetCurrentUserResponse {\n\tm0 := &GetCurrentUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\treturn m0\n}\n\ntype GetCurrentUserSubjectRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetCurrentUserSubjectRequest) Reset() {\n\t*x = GetCurrentUserSubjectRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCurrentUserSubjectRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCurrentUserSubjectRequest) ProtoMessage() {}\n\nfunc (x *GetCurrentUserSubjectRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_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\ntype GetCurrentUserSubjectRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 GetCurrentUserSubjectRequest_builder) Build() *GetCurrentUserSubjectRequest {\n\tm0 := &GetCurrentUserSubjectRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetCurrentUserSubjectResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Subject string                 `protobuf:\"bytes,1,opt,name=subject,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetCurrentUserSubjectResponse) Reset() {\n\t*x = GetCurrentUserSubjectResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCurrentUserSubjectResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCurrentUserSubjectResponse) ProtoMessage() {}\n\nfunc (x *GetCurrentUserSubjectResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authn_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\nfunc (x *GetCurrentUserSubjectResponse) GetSubject() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Subject\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetCurrentUserSubjectResponse) SetSubject(v string) {\n\tx.xxx_hidden_Subject = v\n}\n\ntype GetCurrentUserSubjectResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The user's subject for mapping to user in identity provider.\n\t// Note: we do not want to make it part of the User response as\n\t// it contains potentially sensitive information and the User\n\t// response is shared with other users.\n\tSubject string\n}\n\nfunc (b0 GetCurrentUserSubjectResponse_builder) Build() *GetCurrentUserSubjectResponse {\n\tm0 := &GetCurrentUserSubjectResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Subject = b.Subject\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_authn_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_authn_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"'buf/alpha/registry/v1alpha1/authn.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/registry/v1alpha1/user.proto\\\"\\x17\\n\" +\n\t\"\\x15GetCurrentUserRequest\\\"O\\n\" +\n\t\"\\x16GetCurrentUserResponse\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\\"\\x1e\\n\" +\n\t\"\\x1cGetCurrentUserSubjectRequest\\\"9\\n\" +\n\t\"\\x1dGetCurrentUserSubjectResponse\\x12\\x18\\n\" +\n\t\"\\asubject\\x18\\x01 \\x01(\\tR\\asubject2\\xa4\\x02\\n\" +\n\t\"\\fAuthnService\\x12~\\n\" +\n\t\"\\x0eGetCurrentUser\\x122.buf.alpha.registry.v1alpha1.GetCurrentUserRequest\\x1a3.buf.alpha.registry.v1alpha1.GetCurrentUserResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x93\\x01\\n\" +\n\t\"\\x15GetCurrentUserSubject\\x129.buf.alpha.registry.v1alpha1.GetCurrentUserSubjectRequest\\x1a:.buf.alpha.registry.v1alpha1.GetCurrentUserSubjectResponse\\\"\\x03\\x90\\x02\\x01B\\x97\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\n\" +\n\t\"AuthnProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 4)\nvar file_buf_alpha_registry_v1alpha1_authn_proto_goTypes = []any{\n\t(*GetCurrentUserRequest)(nil),         // 0: buf.alpha.registry.v1alpha1.GetCurrentUserRequest\n\t(*GetCurrentUserResponse)(nil),        // 1: buf.alpha.registry.v1alpha1.GetCurrentUserResponse\n\t(*GetCurrentUserSubjectRequest)(nil),  // 2: buf.alpha.registry.v1alpha1.GetCurrentUserSubjectRequest\n\t(*GetCurrentUserSubjectResponse)(nil), // 3: buf.alpha.registry.v1alpha1.GetCurrentUserSubjectResponse\n\t(*User)(nil),                          // 4: buf.alpha.registry.v1alpha1.User\n}\nvar file_buf_alpha_registry_v1alpha1_authn_proto_depIdxs = []int32{\n\t4, // 0: buf.alpha.registry.v1alpha1.GetCurrentUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t0, // 1: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUser:input_type -> buf.alpha.registry.v1alpha1.GetCurrentUserRequest\n\t2, // 2: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUserSubject:input_type -> buf.alpha.registry.v1alpha1.GetCurrentUserSubjectRequest\n\t1, // 3: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUser:output_type -> buf.alpha.registry.v1alpha1.GetCurrentUserResponse\n\t3, // 4: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUserSubject:output_type -> buf.alpha.registry.v1alpha1.GetCurrentUserSubjectResponse\n\t3, // [3:5] is the sub-list for method output_type\n\t1, // [1:3] 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_buf_alpha_registry_v1alpha1_authn_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_authn_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_authn_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_user_proto_init()\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_buf_alpha_registry_v1alpha1_authn_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_authn_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   4,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_authn_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_authn_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_authn_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_authn_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_authn_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/authz.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/authz.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 UserCanCreateOrganizationRepositoryRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UserCanCreateOrganizationRepositoryRequest) Reset() {\n\t*x = UserCanCreateOrganizationRepositoryRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanCreateOrganizationRepositoryRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanCreateOrganizationRepositoryRequest) ProtoMessage() {}\n\nfunc (x *UserCanCreateOrganizationRepositoryRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanCreateOrganizationRepositoryRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanCreateOrganizationRepositoryRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype UserCanCreateOrganizationRepositoryRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to check\n\t// whether the user is authorized.\n\tOrganizationId string\n}\n\nfunc (b0 UserCanCreateOrganizationRepositoryRequest_builder) Build() *UserCanCreateOrganizationRepositoryRequest {\n\tm0 := &UserCanCreateOrganizationRepositoryRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype UserCanCreateOrganizationRepositoryResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanCreateOrganizationRepositoryResponse) Reset() {\n\t*x = UserCanCreateOrganizationRepositoryResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanCreateOrganizationRepositoryResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanCreateOrganizationRepositoryResponse) ProtoMessage() {}\n\nfunc (x *UserCanCreateOrganizationRepositoryResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanCreateOrganizationRepositoryResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanCreateOrganizationRepositoryResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanCreateOrganizationRepositoryResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanCreateOrganizationRepositoryResponse_builder) Build() *UserCanCreateOrganizationRepositoryResponse {\n\tm0 := &UserCanCreateOrganizationRepositoryResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\ntype UserCanSeeRepositorySettingsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *UserCanSeeRepositorySettingsRequest) Reset() {\n\t*x = UserCanSeeRepositorySettingsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanSeeRepositorySettingsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanSeeRepositorySettingsRequest) ProtoMessage() {}\n\nfunc (x *UserCanSeeRepositorySettingsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanSeeRepositorySettingsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanSeeRepositorySettingsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype UserCanSeeRepositorySettingsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// whether the user is authorized.\n\tRepositoryId string\n}\n\nfunc (b0 UserCanSeeRepositorySettingsRequest_builder) Build() *UserCanSeeRepositorySettingsRequest {\n\tm0 := &UserCanSeeRepositorySettingsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype UserCanSeeRepositorySettingsResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanSeeRepositorySettingsResponse) Reset() {\n\t*x = UserCanSeeRepositorySettingsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanSeeRepositorySettingsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanSeeRepositorySettingsResponse) ProtoMessage() {}\n\nfunc (x *UserCanSeeRepositorySettingsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanSeeRepositorySettingsResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanSeeRepositorySettingsResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanSeeRepositorySettingsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanSeeRepositorySettingsResponse_builder) Build() *UserCanSeeRepositorySettingsResponse {\n\tm0 := &UserCanSeeRepositorySettingsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\ntype UserCanSeeOrganizationSettingsRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UserCanSeeOrganizationSettingsRequest) Reset() {\n\t*x = UserCanSeeOrganizationSettingsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanSeeOrganizationSettingsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanSeeOrganizationSettingsRequest) ProtoMessage() {}\n\nfunc (x *UserCanSeeOrganizationSettingsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanSeeOrganizationSettingsRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanSeeOrganizationSettingsRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype UserCanSeeOrganizationSettingsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to check\n\t// whether the user is authorized.\n\tOrganizationId string\n}\n\nfunc (b0 UserCanSeeOrganizationSettingsRequest_builder) Build() *UserCanSeeOrganizationSettingsRequest {\n\tm0 := &UserCanSeeOrganizationSettingsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype UserCanSeeOrganizationSettingsResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanSeeOrganizationSettingsResponse) Reset() {\n\t*x = UserCanSeeOrganizationSettingsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanSeeOrganizationSettingsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanSeeOrganizationSettingsResponse) ProtoMessage() {}\n\nfunc (x *UserCanSeeOrganizationSettingsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanSeeOrganizationSettingsResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanSeeOrganizationSettingsResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanSeeOrganizationSettingsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanSeeOrganizationSettingsResponse_builder) Build() *UserCanSeeOrganizationSettingsResponse {\n\tm0 := &UserCanSeeOrganizationSettingsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\ntype UserCanAddOrganizationMemberRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UserCanAddOrganizationMemberRequest) Reset() {\n\t*x = UserCanAddOrganizationMemberRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanAddOrganizationMemberRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanAddOrganizationMemberRequest) ProtoMessage() {}\n\nfunc (x *UserCanAddOrganizationMemberRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanAddOrganizationMemberRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanAddOrganizationMemberRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype UserCanAddOrganizationMemberRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to check\n\t// whether the user is authorized.\n\tOrganizationId string\n}\n\nfunc (b0 UserCanAddOrganizationMemberRequest_builder) Build() *UserCanAddOrganizationMemberRequest {\n\tm0 := &UserCanAddOrganizationMemberRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype UserCanAddOrganizationMemberResponse struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_AuthorizedRoles []OrganizationRole     `protobuf:\"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *UserCanAddOrganizationMemberResponse) Reset() {\n\t*x = UserCanAddOrganizationMemberResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanAddOrganizationMemberResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanAddOrganizationMemberResponse) ProtoMessage() {}\n\nfunc (x *UserCanAddOrganizationMemberResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanAddOrganizationMemberResponse) GetAuthorizedRoles() []OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AuthorizedRoles\n\t}\n\treturn nil\n}\n\nfunc (x *UserCanAddOrganizationMemberResponse) SetAuthorizedRoles(v []OrganizationRole) {\n\tx.xxx_hidden_AuthorizedRoles = v\n}\n\ntype UserCanAddOrganizationMemberResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of roles that the user is authorized to add, empty list means the user is\n\t// not authorized to add any members.\n\tAuthorizedRoles []OrganizationRole\n}\n\nfunc (b0 UserCanAddOrganizationMemberResponse_builder) Build() *UserCanAddOrganizationMemberResponse {\n\tm0 := &UserCanAddOrganizationMemberResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_AuthorizedRoles = b.AuthorizedRoles\n\treturn m0\n}\n\ntype UserCanUpdateOrganizationMemberRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UserCanUpdateOrganizationMemberRequest) Reset() {\n\t*x = UserCanUpdateOrganizationMemberRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanUpdateOrganizationMemberRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanUpdateOrganizationMemberRequest) ProtoMessage() {}\n\nfunc (x *UserCanUpdateOrganizationMemberRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_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\nfunc (x *UserCanUpdateOrganizationMemberRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanUpdateOrganizationMemberRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype UserCanUpdateOrganizationMemberRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to check\n\t// whether the user is authorized.\n\tOrganizationId string\n}\n\nfunc (b0 UserCanUpdateOrganizationMemberRequest_builder) Build() *UserCanUpdateOrganizationMemberRequest {\n\tm0 := &UserCanUpdateOrganizationMemberRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype UserCanUpdateOrganizationMemberResponse struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_AuthorizedRoles []OrganizationRole     `protobuf:\"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *UserCanUpdateOrganizationMemberResponse) Reset() {\n\t*x = UserCanUpdateOrganizationMemberResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanUpdateOrganizationMemberResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanUpdateOrganizationMemberResponse) ProtoMessage() {}\n\nfunc (x *UserCanUpdateOrganizationMemberResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[9]\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\nfunc (x *UserCanUpdateOrganizationMemberResponse) GetAuthorizedRoles() []OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AuthorizedRoles\n\t}\n\treturn nil\n}\n\nfunc (x *UserCanUpdateOrganizationMemberResponse) SetAuthorizedRoles(v []OrganizationRole) {\n\tx.xxx_hidden_AuthorizedRoles = v\n}\n\ntype UserCanUpdateOrganizationMemberResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of roles that the user is authorized to update (from and to), empty list means the user is\n\t// not authorized to update any members' role.\n\tAuthorizedRoles []OrganizationRole\n}\n\nfunc (b0 UserCanUpdateOrganizationMemberResponse_builder) Build() *UserCanUpdateOrganizationMemberResponse {\n\tm0 := &UserCanUpdateOrganizationMemberResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_AuthorizedRoles = b.AuthorizedRoles\n\treturn m0\n}\n\ntype UserCanRemoveOrganizationMemberRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UserCanRemoveOrganizationMemberRequest) Reset() {\n\t*x = UserCanRemoveOrganizationMemberRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanRemoveOrganizationMemberRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanRemoveOrganizationMemberRequest) ProtoMessage() {}\n\nfunc (x *UserCanRemoveOrganizationMemberRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[10]\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\nfunc (x *UserCanRemoveOrganizationMemberRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanRemoveOrganizationMemberRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype UserCanRemoveOrganizationMemberRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to check\n\t// whether the user is authorized.\n\tOrganizationId string\n}\n\nfunc (b0 UserCanRemoveOrganizationMemberRequest_builder) Build() *UserCanRemoveOrganizationMemberRequest {\n\tm0 := &UserCanRemoveOrganizationMemberRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype UserCanRemoveOrganizationMemberResponse struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_AuthorizedRoles []OrganizationRole     `protobuf:\"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *UserCanRemoveOrganizationMemberResponse) Reset() {\n\t*x = UserCanRemoveOrganizationMemberResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanRemoveOrganizationMemberResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanRemoveOrganizationMemberResponse) ProtoMessage() {}\n\nfunc (x *UserCanRemoveOrganizationMemberResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[11]\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\nfunc (x *UserCanRemoveOrganizationMemberResponse) GetAuthorizedRoles() []OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AuthorizedRoles\n\t}\n\treturn nil\n}\n\nfunc (x *UserCanRemoveOrganizationMemberResponse) SetAuthorizedRoles(v []OrganizationRole) {\n\tx.xxx_hidden_AuthorizedRoles = v\n}\n\ntype UserCanRemoveOrganizationMemberResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of roles that the user is authorized to remove, empty list means the user is\n\t// not authorized to remove any members.\n\tAuthorizedRoles []OrganizationRole\n}\n\nfunc (b0 UserCanRemoveOrganizationMemberResponse_builder) Build() *UserCanRemoveOrganizationMemberResponse {\n\tm0 := &UserCanRemoveOrganizationMemberResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_AuthorizedRoles = b.AuthorizedRoles\n\treturn m0\n}\n\ntype UserCanDeleteOrganizationRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UserCanDeleteOrganizationRequest) Reset() {\n\t*x = UserCanDeleteOrganizationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanDeleteOrganizationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanDeleteOrganizationRequest) ProtoMessage() {}\n\nfunc (x *UserCanDeleteOrganizationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[12]\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\nfunc (x *UserCanDeleteOrganizationRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanDeleteOrganizationRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype UserCanDeleteOrganizationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to check\n\t// whether the user is authorized.\n\tOrganizationId string\n}\n\nfunc (b0 UserCanDeleteOrganizationRequest_builder) Build() *UserCanDeleteOrganizationRequest {\n\tm0 := &UserCanDeleteOrganizationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype UserCanDeleteOrganizationResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanDeleteOrganizationResponse) Reset() {\n\t*x = UserCanDeleteOrganizationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanDeleteOrganizationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanDeleteOrganizationResponse) ProtoMessage() {}\n\nfunc (x *UserCanDeleteOrganizationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[13]\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\nfunc (x *UserCanDeleteOrganizationResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanDeleteOrganizationResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanDeleteOrganizationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanDeleteOrganizationResponse_builder) Build() *UserCanDeleteOrganizationResponse {\n\tm0 := &UserCanDeleteOrganizationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\ntype UserCanDeleteRepositoryRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *UserCanDeleteRepositoryRequest) Reset() {\n\t*x = UserCanDeleteRepositoryRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanDeleteRepositoryRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanDeleteRepositoryRequest) ProtoMessage() {}\n\nfunc (x *UserCanDeleteRepositoryRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[14]\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\nfunc (x *UserCanDeleteRepositoryRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanDeleteRepositoryRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype UserCanDeleteRepositoryRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// whether the user is authorized.\n\tRepositoryId string\n}\n\nfunc (b0 UserCanDeleteRepositoryRequest_builder) Build() *UserCanDeleteRepositoryRequest {\n\tm0 := &UserCanDeleteRepositoryRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype UserCanDeleteRepositoryResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanDeleteRepositoryResponse) Reset() {\n\t*x = UserCanDeleteRepositoryResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanDeleteRepositoryResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanDeleteRepositoryResponse) ProtoMessage() {}\n\nfunc (x *UserCanDeleteRepositoryResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[15]\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\nfunc (x *UserCanDeleteRepositoryResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanDeleteRepositoryResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanDeleteRepositoryResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanDeleteRepositoryResponse_builder) Build() *UserCanDeleteRepositoryResponse {\n\tm0 := &UserCanDeleteRepositoryResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\ntype UserCanDeleteUserRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UserCanDeleteUserRequest) Reset() {\n\t*x = UserCanDeleteUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanDeleteUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanDeleteUserRequest) ProtoMessage() {}\n\nfunc (x *UserCanDeleteUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[16]\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\ntype UserCanDeleteUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UserCanDeleteUserRequest_builder) Build() *UserCanDeleteUserRequest {\n\tm0 := &UserCanDeleteUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype UserCanDeleteUserResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanDeleteUserResponse) Reset() {\n\t*x = UserCanDeleteUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanDeleteUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanDeleteUserResponse) ProtoMessage() {}\n\nfunc (x *UserCanDeleteUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[17]\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\nfunc (x *UserCanDeleteUserResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanDeleteUserResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanDeleteUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanDeleteUserResponse_builder) Build() *UserCanDeleteUserResponse {\n\tm0 := &UserCanDeleteUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\ntype UserCanSeeServerAdminPanelRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UserCanSeeServerAdminPanelRequest) Reset() {\n\t*x = UserCanSeeServerAdminPanelRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanSeeServerAdminPanelRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanSeeServerAdminPanelRequest) ProtoMessage() {}\n\nfunc (x *UserCanSeeServerAdminPanelRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[18]\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\ntype UserCanSeeServerAdminPanelRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UserCanSeeServerAdminPanelRequest_builder) Build() *UserCanSeeServerAdminPanelRequest {\n\tm0 := &UserCanSeeServerAdminPanelRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype UserCanSeeServerAdminPanelResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanSeeServerAdminPanelResponse) Reset() {\n\t*x = UserCanSeeServerAdminPanelResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanSeeServerAdminPanelResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanSeeServerAdminPanelResponse) ProtoMessage() {}\n\nfunc (x *UserCanSeeServerAdminPanelResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[19]\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\nfunc (x *UserCanSeeServerAdminPanelResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanSeeServerAdminPanelResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanSeeServerAdminPanelResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanSeeServerAdminPanelResponse_builder) Build() *UserCanSeeServerAdminPanelResponse {\n\tm0 := &UserCanSeeServerAdminPanelResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\ntype UserCanManageRepositoryContributorsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *UserCanManageRepositoryContributorsRequest) Reset() {\n\t*x = UserCanManageRepositoryContributorsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanManageRepositoryContributorsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanManageRepositoryContributorsRequest) ProtoMessage() {}\n\nfunc (x *UserCanManageRepositoryContributorsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[20]\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\nfunc (x *UserCanManageRepositoryContributorsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanManageRepositoryContributorsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype UserCanManageRepositoryContributorsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// whether the user is authorized.\n\tRepositoryId string\n}\n\nfunc (b0 UserCanManageRepositoryContributorsRequest_builder) Build() *UserCanManageRepositoryContributorsRequest {\n\tm0 := &UserCanManageRepositoryContributorsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype UserCanManageRepositoryContributorsResponse struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_AuthorizedRoles []RepositoryRole       `protobuf:\"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *UserCanManageRepositoryContributorsResponse) Reset() {\n\t*x = UserCanManageRepositoryContributorsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanManageRepositoryContributorsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanManageRepositoryContributorsResponse) ProtoMessage() {}\n\nfunc (x *UserCanManageRepositoryContributorsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[21]\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\nfunc (x *UserCanManageRepositoryContributorsResponse) GetAuthorizedRoles() []RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AuthorizedRoles\n\t}\n\treturn nil\n}\n\nfunc (x *UserCanManageRepositoryContributorsResponse) SetAuthorizedRoles(v []RepositoryRole) {\n\tx.xxx_hidden_AuthorizedRoles = v\n}\n\ntype UserCanManageRepositoryContributorsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of roles that the user is authorized to manage, empty list means the user is\n\t// not authorized to manage any contributors.\n\tAuthorizedRoles []RepositoryRole\n}\n\nfunc (b0 UserCanManageRepositoryContributorsResponse_builder) Build() *UserCanManageRepositoryContributorsResponse {\n\tm0 := &UserCanManageRepositoryContributorsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_AuthorizedRoles = b.AuthorizedRoles\n\treturn m0\n}\n\ntype UserCanReviewCommitsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *UserCanReviewCommitsRequest) Reset() {\n\t*x = UserCanReviewCommitsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanReviewCommitsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanReviewCommitsRequest) ProtoMessage() {}\n\nfunc (x *UserCanReviewCommitsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[22]\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\nfunc (x *UserCanReviewCommitsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserCanReviewCommitsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype UserCanReviewCommitsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// whether the user is authorized.\n\tRepositoryId string\n}\n\nfunc (b0 UserCanReviewCommitsRequest_builder) Build() *UserCanReviewCommitsRequest {\n\tm0 := &UserCanReviewCommitsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype UserCanReviewCommitsResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Authorized bool                   `protobuf:\"varint,1,opt,name=authorized,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UserCanReviewCommitsResponse) Reset() {\n\t*x = UserCanReviewCommitsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserCanReviewCommitsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserCanReviewCommitsResponse) ProtoMessage() {}\n\nfunc (x *UserCanReviewCommitsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[23]\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\nfunc (x *UserCanReviewCommitsResponse) GetAuthorized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Authorized\n\t}\n\treturn false\n}\n\nfunc (x *UserCanReviewCommitsResponse) SetAuthorized(v bool) {\n\tx.xxx_hidden_Authorized = v\n}\n\ntype UserCanReviewCommitsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAuthorized bool\n}\n\nfunc (b0 UserCanReviewCommitsResponse_builder) Build() *UserCanReviewCommitsResponse {\n\tm0 := &UserCanReviewCommitsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Authorized = b.Authorized\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_authz_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_authz_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"'buf/alpha/registry/v1alpha1/authz.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/registry/v1alpha1/role.proto\\\"U\\n\" +\n\t\"*UserCanCreateOrganizationRepositoryRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"M\\n\" +\n\t\"+UserCanCreateOrganizationRepositoryResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized\\\"J\\n\" +\n\t\"#UserCanSeeRepositorySettingsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"F\\n\" +\n\t\"$UserCanSeeRepositorySettingsResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized\\\"P\\n\" +\n\t\"%UserCanSeeOrganizationSettingsRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"H\\n\" +\n\t\"&UserCanSeeOrganizationSettingsResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized\\\"N\\n\" +\n\t\"#UserCanAddOrganizationMemberRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"\\x80\\x01\\n\" +\n\t\"$UserCanAddOrganizationMemberResponse\\x12X\\n\" +\n\t\"\\x10authorized_roles\\x18\\x01 \\x03(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x0fauthorizedRoles\\\"Q\\n\" +\n\t\"&UserCanUpdateOrganizationMemberRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"\\x83\\x01\\n\" +\n\t\"'UserCanUpdateOrganizationMemberResponse\\x12X\\n\" +\n\t\"\\x10authorized_roles\\x18\\x01 \\x03(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x0fauthorizedRoles\\\"Q\\n\" +\n\t\"&UserCanRemoveOrganizationMemberRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"\\x83\\x01\\n\" +\n\t\"'UserCanRemoveOrganizationMemberResponse\\x12X\\n\" +\n\t\"\\x10authorized_roles\\x18\\x01 \\x03(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x0fauthorizedRoles\\\"K\\n\" +\n\t\" UserCanDeleteOrganizationRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"C\\n\" +\n\t\"!UserCanDeleteOrganizationResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized\\\"E\\n\" +\n\t\"\\x1eUserCanDeleteRepositoryRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"A\\n\" +\n\t\"\\x1fUserCanDeleteRepositoryResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized\\\"\\x1a\\n\" +\n\t\"\\x18UserCanDeleteUserRequest\\\";\\n\" +\n\t\"\\x19UserCanDeleteUserResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized\\\"#\\n\" +\n\t\"!UserCanSeeServerAdminPanelRequest\\\"D\\n\" +\n\t\"\\\"UserCanSeeServerAdminPanelResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized\\\"Q\\n\" +\n\t\"*UserCanManageRepositoryContributorsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"\\x85\\x01\\n\" +\n\t\"+UserCanManageRepositoryContributorsResponse\\x12V\\n\" +\n\t\"\\x10authorized_roles\\x18\\x01 \\x03(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x0fauthorizedRoles\\\"B\\n\" +\n\t\"\\x1bUserCanReviewCommitsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\">\\n\" +\n\t\"\\x1cUserCanReviewCommitsResponse\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"authorized\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"authorized2\\xfd\\x0f\\n\" +\n\t\"\\fAuthzService\\x12\\xbd\\x01\\n\" +\n\t\"#UserCanCreateOrganizationRepository\\x12G.buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryRequest\\x1aH.buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa8\\x01\\n\" +\n\t\"\\x1cUserCanSeeRepositorySettings\\x12@.buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsRequest\\x1aA.buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xae\\x01\\n\" +\n\t\"\\x1eUserCanSeeOrganizationSettings\\x12B.buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsRequest\\x1aC.buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa8\\x01\\n\" +\n\t\"\\x1cUserCanAddOrganizationMember\\x12@.buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberRequest\\x1aA.buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xb1\\x01\\n\" +\n\t\"\\x1fUserCanUpdateOrganizationMember\\x12C.buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberRequest\\x1aD.buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xb1\\x01\\n\" +\n\t\"\\x1fUserCanRemoveOrganizationMember\\x12C.buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberRequest\\x1aD.buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x9f\\x01\\n\" +\n\t\"\\x19UserCanDeleteOrganization\\x12=.buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationRequest\\x1a>.buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x99\\x01\\n\" +\n\t\"\\x17UserCanDeleteRepository\\x12;.buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryRequest\\x1a<.buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x87\\x01\\n\" +\n\t\"\\x11UserCanDeleteUser\\x125.buf.alpha.registry.v1alpha1.UserCanDeleteUserRequest\\x1a6.buf.alpha.registry.v1alpha1.UserCanDeleteUserResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa2\\x01\\n\" +\n\t\"\\x1aUserCanSeeServerAdminPanel\\x12>.buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelRequest\\x1a?.buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xbd\\x01\\n\" +\n\t\"#UserCanManageRepositoryContributors\\x12G.buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsRequest\\x1aH.buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x90\\x01\\n\" +\n\t\"\\x14UserCanReviewCommits\\x128.buf.alpha.registry.v1alpha1.UserCanReviewCommitsRequest\\x1a9.buf.alpha.registry.v1alpha1.UserCanReviewCommitsResponse\\\"\\x03\\x90\\x02\\x01B\\x97\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\n\" +\n\t\"AuthzProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes = make([]protoimpl.MessageInfo, 24)\nvar file_buf_alpha_registry_v1alpha1_authz_proto_goTypes = []any{\n\t(*UserCanCreateOrganizationRepositoryRequest)(nil),  // 0: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryRequest\n\t(*UserCanCreateOrganizationRepositoryResponse)(nil), // 1: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryResponse\n\t(*UserCanSeeRepositorySettingsRequest)(nil),         // 2: buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsRequest\n\t(*UserCanSeeRepositorySettingsResponse)(nil),        // 3: buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsResponse\n\t(*UserCanSeeOrganizationSettingsRequest)(nil),       // 4: buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsRequest\n\t(*UserCanSeeOrganizationSettingsResponse)(nil),      // 5: buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsResponse\n\t(*UserCanAddOrganizationMemberRequest)(nil),         // 6: buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberRequest\n\t(*UserCanAddOrganizationMemberResponse)(nil),        // 7: buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberResponse\n\t(*UserCanUpdateOrganizationMemberRequest)(nil),      // 8: buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberRequest\n\t(*UserCanUpdateOrganizationMemberResponse)(nil),     // 9: buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberResponse\n\t(*UserCanRemoveOrganizationMemberRequest)(nil),      // 10: buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberRequest\n\t(*UserCanRemoveOrganizationMemberResponse)(nil),     // 11: buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberResponse\n\t(*UserCanDeleteOrganizationRequest)(nil),            // 12: buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationRequest\n\t(*UserCanDeleteOrganizationResponse)(nil),           // 13: buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationResponse\n\t(*UserCanDeleteRepositoryRequest)(nil),              // 14: buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryRequest\n\t(*UserCanDeleteRepositoryResponse)(nil),             // 15: buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryResponse\n\t(*UserCanDeleteUserRequest)(nil),                    // 16: buf.alpha.registry.v1alpha1.UserCanDeleteUserRequest\n\t(*UserCanDeleteUserResponse)(nil),                   // 17: buf.alpha.registry.v1alpha1.UserCanDeleteUserResponse\n\t(*UserCanSeeServerAdminPanelRequest)(nil),           // 18: buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelRequest\n\t(*UserCanSeeServerAdminPanelResponse)(nil),          // 19: buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelResponse\n\t(*UserCanManageRepositoryContributorsRequest)(nil),  // 20: buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsRequest\n\t(*UserCanManageRepositoryContributorsResponse)(nil), // 21: buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsResponse\n\t(*UserCanReviewCommitsRequest)(nil),                 // 22: buf.alpha.registry.v1alpha1.UserCanReviewCommitsRequest\n\t(*UserCanReviewCommitsResponse)(nil),                // 23: buf.alpha.registry.v1alpha1.UserCanReviewCommitsResponse\n\t(OrganizationRole)(0),                               // 24: buf.alpha.registry.v1alpha1.OrganizationRole\n\t(RepositoryRole)(0),                                 // 25: buf.alpha.registry.v1alpha1.RepositoryRole\n}\nvar file_buf_alpha_registry_v1alpha1_authz_proto_depIdxs = []int32{\n\t24, // 0: buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t24, // 1: buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t24, // 2: buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t25, // 3: buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t0,  // 4: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationRepository:input_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryRequest\n\t2,  // 5: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeRepositorySettings:input_type -> buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsRequest\n\t4,  // 6: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeOrganizationSettings:input_type -> buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsRequest\n\t6,  // 7: buf.alpha.registry.v1alpha1.AuthzService.UserCanAddOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberRequest\n\t8,  // 8: buf.alpha.registry.v1alpha1.AuthzService.UserCanUpdateOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberRequest\n\t10, // 9: buf.alpha.registry.v1alpha1.AuthzService.UserCanRemoveOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberRequest\n\t12, // 10: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteOrganization:input_type -> buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationRequest\n\t14, // 11: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteRepository:input_type -> buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryRequest\n\t16, // 12: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteUser:input_type -> buf.alpha.registry.v1alpha1.UserCanDeleteUserRequest\n\t18, // 13: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeServerAdminPanel:input_type -> buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelRequest\n\t20, // 14: buf.alpha.registry.v1alpha1.AuthzService.UserCanManageRepositoryContributors:input_type -> buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsRequest\n\t22, // 15: buf.alpha.registry.v1alpha1.AuthzService.UserCanReviewCommits:input_type -> buf.alpha.registry.v1alpha1.UserCanReviewCommitsRequest\n\t1,  // 16: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationRepository:output_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryResponse\n\t3,  // 17: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeRepositorySettings:output_type -> buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsResponse\n\t5,  // 18: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeOrganizationSettings:output_type -> buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsResponse\n\t7,  // 19: buf.alpha.registry.v1alpha1.AuthzService.UserCanAddOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberResponse\n\t9,  // 20: buf.alpha.registry.v1alpha1.AuthzService.UserCanUpdateOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberResponse\n\t11, // 21: buf.alpha.registry.v1alpha1.AuthzService.UserCanRemoveOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberResponse\n\t13, // 22: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteOrganization:output_type -> buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationResponse\n\t15, // 23: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteRepository:output_type -> buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryResponse\n\t17, // 24: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteUser:output_type -> buf.alpha.registry.v1alpha1.UserCanDeleteUserResponse\n\t19, // 25: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeServerAdminPanel:output_type -> buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelResponse\n\t21, // 26: buf.alpha.registry.v1alpha1.AuthzService.UserCanManageRepositoryContributors:output_type -> buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsResponse\n\t23, // 27: buf.alpha.registry.v1alpha1.AuthzService.UserCanReviewCommits:output_type -> buf.alpha.registry.v1alpha1.UserCanReviewCommitsResponse\n\t16, // [16:28] is the sub-list for method output_type\n\t4,  // [4:16] is the sub-list for method input_type\n\t4,  // [4:4] is the sub-list for extension type_name\n\t4,  // [4:4] is the sub-list for extension extendee\n\t0,  // [0:4] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_authz_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_authz_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_authz_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_role_proto_init()\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_buf_alpha_registry_v1alpha1_authz_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_authz_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   24,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_authz_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_authz_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_authz_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_authz_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_authz_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/convert.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/convert.proto\n\npackage registryv1alpha1\n\nimport (\n\tv1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// The supported formats for the serialized message conversion.\ntype ConvertFormat int32\n\nconst (\n\tConvertFormat_CONVERT_FORMAT_UNSPECIFIED ConvertFormat = 0\n\tConvertFormat_CONVERT_FORMAT_BIN         ConvertFormat = 1\n\tConvertFormat_CONVERT_FORMAT_JSON        ConvertFormat = 2\n)\n\n// Enum value maps for ConvertFormat.\nvar (\n\tConvertFormat_name = map[int32]string{\n\t\t0: \"CONVERT_FORMAT_UNSPECIFIED\",\n\t\t1: \"CONVERT_FORMAT_BIN\",\n\t\t2: \"CONVERT_FORMAT_JSON\",\n\t}\n\tConvertFormat_value = map[string]int32{\n\t\t\"CONVERT_FORMAT_UNSPECIFIED\": 0,\n\t\t\"CONVERT_FORMAT_BIN\":         1,\n\t\t\"CONVERT_FORMAT_JSON\":        2,\n\t}\n)\n\nfunc (x ConvertFormat) Enum() *ConvertFormat {\n\tp := new(ConvertFormat)\n\t*p = x\n\treturn p\n}\n\nfunc (x ConvertFormat) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ConvertFormat) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes[0].Descriptor()\n}\n\nfunc (ConvertFormat) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes[0]\n}\n\nfunc (x ConvertFormat) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype ConvertRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_TypeName       string                 `protobuf:\"bytes,1,opt,name=type_name,json=typeName,proto3\"`\n\txxx_hidden_Image          *v1.Image              `protobuf:\"bytes,2,opt,name=image,proto3\"`\n\txxx_hidden_Payload        []byte                 `protobuf:\"bytes,3,opt,name=payload,proto3\"`\n\txxx_hidden_RequestFormat  ConvertFormat          `protobuf:\"varint,4,opt,name=request_format,json=requestFormat,proto3,enum=buf.alpha.registry.v1alpha1.ConvertFormat\"`\n\txxx_hidden_ResponseFormat ConvertFormat          `protobuf:\"varint,5,opt,name=response_format,json=responseFormat,proto3,enum=buf.alpha.registry.v1alpha1.ConvertFormat\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ConvertRequest) Reset() {\n\t*x = ConvertRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ConvertRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ConvertRequest) ProtoMessage() {}\n\nfunc (x *ConvertRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_convert_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\nfunc (x *ConvertRequest) GetTypeName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TypeName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ConvertRequest) GetImage() *v1.Image {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Image\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertRequest) GetPayload() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Payload\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertRequest) GetRequestFormat() ConvertFormat {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RequestFormat\n\t}\n\treturn ConvertFormat_CONVERT_FORMAT_UNSPECIFIED\n}\n\nfunc (x *ConvertRequest) GetResponseFormat() ConvertFormat {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ResponseFormat\n\t}\n\treturn ConvertFormat_CONVERT_FORMAT_UNSPECIFIED\n}\n\nfunc (x *ConvertRequest) SetTypeName(v string) {\n\tx.xxx_hidden_TypeName = v\n}\n\nfunc (x *ConvertRequest) SetImage(v *v1.Image) {\n\tx.xxx_hidden_Image = v\n}\n\nfunc (x *ConvertRequest) SetPayload(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Payload = v\n}\n\nfunc (x *ConvertRequest) SetRequestFormat(v ConvertFormat) {\n\tx.xxx_hidden_RequestFormat = v\n}\n\nfunc (x *ConvertRequest) SetResponseFormat(v ConvertFormat) {\n\tx.xxx_hidden_ResponseFormat = v\n}\n\nfunc (x *ConvertRequest) HasImage() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Image != nil\n}\n\nfunc (x *ConvertRequest) ClearImage() {\n\tx.xxx_hidden_Image = nil\n}\n\ntype ConvertRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// type_name is the full type name of the serialized message (like acme.weather.v1.Units).\n\tTypeName string\n\t// image is the image source that defines the serialized message.\n\tImage *v1.Image\n\t// payload is the serialized Protobuf message.\n\tPayload []byte\n\t// request_format is the format of the payload.\n\tRequestFormat ConvertFormat\n\t// response_format is the desired format of the output result.\n\tResponseFormat ConvertFormat\n}\n\nfunc (b0 ConvertRequest_builder) Build() *ConvertRequest {\n\tm0 := &ConvertRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TypeName = b.TypeName\n\tx.xxx_hidden_Image = b.Image\n\tx.xxx_hidden_Payload = b.Payload\n\tx.xxx_hidden_RequestFormat = b.RequestFormat\n\tx.xxx_hidden_ResponseFormat = b.ResponseFormat\n\treturn m0\n}\n\ntype ConvertResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Payload []byte                 `protobuf:\"bytes,1,opt,name=payload,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *ConvertResponse) Reset() {\n\t*x = ConvertResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ConvertResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ConvertResponse) ProtoMessage() {}\n\nfunc (x *ConvertResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_convert_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\nfunc (x *ConvertResponse) GetPayload() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Payload\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertResponse) SetPayload(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Payload = v\n}\n\ntype ConvertResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// payload is the converted serialized message in one of the supported formats.\n\tPayload []byte\n}\n\nfunc (b0 ConvertResponse_builder) Build() *ConvertResponse {\n\tm0 := &ConvertResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Payload = b.Payload\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_convert_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_convert_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\")buf/alpha/registry/v1alpha1/convert.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1ebuf/alpha/image/v1/image.proto\\\"\\xa0\\x02\\n\" +\n\t\"\\x0eConvertRequest\\x12\\x1b\\n\" +\n\t\"\\ttype_name\\x18\\x01 \\x01(\\tR\\btypeName\\x12/\\n\" +\n\t\"\\x05image\\x18\\x02 \\x01(\\v2\\x19.buf.alpha.image.v1.ImageR\\x05image\\x12\\x18\\n\" +\n\t\"\\apayload\\x18\\x03 \\x01(\\fR\\apayload\\x12Q\\n\" +\n\t\"\\x0erequest_format\\x18\\x04 \\x01(\\x0e2*.buf.alpha.registry.v1alpha1.ConvertFormatR\\rrequestFormat\\x12S\\n\" +\n\t\"\\x0fresponse_format\\x18\\x05 \\x01(\\x0e2*.buf.alpha.registry.v1alpha1.ConvertFormatR\\x0eresponseFormat\\\"+\\n\" +\n\t\"\\x0fConvertResponse\\x12\\x18\\n\" +\n\t\"\\apayload\\x18\\x01 \\x01(\\fR\\apayload*`\\n\" +\n\t\"\\rConvertFormat\\x12\\x1e\\n\" +\n\t\"\\x1aCONVERT_FORMAT_UNSPECIFIED\\x10\\x00\\x12\\x16\\n\" +\n\t\"\\x12CONVERT_FORMAT_BIN\\x10\\x01\\x12\\x17\\n\" +\n\t\"\\x13CONVERT_FORMAT_JSON\\x10\\x022v\\n\" +\n\t\"\\x0eConvertService\\x12d\\n\" +\n\t\"\\aConvert\\x12+.buf.alpha.registry.v1alpha1.ConvertRequest\\x1a,.buf.alpha.registry.v1alpha1.ConvertResponseB\\x99\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\fConvertProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_registry_v1alpha1_convert_proto_goTypes = []any{\n\t(ConvertFormat)(0),      // 0: buf.alpha.registry.v1alpha1.ConvertFormat\n\t(*ConvertRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.ConvertRequest\n\t(*ConvertResponse)(nil), // 2: buf.alpha.registry.v1alpha1.ConvertResponse\n\t(*v1.Image)(nil),        // 3: buf.alpha.image.v1.Image\n}\nvar file_buf_alpha_registry_v1alpha1_convert_proto_depIdxs = []int32{\n\t3, // 0: buf.alpha.registry.v1alpha1.ConvertRequest.image:type_name -> buf.alpha.image.v1.Image\n\t0, // 1: buf.alpha.registry.v1alpha1.ConvertRequest.request_format:type_name -> buf.alpha.registry.v1alpha1.ConvertFormat\n\t0, // 2: buf.alpha.registry.v1alpha1.ConvertRequest.response_format:type_name -> buf.alpha.registry.v1alpha1.ConvertFormat\n\t1, // 3: buf.alpha.registry.v1alpha1.ConvertService.Convert:input_type -> buf.alpha.registry.v1alpha1.ConvertRequest\n\t2, // 4: buf.alpha.registry.v1alpha1.ConvertService.Convert:output_type -> buf.alpha.registry.v1alpha1.ConvertResponse\n\t4, // [4:5] is the sub-list for method output_type\n\t3, // [3:4] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_convert_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_convert_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_convert_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_buf_alpha_registry_v1alpha1_convert_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_convert_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_convert_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_convert_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_convert_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_convert_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_convert_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/display.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/display.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 DisplayOrganizationElementsRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *DisplayOrganizationElementsRequest) Reset() {\n\t*x = DisplayOrganizationElementsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayOrganizationElementsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayOrganizationElementsRequest) ProtoMessage() {}\n\nfunc (x *DisplayOrganizationElementsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\nfunc (x *DisplayOrganizationElementsRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DisplayOrganizationElementsRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype DisplayOrganizationElementsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to check\n\t// which elements should be displayed.\n\tOrganizationId string\n}\n\nfunc (b0 DisplayOrganizationElementsRequest_builder) Build() *DisplayOrganizationElementsRequest {\n\tm0 := &DisplayOrganizationElementsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype DisplayOrganizationElementsResponse struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_CreateRepository bool                   `protobuf:\"varint,1,opt,name=create_repository,json=createRepository,proto3\"`\n\txxx_hidden_Settings         bool                   `protobuf:\"varint,4,opt,name=settings,proto3\"`\n\txxx_hidden_UpdateSettings   bool                   `protobuf:\"varint,5,opt,name=update_settings,json=updateSettings,proto3\"`\n\txxx_hidden_Delete           bool                   `protobuf:\"varint,6,opt,name=delete,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *DisplayOrganizationElementsResponse) Reset() {\n\t*x = DisplayOrganizationElementsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayOrganizationElementsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayOrganizationElementsResponse) ProtoMessage() {}\n\nfunc (x *DisplayOrganizationElementsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\nfunc (x *DisplayOrganizationElementsResponse) GetCreateRepository() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateRepository\n\t}\n\treturn false\n}\n\nfunc (x *DisplayOrganizationElementsResponse) GetSettings() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Settings\n\t}\n\treturn false\n}\n\nfunc (x *DisplayOrganizationElementsResponse) GetUpdateSettings() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UpdateSettings\n\t}\n\treturn false\n}\n\nfunc (x *DisplayOrganizationElementsResponse) GetDelete() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Delete\n\t}\n\treturn false\n}\n\nfunc (x *DisplayOrganizationElementsResponse) SetCreateRepository(v bool) {\n\tx.xxx_hidden_CreateRepository = v\n}\n\nfunc (x *DisplayOrganizationElementsResponse) SetSettings(v bool) {\n\tx.xxx_hidden_Settings = v\n}\n\nfunc (x *DisplayOrganizationElementsResponse) SetUpdateSettings(v bool) {\n\tx.xxx_hidden_UpdateSettings = v\n}\n\nfunc (x *DisplayOrganizationElementsResponse) SetDelete(v bool) {\n\tx.xxx_hidden_Delete = v\n}\n\ntype DisplayOrganizationElementsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Display create organization repository element if true.\n\tCreateRepository bool\n\t// Display organization settings element if true.\n\tSettings bool\n\t// Display update organization settings element if true.\n\tUpdateSettings bool\n\t// Display delete organization element if true.\n\tDelete bool\n}\n\nfunc (b0 DisplayOrganizationElementsResponse_builder) Build() *DisplayOrganizationElementsResponse {\n\tm0 := &DisplayOrganizationElementsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_CreateRepository = b.CreateRepository\n\tx.xxx_hidden_Settings = b.Settings\n\tx.xxx_hidden_UpdateSettings = b.UpdateSettings\n\tx.xxx_hidden_Delete = b.Delete\n\treturn m0\n}\n\ntype DisplayRepositoryElementsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *DisplayRepositoryElementsRequest) Reset() {\n\t*x = DisplayRepositoryElementsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayRepositoryElementsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayRepositoryElementsRequest) ProtoMessage() {}\n\nfunc (x *DisplayRepositoryElementsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\nfunc (x *DisplayRepositoryElementsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DisplayRepositoryElementsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype DisplayRepositoryElementsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// which elements should be displayed.\n\tRepositoryId string\n}\n\nfunc (b0 DisplayRepositoryElementsRequest_builder) Build() *DisplayRepositoryElementsRequest {\n\tm0 := &DisplayRepositoryElementsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype DisplayRepositoryElementsResponse struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Settings     bool                   `protobuf:\"varint,1,opt,name=settings,proto3\"`\n\txxx_hidden_Delete       bool                   `protobuf:\"varint,2,opt,name=delete,proto3\"`\n\txxx_hidden_Write        bool                   `protobuf:\"varint,3,opt,name=write,proto3\"`\n\txxx_hidden_LimitedWrite bool                   `protobuf:\"varint,4,opt,name=limited_write,json=limitedWrite,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *DisplayRepositoryElementsResponse) Reset() {\n\t*x = DisplayRepositoryElementsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayRepositoryElementsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayRepositoryElementsResponse) ProtoMessage() {}\n\nfunc (x *DisplayRepositoryElementsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\nfunc (x *DisplayRepositoryElementsResponse) GetSettings() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Settings\n\t}\n\treturn false\n}\n\nfunc (x *DisplayRepositoryElementsResponse) GetDelete() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Delete\n\t}\n\treturn false\n}\n\nfunc (x *DisplayRepositoryElementsResponse) GetWrite() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Write\n\t}\n\treturn false\n}\n\nfunc (x *DisplayRepositoryElementsResponse) GetLimitedWrite() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LimitedWrite\n\t}\n\treturn false\n}\n\nfunc (x *DisplayRepositoryElementsResponse) SetSettings(v bool) {\n\tx.xxx_hidden_Settings = v\n}\n\nfunc (x *DisplayRepositoryElementsResponse) SetDelete(v bool) {\n\tx.xxx_hidden_Delete = v\n}\n\nfunc (x *DisplayRepositoryElementsResponse) SetWrite(v bool) {\n\tx.xxx_hidden_Write = v\n}\n\nfunc (x *DisplayRepositoryElementsResponse) SetLimitedWrite(v bool) {\n\tx.xxx_hidden_LimitedWrite = v\n}\n\ntype DisplayRepositoryElementsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Display repository settings element if true.\n\tSettings bool\n\t// Display delete repository element if true.\n\tDelete bool\n\t// Display write repository elements if true. It includes all elements from limited_write.\n\tWrite bool\n\t// Display limited_write repository elements if true. This is a subset of write elements.\n\tLimitedWrite bool\n}\n\nfunc (b0 DisplayRepositoryElementsResponse_builder) Build() *DisplayRepositoryElementsResponse {\n\tm0 := &DisplayRepositoryElementsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Settings = b.Settings\n\tx.xxx_hidden_Delete = b.Delete\n\tx.xxx_hidden_Write = b.Write\n\tx.xxx_hidden_LimitedWrite = b.LimitedWrite\n\treturn m0\n}\n\ntype DisplayPluginElementsRequest struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginId string                 `protobuf:\"bytes,1,opt,name=plugin_id,json=pluginId,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *DisplayPluginElementsRequest) Reset() {\n\t*x = DisplayPluginElementsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayPluginElementsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayPluginElementsRequest) ProtoMessage() {}\n\nfunc (x *DisplayPluginElementsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\nfunc (x *DisplayPluginElementsRequest) GetPluginId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DisplayPluginElementsRequest) SetPluginId(v string) {\n\tx.xxx_hidden_PluginId = v\n}\n\ntype DisplayPluginElementsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the plugin for which to check\n\t// which elements should be displayed.\n\tPluginId string\n}\n\nfunc (b0 DisplayPluginElementsRequest_builder) Build() *DisplayPluginElementsRequest {\n\tm0 := &DisplayPluginElementsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginId = b.PluginId\n\treturn m0\n}\n\ntype DisplayPluginElementsResponse struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Settings bool                   `protobuf:\"varint,1,opt,name=settings,proto3\"`\n\txxx_hidden_Delete   bool                   `protobuf:\"varint,2,opt,name=delete,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *DisplayPluginElementsResponse) Reset() {\n\t*x = DisplayPluginElementsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayPluginElementsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayPluginElementsResponse) ProtoMessage() {}\n\nfunc (x *DisplayPluginElementsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\nfunc (x *DisplayPluginElementsResponse) GetSettings() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Settings\n\t}\n\treturn false\n}\n\nfunc (x *DisplayPluginElementsResponse) GetDelete() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Delete\n\t}\n\treturn false\n}\n\nfunc (x *DisplayPluginElementsResponse) SetSettings(v bool) {\n\tx.xxx_hidden_Settings = v\n}\n\nfunc (x *DisplayPluginElementsResponse) SetDelete(v bool) {\n\tx.xxx_hidden_Delete = v\n}\n\ntype DisplayPluginElementsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Display plugin settings element if true.\n\tSettings bool\n\t// Display delete plugin element if true.\n\tDelete bool\n}\n\nfunc (b0 DisplayPluginElementsResponse_builder) Build() *DisplayPluginElementsResponse {\n\tm0 := &DisplayPluginElementsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Settings = b.Settings\n\tx.xxx_hidden_Delete = b.Delete\n\treturn m0\n}\n\ntype DisplayUserElementsRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DisplayUserElementsRequest) Reset() {\n\t*x = DisplayUserElementsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayUserElementsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayUserElementsRequest) ProtoMessage() {}\n\nfunc (x *DisplayUserElementsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\ntype DisplayUserElementsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DisplayUserElementsRequest_builder) Build() *DisplayUserElementsRequest {\n\tm0 := &DisplayUserElementsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype DisplayUserElementsResponse struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Delete bool                   `protobuf:\"varint,1,opt,name=delete,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *DisplayUserElementsResponse) Reset() {\n\t*x = DisplayUserElementsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayUserElementsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayUserElementsResponse) ProtoMessage() {}\n\nfunc (x *DisplayUserElementsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\nfunc (x *DisplayUserElementsResponse) GetDelete() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Delete\n\t}\n\treturn false\n}\n\nfunc (x *DisplayUserElementsResponse) SetDelete(v bool) {\n\tx.xxx_hidden_Delete = v\n}\n\ntype DisplayUserElementsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Display delete user element if true.\n\tDelete bool\n}\n\nfunc (b0 DisplayUserElementsResponse_builder) Build() *DisplayUserElementsResponse {\n\tm0 := &DisplayUserElementsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Delete = b.Delete\n\treturn m0\n}\n\ntype DisplayServerElementsRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DisplayServerElementsRequest) Reset() {\n\t*x = DisplayServerElementsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayServerElementsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayServerElementsRequest) ProtoMessage() {}\n\nfunc (x *DisplayServerElementsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_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\ntype DisplayServerElementsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DisplayServerElementsRequest_builder) Build() *DisplayServerElementsRequest {\n\tm0 := &DisplayServerElementsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype DisplayServerElementsResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_AdminPanel bool                   `protobuf:\"varint,1,opt,name=admin_panel,json=adminPanel,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *DisplayServerElementsResponse) Reset() {\n\t*x = DisplayServerElementsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayServerElementsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayServerElementsResponse) ProtoMessage() {}\n\nfunc (x *DisplayServerElementsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[9]\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\nfunc (x *DisplayServerElementsResponse) GetAdminPanel() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AdminPanel\n\t}\n\treturn false\n}\n\nfunc (x *DisplayServerElementsResponse) SetAdminPanel(v bool) {\n\tx.xxx_hidden_AdminPanel = v\n}\n\ntype DisplayServerElementsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Display server admin panel element if true.\n\tAdminPanel bool\n}\n\nfunc (b0 DisplayServerElementsResponse_builder) Build() *DisplayServerElementsResponse {\n\tm0 := &DisplayServerElementsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_AdminPanel = b.AdminPanel\n\treturn m0\n}\n\ntype DisplayOwnerEntitledElementsRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerName string                 `protobuf:\"bytes,1,opt,name=owner_name,json=ownerName,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *DisplayOwnerEntitledElementsRequest) Reset() {\n\t*x = DisplayOwnerEntitledElementsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayOwnerEntitledElementsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayOwnerEntitledElementsRequest) ProtoMessage() {}\n\nfunc (x *DisplayOwnerEntitledElementsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[10]\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\nfunc (x *DisplayOwnerEntitledElementsRequest) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *DisplayOwnerEntitledElementsRequest) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\ntype DisplayOwnerEntitledElementsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the owner for which to check\n\t// which elements are entitled to be displayed.\n\tOwnerName string\n}\n\nfunc (b0 DisplayOwnerEntitledElementsRequest_builder) Build() *DisplayOwnerEntitledElementsRequest {\n\tm0 := &DisplayOwnerEntitledElementsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\treturn m0\n}\n\ntype DisplayOwnerEntitledElementsResponse struct {\n\tstate                              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_CreatePrivateRepository bool                   `protobuf:\"varint,1,opt,name=create_private_repository,json=createPrivateRepository,proto3\"`\n\tunknownFields                      protoimpl.UnknownFields\n\tsizeCache                          protoimpl.SizeCache\n}\n\nfunc (x *DisplayOwnerEntitledElementsResponse) Reset() {\n\t*x = DisplayOwnerEntitledElementsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayOwnerEntitledElementsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayOwnerEntitledElementsResponse) ProtoMessage() {}\n\nfunc (x *DisplayOwnerEntitledElementsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[11]\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\nfunc (x *DisplayOwnerEntitledElementsResponse) GetCreatePrivateRepository() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreatePrivateRepository\n\t}\n\treturn false\n}\n\nfunc (x *DisplayOwnerEntitledElementsResponse) SetCreatePrivateRepository(v bool) {\n\tx.xxx_hidden_CreatePrivateRepository = v\n}\n\ntype DisplayOwnerEntitledElementsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Display create private repository element if true.\n\tCreatePrivateRepository bool\n}\n\nfunc (b0 DisplayOwnerEntitledElementsResponse_builder) Build() *DisplayOwnerEntitledElementsResponse {\n\tm0 := &DisplayOwnerEntitledElementsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_CreatePrivateRepository = b.CreatePrivateRepository\n\treturn m0\n}\n\ntype DisplayRepositoryEntitledElementsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *DisplayRepositoryEntitledElementsRequest) Reset() {\n\t*x = DisplayRepositoryEntitledElementsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayRepositoryEntitledElementsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayRepositoryEntitledElementsRequest) ProtoMessage() {}\n\nfunc (x *DisplayRepositoryEntitledElementsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[12]\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\nfunc (x *DisplayRepositoryEntitledElementsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DisplayRepositoryEntitledElementsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype DisplayRepositoryEntitledElementsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// which elements are entitled to be displayed.\n\tRepositoryId string\n}\n\nfunc (b0 DisplayRepositoryEntitledElementsRequest_builder) Build() *DisplayRepositoryEntitledElementsRequest {\n\tm0 := &DisplayRepositoryEntitledElementsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype DisplayRepositoryEntitledElementsResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_SetPrivate bool                   `protobuf:\"varint,1,opt,name=set_private,json=setPrivate,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *DisplayRepositoryEntitledElementsResponse) Reset() {\n\t*x = DisplayRepositoryEntitledElementsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DisplayRepositoryEntitledElementsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DisplayRepositoryEntitledElementsResponse) ProtoMessage() {}\n\nfunc (x *DisplayRepositoryEntitledElementsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[13]\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\nfunc (x *DisplayRepositoryEntitledElementsResponse) GetSetPrivate() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SetPrivate\n\t}\n\treturn false\n}\n\nfunc (x *DisplayRepositoryEntitledElementsResponse) SetSetPrivate(v bool) {\n\tx.xxx_hidden_SetPrivate = v\n}\n\ntype DisplayRepositoryEntitledElementsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Display repository change to private setting element if true.\n\tSetPrivate bool\n}\n\nfunc (b0 DisplayRepositoryEntitledElementsResponse_builder) Build() *DisplayRepositoryEntitledElementsResponse {\n\tm0 := &DisplayRepositoryEntitledElementsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_SetPrivate = b.SetPrivate\n\treturn m0\n}\n\ntype ListManageableRepositoryRolesRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ListManageableRepositoryRolesRequest) Reset() {\n\t*x = ListManageableRepositoryRolesRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListManageableRepositoryRolesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListManageableRepositoryRolesRequest) ProtoMessage() {}\n\nfunc (x *ListManageableRepositoryRolesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[14]\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\nfunc (x *ListManageableRepositoryRolesRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListManageableRepositoryRolesRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype ListManageableRepositoryRolesRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// which roles should be displayed as manageable.\n\tRepositoryId string\n}\n\nfunc (b0 ListManageableRepositoryRolesRequest_builder) Build() *ListManageableRepositoryRolesRequest {\n\tm0 := &ListManageableRepositoryRolesRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype ListManageableRepositoryRolesResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Roles []RepositoryRole       `protobuf:\"varint,1,rep,packed,name=roles,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *ListManageableRepositoryRolesResponse) Reset() {\n\t*x = ListManageableRepositoryRolesResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListManageableRepositoryRolesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListManageableRepositoryRolesResponse) ProtoMessage() {}\n\nfunc (x *ListManageableRepositoryRolesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[15]\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\nfunc (x *ListManageableRepositoryRolesResponse) GetRoles() []RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Roles\n\t}\n\treturn nil\n}\n\nfunc (x *ListManageableRepositoryRolesResponse) SetRoles(v []RepositoryRole) {\n\tx.xxx_hidden_Roles = v\n}\n\ntype ListManageableRepositoryRolesResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of roles that should be displayed\n\t// to the user as manageable.\n\tRoles []RepositoryRole\n}\n\nfunc (b0 ListManageableRepositoryRolesResponse_builder) Build() *ListManageableRepositoryRolesResponse {\n\tm0 := &ListManageableRepositoryRolesResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Roles = b.Roles\n\treturn m0\n}\n\ntype ListManageableUserRepositoryRolesRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_UserId       string                 `protobuf:\"bytes,2,opt,name=user_id,json=userId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ListManageableUserRepositoryRolesRequest) Reset() {\n\t*x = ListManageableUserRepositoryRolesRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListManageableUserRepositoryRolesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListManageableUserRepositoryRolesRequest) ProtoMessage() {}\n\nfunc (x *ListManageableUserRepositoryRolesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[16]\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\nfunc (x *ListManageableUserRepositoryRolesRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListManageableUserRepositoryRolesRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListManageableUserRepositoryRolesRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ListManageableUserRepositoryRolesRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\ntype ListManageableUserRepositoryRolesRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to check\n\t// which roles should be displayed as manageable.\n\tRepositoryId string\n\t// The ID of the target user for which to check\n\t// which roles are manageable.\n\tUserId string\n}\n\nfunc (b0 ListManageableUserRepositoryRolesRequest_builder) Build() *ListManageableUserRepositoryRolesRequest {\n\tm0 := &ListManageableUserRepositoryRolesRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_UserId = b.UserId\n\treturn m0\n}\n\ntype ListManageableUserRepositoryRolesResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Roles []RepositoryRole       `protobuf:\"varint,1,rep,packed,name=roles,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *ListManageableUserRepositoryRolesResponse) Reset() {\n\t*x = ListManageableUserRepositoryRolesResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListManageableUserRepositoryRolesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListManageableUserRepositoryRolesResponse) ProtoMessage() {}\n\nfunc (x *ListManageableUserRepositoryRolesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[17]\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\nfunc (x *ListManageableUserRepositoryRolesResponse) GetRoles() []RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Roles\n\t}\n\treturn nil\n}\n\nfunc (x *ListManageableUserRepositoryRolesResponse) SetRoles(v []RepositoryRole) {\n\tx.xxx_hidden_Roles = v\n}\n\ntype ListManageableUserRepositoryRolesResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of roles that should be displayed\n\t// to the user as manageable.\n\tRoles []RepositoryRole\n}\n\nfunc (b0 ListManageableUserRepositoryRolesResponse_builder) Build() *ListManageableUserRepositoryRolesResponse {\n\tm0 := &ListManageableUserRepositoryRolesResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Roles = b.Roles\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_display_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_display_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\")buf/alpha/registry/v1alpha1/display.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/registry/v1alpha1/role.proto\\\"M\\n\" +\n\t\"\\\"DisplayOrganizationElementsRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"\\xdb\\x01\\n\" +\n\t\"#DisplayOrganizationElementsResponse\\x12+\\n\" +\n\t\"\\x11create_repository\\x18\\x01 \\x01(\\bR\\x10createRepository\\x12\\x1a\\n\" +\n\t\"\\bsettings\\x18\\x04 \\x01(\\bR\\bsettings\\x12'\\n\" +\n\t\"\\x0fupdate_settings\\x18\\x05 \\x01(\\bR\\x0eupdateSettings\\x12\\x16\\n\" +\n\t\"\\x06delete\\x18\\x06 \\x01(\\bR\\x06deleteJ\\x04\\b\\x02\\x10\\x03J\\x04\\b\\x03\\x10\\x04R\\rcreate_pluginR\\x0fcreate_template\\\"G\\n\" +\n\t\" DisplayRepositoryElementsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"\\x92\\x01\\n\" +\n\t\"!DisplayRepositoryElementsResponse\\x12\\x1a\\n\" +\n\t\"\\bsettings\\x18\\x01 \\x01(\\bR\\bsettings\\x12\\x16\\n\" +\n\t\"\\x06delete\\x18\\x02 \\x01(\\bR\\x06delete\\x12\\x14\\n\" +\n\t\"\\x05write\\x18\\x03 \\x01(\\bR\\x05write\\x12#\\n\" +\n\t\"\\rlimited_write\\x18\\x04 \\x01(\\bR\\flimitedWrite\\\";\\n\" +\n\t\"\\x1cDisplayPluginElementsRequest\\x12\\x1b\\n\" +\n\t\"\\tplugin_id\\x18\\x01 \\x01(\\tR\\bpluginId\\\"S\\n\" +\n\t\"\\x1dDisplayPluginElementsResponse\\x12\\x1a\\n\" +\n\t\"\\bsettings\\x18\\x01 \\x01(\\bR\\bsettings\\x12\\x16\\n\" +\n\t\"\\x06delete\\x18\\x02 \\x01(\\bR\\x06delete\\\"\\x1c\\n\" +\n\t\"\\x1aDisplayUserElementsRequest\\\"5\\n\" +\n\t\"\\x1bDisplayUserElementsResponse\\x12\\x16\\n\" +\n\t\"\\x06delete\\x18\\x01 \\x01(\\bR\\x06delete\\\"\\x1e\\n\" +\n\t\"\\x1cDisplayServerElementsRequest\\\"@\\n\" +\n\t\"\\x1dDisplayServerElementsResponse\\x12\\x1f\\n\" +\n\t\"\\vadmin_panel\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"adminPanel\\\"D\\n\" +\n\t\"#DisplayOwnerEntitledElementsRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x01 \\x01(\\tR\\townerName\\\"b\\n\" +\n\t\"$DisplayOwnerEntitledElementsResponse\\x12:\\n\" +\n\t\"\\x19create_private_repository\\x18\\x01 \\x01(\\bR\\x17createPrivateRepository\\\"O\\n\" +\n\t\"(DisplayRepositoryEntitledElementsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"L\\n\" +\n\t\")DisplayRepositoryEntitledElementsResponse\\x12\\x1f\\n\" +\n\t\"\\vset_private\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"setPrivate\\\"K\\n\" +\n\t\"$ListManageableRepositoryRolesRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"j\\n\" +\n\t\"%ListManageableRepositoryRolesResponse\\x12A\\n\" +\n\t\"\\x05roles\\x18\\x01 \\x03(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x05roles\\\"h\\n\" +\n\t\"(ListManageableUserRepositoryRolesRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x02 \\x01(\\tR\\x06userId\\\"n\\n\" +\n\t\")ListManageableUserRepositoryRolesResponse\\x12A\\n\" +\n\t\"\\x05roles\\x18\\x01 \\x03(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x05roles2\\xe3\\v\\n\" +\n\t\"\\x0eDisplayService\\x12\\xa5\\x01\\n\" +\n\t\"\\x1bDisplayOrganizationElements\\x12?.buf.alpha.registry.v1alpha1.DisplayOrganizationElementsRequest\\x1a@.buf.alpha.registry.v1alpha1.DisplayOrganizationElementsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x9f\\x01\\n\" +\n\t\"\\x19DisplayRepositoryElements\\x12=.buf.alpha.registry.v1alpha1.DisplayRepositoryElementsRequest\\x1a>.buf.alpha.registry.v1alpha1.DisplayRepositoryElementsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x93\\x01\\n\" +\n\t\"\\x15DisplayPluginElements\\x129.buf.alpha.registry.v1alpha1.DisplayPluginElementsRequest\\x1a:.buf.alpha.registry.v1alpha1.DisplayPluginElementsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8d\\x01\\n\" +\n\t\"\\x13DisplayUserElements\\x127.buf.alpha.registry.v1alpha1.DisplayUserElementsRequest\\x1a8.buf.alpha.registry.v1alpha1.DisplayUserElementsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x93\\x01\\n\" +\n\t\"\\x15DisplayServerElements\\x129.buf.alpha.registry.v1alpha1.DisplayServerElementsRequest\\x1a:.buf.alpha.registry.v1alpha1.DisplayServerElementsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa8\\x01\\n\" +\n\t\"\\x1cDisplayOwnerEntitledElements\\x12@.buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsRequest\\x1aA.buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xb7\\x01\\n\" +\n\t\"!DisplayRepositoryEntitledElements\\x12E.buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsRequest\\x1aF.buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xab\\x01\\n\" +\n\t\"\\x1dListManageableRepositoryRoles\\x12A.buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesRequest\\x1aB.buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xb7\\x01\\n\" +\n\t\"!ListManageableUserRepositoryRoles\\x12E.buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesRequest\\x1aF.buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesResponse\\\"\\x03\\x90\\x02\\x01B\\x99\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\fDisplayProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_display_proto_msgTypes = make([]protoimpl.MessageInfo, 18)\nvar file_buf_alpha_registry_v1alpha1_display_proto_goTypes = []any{\n\t(*DisplayOrganizationElementsRequest)(nil),        // 0: buf.alpha.registry.v1alpha1.DisplayOrganizationElementsRequest\n\t(*DisplayOrganizationElementsResponse)(nil),       // 1: buf.alpha.registry.v1alpha1.DisplayOrganizationElementsResponse\n\t(*DisplayRepositoryElementsRequest)(nil),          // 2: buf.alpha.registry.v1alpha1.DisplayRepositoryElementsRequest\n\t(*DisplayRepositoryElementsResponse)(nil),         // 3: buf.alpha.registry.v1alpha1.DisplayRepositoryElementsResponse\n\t(*DisplayPluginElementsRequest)(nil),              // 4: buf.alpha.registry.v1alpha1.DisplayPluginElementsRequest\n\t(*DisplayPluginElementsResponse)(nil),             // 5: buf.alpha.registry.v1alpha1.DisplayPluginElementsResponse\n\t(*DisplayUserElementsRequest)(nil),                // 6: buf.alpha.registry.v1alpha1.DisplayUserElementsRequest\n\t(*DisplayUserElementsResponse)(nil),               // 7: buf.alpha.registry.v1alpha1.DisplayUserElementsResponse\n\t(*DisplayServerElementsRequest)(nil),              // 8: buf.alpha.registry.v1alpha1.DisplayServerElementsRequest\n\t(*DisplayServerElementsResponse)(nil),             // 9: buf.alpha.registry.v1alpha1.DisplayServerElementsResponse\n\t(*DisplayOwnerEntitledElementsRequest)(nil),       // 10: buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsRequest\n\t(*DisplayOwnerEntitledElementsResponse)(nil),      // 11: buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsResponse\n\t(*DisplayRepositoryEntitledElementsRequest)(nil),  // 12: buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsRequest\n\t(*DisplayRepositoryEntitledElementsResponse)(nil), // 13: buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsResponse\n\t(*ListManageableRepositoryRolesRequest)(nil),      // 14: buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesRequest\n\t(*ListManageableRepositoryRolesResponse)(nil),     // 15: buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesResponse\n\t(*ListManageableUserRepositoryRolesRequest)(nil),  // 16: buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesRequest\n\t(*ListManageableUserRepositoryRolesResponse)(nil), // 17: buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesResponse\n\t(RepositoryRole)(0),                               // 18: buf.alpha.registry.v1alpha1.RepositoryRole\n}\nvar file_buf_alpha_registry_v1alpha1_display_proto_depIdxs = []int32{\n\t18, // 0: buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesResponse.roles:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t18, // 1: buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesResponse.roles:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t0,  // 2: buf.alpha.registry.v1alpha1.DisplayService.DisplayOrganizationElements:input_type -> buf.alpha.registry.v1alpha1.DisplayOrganizationElementsRequest\n\t2,  // 3: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryElements:input_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryElementsRequest\n\t4,  // 4: buf.alpha.registry.v1alpha1.DisplayService.DisplayPluginElements:input_type -> buf.alpha.registry.v1alpha1.DisplayPluginElementsRequest\n\t6,  // 5: buf.alpha.registry.v1alpha1.DisplayService.DisplayUserElements:input_type -> buf.alpha.registry.v1alpha1.DisplayUserElementsRequest\n\t8,  // 6: buf.alpha.registry.v1alpha1.DisplayService.DisplayServerElements:input_type -> buf.alpha.registry.v1alpha1.DisplayServerElementsRequest\n\t10, // 7: buf.alpha.registry.v1alpha1.DisplayService.DisplayOwnerEntitledElements:input_type -> buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsRequest\n\t12, // 8: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryEntitledElements:input_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsRequest\n\t14, // 9: buf.alpha.registry.v1alpha1.DisplayService.ListManageableRepositoryRoles:input_type -> buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesRequest\n\t16, // 10: buf.alpha.registry.v1alpha1.DisplayService.ListManageableUserRepositoryRoles:input_type -> buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesRequest\n\t1,  // 11: buf.alpha.registry.v1alpha1.DisplayService.DisplayOrganizationElements:output_type -> buf.alpha.registry.v1alpha1.DisplayOrganizationElementsResponse\n\t3,  // 12: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryElements:output_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryElementsResponse\n\t5,  // 13: buf.alpha.registry.v1alpha1.DisplayService.DisplayPluginElements:output_type -> buf.alpha.registry.v1alpha1.DisplayPluginElementsResponse\n\t7,  // 14: buf.alpha.registry.v1alpha1.DisplayService.DisplayUserElements:output_type -> buf.alpha.registry.v1alpha1.DisplayUserElementsResponse\n\t9,  // 15: buf.alpha.registry.v1alpha1.DisplayService.DisplayServerElements:output_type -> buf.alpha.registry.v1alpha1.DisplayServerElementsResponse\n\t11, // 16: buf.alpha.registry.v1alpha1.DisplayService.DisplayOwnerEntitledElements:output_type -> buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsResponse\n\t13, // 17: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryEntitledElements:output_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsResponse\n\t15, // 18: buf.alpha.registry.v1alpha1.DisplayService.ListManageableRepositoryRoles:output_type -> buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesResponse\n\t17, // 19: buf.alpha.registry.v1alpha1.DisplayService.ListManageableUserRepositoryRoles:output_type -> buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesResponse\n\t11, // [11:20] is the sub-list for method output_type\n\t2,  // [2:11] 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_buf_alpha_registry_v1alpha1_display_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_display_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_display_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_role_proto_init()\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_buf_alpha_registry_v1alpha1_display_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_display_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   18,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_display_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_display_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_display_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_display_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_display_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_display_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/doc.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/doc.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// FieldType indicates whether a field is a normal, an extension or an any.\ntype FieldType int32\n\nconst (\n\tFieldType_FIELD_TYPE_UNSPECIFIED FieldType = 0\n\tFieldType_FIELD_TYPE_NORMAL      FieldType = 1\n\tFieldType_FIELD_TYPE_EXTENSION   FieldType = 2\n\tFieldType_FIELD_TYPE_ANY         FieldType = 3\n)\n\n// Enum value maps for FieldType.\nvar (\n\tFieldType_name = map[int32]string{\n\t\t0: \"FIELD_TYPE_UNSPECIFIED\",\n\t\t1: \"FIELD_TYPE_NORMAL\",\n\t\t2: \"FIELD_TYPE_EXTENSION\",\n\t\t3: \"FIELD_TYPE_ANY\",\n\t}\n\tFieldType_value = map[string]int32{\n\t\t\"FIELD_TYPE_UNSPECIFIED\": 0,\n\t\t\"FIELD_TYPE_NORMAL\":      1,\n\t\t\"FIELD_TYPE_EXTENSION\":   2,\n\t\t\"FIELD_TYPE_ANY\":         3,\n\t}\n)\n\nfunc (x FieldType) Enum() *FieldType {\n\tp := new(FieldType)\n\t*p = x\n\treturn p\n}\n\nfunc (x FieldType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (FieldType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_doc_proto_enumTypes[0].Descriptor()\n}\n\nfunc (FieldType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_doc_proto_enumTypes[0]\n}\n\nfunc (x FieldType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// GetSourceDirectoryInfoRequest takes an owner, repository, and reference.\ntype GetSourceDirectoryInfoRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetSourceDirectoryInfoRequest) Reset() {\n\t*x = GetSourceDirectoryInfoRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSourceDirectoryInfoRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSourceDirectoryInfoRequest) ProtoMessage() {}\n\nfunc (x *GetSourceDirectoryInfoRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *GetSourceDirectoryInfoRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSourceDirectoryInfoRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSourceDirectoryInfoRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSourceDirectoryInfoRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetSourceDirectoryInfoRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetSourceDirectoryInfoRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype GetSourceDirectoryInfoRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n}\n\nfunc (b0 GetSourceDirectoryInfoRequest_builder) Build() *GetSourceDirectoryInfoRequest {\n\tm0 := &GetSourceDirectoryInfoRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\n// GetSourceDirectoryInfoResponse returns the root FileInfo for the requested module.\ntype GetSourceDirectoryInfoResponse struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Root *FileInfo              `protobuf:\"bytes,1,opt,name=root,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *GetSourceDirectoryInfoResponse) Reset() {\n\t*x = GetSourceDirectoryInfoResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSourceDirectoryInfoResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSourceDirectoryInfoResponse) ProtoMessage() {}\n\nfunc (x *GetSourceDirectoryInfoResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *GetSourceDirectoryInfoResponse) GetRoot() *FileInfo {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Root\n\t}\n\treturn nil\n}\n\nfunc (x *GetSourceDirectoryInfoResponse) SetRoot(v *FileInfo) {\n\tx.xxx_hidden_Root = v\n}\n\nfunc (x *GetSourceDirectoryInfoResponse) HasRoot() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Root != nil\n}\n\nfunc (x *GetSourceDirectoryInfoResponse) ClearRoot() {\n\tx.xxx_hidden_Root = nil\n}\n\ntype GetSourceDirectoryInfoResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRoot *FileInfo\n}\n\nfunc (b0 GetSourceDirectoryInfoResponse_builder) Build() *GetSourceDirectoryInfoResponse {\n\tm0 := &GetSourceDirectoryInfoResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Root = b.Root\n\treturn m0\n}\n\n// FileInfo is a nested structure that contains the file path, whether or not it's a directory,\n// and if so, the FileInfo children of that directory.\ntype FileInfo struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Path     string                 `protobuf:\"bytes,1,opt,name=path,proto3\"`\n\txxx_hidden_IsDir    bool                   `protobuf:\"varint,2,opt,name=is_dir,json=isDir,proto3\"`\n\txxx_hidden_Children *[]*FileInfo           `protobuf:\"bytes,3,rep,name=children,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *FileInfo) Reset() {\n\t*x = FileInfo{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *FileInfo) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*FileInfo) ProtoMessage() {}\n\nfunc (x *FileInfo) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *FileInfo) GetPath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Path\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileInfo) GetIsDir() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IsDir\n\t}\n\treturn false\n}\n\nfunc (x *FileInfo) GetChildren() []*FileInfo {\n\tif x != nil {\n\t\tif x.xxx_hidden_Children != nil {\n\t\t\treturn *x.xxx_hidden_Children\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *FileInfo) SetPath(v string) {\n\tx.xxx_hidden_Path = v\n}\n\nfunc (x *FileInfo) SetIsDir(v bool) {\n\tx.xxx_hidden_IsDir = v\n}\n\nfunc (x *FileInfo) SetChildren(v []*FileInfo) {\n\tx.xxx_hidden_Children = &v\n}\n\ntype FileInfo_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// the normalized path of the directory, relative to the root of the module.\n\tPath     string\n\tIsDir    bool\n\tChildren []*FileInfo\n}\n\nfunc (b0 FileInfo_builder) Build() *FileInfo {\n\tm0 := &FileInfo{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Path = b.Path\n\tx.xxx_hidden_IsDir = b.IsDir\n\tx.xxx_hidden_Children = &b.Children\n\treturn m0\n}\n\n// GetSourceFileRequest takes an owner, repository, reference, and normalized path.\ntype GetSourceFileRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\txxx_hidden_Path       string                 `protobuf:\"bytes,4,opt,name=path,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetSourceFileRequest) Reset() {\n\t*x = GetSourceFileRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSourceFileRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSourceFileRequest) ProtoMessage() {}\n\nfunc (x *GetSourceFileRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *GetSourceFileRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSourceFileRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSourceFileRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSourceFileRequest) GetPath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Path\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSourceFileRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetSourceFileRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetSourceFileRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *GetSourceFileRequest) SetPath(v string) {\n\tx.xxx_hidden_Path = v\n}\n\ntype GetSourceFileRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n\t// the normalized path to the requested file, relative to the root of the module.\n\tPath string\n}\n\nfunc (b0 GetSourceFileRequest_builder) Build() *GetSourceFileRequest {\n\tm0 := &GetSourceFileRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_Path = b.Path\n\treturn m0\n}\n\n// GetSourceFileResponse returns the source code contents of the requested file.\ntype GetSourceFileResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Content []byte                 `protobuf:\"bytes,1,opt,name=content,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetSourceFileResponse) Reset() {\n\t*x = GetSourceFileResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSourceFileResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSourceFileResponse) ProtoMessage() {}\n\nfunc (x *GetSourceFileResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *GetSourceFileResponse) GetContent() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Content\n\t}\n\treturn nil\n}\n\nfunc (x *GetSourceFileResponse) SetContent(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Content = v\n}\n\ntype GetSourceFileResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// content is the content of the file.\n\tContent []byte\n}\n\nfunc (b0 GetSourceFileResponse_builder) Build() *GetSourceFileResponse {\n\tm0 := &GetSourceFileResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Content = b.Content\n\treturn m0\n}\n\n// GetModulePackagesRequest takes an owner, repository, and reference.\ntype GetModulePackagesRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetModulePackagesRequest) Reset() {\n\t*x = GetModulePackagesRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetModulePackagesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetModulePackagesRequest) ProtoMessage() {}\n\nfunc (x *GetModulePackagesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *GetModulePackagesRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetModulePackagesRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetModulePackagesRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetModulePackagesRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetModulePackagesRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetModulePackagesRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype GetModulePackagesRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n}\n\nfunc (b0 GetModulePackagesRequest_builder) Build() *GetModulePackagesRequest {\n\tm0 := &GetModulePackagesRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\n// GetModulePackagesResponse returns the list of ModulePackages for the requested module.\ntype GetModulePackagesResponse struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name           string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_ModulePackages *[]*ModulePackage      `protobuf:\"bytes,2,rep,name=module_packages,json=modulePackages,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *GetModulePackagesResponse) Reset() {\n\t*x = GetModulePackagesResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetModulePackagesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetModulePackagesResponse) ProtoMessage() {}\n\nfunc (x *GetModulePackagesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *GetModulePackagesResponse) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetModulePackagesResponse) GetModulePackages() []*ModulePackage {\n\tif x != nil {\n\t\tif x.xxx_hidden_ModulePackages != nil {\n\t\t\treturn *x.xxx_hidden_ModulePackages\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetModulePackagesResponse) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GetModulePackagesResponse) SetModulePackages(v []*ModulePackage) {\n\tx.xxx_hidden_ModulePackages = &v\n}\n\ntype GetModulePackagesResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName           string\n\tModulePackages []*ModulePackage\n}\n\nfunc (b0 GetModulePackagesResponse_builder) Build() *GetModulePackagesResponse {\n\tm0 := &GetModulePackagesResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_ModulePackages = &b.ModulePackages\n\treturn m0\n}\n\n// ModulePackage provides the details about a module's associated package.\ntype ModulePackage struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name        string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Description string                 `protobuf:\"bytes,2,opt,name=description,proto3\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *ModulePackage) Reset() {\n\t*x = ModulePackage{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModulePackage) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModulePackage) ProtoMessage() {}\n\nfunc (x *ModulePackage) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *ModulePackage) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModulePackage) GetDescription() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Description\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModulePackage) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *ModulePackage) SetDescription(v string) {\n\tx.xxx_hidden_Description = v\n}\n\ntype ModulePackage_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName        string\n\tDescription string\n}\n\nfunc (b0 ModulePackage_builder) Build() *ModulePackage {\n\tm0 := &ModulePackage{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Description = b.Description\n\treturn m0\n}\n\n// GetModuleDocumentationRequest takes an owner, repository, and reference.\ntype GetModuleDocumentationRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetModuleDocumentationRequest) Reset() {\n\t*x = GetModuleDocumentationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetModuleDocumentationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetModuleDocumentationRequest) ProtoMessage() {}\n\nfunc (x *GetModuleDocumentationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_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\nfunc (x *GetModuleDocumentationRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetModuleDocumentationRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetModuleDocumentationRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetModuleDocumentationRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetModuleDocumentationRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetModuleDocumentationRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype GetModuleDocumentationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n}\n\nfunc (b0 GetModuleDocumentationRequest_builder) Build() *GetModuleDocumentationRequest {\n\tm0 := &GetModuleDocumentationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\n// GetModuleDocumentationResponse returns the ModuleDocumentation for the requested module.\ntype GetModuleDocumentationResponse struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ModuleDocumentation *ModuleDocumentation   `protobuf:\"bytes,1,opt,name=module_documentation,json=moduleDocumentation,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *GetModuleDocumentationResponse) Reset() {\n\t*x = GetModuleDocumentationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetModuleDocumentationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetModuleDocumentationResponse) ProtoMessage() {}\n\nfunc (x *GetModuleDocumentationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[9]\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\nfunc (x *GetModuleDocumentationResponse) GetModuleDocumentation() *ModuleDocumentation {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleDocumentation\n\t}\n\treturn nil\n}\n\nfunc (x *GetModuleDocumentationResponse) SetModuleDocumentation(v *ModuleDocumentation) {\n\tx.xxx_hidden_ModuleDocumentation = v\n}\n\nfunc (x *GetModuleDocumentationResponse) HasModuleDocumentation() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleDocumentation != nil\n}\n\nfunc (x *GetModuleDocumentationResponse) ClearModuleDocumentation() {\n\tx.xxx_hidden_ModuleDocumentation = nil\n}\n\ntype GetModuleDocumentationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tModuleDocumentation *ModuleDocumentation\n}\n\nfunc (b0 GetModuleDocumentationResponse_builder) Build() *GetModuleDocumentationResponse {\n\tm0 := &GetModuleDocumentationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ModuleDocumentation = b.ModuleDocumentation\n\treturn m0\n}\n\n// ModuleDocumentation provides the name of the module and associated documentations.\ntype ModuleDocumentation struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name              string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Documentation     string                 `protobuf:\"bytes,3,opt,name=documentation,proto3\"`\n\txxx_hidden_License           string                 `protobuf:\"bytes,4,opt,name=license,proto3\"`\n\txxx_hidden_DocumentationPath string                 `protobuf:\"bytes,5,opt,name=documentation_path,json=documentationPath,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *ModuleDocumentation) Reset() {\n\t*x = ModuleDocumentation{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModuleDocumentation) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModuleDocumentation) ProtoMessage() {}\n\nfunc (x *ModuleDocumentation) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[10]\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\nfunc (x *ModuleDocumentation) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleDocumentation) GetDocumentation() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Documentation\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleDocumentation) GetLicense() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_License\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleDocumentation) GetDocumentationPath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DocumentationPath\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleDocumentation) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *ModuleDocumentation) SetDocumentation(v string) {\n\tx.xxx_hidden_Documentation = v\n}\n\nfunc (x *ModuleDocumentation) SetLicense(v string) {\n\tx.xxx_hidden_License = v\n}\n\nfunc (x *ModuleDocumentation) SetDocumentationPath(v string) {\n\tx.xxx_hidden_DocumentationPath = v\n}\n\ntype ModuleDocumentation_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n\t// This is the string representation of the contents of the buf.md file for module-level documentation.\n\t//\n\t// The buf.md file is a part of the module.\n\t// string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n\tDocumentation string\n\t// This is the string representation of the contents of the LICENSE file for module-level license.\n\t//\n\t// The LICENSE file is a part of the module.\n\t// string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n\tLicense string\n\t// documentation_path is the path of the file which contains the module documentation.\n\t//\n\t// either `buf.md`, `README.md` or `README.markdown`.\n\t// if empty, assumes buf.md.\n\tDocumentationPath string\n}\n\nfunc (b0 ModuleDocumentation_builder) Build() *ModuleDocumentation {\n\tm0 := &ModuleDocumentation{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Documentation = b.Documentation\n\tx.xxx_hidden_License = b.License\n\tx.xxx_hidden_DocumentationPath = b.DocumentationPath\n\treturn m0\n}\n\n// GetPackageDocumentationRequest takes an owner, repository, reference, and package name.\ntype GetPackageDocumentationRequest struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner       string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository  string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference   string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\txxx_hidden_PackageName string                 `protobuf:\"bytes,4,opt,name=package_name,json=packageName,proto3\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *GetPackageDocumentationRequest) Reset() {\n\t*x = GetPackageDocumentationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetPackageDocumentationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetPackageDocumentationRequest) ProtoMessage() {}\n\nfunc (x *GetPackageDocumentationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[11]\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\nfunc (x *GetPackageDocumentationRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetPackageDocumentationRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetPackageDocumentationRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetPackageDocumentationRequest) GetPackageName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PackageName\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetPackageDocumentationRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetPackageDocumentationRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetPackageDocumentationRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *GetPackageDocumentationRequest) SetPackageName(v string) {\n\tx.xxx_hidden_PackageName = v\n}\n\ntype GetPackageDocumentationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n\t// this is the fully qualified package name.\n\tPackageName string\n}\n\nfunc (b0 GetPackageDocumentationRequest_builder) Build() *GetPackageDocumentationRequest {\n\tm0 := &GetPackageDocumentationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_PackageName = b.PackageName\n\treturn m0\n}\n\n// GetPackageDocumentationResponse returns the documentation for the requested package.\ntype GetPackageDocumentationResponse struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PackageDocumentation *PackageDocumentation  `protobuf:\"bytes,1,opt,name=package_documentation,json=packageDocumentation,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *GetPackageDocumentationResponse) Reset() {\n\t*x = GetPackageDocumentationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetPackageDocumentationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetPackageDocumentationResponse) ProtoMessage() {}\n\nfunc (x *GetPackageDocumentationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[12]\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\nfunc (x *GetPackageDocumentationResponse) GetPackageDocumentation() *PackageDocumentation {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PackageDocumentation\n\t}\n\treturn nil\n}\n\nfunc (x *GetPackageDocumentationResponse) SetPackageDocumentation(v *PackageDocumentation) {\n\tx.xxx_hidden_PackageDocumentation = v\n}\n\nfunc (x *GetPackageDocumentationResponse) HasPackageDocumentation() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PackageDocumentation != nil\n}\n\nfunc (x *GetPackageDocumentationResponse) ClearPackageDocumentation() {\n\tx.xxx_hidden_PackageDocumentation = nil\n}\n\ntype GetPackageDocumentationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPackageDocumentation *PackageDocumentation\n}\n\nfunc (b0 GetPackageDocumentationResponse_builder) Build() *GetPackageDocumentationResponse {\n\tm0 := &GetPackageDocumentationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PackageDocumentation = b.PackageDocumentation\n\treturn m0\n}\n\n// PackageDocumentation provides the name, description, and top level types defined in the package.\ntype PackageDocumentation struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name           string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Comments       string                 `protobuf:\"bytes,2,opt,name=comments,proto3\"`\n\txxx_hidden_Services       *[]*Service            `protobuf:\"bytes,3,rep,name=services,proto3\"`\n\txxx_hidden_Enums          *[]*Enum               `protobuf:\"bytes,4,rep,name=enums,proto3\"`\n\txxx_hidden_Messages       *[]*Message            `protobuf:\"bytes,5,rep,name=messages,proto3\"`\n\txxx_hidden_FileExtensions *[]*FileExtension      `protobuf:\"bytes,6,rep,name=file_extensions,json=fileExtensions,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PackageDocumentation) Reset() {\n\t*x = PackageDocumentation{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PackageDocumentation) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PackageDocumentation) ProtoMessage() {}\n\nfunc (x *PackageDocumentation) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[13]\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\nfunc (x *PackageDocumentation) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *PackageDocumentation) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *PackageDocumentation) GetServices() []*Service {\n\tif x != nil {\n\t\tif x.xxx_hidden_Services != nil {\n\t\t\treturn *x.xxx_hidden_Services\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PackageDocumentation) GetEnums() []*Enum {\n\tif x != nil {\n\t\tif x.xxx_hidden_Enums != nil {\n\t\t\treturn *x.xxx_hidden_Enums\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PackageDocumentation) GetMessages() []*Message {\n\tif x != nil {\n\t\tif x.xxx_hidden_Messages != nil {\n\t\t\treturn *x.xxx_hidden_Messages\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PackageDocumentation) GetFileExtensions() []*FileExtension {\n\tif x != nil {\n\t\tif x.xxx_hidden_FileExtensions != nil {\n\t\t\treturn *x.xxx_hidden_FileExtensions\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PackageDocumentation) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *PackageDocumentation) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *PackageDocumentation) SetServices(v []*Service) {\n\tx.xxx_hidden_Services = &v\n}\n\nfunc (x *PackageDocumentation) SetEnums(v []*Enum) {\n\tx.xxx_hidden_Enums = &v\n}\n\nfunc (x *PackageDocumentation) SetMessages(v []*Message) {\n\tx.xxx_hidden_Messages = &v\n}\n\nfunc (x *PackageDocumentation) SetFileExtensions(v []*FileExtension) {\n\tx.xxx_hidden_FileExtensions = &v\n}\n\ntype PackageDocumentation_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n\t// comments contains the package-level comment documentation.\n\t// There is currently no convention for this.\n\t//\n\t// This is derived from the leading comments at the top level of the package.\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\t// services contains all the services defined in the package in alphabetical order.\n\tServices []*Service\n\t// enums contains all the enums defined in the package in alphabetical order.\n\tEnums []*Enum\n\t// messages contains all the messages defined in the package in alphabetical order.\n\tMessages []*Message\n\t// extensions contains all the file level extensions in the package in alphabetical order.\n\tFileExtensions []*FileExtension\n}\n\nfunc (b0 PackageDocumentation_builder) Build() *PackageDocumentation {\n\tm0 := &PackageDocumentation{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_Services = &b.Services\n\tx.xxx_hidden_Enums = &b.Enums\n\tx.xxx_hidden_Messages = &b.Messages\n\tx.xxx_hidden_FileExtensions = &b.FileExtensions\n\treturn m0\n}\n\n// Location provides the location information for the source code.\n//\n// This does not provide the leading or trailing comments as these will\n// be parsed into descriptions or dropped respectively.\ntype Location struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_StartLine   int32                  `protobuf:\"varint,1,opt,name=start_line,json=startLine,proto3\"`\n\txxx_hidden_StartColumn int32                  `protobuf:\"varint,2,opt,name=start_column,json=startColumn,proto3\"`\n\txxx_hidden_EndLine     int32                  `protobuf:\"varint,3,opt,name=end_line,json=endLine,proto3\"`\n\txxx_hidden_EndColumn   int32                  `protobuf:\"varint,4,opt,name=end_column,json=endColumn,proto3\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *Location) Reset() {\n\t*x = Location{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Location) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Location) ProtoMessage() {}\n\nfunc (x *Location) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[14]\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\nfunc (x *Location) GetStartLine() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_StartLine\n\t}\n\treturn 0\n}\n\nfunc (x *Location) GetStartColumn() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_StartColumn\n\t}\n\treturn 0\n}\n\nfunc (x *Location) GetEndLine() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EndLine\n\t}\n\treturn 0\n}\n\nfunc (x *Location) GetEndColumn() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EndColumn\n\t}\n\treturn 0\n}\n\nfunc (x *Location) SetStartLine(v int32) {\n\tx.xxx_hidden_StartLine = v\n}\n\nfunc (x *Location) SetStartColumn(v int32) {\n\tx.xxx_hidden_StartColumn = v\n}\n\nfunc (x *Location) SetEndLine(v int32) {\n\tx.xxx_hidden_EndLine = v\n}\n\nfunc (x *Location) SetEndColumn(v int32) {\n\tx.xxx_hidden_EndColumn = v\n}\n\ntype Location_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tStartLine   int32\n\tStartColumn int32\n\tEndLine     int32\n\tEndColumn   int32\n}\n\nfunc (b0 Location_builder) Build() *Location {\n\tm0 := &Location{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_StartLine = b.StartLine\n\tx.xxx_hidden_StartColumn = b.StartColumn\n\tx.xxx_hidden_EndLine = b.EndLine\n\tx.xxx_hidden_EndColumn = b.EndColumn\n\treturn m0\n}\n\n// Service provides information for the documentation for a given service type in a file.\ntype Service struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name                 string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_NestedName           string                 `protobuf:\"bytes,2,opt,name=nested_name,json=nestedName,proto3\"`\n\txxx_hidden_FullName             string                 `protobuf:\"bytes,3,opt,name=full_name,json=fullName,proto3\"`\n\txxx_hidden_Comments             string                 `protobuf:\"bytes,4,opt,name=comments,proto3\"`\n\txxx_hidden_FilePath             string                 `protobuf:\"bytes,5,opt,name=file_path,json=filePath,proto3\"`\n\txxx_hidden_Location             *Location              `protobuf:\"bytes,6,opt,name=location,proto3\"`\n\txxx_hidden_Methods              *[]*Method             `protobuf:\"bytes,7,rep,name=methods,proto3\"`\n\txxx_hidden_ImplicitlyDeprecated bool                   `protobuf:\"varint,9,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3\"`\n\txxx_hidden_Options              *[]*FieldLiteral       `protobuf:\"bytes,10,rep,name=options,proto3\"`\n\txxx_hidden_ServiceOptions       *ServiceOptions        `protobuf:\"bytes,8,opt,name=service_options,json=serviceOptions,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *Service) Reset() {\n\t*x = Service{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Service) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Service) ProtoMessage() {}\n\nfunc (x *Service) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[15]\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\nfunc (x *Service) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Service) GetNestedName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NestedName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Service) GetFullName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Service) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *Service) GetFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *Service) GetLocation() *Location {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Location\n\t}\n\treturn nil\n}\n\nfunc (x *Service) GetMethods() []*Method {\n\tif x != nil {\n\t\tif x.xxx_hidden_Methods != nil {\n\t\t\treturn *x.xxx_hidden_Methods\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Service) GetImplicitlyDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImplicitlyDeprecated\n\t}\n\treturn false\n}\n\nfunc (x *Service) GetOptions() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Options != nil {\n\t\t\treturn *x.xxx_hidden_Options\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Service) GetServiceOptions() *ServiceOptions {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ServiceOptions\n\t}\n\treturn nil\n}\n\nfunc (x *Service) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Service) SetNestedName(v string) {\n\tx.xxx_hidden_NestedName = v\n}\n\nfunc (x *Service) SetFullName(v string) {\n\tx.xxx_hidden_FullName = v\n}\n\nfunc (x *Service) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *Service) SetFilePath(v string) {\n\tx.xxx_hidden_FilePath = v\n}\n\nfunc (x *Service) SetLocation(v *Location) {\n\tx.xxx_hidden_Location = v\n}\n\nfunc (x *Service) SetMethods(v []*Method) {\n\tx.xxx_hidden_Methods = &v\n}\n\nfunc (x *Service) SetImplicitlyDeprecated(v bool) {\n\tx.xxx_hidden_ImplicitlyDeprecated = v\n}\n\nfunc (x *Service) SetOptions(v []*FieldLiteral) {\n\tx.xxx_hidden_Options = &v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Service) SetServiceOptions(v *ServiceOptions) {\n\tx.xxx_hidden_ServiceOptions = v\n}\n\nfunc (x *Service) HasLocation() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Location != nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Service) HasServiceOptions() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ServiceOptions != nil\n}\n\nfunc (x *Service) ClearLocation() {\n\tx.xxx_hidden_Location = nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Service) ClearServiceOptions() {\n\tx.xxx_hidden_ServiceOptions = nil\n}\n\ntype Service_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n\t// nested_name includes the nested types for a given type definition.\n\tNestedName string\n\t// full_name includes the package name and nested types for a given type definition.\n\tFullName string\n\t// comments is derived from the leading comments of a given service.\n\t//\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\t// file_path is the normalized path of the file containing the service.\n\t// This is used for navigating to the source code for the service.\n\tFilePath string\n\tLocation *Location\n\tMethods  []*Method\n\t// implicitly_deprecated is true if its enclosing file is deprecated.\n\tImplicitlyDeprecated bool\n\t// All options that are present on the service. This is a super-set of\n\t// service_options and uses a dynamic representation so it can also\n\t// accommodate custom options with arbitrary types.\n\t// This supersedes service_options.\n\tOptions []*FieldLiteral\n\t// Use options instead.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\n\tServiceOptions *ServiceOptions\n}\n\nfunc (b0 Service_builder) Build() *Service {\n\tm0 := &Service{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_NestedName = b.NestedName\n\tx.xxx_hidden_FullName = b.FullName\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_FilePath = b.FilePath\n\tx.xxx_hidden_Location = b.Location\n\tx.xxx_hidden_Methods = &b.Methods\n\tx.xxx_hidden_ImplicitlyDeprecated = b.ImplicitlyDeprecated\n\tx.xxx_hidden_Options = &b.Options\n\tx.xxx_hidden_ServiceOptions = b.ServiceOptions\n\treturn m0\n}\n\n// ServiceOptions provides information for the documentation of options for a given service.\n//\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype ServiceOptions struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Deprecated bool                   `protobuf:\"varint,1,opt,name=deprecated,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *ServiceOptions) Reset() {\n\t*x = ServiceOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ServiceOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ServiceOptions) ProtoMessage() {}\n\nfunc (x *ServiceOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[16]\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\nfunc (x *ServiceOptions) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *ServiceOptions) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype ServiceOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tDeprecated bool\n}\n\nfunc (b0 ServiceOptions_builder) Build() *ServiceOptions {\n\tm0 := &ServiceOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\treturn m0\n}\n\n// Method provides information for the documentation for a method of a given service.\ntype Method struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name                 string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Comments             string                 `protobuf:\"bytes,2,opt,name=comments,proto3\"`\n\txxx_hidden_Request              *MethodRequestResponse `protobuf:\"bytes,3,opt,name=request,proto3\"`\n\txxx_hidden_Response             *MethodRequestResponse `protobuf:\"bytes,4,opt,name=response,proto3\"`\n\txxx_hidden_ImplicitlyDeprecated bool                   `protobuf:\"varint,6,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3\"`\n\txxx_hidden_Options              *[]*FieldLiteral       `protobuf:\"bytes,7,rep,name=options,proto3\"`\n\txxx_hidden_MethodOptions        *MethodOptions         `protobuf:\"bytes,5,opt,name=method_options,json=methodOptions,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *Method) Reset() {\n\t*x = Method{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Method) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Method) ProtoMessage() {}\n\nfunc (x *Method) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[17]\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\nfunc (x *Method) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Method) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *Method) GetRequest() *MethodRequestResponse {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Request\n\t}\n\treturn nil\n}\n\nfunc (x *Method) GetResponse() *MethodRequestResponse {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Response\n\t}\n\treturn nil\n}\n\nfunc (x *Method) GetImplicitlyDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImplicitlyDeprecated\n\t}\n\treturn false\n}\n\nfunc (x *Method) GetOptions() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Options != nil {\n\t\t\treturn *x.xxx_hidden_Options\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Method) GetMethodOptions() *MethodOptions {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MethodOptions\n\t}\n\treturn nil\n}\n\nfunc (x *Method) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Method) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *Method) SetRequest(v *MethodRequestResponse) {\n\tx.xxx_hidden_Request = v\n}\n\nfunc (x *Method) SetResponse(v *MethodRequestResponse) {\n\tx.xxx_hidden_Response = v\n}\n\nfunc (x *Method) SetImplicitlyDeprecated(v bool) {\n\tx.xxx_hidden_ImplicitlyDeprecated = v\n}\n\nfunc (x *Method) SetOptions(v []*FieldLiteral) {\n\tx.xxx_hidden_Options = &v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Method) SetMethodOptions(v *MethodOptions) {\n\tx.xxx_hidden_MethodOptions = v\n}\n\nfunc (x *Method) HasRequest() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Request != nil\n}\n\nfunc (x *Method) HasResponse() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Response != nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Method) HasMethodOptions() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_MethodOptions != nil\n}\n\nfunc (x *Method) ClearRequest() {\n\tx.xxx_hidden_Request = nil\n}\n\nfunc (x *Method) ClearResponse() {\n\tx.xxx_hidden_Response = nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Method) ClearMethodOptions() {\n\tx.xxx_hidden_MethodOptions = nil\n}\n\ntype Method_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n\t// comments is derived from the leading comments of a given method.\n\t//\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\tRequest  *MethodRequestResponse\n\tResponse *MethodRequestResponse\n\t// implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n\tImplicitlyDeprecated bool\n\t// All options that are present on the method. This is a super-set of\n\t// method_options and uses a dynamic representation so it can also\n\t// accommodate custom options with arbitrary types.\n\t// This supersedes method_options.\n\tOptions []*FieldLiteral\n\t// Use options instead.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\n\tMethodOptions *MethodOptions\n}\n\nfunc (b0 Method_builder) Build() *Method {\n\tm0 := &Method{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_Request = b.Request\n\tx.xxx_hidden_Response = b.Response\n\tx.xxx_hidden_ImplicitlyDeprecated = b.ImplicitlyDeprecated\n\tx.xxx_hidden_Options = &b.Options\n\tx.xxx_hidden_MethodOptions = b.MethodOptions\n\treturn m0\n}\n\n// MethodOptions provides information for the documentation of options for a method.\n//\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype MethodOptions struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Deprecated       bool                   `protobuf:\"varint,1,opt,name=deprecated,proto3\"`\n\txxx_hidden_IdempotencyLevel int32                  `protobuf:\"varint,2,opt,name=idempotency_level,json=idempotencyLevel,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *MethodOptions) Reset() {\n\t*x = MethodOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MethodOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MethodOptions) ProtoMessage() {}\n\nfunc (x *MethodOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[18]\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\nfunc (x *MethodOptions) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *MethodOptions) GetIdempotencyLevel() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IdempotencyLevel\n\t}\n\treturn 0\n}\n\nfunc (x *MethodOptions) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *MethodOptions) SetIdempotencyLevel(v int32) {\n\tx.xxx_hidden_IdempotencyLevel = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype MethodOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tDeprecated bool\n\t// idempotency_level holds a value of the enumeration `google.protobuf.MethodOptions.IdempotencyLevel.\n\tIdempotencyLevel int32\n}\n\nfunc (b0 MethodOptions_builder) Build() *MethodOptions {\n\tm0 := &MethodOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\tx.xxx_hidden_IdempotencyLevel = b.IdempotencyLevel\n\treturn m0\n}\n\n// MethodRequestResponse provides information for the documentation of a Method request or response message.\ntype MethodRequestResponse struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_NestedType      string                 `protobuf:\"bytes,1,opt,name=nested_type,json=nestedType,proto3\"`\n\txxx_hidden_FullType        string                 `protobuf:\"bytes,2,opt,name=full_type,json=fullType,proto3\"`\n\txxx_hidden_Streaming       bool                   `protobuf:\"varint,3,opt,name=streaming,proto3\"`\n\txxx_hidden_Message         *Message               `protobuf:\"bytes,4,opt,name=message,proto3\"`\n\txxx_hidden_ImportModuleRef *ImportModuleRef       `protobuf:\"bytes,5,opt,name=import_module_ref,json=importModuleRef,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *MethodRequestResponse) Reset() {\n\t*x = MethodRequestResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MethodRequestResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MethodRequestResponse) ProtoMessage() {}\n\nfunc (x *MethodRequestResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[19]\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\nfunc (x *MethodRequestResponse) GetNestedType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NestedType\n\t}\n\treturn \"\"\n}\n\nfunc (x *MethodRequestResponse) GetFullType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullType\n\t}\n\treturn \"\"\n}\n\nfunc (x *MethodRequestResponse) GetStreaming() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Streaming\n\t}\n\treturn false\n}\n\nfunc (x *MethodRequestResponse) GetMessage() *Message {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Message\n\t}\n\treturn nil\n}\n\nfunc (x *MethodRequestResponse) GetImportModuleRef() *ImportModuleRef {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImportModuleRef\n\t}\n\treturn nil\n}\n\nfunc (x *MethodRequestResponse) SetNestedType(v string) {\n\tx.xxx_hidden_NestedType = v\n}\n\nfunc (x *MethodRequestResponse) SetFullType(v string) {\n\tx.xxx_hidden_FullType = v\n}\n\nfunc (x *MethodRequestResponse) SetStreaming(v bool) {\n\tx.xxx_hidden_Streaming = v\n}\n\nfunc (x *MethodRequestResponse) SetMessage(v *Message) {\n\tx.xxx_hidden_Message = v\n}\n\nfunc (x *MethodRequestResponse) SetImportModuleRef(v *ImportModuleRef) {\n\tx.xxx_hidden_ImportModuleRef = v\n}\n\nfunc (x *MethodRequestResponse) HasMessage() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Message != nil\n}\n\nfunc (x *MethodRequestResponse) HasImportModuleRef() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ImportModuleRef != nil\n}\n\nfunc (x *MethodRequestResponse) ClearMessage() {\n\tx.xxx_hidden_Message = nil\n}\n\nfunc (x *MethodRequestResponse) ClearImportModuleRef() {\n\tx.xxx_hidden_ImportModuleRef = nil\n}\n\ntype MethodRequestResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// nested_type is the nested name of the message of the request or response. This includes nested definitions.\n\tNestedType string\n\t// full_type is the fully qualified name of the message of the request or response. This includes package and nested definitions.\n\tFullType string\n\t// boolean flag for whether the streaming label is set on an method request or response.\n\tStreaming bool\n\tMessage   *Message\n\t// import_module_ref is included if the request or response is an imported type.\n\t// It contains all the metadata for the import.\n\tImportModuleRef *ImportModuleRef\n}\n\nfunc (b0 MethodRequestResponse_builder) Build() *MethodRequestResponse {\n\tm0 := &MethodRequestResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_NestedType = b.NestedType\n\tx.xxx_hidden_FullType = b.FullType\n\tx.xxx_hidden_Streaming = b.Streaming\n\tx.xxx_hidden_Message = b.Message\n\tx.xxx_hidden_ImportModuleRef = b.ImportModuleRef\n\treturn m0\n}\n\n// Enum provides information for the documentation of an enum.\ntype Enum struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name                 string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_NestedName           string                 `protobuf:\"bytes,2,opt,name=nested_name,json=nestedName,proto3\"`\n\txxx_hidden_FullName             string                 `protobuf:\"bytes,3,opt,name=full_name,json=fullName,proto3\"`\n\txxx_hidden_Comments             string                 `protobuf:\"bytes,4,opt,name=comments,proto3\"`\n\txxx_hidden_FilePath             string                 `protobuf:\"bytes,5,opt,name=file_path,json=filePath,proto3\"`\n\txxx_hidden_Location             *Location              `protobuf:\"bytes,6,opt,name=location,proto3\"`\n\txxx_hidden_Values               *[]*EnumValue          `protobuf:\"bytes,7,rep,name=values,proto3\"`\n\txxx_hidden_ImplicitlyDeprecated bool                   `protobuf:\"varint,9,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3\"`\n\txxx_hidden_Options              *[]*FieldLiteral       `protobuf:\"bytes,10,rep,name=options,proto3\"`\n\txxx_hidden_EnumOptions          *EnumOptions           `protobuf:\"bytes,8,opt,name=enum_options,json=enumOptions,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *Enum) Reset() {\n\t*x = Enum{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Enum) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Enum) ProtoMessage() {}\n\nfunc (x *Enum) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[20]\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\nfunc (x *Enum) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Enum) GetNestedName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NestedName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Enum) GetFullName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Enum) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *Enum) GetFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *Enum) GetLocation() *Location {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Location\n\t}\n\treturn nil\n}\n\nfunc (x *Enum) GetValues() []*EnumValue {\n\tif x != nil {\n\t\tif x.xxx_hidden_Values != nil {\n\t\t\treturn *x.xxx_hidden_Values\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Enum) GetImplicitlyDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImplicitlyDeprecated\n\t}\n\treturn false\n}\n\nfunc (x *Enum) GetOptions() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Options != nil {\n\t\t\treturn *x.xxx_hidden_Options\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Enum) GetEnumOptions() *EnumOptions {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EnumOptions\n\t}\n\treturn nil\n}\n\nfunc (x *Enum) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Enum) SetNestedName(v string) {\n\tx.xxx_hidden_NestedName = v\n}\n\nfunc (x *Enum) SetFullName(v string) {\n\tx.xxx_hidden_FullName = v\n}\n\nfunc (x *Enum) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *Enum) SetFilePath(v string) {\n\tx.xxx_hidden_FilePath = v\n}\n\nfunc (x *Enum) SetLocation(v *Location) {\n\tx.xxx_hidden_Location = v\n}\n\nfunc (x *Enum) SetValues(v []*EnumValue) {\n\tx.xxx_hidden_Values = &v\n}\n\nfunc (x *Enum) SetImplicitlyDeprecated(v bool) {\n\tx.xxx_hidden_ImplicitlyDeprecated = v\n}\n\nfunc (x *Enum) SetOptions(v []*FieldLiteral) {\n\tx.xxx_hidden_Options = &v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Enum) SetEnumOptions(v *EnumOptions) {\n\tx.xxx_hidden_EnumOptions = v\n}\n\nfunc (x *Enum) HasLocation() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Location != nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Enum) HasEnumOptions() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_EnumOptions != nil\n}\n\nfunc (x *Enum) ClearLocation() {\n\tx.xxx_hidden_Location = nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Enum) ClearEnumOptions() {\n\tx.xxx_hidden_EnumOptions = nil\n}\n\ntype Enum_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n\t// nested_name includes the nested types for a given type definition.\n\tNestedName string\n\t// full_name includes the package name and nested types for a given type definition.\n\tFullName string\n\t// comments is derived from the leading comments of a given Enum.\n\t//\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\t// file_path is the normalized path of the file containing the enum.\n\tFilePath string\n\tLocation *Location\n\tValues   []*EnumValue\n\t// implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n\tImplicitlyDeprecated bool\n\t// All options that are present on the enum. This is a super-set of\n\t// enum_options and uses a dynamic representation so it can also\n\t// accommodate custom options with arbitrary types.\n\t// // This supersedes enum_options.\n\tOptions []*FieldLiteral\n\t// Use options instead.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\n\tEnumOptions *EnumOptions\n}\n\nfunc (b0 Enum_builder) Build() *Enum {\n\tm0 := &Enum{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_NestedName = b.NestedName\n\tx.xxx_hidden_FullName = b.FullName\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_FilePath = b.FilePath\n\tx.xxx_hidden_Location = b.Location\n\tx.xxx_hidden_Values = &b.Values\n\tx.xxx_hidden_ImplicitlyDeprecated = b.ImplicitlyDeprecated\n\tx.xxx_hidden_Options = &b.Options\n\tx.xxx_hidden_EnumOptions = b.EnumOptions\n\treturn m0\n}\n\n// EnumOptions provides information for the documentation of options for an enum.\n//\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype EnumOptions struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Deprecated bool                   `protobuf:\"varint,1,opt,name=deprecated,proto3\"`\n\txxx_hidden_AllowAlias bool                   `protobuf:\"varint,2,opt,name=allow_alias,json=allowAlias,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *EnumOptions) Reset() {\n\t*x = EnumOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *EnumOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EnumOptions) ProtoMessage() {}\n\nfunc (x *EnumOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[21]\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\nfunc (x *EnumOptions) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *EnumOptions) GetAllowAlias() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AllowAlias\n\t}\n\treturn false\n}\n\nfunc (x *EnumOptions) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *EnumOptions) SetAllowAlias(v bool) {\n\tx.xxx_hidden_AllowAlias = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype EnumOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tDeprecated bool\n\tAllowAlias bool\n}\n\nfunc (b0 EnumOptions_builder) Build() *EnumOptions {\n\tm0 := &EnumOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\tx.xxx_hidden_AllowAlias = b.AllowAlias\n\treturn m0\n}\n\n// EnumValue provides information for the documentation of an enum value.\ntype EnumValue struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name             string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Number           int32                  `protobuf:\"varint,2,opt,name=number,proto3\"`\n\txxx_hidden_Comments         string                 `protobuf:\"bytes,3,opt,name=comments,proto3\"`\n\txxx_hidden_Options          *[]*FieldLiteral       `protobuf:\"bytes,5,rep,name=options,proto3\"`\n\txxx_hidden_EnumValueOptions *EnumValueOptions      `protobuf:\"bytes,4,opt,name=enum_value_options,json=enumValueOptions,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *EnumValue) Reset() {\n\t*x = EnumValue{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\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_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[22]\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\nfunc (x *EnumValue) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *EnumValue) GetNumber() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Number\n\t}\n\treturn 0\n}\n\nfunc (x *EnumValue) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *EnumValue) GetOptions() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Options != nil {\n\t\t\treturn *x.xxx_hidden_Options\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *EnumValue) GetEnumValueOptions() *EnumValueOptions {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EnumValueOptions\n\t}\n\treturn nil\n}\n\nfunc (x *EnumValue) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *EnumValue) SetNumber(v int32) {\n\tx.xxx_hidden_Number = v\n}\n\nfunc (x *EnumValue) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *EnumValue) SetOptions(v []*FieldLiteral) {\n\tx.xxx_hidden_Options = &v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *EnumValue) SetEnumValueOptions(v *EnumValueOptions) {\n\tx.xxx_hidden_EnumValueOptions = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *EnumValue) HasEnumValueOptions() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_EnumValueOptions != nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *EnumValue) ClearEnumValueOptions() {\n\tx.xxx_hidden_EnumValueOptions = nil\n}\n\ntype EnumValue_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName   string\n\tNumber int32\n\t// comments is derived from the leading comments of a given enum value.\n\t//\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\t// All options that are present on the enum. This is a super-set of\n\t// enum_value_options and uses a dynamic representation so it can also\n\t// accommodate custom options with arbitrary types.\n\t// // This supersedes enum_value_options.\n\tOptions []*FieldLiteral\n\t// Use options instead.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\n\tEnumValueOptions *EnumValueOptions\n}\n\nfunc (b0 EnumValue_builder) Build() *EnumValue {\n\tm0 := &EnumValue{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Number = b.Number\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_Options = &b.Options\n\tx.xxx_hidden_EnumValueOptions = b.EnumValueOptions\n\treturn m0\n}\n\n// EnumValueOptions provides information for the documentation of options for an enum value.\n//\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype EnumValueOptions struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Deprecated bool                   `protobuf:\"varint,1,opt,name=deprecated,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *EnumValueOptions) Reset() {\n\t*x = EnumValueOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *EnumValueOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EnumValueOptions) ProtoMessage() {}\n\nfunc (x *EnumValueOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[23]\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\nfunc (x *EnumValueOptions) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *EnumValueOptions) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype EnumValueOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tDeprecated bool\n}\n\nfunc (b0 EnumValueOptions_builder) Build() *EnumValueOptions {\n\tm0 := &EnumValueOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\treturn m0\n}\n\n// ImportRef provides the import metadata if a type is imported.\ntype ImportModuleRef struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Remote      string                 `protobuf:\"bytes,1,opt,name=remote,proto3\"`\n\txxx_hidden_Owner       string                 `protobuf:\"bytes,2,opt,name=owner,proto3\"`\n\txxx_hidden_Repository  string                 `protobuf:\"bytes,3,opt,name=repository,proto3\"`\n\txxx_hidden_Commit      string                 `protobuf:\"bytes,4,opt,name=commit,proto3\"`\n\txxx_hidden_PackageName string                 `protobuf:\"bytes,5,opt,name=package_name,json=packageName,proto3\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *ImportModuleRef) Reset() {\n\t*x = ImportModuleRef{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[24]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ImportModuleRef) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ImportModuleRef) ProtoMessage() {}\n\nfunc (x *ImportModuleRef) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[24]\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\nfunc (x *ImportModuleRef) GetRemote() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Remote\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImportModuleRef) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImportModuleRef) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImportModuleRef) GetCommit() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImportModuleRef) GetPackageName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PackageName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ImportModuleRef) SetRemote(v string) {\n\tx.xxx_hidden_Remote = v\n}\n\nfunc (x *ImportModuleRef) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *ImportModuleRef) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *ImportModuleRef) SetCommit(v string) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *ImportModuleRef) SetPackageName(v string) {\n\tx.xxx_hidden_PackageName = v\n}\n\ntype ImportModuleRef_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRemote     string\n\tOwner      string\n\tRepository string\n\t// the commit is based on the module commit of the imported type provided\n\t// by the image.\n\tCommit      string\n\tPackageName string\n}\n\nfunc (b0 ImportModuleRef_builder) Build() *ImportModuleRef {\n\tm0 := &ImportModuleRef{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Remote = b.Remote\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Commit = b.Commit\n\tx.xxx_hidden_PackageName = b.PackageName\n\treturn m0\n}\n\n// Message provides information for the documentation of a protobuf message.\ntype Message struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name                 string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_NestedName           string                 `protobuf:\"bytes,2,opt,name=nested_name,json=nestedName,proto3\"`\n\txxx_hidden_FullName             string                 `protobuf:\"bytes,3,opt,name=full_name,json=fullName,proto3\"`\n\txxx_hidden_Comments             string                 `protobuf:\"bytes,4,opt,name=comments,proto3\"`\n\txxx_hidden_FilePath             string                 `protobuf:\"bytes,5,opt,name=file_path,json=filePath,proto3\"`\n\txxx_hidden_IsMapEntry           bool                   `protobuf:\"varint,6,opt,name=is_map_entry,json=isMapEntry,proto3\"`\n\txxx_hidden_Fields               *[]*MessageField       `protobuf:\"bytes,7,rep,name=fields,proto3\"`\n\txxx_hidden_Location             *Location              `protobuf:\"bytes,8,opt,name=location,proto3\"`\n\txxx_hidden_MessageExtensions    *[]*Field              `protobuf:\"bytes,9,rep,name=message_extensions,json=messageExtensions,proto3\"`\n\txxx_hidden_ImplicitlyDeprecated bool                   `protobuf:\"varint,11,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3\"`\n\txxx_hidden_Options              *[]*FieldLiteral       `protobuf:\"bytes,12,rep,name=options,proto3\"`\n\txxx_hidden_MessageOptions       *MessageOptions        `protobuf:\"bytes,10,opt,name=message_options,json=messageOptions,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *Message) Reset() {\n\t*x = Message{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[25]\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_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[25]\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\nfunc (x *Message) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Message) GetNestedName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NestedName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Message) GetFullName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Message) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *Message) GetFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *Message) GetIsMapEntry() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IsMapEntry\n\t}\n\treturn false\n}\n\nfunc (x *Message) GetFields() []*MessageField {\n\tif x != nil {\n\t\tif x.xxx_hidden_Fields != nil {\n\t\t\treturn *x.xxx_hidden_Fields\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Message) GetLocation() *Location {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Location\n\t}\n\treturn nil\n}\n\nfunc (x *Message) GetMessageExtensions() []*Field {\n\tif x != nil {\n\t\tif x.xxx_hidden_MessageExtensions != nil {\n\t\t\treturn *x.xxx_hidden_MessageExtensions\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Message) GetImplicitlyDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImplicitlyDeprecated\n\t}\n\treturn false\n}\n\nfunc (x *Message) GetOptions() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Options != nil {\n\t\t\treturn *x.xxx_hidden_Options\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Message) GetMessageOptions() *MessageOptions {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MessageOptions\n\t}\n\treturn nil\n}\n\nfunc (x *Message) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Message) SetNestedName(v string) {\n\tx.xxx_hidden_NestedName = v\n}\n\nfunc (x *Message) SetFullName(v string) {\n\tx.xxx_hidden_FullName = v\n}\n\nfunc (x *Message) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *Message) SetFilePath(v string) {\n\tx.xxx_hidden_FilePath = v\n}\n\nfunc (x *Message) SetIsMapEntry(v bool) {\n\tx.xxx_hidden_IsMapEntry = v\n}\n\nfunc (x *Message) SetFields(v []*MessageField) {\n\tx.xxx_hidden_Fields = &v\n}\n\nfunc (x *Message) SetLocation(v *Location) {\n\tx.xxx_hidden_Location = v\n}\n\nfunc (x *Message) SetMessageExtensions(v []*Field) {\n\tx.xxx_hidden_MessageExtensions = &v\n}\n\nfunc (x *Message) SetImplicitlyDeprecated(v bool) {\n\tx.xxx_hidden_ImplicitlyDeprecated = v\n}\n\nfunc (x *Message) SetOptions(v []*FieldLiteral) {\n\tx.xxx_hidden_Options = &v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Message) SetMessageOptions(v *MessageOptions) {\n\tx.xxx_hidden_MessageOptions = v\n}\n\nfunc (x *Message) HasLocation() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Location != nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Message) HasMessageOptions() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_MessageOptions != nil\n}\n\nfunc (x *Message) ClearLocation() {\n\tx.xxx_hidden_Location = nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Message) ClearMessageOptions() {\n\tx.xxx_hidden_MessageOptions = nil\n}\n\ntype Message_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n\t// nested_name includes the nested types for a given type definition.\n\tNestedName string\n\t// full_name includes the package name and nested types for a given type definition.\n\tFullName string\n\t// comments is derived from the leading comments of a given message.\n\t//\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\t// file_path is the normalized path of the file containing the message.\n\tFilePath          string\n\tIsMapEntry        bool\n\tFields            []*MessageField\n\tLocation          *Location\n\tMessageExtensions []*Field\n\t// implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n\tImplicitlyDeprecated bool\n\t// All options that are present on the message. This is a super-set of\n\t// message_options and uses a dynamic representation so it can also\n\t// accommodate custom options with arbitrary types.\n\t// // This supersedes message_options.\n\tOptions []*FieldLiteral\n\t// Use options instead.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\n\tMessageOptions *MessageOptions\n}\n\nfunc (b0 Message_builder) Build() *Message {\n\tm0 := &Message{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_NestedName = b.NestedName\n\tx.xxx_hidden_FullName = b.FullName\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_FilePath = b.FilePath\n\tx.xxx_hidden_IsMapEntry = b.IsMapEntry\n\tx.xxx_hidden_Fields = &b.Fields\n\tx.xxx_hidden_Location = b.Location\n\tx.xxx_hidden_MessageExtensions = &b.MessageExtensions\n\tx.xxx_hidden_ImplicitlyDeprecated = b.ImplicitlyDeprecated\n\tx.xxx_hidden_Options = &b.Options\n\tx.xxx_hidden_MessageOptions = b.MessageOptions\n\treturn m0\n}\n\n// MessageField can be either a single field or a oneof set of fields.\ntype MessageField struct {\n\tstate                   protoimpl.MessageState      `protogen:\"opaque.v1\"`\n\txxx_hidden_MessageField isMessageField_MessageField `protobuf_oneof:\"message_field\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *MessageField) Reset() {\n\t*x = MessageField{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MessageField) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MessageField) ProtoMessage() {}\n\nfunc (x *MessageField) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26]\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\nfunc (x *MessageField) GetField() *Field {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageField.(*messageField_Field); ok {\n\t\t\treturn x.Field\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *MessageField) GetOneof() *Oneof {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageField.(*messageField_Oneof); ok {\n\t\t\treturn x.Oneof\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *MessageField) SetField(v *Field) {\n\tif v == nil {\n\t\tx.xxx_hidden_MessageField = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_MessageField = &messageField_Field{v}\n}\n\nfunc (x *MessageField) SetOneof(v *Oneof) {\n\tif v == nil {\n\t\tx.xxx_hidden_MessageField = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_MessageField = &messageField_Oneof{v}\n}\n\nfunc (x *MessageField) HasMessageField() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_MessageField != nil\n}\n\nfunc (x *MessageField) HasField() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageField.(*messageField_Field)\n\treturn ok\n}\n\nfunc (x *MessageField) HasOneof() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageField.(*messageField_Oneof)\n\treturn ok\n}\n\nfunc (x *MessageField) ClearMessageField() {\n\tx.xxx_hidden_MessageField = nil\n}\n\nfunc (x *MessageField) ClearField() {\n\tif _, ok := x.xxx_hidden_MessageField.(*messageField_Field); ok {\n\t\tx.xxx_hidden_MessageField = nil\n\t}\n}\n\nfunc (x *MessageField) ClearOneof() {\n\tif _, ok := x.xxx_hidden_MessageField.(*messageField_Oneof); ok {\n\t\tx.xxx_hidden_MessageField = nil\n\t}\n}\n\nconst MessageField_MessageField_not_set_case case_MessageField_MessageField = 0\nconst MessageField_Field_case case_MessageField_MessageField = 1\nconst MessageField_Oneof_case case_MessageField_MessageField = 2\n\nfunc (x *MessageField) WhichMessageField() case_MessageField_MessageField {\n\tif x == nil {\n\t\treturn MessageField_MessageField_not_set_case\n\t}\n\tswitch x.xxx_hidden_MessageField.(type) {\n\tcase *messageField_Field:\n\t\treturn MessageField_Field_case\n\tcase *messageField_Oneof:\n\t\treturn MessageField_Oneof_case\n\tdefault:\n\t\treturn MessageField_MessageField_not_set_case\n\t}\n}\n\ntype MessageField_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_MessageField:\n\tField *Field\n\tOneof *Oneof\n\t// -- end of xxx_hidden_MessageField\n}\n\nfunc (b0 MessageField_builder) Build() *MessageField {\n\tm0 := &MessageField{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Field != nil {\n\t\tx.xxx_hidden_MessageField = &messageField_Field{b.Field}\n\t}\n\tif b.Oneof != nil {\n\t\tx.xxx_hidden_MessageField = &messageField_Oneof{b.Oneof}\n\t}\n\treturn m0\n}\n\ntype case_MessageField_MessageField protoreflect.FieldNumber\n\nfunc (x case_MessageField_MessageField) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isMessageField_MessageField interface {\n\tisMessageField_MessageField()\n}\n\ntype messageField_Field struct {\n\tField *Field `protobuf:\"bytes,1,opt,name=field,proto3,oneof\"`\n}\n\ntype messageField_Oneof struct {\n\tOneof *Oneof `protobuf:\"bytes,2,opt,name=oneof,proto3,oneof\"`\n}\n\nfunc (*messageField_Field) isMessageField_MessageField() {}\n\nfunc (*messageField_Oneof) isMessageField_MessageField() {}\n\n// MessageOptions provides information for the documentation of options for a message.\n//\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype MessageOptions struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Deprecated bool                   `protobuf:\"varint,1,opt,name=deprecated,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *MessageOptions) Reset() {\n\t*x = MessageOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[27]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MessageOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MessageOptions) ProtoMessage() {}\n\nfunc (x *MessageOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[27]\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\nfunc (x *MessageOptions) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *MessageOptions) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype MessageOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tDeprecated bool\n}\n\nfunc (b0 MessageOptions_builder) Build() *MessageOptions {\n\tm0 := &MessageOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\treturn m0\n}\n\n// Oneof represents a oneof set of fields.\ntype Oneof struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name    string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Fields  *[]*Field              `protobuf:\"bytes,2,rep,name=fields,proto3\"`\n\txxx_hidden_Options *[]*FieldLiteral       `protobuf:\"bytes,3,rep,name=options,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *Oneof) Reset() {\n\t*x = Oneof{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[28]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Oneof) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Oneof) ProtoMessage() {}\n\nfunc (x *Oneof) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[28]\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\nfunc (x *Oneof) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Oneof) GetFields() []*Field {\n\tif x != nil {\n\t\tif x.xxx_hidden_Fields != nil {\n\t\t\treturn *x.xxx_hidden_Fields\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Oneof) GetOptions() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Options != nil {\n\t\t\treturn *x.xxx_hidden_Options\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Oneof) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Oneof) SetFields(v []*Field) {\n\tx.xxx_hidden_Fields = &v\n}\n\nfunc (x *Oneof) SetOptions(v []*FieldLiteral) {\n\tx.xxx_hidden_Options = &v\n}\n\ntype Oneof_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName   string\n\tFields []*Field\n\t// All options that are present on the OneOf.\n\t// This is a dynamic representation so it can also\n\t// accommodate custom options with arbitrary types.\n\tOptions []*FieldLiteral\n}\n\nfunc (b0 Oneof_builder) Build() *Oneof {\n\tm0 := &Oneof{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Fields = &b.Fields\n\tx.xxx_hidden_Options = &b.Options\n\treturn m0\n}\n\n// Field provides information for the documentation of a message field.\ntype Field struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name            string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Comments        string                 `protobuf:\"bytes,2,opt,name=comments,proto3\"`\n\txxx_hidden_Label           string                 `protobuf:\"bytes,3,opt,name=label,proto3\"`\n\txxx_hidden_NestedType      string                 `protobuf:\"bytes,4,opt,name=nested_type,json=nestedType,proto3\"`\n\txxx_hidden_FullType        string                 `protobuf:\"bytes,5,opt,name=full_type,json=fullType,proto3\"`\n\txxx_hidden_Tag             uint32                 `protobuf:\"varint,6,opt,name=tag,proto3\"`\n\txxx_hidden_MapEntry        *MapEntry              `protobuf:\"bytes,7,opt,name=map_entry,json=mapEntry,proto3\"`\n\txxx_hidden_ImportModuleRef *ImportModuleRef       `protobuf:\"bytes,8,opt,name=import_module_ref,json=importModuleRef,proto3\"`\n\txxx_hidden_Extendee        string                 `protobuf:\"bytes,9,opt,name=extendee,proto3\"`\n\txxx_hidden_Options         *[]*FieldLiteral       `protobuf:\"bytes,11,rep,name=options,proto3\"`\n\txxx_hidden_FieldOptions    *FieldOptions          `protobuf:\"bytes,10,opt,name=field_options,json=fieldOptions,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *Field) Reset() {\n\t*x = Field{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[29]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Field) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Field) ProtoMessage() {}\n\nfunc (x *Field) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[29]\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\nfunc (x *Field) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Field) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *Field) GetLabel() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Label\n\t}\n\treturn \"\"\n}\n\nfunc (x *Field) GetNestedType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NestedType\n\t}\n\treturn \"\"\n}\n\nfunc (x *Field) GetFullType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullType\n\t}\n\treturn \"\"\n}\n\nfunc (x *Field) GetTag() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Tag\n\t}\n\treturn 0\n}\n\nfunc (x *Field) GetMapEntry() *MapEntry {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MapEntry\n\t}\n\treturn nil\n}\n\nfunc (x *Field) GetImportModuleRef() *ImportModuleRef {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImportModuleRef\n\t}\n\treturn nil\n}\n\nfunc (x *Field) GetExtendee() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Extendee\n\t}\n\treturn \"\"\n}\n\nfunc (x *Field) GetOptions() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Options != nil {\n\t\t\treturn *x.xxx_hidden_Options\n\t\t}\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Field) GetFieldOptions() *FieldOptions {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FieldOptions\n\t}\n\treturn nil\n}\n\nfunc (x *Field) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Field) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *Field) SetLabel(v string) {\n\tx.xxx_hidden_Label = v\n}\n\nfunc (x *Field) SetNestedType(v string) {\n\tx.xxx_hidden_NestedType = v\n}\n\nfunc (x *Field) SetFullType(v string) {\n\tx.xxx_hidden_FullType = v\n}\n\nfunc (x *Field) SetTag(v uint32) {\n\tx.xxx_hidden_Tag = v\n}\n\nfunc (x *Field) SetMapEntry(v *MapEntry) {\n\tx.xxx_hidden_MapEntry = v\n}\n\nfunc (x *Field) SetImportModuleRef(v *ImportModuleRef) {\n\tx.xxx_hidden_ImportModuleRef = v\n}\n\nfunc (x *Field) SetExtendee(v string) {\n\tx.xxx_hidden_Extendee = v\n}\n\nfunc (x *Field) SetOptions(v []*FieldLiteral) {\n\tx.xxx_hidden_Options = &v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Field) SetFieldOptions(v *FieldOptions) {\n\tx.xxx_hidden_FieldOptions = v\n}\n\nfunc (x *Field) HasMapEntry() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_MapEntry != nil\n}\n\nfunc (x *Field) HasImportModuleRef() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ImportModuleRef != nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Field) HasFieldOptions() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_FieldOptions != nil\n}\n\nfunc (x *Field) ClearMapEntry() {\n\tx.xxx_hidden_MapEntry = nil\n}\n\nfunc (x *Field) ClearImportModuleRef() {\n\tx.xxx_hidden_ImportModuleRef = nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\nfunc (x *Field) ClearFieldOptions() {\n\tx.xxx_hidden_FieldOptions = nil\n}\n\ntype Field_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n\t// comments is derived from the leading comments of a given message field.\n\t//\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\tLabel    string\n\t// string representation of the nested name of the field type, which includes nested definitions.\n\tNestedType string\n\t// string representation of the full name of the field type, which includes package name\n\t// and nested definitions.\n\tFullType string\n\tTag      uint32\n\t// MapEntry is present if the field is a map type.\n\tMapEntry *MapEntry\n\t// import_module_ref is included if the field is an imported type.\n\t// It contains all the metadata for the import.\n\tImportModuleRef *ImportModuleRef\n\t// Extendee is the name of the type that is being ext if the field is an extension.\n\t// This is an empty string for fields that are not extensions.\n\tExtendee string\n\t// All options that are present on the field. This is a super-set of\n\t// field_options and uses a dynamic representation so it can also\n\t// accommodate custom options with arbitrary types.\n\t// This supersedes field_options.\n\tOptions []*FieldLiteral\n\t// Use options instead.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\n\tFieldOptions *FieldOptions\n}\n\nfunc (b0 Field_builder) Build() *Field {\n\tm0 := &Field{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_Label = b.Label\n\tx.xxx_hidden_NestedType = b.NestedType\n\tx.xxx_hidden_FullType = b.FullType\n\tx.xxx_hidden_Tag = b.Tag\n\tx.xxx_hidden_MapEntry = b.MapEntry\n\tx.xxx_hidden_ImportModuleRef = b.ImportModuleRef\n\tx.xxx_hidden_Extendee = b.Extendee\n\tx.xxx_hidden_Options = &b.Options\n\tx.xxx_hidden_FieldOptions = b.FieldOptions\n\treturn m0\n}\n\n// FieldOptions provides information for the documentation of options for a field.\n//\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype FieldOptions struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Deprecated  bool                   `protobuf:\"varint,1,opt,name=deprecated,proto3\"`\n\txxx_hidden_Packed      bool                   `protobuf:\"varint,2,opt,name=packed,proto3,oneof\"`\n\txxx_hidden_Ctype       int32                  `protobuf:\"varint,3,opt,name=ctype,proto3\"`\n\txxx_hidden_Jstype      int32                  `protobuf:\"varint,4,opt,name=jstype,proto3\"`\n\tXXX_raceDetectHookData protoimpl.RaceDetectHookData\n\tXXX_presence           [1]uint32\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *FieldOptions) Reset() {\n\t*x = FieldOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[30]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *FieldOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*FieldOptions) ProtoMessage() {}\n\nfunc (x *FieldOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[30]\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\nfunc (x *FieldOptions) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *FieldOptions) GetPacked() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Packed\n\t}\n\treturn false\n}\n\nfunc (x *FieldOptions) GetCtype() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Ctype\n\t}\n\treturn 0\n}\n\nfunc (x *FieldOptions) GetJstype() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Jstype\n\t}\n\treturn 0\n}\n\nfunc (x *FieldOptions) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *FieldOptions) SetPacked(v bool) {\n\tx.xxx_hidden_Packed = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 4)\n}\n\nfunc (x *FieldOptions) SetCtype(v int32) {\n\tx.xxx_hidden_Ctype = v\n}\n\nfunc (x *FieldOptions) SetJstype(v int32) {\n\tx.xxx_hidden_Jstype = v\n}\n\nfunc (x *FieldOptions) HasPacked() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *FieldOptions) ClearPacked() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_Packed = false\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/doc.proto.\ntype FieldOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tDeprecated bool\n\tPacked     *bool\n\t// ctype holds a value of the enumeration `google.protobuf.FieldOptions.CType.\n\tCtype int32\n\t// jstype holds a value of the enumeration `google.protobuf.FieldOptions.JSType.\n\tJstype int32\n}\n\nfunc (b0 FieldOptions_builder) Build() *FieldOptions {\n\tm0 := &FieldOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\tif b.Packed != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 4)\n\t\tx.xxx_hidden_Packed = *b.Packed\n\t}\n\tx.xxx_hidden_Ctype = b.Ctype\n\tx.xxx_hidden_Jstype = b.Jstype\n\treturn m0\n}\n\n// FieldLiteral represents a field and its value. It can be used to model descriptor options.\ntype FieldLiteral struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name            string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Tag             int32                  `protobuf:\"varint,2,opt,name=tag,proto3\"`\n\txxx_hidden_FieldType       FieldType              `protobuf:\"varint,3,opt,name=field_type,json=fieldType,proto3,enum=buf.alpha.registry.v1alpha1.FieldType\"`\n\txxx_hidden_Value           *LiteralValue          `protobuf:\"bytes,4,opt,name=value,proto3\"`\n\txxx_hidden_ImportModuleRef *ImportModuleRef       `protobuf:\"bytes,5,opt,name=import_module_ref,json=importModuleRef,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *FieldLiteral) Reset() {\n\t*x = FieldLiteral{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[31]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *FieldLiteral) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*FieldLiteral) ProtoMessage() {}\n\nfunc (x *FieldLiteral) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[31]\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\nfunc (x *FieldLiteral) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *FieldLiteral) GetTag() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Tag\n\t}\n\treturn 0\n}\n\nfunc (x *FieldLiteral) GetFieldType() FieldType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FieldType\n\t}\n\treturn FieldType_FIELD_TYPE_UNSPECIFIED\n}\n\nfunc (x *FieldLiteral) GetValue() *LiteralValue {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Value\n\t}\n\treturn nil\n}\n\nfunc (x *FieldLiteral) GetImportModuleRef() *ImportModuleRef {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImportModuleRef\n\t}\n\treturn nil\n}\n\nfunc (x *FieldLiteral) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *FieldLiteral) SetTag(v int32) {\n\tx.xxx_hidden_Tag = v\n}\n\nfunc (x *FieldLiteral) SetFieldType(v FieldType) {\n\tx.xxx_hidden_FieldType = v\n}\n\nfunc (x *FieldLiteral) SetValue(v *LiteralValue) {\n\tx.xxx_hidden_Value = v\n}\n\nfunc (x *FieldLiteral) SetImportModuleRef(v *ImportModuleRef) {\n\tx.xxx_hidden_ImportModuleRef = v\n}\n\nfunc (x *FieldLiteral) HasValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Value != nil\n}\n\nfunc (x *FieldLiteral) HasImportModuleRef() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ImportModuleRef != nil\n}\n\nfunc (x *FieldLiteral) ClearValue() {\n\tx.xxx_hidden_Value = nil\n}\n\nfunc (x *FieldLiteral) ClearImportModuleRef() {\n\tx.xxx_hidden_ImportModuleRef = nil\n}\n\ntype FieldLiteral_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// When is_extension is true, name is the fully-qualified name of the\n\t// extension. Otherwise, it is the simple name of the field.\n\tName string\n\t// The unique field number associated with the field.\n\tTag int32\n\t// Indicates whether this is an extension or not.\n\tFieldType FieldType\n\t// The field's value.\n\tValue *LiteralValue\n\t// This is the module where the extension is defined if the field type\n\t// is extension or the module where the messages is defined for field type any.\n\tImportModuleRef *ImportModuleRef\n}\n\nfunc (b0 FieldLiteral_builder) Build() *FieldLiteral {\n\tm0 := &FieldLiteral{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Tag = b.Tag\n\tx.xxx_hidden_FieldType = b.FieldType\n\tx.xxx_hidden_Value = b.Value\n\tx.xxx_hidden_ImportModuleRef = b.ImportModuleRef\n\treturn m0\n}\n\n// MessageLiteral represents an option value for a type that is a message.\ntype MessageLiteral struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Fields *[]*FieldLiteral       `protobuf:\"bytes,1,rep,name=fields,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *MessageLiteral) Reset() {\n\t*x = MessageLiteral{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[32]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MessageLiteral) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MessageLiteral) ProtoMessage() {}\n\nfunc (x *MessageLiteral) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[32]\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\nfunc (x *MessageLiteral) GetFields() []*FieldLiteral {\n\tif x != nil {\n\t\tif x.xxx_hidden_Fields != nil {\n\t\t\treturn *x.xxx_hidden_Fields\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *MessageLiteral) SetFields(v []*FieldLiteral) {\n\tx.xxx_hidden_Fields = &v\n}\n\ntype MessageLiteral_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Map of field names to value. Extension field names will be in the form:\n\t// [fully.qualified.extension.Name].\n\tFields []*FieldLiteral\n}\n\nfunc (b0 MessageLiteral_builder) Build() *MessageLiteral {\n\tm0 := &MessageLiteral{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Fields = &b.Fields\n\treturn m0\n}\n\n// ArrayLiteral represents an option value for a type that is a repeated field.\n// Maps are also represented using an ArrayLiteral, where each map entry is a MessageLiteral\n// that contains a key and value field.\ntype ArrayLiteral struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Elements *[]*LiteralValue       `protobuf:\"bytes,1,rep,name=elements,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *ArrayLiteral) Reset() {\n\t*x = ArrayLiteral{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[33]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ArrayLiteral) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ArrayLiteral) ProtoMessage() {}\n\nfunc (x *ArrayLiteral) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[33]\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\nfunc (x *ArrayLiteral) GetElements() []*LiteralValue {\n\tif x != nil {\n\t\tif x.xxx_hidden_Elements != nil {\n\t\t\treturn *x.xxx_hidden_Elements\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ArrayLiteral) SetElements(v []*LiteralValue) {\n\tx.xxx_hidden_Elements = &v\n}\n\ntype ArrayLiteral_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tElements []*LiteralValue\n}\n\nfunc (b0 ArrayLiteral_builder) Build() *ArrayLiteral {\n\tm0 := &ArrayLiteral{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Elements = &b.Elements\n\treturn m0\n}\n\n// LiteralValue represents the actual value of the extension.\ntype LiteralValue struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Value    isLiteralValue_Value   `protobuf_oneof:\"value\"`\n\txxx_hidden_Comments string                 `protobuf:\"bytes,10,opt,name=comments,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *LiteralValue) Reset() {\n\t*x = LiteralValue{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[34]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *LiteralValue) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*LiteralValue) ProtoMessage() {}\n\nfunc (x *LiteralValue) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[34]\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\nfunc (x *LiteralValue) GetStringValue() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_StringValue); ok {\n\t\t\treturn x.StringValue\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *LiteralValue) GetIntValue() int64 {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_IntValue); ok {\n\t\t\treturn x.IntValue\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc (x *LiteralValue) GetUintValue() uint64 {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_UintValue); ok {\n\t\t\treturn x.UintValue\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc (x *LiteralValue) GetDoubleValue() float64 {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_DoubleValue); ok {\n\t\t\treturn x.DoubleValue\n\t\t}\n\t}\n\treturn 0\n}\n\nfunc (x *LiteralValue) GetBoolValue() bool {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_BoolValue); ok {\n\t\t\treturn x.BoolValue\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (x *LiteralValue) GetEnumValueNameValue() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_EnumValueNameValue); ok {\n\t\t\treturn x.EnumValueNameValue\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *LiteralValue) GetArrayValue() *ArrayLiteral {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_ArrayValue); ok {\n\t\t\treturn x.ArrayValue\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *LiteralValue) GetMessageValue() *MessageLiteral {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Value.(*literalValue_MessageValue); ok {\n\t\t\treturn x.MessageValue\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *LiteralValue) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *LiteralValue) SetStringValue(v string) {\n\tx.xxx_hidden_Value = &literalValue_StringValue{v}\n}\n\nfunc (x *LiteralValue) SetIntValue(v int64) {\n\tx.xxx_hidden_Value = &literalValue_IntValue{v}\n}\n\nfunc (x *LiteralValue) SetUintValue(v uint64) {\n\tx.xxx_hidden_Value = &literalValue_UintValue{v}\n}\n\nfunc (x *LiteralValue) SetDoubleValue(v float64) {\n\tx.xxx_hidden_Value = &literalValue_DoubleValue{v}\n}\n\nfunc (x *LiteralValue) SetBoolValue(v bool) {\n\tx.xxx_hidden_Value = &literalValue_BoolValue{v}\n}\n\nfunc (x *LiteralValue) SetEnumValueNameValue(v string) {\n\tx.xxx_hidden_Value = &literalValue_EnumValueNameValue{v}\n}\n\nfunc (x *LiteralValue) SetArrayValue(v *ArrayLiteral) {\n\tif v == nil {\n\t\tx.xxx_hidden_Value = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Value = &literalValue_ArrayValue{v}\n}\n\nfunc (x *LiteralValue) SetMessageValue(v *MessageLiteral) {\n\tif v == nil {\n\t\tx.xxx_hidden_Value = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Value = &literalValue_MessageValue{v}\n}\n\nfunc (x *LiteralValue) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *LiteralValue) HasValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Value != nil\n}\n\nfunc (x *LiteralValue) HasStringValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_StringValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) HasIntValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_IntValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) HasUintValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_UintValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) HasDoubleValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_DoubleValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) HasBoolValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_BoolValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) HasEnumValueNameValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_EnumValueNameValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) HasArrayValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_ArrayValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) HasMessageValue() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Value.(*literalValue_MessageValue)\n\treturn ok\n}\n\nfunc (x *LiteralValue) ClearValue() {\n\tx.xxx_hidden_Value = nil\n}\n\nfunc (x *LiteralValue) ClearStringValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_StringValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nfunc (x *LiteralValue) ClearIntValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_IntValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nfunc (x *LiteralValue) ClearUintValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_UintValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nfunc (x *LiteralValue) ClearDoubleValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_DoubleValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nfunc (x *LiteralValue) ClearBoolValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_BoolValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nfunc (x *LiteralValue) ClearEnumValueNameValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_EnumValueNameValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nfunc (x *LiteralValue) ClearArrayValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_ArrayValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nfunc (x *LiteralValue) ClearMessageValue() {\n\tif _, ok := x.xxx_hidden_Value.(*literalValue_MessageValue); ok {\n\t\tx.xxx_hidden_Value = nil\n\t}\n}\n\nconst LiteralValue_Value_not_set_case case_LiteralValue_Value = 0\nconst LiteralValue_StringValue_case case_LiteralValue_Value = 2\nconst LiteralValue_IntValue_case case_LiteralValue_Value = 3\nconst LiteralValue_UintValue_case case_LiteralValue_Value = 4\nconst LiteralValue_DoubleValue_case case_LiteralValue_Value = 5\nconst LiteralValue_BoolValue_case case_LiteralValue_Value = 6\nconst LiteralValue_EnumValueNameValue_case case_LiteralValue_Value = 7\nconst LiteralValue_ArrayValue_case case_LiteralValue_Value = 8\nconst LiteralValue_MessageValue_case case_LiteralValue_Value = 9\n\nfunc (x *LiteralValue) WhichValue() case_LiteralValue_Value {\n\tif x == nil {\n\t\treturn LiteralValue_Value_not_set_case\n\t}\n\tswitch x.xxx_hidden_Value.(type) {\n\tcase *literalValue_StringValue:\n\t\treturn LiteralValue_StringValue_case\n\tcase *literalValue_IntValue:\n\t\treturn LiteralValue_IntValue_case\n\tcase *literalValue_UintValue:\n\t\treturn LiteralValue_UintValue_case\n\tcase *literalValue_DoubleValue:\n\t\treturn LiteralValue_DoubleValue_case\n\tcase *literalValue_BoolValue:\n\t\treturn LiteralValue_BoolValue_case\n\tcase *literalValue_EnumValueNameValue:\n\t\treturn LiteralValue_EnumValueNameValue_case\n\tcase *literalValue_ArrayValue:\n\t\treturn LiteralValue_ArrayValue_case\n\tcase *literalValue_MessageValue:\n\t\treturn LiteralValue_MessageValue_case\n\tdefault:\n\t\treturn LiteralValue_Value_not_set_case\n\t}\n}\n\ntype LiteralValue_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Value:\n\tStringValue        *string\n\tIntValue           *int64\n\tUintValue          *uint64\n\tDoubleValue        *float64\n\tBoolValue          *bool\n\tEnumValueNameValue *string\n\tArrayValue         *ArrayLiteral\n\tMessageValue       *MessageLiteral\n\t// -- end of xxx_hidden_Value\n\tComments string\n}\n\nfunc (b0 LiteralValue_builder) Build() *LiteralValue {\n\tm0 := &LiteralValue{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.StringValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_StringValue{*b.StringValue}\n\t}\n\tif b.IntValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_IntValue{*b.IntValue}\n\t}\n\tif b.UintValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_UintValue{*b.UintValue}\n\t}\n\tif b.DoubleValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_DoubleValue{*b.DoubleValue}\n\t}\n\tif b.BoolValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_BoolValue{*b.BoolValue}\n\t}\n\tif b.EnumValueNameValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_EnumValueNameValue{*b.EnumValueNameValue}\n\t}\n\tif b.ArrayValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_ArrayValue{b.ArrayValue}\n\t}\n\tif b.MessageValue != nil {\n\t\tx.xxx_hidden_Value = &literalValue_MessageValue{b.MessageValue}\n\t}\n\tx.xxx_hidden_Comments = b.Comments\n\treturn m0\n}\n\ntype case_LiteralValue_Value protoreflect.FieldNumber\n\nfunc (x case_LiteralValue_Value) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[34].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isLiteralValue_Value interface {\n\tisLiteralValue_Value()\n}\n\ntype literalValue_StringValue struct {\n\tStringValue string `protobuf:\"bytes,2,opt,name=string_value,json=stringValue,proto3,oneof\"`\n}\n\ntype literalValue_IntValue struct {\n\tIntValue int64 `protobuf:\"varint,3,opt,name=int_value,json=intValue,proto3,oneof\"`\n}\n\ntype literalValue_UintValue struct {\n\tUintValue uint64 `protobuf:\"varint,4,opt,name=uint_value,json=uintValue,proto3,oneof\"`\n}\n\ntype literalValue_DoubleValue struct {\n\tDoubleValue float64 `protobuf:\"fixed64,5,opt,name=double_value,json=doubleValue,proto3,oneof\"`\n}\n\ntype literalValue_BoolValue struct {\n\tBoolValue bool `protobuf:\"varint,6,opt,name=bool_value,json=boolValue,proto3,oneof\"`\n}\n\ntype literalValue_EnumValueNameValue struct {\n\tEnumValueNameValue string `protobuf:\"bytes,7,opt,name=enum_value_name_value,json=enumValueNameValue,proto3,oneof\"`\n}\n\ntype literalValue_ArrayValue struct {\n\tArrayValue *ArrayLiteral `protobuf:\"bytes,8,opt,name=array_value,json=arrayValue,proto3,oneof\"`\n}\n\ntype literalValue_MessageValue struct {\n\tMessageValue *MessageLiteral `protobuf:\"bytes,9,opt,name=message_value,json=messageValue,proto3,oneof\"`\n}\n\nfunc (*literalValue_StringValue) isLiteralValue_Value() {}\n\nfunc (*literalValue_IntValue) isLiteralValue_Value() {}\n\nfunc (*literalValue_UintValue) isLiteralValue_Value() {}\n\nfunc (*literalValue_DoubleValue) isLiteralValue_Value() {}\n\nfunc (*literalValue_BoolValue) isLiteralValue_Value() {}\n\nfunc (*literalValue_EnumValueNameValue) isLiteralValue_Value() {}\n\nfunc (*literalValue_ArrayValue) isLiteralValue_Value() {}\n\nfunc (*literalValue_MessageValue) isLiteralValue_Value() {}\n\n// MapEntry provides the key and value types for the MapEntry type for a map field.\ntype MapEntry struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_KeyFullType          string                 `protobuf:\"bytes,1,opt,name=key_full_type,json=keyFullType,proto3\"`\n\txxx_hidden_ValueNestedType      string                 `protobuf:\"bytes,2,opt,name=value_nested_type,json=valueNestedType,proto3\"`\n\txxx_hidden_ValueFullType        string                 `protobuf:\"bytes,3,opt,name=value_full_type,json=valueFullType,proto3\"`\n\txxx_hidden_ValueImportModuleRef *ImportModuleRef       `protobuf:\"bytes,4,opt,name=value_import_module_ref,json=valueImportModuleRef,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *MapEntry) Reset() {\n\t*x = MapEntry{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[35]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MapEntry) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MapEntry) ProtoMessage() {}\n\nfunc (x *MapEntry) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[35]\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\nfunc (x *MapEntry) GetKeyFullType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_KeyFullType\n\t}\n\treturn \"\"\n}\n\nfunc (x *MapEntry) GetValueNestedType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ValueNestedType\n\t}\n\treturn \"\"\n}\n\nfunc (x *MapEntry) GetValueFullType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ValueFullType\n\t}\n\treturn \"\"\n}\n\nfunc (x *MapEntry) GetValueImportModuleRef() *ImportModuleRef {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ValueImportModuleRef\n\t}\n\treturn nil\n}\n\nfunc (x *MapEntry) SetKeyFullType(v string) {\n\tx.xxx_hidden_KeyFullType = v\n}\n\nfunc (x *MapEntry) SetValueNestedType(v string) {\n\tx.xxx_hidden_ValueNestedType = v\n}\n\nfunc (x *MapEntry) SetValueFullType(v string) {\n\tx.xxx_hidden_ValueFullType = v\n}\n\nfunc (x *MapEntry) SetValueImportModuleRef(v *ImportModuleRef) {\n\tx.xxx_hidden_ValueImportModuleRef = v\n}\n\nfunc (x *MapEntry) HasValueImportModuleRef() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ValueImportModuleRef != nil\n}\n\nfunc (x *MapEntry) ClearValueImportModuleRef() {\n\tx.xxx_hidden_ValueImportModuleRef = nil\n}\n\ntype MapEntry_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// string representation of the full name of the type for the map key. keys can only be\n\t// scalar types: https://developers.google.com/protocol-buffers/docs/overview#maps\n\tKeyFullType string\n\t// string representation of the nested name of the type for the map value.\n\tValueNestedType string\n\t// string representation of the full name of the type for the map value.\n\tValueFullType string\n\t// if the value is an imported type, this is the import module ref\n\tValueImportModuleRef *ImportModuleRef\n}\n\nfunc (b0 MapEntry_builder) Build() *MapEntry {\n\tm0 := &MapEntry{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_KeyFullType = b.KeyFullType\n\tx.xxx_hidden_ValueNestedType = b.ValueNestedType\n\tx.xxx_hidden_ValueFullType = b.ValueFullType\n\tx.xxx_hidden_ValueImportModuleRef = b.ValueImportModuleRef\n\treturn m0\n}\n\n// FileExtension provides the information for the documentation of a file extension.\ntype FileExtension struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ExtensionType        string                 `protobuf:\"bytes,1,opt,name=extension_type,json=extensionType,proto3\"`\n\txxx_hidden_Comments             string                 `protobuf:\"bytes,2,opt,name=comments,proto3\"`\n\txxx_hidden_FilePath             string                 `protobuf:\"bytes,3,opt,name=file_path,json=filePath,proto3\"`\n\txxx_hidden_Location             *Location              `protobuf:\"bytes,4,opt,name=location,proto3\"`\n\txxx_hidden_Fields               *[]*Field              `protobuf:\"bytes,5,rep,name=fields,proto3\"`\n\txxx_hidden_ImplicitlyDeprecated bool                   `protobuf:\"varint,6,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *FileExtension) Reset() {\n\t*x = FileExtension{}\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[36]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *FileExtension) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*FileExtension) ProtoMessage() {}\n\nfunc (x *FileExtension) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[36]\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\nfunc (x *FileExtension) GetExtensionType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExtensionType\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileExtension) GetComments() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Comments\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileExtension) GetFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileExtension) GetLocation() *Location {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Location\n\t}\n\treturn nil\n}\n\nfunc (x *FileExtension) GetFields() []*Field {\n\tif x != nil {\n\t\tif x.xxx_hidden_Fields != nil {\n\t\t\treturn *x.xxx_hidden_Fields\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *FileExtension) GetImplicitlyDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImplicitlyDeprecated\n\t}\n\treturn false\n}\n\nfunc (x *FileExtension) SetExtensionType(v string) {\n\tx.xxx_hidden_ExtensionType = v\n}\n\nfunc (x *FileExtension) SetComments(v string) {\n\tx.xxx_hidden_Comments = v\n}\n\nfunc (x *FileExtension) SetFilePath(v string) {\n\tx.xxx_hidden_FilePath = v\n}\n\nfunc (x *FileExtension) SetLocation(v *Location) {\n\tx.xxx_hidden_Location = v\n}\n\nfunc (x *FileExtension) SetFields(v []*Field) {\n\tx.xxx_hidden_Fields = &v\n}\n\nfunc (x *FileExtension) SetImplicitlyDeprecated(v bool) {\n\tx.xxx_hidden_ImplicitlyDeprecated = v\n}\n\nfunc (x *FileExtension) HasLocation() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Location != nil\n}\n\nfunc (x *FileExtension) ClearLocation() {\n\tx.xxx_hidden_Location = nil\n}\n\ntype FileExtension_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// extension_type is the string representation of the type being extended.\n\tExtensionType string\n\t// comments is derived from the leading comments of a given message field.\n\t//\n\t// Paragraph newlines (double new lines) are respected, however single newlines are not.\n\t// Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n\tComments string\n\t// file_path is the normalized path of the file containing the message.\n\tFilePath string\n\tLocation *Location\n\t// fields are all the fields that are associated with the extension.\n\tFields []*Field\n\t// implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n\tImplicitlyDeprecated bool\n}\n\nfunc (b0 FileExtension_builder) Build() *FileExtension {\n\tm0 := &FileExtension{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ExtensionType = b.ExtensionType\n\tx.xxx_hidden_Comments = b.Comments\n\tx.xxx_hidden_FilePath = b.FilePath\n\tx.xxx_hidden_Location = b.Location\n\tx.xxx_hidden_Fields = &b.Fields\n\tx.xxx_hidden_ImplicitlyDeprecated = b.ImplicitlyDeprecated\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_doc_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_doc_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"%buf/alpha/registry/v1alpha1/doc.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\\"s\\n\" +\n\t\"\\x1dGetSourceDirectoryInfoRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"[\\n\" +\n\t\"\\x1eGetSourceDirectoryInfoResponse\\x129\\n\" +\n\t\"\\x04root\\x18\\x01 \\x01(\\v2%.buf.alpha.registry.v1alpha1.FileInfoR\\x04root\\\"x\\n\" +\n\t\"\\bFileInfo\\x12\\x12\\n\" +\n\t\"\\x04path\\x18\\x01 \\x01(\\tR\\x04path\\x12\\x15\\n\" +\n\t\"\\x06is_dir\\x18\\x02 \\x01(\\bR\\x05isDir\\x12A\\n\" +\n\t\"\\bchildren\\x18\\x03 \\x03(\\v2%.buf.alpha.registry.v1alpha1.FileInfoR\\bchildren\\\"~\\n\" +\n\t\"\\x14GetSourceFileRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\x12\\x12\\n\" +\n\t\"\\x04path\\x18\\x04 \\x01(\\tR\\x04path\\\"1\\n\" +\n\t\"\\x15GetSourceFileResponse\\x12\\x18\\n\" +\n\t\"\\acontent\\x18\\x01 \\x01(\\fR\\acontent\\\"n\\n\" +\n\t\"\\x18GetModulePackagesRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"\\x84\\x01\\n\" +\n\t\"\\x19GetModulePackagesResponse\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12S\\n\" +\n\t\"\\x0fmodule_packages\\x18\\x02 \\x03(\\v2*.buf.alpha.registry.v1alpha1.ModulePackageR\\x0emodulePackages\\\"E\\n\" +\n\t\"\\rModulePackage\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12 \\n\" +\n\t\"\\vdescription\\x18\\x02 \\x01(\\tR\\vdescription\\\"s\\n\" +\n\t\"\\x1dGetModuleDocumentationRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"\\x85\\x01\\n\" +\n\t\"\\x1eGetModuleDocumentationResponse\\x12c\\n\" +\n\t\"\\x14module_documentation\\x18\\x01 \\x01(\\v20.buf.alpha.registry.v1alpha1.ModuleDocumentationR\\x13moduleDocumentation\\\"\\x98\\x01\\n\" +\n\t\"\\x13ModuleDocumentation\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12$\\n\" +\n\t\"\\rdocumentation\\x18\\x03 \\x01(\\tR\\rdocumentation\\x12\\x18\\n\" +\n\t\"\\alicense\\x18\\x04 \\x01(\\tR\\alicense\\x12-\\n\" +\n\t\"\\x12documentation_path\\x18\\x05 \\x01(\\tR\\x11documentationPath\\\"\\x97\\x01\\n\" +\n\t\"\\x1eGetPackageDocumentationRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\x12!\\n\" +\n\t\"\\fpackage_name\\x18\\x04 \\x01(\\tR\\vpackageName\\\"\\x89\\x01\\n\" +\n\t\"\\x1fGetPackageDocumentationResponse\\x12f\\n\" +\n\t\"\\x15package_documentation\\x18\\x01 \\x01(\\v21.buf.alpha.registry.v1alpha1.PackageDocumentationR\\x14packageDocumentation\\\"\\xd8\\x02\\n\" +\n\t\"\\x14PackageDocumentation\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x02 \\x01(\\tR\\bcomments\\x12@\\n\" +\n\t\"\\bservices\\x18\\x03 \\x03(\\v2$.buf.alpha.registry.v1alpha1.ServiceR\\bservices\\x127\\n\" +\n\t\"\\x05enums\\x18\\x04 \\x03(\\v2!.buf.alpha.registry.v1alpha1.EnumR\\x05enums\\x12@\\n\" +\n\t\"\\bmessages\\x18\\x05 \\x03(\\v2$.buf.alpha.registry.v1alpha1.MessageR\\bmessages\\x12S\\n\" +\n\t\"\\x0ffile_extensions\\x18\\x06 \\x03(\\v2*.buf.alpha.registry.v1alpha1.FileExtensionR\\x0efileExtensions\\\"\\x86\\x01\\n\" +\n\t\"\\bLocation\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"start_line\\x18\\x01 \\x01(\\x05R\\tstartLine\\x12!\\n\" +\n\t\"\\fstart_column\\x18\\x02 \\x01(\\x05R\\vstartColumn\\x12\\x19\\n\" +\n\t\"\\bend_line\\x18\\x03 \\x01(\\x05R\\aendLine\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"end_column\\x18\\x04 \\x01(\\x05R\\tendColumn\\\"\\xea\\x03\\n\" +\n\t\"\\aService\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x1f\\n\" +\n\t\"\\vnested_name\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"nestedName\\x12\\x1b\\n\" +\n\t\"\\tfull_name\\x18\\x03 \\x01(\\tR\\bfullName\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x04 \\x01(\\tR\\bcomments\\x12\\x1b\\n\" +\n\t\"\\tfile_path\\x18\\x05 \\x01(\\tR\\bfilePath\\x12A\\n\" +\n\t\"\\blocation\\x18\\x06 \\x01(\\v2%.buf.alpha.registry.v1alpha1.LocationR\\blocation\\x12=\\n\" +\n\t\"\\amethods\\x18\\a \\x03(\\v2#.buf.alpha.registry.v1alpha1.MethodR\\amethods\\x123\\n\" +\n\t\"\\x15implicitly_deprecated\\x18\\t \\x01(\\bR\\x14implicitlyDeprecated\\x12C\\n\" +\n\t\"\\aoptions\\x18\\n\" +\n\t\" \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\aoptions\\x12X\\n\" +\n\t\"\\x0fservice_options\\x18\\b \\x01(\\v2+.buf.alpha.registry.v1alpha1.ServiceOptionsB\\x02\\x18\\x01R\\x0eserviceOptions\\\"4\\n\" +\n\t\"\\x0eServiceOptions\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"deprecated:\\x02\\x18\\x01\\\"\\xa7\\x03\\n\" +\n\t\"\\x06Method\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x02 \\x01(\\tR\\bcomments\\x12L\\n\" +\n\t\"\\arequest\\x18\\x03 \\x01(\\v22.buf.alpha.registry.v1alpha1.MethodRequestResponseR\\arequest\\x12N\\n\" +\n\t\"\\bresponse\\x18\\x04 \\x01(\\v22.buf.alpha.registry.v1alpha1.MethodRequestResponseR\\bresponse\\x123\\n\" +\n\t\"\\x15implicitly_deprecated\\x18\\x06 \\x01(\\bR\\x14implicitlyDeprecated\\x12C\\n\" +\n\t\"\\aoptions\\x18\\a \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\aoptions\\x12U\\n\" +\n\t\"\\x0emethod_options\\x18\\x05 \\x01(\\v2*.buf.alpha.registry.v1alpha1.MethodOptionsB\\x02\\x18\\x01R\\rmethodOptions\\\"`\\n\" +\n\t\"\\rMethodOptions\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"deprecated\\x12+\\n\" +\n\t\"\\x11idempotency_level\\x18\\x02 \\x01(\\x05R\\x10idempotencyLevel:\\x02\\x18\\x01\\\"\\x8d\\x02\\n\" +\n\t\"\\x15MethodRequestResponse\\x12\\x1f\\n\" +\n\t\"\\vnested_type\\x18\\x01 \\x01(\\tR\\n\" +\n\t\"nestedType\\x12\\x1b\\n\" +\n\t\"\\tfull_type\\x18\\x02 \\x01(\\tR\\bfullType\\x12\\x1c\\n\" +\n\t\"\\tstreaming\\x18\\x03 \\x01(\\bR\\tstreaming\\x12>\\n\" +\n\t\"\\amessage\\x18\\x04 \\x01(\\v2$.buf.alpha.registry.v1alpha1.MessageR\\amessage\\x12X\\n\" +\n\t\"\\x11import_module_ref\\x18\\x05 \\x01(\\v2,.buf.alpha.registry.v1alpha1.ImportModuleRefR\\x0fimportModuleRef\\\"\\xdf\\x03\\n\" +\n\t\"\\x04Enum\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x1f\\n\" +\n\t\"\\vnested_name\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"nestedName\\x12\\x1b\\n\" +\n\t\"\\tfull_name\\x18\\x03 \\x01(\\tR\\bfullName\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x04 \\x01(\\tR\\bcomments\\x12\\x1b\\n\" +\n\t\"\\tfile_path\\x18\\x05 \\x01(\\tR\\bfilePath\\x12A\\n\" +\n\t\"\\blocation\\x18\\x06 \\x01(\\v2%.buf.alpha.registry.v1alpha1.LocationR\\blocation\\x12>\\n\" +\n\t\"\\x06values\\x18\\a \\x03(\\v2&.buf.alpha.registry.v1alpha1.EnumValueR\\x06values\\x123\\n\" +\n\t\"\\x15implicitly_deprecated\\x18\\t \\x01(\\bR\\x14implicitlyDeprecated\\x12C\\n\" +\n\t\"\\aoptions\\x18\\n\" +\n\t\" \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\aoptions\\x12O\\n\" +\n\t\"\\fenum_options\\x18\\b \\x01(\\v2(.buf.alpha.registry.v1alpha1.EnumOptionsB\\x02\\x18\\x01R\\venumOptions\\\"R\\n\" +\n\t\"\\vEnumOptions\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"deprecated\\x12\\x1f\\n\" +\n\t\"\\vallow_alias\\x18\\x02 \\x01(\\bR\\n\" +\n\t\"allowAlias:\\x02\\x18\\x01\\\"\\xf9\\x01\\n\" +\n\t\"\\tEnumValue\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x16\\n\" +\n\t\"\\x06number\\x18\\x02 \\x01(\\x05R\\x06number\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x03 \\x01(\\tR\\bcomments\\x12C\\n\" +\n\t\"\\aoptions\\x18\\x05 \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\aoptions\\x12_\\n\" +\n\t\"\\x12enum_value_options\\x18\\x04 \\x01(\\v2-.buf.alpha.registry.v1alpha1.EnumValueOptionsB\\x02\\x18\\x01R\\x10enumValueOptions\\\"6\\n\" +\n\t\"\\x10EnumValueOptions\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"deprecated:\\x02\\x18\\x01\\\"\\x9a\\x01\\n\" +\n\t\"\\x0fImportModuleRef\\x12\\x16\\n\" +\n\t\"\\x06remote\\x18\\x01 \\x01(\\tR\\x06remote\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x02 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x16\\n\" +\n\t\"\\x06commit\\x18\\x04 \\x01(\\tR\\x06commit\\x12!\\n\" +\n\t\"\\fpackage_name\\x18\\x05 \\x01(\\tR\\vpackageName\\\"\\xe3\\x04\\n\" +\n\t\"\\aMessage\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x1f\\n\" +\n\t\"\\vnested_name\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"nestedName\\x12\\x1b\\n\" +\n\t\"\\tfull_name\\x18\\x03 \\x01(\\tR\\bfullName\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x04 \\x01(\\tR\\bcomments\\x12\\x1b\\n\" +\n\t\"\\tfile_path\\x18\\x05 \\x01(\\tR\\bfilePath\\x12 \\n\" +\n\t\"\\fis_map_entry\\x18\\x06 \\x01(\\bR\\n\" +\n\t\"isMapEntry\\x12A\\n\" +\n\t\"\\x06fields\\x18\\a \\x03(\\v2).buf.alpha.registry.v1alpha1.MessageFieldR\\x06fields\\x12A\\n\" +\n\t\"\\blocation\\x18\\b \\x01(\\v2%.buf.alpha.registry.v1alpha1.LocationR\\blocation\\x12Q\\n\" +\n\t\"\\x12message_extensions\\x18\\t \\x03(\\v2\\\".buf.alpha.registry.v1alpha1.FieldR\\x11messageExtensions\\x123\\n\" +\n\t\"\\x15implicitly_deprecated\\x18\\v \\x01(\\bR\\x14implicitlyDeprecated\\x12C\\n\" +\n\t\"\\aoptions\\x18\\f \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\aoptions\\x12X\\n\" +\n\t\"\\x0fmessage_options\\x18\\n\" +\n\t\" \\x01(\\v2+.buf.alpha.registry.v1alpha1.MessageOptionsB\\x02\\x18\\x01R\\x0emessageOptions\\\"\\x97\\x01\\n\" +\n\t\"\\fMessageField\\x12:\\n\" +\n\t\"\\x05field\\x18\\x01 \\x01(\\v2\\\".buf.alpha.registry.v1alpha1.FieldH\\x00R\\x05field\\x12:\\n\" +\n\t\"\\x05oneof\\x18\\x02 \\x01(\\v2\\\".buf.alpha.registry.v1alpha1.OneofH\\x00R\\x05oneofB\\x0f\\n\" +\n\t\"\\rmessage_field\\\"4\\n\" +\n\t\"\\x0eMessageOptions\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"deprecated:\\x02\\x18\\x01\\\"\\x9c\\x01\\n\" +\n\t\"\\x05Oneof\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12:\\n\" +\n\t\"\\x06fields\\x18\\x02 \\x03(\\v2\\\".buf.alpha.registry.v1alpha1.FieldR\\x06fields\\x12C\\n\" +\n\t\"\\aoptions\\x18\\x03 \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\aoptions\\\"\\xf0\\x03\\n\" +\n\t\"\\x05Field\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x02 \\x01(\\tR\\bcomments\\x12\\x14\\n\" +\n\t\"\\x05label\\x18\\x03 \\x01(\\tR\\x05label\\x12\\x1f\\n\" +\n\t\"\\vnested_type\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"nestedType\\x12\\x1b\\n\" +\n\t\"\\tfull_type\\x18\\x05 \\x01(\\tR\\bfullType\\x12\\x10\\n\" +\n\t\"\\x03tag\\x18\\x06 \\x01(\\rR\\x03tag\\x12B\\n\" +\n\t\"\\tmap_entry\\x18\\a \\x01(\\v2%.buf.alpha.registry.v1alpha1.MapEntryR\\bmapEntry\\x12X\\n\" +\n\t\"\\x11import_module_ref\\x18\\b \\x01(\\v2,.buf.alpha.registry.v1alpha1.ImportModuleRefR\\x0fimportModuleRef\\x12\\x1a\\n\" +\n\t\"\\bextendee\\x18\\t \\x01(\\tR\\bextendee\\x12C\\n\" +\n\t\"\\aoptions\\x18\\v \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\aoptions\\x12R\\n\" +\n\t\"\\rfield_options\\x18\\n\" +\n\t\" \\x01(\\v2).buf.alpha.registry.v1alpha1.FieldOptionsB\\x02\\x18\\x01R\\ffieldOptions\\\"\\x88\\x01\\n\" +\n\t\"\\fFieldOptions\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x01 \\x01(\\bR\\n\" +\n\t\"deprecated\\x12\\x1b\\n\" +\n\t\"\\x06packed\\x18\\x02 \\x01(\\bH\\x00R\\x06packed\\x88\\x01\\x01\\x12\\x14\\n\" +\n\t\"\\x05ctype\\x18\\x03 \\x01(\\x05R\\x05ctype\\x12\\x16\\n\" +\n\t\"\\x06jstype\\x18\\x04 \\x01(\\x05R\\x06jstype:\\x02\\x18\\x01B\\t\\n\" +\n\t\"\\a_packed\\\"\\x96\\x02\\n\" +\n\t\"\\fFieldLiteral\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x10\\n\" +\n\t\"\\x03tag\\x18\\x02 \\x01(\\x05R\\x03tag\\x12E\\n\" +\n\t\"\\n\" +\n\t\"field_type\\x18\\x03 \\x01(\\x0e2&.buf.alpha.registry.v1alpha1.FieldTypeR\\tfieldType\\x12?\\n\" +\n\t\"\\x05value\\x18\\x04 \\x01(\\v2).buf.alpha.registry.v1alpha1.LiteralValueR\\x05value\\x12X\\n\" +\n\t\"\\x11import_module_ref\\x18\\x05 \\x01(\\v2,.buf.alpha.registry.v1alpha1.ImportModuleRefR\\x0fimportModuleRef\\\"S\\n\" +\n\t\"\\x0eMessageLiteral\\x12A\\n\" +\n\t\"\\x06fields\\x18\\x01 \\x03(\\v2).buf.alpha.registry.v1alpha1.FieldLiteralR\\x06fields\\\"U\\n\" +\n\t\"\\fArrayLiteral\\x12E\\n\" +\n\t\"\\belements\\x18\\x01 \\x03(\\v2).buf.alpha.registry.v1alpha1.LiteralValueR\\belements\\\"\\xb5\\x03\\n\" +\n\t\"\\fLiteralValue\\x12#\\n\" +\n\t\"\\fstring_value\\x18\\x02 \\x01(\\tH\\x00R\\vstringValue\\x12\\x1d\\n\" +\n\t\"\\tint_value\\x18\\x03 \\x01(\\x03H\\x00R\\bintValue\\x12\\x1f\\n\" +\n\t\"\\n\" +\n\t\"uint_value\\x18\\x04 \\x01(\\x04H\\x00R\\tuintValue\\x12#\\n\" +\n\t\"\\fdouble_value\\x18\\x05 \\x01(\\x01H\\x00R\\vdoubleValue\\x12\\x1f\\n\" +\n\t\"\\n\" +\n\t\"bool_value\\x18\\x06 \\x01(\\bH\\x00R\\tboolValue\\x123\\n\" +\n\t\"\\x15enum_value_name_value\\x18\\a \\x01(\\tH\\x00R\\x12enumValueNameValue\\x12L\\n\" +\n\t\"\\varray_value\\x18\\b \\x01(\\v2).buf.alpha.registry.v1alpha1.ArrayLiteralH\\x00R\\n\" +\n\t\"arrayValue\\x12R\\n\" +\n\t\"\\rmessage_value\\x18\\t \\x01(\\v2+.buf.alpha.registry.v1alpha1.MessageLiteralH\\x00R\\fmessageValue\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\n\" +\n\t\" \\x01(\\tR\\bcommentsB\\a\\n\" +\n\t\"\\x05value\\\"\\xe7\\x01\\n\" +\n\t\"\\bMapEntry\\x12\\\"\\n\" +\n\t\"\\rkey_full_type\\x18\\x01 \\x01(\\tR\\vkeyFullType\\x12*\\n\" +\n\t\"\\x11value_nested_type\\x18\\x02 \\x01(\\tR\\x0fvalueNestedType\\x12&\\n\" +\n\t\"\\x0fvalue_full_type\\x18\\x03 \\x01(\\tR\\rvalueFullType\\x12c\\n\" +\n\t\"\\x17value_import_module_ref\\x18\\x04 \\x01(\\v2,.buf.alpha.registry.v1alpha1.ImportModuleRefR\\x14valueImportModuleRef\\\"\\xa3\\x02\\n\" +\n\t\"\\rFileExtension\\x12%\\n\" +\n\t\"\\x0eextension_type\\x18\\x01 \\x01(\\tR\\rextensionType\\x12\\x1a\\n\" +\n\t\"\\bcomments\\x18\\x02 \\x01(\\tR\\bcomments\\x12\\x1b\\n\" +\n\t\"\\tfile_path\\x18\\x03 \\x01(\\tR\\bfilePath\\x12A\\n\" +\n\t\"\\blocation\\x18\\x04 \\x01(\\v2%.buf.alpha.registry.v1alpha1.LocationR\\blocation\\x12:\\n\" +\n\t\"\\x06fields\\x18\\x05 \\x03(\\v2\\\".buf.alpha.registry.v1alpha1.FieldR\\x06fields\\x123\\n\" +\n\t\"\\x15implicitly_deprecated\\x18\\x06 \\x01(\\bR\\x14implicitlyDeprecated*l\\n\" +\n\t\"\\tFieldType\\x12\\x1a\\n\" +\n\t\"\\x16FIELD_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x15\\n\" +\n\t\"\\x11FIELD_TYPE_NORMAL\\x10\\x01\\x12\\x18\\n\" +\n\t\"\\x14FIELD_TYPE_EXTENSION\\x10\\x02\\x12\\x12\\n\" +\n\t\"\\x0eFIELD_TYPE_ANY\\x10\\x032\\xe1\\x05\\n\" +\n\t\"\\n\" +\n\t\"DocService\\x12\\x96\\x01\\n\" +\n\t\"\\x16GetSourceDirectoryInfo\\x12:.buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoRequest\\x1a;.buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoResponse\\\"\\x03\\x90\\x02\\x01\\x12{\\n\" +\n\t\"\\rGetSourceFile\\x121.buf.alpha.registry.v1alpha1.GetSourceFileRequest\\x1a2.buf.alpha.registry.v1alpha1.GetSourceFileResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x87\\x01\\n\" +\n\t\"\\x11GetModulePackages\\x125.buf.alpha.registry.v1alpha1.GetModulePackagesRequest\\x1a6.buf.alpha.registry.v1alpha1.GetModulePackagesResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x96\\x01\\n\" +\n\t\"\\x16GetModuleDocumentation\\x12:.buf.alpha.registry.v1alpha1.GetModuleDocumentationRequest\\x1a;.buf.alpha.registry.v1alpha1.GetModuleDocumentationResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x99\\x01\\n\" +\n\t\"\\x17GetPackageDocumentation\\x12;.buf.alpha.registry.v1alpha1.GetPackageDocumentationRequest\\x1a<.buf.alpha.registry.v1alpha1.GetPackageDocumentationResponse\\\"\\x03\\x90\\x02\\x01B\\x95\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\bDocProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_doc_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes = make([]protoimpl.MessageInfo, 37)\nvar file_buf_alpha_registry_v1alpha1_doc_proto_goTypes = []any{\n\t(FieldType)(0),                          // 0: buf.alpha.registry.v1alpha1.FieldType\n\t(*GetSourceDirectoryInfoRequest)(nil),   // 1: buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoRequest\n\t(*GetSourceDirectoryInfoResponse)(nil),  // 2: buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoResponse\n\t(*FileInfo)(nil),                        // 3: buf.alpha.registry.v1alpha1.FileInfo\n\t(*GetSourceFileRequest)(nil),            // 4: buf.alpha.registry.v1alpha1.GetSourceFileRequest\n\t(*GetSourceFileResponse)(nil),           // 5: buf.alpha.registry.v1alpha1.GetSourceFileResponse\n\t(*GetModulePackagesRequest)(nil),        // 6: buf.alpha.registry.v1alpha1.GetModulePackagesRequest\n\t(*GetModulePackagesResponse)(nil),       // 7: buf.alpha.registry.v1alpha1.GetModulePackagesResponse\n\t(*ModulePackage)(nil),                   // 8: buf.alpha.registry.v1alpha1.ModulePackage\n\t(*GetModuleDocumentationRequest)(nil),   // 9: buf.alpha.registry.v1alpha1.GetModuleDocumentationRequest\n\t(*GetModuleDocumentationResponse)(nil),  // 10: buf.alpha.registry.v1alpha1.GetModuleDocumentationResponse\n\t(*ModuleDocumentation)(nil),             // 11: buf.alpha.registry.v1alpha1.ModuleDocumentation\n\t(*GetPackageDocumentationRequest)(nil),  // 12: buf.alpha.registry.v1alpha1.GetPackageDocumentationRequest\n\t(*GetPackageDocumentationResponse)(nil), // 13: buf.alpha.registry.v1alpha1.GetPackageDocumentationResponse\n\t(*PackageDocumentation)(nil),            // 14: buf.alpha.registry.v1alpha1.PackageDocumentation\n\t(*Location)(nil),                        // 15: buf.alpha.registry.v1alpha1.Location\n\t(*Service)(nil),                         // 16: buf.alpha.registry.v1alpha1.Service\n\t(*ServiceOptions)(nil),                  // 17: buf.alpha.registry.v1alpha1.ServiceOptions\n\t(*Method)(nil),                          // 18: buf.alpha.registry.v1alpha1.Method\n\t(*MethodOptions)(nil),                   // 19: buf.alpha.registry.v1alpha1.MethodOptions\n\t(*MethodRequestResponse)(nil),           // 20: buf.alpha.registry.v1alpha1.MethodRequestResponse\n\t(*Enum)(nil),                            // 21: buf.alpha.registry.v1alpha1.Enum\n\t(*EnumOptions)(nil),                     // 22: buf.alpha.registry.v1alpha1.EnumOptions\n\t(*EnumValue)(nil),                       // 23: buf.alpha.registry.v1alpha1.EnumValue\n\t(*EnumValueOptions)(nil),                // 24: buf.alpha.registry.v1alpha1.EnumValueOptions\n\t(*ImportModuleRef)(nil),                 // 25: buf.alpha.registry.v1alpha1.ImportModuleRef\n\t(*Message)(nil),                         // 26: buf.alpha.registry.v1alpha1.Message\n\t(*MessageField)(nil),                    // 27: buf.alpha.registry.v1alpha1.MessageField\n\t(*MessageOptions)(nil),                  // 28: buf.alpha.registry.v1alpha1.MessageOptions\n\t(*Oneof)(nil),                           // 29: buf.alpha.registry.v1alpha1.Oneof\n\t(*Field)(nil),                           // 30: buf.alpha.registry.v1alpha1.Field\n\t(*FieldOptions)(nil),                    // 31: buf.alpha.registry.v1alpha1.FieldOptions\n\t(*FieldLiteral)(nil),                    // 32: buf.alpha.registry.v1alpha1.FieldLiteral\n\t(*MessageLiteral)(nil),                  // 33: buf.alpha.registry.v1alpha1.MessageLiteral\n\t(*ArrayLiteral)(nil),                    // 34: buf.alpha.registry.v1alpha1.ArrayLiteral\n\t(*LiteralValue)(nil),                    // 35: buf.alpha.registry.v1alpha1.LiteralValue\n\t(*MapEntry)(nil),                        // 36: buf.alpha.registry.v1alpha1.MapEntry\n\t(*FileExtension)(nil),                   // 37: buf.alpha.registry.v1alpha1.FileExtension\n}\nvar file_buf_alpha_registry_v1alpha1_doc_proto_depIdxs = []int32{\n\t3,  // 0: buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoResponse.root:type_name -> buf.alpha.registry.v1alpha1.FileInfo\n\t3,  // 1: buf.alpha.registry.v1alpha1.FileInfo.children:type_name -> buf.alpha.registry.v1alpha1.FileInfo\n\t8,  // 2: buf.alpha.registry.v1alpha1.GetModulePackagesResponse.module_packages:type_name -> buf.alpha.registry.v1alpha1.ModulePackage\n\t11, // 3: buf.alpha.registry.v1alpha1.GetModuleDocumentationResponse.module_documentation:type_name -> buf.alpha.registry.v1alpha1.ModuleDocumentation\n\t14, // 4: buf.alpha.registry.v1alpha1.GetPackageDocumentationResponse.package_documentation:type_name -> buf.alpha.registry.v1alpha1.PackageDocumentation\n\t16, // 5: buf.alpha.registry.v1alpha1.PackageDocumentation.services:type_name -> buf.alpha.registry.v1alpha1.Service\n\t21, // 6: buf.alpha.registry.v1alpha1.PackageDocumentation.enums:type_name -> buf.alpha.registry.v1alpha1.Enum\n\t26, // 7: buf.alpha.registry.v1alpha1.PackageDocumentation.messages:type_name -> buf.alpha.registry.v1alpha1.Message\n\t37, // 8: buf.alpha.registry.v1alpha1.PackageDocumentation.file_extensions:type_name -> buf.alpha.registry.v1alpha1.FileExtension\n\t15, // 9: buf.alpha.registry.v1alpha1.Service.location:type_name -> buf.alpha.registry.v1alpha1.Location\n\t18, // 10: buf.alpha.registry.v1alpha1.Service.methods:type_name -> buf.alpha.registry.v1alpha1.Method\n\t32, // 11: buf.alpha.registry.v1alpha1.Service.options:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t17, // 12: buf.alpha.registry.v1alpha1.Service.service_options:type_name -> buf.alpha.registry.v1alpha1.ServiceOptions\n\t20, // 13: buf.alpha.registry.v1alpha1.Method.request:type_name -> buf.alpha.registry.v1alpha1.MethodRequestResponse\n\t20, // 14: buf.alpha.registry.v1alpha1.Method.response:type_name -> buf.alpha.registry.v1alpha1.MethodRequestResponse\n\t32, // 15: buf.alpha.registry.v1alpha1.Method.options:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t19, // 16: buf.alpha.registry.v1alpha1.Method.method_options:type_name -> buf.alpha.registry.v1alpha1.MethodOptions\n\t26, // 17: buf.alpha.registry.v1alpha1.MethodRequestResponse.message:type_name -> buf.alpha.registry.v1alpha1.Message\n\t25, // 18: buf.alpha.registry.v1alpha1.MethodRequestResponse.import_module_ref:type_name -> buf.alpha.registry.v1alpha1.ImportModuleRef\n\t15, // 19: buf.alpha.registry.v1alpha1.Enum.location:type_name -> buf.alpha.registry.v1alpha1.Location\n\t23, // 20: buf.alpha.registry.v1alpha1.Enum.values:type_name -> buf.alpha.registry.v1alpha1.EnumValue\n\t32, // 21: buf.alpha.registry.v1alpha1.Enum.options:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t22, // 22: buf.alpha.registry.v1alpha1.Enum.enum_options:type_name -> buf.alpha.registry.v1alpha1.EnumOptions\n\t32, // 23: buf.alpha.registry.v1alpha1.EnumValue.options:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t24, // 24: buf.alpha.registry.v1alpha1.EnumValue.enum_value_options:type_name -> buf.alpha.registry.v1alpha1.EnumValueOptions\n\t27, // 25: buf.alpha.registry.v1alpha1.Message.fields:type_name -> buf.alpha.registry.v1alpha1.MessageField\n\t15, // 26: buf.alpha.registry.v1alpha1.Message.location:type_name -> buf.alpha.registry.v1alpha1.Location\n\t30, // 27: buf.alpha.registry.v1alpha1.Message.message_extensions:type_name -> buf.alpha.registry.v1alpha1.Field\n\t32, // 28: buf.alpha.registry.v1alpha1.Message.options:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t28, // 29: buf.alpha.registry.v1alpha1.Message.message_options:type_name -> buf.alpha.registry.v1alpha1.MessageOptions\n\t30, // 30: buf.alpha.registry.v1alpha1.MessageField.field:type_name -> buf.alpha.registry.v1alpha1.Field\n\t29, // 31: buf.alpha.registry.v1alpha1.MessageField.oneof:type_name -> buf.alpha.registry.v1alpha1.Oneof\n\t30, // 32: buf.alpha.registry.v1alpha1.Oneof.fields:type_name -> buf.alpha.registry.v1alpha1.Field\n\t32, // 33: buf.alpha.registry.v1alpha1.Oneof.options:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t36, // 34: buf.alpha.registry.v1alpha1.Field.map_entry:type_name -> buf.alpha.registry.v1alpha1.MapEntry\n\t25, // 35: buf.alpha.registry.v1alpha1.Field.import_module_ref:type_name -> buf.alpha.registry.v1alpha1.ImportModuleRef\n\t32, // 36: buf.alpha.registry.v1alpha1.Field.options:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t31, // 37: buf.alpha.registry.v1alpha1.Field.field_options:type_name -> buf.alpha.registry.v1alpha1.FieldOptions\n\t0,  // 38: buf.alpha.registry.v1alpha1.FieldLiteral.field_type:type_name -> buf.alpha.registry.v1alpha1.FieldType\n\t35, // 39: buf.alpha.registry.v1alpha1.FieldLiteral.value:type_name -> buf.alpha.registry.v1alpha1.LiteralValue\n\t25, // 40: buf.alpha.registry.v1alpha1.FieldLiteral.import_module_ref:type_name -> buf.alpha.registry.v1alpha1.ImportModuleRef\n\t32, // 41: buf.alpha.registry.v1alpha1.MessageLiteral.fields:type_name -> buf.alpha.registry.v1alpha1.FieldLiteral\n\t35, // 42: buf.alpha.registry.v1alpha1.ArrayLiteral.elements:type_name -> buf.alpha.registry.v1alpha1.LiteralValue\n\t34, // 43: buf.alpha.registry.v1alpha1.LiteralValue.array_value:type_name -> buf.alpha.registry.v1alpha1.ArrayLiteral\n\t33, // 44: buf.alpha.registry.v1alpha1.LiteralValue.message_value:type_name -> buf.alpha.registry.v1alpha1.MessageLiteral\n\t25, // 45: buf.alpha.registry.v1alpha1.MapEntry.value_import_module_ref:type_name -> buf.alpha.registry.v1alpha1.ImportModuleRef\n\t15, // 46: buf.alpha.registry.v1alpha1.FileExtension.location:type_name -> buf.alpha.registry.v1alpha1.Location\n\t30, // 47: buf.alpha.registry.v1alpha1.FileExtension.fields:type_name -> buf.alpha.registry.v1alpha1.Field\n\t1,  // 48: buf.alpha.registry.v1alpha1.DocService.GetSourceDirectoryInfo:input_type -> buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoRequest\n\t4,  // 49: buf.alpha.registry.v1alpha1.DocService.GetSourceFile:input_type -> buf.alpha.registry.v1alpha1.GetSourceFileRequest\n\t6,  // 50: buf.alpha.registry.v1alpha1.DocService.GetModulePackages:input_type -> buf.alpha.registry.v1alpha1.GetModulePackagesRequest\n\t9,  // 51: buf.alpha.registry.v1alpha1.DocService.GetModuleDocumentation:input_type -> buf.alpha.registry.v1alpha1.GetModuleDocumentationRequest\n\t12, // 52: buf.alpha.registry.v1alpha1.DocService.GetPackageDocumentation:input_type -> buf.alpha.registry.v1alpha1.GetPackageDocumentationRequest\n\t2,  // 53: buf.alpha.registry.v1alpha1.DocService.GetSourceDirectoryInfo:output_type -> buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoResponse\n\t5,  // 54: buf.alpha.registry.v1alpha1.DocService.GetSourceFile:output_type -> buf.alpha.registry.v1alpha1.GetSourceFileResponse\n\t7,  // 55: buf.alpha.registry.v1alpha1.DocService.GetModulePackages:output_type -> buf.alpha.registry.v1alpha1.GetModulePackagesResponse\n\t10, // 56: buf.alpha.registry.v1alpha1.DocService.GetModuleDocumentation:output_type -> buf.alpha.registry.v1alpha1.GetModuleDocumentationResponse\n\t13, // 57: buf.alpha.registry.v1alpha1.DocService.GetPackageDocumentation:output_type -> buf.alpha.registry.v1alpha1.GetPackageDocumentationResponse\n\t53, // [53:58] is the sub-list for method output_type\n\t48, // [48:53] is the sub-list for method input_type\n\t48, // [48:48] is the sub-list for extension type_name\n\t48, // [48:48] is the sub-list for extension extendee\n\t0,  // [0:48] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_doc_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_doc_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_doc_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26].OneofWrappers = []any{\n\t\t(*messageField_Field)(nil),\n\t\t(*messageField_Oneof)(nil),\n\t}\n\tfile_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[30].OneofWrappers = []any{}\n\tfile_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[34].OneofWrappers = []any{\n\t\t(*literalValue_StringValue)(nil),\n\t\t(*literalValue_IntValue)(nil),\n\t\t(*literalValue_UintValue)(nil),\n\t\t(*literalValue_DoubleValue)(nil),\n\t\t(*literalValue_BoolValue)(nil),\n\t\t(*literalValue_EnumValueNameValue)(nil),\n\t\t(*literalValue_ArrayValue)(nil),\n\t\t(*literalValue_MessageValue)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_doc_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_doc_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   37,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_doc_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_doc_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_doc_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_doc_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_doc_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_doc_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/download.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/download.proto\n\npackage registryv1alpha1\n\nimport (\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// DownloadRequest specifies the module to download.\ntype DownloadRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *DownloadRequest) Reset() {\n\t*x = DownloadRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DownloadRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DownloadRequest) ProtoMessage() {}\n\nfunc (x *DownloadRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_download_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\nfunc (x *DownloadRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *DownloadRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *DownloadRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *DownloadRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *DownloadRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *DownloadRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype DownloadRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n}\n\nfunc (b0 DownloadRequest_builder) Build() *DownloadRequest {\n\tm0 := &DownloadRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\n// DownloadResponse contains the remote module.\ntype DownloadResponse struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Module *v1alpha1.Module       `protobuf:\"bytes,1,opt,name=module,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *DownloadResponse) Reset() {\n\t*x = DownloadResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DownloadResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DownloadResponse) ProtoMessage() {}\n\nfunc (x *DownloadResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_download_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\nfunc (x *DownloadResponse) GetModule() *v1alpha1.Module {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Module\n\t}\n\treturn nil\n}\n\nfunc (x *DownloadResponse) SetModule(v *v1alpha1.Module) {\n\tx.xxx_hidden_Module = v\n}\n\nfunc (x *DownloadResponse) HasModule() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Module != nil\n}\n\nfunc (x *DownloadResponse) ClearModule() {\n\tx.xxx_hidden_Module = nil\n}\n\ntype DownloadResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tModule *v1alpha1.Module\n}\n\nfunc (b0 DownloadResponse_builder) Build() *DownloadResponse {\n\tm0 := &DownloadResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Module = b.Module\n\treturn m0\n}\n\n// DownloadManifestAndBlobsRequest specifies the module to download.\ntype DownloadManifestAndBlobsRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *DownloadManifestAndBlobsRequest) Reset() {\n\t*x = DownloadManifestAndBlobsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DownloadManifestAndBlobsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DownloadManifestAndBlobsRequest) ProtoMessage() {}\n\nfunc (x *DownloadManifestAndBlobsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_download_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\nfunc (x *DownloadManifestAndBlobsRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *DownloadManifestAndBlobsRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *DownloadManifestAndBlobsRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *DownloadManifestAndBlobsRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *DownloadManifestAndBlobsRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *DownloadManifestAndBlobsRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype DownloadManifestAndBlobsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n}\n\nfunc (b0 DownloadManifestAndBlobsRequest_builder) Build() *DownloadManifestAndBlobsRequest {\n\tm0 := &DownloadManifestAndBlobsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\n// DownloadManifestAndBlobsResponse is the returned resolved remote module.\ntype DownloadManifestAndBlobsResponse struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Manifest *v1alpha1.Blob         `protobuf:\"bytes,1,opt,name=manifest,proto3\"`\n\txxx_hidden_Blobs    *[]*v1alpha1.Blob      `protobuf:\"bytes,2,rep,name=blobs,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *DownloadManifestAndBlobsResponse) Reset() {\n\t*x = DownloadManifestAndBlobsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DownloadManifestAndBlobsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DownloadManifestAndBlobsResponse) ProtoMessage() {}\n\nfunc (x *DownloadManifestAndBlobsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_download_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\nfunc (x *DownloadManifestAndBlobsResponse) GetManifest() *v1alpha1.Blob {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Manifest\n\t}\n\treturn nil\n}\n\nfunc (x *DownloadManifestAndBlobsResponse) GetBlobs() []*v1alpha1.Blob {\n\tif x != nil {\n\t\tif x.xxx_hidden_Blobs != nil {\n\t\t\treturn *x.xxx_hidden_Blobs\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *DownloadManifestAndBlobsResponse) SetManifest(v *v1alpha1.Blob) {\n\tx.xxx_hidden_Manifest = v\n}\n\nfunc (x *DownloadManifestAndBlobsResponse) SetBlobs(v []*v1alpha1.Blob) {\n\tx.xxx_hidden_Blobs = &v\n}\n\nfunc (x *DownloadManifestAndBlobsResponse) HasManifest() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Manifest != nil\n}\n\nfunc (x *DownloadManifestAndBlobsResponse) ClearManifest() {\n\tx.xxx_hidden_Manifest = nil\n}\n\ntype DownloadManifestAndBlobsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// manifest is the manifest of the module's content.\n\t// The content of the manifest blob is a text encoding of an ordered list of unique paths, each path encoded as:\n\t//\n\t//\t<digest_type>:<digest>[SP][SP]<path>[LF]\n\t//\n\t// The only supported digest type is 'shake256'. The shake256 digest consists of 64 bytes of lowercase hex\n\t// encoded output of SHAKE256.\n\tManifest *v1alpha1.Blob\n\t// blobs is a set of blobs that closes on the module's manifest to form the\n\t// complete module's content.\n\tBlobs []*v1alpha1.Blob\n}\n\nfunc (b0 DownloadManifestAndBlobsResponse_builder) Build() *DownloadManifestAndBlobsResponse {\n\tm0 := &DownloadManifestAndBlobsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Manifest = b.Manifest\n\tx.xxx_hidden_Blobs = &b.Blobs\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_download_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_download_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"*buf/alpha/registry/v1alpha1/download.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/module/v1alpha1/module.proto\\\"e\\n\" +\n\t\"\\x0fDownloadRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"M\\n\" +\n\t\"\\x10DownloadResponse\\x129\\n\" +\n\t\"\\x06module\\x18\\x01 \\x01(\\v2!.buf.alpha.module.v1alpha1.ModuleR\\x06module\\\"u\\n\" +\n\t\"\\x1fDownloadManifestAndBlobsRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"\\x96\\x01\\n\" +\n\t\" DownloadManifestAndBlobsResponse\\x12;\\n\" +\n\t\"\\bmanifest\\x18\\x01 \\x01(\\v2\\x1f.buf.alpha.module.v1alpha1.BlobR\\bmanifest\\x125\\n\" +\n\t\"\\x05blobs\\x18\\x02 \\x03(\\v2\\x1f.buf.alpha.module.v1alpha1.BlobR\\x05blobs2\\x9e\\x02\\n\" +\n\t\"\\x0fDownloadService\\x12l\\n\" +\n\t\"\\bDownload\\x12,.buf.alpha.registry.v1alpha1.DownloadRequest\\x1a-.buf.alpha.registry.v1alpha1.DownloadResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x9c\\x01\\n\" +\n\t\"\\x18DownloadManifestAndBlobs\\x12<.buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsRequest\\x1a=.buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse\\\"\\x03\\x90\\x02\\x01B\\x9a\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\rDownloadProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_download_proto_msgTypes = make([]protoimpl.MessageInfo, 4)\nvar file_buf_alpha_registry_v1alpha1_download_proto_goTypes = []any{\n\t(*DownloadRequest)(nil),                  // 0: buf.alpha.registry.v1alpha1.DownloadRequest\n\t(*DownloadResponse)(nil),                 // 1: buf.alpha.registry.v1alpha1.DownloadResponse\n\t(*DownloadManifestAndBlobsRequest)(nil),  // 2: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsRequest\n\t(*DownloadManifestAndBlobsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse\n\t(*v1alpha1.Module)(nil),                  // 4: buf.alpha.module.v1alpha1.Module\n\t(*v1alpha1.Blob)(nil),                    // 5: buf.alpha.module.v1alpha1.Blob\n}\nvar file_buf_alpha_registry_v1alpha1_download_proto_depIdxs = []int32{\n\t4, // 0: buf.alpha.registry.v1alpha1.DownloadResponse.module:type_name -> buf.alpha.module.v1alpha1.Module\n\t5, // 1: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse.manifest:type_name -> buf.alpha.module.v1alpha1.Blob\n\t5, // 2: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse.blobs:type_name -> buf.alpha.module.v1alpha1.Blob\n\t0, // 3: buf.alpha.registry.v1alpha1.DownloadService.Download:input_type -> buf.alpha.registry.v1alpha1.DownloadRequest\n\t2, // 4: buf.alpha.registry.v1alpha1.DownloadService.DownloadManifestAndBlobs:input_type -> buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsRequest\n\t1, // 5: buf.alpha.registry.v1alpha1.DownloadService.Download:output_type -> buf.alpha.registry.v1alpha1.DownloadResponse\n\t3, // 6: buf.alpha.registry.v1alpha1.DownloadService.DownloadManifestAndBlobs:output_type -> buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse\n\t5, // [5:7] is the sub-list for method output_type\n\t3, // [3:5] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_download_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_download_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_download_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_buf_alpha_registry_v1alpha1_download_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_download_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   4,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_download_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_download_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_download_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_download_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_download_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_download_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/git_metadata.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/git_metadata.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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\n// GitIdentity is a Git user identity, typically either an author or a committer.\ntype GitIdentity struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name  string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Email string                 `protobuf:\"bytes,2,opt,name=email,proto3\"`\n\txxx_hidden_Time  *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=time,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *GitIdentity) Reset() {\n\t*x = GitIdentity{}\n\tmi := &file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GitIdentity) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GitIdentity) ProtoMessage() {}\n\nfunc (x *GitIdentity) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_git_metadata_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\nfunc (x *GitIdentity) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GitIdentity) GetEmail() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Email\n\t}\n\treturn \"\"\n}\n\nfunc (x *GitIdentity) GetTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Time\n\t}\n\treturn nil\n}\n\nfunc (x *GitIdentity) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GitIdentity) SetEmail(v string) {\n\tx.xxx_hidden_Email = v\n}\n\nfunc (x *GitIdentity) SetTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_Time = v\n}\n\nfunc (x *GitIdentity) HasTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Time != nil\n}\n\nfunc (x *GitIdentity) ClearTime() {\n\tx.xxx_hidden_Time = nil\n}\n\ntype GitIdentity_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Name is the name of the Git identity. This is not the BSR user's username.\n\tName string\n\t// Email is the email of the Git identity. This is not the BSR user's email.\n\tEmail string\n\t// Time is the time at which this identity was captured.\n\tTime *timestamppb.Timestamp\n}\n\nfunc (b0 GitIdentity_builder) Build() *GitIdentity {\n\tm0 := &GitIdentity{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Email = b.Email\n\tx.xxx_hidden_Time = b.Time\n\treturn m0\n}\n\n// GitCommitInformation is the information associated with a Git commit.\n// This always includes the hash.\n// The author and/or committer user identities are included when available.\ntype GitCommitInformation struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Hash      string                 `protobuf:\"bytes,1,opt,name=hash,proto3\"`\n\txxx_hidden_Author    *GitIdentity           `protobuf:\"bytes,2,opt,name=author,proto3\"`\n\txxx_hidden_Committer *GitIdentity           `protobuf:\"bytes,3,opt,name=committer,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *GitCommitInformation) Reset() {\n\t*x = GitCommitInformation{}\n\tmi := &file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GitCommitInformation) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GitCommitInformation) ProtoMessage() {}\n\nfunc (x *GitCommitInformation) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_git_metadata_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\nfunc (x *GitCommitInformation) GetHash() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Hash\n\t}\n\treturn \"\"\n}\n\nfunc (x *GitCommitInformation) GetAuthor() *GitIdentity {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Author\n\t}\n\treturn nil\n}\n\nfunc (x *GitCommitInformation) GetCommitter() *GitIdentity {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Committer\n\t}\n\treturn nil\n}\n\nfunc (x *GitCommitInformation) SetHash(v string) {\n\tx.xxx_hidden_Hash = v\n}\n\nfunc (x *GitCommitInformation) SetAuthor(v *GitIdentity) {\n\tx.xxx_hidden_Author = v\n}\n\nfunc (x *GitCommitInformation) SetCommitter(v *GitIdentity) {\n\tx.xxx_hidden_Committer = v\n}\n\nfunc (x *GitCommitInformation) HasAuthor() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Author != nil\n}\n\nfunc (x *GitCommitInformation) HasCommitter() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Committer != nil\n}\n\nfunc (x *GitCommitInformation) ClearAuthor() {\n\tx.xxx_hidden_Author = nil\n}\n\nfunc (x *GitCommitInformation) ClearCommitter() {\n\tx.xxx_hidden_Committer = nil\n}\n\ntype GitCommitInformation_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Hash is the SHA1 hash of the git commit.\n\tHash string\n\t// Author is metadata associated with the author of the git commit.\n\t// This may not always be available, so it is not always populated.\n\tAuthor *GitIdentity\n\t// Committer is the metadata associated with the committer of the git commit.\n\t// This may not always be available, so it is not always populated.\n\tCommitter *GitIdentity\n}\n\nfunc (b0 GitCommitInformation_builder) Build() *GitCommitInformation {\n\tm0 := &GitCommitInformation{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Hash = b.Hash\n\tx.xxx_hidden_Author = b.Author\n\tx.xxx_hidden_Committer = b.Committer\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_git_metadata_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\".buf/alpha/registry/v1alpha1/git_metadata.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"g\\n\" +\n\t\"\\vGitIdentity\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x14\\n\" +\n\t\"\\x05email\\x18\\x02 \\x01(\\tR\\x05email\\x12.\\n\" +\n\t\"\\x04time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x04time\\\"\\xb4\\x01\\n\" +\n\t\"\\x14GitCommitInformation\\x12\\x12\\n\" +\n\t\"\\x04hash\\x18\\x01 \\x01(\\tR\\x04hash\\x12@\\n\" +\n\t\"\\x06author\\x18\\x02 \\x01(\\v2(.buf.alpha.registry.v1alpha1.GitIdentityR\\x06author\\x12F\\n\" +\n\t\"\\tcommitter\\x18\\x03 \\x01(\\v2(.buf.alpha.registry.v1alpha1.GitIdentityR\\tcommitterB\\x9d\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x10GitMetadataProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes = []any{\n\t(*GitIdentity)(nil),           // 0: buf.alpha.registry.v1alpha1.GitIdentity\n\t(*GitCommitInformation)(nil),  // 1: buf.alpha.registry.v1alpha1.GitCommitInformation\n\t(*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs = []int32{\n\t2, // 0: buf.alpha.registry.v1alpha1.GitIdentity.time:type_name -> google.protobuf.Timestamp\n\t0, // 1: buf.alpha.registry.v1alpha1.GitCommitInformation.author:type_name -> buf.alpha.registry.v1alpha1.GitIdentity\n\t0, // 2: buf.alpha.registry.v1alpha1.GitCommitInformation.committer:type_name -> buf.alpha.registry.v1alpha1.GitIdentity\n\t3, // [3:3] is the sub-list for method output_type\n\t3, // [3:3] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_git_metadata_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_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_git_metadata_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_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_git_metadata_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/github.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/github.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 GithubAppConfig struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_AppId string                 `protobuf:\"bytes,1,opt,name=app_id,json=appId,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *GithubAppConfig) Reset() {\n\t*x = GithubAppConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GithubAppConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GithubAppConfig) ProtoMessage() {}\n\nfunc (x *GithubAppConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_github_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\nfunc (x *GithubAppConfig) GetAppId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AppId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GithubAppConfig) SetAppId(v string) {\n\tx.xxx_hidden_AppId = v\n}\n\ntype GithubAppConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAppId string\n}\n\nfunc (b0 GithubAppConfig_builder) Build() *GithubAppConfig {\n\tm0 := &GithubAppConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_AppId = b.AppId\n\treturn m0\n}\n\ntype GetGithubAppConfigRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetGithubAppConfigRequest) Reset() {\n\t*x = GetGithubAppConfigRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetGithubAppConfigRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetGithubAppConfigRequest) ProtoMessage() {}\n\nfunc (x *GetGithubAppConfigRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_github_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\ntype GetGithubAppConfigRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 GetGithubAppConfigRequest_builder) Build() *GetGithubAppConfigRequest {\n\tm0 := &GetGithubAppConfigRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetGithubAppConfigResponse struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_AppConfig *GithubAppConfig       `protobuf:\"bytes,1,opt,name=app_config,json=appConfig,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *GetGithubAppConfigResponse) Reset() {\n\t*x = GetGithubAppConfigResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetGithubAppConfigResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetGithubAppConfigResponse) ProtoMessage() {}\n\nfunc (x *GetGithubAppConfigResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_github_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\nfunc (x *GetGithubAppConfigResponse) GetAppConfig() *GithubAppConfig {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AppConfig\n\t}\n\treturn nil\n}\n\nfunc (x *GetGithubAppConfigResponse) SetAppConfig(v *GithubAppConfig) {\n\tx.xxx_hidden_AppConfig = v\n}\n\nfunc (x *GetGithubAppConfigResponse) HasAppConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_AppConfig != nil\n}\n\nfunc (x *GetGithubAppConfigResponse) ClearAppConfig() {\n\tx.xxx_hidden_AppConfig = nil\n}\n\ntype GetGithubAppConfigResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAppConfig *GithubAppConfig\n}\n\nfunc (b0 GetGithubAppConfigResponse_builder) Build() *GetGithubAppConfigResponse {\n\tm0 := &GetGithubAppConfigResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_AppConfig = b.AppConfig\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_github_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_github_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"(buf/alpha/registry/v1alpha1/github.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\\"(\\n\" +\n\t\"\\x0fGithubAppConfig\\x12\\x15\\n\" +\n\t\"\\x06app_id\\x18\\x01 \\x01(\\tR\\x05appId\\\"\\x1b\\n\" +\n\t\"\\x19GetGithubAppConfigRequest\\\"i\\n\" +\n\t\"\\x1aGetGithubAppConfigResponse\\x12K\\n\" +\n\t\"\\n\" +\n\t\"app_config\\x18\\x01 \\x01(\\v2,.buf.alpha.registry.v1alpha1.GithubAppConfigR\\tappConfig2\\x9c\\x01\\n\" +\n\t\"\\rGithubService\\x12\\x8a\\x01\\n\" +\n\t\"\\x12GetGithubAppConfig\\x126.buf.alpha.registry.v1alpha1.GetGithubAppConfigRequest\\x1a7.buf.alpha.registry.v1alpha1.GetGithubAppConfigResponse\\\"\\x03\\x90\\x02\\x01B\\x98\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\vGithubProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_github_proto_msgTypes = make([]protoimpl.MessageInfo, 3)\nvar file_buf_alpha_registry_v1alpha1_github_proto_goTypes = []any{\n\t(*GithubAppConfig)(nil),            // 0: buf.alpha.registry.v1alpha1.GithubAppConfig\n\t(*GetGithubAppConfigRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.GetGithubAppConfigRequest\n\t(*GetGithubAppConfigResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetGithubAppConfigResponse\n}\nvar file_buf_alpha_registry_v1alpha1_github_proto_depIdxs = []int32{\n\t0, // 0: buf.alpha.registry.v1alpha1.GetGithubAppConfigResponse.app_config:type_name -> buf.alpha.registry.v1alpha1.GithubAppConfig\n\t1, // 1: buf.alpha.registry.v1alpha1.GithubService.GetGithubAppConfig:input_type -> buf.alpha.registry.v1alpha1.GetGithubAppConfigRequest\n\t2, // 2: buf.alpha.registry.v1alpha1.GithubService.GetGithubAppConfig:output_type -> buf.alpha.registry.v1alpha1.GetGithubAppConfigResponse\n\t2, // [2:3] is the sub-list for method output_type\n\t1, // [1:2] 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_buf_alpha_registry_v1alpha1_github_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_github_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_github_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_buf_alpha_registry_v1alpha1_github_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_github_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   3,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_github_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_github_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_github_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_github_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_github_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_github_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/image.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/image.proto\n\npackage registryv1alpha1\n\nimport (\n\tv1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// ImageMask is used in GetImageRequest to specify which parts of an image\n// should be masked in responses.\ntype ImageMask int32\n\nconst (\n\tImageMask_IMAGE_MASK_UNSPECIFIED ImageMask = 0\n\t// IMAGE_MASK_MESSAGES refers to ImageFile's `google.protobuf.DescriptorProto\n\t// message_type` field.\n\tImageMask_IMAGE_MASK_MESSAGES ImageMask = 1\n\t// IMAGE_MASK_ENUMS refers to ImageFile's `google.protobuf.EnumDescriptorProto\n\t// enum_type` field.\n\tImageMask_IMAGE_MASK_ENUMS ImageMask = 2\n\t// IMAGE_MASK_SERVICES refers to ImageFile's\n\t// `google.protobuf.ServiceDescriptorProto service` field.\n\tImageMask_IMAGE_MASK_SERVICES ImageMask = 3\n)\n\n// Enum value maps for ImageMask.\nvar (\n\tImageMask_name = map[int32]string{\n\t\t0: \"IMAGE_MASK_UNSPECIFIED\",\n\t\t1: \"IMAGE_MASK_MESSAGES\",\n\t\t2: \"IMAGE_MASK_ENUMS\",\n\t\t3: \"IMAGE_MASK_SERVICES\",\n\t}\n\tImageMask_value = map[string]int32{\n\t\t\"IMAGE_MASK_UNSPECIFIED\": 0,\n\t\t\"IMAGE_MASK_MESSAGES\":    1,\n\t\t\"IMAGE_MASK_ENUMS\":       2,\n\t\t\"IMAGE_MASK_SERVICES\":    3,\n\t}\n)\n\nfunc (x ImageMask) Enum() *ImageMask {\n\tp := new(ImageMask)\n\t*p = x\n\treturn p\n}\n\nfunc (x ImageMask) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ImageMask) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_image_proto_enumTypes[0].Descriptor()\n}\n\nfunc (ImageMask) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_image_proto_enumTypes[0]\n}\n\nfunc (x ImageMask) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype GetImageRequest struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner             string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository        string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference         string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\txxx_hidden_ExcludeImports    bool                   `protobuf:\"varint,4,opt,name=exclude_imports,json=excludeImports,proto3\"`\n\txxx_hidden_ExcludeSourceInfo bool                   `protobuf:\"varint,5,opt,name=exclude_source_info,json=excludeSourceInfo,proto3\"`\n\txxx_hidden_Types             []string               `protobuf:\"bytes,6,rep,name=types,proto3\"`\n\txxx_hidden_IncludeMask       []ImageMask            `protobuf:\"varint,7,rep,packed,name=include_mask,json=includeMask,proto3,enum=buf.alpha.registry.v1alpha1.ImageMask\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *GetImageRequest) Reset() {\n\t*x = GetImageRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetImageRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetImageRequest) ProtoMessage() {}\n\nfunc (x *GetImageRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_image_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\nfunc (x *GetImageRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetImageRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetImageRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetImageRequest) GetExcludeImports() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExcludeImports\n\t}\n\treturn false\n}\n\nfunc (x *GetImageRequest) GetExcludeSourceInfo() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExcludeSourceInfo\n\t}\n\treturn false\n}\n\nfunc (x *GetImageRequest) GetTypes() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Types\n\t}\n\treturn nil\n}\n\nfunc (x *GetImageRequest) GetIncludeMask() []ImageMask {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeMask\n\t}\n\treturn nil\n}\n\nfunc (x *GetImageRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetImageRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetImageRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *GetImageRequest) SetExcludeImports(v bool) {\n\tx.xxx_hidden_ExcludeImports = v\n}\n\nfunc (x *GetImageRequest) SetExcludeSourceInfo(v bool) {\n\tx.xxx_hidden_ExcludeSourceInfo = v\n}\n\nfunc (x *GetImageRequest) SetTypes(v []string) {\n\tx.xxx_hidden_Types = v\n}\n\nfunc (x *GetImageRequest) SetIncludeMask(v []ImageMask) {\n\tx.xxx_hidden_IncludeMask = v\n}\n\ntype GetImageRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n\t// Exclude files from imported buf modules in this image.\n\tExcludeImports bool\n\t// Exclude source_code_info fields from each ImageFile.\n\tExcludeSourceInfo bool\n\t// When specified the returned image will only contain the necessary files and\n\t// descriptors in those files to describe these types. Accepts messages, enums\n\t// and services. All types must be defined in the buf module, types in\n\t// dependencies are not accepted.\n\t//\n\t// At this time specifying `types` requires `exclude_source_info` to be set to\n\t// true.\n\tTypes []string\n\t// When not empty, the returned image's files will only include\n\t// *DescriptorProto fields for the elements specified here. The masks are\n\t// applied without regard for dependencies between types. For example, if\n\t// `IMAGE_MASK_MESSAGES` is specified without `IMAGE_MASK_ENUMS` the resulting\n\t// image will NOT contain enum definitions even if they are referenced from\n\t// message fields.\n\tIncludeMask []ImageMask\n}\n\nfunc (b0 GetImageRequest_builder) Build() *GetImageRequest {\n\tm0 := &GetImageRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_ExcludeImports = b.ExcludeImports\n\tx.xxx_hidden_ExcludeSourceInfo = b.ExcludeSourceInfo\n\tx.xxx_hidden_Types = b.Types\n\tx.xxx_hidden_IncludeMask = b.IncludeMask\n\treturn m0\n}\n\ntype GetImageResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Image *v1.Image              `protobuf:\"bytes,1,opt,name=image,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *GetImageResponse) Reset() {\n\t*x = GetImageResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetImageResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetImageResponse) ProtoMessage() {}\n\nfunc (x *GetImageResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_image_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\nfunc (x *GetImageResponse) GetImage() *v1.Image {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Image\n\t}\n\treturn nil\n}\n\nfunc (x *GetImageResponse) SetImage(v *v1.Image) {\n\tx.xxx_hidden_Image = v\n}\n\nfunc (x *GetImageResponse) HasImage() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Image != nil\n}\n\nfunc (x *GetImageResponse) ClearImage() {\n\tx.xxx_hidden_Image = nil\n}\n\ntype GetImageResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tImage *v1.Image\n}\n\nfunc (b0 GetImageResponse_builder) Build() *GetImageResponse {\n\tm0 := &GetImageResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Image = b.Image\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_image_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_image_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"'buf/alpha/registry/v1alpha1/image.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1ebuf/alpha/image/v1/image.proto\\\"\\x9f\\x02\\n\" +\n\t\"\\x0fGetImageRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\x12'\\n\" +\n\t\"\\x0fexclude_imports\\x18\\x04 \\x01(\\bR\\x0eexcludeImports\\x12.\\n\" +\n\t\"\\x13exclude_source_info\\x18\\x05 \\x01(\\bR\\x11excludeSourceInfo\\x12\\x14\\n\" +\n\t\"\\x05types\\x18\\x06 \\x03(\\tR\\x05types\\x12I\\n\" +\n\t\"\\finclude_mask\\x18\\a \\x03(\\x0e2&.buf.alpha.registry.v1alpha1.ImageMaskR\\vincludeMask\\\"C\\n\" +\n\t\"\\x10GetImageResponse\\x12/\\n\" +\n\t\"\\x05image\\x18\\x01 \\x01(\\v2\\x19.buf.alpha.image.v1.ImageR\\x05image*o\\n\" +\n\t\"\\tImageMask\\x12\\x1a\\n\" +\n\t\"\\x16IMAGE_MASK_UNSPECIFIED\\x10\\x00\\x12\\x17\\n\" +\n\t\"\\x13IMAGE_MASK_MESSAGES\\x10\\x01\\x12\\x14\\n\" +\n\t\"\\x10IMAGE_MASK_ENUMS\\x10\\x02\\x12\\x17\\n\" +\n\t\"\\x13IMAGE_MASK_SERVICES\\x10\\x032|\\n\" +\n\t\"\\fImageService\\x12l\\n\" +\n\t\"\\bGetImage\\x12,.buf.alpha.registry.v1alpha1.GetImageRequest\\x1a-.buf.alpha.registry.v1alpha1.GetImageResponse\\\"\\x03\\x90\\x02\\x01B\\x97\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\n\" +\n\t\"ImageProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_image_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_image_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_registry_v1alpha1_image_proto_goTypes = []any{\n\t(ImageMask)(0),           // 0: buf.alpha.registry.v1alpha1.ImageMask\n\t(*GetImageRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.GetImageRequest\n\t(*GetImageResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetImageResponse\n\t(*v1.Image)(nil),         // 3: buf.alpha.image.v1.Image\n}\nvar file_buf_alpha_registry_v1alpha1_image_proto_depIdxs = []int32{\n\t0, // 0: buf.alpha.registry.v1alpha1.GetImageRequest.include_mask:type_name -> buf.alpha.registry.v1alpha1.ImageMask\n\t3, // 1: buf.alpha.registry.v1alpha1.GetImageResponse.image:type_name -> buf.alpha.image.v1.Image\n\t1, // 2: buf.alpha.registry.v1alpha1.ImageService.GetImage:input_type -> buf.alpha.registry.v1alpha1.GetImageRequest\n\t2, // 3: buf.alpha.registry.v1alpha1.ImageService.GetImage:output_type -> buf.alpha.registry.v1alpha1.GetImageResponse\n\t3, // [3:4] is the sub-list for method output_type\n\t2, // [2:3] 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_buf_alpha_registry_v1alpha1_image_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_image_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_image_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_buf_alpha_registry_v1alpha1_image_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_image_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_image_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_image_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_image_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_image_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_image_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_image_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_image_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/jsonschema.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/jsonschema.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 GetJSONSchemaRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\txxx_hidden_TypeName   string                 `protobuf:\"bytes,4,opt,name=type_name,json=typeName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetJSONSchemaRequest) Reset() {\n\t*x = GetJSONSchemaRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetJSONSchemaRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetJSONSchemaRequest) ProtoMessage() {}\n\nfunc (x *GetJSONSchemaRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_jsonschema_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\nfunc (x *GetJSONSchemaRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetJSONSchemaRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetJSONSchemaRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetJSONSchemaRequest) GetTypeName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TypeName\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetJSONSchemaRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetJSONSchemaRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetJSONSchemaRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *GetJSONSchemaRequest) SetTypeName(v string) {\n\tx.xxx_hidden_TypeName = v\n}\n\ntype GetJSONSchemaRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n\t// A fully qualified name of the type to generate a JSONSchema for, e.g.\n\t// \"pkg.foo.Bar\". The type needs to resolve in the referenced module or any of\n\t// its dependencies. Currently only messages types are supported.\n\tTypeName string\n}\n\nfunc (b0 GetJSONSchemaRequest_builder) Build() *GetJSONSchemaRequest {\n\tm0 := &GetJSONSchemaRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_TypeName = b.TypeName\n\treturn m0\n}\n\ntype GetJSONSchemaResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_JsonSchema []byte                 `protobuf:\"bytes,1,opt,name=json_schema,json=jsonSchema,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetJSONSchemaResponse) Reset() {\n\t*x = GetJSONSchemaResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetJSONSchemaResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetJSONSchemaResponse) ProtoMessage() {}\n\nfunc (x *GetJSONSchemaResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_jsonschema_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\nfunc (x *GetJSONSchemaResponse) GetJsonSchema() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_JsonSchema\n\t}\n\treturn nil\n}\n\nfunc (x *GetJSONSchemaResponse) SetJsonSchema(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_JsonSchema = v\n}\n\ntype GetJSONSchemaResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// A json schema representing what the json encoded payload for type_name\n\t// should conform to. This schema is an approximation to be used by editors\n\t// for validation and autocompletion, not a lossless representation of the\n\t// type's descriptor.\n\tJsonSchema []byte\n}\n\nfunc (b0 GetJSONSchemaResponse_builder) Build() *GetJSONSchemaResponse {\n\tm0 := &GetJSONSchemaResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_JsonSchema = b.JsonSchema\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_jsonschema_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\",buf/alpha/registry/v1alpha1/jsonschema.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\\"\\x87\\x01\\n\" +\n\t\"\\x14GetJSONSchemaRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\x12\\x1b\\n\" +\n\t\"\\ttype_name\\x18\\x04 \\x01(\\tR\\btypeName\\\"8\\n\" +\n\t\"\\x15GetJSONSchemaResponse\\x12\\x1f\\n\" +\n\t\"\\vjson_schema\\x18\\x01 \\x01(\\fR\\n\" +\n\t\"jsonSchema2\\x90\\x01\\n\" +\n\t\"\\x11JSONSchemaService\\x12{\\n\" +\n\t\"\\rGetJSONSchema\\x121.buf.alpha.registry.v1alpha1.GetJSONSchemaRequest\\x1a2.buf.alpha.registry.v1alpha1.GetJSONSchemaResponse\\\"\\x03\\x90\\x02\\x01B\\x9c\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x0fJsonschemaProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_registry_v1alpha1_jsonschema_proto_goTypes = []any{\n\t(*GetJSONSchemaRequest)(nil),  // 0: buf.alpha.registry.v1alpha1.GetJSONSchemaRequest\n\t(*GetJSONSchemaResponse)(nil), // 1: buf.alpha.registry.v1alpha1.GetJSONSchemaResponse\n}\nvar file_buf_alpha_registry_v1alpha1_jsonschema_proto_depIdxs = []int32{\n\t0, // 0: buf.alpha.registry.v1alpha1.JSONSchemaService.GetJSONSchema:input_type -> buf.alpha.registry.v1alpha1.GetJSONSchemaRequest\n\t1, // 1: buf.alpha.registry.v1alpha1.JSONSchemaService.GetJSONSchema:output_type -> buf.alpha.registry.v1alpha1.GetJSONSchemaResponse\n\t1, // [1:2] is the sub-list for method output_type\n\t0, // [0:1] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_jsonschema_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_jsonschema_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_jsonschema_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_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_jsonschema_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_jsonschema_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_jsonschema_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_jsonschema_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_jsonschema_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/module.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/module.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// LocalModuleReference is a local module reference.\n//\n// It does not include a remote.\ntype LocalModuleReference struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *LocalModuleReference) Reset() {\n\t*x = LocalModuleReference{}\n\tmi := &file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *LocalModuleReference) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*LocalModuleReference) ProtoMessage() {}\n\nfunc (x *LocalModuleReference) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_module_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\nfunc (x *LocalModuleReference) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *LocalModuleReference) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *LocalModuleReference) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *LocalModuleReference) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *LocalModuleReference) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *LocalModuleReference) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype LocalModuleReference_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// either branch or commit\n\tReference string\n}\n\nfunc (b0 LocalModuleReference_builder) Build() *LocalModuleReference {\n\tm0 := &LocalModuleReference{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\n// LocalModulePin is a local module pin.\n//\n// It does not include a remote.\ntype LocalModulePin struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner          string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository     string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Commit         string                 `protobuf:\"bytes,4,opt,name=commit,proto3\"`\n\txxx_hidden_ManifestDigest string                 `protobuf:\"bytes,6,opt,name=manifest_digest,json=manifestDigest,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *LocalModulePin) Reset() {\n\t*x = LocalModulePin{}\n\tmi := &file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *LocalModulePin) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*LocalModulePin) ProtoMessage() {}\n\nfunc (x *LocalModulePin) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_module_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\nfunc (x *LocalModulePin) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *LocalModulePin) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *LocalModulePin) GetCommit() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn \"\"\n}\n\nfunc (x *LocalModulePin) GetManifestDigest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ManifestDigest\n\t}\n\treturn \"\"\n}\n\nfunc (x *LocalModulePin) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *LocalModulePin) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *LocalModulePin) SetCommit(v string) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *LocalModulePin) SetManifestDigest(v string) {\n\tx.xxx_hidden_ManifestDigest = v\n}\n\ntype LocalModulePin_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\tCommit     string\n\t// Module's manifest digest. Replacement for previous b1/b3 digests.\n\tManifestDigest string\n}\n\nfunc (b0 LocalModulePin_builder) Build() *LocalModulePin {\n\tm0 := &LocalModulePin{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Commit = b.Commit\n\tx.xxx_hidden_ManifestDigest = b.ManifestDigest\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_module_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_module_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"(buf/alpha/registry/v1alpha1/module.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\\"j\\n\" +\n\t\"\\x14LocalModuleReference\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"\\xc8\\x01\\n\" +\n\t\"\\x0eLocalModulePin\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x16\\n\" +\n\t\"\\x06commit\\x18\\x04 \\x01(\\tR\\x06commit\\x12'\\n\" +\n\t\"\\x0fmanifest_digest\\x18\\x06 \\x01(\\tR\\x0emanifestDigestJ\\x04\\b\\x03\\x10\\x04J\\x04\\b\\x05\\x10\\x06J\\x04\\b\\a\\x10\\bJ\\x04\\b\\b\\x10\\tR\\x06branchR\\vcreate_timeR\\x06digestR\\n\" +\n\t\"draft_nameB\\x98\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\vModuleProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_buf_alpha_registry_v1alpha1_module_proto_goTypes = []any{\n\t(*LocalModuleReference)(nil), // 0: buf.alpha.registry.v1alpha1.LocalModuleReference\n\t(*LocalModulePin)(nil),       // 1: buf.alpha.registry.v1alpha1.LocalModulePin\n}\nvar file_buf_alpha_registry_v1alpha1_module_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_module_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_module_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_module_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_buf_alpha_registry_v1alpha1_module_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_module_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_buf_alpha_registry_v1alpha1_module_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_module_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_module_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_module_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_module_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_module_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/organization.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/organization.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 Organization struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id                 string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime         *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_UpdateTime         *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=update_time,json=updateTime,proto3\"`\n\txxx_hidden_Name               string                 `protobuf:\"bytes,4,opt,name=name,proto3\"`\n\txxx_hidden_Description        string                 `protobuf:\"bytes,5,opt,name=description,proto3\"`\n\txxx_hidden_Url                string                 `protobuf:\"bytes,6,opt,name=url,proto3\"`\n\txxx_hidden_VerificationStatus VerificationStatus     `protobuf:\"varint,7,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *Organization) Reset() {\n\t*x = Organization{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Organization) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Organization) ProtoMessage() {}\n\nfunc (x *Organization) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *Organization) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *Organization) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *Organization) GetUpdateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UpdateTime\n\t}\n\treturn nil\n}\n\nfunc (x *Organization) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Organization) GetDescription() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Description\n\t}\n\treturn \"\"\n}\n\nfunc (x *Organization) GetUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Url\n\t}\n\treturn \"\"\n}\n\nfunc (x *Organization) GetVerificationStatus() VerificationStatus {\n\tif x != nil {\n\t\treturn x.xxx_hidden_VerificationStatus\n\t}\n\treturn VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED\n}\n\nfunc (x *Organization) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *Organization) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *Organization) SetUpdateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_UpdateTime = v\n}\n\nfunc (x *Organization) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Organization) SetDescription(v string) {\n\tx.xxx_hidden_Description = v\n}\n\nfunc (x *Organization) SetUrl(v string) {\n\tx.xxx_hidden_Url = v\n}\n\nfunc (x *Organization) SetVerificationStatus(v VerificationStatus) {\n\tx.xxx_hidden_VerificationStatus = v\n}\n\nfunc (x *Organization) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *Organization) HasUpdateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_UpdateTime != nil\n}\n\nfunc (x *Organization) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *Organization) ClearUpdateTime() {\n\tx.xxx_hidden_UpdateTime = nil\n}\n\ntype Organization_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// primary key, unique, immutable\n\tId string\n\t// immutable\n\tCreateTime *timestamppb.Timestamp\n\t// mutable\n\tUpdateTime *timestamppb.Timestamp\n\t// unique, mutable\n\tName string\n\t// description is the user configurable description of the organization.\n\tDescription string\n\t// url is the user configurable URL in the description of the organization,\n\t// always included the scheme and will not have a #fragment suffix.\n\tUrl string\n\t// verification status of the organization, configurable by server admin.\n\tVerificationStatus VerificationStatus\n}\n\nfunc (b0 Organization_builder) Build() *Organization {\n\tm0 := &Organization{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_UpdateTime = b.UpdateTime\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Description = b.Description\n\tx.xxx_hidden_Url = b.Url\n\tx.xxx_hidden_VerificationStatus = b.VerificationStatus\n\treturn m0\n}\n\n// OrganizationMembership is a nested structure that contains\n// the organization and user membership information on that organization.\ntype OrganizationMembership struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Organization     *Organization          `protobuf:\"bytes,1,opt,name=organization,proto3\"`\n\txxx_hidden_OrganizationRole OrganizationRole       `protobuf:\"varint,2,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *OrganizationMembership) Reset() {\n\t*x = OrganizationMembership{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *OrganizationMembership) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*OrganizationMembership) ProtoMessage() {}\n\nfunc (x *OrganizationMembership) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *OrganizationMembership) GetOrganization() *Organization {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Organization\n\t}\n\treturn nil\n}\n\nfunc (x *OrganizationMembership) GetOrganizationRole() OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationRole\n\t}\n\treturn OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\nfunc (x *OrganizationMembership) SetOrganization(v *Organization) {\n\tx.xxx_hidden_Organization = v\n}\n\nfunc (x *OrganizationMembership) SetOrganizationRole(v OrganizationRole) {\n\tx.xxx_hidden_OrganizationRole = v\n}\n\nfunc (x *OrganizationMembership) HasOrganization() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Organization != nil\n}\n\nfunc (x *OrganizationMembership) ClearOrganization() {\n\tx.xxx_hidden_Organization = nil\n}\n\ntype OrganizationMembership_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganization     *Organization\n\tOrganizationRole OrganizationRole\n}\n\nfunc (b0 OrganizationMembership_builder) Build() *OrganizationMembership {\n\tm0 := &OrganizationMembership{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Organization = b.Organization\n\tx.xxx_hidden_OrganizationRole = b.OrganizationRole\n\treturn m0\n}\n\ntype GetOrganizationRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetOrganizationRequest) Reset() {\n\t*x = GetOrganizationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOrganizationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOrganizationRequest) ProtoMessage() {}\n\nfunc (x *GetOrganizationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *GetOrganizationRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetOrganizationRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\ntype GetOrganizationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId string\n}\n\nfunc (b0 GetOrganizationRequest_builder) Build() *GetOrganizationRequest {\n\tm0 := &GetOrganizationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\treturn m0\n}\n\ntype GetOrganizationResponse struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Organization *Organization          `protobuf:\"bytes,1,opt,name=organization,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetOrganizationResponse) Reset() {\n\t*x = GetOrganizationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOrganizationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOrganizationResponse) ProtoMessage() {}\n\nfunc (x *GetOrganizationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *GetOrganizationResponse) GetOrganization() *Organization {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Organization\n\t}\n\treturn nil\n}\n\nfunc (x *GetOrganizationResponse) SetOrganization(v *Organization) {\n\tx.xxx_hidden_Organization = v\n}\n\nfunc (x *GetOrganizationResponse) HasOrganization() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Organization != nil\n}\n\nfunc (x *GetOrganizationResponse) ClearOrganization() {\n\tx.xxx_hidden_Organization = nil\n}\n\ntype GetOrganizationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganization *Organization\n}\n\nfunc (b0 GetOrganizationResponse_builder) Build() *GetOrganizationResponse {\n\tm0 := &GetOrganizationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Organization = b.Organization\n\treturn m0\n}\n\ntype GetOrganizationByNameRequest struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *GetOrganizationByNameRequest) Reset() {\n\t*x = GetOrganizationByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOrganizationByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOrganizationByNameRequest) ProtoMessage() {}\n\nfunc (x *GetOrganizationByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *GetOrganizationByNameRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetOrganizationByNameRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype GetOrganizationByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n}\n\nfunc (b0 GetOrganizationByNameRequest_builder) Build() *GetOrganizationByNameRequest {\n\tm0 := &GetOrganizationByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype GetOrganizationByNameResponse struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Organization *Organization          `protobuf:\"bytes,1,opt,name=organization,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetOrganizationByNameResponse) Reset() {\n\t*x = GetOrganizationByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOrganizationByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOrganizationByNameResponse) ProtoMessage() {}\n\nfunc (x *GetOrganizationByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *GetOrganizationByNameResponse) GetOrganization() *Organization {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Organization\n\t}\n\treturn nil\n}\n\nfunc (x *GetOrganizationByNameResponse) SetOrganization(v *Organization) {\n\tx.xxx_hidden_Organization = v\n}\n\nfunc (x *GetOrganizationByNameResponse) HasOrganization() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Organization != nil\n}\n\nfunc (x *GetOrganizationByNameResponse) ClearOrganization() {\n\tx.xxx_hidden_Organization = nil\n}\n\ntype GetOrganizationByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganization *Organization\n}\n\nfunc (b0 GetOrganizationByNameResponse_builder) Build() *GetOrganizationByNameResponse {\n\tm0 := &GetOrganizationByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Organization = b.Organization\n\treturn m0\n}\n\ntype ListOrganizationsRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListOrganizationsRequest) Reset() {\n\t*x = ListOrganizationsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListOrganizationsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListOrganizationsRequest) ProtoMessage() {}\n\nfunc (x *ListOrganizationsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *ListOrganizationsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListOrganizationsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationsRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListOrganizationsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListOrganizationsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListOrganizationsRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListOrganizationsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListOrganizationsRequest_builder) Build() *ListOrganizationsRequest {\n\tm0 := &ListOrganizationsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListOrganizationsResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Organizations *[]*Organization       `protobuf:\"bytes,1,rep,name=organizations,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListOrganizationsResponse) Reset() {\n\t*x = ListOrganizationsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListOrganizationsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListOrganizationsResponse) ProtoMessage() {}\n\nfunc (x *ListOrganizationsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *ListOrganizationsResponse) GetOrganizations() []*Organization {\n\tif x != nil {\n\t\tif x.xxx_hidden_Organizations != nil {\n\t\t\treturn *x.xxx_hidden_Organizations\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListOrganizationsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationsResponse) SetOrganizations(v []*Organization) {\n\tx.xxx_hidden_Organizations = &v\n}\n\nfunc (x *ListOrganizationsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListOrganizationsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganizations []*Organization\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListOrganizationsResponse_builder) Build() *ListOrganizationsResponse {\n\tm0 := &ListOrganizationsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Organizations = &b.Organizations\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListUserOrganizationsRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserId    string                 `protobuf:\"bytes,1,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,4,opt,name=reverse,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListUserOrganizationsRequest) Reset() {\n\t*x = ListUserOrganizationsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListUserOrganizationsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListUserOrganizationsRequest) ProtoMessage() {}\n\nfunc (x *ListUserOrganizationsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_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\nfunc (x *ListUserOrganizationsRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUserOrganizationsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListUserOrganizationsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUserOrganizationsRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListUserOrganizationsRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *ListUserOrganizationsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListUserOrganizationsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListUserOrganizationsRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListUserOrganizationsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the user whose organizations should be listed.\n\tUserId   string\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListUserOrganizationsRequest_builder) Build() *ListUserOrganizationsRequest {\n\tm0 := &ListUserOrganizationsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListUserOrganizationsResponse struct {\n\tstate                    protoimpl.MessageState     `protogen:\"opaque.v1\"`\n\txxx_hidden_Organizations *[]*OrganizationMembership `protobuf:\"bytes,1,rep,name=organizations,proto3\"`\n\txxx_hidden_NextPageToken string                     `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListUserOrganizationsResponse) Reset() {\n\t*x = ListUserOrganizationsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListUserOrganizationsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListUserOrganizationsResponse) ProtoMessage() {}\n\nfunc (x *ListUserOrganizationsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[9]\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\nfunc (x *ListUserOrganizationsResponse) GetOrganizations() []*OrganizationMembership {\n\tif x != nil {\n\t\tif x.xxx_hidden_Organizations != nil {\n\t\t\treturn *x.xxx_hidden_Organizations\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListUserOrganizationsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUserOrganizationsResponse) SetOrganizations(v []*OrganizationMembership) {\n\tx.xxx_hidden_Organizations = &v\n}\n\nfunc (x *ListUserOrganizationsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListUserOrganizationsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganizations []*OrganizationMembership\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListUserOrganizationsResponse_builder) Build() *ListUserOrganizationsResponse {\n\tm0 := &ListUserOrganizationsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Organizations = &b.Organizations\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype GetUserOrganizationRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserId         string                 `protobuf:\"bytes,1,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,2,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *GetUserOrganizationRequest) Reset() {\n\t*x = GetUserOrganizationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUserOrganizationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUserOrganizationRequest) ProtoMessage() {}\n\nfunc (x *GetUserOrganizationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[10]\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\nfunc (x *GetUserOrganizationRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetUserOrganizationRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetUserOrganizationRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *GetUserOrganizationRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype GetUserOrganizationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the user whose membership should be retrieved.\n\tUserId string\n\t// The ID of the organization.\n\tOrganizationId string\n}\n\nfunc (b0 GetUserOrganizationRequest_builder) Build() *GetUserOrganizationRequest {\n\tm0 := &GetUserOrganizationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype GetUserOrganizationResponse struct {\n\tstate                             protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationMembership *OrganizationMembership `protobuf:\"bytes,1,opt,name=organization_membership,json=organizationMembership,proto3\"`\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *GetUserOrganizationResponse) Reset() {\n\t*x = GetUserOrganizationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUserOrganizationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUserOrganizationResponse) ProtoMessage() {}\n\nfunc (x *GetUserOrganizationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[11]\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\nfunc (x *GetUserOrganizationResponse) GetOrganizationMembership() *OrganizationMembership {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationMembership\n\t}\n\treturn nil\n}\n\nfunc (x *GetUserOrganizationResponse) SetOrganizationMembership(v *OrganizationMembership) {\n\tx.xxx_hidden_OrganizationMembership = v\n}\n\nfunc (x *GetUserOrganizationResponse) HasOrganizationMembership() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_OrganizationMembership != nil\n}\n\nfunc (x *GetUserOrganizationResponse) ClearOrganizationMembership() {\n\tx.xxx_hidden_OrganizationMembership = nil\n}\n\ntype GetUserOrganizationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganizationMembership *OrganizationMembership\n}\n\nfunc (b0 GetUserOrganizationResponse_builder) Build() *GetUserOrganizationResponse {\n\tm0 := &GetUserOrganizationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationMembership = b.OrganizationMembership\n\treturn m0\n}\n\ntype CreateOrganizationRequest struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *CreateOrganizationRequest) Reset() {\n\t*x = CreateOrganizationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateOrganizationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateOrganizationRequest) ProtoMessage() {}\n\nfunc (x *CreateOrganizationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[12]\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\nfunc (x *CreateOrganizationRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateOrganizationRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype CreateOrganizationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Must be unique across organizations.\n\tName string\n}\n\nfunc (b0 CreateOrganizationRequest_builder) Build() *CreateOrganizationRequest {\n\tm0 := &CreateOrganizationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype CreateOrganizationResponse struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Organization *Organization          `protobuf:\"bytes,1,opt,name=organization,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *CreateOrganizationResponse) Reset() {\n\t*x = CreateOrganizationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateOrganizationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateOrganizationResponse) ProtoMessage() {}\n\nfunc (x *CreateOrganizationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[13]\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\nfunc (x *CreateOrganizationResponse) GetOrganization() *Organization {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Organization\n\t}\n\treturn nil\n}\n\nfunc (x *CreateOrganizationResponse) SetOrganization(v *Organization) {\n\tx.xxx_hidden_Organization = v\n}\n\nfunc (x *CreateOrganizationResponse) HasOrganization() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Organization != nil\n}\n\nfunc (x *CreateOrganizationResponse) ClearOrganization() {\n\tx.xxx_hidden_Organization = nil\n}\n\ntype CreateOrganizationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganization *Organization\n}\n\nfunc (b0 CreateOrganizationResponse_builder) Build() *CreateOrganizationResponse {\n\tm0 := &CreateOrganizationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Organization = b.Organization\n\treturn m0\n}\n\ntype DeleteOrganizationRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteOrganizationRequest) Reset() {\n\t*x = DeleteOrganizationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteOrganizationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteOrganizationRequest) ProtoMessage() {}\n\nfunc (x *DeleteOrganizationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[14]\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\nfunc (x *DeleteOrganizationRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteOrganizationRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\ntype DeleteOrganizationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId string\n}\n\nfunc (b0 DeleteOrganizationRequest_builder) Build() *DeleteOrganizationRequest {\n\tm0 := &DeleteOrganizationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\treturn m0\n}\n\ntype DeleteOrganizationResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteOrganizationResponse) Reset() {\n\t*x = DeleteOrganizationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteOrganizationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteOrganizationResponse) ProtoMessage() {}\n\nfunc (x *DeleteOrganizationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[15]\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\ntype DeleteOrganizationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteOrganizationResponse_builder) Build() *DeleteOrganizationResponse {\n\tm0 := &DeleteOrganizationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype DeleteOrganizationByNameRequest struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *DeleteOrganizationByNameRequest) Reset() {\n\t*x = DeleteOrganizationByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteOrganizationByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteOrganizationByNameRequest) ProtoMessage() {}\n\nfunc (x *DeleteOrganizationByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[16]\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\nfunc (x *DeleteOrganizationByNameRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteOrganizationByNameRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype DeleteOrganizationByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName string\n}\n\nfunc (b0 DeleteOrganizationByNameRequest_builder) Build() *DeleteOrganizationByNameRequest {\n\tm0 := &DeleteOrganizationByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype DeleteOrganizationByNameResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteOrganizationByNameResponse) Reset() {\n\t*x = DeleteOrganizationByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteOrganizationByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteOrganizationByNameResponse) ProtoMessage() {}\n\nfunc (x *DeleteOrganizationByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[17]\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\ntype DeleteOrganizationByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteOrganizationByNameResponse_builder) Build() *DeleteOrganizationByNameResponse {\n\tm0 := &DeleteOrganizationByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype AddOrganizationMemberRequest struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_UserId           string                 `protobuf:\"bytes,2,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_OrganizationRole OrganizationRole       `protobuf:\"varint,3,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *AddOrganizationMemberRequest) Reset() {\n\t*x = AddOrganizationMemberRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *AddOrganizationMemberRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AddOrganizationMemberRequest) ProtoMessage() {}\n\nfunc (x *AddOrganizationMemberRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[18]\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\nfunc (x *AddOrganizationMemberRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *AddOrganizationMemberRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *AddOrganizationMemberRequest) GetOrganizationRole() OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationRole\n\t}\n\treturn OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\nfunc (x *AddOrganizationMemberRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *AddOrganizationMemberRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *AddOrganizationMemberRequest) SetOrganizationRole(v OrganizationRole) {\n\tx.xxx_hidden_OrganizationRole = v\n}\n\ntype AddOrganizationMemberRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which the user will be added to.\n\tOrganizationId string\n\t// The ID of the user for which to be added to the organization.\n\tUserId string\n\t// The new role of the user in the organization.\n\tOrganizationRole OrganizationRole\n}\n\nfunc (b0 AddOrganizationMemberRequest_builder) Build() *AddOrganizationMemberRequest {\n\tm0 := &AddOrganizationMemberRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_OrganizationRole = b.OrganizationRole\n\treturn m0\n}\n\ntype AddOrganizationMemberResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *AddOrganizationMemberResponse) Reset() {\n\t*x = AddOrganizationMemberResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *AddOrganizationMemberResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AddOrganizationMemberResponse) ProtoMessage() {}\n\nfunc (x *AddOrganizationMemberResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[19]\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\ntype AddOrganizationMemberResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 AddOrganizationMemberResponse_builder) Build() *AddOrganizationMemberResponse {\n\tm0 := &AddOrganizationMemberResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype UpdateOrganizationMemberRequest struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId   string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_UserId           string                 `protobuf:\"bytes,2,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_OrganizationRole OrganizationRole       `protobuf:\"varint,3,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationMemberRequest) Reset() {\n\t*x = UpdateOrganizationMemberRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationMemberRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationMemberRequest) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationMemberRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[20]\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\nfunc (x *UpdateOrganizationMemberRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationMemberRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationMemberRequest) GetOrganizationRole() OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationRole\n\t}\n\treturn OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\nfunc (x *UpdateOrganizationMemberRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *UpdateOrganizationMemberRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *UpdateOrganizationMemberRequest) SetOrganizationRole(v OrganizationRole) {\n\tx.xxx_hidden_OrganizationRole = v\n}\n\ntype UpdateOrganizationMemberRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which the member belongs to.\n\tOrganizationId string\n\t// The ID of the user for which to be updated the role.\n\tUserId string\n\t// The new role of the user in the organization.\n\tOrganizationRole OrganizationRole\n}\n\nfunc (b0 UpdateOrganizationMemberRequest_builder) Build() *UpdateOrganizationMemberRequest {\n\tm0 := &UpdateOrganizationMemberRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_OrganizationRole = b.OrganizationRole\n\treturn m0\n}\n\ntype UpdateOrganizationMemberResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationMemberResponse) Reset() {\n\t*x = UpdateOrganizationMemberResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationMemberResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationMemberResponse) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationMemberResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[21]\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\ntype UpdateOrganizationMemberResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateOrganizationMemberResponse_builder) Build() *UpdateOrganizationMemberResponse {\n\tm0 := &UpdateOrganizationMemberResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype RemoveOrganizationMemberRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_UserId         string                 `protobuf:\"bytes,2,opt,name=user_id,json=userId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *RemoveOrganizationMemberRequest) Reset() {\n\t*x = RemoveOrganizationMemberRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RemoveOrganizationMemberRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RemoveOrganizationMemberRequest) ProtoMessage() {}\n\nfunc (x *RemoveOrganizationMemberRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[22]\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\nfunc (x *RemoveOrganizationMemberRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RemoveOrganizationMemberRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RemoveOrganizationMemberRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *RemoveOrganizationMemberRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\ntype RemoveOrganizationMemberRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which the member belongs to.\n\tOrganizationId string\n\t// The ID of the user for which to be removed the role.\n\tUserId string\n}\n\nfunc (b0 RemoveOrganizationMemberRequest_builder) Build() *RemoveOrganizationMemberRequest {\n\tm0 := &RemoveOrganizationMemberRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_UserId = b.UserId\n\treturn m0\n}\n\ntype RemoveOrganizationMemberResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *RemoveOrganizationMemberResponse) Reset() {\n\t*x = RemoveOrganizationMemberResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RemoveOrganizationMemberResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RemoveOrganizationMemberResponse) ProtoMessage() {}\n\nfunc (x *RemoveOrganizationMemberResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[23]\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\ntype RemoveOrganizationMemberResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 RemoveOrganizationMemberResponse_builder) Build() *RemoveOrganizationMemberResponse {\n\tm0 := &RemoveOrganizationMemberResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetOrganizationSettingsRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *GetOrganizationSettingsRequest) Reset() {\n\t*x = GetOrganizationSettingsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[24]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOrganizationSettingsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOrganizationSettingsRequest) ProtoMessage() {}\n\nfunc (x *GetOrganizationSettingsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[24]\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\nfunc (x *GetOrganizationSettingsRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetOrganizationSettingsRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\ntype GetOrganizationSettingsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to get the settings.\n\tOrganizationId string\n}\n\nfunc (b0 GetOrganizationSettingsRequest_builder) Build() *GetOrganizationSettingsRequest {\n\tm0 := &GetOrganizationSettingsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\treturn m0\n}\n\ntype GetOrganizationSettingsResponse struct {\n\tstate                         protoimpl.MessageState                       `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryBaseRole RepositoryRole                               `protobuf:\"varint,1,opt,name=repository_base_role,json=repositoryBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\txxx_hidden_MembersCount       uint32                                       `protobuf:\"varint,4,opt,name=members_count,json=membersCount,proto3\"`\n\txxx_hidden_IdpGroups          *[]*GetOrganizationSettingsResponse_IdPGroup `protobuf:\"bytes,5,rep,name=idp_groups,json=idpGroups,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *GetOrganizationSettingsResponse) Reset() {\n\t*x = GetOrganizationSettingsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[25]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOrganizationSettingsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOrganizationSettingsResponse) ProtoMessage() {}\n\nfunc (x *GetOrganizationSettingsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[25]\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\nfunc (x *GetOrganizationSettingsResponse) GetRepositoryBaseRole() RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryBaseRole\n\t}\n\treturn RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\nfunc (x *GetOrganizationSettingsResponse) GetMembersCount() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MembersCount\n\t}\n\treturn 0\n}\n\nfunc (x *GetOrganizationSettingsResponse) GetIdpGroups() []*GetOrganizationSettingsResponse_IdPGroup {\n\tif x != nil {\n\t\tif x.xxx_hidden_IdpGroups != nil {\n\t\t\treturn *x.xxx_hidden_IdpGroups\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetOrganizationSettingsResponse) SetRepositoryBaseRole(v RepositoryRole) {\n\tx.xxx_hidden_RepositoryBaseRole = v\n}\n\nfunc (x *GetOrganizationSettingsResponse) SetMembersCount(v uint32) {\n\tx.xxx_hidden_MembersCount = v\n}\n\nfunc (x *GetOrganizationSettingsResponse) SetIdpGroups(v []*GetOrganizationSettingsResponse_IdPGroup) {\n\tx.xxx_hidden_IdpGroups = &v\n}\n\ntype GetOrganizationSettingsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryBaseRole RepositoryRole\n\t// The number of members in the organization.\n\tMembersCount uint32\n\t// The IdP groups associated with the organization.\n\tIdpGroups []*GetOrganizationSettingsResponse_IdPGroup\n}\n\nfunc (b0 GetOrganizationSettingsResponse_builder) Build() *GetOrganizationSettingsResponse {\n\tm0 := &GetOrganizationSettingsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryBaseRole = b.RepositoryBaseRole\n\tx.xxx_hidden_MembersCount = b.MembersCount\n\tx.xxx_hidden_IdpGroups = &b.IdpGroups\n\treturn m0\n}\n\ntype UpdateOrganizationSettingsRequest struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId     string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_RepositoryBaseRole RepositoryRole         `protobuf:\"varint,2,opt,name=repository_base_role,json=repositoryBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\txxx_hidden_Description        *string                `protobuf:\"bytes,5,opt,name=description,proto3,oneof\"`\n\txxx_hidden_Url                *string                `protobuf:\"bytes,6,opt,name=url,proto3,oneof\"`\n\tXXX_raceDetectHookData        protoimpl.RaceDetectHookData\n\tXXX_presence                  [1]uint32\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) Reset() {\n\t*x = UpdateOrganizationSettingsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[26]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationSettingsRequest) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationSettingsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[26]\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\nfunc (x *UpdateOrganizationSettingsRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) GetRepositoryBaseRole() RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryBaseRole\n\t}\n\treturn RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) GetDescription() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Description != nil {\n\t\t\treturn *x.xxx_hidden_Description\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) GetUrl() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Url != nil {\n\t\t\treturn *x.xxx_hidden_Url\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) SetRepositoryBaseRole(v RepositoryRole) {\n\tx.xxx_hidden_RepositoryBaseRole = v\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) SetDescription(v string) {\n\tx.xxx_hidden_Description = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4)\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) SetUrl(v string) {\n\tx.xxx_hidden_Url = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 4)\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) HasDescription() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) HasUrl() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 3)\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) ClearDescription() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_Description = nil\n}\n\nfunc (x *UpdateOrganizationSettingsRequest) ClearUrl() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3)\n\tx.xxx_hidden_Url = nil\n}\n\ntype UpdateOrganizationSettingsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to update the base roles.\n\tOrganizationId string\n\t// optional, no update to this base role will be made if this is unspecified.\n\tRepositoryBaseRole RepositoryRole\n\t// optional, update to description will only be made when this is present\n\tDescription *string\n\t// optional, update to url will only be made when this is present\n\tUrl *string\n}\n\nfunc (b0 UpdateOrganizationSettingsRequest_builder) Build() *UpdateOrganizationSettingsRequest {\n\tm0 := &UpdateOrganizationSettingsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_RepositoryBaseRole = b.RepositoryBaseRole\n\tif b.Description != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4)\n\t\tx.xxx_hidden_Description = b.Description\n\t}\n\tif b.Url != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 4)\n\t\tx.xxx_hidden_Url = b.Url\n\t}\n\treturn m0\n}\n\ntype UpdateOrganizationSettingsResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationSettingsResponse) Reset() {\n\t*x = UpdateOrganizationSettingsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[27]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationSettingsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationSettingsResponse) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationSettingsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[27]\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\ntype UpdateOrganizationSettingsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateOrganizationSettingsResponse_builder) Build() *UpdateOrganizationSettingsResponse {\n\tm0 := &UpdateOrganizationSettingsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype AddOrganizationGroupRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_GroupName      string                 `protobuf:\"bytes,2,opt,name=group_name,json=groupName,proto3\"`\n\txxx_hidden_RoleOverride   OrganizationRole       `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *AddOrganizationGroupRequest) Reset() {\n\t*x = AddOrganizationGroupRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[28]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *AddOrganizationGroupRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AddOrganizationGroupRequest) ProtoMessage() {}\n\nfunc (x *AddOrganizationGroupRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[28]\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\nfunc (x *AddOrganizationGroupRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *AddOrganizationGroupRequest) GetGroupName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GroupName\n\t}\n\treturn \"\"\n}\n\nfunc (x *AddOrganizationGroupRequest) GetRoleOverride() OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RoleOverride\n\t}\n\treturn OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\nfunc (x *AddOrganizationGroupRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *AddOrganizationGroupRequest) SetGroupName(v string) {\n\tx.xxx_hidden_GroupName = v\n}\n\nfunc (x *AddOrganizationGroupRequest) SetRoleOverride(v OrganizationRole) {\n\tx.xxx_hidden_RoleOverride = v\n}\n\ntype AddOrganizationGroupRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to add the group.\n\tOrganizationId string\n\t// The name of the group to add.\n\tGroupName string\n\t// The role to associate with this organization group.\n\t//\n\t// Any user who maps to this organization via this group will be granted this role. If no role is\n\t// set, the user will be granted the 'member' role.\n\tRoleOverride OrganizationRole\n}\n\nfunc (b0 AddOrganizationGroupRequest_builder) Build() *AddOrganizationGroupRequest {\n\tm0 := &AddOrganizationGroupRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_GroupName = b.GroupName\n\tx.xxx_hidden_RoleOverride = b.RoleOverride\n\treturn m0\n}\n\ntype AddOrganizationGroupResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *AddOrganizationGroupResponse) Reset() {\n\t*x = AddOrganizationGroupResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[29]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *AddOrganizationGroupResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AddOrganizationGroupResponse) ProtoMessage() {}\n\nfunc (x *AddOrganizationGroupResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[29]\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\ntype AddOrganizationGroupResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 AddOrganizationGroupResponse_builder) Build() *AddOrganizationGroupResponse {\n\tm0 := &AddOrganizationGroupResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype UpdateOrganizationGroupRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_GroupName      string                 `protobuf:\"bytes,2,opt,name=group_name,json=groupName,proto3\"`\n\txxx_hidden_RoleOverride   OrganizationRole       `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole,oneof\"`\n\tXXX_raceDetectHookData    protoimpl.RaceDetectHookData\n\tXXX_presence              [1]uint32\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationGroupRequest) Reset() {\n\t*x = UpdateOrganizationGroupRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[30]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationGroupRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationGroupRequest) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationGroupRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[30]\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\nfunc (x *UpdateOrganizationGroupRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationGroupRequest) GetGroupName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GroupName\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateOrganizationGroupRequest) GetRoleOverride() OrganizationRole {\n\tif x != nil {\n\t\tif protoimpl.X.Present(&(x.XXX_presence[0]), 2) {\n\t\t\treturn x.xxx_hidden_RoleOverride\n\t\t}\n\t}\n\treturn OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\nfunc (x *UpdateOrganizationGroupRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *UpdateOrganizationGroupRequest) SetGroupName(v string) {\n\tx.xxx_hidden_GroupName = v\n}\n\nfunc (x *UpdateOrganizationGroupRequest) SetRoleOverride(v OrganizationRole) {\n\tx.xxx_hidden_RoleOverride = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3)\n}\n\nfunc (x *UpdateOrganizationGroupRequest) HasRoleOverride() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *UpdateOrganizationGroupRequest) ClearRoleOverride() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_RoleOverride = OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\ntype UpdateOrganizationGroupRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization to which this group belongs.\n\tOrganizationId string\n\t// The name of the group to update.\n\tGroupName string\n\t// The role to associate with this organization group.\n\t//\n\t// Setting this to 'UNSPECIFIED' will remove the override. Leaving this unset will not update this\n\t// property.\n\tRoleOverride *OrganizationRole\n}\n\nfunc (b0 UpdateOrganizationGroupRequest_builder) Build() *UpdateOrganizationGroupRequest {\n\tm0 := &UpdateOrganizationGroupRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_GroupName = b.GroupName\n\tif b.RoleOverride != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3)\n\t\tx.xxx_hidden_RoleOverride = *b.RoleOverride\n\t}\n\treturn m0\n}\n\ntype UpdateOrganizationGroupResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateOrganizationGroupResponse) Reset() {\n\t*x = UpdateOrganizationGroupResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[31]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateOrganizationGroupResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateOrganizationGroupResponse) ProtoMessage() {}\n\nfunc (x *UpdateOrganizationGroupResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[31]\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\ntype UpdateOrganizationGroupResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateOrganizationGroupResponse_builder) Build() *UpdateOrganizationGroupResponse {\n\tm0 := &UpdateOrganizationGroupResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype RemoveOrganizationGroupRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_GroupName      string                 `protobuf:\"bytes,2,opt,name=group_name,json=groupName,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *RemoveOrganizationGroupRequest) Reset() {\n\t*x = RemoveOrganizationGroupRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[32]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RemoveOrganizationGroupRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RemoveOrganizationGroupRequest) ProtoMessage() {}\n\nfunc (x *RemoveOrganizationGroupRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[32]\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\nfunc (x *RemoveOrganizationGroupRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RemoveOrganizationGroupRequest) GetGroupName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GroupName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RemoveOrganizationGroupRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *RemoveOrganizationGroupRequest) SetGroupName(v string) {\n\tx.xxx_hidden_GroupName = v\n}\n\ntype RemoveOrganizationGroupRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization for which to remove the group.\n\tOrganizationId string\n\t// The name of the group to remove.\n\tGroupName string\n}\n\nfunc (b0 RemoveOrganizationGroupRequest_builder) Build() *RemoveOrganizationGroupRequest {\n\tm0 := &RemoveOrganizationGroupRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_GroupName = b.GroupName\n\treturn m0\n}\n\ntype RemoveOrganizationGroupResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *RemoveOrganizationGroupResponse) Reset() {\n\t*x = RemoveOrganizationGroupResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[33]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RemoveOrganizationGroupResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RemoveOrganizationGroupResponse) ProtoMessage() {}\n\nfunc (x *RemoveOrganizationGroupResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[33]\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\ntype RemoveOrganizationGroupResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 RemoveOrganizationGroupResponse_builder) Build() *RemoveOrganizationGroupResponse {\n\tm0 := &RemoveOrganizationGroupResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetOrganizationSettingsResponse_IdPGroup struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name         string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_RoleOverride OrganizationRole       `protobuf:\"varint,2,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetOrganizationSettingsResponse_IdPGroup) Reset() {\n\t*x = GetOrganizationSettingsResponse_IdPGroup{}\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[34]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOrganizationSettingsResponse_IdPGroup) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOrganizationSettingsResponse_IdPGroup) ProtoMessage() {}\n\nfunc (x *GetOrganizationSettingsResponse_IdPGroup) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[34]\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\nfunc (x *GetOrganizationSettingsResponse_IdPGroup) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetOrganizationSettingsResponse_IdPGroup) GetRoleOverride() OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RoleOverride\n\t}\n\treturn OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\nfunc (x *GetOrganizationSettingsResponse_IdPGroup) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GetOrganizationSettingsResponse_IdPGroup) SetRoleOverride(v OrganizationRole) {\n\tx.xxx_hidden_RoleOverride = v\n}\n\ntype GetOrganizationSettingsResponse_IdPGroup_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the IdP group.\n\tName string\n\t// The role override associated with this group.\n\tRoleOverride OrganizationRole\n}\n\nfunc (b0 GetOrganizationSettingsResponse_IdPGroup_builder) Build() *GetOrganizationSettingsResponse_IdPGroup {\n\tm0 := &GetOrganizationSettingsResponse_IdPGroup{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_RoleOverride = b.RoleOverride\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_organization_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_organization_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\".buf/alpha/registry/v1alpha1/organization.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/registry/v1alpha1/role.proto\\x1a5buf/alpha/registry/v1alpha1/verification_status.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xc2\\x02\\n\" +\n\t\"\\fOrganization\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12;\\n\" +\n\t\"\\vupdate_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"updateTime\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x04 \\x01(\\tR\\x04name\\x12 \\n\" +\n\t\"\\vdescription\\x18\\x05 \\x01(\\tR\\vdescription\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\x06 \\x01(\\tR\\x03url\\x12`\\n\" +\n\t\"\\x13verification_status\\x18\\a \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.VerificationStatusR\\x12verificationStatus\\\"\\xc3\\x01\\n\" +\n\t\"\\x16OrganizationMembership\\x12M\\n\" +\n\t\"\\forganization\\x18\\x01 \\x01(\\v2).buf.alpha.registry.v1alpha1.OrganizationR\\forganization\\x12Z\\n\" +\n\t\"\\x11organization_role\\x18\\x02 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x10organizationRole\\\"(\\n\" +\n\t\"\\x16GetOrganizationRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\\"h\\n\" +\n\t\"\\x17GetOrganizationResponse\\x12M\\n\" +\n\t\"\\forganization\\x18\\x01 \\x01(\\v2).buf.alpha.registry.v1alpha1.OrganizationR\\forganization\\\"2\\n\" +\n\t\"\\x1cGetOrganizationByNameRequest\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\\"n\\n\" +\n\t\"\\x1dGetOrganizationByNameResponse\\x12M\\n\" +\n\t\"\\forganization\\x18\\x01 \\x01(\\v2).buf.alpha.registry.v1alpha1.OrganizationR\\forganization\\\"p\\n\" +\n\t\"\\x18ListOrganizationsRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\\"\\x94\\x01\\n\" +\n\t\"\\x19ListOrganizationsResponse\\x12O\\n\" +\n\t\"\\rorganizations\\x18\\x01 \\x03(\\v2).buf.alpha.registry.v1alpha1.OrganizationR\\rorganizations\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x8d\\x01\\n\" +\n\t\"\\x1cListUserOrganizationsRequest\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x01 \\x01(\\tR\\x06userId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x04 \\x01(\\bR\\areverse\\\"\\xa2\\x01\\n\" +\n\t\"\\x1dListUserOrganizationsResponse\\x12Y\\n\" +\n\t\"\\rorganizations\\x18\\x01 \\x03(\\v23.buf.alpha.registry.v1alpha1.OrganizationMembershipR\\rorganizations\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"^\\n\" +\n\t\"\\x1aGetUserOrganizationRequest\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x01 \\x01(\\tR\\x06userId\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x02 \\x01(\\tR\\x0eorganizationId\\\"\\x8b\\x01\\n\" +\n\t\"\\x1bGetUserOrganizationResponse\\x12l\\n\" +\n\t\"\\x17organization_membership\\x18\\x01 \\x01(\\v23.buf.alpha.registry.v1alpha1.OrganizationMembershipR\\x16organizationMembership\\\"/\\n\" +\n\t\"\\x19CreateOrganizationRequest\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\\"k\\n\" +\n\t\"\\x1aCreateOrganizationResponse\\x12M\\n\" +\n\t\"\\forganization\\x18\\x01 \\x01(\\v2).buf.alpha.registry.v1alpha1.OrganizationR\\forganization\\\"+\\n\" +\n\t\"\\x19DeleteOrganizationRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\\"\\x1c\\n\" +\n\t\"\\x1aDeleteOrganizationResponse\\\"5\\n\" +\n\t\"\\x1fDeleteOrganizationByNameRequest\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\\"\\\"\\n\" +\n\t\" DeleteOrganizationByNameResponse\\\"\\xbc\\x01\\n\" +\n\t\"\\x1cAddOrganizationMemberRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x02 \\x01(\\tR\\x06userId\\x12Z\\n\" +\n\t\"\\x11organization_role\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x10organizationRole\\\"\\x1f\\n\" +\n\t\"\\x1dAddOrganizationMemberResponse\\\"\\xbf\\x01\\n\" +\n\t\"\\x1fUpdateOrganizationMemberRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x02 \\x01(\\tR\\x06userId\\x12Z\\n\" +\n\t\"\\x11organization_role\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x10organizationRole\\\"\\\"\\n\" +\n\t\" UpdateOrganizationMemberResponse\\\"c\\n\" +\n\t\"\\x1fRemoveOrganizationMemberRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x02 \\x01(\\tR\\x06userId\\\"\\\"\\n\" +\n\t\" RemoveOrganizationMemberResponse\\\"I\\n\" +\n\t\"\\x1eGetOrganizationSettingsRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\\"\\xb1\\x03\\n\" +\n\t\"\\x1fGetOrganizationSettingsResponse\\x12]\\n\" +\n\t\"\\x14repository_base_role\\x18\\x01 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x12repositoryBaseRole\\x12#\\n\" +\n\t\"\\rmembers_count\\x18\\x04 \\x01(\\rR\\fmembersCount\\x12d\\n\" +\n\t\"\\n\" +\n\t\"idp_groups\\x18\\x05 \\x03(\\v2E.buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.IdPGroupR\\tidpGroups\\x1ar\\n\" +\n\t\"\\bIdPGroup\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12R\\n\" +\n\t\"\\rrole_override\\x18\\x02 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\froleOverrideJ\\x04\\b\\x02\\x10\\x03J\\x04\\b\\x03\\x10\\x04R\\x10plugin_base_roleR\\x12template_base_role\\\"\\xb3\\x02\\n\" +\n\t\"!UpdateOrganizationSettingsRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12]\\n\" +\n\t\"\\x14repository_base_role\\x18\\x02 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x12repositoryBaseRole\\x12%\\n\" +\n\t\"\\vdescription\\x18\\x05 \\x01(\\tH\\x00R\\vdescription\\x88\\x01\\x01\\x12\\x15\\n\" +\n\t\"\\x03url\\x18\\x06 \\x01(\\tH\\x01R\\x03url\\x88\\x01\\x01B\\x0e\\n\" +\n\t\"\\f_descriptionB\\x06\\n\" +\n\t\"\\x04_urlJ\\x04\\b\\x03\\x10\\x04J\\x04\\b\\x04\\x10\\x05R\\x10plugin_base_roleR\\x12template_base_role\\\"$\\n\" +\n\t\"\\\"UpdateOrganizationSettingsResponse\\\"\\xb9\\x01\\n\" +\n\t\"\\x1bAddOrganizationGroupRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"group_name\\x18\\x02 \\x01(\\tR\\tgroupName\\x12R\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\froleOverride\\\"\\x1e\\n\" +\n\t\"\\x1cAddOrganizationGroupResponse\\\"\\xd3\\x01\\n\" +\n\t\"\\x1eUpdateOrganizationGroupRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"group_name\\x18\\x02 \\x01(\\tR\\tgroupName\\x12W\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleH\\x00R\\froleOverride\\x88\\x01\\x01B\\x10\\n\" +\n\t\"\\x0e_role_override\\\"!\\n\" +\n\t\"\\x1fUpdateOrganizationGroupResponse\\\"h\\n\" +\n\t\"\\x1eRemoveOrganizationGroupRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"group_name\\x18\\x02 \\x01(\\tR\\tgroupName\\\"!\\n\" +\n\t\"\\x1fRemoveOrganizationGroupResponse2\\xee\\x12\\n\" +\n\t\"\\x13OrganizationService\\x12\\x81\\x01\\n\" +\n\t\"\\x0fGetOrganization\\x123.buf.alpha.registry.v1alpha1.GetOrganizationRequest\\x1a4.buf.alpha.registry.v1alpha1.GetOrganizationResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x93\\x01\\n\" +\n\t\"\\x15GetOrganizationByName\\x129.buf.alpha.registry.v1alpha1.GetOrganizationByNameRequest\\x1a:.buf.alpha.registry.v1alpha1.GetOrganizationByNameResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x87\\x01\\n\" +\n\t\"\\x11ListOrganizations\\x125.buf.alpha.registry.v1alpha1.ListOrganizationsRequest\\x1a6.buf.alpha.registry.v1alpha1.ListOrganizationsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x93\\x01\\n\" +\n\t\"\\x15ListUserOrganizations\\x129.buf.alpha.registry.v1alpha1.ListUserOrganizationsRequest\\x1a:.buf.alpha.registry.v1alpha1.ListUserOrganizationsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8d\\x01\\n\" +\n\t\"\\x13GetUserOrganization\\x127.buf.alpha.registry.v1alpha1.GetUserOrganizationRequest\\x1a8.buf.alpha.registry.v1alpha1.GetUserOrganizationResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8a\\x01\\n\" +\n\t\"\\x12CreateOrganization\\x126.buf.alpha.registry.v1alpha1.CreateOrganizationRequest\\x1a7.buf.alpha.registry.v1alpha1.CreateOrganizationResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x8a\\x01\\n\" +\n\t\"\\x12DeleteOrganization\\x126.buf.alpha.registry.v1alpha1.DeleteOrganizationRequest\\x1a7.buf.alpha.registry.v1alpha1.DeleteOrganizationResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x9c\\x01\\n\" +\n\t\"\\x18DeleteOrganizationByName\\x12<.buf.alpha.registry.v1alpha1.DeleteOrganizationByNameRequest\\x1a=.buf.alpha.registry.v1alpha1.DeleteOrganizationByNameResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x93\\x01\\n\" +\n\t\"\\x15AddOrganizationMember\\x129.buf.alpha.registry.v1alpha1.AddOrganizationMemberRequest\\x1a:.buf.alpha.registry.v1alpha1.AddOrganizationMemberResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x97\\x01\\n\" +\n\t\"\\x18UpdateOrganizationMember\\x12<.buf.alpha.registry.v1alpha1.UpdateOrganizationMemberRequest\\x1a=.buf.alpha.registry.v1alpha1.UpdateOrganizationMemberResponse\\x12\\x9c\\x01\\n\" +\n\t\"\\x18RemoveOrganizationMember\\x12<.buf.alpha.registry.v1alpha1.RemoveOrganizationMemberRequest\\x1a=.buf.alpha.registry.v1alpha1.RemoveOrganizationMemberResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x99\\x01\\n\" +\n\t\"\\x17GetOrganizationSettings\\x12;.buf.alpha.registry.v1alpha1.GetOrganizationSettingsRequest\\x1a<.buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x9d\\x01\\n\" +\n\t\"\\x1aUpdateOrganizationSettings\\x12>.buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest\\x1a?.buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsResponse\\x12\\x90\\x01\\n\" +\n\t\"\\x14AddOrganizationGroup\\x128.buf.alpha.registry.v1alpha1.AddOrganizationGroupRequest\\x1a9.buf.alpha.registry.v1alpha1.AddOrganizationGroupResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x99\\x01\\n\" +\n\t\"\\x17UpdateOrganizationGroup\\x12;.buf.alpha.registry.v1alpha1.UpdateOrganizationGroupRequest\\x1a<.buf.alpha.registry.v1alpha1.UpdateOrganizationGroupResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x99\\x01\\n\" +\n\t\"\\x17RemoveOrganizationGroup\\x12;.buf.alpha.registry.v1alpha1.RemoveOrganizationGroupRequest\\x1a<.buf.alpha.registry.v1alpha1.RemoveOrganizationGroupResponse\\\"\\x03\\x90\\x02\\x02B\\x9e\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x11OrganizationProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 35)\nvar file_buf_alpha_registry_v1alpha1_organization_proto_goTypes = []any{\n\t(*Organization)(nil),                             // 0: buf.alpha.registry.v1alpha1.Organization\n\t(*OrganizationMembership)(nil),                   // 1: buf.alpha.registry.v1alpha1.OrganizationMembership\n\t(*GetOrganizationRequest)(nil),                   // 2: buf.alpha.registry.v1alpha1.GetOrganizationRequest\n\t(*GetOrganizationResponse)(nil),                  // 3: buf.alpha.registry.v1alpha1.GetOrganizationResponse\n\t(*GetOrganizationByNameRequest)(nil),             // 4: buf.alpha.registry.v1alpha1.GetOrganizationByNameRequest\n\t(*GetOrganizationByNameResponse)(nil),            // 5: buf.alpha.registry.v1alpha1.GetOrganizationByNameResponse\n\t(*ListOrganizationsRequest)(nil),                 // 6: buf.alpha.registry.v1alpha1.ListOrganizationsRequest\n\t(*ListOrganizationsResponse)(nil),                // 7: buf.alpha.registry.v1alpha1.ListOrganizationsResponse\n\t(*ListUserOrganizationsRequest)(nil),             // 8: buf.alpha.registry.v1alpha1.ListUserOrganizationsRequest\n\t(*ListUserOrganizationsResponse)(nil),            // 9: buf.alpha.registry.v1alpha1.ListUserOrganizationsResponse\n\t(*GetUserOrganizationRequest)(nil),               // 10: buf.alpha.registry.v1alpha1.GetUserOrganizationRequest\n\t(*GetUserOrganizationResponse)(nil),              // 11: buf.alpha.registry.v1alpha1.GetUserOrganizationResponse\n\t(*CreateOrganizationRequest)(nil),                // 12: buf.alpha.registry.v1alpha1.CreateOrganizationRequest\n\t(*CreateOrganizationResponse)(nil),               // 13: buf.alpha.registry.v1alpha1.CreateOrganizationResponse\n\t(*DeleteOrganizationRequest)(nil),                // 14: buf.alpha.registry.v1alpha1.DeleteOrganizationRequest\n\t(*DeleteOrganizationResponse)(nil),               // 15: buf.alpha.registry.v1alpha1.DeleteOrganizationResponse\n\t(*DeleteOrganizationByNameRequest)(nil),          // 16: buf.alpha.registry.v1alpha1.DeleteOrganizationByNameRequest\n\t(*DeleteOrganizationByNameResponse)(nil),         // 17: buf.alpha.registry.v1alpha1.DeleteOrganizationByNameResponse\n\t(*AddOrganizationMemberRequest)(nil),             // 18: buf.alpha.registry.v1alpha1.AddOrganizationMemberRequest\n\t(*AddOrganizationMemberResponse)(nil),            // 19: buf.alpha.registry.v1alpha1.AddOrganizationMemberResponse\n\t(*UpdateOrganizationMemberRequest)(nil),          // 20: buf.alpha.registry.v1alpha1.UpdateOrganizationMemberRequest\n\t(*UpdateOrganizationMemberResponse)(nil),         // 21: buf.alpha.registry.v1alpha1.UpdateOrganizationMemberResponse\n\t(*RemoveOrganizationMemberRequest)(nil),          // 22: buf.alpha.registry.v1alpha1.RemoveOrganizationMemberRequest\n\t(*RemoveOrganizationMemberResponse)(nil),         // 23: buf.alpha.registry.v1alpha1.RemoveOrganizationMemberResponse\n\t(*GetOrganizationSettingsRequest)(nil),           // 24: buf.alpha.registry.v1alpha1.GetOrganizationSettingsRequest\n\t(*GetOrganizationSettingsResponse)(nil),          // 25: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse\n\t(*UpdateOrganizationSettingsRequest)(nil),        // 26: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest\n\t(*UpdateOrganizationSettingsResponse)(nil),       // 27: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsResponse\n\t(*AddOrganizationGroupRequest)(nil),              // 28: buf.alpha.registry.v1alpha1.AddOrganizationGroupRequest\n\t(*AddOrganizationGroupResponse)(nil),             // 29: buf.alpha.registry.v1alpha1.AddOrganizationGroupResponse\n\t(*UpdateOrganizationGroupRequest)(nil),           // 30: buf.alpha.registry.v1alpha1.UpdateOrganizationGroupRequest\n\t(*UpdateOrganizationGroupResponse)(nil),          // 31: buf.alpha.registry.v1alpha1.UpdateOrganizationGroupResponse\n\t(*RemoveOrganizationGroupRequest)(nil),           // 32: buf.alpha.registry.v1alpha1.RemoveOrganizationGroupRequest\n\t(*RemoveOrganizationGroupResponse)(nil),          // 33: buf.alpha.registry.v1alpha1.RemoveOrganizationGroupResponse\n\t(*GetOrganizationSettingsResponse_IdPGroup)(nil), // 34: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.IdPGroup\n\t(*timestamppb.Timestamp)(nil),                    // 35: google.protobuf.Timestamp\n\t(VerificationStatus)(0),                          // 36: buf.alpha.registry.v1alpha1.VerificationStatus\n\t(OrganizationRole)(0),                            // 37: buf.alpha.registry.v1alpha1.OrganizationRole\n\t(RepositoryRole)(0),                              // 38: buf.alpha.registry.v1alpha1.RepositoryRole\n}\nvar file_buf_alpha_registry_v1alpha1_organization_proto_depIdxs = []int32{\n\t35, // 0: buf.alpha.registry.v1alpha1.Organization.create_time:type_name -> google.protobuf.Timestamp\n\t35, // 1: buf.alpha.registry.v1alpha1.Organization.update_time:type_name -> google.protobuf.Timestamp\n\t36, // 2: buf.alpha.registry.v1alpha1.Organization.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus\n\t0,  // 3: buf.alpha.registry.v1alpha1.OrganizationMembership.organization:type_name -> buf.alpha.registry.v1alpha1.Organization\n\t37, // 4: buf.alpha.registry.v1alpha1.OrganizationMembership.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t0,  // 5: buf.alpha.registry.v1alpha1.GetOrganizationResponse.organization:type_name -> buf.alpha.registry.v1alpha1.Organization\n\t0,  // 6: buf.alpha.registry.v1alpha1.GetOrganizationByNameResponse.organization:type_name -> buf.alpha.registry.v1alpha1.Organization\n\t0,  // 7: buf.alpha.registry.v1alpha1.ListOrganizationsResponse.organizations:type_name -> buf.alpha.registry.v1alpha1.Organization\n\t1,  // 8: buf.alpha.registry.v1alpha1.ListUserOrganizationsResponse.organizations:type_name -> buf.alpha.registry.v1alpha1.OrganizationMembership\n\t1,  // 9: buf.alpha.registry.v1alpha1.GetUserOrganizationResponse.organization_membership:type_name -> buf.alpha.registry.v1alpha1.OrganizationMembership\n\t0,  // 10: buf.alpha.registry.v1alpha1.CreateOrganizationResponse.organization:type_name -> buf.alpha.registry.v1alpha1.Organization\n\t37, // 11: buf.alpha.registry.v1alpha1.AddOrganizationMemberRequest.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t37, // 12: buf.alpha.registry.v1alpha1.UpdateOrganizationMemberRequest.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t38, // 13: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.repository_base_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t34, // 14: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.idp_groups:type_name -> buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.IdPGroup\n\t38, // 15: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest.repository_base_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t37, // 16: buf.alpha.registry.v1alpha1.AddOrganizationGroupRequest.role_override:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t37, // 17: buf.alpha.registry.v1alpha1.UpdateOrganizationGroupRequest.role_override:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t37, // 18: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.IdPGroup.role_override:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t2,  // 19: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganization:input_type -> buf.alpha.registry.v1alpha1.GetOrganizationRequest\n\t4,  // 20: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationByName:input_type -> buf.alpha.registry.v1alpha1.GetOrganizationByNameRequest\n\t6,  // 21: buf.alpha.registry.v1alpha1.OrganizationService.ListOrganizations:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationsRequest\n\t8,  // 22: buf.alpha.registry.v1alpha1.OrganizationService.ListUserOrganizations:input_type -> buf.alpha.registry.v1alpha1.ListUserOrganizationsRequest\n\t10, // 23: buf.alpha.registry.v1alpha1.OrganizationService.GetUserOrganization:input_type -> buf.alpha.registry.v1alpha1.GetUserOrganizationRequest\n\t12, // 24: buf.alpha.registry.v1alpha1.OrganizationService.CreateOrganization:input_type -> buf.alpha.registry.v1alpha1.CreateOrganizationRequest\n\t14, // 25: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganization:input_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationRequest\n\t16, // 26: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganizationByName:input_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationByNameRequest\n\t18, // 27: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.AddOrganizationMemberRequest\n\t20, // 28: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationMemberRequest\n\t22, // 29: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationMemberRequest\n\t24, // 30: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationSettings:input_type -> buf.alpha.registry.v1alpha1.GetOrganizationSettingsRequest\n\t26, // 31: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationSettings:input_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest\n\t28, // 32: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationGroup:input_type -> buf.alpha.registry.v1alpha1.AddOrganizationGroupRequest\n\t30, // 33: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationGroup:input_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationGroupRequest\n\t32, // 34: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationGroup:input_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationGroupRequest\n\t3,  // 35: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganization:output_type -> buf.alpha.registry.v1alpha1.GetOrganizationResponse\n\t5,  // 36: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationByName:output_type -> buf.alpha.registry.v1alpha1.GetOrganizationByNameResponse\n\t7,  // 37: buf.alpha.registry.v1alpha1.OrganizationService.ListOrganizations:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationsResponse\n\t9,  // 38: buf.alpha.registry.v1alpha1.OrganizationService.ListUserOrganizations:output_type -> buf.alpha.registry.v1alpha1.ListUserOrganizationsResponse\n\t11, // 39: buf.alpha.registry.v1alpha1.OrganizationService.GetUserOrganization:output_type -> buf.alpha.registry.v1alpha1.GetUserOrganizationResponse\n\t13, // 40: buf.alpha.registry.v1alpha1.OrganizationService.CreateOrganization:output_type -> buf.alpha.registry.v1alpha1.CreateOrganizationResponse\n\t15, // 41: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganization:output_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationResponse\n\t17, // 42: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganizationByName:output_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationByNameResponse\n\t19, // 43: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.AddOrganizationMemberResponse\n\t21, // 44: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationMemberResponse\n\t23, // 45: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationMemberResponse\n\t25, // 46: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationSettings:output_type -> buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse\n\t27, // 47: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationSettings:output_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsResponse\n\t29, // 48: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationGroup:output_type -> buf.alpha.registry.v1alpha1.AddOrganizationGroupResponse\n\t31, // 49: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationGroup:output_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationGroupResponse\n\t33, // 50: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationGroup:output_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationGroupResponse\n\t35, // [35:51] is the sub-list for method output_type\n\t19, // [19:35] is the sub-list for method input_type\n\t19, // [19:19] is the sub-list for extension type_name\n\t19, // [19:19] is the sub-list for extension extendee\n\t0,  // [0:19] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_organization_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_organization_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_organization_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_role_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_verification_status_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[26].OneofWrappers = []any{}\n\tfile_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[30].OneofWrappers = []any{}\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_buf_alpha_registry_v1alpha1_organization_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_organization_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   35,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_organization_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_organization_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_organization_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_organization_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_organization_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/owner.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/owner.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 Owner struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner isOwner_Owner          `protobuf_oneof:\"owner\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *Owner) Reset() {\n\t*x = Owner{}\n\tmi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Owner) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Owner) ProtoMessage() {}\n\nfunc (x *Owner) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_owner_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\nfunc (x *Owner) GetUser() *User {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Owner.(*owner_User); ok {\n\t\t\treturn x.User\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Owner) GetOrganization() *Organization {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Owner.(*owner_Organization); ok {\n\t\t\treturn x.Organization\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Owner) SetUser(v *User) {\n\tif v == nil {\n\t\tx.xxx_hidden_Owner = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Owner = &owner_User{v}\n}\n\nfunc (x *Owner) SetOrganization(v *Organization) {\n\tif v == nil {\n\t\tx.xxx_hidden_Owner = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Owner = &owner_Organization{v}\n}\n\nfunc (x *Owner) HasOwner() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Owner != nil\n}\n\nfunc (x *Owner) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Owner.(*owner_User)\n\treturn ok\n}\n\nfunc (x *Owner) HasOrganization() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Owner.(*owner_Organization)\n\treturn ok\n}\n\nfunc (x *Owner) ClearOwner() {\n\tx.xxx_hidden_Owner = nil\n}\n\nfunc (x *Owner) ClearUser() {\n\tif _, ok := x.xxx_hidden_Owner.(*owner_User); ok {\n\t\tx.xxx_hidden_Owner = nil\n\t}\n}\n\nfunc (x *Owner) ClearOrganization() {\n\tif _, ok := x.xxx_hidden_Owner.(*owner_Organization); ok {\n\t\tx.xxx_hidden_Owner = nil\n\t}\n}\n\nconst Owner_Owner_not_set_case case_Owner_Owner = 0\nconst Owner_User_case case_Owner_Owner = 1\nconst Owner_Organization_case case_Owner_Owner = 2\n\nfunc (x *Owner) WhichOwner() case_Owner_Owner {\n\tif x == nil {\n\t\treturn Owner_Owner_not_set_case\n\t}\n\tswitch x.xxx_hidden_Owner.(type) {\n\tcase *owner_User:\n\t\treturn Owner_User_case\n\tcase *owner_Organization:\n\t\treturn Owner_Organization_case\n\tdefault:\n\t\treturn Owner_Owner_not_set_case\n\t}\n}\n\ntype Owner_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Owner:\n\t// The requested owner is a `User`.\n\tUser *User\n\t// The requested owner is a `Organization`.\n\tOrganization *Organization\n\t// -- end of xxx_hidden_Owner\n}\n\nfunc (b0 Owner_builder) Build() *Owner {\n\tm0 := &Owner{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.User != nil {\n\t\tx.xxx_hidden_Owner = &owner_User{b.User}\n\t}\n\tif b.Organization != nil {\n\t\tx.xxx_hidden_Owner = &owner_Organization{b.Organization}\n\t}\n\treturn m0\n}\n\ntype case_Owner_Owner protoreflect.FieldNumber\n\nfunc (x case_Owner_Owner) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isOwner_Owner interface {\n\tisOwner_Owner()\n}\n\ntype owner_User struct {\n\t// The requested owner is a `User`.\n\tUser *User `protobuf:\"bytes,1,opt,name=user,proto3,oneof\"`\n}\n\ntype owner_Organization struct {\n\t// The requested owner is a `Organization`.\n\tOrganization *Organization `protobuf:\"bytes,2,opt,name=organization,proto3,oneof\"`\n}\n\nfunc (*owner_User) isOwner_Owner() {}\n\nfunc (*owner_Organization) isOwner_Owner() {}\n\ntype GetOwnerByNameRequest struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *GetOwnerByNameRequest) Reset() {\n\t*x = GetOwnerByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOwnerByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOwnerByNameRequest) ProtoMessage() {}\n\nfunc (x *GetOwnerByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_owner_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\nfunc (x *GetOwnerByNameRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetOwnerByNameRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype GetOwnerByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Name of the requested owner.\n\tName string\n}\n\nfunc (b0 GetOwnerByNameRequest_builder) Build() *GetOwnerByNameRequest {\n\tm0 := &GetOwnerByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype GetOwnerByNameResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner *Owner                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *GetOwnerByNameResponse) Reset() {\n\t*x = GetOwnerByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetOwnerByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetOwnerByNameResponse) ProtoMessage() {}\n\nfunc (x *GetOwnerByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_owner_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\nfunc (x *GetOwnerByNameResponse) GetOwner() *Owner {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn nil\n}\n\nfunc (x *GetOwnerByNameResponse) SetOwner(v *Owner) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetOwnerByNameResponse) HasOwner() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Owner != nil\n}\n\nfunc (x *GetOwnerByNameResponse) ClearOwner() {\n\tx.xxx_hidden_Owner = nil\n}\n\ntype GetOwnerByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner *Owner\n}\n\nfunc (b0 GetOwnerByNameResponse_builder) Build() *GetOwnerByNameResponse {\n\tm0 := &GetOwnerByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_owner_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"'buf/alpha/registry/v1alpha1/owner.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a.buf/alpha/registry/v1alpha1/organization.proto\\x1a&buf/alpha/registry/v1alpha1/user.proto\\\"\\x9a\\x01\\n\" +\n\t\"\\x05Owner\\x127\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserH\\x00R\\x04user\\x12O\\n\" +\n\t\"\\forganization\\x18\\x02 \\x01(\\v2).buf.alpha.registry.v1alpha1.OrganizationH\\x00R\\forganizationB\\a\\n\" +\n\t\"\\x05owner\\\"+\\n\" +\n\t\"\\x15GetOwnerByNameRequest\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\\"R\\n\" +\n\t\"\\x16GetOwnerByNameResponse\\x128\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\v2\\\".buf.alpha.registry.v1alpha1.OwnerR\\x05owner2\\x8e\\x01\\n\" +\n\t\"\\fOwnerService\\x12~\\n\" +\n\t\"\\x0eGetOwnerByName\\x122.buf.alpha.registry.v1alpha1.GetOwnerByNameRequest\\x1a3.buf.alpha.registry.v1alpha1.GetOwnerByNameResponse\\\"\\x03\\x90\\x02\\x01B\\x97\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\n\" +\n\t\"OwnerProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes = make([]protoimpl.MessageInfo, 3)\nvar file_buf_alpha_registry_v1alpha1_owner_proto_goTypes = []any{\n\t(*Owner)(nil),                  // 0: buf.alpha.registry.v1alpha1.Owner\n\t(*GetOwnerByNameRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.GetOwnerByNameRequest\n\t(*GetOwnerByNameResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetOwnerByNameResponse\n\t(*User)(nil),                   // 3: buf.alpha.registry.v1alpha1.User\n\t(*Organization)(nil),           // 4: buf.alpha.registry.v1alpha1.Organization\n}\nvar file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs = []int32{\n\t3, // 0: buf.alpha.registry.v1alpha1.Owner.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t4, // 1: buf.alpha.registry.v1alpha1.Owner.organization:type_name -> buf.alpha.registry.v1alpha1.Organization\n\t0, // 2: buf.alpha.registry.v1alpha1.GetOwnerByNameResponse.owner:type_name -> buf.alpha.registry.v1alpha1.Owner\n\t1, // 3: buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName:input_type -> buf.alpha.registry.v1alpha1.GetOwnerByNameRequest\n\t2, // 4: buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName:output_type -> buf.alpha.registry.v1alpha1.GetOwnerByNameResponse\n\t4, // [4:5] is the sub-list for method output_type\n\t3, // [3:4] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_owner_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_owner_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_owner_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_organization_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_user_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0].OneofWrappers = []any{\n\t\t(*owner_User)(nil),\n\t\t(*owner_Organization)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   3,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_owner_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_owner_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_owner_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_owner_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/plugin_curation.proto\n\npackage registryv1alpha1\n\nimport (\n\tv1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\tpluginpb \"google.golang.org/protobuf/types/pluginpb\"\n\treflect \"reflect\"\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\n// CuratedPluginVisibility defines the visibility options available\n// for Curated Plugins.\ntype CuratedPluginVisibility int32\n\nconst (\n\tCuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_UNSPECIFIED CuratedPluginVisibility = 0\n\tCuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PUBLIC      CuratedPluginVisibility = 1\n\tCuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PRIVATE     CuratedPluginVisibility = 2\n)\n\n// Enum value maps for CuratedPluginVisibility.\nvar (\n\tCuratedPluginVisibility_name = map[int32]string{\n\t\t0: \"CURATED_PLUGIN_VISIBILITY_UNSPECIFIED\",\n\t\t1: \"CURATED_PLUGIN_VISIBILITY_PUBLIC\",\n\t\t2: \"CURATED_PLUGIN_VISIBILITY_PRIVATE\",\n\t}\n\tCuratedPluginVisibility_value = map[string]int32{\n\t\t\"CURATED_PLUGIN_VISIBILITY_UNSPECIFIED\": 0,\n\t\t\"CURATED_PLUGIN_VISIBILITY_PUBLIC\":      1,\n\t\t\"CURATED_PLUGIN_VISIBILITY_PRIVATE\":     2,\n\t}\n)\n\nfunc (x CuratedPluginVisibility) Enum() *CuratedPluginVisibility {\n\tp := new(CuratedPluginVisibility)\n\t*p = x\n\treturn p\n}\n\nfunc (x CuratedPluginVisibility) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (CuratedPluginVisibility) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[0].Descriptor()\n}\n\nfunc (CuratedPluginVisibility) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[0]\n}\n\nfunc (x CuratedPluginVisibility) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// The supported plugin registries for curated plugins.\ntype PluginRegistryType int32\n\nconst (\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED PluginRegistryType = 0\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_GO          PluginRegistryType = 1\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_NPM         PluginRegistryType = 2\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_MAVEN       PluginRegistryType = 3\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_SWIFT       PluginRegistryType = 4\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_PYTHON      PluginRegistryType = 5\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_CARGO       PluginRegistryType = 7\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_NUGET       PluginRegistryType = 8\n\tPluginRegistryType_PLUGIN_REGISTRY_TYPE_CMAKE       PluginRegistryType = 9\n)\n\n// Enum value maps for PluginRegistryType.\nvar (\n\tPluginRegistryType_name = map[int32]string{\n\t\t0: \"PLUGIN_REGISTRY_TYPE_UNSPECIFIED\",\n\t\t1: \"PLUGIN_REGISTRY_TYPE_GO\",\n\t\t2: \"PLUGIN_REGISTRY_TYPE_NPM\",\n\t\t3: \"PLUGIN_REGISTRY_TYPE_MAVEN\",\n\t\t4: \"PLUGIN_REGISTRY_TYPE_SWIFT\",\n\t\t5: \"PLUGIN_REGISTRY_TYPE_PYTHON\",\n\t\t7: \"PLUGIN_REGISTRY_TYPE_CARGO\",\n\t\t8: \"PLUGIN_REGISTRY_TYPE_NUGET\",\n\t\t9: \"PLUGIN_REGISTRY_TYPE_CMAKE\",\n\t}\n\tPluginRegistryType_value = map[string]int32{\n\t\t\"PLUGIN_REGISTRY_TYPE_UNSPECIFIED\": 0,\n\t\t\"PLUGIN_REGISTRY_TYPE_GO\":          1,\n\t\t\"PLUGIN_REGISTRY_TYPE_NPM\":         2,\n\t\t\"PLUGIN_REGISTRY_TYPE_MAVEN\":       3,\n\t\t\"PLUGIN_REGISTRY_TYPE_SWIFT\":       4,\n\t\t\"PLUGIN_REGISTRY_TYPE_PYTHON\":      5,\n\t\t\"PLUGIN_REGISTRY_TYPE_CARGO\":       7,\n\t\t\"PLUGIN_REGISTRY_TYPE_NUGET\":       8,\n\t\t\"PLUGIN_REGISTRY_TYPE_CMAKE\":       9,\n\t}\n)\n\nfunc (x PluginRegistryType) Enum() *PluginRegistryType {\n\tp := new(PluginRegistryType)\n\t*p = x\n\treturn p\n}\n\nfunc (x PluginRegistryType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (PluginRegistryType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[1].Descriptor()\n}\n\nfunc (PluginRegistryType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[1]\n}\n\nfunc (x PluginRegistryType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// PluginLanguage is used to specify the output languages a plugin supports.\ntype PluginLanguage int32\n\nconst (\n\tPluginLanguage_PLUGIN_LANGUAGE_UNSPECIFIED PluginLanguage = 0\n\tPluginLanguage_PLUGIN_LANGUAGE_GO          PluginLanguage = 1\n\tPluginLanguage_PLUGIN_LANGUAGE_JAVASCRIPT  PluginLanguage = 2\n\tPluginLanguage_PLUGIN_LANGUAGE_TYPESCRIPT  PluginLanguage = 3\n\tPluginLanguage_PLUGIN_LANGUAGE_SWIFT       PluginLanguage = 4\n\tPluginLanguage_PLUGIN_LANGUAGE_CPP         PluginLanguage = 5\n\tPluginLanguage_PLUGIN_LANGUAGE_JAVA        PluginLanguage = 6\n\tPluginLanguage_PLUGIN_LANGUAGE_DART        PluginLanguage = 7\n\tPluginLanguage_PLUGIN_LANGUAGE_RUST        PluginLanguage = 8\n\tPluginLanguage_PLUGIN_LANGUAGE_PYTHON      PluginLanguage = 9\n\tPluginLanguage_PLUGIN_LANGUAGE_RUBY        PluginLanguage = 10\n\tPluginLanguage_PLUGIN_LANGUAGE_KOTLIN      PluginLanguage = 11\n\tPluginLanguage_PLUGIN_LANGUAGE_OBJECTIVE_C PluginLanguage = 12\n\tPluginLanguage_PLUGIN_LANGUAGE_PHP         PluginLanguage = 13\n\tPluginLanguage_PLUGIN_LANGUAGE_CSHARP      PluginLanguage = 14\n\tPluginLanguage_PLUGIN_LANGUAGE_SCALA       PluginLanguage = 15\n\tPluginLanguage_PLUGIN_LANGUAGE_C           PluginLanguage = 16\n)\n\n// Enum value maps for PluginLanguage.\nvar (\n\tPluginLanguage_name = map[int32]string{\n\t\t0:  \"PLUGIN_LANGUAGE_UNSPECIFIED\",\n\t\t1:  \"PLUGIN_LANGUAGE_GO\",\n\t\t2:  \"PLUGIN_LANGUAGE_JAVASCRIPT\",\n\t\t3:  \"PLUGIN_LANGUAGE_TYPESCRIPT\",\n\t\t4:  \"PLUGIN_LANGUAGE_SWIFT\",\n\t\t5:  \"PLUGIN_LANGUAGE_CPP\",\n\t\t6:  \"PLUGIN_LANGUAGE_JAVA\",\n\t\t7:  \"PLUGIN_LANGUAGE_DART\",\n\t\t8:  \"PLUGIN_LANGUAGE_RUST\",\n\t\t9:  \"PLUGIN_LANGUAGE_PYTHON\",\n\t\t10: \"PLUGIN_LANGUAGE_RUBY\",\n\t\t11: \"PLUGIN_LANGUAGE_KOTLIN\",\n\t\t12: \"PLUGIN_LANGUAGE_OBJECTIVE_C\",\n\t\t13: \"PLUGIN_LANGUAGE_PHP\",\n\t\t14: \"PLUGIN_LANGUAGE_CSHARP\",\n\t\t15: \"PLUGIN_LANGUAGE_SCALA\",\n\t\t16: \"PLUGIN_LANGUAGE_C\",\n\t}\n\tPluginLanguage_value = map[string]int32{\n\t\t\"PLUGIN_LANGUAGE_UNSPECIFIED\": 0,\n\t\t\"PLUGIN_LANGUAGE_GO\":          1,\n\t\t\"PLUGIN_LANGUAGE_JAVASCRIPT\":  2,\n\t\t\"PLUGIN_LANGUAGE_TYPESCRIPT\":  3,\n\t\t\"PLUGIN_LANGUAGE_SWIFT\":       4,\n\t\t\"PLUGIN_LANGUAGE_CPP\":         5,\n\t\t\"PLUGIN_LANGUAGE_JAVA\":        6,\n\t\t\"PLUGIN_LANGUAGE_DART\":        7,\n\t\t\"PLUGIN_LANGUAGE_RUST\":        8,\n\t\t\"PLUGIN_LANGUAGE_PYTHON\":      9,\n\t\t\"PLUGIN_LANGUAGE_RUBY\":        10,\n\t\t\"PLUGIN_LANGUAGE_KOTLIN\":      11,\n\t\t\"PLUGIN_LANGUAGE_OBJECTIVE_C\": 12,\n\t\t\"PLUGIN_LANGUAGE_PHP\":         13,\n\t\t\"PLUGIN_LANGUAGE_CSHARP\":      14,\n\t\t\"PLUGIN_LANGUAGE_SCALA\":       15,\n\t\t\"PLUGIN_LANGUAGE_C\":           16,\n\t}\n)\n\nfunc (x PluginLanguage) Enum() *PluginLanguage {\n\tp := new(PluginLanguage)\n\t*p = x\n\treturn p\n}\n\nfunc (x PluginLanguage) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (PluginLanguage) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[2].Descriptor()\n}\n\nfunc (PluginLanguage) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[2]\n}\n\nfunc (x PluginLanguage) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// NPMImportStyle is used to specify the import style the plugin supports.\ntype NPMImportStyle int32\n\nconst (\n\tNPMImportStyle_NPM_IMPORT_STYLE_UNSPECIFIED NPMImportStyle = 0\n\tNPMImportStyle_NPM_IMPORT_STYLE_MODULE      NPMImportStyle = 1\n\tNPMImportStyle_NPM_IMPORT_STYLE_COMMONJS    NPMImportStyle = 2\n)\n\n// Enum value maps for NPMImportStyle.\nvar (\n\tNPMImportStyle_name = map[int32]string{\n\t\t0: \"NPM_IMPORT_STYLE_UNSPECIFIED\",\n\t\t1: \"NPM_IMPORT_STYLE_MODULE\",\n\t\t2: \"NPM_IMPORT_STYLE_COMMONJS\",\n\t}\n\tNPMImportStyle_value = map[string]int32{\n\t\t\"NPM_IMPORT_STYLE_UNSPECIFIED\": 0,\n\t\t\"NPM_IMPORT_STYLE_MODULE\":      1,\n\t\t\"NPM_IMPORT_STYLE_COMMONJS\":    2,\n\t}\n)\n\nfunc (x NPMImportStyle) Enum() *NPMImportStyle {\n\tp := new(NPMImportStyle)\n\t*p = x\n\treturn p\n}\n\nfunc (x NPMImportStyle) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (NPMImportStyle) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[3].Descriptor()\n}\n\nfunc (NPMImportStyle) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[3]\n}\n\nfunc (x NPMImportStyle) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// SwiftPlatformType is used to specify the platform type for a Swift plugins minimum compatible version.\ntype SwiftPlatformType int32\n\nconst (\n\tSwiftPlatformType_SWIFT_PLATFORM_TYPE_UNSPECIFIED SwiftPlatformType = 0\n\tSwiftPlatformType_SWIFT_PLATFORM_TYPE_MACOS       SwiftPlatformType = 1\n\tSwiftPlatformType_SWIFT_PLATFORM_TYPE_IOS         SwiftPlatformType = 2\n\tSwiftPlatformType_SWIFT_PLATFORM_TYPE_WATCHOS     SwiftPlatformType = 3\n\tSwiftPlatformType_SWIFT_PLATFORM_TYPE_TVOS        SwiftPlatformType = 4\n)\n\n// Enum value maps for SwiftPlatformType.\nvar (\n\tSwiftPlatformType_name = map[int32]string{\n\t\t0: \"SWIFT_PLATFORM_TYPE_UNSPECIFIED\",\n\t\t1: \"SWIFT_PLATFORM_TYPE_MACOS\",\n\t\t2: \"SWIFT_PLATFORM_TYPE_IOS\",\n\t\t3: \"SWIFT_PLATFORM_TYPE_WATCHOS\",\n\t\t4: \"SWIFT_PLATFORM_TYPE_TVOS\",\n\t}\n\tSwiftPlatformType_value = map[string]int32{\n\t\t\"SWIFT_PLATFORM_TYPE_UNSPECIFIED\": 0,\n\t\t\"SWIFT_PLATFORM_TYPE_MACOS\":       1,\n\t\t\"SWIFT_PLATFORM_TYPE_IOS\":         2,\n\t\t\"SWIFT_PLATFORM_TYPE_WATCHOS\":     3,\n\t\t\"SWIFT_PLATFORM_TYPE_TVOS\":        4,\n\t}\n)\n\nfunc (x SwiftPlatformType) Enum() *SwiftPlatformType {\n\tp := new(SwiftPlatformType)\n\t*p = x\n\treturn p\n}\n\nfunc (x SwiftPlatformType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (SwiftPlatformType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[4].Descriptor()\n}\n\nfunc (SwiftPlatformType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[4]\n}\n\nfunc (x SwiftPlatformType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// PythonPackageType is used to specify the package type for a Python Generated SDK.\ntype PythonPackageType int32\n\nconst (\n\tPythonPackageType_PYTHON_PACKAGE_TYPE_UNSPECIFIED PythonPackageType = 0\n\t// Regular Python package, containing Python runtime code (`.py` files).\n\tPythonPackageType_PYTHON_PACKAGE_TYPE_RUNTIME PythonPackageType = 1\n\t// Stub-only package, containing only `.pyi` files.\n\t// Ref: https://peps.python.org/pep-0561/#stub-only-packages\n\tPythonPackageType_PYTHON_PACKAGE_TYPE_STUB_ONLY PythonPackageType = 2\n)\n\n// Enum value maps for PythonPackageType.\nvar (\n\tPythonPackageType_name = map[int32]string{\n\t\t0: \"PYTHON_PACKAGE_TYPE_UNSPECIFIED\",\n\t\t1: \"PYTHON_PACKAGE_TYPE_RUNTIME\",\n\t\t2: \"PYTHON_PACKAGE_TYPE_STUB_ONLY\",\n\t}\n\tPythonPackageType_value = map[string]int32{\n\t\t\"PYTHON_PACKAGE_TYPE_UNSPECIFIED\": 0,\n\t\t\"PYTHON_PACKAGE_TYPE_RUNTIME\":     1,\n\t\t\"PYTHON_PACKAGE_TYPE_STUB_ONLY\":   2,\n\t}\n)\n\nfunc (x PythonPackageType) Enum() *PythonPackageType {\n\tp := new(PythonPackageType)\n\t*p = x\n\treturn p\n}\n\nfunc (x PythonPackageType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (PythonPackageType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[5].Descriptor()\n}\n\nfunc (PythonPackageType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[5]\n}\n\nfunc (x PythonPackageType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// DotnetTargetFramework specifies the target framework for dotnet plugins.\n// This is not meant to be an exhaustive list - most plugins should target a\n// netstandard version.\n// Reference: https://learn.microsoft.com/en-us/dotnet/standard/frameworks\ntype DotnetTargetFramework int32\n\nconst (\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_UNSPECIFIED     DotnetTargetFramework = 0\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_0 DotnetTargetFramework = 1\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_1 DotnetTargetFramework = 2\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_2 DotnetTargetFramework = 3\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_3 DotnetTargetFramework = 4\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_4 DotnetTargetFramework = 5\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_5 DotnetTargetFramework = 6\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_6 DotnetTargetFramework = 7\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_0 DotnetTargetFramework = 8\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_1 DotnetTargetFramework = 9\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_5_0         DotnetTargetFramework = 10\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_6_0         DotnetTargetFramework = 11\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_7_0         DotnetTargetFramework = 12\n\tDotnetTargetFramework_DOTNET_TARGET_FRAMEWORK_NET_8_0         DotnetTargetFramework = 13\n)\n\n// Enum value maps for DotnetTargetFramework.\nvar (\n\tDotnetTargetFramework_name = map[int32]string{\n\t\t0:  \"DOTNET_TARGET_FRAMEWORK_UNSPECIFIED\",\n\t\t1:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_0\",\n\t\t2:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_1\",\n\t\t3:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_2\",\n\t\t4:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_3\",\n\t\t5:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_4\",\n\t\t6:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_5\",\n\t\t7:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_6\",\n\t\t8:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_0\",\n\t\t9:  \"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_1\",\n\t\t10: \"DOTNET_TARGET_FRAMEWORK_NET_5_0\",\n\t\t11: \"DOTNET_TARGET_FRAMEWORK_NET_6_0\",\n\t\t12: \"DOTNET_TARGET_FRAMEWORK_NET_7_0\",\n\t\t13: \"DOTNET_TARGET_FRAMEWORK_NET_8_0\",\n\t}\n\tDotnetTargetFramework_value = map[string]int32{\n\t\t\"DOTNET_TARGET_FRAMEWORK_UNSPECIFIED\":     0,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_0\": 1,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_1\": 2,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_2\": 3,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_3\": 4,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_4\": 5,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_5\": 6,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_6\": 7,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_0\": 8,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_1\": 9,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NET_5_0\":         10,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NET_6_0\":         11,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NET_7_0\":         12,\n\t\t\"DOTNET_TARGET_FRAMEWORK_NET_8_0\":         13,\n\t}\n)\n\nfunc (x DotnetTargetFramework) Enum() *DotnetTargetFramework {\n\tp := new(DotnetTargetFramework)\n\t*p = x\n\treturn p\n}\n\nfunc (x DotnetTargetFramework) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (DotnetTargetFramework) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[6].Descriptor()\n}\n\nfunc (DotnetTargetFramework) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[6]\n}\n\nfunc (x DotnetTargetFramework) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// GoConfig is the configuration for a Go plugin.\ntype GoConfig struct {\n\tstate                       protoimpl.MessageState      `protogen:\"opaque.v1\"`\n\txxx_hidden_RuntimeLibraries *[]*GoConfig_RuntimeLibrary `protobuf:\"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\txxx_hidden_MinimumVersion   string                      `protobuf:\"bytes,2,opt,name=minimum_version,json=minimumVersion,proto3\"`\n\txxx_hidden_BasePlugin       string                      `protobuf:\"bytes,3,opt,name=base_plugin,json=basePlugin,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *GoConfig) Reset() {\n\t*x = GoConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GoConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GoConfig) ProtoMessage() {}\n\nfunc (x *GoConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *GoConfig) GetRuntimeLibraries() []*GoConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GoConfig) GetMinimumVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MinimumVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *GoConfig) GetBasePlugin() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_BasePlugin\n\t}\n\treturn \"\"\n}\n\nfunc (x *GoConfig) SetRuntimeLibraries(v []*GoConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\nfunc (x *GoConfig) SetMinimumVersion(v string) {\n\tx.xxx_hidden_MinimumVersion = v\n}\n\nfunc (x *GoConfig) SetBasePlugin(v string) {\n\tx.xxx_hidden_BasePlugin = v\n}\n\ntype GoConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Optionally define the runtime libraries for the plugin.\n\tRuntimeLibraries []*GoConfig_RuntimeLibrary\n\t// The minimum Go version required by the plugin.\n\tMinimumVersion string\n\t// Optionally specifies an alternate base plugin like \"remote/org/go-multi\" instead of the default\n\t// \"remote/protocolbuffers/go\". If provided, the name must match one of the plugin dependencies in\n\t// the top-level deps field.\n\t//\n\t// This affects how imports are resolved - the specified plugin's import path will be used as the\n\t// base path for all generated code, replacing the default protocolbuffers/go import paths. Used\n\t// when depending on non-default BSR plugins.\n\tBasePlugin string\n}\n\nfunc (b0 GoConfig_builder) Build() *GoConfig {\n\tm0 := &GoConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\tx.xxx_hidden_MinimumVersion = b.MinimumVersion\n\tx.xxx_hidden_BasePlugin = b.BasePlugin\n\treturn m0\n}\n\n// NPMConfig is the configuration for a JavaScript NPM plugin.\ntype NPMConfig struct {\n\tstate                              protoimpl.MessageState       `protogen:\"opaque.v1\"`\n\txxx_hidden_RuntimeLibraries        *[]*NPMConfig_RuntimeLibrary `protobuf:\"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\txxx_hidden_RewriteImportPathSuffix string                       `protobuf:\"bytes,2,opt,name=rewrite_import_path_suffix,json=rewriteImportPathSuffix,proto3\"`\n\txxx_hidden_ImportStyle             NPMImportStyle               `protobuf:\"varint,3,opt,name=import_style,json=importStyle,proto3,enum=buf.alpha.registry.v1alpha1.NPMImportStyle\"`\n\tunknownFields                      protoimpl.UnknownFields\n\tsizeCache                          protoimpl.SizeCache\n}\n\nfunc (x *NPMConfig) Reset() {\n\t*x = NPMConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NPMConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NPMConfig) ProtoMessage() {}\n\nfunc (x *NPMConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *NPMConfig) GetRuntimeLibraries() []*NPMConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *NPMConfig) GetRewriteImportPathSuffix() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RewriteImportPathSuffix\n\t}\n\treturn \"\"\n}\n\nfunc (x *NPMConfig) GetImportStyle() NPMImportStyle {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImportStyle\n\t}\n\treturn NPMImportStyle_NPM_IMPORT_STYLE_UNSPECIFIED\n}\n\nfunc (x *NPMConfig) SetRuntimeLibraries(v []*NPMConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\nfunc (x *NPMConfig) SetRewriteImportPathSuffix(v string) {\n\tx.xxx_hidden_RewriteImportPathSuffix = v\n}\n\nfunc (x *NPMConfig) SetImportStyle(v NPMImportStyle) {\n\tx.xxx_hidden_ImportStyle = v\n}\n\ntype NPMConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Optionally define the runtime libraries for the plugin.\n\tRuntimeLibraries []*NPMConfig_RuntimeLibrary\n\t// Optionally define a configuration for rewriting import paths, a feature mainly\n\t// used for remote code generation in the BSR npm registry, which makes it possible\n\t// to serve the output of a BSR module and a plugin in an individual package.\n\t//\n\t// All plugins based on @bufbuild/protoplugin support the option \"rewrite_imports\".\n\t// Setting this value, i.e. \"connectweb.js\" or \"pb.js\", informs the BSR npm registry\n\t// that the plugin supports import rewrites with the given import suffix.\n\tRewriteImportPathSuffix string\n\t// The import style used for the \"type\" field in the package.json file.\n\t// This exists to support legacy plugins that require \"commonjs\" support.\n\tImportStyle NPMImportStyle\n}\n\nfunc (b0 NPMConfig_builder) Build() *NPMConfig {\n\tm0 := &NPMConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\tx.xxx_hidden_RewriteImportPathSuffix = b.RewriteImportPathSuffix\n\tx.xxx_hidden_ImportStyle = b.ImportStyle\n\treturn m0\n}\n\n// MavenConfig is the configuration for a Maven plugin.\ntype MavenConfig struct {\n\tstate                         protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_RuntimeLibraries   *[]*MavenConfig_RuntimeLibrary `protobuf:\"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\txxx_hidden_Compiler           *MavenConfig_CompilerConfig    `protobuf:\"bytes,2,opt,name=compiler,proto3\"`\n\txxx_hidden_AdditionalRuntimes *[]*MavenConfig_RuntimeConfig  `protobuf:\"bytes,3,rep,name=additional_runtimes,json=additionalRuntimes,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *MavenConfig) Reset() {\n\t*x = MavenConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MavenConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MavenConfig) ProtoMessage() {}\n\nfunc (x *MavenConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *MavenConfig) GetRuntimeLibraries() []*MavenConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *MavenConfig) GetCompiler() *MavenConfig_CompilerConfig {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Compiler\n\t}\n\treturn nil\n}\n\nfunc (x *MavenConfig) GetAdditionalRuntimes() []*MavenConfig_RuntimeConfig {\n\tif x != nil {\n\t\tif x.xxx_hidden_AdditionalRuntimes != nil {\n\t\t\treturn *x.xxx_hidden_AdditionalRuntimes\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *MavenConfig) SetRuntimeLibraries(v []*MavenConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\nfunc (x *MavenConfig) SetCompiler(v *MavenConfig_CompilerConfig) {\n\tx.xxx_hidden_Compiler = v\n}\n\nfunc (x *MavenConfig) SetAdditionalRuntimes(v []*MavenConfig_RuntimeConfig) {\n\tx.xxx_hidden_AdditionalRuntimes = &v\n}\n\nfunc (x *MavenConfig) HasCompiler() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Compiler != nil\n}\n\nfunc (x *MavenConfig) ClearCompiler() {\n\tx.xxx_hidden_Compiler = nil\n}\n\ntype MavenConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Optionally define the runtime libraries for the plugin.\n\tRuntimeLibraries []*MavenConfig_RuntimeLibrary\n\t// Settings for the Java/Kotlin compiler used to compile the generated code.\n\tCompiler *MavenConfig_CompilerConfig\n\t// Optional additional runtimes supported by the plugin.\n\tAdditionalRuntimes []*MavenConfig_RuntimeConfig\n}\n\nfunc (b0 MavenConfig_builder) Build() *MavenConfig {\n\tm0 := &MavenConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\tx.xxx_hidden_Compiler = b.Compiler\n\tx.xxx_hidden_AdditionalRuntimes = &b.AdditionalRuntimes\n\treturn m0\n}\n\n// NugetConfig is the configuration for a NuGet C# plugin.\ntype NugetConfig struct {\n\tstate                       protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_TargetFrameworks []DotnetTargetFramework        `protobuf:\"varint,1,rep,packed,name=target_frameworks,json=targetFrameworks,proto3,enum=buf.alpha.registry.v1alpha1.DotnetTargetFramework\"`\n\txxx_hidden_RuntimeLibraries *[]*NugetConfig_RuntimeLibrary `protobuf:\"bytes,2,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *NugetConfig) Reset() {\n\t*x = NugetConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NugetConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NugetConfig) ProtoMessage() {}\n\nfunc (x *NugetConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *NugetConfig) GetTargetFrameworks() []DotnetTargetFramework {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TargetFrameworks\n\t}\n\treturn nil\n}\n\nfunc (x *NugetConfig) GetRuntimeLibraries() []*NugetConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *NugetConfig) SetTargetFrameworks(v []DotnetTargetFramework) {\n\tx.xxx_hidden_TargetFrameworks = v\n}\n\nfunc (x *NugetConfig) SetRuntimeLibraries(v []*NugetConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\ntype NugetConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Target frameworks to build. At least one target framework is required.\n\tTargetFrameworks []DotnetTargetFramework\n\t// Optional runtime libraries required by the plugin's generated code.\n\tRuntimeLibraries []*NugetConfig_RuntimeLibrary\n}\n\nfunc (b0 NugetConfig_builder) Build() *NugetConfig {\n\tm0 := &NugetConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TargetFrameworks = b.TargetFrameworks\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\treturn m0\n}\n\n// CmakeConfig is the configuration for a Cmake C++ plugin.\ntype CmakeConfig struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *CmakeConfig) Reset() {\n\t*x = CmakeConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CmakeConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CmakeConfig) ProtoMessage() {}\n\nfunc (x *CmakeConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\ntype CmakeConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 CmakeConfig_builder) Build() *CmakeConfig {\n\tm0 := &CmakeConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype SwiftConfig struct {\n\tstate                       protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_RuntimeLibraries *[]*SwiftConfig_RuntimeLibrary `protobuf:\"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *SwiftConfig) Reset() {\n\t*x = SwiftConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SwiftConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SwiftConfig) ProtoMessage() {}\n\nfunc (x *SwiftConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *SwiftConfig) GetRuntimeLibraries() []*SwiftConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SwiftConfig) SetRuntimeLibraries(v []*SwiftConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\ntype SwiftConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Optionally define the runtime libraries for the plugin.\n\tRuntimeLibraries []*SwiftConfig_RuntimeLibrary\n}\n\nfunc (b0 SwiftConfig_builder) Build() *SwiftConfig {\n\tm0 := &SwiftConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\treturn m0\n}\n\ntype PythonConfig struct {\n\tstate                       protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_RuntimeLibraries *[]*PythonConfig_RuntimeLibrary `protobuf:\"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\txxx_hidden_RequiresPython   string                          `protobuf:\"bytes,2,opt,name=requires_python,json=requiresPython,proto3\"`\n\txxx_hidden_PackageType      PythonPackageType               `protobuf:\"varint,3,opt,name=package_type,json=packageType,proto3,enum=buf.alpha.registry.v1alpha1.PythonPackageType\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *PythonConfig) Reset() {\n\t*x = PythonConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PythonConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PythonConfig) ProtoMessage() {}\n\nfunc (x *PythonConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *PythonConfig) GetRuntimeLibraries() []*PythonConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PythonConfig) GetRequiresPython() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RequiresPython\n\t}\n\treturn \"\"\n}\n\nfunc (x *PythonConfig) GetPackageType() PythonPackageType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PackageType\n\t}\n\treturn PythonPackageType_PYTHON_PACKAGE_TYPE_UNSPECIFIED\n}\n\nfunc (x *PythonConfig) SetRuntimeLibraries(v []*PythonConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\nfunc (x *PythonConfig) SetRequiresPython(v string) {\n\tx.xxx_hidden_RequiresPython = v\n}\n\nfunc (x *PythonConfig) SetPackageType(v PythonPackageType) {\n\tx.xxx_hidden_PackageType = v\n}\n\ntype PythonConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRuntimeLibraries []*PythonConfig_RuntimeLibrary\n\t// requires_python is a PEP 440 Version Specifier that specifies the value of\n\t// the `Requires-Python` field in a metadata file.\n\t//\n\t// Ref:\n\t// - https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python\n\t// - https://peps.python.org/pep-0440/\n\tRequiresPython string\n\t// package_type is the PythonPackageType that this plugin generates.\n\tPackageType PythonPackageType\n}\n\nfunc (b0 PythonConfig_builder) Build() *PythonConfig {\n\tm0 := &PythonConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\tx.xxx_hidden_RequiresPython = b.RequiresPython\n\tx.xxx_hidden_PackageType = b.PackageType\n\treturn m0\n}\n\n// CargoConfig specifies the Cargo Registry configuration for a Rust plugin.\ntype CargoConfig struct {\n\tstate                       protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_RustVersion      string                         `protobuf:\"bytes,1,opt,name=rust_version,json=rustVersion,proto3\"`\n\txxx_hidden_RuntimeLibraries *[]*CargoConfig_RuntimeLibrary `protobuf:\"bytes,2,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *CargoConfig) Reset() {\n\t*x = CargoConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CargoConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CargoConfig) ProtoMessage() {}\n\nfunc (x *CargoConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *CargoConfig) GetRustVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RustVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *CargoConfig) GetRuntimeLibraries() []*CargoConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *CargoConfig) SetRustVersion(v string) {\n\tx.xxx_hidden_RustVersion = v\n}\n\nfunc (x *CargoConfig) SetRuntimeLibraries(v []*CargoConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\ntype CargoConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// rust_version specifies the minimum supported Rust version (MSRV) for the generated crate.\n\t// Ref: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field\n\tRustVersion string\n\t// runtime_libraries specifies the runtime dependencies for the generated crate. Optional.\n\tRuntimeLibraries []*CargoConfig_RuntimeLibrary\n}\n\nfunc (b0 CargoConfig_builder) Build() *CargoConfig {\n\tm0 := &CargoConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RustVersion = b.RustVersion\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\treturn m0\n}\n\n// RegistryConfig is the configuration for the remote registry of a plugin.\ntype RegistryConfig struct {\n\tstate                     protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_RegistryConfig isRegistryConfig_RegistryConfig `protobuf_oneof:\"registry_config\"`\n\txxx_hidden_Options        []string                        `protobuf:\"bytes,10,rep,name=options,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *RegistryConfig) Reset() {\n\t*x = RegistryConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RegistryConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RegistryConfig) ProtoMessage() {}\n\nfunc (x *RegistryConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_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\nfunc (x *RegistryConfig) GetGoConfig() *GoConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_GoConfig); ok {\n\t\t\treturn x.GoConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetNpmConfig() *NPMConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_NpmConfig); ok {\n\t\t\treturn x.NpmConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetMavenConfig() *MavenConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_MavenConfig); ok {\n\t\t\treturn x.MavenConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetSwiftConfig() *SwiftConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_SwiftConfig); ok {\n\t\t\treturn x.SwiftConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetPythonConfig() *PythonConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_PythonConfig); ok {\n\t\t\treturn x.PythonConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetCargoConfig() *CargoConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_CargoConfig); ok {\n\t\t\treturn x.CargoConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetNugetConfig() *NugetConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_NugetConfig); ok {\n\t\t\treturn x.NugetConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetCmakeConfig() *CmakeConfig {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_CmakeConfig); ok {\n\t\t\treturn x.CmakeConfig\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) GetOptions() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Options\n\t}\n\treturn nil\n}\n\nfunc (x *RegistryConfig) SetGoConfig(v *GoConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_GoConfig{v}\n}\n\nfunc (x *RegistryConfig) SetNpmConfig(v *NPMConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_NpmConfig{v}\n}\n\nfunc (x *RegistryConfig) SetMavenConfig(v *MavenConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_MavenConfig{v}\n}\n\nfunc (x *RegistryConfig) SetSwiftConfig(v *SwiftConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_SwiftConfig{v}\n}\n\nfunc (x *RegistryConfig) SetPythonConfig(v *PythonConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_PythonConfig{v}\n}\n\nfunc (x *RegistryConfig) SetCargoConfig(v *CargoConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_CargoConfig{v}\n}\n\nfunc (x *RegistryConfig) SetNugetConfig(v *NugetConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_NugetConfig{v}\n}\n\nfunc (x *RegistryConfig) SetCmakeConfig(v *CmakeConfig) {\n\tif v == nil {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_RegistryConfig = &registryConfig_CmakeConfig{v}\n}\n\nfunc (x *RegistryConfig) SetOptions(v []string) {\n\tx.xxx_hidden_Options = v\n}\n\nfunc (x *RegistryConfig) HasRegistryConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RegistryConfig != nil\n}\n\nfunc (x *RegistryConfig) HasGoConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_GoConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) HasNpmConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_NpmConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) HasMavenConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_MavenConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) HasSwiftConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_SwiftConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) HasPythonConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_PythonConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) HasCargoConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_CargoConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) HasNugetConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_NugetConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) HasCmakeConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_CmakeConfig)\n\treturn ok\n}\n\nfunc (x *RegistryConfig) ClearRegistryConfig() {\n\tx.xxx_hidden_RegistryConfig = nil\n}\n\nfunc (x *RegistryConfig) ClearGoConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_GoConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nfunc (x *RegistryConfig) ClearNpmConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_NpmConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nfunc (x *RegistryConfig) ClearMavenConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_MavenConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nfunc (x *RegistryConfig) ClearSwiftConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_SwiftConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nfunc (x *RegistryConfig) ClearPythonConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_PythonConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nfunc (x *RegistryConfig) ClearCargoConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_CargoConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nfunc (x *RegistryConfig) ClearNugetConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_NugetConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nfunc (x *RegistryConfig) ClearCmakeConfig() {\n\tif _, ok := x.xxx_hidden_RegistryConfig.(*registryConfig_CmakeConfig); ok {\n\t\tx.xxx_hidden_RegistryConfig = nil\n\t}\n}\n\nconst RegistryConfig_RegistryConfig_not_set_case case_RegistryConfig_RegistryConfig = 0\nconst RegistryConfig_GoConfig_case case_RegistryConfig_RegistryConfig = 1\nconst RegistryConfig_NpmConfig_case case_RegistryConfig_RegistryConfig = 2\nconst RegistryConfig_MavenConfig_case case_RegistryConfig_RegistryConfig = 3\nconst RegistryConfig_SwiftConfig_case case_RegistryConfig_RegistryConfig = 4\nconst RegistryConfig_PythonConfig_case case_RegistryConfig_RegistryConfig = 5\nconst RegistryConfig_CargoConfig_case case_RegistryConfig_RegistryConfig = 6\nconst RegistryConfig_NugetConfig_case case_RegistryConfig_RegistryConfig = 7\nconst RegistryConfig_CmakeConfig_case case_RegistryConfig_RegistryConfig = 8\n\nfunc (x *RegistryConfig) WhichRegistryConfig() case_RegistryConfig_RegistryConfig {\n\tif x == nil {\n\t\treturn RegistryConfig_RegistryConfig_not_set_case\n\t}\n\tswitch x.xxx_hidden_RegistryConfig.(type) {\n\tcase *registryConfig_GoConfig:\n\t\treturn RegistryConfig_GoConfig_case\n\tcase *registryConfig_NpmConfig:\n\t\treturn RegistryConfig_NpmConfig_case\n\tcase *registryConfig_MavenConfig:\n\t\treturn RegistryConfig_MavenConfig_case\n\tcase *registryConfig_SwiftConfig:\n\t\treturn RegistryConfig_SwiftConfig_case\n\tcase *registryConfig_PythonConfig:\n\t\treturn RegistryConfig_PythonConfig_case\n\tcase *registryConfig_CargoConfig:\n\t\treturn RegistryConfig_CargoConfig_case\n\tcase *registryConfig_NugetConfig:\n\t\treturn RegistryConfig_NugetConfig_case\n\tcase *registryConfig_CmakeConfig:\n\t\treturn RegistryConfig_CmakeConfig_case\n\tdefault:\n\t\treturn RegistryConfig_RegistryConfig_not_set_case\n\t}\n}\n\ntype RegistryConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_RegistryConfig:\n\tGoConfig     *GoConfig\n\tNpmConfig    *NPMConfig\n\tMavenConfig  *MavenConfig\n\tSwiftConfig  *SwiftConfig\n\tPythonConfig *PythonConfig\n\tCargoConfig  *CargoConfig\n\tNugetConfig  *NugetConfig\n\tCmakeConfig  *CmakeConfig\n\t// -- end of xxx_hidden_RegistryConfig\n\t// The options to pass to the plugin. These will\n\t// be merged into a single, comma-separated string.\n\tOptions []string\n}\n\nfunc (b0 RegistryConfig_builder) Build() *RegistryConfig {\n\tm0 := &RegistryConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.GoConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_GoConfig{b.GoConfig}\n\t}\n\tif b.NpmConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_NpmConfig{b.NpmConfig}\n\t}\n\tif b.MavenConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_MavenConfig{b.MavenConfig}\n\t}\n\tif b.SwiftConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_SwiftConfig{b.SwiftConfig}\n\t}\n\tif b.PythonConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_PythonConfig{b.PythonConfig}\n\t}\n\tif b.CargoConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_CargoConfig{b.CargoConfig}\n\t}\n\tif b.NugetConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_NugetConfig{b.NugetConfig}\n\t}\n\tif b.CmakeConfig != nil {\n\t\tx.xxx_hidden_RegistryConfig = &registryConfig_CmakeConfig{b.CmakeConfig}\n\t}\n\tx.xxx_hidden_Options = b.Options\n\treturn m0\n}\n\ntype case_RegistryConfig_RegistryConfig protoreflect.FieldNumber\n\nfunc (x case_RegistryConfig_RegistryConfig) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[8].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isRegistryConfig_RegistryConfig interface {\n\tisRegistryConfig_RegistryConfig()\n}\n\ntype registryConfig_GoConfig struct {\n\tGoConfig *GoConfig `protobuf:\"bytes,1,opt,name=go_config,json=goConfig,proto3,oneof\"`\n}\n\ntype registryConfig_NpmConfig struct {\n\tNpmConfig *NPMConfig `protobuf:\"bytes,2,opt,name=npm_config,json=npmConfig,proto3,oneof\"`\n}\n\ntype registryConfig_MavenConfig struct {\n\tMavenConfig *MavenConfig `protobuf:\"bytes,3,opt,name=maven_config,json=mavenConfig,proto3,oneof\"`\n}\n\ntype registryConfig_SwiftConfig struct {\n\tSwiftConfig *SwiftConfig `protobuf:\"bytes,4,opt,name=swift_config,json=swiftConfig,proto3,oneof\"`\n}\n\ntype registryConfig_PythonConfig struct {\n\tPythonConfig *PythonConfig `protobuf:\"bytes,5,opt,name=python_config,json=pythonConfig,proto3,oneof\"`\n}\n\ntype registryConfig_CargoConfig struct {\n\tCargoConfig *CargoConfig `protobuf:\"bytes,6,opt,name=cargo_config,json=cargoConfig,proto3,oneof\"`\n}\n\ntype registryConfig_NugetConfig struct {\n\tNugetConfig *NugetConfig `protobuf:\"bytes,7,opt,name=nuget_config,json=nugetConfig,proto3,oneof\"`\n}\n\ntype registryConfig_CmakeConfig struct {\n\tCmakeConfig *CmakeConfig `protobuf:\"bytes,8,opt,name=cmake_config,json=cmakeConfig,proto3,oneof\"`\n}\n\nfunc (*registryConfig_GoConfig) isRegistryConfig_RegistryConfig() {}\n\nfunc (*registryConfig_NpmConfig) isRegistryConfig_RegistryConfig() {}\n\nfunc (*registryConfig_MavenConfig) isRegistryConfig_RegistryConfig() {}\n\nfunc (*registryConfig_SwiftConfig) isRegistryConfig_RegistryConfig() {}\n\nfunc (*registryConfig_PythonConfig) isRegistryConfig_RegistryConfig() {}\n\nfunc (*registryConfig_CargoConfig) isRegistryConfig_RegistryConfig() {}\n\nfunc (*registryConfig_NugetConfig) isRegistryConfig_RegistryConfig() {}\n\nfunc (*registryConfig_CmakeConfig) isRegistryConfig_RegistryConfig() {}\n\ntype CuratedPluginReference struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner    string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name     string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Version  string                 `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_Revision uint32                 `protobuf:\"varint,4,opt,name=revision,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *CuratedPluginReference) Reset() {\n\t*x = CuratedPluginReference{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CuratedPluginReference) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CuratedPluginReference) ProtoMessage() {}\n\nfunc (x *CuratedPluginReference) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[9]\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\nfunc (x *CuratedPluginReference) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginReference) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginReference) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginReference) GetRevision() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Revision\n\t}\n\treturn 0\n}\n\nfunc (x *CuratedPluginReference) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *CuratedPluginReference) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *CuratedPluginReference) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *CuratedPluginReference) SetRevision(v uint32) {\n\tx.xxx_hidden_Revision = v\n}\n\ntype CuratedPluginReference_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the plugin, i.e. \"library\".\n\tOwner string\n\t// The name of the plugin, i.e. \"connect-go\".\n\tName string\n\t// Semver-formatted plugin version.\n\tVersion string\n\t// The revision for this plugin version.\n\tRevision uint32\n}\n\nfunc (b0 CuratedPluginReference_builder) Build() *CuratedPluginReference {\n\tm0 := &CuratedPluginReference{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_Revision = b.Revision\n\treturn m0\n}\n\n// CuratedPlugin represents a protoc plugin curated by Buf, such as protoc-gen-go.\ntype CuratedPlugin struct {\n\tstate                           protoimpl.MessageState     `protogen:\"opaque.v1\"`\n\txxx_hidden_Id                   string                     `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Owner                string                     `protobuf:\"bytes,2,opt,name=owner,proto3\"`\n\txxx_hidden_Name                 string                     `protobuf:\"bytes,3,opt,name=name,proto3\"`\n\txxx_hidden_RegistryType         PluginRegistryType         `protobuf:\"varint,4,opt,name=registry_type,json=registryType,proto3,enum=buf.alpha.registry.v1alpha1.PluginRegistryType\"`\n\txxx_hidden_Version              string                     `protobuf:\"bytes,5,opt,name=version,proto3\"`\n\txxx_hidden_ContainerImageDigest string                     `protobuf:\"bytes,6,opt,name=container_image_digest,json=containerImageDigest,proto3\"`\n\txxx_hidden_CreateTime           *timestamppb.Timestamp     `protobuf:\"bytes,8,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_Dependencies         *[]*CuratedPluginReference `protobuf:\"bytes,9,rep,name=dependencies,proto3\"`\n\txxx_hidden_SourceUrl            string                     `protobuf:\"bytes,10,opt,name=source_url,json=sourceUrl,proto3\"`\n\txxx_hidden_Description          string                     `protobuf:\"bytes,11,opt,name=description,proto3\"`\n\txxx_hidden_RegistryConfig       *RegistryConfig            `protobuf:\"bytes,12,opt,name=registry_config,json=registryConfig,proto3\"`\n\txxx_hidden_Revision             uint32                     `protobuf:\"varint,13,opt,name=revision,proto3\"`\n\txxx_hidden_OutputLanguages      []PluginLanguage           `protobuf:\"varint,14,rep,packed,name=output_languages,json=outputLanguages,proto3,enum=buf.alpha.registry.v1alpha1.PluginLanguage\"`\n\txxx_hidden_SpdxLicenseId        string                     `protobuf:\"bytes,15,opt,name=spdx_license_id,json=spdxLicenseId,proto3\"`\n\txxx_hidden_LicenseUrl           string                     `protobuf:\"bytes,16,opt,name=license_url,json=licenseUrl,proto3\"`\n\txxx_hidden_Verified             bool                       `protobuf:\"varint,17,opt,name=verified,proto3\"`\n\txxx_hidden_Visibility           CuratedPluginVisibility    `protobuf:\"varint,18,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.CuratedPluginVisibility\"`\n\txxx_hidden_Deprecated           bool                       `protobuf:\"varint,19,opt,name=deprecated,proto3\"`\n\txxx_hidden_DeprecationMessage   string                     `protobuf:\"bytes,20,opt,name=deprecation_message,json=deprecationMessage,proto3\"`\n\txxx_hidden_IntegrationGuideUrl  string                     `protobuf:\"bytes,21,opt,name=integration_guide_url,json=integrationGuideUrl,proto3\"`\n\txxx_hidden_Doc                  string                     `protobuf:\"bytes,22,opt,name=doc,proto3\"`\n\txxx_hidden_Collections          *[]*PluginCollection       `protobuf:\"bytes,23,rep,name=collections,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *CuratedPlugin) Reset() {\n\t*x = CuratedPlugin{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CuratedPlugin) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CuratedPlugin) ProtoMessage() {}\n\nfunc (x *CuratedPlugin) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[10]\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\nfunc (x *CuratedPlugin) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetRegistryType() PluginRegistryType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RegistryType\n\t}\n\treturn PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED\n}\n\nfunc (x *CuratedPlugin) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetContainerImageDigest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ContainerImageDigest\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPlugin) GetDependencies() []*CuratedPluginReference {\n\tif x != nil {\n\t\tif x.xxx_hidden_Dependencies != nil {\n\t\t\treturn *x.xxx_hidden_Dependencies\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPlugin) GetSourceUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SourceUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetDescription() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Description\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetRegistryConfig() *RegistryConfig {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RegistryConfig\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPlugin) GetRevision() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Revision\n\t}\n\treturn 0\n}\n\nfunc (x *CuratedPlugin) GetOutputLanguages() []PluginLanguage {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OutputLanguages\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPlugin) GetSpdxLicenseId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SpdxLicenseId\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetLicenseUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LicenseUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetVerified() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Verified\n\t}\n\treturn false\n}\n\nfunc (x *CuratedPlugin) GetVisibility() CuratedPluginVisibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_UNSPECIFIED\n}\n\nfunc (x *CuratedPlugin) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *CuratedPlugin) GetDeprecationMessage() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DeprecationMessage\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetIntegrationGuideUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IntegrationGuideUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetDoc() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Doc\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPlugin) GetCollections() []*PluginCollection {\n\tif x != nil {\n\t\tif x.xxx_hidden_Collections != nil {\n\t\t\treturn *x.xxx_hidden_Collections\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPlugin) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *CuratedPlugin) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *CuratedPlugin) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *CuratedPlugin) SetRegistryType(v PluginRegistryType) {\n\tx.xxx_hidden_RegistryType = v\n}\n\nfunc (x *CuratedPlugin) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *CuratedPlugin) SetContainerImageDigest(v string) {\n\tx.xxx_hidden_ContainerImageDigest = v\n}\n\nfunc (x *CuratedPlugin) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *CuratedPlugin) SetDependencies(v []*CuratedPluginReference) {\n\tx.xxx_hidden_Dependencies = &v\n}\n\nfunc (x *CuratedPlugin) SetSourceUrl(v string) {\n\tx.xxx_hidden_SourceUrl = v\n}\n\nfunc (x *CuratedPlugin) SetDescription(v string) {\n\tx.xxx_hidden_Description = v\n}\n\nfunc (x *CuratedPlugin) SetRegistryConfig(v *RegistryConfig) {\n\tx.xxx_hidden_RegistryConfig = v\n}\n\nfunc (x *CuratedPlugin) SetRevision(v uint32) {\n\tx.xxx_hidden_Revision = v\n}\n\nfunc (x *CuratedPlugin) SetOutputLanguages(v []PluginLanguage) {\n\tx.xxx_hidden_OutputLanguages = v\n}\n\nfunc (x *CuratedPlugin) SetSpdxLicenseId(v string) {\n\tx.xxx_hidden_SpdxLicenseId = v\n}\n\nfunc (x *CuratedPlugin) SetLicenseUrl(v string) {\n\tx.xxx_hidden_LicenseUrl = v\n}\n\nfunc (x *CuratedPlugin) SetVerified(v bool) {\n\tx.xxx_hidden_Verified = v\n}\n\nfunc (x *CuratedPlugin) SetVisibility(v CuratedPluginVisibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *CuratedPlugin) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *CuratedPlugin) SetDeprecationMessage(v string) {\n\tx.xxx_hidden_DeprecationMessage = v\n}\n\nfunc (x *CuratedPlugin) SetIntegrationGuideUrl(v string) {\n\tx.xxx_hidden_IntegrationGuideUrl = v\n}\n\nfunc (x *CuratedPlugin) SetDoc(v string) {\n\tx.xxx_hidden_Doc = v\n}\n\nfunc (x *CuratedPlugin) SetCollections(v []*PluginCollection) {\n\tx.xxx_hidden_Collections = &v\n}\n\nfunc (x *CuratedPlugin) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *CuratedPlugin) HasRegistryConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RegistryConfig != nil\n}\n\nfunc (x *CuratedPlugin) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *CuratedPlugin) ClearRegistryConfig() {\n\tx.xxx_hidden_RegistryConfig = nil\n}\n\ntype CuratedPlugin_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the plugin, which uniquely identifies the plugin.\n\tId string\n\t// The owner of the plugin, i.e. \"library\".\n\tOwner string\n\t// The name of the plugin, i.e. \"connect-go\".\n\tName string\n\t// The optional registry type of the plugin.\n\tRegistryType PluginRegistryType\n\t// Semver-formatted plugin version.\n\tVersion string\n\t// The full container image digest associated with this plugin version including\n\t// the algorithm.\n\t// Ref: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests\n\tContainerImageDigest string\n\t// The creation time of the plugin.\n\tCreateTime *timestamppb.Timestamp\n\t// List of plugin dependencies.\n\tDependencies []*CuratedPluginReference\n\t// Optionally specify the URL leading to the source code of the plugin, if available.\n\tSourceUrl string\n\t// Optionally specify a brief description of the plugin functionality.\n\tDescription string\n\t// The configuration for the remote registry of the plugin.\n\tRegistryConfig *RegistryConfig\n\t// The revision for this plugin version.\n\tRevision uint32\n\t// The output languages supported by the plugin.\n\tOutputLanguages []PluginLanguage\n\t// spdx_license_id is the license of the plugin, which should be one of the identifiers\n\t// defined in https://spdx.org/licenses\n\tSpdxLicenseId string\n\t// license_url specifies an optional URL for the plugin's license (if not using a standard spdx_license_id).\n\tLicenseUrl string\n\t// verified indicates the plugin has been verified. Verification is a property\n\t// of the BSR and cannot be set by end-users.\n\tVerified bool\n\t// Visibility indicates whether the plugin is public or private.\n\tVisibility CuratedPluginVisibility\n\t// Deprecated indicates whether the plugin is deprecated.\n\tDeprecated bool\n\t// Optionally specify a message to be displayed when the plugin is deprecated.\n\tDeprecationMessage string\n\t// The URL leading to the integration guide of the plugin, if available.\n\tIntegrationGuideUrl string\n\t// The configurable documentation of the Plugin.\n\tDoc string\n\t// The collections the Plugin belongs to.\n\tCollections []*PluginCollection\n}\n\nfunc (b0 CuratedPlugin_builder) Build() *CuratedPlugin {\n\tm0 := &CuratedPlugin{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_RegistryType = b.RegistryType\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_ContainerImageDigest = b.ContainerImageDigest\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_Dependencies = &b.Dependencies\n\tx.xxx_hidden_SourceUrl = b.SourceUrl\n\tx.xxx_hidden_Description = b.Description\n\tx.xxx_hidden_RegistryConfig = b.RegistryConfig\n\tx.xxx_hidden_Revision = b.Revision\n\tx.xxx_hidden_OutputLanguages = b.OutputLanguages\n\tx.xxx_hidden_SpdxLicenseId = b.SpdxLicenseId\n\tx.xxx_hidden_LicenseUrl = b.LicenseUrl\n\tx.xxx_hidden_Verified = b.Verified\n\tx.xxx_hidden_Visibility = b.Visibility\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\tx.xxx_hidden_DeprecationMessage = b.DeprecationMessage\n\tx.xxx_hidden_IntegrationGuideUrl = b.IntegrationGuideUrl\n\tx.xxx_hidden_Doc = b.Doc\n\tx.xxx_hidden_Collections = &b.Collections\n\treturn m0\n}\n\n// Plugin collections group related plugins, organizing them by functionality or ecosystem.\ntype PluginCollection struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *PluginCollection) Reset() {\n\t*x = PluginCollection{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PluginCollection) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PluginCollection) ProtoMessage() {}\n\nfunc (x *PluginCollection) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[11]\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\nfunc (x *PluginCollection) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *PluginCollection) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype PluginCollection_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the collection.\n\tName string\n}\n\nfunc (b0 PluginCollection_builder) Build() *PluginCollection {\n\tm0 := &PluginCollection{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype GenerateCodeRequest struct {\n\tstate                            protoimpl.MessageState      `protogen:\"opaque.v1\"`\n\txxx_hidden_Image                 *v1.Image                   `protobuf:\"bytes,1,opt,name=image,proto3\"`\n\txxx_hidden_Requests              *[]*PluginGenerationRequest `protobuf:\"bytes,2,rep,name=requests,proto3\"`\n\txxx_hidden_IncludeImports        bool                        `protobuf:\"varint,3,opt,name=include_imports,json=includeImports,proto3\"`\n\txxx_hidden_IncludeWellKnownTypes bool                        `protobuf:\"varint,4,opt,name=include_well_known_types,json=includeWellKnownTypes,proto3\"`\n\tunknownFields                    protoimpl.UnknownFields\n\tsizeCache                        protoimpl.SizeCache\n}\n\nfunc (x *GenerateCodeRequest) Reset() {\n\t*x = GenerateCodeRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GenerateCodeRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GenerateCodeRequest) ProtoMessage() {}\n\nfunc (x *GenerateCodeRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[12]\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\nfunc (x *GenerateCodeRequest) GetImage() *v1.Image {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Image\n\t}\n\treturn nil\n}\n\nfunc (x *GenerateCodeRequest) GetRequests() []*PluginGenerationRequest {\n\tif x != nil {\n\t\tif x.xxx_hidden_Requests != nil {\n\t\t\treturn *x.xxx_hidden_Requests\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GenerateCodeRequest) GetIncludeImports() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeImports\n\t}\n\treturn false\n}\n\nfunc (x *GenerateCodeRequest) GetIncludeWellKnownTypes() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeWellKnownTypes\n\t}\n\treturn false\n}\n\nfunc (x *GenerateCodeRequest) SetImage(v *v1.Image) {\n\tx.xxx_hidden_Image = v\n}\n\nfunc (x *GenerateCodeRequest) SetRequests(v []*PluginGenerationRequest) {\n\tx.xxx_hidden_Requests = &v\n}\n\nfunc (x *GenerateCodeRequest) SetIncludeImports(v bool) {\n\tx.xxx_hidden_IncludeImports = v\n}\n\nfunc (x *GenerateCodeRequest) SetIncludeWellKnownTypes(v bool) {\n\tx.xxx_hidden_IncludeWellKnownTypes = v\n}\n\nfunc (x *GenerateCodeRequest) HasImage() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Image != nil\n}\n\nfunc (x *GenerateCodeRequest) ClearImage() {\n\tx.xxx_hidden_Image = nil\n}\n\ntype GenerateCodeRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The image to run plugins against to generate the desired file outputs.\n\t//\n\t// All image files that are not imports and not well-known types will be generated.\n\t// If you want to filter what files are generated, modify the image.\n\t// If you want to include imports, set include_imports.\n\tImage    *v1.Image\n\tRequests []*PluginGenerationRequest\n\t// Include imports from the Image in generation. If include_imports is also set\n\t// in one of requests, use the request's value for that plugin.\n\tIncludeImports bool\n\t// Include Well-Known Types from the Image in generation.\n\t//\n\t// include_imports must be set if include_well_known_types is set. If include_well_known_types\n\t// is also set in one of requests, use the request's value for that plugin.\n\tIncludeWellKnownTypes bool\n}\n\nfunc (b0 GenerateCodeRequest_builder) Build() *GenerateCodeRequest {\n\tm0 := &GenerateCodeRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Image = b.Image\n\tx.xxx_hidden_Requests = &b.Requests\n\tx.xxx_hidden_IncludeImports = b.IncludeImports\n\tx.xxx_hidden_IncludeWellKnownTypes = b.IncludeWellKnownTypes\n\treturn m0\n}\n\ntype GenerateCodeResponse struct {\n\tstate                protoimpl.MessageState       `protogen:\"opaque.v1\"`\n\txxx_hidden_Responses *[]*PluginGenerationResponse `protobuf:\"bytes,1,rep,name=responses,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *GenerateCodeResponse) Reset() {\n\t*x = GenerateCodeResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GenerateCodeResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GenerateCodeResponse) ProtoMessage() {}\n\nfunc (x *GenerateCodeResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[13]\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\nfunc (x *GenerateCodeResponse) GetResponses() []*PluginGenerationResponse {\n\tif x != nil {\n\t\tif x.xxx_hidden_Responses != nil {\n\t\t\treturn *x.xxx_hidden_Responses\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GenerateCodeResponse) SetResponses(v []*PluginGenerationResponse) {\n\tx.xxx_hidden_Responses = &v\n}\n\ntype GenerateCodeResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Responses from each plugin execution.\n\t// The order of each response matches the order in the GenerateCodeRequest.\n\tResponses []*PluginGenerationResponse\n}\n\nfunc (b0 GenerateCodeResponse_builder) Build() *GenerateCodeResponse {\n\tm0 := &GenerateCodeResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Responses = &b.Responses\n\treturn m0\n}\n\n// Request for performing code generation using the specified plugin.\ntype PluginGenerationRequest struct {\n\tstate                            protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference       *CuratedPluginReference `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_Options               []string                `protobuf:\"bytes,2,rep,name=options,proto3\"`\n\txxx_hidden_IncludeImports        bool                    `protobuf:\"varint,3,opt,name=include_imports,json=includeImports,proto3,oneof\"`\n\txxx_hidden_IncludeWellKnownTypes bool                    `protobuf:\"varint,4,opt,name=include_well_known_types,json=includeWellKnownTypes,proto3,oneof\"`\n\tXXX_raceDetectHookData           protoimpl.RaceDetectHookData\n\tXXX_presence                     [1]uint32\n\tunknownFields                    protoimpl.UnknownFields\n\tsizeCache                        protoimpl.SizeCache\n}\n\nfunc (x *PluginGenerationRequest) Reset() {\n\t*x = PluginGenerationRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PluginGenerationRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PluginGenerationRequest) ProtoMessage() {}\n\nfunc (x *PluginGenerationRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[14]\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\nfunc (x *PluginGenerationRequest) GetPluginReference() *CuratedPluginReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *PluginGenerationRequest) GetOptions() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Options\n\t}\n\treturn nil\n}\n\nfunc (x *PluginGenerationRequest) GetIncludeImports() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeImports\n\t}\n\treturn false\n}\n\nfunc (x *PluginGenerationRequest) GetIncludeWellKnownTypes() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeWellKnownTypes\n\t}\n\treturn false\n}\n\nfunc (x *PluginGenerationRequest) SetPluginReference(v *CuratedPluginReference) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *PluginGenerationRequest) SetOptions(v []string) {\n\tx.xxx_hidden_Options = v\n}\n\nfunc (x *PluginGenerationRequest) SetIncludeImports(v bool) {\n\tx.xxx_hidden_IncludeImports = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 4)\n}\n\nfunc (x *PluginGenerationRequest) SetIncludeWellKnownTypes(v bool) {\n\tx.xxx_hidden_IncludeWellKnownTypes = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 4)\n}\n\nfunc (x *PluginGenerationRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *PluginGenerationRequest) HasIncludeImports() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *PluginGenerationRequest) HasIncludeWellKnownTypes() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 3)\n}\n\nfunc (x *PluginGenerationRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *PluginGenerationRequest) ClearIncludeImports() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_IncludeImports = false\n}\n\nfunc (x *PluginGenerationRequest) ClearIncludeWellKnownTypes() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3)\n\tx.xxx_hidden_IncludeWellKnownTypes = false\n}\n\ntype PluginGenerationRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin to execute.\n\tPluginReference *CuratedPluginReference\n\t// The options to pass to the plugin. These will\n\t// be merged into a single, comma-separated string.\n\tOptions []string\n\t// Include imports from the Image in generation.\n\tIncludeImports *bool\n\t// Include Well-Known Types from the Image in generation.\n\t//\n\t// include_imports must be set if include_well_known_types is set.\n\tIncludeWellKnownTypes *bool\n}\n\nfunc (b0 PluginGenerationRequest_builder) Build() *PluginGenerationRequest {\n\tm0 := &PluginGenerationRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_Options = b.Options\n\tif b.IncludeImports != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 4)\n\t\tx.xxx_hidden_IncludeImports = *b.IncludeImports\n\t}\n\tif b.IncludeWellKnownTypes != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 4)\n\t\tx.xxx_hidden_IncludeWellKnownTypes = *b.IncludeWellKnownTypes\n\t}\n\treturn m0\n}\n\n// Response from code generation for a given plugin.\ntype PluginGenerationResponse struct {\n\tstate               protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_Response *pluginpb.CodeGeneratorResponse `protobuf:\"bytes,1,opt,name=response,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *PluginGenerationResponse) Reset() {\n\t*x = PluginGenerationResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PluginGenerationResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PluginGenerationResponse) ProtoMessage() {}\n\nfunc (x *PluginGenerationResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[15]\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\nfunc (x *PluginGenerationResponse) GetResponse() *pluginpb.CodeGeneratorResponse {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Response\n\t}\n\treturn nil\n}\n\nfunc (x *PluginGenerationResponse) SetResponse(v *pluginpb.CodeGeneratorResponse) {\n\tx.xxx_hidden_Response = v\n}\n\nfunc (x *PluginGenerationResponse) HasResponse() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Response != nil\n}\n\nfunc (x *PluginGenerationResponse) ClearResponse() {\n\tx.xxx_hidden_Response = nil\n}\n\ntype PluginGenerationResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Generated code from the plugin.\n\tResponse *pluginpb.CodeGeneratorResponse\n}\n\nfunc (b0 PluginGenerationResponse_builder) Build() *PluginGenerationResponse {\n\tm0 := &PluginGenerationResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Response = b.Response\n\treturn m0\n}\n\ntype DeleteCuratedPluginRequest struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner   string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name    string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *DeleteCuratedPluginRequest) Reset() {\n\t*x = DeleteCuratedPluginRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteCuratedPluginRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteCuratedPluginRequest) ProtoMessage() {}\n\nfunc (x *DeleteCuratedPluginRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[16]\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\nfunc (x *DeleteCuratedPluginRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteCuratedPluginRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteCuratedPluginRequest) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteCuratedPluginRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *DeleteCuratedPluginRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *DeleteCuratedPluginRequest) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype DeleteCuratedPluginRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the plugin to delete.\n\tOwner string\n\t// The name of the plugin to delete.\n\tName string\n\t// Version is the plugin version and is optional. If this field is not set then delete all versions,\n\t// otherwise delete only the specified version which includes all revisions.\n\tVersion string\n}\n\nfunc (b0 DeleteCuratedPluginRequest_builder) Build() *DeleteCuratedPluginRequest {\n\tm0 := &DeleteCuratedPluginRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype DeleteCuratedPluginResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteCuratedPluginResponse) Reset() {\n\t*x = DeleteCuratedPluginResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteCuratedPluginResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteCuratedPluginResponse) ProtoMessage() {}\n\nfunc (x *DeleteCuratedPluginResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[17]\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\ntype DeleteCuratedPluginResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteCuratedPluginResponse_builder) Build() *DeleteCuratedPluginResponse {\n\tm0 := &DeleteCuratedPluginResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype CreateCuratedPluginRequest struct {\n\tstate                           protoimpl.MessageState     `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner                string                     `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name                 string                     `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_RegistryType         PluginRegistryType         `protobuf:\"varint,3,opt,name=registry_type,json=registryType,proto3,enum=buf.alpha.registry.v1alpha1.PluginRegistryType\"`\n\txxx_hidden_Version              string                     `protobuf:\"bytes,4,opt,name=version,proto3\"`\n\txxx_hidden_ContainerImageDigest string                     `protobuf:\"bytes,5,opt,name=container_image_digest,json=containerImageDigest,proto3\"`\n\txxx_hidden_Dependencies         *[]*CuratedPluginReference `protobuf:\"bytes,7,rep,name=dependencies,proto3\"`\n\txxx_hidden_SourceUrl            string                     `protobuf:\"bytes,8,opt,name=source_url,json=sourceUrl,proto3\"`\n\txxx_hidden_Description          string                     `protobuf:\"bytes,9,opt,name=description,proto3\"`\n\txxx_hidden_RegistryConfig       *RegistryConfig            `protobuf:\"bytes,12,opt,name=registry_config,json=registryConfig,proto3\"`\n\txxx_hidden_Revision             uint32                     `protobuf:\"varint,13,opt,name=revision,proto3\"`\n\txxx_hidden_OutputLanguages      []PluginLanguage           `protobuf:\"varint,14,rep,packed,name=output_languages,json=outputLanguages,proto3,enum=buf.alpha.registry.v1alpha1.PluginLanguage\"`\n\txxx_hidden_SpdxLicenseId        string                     `protobuf:\"bytes,15,opt,name=spdx_license_id,json=spdxLicenseId,proto3\"`\n\txxx_hidden_LicenseUrl           string                     `protobuf:\"bytes,16,opt,name=license_url,json=licenseUrl,proto3\"`\n\txxx_hidden_Visibility           CuratedPluginVisibility    `protobuf:\"varint,17,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.CuratedPluginVisibility\"`\n\txxx_hidden_IntegrationGuideUrl  string                     `protobuf:\"bytes,18,opt,name=integration_guide_url,json=integrationGuideUrl,proto3\"`\n\txxx_hidden_Deprecated           bool                       `protobuf:\"varint,19,opt,name=deprecated,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *CreateCuratedPluginRequest) Reset() {\n\t*x = CreateCuratedPluginRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateCuratedPluginRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateCuratedPluginRequest) ProtoMessage() {}\n\nfunc (x *CreateCuratedPluginRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[18]\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\nfunc (x *CreateCuratedPluginRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetRegistryType() PluginRegistryType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RegistryType\n\t}\n\treturn PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED\n}\n\nfunc (x *CreateCuratedPluginRequest) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetContainerImageDigest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ContainerImageDigest\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetDependencies() []*CuratedPluginReference {\n\tif x != nil {\n\t\tif x.xxx_hidden_Dependencies != nil {\n\t\t\treturn *x.xxx_hidden_Dependencies\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *CreateCuratedPluginRequest) GetSourceUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SourceUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetDescription() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Description\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetRegistryConfig() *RegistryConfig {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RegistryConfig\n\t}\n\treturn nil\n}\n\nfunc (x *CreateCuratedPluginRequest) GetRevision() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Revision\n\t}\n\treturn 0\n}\n\nfunc (x *CreateCuratedPluginRequest) GetOutputLanguages() []PluginLanguage {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OutputLanguages\n\t}\n\treturn nil\n}\n\nfunc (x *CreateCuratedPluginRequest) GetSpdxLicenseId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SpdxLicenseId\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetLicenseUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LicenseUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetVisibility() CuratedPluginVisibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_UNSPECIFIED\n}\n\nfunc (x *CreateCuratedPluginRequest) GetIntegrationGuideUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IntegrationGuideUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateCuratedPluginRequest) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *CreateCuratedPluginRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetRegistryType(v PluginRegistryType) {\n\tx.xxx_hidden_RegistryType = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetContainerImageDigest(v string) {\n\tx.xxx_hidden_ContainerImageDigest = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetDependencies(v []*CuratedPluginReference) {\n\tx.xxx_hidden_Dependencies = &v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetSourceUrl(v string) {\n\tx.xxx_hidden_SourceUrl = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetDescription(v string) {\n\tx.xxx_hidden_Description = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetRegistryConfig(v *RegistryConfig) {\n\tx.xxx_hidden_RegistryConfig = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetRevision(v uint32) {\n\tx.xxx_hidden_Revision = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetOutputLanguages(v []PluginLanguage) {\n\tx.xxx_hidden_OutputLanguages = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetSpdxLicenseId(v string) {\n\tx.xxx_hidden_SpdxLicenseId = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetLicenseUrl(v string) {\n\tx.xxx_hidden_LicenseUrl = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetVisibility(v CuratedPluginVisibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetIntegrationGuideUrl(v string) {\n\tx.xxx_hidden_IntegrationGuideUrl = v\n}\n\nfunc (x *CreateCuratedPluginRequest) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *CreateCuratedPluginRequest) HasRegistryConfig() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RegistryConfig != nil\n}\n\nfunc (x *CreateCuratedPluginRequest) ClearRegistryConfig() {\n\tx.xxx_hidden_RegistryConfig = nil\n}\n\ntype CreateCuratedPluginRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the plugin, i.e. \"library\".\n\tOwner string\n\t// The name of the plugin, i.e. \"connect-go\".\n\tName string\n\t// The optional registry type of the plugin.\n\tRegistryType PluginRegistryType\n\t// Semver-formatted plugin version.\n\tVersion string\n\t// The full container image digest associated with this plugin version including\n\t// the algorithm.\n\t// Ref: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests\n\tContainerImageDigest string\n\t// List of plugin dependencies.\n\tDependencies []*CuratedPluginReference\n\t// The URL leading to the source code of the plugin, if available.\n\tSourceUrl string\n\t// A brief description of the plugin functionality.\n\tDescription string\n\t// The configuration for the remote registry of the plugin.\n\tRegistryConfig *RegistryConfig\n\t// The revision for this plugin version.\n\tRevision uint32\n\t// The output languages supported by the plugin.\n\tOutputLanguages []PluginLanguage\n\t// spdx_license_id is the license of the plugin, which should be one of the identifiers\n\t// defined in https://spdx.org/licenses\n\tSpdxLicenseId string\n\t// license_url specifies an optional URL for the plugin's license (if not using a standard spdx_license_id).\n\tLicenseUrl string\n\t// Visibility indicates whether the plugin is public or private.\n\tVisibility CuratedPluginVisibility\n\t// The URL leading to the integration guide of the plugin, if available.\n\tIntegrationGuideUrl string\n\t// The deprecation status of the plugin.\n\tDeprecated bool\n}\n\nfunc (b0 CreateCuratedPluginRequest_builder) Build() *CreateCuratedPluginRequest {\n\tm0 := &CreateCuratedPluginRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_RegistryType = b.RegistryType\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_ContainerImageDigest = b.ContainerImageDigest\n\tx.xxx_hidden_Dependencies = &b.Dependencies\n\tx.xxx_hidden_SourceUrl = b.SourceUrl\n\tx.xxx_hidden_Description = b.Description\n\tx.xxx_hidden_RegistryConfig = b.RegistryConfig\n\tx.xxx_hidden_Revision = b.Revision\n\tx.xxx_hidden_OutputLanguages = b.OutputLanguages\n\tx.xxx_hidden_SpdxLicenseId = b.SpdxLicenseId\n\tx.xxx_hidden_LicenseUrl = b.LicenseUrl\n\tx.xxx_hidden_Visibility = b.Visibility\n\tx.xxx_hidden_IntegrationGuideUrl = b.IntegrationGuideUrl\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\treturn m0\n}\n\ntype CreateCuratedPluginResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Configuration *CuratedPlugin         `protobuf:\"bytes,1,opt,name=configuration,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *CreateCuratedPluginResponse) Reset() {\n\t*x = CreateCuratedPluginResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateCuratedPluginResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateCuratedPluginResponse) ProtoMessage() {}\n\nfunc (x *CreateCuratedPluginResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[19]\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\nfunc (x *CreateCuratedPluginResponse) GetConfiguration() *CuratedPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Configuration\n\t}\n\treturn nil\n}\n\nfunc (x *CreateCuratedPluginResponse) SetConfiguration(v *CuratedPlugin) {\n\tx.xxx_hidden_Configuration = v\n}\n\nfunc (x *CreateCuratedPluginResponse) HasConfiguration() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Configuration != nil\n}\n\nfunc (x *CreateCuratedPluginResponse) ClearConfiguration() {\n\tx.xxx_hidden_Configuration = nil\n}\n\ntype CreateCuratedPluginResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The created plugin.\n\tConfiguration *CuratedPlugin\n}\n\nfunc (b0 CreateCuratedPluginResponse_builder) Build() *CreateCuratedPluginResponse {\n\tm0 := &CreateCuratedPluginResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Configuration = b.Configuration\n\treturn m0\n}\n\ntype ListCuratedPluginsRequest struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize               uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken              string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse                bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\txxx_hidden_SupportsRemotePackages bool                   `protobuf:\"varint,4,opt,name=supports_remote_packages,json=supportsRemotePackages,proto3\"`\n\txxx_hidden_IncludeDeprecated      bool                   `protobuf:\"varint,5,opt,name=include_deprecated,json=includeDeprecated,proto3\"`\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *ListCuratedPluginsRequest) Reset() {\n\t*x = ListCuratedPluginsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListCuratedPluginsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListCuratedPluginsRequest) ProtoMessage() {}\n\nfunc (x *ListCuratedPluginsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[20]\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\nfunc (x *ListCuratedPluginsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListCuratedPluginsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListCuratedPluginsRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListCuratedPluginsRequest) GetSupportsRemotePackages() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SupportsRemotePackages\n\t}\n\treturn false\n}\n\nfunc (x *ListCuratedPluginsRequest) GetIncludeDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeDeprecated\n\t}\n\treturn false\n}\n\nfunc (x *ListCuratedPluginsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListCuratedPluginsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListCuratedPluginsRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\nfunc (x *ListCuratedPluginsRequest) SetSupportsRemotePackages(v bool) {\n\tx.xxx_hidden_SupportsRemotePackages = v\n}\n\nfunc (x *ListCuratedPluginsRequest) SetIncludeDeprecated(v bool) {\n\tx.xxx_hidden_IncludeDeprecated = v\n}\n\ntype ListCuratedPluginsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n\t// If true, will only return plugins which support remote packages (registry_type is set).\n\tSupportsRemotePackages bool\n\t// If true, will include deprecated plugins.\n\tIncludeDeprecated bool\n}\n\nfunc (b0 ListCuratedPluginsRequest_builder) Build() *ListCuratedPluginsRequest {\n\tm0 := &ListCuratedPluginsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\tx.xxx_hidden_SupportsRemotePackages = b.SupportsRemotePackages\n\tx.xxx_hidden_IncludeDeprecated = b.IncludeDeprecated\n\treturn m0\n}\n\ntype ListCuratedPluginsResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Plugins       *[]*CuratedPlugin      `protobuf:\"bytes,1,rep,name=plugins,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListCuratedPluginsResponse) Reset() {\n\t*x = ListCuratedPluginsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListCuratedPluginsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListCuratedPluginsResponse) ProtoMessage() {}\n\nfunc (x *ListCuratedPluginsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[21]\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\nfunc (x *ListCuratedPluginsResponse) GetPlugins() []*CuratedPlugin {\n\tif x != nil {\n\t\tif x.xxx_hidden_Plugins != nil {\n\t\t\treturn *x.xxx_hidden_Plugins\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListCuratedPluginsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListCuratedPluginsResponse) SetPlugins(v []*CuratedPlugin) {\n\tx.xxx_hidden_Plugins = &v\n}\n\nfunc (x *ListCuratedPluginsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListCuratedPluginsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPlugins []*CuratedPlugin\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListCuratedPluginsResponse_builder) Build() *ListCuratedPluginsResponse {\n\tm0 := &ListCuratedPluginsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Plugins = &b.Plugins\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype GetLatestCuratedPluginRequest struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner                  string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name                   string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Version                string                 `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_Revision               uint32                 `protobuf:\"varint,4,opt,name=revision,proto3\"`\n\txxx_hidden_SupportsRemotePackages bool                   `protobuf:\"varint,5,opt,name=supports_remote_packages,json=supportsRemotePackages,proto3\"`\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *GetLatestCuratedPluginRequest) Reset() {\n\t*x = GetLatestCuratedPluginRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetLatestCuratedPluginRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetLatestCuratedPluginRequest) ProtoMessage() {}\n\nfunc (x *GetLatestCuratedPluginRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[22]\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\nfunc (x *GetLatestCuratedPluginRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetLatestCuratedPluginRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetLatestCuratedPluginRequest) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetLatestCuratedPluginRequest) GetRevision() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Revision\n\t}\n\treturn 0\n}\n\nfunc (x *GetLatestCuratedPluginRequest) GetSupportsRemotePackages() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SupportsRemotePackages\n\t}\n\treturn false\n}\n\nfunc (x *GetLatestCuratedPluginRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetLatestCuratedPluginRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GetLatestCuratedPluginRequest) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *GetLatestCuratedPluginRequest) SetRevision(v uint32) {\n\tx.xxx_hidden_Revision = v\n}\n\nfunc (x *GetLatestCuratedPluginRequest) SetSupportsRemotePackages(v bool) {\n\tx.xxx_hidden_SupportsRemotePackages = v\n}\n\ntype GetLatestCuratedPluginRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the plugin, i.e. \"library\".\n\tOwner string\n\t// The name of the plugin, i.e. \"connect-go\".\n\tName string\n\t// Both version (semver-formatted) and revision are optional, which means\n\t// return the latest plugin.\n\t// If version is set, but revision is omitted, then return the latest\n\t// revision for that version.\n\t// If version and revision are both set, return specific plugin.\n\t// It is an error to set a revision without a corresponding version.\n\tVersion  string\n\tRevision uint32\n\t// If true, will only return versions (and revisions) which support remote packages (registry_type is set).\n\tSupportsRemotePackages bool\n}\n\nfunc (b0 GetLatestCuratedPluginRequest_builder) Build() *GetLatestCuratedPluginRequest {\n\tm0 := &GetLatestCuratedPluginRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_Revision = b.Revision\n\tx.xxx_hidden_SupportsRemotePackages = b.SupportsRemotePackages\n\treturn m0\n}\n\ntype GetLatestCuratedPluginResponse struct {\n\tstate               protoimpl.MessageState            `protogen:\"opaque.v1\"`\n\txxx_hidden_Plugin   *CuratedPlugin                    `protobuf:\"bytes,1,opt,name=plugin,proto3\"`\n\txxx_hidden_Versions *[]*CuratedPluginVersionRevisions `protobuf:\"bytes,2,rep,name=versions,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *GetLatestCuratedPluginResponse) Reset() {\n\t*x = GetLatestCuratedPluginResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetLatestCuratedPluginResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetLatestCuratedPluginResponse) ProtoMessage() {}\n\nfunc (x *GetLatestCuratedPluginResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[23]\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\nfunc (x *GetLatestCuratedPluginResponse) GetPlugin() *CuratedPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Plugin\n\t}\n\treturn nil\n}\n\nfunc (x *GetLatestCuratedPluginResponse) GetVersions() []*CuratedPluginVersionRevisions {\n\tif x != nil {\n\t\tif x.xxx_hidden_Versions != nil {\n\t\t\treturn *x.xxx_hidden_Versions\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetLatestCuratedPluginResponse) SetPlugin(v *CuratedPlugin) {\n\tx.xxx_hidden_Plugin = v\n}\n\nfunc (x *GetLatestCuratedPluginResponse) SetVersions(v []*CuratedPluginVersionRevisions) {\n\tx.xxx_hidden_Versions = &v\n}\n\nfunc (x *GetLatestCuratedPluginResponse) HasPlugin() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Plugin != nil\n}\n\nfunc (x *GetLatestCuratedPluginResponse) ClearPlugin() {\n\tx.xxx_hidden_Plugin = nil\n}\n\ntype GetLatestCuratedPluginResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPlugin *CuratedPlugin\n\t// versions is a semver-sorted list in descending order.\n\tVersions []*CuratedPluginVersionRevisions\n}\n\nfunc (b0 GetLatestCuratedPluginResponse_builder) Build() *GetLatestCuratedPluginResponse {\n\tm0 := &GetLatestCuratedPluginResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Plugin = b.Plugin\n\tx.xxx_hidden_Versions = &b.Versions\n\treturn m0\n}\n\ntype CuratedPluginVersionRevisions struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version   string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\txxx_hidden_Revisions []uint32               `protobuf:\"varint,2,rep,packed,name=revisions,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *CuratedPluginVersionRevisions) Reset() {\n\t*x = CuratedPluginVersionRevisions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[24]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CuratedPluginVersionRevisions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CuratedPluginVersionRevisions) ProtoMessage() {}\n\nfunc (x *CuratedPluginVersionRevisions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[24]\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\nfunc (x *CuratedPluginVersionRevisions) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginVersionRevisions) GetRevisions() []uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Revisions\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPluginVersionRevisions) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *CuratedPluginVersionRevisions) SetRevisions(v []uint32) {\n\tx.xxx_hidden_Revisions = v\n}\n\ntype CuratedPluginVersionRevisions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tVersion string\n\t// revisions is a sorted list in descending order.\n\tRevisions []uint32\n}\n\nfunc (b0 CuratedPluginVersionRevisions_builder) Build() *CuratedPluginVersionRevisions {\n\tm0 := &CuratedPluginVersionRevisions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_Revisions = b.Revisions\n\treturn m0\n}\n\n// RuntimeLibrary describes the runtime library dependency of the generated code.\ntype GoConfig_RuntimeLibrary struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Module  string                 `protobuf:\"bytes,1,opt,name=module,proto3\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,2,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GoConfig_RuntimeLibrary) Reset() {\n\t*x = GoConfig_RuntimeLibrary{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[25]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GoConfig_RuntimeLibrary) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GoConfig_RuntimeLibrary) ProtoMessage() {}\n\nfunc (x *GoConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[25]\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\nfunc (x *GoConfig_RuntimeLibrary) GetModule() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Module\n\t}\n\treturn \"\"\n}\n\nfunc (x *GoConfig_RuntimeLibrary) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GoConfig_RuntimeLibrary) SetModule(v string) {\n\tx.xxx_hidden_Module = v\n}\n\nfunc (x *GoConfig_RuntimeLibrary) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GoConfig_RuntimeLibrary_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the runtime library module, i.e. \"google.golang.org/protobuf\".\n\tModule string\n\t// The version of the runtime library, i.e. \"v1.27.1\".\n\tVersion string\n}\n\nfunc (b0 GoConfig_RuntimeLibrary_builder) Build() *GoConfig_RuntimeLibrary {\n\tm0 := &GoConfig_RuntimeLibrary{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Module = b.Module\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\n// RuntimeLibrary describes the runtime library dependency of the generated code.\ntype NPMConfig_RuntimeLibrary struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Package string                 `protobuf:\"bytes,1,opt,name=package,proto3\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,2,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *NPMConfig_RuntimeLibrary) Reset() {\n\t*x = NPMConfig_RuntimeLibrary{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[26]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NPMConfig_RuntimeLibrary) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NPMConfig_RuntimeLibrary) ProtoMessage() {}\n\nfunc (x *NPMConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[26]\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\nfunc (x *NPMConfig_RuntimeLibrary) GetPackage() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Package\n\t}\n\treturn \"\"\n}\n\nfunc (x *NPMConfig_RuntimeLibrary) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *NPMConfig_RuntimeLibrary) SetPackage(v string) {\n\tx.xxx_hidden_Package = v\n}\n\nfunc (x *NPMConfig_RuntimeLibrary) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype NPMConfig_RuntimeLibrary_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the runtime library package, i.e. \"@grpc/grpc-js\".\n\tPackage string\n\t// The version of the runtime library, i.e. \"^1.27.1\".\n\tVersion string\n}\n\nfunc (b0 NPMConfig_RuntimeLibrary_builder) Build() *NPMConfig_RuntimeLibrary {\n\tm0 := &NPMConfig_RuntimeLibrary{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Package = b.Package\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\n// RuntimeLibrary describes a runtime dependency of the generated code.\ntype MavenConfig_RuntimeLibrary struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_GroupId    string                 `protobuf:\"bytes,1,opt,name=group_id,json=groupId,proto3\"`\n\txxx_hidden_ArtifactId string                 `protobuf:\"bytes,2,opt,name=artifact_id,json=artifactId,proto3\"`\n\txxx_hidden_Version    string                 `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_Classifier string                 `protobuf:\"bytes,4,opt,name=classifier,proto3\"`\n\txxx_hidden_Extension  string                 `protobuf:\"bytes,5,opt,name=extension,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) Reset() {\n\t*x = MavenConfig_RuntimeLibrary{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[27]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MavenConfig_RuntimeLibrary) ProtoMessage() {}\n\nfunc (x *MavenConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[27]\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\nfunc (x *MavenConfig_RuntimeLibrary) GetGroupId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GroupId\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) GetArtifactId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ArtifactId\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) GetClassifier() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Classifier\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) GetExtension() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Extension\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) SetGroupId(v string) {\n\tx.xxx_hidden_GroupId = v\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) SetArtifactId(v string) {\n\tx.xxx_hidden_ArtifactId = v\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) SetClassifier(v string) {\n\tx.xxx_hidden_Classifier = v\n}\n\nfunc (x *MavenConfig_RuntimeLibrary) SetExtension(v string) {\n\tx.xxx_hidden_Extension = v\n}\n\ntype MavenConfig_RuntimeLibrary_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tGroupId    string\n\tArtifactId string\n\tVersion    string\n\tClassifier string\n\tExtension  string\n}\n\nfunc (b0 MavenConfig_RuntimeLibrary_builder) Build() *MavenConfig_RuntimeLibrary {\n\tm0 := &MavenConfig_RuntimeLibrary{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_GroupId = b.GroupId\n\tx.xxx_hidden_ArtifactId = b.ArtifactId\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_Classifier = b.Classifier\n\tx.xxx_hidden_Extension = b.Extension\n\treturn m0\n}\n\n// CompilerConfig contains configuration for the Java and/or Kotlin compiler used when compiling the generated code.\ntype MavenConfig_CompilerConfig struct {\n\tstate             protoimpl.MessageState            `protogen:\"opaque.v1\"`\n\txxx_hidden_Java   *MavenConfig_CompilerJavaConfig   `protobuf:\"bytes,1,opt,name=java,proto3\"`\n\txxx_hidden_Kotlin *MavenConfig_CompilerKotlinConfig `protobuf:\"bytes,2,opt,name=kotlin,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *MavenConfig_CompilerConfig) Reset() {\n\t*x = MavenConfig_CompilerConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[28]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MavenConfig_CompilerConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MavenConfig_CompilerConfig) ProtoMessage() {}\n\nfunc (x *MavenConfig_CompilerConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[28]\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\nfunc (x *MavenConfig_CompilerConfig) GetJava() *MavenConfig_CompilerJavaConfig {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Java\n\t}\n\treturn nil\n}\n\nfunc (x *MavenConfig_CompilerConfig) GetKotlin() *MavenConfig_CompilerKotlinConfig {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Kotlin\n\t}\n\treturn nil\n}\n\nfunc (x *MavenConfig_CompilerConfig) SetJava(v *MavenConfig_CompilerJavaConfig) {\n\tx.xxx_hidden_Java = v\n}\n\nfunc (x *MavenConfig_CompilerConfig) SetKotlin(v *MavenConfig_CompilerKotlinConfig) {\n\tx.xxx_hidden_Kotlin = v\n}\n\nfunc (x *MavenConfig_CompilerConfig) HasJava() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Java != nil\n}\n\nfunc (x *MavenConfig_CompilerConfig) HasKotlin() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Kotlin != nil\n}\n\nfunc (x *MavenConfig_CompilerConfig) ClearJava() {\n\tx.xxx_hidden_Java = nil\n}\n\nfunc (x *MavenConfig_CompilerConfig) ClearKotlin() {\n\tx.xxx_hidden_Kotlin = nil\n}\n\ntype MavenConfig_CompilerConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tJava   *MavenConfig_CompilerJavaConfig\n\tKotlin *MavenConfig_CompilerKotlinConfig\n}\n\nfunc (b0 MavenConfig_CompilerConfig_builder) Build() *MavenConfig_CompilerConfig {\n\tm0 := &MavenConfig_CompilerConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Java = b.Java\n\tx.xxx_hidden_Kotlin = b.Kotlin\n\treturn m0\n}\n\n// CompilerJavaConfig contains settings for the Java compiler.\ntype MavenConfig_CompilerJavaConfig struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Encoding string                 `protobuf:\"bytes,1,opt,name=encoding,proto3\"`\n\txxx_hidden_Release  int32                  `protobuf:\"varint,2,opt,name=release,proto3\"`\n\txxx_hidden_Source   int32                  `protobuf:\"varint,3,opt,name=source,proto3\"`\n\txxx_hidden_Target   int32                  `protobuf:\"varint,4,opt,name=target,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) Reset() {\n\t*x = MavenConfig_CompilerJavaConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[29]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MavenConfig_CompilerJavaConfig) ProtoMessage() {}\n\nfunc (x *MavenConfig_CompilerJavaConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[29]\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\nfunc (x *MavenConfig_CompilerJavaConfig) GetEncoding() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Encoding\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) GetRelease() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Release\n\t}\n\treturn 0\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) GetSource() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Source\n\t}\n\treturn 0\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) GetTarget() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Target\n\t}\n\treturn 0\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) SetEncoding(v string) {\n\tx.xxx_hidden_Encoding = v\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) SetRelease(v int32) {\n\tx.xxx_hidden_Release = v\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) SetSource(v int32) {\n\tx.xxx_hidden_Source = v\n}\n\nfunc (x *MavenConfig_CompilerJavaConfig) SetTarget(v int32) {\n\tx.xxx_hidden_Target = v\n}\n\ntype MavenConfig_CompilerJavaConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// File encoding (default: UTF-8).\n\tEncoding string\n\t// Release version (default: 8).\n\tRelease int32\n\t// Source version (default: 8).\n\tSource int32\n\t// Target version (default: 8).\n\tTarget int32\n}\n\nfunc (b0 MavenConfig_CompilerJavaConfig_builder) Build() *MavenConfig_CompilerJavaConfig {\n\tm0 := &MavenConfig_CompilerJavaConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Encoding = b.Encoding\n\tx.xxx_hidden_Release = b.Release\n\tx.xxx_hidden_Source = b.Source\n\tx.xxx_hidden_Target = b.Target\n\treturn m0\n}\n\n// CompilerKotlinConfig contains settings for the Kotlin compiler.\ntype MavenConfig_CompilerKotlinConfig struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version         string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\txxx_hidden_ApiVersion      string                 `protobuf:\"bytes,2,opt,name=api_version,json=apiVersion,proto3\"`\n\txxx_hidden_JvmTarget       string                 `protobuf:\"bytes,3,opt,name=jvm_target,json=jvmTarget,proto3\"`\n\txxx_hidden_LanguageVersion string                 `protobuf:\"bytes,4,opt,name=language_version,json=languageVersion,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) Reset() {\n\t*x = MavenConfig_CompilerKotlinConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[30]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MavenConfig_CompilerKotlinConfig) ProtoMessage() {}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[30]\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\nfunc (x *MavenConfig_CompilerKotlinConfig) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) GetApiVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ApiVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) GetJvmTarget() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_JvmTarget\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) GetLanguageVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LanguageVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) SetApiVersion(v string) {\n\tx.xxx_hidden_ApiVersion = v\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) SetJvmTarget(v string) {\n\tx.xxx_hidden_JvmTarget = v\n}\n\nfunc (x *MavenConfig_CompilerKotlinConfig) SetLanguageVersion(v string) {\n\tx.xxx_hidden_LanguageVersion = v\n}\n\ntype MavenConfig_CompilerKotlinConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Version of the Kotlin compiler used to compile the generated code.\n\tVersion string\n\t// Version of the Kotlin API to target.\n\tApiVersion string\n\t// Target version of the JVM bytecode (default: 1.8).\n\tJvmTarget string\n\t// Kotlin language version used for source compatibility.\n\tLanguageVersion string\n}\n\nfunc (b0 MavenConfig_CompilerKotlinConfig_builder) Build() *MavenConfig_CompilerKotlinConfig {\n\tm0 := &MavenConfig_CompilerKotlinConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_ApiVersion = b.ApiVersion\n\tx.xxx_hidden_JvmTarget = b.JvmTarget\n\tx.xxx_hidden_LanguageVersion = b.LanguageVersion\n\treturn m0\n}\n\n// RuntimeConfig allows configuring additional runtimes (like the 'lite' runtime).\n// They can use different runtime dependencies and plugin options.\ntype MavenConfig_RuntimeConfig struct {\n\tstate                       protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_Name             string                         `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_RuntimeLibraries *[]*MavenConfig_RuntimeLibrary `protobuf:\"bytes,2,rep,name=runtime_libraries,json=runtimeLibraries,proto3\"`\n\txxx_hidden_Options          []string                       `protobuf:\"bytes,3,rep,name=options,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *MavenConfig_RuntimeConfig) Reset() {\n\t*x = MavenConfig_RuntimeConfig{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[31]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *MavenConfig_RuntimeConfig) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*MavenConfig_RuntimeConfig) ProtoMessage() {}\n\nfunc (x *MavenConfig_RuntimeConfig) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[31]\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\nfunc (x *MavenConfig_RuntimeConfig) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *MavenConfig_RuntimeConfig) GetRuntimeLibraries() []*MavenConfig_RuntimeLibrary {\n\tif x != nil {\n\t\tif x.xxx_hidden_RuntimeLibraries != nil {\n\t\t\treturn *x.xxx_hidden_RuntimeLibraries\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *MavenConfig_RuntimeConfig) GetOptions() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Options\n\t}\n\treturn nil\n}\n\nfunc (x *MavenConfig_RuntimeConfig) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *MavenConfig_RuntimeConfig) SetRuntimeLibraries(v []*MavenConfig_RuntimeLibrary) {\n\tx.xxx_hidden_RuntimeLibraries = &v\n}\n\nfunc (x *MavenConfig_RuntimeConfig) SetOptions(v []string) {\n\tx.xxx_hidden_Options = v\n}\n\ntype MavenConfig_RuntimeConfig_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tName             string\n\tRuntimeLibraries []*MavenConfig_RuntimeLibrary\n\t// The options to pass to the plugin. These will\n\t// be merged into a single, comma-separated string.\n\tOptions []string\n}\n\nfunc (b0 MavenConfig_RuntimeConfig_builder) Build() *MavenConfig_RuntimeConfig {\n\tm0 := &MavenConfig_RuntimeConfig{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_RuntimeLibraries = &b.RuntimeLibraries\n\tx.xxx_hidden_Options = b.Options\n\treturn m0\n}\n\n// RuntimeLibrary describes a NuGet package dependency of the generated code.\n// Ref: https://learn.microsoft.com/en-us/dotnet/core/tools/dependencies#the-packagereference-element\ntype NugetConfig_RuntimeLibrary struct {\n\tstate                       protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_Name             string                  `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Version          string                  `protobuf:\"bytes,2,opt,name=version,proto3\"`\n\txxx_hidden_TargetFrameworks []DotnetTargetFramework `protobuf:\"varint,3,rep,packed,name=target_frameworks,json=targetFrameworks,proto3,enum=buf.alpha.registry.v1alpha1.DotnetTargetFramework\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *NugetConfig_RuntimeLibrary) Reset() {\n\t*x = NugetConfig_RuntimeLibrary{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[32]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *NugetConfig_RuntimeLibrary) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*NugetConfig_RuntimeLibrary) ProtoMessage() {}\n\nfunc (x *NugetConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[32]\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\nfunc (x *NugetConfig_RuntimeLibrary) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *NugetConfig_RuntimeLibrary) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *NugetConfig_RuntimeLibrary) GetTargetFrameworks() []DotnetTargetFramework {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TargetFrameworks\n\t}\n\treturn nil\n}\n\nfunc (x *NugetConfig_RuntimeLibrary) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *NugetConfig_RuntimeLibrary) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *NugetConfig_RuntimeLibrary) SetTargetFrameworks(v []DotnetTargetFramework) {\n\tx.xxx_hidden_TargetFrameworks = v\n}\n\ntype NugetConfig_RuntimeLibrary_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the NuGet package (also known as the package ID).\n\tName string\n\t// The version of the NuGet package (supports ranges).\n\t// Ref: https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges\n\tVersion string\n\t// Optional target frameworks. If specified, these dependencies will be\n\t// conditionally added when building for the specified target framework.\n\tTargetFrameworks []DotnetTargetFramework\n}\n\nfunc (b0 NugetConfig_RuntimeLibrary_builder) Build() *NugetConfig_RuntimeLibrary {\n\tm0 := &NugetConfig_RuntimeLibrary{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_TargetFrameworks = b.TargetFrameworks\n\treturn m0\n}\n\n// RuntimeLibrary describes a runtime library dependency of the generated code.\ntype SwiftConfig_RuntimeLibrary struct {\n\tstate                    protoimpl.MessageState                  `protogen:\"opaque.v1\"`\n\txxx_hidden_Source        string                                  `protobuf:\"bytes,1,opt,name=source,proto3\"`\n\txxx_hidden_Package       string                                  `protobuf:\"bytes,2,opt,name=package,proto3\"`\n\txxx_hidden_Version       string                                  `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_Products      []string                                `protobuf:\"bytes,4,rep,name=products,proto3\"`\n\txxx_hidden_Platforms     *[]*SwiftConfig_RuntimeLibrary_Platform `protobuf:\"bytes,5,rep,name=platforms,proto3\"`\n\txxx_hidden_SwiftVersions []string                                `protobuf:\"bytes,6,rep,name=swift_versions,json=swiftVersions,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) Reset() {\n\t*x = SwiftConfig_RuntimeLibrary{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[33]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SwiftConfig_RuntimeLibrary) ProtoMessage() {}\n\nfunc (x *SwiftConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[33]\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\nfunc (x *SwiftConfig_RuntimeLibrary) GetSource() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Source\n\t}\n\treturn \"\"\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) GetPackage() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Package\n\t}\n\treturn \"\"\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) GetProducts() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Products\n\t}\n\treturn nil\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) GetPlatforms() []*SwiftConfig_RuntimeLibrary_Platform {\n\tif x != nil {\n\t\tif x.xxx_hidden_Platforms != nil {\n\t\t\treturn *x.xxx_hidden_Platforms\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) GetSwiftVersions() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SwiftVersions\n\t}\n\treturn nil\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) SetSource(v string) {\n\tx.xxx_hidden_Source = v\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) SetPackage(v string) {\n\tx.xxx_hidden_Package = v\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) SetProducts(v []string) {\n\tx.xxx_hidden_Products = v\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) SetPlatforms(v []*SwiftConfig_RuntimeLibrary_Platform) {\n\tx.xxx_hidden_Platforms = &v\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary) SetSwiftVersions(v []string) {\n\tx.xxx_hidden_SwiftVersions = v\n}\n\ntype SwiftConfig_RuntimeLibrary_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The source of the runtime library package, e.g. https://github.com/apple/swift-protobuf.git.\n\tSource string\n\t// The name of the runtime library package, e.g. \"swift-protobuf\".\n\tPackage string\n\t// The version of the runtime library, e.g. \"1.21.0\".\n\tVersion string\n\t// The products exported by the runtime library, e.g. \"SwiftProtobuf\".\n\tProducts []string\n\t// The minimum compatible platform versions of the runtime library.\n\tPlatforms []*SwiftConfig_RuntimeLibrary_Platform\n\t// The supported Swift language versions of the runtime library, e.g. \".v5\".\n\tSwiftVersions []string\n}\n\nfunc (b0 SwiftConfig_RuntimeLibrary_builder) Build() *SwiftConfig_RuntimeLibrary {\n\tm0 := &SwiftConfig_RuntimeLibrary{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Source = b.Source\n\tx.xxx_hidden_Package = b.Package\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_Products = b.Products\n\tx.xxx_hidden_Platforms = &b.Platforms\n\tx.xxx_hidden_SwiftVersions = b.SwiftVersions\n\treturn m0\n}\n\n// The minimum compatible platform versions of the runtime library.\ntype SwiftConfig_RuntimeLibrary_Platform struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name    SwiftPlatformType      `protobuf:\"varint,1,opt,name=name,proto3,enum=buf.alpha.registry.v1alpha1.SwiftPlatformType\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,2,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary_Platform) Reset() {\n\t*x = SwiftConfig_RuntimeLibrary_Platform{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[34]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary_Platform) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SwiftConfig_RuntimeLibrary_Platform) ProtoMessage() {}\n\nfunc (x *SwiftConfig_RuntimeLibrary_Platform) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[34]\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\nfunc (x *SwiftConfig_RuntimeLibrary_Platform) GetName() SwiftPlatformType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn SwiftPlatformType_SWIFT_PLATFORM_TYPE_UNSPECIFIED\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary_Platform) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary_Platform) SetName(v SwiftPlatformType) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *SwiftConfig_RuntimeLibrary_Platform) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype SwiftConfig_RuntimeLibrary_Platform_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the platform.\n\tName SwiftPlatformType\n\t// The minimum compatible version of the platform.\n\tVersion string\n}\n\nfunc (b0 SwiftConfig_RuntimeLibrary_Platform_builder) Build() *SwiftConfig_RuntimeLibrary_Platform {\n\tm0 := &SwiftConfig_RuntimeLibrary_Platform{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype PythonConfig_RuntimeLibrary struct {\n\tstate                              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_DependencySpecification string                 `protobuf:\"bytes,1,opt,name=dependency_specification,json=dependencySpecification,proto3\"`\n\tunknownFields                      protoimpl.UnknownFields\n\tsizeCache                          protoimpl.SizeCache\n}\n\nfunc (x *PythonConfig_RuntimeLibrary) Reset() {\n\t*x = PythonConfig_RuntimeLibrary{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[35]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PythonConfig_RuntimeLibrary) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PythonConfig_RuntimeLibrary) ProtoMessage() {}\n\nfunc (x *PythonConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[35]\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\nfunc (x *PythonConfig_RuntimeLibrary) GetDependencySpecification() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DependencySpecification\n\t}\n\treturn \"\"\n}\n\nfunc (x *PythonConfig_RuntimeLibrary) SetDependencySpecification(v string) {\n\tx.xxx_hidden_DependencySpecification = v\n}\n\ntype PythonConfig_RuntimeLibrary_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// dependency_specification is a PEP 508 Dependency Specification.\n\t// Ref: https://peps.python.org/pep-0508/\n\tDependencySpecification string\n}\n\nfunc (b0 PythonConfig_RuntimeLibrary_builder) Build() *PythonConfig_RuntimeLibrary {\n\tm0 := &PythonConfig_RuntimeLibrary{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_DependencySpecification = b.DependencySpecification\n\treturn m0\n}\n\n// RuntimeLibrary specifies a runtime dependency for a generated crate.\n// It is the subset of a full Cargo dependency specification, which contains\n// fields that are irrelevant for Generated SDKs.\n// Ref: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html\ntype CargoConfig_RuntimeLibrary struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name               string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_VersionRequirement string                 `protobuf:\"bytes,2,opt,name=version_requirement,json=versionRequirement,proto3\"`\n\txxx_hidden_DefaultFeatures    bool                   `protobuf:\"varint,3,opt,name=default_features,json=defaultFeatures,proto3\"`\n\txxx_hidden_Features           []string               `protobuf:\"bytes,4,rep,name=features,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) Reset() {\n\t*x = CargoConfig_RuntimeLibrary{}\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[36]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CargoConfig_RuntimeLibrary) ProtoMessage() {}\n\nfunc (x *CargoConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[36]\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\nfunc (x *CargoConfig_RuntimeLibrary) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) GetVersionRequirement() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_VersionRequirement\n\t}\n\treturn \"\"\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) GetDefaultFeatures() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DefaultFeatures\n\t}\n\treturn false\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) GetFeatures() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Features\n\t}\n\treturn nil\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) SetVersionRequirement(v string) {\n\tx.xxx_hidden_VersionRequirement = v\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) SetDefaultFeatures(v bool) {\n\tx.xxx_hidden_DefaultFeatures = v\n}\n\nfunc (x *CargoConfig_RuntimeLibrary) SetFeatures(v []string) {\n\tx.xxx_hidden_Features = v\n}\n\ntype CargoConfig_RuntimeLibrary_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// name specifies the name of the dependency.\n\tName string\n\t// version_requirement specifies the version requirement of the dependency.\n\tVersionRequirement string\n\t// default_features specifies whether or not default features will be enabled for the dependency.\n\tDefaultFeatures bool\n\t// features specifies the features enabled for the dependency.\n\tFeatures []string\n}\n\nfunc (b0 CargoConfig_RuntimeLibrary_builder) Build() *CargoConfig_RuntimeLibrary {\n\tm0 := &CargoConfig_RuntimeLibrary{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_VersionRequirement = b.VersionRequirement\n\tx.xxx_hidden_DefaultFeatures = b.DefaultFeatures\n\tx.xxx_hidden_Features = b.Features\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_plugin_curation_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"1buf/alpha/registry/v1alpha1/plugin_curation.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1ebuf/alpha/image/v1/image.proto\\x1a%google/protobuf/compiler/plugin.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xfb\\x01\\n\" +\n\t\"\\bGoConfig\\x12a\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x01 \\x03(\\v24.buf.alpha.registry.v1alpha1.GoConfig.RuntimeLibraryR\\x10runtimeLibraries\\x12'\\n\" +\n\t\"\\x0fminimum_version\\x18\\x02 \\x01(\\tR\\x0eminimumVersion\\x12\\x1f\\n\" +\n\t\"\\vbase_plugin\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"basePlugin\\x1aB\\n\" +\n\t\"\\x0eRuntimeLibrary\\x12\\x16\\n\" +\n\t\"\\x06module\\x18\\x01 \\x01(\\tR\\x06module\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x02 \\x01(\\tR\\aversion\\\"\\xc2\\x02\\n\" +\n\t\"\\tNPMConfig\\x12b\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x01 \\x03(\\v25.buf.alpha.registry.v1alpha1.NPMConfig.RuntimeLibraryR\\x10runtimeLibraries\\x12;\\n\" +\n\t\"\\x1arewrite_import_path_suffix\\x18\\x02 \\x01(\\tR\\x17rewriteImportPathSuffix\\x12N\\n\" +\n\t\"\\fimport_style\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.NPMImportStyleR\\vimportStyle\\x1aD\\n\" +\n\t\"\\x0eRuntimeLibrary\\x12\\x18\\n\" +\n\t\"\\apackage\\x18\\x01 \\x01(\\tR\\apackage\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x02 \\x01(\\tR\\aversion\\\"\\xd3\\b\\n\" +\n\t\"\\vMavenConfig\\x12d\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x01 \\x03(\\v27.buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibraryR\\x10runtimeLibraries\\x12S\\n\" +\n\t\"\\bcompiler\\x18\\x02 \\x01(\\v27.buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfigR\\bcompiler\\x12g\\n\" +\n\t\"\\x13additional_runtimes\\x18\\x03 \\x03(\\v26.buf.alpha.registry.v1alpha1.MavenConfig.RuntimeConfigR\\x12additionalRuntimes\\x1a\\xa4\\x01\\n\" +\n\t\"\\x0eRuntimeLibrary\\x12\\x19\\n\" +\n\t\"\\bgroup_id\\x18\\x01 \\x01(\\tR\\agroupId\\x12\\x1f\\n\" +\n\t\"\\vartifact_id\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"artifactId\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"classifier\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"classifier\\x12\\x1c\\n\" +\n\t\"\\textension\\x18\\x05 \\x01(\\tR\\textension\\x1a\\xb8\\x01\\n\" +\n\t\"\\x0eCompilerConfig\\x12O\\n\" +\n\t\"\\x04java\\x18\\x01 \\x01(\\v2;.buf.alpha.registry.v1alpha1.MavenConfig.CompilerJavaConfigR\\x04java\\x12U\\n\" +\n\t\"\\x06kotlin\\x18\\x02 \\x01(\\v2=.buf.alpha.registry.v1alpha1.MavenConfig.CompilerKotlinConfigR\\x06kotlin\\x1az\\n\" +\n\t\"\\x12CompilerJavaConfig\\x12\\x1a\\n\" +\n\t\"\\bencoding\\x18\\x01 \\x01(\\tR\\bencoding\\x12\\x18\\n\" +\n\t\"\\arelease\\x18\\x02 \\x01(\\x05R\\arelease\\x12\\x16\\n\" +\n\t\"\\x06source\\x18\\x03 \\x01(\\x05R\\x06source\\x12\\x16\\n\" +\n\t\"\\x06target\\x18\\x04 \\x01(\\x05R\\x06target\\x1a\\x9b\\x01\\n\" +\n\t\"\\x14CompilerKotlinConfig\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\x12\\x1f\\n\" +\n\t\"\\vapi_version\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"apiVersion\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"jvm_target\\x18\\x03 \\x01(\\tR\\tjvmTarget\\x12)\\n\" +\n\t\"\\x10language_version\\x18\\x04 \\x01(\\tR\\x0flanguageVersion\\x1a\\xa3\\x01\\n\" +\n\t\"\\rRuntimeConfig\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12d\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x02 \\x03(\\v27.buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibraryR\\x10runtimeLibraries\\x12\\x18\\n\" +\n\t\"\\aoptions\\x18\\x03 \\x03(\\tR\\aoptions\\\"\\xf6\\x02\\n\" +\n\t\"\\vNugetConfig\\x12_\\n\" +\n\t\"\\x11target_frameworks\\x18\\x01 \\x03(\\x0e22.buf.alpha.registry.v1alpha1.DotnetTargetFrameworkR\\x10targetFrameworks\\x12d\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x02 \\x03(\\v27.buf.alpha.registry.v1alpha1.NugetConfig.RuntimeLibraryR\\x10runtimeLibraries\\x1a\\x9f\\x01\\n\" +\n\t\"\\x0eRuntimeLibrary\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x02 \\x01(\\tR\\aversion\\x12_\\n\" +\n\t\"\\x11target_frameworks\\x18\\x03 \\x03(\\x0e22.buf.alpha.registry.v1alpha1.DotnetTargetFrameworkR\\x10targetFrameworks\\\"\\r\\n\" +\n\t\"\\vCmakeConfig\\\"\\xdf\\x03\\n\" +\n\t\"\\vSwiftConfig\\x12d\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x01 \\x03(\\v27.buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibraryR\\x10runtimeLibraries\\x1a\\xe9\\x02\\n\" +\n\t\"\\x0eRuntimeLibrary\\x12\\x16\\n\" +\n\t\"\\x06source\\x18\\x01 \\x01(\\tR\\x06source\\x12\\x18\\n\" +\n\t\"\\apackage\\x18\\x02 \\x01(\\tR\\apackage\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12\\x1a\\n\" +\n\t\"\\bproducts\\x18\\x04 \\x03(\\tR\\bproducts\\x12^\\n\" +\n\t\"\\tplatforms\\x18\\x05 \\x03(\\v2@.buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.PlatformR\\tplatforms\\x12%\\n\" +\n\t\"\\x0eswift_versions\\x18\\x06 \\x03(\\tR\\rswiftVersions\\x1ah\\n\" +\n\t\"\\bPlatform\\x12B\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\x0e2..buf.alpha.registry.v1alpha1.SwiftPlatformTypeR\\x04name\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x02 \\x01(\\tR\\aversion\\\"\\xbe\\x02\\n\" +\n\t\"\\fPythonConfig\\x12e\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x01 \\x03(\\v28.buf.alpha.registry.v1alpha1.PythonConfig.RuntimeLibraryR\\x10runtimeLibraries\\x12'\\n\" +\n\t\"\\x0frequires_python\\x18\\x02 \\x01(\\tR\\x0erequiresPython\\x12Q\\n\" +\n\t\"\\fpackage_type\\x18\\x03 \\x01(\\x0e2..buf.alpha.registry.v1alpha1.PythonPackageTypeR\\vpackageType\\x1aK\\n\" +\n\t\"\\x0eRuntimeLibrary\\x129\\n\" +\n\t\"\\x18dependency_specification\\x18\\x01 \\x01(\\tR\\x17dependencySpecification\\\"\\xb5\\x02\\n\" +\n\t\"\\vCargoConfig\\x12!\\n\" +\n\t\"\\frust_version\\x18\\x01 \\x01(\\tR\\vrustVersion\\x12d\\n\" +\n\t\"\\x11runtime_libraries\\x18\\x02 \\x03(\\v27.buf.alpha.registry.v1alpha1.CargoConfig.RuntimeLibraryR\\x10runtimeLibraries\\x1a\\x9c\\x01\\n\" +\n\t\"\\x0eRuntimeLibrary\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12/\\n\" +\n\t\"\\x13version_requirement\\x18\\x02 \\x01(\\tR\\x12versionRequirement\\x12)\\n\" +\n\t\"\\x10default_features\\x18\\x03 \\x01(\\bR\\x0fdefaultFeatures\\x12\\x1a\\n\" +\n\t\"\\bfeatures\\x18\\x04 \\x03(\\tR\\bfeatures\\\"\\xaf\\x05\\n\" +\n\t\"\\x0eRegistryConfig\\x12D\\n\" +\n\t\"\\tgo_config\\x18\\x01 \\x01(\\v2%.buf.alpha.registry.v1alpha1.GoConfigH\\x00R\\bgoConfig\\x12G\\n\" +\n\t\"\\n\" +\n\t\"npm_config\\x18\\x02 \\x01(\\v2&.buf.alpha.registry.v1alpha1.NPMConfigH\\x00R\\tnpmConfig\\x12M\\n\" +\n\t\"\\fmaven_config\\x18\\x03 \\x01(\\v2(.buf.alpha.registry.v1alpha1.MavenConfigH\\x00R\\vmavenConfig\\x12M\\n\" +\n\t\"\\fswift_config\\x18\\x04 \\x01(\\v2(.buf.alpha.registry.v1alpha1.SwiftConfigH\\x00R\\vswiftConfig\\x12P\\n\" +\n\t\"\\rpython_config\\x18\\x05 \\x01(\\v2).buf.alpha.registry.v1alpha1.PythonConfigH\\x00R\\fpythonConfig\\x12M\\n\" +\n\t\"\\fcargo_config\\x18\\x06 \\x01(\\v2(.buf.alpha.registry.v1alpha1.CargoConfigH\\x00R\\vcargoConfig\\x12M\\n\" +\n\t\"\\fnuget_config\\x18\\a \\x01(\\v2(.buf.alpha.registry.v1alpha1.NugetConfigH\\x00R\\vnugetConfig\\x12M\\n\" +\n\t\"\\fcmake_config\\x18\\b \\x01(\\v2(.buf.alpha.registry.v1alpha1.CmakeConfigH\\x00R\\vcmakeConfig\\x12\\x18\\n\" +\n\t\"\\aoptions\\x18\\n\" +\n\t\" \\x03(\\tR\\aoptionsB\\x11\\n\" +\n\t\"\\x0fregistry_configJ\\x04\\b\\t\\x10\\n\" +\n\t\"\\\"x\\n\" +\n\t\"\\x16CuratedPluginReference\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12\\x1a\\n\" +\n\t\"\\brevision\\x18\\x04 \\x01(\\rR\\brevision\\\"\\xb3\\b\\n\" +\n\t\"\\rCuratedPlugin\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x02 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x03 \\x01(\\tR\\x04name\\x12T\\n\" +\n\t\"\\rregistry_type\\x18\\x04 \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.PluginRegistryTypeR\\fregistryType\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x05 \\x01(\\tR\\aversion\\x124\\n\" +\n\t\"\\x16container_image_digest\\x18\\x06 \\x01(\\tR\\x14containerImageDigest\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\b \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12W\\n\" +\n\t\"\\fdependencies\\x18\\t \\x03(\\v23.buf.alpha.registry.v1alpha1.CuratedPluginReferenceR\\fdependencies\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"source_url\\x18\\n\" +\n\t\" \\x01(\\tR\\tsourceUrl\\x12 \\n\" +\n\t\"\\vdescription\\x18\\v \\x01(\\tR\\vdescription\\x12T\\n\" +\n\t\"\\x0fregistry_config\\x18\\f \\x01(\\v2+.buf.alpha.registry.v1alpha1.RegistryConfigR\\x0eregistryConfig\\x12\\x1a\\n\" +\n\t\"\\brevision\\x18\\r \\x01(\\rR\\brevision\\x12V\\n\" +\n\t\"\\x10output_languages\\x18\\x0e \\x03(\\x0e2+.buf.alpha.registry.v1alpha1.PluginLanguageR\\x0foutputLanguages\\x12&\\n\" +\n\t\"\\x0fspdx_license_id\\x18\\x0f \\x01(\\tR\\rspdxLicenseId\\x12\\x1f\\n\" +\n\t\"\\vlicense_url\\x18\\x10 \\x01(\\tR\\n\" +\n\t\"licenseUrl\\x12\\x1a\\n\" +\n\t\"\\bverified\\x18\\x11 \\x01(\\bR\\bverified\\x12T\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x12 \\x01(\\x0e24.buf.alpha.registry.v1alpha1.CuratedPluginVisibilityR\\n\" +\n\t\"visibility\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x13 \\x01(\\bR\\n\" +\n\t\"deprecated\\x12/\\n\" +\n\t\"\\x13deprecation_message\\x18\\x14 \\x01(\\tR\\x12deprecationMessage\\x122\\n\" +\n\t\"\\x15integration_guide_url\\x18\\x15 \\x01(\\tR\\x13integrationGuideUrl\\x12\\x10\\n\" +\n\t\"\\x03doc\\x18\\x16 \\x01(\\tR\\x03doc\\x12O\\n\" +\n\t\"\\vcollections\\x18\\x17 \\x03(\\v2-.buf.alpha.registry.v1alpha1.PluginCollectionR\\vcollections\\\"&\\n\" +\n\t\"\\x10PluginCollection\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\\"\\xfa\\x01\\n\" +\n\t\"\\x13GenerateCodeRequest\\x12/\\n\" +\n\t\"\\x05image\\x18\\x01 \\x01(\\v2\\x19.buf.alpha.image.v1.ImageR\\x05image\\x12P\\n\" +\n\t\"\\brequests\\x18\\x02 \\x03(\\v24.buf.alpha.registry.v1alpha1.PluginGenerationRequestR\\brequests\\x12'\\n\" +\n\t\"\\x0finclude_imports\\x18\\x03 \\x01(\\bR\\x0eincludeImports\\x127\\n\" +\n\t\"\\x18include_well_known_types\\x18\\x04 \\x01(\\bR\\x15includeWellKnownTypes\\\"k\\n\" +\n\t\"\\x14GenerateCodeResponse\\x12S\\n\" +\n\t\"\\tresponses\\x18\\x01 \\x03(\\v25.buf.alpha.registry.v1alpha1.PluginGenerationResponseR\\tresponses\\\"\\xb0\\x02\\n\" +\n\t\"\\x17PluginGenerationRequest\\x12^\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v23.buf.alpha.registry.v1alpha1.CuratedPluginReferenceR\\x0fpluginReference\\x12\\x18\\n\" +\n\t\"\\aoptions\\x18\\x02 \\x03(\\tR\\aoptions\\x12,\\n\" +\n\t\"\\x0finclude_imports\\x18\\x03 \\x01(\\bH\\x00R\\x0eincludeImports\\x88\\x01\\x01\\x12<\\n\" +\n\t\"\\x18include_well_known_types\\x18\\x04 \\x01(\\bH\\x01R\\x15includeWellKnownTypes\\x88\\x01\\x01B\\x12\\n\" +\n\t\"\\x10_include_importsB\\x1b\\n\" +\n\t\"\\x19_include_well_known_types\\\"g\\n\" +\n\t\"\\x18PluginGenerationResponse\\x12K\\n\" +\n\t\"\\bresponse\\x18\\x01 \\x01(\\v2/.google.protobuf.compiler.CodeGeneratorResponseR\\bresponse\\\"`\\n\" +\n\t\"\\x1aDeleteCuratedPluginRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\\"\\x1d\\n\" +\n\t\"\\x1bDeleteCuratedPluginResponse\\\"\\xc3\\x06\\n\" +\n\t\"\\x1aCreateCuratedPluginRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12T\\n\" +\n\t\"\\rregistry_type\\x18\\x03 \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.PluginRegistryTypeR\\fregistryType\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x04 \\x01(\\tR\\aversion\\x124\\n\" +\n\t\"\\x16container_image_digest\\x18\\x05 \\x01(\\tR\\x14containerImageDigest\\x12W\\n\" +\n\t\"\\fdependencies\\x18\\a \\x03(\\v23.buf.alpha.registry.v1alpha1.CuratedPluginReferenceR\\fdependencies\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"source_url\\x18\\b \\x01(\\tR\\tsourceUrl\\x12 \\n\" +\n\t\"\\vdescription\\x18\\t \\x01(\\tR\\vdescription\\x12T\\n\" +\n\t\"\\x0fregistry_config\\x18\\f \\x01(\\v2+.buf.alpha.registry.v1alpha1.RegistryConfigR\\x0eregistryConfig\\x12\\x1a\\n\" +\n\t\"\\brevision\\x18\\r \\x01(\\rR\\brevision\\x12V\\n\" +\n\t\"\\x10output_languages\\x18\\x0e \\x03(\\x0e2+.buf.alpha.registry.v1alpha1.PluginLanguageR\\x0foutputLanguages\\x12&\\n\" +\n\t\"\\x0fspdx_license_id\\x18\\x0f \\x01(\\tR\\rspdxLicenseId\\x12\\x1f\\n\" +\n\t\"\\vlicense_url\\x18\\x10 \\x01(\\tR\\n\" +\n\t\"licenseUrl\\x12T\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x11 \\x01(\\x0e24.buf.alpha.registry.v1alpha1.CuratedPluginVisibilityR\\n\" +\n\t\"visibility\\x122\\n\" +\n\t\"\\x15integration_guide_url\\x18\\x12 \\x01(\\tR\\x13integrationGuideUrl\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x13 \\x01(\\bR\\n\" +\n\t\"deprecated\\\"o\\n\" +\n\t\"\\x1bCreateCuratedPluginResponse\\x12P\\n\" +\n\t\"\\rconfiguration\\x18\\x01 \\x01(\\v2*.buf.alpha.registry.v1alpha1.CuratedPluginR\\rconfiguration\\\"\\xda\\x01\\n\" +\n\t\"\\x19ListCuratedPluginsRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\x128\\n\" +\n\t\"\\x18supports_remote_packages\\x18\\x04 \\x01(\\bR\\x16supportsRemotePackages\\x12-\\n\" +\n\t\"\\x12include_deprecated\\x18\\x05 \\x01(\\bR\\x11includeDeprecated\\\"\\x8a\\x01\\n\" +\n\t\"\\x1aListCuratedPluginsResponse\\x12D\\n\" +\n\t\"\\aplugins\\x18\\x01 \\x03(\\v2*.buf.alpha.registry.v1alpha1.CuratedPluginR\\aplugins\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\xb9\\x01\\n\" +\n\t\"\\x1dGetLatestCuratedPluginRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12\\x1a\\n\" +\n\t\"\\brevision\\x18\\x04 \\x01(\\rR\\brevision\\x128\\n\" +\n\t\"\\x18supports_remote_packages\\x18\\x05 \\x01(\\bR\\x16supportsRemotePackages\\\"\\xbc\\x01\\n\" +\n\t\"\\x1eGetLatestCuratedPluginResponse\\x12B\\n\" +\n\t\"\\x06plugin\\x18\\x01 \\x01(\\v2*.buf.alpha.registry.v1alpha1.CuratedPluginR\\x06plugin\\x12V\\n\" +\n\t\"\\bversions\\x18\\x02 \\x03(\\v2:.buf.alpha.registry.v1alpha1.CuratedPluginVersionRevisionsR\\bversions\\\"W\\n\" +\n\t\"\\x1dCuratedPluginVersionRevisions\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\x12\\x1c\\n\" +\n\t\"\\trevisions\\x18\\x02 \\x03(\\rR\\trevisions*\\x91\\x01\\n\" +\n\t\"\\x17CuratedPluginVisibility\\x12)\\n\" +\n\t\"%CURATED_PLUGIN_VISIBILITY_UNSPECIFIED\\x10\\x00\\x12$\\n\" +\n\t\" CURATED_PLUGIN_VISIBILITY_PUBLIC\\x10\\x01\\x12%\\n\" +\n\t\"!CURATED_PLUGIN_VISIBILITY_PRIVATE\\x10\\x02*\\xda\\x02\\n\" +\n\t\"\\x12PluginRegistryType\\x12$\\n\" +\n\t\" PLUGIN_REGISTRY_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x1b\\n\" +\n\t\"\\x17PLUGIN_REGISTRY_TYPE_GO\\x10\\x01\\x12\\x1c\\n\" +\n\t\"\\x18PLUGIN_REGISTRY_TYPE_NPM\\x10\\x02\\x12\\x1e\\n\" +\n\t\"\\x1aPLUGIN_REGISTRY_TYPE_MAVEN\\x10\\x03\\x12\\x1e\\n\" +\n\t\"\\x1aPLUGIN_REGISTRY_TYPE_SWIFT\\x10\\x04\\x12\\x1f\\n\" +\n\t\"\\x1bPLUGIN_REGISTRY_TYPE_PYTHON\\x10\\x05\\x12\\x1e\\n\" +\n\t\"\\x1aPLUGIN_REGISTRY_TYPE_CARGO\\x10\\a\\x12\\x1e\\n\" +\n\t\"\\x1aPLUGIN_REGISTRY_TYPE_NUGET\\x10\\b\\x12\\x1e\\n\" +\n\t\"\\x1aPLUGIN_REGISTRY_TYPE_CMAKE\\x10\\t\\\"\\x04\\b\\x06\\x10\\x06*\\x1cPLUGIN_REGISTRY_TYPE_ARCHIVE*\\xe5\\x03\\n\" +\n\t\"\\x0ePluginLanguage\\x12\\x1f\\n\" +\n\t\"\\x1bPLUGIN_LANGUAGE_UNSPECIFIED\\x10\\x00\\x12\\x16\\n\" +\n\t\"\\x12PLUGIN_LANGUAGE_GO\\x10\\x01\\x12\\x1e\\n\" +\n\t\"\\x1aPLUGIN_LANGUAGE_JAVASCRIPT\\x10\\x02\\x12\\x1e\\n\" +\n\t\"\\x1aPLUGIN_LANGUAGE_TYPESCRIPT\\x10\\x03\\x12\\x19\\n\" +\n\t\"\\x15PLUGIN_LANGUAGE_SWIFT\\x10\\x04\\x12\\x17\\n\" +\n\t\"\\x13PLUGIN_LANGUAGE_CPP\\x10\\x05\\x12\\x18\\n\" +\n\t\"\\x14PLUGIN_LANGUAGE_JAVA\\x10\\x06\\x12\\x18\\n\" +\n\t\"\\x14PLUGIN_LANGUAGE_DART\\x10\\a\\x12\\x18\\n\" +\n\t\"\\x14PLUGIN_LANGUAGE_RUST\\x10\\b\\x12\\x1a\\n\" +\n\t\"\\x16PLUGIN_LANGUAGE_PYTHON\\x10\\t\\x12\\x18\\n\" +\n\t\"\\x14PLUGIN_LANGUAGE_RUBY\\x10\\n\" +\n\t\"\\x12\\x1a\\n\" +\n\t\"\\x16PLUGIN_LANGUAGE_KOTLIN\\x10\\v\\x12\\x1f\\n\" +\n\t\"\\x1bPLUGIN_LANGUAGE_OBJECTIVE_C\\x10\\f\\x12\\x17\\n\" +\n\t\"\\x13PLUGIN_LANGUAGE_PHP\\x10\\r\\x12\\x1a\\n\" +\n\t\"\\x16PLUGIN_LANGUAGE_CSHARP\\x10\\x0e\\x12\\x19\\n\" +\n\t\"\\x15PLUGIN_LANGUAGE_SCALA\\x10\\x0f\\x12\\x15\\n\" +\n\t\"\\x11PLUGIN_LANGUAGE_C\\x10\\x10*n\\n\" +\n\t\"\\x0eNPMImportStyle\\x12 \\n\" +\n\t\"\\x1cNPM_IMPORT_STYLE_UNSPECIFIED\\x10\\x00\\x12\\x1b\\n\" +\n\t\"\\x17NPM_IMPORT_STYLE_MODULE\\x10\\x01\\x12\\x1d\\n\" +\n\t\"\\x19NPM_IMPORT_STYLE_COMMONJS\\x10\\x02*\\xb3\\x01\\n\" +\n\t\"\\x11SwiftPlatformType\\x12#\\n\" +\n\t\"\\x1fSWIFT_PLATFORM_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x1d\\n\" +\n\t\"\\x19SWIFT_PLATFORM_TYPE_MACOS\\x10\\x01\\x12\\x1b\\n\" +\n\t\"\\x17SWIFT_PLATFORM_TYPE_IOS\\x10\\x02\\x12\\x1f\\n\" +\n\t\"\\x1bSWIFT_PLATFORM_TYPE_WATCHOS\\x10\\x03\\x12\\x1c\\n\" +\n\t\"\\x18SWIFT_PLATFORM_TYPE_TVOS\\x10\\x04*|\\n\" +\n\t\"\\x11PythonPackageType\\x12#\\n\" +\n\t\"\\x1fPYTHON_PACKAGE_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x1f\\n\" +\n\t\"\\x1bPYTHON_PACKAGE_TYPE_RUNTIME\\x10\\x01\\x12!\\n\" +\n\t\"\\x1dPYTHON_PACKAGE_TYPE_STUB_ONLY\\x10\\x02*\\xe9\\x04\\n\" +\n\t\"\\x15DotnetTargetFramework\\x12'\\n\" +\n\t\"#DOTNET_TARGET_FRAMEWORK_UNSPECIFIED\\x10\\x00\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_0\\x10\\x01\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_1\\x10\\x02\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_2\\x10\\x03\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_3\\x10\\x04\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_4\\x10\\x05\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_5\\x10\\x06\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_6\\x10\\a\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_0\\x10\\b\\x12+\\n\" +\n\t\"'DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_1\\x10\\t\\x12#\\n\" +\n\t\"\\x1fDOTNET_TARGET_FRAMEWORK_NET_5_0\\x10\\n\" +\n\t\"\\x12#\\n\" +\n\t\"\\x1fDOTNET_TARGET_FRAMEWORK_NET_6_0\\x10\\v\\x12#\\n\" +\n\t\"\\x1fDOTNET_TARGET_FRAMEWORK_NET_7_0\\x10\\f\\x12#\\n\" +\n\t\"\\x1fDOTNET_TARGET_FRAMEWORK_NET_8_0\\x10\\r2\\xdd\\x04\\n\" +\n\t\"\\x15PluginCurationService\\x12\\x8a\\x01\\n\" +\n\t\"\\x12ListCuratedPlugins\\x126.buf.alpha.registry.v1alpha1.ListCuratedPluginsRequest\\x1a7.buf.alpha.registry.v1alpha1.ListCuratedPluginsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8d\\x01\\n\" +\n\t\"\\x13CreateCuratedPlugin\\x127.buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest\\x1a8.buf.alpha.registry.v1alpha1.CreateCuratedPluginResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x96\\x01\\n\" +\n\t\"\\x16GetLatestCuratedPlugin\\x12:.buf.alpha.registry.v1alpha1.GetLatestCuratedPluginRequest\\x1a;.buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8d\\x01\\n\" +\n\t\"\\x13DeleteCuratedPlugin\\x127.buf.alpha.registry.v1alpha1.DeleteCuratedPluginRequest\\x1a8.buf.alpha.registry.v1alpha1.DeleteCuratedPluginResponse\\\"\\x03\\x90\\x02\\x022\\x8c\\x01\\n\" +\n\t\"\\x15CodeGenerationService\\x12s\\n\" +\n\t\"\\fGenerateCode\\x120.buf.alpha.registry.v1alpha1.GenerateCodeRequest\\x1a1.buf.alpha.registry.v1alpha1.GenerateCodeResponseB\\xa0\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x13PluginCurationProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes = make([]protoimpl.EnumInfo, 7)\nvar file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes = make([]protoimpl.MessageInfo, 37)\nvar file_buf_alpha_registry_v1alpha1_plugin_curation_proto_goTypes = []any{\n\t(CuratedPluginVisibility)(0),                // 0: buf.alpha.registry.v1alpha1.CuratedPluginVisibility\n\t(PluginRegistryType)(0),                     // 1: buf.alpha.registry.v1alpha1.PluginRegistryType\n\t(PluginLanguage)(0),                         // 2: buf.alpha.registry.v1alpha1.PluginLanguage\n\t(NPMImportStyle)(0),                         // 3: buf.alpha.registry.v1alpha1.NPMImportStyle\n\t(SwiftPlatformType)(0),                      // 4: buf.alpha.registry.v1alpha1.SwiftPlatformType\n\t(PythonPackageType)(0),                      // 5: buf.alpha.registry.v1alpha1.PythonPackageType\n\t(DotnetTargetFramework)(0),                  // 6: buf.alpha.registry.v1alpha1.DotnetTargetFramework\n\t(*GoConfig)(nil),                            // 7: buf.alpha.registry.v1alpha1.GoConfig\n\t(*NPMConfig)(nil),                           // 8: buf.alpha.registry.v1alpha1.NPMConfig\n\t(*MavenConfig)(nil),                         // 9: buf.alpha.registry.v1alpha1.MavenConfig\n\t(*NugetConfig)(nil),                         // 10: buf.alpha.registry.v1alpha1.NugetConfig\n\t(*CmakeConfig)(nil),                         // 11: buf.alpha.registry.v1alpha1.CmakeConfig\n\t(*SwiftConfig)(nil),                         // 12: buf.alpha.registry.v1alpha1.SwiftConfig\n\t(*PythonConfig)(nil),                        // 13: buf.alpha.registry.v1alpha1.PythonConfig\n\t(*CargoConfig)(nil),                         // 14: buf.alpha.registry.v1alpha1.CargoConfig\n\t(*RegistryConfig)(nil),                      // 15: buf.alpha.registry.v1alpha1.RegistryConfig\n\t(*CuratedPluginReference)(nil),              // 16: buf.alpha.registry.v1alpha1.CuratedPluginReference\n\t(*CuratedPlugin)(nil),                       // 17: buf.alpha.registry.v1alpha1.CuratedPlugin\n\t(*PluginCollection)(nil),                    // 18: buf.alpha.registry.v1alpha1.PluginCollection\n\t(*GenerateCodeRequest)(nil),                 // 19: buf.alpha.registry.v1alpha1.GenerateCodeRequest\n\t(*GenerateCodeResponse)(nil),                // 20: buf.alpha.registry.v1alpha1.GenerateCodeResponse\n\t(*PluginGenerationRequest)(nil),             // 21: buf.alpha.registry.v1alpha1.PluginGenerationRequest\n\t(*PluginGenerationResponse)(nil),            // 22: buf.alpha.registry.v1alpha1.PluginGenerationResponse\n\t(*DeleteCuratedPluginRequest)(nil),          // 23: buf.alpha.registry.v1alpha1.DeleteCuratedPluginRequest\n\t(*DeleteCuratedPluginResponse)(nil),         // 24: buf.alpha.registry.v1alpha1.DeleteCuratedPluginResponse\n\t(*CreateCuratedPluginRequest)(nil),          // 25: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest\n\t(*CreateCuratedPluginResponse)(nil),         // 26: buf.alpha.registry.v1alpha1.CreateCuratedPluginResponse\n\t(*ListCuratedPluginsRequest)(nil),           // 27: buf.alpha.registry.v1alpha1.ListCuratedPluginsRequest\n\t(*ListCuratedPluginsResponse)(nil),          // 28: buf.alpha.registry.v1alpha1.ListCuratedPluginsResponse\n\t(*GetLatestCuratedPluginRequest)(nil),       // 29: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginRequest\n\t(*GetLatestCuratedPluginResponse)(nil),      // 30: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse\n\t(*CuratedPluginVersionRevisions)(nil),       // 31: buf.alpha.registry.v1alpha1.CuratedPluginVersionRevisions\n\t(*GoConfig_RuntimeLibrary)(nil),             // 32: buf.alpha.registry.v1alpha1.GoConfig.RuntimeLibrary\n\t(*NPMConfig_RuntimeLibrary)(nil),            // 33: buf.alpha.registry.v1alpha1.NPMConfig.RuntimeLibrary\n\t(*MavenConfig_RuntimeLibrary)(nil),          // 34: buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibrary\n\t(*MavenConfig_CompilerConfig)(nil),          // 35: buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig\n\t(*MavenConfig_CompilerJavaConfig)(nil),      // 36: buf.alpha.registry.v1alpha1.MavenConfig.CompilerJavaConfig\n\t(*MavenConfig_CompilerKotlinConfig)(nil),    // 37: buf.alpha.registry.v1alpha1.MavenConfig.CompilerKotlinConfig\n\t(*MavenConfig_RuntimeConfig)(nil),           // 38: buf.alpha.registry.v1alpha1.MavenConfig.RuntimeConfig\n\t(*NugetConfig_RuntimeLibrary)(nil),          // 39: buf.alpha.registry.v1alpha1.NugetConfig.RuntimeLibrary\n\t(*SwiftConfig_RuntimeLibrary)(nil),          // 40: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary\n\t(*SwiftConfig_RuntimeLibrary_Platform)(nil), // 41: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.Platform\n\t(*PythonConfig_RuntimeLibrary)(nil),         // 42: buf.alpha.registry.v1alpha1.PythonConfig.RuntimeLibrary\n\t(*CargoConfig_RuntimeLibrary)(nil),          // 43: buf.alpha.registry.v1alpha1.CargoConfig.RuntimeLibrary\n\t(*timestamppb.Timestamp)(nil),               // 44: google.protobuf.Timestamp\n\t(*v1.Image)(nil),                            // 45: buf.alpha.image.v1.Image\n\t(*pluginpb.CodeGeneratorResponse)(nil),      // 46: google.protobuf.compiler.CodeGeneratorResponse\n}\nvar file_buf_alpha_registry_v1alpha1_plugin_curation_proto_depIdxs = []int32{\n\t32, // 0: buf.alpha.registry.v1alpha1.GoConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.GoConfig.RuntimeLibrary\n\t33, // 1: buf.alpha.registry.v1alpha1.NPMConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.NPMConfig.RuntimeLibrary\n\t3,  // 2: buf.alpha.registry.v1alpha1.NPMConfig.import_style:type_name -> buf.alpha.registry.v1alpha1.NPMImportStyle\n\t34, // 3: buf.alpha.registry.v1alpha1.MavenConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibrary\n\t35, // 4: buf.alpha.registry.v1alpha1.MavenConfig.compiler:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig\n\t38, // 5: buf.alpha.registry.v1alpha1.MavenConfig.additional_runtimes:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.RuntimeConfig\n\t6,  // 6: buf.alpha.registry.v1alpha1.NugetConfig.target_frameworks:type_name -> buf.alpha.registry.v1alpha1.DotnetTargetFramework\n\t39, // 7: buf.alpha.registry.v1alpha1.NugetConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.NugetConfig.RuntimeLibrary\n\t40, // 8: buf.alpha.registry.v1alpha1.SwiftConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary\n\t42, // 9: buf.alpha.registry.v1alpha1.PythonConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.PythonConfig.RuntimeLibrary\n\t5,  // 10: buf.alpha.registry.v1alpha1.PythonConfig.package_type:type_name -> buf.alpha.registry.v1alpha1.PythonPackageType\n\t43, // 11: buf.alpha.registry.v1alpha1.CargoConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.CargoConfig.RuntimeLibrary\n\t7,  // 12: buf.alpha.registry.v1alpha1.RegistryConfig.go_config:type_name -> buf.alpha.registry.v1alpha1.GoConfig\n\t8,  // 13: buf.alpha.registry.v1alpha1.RegistryConfig.npm_config:type_name -> buf.alpha.registry.v1alpha1.NPMConfig\n\t9,  // 14: buf.alpha.registry.v1alpha1.RegistryConfig.maven_config:type_name -> buf.alpha.registry.v1alpha1.MavenConfig\n\t12, // 15: buf.alpha.registry.v1alpha1.RegistryConfig.swift_config:type_name -> buf.alpha.registry.v1alpha1.SwiftConfig\n\t13, // 16: buf.alpha.registry.v1alpha1.RegistryConfig.python_config:type_name -> buf.alpha.registry.v1alpha1.PythonConfig\n\t14, // 17: buf.alpha.registry.v1alpha1.RegistryConfig.cargo_config:type_name -> buf.alpha.registry.v1alpha1.CargoConfig\n\t10, // 18: buf.alpha.registry.v1alpha1.RegistryConfig.nuget_config:type_name -> buf.alpha.registry.v1alpha1.NugetConfig\n\t11, // 19: buf.alpha.registry.v1alpha1.RegistryConfig.cmake_config:type_name -> buf.alpha.registry.v1alpha1.CmakeConfig\n\t1,  // 20: buf.alpha.registry.v1alpha1.CuratedPlugin.registry_type:type_name -> buf.alpha.registry.v1alpha1.PluginRegistryType\n\t44, // 21: buf.alpha.registry.v1alpha1.CuratedPlugin.create_time:type_name -> google.protobuf.Timestamp\n\t16, // 22: buf.alpha.registry.v1alpha1.CuratedPlugin.dependencies:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginReference\n\t15, // 23: buf.alpha.registry.v1alpha1.CuratedPlugin.registry_config:type_name -> buf.alpha.registry.v1alpha1.RegistryConfig\n\t2,  // 24: buf.alpha.registry.v1alpha1.CuratedPlugin.output_languages:type_name -> buf.alpha.registry.v1alpha1.PluginLanguage\n\t0,  // 25: buf.alpha.registry.v1alpha1.CuratedPlugin.visibility:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginVisibility\n\t18, // 26: buf.alpha.registry.v1alpha1.CuratedPlugin.collections:type_name -> buf.alpha.registry.v1alpha1.PluginCollection\n\t45, // 27: buf.alpha.registry.v1alpha1.GenerateCodeRequest.image:type_name -> buf.alpha.image.v1.Image\n\t21, // 28: buf.alpha.registry.v1alpha1.GenerateCodeRequest.requests:type_name -> buf.alpha.registry.v1alpha1.PluginGenerationRequest\n\t22, // 29: buf.alpha.registry.v1alpha1.GenerateCodeResponse.responses:type_name -> buf.alpha.registry.v1alpha1.PluginGenerationResponse\n\t16, // 30: buf.alpha.registry.v1alpha1.PluginGenerationRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginReference\n\t46, // 31: buf.alpha.registry.v1alpha1.PluginGenerationResponse.response:type_name -> google.protobuf.compiler.CodeGeneratorResponse\n\t1,  // 32: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.registry_type:type_name -> buf.alpha.registry.v1alpha1.PluginRegistryType\n\t16, // 33: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.dependencies:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginReference\n\t15, // 34: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.registry_config:type_name -> buf.alpha.registry.v1alpha1.RegistryConfig\n\t2,  // 35: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.output_languages:type_name -> buf.alpha.registry.v1alpha1.PluginLanguage\n\t0,  // 36: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.visibility:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginVisibility\n\t17, // 37: buf.alpha.registry.v1alpha1.CreateCuratedPluginResponse.configuration:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin\n\t17, // 38: buf.alpha.registry.v1alpha1.ListCuratedPluginsResponse.plugins:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin\n\t17, // 39: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse.plugin:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin\n\t31, // 40: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse.versions:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginVersionRevisions\n\t36, // 41: buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig.java:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.CompilerJavaConfig\n\t37, // 42: buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig.kotlin:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.CompilerKotlinConfig\n\t34, // 43: buf.alpha.registry.v1alpha1.MavenConfig.RuntimeConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibrary\n\t6,  // 44: buf.alpha.registry.v1alpha1.NugetConfig.RuntimeLibrary.target_frameworks:type_name -> buf.alpha.registry.v1alpha1.DotnetTargetFramework\n\t41, // 45: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.platforms:type_name -> buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.Platform\n\t4,  // 46: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.Platform.name:type_name -> buf.alpha.registry.v1alpha1.SwiftPlatformType\n\t27, // 47: buf.alpha.registry.v1alpha1.PluginCurationService.ListCuratedPlugins:input_type -> buf.alpha.registry.v1alpha1.ListCuratedPluginsRequest\n\t25, // 48: buf.alpha.registry.v1alpha1.PluginCurationService.CreateCuratedPlugin:input_type -> buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest\n\t29, // 49: buf.alpha.registry.v1alpha1.PluginCurationService.GetLatestCuratedPlugin:input_type -> buf.alpha.registry.v1alpha1.GetLatestCuratedPluginRequest\n\t23, // 50: buf.alpha.registry.v1alpha1.PluginCurationService.DeleteCuratedPlugin:input_type -> buf.alpha.registry.v1alpha1.DeleteCuratedPluginRequest\n\t19, // 51: buf.alpha.registry.v1alpha1.CodeGenerationService.GenerateCode:input_type -> buf.alpha.registry.v1alpha1.GenerateCodeRequest\n\t28, // 52: buf.alpha.registry.v1alpha1.PluginCurationService.ListCuratedPlugins:output_type -> buf.alpha.registry.v1alpha1.ListCuratedPluginsResponse\n\t26, // 53: buf.alpha.registry.v1alpha1.PluginCurationService.CreateCuratedPlugin:output_type -> buf.alpha.registry.v1alpha1.CreateCuratedPluginResponse\n\t30, // 54: buf.alpha.registry.v1alpha1.PluginCurationService.GetLatestCuratedPlugin:output_type -> buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse\n\t24, // 55: buf.alpha.registry.v1alpha1.PluginCurationService.DeleteCuratedPlugin:output_type -> buf.alpha.registry.v1alpha1.DeleteCuratedPluginResponse\n\t20, // 56: buf.alpha.registry.v1alpha1.CodeGenerationService.GenerateCode:output_type -> buf.alpha.registry.v1alpha1.GenerateCodeResponse\n\t52, // [52:57] is the sub-list for method output_type\n\t47, // [47:52] is the sub-list for method input_type\n\t47, // [47:47] is the sub-list for extension type_name\n\t47, // [47:47] is the sub-list for extension extendee\n\t0,  // [0:47] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_plugin_curation_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_plugin_curation_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_plugin_curation_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[8].OneofWrappers = []any{\n\t\t(*registryConfig_GoConfig)(nil),\n\t\t(*registryConfig_NpmConfig)(nil),\n\t\t(*registryConfig_MavenConfig)(nil),\n\t\t(*registryConfig_SwiftConfig)(nil),\n\t\t(*registryConfig_PythonConfig)(nil),\n\t\t(*registryConfig_CargoConfig)(nil),\n\t\t(*registryConfig_NugetConfig)(nil),\n\t\t(*registryConfig_CmakeConfig)(nil),\n\t}\n\tfile_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[14].OneofWrappers = []any{}\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_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc)),\n\t\t\tNumEnums:      7,\n\t\t\tNumMessages:   37,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   2,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_plugin_curation_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_plugin_curation_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_plugin_curation_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_plugin_curation_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_plugin_curation_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/push.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/push.proto\n\npackage registryv1alpha1\n\nimport (\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// PushRequest specifies the module to push to the BSR.\ntype PushRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Branch     string                 `protobuf:\"bytes,3,opt,name=branch,proto3\"`\n\txxx_hidden_Module     *v1alpha1.Module       `protobuf:\"bytes,4,opt,name=module,proto3\"`\n\txxx_hidden_Tags       []string               `protobuf:\"bytes,5,rep,name=tags,proto3\"`\n\txxx_hidden_Tracks     []string               `protobuf:\"bytes,6,rep,name=tracks,proto3\"`\n\txxx_hidden_DraftName  string                 `protobuf:\"bytes,7,opt,name=draft_name,json=draftName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PushRequest) Reset() {\n\t*x = PushRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PushRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PushRequest) ProtoMessage() {}\n\nfunc (x *PushRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_push_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\nfunc (x *PushRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *PushRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto.\nfunc (x *PushRequest) GetBranch() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Branch\n\t}\n\treturn \"\"\n}\n\nfunc (x *PushRequest) GetModule() *v1alpha1.Module {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Module\n\t}\n\treturn nil\n}\n\nfunc (x *PushRequest) GetTags() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Tags\n\t}\n\treturn nil\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto.\nfunc (x *PushRequest) GetTracks() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Tracks\n\t}\n\treturn nil\n}\n\nfunc (x *PushRequest) GetDraftName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DraftName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PushRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *PushRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto.\nfunc (x *PushRequest) SetBranch(v string) {\n\tx.xxx_hidden_Branch = v\n}\n\nfunc (x *PushRequest) SetModule(v *v1alpha1.Module) {\n\tx.xxx_hidden_Module = v\n}\n\nfunc (x *PushRequest) SetTags(v []string) {\n\tx.xxx_hidden_Tags = v\n}\n\n// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto.\nfunc (x *PushRequest) SetTracks(v []string) {\n\tx.xxx_hidden_Tracks = v\n}\n\nfunc (x *PushRequest) SetDraftName(v string) {\n\tx.xxx_hidden_DraftName = v\n}\n\nfunc (x *PushRequest) HasModule() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Module != nil\n}\n\nfunc (x *PushRequest) ClearModule() {\n\tx.xxx_hidden_Module = nil\n}\n\ntype PushRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto.\n\tBranch string\n\tModule *v1alpha1.Module\n\t// Optional; if provided, the provided tags\n\t// are created for the pushed commit.\n\tTags []string\n\t// Optional; if provided, the pushed commit\n\t// will be appended to these tracks. If the\n\t// tracks do not exist, they will be created.\n\t//\n\t// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto.\n\tTracks []string\n\t// If non-empty, the push creates a draft commit with this name.\n\tDraftName string\n}\n\nfunc (b0 PushRequest_builder) Build() *PushRequest {\n\tm0 := &PushRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Branch = b.Branch\n\tx.xxx_hidden_Module = b.Module\n\tx.xxx_hidden_Tags = b.Tags\n\tx.xxx_hidden_Tracks = b.Tracks\n\tx.xxx_hidden_DraftName = b.DraftName\n\treturn m0\n}\n\n// PushResponse is the pushed module pin, local to the used remote.\ntype PushResponse struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_LocalModulePin *LocalModulePin        `protobuf:\"bytes,5,opt,name=local_module_pin,json=localModulePin,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PushResponse) Reset() {\n\t*x = PushResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PushResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PushResponse) ProtoMessage() {}\n\nfunc (x *PushResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_push_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\nfunc (x *PushResponse) GetLocalModulePin() *LocalModulePin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LocalModulePin\n\t}\n\treturn nil\n}\n\nfunc (x *PushResponse) SetLocalModulePin(v *LocalModulePin) {\n\tx.xxx_hidden_LocalModulePin = v\n}\n\nfunc (x *PushResponse) HasLocalModulePin() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_LocalModulePin != nil\n}\n\nfunc (x *PushResponse) ClearLocalModulePin() {\n\tx.xxx_hidden_LocalModulePin = nil\n}\n\ntype PushResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tLocalModulePin *LocalModulePin\n}\n\nfunc (b0 PushResponse_builder) Build() *PushResponse {\n\tm0 := &PushResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_LocalModulePin = b.LocalModulePin\n\treturn m0\n}\n\n// PushManifestAndBlobsRequest holds the module to push in the manifest+blobs\n// encoding format.\ntype PushManifestAndBlobsRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Manifest   *v1alpha1.Blob         `protobuf:\"bytes,3,opt,name=manifest,proto3\"`\n\txxx_hidden_Blobs      *[]*v1alpha1.Blob      `protobuf:\"bytes,4,rep,name=blobs,proto3\"`\n\txxx_hidden_Tags       []string               `protobuf:\"bytes,5,rep,name=tags,proto3\"`\n\txxx_hidden_DraftName  string                 `protobuf:\"bytes,6,opt,name=draft_name,json=draftName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *PushManifestAndBlobsRequest) Reset() {\n\t*x = PushManifestAndBlobsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PushManifestAndBlobsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PushManifestAndBlobsRequest) ProtoMessage() {}\n\nfunc (x *PushManifestAndBlobsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_push_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\nfunc (x *PushManifestAndBlobsRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *PushManifestAndBlobsRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *PushManifestAndBlobsRequest) GetManifest() *v1alpha1.Blob {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Manifest\n\t}\n\treturn nil\n}\n\nfunc (x *PushManifestAndBlobsRequest) GetBlobs() []*v1alpha1.Blob {\n\tif x != nil {\n\t\tif x.xxx_hidden_Blobs != nil {\n\t\t\treturn *x.xxx_hidden_Blobs\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *PushManifestAndBlobsRequest) GetTags() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Tags\n\t}\n\treturn nil\n}\n\nfunc (x *PushManifestAndBlobsRequest) GetDraftName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DraftName\n\t}\n\treturn \"\"\n}\n\nfunc (x *PushManifestAndBlobsRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *PushManifestAndBlobsRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *PushManifestAndBlobsRequest) SetManifest(v *v1alpha1.Blob) {\n\tx.xxx_hidden_Manifest = v\n}\n\nfunc (x *PushManifestAndBlobsRequest) SetBlobs(v []*v1alpha1.Blob) {\n\tx.xxx_hidden_Blobs = &v\n}\n\nfunc (x *PushManifestAndBlobsRequest) SetTags(v []string) {\n\tx.xxx_hidden_Tags = v\n}\n\nfunc (x *PushManifestAndBlobsRequest) SetDraftName(v string) {\n\tx.xxx_hidden_DraftName = v\n}\n\nfunc (x *PushManifestAndBlobsRequest) HasManifest() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Manifest != nil\n}\n\nfunc (x *PushManifestAndBlobsRequest) ClearManifest() {\n\tx.xxx_hidden_Manifest = nil\n}\n\ntype PushManifestAndBlobsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwner      string\n\tRepository string\n\t// Manifest with all the module files being pushed.\n\t// The content of the manifest blob is a text encoding of an ordered list of unique paths, each path encoded as:\n\t//\n\t//\t<digest_type>:<digest>[SP][SP]<path>[LF]\n\t//\n\t// The only current supported digest type is 'shake256'. The shake256 digest consists of 64 bytes of lowercase hex\n\t// encoded output of SHAKE256. See buf.alpha.module.v1alpha1.Digest for more details.\n\tManifest *v1alpha1.Blob\n\t// Referenced blobs in the manifest. Keep in mind there is not necessarily one\n\t// blob per file, but one blob per digest, so for files with exactly the same\n\t// content, you can send just one blob.\n\tBlobs []*v1alpha1.Blob\n\t// Optional; if provided, the provided tags\n\t// are created for the pushed commit.\n\tTags []string\n\t// If non-empty, the push creates a draft commit with this name.\n\tDraftName string\n}\n\nfunc (b0 PushManifestAndBlobsRequest_builder) Build() *PushManifestAndBlobsRequest {\n\tm0 := &PushManifestAndBlobsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Manifest = b.Manifest\n\tx.xxx_hidden_Blobs = &b.Blobs\n\tx.xxx_hidden_Tags = b.Tags\n\tx.xxx_hidden_DraftName = b.DraftName\n\treturn m0\n}\n\n// PushManifestAndBlobsResponse is the pushed module pin, local to the used\n// remote.\ntype PushManifestAndBlobsResponse struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_LocalModulePin *LocalModulePin        `protobuf:\"bytes,1,opt,name=local_module_pin,json=localModulePin,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *PushManifestAndBlobsResponse) Reset() {\n\t*x = PushManifestAndBlobsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *PushManifestAndBlobsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*PushManifestAndBlobsResponse) ProtoMessage() {}\n\nfunc (x *PushManifestAndBlobsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_push_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\nfunc (x *PushManifestAndBlobsResponse) GetLocalModulePin() *LocalModulePin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LocalModulePin\n\t}\n\treturn nil\n}\n\nfunc (x *PushManifestAndBlobsResponse) SetLocalModulePin(v *LocalModulePin) {\n\tx.xxx_hidden_LocalModulePin = v\n}\n\nfunc (x *PushManifestAndBlobsResponse) HasLocalModulePin() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_LocalModulePin != nil\n}\n\nfunc (x *PushManifestAndBlobsResponse) ClearLocalModulePin() {\n\tx.xxx_hidden_LocalModulePin = nil\n}\n\ntype PushManifestAndBlobsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tLocalModulePin *LocalModulePin\n}\n\nfunc (b0 PushManifestAndBlobsResponse_builder) Build() *PushManifestAndBlobsResponse {\n\tm0 := &PushManifestAndBlobsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_LocalModulePin = b.LocalModulePin\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_push_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_push_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"&buf/alpha/registry/v1alpha1/push.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/module/v1alpha1/module.proto\\x1a(buf/alpha/registry/v1alpha1/module.proto\\\"\\xe9\\x01\\n\" +\n\t\"\\vPushRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1a\\n\" +\n\t\"\\x06branch\\x18\\x03 \\x01(\\tB\\x02\\x18\\x01R\\x06branch\\x129\\n\" +\n\t\"\\x06module\\x18\\x04 \\x01(\\v2!.buf.alpha.module.v1alpha1.ModuleR\\x06module\\x12\\x12\\n\" +\n\t\"\\x04tags\\x18\\x05 \\x03(\\tR\\x04tags\\x12\\x1a\\n\" +\n\t\"\\x06tracks\\x18\\x06 \\x03(\\tB\\x02\\x18\\x01R\\x06tracks\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"draft_name\\x18\\a \\x01(\\tR\\tdraftName\\\"e\\n\" +\n\t\"\\fPushResponse\\x12U\\n\" +\n\t\"\\x10local_module_pin\\x18\\x05 \\x01(\\v2+.buf.alpha.registry.v1alpha1.LocalModulePinR\\x0elocalModulePin\\\"\\xfa\\x01\\n\" +\n\t\"\\x1bPushManifestAndBlobsRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12;\\n\" +\n\t\"\\bmanifest\\x18\\x03 \\x01(\\v2\\x1f.buf.alpha.module.v1alpha1.BlobR\\bmanifest\\x125\\n\" +\n\t\"\\x05blobs\\x18\\x04 \\x03(\\v2\\x1f.buf.alpha.module.v1alpha1.BlobR\\x05blobs\\x12\\x12\\n\" +\n\t\"\\x04tags\\x18\\x05 \\x03(\\tR\\x04tags\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"draft_name\\x18\\x06 \\x01(\\tR\\tdraftName\\\"u\\n\" +\n\t\"\\x1cPushManifestAndBlobsResponse\\x12U\\n\" +\n\t\"\\x10local_module_pin\\x18\\x01 \\x01(\\v2+.buf.alpha.registry.v1alpha1.LocalModulePinR\\x0elocalModulePin2\\x82\\x02\\n\" +\n\t\"\\vPushService\\x12`\\n\" +\n\t\"\\x04Push\\x12(.buf.alpha.registry.v1alpha1.PushRequest\\x1a).buf.alpha.registry.v1alpha1.PushResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x90\\x01\\n\" +\n\t\"\\x14PushManifestAndBlobs\\x128.buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest\\x1a9.buf.alpha.registry.v1alpha1.PushManifestAndBlobsResponse\\\"\\x03\\x90\\x02\\x02B\\x96\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\tPushProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_push_proto_msgTypes = make([]protoimpl.MessageInfo, 4)\nvar file_buf_alpha_registry_v1alpha1_push_proto_goTypes = []any{\n\t(*PushRequest)(nil),                  // 0: buf.alpha.registry.v1alpha1.PushRequest\n\t(*PushResponse)(nil),                 // 1: buf.alpha.registry.v1alpha1.PushResponse\n\t(*PushManifestAndBlobsRequest)(nil),  // 2: buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest\n\t(*PushManifestAndBlobsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.PushManifestAndBlobsResponse\n\t(*v1alpha1.Module)(nil),              // 4: buf.alpha.module.v1alpha1.Module\n\t(*LocalModulePin)(nil),               // 5: buf.alpha.registry.v1alpha1.LocalModulePin\n\t(*v1alpha1.Blob)(nil),                // 6: buf.alpha.module.v1alpha1.Blob\n}\nvar file_buf_alpha_registry_v1alpha1_push_proto_depIdxs = []int32{\n\t4, // 0: buf.alpha.registry.v1alpha1.PushRequest.module:type_name -> buf.alpha.module.v1alpha1.Module\n\t5, // 1: buf.alpha.registry.v1alpha1.PushResponse.local_module_pin:type_name -> buf.alpha.registry.v1alpha1.LocalModulePin\n\t6, // 2: buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest.manifest:type_name -> buf.alpha.module.v1alpha1.Blob\n\t6, // 3: buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest.blobs:type_name -> buf.alpha.module.v1alpha1.Blob\n\t5, // 4: buf.alpha.registry.v1alpha1.PushManifestAndBlobsResponse.local_module_pin:type_name -> buf.alpha.registry.v1alpha1.LocalModulePin\n\t0, // 5: buf.alpha.registry.v1alpha1.PushService.Push:input_type -> buf.alpha.registry.v1alpha1.PushRequest\n\t2, // 6: buf.alpha.registry.v1alpha1.PushService.PushManifestAndBlobs:input_type -> buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest\n\t1, // 7: buf.alpha.registry.v1alpha1.PushService.Push:output_type -> buf.alpha.registry.v1alpha1.PushResponse\n\t3, // 8: buf.alpha.registry.v1alpha1.PushService.PushManifestAndBlobs:output_type -> buf.alpha.registry.v1alpha1.PushManifestAndBlobsResponse\n\t7, // [7:9] is the sub-list for method output_type\n\t5, // [5:7] is the sub-list for method input_type\n\t5, // [5:5] is the sub-list for extension type_name\n\t5, // [5:5] is the sub-list for extension extendee\n\t0, // [0:5] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_push_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_push_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_push_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_module_proto_init()\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_buf_alpha_registry_v1alpha1_push_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_push_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   4,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_push_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_push_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_push_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_push_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_push_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_push_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/reference.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/reference.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 Reference struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Reference isReference_Reference  `protobuf_oneof:\"reference\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *Reference) Reset() {\n\t*x = Reference{}\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\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_buf_alpha_registry_v1alpha1_reference_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\nfunc (x *Reference) GetBranch() *RepositoryBranch {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*reference_Branch); ok {\n\t\t\treturn x.Branch\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Reference) GetTag() *RepositoryTag {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*reference_Tag); ok {\n\t\t\treturn x.Tag\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Reference) GetCommit() *RepositoryCommit {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*reference_Commit); ok {\n\t\t\treturn x.Commit\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Reference) GetMain() *RepositoryMainReference {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*reference_Main); ok {\n\t\t\treturn x.Main\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Reference) GetDraft() *RepositoryDraft {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*reference_Draft); ok {\n\t\t\treturn x.Draft\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Reference) GetVcsCommit() *RepositoryVCSCommit {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*reference_VcsCommit); ok {\n\t\t\treturn x.VcsCommit\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Reference) SetBranch(v *RepositoryBranch) {\n\tif v == nil {\n\t\tx.xxx_hidden_Reference = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Reference = &reference_Branch{v}\n}\n\nfunc (x *Reference) SetTag(v *RepositoryTag) {\n\tif v == nil {\n\t\tx.xxx_hidden_Reference = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Reference = &reference_Tag{v}\n}\n\nfunc (x *Reference) SetCommit(v *RepositoryCommit) {\n\tif v == nil {\n\t\tx.xxx_hidden_Reference = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Reference = &reference_Commit{v}\n}\n\nfunc (x *Reference) SetMain(v *RepositoryMainReference) {\n\tif v == nil {\n\t\tx.xxx_hidden_Reference = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Reference = &reference_Main{v}\n}\n\nfunc (x *Reference) SetDraft(v *RepositoryDraft) {\n\tif v == nil {\n\t\tx.xxx_hidden_Reference = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Reference = &reference_Draft{v}\n}\n\nfunc (x *Reference) SetVcsCommit(v *RepositoryVCSCommit) {\n\tif v == nil {\n\t\tx.xxx_hidden_Reference = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Reference = &reference_VcsCommit{v}\n}\n\nfunc (x *Reference) HasReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Reference != nil\n}\n\nfunc (x *Reference) HasBranch() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*reference_Branch)\n\treturn ok\n}\n\nfunc (x *Reference) HasTag() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*reference_Tag)\n\treturn ok\n}\n\nfunc (x *Reference) HasCommit() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*reference_Commit)\n\treturn ok\n}\n\nfunc (x *Reference) HasMain() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*reference_Main)\n\treturn ok\n}\n\nfunc (x *Reference) HasDraft() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*reference_Draft)\n\treturn ok\n}\n\nfunc (x *Reference) HasVcsCommit() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*reference_VcsCommit)\n\treturn ok\n}\n\nfunc (x *Reference) ClearReference() {\n\tx.xxx_hidden_Reference = nil\n}\n\nfunc (x *Reference) ClearBranch() {\n\tif _, ok := x.xxx_hidden_Reference.(*reference_Branch); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nfunc (x *Reference) ClearTag() {\n\tif _, ok := x.xxx_hidden_Reference.(*reference_Tag); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nfunc (x *Reference) ClearCommit() {\n\tif _, ok := x.xxx_hidden_Reference.(*reference_Commit); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nfunc (x *Reference) ClearMain() {\n\tif _, ok := x.xxx_hidden_Reference.(*reference_Main); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nfunc (x *Reference) ClearDraft() {\n\tif _, ok := x.xxx_hidden_Reference.(*reference_Draft); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nfunc (x *Reference) ClearVcsCommit() {\n\tif _, ok := x.xxx_hidden_Reference.(*reference_VcsCommit); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nconst Reference_Reference_not_set_case case_Reference_Reference = 0\nconst Reference_Branch_case case_Reference_Reference = 1\nconst Reference_Tag_case case_Reference_Reference = 2\nconst Reference_Commit_case case_Reference_Reference = 3\nconst Reference_Main_case case_Reference_Reference = 5\nconst Reference_Draft_case case_Reference_Reference = 6\nconst Reference_VcsCommit_case case_Reference_Reference = 7\n\nfunc (x *Reference) WhichReference() case_Reference_Reference {\n\tif x == nil {\n\t\treturn Reference_Reference_not_set_case\n\t}\n\tswitch x.xxx_hidden_Reference.(type) {\n\tcase *reference_Branch:\n\t\treturn Reference_Branch_case\n\tcase *reference_Tag:\n\t\treturn Reference_Tag_case\n\tcase *reference_Commit:\n\t\treturn Reference_Commit_case\n\tcase *reference_Main:\n\t\treturn Reference_Main_case\n\tcase *reference_Draft:\n\t\treturn Reference_Draft_case\n\tcase *reference_VcsCommit:\n\t\treturn Reference_VcsCommit_case\n\tdefault:\n\t\treturn Reference_Reference_not_set_case\n\t}\n}\n\ntype Reference_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Reference:\n\t// The requested reference is a branch.\n\tBranch *RepositoryBranch\n\t// The requested reference is a tag.\n\tTag *RepositoryTag\n\t// The requested reference is a commit.\n\tCommit *RepositoryCommit\n\t// The requested reference is the default reference.\n\tMain *RepositoryMainReference\n\t// The requested reference is a draft commit.\n\tDraft *RepositoryDraft\n\t// The requested reference is a VCS commit.\n\tVcsCommit *RepositoryVCSCommit\n\t// -- end of xxx_hidden_Reference\n}\n\nfunc (b0 Reference_builder) Build() *Reference {\n\tm0 := &Reference{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Branch != nil {\n\t\tx.xxx_hidden_Reference = &reference_Branch{b.Branch}\n\t}\n\tif b.Tag != nil {\n\t\tx.xxx_hidden_Reference = &reference_Tag{b.Tag}\n\t}\n\tif b.Commit != nil {\n\t\tx.xxx_hidden_Reference = &reference_Commit{b.Commit}\n\t}\n\tif b.Main != nil {\n\t\tx.xxx_hidden_Reference = &reference_Main{b.Main}\n\t}\n\tif b.Draft != nil {\n\t\tx.xxx_hidden_Reference = &reference_Draft{b.Draft}\n\t}\n\tif b.VcsCommit != nil {\n\t\tx.xxx_hidden_Reference = &reference_VcsCommit{b.VcsCommit}\n\t}\n\treturn m0\n}\n\ntype case_Reference_Reference protoreflect.FieldNumber\n\nfunc (x case_Reference_Reference) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[0].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isReference_Reference interface {\n\tisReference_Reference()\n}\n\ntype reference_Branch struct {\n\t// The requested reference is a branch.\n\tBranch *RepositoryBranch `protobuf:\"bytes,1,opt,name=branch,proto3,oneof\"`\n}\n\ntype reference_Tag struct {\n\t// The requested reference is a tag.\n\tTag *RepositoryTag `protobuf:\"bytes,2,opt,name=tag,proto3,oneof\"`\n}\n\ntype reference_Commit struct {\n\t// The requested reference is a commit.\n\tCommit *RepositoryCommit `protobuf:\"bytes,3,opt,name=commit,proto3,oneof\"`\n}\n\ntype reference_Main struct {\n\t// The requested reference is the default reference.\n\tMain *RepositoryMainReference `protobuf:\"bytes,5,opt,name=main,proto3,oneof\"`\n}\n\ntype reference_Draft struct {\n\t// The requested reference is a draft commit.\n\tDraft *RepositoryDraft `protobuf:\"bytes,6,opt,name=draft,proto3,oneof\"`\n}\n\ntype reference_VcsCommit struct {\n\t// The requested reference is a VCS commit.\n\tVcsCommit *RepositoryVCSCommit `protobuf:\"bytes,7,opt,name=vcs_commit,json=vcsCommit,proto3,oneof\"`\n}\n\nfunc (*reference_Branch) isReference_Reference() {}\n\nfunc (*reference_Tag) isReference_Reference() {}\n\nfunc (*reference_Commit) isReference_Reference() {}\n\nfunc (*reference_Main) isReference_Reference() {}\n\nfunc (*reference_Draft) isReference_Reference() {}\n\nfunc (*reference_VcsCommit) isReference_Reference() {}\n\ntype RepositoryMainReference struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name   string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Commit *RepositoryCommit      `protobuf:\"bytes,2,opt,name=commit,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *RepositoryMainReference) Reset() {\n\t*x = RepositoryMainReference{}\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryMainReference) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryMainReference) ProtoMessage() {}\n\nfunc (x *RepositoryMainReference) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_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\nfunc (x *RepositoryMainReference) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryMainReference) GetCommit() *RepositoryCommit {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryMainReference) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositoryMainReference) SetCommit(v *RepositoryCommit) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *RepositoryMainReference) HasCommit() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Commit != nil\n}\n\nfunc (x *RepositoryMainReference) ClearCommit() {\n\tx.xxx_hidden_Commit = nil\n}\n\ntype RepositoryMainReference_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Name is the configured default_branch for the repository (default: 'main').\n\tName string\n\t// The latest commit in this repository. If the repository has no commits,\n\t// this will be empty.\n\tCommit *RepositoryCommit\n}\n\nfunc (b0 RepositoryMainReference_builder) Build() *RepositoryMainReference {\n\tm0 := &RepositoryMainReference{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Commit = b.Commit\n\treturn m0\n}\n\ntype RepositoryDraft struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name   string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Commit *RepositoryCommit      `protobuf:\"bytes,2,opt,name=commit,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *RepositoryDraft) Reset() {\n\t*x = RepositoryDraft{}\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryDraft) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryDraft) ProtoMessage() {}\n\nfunc (x *RepositoryDraft) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_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\nfunc (x *RepositoryDraft) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryDraft) GetCommit() *RepositoryCommit {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryDraft) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositoryDraft) SetCommit(v *RepositoryCommit) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *RepositoryDraft) HasCommit() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Commit != nil\n}\n\nfunc (x *RepositoryDraft) ClearCommit() {\n\tx.xxx_hidden_Commit = nil\n}\n\ntype RepositoryDraft_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The name of the draft\n\tName string\n\t// The commit this draft points to.\n\tCommit *RepositoryCommit\n}\n\nfunc (b0 RepositoryDraft_builder) Build() *RepositoryDraft {\n\tm0 := &RepositoryDraft{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Commit = b.Commit\n\treturn m0\n}\n\ntype RepositoryVCSCommit struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id         string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_Name       string                 `protobuf:\"bytes,3,opt,name=name,proto3\"`\n\txxx_hidden_CommitName string                 `protobuf:\"bytes,4,opt,name=commit_name,json=commitName,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *RepositoryVCSCommit) Reset() {\n\t*x = RepositoryVCSCommit{}\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryVCSCommit) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryVCSCommit) ProtoMessage() {}\n\nfunc (x *RepositoryVCSCommit) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_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\nfunc (x *RepositoryVCSCommit) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryVCSCommit) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryVCSCommit) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryVCSCommit) GetCommitName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CommitName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryVCSCommit) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *RepositoryVCSCommit) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *RepositoryVCSCommit) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositoryVCSCommit) SetCommitName(v string) {\n\tx.xxx_hidden_CommitName = v\n}\n\nfunc (x *RepositoryVCSCommit) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *RepositoryVCSCommit) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\ntype RepositoryVCSCommit_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// primary key, unique.\n\tId string\n\t// immutable\n\tCreateTime *timestamppb.Timestamp\n\t// The name of the VCS commit, e.g. for Git, it would be the Git hash.\n\tName string\n\t// The name of the BSR commit this VCS commit belongs to.\n\tCommitName string\n}\n\nfunc (b0 RepositoryVCSCommit_builder) Build() *RepositoryVCSCommit {\n\tm0 := &RepositoryVCSCommit{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_CommitName = b.CommitName\n\treturn m0\n}\n\ntype GetReferenceByNameRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name           string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\txxx_hidden_Owner          string                 `protobuf:\"bytes,2,opt,name=owner,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,3,opt,name=repository_name,json=repositoryName,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *GetReferenceByNameRequest) Reset() {\n\t*x = GetReferenceByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetReferenceByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetReferenceByNameRequest) ProtoMessage() {}\n\nfunc (x *GetReferenceByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_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\nfunc (x *GetReferenceByNameRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetReferenceByNameRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetReferenceByNameRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetReferenceByNameRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GetReferenceByNameRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetReferenceByNameRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\ntype GetReferenceByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Optional name (if unspecified, will use the repository's default_branch).\n\tName string\n\t// Owner of the repository the reference belongs to.\n\tOwner string\n\t// Name of the repository the reference belongs to.\n\tRepositoryName string\n}\n\nfunc (b0 GetReferenceByNameRequest_builder) Build() *GetReferenceByNameRequest {\n\tm0 := &GetReferenceByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\treturn m0\n}\n\ntype GetReferenceByNameResponse struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Reference *Reference             `protobuf:\"bytes,1,opt,name=reference,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *GetReferenceByNameResponse) Reset() {\n\t*x = GetReferenceByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetReferenceByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetReferenceByNameResponse) ProtoMessage() {}\n\nfunc (x *GetReferenceByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_reference_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\nfunc (x *GetReferenceByNameResponse) GetReference() *Reference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn nil\n}\n\nfunc (x *GetReferenceByNameResponse) SetReference(v *Reference) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *GetReferenceByNameResponse) HasReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Reference != nil\n}\n\nfunc (x *GetReferenceByNameResponse) ClearReference() {\n\tx.xxx_hidden_Reference = nil\n}\n\ntype GetReferenceByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tReference *Reference\n}\n\nfunc (b0 GetReferenceByNameResponse_builder) Build() *GetReferenceByNameResponse {\n\tm0 := &GetReferenceByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_reference_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_reference_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"+buf/alpha/registry/v1alpha1/reference.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a3buf/alpha/registry/v1alpha1/repository_branch.proto\\x1a3buf/alpha/registry/v1alpha1/repository_commit.proto\\x1a0buf/alpha/registry/v1alpha1/repository_tag.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xdc\\x03\\n\" +\n\t\"\\tReference\\x12G\\n\" +\n\t\"\\x06branch\\x18\\x01 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryBranchH\\x00R\\x06branch\\x12>\\n\" +\n\t\"\\x03tag\\x18\\x02 \\x01(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagH\\x00R\\x03tag\\x12G\\n\" +\n\t\"\\x06commit\\x18\\x03 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitH\\x00R\\x06commit\\x12J\\n\" +\n\t\"\\x04main\\x18\\x05 \\x01(\\v24.buf.alpha.registry.v1alpha1.RepositoryMainReferenceH\\x00R\\x04main\\x12D\\n\" +\n\t\"\\x05draft\\x18\\x06 \\x01(\\v2,.buf.alpha.registry.v1alpha1.RepositoryDraftH\\x00R\\x05draft\\x12Q\\n\" +\n\t\"\\n\" +\n\t\"vcs_commit\\x18\\a \\x01(\\v20.buf.alpha.registry.v1alpha1.RepositoryVCSCommitH\\x00R\\tvcsCommitB\\v\\n\" +\n\t\"\\treferenceJ\\x04\\b\\x04\\x10\\x05R\\x05track\\\"t\\n\" +\n\t\"\\x17RepositoryMainReference\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12E\\n\" +\n\t\"\\x06commit\\x18\\x02 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x06commit\\\"l\\n\" +\n\t\"\\x0fRepositoryDraft\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12E\\n\" +\n\t\"\\x06commit\\x18\\x02 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x06commit\\\"\\x97\\x01\\n\" +\n\t\"\\x13RepositoryVCSCommit\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x03 \\x01(\\tR\\x04name\\x12\\x1f\\n\" +\n\t\"\\vcommit_name\\x18\\x04 \\x01(\\tR\\n\" +\n\t\"commitName\\\"n\\n\" +\n\t\"\\x19GetReferenceByNameRequest\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x02 \\x01(\\tR\\x05owner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x03 \\x01(\\tR\\x0erepositoryName\\\"b\\n\" +\n\t\"\\x1aGetReferenceByNameResponse\\x12D\\n\" +\n\t\"\\treference\\x18\\x01 \\x01(\\v2&.buf.alpha.registry.v1alpha1.ReferenceR\\treference2\\x9f\\x01\\n\" +\n\t\"\\x10ReferenceService\\x12\\x8a\\x01\\n\" +\n\t\"\\x12GetReferenceByName\\x126.buf.alpha.registry.v1alpha1.GetReferenceByNameRequest\\x1a7.buf.alpha.registry.v1alpha1.GetReferenceByNameResponse\\\"\\x03\\x90\\x02\\x01B\\x9b\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x0eReferenceProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes = make([]protoimpl.MessageInfo, 6)\nvar file_buf_alpha_registry_v1alpha1_reference_proto_goTypes = []any{\n\t(*Reference)(nil),                  // 0: buf.alpha.registry.v1alpha1.Reference\n\t(*RepositoryMainReference)(nil),    // 1: buf.alpha.registry.v1alpha1.RepositoryMainReference\n\t(*RepositoryDraft)(nil),            // 2: buf.alpha.registry.v1alpha1.RepositoryDraft\n\t(*RepositoryVCSCommit)(nil),        // 3: buf.alpha.registry.v1alpha1.RepositoryVCSCommit\n\t(*GetReferenceByNameRequest)(nil),  // 4: buf.alpha.registry.v1alpha1.GetReferenceByNameRequest\n\t(*GetReferenceByNameResponse)(nil), // 5: buf.alpha.registry.v1alpha1.GetReferenceByNameResponse\n\t(*RepositoryBranch)(nil),           // 6: buf.alpha.registry.v1alpha1.RepositoryBranch\n\t(*RepositoryTag)(nil),              // 7: buf.alpha.registry.v1alpha1.RepositoryTag\n\t(*RepositoryCommit)(nil),           // 8: buf.alpha.registry.v1alpha1.RepositoryCommit\n\t(*timestamppb.Timestamp)(nil),      // 9: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_reference_proto_depIdxs = []int32{\n\t6,  // 0: buf.alpha.registry.v1alpha1.Reference.branch:type_name -> buf.alpha.registry.v1alpha1.RepositoryBranch\n\t7,  // 1: buf.alpha.registry.v1alpha1.Reference.tag:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t8,  // 2: buf.alpha.registry.v1alpha1.Reference.commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t1,  // 3: buf.alpha.registry.v1alpha1.Reference.main:type_name -> buf.alpha.registry.v1alpha1.RepositoryMainReference\n\t2,  // 4: buf.alpha.registry.v1alpha1.Reference.draft:type_name -> buf.alpha.registry.v1alpha1.RepositoryDraft\n\t3,  // 5: buf.alpha.registry.v1alpha1.Reference.vcs_commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryVCSCommit\n\t8,  // 6: buf.alpha.registry.v1alpha1.RepositoryMainReference.commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t8,  // 7: buf.alpha.registry.v1alpha1.RepositoryDraft.commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t9,  // 8: buf.alpha.registry.v1alpha1.RepositoryVCSCommit.create_time:type_name -> google.protobuf.Timestamp\n\t0,  // 9: buf.alpha.registry.v1alpha1.GetReferenceByNameResponse.reference:type_name -> buf.alpha.registry.v1alpha1.Reference\n\t4,  // 10: buf.alpha.registry.v1alpha1.ReferenceService.GetReferenceByName:input_type -> buf.alpha.registry.v1alpha1.GetReferenceByNameRequest\n\t5,  // 11: buf.alpha.registry.v1alpha1.ReferenceService.GetReferenceByName:output_type -> buf.alpha.registry.v1alpha1.GetReferenceByNameResponse\n\t11, // [11:12] is the sub-list for method output_type\n\t10, // [10:11] is the sub-list for method input_type\n\t10, // [10:10] is the sub-list for extension type_name\n\t10, // [10:10] is the sub-list for extension extendee\n\t0,  // [0:10] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_reference_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_reference_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_reference_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_repository_branch_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_commit_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_tag_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[0].OneofWrappers = []any{\n\t\t(*reference_Branch)(nil),\n\t\t(*reference_Tag)(nil),\n\t\t(*reference_Commit)(nil),\n\t\t(*reference_Main)(nil),\n\t\t(*reference_Draft)(nil),\n\t\t(*reference_VcsCommit)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_reference_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_reference_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   6,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_reference_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_reference_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_reference_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_reference_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_reference_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/repository.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/repository.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 Visibility int32\n\nconst (\n\tVisibility_VISIBILITY_UNSPECIFIED Visibility = 0\n\tVisibility_VISIBILITY_PUBLIC      Visibility = 1\n\tVisibility_VISIBILITY_PRIVATE     Visibility = 2\n)\n\n// Enum value maps for Visibility.\nvar (\n\tVisibility_name = map[int32]string{\n\t\t0: \"VISIBILITY_UNSPECIFIED\",\n\t\t1: \"VISIBILITY_PUBLIC\",\n\t\t2: \"VISIBILITY_PRIVATE\",\n\t}\n\tVisibility_value = map[string]int32{\n\t\t\"VISIBILITY_UNSPECIFIED\": 0,\n\t\t\"VISIBILITY_PUBLIC\":      1,\n\t\t\"VISIBILITY_PRIVATE\":     2,\n\t}\n)\n\nfunc (x Visibility) Enum() *Visibility {\n\tp := new(Visibility)\n\t*p = x\n\treturn p\n}\n\nfunc (x Visibility) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Visibility) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Visibility) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes[0]\n}\n\nfunc (x Visibility) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype Repository struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id                 string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime         *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_UpdateTime         *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=update_time,json=updateTime,proto3\"`\n\txxx_hidden_Name               string                 `protobuf:\"bytes,4,opt,name=name,proto3\"`\n\txxx_hidden_Owner              isRepository_Owner     `protobuf_oneof:\"owner\"`\n\txxx_hidden_Visibility         Visibility             `protobuf:\"varint,7,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_Deprecated         bool                   `protobuf:\"varint,8,opt,name=deprecated,proto3\"`\n\txxx_hidden_DeprecationMessage string                 `protobuf:\"bytes,9,opt,name=deprecation_message,json=deprecationMessage,proto3\"`\n\txxx_hidden_OwnerName          string                 `protobuf:\"bytes,10,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_Description        string                 `protobuf:\"bytes,11,opt,name=description,proto3\"`\n\txxx_hidden_Url                string                 `protobuf:\"bytes,12,opt,name=url,proto3\"`\n\txxx_hidden_DefaultBranch      string                 `protobuf:\"bytes,13,opt,name=default_branch,json=defaultBranch,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *Repository) Reset() {\n\t*x = Repository{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Repository) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Repository) ProtoMessage() {}\n\nfunc (x *Repository) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *Repository) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *Repository) GetUpdateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UpdateTime\n\t}\n\treturn nil\n}\n\nfunc (x *Repository) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetUserId() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Owner.(*repository_UserId); ok {\n\t\t\treturn x.UserId\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetOrganizationId() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Owner.(*repository_OrganizationId); ok {\n\t\t\treturn x.OrganizationId\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetVisibility() Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn Visibility_VISIBILITY_UNSPECIFIED\n}\n\nfunc (x *Repository) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *Repository) GetDeprecationMessage() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DeprecationMessage\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetDescription() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Description\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Url\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) GetDefaultBranch() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DefaultBranch\n\t}\n\treturn \"\"\n}\n\nfunc (x *Repository) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *Repository) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *Repository) SetUpdateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_UpdateTime = v\n}\n\nfunc (x *Repository) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *Repository) SetUserId(v string) {\n\tx.xxx_hidden_Owner = &repository_UserId{v}\n}\n\nfunc (x *Repository) SetOrganizationId(v string) {\n\tx.xxx_hidden_Owner = &repository_OrganizationId{v}\n}\n\nfunc (x *Repository) SetVisibility(v Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *Repository) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *Repository) SetDeprecationMessage(v string) {\n\tx.xxx_hidden_DeprecationMessage = v\n}\n\nfunc (x *Repository) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *Repository) SetDescription(v string) {\n\tx.xxx_hidden_Description = v\n}\n\nfunc (x *Repository) SetUrl(v string) {\n\tx.xxx_hidden_Url = v\n}\n\nfunc (x *Repository) SetDefaultBranch(v string) {\n\tx.xxx_hidden_DefaultBranch = v\n}\n\nfunc (x *Repository) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *Repository) HasUpdateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_UpdateTime != nil\n}\n\nfunc (x *Repository) HasOwner() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Owner != nil\n}\n\nfunc (x *Repository) HasUserId() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Owner.(*repository_UserId)\n\treturn ok\n}\n\nfunc (x *Repository) HasOrganizationId() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Owner.(*repository_OrganizationId)\n\treturn ok\n}\n\nfunc (x *Repository) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *Repository) ClearUpdateTime() {\n\tx.xxx_hidden_UpdateTime = nil\n}\n\nfunc (x *Repository) ClearOwner() {\n\tx.xxx_hidden_Owner = nil\n}\n\nfunc (x *Repository) ClearUserId() {\n\tif _, ok := x.xxx_hidden_Owner.(*repository_UserId); ok {\n\t\tx.xxx_hidden_Owner = nil\n\t}\n}\n\nfunc (x *Repository) ClearOrganizationId() {\n\tif _, ok := x.xxx_hidden_Owner.(*repository_OrganizationId); ok {\n\t\tx.xxx_hidden_Owner = nil\n\t}\n}\n\nconst Repository_Owner_not_set_case case_Repository_Owner = 0\nconst Repository_UserId_case case_Repository_Owner = 5\nconst Repository_OrganizationId_case case_Repository_Owner = 6\n\nfunc (x *Repository) WhichOwner() case_Repository_Owner {\n\tif x == nil {\n\t\treturn Repository_Owner_not_set_case\n\t}\n\tswitch x.xxx_hidden_Owner.(type) {\n\tcase *repository_UserId:\n\t\treturn Repository_UserId_case\n\tcase *repository_OrganizationId:\n\t\treturn Repository_OrganizationId_case\n\tdefault:\n\t\treturn Repository_Owner_not_set_case\n\t}\n}\n\ntype Repository_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// primary key, unique, immutable\n\tId string\n\t// immutable\n\tCreateTime *timestamppb.Timestamp\n\t// mutable\n\tUpdateTime *timestamppb.Timestamp\n\t// unique, mutable\n\tName string\n\t// Fields of oneof xxx_hidden_Owner:\n\t// foreign key, mutable\n\tUserId *string\n\t// foreign key, mutable\n\tOrganizationId *string\n\t// -- end of xxx_hidden_Owner\n\tVisibility Visibility\n\t// deprecated means this repository is deprecated.\n\tDeprecated bool\n\t// deprecation_message is the message shown if the repository is deprecated.\n\tDeprecationMessage string\n\t// owner_name is the name of the owner of the repository,\n\t// either a username or organization name.\n\tOwnerName string\n\t// description is the user configurable description of the repository.\n\tDescription string\n\t// url is the user configurable URL in the description of the repository,\n\t// always included the scheme and will not have a #fragment suffix.\n\tUrl string\n\t// default_branch in a BSR repository. It is used when syncing a git repository, to make sure both\n\t// default branches (BSR and Git) are in sync. By default, every BSR repository is created with a\n\t// \"main\" default branch.\n\tDefaultBranch string\n}\n\nfunc (b0 Repository_builder) Build() *Repository {\n\tm0 := &Repository{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_UpdateTime = b.UpdateTime\n\tx.xxx_hidden_Name = b.Name\n\tif b.UserId != nil {\n\t\tx.xxx_hidden_Owner = &repository_UserId{*b.UserId}\n\t}\n\tif b.OrganizationId != nil {\n\t\tx.xxx_hidden_Owner = &repository_OrganizationId{*b.OrganizationId}\n\t}\n\tx.xxx_hidden_Visibility = b.Visibility\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\tx.xxx_hidden_DeprecationMessage = b.DeprecationMessage\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_Description = b.Description\n\tx.xxx_hidden_Url = b.Url\n\tx.xxx_hidden_DefaultBranch = b.DefaultBranch\n\treturn m0\n}\n\ntype case_Repository_Owner protoreflect.FieldNumber\n\nfunc (x case_Repository_Owner) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[0].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isRepository_Owner interface {\n\tisRepository_Owner()\n}\n\ntype repository_UserId struct {\n\t// foreign key, mutable\n\tUserId string `protobuf:\"bytes,5,opt,name=user_id,json=userId,proto3,oneof\"`\n}\n\ntype repository_OrganizationId struct {\n\t// foreign key, mutable\n\tOrganizationId string `protobuf:\"bytes,6,opt,name=organization_id,json=organizationId,proto3,oneof\"`\n}\n\nfunc (*repository_UserId) isRepository_Owner() {}\n\nfunc (*repository_OrganizationId) isRepository_Owner() {}\n\ntype RepositoryCounts struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_TagsCount   uint32                 `protobuf:\"varint,1,opt,name=tags_count,json=tagsCount,proto3\"`\n\txxx_hidden_DraftsCount uint32                 `protobuf:\"varint,3,opt,name=drafts_count,json=draftsCount,proto3\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *RepositoryCounts) Reset() {\n\t*x = RepositoryCounts{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryCounts) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryCounts) ProtoMessage() {}\n\nfunc (x *RepositoryCounts) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *RepositoryCounts) GetTagsCount() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TagsCount\n\t}\n\treturn 0\n}\n\nfunc (x *RepositoryCounts) GetDraftsCount() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DraftsCount\n\t}\n\treturn 0\n}\n\nfunc (x *RepositoryCounts) SetTagsCount(v uint32) {\n\tx.xxx_hidden_TagsCount = v\n}\n\nfunc (x *RepositoryCounts) SetDraftsCount(v uint32) {\n\tx.xxx_hidden_DraftsCount = v\n}\n\ntype RepositoryCounts_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tTagsCount   uint32\n\tDraftsCount uint32\n}\n\nfunc (b0 RepositoryCounts_builder) Build() *RepositoryCounts {\n\tm0 := &RepositoryCounts{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TagsCount = b.TagsCount\n\tx.xxx_hidden_DraftsCount = b.DraftsCount\n\treturn m0\n}\n\ntype RepositoryContributor struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User         *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,2,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_ExplicitRole RepositoryRole         `protobuf:\"varint,3,opt,name=explicit_role,json=explicitRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\txxx_hidden_ImplicitRole RepositoryRole         `protobuf:\"varint,4,opt,name=implicit_role,json=implicitRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *RepositoryContributor) Reset() {\n\t*x = RepositoryContributor{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryContributor) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryContributor) ProtoMessage() {}\n\nfunc (x *RepositoryContributor) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *RepositoryContributor) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryContributor) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryContributor) GetExplicitRole() RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExplicitRole\n\t}\n\treturn RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\nfunc (x *RepositoryContributor) GetImplicitRole() RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ImplicitRole\n\t}\n\treturn RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\nfunc (x *RepositoryContributor) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *RepositoryContributor) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *RepositoryContributor) SetExplicitRole(v RepositoryRole) {\n\tx.xxx_hidden_ExplicitRole = v\n}\n\nfunc (x *RepositoryContributor) SetImplicitRole(v RepositoryRole) {\n\tx.xxx_hidden_ImplicitRole = v\n}\n\nfunc (x *RepositoryContributor) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *RepositoryContributor) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype RepositoryContributor_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUser *User\n\t// The ID of the for which the role belongs to.\n\tRepositoryId string\n\t// The role that the user has been explicitly assigned against the repository.\n\tExplicitRole RepositoryRole\n\t// Optionally defines the role that the user has implicitly against the repository through the owning organization.\n\t// If the repository does not belong to an organization or the user is not part of the owning organization, this is unset.\n\tImplicitRole RepositoryRole\n}\n\nfunc (b0 RepositoryContributor_builder) Build() *RepositoryContributor {\n\tm0 := &RepositoryContributor{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_ExplicitRole = b.ExplicitRole\n\tx.xxx_hidden_ImplicitRole = b.ImplicitRole\n\treturn m0\n}\n\ntype RepositoryMetadata struct {\n\tstate                              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id                      string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Name                    string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_OwnerName               string                 `protobuf:\"bytes,3,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_OwnerVerificationStatus VerificationStatus     `protobuf:\"varint,4,opt,name=owner_verification_status,json=ownerVerificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus\"`\n\txxx_hidden_LatestCommitTime        *timestamppb.Timestamp `protobuf:\"bytes,5,opt,name=latest_commit_time,json=latestCommitTime,proto3\"`\n\txxx_hidden_LatestSpdxLicenseId     string                 `protobuf:\"bytes,6,opt,name=latest_spdx_license_id,json=latestSpdxLicenseId,proto3\"`\n\tunknownFields                      protoimpl.UnknownFields\n\tsizeCache                          protoimpl.SizeCache\n}\n\nfunc (x *RepositoryMetadata) Reset() {\n\t*x = RepositoryMetadata{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryMetadata) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryMetadata) ProtoMessage() {}\n\nfunc (x *RepositoryMetadata) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *RepositoryMetadata) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryMetadata) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryMetadata) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryMetadata) GetOwnerVerificationStatus() VerificationStatus {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerVerificationStatus\n\t}\n\treturn VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED\n}\n\nfunc (x *RepositoryMetadata) GetLatestCommitTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LatestCommitTime\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryMetadata) GetLatestSpdxLicenseId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LatestSpdxLicenseId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryMetadata) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *RepositoryMetadata) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositoryMetadata) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *RepositoryMetadata) SetOwnerVerificationStatus(v VerificationStatus) {\n\tx.xxx_hidden_OwnerVerificationStatus = v\n}\n\nfunc (x *RepositoryMetadata) SetLatestCommitTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_LatestCommitTime = v\n}\n\nfunc (x *RepositoryMetadata) SetLatestSpdxLicenseId(v string) {\n\tx.xxx_hidden_LatestSpdxLicenseId = v\n}\n\nfunc (x *RepositoryMetadata) HasLatestCommitTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_LatestCommitTime != nil\n}\n\nfunc (x *RepositoryMetadata) ClearLatestCommitTime() {\n\tx.xxx_hidden_LatestCommitTime = nil\n}\n\ntype RepositoryMetadata_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository.\n\tId string\n\t// The name of the repository.\n\tName string\n\t// The owner name of the repository.\n\tOwnerName string\n\t// The verification status of the owner of the repository.\n\tOwnerVerificationStatus VerificationStatus\n\t// The commit time of the latest main commit in the repository.\n\tLatestCommitTime *timestamppb.Timestamp\n\t// The SPDX license ID of the latest main commit in the repository.\n\tLatestSpdxLicenseId string\n}\n\nfunc (b0 RepositoryMetadata_builder) Build() *RepositoryMetadata {\n\tm0 := &RepositoryMetadata{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_OwnerVerificationStatus = b.OwnerVerificationStatus\n\tx.xxx_hidden_LatestCommitTime = b.LatestCommitTime\n\tx.xxx_hidden_LatestSpdxLicenseId = b.LatestSpdxLicenseId\n\treturn m0\n}\n\ntype GetRepositoriesByFullNameRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_FullNames []string               `protobuf:\"bytes,1,rep,name=full_names,json=fullNames,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoriesByFullNameRequest) Reset() {\n\t*x = GetRepositoriesByFullNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoriesByFullNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoriesByFullNameRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoriesByFullNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *GetRepositoriesByFullNameRequest) GetFullNames() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullNames\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoriesByFullNameRequest) SetFullNames(v []string) {\n\tx.xxx_hidden_FullNames = v\n}\n\ntype GetRepositoriesByFullNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// minimum length is 1\n\t// maximum length is 250\n\tFullNames []string\n}\n\nfunc (b0 GetRepositoriesByFullNameRequest_builder) Build() *GetRepositoriesByFullNameRequest {\n\tm0 := &GetRepositoriesByFullNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_FullNames = b.FullNames\n\treturn m0\n}\n\ntype GetRepositoriesByFullNameResponse struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repositories *[]*Repository         `protobuf:\"bytes,1,rep,name=repositories,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoriesByFullNameResponse) Reset() {\n\t*x = GetRepositoriesByFullNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoriesByFullNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoriesByFullNameResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoriesByFullNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *GetRepositoriesByFullNameResponse) GetRepositories() []*Repository {\n\tif x != nil {\n\t\tif x.xxx_hidden_Repositories != nil {\n\t\t\treturn *x.xxx_hidden_Repositories\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoriesByFullNameResponse) SetRepositories(v []*Repository) {\n\tx.xxx_hidden_Repositories = &v\n}\n\ntype GetRepositoriesByFullNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositories []*Repository\n}\n\nfunc (b0 GetRepositoriesByFullNameResponse_builder) Build() *GetRepositoriesByFullNameResponse {\n\tm0 := &GetRepositoriesByFullNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repositories = &b.Repositories\n\treturn m0\n}\n\ntype GetRepositoryRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryRequest) Reset() {\n\t*x = GetRepositoryRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoryRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *GetRepositoryRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\ntype GetRepositoryRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId string\n}\n\nfunc (b0 GetRepositoryRequest_builder) Build() *GetRepositoryRequest {\n\tm0 := &GetRepositoryRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\treturn m0\n}\n\ntype GetRepositoryResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repository *Repository            `protobuf:\"bytes,1,opt,name=repository,proto3\"`\n\txxx_hidden_Counts     *RepositoryCounts      `protobuf:\"bytes,2,opt,name=counts,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryResponse) Reset() {\n\t*x = GetRepositoryResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoryResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *GetRepositoryResponse) GetRepository() *Repository {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoryResponse) GetCounts() *RepositoryCounts {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Counts\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoryResponse) SetRepository(v *Repository) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetRepositoryResponse) SetCounts(v *RepositoryCounts) {\n\tx.xxx_hidden_Counts = v\n}\n\nfunc (x *GetRepositoryResponse) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Repository != nil\n}\n\nfunc (x *GetRepositoryResponse) HasCounts() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Counts != nil\n}\n\nfunc (x *GetRepositoryResponse) ClearRepository() {\n\tx.xxx_hidden_Repository = nil\n}\n\nfunc (x *GetRepositoryResponse) ClearCounts() {\n\tx.xxx_hidden_Counts = nil\n}\n\ntype GetRepositoryResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepository *Repository\n\tCounts     *RepositoryCounts\n}\n\nfunc (b0 GetRepositoryResponse_builder) Build() *GetRepositoryResponse {\n\tm0 := &GetRepositoryResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Counts = b.Counts\n\treturn m0\n}\n\ntype GetRepositoryByFullNameRequest struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_FullName string                 `protobuf:\"bytes,1,opt,name=full_name,json=fullName,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryByFullNameRequest) Reset() {\n\t*x = GetRepositoryByFullNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryByFullNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryByFullNameRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoryByFullNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_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\nfunc (x *GetRepositoryByFullNameRequest) GetFullName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullName\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryByFullNameRequest) SetFullName(v string) {\n\tx.xxx_hidden_FullName = v\n}\n\ntype GetRepositoryByFullNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tFullName string\n}\n\nfunc (b0 GetRepositoryByFullNameRequest_builder) Build() *GetRepositoryByFullNameRequest {\n\tm0 := &GetRepositoryByFullNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_FullName = b.FullName\n\treturn m0\n}\n\ntype GetRepositoryByFullNameResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repository *Repository            `protobuf:\"bytes,1,opt,name=repository,proto3\"`\n\txxx_hidden_Counts     *RepositoryCounts      `protobuf:\"bytes,2,opt,name=counts,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryByFullNameResponse) Reset() {\n\t*x = GetRepositoryByFullNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryByFullNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryByFullNameResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoryByFullNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[9]\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\nfunc (x *GetRepositoryByFullNameResponse) GetRepository() *Repository {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoryByFullNameResponse) GetCounts() *RepositoryCounts {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Counts\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoryByFullNameResponse) SetRepository(v *Repository) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetRepositoryByFullNameResponse) SetCounts(v *RepositoryCounts) {\n\tx.xxx_hidden_Counts = v\n}\n\nfunc (x *GetRepositoryByFullNameResponse) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Repository != nil\n}\n\nfunc (x *GetRepositoryByFullNameResponse) HasCounts() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Counts != nil\n}\n\nfunc (x *GetRepositoryByFullNameResponse) ClearRepository() {\n\tx.xxx_hidden_Repository = nil\n}\n\nfunc (x *GetRepositoryByFullNameResponse) ClearCounts() {\n\tx.xxx_hidden_Counts = nil\n}\n\ntype GetRepositoryByFullNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepository *Repository\n\tCounts     *RepositoryCounts\n}\n\nfunc (b0 GetRepositoryByFullNameResponse_builder) Build() *GetRepositoryByFullNameResponse {\n\tm0 := &GetRepositoryByFullNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Counts = b.Counts\n\treturn m0\n}\n\ntype ListRepositoriesRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoriesRequest) Reset() {\n\t*x = ListRepositoriesRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoriesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoriesRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoriesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[10]\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\nfunc (x *ListRepositoriesRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoriesRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoriesRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoriesRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoriesRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoriesRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoriesRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListRepositoriesRequest_builder) Build() *ListRepositoriesRequest {\n\tm0 := &ListRepositoriesRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoriesResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repositories  *[]*Repository         `protobuf:\"bytes,1,rep,name=repositories,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoriesResponse) Reset() {\n\t*x = ListRepositoriesResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoriesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoriesResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoriesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[11]\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\nfunc (x *ListRepositoriesResponse) GetRepositories() []*Repository {\n\tif x != nil {\n\t\tif x.xxx_hidden_Repositories != nil {\n\t\t\treturn *x.xxx_hidden_Repositories\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoriesResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoriesResponse) SetRepositories(v []*Repository) {\n\tx.xxx_hidden_Repositories = &v\n}\n\nfunc (x *ListRepositoriesResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoriesResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositories []*Repository\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListRepositoriesResponse_builder) Build() *ListRepositoriesResponse {\n\tm0 := &ListRepositoriesResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repositories = &b.Repositories\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListUserRepositoriesRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserId    string                 `protobuf:\"bytes,1,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,4,opt,name=reverse,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListUserRepositoriesRequest) Reset() {\n\t*x = ListUserRepositoriesRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListUserRepositoriesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListUserRepositoriesRequest) ProtoMessage() {}\n\nfunc (x *ListUserRepositoriesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[12]\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\nfunc (x *ListUserRepositoriesRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUserRepositoriesRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListUserRepositoriesRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUserRepositoriesRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListUserRepositoriesRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *ListUserRepositoriesRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListUserRepositoriesRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListUserRepositoriesRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListUserRepositoriesRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the user whose repositories should be listed.\n\tUserId   string\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListUserRepositoriesRequest_builder) Build() *ListUserRepositoriesRequest {\n\tm0 := &ListUserRepositoriesRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListUserRepositoriesResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repositories  *[]*Repository         `protobuf:\"bytes,1,rep,name=repositories,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListUserRepositoriesResponse) Reset() {\n\t*x = ListUserRepositoriesResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListUserRepositoriesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListUserRepositoriesResponse) ProtoMessage() {}\n\nfunc (x *ListUserRepositoriesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[13]\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\nfunc (x *ListUserRepositoriesResponse) GetRepositories() []*Repository {\n\tif x != nil {\n\t\tif x.xxx_hidden_Repositories != nil {\n\t\t\treturn *x.xxx_hidden_Repositories\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListUserRepositoriesResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUserRepositoriesResponse) SetRepositories(v []*Repository) {\n\tx.xxx_hidden_Repositories = &v\n}\n\nfunc (x *ListUserRepositoriesResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListUserRepositoriesResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositories []*Repository\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListUserRepositoriesResponse_builder) Build() *ListUserRepositoriesResponse {\n\tm0 := &ListUserRepositoriesResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repositories = &b.Repositories\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListRepositoriesUserCanAccessRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) Reset() {\n\t*x = ListRepositoriesUserCanAccessRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoriesUserCanAccessRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[14]\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\nfunc (x *ListRepositoriesUserCanAccessRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoriesUserCanAccessRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoriesUserCanAccessRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListRepositoriesUserCanAccessRequest_builder) Build() *ListRepositoriesUserCanAccessRequest {\n\tm0 := &ListRepositoriesUserCanAccessRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoriesUserCanAccessResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repositories  *[]*Repository         `protobuf:\"bytes,1,rep,name=repositories,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoriesUserCanAccessResponse) Reset() {\n\t*x = ListRepositoriesUserCanAccessResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoriesUserCanAccessResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoriesUserCanAccessResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoriesUserCanAccessResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[15]\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\nfunc (x *ListRepositoriesUserCanAccessResponse) GetRepositories() []*Repository {\n\tif x != nil {\n\t\tif x.xxx_hidden_Repositories != nil {\n\t\t\treturn *x.xxx_hidden_Repositories\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoriesUserCanAccessResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoriesUserCanAccessResponse) SetRepositories(v []*Repository) {\n\tx.xxx_hidden_Repositories = &v\n}\n\nfunc (x *ListRepositoriesUserCanAccessResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoriesUserCanAccessResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositories []*Repository\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListRepositoriesUserCanAccessResponse_builder) Build() *ListRepositoriesUserCanAccessResponse {\n\tm0 := &ListRepositoriesUserCanAccessResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repositories = &b.Repositories\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListOrganizationRepositoriesRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_PageSize       uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken      string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse        bool                   `protobuf:\"varint,4,opt,name=reverse,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) Reset() {\n\t*x = ListOrganizationRepositoriesRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListOrganizationRepositoriesRequest) ProtoMessage() {}\n\nfunc (x *ListOrganizationRepositoriesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[16]\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\nfunc (x *ListOrganizationRepositoriesRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListOrganizationRepositoriesRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListOrganizationRepositoriesRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the organization whose repositories should be listed.\n\tOrganizationId string\n\tPageSize       uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListOrganizationRepositoriesRequest_builder) Build() *ListOrganizationRepositoriesRequest {\n\tm0 := &ListOrganizationRepositoriesRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListOrganizationRepositoriesResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repositories  *[]*Repository         `protobuf:\"bytes,1,rep,name=repositories,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListOrganizationRepositoriesResponse) Reset() {\n\t*x = ListOrganizationRepositoriesResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListOrganizationRepositoriesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListOrganizationRepositoriesResponse) ProtoMessage() {}\n\nfunc (x *ListOrganizationRepositoriesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[17]\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\nfunc (x *ListOrganizationRepositoriesResponse) GetRepositories() []*Repository {\n\tif x != nil {\n\t\tif x.xxx_hidden_Repositories != nil {\n\t\t\treturn *x.xxx_hidden_Repositories\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListOrganizationRepositoriesResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationRepositoriesResponse) SetRepositories(v []*Repository) {\n\tx.xxx_hidden_Repositories = &v\n}\n\nfunc (x *ListOrganizationRepositoriesResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListOrganizationRepositoriesResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositories []*Repository\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListOrganizationRepositoriesResponse_builder) Build() *ListOrganizationRepositoriesResponse {\n\tm0 := &ListOrganizationRepositoriesResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repositories = &b.Repositories\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype CreateRepositoryByFullNameRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_FullName   string                 `protobuf:\"bytes,1,opt,name=full_name,json=fullName,proto3\"`\n\txxx_hidden_Visibility Visibility             `protobuf:\"varint,2,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *CreateRepositoryByFullNameRequest) Reset() {\n\t*x = CreateRepositoryByFullNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateRepositoryByFullNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateRepositoryByFullNameRequest) ProtoMessage() {}\n\nfunc (x *CreateRepositoryByFullNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[18]\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\nfunc (x *CreateRepositoryByFullNameRequest) GetFullName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullName\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateRepositoryByFullNameRequest) GetVisibility() Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn Visibility_VISIBILITY_UNSPECIFIED\n}\n\nfunc (x *CreateRepositoryByFullNameRequest) SetFullName(v string) {\n\tx.xxx_hidden_FullName = v\n}\n\nfunc (x *CreateRepositoryByFullNameRequest) SetVisibility(v Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\ntype CreateRepositoryByFullNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Must be unique across repositories.\n\tFullName   string\n\tVisibility Visibility\n}\n\nfunc (b0 CreateRepositoryByFullNameRequest_builder) Build() *CreateRepositoryByFullNameRequest {\n\tm0 := &CreateRepositoryByFullNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_FullName = b.FullName\n\tx.xxx_hidden_Visibility = b.Visibility\n\treturn m0\n}\n\ntype CreateRepositoryByFullNameResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repository *Repository            `protobuf:\"bytes,1,opt,name=repository,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *CreateRepositoryByFullNameResponse) Reset() {\n\t*x = CreateRepositoryByFullNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateRepositoryByFullNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateRepositoryByFullNameResponse) ProtoMessage() {}\n\nfunc (x *CreateRepositoryByFullNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[19]\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\nfunc (x *CreateRepositoryByFullNameResponse) GetRepository() *Repository {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn nil\n}\n\nfunc (x *CreateRepositoryByFullNameResponse) SetRepository(v *Repository) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *CreateRepositoryByFullNameResponse) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Repository != nil\n}\n\nfunc (x *CreateRepositoryByFullNameResponse) ClearRepository() {\n\tx.xxx_hidden_Repository = nil\n}\n\ntype CreateRepositoryByFullNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepository *Repository\n}\n\nfunc (b0 CreateRepositoryByFullNameResponse_builder) Build() *CreateRepositoryByFullNameResponse {\n\tm0 := &CreateRepositoryByFullNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repository = b.Repository\n\treturn m0\n}\n\ntype DeleteRepositoryRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteRepositoryRequest) Reset() {\n\t*x = DeleteRepositoryRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteRepositoryRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteRepositoryRequest) ProtoMessage() {}\n\nfunc (x *DeleteRepositoryRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[20]\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\nfunc (x *DeleteRepositoryRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteRepositoryRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\ntype DeleteRepositoryRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId string\n}\n\nfunc (b0 DeleteRepositoryRequest_builder) Build() *DeleteRepositoryRequest {\n\tm0 := &DeleteRepositoryRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\treturn m0\n}\n\ntype DeleteRepositoryResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteRepositoryResponse) Reset() {\n\t*x = DeleteRepositoryResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteRepositoryResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteRepositoryResponse) ProtoMessage() {}\n\nfunc (x *DeleteRepositoryResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[21]\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\ntype DeleteRepositoryResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteRepositoryResponse_builder) Build() *DeleteRepositoryResponse {\n\tm0 := &DeleteRepositoryResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype DeleteRepositoryByFullNameRequest struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_FullName string                 `protobuf:\"bytes,1,opt,name=full_name,json=fullName,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *DeleteRepositoryByFullNameRequest) Reset() {\n\t*x = DeleteRepositoryByFullNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteRepositoryByFullNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteRepositoryByFullNameRequest) ProtoMessage() {}\n\nfunc (x *DeleteRepositoryByFullNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[22]\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\nfunc (x *DeleteRepositoryByFullNameRequest) GetFullName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullName\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteRepositoryByFullNameRequest) SetFullName(v string) {\n\tx.xxx_hidden_FullName = v\n}\n\ntype DeleteRepositoryByFullNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tFullName string\n}\n\nfunc (b0 DeleteRepositoryByFullNameRequest_builder) Build() *DeleteRepositoryByFullNameRequest {\n\tm0 := &DeleteRepositoryByFullNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_FullName = b.FullName\n\treturn m0\n}\n\ntype DeleteRepositoryByFullNameResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteRepositoryByFullNameResponse) Reset() {\n\t*x = DeleteRepositoryByFullNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteRepositoryByFullNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteRepositoryByFullNameResponse) ProtoMessage() {}\n\nfunc (x *DeleteRepositoryByFullNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[23]\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\ntype DeleteRepositoryByFullNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteRepositoryByFullNameResponse_builder) Build() *DeleteRepositoryByFullNameResponse {\n\tm0 := &DeleteRepositoryByFullNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype DeprecateRepositoryByNameRequest struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerName          string                 `protobuf:\"bytes,1,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryName     string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_DeprecationMessage string                 `protobuf:\"bytes,3,opt,name=deprecation_message,json=deprecationMessage,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *DeprecateRepositoryByNameRequest) Reset() {\n\t*x = DeprecateRepositoryByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[24]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeprecateRepositoryByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeprecateRepositoryByNameRequest) ProtoMessage() {}\n\nfunc (x *DeprecateRepositoryByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[24]\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\nfunc (x *DeprecateRepositoryByNameRequest) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeprecateRepositoryByNameRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeprecateRepositoryByNameRequest) GetDeprecationMessage() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DeprecationMessage\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeprecateRepositoryByNameRequest) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *DeprecateRepositoryByNameRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *DeprecateRepositoryByNameRequest) SetDeprecationMessage(v string) {\n\tx.xxx_hidden_DeprecationMessage = v\n}\n\ntype DeprecateRepositoryByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwnerName      string\n\tRepositoryName string\n\t// A message shown along with the deprecation warning for this repository.\n\t// It must be a utf8 encoded string containing 256 or fewer characters.\n\tDeprecationMessage string\n}\n\nfunc (b0 DeprecateRepositoryByNameRequest_builder) Build() *DeprecateRepositoryByNameRequest {\n\tm0 := &DeprecateRepositoryByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_DeprecationMessage = b.DeprecationMessage\n\treturn m0\n}\n\ntype DeprecateRepositoryByNameResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repository *Repository            `protobuf:\"bytes,1,opt,name=repository,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *DeprecateRepositoryByNameResponse) Reset() {\n\t*x = DeprecateRepositoryByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[25]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeprecateRepositoryByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeprecateRepositoryByNameResponse) ProtoMessage() {}\n\nfunc (x *DeprecateRepositoryByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[25]\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\nfunc (x *DeprecateRepositoryByNameResponse) GetRepository() *Repository {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn nil\n}\n\nfunc (x *DeprecateRepositoryByNameResponse) SetRepository(v *Repository) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *DeprecateRepositoryByNameResponse) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Repository != nil\n}\n\nfunc (x *DeprecateRepositoryByNameResponse) ClearRepository() {\n\tx.xxx_hidden_Repository = nil\n}\n\ntype DeprecateRepositoryByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepository *Repository\n}\n\nfunc (b0 DeprecateRepositoryByNameResponse_builder) Build() *DeprecateRepositoryByNameResponse {\n\tm0 := &DeprecateRepositoryByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repository = b.Repository\n\treturn m0\n}\n\ntype UndeprecateRepositoryByNameRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,1,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UndeprecateRepositoryByNameRequest) Reset() {\n\t*x = UndeprecateRepositoryByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[26]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UndeprecateRepositoryByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UndeprecateRepositoryByNameRequest) ProtoMessage() {}\n\nfunc (x *UndeprecateRepositoryByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[26]\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\nfunc (x *UndeprecateRepositoryByNameRequest) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *UndeprecateRepositoryByNameRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *UndeprecateRepositoryByNameRequest) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *UndeprecateRepositoryByNameRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\ntype UndeprecateRepositoryByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwnerName      string\n\tRepositoryName string\n}\n\nfunc (b0 UndeprecateRepositoryByNameRequest_builder) Build() *UndeprecateRepositoryByNameRequest {\n\tm0 := &UndeprecateRepositoryByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\treturn m0\n}\n\ntype UndeprecateRepositoryByNameResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Repository *Repository            `protobuf:\"bytes,1,opt,name=repository,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UndeprecateRepositoryByNameResponse) Reset() {\n\t*x = UndeprecateRepositoryByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[27]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UndeprecateRepositoryByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UndeprecateRepositoryByNameResponse) ProtoMessage() {}\n\nfunc (x *UndeprecateRepositoryByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[27]\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\nfunc (x *UndeprecateRepositoryByNameResponse) GetRepository() *Repository {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn nil\n}\n\nfunc (x *UndeprecateRepositoryByNameResponse) SetRepository(v *Repository) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *UndeprecateRepositoryByNameResponse) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Repository != nil\n}\n\nfunc (x *UndeprecateRepositoryByNameResponse) ClearRepository() {\n\tx.xxx_hidden_Repository = nil\n}\n\ntype UndeprecateRepositoryByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepository *Repository\n}\n\nfunc (b0 UndeprecateRepositoryByNameResponse_builder) Build() *UndeprecateRepositoryByNameResponse {\n\tm0 := &UndeprecateRepositoryByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Repository = b.Repository\n\treturn m0\n}\n\ntype SetRepositoryContributorRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId   string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_UserId         string                 `protobuf:\"bytes,2,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_RepositoryRole RepositoryRole         `protobuf:\"varint,3,opt,name=repository_role,json=repositoryRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *SetRepositoryContributorRequest) Reset() {\n\t*x = SetRepositoryContributorRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[28]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SetRepositoryContributorRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SetRepositoryContributorRequest) ProtoMessage() {}\n\nfunc (x *SetRepositoryContributorRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[28]\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\nfunc (x *SetRepositoryContributorRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *SetRepositoryContributorRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *SetRepositoryContributorRequest) GetRepositoryRole() RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryRole\n\t}\n\treturn RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\nfunc (x *SetRepositoryContributorRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *SetRepositoryContributorRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *SetRepositoryContributorRequest) SetRepositoryRole(v RepositoryRole) {\n\tx.xxx_hidden_RepositoryRole = v\n}\n\ntype SetRepositoryContributorRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which the user's role will be set.\n\tRepositoryId string\n\t// The ID of the user whose role will be set.\n\tUserId string\n\t// The role to assign to the user.\n\t// Setting UNSPECIFIED means removing the user's role.\n\tRepositoryRole RepositoryRole\n}\n\nfunc (b0 SetRepositoryContributorRequest_builder) Build() *SetRepositoryContributorRequest {\n\tm0 := &SetRepositoryContributorRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_RepositoryRole = b.RepositoryRole\n\treturn m0\n}\n\ntype SetRepositoryContributorResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *SetRepositoryContributorResponse) Reset() {\n\t*x = SetRepositoryContributorResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[29]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SetRepositoryContributorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SetRepositoryContributorResponse) ProtoMessage() {}\n\nfunc (x *SetRepositoryContributorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[29]\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\ntype SetRepositoryContributorResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 SetRepositoryContributorResponse_builder) Build() *SetRepositoryContributorResponse {\n\tm0 := &SetRepositoryContributorResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype ListRepositoryContributorsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_PageSize     uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken    string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse      bool                   `protobuf:\"varint,4,opt,name=reverse,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryContributorsRequest) Reset() {\n\t*x = ListRepositoryContributorsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[30]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryContributorsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryContributorsRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryContributorsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[30]\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\nfunc (x *ListRepositoryContributorsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryContributorsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryContributorsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryContributorsRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoryContributorsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ListRepositoryContributorsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryContributorsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoryContributorsRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoryContributorsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryId string\n\tPageSize     uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListRepositoryContributorsRequest_builder) Build() *ListRepositoryContributorsRequest {\n\tm0 := &ListRepositoryContributorsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoryContributorsResponse struct {\n\tstate                    protoimpl.MessageState    `protogen:\"opaque.v1\"`\n\txxx_hidden_Users         *[]*RepositoryContributor `protobuf:\"bytes,1,rep,name=users,proto3\"`\n\txxx_hidden_NextPageToken string                    `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryContributorsResponse) Reset() {\n\t*x = ListRepositoryContributorsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[31]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryContributorsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryContributorsResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryContributorsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[31]\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\nfunc (x *ListRepositoryContributorsResponse) GetUsers() []*RepositoryContributor {\n\tif x != nil {\n\t\tif x.xxx_hidden_Users != nil {\n\t\t\treturn *x.xxx_hidden_Users\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryContributorsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryContributorsResponse) SetUsers(v []*RepositoryContributor) {\n\tx.xxx_hidden_Users = &v\n}\n\nfunc (x *ListRepositoryContributorsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryContributorsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUsers []*RepositoryContributor\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListRepositoryContributorsResponse_builder) Build() *ListRepositoryContributorsResponse {\n\tm0 := &ListRepositoryContributorsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Users = &b.Users\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype GetRepositorySettingsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetRepositorySettingsRequest) Reset() {\n\t*x = GetRepositorySettingsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[32]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositorySettingsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositorySettingsRequest) ProtoMessage() {}\n\nfunc (x *GetRepositorySettingsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[32]\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\nfunc (x *GetRepositorySettingsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositorySettingsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype GetRepositorySettingsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to get the settings.\n\tRepositoryId string\n}\n\nfunc (b0 GetRepositorySettingsRequest_builder) Build() *GetRepositorySettingsRequest {\n\tm0 := &GetRepositorySettingsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype GetRepositorySettingsResponse struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ContributorsCount uint32                 `protobuf:\"varint,1,opt,name=contributors_count,json=contributorsCount,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *GetRepositorySettingsResponse) Reset() {\n\t*x = GetRepositorySettingsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[33]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositorySettingsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositorySettingsResponse) ProtoMessage() {}\n\nfunc (x *GetRepositorySettingsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[33]\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\nfunc (x *GetRepositorySettingsResponse) GetContributorsCount() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ContributorsCount\n\t}\n\treturn 0\n}\n\nfunc (x *GetRepositorySettingsResponse) SetContributorsCount(v uint32) {\n\tx.xxx_hidden_ContributorsCount = v\n}\n\ntype GetRepositorySettingsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The number of outside contributors in the repository,\n\t// excluding owning-organization's members that have an explicit role.\n\tContributorsCount uint32\n}\n\nfunc (b0 GetRepositorySettingsResponse_builder) Build() *GetRepositorySettingsResponse {\n\tm0 := &GetRepositorySettingsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ContributorsCount = b.ContributorsCount\n\treturn m0\n}\n\ntype UpdateRepositorySettingsByNameRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,1,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Visibility     Visibility             `protobuf:\"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_Description    *string                `protobuf:\"bytes,4,opt,name=description,proto3,oneof\"`\n\txxx_hidden_Url            *string                `protobuf:\"bytes,5,opt,name=url,proto3,oneof\"`\n\txxx_hidden_DefaultBranch  *string                `protobuf:\"bytes,6,opt,name=default_branch,json=defaultBranch,proto3,oneof\"`\n\tXXX_raceDetectHookData    protoimpl.RaceDetectHookData\n\tXXX_presence              [1]uint32\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) Reset() {\n\t*x = UpdateRepositorySettingsByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[34]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateRepositorySettingsByNameRequest) ProtoMessage() {}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[34]\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\nfunc (x *UpdateRepositorySettingsByNameRequest) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) GetVisibility() Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn Visibility_VISIBILITY_UNSPECIFIED\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) GetDescription() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Description != nil {\n\t\t\treturn *x.xxx_hidden_Description\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) GetUrl() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Url != nil {\n\t\t\treturn *x.xxx_hidden_Url\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) GetDefaultBranch() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_DefaultBranch != nil {\n\t\t\treturn *x.xxx_hidden_DefaultBranch\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) SetVisibility(v Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) SetDescription(v string) {\n\tx.xxx_hidden_Description = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 6)\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) SetUrl(v string) {\n\tx.xxx_hidden_Url = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 6)\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) SetDefaultBranch(v string) {\n\tx.xxx_hidden_DefaultBranch = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 5, 6)\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) HasDescription() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 3)\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) HasUrl() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 4)\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) HasDefaultBranch() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 5)\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) ClearDescription() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3)\n\tx.xxx_hidden_Description = nil\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) ClearUrl() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4)\n\tx.xxx_hidden_Url = nil\n}\n\nfunc (x *UpdateRepositorySettingsByNameRequest) ClearDefaultBranch() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 5)\n\tx.xxx_hidden_DefaultBranch = nil\n}\n\ntype UpdateRepositorySettingsByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOwnerName      string\n\tRepositoryName string\n\t// optional, update to visibility will only be made if this is specified.\n\tVisibility Visibility\n\t// optional, update to description will only be made when this is present\n\tDescription *string\n\t// optional, update to url will only be made when this is present\n\tUrl *string\n\t// optional, update to default_branch will only be made when this is present\n\tDefaultBranch *string\n}\n\nfunc (b0 UpdateRepositorySettingsByNameRequest_builder) Build() *UpdateRepositorySettingsByNameRequest {\n\tm0 := &UpdateRepositorySettingsByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Visibility = b.Visibility\n\tif b.Description != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 6)\n\t\tx.xxx_hidden_Description = b.Description\n\t}\n\tif b.Url != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 6)\n\t\tx.xxx_hidden_Url = b.Url\n\t}\n\tif b.DefaultBranch != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 5, 6)\n\t\tx.xxx_hidden_DefaultBranch = b.DefaultBranch\n\t}\n\treturn m0\n}\n\ntype UpdateRepositorySettingsByNameResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateRepositorySettingsByNameResponse) Reset() {\n\t*x = UpdateRepositorySettingsByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[35]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateRepositorySettingsByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateRepositorySettingsByNameResponse) ProtoMessage() {}\n\nfunc (x *UpdateRepositorySettingsByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[35]\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\ntype UpdateRepositorySettingsByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateRepositorySettingsByNameResponse_builder) Build() *UpdateRepositorySettingsByNameResponse {\n\tm0 := &UpdateRepositorySettingsByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype GetRepositoriesMetadataRequest struct {\n\tstate          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Ids []string               `protobuf:\"bytes,1,rep,name=ids,proto3\"`\n\tunknownFields  protoimpl.UnknownFields\n\tsizeCache      protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoriesMetadataRequest) Reset() {\n\t*x = GetRepositoriesMetadataRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[36]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoriesMetadataRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoriesMetadataRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoriesMetadataRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[36]\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\nfunc (x *GetRepositoriesMetadataRequest) GetIds() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Ids\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoriesMetadataRequest) SetIds(v []string) {\n\tx.xxx_hidden_Ids = v\n}\n\ntype GetRepositoriesMetadataRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of repository IDs to request the metadata.\n\tIds []string\n}\n\nfunc (b0 GetRepositoriesMetadataRequest_builder) Build() *GetRepositoriesMetadataRequest {\n\tm0 := &GetRepositoriesMetadataRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Ids = b.Ids\n\treturn m0\n}\n\ntype GetRepositoriesMetadataResponse struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Metadata *[]*RepositoryMetadata `protobuf:\"bytes,1,rep,name=metadata,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoriesMetadataResponse) Reset() {\n\t*x = GetRepositoriesMetadataResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[37]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoriesMetadataResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoriesMetadataResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoriesMetadataResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[37]\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\nfunc (x *GetRepositoriesMetadataResponse) GetMetadata() []*RepositoryMetadata {\n\tif x != nil {\n\t\tif x.xxx_hidden_Metadata != nil {\n\t\t\treturn *x.xxx_hidden_Metadata\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoriesMetadataResponse) SetMetadata(v []*RepositoryMetadata) {\n\tx.xxx_hidden_Metadata = &v\n}\n\ntype GetRepositoriesMetadataResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tMetadata []*RepositoryMetadata\n}\n\nfunc (b0 GetRepositoriesMetadataResponse_builder) Build() *GetRepositoriesMetadataResponse {\n\tm0 := &GetRepositoriesMetadataResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Metadata = &b.Metadata\n\treturn m0\n}\n\ntype GetRepositoryDependencyDOTStringRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner      string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Reference  string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) Reset() {\n\t*x = GetRepositoryDependencyDOTStringRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[38]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryDependencyDOTStringRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[38]\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\nfunc (x *GetRepositoryDependencyDOTStringRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetRepositoryDependencyDOTStringRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype GetRepositoryDependencyDOTStringRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the BSR repository.\n\tOwner string\n\t// The name of the BSR repository.\n\tRepository string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n}\n\nfunc (b0 GetRepositoryDependencyDOTStringRequest_builder) Build() *GetRepositoryDependencyDOTStringRequest {\n\tm0 := &GetRepositoryDependencyDOTStringRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\ntype GetRepositoryDependencyDOTStringResponse struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_DotString string                 `protobuf:\"bytes,1,opt,name=dot_string,json=dotString,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryDependencyDOTStringResponse) Reset() {\n\t*x = GetRepositoryDependencyDOTStringResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[39]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryDependencyDOTStringResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryDependencyDOTStringResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoryDependencyDOTStringResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[39]\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\nfunc (x *GetRepositoryDependencyDOTStringResponse) GetDotString() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DotString\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryDependencyDOTStringResponse) SetDotString(v string) {\n\tx.xxx_hidden_DotString = v\n}\n\ntype GetRepositoryDependencyDOTStringResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The string DOT representation of the dependency graph for the repository.\n\t//\n\t// DOT language reference: https://graphviz.org/doc/info/lang.html\n\tDotString string\n}\n\nfunc (b0 GetRepositoryDependencyDOTStringResponse_builder) Build() *GetRepositoryDependencyDOTStringResponse {\n\tm0 := &GetRepositoryDependencyDOTStringResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_DotString = b.DotString\n\treturn m0\n}\n\ntype AddRepositoryGroupRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_GroupName    string                 `protobuf:\"bytes,2,opt,name=group_name,json=groupName,proto3\"`\n\txxx_hidden_RoleOverride RepositoryRole         `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *AddRepositoryGroupRequest) Reset() {\n\t*x = AddRepositoryGroupRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[40]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *AddRepositoryGroupRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AddRepositoryGroupRequest) ProtoMessage() {}\n\nfunc (x *AddRepositoryGroupRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[40]\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\nfunc (x *AddRepositoryGroupRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *AddRepositoryGroupRequest) GetGroupName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GroupName\n\t}\n\treturn \"\"\n}\n\nfunc (x *AddRepositoryGroupRequest) GetRoleOverride() RepositoryRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RoleOverride\n\t}\n\treturn RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\nfunc (x *AddRepositoryGroupRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *AddRepositoryGroupRequest) SetGroupName(v string) {\n\tx.xxx_hidden_GroupName = v\n}\n\nfunc (x *AddRepositoryGroupRequest) SetRoleOverride(v RepositoryRole) {\n\tx.xxx_hidden_RoleOverride = v\n}\n\ntype AddRepositoryGroupRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to add the group.\n\tRepositoryId string\n\t// The name of the group to add.\n\tGroupName string\n\t// The role to associate with any user who is added to the repository via this group.\n\t//\n\t// Any user who maps to this repository via this group will be granted this role. If no role is\n\t// set, the user will be granted the containing-organization's base repository role.\n\tRoleOverride RepositoryRole\n}\n\nfunc (b0 AddRepositoryGroupRequest_builder) Build() *AddRepositoryGroupRequest {\n\tm0 := &AddRepositoryGroupRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_GroupName = b.GroupName\n\tx.xxx_hidden_RoleOverride = b.RoleOverride\n\treturn m0\n}\n\ntype AddRepositoryGroupResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *AddRepositoryGroupResponse) Reset() {\n\t*x = AddRepositoryGroupResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[41]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *AddRepositoryGroupResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*AddRepositoryGroupResponse) ProtoMessage() {}\n\nfunc (x *AddRepositoryGroupResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[41]\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\ntype AddRepositoryGroupResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 AddRepositoryGroupResponse_builder) Build() *AddRepositoryGroupResponse {\n\tm0 := &AddRepositoryGroupResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype UpdateRepositoryGroupRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_GroupName    string                 `protobuf:\"bytes,2,opt,name=group_name,json=groupName,proto3\"`\n\txxx_hidden_RoleOverride RepositoryRole         `protobuf:\"varint,3,opt,name=role_override,json=roleOverride,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole,oneof\"`\n\tXXX_raceDetectHookData  protoimpl.RaceDetectHookData\n\tXXX_presence            [1]uint32\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *UpdateRepositoryGroupRequest) Reset() {\n\t*x = UpdateRepositoryGroupRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[42]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateRepositoryGroupRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateRepositoryGroupRequest) ProtoMessage() {}\n\nfunc (x *UpdateRepositoryGroupRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[42]\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\nfunc (x *UpdateRepositoryGroupRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositoryGroupRequest) GetGroupName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GroupName\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositoryGroupRequest) GetRoleOverride() RepositoryRole {\n\tif x != nil {\n\t\tif protoimpl.X.Present(&(x.XXX_presence[0]), 2) {\n\t\t\treturn x.xxx_hidden_RoleOverride\n\t\t}\n\t}\n\treturn RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\nfunc (x *UpdateRepositoryGroupRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *UpdateRepositoryGroupRequest) SetGroupName(v string) {\n\tx.xxx_hidden_GroupName = v\n}\n\nfunc (x *UpdateRepositoryGroupRequest) SetRoleOverride(v RepositoryRole) {\n\tx.xxx_hidden_RoleOverride = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3)\n}\n\nfunc (x *UpdateRepositoryGroupRequest) HasRoleOverride() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *UpdateRepositoryGroupRequest) ClearRoleOverride() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_RoleOverride = RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED\n}\n\ntype UpdateRepositoryGroupRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository to which this group belongs.\n\tRepositoryId string\n\t// The name of the group to update.\n\tGroupName string\n\t// The role to associate with this repository group.\n\t//\n\t// Setting this to 'UNSPECIFIED' will remove the override. Leaving this unset will not update this\n\t// property.\n\tRoleOverride *RepositoryRole\n}\n\nfunc (b0 UpdateRepositoryGroupRequest_builder) Build() *UpdateRepositoryGroupRequest {\n\tm0 := &UpdateRepositoryGroupRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_GroupName = b.GroupName\n\tif b.RoleOverride != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3)\n\t\tx.xxx_hidden_RoleOverride = *b.RoleOverride\n\t}\n\treturn m0\n}\n\ntype UpdateRepositoryGroupResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateRepositoryGroupResponse) Reset() {\n\t*x = UpdateRepositoryGroupResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[43]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateRepositoryGroupResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateRepositoryGroupResponse) ProtoMessage() {}\n\nfunc (x *UpdateRepositoryGroupResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[43]\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\ntype UpdateRepositoryGroupResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateRepositoryGroupResponse_builder) Build() *UpdateRepositoryGroupResponse {\n\tm0 := &UpdateRepositoryGroupResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype RemoveRepositoryGroupRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_GroupName    string                 `protobuf:\"bytes,2,opt,name=group_name,json=groupName,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *RemoveRepositoryGroupRequest) Reset() {\n\t*x = RemoveRepositoryGroupRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[44]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RemoveRepositoryGroupRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RemoveRepositoryGroupRequest) ProtoMessage() {}\n\nfunc (x *RemoveRepositoryGroupRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[44]\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\nfunc (x *RemoveRepositoryGroupRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RemoveRepositoryGroupRequest) GetGroupName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GroupName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RemoveRepositoryGroupRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *RemoveRepositoryGroupRequest) SetGroupName(v string) {\n\tx.xxx_hidden_GroupName = v\n}\n\ntype RemoveRepositoryGroupRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which to remove the group.\n\tRepositoryId string\n\t// The name of the group to remove.\n\tGroupName string\n}\n\nfunc (b0 RemoveRepositoryGroupRequest_builder) Build() *RemoveRepositoryGroupRequest {\n\tm0 := &RemoveRepositoryGroupRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_GroupName = b.GroupName\n\treturn m0\n}\n\ntype RemoveRepositoryGroupResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *RemoveRepositoryGroupResponse) Reset() {\n\t*x = RemoveRepositoryGroupResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[45]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RemoveRepositoryGroupResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RemoveRepositoryGroupResponse) ProtoMessage() {}\n\nfunc (x *RemoveRepositoryGroupResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[45]\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\ntype RemoveRepositoryGroupResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 RemoveRepositoryGroupResponse_builder) Build() *RemoveRepositoryGroupResponse {\n\tm0 := &RemoveRepositoryGroupResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_repository_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_repository_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\",buf/alpha/registry/v1alpha1/repository.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/registry/v1alpha1/role.proto\\x1a&buf/alpha/registry/v1alpha1/user.proto\\x1a5buf/alpha/registry/v1alpha1/verification_status.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\x8d\\x04\\n\" +\n\t\"\\n\" +\n\t\"Repository\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12;\\n\" +\n\t\"\\vupdate_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"updateTime\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x04 \\x01(\\tR\\x04name\\x12\\x19\\n\" +\n\t\"\\auser_id\\x18\\x05 \\x01(\\tH\\x00R\\x06userId\\x12)\\n\" +\n\t\"\\x0forganization_id\\x18\\x06 \\x01(\\tH\\x00R\\x0eorganizationId\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\a \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\b \\x01(\\bR\\n\" +\n\t\"deprecated\\x12/\\n\" +\n\t\"\\x13deprecation_message\\x18\\t \\x01(\\tR\\x12deprecationMessage\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\n\" +\n\t\" \\x01(\\tR\\townerName\\x12 \\n\" +\n\t\"\\vdescription\\x18\\v \\x01(\\tR\\vdescription\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\f \\x01(\\tR\\x03url\\x12%\\n\" +\n\t\"\\x0edefault_branch\\x18\\r \\x01(\\tR\\rdefaultBranchB\\a\\n\" +\n\t\"\\x05owner\\\"h\\n\" +\n\t\"\\x10RepositoryCounts\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"tags_count\\x18\\x01 \\x01(\\rR\\ttagsCount\\x12!\\n\" +\n\t\"\\fdrafts_count\\x18\\x03 \\x01(\\rR\\vdraftsCountJ\\x04\\b\\x02\\x10\\x03R\\ftracks_count\\\"\\x97\\x02\\n\" +\n\t\"\\x15RepositoryContributor\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x02 \\x01(\\tR\\frepositoryId\\x12P\\n\" +\n\t\"\\rexplicit_role\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\fexplicitRole\\x12P\\n\" +\n\t\"\\rimplicit_role\\x18\\x04 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\fimplicitRole\\\"\\xc3\\x02\\n\" +\n\t\"\\x12RepositoryMetadata\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x03 \\x01(\\tR\\townerName\\x12k\\n\" +\n\t\"\\x19owner_verification_status\\x18\\x04 \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.VerificationStatusR\\x17ownerVerificationStatus\\x12H\\n\" +\n\t\"\\x12latest_commit_time\\x18\\x05 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x10latestCommitTime\\x123\\n\" +\n\t\"\\x16latest_spdx_license_id\\x18\\x06 \\x01(\\tR\\x13latestSpdxLicenseId\\\"A\\n\" +\n\t\" GetRepositoriesByFullNameRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"full_names\\x18\\x01 \\x03(\\tR\\tfullNames\\\"p\\n\" +\n\t\"!GetRepositoriesByFullNameResponse\\x12K\\n\" +\n\t\"\\frepositories\\x18\\x01 \\x03(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\frepositories\\\"&\\n\" +\n\t\"\\x14GetRepositoryRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\\"\\xa7\\x01\\n\" +\n\t\"\\x15GetRepositoryResponse\\x12G\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x01 \\x01(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\n\" +\n\t\"repository\\x12E\\n\" +\n\t\"\\x06counts\\x18\\x02 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCountsR\\x06counts\\\"=\\n\" +\n\t\"\\x1eGetRepositoryByFullNameRequest\\x12\\x1b\\n\" +\n\t\"\\tfull_name\\x18\\x01 \\x01(\\tR\\bfullName\\\"\\xb1\\x01\\n\" +\n\t\"\\x1fGetRepositoryByFullNameResponse\\x12G\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x01 \\x01(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\n\" +\n\t\"repository\\x12E\\n\" +\n\t\"\\x06counts\\x18\\x02 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCountsR\\x06counts\\\"o\\n\" +\n\t\"\\x17ListRepositoriesRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\\"\\x8f\\x01\\n\" +\n\t\"\\x18ListRepositoriesResponse\\x12K\\n\" +\n\t\"\\frepositories\\x18\\x01 \\x03(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\frepositories\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x8c\\x01\\n\" +\n\t\"\\x1bListUserRepositoriesRequest\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x01 \\x01(\\tR\\x06userId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x04 \\x01(\\bR\\areverse\\\"\\x93\\x01\\n\" +\n\t\"\\x1cListUserRepositoriesResponse\\x12K\\n\" +\n\t\"\\frepositories\\x18\\x01 \\x03(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\frepositories\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"|\\n\" +\n\t\"$ListRepositoriesUserCanAccessRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\\"\\x9c\\x01\\n\" +\n\t\"%ListRepositoriesUserCanAccessResponse\\x12K\\n\" +\n\t\"\\frepositories\\x18\\x01 \\x03(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\frepositories\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\xa4\\x01\\n\" +\n\t\"#ListOrganizationRepositoriesRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x04 \\x01(\\bR\\areverse\\\"\\x9b\\x01\\n\" +\n\t\"$ListOrganizationRepositoriesResponse\\x12K\\n\" +\n\t\"\\frepositories\\x18\\x01 \\x03(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\frepositories\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x89\\x01\\n\" +\n\t\"!CreateRepositoryByFullNameRequest\\x12\\x1b\\n\" +\n\t\"\\tfull_name\\x18\\x01 \\x01(\\tR\\bfullName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x02 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\\"m\\n\" +\n\t\"\\\"CreateRepositoryByFullNameResponse\\x12G\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x01 \\x01(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\n\" +\n\t\"repository\\\")\\n\" +\n\t\"\\x17DeleteRepositoryRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\\"\\x1a\\n\" +\n\t\"\\x18DeleteRepositoryResponse\\\"@\\n\" +\n\t\"!DeleteRepositoryByFullNameRequest\\x12\\x1b\\n\" +\n\t\"\\tfull_name\\x18\\x01 \\x01(\\tR\\bfullName\\\"$\\n\" +\n\t\"\\\"DeleteRepositoryByFullNameResponse\\\"\\x9b\\x01\\n\" +\n\t\" DeprecateRepositoryByNameRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x01 \\x01(\\tR\\townerName\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12/\\n\" +\n\t\"\\x13deprecation_message\\x18\\x03 \\x01(\\tR\\x12deprecationMessage\\\"l\\n\" +\n\t\"!DeprecateRepositoryByNameResponse\\x12G\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x01 \\x01(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\n\" +\n\t\"repository\\\"l\\n\" +\n\t\"\\\"UndeprecateRepositoryByNameRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x01 \\x01(\\tR\\townerName\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\\"n\\n\" +\n\t\"#UndeprecateRepositoryByNameResponse\\x12G\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x01 \\x01(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\n\" +\n\t\"repository\\\"\\xb5\\x01\\n\" +\n\t\"\\x1fSetRepositoryContributorRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x02 \\x01(\\tR\\x06userId\\x12T\\n\" +\n\t\"\\x0frepository_role\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\x0erepositoryRole\\\"\\\"\\n\" +\n\t\" SetRepositoryContributorResponse\\\"\\x9e\\x01\\n\" +\n\t\"!ListRepositoryContributorsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x04 \\x01(\\bR\\areverse\\\"\\x96\\x01\\n\" +\n\t\"\\\"ListRepositoryContributorsResponse\\x12H\\n\" +\n\t\"\\x05users\\x18\\x01 \\x03(\\v22.buf.alpha.registry.v1alpha1.RepositoryContributorR\\x05users\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"C\\n\" +\n\t\"\\x1cGetRepositorySettingsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"N\\n\" +\n\t\"\\x1dGetRepositorySettingsResponse\\x12-\\n\" +\n\t\"\\x12contributors_count\\x18\\x01 \\x01(\\rR\\x11contributorsCount\\\"\\xcd\\x02\\n\" +\n\t\"%UpdateRepositorySettingsByNameRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x01 \\x01(\\tR\\townerName\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x03 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\x12%\\n\" +\n\t\"\\vdescription\\x18\\x04 \\x01(\\tH\\x00R\\vdescription\\x88\\x01\\x01\\x12\\x15\\n\" +\n\t\"\\x03url\\x18\\x05 \\x01(\\tH\\x01R\\x03url\\x88\\x01\\x01\\x12*\\n\" +\n\t\"\\x0edefault_branch\\x18\\x06 \\x01(\\tH\\x02R\\rdefaultBranch\\x88\\x01\\x01B\\x0e\\n\" +\n\t\"\\f_descriptionB\\x06\\n\" +\n\t\"\\x04_urlB\\x11\\n\" +\n\t\"\\x0f_default_branch\\\"(\\n\" +\n\t\"&UpdateRepositorySettingsByNameResponse\\\"2\\n\" +\n\t\"\\x1eGetRepositoriesMetadataRequest\\x12\\x10\\n\" +\n\t\"\\x03ids\\x18\\x01 \\x03(\\tR\\x03ids\\\"n\\n\" +\n\t\"\\x1fGetRepositoriesMetadataResponse\\x12K\\n\" +\n\t\"\\bmetadata\\x18\\x01 \\x03(\\v2/.buf.alpha.registry.v1alpha1.RepositoryMetadataR\\bmetadata\\\"}\\n\" +\n\t\"'GetRepositoryDependencyDOTStringRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"I\\n\" +\n\t\"(GetRepositoryDependencyDOTStringResponse\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"dot_string\\x18\\x01 \\x01(\\tR\\tdotString\\\"\\xb1\\x01\\n\" +\n\t\"\\x19AddRepositoryGroupRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"group_name\\x18\\x02 \\x01(\\tR\\tgroupName\\x12P\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleR\\froleOverride\\\"\\x1c\\n\" +\n\t\"\\x1aAddRepositoryGroupResponse\\\"\\xcb\\x01\\n\" +\n\t\"\\x1cUpdateRepositoryGroupRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"group_name\\x18\\x02 \\x01(\\tR\\tgroupName\\x12U\\n\" +\n\t\"\\rrole_override\\x18\\x03 \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.RepositoryRoleH\\x00R\\froleOverride\\x88\\x01\\x01B\\x10\\n\" +\n\t\"\\x0e_role_override\\\"\\x1f\\n\" +\n\t\"\\x1dUpdateRepositoryGroupResponse\\\"b\\n\" +\n\t\"\\x1cRemoveRepositoryGroupRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"group_name\\x18\\x02 \\x01(\\tR\\tgroupName\\\"\\x1f\\n\" +\n\t\"\\x1dRemoveRepositoryGroupResponse*W\\n\" +\n\t\"\\n\" +\n\t\"Visibility\\x12\\x1a\\n\" +\n\t\"\\x16VISIBILITY_UNSPECIFIED\\x10\\x00\\x12\\x15\\n\" +\n\t\"\\x11VISIBILITY_PUBLIC\\x10\\x01\\x12\\x16\\n\" +\n\t\"\\x12VISIBILITY_PRIVATE\\x10\\x022\\xdf\\x19\\n\" +\n\t\"\\x11RepositoryService\\x12{\\n\" +\n\t\"\\rGetRepository\\x121.buf.alpha.registry.v1alpha1.GetRepositoryRequest\\x1a2.buf.alpha.registry.v1alpha1.GetRepositoryResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x99\\x01\\n\" +\n\t\"\\x17GetRepositoryByFullName\\x12;.buf.alpha.registry.v1alpha1.GetRepositoryByFullNameRequest\\x1a<.buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x84\\x01\\n\" +\n\t\"\\x10ListRepositories\\x124.buf.alpha.registry.v1alpha1.ListRepositoriesRequest\\x1a5.buf.alpha.registry.v1alpha1.ListRepositoriesResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x90\\x01\\n\" +\n\t\"\\x14ListUserRepositories\\x128.buf.alpha.registry.v1alpha1.ListUserRepositoriesRequest\\x1a9.buf.alpha.registry.v1alpha1.ListUserRepositoriesResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xab\\x01\\n\" +\n\t\"\\x1dListRepositoriesUserCanAccess\\x12A.buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessRequest\\x1aB.buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa8\\x01\\n\" +\n\t\"\\x1cListOrganizationRepositories\\x12@.buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesRequest\\x1aA.buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa2\\x01\\n\" +\n\t\"\\x1aCreateRepositoryByFullName\\x12>.buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameRequest\\x1a?.buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x84\\x01\\n\" +\n\t\"\\x10DeleteRepository\\x124.buf.alpha.registry.v1alpha1.DeleteRepositoryRequest\\x1a5.buf.alpha.registry.v1alpha1.DeleteRepositoryResponse\\\"\\x03\\x90\\x02\\x02\\x12\\xa2\\x01\\n\" +\n\t\"\\x1aDeleteRepositoryByFullName\\x12>.buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameRequest\\x1a?.buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x9a\\x01\\n\" +\n\t\"\\x19DeprecateRepositoryByName\\x12=.buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameRequest\\x1a>.buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameResponse\\x12\\xa0\\x01\\n\" +\n\t\"\\x1bUndeprecateRepositoryByName\\x12?.buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameRequest\\x1a@.buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameResponse\\x12\\x9f\\x01\\n\" +\n\t\"\\x19GetRepositoriesByFullName\\x12=.buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameRequest\\x1a>.buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x97\\x01\\n\" +\n\t\"\\x18SetRepositoryContributor\\x12<.buf.alpha.registry.v1alpha1.SetRepositoryContributorRequest\\x1a=.buf.alpha.registry.v1alpha1.SetRepositoryContributorResponse\\x12\\xa2\\x01\\n\" +\n\t\"\\x1aListRepositoryContributors\\x12>.buf.alpha.registry.v1alpha1.ListRepositoryContributorsRequest\\x1a?.buf.alpha.registry.v1alpha1.ListRepositoryContributorsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x93\\x01\\n\" +\n\t\"\\x15GetRepositorySettings\\x129.buf.alpha.registry.v1alpha1.GetRepositorySettingsRequest\\x1a:.buf.alpha.registry.v1alpha1.GetRepositorySettingsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa9\\x01\\n\" +\n\t\"\\x1eUpdateRepositorySettingsByName\\x12B.buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameRequest\\x1aC.buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameResponse\\x12\\x99\\x01\\n\" +\n\t\"\\x17GetRepositoriesMetadata\\x12;.buf.alpha.registry.v1alpha1.GetRepositoriesMetadataRequest\\x1a<.buf.alpha.registry.v1alpha1.GetRepositoriesMetadataResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xb4\\x01\\n\" +\n\t\" GetRepositoryDependencyDOTString\\x12D.buf.alpha.registry.v1alpha1.GetRepositoryDependencyDOTStringRequest\\x1aE.buf.alpha.registry.v1alpha1.GetRepositoryDependencyDOTStringResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8a\\x01\\n\" +\n\t\"\\x12AddRepositoryGroup\\x126.buf.alpha.registry.v1alpha1.AddRepositoryGroupRequest\\x1a7.buf.alpha.registry.v1alpha1.AddRepositoryGroupResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x93\\x01\\n\" +\n\t\"\\x15UpdateRepositoryGroup\\x129.buf.alpha.registry.v1alpha1.UpdateRepositoryGroupRequest\\x1a:.buf.alpha.registry.v1alpha1.UpdateRepositoryGroupResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x93\\x01\\n\" +\n\t\"\\x15RemoveRepositoryGroup\\x129.buf.alpha.registry.v1alpha1.RemoveRepositoryGroupRequest\\x1a:.buf.alpha.registry.v1alpha1.RemoveRepositoryGroupResponse\\\"\\x03\\x90\\x02\\x02B\\x9c\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x0fRepositoryProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes = make([]protoimpl.MessageInfo, 46)\nvar file_buf_alpha_registry_v1alpha1_repository_proto_goTypes = []any{\n\t(Visibility)(0),                                  // 0: buf.alpha.registry.v1alpha1.Visibility\n\t(*Repository)(nil),                               // 1: buf.alpha.registry.v1alpha1.Repository\n\t(*RepositoryCounts)(nil),                         // 2: buf.alpha.registry.v1alpha1.RepositoryCounts\n\t(*RepositoryContributor)(nil),                    // 3: buf.alpha.registry.v1alpha1.RepositoryContributor\n\t(*RepositoryMetadata)(nil),                       // 4: buf.alpha.registry.v1alpha1.RepositoryMetadata\n\t(*GetRepositoriesByFullNameRequest)(nil),         // 5: buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameRequest\n\t(*GetRepositoriesByFullNameResponse)(nil),        // 6: buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameResponse\n\t(*GetRepositoryRequest)(nil),                     // 7: buf.alpha.registry.v1alpha1.GetRepositoryRequest\n\t(*GetRepositoryResponse)(nil),                    // 8: buf.alpha.registry.v1alpha1.GetRepositoryResponse\n\t(*GetRepositoryByFullNameRequest)(nil),           // 9: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameRequest\n\t(*GetRepositoryByFullNameResponse)(nil),          // 10: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse\n\t(*ListRepositoriesRequest)(nil),                  // 11: buf.alpha.registry.v1alpha1.ListRepositoriesRequest\n\t(*ListRepositoriesResponse)(nil),                 // 12: buf.alpha.registry.v1alpha1.ListRepositoriesResponse\n\t(*ListUserRepositoriesRequest)(nil),              // 13: buf.alpha.registry.v1alpha1.ListUserRepositoriesRequest\n\t(*ListUserRepositoriesResponse)(nil),             // 14: buf.alpha.registry.v1alpha1.ListUserRepositoriesResponse\n\t(*ListRepositoriesUserCanAccessRequest)(nil),     // 15: buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessRequest\n\t(*ListRepositoriesUserCanAccessResponse)(nil),    // 16: buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessResponse\n\t(*ListOrganizationRepositoriesRequest)(nil),      // 17: buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesRequest\n\t(*ListOrganizationRepositoriesResponse)(nil),     // 18: buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesResponse\n\t(*CreateRepositoryByFullNameRequest)(nil),        // 19: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameRequest\n\t(*CreateRepositoryByFullNameResponse)(nil),       // 20: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameResponse\n\t(*DeleteRepositoryRequest)(nil),                  // 21: buf.alpha.registry.v1alpha1.DeleteRepositoryRequest\n\t(*DeleteRepositoryResponse)(nil),                 // 22: buf.alpha.registry.v1alpha1.DeleteRepositoryResponse\n\t(*DeleteRepositoryByFullNameRequest)(nil),        // 23: buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameRequest\n\t(*DeleteRepositoryByFullNameResponse)(nil),       // 24: buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameResponse\n\t(*DeprecateRepositoryByNameRequest)(nil),         // 25: buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameRequest\n\t(*DeprecateRepositoryByNameResponse)(nil),        // 26: buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameResponse\n\t(*UndeprecateRepositoryByNameRequest)(nil),       // 27: buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameRequest\n\t(*UndeprecateRepositoryByNameResponse)(nil),      // 28: buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameResponse\n\t(*SetRepositoryContributorRequest)(nil),          // 29: buf.alpha.registry.v1alpha1.SetRepositoryContributorRequest\n\t(*SetRepositoryContributorResponse)(nil),         // 30: buf.alpha.registry.v1alpha1.SetRepositoryContributorResponse\n\t(*ListRepositoryContributorsRequest)(nil),        // 31: buf.alpha.registry.v1alpha1.ListRepositoryContributorsRequest\n\t(*ListRepositoryContributorsResponse)(nil),       // 32: buf.alpha.registry.v1alpha1.ListRepositoryContributorsResponse\n\t(*GetRepositorySettingsRequest)(nil),             // 33: buf.alpha.registry.v1alpha1.GetRepositorySettingsRequest\n\t(*GetRepositorySettingsResponse)(nil),            // 34: buf.alpha.registry.v1alpha1.GetRepositorySettingsResponse\n\t(*UpdateRepositorySettingsByNameRequest)(nil),    // 35: buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameRequest\n\t(*UpdateRepositorySettingsByNameResponse)(nil),   // 36: buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameResponse\n\t(*GetRepositoriesMetadataRequest)(nil),           // 37: buf.alpha.registry.v1alpha1.GetRepositoriesMetadataRequest\n\t(*GetRepositoriesMetadataResponse)(nil),          // 38: buf.alpha.registry.v1alpha1.GetRepositoriesMetadataResponse\n\t(*GetRepositoryDependencyDOTStringRequest)(nil),  // 39: buf.alpha.registry.v1alpha1.GetRepositoryDependencyDOTStringRequest\n\t(*GetRepositoryDependencyDOTStringResponse)(nil), // 40: buf.alpha.registry.v1alpha1.GetRepositoryDependencyDOTStringResponse\n\t(*AddRepositoryGroupRequest)(nil),                // 41: buf.alpha.registry.v1alpha1.AddRepositoryGroupRequest\n\t(*AddRepositoryGroupResponse)(nil),               // 42: buf.alpha.registry.v1alpha1.AddRepositoryGroupResponse\n\t(*UpdateRepositoryGroupRequest)(nil),             // 43: buf.alpha.registry.v1alpha1.UpdateRepositoryGroupRequest\n\t(*UpdateRepositoryGroupResponse)(nil),            // 44: buf.alpha.registry.v1alpha1.UpdateRepositoryGroupResponse\n\t(*RemoveRepositoryGroupRequest)(nil),             // 45: buf.alpha.registry.v1alpha1.RemoveRepositoryGroupRequest\n\t(*RemoveRepositoryGroupResponse)(nil),            // 46: buf.alpha.registry.v1alpha1.RemoveRepositoryGroupResponse\n\t(*timestamppb.Timestamp)(nil),                    // 47: google.protobuf.Timestamp\n\t(*User)(nil),                                     // 48: buf.alpha.registry.v1alpha1.User\n\t(RepositoryRole)(0),                              // 49: buf.alpha.registry.v1alpha1.RepositoryRole\n\t(VerificationStatus)(0),                          // 50: buf.alpha.registry.v1alpha1.VerificationStatus\n}\nvar file_buf_alpha_registry_v1alpha1_repository_proto_depIdxs = []int32{\n\t47, // 0: buf.alpha.registry.v1alpha1.Repository.create_time:type_name -> google.protobuf.Timestamp\n\t47, // 1: buf.alpha.registry.v1alpha1.Repository.update_time:type_name -> google.protobuf.Timestamp\n\t0,  // 2: buf.alpha.registry.v1alpha1.Repository.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t48, // 3: buf.alpha.registry.v1alpha1.RepositoryContributor.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t49, // 4: buf.alpha.registry.v1alpha1.RepositoryContributor.explicit_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t49, // 5: buf.alpha.registry.v1alpha1.RepositoryContributor.implicit_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t50, // 6: buf.alpha.registry.v1alpha1.RepositoryMetadata.owner_verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus\n\t47, // 7: buf.alpha.registry.v1alpha1.RepositoryMetadata.latest_commit_time:type_name -> google.protobuf.Timestamp\n\t1,  // 8: buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t1,  // 9: buf.alpha.registry.v1alpha1.GetRepositoryResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t2,  // 10: buf.alpha.registry.v1alpha1.GetRepositoryResponse.counts:type_name -> buf.alpha.registry.v1alpha1.RepositoryCounts\n\t1,  // 11: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t2,  // 12: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse.counts:type_name -> buf.alpha.registry.v1alpha1.RepositoryCounts\n\t1,  // 13: buf.alpha.registry.v1alpha1.ListRepositoriesResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t1,  // 14: buf.alpha.registry.v1alpha1.ListUserRepositoriesResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t1,  // 15: buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t1,  // 16: buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t0,  // 17: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameRequest.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t1,  // 18: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t1,  // 19: buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t1,  // 20: buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t49, // 21: buf.alpha.registry.v1alpha1.SetRepositoryContributorRequest.repository_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t3,  // 22: buf.alpha.registry.v1alpha1.ListRepositoryContributorsResponse.users:type_name -> buf.alpha.registry.v1alpha1.RepositoryContributor\n\t0,  // 23: buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameRequest.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t4,  // 24: buf.alpha.registry.v1alpha1.GetRepositoriesMetadataResponse.metadata:type_name -> buf.alpha.registry.v1alpha1.RepositoryMetadata\n\t49, // 25: buf.alpha.registry.v1alpha1.AddRepositoryGroupRequest.role_override:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t49, // 26: buf.alpha.registry.v1alpha1.UpdateRepositoryGroupRequest.role_override:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole\n\t7,  // 27: buf.alpha.registry.v1alpha1.RepositoryService.GetRepository:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryRequest\n\t9,  // 28: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryByFullName:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryByFullNameRequest\n\t11, // 29: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositories:input_type -> buf.alpha.registry.v1alpha1.ListRepositoriesRequest\n\t13, // 30: buf.alpha.registry.v1alpha1.RepositoryService.ListUserRepositories:input_type -> buf.alpha.registry.v1alpha1.ListUserRepositoriesRequest\n\t15, // 31: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoriesUserCanAccess:input_type -> buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessRequest\n\t17, // 32: buf.alpha.registry.v1alpha1.RepositoryService.ListOrganizationRepositories:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesRequest\n\t19, // 33: buf.alpha.registry.v1alpha1.RepositoryService.CreateRepositoryByFullName:input_type -> buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameRequest\n\t21, // 34: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepository:input_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryRequest\n\t23, // 35: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepositoryByFullName:input_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameRequest\n\t25, // 36: buf.alpha.registry.v1alpha1.RepositoryService.DeprecateRepositoryByName:input_type -> buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameRequest\n\t27, // 37: buf.alpha.registry.v1alpha1.RepositoryService.UndeprecateRepositoryByName:input_type -> buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameRequest\n\t5,  // 38: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesByFullName:input_type -> buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameRequest\n\t29, // 39: buf.alpha.registry.v1alpha1.RepositoryService.SetRepositoryContributor:input_type -> buf.alpha.registry.v1alpha1.SetRepositoryContributorRequest\n\t31, // 40: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoryContributors:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryContributorsRequest\n\t33, // 41: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositorySettings:input_type -> buf.alpha.registry.v1alpha1.GetRepositorySettingsRequest\n\t35, // 42: buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositorySettingsByName:input_type -> buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameRequest\n\t37, // 43: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesMetadata:input_type -> buf.alpha.registry.v1alpha1.GetRepositoriesMetadataRequest\n\t39, // 44: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryDependencyDOTString:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryDependencyDOTStringRequest\n\t41, // 45: buf.alpha.registry.v1alpha1.RepositoryService.AddRepositoryGroup:input_type -> buf.alpha.registry.v1alpha1.AddRepositoryGroupRequest\n\t43, // 46: buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositoryGroup:input_type -> buf.alpha.registry.v1alpha1.UpdateRepositoryGroupRequest\n\t45, // 47: buf.alpha.registry.v1alpha1.RepositoryService.RemoveRepositoryGroup:input_type -> buf.alpha.registry.v1alpha1.RemoveRepositoryGroupRequest\n\t8,  // 48: buf.alpha.registry.v1alpha1.RepositoryService.GetRepository:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryResponse\n\t10, // 49: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryByFullName:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse\n\t12, // 50: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositories:output_type -> buf.alpha.registry.v1alpha1.ListRepositoriesResponse\n\t14, // 51: buf.alpha.registry.v1alpha1.RepositoryService.ListUserRepositories:output_type -> buf.alpha.registry.v1alpha1.ListUserRepositoriesResponse\n\t16, // 52: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoriesUserCanAccess:output_type -> buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessResponse\n\t18, // 53: buf.alpha.registry.v1alpha1.RepositoryService.ListOrganizationRepositories:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesResponse\n\t20, // 54: buf.alpha.registry.v1alpha1.RepositoryService.CreateRepositoryByFullName:output_type -> buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameResponse\n\t22, // 55: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepository:output_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryResponse\n\t24, // 56: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepositoryByFullName:output_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameResponse\n\t26, // 57: buf.alpha.registry.v1alpha1.RepositoryService.DeprecateRepositoryByName:output_type -> buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameResponse\n\t28, // 58: buf.alpha.registry.v1alpha1.RepositoryService.UndeprecateRepositoryByName:output_type -> buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameResponse\n\t6,  // 59: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesByFullName:output_type -> buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameResponse\n\t30, // 60: buf.alpha.registry.v1alpha1.RepositoryService.SetRepositoryContributor:output_type -> buf.alpha.registry.v1alpha1.SetRepositoryContributorResponse\n\t32, // 61: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoryContributors:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryContributorsResponse\n\t34, // 62: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositorySettings:output_type -> buf.alpha.registry.v1alpha1.GetRepositorySettingsResponse\n\t36, // 63: buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositorySettingsByName:output_type -> buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameResponse\n\t38, // 64: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesMetadata:output_type -> buf.alpha.registry.v1alpha1.GetRepositoriesMetadataResponse\n\t40, // 65: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryDependencyDOTString:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryDependencyDOTStringResponse\n\t42, // 66: buf.alpha.registry.v1alpha1.RepositoryService.AddRepositoryGroup:output_type -> buf.alpha.registry.v1alpha1.AddRepositoryGroupResponse\n\t44, // 67: buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositoryGroup:output_type -> buf.alpha.registry.v1alpha1.UpdateRepositoryGroupResponse\n\t46, // 68: buf.alpha.registry.v1alpha1.RepositoryService.RemoveRepositoryGroup:output_type -> buf.alpha.registry.v1alpha1.RemoveRepositoryGroupResponse\n\t48, // [48:69] is the sub-list for method output_type\n\t27, // [27:48] is the sub-list for method input_type\n\t27, // [27:27] is the sub-list for extension type_name\n\t27, // [27:27] is the sub-list for extension extendee\n\t0,  // [0:27] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_repository_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_repository_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_repository_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_role_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_user_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_verification_status_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[0].OneofWrappers = []any{\n\t\t(*repository_UserId)(nil),\n\t\t(*repository_OrganizationId)(nil),\n\t}\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[34].OneofWrappers = []any{}\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[42].OneofWrappers = []any{}\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_buf_alpha_registry_v1alpha1_repository_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_repository_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   46,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_repository_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_repository_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_branch.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/repository_branch.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 RepositoryBranch struct {\n\tstate                              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id                      string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Name                    string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_LatestCommitName        string                 `protobuf:\"bytes,3,opt,name=latest_commit_name,json=latestCommitName,proto3\"`\n\txxx_hidden_IsMainBranch            bool                   `protobuf:\"varint,4,opt,name=is_main_branch,json=isMainBranch,proto3\"`\n\txxx_hidden_LastUpdateTime          *timestamppb.Timestamp `protobuf:\"bytes,5,opt,name=last_update_time,json=lastUpdateTime,proto3\"`\n\txxx_hidden_LastUpdateUserId        string                 `protobuf:\"bytes,6,opt,name=last_update_user_id,json=lastUpdateUserId,proto3\"`\n\txxx_hidden_LastUpdateGitAuthorName string                 `protobuf:\"bytes,7,opt,name=last_update_git_author_name,json=lastUpdateGitAuthorName,proto3\"`\n\txxx_hidden_LastUpdateGitCommitHash string                 `protobuf:\"bytes,8,opt,name=last_update_git_commit_hash,json=lastUpdateGitCommitHash,proto3\"`\n\tunknownFields                      protoimpl.UnknownFields\n\tsizeCache                          protoimpl.SizeCache\n}\n\nfunc (x *RepositoryBranch) Reset() {\n\t*x = RepositoryBranch{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryBranch) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryBranch) ProtoMessage() {}\n\nfunc (x *RepositoryBranch) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *RepositoryBranch) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryBranch) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryBranch) GetLatestCommitName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LatestCommitName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryBranch) GetIsMainBranch() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IsMainBranch\n\t}\n\treturn false\n}\n\nfunc (x *RepositoryBranch) GetLastUpdateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LastUpdateTime\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryBranch) GetLastUpdateUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LastUpdateUserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryBranch) GetLastUpdateGitAuthorName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LastUpdateGitAuthorName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryBranch) GetLastUpdateGitCommitHash() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LastUpdateGitCommitHash\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryBranch) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *RepositoryBranch) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositoryBranch) SetLatestCommitName(v string) {\n\tx.xxx_hidden_LatestCommitName = v\n}\n\nfunc (x *RepositoryBranch) SetIsMainBranch(v bool) {\n\tx.xxx_hidden_IsMainBranch = v\n}\n\nfunc (x *RepositoryBranch) SetLastUpdateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_LastUpdateTime = v\n}\n\nfunc (x *RepositoryBranch) SetLastUpdateUserId(v string) {\n\tx.xxx_hidden_LastUpdateUserId = v\n}\n\nfunc (x *RepositoryBranch) SetLastUpdateGitAuthorName(v string) {\n\tx.xxx_hidden_LastUpdateGitAuthorName = v\n}\n\nfunc (x *RepositoryBranch) SetLastUpdateGitCommitHash(v string) {\n\tx.xxx_hidden_LastUpdateGitCommitHash = v\n}\n\nfunc (x *RepositoryBranch) HasLastUpdateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_LastUpdateTime != nil\n}\n\nfunc (x *RepositoryBranch) ClearLastUpdateTime() {\n\tx.xxx_hidden_LastUpdateTime = nil\n}\n\ntype RepositoryBranch_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// primary key, unique.\n\t// branches are based on labels, so when a branch is pushed to, the ID will point to the\n\t// updated entry in the labels table.\n\tId string\n\t// The name of the repository branch.\n\tName string\n\t// The name of the latest commit on the branch.\n\tLatestCommitName string\n\t// is_main_branch denotes whether this branch is considered the main branch of the repository.\n\tIsMainBranch bool\n\t// The last update time of the branch.\n\tLastUpdateTime *timestamppb.Timestamp\n\t// The ID of the user who updated the branch.\n\tLastUpdateUserId string\n\t// The author name of the most recent associated git commit of the branch. May be an empty string\n\t// if no commit in the branch history contains any associated git commit.\n\tLastUpdateGitAuthorName string\n\t// The git commit hash of the most recent associated git commit of the branch. May be an empty\n\t// string if no commit in the branch history contains any associated git commit.\n\tLastUpdateGitCommitHash string\n}\n\nfunc (b0 RepositoryBranch_builder) Build() *RepositoryBranch {\n\tm0 := &RepositoryBranch{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_LatestCommitName = b.LatestCommitName\n\tx.xxx_hidden_IsMainBranch = b.IsMainBranch\n\tx.xxx_hidden_LastUpdateTime = b.LastUpdateTime\n\tx.xxx_hidden_LastUpdateUserId = b.LastUpdateUserId\n\tx.xxx_hidden_LastUpdateGitAuthorName = b.LastUpdateGitAuthorName\n\tx.xxx_hidden_LastUpdateGitCommitHash = b.LastUpdateGitCommitHash\n\treturn m0\n}\n\ntype GetRepositoryBranchRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_Name         string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryBranchRequest) Reset() {\n\t*x = GetRepositoryBranchRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryBranchRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryBranchRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoryBranchRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *GetRepositoryBranchRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryBranchRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryBranchRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *GetRepositoryBranchRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype GetRepositoryBranchRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository for which the branch is requested.\n\tRepositoryId string\n\t// The name of the branch to get.\n\tName string\n}\n\nfunc (b0 GetRepositoryBranchRequest_builder) Build() *GetRepositoryBranchRequest {\n\tm0 := &GetRepositoryBranchRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype GetRepositoryBranchResponse struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Branch *RepositoryBranch      `protobuf:\"bytes,1,opt,name=branch,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryBranchResponse) Reset() {\n\t*x = GetRepositoryBranchResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryBranchResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryBranchResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoryBranchResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *GetRepositoryBranchResponse) GetBranch() *RepositoryBranch {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Branch\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoryBranchResponse) SetBranch(v *RepositoryBranch) {\n\tx.xxx_hidden_Branch = v\n}\n\nfunc (x *GetRepositoryBranchResponse) HasBranch() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Branch != nil\n}\n\nfunc (x *GetRepositoryBranchResponse) ClearBranch() {\n\tx.xxx_hidden_Branch = nil\n}\n\ntype GetRepositoryBranchResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tBranch *RepositoryBranch\n}\n\nfunc (b0 GetRepositoryBranchResponse_builder) Build() *GetRepositoryBranchResponse {\n\tm0 := &GetRepositoryBranchResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Branch = b.Branch\n\treturn m0\n}\n\ntype ListRepositoryBranchesRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_PageSize     uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken    string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryBranchesRequest) Reset() {\n\t*x = ListRepositoryBranchesRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryBranchesRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryBranchesRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryBranchesRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *ListRepositoryBranchesRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryBranchesRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ListRepositoryBranchesRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryBranchesRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\ntype ListRepositoryBranchesRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository whose branches should be listed.\n\tRepositoryId string\n\tPageSize     uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n}\n\nfunc (b0 ListRepositoryBranchesRequest_builder) Build() *ListRepositoryBranchesRequest {\n\tm0 := &ListRepositoryBranchesRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\treturn m0\n}\n\ntype ListRepositoryBranchesResponse struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryBranches *[]*RepositoryBranch   `protobuf:\"bytes,1,rep,name=repository_branches,json=repositoryBranches,proto3\"`\n\txxx_hidden_NextPageToken      string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryBranchesResponse) Reset() {\n\t*x = ListRepositoryBranchesResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryBranchesResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryBranchesResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryBranchesResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *ListRepositoryBranchesResponse) GetRepositoryBranches() []*RepositoryBranch {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryBranches != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryBranches\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryBranchesResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesResponse) SetRepositoryBranches(v []*RepositoryBranch) {\n\tx.xxx_hidden_RepositoryBranches = &v\n}\n\nfunc (x *ListRepositoryBranchesResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryBranchesResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryBranches []*RepositoryBranch\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListRepositoryBranchesResponse_builder) Build() *ListRepositoryBranchesResponse {\n\tm0 := &ListRepositoryBranchesResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryBranches = &b.RepositoryBranches\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListRepositoryBranchesByReferenceRequest struct {\n\tstate                   protoimpl.MessageState                               `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                                               `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_PageSize     uint32                                               `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken    string                                               `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reference    isListRepositoryBranchesByReferenceRequest_Reference `protobuf_oneof:\"reference\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) Reset() {\n\t*x = ListRepositoryBranchesByReferenceRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryBranchesByReferenceRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *ListRepositoryBranchesByReferenceRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) GetCommitName() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*listRepositoryBranchesByReferenceRequest_CommitName); ok {\n\t\t\treturn x.CommitName\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) GetVcsCommitHash() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Reference.(*listRepositoryBranchesByReferenceRequest_VcsCommitHash); ok {\n\t\t\treturn x.VcsCommitHash\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) SetCommitName(v string) {\n\tx.xxx_hidden_Reference = &listRepositoryBranchesByReferenceRequest_CommitName{v}\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) SetVcsCommitHash(v string) {\n\tx.xxx_hidden_Reference = &listRepositoryBranchesByReferenceRequest_VcsCommitHash{v}\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) HasReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Reference != nil\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) HasCommitName() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*listRepositoryBranchesByReferenceRequest_CommitName)\n\treturn ok\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) HasVcsCommitHash() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Reference.(*listRepositoryBranchesByReferenceRequest_VcsCommitHash)\n\treturn ok\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) ClearReference() {\n\tx.xxx_hidden_Reference = nil\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) ClearCommitName() {\n\tif _, ok := x.xxx_hidden_Reference.(*listRepositoryBranchesByReferenceRequest_CommitName); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) ClearVcsCommitHash() {\n\tif _, ok := x.xxx_hidden_Reference.(*listRepositoryBranchesByReferenceRequest_VcsCommitHash); ok {\n\t\tx.xxx_hidden_Reference = nil\n\t}\n}\n\nconst ListRepositoryBranchesByReferenceRequest_Reference_not_set_case case_ListRepositoryBranchesByReferenceRequest_Reference = 0\nconst ListRepositoryBranchesByReferenceRequest_CommitName_case case_ListRepositoryBranchesByReferenceRequest_Reference = 4\nconst ListRepositoryBranchesByReferenceRequest_VcsCommitHash_case case_ListRepositoryBranchesByReferenceRequest_Reference = 5\n\nfunc (x *ListRepositoryBranchesByReferenceRequest) WhichReference() case_ListRepositoryBranchesByReferenceRequest_Reference {\n\tif x == nil {\n\t\treturn ListRepositoryBranchesByReferenceRequest_Reference_not_set_case\n\t}\n\tswitch x.xxx_hidden_Reference.(type) {\n\tcase *listRepositoryBranchesByReferenceRequest_CommitName:\n\t\treturn ListRepositoryBranchesByReferenceRequest_CommitName_case\n\tcase *listRepositoryBranchesByReferenceRequest_VcsCommitHash:\n\t\treturn ListRepositoryBranchesByReferenceRequest_VcsCommitHash_case\n\tdefault:\n\t\treturn ListRepositoryBranchesByReferenceRequest_Reference_not_set_case\n\t}\n}\n\ntype ListRepositoryBranchesByReferenceRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository whose branches should be listed.\n\tRepositoryId string\n\tPageSize     uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\t// The reference by which to filter the returned branches.\n\n\t// Fields of oneof xxx_hidden_Reference:\n\t// The name of a BSR commit. This will filter the branches to only those that include the commit.\n\tCommitName *string\n\t// The hash of a VCS commit. This will filter the branches to only those that include the commit\n\t// associated with the VCS hash.\n\tVcsCommitHash *string\n\t// -- end of xxx_hidden_Reference\n}\n\nfunc (b0 ListRepositoryBranchesByReferenceRequest_builder) Build() *ListRepositoryBranchesByReferenceRequest {\n\tm0 := &ListRepositoryBranchesByReferenceRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tif b.CommitName != nil {\n\t\tx.xxx_hidden_Reference = &listRepositoryBranchesByReferenceRequest_CommitName{*b.CommitName}\n\t}\n\tif b.VcsCommitHash != nil {\n\t\tx.xxx_hidden_Reference = &listRepositoryBranchesByReferenceRequest_VcsCommitHash{*b.VcsCommitHash}\n\t}\n\treturn m0\n}\n\ntype case_ListRepositoryBranchesByReferenceRequest_Reference protoreflect.FieldNumber\n\nfunc (x case_ListRepositoryBranchesByReferenceRequest_Reference) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[5].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isListRepositoryBranchesByReferenceRequest_Reference interface {\n\tisListRepositoryBranchesByReferenceRequest_Reference()\n}\n\ntype listRepositoryBranchesByReferenceRequest_CommitName struct {\n\t// The name of a BSR commit. This will filter the branches to only those that include the commit.\n\tCommitName string `protobuf:\"bytes,4,opt,name=commit_name,json=commitName,proto3,oneof\"`\n}\n\ntype listRepositoryBranchesByReferenceRequest_VcsCommitHash struct {\n\t// The hash of a VCS commit. This will filter the branches to only those that include the commit\n\t// associated with the VCS hash.\n\tVcsCommitHash string `protobuf:\"bytes,5,opt,name=vcs_commit_hash,json=vcsCommitHash,proto3,oneof\"`\n}\n\nfunc (*listRepositoryBranchesByReferenceRequest_CommitName) isListRepositoryBranchesByReferenceRequest_Reference() {\n}\n\nfunc (*listRepositoryBranchesByReferenceRequest_VcsCommitHash) isListRepositoryBranchesByReferenceRequest_Reference() {\n}\n\ntype ListRepositoryBranchesByReferenceResponse struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryBranches *[]*RepositoryBranch   `protobuf:\"bytes,1,rep,name=repository_branches,json=repositoryBranches,proto3\"`\n\txxx_hidden_NextPageToken      string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryBranchesByReferenceResponse) Reset() {\n\t*x = ListRepositoryBranchesByReferenceResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryBranchesByReferenceResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryBranchesByReferenceResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryBranchesByReferenceResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *ListRepositoryBranchesByReferenceResponse) GetRepositoryBranches() []*RepositoryBranch {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryBranches != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryBranches\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryBranchesByReferenceResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryBranchesByReferenceResponse) SetRepositoryBranches(v []*RepositoryBranch) {\n\tx.xxx_hidden_RepositoryBranches = &v\n}\n\nfunc (x *ListRepositoryBranchesByReferenceResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryBranchesByReferenceResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryBranches []*RepositoryBranch\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListRepositoryBranchesByReferenceResponse_builder) Build() *ListRepositoryBranchesByReferenceResponse {\n\tm0 := &ListRepositoryBranchesByReferenceResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryBranches = &b.RepositoryBranches\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype GetCurrentDefaultBranchRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetCurrentDefaultBranchRequest) Reset() {\n\t*x = GetCurrentDefaultBranchRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCurrentDefaultBranchRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCurrentDefaultBranchRequest) ProtoMessage() {}\n\nfunc (x *GetCurrentDefaultBranchRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *GetCurrentDefaultBranchRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetCurrentDefaultBranchRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\ntype GetCurrentDefaultBranchRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository whose current default branch is returned.\n\tRepositoryId string\n}\n\nfunc (b0 GetCurrentDefaultBranchRequest_builder) Build() *GetCurrentDefaultBranchRequest {\n\tm0 := &GetCurrentDefaultBranchRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\treturn m0\n}\n\ntype GetCurrentDefaultBranchResponse struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_CurrentDefaultBranch *RepositoryBranch      `protobuf:\"bytes,1,opt,name=current_default_branch,json=currentDefaultBranch,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *GetCurrentDefaultBranchResponse) Reset() {\n\t*x = GetCurrentDefaultBranchResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCurrentDefaultBranchResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCurrentDefaultBranchResponse) ProtoMessage() {}\n\nfunc (x *GetCurrentDefaultBranchResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_branch_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\nfunc (x *GetCurrentDefaultBranchResponse) GetCurrentDefaultBranch() *RepositoryBranch {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CurrentDefaultBranch\n\t}\n\treturn nil\n}\n\nfunc (x *GetCurrentDefaultBranchResponse) SetCurrentDefaultBranch(v *RepositoryBranch) {\n\tx.xxx_hidden_CurrentDefaultBranch = v\n}\n\nfunc (x *GetCurrentDefaultBranchResponse) HasCurrentDefaultBranch() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CurrentDefaultBranch != nil\n}\n\nfunc (x *GetCurrentDefaultBranchResponse) ClearCurrentDefaultBranch() {\n\tx.xxx_hidden_CurrentDefaultBranch = nil\n}\n\ntype GetCurrentDefaultBranchResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tCurrentDefaultBranch *RepositoryBranch\n}\n\nfunc (b0 GetCurrentDefaultBranchResponse_builder) Build() *GetCurrentDefaultBranchResponse {\n\tm0 := &GetCurrentDefaultBranchResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_CurrentDefaultBranch = b.CurrentDefaultBranch\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_repository_branch_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"3buf/alpha/registry/v1alpha1/repository_branch.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xfb\\x02\\n\" +\n\t\"\\x10RepositoryBranch\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12,\\n\" +\n\t\"\\x12latest_commit_name\\x18\\x03 \\x01(\\tR\\x10latestCommitName\\x12$\\n\" +\n\t\"\\x0eis_main_branch\\x18\\x04 \\x01(\\bR\\fisMainBranch\\x12D\\n\" +\n\t\"\\x10last_update_time\\x18\\x05 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x0elastUpdateTime\\x12-\\n\" +\n\t\"\\x13last_update_user_id\\x18\\x06 \\x01(\\tR\\x10lastUpdateUserId\\x12<\\n\" +\n\t\"\\x1blast_update_git_author_name\\x18\\a \\x01(\\tR\\x17lastUpdateGitAuthorName\\x12<\\n\" +\n\t\"\\x1blast_update_git_commit_hash\\x18\\b \\x01(\\tR\\x17lastUpdateGitCommitHash\\\"U\\n\" +\n\t\"\\x1aGetRepositoryBranchRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\\"d\\n\" +\n\t\"\\x1bGetRepositoryBranchResponse\\x12E\\n\" +\n\t\"\\x06branch\\x18\\x01 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryBranchR\\x06branch\\\"\\x80\\x01\\n\" +\n\t\"\\x1dListRepositoryBranchesRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\\"\\xa8\\x01\\n\" +\n\t\"\\x1eListRepositoryBranchesResponse\\x12^\\n\" +\n\t\"\\x13repository_branches\\x18\\x01 \\x03(\\v2-.buf.alpha.registry.v1alpha1.RepositoryBranchR\\x12repositoryBranches\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\xe5\\x01\\n\" +\n\t\"(ListRepositoryBranchesByReferenceRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\x12!\\n\" +\n\t\"\\vcommit_name\\x18\\x04 \\x01(\\tH\\x00R\\n\" +\n\t\"commitName\\x12(\\n\" +\n\t\"\\x0fvcs_commit_hash\\x18\\x05 \\x01(\\tH\\x00R\\rvcsCommitHashB\\v\\n\" +\n\t\"\\treference\\\"\\xb3\\x01\\n\" +\n\t\")ListRepositoryBranchesByReferenceResponse\\x12^\\n\" +\n\t\"\\x13repository_branches\\x18\\x01 \\x03(\\v2-.buf.alpha.registry.v1alpha1.RepositoryBranchR\\x12repositoryBranches\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"E\\n\" +\n\t\"\\x1eGetCurrentDefaultBranchRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\\"\\x86\\x01\\n\" +\n\t\"\\x1fGetCurrentDefaultBranchResponse\\x12c\\n\" +\n\t\"\\x16current_default_branch\\x18\\x01 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryBranchR\\x14currentDefaultBranch2\\x98\\x05\\n\" +\n\t\"\\x17RepositoryBranchService\\x12\\x8d\\x01\\n\" +\n\t\"\\x13GetRepositoryBranch\\x127.buf.alpha.registry.v1alpha1.GetRepositoryBranchRequest\\x1a8.buf.alpha.registry.v1alpha1.GetRepositoryBranchResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x96\\x01\\n\" +\n\t\"\\x16ListRepositoryBranches\\x12:.buf.alpha.registry.v1alpha1.ListRepositoryBranchesRequest\\x1a;.buf.alpha.registry.v1alpha1.ListRepositoryBranchesResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xb7\\x01\\n\" +\n\t\"!ListRepositoryBranchesByReference\\x12E.buf.alpha.registry.v1alpha1.ListRepositoryBranchesByReferenceRequest\\x1aF.buf.alpha.registry.v1alpha1.ListRepositoryBranchesByReferenceResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x99\\x01\\n\" +\n\t\"\\x17GetCurrentDefaultBranch\\x12;.buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchRequest\\x1a<.buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchResponse\\\"\\x03\\x90\\x02\\x01B\\xa2\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x15RepositoryBranchProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes = make([]protoimpl.MessageInfo, 9)\nvar file_buf_alpha_registry_v1alpha1_repository_branch_proto_goTypes = []any{\n\t(*RepositoryBranch)(nil),                          // 0: buf.alpha.registry.v1alpha1.RepositoryBranch\n\t(*GetRepositoryBranchRequest)(nil),                // 1: buf.alpha.registry.v1alpha1.GetRepositoryBranchRequest\n\t(*GetRepositoryBranchResponse)(nil),               // 2: buf.alpha.registry.v1alpha1.GetRepositoryBranchResponse\n\t(*ListRepositoryBranchesRequest)(nil),             // 3: buf.alpha.registry.v1alpha1.ListRepositoryBranchesRequest\n\t(*ListRepositoryBranchesResponse)(nil),            // 4: buf.alpha.registry.v1alpha1.ListRepositoryBranchesResponse\n\t(*ListRepositoryBranchesByReferenceRequest)(nil),  // 5: buf.alpha.registry.v1alpha1.ListRepositoryBranchesByReferenceRequest\n\t(*ListRepositoryBranchesByReferenceResponse)(nil), // 6: buf.alpha.registry.v1alpha1.ListRepositoryBranchesByReferenceResponse\n\t(*GetCurrentDefaultBranchRequest)(nil),            // 7: buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchRequest\n\t(*GetCurrentDefaultBranchResponse)(nil),           // 8: buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchResponse\n\t(*timestamppb.Timestamp)(nil),                     // 9: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_repository_branch_proto_depIdxs = []int32{\n\t9, // 0: buf.alpha.registry.v1alpha1.RepositoryBranch.last_update_time:type_name -> google.protobuf.Timestamp\n\t0, // 1: buf.alpha.registry.v1alpha1.GetRepositoryBranchResponse.branch:type_name -> buf.alpha.registry.v1alpha1.RepositoryBranch\n\t0, // 2: buf.alpha.registry.v1alpha1.ListRepositoryBranchesResponse.repository_branches:type_name -> buf.alpha.registry.v1alpha1.RepositoryBranch\n\t0, // 3: buf.alpha.registry.v1alpha1.ListRepositoryBranchesByReferenceResponse.repository_branches:type_name -> buf.alpha.registry.v1alpha1.RepositoryBranch\n\t0, // 4: buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchResponse.current_default_branch:type_name -> buf.alpha.registry.v1alpha1.RepositoryBranch\n\t1, // 5: buf.alpha.registry.v1alpha1.RepositoryBranchService.GetRepositoryBranch:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryBranchRequest\n\t3, // 6: buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranches:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryBranchesRequest\n\t5, // 7: buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranchesByReference:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryBranchesByReferenceRequest\n\t7, // 8: buf.alpha.registry.v1alpha1.RepositoryBranchService.GetCurrentDefaultBranch:input_type -> buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchRequest\n\t2, // 9: buf.alpha.registry.v1alpha1.RepositoryBranchService.GetRepositoryBranch:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryBranchResponse\n\t4, // 10: buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranches:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryBranchesResponse\n\t6, // 11: buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranchesByReference:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryBranchesByReferenceResponse\n\t8, // 12: buf.alpha.registry.v1alpha1.RepositoryBranchService.GetCurrentDefaultBranch:output_type -> buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchResponse\n\t9, // [9:13] is the sub-list for method output_type\n\t5, // [5:9] is the sub-list for method input_type\n\t5, // [5:5] is the sub-list for extension type_name\n\t5, // [5:5] is the sub-list for extension extendee\n\t0, // [0:5] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_repository_branch_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_repository_branch_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_repository_branch_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[5].OneofWrappers = []any{\n\t\t(*listRepositoryBranchesByReferenceRequest_CommitName)(nil),\n\t\t(*listRepositoryBranchesByReferenceRequest_VcsCommitHash)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   9,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_repository_branch_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_branch_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_repository_branch_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_repository_branch_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_repository_branch_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_commit.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/repository_commit.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 RepositoryCommit struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id              string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime      *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_Digest          string                 `protobuf:\"bytes,3,opt,name=digest,proto3\"`\n\txxx_hidden_Name            string                 `protobuf:\"bytes,4,opt,name=name,proto3\"`\n\txxx_hidden_Branch          string                 `protobuf:\"bytes,5,opt,name=branch,proto3\"`\n\txxx_hidden_Author          string                 `protobuf:\"bytes,7,opt,name=author,proto3\"`\n\txxx_hidden_Tags            *[]*RepositoryTag      `protobuf:\"bytes,8,rep,name=tags,proto3\"`\n\txxx_hidden_DraftName       string                 `protobuf:\"bytes,9,opt,name=draft_name,json=draftName,proto3\"`\n\txxx_hidden_SpdxLicenseId   string                 `protobuf:\"bytes,10,opt,name=spdx_license_id,json=spdxLicenseId,proto3\"`\n\txxx_hidden_ManifestDigest  string                 `protobuf:\"bytes,11,opt,name=manifest_digest,json=manifestDigest,proto3\"`\n\txxx_hidden_TagCount        int64                  `protobuf:\"varint,12,opt,name=tag_count,json=tagCount,proto3\"`\n\txxx_hidden_GitCommitsCount int64                  `protobuf:\"varint,13,opt,name=git_commits_count,json=gitCommitsCount,proto3\"`\n\txxx_hidden_B5Digest        string                 `protobuf:\"bytes,14,opt,name=b5_digest,json=b5Digest,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *RepositoryCommit) Reset() {\n\t*x = RepositoryCommit{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryCommit) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryCommit) ProtoMessage() {}\n\nfunc (x *RepositoryCommit) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *RepositoryCommit) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryCommit) GetDigest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Digest\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetBranch() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Branch\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetAuthor() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Author\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetTags() []*RepositoryTag {\n\tif x != nil {\n\t\tif x.xxx_hidden_Tags != nil {\n\t\t\treturn *x.xxx_hidden_Tags\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryCommit) GetDraftName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DraftName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetSpdxLicenseId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SpdxLicenseId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetManifestDigest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ManifestDigest\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) GetTagCount() int64 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TagCount\n\t}\n\treturn 0\n}\n\nfunc (x *RepositoryCommit) GetGitCommitsCount() int64 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_GitCommitsCount\n\t}\n\treturn 0\n}\n\nfunc (x *RepositoryCommit) GetB5Digest() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_B5Digest\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryCommit) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *RepositoryCommit) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *RepositoryCommit) SetDigest(v string) {\n\tx.xxx_hidden_Digest = v\n}\n\nfunc (x *RepositoryCommit) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositoryCommit) SetBranch(v string) {\n\tx.xxx_hidden_Branch = v\n}\n\nfunc (x *RepositoryCommit) SetAuthor(v string) {\n\tx.xxx_hidden_Author = v\n}\n\nfunc (x *RepositoryCommit) SetTags(v []*RepositoryTag) {\n\tx.xxx_hidden_Tags = &v\n}\n\nfunc (x *RepositoryCommit) SetDraftName(v string) {\n\tx.xxx_hidden_DraftName = v\n}\n\nfunc (x *RepositoryCommit) SetSpdxLicenseId(v string) {\n\tx.xxx_hidden_SpdxLicenseId = v\n}\n\nfunc (x *RepositoryCommit) SetManifestDigest(v string) {\n\tx.xxx_hidden_ManifestDigest = v\n}\n\nfunc (x *RepositoryCommit) SetTagCount(v int64) {\n\tx.xxx_hidden_TagCount = v\n}\n\nfunc (x *RepositoryCommit) SetGitCommitsCount(v int64) {\n\tx.xxx_hidden_GitCommitsCount = v\n}\n\nfunc (x *RepositoryCommit) SetB5Digest(v string) {\n\tx.xxx_hidden_B5Digest = v\n}\n\nfunc (x *RepositoryCommit) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *RepositoryCommit) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\ntype RepositoryCommit_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// primary key, unique, immutable\n\tId string\n\t// immutable\n\tCreateTime *timestamppb.Timestamp\n\t// The digest of the commit.\n\tDigest string\n\t// The name of the commit.\n\t// This is what is referenced by users.\n\t// Unique, immutable.\n\tName string\n\t// The branch on which this commit was created.\n\tBranch string\n\t// The username of the user who authored this commit.\n\tAuthor string\n\t// The tags associated with this commit\n\tTags []*RepositoryTag\n\t// The commit's draft name, if it is a draft commit.\n\tDraftName string\n\t// spdx_license_id is the license of the commit, based on the\n\t// license file pushed, which should be one of the identifier defined in\n\t// https://spdx.org/licenses, and will be not set if the license file is not\n\t// presented or cannot be classified into a known license.\n\tSpdxLicenseId string\n\t// The manifest digest of the commit.\n\tManifestDigest string\n\t// Number of tags associated with the commit.\n\tTagCount int64\n\t// Number of git commits with associated with the BSR commit.\n\tGitCommitsCount int64\n\t// The b5 digest of the commit.\n\tB5Digest string\n}\n\nfunc (b0 RepositoryCommit_builder) Build() *RepositoryCommit {\n\tm0 := &RepositoryCommit{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_Digest = b.Digest\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Branch = b.Branch\n\tx.xxx_hidden_Author = b.Author\n\tx.xxx_hidden_Tags = &b.Tags\n\tx.xxx_hidden_DraftName = b.DraftName\n\tx.xxx_hidden_SpdxLicenseId = b.SpdxLicenseId\n\tx.xxx_hidden_ManifestDigest = b.ManifestDigest\n\tx.xxx_hidden_TagCount = b.TagCount\n\tx.xxx_hidden_GitCommitsCount = b.GitCommitsCount\n\tx.xxx_hidden_B5Digest = b.B5Digest\n\treturn m0\n}\n\ntype ListRepositoryCommitsByBranchRequest struct {\n\tstate                           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner      string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName       string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_RepositoryBranchName string                 `protobuf:\"bytes,3,opt,name=repository_branch_name,json=repositoryBranchName,proto3\"`\n\txxx_hidden_PageSize             uint32                 `protobuf:\"varint,4,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken            string                 `protobuf:\"bytes,5,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse              bool                   `protobuf:\"varint,6,opt,name=reverse,proto3\"`\n\tunknownFields                   protoimpl.UnknownFields\n\tsizeCache                       protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) Reset() {\n\t*x = ListRepositoryCommitsByBranchRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryCommitsByBranchRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *ListRepositoryCommitsByBranchRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) GetRepositoryBranchName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryBranchName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) SetRepositoryBranchName(v string) {\n\tx.xxx_hidden_RepositoryBranchName = v\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoryCommitsByBranchRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoryCommitsByBranchRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repository which the repository branch belongs to.\n\tRepositoryOwner string\n\t// The name of the repository which the repository branch belongs to.\n\tRepositoryName string\n\t// The name of the repository branch whose commits should be listed.\n\tRepositoryBranchName string\n\tPageSize             uint32\n\t// For now this is the id of he last commit returned in the previous page.\n\t// This is directly set by the frontend when listing track history starting with a\n\t// specific commit. If we page_token to be anything other than a commit id\n\t// we need to change the frontend as well.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListRepositoryCommitsByBranchRequest_builder) Build() *ListRepositoryCommitsByBranchRequest {\n\tm0 := &ListRepositoryCommitsByBranchRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_RepositoryBranchName = b.RepositoryBranchName\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoryCommitsByBranchResponse struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryCommits *[]*RepositoryCommit   `protobuf:\"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3\"`\n\txxx_hidden_NextPageToken     string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryCommitsByBranchResponse) Reset() {\n\t*x = ListRepositoryCommitsByBranchResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryCommitsByBranchResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryCommitsByBranchResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryCommitsByBranchResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *ListRepositoryCommitsByBranchResponse) GetRepositoryCommits() []*RepositoryCommit {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryCommits != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryCommits\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryCommitsByBranchResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByBranchResponse) SetRepositoryCommits(v []*RepositoryCommit) {\n\tx.xxx_hidden_RepositoryCommits = &v\n}\n\nfunc (x *ListRepositoryCommitsByBranchResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryCommitsByBranchResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryCommits []*RepositoryCommit\n\tNextPageToken     string\n}\n\nfunc (b0 ListRepositoryCommitsByBranchResponse_builder) Build() *ListRepositoryCommitsByBranchResponse {\n\tm0 := &ListRepositoryCommitsByBranchResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryCommits = &b.RepositoryCommits\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListRepositoryCommitsByReferenceRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Reference       string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\txxx_hidden_PageSize        uint32                 `protobuf:\"varint,4,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken       string                 `protobuf:\"bytes,5,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse         bool                   `protobuf:\"varint,6,opt,name=reverse,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) Reset() {\n\t*x = ListRepositoryCommitsByReferenceRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryCommitsByReferenceRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *ListRepositoryCommitsByReferenceRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoryCommitsByReferenceRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoryCommitsByReferenceRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repository which the repository reference belongs to.\n\tRepositoryOwner string\n\t// The name of the repository which the repository reference belongs to.\n\tRepositoryName string\n\t// The optional reference used to resolve repository commits. Can be a tag or commit.\n\t// If unspecified, will use the repository's default_branch.\n\tReference string\n\tPageSize  uint32\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListRepositoryCommitsByReferenceRequest_builder) Build() *ListRepositoryCommitsByReferenceRequest {\n\tm0 := &ListRepositoryCommitsByReferenceRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoryCommitsByReferenceResponse struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryCommits *[]*RepositoryCommit   `protobuf:\"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3\"`\n\txxx_hidden_NextPageToken     string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryCommitsByReferenceResponse) Reset() {\n\t*x = ListRepositoryCommitsByReferenceResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryCommitsByReferenceResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryCommitsByReferenceResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryCommitsByReferenceResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *ListRepositoryCommitsByReferenceResponse) GetRepositoryCommits() []*RepositoryCommit {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryCommits != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryCommits\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryCommitsByReferenceResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryCommitsByReferenceResponse) SetRepositoryCommits(v []*RepositoryCommit) {\n\tx.xxx_hidden_RepositoryCommits = &v\n}\n\nfunc (x *ListRepositoryCommitsByReferenceResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryCommitsByReferenceResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryCommits []*RepositoryCommit\n\tNextPageToken     string\n}\n\nfunc (b0 ListRepositoryCommitsByReferenceResponse_builder) Build() *ListRepositoryCommitsByReferenceResponse {\n\tm0 := &ListRepositoryCommitsByReferenceResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryCommits = &b.RepositoryCommits\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype GetRepositoryCommitByReferenceRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Reference       string                 `protobuf:\"bytes,3,opt,name=reference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) Reset() {\n\t*x = GetRepositoryCommitByReferenceRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryCommitByReferenceRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *GetRepositoryCommitByReferenceRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *GetRepositoryCommitByReferenceRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\ntype GetRepositoryCommitByReferenceRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repository which the reference belongs to.\n\tRepositoryOwner string\n\t// The name of the repository which the reference belongs to.\n\tRepositoryName string\n\t// The optional reference that should be resolved to a commit. Can be a tag or commit.\n\t// If unspecified, will use the repository's default_branch.\n\tReference string\n}\n\nfunc (b0 GetRepositoryCommitByReferenceRequest_builder) Build() *GetRepositoryCommitByReferenceRequest {\n\tm0 := &GetRepositoryCommitByReferenceRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Reference = b.Reference\n\treturn m0\n}\n\ntype GetRepositoryCommitByReferenceResponse struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryCommit *RepositoryCommit      `protobuf:\"bytes,1,opt,name=repository_commit,json=repositoryCommit,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryCommitByReferenceResponse) Reset() {\n\t*x = GetRepositoryCommitByReferenceResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryCommitByReferenceResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryCommitByReferenceResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoryCommitByReferenceResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *GetRepositoryCommitByReferenceResponse) GetRepositoryCommit() *RepositoryCommit {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryCommit\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoryCommitByReferenceResponse) SetRepositoryCommit(v *RepositoryCommit) {\n\tx.xxx_hidden_RepositoryCommit = v\n}\n\nfunc (x *GetRepositoryCommitByReferenceResponse) HasRepositoryCommit() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RepositoryCommit != nil\n}\n\nfunc (x *GetRepositoryCommitByReferenceResponse) ClearRepositoryCommit() {\n\tx.xxx_hidden_RepositoryCommit = nil\n}\n\ntype GetRepositoryCommitByReferenceResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryCommit *RepositoryCommit\n}\n\nfunc (b0 GetRepositoryCommitByReferenceResponse_builder) Build() *GetRepositoryCommitByReferenceResponse {\n\tm0 := &GetRepositoryCommitByReferenceResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryCommit = b.RepositoryCommit\n\treturn m0\n}\n\ntype ListRepositoryDraftCommitsRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_PageSize        uint32                 `protobuf:\"varint,3,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken       string                 `protobuf:\"bytes,4,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse         bool                   `protobuf:\"varint,5,opt,name=reverse,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) Reset() {\n\t*x = ListRepositoryDraftCommitsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryDraftCommitsRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryDraftCommitsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *ListRepositoryDraftCommitsRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoryDraftCommitsRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoryDraftCommitsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repository which the repository branch belongs to.\n\tRepositoryOwner string\n\t// The name of the repository which the repository branch belongs to.\n\tRepositoryName string\n\tPageSize       uint32\n\tPageToken      string\n\t// By default, draft commits are ordered by last update time descending.\n\t// Reverse orders them ascending.\n\tReverse bool\n}\n\nfunc (b0 ListRepositoryDraftCommitsRequest_builder) Build() *ListRepositoryDraftCommitsRequest {\n\tm0 := &ListRepositoryDraftCommitsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoryDraftCommitsResponse struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryCommits *[]*RepositoryCommit   `protobuf:\"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3\"`\n\txxx_hidden_NextPageToken     string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryDraftCommitsResponse) Reset() {\n\t*x = ListRepositoryDraftCommitsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryDraftCommitsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryDraftCommitsResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryDraftCommitsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_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\nfunc (x *ListRepositoryDraftCommitsResponse) GetRepositoryCommits() []*RepositoryCommit {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryCommits != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryCommits\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryDraftCommitsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryDraftCommitsResponse) SetRepositoryCommits(v []*RepositoryCommit) {\n\tx.xxx_hidden_RepositoryCommits = &v\n}\n\nfunc (x *ListRepositoryDraftCommitsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryDraftCommitsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Each commit will have draft_name set.\n\tRepositoryCommits []*RepositoryCommit\n\tNextPageToken     string\n}\n\nfunc (b0 ListRepositoryDraftCommitsResponse_builder) Build() *ListRepositoryDraftCommitsResponse {\n\tm0 := &ListRepositoryDraftCommitsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryCommits = &b.RepositoryCommits\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype DeleteRepositoryDraftCommitRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_DraftName       string                 `protobuf:\"bytes,3,opt,name=draft_name,json=draftName,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) Reset() {\n\t*x = DeleteRepositoryDraftCommitRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteRepositoryDraftCommitRequest) ProtoMessage() {}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[9]\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\nfunc (x *DeleteRepositoryDraftCommitRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) GetDraftName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DraftName\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *DeleteRepositoryDraftCommitRequest) SetDraftName(v string) {\n\tx.xxx_hidden_DraftName = v\n}\n\ntype DeleteRepositoryDraftCommitRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repository which the repository branch belongs to.\n\tRepositoryOwner string\n\t// The name of the repository which the repository branch belongs to.\n\tRepositoryName string\n\t// The name of the draft to delete.\n\tDraftName string\n}\n\nfunc (b0 DeleteRepositoryDraftCommitRequest_builder) Build() *DeleteRepositoryDraftCommitRequest {\n\tm0 := &DeleteRepositoryDraftCommitRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_DraftName = b.DraftName\n\treturn m0\n}\n\ntype DeleteRepositoryDraftCommitResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteRepositoryDraftCommitResponse) Reset() {\n\t*x = DeleteRepositoryDraftCommitResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteRepositoryDraftCommitResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteRepositoryDraftCommitResponse) ProtoMessage() {}\n\nfunc (x *DeleteRepositoryDraftCommitResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[10]\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\ntype DeleteRepositoryDraftCommitResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteRepositoryDraftCommitResponse_builder) Build() *DeleteRepositoryDraftCommitResponse {\n\tm0 := &DeleteRepositoryDraftCommitResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_repository_commit_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"3buf/alpha/registry/v1alpha1/repository_commit.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a0buf/alpha/registry/v1alpha1/repository_tag.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xeb\\x03\\n\" +\n\t\"\\x10RepositoryCommit\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12\\x16\\n\" +\n\t\"\\x06digest\\x18\\x03 \\x01(\\tR\\x06digest\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x04 \\x01(\\tR\\x04name\\x12\\x16\\n\" +\n\t\"\\x06branch\\x18\\x05 \\x01(\\tR\\x06branch\\x12\\x16\\n\" +\n\t\"\\x06author\\x18\\a \\x01(\\tR\\x06author\\x12>\\n\" +\n\t\"\\x04tags\\x18\\b \\x03(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagR\\x04tags\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"draft_name\\x18\\t \\x01(\\tR\\tdraftName\\x12&\\n\" +\n\t\"\\x0fspdx_license_id\\x18\\n\" +\n\t\" \\x01(\\tR\\rspdxLicenseId\\x12'\\n\" +\n\t\"\\x0fmanifest_digest\\x18\\v \\x01(\\tR\\x0emanifestDigest\\x12\\x1b\\n\" +\n\t\"\\ttag_count\\x18\\f \\x01(\\x03R\\btagCount\\x12*\\n\" +\n\t\"\\x11git_commits_count\\x18\\r \\x01(\\x03R\\x0fgitCommitsCount\\x12\\x1b\\n\" +\n\t\"\\tb5_digest\\x18\\x0e \\x01(\\tR\\bb5DigestJ\\x04\\b\\x06\\x10\\aR\\x12commit_sequence_id\\\"\\x86\\x02\\n\" +\n\t\"$ListRepositoryCommitsByBranchRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x124\\n\" +\n\t\"\\x16repository_branch_name\\x18\\x03 \\x01(\\tR\\x14repositoryBranchName\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x04 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x05 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x06 \\x01(\\bR\\areverse\\\"\\xad\\x01\\n\" +\n\t\"%ListRepositoryCommitsByBranchResponse\\x12\\\\\\n\" +\n\t\"\\x12repository_commits\\x18\\x01 \\x03(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x11repositoryCommits\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\xf1\\x01\\n\" +\n\t\"'ListRepositoryCommitsByReferenceRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x04 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x05 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x06 \\x01(\\bR\\areverse\\\"\\xb0\\x01\\n\" +\n\t\"(ListRepositoryCommitsByReferenceResponse\\x12\\\\\\n\" +\n\t\"\\x12repository_commits\\x18\\x01 \\x03(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x11repositoryCommits\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x99\\x01\\n\" +\n\t\"%GetRepositoryCommitByReferenceRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x03 \\x01(\\tR\\treference\\\"\\x84\\x01\\n\" +\n\t\"&GetRepositoryCommitByReferenceResponse\\x12Z\\n\" +\n\t\"\\x11repository_commit\\x18\\x01 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x10repositoryCommit\\\"\\xcd\\x01\\n\" +\n\t\"!ListRepositoryDraftCommitsRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x03 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x04 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x05 \\x01(\\bR\\areverse\\\"\\xaa\\x01\\n\" +\n\t\"\\\"ListRepositoryDraftCommitsResponse\\x12\\\\\\n\" +\n\t\"\\x12repository_commits\\x18\\x01 \\x03(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x11repositoryCommits\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x97\\x01\\n\" +\n\t\"\\\"DeleteRepositoryDraftCommitRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"draft_name\\x18\\x03 \\x01(\\tR\\tdraftName\\\"%\\n\" +\n\t\"#DeleteRepositoryDraftCommitResponse2\\xff\\x06\\n\" +\n\t\"\\x17RepositoryCommitService\\x12\\xae\\x01\\n\" +\n\t\"\\x1dListRepositoryCommitsByBranch\\x12A.buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchRequest\\x1aB.buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchResponse\\\"\\x06\\x88\\x02\\x01\\x90\\x02\\x01\\x12\\xb4\\x01\\n\" +\n\t\" ListRepositoryCommitsByReference\\x12D.buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceRequest\\x1aE.buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xae\\x01\\n\" +\n\t\"\\x1eGetRepositoryCommitByReference\\x12B.buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceRequest\\x1aC.buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa2\\x01\\n\" +\n\t\"\\x1aListRepositoryDraftCommits\\x12>.buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsRequest\\x1a?.buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xa5\\x01\\n\" +\n\t\"\\x1bDeleteRepositoryDraftCommit\\x12?.buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitRequest\\x1a@.buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitResponse\\\"\\x03\\x90\\x02\\x02B\\xa2\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x15RepositoryCommitProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes = make([]protoimpl.MessageInfo, 11)\nvar file_buf_alpha_registry_v1alpha1_repository_commit_proto_goTypes = []any{\n\t(*RepositoryCommit)(nil),                         // 0: buf.alpha.registry.v1alpha1.RepositoryCommit\n\t(*ListRepositoryCommitsByBranchRequest)(nil),     // 1: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchRequest\n\t(*ListRepositoryCommitsByBranchResponse)(nil),    // 2: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchResponse\n\t(*ListRepositoryCommitsByReferenceRequest)(nil),  // 3: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceRequest\n\t(*ListRepositoryCommitsByReferenceResponse)(nil), // 4: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceResponse\n\t(*GetRepositoryCommitByReferenceRequest)(nil),    // 5: buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceRequest\n\t(*GetRepositoryCommitByReferenceResponse)(nil),   // 6: buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceResponse\n\t(*ListRepositoryDraftCommitsRequest)(nil),        // 7: buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsRequest\n\t(*ListRepositoryDraftCommitsResponse)(nil),       // 8: buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsResponse\n\t(*DeleteRepositoryDraftCommitRequest)(nil),       // 9: buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitRequest\n\t(*DeleteRepositoryDraftCommitResponse)(nil),      // 10: buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitResponse\n\t(*timestamppb.Timestamp)(nil),                    // 11: google.protobuf.Timestamp\n\t(*RepositoryTag)(nil),                            // 12: buf.alpha.registry.v1alpha1.RepositoryTag\n}\nvar file_buf_alpha_registry_v1alpha1_repository_commit_proto_depIdxs = []int32{\n\t11, // 0: buf.alpha.registry.v1alpha1.RepositoryCommit.create_time:type_name -> google.protobuf.Timestamp\n\t12, // 1: buf.alpha.registry.v1alpha1.RepositoryCommit.tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t0,  // 2: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t0,  // 3: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t0,  // 4: buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceResponse.repository_commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t0,  // 5: buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t1,  // 6: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByBranch:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchRequest\n\t3,  // 7: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByReference:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceRequest\n\t5,  // 8: buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitByReference:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceRequest\n\t7,  // 9: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryDraftCommits:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsRequest\n\t9,  // 10: buf.alpha.registry.v1alpha1.RepositoryCommitService.DeleteRepositoryDraftCommit:input_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitRequest\n\t2,  // 11: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByBranch:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchResponse\n\t4,  // 12: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByReference:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceResponse\n\t6,  // 13: buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitByReference:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceResponse\n\t8,  // 14: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryDraftCommits:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsResponse\n\t10, // 15: buf.alpha.registry.v1alpha1.RepositoryCommitService.DeleteRepositoryDraftCommit:output_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitResponse\n\t11, // [11:16] is the sub-list for method output_type\n\t6,  // [6:11] 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_buf_alpha_registry_v1alpha1_repository_commit_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_repository_commit_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_repository_commit_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_repository_tag_proto_init()\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_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   11,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_repository_commit_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_commit_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_repository_commit_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_repository_commit_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_repository_commit_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_tag.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/repository_tag.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 RepositoryTag struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id         string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_Name       string                 `protobuf:\"bytes,4,opt,name=name,proto3\"`\n\txxx_hidden_CommitName string                 `protobuf:\"bytes,5,opt,name=commit_name,json=commitName,proto3\"`\n\txxx_hidden_Author     string                 `protobuf:\"bytes,6,opt,name=author,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *RepositoryTag) Reset() {\n\t*x = RepositoryTag{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryTag) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryTag) ProtoMessage() {}\n\nfunc (x *RepositoryTag) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *RepositoryTag) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryTag) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryTag) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryTag) GetCommitName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CommitName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryTag) GetAuthor() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Author\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositoryTag) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *RepositoryTag) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *RepositoryTag) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositoryTag) SetCommitName(v string) {\n\tx.xxx_hidden_CommitName = v\n}\n\nfunc (x *RepositoryTag) SetAuthor(v string) {\n\tx.xxx_hidden_Author = v\n}\n\nfunc (x *RepositoryTag) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *RepositoryTag) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\ntype RepositoryTag_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// primary key, unique.\n\t// tags are based on labels, so if a label has been moved, the ID will point to the\n\t// updated entry in the labels table.\n\tId string\n\t// immutable\n\tCreateTime *timestamppb.Timestamp\n\t// We reserve field number '3' for the update_time.\n\t// google.protobuf.Timestamp update_time = 3;\n\t// The name of the repository tag, e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n\tName string\n\t// The name of the commit this tag belongs to.\n\tCommitName string\n\t// The username of the author of the tag.\n\tAuthor string\n}\n\nfunc (b0 RepositoryTag_builder) Build() *RepositoryTag {\n\tm0 := &RepositoryTag{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_CommitName = b.CommitName\n\tx.xxx_hidden_Author = b.Author\n\treturn m0\n}\n\ntype GetRepositoryTagRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_Name         string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryTagRequest) Reset() {\n\t*x = GetRepositoryTagRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryTagRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryTagRequest) ProtoMessage() {}\n\nfunc (x *GetRepositoryTagRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *GetRepositoryTagRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryTagRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRepositoryTagRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *GetRepositoryTagRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype GetRepositoryTagRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository this tag belongs to.\n\tRepositoryId string\n\t// The name of the repository tag to get, e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n\tName string\n}\n\nfunc (b0 GetRepositoryTagRequest_builder) Build() *GetRepositoryTagRequest {\n\tm0 := &GetRepositoryTagRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype GetRepositoryTagResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryTag *RepositoryTag         `protobuf:\"bytes,1,opt,name=repository_tag,json=repositoryTag,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *GetRepositoryTagResponse) Reset() {\n\t*x = GetRepositoryTagResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRepositoryTagResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRepositoryTagResponse) ProtoMessage() {}\n\nfunc (x *GetRepositoryTagResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *GetRepositoryTagResponse) GetRepositoryTag() *RepositoryTag {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryTag\n\t}\n\treturn nil\n}\n\nfunc (x *GetRepositoryTagResponse) SetRepositoryTag(v *RepositoryTag) {\n\tx.xxx_hidden_RepositoryTag = v\n}\n\nfunc (x *GetRepositoryTagResponse) HasRepositoryTag() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RepositoryTag != nil\n}\n\nfunc (x *GetRepositoryTagResponse) ClearRepositoryTag() {\n\tx.xxx_hidden_RepositoryTag = nil\n}\n\ntype GetRepositoryTagResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryTag *RepositoryTag\n}\n\nfunc (b0 GetRepositoryTagResponse_builder) Build() *GetRepositoryTagResponse {\n\tm0 := &GetRepositoryTagResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryTag = b.RepositoryTag\n\treturn m0\n}\n\ntype CreateRepositoryTagRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_Name         string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_CommitName   string                 `protobuf:\"bytes,3,opt,name=commit_name,json=commitName,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *CreateRepositoryTagRequest) Reset() {\n\t*x = CreateRepositoryTagRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateRepositoryTagRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateRepositoryTagRequest) ProtoMessage() {}\n\nfunc (x *CreateRepositoryTagRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *CreateRepositoryTagRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateRepositoryTagRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateRepositoryTagRequest) GetCommitName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CommitName\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateRepositoryTagRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *CreateRepositoryTagRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *CreateRepositoryTagRequest) SetCommitName(v string) {\n\tx.xxx_hidden_CommitName = v\n}\n\ntype CreateRepositoryTagRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository this tag should be created on.\n\tRepositoryId string\n\t// The name of the repository tag, e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n\tName string\n\t// The name of the commit this tag should be created for.\n\tCommitName string\n}\n\nfunc (b0 CreateRepositoryTagRequest_builder) Build() *CreateRepositoryTagRequest {\n\tm0 := &CreateRepositoryTagRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_CommitName = b.CommitName\n\treturn m0\n}\n\ntype CreateRepositoryTagResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryTag *RepositoryTag         `protobuf:\"bytes,1,opt,name=repository_tag,json=repositoryTag,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *CreateRepositoryTagResponse) Reset() {\n\t*x = CreateRepositoryTagResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateRepositoryTagResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateRepositoryTagResponse) ProtoMessage() {}\n\nfunc (x *CreateRepositoryTagResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *CreateRepositoryTagResponse) GetRepositoryTag() *RepositoryTag {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryTag\n\t}\n\treturn nil\n}\n\nfunc (x *CreateRepositoryTagResponse) SetRepositoryTag(v *RepositoryTag) {\n\tx.xxx_hidden_RepositoryTag = v\n}\n\nfunc (x *CreateRepositoryTagResponse) HasRepositoryTag() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RepositoryTag != nil\n}\n\nfunc (x *CreateRepositoryTagResponse) ClearRepositoryTag() {\n\tx.xxx_hidden_RepositoryTag = nil\n}\n\ntype CreateRepositoryTagResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryTag *RepositoryTag\n}\n\nfunc (b0 CreateRepositoryTagResponse_builder) Build() *CreateRepositoryTagResponse {\n\tm0 := &CreateRepositoryTagResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryTag = b.RepositoryTag\n\treturn m0\n}\n\ntype UpdateRepositoryTagRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_Name         string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_CommitName   *string                `protobuf:\"bytes,3,opt,name=commit_name,json=commitName,proto3,oneof\"`\n\tXXX_raceDetectHookData  protoimpl.RaceDetectHookData\n\tXXX_presence            [1]uint32\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *UpdateRepositoryTagRequest) Reset() {\n\t*x = UpdateRepositoryTagRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateRepositoryTagRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateRepositoryTagRequest) ProtoMessage() {}\n\nfunc (x *UpdateRepositoryTagRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *UpdateRepositoryTagRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositoryTagRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositoryTagRequest) GetCommitName() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_CommitName != nil {\n\t\t\treturn *x.xxx_hidden_CommitName\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateRepositoryTagRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *UpdateRepositoryTagRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *UpdateRepositoryTagRequest) SetCommitName(v string) {\n\tx.xxx_hidden_CommitName = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3)\n}\n\nfunc (x *UpdateRepositoryTagRequest) HasCommitName() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *UpdateRepositoryTagRequest) ClearCommitName() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_CommitName = nil\n}\n\ntype UpdateRepositoryTagRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository this tag belongs to.\n\tRepositoryId string\n\t// The name of the repository tag, to update e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n\tName string\n\t// The name of the commit this tag should reference.\n\tCommitName *string\n}\n\nfunc (b0 UpdateRepositoryTagRequest_builder) Build() *UpdateRepositoryTagRequest {\n\tm0 := &UpdateRepositoryTagRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_Name = b.Name\n\tif b.CommitName != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3)\n\t\tx.xxx_hidden_CommitName = b.CommitName\n\t}\n\treturn m0\n}\n\ntype UpdateRepositoryTagResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryTag *RepositoryTag         `protobuf:\"bytes,1,opt,name=repository_tag,json=repositoryTag,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *UpdateRepositoryTagResponse) Reset() {\n\t*x = UpdateRepositoryTagResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateRepositoryTagResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateRepositoryTagResponse) ProtoMessage() {}\n\nfunc (x *UpdateRepositoryTagResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *UpdateRepositoryTagResponse) GetRepositoryTag() *RepositoryTag {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryTag\n\t}\n\treturn nil\n}\n\nfunc (x *UpdateRepositoryTagResponse) SetRepositoryTag(v *RepositoryTag) {\n\tx.xxx_hidden_RepositoryTag = v\n}\n\nfunc (x *UpdateRepositoryTagResponse) HasRepositoryTag() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RepositoryTag != nil\n}\n\nfunc (x *UpdateRepositoryTagResponse) ClearRepositoryTag() {\n\tx.xxx_hidden_RepositoryTag = nil\n}\n\ntype UpdateRepositoryTagResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryTag *RepositoryTag\n}\n\nfunc (b0 UpdateRepositoryTagResponse_builder) Build() *UpdateRepositoryTagResponse {\n\tm0 := &UpdateRepositoryTagResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryTag = b.RepositoryTag\n\treturn m0\n}\n\ntype ListRepositoryTagsRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_PageSize     uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken    string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse      bool                   `protobuf:\"varint,4,opt,name=reverse,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryTagsRequest) Reset() {\n\t*x = ListRepositoryTagsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryTagsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryTagsRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryTagsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *ListRepositoryTagsRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryTagsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryTagsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryTagsRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoryTagsRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ListRepositoryTagsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryTagsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoryTagsRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoryTagsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository whose tags should be listed.\n\tRepositoryId string\n\tPageSize     uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListRepositoryTagsRequest_builder) Build() *ListRepositoryTagsRequest {\n\tm0 := &ListRepositoryTagsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoryTagsResponse struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryTags *[]*RepositoryTag      `protobuf:\"bytes,1,rep,name=repository_tags,json=repositoryTags,proto3\"`\n\txxx_hidden_NextPageToken  string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryTagsResponse) Reset() {\n\t*x = ListRepositoryTagsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryTagsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryTagsResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryTagsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_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\nfunc (x *ListRepositoryTagsResponse) GetRepositoryTags() []*RepositoryTag {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryTags != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryTags\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryTagsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryTagsResponse) SetRepositoryTags(v []*RepositoryTag) {\n\tx.xxx_hidden_RepositoryTags = &v\n}\n\nfunc (x *ListRepositoryTagsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryTagsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryTags []*RepositoryTag\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListRepositoryTagsResponse_builder) Build() *ListRepositoryTagsResponse {\n\tm0 := &ListRepositoryTagsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryTags = &b.RepositoryTags\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListRepositoryTagsForReferenceRequest struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_Reference    string                 `protobuf:\"bytes,2,opt,name=reference,proto3\"`\n\txxx_hidden_PageSize     uint32                 `protobuf:\"varint,3,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken    string                 `protobuf:\"bytes,4,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse      bool                   `protobuf:\"varint,5,opt,name=reverse,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) Reset() {\n\t*x = ListRepositoryTagsForReferenceRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryTagsForReferenceRequest) ProtoMessage() {}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[9]\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\nfunc (x *ListRepositoryTagsForReferenceRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) GetReference() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) SetReference(v string) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListRepositoryTagsForReferenceRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListRepositoryTagsForReferenceRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the repository whose tags should be listed.\n\tRepositoryId string\n\t// Optional reference (if unspecified, will use the repository's default_branch).\n\tReference string\n\tPageSize  uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListRepositoryTagsForReferenceRequest_builder) Build() *ListRepositoryTagsForReferenceRequest {\n\tm0 := &ListRepositoryTagsForReferenceRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListRepositoryTagsForReferenceResponse struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryTags *[]*RepositoryTag      `protobuf:\"bytes,1,rep,name=repository_tags,json=repositoryTags,proto3\"`\n\txxx_hidden_NextPageToken  string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ListRepositoryTagsForReferenceResponse) Reset() {\n\t*x = ListRepositoryTagsForReferenceResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListRepositoryTagsForReferenceResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListRepositoryTagsForReferenceResponse) ProtoMessage() {}\n\nfunc (x *ListRepositoryTagsForReferenceResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[10]\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\nfunc (x *ListRepositoryTagsForReferenceResponse) GetRepositoryTags() []*RepositoryTag {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryTags != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryTags\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListRepositoryTagsForReferenceResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListRepositoryTagsForReferenceResponse) SetRepositoryTags(v []*RepositoryTag) {\n\tx.xxx_hidden_RepositoryTags = &v\n}\n\nfunc (x *ListRepositoryTagsForReferenceResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListRepositoryTagsForReferenceResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryTags []*RepositoryTag\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListRepositoryTagsForReferenceResponse_builder) Build() *ListRepositoryTagsForReferenceResponse {\n\tm0 := &ListRepositoryTagsForReferenceResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryTags = &b.RepositoryTags\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_repository_tag_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"0buf/alpha/registry/v1alpha1/repository_tag.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xa9\\x01\\n\" +\n\t\"\\rRepositoryTag\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x04 \\x01(\\tR\\x04name\\x12\\x1f\\n\" +\n\t\"\\vcommit_name\\x18\\x05 \\x01(\\tR\\n\" +\n\t\"commitName\\x12\\x16\\n\" +\n\t\"\\x06author\\x18\\x06 \\x01(\\tR\\x06author\\\"R\\n\" +\n\t\"\\x17GetRepositoryTagRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\\"m\\n\" +\n\t\"\\x18GetRepositoryTagResponse\\x12Q\\n\" +\n\t\"\\x0erepository_tag\\x18\\x01 \\x01(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagR\\rrepositoryTag\\\"v\\n\" +\n\t\"\\x1aCreateRepositoryTagRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x1f\\n\" +\n\t\"\\vcommit_name\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"commitName\\\"p\\n\" +\n\t\"\\x1bCreateRepositoryTagResponse\\x12Q\\n\" +\n\t\"\\x0erepository_tag\\x18\\x01 \\x01(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagR\\rrepositoryTag\\\"\\x8b\\x01\\n\" +\n\t\"\\x1aUpdateRepositoryTagRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12$\\n\" +\n\t\"\\vcommit_name\\x18\\x03 \\x01(\\tH\\x00R\\n\" +\n\t\"commitName\\x88\\x01\\x01B\\x0e\\n\" +\n\t\"\\f_commit_name\\\"p\\n\" +\n\t\"\\x1bUpdateRepositoryTagResponse\\x12Q\\n\" +\n\t\"\\x0erepository_tag\\x18\\x01 \\x01(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagR\\rrepositoryTag\\\"\\x96\\x01\\n\" +\n\t\"\\x19ListRepositoryTagsRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x04 \\x01(\\bR\\areverse\\\"\\x99\\x01\\n\" +\n\t\"\\x1aListRepositoryTagsResponse\\x12S\\n\" +\n\t\"\\x0frepository_tags\\x18\\x01 \\x03(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagR\\x0erepositoryTags\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\xc0\\x01\\n\" +\n\t\"%ListRepositoryTagsForReferenceRequest\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12\\x1c\\n\" +\n\t\"\\treference\\x18\\x02 \\x01(\\tR\\treference\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x03 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x04 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x05 \\x01(\\bR\\areverse\\\"\\xa5\\x01\\n\" +\n\t\"&ListRepositoryTagsForReferenceResponse\\x12S\\n\" +\n\t\"\\x0frepository_tags\\x18\\x01 \\x03(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagR\\x0erepositoryTags\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken2\\xfb\\x05\\n\" +\n\t\"\\x14RepositoryTagService\\x12\\x84\\x01\\n\" +\n\t\"\\x10GetRepositoryTag\\x124.buf.alpha.registry.v1alpha1.GetRepositoryTagRequest\\x1a5.buf.alpha.registry.v1alpha1.GetRepositoryTagResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x8d\\x01\\n\" +\n\t\"\\x13CreateRepositoryTag\\x127.buf.alpha.registry.v1alpha1.CreateRepositoryTagRequest\\x1a8.buf.alpha.registry.v1alpha1.CreateRepositoryTagResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x8d\\x01\\n\" +\n\t\"\\x13UpdateRepositoryTag\\x127.buf.alpha.registry.v1alpha1.UpdateRepositoryTagRequest\\x1a8.buf.alpha.registry.v1alpha1.UpdateRepositoryTagResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x8a\\x01\\n\" +\n\t\"\\x12ListRepositoryTags\\x126.buf.alpha.registry.v1alpha1.ListRepositoryTagsRequest\\x1a7.buf.alpha.registry.v1alpha1.ListRepositoryTagsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\xae\\x01\\n\" +\n\t\"\\x1eListRepositoryTagsForReference\\x12B.buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceRequest\\x1aC.buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceResponse\\\"\\x03\\x90\\x02\\x01B\\x9f\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x12RepositoryTagProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes = make([]protoimpl.MessageInfo, 11)\nvar file_buf_alpha_registry_v1alpha1_repository_tag_proto_goTypes = []any{\n\t(*RepositoryTag)(nil),                          // 0: buf.alpha.registry.v1alpha1.RepositoryTag\n\t(*GetRepositoryTagRequest)(nil),                // 1: buf.alpha.registry.v1alpha1.GetRepositoryTagRequest\n\t(*GetRepositoryTagResponse)(nil),               // 2: buf.alpha.registry.v1alpha1.GetRepositoryTagResponse\n\t(*CreateRepositoryTagRequest)(nil),             // 3: buf.alpha.registry.v1alpha1.CreateRepositoryTagRequest\n\t(*CreateRepositoryTagResponse)(nil),            // 4: buf.alpha.registry.v1alpha1.CreateRepositoryTagResponse\n\t(*UpdateRepositoryTagRequest)(nil),             // 5: buf.alpha.registry.v1alpha1.UpdateRepositoryTagRequest\n\t(*UpdateRepositoryTagResponse)(nil),            // 6: buf.alpha.registry.v1alpha1.UpdateRepositoryTagResponse\n\t(*ListRepositoryTagsRequest)(nil),              // 7: buf.alpha.registry.v1alpha1.ListRepositoryTagsRequest\n\t(*ListRepositoryTagsResponse)(nil),             // 8: buf.alpha.registry.v1alpha1.ListRepositoryTagsResponse\n\t(*ListRepositoryTagsForReferenceRequest)(nil),  // 9: buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceRequest\n\t(*ListRepositoryTagsForReferenceResponse)(nil), // 10: buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceResponse\n\t(*timestamppb.Timestamp)(nil),                  // 11: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_repository_tag_proto_depIdxs = []int32{\n\t11, // 0: buf.alpha.registry.v1alpha1.RepositoryTag.create_time:type_name -> google.protobuf.Timestamp\n\t0,  // 1: buf.alpha.registry.v1alpha1.GetRepositoryTagResponse.repository_tag:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t0,  // 2: buf.alpha.registry.v1alpha1.CreateRepositoryTagResponse.repository_tag:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t0,  // 3: buf.alpha.registry.v1alpha1.UpdateRepositoryTagResponse.repository_tag:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t0,  // 4: buf.alpha.registry.v1alpha1.ListRepositoryTagsResponse.repository_tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t0,  // 5: buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceResponse.repository_tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t1,  // 6: buf.alpha.registry.v1alpha1.RepositoryTagService.GetRepositoryTag:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryTagRequest\n\t3,  // 7: buf.alpha.registry.v1alpha1.RepositoryTagService.CreateRepositoryTag:input_type -> buf.alpha.registry.v1alpha1.CreateRepositoryTagRequest\n\t5,  // 8: buf.alpha.registry.v1alpha1.RepositoryTagService.UpdateRepositoryTag:input_type -> buf.alpha.registry.v1alpha1.UpdateRepositoryTagRequest\n\t7,  // 9: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTags:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsRequest\n\t9,  // 10: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTagsForReference:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceRequest\n\t2,  // 11: buf.alpha.registry.v1alpha1.RepositoryTagService.GetRepositoryTag:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryTagResponse\n\t4,  // 12: buf.alpha.registry.v1alpha1.RepositoryTagService.CreateRepositoryTag:output_type -> buf.alpha.registry.v1alpha1.CreateRepositoryTagResponse\n\t6,  // 13: buf.alpha.registry.v1alpha1.RepositoryTagService.UpdateRepositoryTag:output_type -> buf.alpha.registry.v1alpha1.UpdateRepositoryTagResponse\n\t8,  // 14: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTags:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsResponse\n\t10, // 15: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTagsForReference:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceResponse\n\t11, // [11:16] is the sub-list for method output_type\n\t6,  // [6:11] 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_buf_alpha_registry_v1alpha1_repository_tag_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_repository_tag_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_repository_tag_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[5].OneofWrappers = []any{}\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_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   11,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_repository_tag_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_tag_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_repository_tag_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_repository_tag_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_repository_tag_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/resolve.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/resolve.proto\n\npackage registryv1alpha1\n\nimport (\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 ResolvedReferenceType int32\n\nconst (\n\tResolvedReferenceType_RESOLVED_REFERENCE_TYPE_UNSPECIFIED ResolvedReferenceType = 0\n\tResolvedReferenceType_RESOLVED_REFERENCE_TYPE_COMMIT      ResolvedReferenceType = 1\n\tResolvedReferenceType_RESOLVED_REFERENCE_TYPE_BRANCH      ResolvedReferenceType = 2\n\tResolvedReferenceType_RESOLVED_REFERENCE_TYPE_TAG         ResolvedReferenceType = 3\n\tResolvedReferenceType_RESOLVED_REFERENCE_TYPE_DRAFT       ResolvedReferenceType = 5\n)\n\n// Enum value maps for ResolvedReferenceType.\nvar (\n\tResolvedReferenceType_name = map[int32]string{\n\t\t0: \"RESOLVED_REFERENCE_TYPE_UNSPECIFIED\",\n\t\t1: \"RESOLVED_REFERENCE_TYPE_COMMIT\",\n\t\t2: \"RESOLVED_REFERENCE_TYPE_BRANCH\",\n\t\t3: \"RESOLVED_REFERENCE_TYPE_TAG\",\n\t\t5: \"RESOLVED_REFERENCE_TYPE_DRAFT\",\n\t}\n\tResolvedReferenceType_value = map[string]int32{\n\t\t\"RESOLVED_REFERENCE_TYPE_UNSPECIFIED\": 0,\n\t\t\"RESOLVED_REFERENCE_TYPE_COMMIT\":      1,\n\t\t\"RESOLVED_REFERENCE_TYPE_BRANCH\":      2,\n\t\t\"RESOLVED_REFERENCE_TYPE_TAG\":         3,\n\t\t\"RESOLVED_REFERENCE_TYPE_DRAFT\":       5,\n\t}\n)\n\nfunc (x ResolvedReferenceType) Enum() *ResolvedReferenceType {\n\tp := new(ResolvedReferenceType)\n\t*p = x\n\treturn p\n}\n\nfunc (x ResolvedReferenceType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ResolvedReferenceType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes[0].Descriptor()\n}\n\nfunc (ResolvedReferenceType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes[0]\n}\n\nfunc (x ResolvedReferenceType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype GetModulePinsRequest struct {\n\tstate                        protoimpl.MessageState       `protogen:\"opaque.v1\"`\n\txxx_hidden_ModuleReferences  *[]*v1alpha1.ModuleReference `protobuf:\"bytes,1,rep,name=module_references,json=moduleReferences,proto3\"`\n\txxx_hidden_CurrentModulePins *[]*v1alpha1.ModulePin       `protobuf:\"bytes,2,rep,name=current_module_pins,json=currentModulePins,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *GetModulePinsRequest) Reset() {\n\t*x = GetModulePinsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetModulePinsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetModulePinsRequest) ProtoMessage() {}\n\nfunc (x *GetModulePinsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetModulePinsRequest) GetModuleReferences() []*v1alpha1.ModuleReference {\n\tif x != nil {\n\t\tif x.xxx_hidden_ModuleReferences != nil {\n\t\t\treturn *x.xxx_hidden_ModuleReferences\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetModulePinsRequest) GetCurrentModulePins() []*v1alpha1.ModulePin {\n\tif x != nil {\n\t\tif x.xxx_hidden_CurrentModulePins != nil {\n\t\t\treturn *x.xxx_hidden_CurrentModulePins\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetModulePinsRequest) SetModuleReferences(v []*v1alpha1.ModuleReference) {\n\tx.xxx_hidden_ModuleReferences = &v\n}\n\nfunc (x *GetModulePinsRequest) SetCurrentModulePins(v []*v1alpha1.ModulePin) {\n\tx.xxx_hidden_CurrentModulePins = &v\n}\n\ntype GetModulePinsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tModuleReferences []*v1alpha1.ModuleReference\n\t// current_module_pins allows for partial dependency updates by letting clients\n\t// send a request with the pins for their current module and only the\n\t// identities of the dependencies they want to update in module_references.\n\t//\n\t// When resolving, if a client supplied module pin is:\n\t//   - in the transitive closure of pins resolved from the module_references,\n\t//     the client supplied module pin will be an extra candidate for tie\n\t//     breaking.\n\t//   - NOT in the in the transitive closure of pins resolved from the\n\t//     module_references, it will be returned as is.\n\tCurrentModulePins []*v1alpha1.ModulePin\n}\n\nfunc (b0 GetModulePinsRequest_builder) Build() *GetModulePinsRequest {\n\tm0 := &GetModulePinsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ModuleReferences = &b.ModuleReferences\n\tx.xxx_hidden_CurrentModulePins = &b.CurrentModulePins\n\treturn m0\n}\n\ntype GetModulePinsResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ModulePins *[]*v1alpha1.ModulePin `protobuf:\"bytes,1,rep,name=module_pins,json=modulePins,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetModulePinsResponse) Reset() {\n\t*x = GetModulePinsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetModulePinsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetModulePinsResponse) ProtoMessage() {}\n\nfunc (x *GetModulePinsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetModulePinsResponse) GetModulePins() []*v1alpha1.ModulePin {\n\tif x != nil {\n\t\tif x.xxx_hidden_ModulePins != nil {\n\t\t\treturn *x.xxx_hidden_ModulePins\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetModulePinsResponse) SetModulePins(v []*v1alpha1.ModulePin) {\n\tx.xxx_hidden_ModulePins = &v\n}\n\ntype GetModulePinsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tModulePins []*v1alpha1.ModulePin\n}\n\nfunc (b0 GetModulePinsResponse_builder) Build() *GetModulePinsResponse {\n\tm0 := &GetModulePinsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ModulePins = &b.ModulePins\n\treturn m0\n}\n\ntype GetLocalModulePinsRequest struct {\n\tstate                            protoimpl.MessageState   `protogen:\"opaque.v1\"`\n\txxx_hidden_LocalModuleReferences *[]*LocalModuleReference `protobuf:\"bytes,1,rep,name=local_module_references,json=localModuleReferences,proto3\"`\n\tunknownFields                    protoimpl.UnknownFields\n\tsizeCache                        protoimpl.SizeCache\n}\n\nfunc (x *GetLocalModulePinsRequest) Reset() {\n\t*x = GetLocalModulePinsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetLocalModulePinsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetLocalModulePinsRequest) ProtoMessage() {}\n\nfunc (x *GetLocalModulePinsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetLocalModulePinsRequest) GetLocalModuleReferences() []*LocalModuleReference {\n\tif x != nil {\n\t\tif x.xxx_hidden_LocalModuleReferences != nil {\n\t\t\treturn *x.xxx_hidden_LocalModuleReferences\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetLocalModulePinsRequest) SetLocalModuleReferences(v []*LocalModuleReference) {\n\tx.xxx_hidden_LocalModuleReferences = &v\n}\n\ntype GetLocalModulePinsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tLocalModuleReferences []*LocalModuleReference\n}\n\nfunc (b0 GetLocalModulePinsRequest_builder) Build() *GetLocalModulePinsRequest {\n\tm0 := &GetLocalModulePinsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_LocalModuleReferences = &b.LocalModuleReferences\n\treturn m0\n}\n\ntype LocalModuleResolveResult struct {\n\tstate                            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Reference             *LocalModuleReference  `protobuf:\"bytes,1,opt,name=reference,proto3\"`\n\txxx_hidden_Pin                   *LocalModulePin        `protobuf:\"bytes,2,opt,name=pin,proto3\"`\n\txxx_hidden_ResolvedReferenceType ResolvedReferenceType  `protobuf:\"varint,3,opt,name=resolved_reference_type,json=resolvedReferenceType,proto3,enum=buf.alpha.registry.v1alpha1.ResolvedReferenceType\"`\n\tunknownFields                    protoimpl.UnknownFields\n\tsizeCache                        protoimpl.SizeCache\n}\n\nfunc (x *LocalModuleResolveResult) Reset() {\n\t*x = LocalModuleResolveResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *LocalModuleResolveResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*LocalModuleResolveResult) ProtoMessage() {}\n\nfunc (x *LocalModuleResolveResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *LocalModuleResolveResult) GetReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reference\n\t}\n\treturn nil\n}\n\nfunc (x *LocalModuleResolveResult) GetPin() *LocalModulePin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Pin\n\t}\n\treturn nil\n}\n\nfunc (x *LocalModuleResolveResult) GetResolvedReferenceType() ResolvedReferenceType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ResolvedReferenceType\n\t}\n\treturn ResolvedReferenceType_RESOLVED_REFERENCE_TYPE_UNSPECIFIED\n}\n\nfunc (x *LocalModuleResolveResult) SetReference(v *LocalModuleReference) {\n\tx.xxx_hidden_Reference = v\n}\n\nfunc (x *LocalModuleResolveResult) SetPin(v *LocalModulePin) {\n\tx.xxx_hidden_Pin = v\n}\n\nfunc (x *LocalModuleResolveResult) SetResolvedReferenceType(v ResolvedReferenceType) {\n\tx.xxx_hidden_ResolvedReferenceType = v\n}\n\nfunc (x *LocalModuleResolveResult) HasReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Reference != nil\n}\n\nfunc (x *LocalModuleResolveResult) HasPin() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Pin != nil\n}\n\nfunc (x *LocalModuleResolveResult) ClearReference() {\n\tx.xxx_hidden_Reference = nil\n}\n\nfunc (x *LocalModuleResolveResult) ClearPin() {\n\tx.xxx_hidden_Pin = nil\n}\n\ntype LocalModuleResolveResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// A copy of the reference that was resolved.\n\tReference *LocalModuleReference\n\t// The pin the reference resolved to.\n\tPin *LocalModulePin\n\t// The type the reference resolved as.\n\tResolvedReferenceType ResolvedReferenceType\n}\n\nfunc (b0 LocalModuleResolveResult_builder) Build() *LocalModuleResolveResult {\n\tm0 := &LocalModuleResolveResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Reference = b.Reference\n\tx.xxx_hidden_Pin = b.Pin\n\tx.xxx_hidden_ResolvedReferenceType = b.ResolvedReferenceType\n\treturn m0\n}\n\ntype GetLocalModulePinsResponse struct {\n\tstate                                protoimpl.MessageState       `protogen:\"opaque.v1\"`\n\txxx_hidden_LocalModuleResolveResults *[]*LocalModuleResolveResult `protobuf:\"bytes,1,rep,name=local_module_resolve_results,json=localModuleResolveResults,proto3\"`\n\txxx_hidden_Dependencies              *[]*v1alpha1.ModulePin       `protobuf:\"bytes,2,rep,name=dependencies,proto3\"`\n\tunknownFields                        protoimpl.UnknownFields\n\tsizeCache                            protoimpl.SizeCache\n}\n\nfunc (x *GetLocalModulePinsResponse) Reset() {\n\t*x = GetLocalModulePinsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetLocalModulePinsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetLocalModulePinsResponse) ProtoMessage() {}\n\nfunc (x *GetLocalModulePinsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetLocalModulePinsResponse) GetLocalModuleResolveResults() []*LocalModuleResolveResult {\n\tif x != nil {\n\t\tif x.xxx_hidden_LocalModuleResolveResults != nil {\n\t\t\treturn *x.xxx_hidden_LocalModuleResolveResults\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetLocalModulePinsResponse) GetDependencies() []*v1alpha1.ModulePin {\n\tif x != nil {\n\t\tif x.xxx_hidden_Dependencies != nil {\n\t\t\treturn *x.xxx_hidden_Dependencies\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *GetLocalModulePinsResponse) SetLocalModuleResolveResults(v []*LocalModuleResolveResult) {\n\tx.xxx_hidden_LocalModuleResolveResults = &v\n}\n\nfunc (x *GetLocalModulePinsResponse) SetDependencies(v []*v1alpha1.ModulePin) {\n\tx.xxx_hidden_Dependencies = &v\n}\n\ntype GetLocalModulePinsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tLocalModuleResolveResults []*LocalModuleResolveResult\n\t// dependencies are the dependencies of the LocalModulePins.\n\t//\n\t// This includes the transitive deps.\n\tDependencies []*v1alpha1.ModulePin\n}\n\nfunc (b0 GetLocalModulePinsResponse_builder) Build() *GetLocalModulePinsResponse {\n\tm0 := &GetLocalModulePinsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_LocalModuleResolveResults = &b.LocalModuleResolveResults\n\tx.xxx_hidden_Dependencies = &b.Dependencies\n\treturn m0\n}\n\ntype GetGoVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetGoVersionRequest) Reset() {\n\t*x = GetGoVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetGoVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetGoVersionRequest) ProtoMessage() {}\n\nfunc (x *GetGoVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetGoVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetGoVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetGoVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetGoVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetGoVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetGoVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetGoVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetGoVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetGoVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetGoVersionRequest_builder) Build() *GetGoVersionRequest {\n\tm0 := &GetGoVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetGoVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetGoVersionResponse) Reset() {\n\t*x = GetGoVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetGoVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetGoVersionResponse) ProtoMessage() {}\n\nfunc (x *GetGoVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetGoVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetGoVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetGoVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the go module proxy.\n\tVersion string\n}\n\nfunc (b0 GetGoVersionResponse_builder) Build() *GetGoVersionResponse {\n\tm0 := &GetGoVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype GetMavenVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetMavenVersionRequest) Reset() {\n\t*x = GetMavenVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetMavenVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetMavenVersionRequest) ProtoMessage() {}\n\nfunc (x *GetMavenVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetMavenVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetMavenVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetMavenVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetMavenVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetMavenVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetMavenVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetMavenVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetMavenVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetMavenVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetMavenVersionRequest_builder) Build() *GetMavenVersionRequest {\n\tm0 := &GetMavenVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetMavenVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetMavenVersionResponse) Reset() {\n\t*x = GetMavenVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetMavenVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetMavenVersionResponse) ProtoMessage() {}\n\nfunc (x *GetMavenVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_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\nfunc (x *GetMavenVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetMavenVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetMavenVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the maven repository.\n\tVersion string\n}\n\nfunc (b0 GetMavenVersionResponse_builder) Build() *GetMavenVersionResponse {\n\tm0 := &GetMavenVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype GetNPMVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetNPMVersionRequest) Reset() {\n\t*x = GetNPMVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetNPMVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetNPMVersionRequest) ProtoMessage() {}\n\nfunc (x *GetNPMVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[9]\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\nfunc (x *GetNPMVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetNPMVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetNPMVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetNPMVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetNPMVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetNPMVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetNPMVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetNPMVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetNPMVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetNPMVersionRequest_builder) Build() *GetNPMVersionRequest {\n\tm0 := &GetNPMVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetNPMVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetNPMVersionResponse) Reset() {\n\t*x = GetNPMVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetNPMVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetNPMVersionResponse) ProtoMessage() {}\n\nfunc (x *GetNPMVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[10]\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\nfunc (x *GetNPMVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetNPMVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetNPMVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the npm registry.\n\tVersion string\n}\n\nfunc (b0 GetNPMVersionResponse_builder) Build() *GetNPMVersionResponse {\n\tm0 := &GetNPMVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype GetSwiftVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetSwiftVersionRequest) Reset() {\n\t*x = GetSwiftVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSwiftVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSwiftVersionRequest) ProtoMessage() {}\n\nfunc (x *GetSwiftVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[11]\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\nfunc (x *GetSwiftVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetSwiftVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetSwiftVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetSwiftVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetSwiftVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetSwiftVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetSwiftVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetSwiftVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetSwiftVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetSwiftVersionRequest_builder) Build() *GetSwiftVersionRequest {\n\tm0 := &GetSwiftVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetSwiftVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetSwiftVersionResponse) Reset() {\n\t*x = GetSwiftVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSwiftVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSwiftVersionResponse) ProtoMessage() {}\n\nfunc (x *GetSwiftVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[12]\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\nfunc (x *GetSwiftVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSwiftVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetSwiftVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the swift registry.\n\tVersion string\n}\n\nfunc (b0 GetSwiftVersionResponse_builder) Build() *GetSwiftVersionResponse {\n\tm0 := &GetSwiftVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype GetPythonVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetPythonVersionRequest) Reset() {\n\t*x = GetPythonVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetPythonVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetPythonVersionRequest) ProtoMessage() {}\n\nfunc (x *GetPythonVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[13]\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\nfunc (x *GetPythonVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetPythonVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetPythonVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetPythonVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetPythonVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetPythonVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetPythonVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetPythonVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetPythonVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetPythonVersionRequest_builder) Build() *GetPythonVersionRequest {\n\tm0 := &GetPythonVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetPythonVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetPythonVersionResponse) Reset() {\n\t*x = GetPythonVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetPythonVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetPythonVersionResponse) ProtoMessage() {}\n\nfunc (x *GetPythonVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[14]\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\nfunc (x *GetPythonVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetPythonVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetPythonVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the python repository.\n\tVersion string\n}\n\nfunc (b0 GetPythonVersionResponse_builder) Build() *GetPythonVersionResponse {\n\tm0 := &GetPythonVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype GetCargoVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetCargoVersionRequest) Reset() {\n\t*x = GetCargoVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCargoVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCargoVersionRequest) ProtoMessage() {}\n\nfunc (x *GetCargoVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[15]\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\nfunc (x *GetCargoVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetCargoVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetCargoVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetCargoVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetCargoVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetCargoVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetCargoVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetCargoVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetCargoVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetCargoVersionRequest_builder) Build() *GetCargoVersionRequest {\n\tm0 := &GetCargoVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetCargoVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetCargoVersionResponse) Reset() {\n\t*x = GetCargoVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCargoVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCargoVersionResponse) ProtoMessage() {}\n\nfunc (x *GetCargoVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[16]\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\nfunc (x *GetCargoVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetCargoVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetCargoVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the cargo registry.\n\tVersion string\n}\n\nfunc (b0 GetCargoVersionResponse_builder) Build() *GetCargoVersionResponse {\n\tm0 := &GetCargoVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype GetNugetVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetNugetVersionRequest) Reset() {\n\t*x = GetNugetVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetNugetVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetNugetVersionRequest) ProtoMessage() {}\n\nfunc (x *GetNugetVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[17]\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\nfunc (x *GetNugetVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetNugetVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetNugetVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetNugetVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetNugetVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetNugetVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetNugetVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetNugetVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetNugetVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetNugetVersionRequest_builder) Build() *GetNugetVersionRequest {\n\tm0 := &GetNugetVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetNugetVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetNugetVersionResponse) Reset() {\n\t*x = GetNugetVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetNugetVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetNugetVersionResponse) ProtoMessage() {}\n\nfunc (x *GetNugetVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[18]\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\nfunc (x *GetNugetVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetNugetVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetNugetVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the nuget registry.\n\tVersion string\n}\n\nfunc (b0 GetNugetVersionResponse_builder) Build() *GetNugetVersionResponse {\n\tm0 := &GetNugetVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\ntype GetCmakeVersionRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,2,opt,name=module_reference,json=moduleReference,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetCmakeVersionRequest) Reset() {\n\t*x = GetCmakeVersionRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCmakeVersionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCmakeVersionRequest) ProtoMessage() {}\n\nfunc (x *GetCmakeVersionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[19]\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\nfunc (x *GetCmakeVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetCmakeVersionRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetCmakeVersionRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetCmakeVersionRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetCmakeVersionRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetCmakeVersionRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetCmakeVersionRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\nfunc (x *GetCmakeVersionRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\ntype GetCmakeVersionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin reference to resolve.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The module reference to resolve.\n\tModuleReference *LocalModuleReference\n}\n\nfunc (b0 GetCmakeVersionRequest_builder) Build() *GetCmakeVersionRequest {\n\tm0 := &GetCmakeVersionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\treturn m0\n}\n\ntype GetCmakeVersionResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Version string                 `protobuf:\"bytes,1,opt,name=version,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetCmakeVersionResponse) Reset() {\n\t*x = GetCmakeVersionResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetCmakeVersionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetCmakeVersionResponse) ProtoMessage() {}\n\nfunc (x *GetCmakeVersionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[20]\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\nfunc (x *GetCmakeVersionResponse) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetCmakeVersionResponse) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\ntype GetCmakeVersionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// version is the resolved version to be used with the cmake registry.\n\tVersion string\n}\n\nfunc (b0 GetCmakeVersionResponse_builder) Build() *GetCmakeVersionResponse {\n\tm0 := &GetCmakeVersionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Version = b.Version\n\treturn m0\n}\n\n// GetRemotePackageVersionPlugin is a plugin reference.\n// If the version is empty, this is a reference to the latest version.\ntype GetRemotePackageVersionPlugin struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner    string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name     string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Version  string                 `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_Revision uint32                 `protobuf:\"varint,4,opt,name=revision,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *GetRemotePackageVersionPlugin) Reset() {\n\t*x = GetRemotePackageVersionPlugin{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetRemotePackageVersionPlugin) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetRemotePackageVersionPlugin) ProtoMessage() {}\n\nfunc (x *GetRemotePackageVersionPlugin) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[21]\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\nfunc (x *GetRemotePackageVersionPlugin) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRemotePackageVersionPlugin) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRemotePackageVersionPlugin) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetRemotePackageVersionPlugin) GetRevision() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Revision\n\t}\n\treturn 0\n}\n\nfunc (x *GetRemotePackageVersionPlugin) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetRemotePackageVersionPlugin) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GetRemotePackageVersionPlugin) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *GetRemotePackageVersionPlugin) SetRevision(v uint32) {\n\tx.xxx_hidden_Revision = v\n}\n\ntype GetRemotePackageVersionPlugin_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the plugin.\n\t// example: bufbuild\n\tOwner string\n\t// The name of the plugin.\n\t// example: connect-go\n\tName string\n\t// The version of the plugin.\n\t// If empty, this is a reference to the latest version.\n\t// example: v1.0.0\n\tVersion string\n\t// The revision of the plugin version.\n\t// example: 1\n\tRevision uint32\n}\n\nfunc (b0 GetRemotePackageVersionPlugin_builder) Build() *GetRemotePackageVersionPlugin {\n\tm0 := &GetRemotePackageVersionPlugin{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_Revision = b.Revision\n\treturn m0\n}\n\ntype GetSDKInfoRequest struct {\n\tstate                      protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_ModuleReference *LocalModuleReference          `protobuf:\"bytes,1,opt,name=module_reference,json=moduleReference,proto3\"`\n\txxx_hidden_PluginReference *GetRemotePackageVersionPlugin `protobuf:\"bytes,2,opt,name=plugin_reference,json=pluginReference,proto3\"`\n\txxx_hidden_SdkVersion      string                         `protobuf:\"bytes,3,opt,name=sdk_version,json=sdkVersion,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *GetSDKInfoRequest) Reset() {\n\t*x = GetSDKInfoRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[22]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSDKInfoRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSDKInfoRequest) ProtoMessage() {}\n\nfunc (x *GetSDKInfoRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[22]\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\nfunc (x *GetSDKInfoRequest) GetModuleReference() *LocalModuleReference {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetSDKInfoRequest) GetPluginReference() *GetRemotePackageVersionPlugin {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginReference\n\t}\n\treturn nil\n}\n\nfunc (x *GetSDKInfoRequest) GetSdkVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SdkVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoRequest) SetModuleReference(v *LocalModuleReference) {\n\tx.xxx_hidden_ModuleReference = v\n}\n\nfunc (x *GetSDKInfoRequest) SetPluginReference(v *GetRemotePackageVersionPlugin) {\n\tx.xxx_hidden_PluginReference = v\n}\n\nfunc (x *GetSDKInfoRequest) SetSdkVersion(v string) {\n\tx.xxx_hidden_SdkVersion = v\n}\n\nfunc (x *GetSDKInfoRequest) HasModuleReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleReference != nil\n}\n\nfunc (x *GetSDKInfoRequest) HasPluginReference() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginReference != nil\n}\n\nfunc (x *GetSDKInfoRequest) ClearModuleReference() {\n\tx.xxx_hidden_ModuleReference = nil\n}\n\nfunc (x *GetSDKInfoRequest) ClearPluginReference() {\n\tx.xxx_hidden_PluginReference = nil\n}\n\ntype GetSDKInfoRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The local module reference for the SDK.\n\tModuleReference *LocalModuleReference\n\t// The plugin reference for the SDK.\n\tPluginReference *GetRemotePackageVersionPlugin\n\t// The SDK version string. If this is not provided, then it will be resolved using the module\n\t// and plugin references provided.\n\tSdkVersion string\n}\n\nfunc (b0 GetSDKInfoRequest_builder) Build() *GetSDKInfoRequest {\n\tm0 := &GetSDKInfoRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ModuleReference = b.ModuleReference\n\tx.xxx_hidden_PluginReference = b.PluginReference\n\tx.xxx_hidden_SdkVersion = b.SdkVersion\n\treturn m0\n}\n\ntype GetSDKInfoResponse struct {\n\tstate                 protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_ModuleInfo *GetSDKInfoResponse_ModuleInfo `protobuf:\"bytes,1,opt,name=module_info,json=moduleInfo,proto3\"`\n\txxx_hidden_PluginInfo *GetSDKInfoResponse_PluginInfo `protobuf:\"bytes,2,opt,name=plugin_info,json=pluginInfo,proto3\"`\n\txxx_hidden_SdkVersion string                         `protobuf:\"bytes,3,opt,name=sdk_version,json=sdkVersion,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *GetSDKInfoResponse) Reset() {\n\t*x = GetSDKInfoResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[23]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSDKInfoResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSDKInfoResponse) ProtoMessage() {}\n\nfunc (x *GetSDKInfoResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[23]\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\nfunc (x *GetSDKInfoResponse) GetModuleInfo() *GetSDKInfoResponse_ModuleInfo {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleInfo\n\t}\n\treturn nil\n}\n\nfunc (x *GetSDKInfoResponse) GetPluginInfo() *GetSDKInfoResponse_PluginInfo {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginInfo\n\t}\n\treturn nil\n}\n\nfunc (x *GetSDKInfoResponse) GetSdkVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SdkVersion\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoResponse) SetModuleInfo(v *GetSDKInfoResponse_ModuleInfo) {\n\tx.xxx_hidden_ModuleInfo = v\n}\n\nfunc (x *GetSDKInfoResponse) SetPluginInfo(v *GetSDKInfoResponse_PluginInfo) {\n\tx.xxx_hidden_PluginInfo = v\n}\n\nfunc (x *GetSDKInfoResponse) SetSdkVersion(v string) {\n\tx.xxx_hidden_SdkVersion = v\n}\n\nfunc (x *GetSDKInfoResponse) HasModuleInfo() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleInfo != nil\n}\n\nfunc (x *GetSDKInfoResponse) HasPluginInfo() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_PluginInfo != nil\n}\n\nfunc (x *GetSDKInfoResponse) ClearModuleInfo() {\n\tx.xxx_hidden_ModuleInfo = nil\n}\n\nfunc (x *GetSDKInfoResponse) ClearPluginInfo() {\n\tx.xxx_hidden_PluginInfo = nil\n}\n\ntype GetSDKInfoResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tModuleInfo *GetSDKInfoResponse_ModuleInfo\n\tPluginInfo *GetSDKInfoResponse_PluginInfo\n\t// The SDK version string. The format is based on the SDK registry supported by the\n\t// provided plugin.\n\tSdkVersion string\n}\n\nfunc (b0 GetSDKInfoResponse_builder) Build() *GetSDKInfoResponse {\n\tm0 := &GetSDKInfoResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ModuleInfo = b.ModuleInfo\n\tx.xxx_hidden_PluginInfo = b.PluginInfo\n\tx.xxx_hidden_SdkVersion = b.SdkVersion\n\treturn m0\n}\n\n// ModuleInfo is the parsed module information for the SDK.\ntype GetSDKInfoResponse_ModuleInfo struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner                  string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name                   string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Commit                 string                 `protobuf:\"bytes,3,opt,name=commit,proto3\"`\n\txxx_hidden_ModuleCommitCreateTime *timestamppb.Timestamp `protobuf:\"bytes,4,opt,name=module_commit_create_time,json=moduleCommitCreateTime,proto3\"`\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) Reset() {\n\t*x = GetSDKInfoResponse_ModuleInfo{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[24]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSDKInfoResponse_ModuleInfo) ProtoMessage() {}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[24]\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\nfunc (x *GetSDKInfoResponse_ModuleInfo) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) GetCommit() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) GetModuleCommitCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ModuleCommitCreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) SetCommit(v string) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) SetModuleCommitCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_ModuleCommitCreateTime = v\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) HasModuleCommitCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ModuleCommitCreateTime != nil\n}\n\nfunc (x *GetSDKInfoResponse_ModuleInfo) ClearModuleCommitCreateTime() {\n\tx.xxx_hidden_ModuleCommitCreateTime = nil\n}\n\ntype GetSDKInfoResponse_ModuleInfo_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The module owner name.\n\tOwner string\n\t// The module name.\n\tName string\n\t// The module commit for the SDK.\n\tCommit string\n\t// The module commit create time. This will always be in UTC.\n\tModuleCommitCreateTime *timestamppb.Timestamp\n}\n\nfunc (b0 GetSDKInfoResponse_ModuleInfo_builder) Build() *GetSDKInfoResponse_ModuleInfo {\n\tm0 := &GetSDKInfoResponse_ModuleInfo{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Commit = b.Commit\n\tx.xxx_hidden_ModuleCommitCreateTime = b.ModuleCommitCreateTime\n\treturn m0\n}\n\n// PluginInfo is the parsed plugin information for the SDK.\ntype GetSDKInfoResponse_PluginInfo struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner          string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name           string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Version        string                 `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_PluginRevision uint32                 `protobuf:\"varint,4,opt,name=plugin_revision,json=pluginRevision,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) Reset() {\n\t*x = GetSDKInfoResponse_PluginInfo{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[25]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSDKInfoResponse_PluginInfo) ProtoMessage() {}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[25]\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\nfunc (x *GetSDKInfoResponse_PluginInfo) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) GetPluginRevision() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PluginRevision\n\t}\n\treturn 0\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *GetSDKInfoResponse_PluginInfo) SetPluginRevision(v uint32) {\n\tx.xxx_hidden_PluginRevision = v\n}\n\ntype GetSDKInfoResponse_PluginInfo_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plugin owner.\n\tOwner string\n\t// The plugin name.\n\tName string\n\t// The semver plugin version. This will always be valid semver.\n\tVersion string\n\t// The plugin revision.\n\tPluginRevision uint32\n}\n\nfunc (b0 GetSDKInfoResponse_PluginInfo_builder) Build() *GetSDKInfoResponse_PluginInfo {\n\tm0 := &GetSDKInfoResponse_PluginInfo{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_PluginRevision = b.PluginRevision\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_resolve_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_resolve_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\")buf/alpha/registry/v1alpha1/resolve.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/module/v1alpha1/module.proto\\x1a(buf/alpha/registry/v1alpha1/module.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xc5\\x01\\n\" +\n\t\"\\x14GetModulePinsRequest\\x12W\\n\" +\n\t\"\\x11module_references\\x18\\x01 \\x03(\\v2*.buf.alpha.module.v1alpha1.ModuleReferenceR\\x10moduleReferences\\x12T\\n\" +\n\t\"\\x13current_module_pins\\x18\\x02 \\x03(\\v2$.buf.alpha.module.v1alpha1.ModulePinR\\x11currentModulePins\\\"^\\n\" +\n\t\"\\x15GetModulePinsResponse\\x12E\\n\" +\n\t\"\\vmodule_pins\\x18\\x01 \\x03(\\v2$.buf.alpha.module.v1alpha1.ModulePinR\\n\" +\n\t\"modulePins\\\"\\x86\\x01\\n\" +\n\t\"\\x19GetLocalModulePinsRequest\\x12i\\n\" +\n\t\"\\x17local_module_references\\x18\\x01 \\x03(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x15localModuleReferences\\\"\\xa9\\x02\\n\" +\n\t\"\\x18LocalModuleResolveResult\\x12O\\n\" +\n\t\"\\treference\\x18\\x01 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\treference\\x12=\\n\" +\n\t\"\\x03pin\\x18\\x02 \\x01(\\v2+.buf.alpha.registry.v1alpha1.LocalModulePinR\\x03pin\\x12j\\n\" +\n\t\"\\x17resolved_reference_type\\x18\\x03 \\x01(\\x0e22.buf.alpha.registry.v1alpha1.ResolvedReferenceTypeR\\x15resolvedReferenceTypeJ\\x04\\b\\x04\\x10\\x05R\\vis_bsr_head\\\"\\xde\\x01\\n\" +\n\t\"\\x1aGetLocalModulePinsResponse\\x12v\\n\" +\n\t\"\\x1clocal_module_resolve_results\\x18\\x01 \\x03(\\v25.buf.alpha.registry.v1alpha1.LocalModuleResolveResultR\\x19localModuleResolveResults\\x12H\\n\" +\n\t\"\\fdependencies\\x18\\x02 \\x03(\\v2$.buf.alpha.module.v1alpha1.ModulePinR\\fdependencies\\\"\\xda\\x01\\n\" +\n\t\"\\x13GetGoVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"0\\n\" +\n\t\"\\x14GetGoVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\xdd\\x01\\n\" +\n\t\"\\x16GetMavenVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"3\\n\" +\n\t\"\\x17GetMavenVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\xdb\\x01\\n\" +\n\t\"\\x14GetNPMVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"1\\n\" +\n\t\"\\x15GetNPMVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\xdd\\x01\\n\" +\n\t\"\\x16GetSwiftVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"3\\n\" +\n\t\"\\x17GetSwiftVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\xde\\x01\\n\" +\n\t\"\\x17GetPythonVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"4\\n\" +\n\t\"\\x18GetPythonVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\xdd\\x01\\n\" +\n\t\"\\x16GetCargoVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"3\\n\" +\n\t\"\\x17GetCargoVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\xdd\\x01\\n\" +\n\t\"\\x16GetNugetVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"3\\n\" +\n\t\"\\x17GetNugetVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\xdd\\x01\\n\" +\n\t\"\\x16GetCmakeVersionRequest\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x02 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\\"3\\n\" +\n\t\"\\x17GetCmakeVersionResponse\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x01 \\x01(\\tR\\aversion\\\"\\x7f\\n\" +\n\t\"\\x1dGetRemotePackageVersionPlugin\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12\\x1a\\n\" +\n\t\"\\brevision\\x18\\x04 \\x01(\\rR\\brevision\\\"\\xf9\\x01\\n\" +\n\t\"\\x11GetSDKInfoRequest\\x12\\\\\\n\" +\n\t\"\\x10module_reference\\x18\\x01 \\x01(\\v21.buf.alpha.registry.v1alpha1.LocalModuleReferenceR\\x0fmoduleReference\\x12e\\n\" +\n\t\"\\x10plugin_reference\\x18\\x02 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetRemotePackageVersionPluginR\\x0fpluginReference\\x12\\x1f\\n\" +\n\t\"\\vsdk_version\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"sdkVersion\\\"\\x92\\x04\\n\" +\n\t\"\\x12GetSDKInfoResponse\\x12[\\n\" +\n\t\"\\vmodule_info\\x18\\x01 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetSDKInfoResponse.ModuleInfoR\\n\" +\n\t\"moduleInfo\\x12[\\n\" +\n\t\"\\vplugin_info\\x18\\x02 \\x01(\\v2:.buf.alpha.registry.v1alpha1.GetSDKInfoResponse.PluginInfoR\\n\" +\n\t\"pluginInfo\\x12\\x1f\\n\" +\n\t\"\\vsdk_version\\x18\\x03 \\x01(\\tR\\n\" +\n\t\"sdkVersion\\x1a\\xa5\\x01\\n\" +\n\t\"\\n\" +\n\t\"ModuleInfo\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x16\\n\" +\n\t\"\\x06commit\\x18\\x03 \\x01(\\tR\\x06commit\\x12U\\n\" +\n\t\"\\x19module_commit_create_time\\x18\\x04 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x16moduleCommitCreateTime\\x1ay\\n\" +\n\t\"\\n\" +\n\t\"PluginInfo\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12'\\n\" +\n\t\"\\x0fplugin_revision\\x18\\x04 \\x01(\\rR\\x0epluginRevision*\\xf1\\x01\\n\" +\n\t\"\\x15ResolvedReferenceType\\x12'\\n\" +\n\t\"#RESOLVED_REFERENCE_TYPE_UNSPECIFIED\\x10\\x00\\x12\\\"\\n\" +\n\t\"\\x1eRESOLVED_REFERENCE_TYPE_COMMIT\\x10\\x01\\x12\\\"\\n\" +\n\t\"\\x1eRESOLVED_REFERENCE_TYPE_BRANCH\\x10\\x02\\x12\\x1f\\n\" +\n\t\"\\x1bRESOLVED_REFERENCE_TYPE_TAG\\x10\\x03\\x12!\\n\" +\n\t\"\\x1dRESOLVED_REFERENCE_TYPE_DRAFT\\x10\\x05\\\"\\x04\\b\\x04\\x10\\x04*\\x1dRESOLVED_REFERENCE_TYPE_TRACK2\\x93\\n\" +\n\t\"\\n\" +\n\t\"\\x0eResolveService\\x12{\\n\" +\n\t\"\\rGetModulePins\\x121.buf.alpha.registry.v1alpha1.GetModulePinsRequest\\x1a2.buf.alpha.registry.v1alpha1.GetModulePinsResponse\\\"\\x03\\x90\\x02\\x01\\x12r\\n\" +\n\t\"\\n\" +\n\t\"GetSDKInfo\\x12..buf.alpha.registry.v1alpha1.GetSDKInfoRequest\\x1a/.buf.alpha.registry.v1alpha1.GetSDKInfoResponse\\\"\\x03\\x90\\x02\\x01\\x12x\\n\" +\n\t\"\\fGetGoVersion\\x120.buf.alpha.registry.v1alpha1.GetGoVersionRequest\\x1a1.buf.alpha.registry.v1alpha1.GetGoVersionResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x81\\x01\\n\" +\n\t\"\\x0fGetSwiftVersion\\x123.buf.alpha.registry.v1alpha1.GetSwiftVersionRequest\\x1a4.buf.alpha.registry.v1alpha1.GetSwiftVersionResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x81\\x01\\n\" +\n\t\"\\x0fGetMavenVersion\\x123.buf.alpha.registry.v1alpha1.GetMavenVersionRequest\\x1a4.buf.alpha.registry.v1alpha1.GetMavenVersionResponse\\\"\\x03\\x90\\x02\\x01\\x12{\\n\" +\n\t\"\\rGetNPMVersion\\x121.buf.alpha.registry.v1alpha1.GetNPMVersionRequest\\x1a2.buf.alpha.registry.v1alpha1.GetNPMVersionResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x84\\x01\\n\" +\n\t\"\\x10GetPythonVersion\\x124.buf.alpha.registry.v1alpha1.GetPythonVersionRequest\\x1a5.buf.alpha.registry.v1alpha1.GetPythonVersionResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x81\\x01\\n\" +\n\t\"\\x0fGetCargoVersion\\x123.buf.alpha.registry.v1alpha1.GetCargoVersionRequest\\x1a4.buf.alpha.registry.v1alpha1.GetCargoVersionResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x81\\x01\\n\" +\n\t\"\\x0fGetNugetVersion\\x123.buf.alpha.registry.v1alpha1.GetNugetVersionRequest\\x1a4.buf.alpha.registry.v1alpha1.GetNugetVersionResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x81\\x01\\n\" +\n\t\"\\x0fGetCmakeVersion\\x123.buf.alpha.registry.v1alpha1.GetCmakeVersionRequest\\x1a4.buf.alpha.registry.v1alpha1.GetCmakeVersionResponse\\\"\\x03\\x90\\x02\\x012\\xa2\\x01\\n\" +\n\t\"\\x13LocalResolveService\\x12\\x8a\\x01\\n\" +\n\t\"\\x12GetLocalModulePins\\x126.buf.alpha.registry.v1alpha1.GetLocalModulePinsRequest\\x1a7.buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse\\\"\\x03\\x90\\x02\\x01B\\x99\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\fResolveProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes = make([]protoimpl.MessageInfo, 26)\nvar file_buf_alpha_registry_v1alpha1_resolve_proto_goTypes = []any{\n\t(ResolvedReferenceType)(0),            // 0: buf.alpha.registry.v1alpha1.ResolvedReferenceType\n\t(*GetModulePinsRequest)(nil),          // 1: buf.alpha.registry.v1alpha1.GetModulePinsRequest\n\t(*GetModulePinsResponse)(nil),         // 2: buf.alpha.registry.v1alpha1.GetModulePinsResponse\n\t(*GetLocalModulePinsRequest)(nil),     // 3: buf.alpha.registry.v1alpha1.GetLocalModulePinsRequest\n\t(*LocalModuleResolveResult)(nil),      // 4: buf.alpha.registry.v1alpha1.LocalModuleResolveResult\n\t(*GetLocalModulePinsResponse)(nil),    // 5: buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse\n\t(*GetGoVersionRequest)(nil),           // 6: buf.alpha.registry.v1alpha1.GetGoVersionRequest\n\t(*GetGoVersionResponse)(nil),          // 7: buf.alpha.registry.v1alpha1.GetGoVersionResponse\n\t(*GetMavenVersionRequest)(nil),        // 8: buf.alpha.registry.v1alpha1.GetMavenVersionRequest\n\t(*GetMavenVersionResponse)(nil),       // 9: buf.alpha.registry.v1alpha1.GetMavenVersionResponse\n\t(*GetNPMVersionRequest)(nil),          // 10: buf.alpha.registry.v1alpha1.GetNPMVersionRequest\n\t(*GetNPMVersionResponse)(nil),         // 11: buf.alpha.registry.v1alpha1.GetNPMVersionResponse\n\t(*GetSwiftVersionRequest)(nil),        // 12: buf.alpha.registry.v1alpha1.GetSwiftVersionRequest\n\t(*GetSwiftVersionResponse)(nil),       // 13: buf.alpha.registry.v1alpha1.GetSwiftVersionResponse\n\t(*GetPythonVersionRequest)(nil),       // 14: buf.alpha.registry.v1alpha1.GetPythonVersionRequest\n\t(*GetPythonVersionResponse)(nil),      // 15: buf.alpha.registry.v1alpha1.GetPythonVersionResponse\n\t(*GetCargoVersionRequest)(nil),        // 16: buf.alpha.registry.v1alpha1.GetCargoVersionRequest\n\t(*GetCargoVersionResponse)(nil),       // 17: buf.alpha.registry.v1alpha1.GetCargoVersionResponse\n\t(*GetNugetVersionRequest)(nil),        // 18: buf.alpha.registry.v1alpha1.GetNugetVersionRequest\n\t(*GetNugetVersionResponse)(nil),       // 19: buf.alpha.registry.v1alpha1.GetNugetVersionResponse\n\t(*GetCmakeVersionRequest)(nil),        // 20: buf.alpha.registry.v1alpha1.GetCmakeVersionRequest\n\t(*GetCmakeVersionResponse)(nil),       // 21: buf.alpha.registry.v1alpha1.GetCmakeVersionResponse\n\t(*GetRemotePackageVersionPlugin)(nil), // 22: buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t(*GetSDKInfoRequest)(nil),             // 23: buf.alpha.registry.v1alpha1.GetSDKInfoRequest\n\t(*GetSDKInfoResponse)(nil),            // 24: buf.alpha.registry.v1alpha1.GetSDKInfoResponse\n\t(*GetSDKInfoResponse_ModuleInfo)(nil), // 25: buf.alpha.registry.v1alpha1.GetSDKInfoResponse.ModuleInfo\n\t(*GetSDKInfoResponse_PluginInfo)(nil), // 26: buf.alpha.registry.v1alpha1.GetSDKInfoResponse.PluginInfo\n\t(*v1alpha1.ModuleReference)(nil),      // 27: buf.alpha.module.v1alpha1.ModuleReference\n\t(*v1alpha1.ModulePin)(nil),            // 28: buf.alpha.module.v1alpha1.ModulePin\n\t(*LocalModuleReference)(nil),          // 29: buf.alpha.registry.v1alpha1.LocalModuleReference\n\t(*LocalModulePin)(nil),                // 30: buf.alpha.registry.v1alpha1.LocalModulePin\n\t(*timestamppb.Timestamp)(nil),         // 31: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_resolve_proto_depIdxs = []int32{\n\t27, // 0: buf.alpha.registry.v1alpha1.GetModulePinsRequest.module_references:type_name -> buf.alpha.module.v1alpha1.ModuleReference\n\t28, // 1: buf.alpha.registry.v1alpha1.GetModulePinsRequest.current_module_pins:type_name -> buf.alpha.module.v1alpha1.ModulePin\n\t28, // 2: buf.alpha.registry.v1alpha1.GetModulePinsResponse.module_pins:type_name -> buf.alpha.module.v1alpha1.ModulePin\n\t29, // 3: buf.alpha.registry.v1alpha1.GetLocalModulePinsRequest.local_module_references:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t29, // 4: buf.alpha.registry.v1alpha1.LocalModuleResolveResult.reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t30, // 5: buf.alpha.registry.v1alpha1.LocalModuleResolveResult.pin:type_name -> buf.alpha.registry.v1alpha1.LocalModulePin\n\t0,  // 6: buf.alpha.registry.v1alpha1.LocalModuleResolveResult.resolved_reference_type:type_name -> buf.alpha.registry.v1alpha1.ResolvedReferenceType\n\t4,  // 7: buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse.local_module_resolve_results:type_name -> buf.alpha.registry.v1alpha1.LocalModuleResolveResult\n\t28, // 8: buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse.dependencies:type_name -> buf.alpha.module.v1alpha1.ModulePin\n\t22, // 9: buf.alpha.registry.v1alpha1.GetGoVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 10: buf.alpha.registry.v1alpha1.GetGoVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 11: buf.alpha.registry.v1alpha1.GetMavenVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 12: buf.alpha.registry.v1alpha1.GetMavenVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 13: buf.alpha.registry.v1alpha1.GetNPMVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 14: buf.alpha.registry.v1alpha1.GetNPMVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 15: buf.alpha.registry.v1alpha1.GetSwiftVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 16: buf.alpha.registry.v1alpha1.GetSwiftVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 17: buf.alpha.registry.v1alpha1.GetPythonVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 18: buf.alpha.registry.v1alpha1.GetPythonVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 19: buf.alpha.registry.v1alpha1.GetCargoVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 20: buf.alpha.registry.v1alpha1.GetCargoVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 21: buf.alpha.registry.v1alpha1.GetNugetVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 22: buf.alpha.registry.v1alpha1.GetNugetVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 23: buf.alpha.registry.v1alpha1.GetCmakeVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t29, // 24: buf.alpha.registry.v1alpha1.GetCmakeVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t29, // 25: buf.alpha.registry.v1alpha1.GetSDKInfoRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference\n\t22, // 26: buf.alpha.registry.v1alpha1.GetSDKInfoRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin\n\t25, // 27: buf.alpha.registry.v1alpha1.GetSDKInfoResponse.module_info:type_name -> buf.alpha.registry.v1alpha1.GetSDKInfoResponse.ModuleInfo\n\t26, // 28: buf.alpha.registry.v1alpha1.GetSDKInfoResponse.plugin_info:type_name -> buf.alpha.registry.v1alpha1.GetSDKInfoResponse.PluginInfo\n\t31, // 29: buf.alpha.registry.v1alpha1.GetSDKInfoResponse.ModuleInfo.module_commit_create_time:type_name -> google.protobuf.Timestamp\n\t1,  // 30: buf.alpha.registry.v1alpha1.ResolveService.GetModulePins:input_type -> buf.alpha.registry.v1alpha1.GetModulePinsRequest\n\t23, // 31: buf.alpha.registry.v1alpha1.ResolveService.GetSDKInfo:input_type -> buf.alpha.registry.v1alpha1.GetSDKInfoRequest\n\t6,  // 32: buf.alpha.registry.v1alpha1.ResolveService.GetGoVersion:input_type -> buf.alpha.registry.v1alpha1.GetGoVersionRequest\n\t12, // 33: buf.alpha.registry.v1alpha1.ResolveService.GetSwiftVersion:input_type -> buf.alpha.registry.v1alpha1.GetSwiftVersionRequest\n\t8,  // 34: buf.alpha.registry.v1alpha1.ResolveService.GetMavenVersion:input_type -> buf.alpha.registry.v1alpha1.GetMavenVersionRequest\n\t10, // 35: buf.alpha.registry.v1alpha1.ResolveService.GetNPMVersion:input_type -> buf.alpha.registry.v1alpha1.GetNPMVersionRequest\n\t14, // 36: buf.alpha.registry.v1alpha1.ResolveService.GetPythonVersion:input_type -> buf.alpha.registry.v1alpha1.GetPythonVersionRequest\n\t16, // 37: buf.alpha.registry.v1alpha1.ResolveService.GetCargoVersion:input_type -> buf.alpha.registry.v1alpha1.GetCargoVersionRequest\n\t18, // 38: buf.alpha.registry.v1alpha1.ResolveService.GetNugetVersion:input_type -> buf.alpha.registry.v1alpha1.GetNugetVersionRequest\n\t20, // 39: buf.alpha.registry.v1alpha1.ResolveService.GetCmakeVersion:input_type -> buf.alpha.registry.v1alpha1.GetCmakeVersionRequest\n\t3,  // 40: buf.alpha.registry.v1alpha1.LocalResolveService.GetLocalModulePins:input_type -> buf.alpha.registry.v1alpha1.GetLocalModulePinsRequest\n\t2,  // 41: buf.alpha.registry.v1alpha1.ResolveService.GetModulePins:output_type -> buf.alpha.registry.v1alpha1.GetModulePinsResponse\n\t24, // 42: buf.alpha.registry.v1alpha1.ResolveService.GetSDKInfo:output_type -> buf.alpha.registry.v1alpha1.GetSDKInfoResponse\n\t7,  // 43: buf.alpha.registry.v1alpha1.ResolveService.GetGoVersion:output_type -> buf.alpha.registry.v1alpha1.GetGoVersionResponse\n\t13, // 44: buf.alpha.registry.v1alpha1.ResolveService.GetSwiftVersion:output_type -> buf.alpha.registry.v1alpha1.GetSwiftVersionResponse\n\t9,  // 45: buf.alpha.registry.v1alpha1.ResolveService.GetMavenVersion:output_type -> buf.alpha.registry.v1alpha1.GetMavenVersionResponse\n\t11, // 46: buf.alpha.registry.v1alpha1.ResolveService.GetNPMVersion:output_type -> buf.alpha.registry.v1alpha1.GetNPMVersionResponse\n\t15, // 47: buf.alpha.registry.v1alpha1.ResolveService.GetPythonVersion:output_type -> buf.alpha.registry.v1alpha1.GetPythonVersionResponse\n\t17, // 48: buf.alpha.registry.v1alpha1.ResolveService.GetCargoVersion:output_type -> buf.alpha.registry.v1alpha1.GetCargoVersionResponse\n\t19, // 49: buf.alpha.registry.v1alpha1.ResolveService.GetNugetVersion:output_type -> buf.alpha.registry.v1alpha1.GetNugetVersionResponse\n\t21, // 50: buf.alpha.registry.v1alpha1.ResolveService.GetCmakeVersion:output_type -> buf.alpha.registry.v1alpha1.GetCmakeVersionResponse\n\t5,  // 51: buf.alpha.registry.v1alpha1.LocalResolveService.GetLocalModulePins:output_type -> buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse\n\t41, // [41:52] is the sub-list for method output_type\n\t30, // [30:41] 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_buf_alpha_registry_v1alpha1_resolve_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_resolve_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_resolve_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_module_proto_init()\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_buf_alpha_registry_v1alpha1_resolve_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_resolve_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   26,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   2,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_resolve_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_resolve_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_resolve_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_resolve_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_resolve_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/resource.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/resource.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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 Resource struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Resource isResource_Resource    `protobuf_oneof:\"resource\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *Resource) Reset() {\n\t*x = Resource{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Resource) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Resource) ProtoMessage() {}\n\nfunc (x *Resource) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resource_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\nfunc (x *Resource) GetRepository() *Repository {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Resource.(*resource_Repository); ok {\n\t\t\treturn x.Repository\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Resource) GetPlugin() *CuratedPlugin {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Resource.(*resource_Plugin); ok {\n\t\t\treturn x.Plugin\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *Resource) SetRepository(v *Repository) {\n\tif v == nil {\n\t\tx.xxx_hidden_Resource = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Resource = &resource_Repository{v}\n}\n\nfunc (x *Resource) SetPlugin(v *CuratedPlugin) {\n\tif v == nil {\n\t\tx.xxx_hidden_Resource = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Resource = &resource_Plugin{v}\n}\n\nfunc (x *Resource) HasResource() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Resource != nil\n}\n\nfunc (x *Resource) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Resource.(*resource_Repository)\n\treturn ok\n}\n\nfunc (x *Resource) HasPlugin() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Resource.(*resource_Plugin)\n\treturn ok\n}\n\nfunc (x *Resource) ClearResource() {\n\tx.xxx_hidden_Resource = nil\n}\n\nfunc (x *Resource) ClearRepository() {\n\tif _, ok := x.xxx_hidden_Resource.(*resource_Repository); ok {\n\t\tx.xxx_hidden_Resource = nil\n\t}\n}\n\nfunc (x *Resource) ClearPlugin() {\n\tif _, ok := x.xxx_hidden_Resource.(*resource_Plugin); ok {\n\t\tx.xxx_hidden_Resource = nil\n\t}\n}\n\nconst Resource_Resource_not_set_case case_Resource_Resource = 0\nconst Resource_Repository_case case_Resource_Resource = 1\nconst Resource_Plugin_case case_Resource_Resource = 2\n\nfunc (x *Resource) WhichResource() case_Resource_Resource {\n\tif x == nil {\n\t\treturn Resource_Resource_not_set_case\n\t}\n\tswitch x.xxx_hidden_Resource.(type) {\n\tcase *resource_Repository:\n\t\treturn Resource_Repository_case\n\tcase *resource_Plugin:\n\t\treturn Resource_Plugin_case\n\tdefault:\n\t\treturn Resource_Resource_not_set_case\n\t}\n}\n\ntype Resource_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Resource:\n\tRepository *Repository\n\tPlugin     *CuratedPlugin\n\t// -- end of xxx_hidden_Resource\n}\n\nfunc (b0 Resource_builder) Build() *Resource {\n\tm0 := &Resource{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Repository != nil {\n\t\tx.xxx_hidden_Resource = &resource_Repository{b.Repository}\n\t}\n\tif b.Plugin != nil {\n\t\tx.xxx_hidden_Resource = &resource_Plugin{b.Plugin}\n\t}\n\treturn m0\n}\n\ntype case_Resource_Resource protoreflect.FieldNumber\n\nfunc (x case_Resource_Resource) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[0].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isResource_Resource interface {\n\tisResource_Resource()\n}\n\ntype resource_Repository struct {\n\tRepository *Repository `protobuf:\"bytes,1,opt,name=repository,proto3,oneof\"`\n}\n\ntype resource_Plugin struct {\n\tPlugin *CuratedPlugin `protobuf:\"bytes,2,opt,name=plugin,proto3,oneof\"`\n}\n\nfunc (*resource_Repository) isResource_Resource() {}\n\nfunc (*resource_Plugin) isResource_Resource() {}\n\ntype GetResourceByNameRequest struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Name  string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *GetResourceByNameRequest) Reset() {\n\t*x = GetResourceByNameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetResourceByNameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetResourceByNameRequest) ProtoMessage() {}\n\nfunc (x *GetResourceByNameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resource_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\nfunc (x *GetResourceByNameRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetResourceByNameRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetResourceByNameRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetResourceByNameRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype GetResourceByNameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Owner of the requested resource.\n\tOwner string\n\t// Name of the requested resource.\n\tName string\n}\n\nfunc (b0 GetResourceByNameRequest_builder) Build() *GetResourceByNameRequest {\n\tm0 := &GetResourceByNameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\ntype GetResourceByNameResponse struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Resource *Resource              `protobuf:\"bytes,1,opt,name=resource,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *GetResourceByNameResponse) Reset() {\n\t*x = GetResourceByNameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetResourceByNameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetResourceByNameResponse) ProtoMessage() {}\n\nfunc (x *GetResourceByNameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_resource_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\nfunc (x *GetResourceByNameResponse) GetResource() *Resource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Resource\n\t}\n\treturn nil\n}\n\nfunc (x *GetResourceByNameResponse) SetResource(v *Resource) {\n\tx.xxx_hidden_Resource = v\n}\n\nfunc (x *GetResourceByNameResponse) HasResource() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Resource != nil\n}\n\nfunc (x *GetResourceByNameResponse) ClearResource() {\n\tx.xxx_hidden_Resource = nil\n}\n\ntype GetResourceByNameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tResource *Resource\n}\n\nfunc (b0 GetResourceByNameResponse_builder) Build() *GetResourceByNameResponse {\n\tm0 := &GetResourceByNameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Resource = b.Resource\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_resource_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_resource_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"*buf/alpha/registry/v1alpha1/resource.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a1buf/alpha/registry/v1alpha1/plugin_curation.proto\\x1a,buf/alpha/registry/v1alpha1/repository.proto\\\"\\xa7\\x01\\n\" +\n\t\"\\bResource\\x12I\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x01 \\x01(\\v2'.buf.alpha.registry.v1alpha1.RepositoryH\\x00R\\n\" +\n\t\"repository\\x12D\\n\" +\n\t\"\\x06plugin\\x18\\x02 \\x01(\\v2*.buf.alpha.registry.v1alpha1.CuratedPluginH\\x00R\\x06pluginB\\n\" +\n\t\"\\n\" +\n\t\"\\bresource\\\"D\\n\" +\n\t\"\\x18GetResourceByNameRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\\"^\\n\" +\n\t\"\\x19GetResourceByNameResponse\\x12A\\n\" +\n\t\"\\bresource\\x18\\x01 \\x01(\\v2%.buf.alpha.registry.v1alpha1.ResourceR\\bresource2\\x9b\\x01\\n\" +\n\t\"\\x0fResourceService\\x12\\x87\\x01\\n\" +\n\t\"\\x11GetResourceByName\\x125.buf.alpha.registry.v1alpha1.GetResourceByNameRequest\\x1a6.buf.alpha.registry.v1alpha1.GetResourceByNameResponse\\\"\\x03\\x90\\x02\\x01B\\x9a\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\rResourceProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 3)\nvar file_buf_alpha_registry_v1alpha1_resource_proto_goTypes = []any{\n\t(*Resource)(nil),                  // 0: buf.alpha.registry.v1alpha1.Resource\n\t(*GetResourceByNameRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.GetResourceByNameRequest\n\t(*GetResourceByNameResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetResourceByNameResponse\n\t(*Repository)(nil),                // 3: buf.alpha.registry.v1alpha1.Repository\n\t(*CuratedPlugin)(nil),             // 4: buf.alpha.registry.v1alpha1.CuratedPlugin\n}\nvar file_buf_alpha_registry_v1alpha1_resource_proto_depIdxs = []int32{\n\t3, // 0: buf.alpha.registry.v1alpha1.Resource.repository:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t4, // 1: buf.alpha.registry.v1alpha1.Resource.plugin:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin\n\t0, // 2: buf.alpha.registry.v1alpha1.GetResourceByNameResponse.resource:type_name -> buf.alpha.registry.v1alpha1.Resource\n\t1, // 3: buf.alpha.registry.v1alpha1.ResourceService.GetResourceByName:input_type -> buf.alpha.registry.v1alpha1.GetResourceByNameRequest\n\t2, // 4: buf.alpha.registry.v1alpha1.ResourceService.GetResourceByName:output_type -> buf.alpha.registry.v1alpha1.GetResourceByNameResponse\n\t4, // [4:5] is the sub-list for method output_type\n\t3, // [3:4] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_resource_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_resource_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_resource_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_plugin_curation_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[0].OneofWrappers = []any{\n\t\t(*resource_Repository)(nil),\n\t\t(*resource_Plugin)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_resource_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_resource_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   3,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_resource_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_resource_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_resource_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_resource_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_resource_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/role.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/role.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// The roles that users can have in a Server.\ntype ServerRole int32\n\nconst (\n\tServerRole_SERVER_ROLE_UNSPECIFIED ServerRole = 0\n\tServerRole_SERVER_ROLE_ADMIN       ServerRole = 1\n\tServerRole_SERVER_ROLE_MEMBER      ServerRole = 2\n)\n\n// Enum value maps for ServerRole.\nvar (\n\tServerRole_name = map[int32]string{\n\t\t0: \"SERVER_ROLE_UNSPECIFIED\",\n\t\t1: \"SERVER_ROLE_ADMIN\",\n\t\t2: \"SERVER_ROLE_MEMBER\",\n\t}\n\tServerRole_value = map[string]int32{\n\t\t\"SERVER_ROLE_UNSPECIFIED\": 0,\n\t\t\"SERVER_ROLE_ADMIN\":       1,\n\t\t\"SERVER_ROLE_MEMBER\":      2,\n\t}\n)\n\nfunc (x ServerRole) Enum() *ServerRole {\n\tp := new(ServerRole)\n\t*p = x\n\treturn p\n}\n\nfunc (x ServerRole) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (ServerRole) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[0].Descriptor()\n}\n\nfunc (ServerRole) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[0]\n}\n\nfunc (x ServerRole) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// The roles that users can have in a Organization.\ntype OrganizationRole int32\n\nconst (\n\tOrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED OrganizationRole = 0\n\tOrganizationRole_ORGANIZATION_ROLE_OWNER       OrganizationRole = 1\n\tOrganizationRole_ORGANIZATION_ROLE_ADMIN       OrganizationRole = 2\n\tOrganizationRole_ORGANIZATION_ROLE_MEMBER      OrganizationRole = 3\n\tOrganizationRole_ORGANIZATION_ROLE_MACHINE     OrganizationRole = 4\n)\n\n// Enum value maps for OrganizationRole.\nvar (\n\tOrganizationRole_name = map[int32]string{\n\t\t0: \"ORGANIZATION_ROLE_UNSPECIFIED\",\n\t\t1: \"ORGANIZATION_ROLE_OWNER\",\n\t\t2: \"ORGANIZATION_ROLE_ADMIN\",\n\t\t3: \"ORGANIZATION_ROLE_MEMBER\",\n\t\t4: \"ORGANIZATION_ROLE_MACHINE\",\n\t}\n\tOrganizationRole_value = map[string]int32{\n\t\t\"ORGANIZATION_ROLE_UNSPECIFIED\": 0,\n\t\t\"ORGANIZATION_ROLE_OWNER\":       1,\n\t\t\"ORGANIZATION_ROLE_ADMIN\":       2,\n\t\t\"ORGANIZATION_ROLE_MEMBER\":      3,\n\t\t\"ORGANIZATION_ROLE_MACHINE\":     4,\n\t}\n)\n\nfunc (x OrganizationRole) Enum() *OrganizationRole {\n\tp := new(OrganizationRole)\n\t*p = x\n\treturn p\n}\n\nfunc (x OrganizationRole) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (OrganizationRole) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[1].Descriptor()\n}\n\nfunc (OrganizationRole) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[1]\n}\n\nfunc (x OrganizationRole) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// The source of a user's role in an Organization.\ntype OrganizationRoleSource int32\n\nconst (\n\tOrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_UNSPECIFIED OrganizationRoleSource = 0\n\tOrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_DIRECT      OrganizationRoleSource = 1\n\tOrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_JIT         OrganizationRoleSource = 2\n\tOrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_IDP_GROUP   OrganizationRoleSource = 3\n)\n\n// Enum value maps for OrganizationRoleSource.\nvar (\n\tOrganizationRoleSource_name = map[int32]string{\n\t\t0: \"ORGANIZATION_ROLE_SOURCE_UNSPECIFIED\",\n\t\t1: \"ORGANIZATION_ROLE_SOURCE_DIRECT\",\n\t\t2: \"ORGANIZATION_ROLE_SOURCE_JIT\",\n\t\t3: \"ORGANIZATION_ROLE_SOURCE_IDP_GROUP\",\n\t}\n\tOrganizationRoleSource_value = map[string]int32{\n\t\t\"ORGANIZATION_ROLE_SOURCE_UNSPECIFIED\": 0,\n\t\t\"ORGANIZATION_ROLE_SOURCE_DIRECT\":      1,\n\t\t\"ORGANIZATION_ROLE_SOURCE_JIT\":         2,\n\t\t\"ORGANIZATION_ROLE_SOURCE_IDP_GROUP\":   3,\n\t}\n)\n\nfunc (x OrganizationRoleSource) Enum() *OrganizationRoleSource {\n\tp := new(OrganizationRoleSource)\n\t*p = x\n\treturn p\n}\n\nfunc (x OrganizationRoleSource) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (OrganizationRoleSource) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[2].Descriptor()\n}\n\nfunc (OrganizationRoleSource) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[2]\n}\n\nfunc (x OrganizationRoleSource) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// The roles that users can have for a Repository.\ntype RepositoryRole int32\n\nconst (\n\tRepositoryRole_REPOSITORY_ROLE_UNSPECIFIED   RepositoryRole = 0\n\tRepositoryRole_REPOSITORY_ROLE_OWNER         RepositoryRole = 1\n\tRepositoryRole_REPOSITORY_ROLE_ADMIN         RepositoryRole = 2\n\tRepositoryRole_REPOSITORY_ROLE_WRITE         RepositoryRole = 3\n\tRepositoryRole_REPOSITORY_ROLE_READ          RepositoryRole = 4\n\tRepositoryRole_REPOSITORY_ROLE_LIMITED_WRITE RepositoryRole = 5\n)\n\n// Enum value maps for RepositoryRole.\nvar (\n\tRepositoryRole_name = map[int32]string{\n\t\t0: \"REPOSITORY_ROLE_UNSPECIFIED\",\n\t\t1: \"REPOSITORY_ROLE_OWNER\",\n\t\t2: \"REPOSITORY_ROLE_ADMIN\",\n\t\t3: \"REPOSITORY_ROLE_WRITE\",\n\t\t4: \"REPOSITORY_ROLE_READ\",\n\t\t5: \"REPOSITORY_ROLE_LIMITED_WRITE\",\n\t}\n\tRepositoryRole_value = map[string]int32{\n\t\t\"REPOSITORY_ROLE_UNSPECIFIED\":   0,\n\t\t\"REPOSITORY_ROLE_OWNER\":         1,\n\t\t\"REPOSITORY_ROLE_ADMIN\":         2,\n\t\t\"REPOSITORY_ROLE_WRITE\":         3,\n\t\t\"REPOSITORY_ROLE_READ\":          4,\n\t\t\"REPOSITORY_ROLE_LIMITED_WRITE\": 5,\n\t}\n)\n\nfunc (x RepositoryRole) Enum() *RepositoryRole {\n\tp := new(RepositoryRole)\n\t*p = x\n\treturn p\n}\n\nfunc (x RepositoryRole) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (RepositoryRole) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[3].Descriptor()\n}\n\nfunc (RepositoryRole) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[3]\n}\n\nfunc (x RepositoryRole) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// The source of a user's role in a Repository.\ntype RepositoryRoleSource int32\n\nconst (\n\tRepositoryRoleSource_REPOSITORY_ROLE_SOURCE_UNSPECIFIED RepositoryRoleSource = 0\n\tRepositoryRoleSource_REPOSITORY_ROLE_SOURCE_DIRECT      RepositoryRoleSource = 1\n\tRepositoryRoleSource_REPOSITORY_ROLE_SOURCE_IDP_GROUP   RepositoryRoleSource = 2\n)\n\n// Enum value maps for RepositoryRoleSource.\nvar (\n\tRepositoryRoleSource_name = map[int32]string{\n\t\t0: \"REPOSITORY_ROLE_SOURCE_UNSPECIFIED\",\n\t\t1: \"REPOSITORY_ROLE_SOURCE_DIRECT\",\n\t\t2: \"REPOSITORY_ROLE_SOURCE_IDP_GROUP\",\n\t}\n\tRepositoryRoleSource_value = map[string]int32{\n\t\t\"REPOSITORY_ROLE_SOURCE_UNSPECIFIED\": 0,\n\t\t\"REPOSITORY_ROLE_SOURCE_DIRECT\":      1,\n\t\t\"REPOSITORY_ROLE_SOURCE_IDP_GROUP\":   2,\n\t}\n)\n\nfunc (x RepositoryRoleSource) Enum() *RepositoryRoleSource {\n\tp := new(RepositoryRoleSource)\n\t*p = x\n\treturn p\n}\n\nfunc (x RepositoryRoleSource) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (RepositoryRoleSource) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[4].Descriptor()\n}\n\nfunc (RepositoryRoleSource) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[4]\n}\n\nfunc (x RepositoryRoleSource) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\nvar File_buf_alpha_registry_v1alpha1_role_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_role_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"&buf/alpha/registry/v1alpha1/role.proto\\x12\\x1bbuf.alpha.registry.v1alpha1*X\\n\" +\n\t\"\\n\" +\n\t\"ServerRole\\x12\\x1b\\n\" +\n\t\"\\x17SERVER_ROLE_UNSPECIFIED\\x10\\x00\\x12\\x15\\n\" +\n\t\"\\x11SERVER_ROLE_ADMIN\\x10\\x01\\x12\\x16\\n\" +\n\t\"\\x12SERVER_ROLE_MEMBER\\x10\\x02*\\xac\\x01\\n\" +\n\t\"\\x10OrganizationRole\\x12!\\n\" +\n\t\"\\x1dORGANIZATION_ROLE_UNSPECIFIED\\x10\\x00\\x12\\x1b\\n\" +\n\t\"\\x17ORGANIZATION_ROLE_OWNER\\x10\\x01\\x12\\x1b\\n\" +\n\t\"\\x17ORGANIZATION_ROLE_ADMIN\\x10\\x02\\x12\\x1c\\n\" +\n\t\"\\x18ORGANIZATION_ROLE_MEMBER\\x10\\x03\\x12\\x1d\\n\" +\n\t\"\\x19ORGANIZATION_ROLE_MACHINE\\x10\\x04*\\xb1\\x01\\n\" +\n\t\"\\x16OrganizationRoleSource\\x12(\\n\" +\n\t\"$ORGANIZATION_ROLE_SOURCE_UNSPECIFIED\\x10\\x00\\x12#\\n\" +\n\t\"\\x1fORGANIZATION_ROLE_SOURCE_DIRECT\\x10\\x01\\x12 \\n\" +\n\t\"\\x1cORGANIZATION_ROLE_SOURCE_JIT\\x10\\x02\\x12&\\n\" +\n\t\"\\\"ORGANIZATION_ROLE_SOURCE_IDP_GROUP\\x10\\x03*\\xbf\\x01\\n\" +\n\t\"\\x0eRepositoryRole\\x12\\x1f\\n\" +\n\t\"\\x1bREPOSITORY_ROLE_UNSPECIFIED\\x10\\x00\\x12\\x19\\n\" +\n\t\"\\x15REPOSITORY_ROLE_OWNER\\x10\\x01\\x12\\x19\\n\" +\n\t\"\\x15REPOSITORY_ROLE_ADMIN\\x10\\x02\\x12\\x19\\n\" +\n\t\"\\x15REPOSITORY_ROLE_WRITE\\x10\\x03\\x12\\x18\\n\" +\n\t\"\\x14REPOSITORY_ROLE_READ\\x10\\x04\\x12!\\n\" +\n\t\"\\x1dREPOSITORY_ROLE_LIMITED_WRITE\\x10\\x05*\\x87\\x01\\n\" +\n\t\"\\x14RepositoryRoleSource\\x12&\\n\" +\n\t\"\\\"REPOSITORY_ROLE_SOURCE_UNSPECIFIED\\x10\\x00\\x12!\\n\" +\n\t\"\\x1dREPOSITORY_ROLE_SOURCE_DIRECT\\x10\\x01\\x12$\\n\" +\n\t\" REPOSITORY_ROLE_SOURCE_IDP_GROUP\\x10\\x02B\\x96\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\tRoleProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_role_proto_enumTypes = make([]protoimpl.EnumInfo, 5)\nvar file_buf_alpha_registry_v1alpha1_role_proto_goTypes = []any{\n\t(ServerRole)(0),             // 0: buf.alpha.registry.v1alpha1.ServerRole\n\t(OrganizationRole)(0),       // 1: buf.alpha.registry.v1alpha1.OrganizationRole\n\t(OrganizationRoleSource)(0), // 2: buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t(RepositoryRole)(0),         // 3: buf.alpha.registry.v1alpha1.RepositoryRole\n\t(RepositoryRoleSource)(0),   // 4: buf.alpha.registry.v1alpha1.RepositoryRoleSource\n}\nvar file_buf_alpha_registry_v1alpha1_role_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_role_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_role_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_role_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_buf_alpha_registry_v1alpha1_role_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_role_proto_rawDesc)),\n\t\t\tNumEnums:      5,\n\t\t\tNumMessages:   0,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_role_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_role_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_role_proto_enumTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_role_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_role_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_role_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/schema.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/schema.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdescriptorpb \"google.golang.org/protobuf/types/descriptorpb\"\n\treflect \"reflect\"\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 Format int32\n\nconst (\n\tFormat_FORMAT_UNSPECIFIED Format = 0\n\tFormat_FORMAT_BINARY      Format = 1\n\tFormat_FORMAT_JSON        Format = 2\n\tFormat_FORMAT_TEXT        Format = 3\n)\n\n// Enum value maps for Format.\nvar (\n\tFormat_name = map[int32]string{\n\t\t0: \"FORMAT_UNSPECIFIED\",\n\t\t1: \"FORMAT_BINARY\",\n\t\t2: \"FORMAT_JSON\",\n\t\t3: \"FORMAT_TEXT\",\n\t}\n\tFormat_value = map[string]int32{\n\t\t\"FORMAT_UNSPECIFIED\": 0,\n\t\t\"FORMAT_BINARY\":      1,\n\t\t\"FORMAT_JSON\":        2,\n\t\t\"FORMAT_TEXT\":        3,\n\t}\n)\n\nfunc (x Format) Enum() *Format {\n\tp := new(Format)\n\t*p = x\n\treturn p\n}\n\nfunc (x Format) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (Format) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes[0].Descriptor()\n}\n\nfunc (Format) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes[0]\n}\n\nfunc (x Format) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype GetSchemaRequest struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner                  string                 `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository             string                 `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Version                string                 `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_Types                  []string               `protobuf:\"bytes,4,rep,name=types,proto3\"`\n\txxx_hidden_IfNotCommit            string                 `protobuf:\"bytes,5,opt,name=if_not_commit,json=ifNotCommit,proto3\"`\n\txxx_hidden_ExcludeCustomOptions   bool                   `protobuf:\"varint,6,opt,name=exclude_custom_options,json=excludeCustomOptions,proto3\"`\n\txxx_hidden_ExcludeKnownExtensions bool                   `protobuf:\"varint,7,opt,name=exclude_known_extensions,json=excludeKnownExtensions,proto3\"`\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *GetSchemaRequest) Reset() {\n\t*x = GetSchemaRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSchemaRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSchemaRequest) ProtoMessage() {}\n\nfunc (x *GetSchemaRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_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\nfunc (x *GetSchemaRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSchemaRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSchemaRequest) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSchemaRequest) GetTypes() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Types\n\t}\n\treturn nil\n}\n\nfunc (x *GetSchemaRequest) GetIfNotCommit() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IfNotCommit\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSchemaRequest) GetExcludeCustomOptions() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExcludeCustomOptions\n\t}\n\treturn false\n}\n\nfunc (x *GetSchemaRequest) GetExcludeKnownExtensions() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExcludeKnownExtensions\n\t}\n\treturn false\n}\n\nfunc (x *GetSchemaRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *GetSchemaRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *GetSchemaRequest) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *GetSchemaRequest) SetTypes(v []string) {\n\tx.xxx_hidden_Types = v\n}\n\nfunc (x *GetSchemaRequest) SetIfNotCommit(v string) {\n\tx.xxx_hidden_IfNotCommit = v\n}\n\nfunc (x *GetSchemaRequest) SetExcludeCustomOptions(v bool) {\n\tx.xxx_hidden_ExcludeCustomOptions = v\n}\n\nfunc (x *GetSchemaRequest) SetExcludeKnownExtensions(v bool) {\n\tx.xxx_hidden_ExcludeKnownExtensions = v\n}\n\ntype GetSchemaRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repo that contains the schema to retrieve (a user name or\n\t// organization name).\n\tOwner string\n\t// The name of the repo that contains the schema to retrieve.\n\tRepository string\n\t// Optional version of the repo. If unspecified, defaults to latest version on\n\t// the repo's \"main\" branch.\n\tVersion string\n\t// Zero or more types names. The names may refer to messages, enums, services,\n\t// methods, or extensions. All names must be fully-qualified. If any name\n\t// is unknown, the request will fail and no schema will be returned.\n\t//\n\t// If no names are provided, the full schema for the module is returned.\n\t// Otherwise, the resulting schema contains only the named elements and all of\n\t// their dependencies. This is enough information for the caller to construct\n\t// a dynamic message for any requested message types or to dynamically invoke\n\t// an RPC for any requested methods or services.\n\tTypes []string\n\t// If present, this is a commit that the client already has cached. So if the\n\t// given module version resolves to this same commit, the server should not\n\t// send back any descriptors since the client already has them.\n\t//\n\t// This allows a client to efficiently poll for updates: after the initial RPC\n\t// to get a schema, the client can cache the descriptors and the resolved\n\t// commit. It then includes that commit in subsequent requests in this field,\n\t// and the server will only reply with a schema (and new commit) if/when the\n\t// resolved commit changes.\n\tIfNotCommit string\n\t// If true, the returned schema will not include extension definitions for custom\n\t// options that appear on schema elements. When filtering the schema based on the\n\t// given element names, options on all encountered elements are usually examined\n\t// as well. But that is not the case if excluding custom options.\n\t//\n\t// This flag is ignored if element_names is empty as the entire schema is always\n\t// returned in that case.\n\tExcludeCustomOptions bool\n\t// If true, the returned schema will not include known extensions for extendable\n\t// messages for schema elements. If exclude_custom_options is true, such extensions\n\t// may still be returned if the applicable descriptor options type is part of the\n\t// requested schema.\n\t//\n\t// This flag is ignored if element_names is empty as the entire schema is always\n\t// returned in that case.\n\tExcludeKnownExtensions bool\n}\n\nfunc (b0 GetSchemaRequest_builder) Build() *GetSchemaRequest {\n\tm0 := &GetSchemaRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_Types = b.Types\n\tx.xxx_hidden_IfNotCommit = b.IfNotCommit\n\tx.xxx_hidden_ExcludeCustomOptions = b.ExcludeCustomOptions\n\tx.xxx_hidden_ExcludeKnownExtensions = b.ExcludeKnownExtensions\n\treturn m0\n}\n\ntype GetSchemaResponse struct {\n\tstate                  protoimpl.MessageState          `protogen:\"opaque.v1\"`\n\txxx_hidden_Commit      string                          `protobuf:\"bytes,1,opt,name=commit,proto3\"`\n\txxx_hidden_SchemaFiles *descriptorpb.FileDescriptorSet `protobuf:\"bytes,2,opt,name=schema_files,json=schemaFiles,proto3\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *GetSchemaResponse) Reset() {\n\t*x = GetSchemaResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetSchemaResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetSchemaResponse) ProtoMessage() {}\n\nfunc (x *GetSchemaResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_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\nfunc (x *GetSchemaResponse) GetCommit() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetSchemaResponse) GetSchemaFiles() *descriptorpb.FileDescriptorSet {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SchemaFiles\n\t}\n\treturn nil\n}\n\nfunc (x *GetSchemaResponse) SetCommit(v string) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *GetSchemaResponse) SetSchemaFiles(v *descriptorpb.FileDescriptorSet) {\n\tx.xxx_hidden_SchemaFiles = v\n}\n\nfunc (x *GetSchemaResponse) HasSchemaFiles() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_SchemaFiles != nil\n}\n\nfunc (x *GetSchemaResponse) ClearSchemaFiles() {\n\tx.xxx_hidden_SchemaFiles = nil\n}\n\ntype GetSchemaResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The resolved version of the schema. If the requested version was a commit,\n\t// this value is the same as that. If the requested version referred to a tag\n\t// or branch, this is the commit for that tag or latest commit for that\n\t// branch. If the request did not include any version, this is the latest\n\t// version for the module's main branch.\n\tCommit string\n\t// The schema, which is a set of file descriptors that include the requested elements\n\t// and their dependencies.\n\tSchemaFiles *descriptorpb.FileDescriptorSet\n}\n\nfunc (b0 GetSchemaResponse_builder) Build() *GetSchemaResponse {\n\tm0 := &GetSchemaResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Commit = b.Commit\n\tx.xxx_hidden_SchemaFiles = b.SchemaFiles\n\treturn m0\n}\n\ntype ConvertMessageRequest struct {\n\tstate                     protoimpl.MessageState               `protogen:\"opaque.v1\"`\n\txxx_hidden_Owner          string                               `protobuf:\"bytes,1,opt,name=owner,proto3\"`\n\txxx_hidden_Repository     string                               `protobuf:\"bytes,2,opt,name=repository,proto3\"`\n\txxx_hidden_Version        string                               `protobuf:\"bytes,3,opt,name=version,proto3\"`\n\txxx_hidden_MessageName    string                               `protobuf:\"bytes,4,opt,name=message_name,json=messageName,proto3\"`\n\txxx_hidden_InputFormat    Format                               `protobuf:\"varint,5,opt,name=input_format,json=inputFormat,proto3,enum=buf.alpha.registry.v1alpha1.Format\"`\n\txxx_hidden_InputData      []byte                               `protobuf:\"bytes,6,opt,name=input_data,json=inputData,proto3\"`\n\txxx_hidden_DiscardUnknown bool                                 `protobuf:\"varint,7,opt,name=discard_unknown,json=discardUnknown,proto3\"`\n\txxx_hidden_OutputFormat   isConvertMessageRequest_OutputFormat `protobuf_oneof:\"output_format\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ConvertMessageRequest) Reset() {\n\t*x = ConvertMessageRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ConvertMessageRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ConvertMessageRequest) ProtoMessage() {}\n\nfunc (x *ConvertMessageRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_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\nfunc (x *ConvertMessageRequest) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ConvertMessageRequest) GetRepository() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn \"\"\n}\n\nfunc (x *ConvertMessageRequest) GetVersion() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Version\n\t}\n\treturn \"\"\n}\n\nfunc (x *ConvertMessageRequest) GetMessageName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_MessageName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ConvertMessageRequest) GetInputFormat() Format {\n\tif x != nil {\n\t\treturn x.xxx_hidden_InputFormat\n\t}\n\treturn Format_FORMAT_UNSPECIFIED\n}\n\nfunc (x *ConvertMessageRequest) GetInputData() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_InputData\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertMessageRequest) GetDiscardUnknown() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_DiscardUnknown\n\t}\n\treturn false\n}\n\nfunc (x *ConvertMessageRequest) GetOutputBinary() *BinaryOutputOptions {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputBinary); ok {\n\t\t\treturn x.OutputBinary\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertMessageRequest) GetOutputJson() *JSONOutputOptions {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputJson); ok {\n\t\t\treturn x.OutputJson\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertMessageRequest) GetOutputText() *TextOutputOptions {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputText); ok {\n\t\t\treturn x.OutputText\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertMessageRequest) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *ConvertMessageRequest) SetRepository(v string) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *ConvertMessageRequest) SetVersion(v string) {\n\tx.xxx_hidden_Version = v\n}\n\nfunc (x *ConvertMessageRequest) SetMessageName(v string) {\n\tx.xxx_hidden_MessageName = v\n}\n\nfunc (x *ConvertMessageRequest) SetInputFormat(v Format) {\n\tx.xxx_hidden_InputFormat = v\n}\n\nfunc (x *ConvertMessageRequest) SetInputData(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_InputData = v\n}\n\nfunc (x *ConvertMessageRequest) SetDiscardUnknown(v bool) {\n\tx.xxx_hidden_DiscardUnknown = v\n}\n\nfunc (x *ConvertMessageRequest) SetOutputBinary(v *BinaryOutputOptions) {\n\tif v == nil {\n\t\tx.xxx_hidden_OutputFormat = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_OutputFormat = &convertMessageRequest_OutputBinary{v}\n}\n\nfunc (x *ConvertMessageRequest) SetOutputJson(v *JSONOutputOptions) {\n\tif v == nil {\n\t\tx.xxx_hidden_OutputFormat = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_OutputFormat = &convertMessageRequest_OutputJson{v}\n}\n\nfunc (x *ConvertMessageRequest) SetOutputText(v *TextOutputOptions) {\n\tif v == nil {\n\t\tx.xxx_hidden_OutputFormat = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_OutputFormat = &convertMessageRequest_OutputText{v}\n}\n\nfunc (x *ConvertMessageRequest) HasOutputFormat() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_OutputFormat != nil\n}\n\nfunc (x *ConvertMessageRequest) HasOutputBinary() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputBinary)\n\treturn ok\n}\n\nfunc (x *ConvertMessageRequest) HasOutputJson() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputJson)\n\treturn ok\n}\n\nfunc (x *ConvertMessageRequest) HasOutputText() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputText)\n\treturn ok\n}\n\nfunc (x *ConvertMessageRequest) ClearOutputFormat() {\n\tx.xxx_hidden_OutputFormat = nil\n}\n\nfunc (x *ConvertMessageRequest) ClearOutputBinary() {\n\tif _, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputBinary); ok {\n\t\tx.xxx_hidden_OutputFormat = nil\n\t}\n}\n\nfunc (x *ConvertMessageRequest) ClearOutputJson() {\n\tif _, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputJson); ok {\n\t\tx.xxx_hidden_OutputFormat = nil\n\t}\n}\n\nfunc (x *ConvertMessageRequest) ClearOutputText() {\n\tif _, ok := x.xxx_hidden_OutputFormat.(*convertMessageRequest_OutputText); ok {\n\t\tx.xxx_hidden_OutputFormat = nil\n\t}\n}\n\nconst ConvertMessageRequest_OutputFormat_not_set_case case_ConvertMessageRequest_OutputFormat = 0\nconst ConvertMessageRequest_OutputBinary_case case_ConvertMessageRequest_OutputFormat = 8\nconst ConvertMessageRequest_OutputJson_case case_ConvertMessageRequest_OutputFormat = 9\nconst ConvertMessageRequest_OutputText_case case_ConvertMessageRequest_OutputFormat = 10\n\nfunc (x *ConvertMessageRequest) WhichOutputFormat() case_ConvertMessageRequest_OutputFormat {\n\tif x == nil {\n\t\treturn ConvertMessageRequest_OutputFormat_not_set_case\n\t}\n\tswitch x.xxx_hidden_OutputFormat.(type) {\n\tcase *convertMessageRequest_OutputBinary:\n\t\treturn ConvertMessageRequest_OutputBinary_case\n\tcase *convertMessageRequest_OutputJson:\n\t\treturn ConvertMessageRequest_OutputJson_case\n\tcase *convertMessageRequest_OutputText:\n\t\treturn ConvertMessageRequest_OutputText_case\n\tdefault:\n\t\treturn ConvertMessageRequest_OutputFormat_not_set_case\n\t}\n}\n\ntype ConvertMessageRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repo that contains the schema to retrieve (a user name or\n\t// organization name).\n\tOwner string\n\t// The name of the repo that contains the schema to retrieve.\n\tRepository string\n\t// Optional version of the repo. This can be a tag or branch name or a commit.\n\t// If unspecified, defaults to latest version on the repo's \"main\" branch.\n\tVersion string\n\t// The fully-qualified name of the message. Required.\n\tMessageName string\n\t// The format of the input data. Required.\n\tInputFormat Format\n\t// The input data that is to be converted. Required. This must be\n\t// a valid encoding of type indicated by message_name in the format\n\t// indicated by input_format.\n\tInputData []byte\n\t// If true, any unresolvable fields in the input are discarded. For\n\t// formats other than FORMAT_BINARY, this means that the operation\n\t// will fail if the input contains unrecognized field names. For\n\t// FORMAT_BINARY, unrecognized fields can be retained and possibly\n\t// included in the reformatted output (depending on the requested\n\t// output format).\n\tDiscardUnknown bool\n\t// Fields of oneof xxx_hidden_OutputFormat:\n\tOutputBinary *BinaryOutputOptions\n\tOutputJson   *JSONOutputOptions\n\tOutputText   *TextOutputOptions\n\t// -- end of xxx_hidden_OutputFormat\n}\n\nfunc (b0 ConvertMessageRequest_builder) Build() *ConvertMessageRequest {\n\tm0 := &ConvertMessageRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Repository = b.Repository\n\tx.xxx_hidden_Version = b.Version\n\tx.xxx_hidden_MessageName = b.MessageName\n\tx.xxx_hidden_InputFormat = b.InputFormat\n\tx.xxx_hidden_InputData = b.InputData\n\tx.xxx_hidden_DiscardUnknown = b.DiscardUnknown\n\tif b.OutputBinary != nil {\n\t\tx.xxx_hidden_OutputFormat = &convertMessageRequest_OutputBinary{b.OutputBinary}\n\t}\n\tif b.OutputJson != nil {\n\t\tx.xxx_hidden_OutputFormat = &convertMessageRequest_OutputJson{b.OutputJson}\n\t}\n\tif b.OutputText != nil {\n\t\tx.xxx_hidden_OutputFormat = &convertMessageRequest_OutputText{b.OutputText}\n\t}\n\treturn m0\n}\n\ntype case_ConvertMessageRequest_OutputFormat protoreflect.FieldNumber\n\nfunc (x case_ConvertMessageRequest_OutputFormat) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[2].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isConvertMessageRequest_OutputFormat interface {\n\tisConvertMessageRequest_OutputFormat()\n}\n\ntype convertMessageRequest_OutputBinary struct {\n\tOutputBinary *BinaryOutputOptions `protobuf:\"bytes,8,opt,name=output_binary,json=outputBinary,proto3,oneof\"`\n}\n\ntype convertMessageRequest_OutputJson struct {\n\tOutputJson *JSONOutputOptions `protobuf:\"bytes,9,opt,name=output_json,json=outputJson,proto3,oneof\"`\n}\n\ntype convertMessageRequest_OutputText struct {\n\tOutputText *TextOutputOptions `protobuf:\"bytes,10,opt,name=output_text,json=outputText,proto3,oneof\"`\n}\n\nfunc (*convertMessageRequest_OutputBinary) isConvertMessageRequest_OutputFormat() {}\n\nfunc (*convertMessageRequest_OutputJson) isConvertMessageRequest_OutputFormat() {}\n\nfunc (*convertMessageRequest_OutputText) isConvertMessageRequest_OutputFormat() {}\n\ntype BinaryOutputOptions struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *BinaryOutputOptions) Reset() {\n\t*x = BinaryOutputOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *BinaryOutputOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*BinaryOutputOptions) ProtoMessage() {}\n\nfunc (x *BinaryOutputOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_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\ntype BinaryOutputOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 BinaryOutputOptions_builder) Build() *BinaryOutputOptions {\n\tm0 := &BinaryOutputOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype JSONOutputOptions struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UseEnumNumbers  bool                   `protobuf:\"varint,3,opt,name=use_enum_numbers,json=useEnumNumbers,proto3\"`\n\txxx_hidden_IncludeDefaults bool                   `protobuf:\"varint,4,opt,name=include_defaults,json=includeDefaults,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *JSONOutputOptions) Reset() {\n\t*x = JSONOutputOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *JSONOutputOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*JSONOutputOptions) ProtoMessage() {}\n\nfunc (x *JSONOutputOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_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\nfunc (x *JSONOutputOptions) GetUseEnumNumbers() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UseEnumNumbers\n\t}\n\treturn false\n}\n\nfunc (x *JSONOutputOptions) GetIncludeDefaults() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeDefaults\n\t}\n\treturn false\n}\n\nfunc (x *JSONOutputOptions) SetUseEnumNumbers(v bool) {\n\tx.xxx_hidden_UseEnumNumbers = v\n}\n\nfunc (x *JSONOutputOptions) SetIncludeDefaults(v bool) {\n\tx.xxx_hidden_IncludeDefaults = v\n}\n\ntype JSONOutputOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Enum fields will be emitted as numeric values. If false (the default), enum\n\t// fields are emitted as strings that are the enum values' names.\n\tUseEnumNumbers bool\n\t// Includes fields that have their default values. This applies only to fields\n\t// defined in proto3 syntax that have no explicit \"optional\" keyword. Other\n\t// optional fields will be included if present in the input data.\n\tIncludeDefaults bool\n}\n\nfunc (b0 JSONOutputOptions_builder) Build() *JSONOutputOptions {\n\tm0 := &JSONOutputOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UseEnumNumbers = b.UseEnumNumbers\n\tx.xxx_hidden_IncludeDefaults = b.IncludeDefaults\n\treturn m0\n}\n\ntype TextOutputOptions struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_IncludeUnrecognized bool                   `protobuf:\"varint,2,opt,name=include_unrecognized,json=includeUnrecognized,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *TextOutputOptions) Reset() {\n\t*x = TextOutputOptions{}\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *TextOutputOptions) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TextOutputOptions) ProtoMessage() {}\n\nfunc (x *TextOutputOptions) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_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\nfunc (x *TextOutputOptions) GetIncludeUnrecognized() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeUnrecognized\n\t}\n\treturn false\n}\n\nfunc (x *TextOutputOptions) SetIncludeUnrecognized(v bool) {\n\tx.xxx_hidden_IncludeUnrecognized = v\n}\n\ntype TextOutputOptions_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// If true and the input data includes unrecognized fields, the unrecognized\n\t// fields will be preserved in the text output (using field numbers and raw\n\t// values).\n\tIncludeUnrecognized bool\n}\n\nfunc (b0 TextOutputOptions_builder) Build() *TextOutputOptions {\n\tm0 := &TextOutputOptions{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_IncludeUnrecognized = b.IncludeUnrecognized\n\treturn m0\n}\n\ntype ConvertMessageResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Commit     string                 `protobuf:\"bytes,1,opt,name=commit,proto3\"`\n\txxx_hidden_OutputData []byte                 `protobuf:\"bytes,2,opt,name=output_data,json=outputData,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *ConvertMessageResponse) Reset() {\n\t*x = ConvertMessageResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ConvertMessageResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ConvertMessageResponse) ProtoMessage() {}\n\nfunc (x *ConvertMessageResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_schema_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\nfunc (x *ConvertMessageResponse) GetCommit() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Commit\n\t}\n\treturn \"\"\n}\n\nfunc (x *ConvertMessageResponse) GetOutputData() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OutputData\n\t}\n\treturn nil\n}\n\nfunc (x *ConvertMessageResponse) SetCommit(v string) {\n\tx.xxx_hidden_Commit = v\n}\n\nfunc (x *ConvertMessageResponse) SetOutputData(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_OutputData = v\n}\n\ntype ConvertMessageResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The resolved version of the schema. If the requested version was a commit,\n\t// this value is the same as that. If the requested version referred to a tag\n\t// or branch, this is the commit for that tag or latest commit for that\n\t// branch. If the request did not include any version, this is the latest\n\t// version for the module's main branch.\n\tCommit string\n\t// The reformatted data.\n\tOutputData []byte\n}\n\nfunc (b0 ConvertMessageResponse_builder) Build() *ConvertMessageResponse {\n\tm0 := &ConvertMessageResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Commit = b.Commit\n\tx.xxx_hidden_OutputData = b.OutputData\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_schema_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_schema_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"(buf/alpha/registry/v1alpha1/schema.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a google/protobuf/descriptor.proto\\\"\\x8c\\x02\\n\" +\n\t\"\\x10GetSchemaRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12\\x14\\n\" +\n\t\"\\x05types\\x18\\x04 \\x03(\\tR\\x05types\\x12\\\"\\n\" +\n\t\"\\rif_not_commit\\x18\\x05 \\x01(\\tR\\vifNotCommit\\x124\\n\" +\n\t\"\\x16exclude_custom_options\\x18\\x06 \\x01(\\bR\\x14excludeCustomOptions\\x128\\n\" +\n\t\"\\x18exclude_known_extensions\\x18\\a \\x01(\\bR\\x16excludeKnownExtensions\\\"r\\n\" +\n\t\"\\x11GetSchemaResponse\\x12\\x16\\n\" +\n\t\"\\x06commit\\x18\\x01 \\x01(\\tR\\x06commit\\x12E\\n\" +\n\t\"\\fschema_files\\x18\\x02 \\x01(\\v2\\\".google.protobuf.FileDescriptorSetR\\vschemaFiles\\\"\\xaa\\x04\\n\" +\n\t\"\\x15ConvertMessageRequest\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x01 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x02 \\x01(\\tR\\n\" +\n\t\"repository\\x12\\x18\\n\" +\n\t\"\\aversion\\x18\\x03 \\x01(\\tR\\aversion\\x12!\\n\" +\n\t\"\\fmessage_name\\x18\\x04 \\x01(\\tR\\vmessageName\\x12F\\n\" +\n\t\"\\finput_format\\x18\\x05 \\x01(\\x0e2#.buf.alpha.registry.v1alpha1.FormatR\\vinputFormat\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"input_data\\x18\\x06 \\x01(\\fR\\tinputData\\x12'\\n\" +\n\t\"\\x0fdiscard_unknown\\x18\\a \\x01(\\bR\\x0ediscardUnknown\\x12W\\n\" +\n\t\"\\routput_binary\\x18\\b \\x01(\\v20.buf.alpha.registry.v1alpha1.BinaryOutputOptionsH\\x00R\\foutputBinary\\x12Q\\n\" +\n\t\"\\voutput_json\\x18\\t \\x01(\\v2..buf.alpha.registry.v1alpha1.JSONOutputOptionsH\\x00R\\n\" +\n\t\"outputJson\\x12Q\\n\" +\n\t\"\\voutput_text\\x18\\n\" +\n\t\" \\x01(\\v2..buf.alpha.registry.v1alpha1.TextOutputOptionsH\\x00R\\n\" +\n\t\"outputTextB\\x0f\\n\" +\n\t\"\\routput_format\\\"\\x15\\n\" +\n\t\"\\x13BinaryOutputOptions\\\"h\\n\" +\n\t\"\\x11JSONOutputOptions\\x12(\\n\" +\n\t\"\\x10use_enum_numbers\\x18\\x03 \\x01(\\bR\\x0euseEnumNumbers\\x12)\\n\" +\n\t\"\\x10include_defaults\\x18\\x04 \\x01(\\bR\\x0fincludeDefaults\\\"F\\n\" +\n\t\"\\x11TextOutputOptions\\x121\\n\" +\n\t\"\\x14include_unrecognized\\x18\\x02 \\x01(\\bR\\x13includeUnrecognized\\\"Q\\n\" +\n\t\"\\x16ConvertMessageResponse\\x12\\x16\\n\" +\n\t\"\\x06commit\\x18\\x01 \\x01(\\tR\\x06commit\\x12\\x1f\\n\" +\n\t\"\\voutput_data\\x18\\x02 \\x01(\\fR\\n\" +\n\t\"outputData*U\\n\" +\n\t\"\\x06Format\\x12\\x16\\n\" +\n\t\"\\x12FORMAT_UNSPECIFIED\\x10\\x00\\x12\\x11\\n\" +\n\t\"\\rFORMAT_BINARY\\x10\\x01\\x12\\x0f\\n\" +\n\t\"\\vFORMAT_JSON\\x10\\x02\\x12\\x0f\\n\" +\n\t\"\\vFORMAT_TEXT\\x10\\x032\\xfb\\x01\\n\" +\n\t\"\\rSchemaService\\x12o\\n\" +\n\t\"\\tGetSchema\\x12-.buf.alpha.registry.v1alpha1.GetSchemaRequest\\x1a..buf.alpha.registry.v1alpha1.GetSchemaResponse\\\"\\x03\\x90\\x02\\x01\\x12y\\n\" +\n\t\"\\x0eConvertMessage\\x122.buf.alpha.registry.v1alpha1.ConvertMessageRequest\\x1a3.buf.alpha.registry.v1alpha1.ConvertMessageResponseB\\x98\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\vSchemaProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 7)\nvar file_buf_alpha_registry_v1alpha1_schema_proto_goTypes = []any{\n\t(Format)(0),                            // 0: buf.alpha.registry.v1alpha1.Format\n\t(*GetSchemaRequest)(nil),               // 1: buf.alpha.registry.v1alpha1.GetSchemaRequest\n\t(*GetSchemaResponse)(nil),              // 2: buf.alpha.registry.v1alpha1.GetSchemaResponse\n\t(*ConvertMessageRequest)(nil),          // 3: buf.alpha.registry.v1alpha1.ConvertMessageRequest\n\t(*BinaryOutputOptions)(nil),            // 4: buf.alpha.registry.v1alpha1.BinaryOutputOptions\n\t(*JSONOutputOptions)(nil),              // 5: buf.alpha.registry.v1alpha1.JSONOutputOptions\n\t(*TextOutputOptions)(nil),              // 6: buf.alpha.registry.v1alpha1.TextOutputOptions\n\t(*ConvertMessageResponse)(nil),         // 7: buf.alpha.registry.v1alpha1.ConvertMessageResponse\n\t(*descriptorpb.FileDescriptorSet)(nil), // 8: google.protobuf.FileDescriptorSet\n}\nvar file_buf_alpha_registry_v1alpha1_schema_proto_depIdxs = []int32{\n\t8, // 0: buf.alpha.registry.v1alpha1.GetSchemaResponse.schema_files:type_name -> google.protobuf.FileDescriptorSet\n\t0, // 1: buf.alpha.registry.v1alpha1.ConvertMessageRequest.input_format:type_name -> buf.alpha.registry.v1alpha1.Format\n\t4, // 2: buf.alpha.registry.v1alpha1.ConvertMessageRequest.output_binary:type_name -> buf.alpha.registry.v1alpha1.BinaryOutputOptions\n\t5, // 3: buf.alpha.registry.v1alpha1.ConvertMessageRequest.output_json:type_name -> buf.alpha.registry.v1alpha1.JSONOutputOptions\n\t6, // 4: buf.alpha.registry.v1alpha1.ConvertMessageRequest.output_text:type_name -> buf.alpha.registry.v1alpha1.TextOutputOptions\n\t1, // 5: buf.alpha.registry.v1alpha1.SchemaService.GetSchema:input_type -> buf.alpha.registry.v1alpha1.GetSchemaRequest\n\t3, // 6: buf.alpha.registry.v1alpha1.SchemaService.ConvertMessage:input_type -> buf.alpha.registry.v1alpha1.ConvertMessageRequest\n\t2, // 7: buf.alpha.registry.v1alpha1.SchemaService.GetSchema:output_type -> buf.alpha.registry.v1alpha1.GetSchemaResponse\n\t7, // 8: buf.alpha.registry.v1alpha1.SchemaService.ConvertMessage:output_type -> buf.alpha.registry.v1alpha1.ConvertMessageResponse\n\t7, // [7:9] is the sub-list for method output_type\n\t5, // [5:7] is the sub-list for method input_type\n\t5, // [5:5] is the sub-list for extension type_name\n\t5, // [5:5] is the sub-list for extension extendee\n\t0, // [0:5] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_schema_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_schema_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_schema_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[2].OneofWrappers = []any{\n\t\t(*convertMessageRequest_OutputBinary)(nil),\n\t\t(*convertMessageRequest_OutputJson)(nil),\n\t\t(*convertMessageRequest_OutputText)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_schema_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_schema_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   7,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_schema_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_schema_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_schema_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_schema_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_schema_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/scim_token.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/scim_token.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 SCIMToken struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id         string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_ExpireTime *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=expire_time,json=expireTime,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *SCIMToken) Reset() {\n\t*x = SCIMToken{}\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SCIMToken) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SCIMToken) ProtoMessage() {}\n\nfunc (x *SCIMToken) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_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\nfunc (x *SCIMToken) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *SCIMToken) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *SCIMToken) GetExpireTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExpireTime\n\t}\n\treturn nil\n}\n\nfunc (x *SCIMToken) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *SCIMToken) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *SCIMToken) SetExpireTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_ExpireTime = v\n}\n\nfunc (x *SCIMToken) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *SCIMToken) HasExpireTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ExpireTime != nil\n}\n\nfunc (x *SCIMToken) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *SCIMToken) ClearExpireTime() {\n\tx.xxx_hidden_ExpireTime = nil\n}\n\ntype SCIMToken_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId         string\n\tCreateTime *timestamppb.Timestamp\n\tExpireTime *timestamppb.Timestamp\n}\n\nfunc (b0 SCIMToken_builder) Build() *SCIMToken {\n\tm0 := &SCIMToken{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_ExpireTime = b.ExpireTime\n\treturn m0\n}\n\ntype CreateSCIMTokenRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ExpireTime *timestamppb.Timestamp `protobuf:\"bytes,1,opt,name=expire_time,json=expireTime,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *CreateSCIMTokenRequest) Reset() {\n\t*x = CreateSCIMTokenRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateSCIMTokenRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateSCIMTokenRequest) ProtoMessage() {}\n\nfunc (x *CreateSCIMTokenRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_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\nfunc (x *CreateSCIMTokenRequest) GetExpireTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExpireTime\n\t}\n\treturn nil\n}\n\nfunc (x *CreateSCIMTokenRequest) SetExpireTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_ExpireTime = v\n}\n\nfunc (x *CreateSCIMTokenRequest) HasExpireTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ExpireTime != nil\n}\n\nfunc (x *CreateSCIMTokenRequest) ClearExpireTime() {\n\tx.xxx_hidden_ExpireTime = nil\n}\n\ntype CreateSCIMTokenRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The time until which the token should be valid.\n\t// Must be in the future. May be null for no expiry.\n\tExpireTime *timestamppb.Timestamp\n}\n\nfunc (b0 CreateSCIMTokenRequest_builder) Build() *CreateSCIMTokenRequest {\n\tm0 := &CreateSCIMTokenRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ExpireTime = b.ExpireTime\n\treturn m0\n}\n\ntype CreateSCIMTokenResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Token string                 `protobuf:\"bytes,1,opt,name=token,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *CreateSCIMTokenResponse) Reset() {\n\t*x = CreateSCIMTokenResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateSCIMTokenResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateSCIMTokenResponse) ProtoMessage() {}\n\nfunc (x *CreateSCIMTokenResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_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\nfunc (x *CreateSCIMTokenResponse) GetToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Token\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateSCIMTokenResponse) SetToken(v string) {\n\tx.xxx_hidden_Token = v\n}\n\ntype CreateSCIMTokenResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plaintext token to use for authentication.\n\tToken string\n}\n\nfunc (b0 CreateSCIMTokenResponse_builder) Build() *CreateSCIMTokenResponse {\n\tm0 := &CreateSCIMTokenResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Token = b.Token\n\treturn m0\n}\n\ntype ListSCIMTokensRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListSCIMTokensRequest) Reset() {\n\t*x = ListSCIMTokensRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListSCIMTokensRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListSCIMTokensRequest) ProtoMessage() {}\n\nfunc (x *ListSCIMTokensRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_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\nfunc (x *ListSCIMTokensRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListSCIMTokensRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListSCIMTokensRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListSCIMTokensRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListSCIMTokensRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListSCIMTokensRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListSCIMTokensRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListSCIMTokensRequest_builder) Build() *ListSCIMTokensRequest {\n\tm0 := &ListSCIMTokensRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListSCIMTokensResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Tokens        *[]*SCIMToken          `protobuf:\"bytes,1,rep,name=tokens,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListSCIMTokensResponse) Reset() {\n\t*x = ListSCIMTokensResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListSCIMTokensResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListSCIMTokensResponse) ProtoMessage() {}\n\nfunc (x *ListSCIMTokensResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_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\nfunc (x *ListSCIMTokensResponse) GetTokens() []*SCIMToken {\n\tif x != nil {\n\t\tif x.xxx_hidden_Tokens != nil {\n\t\t\treturn *x.xxx_hidden_Tokens\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListSCIMTokensResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListSCIMTokensResponse) SetTokens(v []*SCIMToken) {\n\tx.xxx_hidden_Tokens = &v\n}\n\nfunc (x *ListSCIMTokensResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListSCIMTokensResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tTokens []*SCIMToken\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListSCIMTokensResponse_builder) Build() *ListSCIMTokensResponse {\n\tm0 := &ListSCIMTokensResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Tokens = &b.Tokens\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype DeleteSCIMTokenRequest struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_TokenId string                 `protobuf:\"bytes,1,opt,name=token_id,json=tokenId,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *DeleteSCIMTokenRequest) Reset() {\n\t*x = DeleteSCIMTokenRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteSCIMTokenRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteSCIMTokenRequest) ProtoMessage() {}\n\nfunc (x *DeleteSCIMTokenRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_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\nfunc (x *DeleteSCIMTokenRequest) GetTokenId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TokenId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteSCIMTokenRequest) SetTokenId(v string) {\n\tx.xxx_hidden_TokenId = v\n}\n\ntype DeleteSCIMTokenRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tTokenId string\n}\n\nfunc (b0 DeleteSCIMTokenRequest_builder) Build() *DeleteSCIMTokenRequest {\n\tm0 := &DeleteSCIMTokenRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TokenId = b.TokenId\n\treturn m0\n}\n\ntype DeleteSCIMTokenResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteSCIMTokenResponse) Reset() {\n\t*x = DeleteSCIMTokenResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteSCIMTokenResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteSCIMTokenResponse) ProtoMessage() {}\n\nfunc (x *DeleteSCIMTokenResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_scim_token_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\ntype DeleteSCIMTokenResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteSCIMTokenResponse_builder) Build() *DeleteSCIMTokenResponse {\n\tm0 := &DeleteSCIMTokenResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_scim_token_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\",buf/alpha/registry/v1alpha1/scim_token.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\x95\\x01\\n\" +\n\t\"\\tSCIMToken\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12;\\n\" +\n\t\"\\vexpire_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"expireTime\\\"U\\n\" +\n\t\"\\x16CreateSCIMTokenRequest\\x12;\\n\" +\n\t\"\\vexpire_time\\x18\\x01 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"expireTime\\\"/\\n\" +\n\t\"\\x17CreateSCIMTokenResponse\\x12\\x14\\n\" +\n\t\"\\x05token\\x18\\x01 \\x01(\\tR\\x05token\\\"m\\n\" +\n\t\"\\x15ListSCIMTokensRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\\"\\x80\\x01\\n\" +\n\t\"\\x16ListSCIMTokensResponse\\x12>\\n\" +\n\t\"\\x06tokens\\x18\\x01 \\x03(\\v2&.buf.alpha.registry.v1alpha1.SCIMTokenR\\x06tokens\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"3\\n\" +\n\t\"\\x16DeleteSCIMTokenRequest\\x12\\x19\\n\" +\n\t\"\\btoken_id\\x18\\x01 \\x01(\\tR\\atokenId\\\"\\x19\\n\" +\n\t\"\\x17DeleteSCIMTokenResponse2\\x94\\x03\\n\" +\n\t\"\\x10SCIMTokenService\\x12|\\n\" +\n\t\"\\x0fCreateSCIMToken\\x123.buf.alpha.registry.v1alpha1.CreateSCIMTokenRequest\\x1a4.buf.alpha.registry.v1alpha1.CreateSCIMTokenResponse\\x12~\\n\" +\n\t\"\\x0eListSCIMTokens\\x122.buf.alpha.registry.v1alpha1.ListSCIMTokensRequest\\x1a3.buf.alpha.registry.v1alpha1.ListSCIMTokensResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x81\\x01\\n\" +\n\t\"\\x0fDeleteSCIMToken\\x123.buf.alpha.registry.v1alpha1.DeleteSCIMTokenRequest\\x1a4.buf.alpha.registry.v1alpha1.DeleteSCIMTokenResponse\\\"\\x03\\x90\\x02\\x02B\\x9b\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x0eScimTokenProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes = make([]protoimpl.MessageInfo, 7)\nvar file_buf_alpha_registry_v1alpha1_scim_token_proto_goTypes = []any{\n\t(*SCIMToken)(nil),               // 0: buf.alpha.registry.v1alpha1.SCIMToken\n\t(*CreateSCIMTokenRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.CreateSCIMTokenRequest\n\t(*CreateSCIMTokenResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateSCIMTokenResponse\n\t(*ListSCIMTokensRequest)(nil),   // 3: buf.alpha.registry.v1alpha1.ListSCIMTokensRequest\n\t(*ListSCIMTokensResponse)(nil),  // 4: buf.alpha.registry.v1alpha1.ListSCIMTokensResponse\n\t(*DeleteSCIMTokenRequest)(nil),  // 5: buf.alpha.registry.v1alpha1.DeleteSCIMTokenRequest\n\t(*DeleteSCIMTokenResponse)(nil), // 6: buf.alpha.registry.v1alpha1.DeleteSCIMTokenResponse\n\t(*timestamppb.Timestamp)(nil),   // 7: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_scim_token_proto_depIdxs = []int32{\n\t7, // 0: buf.alpha.registry.v1alpha1.SCIMToken.create_time:type_name -> google.protobuf.Timestamp\n\t7, // 1: buf.alpha.registry.v1alpha1.SCIMToken.expire_time:type_name -> google.protobuf.Timestamp\n\t7, // 2: buf.alpha.registry.v1alpha1.CreateSCIMTokenRequest.expire_time:type_name -> google.protobuf.Timestamp\n\t0, // 3: buf.alpha.registry.v1alpha1.ListSCIMTokensResponse.tokens:type_name -> buf.alpha.registry.v1alpha1.SCIMToken\n\t1, // 4: buf.alpha.registry.v1alpha1.SCIMTokenService.CreateSCIMToken:input_type -> buf.alpha.registry.v1alpha1.CreateSCIMTokenRequest\n\t3, // 5: buf.alpha.registry.v1alpha1.SCIMTokenService.ListSCIMTokens:input_type -> buf.alpha.registry.v1alpha1.ListSCIMTokensRequest\n\t5, // 6: buf.alpha.registry.v1alpha1.SCIMTokenService.DeleteSCIMToken:input_type -> buf.alpha.registry.v1alpha1.DeleteSCIMTokenRequest\n\t2, // 7: buf.alpha.registry.v1alpha1.SCIMTokenService.CreateSCIMToken:output_type -> buf.alpha.registry.v1alpha1.CreateSCIMTokenResponse\n\t4, // 8: buf.alpha.registry.v1alpha1.SCIMTokenService.ListSCIMTokens:output_type -> buf.alpha.registry.v1alpha1.ListSCIMTokensResponse\n\t6, // 9: buf.alpha.registry.v1alpha1.SCIMTokenService.DeleteSCIMToken:output_type -> buf.alpha.registry.v1alpha1.DeleteSCIMTokenResponse\n\t7, // [7:10] is the sub-list for method output_type\n\t4, // [4:7] is the sub-list for method input_type\n\t4, // [4:4] is the sub-list for extension type_name\n\t4, // [4:4] is the sub-list for extension extendee\n\t0, // [0:4] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_scim_token_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_scim_token_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_scim_token_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_buf_alpha_registry_v1alpha1_scim_token_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   7,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_scim_token_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_scim_token_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_scim_token_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_scim_token_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_scim_token_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/search.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/search.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 SearchFilter int32\n\nconst (\n\tSearchFilter_SEARCH_FILTER_UNSPECIFIED    SearchFilter = 0\n\tSearchFilter_SEARCH_FILTER_USER           SearchFilter = 1\n\tSearchFilter_SEARCH_FILTER_ORGANIZATION   SearchFilter = 2\n\tSearchFilter_SEARCH_FILTER_REPOSITORY     SearchFilter = 3\n\tSearchFilter_SEARCH_FILTER_TEAM           SearchFilter = 6\n\tSearchFilter_SEARCH_FILTER_CURATED_PLUGIN SearchFilter = 7\n\tSearchFilter_SEARCH_FILTER_MODULE_ELEMENT SearchFilter = 8\n\tSearchFilter_SEARCH_FILTER_MODULE_FILE    SearchFilter = 9\n)\n\n// Enum value maps for SearchFilter.\nvar (\n\tSearchFilter_name = map[int32]string{\n\t\t0: \"SEARCH_FILTER_UNSPECIFIED\",\n\t\t1: \"SEARCH_FILTER_USER\",\n\t\t2: \"SEARCH_FILTER_ORGANIZATION\",\n\t\t3: \"SEARCH_FILTER_REPOSITORY\",\n\t\t6: \"SEARCH_FILTER_TEAM\",\n\t\t7: \"SEARCH_FILTER_CURATED_PLUGIN\",\n\t\t8: \"SEARCH_FILTER_MODULE_ELEMENT\",\n\t\t9: \"SEARCH_FILTER_MODULE_FILE\",\n\t}\n\tSearchFilter_value = map[string]int32{\n\t\t\"SEARCH_FILTER_UNSPECIFIED\":    0,\n\t\t\"SEARCH_FILTER_USER\":           1,\n\t\t\"SEARCH_FILTER_ORGANIZATION\":   2,\n\t\t\"SEARCH_FILTER_REPOSITORY\":     3,\n\t\t\"SEARCH_FILTER_TEAM\":           6,\n\t\t\"SEARCH_FILTER_CURATED_PLUGIN\": 7,\n\t\t\"SEARCH_FILTER_MODULE_ELEMENT\": 8,\n\t\t\"SEARCH_FILTER_MODULE_FILE\":    9,\n\t}\n)\n\nfunc (x SearchFilter) Enum() *SearchFilter {\n\tp := new(SearchFilter)\n\t*p = x\n\treturn p\n}\n\nfunc (x SearchFilter) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (SearchFilter) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[0].Descriptor()\n}\n\nfunc (SearchFilter) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[0]\n}\n\nfunc (x SearchFilter) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype OrderBy int32\n\nconst (\n\tOrderBy_ORDER_BY_UNSPECIFIED OrderBy = 0\n\tOrderBy_ORDER_BY_CREATE_TIME OrderBy = 1\n\tOrderBy_ORDER_BY_UPDATE_TIME OrderBy = 2\n\tOrderBy_ORDER_BY_NAME        OrderBy = 3\n)\n\n// Enum value maps for OrderBy.\nvar (\n\tOrderBy_name = map[int32]string{\n\t\t0: \"ORDER_BY_UNSPECIFIED\",\n\t\t1: \"ORDER_BY_CREATE_TIME\",\n\t\t2: \"ORDER_BY_UPDATE_TIME\",\n\t\t3: \"ORDER_BY_NAME\",\n\t}\n\tOrderBy_value = map[string]int32{\n\t\t\"ORDER_BY_UNSPECIFIED\": 0,\n\t\t\"ORDER_BY_CREATE_TIME\": 1,\n\t\t\"ORDER_BY_UPDATE_TIME\": 2,\n\t\t\"ORDER_BY_NAME\":        3,\n\t}\n)\n\nfunc (x OrderBy) Enum() *OrderBy {\n\tp := new(OrderBy)\n\t*p = x\n\treturn p\n}\n\nfunc (x OrderBy) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (OrderBy) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[1].Descriptor()\n}\n\nfunc (OrderBy) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[1]\n}\n\nfunc (x OrderBy) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// SearchModuleElementType is the protobuf element type of a fully qualified name in a module element search result.\n// This is a subset of types in https://protobuf.com/docs/language-spec#named-elements that are exposing in the search.\ntype SearchModuleElementType int32\n\nconst (\n\tSearchModuleElementType_SEARCH_MODULE_ELEMENT_TYPE_UNSPECIFIED SearchModuleElementType = 0\n\tSearchModuleElementType_SEARCH_MODULE_ELEMENT_TYPE_SERVICE     SearchModuleElementType = 1\n\tSearchModuleElementType_SEARCH_MODULE_ELEMENT_TYPE_METHOD      SearchModuleElementType = 2\n\tSearchModuleElementType_SEARCH_MODULE_ELEMENT_TYPE_MESSAGE     SearchModuleElementType = 3\n\tSearchModuleElementType_SEARCH_MODULE_ELEMENT_TYPE_ENUM        SearchModuleElementType = 4\n)\n\n// Enum value maps for SearchModuleElementType.\nvar (\n\tSearchModuleElementType_name = map[int32]string{\n\t\t0: \"SEARCH_MODULE_ELEMENT_TYPE_UNSPECIFIED\",\n\t\t1: \"SEARCH_MODULE_ELEMENT_TYPE_SERVICE\",\n\t\t2: \"SEARCH_MODULE_ELEMENT_TYPE_METHOD\",\n\t\t3: \"SEARCH_MODULE_ELEMENT_TYPE_MESSAGE\",\n\t\t4: \"SEARCH_MODULE_ELEMENT_TYPE_ENUM\",\n\t}\n\tSearchModuleElementType_value = map[string]int32{\n\t\t\"SEARCH_MODULE_ELEMENT_TYPE_UNSPECIFIED\": 0,\n\t\t\"SEARCH_MODULE_ELEMENT_TYPE_SERVICE\":     1,\n\t\t\"SEARCH_MODULE_ELEMENT_TYPE_METHOD\":      2,\n\t\t\"SEARCH_MODULE_ELEMENT_TYPE_MESSAGE\":     3,\n\t\t\"SEARCH_MODULE_ELEMENT_TYPE_ENUM\":        4,\n\t}\n)\n\nfunc (x SearchModuleElementType) Enum() *SearchModuleElementType {\n\tp := new(SearchModuleElementType)\n\t*p = x\n\treturn p\n}\n\nfunc (x SearchModuleElementType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (SearchModuleElementType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[2].Descriptor()\n}\n\nfunc (SearchModuleElementType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[2]\n}\n\nfunc (x SearchModuleElementType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype SearchModuleContentFilter int32\n\nconst (\n\tSearchModuleContentFilter_SEARCH_MODULE_CONTENT_FILTER_UNSPECIFIED SearchModuleContentFilter = 0\n\t// SEARCH_MODULE_CONTENT_FILTER_ELEMENT is the filter for elements, e.g. messages, services, and methods.\n\tSearchModuleContentFilter_SEARCH_MODULE_CONTENT_FILTER_ELEMENT SearchModuleContentFilter = 1\n\t// SEARCH_MODULE_CONTENT_FILTER_FILE is the filter for files.\n\tSearchModuleContentFilter_SEARCH_MODULE_CONTENT_FILTER_FILE SearchModuleContentFilter = 2\n)\n\n// Enum value maps for SearchModuleContentFilter.\nvar (\n\tSearchModuleContentFilter_name = map[int32]string{\n\t\t0: \"SEARCH_MODULE_CONTENT_FILTER_UNSPECIFIED\",\n\t\t1: \"SEARCH_MODULE_CONTENT_FILTER_ELEMENT\",\n\t\t2: \"SEARCH_MODULE_CONTENT_FILTER_FILE\",\n\t}\n\tSearchModuleContentFilter_value = map[string]int32{\n\t\t\"SEARCH_MODULE_CONTENT_FILTER_UNSPECIFIED\": 0,\n\t\t\"SEARCH_MODULE_CONTENT_FILTER_ELEMENT\":     1,\n\t\t\"SEARCH_MODULE_CONTENT_FILTER_FILE\":        2,\n\t}\n)\n\nfunc (x SearchModuleContentFilter) Enum() *SearchModuleContentFilter {\n\tp := new(SearchModuleContentFilter)\n\t*p = x\n\treturn p\n}\n\nfunc (x SearchModuleContentFilter) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (SearchModuleContentFilter) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[3].Descriptor()\n}\n\nfunc (SearchModuleContentFilter) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[3]\n}\n\nfunc (x SearchModuleContentFilter) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype RepositorySearchResult struct {\n\tstate                              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id                      string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Name                    string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Owner                   string                 `protobuf:\"bytes,3,opt,name=owner,proto3\"`\n\txxx_hidden_Visibility              Visibility             `protobuf:\"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility\"`\n\txxx_hidden_Deprecated              bool                   `protobuf:\"varint,5,opt,name=deprecated,proto3\"`\n\txxx_hidden_LatestSpdxLicenseId     string                 `protobuf:\"bytes,6,opt,name=latest_spdx_license_id,json=latestSpdxLicenseId,proto3\"`\n\txxx_hidden_OwnerVerificationStatus VerificationStatus     `protobuf:\"varint,7,opt,name=owner_verification_status,json=ownerVerificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus\"`\n\txxx_hidden_Url                     string                 `protobuf:\"bytes,8,opt,name=url,proto3\"`\n\txxx_hidden_LatestCommitTime        *timestamppb.Timestamp `protobuf:\"bytes,9,opt,name=latest_commit_time,json=latestCommitTime,proto3\"`\n\tunknownFields                      protoimpl.UnknownFields\n\tsizeCache                          protoimpl.SizeCache\n}\n\nfunc (x *RepositorySearchResult) Reset() {\n\t*x = RepositorySearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositorySearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositorySearchResult) ProtoMessage() {}\n\nfunc (x *RepositorySearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *RepositorySearchResult) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositorySearchResult) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositorySearchResult) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositorySearchResult) GetVisibility() Visibility {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Visibility\n\t}\n\treturn Visibility_VISIBILITY_UNSPECIFIED\n}\n\nfunc (x *RepositorySearchResult) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *RepositorySearchResult) GetLatestSpdxLicenseId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LatestSpdxLicenseId\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositorySearchResult) GetOwnerVerificationStatus() VerificationStatus {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerVerificationStatus\n\t}\n\treturn VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED\n}\n\nfunc (x *RepositorySearchResult) GetUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Url\n\t}\n\treturn \"\"\n}\n\nfunc (x *RepositorySearchResult) GetLatestCommitTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LatestCommitTime\n\t}\n\treturn nil\n}\n\nfunc (x *RepositorySearchResult) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *RepositorySearchResult) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *RepositorySearchResult) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *RepositorySearchResult) SetVisibility(v Visibility) {\n\tx.xxx_hidden_Visibility = v\n}\n\nfunc (x *RepositorySearchResult) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *RepositorySearchResult) SetLatestSpdxLicenseId(v string) {\n\tx.xxx_hidden_LatestSpdxLicenseId = v\n}\n\nfunc (x *RepositorySearchResult) SetOwnerVerificationStatus(v VerificationStatus) {\n\tx.xxx_hidden_OwnerVerificationStatus = v\n}\n\nfunc (x *RepositorySearchResult) SetUrl(v string) {\n\tx.xxx_hidden_Url = v\n}\n\nfunc (x *RepositorySearchResult) SetLatestCommitTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_LatestCommitTime = v\n}\n\nfunc (x *RepositorySearchResult) HasLatestCommitTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_LatestCommitTime != nil\n}\n\nfunc (x *RepositorySearchResult) ClearLatestCommitTime() {\n\tx.xxx_hidden_LatestCommitTime = nil\n}\n\ntype RepositorySearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId   string\n\tName string\n\t// The name of the user or organization\n\t// who is the owner of this repository.\n\tOwner string\n\t// The visibility of the repository.\n\tVisibility Visibility\n\tDeprecated bool\n\t// The SPDX license ID of the latest main commit in the repository.\n\tLatestSpdxLicenseId string\n\t// The verification status of the owner of the repository.\n\tOwnerVerificationStatus VerificationStatus\n\t// The user configurable URL in the description of the repository.\n\tUrl string\n\t// The commit time of the latest main commit in the repository.\n\tLatestCommitTime *timestamppb.Timestamp\n}\n\nfunc (b0 RepositorySearchResult_builder) Build() *RepositorySearchResult {\n\tm0 := &RepositorySearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Visibility = b.Visibility\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\tx.xxx_hidden_LatestSpdxLicenseId = b.LatestSpdxLicenseId\n\tx.xxx_hidden_OwnerVerificationStatus = b.OwnerVerificationStatus\n\tx.xxx_hidden_Url = b.Url\n\tx.xxx_hidden_LatestCommitTime = b.LatestCommitTime\n\treturn m0\n}\n\ntype OrganizationSearchResult struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id         string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Name       string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_CreateTime *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=create_time,json=createTime,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *OrganizationSearchResult) Reset() {\n\t*x = OrganizationSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *OrganizationSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*OrganizationSearchResult) ProtoMessage() {}\n\nfunc (x *OrganizationSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *OrganizationSearchResult) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *OrganizationSearchResult) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *OrganizationSearchResult) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *OrganizationSearchResult) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *OrganizationSearchResult) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *OrganizationSearchResult) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *OrganizationSearchResult) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *OrganizationSearchResult) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\ntype OrganizationSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId         string\n\tName       string\n\tCreateTime *timestamppb.Timestamp\n}\n\nfunc (b0 OrganizationSearchResult_builder) Build() *OrganizationSearchResult {\n\tm0 := &OrganizationSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\treturn m0\n}\n\ntype UserSearchResult struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id          string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Username    string                 `protobuf:\"bytes,2,opt,name=username,proto3\"`\n\txxx_hidden_Deactivated bool                   `protobuf:\"varint,3,opt,name=deactivated,proto3\"`\n\txxx_hidden_CreateTime  *timestamppb.Timestamp `protobuf:\"bytes,4,opt,name=create_time,json=createTime,proto3\"`\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *UserSearchResult) Reset() {\n\t*x = UserSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UserSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UserSearchResult) ProtoMessage() {}\n\nfunc (x *UserSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *UserSearchResult) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserSearchResult) GetUsername() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *UserSearchResult) GetDeactivated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deactivated\n\t}\n\treturn false\n}\n\nfunc (x *UserSearchResult) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *UserSearchResult) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *UserSearchResult) SetUsername(v string) {\n\tx.xxx_hidden_Username = v\n}\n\nfunc (x *UserSearchResult) SetDeactivated(v bool) {\n\tx.xxx_hidden_Deactivated = v\n}\n\nfunc (x *UserSearchResult) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *UserSearchResult) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *UserSearchResult) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\ntype UserSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId          string\n\tUsername    string\n\tDeactivated bool\n\tCreateTime  *timestamppb.Timestamp\n}\n\nfunc (b0 UserSearchResult_builder) Build() *UserSearchResult {\n\tm0 := &UserSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Username = b.Username\n\tx.xxx_hidden_Deactivated = b.Deactivated\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\treturn m0\n}\n\ntype TeamSearchResult struct {\n\tstate                       protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id               string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Name             string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_OrganizationName string                 `protobuf:\"bytes,3,opt,name=organization_name,json=organizationName,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *TeamSearchResult) Reset() {\n\t*x = TeamSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *TeamSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*TeamSearchResult) ProtoMessage() {}\n\nfunc (x *TeamSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *TeamSearchResult) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *TeamSearchResult) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *TeamSearchResult) GetOrganizationName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationName\n\t}\n\treturn \"\"\n}\n\nfunc (x *TeamSearchResult) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *TeamSearchResult) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *TeamSearchResult) SetOrganizationName(v string) {\n\tx.xxx_hidden_OrganizationName = v\n}\n\ntype TeamSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId               string\n\tName             string\n\tOrganizationName string\n}\n\nfunc (b0 TeamSearchResult_builder) Build() *TeamSearchResult {\n\tm0 := &TeamSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_OrganizationName = b.OrganizationName\n\treturn m0\n}\n\ntype CuratedPluginSearchResult struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id              string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_Name            string                 `protobuf:\"bytes,2,opt,name=name,proto3\"`\n\txxx_hidden_Owner           string                 `protobuf:\"bytes,3,opt,name=owner,proto3\"`\n\txxx_hidden_Deprecated      bool                   `protobuf:\"varint,4,opt,name=deprecated,proto3\"`\n\txxx_hidden_Description     string                 `protobuf:\"bytes,5,opt,name=description,proto3\"`\n\txxx_hidden_RegistryType    PluginRegistryType     `protobuf:\"varint,6,opt,name=registry_type,json=registryType,proto3,enum=buf.alpha.registry.v1alpha1.PluginRegistryType\"`\n\txxx_hidden_OutputLanguages []PluginLanguage       `protobuf:\"varint,7,rep,packed,name=output_languages,json=outputLanguages,proto3,enum=buf.alpha.registry.v1alpha1.PluginLanguage\"`\n\txxx_hidden_CreateTime      *timestamppb.Timestamp `protobuf:\"bytes,8,opt,name=create_time,json=createTime,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *CuratedPluginSearchResult) Reset() {\n\t*x = CuratedPluginSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CuratedPluginSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CuratedPluginSearchResult) ProtoMessage() {}\n\nfunc (x *CuratedPluginSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *CuratedPluginSearchResult) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginSearchResult) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginSearchResult) GetOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Owner\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginSearchResult) GetDeprecated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deprecated\n\t}\n\treturn false\n}\n\nfunc (x *CuratedPluginSearchResult) GetDescription() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Description\n\t}\n\treturn \"\"\n}\n\nfunc (x *CuratedPluginSearchResult) GetRegistryType() PluginRegistryType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RegistryType\n\t}\n\treturn PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED\n}\n\nfunc (x *CuratedPluginSearchResult) GetOutputLanguages() []PluginLanguage {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OutputLanguages\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPluginSearchResult) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *CuratedPluginSearchResult) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *CuratedPluginSearchResult) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *CuratedPluginSearchResult) SetOwner(v string) {\n\tx.xxx_hidden_Owner = v\n}\n\nfunc (x *CuratedPluginSearchResult) SetDeprecated(v bool) {\n\tx.xxx_hidden_Deprecated = v\n}\n\nfunc (x *CuratedPluginSearchResult) SetDescription(v string) {\n\tx.xxx_hidden_Description = v\n}\n\nfunc (x *CuratedPluginSearchResult) SetRegistryType(v PluginRegistryType) {\n\tx.xxx_hidden_RegistryType = v\n}\n\nfunc (x *CuratedPluginSearchResult) SetOutputLanguages(v []PluginLanguage) {\n\tx.xxx_hidden_OutputLanguages = v\n}\n\nfunc (x *CuratedPluginSearchResult) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *CuratedPluginSearchResult) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *CuratedPluginSearchResult) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\ntype CuratedPluginSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId   string\n\tName string\n\t// The name of the user or organization\n\t// who is the owner of this plugin.\n\tOwner      string\n\tDeprecated bool\n\t// The description of the plugin and it's functionality.\n\tDescription string\n\t// The registry type of the plugin.\n\tRegistryType PluginRegistryType\n\t// The output languages supported by the plugin.\n\tOutputLanguages []PluginLanguage\n\t// The plugins creation timestamp.\n\tCreateTime *timestamppb.Timestamp\n}\n\nfunc (b0 CuratedPluginSearchResult_builder) Build() *CuratedPluginSearchResult {\n\tm0 := &CuratedPluginSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_Owner = b.Owner\n\tx.xxx_hidden_Deprecated = b.Deprecated\n\tx.xxx_hidden_Description = b.Description\n\tx.xxx_hidden_RegistryType = b.RegistryType\n\tx.xxx_hidden_OutputLanguages = b.OutputLanguages\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\treturn m0\n}\n\ntype ModuleElementSearchResult struct {\n\tstate                              protoimpl.MessageState  `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId            string                  `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryOwner         string                  `protobuf:\"bytes,2,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName          string                  `protobuf:\"bytes,3,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_ProtoFilePath           string                  `protobuf:\"bytes,4,opt,name=proto_file_path,json=protoFilePath,proto3\"`\n\txxx_hidden_FullyQualifiedName      string                  `protobuf:\"bytes,5,opt,name=fully_qualified_name,json=fullyQualifiedName,proto3\"`\n\txxx_hidden_PackageName             string                  `protobuf:\"bytes,6,opt,name=package_name,json=packageName,proto3\"`\n\txxx_hidden_SearchModuleElementType SearchModuleElementType `protobuf:\"varint,7,opt,name=search_module_element_type,json=searchModuleElementType,proto3,enum=buf.alpha.registry.v1alpha1.SearchModuleElementType\"`\n\tunknownFields                      protoimpl.UnknownFields\n\tsizeCache                          protoimpl.SizeCache\n}\n\nfunc (x *ModuleElementSearchResult) Reset() {\n\t*x = ModuleElementSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModuleElementSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModuleElementSearchResult) ProtoMessage() {}\n\nfunc (x *ModuleElementSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *ModuleElementSearchResult) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleElementSearchResult) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleElementSearchResult) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleElementSearchResult) GetProtoFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ProtoFilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleElementSearchResult) GetFullyQualifiedName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullyQualifiedName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleElementSearchResult) GetPackageName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PackageName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleElementSearchResult) GetSearchModuleElementType() SearchModuleElementType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_SearchModuleElementType\n\t}\n\treturn SearchModuleElementType_SEARCH_MODULE_ELEMENT_TYPE_UNSPECIFIED\n}\n\nfunc (x *ModuleElementSearchResult) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ModuleElementSearchResult) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *ModuleElementSearchResult) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *ModuleElementSearchResult) SetProtoFilePath(v string) {\n\tx.xxx_hidden_ProtoFilePath = v\n}\n\nfunc (x *ModuleElementSearchResult) SetFullyQualifiedName(v string) {\n\tx.xxx_hidden_FullyQualifiedName = v\n}\n\nfunc (x *ModuleElementSearchResult) SetPackageName(v string) {\n\tx.xxx_hidden_PackageName = v\n}\n\nfunc (x *ModuleElementSearchResult) SetSearchModuleElementType(v SearchModuleElementType) {\n\tx.xxx_hidden_SearchModuleElementType = v\n}\n\ntype ModuleElementSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryId            string\n\tRepositoryOwner         string\n\tRepositoryName          string\n\tProtoFilePath           string\n\tFullyQualifiedName      string\n\tPackageName             string\n\tSearchModuleElementType SearchModuleElementType\n}\n\nfunc (b0 ModuleElementSearchResult_builder) Build() *ModuleElementSearchResult {\n\tm0 := &ModuleElementSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_ProtoFilePath = b.ProtoFilePath\n\tx.xxx_hidden_FullyQualifiedName = b.FullyQualifiedName\n\tx.xxx_hidden_PackageName = b.PackageName\n\tx.xxx_hidden_SearchModuleElementType = b.SearchModuleElementType\n\treturn m0\n}\n\ntype ModuleFileSearchResult struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId    string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,2,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,3,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_ProtoFilePath   string                 `protobuf:\"bytes,4,opt,name=proto_file_path,json=protoFilePath,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *ModuleFileSearchResult) Reset() {\n\t*x = ModuleFileSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ModuleFileSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ModuleFileSearchResult) ProtoMessage() {}\n\nfunc (x *ModuleFileSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *ModuleFileSearchResult) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleFileSearchResult) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleFileSearchResult) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleFileSearchResult) GetProtoFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ProtoFilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *ModuleFileSearchResult) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ModuleFileSearchResult) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *ModuleFileSearchResult) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *ModuleFileSearchResult) SetProtoFilePath(v string) {\n\tx.xxx_hidden_ProtoFilePath = v\n}\n\ntype ModuleFileSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryId    string\n\tRepositoryOwner string\n\tRepositoryName  string\n\tProtoFilePath   string\n}\n\nfunc (b0 ModuleFileSearchResult_builder) Build() *ModuleFileSearchResult {\n\tm0 := &ModuleFileSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_ProtoFilePath = b.ProtoFilePath\n\treturn m0\n}\n\ntype SearchResult struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Item isSearchResult_Item    `protobuf_oneof:\"item\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *SearchResult) Reset() {\n\t*x = SearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchResult) ProtoMessage() {}\n\nfunc (x *SearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *SearchResult) GetRepository() *RepositorySearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchResult_Repository); ok {\n\t\t\treturn x.Repository\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResult) GetOrganization() *OrganizationSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchResult_Organization); ok {\n\t\t\treturn x.Organization\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResult) GetUser() *UserSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchResult_User); ok {\n\t\t\treturn x.User\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResult) GetTeam() *TeamSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchResult_Team); ok {\n\t\t\treturn x.Team\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResult) GetCuratedPlugin() *CuratedPluginSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchResult_CuratedPlugin); ok {\n\t\t\treturn x.CuratedPlugin\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResult) GetModuleElement() *ModuleElementSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchResult_ModuleElement); ok {\n\t\t\treturn x.ModuleElement\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResult) GetModuleFile() *ModuleFileSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchResult_ModuleFile); ok {\n\t\t\treturn x.ModuleFile\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResult) SetRepository(v *RepositorySearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchResult_Repository{v}\n}\n\nfunc (x *SearchResult) SetOrganization(v *OrganizationSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchResult_Organization{v}\n}\n\nfunc (x *SearchResult) SetUser(v *UserSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchResult_User{v}\n}\n\nfunc (x *SearchResult) SetTeam(v *TeamSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchResult_Team{v}\n}\n\nfunc (x *SearchResult) SetCuratedPlugin(v *CuratedPluginSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchResult_CuratedPlugin{v}\n}\n\nfunc (x *SearchResult) SetModuleElement(v *ModuleElementSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchResult_ModuleElement{v}\n}\n\nfunc (x *SearchResult) SetModuleFile(v *ModuleFileSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchResult_ModuleFile{v}\n}\n\nfunc (x *SearchResult) HasItem() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Item != nil\n}\n\nfunc (x *SearchResult) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchResult_Repository)\n\treturn ok\n}\n\nfunc (x *SearchResult) HasOrganization() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchResult_Organization)\n\treturn ok\n}\n\nfunc (x *SearchResult) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchResult_User)\n\treturn ok\n}\n\nfunc (x *SearchResult) HasTeam() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchResult_Team)\n\treturn ok\n}\n\nfunc (x *SearchResult) HasCuratedPlugin() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchResult_CuratedPlugin)\n\treturn ok\n}\n\nfunc (x *SearchResult) HasModuleElement() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchResult_ModuleElement)\n\treturn ok\n}\n\nfunc (x *SearchResult) HasModuleFile() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchResult_ModuleFile)\n\treturn ok\n}\n\nfunc (x *SearchResult) ClearItem() {\n\tx.xxx_hidden_Item = nil\n}\n\nfunc (x *SearchResult) ClearRepository() {\n\tif _, ok := x.xxx_hidden_Item.(*searchResult_Repository); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nfunc (x *SearchResult) ClearOrganization() {\n\tif _, ok := x.xxx_hidden_Item.(*searchResult_Organization); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nfunc (x *SearchResult) ClearUser() {\n\tif _, ok := x.xxx_hidden_Item.(*searchResult_User); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nfunc (x *SearchResult) ClearTeam() {\n\tif _, ok := x.xxx_hidden_Item.(*searchResult_Team); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nfunc (x *SearchResult) ClearCuratedPlugin() {\n\tif _, ok := x.xxx_hidden_Item.(*searchResult_CuratedPlugin); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nfunc (x *SearchResult) ClearModuleElement() {\n\tif _, ok := x.xxx_hidden_Item.(*searchResult_ModuleElement); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nfunc (x *SearchResult) ClearModuleFile() {\n\tif _, ok := x.xxx_hidden_Item.(*searchResult_ModuleFile); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nconst SearchResult_Item_not_set_case case_SearchResult_Item = 0\nconst SearchResult_Repository_case case_SearchResult_Item = 1\nconst SearchResult_Organization_case case_SearchResult_Item = 2\nconst SearchResult_User_case case_SearchResult_Item = 3\nconst SearchResult_Team_case case_SearchResult_Item = 4\nconst SearchResult_CuratedPlugin_case case_SearchResult_Item = 7\nconst SearchResult_ModuleElement_case case_SearchResult_Item = 8\nconst SearchResult_ModuleFile_case case_SearchResult_Item = 9\n\nfunc (x *SearchResult) WhichItem() case_SearchResult_Item {\n\tif x == nil {\n\t\treturn SearchResult_Item_not_set_case\n\t}\n\tswitch x.xxx_hidden_Item.(type) {\n\tcase *searchResult_Repository:\n\t\treturn SearchResult_Repository_case\n\tcase *searchResult_Organization:\n\t\treturn SearchResult_Organization_case\n\tcase *searchResult_User:\n\t\treturn SearchResult_User_case\n\tcase *searchResult_Team:\n\t\treturn SearchResult_Team_case\n\tcase *searchResult_CuratedPlugin:\n\t\treturn SearchResult_CuratedPlugin_case\n\tcase *searchResult_ModuleElement:\n\t\treturn SearchResult_ModuleElement_case\n\tcase *searchResult_ModuleFile:\n\t\treturn SearchResult_ModuleFile_case\n\tdefault:\n\t\treturn SearchResult_Item_not_set_case\n\t}\n}\n\ntype SearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Item:\n\tRepository    *RepositorySearchResult\n\tOrganization  *OrganizationSearchResult\n\tUser          *UserSearchResult\n\tTeam          *TeamSearchResult\n\tCuratedPlugin *CuratedPluginSearchResult\n\tModuleElement *ModuleElementSearchResult\n\tModuleFile    *ModuleFileSearchResult\n\t// -- end of xxx_hidden_Item\n}\n\nfunc (b0 SearchResult_builder) Build() *SearchResult {\n\tm0 := &SearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Repository != nil {\n\t\tx.xxx_hidden_Item = &searchResult_Repository{b.Repository}\n\t}\n\tif b.Organization != nil {\n\t\tx.xxx_hidden_Item = &searchResult_Organization{b.Organization}\n\t}\n\tif b.User != nil {\n\t\tx.xxx_hidden_Item = &searchResult_User{b.User}\n\t}\n\tif b.Team != nil {\n\t\tx.xxx_hidden_Item = &searchResult_Team{b.Team}\n\t}\n\tif b.CuratedPlugin != nil {\n\t\tx.xxx_hidden_Item = &searchResult_CuratedPlugin{b.CuratedPlugin}\n\t}\n\tif b.ModuleElement != nil {\n\t\tx.xxx_hidden_Item = &searchResult_ModuleElement{b.ModuleElement}\n\t}\n\tif b.ModuleFile != nil {\n\t\tx.xxx_hidden_Item = &searchResult_ModuleFile{b.ModuleFile}\n\t}\n\treturn m0\n}\n\ntype case_SearchResult_Item protoreflect.FieldNumber\n\nfunc (x case_SearchResult_Item) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[7].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isSearchResult_Item interface {\n\tisSearchResult_Item()\n}\n\ntype searchResult_Repository struct {\n\tRepository *RepositorySearchResult `protobuf:\"bytes,1,opt,name=repository,proto3,oneof\"`\n}\n\ntype searchResult_Organization struct {\n\tOrganization *OrganizationSearchResult `protobuf:\"bytes,2,opt,name=organization,proto3,oneof\"`\n}\n\ntype searchResult_User struct {\n\tUser *UserSearchResult `protobuf:\"bytes,3,opt,name=user,proto3,oneof\"`\n}\n\ntype searchResult_Team struct {\n\tTeam *TeamSearchResult `protobuf:\"bytes,4,opt,name=team,proto3,oneof\"`\n}\n\ntype searchResult_CuratedPlugin struct {\n\tCuratedPlugin *CuratedPluginSearchResult `protobuf:\"bytes,7,opt,name=curated_plugin,json=curatedPlugin,proto3,oneof\"`\n}\n\ntype searchResult_ModuleElement struct {\n\tModuleElement *ModuleElementSearchResult `protobuf:\"bytes,8,opt,name=module_element,json=moduleElement,proto3,oneof\"`\n}\n\ntype searchResult_ModuleFile struct {\n\tModuleFile *ModuleFileSearchResult `protobuf:\"bytes,9,opt,name=module_file,json=moduleFile,proto3,oneof\"`\n}\n\nfunc (*searchResult_Repository) isSearchResult_Item() {}\n\nfunc (*searchResult_Organization) isSearchResult_Item() {}\n\nfunc (*searchResult_User) isSearchResult_Item() {}\n\nfunc (*searchResult_Team) isSearchResult_Item() {}\n\nfunc (*searchResult_CuratedPlugin) isSearchResult_Item() {}\n\nfunc (*searchResult_ModuleElement) isSearchResult_Item() {}\n\nfunc (*searchResult_ModuleFile) isSearchResult_Item() {}\n\ntype ElementSearchResult struct {\n\tstate                         protoimpl.MessageState         `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId       string                         `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryOwner    string                         `protobuf:\"bytes,2,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName     string                         `protobuf:\"bytes,3,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_ProtoFilePath      string                         `protobuf:\"bytes,4,opt,name=proto_file_path,json=protoFilePath,proto3\"`\n\txxx_hidden_FullyQualifiedName string                         `protobuf:\"bytes,5,opt,name=fully_qualified_name,json=fullyQualifiedName,proto3\"`\n\txxx_hidden_Document           isElementSearchResult_Document `protobuf_oneof:\"document\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *ElementSearchResult) Reset() {\n\t*x = ElementSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ElementSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ElementSearchResult) ProtoMessage() {}\n\nfunc (x *ElementSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_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\nfunc (x *ElementSearchResult) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ElementSearchResult) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *ElementSearchResult) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ElementSearchResult) GetProtoFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ProtoFilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *ElementSearchResult) GetFullyQualifiedName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FullyQualifiedName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ElementSearchResult) GetService() *Service {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Document.(*elementSearchResult_Service); ok {\n\t\t\treturn x.Service\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ElementSearchResult) GetMethod() *Method {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Document.(*elementSearchResult_Method); ok {\n\t\t\treturn x.Method\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ElementSearchResult) GetEnum() *Enum {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Document.(*elementSearchResult_Enum); ok {\n\t\t\treturn x.Enum\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ElementSearchResult) GetMessage() *Message {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Document.(*elementSearchResult_Message); ok {\n\t\t\treturn x.Message\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ElementSearchResult) GetFileExtension() *FileExtension {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Document.(*elementSearchResult_FileExtension); ok {\n\t\t\treturn x.FileExtension\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ElementSearchResult) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *ElementSearchResult) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *ElementSearchResult) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *ElementSearchResult) SetProtoFilePath(v string) {\n\tx.xxx_hidden_ProtoFilePath = v\n}\n\nfunc (x *ElementSearchResult) SetFullyQualifiedName(v string) {\n\tx.xxx_hidden_FullyQualifiedName = v\n}\n\nfunc (x *ElementSearchResult) SetService(v *Service) {\n\tif v == nil {\n\t\tx.xxx_hidden_Document = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Document = &elementSearchResult_Service{v}\n}\n\nfunc (x *ElementSearchResult) SetMethod(v *Method) {\n\tif v == nil {\n\t\tx.xxx_hidden_Document = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Document = &elementSearchResult_Method{v}\n}\n\nfunc (x *ElementSearchResult) SetEnum(v *Enum) {\n\tif v == nil {\n\t\tx.xxx_hidden_Document = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Document = &elementSearchResult_Enum{v}\n}\n\nfunc (x *ElementSearchResult) SetMessage(v *Message) {\n\tif v == nil {\n\t\tx.xxx_hidden_Document = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Document = &elementSearchResult_Message{v}\n}\n\nfunc (x *ElementSearchResult) SetFileExtension(v *FileExtension) {\n\tif v == nil {\n\t\tx.xxx_hidden_Document = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Document = &elementSearchResult_FileExtension{v}\n}\n\nfunc (x *ElementSearchResult) HasDocument() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Document != nil\n}\n\nfunc (x *ElementSearchResult) HasService() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Document.(*elementSearchResult_Service)\n\treturn ok\n}\n\nfunc (x *ElementSearchResult) HasMethod() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Document.(*elementSearchResult_Method)\n\treturn ok\n}\n\nfunc (x *ElementSearchResult) HasEnum() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Document.(*elementSearchResult_Enum)\n\treturn ok\n}\n\nfunc (x *ElementSearchResult) HasMessage() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Document.(*elementSearchResult_Message)\n\treturn ok\n}\n\nfunc (x *ElementSearchResult) HasFileExtension() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Document.(*elementSearchResult_FileExtension)\n\treturn ok\n}\n\nfunc (x *ElementSearchResult) ClearDocument() {\n\tx.xxx_hidden_Document = nil\n}\n\nfunc (x *ElementSearchResult) ClearService() {\n\tif _, ok := x.xxx_hidden_Document.(*elementSearchResult_Service); ok {\n\t\tx.xxx_hidden_Document = nil\n\t}\n}\n\nfunc (x *ElementSearchResult) ClearMethod() {\n\tif _, ok := x.xxx_hidden_Document.(*elementSearchResult_Method); ok {\n\t\tx.xxx_hidden_Document = nil\n\t}\n}\n\nfunc (x *ElementSearchResult) ClearEnum() {\n\tif _, ok := x.xxx_hidden_Document.(*elementSearchResult_Enum); ok {\n\t\tx.xxx_hidden_Document = nil\n\t}\n}\n\nfunc (x *ElementSearchResult) ClearMessage() {\n\tif _, ok := x.xxx_hidden_Document.(*elementSearchResult_Message); ok {\n\t\tx.xxx_hidden_Document = nil\n\t}\n}\n\nfunc (x *ElementSearchResult) ClearFileExtension() {\n\tif _, ok := x.xxx_hidden_Document.(*elementSearchResult_FileExtension); ok {\n\t\tx.xxx_hidden_Document = nil\n\t}\n}\n\nconst ElementSearchResult_Document_not_set_case case_ElementSearchResult_Document = 0\nconst ElementSearchResult_Service_case case_ElementSearchResult_Document = 6\nconst ElementSearchResult_Method_case case_ElementSearchResult_Document = 7\nconst ElementSearchResult_Enum_case case_ElementSearchResult_Document = 8\nconst ElementSearchResult_Message_case case_ElementSearchResult_Document = 9\nconst ElementSearchResult_FileExtension_case case_ElementSearchResult_Document = 10\n\nfunc (x *ElementSearchResult) WhichDocument() case_ElementSearchResult_Document {\n\tif x == nil {\n\t\treturn ElementSearchResult_Document_not_set_case\n\t}\n\tswitch x.xxx_hidden_Document.(type) {\n\tcase *elementSearchResult_Service:\n\t\treturn ElementSearchResult_Service_case\n\tcase *elementSearchResult_Method:\n\t\treturn ElementSearchResult_Method_case\n\tcase *elementSearchResult_Enum:\n\t\treturn ElementSearchResult_Enum_case\n\tcase *elementSearchResult_Message:\n\t\treturn ElementSearchResult_Message_case\n\tcase *elementSearchResult_FileExtension:\n\t\treturn ElementSearchResult_FileExtension_case\n\tdefault:\n\t\treturn ElementSearchResult_Document_not_set_case\n\t}\n}\n\ntype ElementSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryId       string\n\tRepositoryOwner    string\n\tRepositoryName     string\n\tProtoFilePath      string\n\tFullyQualifiedName string\n\t// Fields of oneof xxx_hidden_Document:\n\tService       *Service\n\tMethod        *Method\n\tEnum          *Enum\n\tMessage       *Message\n\tFileExtension *FileExtension\n\t// -- end of xxx_hidden_Document\n}\n\nfunc (b0 ElementSearchResult_builder) Build() *ElementSearchResult {\n\tm0 := &ElementSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_ProtoFilePath = b.ProtoFilePath\n\tx.xxx_hidden_FullyQualifiedName = b.FullyQualifiedName\n\tif b.Service != nil {\n\t\tx.xxx_hidden_Document = &elementSearchResult_Service{b.Service}\n\t}\n\tif b.Method != nil {\n\t\tx.xxx_hidden_Document = &elementSearchResult_Method{b.Method}\n\t}\n\tif b.Enum != nil {\n\t\tx.xxx_hidden_Document = &elementSearchResult_Enum{b.Enum}\n\t}\n\tif b.Message != nil {\n\t\tx.xxx_hidden_Document = &elementSearchResult_Message{b.Message}\n\t}\n\tif b.FileExtension != nil {\n\t\tx.xxx_hidden_Document = &elementSearchResult_FileExtension{b.FileExtension}\n\t}\n\treturn m0\n}\n\ntype case_ElementSearchResult_Document protoreflect.FieldNumber\n\nfunc (x case_ElementSearchResult_Document) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[8].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isElementSearchResult_Document interface {\n\tisElementSearchResult_Document()\n}\n\ntype elementSearchResult_Service struct {\n\tService *Service `protobuf:\"bytes,6,opt,name=service,proto3,oneof\"`\n}\n\ntype elementSearchResult_Method struct {\n\tMethod *Method `protobuf:\"bytes,7,opt,name=method,proto3,oneof\"`\n}\n\ntype elementSearchResult_Enum struct {\n\tEnum *Enum `protobuf:\"bytes,8,opt,name=enum,proto3,oneof\"`\n}\n\ntype elementSearchResult_Message struct {\n\tMessage *Message `protobuf:\"bytes,9,opt,name=message,proto3,oneof\"`\n}\n\ntype elementSearchResult_FileExtension struct {\n\tFileExtension *FileExtension `protobuf:\"bytes,10,opt,name=file_extension,json=fileExtension,proto3,oneof\"`\n}\n\nfunc (*elementSearchResult_Service) isElementSearchResult_Document() {}\n\nfunc (*elementSearchResult_Method) isElementSearchResult_Document() {}\n\nfunc (*elementSearchResult_Enum) isElementSearchResult_Document() {}\n\nfunc (*elementSearchResult_Message) isElementSearchResult_Document() {}\n\nfunc (*elementSearchResult_FileExtension) isElementSearchResult_Document() {}\n\ntype FileSearchResult struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryId    string                 `protobuf:\"bytes,1,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,2,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,3,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_ProtoFilePath   string                 `protobuf:\"bytes,4,opt,name=proto_file_path,json=protoFilePath,proto3\"`\n\txxx_hidden_Content         []byte                 `protobuf:\"bytes,5,opt,name=content,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *FileSearchResult) Reset() {\n\t*x = FileSearchResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *FileSearchResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*FileSearchResult) ProtoMessage() {}\n\nfunc (x *FileSearchResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[9]\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\nfunc (x *FileSearchResult) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileSearchResult) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileSearchResult) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileSearchResult) GetProtoFilePath() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ProtoFilePath\n\t}\n\treturn \"\"\n}\n\nfunc (x *FileSearchResult) GetContent() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Content\n\t}\n\treturn nil\n}\n\nfunc (x *FileSearchResult) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *FileSearchResult) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *FileSearchResult) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *FileSearchResult) SetProtoFilePath(v string) {\n\tx.xxx_hidden_ProtoFilePath = v\n}\n\nfunc (x *FileSearchResult) SetContent(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Content = v\n}\n\ntype FileSearchResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryId    string\n\tRepositoryOwner string\n\tRepositoryName  string\n\tProtoFilePath   string\n\tContent         []byte\n}\n\nfunc (b0 FileSearchResult_builder) Build() *FileSearchResult {\n\tm0 := &FileSearchResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_ProtoFilePath = b.ProtoFilePath\n\tx.xxx_hidden_Content = b.Content\n\treturn m0\n}\n\ntype SearchModuleContentResult struct {\n\tstate           protoimpl.MessageState           `protogen:\"opaque.v1\"`\n\txxx_hidden_Item isSearchModuleContentResult_Item `protobuf_oneof:\"item\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *SearchModuleContentResult) Reset() {\n\t*x = SearchModuleContentResult{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchModuleContentResult) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchModuleContentResult) ProtoMessage() {}\n\nfunc (x *SearchModuleContentResult) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[10]\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\nfunc (x *SearchModuleContentResult) GetElement() *ElementSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchModuleContentResult_Element); ok {\n\t\t\treturn x.Element\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchModuleContentResult) GetFile() *FileSearchResult {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Item.(*searchModuleContentResult_File); ok {\n\t\t\treturn x.File\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchModuleContentResult) SetElement(v *ElementSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchModuleContentResult_Element{v}\n}\n\nfunc (x *SearchModuleContentResult) SetFile(v *FileSearchResult) {\n\tif v == nil {\n\t\tx.xxx_hidden_Item = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Item = &searchModuleContentResult_File{v}\n}\n\nfunc (x *SearchModuleContentResult) HasItem() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Item != nil\n}\n\nfunc (x *SearchModuleContentResult) HasElement() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchModuleContentResult_Element)\n\treturn ok\n}\n\nfunc (x *SearchModuleContentResult) HasFile() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Item.(*searchModuleContentResult_File)\n\treturn ok\n}\n\nfunc (x *SearchModuleContentResult) ClearItem() {\n\tx.xxx_hidden_Item = nil\n}\n\nfunc (x *SearchModuleContentResult) ClearElement() {\n\tif _, ok := x.xxx_hidden_Item.(*searchModuleContentResult_Element); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nfunc (x *SearchModuleContentResult) ClearFile() {\n\tif _, ok := x.xxx_hidden_Item.(*searchModuleContentResult_File); ok {\n\t\tx.xxx_hidden_Item = nil\n\t}\n}\n\nconst SearchModuleContentResult_Item_not_set_case case_SearchModuleContentResult_Item = 0\nconst SearchModuleContentResult_Element_case case_SearchModuleContentResult_Item = 1\nconst SearchModuleContentResult_File_case case_SearchModuleContentResult_Item = 2\n\nfunc (x *SearchModuleContentResult) WhichItem() case_SearchModuleContentResult_Item {\n\tif x == nil {\n\t\treturn SearchModuleContentResult_Item_not_set_case\n\t}\n\tswitch x.xxx_hidden_Item.(type) {\n\tcase *searchModuleContentResult_Element:\n\t\treturn SearchModuleContentResult_Element_case\n\tcase *searchModuleContentResult_File:\n\t\treturn SearchModuleContentResult_File_case\n\tdefault:\n\t\treturn SearchModuleContentResult_Item_not_set_case\n\t}\n}\n\ntype SearchModuleContentResult_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Item:\n\tElement *ElementSearchResult\n\tFile    *FileSearchResult\n\t// -- end of xxx_hidden_Item\n}\n\nfunc (b0 SearchModuleContentResult_builder) Build() *SearchModuleContentResult {\n\tm0 := &SearchModuleContentResult{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.Element != nil {\n\t\tx.xxx_hidden_Item = &searchModuleContentResult_Element{b.Element}\n\t}\n\tif b.File != nil {\n\t\tx.xxx_hidden_Item = &searchModuleContentResult_File{b.File}\n\t}\n\treturn m0\n}\n\ntype case_SearchModuleContentResult_Item protoreflect.FieldNumber\n\nfunc (x case_SearchModuleContentResult_Item) String() string {\n\tmd := file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[10].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isSearchModuleContentResult_Item interface {\n\tisSearchModuleContentResult_Item()\n}\n\ntype searchModuleContentResult_Element struct {\n\tElement *ElementSearchResult `protobuf:\"bytes,1,opt,name=element,proto3,oneof\"`\n}\n\ntype searchModuleContentResult_File struct {\n\tFile *FileSearchResult `protobuf:\"bytes,2,opt,name=file,proto3,oneof\"`\n}\n\nfunc (*searchModuleContentResult_Element) isSearchModuleContentResult_Item() {}\n\nfunc (*searchModuleContentResult_File) isSearchModuleContentResult_Item() {}\n\ntype SearchRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Query     string                 `protobuf:\"bytes,1,opt,name=query,proto3\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken uint32                 `protobuf:\"varint,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Filters   []SearchFilter         `protobuf:\"varint,4,rep,packed,name=filters,proto3,enum=buf.alpha.registry.v1alpha1.SearchFilter\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *SearchRequest) Reset() {\n\t*x = SearchRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchRequest) ProtoMessage() {}\n\nfunc (x *SearchRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[11]\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\nfunc (x *SearchRequest) GetQuery() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Query\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *SearchRequest) GetPageToken() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn 0\n}\n\nfunc (x *SearchRequest) GetFilters() []SearchFilter {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Filters\n\t}\n\treturn nil\n}\n\nfunc (x *SearchRequest) SetQuery(v string) {\n\tx.xxx_hidden_Query = v\n}\n\nfunc (x *SearchRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *SearchRequest) SetPageToken(v uint32) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *SearchRequest) SetFilters(v []SearchFilter) {\n\tx.xxx_hidden_Filters = v\n}\n\ntype SearchRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The search string.\n\tQuery    string\n\tPageSize uint32\n\t// The first page is returned if this is 0.\n\tPageToken uint32\n\t// Empty list means show all. Supplying one or more enums will\n\t// limit the search to only the requested resources.\n\t// Supplying all possible enums is equivalent to empty list of filters.\n\tFilters []SearchFilter\n}\n\nfunc (b0 SearchRequest_builder) Build() *SearchRequest {\n\tm0 := &SearchRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Query = b.Query\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Filters = b.Filters\n\treturn m0\n}\n\ntype SearchResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_SearchResults *[]*SearchResult       `protobuf:\"bytes,1,rep,name=search_results,json=searchResults,proto3\"`\n\txxx_hidden_NextPageToken uint32                 `protobuf:\"varint,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *SearchResponse) Reset() {\n\t*x = SearchResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchResponse) ProtoMessage() {}\n\nfunc (x *SearchResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[12]\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\nfunc (x *SearchResponse) GetSearchResults() []*SearchResult {\n\tif x != nil {\n\t\tif x.xxx_hidden_SearchResults != nil {\n\t\t\treturn *x.xxx_hidden_SearchResults\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchResponse) GetNextPageToken() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn 0\n}\n\nfunc (x *SearchResponse) SetSearchResults(v []*SearchResult) {\n\tx.xxx_hidden_SearchResults = &v\n}\n\nfunc (x *SearchResponse) SetNextPageToken(v uint32) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype SearchResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tSearchResults []*SearchResult\n\t// There are no more pages if this is 0.\n\tNextPageToken uint32\n}\n\nfunc (b0 SearchResponse_builder) Build() *SearchResponse {\n\tm0 := &SearchResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_SearchResults = &b.SearchResults\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype SearchTagRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Query           string                 `protobuf:\"bytes,3,opt,name=query,proto3\"`\n\txxx_hidden_PageSize        uint32                 `protobuf:\"varint,4,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken       string                 `protobuf:\"bytes,5,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_OrderBy         OrderBy                `protobuf:\"varint,6,opt,name=order_by,json=orderBy,proto3,enum=buf.alpha.registry.v1alpha1.OrderBy\"`\n\txxx_hidden_Reverse         bool                   `protobuf:\"varint,7,opt,name=reverse,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *SearchTagRequest) Reset() {\n\t*x = SearchTagRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchTagRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchTagRequest) ProtoMessage() {}\n\nfunc (x *SearchTagRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[13]\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\nfunc (x *SearchTagRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchTagRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchTagRequest) GetQuery() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Query\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchTagRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *SearchTagRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchTagRequest) GetOrderBy() OrderBy {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrderBy\n\t}\n\treturn OrderBy_ORDER_BY_UNSPECIFIED\n}\n\nfunc (x *SearchTagRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *SearchTagRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *SearchTagRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *SearchTagRequest) SetQuery(v string) {\n\tx.xxx_hidden_Query = v\n}\n\nfunc (x *SearchTagRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *SearchTagRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *SearchTagRequest) SetOrderBy(v OrderBy) {\n\tx.xxx_hidden_OrderBy = v\n}\n\nfunc (x *SearchTagRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype SearchTagRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repository.\n\tRepositoryOwner string\n\t// The name of the repository.\n\tRepositoryName string\n\t// The search string.\n\tQuery    string\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\t// The field to order results by.\n\tOrderBy OrderBy\n\t// Reverse orders results in descending order.\n\tReverse bool\n}\n\nfunc (b0 SearchTagRequest_builder) Build() *SearchTagRequest {\n\tm0 := &SearchTagRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Query = b.Query\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_OrderBy = b.OrderBy\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype SearchTagResponse struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryTags *[]*RepositoryTag      `protobuf:\"bytes,1,rep,name=repository_tags,json=repositoryTags,proto3\"`\n\txxx_hidden_NextPageToken  string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *SearchTagResponse) Reset() {\n\t*x = SearchTagResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchTagResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchTagResponse) ProtoMessage() {}\n\nfunc (x *SearchTagResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[14]\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\nfunc (x *SearchTagResponse) GetRepositoryTags() []*RepositoryTag {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryTags != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryTags\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchTagResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchTagResponse) SetRepositoryTags(v []*RepositoryTag) {\n\tx.xxx_hidden_RepositoryTags = &v\n}\n\nfunc (x *SearchTagResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype SearchTagResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryTags []*RepositoryTag\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 SearchTagResponse_builder) Build() *SearchTagResponse {\n\tm0 := &SearchTagResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryTags = &b.RepositoryTags\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype SearchDraftRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Query           string                 `protobuf:\"bytes,3,opt,name=query,proto3\"`\n\txxx_hidden_PageSize        uint32                 `protobuf:\"varint,4,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken       string                 `protobuf:\"bytes,5,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_OrderBy         OrderBy                `protobuf:\"varint,6,opt,name=order_by,json=orderBy,proto3,enum=buf.alpha.registry.v1alpha1.OrderBy\"`\n\txxx_hidden_Reverse         bool                   `protobuf:\"varint,7,opt,name=reverse,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *SearchDraftRequest) Reset() {\n\t*x = SearchDraftRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchDraftRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchDraftRequest) ProtoMessage() {}\n\nfunc (x *SearchDraftRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[15]\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\nfunc (x *SearchDraftRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchDraftRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchDraftRequest) GetQuery() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Query\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchDraftRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *SearchDraftRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchDraftRequest) GetOrderBy() OrderBy {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrderBy\n\t}\n\treturn OrderBy_ORDER_BY_UNSPECIFIED\n}\n\nfunc (x *SearchDraftRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *SearchDraftRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *SearchDraftRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *SearchDraftRequest) SetQuery(v string) {\n\tx.xxx_hidden_Query = v\n}\n\nfunc (x *SearchDraftRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *SearchDraftRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *SearchDraftRequest) SetOrderBy(v OrderBy) {\n\tx.xxx_hidden_OrderBy = v\n}\n\nfunc (x *SearchDraftRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype SearchDraftRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The owner of the repository.\n\tRepositoryOwner string\n\t// The name of the repository.\n\tRepositoryName string\n\t// The search string.\n\tQuery    string\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\t// The field to order results by.\n\tOrderBy OrderBy\n\t// Reverse orders results in descending order.\n\tReverse bool\n}\n\nfunc (b0 SearchDraftRequest_builder) Build() *SearchDraftRequest {\n\tm0 := &SearchDraftRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Query = b.Query\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_OrderBy = b.OrderBy\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype SearchDraftResponse struct {\n\tstate                        protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryCommits *[]*RepositoryCommit   `protobuf:\"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3\"`\n\txxx_hidden_NextPageToken     string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields                protoimpl.UnknownFields\n\tsizeCache                    protoimpl.SizeCache\n}\n\nfunc (x *SearchDraftResponse) Reset() {\n\t*x = SearchDraftResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchDraftResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchDraftResponse) ProtoMessage() {}\n\nfunc (x *SearchDraftResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[16]\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\nfunc (x *SearchDraftResponse) GetRepositoryCommits() []*RepositoryCommit {\n\tif x != nil {\n\t\tif x.xxx_hidden_RepositoryCommits != nil {\n\t\t\treturn *x.xxx_hidden_RepositoryCommits\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchDraftResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchDraftResponse) SetRepositoryCommits(v []*RepositoryCommit) {\n\tx.xxx_hidden_RepositoryCommits = &v\n}\n\nfunc (x *SearchDraftResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype SearchDraftResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tRepositoryCommits []*RepositoryCommit\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 SearchDraftResponse_builder) Build() *SearchDraftResponse {\n\tm0 := &SearchDraftResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryCommits = &b.RepositoryCommits\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype SearchModuleContentRequest struct {\n\tstate                         protoimpl.MessageState      `protogen:\"opaque.v1\"`\n\txxx_hidden_Query              string                      `protobuf:\"bytes,1,opt,name=query,proto3\"`\n\txxx_hidden_PageSize           uint32                      `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken          uint32                      `protobuf:\"varint,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Filters            []SearchModuleContentFilter `protobuf:\"varint,4,rep,packed,name=filters,proto3,enum=buf.alpha.registry.v1alpha1.SearchModuleContentFilter\"`\n\txxx_hidden_RepositoryFullName string                      `protobuf:\"bytes,5,opt,name=repository_full_name,json=repositoryFullName,proto3\"`\n\txxx_hidden_RepositoryOwner    string                      `protobuf:\"bytes,6,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *SearchModuleContentRequest) Reset() {\n\t*x = SearchModuleContentRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchModuleContentRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchModuleContentRequest) ProtoMessage() {}\n\nfunc (x *SearchModuleContentRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[17]\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\nfunc (x *SearchModuleContentRequest) GetQuery() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Query\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchModuleContentRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *SearchModuleContentRequest) GetPageToken() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn 0\n}\n\nfunc (x *SearchModuleContentRequest) GetFilters() []SearchModuleContentFilter {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Filters\n\t}\n\treturn nil\n}\n\nfunc (x *SearchModuleContentRequest) GetRepositoryFullName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryFullName\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchModuleContentRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *SearchModuleContentRequest) SetQuery(v string) {\n\tx.xxx_hidden_Query = v\n}\n\nfunc (x *SearchModuleContentRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *SearchModuleContentRequest) SetPageToken(v uint32) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *SearchModuleContentRequest) SetFilters(v []SearchModuleContentFilter) {\n\tx.xxx_hidden_Filters = v\n}\n\nfunc (x *SearchModuleContentRequest) SetRepositoryFullName(v string) {\n\tx.xxx_hidden_RepositoryFullName = v\n}\n\nfunc (x *SearchModuleContentRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\ntype SearchModuleContentRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The search string.\n\tQuery    string\n\tPageSize uint32\n\t// The first page is returned if this is 0.\n\tPageToken uint32\n\t// Empty list means show all. Supplying one or more enums will\n\t// limit the search to only the requested resources.\n\t// Supplying all possible enums is equivalent to empty list of filters.\n\tFilters []SearchModuleContentFilter\n\t// Optional, if provided the search results will be limited to the provided repository.\n\tRepositoryFullName string\n\t// Optional, if provided the search results will be limited to the provided owner,\n\t// ignored if repository_full_name is provided.\n\tRepositoryOwner string\n}\n\nfunc (b0 SearchModuleContentRequest_builder) Build() *SearchModuleContentRequest {\n\tm0 := &SearchModuleContentRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Query = b.Query\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Filters = b.Filters\n\tx.xxx_hidden_RepositoryFullName = b.RepositoryFullName\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\treturn m0\n}\n\ntype SearchModuleContentResponse struct {\n\tstate                    protoimpl.MessageState        `protogen:\"opaque.v1\"`\n\txxx_hidden_SearchResults *[]*SearchModuleContentResult `protobuf:\"bytes,1,rep,name=search_results,json=searchResults,proto3\"`\n\txxx_hidden_NextPageToken uint32                        `protobuf:\"varint,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *SearchModuleContentResponse) Reset() {\n\t*x = SearchModuleContentResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SearchModuleContentResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SearchModuleContentResponse) ProtoMessage() {}\n\nfunc (x *SearchModuleContentResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[18]\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\nfunc (x *SearchModuleContentResponse) GetSearchResults() []*SearchModuleContentResult {\n\tif x != nil {\n\t\tif x.xxx_hidden_SearchResults != nil {\n\t\t\treturn *x.xxx_hidden_SearchResults\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SearchModuleContentResponse) GetNextPageToken() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn 0\n}\n\nfunc (x *SearchModuleContentResponse) SetSearchResults(v []*SearchModuleContentResult) {\n\tx.xxx_hidden_SearchResults = &v\n}\n\nfunc (x *SearchModuleContentResponse) SetNextPageToken(v uint32) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype SearchModuleContentResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tSearchResults []*SearchModuleContentResult\n\t// There are no more pages if this is 0.\n\tNextPageToken uint32\n}\n\nfunc (b0 SearchModuleContentResponse_builder) Build() *SearchModuleContentResponse {\n\tm0 := &SearchModuleContentResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_SearchResults = &b.SearchResults\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_search_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_search_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"(buf/alpha/registry/v1alpha1/search.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a%buf/alpha/registry/v1alpha1/doc.proto\\x1a1buf/alpha/registry/v1alpha1/plugin_curation.proto\\x1a,buf/alpha/registry/v1alpha1/repository.proto\\x1a3buf/alpha/registry/v1alpha1/repository_commit.proto\\x1a0buf/alpha/registry/v1alpha1/repository_tag.proto\\x1a5buf/alpha/registry/v1alpha1/verification_status.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xb9\\x03\\n\" +\n\t\"\\x16RepositorySearchResult\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x03 \\x01(\\tR\\x05owner\\x12G\\n\" +\n\t\"\\n\" +\n\t\"visibility\\x18\\x04 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.VisibilityR\\n\" +\n\t\"visibility\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x05 \\x01(\\bR\\n\" +\n\t\"deprecated\\x123\\n\" +\n\t\"\\x16latest_spdx_license_id\\x18\\x06 \\x01(\\tR\\x13latestSpdxLicenseId\\x12k\\n\" +\n\t\"\\x19owner_verification_status\\x18\\a \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.VerificationStatusR\\x17ownerVerificationStatus\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\b \\x01(\\tR\\x03url\\x12H\\n\" +\n\t\"\\x12latest_commit_time\\x18\\t \\x01(\\v2\\x1a.google.protobuf.TimestampR\\x10latestCommitTime\\\"{\\n\" +\n\t\"\\x18OrganizationSearchResult\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\\"\\x9d\\x01\\n\" +\n\t\"\\x10UserSearchResult\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x1a\\n\" +\n\t\"\\busername\\x18\\x02 \\x01(\\tR\\busername\\x12 \\n\" +\n\t\"\\vdeactivated\\x18\\x03 \\x01(\\bR\\vdeactivated\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x04 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\\"c\\n\" +\n\t\"\\x10TeamSearchResult\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12+\\n\" +\n\t\"\\x11organization_name\\x18\\x03 \\x01(\\tR\\x10organizationName\\\"\\x82\\x03\\n\" +\n\t\"\\x19CuratedPluginSearchResult\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x02 \\x01(\\tR\\x04name\\x12\\x14\\n\" +\n\t\"\\x05owner\\x18\\x03 \\x01(\\tR\\x05owner\\x12\\x1e\\n\" +\n\t\"\\n\" +\n\t\"deprecated\\x18\\x04 \\x01(\\bR\\n\" +\n\t\"deprecated\\x12 \\n\" +\n\t\"\\vdescription\\x18\\x05 \\x01(\\tR\\vdescription\\x12T\\n\" +\n\t\"\\rregistry_type\\x18\\x06 \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.PluginRegistryTypeR\\fregistryType\\x12V\\n\" +\n\t\"\\x10output_languages\\x18\\a \\x03(\\x0e2+.buf.alpha.registry.v1alpha1.PluginLanguageR\\x0foutputLanguages\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\b \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\\"\\x84\\x03\\n\" +\n\t\"\\x19ModuleElementSearchResult\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x02 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x03 \\x01(\\tR\\x0erepositoryName\\x12&\\n\" +\n\t\"\\x0fproto_file_path\\x18\\x04 \\x01(\\tR\\rprotoFilePath\\x120\\n\" +\n\t\"\\x14fully_qualified_name\\x18\\x05 \\x01(\\tR\\x12fullyQualifiedName\\x12!\\n\" +\n\t\"\\fpackage_name\\x18\\x06 \\x01(\\tR\\vpackageName\\x12q\\n\" +\n\t\"\\x1asearch_module_element_type\\x18\\a \\x01(\\x0e24.buf.alpha.registry.v1alpha1.SearchModuleElementTypeR\\x17searchModuleElementType\\\"\\xb9\\x01\\n\" +\n\t\"\\x16ModuleFileSearchResult\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x02 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x03 \\x01(\\tR\\x0erepositoryName\\x12&\\n\" +\n\t\"\\x0fproto_file_path\\x18\\x04 \\x01(\\tR\\rprotoFilePath\\\"\\x8c\\x05\\n\" +\n\t\"\\fSearchResult\\x12U\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x01 \\x01(\\v23.buf.alpha.registry.v1alpha1.RepositorySearchResultH\\x00R\\n\" +\n\t\"repository\\x12[\\n\" +\n\t\"\\forganization\\x18\\x02 \\x01(\\v25.buf.alpha.registry.v1alpha1.OrganizationSearchResultH\\x00R\\forganization\\x12C\\n\" +\n\t\"\\x04user\\x18\\x03 \\x01(\\v2-.buf.alpha.registry.v1alpha1.UserSearchResultH\\x00R\\x04user\\x12C\\n\" +\n\t\"\\x04team\\x18\\x04 \\x01(\\v2-.buf.alpha.registry.v1alpha1.TeamSearchResultH\\x00R\\x04team\\x12_\\n\" +\n\t\"\\x0ecurated_plugin\\x18\\a \\x01(\\v26.buf.alpha.registry.v1alpha1.CuratedPluginSearchResultH\\x00R\\rcuratedPlugin\\x12_\\n\" +\n\t\"\\x0emodule_element\\x18\\b \\x01(\\v26.buf.alpha.registry.v1alpha1.ModuleElementSearchResultH\\x00R\\rmoduleElement\\x12V\\n\" +\n\t\"\\vmodule_file\\x18\\t \\x01(\\v23.buf.alpha.registry.v1alpha1.ModuleFileSearchResultH\\x00R\\n\" +\n\t\"moduleFileB\\x06\\n\" +\n\t\"\\x04itemJ\\x04\\b\\x05\\x10\\x06J\\x04\\b\\x06\\x10\\aR\\x06pluginR\\btemplate\\\"\\xc5\\x04\\n\" +\n\t\"\\x13ElementSearchResult\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x02 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x03 \\x01(\\tR\\x0erepositoryName\\x12&\\n\" +\n\t\"\\x0fproto_file_path\\x18\\x04 \\x01(\\tR\\rprotoFilePath\\x120\\n\" +\n\t\"\\x14fully_qualified_name\\x18\\x05 \\x01(\\tR\\x12fullyQualifiedName\\x12@\\n\" +\n\t\"\\aservice\\x18\\x06 \\x01(\\v2$.buf.alpha.registry.v1alpha1.ServiceH\\x00R\\aservice\\x12=\\n\" +\n\t\"\\x06method\\x18\\a \\x01(\\v2#.buf.alpha.registry.v1alpha1.MethodH\\x00R\\x06method\\x127\\n\" +\n\t\"\\x04enum\\x18\\b \\x01(\\v2!.buf.alpha.registry.v1alpha1.EnumH\\x00R\\x04enum\\x12@\\n\" +\n\t\"\\amessage\\x18\\t \\x01(\\v2$.buf.alpha.registry.v1alpha1.MessageH\\x00R\\amessage\\x12S\\n\" +\n\t\"\\x0efile_extension\\x18\\n\" +\n\t\" \\x01(\\v2*.buf.alpha.registry.v1alpha1.FileExtensionH\\x00R\\rfileExtensionB\\n\" +\n\t\"\\n\" +\n\t\"\\bdocument\\\"\\xcd\\x01\\n\" +\n\t\"\\x10FileSearchResult\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x01 \\x01(\\tR\\frepositoryId\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x02 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x03 \\x01(\\tR\\x0erepositoryName\\x12&\\n\" +\n\t\"\\x0fproto_file_path\\x18\\x04 \\x01(\\tR\\rprotoFilePath\\x12\\x18\\n\" +\n\t\"\\acontent\\x18\\x05 \\x01(\\fR\\acontent\\\"\\xb6\\x01\\n\" +\n\t\"\\x19SearchModuleContentResult\\x12L\\n\" +\n\t\"\\aelement\\x18\\x01 \\x01(\\v20.buf.alpha.registry.v1alpha1.ElementSearchResultH\\x00R\\aelement\\x12C\\n\" +\n\t\"\\x04file\\x18\\x02 \\x01(\\v2-.buf.alpha.registry.v1alpha1.FileSearchResultH\\x00R\\x04fileB\\x06\\n\" +\n\t\"\\x04item\\\"\\xa6\\x01\\n\" +\n\t\"\\rSearchRequest\\x12\\x14\\n\" +\n\t\"\\x05query\\x18\\x01 \\x01(\\tR\\x05query\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\rR\\tpageToken\\x12C\\n\" +\n\t\"\\afilters\\x18\\x04 \\x03(\\x0e2).buf.alpha.registry.v1alpha1.SearchFilterR\\afilters\\\"\\x8a\\x01\\n\" +\n\t\"\\x0eSearchResponse\\x12P\\n\" +\n\t\"\\x0esearch_results\\x18\\x01 \\x03(\\v2).buf.alpha.registry.v1alpha1.SearchResultR\\rsearchResults\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\rR\\rnextPageToken\\\"\\x93\\x02\\n\" +\n\t\"\\x10SearchTagRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x14\\n\" +\n\t\"\\x05query\\x18\\x03 \\x01(\\tR\\x05query\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x04 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x05 \\x01(\\tR\\tpageToken\\x12?\\n\" +\n\t\"\\border_by\\x18\\x06 \\x01(\\x0e2$.buf.alpha.registry.v1alpha1.OrderByR\\aorderBy\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\a \\x01(\\bR\\areverse\\\"\\x90\\x01\\n\" +\n\t\"\\x11SearchTagResponse\\x12S\\n\" +\n\t\"\\x0frepository_tags\\x18\\x01 \\x03(\\v2*.buf.alpha.registry.v1alpha1.RepositoryTagR\\x0erepositoryTags\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x95\\x02\\n\" +\n\t\"\\x12SearchDraftRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x14\\n\" +\n\t\"\\x05query\\x18\\x03 \\x01(\\tR\\x05query\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x04 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x05 \\x01(\\tR\\tpageToken\\x12?\\n\" +\n\t\"\\border_by\\x18\\x06 \\x01(\\x0e2$.buf.alpha.registry.v1alpha1.OrderByR\\aorderBy\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\a \\x01(\\bR\\areverse\\\"\\x9b\\x01\\n\" +\n\t\"\\x13SearchDraftResponse\\x12\\\\\\n\" +\n\t\"\\x12repository_commits\\x18\\x01 \\x03(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x11repositoryCommits\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x9d\\x02\\n\" +\n\t\"\\x1aSearchModuleContentRequest\\x12\\x14\\n\" +\n\t\"\\x05query\\x18\\x01 \\x01(\\tR\\x05query\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\rR\\tpageToken\\x12P\\n\" +\n\t\"\\afilters\\x18\\x04 \\x03(\\x0e26.buf.alpha.registry.v1alpha1.SearchModuleContentFilterR\\afilters\\x120\\n\" +\n\t\"\\x14repository_full_name\\x18\\x05 \\x01(\\tR\\x12repositoryFullName\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x06 \\x01(\\tR\\x0frepositoryOwner\\\"\\xa4\\x01\\n\" +\n\t\"\\x1bSearchModuleContentResponse\\x12]\\n\" +\n\t\"\\x0esearch_results\\x18\\x01 \\x03(\\v26.buf.alpha.registry.v1alpha1.SearchModuleContentResultR\\rsearchResults\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\rR\\rnextPageToken*\\xb8\\x02\\n\" +\n\t\"\\fSearchFilter\\x12\\x1d\\n\" +\n\t\"\\x19SEARCH_FILTER_UNSPECIFIED\\x10\\x00\\x12\\x16\\n\" +\n\t\"\\x12SEARCH_FILTER_USER\\x10\\x01\\x12\\x1e\\n\" +\n\t\"\\x1aSEARCH_FILTER_ORGANIZATION\\x10\\x02\\x12\\x1c\\n\" +\n\t\"\\x18SEARCH_FILTER_REPOSITORY\\x10\\x03\\x12\\x16\\n\" +\n\t\"\\x12SEARCH_FILTER_TEAM\\x10\\x06\\x12 \\n\" +\n\t\"\\x1cSEARCH_FILTER_CURATED_PLUGIN\\x10\\a\\x12 \\n\" +\n\t\"\\x1cSEARCH_FILTER_MODULE_ELEMENT\\x10\\b\\x12\\x1d\\n\" +\n\t\"\\x19SEARCH_FILTER_MODULE_FILE\\x10\\t\\\"\\x04\\b\\x04\\x10\\x04\\\"\\x04\\b\\x05\\x10\\x05*\\x14SEARCH_FILTER_PLUGIN*\\x16SEARCH_FILTER_TEMPLATE*j\\n\" +\n\t\"\\aOrderBy\\x12\\x18\\n\" +\n\t\"\\x14ORDER_BY_UNSPECIFIED\\x10\\x00\\x12\\x18\\n\" +\n\t\"\\x14ORDER_BY_CREATE_TIME\\x10\\x01\\x12\\x18\\n\" +\n\t\"\\x14ORDER_BY_UPDATE_TIME\\x10\\x02\\x12\\x11\\n\" +\n\t\"\\rORDER_BY_NAME\\x10\\x03*\\xe1\\x01\\n\" +\n\t\"\\x17SearchModuleElementType\\x12*\\n\" +\n\t\"&SEARCH_MODULE_ELEMENT_TYPE_UNSPECIFIED\\x10\\x00\\x12&\\n\" +\n\t\"\\\"SEARCH_MODULE_ELEMENT_TYPE_SERVICE\\x10\\x01\\x12%\\n\" +\n\t\"!SEARCH_MODULE_ELEMENT_TYPE_METHOD\\x10\\x02\\x12&\\n\" +\n\t\"\\\"SEARCH_MODULE_ELEMENT_TYPE_MESSAGE\\x10\\x03\\x12#\\n\" +\n\t\"\\x1fSEARCH_MODULE_ELEMENT_TYPE_ENUM\\x10\\x04*\\x9a\\x01\\n\" +\n\t\"\\x19SearchModuleContentFilter\\x12,\\n\" +\n\t\"(SEARCH_MODULE_CONTENT_FILTER_UNSPECIFIED\\x10\\x00\\x12(\\n\" +\n\t\"$SEARCH_MODULE_CONTENT_FILTER_ELEMENT\\x10\\x01\\x12%\\n\" +\n\t\"!SEARCH_MODULE_CONTENT_FILTER_FILE\\x10\\x022\\xef\\x03\\n\" +\n\t\"\\rSearchService\\x12f\\n\" +\n\t\"\\x06Search\\x12*.buf.alpha.registry.v1alpha1.SearchRequest\\x1a+.buf.alpha.registry.v1alpha1.SearchResponse\\\"\\x03\\x90\\x02\\x01\\x12o\\n\" +\n\t\"\\tSearchTag\\x12-.buf.alpha.registry.v1alpha1.SearchTagRequest\\x1a..buf.alpha.registry.v1alpha1.SearchTagResponse\\\"\\x03\\x90\\x02\\x01\\x12u\\n\" +\n\t\"\\vSearchDraft\\x12/.buf.alpha.registry.v1alpha1.SearchDraftRequest\\x1a0.buf.alpha.registry.v1alpha1.SearchDraftResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8d\\x01\\n\" +\n\t\"\\x13SearchModuleContent\\x127.buf.alpha.registry.v1alpha1.SearchModuleContentRequest\\x1a8.buf.alpha.registry.v1alpha1.SearchModuleContentResponse\\\"\\x03\\x90\\x02\\x01B\\x98\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\vSearchProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_search_proto_enumTypes = make([]protoimpl.EnumInfo, 4)\nvar file_buf_alpha_registry_v1alpha1_search_proto_msgTypes = make([]protoimpl.MessageInfo, 19)\nvar file_buf_alpha_registry_v1alpha1_search_proto_goTypes = []any{\n\t(SearchFilter)(0),                   // 0: buf.alpha.registry.v1alpha1.SearchFilter\n\t(OrderBy)(0),                        // 1: buf.alpha.registry.v1alpha1.OrderBy\n\t(SearchModuleElementType)(0),        // 2: buf.alpha.registry.v1alpha1.SearchModuleElementType\n\t(SearchModuleContentFilter)(0),      // 3: buf.alpha.registry.v1alpha1.SearchModuleContentFilter\n\t(*RepositorySearchResult)(nil),      // 4: buf.alpha.registry.v1alpha1.RepositorySearchResult\n\t(*OrganizationSearchResult)(nil),    // 5: buf.alpha.registry.v1alpha1.OrganizationSearchResult\n\t(*UserSearchResult)(nil),            // 6: buf.alpha.registry.v1alpha1.UserSearchResult\n\t(*TeamSearchResult)(nil),            // 7: buf.alpha.registry.v1alpha1.TeamSearchResult\n\t(*CuratedPluginSearchResult)(nil),   // 8: buf.alpha.registry.v1alpha1.CuratedPluginSearchResult\n\t(*ModuleElementSearchResult)(nil),   // 9: buf.alpha.registry.v1alpha1.ModuleElementSearchResult\n\t(*ModuleFileSearchResult)(nil),      // 10: buf.alpha.registry.v1alpha1.ModuleFileSearchResult\n\t(*SearchResult)(nil),                // 11: buf.alpha.registry.v1alpha1.SearchResult\n\t(*ElementSearchResult)(nil),         // 12: buf.alpha.registry.v1alpha1.ElementSearchResult\n\t(*FileSearchResult)(nil),            // 13: buf.alpha.registry.v1alpha1.FileSearchResult\n\t(*SearchModuleContentResult)(nil),   // 14: buf.alpha.registry.v1alpha1.SearchModuleContentResult\n\t(*SearchRequest)(nil),               // 15: buf.alpha.registry.v1alpha1.SearchRequest\n\t(*SearchResponse)(nil),              // 16: buf.alpha.registry.v1alpha1.SearchResponse\n\t(*SearchTagRequest)(nil),            // 17: buf.alpha.registry.v1alpha1.SearchTagRequest\n\t(*SearchTagResponse)(nil),           // 18: buf.alpha.registry.v1alpha1.SearchTagResponse\n\t(*SearchDraftRequest)(nil),          // 19: buf.alpha.registry.v1alpha1.SearchDraftRequest\n\t(*SearchDraftResponse)(nil),         // 20: buf.alpha.registry.v1alpha1.SearchDraftResponse\n\t(*SearchModuleContentRequest)(nil),  // 21: buf.alpha.registry.v1alpha1.SearchModuleContentRequest\n\t(*SearchModuleContentResponse)(nil), // 22: buf.alpha.registry.v1alpha1.SearchModuleContentResponse\n\t(Visibility)(0),                     // 23: buf.alpha.registry.v1alpha1.Visibility\n\t(VerificationStatus)(0),             // 24: buf.alpha.registry.v1alpha1.VerificationStatus\n\t(*timestamppb.Timestamp)(nil),       // 25: google.protobuf.Timestamp\n\t(PluginRegistryType)(0),             // 26: buf.alpha.registry.v1alpha1.PluginRegistryType\n\t(PluginLanguage)(0),                 // 27: buf.alpha.registry.v1alpha1.PluginLanguage\n\t(*Service)(nil),                     // 28: buf.alpha.registry.v1alpha1.Service\n\t(*Method)(nil),                      // 29: buf.alpha.registry.v1alpha1.Method\n\t(*Enum)(nil),                        // 30: buf.alpha.registry.v1alpha1.Enum\n\t(*Message)(nil),                     // 31: buf.alpha.registry.v1alpha1.Message\n\t(*FileExtension)(nil),               // 32: buf.alpha.registry.v1alpha1.FileExtension\n\t(*RepositoryTag)(nil),               // 33: buf.alpha.registry.v1alpha1.RepositoryTag\n\t(*RepositoryCommit)(nil),            // 34: buf.alpha.registry.v1alpha1.RepositoryCommit\n}\nvar file_buf_alpha_registry_v1alpha1_search_proto_depIdxs = []int32{\n\t23, // 0: buf.alpha.registry.v1alpha1.RepositorySearchResult.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility\n\t24, // 1: buf.alpha.registry.v1alpha1.RepositorySearchResult.owner_verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus\n\t25, // 2: buf.alpha.registry.v1alpha1.RepositorySearchResult.latest_commit_time:type_name -> google.protobuf.Timestamp\n\t25, // 3: buf.alpha.registry.v1alpha1.OrganizationSearchResult.create_time:type_name -> google.protobuf.Timestamp\n\t25, // 4: buf.alpha.registry.v1alpha1.UserSearchResult.create_time:type_name -> google.protobuf.Timestamp\n\t26, // 5: buf.alpha.registry.v1alpha1.CuratedPluginSearchResult.registry_type:type_name -> buf.alpha.registry.v1alpha1.PluginRegistryType\n\t27, // 6: buf.alpha.registry.v1alpha1.CuratedPluginSearchResult.output_languages:type_name -> buf.alpha.registry.v1alpha1.PluginLanguage\n\t25, // 7: buf.alpha.registry.v1alpha1.CuratedPluginSearchResult.create_time:type_name -> google.protobuf.Timestamp\n\t2,  // 8: buf.alpha.registry.v1alpha1.ModuleElementSearchResult.search_module_element_type:type_name -> buf.alpha.registry.v1alpha1.SearchModuleElementType\n\t4,  // 9: buf.alpha.registry.v1alpha1.SearchResult.repository:type_name -> buf.alpha.registry.v1alpha1.RepositorySearchResult\n\t5,  // 10: buf.alpha.registry.v1alpha1.SearchResult.organization:type_name -> buf.alpha.registry.v1alpha1.OrganizationSearchResult\n\t6,  // 11: buf.alpha.registry.v1alpha1.SearchResult.user:type_name -> buf.alpha.registry.v1alpha1.UserSearchResult\n\t7,  // 12: buf.alpha.registry.v1alpha1.SearchResult.team:type_name -> buf.alpha.registry.v1alpha1.TeamSearchResult\n\t8,  // 13: buf.alpha.registry.v1alpha1.SearchResult.curated_plugin:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginSearchResult\n\t9,  // 14: buf.alpha.registry.v1alpha1.SearchResult.module_element:type_name -> buf.alpha.registry.v1alpha1.ModuleElementSearchResult\n\t10, // 15: buf.alpha.registry.v1alpha1.SearchResult.module_file:type_name -> buf.alpha.registry.v1alpha1.ModuleFileSearchResult\n\t28, // 16: buf.alpha.registry.v1alpha1.ElementSearchResult.service:type_name -> buf.alpha.registry.v1alpha1.Service\n\t29, // 17: buf.alpha.registry.v1alpha1.ElementSearchResult.method:type_name -> buf.alpha.registry.v1alpha1.Method\n\t30, // 18: buf.alpha.registry.v1alpha1.ElementSearchResult.enum:type_name -> buf.alpha.registry.v1alpha1.Enum\n\t31, // 19: buf.alpha.registry.v1alpha1.ElementSearchResult.message:type_name -> buf.alpha.registry.v1alpha1.Message\n\t32, // 20: buf.alpha.registry.v1alpha1.ElementSearchResult.file_extension:type_name -> buf.alpha.registry.v1alpha1.FileExtension\n\t12, // 21: buf.alpha.registry.v1alpha1.SearchModuleContentResult.element:type_name -> buf.alpha.registry.v1alpha1.ElementSearchResult\n\t13, // 22: buf.alpha.registry.v1alpha1.SearchModuleContentResult.file:type_name -> buf.alpha.registry.v1alpha1.FileSearchResult\n\t0,  // 23: buf.alpha.registry.v1alpha1.SearchRequest.filters:type_name -> buf.alpha.registry.v1alpha1.SearchFilter\n\t11, // 24: buf.alpha.registry.v1alpha1.SearchResponse.search_results:type_name -> buf.alpha.registry.v1alpha1.SearchResult\n\t1,  // 25: buf.alpha.registry.v1alpha1.SearchTagRequest.order_by:type_name -> buf.alpha.registry.v1alpha1.OrderBy\n\t33, // 26: buf.alpha.registry.v1alpha1.SearchTagResponse.repository_tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag\n\t1,  // 27: buf.alpha.registry.v1alpha1.SearchDraftRequest.order_by:type_name -> buf.alpha.registry.v1alpha1.OrderBy\n\t34, // 28: buf.alpha.registry.v1alpha1.SearchDraftResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t3,  // 29: buf.alpha.registry.v1alpha1.SearchModuleContentRequest.filters:type_name -> buf.alpha.registry.v1alpha1.SearchModuleContentFilter\n\t14, // 30: buf.alpha.registry.v1alpha1.SearchModuleContentResponse.search_results:type_name -> buf.alpha.registry.v1alpha1.SearchModuleContentResult\n\t15, // 31: buf.alpha.registry.v1alpha1.SearchService.Search:input_type -> buf.alpha.registry.v1alpha1.SearchRequest\n\t17, // 32: buf.alpha.registry.v1alpha1.SearchService.SearchTag:input_type -> buf.alpha.registry.v1alpha1.SearchTagRequest\n\t19, // 33: buf.alpha.registry.v1alpha1.SearchService.SearchDraft:input_type -> buf.alpha.registry.v1alpha1.SearchDraftRequest\n\t21, // 34: buf.alpha.registry.v1alpha1.SearchService.SearchModuleContent:input_type -> buf.alpha.registry.v1alpha1.SearchModuleContentRequest\n\t16, // 35: buf.alpha.registry.v1alpha1.SearchService.Search:output_type -> buf.alpha.registry.v1alpha1.SearchResponse\n\t18, // 36: buf.alpha.registry.v1alpha1.SearchService.SearchTag:output_type -> buf.alpha.registry.v1alpha1.SearchTagResponse\n\t20, // 37: buf.alpha.registry.v1alpha1.SearchService.SearchDraft:output_type -> buf.alpha.registry.v1alpha1.SearchDraftResponse\n\t22, // 38: buf.alpha.registry.v1alpha1.SearchService.SearchModuleContent:output_type -> buf.alpha.registry.v1alpha1.SearchModuleContentResponse\n\t35, // [35:39] is the sub-list for method output_type\n\t31, // [31:35] 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_buf_alpha_registry_v1alpha1_search_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_search_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_search_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_doc_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_plugin_curation_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_commit_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_repository_tag_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_verification_status_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_search_proto_msgTypes[7].OneofWrappers = []any{\n\t\t(*searchResult_Repository)(nil),\n\t\t(*searchResult_Organization)(nil),\n\t\t(*searchResult_User)(nil),\n\t\t(*searchResult_Team)(nil),\n\t\t(*searchResult_CuratedPlugin)(nil),\n\t\t(*searchResult_ModuleElement)(nil),\n\t\t(*searchResult_ModuleFile)(nil),\n\t}\n\tfile_buf_alpha_registry_v1alpha1_search_proto_msgTypes[8].OneofWrappers = []any{\n\t\t(*elementSearchResult_Service)(nil),\n\t\t(*elementSearchResult_Method)(nil),\n\t\t(*elementSearchResult_Enum)(nil),\n\t\t(*elementSearchResult_Message)(nil),\n\t\t(*elementSearchResult_FileExtension)(nil),\n\t}\n\tfile_buf_alpha_registry_v1alpha1_search_proto_msgTypes[10].OneofWrappers = []any{\n\t\t(*searchModuleContentResult_Element)(nil),\n\t\t(*searchModuleContentResult_File)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_registry_v1alpha1_search_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_search_proto_rawDesc)),\n\t\t\tNumEnums:      4,\n\t\t\tNumMessages:   19,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_search_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_search_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_search_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_search_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_search_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_search_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_search_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/studio.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/studio.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// The protocols supported by Studio agent.\ntype StudioAgentProtocol int32\n\nconst (\n\tStudioAgentProtocol_STUDIO_AGENT_PROTOCOL_UNSPECIFIED StudioAgentProtocol = 0\n\tStudioAgentProtocol_STUDIO_AGENT_PROTOCOL_GRPC        StudioAgentProtocol = 1\n\tStudioAgentProtocol_STUDIO_AGENT_PROTOCOL_CONNECT     StudioAgentProtocol = 2\n)\n\n// Enum value maps for StudioAgentProtocol.\nvar (\n\tStudioAgentProtocol_name = map[int32]string{\n\t\t0: \"STUDIO_AGENT_PROTOCOL_UNSPECIFIED\",\n\t\t1: \"STUDIO_AGENT_PROTOCOL_GRPC\",\n\t\t2: \"STUDIO_AGENT_PROTOCOL_CONNECT\",\n\t}\n\tStudioAgentProtocol_value = map[string]int32{\n\t\t\"STUDIO_AGENT_PROTOCOL_UNSPECIFIED\": 0,\n\t\t\"STUDIO_AGENT_PROTOCOL_GRPC\":        1,\n\t\t\"STUDIO_AGENT_PROTOCOL_CONNECT\":     2,\n\t}\n)\n\nfunc (x StudioAgentProtocol) Enum() *StudioAgentProtocol {\n\tp := new(StudioAgentProtocol)\n\t*p = x\n\treturn p\n}\n\nfunc (x StudioAgentProtocol) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (StudioAgentProtocol) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes[0].Descriptor()\n}\n\nfunc (StudioAgentProtocol) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes[0]\n}\n\nfunc (x StudioAgentProtocol) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// StudioAgentPreset is the information about an agent preset in the Studio.\ntype StudioAgentPreset struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Url       string                 `protobuf:\"bytes,1,opt,name=url,proto3\"`\n\txxx_hidden_Alias     string                 `protobuf:\"bytes,2,opt,name=alias,proto3\"`\n\txxx_hidden_Protocol  StudioAgentProtocol    `protobuf:\"varint,3,opt,name=protocol,proto3,enum=buf.alpha.registry.v1alpha1.StudioAgentProtocol\"`\n\txxx_hidden_TargetUrl string                 `protobuf:\"bytes,4,opt,name=target_url,json=targetUrl,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *StudioAgentPreset) Reset() {\n\t*x = StudioAgentPreset{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *StudioAgentPreset) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StudioAgentPreset) ProtoMessage() {}\n\nfunc (x *StudioAgentPreset) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_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\nfunc (x *StudioAgentPreset) GetUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Url\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioAgentPreset) GetAlias() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Alias\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioAgentPreset) GetProtocol() StudioAgentProtocol {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Protocol\n\t}\n\treturn StudioAgentProtocol_STUDIO_AGENT_PROTOCOL_UNSPECIFIED\n}\n\nfunc (x *StudioAgentPreset) GetTargetUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TargetUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioAgentPreset) SetUrl(v string) {\n\tx.xxx_hidden_Url = v\n}\n\nfunc (x *StudioAgentPreset) SetAlias(v string) {\n\tx.xxx_hidden_Alias = v\n}\n\nfunc (x *StudioAgentPreset) SetProtocol(v StudioAgentProtocol) {\n\tx.xxx_hidden_Protocol = v\n}\n\nfunc (x *StudioAgentPreset) SetTargetUrl(v string) {\n\tx.xxx_hidden_TargetUrl = v\n}\n\ntype StudioAgentPreset_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The agent URL in the Studio.\n\tUrl string\n\t// The optional alias of the agent URL.\n\tAlias string\n\t// The protocol the agent should use to forward requests.\n\tProtocol StudioAgentProtocol\n\t// The URL of the target host.\n\tTargetUrl string\n}\n\nfunc (b0 StudioAgentPreset_builder) Build() *StudioAgentPreset {\n\tm0 := &StudioAgentPreset{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Url = b.Url\n\tx.xxx_hidden_Alias = b.Alias\n\tx.xxx_hidden_Protocol = b.Protocol\n\tx.xxx_hidden_TargetUrl = b.TargetUrl\n\treturn m0\n}\n\ntype ListStudioAgentPresetsRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *ListStudioAgentPresetsRequest) Reset() {\n\t*x = ListStudioAgentPresetsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListStudioAgentPresetsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListStudioAgentPresetsRequest) ProtoMessage() {}\n\nfunc (x *ListStudioAgentPresetsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_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\ntype ListStudioAgentPresetsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 ListStudioAgentPresetsRequest_builder) Build() *ListStudioAgentPresetsRequest {\n\tm0 := &ListStudioAgentPresetsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype ListStudioAgentPresetsResponse struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Agents *[]*StudioAgentPreset  `protobuf:\"bytes,1,rep,name=agents,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *ListStudioAgentPresetsResponse) Reset() {\n\t*x = ListStudioAgentPresetsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListStudioAgentPresetsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListStudioAgentPresetsResponse) ProtoMessage() {}\n\nfunc (x *ListStudioAgentPresetsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_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\nfunc (x *ListStudioAgentPresetsResponse) GetAgents() []*StudioAgentPreset {\n\tif x != nil {\n\t\tif x.xxx_hidden_Agents != nil {\n\t\t\treturn *x.xxx_hidden_Agents\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListStudioAgentPresetsResponse) SetAgents(v []*StudioAgentPreset) {\n\tx.xxx_hidden_Agents = &v\n}\n\ntype ListStudioAgentPresetsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAgents []*StudioAgentPreset\n}\n\nfunc (b0 ListStudioAgentPresetsResponse_builder) Build() *ListStudioAgentPresetsResponse {\n\tm0 := &ListStudioAgentPresetsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Agents = &b.Agents\n\treturn m0\n}\n\ntype SetStudioAgentPresetsRequest struct {\n\tstate             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Agents *[]*StudioAgentPreset  `protobuf:\"bytes,1,rep,name=agents,proto3\"`\n\tunknownFields     protoimpl.UnknownFields\n\tsizeCache         protoimpl.SizeCache\n}\n\nfunc (x *SetStudioAgentPresetsRequest) Reset() {\n\t*x = SetStudioAgentPresetsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SetStudioAgentPresetsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SetStudioAgentPresetsRequest) ProtoMessage() {}\n\nfunc (x *SetStudioAgentPresetsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_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\nfunc (x *SetStudioAgentPresetsRequest) GetAgents() []*StudioAgentPreset {\n\tif x != nil {\n\t\tif x.xxx_hidden_Agents != nil {\n\t\t\treturn *x.xxx_hidden_Agents\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *SetStudioAgentPresetsRequest) SetAgents(v []*StudioAgentPreset) {\n\tx.xxx_hidden_Agents = &v\n}\n\ntype SetStudioAgentPresetsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tAgents []*StudioAgentPreset\n}\n\nfunc (b0 SetStudioAgentPresetsRequest_builder) Build() *SetStudioAgentPresetsRequest {\n\tm0 := &SetStudioAgentPresetsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Agents = &b.Agents\n\treturn m0\n}\n\ntype SetStudioAgentPresetsResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *SetStudioAgentPresetsResponse) Reset() {\n\t*x = SetStudioAgentPresetsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *SetStudioAgentPresetsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*SetStudioAgentPresetsResponse) ProtoMessage() {}\n\nfunc (x *SetStudioAgentPresetsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_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\ntype SetStudioAgentPresetsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 SetStudioAgentPresetsResponse_builder) Build() *SetStudioAgentPresetsResponse {\n\tm0 := &SetStudioAgentPresetsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_studio_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_studio_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"(buf/alpha/registry/v1alpha1/studio.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\\"\\xa8\\x01\\n\" +\n\t\"\\x11StudioAgentPreset\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\x01 \\x01(\\tR\\x03url\\x12\\x14\\n\" +\n\t\"\\x05alias\\x18\\x02 \\x01(\\tR\\x05alias\\x12L\\n\" +\n\t\"\\bprotocol\\x18\\x03 \\x01(\\x0e20.buf.alpha.registry.v1alpha1.StudioAgentProtocolR\\bprotocol\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"target_url\\x18\\x04 \\x01(\\tR\\ttargetUrl\\\"\\x1f\\n\" +\n\t\"\\x1dListStudioAgentPresetsRequest\\\"h\\n\" +\n\t\"\\x1eListStudioAgentPresetsResponse\\x12F\\n\" +\n\t\"\\x06agents\\x18\\x01 \\x03(\\v2..buf.alpha.registry.v1alpha1.StudioAgentPresetR\\x06agents\\\"f\\n\" +\n\t\"\\x1cSetStudioAgentPresetsRequest\\x12F\\n\" +\n\t\"\\x06agents\\x18\\x01 \\x03(\\v2..buf.alpha.registry.v1alpha1.StudioAgentPresetR\\x06agents\\\"\\x1f\\n\" +\n\t\"\\x1dSetStudioAgentPresetsResponse*\\x7f\\n\" +\n\t\"\\x13StudioAgentProtocol\\x12%\\n\" +\n\t\"!STUDIO_AGENT_PROTOCOL_UNSPECIFIED\\x10\\x00\\x12\\x1e\\n\" +\n\t\"\\x1aSTUDIO_AGENT_PROTOCOL_GRPC\\x10\\x01\\x12!\\n\" +\n\t\"\\x1dSTUDIO_AGENT_PROTOCOL_CONNECT\\x10\\x022\\xb9\\x02\\n\" +\n\t\"\\rStudioService\\x12\\x96\\x01\\n\" +\n\t\"\\x16ListStudioAgentPresets\\x12:.buf.alpha.registry.v1alpha1.ListStudioAgentPresetsRequest\\x1a;.buf.alpha.registry.v1alpha1.ListStudioAgentPresetsResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x8e\\x01\\n\" +\n\t\"\\x15SetStudioAgentPresets\\x129.buf.alpha.registry.v1alpha1.SetStudioAgentPresetsRequest\\x1a:.buf.alpha.registry.v1alpha1.SetStudioAgentPresetsResponseB\\x98\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\vStudioProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes = make([]protoimpl.MessageInfo, 5)\nvar file_buf_alpha_registry_v1alpha1_studio_proto_goTypes = []any{\n\t(StudioAgentProtocol)(0),               // 0: buf.alpha.registry.v1alpha1.StudioAgentProtocol\n\t(*StudioAgentPreset)(nil),              // 1: buf.alpha.registry.v1alpha1.StudioAgentPreset\n\t(*ListStudioAgentPresetsRequest)(nil),  // 2: buf.alpha.registry.v1alpha1.ListStudioAgentPresetsRequest\n\t(*ListStudioAgentPresetsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.ListStudioAgentPresetsResponse\n\t(*SetStudioAgentPresetsRequest)(nil),   // 4: buf.alpha.registry.v1alpha1.SetStudioAgentPresetsRequest\n\t(*SetStudioAgentPresetsResponse)(nil),  // 5: buf.alpha.registry.v1alpha1.SetStudioAgentPresetsResponse\n}\nvar file_buf_alpha_registry_v1alpha1_studio_proto_depIdxs = []int32{\n\t0, // 0: buf.alpha.registry.v1alpha1.StudioAgentPreset.protocol:type_name -> buf.alpha.registry.v1alpha1.StudioAgentProtocol\n\t1, // 1: buf.alpha.registry.v1alpha1.ListStudioAgentPresetsResponse.agents:type_name -> buf.alpha.registry.v1alpha1.StudioAgentPreset\n\t1, // 2: buf.alpha.registry.v1alpha1.SetStudioAgentPresetsRequest.agents:type_name -> buf.alpha.registry.v1alpha1.StudioAgentPreset\n\t2, // 3: buf.alpha.registry.v1alpha1.StudioService.ListStudioAgentPresets:input_type -> buf.alpha.registry.v1alpha1.ListStudioAgentPresetsRequest\n\t4, // 4: buf.alpha.registry.v1alpha1.StudioService.SetStudioAgentPresets:input_type -> buf.alpha.registry.v1alpha1.SetStudioAgentPresetsRequest\n\t3, // 5: buf.alpha.registry.v1alpha1.StudioService.ListStudioAgentPresets:output_type -> buf.alpha.registry.v1alpha1.ListStudioAgentPresetsResponse\n\t5, // 6: buf.alpha.registry.v1alpha1.StudioService.SetStudioAgentPresets:output_type -> buf.alpha.registry.v1alpha1.SetStudioAgentPresetsResponse\n\t5, // [5:7] is the sub-list for method output_type\n\t3, // [3:5] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_studio_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_studio_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_studio_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_buf_alpha_registry_v1alpha1_studio_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_studio_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   5,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_studio_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_studio_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_studio_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_studio_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_studio_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/studio_request.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/studio_request.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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\n// StudioProtocol are the supported protocols for Studio Requests.\ntype StudioProtocol int32\n\nconst (\n\t// STUDIO_PROTOCOL_UNSPECIFIED is a safe default for requests with no protocol\n\t// defined.\n\tStudioProtocol_STUDIO_PROTOCOL_UNSPECIFIED StudioProtocol = 0\n\t// STUDIO_PROTOCOL_CONNECT is the Connect protocol in Studio.\n\tStudioProtocol_STUDIO_PROTOCOL_CONNECT StudioProtocol = 1\n\t// STUDIO_PROTOCOL_GRPC is the gRPC protocol in Studio.\n\tStudioProtocol_STUDIO_PROTOCOL_GRPC StudioProtocol = 2\n\t// STUDIO_PROTOCOL_GRPC_WEB is the gRPC-web protocol in Studio.\n\tStudioProtocol_STUDIO_PROTOCOL_GRPC_WEB StudioProtocol = 3\n)\n\n// Enum value maps for StudioProtocol.\nvar (\n\tStudioProtocol_name = map[int32]string{\n\t\t0: \"STUDIO_PROTOCOL_UNSPECIFIED\",\n\t\t1: \"STUDIO_PROTOCOL_CONNECT\",\n\t\t2: \"STUDIO_PROTOCOL_GRPC\",\n\t\t3: \"STUDIO_PROTOCOL_GRPC_WEB\",\n\t}\n\tStudioProtocol_value = map[string]int32{\n\t\t\"STUDIO_PROTOCOL_UNSPECIFIED\": 0,\n\t\t\"STUDIO_PROTOCOL_CONNECT\":     1,\n\t\t\"STUDIO_PROTOCOL_GRPC\":        2,\n\t\t\"STUDIO_PROTOCOL_GRPC_WEB\":    3,\n\t}\n)\n\nfunc (x StudioProtocol) Enum() *StudioProtocol {\n\tp := new(StudioProtocol)\n\t*p = x\n\treturn p\n}\n\nfunc (x StudioProtocol) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (StudioProtocol) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes[0].Descriptor()\n}\n\nfunc (StudioProtocol) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes[0]\n}\n\nfunc (x StudioProtocol) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// CreateStudioRequestRequest is the proto request representation of the\n// CreateStudioRequest method.\ntype CreateStudioRequestRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,2,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Name            string                 `protobuf:\"bytes,3,opt,name=name,proto3\"`\n\txxx_hidden_TargetBaseUrl   string                 `protobuf:\"bytes,4,opt,name=target_base_url,json=targetBaseUrl,proto3\"`\n\txxx_hidden_Service         string                 `protobuf:\"bytes,5,opt,name=service,proto3\"`\n\txxx_hidden_Method          string                 `protobuf:\"bytes,6,opt,name=method,proto3\"`\n\txxx_hidden_Body            string                 `protobuf:\"bytes,7,opt,name=body,proto3\"`\n\txxx_hidden_Headers         map[string]string      `protobuf:\"bytes,8,rep,name=headers,proto3\" protobuf_key:\"bytes,1,opt,name=key\" protobuf_val:\"bytes,2,opt,name=value\"`\n\txxx_hidden_IncludeCookies  bool                   `protobuf:\"varint,9,opt,name=include_cookies,json=includeCookies,proto3\"`\n\txxx_hidden_Protocol        StudioProtocol         `protobuf:\"varint,10,opt,name=protocol,proto3,enum=buf.alpha.registry.v1alpha1.StudioProtocol\"`\n\txxx_hidden_AgentUrl        string                 `protobuf:\"bytes,11,opt,name=agent_url,json=agentUrl,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *CreateStudioRequestRequest) Reset() {\n\t*x = CreateStudioRequestRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateStudioRequestRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateStudioRequestRequest) ProtoMessage() {}\n\nfunc (x *CreateStudioRequestRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\nfunc (x *CreateStudioRequestRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) GetTargetBaseUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TargetBaseUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) GetService() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Service\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) GetMethod() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Method\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) GetBody() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Body\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) GetHeaders() map[string]string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Headers\n\t}\n\treturn nil\n}\n\nfunc (x *CreateStudioRequestRequest) GetIncludeCookies() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeCookies\n\t}\n\treturn false\n}\n\nfunc (x *CreateStudioRequestRequest) GetProtocol() StudioProtocol {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Protocol\n\t}\n\treturn StudioProtocol_STUDIO_PROTOCOL_UNSPECIFIED\n}\n\nfunc (x *CreateStudioRequestRequest) GetAgentUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AgentUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateStudioRequestRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetTargetBaseUrl(v string) {\n\tx.xxx_hidden_TargetBaseUrl = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetService(v string) {\n\tx.xxx_hidden_Service = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetMethod(v string) {\n\tx.xxx_hidden_Method = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetBody(v string) {\n\tx.xxx_hidden_Body = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetHeaders(v map[string]string) {\n\tx.xxx_hidden_Headers = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetIncludeCookies(v bool) {\n\tx.xxx_hidden_IncludeCookies = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetProtocol(v StudioProtocol) {\n\tx.xxx_hidden_Protocol = v\n}\n\nfunc (x *CreateStudioRequestRequest) SetAgentUrl(v string) {\n\tx.xxx_hidden_AgentUrl = v\n}\n\ntype CreateStudioRequestRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The linked BSR repository owner name (user or organization).\n\tRepositoryOwner string\n\t// The linked BSR repository name.\n\tRepositoryName string\n\t// The friendly name of this request.\n\tName string\n\t// The target base URL of this request.\n\tTargetBaseUrl string\n\t// The target service name as defined in the BSR repository.\n\tService string\n\t// The target RPC method name as defined in the BSR repository.\n\tMethod string\n\t// The request body as defined in Studio.\n\tBody string\n\t// The request headers as defined in Studio.\n\tHeaders map[string]string\n\t// Should this request include cookies from the Studio current session?\n\tIncludeCookies bool\n\t// The protocol that Studio uses to send this request.\n\tProtocol StudioProtocol\n\t// The agent url (if any) used by Studio to send the request. See\n\t// https://docs.buf.build/bsr/studio#via-buf-studio-agent for details.\n\tAgentUrl string\n}\n\nfunc (b0 CreateStudioRequestRequest_builder) Build() *CreateStudioRequestRequest {\n\tm0 := &CreateStudioRequestRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_TargetBaseUrl = b.TargetBaseUrl\n\tx.xxx_hidden_Service = b.Service\n\tx.xxx_hidden_Method = b.Method\n\tx.xxx_hidden_Body = b.Body\n\tx.xxx_hidden_Headers = b.Headers\n\tx.xxx_hidden_IncludeCookies = b.IncludeCookies\n\tx.xxx_hidden_Protocol = b.Protocol\n\tx.xxx_hidden_AgentUrl = b.AgentUrl\n\treturn m0\n}\n\n// CreateStudioRequestResponse returns the created StudioRequest.\ntype CreateStudioRequestResponse struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_CreatedRequest *StudioRequest         `protobuf:\"bytes,1,opt,name=created_request,json=createdRequest,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *CreateStudioRequestResponse) Reset() {\n\t*x = CreateStudioRequestResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateStudioRequestResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateStudioRequestResponse) ProtoMessage() {}\n\nfunc (x *CreateStudioRequestResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\nfunc (x *CreateStudioRequestResponse) GetCreatedRequest() *StudioRequest {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreatedRequest\n\t}\n\treturn nil\n}\n\nfunc (x *CreateStudioRequestResponse) SetCreatedRequest(v *StudioRequest) {\n\tx.xxx_hidden_CreatedRequest = v\n}\n\nfunc (x *CreateStudioRequestResponse) HasCreatedRequest() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreatedRequest != nil\n}\n\nfunc (x *CreateStudioRequestResponse) ClearCreatedRequest() {\n\tx.xxx_hidden_CreatedRequest = nil\n}\n\ntype CreateStudioRequestResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Created Studio Request.\n\tCreatedRequest *StudioRequest\n}\n\nfunc (b0 CreateStudioRequestResponse_builder) Build() *CreateStudioRequestResponse {\n\tm0 := &CreateStudioRequestResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_CreatedRequest = b.CreatedRequest\n\treturn m0\n}\n\n// RenameStudioRequestRequest is the proto request representation of the\n// RenameStudioRequest method.\ntype RenameStudioRequestRequest struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id      string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_NewName string                 `protobuf:\"bytes,2,opt,name=new_name,json=newName,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *RenameStudioRequestRequest) Reset() {\n\t*x = RenameStudioRequestRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RenameStudioRequestRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RenameStudioRequestRequest) ProtoMessage() {}\n\nfunc (x *RenameStudioRequestRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\nfunc (x *RenameStudioRequestRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *RenameStudioRequestRequest) GetNewName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NewName\n\t}\n\treturn \"\"\n}\n\nfunc (x *RenameStudioRequestRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *RenameStudioRequestRequest) SetNewName(v string) {\n\tx.xxx_hidden_NewName = v\n}\n\ntype RenameStudioRequestRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The Studio Request ID that will be renamed.\n\tId string\n\t// The new name for the request.\n\tNewName string\n}\n\nfunc (b0 RenameStudioRequestRequest_builder) Build() *RenameStudioRequestRequest {\n\tm0 := &RenameStudioRequestRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_NewName = b.NewName\n\treturn m0\n}\n\n// RenameStudioRequestResponse returns empty on successful renaming.\ntype RenameStudioRequestResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *RenameStudioRequestResponse) Reset() {\n\t*x = RenameStudioRequestResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RenameStudioRequestResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RenameStudioRequestResponse) ProtoMessage() {}\n\nfunc (x *RenameStudioRequestResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\ntype RenameStudioRequestResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 RenameStudioRequestResponse_builder) Build() *RenameStudioRequestResponse {\n\tm0 := &RenameStudioRequestResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\n// DeleteStudioRequestRequest is the proto request representation of the\n// DeleteStudioRequest method.\ntype DeleteStudioRequestRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteStudioRequestRequest) Reset() {\n\t*x = DeleteStudioRequestRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteStudioRequestRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteStudioRequestRequest) ProtoMessage() {}\n\nfunc (x *DeleteStudioRequestRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\nfunc (x *DeleteStudioRequestRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteStudioRequestRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\ntype DeleteStudioRequestRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The Studio Request ID that will be deleted.\n\tId string\n}\n\nfunc (b0 DeleteStudioRequestRequest_builder) Build() *DeleteStudioRequestRequest {\n\tm0 := &DeleteStudioRequestRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\treturn m0\n}\n\n// DeleteStudioRequestResponse returns empty on successful deletions.\ntype DeleteStudioRequestResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteStudioRequestResponse) Reset() {\n\t*x = DeleteStudioRequestResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteStudioRequestResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteStudioRequestResponse) ProtoMessage() {}\n\nfunc (x *DeleteStudioRequestResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\ntype DeleteStudioRequestResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteStudioRequestResponse_builder) Build() *DeleteStudioRequestResponse {\n\tm0 := &DeleteStudioRequestResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\n// ListStudioRequestsRequest is the proto request representation of the\n// ListStudioRequests method.\ntype ListStudioRequestsRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListStudioRequestsRequest) Reset() {\n\t*x = ListStudioRequestsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListStudioRequestsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListStudioRequestsRequest) ProtoMessage() {}\n\nfunc (x *ListStudioRequestsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\nfunc (x *ListStudioRequestsRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListStudioRequestsRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListStudioRequestsRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListStudioRequestsRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListStudioRequestsRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListStudioRequestsRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListStudioRequestsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The page size for listing studio requests, values between 1-250.\n\tPageSize uint32\n\t// The page token for paginating. The first page is returned if this is empty.\n\tPageToken string\n\t// The listed studio requests are order by created time in ascending order.\n\t// You can reverse that order setting this value to true.\n\tReverse bool\n}\n\nfunc (b0 ListStudioRequestsRequest_builder) Build() *ListStudioRequestsRequest {\n\tm0 := &ListStudioRequestsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\n// ListStudioRequestsResponse is the proto response representation of the\n// ListStudioRequests method.\ntype ListStudioRequestsResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Requests      *[]*StudioRequest      `protobuf:\"bytes,1,rep,name=requests,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListStudioRequestsResponse) Reset() {\n\t*x = ListStudioRequestsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListStudioRequestsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListStudioRequestsResponse) ProtoMessage() {}\n\nfunc (x *ListStudioRequestsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\nfunc (x *ListStudioRequestsResponse) GetRequests() []*StudioRequest {\n\tif x != nil {\n\t\tif x.xxx_hidden_Requests != nil {\n\t\t\treturn *x.xxx_hidden_Requests\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListStudioRequestsResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListStudioRequestsResponse) SetRequests(v []*StudioRequest) {\n\tx.xxx_hidden_Requests = &v\n}\n\nfunc (x *ListStudioRequestsResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListStudioRequestsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of requests in the current page.\n\tRequests []*StudioRequest\n\t// The requests' next page token. There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListStudioRequestsResponse_builder) Build() *ListStudioRequestsResponse {\n\tm0 := &ListStudioRequestsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Requests = &b.Requests\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\n// StudioRequest represents a saved request in Studio, that is synced to a BSR\n// user's profile.\ntype StudioRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id              string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime      *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_UpdateTime      *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=update_time,json=updateTime,proto3\"`\n\txxx_hidden_AuthorUserId    string                 `protobuf:\"bytes,4,opt,name=author_user_id,json=authorUserId,proto3\"`\n\txxx_hidden_RepositoryId    string                 `protobuf:\"bytes,5,opt,name=repository_id,json=repositoryId,proto3\"`\n\txxx_hidden_Name            string                 `protobuf:\"bytes,6,opt,name=name,proto3\"`\n\txxx_hidden_TargetBaseUrl   string                 `protobuf:\"bytes,7,opt,name=target_base_url,json=targetBaseUrl,proto3\"`\n\txxx_hidden_RepositoryOwner string                 `protobuf:\"bytes,8,opt,name=repository_owner,json=repositoryOwner,proto3\"`\n\txxx_hidden_RepositoryName  string                 `protobuf:\"bytes,9,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_Service         string                 `protobuf:\"bytes,10,opt,name=service,proto3\"`\n\txxx_hidden_Method          string                 `protobuf:\"bytes,11,opt,name=method,proto3\"`\n\txxx_hidden_Body            string                 `protobuf:\"bytes,12,opt,name=body,proto3\"`\n\txxx_hidden_Headers         map[string]string      `protobuf:\"bytes,13,rep,name=headers,proto3\" protobuf_key:\"bytes,1,opt,name=key\" protobuf_val:\"bytes,2,opt,name=value\"`\n\txxx_hidden_IncludeCookies  bool                   `protobuf:\"varint,14,opt,name=include_cookies,json=includeCookies,proto3\"`\n\txxx_hidden_Protocol        StudioProtocol         `protobuf:\"varint,15,opt,name=protocol,proto3,enum=buf.alpha.registry.v1alpha1.StudioProtocol\"`\n\txxx_hidden_AgentUrl        string                 `protobuf:\"bytes,16,opt,name=agent_url,json=agentUrl,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *StudioRequest) Reset() {\n\t*x = StudioRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *StudioRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*StudioRequest) ProtoMessage() {}\n\nfunc (x *StudioRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_studio_request_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\nfunc (x *StudioRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *StudioRequest) GetUpdateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UpdateTime\n\t}\n\treturn nil\n}\n\nfunc (x *StudioRequest) GetAuthorUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AuthorUserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetRepositoryId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryId\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetTargetBaseUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TargetBaseUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetRepositoryOwner() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryOwner\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetService() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Service\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetMethod() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Method\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetBody() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Body\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) GetHeaders() map[string]string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Headers\n\t}\n\treturn nil\n}\n\nfunc (x *StudioRequest) GetIncludeCookies() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_IncludeCookies\n\t}\n\treturn false\n}\n\nfunc (x *StudioRequest) GetProtocol() StudioProtocol {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Protocol\n\t}\n\treturn StudioProtocol_STUDIO_PROTOCOL_UNSPECIFIED\n}\n\nfunc (x *StudioRequest) GetAgentUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_AgentUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *StudioRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *StudioRequest) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *StudioRequest) SetUpdateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_UpdateTime = v\n}\n\nfunc (x *StudioRequest) SetAuthorUserId(v string) {\n\tx.xxx_hidden_AuthorUserId = v\n}\n\nfunc (x *StudioRequest) SetRepositoryId(v string) {\n\tx.xxx_hidden_RepositoryId = v\n}\n\nfunc (x *StudioRequest) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\nfunc (x *StudioRequest) SetTargetBaseUrl(v string) {\n\tx.xxx_hidden_TargetBaseUrl = v\n}\n\nfunc (x *StudioRequest) SetRepositoryOwner(v string) {\n\tx.xxx_hidden_RepositoryOwner = v\n}\n\nfunc (x *StudioRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *StudioRequest) SetService(v string) {\n\tx.xxx_hidden_Service = v\n}\n\nfunc (x *StudioRequest) SetMethod(v string) {\n\tx.xxx_hidden_Method = v\n}\n\nfunc (x *StudioRequest) SetBody(v string) {\n\tx.xxx_hidden_Body = v\n}\n\nfunc (x *StudioRequest) SetHeaders(v map[string]string) {\n\tx.xxx_hidden_Headers = v\n}\n\nfunc (x *StudioRequest) SetIncludeCookies(v bool) {\n\tx.xxx_hidden_IncludeCookies = v\n}\n\nfunc (x *StudioRequest) SetProtocol(v StudioProtocol) {\n\tx.xxx_hidden_Protocol = v\n}\n\nfunc (x *StudioRequest) SetAgentUrl(v string) {\n\tx.xxx_hidden_AgentUrl = v\n}\n\nfunc (x *StudioRequest) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *StudioRequest) HasUpdateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_UpdateTime != nil\n}\n\nfunc (x *StudioRequest) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *StudioRequest) ClearUpdateTime() {\n\tx.xxx_hidden_UpdateTime = nil\n}\n\ntype StudioRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of this Studio Request.\n\tId string\n\t// The request creation timestamp.\n\tCreateTime *timestamppb.Timestamp\n\t// The request last updated timestamp.\n\tUpdateTime *timestamppb.Timestamp\n\t// User ID who created and saved this request.\n\tAuthorUserId string\n\t// BSR repository ID this request is linked to.\n\tRepositoryId string\n\t// The friendly name of this request.\n\tName string\n\t// The target base URL of this request.\n\tTargetBaseUrl string\n\t// The BSR repository owner name (user or organization).\n\tRepositoryOwner string\n\t// The BSR repository name.\n\tRepositoryName string\n\t// The target service name as defined in the BSR repository.\n\tService string\n\t// The target RPC method name as defined in the BSR repository.\n\tMethod string\n\t// The request body as defined in Studio.\n\tBody string\n\t// The request headers as defined in Studio.\n\tHeaders map[string]string\n\t// Should this request include cookies from the Studio current session?\n\tIncludeCookies bool\n\t// The protocol that Studio uses to send this request.\n\tProtocol StudioProtocol\n\t// The agent url (if any) used by Studio to send the request. See\n\t// https://docs.buf.build/bsr/studio#via-buf-studio-agent for details.\n\tAgentUrl string\n}\n\nfunc (b0 StudioRequest_builder) Build() *StudioRequest {\n\tm0 := &StudioRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_UpdateTime = b.UpdateTime\n\tx.xxx_hidden_AuthorUserId = b.AuthorUserId\n\tx.xxx_hidden_RepositoryId = b.RepositoryId\n\tx.xxx_hidden_Name = b.Name\n\tx.xxx_hidden_TargetBaseUrl = b.TargetBaseUrl\n\tx.xxx_hidden_RepositoryOwner = b.RepositoryOwner\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_Service = b.Service\n\tx.xxx_hidden_Method = b.Method\n\tx.xxx_hidden_Body = b.Body\n\tx.xxx_hidden_Headers = b.Headers\n\tx.xxx_hidden_IncludeCookies = b.IncludeCookies\n\tx.xxx_hidden_Protocol = b.Protocol\n\tx.xxx_hidden_AgentUrl = b.AgentUrl\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_studio_request_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"0buf/alpha/registry/v1alpha1/studio_request.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\x9d\\x04\\n\" +\n\t\"\\x1aCreateStudioRequestRequest\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\x01 \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x02 \\x01(\\tR\\x0erepositoryName\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x03 \\x01(\\tR\\x04name\\x12&\\n\" +\n\t\"\\x0ftarget_base_url\\x18\\x04 \\x01(\\tR\\rtargetBaseUrl\\x12\\x18\\n\" +\n\t\"\\aservice\\x18\\x05 \\x01(\\tR\\aservice\\x12\\x16\\n\" +\n\t\"\\x06method\\x18\\x06 \\x01(\\tR\\x06method\\x12\\x12\\n\" +\n\t\"\\x04body\\x18\\a \\x01(\\tR\\x04body\\x12^\\n\" +\n\t\"\\aheaders\\x18\\b \\x03(\\v2D.buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.HeadersEntryR\\aheaders\\x12'\\n\" +\n\t\"\\x0finclude_cookies\\x18\\t \\x01(\\bR\\x0eincludeCookies\\x12G\\n\" +\n\t\"\\bprotocol\\x18\\n\" +\n\t\" \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.StudioProtocolR\\bprotocol\\x12\\x1b\\n\" +\n\t\"\\tagent_url\\x18\\v \\x01(\\tR\\bagentUrl\\x1a:\\n\" +\n\t\"\\fHeadersEntry\\x12\\x10\\n\" +\n\t\"\\x03key\\x18\\x01 \\x01(\\tR\\x03key\\x12\\x14\\n\" +\n\t\"\\x05value\\x18\\x02 \\x01(\\tR\\x05value:\\x028\\x01\\\"r\\n\" +\n\t\"\\x1bCreateStudioRequestResponse\\x12S\\n\" +\n\t\"\\x0fcreated_request\\x18\\x01 \\x01(\\v2*.buf.alpha.registry.v1alpha1.StudioRequestR\\x0ecreatedRequest\\\"G\\n\" +\n\t\"\\x1aRenameStudioRequestRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12\\x19\\n\" +\n\t\"\\bnew_name\\x18\\x02 \\x01(\\tR\\anewName\\\"\\x1d\\n\" +\n\t\"\\x1bRenameStudioRequestResponse\\\",\\n\" +\n\t\"\\x1aDeleteStudioRequestRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\\"\\x1d\\n\" +\n\t\"\\x1bDeleteStudioRequestResponse\\\"q\\n\" +\n\t\"\\x19ListStudioRequestsRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\\"\\x8c\\x01\\n\" +\n\t\"\\x1aListStudioRequestsResponse\\x12F\\n\" +\n\t\"\\brequests\\x18\\x01 \\x03(\\v2*.buf.alpha.registry.v1alpha1.StudioRequestR\\brequests\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\xd8\\x05\\n\" +\n\t\"\\rStudioRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12;\\n\" +\n\t\"\\vupdate_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"updateTime\\x12$\\n\" +\n\t\"\\x0eauthor_user_id\\x18\\x04 \\x01(\\tR\\fauthorUserId\\x12#\\n\" +\n\t\"\\rrepository_id\\x18\\x05 \\x01(\\tR\\frepositoryId\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x06 \\x01(\\tR\\x04name\\x12&\\n\" +\n\t\"\\x0ftarget_base_url\\x18\\a \\x01(\\tR\\rtargetBaseUrl\\x12)\\n\" +\n\t\"\\x10repository_owner\\x18\\b \\x01(\\tR\\x0frepositoryOwner\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\t \\x01(\\tR\\x0erepositoryName\\x12\\x18\\n\" +\n\t\"\\aservice\\x18\\n\" +\n\t\" \\x01(\\tR\\aservice\\x12\\x16\\n\" +\n\t\"\\x06method\\x18\\v \\x01(\\tR\\x06method\\x12\\x12\\n\" +\n\t\"\\x04body\\x18\\f \\x01(\\tR\\x04body\\x12Q\\n\" +\n\t\"\\aheaders\\x18\\r \\x03(\\v27.buf.alpha.registry.v1alpha1.StudioRequest.HeadersEntryR\\aheaders\\x12'\\n\" +\n\t\"\\x0finclude_cookies\\x18\\x0e \\x01(\\bR\\x0eincludeCookies\\x12G\\n\" +\n\t\"\\bprotocol\\x18\\x0f \\x01(\\x0e2+.buf.alpha.registry.v1alpha1.StudioProtocolR\\bprotocol\\x12\\x1b\\n\" +\n\t\"\\tagent_url\\x18\\x10 \\x01(\\tR\\bagentUrl\\x1a:\\n\" +\n\t\"\\fHeadersEntry\\x12\\x10\\n\" +\n\t\"\\x03key\\x18\\x01 \\x01(\\tR\\x03key\\x12\\x14\\n\" +\n\t\"\\x05value\\x18\\x02 \\x01(\\tR\\x05value:\\x028\\x01*\\x86\\x01\\n\" +\n\t\"\\x0eStudioProtocol\\x12\\x1f\\n\" +\n\t\"\\x1bSTUDIO_PROTOCOL_UNSPECIFIED\\x10\\x00\\x12\\x1b\\n\" +\n\t\"\\x17STUDIO_PROTOCOL_CONNECT\\x10\\x01\\x12\\x18\\n\" +\n\t\"\\x14STUDIO_PROTOCOL_GRPC\\x10\\x02\\x12\\x1c\\n\" +\n\t\"\\x18STUDIO_PROTOCOL_GRPC_WEB\\x10\\x032\\xcd\\x04\\n\" +\n\t\"\\x14StudioRequestService\\x12\\x8a\\x01\\n\" +\n\t\"\\x13CreateStudioRequest\\x127.buf.alpha.registry.v1alpha1.CreateStudioRequestRequest\\x1a8.buf.alpha.registry.v1alpha1.CreateStudioRequestResponse\\\"\\x00\\x12\\x8a\\x01\\n\" +\n\t\"\\x13RenameStudioRequest\\x127.buf.alpha.registry.v1alpha1.RenameStudioRequestRequest\\x1a8.buf.alpha.registry.v1alpha1.RenameStudioRequestResponse\\\"\\x00\\x12\\x8d\\x01\\n\" +\n\t\"\\x13DeleteStudioRequest\\x127.buf.alpha.registry.v1alpha1.DeleteStudioRequestRequest\\x1a8.buf.alpha.registry.v1alpha1.DeleteStudioRequestResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x8a\\x01\\n\" +\n\t\"\\x12ListStudioRequests\\x126.buf.alpha.registry.v1alpha1.ListStudioRequestsRequest\\x1a7.buf.alpha.registry.v1alpha1.ListStudioRequestsResponse\\\"\\x03\\x90\\x02\\x01B\\x9f\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x12StudioRequestProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes = make([]protoimpl.MessageInfo, 11)\nvar file_buf_alpha_registry_v1alpha1_studio_request_proto_goTypes = []any{\n\t(StudioProtocol)(0),                 // 0: buf.alpha.registry.v1alpha1.StudioProtocol\n\t(*CreateStudioRequestRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest\n\t(*CreateStudioRequestResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateStudioRequestResponse\n\t(*RenameStudioRequestRequest)(nil),  // 3: buf.alpha.registry.v1alpha1.RenameStudioRequestRequest\n\t(*RenameStudioRequestResponse)(nil), // 4: buf.alpha.registry.v1alpha1.RenameStudioRequestResponse\n\t(*DeleteStudioRequestRequest)(nil),  // 5: buf.alpha.registry.v1alpha1.DeleteStudioRequestRequest\n\t(*DeleteStudioRequestResponse)(nil), // 6: buf.alpha.registry.v1alpha1.DeleteStudioRequestResponse\n\t(*ListStudioRequestsRequest)(nil),   // 7: buf.alpha.registry.v1alpha1.ListStudioRequestsRequest\n\t(*ListStudioRequestsResponse)(nil),  // 8: buf.alpha.registry.v1alpha1.ListStudioRequestsResponse\n\t(*StudioRequest)(nil),               // 9: buf.alpha.registry.v1alpha1.StudioRequest\n\tnil,                                 // 10: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.HeadersEntry\n\tnil,                                 // 11: buf.alpha.registry.v1alpha1.StudioRequest.HeadersEntry\n\t(*timestamppb.Timestamp)(nil),       // 12: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_studio_request_proto_depIdxs = []int32{\n\t10, // 0: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.headers:type_name -> buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.HeadersEntry\n\t0,  // 1: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.protocol:type_name -> buf.alpha.registry.v1alpha1.StudioProtocol\n\t9,  // 2: buf.alpha.registry.v1alpha1.CreateStudioRequestResponse.created_request:type_name -> buf.alpha.registry.v1alpha1.StudioRequest\n\t9,  // 3: buf.alpha.registry.v1alpha1.ListStudioRequestsResponse.requests:type_name -> buf.alpha.registry.v1alpha1.StudioRequest\n\t12, // 4: buf.alpha.registry.v1alpha1.StudioRequest.create_time:type_name -> google.protobuf.Timestamp\n\t12, // 5: buf.alpha.registry.v1alpha1.StudioRequest.update_time:type_name -> google.protobuf.Timestamp\n\t11, // 6: buf.alpha.registry.v1alpha1.StudioRequest.headers:type_name -> buf.alpha.registry.v1alpha1.StudioRequest.HeadersEntry\n\t0,  // 7: buf.alpha.registry.v1alpha1.StudioRequest.protocol:type_name -> buf.alpha.registry.v1alpha1.StudioProtocol\n\t1,  // 8: buf.alpha.registry.v1alpha1.StudioRequestService.CreateStudioRequest:input_type -> buf.alpha.registry.v1alpha1.CreateStudioRequestRequest\n\t3,  // 9: buf.alpha.registry.v1alpha1.StudioRequestService.RenameStudioRequest:input_type -> buf.alpha.registry.v1alpha1.RenameStudioRequestRequest\n\t5,  // 10: buf.alpha.registry.v1alpha1.StudioRequestService.DeleteStudioRequest:input_type -> buf.alpha.registry.v1alpha1.DeleteStudioRequestRequest\n\t7,  // 11: buf.alpha.registry.v1alpha1.StudioRequestService.ListStudioRequests:input_type -> buf.alpha.registry.v1alpha1.ListStudioRequestsRequest\n\t2,  // 12: buf.alpha.registry.v1alpha1.StudioRequestService.CreateStudioRequest:output_type -> buf.alpha.registry.v1alpha1.CreateStudioRequestResponse\n\t4,  // 13: buf.alpha.registry.v1alpha1.StudioRequestService.RenameStudioRequest:output_type -> buf.alpha.registry.v1alpha1.RenameStudioRequestResponse\n\t6,  // 14: buf.alpha.registry.v1alpha1.StudioRequestService.DeleteStudioRequest:output_type -> buf.alpha.registry.v1alpha1.DeleteStudioRequestResponse\n\t8,  // 15: buf.alpha.registry.v1alpha1.StudioRequestService.ListStudioRequests:output_type -> buf.alpha.registry.v1alpha1.ListStudioRequestsResponse\n\t12, // [12:16] is the sub-list for method output_type\n\t8,  // [8:12] is the sub-list for method input_type\n\t8,  // [8:8] is the sub-list for extension type_name\n\t8,  // [8:8] is the sub-list for extension extendee\n\t0,  // [0:8] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_studio_request_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_studio_request_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_studio_request_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_buf_alpha_registry_v1alpha1_studio_request_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   11,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_studio_request_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_studio_request_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_studio_request_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_studio_request_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_studio_request_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/token.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/token.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 Token struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id         string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_ExpireTime *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=expire_time,json=expireTime,proto3\"`\n\txxx_hidden_Note       string                 `protobuf:\"bytes,4,opt,name=note,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *Token) Reset() {\n\t*x = Token{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Token) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Token) ProtoMessage() {}\n\nfunc (x *Token) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *Token) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *Token) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *Token) GetExpireTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExpireTime\n\t}\n\treturn nil\n}\n\nfunc (x *Token) GetNote() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Note\n\t}\n\treturn \"\"\n}\n\nfunc (x *Token) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *Token) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *Token) SetExpireTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_ExpireTime = v\n}\n\nfunc (x *Token) SetNote(v string) {\n\tx.xxx_hidden_Note = v\n}\n\nfunc (x *Token) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *Token) HasExpireTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ExpireTime != nil\n}\n\nfunc (x *Token) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *Token) ClearExpireTime() {\n\tx.xxx_hidden_ExpireTime = nil\n}\n\ntype Token_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId         string\n\tCreateTime *timestamppb.Timestamp\n\tExpireTime *timestamppb.Timestamp\n\tNote       string\n}\n\nfunc (b0 Token_builder) Build() *Token {\n\tm0 := &Token{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_ExpireTime = b.ExpireTime\n\tx.xxx_hidden_Note = b.Note\n\treturn m0\n}\n\ntype CreateTokenRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Note       string                 `protobuf:\"bytes,1,opt,name=note,proto3\"`\n\txxx_hidden_ExpireTime *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=expire_time,json=expireTime,proto3\"`\n\txxx_hidden_UserId     string                 `protobuf:\"bytes,3,opt,name=user_id,json=userId,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *CreateTokenRequest) Reset() {\n\t*x = CreateTokenRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateTokenRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateTokenRequest) ProtoMessage() {}\n\nfunc (x *CreateTokenRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *CreateTokenRequest) GetNote() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Note\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateTokenRequest) GetExpireTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExpireTime\n\t}\n\treturn nil\n}\n\nfunc (x *CreateTokenRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateTokenRequest) SetNote(v string) {\n\tx.xxx_hidden_Note = v\n}\n\nfunc (x *CreateTokenRequest) SetExpireTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_ExpireTime = v\n}\n\nfunc (x *CreateTokenRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *CreateTokenRequest) HasExpireTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_ExpireTime != nil\n}\n\nfunc (x *CreateTokenRequest) ClearExpireTime() {\n\tx.xxx_hidden_ExpireTime = nil\n}\n\ntype CreateTokenRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tNote string\n\t// The time until which the token should be valid.\n\t// Must be in the future. May be null for no expiry.\n\tExpireTime *timestamppb.Timestamp\n\t// The ID of the user to create a new token, can only be\n\t// the user who perform this action, or a machine user.\n\t// Default to the user who perform this action if this is empty.\n\tUserId string\n}\n\nfunc (b0 CreateTokenRequest_builder) Build() *CreateTokenRequest {\n\tm0 := &CreateTokenRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Note = b.Note\n\tx.xxx_hidden_ExpireTime = b.ExpireTime\n\tx.xxx_hidden_UserId = b.UserId\n\treturn m0\n}\n\ntype CreateTokenResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Token string                 `protobuf:\"bytes,1,opt,name=token,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *CreateTokenResponse) Reset() {\n\t*x = CreateTokenResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateTokenResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateTokenResponse) ProtoMessage() {}\n\nfunc (x *CreateTokenResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *CreateTokenResponse) GetToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Token\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateTokenResponse) SetToken(v string) {\n\tx.xxx_hidden_Token = v\n}\n\ntype CreateTokenResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The plaintext token to use for authentication.\n\tToken string\n}\n\nfunc (b0 CreateTokenResponse_builder) Build() *CreateTokenResponse {\n\tm0 := &CreateTokenResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Token = b.Token\n\treturn m0\n}\n\ntype GetTokenRequest struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_TokenId string                 `protobuf:\"bytes,1,opt,name=token_id,json=tokenId,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *GetTokenRequest) Reset() {\n\t*x = GetTokenRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetTokenRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetTokenRequest) ProtoMessage() {}\n\nfunc (x *GetTokenRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *GetTokenRequest) GetTokenId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TokenId\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetTokenRequest) SetTokenId(v string) {\n\tx.xxx_hidden_TokenId = v\n}\n\ntype GetTokenRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tTokenId string\n}\n\nfunc (b0 GetTokenRequest_builder) Build() *GetTokenRequest {\n\tm0 := &GetTokenRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TokenId = b.TokenId\n\treturn m0\n}\n\ntype GetTokenResponse struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Token *Token                 `protobuf:\"bytes,1,opt,name=token,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *GetTokenResponse) Reset() {\n\t*x = GetTokenResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetTokenResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetTokenResponse) ProtoMessage() {}\n\nfunc (x *GetTokenResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *GetTokenResponse) GetToken() *Token {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Token\n\t}\n\treturn nil\n}\n\nfunc (x *GetTokenResponse) SetToken(v *Token) {\n\tx.xxx_hidden_Token = v\n}\n\nfunc (x *GetTokenResponse) HasToken() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Token != nil\n}\n\nfunc (x *GetTokenResponse) ClearToken() {\n\tx.xxx_hidden_Token = nil\n}\n\ntype GetTokenResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tToken *Token\n}\n\nfunc (b0 GetTokenResponse_builder) Build() *GetTokenResponse {\n\tm0 := &GetTokenResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Token = b.Token\n\treturn m0\n}\n\ntype ListTokensRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize  uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse   bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\txxx_hidden_UserId    string                 `protobuf:\"bytes,4,opt,name=user_id,json=userId,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *ListTokensRequest) Reset() {\n\t*x = ListTokensRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListTokensRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListTokensRequest) ProtoMessage() {}\n\nfunc (x *ListTokensRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *ListTokensRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListTokensRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListTokensRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListTokensRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListTokensRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListTokensRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListTokensRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\nfunc (x *ListTokensRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\ntype ListTokensRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n\t// The ID of the user to list tokens, can only be\n\t// the user who perform this action, or a machine user.\n\t// Default to the user who perform this action if this is empty.\n\tUserId string\n}\n\nfunc (b0 ListTokensRequest_builder) Build() *ListTokensRequest {\n\tm0 := &ListTokensRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\tx.xxx_hidden_UserId = b.UserId\n\treturn m0\n}\n\ntype ListTokensResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Tokens        *[]*Token              `protobuf:\"bytes,1,rep,name=tokens,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListTokensResponse) Reset() {\n\t*x = ListTokensResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListTokensResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListTokensResponse) ProtoMessage() {}\n\nfunc (x *ListTokensResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *ListTokensResponse) GetTokens() []*Token {\n\tif x != nil {\n\t\tif x.xxx_hidden_Tokens != nil {\n\t\t\treturn *x.xxx_hidden_Tokens\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListTokensResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListTokensResponse) SetTokens(v []*Token) {\n\tx.xxx_hidden_Tokens = &v\n}\n\nfunc (x *ListTokensResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListTokensResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tTokens []*Token\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListTokensResponse_builder) Build() *ListTokensResponse {\n\tm0 := &ListTokensResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Tokens = &b.Tokens\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype DeleteTokenRequest struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_TokenId string                 `protobuf:\"bytes,1,opt,name=token_id,json=tokenId,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *DeleteTokenRequest) Reset() {\n\t*x = DeleteTokenRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteTokenRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteTokenRequest) ProtoMessage() {}\n\nfunc (x *DeleteTokenRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\nfunc (x *DeleteTokenRequest) GetTokenId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TokenId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteTokenRequest) SetTokenId(v string) {\n\tx.xxx_hidden_TokenId = v\n}\n\ntype DeleteTokenRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tTokenId string\n}\n\nfunc (b0 DeleteTokenRequest_builder) Build() *DeleteTokenRequest {\n\tm0 := &DeleteTokenRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TokenId = b.TokenId\n\treturn m0\n}\n\ntype DeleteTokenResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteTokenResponse) Reset() {\n\t*x = DeleteTokenResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteTokenResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteTokenResponse) ProtoMessage() {}\n\nfunc (x *DeleteTokenResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_token_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\ntype DeleteTokenResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteTokenResponse_builder) Build() *DeleteTokenResponse {\n\tm0 := &DeleteTokenResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_token_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_token_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"'buf/alpha/registry/v1alpha1/token.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xa5\\x01\\n\" +\n\t\"\\x05Token\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12;\\n\" +\n\t\"\\vexpire_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"expireTime\\x12\\x12\\n\" +\n\t\"\\x04note\\x18\\x04 \\x01(\\tR\\x04note\\\"~\\n\" +\n\t\"\\x12CreateTokenRequest\\x12\\x12\\n\" +\n\t\"\\x04note\\x18\\x01 \\x01(\\tR\\x04note\\x12;\\n\" +\n\t\"\\vexpire_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"expireTime\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x03 \\x01(\\tR\\x06userId\\\"+\\n\" +\n\t\"\\x13CreateTokenResponse\\x12\\x14\\n\" +\n\t\"\\x05token\\x18\\x01 \\x01(\\tR\\x05token\\\",\\n\" +\n\t\"\\x0fGetTokenRequest\\x12\\x19\\n\" +\n\t\"\\btoken_id\\x18\\x01 \\x01(\\tR\\atokenId\\\"L\\n\" +\n\t\"\\x10GetTokenResponse\\x128\\n\" +\n\t\"\\x05token\\x18\\x01 \\x01(\\v2\\\".buf.alpha.registry.v1alpha1.TokenR\\x05token\\\"\\x82\\x01\\n\" +\n\t\"\\x11ListTokensRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x04 \\x01(\\tR\\x06userId\\\"x\\n\" +\n\t\"\\x12ListTokensResponse\\x12:\\n\" +\n\t\"\\x06tokens\\x18\\x01 \\x03(\\v2\\\".buf.alpha.registry.v1alpha1.TokenR\\x06tokens\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"/\\n\" +\n\t\"\\x12DeleteTokenRequest\\x12\\x19\\n\" +\n\t\"\\btoken_id\\x18\\x01 \\x01(\\tR\\atokenId\\\"\\x15\\n\" +\n\t\"\\x13DeleteTokenResponse2\\xd9\\x03\\n\" +\n\t\"\\fTokenService\\x12p\\n\" +\n\t\"\\vCreateToken\\x12/.buf.alpha.registry.v1alpha1.CreateTokenRequest\\x1a0.buf.alpha.registry.v1alpha1.CreateTokenResponse\\x12l\\n\" +\n\t\"\\bGetToken\\x12,.buf.alpha.registry.v1alpha1.GetTokenRequest\\x1a-.buf.alpha.registry.v1alpha1.GetTokenResponse\\\"\\x03\\x90\\x02\\x01\\x12r\\n\" +\n\t\"\\n\" +\n\t\"ListTokens\\x12..buf.alpha.registry.v1alpha1.ListTokensRequest\\x1a/.buf.alpha.registry.v1alpha1.ListTokensResponse\\\"\\x03\\x90\\x02\\x01\\x12u\\n\" +\n\t\"\\vDeleteToken\\x12/.buf.alpha.registry.v1alpha1.DeleteTokenRequest\\x1a0.buf.alpha.registry.v1alpha1.DeleteTokenResponse\\\"\\x03\\x90\\x02\\x02B\\x97\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\n\" +\n\t\"TokenProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_token_proto_msgTypes = make([]protoimpl.MessageInfo, 9)\nvar file_buf_alpha_registry_v1alpha1_token_proto_goTypes = []any{\n\t(*Token)(nil),                 // 0: buf.alpha.registry.v1alpha1.Token\n\t(*CreateTokenRequest)(nil),    // 1: buf.alpha.registry.v1alpha1.CreateTokenRequest\n\t(*CreateTokenResponse)(nil),   // 2: buf.alpha.registry.v1alpha1.CreateTokenResponse\n\t(*GetTokenRequest)(nil),       // 3: buf.alpha.registry.v1alpha1.GetTokenRequest\n\t(*GetTokenResponse)(nil),      // 4: buf.alpha.registry.v1alpha1.GetTokenResponse\n\t(*ListTokensRequest)(nil),     // 5: buf.alpha.registry.v1alpha1.ListTokensRequest\n\t(*ListTokensResponse)(nil),    // 6: buf.alpha.registry.v1alpha1.ListTokensResponse\n\t(*DeleteTokenRequest)(nil),    // 7: buf.alpha.registry.v1alpha1.DeleteTokenRequest\n\t(*DeleteTokenResponse)(nil),   // 8: buf.alpha.registry.v1alpha1.DeleteTokenResponse\n\t(*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_token_proto_depIdxs = []int32{\n\t9, // 0: buf.alpha.registry.v1alpha1.Token.create_time:type_name -> google.protobuf.Timestamp\n\t9, // 1: buf.alpha.registry.v1alpha1.Token.expire_time:type_name -> google.protobuf.Timestamp\n\t9, // 2: buf.alpha.registry.v1alpha1.CreateTokenRequest.expire_time:type_name -> google.protobuf.Timestamp\n\t0, // 3: buf.alpha.registry.v1alpha1.GetTokenResponse.token:type_name -> buf.alpha.registry.v1alpha1.Token\n\t0, // 4: buf.alpha.registry.v1alpha1.ListTokensResponse.tokens:type_name -> buf.alpha.registry.v1alpha1.Token\n\t1, // 5: buf.alpha.registry.v1alpha1.TokenService.CreateToken:input_type -> buf.alpha.registry.v1alpha1.CreateTokenRequest\n\t3, // 6: buf.alpha.registry.v1alpha1.TokenService.GetToken:input_type -> buf.alpha.registry.v1alpha1.GetTokenRequest\n\t5, // 7: buf.alpha.registry.v1alpha1.TokenService.ListTokens:input_type -> buf.alpha.registry.v1alpha1.ListTokensRequest\n\t7, // 8: buf.alpha.registry.v1alpha1.TokenService.DeleteToken:input_type -> buf.alpha.registry.v1alpha1.DeleteTokenRequest\n\t2, // 9: buf.alpha.registry.v1alpha1.TokenService.CreateToken:output_type -> buf.alpha.registry.v1alpha1.CreateTokenResponse\n\t4, // 10: buf.alpha.registry.v1alpha1.TokenService.GetToken:output_type -> buf.alpha.registry.v1alpha1.GetTokenResponse\n\t6, // 11: buf.alpha.registry.v1alpha1.TokenService.ListTokens:output_type -> buf.alpha.registry.v1alpha1.ListTokensResponse\n\t8, // 12: buf.alpha.registry.v1alpha1.TokenService.DeleteToken:output_type -> buf.alpha.registry.v1alpha1.DeleteTokenResponse\n\t9, // [9:13] is the sub-list for method output_type\n\t5, // [5:9] is the sub-list for method input_type\n\t5, // [5:5] is the sub-list for extension type_name\n\t5, // [5:5] is the sub-list for extension extendee\n\t0, // [0:5] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_token_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_token_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_token_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_buf_alpha_registry_v1alpha1_token_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_token_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   9,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_token_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_token_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_token_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_token_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_token_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_token_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage registryv1alpha1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/user.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/user.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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 UserState int32\n\nconst (\n\tUserState_USER_STATE_UNSPECIFIED UserState = 0\n\tUserState_USER_STATE_ACTIVE      UserState = 1\n\tUserState_USER_STATE_DEACTIVATED UserState = 2\n)\n\n// Enum value maps for UserState.\nvar (\n\tUserState_name = map[int32]string{\n\t\t0: \"USER_STATE_UNSPECIFIED\",\n\t\t1: \"USER_STATE_ACTIVE\",\n\t\t2: \"USER_STATE_DEACTIVATED\",\n\t}\n\tUserState_value = map[string]int32{\n\t\t\"USER_STATE_UNSPECIFIED\": 0,\n\t\t\"USER_STATE_ACTIVE\":      1,\n\t\t\"USER_STATE_DEACTIVATED\": 2,\n\t}\n)\n\nfunc (x UserState) Enum() *UserState {\n\tp := new(UserState)\n\t*p = x\n\treturn p\n}\n\nfunc (x UserState) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (UserState) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[0].Descriptor()\n}\n\nfunc (UserState) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[0]\n}\n\nfunc (x UserState) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype UserType int32\n\nconst (\n\tUserType_USER_TYPE_UNSPECIFIED UserType = 0\n\tUserType_USER_TYPE_PERSONAL    UserType = 1\n\tUserType_USER_TYPE_MACHINE     UserType = 2\n\tUserType_USER_TYPE_SYSTEM      UserType = 3\n)\n\n// Enum value maps for UserType.\nvar (\n\tUserType_name = map[int32]string{\n\t\t0: \"USER_TYPE_UNSPECIFIED\",\n\t\t1: \"USER_TYPE_PERSONAL\",\n\t\t2: \"USER_TYPE_MACHINE\",\n\t\t3: \"USER_TYPE_SYSTEM\",\n\t}\n\tUserType_value = map[string]int32{\n\t\t\"USER_TYPE_UNSPECIFIED\": 0,\n\t\t\"USER_TYPE_PERSONAL\":    1,\n\t\t\"USER_TYPE_MACHINE\":     2,\n\t\t\"USER_TYPE_SYSTEM\":      3,\n\t}\n)\n\nfunc (x UserType) Enum() *UserType {\n\tp := new(UserType)\n\t*p = x\n\treturn p\n}\n\nfunc (x UserType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (UserType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[1].Descriptor()\n}\n\nfunc (UserType) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[1]\n}\n\nfunc (x UserType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype User struct {\n\tstate                         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id                 string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\txxx_hidden_CreateTime         *timestamppb.Timestamp `protobuf:\"bytes,2,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_UpdateTime         *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=update_time,json=updateTime,proto3\"`\n\txxx_hidden_Username           string                 `protobuf:\"bytes,4,opt,name=username,proto3\"`\n\txxx_hidden_Deactivated        bool                   `protobuf:\"varint,5,opt,name=deactivated,proto3\"`\n\txxx_hidden_Description        string                 `protobuf:\"bytes,6,opt,name=description,proto3\"`\n\txxx_hidden_Url                string                 `protobuf:\"bytes,7,opt,name=url,proto3\"`\n\txxx_hidden_VerificationStatus VerificationStatus     `protobuf:\"varint,8,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus\"`\n\txxx_hidden_UserType           UserType               `protobuf:\"varint,9,opt,name=user_type,json=userType,proto3,enum=buf.alpha.registry.v1alpha1.UserType\"`\n\tunknownFields                 protoimpl.UnknownFields\n\tsizeCache                     protoimpl.SizeCache\n}\n\nfunc (x *User) Reset() {\n\t*x = User{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *User) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*User) ProtoMessage() {}\n\nfunc (x *User) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *User) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *User) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *User) GetUpdateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UpdateTime\n\t}\n\treturn nil\n}\n\nfunc (x *User) GetUsername() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *User) GetDeactivated() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Deactivated\n\t}\n\treturn false\n}\n\nfunc (x *User) GetDescription() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Description\n\t}\n\treturn \"\"\n}\n\nfunc (x *User) GetUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Url\n\t}\n\treturn \"\"\n}\n\nfunc (x *User) GetVerificationStatus() VerificationStatus {\n\tif x != nil {\n\t\treturn x.xxx_hidden_VerificationStatus\n\t}\n\treturn VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED\n}\n\nfunc (x *User) GetUserType() UserType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserType\n\t}\n\treturn UserType_USER_TYPE_UNSPECIFIED\n}\n\nfunc (x *User) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\nfunc (x *User) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *User) SetUpdateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_UpdateTime = v\n}\n\nfunc (x *User) SetUsername(v string) {\n\tx.xxx_hidden_Username = v\n}\n\nfunc (x *User) SetDeactivated(v bool) {\n\tx.xxx_hidden_Deactivated = v\n}\n\nfunc (x *User) SetDescription(v string) {\n\tx.xxx_hidden_Description = v\n}\n\nfunc (x *User) SetUrl(v string) {\n\tx.xxx_hidden_Url = v\n}\n\nfunc (x *User) SetVerificationStatus(v VerificationStatus) {\n\tx.xxx_hidden_VerificationStatus = v\n}\n\nfunc (x *User) SetUserType(v UserType) {\n\tx.xxx_hidden_UserType = v\n}\n\nfunc (x *User) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *User) HasUpdateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_UpdateTime != nil\n}\n\nfunc (x *User) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *User) ClearUpdateTime() {\n\tx.xxx_hidden_UpdateTime = nil\n}\n\ntype User_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// primary key, unique, immutable\n\tId string\n\t// immutable\n\tCreateTime *timestamppb.Timestamp\n\t// mutable\n\tUpdateTime *timestamppb.Timestamp\n\t// unique, mutable\n\tUsername string\n\t// mutable\n\tDeactivated bool\n\t// description is the user configurable description of the user.\n\tDescription string\n\t// url is the user configurable URL in the description of the user,\n\t// always included the scheme and will not have a #fragment suffix.\n\tUrl string\n\t// verification status of the user, configurable by server admin.\n\tVerificationStatus VerificationStatus\n\t// user type of the user, depends on how the user was created.\n\tUserType UserType\n}\n\nfunc (b0 User_builder) Build() *User {\n\tm0 := &User{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_UpdateTime = b.UpdateTime\n\tx.xxx_hidden_Username = b.Username\n\tx.xxx_hidden_Deactivated = b.Deactivated\n\tx.xxx_hidden_Description = b.Description\n\tx.xxx_hidden_Url = b.Url\n\tx.xxx_hidden_VerificationStatus = b.VerificationStatus\n\tx.xxx_hidden_UserType = b.UserType\n\treturn m0\n}\n\n// TODO: #663 move this to organization service\ntype OrganizationUser struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User                   *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\txxx_hidden_OrganizationId         string                 `protobuf:\"bytes,2,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_OrganizationRole       OrganizationRole       `protobuf:\"varint,3,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole\"`\n\txxx_hidden_OrganizationRoleSource OrganizationRoleSource `protobuf:\"varint,4,opt,name=organization_role_source,json=organizationRoleSource,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRoleSource\"`\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *OrganizationUser) Reset() {\n\t*x = OrganizationUser{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *OrganizationUser) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*OrganizationUser) ProtoMessage() {}\n\nfunc (x *OrganizationUser) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *OrganizationUser) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *OrganizationUser) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *OrganizationUser) GetOrganizationRole() OrganizationRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationRole\n\t}\n\treturn OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED\n}\n\nfunc (x *OrganizationUser) GetOrganizationRoleSource() OrganizationRoleSource {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationRoleSource\n\t}\n\treturn OrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_UNSPECIFIED\n}\n\nfunc (x *OrganizationUser) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *OrganizationUser) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *OrganizationUser) SetOrganizationRole(v OrganizationRole) {\n\tx.xxx_hidden_OrganizationRole = v\n}\n\nfunc (x *OrganizationUser) SetOrganizationRoleSource(v OrganizationRoleSource) {\n\tx.xxx_hidden_OrganizationRoleSource = v\n}\n\nfunc (x *OrganizationUser) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *OrganizationUser) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype OrganizationUser_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUser *User\n\t// The ID of the organization for which the role belongs to.\n\tOrganizationId string\n\t// The role that the user has in the organization above.\n\tOrganizationRole OrganizationRole\n\t// The source of the user's role in the organization above.\n\tOrganizationRoleSource OrganizationRoleSource\n}\n\nfunc (b0 OrganizationUser_builder) Build() *OrganizationUser {\n\tm0 := &OrganizationUser{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_OrganizationRole = b.OrganizationRole\n\tx.xxx_hidden_OrganizationRoleSource = b.OrganizationRoleSource\n\treturn m0\n}\n\ntype CreateUserRequest struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Username string                 `protobuf:\"bytes,1,opt,name=username,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *CreateUserRequest) Reset() {\n\t*x = CreateUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateUserRequest) ProtoMessage() {}\n\nfunc (x *CreateUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *CreateUserRequest) GetUsername() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateUserRequest) SetUsername(v string) {\n\tx.xxx_hidden_Username = v\n}\n\ntype CreateUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUsername string\n}\n\nfunc (b0 CreateUserRequest_builder) Build() *CreateUserRequest {\n\tm0 := &CreateUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Username = b.Username\n\treturn m0\n}\n\ntype CreateUserResponse struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *CreateUserResponse) Reset() {\n\t*x = CreateUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateUserResponse) ProtoMessage() {}\n\nfunc (x *CreateUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *CreateUserResponse) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *CreateUserResponse) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *CreateUserResponse) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *CreateUserResponse) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype CreateUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUser *User\n}\n\nfunc (b0 CreateUserResponse_builder) Build() *CreateUserResponse {\n\tm0 := &CreateUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\treturn m0\n}\n\ntype GetUserRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *GetUserRequest) Reset() {\n\t*x = GetUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUserRequest) ProtoMessage() {}\n\nfunc (x *GetUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *GetUserRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetUserRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\ntype GetUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId string\n}\n\nfunc (b0 GetUserRequest_builder) Build() *GetUserRequest {\n\tm0 := &GetUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\treturn m0\n}\n\ntype GetUserResponse struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *GetUserResponse) Reset() {\n\t*x = GetUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUserResponse) ProtoMessage() {}\n\nfunc (x *GetUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *GetUserResponse) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *GetUserResponse) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *GetUserResponse) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *GetUserResponse) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype GetUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUser *User\n}\n\nfunc (b0 GetUserResponse_builder) Build() *GetUserResponse {\n\tm0 := &GetUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\treturn m0\n}\n\ntype GetUserByUsernameRequest struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Username string                 `protobuf:\"bytes,1,opt,name=username,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *GetUserByUsernameRequest) Reset() {\n\t*x = GetUserByUsernameRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUserByUsernameRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUserByUsernameRequest) ProtoMessage() {}\n\nfunc (x *GetUserByUsernameRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *GetUserByUsernameRequest) GetUsername() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Username\n\t}\n\treturn \"\"\n}\n\nfunc (x *GetUserByUsernameRequest) SetUsername(v string) {\n\tx.xxx_hidden_Username = v\n}\n\ntype GetUserByUsernameRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUsername string\n}\n\nfunc (b0 GetUserByUsernameRequest_builder) Build() *GetUserByUsernameRequest {\n\tm0 := &GetUserByUsernameRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Username = b.Username\n\treturn m0\n}\n\ntype GetUserByUsernameResponse struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_User *User                  `protobuf:\"bytes,1,opt,name=user,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *GetUserByUsernameResponse) Reset() {\n\t*x = GetUserByUsernameResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *GetUserByUsernameResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*GetUserByUsernameResponse) ProtoMessage() {}\n\nfunc (x *GetUserByUsernameResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *GetUserByUsernameResponse) GetUser() *User {\n\tif x != nil {\n\t\treturn x.xxx_hidden_User\n\t}\n\treturn nil\n}\n\nfunc (x *GetUserByUsernameResponse) SetUser(v *User) {\n\tx.xxx_hidden_User = v\n}\n\nfunc (x *GetUserByUsernameResponse) HasUser() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_User != nil\n}\n\nfunc (x *GetUserByUsernameResponse) ClearUser() {\n\tx.xxx_hidden_User = nil\n}\n\ntype GetUserByUsernameResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUser *User\n}\n\nfunc (b0 GetUserByUsernameResponse_builder) Build() *GetUserByUsernameResponse {\n\tm0 := &GetUserByUsernameResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_User = b.User\n\treturn m0\n}\n\ntype ListUsersRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_PageSize        uint32                 `protobuf:\"varint,1,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken       string                 `protobuf:\"bytes,2,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse         bool                   `protobuf:\"varint,3,opt,name=reverse,proto3\"`\n\txxx_hidden_UserStateFilter UserState              `protobuf:\"varint,4,opt,name=user_state_filter,json=userStateFilter,proto3,enum=buf.alpha.registry.v1alpha1.UserState\"`\n\txxx_hidden_UserTypeFilters []UserType             `protobuf:\"varint,5,rep,packed,name=user_type_filters,json=userTypeFilters,proto3,enum=buf.alpha.registry.v1alpha1.UserType\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *ListUsersRequest) Reset() {\n\t*x = ListUsersRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[8]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListUsersRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListUsersRequest) ProtoMessage() {}\n\nfunc (x *ListUsersRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_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\nfunc (x *ListUsersRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListUsersRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUsersRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListUsersRequest) GetUserStateFilter() UserState {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserStateFilter\n\t}\n\treturn UserState_USER_STATE_UNSPECIFIED\n}\n\nfunc (x *ListUsersRequest) GetUserTypeFilters() []UserType {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserTypeFilters\n\t}\n\treturn nil\n}\n\nfunc (x *ListUsersRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListUsersRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListUsersRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\nfunc (x *ListUsersRequest) SetUserStateFilter(v UserState) {\n\tx.xxx_hidden_UserStateFilter = v\n}\n\nfunc (x *ListUsersRequest) SetUserTypeFilters(v []UserType) {\n\tx.xxx_hidden_UserTypeFilters = v\n}\n\ntype ListUsersRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tPageSize uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n\t// If the user_state_filter is unspecified, users of all states are included.\n\tUserStateFilter UserState\n\t// If the user_type_filters is empty, users of all types are included.\n\tUserTypeFilters []UserType\n}\n\nfunc (b0 ListUsersRequest_builder) Build() *ListUsersRequest {\n\tm0 := &ListUsersRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\tx.xxx_hidden_UserStateFilter = b.UserStateFilter\n\tx.xxx_hidden_UserTypeFilters = b.UserTypeFilters\n\treturn m0\n}\n\ntype ListUsersResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Users         *[]*User               `protobuf:\"bytes,1,rep,name=users,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListUsersResponse) Reset() {\n\t*x = ListUsersResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[9]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListUsersResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListUsersResponse) ProtoMessage() {}\n\nfunc (x *ListUsersResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[9]\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\nfunc (x *ListUsersResponse) GetUsers() []*User {\n\tif x != nil {\n\t\tif x.xxx_hidden_Users != nil {\n\t\t\treturn *x.xxx_hidden_Users\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListUsersResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListUsersResponse) SetUsers(v []*User) {\n\tx.xxx_hidden_Users = &v\n}\n\nfunc (x *ListUsersResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListUsersResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUsers []*User\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListUsersResponse_builder) Build() *ListUsersResponse {\n\tm0 := &ListUsersResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Users = &b.Users\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype ListOrganizationUsersRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_OrganizationId string                 `protobuf:\"bytes,1,opt,name=organization_id,json=organizationId,proto3\"`\n\txxx_hidden_PageSize       uint32                 `protobuf:\"varint,2,opt,name=page_size,json=pageSize,proto3\"`\n\txxx_hidden_PageToken      string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\txxx_hidden_Reverse        bool                   `protobuf:\"varint,4,opt,name=reverse,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ListOrganizationUsersRequest) Reset() {\n\t*x = ListOrganizationUsersRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[10]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListOrganizationUsersRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListOrganizationUsersRequest) ProtoMessage() {}\n\nfunc (x *ListOrganizationUsersRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[10]\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\nfunc (x *ListOrganizationUsersRequest) GetOrganizationId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OrganizationId\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationUsersRequest) GetPageSize() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageSize\n\t}\n\treturn 0\n}\n\nfunc (x *ListOrganizationUsersRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationUsersRequest) GetReverse() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Reverse\n\t}\n\treturn false\n}\n\nfunc (x *ListOrganizationUsersRequest) SetOrganizationId(v string) {\n\tx.xxx_hidden_OrganizationId = v\n}\n\nfunc (x *ListOrganizationUsersRequest) SetPageSize(v uint32) {\n\tx.xxx_hidden_PageSize = v\n}\n\nfunc (x *ListOrganizationUsersRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\nfunc (x *ListOrganizationUsersRequest) SetReverse(v bool) {\n\tx.xxx_hidden_Reverse = v\n}\n\ntype ListOrganizationUsersRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tOrganizationId string\n\tPageSize       uint32\n\t// The first page is returned if this is empty.\n\tPageToken string\n\tReverse   bool\n}\n\nfunc (b0 ListOrganizationUsersRequest_builder) Build() *ListOrganizationUsersRequest {\n\tm0 := &ListOrganizationUsersRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_OrganizationId = b.OrganizationId\n\tx.xxx_hidden_PageSize = b.PageSize\n\tx.xxx_hidden_PageToken = b.PageToken\n\tx.xxx_hidden_Reverse = b.Reverse\n\treturn m0\n}\n\ntype ListOrganizationUsersResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Users         *[]*OrganizationUser   `protobuf:\"bytes,1,rep,name=users,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListOrganizationUsersResponse) Reset() {\n\t*x = ListOrganizationUsersResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[11]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListOrganizationUsersResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListOrganizationUsersResponse) ProtoMessage() {}\n\nfunc (x *ListOrganizationUsersResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[11]\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\nfunc (x *ListOrganizationUsersResponse) GetUsers() []*OrganizationUser {\n\tif x != nil {\n\t\tif x.xxx_hidden_Users != nil {\n\t\t\treturn *x.xxx_hidden_Users\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListOrganizationUsersResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListOrganizationUsersResponse) SetUsers(v []*OrganizationUser) {\n\tx.xxx_hidden_Users = &v\n}\n\nfunc (x *ListOrganizationUsersResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListOrganizationUsersResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUsers []*OrganizationUser\n\t// There are no more pages if this is empty.\n\tNextPageToken string\n}\n\nfunc (b0 ListOrganizationUsersResponse_builder) Build() *ListOrganizationUsersResponse {\n\tm0 := &ListOrganizationUsersResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Users = &b.Users\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\ntype DeleteUserRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteUserRequest) Reset() {\n\t*x = DeleteUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[12]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteUserRequest) ProtoMessage() {}\n\nfunc (x *DeleteUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[12]\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\ntype DeleteUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteUserRequest_builder) Build() *DeleteUserRequest {\n\tm0 := &DeleteUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype DeleteUserResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteUserResponse) Reset() {\n\t*x = DeleteUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[13]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteUserResponse) ProtoMessage() {}\n\nfunc (x *DeleteUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[13]\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\ntype DeleteUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteUserResponse_builder) Build() *DeleteUserResponse {\n\tm0 := &DeleteUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype DeactivateUserRequest struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Id string                 `protobuf:\"bytes,1,opt,name=id,proto3\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeactivateUserRequest) Reset() {\n\t*x = DeactivateUserRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[14]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeactivateUserRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeactivateUserRequest) ProtoMessage() {}\n\nfunc (x *DeactivateUserRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[14]\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\nfunc (x *DeactivateUserRequest) GetId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Id\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeactivateUserRequest) SetId(v string) {\n\tx.xxx_hidden_Id = v\n}\n\ntype DeactivateUserRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tId string\n}\n\nfunc (b0 DeactivateUserRequest_builder) Build() *DeactivateUserRequest {\n\tm0 := &DeactivateUserRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Id = b.Id\n\treturn m0\n}\n\ntype DeactivateUserResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeactivateUserResponse) Reset() {\n\t*x = DeactivateUserResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[15]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeactivateUserResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeactivateUserResponse) ProtoMessage() {}\n\nfunc (x *DeactivateUserResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[15]\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\ntype DeactivateUserResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeactivateUserResponse_builder) Build() *DeactivateUserResponse {\n\tm0 := &DeactivateUserResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype UpdateUserServerRoleRequest struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserId     string                 `protobuf:\"bytes,1,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_ServerRole ServerRole             `protobuf:\"varint,2,opt,name=server_role,json=serverRole,proto3,enum=buf.alpha.registry.v1alpha1.ServerRole\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *UpdateUserServerRoleRequest) Reset() {\n\t*x = UpdateUserServerRoleRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[16]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUserServerRoleRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUserServerRoleRequest) ProtoMessage() {}\n\nfunc (x *UpdateUserServerRoleRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[16]\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\nfunc (x *UpdateUserServerRoleRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateUserServerRoleRequest) GetServerRole() ServerRole {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ServerRole\n\t}\n\treturn ServerRole_SERVER_ROLE_UNSPECIFIED\n}\n\nfunc (x *UpdateUserServerRoleRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *UpdateUserServerRoleRequest) SetServerRole(v ServerRole) {\n\tx.xxx_hidden_ServerRole = v\n}\n\ntype UpdateUserServerRoleRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The ID of the user for which to be updated a role.\n\tUserId string\n\t// The new role of the user in the server.\n\tServerRole ServerRole\n}\n\nfunc (b0 UpdateUserServerRoleRequest_builder) Build() *UpdateUserServerRoleRequest {\n\tm0 := &UpdateUserServerRoleRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserId = b.UserId\n\tx.xxx_hidden_ServerRole = b.ServerRole\n\treturn m0\n}\n\ntype UpdateUserServerRoleResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateUserServerRoleResponse) Reset() {\n\t*x = UpdateUserServerRoleResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[17]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUserServerRoleResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUserServerRoleResponse) ProtoMessage() {}\n\nfunc (x *UpdateUserServerRoleResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[17]\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\ntype UpdateUserServerRoleResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateUserServerRoleResponse_builder) Build() *UpdateUserServerRoleResponse {\n\tm0 := &UpdateUserServerRoleResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\ntype CountUsersRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserStateFilter UserState              `protobuf:\"varint,1,opt,name=user_state_filter,json=userStateFilter,proto3,enum=buf.alpha.registry.v1alpha1.UserState\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *CountUsersRequest) Reset() {\n\t*x = CountUsersRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[18]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CountUsersRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CountUsersRequest) ProtoMessage() {}\n\nfunc (x *CountUsersRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[18]\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\nfunc (x *CountUsersRequest) GetUserStateFilter() UserState {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserStateFilter\n\t}\n\treturn UserState_USER_STATE_UNSPECIFIED\n}\n\nfunc (x *CountUsersRequest) SetUserStateFilter(v UserState) {\n\tx.xxx_hidden_UserStateFilter = v\n}\n\ntype CountUsersRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// If the user_state_filter is unspecified, all users are included.\n\tUserStateFilter UserState\n}\n\nfunc (b0 CountUsersRequest_builder) Build() *CountUsersRequest {\n\tm0 := &CountUsersRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserStateFilter = b.UserStateFilter\n\treturn m0\n}\n\ntype CountUsersResponse struct {\n\tstate                 protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_TotalCount uint32                 `protobuf:\"varint,1,opt,name=total_count,json=totalCount,proto3\"`\n\tunknownFields         protoimpl.UnknownFields\n\tsizeCache             protoimpl.SizeCache\n}\n\nfunc (x *CountUsersResponse) Reset() {\n\t*x = CountUsersResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[19]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CountUsersResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CountUsersResponse) ProtoMessage() {}\n\nfunc (x *CountUsersResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[19]\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\nfunc (x *CountUsersResponse) GetTotalCount() uint32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_TotalCount\n\t}\n\treturn 0\n}\n\nfunc (x *CountUsersResponse) SetTotalCount(v uint32) {\n\tx.xxx_hidden_TotalCount = v\n}\n\ntype CountUsersResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tTotalCount uint32\n}\n\nfunc (b0 CountUsersResponse_builder) Build() *CountUsersResponse {\n\tm0 := &CountUsersResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_TotalCount = b.TotalCount\n\treturn m0\n}\n\ntype UpdateUserSettingsRequest struct {\n\tstate                  protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_UserId      string                 `protobuf:\"bytes,1,opt,name=user_id,json=userId,proto3\"`\n\txxx_hidden_Description *string                `protobuf:\"bytes,2,opt,name=description,proto3,oneof\"`\n\txxx_hidden_Url         *string                `protobuf:\"bytes,3,opt,name=url,proto3,oneof\"`\n\tXXX_raceDetectHookData protoimpl.RaceDetectHookData\n\tXXX_presence           [1]uint32\n\tunknownFields          protoimpl.UnknownFields\n\tsizeCache              protoimpl.SizeCache\n}\n\nfunc (x *UpdateUserSettingsRequest) Reset() {\n\t*x = UpdateUserSettingsRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[20]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUserSettingsRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUserSettingsRequest) ProtoMessage() {}\n\nfunc (x *UpdateUserSettingsRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[20]\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\nfunc (x *UpdateUserSettingsRequest) GetUserId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UserId\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateUserSettingsRequest) GetDescription() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Description != nil {\n\t\t\treturn *x.xxx_hidden_Description\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateUserSettingsRequest) GetUrl() string {\n\tif x != nil {\n\t\tif x.xxx_hidden_Url != nil {\n\t\t\treturn *x.xxx_hidden_Url\n\t\t}\n\t\treturn \"\"\n\t}\n\treturn \"\"\n}\n\nfunc (x *UpdateUserSettingsRequest) SetUserId(v string) {\n\tx.xxx_hidden_UserId = v\n}\n\nfunc (x *UpdateUserSettingsRequest) SetDescription(v string) {\n\tx.xxx_hidden_Description = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3)\n}\n\nfunc (x *UpdateUserSettingsRequest) SetUrl(v string) {\n\tx.xxx_hidden_Url = &v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3)\n}\n\nfunc (x *UpdateUserSettingsRequest) HasDescription() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *UpdateUserSettingsRequest) HasUrl() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *UpdateUserSettingsRequest) ClearDescription() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_Description = nil\n}\n\nfunc (x *UpdateUserSettingsRequest) ClearUrl() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_Url = nil\n}\n\ntype UpdateUserSettingsRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tUserId string\n\t// optional, update to description will only be made when this is present\n\tDescription *string\n\t// optional, update to url will only be made when this is present\n\tUrl *string\n}\n\nfunc (b0 UpdateUserSettingsRequest_builder) Build() *UpdateUserSettingsRequest {\n\tm0 := &UpdateUserSettingsRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_UserId = b.UserId\n\tif b.Description != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3)\n\t\tx.xxx_hidden_Description = b.Description\n\t}\n\tif b.Url != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3)\n\t\tx.xxx_hidden_Url = b.Url\n\t}\n\treturn m0\n}\n\ntype UpdateUserSettingsResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *UpdateUserSettingsResponse) Reset() {\n\t*x = UpdateUserSettingsResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[21]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *UpdateUserSettingsResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*UpdateUserSettingsResponse) ProtoMessage() {}\n\nfunc (x *UpdateUserSettingsResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[21]\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\ntype UpdateUserSettingsResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 UpdateUserSettingsResponse_builder) Build() *UpdateUserSettingsResponse {\n\tm0 := &UpdateUserSettingsResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_user_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_user_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"&buf/alpha/registry/v1alpha1/user.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a&buf/alpha/registry/v1alpha1/role.proto\\x1a5buf/alpha/registry/v1alpha1/verification_status.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xa8\\x03\\n\" +\n\t\"\\x04User\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x02 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12;\\n\" +\n\t\"\\vupdate_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"updateTime\\x12\\x1a\\n\" +\n\t\"\\busername\\x18\\x04 \\x01(\\tR\\busername\\x12 \\n\" +\n\t\"\\vdeactivated\\x18\\x05 \\x01(\\bR\\vdeactivated\\x12 \\n\" +\n\t\"\\vdescription\\x18\\x06 \\x01(\\tR\\vdescription\\x12\\x10\\n\" +\n\t\"\\x03url\\x18\\a \\x01(\\tR\\x03url\\x12`\\n\" +\n\t\"\\x13verification_status\\x18\\b \\x01(\\x0e2/.buf.alpha.registry.v1alpha1.VerificationStatusR\\x12verificationStatus\\x12B\\n\" +\n\t\"\\tuser_type\\x18\\t \\x01(\\x0e2%.buf.alpha.registry.v1alpha1.UserTypeR\\buserType\\\"\\xbd\\x02\\n\" +\n\t\"\\x10OrganizationUser\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x02 \\x01(\\tR\\x0eorganizationId\\x12Z\\n\" +\n\t\"\\x11organization_role\\x18\\x03 \\x01(\\x0e2-.buf.alpha.registry.v1alpha1.OrganizationRoleR\\x10organizationRole\\x12m\\n\" +\n\t\"\\x18organization_role_source\\x18\\x04 \\x01(\\x0e23.buf.alpha.registry.v1alpha1.OrganizationRoleSourceR\\x16organizationRoleSource\\\"/\\n\" +\n\t\"\\x11CreateUserRequest\\x12\\x1a\\n\" +\n\t\"\\busername\\x18\\x01 \\x01(\\tR\\busername\\\"K\\n\" +\n\t\"\\x12CreateUserResponse\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\\" \\n\" +\n\t\"\\x0eGetUserRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\\"H\\n\" +\n\t\"\\x0fGetUserResponse\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\\"6\\n\" +\n\t\"\\x18GetUserByUsernameRequest\\x12\\x1a\\n\" +\n\t\"\\busername\\x18\\x01 \\x01(\\tR\\busername\\\"R\\n\" +\n\t\"\\x19GetUserByUsernameResponse\\x125\\n\" +\n\t\"\\x04user\\x18\\x01 \\x01(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x04user\\\"\\x8f\\x02\\n\" +\n\t\"\\x10ListUsersRequest\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x01 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x02 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x03 \\x01(\\bR\\areverse\\x12R\\n\" +\n\t\"\\x11user_state_filter\\x18\\x04 \\x01(\\x0e2&.buf.alpha.registry.v1alpha1.UserStateR\\x0fuserStateFilter\\x12Q\\n\" +\n\t\"\\x11user_type_filters\\x18\\x05 \\x03(\\x0e2%.buf.alpha.registry.v1alpha1.UserTypeR\\x0fuserTypeFilters\\\"t\\n\" +\n\t\"\\x11ListUsersResponse\\x127\\n\" +\n\t\"\\x05users\\x18\\x01 \\x03(\\v2!.buf.alpha.registry.v1alpha1.UserR\\x05users\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x9d\\x01\\n\" +\n\t\"\\x1cListOrganizationUsersRequest\\x12'\\n\" +\n\t\"\\x0forganization_id\\x18\\x01 \\x01(\\tR\\x0eorganizationId\\x12\\x1b\\n\" +\n\t\"\\tpage_size\\x18\\x02 \\x01(\\rR\\bpageSize\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\x12\\x18\\n\" +\n\t\"\\areverse\\x18\\x04 \\x01(\\bR\\areverse\\\"\\x8c\\x01\\n\" +\n\t\"\\x1dListOrganizationUsersResponse\\x12C\\n\" +\n\t\"\\x05users\\x18\\x01 \\x03(\\v2-.buf.alpha.registry.v1alpha1.OrganizationUserR\\x05users\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\x13\\n\" +\n\t\"\\x11DeleteUserRequest\\\"\\x14\\n\" +\n\t\"\\x12DeleteUserResponse\\\"'\\n\" +\n\t\"\\x15DeactivateUserRequest\\x12\\x0e\\n\" +\n\t\"\\x02id\\x18\\x01 \\x01(\\tR\\x02id\\\"\\x18\\n\" +\n\t\"\\x16DeactivateUserResponse\\\"\\x80\\x01\\n\" +\n\t\"\\x1bUpdateUserServerRoleRequest\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x01 \\x01(\\tR\\x06userId\\x12H\\n\" +\n\t\"\\vserver_role\\x18\\x02 \\x01(\\x0e2'.buf.alpha.registry.v1alpha1.ServerRoleR\\n\" +\n\t\"serverRole\\\"\\x1e\\n\" +\n\t\"\\x1cUpdateUserServerRoleResponse\\\"g\\n\" +\n\t\"\\x11CountUsersRequest\\x12R\\n\" +\n\t\"\\x11user_state_filter\\x18\\x01 \\x01(\\x0e2&.buf.alpha.registry.v1alpha1.UserStateR\\x0fuserStateFilter\\\"5\\n\" +\n\t\"\\x12CountUsersResponse\\x12\\x1f\\n\" +\n\t\"\\vtotal_count\\x18\\x01 \\x01(\\rR\\n\" +\n\t\"totalCount\\\"\\x8a\\x01\\n\" +\n\t\"\\x19UpdateUserSettingsRequest\\x12\\x17\\n\" +\n\t\"\\auser_id\\x18\\x01 \\x01(\\tR\\x06userId\\x12%\\n\" +\n\t\"\\vdescription\\x18\\x02 \\x01(\\tH\\x00R\\vdescription\\x88\\x01\\x01\\x12\\x15\\n\" +\n\t\"\\x03url\\x18\\x03 \\x01(\\tH\\x01R\\x03url\\x88\\x01\\x01B\\x0e\\n\" +\n\t\"\\f_descriptionB\\x06\\n\" +\n\t\"\\x04_url\\\"\\x1c\\n\" +\n\t\"\\x1aUpdateUserSettingsResponse*Z\\n\" +\n\t\"\\tUserState\\x12\\x1a\\n\" +\n\t\"\\x16USER_STATE_UNSPECIFIED\\x10\\x00\\x12\\x15\\n\" +\n\t\"\\x11USER_STATE_ACTIVE\\x10\\x01\\x12\\x1a\\n\" +\n\t\"\\x16USER_STATE_DEACTIVATED\\x10\\x02*j\\n\" +\n\t\"\\bUserType\\x12\\x19\\n\" +\n\t\"\\x15USER_TYPE_UNSPECIFIED\\x10\\x00\\x12\\x16\\n\" +\n\t\"\\x12USER_TYPE_PERSONAL\\x10\\x01\\x12\\x15\\n\" +\n\t\"\\x11USER_TYPE_MACHINE\\x10\\x02\\x12\\x14\\n\" +\n\t\"\\x10USER_TYPE_SYSTEM\\x10\\x032\\xfb\\t\\n\" +\n\t\"\\vUserService\\x12r\\n\" +\n\t\"\\n\" +\n\t\"CreateUser\\x12..buf.alpha.registry.v1alpha1.CreateUserRequest\\x1a/.buf.alpha.registry.v1alpha1.CreateUserResponse\\\"\\x03\\x90\\x02\\x02\\x12i\\n\" +\n\t\"\\aGetUser\\x12+.buf.alpha.registry.v1alpha1.GetUserRequest\\x1a,.buf.alpha.registry.v1alpha1.GetUserResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x87\\x01\\n\" +\n\t\"\\x11GetUserByUsername\\x125.buf.alpha.registry.v1alpha1.GetUserByUsernameRequest\\x1a6.buf.alpha.registry.v1alpha1.GetUserByUsernameResponse\\\"\\x03\\x90\\x02\\x01\\x12o\\n\" +\n\t\"\\tListUsers\\x12-.buf.alpha.registry.v1alpha1.ListUsersRequest\\x1a..buf.alpha.registry.v1alpha1.ListUsersResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x93\\x01\\n\" +\n\t\"\\x15ListOrganizationUsers\\x129.buf.alpha.registry.v1alpha1.ListOrganizationUsersRequest\\x1a:.buf.alpha.registry.v1alpha1.ListOrganizationUsersResponse\\\"\\x03\\x90\\x02\\x01\\x12r\\n\" +\n\t\"\\n\" +\n\t\"DeleteUser\\x12..buf.alpha.registry.v1alpha1.DeleteUserRequest\\x1a/.buf.alpha.registry.v1alpha1.DeleteUserResponse\\\"\\x03\\x90\\x02\\x02\\x12~\\n\" +\n\t\"\\x0eDeactivateUser\\x122.buf.alpha.registry.v1alpha1.DeactivateUserRequest\\x1a3.buf.alpha.registry.v1alpha1.DeactivateUserResponse\\\"\\x03\\x90\\x02\\x02\\x12\\x8b\\x01\\n\" +\n\t\"\\x14UpdateUserServerRole\\x128.buf.alpha.registry.v1alpha1.UpdateUserServerRoleRequest\\x1a9.buf.alpha.registry.v1alpha1.UpdateUserServerRoleResponse\\x12r\\n\" +\n\t\"\\n\" +\n\t\"CountUsers\\x12..buf.alpha.registry.v1alpha1.CountUsersRequest\\x1a/.buf.alpha.registry.v1alpha1.CountUsersResponse\\\"\\x03\\x90\\x02\\x01\\x12\\x85\\x01\\n\" +\n\t\"\\x12UpdateUserSettings\\x126.buf.alpha.registry.v1alpha1.UpdateUserSettingsRequest\\x1a7.buf.alpha.registry.v1alpha1.UpdateUserSettingsResponseB\\x96\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\tUserProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_user_proto_enumTypes = make([]protoimpl.EnumInfo, 2)\nvar file_buf_alpha_registry_v1alpha1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 22)\nvar file_buf_alpha_registry_v1alpha1_user_proto_goTypes = []any{\n\t(UserState)(0),                        // 0: buf.alpha.registry.v1alpha1.UserState\n\t(UserType)(0),                         // 1: buf.alpha.registry.v1alpha1.UserType\n\t(*User)(nil),                          // 2: buf.alpha.registry.v1alpha1.User\n\t(*OrganizationUser)(nil),              // 3: buf.alpha.registry.v1alpha1.OrganizationUser\n\t(*CreateUserRequest)(nil),             // 4: buf.alpha.registry.v1alpha1.CreateUserRequest\n\t(*CreateUserResponse)(nil),            // 5: buf.alpha.registry.v1alpha1.CreateUserResponse\n\t(*GetUserRequest)(nil),                // 6: buf.alpha.registry.v1alpha1.GetUserRequest\n\t(*GetUserResponse)(nil),               // 7: buf.alpha.registry.v1alpha1.GetUserResponse\n\t(*GetUserByUsernameRequest)(nil),      // 8: buf.alpha.registry.v1alpha1.GetUserByUsernameRequest\n\t(*GetUserByUsernameResponse)(nil),     // 9: buf.alpha.registry.v1alpha1.GetUserByUsernameResponse\n\t(*ListUsersRequest)(nil),              // 10: buf.alpha.registry.v1alpha1.ListUsersRequest\n\t(*ListUsersResponse)(nil),             // 11: buf.alpha.registry.v1alpha1.ListUsersResponse\n\t(*ListOrganizationUsersRequest)(nil),  // 12: buf.alpha.registry.v1alpha1.ListOrganizationUsersRequest\n\t(*ListOrganizationUsersResponse)(nil), // 13: buf.alpha.registry.v1alpha1.ListOrganizationUsersResponse\n\t(*DeleteUserRequest)(nil),             // 14: buf.alpha.registry.v1alpha1.DeleteUserRequest\n\t(*DeleteUserResponse)(nil),            // 15: buf.alpha.registry.v1alpha1.DeleteUserResponse\n\t(*DeactivateUserRequest)(nil),         // 16: buf.alpha.registry.v1alpha1.DeactivateUserRequest\n\t(*DeactivateUserResponse)(nil),        // 17: buf.alpha.registry.v1alpha1.DeactivateUserResponse\n\t(*UpdateUserServerRoleRequest)(nil),   // 18: buf.alpha.registry.v1alpha1.UpdateUserServerRoleRequest\n\t(*UpdateUserServerRoleResponse)(nil),  // 19: buf.alpha.registry.v1alpha1.UpdateUserServerRoleResponse\n\t(*CountUsersRequest)(nil),             // 20: buf.alpha.registry.v1alpha1.CountUsersRequest\n\t(*CountUsersResponse)(nil),            // 21: buf.alpha.registry.v1alpha1.CountUsersResponse\n\t(*UpdateUserSettingsRequest)(nil),     // 22: buf.alpha.registry.v1alpha1.UpdateUserSettingsRequest\n\t(*UpdateUserSettingsResponse)(nil),    // 23: buf.alpha.registry.v1alpha1.UpdateUserSettingsResponse\n\t(*timestamppb.Timestamp)(nil),         // 24: google.protobuf.Timestamp\n\t(VerificationStatus)(0),               // 25: buf.alpha.registry.v1alpha1.VerificationStatus\n\t(OrganizationRole)(0),                 // 26: buf.alpha.registry.v1alpha1.OrganizationRole\n\t(OrganizationRoleSource)(0),           // 27: buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t(ServerRole)(0),                       // 28: buf.alpha.registry.v1alpha1.ServerRole\n}\nvar file_buf_alpha_registry_v1alpha1_user_proto_depIdxs = []int32{\n\t24, // 0: buf.alpha.registry.v1alpha1.User.create_time:type_name -> google.protobuf.Timestamp\n\t24, // 1: buf.alpha.registry.v1alpha1.User.update_time:type_name -> google.protobuf.Timestamp\n\t25, // 2: buf.alpha.registry.v1alpha1.User.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus\n\t1,  // 3: buf.alpha.registry.v1alpha1.User.user_type:type_name -> buf.alpha.registry.v1alpha1.UserType\n\t2,  // 4: buf.alpha.registry.v1alpha1.OrganizationUser.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t26, // 5: buf.alpha.registry.v1alpha1.OrganizationUser.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole\n\t27, // 6: buf.alpha.registry.v1alpha1.OrganizationUser.organization_role_source:type_name -> buf.alpha.registry.v1alpha1.OrganizationRoleSource\n\t2,  // 7: buf.alpha.registry.v1alpha1.CreateUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t2,  // 8: buf.alpha.registry.v1alpha1.GetUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t2,  // 9: buf.alpha.registry.v1alpha1.GetUserByUsernameResponse.user:type_name -> buf.alpha.registry.v1alpha1.User\n\t0,  // 10: buf.alpha.registry.v1alpha1.ListUsersRequest.user_state_filter:type_name -> buf.alpha.registry.v1alpha1.UserState\n\t1,  // 11: buf.alpha.registry.v1alpha1.ListUsersRequest.user_type_filters:type_name -> buf.alpha.registry.v1alpha1.UserType\n\t2,  // 12: buf.alpha.registry.v1alpha1.ListUsersResponse.users:type_name -> buf.alpha.registry.v1alpha1.User\n\t3,  // 13: buf.alpha.registry.v1alpha1.ListOrganizationUsersResponse.users:type_name -> buf.alpha.registry.v1alpha1.OrganizationUser\n\t28, // 14: buf.alpha.registry.v1alpha1.UpdateUserServerRoleRequest.server_role:type_name -> buf.alpha.registry.v1alpha1.ServerRole\n\t0,  // 15: buf.alpha.registry.v1alpha1.CountUsersRequest.user_state_filter:type_name -> buf.alpha.registry.v1alpha1.UserState\n\t4,  // 16: buf.alpha.registry.v1alpha1.UserService.CreateUser:input_type -> buf.alpha.registry.v1alpha1.CreateUserRequest\n\t6,  // 17: buf.alpha.registry.v1alpha1.UserService.GetUser:input_type -> buf.alpha.registry.v1alpha1.GetUserRequest\n\t8,  // 18: buf.alpha.registry.v1alpha1.UserService.GetUserByUsername:input_type -> buf.alpha.registry.v1alpha1.GetUserByUsernameRequest\n\t10, // 19: buf.alpha.registry.v1alpha1.UserService.ListUsers:input_type -> buf.alpha.registry.v1alpha1.ListUsersRequest\n\t12, // 20: buf.alpha.registry.v1alpha1.UserService.ListOrganizationUsers:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationUsersRequest\n\t14, // 21: buf.alpha.registry.v1alpha1.UserService.DeleteUser:input_type -> buf.alpha.registry.v1alpha1.DeleteUserRequest\n\t16, // 22: buf.alpha.registry.v1alpha1.UserService.DeactivateUser:input_type -> buf.alpha.registry.v1alpha1.DeactivateUserRequest\n\t18, // 23: buf.alpha.registry.v1alpha1.UserService.UpdateUserServerRole:input_type -> buf.alpha.registry.v1alpha1.UpdateUserServerRoleRequest\n\t20, // 24: buf.alpha.registry.v1alpha1.UserService.CountUsers:input_type -> buf.alpha.registry.v1alpha1.CountUsersRequest\n\t22, // 25: buf.alpha.registry.v1alpha1.UserService.UpdateUserSettings:input_type -> buf.alpha.registry.v1alpha1.UpdateUserSettingsRequest\n\t5,  // 26: buf.alpha.registry.v1alpha1.UserService.CreateUser:output_type -> buf.alpha.registry.v1alpha1.CreateUserResponse\n\t7,  // 27: buf.alpha.registry.v1alpha1.UserService.GetUser:output_type -> buf.alpha.registry.v1alpha1.GetUserResponse\n\t9,  // 28: buf.alpha.registry.v1alpha1.UserService.GetUserByUsername:output_type -> buf.alpha.registry.v1alpha1.GetUserByUsernameResponse\n\t11, // 29: buf.alpha.registry.v1alpha1.UserService.ListUsers:output_type -> buf.alpha.registry.v1alpha1.ListUsersResponse\n\t13, // 30: buf.alpha.registry.v1alpha1.UserService.ListOrganizationUsers:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationUsersResponse\n\t15, // 31: buf.alpha.registry.v1alpha1.UserService.DeleteUser:output_type -> buf.alpha.registry.v1alpha1.DeleteUserResponse\n\t17, // 32: buf.alpha.registry.v1alpha1.UserService.DeactivateUser:output_type -> buf.alpha.registry.v1alpha1.DeactivateUserResponse\n\t19, // 33: buf.alpha.registry.v1alpha1.UserService.UpdateUserServerRole:output_type -> buf.alpha.registry.v1alpha1.UpdateUserServerRoleResponse\n\t21, // 34: buf.alpha.registry.v1alpha1.UserService.CountUsers:output_type -> buf.alpha.registry.v1alpha1.CountUsersResponse\n\t23, // 35: buf.alpha.registry.v1alpha1.UserService.UpdateUserSettings:output_type -> buf.alpha.registry.v1alpha1.UpdateUserSettingsResponse\n\t26, // [26:36] is the sub-list for method output_type\n\t16, // [16:26] is the sub-list for method input_type\n\t16, // [16:16] is the sub-list for extension type_name\n\t16, // [16:16] is the sub-list for extension extendee\n\t0,  // [0:16] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_user_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_user_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_user_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_registry_v1alpha1_role_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_verification_status_proto_init()\n\tfile_buf_alpha_registry_v1alpha1_user_proto_msgTypes[20].OneofWrappers = []any{}\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_buf_alpha_registry_v1alpha1_user_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_user_proto_rawDesc)),\n\t\t\tNumEnums:      2,\n\t\t\tNumMessages:   22,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_user_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_user_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_user_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_user_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_user_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_user_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_user_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/verification_status.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/verification_status.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// VerificationStatus is the verification status of an owner on if we recognize them,\n// an owner can be either user or organization.\ntype VerificationStatus int32\n\nconst (\n\tVerificationStatus_VERIFICATION_STATUS_UNSPECIFIED VerificationStatus = 0\n\t// OFFICIAL indicates that the owner is maintained by Buf.\n\tVerificationStatus_VERIFICATION_STATUS_OFFICIAL VerificationStatus = 1\n\t// VERIFIED_PUBLISHER indicates that the owner is a third-party that has been\n\t// verified by Buf.\n\tVerificationStatus_VERIFICATION_STATUS_VERIFIED_PUBLISHER VerificationStatus = 2\n)\n\n// Enum value maps for VerificationStatus.\nvar (\n\tVerificationStatus_name = map[int32]string{\n\t\t0: \"VERIFICATION_STATUS_UNSPECIFIED\",\n\t\t1: \"VERIFICATION_STATUS_OFFICIAL\",\n\t\t2: \"VERIFICATION_STATUS_VERIFIED_PUBLISHER\",\n\t}\n\tVerificationStatus_value = map[string]int32{\n\t\t\"VERIFICATION_STATUS_UNSPECIFIED\":        0,\n\t\t\"VERIFICATION_STATUS_OFFICIAL\":           1,\n\t\t\"VERIFICATION_STATUS_VERIFIED_PUBLISHER\": 2,\n\t}\n)\n\nfunc (x VerificationStatus) Enum() *VerificationStatus {\n\tp := new(VerificationStatus)\n\t*p = x\n\treturn p\n}\n\nfunc (x VerificationStatus) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (VerificationStatus) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes[0].Descriptor()\n}\n\nfunc (VerificationStatus) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes[0]\n}\n\nfunc (x VerificationStatus) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\nvar File_buf_alpha_registry_v1alpha1_verification_status_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"5buf/alpha/registry/v1alpha1/verification_status.proto\\x12\\x1bbuf.alpha.registry.v1alpha1*\\x87\\x01\\n\" +\n\t\"\\x12VerificationStatus\\x12#\\n\" +\n\t\"\\x1fVERIFICATION_STATUS_UNSPECIFIED\\x10\\x00\\x12 \\n\" +\n\t\"\\x1cVERIFICATION_STATUS_OFFICIAL\\x10\\x01\\x12*\\n\" +\n\t\"&VERIFICATION_STATUS_VERIFIED_PUBLISHER\\x10\\x02B\\xa4\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\x17VerificationStatusProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_verification_status_proto_goTypes = []any{\n\t(VerificationStatus)(0), // 0: buf.alpha.registry.v1alpha1.VerificationStatus\n}\nvar file_buf_alpha_registry_v1alpha1_verification_status_proto_depIdxs = []int32{\n\t0, // [0:0] is the sub-list for method output_type\n\t0, // [0:0] is the sub-list for method input_type\n\t0, // [0:0] is the sub-list for extension type_name\n\t0, // [0:0] is the sub-list for extension extendee\n\t0, // [0:0] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_registry_v1alpha1_verification_status_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_verification_status_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_verification_status_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_buf_alpha_registry_v1alpha1_verification_status_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   0,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_verification_status_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_verification_status_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_verification_status_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_verification_status_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_verification_status_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/registry/v1alpha1/webhook.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/registry/v1alpha1/webhook.proto\n\npackage registryv1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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\n// WebhookEvent contains the currently supported webhook event types.\ntype WebhookEvent int32\n\nconst (\n\t// WEBHOOK_EVENT_UNSPECIFIED is a safe noop default for webhook events\n\t// subscription. It will trigger an error if trying to register a webhook with\n\t// this event.\n\tWebhookEvent_WEBHOOK_EVENT_UNSPECIFIED WebhookEvent = 0\n\t// WEBHOOK_EVENT_REPOSITORY_PUSH is emitted whenever a successful buf push is\n\t// completed for a specific repository.\n\tWebhookEvent_WEBHOOK_EVENT_REPOSITORY_PUSH WebhookEvent = 1\n)\n\n// Enum value maps for WebhookEvent.\nvar (\n\tWebhookEvent_name = map[int32]string{\n\t\t0: \"WEBHOOK_EVENT_UNSPECIFIED\",\n\t\t1: \"WEBHOOK_EVENT_REPOSITORY_PUSH\",\n\t}\n\tWebhookEvent_value = map[string]int32{\n\t\t\"WEBHOOK_EVENT_UNSPECIFIED\":     0,\n\t\t\"WEBHOOK_EVENT_REPOSITORY_PUSH\": 1,\n\t}\n)\n\nfunc (x WebhookEvent) Enum() *WebhookEvent {\n\tp := new(WebhookEvent)\n\t*p = x\n\treturn p\n}\n\nfunc (x WebhookEvent) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (WebhookEvent) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes[0].Descriptor()\n}\n\nfunc (WebhookEvent) Type() protoreflect.EnumType {\n\treturn &file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes[0]\n}\n\nfunc (x WebhookEvent) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\n// CreateWebhookRequest is the proto request representation of a\n// webhook request body.\ntype CreateWebhookRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_WebhookEvent   WebhookEvent           `protobuf:\"varint,1,opt,name=webhook_event,json=webhookEvent,proto3,enum=buf.alpha.registry.v1alpha1.WebhookEvent\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,3,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_CallbackUrl    string                 `protobuf:\"bytes,4,opt,name=callback_url,json=callbackUrl,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *CreateWebhookRequest) Reset() {\n\t*x = CreateWebhookRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateWebhookRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateWebhookRequest) ProtoMessage() {}\n\nfunc (x *CreateWebhookRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_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\nfunc (x *CreateWebhookRequest) GetWebhookEvent() WebhookEvent {\n\tif x != nil {\n\t\treturn x.xxx_hidden_WebhookEvent\n\t}\n\treturn WebhookEvent_WEBHOOK_EVENT_UNSPECIFIED\n}\n\nfunc (x *CreateWebhookRequest) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateWebhookRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateWebhookRequest) GetCallbackUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CallbackUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *CreateWebhookRequest) SetWebhookEvent(v WebhookEvent) {\n\tx.xxx_hidden_WebhookEvent = v\n}\n\nfunc (x *CreateWebhookRequest) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *CreateWebhookRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *CreateWebhookRequest) SetCallbackUrl(v string) {\n\tx.xxx_hidden_CallbackUrl = v\n}\n\ntype CreateWebhookRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The event to subscribe to for the given repository.\n\tWebhookEvent WebhookEvent\n\t// The owner name of the repository in the corresponding subscription request.\n\tOwnerName string\n\t// The repository name that the subscriber wishes create a subscription for.\n\tRepositoryName string\n\t// The subscriber's callback URL where notifications should be delivered.\n\tCallbackUrl string\n}\n\nfunc (b0 CreateWebhookRequest_builder) Build() *CreateWebhookRequest {\n\tm0 := &CreateWebhookRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_WebhookEvent = b.WebhookEvent\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_CallbackUrl = b.CallbackUrl\n\treturn m0\n}\n\n// CreateWebhookResponse is the proto response representation\n// of a webhook request.\ntype CreateWebhookResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Webhook *Webhook               `protobuf:\"bytes,1,opt,name=webhook,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *CreateWebhookResponse) Reset() {\n\t*x = CreateWebhookResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CreateWebhookResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CreateWebhookResponse) ProtoMessage() {}\n\nfunc (x *CreateWebhookResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_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\nfunc (x *CreateWebhookResponse) GetWebhook() *Webhook {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Webhook\n\t}\n\treturn nil\n}\n\nfunc (x *CreateWebhookResponse) SetWebhook(v *Webhook) {\n\tx.xxx_hidden_Webhook = v\n}\n\nfunc (x *CreateWebhookResponse) HasWebhook() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Webhook != nil\n}\n\nfunc (x *CreateWebhookResponse) ClearWebhook() {\n\tx.xxx_hidden_Webhook = nil\n}\n\ntype CreateWebhookResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Created webhook subscription.\n\tWebhook *Webhook\n}\n\nfunc (b0 CreateWebhookResponse_builder) Build() *CreateWebhookResponse {\n\tm0 := &CreateWebhookResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Webhook = b.Webhook\n\treturn m0\n}\n\n// DeleteWebhookRequest is the request for unsubscribing to a webhook.\ntype DeleteWebhookRequest struct {\n\tstate                protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_WebhookId string                 `protobuf:\"bytes,1,opt,name=webhook_id,json=webhookId,proto3\"`\n\tunknownFields        protoimpl.UnknownFields\n\tsizeCache            protoimpl.SizeCache\n}\n\nfunc (x *DeleteWebhookRequest) Reset() {\n\t*x = DeleteWebhookRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteWebhookRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteWebhookRequest) ProtoMessage() {}\n\nfunc (x *DeleteWebhookRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_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\nfunc (x *DeleteWebhookRequest) GetWebhookId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_WebhookId\n\t}\n\treturn \"\"\n}\n\nfunc (x *DeleteWebhookRequest) SetWebhookId(v string) {\n\tx.xxx_hidden_WebhookId = v\n}\n\ntype DeleteWebhookRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The id of the webhook subscription to delete.\n\tWebhookId string\n}\n\nfunc (b0 DeleteWebhookRequest_builder) Build() *DeleteWebhookRequest {\n\tm0 := &DeleteWebhookRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_WebhookId = b.WebhookId\n\treturn m0\n}\n\n// DeleteWebhookResponse is the response for unsubscribing\n// from a webhook.\ntype DeleteWebhookResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *DeleteWebhookResponse) Reset() {\n\t*x = DeleteWebhookResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *DeleteWebhookResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*DeleteWebhookResponse) ProtoMessage() {}\n\nfunc (x *DeleteWebhookResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_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\ntype DeleteWebhookResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 DeleteWebhookResponse_builder) Build() *DeleteWebhookResponse {\n\tm0 := &DeleteWebhookResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\n// ListWebhooksRequest is the request to get the\n// list of subscribed webhooks for a given repository.\ntype ListWebhooksRequest struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,1,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,2,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_PageToken      string                 `protobuf:\"bytes,3,opt,name=page_token,json=pageToken,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ListWebhooksRequest) Reset() {\n\t*x = ListWebhooksRequest{}\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListWebhooksRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListWebhooksRequest) ProtoMessage() {}\n\nfunc (x *ListWebhooksRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_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\nfunc (x *ListWebhooksRequest) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListWebhooksRequest) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListWebhooksRequest) GetPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_PageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListWebhooksRequest) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *ListWebhooksRequest) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *ListWebhooksRequest) SetPageToken(v string) {\n\tx.xxx_hidden_PageToken = v\n}\n\ntype ListWebhooksRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The repository name given in the corresponding subscription request.\n\tRepositoryName string\n\t// The owner associated with the repository.\n\tOwnerName string\n\t// The page token for paginating.\n\tPageToken string\n}\n\nfunc (b0 ListWebhooksRequest_builder) Build() *ListWebhooksRequest {\n\tm0 := &ListWebhooksRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_PageToken = b.PageToken\n\treturn m0\n}\n\n// ListWebhooksResponse is the response for the list of\n// subscribed webhooks for a given repository.\ntype ListWebhooksResponse struct {\n\tstate                    protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Webhooks      *[]*Webhook            `protobuf:\"bytes,1,rep,name=webhooks,proto3\"`\n\txxx_hidden_NextPageToken string                 `protobuf:\"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3\"`\n\tunknownFields            protoimpl.UnknownFields\n\tsizeCache                protoimpl.SizeCache\n}\n\nfunc (x *ListWebhooksResponse) Reset() {\n\t*x = ListWebhooksResponse{}\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListWebhooksResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListWebhooksResponse) ProtoMessage() {}\n\nfunc (x *ListWebhooksResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_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\nfunc (x *ListWebhooksResponse) GetWebhooks() []*Webhook {\n\tif x != nil {\n\t\tif x.xxx_hidden_Webhooks != nil {\n\t\t\treturn *x.xxx_hidden_Webhooks\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListWebhooksResponse) GetNextPageToken() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_NextPageToken\n\t}\n\treturn \"\"\n}\n\nfunc (x *ListWebhooksResponse) SetWebhooks(v []*Webhook) {\n\tx.xxx_hidden_Webhooks = &v\n}\n\nfunc (x *ListWebhooksResponse) SetNextPageToken(v string) {\n\tx.xxx_hidden_NextPageToken = v\n}\n\ntype ListWebhooksResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The list of subscribed webhooks for a given repository.\n\tWebhooks []*Webhook\n\t// The next page token for paginating.\n\tNextPageToken string\n}\n\nfunc (b0 ListWebhooksResponse_builder) Build() *ListWebhooksResponse {\n\tm0 := &ListWebhooksResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Webhooks = &b.Webhooks\n\tx.xxx_hidden_NextPageToken = b.NextPageToken\n\treturn m0\n}\n\n// Webhook is the representation of a webhook repository event subscription.\ntype Webhook struct {\n\tstate                     protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Event          WebhookEvent           `protobuf:\"varint,1,opt,name=event,proto3,enum=buf.alpha.registry.v1alpha1.WebhookEvent\"`\n\txxx_hidden_WebhookId      string                 `protobuf:\"bytes,2,opt,name=webhook_id,json=webhookId,proto3\"`\n\txxx_hidden_CreateTime     *timestamppb.Timestamp `protobuf:\"bytes,3,opt,name=create_time,json=createTime,proto3\"`\n\txxx_hidden_UpdateTime     *timestamppb.Timestamp `protobuf:\"bytes,4,opt,name=update_time,json=updateTime,proto3\"`\n\txxx_hidden_RepositoryName string                 `protobuf:\"bytes,5,opt,name=repository_name,json=repositoryName,proto3\"`\n\txxx_hidden_OwnerName      string                 `protobuf:\"bytes,6,opt,name=owner_name,json=ownerName,proto3\"`\n\txxx_hidden_CallbackUrl    string                 `protobuf:\"bytes,7,opt,name=callback_url,json=callbackUrl,proto3\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *Webhook) Reset() {\n\t*x = Webhook{}\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Webhook) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Webhook) ProtoMessage() {}\n\nfunc (x *Webhook) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_registry_v1alpha1_webhook_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\nfunc (x *Webhook) GetEvent() WebhookEvent {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Event\n\t}\n\treturn WebhookEvent_WEBHOOK_EVENT_UNSPECIFIED\n}\n\nfunc (x *Webhook) GetWebhookId() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_WebhookId\n\t}\n\treturn \"\"\n}\n\nfunc (x *Webhook) GetCreateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CreateTime\n\t}\n\treturn nil\n}\n\nfunc (x *Webhook) GetUpdateTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UpdateTime\n\t}\n\treturn nil\n}\n\nfunc (x *Webhook) GetRepositoryName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Webhook) GetOwnerName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OwnerName\n\t}\n\treturn \"\"\n}\n\nfunc (x *Webhook) GetCallbackUrl() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_CallbackUrl\n\t}\n\treturn \"\"\n}\n\nfunc (x *Webhook) SetEvent(v WebhookEvent) {\n\tx.xxx_hidden_Event = v\n}\n\nfunc (x *Webhook) SetWebhookId(v string) {\n\tx.xxx_hidden_WebhookId = v\n}\n\nfunc (x *Webhook) SetCreateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_CreateTime = v\n}\n\nfunc (x *Webhook) SetUpdateTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_UpdateTime = v\n}\n\nfunc (x *Webhook) SetRepositoryName(v string) {\n\tx.xxx_hidden_RepositoryName = v\n}\n\nfunc (x *Webhook) SetOwnerName(v string) {\n\tx.xxx_hidden_OwnerName = v\n}\n\nfunc (x *Webhook) SetCallbackUrl(v string) {\n\tx.xxx_hidden_CallbackUrl = v\n}\n\nfunc (x *Webhook) HasCreateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_CreateTime != nil\n}\n\nfunc (x *Webhook) HasUpdateTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_UpdateTime != nil\n}\n\nfunc (x *Webhook) ClearCreateTime() {\n\tx.xxx_hidden_CreateTime = nil\n}\n\nfunc (x *Webhook) ClearUpdateTime() {\n\tx.xxx_hidden_UpdateTime = nil\n}\n\ntype Webhook_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The event associated with the subscription id.\n\tEvent WebhookEvent\n\t// The id of the associated subscription.\n\tWebhookId string\n\t// The webhook creation timestamp.\n\tCreateTime *timestamppb.Timestamp\n\t// The webhook last updated timestamp.\n\tUpdateTime *timestamppb.Timestamp\n\t// The webhook repository name.\n\tRepositoryName string\n\t// The webhook repository owner name.\n\tOwnerName string\n\t// The subscriber's callback URL where notifications are delivered. Currently\n\t// we only support Connect-powered backends with application/proto as the\n\t// content type. Make sure that your URL ends with\n\t// \"/buf.alpha.webhook.v1alpha1.EventService/Event\". For more information\n\t// about Connect, see https://connectrpc.com.\n\tCallbackUrl string\n}\n\nfunc (b0 Webhook_builder) Build() *Webhook {\n\tm0 := &Webhook{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Event = b.Event\n\tx.xxx_hidden_WebhookId = b.WebhookId\n\tx.xxx_hidden_CreateTime = b.CreateTime\n\tx.xxx_hidden_UpdateTime = b.UpdateTime\n\tx.xxx_hidden_RepositoryName = b.RepositoryName\n\tx.xxx_hidden_OwnerName = b.OwnerName\n\tx.xxx_hidden_CallbackUrl = b.CallbackUrl\n\treturn m0\n}\n\nvar File_buf_alpha_registry_v1alpha1_webhook_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_registry_v1alpha1_webhook_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\")buf/alpha/registry/v1alpha1/webhook.proto\\x12\\x1bbuf.alpha.registry.v1alpha1\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\xd1\\x01\\n\" +\n\t\"\\x14CreateWebhookRequest\\x12N\\n\" +\n\t\"\\rwebhook_event\\x18\\x01 \\x01(\\x0e2).buf.alpha.registry.v1alpha1.WebhookEventR\\fwebhookEvent\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x03 \\x01(\\tR\\x0erepositoryName\\x12!\\n\" +\n\t\"\\fcallback_url\\x18\\x04 \\x01(\\tR\\vcallbackUrl\\\"W\\n\" +\n\t\"\\x15CreateWebhookResponse\\x12>\\n\" +\n\t\"\\awebhook\\x18\\x01 \\x01(\\v2$.buf.alpha.registry.v1alpha1.WebhookR\\awebhook\\\"5\\n\" +\n\t\"\\x14DeleteWebhookRequest\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"webhook_id\\x18\\x01 \\x01(\\tR\\twebhookId\\\"\\x17\\n\" +\n\t\"\\x15DeleteWebhookResponse\\\"|\\n\" +\n\t\"\\x13ListWebhooksRequest\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x01 \\x01(\\tR\\x0erepositoryName\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x02 \\x01(\\tR\\townerName\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"page_token\\x18\\x03 \\x01(\\tR\\tpageToken\\\"\\x80\\x01\\n\" +\n\t\"\\x14ListWebhooksResponse\\x12@\\n\" +\n\t\"\\bwebhooks\\x18\\x01 \\x03(\\v2$.buf.alpha.registry.v1alpha1.WebhookR\\bwebhooks\\x12&\\n\" +\n\t\"\\x0fnext_page_token\\x18\\x02 \\x01(\\tR\\rnextPageToken\\\"\\xce\\x02\\n\" +\n\t\"\\aWebhook\\x12?\\n\" +\n\t\"\\x05event\\x18\\x01 \\x01(\\x0e2).buf.alpha.registry.v1alpha1.WebhookEventR\\x05event\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"webhook_id\\x18\\x02 \\x01(\\tR\\twebhookId\\x12;\\n\" +\n\t\"\\vcreate_time\\x18\\x03 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"createTime\\x12;\\n\" +\n\t\"\\vupdate_time\\x18\\x04 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\n\" +\n\t\"updateTime\\x12'\\n\" +\n\t\"\\x0frepository_name\\x18\\x05 \\x01(\\tR\\x0erepositoryName\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"owner_name\\x18\\x06 \\x01(\\tR\\townerName\\x12!\\n\" +\n\t\"\\fcallback_url\\x18\\a \\x01(\\tR\\vcallbackUrl*P\\n\" +\n\t\"\\fWebhookEvent\\x12\\x1d\\n\" +\n\t\"\\x19WEBHOOK_EVENT_UNSPECIFIED\\x10\\x00\\x12!\\n\" +\n\t\"\\x1dWEBHOOK_EVENT_REPOSITORY_PUSH\\x10\\x012\\x84\\x03\\n\" +\n\t\"\\x0eWebhookService\\x12{\\n\" +\n\t\"\\rCreateWebhook\\x121.buf.alpha.registry.v1alpha1.CreateWebhookRequest\\x1a2.buf.alpha.registry.v1alpha1.CreateWebhookResponse\\\"\\x03\\x90\\x02\\x02\\x12{\\n\" +\n\t\"\\rDeleteWebhook\\x121.buf.alpha.registry.v1alpha1.DeleteWebhookRequest\\x1a2.buf.alpha.registry.v1alpha1.DeleteWebhookResponse\\\"\\x03\\x90\\x02\\x02\\x12x\\n\" +\n\t\"\\fListWebhooks\\x120.buf.alpha.registry.v1alpha1.ListWebhooksRequest\\x1a1.buf.alpha.registry.v1alpha1.ListWebhooksResponse\\\"\\x03\\x90\\x02\\x01B\\x99\\x02\\n\" +\n\t\"\\x1fcom.buf.alpha.registry.v1alpha1B\\fWebhookProtoP\\x01ZYgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1;registryv1alpha1\\xa2\\x02\\x03BAR\\xaa\\x02\\x1bBuf.Alpha.Registry.V1alpha1\\xca\\x02\\x1bBuf\\\\Alpha\\\\Registry\\\\V1alpha1\\xe2\\x02'Buf\\\\Alpha\\\\Registry\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1eBuf::Alpha::Registry::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes = make([]protoimpl.MessageInfo, 7)\nvar file_buf_alpha_registry_v1alpha1_webhook_proto_goTypes = []any{\n\t(WebhookEvent)(0),             // 0: buf.alpha.registry.v1alpha1.WebhookEvent\n\t(*CreateWebhookRequest)(nil),  // 1: buf.alpha.registry.v1alpha1.CreateWebhookRequest\n\t(*CreateWebhookResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateWebhookResponse\n\t(*DeleteWebhookRequest)(nil),  // 3: buf.alpha.registry.v1alpha1.DeleteWebhookRequest\n\t(*DeleteWebhookResponse)(nil), // 4: buf.alpha.registry.v1alpha1.DeleteWebhookResponse\n\t(*ListWebhooksRequest)(nil),   // 5: buf.alpha.registry.v1alpha1.ListWebhooksRequest\n\t(*ListWebhooksResponse)(nil),  // 6: buf.alpha.registry.v1alpha1.ListWebhooksResponse\n\t(*Webhook)(nil),               // 7: buf.alpha.registry.v1alpha1.Webhook\n\t(*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp\n}\nvar file_buf_alpha_registry_v1alpha1_webhook_proto_depIdxs = []int32{\n\t0, // 0: buf.alpha.registry.v1alpha1.CreateWebhookRequest.webhook_event:type_name -> buf.alpha.registry.v1alpha1.WebhookEvent\n\t7, // 1: buf.alpha.registry.v1alpha1.CreateWebhookResponse.webhook:type_name -> buf.alpha.registry.v1alpha1.Webhook\n\t7, // 2: buf.alpha.registry.v1alpha1.ListWebhooksResponse.webhooks:type_name -> buf.alpha.registry.v1alpha1.Webhook\n\t0, // 3: buf.alpha.registry.v1alpha1.Webhook.event:type_name -> buf.alpha.registry.v1alpha1.WebhookEvent\n\t8, // 4: buf.alpha.registry.v1alpha1.Webhook.create_time:type_name -> google.protobuf.Timestamp\n\t8, // 5: buf.alpha.registry.v1alpha1.Webhook.update_time:type_name -> google.protobuf.Timestamp\n\t1, // 6: buf.alpha.registry.v1alpha1.WebhookService.CreateWebhook:input_type -> buf.alpha.registry.v1alpha1.CreateWebhookRequest\n\t3, // 7: buf.alpha.registry.v1alpha1.WebhookService.DeleteWebhook:input_type -> buf.alpha.registry.v1alpha1.DeleteWebhookRequest\n\t5, // 8: buf.alpha.registry.v1alpha1.WebhookService.ListWebhooks:input_type -> buf.alpha.registry.v1alpha1.ListWebhooksRequest\n\t2, // 9: buf.alpha.registry.v1alpha1.WebhookService.CreateWebhook:output_type -> buf.alpha.registry.v1alpha1.CreateWebhookResponse\n\t4, // 10: buf.alpha.registry.v1alpha1.WebhookService.DeleteWebhook:output_type -> buf.alpha.registry.v1alpha1.DeleteWebhookResponse\n\t6, // 11: buf.alpha.registry.v1alpha1.WebhookService.ListWebhooks:output_type -> buf.alpha.registry.v1alpha1.ListWebhooksResponse\n\t9, // [9:12] is the sub-list for method output_type\n\t6, // [6:9] 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_buf_alpha_registry_v1alpha1_webhook_proto_init() }\nfunc file_buf_alpha_registry_v1alpha1_webhook_proto_init() {\n\tif File_buf_alpha_registry_v1alpha1_webhook_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_buf_alpha_registry_v1alpha1_webhook_proto_rawDesc), len(file_buf_alpha_registry_v1alpha1_webhook_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   7,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_registry_v1alpha1_webhook_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_registry_v1alpha1_webhook_proto_depIdxs,\n\t\tEnumInfos:         file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes,\n\t\tMessageInfos:      file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_registry_v1alpha1_webhook_proto = out.File\n\tfile_buf_alpha_registry_v1alpha1_webhook_proto_goTypes = nil\n\tfile_buf_alpha_registry_v1alpha1_webhook_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/studio/v1alpha1/invoke.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/studio/v1alpha1/invoke.proto\n\n// The buf.alpha.studio.v1alpha1 package contains types used by the buf studio\n// agent. Because browsers are not capable of sending gRPC requests directly,\n// users can run a studio agent to that receives enveloped requests from the\n// browser and forwards them as gRPC requests.\n//\n// Ideally the agent would be simple protocol translating HTTP proxy without\n// requiring any custom envelope. Unfortunately, js in the browser cannot set\n// per request proxy configuration and we cannot specify that we want to open a\n// connection to the request agent while specifying a different server in the\n// request's Host header. The studio agent and UI could communicate this through\n// a custom header instead, but reading custom headers requires a CORS-preflight\n// request.\n//\n// To facilitate easier deployment it in environments with complicated edge\n// configuration, it is a goal for the agent and UI to communicate without the\n// need for a CORS-preflight requests. This limits our ability to use custom\n// headers and restricts allowed values for the Content-Type header. Due to this\n// we cannot simply use gRPC-Web with an additional header, but instead rely on\n// enveloping the request and responses in a base64 encoded binary proto message\n// sent over a POST endpoint with text/plain as Content-Type.\n//\n// We may explore other transports such as WebSockets or WebTransport, at which\n// point we should define proper proto services and methods here as well.\n\npackage studiov1alpha1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// Headers encode HTTP headers.\ntype Headers struct {\n\tstate            protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Key   string                 `protobuf:\"bytes,1,opt,name=key,proto3\"`\n\txxx_hidden_Value []string               `protobuf:\"bytes,2,rep,name=value,proto3\"`\n\tunknownFields    protoimpl.UnknownFields\n\tsizeCache        protoimpl.SizeCache\n}\n\nfunc (x *Headers) Reset() {\n\t*x = Headers{}\n\tmi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *Headers) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*Headers) ProtoMessage() {}\n\nfunc (x *Headers) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_studio_v1alpha1_invoke_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\nfunc (x *Headers) GetKey() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Key\n\t}\n\treturn \"\"\n}\n\nfunc (x *Headers) GetValue() []string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Value\n\t}\n\treturn nil\n}\n\nfunc (x *Headers) SetKey(v string) {\n\tx.xxx_hidden_Key = v\n}\n\nfunc (x *Headers) SetValue(v []string) {\n\tx.xxx_hidden_Value = v\n}\n\ntype Headers_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tKey   string\n\tValue []string\n}\n\nfunc (b0 Headers_builder) Build() *Headers {\n\tm0 := &Headers{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Key = b.Key\n\tx.xxx_hidden_Value = b.Value\n\treturn m0\n}\n\n// InvokeRequest encodes an enveloped RPC request. See the package documentation\n// for more information.\ntype InvokeRequest struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Target  string                 `protobuf:\"bytes,1,opt,name=target,proto3\"`\n\txxx_hidden_Headers *[]*Headers            `protobuf:\"bytes,2,rep,name=headers,proto3\"`\n\txxx_hidden_Body    []byte                 `protobuf:\"bytes,3,opt,name=body,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *InvokeRequest) Reset() {\n\t*x = InvokeRequest{}\n\tmi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *InvokeRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*InvokeRequest) ProtoMessage() {}\n\nfunc (x *InvokeRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_studio_v1alpha1_invoke_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\nfunc (x *InvokeRequest) GetTarget() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Target\n\t}\n\treturn \"\"\n}\n\nfunc (x *InvokeRequest) GetHeaders() []*Headers {\n\tif x != nil {\n\t\tif x.xxx_hidden_Headers != nil {\n\t\t\treturn *x.xxx_hidden_Headers\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *InvokeRequest) GetBody() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Body\n\t}\n\treturn nil\n}\n\nfunc (x *InvokeRequest) SetTarget(v string) {\n\tx.xxx_hidden_Target = v\n}\n\nfunc (x *InvokeRequest) SetHeaders(v []*Headers) {\n\tx.xxx_hidden_Headers = &v\n}\n\nfunc (x *InvokeRequest) SetBody(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Body = v\n}\n\ntype InvokeRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Target server the agent should forward this request to, e.g.\n\t// \"https://api.acme.corp/pkg.Service/Method\". Using the \"http\" scheme will\n\t// cause the request to be forwarded as h2c, whereas \"https\" forwards the\n\t// request with regular h2.\n\tTarget string\n\t// Headers to send with the request. If body is set, a Content-Type header\n\t// must be specified.\n\tHeaders []*Headers\n\t// The message to be sent in the request (without any protocol specific framing).\n\tBody []byte\n}\n\nfunc (b0 InvokeRequest_builder) Build() *InvokeRequest {\n\tm0 := &InvokeRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Target = b.Target\n\tx.xxx_hidden_Headers = &b.Headers\n\tx.xxx_hidden_Body = b.Body\n\treturn m0\n}\n\n// InvokeResponse encodes an enveloped RPC response. See the package documentation\n// for more information.\ntype InvokeResponse struct {\n\tstate               protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Headers  *[]*Headers            `protobuf:\"bytes,1,rep,name=headers,proto3\"`\n\txxx_hidden_Body     []byte                 `protobuf:\"bytes,2,opt,name=body,proto3\"`\n\txxx_hidden_Trailers *[]*Headers            `protobuf:\"bytes,3,rep,name=trailers,proto3\"`\n\tunknownFields       protoimpl.UnknownFields\n\tsizeCache           protoimpl.SizeCache\n}\n\nfunc (x *InvokeResponse) Reset() {\n\t*x = InvokeResponse{}\n\tmi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *InvokeResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*InvokeResponse) ProtoMessage() {}\n\nfunc (x *InvokeResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_studio_v1alpha1_invoke_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\nfunc (x *InvokeResponse) GetHeaders() []*Headers {\n\tif x != nil {\n\t\tif x.xxx_hidden_Headers != nil {\n\t\t\treturn *x.xxx_hidden_Headers\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *InvokeResponse) GetBody() []byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Body\n\t}\n\treturn nil\n}\n\nfunc (x *InvokeResponse) GetTrailers() []*Headers {\n\tif x != nil {\n\t\tif x.xxx_hidden_Trailers != nil {\n\t\t\treturn *x.xxx_hidden_Trailers\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *InvokeResponse) SetHeaders(v []*Headers) {\n\tx.xxx_hidden_Headers = &v\n}\n\nfunc (x *InvokeResponse) SetBody(v []byte) {\n\tif v == nil {\n\t\tv = []byte{}\n\t}\n\tx.xxx_hidden_Body = v\n}\n\nfunc (x *InvokeResponse) SetTrailers(v []*Headers) {\n\tx.xxx_hidden_Trailers = &v\n}\n\ntype InvokeResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Headers received in the response.\n\tHeaders []*Headers\n\t// The encoded message received in the response (without protocol specific framing).\n\tBody []byte\n\t// Trailers received in the response.\n\tTrailers []*Headers\n}\n\nfunc (b0 InvokeResponse_builder) Build() *InvokeResponse {\n\tm0 := &InvokeResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Headers = &b.Headers\n\tx.xxx_hidden_Body = b.Body\n\tx.xxx_hidden_Trailers = &b.Trailers\n\treturn m0\n}\n\nvar File_buf_alpha_studio_v1alpha1_invoke_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_studio_v1alpha1_invoke_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"&buf/alpha/studio/v1alpha1/invoke.proto\\x12\\x19buf.alpha.studio.v1alpha1\\\"1\\n\" +\n\t\"\\aHeaders\\x12\\x10\\n\" +\n\t\"\\x03key\\x18\\x01 \\x01(\\tR\\x03key\\x12\\x14\\n\" +\n\t\"\\x05value\\x18\\x02 \\x03(\\tR\\x05value\\\"y\\n\" +\n\t\"\\rInvokeRequest\\x12\\x16\\n\" +\n\t\"\\x06target\\x18\\x01 \\x01(\\tR\\x06target\\x12<\\n\" +\n\t\"\\aheaders\\x18\\x02 \\x03(\\v2\\\".buf.alpha.studio.v1alpha1.HeadersR\\aheaders\\x12\\x12\\n\" +\n\t\"\\x04body\\x18\\x03 \\x01(\\fR\\x04body\\\"\\xa2\\x01\\n\" +\n\t\"\\x0eInvokeResponse\\x12<\\n\" +\n\t\"\\aheaders\\x18\\x01 \\x03(\\v2\\\".buf.alpha.studio.v1alpha1.HeadersR\\aheaders\\x12\\x12\\n\" +\n\t\"\\x04body\\x18\\x02 \\x01(\\fR\\x04body\\x12>\\n\" +\n\t\"\\btrailers\\x18\\x03 \\x03(\\v2\\\".buf.alpha.studio.v1alpha1.HeadersR\\btrailersB\\x8a\\x02\\n\" +\n\t\"\\x1dcom.buf.alpha.studio.v1alpha1B\\vInvokeProtoP\\x01ZUgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1;studiov1alpha1\\xa2\\x02\\x03BAS\\xaa\\x02\\x19Buf.Alpha.Studio.V1alpha1\\xca\\x02\\x19Buf\\\\Alpha\\\\Studio\\\\V1alpha1\\xe2\\x02%Buf\\\\Alpha\\\\Studio\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1cBuf::Alpha::Studio::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes = make([]protoimpl.MessageInfo, 3)\nvar file_buf_alpha_studio_v1alpha1_invoke_proto_goTypes = []any{\n\t(*Headers)(nil),        // 0: buf.alpha.studio.v1alpha1.Headers\n\t(*InvokeRequest)(nil),  // 1: buf.alpha.studio.v1alpha1.InvokeRequest\n\t(*InvokeResponse)(nil), // 2: buf.alpha.studio.v1alpha1.InvokeResponse\n}\nvar file_buf_alpha_studio_v1alpha1_invoke_proto_depIdxs = []int32{\n\t0, // 0: buf.alpha.studio.v1alpha1.InvokeRequest.headers:type_name -> buf.alpha.studio.v1alpha1.Headers\n\t0, // 1: buf.alpha.studio.v1alpha1.InvokeResponse.headers:type_name -> buf.alpha.studio.v1alpha1.Headers\n\t0, // 2: buf.alpha.studio.v1alpha1.InvokeResponse.trailers:type_name -> buf.alpha.studio.v1alpha1.Headers\n\t3, // [3:3] is the sub-list for method output_type\n\t3, // [3:3] is the sub-list for method input_type\n\t3, // [3:3] is the sub-list for extension type_name\n\t3, // [3:3] is the sub-list for extension extendee\n\t0, // [0:3] is the sub-list for field type_name\n}\n\nfunc init() { file_buf_alpha_studio_v1alpha1_invoke_proto_init() }\nfunc file_buf_alpha_studio_v1alpha1_invoke_proto_init() {\n\tif File_buf_alpha_studio_v1alpha1_invoke_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_buf_alpha_studio_v1alpha1_invoke_proto_rawDesc), len(file_buf_alpha_studio_v1alpha1_invoke_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   3,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_studio_v1alpha1_invoke_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_studio_v1alpha1_invoke_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_studio_v1alpha1_invoke_proto = out.File\n\tfile_buf_alpha_studio_v1alpha1_invoke_proto_goTypes = nil\n\tfile_buf_alpha_studio_v1alpha1_invoke_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/studio/v1alpha1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage studiov1alpha1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/webhook/v1alpha1/event.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: buf/alpha/webhook/v1alpha1/event.proto\n\npackage webhookv1alpha1\n\nimport (\n\tv1alpha1 \"github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1\"\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\ttimestamppb \"google.golang.org/protobuf/types/known/timestamppb\"\n\treflect \"reflect\"\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\n// EventRequest is the request payload that will be sent to the customer\n// that is subscribed to webhook events in the BSR.\ntype EventRequest struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Event   v1alpha1.WebhookEvent  `protobuf:\"varint,1,opt,name=event,proto3,enum=buf.alpha.registry.v1alpha1.WebhookEvent\"`\n\txxx_hidden_Payload *EventPayload          `protobuf:\"bytes,2,opt,name=payload,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *EventRequest) Reset() {\n\t*x = EventRequest{}\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *EventRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EventRequest) ProtoMessage() {}\n\nfunc (x *EventRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_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\nfunc (x *EventRequest) GetEvent() v1alpha1.WebhookEvent {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Event\n\t}\n\treturn v1alpha1.WebhookEvent(0)\n}\n\nfunc (x *EventRequest) GetPayload() *EventPayload {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Payload\n\t}\n\treturn nil\n}\n\nfunc (x *EventRequest) SetEvent(v v1alpha1.WebhookEvent) {\n\tx.xxx_hidden_Event = v\n}\n\nfunc (x *EventRequest) SetPayload(v *EventPayload) {\n\tx.xxx_hidden_Payload = v\n}\n\nfunc (x *EventRequest) HasPayload() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Payload != nil\n}\n\nfunc (x *EventRequest) ClearPayload() {\n\tx.xxx_hidden_Payload = nil\n}\n\ntype EventRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The webhook event that was triggered. This event is the same one that is\n\t// registered when creating a webhook in the BSR.\n\tEvent v1alpha1.WebhookEvent\n\t// The event payload of the event was triggered.\n\tPayload *EventPayload\n}\n\nfunc (b0 EventRequest_builder) Build() *EventRequest {\n\tm0 := &EventRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Event = b.Event\n\tx.xxx_hidden_Payload = b.Payload\n\treturn m0\n}\n\n// EventPayload contains the actual event payload for all possible\n// webhook event types.\ntype EventPayload struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Payload isEventPayload_Payload `protobuf_oneof:\"payload\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *EventPayload) Reset() {\n\t*x = EventPayload{}\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *EventPayload) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EventPayload) ProtoMessage() {}\n\nfunc (x *EventPayload) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_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\nfunc (x *EventPayload) GetRepositoryPush() *RepositoryPushEvent {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_Payload.(*eventPayload_RepositoryPush); ok {\n\t\t\treturn x.RepositoryPush\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *EventPayload) SetRepositoryPush(v *RepositoryPushEvent) {\n\tif v == nil {\n\t\tx.xxx_hidden_Payload = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_Payload = &eventPayload_RepositoryPush{v}\n}\n\nfunc (x *EventPayload) HasPayload() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Payload != nil\n}\n\nfunc (x *EventPayload) HasRepositoryPush() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_Payload.(*eventPayload_RepositoryPush)\n\treturn ok\n}\n\nfunc (x *EventPayload) ClearPayload() {\n\tx.xxx_hidden_Payload = nil\n}\n\nfunc (x *EventPayload) ClearRepositoryPush() {\n\tif _, ok := x.xxx_hidden_Payload.(*eventPayload_RepositoryPush); ok {\n\t\tx.xxx_hidden_Payload = nil\n\t}\n}\n\nconst EventPayload_Payload_not_set_case case_EventPayload_Payload = 0\nconst EventPayload_RepositoryPush_case case_EventPayload_Payload = 1\n\nfunc (x *EventPayload) WhichPayload() case_EventPayload_Payload {\n\tif x == nil {\n\t\treturn EventPayload_Payload_not_set_case\n\t}\n\tswitch x.xxx_hidden_Payload.(type) {\n\tcase *eventPayload_RepositoryPush:\n\t\treturn EventPayload_RepositoryPush_case\n\tdefault:\n\t\treturn EventPayload_Payload_not_set_case\n\t}\n}\n\ntype EventPayload_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fields of oneof xxx_hidden_Payload:\n\tRepositoryPush *RepositoryPushEvent\n\t// -- end of xxx_hidden_Payload\n}\n\nfunc (b0 EventPayload_builder) Build() *EventPayload {\n\tm0 := &EventPayload{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.RepositoryPush != nil {\n\t\tx.xxx_hidden_Payload = &eventPayload_RepositoryPush{b.RepositoryPush}\n\t}\n\treturn m0\n}\n\ntype case_EventPayload_Payload protoreflect.FieldNumber\n\nfunc (x case_EventPayload_Payload) String() string {\n\tmd := file_buf_alpha_webhook_v1alpha1_event_proto_msgTypes[1].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isEventPayload_Payload interface {\n\tisEventPayload_Payload()\n}\n\ntype eventPayload_RepositoryPush struct {\n\tRepositoryPush *RepositoryPushEvent `protobuf:\"bytes,1,opt,name=repository_push,json=repositoryPush,proto3,oneof\"`\n}\n\nfunc (*eventPayload_RepositoryPush) isEventPayload_Payload() {}\n\n// EventResponse is the empty response payload from the customer to Buf.\ntype EventResponse struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *EventResponse) Reset() {\n\t*x = EventResponse{}\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *EventResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*EventResponse) ProtoMessage() {}\n\nfunc (x *EventResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_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\ntype EventResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 EventResponse_builder) Build() *EventResponse {\n\tm0 := &EventResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\n// Payload for the event WEBHOOK_EVENT_REPOSITORY_PUSH.\ntype RepositoryPushEvent struct {\n\tstate                       protoimpl.MessageState     `protogen:\"opaque.v1\"`\n\txxx_hidden_EventTime        *timestamppb.Timestamp     `protobuf:\"bytes,1,opt,name=event_time,json=eventTime,proto3\"`\n\txxx_hidden_RepositoryCommit *v1alpha1.RepositoryCommit `protobuf:\"bytes,2,opt,name=repository_commit,json=repositoryCommit,proto3\"`\n\txxx_hidden_Repository       *v1alpha1.Repository       `protobuf:\"bytes,3,opt,name=repository,proto3\"`\n\tunknownFields               protoimpl.UnknownFields\n\tsizeCache                   protoimpl.SizeCache\n}\n\nfunc (x *RepositoryPushEvent) Reset() {\n\t*x = RepositoryPushEvent{}\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *RepositoryPushEvent) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*RepositoryPushEvent) ProtoMessage() {}\n\nfunc (x *RepositoryPushEvent) ProtoReflect() protoreflect.Message {\n\tmi := &file_buf_alpha_webhook_v1alpha1_event_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\nfunc (x *RepositoryPushEvent) GetEventTime() *timestamppb.Timestamp {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EventTime\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryPushEvent) GetRepositoryCommit() *v1alpha1.RepositoryCommit {\n\tif x != nil {\n\t\treturn x.xxx_hidden_RepositoryCommit\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryPushEvent) GetRepository() *v1alpha1.Repository {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Repository\n\t}\n\treturn nil\n}\n\nfunc (x *RepositoryPushEvent) SetEventTime(v *timestamppb.Timestamp) {\n\tx.xxx_hidden_EventTime = v\n}\n\nfunc (x *RepositoryPushEvent) SetRepositoryCommit(v *v1alpha1.RepositoryCommit) {\n\tx.xxx_hidden_RepositoryCommit = v\n}\n\nfunc (x *RepositoryPushEvent) SetRepository(v *v1alpha1.Repository) {\n\tx.xxx_hidden_Repository = v\n}\n\nfunc (x *RepositoryPushEvent) HasEventTime() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_EventTime != nil\n}\n\nfunc (x *RepositoryPushEvent) HasRepositoryCommit() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_RepositoryCommit != nil\n}\n\nfunc (x *RepositoryPushEvent) HasRepository() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_Repository != nil\n}\n\nfunc (x *RepositoryPushEvent) ClearEventTime() {\n\tx.xxx_hidden_EventTime = nil\n}\n\nfunc (x *RepositoryPushEvent) ClearRepositoryCommit() {\n\tx.xxx_hidden_RepositoryCommit = nil\n}\n\nfunc (x *RepositoryPushEvent) ClearRepository() {\n\tx.xxx_hidden_Repository = nil\n}\n\ntype RepositoryPushEvent_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The timestamp of the commit push.\n\tEventTime *timestamppb.Timestamp\n\t// The repository commit that was pushed.\n\tRepositoryCommit *v1alpha1.RepositoryCommit\n\t// The repository that was pushed.\n\tRepository *v1alpha1.Repository\n}\n\nfunc (b0 RepositoryPushEvent_builder) Build() *RepositoryPushEvent {\n\tm0 := &RepositoryPushEvent{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_EventTime = b.EventTime\n\tx.xxx_hidden_RepositoryCommit = b.RepositoryCommit\n\tx.xxx_hidden_Repository = b.Repository\n\treturn m0\n}\n\nvar File_buf_alpha_webhook_v1alpha1_event_proto protoreflect.FileDescriptor\n\nconst file_buf_alpha_webhook_v1alpha1_event_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"&buf/alpha/webhook/v1alpha1/event.proto\\x12\\x1abuf.alpha.webhook.v1alpha1\\x1a,buf/alpha/registry/v1alpha1/repository.proto\\x1a3buf/alpha/registry/v1alpha1/repository_commit.proto\\x1a)buf/alpha/registry/v1alpha1/webhook.proto\\x1a\\x1fgoogle/protobuf/timestamp.proto\\\"\\x93\\x01\\n\" +\n\t\"\\fEventRequest\\x12?\\n\" +\n\t\"\\x05event\\x18\\x01 \\x01(\\x0e2).buf.alpha.registry.v1alpha1.WebhookEventR\\x05event\\x12B\\n\" +\n\t\"\\apayload\\x18\\x02 \\x01(\\v2(.buf.alpha.webhook.v1alpha1.EventPayloadR\\apayload\\\"u\\n\" +\n\t\"\\fEventPayload\\x12Z\\n\" +\n\t\"\\x0frepository_push\\x18\\x01 \\x01(\\v2/.buf.alpha.webhook.v1alpha1.RepositoryPushEventH\\x00R\\x0erepositoryPushB\\t\\n\" +\n\t\"\\apayload\\\"\\x0f\\n\" +\n\t\"\\rEventResponse\\\"\\xf5\\x01\\n\" +\n\t\"\\x13RepositoryPushEvent\\x129\\n\" +\n\t\"\\n\" +\n\t\"event_time\\x18\\x01 \\x01(\\v2\\x1a.google.protobuf.TimestampR\\teventTime\\x12Z\\n\" +\n\t\"\\x11repository_commit\\x18\\x02 \\x01(\\v2-.buf.alpha.registry.v1alpha1.RepositoryCommitR\\x10repositoryCommit\\x12G\\n\" +\n\t\"\\n\" +\n\t\"repository\\x18\\x03 \\x01(\\v2'.buf.alpha.registry.v1alpha1.RepositoryR\\n\" +\n\t\"repository2l\\n\" +\n\t\"\\fEventService\\x12\\\\\\n\" +\n\t\"\\x05Event\\x12(.buf.alpha.webhook.v1alpha1.EventRequest\\x1a).buf.alpha.webhook.v1alpha1.EventResponseB\\x90\\x02\\n\" +\n\t\"\\x1ecom.buf.alpha.webhook.v1alpha1B\\n\" +\n\t\"EventProtoP\\x01ZWgithub.com/bufbuild/buf/private/gen/proto/go/buf/alpha/webhook/v1alpha1;webhookv1alpha1\\xa2\\x02\\x03BAW\\xaa\\x02\\x1aBuf.Alpha.Webhook.V1alpha1\\xca\\x02\\x1aBuf\\\\Alpha\\\\Webhook\\\\V1alpha1\\xe2\\x02&Buf\\\\Alpha\\\\Webhook\\\\V1alpha1\\\\GPBMetadata\\xea\\x02\\x1dBuf::Alpha::Webhook::V1alpha1b\\x06proto3\"\n\nvar file_buf_alpha_webhook_v1alpha1_event_proto_msgTypes = make([]protoimpl.MessageInfo, 4)\nvar file_buf_alpha_webhook_v1alpha1_event_proto_goTypes = []any{\n\t(*EventRequest)(nil),              // 0: buf.alpha.webhook.v1alpha1.EventRequest\n\t(*EventPayload)(nil),              // 1: buf.alpha.webhook.v1alpha1.EventPayload\n\t(*EventResponse)(nil),             // 2: buf.alpha.webhook.v1alpha1.EventResponse\n\t(*RepositoryPushEvent)(nil),       // 3: buf.alpha.webhook.v1alpha1.RepositoryPushEvent\n\t(v1alpha1.WebhookEvent)(0),        // 4: buf.alpha.registry.v1alpha1.WebhookEvent\n\t(*timestamppb.Timestamp)(nil),     // 5: google.protobuf.Timestamp\n\t(*v1alpha1.RepositoryCommit)(nil), // 6: buf.alpha.registry.v1alpha1.RepositoryCommit\n\t(*v1alpha1.Repository)(nil),       // 7: buf.alpha.registry.v1alpha1.Repository\n}\nvar file_buf_alpha_webhook_v1alpha1_event_proto_depIdxs = []int32{\n\t4, // 0: buf.alpha.webhook.v1alpha1.EventRequest.event:type_name -> buf.alpha.registry.v1alpha1.WebhookEvent\n\t1, // 1: buf.alpha.webhook.v1alpha1.EventRequest.payload:type_name -> buf.alpha.webhook.v1alpha1.EventPayload\n\t3, // 2: buf.alpha.webhook.v1alpha1.EventPayload.repository_push:type_name -> buf.alpha.webhook.v1alpha1.RepositoryPushEvent\n\t5, // 3: buf.alpha.webhook.v1alpha1.RepositoryPushEvent.event_time:type_name -> google.protobuf.Timestamp\n\t6, // 4: buf.alpha.webhook.v1alpha1.RepositoryPushEvent.repository_commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit\n\t7, // 5: buf.alpha.webhook.v1alpha1.RepositoryPushEvent.repository:type_name -> buf.alpha.registry.v1alpha1.Repository\n\t0, // 6: buf.alpha.webhook.v1alpha1.EventService.Event:input_type -> buf.alpha.webhook.v1alpha1.EventRequest\n\t2, // 7: buf.alpha.webhook.v1alpha1.EventService.Event:output_type -> buf.alpha.webhook.v1alpha1.EventResponse\n\t7, // [7:8] is the sub-list for method output_type\n\t6, // [6:7] 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_buf_alpha_webhook_v1alpha1_event_proto_init() }\nfunc file_buf_alpha_webhook_v1alpha1_event_proto_init() {\n\tif File_buf_alpha_webhook_v1alpha1_event_proto != nil {\n\t\treturn\n\t}\n\tfile_buf_alpha_webhook_v1alpha1_event_proto_msgTypes[1].OneofWrappers = []any{\n\t\t(*eventPayload_RepositoryPush)(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: unsafe.Slice(unsafe.StringData(file_buf_alpha_webhook_v1alpha1_event_proto_rawDesc), len(file_buf_alpha_webhook_v1alpha1_event_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   4,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_buf_alpha_webhook_v1alpha1_event_proto_goTypes,\n\t\tDependencyIndexes: file_buf_alpha_webhook_v1alpha1_event_proto_depIdxs,\n\t\tMessageInfos:      file_buf_alpha_webhook_v1alpha1_event_proto_msgTypes,\n\t}.Build()\n\tFile_buf_alpha_webhook_v1alpha1_event_proto = out.File\n\tfile_buf_alpha_webhook_v1alpha1_event_proto_goTypes = nil\n\tfile_buf_alpha_webhook_v1alpha1_event_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/buf/alpha/webhook/v1alpha1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage webhookv1alpha1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/google/protobuf/cpp_features.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: google/protobuf/cpp_features.proto\n\npackage protobuf\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdescriptorpb \"google.golang.org/protobuf/types/descriptorpb\"\n\treflect \"reflect\"\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 CppFeatures_StringType int32\n\nconst (\n\tCppFeatures_STRING_TYPE_UNKNOWN CppFeatures_StringType = 0\n\tCppFeatures_VIEW                CppFeatures_StringType = 1\n\tCppFeatures_CORD                CppFeatures_StringType = 2\n\tCppFeatures_STRING              CppFeatures_StringType = 3\n)\n\n// Enum value maps for CppFeatures_StringType.\nvar (\n\tCppFeatures_StringType_name = map[int32]string{\n\t\t0: \"STRING_TYPE_UNKNOWN\",\n\t\t1: \"VIEW\",\n\t\t2: \"CORD\",\n\t\t3: \"STRING\",\n\t}\n\tCppFeatures_StringType_value = map[string]int32{\n\t\t\"STRING_TYPE_UNKNOWN\": 0,\n\t\t\"VIEW\":                1,\n\t\t\"CORD\":                2,\n\t\t\"STRING\":              3,\n\t}\n)\n\nfunc (x CppFeatures_StringType) Enum() *CppFeatures_StringType {\n\tp := new(CppFeatures_StringType)\n\t*p = x\n\treturn p\n}\n\nfunc (x CppFeatures_StringType) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (CppFeatures_StringType) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_google_protobuf_cpp_features_proto_enumTypes[0].Descriptor()\n}\n\nfunc (CppFeatures_StringType) Type() protoreflect.EnumType {\n\treturn &file_google_protobuf_cpp_features_proto_enumTypes[0]\n}\n\nfunc (x CppFeatures_StringType) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype CppFeatures struct {\n\tstate                             protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_LegacyClosedEnum       bool                   `protobuf:\"varint,1,opt,name=legacy_closed_enum,json=legacyClosedEnum\"`\n\txxx_hidden_StringType             CppFeatures_StringType `protobuf:\"varint,2,opt,name=string_type,json=stringType,enum=pb.CppFeatures_StringType\"`\n\txxx_hidden_EnumNameUsesStringView bool                   `protobuf:\"varint,3,opt,name=enum_name_uses_string_view,json=enumNameUsesStringView\"`\n\tXXX_raceDetectHookData            protoimpl.RaceDetectHookData\n\tXXX_presence                      [1]uint32\n\tunknownFields                     protoimpl.UnknownFields\n\tsizeCache                         protoimpl.SizeCache\n}\n\nfunc (x *CppFeatures) Reset() {\n\t*x = CppFeatures{}\n\tmi := &file_google_protobuf_cpp_features_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *CppFeatures) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*CppFeatures) ProtoMessage() {}\n\nfunc (x *CppFeatures) ProtoReflect() protoreflect.Message {\n\tmi := &file_google_protobuf_cpp_features_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\nfunc (x *CppFeatures) GetLegacyClosedEnum() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LegacyClosedEnum\n\t}\n\treturn false\n}\n\nfunc (x *CppFeatures) GetStringType() CppFeatures_StringType {\n\tif x != nil {\n\t\tif protoimpl.X.Present(&(x.XXX_presence[0]), 1) {\n\t\t\treturn x.xxx_hidden_StringType\n\t\t}\n\t}\n\treturn CppFeatures_STRING_TYPE_UNKNOWN\n}\n\nfunc (x *CppFeatures) GetEnumNameUsesStringView() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_EnumNameUsesStringView\n\t}\n\treturn false\n}\n\nfunc (x *CppFeatures) SetLegacyClosedEnum(v bool) {\n\tx.xxx_hidden_LegacyClosedEnum = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 3)\n}\n\nfunc (x *CppFeatures) SetStringType(v CppFeatures_StringType) {\n\tx.xxx_hidden_StringType = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 3)\n}\n\nfunc (x *CppFeatures) SetEnumNameUsesStringView(v bool) {\n\tx.xxx_hidden_EnumNameUsesStringView = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 3)\n}\n\nfunc (x *CppFeatures) HasLegacyClosedEnum() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 0)\n}\n\nfunc (x *CppFeatures) HasStringType() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *CppFeatures) HasEnumNameUsesStringView() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *CppFeatures) ClearLegacyClosedEnum() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)\n\tx.xxx_hidden_LegacyClosedEnum = false\n}\n\nfunc (x *CppFeatures) ClearStringType() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_StringType = CppFeatures_STRING_TYPE_UNKNOWN\n}\n\nfunc (x *CppFeatures) ClearEnumNameUsesStringView() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_EnumNameUsesStringView = false\n}\n\ntype CppFeatures_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Whether or not to treat an enum field as closed.  This option is only\n\t// applicable to enum fields, and will be removed in the future.  It is\n\t// consistent with the legacy behavior of using proto3 enum types for proto2\n\t// fields.\n\tLegacyClosedEnum       *bool\n\tStringType             *CppFeatures_StringType\n\tEnumNameUsesStringView *bool\n}\n\nfunc (b0 CppFeatures_builder) Build() *CppFeatures {\n\tm0 := &CppFeatures{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.LegacyClosedEnum != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 3)\n\t\tx.xxx_hidden_LegacyClosedEnum = *b.LegacyClosedEnum\n\t}\n\tif b.StringType != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 3)\n\t\tx.xxx_hidden_StringType = *b.StringType\n\t}\n\tif b.EnumNameUsesStringView != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 3)\n\t\tx.xxx_hidden_EnumNameUsesStringView = *b.EnumNameUsesStringView\n\t}\n\treturn m0\n}\n\nvar file_google_protobuf_cpp_features_proto_extTypes = []protoimpl.ExtensionInfo{\n\t{\n\t\tExtendedType:  (*descriptorpb.FeatureSet)(nil),\n\t\tExtensionType: (*CppFeatures)(nil),\n\t\tField:         1000,\n\t\tName:          \"pb.cpp\",\n\t\tTag:           \"bytes,1000,opt,name=cpp\",\n\t\tFilename:      \"google/protobuf/cpp_features.proto\",\n\t},\n}\n\n// Extension fields to descriptorpb.FeatureSet.\nvar (\n\t// optional pb.CppFeatures cpp = 1000;\n\tE_Cpp = &file_google_protobuf_cpp_features_proto_extTypes[0]\n)\n\nvar File_google_protobuf_cpp_features_proto protoreflect.FileDescriptor\n\nconst file_google_protobuf_cpp_features_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"\\\"google/protobuf/cpp_features.proto\\x12\\x02pb\\x1a google/protobuf/descriptor.proto\\\"\\xb2\\x04\\n\" +\n\t\"\\vCppFeatures\\x12\\x8d\\x02\\n\" +\n\t\"\\x12legacy_closed_enum\\x18\\x01 \\x01(\\bB\\xde\\x01\\x88\\x01\\x01\\x98\\x01\\x04\\x98\\x01\\x01\\xa2\\x01\\t\\x12\\x04true\\x18\\x84\\a\\xa2\\x01\\n\" +\n\t\"\\x12\\x05false\\x18\\xe7\\a\\xb2\\x01\\xb8\\x01\\b\\xe8\\a\\x10\\xe8\\a\\x1a\\xaf\\x01The legacy closed enum behavior in C++ is deprecated and is scheduled to be removed in edition 2025.  See http://protobuf.dev/programming-guides/enum/#cpp for more informationR\\x10legacyClosedEnum\\x12f\\n\" +\n\t\"\\vstring_type\\x18\\x02 \\x01(\\x0e2\\x1a.pb.CppFeatures.StringTypeB)\\x88\\x01\\x01\\x98\\x01\\x04\\x98\\x01\\x01\\xa2\\x01\\v\\x12\\x06STRING\\x18\\x84\\a\\xa2\\x01\\t\\x12\\x04VIEW\\x18\\xe9\\a\\xb2\\x01\\x03\\b\\xe8\\aR\\n\" +\n\t\"stringType\\x12d\\n\" +\n\t\"\\x1aenum_name_uses_string_view\\x18\\x03 \\x01(\\bB(\\x88\\x01\\x02\\x98\\x01\\x06\\x98\\x01\\x01\\xa2\\x01\\n\" +\n\t\"\\x12\\x05false\\x18\\x84\\a\\xa2\\x01\\t\\x12\\x04true\\x18\\xe9\\a\\xb2\\x01\\x03\\b\\xe9\\aR\\x16enumNameUsesStringView\\\"E\\n\" +\n\t\"\\n\" +\n\t\"StringType\\x12\\x17\\n\" +\n\t\"\\x13STRING_TYPE_UNKNOWN\\x10\\x00\\x12\\b\\n\" +\n\t\"\\x04VIEW\\x10\\x01\\x12\\b\\n\" +\n\t\"\\x04CORD\\x10\\x02\\x12\\n\" +\n\t\"\\n\" +\n\t\"\\x06STRING\\x10\\x03:?\\n\" +\n\t\"\\x03cpp\\x12\\x1b.google.protobuf.FeatureSet\\x18\\xe8\\a \\x01(\\v2\\x0f.pb.CppFeaturesR\\x03cpp\"\n\nvar file_google_protobuf_cpp_features_proto_enumTypes = make([]protoimpl.EnumInfo, 1)\nvar file_google_protobuf_cpp_features_proto_msgTypes = make([]protoimpl.MessageInfo, 1)\nvar file_google_protobuf_cpp_features_proto_goTypes = []any{\n\t(CppFeatures_StringType)(0),     // 0: pb.CppFeatures.StringType\n\t(*CppFeatures)(nil),             // 1: pb.CppFeatures\n\t(*descriptorpb.FeatureSet)(nil), // 2: google.protobuf.FeatureSet\n}\nvar file_google_protobuf_cpp_features_proto_depIdxs = []int32{\n\t0, // 0: pb.CppFeatures.string_type:type_name -> pb.CppFeatures.StringType\n\t2, // 1: pb.cpp:extendee -> google.protobuf.FeatureSet\n\t1, // 2: pb.cpp:type_name -> pb.CppFeatures\n\t3, // [3:3] is the sub-list for method output_type\n\t3, // [3:3] is the sub-list for method input_type\n\t2, // [2:3] is the sub-list for extension type_name\n\t1, // [1:2] is the sub-list for extension extendee\n\t0, // [0:1] is the sub-list for field type_name\n}\n\nfunc init() { file_google_protobuf_cpp_features_proto_init() }\nfunc file_google_protobuf_cpp_features_proto_init() {\n\tif File_google_protobuf_cpp_features_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_google_protobuf_cpp_features_proto_rawDesc), len(file_google_protobuf_cpp_features_proto_rawDesc)),\n\t\t\tNumEnums:      1,\n\t\t\tNumMessages:   1,\n\t\t\tNumExtensions: 1,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_google_protobuf_cpp_features_proto_goTypes,\n\t\tDependencyIndexes: file_google_protobuf_cpp_features_proto_depIdxs,\n\t\tEnumInfos:         file_google_protobuf_cpp_features_proto_enumTypes,\n\t\tMessageInfos:      file_google_protobuf_cpp_features_proto_msgTypes,\n\t\tExtensionInfos:    file_google_protobuf_cpp_features_proto_extTypes,\n\t}.Build()\n\tFile_google_protobuf_cpp_features_proto = out.File\n\tfile_google_protobuf_cpp_features_proto_goTypes = nil\n\tfile_google_protobuf_cpp_features_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/google/protobuf/java_features.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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.36.11\n// \tprotoc        (unknown)\n// source: google/protobuf/java_features.proto\n\npackage protobuf\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\tdescriptorpb \"google.golang.org/protobuf/types/descriptorpb\"\n\treflect \"reflect\"\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\n// The UTF8 validation strategy to use.\ntype JavaFeatures_Utf8Validation int32\n\nconst (\n\t// Invalid default, which should never be used.\n\tJavaFeatures_UTF8_VALIDATION_UNKNOWN JavaFeatures_Utf8Validation = 0\n\t// Respect the UTF8 validation behavior specified by the global\n\t// utf8_validation feature.\n\tJavaFeatures_DEFAULT JavaFeatures_Utf8Validation = 1\n\t// Verifies UTF8 validity overriding the global utf8_validation\n\t// feature. This represents the legacy java_string_check_utf8 option.\n\tJavaFeatures_VERIFY JavaFeatures_Utf8Validation = 2\n)\n\n// Enum value maps for JavaFeatures_Utf8Validation.\nvar (\n\tJavaFeatures_Utf8Validation_name = map[int32]string{\n\t\t0: \"UTF8_VALIDATION_UNKNOWN\",\n\t\t1: \"DEFAULT\",\n\t\t2: \"VERIFY\",\n\t}\n\tJavaFeatures_Utf8Validation_value = map[string]int32{\n\t\t\"UTF8_VALIDATION_UNKNOWN\": 0,\n\t\t\"DEFAULT\":                 1,\n\t\t\"VERIFY\":                  2,\n\t}\n)\n\nfunc (x JavaFeatures_Utf8Validation) Enum() *JavaFeatures_Utf8Validation {\n\tp := new(JavaFeatures_Utf8Validation)\n\t*p = x\n\treturn p\n}\n\nfunc (x JavaFeatures_Utf8Validation) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (JavaFeatures_Utf8Validation) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_google_protobuf_java_features_proto_enumTypes[0].Descriptor()\n}\n\nfunc (JavaFeatures_Utf8Validation) Type() protoreflect.EnumType {\n\treturn &file_google_protobuf_java_features_proto_enumTypes[0]\n}\n\nfunc (x JavaFeatures_Utf8Validation) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype JavaFeatures_NestInFileClassFeature_NestInFileClass int32\n\nconst (\n\t// Invalid default, which should never be used.\n\tJavaFeatures_NestInFileClassFeature_NEST_IN_FILE_CLASS_UNKNOWN JavaFeatures_NestInFileClassFeature_NestInFileClass = 0\n\t// Do not nest the generated class in the file class.\n\tJavaFeatures_NestInFileClassFeature_NO JavaFeatures_NestInFileClassFeature_NestInFileClass = 1\n\t// Nest the generated class in the file class.\n\tJavaFeatures_NestInFileClassFeature_YES JavaFeatures_NestInFileClassFeature_NestInFileClass = 2\n\t// Fall back to the `java_multiple_files` option. Users won't be able to\n\t// set this option.\n\tJavaFeatures_NestInFileClassFeature_LEGACY JavaFeatures_NestInFileClassFeature_NestInFileClass = 3\n)\n\n// Enum value maps for JavaFeatures_NestInFileClassFeature_NestInFileClass.\nvar (\n\tJavaFeatures_NestInFileClassFeature_NestInFileClass_name = map[int32]string{\n\t\t0: \"NEST_IN_FILE_CLASS_UNKNOWN\",\n\t\t1: \"NO\",\n\t\t2: \"YES\",\n\t\t3: \"LEGACY\",\n\t}\n\tJavaFeatures_NestInFileClassFeature_NestInFileClass_value = map[string]int32{\n\t\t\"NEST_IN_FILE_CLASS_UNKNOWN\": 0,\n\t\t\"NO\":                         1,\n\t\t\"YES\":                        2,\n\t\t\"LEGACY\":                     3,\n\t}\n)\n\nfunc (x JavaFeatures_NestInFileClassFeature_NestInFileClass) Enum() *JavaFeatures_NestInFileClassFeature_NestInFileClass {\n\tp := new(JavaFeatures_NestInFileClassFeature_NestInFileClass)\n\t*p = x\n\treturn p\n}\n\nfunc (x JavaFeatures_NestInFileClassFeature_NestInFileClass) String() string {\n\treturn protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))\n}\n\nfunc (JavaFeatures_NestInFileClassFeature_NestInFileClass) Descriptor() protoreflect.EnumDescriptor {\n\treturn file_google_protobuf_java_features_proto_enumTypes[1].Descriptor()\n}\n\nfunc (JavaFeatures_NestInFileClassFeature_NestInFileClass) Type() protoreflect.EnumType {\n\treturn &file_google_protobuf_java_features_proto_enumTypes[1]\n}\n\nfunc (x JavaFeatures_NestInFileClassFeature_NestInFileClass) Number() protoreflect.EnumNumber {\n\treturn protoreflect.EnumNumber(x)\n}\n\ntype JavaFeatures struct {\n\tstate                                  protoimpl.MessageState                              `protogen:\"opaque.v1\"`\n\txxx_hidden_LegacyClosedEnum            bool                                                `protobuf:\"varint,1,opt,name=legacy_closed_enum,json=legacyClosedEnum\"`\n\txxx_hidden_Utf8Validation              JavaFeatures_Utf8Validation                         `protobuf:\"varint,2,opt,name=utf8_validation,json=utf8Validation,enum=pb.JavaFeatures_Utf8Validation\"`\n\txxx_hidden_LargeEnum                   bool                                                `protobuf:\"varint,3,opt,name=large_enum,json=largeEnum\"`\n\txxx_hidden_UseOldOuterClassnameDefault bool                                                `protobuf:\"varint,4,opt,name=use_old_outer_classname_default,json=useOldOuterClassnameDefault\"`\n\txxx_hidden_NestInFileClass             JavaFeatures_NestInFileClassFeature_NestInFileClass `protobuf:\"varint,5,opt,name=nest_in_file_class,json=nestInFileClass,enum=pb.JavaFeatures_NestInFileClassFeature_NestInFileClass\"`\n\tXXX_raceDetectHookData                 protoimpl.RaceDetectHookData\n\tXXX_presence                           [1]uint32\n\tunknownFields                          protoimpl.UnknownFields\n\tsizeCache                              protoimpl.SizeCache\n}\n\nfunc (x *JavaFeatures) Reset() {\n\t*x = JavaFeatures{}\n\tmi := &file_google_protobuf_java_features_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *JavaFeatures) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*JavaFeatures) ProtoMessage() {}\n\nfunc (x *JavaFeatures) ProtoReflect() protoreflect.Message {\n\tmi := &file_google_protobuf_java_features_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\nfunc (x *JavaFeatures) GetLegacyClosedEnum() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LegacyClosedEnum\n\t}\n\treturn false\n}\n\nfunc (x *JavaFeatures) GetUtf8Validation() JavaFeatures_Utf8Validation {\n\tif x != nil {\n\t\tif protoimpl.X.Present(&(x.XXX_presence[0]), 1) {\n\t\t\treturn x.xxx_hidden_Utf8Validation\n\t\t}\n\t}\n\treturn JavaFeatures_UTF8_VALIDATION_UNKNOWN\n}\n\nfunc (x *JavaFeatures) GetLargeEnum() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_LargeEnum\n\t}\n\treturn false\n}\n\nfunc (x *JavaFeatures) GetUseOldOuterClassnameDefault() bool {\n\tif x != nil {\n\t\treturn x.xxx_hidden_UseOldOuterClassnameDefault\n\t}\n\treturn false\n}\n\nfunc (x *JavaFeatures) GetNestInFileClass() JavaFeatures_NestInFileClassFeature_NestInFileClass {\n\tif x != nil {\n\t\tif protoimpl.X.Present(&(x.XXX_presence[0]), 4) {\n\t\t\treturn x.xxx_hidden_NestInFileClass\n\t\t}\n\t}\n\treturn JavaFeatures_NestInFileClassFeature_NEST_IN_FILE_CLASS_UNKNOWN\n}\n\nfunc (x *JavaFeatures) SetLegacyClosedEnum(v bool) {\n\tx.xxx_hidden_LegacyClosedEnum = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 5)\n}\n\nfunc (x *JavaFeatures) SetUtf8Validation(v JavaFeatures_Utf8Validation) {\n\tx.xxx_hidden_Utf8Validation = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 5)\n}\n\nfunc (x *JavaFeatures) SetLargeEnum(v bool) {\n\tx.xxx_hidden_LargeEnum = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 2, 5)\n}\n\nfunc (x *JavaFeatures) SetUseOldOuterClassnameDefault(v bool) {\n\tx.xxx_hidden_UseOldOuterClassnameDefault = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 3, 5)\n}\n\nfunc (x *JavaFeatures) SetNestInFileClass(v JavaFeatures_NestInFileClassFeature_NestInFileClass) {\n\tx.xxx_hidden_NestInFileClass = v\n\tprotoimpl.X.SetPresent(&(x.XXX_presence[0]), 4, 5)\n}\n\nfunc (x *JavaFeatures) HasLegacyClosedEnum() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 0)\n}\n\nfunc (x *JavaFeatures) HasUtf8Validation() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 1)\n}\n\nfunc (x *JavaFeatures) HasLargeEnum() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 2)\n}\n\nfunc (x *JavaFeatures) HasUseOldOuterClassnameDefault() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 3)\n}\n\nfunc (x *JavaFeatures) HasNestInFileClass() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn protoimpl.X.Present(&(x.XXX_presence[0]), 4)\n}\n\nfunc (x *JavaFeatures) ClearLegacyClosedEnum() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)\n\tx.xxx_hidden_LegacyClosedEnum = false\n}\n\nfunc (x *JavaFeatures) ClearUtf8Validation() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)\n\tx.xxx_hidden_Utf8Validation = JavaFeatures_UTF8_VALIDATION_UNKNOWN\n}\n\nfunc (x *JavaFeatures) ClearLargeEnum() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 2)\n\tx.xxx_hidden_LargeEnum = false\n}\n\nfunc (x *JavaFeatures) ClearUseOldOuterClassnameDefault() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 3)\n\tx.xxx_hidden_UseOldOuterClassnameDefault = false\n}\n\nfunc (x *JavaFeatures) ClearNestInFileClass() {\n\tprotoimpl.X.ClearPresent(&(x.XXX_presence[0]), 4)\n\tx.xxx_hidden_NestInFileClass = JavaFeatures_NestInFileClassFeature_NEST_IN_FILE_CLASS_UNKNOWN\n}\n\ntype JavaFeatures_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Whether or not to treat an enum field as closed.  This option is only\n\t// applicable to enum fields, and will be removed in the future.  It is\n\t// consistent with the legacy behavior of using proto3 enum types for proto2\n\t// fields.\n\tLegacyClosedEnum *bool\n\tUtf8Validation   *JavaFeatures_Utf8Validation\n\t// Allows creation of large Java enums, extending beyond the standard\n\t// constant limits imposed by the Java language.\n\tLargeEnum *bool\n\t// Whether to use the old default outer class name scheme, or the new feature\n\t// which adds a \"Proto\" suffix to the outer class name.\n\t//\n\t// Users will not be able to set this option, because we removed it in the\n\t// same edition that it was introduced. But we use it to determine which\n\t// naming scheme to use for outer class name defaults.\n\tUseOldOuterClassnameDefault *bool\n\t// Whether to nest the generated class in the generated file class. This is\n\t// only applicable to *top-level* messages, enums, and services.\n\tNestInFileClass *JavaFeatures_NestInFileClassFeature_NestInFileClass\n}\n\nfunc (b0 JavaFeatures_builder) Build() *JavaFeatures {\n\tm0 := &JavaFeatures{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tif b.LegacyClosedEnum != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 5)\n\t\tx.xxx_hidden_LegacyClosedEnum = *b.LegacyClosedEnum\n\t}\n\tif b.Utf8Validation != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 5)\n\t\tx.xxx_hidden_Utf8Validation = *b.Utf8Validation\n\t}\n\tif b.LargeEnum != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 2, 5)\n\t\tx.xxx_hidden_LargeEnum = *b.LargeEnum\n\t}\n\tif b.UseOldOuterClassnameDefault != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 3, 5)\n\t\tx.xxx_hidden_UseOldOuterClassnameDefault = *b.UseOldOuterClassnameDefault\n\t}\n\tif b.NestInFileClass != nil {\n\t\tprotoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 4, 5)\n\t\tx.xxx_hidden_NestInFileClass = *b.NestInFileClass\n\t}\n\treturn m0\n}\n\ntype JavaFeatures_NestInFileClassFeature struct {\n\tstate         protoimpl.MessageState `protogen:\"opaque.v1\"`\n\tunknownFields protoimpl.UnknownFields\n\tsizeCache     protoimpl.SizeCache\n}\n\nfunc (x *JavaFeatures_NestInFileClassFeature) Reset() {\n\t*x = JavaFeatures_NestInFileClassFeature{}\n\tmi := &file_google_protobuf_java_features_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *JavaFeatures_NestInFileClassFeature) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*JavaFeatures_NestInFileClassFeature) ProtoMessage() {}\n\nfunc (x *JavaFeatures_NestInFileClassFeature) ProtoReflect() protoreflect.Message {\n\tmi := &file_google_protobuf_java_features_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\ntype JavaFeatures_NestInFileClassFeature_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n}\n\nfunc (b0 JavaFeatures_NestInFileClassFeature_builder) Build() *JavaFeatures_NestInFileClassFeature {\n\tm0 := &JavaFeatures_NestInFileClassFeature{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\treturn m0\n}\n\nvar file_google_protobuf_java_features_proto_extTypes = []protoimpl.ExtensionInfo{\n\t{\n\t\tExtendedType:  (*descriptorpb.FeatureSet)(nil),\n\t\tExtensionType: (*JavaFeatures)(nil),\n\t\tField:         1001,\n\t\tName:          \"pb.java\",\n\t\tTag:           \"bytes,1001,opt,name=java\",\n\t\tFilename:      \"google/protobuf/java_features.proto\",\n\t},\n}\n\n// Extension fields to descriptorpb.FeatureSet.\nvar (\n\t// optional pb.JavaFeatures java = 1001;\n\tE_Java = &file_google_protobuf_java_features_proto_extTypes[0]\n)\n\nvar File_google_protobuf_java_features_proto protoreflect.FileDescriptor\n\nconst file_google_protobuf_java_features_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"#google/protobuf/java_features.proto\\x12\\x02pb\\x1a google/protobuf/descriptor.proto\\\"\\xd9\\b\\n\" +\n\t\"\\fJavaFeatures\\x12\\x90\\x02\\n\" +\n\t\"\\x12legacy_closed_enum\\x18\\x01 \\x01(\\bB\\xe1\\x01\\x88\\x01\\x01\\x98\\x01\\x04\\x98\\x01\\x01\\xa2\\x01\\t\\x12\\x04true\\x18\\x84\\a\\xa2\\x01\\n\" +\n\t\"\\x12\\x05false\\x18\\xe7\\a\\xb2\\x01\\xbb\\x01\\b\\xe8\\a\\x10\\xe8\\a\\x1a\\xb2\\x01The legacy closed enum behavior in Java is deprecated and is scheduled to be removed in edition 2025.  See http://protobuf.dev/programming-guides/enum/#java for more information.R\\x10legacyClosedEnum\\x12\\xaf\\x02\\n\" +\n\t\"\\x0futf8_validation\\x18\\x02 \\x01(\\x0e2\\x1f.pb.JavaFeatures.Utf8ValidationB\\xe4\\x01\\x88\\x01\\x01\\x98\\x01\\x04\\x98\\x01\\x01\\xa2\\x01\\f\\x12\\aDEFAULT\\x18\\x84\\a\\xb2\\x01\\xc8\\x01\\b\\xe8\\a\\x10\\xe9\\a\\x1a\\xbf\\x01The Java-specific utf8 validation feature is deprecated and is scheduled to be removed in edition 2025.  Utf8 validation behavior should use the global cross-language utf8_validation feature.R\\x0eutf8Validation\\x12;\\n\" +\n\t\"\\n\" +\n\t\"large_enum\\x18\\x03 \\x01(\\bB\\x1c\\x88\\x01\\x01\\x98\\x01\\x06\\x98\\x01\\x01\\xa2\\x01\\n\" +\n\t\"\\x12\\x05false\\x18\\x84\\a\\xb2\\x01\\x03\\b\\xe9\\aR\\tlargeEnum\\x12n\\n\" +\n\t\"\\x1fuse_old_outer_classname_default\\x18\\x04 \\x01(\\bB(\\x88\\x01\\x01\\x98\\x01\\x01\\xa2\\x01\\t\\x12\\x04true\\x18\\x84\\a\\xa2\\x01\\n\" +\n\t\"\\x12\\x05false\\x18\\xe9\\a\\xb2\\x01\\x06\\b\\xe9\\a \\xe9\\aR\\x1buseOldOuterClassnameDefault\\x12\\x90\\x01\\n\" +\n\t\"\\x12nest_in_file_class\\x18\\x05 \\x01(\\x0e27.pb.JavaFeatures.NestInFileClassFeature.NestInFileClassB*\\x88\\x01\\x02\\x98\\x01\\x03\\x98\\x01\\x06\\x98\\x01\\b\\xa2\\x01\\v\\x12\\x06LEGACY\\x18\\x84\\a\\xa2\\x01\\a\\x12\\x02NO\\x18\\xe9\\a\\xb2\\x01\\x03\\b\\xe9\\aR\\x0fnestInFileClass\\x1a|\\n\" +\n\t\"\\x16NestInFileClassFeature\\\"X\\n\" +\n\t\"\\x0fNestInFileClass\\x12\\x1e\\n\" +\n\t\"\\x1aNEST_IN_FILE_CLASS_UNKNOWN\\x10\\x00\\x12\\x06\\n\" +\n\t\"\\x02NO\\x10\\x01\\x12\\a\\n\" +\n\t\"\\x03YES\\x10\\x02\\x12\\x14\\n\" +\n\t\"\\x06LEGACY\\x10\\x03\\x1a\\b\\\"\\x06\\b\\xe9\\a \\xe9\\aJ\\b\\b\\x01\\x10\\x80\\x80\\x80\\x80\\x02\\\"F\\n\" +\n\t\"\\x0eUtf8Validation\\x12\\x1b\\n\" +\n\t\"\\x17UTF8_VALIDATION_UNKNOWN\\x10\\x00\\x12\\v\\n\" +\n\t\"\\aDEFAULT\\x10\\x01\\x12\\n\" +\n\t\"\\n\" +\n\t\"\\x06VERIFY\\x10\\x02:B\\n\" +\n\t\"\\x04java\\x12\\x1b.google.protobuf.FeatureSet\\x18\\xe9\\a \\x01(\\v2\\x10.pb.JavaFeaturesR\\x04javaB(\\n\" +\n\t\"\\x13com.google.protobufB\\x11JavaFeaturesProto\"\n\nvar file_google_protobuf_java_features_proto_enumTypes = make([]protoimpl.EnumInfo, 2)\nvar file_google_protobuf_java_features_proto_msgTypes = make([]protoimpl.MessageInfo, 2)\nvar file_google_protobuf_java_features_proto_goTypes = []any{\n\t(JavaFeatures_Utf8Validation)(0),                         // 0: pb.JavaFeatures.Utf8Validation\n\t(JavaFeatures_NestInFileClassFeature_NestInFileClass)(0), // 1: pb.JavaFeatures.NestInFileClassFeature.NestInFileClass\n\t(*JavaFeatures)(nil),                                     // 2: pb.JavaFeatures\n\t(*JavaFeatures_NestInFileClassFeature)(nil),              // 3: pb.JavaFeatures.NestInFileClassFeature\n\t(*descriptorpb.FeatureSet)(nil),                          // 4: google.protobuf.FeatureSet\n}\nvar file_google_protobuf_java_features_proto_depIdxs = []int32{\n\t0, // 0: pb.JavaFeatures.utf8_validation:type_name -> pb.JavaFeatures.Utf8Validation\n\t1, // 1: pb.JavaFeatures.nest_in_file_class:type_name -> pb.JavaFeatures.NestInFileClassFeature.NestInFileClass\n\t4, // 2: pb.java:extendee -> google.protobuf.FeatureSet\n\t2, // 3: pb.java:type_name -> pb.JavaFeatures\n\t4, // [4:4] is the sub-list for method output_type\n\t4, // [4:4] is the sub-list for method input_type\n\t3, // [3:4] is the sub-list for extension type_name\n\t2, // [2:3] is the sub-list for extension extendee\n\t0, // [0:2] is the sub-list for field type_name\n}\n\nfunc init() { file_google_protobuf_java_features_proto_init() }\nfunc file_google_protobuf_java_features_proto_init() {\n\tif File_google_protobuf_java_features_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_google_protobuf_java_features_proto_rawDesc), len(file_google_protobuf_java_features_proto_rawDesc)),\n\t\t\tNumEnums:      2,\n\t\t\tNumMessages:   2,\n\t\t\tNumExtensions: 1,\n\t\t\tNumServices:   0,\n\t\t},\n\t\tGoTypes:           file_google_protobuf_java_features_proto_goTypes,\n\t\tDependencyIndexes: file_google_protobuf_java_features_proto_depIdxs,\n\t\tEnumInfos:         file_google_protobuf_java_features_proto_enumTypes,\n\t\tMessageInfos:      file_google_protobuf_java_features_proto_msgTypes,\n\t\tExtensionInfos:    file_google_protobuf_java_features_proto_extTypes,\n\t}.Build()\n\tFile_google_protobuf_java_features_proto = out.File\n\tfile_google_protobuf_java_features_proto_goTypes = nil\n\tfile_google_protobuf_java_features_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/google/protobuf/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protobuf\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/gen/proto/go/grpc/reflection/v1/reflection.pb.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Service exported by server reflection.  A more complete description of how\n// server reflection works can be found at\n// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md\n//\n// The canonical version of this proto can be found at\n// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto\n\n// Code generated by protoc-gen-go. DO NOT EDIT.\n// versions:\n// \tprotoc-gen-go v1.36.11\n// \tprotoc        (unknown)\n// source: grpc/reflection/v1/reflection.proto\n\npackage reflectionv1\n\nimport (\n\tprotoreflect \"google.golang.org/protobuf/reflect/protoreflect\"\n\tprotoimpl \"google.golang.org/protobuf/runtime/protoimpl\"\n\treflect \"reflect\"\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\n// The message sent by the client when calling ServerReflectionInfo method.\ntype ServerReflectionRequest struct {\n\tstate                     protoimpl.MessageState                   `protogen:\"opaque.v1\"`\n\txxx_hidden_Host           string                                   `protobuf:\"bytes,1,opt,name=host,proto3\"`\n\txxx_hidden_MessageRequest isServerReflectionRequest_MessageRequest `protobuf_oneof:\"message_request\"`\n\tunknownFields             protoimpl.UnknownFields\n\tsizeCache                 protoimpl.SizeCache\n}\n\nfunc (x *ServerReflectionRequest) Reset() {\n\t*x = ServerReflectionRequest{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[0]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ServerReflectionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ServerReflectionRequest) ProtoMessage() {}\n\nfunc (x *ServerReflectionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *ServerReflectionRequest) GetHost() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Host\n\t}\n\treturn \"\"\n}\n\nfunc (x *ServerReflectionRequest) GetFileByFilename() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileByFilename); ok {\n\t\t\treturn x.FileByFilename\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *ServerReflectionRequest) GetFileContainingSymbol() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileContainingSymbol); ok {\n\t\t\treturn x.FileContainingSymbol\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *ServerReflectionRequest) GetFileContainingExtension() *ExtensionRequest {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileContainingExtension); ok {\n\t\t\treturn x.FileContainingExtension\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ServerReflectionRequest) GetAllExtensionNumbersOfType() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_AllExtensionNumbersOfType); ok {\n\t\t\treturn x.AllExtensionNumbersOfType\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *ServerReflectionRequest) GetListServices() string {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_ListServices); ok {\n\t\t\treturn x.ListServices\n\t\t}\n\t}\n\treturn \"\"\n}\n\nfunc (x *ServerReflectionRequest) SetHost(v string) {\n\tx.xxx_hidden_Host = v\n}\n\nfunc (x *ServerReflectionRequest) SetFileByFilename(v string) {\n\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_FileByFilename{v}\n}\n\nfunc (x *ServerReflectionRequest) SetFileContainingSymbol(v string) {\n\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_FileContainingSymbol{v}\n}\n\nfunc (x *ServerReflectionRequest) SetFileContainingExtension(v *ExtensionRequest) {\n\tif v == nil {\n\t\tx.xxx_hidden_MessageRequest = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_FileContainingExtension{v}\n}\n\nfunc (x *ServerReflectionRequest) SetAllExtensionNumbersOfType(v string) {\n\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_AllExtensionNumbersOfType{v}\n}\n\nfunc (x *ServerReflectionRequest) SetListServices(v string) {\n\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_ListServices{v}\n}\n\nfunc (x *ServerReflectionRequest) HasMessageRequest() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_MessageRequest != nil\n}\n\nfunc (x *ServerReflectionRequest) HasFileByFilename() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileByFilename)\n\treturn ok\n}\n\nfunc (x *ServerReflectionRequest) HasFileContainingSymbol() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileContainingSymbol)\n\treturn ok\n}\n\nfunc (x *ServerReflectionRequest) HasFileContainingExtension() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileContainingExtension)\n\treturn ok\n}\n\nfunc (x *ServerReflectionRequest) HasAllExtensionNumbersOfType() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_AllExtensionNumbersOfType)\n\treturn ok\n}\n\nfunc (x *ServerReflectionRequest) HasListServices() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_ListServices)\n\treturn ok\n}\n\nfunc (x *ServerReflectionRequest) ClearMessageRequest() {\n\tx.xxx_hidden_MessageRequest = nil\n}\n\nfunc (x *ServerReflectionRequest) ClearFileByFilename() {\n\tif _, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileByFilename); ok {\n\t\tx.xxx_hidden_MessageRequest = nil\n\t}\n}\n\nfunc (x *ServerReflectionRequest) ClearFileContainingSymbol() {\n\tif _, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileContainingSymbol); ok {\n\t\tx.xxx_hidden_MessageRequest = nil\n\t}\n}\n\nfunc (x *ServerReflectionRequest) ClearFileContainingExtension() {\n\tif _, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_FileContainingExtension); ok {\n\t\tx.xxx_hidden_MessageRequest = nil\n\t}\n}\n\nfunc (x *ServerReflectionRequest) ClearAllExtensionNumbersOfType() {\n\tif _, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_AllExtensionNumbersOfType); ok {\n\t\tx.xxx_hidden_MessageRequest = nil\n\t}\n}\n\nfunc (x *ServerReflectionRequest) ClearListServices() {\n\tif _, ok := x.xxx_hidden_MessageRequest.(*serverReflectionRequest_ListServices); ok {\n\t\tx.xxx_hidden_MessageRequest = nil\n\t}\n}\n\nconst ServerReflectionRequest_MessageRequest_not_set_case case_ServerReflectionRequest_MessageRequest = 0\nconst ServerReflectionRequest_FileByFilename_case case_ServerReflectionRequest_MessageRequest = 3\nconst ServerReflectionRequest_FileContainingSymbol_case case_ServerReflectionRequest_MessageRequest = 4\nconst ServerReflectionRequest_FileContainingExtension_case case_ServerReflectionRequest_MessageRequest = 5\nconst ServerReflectionRequest_AllExtensionNumbersOfType_case case_ServerReflectionRequest_MessageRequest = 6\nconst ServerReflectionRequest_ListServices_case case_ServerReflectionRequest_MessageRequest = 7\n\nfunc (x *ServerReflectionRequest) WhichMessageRequest() case_ServerReflectionRequest_MessageRequest {\n\tif x == nil {\n\t\treturn ServerReflectionRequest_MessageRequest_not_set_case\n\t}\n\tswitch x.xxx_hidden_MessageRequest.(type) {\n\tcase *serverReflectionRequest_FileByFilename:\n\t\treturn ServerReflectionRequest_FileByFilename_case\n\tcase *serverReflectionRequest_FileContainingSymbol:\n\t\treturn ServerReflectionRequest_FileContainingSymbol_case\n\tcase *serverReflectionRequest_FileContainingExtension:\n\t\treturn ServerReflectionRequest_FileContainingExtension_case\n\tcase *serverReflectionRequest_AllExtensionNumbersOfType:\n\t\treturn ServerReflectionRequest_AllExtensionNumbersOfType_case\n\tcase *serverReflectionRequest_ListServices:\n\t\treturn ServerReflectionRequest_ListServices_case\n\tdefault:\n\t\treturn ServerReflectionRequest_MessageRequest_not_set_case\n\t}\n}\n\ntype ServerReflectionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tHost string\n\t// To use reflection service, the client should set one of the following\n\t// fields in message_request. The server distinguishes requests by their\n\t// defined field and then handles them using corresponding methods.\n\n\t// Fields of oneof xxx_hidden_MessageRequest:\n\t// Find a proto file by the file name.\n\tFileByFilename *string\n\t// Find the proto file that declares the given fully-qualified symbol name.\n\t// This field should be a fully-qualified symbol name\n\t// (e.g. <package>.<service>[.<method>] or <package>.<type>).\n\tFileContainingSymbol *string\n\t// Find the proto file which defines an extension extending the given\n\t// message type with the given field number.\n\tFileContainingExtension *ExtensionRequest\n\t// Finds the tag numbers used by all known extensions of the given message\n\t// type, and appends them to ExtensionNumberResponse in an undefined order.\n\t// Its corresponding method is best-effort: it's not guaranteed that the\n\t// reflection service will implement this method, and it's not guaranteed\n\t// that this method will provide all extensions. Returns\n\t// StatusCode::UNIMPLEMENTED if it's not implemented.\n\t// This field should be a fully-qualified type name. The format is\n\t// <package>.<type>\n\tAllExtensionNumbersOfType *string\n\t// List the full names of registered services. The content will not be\n\t// checked.\n\tListServices *string\n\t// -- end of xxx_hidden_MessageRequest\n}\n\nfunc (b0 ServerReflectionRequest_builder) Build() *ServerReflectionRequest {\n\tm0 := &ServerReflectionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Host = b.Host\n\tif b.FileByFilename != nil {\n\t\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_FileByFilename{*b.FileByFilename}\n\t}\n\tif b.FileContainingSymbol != nil {\n\t\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_FileContainingSymbol{*b.FileContainingSymbol}\n\t}\n\tif b.FileContainingExtension != nil {\n\t\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_FileContainingExtension{b.FileContainingExtension}\n\t}\n\tif b.AllExtensionNumbersOfType != nil {\n\t\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_AllExtensionNumbersOfType{*b.AllExtensionNumbersOfType}\n\t}\n\tif b.ListServices != nil {\n\t\tx.xxx_hidden_MessageRequest = &serverReflectionRequest_ListServices{*b.ListServices}\n\t}\n\treturn m0\n}\n\ntype case_ServerReflectionRequest_MessageRequest protoreflect.FieldNumber\n\nfunc (x case_ServerReflectionRequest_MessageRequest) String() string {\n\tmd := file_grpc_reflection_v1_reflection_proto_msgTypes[0].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isServerReflectionRequest_MessageRequest interface {\n\tisServerReflectionRequest_MessageRequest()\n}\n\ntype serverReflectionRequest_FileByFilename struct {\n\t// Find a proto file by the file name.\n\tFileByFilename string `protobuf:\"bytes,3,opt,name=file_by_filename,json=fileByFilename,proto3,oneof\"`\n}\n\ntype serverReflectionRequest_FileContainingSymbol struct {\n\t// Find the proto file that declares the given fully-qualified symbol name.\n\t// This field should be a fully-qualified symbol name\n\t// (e.g. <package>.<service>[.<method>] or <package>.<type>).\n\tFileContainingSymbol string `protobuf:\"bytes,4,opt,name=file_containing_symbol,json=fileContainingSymbol,proto3,oneof\"`\n}\n\ntype serverReflectionRequest_FileContainingExtension struct {\n\t// Find the proto file which defines an extension extending the given\n\t// message type with the given field number.\n\tFileContainingExtension *ExtensionRequest `protobuf:\"bytes,5,opt,name=file_containing_extension,json=fileContainingExtension,proto3,oneof\"`\n}\n\ntype serverReflectionRequest_AllExtensionNumbersOfType struct {\n\t// Finds the tag numbers used by all known extensions of the given message\n\t// type, and appends them to ExtensionNumberResponse in an undefined order.\n\t// Its corresponding method is best-effort: it's not guaranteed that the\n\t// reflection service will implement this method, and it's not guaranteed\n\t// that this method will provide all extensions. Returns\n\t// StatusCode::UNIMPLEMENTED if it's not implemented.\n\t// This field should be a fully-qualified type name. The format is\n\t// <package>.<type>\n\tAllExtensionNumbersOfType string `protobuf:\"bytes,6,opt,name=all_extension_numbers_of_type,json=allExtensionNumbersOfType,proto3,oneof\"`\n}\n\ntype serverReflectionRequest_ListServices struct {\n\t// List the full names of registered services. The content will not be\n\t// checked.\n\tListServices string `protobuf:\"bytes,7,opt,name=list_services,json=listServices,proto3,oneof\"`\n}\n\nfunc (*serverReflectionRequest_FileByFilename) isServerReflectionRequest_MessageRequest() {}\n\nfunc (*serverReflectionRequest_FileContainingSymbol) isServerReflectionRequest_MessageRequest() {}\n\nfunc (*serverReflectionRequest_FileContainingExtension) isServerReflectionRequest_MessageRequest() {}\n\nfunc (*serverReflectionRequest_AllExtensionNumbersOfType) isServerReflectionRequest_MessageRequest() {\n}\n\nfunc (*serverReflectionRequest_ListServices) isServerReflectionRequest_MessageRequest() {}\n\n// The type name and extension number sent by the client when requesting\n// file_containing_extension.\ntype ExtensionRequest struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ContainingType  string                 `protobuf:\"bytes,1,opt,name=containing_type,json=containingType,proto3\"`\n\txxx_hidden_ExtensionNumber int32                  `protobuf:\"varint,2,opt,name=extension_number,json=extensionNumber,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *ExtensionRequest) Reset() {\n\t*x = ExtensionRequest{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[1]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ExtensionRequest) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ExtensionRequest) ProtoMessage() {}\n\nfunc (x *ExtensionRequest) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *ExtensionRequest) GetContainingType() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ContainingType\n\t}\n\treturn \"\"\n}\n\nfunc (x *ExtensionRequest) GetExtensionNumber() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExtensionNumber\n\t}\n\treturn 0\n}\n\nfunc (x *ExtensionRequest) SetContainingType(v string) {\n\tx.xxx_hidden_ContainingType = v\n}\n\nfunc (x *ExtensionRequest) SetExtensionNumber(v int32) {\n\tx.xxx_hidden_ExtensionNumber = v\n}\n\ntype ExtensionRequest_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Fully-qualified type name. The format should be <package>.<type>\n\tContainingType  string\n\tExtensionNumber int32\n}\n\nfunc (b0 ExtensionRequest_builder) Build() *ExtensionRequest {\n\tm0 := &ExtensionRequest{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ContainingType = b.ContainingType\n\tx.xxx_hidden_ExtensionNumber = b.ExtensionNumber\n\treturn m0\n}\n\n// The message sent by the server to answer ServerReflectionInfo method.\ntype ServerReflectionResponse struct {\n\tstate                      protoimpl.MessageState                     `protogen:\"opaque.v1\"`\n\txxx_hidden_ValidHost       string                                     `protobuf:\"bytes,1,opt,name=valid_host,json=validHost,proto3\"`\n\txxx_hidden_OriginalRequest *ServerReflectionRequest                   `protobuf:\"bytes,2,opt,name=original_request,json=originalRequest,proto3\"`\n\txxx_hidden_MessageResponse isServerReflectionResponse_MessageResponse `protobuf_oneof:\"message_response\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *ServerReflectionResponse) Reset() {\n\t*x = ServerReflectionResponse{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[2]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ServerReflectionResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ServerReflectionResponse) ProtoMessage() {}\n\nfunc (x *ServerReflectionResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *ServerReflectionResponse) GetValidHost() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ValidHost\n\t}\n\treturn \"\"\n}\n\nfunc (x *ServerReflectionResponse) GetOriginalRequest() *ServerReflectionRequest {\n\tif x != nil {\n\t\treturn x.xxx_hidden_OriginalRequest\n\t}\n\treturn nil\n}\n\nfunc (x *ServerReflectionResponse) GetFileDescriptorResponse() *FileDescriptorResponse {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_FileDescriptorResponse); ok {\n\t\t\treturn x.FileDescriptorResponse\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ServerReflectionResponse) GetAllExtensionNumbersResponse() *ExtensionNumberResponse {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_AllExtensionNumbersResponse); ok {\n\t\t\treturn x.AllExtensionNumbersResponse\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ServerReflectionResponse) GetListServicesResponse() *ListServiceResponse {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_ListServicesResponse); ok {\n\t\t\treturn x.ListServicesResponse\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ServerReflectionResponse) GetErrorResponse() *ErrorResponse {\n\tif x != nil {\n\t\tif x, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_ErrorResponse); ok {\n\t\t\treturn x.ErrorResponse\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ServerReflectionResponse) SetValidHost(v string) {\n\tx.xxx_hidden_ValidHost = v\n}\n\nfunc (x *ServerReflectionResponse) SetOriginalRequest(v *ServerReflectionRequest) {\n\tx.xxx_hidden_OriginalRequest = v\n}\n\nfunc (x *ServerReflectionResponse) SetFileDescriptorResponse(v *FileDescriptorResponse) {\n\tif v == nil {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_FileDescriptorResponse{v}\n}\n\nfunc (x *ServerReflectionResponse) SetAllExtensionNumbersResponse(v *ExtensionNumberResponse) {\n\tif v == nil {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_AllExtensionNumbersResponse{v}\n}\n\nfunc (x *ServerReflectionResponse) SetListServicesResponse(v *ListServiceResponse) {\n\tif v == nil {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_ListServicesResponse{v}\n}\n\nfunc (x *ServerReflectionResponse) SetErrorResponse(v *ErrorResponse) {\n\tif v == nil {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t\treturn\n\t}\n\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_ErrorResponse{v}\n}\n\nfunc (x *ServerReflectionResponse) HasOriginalRequest() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_OriginalRequest != nil\n}\n\nfunc (x *ServerReflectionResponse) HasMessageResponse() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\treturn x.xxx_hidden_MessageResponse != nil\n}\n\nfunc (x *ServerReflectionResponse) HasFileDescriptorResponse() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_FileDescriptorResponse)\n\treturn ok\n}\n\nfunc (x *ServerReflectionResponse) HasAllExtensionNumbersResponse() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_AllExtensionNumbersResponse)\n\treturn ok\n}\n\nfunc (x *ServerReflectionResponse) HasListServicesResponse() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_ListServicesResponse)\n\treturn ok\n}\n\nfunc (x *ServerReflectionResponse) HasErrorResponse() bool {\n\tif x == nil {\n\t\treturn false\n\t}\n\t_, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_ErrorResponse)\n\treturn ok\n}\n\nfunc (x *ServerReflectionResponse) ClearOriginalRequest() {\n\tx.xxx_hidden_OriginalRequest = nil\n}\n\nfunc (x *ServerReflectionResponse) ClearMessageResponse() {\n\tx.xxx_hidden_MessageResponse = nil\n}\n\nfunc (x *ServerReflectionResponse) ClearFileDescriptorResponse() {\n\tif _, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_FileDescriptorResponse); ok {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t}\n}\n\nfunc (x *ServerReflectionResponse) ClearAllExtensionNumbersResponse() {\n\tif _, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_AllExtensionNumbersResponse); ok {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t}\n}\n\nfunc (x *ServerReflectionResponse) ClearListServicesResponse() {\n\tif _, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_ListServicesResponse); ok {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t}\n}\n\nfunc (x *ServerReflectionResponse) ClearErrorResponse() {\n\tif _, ok := x.xxx_hidden_MessageResponse.(*serverReflectionResponse_ErrorResponse); ok {\n\t\tx.xxx_hidden_MessageResponse = nil\n\t}\n}\n\nconst ServerReflectionResponse_MessageResponse_not_set_case case_ServerReflectionResponse_MessageResponse = 0\nconst ServerReflectionResponse_FileDescriptorResponse_case case_ServerReflectionResponse_MessageResponse = 4\nconst ServerReflectionResponse_AllExtensionNumbersResponse_case case_ServerReflectionResponse_MessageResponse = 5\nconst ServerReflectionResponse_ListServicesResponse_case case_ServerReflectionResponse_MessageResponse = 6\nconst ServerReflectionResponse_ErrorResponse_case case_ServerReflectionResponse_MessageResponse = 7\n\nfunc (x *ServerReflectionResponse) WhichMessageResponse() case_ServerReflectionResponse_MessageResponse {\n\tif x == nil {\n\t\treturn ServerReflectionResponse_MessageResponse_not_set_case\n\t}\n\tswitch x.xxx_hidden_MessageResponse.(type) {\n\tcase *serverReflectionResponse_FileDescriptorResponse:\n\t\treturn ServerReflectionResponse_FileDescriptorResponse_case\n\tcase *serverReflectionResponse_AllExtensionNumbersResponse:\n\t\treturn ServerReflectionResponse_AllExtensionNumbersResponse_case\n\tcase *serverReflectionResponse_ListServicesResponse:\n\t\treturn ServerReflectionResponse_ListServicesResponse_case\n\tcase *serverReflectionResponse_ErrorResponse:\n\t\treturn ServerReflectionResponse_ErrorResponse_case\n\tdefault:\n\t\treturn ServerReflectionResponse_MessageResponse_not_set_case\n\t}\n}\n\ntype ServerReflectionResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\tValidHost       string\n\tOriginalRequest *ServerReflectionRequest\n\t// The server sets one of the following fields according to the message_request\n\t// in the request.\n\n\t// Fields of oneof xxx_hidden_MessageResponse:\n\t// This message is used to answer file_by_filename, file_containing_symbol,\n\t// file_containing_extension requests with transitive dependencies.\n\t// As the repeated label is not allowed in oneof fields, we use a\n\t// FileDescriptorResponse message to encapsulate the repeated fields.\n\t// The reflection service is allowed to avoid sending FileDescriptorProtos\n\t// that were previously sent in response to earlier requests in the stream.\n\tFileDescriptorResponse *FileDescriptorResponse\n\t// This message is used to answer all_extension_numbers_of_type requests.\n\tAllExtensionNumbersResponse *ExtensionNumberResponse\n\t// This message is used to answer list_services requests.\n\tListServicesResponse *ListServiceResponse\n\t// This message is used when an error occurs.\n\tErrorResponse *ErrorResponse\n\t// -- end of xxx_hidden_MessageResponse\n}\n\nfunc (b0 ServerReflectionResponse_builder) Build() *ServerReflectionResponse {\n\tm0 := &ServerReflectionResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ValidHost = b.ValidHost\n\tx.xxx_hidden_OriginalRequest = b.OriginalRequest\n\tif b.FileDescriptorResponse != nil {\n\t\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_FileDescriptorResponse{b.FileDescriptorResponse}\n\t}\n\tif b.AllExtensionNumbersResponse != nil {\n\t\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_AllExtensionNumbersResponse{b.AllExtensionNumbersResponse}\n\t}\n\tif b.ListServicesResponse != nil {\n\t\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_ListServicesResponse{b.ListServicesResponse}\n\t}\n\tif b.ErrorResponse != nil {\n\t\tx.xxx_hidden_MessageResponse = &serverReflectionResponse_ErrorResponse{b.ErrorResponse}\n\t}\n\treturn m0\n}\n\ntype case_ServerReflectionResponse_MessageResponse protoreflect.FieldNumber\n\nfunc (x case_ServerReflectionResponse_MessageResponse) String() string {\n\tmd := file_grpc_reflection_v1_reflection_proto_msgTypes[2].Descriptor()\n\tif x == 0 {\n\t\treturn \"not set\"\n\t}\n\treturn protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))\n}\n\ntype isServerReflectionResponse_MessageResponse interface {\n\tisServerReflectionResponse_MessageResponse()\n}\n\ntype serverReflectionResponse_FileDescriptorResponse struct {\n\t// This message is used to answer file_by_filename, file_containing_symbol,\n\t// file_containing_extension requests with transitive dependencies.\n\t// As the repeated label is not allowed in oneof fields, we use a\n\t// FileDescriptorResponse message to encapsulate the repeated fields.\n\t// The reflection service is allowed to avoid sending FileDescriptorProtos\n\t// that were previously sent in response to earlier requests in the stream.\n\tFileDescriptorResponse *FileDescriptorResponse `protobuf:\"bytes,4,opt,name=file_descriptor_response,json=fileDescriptorResponse,proto3,oneof\"`\n}\n\ntype serverReflectionResponse_AllExtensionNumbersResponse struct {\n\t// This message is used to answer all_extension_numbers_of_type requests.\n\tAllExtensionNumbersResponse *ExtensionNumberResponse `protobuf:\"bytes,5,opt,name=all_extension_numbers_response,json=allExtensionNumbersResponse,proto3,oneof\"`\n}\n\ntype serverReflectionResponse_ListServicesResponse struct {\n\t// This message is used to answer list_services requests.\n\tListServicesResponse *ListServiceResponse `protobuf:\"bytes,6,opt,name=list_services_response,json=listServicesResponse,proto3,oneof\"`\n}\n\ntype serverReflectionResponse_ErrorResponse struct {\n\t// This message is used when an error occurs.\n\tErrorResponse *ErrorResponse `protobuf:\"bytes,7,opt,name=error_response,json=errorResponse,proto3,oneof\"`\n}\n\nfunc (*serverReflectionResponse_FileDescriptorResponse) isServerReflectionResponse_MessageResponse() {\n}\n\nfunc (*serverReflectionResponse_AllExtensionNumbersResponse) isServerReflectionResponse_MessageResponse() {\n}\n\nfunc (*serverReflectionResponse_ListServicesResponse) isServerReflectionResponse_MessageResponse() {}\n\nfunc (*serverReflectionResponse_ErrorResponse) isServerReflectionResponse_MessageResponse() {}\n\n// Serialized FileDescriptorProto messages sent by the server answering\n// a file_by_filename, file_containing_symbol, or file_containing_extension\n// request.\ntype FileDescriptorResponse struct {\n\tstate                          protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_FileDescriptorProto [][]byte               `protobuf:\"bytes,1,rep,name=file_descriptor_proto,json=fileDescriptorProto,proto3\"`\n\tunknownFields                  protoimpl.UnknownFields\n\tsizeCache                      protoimpl.SizeCache\n}\n\nfunc (x *FileDescriptorResponse) Reset() {\n\t*x = FileDescriptorResponse{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[3]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *FileDescriptorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*FileDescriptorResponse) ProtoMessage() {}\n\nfunc (x *FileDescriptorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *FileDescriptorResponse) GetFileDescriptorProto() [][]byte {\n\tif x != nil {\n\t\treturn x.xxx_hidden_FileDescriptorProto\n\t}\n\treturn nil\n}\n\nfunc (x *FileDescriptorResponse) SetFileDescriptorProto(v [][]byte) {\n\tx.xxx_hidden_FileDescriptorProto = v\n}\n\ntype FileDescriptorResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Serialized FileDescriptorProto messages. We avoid taking a dependency on\n\t// descriptor.proto, which uses proto2 only features, by making them opaque\n\t// bytes instead.\n\tFileDescriptorProto [][]byte\n}\n\nfunc (b0 FileDescriptorResponse_builder) Build() *FileDescriptorResponse {\n\tm0 := &FileDescriptorResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_FileDescriptorProto = b.FileDescriptorProto\n\treturn m0\n}\n\n// A list of extension numbers sent by the server answering\n// all_extension_numbers_of_type request.\ntype ExtensionNumberResponse struct {\n\tstate                      protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_BaseTypeName    string                 `protobuf:\"bytes,1,opt,name=base_type_name,json=baseTypeName,proto3\"`\n\txxx_hidden_ExtensionNumber []int32                `protobuf:\"varint,2,rep,packed,name=extension_number,json=extensionNumber,proto3\"`\n\tunknownFields              protoimpl.UnknownFields\n\tsizeCache                  protoimpl.SizeCache\n}\n\nfunc (x *ExtensionNumberResponse) Reset() {\n\t*x = ExtensionNumberResponse{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[4]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ExtensionNumberResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ExtensionNumberResponse) ProtoMessage() {}\n\nfunc (x *ExtensionNumberResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *ExtensionNumberResponse) GetBaseTypeName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_BaseTypeName\n\t}\n\treturn \"\"\n}\n\nfunc (x *ExtensionNumberResponse) GetExtensionNumber() []int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ExtensionNumber\n\t}\n\treturn nil\n}\n\nfunc (x *ExtensionNumberResponse) SetBaseTypeName(v string) {\n\tx.xxx_hidden_BaseTypeName = v\n}\n\nfunc (x *ExtensionNumberResponse) SetExtensionNumber(v []int32) {\n\tx.xxx_hidden_ExtensionNumber = v\n}\n\ntype ExtensionNumberResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Full name of the base type, including the package name. The format\n\t// is <package>.<type>\n\tBaseTypeName    string\n\tExtensionNumber []int32\n}\n\nfunc (b0 ExtensionNumberResponse_builder) Build() *ExtensionNumberResponse {\n\tm0 := &ExtensionNumberResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_BaseTypeName = b.BaseTypeName\n\tx.xxx_hidden_ExtensionNumber = b.ExtensionNumber\n\treturn m0\n}\n\n// A list of ServiceResponse sent by the server answering list_services request.\ntype ListServiceResponse struct {\n\tstate              protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Service *[]*ServiceResponse    `protobuf:\"bytes,1,rep,name=service,proto3\"`\n\tunknownFields      protoimpl.UnknownFields\n\tsizeCache          protoimpl.SizeCache\n}\n\nfunc (x *ListServiceResponse) Reset() {\n\t*x = ListServiceResponse{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[5]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ListServiceResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ListServiceResponse) ProtoMessage() {}\n\nfunc (x *ListServiceResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *ListServiceResponse) GetService() []*ServiceResponse {\n\tif x != nil {\n\t\tif x.xxx_hidden_Service != nil {\n\t\t\treturn *x.xxx_hidden_Service\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (x *ListServiceResponse) SetService(v []*ServiceResponse) {\n\tx.xxx_hidden_Service = &v\n}\n\ntype ListServiceResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// The information of each service may be expanded in the future, so we use\n\t// ServiceResponse message to encapsulate it.\n\tService []*ServiceResponse\n}\n\nfunc (b0 ListServiceResponse_builder) Build() *ListServiceResponse {\n\tm0 := &ListServiceResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Service = &b.Service\n\treturn m0\n}\n\n// The information of a single service used by ListServiceResponse to answer\n// list_services request.\ntype ServiceResponse struct {\n\tstate           protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_Name string                 `protobuf:\"bytes,1,opt,name=name,proto3\"`\n\tunknownFields   protoimpl.UnknownFields\n\tsizeCache       protoimpl.SizeCache\n}\n\nfunc (x *ServiceResponse) Reset() {\n\t*x = ServiceResponse{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[6]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ServiceResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ServiceResponse) ProtoMessage() {}\n\nfunc (x *ServiceResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *ServiceResponse) GetName() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_Name\n\t}\n\treturn \"\"\n}\n\nfunc (x *ServiceResponse) SetName(v string) {\n\tx.xxx_hidden_Name = v\n}\n\ntype ServiceResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// Full name of a registered service, including its package name. The format\n\t// is <package>.<service>\n\tName string\n}\n\nfunc (b0 ServiceResponse_builder) Build() *ServiceResponse {\n\tm0 := &ServiceResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_Name = b.Name\n\treturn m0\n}\n\n// The error code and error message sent by the server when an error occurs.\ntype ErrorResponse struct {\n\tstate                   protoimpl.MessageState `protogen:\"opaque.v1\"`\n\txxx_hidden_ErrorCode    int32                  `protobuf:\"varint,1,opt,name=error_code,json=errorCode,proto3\"`\n\txxx_hidden_ErrorMessage string                 `protobuf:\"bytes,2,opt,name=error_message,json=errorMessage,proto3\"`\n\tunknownFields           protoimpl.UnknownFields\n\tsizeCache               protoimpl.SizeCache\n}\n\nfunc (x *ErrorResponse) Reset() {\n\t*x = ErrorResponse{}\n\tmi := &file_grpc_reflection_v1_reflection_proto_msgTypes[7]\n\tms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))\n\tms.StoreMessageInfo(mi)\n}\n\nfunc (x *ErrorResponse) String() string {\n\treturn protoimpl.X.MessageStringOf(x)\n}\n\nfunc (*ErrorResponse) ProtoMessage() {}\n\nfunc (x *ErrorResponse) ProtoReflect() protoreflect.Message {\n\tmi := &file_grpc_reflection_v1_reflection_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\nfunc (x *ErrorResponse) GetErrorCode() int32 {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ErrorCode\n\t}\n\treturn 0\n}\n\nfunc (x *ErrorResponse) GetErrorMessage() string {\n\tif x != nil {\n\t\treturn x.xxx_hidden_ErrorMessage\n\t}\n\treturn \"\"\n}\n\nfunc (x *ErrorResponse) SetErrorCode(v int32) {\n\tx.xxx_hidden_ErrorCode = v\n}\n\nfunc (x *ErrorResponse) SetErrorMessage(v string) {\n\tx.xxx_hidden_ErrorMessage = v\n}\n\ntype ErrorResponse_builder struct {\n\t_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.\n\n\t// This field uses the error codes defined in grpc::StatusCode.\n\tErrorCode    int32\n\tErrorMessage string\n}\n\nfunc (b0 ErrorResponse_builder) Build() *ErrorResponse {\n\tm0 := &ErrorResponse{}\n\tb, x := &b0, m0\n\t_, _ = b, x\n\tx.xxx_hidden_ErrorCode = b.ErrorCode\n\tx.xxx_hidden_ErrorMessage = b.ErrorMessage\n\treturn m0\n}\n\nvar File_grpc_reflection_v1_reflection_proto protoreflect.FileDescriptor\n\nconst file_grpc_reflection_v1_reflection_proto_rawDesc = \"\" +\n\t\"\\n\" +\n\t\"#grpc/reflection/v1/reflection.proto\\x12\\x12grpc.reflection.v1\\\"\\xf3\\x02\\n\" +\n\t\"\\x17ServerReflectionRequest\\x12\\x12\\n\" +\n\t\"\\x04host\\x18\\x01 \\x01(\\tR\\x04host\\x12*\\n\" +\n\t\"\\x10file_by_filename\\x18\\x03 \\x01(\\tH\\x00R\\x0efileByFilename\\x126\\n\" +\n\t\"\\x16file_containing_symbol\\x18\\x04 \\x01(\\tH\\x00R\\x14fileContainingSymbol\\x12b\\n\" +\n\t\"\\x19file_containing_extension\\x18\\x05 \\x01(\\v2$.grpc.reflection.v1.ExtensionRequestH\\x00R\\x17fileContainingExtension\\x12B\\n\" +\n\t\"\\x1dall_extension_numbers_of_type\\x18\\x06 \\x01(\\tH\\x00R\\x19allExtensionNumbersOfType\\x12%\\n\" +\n\t\"\\rlist_services\\x18\\a \\x01(\\tH\\x00R\\flistServicesB\\x11\\n\" +\n\t\"\\x0fmessage_request\\\"f\\n\" +\n\t\"\\x10ExtensionRequest\\x12'\\n\" +\n\t\"\\x0fcontaining_type\\x18\\x01 \\x01(\\tR\\x0econtainingType\\x12)\\n\" +\n\t\"\\x10extension_number\\x18\\x02 \\x01(\\x05R\\x0fextensionNumber\\\"\\xae\\x04\\n\" +\n\t\"\\x18ServerReflectionResponse\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"valid_host\\x18\\x01 \\x01(\\tR\\tvalidHost\\x12V\\n\" +\n\t\"\\x10original_request\\x18\\x02 \\x01(\\v2+.grpc.reflection.v1.ServerReflectionRequestR\\x0foriginalRequest\\x12f\\n\" +\n\t\"\\x18file_descriptor_response\\x18\\x04 \\x01(\\v2*.grpc.reflection.v1.FileDescriptorResponseH\\x00R\\x16fileDescriptorResponse\\x12r\\n\" +\n\t\"\\x1eall_extension_numbers_response\\x18\\x05 \\x01(\\v2+.grpc.reflection.v1.ExtensionNumberResponseH\\x00R\\x1ballExtensionNumbersResponse\\x12_\\n\" +\n\t\"\\x16list_services_response\\x18\\x06 \\x01(\\v2'.grpc.reflection.v1.ListServiceResponseH\\x00R\\x14listServicesResponse\\x12J\\n\" +\n\t\"\\x0eerror_response\\x18\\a \\x01(\\v2!.grpc.reflection.v1.ErrorResponseH\\x00R\\rerrorResponseB\\x12\\n\" +\n\t\"\\x10message_response\\\"L\\n\" +\n\t\"\\x16FileDescriptorResponse\\x122\\n\" +\n\t\"\\x15file_descriptor_proto\\x18\\x01 \\x03(\\fR\\x13fileDescriptorProto\\\"j\\n\" +\n\t\"\\x17ExtensionNumberResponse\\x12$\\n\" +\n\t\"\\x0ebase_type_name\\x18\\x01 \\x01(\\tR\\fbaseTypeName\\x12)\\n\" +\n\t\"\\x10extension_number\\x18\\x02 \\x03(\\x05R\\x0fextensionNumber\\\"T\\n\" +\n\t\"\\x13ListServiceResponse\\x12=\\n\" +\n\t\"\\aservice\\x18\\x01 \\x03(\\v2#.grpc.reflection.v1.ServiceResponseR\\aservice\\\"%\\n\" +\n\t\"\\x0fServiceResponse\\x12\\x12\\n\" +\n\t\"\\x04name\\x18\\x01 \\x01(\\tR\\x04name\\\"S\\n\" +\n\t\"\\rErrorResponse\\x12\\x1d\\n\" +\n\t\"\\n\" +\n\t\"error_code\\x18\\x01 \\x01(\\x05R\\terrorCode\\x12#\\n\" +\n\t\"\\rerror_message\\x18\\x02 \\x01(\\tR\\ferrorMessage2\\x89\\x01\\n\" +\n\t\"\\x10ServerReflection\\x12u\\n\" +\n\t\"\\x14ServerReflectionInfo\\x12+.grpc.reflection.v1.ServerReflectionRequest\\x1a,.grpc.reflection.v1.ServerReflectionResponse(\\x010\\x01B\\xe1\\x01\\n\" +\n\t\"\\x16com.grpc.reflection.v1B\\x0fReflectionProtoP\\x01ZLgithub.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1;reflectionv1\\xa2\\x02\\x03GRX\\xaa\\x02\\x12Grpc.Reflection.V1\\xca\\x02\\x12Grpc\\\\Reflection\\\\V1\\xe2\\x02\\x1eGrpc\\\\Reflection\\\\V1\\\\GPBMetadata\\xea\\x02\\x14Grpc::Reflection::V1b\\x06proto3\"\n\nvar file_grpc_reflection_v1_reflection_proto_msgTypes = make([]protoimpl.MessageInfo, 8)\nvar file_grpc_reflection_v1_reflection_proto_goTypes = []any{\n\t(*ServerReflectionRequest)(nil),  // 0: grpc.reflection.v1.ServerReflectionRequest\n\t(*ExtensionRequest)(nil),         // 1: grpc.reflection.v1.ExtensionRequest\n\t(*ServerReflectionResponse)(nil), // 2: grpc.reflection.v1.ServerReflectionResponse\n\t(*FileDescriptorResponse)(nil),   // 3: grpc.reflection.v1.FileDescriptorResponse\n\t(*ExtensionNumberResponse)(nil),  // 4: grpc.reflection.v1.ExtensionNumberResponse\n\t(*ListServiceResponse)(nil),      // 5: grpc.reflection.v1.ListServiceResponse\n\t(*ServiceResponse)(nil),          // 6: grpc.reflection.v1.ServiceResponse\n\t(*ErrorResponse)(nil),            // 7: grpc.reflection.v1.ErrorResponse\n}\nvar file_grpc_reflection_v1_reflection_proto_depIdxs = []int32{\n\t1, // 0: grpc.reflection.v1.ServerReflectionRequest.file_containing_extension:type_name -> grpc.reflection.v1.ExtensionRequest\n\t0, // 1: grpc.reflection.v1.ServerReflectionResponse.original_request:type_name -> grpc.reflection.v1.ServerReflectionRequest\n\t3, // 2: grpc.reflection.v1.ServerReflectionResponse.file_descriptor_response:type_name -> grpc.reflection.v1.FileDescriptorResponse\n\t4, // 3: grpc.reflection.v1.ServerReflectionResponse.all_extension_numbers_response:type_name -> grpc.reflection.v1.ExtensionNumberResponse\n\t5, // 4: grpc.reflection.v1.ServerReflectionResponse.list_services_response:type_name -> grpc.reflection.v1.ListServiceResponse\n\t7, // 5: grpc.reflection.v1.ServerReflectionResponse.error_response:type_name -> grpc.reflection.v1.ErrorResponse\n\t6, // 6: grpc.reflection.v1.ListServiceResponse.service:type_name -> grpc.reflection.v1.ServiceResponse\n\t0, // 7: grpc.reflection.v1.ServerReflection.ServerReflectionInfo:input_type -> grpc.reflection.v1.ServerReflectionRequest\n\t2, // 8: grpc.reflection.v1.ServerReflection.ServerReflectionInfo:output_type -> grpc.reflection.v1.ServerReflectionResponse\n\t8, // [8:9] is the sub-list for method output_type\n\t7, // [7:8] is the sub-list for method input_type\n\t7, // [7:7] is the sub-list for extension type_name\n\t7, // [7:7] is the sub-list for extension extendee\n\t0, // [0:7] is the sub-list for field type_name\n}\n\nfunc init() { file_grpc_reflection_v1_reflection_proto_init() }\nfunc file_grpc_reflection_v1_reflection_proto_init() {\n\tif File_grpc_reflection_v1_reflection_proto != nil {\n\t\treturn\n\t}\n\tfile_grpc_reflection_v1_reflection_proto_msgTypes[0].OneofWrappers = []any{\n\t\t(*serverReflectionRequest_FileByFilename)(nil),\n\t\t(*serverReflectionRequest_FileContainingSymbol)(nil),\n\t\t(*serverReflectionRequest_FileContainingExtension)(nil),\n\t\t(*serverReflectionRequest_AllExtensionNumbersOfType)(nil),\n\t\t(*serverReflectionRequest_ListServices)(nil),\n\t}\n\tfile_grpc_reflection_v1_reflection_proto_msgTypes[2].OneofWrappers = []any{\n\t\t(*serverReflectionResponse_FileDescriptorResponse)(nil),\n\t\t(*serverReflectionResponse_AllExtensionNumbersResponse)(nil),\n\t\t(*serverReflectionResponse_ListServicesResponse)(nil),\n\t\t(*serverReflectionResponse_ErrorResponse)(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: unsafe.Slice(unsafe.StringData(file_grpc_reflection_v1_reflection_proto_rawDesc), len(file_grpc_reflection_v1_reflection_proto_rawDesc)),\n\t\t\tNumEnums:      0,\n\t\t\tNumMessages:   8,\n\t\t\tNumExtensions: 0,\n\t\t\tNumServices:   1,\n\t\t},\n\t\tGoTypes:           file_grpc_reflection_v1_reflection_proto_goTypes,\n\t\tDependencyIndexes: file_grpc_reflection_v1_reflection_proto_depIdxs,\n\t\tMessageInfos:      file_grpc_reflection_v1_reflection_proto_msgTypes,\n\t}.Build()\n\tFile_grpc_reflection_v1_reflection_proto = out.File\n\tfile_grpc_reflection_v1_reflection_proto_goTypes = nil\n\tfile_grpc_reflection_v1_reflection_proto_depIdxs = nil\n}\n"
  },
  {
    "path": "private/gen/proto/go/grpc/reflection/v1/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage reflectionv1\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/bandeps/bandeps.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bandeps\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app\"\n)\n\n// Checker is a checker.\ntype Checker interface {\n\t// Check runs bandeps in the current directory with the configuration.\n\tCheck(\n\t\tctx context.Context,\n\t\tenvStdioContainer app.EnvStdioContainer,\n\t\texternalConfig ExternalConfig,\n\t) ([]Violation, error)\n}\n\n// NewChecker returns a new Checker.\nfunc NewChecker(logger *slog.Logger) Checker {\n\treturn newChecker(logger)\n}\n\n// Violation is a violation.\ntype Violation interface {\n\tfmt.Stringer\n\n\tPackage() string\n\tDep() string\n\tNote() string\n\n\tkey() string\n}\n\n// ExternalConfig is an external configuration.\ntype ExternalConfig struct {\n\tBans []ExternalBanConfig `json:\"bans,omitempty\" yaml:\"bans,omitempty\"`\n}\n\n// ExternalBanConfig is an external ban configuration.\ntype ExternalBanConfig struct {\n\t// Packages are the package expressions to get dependencies for.\n\tPackages ExternalPackageConfig `json:\"packages\" yaml:\"packages,omitempty\"`\n\t// Deps are package expressions that cannot be depended on for Packages.\n\tDeps ExternalPackageConfig `json:\"deps\" yaml:\"deps,omitempty\"`\n\t// Note is a note to print out regarding why this ban exists.\n\tNote string `json:\"note,omitempty\" yaml:\"note,omitempty\"`\n}\n\n// ExternalPackageConfig is an external package configuration.\ntype ExternalPackageConfig struct {\n\t// Use are the package expressions to list with go list.\n\tUse []string `json:\"use,omitempty\" yaml:\"use,omitempty\"`\n\t// Except are the package expressions that should be excluded from Use.\n\tExcept []string `json:\"except,omitempty\" yaml:\"except,omitempty\"`\n}\n"
  },
  {
    "path": "private/pkg/bandeps/checker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bandeps\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\t\"sync\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n)\n\ntype checker struct {\n\tlogger *slog.Logger\n}\n\nfunc newChecker(logger *slog.Logger) *checker {\n\treturn &checker{\n\t\tlogger: logger,\n\t}\n}\n\nfunc (c *checker) Check(\n\tctx context.Context,\n\tenvStdioContainer app.EnvStdioContainer,\n\texternalConfig ExternalConfig,\n) ([]Violation, error) {\n\tstate := newState(c.logger, envStdioContainer)\n\tif err := c.populateState(ctx, state, externalConfig); err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, externalBanConfig := range externalConfig.Bans {\n\t\tif err := c.checkBan(ctx, state, externalBanConfig); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn state.Violations(), nil\n}\n\nfunc (c *checker) checkBan(\n\tctx context.Context,\n\tstate *state,\n\texternalBanConfig ExternalBanConfig,\n) error {\n\tpackages, err := c.getPackages(ctx, state, externalBanConfig.Packages)\n\tif err != nil {\n\t\treturn err\n\t}\n\tbanPackages, err := c.getPackages(ctx, state, externalBanConfig.Deps)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor pkg := range packages {\n\t\tdeps, err := state.DepsForPackages(ctx, pkg)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor dep := range deps {\n\t\t\tif _, ok := banPackages[dep]; ok {\n\t\t\t\tstate.AddViolation(\n\t\t\t\t\tnewViolation(\n\t\t\t\t\t\tpkg,\n\t\t\t\t\t\tdep,\n\t\t\t\t\t\texternalBanConfig.Note,\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (c *checker) getPackages(\n\tctx context.Context,\n\tstate *state,\n\texternalPackageConfig ExternalPackageConfig,\n) (map[string]struct{}, error) {\n\tusePackages, err := state.PackagesForPackageExpressions(ctx, externalPackageConfig.Use...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texceptPackages, err := state.PackagesForPackageExpressions(ctx, externalPackageConfig.Except...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsubtractMaps(usePackages, exceptPackages)\n\treturn usePackages, nil\n}\n\nfunc (c *checker) populateState(ctx context.Context, state *state, externalConfig ExternalConfig) error {\n\tvar depPackageExpressions []string\n\tvar packageExpressions []string\n\tfor _, externalBanConfig := range externalConfig.Bans {\n\t\tdepPackageExpressions = append(depPackageExpressions, externalBanConfig.Packages.Use...)\n\t\tdepPackageExpressions = append(depPackageExpressions, externalBanConfig.Packages.Except...)\n\t\tpackageExpressions = append(packageExpressions, externalBanConfig.Deps.Use...)\n\t\tpackageExpressions = append(packageExpressions, externalBanConfig.Deps.Except...)\n\t}\n\n\tdepPackages := make(map[string]struct{})\n\tvar lock sync.Mutex\n\tvar jobs []func(context.Context) error\n\tfor _, packageExpression := range depPackageExpressions {\n\t\tjobs = append(\n\t\t\tjobs,\n\t\t\tfunc(ctx context.Context) error {\n\t\t\t\tpkgs, err := state.PackagesForPackageExpressions(ctx, packageExpression)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tlock.Lock()\n\t\t\t\taddMaps(depPackages, pkgs)\n\t\t\t\tlock.Unlock()\n\t\t\t\treturn nil\n\t\t\t},\n\t\t)\n\t}\n\tfor _, packageExpression := range packageExpressions {\n\t\tjobs = append(\n\t\t\tjobs,\n\t\t\tfunc(ctx context.Context) error {\n\t\t\t\t_, err := state.PackagesForPackageExpressions(ctx, packageExpression)\n\t\t\t\treturn err\n\t\t\t},\n\t\t)\n\t}\n\tif err := thread.Parallelize(ctx, jobs, thread.ParallelizeWithCancelOnFailure()); err != nil {\n\t\treturn err\n\t}\n\n\tjobs = make([]func(context.Context) error, 0)\n\tfor pkg := range depPackages {\n\t\tjobs = append(\n\t\t\tjobs,\n\t\t\tfunc(ctx context.Context) error {\n\t\t\t\t_, err := state.DepsForPackages(ctx, pkg)\n\t\t\t\treturn err\n\t\t\t},\n\t\t)\n\t}\n\treturn thread.Parallelize(ctx, jobs, thread.ParallelizeWithCancelOnFailure())\n}\n"
  },
  {
    "path": "private/pkg/bandeps/cmd/bandeps/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"buf.build/go/app/appcmd\"\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/pkg/bandeps\"\n\t\"github.com/bufbuild/buf/private/pkg/encoding\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tname = \"bandeps\"\n\n\tconfigFileFlagName      = \"config-file\"\n\tconfigFileFlagShortName = \"f\"\n\n\ttimeout = 120 * time.Second\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\tbuilder := appext.NewBuilder(\n\t\tname,\n\t\tappext.BuilderWithTimeout(timeout),\n\t\tappext.BuilderWithLoggerProvider(slogapp.LoggerProvider),\n\t)\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse: name,\n\t\tRun: builder.NewRunFunc(\n\t\t\tfunc(ctx context.Context, container appext.Container) error {\n\t\t\t\treturn run(ctx, container, flags)\n\t\t\t},\n\t\t),\n\t\tBindPersistentFlags: builder.BindRoot,\n\t\tBindFlags:           flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tConfigFile string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVarP(\n\t\t&f.ConfigFile,\n\t\tconfigFileFlagName,\n\t\tconfigFileFlagShortName,\n\t\t\"\",\n\t\t\"The config file to use.\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, configFileFlagName)\n}\n\nfunc run(ctx context.Context, container appext.Container, flags *flags) error {\n\tconfigData, err := os.ReadFile(flags.ConfigFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar externalConfig bandeps.ExternalConfig\n\tif err := encoding.UnmarshalJSONOrYAMLStrict(configData, &externalConfig); err != nil {\n\t\treturn err\n\t}\n\tviolations, err := bandeps.NewChecker(\n\t\tcontainer.Logger(),\n\t).Check(\n\t\tctx,\n\t\tcontainer,\n\t\texternalConfig,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(violations) > 0 {\n\t\tfor _, violation := range violations {\n\t\t\tif _, err := fmt.Fprintln(container.Stdout(), violation.String()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn errors.New(\"\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/bandeps/cmd/bandeps/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/bandeps/key_rwlock.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bandeps\n\nimport \"sync\"\n\n// You can never hold more than one key at a time! We do not enforce lock ordering!\n\ntype keyRWLock struct {\n\tkeyToRWLock map[string]*sync.RWMutex\n\tlock        sync.Mutex\n}\n\nfunc newKeyRWLock() *keyRWLock {\n\treturn &keyRWLock{\n\t\tkeyToRWLock: make(map[string]*sync.RWMutex),\n\t}\n}\n\nfunc (k *keyRWLock) RLock(key string) {\n\tk.getRWLock(key).Lock()\n}\n\nfunc (k *keyRWLock) RUnlock(key string) {\n\tk.getRWLock(key).Unlock()\n}\n\nfunc (k *keyRWLock) Lock(key string) {\n\tk.getRWLock(key).Lock()\n}\n\nfunc (k *keyRWLock) Unlock(key string) {\n\tk.getRWLock(key).Unlock()\n}\n\nfunc (k *keyRWLock) getRWLock(key string) *sync.RWMutex {\n\tk.lock.Lock()\n\trwLock, ok := k.keyToRWLock[key]\n\tif !ok {\n\t\trwLock = &sync.RWMutex{}\n\t\tk.keyToRWLock[key] = rwLock\n\t}\n\tk.lock.Unlock()\n\treturn rwLock\n}\n"
  },
  {
    "path": "private/pkg/bandeps/state.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bandeps\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"log/slog\"\n\t\"sync\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"buf.build/go/standard/xslices\"\n)\n\ntype state struct {\n\tlogger            *slog.Logger\n\tenvStdioContainer app.EnvStdioContainer\n\tviolationMap      map[string]Violation\n\t// map from ./foo/bar/... to actual packages\n\tpackageExpressionToPackages     map[string]*packagesResult\n\tpackageExpressionToPackagesLock *keyRWLock\n\t// map from packages to dependencies\n\tpackageToDeps     map[string]*depsResult\n\tpackageToDepsLock *keyRWLock\n\tlock              sync.RWMutex\n\tcalls             int\n\tcacheHits         int\n}\n\nfunc newState(\n\tlogger *slog.Logger,\n\tenvStdioContainer app.EnvStdioContainer,\n) *state {\n\treturn &state{\n\t\tlogger:                          logger,\n\t\tenvStdioContainer:               envStdioContainer,\n\t\tviolationMap:                    make(map[string]Violation),\n\t\tpackageExpressionToPackages:     make(map[string]*packagesResult),\n\t\tpackageExpressionToPackagesLock: newKeyRWLock(),\n\t\tpackageToDeps:                   make(map[string]*depsResult),\n\t\tpackageToDepsLock:               newKeyRWLock(),\n\t}\n}\n\nfunc (s *state) PackagesForPackageExpressions(\n\tctx context.Context,\n\tpackageExpressions ...string,\n) (map[string]struct{}, error) {\n\tpackages := make(map[string]struct{})\n\tfor _, packageExpression := range packageExpressions {\n\t\tiPackages, err := s.packagesForPackageExpression(ctx, packageExpression)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\taddMaps(packages, iPackages)\n\t}\n\treturn packages, nil\n}\n\nfunc (s *state) DepsForPackages(\n\tctx context.Context,\n\tpkgs ...string,\n) (map[string]struct{}, error) {\n\tdeps := make(map[string]struct{})\n\tfor _, pkg := range pkgs {\n\t\tiDeps, err := s.depsForPackage(ctx, pkg)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\taddMaps(deps, iDeps)\n\t}\n\treturn deps, nil\n}\n\nfunc (s *state) AddViolation(violation Violation) {\n\tviolationKey := violation.key()\n\ts.lock.Lock()\n\tif _, ok := s.violationMap[violationKey]; !ok {\n\t\ts.violationMap[violationKey] = violation\n\t}\n\ts.lock.Unlock()\n}\n\nfunc (s *state) Violations() []Violation {\n\ts.lock.RLock()\n\tviolations := make([]Violation, 0, len(s.violationMap))\n\tfor _, violation := range s.violationMap {\n\t\tviolations = append(violations, violation)\n\t}\n\ts.lock.RUnlock()\n\tsortViolations(violations)\n\treturn violations\n}\n\nfunc (s *state) packagesForPackageExpression(\n\tctx context.Context,\n\tpackageExpression string,\n) (map[string]struct{}, error) {\n\tdefer func() {\n\t\t// not worrying about locks\n\t\ts.logger.DebugContext(ctx, \"cache\", slog.Int(\"calls\", s.calls), slog.Int(\"hits\", s.cacheHits))\n\t}()\n\n\ts.packageExpressionToPackagesLock.RLock(packageExpression)\n\ts.lock.RLock()\n\tpackageResult, ok := s.packageExpressionToPackages[packageExpression]\n\ts.lock.RUnlock()\n\ts.packageExpressionToPackagesLock.RUnlock(packageExpression)\n\tif ok {\n\t\ts.lock.Lock()\n\t\ts.calls++\n\t\ts.cacheHits++\n\t\ts.lock.Unlock()\n\t\treturn packageResult.Packages, packageResult.Err\n\t}\n\n\ts.packageExpressionToPackagesLock.Lock(packageExpression)\n\tdefer s.packageExpressionToPackagesLock.Unlock(packageExpression)\n\n\ts.lock.RLock()\n\tpackageResult, ok = s.packageExpressionToPackages[packageExpression]\n\ts.lock.RUnlock()\n\tif ok {\n\t\ts.lock.Lock()\n\t\ts.calls++\n\t\ts.cacheHits++\n\t\ts.lock.Unlock()\n\t\treturn packageResult.Packages, packageResult.Err\n\t}\n\tpackages, err := s.packagesForPackageExpressionUncached(ctx, packageExpression)\n\t// we always hold key lock and then this lock so lock ordering is ok\n\ts.lock.Lock()\n\ts.packageExpressionToPackages[packageExpression] = newPackagesResult(packages, err)\n\ts.calls++\n\ts.lock.Unlock()\n\treturn packages, err\n}\n\nfunc (s *state) packagesForPackageExpressionUncached(\n\tctx context.Context,\n\tpackageExpression string,\n) (map[string]struct{}, error) {\n\tdata, err := s.runStdout(ctx, `go`, `list`, packageExpression)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.ToStructMap(getNonEmptyLines(string(data))), nil\n}\n\nfunc (s *state) depsForPackage(\n\tctx context.Context,\n\tpkg string,\n) (map[string]struct{}, error) {\n\tdefer func() {\n\t\t// not worrying about locks\n\t\ts.logger.DebugContext(ctx, \"cache\", slog.Int(\"calls\", s.calls), slog.Int(\"hits\", s.cacheHits))\n\t}()\n\n\ts.packageToDepsLock.RLock(pkg)\n\ts.lock.RLock()\n\tdepResult, ok := s.packageToDeps[pkg]\n\ts.lock.RUnlock()\n\ts.packageToDepsLock.RUnlock(pkg)\n\tif ok {\n\t\ts.lock.Lock()\n\t\ts.calls++\n\t\ts.cacheHits++\n\t\ts.lock.Unlock()\n\t\treturn depResult.Deps, depResult.Err\n\t}\n\n\ts.packageToDepsLock.Lock(pkg)\n\tdefer s.packageToDepsLock.Unlock(pkg)\n\n\ts.lock.RLock()\n\tdepResult, ok = s.packageToDeps[pkg]\n\ts.lock.RUnlock()\n\tif ok {\n\t\ts.lock.Lock()\n\t\ts.calls++\n\t\ts.cacheHits++\n\t\ts.lock.Unlock()\n\t\treturn depResult.Deps, depResult.Err\n\t}\n\tdeps, err := s.depsForPackageUncached(ctx, pkg)\n\t// we always hold key lock and then this lock so lock ordering is ok\n\ts.lock.Lock()\n\ts.packageToDeps[pkg] = newDepsResult(deps, err)\n\ts.calls++\n\ts.lock.Unlock()\n\treturn deps, err\n}\n\nfunc (s *state) depsForPackageUncached(\n\tctx context.Context,\n\tpkg string,\n) (map[string]struct{}, error) {\n\tdata, err := s.runStdout(ctx, `go`, `list`, `-f`, `{{join .Deps \"\\n\"}}`, pkg)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.ToStructMap(getNonEmptyLines(string(data))), nil\n}\n\nfunc (s *state) runStdout(ctx context.Context, name string, args ...string) ([]byte, error) {\n\tbuffer := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tname,\n\t\txexec.WithArgs(args...),\n\t\txexec.WithEnv(app.Environ(s.envStdioContainer)),\n\t\txexec.WithStdin(s.envStdioContainer.Stdin()),\n\t\txexec.WithStdout(buffer),\n\t\txexec.WithStderr(s.envStdioContainer.Stderr()),\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buffer.Bytes(), nil\n}\n\ntype packagesResult struct {\n\tPackages map[string]struct{}\n\tErr      error\n}\n\nfunc newPackagesResult(\n\tpackages map[string]struct{},\n\terr error,\n) *packagesResult {\n\treturn &packagesResult{\n\t\tPackages: packages,\n\t\tErr:      err,\n\t}\n}\n\ntype depsResult struct {\n\tDeps map[string]struct{}\n\tErr  error\n}\n\nfunc newDepsResult(\n\tdeps map[string]struct{},\n\terr error,\n) *depsResult {\n\treturn &depsResult{\n\t\tDeps: deps,\n\t\tErr:  err,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/bandeps/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage bandeps\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/bandeps/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bandeps\n\nimport (\n\t\"maps\"\n\t\"sort\"\n\t\"strings\"\n)\n\nfunc sortViolations(violations []Violation) {\n\tsort.Slice(\n\t\tviolations,\n\t\tfunc(i int, j int) bool {\n\t\t\tone := violations[i]\n\t\t\ttwo := violations[j]\n\t\t\tif one.Package() < two.Package() {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif one.Package() > two.Package() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif one.Dep() < two.Dep() {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif one.Dep() > two.Dep() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn one.Note() < two.Note()\n\t\t},\n\t)\n}\n\nfunc getNonEmptyLines(s string) []string {\n\tvar lines []string\n\tfor line := range strings.SplitSeq(s, \"\\n\") {\n\t\tif line := strings.TrimSpace(line); line != \"\" {\n\t\t\tlines = append(lines, line)\n\t\t}\n\t}\n\treturn lines\n}\n\nfunc addMaps(base map[string]struct{}, toAdd ...map[string]struct{}) {\n\tfor _, m := range toAdd {\n\t\tmaps.Copy(base, m)\n\t}\n}\n\nfunc subtractMaps(base map[string]struct{}, toSubtract ...map[string]struct{}) {\n\tfor _, m := range toSubtract {\n\t\tfor k := range m {\n\t\t\tdelete(base, k)\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "private/pkg/bandeps/violation.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 bandeps\n\nimport (\n\t\"crypto/sha256\"\n)\n\ntype violation struct {\n\tpkg  string\n\tdep  string\n\tnote string\n}\n\nfunc newViolation(\n\tpkg string,\n\tdep string,\n\tnote string,\n) *violation {\n\treturn &violation{\n\t\tpkg:  pkg,\n\t\tdep:  dep,\n\t\tnote: note,\n\t}\n}\n\nfunc (v *violation) Package() string {\n\treturn v.pkg\n}\n\nfunc (v *violation) Dep() string {\n\treturn v.dep\n}\n\nfunc (v *violation) Note() string {\n\treturn v.note\n}\n\nfunc (v *violation) String() string {\n\treturn v.pkg + ` cannot depend on ` + v.dep + `: ` + v.note + `.`\n}\n\nfunc (v *violation) key() string {\n\thash := sha256.New()\n\t_, _ = hash.Write([]byte(v.pkg))\n\t_, _ = hash.Write([]byte(v.dep))\n\t_, _ = hash.Write([]byte(v.note))\n\treturn string(hash.Sum(nil))\n}\n"
  },
  {
    "path": "private/pkg/cache/cache.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cache\n\nimport (\n\t\"sync\"\n)\n\n// Cache is a cache from K to V.\n//\n// It uses double-locking to get values.\ntype Cache[K comparable, V any] struct {\n\tstore map[K]*result[V]\n\tlock  sync.RWMutex\n}\n\n// GetOrAdd gets the value for the key, or calls getUncached to get a new value,\n// and then caches the value.\n//\n// If getUncached calls another Cache, the order of GetOrAdd calls between caches\n// must be preserved for lock ordering.\nfunc (c *Cache[K, V]) GetOrAdd(key K, getUncached func() (V, error)) (V, error) {\n\tc.lock.RLock()\n\tvar result *result[V]\n\tvar ok bool\n\tif c.store != nil {\n\t\tresult, ok = c.store[key]\n\t}\n\tc.lock.RUnlock()\n\tif ok {\n\t\treturn result.value, result.err\n\t}\n\tc.lock.Lock()\n\tvalue, err := c.getOrAddInsideWriteLock(key, getUncached)\n\tc.lock.Unlock()\n\treturn value, err\n}\n\nfunc (c *Cache[K, V]) getOrAddInsideWriteLock(key K, getUncached func() (V, error)) (V, error) {\n\tif c.store == nil {\n\t\tc.store = make(map[K]*result[V])\n\t}\n\tresult, ok := c.store[key]\n\tif ok {\n\t\treturn result.value, result.err\n\t}\n\tvalue, err := getUncached()\n\tc.store[key] = newResult(value, err)\n\treturn value, err\n}\n\ntype result[V any] struct {\n\tvalue V\n\terr   error\n}\n\nfunc newResult[V any](value V, err error) *result[V] {\n\treturn &result[V]{\n\t\tvalue: value,\n\t\terr:   err,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/cache/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage cache\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/cas/blob.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n)\n\n// Blob is content with its associated Digest.\ntype Blob interface {\n\t// Digest returns the Digest of the Blob.\n\t//\n\t// Always non-nil.\n\t//\n\t// NewDigestForContent(bytes.NewReader(blob.Content())) should always match this value.\n\tDigest() Digest\n\t// Content returns the content of the Blob.\n\t//\n\t// May be empty.\n\tContent() []byte\n\n\t// Protect against creation of a Blob outside of this package, as we\n\t// do very careful validation.\n\tisBlob()\n}\n\n// NewBlobForContent returns a new Blob for the content as read from the Reader.\n//\n// The reader is read until io.EOF.\nfunc NewBlobForContent(reader io.Reader, options ...BlobOption) (Blob, error) {\n\tblobOptions := newBlobOptions()\n\tfor _, option := range options {\n\t\toption(blobOptions)\n\t}\n\tbuffer := bytes.NewBuffer(nil)\n\tteeReader := io.TeeReader(reader, buffer)\n\tdigest, err := NewDigestForContent(teeReader, DigestWithDigestType(blobOptions.digestType))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tblob := newBlob(digest, buffer.Bytes())\n\tif blobOptions.knownDigest != nil && !DigestEqual(blob.Digest(), blobOptions.knownDigest) {\n\t\treturn nil, fmt.Errorf(\"Digest %v did not match known Digest %v when creating a new Blob\", blob.Digest(), blobOptions.knownDigest)\n\t}\n\treturn blob, nil\n}\n\n// BlobOption is an option when constructing a new Blob\ntype BlobOption func(*blobOptions)\n\n// BlobWithKnownDigest returns a new BlobOption that results in validation that the\n// Digest for the new Blob matches an existing known Digest.\nfunc BlobWithKnownDigest(knownDigest Digest) BlobOption {\n\treturn func(blobOptions *blobOptions) {\n\t\tblobOptions.knownDigest = knownDigest\n\t}\n}\n\n// BlobWithDigestType returns a new BlobOption sets the DigestType to be used.\n//\n// The default is DigestTypeShake256.\nfunc BlobWithDigestType(digestType DigestType) BlobOption {\n\treturn func(blobOptions *blobOptions) {\n\t\tblobOptions.digestType = digestType\n\t}\n}\n\n// *** PRIVATE ***\n\ntype blob struct {\n\tdigest  Digest\n\tcontent []byte\n}\n\nfunc newBlob(digest Digest, content []byte) *blob {\n\treturn &blob{\n\t\tdigest:  digest,\n\t\tcontent: content,\n\t}\n}\n\nfunc (b *blob) Digest() Digest {\n\treturn b.digest\n}\n\nfunc (b *blob) Content() []byte {\n\treturn b.content\n}\n\nfunc (*blob) isBlob() {}\n\ntype blobOptions struct {\n\tknownDigest Digest\n\tdigestType  DigestType\n}\n\nfunc newBlobOptions() *blobOptions {\n\treturn &blobOptions{}\n}\n"
  },
  {
    "path": "private/pkg/cas/blob_set.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"sort\"\n)\n\n// BlobSet is a set of deduplicated Blobs.\ntype BlobSet interface {\n\t// GetBlob gets the Blob for the given Digest, or nil if no such Blob exists.\n\tGetBlob(digest Digest) Blob\n\t// Blobs returns the Blobs associated with this BlobSet, ordered by\n\t// the sort value of the Digest.\n\t//\n\t// TODO: The former version of this package returns the Blobs in unspecified\n\t// order. We generally try to give a deterministic order in our codebase. There\n\t// are schools of arguments both ways, but we'd like to stay consistent.\n\tBlobs() []Blob\n\n\t// Protect against creation of a BlobSet outside of this package, as we\n\t// do very careful validation.\n\tisBlobSet()\n}\n\n// NewBlobSet returns a new BlobSet.\n//\n// Blobs are deduplicated upon construction.\nfunc NewBlobSet(blobs []Blob) (BlobSet, error) {\n\treturn newBlobSet(blobs)\n}\n\n// *** PRIVATE ***\n\ntype blobSet struct {\n\tdigestStringToBlob  map[string]Blob\n\tsortedDigestStrings []string\n}\n\nfunc newBlobSet(blobs []Blob) (*blobSet, error) {\n\tdigestStringToBlob := make(map[string]Blob, len(blobs))\n\tsortedDigestStrings := make([]string, 0, len(blobs))\n\tfor _, blob := range blobs {\n\t\t// In the former version of this package, we validated that Blob contents matched for Blobs\n\t\t// with the same Digest via BlobEqual, however we no longer do this as BlobEqual no longer\n\t\t// validates content matching. See the comment on BlobEqual for why.\n\t\tdigestString := blob.Digest().String()\n\t\tif _, ok := digestStringToBlob[digestString]; !ok {\n\t\t\tdigestStringToBlob[digestString] = blob\n\t\t\tsortedDigestStrings = append(sortedDigestStrings, digestString)\n\t\t}\n\t}\n\tsort.Strings(sortedDigestStrings)\n\treturn &blobSet{\n\t\tdigestStringToBlob:  digestStringToBlob,\n\t\tsortedDigestStrings: sortedDigestStrings,\n\t}, nil\n}\n\nfunc (b *blobSet) GetBlob(digest Digest) Blob {\n\treturn b.digestStringToBlob[digest.String()]\n}\n\nfunc (b *blobSet) Blobs() []Blob {\n\tblobs := make([]Blob, 0, len(b.digestStringToBlob))\n\tfor _, digestString := range b.sortedDigestStrings {\n\t\tblobs = append(blobs, b.digestStringToBlob[digestString])\n\t}\n\treturn blobs\n}\n\nfunc (*blobSet) isBlobSet() {}\n"
  },
  {
    "path": "private/pkg/cas/blob_set_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNewBlobSet(t *testing.T) {\n\tt.Parallel()\n\tfor _, digestType := range AllDigestTypes {\n\t\tt.Run(digestType.String(), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tblobs := testNewBlobs(t, 10, digestType)\n\t\t\tblobSet, err := NewBlobSet(blobs)\n\t\t\trequire.NoError(t, err)\n\t\t\ttestAssertBlobsEqual(t, blobs, blobSet.Blobs())\n\t\t\tassert.Equal(t, blobs[0], blobSet.GetBlob(blobs[0].Digest()))\n\t\t})\n\t}\n}\n\nfunc TestNewBlobSetDuplicatesValid(t *testing.T) {\n\tt.Parallel()\n\tfor _, digestType := range AllDigestTypes {\n\t\tt.Run(digestType.String(), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tblobs := testNewBlobs(t, 10, digestType)\n\t\t\t_, err := NewBlobSet(append(blobs, blobs[0]))\n\t\t\trequire.NoError(t, err)\n\t\t})\n\t}\n}\n\nfunc testNewBlobs(t *testing.T, size int, digestType DigestType) []Blob {\n\tvar blobs []Blob\n\tfor i := range size {\n\t\tcontent := fmt.Sprintf(\"some file content %d\", i)\n\t\tblob, err := NewBlobForContent(strings.NewReader(content), BlobWithDigestType(digestType))\n\t\trequire.NoError(t, err)\n\t\tblobs = append(blobs, blob)\n\t}\n\treturn blobs\n}\n\n// testAssertBlobsEqual makes sure all the blobs digests in the array are the\n// same (assuming they're correctly built), ignoring order in the blobs arrays.\nfunc testAssertBlobsEqual(t *testing.T, expectedBlobs []Blob, actualBlobs []Blob) {\n\texpectedDigests := make(map[string]struct{}, len(expectedBlobs))\n\tfor _, expectedBlob := range expectedBlobs {\n\t\texpectedDigests[expectedBlob.Digest().String()] = struct{}{}\n\t}\n\tactualDigests := make(map[string]struct{}, len(actualBlobs))\n\tfor _, actualBlob := range actualBlobs {\n\t\tactualDigests[actualBlob.Digest().String()] = struct{}{}\n\t}\n\tassert.Equal(t, expectedDigests, actualDigests)\n}\n"
  },
  {
    "path": "private/pkg/cas/blob_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNewBlobForContent(t *testing.T) {\n\tt.Parallel()\n\tcontent := \"some file content\"\n\tdigest, err := NewDigestForContent(strings.NewReader(content))\n\trequire.NoError(t, err)\n\tblob, err := NewBlobForContent(\n\t\tstrings.NewReader(content),\n\t\tBlobWithKnownDigest(digest),\n\t)\n\trequire.NoError(t, err)\n\tassert.True(t, DigestEqual(blob.Digest(), digest))\n\tassert.Equal(t, []byte(content), blob.Content())\n\n\tdifferentContent := \"some different file content\"\n\tdifferentDigest, err := NewDigestForContent(strings.NewReader(differentContent))\n\trequire.NoError(t, err)\n\t_, err = NewBlobForContent(\n\t\tstrings.NewReader(content),\n\t\tBlobWithKnownDigest(differentDigest),\n\t)\n\trequire.Error(t, err)\n}\n"
  },
  {
    "path": "private/pkg/cas/cas.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n"
  },
  {
    "path": "private/pkg/cas/digest.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha256\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/shake256\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\nconst (\n\t// DigestTypeShake256 represents the shake256 digest type.\n\t//\n\t// This is both the default and the only currently-known value for DigestType.\n\tDigestTypeShake256 DigestType = iota + 1\n\t// DigestTypeSha256 represents the sha256 digest type.\n\tDigestTypeSha256\n\n\tsha256DigestLength = 32\n)\n\nvar (\n\t// AllDigestTypes are all DigestTypes.\n\tAllDigestTypes = []DigestType{DigestTypeShake256, DigestTypeSha256}\n\n\tdigestTypeToString = map[DigestType]string{\n\t\tDigestTypeShake256: \"shake256\",\n\t\tDigestTypeSha256:   \"sha256\",\n\t}\n\tstringToDigestType = map[string]DigestType{\n\t\t\"shake256\": DigestTypeShake256,\n\t\t\"sha256\":   DigestTypeSha256,\n\t}\n)\n\n// DigestType is a type of digest.\ntype DigestType int\n\n// String prints the string representation of the DigestType.\nfunc (d DigestType) String() string {\n\ts, ok := digestTypeToString[d]\n\tif !ok {\n\t\treturn strconv.Itoa(int(d))\n\t}\n\treturn s\n}\n\n// ParseDigestType parses a DigestType from its string representation.\n//\n// This reverses DigestType.String().\n//\n// Returns an error of type *ParseError if the string could not be parsed.\nfunc ParseDigestType(s string) (DigestType, error) {\n\td, ok := stringToDigestType[s]\n\tif !ok {\n\t\treturn 0, newParseError(\n\t\t\t\"digest type\",\n\t\t\ts,\n\t\t\tfmt.Errorf(\"unknown type: %q\", s),\n\t\t)\n\t}\n\treturn d, nil\n}\n\n// Digest is a digest of some content.\n//\n// It consists of a DigestType and a digest value.\ntype Digest interface {\n\t// String() prints typeString:hexValue.\n\tfmt.Stringer\n\n\t// Type returns the type of digest.\n\t// Always a valid value.\n\tType() DigestType\n\t// Value returns the digest value.\n\t//\n\t// Always non-empty.\n\tValue() []byte\n\n\t// Protect against creation of a Digest outside of this package, as we\n\t// do very careful validation.\n\tisDigest()\n}\n\n// NewDigest returns a new Digest for the value.\nfunc NewDigest(value []byte, options ...DigestOption) (Digest, error) {\n\tdigestOptions := newDigestOptions()\n\tfor _, option := range options {\n\t\toption(digestOptions)\n\t}\n\tif digestOptions.digestType == 0 {\n\t\tdigestOptions.digestType = DigestTypeShake256\n\t}\n\tswitch digestOptions.digestType {\n\tcase DigestTypeShake256:\n\t\tshake256Digest, err := shake256.NewDigest(value)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newDigest(DigestTypeShake256, shake256Digest.Value()), nil\n\tcase DigestTypeSha256:\n\t\tsha256Digest := sha256.Sum256(value)\n\t\treturn newDigest(DigestTypeSha256, sha256Digest[:]), nil\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestOptions.digestType)\n\t}\n}\n\n// NewDigestForContent creates a new Digest based on the given content read from the Reader.\n//\n// A valid Digest is returned, even in the case of empty content.\n//\n// The Reader is read until io.EOF.\nfunc NewDigestForContent(reader io.Reader, options ...DigestOption) (Digest, error) {\n\tdigestOptions := newDigestOptions()\n\tfor _, option := range options {\n\t\toption(digestOptions)\n\t}\n\tif digestOptions.digestType == 0 {\n\t\tdigestOptions.digestType = DigestTypeShake256\n\t}\n\tswitch digestOptions.digestType {\n\tcase DigestTypeShake256:\n\t\tshake256Digest, err := shake256.NewDigestForContent(reader)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newDigest(DigestTypeShake256, shake256Digest.Value()), nil\n\tcase DigestTypeSha256:\n\t\thash := sha256.New()\n\t\tif _, err := io.Copy(hash, reader); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn newDigest(DigestTypeSha256, hash.Sum(nil)[:]), nil\n\tdefault:\n\t\t// This is a system error.\n\t\treturn nil, syserror.Newf(\"unknown DigestType: %v\", digestOptions.digestType)\n\t}\n}\n\n// DigestOption is an option for a new Digest.\ntype DigestOption func(*digestOptions)\n\n// DigestWithDigestType returns a new DigestOption that specifies the DigestType to be used.\n//\n// The default is DigestTypeShake256.\nfunc DigestWithDigestType(digestType DigestType) DigestOption {\n\treturn func(digestOptions *digestOptions) {\n\t\tdigestOptions.digestType = digestType\n\t}\n}\n\n// ParseDigest parses a Digest from its string representation.\n//\n// A Digest string is of the form typeString:hexValue.\n// The string is expected to be non-empty, If not, an error is returned.\n//\n// This reverses Digest.String().\n//\n// Returns an error of type *bufparse.ParseError if the string could not be parsed.\nfunc ParseDigest(s string) (Digest, error) {\n\tif s == \"\" {\n\t\t// This should be considered a system error.\n\t\treturn nil, errors.New(\"empty string passed to ParseDigest\")\n\t}\n\tdigestTypeString, hexValue, ok := strings.Cut(s, \":\")\n\tif !ok {\n\t\treturn nil, newParseError(\n\t\t\t\"digest\",\n\t\t\ts,\n\t\t\terrors.New(`must in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tdigestType, err := ParseDigestType(digestTypeString)\n\tif err != nil {\n\t\treturn nil, newParseError(\n\t\t\t\"digest\",\n\t\t\ts,\n\t\t\terr,\n\t\t)\n\t}\n\tvalue, err := hex.DecodeString(hexValue)\n\tif err != nil {\n\t\treturn nil, newParseError(\n\t\t\t\"digest\",\n\t\t\ts,\n\t\t\terrors.New(`could not parse hex: must in the form \"digest_type:digest_hex_value\"`),\n\t\t)\n\t}\n\tif err := validateDigestParameters(digestType, value); err != nil {\n\t\treturn nil, newParseError(\n\t\t\t\"digest\",\n\t\t\ts,\n\t\t\terr,\n\t\t)\n\t}\n\treturn newDigest(digestType, value), nil\n}\n\n// DigestEqual returns true if the given Digests are considered equal.\n//\n// If both Digests are nil, this returns true.\n//\n// This check both the DigestType and Digest value.\nfunc DigestEqual(a Digest, b Digest) bool {\n\tif (a == nil) != (b == nil) {\n\t\treturn false\n\t}\n\tif a == nil {\n\t\treturn true\n\t}\n\tif a.Type() != b.Type() {\n\t\treturn false\n\t}\n\treturn bytes.Equal(a.Value(), b.Value())\n}\n\n/// *** PRIVATE ***\n\ntype digest struct {\n\tdigestType DigestType\n\tvalue      []byte\n\t// Cache as we call String pretty often.\n\t// We could do this lazily but not worth it.\n\tstringValue string\n}\n\n// validation should occur outside of this function.\nfunc newDigest(digestType DigestType, value []byte) *digest {\n\treturn &digest{\n\t\tdigestType:  digestType,\n\t\tvalue:       value,\n\t\tstringValue: digestType.String() + \":\" + hex.EncodeToString(value),\n\t}\n}\n\nfunc (d *digest) Type() DigestType {\n\treturn d.digestType\n}\n\nfunc (d *digest) Value() []byte {\n\treturn d.value\n}\n\nfunc (d *digest) String() string {\n\treturn d.stringValue\n}\n\nfunc (*digest) isDigest() {}\n\ntype digestOptions struct {\n\tdigestType DigestType\n}\n\nfunc newDigestOptions() *digestOptions {\n\treturn &digestOptions{}\n}\n\nfunc validateDigestParameters(digestType DigestType, value []byte) error {\n\tswitch digestType {\n\tcase DigestTypeShake256:\n\t\t_, err := shake256.NewDigest(value)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\tcase DigestTypeSha256:\n\t\tif len(value) != sha256DigestLength {\n\t\t\treturn fmt.Errorf(\"invalid shake256 digest value: expected %d bytes, got %d\", sha256DigestLength, len(value))\n\t\t}\n\tdefault:\n\t\t// This is really always a system error, but little harm in including it here, even\n\t\t// though it'll get converted into a bufparse.ParseError in parse.\n\t\treturn syserror.Newf(`unknown digest type: %q`, digestType.String())\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/cas/digest_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Making sure that ParseErrors work outside of the cas package.\npackage cas_test\n\nimport (\n\t\"bytes\"\n\t\"encoding/hex\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n\t\"testing/iotest\"\n\n\t\"github.com/bufbuild/buf/private/pkg/cas\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNewDigestForContent(t *testing.T) {\n\tt.Parallel()\n\tdigest, err := cas.NewDigestForContent(bytes.NewBuffer(nil))\n\trequire.NoError(t, err)\n\tassert.Equal(t, cas.DigestTypeShake256, digest.Type())\n\tassert.NotEmpty(t, digest.Value())\n\n\tdigest, err = cas.NewDigestForContent(strings.NewReader(\"some content\"))\n\trequire.NoError(t, err)\n\tassert.Equal(t, cas.DigestTypeShake256, digest.Type())\n\tassert.NotEmpty(t, digest.Value())\n\n\tdigest, err = cas.NewDigestForContent(bytes.NewBuffer(nil), cas.DigestWithDigestType(cas.DigestTypeSha256))\n\trequire.NoError(t, err)\n\tassert.Equal(t, cas.DigestTypeSha256, digest.Type())\n\tassert.NotEmpty(t, digest.Value())\n\n\tdigest, err = cas.NewDigestForContent(strings.NewReader(\"some content\"), cas.DigestWithDigestType(cas.DigestTypeSha256))\n\trequire.NoError(t, err)\n\tassert.Equal(t, cas.DigestTypeSha256, digest.Type())\n\tassert.NotEmpty(t, digest.Value())\n\n\t// failing digesting content\n\texpectedErr := errors.New(\"testing error\")\n\tdigest, err = cas.NewDigestForContent(iotest.ErrReader(expectedErr))\n\tassert.ErrorIs(t, err, expectedErr)\n\tassert.Nil(t, digest)\n}\n\nfunc TestParseDigestError(t *testing.T) {\n\tt.Parallel()\n\ttestParseDigestError(t, \"\", false)\n\ttestParseDigestError(t, \"foo\", true)\n\ttestParseDigestError(t, \"shake256 foo\", true)\n\ttestParseDigestError(t, \"shake256:_\", true)\n\ttestParseDigestError(t, \"sha256 foo\", true)\n\ttestParseDigestError(t, \"sha256:_\", true)\n\tvalidDigest, err := cas.NewDigestForContent(bytes.NewBuffer(nil))\n\trequire.NoError(t, err)\n\tvalidDigestHex := hex.EncodeToString(validDigest.Value())\n\ttestParseDigestError(t, fmt.Sprintf(\"%s:%s\", validDigest.Type(), validDigestHex[:10]), true)\n\ttestParseDigestError(t, fmt.Sprintf(\"md5:%s\", validDigestHex), true)\n}\n\nfunc TestDigestEqual(t *testing.T) {\n\tt.Parallel()\n\tfileContent := \"one line\\nanother line\\nyet another one\\n\"\n\td1, err := cas.NewDigestForContent(strings.NewReader(fileContent))\n\trequire.NoError(t, err)\n\td2, err := cas.NewDigestForContent(strings.NewReader(fileContent))\n\trequire.NoError(t, err)\n\td3, err := cas.NewDigestForContent(strings.NewReader(fileContent + \"foo\"))\n\trequire.NoError(t, err)\n\td4, err := cas.NewDigestForContent(strings.NewReader(fileContent), cas.DigestWithDigestType(cas.DigestTypeSha256))\n\trequire.NoError(t, err)\n\td5, err := cas.NewDigestForContent(strings.NewReader(fileContent), cas.DigestWithDigestType(cas.DigestTypeSha256))\n\trequire.NoError(t, err)\n\tassert.True(t, cas.DigestEqual(d1, d2))\n\tassert.True(t, cas.DigestEqual(d4, d5))\n\tassert.False(t, cas.DigestEqual(d1, d3))\n\tassert.False(t, cas.DigestEqual(d1, d4))\n\tassert.False(t, cas.DigestEqual(d2, d3))\n\tassert.False(t, cas.DigestEqual(d2, d4))\n}\n\nfunc testParseDigestError(t *testing.T, digestString string, expectParseError bool) {\n\t_, err := cas.ParseDigest(digestString)\n\tassert.Error(t, err)\n\tparseError := &cas.ParseError{}\n\tisParseError := errors.As(err, &parseError)\n\tif expectParseError {\n\t\tassert.True(t, isParseError)\n\t\tassert.Equal(t, digestString, parseError.Input())\n\t} else {\n\t\tassert.False(t, isParseError)\n\t}\n}\n"
  },
  {
    "path": "private/pkg/cas/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport \"strings\"\n\n// ParseError is an error that occurred during parsing.\n//\n// This is returned by all Parse.* functions in this package.\ntype ParseError struct {\n\t// typeString is the user-consumable string representing of the type that was attempted to be parsed.\n\t//\n\t// Users cannot rely on this data being structured.\n\t// Examples: \"digest\", \"digest type\".\n\ttypeString string\n\t// input is the input string that was attempted to be parsed.\n\tinput string\n\t// err is the underlying error.\n\t//\n\t// Err may be a *ParseError itself.\n\t//\n\t// This is an error we may give back to the user, use pretty strings that should\n\t// be read.\n\terr error\n}\n\n// newParseError returns a new ParseError.\n//\n// typeString is the user-consumable string representing of the type that was attempted to be parsed.\n// input is the input string that was attempted to be parsed.\n// err is the underlying error.\nfunc newParseError(typeString string, input string, err error) *ParseError {\n\treturn &ParseError{\n\t\ttypeString: typeString,\n\t\tinput:      input,\n\t\terr:        err,\n\t}\n}\n\n// Error implements the error interface.\nfunc (p *ParseError) Error() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\tvar builder strings.Builder\n\t_, _ = builder.WriteString(`could not parse`)\n\tif p.typeString != \"\" {\n\t\t_, _ = builder.WriteString(` `)\n\t\t_, _ = builder.WriteString(p.typeString)\n\t}\n\tif p.input != \"\" {\n\t\t_, _ = builder.WriteString(` \"`)\n\t\t_, _ = builder.WriteString(p.input)\n\t\t_, _ = builder.WriteString(`\"`)\n\t}\n\tif p.err != nil {\n\t\t_, _ = builder.WriteString(`: `)\n\t\t_, _ = builder.WriteString(p.err.Error())\n\t}\n\treturn builder.String()\n}\n\n// Unwrap returns the underlying error.\nfunc (p *ParseError) Unwrap() error {\n\tif p == nil {\n\t\treturn nil\n\t}\n\treturn p.err\n}\n\n// Input returns the input string that was attempted to be parsed.\nfunc (p *ParseError) Input() string {\n\tif p == nil {\n\t\treturn \"\"\n\t}\n\treturn p.input\n}\n"
  },
  {
    "path": "private/pkg/cas/file_node.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// FileNode is a path and associated digest.\ntype FileNode interface {\n\t// String encodes the FileNode into its canonical form:\n\t//\n\t//   digestString[SP][SP]path\n\tfmt.Stringer\n\n\t// Path returns the Path of the file.\n\t//\n\t// The path is normalized and non-empty.\n\tPath() string\n\t// Digest returns the Digest of the file.\n\t//\n\t// The Digest is always non-nil.\n\tDigest() Digest\n\n\t// Protect against creation of a FileNode outside of this package, as we\n\t// do very careful validation.\n\tisFileNode()\n}\n\n// NewFileNode returns a new FileNode.\n//\n// The path is validated to be normalized and non-empty.\n// The digest is validated to be non-nil.\nfunc NewFileNode(path string, digest Digest) (FileNode, error) {\n\tif err := validateFileNodeParameters(path, digest); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newFileNode(path, digest), nil\n}\n\n// ParseFileNode parses the FileNode from its string representation.\n//\n// The string representation is \"digestString[SP][SP]path\".\n//\n// This reverses FileNode.String().\nfunc ParseFileNode(s string) (FileNode, error) {\n\tsplit := strings.Split(s, \"  \")\n\tif len(split) != 2 {\n\t\treturn nil, newParseError(\n\t\t\t\"file node\",\n\t\t\ts,\n\t\t\terrors.New(`must in the form \"digest[SP][SP]path\"`),\n\t\t)\n\t}\n\tdigest, err := ParseDigest(split[0])\n\tif err != nil {\n\t\treturn nil, newParseError(\n\t\t\t\"file node\",\n\t\t\ts,\n\t\t\terr,\n\t\t)\n\t}\n\tpath := split[1]\n\tif err := validateFileNodeParameters(path, digest); err != nil {\n\t\treturn nil, newParseError(\n\t\t\t\"file node\",\n\t\t\ts,\n\t\t\terr,\n\t\t)\n\t}\n\treturn newFileNode(path, digest), nil\n}\n\n// *** PRIVATE ***\n\ntype fileNode struct {\n\tpath   string\n\tdigest Digest\n}\n\n// validation should occur outside of this function.\nfunc newFileNode(path string, digest Digest) *fileNode {\n\treturn &fileNode{\n\t\tpath:   path,\n\t\tdigest: digest,\n\t}\n}\n\nfunc (f *fileNode) Path() string {\n\treturn f.path\n}\n\nfunc (f *fileNode) Digest() Digest {\n\treturn f.digest\n}\n\nfunc (f *fileNode) String() string {\n\treturn f.digest.String() + \"  \" + f.path\n}\n\nfunc (*fileNode) isFileNode() {}\n\nfunc validateFileNodeParameters(path string, digest Digest) error {\n\tif path == \"\" {\n\t\treturn errors.New(\"path was empty\")\n\t}\n\tnormalizedPath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"path %q was not valid: %w\", path, err)\n\t}\n\tif path != normalizedPath {\n\t\treturn fmt.Errorf(\"path %q was not equal to normalized path %q\", path, normalizedPath)\n\t}\n\tif digest == nil {\n\t\treturn errors.New(\"no digest specified\")\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/cas/file_set.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sort\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// FileSet is a pair of a Manifest and its associated BlobSet.\n//\n// This can be read and written from and to a storage.Bucket.\n//\n// The Manifest is guaranteed to exactly correlate with the Blobs in the BlobSet,\n// that is the Digests of the FileNodes in the Manifest will exactly match the\n// Digests in the Blobs.\ntype FileSet interface {\n\t// Manifest returns the associated Manifest.\n\tManifest() Manifest\n\t// BlobSet returns the associated BlobSet.\n\tBlobSet() BlobSet\n\n\t// Protect against creation of a FileSet outside of this package, as we\n\t// do very careful validation.\n\tisFileSet()\n}\n\n// NewFileSet returns a new FileSet.\n//\n// Validation is done to ensure the Manifest exactly matches the BlobSet.\nfunc NewFileSet(manifest Manifest, blobSet BlobSet) (FileSet, error) {\n\tmanifestDigestStringMap := make(map[string]struct{})\n\tblobDigestStringMap := make(map[string]struct{})\n\tfor _, fileNode := range manifest.FileNodes() {\n\t\tmanifestDigestStringMap[fileNode.Digest().String()] = struct{}{}\n\t}\n\tfor _, blob := range blobSet.Blobs() {\n\t\tblobDigestStringMap[blob.Digest().String()] = struct{}{}\n\t}\n\tvar onlyInManifest []string\n\tvar onlyInBlobSet []string\n\tfor manifestDigestString := range manifestDigestStringMap {\n\t\tif _, ok := blobDigestStringMap[manifestDigestString]; !ok {\n\t\t\tonlyInManifest = append(onlyInManifest, manifestDigestString)\n\t\t}\n\t}\n\tfor blobDigestString := range blobDigestStringMap {\n\t\tif _, ok := manifestDigestStringMap[blobDigestString]; !ok {\n\t\t\tonlyInBlobSet = append(onlyInBlobSet, blobDigestString)\n\t\t}\n\t}\n\tif len(onlyInManifest) > 0 || len(onlyInBlobSet) > 0 {\n\t\tsort.Strings(onlyInManifest)\n\t\tsort.Strings(onlyInBlobSet)\n\t\treturn nil, fmt.Errorf(\"mismatched Manifest and BlobSet at FileSet construction, digests only in Manifest: [%v], digests only in BlobSet: [%v]\", onlyInManifest, onlyInBlobSet)\n\t}\n\treturn newFileSet(manifest, blobSet), nil\n}\n\n// NewFileSetForBucket returns a new FileSet for the given ReadBucket.\nfunc NewFileSetForBucket(ctx context.Context, bucket storage.ReadBucket) (FileSet, error) {\n\tvar fileNodes []FileNode\n\tvar blobs []Blob\n\tif err := storage.WalkReadObjects(\n\t\tctx,\n\t\tbucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tblob, err := NewBlobForContent(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating Blob for file %q: %w\", readObject.Path(), err)\n\t\t\t}\n\t\t\tfileNode, err := NewFileNode(readObject.Path(), blob.Digest())\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error creating FileNode for file %q: %w\", readObject.Path(), err)\n\t\t\t}\n\t\t\tfileNodes = append(fileNodes, fileNode)\n\t\t\tblobs = append(blobs, blob)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tmanifest, err := NewManifest(fileNodes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tblobSet, err := NewBlobSet(blobs)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newFileSet(\n\t\tmanifest,\n\t\tblobSet,\n\t), nil\n}\n\n// PutFileSetToBucket writes the FileSet to the given WriteBucket.\nfunc PutFileSetToBucket(\n\tctx context.Context,\n\tfileSet FileSet,\n\tbucket storage.WriteBucket,\n) error {\n\tfor _, fileNode := range fileSet.Manifest().FileNodes() {\n\t\twriteObjectCloser, err := bucket.Put(ctx, fileNode.Path(), storage.PutWithAtomic())\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tblob := fileSet.BlobSet().GetBlob(fileNode.Digest())\n\t\tif _, err := writeObjectCloser.Write(blob.Content()); err != nil {\n\t\t\treturn errors.Join(err, writeObjectCloser.Close())\n\t\t}\n\t\tif err := writeObjectCloser.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// *** PRIVATE ****\n\ntype fileSet struct {\n\tmanifest Manifest\n\tblobSet  BlobSet\n}\n\nfunc newFileSet(manifest Manifest, blobSet BlobSet) *fileSet {\n\treturn &fileSet{\n\t\tmanifest: manifest,\n\t\tblobSet:  blobSet,\n\t}\n}\n\nfunc (f *fileSet) Manifest() Manifest {\n\treturn f.manifest\n}\n\nfunc (f *fileSet) BlobSet() BlobSet {\n\treturn f.blobSet\n}\n\nfunc (*fileSet) isFileSet() {}\n"
  },
  {
    "path": "private/pkg/cas/manifest.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n)\n\n// Manifest is a set of FileNodes.\ntype Manifest interface {\n\t// fmt.Stringer encodes the Manifest into its canonical form, consisting of\n\t// an sorted list of paths and their digests, sorted by path.\n\t//\n\t// See the documentation on FileNode for how FileNodes are encoded.\n\t//\n\t// An example encoded manifest:\n\t//\n\t//\tshake256:cd22db48cf7c274bbffcb5494a854000cd21b074df7c6edabbd0102c4be8d7623e3931560fcda7acfab286ae1d4f506911daa31f223ee159f59ffce0c7acbbaa  buf.lock\n\t//\tshake256:3b353aa5aacd11015e8577f16e2c4e7a242ce773d8e3a16806795bb94f76e601b0db9bf42d5e1907fda63303e1fa1c65f1c175ecc025a3ef29c3456ad237ad84  buf.md\n\t//\tshake256:7c88a20cf931702d042a4ddee3fde5de84814544411f1c62dbf435b1b81a12a8866a070baabcf8b5a0d31675af361ccb2d93ddada4cdcc11bab7ea3d8d7c4667  buf.yaml\n\t//\tshake256:9db25155eafd19b36882cff129daac575baa67ee44d1cb1fd3894342b28c72b83eb21aa595b806e9cb5344759bc8308200c5af98e4329aa83014dde99afa903a  pet/v1/pet.proto\n\tfmt.Stringer\n\n\t// FileNodes returns the set of FileNodes that make up the Manifest.\n\t//\n\t// The paths of the given FileNodes are guaranteed to be unique.\n\t// The iteration order will be the sorted order of the paths.\n\tFileNodes() []FileNode\n\t// GetFileNode gets the FileNode for the given path.\n\t//\n\t// Returns nil if the path does not exist.\n\tGetFileNode(path string) FileNode\n\t// GetDigest gets the Digest for the given path.\n\t//\n\t// Returns nil if the path does not exist.\n\tGetDigest(path string) Digest\n\n\t// Protect against creation of a Manifest outside of this package, as we\n\t// do very careful validation.\n\tisManifest()\n}\n\n// NewManifest returns a new Manifest for the given path -> Digest map.\n//\n// FileNodes are deduplicated upon construction, however if two FileNodes\n// with the same path have different Digests, an error is returned.\nfunc NewManifest(fileNodes []FileNode) (Manifest, error) {\n\tpathToFileNode, err := getAndValidateManifestPathToFileNode(fileNodes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newManifest(pathToFileNode), nil\n}\n\n// ParseManifest parses a Manifest from its string representation.\n//\n// This reverses Manifest.String().\n//\n// Returns an error of type *ParseError if the string could not be parsed.\nfunc ParseManifest(s string) (Manifest, error) {\n\tvar fileNodes []FileNode\n\toriginal := s\n\tif len(s) > 0 {\n\t\tif s[len(s)-1] != '\\n' {\n\t\t\treturn nil, newParseError(\n\t\t\t\t\"manifest\",\n\t\t\t\toriginal,\n\t\t\t\terrors.New(\"did not end with newline\"),\n\t\t\t)\n\t\t}\n\t\ts = s[:len(s)-1]\n\t\tfor i, line := range strings.Split(s, \"\\n\") {\n\t\t\tfileNode, err := ParseFileNode(line)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, newParseError(\n\t\t\t\t\t\"manifest\",\n\t\t\t\t\toriginal,\n\t\t\t\t\tfmt.Errorf(\"line %d: %w\", i, err),\n\t\t\t\t)\n\t\t\t}\n\t\t\tfileNodes = append(fileNodes, fileNode)\n\t\t}\n\t}\n\t// Even if len(s) == 0, we still go through this flow.\n\t// Just making sure that in the future, we still count an empty manifest as valid.\n\t// Validation occurs within getAndValidateManifestPathToFileNode, so we pass nil to that.\n\tpathToFileNode, err := getAndValidateManifestPathToFileNode(fileNodes)\n\tif err != nil {\n\t\treturn nil, newParseError(\n\t\t\t\"manifest\",\n\t\t\toriginal,\n\t\t\terr,\n\t\t)\n\t}\n\treturn newManifest(pathToFileNode), nil\n}\n\n// ManifestToBlob converts the string representation of the given Manifest into a Blob.\n//\n// The Manifest is assumed to be non-nil.\nfunc ManifestToBlob(manifest Manifest) (Blob, error) {\n\treturn NewBlobForContent(strings.NewReader(manifest.String()))\n}\n\n// ManifestToDigest converts the string representation of the given Manifest into a Digest.\n//\n// The Manifest is assumed to be non-nil.\nfunc ManifestToDigest(manifest Manifest, digestType DigestType) (Digest, error) {\n\treturn NewDigestForContent(strings.NewReader(manifest.String()), DigestWithDigestType(digestType))\n}\n\n// BlobToManifest converts the given Blob representing the string representation of a Manifest into a Manifest.\n//\n// # The Blob is assumed to be non-nil\n//\n// This function returns an error of type *ParseError since this is\n// effectively parsing the blob.\nfunc BlobToManifest(blob Blob) (Manifest, error) {\n\treturn ParseManifest(string(blob.Content()))\n}\n\n// *** PRIVATE ***\n\ntype manifest struct {\n\tpathToFileNode        map[string]FileNode\n\tsortedUniqueFileNodes []FileNode\n}\n\n// use getAndValidateManifestPathToFileNode to create pathToFileNode.\nfunc newManifest(pathToFileNode map[string]FileNode) *manifest {\n\t// Just cache ahead of time for now.\n\tsortedUniqueFileNodes := make([]FileNode, 0, len(pathToFileNode))\n\tfor _, fileNode := range pathToFileNode {\n\t\tsortedUniqueFileNodes = append(sortedUniqueFileNodes, fileNode)\n\t}\n\tsort.Slice(\n\t\tsortedUniqueFileNodes,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn sortedUniqueFileNodes[i].Path() < sortedUniqueFileNodes[j].Path()\n\t\t},\n\t)\n\treturn &manifest{\n\t\tpathToFileNode:        pathToFileNode,\n\t\tsortedUniqueFileNodes: sortedUniqueFileNodes,\n\t}\n}\n\nfunc (m *manifest) FileNodes() []FileNode {\n\treturn m.sortedUniqueFileNodes\n}\n\nfunc (m *manifest) GetFileNode(path string) FileNode {\n\treturn m.pathToFileNode[path]\n}\n\nfunc (m *manifest) GetDigest(path string) Digest {\n\tfileNode := m.GetFileNode(path)\n\tif fileNode == nil {\n\t\treturn nil\n\t}\n\treturn fileNode.Digest()\n}\n\nfunc (m *manifest) String() string {\n\tbuffer := bytes.NewBuffer(nil)\n\tfor _, fileNode := range m.sortedUniqueFileNodes {\n\t\t_, _ = buffer.WriteString(fileNode.String())\n\t\t_, _ = buffer.WriteRune('\\n')\n\t}\n\treturn buffer.String()\n}\n\nfunc (*manifest) isManifest() {}\n\n// serves as parameter validation as well.\nfunc getAndValidateManifestPathToFileNode(fileNodes []FileNode) (map[string]FileNode, error) {\n\tpathToFileNode := make(map[string]FileNode)\n\tfor _, fileNode := range fileNodes {\n\t\tif existingFileNode, ok := pathToFileNode[fileNode.Path()]; ok {\n\t\t\terrorMessage := fmt.Sprintf(\"path %q was duplicated when creating a manifest\", fileNode.Path())\n\t\t\tif !DigestEqual(existingFileNode.Digest(), fileNode.Digest()) {\n\t\t\t\terrorMessage += fmt.Sprintf(\n\t\t\t\t\t\" and the two path entries had different digests: %q, %q\",\n\t\t\t\t\texistingFileNode.Digest().String(),\n\t\t\t\t\tfileNode.Digest().String(),\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn nil, errors.New(errorMessage)\n\t\t} else {\n\t\t\tpathToFileNode[fileNode.Path()] = fileNode\n\t\t}\n\t}\n\treturn pathToFileNode, nil\n}\n"
  },
  {
    "path": "private/pkg/cas/manifest_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestManifest(t *testing.T) {\n\tt.Parallel()\n\tfor _, digestType := range AllDigestTypes {\n\t\tt.Run(digestType.String(), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tvar digests []Digest\n\t\t\tvar fileNodes []FileNode\n\t\t\tfor i := range 10 {\n\t\t\t\tdigest, err := NewDigestForContent(strings.NewReader(fmt.Sprintf(\"content%d\", i)), DigestWithDigestType(digestType))\n\t\t\t\trequire.NoError(t, err)\n\t\t\t\tdigests = append(digests, digest)\n\t\t\t\tfileNode, err := NewFileNode(fmt.Sprintf(\"%d\", i), digest)\n\t\t\t\trequire.NoError(t, err)\n\t\t\t\tfileNodes = append(fileNodes, fileNode)\n\t\t\t}\n\t\t\tmanifest, err := NewManifest(fileNodes)\n\t\t\trequire.NoError(t, err)\n\n\t\t\tsort.Slice(\n\t\t\t\tfileNodes,\n\t\t\t\tfunc(i int, j int) bool {\n\t\t\t\t\treturn fileNodes[i].Path() < fileNodes[j].Path()\n\t\t\t\t},\n\t\t\t)\n\t\t\tmanifestFileNodes := manifest.FileNodes()\n\t\t\tfor i := range 10 {\n\t\t\t\tdigest := manifest.GetDigest(fmt.Sprintf(\"%d\", i))\n\t\t\t\trequire.NotNil(t, digest)\n\t\t\t\tassert.Equal(t, digests[i], digest)\n\t\t\t\tassert.Equal(t, fileNodes[i], manifestFileNodes[i])\n\t\t\t}\n\n\t\t\tmanifestString := manifest.String()\n\t\t\tparsedManifest, err := ParseManifest(manifestString)\n\t\t\trequire.NoError(t, err)\n\n\t\t\t// Do not use fileNodes, FileNodes() are sorted.\n\t\t\tassert.Equal(t, manifestFileNodes, parsedManifest.FileNodes())\n\t\t})\n\t}\n}\n\nfunc TestEmptyManifest(t *testing.T) {\n\tt.Parallel()\n\tmanifest, err := NewManifest(nil)\n\trequire.NoError(t, err)\n\n\tmanifestString := manifest.String()\n\tassert.Empty(t, manifestString)\n\tparsedManifest, err := ParseManifest(manifestString)\n\trequire.NoError(t, err)\n\n\t// Do not use fileNodes, FileNodes() are sorted.\n\tassert.Equal(t, manifest.FileNodes(), parsedManifest.FileNodes())\n}\n\nfunc TestParseManifestError(t *testing.T) {\n\tt.Parallel()\n\ttestParseManifestError(t, \"\\n\")\n\ttestParseManifestError(t, \"whoops\\n\")\n\ttestParseManifestError(t, \"shake256:1234  foo\\n\")\n\ttestParseManifestError(t, \"md5:d41d8cd98f00b204e9800998ecf8427e  foo\\n\")\n\ttestParseManifestError(t, \"bar  foo\\n\")\n\ttestParseManifestError(t, \"shake256:_  foo\\n\")\n}\n\nfunc testParseManifestError(t *testing.T, manifestString string) {\n\t_, err := ParseManifest(manifestString)\n\tassert.Error(t, err)\n\tparseError := &ParseError{}\n\tisParseError := errors.As(err, &parseError)\n\tassert.True(t, isParseError)\n\tassert.Equal(t, manifestString, parseError.Input())\n}\n"
  },
  {
    "path": "private/pkg/cas/storage.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 cas\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// BucketToDigest converts the files in the bucket to a digest.\n//\n// This uses the specified DigestType for the file and manifest digests.\nfunc BucketToDigest(ctx context.Context, bucket storage.ReadBucket, digestType DigestType) (Digest, error) {\n\tvar fileNodes []FileNode\n\tif err := storage.WalkReadObjects(\n\t\tctx,\n\t\tbucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdigest, err := NewDigestForContent(readObject, DigestWithDigestType(digestType))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfileNode, err := NewFileNode(readObject.Path(), digest)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tfileNodes = append(fileNodes, fileNode)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tmanifest, err := NewManifest(fileNodes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn ManifestToDigest(manifest, digestType)\n}\n"
  },
  {
    "path": "private/pkg/cas/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage cas\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/cert/certclient/certclient.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 certclient\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"buf.build/go/app/appext\"\n)\n\n// ExternalClientTLSConfig allows users to configure TLS on the client side.\ntype ExternalClientTLSConfig struct {\n\tUse               string   `json:\"use,omitempty\" yaml:\"use,omitempty\"`\n\tRootCertFilePaths []string `json:\"root_cert_file_paths,omitempty\" yaml:\"root_cert_file_paths,omitempty\"`\n}\n\n// IsEmpty returns true if the ExternalClientTLSConfig is empty.\nfunc (e ExternalClientTLSConfig) IsEmpty() bool {\n\treturn e.Use == \"\" && len(e.RootCertFilePaths) == 0\n}\n\n// NewClientTLSConfig creates a new *tls.Config from the ExternalTLSConfig\n//\n// The default is to use the system TLS config.\nfunc NewClientTLSConfig(\n\tcontainer appext.NameContainer,\n\texternalClientTLSConfig ExternalClientTLSConfig,\n) (*tls.Config, error) {\n\topts := []TLSOption{}\n\tswitch t := strings.ToLower(strings.TrimSpace(externalClientTLSConfig.Use)); t {\n\tcase \"systemandlocal\":\n\t\topts = append(opts, WithSystemCertPool())\n\t\tfallthrough\n\tcase \"local\":\n\t\trootCertFilePaths := externalClientTLSConfig.RootCertFilePaths\n\t\tif len(rootCertFilePaths) == 0 {\n\t\t\trootCertFilePaths = []string{\n\t\t\t\tfilepath.Join(\n\t\t\t\t\tcontainer.ConfigDirPath(),\n\t\t\t\t\t\"tls\",\n\t\t\t\t\t\"root.pem\",\n\t\t\t\t),\n\t\t\t}\n\t\t}\n\t\topts = append(opts, WithRootCertFilePaths(rootCertFilePaths...))\n\t\treturn NewClientTLS(opts...)\n\tcase \"\", \"system\":\n\t\treturn NewClientTLS(WithSystemCertPool())\n\tcase \"false\":\n\t\treturn nil, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown tls.use: %q\", t)\n\t}\n}\n"
  },
  {
    "path": "private/pkg/cert/certclient/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage certclient\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/cert/certclient/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 certclient\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype tlsOptions struct {\n\tuseSystemCerts    bool\n\trootCertFilePaths []string\n}\n\n// TLSOption is an option for a new TLS Config.\ntype TLSOption func(*tlsOptions)\n\n// WithSystemCertPool returns a new TLSOption to use the system\n// certificates. By default, no system certificates are used.\nfunc WithSystemCertPool() TLSOption {\n\treturn func(opts *tlsOptions) {\n\t\topts.useSystemCerts = true\n\t}\n}\n\n// WithRootCertFilePaths returns a new TLSOption to trust the\n// specified root CAs at the given paths.\nfunc WithRootCertFilePaths(rootCertFilePaths ...string) TLSOption {\n\treturn func(opts *tlsOptions) {\n\t\topts.rootCertFilePaths = append(opts.rootCertFilePaths, rootCertFilePaths...)\n\t}\n}\n\n// NewClientTLS creates a new tls.Config from a root certificate files.\nfunc NewClientTLS(options ...TLSOption) (*tls.Config, error) {\n\topts := &tlsOptions{}\n\tfor _, opt := range options {\n\t\topt(opts)\n\t}\n\trootCertDatas := make([][]byte, len(opts.rootCertFilePaths))\n\tfor i, rootCertFilePath := range opts.rootCertFilePaths {\n\t\trootCertData, err := os.ReadFile(rootCertFilePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\trootCertDatas[i] = rootCertData\n\t}\n\treturn newClientTLSConfigFromRootCertDatas(opts.useSystemCerts, rootCertDatas...)\n}\n\n// newClientTLSConfigFromRootCertDatas creates a new tls.Config from root certificate datas.\nfunc newClientTLSConfigFromRootCertDatas(useSystemCerts bool, rootCertDatas ...[]byte) (*tls.Config, error) {\n\tvar certPool *x509.CertPool\n\tif useSystemCerts {\n\t\tvar err error\n\t\tcertPool, err = x509.SystemCertPool()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to acquire system cert pool: %w\", err)\n\t\t}\n\t} else {\n\t\tcertPool = x509.NewCertPool()\n\t}\n\tfor _, rootCertData := range rootCertDatas {\n\t\tif !certPool.AppendCertsFromPEM(rootCertData) {\n\t\t\treturn nil, errors.New(\"failed to append root certificate\")\n\t\t}\n\t}\n\treturn newClientTLSConfigFromRootCertPool(certPool), nil\n}\n\n// newClientTLSConfigFromRootCertPool creates a new tls.Config from a root certificate pool.\nfunc newClientTLSConfigFromRootCertPool(certPool *x509.CertPool) *tls.Config {\n\treturn &tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tRootCAs:    certPool,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/connectclient/connectclient.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 connectclient\n\nimport (\n\t\"slices\"\n\n\t\"connectrpc.com/connect\"\n)\n\n// TODO FUTURE: eliminate config, just make the below MakeOptions, add httpClient as a parameter to Make\n\n// Config holds configuration for creating Connect RPC clients.\ntype Config struct {\n\thttpClient              connect.HTTPClient\n\taddressMapper           func(string) string\n\tinterceptors            []connect.Interceptor\n\tauthInterceptorProvider func(string) connect.UnaryInterceptorFunc\n}\n\n// NewConfig creates a new client configuration with the given HTTP client\n// and options.\nfunc NewConfig(httpClient connect.HTTPClient, options ...ConfigOption) *Config {\n\tcfg := &Config{\n\t\thttpClient: httpClient,\n\t}\n\tfor _, opt := range options {\n\t\topt(cfg)\n\t}\n\treturn cfg\n}\n\n// ConfigOption is an option for customizing a new Config.\ntype ConfigOption func(*Config)\n\n// WithAddressMapper maps the address with the given function.\nfunc WithAddressMapper(addressMapper func(string) string) ConfigOption {\n\treturn func(cfg *Config) {\n\t\tcfg.addressMapper = addressMapper\n\t}\n}\n\n// WithInterceptors adds the slice of interceptors to all clients returned from this provider.\nfunc WithInterceptors(interceptors []connect.Interceptor) ConfigOption {\n\treturn func(cfg *Config) {\n\t\tcfg.interceptors = interceptors\n\t}\n}\n\n// WithAuthInterceptorProvider configures a provider that, when invoked, returns an interceptor that can be added\n// to a client for setting the auth token\nfunc WithAuthInterceptorProvider(authInterceptorProvider func(string) connect.UnaryInterceptorFunc) ConfigOption {\n\treturn func(cfg *Config) {\n\t\tcfg.authInterceptorProvider = authInterceptorProvider\n\t}\n}\n\n// StubFactory is the type of a generated factory function, for creating Connect client stubs.\ntype StubFactory[T any] func(connect.HTTPClient, string, ...connect.ClientOption) T\n\n// Make uses the given generated factory function to create a new connect client.\nfunc Make[T any](cfg *Config, address string, factory StubFactory[T]) T {\n\tinterceptors := slices.Clone(cfg.interceptors)\n\tif cfg.authInterceptorProvider != nil {\n\t\tinterceptor := cfg.authInterceptorProvider(address)\n\t\tinterceptors = append(interceptors, interceptor)\n\t}\n\tif cfg.addressMapper != nil {\n\t\taddress = cfg.addressMapper(address)\n\t}\n\treturn factory(cfg.httpClient, address, connect.WithInterceptors(interceptors...))\n}\n"
  },
  {
    "path": "private/pkg/connectclient/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage connectclient\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/dag/comparable_graph.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 dag\n\n// Largely adopted from https://github.com/stevenle/topsort, with modifications.\n//\n// Copyright 2013 Steven Le. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//    http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// See https://github.com/stevenle/topsort/blob/master/LICENSE.\n\n// ComparableGraph is a Graph that uses comparable Values.\ntype ComparableGraph[Value comparable] struct {\n\tgraph *Graph[Value, Value]\n}\n\n// NewComparableGraph returns a new ComparableGraph for a comparable Value.\n//\n// It is safe to initialize a ComparableGraph with &dag.ComparableGraph[value]{}.\n//\n// Do not use interfaces as Values! If your Value type is an interface, use NewGraph.\nfunc NewComparableGraph[Value comparable]() *ComparableGraph[Value] {\n\tcomparableGraph := &ComparableGraph[Value]{}\n\tcomparableGraph.init()\n\treturn comparableGraph\n}\n\n// AddNode adds a node.\nfunc (g *ComparableGraph[Value]) AddNode(value Value) {\n\tg.Graph().AddNode(value)\n}\n\n// AddEdge adds an edge.\nfunc (g *ComparableGraph[Value]) AddEdge(from Value, to Value) {\n\tg.Graph().AddEdge(from, to)\n}\n\n// ContainsNode returns true if the graph contains the given node.\nfunc (g *ComparableGraph[Value]) ContainsNode(key Value) bool {\n\treturn g.Graph().ContainsNode(key)\n}\n\n// NumNodes returns the number of nodes in the graph.\nfunc (g *ComparableGraph[Value]) NumNodes() int {\n\treturn g.Graph().NumNodes()\n}\n\n// NumEdges returns the number of edges in the graph.\nfunc (g *ComparableGraph[Value]) NumEdges() int {\n\treturn g.Graph().NumEdges()\n}\n\n// OutboundNodes returns the nodes that are outbound from the node for the key.\n//\n// Returns error if there is no node for the key\nfunc (g *ComparableGraph[Value]) OutboundNodes(key Value) ([]Value, error) {\n\treturn g.Graph().OutboundNodes(key)\n}\n\n// InboundNodes returns the nodes that are inbound to the node for the key.\n//\n// Returns error if there is no node for the key\nfunc (g *ComparableGraph[Value]) InboundNodes(key Value) ([]Value, error) {\n\treturn g.Graph().InboundNodes(key)\n}\n\n// WalkNodes visited each node in the Graph based on insertion order.\n//\n// f is called for each node. The first argument is the key for the node,\n// the second argument is all inbound edges, the third argument\n// is all outbound edges.\nfunc (g *ComparableGraph[Value]) WalkNodes(f func(Value, []Value, []Value) error) error {\n\treturn g.Graph().WalkNodes(f)\n}\n\n// WalkEdges visits each edge in the Graph starting at the source keys.\n//\n// f is called for each directed edge. The first argument is the source\n// node, the second is the destination node.\n//\n// Returns a *CycleError if there is a cycle in the graph.\nfunc (g *ComparableGraph[Value]) WalkEdges(f func(Value, Value) error) error {\n\treturn g.Graph().WalkEdges(f)\n}\n\n// TopoSort topologically sorts the nodes in the Graph starting at the given key.\n//\n// Returns a *CycleError if there is a cycle in the graph.\nfunc (g *ComparableGraph[Value]) TopoSort(start Value) ([]Value, error) {\n\treturn g.Graph().TopoSort(start)\n}\n\n// DOTString returns a DOT representation of the graph.\n//\n// valueToString is used to print out the label for each node.\n//\n// https://graphviz.org/doc/info/lang.html\nfunc (g *ComparableGraph[Value]) DOTString(valueToString func(Value) string) (string, error) {\n\treturn g.Graph().DOTString(valueToString)\n}\n\n// Graph returns the underlying Graph that backs the ComparableGraph.\n//\n// Used for functions that need a Graph instead of a ComparableGraph.\nfunc (g *ComparableGraph[Value]) Graph() *Graph[Value, Value] {\n\tg.init()\n\treturn g.graph\n}\n\n// *** PRIVATE ***\n\nfunc (g *ComparableGraph[Value]) init() {\n\tif g.graph == nil {\n\t\tg.graph = NewGraph[Value, Value](func(value Value) Value { return value })\n\t}\n}\n"
  },
  {
    "path": "private/pkg/dag/dag.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 dag\n\n// Package adapted from https://github.com/stevenle/topsort, with modifications.\n//\n// Copyright 2013 Steven Le. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//    http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// See https://github.com/stevenle/topsort/blob/master/LICENSE.\n"
  },
  {
    "path": "private/pkg/dag/dag_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 dag_test\n\n// Largely adopted from https://github.com/stevenle/topsort, with modifications.\n//\n// Copyright 2013 Steven Le. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//    http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// See https://github.com/stevenle/topsort/blob/master/LICENSE.\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/dag\"\n\t\"github.com/bufbuild/buf/private/pkg/dag/dagtest\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestTopoSort(t *testing.T) {\n\tt.Parallel()\n\ttestTopoSortSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t},\n\t\t\"a\",\n\t\t[]string{\"c\", \"b\", \"a\"},\n\t)\n}\n\nfunc TestTopoSort2(t *testing.T) {\n\tt.Parallel()\n\ttestTopoSortSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"c\")\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t},\n\t\t\"a\",\n\t\t[]string{\"c\", \"b\", \"a\"},\n\t)\n}\n\nfunc TestTopoSort3(t *testing.T) {\n\tt.Parallel()\n\ttestTopoSortSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\t// e -> b not part of traversal to a on purpose\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"d\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"b\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t},\n\t\t\"a\",\n\t\t[]string{\"b\", \"c\", \"d\", \"a\"},\n\t)\n}\n\nfunc TestTopoSortCycleError(t *testing.T) {\n\tt.Parallel()\n\ttestTopoSortCycleError(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"b\", \"a\")\n\t\t},\n\t\t\"a\",\n\t\t[]string{\"a\", \"b\", \"a\"},\n\t)\n}\n\nfunc TestTopoSortCycleError2(t *testing.T) {\n\tt.Parallel()\n\ttestTopoSortCycleError(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"a\")\n\t\t},\n\t\t\"a\",\n\t\t[]string{\"a\", \"b\", \"c\", \"a\"},\n\t)\n}\n\nfunc TestTopoSortCycleError3(t *testing.T) {\n\tt.Parallel()\n\ttestTopoSortCycleError(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"b\")\n\t\t},\n\t\t\"a\",\n\t\t[]string{\"b\", \"c\", \"b\"},\n\t)\n}\n\nfunc TestWalkEdges(t *testing.T) {\n\tt.Parallel()\n\ttestWalkEdgesSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"a\", \"c\")\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t},\n\t\t[]stringEdge{\n\t\t\t{\n\t\t\t\tFrom: \"a\",\n\t\t\t\tTo:   \"c\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"a\",\n\t\t\t\tTo:   \"b\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"b\",\n\t\t\t\tTo:   \"c\",\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunc TestWalkEdges2(t *testing.T) {\n\tt.Parallel()\n\ttestWalkEdgesSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t},\n\t\t[]stringEdge{\n\t\t\t{\n\t\t\t\tFrom: \"a\",\n\t\t\t\tTo:   \"b\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"b\",\n\t\t\t\tTo:   \"c\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"c\",\n\t\t\t\tTo:   \"d\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"a\",\n\t\t\t\tTo:   \"d\",\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunc TestWalkEdges3(t *testing.T) {\n\tt.Parallel()\n\ttestWalkEdgesSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t},\n\t\t[]stringEdge{\n\t\t\t{\n\t\t\t\tFrom: \"a\",\n\t\t\t\tTo:   \"b\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"b\",\n\t\t\t\tTo:   \"c\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"c\",\n\t\t\t\tTo:   \"d\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"a\",\n\t\t\t\tTo:   \"d\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tFrom: \"e\",\n\t\t\t\tTo:   \"b\",\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunc TestWalkEdgesCycleError(t *testing.T) {\n\tt.Parallel()\n\ttestWalkEdgesCycleError(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t\tgraph.AddEdge(\"d\", \"b\")\n\t\t},\n\t\t[]string{\"b\", \"c\", \"d\", \"b\"},\n\t)\n}\n\nfunc TestWalkEdgesCycleError2(t *testing.T) {\n\tt.Parallel()\n\ttestWalkEdgesCycleError(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\t// there are no sources\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t\tgraph.AddEdge(\"d\", \"e\")\n\t\t\tgraph.AddEdge(\"d\", \"a\")\n\t\t},\n\t\t[]string{\"b\", \"c\", \"d\", \"e\", \"b\"},\n\t)\n}\n\nfunc TestWalkNodes(t *testing.T) {\n\tt.Parallel()\n\ttestWalkNodesSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t\tgraph.AddNode(\"f\")\n\t\t},\n\t\t[]stringNode{\n\t\t\t{\n\t\t\t\tKey:      \"a\",\n\t\t\t\tInbound:  []string{},\n\t\t\t\tOutbound: []string{\"b\", \"d\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"b\",\n\t\t\t\tInbound:  []string{\"a\", \"e\"},\n\t\t\t\tOutbound: []string{\"c\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"d\",\n\t\t\t\tInbound:  []string{\"a\", \"c\"},\n\t\t\t\tOutbound: []string{},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"c\",\n\t\t\t\tInbound:  []string{\"b\"},\n\t\t\t\tOutbound: []string{\"d\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"e\",\n\t\t\t\tInbound:  []string{},\n\t\t\t\tOutbound: []string{\"b\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"f\",\n\t\t\t\tInbound:  []string{},\n\t\t\t\tOutbound: []string{},\n\t\t\t},\n\t\t},\n\t)\n}\n\nfunc TestGraphEqual(t *testing.T) {\n\tt.Parallel()\n\n\tgraph := dag.NewComparableGraph[string]()\n\tgraph.AddEdge(\"a\", \"b\")\n\tgraph.AddEdge(\"a\", \"d\")\n\tgraph.AddEdge(\"b\", \"c\")\n\tgraph.AddEdge(\"c\", \"d\")\n\tgraph.AddEdge(\"e\", \"b\")\n\tgraph.AddNode(\"f\")\n\n\tdagtest.RequireComparableGraphEqual(\n\t\tt,\n\t\t// Purposefully messing up ordering of keys and outbounds to make sure this is still equal.\n\t\t[]dagtest.ExpectedNode[string]{\n\t\t\t{\n\t\t\t\tKey:      \"a\",\n\t\t\t\tOutbound: []string{\"d\", \"b\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"b\",\n\t\t\t\tOutbound: []string{\"c\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"d\",\n\t\t\t\tOutbound: []string{},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"e\",\n\t\t\t\tOutbound: []string{\"b\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey:      \"c\",\n\t\t\t\tOutbound: []string{\"d\"},\n\t\t\t},\n\t\t\t{\n\t\t\t\tKey: \"f\",\n\t\t\t},\n\t\t},\n\t\tgraph,\n\t)\n}\n\nfunc TestNumNodes(t *testing.T) {\n\tt.Parallel()\n\ttestNumNodesSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t\tgraph.AddNode(\"f\")\n\t\t},\n\t\t6,\n\t)\n}\n\nfunc TestNumEdges(t *testing.T) {\n\tt.Parallel()\n\ttestNumEdgesSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t\tgraph.AddNode(\"f\")\n\t\t},\n\t\t5,\n\t)\n}\n\nfunc TestInboundNodes(t *testing.T) {\n\tt.Parallel()\n\tsetupGraph := func(graph *dag.ComparableGraph[string]) {\n\t\tgraph.AddEdge(\"a\", \"b\")\n\t\tgraph.AddEdge(\"a\", \"d\")\n\t\tgraph.AddEdge(\"b\", \"c\")\n\t\tgraph.AddEdge(\"c\", \"d\")\n\t\tgraph.AddEdge(\"e\", \"b\")\n\t\tgraph.AddNode(\"f\")\n\t}\n\ttestInboundNodesSuccess(t, setupGraph, \"d\", []string{\"a\", \"c\"})\n\ttestInboundNodesSuccess(t, setupGraph, \"b\", []string{\"a\", \"e\"})\n\ttestInboundNodesSuccess(t, setupGraph, \"a\", []string{})\n\ttestInboundNodesSuccess(t, setupGraph, \"f\", []string{})\n}\n\nfunc TestOutboundodes(t *testing.T) {\n\tt.Parallel()\n\tsetupGraph := func(graph *dag.ComparableGraph[string]) {\n\t\tgraph.AddEdge(\"a\", \"b\")\n\t\tgraph.AddEdge(\"a\", \"d\")\n\t\tgraph.AddEdge(\"b\", \"c\")\n\t\tgraph.AddEdge(\"c\", \"d\")\n\t\tgraph.AddEdge(\"e\", \"b\")\n\t\tgraph.AddNode(\"f\")\n\t}\n\ttestOutboundNodesSuccess(t, setupGraph, \"a\", []string{\"b\", \"d\"})\n\ttestOutboundNodesSuccess(t, setupGraph, \"b\", []string{\"c\"})\n\ttestOutboundNodesSuccess(t, setupGraph, \"d\", []string{})\n\ttestOutboundNodesSuccess(t, setupGraph, \"f\", []string{})\n}\n\nfunc TestDOTString(t *testing.T) {\n\tt.Parallel()\n\ttestDOTStringSuccess(\n\t\tt,\n\t\tfunc(graph *dag.ComparableGraph[string]) {\n\t\t\tgraph.AddEdge(\"a\", \"b\")\n\t\t\tgraph.AddEdge(\"a\", \"d\")\n\t\t\tgraph.AddEdge(\"b\", \"c\")\n\t\t\tgraph.AddEdge(\"c\", \"d\")\n\t\t\tgraph.AddEdge(\"e\", \"b\")\n\t\t\tgraph.AddNode(\"f\")\n\t\t},\n\t\t`digraph {\n\n  \"a\" -> \"b\"\n  \"b\" -> \"c\"\n  \"c\" -> \"d\"\n  \"a\" -> \"d\"\n  \"e\" -> \"b\"\n  \"f\"\n\n}`,\n\t)\n}\n\nfunc testTopoSortSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\tstart string,\n\texpected []string,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\tresults, err := graph.TopoSort(start)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expected, results)\n}\n\nfunc testTopoSortCycleError(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\tstart string,\n\texpectedCycle []string,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\t_, err := graph.TopoSort(start)\n\trequire.Equal(\n\t\tt,\n\t\t&dag.CycleError[string]{\n\t\t\tKeys: expectedCycle,\n\t\t},\n\t\terr,\n\t)\n}\n\nfunc testWalkEdgesSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\texpected []stringEdge,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\tvar results []stringEdge\n\terr := graph.WalkEdges(\n\t\tfunc(from string, to string) error {\n\t\t\tresults = append(\n\t\t\t\tresults,\n\t\t\t\tstringEdge{\n\t\t\t\t\tFrom: from,\n\t\t\t\t\tTo:   to,\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn nil\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expected, results)\n}\n\nfunc testWalkEdgesCycleError(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\texpectedCycle []string,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\terr := graph.WalkEdges(func(string, string) error { return nil })\n\trequire.Equal(\n\t\tt,\n\t\t&dag.CycleError[string]{\n\t\t\tKeys: expectedCycle,\n\t\t},\n\t\terr,\n\t)\n}\n\nfunc testWalkNodesSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\texpected []stringNode,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\tvar results []stringNode\n\terr := graph.WalkNodes(\n\t\tfunc(key string, inbound []string, outbound []string) error {\n\t\t\tresults = append(\n\t\t\t\tresults,\n\t\t\t\tstringNode{\n\t\t\t\t\tKey:      key,\n\t\t\t\t\tInbound:  inbound,\n\t\t\t\t\tOutbound: outbound,\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn nil\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expected, results)\n}\n\nfunc testNumNodesSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\texpected int,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\trequire.Equal(t, expected, graph.NumNodes())\n}\n\nfunc testNumEdgesSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\texpected int,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\trequire.Equal(t, expected, graph.NumEdges())\n}\n\nfunc testInboundNodesSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\tkey string,\n\texpected []string,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\tactual, err := graph.InboundNodes(key)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expected, actual)\n}\n\nfunc testOutboundNodesSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\tkey string,\n\texpected []string,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\tactual, err := graph.OutboundNodes(key)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expected, actual)\n}\n\nfunc testDOTStringSuccess(\n\tt *testing.T,\n\tsetupGraph func(*dag.ComparableGraph[string]),\n\texpected string,\n) {\n\tgraph := dag.NewComparableGraph[string]()\n\tsetupGraph(graph)\n\ts, err := graph.DOTString(func(key string) string { return key })\n\trequire.NoError(t, err)\n\trequire.Equal(t, expected, s)\n}\n\ntype stringEdge struct {\n\tFrom string\n\tTo   string\n}\n\ntype stringNode struct {\n\tKey      string\n\tInbound  []string\n\tOutbound []string\n}\n"
  },
  {
    "path": "private/pkg/dag/dagtest/dagtest.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 dagtest\n\nimport (\n\t\"cmp\"\n\t\"slices\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/dag\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// ExpectedNode is an expected node.\ntype ExpectedNode[Key cmp.Ordered] struct {\n\tKey      Key\n\tOutbound []Key\n}\n\n// RequireComparableGraphEqual requires that the Comparable equals the given ExpectedNodes.\n//\n// The order of the input ExpectedNodes does not matter, and the order of\n// the outbound Keys does not matter.\nfunc RequireComparableGraphEqual[Key cmp.Ordered](\n\tt *testing.T,\n\texpected []ExpectedNode[Key],\n\tcomparableGraph *dag.ComparableGraph[Key],\n) {\n\tRequireGraphEqual(t, expected, comparableGraph.Graph(), func(key Key) Key { return key })\n}\n\n// RequireGraphEqual requires that the graph equals the given ExpectedNodes.\n//\n// The order of the input ExpectedNodes does not matter, and the order of\n// the outbound Keys does not matter.\nfunc RequireGraphEqual[Key cmp.Ordered, Value any](\n\tt *testing.T,\n\texpected []ExpectedNode[Key],\n\tgraph *dag.Graph[Key, Value],\n\ttoKey func(Value) Key,\n) {\n\tactual := make([]ExpectedNode[Key], 0, len(expected))\n\terr := graph.WalkNodes(\n\t\tfunc(value Value, _ []Value, outbound []Value) error {\n\t\t\tactual = append(\n\t\t\t\tactual,\n\t\t\t\tExpectedNode[Key]{\n\t\t\t\t\tKey:      toKey(value),\n\t\t\t\t\tOutbound: xslices.Map(outbound, toKey),\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn nil\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(t, normalizeExpectedNodes(expected), normalizeExpectedNodes(actual))\n}\n\nfunc normalizeExpectedNodes[Key cmp.Ordered](expectedNodes []ExpectedNode[Key]) []ExpectedNode[Key] {\n\tif expectedNodes == nil {\n\t\treturn []ExpectedNode[Key]{}\n\t}\n\tc := slices.Clone(expectedNodes)\n\tsort.Slice(\n\t\tc,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn c[i].Key < c[j].Key\n\t\t},\n\t)\n\tfor i, e := range c {\n\t\te.Outbound = normalizeKeys(e.Outbound)\n\t\tc[i] = e\n\t}\n\treturn c\n}\n\nfunc normalizeKeys[Key cmp.Ordered](keys []Key) []Key {\n\tif keys == nil {\n\t\treturn []Key{}\n\t}\n\tkeys = slices.Clone(keys)\n\tslices.Sort(keys)\n\treturn keys\n}\n"
  },
  {
    "path": "private/pkg/dag/dagtest/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage dagtest\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/dag/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 dag\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// CycleError is an error if the Graph had a cycle.\ntype CycleError[Key comparable] struct {\n\tKeys []Key\n}\n\n// Error implements error.\nfunc (c *CycleError[Key]) Error() string {\n\tstrs := make([]string, len(c.Keys))\n\tfor i, key := range c.Keys {\n\t\tstrs[i] = fmt.Sprintf(\"%v\", key)\n\t}\n\treturn fmt.Sprintf(\"cycle error: %s\", strings.Join(strs, \" -> \"))\n}\n"
  },
  {
    "path": "private/pkg/dag/graph.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 dag\n\nimport (\n\t\"bytes\"\n\t\"encoding/xml\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// Graph is a directed acyclic graph structure.\ntype Graph[Key comparable, Value any] struct {\n\tgetKeyForValue func(Value) Key\n\tkeyToValue     map[Key]Value\n\tkeyToNode      map[Key]*node[Key]\n\t// need to store order so that we can create a deterministic CycleError\n\t// in the case of Walk where we have no source nodes, so that we can Walk\n\t// deterministically and find the cycle.\n\tkeys []Key\n}\n\n// NewGraph returns a new Graph for an any Value.\n//\n// The toKey function must convert a Value to a unique comparable key type.\n// It is up to the caller to make sure that the key is unique on a per-value basis.\n//\n// This constructor must be used when initializing a Graph.\n//\n// TODO FUTURE: It really stinks that we have to use the constructor. We have what amounts\n// to silent errors now below with functions that don't return an error. We should\n// figure out a way to do this properly, or perhaps just panic if we don't use the constructor.\nfunc NewGraph[Key comparable, Value any](toKey func(Value) Key) *Graph[Key, Value] {\n\treturn &Graph[Key, Value]{\n\t\tgetKeyForValue: toKey,\n\t\tkeyToValue:     make(map[Key]Value),\n\t\tkeyToNode:      make(map[Key]*node[Key]),\n\t}\n}\n\n// AddNode adds a node.\nfunc (g *Graph[Key, Value]) AddNode(value Value) {\n\tif err := g.checkInit(); err != nil {\n\t\treturn\n\t}\n\tg.getOrAddNode(value)\n}\n\n// AddEdge adds an edge.\nfunc (g *Graph[Key, Value]) AddEdge(from Value, to Value) {\n\tif err := g.checkInit(); err != nil {\n\t\treturn\n\t}\n\tfromNode := g.getOrAddNode(from)\n\ttoNode := g.getOrAddNode(to)\n\tfromNode.addOutboundEdge(g.getKeyForValue(to))\n\ttoNode.addInboundEdge(g.getKeyForValue(from))\n}\n\n// ContainsNode returns true if the graph contains the given node.\nfunc (g *Graph[Key, Value]) ContainsNode(key Key) bool {\n\tif err := g.checkInit(); err != nil {\n\t\treturn false\n\t}\n\t_, ok := g.keyToNode[key]\n\treturn ok\n}\n\n// NumNodes returns the number of nodes in the graph.\nfunc (g *Graph[Key, Value]) NumNodes() int {\n\tif err := g.checkInit(); err != nil {\n\t\treturn 0\n\t}\n\treturn len(g.keys)\n}\n\n// NumEdges returns the number of edges in the graph.\nfunc (g *Graph[Key, Value]) NumEdges() int {\n\tif err := g.checkInit(); err != nil {\n\t\treturn 0\n\t}\n\tvar numEdges int\n\tfor _, node := range g.keyToNode {\n\t\tnumEdges += len(node.outboundEdges)\n\t}\n\treturn numEdges\n}\n\n// InboundNodes returns the nodes that are inbound to the node for the key.\n//\n// Returns error if there is no node for the key\nfunc (g *Graph[Key, Value]) InboundNodes(key Key) ([]Value, error) {\n\tif err := g.checkInit(); err != nil {\n\t\treturn nil, err\n\t}\n\tnode, ok := g.keyToNode[key]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"key not present: %v\", key)\n\t}\n\treturn g.getValuesForKeys(node.inboundEdges)\n}\n\n// OutboundNodes returns the nodes that are outbound from the node for the key.\n//\n// Returns error if there is no node for the key\nfunc (g *Graph[Key, Value]) OutboundNodes(key Key) ([]Value, error) {\n\tif err := g.checkInit(); err != nil {\n\t\treturn nil, err\n\t}\n\tnode, ok := g.keyToNode[key]\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"key not present: %v\", key)\n\t}\n\treturn g.getValuesForKeys(node.outboundEdges)\n}\n\n// WalkNodes visited each node in the Graph based on insertion order.\n//\n// f is called for each node. The first argument is the key for the node,\n// the second argument is all inbound edges, the third argument\n// is all outbound edges.\nfunc (g *Graph[Key, Value]) WalkNodes(f func(Value, []Value, []Value) error) error {\n\tif err := g.checkInit(); err != nil {\n\t\treturn err\n\t}\n\tfor _, key := range g.keys {\n\t\tnode, ok := g.keyToNode[key]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"key not present: %v\", key)\n\t\t}\n\t\tvalue, err := g.getValueForKey(key)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinboundValues, err := g.getValuesForKeys(node.inboundEdges)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\toutboundValues, err := g.getValuesForKeys(node.outboundEdges)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := f(value, inboundValues, outboundValues); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// WalkEdges visits each edge in the Graph starting at the source keys.\n//\n// f is called for each directed edge. The first argument is the source\n// node, the second is the destination node.\n//\n// Returns a *CycleError if there is a cycle in the graph.\nfunc (g *Graph[Key, Value]) WalkEdges(f func(Value, Value) error) error {\n\tif err := g.checkInit(); err != nil {\n\t\treturn err\n\t}\n\tif g.NumEdges() == 0 {\n\t\t// No edges, do not walk.\n\t\treturn nil\n\t}\n\tsourceKeys, err := g.getSourceKeys()\n\tif err != nil {\n\t\treturn err\n\t}\n\tswitch len(sourceKeys) {\n\tcase 0:\n\t\t// If we have no source nodes, we have a cycle in the graph. To print the cycle,\n\t\t// we walk starting at all keys We will hit a cycle in this process, however just to check our\n\t\t// assumptions, we also verify the the walk returns a CycleError, and if not,\n\t\t// return a system error.\n\t\tallVisited := make(map[Key]struct{})\n\t\tfor _, key := range g.keys {\n\t\t\tif err := g.edgeVisit(\n\t\t\t\tkey,\n\t\t\t\tfunc(Value, Value) error { return nil },\n\t\t\t\tnewOrderedSet[Key](),\n\t\t\t\tallVisited,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn errors.New(\"graph had cycle based on source node count being zero, but this was not detected during edge walking\")\n\tcase 1:\n\t\treturn g.edgeVisit(\n\t\t\tsourceKeys[0],\n\t\t\tf,\n\t\t\tnewOrderedSet[Key](),\n\t\t\tmake(map[Key]struct{}),\n\t\t)\n\tdefault:\n\t\tallVisited := make(map[Key]struct{})\n\t\tfor _, key := range sourceKeys {\n\t\t\tif err := g.edgeVisit(\n\t\t\t\tkey,\n\t\t\t\tf,\n\t\t\t\tnewOrderedSet[Key](),\n\t\t\t\tallVisited,\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n}\n\n// TopoSort topologically sorts the nodes in the Graph starting at the given key.\n//\n// Returns a *CycleError if there is a cycle in the graph.\nfunc (g *Graph[Key, Value]) TopoSort(start Key) ([]Value, error) {\n\tif err := g.checkInit(); err != nil {\n\t\treturn nil, err\n\t}\n\tresults := newOrderedSet[Key]()\n\tif err := g.topoVisit(start, results, newOrderedSet[Key]()); err != nil {\n\t\treturn nil, err\n\t}\n\treturn g.getValuesForKeys(results.keys)\n}\n\n// DOTString returns a DOT representation of the graph.\n//\n// valueToString is used to print out the label for each node.\n//\n// https://graphviz.org/doc/info/lang.html\nfunc (g *Graph[Key, Value]) DOTString(valueToString func(Value) string) (string, error) {\n\tif err := g.checkInit(); err != nil {\n\t\treturn \"\", err\n\t}\n\tvar edgeStrings []string\n\tseenKeys := make(map[Key]struct{})\n\tif err := g.WalkEdges(\n\t\tfunc(from Value, to Value) error {\n\t\t\tseenKeys[g.getKeyForValue(from)] = struct{}{}\n\t\t\tseenKeys[g.getKeyForValue(to)] = struct{}{}\n\t\t\tfromName, err := xmlEscape(valueToString(from))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\ttoName, err := xmlEscape(valueToString(to))\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tedgeStrings = append(edgeStrings, fmt.Sprintf(\"%q -> %q\", fromName, toName))\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn \"\", err\n\t}\n\t// We also want to pick up any nodes that do not have edges, and display them.\n\tif err := g.WalkNodes(\n\t\tfunc(value Value, inboundEdges []Value, outboundEdges []Value) error {\n\t\t\tkey := g.getKeyForValue(value)\n\t\t\tif _, ok := seenKeys[key]; ok {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tseenKeys[key] = struct{}{}\n\t\t\tif len(inboundEdges) == 0 && len(outboundEdges) == 0 {\n\t\t\t\tname, err := xmlEscape(valueToString(value))\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tedgeStrings = append(edgeStrings, fmt.Sprintf(\"%q\", name))\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\t// This is a system error.\n\t\t\treturn syserror.Newf(\n\t\t\t\t\"got node %v with %d inbound edges and %d outbound edges, but this was not processed during WalkEdges\",\n\t\t\t\tvalue,\n\t\t\t\tlen(inboundEdges),\n\t\t\t\tlen(outboundEdges),\n\t\t\t)\n\t\t},\n\t); err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(edgeStrings) == 0 {\n\t\treturn \"digraph {}\", nil\n\t}\n\tbuffer := bytes.NewBuffer(nil)\n\t_, _ = buffer.WriteString(\"digraph {\\n\\n\")\n\tfor _, edgeString := range edgeStrings {\n\t\t_, _ = buffer.WriteString(\"  \")\n\t\t_, _ = buffer.WriteString(edgeString)\n\t\t_, _ = buffer.WriteString(\"\\n\")\n\t}\n\t_, _ = buffer.WriteString(\"\\n}\")\n\treturn buffer.String(), nil\n}\n\n// *** PRIVATE ***\n\nfunc (g *Graph[Key, Value]) checkInit() error {\n\t// We have to force usage of the constructor as there is no other clean way to get\n\t// c.getKeyForValue into the struct. Otherwise, we could use an init function for everything,\n\t// but c.getKeyForValue is required. There is no sensible default.\n\t//\n\t// We also do this with ComparableGraph, as otherwise, if we expose Graph as a public\n\t// inheritance, we can't guarantee that an init function will be called, as even if\n\t// we wrapped all the public functions specifically for ComparableGraph with init\n\t// and then c.Graph.Func(), we could not guarantee that these wrapped functions\n\t// would be called.\n\tif g.getKeyForValue == nil || g.keyToValue == nil || g.keyToNode == nil {\n\t\treturn errors.New(\"graphs must be constructed with dag.NewGraph or dag.NewComparableGraph\")\n\t}\n\treturn nil\n}\n\nfunc (g *Graph[Key, Value]) getValuesForKeys(keys []Key) ([]Value, error) {\n\treturn xslices.MapError(keys, g.getValueForKey)\n}\n\nfunc (g *Graph[Key, Value]) getValueForKey(key Key) (Value, error) {\n\tvalue, ok := g.keyToValue[key]\n\tif !ok {\n\t\t// This should never happen.\n\t\treturn value, fmt.Errorf(\"key not present: %v\", key)\n\t}\n\treturn value, nil\n}\n\nfunc (g *Graph[Key, Value]) getOrAddNode(value Value) *node[Key] {\n\tkey := g.getKeyForValue(value)\n\tnode, ok := g.keyToNode[key]\n\tif !ok {\n\t\tnode = newNode[Key]()\n\t\tg.keyToValue[key] = value\n\t\tg.keyToNode[key] = node\n\t\tg.keys = append(g.keys, key)\n\t}\n\treturn node\n}\n\nfunc (g *Graph[Key, Value]) getSourceKeys() ([]Key, error) {\n\tvar sourceKeys []Key\n\t// need to get in deterministic order\n\tfor _, key := range g.keys {\n\t\tnode, ok := g.keyToNode[key]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"key not present: %v\", key)\n\t\t}\n\t\tif len(node.inboundEdgeMap) == 0 {\n\t\t\tsourceKeys = append(sourceKeys, key)\n\t\t}\n\t}\n\treturn sourceKeys, nil\n}\n\nfunc (g *Graph[Key, Value]) edgeVisit(\n\tfrom Key,\n\tf func(Value, Value) error,\n\tthisSourceVisited *orderedSet[Key],\n\tallSourcesVisited map[Key]struct{},\n) error {\n\t// this is based on this source. we want to make sure we don't\n\t// have any cycles based on starting at a single source.\n\tif !thisSourceVisited.add(from) {\n\t\tindex := thisSourceVisited.index(from)\n\t\tcycle := append(thisSourceVisited.keys[index:], from)\n\t\treturn &CycleError[Key]{Keys: cycle}\n\t}\n\t// If we visited this from all edge visiting from other\n\t// sources, do nothing, we've evaluated all cycles and visited this\n\t// node properly. It's OK to return here, as we've already checked\n\t// for cycles with thisSourceVisited.\n\tif _, ok := allSourcesVisited[from]; ok {\n\t\treturn nil\n\t}\n\t// Add to the map. We'll be needing this for future iterations.\n\tallSourcesVisited[from] = struct{}{}\n\n\tfromNode, ok := g.keyToNode[from]\n\tif !ok {\n\t\treturn fmt.Errorf(\"key not present: %v\", from)\n\t}\n\tfromValue, err := g.getValueForKey(from)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, to := range fromNode.outboundEdges {\n\t\ttoValue, err := g.getValueForKey(to)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := f(fromValue, toValue); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := g.edgeVisit(to, f, thisSourceVisited.copy(), allSourcesVisited); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (g *Graph[Key, Value]) topoVisit(\n\tfrom Key,\n\tresults *orderedSet[Key],\n\tvisited *orderedSet[Key],\n) error {\n\tif !visited.add(from) {\n\t\tindex := visited.index(from)\n\t\tcycle := append(visited.keys[index:], from)\n\t\treturn &CycleError[Key]{Keys: cycle}\n\t}\n\n\tfromNode, ok := g.keyToNode[from]\n\tif !ok {\n\t\treturn fmt.Errorf(\"key not present: %v\", from)\n\t}\n\tfor _, to := range fromNode.outboundEdges {\n\t\tif err := g.topoVisit(to, results, visited.copy()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tresults.add(from)\n\treturn nil\n}\n\ntype node[Key comparable] struct {\n\toutboundEdgeMap map[Key]struct{}\n\t// need to store order for deterministic visits\n\toutboundEdges  []Key\n\tinboundEdgeMap map[Key]struct{}\n\t// need to store order for deterministic visits\n\tinboundEdges []Key\n}\n\nfunc newNode[Key comparable]() *node[Key] {\n\treturn &node[Key]{\n\t\toutboundEdgeMap: make(map[Key]struct{}),\n\t\tinboundEdgeMap:  make(map[Key]struct{}),\n\t}\n}\n\nfunc (n *node[Key]) addOutboundEdge(key Key) {\n\tif _, ok := n.outboundEdgeMap[key]; !ok {\n\t\tn.outboundEdgeMap[key] = struct{}{}\n\t\tn.outboundEdges = append(n.outboundEdges, key)\n\t}\n}\n\nfunc (n *node[Key]) addInboundEdge(key Key) {\n\tif _, ok := n.inboundEdgeMap[key]; !ok {\n\t\tn.inboundEdgeMap[key] = struct{}{}\n\t\tn.inboundEdges = append(n.inboundEdges, key)\n\t}\n}\n\ntype orderedSet[Key comparable] struct {\n\tkeyToIndex map[Key]int\n\tkeys       []Key\n\tlength     int\n}\n\nfunc newOrderedSet[Key comparable]() *orderedSet[Key] {\n\treturn &orderedSet[Key]{\n\t\tkeyToIndex: make(map[Key]int),\n\t}\n}\n\n// returns false if already added\nfunc (s *orderedSet[Key]) add(key Key) bool {\n\tif _, ok := s.keyToIndex[key]; !ok {\n\t\ts.keyToIndex[key] = s.length\n\t\ts.keys = append(s.keys, key)\n\t\ts.length++\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc (s *orderedSet[Key]) copy() *orderedSet[Key] {\n\tclone := newOrderedSet[Key]()\n\tfor _, item := range s.keys {\n\t\tclone.add(item)\n\t}\n\treturn clone\n}\n\nfunc (s *orderedSet[Key]) index(item Key) int {\n\tindex, ok := s.keyToIndex[item]\n\tif ok {\n\t\treturn index\n\t}\n\treturn -1\n}\n\nfunc xmlEscape(s string) (string, error) {\n\tbuffer := bytes.NewBuffer(nil)\n\tif err := xml.EscapeText(buffer, []byte(s)); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn buffer.String(), nil\n}\n"
  },
  {
    "path": "private/pkg/dag/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage dag\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/diff/diff.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 diff implements diffing.\n//\n// Should primarily be used for testing.\npackage diff\n\n// Largely copied from https://github.com/golang/go/blob/master/src/cmd/gofmt/gofmt.go\n//\n// 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// https://github.com/golang/go/blob/master/LICENSE\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\n\t\"buf.build/go/standard/xos/xexec\"\n)\n\n// Diff does a diff.\n//\n// Returns nil if no diff.\nfunc Diff(\n\tctx context.Context,\n\tb1 []byte,\n\tb2 []byte,\n\tfilename1 string,\n\tfilename2 string,\n\toptions ...DiffOption,\n) ([]byte, error) {\n\tdiffOptions := newDiffOptions()\n\tfor _, option := range options {\n\t\toption(diffOptions)\n\t}\n\treturn doDiff(\n\t\tctx,\n\t\tb1,\n\t\tb2,\n\t\tfilename1,\n\t\tfilename2,\n\t\tdiffOptions.suppressCommands,\n\t\tdiffOptions.suppressTimestamps,\n\t)\n}\n\n// DiffOption is an option for Diff.\ntype DiffOption func(*diffOptions)\n\n// DiffWithSuppressCommands returns a new DiffOption that suppresses printing of commands.\nfunc DiffWithSuppressCommands() DiffOption {\n\treturn func(diffOptions *diffOptions) {\n\t\tdiffOptions.suppressCommands = true\n\t}\n}\n\n// DiffWithSuppressTimestamps returns a new DiffOption that suppresses printing of timestamps.\nfunc DiffWithSuppressTimestamps() DiffOption {\n\treturn func(diffOptions *diffOptions) {\n\t\tdiffOptions.suppressTimestamps = true\n\t}\n}\n\nfunc doDiff(\n\tctx context.Context,\n\tb1 []byte,\n\tb2 []byte,\n\tfilename1 string,\n\tfilename2 string,\n\tsuppressCommands bool,\n\tsuppressTimestamps bool,\n) ([]byte, error) {\n\tif bytes.Equal(b1, b2) {\n\t\treturn nil, nil\n\t}\n\n\tf1, err := writeTempFile(\"\", \"\", b1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\t_ = os.Remove(f1)\n\t}()\n\n\tf2, err := writeTempFile(\"\", \"\", b2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\t_ = os.Remove(f2)\n\t}()\n\n\tbinaryPath := \"diff\"\n\tif runtime.GOOS == \"plan9\" {\n\t\tbinaryPath = \"/bin/ape/diff\"\n\t}\n\n\tbuffer := bytes.NewBuffer(nil)\n\terr = xexec.Run(\n\t\tctx,\n\t\tbinaryPath,\n\t\txexec.WithArgs(\"-u\", f1, f2),\n\t\txexec.WithStdout(buffer),\n\t\txexec.WithStderr(buffer),\n\t)\n\tdata := buffer.Bytes()\n\tif len(data) > 0 {\n\t\t// diff exits with a non-zero status when the files don't match.\n\t\t// Ignore that failure as long as we get output.\n\t\treturn tryModifyHeader(data, filename1, filename2, suppressCommands, suppressTimestamps), nil\n\t}\n\treturn nil, err\n}\n\nfunc writeTempFile(dir string, prefix string, data []byte) (string, error) {\n\tfile, err := os.CreateTemp(dir, prefix)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(data) > 0 {\n\t\t_, err = file.Write(data)\n\t}\n\tif err1 := file.Close(); err == nil {\n\t\terr = err1\n\t}\n\tif err != nil {\n\t\t_ = os.Remove(file.Name())\n\t\treturn \"\", err\n\t}\n\treturn file.Name(), nil\n}\n\nfunc tryModifyHeader(\n\tdiff []byte,\n\tfilename1 string,\n\tfilename2 string,\n\tsuppressCommands bool,\n\tsuppressTimestamps bool,\n) []byte {\n\tbs := bytes.SplitN(diff, []byte{'\\n'}, 3)\n\tif len(bs) < 3 {\n\t\treturn diff\n\t}\n\t// Preserve timestamps.\n\tvar t0, t1 []byte\n\tif !suppressTimestamps {\n\t\tif i := bytes.LastIndexByte(bs[0], '\\t'); i != -1 {\n\t\t\tt0 = bs[0][i:]\n\t\t}\n\t\tif i := bytes.LastIndexByte(bs[1], '\\t'); i != -1 {\n\t\t\tt1 = bs[1][i:]\n\t\t}\n\t}\n\t// Always print filepath with slash separator.\n\tfilename1 = filepath.ToSlash(filename1)\n\tfilename2 = filepath.ToSlash(filename2)\n\tif filename1 == filename2 {\n\t\tfilename1 = filename1 + \".orig\"\n\t}\n\tbs[0] = fmt.Appendf(nil, \"--- %s%s\", filename1, t0)\n\tbs[1] = fmt.Appendf(nil, \"+++ %s%s\", filename2, t1)\n\tif !suppressCommands {\n\t\tbs = append(\n\t\t\t[][]byte{\n\t\t\t\tfmt.Appendf(nil, \"diff -u %s %s\", filename1, filename2),\n\t\t\t},\n\t\t\tbs...,\n\t\t)\n\t}\n\treturn bytes.Join(bs, []byte{'\\n'})\n}\n\ntype diffOptions struct {\n\tsuppressCommands   bool\n\tsuppressTimestamps bool\n}\n\nfunc newDiffOptions() *diffOptions {\n\treturn &diffOptions{}\n}\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/diffmyers.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 diffmyers\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n)\n\n// EditKind is the kind of edit.\ntype EditKind int\n\nconst (\n\t// EditKindDelete is a delete.\n\tEditKindDelete EditKind = iota + 1\n\t// EditKindInsert is an insert.\n\tEditKindInsert\n)\n\n// Edit is an delete or insert operation.\ntype Edit struct {\n\t// Kind is the kind of edit. It is either an insert or a delete.\n\tKind EditKind\n\t// FromPosition is the line to edit in the original sequence.\n\tFromPosition int\n\t// ToPosition is the line in the new sequence. It is only valid for\n\t// inserts.\n\tToPosition int\n}\n\n// Diff does a diff. It returns a [[]Edit] which when applied to the original\n// sequence will result in the new sequence.\n//\n// The algorithm is based on the paper \"An O(ND) Difference Algorithm and Its\n// Variations\" by Eugene W. Myers. The paper is available at https://citeseerx.ist.psu.edu/doc/10.1.1.4.6927.\n//\n// It implements the linear space refinement of the algorithm described in section 4b. This is the\n// same algorithm used by git.\nfunc Diff(from, to [][]byte) []Edit {\n\treturn shortestEdits(from, to, 0, 0)\n}\n\n// Print prints the edits in the unified diff format without the header.\n//\n// Ref: https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html\nfunc Print(from, to [][]byte, edits []Edit) ([]byte, error) {\n\tconst contextThreshold = 2\n\ttype printLine struct {\n\t\tEditKind EditKind\n\t\tline     []byte\n\t\thunk     bool\n\t}\n\t// If the last line of from is not a newline append one.\n\tif len(from) > 0 && from[len(from)-1] != nil {\n\t\tlast := from[len(from)-1]\n\t\tif last[len(last)-1] != '\\n' {\n\t\t\tfrom[len(from)-1] = append(last, '\\n')\n\t\t}\n\t}\n\t// We preallocate the slice to avoid reallocations.\n\t//\n\t// Each edit is either a delete or an insert so the total number of lines\n\t// in the diff is the number of edits plus the number of lines in the\n\t// original sequence. The worst case for the hunk headers are\n\t// as many edits.\n\tout := make([]*printLine, 0, len(from)+2*len(edits))\n\tvar fromIndex, toIndex, bufferSize int\n\tfor i := 0; i < len(edits); i++ {\n\t\t// Remember the start of the hunk. We add 1 to the indexes because\n\t\t// we want to print the line number and they start at 1.\n\t\thunkOldStart := fromIndex + 1\n\t\thunkNewStart := toIndex + 1\n\t\t// Reserve the space for the hunk header.\n\t\thunk := &printLine{hunk: true}\n\t\tout = append(out, hunk)\n\t\tvar (\n\t\t\tinsertCount, deleteCount int\n\t\t\tprintHunk                bool\n\t\t)\n\t\t// Print the lines in the edit.\n\t\tfor j := i; j < len(edits); j++ {\n\t\t\t// Print the lines before the edit.\n\t\t\tvar advance int\n\t\t\tfor _, line := range from[fromIndex:edits[i].FromPosition] {\n\t\t\t\tout = append(out, &printLine{line: line})\n\t\t\t\tbufferSize += len(line) + 1\n\t\t\t\tadvance++\n\t\t\t}\n\t\t\t// Advance the indexes.\n\t\t\ttoIndex += advance\n\t\t\tfromIndex += advance\n\t\t\tinsertCount += advance\n\t\t\tdeleteCount += advance\n\t\t\tif advance > contextThreshold {\n\t\t\t\ti--\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tprintHunk = true\n\t\t\tswitch edits[j].Kind {\n\t\t\tcase EditKindDelete:\n\t\t\t\tdeleteCount++\n\t\t\t\tfromIndex++\n\t\t\t\tout = append(out, &printLine{\n\t\t\t\t\tEditKind: EditKindDelete,\n\t\t\t\t\tline:     from[edits[j].FromPosition],\n\t\t\t\t})\n\t\t\tcase EditKindInsert:\n\t\t\t\tinsertCount++\n\t\t\t\ttoIndex++\n\t\t\t\tout = append(out, &printLine{\n\t\t\t\t\tEditKind: EditKindInsert,\n\t\t\t\t\tline:     to[edits[j].ToPosition],\n\t\t\t\t})\n\t\t\tdefault:\n\t\t\t\treturn nil, errors.New(\"unknown edit kind\")\n\t\t\t}\n\t\t\tbufferSize += len(out[len(out)-1].line) + 1\n\t\t\ti++\n\t\t}\n\t\tif printHunk {\n\t\t\t// Print the hunk header.\n\t\t\thunk.line = fmt.Appendf(nil, \"@@ -%d,%d +%d,%d @@\\n\", hunkOldStart, deleteCount, hunkNewStart, insertCount)\n\t\t\tbufferSize += len(hunk.line) + 1\n\t\t}\n\t}\n\t// Print the lines after the last edit.\n\tfor _, line := range from[fromIndex:] {\n\t\tout = append(out, &printLine{line: line})\n\t\tbufferSize += len(line) + 1\n\t}\n\tvar buffer bytes.Buffer\n\tbuffer.Grow(bufferSize)\n\tfor _, line := range out {\n\t\tif line.hunk {\n\t\t\tif len(line.line) > 0 {\n\t\t\t\tbuffer.Write(line.line)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tswitch line.EditKind {\n\t\tcase EditKindDelete:\n\t\t\tbuffer.WriteByte('-')\n\t\tcase EditKindInsert:\n\t\t\tbuffer.WriteByte('+')\n\t\tdefault:\n\t\t\tbuffer.WriteByte(' ')\n\t\t}\n\t\tbuffer.Write(line.line)\n\t}\n\treturn buffer.Bytes(), nil\n}\n\nfunc shortestEdits(from, to [][]byte, fromOffset, toOffset int) []Edit {\n\tn, m := len(from), len(to)\n\tif m == 0 { // We've reached the end of the 'to' sequence. So delete the rest of the 'from' sequence.\n\t\tedits := make([]Edit, len(from))\n\t\tfor i := range from {\n\t\t\tedits[i] = Edit{\n\t\t\t\tKind:         EditKindDelete,\n\t\t\t\tFromPosition: fromOffset + i,\n\t\t\t}\n\t\t}\n\t\treturn edits\n\t}\n\tif n == 0 { // We've reached the end of the 'from' sequence. So insert the rest of the 'to' sequence.\n\t\tedits := make([]Edit, len(to))\n\t\tfor i := range to {\n\t\t\tedits[i] = Edit{\n\t\t\t\tKind:         EditKindInsert,\n\t\t\t\tFromPosition: fromOffset,\n\t\t\t\tToPosition:   toOffset + i,\n\t\t\t}\n\t\t}\n\t\treturn edits\n\t}\n\td, x, y, u, v := findMiddleSnake(from, to)\n\tif d > 1 || x != u && y != v {\n\t\treturn append(shortestEdits(from[:x], to[:y], fromOffset, toOffset), shortestEdits(from[u:], to[v:], fromOffset+u, toOffset+v)...)\n\t}\n\tif m > n {\n\t\treturn shortestEdits(nil, to[n:m], fromOffset+n, toOffset+n)\n\t}\n\tif m < n {\n\t\treturn shortestEdits(from[m:n], nil, fromOffset+m, toOffset+m)\n\t}\n\treturn nil\n}\n\n// returns the length, starting and ending points of the middle snake.\n//\n// This is based on the pseudo code in page 11. This deliberately deviates from\n// the style of using descriptive variables names to ease comparison with the\n// pseudo code and variable names in the paper.\nfunc findMiddleSnake(from, to [][]byte) (d int, x int, y int, u int, v int) {\n\tn, m := len(from), len(to)\n\tmaxD := ceiledHalf(n + m)\n\t// We need to allocate 2*maxD+1 because k can go from -maxD to maxD.\n\t// Wherever we access them we just offset by maxD.\n\tvf := make([]int, 2*maxD+1)\n\tvb := make([]int, 2*maxD+1)\n\tfor i := range vf {\n\t\tvf[i] = -1\n\t\tvb[i] = -1\n\t}\n\tvf[1+maxD] = 0\n\tvb[1+maxD] = 0\n\tdelta := n - m\n\tfor d := 0; d <= maxD; d++ {\n\t\tfor k := -d; k <= d; k += 2 { // Forward snake\n\t\t\tvar x int\n\t\t\t// We prefer deletions over insertions.\n\t\t\tif k == -d || (k != d && vf[k-1+maxD] < vf[k+1+maxD]) {\n\t\t\t\tx = vf[k+1+maxD]\n\t\t\t} else {\n\t\t\t\tx = vf[k-1+maxD] + 1\n\t\t\t}\n\t\t\ty := x - k\n\t\t\t// Initial point\n\t\t\txi := x\n\t\t\tyi := y\n\t\t\t// Move diagonally as far as possible.\n\t\t\tfor x < n && y < m && bytes.Equal(from[x], to[y]) {\n\t\t\t\tx++\n\t\t\t\ty++\n\t\t\t}\n\t\t\tvf[k+maxD] = x\n\t\t\tif (delta&1 == 1) && -(k-delta) >= -(d-1) && -(k-delta) <= (d-1) && vb[(-(k-delta))+maxD] != -1 {\n\t\t\t\tif x+vb[(-(k-delta))+maxD] >= n {\n\t\t\t\t\treturn 2*d - 1, xi, yi, x, y\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor k := -d; k <= d; k += 2 { // Backward snake\n\t\t\tvar x int\n\t\t\tif k == -d || (k != d && vb[k-1+maxD] < vb[k+1+maxD]) {\n\t\t\t\tx = vb[k+1+maxD]\n\t\t\t} else {\n\t\t\t\tx = vb[k-1+maxD] + 1\n\t\t\t}\n\t\t\ty := x - k\n\t\t\txi := x\n\t\t\tyi := y\n\t\t\tfor x < n && y < m && bytes.Equal(from[n-x-1], to[m-y-1]) {\n\t\t\t\tx++\n\t\t\t\ty++\n\t\t\t}\n\t\t\tvb[k+maxD] = x\n\t\t\tif (delta&1 == 0) && -(k-delta) >= -d && -(k-delta) <= d && vf[(-(k-delta))+maxD] != -1 {\n\t\t\t\tif x+vf[(-(k-delta))+maxD] >= n {\n\t\t\t\t\treturn 2 * d, n - x, m - y, n - xi, m - yi\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn -1, -1, -1, -1, -1\n}\n\nfunc ceiledHalf(n int) int {\n\tif n%2 == 0 {\n\t\treturn n / 2\n\t}\n\treturn n/2 + 1\n}\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/diffmyers_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 diffmyers_test\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/diff/diffmyers\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nconst writeGoldenFiles = false\n\nfunc TestDiff(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"delete-and-insert\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst from = \"Hello, world!\\n\"\n\t\tconst to = \"Goodbye, world!\\n\"\n\t\tedits := diffmyers.Diff(\n\t\t\tsplitLines(from),\n\t\t\tsplitLines(to),\n\t\t)\n\t\tassert.Equal(t, edits, []diffmyers.Edit{\n\t\t\t{\n\t\t\t\tKind: diffmyers.EditKindDelete,\n\t\t\t},\n\t\t\t{\n\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\tFromPosition: 1,\n\t\t\t},\n\t\t})\n\t\ttestPrint(t, from, to, edits, \"delete-and-insert\")\n\t})\n\tt.Run(\"insert-one\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst from = \"Hello, world!\\n\"\n\t\tconst to = \"Hello, world!\\nGoodbye, world!\\n\"\n\t\tedits := diffmyers.Diff(\n\t\t\tsplitLines(from),\n\t\t\tsplitLines(to),\n\t\t)\n\t\tassert.Equal(t, edits, []diffmyers.Edit{\n\t\t\t{\n\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\tFromPosition: 1,\n\t\t\t\tToPosition:   1,\n\t\t\t},\n\t\t})\n\t\ttestPrint(t, from, to, edits, \"insert\")\n\t})\n\tt.Run(\"delete-one\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst from = \"Hello, world!\\nGoodbye, world!\\n\"\n\t\tconst to = \"Hello, world!\\n\"\n\t\tedits := diffmyers.Diff(\n\t\t\tsplitLines(from),\n\t\t\tsplitLines(to),\n\t\t)\n\t\tassert.Equal(t, edits, []diffmyers.Edit{\n\t\t\t{\n\t\t\t\tKind:         diffmyers.EditKindDelete,\n\t\t\t\tFromPosition: 1,\n\t\t\t},\n\t\t})\n\t\ttestPrint(t, from, to, edits, \"delete\")\n\t})\n\tt.Run(\"create-file\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst from = \"\"\n\t\tconst to = \"Hello, world!\\n\"\n\t\tedits := diffmyers.Diff(\n\t\t\tsplitLines(from),\n\t\t\tsplitLines(to),\n\t\t)\n\t\tassert.Equal(t, edits, []diffmyers.Edit{\n\t\t\t{\n\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\tFromPosition: 0,\n\t\t\t\tToPosition:   0,\n\t\t\t},\n\t\t})\n\t\ttestPrint(t, from, to, edits, \"create\")\n\t})\n\tt.Run(\"remove\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst from = \"Hello, world!\\n\"\n\t\tconst to = \"\"\n\t\tedits := diffmyers.Diff(\n\t\t\tsplitLines(from),\n\t\t\tsplitLines(to),\n\t\t)\n\t\tassert.Equal(t, edits, []diffmyers.Edit{\n\t\t\t{\n\t\t\t\tKind:         diffmyers.EditKindDelete,\n\t\t\t\tFromPosition: 0,\n\t\t\t},\n\t\t})\n\t\ttestPrint(t, from, to, edits, \"remove\")\n\t})\n\tt.Run(\"equal\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst from = \"Hello, world!\\n\"\n\t\tconst to = \"Hello, world!\\n\"\n\t\tedits := diffmyers.Diff(\n\t\t\tsplitLines(from),\n\t\t\tsplitLines(to),\n\t\t)\n\t\tassert.Len(t, edits, 0)\n\t\ttestPrint(t, from, to, edits, \"equal\")\n\t})\n\t// The example from https://www.gnu.org/software/diffutils/manual/html_node/Sample-diff-Input.html\n\tt.Run(\"lao-tzu\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst lao = `The Way that can be told of is not the eternal Way;\nThe name that can be named is not the eternal name.\nThe Nameless is the origin of Heaven and Earth;\nThe Named is the mother of all things.\nTherefore let there always be non-being,\n  so we may see their subtlety,\nAnd let there always be being,\n  so we may see their outcome.\nThe two are the same,\nBut after they are produced,\n  they have different names.\n`\n\t\tconst tzu = `The Nameless is the origin of Heaven and Earth;\nThe named is the mother of all things.\n\nTherefore let there always be non-being,\n  so we may see their subtlety,\nAnd let there always be being,\n  so we may see their outcome.\nThe two are the same,\nBut after they are produced,\n  they have different names.\nThey both may be called deep and profound.\nDeeper and more profound,\nThe door of all subtleties!\n`\n\t\tedits := diffmyers.Diff(\n\t\t\tsplitLines(lao),\n\t\t\tsplitLines(tzu),\n\t\t)\n\t\tassert.Equal(t,\n\t\t\t[]diffmyers.Edit{\n\t\t\t\t{\n\t\t\t\t\tKind: diffmyers.EditKindDelete,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKind:         diffmyers.EditKindDelete,\n\t\t\t\t\tFromPosition: 1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKind:         diffmyers.EditKindDelete,\n\t\t\t\t\tFromPosition: 3,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\t\tFromPosition: 4,\n\t\t\t\t\tToPosition:   1,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\t\tFromPosition: 4,\n\t\t\t\t\tToPosition:   2,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\t\tFromPosition: 11,\n\t\t\t\t\tToPosition:   10,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\t\tFromPosition: 11,\n\t\t\t\t\tToPosition:   11,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tKind:         diffmyers.EditKindInsert,\n\t\t\t\t\tFromPosition: 11,\n\t\t\t\t\tToPosition:   12,\n\t\t\t\t},\n\t\t\t},\n\t\t\tedits,\n\t\t)\n\t\ttestPrint(t, lao, tzu, edits, \"lao-tzu\")\n\t})\n\n\tt.Run(\"first-line-prefix\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tfrom := \"syntax = \\\"proto3\\\";\\n\\npackage test;\\n\\nmessage Foo {\\n  string field1 = 1;\\n  string field2 = 2;\\n  string field3 = 3;\\n  string field4 = 4;\\n  string field5 = 5;\\n}\\n\"\n\t\tto := \"syntax = \\\"proto3\\\";\\n\\npackage test;\\n\\nmessage Foo {\\n  string field1 = 1;\\n  string field2 = 2;\\n  string field3 = 3;\\n  string field4 = 4;\\n  int32 field5 = 5;\\n}\\n\"\n\t\texpectedFirstLineOfOutput := \" syntax = \\\"proto3\\\";\"\n\t\tfromLines := splitLines(from)\n\t\ttoLines := splitLines(to)\n\t\tedits := diffmyers.Diff(\n\t\t\tfromLines,\n\t\t\ttoLines,\n\t\t)\n\t\tdiff, err := diffmyers.Print(\n\t\t\tfromLines,\n\t\t\ttoLines,\n\t\t\tedits,\n\t\t)\n\t\trequire.NoError(t, err)\n\t\tbefore, _, _ := bytes.Cut(diff, []byte(\"\\n\"))\n\n\t\tfirstLine := before\n\t\tactualFirstLine := string(firstLine)\n\t\trequire.Equal(t, expectedFirstLineOfOutput, actualFirstLine,\n\t\t\t\"First line of diff output should match expected format (single space prefix, no double space)\")\n\t\ttestPrint(t, from, to, edits, \"first-line-prefix\")\n\t})\n}\n\nfunc testPrint(t *testing.T, from, to string, edits []diffmyers.Edit, golden string) {\n\tt.Run(\"print\", func(t *testing.T) {\n\t\tdiff, err := diffmyers.Print(\n\t\t\tsplitLines(from),\n\t\t\tsplitLines(to),\n\t\t\tedits,\n\t\t)\n\t\trequire.NoError(t, err)\n\t\tgoldenFilePath := filepath.Join(\"testdata\", golden)\n\t\tif writeGoldenFiles {\n\t\t\trequire.NoError(t, os.WriteFile(goldenFilePath, diff, 0600))\n\t\t}\n\t\tdiffGolden, err := os.ReadFile(goldenFilePath)\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, string(diff), string(diffGolden))\n\t})\n}\n\nfunc splitLines(s string) [][]byte {\n\tlines := bytes.SplitAfter([]byte(s), []byte(\"\\n\"))\n\tif len(lines[len(lines)-1]) == 0 {\n\t\tlines = lines[:len(lines)-1]\n\t}\n\treturn lines\n}\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/create",
    "content": "@@ -1,0 +1,1 @@\n+Hello, world!\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/delete",
    "content": "@@ -1,2 +1,1 @@\n Hello, world!\n-Goodbye, world!\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/delete-and-insert",
    "content": "@@ -1,1 +1,1 @@\n-Hello, world!\n+Goodbye, world!\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/equal",
    "content": " Hello, world!\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/first-line-prefix",
    "content": " syntax = \"proto3\";\n \n package test;\n \n message Foo {\n   string field1 = 1;\n   string field2 = 2;\n   string field3 = 3;\n   string field4 = 4;\n@@ -10,1 +10,1 @@\n-  string field5 = 5;\n+  int32 field5 = 5;\n }\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/insert",
    "content": "@@ -1,1 +1,2 @@\n Hello, world!\n+Goodbye, world!\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/lao-tzu",
    "content": "@@ -1,11 +1,10 @@\n-The Way that can be told of is not the eternal Way;\n-The name that can be named is not the eternal name.\n The Nameless is the origin of Heaven and Earth;\n-The Named is the mother of all things.\n+The named is the mother of all things.\n+\n Therefore let there always be non-being,\n   so we may see their subtlety,\n And let there always be being,\n   so we may see their outcome.\n The two are the same,\n But after they are produced,\n   they have different names.\n@@ -12,0 +11,3 @@\n+They both may be called deep and profound.\n+Deeper and more profound,\n+The door of all subtleties!\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/testdata/remove",
    "content": "@@ -1,1 +1,0 @@\n-Hello, world!\n"
  },
  {
    "path": "private/pkg/diff/diffmyers/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage diffmyers\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/diff/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage diff\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/encoding/encoding.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 encoding provides encoding utilities.\npackage encoding\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n\n\t\"gopkg.in/yaml.v3\"\n)\n\n// UnmarshalJSONStrict unmarshals the data as JSON, returning a user error on failure.\n//\n// If the data length is 0, this is a no-op.\nfunc UnmarshalJSONStrict(data []byte, v any) error {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tjsonDecoder := json.NewDecoder(bytes.NewReader(data))\n\tjsonDecoder.DisallowUnknownFields()\n\treturn jsonDecoder.Decode(v)\n}\n\n// UnmarshalYAMLStrict unmarshals the data as YAML, returning a user error on failure.\n//\n// If the data length is 0, this is a no-op.\nfunc UnmarshalYAMLStrict(data []byte, v any) error {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tyamlDecoder := NewYAMLDecoderStrict(bytes.NewReader(data))\n\treturn updateYAMLTypeError(yamlDecoder.Decode(v))\n}\n\n// UnmarshalJSONOrYAMLStrict unmarshals the data as JSON or YAML in order, returning\n// a user error with both errors on failure.\n//\n// If the data length is 0, this is a no-op.\nfunc UnmarshalJSONOrYAMLStrict(data []byte, v any) error {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tif jsonErr := UnmarshalJSONStrict(data, v); jsonErr != nil {\n\t\tif yamlErr := UnmarshalYAMLStrict(data, v); yamlErr != nil {\n\t\t\treturn errors.New(jsonErr.Error() + \"\\n\" + yamlErr.Error())\n\t\t}\n\t}\n\treturn nil\n}\n\n// UnmarshalJSONNonStrict unmarshals the data as JSON, returning a user error on failure.\n//\n// If the data length is 0, this is a no-op.\nfunc UnmarshalJSONNonStrict(data []byte, v any) error {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tjsonDecoder := json.NewDecoder(bytes.NewReader(data))\n\treturn jsonDecoder.Decode(v)\n}\n\n// UnmarshalYAMLNonStrict unmarshals the data as YAML, returning a user error on failure.\n//\n// If the data length is 0, this is a no-op.\nfunc UnmarshalYAMLNonStrict(data []byte, v any) error {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tyamlDecoder := NewYAMLDecoderNonStrict(bytes.NewReader(data))\n\treturn updateYAMLTypeError(yamlDecoder.Decode(v))\n}\n\n// UnmarshalJSONOrYAMLNonStrict unmarshals the data as JSON or YAML in order, returning\n// a user error with both errors on failure.\n//\n// If the data length is 0, this is a no-op.\nfunc UnmarshalJSONOrYAMLNonStrict(data []byte, v any) error {\n\tif len(data) == 0 {\n\t\treturn nil\n\t}\n\tif jsonErr := UnmarshalJSONNonStrict(data, v); jsonErr != nil {\n\t\tif yamlErr := UnmarshalYAMLNonStrict(data, v); yamlErr != nil {\n\t\t\treturn errors.Join(jsonErr, yamlErr)\n\t\t}\n\t}\n\treturn nil\n}\n\n// GetJSONStringOrStringValue returns the JSON string for the RawMessage if the\n// RawMessage is a string, and the raw value as a string otherwise.\n//\n// If the RawMessage is empty, this returns \"\".\nfunc GetJSONStringOrStringValue(rawMessage json.RawMessage) string {\n\tif len(rawMessage) == 0 {\n\t\treturn \"\"\n\t}\n\tvar s string\n\tif err := json.Unmarshal(rawMessage, &s); err == nil {\n\t\treturn s\n\t}\n\treturn string(rawMessage)\n}\n\n// MarshalYAML marshals the given value into YAML.\nfunc MarshalYAML(v any) (_ []byte, retErr error) {\n\tbuffer := bytes.NewBuffer(nil)\n\tyamlEncoder := NewYAMLEncoder(buffer)\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, yamlEncoder.Close())\n\t}()\n\tif err := yamlEncoder.Encode(v); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buffer.Bytes(), nil\n}\n\n// NewYAMLEncoder creates a new YAML encoder reader from the Writer.\n// The encoder must be closed after use.\nfunc NewYAMLEncoder(writer io.Writer) *yaml.Encoder {\n\tyamlEncoder := yaml.NewEncoder(writer)\n\tyamlEncoder.SetIndent(2)\n\treturn yamlEncoder\n}\n\n// NewYAMLDecoderStrict creates a new YAML decoder from the reader.\nfunc NewYAMLDecoderStrict(reader io.Reader) *yaml.Decoder {\n\tyamlDecoder := yaml.NewDecoder(reader)\n\tyamlDecoder.KnownFields(true)\n\treturn yamlDecoder\n}\n\n// NewYAMLDecoderNonStrict creates a new YAML decoder from the reader.\nfunc NewYAMLDecoderNonStrict(reader io.Reader) *yaml.Decoder {\n\treturn yaml.NewDecoder(reader)\n}\n\n// InterfaceSliceOrStringToCommaSepString parses the input as a\n// slice or string into a comma separated string. This is commonly\n// used with JSON or YAML fields that need to support both string slices\n// and string literals.\nfunc InterfaceSliceOrStringToCommaSepString(in any) (string, error) {\n\tvalues, err := InterfaceSliceOrStringToStringSlice(in)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.Join(values, \",\"), nil\n}\n\n// InterfaceSliceOrStringToStringSlice converts the slice or string to a []string.\nfunc InterfaceSliceOrStringToStringSlice(in any) ([]string, error) {\n\tif in == nil {\n\t\treturn nil, nil\n\t}\n\tswitch t := in.(type) {\n\tcase string:\n\t\treturn []string{t}, nil\n\tcase []any:\n\t\tif len(t) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\t\tres := make([]string, len(t))\n\t\tfor i, elem := range t {\n\t\t\ts, ok := elem.(string)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"could not convert element %T to a string\", elem)\n\t\t\t}\n\t\t\tres[i] = s\n\t\t}\n\t\treturn res, nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"could not interpret %T as string or string slice\", in)\n\t}\n}\n\n// *** PRIVATE ***\n\nfunc updateYAMLTypeError(err error) error {\n\tif err == nil {\n\t\treturn nil\n\t}\n\tvar yamlTypeError *yaml.TypeError\n\tif errors.As(err, &yamlTypeError) {\n\t\tfor i, errString := range yamlTypeError.Errors {\n\t\t\tyamlTypeError.Errors[i] = replaceAfter(\n\t\t\t\treplaceAfter(\n\t\t\t\t\terrString,\n\t\t\t\t\t\"already set in type\",\n\t\t\t\t\t\"already set\",\n\t\t\t\t),\n\t\t\t\t\"not found in type\",\n\t\t\t\t\"not found\",\n\t\t\t)\n\t\t}\n\t\treturn yamlTypeError\n\t}\n\treturn err\n}\n\nfunc replaceAfter(s string, substitute string, replace string) string {\n\tif before, _, ok := strings.Cut(s, substitute); ok {\n\t\treturn before + replace\n\t}\n\treturn s\n}\n"
  },
  {
    "path": "private/pkg/encoding/encoding_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 encoding\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestInterfaceSliceOrStringToCommaSepString(t *testing.T) {\n\tt.Parallel()\n\ttestInterfaceSliceOrStringToCommaSepString(t, \"mystring\", \"mystring\")\n\ttestInterfaceSliceOrStringToCommaSepString(\n\t\tt,\n\t\t[]any{\n\t\t\tany(\"mystring\"),\n\t\t\tany(\"mystring2\"),\n\t\t},\n\t\t\"mystring,mystring2\",\n\t)\n\ttestInterfaceSliceOrStringToCommaSepString(t, nil, \"\")\n\n\t_, err := InterfaceSliceOrStringToCommaSepString(1)\n\trequire.Error(t, err)\n}\n\nfunc testInterfaceSliceOrStringToCommaSepString(t *testing.T, in any, expected string) {\n\tv, err := InterfaceSliceOrStringToCommaSepString(in)\n\trequire.NoError(t, err)\n\trequire.Equal(t, expected, v)\n}\n"
  },
  {
    "path": "private/pkg/encoding/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage encoding\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/filelock/filelock.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 filelock\n\nimport (\n\t\"context\"\n\t\"time\"\n)\n\nconst (\n\t// DefaultLockTimeout is the default lock timeout.\n\tDefaultLockTimeout = 3 * time.Second\n\t// DefaultLockRetryDelay is the default lock retry delay.\n\tDefaultLockRetryDelay = 200 * time.Millisecond\n)\n\n// Unlocker unlocks a file lock.\ntype Unlocker interface {\n\tUnlock() error\n}\n\n// Lock locks a file lock.\n//\n// Use in cases where you need a lock for a specific system file, such as in testing,\n// otherwise use a Locker to manage your file locks.\nfunc Lock(ctx context.Context, filePath string, options ...LockOption) (Unlocker, error) {\n\treturn lock(ctx, filePath, options...)\n}\n\n// RLock read-locks a file lock.\n//\n// Use in cases where you need a lock for a specific system file, such as in testing,\n// otherwise use a Locker to manage your file locks.\nfunc RLock(ctx context.Context, filePath string, options ...LockOption) (Unlocker, error) {\n\treturn rlock(ctx, filePath, options...)\n}\n\n// Locker provides file locks.\ntype Locker interface {\n\t// Lock locks a file lock within the root directory of the Locker.\n\t//\n\t// The given path must be normalized and relative.\n\tLock(ctx context.Context, path string, options ...LockOption) (Unlocker, error)\n\t// RLock read-locks a file lock within the root directory of the Locker.\n\t//\n\t// The given path must be normalized and relative.\n\tRLock(ctx context.Context, path string, options ...LockOption) (Unlocker, error)\n}\n\n// NewLocker returns a new Locker for the given root directory path.\n//\n// The root directory path should generally be a data directory path.\n// The root directory must exist.\nfunc NewLocker(rootDirPath string, options ...LockerOption) (Locker, error) {\n\treturn newLocker(rootDirPath, options...)\n}\n\n// LockerOption is an option for a new Locker.\ntype LockerOption func(*lockerOptions)\n\n// LockerWithLockTimeout sets the default lock timeout for the Locker.\n//\n// If Lock/RLock is called with LockWithTimeout, that will override this default timeout.\n// If this is not set, the default lock timeout is set to DefaultLockTimeout.\nfunc LockerWithLockTimeout(lockTimeout time.Duration) LockerOption {\n\treturn func(lockerOptions *lockerOptions) {\n\t\tlockerOptions.lockTimeout = lockTimeout\n\t}\n}\n\n// LockerWithLockRetryDelay sets the default lock retry delay for the Locker.\n//\n// If Lock/RLock is called with LockWithRetryDelay, that will override the default lock\n// retry delay.\n// If this is not set, the default lock retry delay is set to DefaultLockRetryDelay.\nfunc LockerWithLockRetryDelay(lockRetryDelay time.Duration) LockerOption {\n\treturn func(lockerOptions *lockerOptions) {\n\t\tlockerOptions.lockRetryDelay = lockRetryDelay\n\t}\n}\n\n// LockOption is an option for lock.\ntype LockOption func(*lockOptions)\n\n// LockWithTimeout returns a new LockOption that sets the lock timeout.\n//\n// Lock returns error if the lock cannot be acquired after this amount of time.\n// If this is set to 0, the lock will never timeout.\nfunc LockWithTimeout(timeout time.Duration) LockOption {\n\treturn func(lockOptions *lockOptions) {\n\t\tlockOptions.timeout = timeout\n\t}\n}\n\n// LockWithRetryDelay returns a new LockOption that sets the lock retry delay.\n//\n// Lock will try to lock on this delay up until the lock timeout.\nfunc LockWithRetryDelay(retryDelay time.Duration) LockOption {\n\treturn func(lockOptions *lockOptions) {\n\t\tlockOptions.retryDelay = retryDelay\n\t}\n}\n\n// NewNopLocker returns a new no-op Locker.\nfunc NewNopLocker() Locker {\n\treturn newNopLocker()\n}\n"
  },
  {
    "path": "private/pkg/filelock/filelock_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 filelock\n\nimport (\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGlobalBasic(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\ttempDirPath := t.TempDir()\n\tfilePath := filepath.Join(tempDirPath, \"path/to/lock\")\n\tunlocker, err := Lock(ctx, filePath)\n\trequire.NoError(t, err)\n\t_, err = Lock(ctx, filePath, LockWithTimeout(100*time.Millisecond), LockWithRetryDelay(10*time.Millisecond))\n\trequire.Error(t, err)\n\trequire.NoError(t, unlocker.Unlock())\n\tunlocker, err = Lock(ctx, filePath, LockWithTimeout(100*time.Millisecond), LockWithRetryDelay(10*time.Millisecond))\n\trequire.NoError(t, err)\n\trequire.NoError(t, unlocker.Unlock())\n\tunlocker, err = RLock(ctx, filePath)\n\trequire.NoError(t, err)\n\tunlocker2, err := RLock(ctx, filePath)\n\trequire.NoError(t, err)\n\t_, err = Lock(ctx, filePath, LockWithTimeout(100*time.Millisecond), LockWithRetryDelay(10*time.Millisecond))\n\trequire.Error(t, err)\n\trequire.NoError(t, unlocker.Unlock())\n\trequire.NoError(t, unlocker2.Unlock())\n}\n\nfunc TestLockerBasic(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\ttempDirPath := t.TempDir()\n\tfilePath := \"path/to/lock\"\n\tlocker, err := NewLocker(tempDirPath)\n\trequire.NoError(t, err)\n\tunlocker, err := locker.Lock(ctx, filePath)\n\trequire.NoError(t, err)\n\t_, err = locker.Lock(ctx, filePath, LockWithTimeout(100*time.Millisecond), LockWithRetryDelay(10*time.Millisecond))\n\trequire.Error(t, err)\n\trequire.NoError(t, unlocker.Unlock())\n\tunlocker, err = locker.Lock(ctx, filePath, LockWithTimeout(100*time.Millisecond), LockWithRetryDelay(10*time.Millisecond))\n\trequire.NoError(t, err)\n\trequire.NoError(t, unlocker.Unlock())\n\tunlocker, err = locker.RLock(ctx, filePath)\n\trequire.NoError(t, err)\n\tunlocker2, err := locker.RLock(ctx, filePath)\n\trequire.NoError(t, err)\n\t_, err = locker.Lock(ctx, filePath, LockWithTimeout(100*time.Millisecond), LockWithRetryDelay(10*time.Millisecond))\n\trequire.Error(t, err)\n\trequire.NoError(t, unlocker.Unlock())\n\trequire.NoError(t, unlocker2.Unlock())\n\tabsolutePath := \"/not/normalized/and/validated\"\n\tif runtime.GOOS == \"windows\" {\n\t\tabsolutePath = \"C:\\\\not\\\\normalized\\\\and\\\\validated\"\n\t}\n\t_, err = locker.Lock(ctx, absolutePath)\n\trequire.Error(t, err)\n}\n"
  },
  {
    "path": "private/pkg/filelock/lock.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 filelock\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"time\"\n\n\t\"github.com/gofrs/flock\"\n)\n\nfunc lock(\n\tctx context.Context,\n\tfilePath string,\n\toptions ...LockOption,\n) (Unlocker, error) {\n\treturn lockForFunc(\n\t\tctx,\n\t\tfilePath,\n\t\t(*flock.Flock).TryLockContext,\n\t\toptions...,\n\t)\n}\n\nfunc rlock(\n\tctx context.Context,\n\tfilePath string,\n\toptions ...LockOption,\n) (Unlocker, error) {\n\treturn lockForFunc(\n\t\tctx,\n\t\tfilePath,\n\t\t(*flock.Flock).TryRLockContext,\n\t\toptions...,\n\t)\n}\n\nfunc lockForFunc(\n\tctx context.Context,\n\tfilePath string,\n\ttryLockContextFunc func(*flock.Flock, context.Context, time.Duration) (bool, error),\n\toptions ...LockOption,\n) (Unlocker, error) {\n\tlockOptions := newLockOptions()\n\tfor _, option := range options {\n\t\toption(lockOptions)\n\t}\n\t// mkdir is an atomic operation\n\tif err := os.MkdirAll(filepath.Dir(filePath), 0755); err != nil {\n\t\treturn nil, err\n\t}\n\tvar cancel context.CancelFunc\n\tif lockOptions.timeout != 0 {\n\t\tctx, cancel = context.WithTimeout(ctx, lockOptions.timeout)\n\t\tdefer cancel()\n\t}\n\tflock := flock.New(filePath)\n\tlocked, err := tryLockContextFunc(flock, ctx, lockOptions.retryDelay)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not get file lock %q: %w\", filePath, err)\n\t}\n\tif !locked {\n\t\treturn nil, fmt.Errorf(\"could not lock %q\", filePath)\n\t}\n\treturn flock, nil\n}\n\ntype lockOptions struct {\n\ttimeout    time.Duration\n\tretryDelay time.Duration\n}\n\nfunc newLockOptions() *lockOptions {\n\treturn &lockOptions{\n\t\ttimeout:    DefaultLockTimeout,\n\t\tretryDelay: DefaultLockRetryDelay,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/filelock/locker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 filelock\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"slices\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\ntype locker struct {\n\trootDirPath    string\n\tlockTimeout    time.Duration\n\tlockRetryDelay time.Duration\n}\n\nfunc newLocker(rootDirPath string, options ...LockerOption) (*locker, error) {\n\t// allow symlinks\n\tfileInfo, err := os.Stat(normalpath.Unnormalize(rootDirPath))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !fileInfo.IsDir() {\n\t\treturn nil, fmt.Errorf(\"%q is not a directory\", rootDirPath)\n\t}\n\tlockerOptions := newLockerOptions()\n\tfor _, option := range options {\n\t\toption(lockerOptions)\n\t}\n\treturn &locker{\n\t\t// do not validate - allow anything including absolute paths and jumping context\n\t\trootDirPath:    normalpath.Normalize(rootDirPath),\n\t\tlockTimeout:    lockerOptions.lockTimeout,\n\t\tlockRetryDelay: lockerOptions.lockRetryDelay,\n\t}, nil\n}\n\nfunc (l *locker) Lock(ctx context.Context, path string, options ...LockOption) (Unlocker, error) {\n\tif err := validatePath(path); err != nil {\n\t\treturn nil, err\n\t}\n\toptions = slices.Concat(\n\t\t[]LockOption{\n\t\t\tLockWithTimeout(l.lockTimeout),\n\t\t\tLockWithRetryDelay(l.lockRetryDelay),\n\t\t},\n\t\toptions, // Any additional options set will be applied last\n\t)\n\treturn lock(\n\t\tctx,\n\t\tnormalpath.Unnormalize(normalpath.Join(l.rootDirPath, path)),\n\t\toptions...,\n\t)\n}\n\nfunc (l *locker) RLock(ctx context.Context, path string, options ...LockOption) (Unlocker, error) {\n\tif err := validatePath(path); err != nil {\n\t\treturn nil, err\n\t}\n\toptions = slices.Concat(\n\t\t[]LockOption{\n\t\t\tLockWithTimeout(l.lockTimeout),\n\t\t\tLockWithRetryDelay(l.lockRetryDelay),\n\t\t},\n\t\toptions, // Any additional options set will be applied last\n\t)\n\treturn rlock(\n\t\tctx,\n\t\tnormalpath.Unnormalize(normalpath.Join(l.rootDirPath, path)),\n\t\toptions...,\n\t)\n}\n\nfunc validatePath(path string) error {\n\tnormalPath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif path != normalPath {\n\t\t// just extra safety\n\t\treturn fmt.Errorf(\"expected file lock path %q to be equal to normalized path %q\", path, normalPath)\n\t}\n\treturn nil\n}\n\ntype lockerOptions struct {\n\tlockTimeout    time.Duration\n\tlockRetryDelay time.Duration\n}\n\nfunc newLockerOptions() *lockerOptions {\n\treturn &lockerOptions{\n\t\tlockTimeout:    DefaultLockTimeout,\n\t\tlockRetryDelay: DefaultLockRetryDelay,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/filelock/nop_locker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 filelock\n\nimport (\n\t\"context\"\n)\n\ntype nopLocker struct{}\n\nfunc newNopLocker() *nopLocker {\n\treturn &nopLocker{}\n}\n\nfunc (l *nopLocker) Lock(ctx context.Context, path string, options ...LockOption) (Unlocker, error) {\n\treturn newNopUnlocker(), nil\n}\n\nfunc (l *nopLocker) RLock(ctx context.Context, path string, options ...LockOption) (Unlocker, error) {\n\treturn newNopUnlocker(), nil\n}\n"
  },
  {
    "path": "private/pkg/filelock/nop_unlocker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 filelock\n\ntype nopUnlocker struct{}\n\nfunc newNopUnlocker() *nopUnlocker {\n\treturn &nopUnlocker{}\n}\n\nfunc (l *nopUnlocker) Unlock() error {\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/filelock/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage filelock\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/git/branch.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\ntype branch struct {\n\tbranch string\n}\n\nfunc newBranch(name string) *branch {\n\treturn &branch{\n\t\tbranch: name,\n\t}\n}\n\nfunc (r *branch) cloneBranch() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.branch\n}\n\nfunc (r branch) checkout() string {\n\treturn \"\"\n}\n\nfunc (r *branch) MarshalJSON() ([]byte, error) {\n\treturn []byte(`\"` + r.cloneBranch() + `\"`), nil\n}\n\nfunc (r *branch) String() string {\n\treturn r.cloneBranch()\n}\n"
  },
  {
    "path": "private/pkg/git/cloner.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"strconv\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xlog/xslog\"\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/tmp\"\n)\n\ntype cloner struct {\n\tlogger            *slog.Logger\n\tstorageosProvider storageos.Provider\n\toptions           ClonerOptions\n}\n\nfunc newCloner(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\toptions ClonerOptions,\n) *cloner {\n\treturn &cloner{\n\t\tlogger:            logger,\n\t\tstorageosProvider: storageosProvider,\n\t\toptions:           options,\n\t}\n}\n\nfunc (c *cloner) CloneToBucket(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\turl string,\n\tdepth uint32,\n\twriteBucket storage.WriteBucket,\n\toptions CloneToBucketOptions,\n) (retErr error) {\n\tdefer xslog.DebugProfile(c.logger)()\n\n\tvar err error\n\tswitch {\n\tcase strings.HasPrefix(url, \"http://\"),\n\t\tstrings.HasPrefix(url, \"https://\"),\n\t\tstrings.HasPrefix(url, \"ssh://\"),\n\t\tstrings.HasPrefix(url, \"git://\"),\n\t\tstrings.HasPrefix(url, \"file://\"):\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid git url: %q\", url)\n\t}\n\n\tif depth == 0 {\n\t\treturn errors.New(\"depth must be > 0\")\n\t}\n\n\tdepthArg := strconv.Itoa(int(depth))\n\n\tenvContainer = app.NewEnvContainerWithOverrides(envContainer, map[string]string{\n\t\t// In the case where this is being run in an environment where GIT_DIR and GIT_INDEX_FILE\n\t\t// are set, e.g. within a submodule, we want to treat this as a stand-alone, non-bare\n\t\t// clone rather than interacting with an existing GIT_DIR and GIT_INDEX_FILE.\n\t\t// So we filter out GIT_DIR and GIT_INDEX_FILE from our environment variables.\n\t\t\"GIT_DIR\":        \"\",\n\t\t\"GIT_INDEX_FILE\": \"\",\n\t})\n\n\tbaseDir, err := tmp.NewDir(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, baseDir.Close())\n\t}()\n\n\tbuffer := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\t\"git\",\n\t\txexec.WithArgs(\"init\"),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\txexec.WithStderr(buffer),\n\t\txexec.WithDir(baseDir.Path()),\n\t); err != nil {\n\t\treturn newGitCommandError(err, buffer)\n\t}\n\n\tbuffer.Reset()\n\tif err := xexec.Run(\n\t\tctx,\n\t\t\"git\",\n\t\txexec.WithArgs(\"remote\", \"add\", \"origin\", url),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\txexec.WithStderr(buffer),\n\t\txexec.WithDir(baseDir.Path()),\n\t); err != nil {\n\t\treturn newGitCommandError(err, buffer)\n\t}\n\n\tvar gitConfigAuthArgs []string\n\tif strings.HasPrefix(url, \"https://\") {\n\t\t// These extraArgs MUST be first, as the -c flag potentially produced\n\t\t// is only a flag on the parent git command, not on git fetch.\n\t\textraArgs, err := c.getArgsForHTTPSCommand(envContainer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tgitConfigAuthArgs = append(gitConfigAuthArgs, extraArgs...)\n\t}\n\n\tif strings.HasPrefix(url, \"ssh://\") {\n\t\tenvContainer, err = c.getEnvContainerWithGitSSHCommand(envContainer)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Build the args for the fetch command.\n\tfetchArgs := []string{}\n\tfetchArgs = append(fetchArgs, gitConfigAuthArgs...)\n\tfetchArgs = append(\n\t\tfetchArgs,\n\t\t\"fetch\",\n\t\t\"--depth\", depthArg,\n\t\t// Required on branches matching the current branch of git init.\n\t\t\"--update-head-ok\",\n\t)\n\tif options.Filter != \"\" {\n\t\tfetchArgs = append(fetchArgs, \"--filter\", options.Filter)\n\t}\n\n\t// First, try to fetch the fetchRef directly. If the ref is not found, we\n\t// will try to fetch the fallback ref with a depth to allow resolving partial\n\t// refs locally. If the fetch fails, we will return an error.\n\tvar usedFallback bool\n\tfetchRef, fallbackRef, checkoutRef := getRefspecsForName(options.Name)\n\tbuffer.Reset()\n\tif err := xexec.Run(\n\t\tctx,\n\t\t\"git\",\n\t\txexec.WithArgs(append(fetchArgs, \"origin\", fetchRef)...),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\txexec.WithStderr(buffer),\n\t\txexec.WithDir(baseDir.Path()),\n\t); err != nil {\n\t\t// If the ref fetch failed, without a fallback, return the error.\n\t\tif fallbackRef == \"\" {\n\t\t\treturn newGitCommandError(err, buffer)\n\t\t}\n\t\t// Failed to fetch the ref directly, try to fetch the fallback ref.\n\t\tusedFallback = true\n\t\tbuffer.Reset()\n\t\tif err := xexec.Run(\n\t\t\tctx,\n\t\t\t\"git\",\n\t\t\txexec.WithArgs(append(fetchArgs, \"origin\", fallbackRef)...),\n\t\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\t\txexec.WithStderr(buffer),\n\t\t\txexec.WithDir(baseDir.Path()),\n\t\t); err != nil {\n\t\t\treturn newGitCommandError(err, buffer)\n\t\t}\n\t}\n\n\t// As a further optimization, if a filter is applied with a subdir, we run\n\t// a sparse checkout to reduce the size of the working directory.\n\tbuffer.Reset()\n\tif options.Filter != \"\" && options.SubDir != \"\" {\n\t\t// Set the subdir for sparse checkout.\n\t\tif err := xexec.Run(\n\t\t\tctx,\n\t\t\t\"git\",\n\t\t\txexec.WithArgs(append(gitConfigAuthArgs, \"sparse-checkout\", \"set\", options.SubDir)...),\n\t\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\t\txexec.WithStderr(buffer),\n\t\t\txexec.WithDir(baseDir.Path()),\n\t\t); err != nil {\n\t\t\treturn newGitCommandError(err, buffer)\n\t\t}\n\t}\n\n\t// Always checkout the FETCH_HEAD to populate the working directory.\n\t// This allows for referencing HEAD in checkouts.\n\tbuffer.Reset()\n\tif err := xexec.Run(\n\t\tctx,\n\t\t\"git\",\n\t\txexec.WithArgs(append(gitConfigAuthArgs, \"checkout\", \"--force\", \"FETCH_HEAD\")...),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\txexec.WithStderr(buffer),\n\t\txexec.WithDir(baseDir.Path()),\n\t); err != nil {\n\t\treturn newGitCommandError(err, buffer)\n\t}\n\t// Should checkout if the fallback was used or if the checkout ref is different\n\t// from the fetch ref.\n\tif checkoutRef != \"\" && (usedFallback || checkoutRef != fetchRef) {\n\t\tbuffer.Reset()\n\t\tif err := xexec.Run(\n\t\t\tctx,\n\t\t\t\"git\",\n\t\t\txexec.WithArgs(append(gitConfigAuthArgs, \"checkout\", \"--force\", checkoutRef)...),\n\t\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\t\txexec.WithStderr(buffer),\n\t\t\txexec.WithDir(baseDir.Path()),\n\t\t); err != nil {\n\t\t\treturn newGitCommandError(err, buffer)\n\t\t}\n\t}\n\n\tif options.RecurseSubmodules {\n\t\tbuffer.Reset()\n\t\tif err := xexec.Run(\n\t\t\tctx,\n\t\t\t\"git\",\n\t\t\txexec.WithArgs(append(\n\t\t\t\tgitConfigAuthArgs,\n\t\t\t\t\"submodule\",\n\t\t\t\t\"update\",\n\t\t\t\t\"--init\",\n\t\t\t\t\"--recursive\",\n\t\t\t\t\"--force\",\n\t\t\t\t\"--depth\",\n\t\t\t\tdepthArg,\n\t\t\t)...),\n\t\t\txexec.WithEnv(app.Environ(envContainer)),\n\t\t\txexec.WithStderr(buffer),\n\t\t\txexec.WithDir(baseDir.Path()),\n\t\t); err != nil {\n\t\t\treturn newGitCommandError(err, buffer)\n\t\t}\n\t}\n\n\t// we do NOT want to read in symlinks\n\ttmpReadWriteBucket, err := c.storageosProvider.NewReadWriteBucket(baseDir.Path())\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar readBucket storage.ReadBucket = tmpReadWriteBucket\n\tif options.Matcher != nil {\n\t\treadBucket = storage.FilterReadBucket(readBucket, options.Matcher)\n\t}\n\t_, err = storage.Copy(ctx, readBucket, writeBucket)\n\treturn err\n}\n\nfunc (c *cloner) getArgsForHTTPSCommand(envContainer app.EnvContainer) ([]string, error) {\n\tif c.options.HTTPSUsernameEnvKey == \"\" || c.options.HTTPSPasswordEnvKey == \"\" {\n\t\treturn nil, nil\n\t}\n\thttpsUsernameSet := envContainer.Env(c.options.HTTPSUsernameEnvKey) != \"\"\n\thttpsPasswordSet := envContainer.Env(c.options.HTTPSPasswordEnvKey) != \"\"\n\tif !httpsUsernameSet {\n\t\tif httpsPasswordSet {\n\t\t\treturn nil, fmt.Errorf(\"%s set but %s not set\", c.options.HTTPSPasswordEnvKey, c.options.HTTPSUsernameEnvKey)\n\t\t}\n\t\treturn nil, nil\n\t}\n\tc.logger.Debug(\"git_credential_helper_override\")\n\treturn []string{\n\t\t\"-c\",\n\t\tfmt.Sprintf(\n\t\t\t// TODO: is this OK for windows/other platforms?\n\t\t\t// we might need an alternate flow where the binary has a sub-command to do this, and calls itself\n\t\t\t//\n\t\t\t// putting the variable name in this script, NOT the actual variable value\n\t\t\t// we do not want to store the variable on disk, ever\n\t\t\t// this is especially important if the program dies\n\t\t\t// note that this means i.e. HTTPS_PASSWORD=foo invoke_program does not work as\n\t\t\t// this variable needs to be in the actual global environment\n\t\t\t// TODO this is a mess\n\t\t\t\"credential.helper=!f(){ echo username=${%s}; echo password=${%s}; };f\",\n\t\t\tc.options.HTTPSUsernameEnvKey,\n\t\t\tc.options.HTTPSPasswordEnvKey,\n\t\t),\n\t}, nil\n}\n\nfunc (c *cloner) getEnvContainerWithGitSSHCommand(envContainer app.EnvContainer) (app.EnvContainer, error) {\n\tgitSSHCommand, err := c.getGitSSHCommand(envContainer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif gitSSHCommand != \"\" {\n\t\tc.logger.Debug(\"git_ssh_command_override\")\n\t\treturn app.NewEnvContainerWithOverrides(\n\t\t\tenvContainer,\n\t\t\tmap[string]string{\n\t\t\t\t\"GIT_SSH_COMMAND\": gitSSHCommand,\n\t\t\t},\n\t\t), nil\n\t}\n\treturn envContainer, nil\n}\n\nfunc (c *cloner) getGitSSHCommand(envContainer app.EnvContainer) (string, error) {\n\tsshKeyFilePath := envContainer.Env(c.options.SSHKeyFileEnvKey)\n\tsshKnownHostsFiles := envContainer.Env(c.options.SSHKnownHostsFilesEnvKey)\n\tif sshKeyFilePath == \"\" {\n\t\tif sshKnownHostsFiles != \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"%s set but %s not set\", c.options.SSHKnownHostsFilesEnvKey, c.options.SSHKeyFileEnvKey)\n\t\t}\n\t\treturn \"\", nil\n\t}\n\tif sshKnownHostsFilePaths := getSSHKnownHostsFilePaths(sshKnownHostsFiles); len(sshKnownHostsFilePaths) > 0 {\n\t\treturn fmt.Sprintf(\n\t\t\t`ssh -q -i \"%s\" -o \"IdentitiesOnly=yes\" -o \"UserKnownHostsFile=%s\"`,\n\t\t\tsshKeyFilePath,\n\t\t\tstrings.Join(sshKnownHostsFilePaths, \" \"),\n\t\t), nil\n\t}\n\t// we want to set StrictHostKeyChecking=no because the SSH key file variable was set, so\n\t// there is an ask to override the default ssh settings here\n\treturn fmt.Sprintf(\n\t\t`ssh -q -i \"%s\" -o \"IdentitiesOnly=yes\" -o \"UserKnownHostsFile=%s\" -o \"StrictHostKeyChecking=no\"`,\n\t\tsshKeyFilePath,\n\t\tapp.DevNullFilePath,\n\t), nil\n}\n\nfunc getSSHKnownHostsFilePaths(sshKnownHostsFiles string) []string {\n\tif sshKnownHostsFiles == \"\" {\n\t\treturn nil\n\t}\n\tvar filePaths []string\n\tfor filePath := range strings.SplitSeq(sshKnownHostsFiles, \":\") {\n\t\tfilePath = strings.TrimSpace(filePath)\n\t\tif filePath != \"\" {\n\t\t\tfilePaths = append(filePaths, filePath)\n\t\t}\n\t}\n\treturn filePaths\n}\n\n// getRefspecsForName returns the refs to fetch and checkout. A fallback ref is\n// used for partial refs. If the first fetch fails, the fallback ref is fetched\n// to allow resolving partial refs locally. The checkout ref is the ref to\n// checkout after the fetch.\nfunc getRefspecsForName(gitName Name) (fetchRef string, fallbackRef string, checkoutRef string) {\n\t// Default to fetching HEAD and checking out FETCH_HEAD.\n\tif gitName == nil {\n\t\treturn \"HEAD\", \"\", \"\"\n\t}\n\tcheckout, cloneBranch := gitName.checkout(), gitName.cloneBranch()\n\tif checkout != \"\" && cloneBranch != \"\" {\n\t\t// If a branch, tag, or commit is specified, we fetch the ref directly.\n\t\treturn createFetchRefSpec(cloneBranch), \"\", checkout\n\t} else if cloneBranch != \"\" {\n\t\t// If a branch is specified, we fetch the branch directly.\n\t\treturn cloneBranch, \"\", \"\"\n\t} else if checkout != \"\" && checkout != \"HEAD\" {\n\t\t// If a checkout ref is specified, we fetch the ref directly.\n\t\t// We fallback to fetching the HEAD to resolve partial refs.\n\t\t// We checkout the ref after the fetch if the fallback was used.\n\t\treturn checkout, \"HEAD\", checkout\n\t}\n\treturn \"HEAD\", \"\", \"\"\n}\n\n// createFetchRefSpec create a refspec to ensure a local reference is created\n// when fetching a branch or tag. This allows to checkout the ref with\n// `git checkout` even if the ref is remote tracking. For example:\n//\n//\t+origin/main:origin/main\nfunc createFetchRefSpec(fetchRef string) string {\n\treturn \"+\" + fetchRef + \":\" + fetchRef\n}\n\nfunc newGitCommandError(err error, buffer *bytes.Buffer) error {\n\treturn fmt.Errorf(\"%v\\n%v\", err, buffer.String())\n}\n"
  },
  {
    "path": "private/pkg/git/cmd/git-ls-files-unstaged/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main implements a file lister for git that lists unstaged files.\n//\n// See the documentation for git.Lister for more details.\npackage main\n\nimport (\n\t\"context\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n)\n\nfunc main() {\n\tapp.Main(context.Background(), run)\n}\n\nfunc run(ctx context.Context, container app.Container) error {\n\tfiles, err := git.NewLister().ListFilesAndUnstagedFiles(\n\t\tctx,\n\t\tcontainer,\n\t\tgit.ListFilesAndUnstagedFilesOptions{},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(files) > 0 {\n\t\tif _, err := container.Stdout().Write([]byte(strings.Join(files, \"\\n\") + \"\\n\")); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/git/cmd/git-ls-files-unstaged/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/git/git.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\nconst (\n\tgitCommand      = \"git\"\n\ttagsPrefix      = \"refs/tags/\"\n\theadsPrefix     = \"refs/heads/\"\n\tpseudoRefSuffix = \"^{}\"\n)\n\nvar (\n\t// ErrRemoteNotFound is returned from GetRemote when the specified remote name is not\n\t// found in the current git checkout.\n\tErrRemoteNotFound = errors.New(\"git remote not found\")\n\n\t// ErrInvalidGitCheckout is returned from CheckDirectoryIsValidGitCheckout when the\n\t// specified directory is not a valid git checkout.\n\tErrInvalidGitCheckout = errors.New(\"invalid git checkout\")\n\n\t// ErrInvalidRef is returned from IsValidRef if the ref does not exist in the\n\t// repository containing the given directory (or, if the directory is not\n\t// a valid git checkout).\n\tErrInvalidRef = errors.New(\"invalid git ref\")\n)\n\n// Name is a name identifiable by git.\ntype Name interface {\n\t// If cloneBranch returns a non-empty string, any clones will be performed with --branch set to the value.\n\tcloneBranch() string\n\t// If checkout returns a non-empty string, a checkout of the value will be performed after cloning.\n\tcheckout() string\n}\n\n// NewBranchName returns a new Name for the branch.\nfunc NewBranchName(branch string) Name {\n\treturn newBranch(branch)\n}\n\n// NewTagName returns a new Name for the tag.\nfunc NewTagName(tag string) Name {\n\treturn newBranch(tag)\n}\n\n// NewRefName returns a new Name for the ref.\nfunc NewRefName(ref string) Name {\n\treturn newRef(ref)\n}\n\n// NewRefNameWithBranch returns a new Name for the ref while setting branch as the clone target.\nfunc NewRefNameWithBranch(ref string, branch string) Name {\n\treturn newRefWithBranch(ref, branch)\n}\n\n// Cloner clones git repositories to buckets.\ntype Cloner interface {\n\t// CloneToBucket clones the repository to the bucket.\n\t//\n\t// The url must contain the scheme, including file:// if necessary.\n\t// depth must be > 0.\n\tCloneToBucket(\n\t\tctx context.Context,\n\t\tenvContainer app.EnvContainer,\n\t\turl string,\n\t\tdepth uint32,\n\t\twriteBucket storage.WriteBucket,\n\t\toptions CloneToBucketOptions,\n\t) error\n}\n\n// CloneToBucketOptions are options for Clone.\ntype CloneToBucketOptions struct {\n\tMatcher           storage.Matcher\n\tName              Name\n\tRecurseSubmodules bool\n\tSubDir            string\n\tFilter            string\n}\n\n// NewCloner returns a new Cloner.\nfunc NewCloner(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\toptions ClonerOptions,\n) Cloner {\n\treturn newCloner(logger, storageosProvider, options)\n}\n\n// ClonerOptions are options for a new Cloner.\ntype ClonerOptions struct {\n\tHTTPSUsernameEnvKey      string\n\tHTTPSPasswordEnvKey      string\n\tSSHKeyFileEnvKey         string\n\tSSHKnownHostsFilesEnvKey string\n}\n\n// Lister lists files in git repositories.\ntype Lister interface {\n\t// ListFilesAndUnstagedFiles lists all files checked into git except those that\n\t// were deleted, and also lists unstaged files.\n\t//\n\t// This does not list unstaged deleted files\n\t// This does not list unignored files that were not added.\n\t// This ignores regular files.\n\t//\n\t// This is used for situations like license headers where we want all the\n\t// potential git files during development.\n\t//\n\t// The returned paths will be unnormalized.\n\t//\n\t// This is the equivalent of doing:\n\t//\n\t//\tcomm -23 \\\n\t//\t\t<(git ls-files --cached --modified --others --no-empty-directory --exclude-standard | sort -u | grep -v -e IGNORE_PATH1 -e IGNORE_PATH2) \\\n\t//\t\t<(git ls-files --deleted | sort -u)\n\tListFilesAndUnstagedFiles(\n\t\tctx context.Context,\n\t\tenvContainer app.EnvStdioContainer,\n\t\toptions ListFilesAndUnstagedFilesOptions,\n\t) ([]string, error)\n}\n\n// NewLister returns a new Lister.\nfunc NewLister() Lister {\n\treturn newLister()\n}\n\n// ListFilesAndUnstagedFilesOptions are options for ListFilesAndUnstagedFiles.\ntype ListFilesAndUnstagedFilesOptions struct {\n\t// IgnorePathRegexps are regexes of paths to ignore.\n\t//\n\t// These must be unnormalized in the manner of the local OS that the Lister\n\t// is being applied to.\n\tIgnorePathRegexps []*regexp.Regexp\n}\n\n// Remote represents a Git remote and provides associated metadata.\ntype Remote interface {\n\t// Name of the remote (e.g. \"origin\")\n\tName() string\n\t// HEADBranch is the name of the HEAD branch of the remote.\n\tHEADBranch() string\n\t// Hostname is the host name parsed from the remote URL. If the remote is an unknown\n\t// kind, then this may be an empty string.\n\tHostname() string\n\t// RepositoryPath is the path to the repository based on the remote URL. If the remote\n\t// is an unknown kind, then this may be an empty string.\n\tRepositoryPath() string\n\t// SourceControlURL makes the best effort to construct a user-facing source control url\n\t// given a commit sha string based on the remote source, and available hostname and\n\t// repository path information.\n\t//\n\t// If the remote hostname contains bitbucket (e.g. bitbucket.mycompany.com or bitbucket.org),\n\t// we construct the source control URL as:\n\t//\n\t//   https://<hostname>/<repository-path>/commits/<git-commit-sha>\n\t//\n\t// If the remote hostname contains github (e.g. github.mycompany.com or github.com), we\n\t// construct the source control URL as:\n\t//   https://<hostname>/repository-path>/commit/git-commit-sha>\n\t//\n\t// If the remote hostname contains gitlab (e.g. gitlab.mycompany.com or gitlab.com), we\n\t// construct the source control URL as:\n\t//   https://<hostname>/repository-path>/commit/git-commit-sha>\n\t//\n\t// If the remote is unknown and/or no hostname/repository path information is available,\n\t// this will return an empty string.\n\t//\n\t// This does not do any validation against the gitCommitSha provided.\n\tSourceControlURL(gitCommitSha string) string\n\n\tisRemote()\n}\n\n// GetRemote gets the Git remote based on the given remote name.\n// In order to query the remote information, we need to pass in the env with appropriate\n// permissions.\nfunc GetRemote(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n\tname string,\n) (Remote, error) {\n\treturn getRemote(ctx, envContainer, dir, name)\n}\n\n// CheckDirectoryIsValidGitCheckout runs a simple git rev-parse. In the case where the\n// directory is not a valid git checkout (e.g. the directory is not a git repository or\n// the directory does not exist), this will return a 128. We handle that and return an\n// ErrInvalidGitCheckout to the user.\nfunc CheckDirectoryIsValidGitCheckout(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n) error {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"rev-parse\"),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\tvar exitErr *exec.ExitError\n\t\tif errors.As(err, &exitErr) {\n\t\t\tif exitErr.ExitCode() == 128 {\n\t\t\t\treturn fmt.Errorf(\"dir %s: %w\", dir, ErrInvalidGitCheckout)\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// CheckForUncommittedGitChanges checks if there are any uncommitted and/or unchecked\n// changes from git based on the given directory.\nfunc CheckForUncommittedGitChanges(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n) ([]string, error) {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tvar modifiedFiles []string\n\tenviron := app.Environ(envContainer)\n\t// Unstaged changes\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"diff\", \"--name-only\"),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(environ),\n\t); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get unstaged changes: %w: %s\", err, stderr.String())\n\t}\n\tmodifiedFiles = append(modifiedFiles, getAllTrimmedLinesFromBuffer(stdout)...)\n\n\tstdout = bytes.NewBuffer(nil)\n\tstderr = bytes.NewBuffer(nil)\n\t// Staged changes\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"diff\", \"--name-only\", \"--cached\"),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(environ),\n\t); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get staged changes: %w: %s\", err, stderr.String())\n\t}\n\n\tmodifiedFiles = append(modifiedFiles, getAllTrimmedLinesFromBuffer(stdout)...)\n\treturn modifiedFiles, nil\n}\n\n// GetCurrentHEADGitCommit returns the current HEAD commit based on the given directory.\nfunc GetCurrentHEADGitCommit(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n) (string, error) {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"rev-parse\", \"HEAD\"),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\treturn \"\", fmt.Errorf(\"failed to get current HEAD commit: %w: %s\", err, stderr.String())\n\t}\n\treturn strings.TrimSpace(stdout.String()), nil\n}\n\n// GetRefsForGitCommitAndRemote returns all refs pointing to a given commit based on the\n// given remote for the given directory. Querying the remote for refs information requires\n// passing the environment for permissions.\nfunc GetRefsForGitCommitAndRemote(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n\tremote string,\n\tgitCommitSha string,\n) ([]string, error) {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"ls-remote\", \"--heads\", \"--tags\", remote),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get refs for remote %s: %w: %s\", remote, err, stderr.String())\n\t}\n\tscanner := bufio.NewScanner(stdout)\n\tvar refs []string\n\tfor scanner.Scan() {\n\t\tline := strings.TrimSpace(scanner.Text())\n\t\tif ref, found := strings.CutPrefix(line, gitCommitSha); found {\n\t\t\tref = strings.TrimSpace(ref)\n\t\t\tif tag, isTag := strings.CutPrefix(ref, tagsPrefix); isTag {\n\t\t\t\t// Remove the ^{} suffix for pseudo-ref tags\n\t\t\t\ttag, _ = strings.CutSuffix(tag, pseudoRefSuffix)\n\t\t\t\trefs = append(refs, tag)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif branch, isBranchHead := strings.CutPrefix(ref, headsPrefix); isBranchHead {\n\t\t\t\trefs = append(refs, branch)\n\t\t\t}\n\t\t}\n\t}\n\treturn refs, nil\n}\n\n// IsValidRef returns whether or not ref is a valid git ref for the git\n// repository that contains dir. Returns nil if the ref is valid.\nfunc IsValidRef(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir, ref string,\n) error {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"rev-parse\", \"--verify\", ref),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\tvar exitErr *exec.ExitError\n\t\tif errors.As(err, &exitErr) {\n\t\t\tif exitErr.ExitCode() == 128 {\n\t\t\t\treturn fmt.Errorf(\"could not find ref %s in %s: %w\", ref, dir, ErrInvalidRef)\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// ReadFileAtRef will read the file at path rolled back to the given ref, if\n// it exists at that ref.\n//\n// Specifically, this will take path, and find the associated .git directory\n// (and thus, repository root) associated with that path, if any. It will then\n// look up the commit corresponding to ref in that git directory, and within\n// that commit, the blob corresponding to that path (relative to the repository\n// root).\nfunc ReadFileAtRef(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tpath, ref string,\n) ([]byte, error) {\n\torig := path\n\tpath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Find a directory with a .git directory.\n\tdir := filepath.Dir(path)\n\tfor {\n\t\t_, err := os.Stat(filepath.Join(dir, \".git\"))\n\t\tif err == nil {\n\t\t\tbreak\n\t\t} else if errors.Is(err, os.ErrNotExist) {\n\t\t\tparent := filepath.Dir(dir)\n\t\t\tif parent == dir {\n\t\t\t\treturn nil, fmt.Errorf(\"could not find .git directory for %s: %w\", orig, ErrInvalidGitCheckout)\n\t\t\t}\n\t\t\tdir = parent\n\t\t} else {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// This gives us the name of the blob we're looking for.\n\trel, err := filepath.Rel(dir, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Call git show to show us the file we want.\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(ctx, gitCommand,\n\t\txexec.WithArgs(\"--no-pager\", \"show\", ref+\":\"+rel),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get text of file %s at ref %s: %w: %s\", orig, ref, err, stderr.String())\n\t}\n\n\treturn stdout.Bytes(), nil\n}\n\nfunc getAllTrimmedLinesFromBuffer(buffer *bytes.Buffer) []string {\n\tscanner := bufio.NewScanner(buffer)\n\tvar lines []string\n\tfor scanner.Scan() {\n\t\tlines = append(lines, strings.TrimSpace(scanner.Text()))\n\t}\n\treturn lines\n}\n"
  },
  {
    "path": "private/pkg/git/git_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"net/http/cgi\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/slogtestext\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGitCloner(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\tcontainer, err := app.NewContainerForOS()\n\trequire.NoError(t, err)\n\toriginDir, workDir := createGitDirs(ctx, t, container)\n\n\tt.Run(\"default\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 2\", string(content), \"expected the commit on local-branch to be checked out\")\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.True(t, errors.Is(err, fs.ErrNotExist))\n\t\t_, err = storage.ReadPath(ctx, readBucket, \"submodule/sub.proto\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"default_submodule\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{recurseSubmodules: true})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 2\", string(content), \"expected the commit on local-branch to be checked out\")\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.True(t, errors.Is(err, fs.ErrNotExist))\n\t\tcontent, err = storage.ReadPath(ctx, readBucket, \"submodule/sub.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// submodule\", string(content))\n\t})\n\n\tt.Run(\"main\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewBranchName(\"main\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=main\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewRefName(\"main\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"origin/main\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewBranchName(\"origin/main\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 3\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=origin/main\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewRefName(\"origin/main\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 3\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"origin/remote-branch\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewBranchName(\"origin/remote-branch\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 4\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"remote-tag\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewTagName(\"remote-tag\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 4\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=remote-tag\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewRefName(\"remote-tag\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 4\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"tag=remote-annotated-tag\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewTagName(\"remote-annotated-tag\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 4\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=remote-annotated-tag\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewRefName(\"remote-annotated-tag\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 4\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"branch_and_main_ref\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefNameWithBranch(\"HEAD~\", \"main\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 0\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"branch=main,ref=main~1\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefNameWithBranch(\"main~\", \"main\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 0\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"branch_and_ref\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefNameWithBranch(\"local-branch~\", \"local-branch\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"ref=HEAD\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewRefName(\"HEAD\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 2\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.True(t, errors.Is(err, fs.ErrNotExist))\n\t})\n\tt.Run(\"ref=HEAD~\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefName(\"HEAD~\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=HEAD~1\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefName(\"HEAD~1\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=HEAD^\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefName(\"HEAD^\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.True(t, errors.Is(err, fs.ErrNotExist))\n\t})\n\tt.Run(\"ref=HEAD^1\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefName(\"HEAD^1\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"ref=<commit>\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trevParseBytes, err := runStdout(ctx, container, \"git\", \"-C\", workDir, \"rev-parse\", \"HEAD~\")\n\t\trequire.NoError(t, err)\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefName(strings.TrimSpace(string(revParseBytes)))})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=<partial-commit>\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trevParseBytes, err := runStdout(ctx, container, \"git\", \"-C\", workDir, \"rev-parse\", \"HEAD~\")\n\t\trequire.NoError(t, err)\n\t\tpartialRef := NewRefName(strings.TrimSpace(string(revParseBytes))[:8])\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 8, name: partialRef})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 1\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"ref=<commit>,branch=origin/remote-branch\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trevParseBytes, err := runStdout(ctx, container, \"git\", \"-C\", originDir, \"rev-parse\", \"remote-branch~\")\n\t\trequire.NoError(t, err)\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefNameWithBranch(strings.TrimSpace(string(revParseBytes)), \"origin/remote-branch\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 3\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"ref=<partial-commit>,branch=origin/remote-branch\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\trevParseBytes, err := runStdout(ctx, container, \"git\", \"-C\", originDir, \"rev-parse\", \"remote-branch~\")\n\t\trequire.NoError(t, err)\n\t\tpartialRef := strings.TrimSpace(string(revParseBytes))[:8]\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{depth: 2, name: NewRefNameWithBranch(partialRef, \"origin/remote-branch\")})\n\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"a.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 3\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"filter=tree:0\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewBranchName(\"main\"), filter: \"tree:0\"})\n\n\t\t_, err := readBucket.Stat(ctx, \"a.proto\")\n\t\tassert.NoError(t, err)\n\t\t_, err = readBucket.Stat(ctx, \"c/c.proto\")\n\t\tassert.NoError(t, err)\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"b/b.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 0\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"filter=blob:none\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewBranchName(\"main\"), filter: \"tree:0\"})\n\n\t\t_, err := readBucket.Stat(ctx, \"a.proto\")\n\t\tassert.NoError(t, err)\n\t\t_, err = readBucket.Stat(ctx, \"c/c.proto\")\n\t\tassert.NoError(t, err)\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"b/b.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 0\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\tt.Run(\"filter=tree:0,subdir=b\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket := readBucketForName(ctx, t, workDir, readBucketForNameOptions{name: NewBranchName(\"main\"), filter: \"tree:0\", subDir: \"b\"})\n\n\t\t// Only root and the b directory should be present. It is a sparse checkout.\n\t\t_, err := readBucket.Stat(ctx, \"a.proto\")\n\t\tassert.NoError(t, err)\n\t\t_, err = readBucket.Stat(ctx, \"c/c.proto\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t\tcontent, err := storage.ReadPath(ctx, readBucket, \"b/b.proto\")\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, \"// commit 0\", string(content))\n\t\t_, err = readBucket.Stat(ctx, \"nonexistent\")\n\t\tassert.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n}\n\ntype readBucketForNameOptions struct {\n\tdepth             uint32\n\tname              Name\n\trecurseSubmodules bool\n\tsubDir            string\n\tfilter            string\n}\n\nfunc readBucketForName(ctx context.Context, t *testing.T, path string, options readBucketForNameOptions) storage.ReadBucket {\n\tt.Helper()\n\tstorageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\tcloner := NewCloner(slogtestext.NewLogger(t), storageosProvider, ClonerOptions{})\n\tenvContainer, err := app.NewEnvContainerForOS()\n\trequire.NoError(t, err)\n\n\tdepth := options.depth\n\tif depth == 0 {\n\t\tdepth = 1\n\t}\n\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\terr = cloner.CloneToBucket(\n\t\tctx,\n\t\tenvContainer,\n\t\t\"file://\"+filepath.Join(path, \".git\"),\n\t\tdepth,\n\t\treadWriteBucket,\n\t\tCloneToBucketOptions{\n\t\t\tMatcher:           storage.MatchPathExt(\".proto\"),\n\t\t\tName:              options.name,\n\t\t\tRecurseSubmodules: options.recurseSubmodules,\n\t\t\tSubDir:            options.subDir,\n\t\t\tFilter:            options.filter,\n\t\t},\n\t)\n\trequire.NoError(t, err)\n\treturn readWriteBucket\n}\n\nfunc createGitDirs(\n\tctx context.Context,\n\tt *testing.T,\n\tcontainer app.EnvStdioContainer,\n) (string, string) {\n\ttmpDir := t.TempDir()\n\n\tsubmodulePath := filepath.Join(tmpDir, \"submodule\")\n\trequire.NoError(t, os.MkdirAll(submodulePath, os.ModePerm))\n\trunCommand(ctx, t, container, \"git\", \"-C\", submodulePath, \"init\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", submodulePath, \"config\", \"user.email\", \"tests@buf.build\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", submodulePath, \"config\", \"user.name\", \"Buf go tests\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", submodulePath, \"checkout\", \"-b\", \"main\")\n\trequire.NoError(t, os.WriteFile(filepath.Join(submodulePath, \"sub.proto\"), []byte(\"// submodule\"), 0600))\n\trunCommand(ctx, t, container, \"git\", \"-C\", submodulePath, \"add\", \"sub.proto\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", submodulePath, \"commit\", \"-m\", \"commit 0\")\n\n\tgitExecPathBytes, err := runStdout(ctx, container, \"git\", \"--exec-path\")\n\trequire.NoError(t, err)\n\tgitExecPath := strings.TrimSpace(string(gitExecPathBytes))\n\t// In Golang 1.22, the behavior of \"os/exec\" was changed so that LookPath is no longer called\n\t// in some cases. This preserves the behavior.\n\t// https://cs.opensource.google/go/go/+/f7f266c88598398dcf32b448bcea2100e1702630:src/os/exec/exec.go;dlc=07d4de9312aef72d1bd7427316a2ac21b83e4a20\n\t// https://tip.golang.org/doc/go1.22 (search for \"LookPath\")\n\tgitHTTPBackendPath, err := exec.LookPath(filepath.Join(gitExecPath, \"git-http-backend\"))\n\trequire.NoError(t, err)\n\tt.Logf(\"gitHttpBackendPath=%q submodulePath=%q\", gitHTTPBackendPath, submodulePath)\n\t// https://git-scm.com/docs/git-http-backend#_description\n\tf, err := os.Create(filepath.Join(submodulePath, \".git\", \"git-daemon-export-ok\"))\n\trequire.NoError(t, err)\n\trequire.NoError(t, f.Close())\n\tserver := httptest.NewServer(\n\t\t&cgi.Handler{\n\t\t\tPath: gitHTTPBackendPath,\n\t\t\tDir:  submodulePath,\n\t\t\tEnv: append(\n\t\t\t\tapp.Environ(container),\n\t\t\t\tfmt.Sprintf(\"GIT_PROJECT_ROOT=%s\", submodulePath),\n\t\t\t),\n\t\t\tStderr: container.Stderr(),\n\t\t},\n\t)\n\tt.Cleanup(server.Close)\n\tsubmodulePath = server.URL\n\n\toriginPath := filepath.Join(tmpDir, \"origin\")\n\trequire.NoError(t, os.MkdirAll(originPath, 0777))\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"init\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"config\", \"user.email\", \"tests@buf.build\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"config\", \"user.name\", \"Buf go tests\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"checkout\", \"-b\", \"main\")\n\trequire.NoError(t, os.WriteFile(filepath.Join(originPath, \"a.proto\"), []byte(\"// commit 0\"), 0600))\n\trequire.NoError(t, os.MkdirAll(filepath.Join(originPath, \"b\"), 0777))\n\trequire.NoError(t, os.WriteFile(filepath.Join(originPath, \"b\", \"b.proto\"), []byte(\"// commit 0\"), 0600))\n\trequire.NoError(t, os.MkdirAll(filepath.Join(originPath, \"c\"), 0777))\n\trequire.NoError(t, os.WriteFile(filepath.Join(originPath, \"c\", \"c.proto\"), []byte(\"// commit 0\"), 0600))\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"add\", \"a.proto\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"add\", \"b/b.proto\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"add\", \"c/c.proto\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"commit\", \"-m\", \"commit 0\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"submodule\", \"add\", submodulePath, \"submodule\")\n\trequire.NoError(t, os.WriteFile(filepath.Join(originPath, \"a.proto\"), []byte(\"// commit 1\"), 0600))\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"add\", \"a.proto\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"commit\", \"-m\", \"commit 1\")\n\n\tworkPath := filepath.Join(tmpDir, \"workdir\")\n\trunCommand(ctx, t, container, \"git\", \"clone\", originPath, workPath)\n\trunCommand(ctx, t, container, \"git\", \"-C\", workPath, \"config\", \"user.email\", \"tests@buf.build\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", workPath, \"config\", \"user.name\", \"Buf go tests\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", workPath, \"checkout\", \"-b\", \"local-branch\")\n\trequire.NoError(t, os.WriteFile(filepath.Join(workPath, \"a.proto\"), []byte(\"// commit 2\"), 0600))\n\trunCommand(ctx, t, container, \"git\", \"-C\", workPath, \"commit\", \"-a\", \"-m\", \"commit 2\")\n\n\trequire.NoError(t, os.WriteFile(filepath.Join(originPath, \"a.proto\"), []byte(\"// commit 3\"), 0600))\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"add\", \"a.proto\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"commit\", \"-m\", \"commit 3\")\n\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"checkout\", \"-b\", \"remote-branch\")\n\trequire.NoError(t, os.WriteFile(filepath.Join(originPath, \"a.proto\"), []byte(\"// commit 4\"), 0600))\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"add\", \"a.proto\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"commit\", \"-m\", \"commit 4\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"tag\", \"remote-tag\", \"--no-sign\")\n\trunCommand(ctx, t, container, \"git\", \"-C\", originPath, \"tag\", \"-a\", \"remote-annotated-tag\", \"-m\", \"annotated tag\")\n\n\trunCommand(ctx, t, container, \"git\", \"-C\", workPath, \"fetch\", \"origin\")\n\treturn originPath, workPath\n}\n\nfunc runCommand(\n\tctx context.Context,\n\tt *testing.T,\n\tcontainer app.EnvStdioContainer,\n\tname string,\n\targs ...string,\n) {\n\tt.Helper()\n\toutput, err := runStdout(ctx, container, name, args...)\n\tif err != nil {\n\t\tvar exitErr *exec.ExitError\n\t\tvar stdErr []byte\n\t\tif errors.As(err, &exitErr) {\n\t\t\tstdErr = exitErr.Stderr\n\t\t}\n\t\tassert.FailNow(t, err.Error(), \"stdout: %s\\nstderr: %s\", output, stdErr)\n\t}\n}\n"
  },
  {
    "path": "private/pkg/git/lister.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"os\"\n\t\"regexp\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"buf.build/go/standard/xslices\"\n\t\"buf.build/go/standard/xstrings\"\n)\n\ntype lister struct{}\n\nfunc newLister() *lister {\n\treturn &lister{}\n}\n\nfunc (l *lister) ListFilesAndUnstagedFiles(\n\tctx context.Context,\n\tcontainer app.EnvStdioContainer,\n\toptions ListFilesAndUnstagedFilesOptions,\n) ([]string, error) {\n\tallFilesOutput, err := runStdout(\n\t\tctx,\n\t\tcontainer,\n\t\t\"git\",\n\t\t\"ls-files\",\n\t\t\"--cached\",\n\t\t\"--modified\",\n\t\t\"--others\",\n\t\t\"--exclude-standard\",\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdeletedFilesOutput, err := runStdout(\n\t\tctx,\n\t\tcontainer,\n\t\t\"git\",\n\t\t\"ls-files\",\n\t\t\"--deleted\",\n\t)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn xslices.ToUniqueSorted(\n\t\tfilterNonRegularFiles(\n\t\t\tstringSliceExceptMatches(\n\t\t\t\tstringSliceExcept(\n\t\t\t\t\t// This may not work in all Windows scenarios as we only split on \"\\n\" but\n\t\t\t\t\t// this is no worse than we previously had.\n\t\t\t\t\txstrings.SplitTrimLinesNoEmpty(string(allFilesOutput)),\n\t\t\t\t\txstrings.SplitTrimLinesNoEmpty(string(deletedFilesOutput)),\n\t\t\t\t),\n\t\t\t\toptions.IgnorePathRegexps,\n\t\t\t),\n\t\t),\n\t), nil\n}\n\n// stringSliceExcept returns all elements in source that are not in except.\nfunc stringSliceExcept(source []string, except []string) []string {\n\texceptMap := xslices.ToStructMap(except)\n\tresult := make([]string, 0, len(source))\n\tfor _, s := range source {\n\t\tif _, ok := exceptMap[s]; !ok {\n\t\t\tresult = append(result, s)\n\t\t}\n\t}\n\treturn result\n}\n\n// stringSliceExceptMatches returns all elements in source that do not match\n// any of the regexps.\nfunc stringSliceExceptMatches(source []string, regexps []*regexp.Regexp) []string {\n\tif len(regexps) == 0 {\n\t\treturn source\n\t}\n\tresult := make([]string, 0, len(source))\n\tfor _, s := range source {\n\t\tif !matchesAny(s, regexps) {\n\t\t\tresult = append(result, s)\n\t\t}\n\t}\n\treturn result\n}\n\n// matchesAny returns true if any of regexps match.\nfunc matchesAny(s string, regexps []*regexp.Regexp) bool {\n\tfor _, regexp := range regexps {\n\t\tif regexp.MatchString(s) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// filterNonRegularFiles returns all regular files.\n//\n// This does an os.Stat call, so the files must exist for this to work.\n// Given our usage here, this is true by the time this function is called.\nfunc filterNonRegularFiles(files []string) []string {\n\tfilteredFiles := make([]string, 0, len(files))\n\tfor _, file := range files {\n\t\tif fileInfo, err := os.Stat(file); err == nil && fileInfo.Mode().IsRegular() {\n\t\t\tfilteredFiles = append(filteredFiles, file)\n\t\t}\n\t}\n\treturn filteredFiles\n}\n\nfunc runStdout(ctx context.Context, container app.EnvStdioContainer, name string, args ...string) ([]byte, error) {\n\tbuffer := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tname,\n\t\txexec.WithArgs(args...),\n\t\txexec.WithEnv(app.Environ(container)),\n\t\txexec.WithStdin(container.Stdin()),\n\t\txexec.WithStdout(buffer),\n\t\txexec.WithStderr(container.Stderr()),\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buffer.Bytes(), nil\n}\n"
  },
  {
    "path": "private/pkg/git/ref.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\ntype ref struct {\n\tref string\n}\n\nfunc newRef(name string) *ref {\n\treturn &ref{\n\t\tref: name,\n\t}\n}\n\nfunc (r *ref) cloneBranch() string {\n\treturn \"\"\n}\n\nfunc (r *ref) checkout() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.ref\n}\n\nfunc (r *ref) MarshalJSON() ([]byte, error) {\n\treturn []byte(`\"` + r.checkout() + `\"`), nil\n}\n\nfunc (r *ref) String() string {\n\treturn r.checkout()\n}\n"
  },
  {
    "path": "private/pkg/git/ref_branch.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\nimport \"encoding/json\"\n\ntype refWithBranch struct {\n\tref    string\n\tbranch string\n}\n\nfunc newRefWithBranch(ref string, branch string) *refWithBranch {\n\treturn &refWithBranch{\n\t\tref:    ref,\n\t\tbranch: branch,\n\t}\n}\n\nfunc (r *refWithBranch) cloneBranch() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.branch\n}\n\nfunc (r *refWithBranch) checkout() string {\n\tif r == nil {\n\t\treturn \"\"\n\t}\n\treturn r.ref\n}\n\nfunc (r *refWithBranch) MarshalJSON() ([]byte, error) {\n\treturn json.Marshal(struct {\n\t\tRef    string\n\t\tBranch string\n\t}{\n\t\tRef:    r.checkout(),\n\t\tBranch: r.cloneBranch(),\n\t})\n}\n\nfunc (r *refWithBranch) String() string {\n\treturn r.checkout()\n}\n"
  },
  {
    "path": "private/pkg/git/remote.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/standard/xos/xexec\"\n)\n\nconst (\n\tbitBucketHostname        = \"bitbucket\"\n\tgithubHostname           = \"github\"\n\tgitlabHostname           = \"gitlab\"\n\tgitSuffix                = \".git\"\n\tgithubRemoteURLFormat    = \"https://%s%s/commit/%s\"\n\tgitlabRemoteURLFormat    = \"https://%s%s/commit/%s\"\n\tbitBucketRemoteURLFormat = \"https://%s%s/commits/%s\"\n\n\t// remoteKindUnknown is a remote to a unknown Git source.\n\tremoteKindUnknown remoteKind = iota + 1\n\t// RemoteKindGitHub is a remote to a GitHub Git source.\n\tremoteKindGitHub\n\t// RemoteKindGitLab is a remote to a GitLab Git source.\n\tremoteKindGitLab\n\t// RemoteKindBitBucket is a remote to a BitBucket Git source.\n\tremoteKindBitBucket\n)\n\n// remoteKind is the kind of remote based on Git source (e.g. GitHub, GitLab, BitBucket, etc.)\ntype remoteKind int\n\ntype remote struct {\n\tname           string\n\tkind           remoteKind\n\thostname       string\n\trepositoryPath string\n\theadBranch     string\n}\n\nfunc (r *remote) Name() string {\n\treturn r.name\n}\n\nfunc (r *remote) Hostname() string {\n\treturn r.hostname\n}\n\nfunc (r *remote) RepositoryPath() string {\n\treturn r.repositoryPath\n}\n\nfunc (r *remote) HEADBranch() string {\n\treturn r.headBranch\n}\n\nfunc (r *remote) isRemote() {}\n\nfunc (r *remote) SourceControlURL(gitCommitSha string) string {\n\tswitch r.kind {\n\tcase remoteKindBitBucket:\n\t\treturn fmt.Sprintf(\n\t\t\tbitBucketRemoteURLFormat,\n\t\t\tr.Hostname(),\n\t\t\tr.RepositoryPath(),\n\t\t\tgitCommitSha,\n\t\t)\n\tcase remoteKindGitHub:\n\t\treturn fmt.Sprintf(\n\t\t\tgithubRemoteURLFormat,\n\t\t\tr.Hostname(),\n\t\t\tr.RepositoryPath(),\n\t\t\tgitCommitSha,\n\t\t)\n\tcase remoteKindGitLab:\n\t\treturn fmt.Sprintf(\n\t\t\tgitlabRemoteURLFormat,\n\t\t\tr.Hostname(),\n\t\t\tr.RepositoryPath(),\n\t\t\tgitCommitSha,\n\t\t)\n\t}\n\t// Unknown remote kind, we return an empty URL.\n\treturn \"\"\n}\n\nfunc newRemote(\n\tname string,\n\tkind remoteKind,\n\thostname string,\n\trepositoryPath string,\n\theadBranch string,\n) *remote {\n\treturn &remote{\n\t\tname:           name,\n\t\tkind:           kind,\n\t\thostname:       hostname,\n\t\trepositoryPath: repositoryPath,\n\t\theadBranch:     headBranch,\n\t}\n}\n\nfunc getRemote(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n\tname string,\n) (*remote, error) {\n\tif err := validateRemoteExists(ctx, envContainer, dir, name); err != nil {\n\t\treturn nil, err\n\t}\n\thostname, repositoryPath, err := getRemoteURLMetadata(\n\t\tctx,\n\t\tenvContainer,\n\t\tdir,\n\t\tname,\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get remote URL metadata: %w\", err)\n\t}\n\theadBranch, err := getRemoteHEADBranch(ctx, envContainer, dir, name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get remote HEAD branch: %w\", err)\n\t}\n\treturn newRemote(\n\t\tname,\n\t\tgetRemoteKindFromHostname(hostname),\n\t\thostname,\n\t\trepositoryPath,\n\t\theadBranch,\n\t), nil\n}\n\nfunc validateRemoteExists(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n\tname string,\n) error {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"ls-remote\", \"--exit-code\", name),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\tvar exitErr *exec.ExitError\n\t\tif errors.As(err, &exitErr) {\n\t\t\tif exitErr.ProcessState.ExitCode() == 128 {\n\t\t\t\treturn fmt.Errorf(\"remote %s: %w\", name, ErrRemoteNotFound)\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc getRemoteURLMetadata(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n\tremote string,\n) (string, string, error) {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\t// We use `git config --get remote.<remote>.url` instead of `git remote get-url\n\t\t// since it is more specific to the checkout.\n\t\txexec.WithArgs(\"config\", \"--get\", fmt.Sprintf(\"remote.%s.url\", remote)),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\thostname, repositoryPath := parseRawRemoteURL(strings.TrimSpace(stdout.String()))\n\treturn hostname, repositoryPath, nil\n}\n\nfunc parseRawRemoteURL(rawURL string) (string, string) {\n\tparsed, err := url.Parse(rawURL)\n\tif err != nil {\n\t\t// Attempt to check if this is a scp-style URL.\n\t\tparsed = parseSCPLikeURL(rawURL)\n\t}\n\t// If we are unable to parse host and path information from the URL, then we return\n\t// no information.\n\tif parsed == nil {\n\t\treturn \"\", \"\"\n\t}\n\treturn parsed.Hostname(), strings.TrimSuffix(parsed.Path, gitSuffix)\n}\n\nfunc parseSCPLikeURL(rawURL string) *url.URL {\n\t// https://git-scm.com/docs/git-clone#_git_urls\n\t// An alternative scp-like syntax may also be used with the ssh protocol:\n\t//   [<user>@]<host>:/<path-to-git-repo>\n\t//\n\t// To parse this, we use a regexp from cmd/go/internal/vcs/vcs.go\n\t// https://cs.opensource.google/go/go/+/refs/tags/go1.21.10:src/cmd/go/internal/vcs/vcs.go;l=281-283\n\tscpSyntaxRegexp := regexp.MustCompile(`^(\\w+)@([\\w.-]+):(.*)$`)\n\tif match := scpSyntaxRegexp.FindStringSubmatch(rawURL); match != nil {\n\t\t// The host and path are the only relevant URL components to our use case.\n\t\treturn &url.URL{\n\t\t\tHost: match[2],\n\t\t\tPath: \"/\" + match[3], // scp-like URLs do not have the leading slash\n\t\t}\n\t}\n\treturn nil\n}\n\n// getRemoteHEADBranch returns the HEAD branch based on the given remote and given\n// directory. Querying the remote for the HEAD branch requires passing the\n// environment for permissions.\nfunc getRemoteHEADBranch(\n\tctx context.Context,\n\tenvContainer app.EnvContainer,\n\tdir string,\n\tremote string,\n) (string, error) {\n\tstdout := bytes.NewBuffer(nil)\n\tstderr := bytes.NewBuffer(nil)\n\tif err := xexec.Run(\n\t\tctx,\n\t\tgitCommand,\n\t\txexec.WithArgs(\"remote\", \"show\", remote),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t\txexec.WithDir(dir),\n\t\txexec.WithEnv(app.Environ(envContainer)),\n\t); err != nil {\n\t\treturn \"\", err\n\t}\n\tscanner := bufio.NewScanner(stdout)\n\tfor scanner.Scan() {\n\t\tline := strings.TrimSpace(scanner.Text())\n\t\tif branch, isHEADBranch := strings.CutPrefix(line, \"HEAD branch:\"); isHEADBranch {\n\t\t\treturn strings.TrimSpace(branch), nil\n\t\t}\n\t}\n\treturn \"\", errors.New(\"no HEAD branch information found\")\n}\n\nfunc getRemoteKindFromHostname(hostname string) remoteKind {\n\tif strings.Contains(hostname, bitBucketHostname) {\n\t\treturn remoteKindBitBucket\n\t}\n\tif strings.Contains(hostname, githubHostname) {\n\t\treturn remoteKindGitHub\n\t}\n\tif strings.Contains(hostname, gitlabHostname) {\n\t\treturn remoteKindGitLab\n\t}\n\treturn remoteKindUnknown\n}\n"
  },
  {
    "path": "private/pkg/git/remote_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 git\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGetSourceControlURL(t *testing.T) {\n\tt.Parallel()\n\tt.Run(\"ssh, bitbucket\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"ssh://user@bitbucket.org:1234/user/repo.git\")\n\t\trequire.Equal(t, \"bitbucket.org\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n\tt.Run(\"ssh, github\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"ssh://git@github.com/user/repo.git\")\n\t\trequire.Equal(t, \"github.com\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n\tt.Run(\"scp-like ssh, github\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"git@github.com:user/repo.git\")\n\t\trequire.Equal(t, \"github.com\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n\tt.Run(\"ssh, gitlab\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"ssh://user@gitlab.mycompany.com:1234/user/repo.git\")\n\t\trequire.Equal(t, \"gitlab.mycompany.com\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n\tt.Run(\"scp-like ssh, gitlab\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"git@gitlab.com:user/repo.git\")\n\t\trequire.Equal(t, \"gitlab.com\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n\tt.Run(\"https, bitbucket\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"https://bitbucket.mycompany.com/user/repo.git\")\n\t\trequire.Equal(t, \"bitbucket.mycompany.com\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n\tt.Run(\"https, github\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"https://github.mycompany.com:4321/user/repo.git\")\n\t\trequire.Equal(t, \"github.mycompany.com\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n\tt.Run(\"https, gitlab\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\thostname, repositoryPath := parseRawRemoteURL(\"https://gitlab.com/user/repo.git\")\n\t\trequire.Equal(t, \"gitlab.com\", hostname)\n\t\trequire.Equal(t, \"/user/repo\", repositoryPath)\n\t})\n}\n"
  },
  {
    "path": "private/pkg/git/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage git\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/github/githubtesting/archive_reader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 githubtesting\n\nimport (\n\t\"compress/gzip\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"net/http\"\n\t\"os\"\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/bufbuild/buf/private/pkg/filelock\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\n// since we are in testing, we care less about making sure this times out early\n// we have had some flaky tests based on this being too low, especially when\n// using the race detector\nconst filelockTimeout = 10 * time.Second\n\ntype archiveReader struct {\n\tlogger            *slog.Logger\n\tstorageosProvider storageos.Provider\n\thttpClient        *http.Client\n\tlock              sync.Mutex\n}\n\nfunc newArchiveReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n) *archiveReader {\n\treturn &archiveReader{\n\t\tlogger:            logger,\n\t\tstorageosProvider: storageosProvider,\n\t\thttpClient:        httpClient,\n\t}\n}\n\nfunc (a *archiveReader) GetArchive(\n\tctx context.Context,\n\toutputDirPath string,\n\towner string,\n\trepository string,\n\tref string,\n) (retErr error) {\n\ta.lock.Lock()\n\tdefer a.lock.Unlock()\n\n\toutputDirPath = normalpath.Unnormalize(outputDirPath)\n\n\t// creates a file in the same parent directory as outputDirPath\n\tunlocker, err := filelock.Lock(\n\t\tctx,\n\t\toutputDirPath+\".lock\",\n\t\tfilelock.LockWithTimeout(filelockTimeout),\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, unlocker.Unlock())\n\t}()\n\n\t// check if already exists, if so, do nothing\n\t// OK to use os.Stat here\n\tif fileInfo, err := os.Stat(outputDirPath); err == nil {\n\t\tif !fileInfo.IsDir() {\n\t\t\treturn fmt.Errorf(\"expected %s to be a directory\", outputDirPath)\n\t\t}\n\t\treturn nil\n\t}\n\trequest, err := http.NewRequestWithContext(\n\t\tctx,\n\t\t\"GET\",\n\t\tfmt.Sprintf(\"https://github.com/%s/%s/archive/%s.tar.gz\", owner, repository, ref),\n\t\tnil,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tresponse, err := a.httpClient.Do(request)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, response.Body.Close())\n\t}()\n\tif response.StatusCode != http.StatusOK {\n\t\treturn fmt.Errorf(\"expected HTTP status code %d to be %d\", response.StatusCode, http.StatusOK)\n\t}\n\tgzipReader, err := gzip.NewReader(response.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, gzipReader.Close())\n\t}()\n\tif err := os.MkdirAll(outputDirPath, 0755); err != nil {\n\t\treturn err\n\t}\n\t// do NOT want to read in symlinks\n\treadWriteBucket, err := a.storageosProvider.NewReadWriteBucket(normalpath.Normalize(outputDirPath))\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn storagearchive.Untar(\n\t\tctx,\n\t\tgzipReader,\n\t\treadWriteBucket,\n\t\tstoragearchive.UntarWithStripComponentCount(1),\n\t)\n}\n"
  },
  {
    "path": "private/pkg/github/githubtesting/githubtesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 githubtesting provides testing functionality for GitHub.\npackage githubtesting\n\nimport (\n\t\"context\"\n\t\"log/slog\"\n\t\"net/http\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\n// ArchiveReader reads GitHub archives.\ntype ArchiveReader interface {\n\t// GetArchive gets the GitHub archive and untars it to the output directory path.\n\t//\n\t// The root directory within the tarball is stripped.\n\t// If the directory already exists, this is a no-op.\n\t//\n\t// Uses file locking to make sure the no-op works properly across multiple process invocations,\n\t// which is needed for example with go test.\n\t// This is also thread-safe.\n\t//\n\t// Only use for testing.\n\tGetArchive(\n\t\tctx context.Context,\n\t\toutputDirPath string,\n\t\towner string,\n\t\trepository string,\n\t\tref string,\n\t) error\n}\n\n// NewArchiveReader returns a new ArchiveReader.\nfunc NewArchiveReader(\n\tlogger *slog.Logger,\n\tstorageosProvider storageos.Provider,\n\thttpClient *http.Client,\n) ArchiveReader {\n\treturn newArchiveReader(\n\t\tlogger,\n\t\tstorageosProvider,\n\t\thttpClient,\n\t)\n}\n"
  },
  {
    "path": "private/pkg/github/githubtesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage githubtesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/httpauth/env_authenticator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpauth\n\nimport (\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n)\n\ntype envAuthenticator struct {\n\tusernameKey string\n\tpasswordKey string\n}\n\nfunc newEnvAuthenticator(\n\tusernameKey string,\n\tpasswordKey string,\n) *envAuthenticator {\n\treturn &envAuthenticator{\n\t\tusernameKey: usernameKey,\n\t\tpasswordKey: passwordKey,\n\t}\n}\n\nfunc (a *envAuthenticator) SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error) {\n\treturn setBasicAuth(\n\t\trequest,\n\t\tenvContainer.Env(a.usernameKey),\n\t\tenvContainer.Env(a.passwordKey),\n\t\ta.usernameKey,\n\t\ta.passwordKey,\n\t)\n}\n"
  },
  {
    "path": "private/pkg/httpauth/httpauth.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpauth\n\nimport (\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n)\n\n// Authenticator adds authentication to request.\n//\n// This could be instead replaced with a http.RoundTripper workflow, however\n// this means we have to use the same http.Client, and we generally pass EnvContainers\n// to functions right now, and not building objects with EnvContainers, so this would\n// not fit in with the rest of this codebase. This should be re-evaluated though.\ntype Authenticator interface {\n\t// SetAuth sets authentication on the request.\n\t//\n\t// Returns true if authentication successfully set.\n\t// Does nothing and returns false if no authentication available for the given request.\n\t// Does nothing and returns false if the request scheme is not https.\n\tSetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error)\n}\n\n// NewEnvAuthenticator returns a new env Authenticator for the environment.\nfunc NewEnvAuthenticator(usernameKey string, passwordKey string) Authenticator {\n\treturn newEnvAuthenticator(\n\t\tusernameKey,\n\t\tpasswordKey,\n\t)\n}\n\n// NewNetrcAuthenticator returns a new netrc Authenticator.\nfunc NewNetrcAuthenticator() Authenticator {\n\treturn newNetrcAuthenticator()\n}\n\n// NewNopAuthenticator returns a new nop Authenticator.\n//\n// Always returns false and nil.\nfunc NewNopAuthenticator() Authenticator {\n\treturn newNopAuthenticator()\n}\n\n// NewMultiAuthenticator returns a new multi Authenticator.\n//\n// Stops on first matching SetAuth request.\nfunc NewMultiAuthenticator(authenticators ...Authenticator) Authenticator {\n\treturn newMultiAuthenticator(authenticators...)\n}\n"
  },
  {
    "path": "private/pkg/httpauth/multi_authenticator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpauth\n\nimport (\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n)\n\ntype multiAuthenticator struct {\n\tauthenticators []Authenticator\n}\n\nfunc newMultiAuthenticator(authenticators ...Authenticator) *multiAuthenticator {\n\treturn &multiAuthenticator{\n\t\tauthenticators: authenticators,\n\t}\n}\n\nfunc (a *multiAuthenticator) SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error) {\n\tswitch len(a.authenticators) {\n\tcase 0:\n\t\treturn false, nil\n\tcase 1:\n\t\treturn a.authenticators[0].SetAuth(envContainer, request)\n\tdefault:\n\t\tfor _, authenticator := range a.authenticators {\n\t\t\tok, err := authenticator.SetAuth(envContainer, request)\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t\treturn false, nil\n\t}\n}\n"
  },
  {
    "path": "private/pkg/httpauth/netrc_authenticator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpauth\n\nimport (\n\t\"errors\"\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/bufbuild/buf/private/pkg/netrc\"\n)\n\ntype netrcAuthenticator struct{}\n\nfunc newNetrcAuthenticator() *netrcAuthenticator {\n\treturn &netrcAuthenticator{}\n}\n\nfunc (a *netrcAuthenticator) SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error) {\n\tif request.URL == nil {\n\t\treturn false, errors.New(\"malformed request: no url\")\n\t}\n\tif request.URL.Host == \"\" {\n\t\treturn false, errors.New(\"malformed request: no url host\")\n\t}\n\tmachine, err := netrc.GetMachineForName(envContainer, request.URL.Host)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif machine == nil {\n\t\treturn false, nil\n\t}\n\treturn setBasicAuth(\n\t\trequest,\n\t\tmachine.Login(),\n\t\tmachine.Password(),\n\t\t\"netrc login for host\",\n\t\t\"netrc password for host\",\n\t)\n}\n"
  },
  {
    "path": "private/pkg/httpauth/nop_authenticator.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpauth\n\nimport (\n\t\"net/http\"\n\n\t\"buf.build/go/app\"\n)\n\ntype nopAuthenticator struct{}\n\nfunc newNopAuthenticator() *nopAuthenticator {\n\treturn &nopAuthenticator{}\n}\n\nfunc (*nopAuthenticator) SetAuth(app.EnvContainer, *http.Request) (bool, error) {\n\treturn false, nil\n}\n"
  },
  {
    "path": "private/pkg/httpauth/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage httpauth\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/httpauth/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpauth\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc setBasicAuth(\n\trequest *http.Request,\n\tusername string,\n\tpassword string,\n\tusernameKey string,\n\tpasswordKey string,\n) (bool, error) {\n\tif request.URL == nil {\n\t\treturn false, errors.New(\"malformed request: no url\")\n\t}\n\tif request.URL.Scheme == \"\" {\n\t\treturn false, errors.New(\"malformed request: no url scheme\")\n\t}\n\tif request.URL.Scheme != \"https\" {\n\t\treturn false, nil\n\t}\n\tif username != \"\" && password != \"\" {\n\t\trequest.SetBasicAuth(username, password)\n\t\treturn true, nil\n\t}\n\tif username == \"\" && password == \"\" {\n\t\treturn false, nil\n\t}\n\tif password == \"\" {\n\t\treturn false, fmt.Errorf(\"%s set but %s not set\", usernameKey, passwordKey)\n\t}\n\treturn false, fmt.Errorf(\"%s set but %s not set\", passwordKey, usernameKey)\n}\n"
  },
  {
    "path": "private/pkg/indent/indent.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 indent handles printing with indentation, mostly for debug purposes.\npackage indent\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// Printer prints with potential indents.\n//\n// Not thread-safe.\ntype Printer interface {\n\t// P prints the args with fmt.Sprint on a line after applying the current indent.\n\tP(args ...any)\n\t// Pf prints the format and args with fmt.Sprintf on a line after applying the current indent.\n\tPf(format string, args ...any)\n\t// In indents by one.\n\tIn()\n\t// Out unindents by one.\n\tOut()\n\t// String gets the resulting string representation.\n\t//\n\t// Returns error if there was an error during printing.\n\tString() (string, error)\n\t// Bytes gets the resulting bytes representation.\n\t//\n\t// Returns error if there was an error during printing.\n\tBytes() ([]byte, error)\n\n\tisPrinter()\n}\n\n// NewPrinter returns a new Printer.\nfunc NewPrinter(indent string) Printer {\n\treturn newPrinter(indent)\n}\n\n// *** PRIVATE ***\n\ntype printer struct {\n\tindent         string\n\tbuffer         *bytes.Buffer\n\tcurIndentCount int\n\terr            error\n}\n\nfunc newPrinter(indent string) *printer {\n\treturn &printer{\n\t\tindent:         indent,\n\t\tbuffer:         bytes.NewBuffer(nil),\n\t\tcurIndentCount: 0,\n\t\terr:            nil,\n\t}\n}\n\nfunc (p *printer) P(args ...any) {\n\tif p.err != nil {\n\t\treturn\n\t}\n\tp.pString(fmt.Sprint(args...))\n}\n\nfunc (p *printer) Pf(format string, args ...any) {\n\tif p.err != nil {\n\t\treturn\n\t}\n\tp.pString(fmt.Sprintf(format, args...))\n}\n\nfunc (p *printer) In() {\n\tif p.err != nil {\n\t\treturn\n\t}\n\tp.curIndentCount++\n}\n\nfunc (p *printer) Out() {\n\tif p.err != nil {\n\t\treturn\n\t}\n\tif p.curIndentCount <= 0 {\n\t\tp.err = syserror.New(\"printer indent count is 0 and Out called\")\n\t\treturn\n\t}\n\tp.curIndentCount--\n}\n\nfunc (p *printer) String() (string, error) {\n\tif p.err != nil {\n\t\treturn \"\", p.err\n\t}\n\treturn p.buffer.String(), nil\n}\n\nfunc (p *printer) Bytes() ([]byte, error) {\n\tif p.err != nil {\n\t\treturn nil, p.err\n\t}\n\treturn p.buffer.Bytes(), nil\n}\n\nfunc (p *printer) pString(s string) {\n\ts = strings.TrimSpace(s)\n\tif s == \"\" {\n\t\t_, _ = p.buffer.WriteRune('\\n')\n\t\treturn\n\t}\n\tif p.curIndentCount > 0 {\n\t\ts = strings.Repeat(p.indent, p.curIndentCount) + s\n\t}\n\ts = strings.TrimRightFunc(s, unicode.IsSpace)\n\tif strings.TrimSpace(s) != \"\" {\n\t\t_, _ = p.buffer.WriteString(s)\n\t}\n\t_, _ = p.buffer.WriteRune('\\n')\n}\n\nfunc (*printer) isPrinter() {}\n"
  },
  {
    "path": "private/pkg/indent/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage indent\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/iotesting/iotesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 iotesting\n\nimport (\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n)\n\n// NewWriter returns a new io.Writer that writes\n// to a testing logger.\nfunc NewWriter(tb testing.TB) io.Writer {\n\treturn &writer{\n\t\ttb: tb,\n\t}\n}\n\ntype writer struct {\n\ttb testing.TB\n}\n\nfunc (t *writer) Write(in []byte) (int, error) {\n\tt.tb.Helper()\n\tt.tb.Log(strings.TrimSpace(string(in)))\n\treturn len(in), nil\n}\n"
  },
  {
    "path": "private/pkg/iotesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage iotesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/licenseheader/cmd/license-header/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"github.com/bufbuild/buf/private/pkg/diff\"\n\t\"github.com/bufbuild/buf/private/pkg/git\"\n\t\"github.com/bufbuild/buf/private/pkg/licenseheader\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tuse = \"license-header\"\n\n\tcopyrightHolderFlagName = \"copyright-holder\"\n\tlicenseTypeFlagName     = \"license-type\"\n\tyearRangeFlagName       = \"year-range\"\n\tdiffFlagName            = \"diff\"\n\texitCodeFlagName        = \"exit-code\"\n\tignoreFlagName          = \"ignore\"\n\tignoreFlagShortName     = \"e\"\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse: use + \" files...\",\n\t\tRun: func(ctx context.Context, container app.Container) error {\n\t\t\treturn run(ctx, container, flags)\n\t\t},\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tLicenseType     string\n\tCopyrightHolder string\n\tYearRange       string\n\tDiff            bool\n\tExitCode        bool\n\tIgnore          []string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.LicenseType,\n\t\tlicenseTypeFlagName,\n\t\t\"\",\n\t\t\"The license type. Must be one of [none,apache,proprietary].\",\n\t)\n\t_ = appcmd.MarkFlagRequired(flagSet, licenseTypeFlagName)\n\tflagSet.StringVar(\n\t\t&f.CopyrightHolder,\n\t\tcopyrightHolderFlagName,\n\t\t\"\",\n\t\t\"The copyright holder. Required if license type is not none.\",\n\t)\n\tflagSet.StringVar(\n\t\t&f.YearRange,\n\t\tyearRangeFlagName,\n\t\t\"\",\n\t\t\"The year range. Required if license type is not none.\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.Diff,\n\t\tdiffFlagName,\n\t\tfalse,\n\t\t\"Print a diff instead of modifying the files.\",\n\t)\n\tflagSet.BoolVar(\n\t\t&f.ExitCode,\n\t\texitCodeFlagName,\n\t\tfalse,\n\t\tfmt.Sprintf(\"Exit with a non-zero exit code if a diff is present. Only valid with %s.\", diffFlagName),\n\t)\n\tflagSet.StringSliceVarP(\n\t\t&f.Ignore,\n\t\tignoreFlagName,\n\t\tignoreFlagShortName,\n\t\tnil,\n\t\t`File paths to ignore.\nThese are extended regexes in the style of egrep.\nIf a file matches any of these values, it will be ignored.\nOnly works if there are no arguments and license-header does its own search for files.`,\n\t)\n}\n\nfunc run(ctx context.Context, container app.Container, flags *flags) error {\n\tif flags.ExitCode && !flags.Diff {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"cannot specify %s without %s\", exitCodeFlagName, diffFlagName)\n\t}\n\tlicenseType, err := licenseheader.ParseLicenseType(flags.LicenseType)\n\tif err != nil {\n\t\treturn appcmd.NewInvalidArgumentErrorf(\"--%s: %v\", licenseTypeFlagName, err)\n\t}\n\tif licenseType != licenseheader.LicenseTypeNone {\n\t\tif flags.CopyrightHolder == \"\" {\n\t\t\treturn newRequiredFlagError(copyrightHolderFlagName)\n\t\t}\n\t\tif flags.YearRange == \"\" {\n\t\t\treturn newRequiredFlagError(yearRangeFlagName)\n\t\t}\n\t}\n\tfilenames, err := getFilenames(ctx, container, flags.Ignore)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, filename := range filenames {\n\t\tdata, err := os.ReadFile(filename)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tmodifiedData, err := licenseheader.Modify(\n\t\t\tlicenseType,\n\t\t\tflags.CopyrightHolder,\n\t\t\tflags.YearRange,\n\t\t\tfilename,\n\t\t\tdata,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !bytes.Equal(data, modifiedData) {\n\t\t\tif flags.Diff {\n\t\t\t\tdiffData, err := diff.Diff(\n\t\t\t\t\tctx,\n\t\t\t\t\tdata,\n\t\t\t\t\tmodifiedData,\n\t\t\t\t\tfilename,\n\t\t\t\t\tfilename,\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\t\t\t\tif len(diffData) > 0 {\n\t\t\t\t\tif _, err := os.Stdout.Write(diffData); err != nil {\n\t\t\t\t\t\treturn err\n\t\t\t\t\t}\n\t\t\t\t\tif flags.ExitCode {\n\t\t\t\t\t\treturn app.NewError(100, \"\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfileInfo, err := os.Stat(filename)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := os.WriteFile(filename, modifiedData, fileInfo.Mode().Perm()); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc getFilenames(\n\tctx context.Context,\n\tcontainer app.Container,\n\tignores []string,\n) ([]string, error) {\n\tif container.NumArgs() > 0 {\n\t\tif len(ignores) > 0 {\n\t\t\treturn nil, appcmd.NewInvalidArgumentErrorf(\"cannot use flag %q with any arguments\", ignoreFlagName)\n\t\t}\n\t\treturn app.Args(container), nil\n\t}\n\tignoreRegexps := make([]*regexp.Regexp, len(ignores))\n\tfor i, ignore := range ignores {\n\t\tignoreRegexp, err := regexp.CompilePOSIX(ignore)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tignoreRegexps[i] = ignoreRegexp\n\t}\n\treturn git.NewLister().ListFilesAndUnstagedFiles(\n\t\tctx,\n\t\tcontainer,\n\t\tgit.ListFilesAndUnstagedFilesOptions{\n\t\t\tIgnorePathRegexps: ignoreRegexps,\n\t\t},\n\t)\n}\n\nfunc newRequiredFlagError(flagName string) error {\n\treturn appcmd.NewInvalidArgumentErrorf(\"required flag %q not set\", flagName)\n}\n"
  },
  {
    "path": "private/pkg/licenseheader/cmd/license-header/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/licenseheader/licenseheader.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 licenseheader handles license headers.\npackage licenseheader\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"html/template\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\t// LicenseTypeNone is the no license type.\n\tLicenseTypeNone LicenseType = iota + 1\n\t// LicenseTypeApache is the Apache 2.0 license type.\n\tLicenseTypeApache\n\t// LicenseTypeProprietary is the proprietary license type.\n\tLicenseTypeProprietary\n)\n\nvar (\n\tlicenseTypeToString = map[LicenseType]string{\n\t\tLicenseTypeNone:        \"none\",\n\t\tLicenseTypeApache:      \"apache\",\n\t\tLicenseTypeProprietary: \"proprietary\",\n\t}\n\tstringToLicenseType = map[string]LicenseType{\n\t\t\"none\":        LicenseTypeNone,\n\t\t\"apache\":      LicenseTypeApache,\n\t\t\"proprietary\": LicenseTypeProprietary,\n\t}\n\n\t// does not include LicenseTypeNone\n\tlicenseTypeToTemplateData = map[LicenseType]string{\n\t\tLicenseTypeApache: `Copyright {{.YearRange}} {{.CopyrightHolder}}\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\t\tLicenseTypeProprietary: `Copyright {{.YearRange}} {{.CopyrightHolder}}\n\nAll rights reserved.`,\n\t}\n\n\t// if a header contains any of these lowercase phrases, we consider it a license\n\tlicenseMatchingPhrases = []string{\n\t\t\"copyright\",\n\t}\n\n\textToPrefix = map[string]string{\n\t\t\".go\":    \"//\",\n\t\t\".js\":    \"//\",\n\t\t\".proto\": \"//\",\n\t\t\".sql\":   \"---\",\n\t\t\".ts\":    \"//\",\n\t\t\".tsx\":   \"//\",\n\t\t\".bazel\": \"#\",\n\t\t\".bzl\":   \"#\",\n\t\t\".kt\":    \"//\",\n\t\t\".swift\": \"//\",\n\t\t\".java\":  \"//\",\n\t\t\".cc\":    \"//\",\n\t\t\".c\":     \"//\",\n\t\t\".h\":     \"//\",\n\t\t\".py\":    \"#\",\n\t\t\".pyi\":   \"#\",\n\t}\n)\n\n// LicenseType is a recognized license type.\ntype LicenseType int\n\n// String implements fmt.Stringer.\nfunc (f LicenseType) String() string {\n\ts, ok := licenseTypeToString[f]\n\tif !ok {\n\t\treturn strconv.Itoa(int(f))\n\t}\n\treturn s\n}\n\n// ParseLicenseType parses the LicenseType.\nfunc ParseLicenseType(s string) (LicenseType, error) {\n\tf, ok := stringToLicenseType[s]\n\tif ok {\n\t\treturn f, nil\n\t}\n\treturn 0, fmt.Errorf(\"unknown LicenseType: %q\", s)\n}\n\n// Modify modifies the license header for the filename and data.\n//\n// Returns the modified data, or the unmodified data if no modifications.\n// If the filename extension is not handled, returns the unmodified data.\n//\n// Note this only works with UTF-8 data with lines split by '\\n'.\nfunc Modify(\n\tlicenseType LicenseType,\n\tcopyrightHolder string,\n\tyearRange string,\n\tfilename string,\n\tdata []byte,\n) ([]byte, error) {\n\tprefix, ok := getPrefix(filename)\n\tif !ok {\n\t\t// if we do not have a prefix, we do not know the filename extension,\n\t\t// so we just return the unmodified data\n\t\treturn data, nil\n\t}\n\tremainder := getRemainder(string(data), prefix)\n\tlicenseHeader, err := getLicenseHeader(licenseType, copyrightHolder, yearRange, prefix)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif licenseHeader == \"\" {\n\t\treturn []byte(remainder), nil\n\t}\n\tif len(remainder) == 0 {\n\t\treturn []byte(licenseHeader + \"\\n\"), nil\n\t}\n\treturn []byte(licenseHeader + \"\\n\\n\" + remainder), nil\n}\n\n// getPrefix gets the comment prefix for the filename.\nfunc getPrefix(filename string) (string, bool) {\n\tprefix, ok := extToPrefix[path.Ext(filepath.ToSlash(filename))]\n\treturn prefix, ok\n}\n\n// getRemainder gets the remainder of the file beyond the license header.\nfunc getRemainder(data string, prefix string) string {\n\tif len(data) == 0 {\n\t\treturn \"\"\n\t}\n\tlines := strings.Split(data, \"\\n\")\n\tvar headerLines []string\n\tvar lastCommentLine int\n\tfor i, line := range lines {\n\t\tif !strings.HasPrefix(line, prefix) {\n\t\t\tlastCommentLine = i\n\t\t\tbreak\n\t\t}\n\t\theaderLines = append(headerLines, line)\n\t}\n\t// we have reached the first non-comment, check if the header lines represent a license or not\n\tif !doLinesContainALicense(headerLines) {\n\t\t// if they are not a license, return everything\n\t\treturn data\n\t}\n\t// if they are, return everything but the license and with front newlines stripped\n\treturn strings.TrimLeft(strings.Join(lines[lastCommentLine:], \"\\n\"), \"\\n\")\n}\n\nfunc getLicenseHeader(\n\tlicenseType LicenseType,\n\tcopyrightHolder string,\n\tyearRange string,\n\tprefix string,\n) (string, error) {\n\tif licenseType == LicenseTypeNone {\n\t\treturn \"\", nil\n\t}\n\tif copyrightHolder == \"\" {\n\t\treturn \"\", errors.New(\"copyrightHolder required if not using LicenseTypeNone\")\n\t}\n\tif yearRange == \"\" {\n\t\treturn \"\", errors.New(\"yearRange required if not using LicenseTypeNone\")\n\t}\n\ttemplateData, ok := licenseTypeToTemplateData[licenseType]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"unrecognized license type: %q\", licenseType)\n\t}\n\ttmpl, err := template.New(\"tmpl\").Parse(templateData)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tbuffer := bytes.NewBuffer(nil)\n\tif err := tmpl.Execute(\n\t\tbuffer,\n\t\tnewLicenseData(\n\t\t\tcopyrightHolder,\n\t\t\tyearRange,\n\t\t),\n\t); err != nil {\n\t\treturn \"\", err\n\t}\n\tlines := strings.Split(buffer.String(), \"\\n\")\n\tfor i, line := range lines {\n\t\tif line == \"\" {\n\t\t\tlines[i] = prefix\n\t\t} else {\n\t\t\tlines[i] = prefix + \" \" + line\n\t\t}\n\t}\n\treturn strings.Join(lines, \"\\n\"), nil\n}\n\nfunc doLinesContainALicense(lines []string) bool {\n\tfor _, line := range lines {\n\t\tfor _, matchingPhrase := range licenseMatchingPhrases {\n\t\t\tif strings.Contains(strings.ToLower(line), matchingPhrase) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\ntype licenseData struct {\n\tCopyrightHolder string\n\tYearRange       string\n}\n\nfunc newLicenseData(\n\tcopyrightHolder string,\n\tyearRange string,\n) *licenseData {\n\treturn &licenseData{\n\t\tCopyrightHolder: copyrightHolder,\n\t\tYearRange:       yearRange,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/licenseheader/licenseheader_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 licenseheader\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nconst (\n\ttestCopyrightHolder = \"Foo Bar, Inc.\"\n\ttestYearRange       = \"2020-2021\"\n\ttestApacheGoHeader  = `// Copyright 2020-2021 Foo Bar, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.`\n\ttestProprietaryGoHeader = `// Copyright 2020-2021 Foo Bar, Inc.\n//\n// All rights reserved.`\n)\n\nfunc TestBasic(t *testing.T) {\n\tt.Parallel()\n\n\tmodifiedData, err := Modify(\n\t\tLicenseTypeApache,\n\t\ttestCopyrightHolder,\n\t\ttestYearRange,\n\t\t\"foo/bar.go\",\n\t\t[]byte(\"package foo\"),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\ttestApacheGoHeader+\"\\n\\npackage foo\",\n\t\tstring(modifiedData),\n\t)\n\tmodifiedData, err = Modify(\n\t\tLicenseTypeProprietary,\n\t\ttestCopyrightHolder,\n\t\ttestYearRange,\n\t\t\"foo/bar.go\",\n\t\tmodifiedData,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\ttestProprietaryGoHeader+\"\\n\\npackage foo\",\n\t\tstring(modifiedData),\n\t)\n\tmodifiedData, err = Modify(\n\t\tLicenseTypeNone,\n\t\ttestCopyrightHolder,\n\t\ttestYearRange,\n\t\t\"foo/bar.go\",\n\t\tmodifiedData,\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t\"package foo\",\n\t\tstring(modifiedData),\n\t)\n\tmodifiedData, err = Modify(\n\t\tLicenseTypeApache,\n\t\ttestCopyrightHolder,\n\t\ttestYearRange,\n\t\t\"foo/bar.go\",\n\t\t[]byte(`// copyright foo\n\npackage foo`),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\ttestApacheGoHeader+\"\\n\\npackage foo\",\n\t\tstring(modifiedData),\n\t)\n\tmodifiedData, err = Modify(\n\t\tLicenseTypeApache,\n\t\ttestCopyrightHolder,\n\t\ttestYearRange,\n\t\t\"foo/bar.go\",\n\t\t[]byte(`// foo\npackage foo`),\n\t)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\ttestApacheGoHeader+`\n\n// foo\npackage foo`,\n\t\tstring(modifiedData),\n\t)\n}\n"
  },
  {
    "path": "private/pkg/licenseheader/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage licenseheader\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/netext/netext.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 netext\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net\"\n\t\"strconv\"\n)\n\nconst (\n\tdomainNameMinLength = 2\n\tdomainNameMaxLength = 254\n\tmaxSegmentLength    = 63\n)\n\n// ValidateHostname verifies the given hostname is a well-formed IP address\n// or domain name, optionally including a port, and returns the hostname part.\nfunc ValidateHostname(hostname string) (string, error) {\n\tif len(hostname) == 0 {\n\t\treturn \"\", errors.New(\"must not be empty\")\n\t}\n\tif len(hostname) < domainNameMinLength || len(hostname) > domainNameMaxLength {\n\t\treturn \"\", fmt.Errorf(\"must be at least %d and at most %d characters\", domainNameMinLength, domainNameMaxLength)\n\t}\n\n\tparsedHost := hostname\n\tif host, port, err := net.SplitHostPort(hostname); err == nil {\n\t\t// net.SplitHostPort performs very lax validation of ports (allowing to be resolved from /etc/services).\n\t\t// Only accept numeric ports here.\n\t\tif portNum, err := strconv.ParseUint(port, 10, 32); err == nil && portNum <= 65535 {\n\t\t\tparsedHost = host\n\t\t}\n\t}\n\tif net.ParseIP(parsedHost) != nil {\n\t\t// hostname is a valid IP address\n\t\treturn hostname, nil\n\t}\n\tif err := isValidDomainName(parsedHost); err != nil {\n\t\treturn \"\", fmt.Errorf(\"must either be a valid IP address or domain name: invalid domain name %q, %w\", hostname, err)\n\t}\n\treturn hostname, nil\n}\n\n// isValidDomainName validates a hostname according to the requirements set for\n// domain names internally in the Go standard library's net package, see\n// golang.org/issue/12421.\n//\n// Adapted from https://github.com/golang/go/blob/f4e7a6b905ce60448e506a3f6578d01b60602cdd/src/net/dnsclient.go#L73-L128\n// See https://github.com/golang/go/blob/f4e7a6b905ce60448e506a3f6578d01b60602cdd/LICENSE for the license.\nfunc isValidDomainName(hostname string) error {\n\tprevious := rune('.')\n\tnonNumeric := false\n\tsegmentLen := 0\n\tfor _, char := range hostname {\n\t\tswitch {\n\t\tcase '0' <= char && char <= '9':\n\t\t\tsegmentLen++\n\t\tcase 'a' <= char && char <= 'z' || 'A' <= char && char <= 'Z' || char == '_':\n\t\t\tnonNumeric = true\n\t\t\tsegmentLen++\n\t\tcase char == '-':\n\t\t\tif previous == '.' {\n\t\t\t\treturn fmt.Errorf(\"cannot begin a segment after a period (.) with a hyphen (-)\")\n\t\t\t}\n\t\t\tnonNumeric = true\n\t\t\tsegmentLen++\n\t\tcase char == '.':\n\t\t\tif previous == '.' {\n\t\t\t\treturn fmt.Errorf(\"cannot contain two periods (.) in a row\")\n\t\t\t}\n\t\t\tif previous == '-' {\n\t\t\t\treturn fmt.Errorf(\"cannot have a hyphen (-) immediately before a period (.)\")\n\t\t\t}\n\t\t\tif segmentLen > maxSegmentLength {\n\t\t\t\treturn fmt.Errorf(\"cannot have segments greater than %v characters between periods (.)\", maxSegmentLength)\n\t\t\t}\n\t\t\tsegmentLen = 0\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"included invalid character %q, must only contain letters, digits, periods (.), hyphens (-), or underscores (_)\", char)\n\t\t}\n\t\tprevious = char\n\t}\n\n\tif previous == '-' {\n\t\treturn fmt.Errorf(\"cannot have a hyphen (-) as the final character\")\n\t}\n\tif segmentLen > maxSegmentLength {\n\t\treturn fmt.Errorf(\"cannot have segments greater than %v characters between periods (.)\", maxSegmentLength)\n\t}\n\tif !nonNumeric {\n\t\treturn errors.New(\"must have at least one non-numeric character\")\n\t}\n\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/netext/netext_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 netext\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestValidateHostname(t *testing.T) {\n\tt.Parallel()\n\ttests := []struct {\n\t\tdescription string\n\t\thostname    string\n\t\tisValid     bool\n\t}{\n\t\t{\n\t\t\tdescription: \"localhost is valid\",\n\t\t\thostname:    \"localhost\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"foo.com is valid\",\n\t\t\thostname:    \"foo.com\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"foo.bar.com is valid\",\n\t\t\thostname:    \"foo.bar.com\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"domain name with port is valid\",\n\t\t\thostname:    \"localhost:3000\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"IPV4 is valid\",\n\t\t\thostname:    \"10.40.210.253\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"IPV4 with port is valid\",\n\t\t\thostname:    \"0.0.0.0:64514\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"IPV6 is valid\",\n\t\t\thostname:    \"2001:0db8:85a3:0000:0000:8a2e:0370:7334\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"IPV6 with port is valid\",\n\t\t\thostname:    \"[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:64514\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"0.0.0.0 is valid\",\n\t\t\thostname:    \"0.0.0.0\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"127.0.0.1 is valid\",\n\t\t\thostname:    \"127.0.0.1\",\n\t\t\tisValid:     true,\n\t\t},\n\t\t{\n\t\t\tdescription: \"malformed IP is invalid\",\n\t\t\thostname:    \"127.0.0.256\",\n\t\t\tisValid:     false,\n\t\t},\n\t\t{\n\t\t\tdescription: \"malformed domain name is invalid\",\n\t\t\thostname:    \"this-domain-name-has-too-many-characters-in-a-segment-to-be-considered-valid.com\",\n\t\t\tisValid:     false,\n\t\t},\n\t\t{\n\t\t\tdescription: \"does not allow invalid characters\",\n\t\t\thostname:    \"is.this.a.valid.domain?\",\n\t\t\tisValid:     false,\n\t\t},\n\t\t{\n\t\t\tdescription: \"hostname must be set\",\n\t\t\thostname:    \"\",\n\t\t\tisValid:     false,\n\t\t},\n\t\t{\n\t\t\tdescription: \"urls are invalid\",\n\t\t\thostname:    \"https://buf.build\",\n\t\t\tisValid:     false,\n\t\t},\n\t}\n\n\tfor _, test := range tests {\n\t\ttt := test\n\t\tt.Run(tt.description, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\thostname, err := ValidateHostname(tt.hostname)\n\t\t\tif tt.isValid {\n\t\t\t\tassert.Equal(t, tt.hostname, hostname)\n\t\t\t\tassert.NoError(t, err)\n\t\t\t} else {\n\t\t\t\tassert.Error(t, err)\n\t\t\t}\n\t\t})\n\t}\n}\n"
  },
  {
    "path": "private/pkg/netext/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage netext\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/netrc/machine.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 netrc\n\ntype machine struct {\n\tname     string\n\tlogin    string\n\tpassword string\n}\n\nfunc newMachine(\n\tname string,\n\tlogin string,\n\tpassword string,\n) *machine {\n\treturn &machine{\n\t\tname:     name,\n\t\tlogin:    login,\n\t\tpassword: password,\n\t}\n}\n\nfunc (m *machine) Name() string {\n\treturn m.name\n}\n\nfunc (m *machine) Login() string {\n\treturn m.login\n}\n\nfunc (m *machine) Password() string {\n\treturn m.password\n}\n"
  },
  {
    "path": "private/pkg/netrc/netrc.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 netrc contains functionality to work with netrc.\npackage netrc\n\nimport (\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/jdx/go-netrc\"\n)\n\n// Filename exposes the netrc filename based on the current operating system.\nconst Filename = netrcFilename\n\n// Machine is a machine.\ntype Machine interface {\n\t// Empty for default machine.\n\tName() string\n\tLogin() string\n\tPassword() string\n}\n\n// NewMachine creates a new Machine.\nfunc NewMachine(\n\tname string,\n\tlogin string,\n\tpassword string,\n) Machine {\n\treturn newMachine(name, login, password)\n}\n\n// GetMachineForName returns the Machine for the given name.\n//\n// Returns nil if no such Machine.\nfunc GetMachineForName(envContainer app.EnvContainer, name string) (_ Machine, retErr error) {\n\tfilePath, err := GetFilePath(envContainer)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn GetMachineForNameAndFilePath(name, filePath)\n}\n\n// PutMachines adds the given Machines to the configured netrc file.\nfunc PutMachines(envContainer app.EnvContainer, machines ...Machine) error {\n\tfilePath, err := GetFilePath(envContainer)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn putMachinesForFilePath(machines, filePath)\n}\n\n// DeleteMachineForName deletes the Machine for the given name, if set.\n//\n// Returns false if there was no Machine for the given name.\nfunc DeleteMachineForName(envContainer app.EnvContainer, name string) (bool, error) {\n\tfilePath, err := GetFilePath(envContainer)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treturn deleteMachineForFilePath(name, filePath)\n}\n\n// GetFilePath gets the netrc file path for the given environment.\nfunc GetFilePath(envContainer app.EnvContainer) (string, error) {\n\tif netrcFilePath := envContainer.Env(\"NETRC\"); netrcFilePath != \"\" {\n\t\treturn netrcFilePath, nil\n\t}\n\thomeDirPath, err := app.HomeDirPath(envContainer)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn filepath.Join(homeDirPath, netrcFilename), nil\n}\n\n// GetMachineForNameAndFilePath returns the Machine for the given name from the\n// file at the given path.\n//\n// Returns nil if no such Machine or no such file.\nfunc GetMachineForNameAndFilePath(name string, filePath string) (_ Machine, retErr error) {\n\tif _, err := os.Stat(filePath); 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\tnetrcStruct, err := netrc.Parse(filePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnetrcMachine := netrcStruct.Machine(name)\n\tif netrcMachine == nil {\n\t\tnetrcMachine = netrcStruct.Machine(\"default\")\n\t\tif netrcMachine == nil {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\t// We take the name from the read Machine just in case there's some case-insensitivity weirdness\n\tmachineName := netrcMachine.Name\n\tif machineName == \"default\" {\n\t\tmachineName = \"\"\n\t}\n\treturn newMachine(\n\t\tmachineName,\n\t\tnetrcMachine.Get(\"login\"),\n\t\tnetrcMachine.Get(\"password\"),\n\t), nil\n}\n\nfunc putMachinesForFilePath(machines []Machine, filePath string) (retErr error) {\n\tvar netrcStruct *netrc.Netrc\n\tfileInfo, err := os.Stat(filePath)\n\tvar fileMode fs.FileMode\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tnetrcStruct = &netrc.Netrc{}\n\t\t\tfileMode = 0600\n\t\t} else {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tnetrcStruct, err = netrc.Parse(filePath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfileMode = fileInfo.Mode()\n\t}\n\tfor _, machine := range machines {\n\t\tif foundMachine := netrcStruct.Machine(machine.Name()); foundMachine != nil {\n\t\t\tnetrcStruct.RemoveMachine(machine.Name())\n\t\t}\n\t\tnetrcStruct.AddMachine(\n\t\t\tmachine.Name(),\n\t\t\tmachine.Login(),\n\t\t\tmachine.Password(),\n\t\t)\n\t}\n\treturn os.WriteFile(filePath, []byte(netrcStruct.Render()), fileMode)\n}\n\nfunc deleteMachineForFilePath(name string, filePath string) (_ bool, retErr error) {\n\tfileInfo, err := os.Stat(filePath)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\t// If a netrc file does not already exist, there's nothing to be done.\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\tnetrcStruct, err := netrc.Parse(filePath)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\tif netrcStruct.Machine(name) == nil {\n\t\t// Machine is not set, there is nothing to be done.\n\t\treturn false, nil\n\t}\n\tnetrcStruct.RemoveMachine(name)\n\tif err := os.WriteFile(filePath, []byte(netrcStruct.Render()), fileInfo.Mode()); err != nil {\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n"
  },
  {
    "path": "private/pkg/netrc/netrc_unix.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Matching the unix-like build tags in the Golang source i.e. https://github.com/golang/go/blob/912f0750472dd4f674b69ca1616bfaf377af1805/src/os/file_unix.go#L6\n\n//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage netrc\n\n// netrcFilename is the netrc filename.\n//\n// This will be .netrc for unix-like platforms including darwin.\n// This will be _netrc for windows.\nconst netrcFilename = \".netrc\"\n"
  },
  {
    "path": "private/pkg/netrc/netrc_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Matching the unix-like build tags in the Golang source i.e. https://github.com/golang/go/blob/912f0750472dd4f674b69ca1616bfaf377af1805/src/os/file_unix.go#L6\n\n//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage netrc\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/app\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGetMachineForName(t *testing.T) {\n\tt.Parallel()\n\ttestGetMachineForNameSuccess(\n\t\tt,\n\t\t\"foo.com\",\n\t\t\"testdata/unix/home1\",\n\t\t\"foo.com\",\n\t\t\"bar\",\n\t\t\"baz\",\n\t)\n\ttestGetMachineForNameNil(\n\t\tt,\n\t\t\"api.foo.com\",\n\t\t\"testdata/unix/home1\",\n\t)\n\ttestGetMachineForNameNil(\n\t\tt,\n\t\t\"bar.com\",\n\t\t\"testdata/unix/home1\",\n\t)\n\ttestGetMachineForNameSuccess(\n\t\tt,\n\t\t\"foo.com\",\n\t\t\"testdata/unix/home2\",\n\t\t\"\",\n\t\t\"bar\",\n\t\t\"baz\",\n\t)\n\ttestGetMachineForNameSuccess(\n\t\tt,\n\t\t\"api.foo.com\",\n\t\t\"testdata/unix/home2\",\n\t\t\"\",\n\t\t\"bar\",\n\t\t\"baz\",\n\t)\n\ttestGetMachineForNameSuccess(\n\t\tt,\n\t\t\"bar.com\",\n\t\t\"testdata/unix/home2\",\n\t\t\"\",\n\t\t\"bar\",\n\t\t\"baz\",\n\t)\n\ttestGetMachineForNameNil(\n\t\tt,\n\t\t\"foo.com\",\n\t\t\"testdata/unix/home3\",\n\t)\n\ttestGetMachineForNameNil(\n\t\tt,\n\t\t\"api.foo.com\",\n\t\t\"testdata/unix/home3\",\n\t)\n\ttestGetMachineForNameNil(\n\t\tt,\n\t\t\"bar.com\",\n\t\t\"testdata/unix/home1\",\n\t)\n}\n\nfunc TestPutMachines(t *testing.T) {\n\tt.Parallel()\n\ttestPutMachinesSuccess(\n\t\tt,\n\t\tfalse,\n\t\tNewMachine(\n\t\t\t\"foo.com\",\n\t\t\t\"test@foo.com\",\n\t\t\t\"password\",\n\t\t),\n\t)\n\ttestPutMachinesSuccess(\n\t\tt,\n\t\ttrue,\n\t\tNewMachine(\n\t\t\t\"foo.com\",\n\t\t\t\"test@foo.com\",\n\t\t\t\"password\",\n\t\t),\n\t)\n\ttestPutMachinesSuccess(\n\t\tt,\n\t\tfalse,\n\t\tNewMachine(\n\t\t\t\"bar.com\",\n\t\t\t\"test@bar.com\",\n\t\t\t\"password\",\n\t\t),\n\t\tNewMachine(\n\t\t\t\"baz.com\",\n\t\t\t\"test@baz.com\",\n\t\t\t\"password\",\n\t\t),\n\t)\n}\n\n// https://github.com/bufbuild/buf/issues/611\nfunc TestPutLotsOfBigMachinesSingleLineFiles(t *testing.T) {\n\tt.Parallel()\n\tsize := 10\n\tpassword := strings.Repeat(\"abcdefghijklmnopqrstuvwxyz\", size)\n\tmachines := make([]Machine, 0, size)\n\tbuffer := bytes.NewBuffer(nil)\n\tfor i := range size {\n\t\t// Write the file manually in single-line format as this is where the failure happens.\n\t\tfmt.Fprintf(buffer, \"machine foo%d login bar%d password %s\\n\", i, i, password)\n\t\tmachines = append(\n\t\t\tmachines,\n\t\t\tNewMachine(\n\t\t\t\tfmt.Sprintf(\"foo%d\", i),\n\t\t\t\tfmt.Sprintf(\"bar%d\", i),\n\t\t\t\tpassword,\n\t\t\t),\n\t\t)\n\t}\n\tfilePath := filepath.Join(t.TempDir(), netrcFilename)\n\terr := os.WriteFile(filePath, buffer.Bytes(), 0600)\n\trequire.NoError(t, err)\n\n\tenvContainer := app.NewEnvContainer(map[string]string{\"NETRC\": filePath})\n\tfor _, machine := range machines {\n\t\t// Make sure the existing file can be parsed.\n\t\tactualMachine, err := GetMachineForName(envContainer, machine.Name())\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, machine, actualMachine)\n\t}\n\n\t// Now, modify the file with an extra machine. This is when the file got corrupted.\n\textraMachine := NewMachine(\n\t\t\"baz.com\",\n\t\t\"test@baz.com\",\n\t\t\"password\",\n\t)\n\terr = PutMachines(envContainer, extraMachine)\n\trequire.NoError(t, err)\n\tmachines = append(machines, extraMachine)\n\tfor _, machine := range machines {\n\t\t// Verify all the machines work. This failed previously.\n\t\tactualMachine, err := GetMachineForName(envContainer, machine.Name())\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, machine, actualMachine)\n\t}\n\n\t// Modify some of the existing machines.\n\tmachines = make([]Machine, 0, size)\n\tfor i := range size {\n\t\tmodifiedPassword := password\n\t\tif i%2 == 0 {\n\t\t\tmodifiedPassword = modifiedPassword + \"Z\"\n\t\t}\n\t\tmachine := NewMachine(\n\t\t\tfmt.Sprintf(\"foo%d\", i),\n\t\t\tfmt.Sprintf(\"bar%d\", i),\n\t\t\tmodifiedPassword,\n\t\t)\n\t\tmachines = append(machines, machine)\n\t\tif i%2 == 0 {\n\t\t\terr = PutMachines(envContainer, machine)\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t}\n\tmachines = append(machines, extraMachine)\n\tfor _, machine := range machines {\n\t\tactualMachine, err := GetMachineForName(envContainer, machine.Name())\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, machine, actualMachine)\n\t}\n}\n\nfunc TestDeleteMachineForName(t *testing.T) {\n\tt.Parallel()\n\tfilePath := filepath.Join(t.TempDir(), netrcFilename)\n\tenvContainer := app.NewEnvContainer(map[string]string{\"NETRC\": filePath})\n\terr := PutMachines(\n\t\tenvContainer,\n\t\tNewMachine(\n\t\t\t\"bar.com\",\n\t\t\t\"test@bar.com\",\n\t\t\t\"password\",\n\t\t),\n\t\tNewMachine(\n\t\t\t\"baz.com\",\n\t\t\t\"test@baz.com\",\n\t\t\t\"password\",\n\t\t),\n\t)\n\trequire.NoError(t, err)\n\texists, err := DeleteMachineForName(envContainer, \"bar.com\")\n\trequire.NoError(t, err)\n\trequire.True(t, exists)\n\tmachine, err := GetMachineForName(envContainer, \"bar.com\")\n\trequire.NoError(t, err)\n\tassert.Nil(t, machine)\n\tmachine, err = GetMachineForName(envContainer, \"baz.com\")\n\trequire.NoError(t, err)\n\tassert.NotNil(t, machine)\n\texists, err = DeleteMachineForName(envContainer, \"bar.com\")\n\trequire.NoError(t, err)\n\trequire.False(t, exists)\n}\n\nfunc testPutMachinesSuccess(\n\tt *testing.T,\n\tcreateNetrcBeforePut bool,\n\tmachines ...Machine,\n) {\n\tfilePath := filepath.Join(t.TempDir(), netrcFilename)\n\tenvContainer := app.NewEnvContainer(map[string]string{\"NETRC\": filePath})\n\tfor _, machine := range machines {\n\t\tmachine, err := GetMachineForName(envContainer, machine.Name())\n\t\trequire.NoError(t, err)\n\t\trequire.Nil(t, machine)\n\t}\n\n\tif createNetrcBeforePut {\n\t\t_, err := os.Create(filePath)\n\t\trequire.NoError(t, err)\n\t}\n\n\terr := PutMachines(envContainer, machines...)\n\trequire.NoError(t, err)\n\n\tfor _, machine := range machines {\n\t\tactualMachine, err := GetMachineForName(envContainer, machine.Name())\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(t, machine, actualMachine)\n\t}\n}\n\nfunc testGetMachineForNameSuccess(\n\tt *testing.T,\n\tname string,\n\thomeDirPath string,\n\texpectedName string,\n\texpectedLogin string,\n\texpectedPassword string,\n) {\n\tmachine, err := GetMachineForName(app.NewEnvContainer(map[string]string{\"HOME\": homeDirPath}), name)\n\trequire.NoError(t, err)\n\trequire.NotNil(t, machine)\n\tassert.Equal(t, expectedName, machine.Name())\n\tassert.Equal(t, expectedLogin, machine.Login())\n\tassert.Equal(t, expectedPassword, machine.Password())\n}\n\nfunc testGetMachineForNameNil(\n\tt *testing.T,\n\tname string,\n\thomeDirPath string,\n) {\n\tmachine, err := GetMachineForName(app.NewEnvContainer(map[string]string{\"HOME\": homeDirPath}), name)\n\trequire.NoError(t, err)\n\trequire.Nil(t, machine)\n}\n"
  },
  {
    "path": "private/pkg/netrc/netrc_windows.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 netrc\n\n// netrcFilename is the netrc filename.\n//\n// This will be .netrc for darwin and linux.\n// This will be _netrc for windows.\nconst netrcFilename = \"_netrc\"\n"
  },
  {
    "path": "private/pkg/netrc/testdata/unix/home1/.netrc",
    "content": "machine foo.com\nlogin bar\npassword baz\naccount bat\n"
  },
  {
    "path": "private/pkg/netrc/testdata/unix/home2/.netrc",
    "content": "default\nlogin bar\npassword baz\n"
  },
  {
    "path": "private/pkg/netrc/testdata/unix/home3/.netrcc",
    "content": "default\nlogin bar\npassword baz\n"
  },
  {
    "path": "private/pkg/netrc/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage netrc\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/normalpath/normalpath.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 normalpath provides functions similar to filepath.\n//\n// A normalized path is a cleaned and to-slash'ed path.\n// A validated path validates that a path is relative and does not jump context.\npackage normalpath\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/standard/xslices\"\n)\n\nconst (\n\t// Relative is the PathType for normalized and validated paths.\n\tRelative PathType = 1\n\t// Absolute is the PathType for normalized and absolute paths.\n\tAbsolute PathType = 2\n\n\tstringOSPathSeparator = string(os.PathSeparator)\n\t// This has to be with \"/\" instead of os.PathSeparator as we use this on normalized paths\n\tnormalizedRelPathJumpContextPrefix = \"../\"\n\t// This path jumps context, it transverses up one directory.\n\tnormalizedRelPathJumpContextPath = \"..\"\n)\n\nvar (\n\t// errNotRelative is the error returned if the path is not relative.\n\terrNotRelative = errors.New(\"expected to be relative\")\n\t// errOutsideContextDir is the error returned if the path is outside the context directory.\n\terrOutsideContextDir = errors.New(\"is outside the context directory\")\n)\n\n// PathType is a terminate type for path comparisons.\ntype PathType int\n\n// Separator gets the string value of the separator.\n//\n// TODO: rename to Terminator if we keep this\n// TODO: we should probably refactor so we never need to use absolute paths at all\n// this could be accomplished if we could for ExternalPathToRelPath on buckets\nfunc (t PathType) Separator() string {\n\tswitch t {\n\tcase Relative:\n\t\treturn \".\"\n\tcase Absolute:\n\t\treturn \"/\"\n\tdefault:\n\t\treturn \"\"\n\t}\n}\n\n// Error is a path error.\ntype Error struct {\n\tPath string\n\tErr  error\n}\n\n// NewError returns a new Error.\nfunc NewError(path string, err error) *Error {\n\treturn &Error{\n\t\tPath: path,\n\t\tErr:  err,\n\t}\n}\n\n// Error implements error.\nfunc (e *Error) Error() string {\n\terrString := \"\"\n\tif e.Err != nil {\n\t\terrString = e.Err.Error()\n\t}\n\tif errString == \"\" {\n\t\terrString = \"error\"\n\t}\n\treturn e.Path + \": \" + errString\n}\n\n// Unwrap implements errors.Unwrap for Error.\nfunc (e *Error) Unwrap() error {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Err\n}\n\n// Normalize normalizes the given path.\n//\n// This calls filepath.Clean and filepath.ToSlash on the path.\n// If the path is \"\" or \".\", this returns \".\".\nfunc Normalize(path string) string {\n\treturn filepath.ToSlash(filepath.Clean(path))\n}\n\n// NormalizeAndAbsolute normalizes the path and makes it absolute.\nfunc NormalizeAndAbsolute(path string) (string, error) {\n\tabsPath, err := filepath.Abs(Unnormalize(path))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn Normalize(absPath), nil\n}\n\n// NormalizeAndTransformForPathType calls NormalizeAndValidate for relative\n// paths, and NormalizeAndAbsolute for absolute paths.\nfunc NormalizeAndTransformForPathType(path string, pathType PathType) (string, error) {\n\tswitch pathType {\n\tcase Relative:\n\t\treturn NormalizeAndValidate(path)\n\tcase Absolute:\n\t\treturn NormalizeAndAbsolute(path)\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown PathType: %v\", pathType)\n\t}\n}\n\n// Unnormalize unnormalizes the given path.\n//\n// This calls filepath.FromSlash on the path.\n// If the path is \"\", this returns \"\".\nfunc Unnormalize(path string) string {\n\treturn filepath.FromSlash(path)\n}\n\n// Base is equivalent to filepath.Base.\n//\n// Normalizes before returning.\nfunc Base(path string) string {\n\treturn Normalize(filepath.Base(Unnormalize(path)))\n}\n\n// Dir is equivalent to filepath.Dir.\n//\n// Normalizes before returning.\nfunc Dir(path string) string {\n\treturn Normalize(filepath.Dir(Unnormalize(path)))\n}\n\n// Ext is equivalent to filepath.Ext.\n//\n// Can return empty string.\nfunc Ext(path string) string {\n\treturn filepath.Ext(Unnormalize(path))\n}\n\n// Join is equivalent to filepath.Join.\n//\n// Empty strings are ignored,\n// Can return empty string.\n//\n// Normalizes before returning otherwise.\nfunc Join(paths ...string) string {\n\tunnormalized := make([]string, len(paths))\n\tfor i, path := range paths {\n\t\tunnormalized[i] = Unnormalize(path)\n\t}\n\tvalue := filepath.Join(unnormalized...)\n\tif value == \"\" {\n\t\treturn \"\"\n\t}\n\treturn Normalize(value)\n}\n\n// Rel is equivalent to filepath.Rel.\n//\n// Can return empty string, especially on error.\n//\n// Normalizes before returning otherwise.\nfunc Rel(basepath string, targpath string) (string, error) {\n\tpath, err := filepath.Rel(Unnormalize(basepath), Unnormalize(targpath))\n\tif path == \"\" {\n\t\treturn \"\", err\n\t}\n\treturn Normalize(path), err\n}\n\n// ByDir maps the paths into a map from directory via Dir to the original paths.\n//\n// The paths for each value slice will be sorted.\n//\n// The path is expected to be normalized.\nfunc ByDir(paths ...string) map[string][]string {\n\tm := make(map[string][]string)\n\tfor _, path := range paths {\n\t\tpath = Normalize(path)\n\t\tdir := filepath.Dir(path)\n\t\tm[dir] = append(m[dir], path)\n\t}\n\tfor _, dirPaths := range m {\n\t\tsort.Strings(dirPaths)\n\t}\n\treturn m\n}\n\n// ChunkByDir splits paths into chunks of around the suggestedChunkSize while keeping\n// directory affinity, i.e. paths in the same directory will be in the same chunk.\n//\n// Paths are expected to be normalized.\n// If paths is nil or empty, returns empty.\n// If suggestedChunkSize is <=0, returns [][]string{paths}.\nfunc ChunkByDir(paths []string, suggestedChunkSize int) [][]string {\n\tvar chunks [][]string\n\tif len(paths) == 0 {\n\t\treturn chunks\n\t}\n\tif suggestedChunkSize <= 0 {\n\t\treturn [][]string{paths}\n\t}\n\n\tdirToPaths := ByDir(paths...)\n\t// Get the keys and sort them to keep the output of this stable\n\tdirs := make([]string, 0, len(dirToPaths))\n\tfor dir := range dirToPaths {\n\t\tdirs = append(dirs, dir)\n\t}\n\tsort.Strings(dirs)\n\t// Create a slice of the per-directory path slices\n\tpathsByDir := make([][]string, 0, len(dirToPaths))\n\tfor _, dir := range dirs {\n\t\tpathsByDir = append(pathsByDir, dirToPaths[dir])\n\t}\n\t// Sort the per-directory path slices by length, from greatest to smallest\n\t// We do greatest to smallest because we pop the greatest off first, and\n\t// This will approximate keeping things in alphabetical order given that\n\t// pathsByDir is in alphabetical order of directories.\n\tsort.SliceStable(\n\t\tpathsByDir,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn len(pathsByDir[i]) > len(pathsByDir[j])\n\t\t},\n\t)\n\n\tfor len(pathsByDir) > 0 {\n\t\t// Take the largest set of paths and remove from pathsByDir\n\t\tchunk := pathsByDir[0]\n\t\tpathsByDir = pathsByDir[1:]\n\t\t// While our current chunk is less than the suggestedChunkSize, take the smallest\n\t\t// set of paths and append them to the chunk, and then remove them from pathsByDir\n\t\t//\n\t\t// This will mean that sometimes we have chunks larger than suggestedChunkSize, but\n\t\t// this is best effort. We could likely use more-complicated algorithms here that\n\t\t// smartly combine per-directory path sets that minimize the distance from\n\t\t// suggestedChunkSize, as there are adversary cases to this algorithm, but we\n\t\t// are not diving into that at the moment unless there is a need.\n\t\tfor len(chunk) < suggestedChunkSize && len(pathsByDir) > 0 {\n\t\t\tchunk = append(chunk, pathsByDir[len(pathsByDir)-1]...)\n\t\t\tpathsByDir = pathsByDir[:len(pathsByDir)-1]\n\t\t}\n\t\t// Append the chunk to the list of chunks\n\t\tchunks = append(chunks, chunk)\n\t}\n\n\treturn chunks\n}\n\n// ContainsPath returns true if the dirPath contains the path.\n//\n// The path and value are expected to be normalized and validated if Relative is used.\n// The path and value are expected to be normalized and absolute if Absolute is used.\n//\n// For a given dirPath:\n//\n//   - If path == PathType, dirPath does not contain the path.\n//   - If dirPath == PathType, the dirPath contains the path.\n//   - If dirPath is a directory that contains path, this returns true.\nfunc ContainsPath(dirPath string, path string, pathType PathType) bool {\n\tif dirPath == path {\n\t\treturn false\n\t}\n\treturn EqualsOrContainsPath(dirPath, Dir(path), pathType)\n}\n\n// MapAllEqualOrContainingPaths returns the matching paths in the map in a sorted slice.\n//\n// The path and keys in m are expected to be normalized and validated if Relative is used.\n// The path and keys in m are expected to be normalized and absolute if Absolute is used.\n//\n// If the map is empty, returns nil.\nfunc MapAllEqualOrContainingPaths(m map[string]struct{}, path string, pathType PathType) []string {\n\tif len(m) == 0 {\n\t\treturn nil\n\t}\n\treturn xslices.MapKeysToSortedSlice(MapAllEqualOrContainingPathMap(m, path, pathType))\n}\n\n// StripComponents strips the specified number of components.\n//\n// Path expected to be normalized.\n// Returns false if the path does not have more than the specified number of components.\nfunc StripComponents(path string, countUint32 uint32) (string, bool) {\n\tcount := int(countUint32)\n\tif count == 0 {\n\t\treturn path, true\n\t}\n\tcomponents := Components(path)\n\tif len(components) <= count {\n\t\treturn \"\", false\n\t}\n\treturn Join(components[count:]...), true\n}\n\n// ValidatePathComponent validates that the string is a valid\n// component of a path, e.g. it can be Joined and form a valid path.\nfunc ValidatePathComponent(component string) error {\n\tif component == \"\" {\n\t\treturn errors.New(\"path component must not be empty\")\n\t}\n\tif strings.ContainsRune(component, '/') {\n\t\treturn errors.New(`path component must not contain \"/\" `)\n\t}\n\tif strings.Contains(component, \"..\") {\n\t\treturn errors.New(`path component must not contain \"..\"`)\n\t}\n\tif url.PathEscape(component) != component {\n\t\treturn fmt.Errorf(\n\t\t\t\"path component must match its URL escaped version: %q did not match %q\",\n\t\t\tcomponent,\n\t\t\turl.PathEscape(component),\n\t\t)\n\t}\n\treturn nil\n}\n\n// ValidatePathComponents validates that all the strings are valid\n// components of a path, e.g. they can be Joined and form a valid path.\nfunc ValidatePathComponents(components ...string) error {\n\tfor _, component := range components {\n\t\tif err := ValidatePathComponent(component); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// ValidatePathsNormalizedValidatedUnique validates the file or directory paths are normalized\n// and validated, and not duplicated.\nfunc ValidatePathsNormalizedValidatedUnique(paths []string) error {\n\tpathMap := make(map[string]struct{}, len(paths))\n\tfor _, path := range paths {\n\t\tif path == \"\" {\n\t\t\treturn errors.New(\"path is empty\")\n\t\t}\n\t\tnormalized, err := NormalizeAndValidate(path)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"path had normalization error: %w\", err)\n\t\t}\n\t\tif path != normalized {\n\t\t\treturn fmt.Errorf(\"path %s was not normalized to %s\", path, normalized)\n\t\t}\n\t\tif _, ok := pathMap[path]; ok {\n\t\t\treturn fmt.Errorf(\"duplicate path: %s\", path)\n\t\t}\n\t\tpathMap[path] = struct{}{}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/normalpath/normalpath_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 normalpath\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestChunkByDir(t *testing.T) {\n\tt.Parallel()\n\ttestChunkByDir(\n\t\tt,\n\t\tnil,\n\t\t0,\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\tnil,\n\t\t5,\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{},\n\t\t0,\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{},\n\t\t5,\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\"a/a.proto\"},\n\t\t1,\n\t\t[]string{\"a/a.proto\"},\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\"a/a.proto\"},\n\t\t2,\n\t\t[]string{\"a/a.proto\"},\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t},\n\t\t1,\n\t\t[]string{\"a/a.proto\"},\n\t\t[]string{\"b/b.proto\"},\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"b/b.proto\",\n\t\t},\n\t\t1,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t},\n\t\t[]string{\"b/b.proto\"},\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"b/b.proto\",\n\t\t},\n\t\t2,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t},\n\t\t[]string{\"b/b.proto\"},\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"b/b.proto\",\n\t\t},\n\t\t3,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"b/b.proto\",\n\t\t},\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"a/c.proto\",\n\t\t\t\"a/d.proto\",\n\t\t\t\"a/e.proto\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t\t\"b/c.proto\",\n\t\t\t\"b/d.proto\",\n\t\t\t\"c/a.proto\",\n\t\t\t\"c/b.proto\",\n\t\t\t\"c/c.proto\",\n\t\t\t\"d/a.proto\",\n\t\t\t\"d/b.proto\",\n\t\t\t\"e/a.proto\",\n\t\t},\n\t\t5,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"a/c.proto\",\n\t\t\t\"a/d.proto\",\n\t\t\t\"a/e.proto\",\n\t\t},\n\t\t[]string{\n\t\t\t\"b/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t\t\"b/c.proto\",\n\t\t\t\"b/d.proto\",\n\t\t\t\"e/a.proto\",\n\t\t},\n\t\t[]string{\n\t\t\t\"c/a.proto\",\n\t\t\t\"c/b.proto\",\n\t\t\t\"c/c.proto\",\n\t\t\t\"d/a.proto\",\n\t\t\t\"d/b.proto\",\n\t\t},\n\t)\n\ttestChunkByDir(\n\t\tt,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"a/c.proto\",\n\t\t\t\"a/d.proto\",\n\t\t\t\"a/e.proto\",\n\t\t\t\"b/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t\t\"b/c.proto\",\n\t\t\t\"b/d.proto\",\n\t\t\t\"c/a.proto\",\n\t\t\t\"c/b.proto\",\n\t\t\t\"c/c.proto\",\n\t\t\t\"d/a.proto\",\n\t\t\t\"d/b.proto\",\n\t\t\t\"e/a.proto\",\n\t\t},\n\t\t6,\n\t\t[]string{\n\t\t\t\"a/a.proto\",\n\t\t\t\"a/b.proto\",\n\t\t\t\"a/c.proto\",\n\t\t\t\"a/d.proto\",\n\t\t\t\"a/e.proto\",\n\t\t\t\"e/a.proto\",\n\t\t},\n\t\t[]string{\n\t\t\t\"b/a.proto\",\n\t\t\t\"b/b.proto\",\n\t\t\t\"b/c.proto\",\n\t\t\t\"b/d.proto\",\n\t\t\t\"d/a.proto\",\n\t\t\t\"d/b.proto\",\n\t\t},\n\t\t[]string{\n\t\t\t\"c/a.proto\",\n\t\t\t\"c/b.proto\",\n\t\t\t\"c/c.proto\",\n\t\t},\n\t)\n}\n\nfunc testChunkByDir(t *testing.T, paths []string, suggestedChunkSize int, expected ...[]string) {\n\t// This is testing the implementation unfortunately, so if we change to a different\n\t// algorithm, our expectations will change.\n\tassert.Equal(t, expected, ChunkByDir(paths, suggestedChunkSize))\n}\n"
  },
  {
    "path": "private/pkg/normalpath/normalpath_unix.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Matching the unix-like build tags in the Golang standard library based on the dependency\n// on \"path/filepath\", i.e. https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/path/filepath/path_unix.go;l=5-6\n\n//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage normalpath\n\nimport (\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n)\n\n// NormalizeAndValidate normalizes and validates the given path.\n//\n// This calls Normalize on the path.\n// Returns Error if the path is not relative or jumps context.\n// This can be used to validate that paths are valid to use with Buckets.\n// The error message is safe to pass to users.\nfunc NormalizeAndValidate(path string) (string, error) {\n\tnormalizedPath := Normalize(path)\n\tif filepath.IsAbs(normalizedPath) {\n\t\treturn \"\", NewError(path, errNotRelative)\n\t}\n\t// https://github.com/bufbuild/buf/issues/51\n\tif strings.HasPrefix(normalizedPath, normalizedRelPathJumpContextPrefix) ||\n\t\tnormalizedPath == normalizedRelPathJumpContextPath {\n\t\treturn \"\", NewError(path, errOutsideContextDir)\n\t}\n\treturn normalizedPath, nil\n}\n\n// EqualsOrContainsPath returns true if the value is equal to or contains the path.\n//\n// The path and value are expected to be normalized and validated if Relative is used.\n// The path and value are expected to be normalized and absolute if Absolute is used.\nfunc EqualsOrContainsPath(value string, path string, pathType PathType) bool {\n\tpathRoot := stringOSPathSeparator\n\tif pathType == Relative {\n\t\tpathRoot = \".\"\n\t}\n\n\tif value == pathRoot {\n\t\treturn true\n\t}\n\n\t// Walk up the path and compare at each directory level until there is a\n\t// match or the path reaches its root (either `/` or `.`).\n\tfor curPath := path; curPath != pathRoot; curPath = Dir(curPath) {\n\t\tif value == curPath {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// MapHasEqualOrContainingPath returns true if the path matches any file or directory in the map.\n//\n// The path and keys in m are expected to be normalized and validated if Relative is used.\n// The path and keys in m are expected to be normalized and absolute if Absolute is used.\n//\n// If the map is empty, returns false.\nfunc MapHasEqualOrContainingPath(m map[string]struct{}, path string, pathType PathType) bool {\n\tif len(m) == 0 {\n\t\treturn false\n\t}\n\n\tpathRoot := stringOSPathSeparator\n\tif pathType == Relative {\n\t\tpathRoot = \".\"\n\t}\n\n\tif _, ok := m[pathRoot]; ok {\n\t\treturn true\n\t}\n\tfor curPath := path; curPath != pathRoot; curPath = Dir(curPath) {\n\t\tif _, ok := m[curPath]; ok {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// MapAllEqualOrContainingPathMap returns the paths in m that are equal to, or contain\n// path, in a new map.\n//\n// The path and keys in m are expected to be normalized and validated if Relative is used.\n// The path and keys in m are expected to be normalized and absolute if Absolute is used.\n//\n// If the map is empty, returns nil.\nfunc MapAllEqualOrContainingPathMap(m map[string]struct{}, path string, pathType PathType) map[string]struct{} {\n\tif len(m) == 0 {\n\t\treturn nil\n\t}\n\n\tpathRoot := stringOSPathSeparator\n\tif pathType == Relative {\n\t\tpathRoot = \".\"\n\t}\n\n\tn := make(map[string]struct{})\n\tif _, ok := m[pathRoot]; ok {\n\t\t// also covers if path == separator.\n\t\tn[pathRoot] = struct{}{}\n\t}\n\tfor potentialMatch := range m {\n\t\tfor curPath := path; curPath != pathRoot; curPath = Dir(curPath) {\n\t\t\tif potentialMatch == curPath {\n\t\t\t\tn[potentialMatch] = struct{}{}\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn n\n}\n\n// Components splits the path into it's components.\n//\n// This calls filepath.Split repeatedly.\n//\n// The path is expected to be normalized.\nfunc Components(path string) []string {\n\tvar components []string\n\tdir := Unnormalize(path)\n\tfor {\n\t\tvar file string\n\t\tdir, file = filepath.Split(dir)\n\t\t// puts in reverse\n\t\tcomponents = append(components, file)\n\t\tif dir == stringOSPathSeparator {\n\t\t\tcomponents = append(components, dir)\n\t\t\tbreak\n\t\t}\n\t\tdir = strings.TrimSuffix(dir, stringOSPathSeparator)\n\t\tif dir == \"\" {\n\t\t\tbreak\n\t\t}\n\t}\n\tslices.Reverse(components)\n\tfor i, component := range components {\n\t\tcomponents[i] = Normalize(component)\n\t}\n\treturn components\n}\n"
  },
  {
    "path": "private/pkg/normalpath/normalpath_unix_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 normalpath\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestNormalizeAndValidate(t *testing.T) {\n\tt.Parallel()\n\tpath, err := NormalizeAndValidate(\"\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \".\", path)\n\tpath, err = NormalizeAndValidate(\".\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \".\", path)\n\tpath, err = NormalizeAndValidate(\"./.\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \".\", path)\n\tpath, err = NormalizeAndValidate(\"./foo\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"foo\", path)\n\n\t_, err = NormalizeAndValidate(\"/foo\")\n\tassert.Error(t, err)\n\n\t_, err = NormalizeAndValidate(\"../foo\")\n\tassert.Error(t, err)\n\n\t_, err = NormalizeAndValidate(\"..\")\n\tassert.Error(t, err)\n}\n\nfunc TestNormalize(t *testing.T) {\n\tt.Parallel()\n\tassert.Equal(t, \".\", Normalize(\"\"))\n\tassert.Equal(t, \".\", Normalize(\".\"))\n\tassert.Equal(t, \".\", Normalize(\"./.\"))\n\tassert.Equal(t, \"foo\", Normalize(\"./foo\"))\n\tassert.Equal(t, \"../foo\", Normalize(\"../foo\"))\n\tassert.Equal(t, \"../foo\", Normalize(\"../foo\"))\n\tassert.Equal(t, \"foo\", Normalize(\"foo/\"))\n\tassert.Equal(t, \"foo\", Normalize(\"./foo/\"))\n\tassert.Equal(t, \"/foo\", Normalize(\"/foo\"))\n\tassert.Equal(t, \"/foo\", Normalize(\"/foo/\"))\n\tassert.Equal(t, \"/foo/bar\", Normalize(\"/foo/../foo/bar\"))\n}\n\nfunc TestUnnormalize(t *testing.T) {\n\tt.Parallel()\n\tassert.Equal(t, \"\", Unnormalize(\"\"))\n\tassert.Equal(t, \".\", Unnormalize(\".\"))\n\tassert.Equal(t, \"/foo\", Unnormalize(\"/foo\"))\n}\n\nfunc TestBase(t *testing.T) {\n\tt.Parallel()\n\ttestBase(t, \".\", \".\")\n\ttestBase(t, \".\", \".\")\n\ttestBase(t, \".\", \"./.\")\n\ttestBase(t, \"foo\", \"./foo\")\n\ttestBase(t, \"bar\", \"./foo/bar\")\n\ttestBase(t, \"bar\", \"../foo/bar\")\n\ttestBase(t, \"foo\", \"/foo\")\n\ttestBase(t, \"bar\", \"/foo/bar\")\n}\n\nfunc testBase(t *testing.T, expected string, input string) {\n\tif os.PathSeparator == '/' {\n\t\tassert.Equal(t, expected, filepath.Base(input))\n\t}\n\tassert.Equal(t, expected, Base(input))\n}\n\nfunc TestDir(t *testing.T) {\n\tt.Parallel()\n\ttestDir(t, \".\", \"\")\n\ttestDir(t, \".\", \".\")\n\ttestDir(t, \"/\", \"/\")\n\ttestDir(t, \".\", \"./\")\n\ttestDir(t, \".\", \"./.\")\n\ttestDir(t, \".\", \"foo\")\n\ttestDir(t, \".\", \"./foo\")\n\ttestDir(t, \"foo\", \"./foo/bar\")\n\ttestDir(t, \"../foo\", \"../foo/bar\")\n\ttestDir(t, \"../foo\", \"../foo/bar/../..\")\n\ttestDir(t, \"/foo\", \"/foo/bar\")\n\ttestDir(t, \"/\", \"/foo\")\n}\n\nfunc testDir(t *testing.T, expected string, input string) {\n\tassert.Equal(t, expected, Dir(input))\n}\n\nfunc TestExt(t *testing.T) {\n\tt.Parallel()\n\ttestExt(t, \"\", \"\")\n\ttestExt(t, \".\", \".\")\n\ttestExt(t, \".txt\", \".txt\")\n\ttestExt(t, \".txt\", \".js.txt\")\n\ttestExt(t, \"\", \"foo\")\n\ttestExt(t, \".txt\", \"foo.txt\")\n\ttestExt(t, \".txt\", \"foo.js.txt\")\n\ttestExt(t, \"\", \"./foo\")\n\ttestExt(t, \".txt\", \"./foo.txt\")\n\ttestExt(t, \".txt\", \"./foo.js.txt\")\n\ttestExt(t, \"\", \"./foo/bar\")\n\ttestExt(t, \".txt\", \"./foo/bar.txt\")\n\ttestExt(t, \".txt\", \"./foo/bar.txt\")\n\ttestExt(t, \".txt\", \"./foo/bar.js.txt\")\n\ttestExt(t, \"\", \"../foo/bar\")\n\ttestExt(t, \".txt\", \"../foo/bar.txt\")\n\ttestExt(t, \".txt\", \"../foo/bar.js.txt\")\n}\n\nfunc testExt(t *testing.T, expected string, input string) {\n\tif os.PathSeparator == '/' {\n\t\tassert.Equal(t, expected, filepath.Ext(input))\n\t}\n\tassert.Equal(t, expected, Ext(input))\n}\n\nfunc TestJoin(t *testing.T) {\n\tt.Parallel()\n\ttestJoin(t, \"\", \"\")\n\ttestJoin(t, \"\", \"\", \"\")\n\ttestJoin(t, \".\", \".\", \".\")\n\ttestJoin(t, \".\", \"\", \".\", \"\")\n\ttestJoin(t, \"foo/bar\", \"foo\", \"./bar\")\n\ttestJoin(t, \"foo\", \"foo\", \"./bar\", \"..\")\n\ttestJoin(t, \"/foo/bar\", \"/foo\", \"./bar\")\n\ttestJoin(t, \"/foo\", \"/foo\", \"./bar\", \"..\")\n\ttestJoin(t, \"bar\", \".\", \"bar\")\n}\n\nfunc testJoin(t *testing.T, expected string, input ...string) {\n\tif os.PathSeparator == '/' {\n\t\tassert.Equal(t, expected, filepath.Join(input...))\n\t}\n\tassert.Equal(t, expected, Join(input...))\n}\n\nfunc TestRel(t *testing.T) {\n\tt.Parallel()\n\ttestRel(t, \".\", \"\", \"\")\n\ttestRel(t, \".\", \"\", \".\")\n\ttestRel(t, \".\", \".\", \"\")\n\ttestRel(t, \".\", \".\", \".\")\n\ttestRel(t, \".\", \"foo\", \"foo\")\n\ttestRel(t, \"foo\", \".\", \"foo\")\n\ttestRel(t, \"foo\", \".\", \"./foo\")\n\ttestRel(t, \"foo/bar\", \".\", \"foo/bar\")\n\ttestRel(t, \"bar\", \"/foo\", \"/foo/bar\")\n\ttestRel(t, \"bar\", \"foo\", \"foo/bar\")\n\ttestRel(t, \"baz\", \"/foo/./bar\", \"/foo/bar/baz\")\n\ttestRel(t, \"baz\", \"foo/./bar\", \"foo/bar/baz\")\n\ttestRelError(t, \"\", \"..\", \"foo/bar\")\n}\n\nfunc testRel(t *testing.T, expected string, basepath string, targpath string) {\n\tif os.PathSeparator == '/' {\n\t\trel, err := filepath.Rel(basepath, targpath)\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, expected, rel)\n\t}\n\trel, err := Rel(basepath, targpath)\n\tassert.NoError(t, err)\n\tassert.Equal(t, expected, rel)\n}\n\nfunc testRelError(t *testing.T, expected string, basepath string, targpath string) {\n\tif os.PathSeparator == '/' {\n\t\trel, err := filepath.Rel(basepath, targpath)\n\t\tassert.Error(t, err)\n\t\tassert.Equal(t, expected, rel)\n\t}\n\trel, err := Rel(basepath, targpath)\n\tassert.Error(t, err)\n\tassert.Equal(t, expected, rel)\n}\n\nfunc TestComponents(t *testing.T) {\n\tt.Parallel()\n\ttestComponents(t, \"\", \".\")\n\ttestComponents(t, \".\", \".\")\n\ttestComponents(t, \"foo\", \"foo\")\n\ttestComponents(t, \"foo/bar\", \"foo\", \"bar\")\n\ttestComponents(t, \"foo/bar/../baz\", \"foo\", \"bar\", \"..\", \"baz\")\n\ttestComponents(t, \"/foo/bar\", \"/\", \"foo\", \"bar\")\n\ttestComponents(t, \"./foo/bar\", \".\", \"foo\", \"bar\")\n\ttestComponents(t, \"../foo/bar\", \"..\", \"foo\", \"bar\")\n}\n\nfunc testComponents(t *testing.T, path string, expected ...string) {\n\tassert.Equal(t, expected, Components(path))\n}\n\nfunc TestStripComponents(t *testing.T) {\n\tt.Parallel()\n\ttestStripComponents(t, 0, \"\", true, \"\")\n\ttestStripComponents(t, 0, \"foo\", true, \"foo\")\n\ttestStripComponents(t, 0, \"foo\", true, \"foo\")\n\ttestStripComponents(t, 1, \"\", false, \"foo\")\n\ttestStripComponents(t, 1, \"bar\", true, \"foo/bar\")\n\ttestStripComponents(t, 1, \"bar/baz\", true, \"foo/bar/baz\")\n\ttestStripComponents(t, 2, \"baz\", true, \"foo/bar/baz\")\n\ttestStripComponents(t, 1, \"bar/baz/bat\", true, \"foo/bar/baz/bat\")\n\ttestStripComponents(t, 2, \"baz/bat\", true, \"foo/bar/baz/bat\")\n\ttestStripComponents(t, 3, \"bat\", true, \"foo/bar/baz/bat\")\n\ttestStripComponents(t, 4, \"\", false, \"foo/bar/baz/bat\")\n\ttestStripComponents(t, 5, \"\", false, \"foo/bar/baz/bat\")\n}\n\nfunc testStripComponents(t *testing.T, count uint32, expected string, expectedOK bool, path string) {\n\tactual, ok := StripComponents(path, count)\n\tassert.Equal(t, expectedOK, ok)\n\tassert.Equal(t, expected, actual)\n}\n\nfunc TestByDir(t *testing.T) {\n\tt.Parallel()\n\tassert.Equal(\n\t\tt,\n\t\tmap[string][]string{\n\t\t\t\"one\": {\n\t\t\t\t\"one/1.txt\",\n\t\t\t\t\"one/2.txt\",\n\t\t\t\t\"one/3.txt\",\n\t\t\t},\n\t\t\t\"two\": {\n\t\t\t\t\"two/1.txt\",\n\t\t\t\t\"two/2.txt\",\n\t\t\t\t\"two/3.txt\",\n\t\t\t},\n\t\t},\n\t\tByDir(\n\t\t\t\"one/2.txt\",\n\t\t\t\"one/1.txt\",\n\t\t\t\"two/2.txt\",\n\t\t\t\"one/3.txt\",\n\t\t\t\"two/1.txt\",\n\t\t\t\"two/3.txt\",\n\t\t),\n\t)\n\tassert.Equal(\n\t\tt,\n\t\tmap[string][]string{\n\t\t\t\".\": {\n\t\t\t\t\"1.txt\",\n\t\t\t\t\"2.txt\",\n\t\t\t\t\"3.txt\",\n\t\t\t},\n\t\t\t\"two\": {\n\t\t\t\t\"two/1.txt\",\n\t\t\t\t\"two/2.txt\",\n\t\t\t\t\"two/3.txt\",\n\t\t\t},\n\t\t},\n\t\tByDir(\n\t\t\t\"2.txt\",\n\t\t\t\"1.txt\",\n\t\t\t\"3.txt\",\n\t\t\t\"two/3.txt\",\n\t\t\t\"two/2.txt\",\n\t\t\t\"two/1.txt\",\n\t\t),\n\t)\n}\n\nfunc TestContainsPath(t *testing.T) {\n\tt.Parallel()\n\ttestContainsPath(t, false, \"a.proto\", \"a.proto\")\n\ttestContainsPath(t, true, \".\", \"a.proto\")\n\ttestContainsPath(t, false, \"a.proto\", \".\")\n\ttestContainsPath(t, false, \".\", \".\")\n\ttestContainsPath(t, true, \".\", \"a/b.proto\")\n\ttestContainsPath(t, true, \".\", \"a/b\")\n\ttestContainsPath(t, false, \"a\", \"ab/c\")\n\ttestContainsPath(t, true, \"a\", \"a/b/c\")\n\ttestContainsPath(t, false, \"b\", \"a/b/c\")\n\ttestContainsPath(t, true, \"b\", \"b/b/c\")\n\ttestContainsPath(t, true, \"b\", \"b/a/c\")\n}\n\nfunc testContainsPath(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, ContainsPath(value, path, Relative), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestEqualsOrContainsPath(t *testing.T) {\n\tt.Parallel()\n\ttestEqualsOrContainsPath(t, true, \"a.proto\", \"a.proto\")\n\ttestEqualsOrContainsPath(t, true, \".\", \"a.proto\")\n\ttestEqualsOrContainsPath(t, false, \"a.proto\", \".\")\n\ttestEqualsOrContainsPath(t, true, \".\", \"a/b.proto\")\n\ttestEqualsOrContainsPath(t, true, \".\", \"a/b\")\n\ttestEqualsOrContainsPath(t, false, \"a\", \"ab/c\")\n\ttestEqualsOrContainsPath(t, true, \"a\", \"a/b/c\")\n\ttestEqualsOrContainsPath(t, false, \"b\", \"a/b/c\")\n\ttestEqualsOrContainsPath(t, true, \"b\", \"b/b/c\")\n\ttestEqualsOrContainsPath(t, true, \"b\", \"b/a/c\")\n}\n\nfunc testEqualsOrContainsPath(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, EqualsOrContainsPath(value, path, Relative), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestMapHasEqualOrContainingPath(t *testing.T) {\n\tt.Parallel()\n\ttestMapHasEqualOrContainingPath(t, true, \"a.proto\", \"a.proto\")\n\ttestMapHasEqualOrContainingPath(t, false, \".\", \"a.proto\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a.proto\", \".\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a/b.proto\", \".\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a/b\", \".\")\n\ttestMapHasEqualOrContainingPath(t, false, \"ab/c\", \"a\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a/b/c\", \"a\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, false, \"a/b/c\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"b/b/c\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"b/a/c\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"b/b/c\", \"b\", \".\")\n}\n\nfunc testMapHasEqualOrContainingPath(t *testing.T, expected bool, path string, keys ...string) {\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapHasEqualOrContainingPath(keyMap, path, Relative), fmt.Sprintf(\"%s %v\", path, keys))\n}\n\nfunc TestMapAllEqualOrContainingPaths(t *testing.T) {\n\tt.Parallel()\n\ttestMapAllEqualOrContainingPaths(t, []string{\"a.proto\"}, \"a.proto\", \"a.proto\")\n\ttestMapAllEqualOrContainingPaths(t, nil, \".\", \"a.proto\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\".\"}, \"a.proto\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\".\"}, \"a/b.proto\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\".\"}, \"a/b\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, nil, \"ab/c\", \"a\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"a\"}, \"a/b/c\", \"a\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, nil, \"a/b/c\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\"}, \"b/b/c\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\"}, \"b/a/c\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\", \".\"}, \"b/b/c\", \"b\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\", \"b/b\", \".\"}, \"b/b/c\", \"b\", \"b/b\", \".\")\n}\n\nfunc testMapAllEqualOrContainingPaths(t *testing.T, expected []string, path string, keys ...string) {\n\tif expected == nil {\n\t\texpected = make([]string, 0)\n\t}\n\tsort.Strings(expected)\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapAllEqualOrContainingPaths(keyMap, path, Relative), fmt.Sprintf(\"%s %v\", path, keys))\n}\n\nfunc TestContainsPathAbs(t *testing.T) {\n\tt.Parallel()\n\ttestContainsPathAbs(t, false, \"/a.proto\", \"/a.proto\")\n\ttestContainsPathAbs(t, true, \"/\", \"/a.proto\")\n\ttestContainsPathAbs(t, false, \"/a.proto\", \"/\")\n\ttestContainsPathAbs(t, false, \"/\", \"/\")\n\ttestContainsPathAbs(t, true, \"/\", \"/a/b.proto\")\n\ttestContainsPathAbs(t, true, \"/\", \"/a/b\")\n\ttestContainsPathAbs(t, false, \"/a\", \"/ab/c\")\n\ttestContainsPathAbs(t, true, \"/a\", \"/a/b/c\")\n\ttestContainsPathAbs(t, false, \"/b\", \"/a/b/c\")\n\ttestContainsPathAbs(t, true, \"/b\", \"/b/b/c\")\n\ttestContainsPathAbs(t, true, \"/b\", \"/b/a/c\")\n}\n\nfunc testContainsPathAbs(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, ContainsPath(value, path, Absolute), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestEqualsOrContainsPathAbs(t *testing.T) {\n\tt.Parallel()\n\ttestEqualsOrContainsPathAbs(t, true, \"/a.proto\", \"/a.proto\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/\", \"/a.proto\")\n\ttestEqualsOrContainsPathAbs(t, false, \"a.proto\", \"/\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/\", \"/a/b.proto\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/\", \"/a/b\")\n\ttestEqualsOrContainsPathAbs(t, false, \"/a\", \"/ab/c\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/a\", \"/a/b/c\")\n\ttestEqualsOrContainsPathAbs(t, false, \"/b\", \"/a/b/c\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/b\", \"/b/b/c\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/b\", \"/b/a/c\")\n}\n\nfunc testEqualsOrContainsPathAbs(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, EqualsOrContainsPath(value, path, Absolute), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestMapHasEqualOrContainingPathAbs(t *testing.T) {\n\tt.Parallel()\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a.proto\", \"/a.proto\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"/\", \"/a.proto\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a.proto\", \"/\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a/b.proto\", \"/\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a/b\", \"/\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"/ab/c\", \"/a\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a/b/c\", \"/a\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"/a/b/c\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/b/b/c\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/b/a/c\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/b/b/c\", \"/b\", \"/\")\n}\n\nfunc testMapHasEqualOrContainingPathAbs(t *testing.T, expected bool, path string, keys ...string) {\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapHasEqualOrContainingPath(keyMap, path, Absolute), fmt.Sprintf(\"%s %v\", path, keys))\n}\n\nfunc TestMapAllEqualOrContainingPathsAbs(t *testing.T) {\n\tt.Parallel()\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/a.proto\"}, \"/a.proto\", \"/a.proto\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"/\", \"/a.proto\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/\"}, \"/a.proto\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/\"}, \"/a/b.proto\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/\"}, \"/a/b\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"/ab/c\", \"/a\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/a\"}, \"/a/b/c\", \"/a\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"/a/b/c\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\"}, \"/b/b/c\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\"}, \"/b/a/c\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\", \"/\"}, \"/b/b/c\", \"/b\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\", \"/b/b\", \"/\"}, \"/b/b/c\", \"/b\", \"/b/b\", \"/\")\n}\n\nfunc testMapAllEqualOrContainingPathsAbs(t *testing.T, expected []string, path string, keys ...string) {\n\tif expected == nil {\n\t\texpected = make([]string, 0)\n\t}\n\tsort.Strings(expected)\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapAllEqualOrContainingPaths(keyMap, path, Absolute), fmt.Sprintf(\"%s %v\", path, keys))\n}\n"
  },
  {
    "path": "private/pkg/normalpath/normalpath_windows.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 normalpath\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"slices\"\n\t\"strings\"\n)\n\n// NormalizeAndValidate normalizes and validates the given path.\n//\n// This calls Normalize on the path.\n// Returns Error if the path is not relative or jumps context.\n// This can be used to validate that paths are valid to use with Buckets.\n// The error message is safe to pass to users.\nfunc NormalizeAndValidate(path string) (string, error) {\n\tnormalizedPath := Normalize(path)\n\tif filepath.IsAbs(normalizedPath) || (len(normalizedPath) > 0 && normalizedPath[0] == '/') {\n\t\t// the stdlib implementation of `IsAbs` assumes that a volume name is required for a path to\n\t\t// be absolute, however Windows treats a `/` (normalized) rooted path as absolute _within_ the current volume.\n\t\t// In the context of validating that a path is _not_ relative, we need to reject a path that begins\n\t\t// with `/`.\n\t\treturn \"\", NewError(path, errNotRelative)\n\t}\n\t// https://github.com/bufbuild/buf/issues/51\n\tif strings.HasPrefix(normalizedPath, normalizedRelPathJumpContextPrefix) ||\n\t\tnormalizedPath == normalizedRelPathJumpContextPath {\n\t\treturn \"\", NewError(path, errOutsideContextDir)\n\t}\n\treturn normalizedPath, nil\n}\n\n// EqualsOrContainsPath returns true if the value is equal to or contains the path.\n// path is compared at each directory level to value for equivalency under simple unicode\n// codepoint folding. This means it is context and locale independent. This matching\n// will not support the few rare cases, primarily in Turkish and Lithuanian, noted\n// in the caseless matching section of Unicode 13.0 https://www.unicode.org/versions/Unicode13.0.0/ch05.pdf#page=47.\n//\n// The path and value are expected to be normalized and validated if Relative is used.\n// The path and value are expected to be normalized and absolute if Absolute is used.\nfunc EqualsOrContainsPath(value string, path string, pathType PathType) bool {\n\tcurPath := path\n\tvar lastSeen string\n\tfor {\n\t\tif strings.EqualFold(value, curPath) {\n\t\t\treturn true\n\t\t}\n\t\tcurPath = Dir(curPath)\n\t\tif lastSeen == curPath {\n\t\t\tbreak\n\t\t}\n\t\tlastSeen = curPath\n\t}\n\treturn false\n}\n\n// MapHasEqualOrContainingPath returns true if the path matches any file or directory in the map.\n//\n// The path and keys in m are expected to be normalized and validated if Relative is used.\n// The path and keys in m are expected to be normalized and absolute if Absolute is used.\n//\n// If the map is empty, returns false.\nfunc MapHasEqualOrContainingPath(m map[string]struct{}, path string, pathType PathType) bool {\n\tif len(m) == 0 {\n\t\treturn false\n\t}\n\n\tfor value := range m {\n\t\tif EqualsOrContainsPath(value, path, pathType) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\n// MapAllEqualOrContainingPathMap returns the paths in m that are equal to, or contain\n// path, in a new map.\n//\n// The path and keys in m are expected to be normalized and validated if Relative is used.\n// The path and keys in m are expected to be normalized and absolute if Absolute is used.\n//\n// If the map is empty, returns nil.\nfunc MapAllEqualOrContainingPathMap(m map[string]struct{}, path string, pathType PathType) map[string]struct{} {\n\tif len(m) == 0 {\n\t\treturn nil\n\t}\n\n\tn := make(map[string]struct{})\n\n\tfor potentialMatch := range m {\n\t\tif EqualsOrContainsPath(potentialMatch, path, pathType) {\n\t\t\tn[potentialMatch] = struct{}{}\n\t\t}\n\t}\n\treturn n\n}\n\n// Components splits the path into its components.\n//\n// This calls filepath.Split repeatedly.\n//\n// The path is expected to be normalized.\nfunc Components(path string) []string {\n\tvar components []string\n\n\tif len(path) < 1 {\n\t\treturn []string{\".\"}\n\t}\n\n\tdir := Unnormalize(path)\n\n\tvolumeComponent := filepath.VolumeName(dir)\n\tif len(volumeComponent) > 0 {\n\t\t// On Windows the volume of an absolute path could be one of the following 3 forms\n\t\t// c.f. https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#fully-qualified-vs-relative-paths\n\t\t// * A disk designator: `C:\\`\n\t\t// * A UNC Path: `\\\\servername\\share\\`\n\t\t//   c.f. https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dfsc/149a3039-98ce-491a-9268-2f5ddef08192\n\t\t// * A \"current volume absolute path\" `\\`\n\t\t//   This refers to the root of the current volume\n\t\t//\n\t\t// We do not support paths with string parsing disabled such as\n\t\t// `\\\\?\\path`\n\t\t//\n\t\t// If we did extract a volume name, we need to add a path separator to turn it into\n\t\t// a path component. Volume Names without path separators have an implied \"current directory\"\n\t\t// when performing a join operation, or using them as a path directly, which is not the\n\t\t// intention of `Split` so we ensure they always mean \"the root of this volume\".\n\t\tvolumeComponent = volumeComponent + stringOSPathSeparator\n\t}\n\tif len(volumeComponent) < 1 && dir[0] == os.PathSeparator {\n\t\t// If we didn't extract a volume name then the path is either\n\t\t// absolute and starts with an os.PathSeparator (it must be exactly 1\n\t\t// otherwise its a UNC path and we would have found a volume above) or it is relative.\n\t\t// If it is absolute, we set the expected volume component to os.PathSeparator.\n\t\t// otherwise we leave it as an empty string.\n\t\tvolumeComponent = stringOSPathSeparator\n\t}\n\tfor {\n\t\tvar file string\n\t\tdir, file = filepath.Split(dir)\n\t\t// puts in reverse\n\t\tcomponents = append(components, file)\n\n\t\tif dir == volumeComponent {\n\t\t\tif volumeComponent != \"\" {\n\t\t\t\tcomponents = append(components, dir)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\tdir = strings.TrimSuffix(dir, stringOSPathSeparator)\n\t}\n\tslices.Reverse(components)\n\tfor i, component := range components {\n\t\tcomponents[i] = Normalize(component)\n\t}\n\treturn components\n}\n"
  },
  {
    "path": "private/pkg/normalpath/normalpath_windows_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 normalpath\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestNormalizeAndValidate(t *testing.T) {\n\tt.Parallel()\n\tpath, err := NormalizeAndValidate(\"\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \".\", path)\n\tpath, err = NormalizeAndValidate(\".\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \".\", path)\n\tpath, err = NormalizeAndValidate(\"./.\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \".\", path)\n\tpath, err = NormalizeAndValidate(\"./foo\")\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"foo\", path)\n\n\t// Drive letter path\n\t_, err = NormalizeAndValidate(\"c:\\\\foo\")\n\tassert.Error(t, err)\n\n\t// Network Drive UNC path\n\t_, err = NormalizeAndValidate(\"\\\\\\\\127.0.0.1\\\\$c\\\\\")\n\tassert.Error(t, err)\n\n\t// Absolute path on current drive\n\t_, err = NormalizeAndValidate(\"\\\\root\\\\path\")\n\tassert.Error(t, err)\n\n\t_, err = NormalizeAndValidate(\"../foo\")\n\tassert.Error(t, err)\n\n\t_, err = NormalizeAndValidate(\"..\")\n\tassert.Error(t, err)\n}\n\nfunc TestNormalize(t *testing.T) {\n\tt.Parallel()\n\tassert.Equal(t, \".\", Normalize(\"\"))\n\tassert.Equal(t, \".\", Normalize(\".\"))\n\tassert.Equal(t, \".\", Normalize(\".\\\\.\"))\n\tassert.Equal(t, \"foo\", Normalize(\".\\\\foo\"))\n\tassert.Equal(t, \"../foo\", Normalize(\"..\\\\foo\"))\n\tassert.Equal(t, \"../Foo\", Normalize(\"..\\\\Foo\"))\n\tassert.Equal(t, \"foo\", Normalize(\"foo\\\\\"))\n\tassert.Equal(t, \"foo\", Normalize(\".\\\\foo\\\\\"))\n\tassert.Equal(t, \"c:/foo\", Normalize(\"c:\\\\foo\"))\n\tassert.Equal(t, \"C:/foo\", Normalize(\"C:\\\\foo\\\\\"))\n\tassert.Equal(t, \"c:/foo/bar\", Normalize(\"c:\\\\foo\\\\..\\\\foo\\\\bar\\\\\"))\n\tassert.Equal(t, \"//127.0.0.1/$c/foo/bar\", Normalize(\"\\\\\\\\127.0.0.1\\\\$c\\\\foo\\\\bar\\\\\"))\n\tassert.Equal(t, \"c:/\", Normalize(\"c:\\\\\"))\n\tassert.Equal(t, \"//127.0.0.1/$c/\", Normalize(\"\\\\\\\\127.0.0.1\\\\$c\\\\\"))\n}\n\nfunc TestUnnormalize(t *testing.T) {\n\tt.Parallel()\n\tassert.Equal(t, \"\", Unnormalize(\"\"))\n\tassert.Equal(t, \".\", Unnormalize(\".\"))\n\tassert.Equal(t, \".\\\\foo\\\\bar\", Unnormalize(\"./foo/bar\"))\n\tassert.Equal(t, \"c:\\\\foo\\\\bar\", Unnormalize(\"c:/foo/bar\"))\n\tassert.Equal(t, \"\\\\foo\\\\bar\", Unnormalize(\"/foo/bar\"))\n\tassert.Equal(t, \"\\\\\\\\127.0.0.1\\\\$c\\\\foo\\\\bar\", Unnormalize(\"//127.0.0.1/$c/foo/bar\"))\n}\n\nfunc TestBase(t *testing.T) {\n\tt.Parallel()\n\ttestBase(t, \".\", \".\")\n\ttestBase(t, \".\", \".\")\n\ttestBase(t, \".\", \"./.\")\n\ttestBase(t, \"foo\", \"./foo\")\n\ttestBase(t, \"bar\", \"./foo/bar\")\n\ttestBase(t, \"bar\", \"../foo/bar\")\n\ttestBase(t, \"foo\", \"/foo\")\n\ttestBase(t, \"bar\", \"/foo/bar\")\n\ttestBase(t, \"baz\", \"c:/foo/bar/baz\")\n\ttestBase(t, \"baz\", \"//127.0.0.1/$D/foo/bar/baz\")\n\n\t// Base doesn't specify the input is normalized.\n\ttestBase(t, \"bar\", \"c:\\\\foo\\\\bar\")\n\ttestBase(t, \"baz\", \"\\\\\\\\127.0.0.1\\\\$c\\\\foo\\\\bar\\\\baz\")\n}\n\nfunc testBase(t *testing.T, expected string, input string) {\n\tassert.Equal(t, expected, Base(input))\n}\n\nfunc TestDir(t *testing.T) {\n\tt.Parallel()\n\ttestDir(t, \".\", \"\")\n\ttestDir(t, \".\", \".\")\n\ttestDir(t, \"c:/\", \"c:\\\\\")\n\ttestDir(t, \".\", \".\\\\\")\n\ttestDir(t, \".\", \".\\\\.\")\n\ttestDir(t, \".\", \"foo\")\n\ttestDir(t, \".\", \".\\\\foo\")\n\ttestDir(t, \"foo\", \".\\\\foo\\\\bar\")\n\ttestDir(t, \"../foo\", \"..\\\\foo\\\\bar\")\n\ttestDir(t, \"../foo\", \"..\\\\foo\\\\bar\\\\..\\\\..\")\n\ttestDir(t, \"c:/foo\", \"c:\\\\foo\\\\bar\")\n\ttestDir(t, \"//127.0.0.1/$c/\", \"\\\\\\\\127.0.0.1\\\\$c\\\\foo\")\n\ttestDir(t, \"/foo\", \"\\\\foo\\\\bar\")\n}\n\nfunc testDir(t *testing.T, expected string, input string) {\n\tassert.Equal(t, expected, Dir(input))\n}\n\nfunc TestExt(t *testing.T) {\n\tt.Parallel()\n\ttestExt(t, \"\", \"\")\n\ttestExt(t, \".\", \".\")\n\ttestExt(t, \".txt\", \".txt\")\n\ttestExt(t, \".txt\", \".js.txt\")\n\ttestExt(t, \"\", \"foo\")\n\ttestExt(t, \".txt\", \"foo.txt\")\n\ttestExt(t, \".txt\", \"foo.js.txt\")\n\ttestExt(t, \"\", \".\\\\foo\")\n\ttestExt(t, \".txt\", \".\\\\foo.txt\")\n\ttestExt(t, \".txt\", \".\\\\foo.js.txt\")\n\ttestExt(t, \"\", \".\\\\foo\\\\bar\")\n\ttestExt(t, \".txt\", \".\\\\foo\\\\bar.txt\")\n\ttestExt(t, \".txt\", \".\\\\foo\\\\bar.txt\")\n\ttestExt(t, \".txt\", \".\\\\foo\\\\bar.js.txt\")\n\ttestExt(t, \"\", \"..\\\\foo\\\\bar\")\n\ttestExt(t, \".txt\", \"..\\\\foo\\\\bar.txt\")\n\ttestExt(t, \".txt\", \"..\\\\foo\\\\bar.js.txt\")\n\ttestExt(t, \".txt\", \"\\\\\\\\127.0.0.1\\\\$d\\\\foo.txt\")\n\ttestExt(t, \".txt\", \"c:\\\\foo.txt\")\n}\n\nfunc testExt(t *testing.T, expected string, input string) {\n\tassert.Equal(t, expected, Ext(input))\n}\n\nfunc TestJoin(t *testing.T) {\n\tt.Parallel()\n\ttestJoin(t, \"\", \"\")\n\ttestJoin(t, \"\", \"\", \"\")\n\ttestJoin(t, \".\", \".\", \".\")\n\ttestJoin(t, \".\", \"\", \".\", \"\")\n\ttestJoin(t, \"foo/bar\", \"foo\", \".\\\\bar\")\n\ttestJoin(t, \"foo\", \"foo\", \".\\\\bar\", \"..\")\n\ttestJoin(t, \"c:/foo/bar\", \"c:\\\\\", \"foo\", \".\\\\bar\")\n\ttestJoin(t, \"//127.0.0.1/$c/foo\", \"\\\\\\\\127.0.0.1\\\\$c\\\\\", \"foo\", \".\\\\bar\", \"..\")\n\ttestJoin(t, \"bar\", \".\", \"bar\")\n\ttestJoin(t, \"/foo/bar\", \"\\\\foo\", \".\", \".\", \".\", \"baz\", \"..\", \"bar\")\n}\n\nfunc testJoin(t *testing.T, expected string, input ...string) {\n\tassert.Equal(t, expected, Join(input...))\n}\n\nfunc TestRel(t *testing.T) {\n\tt.Parallel()\n\ttestRel(t, \".\", \"\", \"\")\n\ttestRel(t, \".\", \"\", \".\")\n\ttestRel(t, \".\", \".\", \"\")\n\ttestRel(t, \".\", \".\", \".\")\n\ttestRel(t, \".\", \"foo\", \"foo\")\n\ttestRel(t, \"foo\", \".\", \"foo\")\n\ttestRel(t, \"foo\", \".\", \"./foo\")\n\ttestRel(t, \"foo/bar\", \".\", \"foo/bar\")\n\ttestRel(t, \"bar\", \"c:\\\\foo\", \"c:\\\\foo\\\\bar\")\n\ttestRel(t, \"bar\", \"foo\", \"foo/bar\")\n\ttestRel(t, \"baz\", \"c:\\\\foo/./bar\", \"c:\\\\foo\\\\bar\\\\baz\")\n\ttestRel(t, \"baz\", \"foo/./bar\", \"foo/bar/baz\")\n\n\t// This would require querying the current directory to know what\n\t// Drive `\\` refers to.\n\ttestRelError(t, \"\", \"\\\\foo\\\\bar\", \"c:\\\\foo\\\\bar\")\n\n\ttestRelError(t, \"\", \"..\", \"foo/bar\")\n\ttestRelError(t, \"\", \"c:\\\\foo\", \"d:\\\\bar\")\n\ttestRelError(t, \"\", \"\\\\\\\\127.0.0.1\\\\$c\\\\foo\", \"\\\\\\\\127.0.0.1\\\\$d\\\\foo\")\n}\n\nfunc testRel(t *testing.T, expected string, basepath string, targpath string) {\n\trel, err := Rel(basepath, targpath)\n\tassert.NoError(t, err)\n\tassert.Equal(t, expected, rel)\n}\n\nfunc testRelError(t *testing.T, expected string, basepath string, targpath string) {\n\tif os.PathSeparator == '/' {\n\t\trel, err := filepath.Rel(basepath, targpath)\n\t\tassert.Error(t, err)\n\t\tassert.Equal(t, expected, rel)\n\t}\n\trel, err := Rel(basepath, targpath)\n\tassert.Error(t, err)\n\tassert.Equal(t, expected, rel)\n}\n\nfunc TestComponents(t *testing.T) {\n\tt.Parallel()\n\ttestComponents(t, \"\", \".\")\n\ttestComponents(t, \".\", \".\")\n\ttestComponents(t, \"foo\", \"foo\")\n\ttestComponents(t, \"foo/bar\", \"foo\", \"bar\")\n\ttestComponents(t, \"foo/bar/../baz\", \"foo\", \"bar\", \"..\", \"baz\")\n\ttestComponents(t, \"c:/foo/bar\", \"c:/\", \"foo\", \"bar\")\n\ttestComponents(t, \"//127.0.0.1/$c/foo/bar\", \"//127.0.0.1/$c/\", \"foo\", \"bar\")\n\ttestComponents(t, \"./foo/bar\", \".\", \"foo\", \"bar\")\n\ttestComponents(t, \"../foo/bar\", \"..\", \"foo\", \"bar\")\n\ttestComponents(t, \"/foo/bar\", \"/\", \"foo\", \"bar\")\n}\n\nfunc testComponents(t *testing.T, path string, expected ...string) {\n\tassert.Equal(t, expected, Components(path))\n}\n\nfunc TestStripComponents(t *testing.T) {\n\tt.Parallel()\n\ttestStripComponents(t, 0, \"\", true, \"\")\n\ttestStripComponents(t, 0, \"foo\", true, \"foo\")\n\ttestStripComponents(t, 0, \"foo\", true, \"foo\")\n\ttestStripComponents(t, 1, \"\", false, \"foo\")\n\ttestStripComponents(t, 1, \"bar\", true, \"foo/bar\")\n\ttestStripComponents(t, 1, \"bar/baz\", true, \"foo/bar/baz\")\n\ttestStripComponents(t, 2, \"baz\", true, \"foo/bar/baz\")\n\ttestStripComponents(t, 1, \"bar/baz/BAT\", true, \"foo/bar/baz/BAT\")\n\ttestStripComponents(t, 2, \"baz/BAT\", true, \"foo/bar/baz/BAT\")\n\ttestStripComponents(t, 3, \"BAT\", true, \"foo/bar/baz/BAT\")\n\ttestStripComponents(t, 4, \"\", false, \"foo/bar/baz/BAT\")\n\ttestStripComponents(t, 5, \"\", false, \"foo/bar/baz/BAT\")\n\n\t// Volume names contain separators but they are a single component\n\ttestStripComponents(t, 1, \"foo\", true, \"//127.0.0.1/$c/foo\")\n\ttestStripComponents(t, 2, \"\", false, \"//127.0.0.1/$c/foo\")\n\ttestStripComponents(t, 1, \"foo\", true, \"c:/foo\")\n\ttestStripComponents(t, 2, \"\", false, \"c:/foo\")\n}\n\nfunc testStripComponents(t *testing.T, count int, expected string, expectedOK bool, path string) {\n\tactual, ok := StripComponents(path, uint32(count))\n\tassert.Equal(t, expectedOK, ok)\n\tassert.Equal(t, expected, actual)\n}\n\nfunc TestByDir(t *testing.T) {\n\tt.Parallel()\n\tassert.Equal(\n\t\tt,\n\t\tmap[string][]string{\n\t\t\t\"one\": {\n\t\t\t\t\"one/1.txt\",\n\t\t\t\t\"one/2.txt\",\n\t\t\t\t\"one/3.txt\",\n\t\t\t},\n\t\t\t\"two\": {\n\t\t\t\t\"two/1.txt\",\n\t\t\t\t\"two/2.txt\",\n\t\t\t\t\"two/3.txt\",\n\t\t\t},\n\t\t},\n\t\tByDir(\n\t\t\t\"one/2.txt\",\n\t\t\t\"one/1.txt\",\n\t\t\t\"two/2.txt\",\n\t\t\t\"one/3.txt\",\n\t\t\t\"two/1.txt\",\n\t\t\t\"two/3.txt\",\n\t\t),\n\t)\n\tassert.Equal(\n\t\tt,\n\t\tmap[string][]string{\n\t\t\t\".\": {\n\t\t\t\t\"1.txt\",\n\t\t\t\t\"2.txt\",\n\t\t\t\t\"3.txt\",\n\t\t\t},\n\t\t\t\"two\": {\n\t\t\t\t\"two/1.txt\",\n\t\t\t\t\"two/2.txt\",\n\t\t\t\t\"two/3.txt\",\n\t\t\t},\n\t\t},\n\t\tByDir(\n\t\t\t\"2.txt\",\n\t\t\t\"1.txt\",\n\t\t\t\"3.txt\",\n\t\t\t\"two/3.txt\",\n\t\t\t\"two/2.txt\",\n\t\t\t\"two/1.txt\",\n\t\t),\n\t)\n}\n\nfunc TestContainsPath(t *testing.T) {\n\ttestContainsPath(t, false, \"a.proto\", \"a.proto\")\n\ttestContainsPath(t, true, \".\", \"a.proto\")\n\ttestContainsPath(t, false, \"a.proto\", \".\")\n\ttestContainsPath(t, false, \".\", \".\")\n\ttestContainsPath(t, true, \".\", \"a/b.proto\")\n\ttestContainsPath(t, true, \".\", \"a/b\")\n\ttestContainsPath(t, false, \"a\", \"ab/c\")\n\ttestContainsPath(t, true, \"a\", \"a/b/c\")\n\ttestContainsPath(t, false, \"b\", \"a/b/c\")\n\ttestContainsPath(t, true, \"b\", \"b/b/c\")\n\ttestContainsPath(t, true, \"b\", \"b/a/c\")\n}\n\nfunc testContainsPath(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, ContainsPath(value, path, Relative), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestEqualsOrContainsPath(t *testing.T) {\n\ttestEqualsOrContainsPath(t, true, \"a.proto\", \"a.proto\")\n\ttestEqualsOrContainsPath(t, true, \".\", \"a.proto\")\n\ttestEqualsOrContainsPath(t, false, \"a.proto\", \".\")\n\ttestEqualsOrContainsPath(t, true, \".\", \"a/b.proto\")\n\ttestEqualsOrContainsPath(t, true, \".\", \"a/b\")\n\ttestEqualsOrContainsPath(t, false, \"a\", \"ab/c\")\n\ttestEqualsOrContainsPath(t, true, \"a\", \"a/b/c\")\n\ttestEqualsOrContainsPath(t, false, \"b\", \"a/b/c\")\n\ttestEqualsOrContainsPath(t, true, \"b\", \"b/b/c\")\n\ttestEqualsOrContainsPath(t, true, \"b\", \"b/a/c\")\n}\n\nfunc testEqualsOrContainsPath(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, EqualsOrContainsPath(value, path, Relative), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestMapHasEqualOrContainingPath(t *testing.T) {\n\ttestMapHasEqualOrContainingPath(t, true, \"a.proto\", \"a.proto\")\n\ttestMapHasEqualOrContainingPath(t, false, \".\", \"a.proto\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a.proto\", \".\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a/b.proto\", \".\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a/b\", \".\")\n\ttestMapHasEqualOrContainingPath(t, false, \"ab/c\", \"a\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"a/b/c\", \"a\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, false, \"a/b/c\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"b/b/c\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"b/a/c\", \"b\")\n\ttestMapHasEqualOrContainingPath(t, true, \"b/b/c\", \"b\", \".\")\n}\n\nfunc testMapHasEqualOrContainingPath(t *testing.T, expected bool, path string, keys ...string) {\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapHasEqualOrContainingPath(keyMap, path, Relative), fmt.Sprintf(\"%s %v\", path, keys))\n}\n\nfunc TestMapAllEqualOrContainingPaths(t *testing.T) {\n\ttestMapAllEqualOrContainingPaths(t, []string{\"a.proto\"}, \"a.proto\", \"a.proto\")\n\ttestMapAllEqualOrContainingPaths(t, nil, \".\", \"a.proto\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\".\"}, \"a.proto\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\".\"}, \"a/b.proto\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\".\"}, \"a/b\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, nil, \"ab/c\", \"a\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"a\"}, \"a/b/c\", \"a\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, nil, \"a/b/c\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\"}, \"b/b/c\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\"}, \"b/a/c\", \"b\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\", \".\"}, \"b/b/c\", \"b\", \".\")\n\ttestMapAllEqualOrContainingPaths(t, []string{\"b\", \"b/b\", \".\"}, \"b/b/c\", \"b\", \"b/b\", \".\")\n}\n\nfunc testMapAllEqualOrContainingPaths(t *testing.T, expected []string, path string, keys ...string) {\n\tif expected == nil {\n\t\texpected = make([]string, 0)\n\t}\n\tsort.Strings(expected)\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapAllEqualOrContainingPaths(keyMap, path, Relative), fmt.Sprintf(\"%s %v\", path, keys))\n}\n\nfunc TestContainsPathAbs(t *testing.T) {\n\ttestContainsPathAbs(t, false, \"/a.proto\", \"/a.proto\")\n\ttestContainsPathAbs(t, true, \"/\", \"/a.proto\")\n\ttestContainsPathAbs(t, false, \"/a.proto\", \"/\")\n\ttestContainsPathAbs(t, false, \"/\", \"/\")\n\ttestContainsPathAbs(t, true, \"/\", \"/a/b.proto\")\n\ttestContainsPathAbs(t, true, \"/\", \"/a/b\")\n\ttestContainsPathAbs(t, false, \"/a\", \"/ab/c\")\n\ttestContainsPathAbs(t, true, \"/a\", \"/a/b/c\")\n\ttestContainsPathAbs(t, false, \"/b\", \"/a/b/c\")\n\ttestContainsPathAbs(t, true, \"/b\", \"/b/b/c\")\n\ttestContainsPathAbs(t, true, \"/b\", \"/b/a/c\")\n\n\ttestContainsPathAbs(t, true, \"c:/\", \"c:/a.proto\")\n\ttestContainsPathAbs(t, false, \"c:/\", \"c:/\")\n\ttestContainsPathAbs(t, false, \"c:/\", \"d:/\")\n\t// Can't be known without knowing current directory to detect drive\n\ttestContainsPathAbs(t, false, \"c:/\", \"/\")\n\n\ttestContainsPathAbs(t, true, \"//127.0.0.1/$c/\", \"//127.0.0.1/$c/a.proto\")\n\ttestContainsPathAbs(t, false, \"//127.0.0.1/$c/\", \"//127.0.0.1/$c/\")\n\ttestContainsPathAbs(t, false, \"//127.0.0.1/$c/\", \"//127.0.0.1/$d/a.proto\")\n\t// Can't be known without knowing current directory to detect drive\n\ttestContainsPathAbs(t, false, \"//127.0.0.1/$c/\", \"/\")\n}\n\nfunc testContainsPathAbs(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, ContainsPath(value, path, Absolute), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestEqualsOrContainsPathAbs(t *testing.T) {\n\ttestEqualsOrContainsPathAbs(t, true, \"/a.proto\", \"/a.proto\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/\", \"/a.proto\")\n\ttestEqualsOrContainsPathAbs(t, false, \"a.proto\", \"/\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/\", \"/a/b.proto\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/\", \"/a/b\")\n\ttestEqualsOrContainsPathAbs(t, false, \"/a\", \"/ab/c\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/a\", \"/a/b/c\")\n\ttestEqualsOrContainsPathAbs(t, false, \"/b\", \"/a/b/c\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/b\", \"/b/b/c\")\n\ttestEqualsOrContainsPathAbs(t, true, \"/b\", \"/b/a/c\")\n\n\ttestEqualsOrContainsPathAbs(t, true, \"c:/\", \"c:/a.proto\")\n\ttestEqualsOrContainsPathAbs(t, true, \"c:/\", \"c:/\")\n\ttestEqualsOrContainsPathAbs(t, false, \"c:/\", \"d:/\")\n\t// Can't be known without knowing current directory to detect drive\n\ttestEqualsOrContainsPathAbs(t, false, \"c:/\", \"/\")\n\n\ttestEqualsOrContainsPathAbs(t, true, \"//127.0.0.1/$c/\", \"//127.0.0.1/$c/a.proto\")\n\ttestEqualsOrContainsPathAbs(t, true, \"//127.0.0.1/$c/\", \"//127.0.0.1/$c/\")\n\ttestEqualsOrContainsPathAbs(t, false, \"//127.0.0.1/$c/\", \"//127.0.0.1/$d/a.proto\")\n\t// Can't be known without knowing current directory to detect drive\n\ttestEqualsOrContainsPathAbs(t, false, \"//127.0.0.1/$c/\", \"/\")\n\n\t// Case Folding tests\n\t// c.f. https://www.unicode.org/versions/Unicode13.0.0/ch05.pdf#page=44\n\t// We are not trying to test all code point folding, only a few specific\n\t// cases. We defer to the golang implementation of case folding and retesting\n\t// that is not a goal.\n\n\t// \\u212a is the kelvin symbol (K) which looks like a capital K\n\t// The capital K is the kelvin symbol U+212A\n\ttestEqualsOrContainsPathAbs(t, true, \"c:/k\", \"c:/\\u212a\")\n\n\t// In Turkish, a lower case i maps to a capital I with a dot (İ) U+0130\n\t// a lower case i with no dot ı U+0131 maps to a capital I\n\t// In all other languages a lower case i maps to a capital I\n\t// We explicitly do not support this special case (its 2 codepoints total) as\n\t// it is locale dependent.\n\ttestEqualsOrContainsPathAbs(t, true, \"c:/i\", \"c:/I\")\n\t// TODO: The Go stdlib unicode tables seem to fold \\u0131 to \\u0131 which\n\t// doesn't seem spec compliant, but not important enough right now to warrant\n\t// further research, or further complicating this module.\n\ttestEqualsOrContainsPathAbs(t, false, \"c:/\\u0131\", \"c:/I\")\n\ttestEqualsOrContainsPathAbs(t, false, \"c:/i\", \"c:/\\u0130\")\n\n}\n\nfunc testEqualsOrContainsPathAbs(t *testing.T, expected bool, value string, path string) {\n\tassert.Equal(t, expected, EqualsOrContainsPath(value, path, Absolute), fmt.Sprintf(\"%s %s\", value, path))\n}\n\nfunc TestMapHasEqualOrContainingPathAbs(t *testing.T) {\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a.proto\", \"/a.proto\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"/\", \"/a.proto\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a.proto\", \"/\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a/b.proto\", \"/\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a/b\", \"/\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"/ab/c\", \"/a\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/a/b/c\", \"/a\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"/a/b/c\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/b/b/c\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/b/a/c\", \"/b\")\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"/b/b/c\", \"/b\", \"/\")\n\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"c:/a.proto\", \"d:/\", \"c:/\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"c:/\", \"d:/\", \"c:/a.proto\")\n\t// Can't be known without knowing current directory\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"c:/\", \"/\")\n\n\ttestMapHasEqualOrContainingPathAbs(t, true, \"//127.0.0.1/$c/a.proto\", \"d:/\", \"//127.0.0.1/$c/\")\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"//127.0.0.1/$c/\", \"d:/\", \"//127.0.0.1/$c/a.proto\")\n\t// Can't be known without knowing current directory\n\ttestMapHasEqualOrContainingPathAbs(t, false, \"//127.0.0.1/$c/\", \"/\")\n}\n\nfunc testMapHasEqualOrContainingPathAbs(t *testing.T, expected bool, path string, keys ...string) {\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapHasEqualOrContainingPath(keyMap, path, Absolute), fmt.Sprintf(\"%s %v\", path, keys))\n}\n\nfunc TestMapAllEqualOrContainingPathsAbs(t *testing.T) {\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/a.proto\"}, \"/a.proto\", \"/a.proto\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"/\", \"/a.proto\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/\"}, \"/a.proto\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/\"}, \"/a/b.proto\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/\"}, \"/a/b\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"/ab/c\", \"/a\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/a\"}, \"/a/b/c\", \"/a\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"/a/b/c\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\"}, \"/b/b/c\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\"}, \"/b/a/c\", \"/b\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\", \"/\"}, \"/b/b/c\", \"/b\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"/b\", \"/b/b\", \"/\"}, \"/b/b/c\", \"/b\", \"/b/b\", \"/\")\n\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"c:/\"}, \"c:/a.proto\", \"d:/\", \"c:/\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"c:/\", \"d:/\", \"c:/a.proto\")\n\n\ttestMapAllEqualOrContainingPathsAbs(t, []string{\"//127.0.0.1/$c/\"}, \"//127.0.0.1/$c/a.proto\", \"d:/\", \"//127.0.0.1/$c/\", \"//127.0.0.1/$d/\", \"/\")\n\ttestMapAllEqualOrContainingPathsAbs(t, nil, \"//127.0.0.1/$c/\", \"d:/\", \"//127.0.0.1/$c/a.proto\")\n}\n\nfunc testMapAllEqualOrContainingPathsAbs(t *testing.T, expected []string, path string, keys ...string) {\n\tif expected == nil {\n\t\texpected = make([]string, 0)\n\t}\n\tsort.Strings(expected)\n\tkeyMap := xslices.ToStructMap(keys)\n\tassert.Equal(t, expected, MapAllEqualOrContainingPaths(keyMap, path, Absolute), fmt.Sprintf(\"%s %v\", path, keys))\n}\n"
  },
  {
    "path": "private/pkg/normalpath/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage normalpath\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/oauth2/client.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 oauth2\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"mime\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"time\"\n)\n\nconst (\n\tdefaultPollingInterval   = 5 * time.Second\n\tincrementPollingInterval = 5 * time.Second\n\tmaxPollingInterval       = 30 * time.Second\n\tmaxPayloadSize           = 1 << 20 // 1 MB\n)\n\n// Client is an OAuth 2.0 client that can register a device, authorize a device,\n// and poll for the device access token.\ntype Client struct {\n\tbaseURL string\n\tclient  *http.Client\n}\n\n// NewClient returns a new Client with the given base URL and HTTP client.\nfunc NewClient(baseURL string, client *http.Client) *Client {\n\treturn &Client{\n\t\tbaseURL: strings.TrimSuffix(baseURL, \"/\"),\n\t\tclient:  client,\n\t}\n}\n\n// RegisterDevice registers a new device with the authorization server.\nfunc (c *Client) RegisterDevice(\n\tctx context.Context,\n\tdeviceRegistrationRequest *DeviceRegistrationRequest,\n) (_ *DeviceRegistrationResponse, retErr error) {\n\tinput, err := json.Marshal(deviceRegistrationRequest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tbody := bytes.NewReader(input)\n\trequest, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+DeviceRegistrationPath, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequest.Header.Set(\"Content-Type\", \"application/json\")\n\trequest.Header.Set(\"Accept\", \"application/json\")\n\n\tresponse, err := c.client.Do(request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, response.Body.Close())\n\t}()\n\n\tpayload := &struct {\n\t\tError\n\t\tDeviceRegistrationResponse\n\t}{}\n\tif err := parseJSONResponse(response, payload); err != nil {\n\t\treturn nil, err\n\t}\n\tif payload.ErrorCode != \"\" {\n\t\treturn nil, &payload.Error\n\t}\n\tif code := response.StatusCode; code != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"oauth2: invalid status: %v\", code)\n\t}\n\treturn &payload.DeviceRegistrationResponse, nil\n}\n\n// AuthorizeDevice authorizes a device with the authorization server. The authorization server\n// will return a device code and a user code that the user must use to authorize the device.\nfunc (c *Client) AuthorizeDevice(\n\tctx context.Context,\n\tdeviceAuthorizationRequest *DeviceAuthorizationRequest,\n) (_ *DeviceAuthorizationResponse, retErr error) {\n\tbody := strings.NewReader(deviceAuthorizationRequest.ToValues().Encode())\n\trequest, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+DeviceAuthorizationPath, body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trequest.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\trequest.Header.Set(\"Accept\", \"application/json\")\n\n\tresponse, err := c.client.Do(request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, response.Body.Close())\n\t}()\n\n\tpayload := &struct {\n\t\tError\n\t\tDeviceAuthorizationResponse\n\t}{}\n\tif err := parseJSONResponse(response, payload); err != nil {\n\t\treturn nil, err\n\t}\n\tif payload.ErrorCode != \"\" {\n\t\treturn nil, &payload.Error\n\t}\n\tif code := response.StatusCode; code != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"oauth2: invalid status: %v\", code)\n\t}\n\tif err := validateDeviceAuthorizationResponse(payload.DeviceAuthorizationResponse); err != nil {\n\t\treturn nil, err\n\t}\n\treturn &payload.DeviceAuthorizationResponse, nil\n}\n\n// AccessDeviceToken polls the authorization server for the device access token. The interval\n// parameter specifies the polling interval in seconds.\nfunc (c *Client) AccessDeviceToken(\n\tctx context.Context,\n\tdeviceAccessTokenRequest *DeviceAccessTokenRequest,\n\toptions ...AccessDeviceTokenOption,\n) (*DeviceAccessTokenResponse, error) {\n\taccessOptions := newAccessDeviceTokenOption()\n\tfor _, option := range options {\n\t\toption(accessOptions)\n\t}\n\tpollingInterval := accessOptions.pollingInterval\n\tif pollingInterval == 0 {\n\t\tpollingInterval = defaultPollingInterval\n\t} else if pollingInterval < 0 {\n\t\treturn nil, fmt.Errorf(\"oauth2: polling interval must be greater than 0\")\n\t} else if pollingInterval > maxPollingInterval {\n\t\treturn nil, fmt.Errorf(\"oauth2: polling interval must be less than or equal to %v\", maxPollingInterval)\n\t}\n\tencodedValues := deviceAccessTokenRequest.ToValues().Encode()\n\ttimer := time.NewTimer(pollingInterval)\n\tdefer timer.Stop()\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn nil, ctx.Err()\n\t\tcase <-timer.C:\n\t\t\tbody := strings.NewReader(encodedValues)\n\t\t\trequest, err := http.NewRequestWithContext(ctx, http.MethodPost, c.baseURL+DeviceTokenPath, body)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\trequest.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\t\t\trequest.Header.Set(\"Accept\", \"application/json\")\n\n\t\t\tresponse, err := c.client.Do(request)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tpayload := &struct {\n\t\t\t\tError\n\t\t\t\tDeviceAccessTokenResponse\n\t\t\t}{}\n\t\t\tif err := parseJSONResponse(response, payload); err != nil {\n\t\t\t\tif closeErr := response.Body.Close(); closeErr != nil {\n\t\t\t\t\terr = errors.Join(err, closeErr)\n\t\t\t\t}\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif err := response.Body.Close(); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"oauth2: failed to close response body: %w\", err)\n\t\t\t}\n\t\t\tif response.StatusCode == http.StatusOK && payload.ErrorCode == \"\" {\n\t\t\t\treturn &payload.DeviceAccessTokenResponse, nil\n\t\t\t}\n\t\t\tswitch payload.ErrorCode {\n\t\t\tcase ErrorCodeSlowDown:\n\t\t\t\t// If the server is rate limiting the client, increase the polling interval.\n\t\t\t\tpollingInterval += incrementPollingInterval\n\t\t\tcase ErrorCodeAuthorizationPending:\n\t\t\t\t// If the user has not yet authorized the device, continue polling.\n\t\t\tcase ErrorCodeAccessDenied, ErrorCodeExpiredToken:\n\t\t\t\t// If the user has denied the device or the token has expired, return the error.\n\t\t\t\treturn nil, &payload.Error\n\t\t\tdefault:\n\t\t\t\treturn nil, &payload.Error\n\t\t\t}\n\t\t\ttimer.Reset(pollingInterval)\n\t\t}\n\t}\n}\n\n// AccessDeviceTokenOption is an option for AccessDeviceToken.\ntype AccessDeviceTokenOption func(*accessDeviceTokenOptions)\n\n// AccessDeviceTokenWithPollingInterval returns a new AccessDeviceTokenOption that sets the polling interval.\n//\n// The default is 5 seconds. Polling may not be longer than 30 seconds.\nfunc AccessDeviceTokenWithPollingInterval(pollingInterval time.Duration) AccessDeviceTokenOption {\n\treturn func(accessDeviceTokenOptions *accessDeviceTokenOptions) {\n\t\taccessDeviceTokenOptions.pollingInterval = pollingInterval\n\t}\n}\n\n// *** PRIVATE ***\n\ntype accessDeviceTokenOptions struct {\n\tpollingInterval time.Duration\n}\n\nfunc newAccessDeviceTokenOption() *accessDeviceTokenOptions {\n\treturn &accessDeviceTokenOptions{\n\t\tpollingInterval: defaultPollingInterval,\n\t}\n}\n\nfunc parseJSONResponse(response *http.Response, payload any) error {\n\tbody, err := io.ReadAll(io.LimitReader(response.Body, maxPayloadSize))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"oauth2: failed to read response body: %w\", err)\n\t}\n\tif contentType, _, _ := mime.ParseMediaType(response.Header.Get(\"Content-Type\")); contentType != \"application/json\" {\n\t\treturn fmt.Errorf(\"oauth2: %w: %d %s\", errors.ErrUnsupported, response.StatusCode, body)\n\t}\n\tif err := json.Unmarshal(body, &payload); err != nil {\n\t\treturn fmt.Errorf(\"oauth2: failed to unmarshal response: %w: %s\", err, body)\n\t}\n\treturn nil\n}\n\nfunc validateDeviceAuthorizationResponse(deviceAuthorizationResponse DeviceAuthorizationResponse) error {\n\t// Validate that the verification URI with and without the code\n\t// are valid web URLs, and not a file system URI, for example.\n\tif err := validateURIScheme(deviceAuthorizationResponse.VerificationURI); err != nil {\n\t\treturn err\n\t}\n\treturn validateURIScheme(deviceAuthorizationResponse.VerificationURIComplete)\n}\n\nfunc validateURIScheme(rawURI string) error {\n\tparsed, err := url.Parse(rawURI)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"oauth2: invalid verification URI, %s: %w\", rawURI, err)\n\t}\n\tif parsed.Scheme != \"https\" && parsed.Scheme != \"http\" {\n\t\treturn fmt.Errorf(\"oauth2: invalid verification URI scheme, %q, received: %s\", parsed.Scheme, parsed)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/oauth2/client_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 oauth2\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestRegisterDevice(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tname      string\n\t\tinput     *DeviceRegistrationRequest\n\t\ttransport func(t *testing.T, r *http.Request) (*http.Response, error)\n\t\toutput    *DeviceRegistrationResponse\n\t\terr       error\n\t}{{\n\t\tname: \"success\",\n\t\tinput: &DeviceRegistrationRequest{\n\t\t\tClientName: \"nameOfClient\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertJSONRequest(t, r, `{\"client_name\":\"nameOfClient\"}`)\n\t\t\treturn testNewJSONResponse(t, http.StatusOK, `{\"client_id\":\"clientID\",\"client_secret\":\"clientSecret\",\"client_id_issued_at\":10,\"client_secret_expires_at\":100}`), nil\n\t\t},\n\t\toutput: &DeviceRegistrationResponse{\n\t\t\tClientID:              \"clientID\",\n\t\t\tClientSecret:          \"clientSecret\",\n\t\t\tClientIDIssuedAt:      10,\n\t\t\tClientSecretExpiresAt: 100,\n\t\t},\n\t}, {\n\t\tname: \"error\",\n\t\tinput: &DeviceRegistrationRequest{\n\t\t\tClientName: \"nameOfClient\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertJSONRequest(t, r, `{\"client_name\":\"nameOfClient\"}`)\n\t\t\treturn testNewJSONResponse(t, http.StatusBadRequest, `{\"error\":\"invalid_request\",\"error_description\":\"invalid request\"}`), nil\n\t\t},\n\t\terr: &Error{\n\t\t\tErrorCode:        ErrorCodeInvalidRequest,\n\t\t\tErrorDescription: \"invalid request\",\n\t\t},\n\t}, {\n\t\tname: \"transport error\",\n\t\tinput: &DeviceRegistrationRequest{\n\t\t\tClientName: \"nameOfClient\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\treturn nil, io.EOF\n\t\t},\n\t\terr: &url.Error{\n\t\t\tOp:  \"Post\",\n\t\t\tURL: \"https://buf.build\" + DeviceRegistrationPath,\n\t\t\tErr: io.EOF,\n\t\t},\n\t}, {\n\t\tname:  \"server error\",\n\t\tinput: &DeviceRegistrationRequest{ClientName: \"nameOfClient\"},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\treturn &http.Response{\n\t\t\t\tStatus:     \"501 Not Implemented\",\n\t\t\t\tStatusCode: http.StatusNotImplemented,\n\t\t\t\tBody:       io.NopCloser(strings.NewReader(`not implemented`)),\n\t\t\t}, nil\n\t\t},\n\t\terr: fmt.Errorf(\"oauth2: %w: 501 not implemented\", errors.ErrUnsupported),\n\t}}\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tctx := t.Context()\n\t\t\tc := NewClient(\"https://buf.build\", &http.Client{\n\t\t\t\tTransport: testRoundTripFunc(func(r *http.Request) (*http.Response, error) {\n\t\t\t\t\tassert.Equal(t, r.Method, http.MethodPost)\n\t\t\t\t\tassert.Equal(t, r.URL.Path, DeviceRegistrationPath)\n\t\t\t\t\tassert.Equal(t, r.Header.Get(\"Content-Type\"), \"application/json\")\n\t\t\t\t\tassert.Equal(t, r.Header.Get(\"Accept\"), \"application/json\")\n\t\t\t\t\treturn test.transport(t, r)\n\t\t\t\t}),\n\t\t\t})\n\t\t\toutput, err := c.RegisterDevice(ctx, test.input)\n\t\t\tassert.Equal(t, test.output, output)\n\t\t\tif test.err != nil {\n\t\t\t\tassert.EqualError(t, err, test.err.Error())\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestAuthorizeDevice(t *testing.T) {\n\tt.Parallel()\n\n\ttests := []struct {\n\t\tname      string\n\t\tinput     *DeviceAuthorizationRequest\n\t\ttransport func(t *testing.T, r *http.Request) (*http.Response, error)\n\t\toutput    *DeviceAuthorizationResponse\n\t\terr       error\n\t}{{\n\t\tname: \"success\",\n\t\tinput: &DeviceAuthorizationRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}})\n\t\t\treturn testNewJSONResponse(t, http.StatusOK, `{\"device_code\":\"deviceCode\",\"user_code\":\"userCode\",\"verification_uri\":\"https://example.com\",\"verification_uri_complete\":\"https://example.com?code=userCode\",\"expires_in\":10,\"interval\":5}`), nil\n\t\t},\n\t\toutput: &DeviceAuthorizationResponse{\n\t\t\tDeviceCode:              \"deviceCode\",\n\t\t\tUserCode:                \"userCode\",\n\t\t\tVerificationURI:         \"https://example.com\",\n\t\t\tVerificationURIComplete: \"https://example.com?code=userCode\",\n\t\t\tExpiresIn:               10,\n\t\t\tInterval:                5,\n\t\t},\n\t}, {\n\t\tname: \"error\",\n\t\tinput: &DeviceAuthorizationRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}})\n\t\t\treturn testNewJSONResponse(t, http.StatusBadRequest, `{\"error\":\"invalid_request\",\"error_description\":\"invalid request\"}`), nil\n\t\t},\n\t\terr: &Error{\n\t\t\tErrorCode:        ErrorCodeInvalidRequest,\n\t\t\tErrorDescription: \"invalid request\",\n\t\t},\n\t}, {\n\t\tname: \"http_device_uri\",\n\t\tinput: &DeviceAuthorizationRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}})\n\t\t\treturn testNewJSONResponse(t, http.StatusOK, `{\"device_code\":\"deviceCode\",\"user_code\":\"userCode\",\"verification_uri\":\"http://example.com\",\"verification_uri_complete\":\"http://example.com?code=userCode\",\"expires_in\":10,\"interval\":5}`), nil\n\t\t},\n\t\toutput: &DeviceAuthorizationResponse{\n\t\t\tDeviceCode:              \"deviceCode\",\n\t\t\tUserCode:                \"userCode\",\n\t\t\tVerificationURI:         \"http://example.com\",\n\t\t\tVerificationURIComplete: \"http://example.com?code=userCode\",\n\t\t\tExpiresIn:               10,\n\t\t\tInterval:                5,\n\t\t},\n\t}, {\n\t\tname: \"invalid_device_uri\",\n\t\tinput: &DeviceAuthorizationRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}})\n\t\t\treturn testNewJSONResponse(t, http.StatusOK, `{\"device_code\":\"deviceCode\",\"user_code\":\"userCode\",\"verification_uri\":\"file:///path/to/file.ext\",\"verification_uri_complete\":\"file:///path/to/file.ext?code=userCode\",\"expires_in\":10,\"interval\":5}`), nil\n\t\t},\n\t\terr: fmt.Errorf(\n\t\t\t`oauth2: invalid verification URI scheme, %q, received: %s`,\n\t\t\t\"file\",\n\t\t\t\"file:///path/to/file.ext\",\n\t\t),\n\t}, {\n\t\tname: \"invalid_device_uri_complete\",\n\t\tinput: &DeviceAuthorizationRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}})\n\t\t\treturn testNewJSONResponse(t, http.StatusOK, `{\"device_code\":\"deviceCode\",\"user_code\":\"userCode\",\"verification_uri\":\"https://example.com\",\"verification_uri_complete\":\"file:///path/to/file.ext?code=userCode\",\"expires_in\":10,\"interval\":5}`), nil\n\t\t},\n\t\terr: fmt.Errorf(\n\t\t\t`oauth2: invalid verification URI scheme, %q, received: %s`,\n\t\t\t\"file\",\n\t\t\t\"file:///path/to/file.ext?code=userCode\",\n\t\t),\n\t}}\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tctx := t.Context()\n\t\t\tc := NewClient(\"https://buf.build\", &http.Client{\n\t\t\t\tTransport: testRoundTripFunc(func(r *http.Request) (*http.Response, error) {\n\t\t\t\t\tassert.Equal(t, r.Method, http.MethodPost)\n\t\t\t\t\tassert.Equal(t, r.URL.Path, DeviceAuthorizationPath)\n\t\t\t\t\tassert.Equal(t, r.Header.Get(\"Content-Type\"), \"application/x-www-form-urlencoded\")\n\t\t\t\t\tassert.Equal(t, r.Header.Get(\"Accept\"), \"application/json\")\n\t\t\t\t\treturn test.transport(t, r)\n\t\t\t\t}),\n\t\t\t})\n\t\t\toutput, err := c.AuthorizeDevice(ctx, test.input)\n\t\t\tassert.Equal(t, test.output, output)\n\t\t\tif test.err != nil {\n\t\t\t\tassert.EqualError(t, err, test.err.Error())\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestAccessDeviceToken(t *testing.T) {\n\tt.Parallel()\n\n\tvar pollingCount int\n\ttests := []struct {\n\t\tname      string\n\t\tinput     *DeviceAccessTokenRequest\n\t\ttransport func(t *testing.T, r *http.Request) (*http.Response, error)\n\t\toutput    *DeviceAccessTokenResponse\n\t\terr       error\n\t}{{\n\t\tname: \"success\",\n\t\tinput: &DeviceAccessTokenRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t\tDeviceCode:   \"deviceCode\",\n\t\t\tGrantType:    \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}, \"device_code\": {\"deviceCode\"}, \"grant_type\": {\"urn:ietf:params:oauth:grant-type:device_code\"}})\n\t\t\treturn testNewJSONResponse(t, http.StatusOK, `{\"access_token\":\"accessToken\",\"token_type\":\"bearer\",\"expires_in\":100,\"refresh_token\":\"refreshToken\",\"scope\":\"scope\"}`), nil\n\t\t},\n\t\toutput: &DeviceAccessTokenResponse{\n\t\t\tAccessToken:  \"accessToken\",\n\t\t\tTokenType:    \"bearer\",\n\t\t\tExpiresIn:    100,\n\t\t\tRefreshToken: \"refreshToken\",\n\t\t\tScope:        \"scope\",\n\t\t},\n\t}, {\n\t\tname: \"polling\",\n\t\tinput: &DeviceAccessTokenRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t\tDeviceCode:   \"deviceCode\",\n\t\t\tGrantType:    \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}, \"device_code\": {\"deviceCode\"}, \"grant_type\": {\"urn:ietf:params:oauth:grant-type:device_code\"}})\n\t\t\tif pollingCount == 0 {\n\t\t\t\tpollingCount++\n\t\t\t\treturn testNewJSONResponse(t, http.StatusBadRequest, `{\"error\":\"authorization_pending\",\"error_description\":\"authorization pending\"}`), nil\n\t\t\t}\n\t\t\treturn testNewJSONResponse(t, http.StatusOK, `{\"access_token\":\"accessToken\",\"token_type\":\"bearer\",\"expires_in\":100,\"refresh_token\":\"refreshToken\",\"scope\":\"scope\"}`), nil\n\t\t},\n\t\toutput: &DeviceAccessTokenResponse{\n\t\t\tAccessToken:  \"accessToken\",\n\t\t\tTokenType:    \"bearer\",\n\t\t\tExpiresIn:    100,\n\t\t\tRefreshToken: \"refreshToken\",\n\t\t\tScope:        \"scope\",\n\t\t},\n\t}, {\n\t\tname: \"error\",\n\t\tinput: &DeviceAccessTokenRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t\tDeviceCode:   \"deviceCode\",\n\t\t\tGrantType:    \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\ttestAssertFormRequest(t, r, url.Values{\"client_id\": {\"clientID\"}, \"client_secret\": {\"clientSecret\"}, \"device_code\": {\"deviceCode\"}, \"grant_type\": {\"urn:ietf:params:oauth:grant-type:device_code\"}})\n\t\t\treturn testNewJSONResponse(t, http.StatusBadRequest, `{\"error\":\"invalid_request\",\"error_description\":\"invalid request\"}`), nil\n\t\t},\n\t\terr: &Error{\n\t\t\tErrorCode:        ErrorCodeInvalidRequest,\n\t\t\tErrorDescription: \"invalid request\",\n\t\t},\n\t}, {\n\t\tname: \"expired token\",\n\t\tinput: &DeviceAccessTokenRequest{\n\t\t\tClientID:     \"clientID\",\n\t\t\tClientSecret: \"clientSecret\",\n\t\t\tDeviceCode:   \"deviceCode\",\n\t\t\tGrantType:    \"urn:ietf:params:oauth:grant-type:device_code\",\n\t\t},\n\t\ttransport: func(t *testing.T, r *http.Request) (*http.Response, error) {\n\t\t\treturn testNewJSONResponse(t, http.StatusBadRequest, `{\"error\":\"expired_token\",\"error_description\":\"token expired\"}`), nil\n\t\t},\n\t\terr: &Error{\n\t\t\tErrorCode:        ErrorCodeExpiredToken,\n\t\t\tErrorDescription: \"token expired\",\n\t\t},\n\t}}\n\tfor _, test := range tests {\n\t\tt.Run(test.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tctx := t.Context()\n\t\t\tc := NewClient(\"https://buf.build\", &http.Client{\n\t\t\t\tTransport: testRoundTripFunc(func(r *http.Request) (*http.Response, error) {\n\t\t\t\t\tassert.Equal(t, r.Method, http.MethodPost)\n\t\t\t\t\tassert.Equal(t, r.URL.Path, DeviceTokenPath)\n\t\t\t\t\tassert.Equal(t, r.Header.Get(\"Content-Type\"), \"application/x-www-form-urlencoded\")\n\t\t\t\t\tassert.Equal(t, r.Header.Get(\"Accept\"), \"application/json\")\n\t\t\t\t\treturn test.transport(t, r)\n\t\t\t\t}),\n\t\t\t})\n\t\t\toutput, err := c.AccessDeviceToken(ctx, test.input, AccessDeviceTokenWithPollingInterval(time.Millisecond))\n\t\t\tassert.Equal(t, test.output, output)\n\t\t\tassert.Equal(t, err, test.err)\n\t\t})\n\t}\n}\n\ntype testRoundTripFunc func(r *http.Request) (*http.Response, error)\n\nfunc (s testRoundTripFunc) RoundTrip(r *http.Request) (*http.Response, error) {\n\treturn s(r)\n}\n\nfunc testNewJSONResponse(t *testing.T, statusCode int, body string) *http.Response {\n\tt.Helper()\n\treturn &http.Response{\n\t\tStatusCode: statusCode,\n\t\tHeader:     http.Header{\"Content-Type\": []string{\"application/json\"}},\n\t\tBody:       io.NopCloser(strings.NewReader(body)),\n\t}\n}\n\nfunc testAssertJSONRequest(t *testing.T, r *http.Request, expect string) {\n\tt.Helper()\n\tbody, err := io.ReadAll(r.Body)\n\tif !assert.NoError(t, err) {\n\t\treturn\n\t}\n\tassert.JSONEq(t, string(body), expect)\n}\n\nfunc testAssertFormRequest(t *testing.T, r *http.Request, values url.Values) {\n\tt.Helper()\n\tif !assert.NoError(t, r.ParseForm()) {\n\t\treturn\n\t}\n\tassert.Equal(t, r.Form, values)\n}\n"
  },
  {
    "path": "private/pkg/oauth2/device.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 oauth2\n\nimport (\n\t\"net/url\"\n)\n\nconst (\n\t// DeviceRegistrationPath is the path for the device registration endpoint.\n\tDeviceRegistrationPath = \"/oauth2/device/registration\"\n\t// DeviceAuthorizationPath is the path for the device authorization endpoint.\n\tDeviceAuthorizationPath = \"/oauth2/device/authorization\"\n\t// DeviceTokenPath is the path for the device token endpoint.\n\tDeviceTokenPath = \"/oauth2/device/token\"\n)\n\nconst (\n\t// DeviceAuthorizationGrantType is the grant type for the device authorization flow.\n\tDeviceAuthorizationGrantType = \"urn:ietf:params:oauth:grant-type:device_code\"\n)\n\n// The following error codes are defined by RFC 8628 Section 3.5 Device Authorization Response.\nconst (\n\t// ErrorCodeAuthorizationPending is a pending device authorization grant as the\n\t// end user hasn't yet completed the user interaction steps.\n\tErrorCodeAuthorizationPending ErrorCode = \"authorization_pending\"\n\t// ErrorCodeSlowDown is returned for a pending device authorization grant and\n\t// polling should continue, but the interval MUST be increased by 5 seconds for\n\t// all subsequent requests.\n\tErrorCodeSlowDown ErrorCode = \"slow_down\"\n\t// ErrorCodeAccessDenied is returned when the device authorization request was denied.\n\tErrorCodeAccessDenied ErrorCode = \"access_denied\"\n\t// ErrorCodeExpiredToken is the device_code has expired, and the device authorization\n\t// session has concluded. The client MAY commence a new device authorization request but\n\t// SHOULD wait for user interaction before restarting to avoid unnecessary polling.\n\tErrorCodeExpiredToken ErrorCode = \"expired_token\"\n)\n\n// DeviceRegistrationRequest describes an OpenID Connect Dynamic Client Registration 1.0 request\n// for dynamic client registration. It is a subset of the full specification.\n// It does not require a redirect URI or grant types for the device authorization flow.\n// https://openid.net/specs/openid-connect-registration-1_0.html#RegistrationRequest\ntype DeviceRegistrationRequest struct {\n\t// Name of the client to be presented to the end user.\n\tClientName string `json:\"client_name\"`\n}\n\n// DeviceRegistrationResponse describes a successful OpenID Connect Dynamic Client Registration 1.0 response\n// for dynamic client registration.\ntype DeviceRegistrationResponse struct {\n\t// ClientID is the unique client identifier.\n\tClientID string `json:\"client_id\"`\n\t// ClientSecret is the client secret. May be empty.\n\tClientSecret string `json:\"client_secret,omitempty\"`\n\t// ClientIDIssuedAt is the time at which the ClientID was issued in seconds since the Unix epoch.\n\tClientIDIssuedAt int `json:\"client_id_issued_at\"`\n\t// ClientSecretExpiresAt is the time at which the client_secret will expire in seconds since the Unix epoch.\n\tClientSecretExpiresAt int `json:\"client_secret_expires_at,omitempty\"`\n}\n\n// DeviceAuthorizationRequest describes an RFC 8628 Device Authorization Request.\n// https://datatracker.ietf.org/doc/html/rfc8628#section-3.1\ntype DeviceAuthorizationRequest struct {\n\t// ClientID is the unique client identifier.\n\tClientID string `json:\"client_id\"`\n\t// ClientSecret is the client secret. May be empty.\n\tClientSecret string `json:\"client_secret,omitempty\"`\n}\n\n// ToValues converts the DeviceAuthorizationRequest to url.Values.\nfunc (d *DeviceAuthorizationRequest) ToValues() url.Values {\n\tvalues := make(url.Values, 2)\n\tvalues.Set(\"client_id\", d.ClientID)\n\tif d.ClientSecret != \"\" {\n\t\tvalues.Set(\"client_secret\", d.ClientSecret)\n\t}\n\treturn values\n}\n\n// FromValues converts the url.Values to a DeviceAuthorizationRequest.\nfunc (d *DeviceAuthorizationRequest) FromValues(values url.Values) error {\n\td.ClientID = values.Get(\"client_id\")\n\td.ClientSecret = values.Get(\"client_secret\")\n\treturn nil\n}\n\n// DeviceAuthorizationResponse describes a successful RFC 8628 Device Authorization Response\n// https://datatracker.ietf.org/doc/html/rfc8628#section-3.2\ntype DeviceAuthorizationResponse struct {\n\t// DeviceCode is the device verification code.\n\tDeviceCode string `json:\"device_code\"`\n\t// UserCode is the end-user verification code.\n\tUserCode string `json:\"user_code\"`\n\t// VerificationURI is the verification URI that the end user should visit to\n\t// enter the user_code.\n\tVerificationURI string `json:\"verification_uri\"`\n\t// VerificationURIComplete is the verification URI that includes the user_code.\n\tVerificationURIComplete string `json:\"verification_uri_complete,omitempty\"`\n\t// ExpiresIn is the lifetime in seconds of the \"device_code\" and \"user_code\".\n\tExpiresIn int `json:\"expires_in\"`\n\t// Interval is the minimum amount of time in seconds that the client SHOULD wait\n\t// between polling requests to the token endpoint.\n\tInterval int `json:\"interval,omitempty\"`\n}\n\n// DeviceAccessTokenRequest describes an RFC 8628 Device Token Request.\n// https://datatracker.ietf.org/doc/html/rfc8628#section-3.4\ntype DeviceAccessTokenRequest struct {\n\t// ClientID is the client identifier issued to the client during the registration process.\n\tClientID string `json:\"client_id\"`\n\t// ClientSecret is the client secret. May be empty.\n\tClientSecret string `json:\"client_secret,omitempty\"`\n\t// DeviceCode is the device verification code.\n\tDeviceCode string `json:\"device_code\"`\n\t// GrantType is the grant type for the device authorization flow. Must be\n\t// set to \"urn:ietf:params:oauth:grant-type:device_code\".\n\tGrantType string `json:\"grant_type\"`\n}\n\n// ToValues converts the DeviceTokenRequest to url.Values.\nfunc (d *DeviceAccessTokenRequest) ToValues() url.Values {\n\tvalues := make(url.Values, 4)\n\tvalues.Set(\"client_id\", d.ClientID)\n\tif d.ClientSecret != \"\" {\n\t\tvalues.Set(\"client_secret\", d.ClientSecret)\n\t}\n\tvalues.Set(\"device_code\", d.DeviceCode)\n\tvalues.Set(\"grant_type\", d.GrantType)\n\treturn values\n}\n\n// FromValues converts the url.Values to a DeviceTokenRequest.\nfunc (d *DeviceAccessTokenRequest) FromValues(values url.Values) error {\n\td.ClientID = values.Get(\"client_id\")\n\td.ClientSecret = values.Get(\"client_secret\")\n\td.DeviceCode = values.Get(\"device_code\")\n\td.GrantType = values.Get(\"grant_type\")\n\treturn nil\n}\n\n// DeviceAccessTokenResponse describes a successful RFC 8628 Device Token Response.\n// https://datatracker.ietf.org/doc/html/rfc8628#section-3.5\ntype DeviceAccessTokenResponse struct {\n\t// AccessToken is the access token that can be used to access the protected resources.\n\tAccessToken string `json:\"access_token\"`\n\t// TokenType is the type of the token issued as described in RFC 6749 Section 7.1.\n\t// https://datatracker.ietf.org/doc/html/rfc6749#section-7.1\n\tTokenType string `json:\"token_type\"`\n\t// ExpiresIn is the lifetime in seconds of the access token.\n\tExpiresIn int `json:\"expires_in,omitempty\"`\n\t// RefreshToken may be used to obtain new access tokens using the same authorization\n\t// grant. May be empty.\n\tRefreshToken string `json:\"refresh_token,omitempty\"`\n\t// Scope is the scope of the access token as described in RFC 6749 Section 3.3.\n\t// https://datatracker.ietf.org/doc/html/rfc6749#section-3.3\n\tScope string `json:\"scope,omitempty\"`\n}\n"
  },
  {
    "path": "private/pkg/oauth2/oauth2.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 oauth2 contains functionality to work with OAuth2.\npackage oauth2\n\nimport (\n\t\"fmt\"\n)\n\n// ErrorCode is an OAuth2 error code.\ntype ErrorCode string\n\n// The following error codes are defined by RFC 6749 Section 5.2 Error Response.\nconst (\n\t// ErrorCodeInvalidRequest is an invalid or malformed request error.\n\tErrorCodeInvalidRequest ErrorCode = \"invalid_request\"\n\t// ErrorCodeInvalidClient is a client authentication error.\n\tErrorCodeInvalidClient ErrorCode = \"invalid_client\"\n\t// ErrorCodeInvalidGrant is an invalid grant error.\n\tErrorCodeInvalidGrant ErrorCode = \"invalid_grant\"\n\t// ErrorCodeUnauthorizedClient is an unauthorized client error.\n\tErrorCodeUnauthorizedClient ErrorCode = \"unauthorized_client\"\n\t// ErrorCodeUnsupportedGrantType is an unsupported grant type error.\n\tErrorCodeUnsupportedGrantType ErrorCode = \"unsupported_grant_type\"\n\t// ErrorCodeInvalidScope is an invalid scope error.\n\tErrorCodeInvalidScope ErrorCode = \"invalid_scope\"\n)\n\n// Error is an OAuth2 error.\ntype Error struct {\n\t// ErrorCode is the error code.\n\tErrorCode ErrorCode `json:\"error\"`\n\t// ErrorDescription is a human-readable description of the error. May be empty.\n\tErrorDescription string `json:\"error_description,omitempty\"`\n\t// ErrorURI is a URI for the error. May be empty.\n\tErrorURI string `json:\"error_uri,omitempty\"`\n}\n\n// Error implements error.\nfunc (e *Error) Error() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\ts := fmt.Sprintf(\"oauth2: %q\", e.ErrorCode)\n\tif e.ErrorDescription != \"\" {\n\t\ts += fmt.Sprintf(\" %q\", e.ErrorDescription)\n\t}\n\tif e.ErrorURI != \"\" {\n\t\ts += fmt.Sprintf(\" %q\", e.ErrorURI)\n\t}\n\treturn s\n}\n"
  },
  {
    "path": "private/pkg/oauth2/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage oauth2\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/osext/osext.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 osext provides os utilities.\npackage osext\n\nimport (\n\t\"errors\"\n\t\"os\"\n\t\"sync\"\n)\n\nvar (\n\tglobalWorkDirPath    string\n\tglobalWorkDirPathErr error\n\n\tglobalLock sync.RWMutex\n\n\terrOSGetwdEmpty = errors.New(\"os.Getwd returned empty and no error\")\n)\n\n// Getwd replaces os.Getwd and caches the result.\nfunc Getwd() (string, error) {\n\tglobalLock.RLock()\n\tworkDirPath, workDirPathErr := globalWorkDirPath, globalWorkDirPathErr\n\tglobalLock.RUnlock()\n\tif workDirPath != \"\" || workDirPathErr != nil {\n\t\treturn workDirPath, workDirPathErr\n\t}\n\tglobalLock.Lock()\n\tdefer globalLock.Unlock()\n\tglobalWorkDirPath, globalWorkDirPathErr = getwdUncached()\n\treturn globalWorkDirPath, globalWorkDirPathErr\n}\n\n// Chdir calls os.Chdir and clears any cached result of Getwd.\nfunc Chdir(dir string) error {\n\tglobalLock.Lock()\n\tdefer globalLock.Unlock()\n\tglobalWorkDirPath = \"\"\n\tglobalWorkDirPathErr = nil\n\treturn os.Chdir(dir)\n}\n\nfunc getwdUncached() (string, error) {\n\tworkDirPath, workDirPathErr := os.Getwd()\n\tif workDirPath == \"\" && workDirPathErr == nil {\n\t\treturn \"\", errOSGetwdEmpty\n\t}\n\treturn workDirPath, workDirPathErr\n}\n"
  },
  {
    "path": "private/pkg/osext/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage osext\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/pluginrpcutil/pluginrpcutil.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginrpcutil\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\n// NewLocalRunner returns a new pluginrpc.Runner for the local program.\n//\n// The programName is the path or name of the program. Any program args are passed to\n// the program when it is run. The programArgs may be nil. The environment is set to\n// os.Environ().\nfunc NewLocalRunner(programName string, programArgs ...string) pluginrpc.Runner {\n\treturn newRunner(programName, programArgs...)\n}\n\n// NewWasmRunner returns a new pluginrpc.Runner for the wasm.Runtime and Wasm data.\n//\n// This is used for Wasm plugins. getData returns the Wasm data.\n// The program name is the name of the source file. Must be non-empty.\n// The program args are the arguments to the program. May be empty.\nfunc NewWasmRunner(delegate wasm.Runtime, getData func() ([]byte, error), programName string, programArgs ...string) pluginrpc.Runner {\n\treturn newWasmRunner(delegate, getData, programName, programArgs...)\n}\n\n// ReadWasmFileFromOS reads the Wasm data from the OS.\n//\n// This is used for local Wasm plugins. The lookup is similar to exec.LookPath.\n// The file must be in the local directory or in the PATH. The file is not\n// required to be executable.\nfunc ReadWasmFileFromOS(name string) ([]byte, error) {\n\t// Find the plugin path. We use the same logic as exec.LookPath, but we do\n\t// not require the file to be executable. So check the local directory\n\t// first before checking the PATH.\n\tvar path string\n\tif fileInfo, err := os.Stat(name); err == nil && !fileInfo.IsDir() {\n\t\tpath = name\n\t} else {\n\t\tvar err error\n\t\tpath, err = unsafeLookPath(name)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not find file %q in PATH: %v\", name, err)\n\t\t}\n\t}\n\treturn os.ReadFile(path)\n}\n"
  },
  {
    "path": "private/pkg/pluginrpcutil/runner.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginrpcutil\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"os\"\n\t\"os/exec\"\n\t\"slices\"\n\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\ntype runner struct {\n\tprogramName string\n\tprogramArgs []string\n}\n\nfunc newRunner(\n\tprogramName string,\n\tprogramArgs ...string,\n) *runner {\n\treturn &runner{\n\t\tprogramName: programName,\n\t\tprogramArgs: programArgs,\n\t}\n}\n\nfunc (r *runner) Run(ctx context.Context, env pluginrpc.Env) error {\n\targs := env.Args\n\tif len(r.programArgs) > 0 {\n\t\targs = append(slices.Clone(r.programArgs), env.Args...)\n\t}\n\tif err := xexec.Run(\n\t\tctx,\n\t\tr.programName,\n\t\txexec.WithArgs(args...),\n\t\txexec.WithStdin(env.Stdin),\n\t\txexec.WithStdout(env.Stdout),\n\t\txexec.WithStderr(env.Stderr),\n\t\txexec.WithEnv(os.Environ()),\n\t); err != nil {\n\t\texecExitError := &exec.ExitError{}\n\t\tif errors.As(err, &execExitError) {\n\t\t\treturn pluginrpc.NewExitError(execExitError.ExitCode(), execExitError)\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/pluginrpcutil/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage pluginrpcutil\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/pluginrpcutil/wasm_runner.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 pluginrpcutil\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os/exec\"\n\t\"slices\"\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/pkg/wasm\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\ntype wasmRunner struct {\n\tdelegate    wasm.Runtime\n\tgetData     func() ([]byte, error)\n\tprogramName string\n\tprogramArgs []string\n\t// lock protects compiledModule and compiledModuleErr. Store called as\n\t// a boolean to avoid nil comparison.\n\tlock              sync.RWMutex\n\tcalled            bool\n\tcompiledModule    wasm.CompiledModule\n\tcompiledModuleErr error\n}\n\nfunc newWasmRunner(\n\tdelegate wasm.Runtime,\n\tgetData func() ([]byte, error),\n\tprogramName string,\n\tprogramArgs ...string,\n) *wasmRunner {\n\treturn &wasmRunner{\n\t\tdelegate:    delegate,\n\t\tgetData:     getData,\n\t\tprogramName: programName,\n\t\tprogramArgs: programArgs,\n\t}\n}\n\nfunc (r *wasmRunner) Run(ctx context.Context, env pluginrpc.Env) (retErr error) {\n\tcompiledModule, err := r.loadCompiledModuleOnce(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(r.programArgs) > 0 {\n\t\tenv.Args = append(slices.Clone(r.programArgs), env.Args...)\n\t}\n\treturn compiledModule.Run(ctx, env)\n}\n\nfunc (r *wasmRunner) loadCompiledModuleOnce(ctx context.Context) (wasm.CompiledModule, error) {\n\tr.lock.RLock()\n\tif r.called {\n\t\tr.lock.RUnlock()\n\t\treturn r.compiledModule, r.compiledModuleErr\n\t}\n\tr.lock.RUnlock()\n\tr.lock.Lock()\n\tdefer r.lock.Unlock()\n\tif !r.called {\n\t\tr.compiledModule, r.compiledModuleErr = r.loadCompiledModule(ctx)\n\t\tr.called = true\n\t}\n\treturn r.compiledModule, r.compiledModuleErr\n}\n\nfunc (r *wasmRunner) loadCompiledModule(ctx context.Context) (wasm.CompiledModule, error) {\n\tmoduleWasm, err := r.getData()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not read plugin %q: %w\", r.programName, err)\n\t}\n\t// Compile the module. This CompiledModule is never released, so\n\t// subsequent calls to this function will benefit from the cached\n\t// module. This is only safe as the runner is limited to the CLI.\n\tcompiledModule, err := r.delegate.Compile(ctx, r.programName, moduleWasm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn compiledModule, nil\n}\n\n// unsafeLookPath is a wrapper around exec.LookPath that restores the original\n// pre-Go 1.19 behavior of resolving queries that would use relative PATH\n// entries. We consider it acceptable for the use case of locating plugins.\n//\n// https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory\nfunc unsafeLookPath(file string) (string, error) {\n\tpath, err := exec.LookPath(file)\n\tif errors.Is(err, exec.ErrDot) {\n\t\terr = nil\n\t}\n\treturn path, err\n}\n"
  },
  {
    "path": "private/pkg/protodescriptor/protodescriptor.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protodescriptor\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/protocompile\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nconst (\n\t// MinSupportedEdition is the earliest edition supported by this repo.\n\tMinSupportedEdition = descriptorpb.Edition_EDITION_2023\n\t// MaxSupportedEdition is the latest edition supported by this repo.\n\tMaxSupportedEdition = descriptorpb.Edition_EDITION_2023\n)\n\n// FileDescriptor is an interface that matches the methods on a *descriptorpb.FileDescriptorProto.\n//\n// Note that a FileDescriptor is not necessarily validated, unlike other interfaces in buf.\ntype FileDescriptor interface {\n\tproto.Message\n\tGetName() string\n\tGetPackage() string\n\tGetDependency() []string\n\tGetPublicDependency() []int32\n\tGetWeakDependency() []int32\n\tGetMessageType() []*descriptorpb.DescriptorProto\n\tGetEnumType() []*descriptorpb.EnumDescriptorProto\n\tGetService() []*descriptorpb.ServiceDescriptorProto\n\tGetExtension() []*descriptorpb.FieldDescriptorProto\n\tGetOptions() *descriptorpb.FileOptions\n\tGetSourceCodeInfo() *descriptorpb.SourceCodeInfo\n\tGetSyntax() string\n\tGetEdition() descriptorpb.Edition\n}\n\n// FileDescriptorProtoForFileDescriptor creates a new *descriptorpb.FileDescriptorProto for the fileDescriptor.\n//\n// If the FileDescriptor is already a *descriptorpb.FileDescriptorProto, this returns the input value.\n//\n// Note that this will not round trip exactly. If a *descriptorpb.FileDescriptorProto is turned into another\n// object that is a FileDescriptor, and then passed to this function, the return value will not be equal\n// if name, package, or syntax are set but empty. Instead, the return value will have these values unset.\n// For our/most purposes, this is fine.\nfunc FileDescriptorProtoForFileDescriptor(fileDescriptor FileDescriptor) *descriptorpb.FileDescriptorProto {\n\tif fileDescriptorProto, ok := fileDescriptor.(*descriptorpb.FileDescriptorProto); ok {\n\t\treturn fileDescriptorProto\n\t}\n\tfileDescriptorProto := &descriptorpb.FileDescriptorProto{\n\t\tDependency:       fileDescriptor.GetDependency(),\n\t\tPublicDependency: fileDescriptor.GetPublicDependency(),\n\t\tWeakDependency:   fileDescriptor.GetWeakDependency(),\n\t\tMessageType:      fileDescriptor.GetMessageType(),\n\t\tEnumType:         fileDescriptor.GetEnumType(),\n\t\tService:          fileDescriptor.GetService(),\n\t\tExtension:        fileDescriptor.GetExtension(),\n\t\tOptions:          fileDescriptor.GetOptions(),\n\t\tSourceCodeInfo:   fileDescriptor.GetSourceCodeInfo(),\n\t}\n\t// Note that if a *descriptorpb.FileDescriptorProto has a set but empty name, package,\n\t// or syntax, this won't be an exact round trip. But for our use, we say this is fine.\n\tif name := fileDescriptor.GetName(); name != \"\" {\n\t\tfileDescriptorProto.Name = proto.String(name)\n\t}\n\tif pkg := fileDescriptor.GetPackage(); pkg != \"\" {\n\t\tfileDescriptorProto.Package = proto.String(pkg)\n\t}\n\tif syntax := fileDescriptor.GetSyntax(); syntax != \"\" {\n\t\tfileDescriptorProto.Syntax = proto.String(syntax)\n\t}\n\tif edition := fileDescriptor.GetEdition(); edition != descriptorpb.Edition_EDITION_UNKNOWN {\n\t\tfileDescriptorProto.Edition = &edition\n\t}\n\tfileDescriptorProto.ProtoReflect().SetUnknown(fileDescriptor.ProtoReflect().GetUnknown())\n\treturn fileDescriptorProto\n}\n\n// FileDescriptorProtosForFileDescriptors is a convenience function since Go does not have generics.\n//\n// Note that this will not round trip exactly. If a *descriptorpb.FileDescriptorProto is turned into another\n// object that is a FileDescriptor, and then passed to this function, the return value will not be equal\n// if name, package, or syntax are set but empty. Instead, the return value will have these values unset.\n// For our/most purposes, this is fine.\nfunc FileDescriptorProtosForFileDescriptors[F FileDescriptor](fileDescriptors ...F) []*descriptorpb.FileDescriptorProto {\n\tfileDescriptorsAny := any(fileDescriptors) // must assign to interface var to do type assertion below\n\tif fileDescriptorProtos, ok := fileDescriptorsAny.([]*descriptorpb.FileDescriptorProto); ok {\n\t\treturn fileDescriptorProtos\n\t}\n\n\tfileDescriptorProtos := make([]*descriptorpb.FileDescriptorProto, len(fileDescriptors))\n\tfor i, fileDescriptor := range fileDescriptors {\n\t\tfileDescriptorProtos[i] = FileDescriptorProtoForFileDescriptor(fileDescriptor)\n\t}\n\treturn fileDescriptorProtos\n}\n\n// FileDescriptorSetForFileDescriptors returns a new *descriptorpb.FileDescriptorSet for the given FileDescriptors.\n//\n// Note that this will not round trip exactly. If a *descriptorpb.FileDescriptorProto is turned into another\n// object that is a FileDescriptor, and then passed to this function, the return value will not be equal\n// if name, package, or syntax are set but empty. Instead, the return value will have these values unset.\n// For our/most purposes, this is fine.\nfunc FileDescriptorSetForFileDescriptors[F FileDescriptor](fileDescriptors ...F) *descriptorpb.FileDescriptorSet {\n\treturn &descriptorpb.FileDescriptorSet{\n\t\tFile: FileDescriptorProtosForFileDescriptors(fileDescriptors...),\n\t}\n}\n\n// ValidateFileDescriptor validates the FileDescriptor.\n//\n// A *descriptorpb.FileDescriptorProto can be passed to this.\nfunc ValidateFileDescriptor(fileDescriptor FileDescriptor) error {\n\tif fileDescriptor == nil {\n\t\treturn errors.New(\"nil FileDescriptor\")\n\t}\n\tif err := ValidateProtoPath(\"FileDescriptor.Name\", fileDescriptor.GetName()); err != nil {\n\t\treturn err\n\t}\n\tif err := ValidateProtoPaths(\"FileDescriptor.Dependency\", fileDescriptor.GetDependency()); err != nil {\n\t\treturn err\n\t}\n\tif fileDescriptor.GetSyntax() == \"editions\" {\n\t\tedition := fileDescriptor.GetEdition()\n\t\t// protocompile should support the same editions as buf (or possibly a superset at\n\t\t// some point in the future, like while support for a new edition is being implemented),\n\t\t// but we check with it just in case.\n\t\tif !protocompile.IsEditionSupported(edition) ||\n\t\t\tedition < MinSupportedEdition ||\n\t\t\tedition > MaxSupportedEdition {\n\t\t\treturn fmt.Errorf(\"%s uses unsupported edition %s\",\n\t\t\t\tfileDescriptor.GetName(), edition)\n\t\t}\n\t}\n\treturn nil\n}\n\n// ValidateProtoPath validates the proto path.\n//\n// This checks that the path is normalized and ends in .proto.\nfunc ValidateProtoPath(name string, path string) error {\n\tif path == \"\" {\n\t\treturn fmt.Errorf(\"%s is empty\", name)\n\t}\n\tnormalized, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"%s had normalization error: %w\", name, err)\n\t}\n\tif path != normalized {\n\t\treturn fmt.Errorf(\"%s %s was not normalized to %s\", name, path, normalized)\n\t}\n\tif normalpath.Ext(path) != \".proto\" {\n\t\treturn fmt.Errorf(\"%s %s does not have a .proto extension\", name, path)\n\t}\n\treturn nil\n}\n\n// ValidateProtoPaths validates the proto paths.\n//\n// This checks that the paths are normalized and end in .proto.\nfunc ValidateProtoPaths(name string, paths []string) error {\n\tfor _, path := range paths {\n\t\tif err := ValidateProtoPath(name, path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// FieldDescriptorProtoTypePrettyString prints a pretty string\n// representation of the FieldDescriptorProto_Type.\nfunc FieldDescriptorProtoTypePrettyString(t descriptorpb.FieldDescriptorProto_Type) string {\n\tswitch t {\n\tcase descriptorpb.FieldDescriptorProto_TYPE_DOUBLE:\n\t\treturn \"double\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_FLOAT:\n\t\treturn \"float\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_INT64:\n\t\treturn \"int64\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_UINT64:\n\t\treturn \"uint64\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_INT32:\n\t\treturn \"int32\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_FIXED64:\n\t\treturn \"fixed64\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_FIXED32:\n\t\treturn \"fixed32\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_BOOL:\n\t\treturn \"bool\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_STRING:\n\t\treturn \"string\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_GROUP:\n\t\treturn \"group\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_MESSAGE:\n\t\treturn \"message\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_BYTES:\n\t\treturn \"bytes\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_UINT32:\n\t\treturn \"uint32\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_ENUM:\n\t\treturn \"enum\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_SFIXED32:\n\t\treturn \"sfixed32\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_SFIXED64:\n\t\treturn \"sfixed64\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_SINT32:\n\t\treturn \"sint32\"\n\tcase descriptorpb.FieldDescriptorProto_TYPE_SINT64:\n\t\treturn \"sint64\"\n\tdefault:\n\t\treturn strconv.Itoa(int(t))\n\t}\n}\n\n// FieldDescriptorProtoLabelPrettyString prints a pretty string\n// representation of the FieldDescriptorProto_Label.\nfunc FieldDescriptorProtoLabelPrettyString(l descriptorpb.FieldDescriptorProto_Label) string {\n\tswitch l {\n\tcase descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL:\n\t\treturn \"optional\"\n\tcase descriptorpb.FieldDescriptorProto_LABEL_REQUIRED:\n\t\treturn \"required\"\n\tcase descriptorpb.FieldDescriptorProto_LABEL_REPEATED:\n\t\treturn \"repeated\"\n\tdefault:\n\t\treturn strconv.Itoa(int(l))\n\t}\n}\n"
  },
  {
    "path": "private/pkg/protodescriptor/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protodescriptor\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/protoencoding/detrand.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport _ \"unsafe\"\n\n//go:linkname detrandDisable google.golang.org/protobuf/internal/detrand.Disable\nfunc detrandDisable()\n\nfunc init() {\n\t// Disable detrand so that it does not mess with json or text serialization.\n\t//\n\t// https://github.com/golang/protobuf/issues/1121\n\t// https://go-review.googlesource.com/c/protobuf/+/151340\n\t// https://developers.google.com/protocol-buffers/docs/reference/go/faq#unstable-json\n\t//\n\t// Google is doing this in their own libraries at this point https://github.com/google/starlark-go/blob/ee8ed142361c69d52fe8e9fb5e311d2a0a7c02de/lib/proto/proto.go#L774\n\t//\n\t// See the above issues - detrand.Disable should fundamentally be allowed to be called by external\n\t// libraries, this has been an issue for years.\n\tdetrandDisable()\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/detrand_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// If our call to detrand.Disable ever stops working, these tests will result in\n// the data having random extra whitespaces on some test build.\n\nfunc TestJSONStable(t *testing.T) {\n\tt.Parallel()\n\n\tfileDescriptorProto := &descriptorpb.FileDescriptorProto{Name: proto.String(\"a.proto\")}\n\tdata, err := NewJSONMarshaler(nil, JSONMarshalerWithIndent()).Marshal(fileDescriptorProto)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t\"{\\n  \\\"name\\\": \\\"a.proto\\\"\\n}\",\n\t\tstring(data),\n\t)\n}\n\nfunc TestTxtpbStable(t *testing.T) {\n\tt.Parallel()\n\n\tfileDescriptorProto := &descriptorpb.FileDescriptorProto{Name: proto.String(\"a.proto\")}\n\tdata, err := NewTxtpbMarshaler(nil).Marshal(fileDescriptorProto)\n\trequire.NoError(t, err)\n\trequire.Equal(\n\t\tt,\n\t\t\"name: \\\"a.proto\\\"\\n\",\n\t\tstring(data),\n\t)\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/json_marshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype jsonMarshaler struct {\n\tresolver        Resolver\n\tindent          string\n\tuseProtoNames   bool\n\tuseEnumNumbers  bool\n\temitUnpopulated bool\n}\n\nfunc newJSONMarshaler(resolver Resolver, options ...JSONMarshalerOption) Marshaler {\n\tif resolver == nil {\n\t\tresolver = EmptyResolver\n\t}\n\tjsonMarshaler := &jsonMarshaler{\n\t\tresolver: resolver,\n\t}\n\tfor _, option := range options {\n\t\toption(jsonMarshaler)\n\t}\n\treturn jsonMarshaler\n}\n\nfunc (m *jsonMarshaler) Marshal(message proto.Message) ([]byte, error) {\n\tif err := ReparseExtensions(m.resolver, message.ProtoReflect()); err != nil {\n\t\treturn nil, err\n\t}\n\toptions := protojson.MarshalOptions{\n\t\tResolver:        m.resolver,\n\t\tUseProtoNames:   m.useProtoNames,\n\t\tUseEnumNumbers:  m.useEnumNumbers,\n\t\tEmitUnpopulated: m.emitUnpopulated,\n\t\tIndent:          m.indent,\n\t}\n\tdata, err := options.Marshal(message)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"json marshal: %w\", err)\n\t}\n\treturn data, err\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/json_unmarshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/encoding/protojson\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype jsonUnmarshaler struct {\n\tresolver        Resolver\n\tdisallowUnknown bool\n}\n\nfunc newJSONUnmarshaler(resolver Resolver, options ...JSONUnmarshalerOption) Unmarshaler {\n\tif resolver == nil {\n\t\tresolver = EmptyResolver\n\t}\n\tjsonUnmarshaler := &jsonUnmarshaler{\n\t\tresolver: resolver,\n\t}\n\tfor _, option := range options {\n\t\toption(jsonUnmarshaler)\n\t}\n\treturn jsonUnmarshaler\n}\n\nfunc (m *jsonUnmarshaler) Unmarshal(data []byte, message proto.Message) error {\n\toptions := protojson.UnmarshalOptions{\n\t\tResolver:       m.resolver,\n\t\tDiscardUnknown: !m.disallowUnknown,\n\t}\n\tif err := options.Unmarshal(data, message); err != nil {\n\t\treturn fmt.Errorf(\"json unmarshal: %w\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/protoencoding.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"buf.build/go/protoyaml\"\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/reflect/protoregistry\"\n)\n\n// EmptyResolver is a resolver that never resolves any descriptors. All methods will return (nil, NotFound).\nvar EmptyResolver Resolver = emptyResolver{}\n\n// Resolver can resolve files, messages, enums, and extensions.\ntype Resolver interface {\n\tprotodesc.Resolver\n\tprotoregistry.ExtensionTypeResolver\n\tprotoregistry.MessageTypeResolver\n\tFindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error)\n}\n\n// NewResolver creates a new Resolver.\n//\n// If the input slice is empty, this returns nil\n// The given FileDescriptors must be self-contained, that is they must contain all imports.\n// This can NOT be guaranteed for FileDescriptorSets given over the wire, and can only be guaranteed from builds.\nfunc NewResolver[F protodescriptor.FileDescriptor](fileDescriptors ...F) (Resolver, error) {\n\treturn newResolver(fileDescriptors...)\n}\n\n// NewLazyResolver creates a new Resolver that is constructed from the given\n// descriptors only as needed, if invoked.\n//\n// If there is an error when constructing the resolver, it will be returned by all\n// method calls of the returned resolver.\nfunc NewLazyResolver[F protodescriptor.FileDescriptor](fileDescriptors ...F) Resolver {\n\treturn &lazyResolver{fn: func() (Resolver, error) {\n\t\treturn newResolver(fileDescriptors...)\n\t}}\n}\n\n// CombineResolvers returns a resolver that uses all of the given resolvers. It\n// will use the first resolver, and if it returns an error, the second will be\n// tried, and so on.\nfunc CombineResolvers(resolvers ...Resolver) Resolver {\n\treturn combinedResolver(resolvers)\n}\n\n// Marshaler marshals Messages.\ntype Marshaler interface {\n\tMarshal(message proto.Message) ([]byte, error)\n}\n\n// NewWireMarshaler returns a new Marshaler for wire.\n//\n// See https://godoc.org/google.golang.org/protobuf/proto#MarshalOptions for a discussion on stability.\n// This has the potential to be unstable over time.\nfunc NewWireMarshaler() Marshaler {\n\treturn newWireMarshaler()\n}\n\n// NewJSONMarshaler returns a new Marshaler for JSON.\n//\n// This has the potential to be unstable over time.\n// If the resolver is nil, EmptyResolver will be used.\nfunc NewJSONMarshaler(resolver Resolver, options ...JSONMarshalerOption) Marshaler {\n\treturn newJSONMarshaler(resolver, options...)\n}\n\n// JSONMarshalerOption is an option for a new JSONMarshaler.\ntype JSONMarshalerOption func(*jsonMarshaler)\n\n// JSONMarshalerWithIndent says to use an indent of two spaces.\nfunc JSONMarshalerWithIndent() JSONMarshalerOption {\n\treturn func(jsonMarshaler *jsonMarshaler) {\n\t\tjsonMarshaler.indent = \"  \"\n\t}\n}\n\n// JSONMarshalerWithUseProtoNames says to use proto names.\nfunc JSONMarshalerWithUseProtoNames() JSONMarshalerOption {\n\treturn func(jsonMarshaler *jsonMarshaler) {\n\t\tjsonMarshaler.useProtoNames = true\n\t}\n}\n\n// JSONMarshalerWithUseEnumNumbers says to use enum numbers.\nfunc JSONMarshalerWithUseEnumNumbers() JSONMarshalerOption {\n\treturn func(jsonMarshaler *jsonMarshaler) {\n\t\tjsonMarshaler.useEnumNumbers = true\n\t}\n}\n\n// JSONMarshalerWithEmitUnpopulated says to emit unpopulated values\nfunc JSONMarshalerWithEmitUnpopulated() JSONMarshalerOption {\n\treturn func(jsonMarshaler *jsonMarshaler) {\n\t\tjsonMarshaler.emitUnpopulated = true\n\t}\n}\n\n// NewTxtpbMarshaler returns a new Marshaler for txtpb.\n//\n// If the resolver is nil, EmptyResolver will be used.\nfunc NewTxtpbMarshaler(resolver Resolver) Marshaler {\n\treturn newTxtpbMarshaler(resolver)\n}\n\n// NewYAMLMarshaler returns a new Marshaler for YAML.\n//\n// If the resolver is nil, EmptyResolver will be used.\nfunc NewYAMLMarshaler(resolver Resolver, options ...YAMLMarshalerOption) Marshaler {\n\treturn newYAMLMarshaler(resolver, options...)\n}\n\n// YAMLMarshalerOption is an option for a new YAMLMarshaler.\ntype YAMLMarshalerOption func(*yamlMarshaler)\n\n// YAMLMarshalerWithIndent says to use an indent of two spaces.\nfunc YAMLMarshalerWithIndent() YAMLMarshalerOption {\n\treturn func(yamlMarshaler *yamlMarshaler) {\n\t\tyamlMarshaler.indent = 2\n\t}\n}\n\n// YAMLMarshalerWithUseProtoNames says to use proto names.\nfunc YAMLMarshalerWithUseProtoNames() YAMLMarshalerOption {\n\treturn func(yamlMarshaler *yamlMarshaler) {\n\t\tyamlMarshaler.useProtoNames = true\n\t}\n}\n\n// YAMLMarshalerWithUseEnumNumbers says to use enum numbers.\nfunc YAMLMarshalerWithUseEnumNumbers() YAMLMarshalerOption {\n\treturn func(yamlMarshaler *yamlMarshaler) {\n\t\tyamlMarshaler.useEnumNumbers = true\n\t}\n}\n\n// YAMLMarshalerWithEmitUnpopulated says to emit unpopulated values\nfunc YAMLMarshalerWithEmitUnpopulated() YAMLMarshalerOption {\n\treturn func(yamlMarshaler *yamlMarshaler) {\n\t\tyamlMarshaler.emitUnpopulated = true\n\t}\n}\n\n// Unmarshaler unmarshals Messages.\ntype Unmarshaler interface {\n\tUnmarshal(data []byte, message proto.Message) error\n}\n\n// NewWireUnmarshaler returns a new Unmarshaler for wire.\n//\n// If the resolver is nil, EmptyResolver will be used.\nfunc NewWireUnmarshaler(resolver Resolver) Unmarshaler {\n\treturn newWireUnmarshaler(resolver)\n}\n\n// NewJSONUnmarshaler returns a new Unmarshaler for json.\n//\n// If the resolver is nil, EmptyResolver will be used.\nfunc NewJSONUnmarshaler(resolver Resolver, options ...JSONUnmarshalerOption) Unmarshaler {\n\treturn newJSONUnmarshaler(resolver, options...)\n}\n\n// JSONUnmarshalerOption is an option for a new JSONUnmarshaler.\ntype JSONUnmarshalerOption func(*jsonUnmarshaler)\n\n// JSONUnmarshalerWithDisallowUnknown says to disallow unrecognized fields.\nfunc JSONUnmarshalerWithDisallowUnknown() JSONUnmarshalerOption {\n\treturn func(jsonUnmarshaler *jsonUnmarshaler) {\n\t\tjsonUnmarshaler.disallowUnknown = true\n\t}\n}\n\n// NewTxtpbUnmarshaler returns a new Unmarshaler for txtpb.\n//\n// If the resolver is nil, EmptyResolver will be used.\nfunc NewTxtpbUnmarshaler(resolver Resolver) Unmarshaler {\n\treturn newTxtpbUnmarshaler(resolver)\n}\n\n// YAMLUnmarshalerOption is an option for a new YAMLUnmarshaler.\ntype YAMLUnmarshalerOption func(*yamlUnmarshaler)\n\n// YAMLUnmarshalerWithPath says to use the given path.\nfunc YAMLUnmarshalerWithPath(path string) YAMLUnmarshalerOption {\n\treturn func(yamlUnmarshaler *yamlUnmarshaler) {\n\t\tyamlUnmarshaler.path = path\n\t}\n}\n\n// YAMLUnmarshalerWithValidator says to use the given Validator.\nfunc YAMLUnmarshalerWithValidator(validator protoyaml.Validator) YAMLUnmarshalerOption {\n\treturn func(yamlUnmarshaler *yamlUnmarshaler) {\n\t\tyamlUnmarshaler.validator = validator\n\t}\n}\n\n// NewYAMLUnmarshaler returns a new Unmarshaler for yaml.\n//\n// If the resolver is nil, EmptyResolver will be used.\nfunc NewYAMLUnmarshaler(resolver Resolver, options ...YAMLUnmarshalerOption) Unmarshaler {\n\treturn newYAMLUnmarshaler(resolver, options...)\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/reparse_extensions.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\n// ReparseExtensions uses the given resolver to parse any unrecognized fields in the\n// given reflectMessage as well as re-parse any extensions.\nfunc ReparseExtensions(resolver Resolver, reflectMessage protoreflect.Message) error {\n\tif resolver == nil {\n\t\treturn nil\n\t}\n\treparseBytes := reflectMessage.GetUnknown()\n\n\tif reflectMessage.Descriptor().ExtensionRanges().Len() > 0 {\n\t\t// Collect extensions into separate message so we can serialize\n\t\t// *just* the extensions and then re-parse them below.\n\t\tvar msgExts protoreflect.Message\n\t\treflectMessage.Range(func(field protoreflect.FieldDescriptor, value protoreflect.Value) bool {\n\t\t\tif !field.IsExtension() {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif msgExts == nil {\n\t\t\t\tmsgExts = reflectMessage.Type().New()\n\t\t\t}\n\t\t\tmsgExts.Set(field, value)\n\t\t\treflectMessage.Clear(field)\n\t\t\treturn true\n\t\t})\n\t\tif msgExts != nil {\n\t\t\toptions := proto.MarshalOptions{AllowPartial: true}\n\t\t\tvar err error\n\t\t\treparseBytes, err = options.MarshalAppend(reparseBytes, msgExts.Interface())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(reparseBytes) > 0 {\n\t\treflectMessage.SetUnknown(nil)\n\t\toptions := proto.UnmarshalOptions{\n\t\t\tResolver: resolver,\n\t\t\tMerge:    true,\n\t\t}\n\t\tif err := options.Unmarshal(reparseBytes, reflectMessage.Interface()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tvar err error\n\treflectMessage.Range(func(fieldDescriptor protoreflect.FieldDescriptor, value protoreflect.Value) bool {\n\t\terr = reparseInField(resolver, fieldDescriptor, value)\n\t\treturn err == nil\n\t})\n\treturn err\n}\n\nfunc reparseInField(\n\tresolver Resolver,\n\tfieldDescriptor protoreflect.FieldDescriptor,\n\tvalue protoreflect.Value,\n) error {\n\tif fieldDescriptor.IsMap() {\n\t\tvalDesc := fieldDescriptor.MapValue()\n\t\tif valDesc.Kind() != protoreflect.MessageKind && valDesc.Kind() != protoreflect.GroupKind {\n\t\t\t// nothing to reparse\n\t\t\treturn nil\n\t\t}\n\t\tvar err error\n\t\tvalue.Map().Range(func(k protoreflect.MapKey, v protoreflect.Value) bool {\n\t\t\terr = ReparseExtensions(resolver, v.Message())\n\t\t\treturn err == nil\n\t\t})\n\t\treturn err\n\t}\n\tif fieldDescriptor.Kind() != protoreflect.MessageKind && fieldDescriptor.Kind() != protoreflect.GroupKind {\n\t\t// nothing to reparse\n\t\treturn nil\n\t}\n\tif fieldDescriptor.IsList() {\n\t\tlist := value.List()\n\t\tfor i := range list.Len() {\n\t\t\tif err := ReparseExtensions(resolver, list.Get(i).Message()); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\treturn ReparseExtensions(resolver, value.Message())\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/reparse_extensions_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"math\"\n\t\"testing\"\n\n\t\"buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/encoding/protowire\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n\t\"google.golang.org/protobuf/types/known/durationpb\"\n\t\"google.golang.org/protobuf/types/known/timestamppb\"\n)\n\nfunc TestReparseExtensions(t *testing.T) {\n\tt.Parallel()\n\n\tdescriptorFile := protodesc.ToFileDescriptorProto(descriptorpb.File_google_protobuf_descriptor_proto)\n\tdurationFile := protodesc.ToFileDescriptorProto(durationpb.File_google_protobuf_duration_proto)\n\ttimestampFile := protodesc.ToFileDescriptorProto(timestamppb.File_google_protobuf_timestamp_proto)\n\tvalidateFile := protodesc.ToFileDescriptorProto(validate.File_buf_validate_validate_proto)\n\n\t// The file will include one custom option with a known/generated type.\n\tfieldOpts := &descriptorpb.FieldOptions{}\n\tfieldRules := &validate.FieldRules{\n\t\tRequired: proto.Bool(true),\n\t\tType: &validate.FieldRules_Int32{\n\t\t\tInt32: &validate.Int32Rules{\n\t\t\t\tGreaterThan: &validate.Int32Rules_Gt{\n\t\t\t\t\tGt: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\tproto.SetExtension(fieldOpts, validate.E_Field, fieldRules)\n\t// The file will also contain an unrecognized custom option.\n\tconst customOptionNum = 54321\n\tconst customOptionVal = float32(3.14159)\n\tvar unknownOption []byte\n\tunknownOption = protowire.AppendTag(unknownOption, customOptionNum, protowire.Fixed32Type)\n\tunknownOption = protowire.AppendFixed32(unknownOption, math.Float32bits(customOptionVal))\n\tfieldOpts.ProtoReflect().SetUnknown(unknownOption)\n\n\ttestFile := &descriptorpb.FileDescriptorProto{\n\t\tName:       proto.String(\"test.proto\"),\n\t\tSyntax:     proto.String(\"proto3\"),\n\t\tPackage:    proto.String(\"blah.blah\"),\n\t\tDependency: []string{\"buf/validate/validate.proto\", \"google/protobuf/descriptor.proto\"},\n\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Foo\"),\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:     proto.String(\"bar\"),\n\t\t\t\t\t\tNumber:   proto.Int32(1),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_INT32.Enum(),\n\t\t\t\t\t\tJsonName: proto.String(\"bar\"),\n\t\t\t\t\t\tOptions:  fieldOpts,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".google.protobuf.FieldOptions\"),\n\t\t\t\tName:     proto.String(\"baz\"),\n\t\t\t\tNumber:   proto.Int32(customOptionNum),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_FLOAT.Enum(),\n\t\t\t},\n\t\t},\n\t}\n\n\tresolver, err := NewResolver(descriptorFile, durationFile, timestampFile, validateFile, testFile)\n\trequire.NoError(t, err)\n\terr = ReparseExtensions(resolver, testFile.ProtoReflect())\n\trequire.NoError(t, err)\n\n\trequire.Empty(t, fieldOpts.ProtoReflect().GetUnknown())\n\tvar found int\n\tfieldOpts.ProtoReflect().Range(func(field protoreflect.FieldDescriptor, value protoreflect.Value) bool {\n\t\tswitch field.Number() {\n\t\tcase customOptionNum:\n\t\t\tfound++\n\t\t\tassert.Equal(t, customOptionVal, value.Interface())\n\t\tcase protoreflect.FieldNumber(validate.E_Field.Field):\n\t\t\tfound++\n\t\t\tmsg := value.Message().Interface()\n\t\t\tassert.NotSame(t, fieldRules, msg)\n\t\t\t_, isGenType := msg.(*validate.FieldRules)\n\t\t\tassert.False(t, isGenType)\n\t\t\t_, isDynamicType := msg.(*dynamicpb.Message)\n\t\t\tassert.True(t, isDynamicType)\n\n\t\t\t// round-trip back to gen type to check for equality with original\n\t\t\tdata, err := proto.Marshal(msg)\n\t\t\trequire.NoError(t, err)\n\t\t\troundTrippedRules := &validate.FieldRules{}\n\t\t\terr = proto.Unmarshal(data, roundTrippedRules)\n\t\t\trequire.NoError(t, err)\n\t\t\trequire.Empty(t, cmp.Diff(fieldRules, roundTrippedRules, protocmp.Transform()))\n\t\t}\n\t\treturn true\n\t})\n\tassert.Equal(t, 2, found)\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/resolver.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/pkg/protodescriptor\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n\t\"google.golang.org/protobuf/reflect/protoregistry\"\n\t\"google.golang.org/protobuf/types/dynamicpb\"\n)\n\nconst maxTagNumber = 536870911 // 2^29 - 1\n\nfunc newResolver[F protodescriptor.FileDescriptor](fileDescriptors ...F) (Resolver, error) {\n\tif len(fileDescriptors) == 0 {\n\t\treturn nil, nil\n\t}\n\tfileDescriptorSet := protodescriptor.FileDescriptorSetForFileDescriptors(fileDescriptors...)\n\tif err := stripLegacyOptions(fileDescriptorSet.File); err != nil {\n\t\treturn nil, err\n\t}\n\t// TODO: handle if resolvable\n\tfiles, err := protodesc.FileOptions{\n\t\tAllowUnresolvable: true,\n\t}.NewFiles(fileDescriptorSet)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resolver{Files: files, Types: dynamicpb.NewTypes(files)}, nil\n}\n\ntype resolver struct {\n\t*protoregistry.Files\n\t*dynamicpb.Types\n}\n\ntype lazyResolver struct {\n\tfn       func() (Resolver, error)\n\tinit     sync.Once\n\tresolver Resolver\n\terr      error\n}\n\nfunc (l *lazyResolver) maybeInit() error {\n\tl.init.Do(func() {\n\t\tl.resolver, l.err = l.fn()\n\t})\n\treturn l.err\n}\n\nfunc (l *lazyResolver) FindFileByPath(path string) (protoreflect.FileDescriptor, error) {\n\tif err := l.maybeInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.resolver.FindFileByPath(path)\n}\n\nfunc (l *lazyResolver) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) {\n\tif err := l.maybeInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.resolver.FindDescriptorByName(name)\n}\n\nfunc (l *lazyResolver) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) {\n\tif err := l.maybeInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.resolver.FindEnumByName(enum)\n}\n\nfunc (l *lazyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {\n\tif err := l.maybeInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.resolver.FindExtensionByName(field)\n}\n\nfunc (l *lazyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {\n\tif err := l.maybeInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.resolver.FindExtensionByNumber(message, field)\n}\n\nfunc (l *lazyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {\n\tif err := l.maybeInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.resolver.FindMessageByName(message)\n}\n\nfunc (l *lazyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) {\n\tif err := l.maybeInit(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn l.resolver.FindMessageByURL(url)\n}\n\ntype combinedResolver []Resolver\n\nfunc (c combinedResolver) FindFileByPath(s string) (protoreflect.FileDescriptor, error) {\n\tvar lastErr error\n\tfor _, res := range c {\n\t\tfile, err := res.FindFileByPath(s)\n\t\tif err == nil {\n\t\t\treturn file, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (c combinedResolver) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) {\n\tvar lastErr error\n\tfor _, res := range c {\n\t\tdesc, err := res.FindDescriptorByName(name)\n\t\tif err == nil {\n\t\t\treturn desc, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (c combinedResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) {\n\tvar lastErr error\n\tfor _, res := range c {\n\t\textension, err := res.FindExtensionByName(field)\n\t\tif err == nil {\n\t\t\treturn extension, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (c combinedResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {\n\tvar lastErr error\n\tfor _, res := range c {\n\t\textension, err := res.FindExtensionByNumber(message, field)\n\t\tif err == nil {\n\t\t\treturn extension, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (c combinedResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) {\n\tvar lastErr error\n\tfor _, res := range c {\n\t\tmsg, err := res.FindMessageByName(message)\n\t\tif err == nil {\n\t\t\treturn msg, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (c combinedResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) {\n\tvar lastErr error\n\tfor _, res := range c {\n\t\tmsg, err := res.FindMessageByURL(url)\n\t\tif err == nil {\n\t\t\treturn msg, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (c combinedResolver) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) {\n\tvar lastErr error\n\tfor _, res := range c {\n\t\tmsg, err := res.FindEnumByName(enum)\n\t\tif err == nil {\n\t\t\treturn msg, nil\n\t\t}\n\t\tlastErr = err\n\t}\n\tif lastErr != nil {\n\t\treturn nil, lastErr\n\t}\n\treturn nil, protoregistry.NotFound\n}\n\ntype emptyResolver struct{}\n\nfunc (emptyResolver) FindFileByPath(string) (protoreflect.FileDescriptor, error) {\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (emptyResolver) FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) {\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (emptyResolver) FindEnumByName(protoreflect.FullName) (protoreflect.EnumType, error) {\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (emptyResolver) FindExtensionByName(protoreflect.FullName) (protoreflect.ExtensionType, error) {\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (emptyResolver) FindExtensionByNumber(protoreflect.FullName, protoreflect.FieldNumber) (protoreflect.ExtensionType, error) {\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (emptyResolver) FindMessageByName(protoreflect.FullName) (protoreflect.MessageType, error) {\n\treturn nil, protoregistry.NotFound\n}\n\nfunc (emptyResolver) FindMessageByURL(string) (protoreflect.MessageType, error) {\n\treturn nil, protoregistry.NotFound\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/strip_legacy_options.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// stripLegacyOptions modifies the given slice of file descriptors so that the slice does\n// not contain legacy elements that the Go protobuf runtime does not support -- namely\n// messages that use the message set wire format (and any extensions whose tags are too\n// high to use outside of message set wire format) and weak fields.\n//\n// It does this by simply clearing any message_set_wire_format message options and weak\n// field options encountered, by omitting extensions whose tags are too high, and by\n// modifying extension ranges with numbers that are too high (which means omitting\n// ranges whose start value is too high).\n//\n// This does not actually mutate the given descriptors (though it will mutate the given\n// slice). If any of the descriptors needs to be modified, it is first cloned and its\n// replacement will be stored in the slice. So it is safe to provide descriptor protos\n// that are potentially shared with/referenced from other state.\nfunc stripLegacyOptions(files []*descriptorpb.FileDescriptorProto) error {\n\tfor i, file := range files {\n\t\tnewDescriptor, err := stripLegacyOptionsFromFile(file)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif newDescriptor != nil {\n\t\t\tfiles[i] = newDescriptor\n\t\t}\n\t}\n\treturn nil\n}\n\n// stripLegacyOptionsFromFile strips legacy options from the given file descriptor.\n// If none are encountered this returns nil to indicate no changes were made. Otherwise,\n// it returns a clone of file with legacy options removed.\nfunc stripLegacyOptionsFromFile(file *descriptorpb.FileDescriptorProto) (*descriptorpb.FileDescriptorProto, error) {\n\tvar cloned bool\n\tfor i, message := range file.MessageType {\n\t\tnewDescriptor, err := stripLegacyOptionsFromMessage(message)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif newDescriptor == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif !cloned {\n\t\t\tfile = proto.CloneOf(file)\n\t\t\tcloned = true\n\t\t}\n\t\tfile.MessageType[i] = newDescriptor\n\t}\n\tnewExts, err := stripLegacyOptionsFromExtensions(file.Extension)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif newExts != nil {\n\t\tif !cloned {\n\t\t\tfile = proto.CloneOf(file)\n\t\t\tcloned = true\n\t\t}\n\t\tfile.Extension = newExts\n\t}\n\tif cloned {\n\t\treturn file, nil\n\t}\n\treturn nil, nil // nothing changed\n}\n\n// stripLegacyOptionsFromMessage strips legacy options from the given message descriptor.\n// If none are encountered this returns nil to indicate no changes were made. Otherwise,\n// it returns a clone of message with legacy options removed.\nfunc stripLegacyOptionsFromMessage(message *descriptorpb.DescriptorProto) (*descriptorpb.DescriptorProto, error) {\n\tvar cloned bool\n\tif message.GetOptions().GetMessageSetWireFormat() {\n\t\t// Strip this option since the Go runtime does not support\n\t\t// creating protoreflect.Descriptor instances with this set.\n\t\tmessage = proto.CloneOf(message)\n\t\tcloned = true\n\t\tmessage.Options.MessageSetWireFormat = nil\n\t}\n\tfor i, field := range message.Field {\n\t\tnewDescriptor, err := stripLegacyOptionsFromField(field)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif newDescriptor == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif !cloned {\n\t\t\tmessage = proto.CloneOf(message)\n\t\t\tcloned = true\n\t\t}\n\t\tmessage.Field[i] = newDescriptor\n\t}\n\n\tfor i, nested := range message.NestedType {\n\t\tnewDescriptor, err := stripLegacyOptionsFromMessage(nested)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif newDescriptor == nil {\n\t\t\tcontinue\n\t\t}\n\t\tif !cloned {\n\t\t\tmessage = proto.CloneOf(message)\n\t\t\tcloned = true\n\t\t}\n\t\tmessage.NestedType[i] = newDescriptor\n\t}\n\tnewExtRanges, err := stripLegacyOptionsFromExtensionRanges(message.ExtensionRange)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif newExtRanges != nil {\n\t\tif !cloned {\n\t\t\tmessage = proto.CloneOf(message)\n\t\t\tcloned = true\n\t\t}\n\t\tmessage.ExtensionRange = newExtRanges\n\t}\n\tnewExts, err := stripLegacyOptionsFromExtensions(message.Extension)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif newExts != nil {\n\t\tif !cloned {\n\t\t\tmessage = proto.CloneOf(message)\n\t\t\tcloned = true\n\t\t}\n\t\tmessage.Extension = newExts\n\t}\n\tif cloned {\n\t\treturn message, nil\n\t}\n\treturn nil, nil // nothing changed\n}\n\n// stripLegacyOptionsFromField strips legacy options from the given field descriptor.\n// If none are encountered this returns nil to indicate no changes were made. Otherwise,\n// it returns a clone of field with legacy options removed.\nfunc stripLegacyOptionsFromField(field *descriptorpb.FieldDescriptorProto) (*descriptorpb.FieldDescriptorProto, error) {\n\tif !field.GetOptions().GetWeak() {\n\t\treturn nil, nil\n\t}\n\t// Strip this option since the Go runtime does not support\n\t// creating protoreflect.Descriptor instances with this set.\n\t// Buf CLI doesn't actually support weak dependencies, so\n\t// there should be no practical consequences of removing this.\n\tnewField := proto.CloneOf(field)\n\tnewField.Options.Weak = nil\n\treturn newField, nil\n}\n\n// stripLegacyOptionsFromExtensions strips legacy options and values from the\n// given slice of extension descriptor. If none are encountered this returns\n// nil to indicate no changes were made. Otherwise, it returns a new slice\n// that omits invalid legacy extensions (those whose tag number is too high\n// because they extended a message with message set wire format) and replaces\n// items that had legacy options with clones that have the options removed.\nfunc stripLegacyOptionsFromExtensions(exts []*descriptorpb.FieldDescriptorProto) ([]*descriptorpb.FieldDescriptorProto, error) {\n\t// We leave this nil unless we are actually changing the extensions\n\t// (by removing one with a tag that is too high are or by stripping\n\t// the weak option from one).\n\tvar newExts []*descriptorpb.FieldDescriptorProto\n\tfor i, ext := range exts {\n\t\t// Message-set extensions could be out of range. We simply remove them.\n\t\t// This could possibly\n\t\tif ext.GetNumber() > maxTagNumber {\n\t\t\tif newExts == nil {\n\t\t\t\t// initialize to everything so far except current item (which we're dropping)\n\t\t\t\tnewExts = make([]*descriptorpb.FieldDescriptorProto, i, len(exts)-1)\n\t\t\t\tcopy(newExts, exts)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tnewDescriptor, err := stripLegacyOptionsFromField(ext)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif newDescriptor != nil {\n\t\t\tif newExts == nil {\n\t\t\t\t// initialize to everything so far except current item (that we're replacing)\n\t\t\t\tnewExts = make([]*descriptorpb.FieldDescriptorProto, i, len(exts))\n\t\t\t\tcopy(newExts, exts)\n\t\t\t}\n\t\t\tnewExts = append(newExts, newDescriptor)\n\t\t\tcontinue\n\t\t}\n\t\tif newExts != nil {\n\t\t\tnewExts = append(newExts, ext)\n\t\t}\n\t}\n\treturn newExts, nil\n}\n\n// stripLegacyOptionsFromExtensionRanges strips legacy values from the given\n// slice of extension descriptor. If none are encountered this returns nil\n// to indicate no changes were made. Otherwise, it returns a new slice that\n// is updated to exclude invalid legacy extension ranges (those referencing\n// tag numbers that are too high because they extended a message with message\n// set wire format). If an extension range has a start tag that is too high,\n// it is omitted entirely. If it has an end tag that is too high, the end tag\n// is changed to the maximum valid end tag.\nfunc stripLegacyOptionsFromExtensionRanges(extRanges []*descriptorpb.DescriptorProto_ExtensionRange) ([]*descriptorpb.DescriptorProto_ExtensionRange, error) {\n\t// We leave this nil unless we are actually changing the extensions\n\t// (by removing one with a tag that is too high are or by stripping\n\t// the weak option from one).\n\tvar newExtRanges []*descriptorpb.DescriptorProto_ExtensionRange\n\tfor i, extRange := range extRanges {\n\t\t// Message-set extensions could be out of range. We simply remove them.\n\t\t// This could possibly\n\t\tif extRange.GetStart() > maxTagNumber {\n\t\t\tif newExtRanges == nil {\n\t\t\t\t// initialize to everything so far except current item (which we're dropping)\n\t\t\t\tnewExtRanges = make([]*descriptorpb.DescriptorProto_ExtensionRange, i, len(extRanges)-1)\n\t\t\t\tcopy(newExtRanges, extRanges)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif extRange.GetEnd() > maxTagNumber+1 /* extension range end is exclusive */ {\n\t\t\tnewExtRange := proto.CloneOf(extRange)\n\t\t\tnewExtRange.End = proto.Int32(maxTagNumber + 1)\n\t\t\tif newExtRanges == nil {\n\t\t\t\t// initialize to everything so far except current item (that we're replacing)\n\t\t\t\tnewExtRanges = make([]*descriptorpb.DescriptorProto_ExtensionRange, i, len(extRanges))\n\t\t\t\tcopy(newExtRanges, extRanges)\n\t\t\t}\n\t\t\tnewExtRanges = append(newExtRanges, newExtRange)\n\t\t\tcontinue\n\t\t}\n\t\tif newExtRanges != nil {\n\t\t\tnewExtRanges = append(newExtRanges, extRange)\n\t\t}\n\t}\n\treturn newExtRanges, nil\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/strip_legacy_options_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"testing\"\n\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/proto\"\n\t\"google.golang.org/protobuf/reflect/protodesc\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\nfunc TestStripLegacyOptions(t *testing.T) {\n\tt.Parallel()\n\n\tt.Run(\"no-legacy-options\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tnoLegacy := getFileWithNoLegacyOptions()\n\t\tfiles := []*descriptorpb.FileDescriptorProto{noLegacy}\n\t\terr := stripLegacyOptions(files)\n\t\trequire.NoError(t, err)\n\t\t// Slice not touched\n\t\trequire.Same(t, noLegacy, files[0])\n\t\t// File descriptor not mutated in any way\n\t\trequire.Empty(t, cmp.Diff(getFileWithNoLegacyOptions(), noLegacy, protocmp.Transform()))\n\t})\n\tt.Run(\"legacy_options\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tlegacy := getFileWithLegacyOptions()\n\t\tfiles := []*descriptorpb.FileDescriptorProto{legacy}\n\t\terr := stripLegacyOptions(files)\n\t\trequire.NoError(t, err)\n\t\trequire.Empty(t, cmp.Diff(getFileWithLegacyOptionsRemoved(), files[0], protocmp.Transform()))\n\t\t// Original file replaced but not touched\n\t\trequire.NotSame(t, legacy, files[0])\n\t\trequire.Empty(t, cmp.Diff(getFileWithLegacyOptions(), legacy, protocmp.Transform()))\n\t})\n\tt.Run(\"mixed\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tnoLegacy := getFileWithNoLegacyOptions()\n\t\tlegacy := getFileWithLegacyOptions()\n\t\tfiles := []*descriptorpb.FileDescriptorProto{noLegacy, legacy}\n\t\terr := stripLegacyOptions(files)\n\t\trequire.NoError(t, err)\n\t\trequire.Empty(t, cmp.Diff(getFileWithLegacyOptionsRemoved(), files[1], protocmp.Transform()))\n\t\t// First file not touched\n\t\trequire.Same(t, noLegacy, files[0])\n\t\trequire.Empty(t, cmp.Diff(getFileWithNoLegacyOptions(), noLegacy, protocmp.Transform()))\n\t\t// Second file replaced but not touched\n\t\trequire.NotSame(t, legacy, files[1])\n\t\trequire.Empty(t, cmp.Diff(getFileWithLegacyOptions(), legacy, protocmp.Transform()))\n\n\t\t// Make sure Go runtime is okay with result\n\t\t_, err = NewResolver(files...)\n\t\trequire.NoError(t, err)\n\t})\n\tt.Run(\"protobuf-go-is-happy\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\t// Go runtime is unhappy because of legacy features.\n\t\tfiles := []*descriptorpb.FileDescriptorProto{getFileWithNoLegacyOptions(), getFileWithLegacyOptions()}\n\t\t_, err := protodesc.NewFiles(&descriptorpb.FileDescriptorSet{File: files})\n\t\trequire.ErrorContains(t, err, \"legacy proto1 feature that is no longer supported\")\n\n\t\terr = stripLegacyOptions(files)\n\t\trequire.NoError(t, err)\n\n\t\t// Now it's happy since legacy features have been removed.\n\t\t_, err = protodesc.NewFiles(&descriptorpb.FileDescriptorSet{File: files})\n\t\trequire.NoError(t, err)\n\t})\n}\n\nfunc getFileWithNoLegacyOptions() *descriptorpb.FileDescriptorProto {\n\treturn &descriptorpb.FileDescriptorProto{\n\t\tName:    proto.String(\"no_legacy.proto\"),\n\t\tPackage: proto.String(\"foo.bar\"),\n\t\tSyntax:  proto.String(\"proto2\"),\n\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Foo\"),\n\t\t\t\tOptions: &descriptorpb.MessageOptions{\n\t\t\t\t\tNoStandardDescriptorAccessor: proto.Bool(true),\n\t\t\t\t\tDeprecated:                   proto.Bool(true),\n\t\t\t\t},\n\t\t\t\tExtensionRange: []*descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\t\t\t{\n\t\t\t\t\t\tStart: proto.Int32(100),\n\t\t\t\t\t\tEnd:   proto.Int32(maxTagNumber + 1),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"Bar\"),\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:   proto.String(\"name\"),\n\t\t\t\t\t\tNumber: proto.Int32(1),\n\t\t\t\t\t\tLabel:  descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:   descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\t\t\tDebugRedact: proto.Bool(true),\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\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Foo\"),\n\t\t\t\tName:     proto.String(\"a\"),\n\t\t\t\tNumber:   proto.Int32(maxTagNumber),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_INT64.Enum(),\n\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\tJstype: descriptorpb.FieldOptions_JS_STRING.Enum(),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}\n\nfunc getFileWithLegacyOptions() *descriptorpb.FileDescriptorProto {\n\treturn &descriptorpb.FileDescriptorProto{\n\t\tName:       proto.String(\"legacy.proto\"),\n\t\tPackage:    proto.String(\"foo.bar\"),\n\t\tSyntax:     proto.String(\"proto2\"),\n\t\tDependency: []string{\"no_legacy.proto\"},\n\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Baz\"),\n\t\t\t\tOptions: &descriptorpb.MessageOptions{\n\t\t\t\t\tNoStandardDescriptorAccessor: proto.Bool(true),\n\t\t\t\t\tDeprecated:                   proto.Bool(true),\n\t\t\t\t},\n\t\t\t\tExtensionRange: []*descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\t\t\t{\n\t\t\t\t\t\tStart: proto.Int32(100),\n\t\t\t\t\t\tEnd:   proto.Int32(maxTagNumber + 1),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"Frob\"),\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:   proto.String(\"name\"),\n\t\t\t\t\t\tNumber: proto.Int32(1),\n\t\t\t\t\t\tLabel:  descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:   descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\t\t\tDebugRedact: proto.Bool(true),\n\t\t\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\t\t\tWeak: proto.Bool(true),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Nitz\"),\n\t\t\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:   proto.String(\"name\"),\n\t\t\t\t\t\t\t\tNumber: proto.Int32(1),\n\t\t\t\t\t\t\t\tLabel:  descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\t\t\tType:   descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\t\t\t\t\tWeak: proto.Bool(true),\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\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\t\t\tName:     proto.String(\"a\"),\n\t\t\t\t\t\tNumber:   proto.Int32(1000),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_UINT64.Enum(),\n\t\t\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\t\t\tJstype: descriptorpb.FieldOptions_JS_STRING.Enum(),\n\t\t\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\t\t\tWeak: proto.Bool(true),\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\t{\n\t\t\t\tName: proto.String(\"Fizz\"),\n\t\t\t\tOptions: &descriptorpb.MessageOptions{\n\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\tMessageSetWireFormat: proto.Bool(true),\n\t\t\t\t},\n\t\t\t\tExtensionRange: []*descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\t\t\t{\n\t\t\t\t\t\tStart: proto.Int32(100),\n\t\t\t\t\t\tEnd:   proto.Int32(1000),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// TO BE MODIFIED\n\t\t\t\t\t\tStart: proto.Int32(1000),\n\t\t\t\t\t\tEnd:   proto.Int32(maxTagNumber * 2),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\t\tStart: proto.Int32(maxTagNumber * 3),\n\t\t\t\t\t\tEnd:   proto.Int32(maxTagNumber*3 + 1000),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\t\tStart: proto.Int32(maxTagNumber * 4),\n\t\t\t\t\t\tEnd:   proto.Int32(maxTagNumber*4 + 3),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}},\n\t\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Foo\"),\n\t\t\t\tName:     proto.String(\"b\"),\n\t\t\t\tNumber:   proto.Int32(100),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_INT64.Enum(),\n\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\tJstype: descriptorpb.FieldOptions_JS_STRING.Enum(),\n\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\tWeak: proto.Bool(true),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\tName:     proto.String(\"c\"),\n\t\t\t\tNumber:   proto.Int32(100),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_INT64.Enum(),\n\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\tJstype: descriptorpb.FieldOptions_JS_STRING.Enum(),\n\t\t\t\t\t// TO BE REMOVED\n\t\t\t\t\tWeak: proto.Bool(true),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Fizz\"),\n\t\t\t\tName:     proto.String(\"d\"),\n\t\t\t\tNumber:   proto.Int32(100),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.Foo\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Fizz\"),\n\t\t\t\tName:     proto.String(\"e\"),\n\t\t\t\tNumber:   proto.Int32(maxTagNumber),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.Bar\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\t// TO BE REMOVED\n\t\t\t\tExtendee: proto.String(\".foo.bar.Fizz\"),\n\t\t\t\tName:     proto.String(\"f\"),\n\t\t\t\tNumber:   proto.Int32(maxTagNumber * 2),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.Baz\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\t// TO BE REMOVED\n\t\t\t\tExtendee: proto.String(\".foo.bar.Fizz\"),\n\t\t\t\tName:     proto.String(\"g\"),\n\t\t\t\tNumber:   proto.Int32(maxTagNumber * 4),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.Frob\"),\n\t\t\t},\n\t\t},\n\t}\n}\n\nfunc getFileWithLegacyOptionsRemoved() *descriptorpb.FileDescriptorProto {\n\t// Returns the same thing as getFileWithLegacyOptions, but without\n\t// legacy options/values in it.\n\treturn &descriptorpb.FileDescriptorProto{\n\t\tName:       proto.String(\"legacy.proto\"),\n\t\tPackage:    proto.String(\"foo.bar\"),\n\t\tSyntax:     proto.String(\"proto2\"),\n\t\tDependency: []string{\"no_legacy.proto\"},\n\t\tMessageType: []*descriptorpb.DescriptorProto{\n\t\t\t{\n\t\t\t\tName: proto.String(\"Baz\"),\n\t\t\t\tOptions: &descriptorpb.MessageOptions{\n\t\t\t\t\tNoStandardDescriptorAccessor: proto.Bool(true),\n\t\t\t\t\tDeprecated:                   proto.Bool(true),\n\t\t\t\t},\n\t\t\t\tExtensionRange: []*descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\t\t\t{\n\t\t\t\t\t\tStart: proto.Int32(100),\n\t\t\t\t\t\tEnd:   proto.Int32(maxTagNumber + 1),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tName: proto.String(\"Frob\"),\n\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName:   proto.String(\"name\"),\n\t\t\t\t\t\tNumber: proto.Int32(1),\n\t\t\t\t\t\tLabel:  descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:   descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\t\t\tDebugRedact: proto.Bool(true),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tNestedType: []*descriptorpb.DescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tName: proto.String(\"Nitz\"),\n\t\t\t\t\t\tField: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tName:    proto.String(\"name\"),\n\t\t\t\t\t\t\t\tNumber:  proto.Int32(1),\n\t\t\t\t\t\t\t\tLabel:   descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\t\t\tType:    descriptorpb.FieldDescriptorProto_TYPE_STRING.Enum(),\n\t\t\t\t\t\t\t\tOptions: &descriptorpb.FieldOptions{},\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\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t\t\t{\n\t\t\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\t\t\tName:     proto.String(\"a\"),\n\t\t\t\t\t\tNumber:   proto.Int32(1000),\n\t\t\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_UINT64.Enum(),\n\t\t\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\t\t\tJstype: descriptorpb.FieldOptions_JS_STRING.Enum(),\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\t{\n\t\t\t\tName:    proto.String(\"Fizz\"),\n\t\t\t\tOptions: &descriptorpb.MessageOptions{},\n\t\t\t\tExtensionRange: []*descriptorpb.DescriptorProto_ExtensionRange{\n\t\t\t\t\t{\n\t\t\t\t\t\tStart: proto.Int32(100),\n\t\t\t\t\t\tEnd:   proto.Int32(1000),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tStart: proto.Int32(1000),\n\t\t\t\t\t\tEnd:   proto.Int32(maxTagNumber + 1),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t}},\n\t\tExtension: []*descriptorpb.FieldDescriptorProto{\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Foo\"),\n\t\t\t\tName:     proto.String(\"b\"),\n\t\t\t\tNumber:   proto.Int32(100),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_INT64.Enum(),\n\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\tJstype: descriptorpb.FieldOptions_JS_STRING.Enum(),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Baz\"),\n\t\t\t\tName:     proto.String(\"c\"),\n\t\t\t\tNumber:   proto.Int32(100),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_INT64.Enum(),\n\t\t\t\tOptions: &descriptorpb.FieldOptions{\n\t\t\t\t\tJstype: descriptorpb.FieldOptions_JS_STRING.Enum(),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Fizz\"),\n\t\t\t\tName:     proto.String(\"d\"),\n\t\t\t\tNumber:   proto.Int32(100),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.Foo\"),\n\t\t\t},\n\t\t\t{\n\t\t\t\tExtendee: proto.String(\".foo.bar.Fizz\"),\n\t\t\t\tName:     proto.String(\"e\"),\n\t\t\t\tNumber:   proto.Int32(maxTagNumber),\n\t\t\t\tLabel:    descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum(),\n\t\t\t\tType:     descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum(),\n\t\t\t\tTypeName: proto.String(\".foo.bar.Bar\"),\n\t\t\t},\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/txtpb_marshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/encoding/prototext\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype txtpbMarshaler struct {\n\tresolver Resolver\n}\n\nfunc newTxtpbMarshaler(resolver Resolver) Marshaler {\n\tif resolver == nil {\n\t\tresolver = EmptyResolver\n\t}\n\treturn &txtpbMarshaler{\n\t\tresolver: resolver,\n\t}\n}\n\nfunc (m *txtpbMarshaler) Marshal(message proto.Message) ([]byte, error) {\n\toptions := prototext.MarshalOptions{\n\t\tResolver: m.resolver,\n\t\tIndent:   \"  \",\n\t}\n\tdata, err := options.Marshal(message)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"txtpb marshal: %w\", err)\n\t}\n\treturn data, err\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/txtpb_unmarshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/encoding/prototext\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype txtpbUnmarshaler struct {\n\tresolver Resolver\n}\n\nfunc newTxtpbUnmarshaler(resolver Resolver) Unmarshaler {\n\tif resolver == nil {\n\t\tresolver = EmptyResolver\n\t}\n\treturn &txtpbUnmarshaler{\n\t\tresolver: resolver,\n\t}\n}\n\nfunc (m *txtpbUnmarshaler) Unmarshal(data []byte, message proto.Message) error {\n\toptions := prototext.UnmarshalOptions{\n\t\tResolver: m.resolver,\n\t\t// TODO: make this an option\n\t\tDiscardUnknown: true,\n\t}\n\tif err := options.Unmarshal(data, message); err != nil {\n\t\treturn fmt.Errorf(\"txtpb unmarshal: %w\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protoencoding\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/protoencoding/wire_marshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype wireMarshaler struct{}\n\nfunc newWireMarshaler() Marshaler {\n\treturn &wireMarshaler{}\n}\n\nfunc (m *wireMarshaler) Marshal(message proto.Message) ([]byte, error) {\n\toptions := proto.MarshalOptions{\n\t\tDeterministic: true,\n\t}\n\tdata, err := options.Marshal(message)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"wire marshal: %w\", err)\n\t}\n\treturn data, err\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/wire_unmarshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype wireUnmarshaler struct {\n\tresolver Resolver\n}\n\nfunc newWireUnmarshaler(resolver Resolver) Unmarshaler {\n\tif resolver == nil {\n\t\tresolver = EmptyResolver\n\t}\n\treturn &wireUnmarshaler{\n\t\tresolver: resolver,\n\t}\n}\n\nfunc (m *wireUnmarshaler) Unmarshal(data []byte, message proto.Message) error {\n\toptions := proto.UnmarshalOptions{\n\t\tResolver: m.resolver,\n\t}\n\tif err := options.Unmarshal(data, message); err != nil {\n\t\treturn fmt.Errorf(\"wire unmarshal: %w\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/yaml_marshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"buf.build/go/protoyaml\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype yamlMarshaler struct {\n\tresolver        Resolver\n\tindent          int\n\tuseProtoNames   bool\n\tuseEnumNumbers  bool\n\temitUnpopulated bool\n}\n\nfunc newYAMLMarshaler(resolver Resolver, options ...YAMLMarshalerOption) Marshaler {\n\tif resolver == nil {\n\t\tresolver = EmptyResolver\n\t}\n\tyamlMarshaler := &yamlMarshaler{\n\t\tresolver: resolver,\n\t}\n\tfor _, option := range options {\n\t\toption(yamlMarshaler)\n\t}\n\treturn yamlMarshaler\n}\n\nfunc (m *yamlMarshaler) Marshal(message proto.Message) ([]byte, error) {\n\tif err := ReparseExtensions(m.resolver, message.ProtoReflect()); err != nil {\n\t\treturn nil, err\n\t}\n\toptions := protoyaml.MarshalOptions{\n\t\tIndent:          m.indent,\n\t\tResolver:        m.resolver,\n\t\tUseProtoNames:   m.useProtoNames,\n\t\tUseEnumNumbers:  m.useEnumNumbers,\n\t\tEmitUnpopulated: m.emitUnpopulated,\n\t}\n\tdata, err := options.Marshal(message)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"yaml marshal: %w\", err)\n\t}\n\treturn data, err\n}\n"
  },
  {
    "path": "private/pkg/protoencoding/yaml_unmarshaler.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoencoding\n\nimport (\n\t\"fmt\"\n\n\t\"buf.build/go/protoyaml\"\n\t\"google.golang.org/protobuf/proto\"\n)\n\ntype yamlUnmarshaler struct {\n\tresolver  Resolver\n\tpath      string\n\tvalidator protoyaml.Validator\n}\n\nfunc newYAMLUnmarshaler(resolver Resolver, options ...YAMLUnmarshalerOption) Unmarshaler {\n\tif resolver == nil {\n\t\tresolver = EmptyResolver\n\t}\n\tresult := &yamlUnmarshaler{\n\t\tresolver: resolver,\n\t}\n\tfor _, option := range options {\n\t\toption(result)\n\t}\n\treturn result\n}\n\nfunc (m *yamlUnmarshaler) Unmarshal(data []byte, message proto.Message) error {\n\toptions := protoyaml.UnmarshalOptions{\n\t\tResolver:  m.resolver,\n\t\tValidator: m.validator,\n\t\tPath:      m.path,\n\t}\n\tif err := options.Unmarshal(data, message); err != nil {\n\t\treturn fmt.Errorf(\"yaml unmarshal: %w\", err)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/protogenutil/named_helper.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protogenutil\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"strings\"\n\n\t\"google.golang.org/protobuf/compiler/protogen\"\n)\n\nconst namedHelperGoPackageOptionKey = \"named_go_package\"\n\ntype namedHelper struct {\n\tpluginNameToGoPackage map[string]string\n}\n\nfunc newNamedHelper() *namedHelper {\n\treturn &namedHelper{\n\t\tpluginNameToGoPackage: make(map[string]string),\n\t}\n}\n\nfunc (h *namedHelper) NewGoPackageName(\n\tbaseGoPackageName protogen.GoPackageName,\n\tpluginName string,\n) protogen.GoPackageName {\n\treturn protogen.GoPackageName(string(baseGoPackageName) + pluginName)\n}\n\nfunc (h *namedHelper) NewGoImportPath(\n\tfile *protogen.File,\n\tpluginName string,\n) (protogen.GoImportPath, error) {\n\treturn h.newGoImportPath(\n\t\tpath.Dir(file.GeneratedFilenamePrefix),\n\t\tfile.GoPackageName,\n\t\tpluginName,\n\t)\n}\n\nfunc (h *namedHelper) NewPackageGoImportPath(\n\tgoPackageFileSet *GoPackageFileSet,\n\tpluginName string,\n) (protogen.GoImportPath, error) {\n\treturn h.newGoImportPath(\n\t\tgoPackageFileSet.GeneratedDir,\n\t\tgoPackageFileSet.GoPackageName,\n\t\tpluginName,\n\t)\n}\n\nfunc (h *namedHelper) NewGlobalGoImportPath(\n\tpluginName string,\n) (protogen.GoImportPath, error) {\n\tgoPackage, ok := h.pluginNameToGoPackage[pluginName]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"no %s specified for plugin %s\", namedHelperGoPackageOptionKey, pluginName)\n\t}\n\treturn protogen.GoImportPath(goPackage), nil\n}\n\nfunc (h *namedHelper) NewGeneratedFile(\n\tplugin *protogen.Plugin,\n\tfile *protogen.File,\n\tpluginName string,\n) (*protogen.GeneratedFile, error) {\n\tgoImportPath, err := h.NewGoImportPath(file, pluginName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgoPackageName := h.NewGoPackageName(file.GoPackageName, pluginName)\n\tgeneratedFilePath := path.Dir(file.GeneratedFilenamePrefix) +\n\t\t\"/\" + string(goPackageName) +\n\t\t\"/\" + path.Base(file.GeneratedFilenamePrefix) +\n\t\t\".pb.go\"\n\n\tgeneratedFile := plugin.NewGeneratedFile(generatedFilePath, goImportPath)\n\tprintGeneratedFileNamedHelperHeader(generatedFile, goPackageName, pluginName)\n\treturn generatedFile, nil\n}\n\nfunc (h *namedHelper) NewPackageGeneratedFile(\n\tplugin *protogen.Plugin,\n\tgoPackageFileSet *GoPackageFileSet,\n\tpluginName string,\n) (*protogen.GeneratedFile, error) {\n\tgoImportPath, err := h.NewPackageGoImportPath(goPackageFileSet, pluginName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgoPackageName := h.NewGoPackageName(goPackageFileSet.GoPackageName, pluginName)\n\tfileBaseName := string(goPackageName)\n\t// make sure this file name would not overlap with any actual file name\n\tfor _, file := range goPackageFileSet.Files {\n\t\tif path.Base(file.GeneratedFilenamePrefix) == fileBaseName {\n\t\t\tfileBaseName = fileBaseName + \"_pkg\"\n\t\t\t// do not break, just for the malicious case, where there is a file\n\t\t\t// packagename_pkg.proto, packagename_pkg_pkg.proto, etc\n\t\t}\n\t}\n\tgeneratedFilePath := goPackageFileSet.GeneratedDir +\n\t\t\"/\" + string(goPackageName) +\n\t\t\"/\" + fileBaseName +\n\t\t\".pb.go\"\n\n\tgeneratedFile := plugin.NewGeneratedFile(generatedFilePath, goImportPath)\n\tprintGeneratedFileNamedHelperHeader(generatedFile, goPackageName, pluginName)\n\treturn generatedFile, nil\n}\n\nfunc (h *namedHelper) NewGlobalGeneratedFile(\n\tplugin *protogen.Plugin,\n\tpluginName string,\n) (*protogen.GeneratedFile, error) {\n\tgoImportPath, err := h.NewGlobalGoImportPath(pluginName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tgoPackageName := h.NewGoPackageName(\"\", pluginName)\n\tgeneratedFilePath := string(goPackageName) + \".pb.go\"\n\n\tgeneratedFile := plugin.NewGeneratedFile(generatedFilePath, goImportPath)\n\tprintGeneratedFileNamedHelperHeader(generatedFile, goPackageName, pluginName)\n\treturn generatedFile, nil\n}\n\nfunc (h *namedHelper) newGoImportPath(\n\tgeneratedDir string,\n\tbaseGoPackageName protogen.GoPackageName,\n\tpluginName string,\n) (protogen.GoImportPath, error) {\n\tgoPackage, ok := h.pluginNameToGoPackage[pluginName]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"no %s specified for plugin %s\", namedHelperGoPackageOptionKey, pluginName)\n\t}\n\treturn protogen.GoImportPath(goPackage +\n\t\t\"/\" + generatedDir +\n\t\t\"/\" + string(h.NewGoPackageName(baseGoPackageName, pluginName))), nil\n}\n\nfunc (h *namedHelper) handleOption(key string, value string) error {\n\tif key != namedHelperGoPackageOptionKey {\n\t\treturn nil\n\t}\n\tsplit := strings.Split(value, \"=\")\n\tif len(split) != 2 {\n\t\treturn fmt.Errorf(\"unknown value for %s: %s\", namedHelperGoPackageOptionKey, value)\n\t}\n\th.pluginNameToGoPackage[split[0]] = split[1]\n\treturn nil\n}\n\nfunc printGeneratedFileNamedHelperHeader(\n\tgeneratedFile *protogen.GeneratedFile,\n\tgoPackageName protogen.GoPackageName,\n\tpluginName string,\n) {\n\tgeneratedFile.P(\"// Code generated by protoc-gen-go-\", pluginName, \". DO NOT EDIT.\")\n\tgeneratedFile.P()\n\tgeneratedFile.P(\"package \", goPackageName)\n\tgeneratedFile.P()\n}\n"
  },
  {
    "path": "private/pkg/protogenutil/protogenutil.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protogenutil provides support for protoc plugin development with the\n// protoplugin and protogen packages.\npackage protogenutil\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"path\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/protoplugin\"\n\t\"google.golang.org/protobuf/compiler/protogen\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\n// NewHandler returns a new protoplugin.Handler for the protogen.Plugin function.\nfunc NewHandler(f func(*protogen.Plugin) error, options ...HandlerOption) protoplugin.Handler {\n\thandlerOptions := newHandlerOptions()\n\tfor _, option := range options {\n\t\toption(handlerOptions)\n\t}\n\treturn protoplugin.HandlerFunc(\n\t\tfunc(\n\t\t\tctx context.Context,\n\t\t\tpluginEnv protoplugin.PluginEnv,\n\t\t\tresponseWriter protoplugin.ResponseWriter,\n\t\t\trequest protoplugin.Request,\n\t\t) error {\n\t\t\tplugin, err := protogen.Options{\n\t\t\t\tParamFunc: handlerOptions.optionHandler,\n\t\t\t}.New(request.CodeGeneratorRequest())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := f(plugin); err != nil {\n\t\t\t\tplugin.Error(err)\n\t\t\t}\n\t\t\tresponse := plugin.Response()\n\t\t\tresponseWriter.AddCodeGeneratorResponseFiles(response.GetFile()...)\n\t\t\tresponseWriter.AddError(response.GetError())\n\t\t\tresponseWriter.SetFeatureProto3Optional()\n\t\t\treturn nil\n\t\t},\n\t)\n}\n\n// NewFileHandler returns a newHandler for the protogen file function.\n//\n// This will invoke f with every file marked for generation.\nfunc NewFileHandler(f func(*protogen.Plugin, []*protogen.File) error, options ...HandlerOption) protoplugin.Handler {\n\treturn NewHandler(\n\t\tfunc(plugin *protogen.Plugin) error {\n\t\t\tgenerateFiles := make([]*protogen.File, 0, len(plugin.Files))\n\t\t\tfor _, file := range plugin.Files {\n\t\t\t\tif file.Generate {\n\t\t\t\t\tgenerateFiles = append(generateFiles, file)\n\t\t\t\t}\n\t\t\t}\n\t\t\tsort.Slice(\n\t\t\t\tgenerateFiles,\n\t\t\t\tfunc(i int, j int) bool {\n\t\t\t\t\treturn generateFiles[i].Proto.GetName() < generateFiles[j].Proto.GetName()\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn f(plugin, generateFiles)\n\t\t},\n\t\toptions...,\n\t)\n}\n\n// NewPerFileHandler returns a newHandler for the protogen per-file function.\n//\n// This will invoke f for every file marked for generation.\nfunc NewPerFileHandler(f func(*protogen.Plugin, *protogen.File) error, options ...HandlerOption) protoplugin.Handler {\n\treturn NewFileHandler(\n\t\tfunc(plugin *protogen.Plugin, files []*protogen.File) error {\n\t\t\tfor _, file := range files {\n\t\t\t\tif err := f(plugin, file); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\toptions...,\n\t)\n}\n\n// NewGoPackageHandler returns a newHandler for the protogen package function.\n//\n// This validates that all files marked for generation that would be generated to\n// the same directory also have the same go package and go import path.\n//\n// This will invoke f with every file marked for generation.\nfunc NewGoPackageHandler(f func(*protogen.Plugin, []*GoPackageFileSet) error, options ...HandlerOption) protoplugin.Handler {\n\treturn NewHandler(\n\t\tfunc(plugin *protogen.Plugin) error {\n\t\t\tgeneratedDirToGoPackageFileSet := make(map[string]*GoPackageFileSet)\n\t\t\tfor _, file := range plugin.Files {\n\t\t\t\tif file.Generate {\n\t\t\t\t\tgeneratedDir := path.Dir(file.GeneratedFilenamePrefix)\n\t\t\t\t\tgoPackageFileSet, ok := generatedDirToGoPackageFileSet[generatedDir]\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\tgeneratedDirToGoPackageFileSet[generatedDir] = &GoPackageFileSet{\n\t\t\t\t\t\t\tGeneratedDir:  generatedDir,\n\t\t\t\t\t\t\tGoImportPath:  file.GoImportPath,\n\t\t\t\t\t\t\tGoPackageName: file.GoPackageName,\n\t\t\t\t\t\t\tProtoPackage:  file.Proto.GetPackage(),\n\t\t\t\t\t\t\tFiles:         []*protogen.File{file},\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif goPackageFileSet.GoImportPath != file.GoImportPath {\n\t\t\t\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\t\t\t\"mismatched go import paths for generated directory %q: %q %q\",\n\t\t\t\t\t\t\t\tgeneratedDir,\n\t\t\t\t\t\t\t\tstring(goPackageFileSet.GoImportPath),\n\t\t\t\t\t\t\t\tstring(file.GoImportPath),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif goPackageFileSet.GoPackageName != file.GoPackageName {\n\t\t\t\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\t\t\t\"mismatched go package names for generated directory %q: %q %q\",\n\t\t\t\t\t\t\t\tgeneratedDir,\n\t\t\t\t\t\t\t\tstring(goPackageFileSet.GoPackageName),\n\t\t\t\t\t\t\t\tstring(file.GoPackageName),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif goPackageFileSet.ProtoPackage != file.Proto.GetPackage() {\n\t\t\t\t\t\t\treturn fmt.Errorf(\n\t\t\t\t\t\t\t\t\"mismatched proto package names for generated directory %q: %q %q\",\n\t\t\t\t\t\t\t\tgeneratedDir,\n\t\t\t\t\t\t\t\tgoPackageFileSet.ProtoPackage,\n\t\t\t\t\t\t\t\tfile.Proto.GetPackage(),\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgoPackageFileSet.Files = append(goPackageFileSet.Files, file)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tgoPackageFileSets := make([]*GoPackageFileSet, 0, len(generatedDirToGoPackageFileSet))\n\t\t\tfor _, goPackageFileSet := range generatedDirToGoPackageFileSet {\n\t\t\t\tgoPackageFileSets = append(goPackageFileSets, goPackageFileSet)\n\t\t\t}\n\t\t\tsort.Slice(\n\t\t\t\tgoPackageFileSets,\n\t\t\t\tfunc(i int, j int) bool {\n\t\t\t\t\treturn goPackageFileSets[i].ProtoPackage < goPackageFileSets[j].ProtoPackage\n\t\t\t\t},\n\t\t\t)\n\t\t\treturn f(plugin, goPackageFileSets)\n\t\t},\n\t\toptions...,\n\t)\n}\n\n// NewPerGoPackageHandler returns a newHandler for the protogen per-package function.\n//\n// This validates that all files marked for generation that would be generated to\n// the same directory also have the same go package and go import path.\n//\n// This will invoke f for every file marked for generation.\nfunc NewPerGoPackageHandler(f func(*protogen.Plugin, *GoPackageFileSet) error, options ...HandlerOption) protoplugin.Handler {\n\treturn NewGoPackageHandler(\n\t\tfunc(plugin *protogen.Plugin, goPackageFileSets []*GoPackageFileSet) error {\n\t\t\tfor _, goPackageFileSet := range goPackageFileSets {\n\t\t\t\tif err := f(plugin, goPackageFileSet); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\toptions...,\n\t)\n}\n\n// HandlerOption is an option for a new Handler.\ntype HandlerOption func(*handlerOptions)\n\n// HandlerWithOptionHandler returns a new HandlerOption that sets the given param function.\n//\n// This parses options given on the command line.\nfunc HandlerWithOptionHandler(optionHandler func(string, string) error) HandlerOption {\n\treturn func(handlerOptions *handlerOptions) {\n\t\thandlerOptions.optionHandler = optionHandler\n\t}\n}\n\n// GoPackageFileSet are files within a single Go package.\ntype GoPackageFileSet struct {\n\t// The directory the golang/protobuf files would be generated to.\n\tGeneratedDir string\n\t// The Go import path the golang/protobuf files would be generated to.\n\tGoImportPath protogen.GoImportPath\n\t// The Go package name the golang/protobuf files would be generated to.\n\tGoPackageName protogen.GoPackageName\n\t// ProtoPackage is the proto package for all files.\n\tProtoPackage string\n\t// The files within this package that are marked for generate.\n\tFiles []*protogen.File\n}\n\n// Services returns all the services in this Go package sorted by Go name.\nfunc (g *GoPackageFileSet) Services() []*protogen.Service {\n\tvar services []*protogen.Service\n\tfor _, file := range g.Files {\n\t\tservices = append(services, file.Services...)\n\t}\n\tsort.Slice(\n\t\tservices,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn services[i].GoName < services[j].GoName\n\t\t},\n\t)\n\treturn services\n}\n\n// NamedHelper is a helper to deal with named golang plugins.\n//\n// Named plugins should be named in the form protoc-gen-go-foobar, where the plugin\n// name is considered to be \"foobar\". The plugin name must be lowercase.\ntype NamedHelper interface {\n\t// NewGoPackageName gets the helper GoPackageName for the pluginName.\n\tNewGoPackageName(\n\t\tbaseGoPackageName protogen.GoPackageName,\n\t\tpluginName string,\n\t) protogen.GoPackageName\n\t// NewGoImportPath gets the helper GoImportPath for the pluginName.\n\tNewGoImportPath(\n\t\tfile *protogen.File,\n\t\tpluginName string,\n\t) (protogen.GoImportPath, error)\n\t// NewPackageGoImportPath gets the helper GoImportPath for the pluginName.\n\tNewPackageGoImportPath(\n\t\tgoPackageFileSet *GoPackageFileSet,\n\t\tpluginName string,\n\t) (protogen.GoImportPath, error)\n\t// NewGlobalGoImportPath gets the helper GoImportPath for the pluginName.\n\tNewGlobalGoImportPath(\n\t\tpluginName string,\n\t) (protogen.GoImportPath, error)\n\t// NewGeneratedFile returns a new individual GeneratedFile for a named plugin.\n\t//\n\t// This should be used for named plugins that have a 1-1 mapping between Protobuf files\n\t// and generated files.\n\t//\n\t// This also prints the file header and package.\n\tNewGeneratedFile(\n\t\tplugin *protogen.Plugin,\n\t\tfile *protogen.File,\n\t\tpluginName string,\n\t) (*protogen.GeneratedFile, error)\n\t// NewPackageGeneratedFile returns a new individual GeneratedFile for a named plugin.\n\t//\n\t// This should be used for named plugins that have a 1-1 mapping between Protobuf files\n\t// and generated files. The generated file name will not overlap with the base name\n\t// of any .proto file in the package.\n\t//\n\t// This also prints the file header and package.\n\tNewPackageGeneratedFile(\n\t\tplugin *protogen.Plugin,\n\t\tgoPackageFileSet *GoPackageFileSet,\n\t\tpluginName string,\n\t) (*protogen.GeneratedFile, error)\n\t// NewGlobalGeneratedFile returns a new global GeneratedFile for a named plugin.\n\t//\n\t// This also prints the file header and package.\n\tNewGlobalGeneratedFile(\n\t\tplugin *protogen.Plugin,\n\t\tpluginName string,\n\t) (*protogen.GeneratedFile, error)\n}\n\n// NewNamedFileHandler returns a new file handler for a named plugin.\nfunc NewNamedFileHandler(f func(NamedHelper, *protogen.Plugin, []*protogen.File) error) protoplugin.Handler {\n\tnamedHelper := newNamedHelper()\n\treturn NewFileHandler(\n\t\tfunc(plugin *protogen.Plugin, files []*protogen.File) error {\n\t\t\treturn f(namedHelper, plugin, files)\n\t\t},\n\t\tHandlerWithOptionHandler(\n\t\t\tnamedHelper.handleOption,\n\t\t),\n\t)\n}\n\n// NewNamedPerFileHandler returns a new per-file handler for a named plugin.\nfunc NewNamedPerFileHandler(f func(NamedHelper, *protogen.Plugin, *protogen.File) error) protoplugin.Handler {\n\tnamedHelper := newNamedHelper()\n\treturn NewPerFileHandler(\n\t\tfunc(plugin *protogen.Plugin, file *protogen.File) error {\n\t\t\treturn f(namedHelper, plugin, file)\n\t\t},\n\t\tHandlerWithOptionHandler(\n\t\t\tnamedHelper.handleOption,\n\t\t),\n\t)\n}\n\n// NewNamedGoPackageHandler returns a new go package handler for a named plugin.\nfunc NewNamedGoPackageHandler(f func(NamedHelper, *protogen.Plugin, []*GoPackageFileSet) error) protoplugin.Handler {\n\tnamedHelper := newNamedHelper()\n\treturn NewGoPackageHandler(\n\t\tfunc(plugin *protogen.Plugin, goPackageFileSets []*GoPackageFileSet) error {\n\t\t\treturn f(namedHelper, plugin, goPackageFileSets)\n\t\t},\n\t\tHandlerWithOptionHandler(\n\t\t\tnamedHelper.handleOption,\n\t\t),\n\t)\n}\n\n// NewNamedPerGoPackageHandler returns a new per-go-package handler for a named plugin.\nfunc NewNamedPerGoPackageHandler(f func(NamedHelper, *protogen.Plugin, *GoPackageFileSet) error) protoplugin.Handler {\n\tnamedHelper := newNamedHelper()\n\treturn NewPerGoPackageHandler(\n\t\tfunc(plugin *protogen.Plugin, goPackageFileSet *GoPackageFileSet) error {\n\t\t\treturn f(namedHelper, plugin, goPackageFileSet)\n\t\t},\n\t\tHandlerWithOptionHandler(\n\t\t\tnamedHelper.handleOption,\n\t\t),\n\t)\n}\n\n// ValidateMethodUnary validates that the method is unary.\nfunc ValidateMethodUnary(method *protogen.Method) error {\n\tif method.Desc.IsStreamingClient() || method.Desc.IsStreamingServer() {\n\t\treturn fmt.Errorf(\"plugin does not allow streaming methods: %v\", method.GoName)\n\t}\n\treturn nil\n}\n\n// ValidateFieldNotOneof validates that the field is not a oneof.\nfunc ValidateFieldNotOneof(field *protogen.Field) error {\n\tif oneof := field.Oneof; oneof != nil && !oneof.Desc.IsSynthetic() {\n\t\treturn fmt.Errorf(\"plugin does not allow oneofs for request fields: %v\", field.GoName)\n\t}\n\treturn nil\n}\n\n// ValidateFieldNotMap validates that the field is not a map.\nfunc ValidateFieldNotMap(field *protogen.Field) error {\n\tif field.Desc.IsMap() {\n\t\treturn fmt.Errorf(\"plugin does not allow maps for request fields: %v\", field.GoName)\n\t}\n\treturn nil\n}\n\n// GetUnexportGoName returns a new unexported type for the go name.\n//\n// This makes the first character lowercase.\n// If the goName is empty, this returns empty.\nfunc GetUnexportGoName(goName string) string {\n\tif goName == \"\" {\n\t\treturn \"\"\n\t}\n\treturn strings.ToLower(goName[:1]) + goName[1:]\n}\n\n// GetRequestAndResponseParameterStrings gets the parameters for the given request and response fields.\nfunc GetRequestAndResponseParameterStrings(\n\tgeneratedFile *protogen.GeneratedFile,\n\trequestFields []*protogen.Field,\n\tresponseFields []*protogen.Field,\n) (requestParameterStrings []string, responseParameterStrings []string, _ error) {\n\trequestParameterStrings = make([]string, len(requestFields))\n\tresponseParameterStrings = make([]string, len(responseFields))\n\tfieldNames := make(map[string]struct{})\n\tfor i, field := range requestFields {\n\t\tif err := ValidateFieldNotOneof(field); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfieldGoType, err := GetFieldGoType(generatedFile, field)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfieldName := GetUnexportGoName(field.GoName)\n\t\tfieldNames[fieldName] = struct{}{}\n\t\trequestParameterStrings[i] = fieldName + ` ` + fieldGoType\n\t}\n\tfor i, field := range responseFields {\n\t\tif err := ValidateFieldNotOneof(field); err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfieldGoType, err := GetFieldGoType(generatedFile, field)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\tfieldName := GetUnexportGoName(field.GoName)\n\t\tfor {\n\t\t\tif _, ok := fieldNames[fieldName]; !ok {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tfieldName = fieldName + \"Response\"\n\t\t}\n\t\tfieldNames[fieldName] = struct{}{}\n\t\tresponseParameterStrings[i] = fieldName + ` ` + fieldGoType\n\t}\n\treturn requestParameterStrings, responseParameterStrings, nil\n}\n\n// GetParameterErrorReturnString gets the return string for an error for a method.\nfunc GetParameterErrorReturnString(\n\tgeneratedFile *protogen.GeneratedFile,\n\tfields []*protogen.Field,\n\terrorVarName string,\n) (string, error) {\n\tvarStrings := make([]string, len(fields)+1)\n\tfor i, field := range fields {\n\t\tif err := ValidateFieldNotOneof(field); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tfieldGoZeroValue, err := GetFieldGoZeroValue(generatedFile, field)\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tvarStrings[i] = fieldGoZeroValue\n\t}\n\tvarStrings[len(varStrings)-1] = errorVarName\n\treturn \"return \" + strings.Join(varStrings, \", \"), nil\n}\n\n// GetFieldGoType returns the Go type used for a field.\n//\n// Adapted from https://github.com/protocolbuffers/protobuf-go/blob/81d297c66c9b1e0606eee19a9ee718dcf149276d/cmd/protoc-gen-go/internal_gengo/main.go#L640\n// See https://github.com/protocolbuffers/protobuf-go/blob/81d297c66c9b1e0606eee19a9ee718dcf149276d/LICENSE for the license.\nfunc GetFieldGoType(\n\tgeneratedFile *protogen.GeneratedFile,\n\tfield *protogen.Field,\n) (string, error) {\n\tvar goType string\n\tpointer := field.Desc.HasPresence()\n\tswitch field.Desc.Kind() {\n\tcase protoreflect.BoolKind:\n\t\tgoType = \"bool\"\n\tcase protoreflect.EnumKind:\n\t\tgoType = generatedFile.QualifiedGoIdent(field.Enum.GoIdent)\n\tcase protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:\n\t\tgoType = \"int32\"\n\tcase protoreflect.Uint32Kind, protoreflect.Fixed32Kind:\n\t\tgoType = \"uint32\"\n\tcase protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:\n\t\tgoType = \"int64\"\n\tcase protoreflect.Uint64Kind, protoreflect.Fixed64Kind:\n\t\tgoType = \"uint64\"\n\tcase protoreflect.FloatKind:\n\t\tgoType = \"float32\"\n\tcase protoreflect.DoubleKind:\n\t\tgoType = \"float64\"\n\tcase protoreflect.StringKind:\n\t\tgoType = \"string\"\n\tcase protoreflect.BytesKind:\n\t\tgoType = \"[]byte\"\n\t\tpointer = false // rely on nullability of slices for presence\n\tcase protoreflect.MessageKind, protoreflect.GroupKind:\n\t\tgoType = \"*\" + generatedFile.QualifiedGoIdent(field.Message.GoIdent)\n\t\tpointer = false // pointer captured as part of the type\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown Kind: %T\", field.Desc.Kind())\n\t}\n\tswitch {\n\tcase field.Desc.IsList():\n\t\treturn \"[]\" + goType, nil\n\tcase field.Desc.IsMap():\n\t\tkeyType, err := GetFieldGoType(generatedFile, field.Message.Fields[0])\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tvalType, err := GetFieldGoType(generatedFile, field.Message.Fields[1])\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn fmt.Sprintf(\"map[%v]%v\", keyType, valType), nil\n\t}\n\tif pointer {\n\t\tgoType = \"*\" + goType\n\t}\n\treturn goType, nil\n}\n\n// GetFieldGoZeroValue returns the go zero value for a field.\nfunc GetFieldGoZeroValue(\n\tgeneratedFile *protogen.GeneratedFile,\n\tfield *protogen.Field,\n) (string, error) {\n\tif field.Desc.HasPresence() {\n\t\treturn \"nil\", nil\n\t}\n\tif field.Desc.IsList() {\n\t\treturn \"nil\", nil\n\t}\n\tif field.Desc.IsMap() {\n\t\treturn \"nil\", nil\n\t}\n\tswitch field.Desc.Kind() {\n\tcase protoreflect.BoolKind:\n\t\treturn \"false\", nil\n\tcase protoreflect.EnumKind:\n\t\treturn generatedFile.QualifiedGoIdent(field.Enum.GoIdent) + \"(0)\", nil\n\tcase protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind:\n\t\treturn \"0\", nil\n\tcase protoreflect.Uint32Kind, protoreflect.Fixed32Kind:\n\t\treturn \"0\", nil\n\tcase protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind:\n\t\treturn \"0\", nil\n\tcase protoreflect.Uint64Kind, protoreflect.Fixed64Kind:\n\t\treturn \"0\", nil\n\tcase protoreflect.FloatKind:\n\t\treturn \"0\", nil\n\tcase protoreflect.DoubleKind:\n\t\treturn \"0\", nil\n\tcase protoreflect.StringKind:\n\t\treturn `\"\"`, nil\n\tcase protoreflect.BytesKind:\n\t\treturn \"nil\", nil\n\tcase protoreflect.MessageKind, protoreflect.GroupKind:\n\t\treturn \"nil\", nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown Kind: %T\", field.Desc.Kind())\n\t}\n}\n\ntype handlerOptions struct {\n\toptionHandler func(string, string) error\n}\n\nfunc newHandlerOptions() *handlerOptions {\n\treturn &handlerOptions{}\n}\n"
  },
  {
    "path": "private/pkg/protogenutil/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protogenutil\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/protosourcepath/README.md",
    "content": "# `protosourcepath`\n\n`protosourcepath` is a simple package that takes a [Protobuf source path](source-path) and\nreturns a list of associated source paths. A [Protobuf source path](source-path) is a\n[`SourceCodeInfo.Location`](location) path, which is an array of integers of a variable length\nthat identifies a Protobuf definition. Each element of the source path represents a field\nnumber from a descriptor proto or an index, and they form a *path* from the [`FileDescriptorProto`](file-descriptor)\nto the definition itself. An index is needed for any `repeated` types on the descriptor proto,\nsuch as messages, enums, services, and extensions on [`FileDescriptorProto`](file-descriptor).\n\nFor example, let's say we have the following source path:\n\n```\n[4, 0, 2, 0, 1]\n```\n\nThis path represents `.message_type(0).field(0).name`, which is the name of field at index\n0 for the message at index 0. We can break down the source path by following the numbers,\nstarting from `FileDescriptorProto`:\n\n- `4` is the field number of [`message_type` on `FileDescriptorProto`](message-types), which\n  is a repeated field representing message declarations in the file. `0` is the index of the\n  message for this path.\n- `2` is the field number of [`field` on `DescriptorProto`](field), which is a repeated field\n  representing field declarations of a message. `0` is the index of the field for this path.\n- `1` is the field number of [`name` on `FieldDescriptorProto`](field-name), which is a field\n  representing the name of field declarations.\n\nAll source paths start from `FileDescriptorProto` and end at the Protobuf definition they\nare pointing to. More details on source paths can be found in [descriptor.proto](source-path).\n\nSource paths are useful because they can be used to retrieve the [`SourceCodeInfo`](source-code-info)\nof Protobuf definitions from their `FileDescriptorProto`'s. [`SourceCodeInfo`](source-code-info) provides\nlocation-based metadata of Protobuf definitions, including comments attached to the Protobuf\ndefinition, which we use to look for comment ignores for lint checks. And in the case of comment\nignores, a list of associated paths would allow us to check \"associated locations\" as potential\nsites for defining a comment ignore (e.g. for a lint rule that checks fields, we want users to\nbe able to define a comment ignore on a specific field, but also the message a field belongs\nto, since they could use that to ignore this rule for all fields for that message instead of\ndefining individual comment ignores for each field).\n\n## Associated paths\n\nAssociated paths are source paths that we consider \"associated\" with the given source path,\nwhich we define as parent paths or child paths.\n\n**Parent paths** are valid source paths to \"complete\" Protobuf declarations that are equal or \"closer\"\nto the `FileDescriptorProto` than the given source path. A \"complete\" Protobuf declaration starts\nfrom either the keyword (e.g. `message` or `enum`) or label/name (e.g. fields may or may not\nhave a label, and enum values would start at the name) and terminates at the opening brace\nor semicolon respectively. For example, the path we looked at earlier, `[4, 0, 2, 0, 1]`, one of\nthe parent paths would be `[4, 0, 2, 0]`, which is the complete field declaration of `message_type(0).field(0)`\n(which starts at the label of the field and terminates at the semicolon). Parent paths are\nalways \"complete\" Protobuf declarations. The following is a breakdown of what we consider as parent paths:\n\n- For each top-level declaration (e.g. messages, enums, services, extensions, options), we consider the\n  complete declaration as a parent path. This means that a given path can be one of its parent paths,\n  (e.g. if the given path is `[4, 0, 2, 0]`, then `[4, 0, 2, 0]` would be considered one of\n  the parent paths).\n- For each nested declaration (e.g. field; enum values; options; nested messages, enums, and\n  extensions), we consider the complete declaration of the Protobuf definition as a parent path,\n  and the paths of the complete declarations of all parent types as parent paths (e.g. if the\n  given path is `[4, 0, 3, 2]`, which is a path to the complete declaration of a nested message,\n  then the path itself, `[4, 0, 3, 2]` is considered a parent path and `[4, 0]`, the path of the complete\n  declaration of the parent message is considered a parent path).\n- For each specific attribute (e.g. name, label, field number, enum value number, etc.), we consider the complete\n  declaration of the Protobuf definition as a parent path (as illustrated in the initial example,\n  `[4, 0, 2, 0, 1]`, given the path to a field name, the complete declaration of the field\n  and the complete declaration of the message would be considered parent paths).\n\n**Child paths** are valid source paths that are *not* complete Protobuf declarations that are\nequal or \"closer\" to the `FileDescriptorProto` than the given source path. Going back to our\nexample path, `[4, 0, 2, 0, 1]`, a path to a field name, it would be considered its own child\npath, since it is not a complete Protobuf declaration, and other associated child paths would\ninclude the field number, label, type, and type name. In addition, the associated child paths\nof its parent type would also be considered associated child paths, in this case, the path\nto the message name.\n\nDetails examples for associated paths can be found through the tests.\n\n## API\n\nThere is a single function, `GetAssociatedSourcePaths`, that takes a `protoreflect.SourcePath`\nand returns a list of associated paths.\n\n```go\nfunc GetAssociatedSourcePaths(\n\tsourcePath protoreflect.SourcePath,\n) ([]protoreflect.SourcePath, error)\n```\n\nWe expect there always to be at least one associated path, the path itself.\n\n## Future\n\nWe are currently returning all associated source paths, but we have the option to exclude\nchild paths/Protobuf declarations that are not complete, since our use-case is primarily to\nget comments, which should only be attached to complete Protobuf declarations. However, it\nis currently inexpensive to check all associated source paths, so we have not exposed that\nfunctionality on the exported function.\n\n[location]: https://github.com/protocolbuffers/protobuf/blob/44e9777103aa864859c04159a7abc376c5a98210/src/google/protobuf/descriptor.proto#L1174\n[source-path]: https://github.com/protocolbuffers/protobuf/blob/44e9777103aa864859c04159a7abc376c5a98210/src/google/protobuf/descriptor.proto#L1175-L1197\n[file-descriptor]: https://github.com/protocolbuffers/protobuf/blob/44e9777103aa864859c04159a7abc376c5a98210/src/google/protobuf/descriptor.proto#L97\n[message-types]: https://github.com/protocolbuffers/protobuf/blob/44e9777103aa864859c04159a7abc376c5a98210/src/google/protobuf/descriptor.proto#L110\n[field]: https://github.com/protocolbuffers/protobuf/blob/44e9777103aa864859c04159a7abc376c5a98210/src/google/protobuf/descriptor.proto#L137\n[field-name]: https://github.com/protocolbuffers/protobuf/blob/44e9777103aa864859c04159a7abc376c5a98210/src/google/protobuf/descriptor.proto#L268\n[source-code-info]: https://github.com/protocolbuffers/protobuf/blob/44e9777103aa864859c04159a7abc376c5a98210/src/google/protobuf/descriptor.proto#L1129\n[dfa]: https://en.wikipedia.org/wiki/Deterministic_finite_automaton\n"
  },
  {
    "path": "private/pkg/protosourcepath/enum.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"slices\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tenumNameTypeTag          = int32(1)\n\tenumValuesTypeTag        = int32(2)\n\tenumOptionTypeTag        = int32(3)\n\tenumReservedRangeTypeTag = int32(4)\n\tenumReservedNameTypeTag  = int32(5)\n)\n\n// enums is the state when an element representing enums in the source path was parsed.\nfunc enums(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, enumNameTypeTag),\n\t\t)\n\t}\n\tif len(fullSourcePath) == index+1 {\n\t\t// This path does not extend beyond the enum declaration, return associated paths and\n\t\t// terminate here.\n\t\treturn nil, associatedPaths, nil\n\t}\n\treturn enum, associatedPaths, nil\n}\n\n// enum is the state when an element representing a specific child path of an enum was parsed.\nfunc enum(token int32, fullSourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tswitch token {\n\tcase enumNameTypeTag:\n\t\t// The enum name has already been added, can terminate here immediately.\n\t\treturn nil, nil, nil\n\tcase enumValuesTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for enum values are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have enum value declaration without index\")\n\t\t}\n\t\treturn enumValues, nil, nil\n\tcase enumOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\tcase enumReservedRangeTypeTag:\n\t\t// For reserved ranges, we add the full path and then return the reserved ranges state to\n\t\t// validate the path.\n\t\treturn reservedRanges, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\tcase enumReservedNameTypeTag:\n\t\t// For reserved names, we add the full path and then return the reserved names state to\n\t\t// validate the path.\n\t\treturn reservedNames, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid enum path\")\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/enumvalue.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"slices\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tenumValueNameTypeTag   = int32(1)\n\tenumValueNumberTypeTag = int32(2)\n\tenumValueOptionTypeTag = int32(3)\n)\n\nvar (\n\tterminalEnumValueTokens = []int32{\n\t\tenumValueNameTypeTag,\n\t\tenumValueNumberTypeTag,\n\t}\n)\n\n// enumValues is the state when an element representing enum values in the source path was\n// parsed.\nfunc enumValues(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, enumValueNameTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, enumValueNumberTypeTag),\n\t\t)\n\t}\n\tif len(fullSourcePath) == index+1 {\n\t\t// This does not extend beyond the enum value declaration, return associated paths and\n\t\t// terminate here.\n\t\treturn nil, associatedPaths, nil\n\t}\n\treturn enumValue, associatedPaths, nil\n}\n\n// enumValue is the state when an element representing a specific child path of an enum was\n// parsed.\nfunc enumValue(token int32, sourcePath protoreflect.SourcePath, i int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tif slices.Contains(terminalEnumValueTokens, token) {\n\t\t// Encountered a terminal enum value path, terminate here.\n\t\treturn nil, nil, nil\n\t}\n\tswitch token {\n\tcase enumValueOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(sourcePath)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(sourcePath, \"invalid enum value path\")\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/field.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"slices\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tfieldNameTypeTag         = int32(1)\n\tfieldNumberTypeTag       = int32(3)\n\tfieldLabelTypeTag        = int32(4)\n\tfieldTypeTypeTag         = int32(5)\n\tfieldTypeNameTypeTag     = int32(6)\n\tfieldOptionTypeTag       = int32(8)\n\textensionExtendeeTypeTag = int32(2)\n\tfieldDefaultValueTypeTag = int32(7)\n)\n\nvar (\n\tterminalFieldTokens = []int32{\n\t\tfieldNameTypeTag,\n\t\tfieldNumberTypeTag,\n\t\tfieldLabelTypeTag,\n\t\tfieldTypeTypeTag,\n\t\tfieldTypeNameTypeTag,\n\t\textensionExtendeeTypeTag,\n\t}\n)\n\n// fields is the state when an element representing fields in the source path was parsed.\nfunc fields(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, fieldNameTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, fieldNumberTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, fieldLabelTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, fieldTypeTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, fieldTypeNameTypeTag),\n\t\t)\n\t}\n\tif len(fullSourcePath) == index+1 {\n\t\t// This does not extend beyond the field declaration, return the associated paths and\n\t\t// terminate here.\n\t\treturn nil, associatedPaths, nil\n\t}\n\treturn field, associatedPaths, nil\n}\n\n// field is the state when an element representing a specific child path of a field was parsed.\nfunc field(token int32, fullSourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tif slices.Contains(terminalFieldTokens, token) {\n\t\t// Encountered a terminal field token, can terminate here immediately.\n\t\treturn nil, nil, nil\n\t}\n\tswitch token {\n\tcase fieldOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\tcase fieldDefaultValueTypeTag:\n\t\t// Default value is a terminal path, but was not already added to our associated paths,\n\t\t// since default values are specific to proto2. Add the path and terminate.\n\t\treturn nil, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid field path\")\n}\n\n// extensions is the state when an element representing extensions in the source path was parsed.\nfunc extensions(\n\ttoken int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\t// Extensions share the same descriptor proto definition as fields, so we can parse them\n\t// using the same states.\n\tfield, associatedPaths, err := fields(token, fullSourcePath, index, excludeChildAssociatedPaths)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, extensionExtendeeTypeTag),\n\t\t)\n\t}\n\treturn field, associatedPaths, nil\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/message.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"slices\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tmessageNameTypeTag                 = int32(1)\n\tmessageFieldsTypeTag               = int32(2)\n\tnestedMessagesTypeTag              = int32(3)\n\tnestedEnumsTypeTag                 = int32(4)\n\tmessageOneOfsTypeTag               = int32(8)\n\tmessageOneOfNameTypeTag            = int32(1)\n\tmessageOneOfOptionTypeTag          = int32(2)\n\tmessageOptionTypeTag               = int32(7)\n\tmessageExtensionsTypeTag           = int32(6)\n\tmessageExtensionRangeTypeTag       = int32(5)\n\tmessageExtensionRangeStartTypeTag  = int32(1)\n\tmessageExtensionRangeEndTypeTag    = int32(2)\n\tmessageExtensionRangeOptionTypeTag = int32(3)\n\tmessageReservedRangeTypeTag        = int32(9)\n\tmessageReservedNameTypeTag         = int32(10)\n)\n\nvar (\n\tterminalOneOfTokens = []int32{\n\t\tmessageOneOfNameTypeTag,\n\t}\n\tterminalExtensionRangeTokens = []int32{\n\t\tmessageExtensionRangeStartTypeTag,\n\t\tmessageExtensionRangeEndTypeTag,\n\t}\n)\n\n// messages is the state when an element representing messages in the source path was parsed.\nfunc messages(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, messageNameTypeTag),\n\t\t)\n\t}\n\tif len(fullSourcePath) == index+1 {\n\t\t// This does not extend beyond the message declaration, return associated paths and\n\t\t// terminate here.\n\t\treturn nil, associatedPaths, nil\n\t}\n\treturn message, associatedPaths, nil\n}\n\n// message is the state when an element representing a specific child path of a message was parsed.\nfunc message(token int32, fullSourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tswitch token {\n\tcase messageNameTypeTag:\n\t\t// The path for message name has already been added, can terminate here immediately.\n\t\treturn nil, nil, nil\n\tcase messageFieldsTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for fields are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have field declaration without index\")\n\t\t}\n\t\treturn fields, nil, nil\n\tcase messageOneOfsTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for oneofs are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have oneof declaration without index\")\n\t\t}\n\t\treturn oneOfs, nil, nil\n\tcase nestedMessagesTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for nested messages are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have a nested message declaration without index\")\n\t\t}\n\t\treturn messages, nil, nil\n\tcase nestedEnumsTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for nested enums are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have a nested enum declaration without index\")\n\t\t}\n\t\treturn enums, nil, nil\n\tcase messageOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\tcase messageExtensionRangeTypeTag:\n\t\t// For extension ranges, we add the full path and then return the extension ranges state\n\t\t// to validate the path.\n\t\treturn extensionRanges, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\tcase messageExtensionsTypeTag:\n\t\t// For extensions, we add the full path and then return the extensions state to\n\t\t// validate the path.\n\t\treturn extensions, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\tcase messageReservedRangeTypeTag:\n\t\t// For reserved ranges, we add the full path and then return the reserved ranges state\n\t\t// to validate the path.\n\t\treturn reservedRanges, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\tcase messageReservedNameTypeTag:\n\t\t// For reserved names, we add the full path and then return the reserved names state to\n\t\t// validate the path.\n\t\treturn reservedNames, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid message path\")\n}\n\n// oneOfs is the state when an element representing oneofs in the source path was parsed.\nfunc oneOfs(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, messageOneOfNameTypeTag),\n\t\t)\n\t}\n\treturn oneOf, associatedPaths, nil\n}\n\n// oneOf is the state when an element representing a specific child path of a oneof was parsed.\nfunc oneOf(token int32, fullSourcePath protoreflect.SourcePath, _ int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tif slices.Contains(terminalOneOfTokens, token) {\n\t\t// Encountered a terminal one of token, can terminate here immediately.\n\t\treturn nil, nil, nil\n\t}\n\tswitch token {\n\tcase messageOneOfOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid one of path\")\n}\n\n// extensionRanges is the state when an element representing extension ranges in the source path was parsed.\nfunc extensionRanges(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, messageExtensionRangeStartTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, messageExtensionRangeEndTypeTag),\n\t\t)\n\t}\n\tif len(fullSourcePath) == index+1 {\n\t\t// This does not extend beyond the declaration, return associated paths and terminate here.\n\t\treturn nil, associatedPaths, nil\n\t}\n\treturn extensionRange, associatedPaths, nil\n}\n\n// extensionRange is the state when an element representing a specific child path of an\n// extension range was parsed.\nfunc extensionRange(token int32, fullSourcePath protoreflect.SourcePath, _ int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tif slices.Contains(terminalExtensionRangeTokens, token) {\n\t\t// Encountered a terminal extension range token, can terminate here immediately.\n\t\treturn nil, nil, nil\n\t}\n\tswitch token {\n\tcase messageExtensionRangeOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid extension range path\")\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/method.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"slices\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tmethodNameTypeTag            = int32(1)\n\tmethodInputTypeTypeTag       = int32(2)\n\tmethodOutputTypeTypeTag      = int32(3)\n\tmethodClientStreamingTypeTag = int32(5)\n\tmethodServerStreamingTypeTag = int32(6)\n\tmethodOptionTypeTag          = int32(4)\n)\n\nvar (\n\tterminalMethodTokens = []int32{\n\t\tmethodNameTypeTag,\n\t\tmethodInputTypeTypeTag,\n\t\tmethodOutputTypeTypeTag,\n\t\tmethodClientStreamingTypeTag,\n\t\tmethodServerStreamingTypeTag,\n\t}\n)\n\n// methods is the state when an element representing methods in the source path was parsed.\nfunc methods(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, methodNameTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, methodInputTypeTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, methodOutputTypeTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, methodClientStreamingTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, methodServerStreamingTypeTag),\n\t\t)\n\t}\n\tif len(fullSourcePath) == index+1 {\n\t\t// This does not extend beyond the method declaration, return associated paths and\n\t\t// terminate here.\n\t\treturn nil, associatedPaths, nil\n\t}\n\treturn method, associatedPaths, nil\n}\n\n// method is the state when an element representing a specific child path of a method was parsed.\nfunc method(token int32, fullSourcePath protoreflect.SourcePath, _ int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tif slices.Contains(terminalMethodTokens, token) {\n\t\t// Encountered a terminal method token, can terminate here immediately.\n\t\treturn nil, nil, nil\n\t}\n\tswitch token {\n\tcase methodOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid method path\")\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/protosourcepath.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"fmt\"\n\t\"slices\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tpackageTypeTag             = int32(2)\n\tdependenciesTypeTag        = int32(3)\n\tsyntaxTypeTag              = int32(12)\n\teditionTypeTag             = int32(14)\n\tmessagesTypeTag            = int32(4)\n\tenumsTypeTag               = int32(5)\n\tservicesTypeTag            = int32(6)\n\tfileOptionsTypeTag         = int32(8)\n\textensionsTypeTag          = int32(7)\n\treservedRangeStartTypeTag  = int32(1)\n\treservedRangeEndTypeTag    = int32(2)\n\tuninterpretedOptionTypeTag = int32(999)\n)\n\nvar (\n\tterminalReservedRangeTokens = []int32{\n\t\treservedRangeStartTypeTag,\n\t\treservedRangeEndTypeTag,\n\t}\n)\n\n// GetAssociatedSourcePaths takes a protoreflect.SourcePath and returns a list of associated\n// paths, []protoreflect.SourcePath.\n//\n// We should expect at least one associated path for a valid path input.\n//\n// More details on associated paths are available in the README.md.\nfunc GetAssociatedSourcePaths(sourcePath protoreflect.SourcePath) ([]protoreflect.SourcePath, error) {\n\treturn getAssociatedSourcePaths(sourcePath, true)\n}\n\nfunc getAssociatedSourcePaths(\n\tsourcePath protoreflect.SourcePath,\n\texcludeChildAssociatedPaths bool,\n) ([]protoreflect.SourcePath, error) {\n\tvar result []protoreflect.SourcePath\n\tcurrentState := start\n\tvar associatedSourcePaths []protoreflect.SourcePath\n\tvar err error\n\tfor i, token := range sourcePath {\n\t\tif currentState == nil {\n\t\t\t// We have not parsed the entire source path, but received a terminal state, this is\n\t\t\t// considered an invalid source path, return an error.\n\t\t\treturn nil, newInvalidSourcePathError(sourcePath, \"unexpected termination, invalid source path\")\n\t\t}\n\t\t// Check the currentState and then set the next state.\n\t\tcurrentState, associatedSourcePaths, err = currentState(token, sourcePath, i, excludeChildAssociatedPaths)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Add all associated paths found to the result.\n\t\tif associatedSourcePaths != nil {\n\t\t\tresult = append(result, associatedSourcePaths...)\n\t\t}\n\t}\n\n\treturn result, nil\n}\n\n// *** PRIVATE ***\n\n// state represents a single state in a deterministic finite automaton (DFA). A DFA is used\n// to parse the given source path. Each element of the source path (token) is checked with a\n// state, and each state either returns the state to check the next element or it terminates\n// the DFA. When the DFA is terminated, we do not expect to have additional elements that need\n// to be parsed and all associated paths found are turned.\ntype state func(\n\t// token is the element of the source path that is currently being checked.\n\ttoken int32,\n\t// fullSourcePath is the full source path being parsed. This is needed to construct associated\n\t// source paths based on the token being checked.\n\tfullSourcePath protoreflect.SourcePath,\n\t// index is the index of the token that we are currently checking on the source path.\n\tindex int,\n\t// excludeChildAssociatedPaths, when set to true, will exclude child paths, which are not\n\t// complete Protobuf declarations, from the associated source paths returned.\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error)\n\n// start is the starting state and is used to parse the first element of the source path.\n// It returns the subsequent state based on the token that was parsed.\nfunc start(token int32, fullSourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tswitch token {\n\tcase packageTypeTag, syntaxTypeTag, editionTypeTag:\n\t\t// package, syntax, and edition are terminal paths, return the path and terminate here.\n\t\treturn nil, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\tcase dependenciesTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for dependencies are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have dependency declaration without index\")\n\t\t}\n\t\treturn dependencies, nil, nil\n\tcase messagesTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for messages are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have message declaration without index\")\n\t\t}\n\t\treturn messages, nil, nil\n\tcase enumsTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for enums are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have enum declaration without index\")\n\t\t}\n\t\treturn enums, nil, nil\n\tcase servicesTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for services are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have service declaration without index\")\n\t\t}\n\t\treturn services, nil, nil\n\tcase fileOptionsTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\tcase extensionsTypeTag:\n\t\t// For extensions, we add the full path and then return the extensions state to validate\n\t\t// the path.\n\t\treturn extensions, []protoreflect.SourcePath{currentPath(fullSourcePath, index)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid source path\")\n}\n\n// dependencies is the state when an element representing dependencies in the source path\n// was parsed.\nfunc dependencies(token int32, sourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\t// Dependencies are considered a terminal path, we add the current path and then return.\n\treturn nil, []protoreflect.SourcePath{currentPath(sourcePath, index)}, nil\n}\n\n// options is the state when an element representing options in the source path was parsed.\nfunc options(token int32, fullSourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\t// We already added the full options path, this is considered a terminal state without\n\t// additional information on the option for the source path.\n\tif len(fullSourcePath) == index+1 {\n\t\treturn nil, nil, nil\n\t}\n\t// If there are additional path elements, we loop through them here.\n\treturn options, nil, nil\n}\n\n// reservedRanges is the state when an element representing reserved ranges in the source\n// path was parsed.\nfunc reservedRanges(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, reservedRangeStartTypeTag),\n\t\t\tchildAssociatedPath(fullSourcePath, index, reservedRangeEndTypeTag),\n\t\t)\n\t}\n\treturn reservedRange, associatedPaths, nil\n}\n\n// reservedRange is the state when an element representing a specific child path of a reserved\n// range was parsed.\nfunc reservedRange(token int32, fullSourcePath protoreflect.SourcePath, _ int, _ bool) (state, []protoreflect.SourcePath, error) {\n\t// Reserved ranges are considered a terminal path, we validate the token to ensure that it\n\t// is an expected element and return here.\n\tif !slices.Contains(terminalReservedRangeTokens, token) {\n\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid reserved range path\")\n\t}\n\treturn nil, nil, nil\n}\n\n// reservedNames is the state when an element representing reserved names in the source\n// path was parsed.\nfunc reservedNames(_ int32, fullSourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\t// Reserved names are considered a terminal path, we can terminal immediately.\n\treturn nil, associatedPaths, nil\n}\n\nfunc newInvalidSourcePathError(sourcePath protoreflect.SourcePath, s string) error {\n\treturn fmt.Errorf(\"%s: %v\", s, sourcePath)\n}\n\n// childAssociatedPath makes a copy of the source path at the given index (inclusive)\n// and appends a child path tag.\n// This is a helper function, the caller is expected to manage providing an index within range.\nfunc childAssociatedPath(sourcePath protoreflect.SourcePath, i int, tag int32) protoreflect.SourcePath {\n\treturn append(slices.Clone(sourcePath)[:i+1], tag)\n}\n\n// currentPath makes a copy of the source path at the given index (inclusive).\n// This is a helper function, the caller is expected to manage providing an index within range.\nfunc currentPath(sourcePath protoreflect.SourcePath, i int) protoreflect.SourcePath {\n\treturn slices.Clone(sourcePath)[:i+1]\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/protosourcepath_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bufbuild/protocompile\"\n\t\"github.com/stretchr/testify/require\"\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nfunc TestGetAssociatedSourcePathsProto2(t *testing.T) {\n\tt.Parallel()\n\ttestGetAssociatedSourcePaths(\n\t\tt,\n\t\t\"testdata/proto2/test.proto\",\n\t\tmap[string][]protoreflect.SourcePath{\n\t\t\t\".syntax\":                                                                             {[]int32{12}},\n\t\t\t\".package\":                                                                            {[]int32{2}},\n\t\t\t\".dependency[0]\":                                                                      {[]int32{3, 0}},\n\t\t\t\".service[0]\":                                                                         {[]int32{6, 0}},\n\t\t\t\".service[0].name\":                                                                    {[]int32{6, 0}},\n\t\t\t\".service[0].method[0]\":                                                               {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[0].name\":                                                          {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[0].input_type\":                                                    {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[0].output_type\":                                                   {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[1]\":                                                               {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].name\":                                                          {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].client_streaming\":                                              {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].input_type\":                                                    {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].server_streaming\":                                              {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].output_type\":                                                   {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".message_type[0]\":                                                                    {[]int32{4, 0}},\n\t\t\t\".message_type[0].name\":                                                               {[]int32{4, 0}},\n\t\t\t\".message_type[0].field[0]\":                                                           {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[0].field[0].label\":                                                     {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[0].field[0].type\":                                                      {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[0].field[0].name\":                                                      {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[0].field[0].number\":                                                    {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[1]\":                                                                    {[]int32{4, 1}},\n\t\t\t\".message_type[1].name\":                                                               {[]int32{4, 1}},\n\t\t\t\".message_type[1].nested_type[0]\":                                                     {[]int32{4, 1}, []int32{4, 1, 3, 0}},\n\t\t\t\".message_type[1].nested_type[0].name\":                                                {[]int32{4, 1}, []int32{4, 1, 3, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0]\":                                            {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].label\":                                      {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].type\":                                       {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].name\":                                       {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].number\":                                     {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[1]\":                                            {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[1].label\":                                      {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[1].type_name\":                                  {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[1].name\":                                       {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[1].number\":                                     {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].extension_range\":                                     {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0]\":                                  {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].start\":                            {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].end\":                              {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options\":                          {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.verification\":             {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 3}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0]\":           {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].number\":    {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 1}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].full_name\": {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 2}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].repeated\":  {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].type\":      {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 3}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1]\":           {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1].number\":    {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1, 1}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1].full_name\": {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1, 2}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1].type\":      {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1, 3}},\n\t\t\t\".message_type[1].field[0]\":                                                           {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].label\":                                                     {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].type_name\":                                                 {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].name\":                                                      {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].number\":                                                    {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[2]\":                                                                    {[]int32{4, 2}},\n\t\t\t\".message_type[2].name\":                                                               {[]int32{4, 2}},\n\t\t\t\".message_type[2].field[0]\":                                                           {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[2].field[0].type_name\":                                                 {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[2].field[0].name\":                                                      {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[2].field[0].number\":                                                    {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[3]\":                                                                    {[]int32{4, 3}},\n\t\t\t\".message_type[3].name\":                                                               {[]int32{4, 3}},\n\t\t\t\".message_type[3].field[0]\":                                                           {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].label\":                                                     {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].type\":                                                      {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].name\":                                                      {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].number\":                                                    {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].reserved_name\":                                                      {[]int32{4, 3}, []int32{4, 3, 10}},\n\t\t\t\".message_type[3].reserved_name[0]\":                                                   {[]int32{4, 3}, []int32{4, 3, 10}, []int32{4, 3, 10, 0}},\n\t\t\t\".message_type[3].reserved_name[1]\":                                                   {[]int32{4, 3}, []int32{4, 3, 10}, []int32{4, 3, 10, 1}},\n\t\t\t\".message_type[4]\":                                                                    {[]int32{4, 4}},\n\t\t\t\".message_type[4].name\":                                                               {[]int32{4, 4}},\n\t\t\t\".message_type[4].extension\":                                                          {[]int32{4, 4}, []int32{4, 4, 6}},\n\t\t\t\".message_type[4].extension[0]\":                                                       {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}},\n\t\t\t\".message_type[4].extension[0].extendee\":                                              {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}},\n\t\t\t\".message_type[4].extension[0].label\":                                                 {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}},\n\t\t\t\".message_type[4].extension[0].type\":                                                  {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}},\n\t\t\t\".message_type[4].extension[0].name\":                                                  {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}},\n\t\t\t\".message_type[4].extension[0].number\":                                                {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}},\n\t\t\t\".message_type[4].extension[1]\":                                                       {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}},\n\t\t\t\".message_type[4].extension[1].extendee\":                                              {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}},\n\t\t\t\".message_type[4].extension[1].label\":                                                 {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}},\n\t\t\t\".message_type[4].extension[1].type\":                                                  {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}},\n\t\t\t\".message_type[4].extension[1].name\":                                                  {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}},\n\t\t\t\".message_type[4].extension[1].number\":                                                {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}},\n\t\t\t\".message_type[4].extension[1].options\":                                               {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 8}},\n\t\t\t\".message_type[4].extension[1].default_value\":                                         {[]int32{4, 4}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 7}},\n\t\t},\n\t\ttrue,\n\t)\n\ttestGetAssociatedSourcePaths(\n\t\tt,\n\t\t\"testdata/proto2/test.proto\",\n\t\tmap[string][]protoreflect.SourcePath{\n\t\t\t\".syntax\":                                                                             {[]int32{12}},\n\t\t\t\".package\":                                                                            {[]int32{2}},\n\t\t\t\".dependency[0]\":                                                                      {[]int32{3, 0}},\n\t\t\t\".service[0]\":                                                                         {[]int32{6, 0}, []int32{6, 0, 1}},\n\t\t\t\".service[0].name\":                                                                    {[]int32{6, 0}, []int32{6, 0, 1}},\n\t\t\t\".service[0].method[0]\":                                                               {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[0].name\":                                                          {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[0].input_type\":                                                    {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[0].output_type\":                                                   {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[1]\":                                                               {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].name\":                                                          {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].client_streaming\":                                              {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].input_type\":                                                    {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].server_streaming\":                                              {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].output_type\":                                                   {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".message_type[0]\":                                                                    {[]int32{4, 0}, []int32{4, 0, 1}},\n\t\t\t\".message_type[0].name\":                                                               {[]int32{4, 0}, []int32{4, 0, 1}},\n\t\t\t\".message_type[0].field[0]\":                                                           {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[0].field[0].label\":                                                     {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[0].field[0].type\":                                                      {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[0].field[0].name\":                                                      {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[0].field[0].number\":                                                    {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[1]\":                                                                    {[]int32{4, 1}, []int32{4, 1, 1}},\n\t\t\t\".message_type[1].name\":                                                               {[]int32{4, 1}, []int32{4, 1, 1}},\n\t\t\t\".message_type[1].nested_type[0]\":                                                     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}},\n\t\t\t\".message_type[1].nested_type[0].name\":                                                {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[0]\":                                            {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].label\":                                      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].type\":                                       {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].name\":                                       {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].number\":                                     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1]\":                                            {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1].label\":                                      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1].type_name\":                                  {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1].name\":                                       {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1].number\":                                     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].extension_range\":                                     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0]\":                                  {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].start\":                            {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].end\":                              {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options\":                          {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.verification\":             {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 3}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0]\":           {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].number\":    {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 1}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].full_name\": {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 2}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].repeated\":  {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[0].type\":      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 0, 3}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1]\":           {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1].number\":    {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1, 1}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1].full_name\": {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1, 2}},\n\t\t\t\".message_type[1].nested_type[0].extension_range[0].options.declaration[1].type\":      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 5}, []int32{4, 1, 3, 0, 5, 0}, []int32{4, 1, 3, 0, 5, 0, 1}, []int32{4, 1, 3, 0, 5, 0, 2}, []int32{4, 1, 3, 0, 5, 0, 3, 2, 1, 3}},\n\t\t\t\".message_type[1].field[0]\":                                                           {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].label\":                                                     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].type_name\":                                                 {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].name\":                                                      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].number\":                                                    {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[2]\":                                                                    {[]int32{4, 2}, []int32{4, 2, 1}},\n\t\t\t\".message_type[2].name\":                                                               {[]int32{4, 2}, []int32{4, 2, 1}},\n\t\t\t\".message_type[2].field[0]\":                                                           {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[2].field[0].type_name\":                                                 {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[2].field[0].name\":                                                      {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[2].field[0].number\":                                                    {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[3]\":                                                                    {[]int32{4, 3}, []int32{4, 3, 1}},\n\t\t\t\".message_type[3].name\":                                                               {[]int32{4, 3}, []int32{4, 3, 1}},\n\t\t\t\".message_type[3].field[0]\":                                                           {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].label\":                                                     {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].type\":                                                      {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].name\":                                                      {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].number\":                                                    {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].reserved_name\":                                                      {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 10}},\n\t\t\t\".message_type[3].reserved_name[0]\":                                                   {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 10}, []int32{4, 3, 10, 0}},\n\t\t\t\".message_type[3].reserved_name[1]\":                                                   {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 10}, []int32{4, 3, 10, 1}},\n\t\t\t\".message_type[4]\":                                                                    {[]int32{4, 4}, []int32{4, 4, 1}},\n\t\t\t\".message_type[4].name\":                                                               {[]int32{4, 4}, []int32{4, 4, 1}},\n\t\t\t\".message_type[4].extension\":                                                          {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}},\n\t\t\t\".message_type[4].extension[0]\":                                                       {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}, []int32{4, 4, 6, 0, 1}, []int32{4, 4, 6, 0, 3}, []int32{4, 4, 6, 0, 4}, []int32{4, 4, 6, 0, 5}, []int32{4, 4, 6, 0, 6}, []int32{4, 4, 6, 0, 2}},\n\t\t\t\".message_type[4].extension[0].extendee\":                                              {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}, []int32{4, 4, 6, 0, 1}, []int32{4, 4, 6, 0, 3}, []int32{4, 4, 6, 0, 4}, []int32{4, 4, 6, 0, 5}, []int32{4, 4, 6, 0, 6}, []int32{4, 4, 6, 0, 2}},\n\t\t\t\".message_type[4].extension[0].label\":                                                 {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}, []int32{4, 4, 6, 0, 1}, []int32{4, 4, 6, 0, 3}, []int32{4, 4, 6, 0, 4}, []int32{4, 4, 6, 0, 5}, []int32{4, 4, 6, 0, 6}, []int32{4, 4, 6, 0, 2}},\n\t\t\t\".message_type[4].extension[0].type\":                                                  {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}, []int32{4, 4, 6, 0, 1}, []int32{4, 4, 6, 0, 3}, []int32{4, 4, 6, 0, 4}, []int32{4, 4, 6, 0, 5}, []int32{4, 4, 6, 0, 6}, []int32{4, 4, 6, 0, 2}},\n\t\t\t\".message_type[4].extension[0].name\":                                                  {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}, []int32{4, 4, 6, 0, 1}, []int32{4, 4, 6, 0, 3}, []int32{4, 4, 6, 0, 4}, []int32{4, 4, 6, 0, 5}, []int32{4, 4, 6, 0, 6}, []int32{4, 4, 6, 0, 2}},\n\t\t\t\".message_type[4].extension[0].number\":                                                {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 0}, []int32{4, 4, 6, 0, 1}, []int32{4, 4, 6, 0, 3}, []int32{4, 4, 6, 0, 4}, []int32{4, 4, 6, 0, 5}, []int32{4, 4, 6, 0, 6}, []int32{4, 4, 6, 0, 2}},\n\t\t\t\".message_type[4].extension[1]\":                                                       {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}},\n\t\t\t\".message_type[4].extension[1].extendee\":                                              {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}},\n\t\t\t\".message_type[4].extension[1].label\":                                                 {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}},\n\t\t\t\".message_type[4].extension[1].type\":                                                  {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}},\n\t\t\t\".message_type[4].extension[1].name\":                                                  {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}},\n\t\t\t\".message_type[4].extension[1].number\":                                                {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}},\n\t\t\t\".message_type[4].extension[1].options\":                                               {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}, []int32{4, 4, 6, 1, 8}},\n\t\t\t\".message_type[4].extension[1].default_value\":                                         {[]int32{4, 4}, []int32{4, 4, 1}, []int32{4, 4, 6}, []int32{4, 4, 6, 1}, []int32{4, 4, 6, 1, 1}, []int32{4, 4, 6, 1, 3}, []int32{4, 4, 6, 1, 4}, []int32{4, 4, 6, 1, 5}, []int32{4, 4, 6, 1, 6}, []int32{4, 4, 6, 1, 2}, []int32{4, 4, 6, 1, 7}},\n\t\t},\n\t\tfalse,\n\t)\n}\n\nfunc TestGetAssociatedSourcePathsProto3(t *testing.T) {\n\tt.Parallel()\n\ttestGetAssociatedSourcePaths(\n\t\tt,\n\t\t\"testdata/proto3/test.proto\",\n\t\tmap[string][]protoreflect.SourcePath{\n\t\t\t\".syntax\":                                            {[]int32{12}},\n\t\t\t\".package\":                                           {[]int32{2}},\n\t\t\t\".dependency[0]\":                                     {[]int32{3, 0}},\n\t\t\t\".service[0]\":                                        {[]int32{6, 0}},\n\t\t\t\".service[0].name\":                                   {[]int32{6, 0}},\n\t\t\t\".service[0].method[0]\":                              {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[0].name\":                         {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[0].input_type\":                   {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[0].output_type\":                  {[]int32{6, 0}, []int32{6, 0, 2, 0}},\n\t\t\t\".service[0].method[1]\":                              {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].name\":                         {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].client_streaming\":             {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].input_type\":                   {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].server_streaming\":             {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".service[0].method[1].output_type\":                  {[]int32{6, 0}, []int32{6, 0, 2, 1}},\n\t\t\t\".message_type[0]\":                                   {[]int32{4, 0}},\n\t\t\t\".message_type[0].name\":                              {[]int32{4, 0}},\n\t\t\t\".message_type[0].field[0]\":                          {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[0].field[0].type\":                     {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[0].field[0].name\":                     {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[0].field[0].number\":                   {[]int32{4, 0}, []int32{4, 0, 2, 0}},\n\t\t\t\".message_type[1]\":                                   {[]int32{4, 1}},\n\t\t\t\".message_type[1].name\":                              {[]int32{4, 1}},\n\t\t\t\".message_type[1].nested_type[0]\":                    {[]int32{4, 1}, []int32{4, 1, 3, 0}},\n\t\t\t\".message_type[1].nested_type[0].name\":               {[]int32{4, 1}, []int32{4, 1, 3, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0]\":           {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].label\":     {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].type\":      {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].name\":      {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[0].number\":    {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 0}},\n\t\t\t\".message_type[1].nested_type[0].field[1]\":           {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[1].type_name\": {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[1].name\":      {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[1].number\":    {[]int32{4, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 2, 1}},\n\t\t\t\".message_type[1].enum_type[0]\":                      {[]int32{4, 1}, []int32{4, 1, 4, 0}},\n\t\t\t\".message_type[1].enum_type[0].name\":                 {[]int32{4, 1}, []int32{4, 1, 4, 0}},\n\t\t\t\".message_type[1].enum_type[0].value[0]\":             {[]int32{4, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 2, 0}},\n\t\t\t\".message_type[1].enum_type[0].value[0].name\":        {[]int32{4, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 2, 0}},\n\t\t\t\".message_type[1].enum_type[0].value[0].number\":      {[]int32{4, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 2, 0}},\n\t\t\t\".message_type[1].enum_type[0].value[1]\":             {[]int32{4, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 2, 1}},\n\t\t\t\".message_type[1].enum_type[0].value[1].name\":        {[]int32{4, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 2, 1}},\n\t\t\t\".message_type[1].enum_type[0].value[1].number\":      {[]int32{4, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 2, 1}},\n\t\t\t\".message_type[1].field[0]\":                          {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].label\":                    {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].type_name\":                {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].name\":                     {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[0].number\":                   {[]int32{4, 1}, []int32{4, 1, 2, 0}},\n\t\t\t\".message_type[1].field[1]\":                          {[]int32{4, 1}, []int32{4, 1, 2, 1}},\n\t\t\t\".message_type[1].field[1].type_name\":                {[]int32{4, 1}, []int32{4, 1, 2, 1}},\n\t\t\t\".message_type[1].field[1].name\":                     {[]int32{4, 1}, []int32{4, 1, 2, 1}},\n\t\t\t\".message_type[1].field[1].number\":                   {[]int32{4, 1}, []int32{4, 1, 2, 1}},\n\t\t\t\".message_type[2]\":                                   {[]int32{4, 2}},\n\t\t\t\".message_type[2].name\":                              {[]int32{4, 2}},\n\t\t\t\".message_type[2].field[0]\":                          {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[2].field[0].type_name\":                {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[2].field[0].name\":                     {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[2].field[0].number\":                   {[]int32{4, 2}, []int32{4, 2, 2, 0}},\n\t\t\t\".message_type[3]\":                                   {[]int32{4, 3}},\n\t\t\t\".message_type[3].name\":                              {[]int32{4, 3}},\n\t\t\t\".message_type[3].field[0]\":                          {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].label\":                    {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].type\":                     {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].name\":                     {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].field[0].number\":                   {[]int32{4, 3}, []int32{4, 3, 2, 0}},\n\t\t\t\".message_type[3].reserved_name\":                     {[]int32{4, 3}, []int32{4, 3, 10}},\n\t\t\t\".message_type[3].reserved_name[0]\":                  {[]int32{4, 3}, []int32{4, 3, 10}, []int32{4, 3, 10, 0}},\n\t\t\t\".message_type[3].reserved_name[1]\":                  {[]int32{4, 3}, []int32{4, 3, 10}, []int32{4, 3, 10, 1}},\n\t\t},\n\t\ttrue,\n\t)\n\ttestGetAssociatedSourcePaths(\n\t\tt,\n\t\t\"testdata/proto3/test.proto\",\n\t\tmap[string][]protoreflect.SourcePath{\n\t\t\t\".syntax\":                                            {[]int32{12}},\n\t\t\t\".package\":                                           {[]int32{2}},\n\t\t\t\".dependency[0]\":                                     {[]int32{3, 0}},\n\t\t\t\".service[0]\":                                        {[]int32{6, 0}, []int32{6, 0, 1}},\n\t\t\t\".service[0].name\":                                   {[]int32{6, 0}, []int32{6, 0, 1}},\n\t\t\t\".service[0].method[0]\":                              {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[0].name\":                         {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[0].input_type\":                   {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[0].output_type\":                  {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 0}, []int32{6, 0, 2, 0, 1}, []int32{6, 0, 2, 0, 2}, []int32{6, 0, 2, 0, 3}, []int32{6, 0, 2, 0, 5}, []int32{6, 0, 2, 0, 6}},\n\t\t\t\".service[0].method[1]\":                              {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].name\":                         {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].client_streaming\":             {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].input_type\":                   {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].server_streaming\":             {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".service[0].method[1].output_type\":                  {[]int32{6, 0}, []int32{6, 0, 1}, []int32{6, 0, 2, 1}, []int32{6, 0, 2, 1, 1}, []int32{6, 0, 2, 1, 2}, []int32{6, 0, 2, 1, 3}, []int32{6, 0, 2, 1, 5}, []int32{6, 0, 2, 1, 6}},\n\t\t\t\".message_type[0]\":                                   {[]int32{4, 0}, []int32{4, 0, 1}},\n\t\t\t\".message_type[0].name\":                              {[]int32{4, 0}, []int32{4, 0, 1}},\n\t\t\t\".message_type[0].field[0]\":                          {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[0].field[0].type\":                     {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[0].field[0].name\":                     {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[0].field[0].number\":                   {[]int32{4, 0}, []int32{4, 0, 1}, []int32{4, 0, 2, 0}, []int32{4, 0, 2, 0, 1}, []int32{4, 0, 2, 0, 3}, []int32{4, 0, 2, 0, 4}, []int32{4, 0, 2, 0, 5}, []int32{4, 0, 2, 0, 6}},\n\t\t\t\".message_type[1]\":                                   {[]int32{4, 1}, []int32{4, 1, 1}},\n\t\t\t\".message_type[1].name\":                              {[]int32{4, 1}, []int32{4, 1, 1}},\n\t\t\t\".message_type[1].nested_type[0]\":                    {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}},\n\t\t\t\".message_type[1].nested_type[0].name\":               {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}},\n\t\t\t\".message_type[1].nested_type[0].field[0]\":           {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].label\":     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].type\":      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].name\":      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[0].number\":    {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 0}, []int32{4, 1, 3, 0, 2, 0, 1}, []int32{4, 1, 3, 0, 2, 0, 3}, []int32{4, 1, 3, 0, 2, 0, 4}, []int32{4, 1, 3, 0, 2, 0, 5}, []int32{4, 1, 3, 0, 2, 0, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1]\":           {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1].type_name\": {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1].name\":      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].nested_type[0].field[1].number\":    {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 3, 0}, []int32{4, 1, 3, 0, 1}, []int32{4, 1, 3, 0, 2, 1}, []int32{4, 1, 3, 0, 2, 1, 1}, []int32{4, 1, 3, 0, 2, 1, 3}, []int32{4, 1, 3, 0, 2, 1, 4}, []int32{4, 1, 3, 0, 2, 1, 5}, []int32{4, 1, 3, 0, 2, 1, 6}},\n\t\t\t\".message_type[1].enum_type[0]\":                      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}},\n\t\t\t\".message_type[1].enum_type[0].name\":                 {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}},\n\t\t\t\".message_type[1].enum_type[0].value[0]\":             {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}, []int32{4, 1, 4, 0, 2, 0}, []int32{4, 1, 4, 0, 2, 0, 1}, []int32{4, 1, 4, 0, 2, 0, 2}},\n\t\t\t\".message_type[1].enum_type[0].value[0].name\":        {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}, []int32{4, 1, 4, 0, 2, 0}, []int32{4, 1, 4, 0, 2, 0, 1}, []int32{4, 1, 4, 0, 2, 0, 2}},\n\t\t\t\".message_type[1].enum_type[0].value[0].number\":      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}, []int32{4, 1, 4, 0, 2, 0}, []int32{4, 1, 4, 0, 2, 0, 1}, []int32{4, 1, 4, 0, 2, 0, 2}},\n\t\t\t\".message_type[1].enum_type[0].value[1]\":             {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}, []int32{4, 1, 4, 0, 2, 1}, []int32{4, 1, 4, 0, 2, 1, 1}, []int32{4, 1, 4, 0, 2, 1, 2}},\n\t\t\t\".message_type[1].enum_type[0].value[1].name\":        {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}, []int32{4, 1, 4, 0, 2, 1}, []int32{4, 1, 4, 0, 2, 1, 1}, []int32{4, 1, 4, 0, 2, 1, 2}},\n\t\t\t\".message_type[1].enum_type[0].value[1].number\":      {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 4, 0}, []int32{4, 1, 4, 0, 1}, []int32{4, 1, 4, 0, 2, 1}, []int32{4, 1, 4, 0, 2, 1, 1}, []int32{4, 1, 4, 0, 2, 1, 2}},\n\t\t\t\".message_type[1].field[0]\":                          {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].label\":                    {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].type_name\":                {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].name\":                     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[0].number\":                   {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 0}, []int32{4, 1, 2, 0, 1}, []int32{4, 1, 2, 0, 3}, []int32{4, 1, 2, 0, 4}, []int32{4, 1, 2, 0, 5}, []int32{4, 1, 2, 0, 6}},\n\t\t\t\".message_type[1].field[1]\":                          {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 1}, []int32{4, 1, 2, 1, 1}, []int32{4, 1, 2, 1, 3}, []int32{4, 1, 2, 1, 4}, []int32{4, 1, 2, 1, 5}, []int32{4, 1, 2, 1, 6}},\n\t\t\t\".message_type[1].field[1].type_name\":                {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 1}, []int32{4, 1, 2, 1, 1}, []int32{4, 1, 2, 1, 3}, []int32{4, 1, 2, 1, 4}, []int32{4, 1, 2, 1, 5}, []int32{4, 1, 2, 1, 6}},\n\t\t\t\".message_type[1].field[1].name\":                     {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 1}, []int32{4, 1, 2, 1, 1}, []int32{4, 1, 2, 1, 3}, []int32{4, 1, 2, 1, 4}, []int32{4, 1, 2, 1, 5}, []int32{4, 1, 2, 1, 6}},\n\t\t\t\".message_type[1].field[1].number\":                   {[]int32{4, 1}, []int32{4, 1, 1}, []int32{4, 1, 2, 1}, []int32{4, 1, 2, 1, 1}, []int32{4, 1, 2, 1, 3}, []int32{4, 1, 2, 1, 4}, []int32{4, 1, 2, 1, 5}, []int32{4, 1, 2, 1, 6}},\n\t\t\t\".message_type[2]\":                                   {[]int32{4, 2}, []int32{4, 2, 1}},\n\t\t\t\".message_type[2].name\":                              {[]int32{4, 2}, []int32{4, 2, 1}},\n\t\t\t\".message_type[2].field[0]\":                          {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[2].field[0].type_name\":                {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[2].field[0].name\":                     {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[2].field[0].number\":                   {[]int32{4, 2}, []int32{4, 2, 1}, []int32{4, 2, 2, 0}, []int32{4, 2, 2, 0, 1}, []int32{4, 2, 2, 0, 3}, []int32{4, 2, 2, 0, 4}, []int32{4, 2, 2, 0, 5}, []int32{4, 2, 2, 0, 6}},\n\t\t\t\".message_type[3]\":                                   {[]int32{4, 3}, []int32{4, 3, 1}},\n\t\t\t\".message_type[3].name\":                              {[]int32{4, 3}, []int32{4, 3, 1}},\n\t\t\t\".message_type[3].field[0]\":                          {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].label\":                    {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].type\":                     {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].name\":                     {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].field[0].number\":                   {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 2, 0}, []int32{4, 3, 2, 0, 1}, []int32{4, 3, 2, 0, 3}, []int32{4, 3, 2, 0, 4}, []int32{4, 3, 2, 0, 5}, []int32{4, 3, 2, 0, 6}},\n\t\t\t\".message_type[3].reserved_name\":                     {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 10}},\n\t\t\t\".message_type[3].reserved_name[0]\":                  {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 10}, []int32{4, 3, 10, 0}},\n\t\t\t\".message_type[3].reserved_name[1]\":                  {[]int32{4, 3}, []int32{4, 3, 1}, []int32{4, 3, 10}, []int32{4, 3, 10, 1}},\n\t\t},\n\t\tfalse,\n\t)\n}\n\nfunc testGetAssociatedSourcePaths(\n\tt *testing.T,\n\ttestFilePath string,\n\tsourcePathToExpectedAssociatedPaths map[string][]protoreflect.SourcePath,\n\texcludeChildAssociatedPaths bool,\n) {\n\tcompiler := protocompile.Compiler{\n\t\tResolver:       &protocompile.SourceResolver{},\n\t\tSourceInfoMode: protocompile.SourceInfoStandard,\n\t}\n\tfiles, err := compiler.Compile(t.Context(), testFilePath)\n\trequire.NoError(t, err)\n\trequire.Len(t, files, 1, \"expect only one test file\")\n\tsourceLocations := files[0].SourceLocations()\n\t// SourceLocations are indexed starting from 1\n\tfor i := 1; i < sourceLocations.Len(); i++ {\n\t\tsourceLocation := sourceLocations.Get(i)\n\t\tassociatedSourcePaths, err := getAssociatedSourcePaths(sourceLocation.Path, excludeChildAssociatedPaths)\n\t\trequire.NoError(t, err)\n\t\texpectedAssociatedPaths, ok := sourcePathToExpectedAssociatedPaths[sourceLocation.Path.String()]\n\t\trequire.True(t, ok, sourceLocation.Path)\n\t\trequire.Equal(t, expectedAssociatedPaths, associatedSourcePaths, i)\n\t}\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/service.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protosourcepath\n\nimport (\n\t\"slices\"\n\n\t\"google.golang.org/protobuf/reflect/protoreflect\"\n)\n\nconst (\n\tserviceNameTypeTag    = int32(1)\n\tserviceMethodsTypeTag = int32(2)\n\tserviceOptionTypeTag  = int32(3)\n)\n\n// services is the state when an element representing services in the source path was parsed.\nfunc services(\n\t_ int32,\n\tfullSourcePath protoreflect.SourcePath,\n\tindex int,\n\texcludeChildAssociatedPaths bool,\n) (state, []protoreflect.SourcePath, error) {\n\tassociatedPaths := []protoreflect.SourcePath{\n\t\tcurrentPath(fullSourcePath, index),\n\t}\n\tif !excludeChildAssociatedPaths {\n\t\tassociatedPaths = append(\n\t\t\tassociatedPaths,\n\t\t\tchildAssociatedPath(fullSourcePath, index, serviceNameTypeTag),\n\t\t)\n\t}\n\tif len(fullSourcePath) == +1 {\n\t\t// This does not extend beyond the declaration, return associated paths and\n\t\t// terminate here.\n\t\treturn nil, associatedPaths, nil\n\t}\n\treturn service, associatedPaths, nil\n}\n\n// service is the state when an element representing a specific child path of a service was parsed.\nfunc service(token int32, fullSourcePath protoreflect.SourcePath, index int, _ bool) (state, []protoreflect.SourcePath, error) {\n\tswitch token {\n\tcase serviceNameTypeTag:\n\t\t// The path for service name has already been added, can terminate here immediately.\n\t\treturn nil, nil, nil\n\tcase serviceMethodsTypeTag:\n\t\t// We check to make sure that the length of the source path contains at least the current\n\t\t// token and an index. This is because all source paths for methods are expected\n\t\t// to have indices.\n\t\tif len(fullSourcePath) < index+2 {\n\t\t\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"cannot have method declaration without index\")\n\t\t}\n\t\treturn methods, nil, nil\n\tcase serviceOptionTypeTag:\n\t\t// For options, we add the full path and then return the options state to validate\n\t\t// the path.\n\t\treturn options, []protoreflect.SourcePath{slices.Clone(fullSourcePath)}, nil\n\t}\n\treturn nil, nil, newInvalidSourcePathError(fullSourcePath, \"invalid service path\")\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/testdata/proto2/import.proto",
    "content": "syntax = \"proto2\";\n\npackage foo;\n\nmessage Import {}\n"
  },
  {
    "path": "private/pkg/protosourcepath/testdata/proto2/test.proto",
    "content": "syntax = \"proto2\";\n\npackage foo;\n\nimport \"testdata/proto2/import.proto\";\n\nservice Foo {\n  rpc GetFoo(GetFooRequest) returns (GetFooResponse);\n  rpc GetFoos(stream GetFoosRequest) returns (stream GetFooResponse);\n}\n\nmessage GetFooRequest {\n  required string id = 1;\n}\n\nmessage GetFooResponse {\n  message Value {\n    required string id = 1;\n    optional foo.Import imported_value = 2;\n    extensions 3 to 10 [\n     verification = DECLARATION,\n      declaration = {\n        number: 3,\n        full_name: \".foo.Bar.bar\",\n        repeated: true,\n        type: \"int32\",\n      },\n      declaration = {\n        number: 7,\n        full_name: \".foo.Bar.barbar\",\n        type: \"string\"\n      }\n    ];\n  }\n  repeated Value values = 1;\n}\n\nmessage GetFoosRequest {\n  map<string, string> kv = 1;\n}\n\nmessage GetFoosResponse {\n  repeated bytes content = 1;\n  reserved \"id\", \"values\";\n}\n\nmessage Bar {\n  extend GetFooResponse.Value {\n    repeated int32 bar = 3;\n    optional string barbar = 7 [default = \"hello\"];\n  }\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/testdata/proto3/import.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nmessage Import {}\n"
  },
  {
    "path": "private/pkg/protosourcepath/testdata/proto3/test.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n\nimport \"testdata/proto3/import.proto\";\n\nservice Foo {\n  rpc GetFoo(GetFooRequest) returns (GetFooResponse);\n  rpc GetFoos(stream GetFoosRequest) returns (stream GetFooResponse);\n}\n\nmessage GetFooRequest {\n  string id = 1;\n}\n\nmessage GetFooResponse {\n  message Value {\n    optional string id = 1;\n    foo.Import imported_value = 2;\n  }\n  enum Status {\n    STATUS_UNSPECIFIED = 0;\n    STATUS_VERIFIED = 1;\n  }\n  repeated Value values = 1;\n  Status status = 2;\n}\n\nmessage GetFoosRequest {\n  map<string, string> kv = 1;\n}\n\nmessage GetFoosResponse {\n  repeated bytes content = 1;\n  reserved \"id\", \"values\";\n}\n"
  },
  {
    "path": "private/pkg/protosourcepath/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protosourcepath\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/protostat/protostat.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protostat\n\nimport (\n\t\"context\"\n\t\"io\"\n\n\t\"github.com/bufbuild/protocompile/ast\"\n\t\"github.com/bufbuild/protocompile/parser\"\n\t\"github.com/bufbuild/protocompile/reporter\"\n)\n\n// Stats represents some statistics about one or more Protobuf files.\n//\n// Note that as opposed to most structs in this codebase, we do not omitempty for\n// the fields for JSON or YAML.\ntype Stats struct {\n\tFiles                 int `json:\"files\" yaml:\"files\"`\n\tTypes                 int `json:\"types\" yaml:\"types\"`\n\tPackages              int `json:\"packages\" yaml:\"packages\"`\n\tMessages              int `json:\"messages\" yaml:\"messages\"`\n\tDeprecatedMessages    int `json:\"deprecated_messages\" yaml:\"deprecated_messages\"`\n\tFields                int `json:\"fields\" yaml:\"fields\"`\n\tEnums                 int `json:\"enums\" yaml:\"enums\"`\n\tDeprecatedEnums       int `json:\"deprecated_enums\" yaml:\"deprecated_enums\"`\n\tEnumValues            int `json:\"evalues\" yaml:\"evalues\"`\n\tServices              int `json:\"services\" yaml:\"services\"`\n\tRPCs                  int `json:\"rpcs\" yaml:\"rpcs\"`\n\tDeprecatedRPCs        int `json:\"deprecated_rpcs\" yaml:\"deprecated_rpcs\"`\n\tExtensions            int `json:\"extensions\" yaml:\"extensions\"`\n\tFilesWithSyntaxErrors int `json:\"-\" yaml:\"-\"`\n}\n\n// FileWalker goes through all .proto files for GetStats.\ntype FileWalker interface {\n\t// Walk will invoke f for all .proto files for GetStats.\n\tWalk(ctx context.Context, f func(io.Reader) error) error\n}\n\n// GetStats gathers some simple statistics about a set of Protobuf files.\n//\n// See the packages protostatos and protostatstorage for helpers for the\n// os and storage packages.\nfunc GetStats(ctx context.Context, fileWalker FileWalker) (*Stats, error) {\n\thandler := reporter.NewHandler(\n\t\treporter.NewReporter(\n\t\t\tfunc(reporter.ErrorWithPos) error {\n\t\t\t\t// never aborts\n\t\t\t\treturn nil\n\t\t\t},\n\t\t\tnil,\n\t\t),\n\t)\n\tstatsBuilder := newStatsBuilder()\n\tif err := fileWalker.Walk(\n\t\tctx,\n\t\tfunc(file io.Reader) error {\n\t\t\t// This can return an error and non-nil AST.\n\t\t\t// We do not need the filePath because we do not report errors.\n\t\t\tastRoot, err := parser.Parse(\"\", file, handler)\n\t\t\tif astRoot == nil {\n\t\t\t\t// No AST implies an I/O error trying to read the\n\t\t\t\t// file contents. No stats to collect.\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\t// There was a syntax error, but we still have a partial\n\t\t\t\t// AST we can examine.\n\t\t\t\tstatsBuilder.FilesWithSyntaxErrors++\n\t\t\t}\n\t\t\texamineFile(statsBuilder, astRoot)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tstatsBuilder.Packages = len(statsBuilder.packages)\n\treturn statsBuilder.Stats, nil\n}\n\n// MergeStats merged multiple stats objects into one single Stats object.\n//\n// A new object is returned.\nfunc MergeStats(statsSlice ...*Stats) *Stats {\n\tresultStats := &Stats{}\n\tfor _, stats := range statsSlice {\n\t\tresultStats.Files += stats.Files\n\t\tresultStats.FilesWithSyntaxErrors += stats.FilesWithSyntaxErrors\n\t\tresultStats.Packages += stats.Packages\n\t\tresultStats.Types += stats.Types\n\t\tresultStats.Messages += stats.Messages\n\t\tresultStats.DeprecatedMessages += stats.DeprecatedMessages\n\t\tresultStats.Fields += stats.Fields\n\t\tresultStats.Enums += stats.Enums\n\t\tresultStats.DeprecatedEnums += stats.DeprecatedEnums\n\t\tresultStats.EnumValues += stats.EnumValues\n\t\tresultStats.Services += stats.Services\n\t\tresultStats.RPCs += stats.RPCs\n\t\tresultStats.DeprecatedRPCs += stats.DeprecatedRPCs\n\t\tresultStats.Extensions += stats.Extensions\n\t}\n\treturn resultStats\n}\n\ntype statsBuilder struct {\n\t*Stats\n\n\tpackages map[ast.Identifier]struct{}\n}\n\nfunc newStatsBuilder() *statsBuilder {\n\treturn &statsBuilder{\n\t\tStats:    &Stats{},\n\t\tpackages: make(map[ast.Identifier]struct{}),\n\t}\n}\n\nfunc examineFile(statsBuilder *statsBuilder, fileNode *ast.FileNode) {\n\tstatsBuilder.Files++\n\tfor _, decl := range fileNode.Decls {\n\t\tswitch decl := decl.(type) {\n\t\tcase *ast.PackageNode:\n\t\t\tstatsBuilder.packages[decl.Name.AsIdentifier()] = struct{}{}\n\t\tcase *ast.MessageNode:\n\t\t\texamineMessage(statsBuilder, &decl.MessageBody, decl)\n\t\tcase *ast.EnumNode:\n\t\t\texamineEnum(statsBuilder, decl)\n\t\tcase *ast.ExtendNode:\n\t\t\texamineExtend(statsBuilder, decl)\n\t\tcase *ast.ServiceNode:\n\t\t\tstatsBuilder.Services++\n\t\t\tfor _, decl := range decl.Decls {\n\t\t\t\trpcNode, ok := decl.(*ast.RPCNode)\n\t\t\t\tif ok {\n\t\t\t\t\tstatsBuilder.RPCs++\n\t\t\t\t\tstatsBuilder.Types++\n\t\t\t\t\tif isDeprecated(rpcNode) {\n\t\t\t\t\t\tstatsBuilder.DeprecatedRPCs++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n// examineMessage examines a message body and updates stats.\n// The node parameter is used to check for deprecated options, and can be a MessageNode or GroupNode.\nfunc examineMessage(statsBuilder *statsBuilder, messageBody *ast.MessageBody, node ast.NodeWithOptions) {\n\tstatsBuilder.Messages++\n\tstatsBuilder.Types++\n\tif node != nil && isDeprecated(node) {\n\t\tstatsBuilder.DeprecatedMessages++\n\t}\n\tfor _, decl := range messageBody.Decls {\n\t\tswitch decl := decl.(type) {\n\t\tcase *ast.FieldNode, *ast.MapFieldNode:\n\t\t\tstatsBuilder.Fields++\n\t\tcase *ast.GroupNode:\n\t\t\tstatsBuilder.Fields++\n\t\t\texamineMessage(statsBuilder, &decl.MessageBody, decl)\n\t\tcase *ast.OneofNode:\n\t\t\tfor _, ooDecl := range decl.Decls {\n\t\t\t\tswitch ooDecl := ooDecl.(type) {\n\t\t\t\tcase *ast.FieldNode:\n\t\t\t\t\tstatsBuilder.Fields++\n\t\t\t\tcase *ast.GroupNode:\n\t\t\t\t\tstatsBuilder.Fields++\n\t\t\t\t\texamineMessage(statsBuilder, &ooDecl.MessageBody, ooDecl)\n\t\t\t\t}\n\t\t\t}\n\t\tcase *ast.MessageNode:\n\t\t\texamineMessage(statsBuilder, &decl.MessageBody, decl)\n\t\tcase *ast.EnumNode:\n\t\t\texamineEnum(statsBuilder, decl)\n\t\tcase *ast.ExtendNode:\n\t\t\texamineExtend(statsBuilder, decl)\n\t\t}\n\t}\n}\n\nfunc examineEnum(statsBuilder *statsBuilder, enumNode *ast.EnumNode) {\n\tstatsBuilder.Enums++\n\tstatsBuilder.Types++\n\tif isDeprecated(enumNode) {\n\t\tstatsBuilder.DeprecatedEnums++\n\t}\n\tfor _, decl := range enumNode.Decls {\n\t\t_, ok := decl.(*ast.EnumValueNode)\n\t\tif ok {\n\t\t\tstatsBuilder.EnumValues++\n\t\t}\n\t}\n}\n\nfunc examineExtend(statsBuilder *statsBuilder, extendNode *ast.ExtendNode) {\n\tfor _, decl := range extendNode.Decls {\n\t\tswitch decl := decl.(type) {\n\t\tcase *ast.FieldNode:\n\t\t\tstatsBuilder.Extensions++\n\t\tcase *ast.GroupNode:\n\t\t\tstatsBuilder.Extensions++\n\t\t\texamineMessage(statsBuilder, &decl.MessageBody, decl)\n\t\t}\n\t}\n}\n\nfunc isDeprecated(node ast.NodeWithOptions) bool {\n\t// GroupNode's Options can be nil.\n\tif groupNode, ok := node.(*ast.GroupNode); ok && groupNode.Options == nil {\n\t\treturn false\n\t}\n\tdeprecated := false\n\tnode.RangeOptions(func(opt *ast.OptionNode) bool {\n\t\t// Check if this is the \"deprecated\" option (simple name, not extension)\n\t\tif opt.Name == nil || len(opt.Name.Parts) != 1 {\n\t\t\treturn true // continue\n\t\t}\n\t\tpart := opt.Name.Parts[0]\n\t\tif part.IsExtension() {\n\t\t\treturn true // continue\n\t\t}\n\t\tif part.Value() != \"deprecated\" {\n\t\t\treturn true // continue\n\t\t}\n\t\t// Check if the value is true\n\t\tval := opt.Val.Value()\n\t\tswitch v := val.(type) {\n\t\tcase bool:\n\t\t\tdeprecated = v\n\t\tcase ast.Identifier:\n\t\t\tdeprecated = string(v) == \"true\"\n\t\t}\n\t\treturn false // stop iterating once we find deprecated option\n\t})\n\treturn deprecated\n}\n"
  },
  {
    "path": "private/pkg/protostat/protostat_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protostat\n\nimport (\n\t\"context\"\n\t\"io\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestGetStatsDeprecatedTypes(t *testing.T) {\n\tt.Parallel()\n\ttestCases := []struct {\n\t\tname                       string\n\t\tcontent                    string\n\t\texpectedTypes              int\n\t\texpectedDeprecatedMessages int\n\t\texpectedDeprecatedEnums    int\n\t\texpectedDeprecatedRPCs     int\n\t}{\n\t\t{\n\t\t\tname: \"no deprecated types\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Foo {}\n\t\t\t\tenum Bar { BAR_UNSPECIFIED = 0; }\n\t\t\t`,\n\t\t\texpectedTypes:              2,\n\t\t\texpectedDeprecatedMessages: 0,\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"deprecated message\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Foo {\n\t\t\t\t\toption deprecated = true;\n\t\t\t\t}\n\t\t\t\tmessage Bar {}\n\t\t\t`,\n\t\t\texpectedTypes:              2,\n\t\t\texpectedDeprecatedMessages: 1,\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"deprecated enum\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tenum Status {\n\t\t\t\t\toption deprecated = true;\n\t\t\t\t\tSTATUS_UNSPECIFIED = 0;\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              1,\n\t\t\texpectedDeprecatedMessages: 0,\n\t\t\texpectedDeprecatedEnums:    1,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"deprecated RPC\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Request {}\n\t\t\t\tmessage Response {}\n\t\t\t\tservice MyService {\n\t\t\t\t\trpc GetData(Request) returns (Response) {\n\t\t\t\t\t\toption deprecated = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              3,\n\t\t\texpectedDeprecatedMessages: 0,\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     1,\n\t\t},\n\t\t{\n\t\t\tname: \"RPC without options\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Request {}\n\t\t\t\tmessage Response {}\n\t\t\t\tservice MyService {\n\t\t\t\t\trpc GetData(Request) returns (Response);\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              3,\n\t\t\texpectedDeprecatedMessages: 0,\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"nested deprecated message\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Outer {\n\t\t\t\t\tmessage Inner {\n\t\t\t\t\t\toption deprecated = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              2,\n\t\t\texpectedDeprecatedMessages: 1,\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"outer deprecated but nested not\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Outer {\n\t\t\t\t\toption deprecated = true;\n\t\t\t\t\tmessage Inner {}\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              2,\n\t\t\texpectedDeprecatedMessages: 1,\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"deprecated group\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto2\";\n\t\t\t\tmessage Foo {\n\t\t\t\t\toptional group MyGroup = 1 [deprecated = true] {\n\t\t\t\t\t\toptional string name = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              2, // Foo, MyGroup (group is also a message type)\n\t\t\texpectedDeprecatedMessages: 1, // MyGroup\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"group without options\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto2\";\n\t\t\t\tmessage Foo {\n\t\t\t\t\toptional group MyGroup = 1 {\n\t\t\t\t\t\toptional string name = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              2,\n\t\t\texpectedDeprecatedMessages: 0,\n\t\t\texpectedDeprecatedEnums:    0,\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"all nested types deprecated\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Outer {\n\t\t\t\t\toption deprecated = true;\n\t\t\t\t\tmessage Inner {\n\t\t\t\t\t\toption deprecated = true;\n\t\t\t\t\t}\n\t\t\t\t\tenum Status {\n\t\t\t\t\t\toption deprecated = true;\n\t\t\t\t\t\tSTATUS_UNSPECIFIED = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              3,\n\t\t\texpectedDeprecatedMessages: 2, // Outer, Inner\n\t\t\texpectedDeprecatedEnums:    1, // Status\n\t\t\texpectedDeprecatedRPCs:     0,\n\t\t},\n\t\t{\n\t\t\tname: \"all types deprecated\",\n\t\t\tcontent: `\n\t\t\t\tsyntax = \"proto3\";\n\t\t\t\tmessage Foo {\n\t\t\t\t\toption deprecated = true;\n\t\t\t\t}\n\t\t\t\tenum Bar {\n\t\t\t\t\toption deprecated = true;\n\t\t\t\t\tBAR_UNSPECIFIED = 0;\n\t\t\t\t}\n\t\t\t\tmessage Request {}\n\t\t\t\tmessage Response {}\n\t\t\t\tservice Svc {\n\t\t\t\t\trpc Method(Request) returns (Response) {\n\t\t\t\t\t\toption deprecated = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`,\n\t\t\texpectedTypes:              5, // Foo, Bar, Request, Response, RPC\n\t\t\texpectedDeprecatedMessages: 1, // Foo\n\t\t\texpectedDeprecatedEnums:    1, // Bar\n\t\t\texpectedDeprecatedRPCs:     1, // RPC\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\twalker := &testFileWalker{contents: []string{tc.content}}\n\t\t\tstats, err := GetStats(t.Context(), walker)\n\t\t\trequire.NoError(t, err)\n\t\t\tassert.Equal(t, tc.expectedTypes, stats.Types, \"Types count mismatch\")\n\t\t\tassert.Equal(t, tc.expectedDeprecatedMessages, stats.DeprecatedMessages, \"DeprecatedMessages count mismatch\")\n\t\t\tassert.Equal(t, tc.expectedDeprecatedEnums, stats.DeprecatedEnums, \"DeprecatedEnums count mismatch\")\n\t\t\tassert.Equal(t, tc.expectedDeprecatedRPCs, stats.DeprecatedRPCs, \"DeprecatedRPCs count mismatch\")\n\t\t})\n\t}\n}\n\nfunc TestGetStatsMultipleFiles(t *testing.T) {\n\tt.Parallel()\n\tfile1 := `\n\t\tsyntax = \"proto3\";\n\t\tmessage DeprecatedFoo {\n\t\t\toption deprecated = true;\n\t\t}\n\t`\n\tfile2 := `\n\t\tsyntax = \"proto3\";\n\t\tmessage DeprecatedBar {\n\t\t\toption deprecated = true;\n\t\t}\n\t\tenum DeprecatedEnum {\n\t\t\toption deprecated = true;\n\t\t\tDEPRECATED_ENUM_UNSPECIFIED = 0;\n\t\t}\n\t`\n\n\twalker := &testFileWalker{contents: []string{file1, file2}}\n\tstats, err := GetStats(t.Context(), walker)\n\trequire.NoError(t, err)\n\n\tassert.Equal(t, 2, stats.Files)\n\tassert.Equal(t, 3, stats.Types)              // DeprecatedFoo, DeprecatedBar, DeprecatedEnum\n\tassert.Equal(t, 2, stats.DeprecatedMessages) // DeprecatedFoo, DeprecatedBar\n\tassert.Equal(t, 1, stats.DeprecatedEnums)    // DeprecatedEnum\n\tassert.Equal(t, 0, stats.DeprecatedRPCs)\n}\n\n// testFileWalker is a mock FileWalker that provides proto content from strings.\ntype testFileWalker struct {\n\tcontents []string\n}\n\nfunc (w *testFileWalker) Walk(ctx context.Context, f func(io.Reader) error) error {\n\tfor _, content := range w.contents {\n\t\tif err := f(strings.NewReader(content)); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc TestMergeStats(t *testing.T) {\n\tt.Parallel()\n\tstats1 := &Stats{\n\t\tFiles:              2,\n\t\tTypes:              10,\n\t\tDeprecatedMessages: 3,\n\t\tDeprecatedEnums:    1,\n\t\tDeprecatedRPCs:     1,\n\t\tMessages:           5,\n\t\tFields:             10,\n\t\tEnums:              3,\n\t\tEnumValues:         9,\n\t\tServices:           2,\n\t\tRPCs:               4,\n\t\tExtensions:         3,\n\t}\n\tstats2 := &Stats{\n\t\tFiles:              1,\n\t\tTypes:              6,\n\t\tDeprecatedMessages: 2,\n\t\tDeprecatedEnums:    1,\n\t\tDeprecatedRPCs:     0,\n\t\tMessages:           3,\n\t\tFields:             6,\n\t\tEnums:              2,\n\t\tEnumValues:         6,\n\t\tServices:           1,\n\t\tRPCs:               1,\n\t\tExtensions:         2,\n\t}\n\n\tmerged := MergeStats(stats1, stats2)\n\n\tassert.Equal(t, 3, merged.Files)\n\tassert.Equal(t, 16, merged.Types)\n\tassert.Equal(t, 5, merged.DeprecatedMessages)\n\tassert.Equal(t, 2, merged.DeprecatedEnums)\n\tassert.Equal(t, 1, merged.DeprecatedRPCs)\n\tassert.Equal(t, 8, merged.Messages)\n\tassert.Equal(t, 16, merged.Fields)\n\tassert.Equal(t, 5, merged.Enums)\n\tassert.Equal(t, 15, merged.EnumValues)\n\tassert.Equal(t, 3, merged.Services)\n\tassert.Equal(t, 5, merged.RPCs)\n\tassert.Equal(t, 5, merged.Extensions)\n}\n"
  },
  {
    "path": "private/pkg/protostat/protostatos/file_walker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protostatos\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\ntype fileWalker struct {\n\tfilenames []string\n}\n\nfunc newFileWalker(filenames []string) *fileWalker {\n\treturn &fileWalker{\n\t\tfilenames: filenames,\n\t}\n}\n\nfunc (f *fileWalker) Walk(ctx context.Context, fu func(io.Reader) error) error {\n\tfor _, filename := range f.filenames {\n\t\tif filepath.Ext(filename) != \".proto\" {\n\t\t\tcontinue\n\t\t}\n\t\tfile, err := os.Open(filename)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := fu(file); err != nil {\n\t\t\treturn errors.Join(err, file.Close())\n\t\t}\n\t\tif err := file.Close(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/protostat/protostatos/protostatos.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protostatos\n\nimport \"github.com/bufbuild/buf/private/pkg/protostat\"\n\n// NewFileWalker returns a new FileWalker for the given filenames.\n//\n// Anything without the .proto extension will be excluded.\nfunc NewFileWalker(filenames ...string) protostat.FileWalker {\n\treturn newFileWalker(filenames)\n}\n"
  },
  {
    "path": "private/pkg/protostat/protostatos/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protostatos\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/protostat/protostatstorage/file_walker.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protostatstorage\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\ntype fileWalker struct {\n\treadBucket storage.ReadBucket\n}\n\nfunc newFileWalker(readBucket storage.ReadBucket) *fileWalker {\n\treturn &fileWalker{\n\t\treadBucket: storage.FilterReadBucket(\n\t\t\treadBucket,\n\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t),\n\t}\n}\n\nfunc (f *fileWalker) Walk(ctx context.Context, fu func(io.Reader) error) error {\n\treturn f.readBucket.Walk(\n\t\tctx,\n\t\t\"\",\n\t\tfunc(objectInfo storage.ObjectInfo) (retErr error) {\n\t\t\treadObjectCloser, err := f.readBucket.Get(ctx, objectInfo.Path())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdefer func() {\n\t\t\t\tretErr = errors.Join(retErr, readObjectCloser.Close())\n\t\t\t}()\n\t\t\treturn fu(readObjectCloser)\n\t\t},\n\t)\n}\n"
  },
  {
    "path": "private/pkg/protostat/protostatstorage/protostatstorage.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protostatstorage\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/protostat\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// NewFileWalker returns a new FileWalker for the given ReadBucket.\n//\n// Anything without the .proto extension will be excluded.\nfunc NewFileWalker(readBucket storage.ReadBucket) protostat.FileWalker {\n\treturn newFileWalker(readBucket)\n}\n"
  },
  {
    "path": "private/pkg/protostat/protostatstorage/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protostatstorage\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/protostat/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protostat\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/prototesting/prototesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 prototesting\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xos/xexec\"\n\t\"github.com/bufbuild/buf/private/pkg/diff\"\n\t\"github.com/bufbuild/buf/private/pkg/protoencoding\"\n\t\"github.com/google/go-cmp/cmp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"google.golang.org/protobuf/testing/protocmp\"\n\t\"google.golang.org/protobuf/types/descriptorpb\"\n)\n\n// GetProtocFileDescriptorSet gets the validated FileDescriptorSet using\n// protoc and the Well-Known Types on the current PATH.\n//\n// Only use for testing.\nfunc GetProtocFileDescriptorSet(\n\tctx context.Context,\n\troots []string,\n\trealFilePaths []string,\n\tincludeImports bool,\n\tincludeSourceInfo bool,\n) (_ *descriptorpb.FileDescriptorSet, retErr error) {\n\ttempFile, err := os.CreateTemp(\"\", \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttempFilePath := tempFile.Name()\n\tdefer func() {\n\t\tif err := tempFile.Close(); err != nil {\n\t\t\tretErr = errors.Join(retErr, err)\n\t\t}\n\t\tif err := os.Remove(tempFilePath); err != nil {\n\t\t\tretErr = errors.Join(retErr, err)\n\t\t}\n\t}()\n\n\tif err := RunProtoc(\n\t\tctx,\n\t\troots,\n\t\trealFilePaths,\n\t\tincludeImports,\n\t\tincludeSourceInfo,\n\t\tnil,\n\t\tnil,\n\t\tfmt.Sprintf(\"--descriptor_set_out=%s\", tempFilePath),\n\t\t// Needed to maintain consistency with buf as of v27.0\n\t\t`--retain_options`,\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata, err := os.ReadFile(tempFilePath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfirstFileDescriptorSet := &descriptorpb.FileDescriptorSet{}\n\tif err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(data, firstFileDescriptorSet); err != nil {\n\t\treturn nil, err\n\t}\n\tresolver, err := protoencoding.NewResolver(firstFileDescriptorSet.File...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfileDescriptorSet := &descriptorpb.FileDescriptorSet{}\n\tif err := protoencoding.NewWireUnmarshaler(resolver).Unmarshal(data, fileDescriptorSet); err != nil {\n\t\treturn nil, err\n\t}\n\treturn fileDescriptorSet, nil\n}\n\n// GetProtocVersion runs protoc --version with RunProtoc and returns the output sans the \"libprotoc\" prefix\nfunc GetProtocVersion(ctx context.Context) (string, error) {\n\tvar stdout bytes.Buffer\n\tif err := RunProtoc(ctx, nil, nil, false, false, nil, &stdout, \"--version\"); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn strings.TrimSpace(strings.TrimPrefix(stdout.String(), \"libprotoc\")), nil\n}\n\n// RunProtoc runs protoc.\nfunc RunProtoc(\n\tctx context.Context,\n\troots []string,\n\trealFilePaths []string,\n\tincludeImports bool,\n\tincludeSourceInfo bool,\n\tenv map[string]string,\n\tstdout io.Writer,\n\textraFlags ...string,\n) error {\n\tprotocBinPath, err := getProtocBinPath()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resolved, err := filepath.EvalSymlinks(protocBinPath); err == nil {\n\t\tprotocBinPath = resolved\n\t}\n\tprotocIncludePath, err := getProtocIncludePath(protocBinPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\targs := []string{\"-I\", protocIncludePath}\n\tfor _, root := range roots {\n\t\targs = append(args, \"-I\", root)\n\t}\n\tif includeImports {\n\t\targs = append(args, \"--include_imports\")\n\t}\n\tif includeSourceInfo {\n\t\targs = append(args, \"--include_source_info\")\n\t}\n\targs = append(args, extraFlags...)\n\targs = append(args, realFilePaths...)\n\n\tstderr := bytes.NewBuffer(nil)\n\tif stdout == nil {\n\t\tstdout = stderr\n\t}\n\tenviron := make([]string, 0, len(env))\n\tfor key, value := range env {\n\t\tenviron = append(environ, key+\"=\"+value)\n\t}\n\tif err := xexec.Run(\n\t\tctx,\n\t\tprotocBinPath,\n\t\txexec.WithArgs(args...),\n\t\txexec.WithEnv(environ),\n\t\txexec.WithStdout(stdout),\n\t\txexec.WithStderr(stderr),\n\t); err != nil {\n\t\treturn fmt.Errorf(\"%s returned error: %v %v\", protocBinPath, err, stderr.String())\n\t}\n\treturn nil\n}\n\n// DiffFileDescriptorSetsWire diffs the two FileDescriptorSets using proto.MarshalWire.\nfunc DiffFileDescriptorSetsWire(\n\tctx context.Context,\n\tone *descriptorpb.FileDescriptorSet,\n\ttwo *descriptorpb.FileDescriptorSet,\n\toneName string,\n\ttwoName string,\n) (string, error) {\n\toneData, err := protoencoding.NewWireMarshaler().Marshal(one)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ttwoData, err := protoencoding.NewWireMarshaler().Marshal(two)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\toutput, err := diff.Diff(ctx, oneData, twoData, oneName, twoName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(output), nil\n}\n\n// DiffFileDescriptorSetsJSON diffs the two FileDescriptorSets using JSON.\nfunc DiffFileDescriptorSetsJSON(\n\tctx context.Context,\n\tone *descriptorpb.FileDescriptorSet,\n\ttwo *descriptorpb.FileDescriptorSet,\n\toneName string,\n\ttwoName string,\n) (string, error) {\n\toneResolver, err := protoencoding.NewResolver(one.File...)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\toneData, err := protoencoding.NewJSONMarshaler(oneResolver, protoencoding.JSONMarshalerWithIndent()).Marshal(one)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ttwoResolver, err := protoencoding.NewResolver(two.File...)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\ttwoData, err := protoencoding.NewJSONMarshaler(twoResolver, protoencoding.JSONMarshalerWithIndent()).Marshal(two)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\toutput, err := diff.Diff(ctx, oneData, twoData, oneName, twoName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(output), nil\n}\n\n// DiffFileDescriptorSetsCompare diffs the two FileDescriptorSets using the cmp package.\nfunc DiffFileDescriptorSetsCompare(\n\tone *descriptorpb.FileDescriptorSet,\n\ttwo *descriptorpb.FileDescriptorSet,\n) string {\n\treturn cmp.Diff(one, two, protocmp.Transform())\n}\n\n// AssertFileDescriptorSetsEqual asserts that the FileDescriptorSet are equal for\n// JSON and compare.\nfunc AssertFileDescriptorSetsEqual(\n\tt *testing.T,\n\tone *descriptorpb.FileDescriptorSet,\n\ttwo *descriptorpb.FileDescriptorSet,\n) {\n\tdiff, err := DiffFileDescriptorSetsJSON(t.Context(), one, two, \"buf\", \"protoc\")\n\tassert.NoError(t, err)\n\tassert.Empty(t, diff)\n\tdiff = DiffFileDescriptorSetsCompare(one, two)\n\tassert.Empty(t, diff)\n}\n\n// getProtocBinPath gets the os-specific path for the protoc binary on disk.\nfunc getProtocBinPath() (string, error) {\n\tprotocBinPath, err := exec.LookPath(\"protoc\")\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn filepath.Abs(protocBinPath)\n}\n\n// checkWKT checks that the well-known types are in included in the protoc libraries and returns an error if\n// they are not present.\nfunc checkWKT(protocIncludePath string) error {\n\t// OK to use os.Stat here\n\twktFileInfo, err := os.Stat(filepath.Join(protocIncludePath, \"google\", \"protobuf\", \"any.proto\"))\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !wktFileInfo.Mode().IsRegular() {\n\t\treturn fmt.Errorf(\"could not find google/protobuf/any.proto in %s\", protocIncludePath)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/prototesting/prototesting_unix.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris\n\npackage prototesting\n\nimport (\n\t\"path/filepath\"\n)\n\nfunc getProtocIncludePath(protocBinPath string) (string, error) {\n\tprotocIncludePath, err := filepath.Abs(filepath.Join(filepath.Dir(protocBinPath), \"..\", \"include\"))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := checkWKT(protocIncludePath); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn protocIncludePath, nil\n}\n"
  },
  {
    "path": "private/pkg/prototesting/prototesting_windows.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 prototesting\n\nimport (\n\t\"path/filepath\"\n)\n\nfunc getProtocIncludePath(protocBinPath string) (string, error) {\n\tprotocIncludePath, err := filepath.Abs(\n\t\tfilepath.Join(filepath.Dir(protocBinPath),\n\t\t\t\"..\",\n\t\t\t\"lib\",\n\t\t\t\"include\",\n\t\t))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif err := checkWKT(protocIncludePath); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn protocIncludePath, nil\n}\n"
  },
  {
    "path": "private/pkg/prototesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage prototesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/prototime/prototime.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 prototime\n\nimport (\n\t\"time\"\n\n\t\"google.golang.org/protobuf/types/known/timestamppb\"\n)\n\n// NewTimestamp creates a new proto WKT timestamp from a time.Time.\n// It runs CheckValid() on the timestamp before returning.\nfunc NewTimestamp(t time.Time) (*timestamppb.Timestamp, error) {\n\ttimestamp := timestamppb.New(t)\n\tif err := timestamp.CheckValid(); err != nil {\n\t\treturn nil, err\n\t}\n\treturn timestamp, nil\n}\n"
  },
  {
    "path": "private/pkg/prototime/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage prototime\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/protoversion/package_version.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoversion\n\nimport (\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar _ PackageVersion = &packageVersion{}\n\ntype packageVersion struct {\n\tmajor          int\n\tstabilityLevel StabilityLevel\n\tminor          int\n\tpatch          int\n\tsuffix         string\n}\n\nfunc newPackageVersionForPackage(pkg string, options ...PackageVersionOption) (*packageVersion, bool) {\n\tif pkg == \"\" {\n\t\treturn nil, false\n\t}\n\tparts := strings.Split(pkg, \".\")\n\tif len(parts) < 2 {\n\t\treturn nil, false\n\t}\n\treturn newPackageVersionForComponent(parts[len(parts)-1], options...)\n}\n\nfunc newPackageVersionForComponent(component string, options ...PackageVersionOption) (*packageVersion, bool) {\n\tpackageVersionOptions := newPackageVersionOptions()\n\tfor _, option := range options {\n\t\toption(packageVersionOptions)\n\t}\n\tminMajorVersionNumber := 1\n\tif packageVersionOptions.allowV0 {\n\t\tminMajorVersionNumber = 0\n\t}\n\n\tif strings.Contains(component, \".\") {\n\t\treturn nil, false\n\t}\n\t// must at least contain 'v' and a number\n\tif len(component) < 2 {\n\t\treturn nil, false\n\t}\n\tif component[0] != 'v' {\n\t\treturn nil, false\n\t}\n\n\t// v1beta1 -> 1beta1\n\t// v1testfoo -> 1testfoo\n\t// v1p1alpha1 -> p1alpha1\n\tversion := component[1:]\n\n\tif strings.Contains(version, \"test\") {\n\t\t// 1testfoo -> [1, foo]\n\t\tsplit := strings.SplitN(version, \"test\", 2)\n\t\tif len(split) != 2 {\n\t\t\treturn nil, false\n\t\t}\n\t\tmajor, ok := getNumber(split[0], minMajorVersionNumber)\n\t\tif !ok {\n\t\t\treturn nil, false\n\t\t}\n\t\treturn newPackageVersion(major, StabilityLevelTest, 0, 0, split[1]), true\n\t}\n\n\tvar stabilityLevel StabilityLevel\n\tcontainsAlpha := strings.Contains(version, \"alpha\")\n\tcontainsBeta := strings.Contains(version, \"beta\")\n\tswitch {\n\tcase !containsAlpha && !containsBeta:\n\t\tstabilityLevel = StabilityLevelStable\n\tcase containsAlpha && !containsBeta:\n\t\tstabilityLevel = StabilityLevelAlpha\n\tcase !containsAlpha && containsBeta:\n\t\tstabilityLevel = StabilityLevelBeta\n\tcase containsAlpha && containsBeta:\n\t\treturn nil, false\n\t}\n\tif stabilityLevel != StabilityLevelStable {\n\t\t// 1alpha1 -> [1, 1]\n\t\t// 1p1alpha1 ->[1p1, 1]\n\t\t// 1alpha -> [1, \"\"]\n\t\tsplit := strings.SplitN(version, stabilityLevel.String(), 2)\n\t\tif len(split) != 2 {\n\t\t\treturn nil, false\n\t\t}\n\t\tminor := 0\n\t\tvar ok bool\n\t\tif split[1] != \"\" {\n\t\t\tminor, ok = getNumber(split[1], 1)\n\t\t\tif !ok {\n\t\t\t\treturn nil, false\n\t\t\t}\n\t\t}\n\t\tmajor, patch, ok := getAlphaBetaMajorPatch(split[0], minMajorVersionNumber)\n\t\tif !ok {\n\t\t\treturn nil, false\n\t\t}\n\t\treturn newPackageVersion(major, stabilityLevel, minor, patch, \"\"), true\n\t}\n\n\t// no suffix that is valid, make sure we just have a number\n\tmajor, ok := getNumber(version, minMajorVersionNumber)\n\tif !ok {\n\t\treturn nil, false\n\t}\n\treturn newPackageVersion(major, StabilityLevelStable, 0, 0, \"\"), true\n}\n\nfunc newPackageVersion(\n\tmajor int,\n\tstabilityLevel StabilityLevel,\n\tminor int,\n\tpatch int,\n\tsuffix string,\n) *packageVersion {\n\treturn &packageVersion{\n\t\tmajor:          major,\n\t\tstabilityLevel: stabilityLevel,\n\t\tminor:          minor,\n\t\tpatch:          patch,\n\t\tsuffix:         suffix,\n\t}\n}\n\nfunc (p *packageVersion) Major() int {\n\treturn p.major\n}\n\nfunc (p *packageVersion) StabilityLevel() StabilityLevel {\n\treturn p.stabilityLevel\n}\n\nfunc (p *packageVersion) Minor() int {\n\treturn p.minor\n}\n\nfunc (p *packageVersion) Patch() int {\n\treturn p.patch\n}\n\nfunc (p *packageVersion) Suffix() string {\n\treturn p.suffix\n}\n\nfunc (p *packageVersion) String() string {\n\tvar builder strings.Builder\n\tbuilder.WriteRune('v')\n\tbuilder.WriteString(strconv.Itoa(p.major))\n\tif p.patch > 0 {\n\t\tbuilder.WriteRune('p')\n\t\tbuilder.WriteString(strconv.Itoa(p.patch))\n\t}\n\tbuilder.WriteString(p.stabilityLevel.String())\n\tif p.minor > 0 {\n\t\tbuilder.WriteString(strconv.Itoa(p.minor))\n\t}\n\tif p.suffix != \"\" {\n\t\tbuilder.WriteString(p.suffix)\n\t}\n\treturn builder.String()\n}\n\nfunc (p *packageVersion) isPackageVersion() {}\n\nfunc getAlphaBetaMajorPatch(remainder string, minMajorVersionNumber int) (int, int, bool) {\n\tif strings.Contains(remainder, \"p\") {\n\t\t// 1p1 -> [1, 1]\n\t\tpatchSplit := strings.SplitN(remainder, \"p\", 2)\n\t\tif len(patchSplit) != 2 {\n\t\t\treturn 0, 0, false\n\t\t}\n\t\tmajor, ok := getNumber(patchSplit[0], minMajorVersionNumber)\n\t\tif !ok {\n\t\t\treturn 0, 0, false\n\t\t}\n\t\tpatch, ok := getNumber(patchSplit[1], 1)\n\t\tif !ok {\n\t\t\treturn 0, 0, false\n\t\t}\n\t\treturn major, patch, true\n\t}\n\t// no patch, make sure just a number\n\tmajor, ok := getNumber(remainder, minMajorVersionNumber)\n\tif !ok {\n\t\treturn 0, 0, false\n\t}\n\treturn major, 0, true\n}\n\nfunc getNumber(s string, minimum int) (int, bool) {\n\tif s == \"\" {\n\t\treturn 0, false\n\t}\n\tvalue, err := strconv.ParseInt(s, 10, 32)\n\tif err != nil {\n\t\treturn 0, false\n\t}\n\tif value < int64(minimum) {\n\t\treturn 0, false\n\t}\n\treturn int(value), true\n}\n\ntype packageVersionOptions struct {\n\tallowV0 bool\n}\n\nfunc newPackageVersionOptions() *packageVersionOptions {\n\treturn &packageVersionOptions{}\n}\n"
  },
  {
    "path": "private/pkg/protoversion/protoversion.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoversion\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nconst (\n\t// StabilityLevelStable is stable.\n\tStabilityLevelStable StabilityLevel = iota + 1\n\t// StabilityLevelAlpha is alpha stability.\n\tStabilityLevelAlpha\n\t// StabilityLevelBeta is beta stability.\n\tStabilityLevelBeta\n\t// StabilityLevelTest is test stability.\n\tStabilityLevelTest\n)\n\nvar (\n\tstabilityLevelToString = map[StabilityLevel]string{\n\t\tStabilityLevelStable: \"\",\n\t\tStabilityLevelAlpha:  \"alpha\",\n\t\tStabilityLevelBeta:   \"beta\",\n\t\tStabilityLevelTest:   \"test\",\n\t}\n)\n\n// StabilityLevel is the stability level.\ntype StabilityLevel int\n\n// String implements fmt.Stringer.\nfunc (s StabilityLevel) String() string {\n\tvalue, ok := stabilityLevelToString[s]\n\tif ok {\n\t\treturn value\n\t}\n\treturn strconv.Itoa(int(s))\n}\n\n// PackageVersion is a package version.\n//\n// A package has a version if the last component is a version of the form\n// v\\d+, v\\d+test.*, v\\d+(alpha|beta)\\d*, or v\\d+p\\d+(alpha|beta)\\d*\n// where numbers are >=1.\n//\n// Packages must have at least two components, that is \"package v1beta1\"\n// does not have a package version, but \"package foo.v1beta1\" does.\n//\n// See https://cloud.google.com/apis/design/versioning#channel-based_versioning\n// See https://cloud.google.com/apis/design/versioning#release-based_versioning\ntype PackageVersion interface {\n\tfmt.Stringer\n\n\t// Required.\n\t// Will always be >=0.\n\tMajor() int\n\t// Required.\n\tStabilityLevel() StabilityLevel\n\t// Optional.\n\t// Only potentially set if the stability level is alpha or beta.\n\t// Will always be >=1.\n\tMinor() int\n\t// Optional.\n\t// Only potentially set if the stability level is alpha or beta.\n\t// Will always be >=1.\n\tPatch() int\n\t// Optional.\n\t// Only potentially set if the stability level is test.\n\tSuffix() string\n\n\tisPackageVersion()\n}\n\n// NewPackageVersionForPackage returns the PackageVersion for the package.\n//\n// Returns false if the package has no package version per the specifications.\nfunc NewPackageVersionForPackage(pkg string, options ...PackageVersionOption) (PackageVersion, bool) {\n\treturn newPackageVersionForPackage(pkg, options...)\n}\n\n// NewPackageVersionForComponent returns the PackageVersion for the package component.\n//\n// Returns false if the component is not a package version per the specifications.\n// That is, the component \"v1beta1\" will return true, while the component \"foo\" will return false.\n//\n// Also returns false if the input is not a component.\n// That is, the input \"foo.bar\" is not a component, this is a package.\nfunc NewPackageVersionForComponent(component string, options ...PackageVersionOption) (PackageVersion, bool) {\n\treturn newPackageVersionForComponent(component, options...)\n}\n\n// PackageVersionOption is an option when constructing a new PackageVersion.\ntype PackageVersionOption func(*packageVersionOptions)\n\n// WithAllowV0 returns a new PackageVersionOption that allows major version numbers to be 0.\n//\n// The default is to only allow 1+ major version numbers.\nfunc WithAllowV0() PackageVersionOption {\n\treturn func(packageVersionOptions *packageVersionOptions) {\n\t\tpackageVersionOptions.allowV0 = true\n\t}\n}\n"
  },
  {
    "path": "private/pkg/protoversion/protoversion_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 protoversion\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNewPackageVersionForPackage(t *testing.T) {\n\tt.Parallel()\n\t// note we allow this in the linter as we check this in PACKAGE_DEFINED\n\t// however, for the purposes of packageHasPackageVersion, this does not\n\ttestNewPackageVersionForPackage(t, nil, false, \"\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.v1.bar\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"v1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"v1beta1\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelStable, 0, 0, \"\"), true, \"foo.v1\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(2, StabilityLevelStable, 0, 0, \"\"), true, \"foo.v2\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelStable, 0, 0, \"\"), true, \"foo.bar.v1\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelAlpha, 1, 0, \"\"), true, \"foo.bar.v1alpha1\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelAlpha, 2, 0, \"\"), true, \"foo.bar.v1alpha2\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelBeta, 1, 0, \"\"), true, \"foo.bar.v1beta1\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelBeta, 2, 0, \"\"), true, \"foo.bar.v1beta2\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelAlpha, 1, 1, \"\"), true, \"foo.bar.v1p1alpha1\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelAlpha, 2, 1, \"\"), true, \"foo.bar.v1p1alpha2\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelBeta, 1, 1, \"\"), true, \"foo.bar.v1p1beta1\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelBeta, 2, 1, \"\"), true, \"foo.bar.v1p1beta2\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelTest, 0, 0, \"\"), true, \"foo.bar.v1test\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelTest, 0, 0, \"foo\"), true, \"foo.bar.v1testfoo\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(4, StabilityLevelTest, 0, 0, \"\"), true, \"foo.bar.v4test\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(4, StabilityLevelTest, 0, 0, \"foo\"), true, \"foo.bar.v4testfoo\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelAlpha, 0, 0, \"\"), true, \"foo.bar.v1alpha\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelAlpha, 0, 1, \"\"), true, \"foo.bar.v1p1alpha\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelBeta, 0, 0, \"\"), true, \"foo.bar.v1beta\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(1, StabilityLevelBeta, 0, 1, \"\"), true, \"foo.bar.v1p1beta\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.v0\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0alpha1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0alpha2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0beta1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0beta2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0p1alpha1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0p1alpha2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0p1beta1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0p1beta2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0test\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v0testfoo\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1alpha0\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1beta0\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p1alpha0\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p1beta0\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p0alpha1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p0beta1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1alpha1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1alpha2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1beta1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1beta2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1p1alpha1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1p1alpha2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1p1beta1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1p1beta2\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1test\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.vv1testfoo\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1aalpha1\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p1test\")\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p1testfoo\")\n\ttestNewPackageVersionForPackage(t, newPackageVersion(0, StabilityLevelStable, 0, 0, \"\"), true, \"foo.bar.v0\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, newPackageVersion(0, StabilityLevelAlpha, 1, 0, \"\"), true, \"foo.bar.v0alpha1\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, newPackageVersion(0, StabilityLevelBeta, 1, 0, \"\"), true, \"foo.bar.v0beta1\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, newPackageVersion(0, StabilityLevelTest, 0, 0, \"\"), true, \"foo.bar.v0test\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, newPackageVersion(0, StabilityLevelTest, 0, 0, \"foo\"), true, \"foo.bar.v0testfoo\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1alpha0\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1beta0\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p0alpha1\", WithAllowV0())\n\ttestNewPackageVersionForPackage(t, nil, false, \"foo.bar.v1p0beta1\", WithAllowV0())\n}\n\nfunc TestNewPackageVersionForComponent(t *testing.T) {\n\tt.Parallel()\n\t// note we allow this in the linter as we check this in PACKAGE_DEFINED\n\t// however, for the purposes of packageHasPackageVersion, this does not\n\ttestNewPackageVersionForComponent(t, nil, false, \"\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"foo\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"foo.bar\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1.bar\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"foo.v1\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelStable, 0, 0, \"\"), true, \"v1\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(2, StabilityLevelStable, 0, 0, \"\"), true, \"v2\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelAlpha, 1, 0, \"\"), true, \"v1alpha1\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelAlpha, 2, 0, \"\"), true, \"v1alpha2\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelBeta, 1, 0, \"\"), true, \"v1beta1\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelBeta, 2, 0, \"\"), true, \"v1beta2\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelAlpha, 1, 1, \"\"), true, \"v1p1alpha1\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelAlpha, 2, 1, \"\"), true, \"v1p1alpha2\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelBeta, 1, 1, \"\"), true, \"v1p1beta1\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelBeta, 2, 1, \"\"), true, \"v1p1beta2\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelTest, 0, 0, \"\"), true, \"v1test\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelTest, 0, 0, \"foo\"), true, \"v1testfoo\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(4, StabilityLevelTest, 0, 0, \"\"), true, \"v4test\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(4, StabilityLevelTest, 0, 0, \"foo\"), true, \"v4testfoo\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelAlpha, 0, 0, \"\"), true, \"v1alpha\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelAlpha, 0, 1, \"\"), true, \"v1p1alpha\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelBeta, 0, 0, \"\"), true, \"v1beta\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(1, StabilityLevelBeta, 0, 1, \"\"), true, \"v1p1beta\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0alpha1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0alpha2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0beta1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0beta2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0p1alpha1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0p1alpha2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0p1beta1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0p1beta2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0test\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v0testfoo\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1alpha0\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1beta0\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1p1alpha0\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1p1beta0\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1alpha1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1alpha2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1beta1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1beta2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1p1alpha1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1p1alpha2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1p1beta1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1p1beta2\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1test\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"vv1testfoo\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1aalpha1\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1p1test\")\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1p1testfoo\")\n\ttestNewPackageVersionForComponent(t, newPackageVersion(0, StabilityLevelStable, 0, 0, \"\"), true, \"v0\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, newPackageVersion(0, StabilityLevelAlpha, 1, 0, \"\"), true, \"v0alpha1\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, newPackageVersion(0, StabilityLevelBeta, 1, 0, \"\"), true, \"v0beta1\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, newPackageVersion(0, StabilityLevelTest, 0, 0, \"\"), true, \"v0test\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, newPackageVersion(0, StabilityLevelTest, 0, 0, \"foo\"), true, \"v0testfoo\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1alpha0\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1beta0\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1p0alpha1\", WithAllowV0())\n\ttestNewPackageVersionForComponent(t, nil, false, \"v1p0beta1\", WithAllowV0())\n}\n\nfunc testNewPackageVersionForPackage(t *testing.T, expectedPackageVersion PackageVersion, expectedOK bool, pkg string, options ...PackageVersionOption) {\n\tpackageVersion, ok := NewPackageVersionForPackage(pkg, options...)\n\tassert.Equal(t, expectedOK, ok, pkg)\n\tif expectedOK {\n\t\trequire.NotNil(t, packageVersion)\n\t\tassert.Equal(t, expectedPackageVersion, packageVersion, pkg)\n\t\tsplit := strings.Split(pkg, \".\")\n\t\tassert.Equal(t, split[len(split)-1], packageVersion.String(), pkg)\n\t} else {\n\t\tassert.Nil(t, packageVersion)\n\t}\n}\n\nfunc testNewPackageVersionForComponent(t *testing.T, expectedPackageVersion PackageVersion, expectedOK bool, component string, options ...PackageVersionOption) {\n\tpackageVersion, ok := NewPackageVersionForComponent(component, options...)\n\tassert.Equal(t, expectedOK, ok, component)\n\tif expectedOK {\n\t\tassert.Equal(t, expectedPackageVersion, packageVersion, component)\n\t\tassert.Equal(t, component, packageVersion.String(), component)\n\t} else {\n\t\tassert.Nil(t, packageVersion)\n\t}\n}\n"
  },
  {
    "path": "private/pkg/protoversion/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage protoversion\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/refcount/refcount.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 refcount provides utilities for working with reference-counted objects.\n//\n// Why would you need refcounting in a language that already has GC? The GC\n// can't always tell that all references to some object are gone. For example,\n// suppose that we have a map[string]*T for looking up values based on some\n// string key, but we want to evict elements of that map if no structure holds\n// the key to it anymore. Doing this correctly requires a separately managed\n// refcount. For this, you would use [refcount.Map].\npackage refcount\n\nimport \"sync\"\n\n// Map is a map from keys of type K to values of type *V.\n//\n// Unlike a built-in map, refcount.Map allows for a key to be inserted multiple\n// times concurrently, and deleted multiple times. A key that is inserted n times\n// will only be evicted from the map once it is deleted n times.\n//\n// A zero map is empty and ready to use. Like other Go concurrency primitives, it\n// must not be copied after first use.\n//\n// recount.Map is thread-safe: insertions synchronize-before deletions.\ntype Map[K comparable, V any] struct {\n\tlock  sync.RWMutex\n\ttable map[K]*counted[V]\n}\n\n// Insert inserts a key into the map.\n//\n// If the value is already present in the map, its count is incremented by one;\n// otherwise, the zero value is inserted and returned. This function returns whether\n// an existing entry was found.\n//\n// The returned pointer is never nil.\nfunc (m *Map[K, V]) Insert(key K) (value *V, found bool) {\n\t// NOTE: By replacing counted[V].count with an atomic.Int64, this\n\t// can be downgraded to a read lock, with an upgrade only in the case\n\t// we are inserting a new entry.\n\t//\n\t// This optimization is not performed in the name of expediency, I have\n\t// only recorded it as potential future work\n\tm.lock.Lock()\n\tdefer m.lock.Unlock()\n\n\tif m.table == nil {\n\t\tm.table = make(map[K]*counted[V])\n\t}\n\n\tv, found := m.table[key]\n\tif !found {\n\t\tv = &counted[V]{}\n\t\tm.table[key] = v\n\t}\n\tv.count++\n\treturn &v.value, found\n}\n\n// Get looks up a key in the map.\n//\n// This is identical to ordinary map lookup: if they key is not present, it does not\n// insert and returns nil.\nfunc (m *Map[K, V]) Get(key K) *V {\n\tm.lock.RLock()\n\tdefer m.lock.RUnlock()\n\tvalue := m.table[key]\n\tif value == nil {\n\t\treturn nil\n\t}\n\treturn &value.value\n}\n\n// Range ranges over this map. Beware! While ranging, writes to the map will block.\n//\n// This implements [iter.Seq2] for Map[K, V].\nfunc (m *Map[K, V]) Range(yield func(k K, v *V) bool) {\n\tm.lock.RLock()\n\tdefer m.lock.RUnlock()\n\n\tfor k, v := range m.table {\n\t\tif !yield(k, &v.value) {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\n// Delete deletes a key from the map.\n//\n// The key will only be evicted once [Map.Delete] has been called an equal number of times\n// to prior calls to [Map.Insert] for this key.\n//\n// If the key is present and was actually evicted, the element it maps to is returned. Otherwise,\n// this function returns nil.\nfunc (m *Map[K, V]) Delete(key K) *V {\n\tm.lock.Lock()\n\tdefer m.lock.Unlock()\n\n\tv := m.table[key]\n\tif v == nil {\n\t\treturn nil\n\t}\n\n\tv.count--\n\tif v.count > 0 {\n\t\treturn nil\n\t}\n\n\tdelete(m.table, key)\n\treturn &v.value\n}\n\n// counted is a reference-counted value.\ntype counted[T any] struct {\n\tcount int32 // Protected by Map.lock.\n\tvalue T\n}\n"
  },
  {
    "path": "private/pkg/refcount/refcount_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 refcount\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestMap(t *testing.T) {\n\tt.Parallel()\n\n\ttable := &Map[string, int]{}\n\n\tvalue, found := table.Insert(\"foo\")\n\tassert.Equal(t, *value, 0)\n\tassert.Equal(t, found, false)\n\t*value = 42\n\n\tvalue, found = table.Insert(\"foo\")\n\tassert.Equal(t, *value, 42)\n\tassert.Equal(t, found, true)\n\n\tassert.Equal(t, *table.Get(\"foo\"), 42)\n\tassert.Nil(t, table.Get(\"bar\"))\n\n\tassert.Nil(t, table.Delete(\"foo\"))\n\tassert.Equal(t, *table.Delete(\"foo\"), 42)\n}\n"
  },
  {
    "path": "private/pkg/refcount/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage refcount\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/shake256/shake256.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 shake256 provides simple utilities around shake256 digests.\npackage shake256\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"slices\"\n\n\t\"golang.org/x/crypto/sha3\"\n)\n\nconst shake256Length = 64\n\n// Digest is a shake256 digest.\ntype Digest interface {\n\tValue() []byte\n\n\tisDigest()\n}\n\n// NewDigest returns a new Digest for the value.\nfunc NewDigest(value []byte) (Digest, error) {\n\treturn newDigest(value)\n}\n\n// NewDigestForContent returns a new Digest for the content read from the Reader.\nfunc NewDigestForContent(reader io.Reader) (Digest, error) {\n\tshakeHash := sha3.NewShake256()\n\t// TODO FUTURE: remove in the future, this should have no effect\n\tshakeHash.Reset()\n\tif _, err := io.Copy(shakeHash, reader); err != nil {\n\t\treturn nil, err\n\t}\n\tvalue := make([]byte, shake256Length)\n\tif _, err := shakeHash.Read(value); err != nil {\n\t\t// sha3.ShakeHash never errors or short reads. Something horribly wrong\n\t\t// happened if your computer ended up here.\n\t\treturn nil, err\n\t}\n\treturn newDigest(value)\n}\n\n// *** PRIVATE ***\n\ntype digest struct {\n\tvalue []byte\n}\n\nfunc newDigest(value []byte) (*digest, error) {\n\tif len(value) != shake256Length {\n\t\treturn nil, fmt.Errorf(\"invalid shake256 digest value: expected %d bytes, got %d\", shake256Length, len(value))\n\t}\n\treturn &digest{\n\t\tvalue: value,\n\t}, nil\n}\n\nfunc (d *digest) Value() []byte {\n\treturn slices.Clone(d.value)\n}\n\nfunc (*digest) isDigest() {}\n"
  },
  {
    "path": "private/pkg/shake256/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage shake256\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/slogapp/console.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 slogapp\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\t\"os\"\n\t\"sync\"\n\n\t\"github.com/mattn/go-colorable\"\n\t\"golang.org/x/term\"\n)\n\nconst (\n\t// color codes for ANSI escape sequences.\n\tcolorBlack color = iota + 30\n\tcolorRed\n\tcolorGreen\n\tcolorYellow\n\tcolorBlue\n\tcolorMagenta\n\tcolorCyan\n\tcolorWhite\n\n\t// consoleSeparator is the separator used in console output.\n\tconsoleSeparator = \"\\t\"\n)\n\n// color represents an ANSI color code.\ntype color uint8\n\ntype consoleHandlerOption func(*consoleHandlerOptions)\n\n// withConsoleColor explicitly enables or disables color output, bypassing TTY detection.\n// Without this option, color is enabled only if the writer is a TTY.\n//\n// If the environment variable NO_COLOR is set, colors will be disabled regardless of this setting.\nfunc withConsoleColor(enable bool) consoleHandlerOption {\n\treturn func(options *consoleHandlerOptions) {\n\t\toptions.enableColor = enable\n\t\toptions.colorExplicit = true\n\t}\n}\n\ntype consoleHandlerOptions struct {\n\tenableColor   bool\n\tcolorExplicit bool\n}\n\nfunc newConsoleHandlerOptions() *consoleHandlerOptions {\n\treturn &consoleHandlerOptions{}\n}\n\n// consoleHandler is a custom slog.Handler that formats log messages for the console.\ntype consoleHandler struct {\n\tenableColor bool\n\tout         io.Writer\n\tlock        *sync.Mutex   // Lock protects access to the buffer.\n\tbuffer      *bytes.Buffer // Buffer output for the delegate's writer.\n\tdelegate    slog.Handler  // Delegate writes to buffer.\n}\n\n// newConsoleHandler creates a new consoleHandler with the specified output writer and log level.\n//\n// It pretty prints the level (optionally with color) and message with JSON encoded attributes.\n// It wraps the output writer with colorable if it's os.Stdout or os.Stderr to support color output on Windows.\n// It logs attributes formatted using the slog.JSONHandler as a delegate.\n// It uses a mutex to synchronize access to the output. Not suitable for high-throughput logging.\nfunc newConsoleHandler(out io.Writer, logLevel slog.Level, options ...consoleHandlerOption) *consoleHandler {\n\tconsoleHandlerOptions := newConsoleHandlerOptions()\n\tfor _, option := range options {\n\t\toption(consoleHandlerOptions)\n\t}\n\t// If color was not explicitly set, auto-detect based on whether the writer is a TTY.\n\tenableColor := consoleHandlerOptions.enableColor\n\tif !consoleHandlerOptions.colorExplicit {\n\t\tenableColor = isWriterTTY(out)\n\t}\n\t// NO_COLOR always wins.\n\tif os.Getenv(\"NO_COLOR\") != \"\" {\n\t\tenableColor = false\n\t}\n\t// Wrap the output writer with colorable if it's os.Stdout or os.Stderr\n\t// to support color output on Windows.\n\tif enableColor && (out == os.Stderr || out == os.Stdout) {\n\t\tfile, _ := out.(*os.File)\n\t\tout = colorable.NewColorable(file)\n\t}\n\t// A delegate handler is used to format the log attributes.\n\t// It uses a buffer to accumulate the log attributes before writing them to the output.\n\t// The buffer is protected by the lock.\n\tvar (\n\t\tlock   sync.Mutex\n\t\tbuffer bytes.Buffer\n\t)\n\tdelegateHandler := slog.NewJSONHandler(&buffer, &slog.HandlerOptions{\n\t\tLevel:       logLevel,\n\t\tReplaceAttr: consoleReplaceAttr,\n\t})\n\treturn &consoleHandler{\n\t\tenableColor: enableColor,\n\t\tout:         out,\n\t\tlock:        &lock,\n\t\tbuffer:      &buffer,\n\t\tdelegate:    delegateHandler,\n\t}\n}\n\n// Enabled implements the slog.Handler interface.\nfunc (c *consoleHandler) Enabled(ctx context.Context, level slog.Level) bool {\n\treturn c.delegate.Enabled(ctx, level)\n}\n\n// Handle implements the slog.Handler interface.\nfunc (c *consoleHandler) Handle(ctx context.Context, r slog.Record) error {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\tc.buffer.Reset()\n\tif c.enableColor {\n\t\tc.buffer.WriteString(colorize(r.Level.String(), getColor(r.Level)))\n\t} else {\n\t\tc.buffer.WriteString(r.Level.String())\n\t}\n\tc.buffer.WriteString(consoleSeparator)\n\tc.buffer.WriteString(r.Message)\n\tbufN := c.buffer.Len()\n\tc.buffer.WriteString(consoleSeparator)\n\t// Delegate must always be called, as it may have attributes to write.\n\tif err := c.delegate.Handle(ctx, r); err != nil {\n\t\treturn err\n\t}\n\tif c.buffer.Len() == bufN+len(consoleSeparator+\"{}\\n\") {\n\t\t// No attributes to write, trim the buffer to remove the empty JSON object.\n\t\tc.buffer.Truncate(bufN)\n\t\tc.buffer.WriteByte('\\n')\n\t}\n\t_, err := c.buffer.WriteTo(c.out)\n\treturn err\n}\n\n// WithAttrs implements the slog.Handler interface.\nfunc (c *consoleHandler) WithAttrs(attrs []slog.Attr) slog.Handler {\n\treturn c.cloneWithDelegate(c.delegate.WithAttrs(attrs))\n}\n\n// WithGroup implements the slog.Handler interface.\nfunc (c *consoleHandler) WithGroup(name string) slog.Handler {\n\treturn c.cloneWithDelegate(c.delegate.WithGroup(name))\n}\n\n// cloneWithDelegate creates a new consoleHandler with a new delegate handler.\nfunc (c *consoleHandler) cloneWithDelegate(delegate slog.Handler) *consoleHandler {\n\treturn &consoleHandler{\n\t\tenableColor: c.enableColor,\n\t\tdelegate:    delegate,\n\t\tout:         c.out,\n\t\tlock:        c.lock,\n\t\tbuffer:      c.buffer,\n\t}\n}\n\n// getColor returns the color code for the specified log level.\nfunc getColor(level slog.Level) color {\n\tswitch {\n\tcase level >= slog.LevelError:\n\t\treturn colorRed\n\tcase level >= slog.LevelWarn:\n\t\treturn colorYellow\n\tcase level >= slog.LevelInfo:\n\t\treturn colorBlue\n\tcase level >= slog.LevelDebug:\n\t\treturn colorMagenta\n\tdefault:\n\t\treturn 0\n\t}\n}\n\n// colorize formats the string with the specified color.\nfunc colorize(s string, color color) string {\n\tif color == 0 {\n\t\treturn s\n\t}\n\treturn fmt.Sprintf(\"\\x1b[%dm%s\\x1b[0m\", color, s)\n}\n\n// isWriterTTY checks if the given writer is connected to a TTY.\n// It tries to extract a file descriptor from the writer and check if it's a terminal.\nfunc isWriterTTY(w io.Writer) bool {\n\ttype fdGetter interface {\n\t\tFd() uintptr\n\t}\n\tif fdOut, ok := w.(fdGetter); ok {\n\t\treturn term.IsTerminal(int(fdOut.Fd()))\n\t}\n\t// Can't determine, default to false (no TTY)\n\treturn false\n}\n\n// consoleReplaceAttr is a custom ReplaceAttr function for consoleHandler.\n// It silences the time, level, and message attributes to avoid duplication.\nfunc consoleReplaceAttr(groups []string, a slog.Attr) slog.Attr {\n\tswitch a.Key {\n\tcase slog.TimeKey, slog.LevelKey, slog.MessageKey:\n\t\treturn slog.Attr{}\n\tdefault:\n\t\treturn defaultReplaceAttr(groups, a)\n\t}\n}\n"
  },
  {
    "path": "private/pkg/slogapp/console_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 slogapp\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log/slog\"\n\t\"os\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestIsWriterTTY(t *testing.T) {\n\tt.Parallel()\n\n\t// A bytes.Buffer has no Fd method, so it's not a TTY.\n\tvar buf bytes.Buffer\n\tassert.False(t, isWriterTTY(&buf))\n\n\t// An os.Pipe is never a TTY even though it has an Fd method.\n\t_, w, err := os.Pipe()\n\trequire.NoError(t, err)\n\tt.Cleanup(func() { _ = w.Close() })\n\tassert.False(t, isWriterTTY(w))\n}\n\nfunc TestConsoleLogOutput(t *testing.T) {\n\tt.Parallel()\n\n\ttestConsolLogOutput(t, func(logger *slog.Logger) {\n\t\tlogger.Info(\"hello\", slog.String(\"a\", \"b\"))\n\t\tlogger.Info(\"hello world\")\n\t}, []map[string]any{{\n\t\tslog.LevelKey:   colorize(\"INFO\", getColor(slog.LevelInfo)),\n\t\tslog.MessageKey: \"hello\",\n\t\t\"a\":             \"b\",\n\t}, {\n\t\tslog.LevelKey:   colorize(\"INFO\", getColor(slog.LevelInfo)),\n\t\tslog.MessageKey: \"hello world\",\n\t}}, withConsoleColor(true))\n\n\ttestConsolLogOutput(t, func(logger *slog.Logger) {\n\t\tlogger.Info(\"info\", slog.String(\"a\", \"b\"))\n\t\tlogger.Error(\"error\")\n\t}, []map[string]any{{\n\t\tslog.LevelKey:   \"INFO\",\n\t\tslog.MessageKey: \"info\",\n\t\t\"a\":             \"b\",\n\t}, {\n\t\tslog.LevelKey:   \"ERROR\",\n\t\tslog.MessageKey: \"error\",\n\t}})\n\n\ttestConsolLogOutput(t, func(logger *slog.Logger) {\n\t\tlogger = logger.With(slog.String(\"a\", \"b\"))\n\t\tlogger = logger.WithGroup(\"g\")\n\t\tlogger.Error(\"error message\", slog.String(\"c\", \"d\"))\n\t\tlogger.Info(\"info message\")\n\t\tlogger.Debug(\"debuf message\", slog.String(\"c\", \"d\"))\n\t}, []map[string]any{{\n\t\tslog.LevelKey:   colorize(\"ERROR\", getColor(slog.LevelError)),\n\t\tslog.MessageKey: \"error message\",\n\t\t\"a\":             \"b\",\n\t\t\"g\": map[string]any{\n\t\t\t\"c\": \"d\",\n\t\t},\n\t}, {\n\t\tslog.LevelKey:   colorize(\"INFO\", getColor(slog.LevelInfo)),\n\t\tslog.MessageKey: \"info message\",\n\t\t\"a\":             \"b\",\n\t}}, withConsoleColor(true))\n\n\ttestConsolLogOutput(t, func(logger *slog.Logger) {\n\t\tlogger.Info(\"key spaces\", slog.String(\"a key\", \"with spaces\"))\n\t}, []map[string]any{{\n\t\tslog.LevelKey:   colorize(\"INFO\", getColor(slog.LevelInfo)),\n\t\tslog.MessageKey: \"key spaces\",\n\t\t\"a key\":         \"with spaces\",\n\t}}, withConsoleColor(true))\n}\n\nfunc testConsolLogOutput(t *testing.T, run func(logger *slog.Logger), expects []map[string]any, options ...consoleHandlerOption) {\n\tt.Helper()\n\tvar buf bytes.Buffer\n\tconsoleHandler := newConsoleHandler(&buf, slog.LevelInfo, options...)\n\tlogger := slog.New(consoleHandler)\n\trun(logger)\n\n\tvar outputs []map[string]any\n\tfor line := range bytes.SplitSeq(buf.Bytes(), []byte{'\\n'}) {\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tlineAttrs, err := testParseLogLine(line)\n\t\tif !assert.NoError(t, err) {\n\t\t\tcontinue\n\t\t}\n\t\toutputs = append(outputs, lineAttrs)\n\t}\n\tt.Log(buf.String())\n\trequire.Equal(t, len(expects), len(outputs))\n\tfor i := range len(outputs) {\n\t\toutput, expect := outputs[i], expects[i]\n\t\tassert.Equal(t, expect, output)\n\t}\n}\n\n// testParseLogLine passes the output of a single log line.\nfunc testParseLogLine(lineBytes []byte) (map[string]any, error) {\n\ttop := map[string]any{}\n\tline := string(bytes.TrimSpace(lineBytes))\n\tindex, line, _ := strings.Cut(line, consoleSeparator)\n\ttop[slog.LevelKey] = index\n\tif len(line) == 0 {\n\t\treturn top, nil\n\t}\n\tmessage, line := line, \"\"\n\t// Find the JSON attributes by looking for the first space followed by a '{'.\n\t// This may fail for complex messages but fine for testing.\n\tif jsonIndex := strings.Index(message, consoleSeparator+\"{\"); jsonIndex >= 0 {\n\t\tmessage, line = message[:jsonIndex], message[jsonIndex+1:]\n\t}\n\ttop[slog.MessageKey] = message\n\tif len(line) > 0 {\n\t\t// Capture the JSON attributes.\n\t\tvar attrs map[string]any\n\t\tif err := json.Unmarshal([]byte(line), &attrs); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to unmarshal JSON attrs: %w\", err)\n\t\t}\n\t\t// Merge the JSON attributes into the top-level map.\n\t\tfor key, value := range attrs {\n\t\t\tif _, ok := top[key]; ok {\n\t\t\t\treturn nil, fmt.Errorf(\"duplicate key %q in JSON attributes\", key)\n\t\t\t}\n\t\t\ttop[key] = value\n\t\t}\n\t}\n\treturn top, nil\n}\n"
  },
  {
    "path": "private/pkg/slogapp/slogapp.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 slogapp builds slog.Loggers.\npackage slogapp\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log/slog\"\n\n\t\"buf.build/go/app/appext\"\n)\n\n// LoggerProvider is an appext.LoggerProvider for use with appext.BuilderWithLoggerProvider.\nfunc LoggerProvider(container appext.NameContainer, logLevel appext.LogLevel, logFormat appext.LogFormat) (*slog.Logger, error) {\n\treturn NewLogger(container.Stderr(), logLevel, logFormat)\n}\n\n// NewLogger returns a new Logger for the given level and format.\nfunc NewLogger(writer io.Writer, logLevel appext.LogLevel, logFormat appext.LogFormat) (*slog.Logger, error) {\n\thandler, err := getHandler(writer, logLevel, logFormat)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn slog.New(handler), nil\n}\n\nfunc getLevel(logLevel appext.LogLevel) (slog.Level, error) {\n\tswitch logLevel {\n\tcase appext.LogLevelDebug:\n\t\treturn slog.LevelDebug, nil\n\tcase appext.LogLevelInfo:\n\t\treturn slog.LevelInfo, nil\n\tcase appext.LogLevelWarn:\n\t\treturn slog.LevelWarn, nil\n\tcase appext.LogLevelError:\n\t\treturn slog.LevelError, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"invalid level %v\", logLevel)\n\t}\n}\n\nfunc getHandler(writer io.Writer, logLevel appext.LogLevel, logFormat appext.LogFormat) (slog.Handler, error) {\n\tlevel, err := getLevel(logLevel)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tswitch logFormat {\n\tcase appext.LogFormatJSON:\n\t\treturn slog.NewJSONHandler(writer, &slog.HandlerOptions{\n\t\t\tLevel:       level,\n\t\t\tReplaceAttr: defaultReplaceAttr,\n\t\t}), nil\n\tcase appext.LogFormatText:\n\t\t// Use a custom console handler that formats log messages in a human-readable format.\n\t\treturn newConsoleHandler(writer, level, withConsoleColor(false)), nil\n\tcase appext.LogFormatColor:\n\t\t// Use a custom console handler that formats log messages in a human-readable format.\n\t\t// Color is enabled automatically if the writer is a TTY.\n\t\treturn newConsoleHandler(writer, level), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"invalid logFormat: %v\", logFormat)\n\t}\n}\n\n// defaultReplaceAttr provides a default ReplaceAttr func for [slog.HandlerOptions].\nfunc defaultReplaceAttr(groups []string, a slog.Attr) slog.Attr {\n\t// Make all Duration type values more useful by converting to their default String\n\t// representation, instead of using an integer number of nanoseconds.\n\tif a.Value.Kind() == slog.KindDuration {\n\t\ta.Value = slog.StringValue(a.Value.Duration().String())\n\t}\n\treturn a\n}\n"
  },
  {
    "path": "private/pkg/slogapp/slogapp_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 slogapp\n\nimport (\n\t\"encoding/json\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appext\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestNoStack(t *testing.T) {\n\tt.Parallel()\n\tvar sb strings.Builder\n\tlogger, err := NewLogger(&sb, appext.LogLevelInfo, appext.LogFormatJSON)\n\trequire.NoError(t, err)\n\tlogger.Error(\"boom\")\n\tvar logFields map[string]any\n\terr = json.Unmarshal([]byte(sb.String()), &logFields)\n\trequire.NoError(t, err)\n\tassert.NotContains(t, logFields, \"stacktrace\")\n}\n"
  },
  {
    "path": "private/pkg/slogapp/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage slogapp\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/slogtestext/slogtestext.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 slogtestext provides Loggers for testing.\npackage slogtestext\n\nimport (\n\t\"log/slog\"\n\t\"testing\"\n\n\t\"buf.build/go/app/appext\"\n\t\"github.com/bufbuild/buf/private/pkg/slogapp\"\n\t\"github.com/stretchr/testify/require\"\n)\n\n// NewLogger returns a new Logger for testing.\nfunc NewLogger(t testing.TB, options ...LoggerOption) *slog.Logger {\n\tloggerOptions := newLoggerOptions()\n\tfor _, option := range options {\n\t\toption(loggerOptions)\n\t}\n\tlogger, err := slogapp.NewLogger(t.Output(), loggerOptions.logLevel, appext.LogFormatText)\n\trequire.NoError(t, err)\n\treturn logger\n}\n\n// LoggerOption is an option for a new testing Logger.\ntype LoggerOption func(*loggerOptions)\n\n// WithLogLevel specifies the LogLevel to use for the Logger.\n//\n// The default is appext.LogLevelDebug.\nfunc WithLogLevel(logLevel appext.LogLevel) LoggerOption {\n\treturn func(loggerOptions *loggerOptions) {\n\t\tloggerOptions.logLevel = logLevel\n\t}\n}\n\n// *** PRIVATE ***\n\ntype loggerOptions struct {\n\tlogLevel appext.LogLevel\n}\n\nfunc newLoggerOptions() *loggerOptions {\n\treturn &loggerOptions{\n\t\tlogLevel: appext.LogLevelDebug,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/slogtestext/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage slogtestext\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/bucket.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"io\"\n)\n\n// ReadBucket is a simple read-only bucket.\n//\n// All paths are regular files - Buckets do not handle directories.\n// All paths must be relative.\n// All paths are cleaned and ToSlash'ed by each function.\n// Paths must not jump the bucket context, that is after clean, they\n// cannot contain \"..\".\ntype ReadBucket interface {\n\t// Get gets the path.\n\t//\n\t// The behavior of concurrently Getting and Putting an object is undefined.\n\t// The returned ReadObjectCloser is not thread-safe.\n\t//\n\t// Returns ErrNotExist if the path does not exist, other error\n\t// if there is a system error.\n\tGet(ctx context.Context, path string) (ReadObjectCloser, error)\n\t// Stat gets info in the object.\n\t//\n\t// Returns ErrNotExist if the path does not exist, other error\n\t// if there is a system error.\n\tStat(ctx context.Context, path string) (ObjectInfo, error)\n\t// Walk walks the bucket with the prefix, calling f on each path.\n\t// If the prefix doesn't exist, this is a no-op.\n\t//\n\t// Note that foo/barbaz will not be called for foo/bar, but will\n\t// be called for foo/bar/baz.\n\t//\n\t// Note that a prefix can also be equal to a path in the bucket, in which\n\t// case Walk will walk this single file. That is, if file a/b/c.txt is in\n\t// the bucket, Walk(ctx, \"a/b/c.txt\", ...) will result in a single iteration,\n\t// calling f on the file \"a/b/c.txt\".\n\t//\n\t// All paths given to f are normalized and validated.\n\t// If f returns error, Walk will stop short and return this error.\n\t// Returns other error on system error.\n\tWalk(ctx context.Context, prefix string, f func(ObjectInfo) error) error\n}\n\n// WriteBucket is a write-only bucket.\ntype WriteBucket interface {\n\t// Put returns a WriteObjectCloser to write to the path.\n\t//\n\t// The path is truncated on close.\n\t// The behavior of concurrently Getting and Putting an object is undefined.\n\t// The returned WriteObjectCloser is not thread-safe.\n\t//\n\t// Note that an object may appear via Get and Stat calls before the WriteObjectCloser\n\t// has closed. To guarantee that an object will only appear once the WriteObjectCloser\n\t// is closed, pass PutWithAtomic.\n\t//\n\t// Returns error on system error.\n\tPut(ctx context.Context, path string, options ...PutOption) (WriteObjectCloser, error)\n\t// Delete deletes the object at the path.\n\t//\n\t// Returns ErrNotExist if the path does not exist, other error\n\t// if there is a system error.\n\tDelete(ctx context.Context, path string) error\n\t// DeleteAll deletes all objects with the prefix.\n\t// If the prefix doesn't exist, this is a no-op.\n\t//\n\t// Note that the prefix is used as a filepath prefix, and\n\t// NOT a string prefix. For example, the prefix \"foo/bar\"\n\t// will delete \"foo/bar/baz\", but NOT \"foo/barbaz\".\n\tDeleteAll(ctx context.Context, prefix string) error\n\t// SetExternalAndLocalPathsSupported returns true if SetExternalPath and SetLocalPath are supported.\n\t//\n\t// For example, in-memory buckets may choose to return true so that object sources\n\t// are preserved, but filesystem buckets may choose to return false as they have\n\t// their own external paths.\n\tSetExternalAndLocalPathsSupported() bool\n}\n\n// ReadWriteBucket is a simple read/write bucket.\ntype ReadWriteBucket interface {\n\tReadBucket\n\tWriteBucket\n}\n\n// ReadBucketCloser is a read-only bucket that must be closed.\ntype ReadBucketCloser interface {\n\tio.Closer\n\tReadBucket\n}\n\n// NopReadBucketCloser returns a ReadBucketCloser for the ReadBucket.\nfunc NopReadBucketCloser(readBucket ReadBucket) ReadBucketCloser {\n\treturn nopReadBucketCloser{readBucket}\n}\n\n// WriteBucketCloser is a write-only bucket that must be closed.\ntype WriteBucketCloser interface {\n\tio.Closer\n\tWriteBucket\n}\n\n// NopWriteBucketCloser returns a WriteBucketCloser for the WriteBucket.\nfunc NopWriteBucketCloser(writeBucket WriteBucket) WriteBucketCloser {\n\treturn nopWriteBucketCloser{writeBucket}\n}\n\n// ReadWriteBucketCloser is a read/write bucket that must be closed.\ntype ReadWriteBucketCloser interface {\n\tio.Closer\n\tReadWriteBucket\n}\n\n// NopReadWriteBucketCloser returns a ReadWriteBucketCloser for the ReadWriteBucket.\nfunc NopReadWriteBucketCloser(readWriteBucket ReadWriteBucket) ReadWriteBucketCloser {\n\treturn nopReadWriteBucketCloser{readWriteBucket}\n}\n\n// ObjectInfo contains object info.\n//\n// An ObjectInfo will always be the same for a given path within a given Bucket,\n// that is an ObjectInfo is cacheable for a given Bucket.\ntype ObjectInfo interface {\n\t// Path is the path of the object.\n\t//\n\t// This will always correspond to a path within the Bucket. For sub-buckets, this is the sub-path, but the\n\t// external path will include the sub-bucket path.\n\t//\n\t// This path will always be normalized, validated, and non-empty.\n\tPath() string\n\t// ExternalPath is the path that identifies the object externally.\n\t//\n\t// This path is not necessarily a file path, and should only be used to\n\t// uniquely identify this file as compared to other assets, to for display\n\t// to users.\n\t//\n\t// The path will be unnormalized, if it is a file path.\n\t// The path will never be empty. If a given implementation has no external path, this falls back to path.\n\t//\n\t// Example:\n\t//   Directory: /foo/bar\n\t//   Path: baz/bat.proto\n\t//   ExternalPath: /foo/bar/baz/bat.proto\n\t//\n\t// Example:\n\t//   Directory: .\n\t//   Path: baz/bat.proto\n\t//   ExternalPath: baz/bat.proto\n\t//\n\t// Example:\n\t//   S3 Bucket: https://s3.amazonaws.com/foo\n\t//   Path: baz/bat.proto\n\t//   ExternalPath: s3://foo/baz/bat.proto\n\tExternalPath() string\n\n\t// LocalPath is the path on disk of the object, if the object originated from a local disk.\n\t//\n\t// This will be unnormalized if present.\n\t//\n\t// Will not be present if the path did not originate from disk. For example, objects that originated\n\t// from archives, git repositories, or object stores will not have this present.\n\tLocalPath() string\n}\n\n// ReadObject is an object read from a bucket.\ntype ReadObject interface {\n\tObjectInfo\n\tio.Reader\n}\n\n// ReadObjectCloser is a ReadObject with a closer.\n//\n// It must be closed when done.\ntype ReadObjectCloser interface {\n\tReadObject\n\tio.Closer\n}\n\n// WriteObject object written to a bucket.\ntype WriteObject interface {\n\tio.Writer\n\n\t// SetExternalPath attempts to explicitly set the external path for the new object.\n\t//\n\t// If SetExternalAndLocalPathsSupported returns false, this returns error.\n\tSetExternalPath(externalPath string) error\n\t// SetLocalPath attempts to explicitly set the local path for the new object.\n\t//\n\t// If SetExternalAndLocalPathsSupported  returns false, this returns  error.\n\tSetLocalPath(localPath string) error\n}\n\n// WriteObjectCloser is a WriteObject with a closer.\n//\n// It must be closed when done.\ntype WriteObjectCloser interface {\n\tWriteObject\n\tio.Closer\n}\n\n// PutOptions are the possible options that can be passed to a Put operation.\ntype PutOptions interface {\n\t// Atomic ensures that the Put fully writes the file before making it\n\t// available to readers. This happens by default for some implementations,\n\t// while others may need to perform a sequence of operations to ensure\n\t// atomic writes.\n\t//\n\t// The Put operation is complete and the path will be readable once the\n\t// returned WriteObjectCloser is written and closed (without an error).\n\t// Any errors will cause the Put to be skipped (no path will be created).\n\tAtomic() bool\n\t// SuggestedDisableChunking says to suggest disable chunking entirely.\n\t//\n\t// If SuggestedChunkSize() > 0, this will always be false.\n\t//\n\t// This is a suggestion, implementations may choose to ignore this option.\n\tSuggestedDisableChunking() bool\n\t// SuggestedChunkSize sets the given size in bytes as a suggested chunk\n\t// size to use by the Bucket implementation for this Put call.\n\t// Some implementations of Put allow multi-part upload, and allow customizing the\n\t// chunk size of each part upload, or even disabling multi-part upload.\n\t//\n\t// This is a suggestion, implementations may choose to ignore this option.\n\tSuggestedChunkSize() int\n\n\tisPutOptions()\n}\n\n// NewPutOptions returns a new PutOptions.\n//\n// This is used by Bucket implementations.\nfunc NewPutOptions(options []PutOption) PutOptions {\n\tputOptions := newPutOptions()\n\tfor _, option := range options {\n\t\toption(putOptions)\n\t}\n\treturn putOptions\n}\n\n// PutOption is an option passed when putting an object in a bucket.\ntype PutOption func(*putOptions)\n\n// PutWithSuggestedChunkSize sets the given size in bytes as a suggested chunk\n// size to use by the Bucket implementation for this Put call.\n// Some implementations of Put allow multi-part upload, and allow customizing the\n// chunk size of each part upload, or even disabling multi-part upload.\n//\n// Setting a suggestedChunkSize of 0 says to suggest disable chunking\n// Negative values will be ignored.\n//\n// This is a suggestion, implementations may choose to ignore this option.\nfunc PutWithSuggestedChunkSize(suggestedChunkSize int) PutOption {\n\treturn func(putOptions *putOptions) {\n\t\tif suggestedChunkSize < 0 {\n\t\t\treturn\n\t\t}\n\t\tputOptions.suggestedChunkSize = &suggestedChunkSize\n\t}\n}\n\n// PutWithAtomic ensures that the Put fully writes the file before making it\n// available to readers. This happens by default for some implementations,\n// while others may need to perform a sequence of operations to ensure\n// atomic writes.\n//\n// The Put operation is complete and the path will be readable once the\n// returned WriteObjectCloser is written and closed (without an error).\n// Any errors will cause the Put to be skipped (no path will be created).\nfunc PutWithAtomic() PutOption {\n\treturn func(putOptions *putOptions) {\n\t\tputOptions.atomic = true\n\t}\n}\n\ntype nopReadBucketCloser struct {\n\tReadBucket\n}\n\nfunc (nopReadBucketCloser) Close() error {\n\treturn nil\n}\n\ntype nopWriteBucketCloser struct {\n\tWriteBucket\n}\n\nfunc (nopWriteBucketCloser) Close() error {\n\treturn nil\n}\n\ntype nopReadWriteBucketCloser struct {\n\tReadWriteBucket\n}\n\nfunc (nopReadWriteBucketCloser) Close() error {\n\treturn nil\n}\n\ntype putOptions struct {\n\tatomic             bool\n\tsuggestedChunkSize *int\n}\n\nfunc newPutOptions() *putOptions {\n\treturn &putOptions{}\n}\n\nfunc (p *putOptions) Atomic() bool {\n\treturn p.atomic\n}\n\nfunc (p *putOptions) SuggestedDisableChunking() bool {\n\treturn p.suggestedChunkSize != nil && *p.suggestedChunkSize == 0\n}\n\nfunc (p *putOptions) SuggestedChunkSize() int {\n\tif p.suggestedChunkSize == nil {\n\t\treturn 0\n\t}\n\treturn *p.suggestedChunkSize\n}\n\nfunc (*putOptions) isPutOptions() {}\n"
  },
  {
    "path": "private/pkg/storage/cmd/ddiff/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main implements the ddiff command that diffs two directories.\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n)\n\nconst (\n\tuse = \"ddiff\"\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\treturn &appcmd.Command{\n\t\tUse:  use + \" dir1 dir2\",\n\t\tArgs: appcmd.ExactArgs(2),\n\t\tRun:  run,\n\t}\n}\n\nfunc run(ctx context.Context, container app.Container) error {\n\toneDirPath := filepath.Clean(container.Arg(0))\n\ttwoDirPath := filepath.Clean(container.Arg(1))\n\toneReadWriteBucket, err := storageos.NewProvider(storageos.ProviderWithSymlinks()).NewReadWriteBucket(oneDirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\ttwoReadWriteBucket, err := storageos.NewProvider(storageos.ProviderWithSymlinks()).NewReadWriteBucket(twoDirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar oneExternalPathPrefix string\n\tif oneDirPath != \".\" {\n\t\toneExternalPathPrefix = oneDirPath + string(os.PathSeparator)\n\t}\n\tvar twoExternalPathPrefix string\n\tif twoDirPath != \".\" {\n\t\ttwoExternalPathPrefix = twoDirPath + string(os.PathSeparator)\n\t}\n\treturn storage.Diff(\n\t\tctx,\n\t\tcontainer.Stdout(),\n\t\toneReadWriteBucket,\n\t\ttwoReadWriteBucket,\n\t\tstorage.DiffWithExternalPaths(),\n\t\tstorage.DiffWithExternalPathPrefixes(\n\t\t\toneExternalPathPrefix,\n\t\t\ttwoExternalPathPrefix,\n\t\t),\n\t)\n}\n"
  },
  {
    "path": "private/pkg/storage/cmd/ddiff/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/cmd/storage-go-data/main.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"go/format\"\n\t\"io\"\n\t\"math\"\n\t\"path/filepath\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"buf.build/go/app\"\n\t\"buf.build/go/app/appcmd\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/spf13/pflag\"\n)\n\nconst (\n\tprogramName = \"storage-go-data\"\n\n\tpkgFlagName = \"package\"\n\n\tsliceLength = math.MaxInt64\n)\n\nfunc main() {\n\tappcmd.Main(context.Background(), newCommand())\n}\n\nfunc newCommand() *appcmd.Command {\n\tflags := newFlags()\n\treturn &appcmd.Command{\n\t\tUse:  fmt.Sprintf(\"%s path/to/dir\", programName),\n\t\tArgs: appcmd.ExactArgs(1),\n\t\tRun: func(ctx context.Context, container app.Container) error {\n\t\t\treturn run(ctx, container, flags)\n\t\t},\n\t\tBindFlags: flags.Bind,\n\t}\n}\n\ntype flags struct {\n\tPkg string\n}\n\nfunc newFlags() *flags {\n\treturn &flags{}\n}\n\nfunc (f *flags) Bind(flagSet *pflag.FlagSet) {\n\tflagSet.StringVar(\n\t\t&f.Pkg,\n\t\tpkgFlagName,\n\t\t\"\",\n\t\t\"The name of the generated package.\",\n\t)\n}\n\nfunc run(ctx context.Context, container app.Container, flags *flags) error {\n\tdirPath := container.Arg(0)\n\tpackageName := flags.Pkg\n\tif packageName == \"\" {\n\t\tpackageName = filepath.Base(dirPath)\n\t}\n\tpathToData, err := getPathToData(ctx, dirPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgolangFileData, err := getGolangFileData(pathToData, packageName)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = container.Stdout().Write(golangFileData)\n\treturn err\n}\n\nfunc getPathToData(ctx context.Context, dirPath string) (map[string][]byte, error) {\n\treadWriteBucket, err := storageos.NewProvider(storageos.ProviderWithSymlinks()).NewReadWriteBucket(dirPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpathToData := make(map[string][]byte)\n\tif err := storage.WalkReadObjects(\n\t\tctx,\n\t\treadWriteBucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdata, err := io.ReadAll(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tpathToData[readObject.Path()] = data\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn pathToData, nil\n}\n\nfunc getGolangFileData(pathToData map[string][]byte, packageName string) ([]byte, error) {\n\tbuffer := bytes.NewBuffer(nil)\n\t_, _ = buffer.WriteString(`// Code generated by `)\n\t_, _ = buffer.WriteString(programName)\n\t_, _ = buffer.WriteString(`. DO NOT EDIT.\n\npackage `)\n\t_, _ = buffer.WriteString(packageName)\n\t_, _ = buffer.WriteString(`\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\nvar (\n\t// ReadBucket is the storage.ReadBucket with the static data generated for this package.\n\tReadBucket storage.ReadBucket\n\n\tpathToData = map[string][]byte{\n`)\n\n\tpaths := make([]string, 0, len(pathToData))\n\tfor path := range pathToData {\n\t\tpaths = append(paths, path)\n\t}\n\tsort.Strings(paths)\n\n\tfor _, path := range paths {\n\t\t_, _ = buffer.WriteString(`\"`)\n\t\t_, _ = buffer.WriteString(path)\n\t\t_, _ = buffer.WriteString(`\": {\n`)\n\t\tdata := pathToData[path]\n\t\tfor len(data) > 0 {\n\t\t\tn := min(sliceLength, len(data))\n\t\t\tvar accum strings.Builder\n\t\t\tfor _, elem := range data[:n] {\n\t\t\t\taccum.WriteString(fmt.Sprintf(\"0x%02x,\", elem))\n\t\t\t}\n\t\t\t_, _ = buffer.WriteString(accum.String())\n\t\t\t_, _ = buffer.WriteString(\"\\n\")\n\t\t\tdata = data[n:]\n\t\t}\n\t\t_, _ = buffer.WriteString(`},\n`)\n\t}\n\t_, _ = buffer.WriteString(`}\n)\n\nfunc init() {\n\treadBucket, err := storagemem.NewReadBucket(pathToData)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tReadBucket = readBucket\n}\n\n// Exists returns true if the given path exists in the static data.\n//\n// The path is normalized within this function.\nfunc Exists(path string) bool {\n\t_, ok := pathToData[normalpath.Normalize(path)]\n\treturn ok\n}\n`)\n\n\treturn format.Source(buffer.Bytes())\n}\n"
  },
  {
    "path": "private/pkg/storage/cmd/storage-go-data/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage main\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/copy.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"sync/atomic\"\n\n\t\"github.com/bufbuild/buf/private/pkg/thread\"\n)\n\n// Copy copies the bucket at from to the bucket at to.\n//\n// Copies done concurrently.\n// Returns the number of files copied.\nfunc Copy(\n\tctx context.Context,\n\tfrom ReadBucket,\n\tto WriteBucket,\n\toptions ...CopyOption,\n) (int, error) {\n\tcopyOptions := newCopyOptions()\n\tfor _, option := range options {\n\t\toption(copyOptions)\n\t}\n\treturn copyPaths(\n\t\tctx,\n\t\tfrom,\n\t\tto,\n\t\tcopyOptions.externalAndLocalPaths,\n\t\tcopyOptions.atomic,\n\t)\n}\n\n// CopyReadObject copies the contents of the ReadObject into the WriteBucket at the path.\nfunc CopyReadObject(\n\tctx context.Context,\n\twriteBucket WriteBucket,\n\treadObject ReadObject,\n\toptions ...CopyOption,\n) (retErr error) {\n\tcopyOptions := newCopyOptions()\n\tfor _, option := range options {\n\t\toption(copyOptions)\n\t}\n\treturn copyReadObject(\n\t\tctx,\n\t\treadObject,\n\t\twriteBucket,\n\t\treadObject.Path(),\n\t\tcopyOptions.externalAndLocalPaths,\n\t\tcopyOptions.atomic,\n\t)\n}\n\n// CopyReader copies the contents of the Reader into the WriteBucket at the path.\nfunc CopyReader(\n\tctx context.Context,\n\twriteBucket WriteBucket,\n\treader io.Reader,\n\tpath string,\n) (retErr error) {\n\twriteObjectCloser, err := writeBucket.Put(ctx, path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t}()\n\t_, err = io.Copy(writeObjectCloser, reader)\n\treturn err\n}\n\n// CopyPath copies the fromPath from the ReadBucket to the toPath on the WriteBucket.\nfunc CopyPath(\n\tctx context.Context,\n\tfrom ReadBucket,\n\tfromPath string,\n\tto WriteBucket,\n\ttoPath string,\n\toptions ...CopyOption,\n) error {\n\tcopyOptions := newCopyOptions()\n\tfor _, option := range options {\n\t\toption(copyOptions)\n\t}\n\treturn copyPath(\n\t\tctx,\n\t\tfrom,\n\t\tfromPath,\n\t\tto,\n\t\ttoPath,\n\t\tcopyOptions.externalAndLocalPaths,\n\t\tcopyOptions.atomic,\n\t)\n}\n\n// CopyOption is an option for Copy.\ntype CopyOption func(*copyOptions)\n\n// CopyWithExternalAndLocalPaths returns a new CopyOption that says to copy external and local paths.\n//\n// The to WriteBucket must support setting external and local paths.\nfunc CopyWithExternalAndLocalPaths() CopyOption {\n\treturn func(copyOptions *copyOptions) {\n\t\tcopyOptions.externalAndLocalPaths = true\n\t}\n}\n\n// CopyWithAtomic returns a new CopyOption that says to set PutWithAtomic when copying each file.\n//\n// See the documentation on PutWithAtomic for more details.\nfunc CopyWithAtomic() CopyOption {\n\treturn func(copyOptions *copyOptions) {\n\t\tcopyOptions.atomic = true\n\t}\n}\n\nfunc copyPaths(\n\tctx context.Context,\n\tfrom ReadBucket,\n\tto WriteBucket,\n\tcopyExternalAndLocalPaths bool,\n\tatomicOpt bool,\n) (int, error) {\n\tpaths, err := AllPaths(ctx, from, \"\")\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tvar count atomic.Int64\n\tjobs := make([]func(context.Context) error, len(paths))\n\tfor i, path := range paths {\n\t\tjobs[i] = func(ctx context.Context) error {\n\t\t\tif err := copyPath(ctx, from, path, to, path, copyExternalAndLocalPaths, atomicOpt); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tcount.Add(1)\n\t\t\treturn nil\n\t\t}\n\t}\n\terr = thread.Parallelize(ctx, jobs)\n\treturn int(count.Load()), err\n}\n\n// copyPath copies the path from the bucket at from to the bucket at to using the given paths.\n//\n// Paths will be normalized within this function.\nfunc copyPath(\n\tctx context.Context,\n\tfrom ReadBucket,\n\tfromPath string,\n\tto WriteBucket,\n\ttoPath string,\n\tcopyExternalAndLocalPaths bool,\n\tatomic bool,\n) (retErr error) {\n\treadObjectCloser, err := from.Get(ctx, fromPath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(err, readObjectCloser.Close())\n\t}()\n\treturn copyReadObject(ctx, readObjectCloser, to, toPath, copyExternalAndLocalPaths, atomic)\n}\n\nfunc copyReadObject(\n\tctx context.Context,\n\treadObject ReadObject,\n\tto WriteBucket,\n\ttoPath string,\n\tcopyExternalAndLocalPaths bool,\n\tatomic bool,\n) (retErr error) {\n\tvar putOptions []PutOption\n\tif atomic {\n\t\tputOptions = append(putOptions, PutWithAtomic())\n\t}\n\twriteObjectCloser, err := to.Put(ctx, toPath, putOptions...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t}()\n\tif copyExternalAndLocalPaths {\n\t\tif err := writeObjectCloser.SetExternalPath(readObject.ExternalPath()); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := writeObjectCloser.SetLocalPath(readObject.LocalPath()); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t_, err = io.Copy(writeObjectCloser, readObject)\n\treturn err\n}\n\ntype copyOptions struct {\n\texternalAndLocalPaths bool\n\tatomic                bool\n}\n\nfunc newCopyOptions() *copyOptions {\n\treturn &copyOptions{}\n}\n"
  },
  {
    "path": "private/pkg/storage/diff.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"fmt\"\n\t\"io\"\n\t\"sort\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/diff\"\n)\n\n// DiffOption is an option for Diff.\ntype DiffOption func(*diffOptions)\n\n// DiffWithSuppressCommands returns a new DiffOption that suppresses printing of commands.\nfunc DiffWithSuppressCommands() DiffOption {\n\treturn func(diffOptions *diffOptions) {\n\t\tdiffOptions.suppressCommands = true\n\t}\n}\n\n// DiffWithSuppressTimestamps returns a new DiffOption that suppresses printing of timestamps.\nfunc DiffWithSuppressTimestamps() DiffOption {\n\treturn func(diffOptions *diffOptions) {\n\t\tdiffOptions.suppressTimestamps = true\n\t}\n}\n\n// DiffWithExternalPaths returns a new DiffOption that prints diffs with external paths\n// instead of paths.\nfunc DiffWithExternalPaths() DiffOption {\n\treturn func(diffOptions *diffOptions) {\n\t\tdiffOptions.externalPaths = true\n\t}\n}\n\n// DiffWithExternalPathPrefixes returns a new DiffOption that sets the external path prefixes for the buckets.\n//\n// If a file is in one bucket but not the other, it will be assumed that the file begins\n// with the given prefix, and this prefix should be substituted for the other prefix.\n//\n// For example, if diffing the directories \"test/a\" and \"test/b\", use \"test/a/\" and \"test/b/\",\n// and a file that is in one with path \"test/a/foo.txt\" will be shown as not\n// existing as \"test/b/foo.txt\" in two.\n//\n// Note that the prefixes are directly concatenated, so \"/\" should be included generally.\n//\n// This option has no effect if DiffWithExternalPaths is not set.\n// This option is not required if the prefixes are equal.\nfunc DiffWithExternalPathPrefixes(\n\toneExternalPathPrefix string,\n\ttwoExternalPathPrefix string,\n) DiffOption {\n\treturn func(diffOptions *diffOptions) {\n\t\tif oneExternalPathPrefix != twoExternalPathPrefix {\n\t\t\t// we don't know if external paths are file paths or not\n\t\t\t// so we just operate on pure string-prefix paths\n\t\t\t// this comes up with for example s3://\n\t\t\tdiffOptions.oneExternalPathPrefix = oneExternalPathPrefix\n\t\t\tdiffOptions.twoExternalPathPrefix = twoExternalPathPrefix\n\t\t}\n\t}\n}\n\n// DiffWithTransform returns a DiffOption that adds a transform function. The transform function will be run on each\n// file being compared before it is diffed. transform takes the arguments:\n//\n//\tside: one or two whether it is the first or second item in the diff\n//\tfilename: the filename including path\n//\tcontent: the file content.\n//\n// transform returns a string that is the transformed content of filename.\n//\n// TODO: this needs to be refactored or removed, especially the implicit side enum.\n// Perhaps provide a transform function for a given bucket and apply it there.\nfunc DiffWithTransform(\n\ttransform func(side string, filename string, content []byte) []byte,\n) DiffOption {\n\treturn func(diffOptions *diffOptions) {\n\t\tdiffOptions.transforms = append(diffOptions.transforms, transform)\n\t}\n}\n\n// DiffBytes does a diff of the ReadBuckets.\nfunc DiffBytes(\n\tctx context.Context,\n\tone ReadBucket,\n\ttwo ReadBucket,\n\toptions ...DiffOption,\n) ([]byte, error) {\n\tbuffer := bytes.NewBuffer(nil)\n\tif err := Diff(ctx, buffer, one, two, options...); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buffer.Bytes(), nil\n}\n\n// Diff writes a diff of the ReadBuckets to the Writer.\nfunc Diff(\n\tctx context.Context,\n\twriter io.Writer,\n\tone ReadBucket,\n\ttwo ReadBucket,\n\toptions ...DiffOption,\n) error {\n\t_, err := DiffWithFilenames(ctx, writer, one, two, options...)\n\treturn err\n}\n\n// DiffWithFilenames writes a diff of the ReadBuckets to the Writer and returns\n// the names of any file paths that contained differences. The returned paths\n// are in sorted (ascending) order.\n//\n// Note that the returned paths are determined by comparing the before and after\n// bytes, not just based on whether the configured diff tool reports something.\n// This can be used to avoid re-writing files whose contents don't actually need\n// to change.\nfunc DiffWithFilenames(\n\tctx context.Context,\n\twriter io.Writer,\n\tone ReadBucket,\n\ttwo ReadBucket,\n\toptions ...DiffOption,\n) ([]string, error) {\n\tdiffOptions := newDiffOptions()\n\tfor _, option := range options {\n\t\toption(diffOptions)\n\t}\n\texternalPaths := diffOptions.externalPaths\n\toneExternalPathPrefix := diffOptions.oneExternalPathPrefix\n\ttwoExternalPathPrefix := diffOptions.twoExternalPathPrefix\n\n\toneObjectInfos, err := allObjectInfos(ctx, one, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttwoObjectInfos, err := allObjectInfos(ctx, two, \"\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsortObjectInfos(oneObjectInfos)\n\tsortObjectInfos(twoObjectInfos)\n\tonePathToObjectInfo := pathToObjectInfo(oneObjectInfos)\n\ttwoPathToObjectInfo := pathToObjectInfo(twoObjectInfos)\n\tvar changedPaths []string\n\n\tfor _, oneObjectInfo := range oneObjectInfos {\n\t\tpath := oneObjectInfo.Path()\n\t\toneDiffPath, err := getDiffPathForObjectInfo(\n\t\t\toneObjectInfo,\n\t\t\texternalPaths,\n\t\t\toneExternalPathPrefix,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toneData, err := ReadPath(ctx, one, path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvar twoData []byte\n\t\tvar twoDiffPath string\n\t\tif twoObjectInfo, ok := twoPathToObjectInfo[path]; ok {\n\t\t\ttwoData, err = ReadPath(ctx, two, path)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ttwoDiffPath, err = getDiffPathForObjectInfo(\n\t\t\t\ttwoObjectInfo,\n\t\t\t\texternalPaths,\n\t\t\t\ttwoExternalPathPrefix,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif !bytes.Equal(oneData, twoData) {\n\t\t\t\tchangedPaths = append(changedPaths, path)\n\t\t\t}\n\t\t} else {\n\t\t\tchangedPaths = append(changedPaths, path)\n\t\t\ttwoDiffPath, err = getDiffPathForNotFound(\n\t\t\t\toneObjectInfo,\n\t\t\t\texternalPaths,\n\t\t\t\toneExternalPathPrefix,\n\t\t\t\ttwoExternalPathPrefix,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tfor _, transform := range diffOptions.transforms {\n\t\t\toneData = transform(\"one\", oneDiffPath, oneData)\n\t\t\ttwoData = transform(\"two\", twoDiffPath, twoData)\n\t\t}\n\t\tdiffData, err := diff.Diff(\n\t\t\tctx,\n\t\t\toneData,\n\t\t\ttwoData,\n\t\t\toneDiffPath,\n\t\t\ttwoDiffPath,\n\t\t\tdiffOptions.toDiffPackageOptions()...,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(diffData) > 0 {\n\t\t\tif _, err := writer.Write(diffData); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t}\n\tfor _, twoObjectInfo := range twoObjectInfos {\n\t\tpath := twoObjectInfo.Path()\n\t\tif _, ok := onePathToObjectInfo[path]; !ok {\n\t\t\tchangedPaths = append(changedPaths, path)\n\t\t\ttwoData, err := ReadPath(ctx, two, path)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\toneDiffPath, err := getDiffPathForNotFound(\n\t\t\t\ttwoObjectInfo,\n\t\t\t\texternalPaths,\n\t\t\t\ttwoExternalPathPrefix,\n\t\t\t\toneExternalPathPrefix,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ttwoDiffPath, err := getDiffPathForObjectInfo(\n\t\t\t\ttwoObjectInfo,\n\t\t\t\texternalPaths,\n\t\t\t\ttwoExternalPathPrefix,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tdiffData, err := diff.Diff(\n\t\t\t\tctx,\n\t\t\t\tnil,\n\t\t\t\ttwoData,\n\t\t\t\toneDiffPath,\n\t\t\t\ttwoDiffPath,\n\t\t\t\tdiffOptions.toDiffPackageOptions()...,\n\t\t\t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif len(diffData) > 0 {\n\t\t\t\tif _, err := writer.Write(diffData); err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// changedPaths will be *mostly* sorted. But paths in \"two\" that were not present\n\t// in \"one\" will appear last, even if sort order would have them interleaved.\n\t// So we must sort explicitly.\n\tsort.Strings(changedPaths)\n\treturn changedPaths, nil\n}\n\nfunc getDiffPathForObjectInfo(\n\tobjectInfo ObjectInfo,\n\texternalPaths bool,\n\texternalPathPrefix string,\n) (string, error) {\n\tif !externalPaths {\n\t\treturn objectInfo.Path(), nil\n\t}\n\texternalPath := objectInfo.ExternalPath()\n\tif externalPathPrefix == \"\" {\n\t\treturn externalPath, nil\n\t}\n\tif !strings.HasPrefix(externalPath, externalPathPrefix) {\n\t\treturn \"\", fmt.Errorf(\"diff: expected %s to have prefix %s\", externalPath, externalPathPrefix)\n\t}\n\treturn externalPath, nil\n}\n\nfunc getDiffPathForNotFound(\n\tfoundObjectInfo ObjectInfo,\n\texternalPaths bool,\n\tfoundExternalPathPrefix string,\n\tnotFoundExternalPathPrefix string,\n) (string, error) {\n\tif !externalPaths {\n\t\treturn foundObjectInfo.Path(), nil\n\t}\n\texternalPath := foundObjectInfo.ExternalPath()\n\tswitch {\n\tcase foundExternalPathPrefix == \"\" && notFoundExternalPathPrefix == \"\":\n\t\t// no prefix, just return external path\n\t\treturn externalPath, nil\n\tcase foundExternalPathPrefix == \"\" && notFoundExternalPathPrefix != \"\":\n\t\t// the not-found side has a prefix, append the external path to this prefix, and we're done\n\t\treturn notFoundExternalPathPrefix + externalPath, nil\n\tdefault:\n\t\t//foundExternalPathPrefix != \"\" && notFoundExternalPathPrefix == \"\"\n\t\t//foundExternalPathPrefix != \"\" && notFoundExternalPathPrefix != \"\"\n\t\tif !strings.HasPrefix(externalPath, foundExternalPathPrefix) {\n\t\t\treturn \"\", fmt.Errorf(\"diff: expected %s to have prefix %s\", externalPath, foundExternalPathPrefix)\n\t\t}\n\t\treturn notFoundExternalPathPrefix + strings.TrimPrefix(externalPath, foundExternalPathPrefix), nil\n\t}\n}\n\ntype diffOptions struct {\n\tsuppressCommands      bool\n\tsuppressTimestamps    bool\n\texternalPaths         bool\n\toneExternalPathPrefix string\n\ttwoExternalPathPrefix string\n\ttransforms            []func(side string, filename string, content []byte) []byte\n}\n\nfunc newDiffOptions() *diffOptions {\n\treturn &diffOptions{}\n}\n\nfunc (d *diffOptions) toDiffPackageOptions() []diff.DiffOption {\n\tvar diffPackageOptions []diff.DiffOption\n\tif d.suppressCommands {\n\t\tdiffPackageOptions = append(diffPackageOptions, diff.DiffWithSuppressCommands())\n\t}\n\tif d.suppressTimestamps {\n\t\tdiffPackageOptions = append(diffPackageOptions, diff.DiffWithSuppressTimestamps())\n\t}\n\treturn diffPackageOptions\n}\n"
  },
  {
    "path": "private/pkg/storage/errors.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/fs\"\n\t\"strings\"\n)\n\nvar (\n\t// ErrClosed is the error returned if a bucket or object is already closed.\n\tErrClosed = errors.New(\"already closed\")\n\t// ErrSetExternalPathUnsupported is the error returned if a bucket does not support SetExternalPath.\n\tErrSetExternalPathUnsupported = errors.New(\"setting the external path is unsupported for this bucket\")\n\t// ErrSetLocalPathUnsupported is the error returned if a bucket does not support SetLocalPath.\n\tErrSetLocalPathUnsupported = errors.New(\"setting the local path is unsupported for this bucket\")\n)\n\n// NewErrNotExist returns a new error for a path not existing.\n//\n// Deprecated: use &fs.PathError{Op: \"Operation\", Path: path, Err: fs.ErrNotExist} instead.\nfunc NewErrNotExist(path string) error {\n\t// fs.PathErrors should also have Op, but we don't have an obvious one here.\n\treturn &fs.PathError{Path: path, Err: fs.ErrNotExist}\n}\n\n// IsNotExist returns true for a error that is for a path not existing.\n//\n// Deprecated: Use errors.Is(err, fs.ErrNotExist) instead.\nfunc IsNotExist(err error) bool {\n\treturn errors.Is(err, fs.ErrNotExist)\n}\n\n// NewErrExistsMultipleLocations returns a new error if a path exists in multiple locations.\nfunc NewErrExistsMultipleLocations(path string, externalPaths ...string) error {\n\treturn &errorExistsMultipleLocations{\n\t\tPath:          path,\n\t\tExternalPaths: externalPaths,\n\t}\n}\n\n// IsExistsMultipleLocations returns true if the error is for a path existing in multiple locations.\nfunc IsExistsMultipleLocations(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\tasErr := &errorExistsMultipleLocations{}\n\treturn errors.As(err, &asErr)\n}\n\n// IsWriteLimitReached returns true if the error is of writes exceeding the limit of the bucket.\nfunc IsWriteLimitReached(err error) bool {\n\tif err == nil {\n\t\treturn false\n\t}\n\tasErr := &errWriteLimitReached{}\n\treturn errors.As(err, &asErr)\n}\n\n// errorExistsMultipleLocations is the error returned if a path exists in multiple locations.\ntype errorExistsMultipleLocations struct {\n\tPath          string\n\tExternalPaths []string\n}\n\n// Error implements error.\nfunc (e *errorExistsMultipleLocations) Error() string {\n\treturn e.Path + \" exists in multiple locations: \" + strings.Join(e.ExternalPaths, \" \")\n}\n\n// errWriteLimitReached is the error returned if the write limit is reached.\n//\n// See [LimitWriteBucket].\ntype errWriteLimitReached struct {\n\tLimit       int64\n\tExceedingBy int64\n}\n\n// Error implements error.\nfunc (e *errWriteLimitReached) Error() string {\n\treturn fmt.Sprintf(\"write limit reached: limit: %d, exceeding by: %d\", e.Limit, e.ExceedingBy)\n}\n"
  },
  {
    "path": "private/pkg/storage/filter.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// FilterReadBucket filters the ReadBucket.\n//\n// If the Matchers are empty, the original ReadBucket is returned.\n// If there is more than one Matcher, the Matchers are anded together.\nfunc FilterReadBucket(readBucket ReadBucket, matchers ...Matcher) ReadBucket {\n\tif len(matchers) == 0 {\n\t\treturn readBucket\n\t}\n\treturn newFilterReadBucketCloser(readBucket, nil, MatchAnd(matchers...))\n}\n\n// FilterReadBucketCloser filters the ReadBucketCloser.\n//\n// If the Matchers are empty, the original ReadBucketCloser is returned.\n// If there is more than one Matcher, the Matchers are anded together.\nfunc FilterReadBucketCloser(readBucketCloser ReadBucketCloser, matchers ...Matcher) ReadBucketCloser {\n\tif len(matchers) == 0 {\n\t\treturn readBucketCloser\n\t}\n\treturn newFilterReadBucketCloser(readBucketCloser, readBucketCloser.Close, MatchAnd(matchers...))\n}\n\ntype filterReadBucketCloser struct {\n\tdelegate  ReadBucket\n\tcloseFunc func() error\n\tmatcher   Matcher\n}\n\nfunc newFilterReadBucketCloser(\n\tdelegate ReadBucket,\n\tcloseFunc func() error,\n\tmatcher Matcher,\n) *filterReadBucketCloser {\n\treturn &filterReadBucketCloser{\n\t\tdelegate:  delegate,\n\t\tcloseFunc: closeFunc,\n\t\tmatcher:   matcher,\n\t}\n}\n\nfunc (r *filterReadBucketCloser) Get(ctx context.Context, path string) (ReadObjectCloser, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !r.matcher.MatchPath(path) {\n\t\treturn nil, &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn r.delegate.Get(ctx, path)\n}\n\nfunc (r *filterReadBucketCloser) Stat(ctx context.Context, path string) (ObjectInfo, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !r.matcher.MatchPath(path) {\n\t\treturn nil, &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn r.delegate.Stat(ctx, path)\n}\n\nfunc (r *filterReadBucketCloser) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error {\n\tprefix, err := normalpath.NormalizeAndValidate(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn r.delegate.Walk(\n\t\tctx,\n\t\tprefix,\n\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\tif !r.matcher.MatchPath(objectInfo.Path()) {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn f(objectInfo)\n\t\t},\n\t)\n}\n\nfunc (r *filterReadBucketCloser) Close() error {\n\tif r.closeFunc != nil {\n\t\treturn r.closeFunc()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/storage/limit.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"sync/atomic\"\n)\n\n// LimitWriteBucket returns a [WriteBucket] that writes to [writeBucket]\n// but stops with an error after [limit] bytes are written.\n//\n// The error can be checked using [IsWriteLimitReached].\n//\n// A negative [limit] is same as 0 limit.\nfunc LimitWriteBucket(writeBucket WriteBucket, limit int) WriteBucket {\n\tif limit < 0 {\n\t\tlimit = 0\n\t}\n\treturn newLimitedWriteBucket(writeBucket, int64(limit))\n}\n\ntype limitedWriteBucket struct {\n\tWriteBucket\n\tcurrentSize *atomic.Int64\n\tlimit       int64\n}\n\nfunc newLimitedWriteBucket(bucket WriteBucket, limit int64) *limitedWriteBucket {\n\treturn &limitedWriteBucket{\n\t\tWriteBucket: bucket,\n\t\tcurrentSize: &atomic.Int64{},\n\t\tlimit:       limit,\n\t}\n}\n\nfunc (w *limitedWriteBucket) Put(ctx context.Context, path string, opts ...PutOption) (WriteObjectCloser, error) {\n\twriteObjectCloser, err := w.WriteBucket.Put(ctx, path, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newLimitedWriteObjectCloser(writeObjectCloser, w.currentSize, w.limit), nil\n}\n\ntype limitedWriteObjectCloser struct {\n\tWriteObjectCloser\n\n\tbucketSize *atomic.Int64\n\tlimit      int64\n}\n\nfunc newLimitedWriteObjectCloser(\n\twriteObjectCloser WriteObjectCloser,\n\tbucketSize *atomic.Int64,\n\tlimit int64,\n) *limitedWriteObjectCloser {\n\treturn &limitedWriteObjectCloser{\n\t\tWriteObjectCloser: writeObjectCloser,\n\t\tbucketSize:        bucketSize,\n\t\tlimit:             limit,\n\t}\n}\n\nfunc (o *limitedWriteObjectCloser) Write(p []byte) (int, error) {\n\twriteSize := int64(len(p))\n\tnewBucketSize := o.bucketSize.Add(writeSize)\n\tif newBucketSize > o.limit {\n\t\to.bucketSize.Add(-writeSize)\n\t\treturn 0, &errWriteLimitReached{\n\t\t\tLimit:       o.limit,\n\t\t\tExceedingBy: newBucketSize - o.limit,\n\t\t}\n\t}\n\twrittenSize, err := o.WriteObjectCloser.Write(p)\n\tif int64(writtenSize) < writeSize {\n\t\to.bucketSize.Add(-(writeSize - int64(writtenSize)))\n\t}\n\treturn writtenSize, err\n}\n"
  },
  {
    "path": "private/pkg/storage/map.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n)\n\n// MapReadBucket maps the ReadBucket.\n//\n// If the Mappers are empty, the original ReadBucket is returned.\n// If there is more than one Mapper, the Mappers are called in order\n// for UnmapFullPath, with the order reversed for MapPath.\n//\n// That is, order these assuming you are starting with a full path and\n// working to a path.\nfunc MapReadBucket(readBucket ReadBucket, mappers ...Mapper) ReadBucket {\n\tif len(mappers) == 0 {\n\t\treturn readBucket\n\t}\n\treturn newMapReadBucketCloser(readBucket, nil, MapChain(mappers...))\n}\n\n// MapReadBucketCloser maps the ReadBucketCloser.\n//\n// If the Mappers are empty, the original ReadBucketCloser is returned.\n// If there is more than one Mapper, the Mappers are called in order\n// for UnmapFullPath, with the order reversed for MapPath.\n//\n// That is, order these assuming you are starting with a full path and\n// working to a path.\nfunc MapReadBucketCloser(readBucketCloser ReadBucketCloser, mappers ...Mapper) ReadBucketCloser {\n\tif len(mappers) == 0 {\n\t\treturn readBucketCloser\n\t}\n\treturn newMapReadBucketCloser(readBucketCloser, readBucketCloser.Close, MapChain(mappers...))\n}\n\n// MapWriteBucket maps the WriteBucket.\n//\n// If the Mappers are empty, the original WriteBucket is returned.\n// If there is more than one Mapper, the Mappers are called in order\n// for UnmapFullPath, with the order reversed for MapPath.\n//\n// That is, order these assuming you are starting with a full path and\n// working to a path.\n//\n// If a path that does not match is called for Put, an error is returned.\nfunc MapWriteBucket(writeBucket WriteBucket, mappers ...Mapper) WriteBucket {\n\tif len(mappers) == 0 {\n\t\treturn writeBucket\n\t}\n\treturn newMapWriteBucketCloser(writeBucket, nil, MapChain(mappers...))\n}\n\n// MapWriteBucketCloser maps the WriteBucketCloser.\n//\n// If the Mappers are empty, the original WriteBucketCloser is returned.\n// If there is more than one Mapper, the Mappers are called in order\n// for UnmapFullPath, with the order reversed for MapPath.\n//\n// That is, order these assuming you are starting with a full path and\n// working to a path.\n//\n// If a path that does not match is called for Put, an error is returned.\nfunc MapWriteBucketCloser(writeBucketCloser WriteBucketCloser, mappers ...Mapper) WriteBucketCloser {\n\tif len(mappers) == 0 {\n\t\treturn writeBucketCloser\n\t}\n\treturn newMapWriteBucketCloser(writeBucketCloser, writeBucketCloser.Close, MapChain(mappers...))\n}\n\n// MapReadWriteBucket maps the ReadWriteBucket.\n//\n// If the Mappers are empty, the original ReadWriteBucket is returned.\n// If there is more than one Mapper, the Mappers are called in order\n// for UnmapFullPath, with the order reversed for MapPath.\n//\n// That is, order these assuming you are starting with a full path and\n// working to a path.\nfunc MapReadWriteBucket(readWriteBucket ReadWriteBucket, mappers ...Mapper) ReadWriteBucket {\n\tif len(mappers) == 0 {\n\t\treturn readWriteBucket\n\t}\n\tmapper := MapChain(mappers...)\n\treturn compositeReadWriteBucketCloser{\n\t\tnewMapReadBucketCloser(readWriteBucket, nil, mapper),\n\t\tnewMapWriteBucketCloser(readWriteBucket, nil, mapper),\n\t\tnil,\n\t}\n}\n\n// MapReadWriteBucketCloser maps the ReadWriteBucketCloser.\n//\n// If the Mappers are empty, the original ReadWriteBucketCloser is returned.\n// If there is more than one Mapper, the Mappers are called in order\n// for UnmapFullPath, with the order reversed for MapPath.\n//\n// That is, order these assuming you are starting with a full path and\n// working to a path.\nfunc MapReadWriteBucketCloser(readWriteBucketCloser ReadWriteBucketCloser, mappers ...Mapper) ReadWriteBucketCloser {\n\tif len(mappers) == 0 {\n\t\treturn readWriteBucketCloser\n\t}\n\tmapper := MapChain(mappers...)\n\treturn compositeReadWriteBucketCloser{\n\t\tnewMapReadBucketCloser(readWriteBucketCloser, nil, mapper),\n\t\tnewMapWriteBucketCloser(readWriteBucketCloser, nil, mapper),\n\t\treadWriteBucketCloser.Close,\n\t}\n}\n\ntype mapReadBucketCloser struct {\n\tdelegate  ReadBucket\n\tcloseFunc func() error\n\tmapper    Mapper\n}\n\nfunc newMapReadBucketCloser(\n\tdelegate ReadBucket,\n\tcloseFunc func() error,\n\tmapper Mapper,\n) *mapReadBucketCloser {\n\treturn &mapReadBucketCloser{\n\t\tdelegate:  delegate,\n\t\tcloseFunc: closeFunc,\n\t\tmapper:    mapper,\n\t}\n}\n\nfunc (r *mapReadBucketCloser) Get(ctx context.Context, path string) (ReadObjectCloser, error) {\n\tfullPath, err := r.getFullPath(\"read\", path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treadObjectCloser, err := r.delegate.Get(ctx, fullPath)\n\t// TODO: if this is a path error, we should replace the path\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn replaceReadObjectCloserPath(readObjectCloser, path), nil\n}\n\nfunc (r *mapReadBucketCloser) Stat(ctx context.Context, path string) (ObjectInfo, error) {\n\tfullPath, err := r.getFullPath(\"stat\", path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tobjectInfo, err := r.delegate.Stat(ctx, fullPath)\n\t// TODO: if this is a path error, we should replace the path\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn replaceObjectInfoPath(objectInfo, path), nil\n}\n\nfunc (r *mapReadBucketCloser) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error {\n\tprefix, err := normalpath.NormalizeAndValidate(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfullPrefix, matches := r.mapper.MapPath(prefix)\n\tif !matches {\n\t\treturn nil\n\t}\n\treturn r.delegate.Walk(\n\t\tctx,\n\t\tfullPrefix,\n\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\tpath, matches, err := r.mapper.UnmapFullPath(objectInfo.Path())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif !matches {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn f(replaceObjectInfoPath(objectInfo, path))\n\t\t},\n\t)\n}\n\nfunc (r *mapReadBucketCloser) Close() error {\n\tif r.closeFunc != nil {\n\t\treturn r.closeFunc()\n\t}\n\treturn nil\n}\n\nfunc (r *mapReadBucketCloser) getFullPath(op string, path string) (string, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif path == \".\" {\n\t\treturn \"\", errors.New(\"cannot get root\")\n\t}\n\tfullPath, matches := r.mapper.MapPath(path)\n\tif !matches {\n\t\treturn \"\", &fs.PathError{Op: op, Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn fullPath, nil\n}\n\ntype mapWriteBucketCloser struct {\n\tdelegate  WriteBucket\n\tcloseFunc func() error\n\tmapper    Mapper\n}\n\nfunc newMapWriteBucketCloser(\n\tdelegate WriteBucket,\n\tcloseFunc func() error,\n\tmapper Mapper,\n) *mapWriteBucketCloser {\n\treturn &mapWriteBucketCloser{\n\t\tdelegate:  delegate,\n\t\tcloseFunc: closeFunc,\n\t\tmapper:    mapper,\n\t}\n}\n\nfunc (w *mapWriteBucketCloser) Put(ctx context.Context, path string, opts ...PutOption) (WriteObjectCloser, error) {\n\tfullPath, err := w.getFullPath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\twriteObjectCloser, err := w.delegate.Put(ctx, fullPath, opts...)\n\t// TODO: if this is a path error, we should replace the path\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn replaceWriteObjectCloserExternalAndLocalPathsNotSupported(writeObjectCloser), nil\n}\n\nfunc (w *mapWriteBucketCloser) Delete(ctx context.Context, path string) error {\n\tfullPath, err := w.getFullPath(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn w.delegate.Delete(ctx, fullPath)\n}\n\nfunc (w *mapWriteBucketCloser) DeleteAll(ctx context.Context, prefix string) error {\n\tprefix, err := normalpath.NormalizeAndValidate(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfullPrefix, matches := w.mapper.MapPath(prefix)\n\tif !matches {\n\t\treturn nil\n\t}\n\treturn w.delegate.DeleteAll(ctx, fullPrefix)\n}\n\nfunc (*mapWriteBucketCloser) SetExternalAndLocalPathsSupported() bool {\n\treturn false\n}\n\nfunc (w *mapWriteBucketCloser) Close() error {\n\tif w.closeFunc != nil {\n\t\treturn w.closeFunc()\n\t}\n\treturn nil\n}\n\nfunc (w *mapWriteBucketCloser) getFullPath(path string) (string, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif path == \".\" {\n\t\treturn \"\", errors.New(\"cannot get root\")\n\t}\n\tfullPath, matches := w.mapper.MapPath(path)\n\tif !matches {\n\t\treturn \"\", fmt.Errorf(\"path does not match: %s\", path)\n\t}\n\treturn fullPath, nil\n}\n\nfunc replaceObjectInfoPath(objectInfo ObjectInfo, path string) ObjectInfo {\n\tif objectInfo.Path() == path {\n\t\treturn objectInfo\n\t}\n\treturn storageutil.NewObjectInfo(\n\t\tpath,\n\t\tobjectInfo.ExternalPath(),\n\t\tobjectInfo.LocalPath(),\n\t)\n}\n\nfunc replaceReadObjectCloserPath(readObjectCloser ReadObjectCloser, path string) ReadObjectCloser {\n\tif readObjectCloser.Path() == path {\n\t\treturn readObjectCloser\n\t}\n\treturn compositeReadObjectCloser{replaceObjectInfoPath(readObjectCloser, path), readObjectCloser}\n}\n\nfunc replaceWriteObjectCloserExternalAndLocalPathsNotSupported(writeObjectCloser WriteObjectCloser) WriteObjectCloser {\n\treturn writeObjectCloserExternalAndLocalPathsNotSupported{writeObjectCloser}\n}\n\ntype writeObjectCloserExternalAndLocalPathsNotSupported struct {\n\tio.WriteCloser\n}\n\nfunc (writeObjectCloserExternalAndLocalPathsNotSupported) SetExternalPath(string) error {\n\treturn ErrSetExternalPathUnsupported\n}\n\nfunc (writeObjectCloserExternalAndLocalPathsNotSupported) SetLocalPath(string) error {\n\treturn ErrSetLocalPathUnsupported\n}\n"
  },
  {
    "path": "private/pkg/storage/mapper.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// Mapper is a path mapper.\n//\n// This will cause a Bucket to operate as if the Mapper has all paths mapped.\ntype Mapper interface {\n\t// MapPath maps the path to the full path.\n\t//\n\t// The path is expected to be normalized and validated.\n\t// The returned path is expected to be normalized and validated.\n\t// If the path cannot be mapped, this returns false.\n\tMapPath(path string) (string, bool)\n\t// UnmapFullPath maps the full path to the path.\n\t//\n\t// Returns false if the full path does not apply.\n\t// The path is expected to be normalized and validated.\n\t// The returned path is expected to be normalized and validated.\n\tUnmapFullPath(fullPath string) (string, bool, error)\n\tisMapper()\n}\n\n// MapOnPrefix returns a Mapper that will map the Bucket as if it was created on the given prefix.\n//\n// The prefix is expected to be normalized and validated.\nfunc MapOnPrefix(prefix string) Mapper {\n\treturn prefixMapper{prefix}\n}\n\n// MapChain chains the mappers.\n//\n// If any mapper does not match, this stops checking Mappers and returns\n// an empty path and false. This is as opposed to MatchAnd, that runs\n// every Matcher and returns the path regardless.\n//\n// If the Mappers are empty, a no-op Mapper is returned.\n// If there is more than one Mapper, the Mappers are called in order\n// for UnmapFullPath, with the order reversed for MapPath.\n//\n// That is, order these assuming you are starting with a full path and\n// working to a path.\nfunc MapChain(mappers ...Mapper) Mapper {\n\tswitch len(mappers) {\n\tcase 0:\n\t\treturn nopMapper{}\n\tcase 1:\n\t\treturn mappers[0]\n\tdefault:\n\t\treturn chainMapper{mappers}\n\t}\n}\n\n// ***** private *****\n\ntype prefixMapper struct {\n\tprefix string\n}\n\nfunc (p prefixMapper) MapPath(path string) (string, bool) {\n\treturn normalpath.Join(p.prefix, path), true\n}\n\nfunc (p prefixMapper) UnmapFullPath(fullPath string) (string, bool, error) {\n\tif !normalpath.EqualsOrContainsPath(p.prefix, fullPath, normalpath.Relative) {\n\t\treturn \"\", false, nil\n\t}\n\tpath, err := normalpath.Rel(p.prefix, fullPath)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\treturn path, true, nil\n}\n\nfunc (prefixMapper) isMapper() {}\n\ntype chainMapper struct {\n\tmappers []Mapper\n}\n\nfunc (c chainMapper) MapPath(path string) (string, bool) {\n\treturn c.mapFunc(path, Mapper.MapPath)\n}\n\nfunc (c chainMapper) UnmapFullPath(fullPath string) (string, bool, error) {\n\tpath := fullPath\n\tvar matches bool\n\tvar err error\n\tfor _, mapper := range c.mappers {\n\t\tpath, matches, err = mapper.UnmapFullPath(path)\n\t\tif err != nil {\n\t\t\treturn \"\", false, err\n\t\t}\n\t\tif !matches {\n\t\t\treturn \"\", false, nil\n\t\t}\n\t}\n\treturn path, true, nil\n}\n\nfunc (c chainMapper) mapFunc(\n\tpathOrPrefix string,\n\tf func(Mapper, string) (string, bool),\n) (string, bool) {\n\tfullPathOrPrefix := pathOrPrefix\n\tvar matches bool\n\tfor i := len(c.mappers) - 1; i >= 0; i-- {\n\t\tmapper := c.mappers[i]\n\t\tfullPathOrPrefix, matches = f(mapper, fullPathOrPrefix)\n\t\tif !matches {\n\t\t\treturn \"\", false\n\t\t}\n\t}\n\treturn fullPathOrPrefix, true\n}\n\nfunc (chainMapper) isMapper() {}\n\ntype nopMapper struct{}\n\nfunc (n nopMapper) MapPath(path string) (string, bool) {\n\treturn path, true\n}\n\nfunc (nopMapper) UnmapFullPath(fullPath string) (string, bool, error) {\n\treturn fullPath, true, nil\n}\n\nfunc (nopMapper) isMapper() {}\n"
  },
  {
    "path": "private/pkg/storage/mask.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n\t\"slices\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// MaskReadBucket creates a ReadBucket that masks the include and exclude prefixes,\n// with optimized walking that only traverses include prefixes.\n//\n// If includePrefixes is empty, all paths are included (no prefix filtering on walk).\n// If excludePrefixes is provided, those paths are excluded from results.\n// If both includePrefixes and excludePrefixes are empty, the original ReadBucket is returned.\nfunc MaskReadBucket(readBucket ReadBucket, includePrefixes, excludePrefixes []string) (ReadBucket, error) {\n\tif len(includePrefixes) == 0 && len(excludePrefixes) == 0 {\n\t\treturn readBucket, nil\n\t}\n\treturn newMaskReadBucketCloser(readBucket, nil, includePrefixes, excludePrefixes)\n}\n\n// MaskReadBucketCloser creates a ReadBucketCloser that masks using include and exclude prefixes,\n// with optimized walking that only traverses include prefixes.\n//\n// If includePrefixes is empty, all paths are included (no prefix filtering on walk).\n// If excludePrefixes is provided, those paths are excluded from results.\n// If both includePrefixes and excludePrefixes are empty, the original ReadBucketCloser is returned.\nfunc MaskReadBucketCloser(readBucketCloser ReadBucketCloser, includePrefixes, excludePrefixes []string) (ReadBucketCloser, error) {\n\tif len(includePrefixes) == 0 && len(excludePrefixes) == 0 {\n\t\treturn readBucketCloser, nil\n\t}\n\treturn newMaskReadBucketCloser(readBucketCloser, readBucketCloser.Close, includePrefixes, excludePrefixes)\n}\n\ntype maskReadBucketCloser struct {\n\tdelegate        ReadBucket\n\tcloseFunc       func() error\n\tincludePrefixes []string\n\texcludePrefixes []string\n}\n\nfunc newMaskReadBucketCloser(\n\tdelegate ReadBucket,\n\tcloseFunc func() error,\n\tincludePrefixes, excludePrefixes []string,\n) (*maskReadBucketCloser, error) {\n\tnormalizedIncludes, err := normalizeValidateAndCompactPrefixes(includePrefixes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnormalizedExcludes, err := normalizeValidateAndCompactPrefixes(excludePrefixes)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &maskReadBucketCloser{\n\t\tdelegate:        delegate,\n\t\tcloseFunc:       closeFunc,\n\t\tincludePrefixes: normalizedIncludes,\n\t\texcludePrefixes: normalizedExcludes,\n\t}, nil\n}\n\nfunc (r *maskReadBucketCloser) Get(ctx context.Context, path string) (ReadObjectCloser, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !r.matchPath(path) {\n\t\treturn nil, &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn r.delegate.Get(ctx, path)\n}\n\nfunc (r *maskReadBucketCloser) Stat(ctx context.Context, path string) (ObjectInfo, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif !r.matchPath(path) {\n\t\treturn nil, &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn r.delegate.Stat(ctx, path)\n}\n\nfunc (r *maskReadBucketCloser) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error {\n\tprefix, err := normalpath.NormalizeAndValidate(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\tfor _, excludePrefix := range r.excludePrefixes {\n\t\tisChild := normalpath.EqualsOrContainsPath(excludePrefix, prefix, normalpath.Relative)\n\t\tif isChild {\n\t\t\t// The requested prefix is under an exclude prefix, so nothing to walk.\n\t\t\treturn nil\n\t\t}\n\t}\n\twalkFunc := func(objectInfo ObjectInfo) error {\n\t\tif !r.matchPath(objectInfo.Path()) {\n\t\t\treturn nil\n\t\t}\n\t\treturn f(objectInfo)\n\t}\n\tif len(r.includePrefixes) == 0 {\n\t\t// No include prefixes, so walk normally.\n\t\treturn r.delegate.Walk(ctx, prefix, walkFunc)\n\t}\n\t// Find all include prefixes under the requests root prefix.\n\tvar effectivePrefixes []string\n\tfor _, includePrefix := range r.includePrefixes {\n\t\tisParent := normalpath.EqualsOrContainsPath(includePrefix, prefix, normalpath.Relative)\n\t\tif isParent {\n\t\t\t// The requested prefix is under an include prefix, so walk normally.\n\t\t\treturn r.delegate.Walk(ctx, prefix, walkFunc)\n\t\t}\n\t\tisChild := normalpath.EqualsOrContainsPath(prefix, includePrefix, normalpath.Relative)\n\t\tif isChild {\n\t\t\teffectivePrefixes = append(effectivePrefixes, includePrefix)\n\t\t}\n\t}\n\t// Walk each effective prefix that is a child of the requested prefix.\n\t// The effective prefixes are sorted and compacted on creation of the Bucket,\n\t// so no need to sort or compact here.\n\tfor _, effectivePrefix := range effectivePrefixes {\n\t\tif err := r.delegate.Walk(ctx, effectivePrefix, walkFunc); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (r *maskReadBucketCloser) Close() error {\n\tif r.closeFunc != nil {\n\t\treturn r.closeFunc()\n\t}\n\treturn nil\n}\n\n// matchPath checks if a path matches the include/exclude criteria\nfunc (r *maskReadBucketCloser) matchPath(path string) bool {\n\t// Check excludes first (if any exclude matches, reject the path)\n\tfor _, excludePrefix := range r.excludePrefixes {\n\t\t// Check if the exclude prefix contains the path (path is under exclude prefix)\n\t\tif normalpath.EqualsOrContainsPath(excludePrefix, path, normalpath.Relative) {\n\t\t\treturn false\n\t\t}\n\t}\n\t// If no include prefixes, accept all paths (that weren't excluded)\n\tif len(r.includePrefixes) == 0 {\n\t\treturn true\n\t}\n\t// Check includes (at least one include must match)\n\tfor _, includePrefix := range r.includePrefixes {\n\t\t// Check if the include prefix contains the path (path is under include prefix)\n\t\tif normalpath.EqualsOrContainsPath(includePrefix, path, normalpath.Relative) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\n// normalizeValidateAndCompactPrefixes normalizes, validates, and compacts a list of path prefixes.\n// It removes redundant child prefixes that are already covered by parent prefixes.\n// For example, [\"foo\", \"foo/v1\", \"foo/v1/v2\"] becomes [\"foo\"].\nfunc normalizeValidateAndCompactPrefixes(prefixes []string) ([]string, error) {\n\tif len(prefixes) == 0 {\n\t\treturn nil, nil\n\t}\n\tvar normalized []string\n\tfor _, prefix := range prefixes {\n\t\tnormalizedPrefix, err := normalpath.NormalizeAndValidate(prefix)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tnormalized = append(normalized, normalizedPrefix)\n\t}\n\tslices.Sort(normalized)\n\t// Remove redundant child prefixes that are covered by parent prefixes.\n\t// For example, [\"bar\", \"foo\", \"foo/v1\", \"foo/v1/v2\"] becomes [\"bar\", \"foo\"].\n\treduced := normalized[:1]\n\tfor _, prefix := range normalized[1:] {\n\t\tif !normalpath.EqualsOrContainsPath(reduced[len(reduced)-1], prefix, normalpath.Relative) {\n\t\t\treduced = append(reduced, prefix)\n\t\t}\n\t}\n\treturn reduced, nil\n}\n"
  },
  {
    "path": "private/pkg/storage/mask_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage_test\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestMaskReadBucket(t *testing.T) {\n\tt.Parallel()\n\n\t// Create a test bucket with various files\n\ttestFiles := map[string]string{\n\t\t\"proto/v1/user.proto\":      \"syntax = \\\"proto3\\\";\",\n\t\t\"proto/v1/admin.proto\":     \"syntax = \\\"proto3\\\";\",\n\t\t\"proto/v2/user.proto\":      \"syntax = \\\"proto3\\\";\",\n\t\t\"proto/v2/admin.proto\":     \"syntax = \\\"proto3\\\";\",\n\t\t\"proto/internal/log.proto\": \"syntax = \\\"proto3\\\";\",\n\t\t\"docs/README.md\":           \"# Documentation\",\n\t\t\"src/main.go\":              \"package main\",\n\t\t\"node_modules/pkg/mod.js\":  \"module.exports = {};\",\n\t\t\"api/v1/service.proto\":     \"syntax = \\\"proto3\\\";\",\n\t\t\"api/v2/service.proto\":     \"syntax = \\\"proto3\\\";\",\n\t}\n\tdelegate := storagemem.NewReadWriteBucket()\n\tctx := t.Context()\n\tfor path, content := range testFiles {\n\t\twriteObjectCloser, err := delegate.Put(ctx, path)\n\t\trequire.NoError(t, err)\n\t\t_, err = writeObjectCloser.Write([]byte(content))\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, writeObjectCloser.Close())\n\t}\n\t// When no filters specified, all files should be returned\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{},\n\t\t[]string{},\n\t\t\"\",\n\t\txslices.MapKeysToSlice(testFiles),\n\t)\n\t// Only files under proto/ should be returned\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{\"proto\"},\n\t\t[]string{},\n\t\t\"\",\n\t\t[]string{\"proto/internal/log.proto\", \"proto/v1/admin.proto\", \"proto/v1/user.proto\", \"proto/v2/admin.proto\", \"proto/v2/user.proto\"},\n\t)\n\t// Proto files should be included except those in internal/\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{\"proto\"},\n\t\t[]string{\"proto/internal\"},\n\t\t\"\",\n\t\t[]string{\"proto/v1/admin.proto\", \"proto/v1/user.proto\", \"proto/v2/admin.proto\", \"proto/v2/user.proto\"},\n\t)\n\t// Only files from proto/v1/ and api/v2/ should be returned\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{\"proto/v1\", \"api/v2\"},\n\t\t[]string{},\n\t\t\"\",\n\t\t[]string{\"api/v2/service.proto\", \"proto/v1/admin.proto\", \"proto/v1/user.proto\"},\n\t)\n\t// All files except node_modules should be returned\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{},\n\t\t[]string{\"node_modules\"},\n\t\t\"\",\n\t\txslices.Filter(\n\t\t\txslices.MapKeysToSlice(testFiles),\n\t\t\tfunc(s string) bool { return !strings.HasPrefix(s, \"node_modules\") },\n\t\t),\n\t)\n\t// Walking proto/v1 with include filters should only return proto/v1 files\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{\"proto/v1\", \"proto/v2\"},\n\t\t[]string{},\n\t\t\"proto/v1\",\n\t\t[]string{\"proto/v1/admin.proto\", \"proto/v1/user.proto\"},\n\t)\n\t// Walking proto with specific includes should only return matching files\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{\"proto/v1\", \"proto/v2\"},\n\t\t[]string{},\n\t\t\"proto\",\n\t\t[]string{\"proto/v1/admin.proto\", \"proto/v1/user.proto\", \"proto/v2/admin.proto\", \"proto/v2/user.proto\"},\n\t)\n\t// Walking src with proto includes should return no files\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{\"proto\"},\n\t\t[]string{},\n\t\t\"src\",\n\t\tnil,\n\t)\n\t// Walking proto/v1 with proto include should return proto/v1 files\n\ttestMaskReadBucket(\n\t\tt,\n\t\tdelegate,\n\t\ttestFiles,\n\t\t[]string{\"proto\"},\n\t\t[]string{},\n\t\t\"proto/v1\",\n\t\t[]string{\"proto/v1/admin.proto\", \"proto/v1/user.proto\"},\n\t)\n}\n\nfunc TestMaskReadBucket_InvalidPrefixes(t *testing.T) {\n\tt.Parallel()\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\t_, err := storage.MaskReadBucket(readWriteBucket, []string{\"../invalid\"}, []string{})\n\tassert.Error(t, err, \"Should error on invalid include prefix\")\n\t_, err = storage.MaskReadBucket(readWriteBucket, []string{}, []string{\"../invalid\"})\n\tassert.Error(t, err, \"Should error on invalid exclude prefix\")\n}\n\nfunc TestMaskReadBucket_PrefixCompaction(t *testing.T) {\n\tt.Parallel()\n\n\t// Test that redundant child prefixes are removed\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\tctx := t.Context()\n\n\t// Create test files\n\ttestFiles := map[string]string{\n\t\t\"foo/file1.txt\":       \"content1\",\n\t\t\"foo/v1/file2.txt\":    \"content2\",\n\t\t\"foo/v1/v2/file3.txt\": \"content3\",\n\t\t\"bar/file4.txt\":       \"content4\",\n\t\t\"baz/file5.txt\":       \"content5\",\n\t}\n\tfor path, content := range testFiles {\n\t\twriteObjectCloser, err := readWriteBucket.Put(ctx, path)\n\t\trequire.NoError(t, err)\n\t\t_, err = writeObjectCloser.Write([]byte(content))\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, writeObjectCloser.Close())\n\t}\n\n\t// Test redundant includes: [\"foo\", \"foo/v1\", \"foo/v1/v2\"] should become just [\"foo\"]\n\tfilteredBucket, err := storage.MaskReadBucket(\n\t\treadWriteBucket,\n\t\t[]string{\"foo\", \"foo/v1\", \"foo/v1/v2\"},\n\t\t[]string{},\n\t)\n\trequire.NoError(t, err)\n\n\t// Walk should return all files under \"foo\" (since \"foo/v1\" and \"foo/v1/v2\" are redundant)\n\tvar actualFiles []string\n\terr = filteredBucket.Walk(ctx, \"\", func(objectInfo storage.ObjectInfo) error {\n\t\tactualFiles = append(actualFiles, objectInfo.Path())\n\t\treturn nil\n\t})\n\trequire.NoError(t, err)\n\n\tsort.Strings(actualFiles)\n\texpectedFiles := []string{\"foo/file1.txt\", \"foo/v1/file2.txt\", \"foo/v1/v2/file3.txt\"}\n\tsort.Strings(expectedFiles)\n\tassert.Equal(t, expectedFiles, actualFiles, \"Should include all files under foo prefix\")\n\n\t// Test mixed includes: [\"foo\", \"bar\", \"foo/v1\"] should become [\"foo\", \"bar\"]\n\tfilteredBucket2, err := storage.MaskReadBucket(\n\t\treadWriteBucket,\n\t\t[]string{\"foo\", \"bar\", \"foo/v1\"},\n\t\t[]string{},\n\t)\n\trequire.NoError(t, err)\n\n\tvar actualFiles2 []string\n\terr = filteredBucket2.Walk(ctx, \"\", func(objectInfo storage.ObjectInfo) error {\n\t\tactualFiles2 = append(actualFiles2, objectInfo.Path())\n\t\treturn nil\n\t})\n\trequire.NoError(t, err)\n\n\tsort.Strings(actualFiles2)\n\texpectedFiles2 := []string{\"bar/file4.txt\", \"foo/file1.txt\", \"foo/v1/file2.txt\", \"foo/v1/v2/file3.txt\"}\n\tsort.Strings(expectedFiles2)\n\tassert.Equal(t, expectedFiles2, actualFiles2, \"Should include all files under foo and bar prefixes\")\n}\n\nfunc TestMaskReadBucket_WalkOptimization(t *testing.T) {\n\tt.Parallel()\n\n\t// Add some test files\n\tctx := t.Context()\n\ttestFiles := map[string]string{\n\t\t\"proto/v1/user.proto\": \"content\",\n\t\t\"proto/v2/user.proto\": \"content\",\n\t\t\"docs/README.md\":      \"content\",\n\t\t\"src/main.go\":         \"content\",\n\t}\n\tdelegate := storagemem.NewReadWriteBucket()\n\tfor path, content := range testFiles {\n\t\twriteObjectCloser, err := delegate.Put(ctx, path)\n\t\trequire.NoError(t, err)\n\t\t_, err = writeObjectCloser.Write([]byte(content))\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, writeObjectCloser.Close())\n\t}\n\t// Should walk with original prefix when no includes\n\ttestMaskReadBucket_WalkOptimization(\n\t\tt,\n\t\tdelegate,\n\t\t[]string{},\n\t\t\"\",\n\t\t[]string{\"\"},\n\t)\n\t// Should walk only include prefixes\n\ttestMaskReadBucket_WalkOptimization(\n\t\tt,\n\t\tdelegate,\n\t\t[]string{\"proto/v1\", \"proto/v2\"},\n\t\t\"\",\n\t\t[]string{\"proto/v1\", \"proto/v2\"},\n\t)\n\t// Should walk only the matching include prefix\n\ttestMaskReadBucket_WalkOptimization(\n\t\tt,\n\t\tdelegate,\n\t\t[]string{\"proto/v1\", \"proto/v2\"},\n\t\t\"proto/v1\",\n\t\t[]string{\"proto/v1\"},\n\t)\n\t// Should narrow to include prefixes under walk prefix\n\ttestMaskReadBucket_WalkOptimization(\n\t\tt,\n\t\tdelegate,\n\t\t[]string{\"proto/v1\", \"proto/v2\"},\n\t\t\"proto\",\n\t\t[]string{\"proto/v1\", \"proto/v2\"},\n\t)\n}\n\nfunc testMaskReadBucket(\n\tt *testing.T,\n\tdelegate storage.ReadWriteBucket,\n\ttestFiles map[string]string,\n\tincludePrefixes []string,\n\texcludePrefixes []string,\n\twalkPrefix string,\n\texpectedFiles []string,\n) {\n\tctx := t.Context()\n\n\t// Create prefix filter bucket\n\tfilteredBucket, err := storage.MaskReadBucket(delegate, includePrefixes, excludePrefixes)\n\trequire.NoError(t, err)\n\n\t// Test Walk operation\n\tvar actualFiles []string\n\terr = filteredBucket.Walk(ctx, walkPrefix, func(objectInfo storage.ObjectInfo) error {\n\t\tactualFiles = append(actualFiles, objectInfo.Path())\n\t\treturn nil\n\t})\n\trequire.NoError(t, err)\n\tsort.Strings(actualFiles)\n\tsort.Strings(expectedFiles)\n\tassert.Equal(t, expectedFiles, actualFiles)\n\n\t// Test Get/Stat operations based on include/exclude filters (not walk prefix)\n\t// Calculate which files should be accessible based on the include/exclude filters\n\taccessibleFiles := make(map[string]bool)\n\tfor file := range testFiles {\n\t\tshouldInclude := len(includePrefixes) == 0 // if no includes, include all by default\n\t\tif !shouldInclude {\n\t\t\t// Check if any include prefix matches\n\t\t\tfor _, includePrefix := range includePrefixes {\n\t\t\t\tif file == includePrefix || len(file) > len(includePrefix) && strings.HasPrefix(file, includePrefix) && file[len(includePrefix)] == '/' {\n\t\t\t\t\tshouldInclude = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif shouldInclude {\n\t\t\t// Check excludes\n\t\t\tshouldExclude := false\n\t\t\tfor _, excludePrefix := range excludePrefixes {\n\t\t\t\tif file == excludePrefix || len(file) > len(excludePrefix) && strings.HasPrefix(file, excludePrefix) && file[len(excludePrefix)] == '/' {\n\t\t\t\t\tshouldExclude = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !shouldExclude {\n\t\t\t\taccessibleFiles[file] = true\n\t\t\t}\n\t\t}\n\t}\n\t// Test Get operation for accessible files\n\tfor file := range accessibleFiles {\n\t\treadObjectCloser, err := filteredBucket.Get(ctx, file)\n\t\tassert.NoError(t, err, \"Should be able to get accessible file: %s\", file)\n\t\tif err == nil {\n\t\t\trequire.NoError(t, readObjectCloser.Close())\n\t\t}\n\t}\n\t// Test that non-accessible files return ErrNotExist\n\tfor file := range testFiles {\n\t\tif !accessibleFiles[file] {\n\t\t\t_, err := filteredBucket.Get(ctx, file)\n\t\t\tassert.ErrorIs(t, err, fs.ErrNotExist, \"Non-accessible file %s should return ErrNotExist\", file)\n\t\t\t_, err = filteredBucket.Stat(ctx, file)\n\t\t\tassert.ErrorIs(t, err, fs.ErrNotExist, \"Non-accessible file %s should return ErrNotExist for Stat\", file)\n\t\t}\n\t}\n}\n\nfunc testMaskReadBucket_WalkOptimization(t *testing.T,\n\tbucket storage.ReadWriteBucket,\n\tincludePrefixes []string,\n\twalkPrefix string,\n\texpectedWalkCalls []string,\n) {\n\ttrackingBucket := &walkTrackingBucket{delegate: bucket}\n\tfilteredBucket, err := storage.MaskReadBucket(trackingBucket, includePrefixes, []string{})\n\trequire.NoError(t, err)\n\terr = filteredBucket.Walk(t.Context(), walkPrefix, func(storage.ObjectInfo) error {\n\t\treturn nil\n\t})\n\trequire.NoError(t, err)\n\tsort.Strings(trackingBucket.walkCalls)\n\tsort.Strings(expectedWalkCalls)\n\tassert.Equal(t, expectedWalkCalls, trackingBucket.walkCalls)\n}\n\n// walkTrackingBucket wraps a ReadWriteBucket to track Walk calls\ntype walkTrackingBucket struct {\n\tdelegate  storage.ReadWriteBucket\n\twalkCalls []string\n}\n\nfunc (w *walkTrackingBucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) {\n\treturn w.delegate.Get(ctx, path)\n}\n\nfunc (w *walkTrackingBucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) {\n\treturn w.delegate.Stat(ctx, path)\n}\n\nfunc (w *walkTrackingBucket) Walk(ctx context.Context, prefix string, f func(storage.ObjectInfo) error) error {\n\tw.walkCalls = append(w.walkCalls, prefix)\n\treturn w.delegate.Walk(ctx, prefix, f)\n}\n"
  },
  {
    "path": "private/pkg/storage/matcher.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// Matcher is a path matcher.\n//\n// This will cause a Bucket to operate as if it only contains matching paths.\ntype Matcher interface {\n\t// MatchPath returns true if the path matches.\n\t//\n\t// The path is expected to be normalized and validated.\n\tMatchPath(string) bool\n\tisMatcher()\n}\n\n// MatchPathExt returns a Matcher for the extension.\nfunc MatchPathExt(ext string) Matcher {\n\treturn pathMatcherFunc(func(path string) bool {\n\t\treturn normalpath.Ext(path) == ext\n\t})\n}\n\n// MatchPathBase returns a Matcher for the base.\nfunc MatchPathBase(base string) Matcher {\n\treturn pathMatcherFunc(func(path string) bool {\n\t\treturn normalpath.Base(path) == base\n\t})\n}\n\n// MatchPathEqual returns a Matcher for the path.\nfunc MatchPathEqual(equalPath string) Matcher {\n\treturn pathMatcherFunc(func(path string) bool {\n\t\treturn path == equalPath\n\t})\n}\n\n// MatchPathEqualOrContained returns a Matcher for the path that matches\n// on paths equal or contained by equalOrContainingPath.\nfunc MatchPathEqualOrContained(equalOrContainingPath string) Matcher {\n\treturn pathMatcherFunc(func(path string) bool {\n\t\treturn normalpath.EqualsOrContainsPath(equalOrContainingPath, path, normalpath.Relative)\n\t})\n}\n\n// MatchPathContained returns a Matcher for the directory that matches\n// on paths by contained by containingDir.\nfunc MatchPathContained(containingDir string) Matcher {\n\treturn pathMatcherFunc(func(path string) bool {\n\t\treturn normalpath.ContainsPath(containingDir, path, normalpath.Relative)\n\t})\n}\n\n// MatchOr returns an Or of the Matchers.\nfunc MatchOr(matchers ...Matcher) Matcher {\n\treturn orMatcher(matchers)\n}\n\n// MatchAnd returns an And of the Matchers.\nfunc MatchAnd(matchers ...Matcher) Matcher {\n\treturn andMatcher(matchers)\n}\n\n// MatchNot returns an Not of the Matcher.\nfunc MatchNot(matcher Matcher) Matcher {\n\treturn notMatcher{matcher}\n}\n\n// ***** private *****\n\n// We limit or/and/not to Matchers as composite logic must assume\n// the input path is not modified, so that we can always return it\n\ntype pathMatcherFunc func(string) bool\n\nfunc (f pathMatcherFunc) MatchPath(path string) bool {\n\treturn f(path)\n}\n\nfunc (pathMatcherFunc) isMatcher() {}\n\ntype orMatcher []Matcher\n\nfunc (o orMatcher) MatchPath(path string) bool {\n\tfor _, matcher := range o {\n\t\tif matches := matcher.MatchPath(path); matches {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (orMatcher) isMatcher() {}\n\ntype andMatcher []Matcher\n\nfunc (a andMatcher) MatchPath(path string) bool {\n\tfor _, matcher := range a {\n\t\tif matches := matcher.MatchPath(path); !matches {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc (andMatcher) isMatcher() {}\n\ntype notMatcher struct {\n\tdelegate Matcher\n}\n\nfunc (n notMatcher) MatchPath(path string) bool {\n\treturn !n.delegate.MatchPath(path)\n}\n\nfunc (notMatcher) isMatcher() {}\n"
  },
  {
    "path": "private/pkg/storage/multi.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n)\n\n// MultiReadBucket takes the union of logically-unique ReadBuckets.\n//\n// This expects and validates that no paths overlap between the ReadBuckets.\n//\n// If no readBuckets are given, this returns a no-op ReadBucket.\n// If one readBucket is given, this returns the original ReadBucket.\n// Otherwise, this returns a ReadBucket that will get from all buckets.\nfunc MultiReadBucket(readBuckets ...ReadBucket) ReadBucket {\n\tswitch len(readBuckets) {\n\tcase 0:\n\t\treturn nopReadBucket{}\n\tcase 1:\n\t\treturn readBuckets[0]\n\tdefault:\n\t\treturn newMultiReadBucket(readBuckets, false)\n\t}\n}\n\n// OverlayReadBucket takes the union of the ReadBuckets, overlaying earlier\n// ReadBuckets on top of the other.\n//\n// If two ReadBuckets have the same path, the first ReadBucket with the\n// given path will be used.\n//\n// If no readBuckets are given, this returns a no-op ReadBucket.\n// If one readBucket is given, this returns the original ReadBucket.\n// Otherwise, this returns a ReadBucket that will get from all buckets in\n// the order they are given.\nfunc OverlayReadBucket(readBuckets ...ReadBucket) ReadBucket {\n\tswitch len(readBuckets) {\n\tcase 0:\n\t\treturn nopReadBucket{}\n\tcase 1:\n\t\treturn readBuckets[0]\n\tdefault:\n\t\treturn newMultiReadBucket(readBuckets, true)\n\t}\n}\n\ntype multiReadBucket struct {\n\tdelegates []ReadBucket\n\toverlay   bool\n}\n\nfunc newMultiReadBucket(\n\tdelegates []ReadBucket,\n\toverlay bool,\n) *multiReadBucket {\n\treturn &multiReadBucket{\n\t\tdelegates: delegates,\n\t\toverlay:   overlay,\n\t}\n}\n\nfunc (m *multiReadBucket) Get(ctx context.Context, path string) (ReadObjectCloser, error) {\n\tif m.overlay {\n\t\t// If overlay is enabled, attempt a Get operation against the first bucket. If the file is\n\t\t// found, we avoid the potentially expensive Stat call.\n\t\treadObjectCloser, err := m.delegates[0].Get(ctx, path)\n\t\tif err != nil {\n\t\t\tif !errors.Is(err, fs.ErrNotExist) {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// Fallthrough to expensive logic to check every delegate.\n\t\t} else {\n\t\t\t// If we did find a ReadObjectCloser, return it, otherwise do the expensive logic to\n\t\t\t// check every delegate.\n\t\t\treturn readObjectCloser, nil\n\t\t}\n\t}\n\t_, delegateIndex, err := m.getObjectInfoAndDelegateIndex(ctx, \"read\", path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn m.delegates[delegateIndex].Get(ctx, path)\n}\n\nfunc (m *multiReadBucket) Stat(ctx context.Context, path string) (ObjectInfo, error) {\n\tobjectInfo, _, err := m.getObjectInfoAndDelegateIndex(ctx, \"stat\", path)\n\treturn objectInfo, err\n}\n\nfunc (m *multiReadBucket) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error {\n\tseenPathToExternalPath := make(map[string]string)\n\tfor _, delegate := range m.delegates {\n\t\tif err := delegate.Walk(\n\t\t\tctx,\n\t\t\tprefix,\n\t\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\t\tpath := objectInfo.Path()\n\t\t\t\texternalPath := objectInfo.ExternalPath()\n\t\t\t\tif existingExternalPath, ok := seenPathToExternalPath[path]; ok {\n\t\t\t\t\t// If overlay, we can just return - we've already walked this path.\n\t\t\t\t\tif m.overlay {\n\t\t\t\t\t\treturn nil\n\t\t\t\t\t}\n\t\t\t\t\t// this does not return all paths that are matching, unlike Get and Stat\n\t\t\t\t\t// we do not want to continue iterating, as calling Walk on the same path could cause errors downstream\n\t\t\t\t\t// as callers expect a single call per path.\n\t\t\t\t\treturn NewErrExistsMultipleLocations(path, existingExternalPath, externalPath)\n\t\t\t\t}\n\t\t\t\tseenPathToExternalPath[path] = externalPath\n\t\t\t\treturn f(objectInfo)\n\t\t\t},\n\t\t); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (m *multiReadBucket) getObjectInfoAndDelegateIndex(\n\tctx context.Context,\n\top string,\n\tpath string,\n) (ObjectInfo, int, error) {\n\tvar objectInfos []ObjectInfo\n\tvar delegateIndices []int\n\tfor i, delegate := range m.delegates {\n\t\tobjectInfo, err := delegate.Stat(ctx, path)\n\t\tif err != nil {\n\t\t\tif IsNotExist(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, 0, err\n\t\t}\n\t\t// If overlay, we can stop here - we've found the path and will select\n\t\t// the first Bucket that matches this path.\n\t\tif m.overlay {\n\t\t\treturn objectInfo, i, nil\n\t\t}\n\t\tobjectInfos = append(objectInfos, objectInfo)\n\t\tdelegateIndices = append(delegateIndices, i)\n\t}\n\tswitch len(objectInfos) {\n\tcase 0:\n\t\treturn nil, 0, &fs.PathError{Op: op, Path: path, Err: fs.ErrNotExist}\n\tcase 1:\n\t\treturn objectInfos[0], delegateIndices[0], nil\n\tdefault:\n\t\texternalPaths := make([]string, len(objectInfos))\n\t\tfor i, objectInfo := range objectInfos {\n\t\t\texternalPaths[i] = objectInfo.ExternalPath()\n\t\t}\n\t\treturn nil, 0, NewErrExistsMultipleLocations(path, externalPaths...)\n\t}\n}\n\ntype nopReadBucket struct{}\n\nfunc (nopReadBucket) Get(ctx context.Context, path string) (ReadObjectCloser, error) {\n\tpath, err := storageutil.ValidatePath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn nil, &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n}\n\nfunc (nopReadBucket) Stat(ctx context.Context, path string) (ObjectInfo, error) {\n\tpath, err := storageutil.ValidatePath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn nil, &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n}\n\nfunc (nopReadBucket) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error {\n\t_, err := storageutil.ValidatePrefix(prefix)\n\treturn err\n}\n"
  },
  {
    "path": "private/pkg/storage/storage.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage implements a simple storage abstraction.\n//\n// This is meant to abstract filesystem calls, as well as be a wrapper\n// for in-memory or remote storage. It also provides a smaller attack\n// vector as implementations can do verifications as to what is accessed\n// and what is not.\npackage storage\n"
  },
  {
    "path": "private/pkg/storage/storagearchive/storagearchive.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storagearchive implements archive utilities.\npackage storagearchive\n\nimport (\n\t\"archive/tar\"\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"strings\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n\t\"github.com/klauspost/compress/zip\"\n)\n\nvar (\n\t// ErrFileSizeLimit is returned when file read limit is reached.\n\t//\n\t// See [WithMaxFileSizeUntarOption]\n\tErrFileSizeLimit = errors.New(\"file size exceeded read limit\")\n)\n\n// Tar tars the given bucket to the writer.\n//\n// Only regular files are added to the writer.\n// All files are written as 0644.\nfunc Tar(\n\tctx context.Context,\n\treadBucket storage.ReadBucket,\n\twriter io.Writer,\n) (retErr error) {\n\ttarWriter := tar.NewWriter(writer)\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, tarWriter.Close())\n\t}()\n\treturn storage.WalkReadObjects(\n\t\tctx,\n\t\treadBucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tdata, err := io.ReadAll(readObject)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := tarWriter.WriteHeader(\n\t\t\t\t&tar.Header{\n\t\t\t\t\tTypeflag: tar.TypeReg,\n\t\t\t\t\tName:     readObject.Path(),\n\t\t\t\t\tSize:     int64(len(data)),\n\t\t\t\t\t// If we ever use this outside of testing, we will want to do something about this\n\t\t\t\t\tMode: 0644,\n\t\t\t\t},\n\t\t\t); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t_, err = tarWriter.Write(data)\n\t\t\treturn err\n\t\t},\n\t)\n}\n\n// Untar untars the given tar archive from the reader into the bucket.\n//\n// Only regular files are added to the bucket.\n//\n// Paths from the tar archive will be mapped before adding to the bucket.\n// Mapper can be nil.\n// StripComponents happens before the mapper.\nfunc Untar(\n\tctx context.Context,\n\treader io.Reader,\n\twriteBucket storage.WriteBucket,\n\toptions ...UntarOption,\n) error {\n\tuntarOptions := newUntarOptions()\n\tfor _, option := range options {\n\t\toption(untarOptions)\n\t}\n\ttarReader := tar.NewReader(reader)\n\twalkChecker := storageutil.NewWalkChecker()\n\tfor tarHeader, err := tarReader.Next(); err != io.EOF; tarHeader, err = tarReader.Next() {\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif err := walkChecker.Check(ctx); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif tarHeader.Size < 0 {\n\t\t\treturn fmt.Errorf(\"invalid size for tar file %s: %d\", tarHeader.Name, tarHeader.Size)\n\t\t}\n\t\tif isAppleExtendedAttributesFile(tarHeader.FileInfo()) {\n\t\t\tcontinue\n\t\t}\n\t\tpath, ok, err := unmapArchivePath(tarHeader.Name, untarOptions.filePathMatcher, untarOptions.stripComponentCount)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !ok || !tarHeader.FileInfo().Mode().IsRegular() {\n\t\t\tcontinue\n\t\t}\n\t\tif untarOptions.maxFileSize != 0 && tarHeader.Size > untarOptions.maxFileSize {\n\t\t\treturn fmt.Errorf(\"%w %s:%d\", ErrFileSizeLimit, tarHeader.Name, tarHeader.Size)\n\t\t}\n\t\tif err := storage.CopyReader(ctx, writeBucket, tarReader, path); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\n// UntarOption is an option for Untar.\ntype UntarOption func(*untarOptions)\n\n// UntarWithMaxFileSize returns a new UntarOption that limits the maximum file size.\n//\n// The default is to have no limit.\nfunc UntarWithMaxFileSize(maxFileSize int64) UntarOption {\n\treturn func(untarOptions *untarOptions) {\n\t\tuntarOptions.maxFileSize = maxFileSize\n\t}\n}\n\n// UntarWithStripComponentCount returns a new UntarOption that strips the specified number of components.\nfunc UntarWithStripComponentCount(stripComponentCount uint32) UntarOption {\n\treturn func(untarOptions *untarOptions) {\n\t\tuntarOptions.stripComponentCount = stripComponentCount\n\t}\n}\n\n// UntarWithFilePathMatcher returns a new UntarOption that will only write a given file to the\n// bucket if the function returns true on the normalized file path.\n//\n// The matcher will be applied after components are stripped.\nfunc UntarWithFilePathMatcher(filePathMatcher func(string) bool) UntarOption {\n\treturn func(untarOptions *untarOptions) {\n\t\tuntarOptions.filePathMatcher = filePathMatcher\n\t}\n}\n\n// Zip zips the given bucket to the writer.\n//\n// Only regular files are added to the writer.\nfunc Zip(\n\tctx context.Context,\n\treadBucket storage.ReadBucket,\n\twriter io.Writer,\n\tcompressed bool,\n) (retErr error) {\n\tzipWriter := zip.NewWriter(writer)\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, zipWriter.Close())\n\t}()\n\treturn storage.WalkReadObjects(\n\t\tctx,\n\t\treadBucket,\n\t\t\"\",\n\t\tfunc(readObject storage.ReadObject) error {\n\t\t\tmethod := zip.Store\n\t\t\tif compressed {\n\t\t\t\tmethod = zip.Deflate\n\t\t\t}\n\t\t\theader := &zip.FileHeader{\n\t\t\t\tName:   readObject.Path(),\n\t\t\t\tMethod: method,\n\t\t\t}\n\t\t\twriter, err := zipWriter.CreateHeader(header)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t_, err = io.Copy(writer, readObject)\n\t\t\treturn err\n\t\t},\n\t)\n}\n\n// Unzip unzips the given zip archive from the reader into the bucket.\n//\n// Only regular files are added to the bucket.\n//\n// Paths from the zip archive will be mapped before adding to the bucket.\n// Mapper can be nil.\n// StripComponents happens before the mapper.\nfunc Unzip(\n\tctx context.Context,\n\treaderAt io.ReaderAt,\n\tsize int64,\n\twriteBucket storage.WriteBucket,\n\toptions ...UnzipOption,\n) error {\n\tunzipOptions := newUnzipOptions()\n\tfor _, option := range options {\n\t\toption(unzipOptions)\n\t}\n\tif size < 0 {\n\t\treturn fmt.Errorf(\"unknown size to unzip: %d\", int(size))\n\t}\n\tif size == 0 {\n\t\treturn nil\n\t}\n\tzipReader, err := zip.NewReader(readerAt, size)\n\tif err != nil {\n\t\treturn err\n\t}\n\twalkChecker := storageutil.NewWalkChecker()\n\t// reads can be done concurrently in the future\n\tfor _, zipFile := range zipReader.File {\n\t\tif err := walkChecker.Check(ctx); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tpath, ok, err := unmapArchivePath(zipFile.Name, unzipOptions.filePathMatcher, unzipOptions.stripComponentCount)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tif isAppleExtendedAttributesFile(zipFile.FileInfo()) {\n\t\t\tcontinue\n\t\t}\n\t\tif zipFile.FileInfo().Mode().IsRegular() {\n\t\t\tif err := copyZipFile(ctx, writeBucket, zipFile, path); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n\n// UnzipOption is an option for Unzip.\ntype UnzipOption func(*unzipOptions)\n\n// UnzipWithStripComponentCount returns a new UnzipOption that strips the specified number of components.\nfunc UnzipWithStripComponentCount(stripComponentCount uint32) UnzipOption {\n\treturn func(unzipOptions *unzipOptions) {\n\t\tunzipOptions.stripComponentCount = stripComponentCount\n\t}\n}\n\n// UnzipWithFilePathMatcher returns a new UnzipOption that will only write a given file to the\n// bucket if the function returns true on the normalized file path.\n//\n// The matcher will be applied after components are stripped.\nfunc UnzipWithFilePathMatcher(filePathMatcher func(string) bool) UnzipOption {\n\treturn func(unzipOptions *unzipOptions) {\n\t\tunzipOptions.filePathMatcher = filePathMatcher\n\t}\n}\n\nfunc isAppleExtendedAttributesFile(fileInfo fs.FileInfo) bool {\n\t// On macOS, .tar archives created with libarchive will contain additional\n\t// files with a prefix of \"._\" if there are files with extended attributes\n\t// and copyfile is enabled.\n\t// Archive Utility.app has a similar behavior when creating .zip archives,\n\t// except they are placed under a separate MACOSX directory tree.\n\t// Here, both are handled by just ignoring all files with a \"._\" prefix.\n\t// This is a reasonable compromise because files that live in a Module\n\t// (.proto files, configuration files such as buf.yaml, README files) are\n\t// almost never prefixed with ._, and fixing this issue in this manner\n\t// outweighs the slight incorrectness.\n\treturn strings.HasPrefix(fileInfo.Name(), \"._\")\n}\n\nfunc copyZipFile(\n\tctx context.Context,\n\twriteBucket storage.WriteBucket,\n\tzipFile *zip.File,\n\tpath string,\n) (retErr error) {\n\treadCloser, err := zipFile.Open()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readCloser.Close())\n\t}()\n\treturn storage.CopyReader(ctx, writeBucket, readCloser, path)\n}\n\nfunc unmapArchivePath(\n\tarchivePath string,\n\tfilePathMatcher func(string) bool,\n\tstripComponentCount uint32,\n) (string, bool, error) {\n\tif archivePath == \"\" {\n\t\treturn \"\", false, errors.New(\"empty archive file name\")\n\t}\n\tfullPath, err := normalpath.NormalizeAndValidate(archivePath)\n\tif err != nil {\n\t\treturn \"\", false, err\n\t}\n\tif fullPath == \".\" {\n\t\treturn \"\", false, nil\n\t}\n\tfullPath, ok := normalpath.StripComponents(fullPath, stripComponentCount)\n\tif !ok {\n\t\treturn \"\", false, nil\n\t}\n\tif filePathMatcher != nil && !filePathMatcher(fullPath) {\n\t\treturn \"\", false, nil\n\t}\n\treturn fullPath, true, nil\n}\n\ntype untarOptions struct {\n\tmaxFileSize         int64\n\tstripComponentCount uint32\n\tfilePathMatcher     func(string) bool\n}\n\nfunc newUntarOptions() *untarOptions {\n\treturn &untarOptions{}\n}\n\ntype unzipOptions struct {\n\tstripComponentCount uint32\n\tfilePathMatcher     func(string) bool\n}\n\nfunc newUnzipOptions() *unzipOptions {\n\treturn &unzipOptions{}\n}\n"
  },
  {
    "path": "private/pkg/storage/storagearchive/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage storagearchive\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/storagemem/bucket.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storagemem\n\nimport (\n\t\"context\"\n\t\"io/fs\"\n\t\"sort\"\n\t\"sync\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem/internal\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\ntype bucket struct {\n\tpathToImmutableObject map[string]*internal.ImmutableObject\n\tlock                  sync.RWMutex\n}\n\nfunc newBucket(pathToImmutableObject map[string]*internal.ImmutableObject) *bucket {\n\tif pathToImmutableObject == nil {\n\t\tpathToImmutableObject = make(map[string]*internal.ImmutableObject)\n\t}\n\treturn &bucket{\n\t\tpathToImmutableObject: pathToImmutableObject,\n\t}\n}\n\nfunc (b *bucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) {\n\timmutableObject, err := b.readLockAndGetImmutableObject(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newReadObjectCloser(immutableObject), nil\n}\n\nfunc (b *bucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) {\n\treturn b.readLockAndGetImmutableObject(ctx, path)\n}\n\nfunc (b *bucket) Walk(ctx context.Context, prefix string, f func(storage.ObjectInfo) error) error {\n\tprefix, err := storageutil.ValidatePrefix(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\twalkChecker := storageutil.NewWalkChecker()\n\tb.lock.RLock()\n\tdefer b.lock.RUnlock()\n\t// To ensure same iteration order.\n\t// We could create this in-place during puts with an insertion sort if this\n\t// gets to be time prohibitive.\n\tpaths := make([]string, 0, len(b.pathToImmutableObject))\n\tfor path := range b.pathToImmutableObject {\n\t\tpaths = append(paths, path)\n\t}\n\tsort.Strings(paths)\n\tfor _, path := range paths {\n\t\timmutableObject, ok := b.pathToImmutableObject[path]\n\t\tif !ok {\n\t\t\t// this is a system error\n\t\t\treturn syserror.Newf(\"path %q not in pathToObject\", path)\n\t\t}\n\t\tif err := walkChecker.Check(ctx); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif !normalpath.EqualsOrContainsPath(prefix, path, normalpath.Relative) {\n\t\t\tcontinue\n\t\t}\n\t\tif err := f(immutableObject); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (b *bucket) Put(ctx context.Context, path string, _ ...storage.PutOption) (storage.WriteObjectCloser, error) {\n\t// No need to lock as we do no modifications until close\n\tpath, err := storageutil.ValidatePath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// storagemem writes are already atomic - don't need special handling for PutWithAtomic.\n\treturn newWriteObjectCloser(b, path), nil\n}\n\nfunc (b *bucket) Delete(ctx context.Context, path string) error {\n\tpath, err := storageutil.ValidatePath(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.lock.Lock()\n\tdefer b.lock.Unlock()\n\tif _, ok := b.pathToImmutableObject[path]; !ok {\n\t\treturn &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n\t}\n\t// Note that if there is an existing reader for an object of the same path,\n\t// that reader will continue to read the original file, but we accept this\n\t// as no less consistent than os mechanics.\n\tdelete(b.pathToImmutableObject, path)\n\treturn nil\n}\n\nfunc (b *bucket) DeleteAll(ctx context.Context, prefix string) error {\n\tprefix, err := storageutil.ValidatePrefix(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.lock.Lock()\n\tdefer b.lock.Unlock()\n\tfor path := range b.pathToImmutableObject {\n\t\tif normalpath.EqualsOrContainsPath(prefix, path, normalpath.Relative) {\n\t\t\t// Note that if there is an existing reader for an object of the same path,\n\t\t\t// that reader will continue to read the original file, but we accept this\n\t\t\t// as no less consistent than os mechanics.\n\t\t\tdelete(b.pathToImmutableObject, path)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (*bucket) SetExternalAndLocalPathsSupported() bool {\n\treturn true\n}\n\nfunc (b *bucket) ToReadBucket() (storage.ReadBucket, error) {\n\treturn b, nil\n}\n\nfunc (b *bucket) readLockAndGetImmutableObject(ctx context.Context, path string) (*internal.ImmutableObject, error) {\n\tpath, err := storageutil.ValidatePath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tb.lock.RLock()\n\tdefer b.lock.RUnlock()\n\timmutableObject, ok := b.pathToImmutableObject[path]\n\tif !ok {\n\t\t// it would be nice if this was external path for every bucket\n\t\t// the issue is here: we don't know the external path for memory buckets\n\t\t// because we store external paths individually, so if we do not have\n\t\t// an object, we do not have an external path\n\t\treturn nil, &fs.PathError{Op: \"read\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn immutableObject, nil\n}\n"
  },
  {
    "path": "private/pkg/storage/storagemem/internal/internal.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 internal splits out ImmutableObject into a separate package from storagemem\n// to make it impossible to modify ImmutableObject via direct field access.\npackage internal\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n)\n\n// ImmutableObject is an object that contains a path, external path,\n// and data that is never modified.\n//\n// We make this a struct so there is no weirdness with returning a nil interface.\ntype ImmutableObject struct {\n\tstorageutil.ObjectInfo\n\n\tdata []byte\n}\n\n// NewImmutableObject returns a new ImmutableObject.\n//\n// path is expected to always be non-empty.\n// If externalPath is empty, normalpath.Unnormalize(path) is used.\nfunc NewImmutableObject(\n\tpath string,\n\texternalPath string,\n\tlocalPath string,\n\tdata []byte,\n) *ImmutableObject {\n\tif externalPath == \"\" {\n\t\texternalPath = normalpath.Unnormalize(path)\n\t}\n\treturn &ImmutableObject{\n\t\tObjectInfo: storageutil.NewObjectInfo(path, externalPath, localPath),\n\t\tdata:       data,\n\t}\n}\n\n// Data returns the data.\n//\n// DO NOT MODIFY.\nfunc (i *ImmutableObject) Data() []byte {\n\treturn i.data\n}\n"
  },
  {
    "path": "private/pkg/storage/storagemem/internal/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage internal\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/storagemem/read_object_closer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storagemem\n\nimport (\n\t\"bytes\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem/internal\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n)\n\ntype readObjectCloser struct {\n\tstorageutil.ObjectInfo\n\n\treader *bytes.Reader\n\tclosed bool\n}\n\nfunc newReadObjectCloser(immutableObject *internal.ImmutableObject) *readObjectCloser {\n\treturn &readObjectCloser{\n\t\tObjectInfo: immutableObject.ObjectInfo,\n\t\treader:     bytes.NewReader(immutableObject.Data()),\n\t}\n}\n\nfunc (r *readObjectCloser) Read(p []byte) (int, error) {\n\tif r.closed {\n\t\treturn 0, storage.ErrClosed\n\t}\n\treturn r.reader.Read(p)\n}\n\nfunc (r *readObjectCloser) Close() error {\n\tif r.closed {\n\t\treturn storage.ErrClosed\n\t}\n\tr.closed = true\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/storage/storagemem/storagemem.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storagemem implements an in-memory storage Bucket.\npackage storagemem\n\nimport (\n\t\"context\"\n\t\"errors\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem/internal\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n)\n\nvar errDuplicatePath = errors.New(\"duplicate path\")\n\n// NewReadWriteBucket returns a new in-memory ReadWriteBucket.\nfunc NewReadWriteBucket() storage.ReadWriteBucket {\n\treturn newBucket(nil)\n}\n\n// NewReadBucket returns a new ReadBucket.\nfunc NewReadBucket(pathToData map[string][]byte) (storage.ReadBucket, error) {\n\tpathToImmutableObject := make(map[string]*internal.ImmutableObject, len(pathToData))\n\tfor path, data := range pathToData {\n\t\tpath, err := storageutil.ValidatePath(path)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// This could happen if two paths normalize to the same path.\n\t\tif _, ok := pathToImmutableObject[path]; ok {\n\t\t\treturn nil, errDuplicatePath\n\t\t}\n\t\tpathToImmutableObject[path] = internal.NewImmutableObject(path, \"\", \"\", data)\n\t}\n\treturn newBucket(pathToImmutableObject), nil\n}\n\n// CopyReadBucket will copy the input ReadBucket into an in-memory ReadBucket, if the input\n// ReadBucket is not already an in-memory ReadBucket.\nfunc CopyReadBucket(ctx context.Context, inputBucket storage.ReadBucket) (storage.ReadBucket, error) {\n\tif _, ok := inputBucket.(*bucket); ok {\n\t\treturn inputBucket, nil\n\t}\n\tinMemoryBucket := newBucket(nil)\n\tif _, err := storage.Copy(ctx, inputBucket, inMemoryBucket, storage.CopyWithExternalAndLocalPaths()); err != nil {\n\t\treturn nil, err\n\t}\n\treturn inMemoryBucket, nil\n}\n"
  },
  {
    "path": "private/pkg/storage/storagemem/storagemem_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storagemem_test\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagetesting\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nvar storagetestingDirPath = filepath.Join(\"..\", \"storagetesting\")\n\nfunc TestMem(t *testing.T) {\n\tt.Parallel()\n\tstoragetesting.RunTestSuite(\n\t\tt,\n\t\tstoragetestingDirPath,\n\t\ttestNewReadBucket,\n\t\ttestNewWriteBucket,\n\t\ttestWriteBucketToReadBucket,\n\t\tfalse,\n\t)\n}\n\nfunc testNewReadBucket(t *testing.T, dirPath string, storageosProvider storageos.Provider) (storage.ReadBucket, storagetesting.GetExternalPathFunc) {\n\tosBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tdirPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\treadWriteBucket := storagemem.NewReadWriteBucket()\n\t_, err = storage.Copy(\n\t\tt.Context(),\n\t\tosBucket,\n\t\treadWriteBucket,\n\t\tstorage.CopyWithExternalAndLocalPaths(),\n\t)\n\trequire.NoError(t, err)\n\treturn readWriteBucket, func(t *testing.T, rootPath string, path string) string {\n\t\t// Join calls Clean\n\t\treturn normalpath.Unnormalize(normalpath.Join(rootPath, path))\n\t}\n}\n\nfunc testNewWriteBucket(*testing.T, storageos.Provider) storage.WriteBucket {\n\treturn storagemem.NewReadWriteBucket()\n}\n\nfunc testWriteBucketToReadBucket(t *testing.T, writeBucket storage.WriteBucket) storage.ReadBucket {\n\t// hacky\n\treadWriteBucket, ok := writeBucket.(storage.ReadWriteBucket)\n\trequire.True(t, ok)\n\treturn readWriteBucket\n}\n"
  },
  {
    "path": "private/pkg/storage/storagemem/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage storagemem\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/storagemem/write_object_closer.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storagemem\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagemem/internal\"\n)\n\ntype writeObjectCloser struct {\n\tbucket       *bucket\n\tpath         string\n\texternalPath string\n\tlocalPath    string\n\tbuffer       *bytes.Buffer\n\tclosed       bool\n}\n\nfunc newWriteObjectCloser(\n\tbucket *bucket,\n\tpath string,\n) *writeObjectCloser {\n\treturn &writeObjectCloser{\n\t\tbucket: bucket,\n\t\tpath:   path,\n\t\tbuffer: bytes.NewBuffer(nil),\n\t}\n}\n\nfunc (w *writeObjectCloser) Write(p []byte) (int, error) {\n\tif w.closed {\n\t\treturn 0, storage.ErrClosed\n\t}\n\treturn w.buffer.Write(p)\n}\n\nfunc (w *writeObjectCloser) SetExternalPath(externalPath string) error {\n\tif w.externalPath != \"\" {\n\t\treturn fmt.Errorf(\"external path already set: %q\", w.externalPath)\n\t}\n\tw.externalPath = externalPath\n\treturn nil\n}\n\nfunc (w *writeObjectCloser) SetLocalPath(localPath string) error {\n\tif w.localPath != \"\" {\n\t\treturn fmt.Errorf(\"local path already set: %q\", w.localPath)\n\t}\n\tw.localPath = localPath\n\treturn nil\n}\n\nfunc (w *writeObjectCloser) Close() error {\n\tif w.closed {\n\t\treturn storage.ErrClosed\n\t}\n\tw.closed = true\n\t// overwrites anything existing\n\t// this is the same behavior as storageos\n\tw.bucket.lock.Lock()\n\tdefer w.bucket.lock.Unlock()\n\t// Note that if there is an existing reader for an object of the same path,\n\t// that reader will continue to read the original file, but we accept this\n\t// as no less consistent than os mechanics.\n\tw.bucket.pathToImmutableObject[w.path] = internal.NewImmutableObject(\n\t\tw.path,\n\t\tw.externalPath,\n\t\tw.localPath,\n\t\tw.buffer.Bytes(),\n\t)\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/storage/storageos/bucket.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storageos\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"sync/atomic\"\n\n\t\"buf.build/go/standard/xpath/xfilepath\"\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\n// errNotDir is the error returned if a path is not a directory.\nvar errNotDir = errors.New(\"not a directory\")\n\ntype bucket struct {\n\trootPath         string\n\tabsoluteRootPath string\n\tsymlinks         bool\n}\n\nfunc newBucket(rootPath string, symlinks bool) (*bucket, error) {\n\trootPath = normalpath.Unnormalize(rootPath)\n\tif err := validateDirPathExists(rootPath, symlinks); err != nil {\n\t\treturn nil, err\n\t}\n\tabsoluteRootPath, err := filepath.Abs(rootPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// do not validate - allow anything with OS buckets including\n\t// absolute paths and jumping context\n\trootPath = normalpath.Normalize(rootPath)\n\treturn &bucket{\n\t\trootPath:         rootPath,\n\t\tabsoluteRootPath: absoluteRootPath,\n\t\tsymlinks:         symlinks,\n\t}, nil\n}\n\nfunc (b *bucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) {\n\texternalPath, err := b.getExternalPath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := b.validateExternalPath(path, externalPath); err != nil {\n\t\treturn nil, err\n\t}\n\tresolvedPath := externalPath\n\tif b.symlinks {\n\t\tresolvedPath, err = filepath.EvalSymlinks(externalPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tfile, err := os.Open(resolvedPath)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// we could use fileInfo.Name() however we might as well use the externalPath\n\treturn newReadObjectCloser(\n\t\tpath,\n\t\texternalPath,\n\t\tfile,\n\t), nil\n}\n\nfunc (b *bucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) {\n\texternalPath, err := b.getExternalPath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := b.validateExternalPath(path, externalPath); err != nil {\n\t\treturn nil, err\n\t}\n\t// we could use fileInfo.Name() however we might as well use the externalPath\n\treturn storageutil.NewObjectInfo(\n\t\tpath,\n\t\texternalPath,\n\t\t// In storageos, the external path is also the local path.\n\t\texternalPath,\n\t), nil\n}\n\nfunc (b *bucket) Walk(\n\tctx context.Context,\n\tprefix string,\n\tf func(storage.ObjectInfo) error,\n) error {\n\texternalPrefix, err := b.getExternalPrefix(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\twalkChecker := storageutil.NewWalkChecker()\n\tvar walkOptions []xfilepath.WalkOption\n\tif b.symlinks {\n\t\twalkOptions = append(walkOptions, xfilepath.WalkWithSymlinks())\n\t}\n\tif err := xfilepath.Walk(\n\t\texternalPrefix,\n\t\tfunc(externalPath string, fileInfo os.FileInfo, err error) error {\n\t\t\tif err != nil {\n\t\t\t\t// this can happen if a symlink is broken\n\t\t\t\t// in this case, we just want to continue the walk\n\t\t\t\tif b.symlinks && os.IsNotExist(err) {\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif err := walkChecker.Check(ctx); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tabsoluteExternalPath, err := filepath.Abs(externalPath)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif fileInfo.Mode().IsRegular() {\n\t\t\t\tpath, err := normalpath.Rel(b.absoluteRootPath, absoluteExternalPath)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\t// just in case\n\t\t\t\tpath, err = normalpath.NormalizeAndValidate(path)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif err := f(\n\t\t\t\t\tstorageutil.NewObjectInfo(\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\texternalPath,\n\t\t\t\t\t\t// In storageos, the external path is also the local path.\n\t\t\t\t\t\texternalPath,\n\t\t\t\t\t),\n\t\t\t\t); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t\twalkOptions...,\n\t); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\t// Should be a no-op according to the spec.\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (b *bucket) Put(ctx context.Context, path string, options ...storage.PutOption) (storage.WriteObjectCloser, error) {\n\texternalPath, err := b.getExternalPath(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\texternalDir := filepath.Dir(externalPath)\n\tvar fileInfo os.FileInfo\n\tif b.symlinks {\n\t\tfileInfo, err = os.Stat(externalDir)\n\t} else {\n\t\tfileInfo, err = os.Lstat(externalDir)\n\t}\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\tif err := os.MkdirAll(externalDir, 0755); err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\treturn nil, err\n\t\t}\n\t} else if !fileInfo.IsDir() {\n\t\treturn nil, newErrNotDir(externalDir)\n\t}\n\tvar file *os.File\n\tvar finalPath string\n\tif storage.NewPutOptions(options).Atomic() {\n\t\tfile, err = os.CreateTemp(externalDir, \".tmp\"+filepath.Base(externalPath)+\"*\")\n\t\tfinalPath = externalPath\n\t} else {\n\t\tfile, err = os.Create(externalPath)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn newWriteObjectCloser(\n\t\tfile,\n\t\tfinalPath,\n\t), nil\n}\n\nfunc (b *bucket) Delete(ctx context.Context, path string) error {\n\texternalPath, err := b.getExternalPath(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// Note: this deletes the file at the path, but it may\n\t// leave orphan parent directories around that were\n\t// created by the MkdirAll in Put.\n\tif err := os.Remove(externalPath); err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (b *bucket) DeleteAll(ctx context.Context, prefix string) error {\n\texternalPrefix, err := b.getExternalPrefix(prefix)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif err := os.RemoveAll(externalPrefix); err != nil {\n\t\t// this is a no-nop per the documentation\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil\n\t\t}\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc (*bucket) SetExternalAndLocalPathsSupported() bool {\n\treturn false\n}\n\nfunc (b *bucket) getExternalPath(path string) (string, error) {\n\tpath, err := storageutil.ValidatePath(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trealClean, err := xfilepath.RealClean(normalpath.Join(b.rootPath, path))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn normalpath.Unnormalize(realClean), nil\n}\n\nfunc (b *bucket) validateExternalPath(path string, externalPath string) error {\n\t// this is potentially introducing two calls to a file\n\t// instead of one, ie we do both Stat and Open as opposed to just Open\n\t// we do this to make sure we are only reading regular files\n\tvar fileInfo os.FileInfo\n\tvar err error\n\tif b.symlinks {\n\t\tfileInfo, err = os.Stat(externalPath)\n\t} else {\n\t\tfileInfo, err = os.Lstat(externalPath)\n\t}\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n\t\t}\n\t\t// The path might have a regular file in one of its\n\t\t// elements (e.g. 'foo/bar/baz.proto' where 'bar' is a\n\t\t// regular file).\n\t\t//\n\t\t// In this case, the standard library will return an\n\t\t// os.PathError, but there isn't an exported error value\n\t\t// to check against (i.e. os.Is*). But we can still discover\n\t\t// whether or not this is the case by checking if any of the\n\t\t// path components represents a regular file (e.g. 'foo/bar').\n\t\t//\n\t\t// It's important that we detect these cases so that\n\t\t// multi buckets don't unnecessarily fail when one of\n\t\t// its delegates actually defines the path.\n\t\tlastParentPath := externalPath\n\t\tparentPath := filepath.Dir(externalPath)\n\t\tfor ; parentPath != lastParentPath; lastParentPath, parentPath = parentPath, filepath.Dir(parentPath) {\n\t\t\tparentFileInfo, err := os.Stat(parentPath)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif parentFileInfo.Mode().IsRegular() {\n\t\t\t\t// This error primarily serves as a sentinel error,\n\t\t\t\t// but we preserve the original path argument so that\n\t\t\t\t// the error still makes sense to the user.\n\t\t\t\treturn &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n\t\t\t}\n\t\t}\n\t\treturn err\n\t}\n\tif !fileInfo.Mode().IsRegular() {\n\t\t// making this a user error as any access means this was generally requested\n\t\t// by the user, since we only call the function for Walk on regular files\n\t\treturn &fs.PathError{Op: \"stat\", Path: path, Err: fs.ErrNotExist}\n\t}\n\treturn nil\n}\n\nfunc (b *bucket) getExternalPrefix(prefix string) (string, error) {\n\tprefix, err := storageutil.ValidatePrefix(prefix)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\trealClean, err := xfilepath.RealClean(normalpath.Join(b.rootPath, prefix))\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn normalpath.Unnormalize(realClean), nil\n}\n\ntype readObjectCloser struct {\n\t// we use ObjectInfo for Path, ExternalPath, etc to make sure this is static\n\t// we put ObjectInfos in maps in other places so we do not want this to change\n\t// this could be a problem if the underlying file is concurrently moved or resized however\n\tstorageutil.ObjectInfo\n\n\tfile *os.File\n}\n\nfunc newReadObjectCloser(\n\tpath string,\n\texternalPath string,\n\tfile *os.File,\n) *readObjectCloser {\n\treturn &readObjectCloser{\n\t\tObjectInfo: storageutil.NewObjectInfo(\n\t\t\tpath,\n\t\t\texternalPath,\n\t\t\t// In storageos, the external path is the local path\n\t\t\texternalPath,\n\t\t),\n\t\tfile: file,\n\t}\n}\n\nfunc (r *readObjectCloser) Read(p []byte) (int, error) {\n\tn, err := r.file.Read(p)\n\treturn n, toStorageError(err)\n}\n\nfunc (r *readObjectCloser) Close() error {\n\treturn toStorageError(r.file.Close())\n}\n\ntype writeObjectCloser struct {\n\tfile *os.File\n\t// path is set during atomic writes to the final path where the file should be created.\n\t// If set, the file is a temp file that needs to be renamed to this path if Write/Close are successful.\n\tpath string\n\t// writeErr contains the first non-nil error caught by a call to Write.\n\t// This is returned in Close for atomic writes to prevent writing an incomplete file.\n\twriteErr onceError\n}\n\nfunc newWriteObjectCloser(\n\tfile *os.File,\n\tpath string,\n) *writeObjectCloser {\n\treturn &writeObjectCloser{\n\t\tfile: file,\n\t\tpath: path,\n\t}\n}\n\nfunc (w *writeObjectCloser) Write(p []byte) (int, error) {\n\tn, err := w.file.Write(p)\n\tif err != nil {\n\t\tw.writeErr.Store(err)\n\t}\n\treturn n, toStorageError(err)\n}\n\nfunc (w *writeObjectCloser) SetExternalPath(string) error {\n\treturn storage.ErrSetExternalPathUnsupported\n}\n\nfunc (w *writeObjectCloser) SetLocalPath(string) error {\n\treturn storage.ErrSetLocalPathUnsupported\n}\n\nfunc (w *writeObjectCloser) Close() error {\n\terr := toStorageError(w.file.Close())\n\t// This is an atomic write operation - we need to rename to the final path\n\tif w.path != \"\" {\n\t\tatomicWriteErr := errors.Join(w.writeErr.Load(), err)\n\t\t// Failed during Write or Close - remove temporary file without rename\n\t\tif atomicWriteErr != nil {\n\t\t\treturn toStorageError(errors.Join(atomicWriteErr, os.Remove(w.file.Name())))\n\t\t}\n\t\tif err := os.Rename(w.file.Name(), w.path); err != nil {\n\t\t\treturn toStorageError(errors.Join(err, os.Remove(w.file.Name())))\n\t\t}\n\t}\n\treturn err\n}\n\n// onceError is an object that will only store an error once.\ntype onceError struct {\n\terr atomic.Value\n}\n\n// Store stores the err.\nfunc (e *onceError) Store(err error) {\n\te.err.CompareAndSwap(nil, err)\n}\n\n// Load loads the stored error.\nfunc (e *onceError) Load() error {\n\tatomicValue := e.err.Load()\n\tif atomicValue == nil {\n\t\treturn nil\n\t}\n\terr, ok := atomicValue.(error)\n\tif !ok {\n\t\treturn syserror.Newf(\"expected error but got %T\", atomicValue)\n\t}\n\treturn err\n}\n\n// newErrNotDir returns a new Error for a path not being a directory.\nfunc newErrNotDir(path string) *normalpath.Error {\n\treturn normalpath.NewError(path, errNotDir)\n}\n\nfunc toStorageError(err error) error {\n\tif errors.Is(err, os.ErrClosed) {\n\t\treturn storage.ErrClosed\n\t}\n\treturn err\n}\n\n// validateDirPathExists returns a non-nil error if the given dirPath\n// is not a valid directory path.\nfunc validateDirPathExists(dirPath string, symlinks bool) error {\n\tvar fileInfo os.FileInfo\n\tvar err error\n\tif symlinks {\n\t\tfileInfo, err = os.Stat(dirPath)\n\t} else {\n\t\tfileInfo, err = os.Lstat(dirPath)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !fileInfo.IsDir() {\n\t\treturn newErrNotDir(dirPath)\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/storage/storageos/provider.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storageos\n\nimport \"github.com/bufbuild/buf/private/pkg/storage\"\n\ntype provider struct {\n\tsymlinks bool\n}\n\nfunc newProvider(options ...ProviderOption) *provider {\n\tprovider := &provider{}\n\tfor _, option := range options {\n\t\toption(provider)\n\t}\n\treturn provider\n}\n\nfunc (p *provider) NewReadWriteBucket(rootPath string, options ...ReadWriteBucketOption) (storage.ReadWriteBucket, error) {\n\treadWriteBucketOptions := newReadWriteBucketOptions()\n\tfor _, option := range options {\n\t\toption(readWriteBucketOptions)\n\t}\n\t// need both options for symlinks to be enabled\n\treturn newBucket(\n\t\trootPath,\n\t\tp.symlinks && readWriteBucketOptions.symlinksIfSupported,\n\t)\n}\n\n// doing this as a separate struct so that it's clear this is resolved\n// as a combination of the provider options and read write bucket options\n// so there's no potential issues in newBucket\ntype readWriteBucketOptions struct {\n\tsymlinksIfSupported bool\n}\n\nfunc newReadWriteBucketOptions() *readWriteBucketOptions {\n\treturn &readWriteBucketOptions{}\n}\n"
  },
  {
    "path": "private/pkg/storage/storageos/storageos.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storageos implements an os-backed storage Bucket.\npackage storageos\n\nimport (\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n)\n\n// Provider provides new ReadWriteBuckets.\ntype Provider interface {\n\t// NewReadWriteBucket returns a new OS bucket.\n\t//\n\t// Only regular files are handled, that is Exists should only be called\n\t// for regular files, Get and Put only work for regular files, Put\n\t// automatically calls Mkdir, and Walk only calls f on regular files.\n\t//\n\t// The root path is expected to be normalized, however the root path\n\t// can be absolute or jump context.\n\t//\n\t// Not thread-safe.\n\tNewReadWriteBucket(rootPath string, options ...ReadWriteBucketOption) (storage.ReadWriteBucket, error)\n}\n\n// NewProvider returns a new Provider.\nfunc NewProvider(options ...ProviderOption) Provider {\n\treturn newProvider(options...)\n}\n\n// ProviderOption is an option for a new Provider.\ntype ProviderOption func(*provider)\n\n// ReadWriteBucketOption is an option for a new ReadWriteBucket.\ntype ReadWriteBucketOption func(*readWriteBucketOptions)\n\n// ReadWriteBucketWithSymlinksIfSupported returns a ReadWriteBucketOption that results\n// in symlink support being enabled for this bucket. If the Provider did not have symlink\n// support, this is a no-op.\nfunc ReadWriteBucketWithSymlinksIfSupported() ReadWriteBucketOption {\n\treturn func(readWriteBucketOptions *readWriteBucketOptions) {\n\t\treadWriteBucketOptions.symlinksIfSupported = true\n\t}\n}\n\n// ProviderWithSymlinks returns a ProviderOption that results in symlink support.\n//\n// Note that ReadWriteBucketWithSymlinksIfSupported still needs to be passed for a given\n// ReadWriteBucket to have symlinks followed.\nfunc ProviderWithSymlinks() ProviderOption {\n\treturn func(provider *provider) {\n\t\tprovider.symlinks = true\n\t}\n}\n"
  },
  {
    "path": "private/pkg/storage/storageos/storageos_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storageos_test\n\nimport (\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagetesting\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nvar storagetestingDirPath = filepath.Join(\"..\", \"storagetesting\")\n\nfunc TestOS(t *testing.T) {\n\tt.Parallel()\n\tstoragetesting.RunTestSuite(\n\t\tt,\n\t\tstoragetestingDirPath,\n\t\ttestNewReadBucket,\n\t\ttestNewWriteBucket,\n\t\ttestWriteBucketToReadBucket,\n\t\ttrue,\n\t)\n\n\tt.Run(\"get_non_existent_file\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tctx := t.Context()\n\t\t// Create a bucket at an absolute path.\n\t\ttempDir := t.TempDir()\n\t\ttempDir, err := filepath.Abs(tempDir)\n\t\trequire.NoError(t, err)\n\t\tbucket, err := storageos.NewProvider().NewReadWriteBucket(tempDir)\n\t\trequire.NoError(t, err)\n\n\t\t// Write a file to it.\n\t\twriteObjectCloser, err := bucket.Put(ctx, \"foo.txt\")\n\t\trequire.NoError(t, err)\n\t\twritten, err := writeObjectCloser.Write([]byte(nil))\n\t\trequire.NoError(t, err)\n\t\trequire.Zero(t, written)\n\t\trequire.NoError(t, writeObjectCloser.Close())\n\n\t\t// Try reading a file as if foo.txt is a directory.\n\t\t_, err = bucket.Get(ctx, \"foo.txt/bar.txt\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t\t_, err = bucket.Get(ctx, \"foo.txt/bar.txt/baz.txt\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\n\t\t// Read a file that does not exist at all.\n\t\t_, err = bucket.Get(ctx, \"baz.txt\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n\n\tt.Run(\"get_non_existent_file_symlink\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tctx := t.Context()\n\t\t// Create a bucket at an absolute path.\n\t\tactualTempDir := t.TempDir()\n\t\tactualTempDir, err := filepath.Abs(actualTempDir)\n\t\trequire.NoError(t, err)\n\t\tf, err := os.Create(filepath.Join(actualTempDir, \"foo.txt\"))\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, f.Close())\n\t\ttempDir := t.TempDir()\n\t\ttempDir, err = filepath.Abs(tempDir)\n\t\trequire.NoError(t, err)\n\t\ttempDir = filepath.Join(tempDir, \"sym\")\n\t\trequire.NoError(t, os.Symlink(actualTempDir, tempDir))\n\t\tprovider := storageos.NewProvider(storageos.ProviderWithSymlinks())\n\t\tbucket, err := provider.NewReadWriteBucket(tempDir, storageos.ReadWriteBucketWithSymlinksIfSupported())\n\t\trequire.NoError(t, err)\n\n\t\tfoo, err := bucket.Get(ctx, \"foo.txt\")\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, foo.Close())\n\n\t\t// Try reading a file as if foo.txt is a directory.\n\t\t_, err = bucket.Get(ctx, \"foo.txt/bar.txt\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t\t_, err = bucket.Get(ctx, \"foo.txt/bar.txt/baz.txt\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\n\t\t// Read a file that does not exist at all.\n\t\t_, err = bucket.Get(ctx, \"baz.txt\")\n\t\trequire.ErrorIs(t, err, fs.ErrNotExist)\n\t})\n}\n\nfunc testNewReadBucket(t *testing.T, dirPath string, storageosProvider storageos.Provider) (storage.ReadBucket, storagetesting.GetExternalPathFunc) {\n\tosBucket, err := storageosProvider.NewReadWriteBucket(\n\t\tdirPath,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\treturn osBucket, func(t *testing.T, rootPath string, path string) string {\n\t\t// Join calls Clean\n\t\treturn normalpath.Unnormalize(normalpath.Join(rootPath, path))\n\t}\n}\n\nfunc testNewWriteBucket(t *testing.T, storageosProvider storageos.Provider) storage.WriteBucket {\n\ttmpDir := t.TempDir()\n\tosBucket, err := storageosProvider.NewReadWriteBucket(\n\t\ttmpDir,\n\t\tstorageos.ReadWriteBucketWithSymlinksIfSupported(),\n\t)\n\trequire.NoError(t, err)\n\treturn osBucket\n}\n\nfunc testWriteBucketToReadBucket(t *testing.T, writeBucket storage.WriteBucket) storage.ReadBucket {\n\t// hacky\n\treadWriteBucket, ok := writeBucket.(storage.ReadWriteBucket)\n\trequire.True(t, ok)\n\treturn readWriteBucket\n}\n"
  },
  {
    "path": "private/pkg/storage/storageos/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage storageos\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/storagetesting.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storagetesting implements testing utilities and integration tests for storage.\npackage storagetesting\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/fs\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"sort\"\n\t\"strconv\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"testing\"\n\n\t\"buf.build/go/standard/xslices\"\n\t\"github.com/bufbuild/buf/private/pkg/storage\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storagearchive\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageos\"\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n\t\"github.com/bufbuild/buf/private/pkg/tmp\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nconst (\n\t// testProtoContent is the content of every .proto file in the testing directory.\n\ttestProtoContent = `syntax = \"proto3\";\n\npackage foo;\n`\n\t// testTxtContent is the content of every .txt file in the testing directory.\n\ttestTxtContent = `foo\n`\n\t// testYAMLContent is the content of every .yaml file in the testing directory.\n\ttestYAMLContent = ``\n)\n\n// AssertNotExist asserts the path has the expected ObjectInfo.\nfunc AssertNotExist(\n\tt *testing.T,\n\treadBucket storage.ReadBucket,\n\tpath string,\n) {\n\t_, err := readBucket.Stat(t.Context(), path)\n\tassert.Error(t, err)\n\tassert.True(t, errors.Is(err, fs.ErrNotExist))\n}\n\n// AssertObjectInfo asserts the path has the expected ObjectInfo.\nfunc AssertObjectInfo(\n\tt *testing.T,\n\treadBucket storage.ReadBucket,\n\tpath string,\n\texternalPath string,\n\texternalPathShouldEqualLocalPath bool,\n) {\n\tvar localPath string\n\tif externalPathShouldEqualLocalPath {\n\t\tlocalPath = externalPath\n\t}\n\tobjectInfo, err := readBucket.Stat(t.Context(), path)\n\trequire.NoError(t, err)\n\tAssertObjectInfoEqual(\n\t\tt,\n\t\tstorageutil.NewObjectInfo(\n\t\t\tpath,\n\t\t\texternalPath,\n\t\t\tlocalPath,\n\t\t),\n\t\tobjectInfo,\n\t)\n}\n\n// AssertObjectInfoEqual asserts the two ObjectInfos are equal.\nfunc AssertObjectInfoEqual(\n\tt *testing.T,\n\texpected storage.ObjectInfo,\n\tactual storage.ObjectInfo,\n) {\n\tassert.Equal(t, expected.Path(), actual.Path())\n\tassert.Equal(t, expected.ExternalPath(), actual.ExternalPath())\n}\n\n// AssertPathToContent asserts the content.\nfunc AssertPathToContent(\n\tt *testing.T,\n\treadBucket storage.ReadBucket,\n\twalkPrefix string,\n\texpectedPathToContent map[string]string,\n) {\n\tvar paths []string\n\trequire.NoError(t, readBucket.Walk(\n\t\tt.Context(),\n\t\twalkPrefix,\n\t\tfunc(objectInfo storage.ObjectInfo) error {\n\t\t\tpaths = append(paths, objectInfo.Path())\n\t\t\treturn nil\n\t\t},\n\t))\n\trequire.Equal(t, len(paths), len(xslices.ToUniqueSorted(paths)))\n\tassert.Equal(t, len(expectedPathToContent), len(paths), paths)\n\tfor _, path := range paths {\n\t\texpectedContent, ok := expectedPathToContent[path]\n\t\tassert.True(t, ok, path)\n\t\t_, err := readBucket.Stat(t.Context(), path)\n\t\trequire.NoError(t, err, path)\n\t\treadObjectCloser, err := readBucket.Get(t.Context(), path)\n\t\trequire.NoError(t, err, path)\n\t\tdata, err := io.ReadAll(readObjectCloser)\n\t\tassert.NoError(t, err, path)\n\t\tassert.NoError(t, readObjectCloser.Close())\n\t\tassert.Equal(t, expectedContent, string(data))\n\t}\n}\n\n// AssertPaths asserts the paths.\nfunc AssertPaths(\n\tt *testing.T,\n\treadBucket storage.ReadBucket,\n\twalkPrefix string,\n\texpectedPaths ...string,\n) {\n\tvar paths []string\n\trequire.NoError(t, readBucket.Walk(\n\t\tt.Context(),\n\t\twalkPrefix,\n\t\tfunc(objectInfo storage.ObjectInfo) error {\n\t\t\tpaths = append(paths, objectInfo.Path())\n\t\t\treturn nil\n\t\t},\n\t))\n\tsort.Strings(paths)\n\tassert.Equal(t, xslices.ToUniqueSorted(expectedPaths), paths)\n}\n\n// GetExternalPathFunc can be used to get the external path of\n// a path given the root path.\ntype GetExternalPathFunc func(*testing.T, string, string) string\n\n// RunTestSuite runs the test suite.\n//\n// storagetestingDirPath is the path to this directory.\n// newReadBucket takes a path to a directory.\nfunc RunTestSuite(\n\tt *testing.T,\n\tstoragetestingDirPath string,\n\tnewReadBucket func(*testing.T, string, storageos.Provider) (storage.ReadBucket, GetExternalPathFunc),\n\tnewWriteBucket func(*testing.T, storageos.Provider) storage.WriteBucket,\n\twriteBucketToReadBucket func(*testing.T, storage.WriteBucket) storage.ReadBucket,\n\texternalPathsShouldEqualLocalPaths bool,\n) {\n\toneDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"one\")\n\ttwoDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"two\")\n\tthreeDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"three\")\n\tfourDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"four\")\n\tfiveDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"five\")\n\tsymlinkSuccessDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"symlink_success\")\n\tsymlinkLoopDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"symlink_loop\")\n\toverlayDirPath := filepath.Join(storagetestingDirPath, \"testdata\", \"overlay\")\n\tdefaultProvider := storageos.NewProvider()\n\n\tfor _, prefix := range []string{\n\t\t\"\",\n\t\t\".\",\n\t\t\"./\",\n\t} {\n\t\tt.Run(fmt.Sprintf(\"root-%q\", prefix), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\tAssertPathToContent(\n\t\t\t\tt,\n\t\t\t\treadBucket,\n\t\t\t\tprefix,\n\t\t\t\tmap[string]string{\n\t\t\t\t\t\"root/a/b/1.proto\": testProtoContent,\n\t\t\t\t\t\"root/a/b/2.proto\": testProtoContent,\n\t\t\t\t\t\"root/a/b/2.txt\":   testTxtContent,\n\t\t\t\t\t\"root/ab/1.proto\":  testProtoContent,\n\t\t\t\t\t\"root/ab/2.proto\":  testProtoContent,\n\t\t\t\t\t\"root/ab/2.txt\":    testTxtContent,\n\t\t\t\t\t\"root/a/1.proto\":   testProtoContent,\n\t\t\t\t\t\"root/a/1.txt\":     testTxtContent,\n\t\t\t\t\t\"root/a/bar.yaml\":  testYAMLContent,\n\t\t\t\t\t\"root/c/1.proto\":   testProtoContent,\n\t\t\t\t\t\"root/1.proto\":     testProtoContent,\n\t\t\t\t\t\"root/foo.yaml\":    testYAMLContent,\n\t\t\t\t},\n\t\t\t)\n\t\t})\n\t}\n\n\tt.Run(\"map-1\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\treadBucket = storage.MapReadBucket(\n\t\t\treadBucket,\n\t\t\tstorage.MapOnPrefix(\"root\"),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"a/b/1.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.txt\":   testTxtContent,\n\t\t\t\t\"ab/1.proto\":  testProtoContent,\n\t\t\t\t\"ab/2.proto\":  testProtoContent,\n\t\t\t\t\"ab/2.txt\":    testTxtContent,\n\t\t\t\t\"a/1.proto\":   testProtoContent,\n\t\t\t\t\"a/bar.yaml\":  testYAMLContent,\n\t\t\t\t\"a/1.txt\":     testTxtContent,\n\t\t\t\t\"c/1.proto\":   testProtoContent,\n\t\t\t\t\"1.proto\":     testProtoContent,\n\t\t\t\t\"foo.yaml\":    testYAMLContent,\n\t\t\t},\n\t\t)\n\t})\n\n\tt.Run(\"map-2\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, getExternalPathFunc := newReadBucket(t, oneDirPath, defaultProvider)\n\t\treadBucket = storage.MapReadBucket(\n\t\t\treadBucket,\n\t\t\tstorage.MapOnPrefix(\"root/a\"),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"b/1.proto\": testProtoContent,\n\t\t\t\t\"b/2.proto\": testProtoContent,\n\t\t\t\t\"b/2.txt\":   testTxtContent,\n\t\t\t\t\"1.proto\":   testProtoContent,\n\t\t\t\t\"bar.yaml\":  testYAMLContent,\n\t\t\t\t\"1.txt\":     testTxtContent,\n\t\t\t},\n\t\t)\n\t\tAssertObjectInfo(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"1.proto\",\n\t\t\tgetExternalPathFunc(t, oneDirPath, filepath.Join(\"root\", \"a\", \"1.proto\")),\n\t\t\texternalPathsShouldEqualLocalPaths,\n\t\t)\n\t\treadBucket = storage.MapReadBucket(\n\t\t\treadBucket,\n\t\t\tstorage.MapOnPrefix(\"b\"),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"1.proto\": testProtoContent,\n\t\t\t\t\"2.proto\": testProtoContent,\n\t\t\t\t\"2.txt\":   testTxtContent,\n\t\t\t},\n\t\t)\n\t\tAssertObjectInfo(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"1.proto\",\n\t\t\tgetExternalPathFunc(t, oneDirPath, filepath.Join(\"root\", \"a\", \"b\", \"1.proto\")),\n\t\t\texternalPathsShouldEqualLocalPaths,\n\t\t)\n\t})\n\n\tt.Run(\"map-3\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, getExternalPathFunc := newReadBucket(t, oneDirPath, defaultProvider)\n\t\treadBucket = storage.MapReadBucket(\n\t\t\treadBucket,\n\t\t\tstorage.MapOnPrefix(\"root/ab\"),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"1.proto\": testProtoContent,\n\t\t\t\t\"2.proto\": testProtoContent,\n\t\t\t\t\"2.txt\":   testTxtContent,\n\t\t\t},\n\t\t)\n\t\tAssertObjectInfo(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"1.proto\",\n\t\t\tgetExternalPathFunc(t, oneDirPath, filepath.Join(\"root\", \"ab\", \"1.proto\")),\n\t\t\texternalPathsShouldEqualLocalPaths,\n\t\t)\n\t\treadBucket = storage.FilterReadBucket(\n\t\t\treadBucket,\n\t\t\tstorage.MatchOr(\n\t\t\t\tstorage.MatchPathExt(\".txt\"),\n\t\t\t\tstorage.MatchPathEqual(\"2.proto\"),\n\t\t\t),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"2.proto\": testProtoContent,\n\t\t\t\t\"2.txt\":   testTxtContent,\n\t\t\t},\n\t\t)\n\t\tAssertObjectInfo(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"2.proto\",\n\t\t\tgetExternalPathFunc(t, oneDirPath, filepath.Join(\"root\", \"ab\", \"2.proto\")),\n\t\t\texternalPathsShouldEqualLocalPaths,\n\t\t)\n\t})\n\n\tt.Run(\"multi-all\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, twoDirPath, defaultProvider)\n\t\treadBucketMulti := storage.MultiReadBucket(\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"root1\"),\n\t\t\t),\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"root2\"),\n\t\t\t),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucketMulti,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t// root1\n\t\t\t\t\"a/b/1.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.txt\":   testTxtContent,\n\t\t\t\t\"ab/1.proto\":  testProtoContent,\n\t\t\t\t\"ab/2.proto\":  testProtoContent,\n\t\t\t\t\"ab/2.txt\":    testTxtContent,\n\t\t\t\t\"a/1.proto\":   testProtoContent,\n\t\t\t\t\"a/1.txt\":     testTxtContent,\n\t\t\t\t\"a/bar.yaml\":  testYAMLContent,\n\t\t\t\t\"c/1.proto\":   testProtoContent,\n\t\t\t\t\"1.proto\":     testProtoContent,\n\t\t\t\t\"foo.yaml\":    testYAMLContent,\n\t\t\t\t// root2\n\t\t\t\t\"a/b/3.proto\": testProtoContent,\n\t\t\t\t\"a/b/4.proto\": testProtoContent,\n\t\t\t\t\"a/b/4.txt\":   testTxtContent,\n\t\t\t\t\"ab/3.proto\":  testProtoContent,\n\t\t\t\t\"ab/4.proto\":  testProtoContent,\n\t\t\t\t\"ab/4.txt\":    testTxtContent,\n\t\t\t\t\"a/2.proto\":   testProtoContent,\n\t\t\t\t\"a/2.txt\":     testTxtContent,\n\t\t\t\t\"a/bat.yaml\":  testYAMLContent,\n\t\t\t\t\"c/3.proto\":   testProtoContent,\n\t\t\t\t\"2.proto\":     testProtoContent,\n\t\t\t\t\"baz.yaml\":    testYAMLContent,\n\t\t\t},\n\t\t)\n\t})\n\n\tt.Run(\"multi-overlapping-files-error\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, twoDirPath, defaultProvider)\n\t\treadBucketMulti := storage.MultiReadBucket(\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"root1\"),\n\t\t\t),\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"rootoverlap\"),\n\t\t\t),\n\t\t)\n\t\t_, err := readBucketMulti.Get(\n\t\t\tt.Context(),\n\t\t\t\"a/b/1.proto\",\n\t\t)\n\t\tassert.Error(t, err)\n\t\tassert.True(t, storage.IsExistsMultipleLocations(err))\n\t\t_, err = readBucketMulti.Stat(\n\t\t\tt.Context(),\n\t\t\t\"a/b/1.proto\",\n\t\t)\n\t\tassert.Error(t, err)\n\t\tassert.True(t, storage.IsExistsMultipleLocations(err))\n\t\terr = readBucketMulti.Walk(\n\t\t\tt.Context(),\n\t\t\t\"\",\n\t\t\tfunc(storage.ObjectInfo) error {\n\t\t\t\treturn nil\n\t\t\t},\n\t\t)\n\t\tassert.Error(t, err)\n\t\tassert.True(t, storage.IsExistsMultipleLocations(err))\n\t})\n\n\t// this is testing that if we have i.e. protoc -I root/a -I root\n\t// that even if this is an error in our world, this is not a problem\n\t// in terms of storage buckets\n\tt.Run(\"multi-overlapping-dirs-success\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, fourDirPath, defaultProvider)\n\t\treadBucketMulti := storage.MultiReadBucket(\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"root/a\"),\n\t\t\t),\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"root\"),\n\t\t\t),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucketMulti,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"a/b/1.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.proto\": testProtoContent,\n\t\t\t\t\"a/3.proto\":   testProtoContent,\n\t\t\t\t\"b/1.proto\":   testProtoContent,\n\t\t\t\t\"b/2.proto\":   testProtoContent,\n\t\t\t\t\"3.proto\":     testProtoContent,\n\t\t\t},\n\t\t)\n\t})\n\n\t// this is testing that two roots can have a file with the same\n\t// name, but one could be a directory and the other could be a\n\t// regular file.\n\tt.Run(\"multi-dir-file-collision\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, fiveDirPath, defaultProvider)\n\t\treadBucketMulti := storage.MultiReadBucket(\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"root1\"),\n\t\t\t),\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"root2\"),\n\t\t\t),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucketMulti,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t// root1\n\t\t\t\t\"foo\": testProtoContent,\n\t\t\t\t// root2\n\t\t\t\t\"foo/bar.proto\": testProtoContent,\n\t\t\t},\n\t\t)\n\t})\n\n\tfor _, testCase := range []struct {\n\t\tname                  string\n\t\tprefix                string\n\t\tstripComponentCount   uint32\n\t\tnewReadBucketFunc     func(*testing.T) storage.ReadBucket\n\t\tmappers               []storage.Mapper\n\t\tmatchers              []storage.Matcher\n\t\texpectedPathToContent map[string]string\n\t}{\n\t\t{\n\t\t\tname: \"proto-and-single-file\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathEqual(\"root/foo.yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"root/a/b/1.proto\": testProtoContent,\n\t\t\t\t\"root/a/b/2.proto\": testProtoContent,\n\t\t\t\t\"root/ab/1.proto\":  testProtoContent,\n\t\t\t\t\"root/ab/2.proto\":  testProtoContent,\n\t\t\t\t\"root/a/1.proto\":   testProtoContent,\n\t\t\t\t\"root/c/1.proto\":   testProtoContent,\n\t\t\t\t\"root/1.proto\":     testProtoContent,\n\t\t\t\t\"root/foo.yaml\":    testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-walk-prefix-root-a\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tprefix: \"root/a\",\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathEqual(\"foo.yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"root/a/b/1.proto\": testProtoContent,\n\t\t\t\t\"root/a/b/2.proto\": testProtoContent,\n\t\t\t\t\"root/a/1.proto\":   testProtoContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-walk-prefix-root-a-2\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tprefix: \"./root/a\",\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathEqual(\"foo.yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"root/a/b/1.proto\": testProtoContent,\n\t\t\t\t\"root/a/b/2.proto\": testProtoContent,\n\t\t\t\t\"root/a/1.proto\":   testProtoContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-strip-components\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tstripComponentCount: 1,\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathEqual(\"a/bar.yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"a/b/1.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.proto\": testProtoContent,\n\t\t\t\t\"ab/1.proto\":  testProtoContent,\n\t\t\t\t\"ab/2.proto\":  testProtoContent,\n\t\t\t\t\"a/1.proto\":   testProtoContent,\n\t\t\t\t\"c/1.proto\":   testProtoContent,\n\t\t\t\t\"1.proto\":     testProtoContent,\n\t\t\t\t\"a/bar.yaml\":  testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-map-prefix-root-a\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"root/a\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathEqual(\"bar.yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"b/1.proto\": testProtoContent,\n\t\t\t\t\"b/2.proto\": testProtoContent,\n\t\t\t\t\"1.proto\":   testProtoContent,\n\t\t\t\t\"bar.yaml\":  testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-map-prefix-a-strip-components\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tstripComponentCount: 1,\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"a\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathEqual(\"bar.yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"b/1.proto\": testProtoContent,\n\t\t\t\t\"b/2.proto\": testProtoContent,\n\t\t\t\t\"1.proto\":   testProtoContent,\n\t\t\t\t\"bar.yaml\":  testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"all\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathExt(\".txt\"),\n\t\t\t\t\tstorage.MatchPathExt(\".yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"root/a/b/1.proto\": testProtoContent,\n\t\t\t\t\"root/a/b/2.proto\": testProtoContent,\n\t\t\t\t\"root/a/b/2.txt\":   testTxtContent,\n\t\t\t\t\"root/ab/1.proto\":  testProtoContent,\n\t\t\t\t\"root/ab/2.proto\":  testProtoContent,\n\t\t\t\t\"root/ab/2.txt\":    testTxtContent,\n\t\t\t\t\"root/a/1.proto\":   testProtoContent,\n\t\t\t\t\"root/a/1.txt\":     testTxtContent,\n\t\t\t\t\"root/a/bar.yaml\":  testYAMLContent,\n\t\t\t\t\"root/c/1.proto\":   testProtoContent,\n\t\t\t\t\"root/1.proto\":     testProtoContent,\n\t\t\t\t\"root/foo.yaml\":    testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-not-equal-or-contained-map-prefix\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"root\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchNot(\n\t\t\t\t\tstorage.MatchPathContained(\"a\"),\n\t\t\t\t),\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathEqualOrContained(\"foo.yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"ab/1.proto\": testProtoContent,\n\t\t\t\t\"ab/2.proto\": testProtoContent,\n\t\t\t\t\"c/1.proto\":  testProtoContent,\n\t\t\t\t\"1.proto\":    testProtoContent,\n\t\t\t\t\"foo.yaml\":   testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-not-equal-or-contained-map-prefix-and\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"root\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchAnd(\n\t\t\t\t\tstorage.MatchOr(\n\t\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\t\tstorage.MatchPathEqualOrContained(\"foo.yaml\"),\n\t\t\t\t\t),\n\t\t\t\t\tstorage.MatchNot(\n\t\t\t\t\t\tstorage.MatchPathContained(\"a\"),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"ab/1.proto\": testProtoContent,\n\t\t\t\t\"ab/2.proto\": testProtoContent,\n\t\t\t\t\"c/1.proto\":  testProtoContent,\n\t\t\t\t\"1.proto\":    testProtoContent,\n\t\t\t\t\"foo.yaml\":   testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-not-equal-or-contained-map-prefix-and-2\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"root\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchAnd(\n\t\t\t\t\tstorage.MatchOr(\n\t\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\t\tstorage.MatchPathEqual(\"foo.yaml\"),\n\t\t\t\t\t),\n\t\t\t\t\tstorage.MatchNot(\n\t\t\t\t\t\tstorage.MatchOr(\n\t\t\t\t\t\t\tstorage.MatchPathEqualOrContained(\"a\"),\n\t\t\t\t\t\t\tstorage.MatchPathEqualOrContained(\"c\"),\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\texpectedPathToContent: map[string]string{\n\t\t\t\t\"ab/1.proto\": testProtoContent,\n\t\t\t\t\"ab/2.proto\": testProtoContent,\n\t\t\t\t\"1.proto\":    testProtoContent,\n\t\t\t\t\"foo.yaml\":   testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-not-equal-or-contained-map-prefix-and-3\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"root\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchAnd(\n\t\t\t\t\tstorage.MatchOr(\n\t\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\t\tstorage.MatchPathEqual(\"foo.yaml\"),\n\t\t\t\t\t),\n\t\t\t\t\tstorage.MatchNot(\n\t\t\t\t\t\tstorage.MatchPathEqualOrContained(\"a\"),\n\t\t\t\t\t),\n\t\t\t\t\tstorage.MatchNot(\n\t\t\t\t\t\tstorage.MatchPathEqualOrContained(\"c\"),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"ab/1.proto\": testProtoContent,\n\t\t\t\t\"ab/2.proto\": testProtoContent,\n\t\t\t\t\"1.proto\":    testProtoContent,\n\t\t\t\t\"foo.yaml\":   testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"proto-and-single-file-not-equal-or-contained-map-prefix-chained\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t\t\treturn readBucket\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"root\"),\n\t\t\t\tstorage.MapOnPrefix(\"ab\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t\"1.proto\": testProtoContent,\n\t\t\t\t\"2.proto\": testProtoContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"multi-all\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, twoDirPath, defaultProvider)\n\t\t\t\treturn storage.MultiReadBucket(\n\t\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\t\treadBucket,\n\t\t\t\t\t\tstorage.MapOnPrefix(\"root1\"),\n\t\t\t\t\t),\n\t\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\t\treadBucket,\n\t\t\t\t\t\tstorage.MapOnPrefix(\"root2\"),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathExt(\".txt\"),\n\t\t\t\t\tstorage.MatchPathExt(\".yaml\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t// root1\n\t\t\t\t\"a/b/1.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.proto\": testProtoContent,\n\t\t\t\t\"a/b/2.txt\":   testTxtContent,\n\t\t\t\t\"ab/1.proto\":  testProtoContent,\n\t\t\t\t\"ab/2.proto\":  testProtoContent,\n\t\t\t\t\"ab/2.txt\":    testTxtContent,\n\t\t\t\t\"a/1.proto\":   testProtoContent,\n\t\t\t\t\"a/1.txt\":     testTxtContent,\n\t\t\t\t\"a/bar.yaml\":  testYAMLContent,\n\t\t\t\t\"c/1.proto\":   testProtoContent,\n\t\t\t\t\"1.proto\":     testProtoContent,\n\t\t\t\t\"foo.yaml\":    testYAMLContent,\n\t\t\t\t// root2\n\t\t\t\t\"a/b/3.proto\": testProtoContent,\n\t\t\t\t\"a/b/4.proto\": testProtoContent,\n\t\t\t\t\"a/b/4.txt\":   testTxtContent,\n\t\t\t\t\"ab/3.proto\":  testProtoContent,\n\t\t\t\t\"ab/4.proto\":  testProtoContent,\n\t\t\t\t\"ab/4.txt\":    testTxtContent,\n\t\t\t\t\"a/2.proto\":   testProtoContent,\n\t\t\t\t\"a/2.txt\":     testTxtContent,\n\t\t\t\t\"a/bat.yaml\":  testYAMLContent,\n\t\t\t\t\"c/3.proto\":   testProtoContent,\n\t\t\t\t\"2.proto\":     testProtoContent,\n\t\t\t\t\"baz.yaml\":    testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"multi-map-on-prefix\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, twoDirPath, defaultProvider)\n\t\t\t\treturn storage.MultiReadBucket(\n\t\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\t\treadBucket,\n\t\t\t\t\t\tstorage.MapOnPrefix(\"root1\"),\n\t\t\t\t\t),\n\t\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\t\treadBucket,\n\t\t\t\t\t\tstorage.MapOnPrefix(\"root2\"),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"a\"),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t// root1\n\t\t\t\t\"b/1.proto\": testProtoContent,\n\t\t\t\t\"b/2.proto\": testProtoContent,\n\t\t\t\t\"b/2.txt\":   testTxtContent,\n\t\t\t\t\"1.proto\":   testProtoContent,\n\t\t\t\t\"1.txt\":     testTxtContent,\n\t\t\t\t\"bar.yaml\":  testYAMLContent,\n\t\t\t\t// root2\n\t\t\t\t\"b/3.proto\": testProtoContent,\n\t\t\t\t\"b/4.proto\": testProtoContent,\n\t\t\t\t\"b/4.txt\":   testTxtContent,\n\t\t\t\t\"2.proto\":   testProtoContent,\n\t\t\t\t\"2.txt\":     testTxtContent,\n\t\t\t\t\"bat.yaml\":  testYAMLContent,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"multi-map-on-prefix-filter\",\n\t\t\tnewReadBucketFunc: func(t *testing.T) storage.ReadBucket {\n\t\t\t\treadBucket, _ := newReadBucket(t, twoDirPath, defaultProvider)\n\t\t\t\treturn storage.MultiReadBucket(\n\t\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\t\treadBucket,\n\t\t\t\t\t\tstorage.MapOnPrefix(\"root1\"),\n\t\t\t\t\t),\n\t\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\t\treadBucket,\n\t\t\t\t\t\tstorage.MapOnPrefix(\"root2\"),\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t},\n\t\t\tmappers: []storage.Mapper{\n\t\t\t\tstorage.MapOnPrefix(\"a\"),\n\t\t\t},\n\t\t\tmatchers: []storage.Matcher{\n\t\t\t\tstorage.MatchOr(\n\t\t\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t\t\t\tstorage.MatchPathExt(\".txt\"),\n\t\t\t\t),\n\t\t\t},\n\t\t\texpectedPathToContent: map[string]string{\n\t\t\t\t// root1\n\t\t\t\t\"b/1.proto\": testProtoContent,\n\t\t\t\t\"b/2.proto\": testProtoContent,\n\t\t\t\t\"b/2.txt\":   testTxtContent,\n\t\t\t\t\"1.proto\":   testProtoContent,\n\t\t\t\t\"1.txt\":     testTxtContent,\n\t\t\t\t// root2\n\t\t\t\t\"b/3.proto\": testProtoContent,\n\t\t\t\t\"b/4.proto\": testProtoContent,\n\t\t\t\t\"b/4.txt\":   testTxtContent,\n\t\t\t\t\"2.proto\":   testProtoContent,\n\t\t\t\t\"2.txt\":     testTxtContent,\n\t\t\t},\n\t\t},\n\t} {\n\t\tif testCase.stripComponentCount == 0 {\n\t\t\tt.Run(fmt.Sprintf(\"copy-%s\", testCase.name), func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\treadBucket := testCase.newReadBucketFunc(t)\n\t\t\t\treadBucket = storage.MapReadBucket(readBucket, testCase.mappers...)\n\t\t\t\treadBucket = storage.FilterReadBucket(readBucket, testCase.matchers...)\n\t\t\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\t\t\t_, err := storage.Copy(\n\t\t\t\t\tt.Context(),\n\t\t\t\t\treadBucket,\n\t\t\t\t\twriteBucket,\n\t\t\t\t)\n\t\t\t\trequire.NoError(t, err)\n\t\t\t\treadBucket = writeBucketToReadBucket(t, writeBucket)\n\t\t\t\tAssertPathToContent(t, readBucket, testCase.prefix, testCase.expectedPathToContent)\n\t\t\t})\n\t\t\tt.Run(fmt.Sprintf(\"tar-mapper-read-%s\", testCase.name), func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\treadBucket := testCase.newReadBucketFunc(t)\n\t\t\t\treadBucket = storage.MapReadBucket(readBucket, testCase.mappers...)\n\t\t\t\treadBucket = storage.FilterReadBucket(readBucket, testCase.matchers...)\n\t\t\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\t\t\tbuffer := bytes.NewBuffer(nil)\n\t\t\t\trequire.NoError(t, storagearchive.Tar(\n\t\t\t\t\tt.Context(),\n\t\t\t\t\treadBucket,\n\t\t\t\t\tbuffer,\n\t\t\t\t))\n\t\t\t\trequire.NoError(t, storagearchive.Untar(\n\t\t\t\t\tt.Context(),\n\t\t\t\t\tbuffer,\n\t\t\t\t\twriteBucket,\n\t\t\t\t\tstoragearchive.UntarWithStripComponentCount(\n\t\t\t\t\t\ttestCase.stripComponentCount,\n\t\t\t\t\t),\n\t\t\t\t))\n\t\t\t\treadBucket = writeBucketToReadBucket(t, writeBucket)\n\t\t\t\tAssertPathToContent(t, readBucket, testCase.prefix, testCase.expectedPathToContent)\n\t\t\t})\n\t\t\tt.Run(fmt.Sprintf(\"zip-mapper-read-%s\", testCase.name), func(t *testing.T) {\n\t\t\t\tt.Parallel()\n\t\t\t\treadBucket := testCase.newReadBucketFunc(t)\n\t\t\t\treadBucket = storage.MapReadBucket(readBucket, testCase.mappers...)\n\t\t\t\treadBucket = storage.FilterReadBucket(readBucket, testCase.matchers...)\n\t\t\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\t\t\tbuffer := bytes.NewBuffer(nil)\n\t\t\t\trequire.NoError(t, storagearchive.Zip(\n\t\t\t\t\tt.Context(),\n\t\t\t\t\treadBucket,\n\t\t\t\t\tbuffer,\n\t\t\t\t\ttrue,\n\t\t\t\t))\n\t\t\t\tdata := buffer.Bytes()\n\t\t\t\trequire.NoError(t, storagearchive.Unzip(\n\t\t\t\t\tt.Context(),\n\t\t\t\t\tbytes.NewReader(data),\n\t\t\t\t\tint64(len(data)),\n\t\t\t\t\twriteBucket,\n\t\t\t\t\tstoragearchive.UnzipWithStripComponentCount(\n\t\t\t\t\t\ttestCase.stripComponentCount,\n\t\t\t\t\t),\n\t\t\t\t))\n\t\t\t\treadBucket = writeBucketToReadBucket(t, writeBucket)\n\t\t\t\tAssertPathToContent(t, readBucket, testCase.prefix, testCase.expectedPathToContent)\n\t\t\t})\n\t\t}\n\t\tt.Run(fmt.Sprintf(\"tar-mapper-write-%s\", testCase.name), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\treadBucket := testCase.newReadBucketFunc(t)\n\t\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\t\tbuffer := bytes.NewBuffer(nil)\n\t\t\trequire.NoError(t, storagearchive.Tar(\n\t\t\t\tt.Context(),\n\t\t\t\treadBucket,\n\t\t\t\tbuffer,\n\t\t\t))\n\t\t\trequire.NoError(t, storagearchive.Untar(\n\t\t\t\tt.Context(),\n\t\t\t\tbuffer,\n\t\t\t\twriteBucket,\n\t\t\t\tstoragearchive.UntarWithStripComponentCount(\n\t\t\t\t\ttestCase.stripComponentCount,\n\t\t\t\t),\n\t\t\t))\n\t\t\treadBucket = writeBucketToReadBucket(t, writeBucket)\n\t\t\treadBucket = storage.MapReadBucket(readBucket, testCase.mappers...)\n\t\t\treadBucket = storage.FilterReadBucket(readBucket, testCase.matchers...)\n\t\t\tAssertPathToContent(t, readBucket, testCase.prefix, testCase.expectedPathToContent)\n\t\t})\n\t\tt.Run(fmt.Sprintf(\"zip-mapper-write%s\", testCase.name), func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\treadBucket := testCase.newReadBucketFunc(t)\n\t\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\t\tbuffer := bytes.NewBuffer(nil)\n\t\t\trequire.NoError(t, storagearchive.Zip(\n\t\t\t\tt.Context(),\n\t\t\t\treadBucket,\n\t\t\t\tbuffer,\n\t\t\t\ttrue,\n\t\t\t))\n\t\t\tdata := buffer.Bytes()\n\t\t\trequire.NoError(t, storagearchive.Unzip(\n\t\t\t\tt.Context(),\n\t\t\t\tbytes.NewReader(data),\n\t\t\t\tint64(len(data)),\n\t\t\t\twriteBucket,\n\t\t\t\tstoragearchive.UnzipWithStripComponentCount(\n\t\t\t\t\ttestCase.stripComponentCount,\n\t\t\t\t),\n\t\t\t))\n\t\t\treadBucket = writeBucketToReadBucket(t, writeBucket)\n\t\t\treadBucket = storage.MapReadBucket(readBucket, testCase.mappers...)\n\t\t\treadBucket = storage.FilterReadBucket(readBucket, testCase.matchers...)\n\t\t\tAssertPathToContent(t, readBucket, testCase.prefix, testCase.expectedPathToContent)\n\t\t})\n\t}\n\n\tt.Run(\"diff\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tdiffDirPathA := filepath.Join(storagetestingDirPath, \"testdata\", \"diff\", \"a\")\n\t\tdiffDirPathB := filepath.Join(storagetestingDirPath, \"testdata\", \"diff\", \"b\")\n\t\treadBucketA, getExternalPathFuncA := newReadBucket(t, diffDirPathA, defaultProvider)\n\t\treadBucketB, getExternalPathFuncB := newReadBucket(t, diffDirPathB, defaultProvider)\n\t\treadBucketA = storage.MapReadBucket(readBucketA, storage.MapOnPrefix(\"prefix\"))\n\t\treadBucketB = storage.MapReadBucket(readBucketB, storage.MapOnPrefix(\"prefix\"))\n\t\texternalPathPrefixA := getExternalPathFuncA(t, diffDirPathA, \"prefix\") + string(os.PathSeparator)\n\t\texternalPathPrefixB := getExternalPathFuncB(t, diffDirPathB, \"prefix\") + string(os.PathSeparator)\n\t\ta1TxtPath := filepath.ToSlash(externalPathPrefixA + \"1.txt\")\n\t\tb1TxtPath := filepath.ToSlash(externalPathPrefixB + \"1.txt\")\n\t\ta2TxtPath := filepath.ToSlash(externalPathPrefixA + \"2.txt\")\n\t\tb2TxtPath := filepath.ToSlash(externalPathPrefixB + \"2.txt\")\n\n\t\tdiff, err := storage.DiffBytes(\n\t\t\tt.Context(),\n\t\t\treadBucketA,\n\t\t\treadBucketB,\n\t\t\tstorage.DiffWithSuppressTimestamps(),\n\t\t\tstorage.DiffWithExternalPaths(),\n\t\t\tstorage.DiffWithExternalPathPrefixes(\n\t\t\t\texternalPathPrefixA,\n\t\t\t\texternalPathPrefixB,\n\t\t\t),\n\t\t)\n\n\t\t// This isn't great, but it tests the exact behavior of the diff\n\t\t// functionality. Headers are always \"ToSlash\" paths and `\\n`. The\n\t\t// contents of the diff are platform dependent.\n\t\tdiff1 := `@@ -1,2 +1,2 @@\n-aaaa\n bbbb\n+cccc\n`\n\t\tdiff2 := `@@ -1 +0,0 @@\n-dddd\n`\n\t\texpectDiff := fmt.Sprintf(\n\t\t\t`diff -u %s %s\n--- %s\n+++ %s\n%sdiff -u %s %s\n--- %s\n+++ %s\n%s`,\n\t\t\ta1TxtPath,\n\t\t\tb1TxtPath,\n\t\t\ta1TxtPath,\n\t\t\tb1TxtPath,\n\t\t\tdiff1,\n\t\t\ta2TxtPath,\n\t\t\tb2TxtPath,\n\t\t\ta2TxtPath,\n\t\t\tb2TxtPath,\n\t\t\tdiff2,\n\t\t)\n\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(\n\t\t\tt,\n\t\t\texpectDiff,\n\t\t\tstring(diff),\n\t\t)\n\t})\n\n\tt.Run(\"overlap-success\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, threeDirPath, defaultProvider)\n\t\treadBucket = storage.FilterReadBucket(readBucket, storage.MatchPathExt(\".proto\"))\n\t\treadBucket = storage.MultiReadBucket(\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"a\"),\n\t\t\t),\n\t\t\tstorage.MapReadBucket(\n\t\t\t\treadBucket,\n\t\t\t\tstorage.MapOnPrefix(\"b\"),\n\t\t\t),\n\t\t)\n\t\tallPaths, err := storage.AllPaths(\n\t\t\tt.Context(),\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t)\n\t\trequire.NoError(t, err)\n\t\tassert.Equal(\n\t\t\tt,\n\t\t\t[]string{\n\t\t\t\t\"one.proto\",\n\t\t\t\t\"two.proto\",\n\t\t\t},\n\t\t\tallPaths,\n\t\t)\n\t})\n\n\tt.Run(\"overlap-error\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, threeDirPath, defaultProvider)\n\t\treadBucket = storage.MapReadBucket(\n\t\t\tstorage.MultiReadBucket(\n\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\treadBucket,\n\t\t\t\t\tstorage.MapOnPrefix(\"a\"),\n\t\t\t\t),\n\t\t\t\tstorage.MapReadBucket(\n\t\t\t\t\treadBucket,\n\t\t\t\t\tstorage.MapOnPrefix(\"b\"),\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t\treadBucket = storage.FilterReadBucket(\n\t\t\treadBucket,\n\t\t\tstorage.MatchPathExt(\".proto\"),\n\t\t)\n\t\t_, err := storage.AllPaths(\n\t\t\tt.Context(),\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t)\n\t\tassert.True(t, storage.IsExistsMultipleLocations(err))\n\t})\n\n\tt.Run(\"map-write-bucket\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\tmapWriteBucket := storage.MapWriteBucket(\n\t\t\twriteBucket,\n\t\t\tstorage.MapOnPrefix(\"a/b/c\"),\n\t\t)\n\t\twriteObjectCloser, err := mapWriteBucket.Put(\n\t\t\tt.Context(),\n\t\t\t\"hello\",\n\t\t)\n\t\trequire.NoError(t, err)\n\t\t_, err = writeObjectCloser.Write([]byte(\"abcd\"))\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, writeObjectCloser.Close())\n\t\treadBucket := writeBucketToReadBucket(t, writeBucket)\n\t\tdata, err := storage.ReadPath(\n\t\t\tt.Context(),\n\t\t\treadBucket,\n\t\t\t\"a/b/c/hello\",\n\t\t)\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, \"abcd\", string(data))\n\t})\n\n\tt.Run(\"absolute-path-read-error\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\tabsolutePath := \"/absolute/path\"\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tabsolutePath = \"C:\\\\Fake\\\\Absolute\\\\Path\"\n\t\t}\n\t\texpectErr := fmt.Sprintf(\"%s: expected to be relative\", absolutePath)\n\n\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t_, err := readBucket.Get(t.Context(), absolutePath)\n\t\trequire.EqualError(t, err, expectErr, \"should be using storageutil.ValidatePath on Get\")\n\t\t_, err = readBucket.Stat(t.Context(), absolutePath)\n\t\trequire.EqualError(t, err, expectErr, \"should be using storageutil.ValidatePath on Stat\")\n\t\terr = readBucket.Walk(t.Context(), absolutePath, nil)\n\t\trequire.EqualError(t, err, expectErr, \"should be using storageutil.ValidatePrefix on Walk\")\n\t})\n\n\tt.Run(\"absolute-path-write-error\", func(t *testing.T) {\n\t\tt.Parallel()\n\n\t\tabsolutePath := \"/absolute/path\"\n\t\tif runtime.GOOS == \"windows\" {\n\t\t\tabsolutePath = \"C:\\\\Fake\\\\Absolute\\\\Path\"\n\t\t}\n\t\texpectErr := fmt.Sprintf(\"%s: expected to be relative\", absolutePath)\n\n\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\t_, err := writeBucket.Put(t.Context(), absolutePath)\n\t\trequire.EqualError(t, err, expectErr, \"should be using normalize.NormalizeAndValidate on Put\")\n\t\terr = writeBucket.Delete(t.Context(), absolutePath)\n\t\trequire.EqualError(t, err, expectErr, \"should be using normalize.NormalizeAndValidate on Delete\")\n\t})\n\n\tt.Run(\"root-path-error\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\t_, err := readBucket.Get(t.Context(), \".\")\n\t\trequire.EqualError(t, err, \"cannot use root\", \"should be using storageutil.ValidatePath on Get\")\n\t\t_, err = readBucket.Stat(t.Context(), \".\")\n\t\trequire.EqualError(t, err, \"cannot use root\", \"should be using storageutil.ValidatePath on Stat\")\n\t})\n\n\tt.Run(\"write-bucket-put-delete\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\terr := writeBucket.Delete(t.Context(), \"hello\")\n\t\trequire.True(t, errors.Is(err, fs.ErrNotExist))\n\t\twriteObjectCloser, err := writeBucket.Put(\n\t\t\tt.Context(),\n\t\t\t\"hello\",\n\t\t)\n\t\trequire.NoError(t, err)\n\t\t_, err = writeObjectCloser.Write([]byte(\"abcd\"))\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, writeObjectCloser.Close())\n\t\terr = writeBucket.Delete(t.Context(), \"hello\")\n\t\trequire.NoError(t, err)\n\t\terr = writeBucket.Delete(t.Context(), \"hello\")\n\t\trequire.True(t, errors.Is(err, fs.ErrNotExist))\n\t\twriteObjectCloser, err = writeBucket.Put(\n\t\t\tt.Context(),\n\t\t\t\"hello\",\n\t\t)\n\t\trequire.NoError(t, err)\n\t\t_, err = writeObjectCloser.Write([]byte(\"abcd\"))\n\t\trequire.NoError(t, err)\n\t\trequire.NoError(t, writeObjectCloser.Close())\n\t\terr = writeBucket.Delete(t.Context(), \"hello\")\n\t\trequire.NoError(t, err)\n\t\terr = writeBucket.Delete(t.Context(), \"hello\")\n\t\trequire.True(t, errors.Is(err, fs.ErrNotExist))\n\t})\n\n\tt.Run(\"write-bucket-put-delete-all\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tctx := t.Context()\n\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\t// this test starts with this data in the bucket, and then\n\t\t// deletes it over time in different ways\n\t\tpathToData := map[string]string{\n\t\t\t\"a.txt\":      testTxtContent,\n\t\t\t\"b/d.txt\":    testTxtContent,\n\t\t\t\"b/d/e.txt\":  testTxtContent,\n\t\t\t\"b/d/f.txt\":  testTxtContent,\n\t\t\t\"c.d/e.txt\":  testTxtContent,\n\t\t\t\"c.de/f.txt\": testTxtContent,\n\t\t\t\"g.txt\":      testTxtContent,\n\t\t}\n\t\tfor path, data := range pathToData {\n\t\t\terr := storage.PutPath(ctx, writeBucket, path, []byte(data))\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr := writeBucket.DeleteAll(ctx, \"h\")\n\t\trequire.NoError(t, err)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"b/d/e.txt\")\n\t\trequire.NoError(t, err)\n\t\tdelete(pathToData, \"b/d/e.txt\")\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"b/d\")\n\t\trequire.NoError(t, err)\n\t\tdelete(pathToData, \"b/d/f.txt\")\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"b\")\n\t\trequire.NoError(t, err)\n\t\tdelete(pathToData, \"b/d.txt\")\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"a.txt\")\n\t\trequire.NoError(t, err)\n\t\tdelete(pathToData, \"a.txt\")\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"c.d\")\n\t\trequire.NoError(t, err)\n\t\tdelete(pathToData, \"c.d/e.txt\")\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"c.d\")\n\t\trequire.NoError(t, err)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"c.de\")\n\t\trequire.NoError(t, err)\n\t\tdelete(pathToData, \"c.de/f.txt\")\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t\terr = writeBucket.DeleteAll(ctx, \"\")\n\t\trequire.NoError(t, err)\n\t\tdelete(pathToData, \"g.txt\")\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\twriteBucketToReadBucket(t, writeBucket),\n\t\t\t\"\",\n\t\t\tpathToData,\n\t\t)\n\t})\n\n\tt.Run(\"walk-prefixed-bucket-should-not-error\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\treadBucket := writeBucketToReadBucket(t, writeBucket)\n\t\tmappedReadBucket := storage.MapReadBucket(readBucket, storage.MapOnPrefix(\"prefix\"))\n\t\terr := mappedReadBucket.Walk(t.Context(), \"\", func(_ storage.ObjectInfo) error {\n\t\t\treturn nil\n\t\t})\n\t\trequire.NoError(t, err)\n\t})\n\n\tt.Run(\"symlink_success_no_symlinks\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, symlinkSuccessDirPath, defaultProvider)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"file.proto\": testProtoContent,\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"symlink_success_follow_symlinks\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(\n\t\t\tt,\n\t\t\tsymlinkSuccessDirPath,\n\t\t\tstorageos.NewProvider(\n\t\t\t\tstorageos.ProviderWithSymlinks(),\n\t\t\t),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"1.proto\":      testProtoContent,\n\t\t\t\t\"a/b/1.proto\":  testProtoContent,\n\t\t\t\t\"a/b/2.proto\":  testProtoContent,\n\t\t\t\t\"a/b/2.txt\":    testTxtContent,\n\t\t\t\t\"a/bar.yaml\":   testYAMLContent,\n\t\t\t\t\"a/file.proto\": testProtoContent,\n\t\t\t\t\"ab/1.proto\":   testProtoContent,\n\t\t\t\t\"ab/2.proto\":   testProtoContent,\n\t\t\t\t\"ab/2.txt\":     testTxtContent,\n\t\t\t\t\"file.proto\":   testProtoContent,\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"symlink_loop_no_symlinks\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, symlinkLoopDirPath, defaultProvider)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"file.proto\": testProtoContent,\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"symlink_loop_follow_symlinks\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(\n\t\t\tt,\n\t\t\tsymlinkLoopDirPath,\n\t\t\tstorageos.NewProvider(\n\t\t\t\tstorageos.ProviderWithSymlinks(),\n\t\t\t),\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"file.proto\": testProtoContent,\n\t\t\t},\n\t\t)\n\t})\n\tt.Run(\"is_empty\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tctx := t.Context()\n\n\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\tisEmpty, err := storage.IsEmpty(ctx, readBucket, \"\")\n\t\trequire.NoError(t, err)\n\t\trequire.False(t, isEmpty)\n\t\tisEmpty, err = storage.IsEmpty(ctx, readBucket, \"root/a\")\n\t\trequire.NoError(t, err)\n\t\trequire.False(t, isEmpty)\n\n\t\ttmpDir, err := tmp.NewDir(ctx)\n\t\trequire.NoError(t, err)\n\t\treadBucket, _ = newReadBucket(t, tmpDir.Path(), defaultProvider)\n\t\tisEmpty, err = storage.IsEmpty(ctx, readBucket, \"\")\n\t\trequire.NoError(t, err)\n\t\trequire.True(t, isEmpty)\n\t\terr = os.WriteFile(filepath.Join(tmpDir.Path(), \"foo.txt\"), []byte(\"foo\"), 0600)\n\t\trequire.NoError(t, err)\n\t\t// need to make a new readBucket since the old one won't necessarily have the foo.txt\n\t\t// file in it, ie in-memory buckets\n\t\treadBucket, _ = newReadBucket(t, tmpDir.Path(), defaultProvider)\n\t\tisEmpty, err = storage.IsEmpty(ctx, readBucket, \"\")\n\t\trequire.NoError(t, err)\n\t\trequire.False(t, isEmpty)\n\t\tisEmpty, err = storage.IsEmpty(\n\t\t\tctx,\n\t\t\tstorage.FilterReadBucket(readBucket, storage.MatchPathExt(\".proto\")),\n\t\t\t\"\",\n\t\t)\n\t\trequire.NoError(t, err)\n\t\trequire.True(t, isEmpty)\n\t\trequire.NoError(t, tmpDir.Close())\n\t})\n\tt.Run(\"limit-write-bucket\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\treadBucket := writeBucketToReadBucket(t, writeBucket)\n\t\tconst limit = 2048\n\t\tlimitedWriteBucket := storage.LimitWriteBucket(writeBucket, limit)\n\t\tvar (\n\t\t\twg           sync.WaitGroup\n\t\t\twrittenBytes atomic.Int64\n\t\t\ttriedBytes   atomic.Int64\n\t\t)\n\t\tfor i := range 10 {\n\t\t\twg.Add(1)\n\t\t\tgo func(i int) {\n\t\t\t\tdefer wg.Done()\n\t\t\t\tdata := bytes.Repeat([]byte(\"b\"), i*100)\n\t\t\t\tpath := strconv.Itoa(i)\n\t\t\t\ttriedBytes.Add(int64(len(data)))\n\t\t\t\terr := storage.PutPath(t.Context(), limitedWriteBucket, path, data)\n\t\t\t\tif err != nil {\n\t\t\t\t\tassert.True(t, storage.IsWriteLimitReached(err))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\treadData, err := storage.ReadPath(t.Context(), readBucket, path)\n\t\t\t\tassert.NoError(t, err)\n\t\t\t\tassert.Equal(t, readData, data)\n\t\t\t\twrittenBytes.Add(int64(len(data)))\n\t\t\t}(i)\n\t\t}\n\t\twg.Wait()\n\t\trequire.Greater(t, triedBytes.Load(), int64(limit))\n\t\tassert.LessOrEqual(t, writtenBytes.Load(), int64(limit))\n\t})\n\tt.Run(\"limit-untar-file-size\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\twriteBucket := newWriteBucket(t, defaultProvider)\n\t\tconst limit = 2048\n\t\tfiles := map[string][]byte{\n\t\t\t\"within\":     bytes.Repeat([]byte{0}, limit-1),\n\t\t\t\"at\":         bytes.Repeat([]byte{0}, limit),\n\t\t\t\"exceeds\":    bytes.Repeat([]byte{0}, limit+1),\n\t\t\t\"match-file\": bytes.Repeat([]byte{0}, limit-1),\n\t\t}\n\t\tfor path, data := range files {\n\t\t\terr := storage.PutPath(t.Context(), writeBucket, path, data)\n\t\t\trequire.NoError(t, err)\n\t\t}\n\t\tvar buffer bytes.Buffer\n\t\terr := storagearchive.Tar(t.Context(), writeBucketToReadBucket(t, writeBucket), &buffer)\n\t\trequire.NoError(t, err)\n\t\twriteBucket = newWriteBucket(t, defaultProvider)\n\t\ttarball := bytes.NewReader(buffer.Bytes())\n\t\terr = storagearchive.Untar(t.Context(), tarball, writeBucket, storagearchive.UntarWithMaxFileSize(limit))\n\t\tassert.ErrorIs(t, err, storagearchive.ErrFileSizeLimit)\n\t\t_, err = tarball.Seek(0, io.SeekStart)\n\t\trequire.NoError(t, err)\n\t\terr = storagearchive.Untar(t.Context(), tarball, writeBucket)\n\t\tassert.NoError(t, err)\n\t\t_, err = tarball.Seek(0, io.SeekStart)\n\t\trequire.NoError(t, err)\n\t\terr = storagearchive.Untar(t.Context(), tarball, writeBucket, storagearchive.UntarWithMaxFileSize(limit+1))\n\t\tassert.NoError(t, err)\n\t\terr = storagearchive.Untar(\n\t\t\tt.Context(),\n\t\t\ttarball,\n\t\t\twriteBucket,\n\t\t\tstoragearchive.UntarWithFilePathMatcher(\n\t\t\t\tfunc(filePath string) bool {\n\t\t\t\t\treturn filePath == \"match-file\"\n\t\t\t\t},\n\t\t\t),\n\t\t\tstoragearchive.UntarWithMaxFileSize(limit),\n\t\t)\n\t\tassert.NoError(t, err)\n\t})\n\n\tt.Run(\"walk-on-file-path-that-is-not-pure-prefix\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\treadBucket, _ := newReadBucket(t, oneDirPath, defaultProvider)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"root/a/b\",\n\t\t\tmap[string]string{\n\t\t\t\t\"root/a/b/1.proto\": testProtoContent,\n\t\t\t\t\"root/a/b/2.proto\": testProtoContent,\n\t\t\t\t\"root/a/b/2.txt\":   testTxtContent,\n\t\t\t},\n\t\t)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"root/a/b/1.proto\",\n\t\t\tmap[string]string{\n\t\t\t\t\"root/a/b/1.proto\": testProtoContent,\n\t\t\t},\n\t\t)\n\t})\n\n\tt.Run(\"overlay\", func(t *testing.T) {\n\t\taReadBucket, _ := newReadBucket(t, filepath.Join(overlayDirPath, \"a\"), defaultProvider)\n\t\tbReadBucket, _ := newReadBucket(t, filepath.Join(overlayDirPath, \"b\"), defaultProvider)\n\t\treadBucket := storage.OverlayReadBucket(aReadBucket, bReadBucket)\n\t\tAssertPathToContent(\n\t\t\tt,\n\t\t\treadBucket,\n\t\t\t\"\",\n\t\t\tmap[string]string{\n\t\t\t\t\"1\": \"one\\n\",\n\t\t\t\t\"2\": \"two-a\\n\",\n\t\t\t\t\"3\": \"three\\n\",\n\t\t\t},\n\t\t)\n\t})\n}\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/a/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/a/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/a/b/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/a/bar.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/ab/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/ab/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/base/ab/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/diff/a/prefix/1.txt",
    "content": "aaaa\nbbbb\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/diff/a/prefix/2.txt",
    "content": "dddd\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/diff/b/prefix/1.txt",
    "content": "bbbb\ncccc\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/diff/b/prefix/3.txt",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/five/root1/foo",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/five/root2/foo/bar.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/four/root/a/3.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/four/root/a/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/four/root/a/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/link/file.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/a/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/a/1.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/a/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/a/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/a/b/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/a/bar.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/ab/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/ab/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/ab/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/c/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/one/root/foo.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/overlay/a/1",
    "content": "one\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/overlay/a/2",
    "content": "two-a\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/overlay/b/2",
    "content": "two-b\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/overlay/b/3",
    "content": "three\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/symlink_loop/file.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/symlink_success/file.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/three/a/one.proto",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/three/a/one.txt",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/three/b/one.txt",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/three/b/two.proto",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/foo.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/a/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/a/1.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/a/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/a/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/a/b/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/a/bar.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/ab/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/ab/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/ab/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/c/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root1/foo.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/a/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/a/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/a/b/3.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/a/b/4.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/a/b/4.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/a/bat.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/ab/3.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/ab/4.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/ab/4.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/baz.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/root2/c/3.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/a/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/a/1.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/a/b/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/a/b/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/a/b/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/a/bar.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/ab/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/ab/2.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/ab/2.txt",
    "content": "foo\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/c/1.proto",
    "content": "syntax = \"proto3\";\n\npackage foo;\n"
  },
  {
    "path": "private/pkg/storage/storagetesting/testdata/two/rootoverlap/foo.yaml",
    "content": ""
  },
  {
    "path": "private/pkg/storage/storagetesting/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage storagetesting\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/storageutil/storageutil.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storageutil provides helpers for storage implementations.\npackage storageutil\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/bufbuild/buf/private/pkg/normalpath\"\n)\n\n// ObjectInfo is an embeddable ObjectInfo.\n//\n// This is intentionally static and should not be modifiable.\n// If constructing an object, do not use an ObjectInfo to build it.\ntype ObjectInfo struct {\n\tpath         string\n\texternalPath string\n\tlocalPath    string\n}\n\n// NewObjectInfo returns a new ObjectInfo.\nfunc NewObjectInfo(\n\tpath string,\n\texternalPath string,\n\tlocalPath string,\n) ObjectInfo {\n\treturn ObjectInfo{\n\t\tpath:         path,\n\t\texternalPath: externalPath,\n\t\tlocalPath:    localPath,\n\t}\n}\n\n// Path implements ObjectInfo.\nfunc (o ObjectInfo) Path() string {\n\treturn o.path\n}\n\n// ExternalPath implements ObjectInfo.\nfunc (o ObjectInfo) ExternalPath() string {\n\treturn o.externalPath\n}\n\n// LocalPath implements ObjectInfo.\nfunc (o ObjectInfo) LocalPath() string {\n\treturn o.localPath\n}\n\n// ValidatePath validates a path.\nfunc ValidatePath(path string) (string, error) {\n\tpath, err := normalpath.NormalizeAndValidate(path)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif path == \".\" {\n\t\treturn \"\", errors.New(\"cannot use root\")\n\t}\n\treturn path, nil\n}\n\n// ValidatePrefix validates a prefix.\nfunc ValidatePrefix(prefix string) (string, error) {\n\treturn normalpath.NormalizeAndValidate(prefix)\n}\n\n// WalkChecker does validation for every step of a walk.\ntype WalkChecker interface {\n\tCheck(ctx context.Context) error\n}\n\n// NewWalkChecker returns a new WalkChecker.\nfunc NewWalkChecker() WalkChecker {\n\treturn &walkChecker{}\n}\n\ntype walkChecker struct {\n\tcount int\n}\n\nfunc (w *walkChecker) Check(ctx context.Context) error {\n\tw.count++\n\tselect {\n\tcase <-ctx.Done():\n\t\terr := ctx.Err()\n\t\tif err == context.DeadlineExceeded {\n\t\t\treturn fmt.Errorf(\"timed out after %d files: %v\", w.count, err)\n\t\t}\n\t\treturn err\n\tdefault:\n\t\treturn nil\n\t}\n}\n"
  },
  {
    "path": "private/pkg/storage/storageutil/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage storageutil\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/strip.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/pkg/storage/storageutil\"\n)\n\n// StripReadBucketExternalPaths strips the differentiated ExternalPaths from objects\n// returned from the ReadBucket, instead replacing them with the Paths.\n//\n// This is used in situations where the ExternalPath is actually i.e. in a cache, and\n// you don't want to expose this information to callers.\nfunc StripReadBucketExternalPaths(readBucket ReadBucket) ReadBucket {\n\treturn newStripReadBucket(readBucket)\n}\n\ntype stripReadBucket struct {\n\tdelegate ReadBucket\n}\n\nfunc newStripReadBucket(delegate ReadBucket) *stripReadBucket {\n\treturn &stripReadBucket{\n\t\tdelegate: delegate,\n\t}\n}\n\nfunc (r *stripReadBucket) Get(ctx context.Context, path string) (ReadObjectCloser, error) {\n\treadObjectCloser, err := r.delegate.Get(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn stripReadObjectCloserExternalPath(readObjectCloser), nil\n}\n\nfunc (r *stripReadBucket) Stat(ctx context.Context, path string) (ObjectInfo, error) {\n\tobjectInfo, err := r.delegate.Stat(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn stripObjectInfoExternalPath(objectInfo), nil\n}\n\nfunc (r *stripReadBucket) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error {\n\treturn r.delegate.Walk(\n\t\tctx,\n\t\tprefix,\n\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\treturn f(stripObjectInfoExternalPath(objectInfo))\n\t\t},\n\t)\n}\n\nfunc stripObjectInfoExternalPath(objectInfo ObjectInfo) ObjectInfo {\n\tpath := objectInfo.Path()\n\tif path == objectInfo.ExternalPath() {\n\t\treturn objectInfo\n\t}\n\treturn storageutil.NewObjectInfo(path, path, objectInfo.LocalPath())\n}\n\nfunc stripReadObjectCloserExternalPath(readObjectCloser ReadObjectCloser) ReadObjectCloser {\n\tif readObjectCloser.Path() == readObjectCloser.ExternalPath() {\n\t\treturn readObjectCloser\n\t}\n\treturn compositeReadObjectCloser{stripObjectInfoExternalPath(readObjectCloser), readObjectCloser}\n}\n"
  },
  {
    "path": "private/pkg/storage/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage storage\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/storage/util.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 storage\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"sort\"\n)\n\n// errIsNotEmpty is used to break out of the Walk function early in IsEmpty.\n//\n// If errors.Is(err, errIsNotEmpty), the Walk function found a file.\nvar errIsNotEmpty = errors.New(\"__is_not_empty__\")\n\n// ReadPath is analogous to os.ReadFile.\n//\n// Returns an error that fulfills IsNotExist if the path does not exist.\nfunc ReadPath(ctx context.Context, readBucket ReadBucket, path string) (_ []byte, retErr error) {\n\treadObject, err := readBucket.Get(ctx, path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readObject.Close())\n\t}()\n\treturn io.ReadAll(readObject)\n}\n\n// PutPath puts the data at the path.\nfunc PutPath(ctx context.Context, writeBucket WriteBucket, path string, data []byte, options ...PutOption) (retErr error) {\n\twriteObjectCloser, err := writeBucket.Put(ctx, path, options...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t}()\n\t_, err = writeObjectCloser.Write(data)\n\treturn err\n}\n\n// ForReadObject gets a ReadObjectCloser at the given path, calls f on it, and then closes the ReadObjectCloser.\nfunc ForReadObject(ctx context.Context, readBucket ReadBucket, path string, f func(ReadObject) error) (retErr error) {\n\treadObjectCloser, err := readBucket.Get(ctx, path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, readObjectCloser.Close())\n\t}()\n\treturn f(readObjectCloser)\n}\n\n// ForWriteObject gets a WriteObjectCloser at the given path, calls f on it, and then closes the WriteObjectCloser.\nfunc ForWriteObject(ctx context.Context, writeBucket WriteBucket, path string, f func(WriteObject) error, options ...PutOption) (retErr error) {\n\twriteObjectCloser, err := writeBucket.Put(ctx, path, options...)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tretErr = errors.Join(retErr, writeObjectCloser.Close())\n\t}()\n\treturn f(writeObjectCloser)\n}\n\n// WalkReadObjects walks the bucket and calls get on each, closing the resulting ReadObjectCloser\n// when done.\nfunc WalkReadObjects(\n\tctx context.Context,\n\treadBucket ReadBucket,\n\tprefix string,\n\tf func(ReadObject) error,\n) error {\n\treturn readBucket.Walk(\n\t\tctx,\n\t\tprefix,\n\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\treadObjectCloser, err := readBucket.Get(ctx, objectInfo.Path())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn errors.Join(f(readObjectCloser), readObjectCloser.Close())\n\t\t},\n\t)\n}\n\n// AllPaths walks the bucket and gets all the paths.\n//\n// The returned paths are sorted.\nfunc AllPaths(ctx context.Context, readBucket ReadBucket, prefix string) ([]string, error) {\n\tvar allPaths []string\n\tif err := readBucket.Walk(\n\t\tctx,\n\t\tprefix,\n\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\tallPaths = append(allPaths, objectInfo.Path())\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Strings(allPaths)\n\treturn allPaths, nil\n}\n\n// AllObjectInfos walks the bucket and gets all the ObjectInfos.\n//\n// The returned ObjectInfos are sorted by path.\nfunc AllObjectInfos(ctx context.Context, readBucket ReadBucket, prefix string) ([]ObjectInfo, error) {\n\tvar allObjectInfos []ObjectInfo\n\tif err := readBucket.Walk(\n\t\tctx,\n\t\tprefix,\n\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\tallObjectInfos = append(allObjectInfos, objectInfo)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\tsort.Slice(\n\t\tallObjectInfos,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn allObjectInfos[i].Path() < allObjectInfos[j].Path()\n\t\t},\n\t)\n\treturn allObjectInfos, nil\n}\n\n// Exists returns true if the path exists, false otherwise.\nfunc Exists(ctx context.Context, readBucket ReadBucket, path string) (bool, error) {\n\t_, err := readBucket.Stat(ctx, path)\n\tif err != nil {\n\t\tif IsNotExist(err) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\n// IsEmpty returns true if the bucket is empty under the prefix.\n//\n// A prefix of \"\" or \".\" will check if the entire bucket is empty.\nfunc IsEmpty(ctx context.Context, readBucket ReadBucket, prefix string) (bool, error) {\n\tif err := readBucket.Walk(\n\t\tctx,\n\t\tprefix,\n\t\tfunc(ObjectInfo) error {\n\t\t\treturn errIsNotEmpty\n\t\t},\n\t); err != nil {\n\t\tif errors.Is(err, errIsNotEmpty) {\n\t\t\treturn false, nil\n\t\t}\n\t\treturn false, err\n\t}\n\treturn true, nil\n}\n\n// allObjectInfos walks the bucket and gets all the ObjectInfos.\nfunc allObjectInfos(ctx context.Context, readBucket ReadBucket, prefix string) ([]ObjectInfo, error) {\n\tvar allObjectInfos []ObjectInfo\n\tif err := readBucket.Walk(\n\t\tctx,\n\t\tprefix,\n\t\tfunc(objectInfo ObjectInfo) error {\n\t\t\tallObjectInfos = append(allObjectInfos, objectInfo)\n\t\t\treturn nil\n\t\t},\n\t); err != nil {\n\t\treturn nil, err\n\t}\n\treturn allObjectInfos, nil\n}\n\nfunc pathToObjectInfo(objectInfos []ObjectInfo) map[string]ObjectInfo {\n\tm := make(map[string]ObjectInfo, len(objectInfos))\n\tfor _, objectInfo := range objectInfos {\n\t\tm[objectInfo.Path()] = objectInfo\n\t}\n\treturn m\n}\n\nfunc sortObjectInfos(objectInfos []ObjectInfo) {\n\tsort.Slice(\n\t\tobjectInfos,\n\t\tfunc(i int, j int) bool {\n\t\t\treturn objectInfos[i].Path() < objectInfos[j].Path()\n\t\t},\n\t)\n}\n\ntype compositeReadObjectCloser struct {\n\tObjectInfo\n\tio.ReadCloser\n}\n\ntype compositeReadWriteBucketCloser struct {\n\tReadBucket\n\tWriteBucket\n\tcloseFunc func() error\n}\n\nfunc (c compositeReadWriteBucketCloser) Close() error {\n\tif c.closeFunc != nil {\n\t\treturn c.closeFunc()\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/stringjson/stringjson.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 stringjson\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n)\n\nvar newline = []byte{'\\n'}\n\n// Object is an object that can either be marshaled to string or JSON.\ntype Object interface {\n\tfmt.Stringer\n\tjson.Marshaler\n}\n\n// Print prints the object.\nfunc Print(writer io.Writer, object Object, asJSON bool) error {\n\treturn printInternal(writer, object, asJSON, nil)\n}\n\n// Println prints the object with a newline.\nfunc Println(writer io.Writer, object Object, asJSON bool) error {\n\treturn printInternal(writer, object, asJSON, newline)\n}\n\nfunc printInternal(writer io.Writer, object Object, asJSON bool, extra []byte) error {\n\tif object == nil {\n\t\treturn nil\n\t}\n\tvar data []byte\n\tvar err error\n\tif asJSON {\n\t\tdata, err = object.MarshalJSON()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\tdata = []byte(object.String())\n\t}\n\tif len(data) > 0 {\n\t\tif len(extra) > 0 {\n\t\t\tdata = append(data, extra...)\n\t\t}\n\t\tif _, err := writer.Write(data); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/stringjson/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage stringjson\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/syserror/syserror.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 syserror handles \"system errors\".\n//\n// A system error is an error that should never actually happen, and should be\n// propagated to the user as a bug in the codebase. System errors are generally\n// defensive-programming assertions that we want to check for in our codebase.\n//\n// If a system error occurs, you may want to send a specialized help that says\n// how to file a bug report.\npackage syserror\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\n// Error is a system error.\ntype Error struct {\n\tUnderlying error\n}\n\n// Error implements error.\nfunc (e *Error) Error() string {\n\tif e == nil {\n\t\treturn \"\"\n\t}\n\tif e.Underlying == nil {\n\t\treturn \"\"\n\t}\n\treturn \"system error: \" + e.Underlying.Error()\n}\n\n// Unwrap implements errors.Unwrap for Error.\nfunc (e *Error) Unwrap() error {\n\tif e == nil {\n\t\treturn nil\n\t}\n\treturn e.Underlying\n}\n\n// New is a convenience function that returns a new system error by calling errors.new.\nfunc New(text string) *Error {\n\treturn &Error{\n\t\tUnderlying: errors.New(text),\n\t}\n}\n\n// Newf is a convenience function that returns a new system error by calling fmt.Errorf.\nfunc Newf(format string, args ...any) *Error {\n\treturn &Error{\n\t\tUnderlying: fmt.Errorf(format, args...),\n\t}\n}\n\n// Wrap returns a new system error for err.\n//\n// If err is already a system error, this returns err.\nfunc Wrap(err error) error {\n\tif Is(err) {\n\t\treturn err\n\t}\n\treturn &Error{\n\t\tUnderlying: err,\n\t}\n}\n\n// Is is a convenience function that returns true if err is a system error.\nfunc Is(err error) bool {\n\t_, ok := As(err)\n\treturn ok\n}\n\n// As is a convenience function that returns err as an Error and true if err is an Error,\n// and err and false otherwise.\nfunc As(err error) (*Error, bool) {\n\ttarget := &Error{}\n\tok := errors.As(err, &target)\n\treturn target, ok\n}\n"
  },
  {
    "path": "private/pkg/syserror/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage syserror\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/thread/thread.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 thread\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"runtime\"\n\t\"sync\"\n)\n\nvar (\n\tglobalParallelism = runtime.GOMAXPROCS(0)\n\tglobalLock        sync.RWMutex\n)\n\n// Parallelism returns the current parallelism.\n//\n// This defaults to the number of CPUs.\nfunc Parallelism() int {\n\tglobalLock.RLock()\n\tparallelism := globalParallelism\n\tglobalLock.RUnlock()\n\treturn parallelism\n}\n\n// SetParallelism sets the parallelism.\n//\n// If parallelism < 1, this sets the parallelism to 1.\nfunc SetParallelism(parallelism int) {\n\tif parallelism < 1 {\n\t\tparallelism = 1\n\t}\n\tglobalLock.Lock()\n\tglobalParallelism = parallelism\n\tglobalLock.Unlock()\n}\n\n// Parallelize runs the jobs in parallel.\n//\n// A max of Parallelism jobs will be run at once.\n// Returns the combined error from the jobs.\nfunc Parallelize(ctx context.Context, jobs []func(context.Context) error, options ...ParallelizeOption) error {\n\tparallelizeOptions := newParallelizeOptions()\n\tfor _, option := range options {\n\t\toption(parallelizeOptions)\n\t}\n\tswitch len(jobs) {\n\tcase 0:\n\t\treturn nil\n\tcase 1:\n\t\treturn jobs[0](ctx)\n\t}\n\tmultiplier := max(parallelizeOptions.multiplier, 1)\n\tvar cancel context.CancelFunc\n\tif parallelizeOptions.cancelOnFailure {\n\t\tctx, cancel = context.WithCancel(ctx)\n\t\tdefer cancel()\n\t}\n\tsemaphoreC := make(chan struct{}, Parallelism()*multiplier)\n\tvar errs []error\n\tvar lock sync.Mutex\n\taddError := func(err error) {\n\t\tlock.Lock()\n\t\terrs = append(errs, err)\n\t\tlock.Unlock()\n\t}\n\tvar wg sync.WaitGroup\n\tvar stop bool\n\tfor _, job := range jobs {\n\t\tif stop {\n\t\t\tbreak\n\t\t}\n\t\t// We always want context cancellation/deadline expiration to take\n\t\t// precedence over the semaphore unblocking, but select statements choose\n\t\t// among the unblocked non-default cases pseudorandomly. To correctly\n\t\t// enforce precedence, use a similar pattern to the check-lock-check\n\t\t// pattern common with sync.RWMutex: check the context twice, and only do\n\t\t// the semaphore-protected work in the innermost default case.\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tstop = true\n\t\t\taddError(ctx.Err())\n\t\tcase semaphoreC <- struct{}{}:\n\t\t\tselect {\n\t\t\tcase <-ctx.Done():\n\t\t\t\tstop = true\n\t\t\t\taddError(ctx.Err())\n\t\t\tdefault:\n\t\t\t\tjob := job\n\t\t\t\twg.Go(func() {\n\t\t\t\t\tif err := job(ctx); err != nil {\n\t\t\t\t\t\taddError(err)\n\t\t\t\t\t\tif cancel != nil {\n\t\t\t\t\t\t\tcancel()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// This will never block.\n\t\t\t\t\t<-semaphoreC\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n\twg.Wait()\n\tswitch len(errs) {\n\tcase 0:\n\t\treturn nil\n\tcase 1:\n\t\treturn errs[0]\n\tdefault:\n\t\treturn errors.Join(errs...)\n\t}\n}\n\n// ParallelizeOption is an option to Parallelize.\ntype ParallelizeOption func(*parallelizeOptions)\n\n// ParallelizeWithMultiplier returns a new ParallelizeOption that will use a multiple\n// of Parallelism() for the number of jobs that can be run at once.\n//\n// The default is to only do Parallelism() number of jobs.\n// A multiplier of <1 has no meaning.\nfunc ParallelizeWithMultiplier(multiplier int) ParallelizeOption {\n\treturn func(parallelizeOptions *parallelizeOptions) {\n\t\tparallelizeOptions.multiplier = multiplier\n\t}\n}\n\n// ParallelizeWithCancelOnFailure returns a new ParallelizeOption that will attempt\n// to cancel all other jobs via context cancellation if any job fails.\nfunc ParallelizeWithCancelOnFailure() ParallelizeOption {\n\treturn func(parallelizeOptions *parallelizeOptions) {\n\t\tparallelizeOptions.cancelOnFailure = true\n\t}\n}\n\ntype parallelizeOptions struct {\n\tmultiplier      int\n\tcancelOnFailure bool\n}\n\nfunc newParallelizeOptions() *parallelizeOptions {\n\treturn &parallelizeOptions{}\n}\n"
  },
  {
    "path": "private/pkg/thread/thread_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 thread\n\nimport (\n\t\"context\"\n\t\"sync/atomic\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestParallelizeWithImmediateCancellation(t *testing.T) {\n\tt.Parallel()\n\t// The bulk of the code relies on subtle timing that's difficult to\n\t// reproduce, but we can test the most basic use case.\n\tt.Run(\"RegularRun\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tconst jobsToExecute = 10\n\t\tvar (\n\t\t\texecuted atomic.Int64\n\t\t\tjobs     = make([]func(context.Context) error, 0, jobsToExecute)\n\t\t)\n\t\tfor range jobsToExecute {\n\t\t\tjobs = append(jobs, func(_ context.Context) error {\n\t\t\t\texecuted.Add(1)\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t\terr := Parallelize(t.Context(), jobs)\n\t\tassert.NoError(t, err)\n\t\tassert.Equal(t, int64(jobsToExecute), executed.Load(), \"jobs executed\")\n\t})\n\tt.Run(\"WithCtxCancellation\", func(t *testing.T) {\n\t\tt.Parallel()\n\t\tvar executed atomic.Int64\n\t\tvar jobs []func(context.Context) error\n\t\tfor range 10 {\n\t\t\tjobs = append(jobs, func(_ context.Context) error {\n\t\t\t\texecuted.Add(1)\n\t\t\t\treturn nil\n\t\t\t})\n\t\t}\n\t\tctx, cancel := context.WithCancel(t.Context())\n\t\tcancel()\n\t\terr := Parallelize(ctx, jobs)\n\t\tassert.Error(t, err)\n\t\tassert.Equal(t, int64(0), executed.Load(), \"jobs executed\")\n\t})\n}\n"
  },
  {
    "path": "private/pkg/thread/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage thread\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/tmp/tmp.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 tmp provides temporary files and directories.\n//\n// Usage of this package requires eng approval - ask before using.\npackage tmp\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"io\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"github.com/bufbuild/buf/private/pkg/uuidutil\"\n)\n\n// File is a temporary file or directory.\n//\n// It must be closed when done.\ntype File interface {\n\tio.Closer\n\n\tPath() string\n}\n\n// NewFile returns a new temporary file with the data copied from the Reader.\n//\n// It must be closed when done. This deletes this file.\n// This file will be automatically closed on context cancellation.\n//\n// Usage of this function requires eng approval - ask before using.\nfunc NewFile(ctx context.Context, reader io.Reader) (File, error) {\n\tid, err := uuidutil.New()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfile, err := os.CreateTemp(\"\", id.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpath := file.Name()\n\t// just in case\n\tabsPath, err := filepath.Abs(filepath.Clean(path))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcloser := func() error { return os.Remove(absPath) }\n\tgo func() {\n\t\t<-ctx.Done()\n\t\t_ = closer()\n\t}()\n\t_, err = io.Copy(file, reader)\n\terr = errors.Join(err, file.Close())\n\tif err != nil {\n\t\terr = errors.Join(err, closer())\n\t\treturn nil, err\n\t}\n\treturn newFile(closerFunc(closer), absPath), nil\n}\n\n// NewDir returns a new temporary directory.\n//\n// It must be closed when done. This deletes this directory and all its contents.\n// This directory will be automatically closed on context cancellation.\n//\n// Usage of this function requires eng approval - ask before using.\nfunc NewDir(ctx context.Context, options ...DirOption) (File, error) {\n\tdirOptions := newDirOptions()\n\tfor _, option := range options {\n\t\toption(dirOptions)\n\t}\n\tid, err := uuidutil.New()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tpath, err := os.MkdirTemp(dirOptions.basePath, id.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// just in case\n\tabsPath, err := filepath.Abs(filepath.Clean(path))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcloser := func() error { return os.RemoveAll(absPath) }\n\tgo func() {\n\t\t<-ctx.Done()\n\t\t_ = closer()\n\t}()\n\treturn newFile(closerFunc(closer), absPath), nil\n}\n\n// DirOption is an option for NewDir.\ntype DirOption func(*dirOptions)\n\n// DirWithBasePath returns a new DirOption that sets the base path to create\n// the temporary directory in.\n//\n// The default is to use os.TempDir().\nfunc DirWithBasePath(basePath string) DirOption {\n\treturn func(dirOptions *dirOptions) {\n\t\tdirOptions.basePath = basePath\n\t}\n}\n\ntype file struct {\n\tio.Closer\n\n\tpath string\n}\n\nfunc newFile(closer io.Closer, path string) *file {\n\treturn &file{\n\t\tCloser: closer,\n\t\tpath:   path,\n\t}\n}\n\nfunc (f *file) Path() string {\n\treturn f.path\n}\n\ntype closerFunc func() error\n\nfunc (c closerFunc) Close() error {\n\treturn c()\n}\n\ntype dirOptions struct {\n\tbasePath string\n}\n\nfunc newDirOptions() *dirOptions {\n\treturn &dirOptions{}\n}\n"
  },
  {
    "path": "private/pkg/tmp/tmp_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 tmp\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestFile(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\ttmpFile, err := NewFile(ctx, strings.NewReader(\"foo\"))\n\trequire.NoError(t, err)\n\tassert.True(t, filepath.IsAbs(tmpFile.Path()))\n\tdata, err := os.ReadFile(tmpFile.Path())\n\tassert.NoError(t, err)\n\tassert.Equal(t, \"foo\", string(data))\n\tassert.NoError(t, tmpFile.Close())\n\t_, err = os.ReadFile(tmpFile.Path())\n\tassert.Error(t, err)\n}\n\nfunc TestFileCancel(t *testing.T) {\n\tt.Parallel()\n\tctx, cancel := context.WithCancel(t.Context())\n\ttmpFile, err := NewFile(ctx, strings.NewReader(\"foo\"))\n\trequire.NoError(t, err)\n\t_, err = os.ReadFile(tmpFile.Path())\n\tassert.NoError(t, err)\n\tcancel()\n\ttime.Sleep(1 * time.Second)\n\t_, err = os.ReadFile(tmpFile.Path())\n\tassert.Error(t, err)\n}\n\nfunc TestDir(t *testing.T) {\n\tt.Parallel()\n\tctx := t.Context()\n\ttmpDir, err := NewDir(ctx)\n\trequire.NoError(t, err)\n\tassert.True(t, filepath.IsAbs(tmpDir.Path()))\n\tfileInfo, err := os.Lstat(tmpDir.Path())\n\tassert.NoError(t, err)\n\tassert.True(t, fileInfo.IsDir())\n\tassert.NoError(t, tmpDir.Close())\n\t_, err = os.Lstat(tmpDir.Path())\n\tassert.Error(t, err)\n}\n\nfunc TestDirCancel(t *testing.T) {\n\tt.Parallel()\n\tctx, cancel := context.WithCancel(t.Context())\n\ttmpDir, err := NewDir(ctx)\n\trequire.NoError(t, err)\n\t_, err = os.Lstat(tmpDir.Path())\n\tassert.NoError(t, err)\n\tcancel()\n\ttime.Sleep(1 * time.Second)\n\t_, err = os.Lstat(tmpDir.Path())\n\tassert.Error(t, err)\n}\n"
  },
  {
    "path": "private/pkg/tmp/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage tmp\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/transport/http/httpclient/client.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpclient\n\nimport (\n\t\"crypto/tls\"\n\t\"net/http\"\n)\n\nfunc newClient(clientTLSConfig *tls.Config) *http.Client {\n\treturn &http.Client{\n\t\tTransport: &http.Transport{\n\t\t\tTLSClientConfig: clientTLSConfig,\n\t\t\tProxy:           http.ProxyFromEnvironment,\n\t\t},\n\t}\n}\n"
  },
  {
    "path": "private/pkg/transport/http/httpclient/httpclient.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpclient\n\nimport (\n\t\"crypto/tls\"\n\t\"net/http\"\n)\n\n// NewClient returns a new Client.\nfunc NewClient(clientTLSConfig *tls.Config) *http.Client {\n\treturn newClient(clientTLSConfig)\n}\n"
  },
  {
    "path": "private/pkg/transport/http/httpclient/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage httpclient\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/transport/http/httpserver/httpserver.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 httpserver\n\nimport (\n\t\"context\"\n\t\"crypto/tls\"\n\t\"log/slog\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"golang.org/x/sync/errgroup\"\n)\n\nconst (\n\t// DefaultShutdownTimeout is the default shutdown timeout.\n\tDefaultShutdownTimeout = 10 * time.Second\n\t// DefaultReadHeaderTimeout is the default read header timeout.\n\tDefaultReadHeaderTimeout = 30 * time.Second\n\t// DefaultIdleTimeout is the amount of time a connection can be idle.\n\tDefaultIdleTimeout = 3 * time.Minute\n)\n\ntype runner struct {\n\tshutdownTimeout   time.Duration\n\treadHeaderTimeout time.Duration\n\ttlsConfig         *tls.Config\n\tdisableH2C        bool\n}\n\n// RunOption is an option for a new Run.\ntype RunOption func(*runner)\n\n// RunWithShutdownTimeout returns a new RunOption that uses the given shutdown timeout.\n//\n// The default is to use DefaultShutdownTimeout.\n// If shutdownTimeout is 0, no graceful shutdown will be performed.\nfunc RunWithShutdownTimeout(shutdownTimeout time.Duration) RunOption {\n\treturn func(runner *runner) {\n\t\trunner.shutdownTimeout = shutdownTimeout\n\t}\n}\n\n// RunWithReadHeaderTimeout returns a new RunOption that uses the given read header timeout.\n//\n// The default is to use DefaultReadHeaderTimeout.\n// If readHeaderTimeout is 0, no read header timeout will be used.\nfunc RunWithReadHeaderTimeout(readHeaderTimeout time.Duration) RunOption {\n\treturn func(runner *runner) {\n\t\trunner.readHeaderTimeout = readHeaderTimeout\n\t}\n}\n\n// RunWithTLSConfig returns a new RunOption that uses the given tls.Config.\n//\n// The default is to use no TLS.\nfunc RunWithTLSConfig(tlsConfig *tls.Config) RunOption {\n\treturn func(runner *runner) {\n\t\trunner.tlsConfig = tlsConfig\n\t}\n}\n\n// RunWithoutH2C disables use of H2C (used when RunWithTLSConfig is not called).\nfunc RunWithoutH2C() RunOption {\n\treturn func(runner *runner) {\n\t\trunner.disableH2C = true\n\t}\n}\n\n// Run will start a HTTP server listening on the provided listener and\n// serving the provided handler. This call is blocking and the run\n// is cancelled when the input context is cancelled, the listener is\n// closed upon return.\n//\n// The Run function can be configured further by passing a variety of options.\nfunc Run(\n\tctx context.Context,\n\tlogger *slog.Logger,\n\tlistener net.Listener,\n\thandler http.Handler,\n\toptions ...RunOption,\n) error {\n\ts := &runner{\n\t\tshutdownTimeout:   DefaultShutdownTimeout,\n\t\treadHeaderTimeout: DefaultReadHeaderTimeout,\n\t}\n\tfor _, option := range options {\n\t\toption(s)\n\t}\n\tprotocols := new(http.Protocols)\n\tprotocols.SetHTTP1(true)\n\tprotocols.SetHTTP2(true)\n\tprotocols.SetUnencryptedHTTP2(!s.disableH2C)\n\thttpServer := &http.Server{\n\t\tHandler:           handler,\n\t\tReadHeaderTimeout: s.readHeaderTimeout,\n\t\tErrorLog:          slog.NewLogLogger(logger.Handler(), slog.LevelError),\n\t\tTLSConfig:         s.tlsConfig,\n\t\tProtocols:         protocols,\n\t\tIdleTimeout:       DefaultIdleTimeout,\n\t}\n\n\teg, ctx := errgroup.WithContext(ctx)\n\teg.Go(func() error {\n\t\treturn httpServe(httpServer, listener)\n\t})\n\teg.Go(func() error {\n\t\t<-ctx.Done()\n\t\tstart := time.Now()\n\t\tlogger.Info(\"shutdown_starting\", slog.Duration(\"shutdown_timeout\", s.shutdownTimeout))\n\t\tdefer func() {\n\t\t\tlogger.Info(\"shutdown_finished\", slog.Duration(\"duration\", time.Since(start)))\n\t\t}()\n\t\tif s.shutdownTimeout != 0 {\n\t\t\tctx, cancel := context.WithTimeout(context.Background(), s.shutdownTimeout)\n\t\t\tdefer cancel()\n\t\t\treturn httpServer.Shutdown(ctx)\n\t\t}\n\t\treturn httpServer.Close()\n\t})\n\n\tlogger.Info(\n\t\t\"starting\",\n\t\tslog.String(\"address\", listener.Addr().String()),\n\t\tslog.Duration(\"shutdown_timeout\", s.shutdownTimeout),\n\t\tslog.Bool(\"tls\", s.tlsConfig != nil),\n\t)\n\tif err := eg.Wait(); err != http.ErrServerClosed {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc httpServe(httpServer *http.Server, listener net.Listener) error {\n\tif httpServer.TLSConfig != nil {\n\t\treturn httpServer.ServeTLS(listener, \"\", \"\")\n\t}\n\treturn httpServer.Serve(listener)\n}\n"
  },
  {
    "path": "private/pkg/transport/http/httpserver/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage httpserver\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/uuidutil/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage uuidutil\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/uuidutil/uuidutil.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 uuidutil\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/google/uuid\"\n)\n\n// New returns a new random UUIDv4.\nfunc New() (uuid.UUID, error) {\n\tid, err := uuid.NewRandom()\n\tif err != nil {\n\t\treturn uuid.Nil, err\n\t}\n\treturn id, nil\n}\n\n// ToDashless returns the uuid without dashes.\nfunc ToDashless(id uuid.UUID) string {\n\ts := id.String()\n\treturn s[0:8] + s[9:13] + s[14:18] + s[19:23] + s[24:]\n}\n\n// FromString returns the uuid from the string.\n//\n// As opposed to uuid.FromString, this only accepts uuids with dashes.\n// Always use this instead of uuid.FromString.\nfunc FromString(s string) (uuid.UUID, error) {\n\tif len(s) != 36 {\n\t\treturn uuid.Nil, fmt.Errorf(\"expected uuid to be of length 36 but was %d: %s\", len(s), s)\n\t}\n\treturn uuid.Parse(s)\n}\n\n// FromDashless returns the dashless uuid with dashes.\nfunc FromDashless(dashless string) (uuid.UUID, error) {\n\tif len(dashless) != 32 {\n\t\treturn uuid.Nil, fmt.Errorf(\"expected dashless uuid to be of length 32 but was %d: %s\", len(dashless), dashless)\n\t}\n\t// FromString accepts both dashless and regular, we do this because we need to add our own FromString that does not accept dashless\n\treturn FromString(dashless[0:8] + \"-\" + dashless[8:12] + \"-\" + dashless[12:16] + \"-\" + dashless[16:20] + \"-\" + dashless[20:])\n}\n\n// Validate determines if the given UUID string is valid.\nfunc Validate(s string) error {\n\t_, err := FromString(s)\n\treturn err\n}\n\n// ValidateDashless validates the dashless uuid is valid.\nfunc ValidateDashless(dashless string) error {\n\t_, err := FromDashless(dashless)\n\treturn err\n}\n\n// FromStringSlice returns a slice of uuids from the string slice.\n//\n// This only accepts uuids with dashes.\nfunc FromStringSlice(s []string) ([]uuid.UUID, error) {\n\tvar parsedUUIDS []uuid.UUID\n\tfor _, stringID := range s {\n\t\tparsed, err := FromString(stringID)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tparsedUUIDS = append(parsedUUIDS, parsed)\n\t}\n\treturn parsedUUIDS, nil\n}\n"
  },
  {
    "path": "private/pkg/uuidutil/uuidutil_test.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 uuidutil\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestRoundTrip(t *testing.T) {\n\tt.Parallel()\n\tfor range 100 {\n\t\tid, err := New()\n\t\trequire.NoError(t, err)\n\t\tdashless := ToDashless(id)\n\t\troundTripID, err := FromDashless(dashless)\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, id, roundTripID)\n\t}\n}\n\nfunc TestFromStringFailsWithDashless(t *testing.T) {\n\tt.Parallel()\n\tid, err := New()\n\trequire.NoError(t, err)\n\tdashless := ToDashless(id)\n\t_, err = FromString(dashless)\n\trequire.Error(t, err)\n}\n\nfunc TestFromDashlessFailsWithUUID(t *testing.T) {\n\tt.Parallel()\n\tid, err := New()\n\trequire.NoError(t, err)\n\t_, err = FromDashless(id.String())\n\trequire.Error(t, err)\n}\n\nfunc TestValidateFailsWithDashless(t *testing.T) {\n\tt.Parallel()\n\tid, err := New()\n\trequire.NoError(t, err)\n\tdashless := ToDashless(id)\n\terr = Validate(dashless)\n\trequire.Error(t, err)\n}\n\nfunc TestValidateDashlessFailsWithUUID(t *testing.T) {\n\tt.Parallel()\n\tid, err := New()\n\trequire.NoError(t, err)\n\terr = ValidateDashless(id.String())\n\trequire.Error(t, err)\n}\n\nfunc TestFromStringSliceFailsWithDashless(t *testing.T) {\n\tt.Parallel()\n\tid1, err := New()\n\trequire.NoError(t, err)\n\tid2, err := New()\n\trequire.NoError(t, err)\n\tdashless := []string{ToDashless(id1), ToDashless(id2)}\n\t_, err = FromStringSlice(dashless)\n\trequire.Error(t, err)\n}\n\nfunc TestFromStringSlice(t *testing.T) {\n\tt.Parallel()\n\tid1, err := New()\n\trequire.NoError(t, err)\n\tid2, err := New()\n\trequire.NoError(t, err)\n\tids := []string{id1.String(), id2.String()}\n\tuuids, err := FromStringSlice(ids)\n\trequire.NoError(t, err)\n\trequire.Equal(t, 2, len(uuids))\n\trequire.Equal(t, id1, uuids[0])\n\trequire.Equal(t, id2, uuids[1])\n}\n"
  },
  {
    "path": "private/pkg/verbose/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage verbose\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/verbose/verbose.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 verbose\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"strings\"\n)\n\nvar (\n\t// NopPrinter is a no-op printer.\n\t//\n\t// This generally aligns with the --verbose flag not being set.\n\tNopPrinter = nopPrinter{}\n)\n\n// Printer prints verbose messages.\ntype Printer interface {\n\t// Enabled returns true if verbose mode is enabled.\n\t//\n\t// This is false if the Printer is a no-op printer.\n\tEnabled() bool\n\t// Printf prints a new verbose message.\n\t//\n\t// Leading and trailing newlines are not respected.\n\t//\n\t// Callers should not rely on the print calls being reliable, i.e. errors to\n\t// a backing Writer will be ignored.\n\tPrintf(format string, args ...any)\n\n\tisPrinter()\n}\n\n// NewPrinter returns a new Printer using the given Writer.\n//\n// The trimmed prefix is printed with a : before each line.\n//\n// This generally aligns with the --verbose flag being set and writer being stderr.\nfunc NewPrinter(writer io.Writer, prefix string) Printer {\n\treturn newWritePrinter(writer, prefix)\n}\n\n// NewPrinterForFlagValue returns a new Printer for the given verboseValue flag value.\nfunc NewPrinterForFlagValue(writer io.Writer, prefix string, verboseValue bool) Printer {\n\tif verboseValue {\n\t\treturn NewPrinter(writer, prefix)\n\t}\n\treturn NopPrinter\n}\n\ntype nopPrinter struct{}\n\nfunc (nopPrinter) Printf(string, ...any) {}\n\nfunc (nopPrinter) Enabled() bool {\n\treturn false\n}\n\nfunc (nopPrinter) isPrinter() {}\n\ntype writePrinter struct {\n\twriter io.Writer\n\tprefix string\n}\n\nfunc newWritePrinter(writer io.Writer, prefix string) *writePrinter {\n\tprefix = strings.TrimSpace(prefix)\n\tif prefix != \"\" {\n\t\tprefix = prefix + \": \"\n\t}\n\treturn &writePrinter{\n\t\twriter: writer,\n\t\tprefix: prefix,\n\t}\n}\n\nfunc (w *writePrinter) Printf(format string, args ...any) {\n\tif value := strings.TrimSpace(fmt.Sprintf(format, args...)); value != \"\" {\n\t\t// Errors are ignored per the interface spec.\n\t\t_, _ = w.writer.Write([]byte(w.prefix + value + \"\\n\"))\n\t}\n}\n\nfunc (*writePrinter) Enabled() bool {\n\treturn true\n}\n\nfunc (*writePrinter) isPrinter() {}\n"
  },
  {
    "path": "private/pkg/wasm/compiled_module.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 wasm\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/tetratelabs/wazero\"\n\t\"pluginrpc.com/pluginrpc\"\n)\n\ntype compiledModule struct {\n\tmoduleName     string\n\truntime        wazero.Runtime\n\tcompiledModule wazero.CompiledModule\n}\n\nfunc (p *compiledModule) Run(ctx context.Context, env pluginrpc.Env) error {\n\t// Create a new module wazeroModuleConfig with the given environment.\n\twazeroModuleConfig := wazero.NewModuleConfig().\n\t\tWithStdin(env.Stdin).\n\t\tWithStdout(env.Stdout).\n\t\tWithStderr(env.Stderr).\n\t\t// Use an empty name to allow for multiple instances of the same module.\n\t\t// See wazero.ModuleConfig.WithName.\n\t\tWithName(\"\").\n\t\t// Use the program name as the first argument to replicate the\n\t\t// behavior of os.Exec.\n\t\t// See wazero.ModuleConfig.WithArgs.\n\t\tWithArgs(append([]string{p.moduleName}, env.Args...)...)\n\n\t// Instantiate the Wasm module into the runtime. This effectively runs\n\t// the Wasm module. Only the effect of instantiating the module is used,\n\t// the module is closed immediately after running to free up resources.\n\t// See https://github.com/tetratelabs/wazero/issues/985.\n\twazeroModule, err := p.runtime.InstantiateModule(\n\t\tctx,\n\t\tp.compiledModule,\n\t\twazeroModuleConfig,\n\t)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to instantiate module: %w\", err)\n\t}\n\tif err := wazeroModule.Close(ctx); err != nil {\n\t\treturn fmt.Errorf(\"failed to close module: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (p *compiledModule) Close(ctx context.Context) error {\n\treturn p.compiledModule.Close(ctx)\n}\n"
  },
  {
    "path": "private/pkg/wasm/runtime.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 wasm\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/tetratelabs/wazero\"\n\t\"github.com/tetratelabs/wazero/api\"\n\t\"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1\"\n)\n\nconst (\n\t// defaultMaxMemoryBytes is the maximum memory size in bytes.\n\tdefaultMaxMemoryBytes = 1 << 29 // 512 MiB\n\t// wasmPageSize is the page size in bytes.\n\twasmPageSize = 1 << 16 // 64 KiB\n)\n\ntype runtime struct {\n\truntime          wazero.Runtime\n\tcompilationCache wazero.CompilationCache\n}\n\nfunc newRuntime(ctx context.Context, options ...RuntimeOption) (*runtime, error) {\n\truntimeOptions := newRuntimeOptions()\n\tfor _, option := range options {\n\t\toption(runtimeOptions)\n\t}\n\tif runtimeOptions.maxMemoryBytes == 0 {\n\t\treturn nil, fmt.Errorf(\"Wasm max memory bytes must be greater than 0\")\n\t}\n\t// The maximum memory size is limited to 4 GiB. Sizes less than the page\n\t// size (64 KiB) are truncated. memoryLimitPages is guaranteed to be\n\t// below 2^16 as the maximum uint32 value is 2^32 - 1.\n\t// NOTE: The option represented as a uint32 restricts the max number of\n\t// pages to 2^16-1, one less the the actual max value of 2^16. But this\n\t// is a nicer API then specifying the max number of pages directly.\n\tmemoryLimitPages := runtimeOptions.maxMemoryBytes / wasmPageSize\n\tif memoryLimitPages == 0 {\n\t\treturn nil, fmt.Errorf(\"Wasm max memory bytes %d is too small\", runtimeOptions.maxMemoryBytes)\n\t}\n\n\t// Create the wazero.RuntimeConfig with enforceable limits. Limits are\n\t// enforced through the Wasm sandbox. The following limits are set:\n\t//  - Memory limit: The maximum memory size in pages.\n\t//  - CPU limit: The runtime stops work on context done.\n\t//  - Access limit: All system interfaces are stubbed. No network,\n\t//    disk, clock, etc.\n\t// See wazero.NewRuntimeConfig for more details.\n\twazeroRuntimeConfig := wazero.NewRuntimeConfig().\n\t\tWithCoreFeatures(api.CoreFeaturesV2).\n\t\tWithCloseOnContextDone(true).\n\t\tWithMemoryLimitPages(memoryLimitPages)\n\tvar wazeroCompilationCache wazero.CompilationCache\n\tif runtimeOptions.cacheDir != \"\" {\n\t\tvar err error\n\t\twazeroCompilationCache, err = wazero.NewCompilationCacheWithDir(runtimeOptions.cacheDir)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to create compilation cache: %w\", err)\n\t\t}\n\t\twazeroRuntimeConfig = wazeroRuntimeConfig.WithCompilationCache(wazeroCompilationCache)\n\t}\n\twazeroRuntime := wazero.NewRuntimeWithConfig(ctx, wazeroRuntimeConfig)\n\n\t// Init WASI preview1 APIs. This is required to support the pluginrpc\n\t// protocol. The returned closer method is discarded as the\n\t// instantiated module is never required to be unloaded.\n\tif _, err := wasi_snapshot_preview1.Instantiate(ctx, wazeroRuntime); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to instantiate WASI snapshot preview1: %w\", err)\n\t}\n\treturn &runtime{\n\t\truntime:          wazeroRuntime,\n\t\tcompilationCache: wazeroCompilationCache,\n\t}, nil\n}\n\nfunc (r *runtime) Compile(ctx context.Context, moduleName string, moduleWasm []byte) (CompiledModule, error) {\n\tif moduleName == \"\" {\n\t\t// The plugin is required to be named. We cannot use the name\n\t\t// from the Wasm binary as this is not guaranteed to be set and\n\t\t// may conflict with the provided name.\n\t\treturn nil, fmt.Errorf(\"name is empty\")\n\t}\n\t// Compile the WebAssembly. This operation is hashed on the module\n\t// bytes and the runtime configuration. The compiled module is\n\t// cached in memory and on disk if an optional cache directory is\n\t// provided.\n\twazeroCompiledModule, err := r.runtime.CompileModule(ctx, moduleWasm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &compiledModule{\n\t\tmoduleName:     moduleName,\n\t\truntime:        r.runtime,\n\t\tcompiledModule: wazeroCompiledModule,\n\t}, nil\n}\n\nfunc (r *runtime) Close(ctx context.Context) error {\n\terr := r.runtime.Close(ctx)\n\tif r.compilationCache != nil {\n\t\terr = errors.Join(err, r.compilationCache.Close(ctx))\n\t}\n\treturn err\n}\n\ntype runtimeOptions struct {\n\tmaxMemoryBytes uint32\n\tcacheDir       string\n}\n\nfunc newRuntimeOptions() *runtimeOptions {\n\treturn &runtimeOptions{\n\t\tmaxMemoryBytes: defaultMaxMemoryBytes,\n\t}\n}\n"
  },
  {
    "path": "private/pkg/wasm/unimplemented_runtime.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 wasm\n\nimport (\n\t\"context\"\n\n\t\"github.com/bufbuild/buf/private/pkg/syserror\"\n)\n\ntype unimplementedRuntime struct{}\n\nfunc (unimplementedRuntime) Compile(ctx context.Context, name string, moduleBytes []byte) (CompiledModule, error) {\n\treturn nil, syserror.Newf(\"not implemented\")\n}\n\nfunc (unimplementedRuntime) Close(ctx context.Context) error {\n\treturn nil\n}\n"
  },
  {
    "path": "private/pkg/wasm/usage.gen.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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// Generated. DO NOT EDIT.\n\npackage wasm\n\nimport _ \"buf.build/go/bufprivateusage\"\n"
  },
  {
    "path": "private/pkg/wasm/wasm.go",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS 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 wasm provides a Wasm runtime for plugins.\npackage wasm\n\nimport (\n\t\"context\"\n\n\t\"pluginrpc.com/pluginrpc\"\n)\n\n// UnimplementedRuntime is an unimplemented Runtime.\nvar UnimplementedRuntime = unimplementedRuntime{}\n\n// CompiledModule is a Wasm module ready to be run.\n//\n// It is safe to use this module concurrently. When done, call Close to free\n// resources held by the CompiledModule. All CompiledModules created by the\n// same Runtime will be invalidated when the Runtime is closed.\n//\n// Memory is limited by the Runtime. To restrict CPU usage, cancel the context.\ntype CompiledModule interface {\n\tpluginrpc.Runner\n\t// Close releases all resources held by the compiled module.\n\tClose(ctx context.Context) error\n}\n\n// Runtime is a Wasm runtime.\n//\n// It is safe to use the Runtime concurrently. Close must be called when done\n// with the Runtime to free resources. All CompiledModules created by the same\n// Runtime will be invalidated when the Runtime is closed.\ntype Runtime interface {\n\t// Compile compiles the given Wasm module bytes into a CompiledModule.\n\tCompile(ctx context.Context, moduleName string, moduleWasm []byte) (CompiledModule, error)\n\t// Close releases all resources held by the Runtime.\n\tClose(ctx context.Context) error\n}\n\n// NewRuntime creates a new Wasm Runtime.\nfunc NewRuntime(ctx context.Context, options ...RuntimeOption) (Runtime, error) {\n\treturn newRuntime(ctx, options...)\n}\n\n// RuntimeOption is an option for Runtime.\ntype RuntimeOption func(*runtimeOptions)\n\n// WithMaxMemoryBytes sets the maximum memory size in bytes.\n//\n// The maximuim memory size is limited to 4 GiB. The default is 512 MiB. Sizes\n// less then the page size (64 KiB) are truncated.\nfunc WithMaxMemoryBytes(maxMemoryBytes uint32) RuntimeOption {\n\treturn func(runtimeOptions *runtimeOptions) {\n\t\truntimeOptions.maxMemoryBytes = maxMemoryBytes\n\t}\n}\n\n// WithLocalCacheDir sets the local cache directory.\n//\n// The cache directory is used to store compiled Wasm modules. This can be used\n// to speed up subsequent runs of the same module. The internal cache structure\n// and versioning is handled by the Runtime.\n//\n// This option is only safe use in CLI environments.\nfunc WithLocalCacheDir(cacheDir string) RuntimeOption {\n\treturn func(runtimeOptions *runtimeOptions) {\n\t\truntimeOptions.cacheDir = cacheDir\n\t}\n}\n"
  },
  {
    "path": "proto/buf/alpha/audit/v1alpha1/event.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.audit.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/admin.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository.proto\";\nimport \"buf/alpha/registry/v1alpha1/role.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// ActorType is the type of actor that caused the audited event.\nenum ActorType {\n  ACTOR_TYPE_UNSPECIFIED = 0;\n  ACTOR_TYPE_USER = 1;\n  ACTOR_TYPE_SYSTEM = 2;\n}\n\n// Actor is the actor who caused the audited event.\nmessage Actor {\n  // Type of actor who caused the audited event.\n  ActorType type = 1;\n  // Id of the actor who caused the audited event.\n  string id = 2;\n  // Name of the actor who caused the audited event.\n  string name = 3;\n}\n\n// ResourceType is the type of the resource that was affected by the audited event.\n//\n// [#next-free-field: 23]\nenum ResourceType {\n  RESOURCE_TYPE_UNSPECIFIED = 0;\n  RESOURCE_TYPE_USER = 1;\n  RESOURCE_TYPE_ORGANIZATION = 2;\n  RESOURCE_TYPE_ORGANIZATION_MEMBER = 3;\n  RESOURCE_TYPE_ORGANIZATION_IDP_GROUP = 9;\n  RESOURCE_TYPE_REPOSITORY = 4;\n  RESOURCE_TYPE_REPOSITORY_CONTRIBUTOR = 5;\n  RESOURCE_TYPE_REPOSITORY_COMMIT = 6;\n  RESOURCE_TYPE_REPOSITORY_IDP_GROUP = 18;\n  RESOURCE_TYPE_POLICY = 17;\n  RESOURCE_TYPE_POLICY_COMMIT = 19;\n  RESOURCE_TYPE_POLICY_LABEL = 20;\n  RESOURCE_TYPE_POLICY_ENFORCEMENT = 22;\n  RESOURCE_TYPE_PLUGIN = 7;\n  RESOURCE_TYPE_PLUGIN_COMMIT = 15;\n  RESOURCE_TYPE_CURATED_PLUGIN = 8;\n  RESOURCE_TYPE_TOKEN = 10;\n  RESOURCE_TYPE_SCIM_TOKEN = 11;\n  RESOURCE_TYPE_REPOSITORY_LABEL = 12;\n  RESOURCE_TYPE_SERVER = 13;\n  RESOURCE_TYPE_DEVICE_AUTHORIZATION_GRANT = 14;\n  RESOURCE_TYPE_PLUGIN_LABEL = 16;\n  RESOURCE_TYPE_SDK_PLUGIN_CONSTRAINT = 21;\n}\n\n// Resource is the affected resource by the audited event.\nmessage Resource {\n  // Type of resource that was affected by the audited event.\n  ResourceType type = 1;\n  // Id of the affected resource by the audited event.\n  string id = 2;\n  // Name of the affected resource by the audited event.\n  string name = 3;\n}\n\n// EventType is the type of audited event.\n//\n// [#next-free-field: 84]\nenum EventType {\n  EVENT_TYPE_UNSPECIFIED = 0;\n  EVENT_TYPE_ORGANIZATION_CREATED = 1;\n  EVENT_TYPE_ORGANIZATION_DELETED = 2;\n  EVENT_TYPE_ORGANIZATION_MEMBER_ADDED = 3;\n  EVENT_TYPE_ORGANIZATION_MEMBER_ROLE_CHANGED = 4 [deprecated = true];\n  EVENT_TYPE_ORGANIZATION_MEMBER_ROLES_CHANGED = 50;\n  EVENT_TYPE_ORGANIZATION_MEMBER_REMOVED = 5;\n  EVENT_TYPE_ORGANIZATION_IDP_GROUP_ADDED = 21;\n  EVENT_TYPE_ORGANIZATION_IDP_GROUP_UPDATED = 59;\n  EVENT_TYPE_ORGANIZATION_IDP_GROUP_REMOVED = 22;\n  EVENT_TYPE_ORGANIZATION_RESOURCE_VISIBILITY_CONTROL_CHANGED = 81;\n  EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_ENABLED = 82;\n  EVENT_TYPE_ORGANIZATION_UNIQUENESS_POLICY_DISABLED = 83;\n  EVENT_TYPE_REPOSITORY_CREATED = 6;\n  EVENT_TYPE_REPOSITORY_DEPRECATED = 48;\n  EVENT_TYPE_REPOSITORY_UNDEPRECATED = 49;\n  EVENT_TYPE_REPOSITORY_DELETED = 7;\n  EVENT_TYPE_REPOSITORY_COMMIT_PUSHED = 8;\n  EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ADDED = 9;\n  EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLE_CHANGED = 10;\n  EVENT_TYPE_REPOSITORY_CONTRIBUTOR_ROLES_CHANGED = 63;\n  EVENT_TYPE_REPOSITORY_CONTRIBUTOR_REMOVED = 11;\n  EVENT_TYPE_REPOSITORY_VISIBILITY_CHANGED = 12;\n  EVENT_TYPE_REPOSITORY_DEFAULT_LABEL_NAME_CHANGED = 40;\n  EVENT_TYPE_REPOSITORY_IDP_GROUP_ADDED = 60;\n  EVENT_TYPE_REPOSITORY_IDP_GROUP_UPDATED = 61;\n  EVENT_TYPE_REPOSITORY_IDP_GROUP_REMOVED = 62;\n  EVENT_TYPE_POLICY_CREATED = 54;\n  EVENT_TYPE_POLICY_DELETED = 55;\n  EVENT_TYPE_POLICY_DEPRECATED = 56;\n  EVENT_TYPE_POLICY_UNDEPRECATED = 57;\n  EVENT_TYPE_POLICY_VISIBILITY_CHANGED = 58;\n  EVENT_TYPE_POLICY_COMMIT_PUSHED = 64;\n  EVENT_TYPE_POLICY_LABEL_CREATED = 65;\n  EVENT_TYPE_POLICY_LABEL_MOVED = 66;\n  EVENT_TYPE_POLICY_LABEL_ARCHIVED = 67;\n  EVENT_TYPE_POLICY_LABEL_UNARCHIVED = 68;\n  EVENT_TYPE_PLUGIN_CREATED = 13;\n  EVENT_TYPE_PLUGIN_DELETED = 14;\n  EVENT_TYPE_PLUGIN_DEPRECATED = 51;\n  EVENT_TYPE_PLUGIN_UNDEPRECATED = 52;\n  EVENT_TYPE_PLUGIN_VISIBILITY_CHANGED = 53;\n  EVENT_TYPE_PLUGIN_COMMIT_PUSHED = 43;\n  EVENT_TYPE_CURATED_PLUGIN_CREATED = 20;\n  EVENT_TYPE_CURATED_PLUGIN_DELETED = 31;\n  EVENT_TYPE_CURATED_PLUGIN_STATUS_UPDATED = 78;\n  EVENT_TYPE_USER_CREATED = 15;\n  EVENT_TYPE_USER_DELETED = 16;\n  EVENT_TYPE_USER_DEACTIVATED = 17;\n  EVENT_TYPE_USER_LOGGED_IN = 18;\n  EVENT_TYPE_USER_LOGGED_OUT = 19;\n  EVENT_TYPE_TOKEN_CREATED = 23;\n  EVENT_TYPE_TOKEN_DELETED = 24;\n  EVENT_TYPE_USER_REACTIVATED = 25;\n  EVENT_TYPE_SCIM_TOKEN_CREATED = 26;\n  EVENT_TYPE_SCIM_TOKEN_DELETED = 27;\n  EVENT_TYPE_REPOSITORY_COMMIT_DELETED = 28 [deprecated = true];\n  EVENT_TYPE_REPOSITORY_LABEL_CREATED = 29;\n  EVENT_TYPE_REPOSITORY_LABEL_MOVED = 30;\n  EVENT_TYPE_REPOSITORY_LABEL_ARCHIVED = 38;\n  EVENT_TYPE_REPOSITORY_LABEL_UNARCHIVED = 39;\n  EVENT_TYPE_REPOSITORY_LABEL_ENFORCEMENT_IGNORES_CHANGED = 79;\n  EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_ENABLED = 32;\n  EVENT_TYPE_SERVER_BREAKING_CHANGE_POLICY_DISABLED = 33;\n  EVENT_TYPE_REPOSITORY_DEFAULT_BRANCH_CHANGED = 34 [deprecated = true];\n  EVENT_TYPE_SERVER_UNIQUENESS_POLICY_ENABLED = 35;\n  EVENT_TYPE_SERVER_UNIQUENESS_POLICY_DISABLED = 36;\n  EVENT_TYPE_SERVER_RESOURCE_VISIBILITY_CONTROL_CHANGED = 80;\n  EVENT_TYPE_USER_AUTO_MERGED_FROM_NEW_IDP = 37;\n  EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_APPROVED = 41;\n  EVENT_TYPE_DEVICE_AUTHORIZATION_GRANT_DENIED = 42;\n  EVENT_TYPE_PLUGIN_LABEL_CREATED = 44;\n  EVENT_TYPE_PLUGIN_LABEL_MOVED = 45;\n  EVENT_TYPE_PLUGIN_LABEL_ARCHIVED = 46;\n  EVENT_TYPE_PLUGIN_LABEL_UNARCHIVED = 47;\n  EVENT_TYPE_SERVER_REVIEW_FLOW_ENABLED = 69;\n  EVENT_TYPE_SERVER_REVIEW_FLOW_DISABLED = 70;\n  EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_CREATED = 71;\n  EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_UPDATED = 72;\n  EVENT_TYPE_SDK_PLUGIN_CONSTRAINT_DELETED = 73;\n  EVENT_TYPE_POLICY_ENFORCEMENT_CREATED = 74;\n  EVENT_TYPE_POLICY_ENFORCEMENT_DELETED = 75;\n  EVENT_TYPE_POLICY_ENFORCEMENT_POLICY_CHANGED = 76;\n  EVENT_TYPE_POLICY_ENFORCEMENT_TARGETS_CHANGED = 77;\n}\n\n// EventMetadata provides additional details about the audited event.\nmessage EventMetadata {\n  // UserAgent is the User-Agent header associated with the request that triggered the audited event, if any.\n  string user_agent = 1;\n  // IP is the IP address associated with the request that triggered the audited event, if any.\n  string ip = 2;\n  // TraceID is the ID of the trace associated with the audited event, if any.\n  string trace_id = 3;\n}\n\n// Event is an audited action that happened in the BSR, with the information of what happened, when\n// it happened, who did it, which resource was affected, and more contextual information on the\n// event.\n//\n// [#next-free-field: 90]\nmessage Event {\n  // Unique id of the audited event.\n  string event_id = 1;\n  // Type of the audited event. It specifies \"what\" happened.\n  EventType type = 2;\n  // Actor of the audited event. It specifies \"who\" did it.\n  Actor actor = 3;\n  // Resource of the audited event. It specifies \"which resource\" was affected.\n  Resource resource = 4;\n  // Time of the audited event. It specifies \"when\" it happened.\n  google.protobuf.Timestamp event_time = 5;\n  // Metadata about the audited event. It specifies any additional details about the audited event.\n  EventMetadata metadata = 6;\n  // Payload of the audited event. It specifies additional context on the event.\n  oneof payload {\n    PayloadOrganizationCreated organization_created = 7;\n    PayloadOrganizationDeleted organization_deleted = 8;\n    PayloadOrganizationMemberAdded organization_member_added = 9;\n    PayloadOrganizationMemberRoleChanged organization_member_role_changed = 10;\n    PayloadOrganizationMemberRolesChanged organization_member_roles_changed = 56;\n    PayloadOrganizationMemberRemoved organization_member_removed = 11;\n    PayloadOrganizationResourceVisibilityControlChanged organization_resource_visibility_control_changed = 87;\n    PayloadOrganizationUniquenessPolicyEnabled organization_uniqueness_policy_enabled = 88;\n    PayloadOrganizationUniquenessPolicyDisabled organization_uniqueness_policy_disabled = 89;\n    PayloadRepositoryCreated repository_created = 12;\n    PayloadRepositoryDeprecated repository_deprecated = 54;\n    PayloadRepositoryUndeprecated repository_undeprecated = 55;\n    PayloadRepositoryDeleted repository_deleted = 13;\n    PayloadRepositoryCommitPushed repository_commit_pushed = 14;\n    PayloadRepositoryContributorAdded repository_contributor_added = 15;\n    PayloadRepositoryContributorRoleChanged repository_contributor_role_changed = 16;\n    PayloadRepositoryContributorRolesChanged repository_contributor_roles_changed = 69;\n    PayloadRepositoryContributorRemoved repository_contributor_removed = 17;\n    PayloadRepositoryVisibilityChanged repository_visibility_changed = 18;\n    PayloadRepositoryDefaultLabelNameChanged repository_default_label_name_changed = 46;\n    PayloadRepositoryIDPGroupAdded repository_idp_group_added = 66;\n    PayloadRepositoryIDPGroupUpdated repository_idp_group_updated = 67;\n    PayloadRepositoryIDPGroupRemoved repository_idp_group_removed = 68;\n    PayloadPolicyCreated policy_created = 60;\n    PayloadPolicyDeleted policy_deleted = 61;\n    PayloadPolicyDeprecated policy_deprecated = 62;\n    PayloadPolicyUndeprecated policy_undeprecated = 63;\n    PayloadPolicyVisibilityChanged policy_visibility_changed = 64;\n    PayloadPolicyCommitPushed policy_commit_pushed = 70;\n    PayloadPolicyLabelCreated policy_label_created = 71;\n    PayloadPolicyLabelMoved policy_label_moved = 72;\n    PayloadPolicyLabelArchived policy_label_archived = 73;\n    PayloadPolicyLabelUnarchived policy_label_unarchived = 74;\n    PayloadPluginCreated plugin_created = 19;\n    PayloadPluginDeleted plugin_deleted = 20;\n    PayloadPluginDeprecated plugin_deprecated = 57;\n    PayloadPluginUndeprecated plugin_undeprecated = 58;\n    PayloadPluginVisibilityChanged plugin_visibility_changed = 59;\n    PayloadPluginCommitPushed plugin_commit_pushed = 49;\n    PayloadUserCreated user_created = 21;\n    PayloadUserDeactivated user_deactivated = 22;\n    PayloadUserDeleted user_deleted = 23;\n    PayloadUserLoggedIn user_logged_in = 24;\n    PayloadUserLoggedOut user_logged_out = 25;\n    PayloadCuratedPluginCreated curated_plugin_created = 26;\n    PayloadOrganizationIDPGroupAdded idp_group_added = 27;\n    PayloadOrganizationIDPGroupUpdated idp_group_updated = 65;\n    PayloadOrganizationIDPGroupRemoved idp_group_removed = 28;\n    PayloadTokenCreated token_created = 29;\n    PayloadTokenDeleted token_deleted = 30;\n    PayloadUserReactivated user_reactivated = 31;\n    PayloadSCIMTokenCreated scim_token_created = 32;\n    PayloadSCIMTokenDeleted scim_token_deleted = 33;\n    PayloadRepositoryCommitDeleted repository_commit_deleted = 34 [deprecated = true];\n    PayloadRepositoryLabelCreated repository_label_created = 35;\n    PayloadRepositoryLabelMoved repository_label_moved = 36;\n    PayloadRepositoryLabelArchived repository_label_archived = 44;\n    PayloadRepositoryLabelUnarchived repository_label_unarchived = 45;\n    PayloadRepositoryLabelEnforcementIgnoresChanged repository_label_enforcement_ignores_changed = 85;\n    PayloadCuratedPluginDeleted curated_plugin_deleted = 37;\n    PayloadCuratedPluginStatusUpdated curated_plugin_status_updated = 84;\n    PayloadServerBreakingChangePolicyEnabled payload_server_breaking_change_policy_enabled = 38;\n    PayloadServerBreakingChangePolicyDisabled payload_server_breaking_change_policy_disabled = 39;\n    PayloadRepositoryDefaultBranchChanged repository_default_branch_changed = 40 [deprecated = true];\n    PayloadServerUniquenessPolicyEnabled payload_server_uniqueness_policy_enabled = 41;\n    PayloadServerUniquenessPolicyDisabled payload_server_uniqueness_policy_disabled = 42;\n    PayloadServerResourceVisibilityControlChanged server_resource_visibility_control_changed = 86;\n    PayloadUserAutoMergedFromNewIdP user_auto_merged_from_new_idp = 43;\n    PayloadDeviceAuthorizationGrantApproved device_authorization_grant_approved = 47;\n    PayloadDeviceAuthorizationGrantDenied device_authorization_grant_denied = 48;\n    PayloadPluginLabelCreated plugin_label_created = 50;\n    PayloadPluginLabelMoved plugin_label_moved = 51;\n    PayloadPluginLabelArchived plugin_label_archived = 52;\n    PayloadPluginLabelUnarchived plugin_label_unarchived = 53;\n    PayloadServerReviewFlowEnabled server_review_flow_enabled = 75;\n    PayloadServerReviewFlowDisabled server_review_flow_disabled = 76;\n    PayloadSDKPluginConstraintCreated sdk_plugin_constraint_created = 77;\n    PayloadSDKPluginConstraintUpdated sdk_plugin_constraint_updated = 78;\n    PayloadSDKPluginConstraintDeleted sdk_plugin_constraint_deleted = 79;\n    PayloadPolicyEnforcementCreated policy_enforcement_created = 80;\n    PayloadPolicyEnforcementDeleted policy_enforcement_deleted = 81;\n    PayloadPolicyEnforcementPolicyChanged policy_enforcement_policy_changed = 82;\n    PayloadPolicyEnforcementTargetsChanged policy_enforcement_targets_changed = 83;\n  }\n}\n\nmessage PayloadOrganizationCreated {}\n\nmessage PayloadOrganizationDeleted {}\n\nmessage PayloadOrganizationMemberAdded {\n  // organization_id is the id of the organization with the new member.\n  string organization_id = 1;\n  // organization_name is the name of the organization with the new member.\n  string organization_name = 2;\n  // member_role is the role granted to the member added to the organization.\n  buf.alpha.registry.v1alpha1.OrganizationRole member_role = 3;\n  // member_role_source is the source of the role granted to the member.\n  buf.alpha.registry.v1alpha1.OrganizationRoleSource member_role_source = 4;\n}\n\nmessage PayloadOrganizationMemberRoleChanged {\n  // Deprecated, use PayloadOrganizationMemberRolesChanged instead.\n  option deprecated = true;\n\n  // organization_id is the id of the organization within which the role was changed.\n  string organization_id = 1;\n  // organization_name is the name of the organization within which the role was changed.\n  string organization_name = 2;\n  // old_role is the old role of the member whose role was changed.\n  buf.alpha.registry.v1alpha1.OrganizationRole old_role = 3;\n  // new_role is the new role of the member whose role was changed.\n  buf.alpha.registry.v1alpha1.OrganizationRole new_role = 4;\n  // old_member_role_source is the old source of the role granted to the member.\n  buf.alpha.registry.v1alpha1.OrganizationRoleSource old_member_role_source = 5;\n  // new_member_role_source is the new source of the role granted to the member.\n  buf.alpha.registry.v1alpha1.OrganizationRoleSource new_member_role_source = 6;\n}\n\nmessage PayloadOrganizationMemberRolesChanged {\n  message OrganizationRole {\n    // role is the role of the member.\n    buf.alpha.registry.v1alpha1.OrganizationRole role = 1;\n    // source is the source of the role granted to the member.\n    buf.alpha.registry.v1alpha1.OrganizationRoleSource source = 2;\n  }\n  // organization_id is the id of the organization within which the roles was changed.\n  string organization_id = 1;\n  // organization_name is the name of the organization within which the roles was changed.\n  string organization_name = 2;\n  // old_roles are the old roles of the member.\n  repeated OrganizationRole old_roles = 3;\n  // new_roles are the new roles of the member.\n  repeated OrganizationRole new_roles = 4;\n}\n\nmessage PayloadOrganizationMemberRemoved {\n  // organization_id is the id of the organization that the member was removed from.\n  string organization_id = 1;\n  // organization_name is the name of the organization that the member was removed from.\n  string organization_name = 2;\n  // member_role is the role that the member had when removed from the organization.\n  buf.alpha.registry.v1alpha1.OrganizationRole member_role = 3;\n  // member_role_source is the source of the role granted to the member.\n  buf.alpha.registry.v1alpha1.OrganizationRoleSource member_role_source = 4;\n}\n\nmessage PayloadOrganizationIDPGroupAdded {\n  // organization_id is the id of the organization with the new IDP group.\n  string organization_id = 1;\n  // organization_name is the name of the organization with the new IDP group.\n  string organization_name = 2;\n  // role_override is the role override associated with the new IDP group.\n  buf.alpha.registry.v1alpha1.OrganizationRole role_override = 3;\n}\n\nmessage PayloadOrganizationIDPGroupUpdated {\n  // organization_id is the id of the organization with the updated IDP group.\n  string organization_id = 1;\n  // organization_name is the name of the organization with the updated IDP group.\n  string organization_name = 2;\n  // old_role_override is the role override associated with the IDP updated group. Only set if the\n  // role override was changed.\n  buf.alpha.registry.v1alpha1.OrganizationRole old_role_override = 3;\n  // new_role_override is the role override associated with the IDP updated group. Only set if the\n  // role override was changed.\n  buf.alpha.registry.v1alpha1.OrganizationRole new_role_override = 4;\n}\n\nmessage PayloadOrganizationIDPGroupRemoved {\n  // organization_id is the id of the organization with the removed IDP group.\n  string organization_id = 1;\n  // organization_name is the name of the organization with the removed IDP group.\n  string organization_name = 2;\n  // role_override is the role override associated with the removed IDP group.\n  buf.alpha.registry.v1alpha1.OrganizationRole role_override = 3;\n}\n\nmessage PayloadRepositoryCreated {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // visibility is the visibility of the repository.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n  // default_label_name is the name of the default label for the repository.\n  // If empty, the repository was created with the default label name of 'main'.\n  string default_label_name = 4;\n}\n\nmessage PayloadRepositoryDeleted {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // visibility is the visibility of the repository.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n}\n\nmessage PayloadRepositoryDeprecated {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // visibility is the visibility of the repository.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n  // deprecation_message is the deprecation message set by the deprecation actor.\n  string deprecation_message = 4;\n}\n\nmessage PayloadRepositoryUndeprecated {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // visibility is the visibility of the repository.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n}\n\nmessage PayloadRepositoryCommitPushed {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // repository_id is the id of the repository within which the commit was created.\n  string repository_id = 3;\n  // repository_name is the name of the repository within which the commit was created.\n  string repository_name = 4;\n  // tags are the tags included in the push. Optional.\n  repeated string tags = 5;\n  // draft_name is the name of the draft. Optional.\n  string draft_name = 6;\n  // manifest_digest is the module's manifest digest.\n  string manifest_digest = 7;\n  // b5_digest is the module's b5 digest.\n  string b5_digest = 8;\n}\n\nmessage PayloadRepositoryContributorAdded {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // repository_id is the id of the repository with the new contributor.\n  string repository_id = 3;\n  // repository_name is the name of the repository with the new contributor.\n  string repository_name = 4;\n  // contributor_role is the role granted to the contributor added to the repository.\n  buf.alpha.registry.v1alpha1.RepositoryRole contributor_role = 5;\n}\n\nmessage PayloadRepositoryContributorRoleChanged {\n  // Deprecated, use PayloadRepositoryContributorRolesChanged instead.\n  option deprecated = true;\n\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // repository_id is the id of the repository within which the role was changed.\n  string repository_id = 3;\n  // repository_name is the name of the repository within which the role was changed.\n  string repository_name = 4;\n  // old_role is the old role of the contributor whose role was changed.\n  buf.alpha.registry.v1alpha1.RepositoryRole old_role = 5;\n  // new_role is the new role of the contributor whose role was changed.\n  buf.alpha.registry.v1alpha1.RepositoryRole new_role = 6;\n}\n\nmessage PayloadRepositoryContributorRolesChanged {\n  message RepositoryRole {\n    // role is the role of the member.\n    buf.alpha.registry.v1alpha1.RepositoryRole role = 1;\n    // source is the source of the role granted to the member.\n    buf.alpha.registry.v1alpha1.RepositoryRoleSource source = 2;\n  }\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // repository_id is the id of the repository within which the role was changed.\n  string repository_id = 3;\n  // repository_name is the name of the repository within which the role was changed.\n  string repository_name = 4;\n  // old_roles are the old roles of the contributor.\n  repeated RepositoryRole old_roles = 5;\n  // new_roles are the new roles of the contributor.\n  repeated RepositoryRole new_roles = 6;\n}\n\nmessage PayloadRepositoryContributorRemoved {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // repository_id is the id of the repository that the contributor was removed from.\n  string repository_id = 3;\n  // repository_name is the name of the repository that the contributor was removed from.\n  string repository_name = 4;\n  // contributor_role is the role that the contributor had when removed from the repository.\n  buf.alpha.registry.v1alpha1.RepositoryRole contributor_role = 5;\n}\n\nmessage PayloadRepositoryVisibilityChanged {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // old_visibility is the old visibility of the repository.\n  buf.alpha.registry.v1alpha1.Visibility old_visibility = 3;\n  // new_visibility is the new visibility of the repository.\n  buf.alpha.registry.v1alpha1.Visibility new_visibility = 4;\n}\n\nmessage PayloadRepositoryDefaultLabelNameChanged {\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // old_default_label_name is the old default label name of the repository.\n  string old_default_label_name = 3;\n  // new_default_label_name is the new default label name of the repository.\n  string new_default_label_name = 4;\n}\n\n// PayloadRepositoryDefaultBranchChanged is deprecated.\n//\n// Use PayloadRepositoryDefaultLabelNameChanged instead.\nmessage PayloadRepositoryDefaultBranchChanged {\n  // Deprecated, use PayloadRepositoryDefaultLabelNameChanged instead.\n  option deprecated = true;\n  // owner_id is the id of the owner of the repository.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository.\n  string owner_name = 2;\n  // old_default_branch is the old default branch of the repository.\n  string old_default_branch = 3;\n  // new_default_branch is the new default branch of the repository.\n  string new_default_branch = 4;\n}\n\nmessage PayloadRepositoryIDPGroupAdded {\n  // repository_id is the id of the repository with the new IDP group.\n  string repository_id = 1;\n  // repository_name is the name of the repository with the new IDP group.\n  string repository_name = 2;\n  // role_override is the role override associated with the new IDP group.\n  buf.alpha.registry.v1alpha1.RepositoryRole role_override = 3;\n}\n\nmessage PayloadRepositoryIDPGroupUpdated {\n  // repository_id is the id of the repository with the updated IDP group.\n  string repository_id = 1;\n  // repository_name is the name of the repository with the updated IDP group.\n  string repository_name = 2;\n  // old_role_override is the role override associated with the IDP updated group. Only set if the\n  // role override was changed.\n  buf.alpha.registry.v1alpha1.RepositoryRole old_role_override = 3;\n  // new_role_override is the role override associated with the IDP updated group. Only set if the\n  // role override was changed.\n  buf.alpha.registry.v1alpha1.RepositoryRole new_role_override = 4;\n}\n\nmessage PayloadRepositoryIDPGroupRemoved {\n  // repository_id is the id of the repository with the removed IDP group.\n  string repository_id = 1;\n  // repository_name is the name of the repository with the removed IDP group.\n  string repository_name = 2;\n  // role_override is the role override associated with the removed IDP group.\n  buf.alpha.registry.v1alpha1.RepositoryRole role_override = 3;\n}\n\nmessage PayloadPolicyCreated {\n  // owner_id is the id of the owner of the policy.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy.\n  string owner_name = 2;\n  // visibility is the visibility of the policy.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n}\n\nmessage PayloadPolicyDeleted {\n  // owner_id is the id of the owner of the policy.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy.\n  string owner_name = 2;\n  // visibility is the visibility of the policy.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n}\n\nmessage PayloadPolicyDeprecated {\n  // owner_id is the id of the owner of the policy.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy.\n  string owner_name = 2;\n  // visibility is the visibility of the policy.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n}\n\nmessage PayloadPolicyUndeprecated {\n  // owner_id is the id of the owner of the policy.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy.\n  string owner_name = 2;\n  // visibility is the visibility of the policy.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 3;\n}\n\nmessage PayloadPolicyVisibilityChanged {\n  // owner_id is the id of the owner of the policy.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy.\n  string owner_name = 2;\n  // old_visibility is the old visibility of the policy.\n  buf.alpha.registry.v1alpha1.Visibility old_visibility = 4;\n  // new_visibility is the new visibility of the policy.\n  buf.alpha.registry.v1alpha1.Visibility new_visibility = 5;\n}\n\nmessage PayloadPolicyCommitPushed {\n  // owner_id is the id of the owner of the policy.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy.\n  string owner_name = 2;\n  // policy_id is the id of the policy within which the commit was created.\n  string policy_id = 3;\n  // policy_name is the name of the policy within which the commit was created.\n  string policy_name = 4;\n  // o1_digest is the o1 digest of the pushed policy commit.\n  string o1_digest = 5;\n}\n\nmessage PayloadPluginCreated {\n  // owner_id is the id of the owner of the plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin.\n  string owner_name = 2;\n  // plugin_type is the type of the plugin.\n  string plugin_type = 3;\n  // visibility is the visibility of the plugin.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 4;\n}\n\nmessage PayloadPluginDeleted {\n  // owner_id is the id of the owner of the check plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the check plugin.\n  string owner_name = 2;\n  // plugin_type is the type of the plugin.\n  string plugin_type = 3;\n  // visibility is the visibility of the plugin.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 4;\n}\n\nmessage PayloadPluginDeprecated {\n  // owner_id is the id of the owner of the check plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the check plugin.\n  string owner_name = 2;\n  // plugin_type is the type of the plugin.\n  string plugin_type = 3;\n  // visibility is the visibility of the plugin.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 4;\n}\n\nmessage PayloadPluginUndeprecated {\n  // owner_id is the id of the owner of the check plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the check plugin.\n  string owner_name = 2;\n  // plugin_type is the type of the plugin.\n  string plugin_type = 3;\n  // visibility is the visibility of the plugin.\n  buf.alpha.registry.v1alpha1.Visibility visibility = 4;\n}\n\nmessage PayloadPluginVisibilityChanged {\n  // owner_id is the id of the owner of the check plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the check plugin.\n  string owner_name = 2;\n  // plugin_type is the type of the plugin.\n  string plugin_type = 3;\n  // old_visibility is the old visibility of the plugin.\n  buf.alpha.registry.v1alpha1.Visibility old_visibility = 4;\n  // new_visibility is the new visibility of the plugin.\n  buf.alpha.registry.v1alpha1.Visibility new_visibility = 5;\n}\n\nmessage PayloadPluginCommitPushed {\n  // owner_id is the id of the owner of the plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin.\n  string owner_name = 2;\n  // plugin_id is the id of the plugin.\n  string plugin_id = 3;\n  // plugin_name is the name of the plugin.\n  string plugin_name = 4;\n  // p1_digest is the p1 digest of the pushed plugin commit.\n  string p1_digest = 5;\n}\n\nmessage PayloadUserCreated {}\n\nmessage PayloadUserReactivated {}\n\nmessage PayloadUserDeactivated {}\n\nmessage PayloadUserDeleted {}\n\nmessage PayloadUserLoggedIn {}\n\nmessage PayloadUserLoggedOut {}\n\n// PayloadUserAutoMergedFromNewIdP is the payload for the audit event\n// EVENT_TYPE_USER_AUTO_MERGED_FROM_NEW_IDP. It has no additional information\n// to be included, since the new user is automatically merged to an existing user\n// without the new user being created.\nmessage PayloadUserAutoMergedFromNewIdP {}\n\nmessage PayloadCuratedPluginCreated {\n  // owner_id is the id of the owner of the plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin.\n  string owner_name = 2;\n}\n\nmessage PayloadCuratedPluginDeleted {\n  // owner_id is the id of the owner of the plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin.\n  string owner_name = 2;\n}\n\nmessage PayloadCuratedPluginStatusUpdated {\n  // owner_id is the id of the owner of the plugin.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin.\n  string owner_name = 2;\n  // new_status is the new status of the plugin.\n  string new_status = 3;\n}\n\nmessage PayloadTokenCreated {\n  // owner_id is the id of the owner of the token.\n  string owner_id = 1;\n  // token_expiry_time is the expiry time of the token.\n  google.protobuf.Timestamp token_expiry_time = 2;\n}\n\nmessage PayloadTokenDeleted {\n  // owner_id is the id of the owner of the token.\n  string owner_id = 1;\n}\n\nmessage PayloadSCIMTokenCreated {\n  // token_expiry_time is the expiry time of the token.\n  google.protobuf.Timestamp token_expiry_time = 1;\n}\n\nmessage PayloadSCIMTokenDeleted {}\n\n// PayloadRepositoryCommitDeleted is deprecated.\n//\n// Individual repository commits cannot be deleted.\nmessage PayloadRepositoryCommitDeleted {\n  // Deprecated, individual repository commits cannot be deleted.\n  option deprecated = true;\n  // owner_id is the id of the owner of the repository from which the commit will be deleted.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository from which the commit will be deleted.\n  string owner_name = 2;\n  // repository_id is the id of the repository from which the commit will be deleted.\n  string repository_id = 3;\n  // repository_name is the name of the repository from which the commit will be deleted.\n  string repository_name = 4;\n  // draft_name is the name of the draft. Optional.\n  string draft_name = 5;\n}\n\nmessage PayloadRepositoryLabelCreated {\n  // owner_id is the id of the owner of the repository on which the label was created.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository on which the label was created.\n  string owner_name = 2;\n  // repository_id is the id of the repository on which the label was created.\n  string repository_id = 3;\n  // repository_name is the name of the repository from which the label was created.\n  string repository_name = 4;\n  // label_namespace is the namespace of the label that was created.\n  string label_namespace = 5 [deprecated = true];\n  // commit_id is the id of the commit on which the label was created.\n  string commit_id = 6;\n}\n\nmessage PayloadRepositoryLabelMoved {\n  // owner_id is the id of the owner of the repository on which the label was moved.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository on which the label was moved.\n  string owner_name = 2;\n  // repository_id is the id of the repository on which the label was moved.\n  string repository_id = 3;\n  // repository_name is the name of the repository from which the label was moved.\n  string repository_name = 4;\n  // label_namespace is the namespace of the label that was moved.\n  string label_namespace = 5 [deprecated = true];\n  // to_commit_id is the id of the commit on which the label was moved to.\n  string to_commit_id = 6;\n  // from_commit_id is the id of the commit on which the label was moved from.\n  string from_commit_id = 7;\n}\n\nmessage PayloadRepositoryLabelArchived {\n  // owner_id is the id of the owner of the repository on which the label was archived.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository on which the label was archived.\n  string owner_name = 2;\n  // repository_id is the id of the repository on which the label was archived.\n  string repository_id = 3;\n  // repository_name is the name of the repository from which the label was archived.\n  string repository_name = 4;\n}\n\nmessage PayloadRepositoryLabelUnarchived {\n  // owner_id is the id of the owner of the repository on which the label was unarchived.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the repository on which the label was unarchived.\n  string owner_name = 2;\n  // repository_id is the id of the repository on which the label was unarchived.\n  string repository_id = 3;\n  // repository_name is the name of the repository from which the label was unarchived.\n  string repository_name = 4;\n}\n\nmessage PayloadRepositoryLabelEnforcementIgnoresChanged {\n  // IgnoreEntry is an entry of the ignore configuration applied to the repository label, for a\n  // specific enforcement id.\n  message IgnoreEntry {\n    // The ignored rule or category id.\n    //\n    // If empty, this is an `ignore` entry. If populated, this is an `ignore_only` entry.\n    string rule_or_category_id = 1;\n    // The ignored file or directory paths.\n    repeated string paths = 2;\n  }\n  // owner_id is the id of the repository owner.\n  string owner_id = 1;\n  // owner_name is the name of the repository owner.\n  string owner_name = 2;\n  // repository_id is the id of the repository.\n  string repository_id = 3;\n  // repository_name is the name of the repository.\n  string repository_name = 4;\n  // enforcement_id is the id of the enforcement.\n  string enforcement_id = 5;\n  // old ignore entries configured for the repository label and the enforcement.\n  repeated IgnoreEntry old_ignore_entries = 6;\n  // new ignore entries configured for the repository label and the enforcement.\n  repeated IgnoreEntry new_ignore_entries = 7;\n}\n\nmessage PayloadServerBreakingChangePolicyEnabled {\n  // category is the category of breaking changes.\n  buf.alpha.registry.v1alpha1.BreakingChangeCategory category = 1;\n  // ignore_unstable_packages tracks breaking change enforcement for unstable packages.\n  optional bool ignore_unstable_packages = 2;\n}\n\nmessage PayloadServerBreakingChangePolicyDisabled {}\n\nmessage PayloadServerReviewFlowEnabled {}\n\nmessage PayloadServerReviewFlowDisabled {}\n\nmessage PayloadServerUniquenessPolicyEnabled {}\n\nmessage PayloadServerUniquenessPolicyDisabled {}\n\nmessage PayloadDeviceAuthorizationGrantApproved {\n  // client_id is the id of the registered oauth2 client of the grant.\n  string client_id = 1;\n}\nmessage PayloadDeviceAuthorizationGrantDenied {\n  // client_id is the id of the registered oauth2 client of the grant.\n  string client_id = 1;\n}\n\nmessage PayloadPluginLabelCreated {\n  // owner_id is the id of the owner of the plugin on which the label was created.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin on which the label was created.\n  string owner_name = 2;\n  // plugin_id is the id of the plugin on which the label was created.\n  string plugin_id = 3;\n  // plugin_name is the name of the plugin from which the label was created.\n  string plugin_name = 4;\n  // commit_id is the id of the commit on which the label was created.\n  string commit_id = 6;\n}\n\nmessage PayloadPluginLabelMoved {\n  // owner_id is the id of the owner of the plugin on which the label was moved.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin on which the label was moved.\n  string owner_name = 2;\n  // plugin_id is the id of the plugin on which the label was moved.\n  string plugin_id = 3;\n  // plugin_name is the name of the plugin from which the label was moved.\n  string plugin_name = 4;\n  // to_commit_id is the id of the commit on which the label was moved to.\n  string to_commit_id = 6;\n  // from_commit_id is the id of the commit on which the label was moved from.\n  string from_commit_id = 7;\n}\n\nmessage PayloadPluginLabelArchived {\n  // owner_id is the id of the owner of the plugin on which the label was archived.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin on which the label was archived.\n  string owner_name = 2;\n  // plugin_id is the id of the plugin on which the label was archived.\n  string plugin_id = 3;\n  // plugin_name is the name of the plugin from which the label was archived.\n  string plugin_name = 4;\n}\n\nmessage PayloadPluginLabelUnarchived {\n  // owner_id is the id of the owner of the plugin on which the label was unarchived.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the plugin on which the label was unarchived.\n  string owner_name = 2;\n  // plugin_id is the id of the plugin on which the label was unarchived.\n  string plugin_id = 3;\n  // plugin_name is the name of the plugin from which the label was unarchived.\n  string plugin_name = 4;\n}\n\nmessage PayloadPolicyLabelCreated {\n  // owner_id is the id of the owner of the policy on which the label was created.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy on which the label was created.\n  string owner_name = 2;\n  // policy_id is the id of the policy on which the label was created.\n  string policy_id = 3;\n  // policy_name is the name of the policy from which the label was created.\n  string policy_name = 4;\n  // commit_id is the id of the commit on which the label was created.\n  string commit_id = 6;\n}\n\nmessage PayloadPolicyLabelMoved {\n  // owner_id is the id of the owner of the policy on which the label was moved.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy on which the label was moved.\n  string owner_name = 2;\n  // policy_id is the id of the policy on which the label was moved.\n  string policy_id = 3;\n  // policy_name is the name of the policy from which the label was moved.\n  string policy_name = 4;\n  // to_commit_id is the id of the commit on which the label was moved to.\n  string to_commit_id = 6;\n  // from_commit_id is the id of the commit on which the label was moved from.\n  string from_commit_id = 7;\n}\n\nmessage PayloadPolicyLabelArchived {\n  // owner_id is the id of the owner of the policy on which the label was archived.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy on which the label was archived.\n  string owner_name = 2;\n  // policy_id is the id of the policy on which the label was archived.\n  string policy_id = 3;\n  // policy_name is the name of the policy from which the label was archived.\n  string policy_name = 4;\n}\n\nmessage PayloadPolicyLabelUnarchived {\n  // owner_id is the id of the owner of the policy on which the label was unarchived.\n  string owner_id = 1;\n  // owner_name is the name of the owner of the policy on which the label was unarchived.\n  string owner_name = 2;\n  // policy_id is the id of the policy on which the label was unarchived.\n  string policy_id = 3;\n  // policy_name is the name of the policy from which the label was unarchived.\n  string policy_name = 4;\n}\n\nmessage PayloadSDKPluginConstraintCreated {\n  // repository_owner_id is the id of the owner of the repository of the SDK constraint.\n  string repository_owner_id = 1;\n  // repository_owner_name is the name of the owner of the repository of the SDK constraint.\n  string repository_owner_name = 2;\n  // repository_id is the id of the repository of the SDK constraint.\n  string repository_id = 3;\n  // repository_name is the name of the repository of the SDK constraint.\n  string repository_name = 4;\n  // plugin_owner_id is the id of the owner of the plugin of the SDK constraint.\n  string plugin_owner_id = 5;\n  // plugin_owner_name is the name of the owner of the plugin of the SDK constraint.\n  string plugin_owner_name = 6;\n  // plugin_id is the id of the plugin of the SDK constraint.\n  string plugin_id = 7;\n  // plugin_name is the name of the plugin of the SDK constraint.\n  string plugin_name = 8;\n}\n\nmessage PayloadSDKPluginConstraintUpdated {\n  // repository_owner_id is the id of the owner of the repository of the SDK constraint.\n  string repository_owner_id = 1;\n  // repository_owner_name is the name of the owner of the repository of the SDK constraint.\n  string repository_owner_name = 2;\n  // repository_id is the id of the repository of the SDK constraint.\n  string repository_id = 3;\n  // repository_name is the name of the repository of the SDK constraint.\n  string repository_name = 4;\n  // plugin_owner_id is the id of the owner of the plugin of the SDK constraint.\n  string plugin_owner_id = 5;\n  // plugin_owner_name is the name of the owner of the plugin of the SDK constraint.\n  string plugin_owner_name = 6;\n  // plugin_id is the id of the plugin of the SDK constraint.\n  string plugin_id = 7;\n  // plugin_name is the name of the plugin of the SDK constraint.\n  string plugin_name = 8;\n}\n\nmessage PayloadSDKPluginConstraintDeleted {\n  // repository_owner_id is the id of the owner of the repository of the SDK constraint.\n  string repository_owner_id = 1;\n  // repository_owner_name is the name of the owner of the repository of the SDK constraint.\n  string repository_owner_name = 2;\n  // repository_id is the id of the repository of the SDK constraint.\n  string repository_id = 3;\n  // repository_name is the name of the repository of the SDK constraint.\n  string repository_name = 4;\n  // plugin_owner_id is the id of the owner of the plugin of the SDK constraint.\n  string plugin_owner_id = 5;\n  // plugin_owner_name is the name of the owner of the plugin of the SDK constraint.\n  string plugin_owner_name = 6;\n  // plugin_id is the id of the plugin of the SDK constraint.\n  string plugin_id = 7;\n  // plugin_name is the name of the plugin of the SDK constraint.\n  string plugin_name = 8;\n}\n\n// PolicyEnforcementScope is the scope to which a policy enforcement applies.\nmessage PolicyEnforcementScope {\n  message PolicyEnforcementScopeInstance {}\n  message PolicyEnforcementScopeOwner {\n    // owner_id is the id of the owner (organization or user).\n    string owner_id = 1;\n    // owner_name is the name of the owner (organization or user).\n    string owner_name = 2;\n  }\n  message PolicyEnforcementScopeRepository {\n    // repository_owner_id is the id of the owner of the repository.\n    string repository_owner_id = 1;\n    // repository_owner_name is the name of the owner of the repository.\n    string repository_owner_name = 2;\n    // repository_id is the id of the repository.\n    string repository_id = 3;\n    // repository_name is the name of the repository.\n    string repository_name = 4;\n  }\n  oneof scope {\n    PolicyEnforcementScopeInstance instance = 1;\n    PolicyEnforcementScopeOwner owner = 2;\n    PolicyEnforcementScopeRepository repository = 3;\n  }\n}\n\nmessage PayloadPolicyEnforcementCreated {\n  // scope is the scope to which the policy is enforced.\n  PolicyEnforcementScope scope = 1;\n  // policy_id is the id of the policy that is enforced.\n  string policy_id = 2;\n  // policy_ref is the reference of the policy that is enforced.\n  string policy_ref = 3;\n  // include_targets are the include targets of the policy enforcement.\n  repeated string include_targets = 4;\n}\n\nmessage PayloadPolicyEnforcementDeleted {\n  // scope is the scope to which the policy was enforced.\n  PolicyEnforcementScope scope = 1;\n  // policy_id is the id of the policy that was enforced.\n  string policy_id = 2;\n  // policy_ref is the reference of the policy that was enforced.\n  string policy_ref = 3;\n  // include_targets were the include targets of the policy enforcement.\n  repeated string include_targets = 4;\n}\n\nmessage PayloadPolicyEnforcementPolicyChanged {\n  // scope is the scope to which the policy is enforced. An enforcement cannot change its scope.\n  PolicyEnforcementScope scope = 1;\n  // old_policy_id is the id of the old policy.\n  string old_policy_id = 2;\n  // new_policy_id is the id of the new policy.\n  string new_policy_id = 3;\n  // old_policy_ref is the reference of the old policy.\n  string old_policy_ref = 4;\n  // new_policy_ref is the reference of the new policy.\n  string new_policy_ref = 5;\n}\n\nmessage PayloadPolicyEnforcementTargetsChanged {\n  // scope is the scope to which the policy is enforced. An enforcement cannot change its scope.\n  PolicyEnforcementScope scope = 1;\n  // old_include_targets are the old include targets of the policy enforcement.\n  repeated string old_include_targets = 2;\n  // new_include_targets are the new include targets of the policy enforcement.\n  repeated string new_include_targets = 3;\n}\n\nmessage ResourceVisibilityControl {\n  // Possible visibility that a resource can have.\n  enum Visibility {\n    VISIBILITY_UNSPECIFIED = 0;\n    VISIBILITY_PUBLIC = 1;\n    VISIBILITY_PRIVATE = 2;\n  }\n  // The visibility that is being controlled.\n  Visibility visibility = 1;\n  // Strict defines if the controlled visibility behaves like a restriction or a default value.\n  bool strict = 2;\n}\n\nmessage PayloadServerResourceVisibilityControlChanged {\n  // The resource type that had its visibility control changed.\n  ResourceType resource_type = 1;\n  // The old visibility control for resources of that type under the server instance. If not\n  // present, then this visibility control was just created.\n  optional ResourceVisibilityControl old_visibility_control = 2;\n  // The new visibility control for resources of that type under the server instance. If not\n  // present, then this visibility control was just deleted.\n  optional ResourceVisibilityControl new_visibility_control = 3;\n}\n\nmessage PayloadOrganizationResourceVisibilityControlChanged {\n  // The resource type that had its visibility control changed.\n  ResourceType resource_type = 1;\n  // The old visibility control for resources of that type under the organization. If not present,\n  // then this visibility control was just created.\n  optional ResourceVisibilityControl old_visibility_control = 2;\n  // The new visibility control for resources of that type under the organization. If not present,\n  // then this visibility control was just deleted.\n  optional ResourceVisibilityControl new_visibility_control = 3;\n}\n\nmessage PayloadOrganizationUniquenessPolicyEnabled {}\n\nmessage PayloadOrganizationUniquenessPolicyDisabled {}\n"
  },
  {
    "path": "proto/buf/alpha/audit/v1alpha1/service.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.audit.v1alpha1;\n\nimport \"buf/alpha/audit/v1alpha1/event.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// AuditService is the Audit service.\nservice AuditService {\n  // ListAuditedEvents lists audited events recorded in the BSR instance.\n  rpc ListAuditedEvents(ListAuditedEventsRequest) returns (ListAuditedEventsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage ListAuditedEventsRequest {\n  // The page size for listing audited events, values between 1-250.\n  uint32 page_size = 1;\n  // The page token for paginating. The first page is returned if this is empty.\n  string page_token = 2;\n  // The start timestamp to filter events from.\n  google.protobuf.Timestamp start = 3;\n  // The end timestamp to filter events to.\n  google.protobuf.Timestamp end = 4;\n}\n\nmessage ListAuditedEventsResponse {\n  // The list of audited events in the current page.\n  repeated buf.alpha.audit.v1alpha1.Event events = 1;\n  // The token for the next page of audited events. There are no more pages if\n  // this is empty.\n  string next_page_token = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/breaking/v1/config.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.breaking.v1;\n\n// Config represents the breaking change configuration for a module. The rule and category IDs are defined\n// by the version and apply across the config. The version is independent of the version of\n// the package. The package version refers to the config shape, the version encoded in the Config message\n// indicates which rule and category IDs should be used.\n//\n// The rule and category IDs are not encoded as enums in this package because we may want to support custom rule\n// and category IDs in the future. Callers will need to resolve the rule and category ID strings.\nmessage Config {\n  // version represents the version of the breaking change rule and category IDs that should be used with this config.\n  string version = 1;\n  // use_ids lists the rule and/or category IDs that are included in the breaking change check.\n  repeated string use_ids = 2;\n  // except_ids lists the rule and/or category IDs that are excluded from the breaking change check.\n  repeated string except_ids = 3;\n  // ignore_paths lists the paths of directories and/or files that should be ignored by the breaking change check.\n  // All paths are relative to the root of the module.\n  repeated string ignore_paths = 4;\n  // ignore_id_paths is a map of rule and/or category IDs to directory and/or file paths to exclude from the\n  // breaking change check. This corresponds with the ignore_only configuration key.\n  repeated IDPaths ignore_id_paths = 5;\n  // ignore_unstable_packages ignores packages with a last component that is one of the unstable forms recognised\n  // by the PACKAGE_VERSION_SUFFIX:\n  //   v\\d+test.*\n  //   v\\d+(alpha|beta)\\d+\n  //   v\\d+p\\d+(alpha|beta)\\d+\n  bool ignore_unstable_packages = 6;\n}\n\n// IDPaths represents a rule or category ID and the file and/or directory paths that are ignored for the rule.\nmessage IDPaths {\n  string id = 1;\n  repeated string paths = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/image/v1/image.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto2\";\n\npackage buf.alpha.image.v1;\n\nimport \"google/protobuf/descriptor.proto\";\n\noption cc_enable_arenas = true;\noption optimize_for = SPEED;\n\n// Image is an ext FileDescriptorSet.\n//\n// See https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto\nmessage Image {\n  repeated ImageFile file = 1;\n}\n\n// ImageFile is an extended FileDescriptorProto.\n//\n// Since FileDescriptorProto does not have extensions, we copy the fields from\n// FileDescriptorProto, and then add our own extensions via the buf_extension\n// field. This is compatible with a FileDescriptorProto.\n//\n// See https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto\nmessage ImageFile {\n  optional string name = 1;\n  optional string package = 2;\n  repeated string dependency = 3;\n  repeated int32 public_dependency = 10;\n  repeated int32 weak_dependency = 11;\n  repeated google.protobuf.DescriptorProto message_type = 4;\n  repeated google.protobuf.EnumDescriptorProto enum_type = 5;\n  repeated google.protobuf.ServiceDescriptorProto service = 6;\n  repeated google.protobuf.FieldDescriptorProto extension = 7;\n  optional google.protobuf.FileOptions options = 8;\n  optional google.protobuf.SourceCodeInfo source_code_info = 9;\n  optional string syntax = 12;\n  optional google.protobuf.Edition edition = 14;\n\n  // buf_extension contains buf-specific extensions to FileDescriptorProtos.\n  //\n  // The prefixed name and high tag value is used to all but guarantee there\n  // will never be any conflict with Google's FileDescriptorProto definition.\n  // The definition of a FileDescriptorProto has not changed in years, so\n  // we're not too worried about a conflict here.\n  optional ImageFileExtension buf_extension = 8042;\n}\n\n// ImageFileExtension contains extensions to ImageFiles.\n//\n// The fields are not included directly on the ImageFile so that we can both\n// detect if extensions exist, which signifies this was created by buf and not\n// by protoc, and so that we can add fields in a freeform manner without\n// worrying about conflicts with FileDescriptorProto.\nmessage ImageFileExtension {\n  // is_import denotes whether this file is considered an \"import\".\n  //\n  // An import is a file which was not derived from the local source files.\n  // There are two cases where this could be true:\n  //\n  // 1. A Well-Known Type included from the compiler.\n  // 2. A file that was included from a Buf module dependency.\n  //\n  // We use \"import\" as this matches with the protoc concept of\n  // --include_imports, however import is a bit of an overloaded term.\n  //\n  // This will always be set.\n  optional bool is_import = 1;\n  // ModuleInfo contains information about the Buf module this file belongs to.\n  //\n  // This field is optional and will not be set if the module is not known.\n  optional ModuleInfo module_info = 2;\n  // is_syntax_unspecified denotes whether the file did not have a syntax\n  // explicitly specified.\n  //\n  // Per the FileDescriptorProto spec, it would be fine in this case to just\n  // leave the syntax field unset to denote this and to set the syntax field\n  // to \"proto2\" if it is specified. However, protoc does not set the syntax\n  // field if it was \"proto2\", and plugins may (incorrectly) depend on this.\n  // We also want to maintain consistency with protoc as much as possible.\n  // So instead, we have this field which will denote whether syntax was not\n  // specified.\n  //\n  // This will always be set.\n  optional bool is_syntax_unspecified = 3;\n  // unused_dependency are the indexes within the dependency field on\n  // FileDescriptorProto for those dependencies that are not used.\n  //\n  // This matches the shape of the public_dependency and weak_dependency\n  // fields.\n  repeated int32 unused_dependency = 4;\n}\n\n// ModuleInfo contains information about a Buf module that an ImageFile\n// belongs to.\nmessage ModuleInfo {\n  // name is the name of the Buf module.\n  //\n  // This will always be set.\n  optional ModuleName name = 1;\n  // commit is the repository commit.\n  //\n  // This field is optional and will not be set if the commit is not known.\n  optional string commit = 2;\n}\n\n// ModuleName is a module name.\n//\n// All fields will always be set.\nmessage ModuleName {\n  optional string remote = 1;\n  optional string owner = 2;\n  optional string repository = 3;\n}\n"
  },
  {
    "path": "proto/buf/alpha/lint/v1/config.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.lint.v1;\n\n// Config represents the lint configuration for a module. The rule and category IDs are defined\n// by the version and apply across the config. The version is independent of the version of\n// the package. The package version refers to the config shape, the version encoded in the Config message\n// indicates which rule and category IDs should be used.\n//\n// The rule and category IDs are not encoded as enums in this package because we may want to support custom rule\n// and category IDs in the future. Callers will need to resolve the rule and category ID strings.\nmessage Config {\n  // version represents the version of the lint rule and category IDs that should be used with this config.\n  string version = 1;\n  // use_ids lists the rule and/or category IDs that are included in the lint check.\n  repeated string use_ids = 2;\n  // except_ids lists the rule and/or category IDs that are excluded from the lint check.\n  repeated string except_ids = 3;\n  // ignore_paths lists the paths of directories and/or files that should be ignored by the lint check.\n  // All paths are relative to the root of the module.\n  repeated string ignore_paths = 4;\n  // ignore_id_paths is a map of rule and/or category IDs to directory and/or file paths to exclude from the\n  // lint check. This corresponds with the ignore_only configuration key.\n  repeated IDPaths ignore_id_paths = 5;\n  // enum_zero_value_suffix controls the behavior of the ENUM_ZERO_VALUE lint rule ID. By default, this rule\n  // verifies that the zero value of all enums ends in _UNSPECIFIED. This config allows the user to override\n  // this value with the given string.\n  string enum_zero_value_suffix = 6;\n  // rpc_allow_same_request_response allows the same message type for both the request and response of an RPC.\n  bool rpc_allow_same_request_response = 7;\n  // rpc_allow_google_protobuf_empty_requests allows the RPC requests to use the google.protobuf.Empty message.\n  bool rpc_allow_google_protobuf_empty_requests = 8;\n  // rpc_allow_google_protobuf_empty_responses allows the RPC responses to use the google.protobuf.Empty message.\n  bool rpc_allow_google_protobuf_empty_responses = 9;\n  // service_suffix applies to the SERVICE_SUFFIX rule ID. By default, the rule verifies that all service names\n  // end with the suffix Service. This allows users to override the value with the given string.\n  string service_suffix = 10;\n  // allow_comment_ignores turns on comment-driven ignores.\n  bool allow_comment_ignores = 11;\n}\n\n// IDPaths represents a rule or category ID and the file and/or directory paths that are ignored for the rule.\nmessage IDPaths {\n  string id = 1;\n  repeated string paths = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/module/v1alpha1/module.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.module.v1alpha1;\n\nimport \"buf/alpha/breaking/v1/config.proto\";\nimport \"buf/alpha/lint/v1/config.proto\";\n\nenum DigestType {\n  DIGEST_TYPE_UNSPECIFIED = 0;\n  DIGEST_TYPE_SHAKE256 = 1;\n}\n\n// Digest represents a hash function's value.\nmessage Digest {\n  // digest_type describes the hash algorithm. e.g. \"SHAKE256\"\n  DigestType digest_type = 1;\n  // digest is the hash's output without encoding.\n  bytes digest = 2;\n}\n\n// Blob represents some module content with an associated digest.\nmessage Blob {\n  // Digest of the content.\n  Digest digest = 1;\n  // Content of the blob.\n  bytes content = 2;\n}\n\n// Module is a module.\nmessage Module {\n  // files are the files that make up the set.\n  //\n  // Sorted by path.\n  // Path must be unique.\n  // Only the target files. No imports.\n  //\n  // Maximum total size of all content: 32MB.\n  repeated ModuleFile files = 1;\n  // dependencies are the dependencies.\n  repeated ModulePin dependencies = 2;\n  // documentation is the string representation of the contents of the file at documentation_path.\n  //\n  // string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n  string documentation = 3;\n  // breaking_config is the breaking change detection configuration set for the module.\n  buf.alpha.breaking.v1.Config breaking_config = 4;\n  // lint_config is the lint configuration set for the module.\n  buf.alpha.lint.v1.Config lint_config = 5;\n  // license is the string representation of the contents of the `LICENSE` file.\n  //\n  // string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n  string license = 6;\n  // documentation_path is the path of the file which contains the module documentation.\n  //\n  // either `buf.md`, `README.md` or `README.markdown`.\n  // if empty, assumes buf.md.\n  string documentation_path = 7;\n}\n\n// ModuleFile is a file within a FileSet.\nmessage ModuleFile {\n  // path is the relative path of the file.\n  // Path can only use '/' as the separator character, and includes no \"..\" components.\n  string path = 1;\n  // content is the content of the file.\n  bytes content = 2;\n}\n\n// ModuleReference is a module reference.\nmessage ModuleReference {\n  string remote = 1;\n  string owner = 2;\n  string repository = 3;\n  // either tag, or commit\n  string reference = 4;\n}\n\n// ModulePin is a module pin.\nmessage ModulePin {\n  reserved 4, 6, 7;\n  reserved \"branch\", \"create_time\", \"digest\";\n\n  string remote = 1;\n  string owner = 2;\n  string repository = 3;\n  string commit = 5;\n  // Module's manifest digest. Replacement for previous b1/b3 digests.\n  // This is in the format '<digest_type>:<digest>`, where '<digest_type>' is the lowercase digest name ('shake256'),\n  // and '<digest>' is the lowercase hex-encoded digest.\n  // This value is persisted directly to the buf.lock file (https://buf.build/docs/configuration/v1/buf-lock) as the 'digest' key.\n  string manifest_digest = 8;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/admin.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/organization.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository.proto\";\nimport \"buf/alpha/registry/v1alpha1/user.proto\";\nimport \"buf/alpha/registry/v1alpha1/verification_status.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// BreakingChangeCategory is the allowed list of categories for breaking rule settings.\nenum BreakingChangeCategory {\n  BREAKING_CHANGE_CATEGORY_UNSPECIFIED = 0;\n  BREAKING_CHANGE_CATEGORY_FILE = 1;\n  BREAKING_CHANGE_CATEGORY_WIRE_JSON = 2;\n}\n\nmessage BreakingChangePolicy {\n  optional bool enabled = 1;\n  optional bool ignore_unstable_packages = 2;\n  BreakingChangeCategory category = 3;\n}\n\n// UniquenessPolicy is the policy for uniqueness on the server.\nmessage UniquenessPolicy {\n  // Whether uniqueness policy is enforced.\n  bool enabled = 1;\n}\n\n// Collision is a collision that has occurred.\nmessage Collision {\n  // The reference that has collisions.\n  string reference = 1;\n  // The type of collision.\n  CollisionType type = 2;\n  // The sources of the collision that the user is authorized to see.\n  repeated CollisionSource sources = 3;\n  // Whether there are other collision sources that the user is not authorized to see.\n  // The user should contact a server admin for more information about these collisions.\n  bool has_other_collision_sources = 4;\n}\n\n// CollisionSource is the source of a collision\nmessage CollisionSource {\n  // The name of the owner of the source.\n  string owner_name = 1;\n  // The name of the repository of the source.\n  string repository_name = 2;\n  // The path of the file that is the source of the collision.\n  string path = 3;\n}\n\n// MonthlyUsage contains the total amount of message, enum and services types\n// for every organizations repositories within a single tenant BSR instance\n// for a given month and year.\nmessage MonthlyUsage {\n  // The month, between 1 and 12.\n  uint32 month = 1;\n  // The year, between 2020 and the current year.\n  uint32 year = 2;\n  // The total amount of message types for the month and year.\n  uint32 total_message_types = 3;\n  // The total amount of enum types for the month and year.\n  uint32 total_enum_types = 4;\n  // The total amount of method types for the month and year.\n  uint32 total_method_types = 5;\n}\n\n// CollisionType is the type of collisions that can occur.\nenum CollisionType {\n  // Unspecified collision type.\n  COLLISION_TYPE_UNSPECIFIED = 0;\n  // A fully qualified proto name\n  COLLISION_TYPE_FULLY_QUALIFIED_NAME = 1;\n  // A proto file path\n  COLLISION_TYPE_PATH = 2;\n}\n\n// AdminService is the Admin service.\nservice AdminService {\n  // ForceDeleteUser forces to delete a user. Resources and organizations that are\n  // solely owned by the user will also be deleted.\n  rpc ForceDeleteUser(ForceDeleteUserRequest) returns (ForceDeleteUserResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // Update a user's verification status.\n  rpc UpdateUserVerificationStatus(UpdateUserVerificationStatusRequest) returns (UpdateUserVerificationStatusResponse);\n  // Update a organization's verification.\n  rpc UpdateOrganizationVerificationStatus(UpdateOrganizationVerificationStatusRequest) returns (UpdateOrganizationVerificationStatusResponse);\n  // Create a new machine user on the server.\n  rpc CreateMachineUser(CreateMachineUserRequest) returns (CreateMachineUserResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // Get breaking change policy for the server.\n  rpc GetBreakingChangePolicy(GetBreakingChangePolicyRequest) returns (GetBreakingChangePolicyResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // Update breaking change policy for the server.\n  rpc UpdateBreakingChangePolicy(UpdateBreakingChangePolicyRequest) returns (UpdateBreakingChangePolicyResponse);\n  // Get uniqueness policy for the server.\n  rpc GetUniquenessPolicy(GetUniquenessPolicyRequest) returns (GetUniquenessPolicyResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // Update uniqueness policy enforcement for the server.\n  rpc UpdateUniquenessPolicy(UpdateUniquenessPolicyRequest) returns (UpdateUniquenessPolicyResponse);\n  // Get state of uniqueness collisions for the server\n  rpc ListServerUniquenessCollisions(ListServerUniquenessCollisionsRequest) returns (ListServerUniquenessCollisionsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // Run a back-fill task to fill unique identifiers on the server.\n  // This is a potentially long-running operation, and should only be triggered by the administrator of the server,\n  // if they intend to enable uniqueness policy enforcement.\n  // Successful completion of this operation is a pre-requisite for enabling uniqueness policy enforcement.\n  rpc RunServerUniquenessBackfillTask(RunServerUniquenessBackfillTaskRequest) returns (RunServerUniquenessBackfillTaskResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // GetClusterUsage returns the summation of total message, enum and service types usage\n  // for every repository in each organization within a single tenant BSR instance.\n  rpc GetClusterUsage(GetClusterUsageRequest) returns (GetClusterUsageResponse);\n}\n\nmessage ForceDeleteUserRequest {\n  string user_id = 1;\n}\n\nmessage ForceDeleteUserResponse {\n  reserved 4, 5;\n  reserved \"plugins\", \"templates\";\n\n  // The deleted user.\n  User user = 1;\n  // The deleted organizations.\n  repeated Organization organizations = 2;\n  // The deleted repositories.\n  repeated Repository repositories = 3;\n}\n\nmessage UpdateUserVerificationStatusRequest {\n  string user_id = 1;\n  VerificationStatus verification_status = 2;\n}\n\nmessage UpdateUserVerificationStatusResponse {}\n\nmessage UpdateOrganizationVerificationStatusRequest {\n  string organization_id = 1;\n  VerificationStatus verification_status = 2;\n}\n\nmessage UpdateOrganizationVerificationStatusResponse {}\n\nmessage CreateMachineUserRequest {\n  string username = 1;\n}\n\nmessage CreateMachineUserResponse {\n  User user = 1;\n}\n\nmessage GetBreakingChangePolicyRequest {}\n\nmessage GetBreakingChangePolicyResponse {\n  BreakingChangePolicy policy = 1;\n}\n\nmessage UpdateBreakingChangePolicyRequest {\n  BreakingChangePolicy policy = 1;\n}\n\nmessage UpdateBreakingChangePolicyResponse {}\n\nmessage GetUniquenessPolicyRequest {}\n\nmessage GetUniquenessPolicyResponse {\n  // The current uniqueness policy settings.\n  UniquenessPolicy policy = 1;\n  // Reports the status of the backfill task, which can be executed by the server admin with the\n  // RunServerUniquenessBackfillTask RPC.\n  bool backfill_task_complete = 2;\n}\n\nmessage UpdateUniquenessPolicyRequest {\n  UniquenessPolicy policy = 1;\n}\n\nmessage UpdateUniquenessPolicyResponse {}\n\nmessage ListServerUniquenessCollisionsRequest {\n  // Token of the page to retrieve. If not specified, the first page of\n  // results will be returned. Use the value obtained from `next_page_token`\n  // in the previous response in order to request the next page of results.\n  string page_token = 1;\n  // Number of elements to retrieve in a single page.\n  // When too large a page is requested, the server may decide to further\n  // limit the number of returned resources.\n  uint32 page_size = 2;\n  // The desired collision type to filter by.\n  // This must be specified. Only collisions of the specified type will be returned,\n  // continue to page through results until no more collisions of the specified\n  // type are returned.\n  CollisionType collision_type = 3;\n}\n\nmessage ListServerUniquenessCollisionsResponse {\n  // The collisions.\n  repeated Collision collisions = 1;\n  // Pagination token used to retrieve the next page of results.\n  // Pass the content of this string as the `page_token` attribute of\n  // the next request. `next_page_token` is not returned for the last\n  // page.\n  string next_page_token = 2;\n}\n\nmessage RunServerUniquenessBackfillTaskRequest {}\n\nmessage RunServerUniquenessBackfillTaskResponse {}\n\nmessage GetClusterUsageRequest {\n  // The timestamp of the beginning time of a date range.\n  google.protobuf.Timestamp start_time = 1;\n  // The timestamp of the ending time of a date range.\n  google.protobuf.Timestamp end_time = 2;\n}\n\nmessage GetClusterUsageResponse {\n  repeated MonthlyUsage usage = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/authn.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/user.proto\";\n\n// AuthnService supplies authentication helpers.\nservice AuthnService {\n  // GetCurrentUser gets information associated with the current user.\n  //\n  // The user's ID is retrieved from the request's authentication header.\n  rpc GetCurrentUser(GetCurrentUserRequest) returns (GetCurrentUserResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetCurrentUserSubject gets the currently logged in users subject.\n  //\n  // The user's ID is retrieved from the request's authentication header.\n  rpc GetCurrentUserSubject(GetCurrentUserSubjectRequest) returns (GetCurrentUserSubjectResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetCurrentUserRequest {}\n\nmessage GetCurrentUserResponse {\n  buf.alpha.registry.v1alpha1.User user = 1;\n}\n\nmessage GetCurrentUserSubjectRequest {}\n\nmessage GetCurrentUserSubjectResponse {\n  // The user's subject for mapping to user in identity provider.\n  // Note: we do not want to make it part of the User response as\n  // it contains potentially sensitive information and the User\n  // response is shared with other users.\n  string subject = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/authz.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/role.proto\";\n\n// AuthzService supplies authorization helpers.\nservice AuthzService {\n  // UserCanCreateOrganizationRepository returns whether the user is authorized\n  // to create repositories in an organization.\n  rpc UserCanCreateOrganizationRepository(UserCanCreateOrganizationRepositoryRequest) returns (UserCanCreateOrganizationRepositoryResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanSeeRepositorySettings returns whether the user is authorized\n  // to see repository settings.\n  rpc UserCanSeeRepositorySettings(UserCanSeeRepositorySettingsRequest) returns (UserCanSeeRepositorySettingsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanSeeOrganizationSettings returns whether the user is authorized\n  // to see organization settings.\n  rpc UserCanSeeOrganizationSettings(UserCanSeeOrganizationSettingsRequest) returns (UserCanSeeOrganizationSettingsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanAddOrganizationMember returns whether the user is authorized to add\n  // any members to the organization and the list of roles they can add.\n  rpc UserCanAddOrganizationMember(UserCanAddOrganizationMemberRequest) returns (UserCanAddOrganizationMemberResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanUpdateOrganizationMember returns whether the user is authorized to update\n  // any members' membership information in the organization and the list of roles they can update.\n  rpc UserCanUpdateOrganizationMember(UserCanUpdateOrganizationMemberRequest) returns (UserCanUpdateOrganizationMemberResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanRemoveOrganizationMember returns whether the user is authorized to remove\n  // any members from the organization and the list of roles they can remove.\n  rpc UserCanRemoveOrganizationMember(UserCanRemoveOrganizationMemberRequest) returns (UserCanRemoveOrganizationMemberResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanDeleteOrganization returns whether the user is authorized\n  // to delete an organization.\n  rpc UserCanDeleteOrganization(UserCanDeleteOrganizationRequest) returns (UserCanDeleteOrganizationResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanDeleteRepository returns whether the user is authorized\n  // to delete a repository.\n  rpc UserCanDeleteRepository(UserCanDeleteRepositoryRequest) returns (UserCanDeleteRepositoryResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanDeleteUser returns whether the user is authorized\n  // to delete a user.\n  rpc UserCanDeleteUser(UserCanDeleteUserRequest) returns (UserCanDeleteUserResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanSeeServerAdminPanel returns whether the user is authorized\n  // to see server admin panel.\n  rpc UserCanSeeServerAdminPanel(UserCanSeeServerAdminPanelRequest) returns (UserCanSeeServerAdminPanelResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanManageRepositoryContributors returns whether the user is authorized to manage\n  // any contributors to the repository and the list of roles they can manage.\n  rpc UserCanManageRepositoryContributors(UserCanManageRepositoryContributorsRequest) returns (UserCanManageRepositoryContributorsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UserCanReviewCommits returns whether the user is authorized to review\n  // commits within a repository.\n  rpc UserCanReviewCommits(UserCanReviewCommitsRequest) returns (UserCanReviewCommitsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage UserCanCreateOrganizationRepositoryRequest {\n  // The ID of the organization for which to check\n  // whether the user is authorized.\n  string organization_id = 1;\n}\n\nmessage UserCanCreateOrganizationRepositoryResponse {\n  bool authorized = 1;\n}\n\nmessage UserCanSeeRepositorySettingsRequest {\n  // The ID of the repository for which to check\n  // whether the user is authorized.\n  string repository_id = 1;\n}\n\nmessage UserCanSeeRepositorySettingsResponse {\n  bool authorized = 1;\n}\n\nmessage UserCanSeeOrganizationSettingsRequest {\n  // The ID of the organization for which to check\n  // whether the user is authorized.\n  string organization_id = 1;\n}\n\nmessage UserCanSeeOrganizationSettingsResponse {\n  bool authorized = 1;\n}\n\nmessage UserCanAddOrganizationMemberRequest {\n  // The ID of the organization for which to check\n  // whether the user is authorized.\n  string organization_id = 1;\n}\n\nmessage UserCanAddOrganizationMemberResponse {\n  // The list of roles that the user is authorized to add, empty list means the user is\n  // not authorized to add any members.\n  repeated OrganizationRole authorized_roles = 1;\n}\n\nmessage UserCanUpdateOrganizationMemberRequest {\n  // The ID of the organization for which to check\n  // whether the user is authorized.\n  string organization_id = 1;\n}\n\nmessage UserCanUpdateOrganizationMemberResponse {\n  // The list of roles that the user is authorized to update (from and to), empty list means the user is\n  // not authorized to update any members' role.\n  repeated OrganizationRole authorized_roles = 1;\n}\n\nmessage UserCanRemoveOrganizationMemberRequest {\n  // The ID of the organization for which to check\n  // whether the user is authorized.\n  string organization_id = 1;\n}\n\nmessage UserCanRemoveOrganizationMemberResponse {\n  // The list of roles that the user is authorized to remove, empty list means the user is\n  // not authorized to remove any members.\n  repeated OrganizationRole authorized_roles = 1;\n}\n\nmessage UserCanDeleteOrganizationRequest {\n  // The ID of the organization for which to check\n  // whether the user is authorized.\n  string organization_id = 1;\n}\n\nmessage UserCanDeleteOrganizationResponse {\n  bool authorized = 1;\n}\n\nmessage UserCanDeleteRepositoryRequest {\n  // The ID of the repository for which to check\n  // whether the user is authorized.\n  string repository_id = 1;\n}\n\nmessage UserCanDeleteRepositoryResponse {\n  bool authorized = 1;\n}\n\nmessage UserCanDeleteUserRequest {}\n\nmessage UserCanDeleteUserResponse {\n  bool authorized = 1;\n}\n\nmessage UserCanSeeServerAdminPanelRequest {}\n\nmessage UserCanSeeServerAdminPanelResponse {\n  bool authorized = 1;\n}\n\nmessage UserCanManageRepositoryContributorsRequest {\n  // The ID of the repository for which to check\n  // whether the user is authorized.\n  string repository_id = 1;\n}\n\nmessage UserCanManageRepositoryContributorsResponse {\n  // The list of roles that the user is authorized to manage, empty list means the user is\n  // not authorized to manage any contributors.\n  repeated RepositoryRole authorized_roles = 1;\n}\n\nmessage UserCanReviewCommitsRequest {\n  // The ID of the repository for which to check\n  // whether the user is authorized.\n  string repository_id = 1;\n}\n\nmessage UserCanReviewCommitsResponse {\n  bool authorized = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/convert.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/image/v1/image.proto\";\n\n// The supported formats for the serialized message conversion.\nenum ConvertFormat {\n  CONVERT_FORMAT_UNSPECIFIED = 0;\n  CONVERT_FORMAT_BIN = 1;\n  CONVERT_FORMAT_JSON = 2;\n}\n\n// ConvertService coverts serialized messages\nservice ConvertService {\n  // Convert converts a serialized message according to\n  // the provided type name using an image.\n  rpc Convert(ConvertRequest) returns (ConvertResponse);\n}\n\nmessage ConvertRequest {\n  // type_name is the full type name of the serialized message (like acme.weather.v1.Units).\n  string type_name = 1;\n  // image is the image source that defines the serialized message.\n  buf.alpha.image.v1.Image image = 2;\n  // payload is the serialized Protobuf message.\n  bytes payload = 3;\n  // request_format is the format of the payload.\n  ConvertFormat request_format = 4;\n  // response_format is the desired format of the output result.\n  ConvertFormat response_format = 5;\n}\n\nmessage ConvertResponse {\n  // payload is the converted serialized message in one of the supported formats.\n  bytes payload = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/display.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/role.proto\";\n\n// DisplayService provides information regarding\n// UI element displaying based on the users roles.\nservice DisplayService {\n  // DisplayOrganizationElements returns which organization elements should be displayed to the user.\n  rpc DisplayOrganizationElements(DisplayOrganizationElementsRequest) returns (DisplayOrganizationElementsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DisplayRepositoryElements returns which repository elements should be displayed to the user.\n  rpc DisplayRepositoryElements(DisplayRepositoryElementsRequest) returns (DisplayRepositoryElementsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DisplayPluginElements returns which plugin elements should be displayed to the user.\n  rpc DisplayPluginElements(DisplayPluginElementsRequest) returns (DisplayPluginElementsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DisplayUserElements returns which user elements should be displayed to the user.\n  rpc DisplayUserElements(DisplayUserElementsRequest) returns (DisplayUserElementsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DisplayServerElements returns which server elements should be displayed to the user.\n  rpc DisplayServerElements(DisplayServerElementsRequest) returns (DisplayServerElementsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n\n  // DisplayOwnerEntitledElements returns which owner elements are entitled to be displayed to the user.\n  rpc DisplayOwnerEntitledElements(DisplayOwnerEntitledElementsRequest) returns (DisplayOwnerEntitledElementsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DisplayRepositoryEntitledElements returns which repository elements are entitled to be displayed to the user.\n  rpc DisplayRepositoryEntitledElements(DisplayRepositoryEntitledElementsRequest) returns (DisplayRepositoryEntitledElementsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n\n  // ListManageableRepositoryRoles returns which roles should be displayed\n  // to the user when they are managing contributors on the repository.\n  rpc ListManageableRepositoryRoles(ListManageableRepositoryRolesRequest) returns (ListManageableRepositoryRolesResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListManageableUserRepositoryRoles returns which roles should be displayed\n  // to the user when they are managing a specific contributor on the repository.\n  rpc ListManageableUserRepositoryRoles(ListManageableUserRepositoryRolesRequest) returns (ListManageableUserRepositoryRolesResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage DisplayOrganizationElementsRequest {\n  // The ID of the organization for which to check\n  // which elements should be displayed.\n  string organization_id = 1;\n}\n\nmessage DisplayOrganizationElementsResponse {\n  reserved 2, 3;\n  reserved \"create_plugin\", \"create_template\";\n\n  // Display create organization repository element if true.\n  bool create_repository = 1;\n  // Display organization settings element if true.\n  bool settings = 4;\n  // Display update organization settings element if true.\n  bool update_settings = 5;\n  // Display delete organization element if true.\n  bool delete = 6;\n}\n\nmessage DisplayRepositoryElementsRequest {\n  // The ID of the repository for which to check\n  // which elements should be displayed.\n  string repository_id = 1;\n}\n\nmessage DisplayRepositoryElementsResponse {\n  // Display repository settings element if true.\n  bool settings = 1;\n  // Display delete repository element if true.\n  bool delete = 2;\n  // Display write repository elements if true. It includes all elements from limited_write.\n  bool write = 3;\n  // Display limited_write repository elements if true. This is a subset of write elements.\n  bool limited_write = 4;\n}\n\nmessage DisplayPluginElementsRequest {\n  // The ID of the plugin for which to check\n  // which elements should be displayed.\n  string plugin_id = 1;\n}\n\nmessage DisplayPluginElementsResponse {\n  // Display plugin settings element if true.\n  bool settings = 1;\n  // Display delete plugin element if true.\n  bool delete = 2;\n}\n\nmessage DisplayUserElementsRequest {}\n\nmessage DisplayUserElementsResponse {\n  // Display delete user element if true.\n  bool delete = 1;\n}\n\nmessage DisplayServerElementsRequest {}\n\nmessage DisplayServerElementsResponse {\n  // Display server admin panel element if true.\n  bool admin_panel = 1;\n}\n\nmessage DisplayOwnerEntitledElementsRequest {\n  // The name of the owner for which to check\n  // which elements are entitled to be displayed.\n  string owner_name = 1;\n}\n\nmessage DisplayOwnerEntitledElementsResponse {\n  // Display create private repository element if true.\n  bool create_private_repository = 1;\n}\n\nmessage DisplayRepositoryEntitledElementsRequest {\n  // The ID of the repository for which to check\n  // which elements are entitled to be displayed.\n  string repository_id = 1;\n}\n\nmessage DisplayRepositoryEntitledElementsResponse {\n  // Display repository change to private setting element if true.\n  bool set_private = 1;\n}\n\nmessage ListManageableRepositoryRolesRequest {\n  // The ID of the repository for which to check\n  // which roles should be displayed as manageable.\n  string repository_id = 1;\n}\n\nmessage ListManageableRepositoryRolesResponse {\n  // The list of roles that should be displayed\n  // to the user as manageable.\n  repeated RepositoryRole roles = 1;\n}\n\nmessage ListManageableUserRepositoryRolesRequest {\n  // The ID of the repository for which to check\n  // which roles should be displayed as manageable.\n  string repository_id = 1;\n  // The ID of the target user for which to check\n  // which roles are manageable.\n  string user_id = 2;\n}\n\nmessage ListManageableUserRepositoryRolesResponse {\n  // The list of roles that should be displayed\n  // to the user as manageable.\n  repeated RepositoryRole roles = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/doc.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\n// DocService defines a set of APIs that are intended for use by bufwebd only.\n// This is not intended for general use; changes and use cases are subject to executive approval.\nservice DocService {\n  // GetSourceDirectoryInfo retrieves the directory and file structure for the\n  // given owner, repository and reference.\n  //\n  // The purpose of this is to get a representation of the file tree for a given\n  // module to enable exploring the module by navigating through its contents.\n  rpc GetSourceDirectoryInfo(GetSourceDirectoryInfoRequest) returns (GetSourceDirectoryInfoResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetSourceFile retrieves the source contents for the given owner, repository,\n  // reference, and path.\n  rpc GetSourceFile(GetSourceFileRequest) returns (GetSourceFileResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetModulePackages retrieves the list of packages for the module based on the given\n  // owner, repository, and reference.\n  rpc GetModulePackages(GetModulePackagesRequest) returns (GetModulePackagesResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetModuleDocumentation retrieves the documentations including buf.md and LICENSE files\n  // for module based on the given owner, repository, and reference.\n  rpc GetModuleDocumentation(GetModuleDocumentationRequest) returns (GetModuleDocumentationResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetPackageDocumentation retrieves a a slice of documentation structures\n  // for the given owner, repository, reference, and package name.\n  rpc GetPackageDocumentation(GetPackageDocumentationRequest) returns (GetPackageDocumentationResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\n// GetSourceDirectoryInfoRequest takes an owner, repository, and reference.\nmessage GetSourceDirectoryInfoRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n}\n\n// GetSourceDirectoryInfoResponse returns the root FileInfo for the requested module.\nmessage GetSourceDirectoryInfoResponse {\n  FileInfo root = 1;\n}\n\n// FileInfo is a nested structure that contains the file path, whether or not it's a directory,\n// and if so, the FileInfo children of that directory.\nmessage FileInfo {\n  // the normalized path of the directory, relative to the root of the module.\n  string path = 1;\n  bool is_dir = 2;\n  repeated FileInfo children = 3;\n}\n\n// GetSourceFileRequest takes an owner, repository, reference, and normalized path.\nmessage GetSourceFileRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n  // the normalized path to the requested file, relative to the root of the module.\n  string path = 4;\n}\n\n// GetSourceFileResponse returns the source code contents of the requested file.\nmessage GetSourceFileResponse {\n  // content is the content of the file.\n  bytes content = 1;\n}\n\n// GetModulePackagesRequest takes an owner, repository, and reference.\nmessage GetModulePackagesRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n}\n\n// GetModulePackagesResponse returns the list of ModulePackages for the requested module.\nmessage GetModulePackagesResponse {\n  string name = 1;\n  repeated ModulePackage module_packages = 2;\n}\n\n// ModulePackage provides the details about a module's associated package.\nmessage ModulePackage {\n  string name = 1;\n  string description = 2;\n}\n\n// GetModuleDocumentationRequest takes an owner, repository, and reference.\nmessage GetModuleDocumentationRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n}\n\n// GetModuleDocumentationResponse returns the ModuleDocumentation for the requested module.\nmessage GetModuleDocumentationResponse {\n  ModuleDocumentation module_documentation = 1;\n}\n\n// ModuleDocumentation provides the name of the module and associated documentations.\nmessage ModuleDocumentation {\n  string name = 1;\n  // This is the string representation of the contents of the buf.md file for module-level documentation.\n  //\n  // The buf.md file is a part of the module.\n  // string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n  string documentation = 3;\n  // This is the string representation of the contents of the LICENSE file for module-level license.\n  //\n  // The LICENSE file is a part of the module.\n  // string is used to enforce UTF-8 encoding or 7-bit ASCII text.\n  string license = 4;\n  // documentation_path is the path of the file which contains the module documentation.\n  //\n  // either `buf.md`, `README.md` or `README.markdown`.\n  // if empty, assumes buf.md.\n  string documentation_path = 5;\n}\n\n// GetPackageDocumentationRequest takes an owner, repository, reference, and package name.\nmessage GetPackageDocumentationRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n  // this is the fully qualified package name.\n  string package_name = 4;\n}\n\n// GetPackageDocumentationResponse returns the documentation for the requested package.\nmessage GetPackageDocumentationResponse {\n  PackageDocumentation package_documentation = 1;\n}\n\n// PackageDocumentation provides the name, description, and top level types defined in the package.\nmessage PackageDocumentation {\n  string name = 1;\n  // comments contains the package-level comment documentation.\n  // There is currently no convention for this.\n  //\n  // This is derived from the leading comments at the top level of the package.\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 2;\n  // services contains all the services defined in the package in alphabetical order.\n  repeated Service services = 3;\n  // enums contains all the enums defined in the package in alphabetical order.\n  repeated Enum enums = 4;\n  // messages contains all the messages defined in the package in alphabetical order.\n  repeated Message messages = 5;\n  // extensions contains all the file level extensions in the package in alphabetical order.\n  repeated FileExtension file_extensions = 6;\n}\n\n// Location provides the location information for the source code.\n//\n// This does not provide the leading or trailing comments as these will\n// be parsed into descriptions or dropped respectively.\nmessage Location {\n  int32 start_line = 1;\n  int32 start_column = 2;\n  int32 end_line = 3;\n  int32 end_column = 4;\n}\n\n// Service provides information for the documentation for a given service type in a file.\nmessage Service {\n  string name = 1;\n  // nested_name includes the nested types for a given type definition.\n  string nested_name = 2;\n  // full_name includes the package name and nested types for a given type definition.\n  string full_name = 3;\n  // comments is derived from the leading comments of a given service.\n  //\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 4;\n  // file_path is the normalized path of the file containing the service.\n  // This is used for navigating to the source code for the service.\n  string file_path = 5;\n  Location location = 6;\n  repeated Method methods = 7;\n  // implicitly_deprecated is true if its enclosing file is deprecated.\n  bool implicitly_deprecated = 9;\n  // All options that are present on the service. This is a super-set of\n  // service_options and uses a dynamic representation so it can also\n  // accommodate custom options with arbitrary types.\n  // This supersedes service_options.\n  repeated FieldLiteral options = 10;\n  // Use options instead.\n  ServiceOptions service_options = 8 [deprecated = true];\n}\n\n// ServiceOptions provides information for the documentation of options for a given service.\nmessage ServiceOptions {\n  option deprecated = true;\n  bool deprecated = 1;\n}\n\n// Method provides information for the documentation for a method of a given service.\nmessage Method {\n  string name = 1;\n  // comments is derived from the leading comments of a given method.\n  //\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 2;\n  MethodRequestResponse request = 3;\n  MethodRequestResponse response = 4;\n  // implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n  bool implicitly_deprecated = 6;\n  // All options that are present on the method. This is a super-set of\n  // method_options and uses a dynamic representation so it can also\n  // accommodate custom options with arbitrary types.\n  // This supersedes method_options.\n  repeated FieldLiteral options = 7;\n  // Use options instead.\n  MethodOptions method_options = 5 [deprecated = true];\n}\n\n// MethodOptions provides information for the documentation of options for a method.\nmessage MethodOptions {\n  option deprecated = true;\n  bool deprecated = 1;\n  // idempotency_level holds a value of the enumeration `google.protobuf.MethodOptions.IdempotencyLevel.\n  int32 idempotency_level = 2;\n}\n\n// MethodRequestResponse provides information for the documentation of a Method request or response message.\nmessage MethodRequestResponse {\n  // nested_type is the nested name of the message of the request or response. This includes nested definitions.\n  string nested_type = 1;\n  // full_type is the fully qualified name of the message of the request or response. This includes package and nested definitions.\n  string full_type = 2;\n  // boolean flag for whether the streaming label is set on an method request or response.\n  bool streaming = 3;\n  Message message = 4;\n  // import_module_ref is included if the request or response is an imported type.\n  // It contains all the metadata for the import.\n  ImportModuleRef import_module_ref = 5;\n}\n\n// Enum provides information for the documentation of an enum.\nmessage Enum {\n  string name = 1;\n  // nested_name includes the nested types for a given type definition.\n  string nested_name = 2;\n  // full_name includes the package name and nested types for a given type definition.\n  string full_name = 3;\n  // comments is derived from the leading comments of a given Enum.\n  //\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 4;\n  // file_path is the normalized path of the file containing the enum.\n  string file_path = 5;\n  Location location = 6;\n  repeated EnumValue values = 7;\n  // implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n  bool implicitly_deprecated = 9;\n  // All options that are present on the enum. This is a super-set of\n  // enum_options and uses a dynamic representation so it can also\n  // accommodate custom options with arbitrary types.\n  // // This supersedes enum_options.\n  repeated FieldLiteral options = 10;\n  // Use options instead.\n  EnumOptions enum_options = 8 [deprecated = true];\n}\n\n// EnumOptions provides information for the documentation of options for an enum.\nmessage EnumOptions {\n  option deprecated = true;\n  bool deprecated = 1;\n  bool allow_alias = 2;\n}\n\n// EnumValue provides information for the documentation of an enum value.\nmessage EnumValue {\n  string name = 1;\n  int32 number = 2;\n  // comments is derived from the leading comments of a given enum value.\n  //\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 3;\n  // All options that are present on the enum. This is a super-set of\n  // enum_value_options and uses a dynamic representation so it can also\n  // accommodate custom options with arbitrary types.\n  // // This supersedes enum_value_options.\n  repeated FieldLiteral options = 5;\n  // Use options instead.\n  EnumValueOptions enum_value_options = 4 [deprecated = true];\n}\n\n// EnumValueOptions provides information for the documentation of options for an enum value.\nmessage EnumValueOptions {\n  option deprecated = true;\n  bool deprecated = 1;\n}\n\n// ImportRef provides the import metadata if a type is imported.\nmessage ImportModuleRef {\n  string remote = 1;\n  string owner = 2;\n  string repository = 3;\n  // the commit is based on the module commit of the imported type provided\n  // by the image.\n  string commit = 4;\n  string package_name = 5;\n}\n\n// Message provides information for the documentation of a protobuf message.\nmessage Message {\n  string name = 1;\n  // nested_name includes the nested types for a given type definition.\n  string nested_name = 2;\n  // full_name includes the package name and nested types for a given type definition.\n  string full_name = 3;\n  // comments is derived from the leading comments of a given message.\n  //\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 4;\n  // file_path is the normalized path of the file containing the message.\n  string file_path = 5;\n  bool is_map_entry = 6;\n  repeated MessageField fields = 7;\n  Location location = 8;\n  repeated Field message_extensions = 9;\n  // implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n  bool implicitly_deprecated = 11;\n  // All options that are present on the message. This is a super-set of\n  // message_options and uses a dynamic representation so it can also\n  // accommodate custom options with arbitrary types.\n  // // This supersedes message_options.\n  repeated FieldLiteral options = 12;\n  // Use options instead.\n  MessageOptions message_options = 10 [deprecated = true];\n}\n\n// MessageField can be either a single field or a oneof set of fields.\nmessage MessageField {\n  oneof message_field {\n    Field field = 1;\n    Oneof oneof = 2;\n  }\n}\n\n// MessageOptions provides information for the documentation of options for a message.\nmessage MessageOptions {\n  option deprecated = true;\n  bool deprecated = 1;\n}\n\n// Oneof represents a oneof set of fields.\nmessage Oneof {\n  string name = 1;\n  repeated Field fields = 2;\n  // All options that are present on the OneOf.\n  // This is a dynamic representation so it can also\n  // accommodate custom options with arbitrary types.\n  repeated FieldLiteral options = 3;\n}\n\n// Field provides information for the documentation of a message field.\nmessage Field {\n  string name = 1;\n  // comments is derived from the leading comments of a given message field.\n  //\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 2;\n  string label = 3;\n  // string representation of the nested name of the field type, which includes nested definitions.\n  string nested_type = 4;\n  // string representation of the full name of the field type, which includes package name\n  // and nested definitions.\n  string full_type = 5;\n  uint32 tag = 6;\n  // MapEntry is present if the field is a map type.\n  MapEntry map_entry = 7;\n  // import_module_ref is included if the field is an imported type.\n  // It contains all the metadata for the import.\n  ImportModuleRef import_module_ref = 8;\n  // Extendee is the name of the type that is being ext if the field is an extension.\n  // This is an empty string for fields that are not extensions.\n  string extendee = 9;\n  // All options that are present on the field. This is a super-set of\n  // field_options and uses a dynamic representation so it can also\n  // accommodate custom options with arbitrary types.\n  // This supersedes field_options.\n  repeated FieldLiteral options = 11;\n  // Use options instead.\n  FieldOptions field_options = 10 [deprecated = true];\n}\n\n// FieldOptions provides information for the documentation of options for a field.\nmessage FieldOptions {\n  option deprecated = true;\n  bool deprecated = 1;\n  optional bool packed = 2;\n  // ctype holds a value of the enumeration `google.protobuf.FieldOptions.CType.\n  int32 ctype = 3;\n  // jstype holds a value of the enumeration `google.protobuf.FieldOptions.JSType.\n  int32 jstype = 4;\n}\n\n// FieldType indicates whether a field is a normal, an extension or an any.\nenum FieldType {\n  FIELD_TYPE_UNSPECIFIED = 0;\n  FIELD_TYPE_NORMAL = 1;\n  FIELD_TYPE_EXTENSION = 2;\n  FIELD_TYPE_ANY = 3;\n}\n\n// FieldLiteral represents a field and its value. It can be used to model descriptor options.\nmessage FieldLiteral {\n  // When is_extension is true, name is the fully-qualified name of the\n  // extension. Otherwise, it is the simple name of the field.\n  string name = 1;\n  // The unique field number associated with the field.\n  int32 tag = 2;\n  // Indicates whether this is an extension or not.\n  FieldType field_type = 3;\n  // The field's value.\n  LiteralValue value = 4;\n  // This is the module where the extension is defined if the field type\n  // is extension or the module where the messages is defined for field type any.\n  ImportModuleRef import_module_ref = 5;\n}\n\n// MessageLiteral represents an option value for a type that is a message.\nmessage MessageLiteral {\n  // Map of field names to value. Extension field names will be in the form:\n  // [fully.qualified.extension.Name].\n  repeated FieldLiteral fields = 1;\n}\n\n// ArrayLiteral represents an option value for a type that is a repeated field.\n// Maps are also represented using an ArrayLiteral, where each map entry is a MessageLiteral\n// that contains a key and value field.\nmessage ArrayLiteral {\n  repeated LiteralValue elements = 1;\n}\n\n// LiteralValue represents the actual value of the extension.\nmessage LiteralValue {\n  oneof value {\n    string string_value = 2;\n    int64 int_value = 3;\n    uint64 uint_value = 4;\n    double double_value = 5;\n    bool bool_value = 6;\n    string enum_value_name_value = 7;\n    ArrayLiteral array_value = 8;\n    MessageLiteral message_value = 9;\n  }\n  string comments = 10;\n}\n\n// MapEntry provides the key and value types for the MapEntry type for a map field.\nmessage MapEntry {\n  // string representation of the full name of the type for the map key. keys can only be\n  // scalar types: https://developers.google.com/protocol-buffers/docs/overview#maps\n  string key_full_type = 1;\n  // string representation of the nested name of the type for the map value.\n  string value_nested_type = 2;\n  // string representation of the full name of the type for the map value.\n  string value_full_type = 3;\n  // if the value is an imported type, this is the import module ref\n  ImportModuleRef value_import_module_ref = 4;\n}\n\n// FileExtension provides the information for the documentation of a file extension.\nmessage FileExtension {\n  // extension_type is the string representation of the type being extended.\n  string extension_type = 1;\n  // comments is derived from the leading comments of a given message field.\n  //\n  // Paragraph newlines (double new lines) are respected, however single newlines are not.\n  // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped.\n  string comments = 2;\n  // file_path is the normalized path of the file containing the message.\n  string file_path = 3;\n  Location location = 4;\n  // fields are all the fields that are associated with the extension.\n  repeated Field fields = 5;\n  // implicitly_deprecated is true if its enclosing file or parent element is deprecated.\n  bool implicitly_deprecated = 6;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/download.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/module/v1alpha1/module.proto\";\n\n// DownloadService is the download service.\nservice DownloadService {\n  // Download downloads a BSR module.\n  // NOTE: Newer clients should use DownloadManifestAndBlobs instead.\n  rpc Download(DownloadRequest) returns (DownloadResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DownloadManifestAndBlobs downloads a module in the manifest+blobs encoding format.\n  rpc DownloadManifestAndBlobs(DownloadManifestAndBlobsRequest) returns (DownloadManifestAndBlobsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\n// DownloadRequest specifies the module to download.\nmessage DownloadRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n}\n\n// DownloadResponse contains the remote module.\nmessage DownloadResponse {\n  buf.alpha.module.v1alpha1.Module module = 1;\n}\n\n// DownloadManifestAndBlobsRequest specifies the module to download.\nmessage DownloadManifestAndBlobsRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n}\n\n// DownloadManifestAndBlobsResponse is the returned resolved remote module.\nmessage DownloadManifestAndBlobsResponse {\n  // manifest is the manifest of the module's content.\n  // The content of the manifest blob is a text encoding of an ordered list of unique paths, each path encoded as:\n  //   <digest_type>:<digest>[SP][SP]<path>[LF]\n  // The only supported digest type is 'shake256'. The shake256 digest consists of 64 bytes of lowercase hex\n  // encoded output of SHAKE256.\n  buf.alpha.module.v1alpha1.Blob manifest = 1;\n  // blobs is a set of blobs that closes on the module's manifest to form the\n  // complete module's content.\n  repeated buf.alpha.module.v1alpha1.Blob blobs = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/git_metadata.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\n// GitIdentity is a Git user identity, typically either an author or a committer.\nmessage GitIdentity {\n  // Name is the name of the Git identity. This is not the BSR user's username.\n  string name = 1;\n  // Email is the email of the Git identity. This is not the BSR user's email.\n  string email = 2;\n  // Time is the time at which this identity was captured.\n  google.protobuf.Timestamp time = 3;\n}\n\n// GitCommitInformation is the information associated with a Git commit.\n// This always includes the hash.\n// The author and/or committer user identities are included when available.\nmessage GitCommitInformation {\n  // Hash is the SHA1 hash of the git commit.\n  string hash = 1;\n  // Author is metadata associated with the author of the git commit.\n  // This may not always be available, so it is not always populated.\n  GitIdentity author = 2;\n  // Committer is the metadata associated with the committer of the git commit.\n  // This may not always be available, so it is not always populated.\n  GitIdentity committer = 3;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/github.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nmessage GithubAppConfig {\n  string app_id = 1;\n}\n\nmessage GetGithubAppConfigRequest {}\n\nmessage GetGithubAppConfigResponse {\n  GithubAppConfig app_config = 1;\n}\n\n// GithubService is the service used to interact with Github-related information\nservice GithubService {\n  // GetGithubAppConfig returns a Github Application Configuration.\n  rpc GetGithubAppConfig(GetGithubAppConfigRequest) returns (GetGithubAppConfigResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/image.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/image/v1/image.proto\";\n\n// ImageService serves compiled images.\nservice ImageService {\n  // GetImage serves a compiled image for the local module. It automatically\n  // downloads dependencies if necessary.\n  rpc GetImage(GetImageRequest) returns (GetImageResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\n// ImageMask is used in GetImageRequest to specify which parts of an image\n// should be masked in responses.\nenum ImageMask {\n  IMAGE_MASK_UNSPECIFIED = 0;\n\n  // IMAGE_MASK_MESSAGES refers to ImageFile's `google.protobuf.DescriptorProto\n  // message_type` field.\n  IMAGE_MASK_MESSAGES = 1;\n\n  // IMAGE_MASK_ENUMS refers to ImageFile's `google.protobuf.EnumDescriptorProto\n  // enum_type` field.\n  IMAGE_MASK_ENUMS = 2;\n\n  // IMAGE_MASK_SERVICES refers to ImageFile's\n  // `google.protobuf.ServiceDescriptorProto service` field.\n  IMAGE_MASK_SERVICES = 3;\n}\n\nmessage GetImageRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n\n  // Exclude files from imported buf modules in this image.\n  bool exclude_imports = 4;\n\n  // Exclude source_code_info fields from each ImageFile.\n  bool exclude_source_info = 5;\n\n  // When specified the returned image will only contain the necessary files and\n  // descriptors in those files to describe these types. Accepts messages, enums\n  // and services. All types must be defined in the buf module, types in\n  // dependencies are not accepted.\n  //\n  // At this time specifying `types` requires `exclude_source_info` to be set to\n  // true.\n  repeated string types = 6;\n\n  // When not empty, the returned image's files will only include\n  // *DescriptorProto fields for the elements specified here. The masks are\n  // applied without regard for dependencies between types. For example, if\n  // `IMAGE_MASK_MESSAGES` is specified without `IMAGE_MASK_ENUMS` the resulting\n  // image will NOT contain enum definitions even if they are referenced from\n  // message fields.\n  repeated ImageMask include_mask = 7;\n}\n\nmessage GetImageResponse {\n  buf.alpha.image.v1.Image image = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/jsonschema.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\n// JSONSchemaService serves JSONSchemas describing protobuf types in buf\n// modules.\nservice JSONSchemaService {\n  // GetJSONSchema allows users to get an (approximate) json schema for a\n  // protobuf type.\n  rpc GetJSONSchema(GetJSONSchemaRequest) returns (GetJSONSchemaResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetJSONSchemaRequest {\n  string owner = 1;\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n\n  // A fully qualified name of the type to generate a JSONSchema for, e.g.\n  // \"pkg.foo.Bar\". The type needs to resolve in the referenced module or any of\n  // its dependencies. Currently only messages types are supported.\n  string type_name = 4;\n}\n\nmessage GetJSONSchemaResponse {\n  // A json schema representing what the json encoded payload for type_name\n  // should conform to. This schema is an approximation to be used by editors\n  // for validation and autocompletion, not a lossless representation of the\n  // type's descriptor.\n  bytes json_schema = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/module.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\n// LocalModuleReference is a local module reference.\n//\n// It does not include a remote.\nmessage LocalModuleReference {\n  string owner = 1;\n  string repository = 2;\n  // either branch or commit\n  string reference = 3;\n}\n\n// LocalModulePin is a local module pin.\n//\n// It does not include a remote.\nmessage LocalModulePin {\n  reserved 3, 5, 7, 8;\n  reserved \"branch\", \"create_time\", \"digest\", \"draft_name\";\n\n  string owner = 1;\n  string repository = 2;\n  string commit = 4;\n  // Module's manifest digest. Replacement for previous b1/b3 digests.\n  string manifest_digest = 6;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/organization.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/role.proto\";\nimport \"buf/alpha/registry/v1alpha1/verification_status.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Organization {\n  // primary key, unique, immutable\n  string id = 1;\n  // immutable\n  google.protobuf.Timestamp create_time = 2;\n  // mutable\n  google.protobuf.Timestamp update_time = 3;\n  // unique, mutable\n  string name = 4;\n  // description is the user configurable description of the organization.\n  string description = 5;\n  // url is the user configurable URL in the description of the organization,\n  // always included the scheme and will not have a #fragment suffix.\n  string url = 6;\n  // verification status of the organization, configurable by server admin.\n  VerificationStatus verification_status = 7;\n}\n\n// OrganizationMembership is a nested structure that contains\n// the organization and user membership information on that organization.\nmessage OrganizationMembership {\n  Organization organization = 1;\n  OrganizationRole organization_role = 2;\n}\n\n// OrganizationService is the Organization service.\nservice OrganizationService {\n  // GetOrganization gets a organization by ID.\n  rpc GetOrganization(GetOrganizationRequest) returns (GetOrganizationResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetOrganizationByName gets a organization by name.\n  rpc GetOrganizationByName(GetOrganizationByNameRequest) returns (GetOrganizationByNameResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListOrganizations lists all organizations.\n  rpc ListOrganizations(ListOrganizationsRequest) returns (ListOrganizationsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListUserOrganizations lists all organizations a user is member of.\n  rpc ListUserOrganizations(ListUserOrganizationsRequest) returns (ListUserOrganizationsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  rpc GetUserOrganization(GetUserOrganizationRequest) returns (GetUserOrganizationResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // CreateOrganization creates a new organization.\n  rpc CreateOrganization(CreateOrganizationRequest) returns (CreateOrganizationResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // DeleteOrganization deletes a organization.\n  rpc DeleteOrganization(DeleteOrganizationRequest) returns (DeleteOrganizationResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // DeleteOrganizationByName deletes a organization by name.\n  rpc DeleteOrganizationByName(DeleteOrganizationByNameRequest) returns (DeleteOrganizationByNameResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // AddOrganizationMember add a role to an user in the organization.\n  rpc AddOrganizationMember(AddOrganizationMemberRequest) returns (AddOrganizationMemberResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // UpdateOrganizationMember update the user's membership information in the organization.\n  rpc UpdateOrganizationMember(UpdateOrganizationMemberRequest) returns (UpdateOrganizationMemberResponse);\n  // RemoveOrganizationMember remove the role of an user in the organization.\n  rpc RemoveOrganizationMember(RemoveOrganizationMemberRequest) returns (RemoveOrganizationMemberResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // GetOrganizationSettings gets the settings of an organization, including organization base roles.\n  rpc GetOrganizationSettings(GetOrganizationSettingsRequest) returns (GetOrganizationSettingsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UpdateOrganizationSettings update the organization settings including base roles.\n  rpc UpdateOrganizationSettings(UpdateOrganizationSettingsRequest) returns (UpdateOrganizationSettingsResponse);\n  // AddOrganizationGroup adds an IdP Group to the organization.\n  rpc AddOrganizationGroup(AddOrganizationGroupRequest) returns (AddOrganizationGroupResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // UpdateOrganizationGroup updates an IdP Group for the organization.\n  rpc UpdateOrganizationGroup(UpdateOrganizationGroupRequest) returns (UpdateOrganizationGroupResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // RemoveOrganizationGroup removes an IdP Group from the organization.\n  rpc RemoveOrganizationGroup(RemoveOrganizationGroupRequest) returns (RemoveOrganizationGroupResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\nmessage GetOrganizationRequest {\n  string id = 1;\n}\n\nmessage GetOrganizationResponse {\n  Organization organization = 1;\n}\n\nmessage GetOrganizationByNameRequest {\n  string name = 1;\n}\n\nmessage GetOrganizationByNameResponse {\n  Organization organization = 1;\n}\n\nmessage ListOrganizationsRequest {\n  uint32 page_size = 1;\n  // The first page is returned if this is empty.\n  string page_token = 2;\n  bool reverse = 3;\n}\n\nmessage ListOrganizationsResponse {\n  repeated Organization organizations = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage ListUserOrganizationsRequest {\n  // The ID of the user whose organizations should be listed.\n  string user_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n  bool reverse = 4;\n}\n\nmessage ListUserOrganizationsResponse {\n  repeated OrganizationMembership organizations = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage GetUserOrganizationRequest {\n  // The ID of the user whose membership should be retrieved.\n  string user_id = 1;\n  // The ID of the organization.\n  string organization_id = 2;\n}\n\nmessage GetUserOrganizationResponse {\n  OrganizationMembership organization_membership = 1;\n}\n\nmessage CreateOrganizationRequest {\n  // Must be unique across organizations.\n  string name = 1;\n}\n\nmessage CreateOrganizationResponse {\n  Organization organization = 1;\n}\n\nmessage DeleteOrganizationRequest {\n  string id = 1;\n}\n\nmessage DeleteOrganizationResponse {}\n\nmessage DeleteOrganizationByNameRequest {\n  string name = 1;\n}\n\nmessage DeleteOrganizationByNameResponse {}\n\nmessage AddOrganizationMemberRequest {\n  // The ID of the organization for which the user will be added to.\n  string organization_id = 1;\n  // The ID of the user for which to be added to the organization.\n  string user_id = 2;\n  // The new role of the user in the organization.\n  OrganizationRole organization_role = 3;\n}\n\nmessage AddOrganizationMemberResponse {}\n\nmessage UpdateOrganizationMemberRequest {\n  // The ID of the organization for which the member belongs to.\n  string organization_id = 1;\n  // The ID of the user for which to be updated the role.\n  string user_id = 2;\n  // The new role of the user in the organization.\n  OrganizationRole organization_role = 3;\n}\n\nmessage UpdateOrganizationMemberResponse {}\n\nmessage RemoveOrganizationMemberRequest {\n  // The ID of the organization for which the member belongs to.\n  string organization_id = 1;\n  // The ID of the user for which to be removed the role.\n  string user_id = 2;\n}\n\nmessage RemoveOrganizationMemberResponse {}\n\nmessage GetOrganizationSettingsRequest {\n  // The ID of the organization for which to get the settings.\n  string organization_id = 1;\n}\n\nmessage GetOrganizationSettingsResponse {\n  message IdPGroup {\n    // The name of the IdP group.\n    string name = 1;\n    // The role override associated with this group.\n    OrganizationRole role_override = 2;\n  }\n\n  reserved 2, 3;\n  reserved \"plugin_base_role\", \"template_base_role\";\n\n  RepositoryRole repository_base_role = 1;\n  // The number of members in the organization.\n  uint32 members_count = 4;\n  // The IdP groups associated with the organization.\n  repeated IdPGroup idp_groups = 5;\n}\n\nmessage UpdateOrganizationSettingsRequest {\n  reserved 3, 4;\n  reserved \"plugin_base_role\", \"template_base_role\";\n\n  // The ID of the organization for which to update the base roles.\n  string organization_id = 1;\n  // optional, no update to this base role will be made if this is unspecified.\n  RepositoryRole repository_base_role = 2;\n  // optional, update to description will only be made when this is present\n  optional string description = 5;\n  // optional, update to url will only be made when this is present\n  optional string url = 6;\n}\n\nmessage UpdateOrganizationSettingsResponse {}\n\nmessage AddOrganizationGroupRequest {\n  // The ID of the organization for which to add the group.\n  string organization_id = 1;\n  // The name of the group to add.\n  string group_name = 2;\n  // The role to associate with this organization group.\n  //\n  // Any user who maps to this organization via this group will be granted this role. If no role is\n  // set, the user will be granted the 'member' role.\n  OrganizationRole role_override = 3;\n}\n\nmessage AddOrganizationGroupResponse {}\n\nmessage UpdateOrganizationGroupRequest {\n  // The ID of the organization to which this group belongs.\n  string organization_id = 1;\n  // The name of the group to update.\n  string group_name = 2;\n  // The role to associate with this organization group.\n  //\n  // Setting this to 'UNSPECIFIED' will remove the override. Leaving this unset will not update this\n  // property.\n  optional OrganizationRole role_override = 3;\n}\n\nmessage UpdateOrganizationGroupResponse {}\n\nmessage RemoveOrganizationGroupRequest {\n  // The ID of the organization for which to remove the group.\n  string organization_id = 1;\n  // The name of the group to remove.\n  string group_name = 2;\n}\n\nmessage RemoveOrganizationGroupResponse {}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/owner.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/organization.proto\";\nimport \"buf/alpha/registry/v1alpha1/user.proto\";\n\nmessage Owner {\n  oneof owner {\n    // The requested owner is a `User`.\n    User user = 1;\n    // The requested owner is a `Organization`.\n    Organization organization = 2;\n  }\n}\n\n// OwnerService is a service that provides RPCs that allow the BSR to query\n// for owner information.\nservice OwnerService {\n  // GetOwnerByName takes an owner name and returns the owner as\n  // either a user or organization.\n  rpc GetOwnerByName(GetOwnerByNameRequest) returns (GetOwnerByNameResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetOwnerByNameRequest {\n  // Name of the requested owner.\n  string name = 1;\n}\n\nmessage GetOwnerByNameResponse {\n  Owner owner = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/plugin_curation.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/image/v1/image.proto\";\nimport \"google/protobuf/compiler/plugin.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// CuratedPluginVisibility defines the visibility options available\n// for Curated Plugins.\nenum CuratedPluginVisibility {\n  CURATED_PLUGIN_VISIBILITY_UNSPECIFIED = 0;\n  CURATED_PLUGIN_VISIBILITY_PUBLIC = 1;\n  CURATED_PLUGIN_VISIBILITY_PRIVATE = 2;\n}\n\n// The supported plugin registries for curated plugins.\nenum PluginRegistryType {\n  reserved 6;\n  reserved \"PLUGIN_REGISTRY_TYPE_ARCHIVE\";\n\n  PLUGIN_REGISTRY_TYPE_UNSPECIFIED = 0;\n  PLUGIN_REGISTRY_TYPE_GO = 1;\n  PLUGIN_REGISTRY_TYPE_NPM = 2;\n  PLUGIN_REGISTRY_TYPE_MAVEN = 3;\n  PLUGIN_REGISTRY_TYPE_SWIFT = 4;\n  PLUGIN_REGISTRY_TYPE_PYTHON = 5;\n  PLUGIN_REGISTRY_TYPE_CARGO = 7;\n  PLUGIN_REGISTRY_TYPE_NUGET = 8;\n  PLUGIN_REGISTRY_TYPE_CMAKE = 9;\n}\n\n// PluginLanguage is used to specify the output languages a plugin supports.\nenum PluginLanguage {\n  PLUGIN_LANGUAGE_UNSPECIFIED = 0;\n  PLUGIN_LANGUAGE_GO = 1;\n  PLUGIN_LANGUAGE_JAVASCRIPT = 2;\n  PLUGIN_LANGUAGE_TYPESCRIPT = 3;\n  PLUGIN_LANGUAGE_SWIFT = 4;\n  PLUGIN_LANGUAGE_CPP = 5;\n  PLUGIN_LANGUAGE_JAVA = 6;\n  PLUGIN_LANGUAGE_DART = 7;\n  PLUGIN_LANGUAGE_RUST = 8;\n  PLUGIN_LANGUAGE_PYTHON = 9;\n  PLUGIN_LANGUAGE_RUBY = 10;\n  PLUGIN_LANGUAGE_KOTLIN = 11;\n  PLUGIN_LANGUAGE_OBJECTIVE_C = 12;\n  PLUGIN_LANGUAGE_PHP = 13;\n  PLUGIN_LANGUAGE_CSHARP = 14;\n  PLUGIN_LANGUAGE_SCALA = 15;\n  PLUGIN_LANGUAGE_C = 16;\n}\n\n// NPMImportStyle is used to specify the import style the plugin supports.\nenum NPMImportStyle {\n  NPM_IMPORT_STYLE_UNSPECIFIED = 0;\n  NPM_IMPORT_STYLE_MODULE = 1;\n  NPM_IMPORT_STYLE_COMMONJS = 2;\n}\n\n// SwiftPlatformType is used to specify the platform type for a Swift plugins minimum compatible version.\nenum SwiftPlatformType {\n  SWIFT_PLATFORM_TYPE_UNSPECIFIED = 0;\n  SWIFT_PLATFORM_TYPE_MACOS = 1;\n  SWIFT_PLATFORM_TYPE_IOS = 2;\n  SWIFT_PLATFORM_TYPE_WATCHOS = 3;\n  SWIFT_PLATFORM_TYPE_TVOS = 4;\n}\n\n// PythonPackageType is used to specify the package type for a Python Generated SDK.\nenum PythonPackageType {\n  PYTHON_PACKAGE_TYPE_UNSPECIFIED = 0;\n  // Regular Python package, containing Python runtime code (`.py` files).\n  PYTHON_PACKAGE_TYPE_RUNTIME = 1;\n  // Stub-only package, containing only `.pyi` files.\n  // Ref: https://peps.python.org/pep-0561/#stub-only-packages\n  PYTHON_PACKAGE_TYPE_STUB_ONLY = 2;\n}\n\n// DotnetTargetFramework specifies the target framework for dotnet plugins.\n// This is not meant to be an exhaustive list - most plugins should target a\n// netstandard version.\n// Reference: https://learn.microsoft.com/en-us/dotnet/standard/frameworks\nenum DotnetTargetFramework {\n  DOTNET_TARGET_FRAMEWORK_UNSPECIFIED = 0;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_0 = 1;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_1 = 2;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_2 = 3;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_3 = 4;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_4 = 5;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_5 = 6;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_1_6 = 7;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_0 = 8;\n  DOTNET_TARGET_FRAMEWORK_NETSTANDARD_2_1 = 9;\n  DOTNET_TARGET_FRAMEWORK_NET_5_0 = 10;\n  DOTNET_TARGET_FRAMEWORK_NET_6_0 = 11;\n  DOTNET_TARGET_FRAMEWORK_NET_7_0 = 12;\n  DOTNET_TARGET_FRAMEWORK_NET_8_0 = 13;\n}\n\n// GoConfig is the configuration for a Go plugin.\nmessage GoConfig {\n  // RuntimeLibrary describes the runtime library dependency of the generated code.\n  message RuntimeLibrary {\n    // The name of the runtime library module, i.e. \"google.golang.org/protobuf\".\n    string module = 1;\n    // The version of the runtime library, i.e. \"v1.27.1\".\n    string version = 2;\n  }\n  // Optionally define the runtime libraries for the plugin.\n  repeated RuntimeLibrary runtime_libraries = 1;\n  // The minimum Go version required by the plugin.\n  string minimum_version = 2;\n  // Optionally specifies an alternate base plugin like \"remote/org/go-multi\" instead of the default\n  // \"remote/protocolbuffers/go\". If provided, the name must match one of the plugin dependencies in\n  // the top-level deps field.\n  //\n  // This affects how imports are resolved - the specified plugin's import path will be used as the\n  // base path for all generated code, replacing the default protocolbuffers/go import paths. Used\n  // when depending on non-default BSR plugins.\n  string base_plugin = 3;\n}\n\n// NPMConfig is the configuration for a JavaScript NPM plugin.\nmessage NPMConfig {\n  // RuntimeLibrary describes the runtime library dependency of the generated code.\n  message RuntimeLibrary {\n    // The name of the runtime library package, i.e. \"@grpc/grpc-js\".\n    string package = 1;\n    // The version of the runtime library, i.e. \"^1.27.1\".\n    string version = 2;\n  }\n  // Optionally define the runtime libraries for the plugin.\n  repeated RuntimeLibrary runtime_libraries = 1;\n  // Optionally define a configuration for rewriting import paths, a feature mainly\n  // used for remote code generation in the BSR npm registry, which makes it possible\n  // to serve the output of a BSR module and a plugin in an individual package.\n  //\n  // All plugins based on @bufbuild/protoplugin support the option \"rewrite_imports\".\n  // Setting this value, i.e. \"connectweb.js\" or \"pb.js\", informs the BSR npm registry\n  // that the plugin supports import rewrites with the given import suffix.\n  string rewrite_import_path_suffix = 2;\n  // The import style used for the \"type\" field in the package.json file.\n  // This exists to support legacy plugins that require \"commonjs\" support.\n  NPMImportStyle import_style = 3;\n}\n\n// MavenConfig is the configuration for a Maven plugin.\nmessage MavenConfig {\n  // RuntimeLibrary describes a runtime dependency of the generated code.\n  message RuntimeLibrary {\n    string group_id = 1;\n    string artifact_id = 2;\n    string version = 3;\n    string classifier = 4;\n    string extension = 5;\n  }\n  // CompilerConfig contains configuration for the Java and/or Kotlin compiler used when compiling the generated code.\n  message CompilerConfig {\n    CompilerJavaConfig java = 1;\n    CompilerKotlinConfig kotlin = 2;\n  }\n  // CompilerJavaConfig contains settings for the Java compiler.\n  message CompilerJavaConfig {\n    // File encoding (default: UTF-8).\n    string encoding = 1;\n    // Release version (default: 8).\n    int32 release = 2;\n    // Source version (default: 8).\n    int32 source = 3;\n    // Target version (default: 8).\n    int32 target = 4;\n  }\n  // CompilerKotlinConfig contains settings for the Kotlin compiler.\n  message CompilerKotlinConfig {\n    // Version of the Kotlin compiler used to compile the generated code.\n    string version = 1;\n    // Version of the Kotlin API to target.\n    string api_version = 2;\n    // Target version of the JVM bytecode (default: 1.8).\n    string jvm_target = 3;\n    // Kotlin language version used for source compatibility.\n    string language_version = 4;\n  }\n  // RuntimeConfig allows configuring additional runtimes (like the 'lite' runtime).\n  // They can use different runtime dependencies and plugin options.\n  message RuntimeConfig {\n    string name = 1;\n    repeated RuntimeLibrary runtime_libraries = 2;\n    // The options to pass to the plugin. These will\n    // be merged into a single, comma-separated string.\n    repeated string options = 3;\n  }\n\n  // Optionally define the runtime libraries for the plugin.\n  repeated RuntimeLibrary runtime_libraries = 1;\n  // Settings for the Java/Kotlin compiler used to compile the generated code.\n  CompilerConfig compiler = 2;\n  // Optional additional runtimes supported by the plugin.\n  repeated RuntimeConfig additional_runtimes = 3;\n}\n\n// NugetConfig is the configuration for a NuGet C# plugin.\nmessage NugetConfig {\n  // RuntimeLibrary describes a NuGet package dependency of the generated code.\n  // Ref: https://learn.microsoft.com/en-us/dotnet/core/tools/dependencies#the-packagereference-element\n  message RuntimeLibrary {\n    // The name of the NuGet package (also known as the package ID).\n    string name = 1;\n    // The version of the NuGet package (supports ranges).\n    // Ref: https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges\n    string version = 2;\n    // Optional target frameworks. If specified, these dependencies will be\n    // conditionally added when building for the specified target framework.\n    repeated DotnetTargetFramework target_frameworks = 3;\n  }\n  // Target frameworks to build. At least one target framework is required.\n  repeated DotnetTargetFramework target_frameworks = 1;\n  // Optional runtime libraries required by the plugin's generated code.\n  repeated RuntimeLibrary runtime_libraries = 2;\n}\n\n// CmakeConfig is the configuration for a Cmake C++ plugin.\nmessage CmakeConfig {}\n\nmessage SwiftConfig {\n  // RuntimeLibrary describes a runtime library dependency of the generated code.\n  message RuntimeLibrary {\n    // The source of the runtime library package, e.g. https://github.com/apple/swift-protobuf.git.\n    string source = 1;\n    // The name of the runtime library package, e.g. \"swift-protobuf\".\n    string package = 2;\n    // The version of the runtime library, e.g. \"1.21.0\".\n    string version = 3;\n    // The products exported by the runtime library, e.g. \"SwiftProtobuf\".\n    repeated string products = 4;\n    // The minimum compatible platform versions of the runtime library.\n    message Platform {\n      // The name of the platform.\n      SwiftPlatformType name = 1;\n      // The minimum compatible version of the platform.\n      string version = 2;\n    }\n    // The minimum compatible platform versions of the runtime library.\n    repeated Platform platforms = 5;\n    // The supported Swift language versions of the runtime library, e.g. \".v5\".\n    repeated string swift_versions = 6;\n  }\n  // Optionally define the runtime libraries for the plugin.\n  repeated RuntimeLibrary runtime_libraries = 1;\n}\n\nmessage PythonConfig {\n  message RuntimeLibrary {\n    // dependency_specification is a PEP 508 Dependency Specification.\n    // Ref: https://peps.python.org/pep-0508/\n    string dependency_specification = 1;\n  }\n  repeated RuntimeLibrary runtime_libraries = 1;\n  // requires_python is a PEP 440 Version Specifier that specifies the value of\n  // the `Requires-Python` field in a metadata file.\n  //\n  // Ref:\n  // - https://packaging.python.org/en/latest/specifications/core-metadata/#requires-python\n  // - https://peps.python.org/pep-0440/\n  string requires_python = 2;\n  // package_type is the PythonPackageType that this plugin generates.\n  PythonPackageType package_type = 3;\n}\n\n// CargoConfig specifies the Cargo Registry configuration for a Rust plugin.\nmessage CargoConfig {\n  // RuntimeLibrary specifies a runtime dependency for a generated crate.\n  // It is the subset of a full Cargo dependency specification, which contains\n  // fields that are irrelevant for Generated SDKs.\n  // Ref: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html\n  message RuntimeLibrary {\n    // name specifies the name of the dependency.\n    string name = 1;\n    // version_requirement specifies the version requirement of the dependency.\n    string version_requirement = 2;\n    // default_features specifies whether or not default features will be enabled for the dependency.\n    bool default_features = 3;\n    // features specifies the features enabled for the dependency.\n    repeated string features = 4;\n  }\n  // rust_version specifies the minimum supported Rust version (MSRV) for the generated crate.\n  // Ref: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field\n  string rust_version = 1;\n  // runtime_libraries specifies the runtime dependencies for the generated crate. Optional.\n  repeated RuntimeLibrary runtime_libraries = 2;\n}\n\n// RegistryConfig is the configuration for the remote registry of a plugin.\nmessage RegistryConfig {\n  oneof registry_config {\n    GoConfig go_config = 1;\n    NPMConfig npm_config = 2;\n    MavenConfig maven_config = 3;\n    SwiftConfig swift_config = 4;\n    PythonConfig python_config = 5;\n    CargoConfig cargo_config = 6;\n    NugetConfig nuget_config = 7;\n    CmakeConfig cmake_config = 8;\n  }\n  // Reserved for future remote registry types.\n  reserved 9;\n  // The options to pass to the plugin. These will\n  // be merged into a single, comma-separated string.\n  repeated string options = 10;\n}\n\nmessage CuratedPluginReference {\n  // The owner of the plugin, i.e. \"library\".\n  string owner = 1;\n  // The name of the plugin, i.e. \"connect-go\".\n  string name = 2;\n  // Semver-formatted plugin version.\n  string version = 3;\n  // The revision for this plugin version.\n  uint32 revision = 4;\n}\n\n// CuratedPlugin represents a protoc plugin curated by Buf, such as protoc-gen-go.\nmessage CuratedPlugin {\n  // The ID of the plugin, which uniquely identifies the plugin.\n  string id = 1;\n  // The owner of the plugin, i.e. \"library\".\n  string owner = 2;\n  // The name of the plugin, i.e. \"connect-go\".\n  string name = 3;\n  // The optional registry type of the plugin.\n  PluginRegistryType registry_type = 4;\n  // Semver-formatted plugin version.\n  string version = 5;\n  // The full container image digest associated with this plugin version including\n  // the algorithm.\n  // Ref: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests\n  string container_image_digest = 6;\n  // The creation time of the plugin.\n  google.protobuf.Timestamp create_time = 8;\n  // List of plugin dependencies.\n  repeated CuratedPluginReference dependencies = 9;\n  // Optionally specify the URL leading to the source code of the plugin, if available.\n  string source_url = 10;\n  // Optionally specify a brief description of the plugin functionality.\n  string description = 11;\n  // The configuration for the remote registry of the plugin.\n  RegistryConfig registry_config = 12;\n  // The revision for this plugin version.\n  uint32 revision = 13;\n  // The output languages supported by the plugin.\n  repeated PluginLanguage output_languages = 14;\n  // spdx_license_id is the license of the plugin, which should be one of the identifiers\n  // defined in https://spdx.org/licenses\n  string spdx_license_id = 15;\n  // license_url specifies an optional URL for the plugin's license (if not using a standard spdx_license_id).\n  string license_url = 16;\n  // verified indicates the plugin has been verified. Verification is a property\n  // of the BSR and cannot be set by end-users.\n  bool verified = 17;\n  // Visibility indicates whether the plugin is public or private.\n  CuratedPluginVisibility visibility = 18;\n  // Deprecated indicates whether the plugin is deprecated.\n  bool deprecated = 19;\n  // Optionally specify a message to be displayed when the plugin is deprecated.\n  string deprecation_message = 20;\n  // The URL leading to the integration guide of the plugin, if available.\n  string integration_guide_url = 21;\n  // The configurable documentation of the Plugin.\n  string doc = 22;\n  // The collections the Plugin belongs to.\n  repeated PluginCollection collections = 23;\n}\n\n// Plugin collections group related plugins, organizing them by functionality or ecosystem.\nmessage PluginCollection {\n  // The name of the collection.\n  string name = 1;\n}\n\n// PluginCurationService manages curated plugins.\nservice PluginCurationService {\n  // ListCuratedPlugins returns all the curated plugins available.\n  rpc ListCuratedPlugins(ListCuratedPluginsRequest) returns (ListCuratedPluginsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // CreateCuratedPlugin creates a new curated plugin.\n  rpc CreateCuratedPlugin(CreateCuratedPluginRequest) returns (CreateCuratedPluginResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // GetLatestCuratedPlugin returns the latest version of a plugin matching given parameters.\n  rpc GetLatestCuratedPlugin(GetLatestCuratedPluginRequest) returns (GetLatestCuratedPluginResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DeleteCuratedPlugin deletes a curated plugin based on the given parameters.\n  rpc DeleteCuratedPlugin(DeleteCuratedPluginRequest) returns (DeleteCuratedPluginResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\n// CodeGenerationService generates code using remote plugins.\nservice CodeGenerationService {\n  // GenerateCode generates code using the specified remote plugins.\n  rpc GenerateCode(GenerateCodeRequest) returns (GenerateCodeResponse);\n}\n\nmessage GenerateCodeRequest {\n  // The image to run plugins against to generate the desired file outputs.\n  //\n  // All image files that are not imports and not well-known types will be generated.\n  // If you want to filter what files are generated, modify the image.\n  // If you want to include imports, set include_imports.\n  buf.alpha.image.v1.Image image = 1;\n  repeated PluginGenerationRequest requests = 2;\n  // Include imports from the Image in generation. If include_imports is also set\n  // in one of requests, use the request's value for that plugin.\n  bool include_imports = 3;\n  // Include Well-Known Types from the Image in generation.\n  //\n  // include_imports must be set if include_well_known_types is set. If include_well_known_types\n  // is also set in one of requests, use the request's value for that plugin.\n  bool include_well_known_types = 4;\n}\n\nmessage GenerateCodeResponse {\n  // Responses from each plugin execution.\n  // The order of each response matches the order in the GenerateCodeRequest.\n  repeated PluginGenerationResponse responses = 1;\n}\n\n// Request for performing code generation using the specified plugin.\nmessage PluginGenerationRequest {\n  // The plugin to execute.\n  CuratedPluginReference plugin_reference = 1;\n  // The options to pass to the plugin. These will\n  // be merged into a single, comma-separated string.\n  repeated string options = 2;\n  // Include imports from the Image in generation.\n  optional bool include_imports = 3;\n  // Include Well-Known Types from the Image in generation.\n  //\n  // include_imports must be set if include_well_known_types is set.\n  optional bool include_well_known_types = 4;\n}\n\n// Response from code generation for a given plugin.\nmessage PluginGenerationResponse {\n  // Generated code from the plugin.\n  google.protobuf.compiler.CodeGeneratorResponse response = 1;\n}\n\nmessage DeleteCuratedPluginRequest {\n  // The owner of the plugin to delete.\n  string owner = 1;\n  // The name of the plugin to delete.\n  string name = 2;\n  // Version is the plugin version and is optional. If this field is not set then delete all versions,\n  // otherwise delete only the specified version which includes all revisions.\n  string version = 3;\n}\n\nmessage DeleteCuratedPluginResponse {}\n\nmessage CreateCuratedPluginRequest {\n  // The owner of the plugin, i.e. \"library\".\n  string owner = 1;\n  // The name of the plugin, i.e. \"connect-go\".\n  string name = 2;\n  // The optional registry type of the plugin.\n  PluginRegistryType registry_type = 3;\n  // Semver-formatted plugin version.\n  string version = 4;\n  // The full container image digest associated with this plugin version including\n  // the algorithm.\n  // Ref: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests\n  string container_image_digest = 5;\n  // List of plugin dependencies.\n  repeated CuratedPluginReference dependencies = 7;\n  // The URL leading to the source code of the plugin, if available.\n  string source_url = 8;\n  // A brief description of the plugin functionality.\n  string description = 9;\n  // The configuration for the remote registry of the plugin.\n  RegistryConfig registry_config = 12;\n  // The revision for this plugin version.\n  uint32 revision = 13;\n  // The output languages supported by the plugin.\n  repeated PluginLanguage output_languages = 14;\n  // spdx_license_id is the license of the plugin, which should be one of the identifiers\n  // defined in https://spdx.org/licenses\n  string spdx_license_id = 15;\n  // license_url specifies an optional URL for the plugin's license (if not using a standard spdx_license_id).\n  string license_url = 16;\n  // Visibility indicates whether the plugin is public or private.\n  CuratedPluginVisibility visibility = 17;\n  // The URL leading to the integration guide of the plugin, if available.\n  string integration_guide_url = 18;\n  // The deprecation status of the plugin.\n  bool deprecated = 19;\n}\n\nmessage CreateCuratedPluginResponse {\n  // The created plugin.\n  CuratedPlugin configuration = 1;\n}\n\nmessage ListCuratedPluginsRequest {\n  uint32 page_size = 1;\n  // The first page is returned if this is empty.\n  string page_token = 2;\n  bool reverse = 3;\n  // If true, will only return plugins which support remote packages (registry_type is set).\n  bool supports_remote_packages = 4;\n  // If true, will include deprecated plugins.\n  bool include_deprecated = 5;\n}\n\nmessage ListCuratedPluginsResponse {\n  repeated CuratedPlugin plugins = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage GetLatestCuratedPluginRequest {\n  // The owner of the plugin, i.e. \"library\".\n  string owner = 1;\n  // The name of the plugin, i.e. \"connect-go\".\n  string name = 2;\n  // Both version (semver-formatted) and revision are optional, which means\n  // return the latest plugin.\n  // If version is set, but revision is omitted, then return the latest\n  // revision for that version.\n  // If version and revision are both set, return specific plugin.\n  // It is an error to set a revision without a corresponding version.\n  string version = 3;\n  uint32 revision = 4;\n  // If true, will only return versions (and revisions) which support remote packages (registry_type is set).\n  bool supports_remote_packages = 5;\n}\n\nmessage GetLatestCuratedPluginResponse {\n  CuratedPlugin plugin = 1;\n  // versions is a semver-sorted list in descending order.\n  repeated CuratedPluginVersionRevisions versions = 2;\n}\n\nmessage CuratedPluginVersionRevisions {\n  string version = 1;\n  // revisions is a sorted list in descending order.\n  repeated uint32 revisions = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/push.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/module/v1alpha1/module.proto\";\nimport \"buf/alpha/registry/v1alpha1/module.proto\";\n\n// PushService is the Push service.\nservice PushService {\n  // Push pushes.\n  // NOTE: Newer clients should use PushManifestAndBlobs.\n  rpc Push(PushRequest) returns (PushResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // PushManifestAndBlobs pushes a module by encoding it in a manifest and blobs format.\n  rpc PushManifestAndBlobs(PushManifestAndBlobsRequest) returns (PushManifestAndBlobsResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\n// PushRequest specifies the module to push to the BSR.\nmessage PushRequest {\n  string owner = 1;\n  string repository = 2;\n  string branch = 3 [deprecated = true];\n  buf.alpha.module.v1alpha1.Module module = 4;\n  // Optional; if provided, the provided tags\n  // are created for the pushed commit.\n  repeated string tags = 5;\n  // Optional; if provided, the pushed commit\n  // will be appended to these tracks. If the\n  // tracks do not exist, they will be created.\n  repeated string tracks = 6 [deprecated = true];\n  // If non-empty, the push creates a draft commit with this name.\n  string draft_name = 7;\n}\n\n// PushResponse is the pushed module pin, local to the used remote.\nmessage PushResponse {\n  LocalModulePin local_module_pin = 5;\n}\n\n// PushManifestAndBlobsRequest holds the module to push in the manifest+blobs\n// encoding format.\nmessage PushManifestAndBlobsRequest {\n  string owner = 1;\n  string repository = 2;\n  // Manifest with all the module files being pushed.\n  // The content of the manifest blob is a text encoding of an ordered list of unique paths, each path encoded as:\n  //   <digest_type>:<digest>[SP][SP]<path>[LF]\n  // The only current supported digest type is 'shake256'. The shake256 digest consists of 64 bytes of lowercase hex\n  // encoded output of SHAKE256. See buf.alpha.module.v1alpha1.Digest for more details.\n  buf.alpha.module.v1alpha1.Blob manifest = 3;\n  // Referenced blobs in the manifest. Keep in mind there is not necessarily one\n  // blob per file, but one blob per digest, so for files with exactly the same\n  // content, you can send just one blob.\n  repeated buf.alpha.module.v1alpha1.Blob blobs = 4;\n  // Optional; if provided, the provided tags\n  // are created for the pushed commit.\n  repeated string tags = 5;\n  // If non-empty, the push creates a draft commit with this name.\n  string draft_name = 6;\n}\n\n// PushManifestAndBlobsResponse is the pushed module pin, local to the used\n// remote.\nmessage PushManifestAndBlobsResponse {\n  LocalModulePin local_module_pin = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/reference.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/repository_branch.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository_commit.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository_tag.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Reference {\n  reserved 4;\n  reserved \"track\";\n\n  oneof reference {\n    // The requested reference is a branch.\n    RepositoryBranch branch = 1;\n    // The requested reference is a tag.\n    RepositoryTag tag = 2;\n    // The requested reference is a commit.\n    RepositoryCommit commit = 3;\n    // The requested reference is the default reference.\n    RepositoryMainReference main = 5;\n    // The requested reference is a draft commit.\n    RepositoryDraft draft = 6;\n    // The requested reference is a VCS commit.\n    RepositoryVCSCommit vcs_commit = 7;\n  }\n}\n\nmessage RepositoryMainReference {\n  // Name is the configured default_branch for the repository (default: 'main').\n  string name = 1;\n  // The latest commit in this repository. If the repository has no commits,\n  // this will be empty.\n  RepositoryCommit commit = 2;\n}\n\nmessage RepositoryDraft {\n  // The name of the draft\n  string name = 1;\n  // The commit this draft points to.\n  RepositoryCommit commit = 2;\n}\n\nmessage RepositoryVCSCommit {\n  // primary key, unique.\n  string id = 1;\n  // immutable\n  google.protobuf.Timestamp create_time = 2;\n  // The name of the VCS commit, e.g. for Git, it would be the Git hash.\n  string name = 3;\n  // The name of the BSR commit this VCS commit belongs to.\n  string commit_name = 4;\n}\n\n// ReferenceService is a service that provides RPCs that allow the BSR to query\n// for reference information.\nservice ReferenceService {\n  // GetReferenceByName takes a reference name and returns the\n  // reference either as main, a tag, or a commit.\n  rpc GetReferenceByName(GetReferenceByNameRequest) returns (GetReferenceByNameResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetReferenceByNameRequest {\n  // Optional name (if unspecified, will use the repository's default_branch).\n  string name = 1;\n  // Owner of the repository the reference belongs to.\n  string owner = 2;\n  // Name of the repository the reference belongs to.\n  string repository_name = 3;\n}\n\nmessage GetReferenceByNameResponse {\n  Reference reference = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/repository.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/role.proto\";\nimport \"buf/alpha/registry/v1alpha1/user.proto\";\nimport \"buf/alpha/registry/v1alpha1/verification_status.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nenum Visibility {\n  VISIBILITY_UNSPECIFIED = 0;\n  VISIBILITY_PUBLIC = 1;\n  VISIBILITY_PRIVATE = 2;\n}\n\nmessage Repository {\n  // primary key, unique, immutable\n  string id = 1;\n  // immutable\n  google.protobuf.Timestamp create_time = 2;\n  // mutable\n  google.protobuf.Timestamp update_time = 3;\n  // unique, mutable\n  string name = 4;\n  oneof owner {\n    // foreign key, mutable\n    string user_id = 5;\n    // foreign key, mutable\n    string organization_id = 6;\n  }\n  Visibility visibility = 7;\n  // deprecated means this repository is deprecated.\n  bool deprecated = 8;\n  // deprecation_message is the message shown if the repository is deprecated.\n  string deprecation_message = 9;\n  // owner_name is the name of the owner of the repository,\n  // either a username or organization name.\n  string owner_name = 10;\n  // description is the user configurable description of the repository.\n  string description = 11;\n  // url is the user configurable URL in the description of the repository,\n  // always included the scheme and will not have a #fragment suffix.\n  string url = 12;\n  // default_branch in a BSR repository. It is used when syncing a git repository, to make sure both\n  // default branches (BSR and Git) are in sync. By default, every BSR repository is created with a\n  // \"main\" default branch.\n  string default_branch = 13;\n}\n\nmessage RepositoryCounts {\n  reserved 2;\n  reserved \"tracks_count\";\n\n  uint32 tags_count = 1;\n  uint32 drafts_count = 3;\n}\n\nmessage RepositoryContributor {\n  User user = 1;\n  // The ID of the for which the role belongs to.\n  string repository_id = 2;\n  // The role that the user has been explicitly assigned against the repository.\n  RepositoryRole explicit_role = 3;\n  // Optionally defines the role that the user has implicitly against the repository through the owning organization.\n  // If the repository does not belong to an organization or the user is not part of the owning organization, this is unset.\n  RepositoryRole implicit_role = 4;\n}\n\nmessage RepositoryMetadata {\n  // The ID of the repository.\n  string id = 1;\n  // The name of the repository.\n  string name = 2;\n  // The owner name of the repository.\n  string owner_name = 3;\n  // The verification status of the owner of the repository.\n  VerificationStatus owner_verification_status = 4;\n  // The commit time of the latest main commit in the repository.\n  google.protobuf.Timestamp latest_commit_time = 5;\n  // The SPDX license ID of the latest main commit in the repository.\n  string latest_spdx_license_id = 6;\n}\n\n// RepositoryService is the Repository service.\nservice RepositoryService {\n  // GetRepository gets a repository by ID.\n  rpc GetRepository(GetRepositoryRequest) returns (GetRepositoryResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetRepositoryByFullName gets a repository by full name.\n  rpc GetRepositoryByFullName(GetRepositoryByFullNameRequest) returns (GetRepositoryByFullNameResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListRepositories lists all repositories.\n  rpc ListRepositories(ListRepositoriesRequest) returns (ListRepositoriesResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListUserRepositories lists all repositories belonging to a user.\n  rpc ListUserRepositories(ListUserRepositoriesRequest) returns (ListUserRepositoriesResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListRepositoriesUserCanAccess lists all repositories a user can access.\n  rpc ListRepositoriesUserCanAccess(ListRepositoriesUserCanAccessRequest) returns (ListRepositoriesUserCanAccessResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListOrganizationRepositories lists all repositories for an organization.\n  rpc ListOrganizationRepositories(ListOrganizationRepositoriesRequest) returns (ListOrganizationRepositoriesResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // CreateRepositoryByFullName creates a new repository by full name.\n  rpc CreateRepositoryByFullName(CreateRepositoryByFullNameRequest) returns (CreateRepositoryByFullNameResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // DeleteRepository deletes a repository.\n  rpc DeleteRepository(DeleteRepositoryRequest) returns (DeleteRepositoryResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // DeleteRepositoryByFullName deletes a repository by full name.\n  rpc DeleteRepositoryByFullName(DeleteRepositoryByFullNameRequest) returns (DeleteRepositoryByFullNameResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // DeprecateRepositoryByName deprecates the repository.\n  rpc DeprecateRepositoryByName(DeprecateRepositoryByNameRequest) returns (DeprecateRepositoryByNameResponse);\n  // UndeprecateRepositoryByName makes the repository not deprecated and removes any deprecation_message.\n  rpc UndeprecateRepositoryByName(UndeprecateRepositoryByNameRequest) returns (UndeprecateRepositoryByNameResponse);\n  // GetRepositoriesByFullName gets repositories by full name. Response order is unspecified.\n  // Errors if any of the repositories don't exist or the caller does not have access to any of the repositories.\n  rpc GetRepositoriesByFullName(GetRepositoriesByFullNameRequest) returns (GetRepositoriesByFullNameResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // SetRepositoryContributor sets the role of a user in the repository.\n  rpc SetRepositoryContributor(SetRepositoryContributorRequest) returns (SetRepositoryContributorResponse);\n  // ListRepositoryContributors returns the list of contributors that has an explicit role against the repository.\n  // This does not include users who have implicit roles against the repository, unless they have also been\n  // assigned a role explicitly.\n  rpc ListRepositoryContributors(ListRepositoryContributorsRequest) returns (ListRepositoryContributorsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetRepositorySettings gets the settings of a repository.\n  rpc GetRepositorySettings(GetRepositorySettingsRequest) returns (GetRepositorySettingsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UpdateRepositorySettingsByName updates the settings of a repository.\n  rpc UpdateRepositorySettingsByName(UpdateRepositorySettingsByNameRequest) returns (UpdateRepositorySettingsByNameResponse);\n  // GetRepositoriesMetadata gets the metadata of the repositories in the request, the length of repositories in the\n  // request should match the length of the metadata in the response, and the order of repositories in the response\n  // should match the order of the metadata in the request.\n  rpc GetRepositoriesMetadata(GetRepositoriesMetadataRequest) returns (GetRepositoriesMetadataResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetRepositoryDependencyDOTString gets the dependency graph DOT string for the repository.\n  rpc GetRepositoryDependencyDOTString(GetRepositoryDependencyDOTStringRequest) returns (GetRepositoryDependencyDOTStringResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // AddRepositoryGroup adds an IdP Group to the repository.\n  //\n  // Only repositories owned by an organization can have groups.\n  rpc AddRepositoryGroup(AddRepositoryGroupRequest) returns (AddRepositoryGroupResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // UpdateRepositoryGroup updates an IdP Group for the repository.\n  rpc UpdateRepositoryGroup(UpdateRepositoryGroupRequest) returns (UpdateRepositoryGroupResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // RemoveRepositoryGroup removes an IdP Group from the repository.\n  rpc RemoveRepositoryGroup(RemoveRepositoryGroupRequest) returns (RemoveRepositoryGroupResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\nmessage GetRepositoriesByFullNameRequest {\n  // minimum length is 1\n  // maximum length is 250\n  repeated string full_names = 1;\n}\n\nmessage GetRepositoriesByFullNameResponse {\n  repeated Repository repositories = 1;\n}\n\nmessage GetRepositoryRequest {\n  string id = 1;\n}\n\nmessage GetRepositoryResponse {\n  Repository repository = 1;\n  RepositoryCounts counts = 2;\n}\n\nmessage GetRepositoryByFullNameRequest {\n  string full_name = 1;\n}\n\nmessage GetRepositoryByFullNameResponse {\n  Repository repository = 1;\n  RepositoryCounts counts = 2;\n}\n\nmessage ListRepositoriesRequest {\n  uint32 page_size = 1;\n  // The first page is returned if this is empty.\n  string page_token = 2;\n  bool reverse = 3;\n}\n\nmessage ListRepositoriesResponse {\n  repeated Repository repositories = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage ListUserRepositoriesRequest {\n  // The ID of the user whose repositories should be listed.\n  string user_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n  bool reverse = 4;\n}\n\nmessage ListUserRepositoriesResponse {\n  repeated Repository repositories = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage ListRepositoriesUserCanAccessRequest {\n  uint32 page_size = 1;\n  // The first page is returned if this is empty.\n  string page_token = 2;\n  bool reverse = 3;\n}\n\nmessage ListRepositoriesUserCanAccessResponse {\n  repeated Repository repositories = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage ListOrganizationRepositoriesRequest {\n  // The ID of the organization whose repositories should be listed.\n  string organization_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n  bool reverse = 4;\n}\n\nmessage ListOrganizationRepositoriesResponse {\n  repeated Repository repositories = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage CreateRepositoryByFullNameRequest {\n  // Must be unique across repositories.\n  string full_name = 1;\n  Visibility visibility = 2;\n}\n\nmessage CreateRepositoryByFullNameResponse {\n  Repository repository = 1;\n}\n\nmessage DeleteRepositoryRequest {\n  string id = 1;\n}\n\nmessage DeleteRepositoryResponse {}\n\nmessage DeleteRepositoryByFullNameRequest {\n  string full_name = 1;\n}\n\nmessage DeleteRepositoryByFullNameResponse {}\n\nmessage DeprecateRepositoryByNameRequest {\n  string owner_name = 1;\n  string repository_name = 2;\n  // A message shown along with the deprecation warning for this repository.\n  // It must be a utf8 encoded string containing 256 or fewer characters.\n  string deprecation_message = 3;\n}\n\nmessage DeprecateRepositoryByNameResponse {\n  Repository repository = 1;\n}\n\nmessage UndeprecateRepositoryByNameRequest {\n  string owner_name = 1;\n  string repository_name = 2;\n}\n\nmessage UndeprecateRepositoryByNameResponse {\n  Repository repository = 1;\n}\n\nmessage SetRepositoryContributorRequest {\n  // The ID of the repository for which the user's role will be set.\n  string repository_id = 1;\n  // The ID of the user whose role will be set.\n  string user_id = 2;\n  // The role to assign to the user.\n  // Setting UNSPECIFIED means removing the user's role.\n  RepositoryRole repository_role = 3;\n}\n\nmessage SetRepositoryContributorResponse {}\n\nmessage ListRepositoryContributorsRequest {\n  string repository_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n  bool reverse = 4;\n}\n\nmessage ListRepositoryContributorsResponse {\n  repeated RepositoryContributor users = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage GetRepositorySettingsRequest {\n  // The ID of the repository for which to get the settings.\n  string repository_id = 1;\n}\n\nmessage GetRepositorySettingsResponse {\n  // The number of outside contributors in the repository,\n  // excluding owning-organization's members that have an explicit role.\n  uint32 contributors_count = 1;\n}\n\nmessage UpdateRepositorySettingsByNameRequest {\n  string owner_name = 1;\n  string repository_name = 2;\n  // optional, update to visibility will only be made if this is specified.\n  Visibility visibility = 3;\n  // optional, update to description will only be made when this is present\n  optional string description = 4;\n  // optional, update to url will only be made when this is present\n  optional string url = 5;\n  // optional, update to default_branch will only be made when this is present\n  optional string default_branch = 6;\n}\n\nmessage UpdateRepositorySettingsByNameResponse {}\n\nmessage GetRepositoriesMetadataRequest {\n  // The list of repository IDs to request the metadata.\n  repeated string ids = 1;\n}\n\nmessage GetRepositoriesMetadataResponse {\n  repeated RepositoryMetadata metadata = 1;\n}\n\nmessage GetRepositoryDependencyDOTStringRequest {\n  // The owner of the BSR repository.\n  string owner = 1;\n  // The name of the BSR repository.\n  string repository = 2;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 3;\n}\n\nmessage GetRepositoryDependencyDOTStringResponse {\n  // The string DOT representation of the dependency graph for the repository.\n  //\n  // DOT language reference: https://graphviz.org/doc/info/lang.html\n  string dot_string = 1;\n}\n\nmessage AddRepositoryGroupRequest {\n  // The ID of the repository for which to add the group.\n  string repository_id = 1;\n  // The name of the group to add.\n  string group_name = 2;\n  // The role to associate with any user who is added to the repository via this group.\n  //\n  // Any user who maps to this repository via this group will be granted this role. If no role is\n  // set, the user will be granted the containing-organization's base repository role.\n  RepositoryRole role_override = 3;\n}\n\nmessage AddRepositoryGroupResponse {}\n\nmessage UpdateRepositoryGroupRequest {\n  // The ID of the repository to which this group belongs.\n  string repository_id = 1;\n  // The name of the group to update.\n  string group_name = 2;\n  // The role to associate with this repository group.\n  //\n  // Setting this to 'UNSPECIFIED' will remove the override. Leaving this unset will not update this\n  // property.\n  optional RepositoryRole role_override = 3;\n}\n\nmessage UpdateRepositoryGroupResponse {}\n\nmessage RemoveRepositoryGroupRequest {\n  // The ID of the repository for which to remove the group.\n  string repository_id = 1;\n  // The name of the group to remove.\n  string group_name = 2;\n}\n\nmessage RemoveRepositoryGroupResponse {}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/repository_branch.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage RepositoryBranch {\n  // primary key, unique.\n  // branches are based on labels, so when a branch is pushed to, the ID will point to the\n  // updated entry in the labels table.\n  string id = 1;\n  // The name of the repository branch.\n  string name = 2;\n  // The name of the latest commit on the branch.\n  string latest_commit_name = 3;\n  // is_main_branch denotes whether this branch is considered the main branch of the repository.\n  bool is_main_branch = 4;\n  // The last update time of the branch.\n  google.protobuf.Timestamp last_update_time = 5;\n  // The ID of the user who updated the branch.\n  string last_update_user_id = 6;\n  // The author name of the most recent associated git commit of the branch. May be an empty string\n  // if no commit in the branch history contains any associated git commit.\n  string last_update_git_author_name = 7;\n  // The git commit hash of the most recent associated git commit of the branch. May be an empty\n  // string if no commit in the branch history contains any associated git commit.\n  string last_update_git_commit_hash = 8;\n}\n\n// RepositoryBranchService is the Repository branch service.\nservice RepositoryBranchService {\n  // GetRepositoryBranch gets a repository branch associated with a Repository by name\n  rpc GetRepositoryBranch(GetRepositoryBranchRequest) returns (GetRepositoryBranchResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListRepositoryBranches lists the repository branches associated with a Repository.\n  rpc ListRepositoryBranches(ListRepositoryBranchesRequest) returns (ListRepositoryBranchesResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListRepositoryBranchesByReference lists the repository branches associated with a Repository,\n  // filtered by a reference.\n  rpc ListRepositoryBranchesByReference(ListRepositoryBranchesByReferenceRequest) returns (ListRepositoryBranchesByReferenceResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetCurrentDefaultBranch returns the branch that is mapped to the repository's `default_branch` field.\n  rpc GetCurrentDefaultBranch(GetCurrentDefaultBranchRequest) returns (GetCurrentDefaultBranchResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetRepositoryBranchRequest {\n  // The ID of the repository for which the branch is requested.\n  string repository_id = 1;\n  // The name of the branch to get.\n  string name = 2;\n}\n\nmessage GetRepositoryBranchResponse {\n  RepositoryBranch branch = 1;\n}\n\nmessage ListRepositoryBranchesRequest {\n  // The ID of the repository whose branches should be listed.\n  string repository_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n}\n\nmessage ListRepositoryBranchesResponse {\n  repeated RepositoryBranch repository_branches = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage ListRepositoryBranchesByReferenceRequest {\n  // The ID of the repository whose branches should be listed.\n  string repository_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n  // The reference by which to filter the returned branches.\n  oneof reference {\n    // The name of a BSR commit. This will filter the branches to only those that include the commit.\n    string commit_name = 4;\n    // The hash of a VCS commit. This will filter the branches to only those that include the commit\n    // associated with the VCS hash.\n    string vcs_commit_hash = 5;\n  }\n}\n\nmessage ListRepositoryBranchesByReferenceResponse {\n  repeated RepositoryBranch repository_branches = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\nmessage GetCurrentDefaultBranchRequest {\n  // The ID of the repository whose current default branch is returned.\n  string repository_id = 1;\n}\n\nmessage GetCurrentDefaultBranchResponse {\n  RepositoryBranch current_default_branch = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/repository_commit.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/repository_tag.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage RepositoryCommit {\n  // primary key, unique, immutable\n  string id = 1;\n  // immutable\n  google.protobuf.Timestamp create_time = 2;\n  // The digest of the commit.\n  string digest = 3;\n  // The name of the commit.\n  // This is what is referenced by users.\n  // Unique, immutable.\n  string name = 4;\n  // The branch on which this commit was created.\n  string branch = 5;\n  reserved 6;\n  reserved \"commit_sequence_id\";\n  // The username of the user who authored this commit.\n  string author = 7;\n  // The tags associated with this commit\n  repeated buf.alpha.registry.v1alpha1.RepositoryTag tags = 8;\n  // The commit's draft name, if it is a draft commit.\n  string draft_name = 9;\n  // spdx_license_id is the license of the commit, based on the\n  // license file pushed, which should be one of the identifier defined in\n  // https://spdx.org/licenses, and will be not set if the license file is not\n  // presented or cannot be classified into a known license.\n  string spdx_license_id = 10;\n  // The manifest digest of the commit.\n  string manifest_digest = 11;\n  // Number of tags associated with the commit.\n  int64 tag_count = 12;\n  // Number of git commits with associated with the BSR commit.\n  int64 git_commits_count = 13;\n  // The b5 digest of the commit.\n  string b5_digest = 14;\n}\n\n// RepositoryCommitService is the Repository commit service.\nservice RepositoryCommitService {\n  // ListRepositoryCommitsByBranch lists the repository commits associated\n  // with a repository branch on a repository, ordered by their create time.\n  rpc ListRepositoryCommitsByBranch(ListRepositoryCommitsByBranchRequest) returns (ListRepositoryCommitsByBranchResponse) {\n    // ListRepositoryCommitsByBranch has been deprecated, use\n    // ListRepositoryCommitsByReference instead.\n    option deprecated = true;\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n\n  // ListRepositoryCommitsByReference returns repository commits up-to and including\n  // the provided reference.\n  rpc ListRepositoryCommitsByReference(ListRepositoryCommitsByReferenceRequest) returns (ListRepositoryCommitsByReferenceResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetRepositoryCommitByReference returns the repository commit matching\n  // the provided reference, if it exists.\n  rpc GetRepositoryCommitByReference(GetRepositoryCommitByReferenceRequest) returns (GetRepositoryCommitByReferenceResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListRepositoryDraftCommits lists draft commits in a repository.\n  rpc ListRepositoryDraftCommits(ListRepositoryDraftCommitsRequest) returns (ListRepositoryDraftCommitsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DeleteRepositoryDraftCommit deletes a draft.\n  rpc DeleteRepositoryDraftCommit(DeleteRepositoryDraftCommitRequest) returns (DeleteRepositoryDraftCommitResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\nmessage ListRepositoryCommitsByBranchRequest {\n  // The owner of the repository which the repository branch belongs to.\n  string repository_owner = 1;\n  // The name of the repository which the repository branch belongs to.\n  string repository_name = 2;\n  // The name of the repository branch whose commits should be listed.\n  string repository_branch_name = 3;\n  uint32 page_size = 4;\n  // For now this is the id of he last commit returned in the previous page.\n  // This is directly set by the frontend when listing track history starting with a\n  // specific commit. If we page_token to be anything other than a commit id\n  // we need to change the frontend as well.\n  string page_token = 5;\n  bool reverse = 6;\n}\n\nmessage ListRepositoryCommitsByBranchResponse {\n  repeated RepositoryCommit repository_commits = 1;\n  string next_page_token = 2;\n}\n\nmessage ListRepositoryCommitsByReferenceRequest {\n  // The owner of the repository which the repository reference belongs to.\n  string repository_owner = 1;\n  // The name of the repository which the repository reference belongs to.\n  string repository_name = 2;\n  // The optional reference used to resolve repository commits. Can be a tag or commit.\n  // If unspecified, will use the repository's default_branch.\n  string reference = 3;\n  uint32 page_size = 4;\n  string page_token = 5;\n  bool reverse = 6;\n}\n\nmessage ListRepositoryCommitsByReferenceResponse {\n  repeated RepositoryCommit repository_commits = 1;\n  string next_page_token = 2;\n}\n\nmessage GetRepositoryCommitByReferenceRequest {\n  // The owner of the repository which the reference belongs to.\n  string repository_owner = 1;\n  // The name of the repository which the reference belongs to.\n  string repository_name = 2;\n  // The optional reference that should be resolved to a commit. Can be a tag or commit.\n  // If unspecified, will use the repository's default_branch.\n  string reference = 3;\n}\n\nmessage GetRepositoryCommitByReferenceResponse {\n  RepositoryCommit repository_commit = 1;\n}\n\nmessage ListRepositoryDraftCommitsRequest {\n  // The owner of the repository which the repository branch belongs to.\n  string repository_owner = 1;\n  // The name of the repository which the repository branch belongs to.\n  string repository_name = 2;\n  uint32 page_size = 3;\n  string page_token = 4;\n  // By default, draft commits are ordered by last update time descending.\n  // Reverse orders them ascending.\n  bool reverse = 5;\n}\n\nmessage ListRepositoryDraftCommitsResponse {\n  // Each commit will have draft_name set.\n  repeated RepositoryCommit repository_commits = 1;\n  string next_page_token = 2;\n}\n\nmessage DeleteRepositoryDraftCommitRequest {\n  // The owner of the repository which the repository branch belongs to.\n  string repository_owner = 1;\n  // The name of the repository which the repository branch belongs to.\n  string repository_name = 2;\n  // The name of the draft to delete.\n  string draft_name = 3;\n}\n\nmessage DeleteRepositoryDraftCommitResponse {}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/repository_tag.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage RepositoryTag {\n  // primary key, unique.\n  // tags are based on labels, so if a label has been moved, the ID will point to the\n  // updated entry in the labels table.\n  string id = 1;\n  // immutable\n  google.protobuf.Timestamp create_time = 2;\n  // We reserve field number '3' for the update_time.\n  // google.protobuf.Timestamp update_time = 3;\n  // The name of the repository tag, e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n  string name = 4;\n  // The name of the commit this tag belongs to.\n  string commit_name = 5;\n  // The username of the author of the tag.\n  string author = 6;\n}\n\n// RepositoryTagService is the Repository tag service.\nservice RepositoryTagService {\n  // GetRepositoryTag gets an existing repository tag.\n  rpc GetRepositoryTag(GetRepositoryTagRequest) returns (GetRepositoryTagResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // CreateRepositoryTag creates a new repository tag.\n  rpc CreateRepositoryTag(CreateRepositoryTagRequest) returns (CreateRepositoryTagResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // UpdateRepositoryTag update an existing repository tag.\n  rpc UpdateRepositoryTag(UpdateRepositoryTagRequest) returns (UpdateRepositoryTagResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // ListRepositoryTags lists the repository tags associated with a Repository.\n  rpc ListRepositoryTags(ListRepositoryTagsRequest) returns (ListRepositoryTagsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListRepositoryTagsForReference lists the repository tags associated with a repository\n  // reference name.\n  rpc ListRepositoryTagsForReference(ListRepositoryTagsForReferenceRequest) returns (ListRepositoryTagsForReferenceResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetRepositoryTagRequest {\n  // The ID of the repository this tag belongs to.\n  string repository_id = 1;\n  // The name of the repository tag to get, e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n  string name = 2;\n}\n\nmessage GetRepositoryTagResponse {\n  RepositoryTag repository_tag = 1;\n}\n\nmessage CreateRepositoryTagRequest {\n  // The ID of the repository this tag should be created on.\n  string repository_id = 1;\n  // The name of the repository tag, e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n  string name = 2;\n  // The name of the commit this tag should be created for.\n  string commit_name = 3;\n}\n\nmessage CreateRepositoryTagResponse {\n  RepositoryTag repository_tag = 1;\n}\n\nmessage UpdateRepositoryTagRequest {\n  // The ID of the repository this tag belongs to.\n  string repository_id = 1;\n  // The name of the repository tag, to update e.g. \"6e2e7f24718a76caa32a80d0e2b1841ef2c61403\".\n  string name = 2;\n  // The name of the commit this tag should reference.\n  optional string commit_name = 3;\n}\n\nmessage UpdateRepositoryTagResponse {\n  RepositoryTag repository_tag = 1;\n}\n\nmessage ListRepositoryTagsRequest {\n  // The ID of the repository whose tags should be listed.\n  string repository_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n  bool reverse = 4;\n}\n\nmessage ListRepositoryTagsResponse {\n  repeated RepositoryTag repository_tags = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage ListRepositoryTagsForReferenceRequest {\n  // The ID of the repository whose tags should be listed.\n  string repository_id = 1;\n  // Optional reference (if unspecified, will use the repository's default_branch).\n  string reference = 2;\n  uint32 page_size = 3;\n  // The first page is returned if this is empty.\n  string page_token = 4;\n  bool reverse = 5;\n}\n\nmessage ListRepositoryTagsForReferenceResponse {\n  repeated RepositoryTag repository_tags = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/resolve.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/module/v1alpha1/module.proto\";\nimport \"buf/alpha/registry/v1alpha1/module.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// ResolveService is the resolve service.\n//\n// This is the public service.\nservice ResolveService {\n  // GetModulePins finds all the latest digests and respective dependencies of\n  // the provided module references and picks a set of distinct modules pins.\n  //\n  // Note that module references with commits should still be passed to this function\n  // to make sure this function can do dependency resolution.\n  //\n  // This function also deals with tiebreaking what ModulePin wins for the same repository.\n  rpc GetModulePins(GetModulePinsRequest) returns (GetModulePinsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetSDKInfo takes a module, plugin, and optionally SDK version, and returns the SDK\n  // info. The SDK info includes the module, module commit, module commit create time, plugin,\n  // plugin version, plugin revision, and the SDK version string\n  // for the SDK.\n  //\n  // If the module reference and/or plugin version is included, then the SDK at the\n  // specified version will be resolved. If the SDK version is included, then it will be\n  // validated with the module and plugin information provided.\n  //\n  // This replaces the need for all subsequent RPCs, which requires the caller to resolve\n  // the registry type first. Instead, the registry type will be resolved based on the plugin\n  // information provided.\n  rpc GetSDKInfo(GetSDKInfoRequest) returns (GetSDKInfoResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetGoVersion resolves the given plugin and module references to a version.\n  rpc GetGoVersion(GetGoVersionRequest) returns (GetGoVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetSwiftVersion resolves the given plugin and module references to a version.\n  rpc GetSwiftVersion(GetSwiftVersionRequest) returns (GetSwiftVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetMavenVersion resolves the given plugin and module references to a version.\n  rpc GetMavenVersion(GetMavenVersionRequest) returns (GetMavenVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetNPMVersion resolves the given plugin and module references to a version.\n  rpc GetNPMVersion(GetNPMVersionRequest) returns (GetNPMVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetPythonVersion resolves the given plugin and module references to a version.\n  rpc GetPythonVersion(GetPythonVersionRequest) returns (GetPythonVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetCargoVersion resolves the given plugin and module references to a version.\n  rpc GetCargoVersion(GetCargoVersionRequest) returns (GetCargoVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetNugetVersion resolves the given plugin and module references to a version.\n  rpc GetNugetVersion(GetNugetVersionRequest) returns (GetNugetVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetCmakeVersion resolves the given plugin and module references to a version.\n  rpc GetCmakeVersion(GetCmakeVersionRequest) returns (GetCmakeVersionResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetModulePinsRequest {\n  repeated buf.alpha.module.v1alpha1.ModuleReference module_references = 1;\n\n  // current_module_pins allows for partial dependency updates by letting clients\n  // send a request with the pins for their current module and only the\n  // identities of the dependencies they want to update in module_references.\n  //\n  // When resolving, if a client supplied module pin is:\n  // - in the transitive closure of pins resolved from the module_references,\n  //   the client supplied module pin will be an extra candidate for tie\n  //   breaking.\n  // - NOT in the in the transitive closure of pins resolved from the\n  //   module_references, it will be returned as is.\n  repeated buf.alpha.module.v1alpha1.ModulePin current_module_pins = 2;\n}\n\nmessage GetModulePinsResponse {\n  repeated buf.alpha.module.v1alpha1.ModulePin module_pins = 1;\n}\n\n// LocalResolveService is the local resolve service.\n//\n// This is called by ResolveService implementations, and is enterprise.\nservice LocalResolveService {\n  // GetLocalModulePins gets the latest pins for the specified local module references.\n  // It also includes all of the modules transitive dependencies for the specified references.\n  //\n  // We want this for two reasons:\n  //\n  //  1. It makes it easy to say \"we know we're looking for owner/repo on this specific remote\".\n  //     While we could just do this in GetModulePins by being aware of what our remote is\n  //     (something we probably still need to know, DNS problems aside, which are more\n  //     theoretical), this helps.\n  //  2. Having a separate method makes us able to say \"do not make decisions about what\n  //     wins between competing pins for the same repo\". This should only be done in\n  //     GetModulePins, not in this function, i.e. only done at the top level.\n  rpc GetLocalModulePins(GetLocalModulePinsRequest) returns (GetLocalModulePinsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetLocalModulePinsRequest {\n  repeated buf.alpha.registry.v1alpha1.LocalModuleReference local_module_references = 1;\n}\n\nenum ResolvedReferenceType {\n  reserved 4;\n  reserved \"RESOLVED_REFERENCE_TYPE_TRACK\";\n\n  RESOLVED_REFERENCE_TYPE_UNSPECIFIED = 0;\n  RESOLVED_REFERENCE_TYPE_COMMIT = 1;\n  RESOLVED_REFERENCE_TYPE_BRANCH = 2;\n  RESOLVED_REFERENCE_TYPE_TAG = 3;\n  RESOLVED_REFERENCE_TYPE_DRAFT = 5;\n}\n\nmessage LocalModuleResolveResult {\n  reserved 4;\n  reserved \"is_bsr_head\";\n\n  // A copy of the reference that was resolved.\n  buf.alpha.registry.v1alpha1.LocalModuleReference reference = 1;\n  // The pin the reference resolved to.\n  buf.alpha.registry.v1alpha1.LocalModulePin pin = 2;\n  // The type the reference resolved as.\n  ResolvedReferenceType resolved_reference_type = 3;\n}\n\nmessage GetLocalModulePinsResponse {\n  repeated LocalModuleResolveResult local_module_resolve_results = 1;\n\n  // dependencies are the dependencies of the LocalModulePins.\n  //\n  // This includes the transitive deps.\n  repeated buf.alpha.module.v1alpha1.ModulePin dependencies = 2;\n}\n\nmessage GetGoVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetGoVersionResponse {\n  // version is the resolved version to be used with the go module proxy.\n  string version = 1;\n}\n\nmessage GetMavenVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetMavenVersionResponse {\n  // version is the resolved version to be used with the maven repository.\n  string version = 1;\n}\n\nmessage GetNPMVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetNPMVersionResponse {\n  // version is the resolved version to be used with the npm registry.\n  string version = 1;\n}\n\nmessage GetSwiftVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetSwiftVersionResponse {\n  // version is the resolved version to be used with the swift registry.\n  string version = 1;\n}\n\nmessage GetPythonVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetPythonVersionResponse {\n  // version is the resolved version to be used with the python repository.\n  string version = 1;\n}\n\nmessage GetCargoVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetCargoVersionResponse {\n  // version is the resolved version to be used with the cargo registry.\n  string version = 1;\n}\n\nmessage GetNugetVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetNugetVersionResponse {\n  // version is the resolved version to be used with the nuget registry.\n  string version = 1;\n}\n\nmessage GetCmakeVersionRequest {\n  // The plugin reference to resolve.\n  GetRemotePackageVersionPlugin plugin_reference = 1;\n  // The module reference to resolve.\n  LocalModuleReference module_reference = 2;\n}\n\nmessage GetCmakeVersionResponse {\n  // version is the resolved version to be used with the cmake registry.\n  string version = 1;\n}\n\n// GetRemotePackageVersionPlugin is a plugin reference.\n// If the version is empty, this is a reference to the latest version.\nmessage GetRemotePackageVersionPlugin {\n  // The owner of the plugin.\n  // example: bufbuild\n  string owner = 1;\n  // The name of the plugin.\n  // example: connect-go\n  string name = 2;\n  // The version of the plugin.\n  // If empty, this is a reference to the latest version.\n  // example: v1.0.0\n  string version = 3;\n  // The revision of the plugin version.\n  // example: 1\n  uint32 revision = 4;\n}\n\nmessage GetSDKInfoRequest {\n  // The local module reference for the SDK.\n  LocalModuleReference module_reference = 1;\n  // The plugin reference for the SDK.\n  GetRemotePackageVersionPlugin plugin_reference = 2;\n  // The SDK version string. If this is not provided, then it will be resolved using the module\n  // and plugin references provided.\n  string sdk_version = 3;\n}\n\nmessage GetSDKInfoResponse {\n  // ModuleInfo is the parsed module information for the SDK.\n  message ModuleInfo {\n    // The module owner name.\n    string owner = 1;\n    // The module name.\n    string name = 2;\n    // The module commit for the SDK.\n    string commit = 3;\n    // The module commit create time. This will always be in UTC.\n    google.protobuf.Timestamp module_commit_create_time = 4;\n  }\n  // PluginInfo is the parsed plugin information for the SDK.\n  message PluginInfo {\n    // The plugin owner.\n    string owner = 1;\n    // The plugin name.\n    string name = 2;\n    // The semver plugin version. This will always be valid semver.\n    string version = 3;\n    // The plugin revision.\n    uint32 plugin_revision = 4;\n  }\n  ModuleInfo module_info = 1;\n  PluginInfo plugin_info = 2;\n  // The SDK version string. The format is based on the SDK registry supported by the\n  // provided plugin.\n  string sdk_version = 3;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/resource.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/plugin_curation.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository.proto\";\n\nmessage Resource {\n  oneof resource {\n    Repository repository = 1;\n    CuratedPlugin plugin = 2;\n  }\n}\n\n// ResourceService manages resources.\nservice ResourceService {\n  // GetResourceByName takes a resource name and returns the\n  // resource either as a repository or a plugin.\n  rpc GetResourceByName(GetResourceByNameRequest) returns (GetResourceByNameResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage GetResourceByNameRequest {\n  // Owner of the requested resource.\n  string owner = 1;\n  // Name of the requested resource.\n  string name = 2;\n}\n\nmessage GetResourceByNameResponse {\n  Resource resource = 1;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/role.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\n// The roles that users can have in a Server.\nenum ServerRole {\n  SERVER_ROLE_UNSPECIFIED = 0;\n  SERVER_ROLE_ADMIN = 1;\n  SERVER_ROLE_MEMBER = 2;\n}\n\n// The roles that users can have in a Organization.\nenum OrganizationRole {\n  ORGANIZATION_ROLE_UNSPECIFIED = 0;\n  ORGANIZATION_ROLE_OWNER = 1;\n  ORGANIZATION_ROLE_ADMIN = 2;\n  ORGANIZATION_ROLE_MEMBER = 3;\n  ORGANIZATION_ROLE_MACHINE = 4;\n}\n\n// The source of a user's role in an Organization.\nenum OrganizationRoleSource {\n  ORGANIZATION_ROLE_SOURCE_UNSPECIFIED = 0;\n  ORGANIZATION_ROLE_SOURCE_DIRECT = 1;\n  ORGANIZATION_ROLE_SOURCE_JIT = 2;\n  ORGANIZATION_ROLE_SOURCE_IDP_GROUP = 3;\n}\n\n// The roles that users can have for a Repository.\nenum RepositoryRole {\n  REPOSITORY_ROLE_UNSPECIFIED = 0;\n  REPOSITORY_ROLE_OWNER = 1;\n  REPOSITORY_ROLE_ADMIN = 2;\n  REPOSITORY_ROLE_WRITE = 3;\n  REPOSITORY_ROLE_READ = 4;\n  REPOSITORY_ROLE_LIMITED_WRITE = 5;\n}\n\n// The source of a user's role in a Repository.\nenum RepositoryRoleSource {\n  REPOSITORY_ROLE_SOURCE_UNSPECIFIED = 0;\n  REPOSITORY_ROLE_SOURCE_DIRECT = 1;\n  REPOSITORY_ROLE_SOURCE_IDP_GROUP = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/schema.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/descriptor.proto\";\n\n// Provides endpoints for downloading dynamic schemas and for using schemas\n// in validation and data transformation functions.\nservice SchemaService {\n  // GetSchema allows the caller to download a schema for one or more requested\n  // types, RPC services, or RPC methods.\n  rpc GetSchema(GetSchemaRequest) returns (GetSchemaResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n\n  // ConvertMessage allows the caller to convert a given message data blob from\n  // one format to another by referring to a type schema for the blob.\n  rpc ConvertMessage(ConvertMessageRequest) returns (ConvertMessageResponse);\n  // TODO: move this to ConvertService and remove its existing, unused endpoint.\n\n  // TODO: batch or streaming endpoint, for more efficient conversion of many messages\n}\n\nmessage GetSchemaRequest {\n  // The owner of the repo that contains the schema to retrieve (a user name or\n  // organization name).\n  string owner = 1;\n  // The name of the repo that contains the schema to retrieve.\n  string repository = 2;\n  // Optional version of the repo. If unspecified, defaults to latest version on\n  // the repo's \"main\" branch.\n  string version = 3;\n\n  // Zero or more types names. The names may refer to messages, enums, services,\n  // methods, or extensions. All names must be fully-qualified. If any name\n  // is unknown, the request will fail and no schema will be returned.\n  //\n  // If no names are provided, the full schema for the module is returned.\n  // Otherwise, the resulting schema contains only the named elements and all of\n  // their dependencies. This is enough information for the caller to construct\n  // a dynamic message for any requested message types or to dynamically invoke\n  // an RPC for any requested methods or services.\n  repeated string types = 4;\n\n  // If present, this is a commit that the client already has cached. So if the\n  // given module version resolves to this same commit, the server should not\n  // send back any descriptors since the client already has them.\n  //\n  // This allows a client to efficiently poll for updates: after the initial RPC\n  // to get a schema, the client can cache the descriptors and the resolved\n  // commit. It then includes that commit in subsequent requests in this field,\n  // and the server will only reply with a schema (and new commit) if/when the\n  // resolved commit changes.\n  string if_not_commit = 5;\n\n  // If true, the returned schema will not include extension definitions for custom\n  // options that appear on schema elements. When filtering the schema based on the\n  // given element names, options on all encountered elements are usually examined\n  // as well. But that is not the case if excluding custom options.\n  //\n  // This flag is ignored if element_names is empty as the entire schema is always\n  // returned in that case.\n  bool exclude_custom_options = 6;\n\n  // If true, the returned schema will not include known extensions for extendable\n  // messages for schema elements. If exclude_custom_options is true, such extensions\n  // may still be returned if the applicable descriptor options type is part of the\n  // requested schema.\n  //\n  // This flag is ignored if element_names is empty as the entire schema is always\n  // returned in that case.\n  bool exclude_known_extensions = 7;\n\n  // TODO: consider providing a way for client to indicate what files the server\n  //   can exclude, to reduce response size when caller already knows things\n  //   (for example, usually no need to include google/protobuf/descriptor.proto)\n}\n\nmessage GetSchemaResponse {\n  // The resolved version of the schema. If the requested version was a commit,\n  // this value is the same as that. If the requested version referred to a tag\n  // or branch, this is the commit for that tag or latest commit for that\n  // branch. If the request did not include any version, this is the latest\n  // version for the module's main branch.\n  string commit = 1;\n  // The schema, which is a set of file descriptors that include the requested elements\n  // and their dependencies.\n  google.protobuf.FileDescriptorSet schema_files = 2;\n}\n\nmessage ConvertMessageRequest {\n  // The owner of the repo that contains the schema to retrieve (a user name or\n  // organization name).\n  string owner = 1;\n  // The name of the repo that contains the schema to retrieve.\n  string repository = 2;\n  // Optional version of the repo. This can be a tag or branch name or a commit.\n  // If unspecified, defaults to latest version on the repo's \"main\" branch.\n  string version = 3;\n\n  // The fully-qualified name of the message. Required.\n  string message_name = 4;\n\n  // The format of the input data. Required.\n  Format input_format = 5;\n\n  // The input data that is to be converted. Required. This must be\n  // a valid encoding of type indicated by message_name in the format\n  // indicated by input_format.\n  bytes input_data = 6;\n\n  // If true, any unresolvable fields in the input are discarded. For\n  // formats other than FORMAT_BINARY, this means that the operation\n  // will fail if the input contains unrecognized field names. For\n  // FORMAT_BINARY, unrecognized fields can be retained and possibly\n  // included in the reformatted output (depending on the requested\n  // output format).\n  bool discard_unknown = 7;\n\n  oneof output_format {\n    BinaryOutputOptions output_binary = 8;\n    JSONOutputOptions output_json = 9;\n    TextOutputOptions output_text = 10;\n  }\n}\n\nenum Format {\n  FORMAT_UNSPECIFIED = 0;\n\n  FORMAT_BINARY = 1;\n  FORMAT_JSON = 2;\n  FORMAT_TEXT = 3;\n}\n\nmessage BinaryOutputOptions {}\n\nmessage JSONOutputOptions {\n  // Enum fields will be emitted as numeric values. If false (the default), enum\n  // fields are emitted as strings that are the enum values' names.\n  bool use_enum_numbers = 3;\n  // Includes fields that have their default values. This applies only to fields\n  // defined in proto3 syntax that have no explicit \"optional\" keyword. Other\n  // optional fields will be included if present in the input data.\n  bool include_defaults = 4;\n}\n\nmessage TextOutputOptions {\n  // If true and the input data includes unrecognized fields, the unrecognized\n  // fields will be preserved in the text output (using field numbers and raw\n  // values).\n  bool include_unrecognized = 2;\n}\n\nmessage ConvertMessageResponse {\n  // The resolved version of the schema. If the requested version was a commit,\n  // this value is the same as that. If the requested version referred to a tag\n  // or branch, this is the commit for that tag or latest commit for that\n  // branch. If the request did not include any version, this is the latest\n  // version for the module's main branch.\n  string commit = 1;\n  // The reformatted data.\n  bytes output_data = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/scim_token.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage SCIMToken {\n  string id = 1;\n  google.protobuf.Timestamp create_time = 2;\n  google.protobuf.Timestamp expire_time = 3;\n}\n\n// TokenSCIMService is the SCIM Token service.\nservice SCIMTokenService {\n  // CreateToken creates a new token suitable for authentication to the SCIM API.\n  //\n  // This method requires authentication.\n  rpc CreateSCIMToken(CreateSCIMTokenRequest) returns (CreateSCIMTokenResponse);\n  // ListTokens lists all active SCIM tokens.\n  //\n  // This method requires authentication.\n  rpc ListSCIMTokens(ListSCIMTokensRequest) returns (ListSCIMTokensResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DeleteToken deletes an existing token.\n  //\n  // This method requires authentication.\n  rpc DeleteSCIMToken(DeleteSCIMTokenRequest) returns (DeleteSCIMTokenResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\nmessage CreateSCIMTokenRequest {\n  // The time until which the token should be valid.\n  // Must be in the future. May be null for no expiry.\n  google.protobuf.Timestamp expire_time = 1;\n}\n\nmessage CreateSCIMTokenResponse {\n  // The plaintext token to use for authentication.\n  string token = 1;\n}\n\nmessage ListSCIMTokensRequest {\n  uint32 page_size = 1;\n  // The first page is returned if this is empty.\n  string page_token = 2;\n  bool reverse = 3;\n}\n\nmessage ListSCIMTokensResponse {\n  repeated SCIMToken tokens = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage DeleteSCIMTokenRequest {\n  string token_id = 1;\n}\n\nmessage DeleteSCIMTokenResponse {}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/search.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/doc.proto\";\nimport \"buf/alpha/registry/v1alpha1/plugin_curation.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository_commit.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository_tag.proto\";\nimport \"buf/alpha/registry/v1alpha1/verification_status.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nenum SearchFilter {\n  reserved 4, 5;\n  reserved \"SEARCH_FILTER_PLUGIN\", \"SEARCH_FILTER_TEMPLATE\";\n\n  SEARCH_FILTER_UNSPECIFIED = 0;\n  SEARCH_FILTER_USER = 1;\n  SEARCH_FILTER_ORGANIZATION = 2;\n  SEARCH_FILTER_REPOSITORY = 3;\n  SEARCH_FILTER_TEAM = 6;\n  SEARCH_FILTER_CURATED_PLUGIN = 7;\n  SEARCH_FILTER_MODULE_ELEMENT = 8;\n  SEARCH_FILTER_MODULE_FILE = 9;\n}\n\nenum OrderBy {\n  ORDER_BY_UNSPECIFIED = 0;\n  ORDER_BY_CREATE_TIME = 1;\n  ORDER_BY_UPDATE_TIME = 2;\n  ORDER_BY_NAME = 3;\n}\n\n// SearchModuleElementType is the protobuf element type of a fully qualified name in a module element search result.\n// This is a subset of types in https://protobuf.com/docs/language-spec#named-elements that are exposing in the search.\nenum SearchModuleElementType {\n  SEARCH_MODULE_ELEMENT_TYPE_UNSPECIFIED = 0;\n  SEARCH_MODULE_ELEMENT_TYPE_SERVICE = 1;\n  SEARCH_MODULE_ELEMENT_TYPE_METHOD = 2;\n  SEARCH_MODULE_ELEMENT_TYPE_MESSAGE = 3;\n  SEARCH_MODULE_ELEMENT_TYPE_ENUM = 4;\n}\n\nmessage RepositorySearchResult {\n  string id = 1;\n  string name = 2;\n  // The name of the user or organization\n  // who is the owner of this repository.\n  string owner = 3;\n  // The visibility of the repository.\n  Visibility visibility = 4;\n  bool deprecated = 5;\n  // The SPDX license ID of the latest main commit in the repository.\n  string latest_spdx_license_id = 6;\n  // The verification status of the owner of the repository.\n  VerificationStatus owner_verification_status = 7;\n  // The user configurable URL in the description of the repository.\n  string url = 8;\n  // The commit time of the latest main commit in the repository.\n  google.protobuf.Timestamp latest_commit_time = 9;\n}\n\nmessage OrganizationSearchResult {\n  string id = 1;\n  string name = 2;\n  google.protobuf.Timestamp create_time = 3;\n}\n\nmessage UserSearchResult {\n  string id = 1;\n  string username = 2;\n  bool deactivated = 3;\n  google.protobuf.Timestamp create_time = 4;\n}\n\nmessage TeamSearchResult {\n  string id = 1;\n  string name = 2;\n  string organization_name = 3;\n}\n\nmessage CuratedPluginSearchResult {\n  string id = 1;\n  string name = 2;\n  // The name of the user or organization\n  // who is the owner of this plugin.\n  string owner = 3;\n  bool deprecated = 4;\n  // The description of the plugin and it's functionality.\n  string description = 5;\n  // The registry type of the plugin.\n  PluginRegistryType registry_type = 6;\n  // The output languages supported by the plugin.\n  repeated PluginLanguage output_languages = 7;\n  // The plugins creation timestamp.\n  google.protobuf.Timestamp create_time = 8;\n}\n\nmessage ModuleElementSearchResult {\n  string repository_id = 1;\n  string repository_owner = 2;\n  string repository_name = 3;\n  string proto_file_path = 4;\n  string fully_qualified_name = 5;\n  string package_name = 6;\n  SearchModuleElementType search_module_element_type = 7;\n}\n\nmessage ModuleFileSearchResult {\n  string repository_id = 1;\n  string repository_owner = 2;\n  string repository_name = 3;\n  string proto_file_path = 4;\n}\n\nmessage SearchResult {\n  reserved 5, 6;\n  reserved \"plugin\", \"template\";\n\n  oneof item {\n    RepositorySearchResult repository = 1;\n    OrganizationSearchResult organization = 2;\n    UserSearchResult user = 3;\n    TeamSearchResult team = 4;\n    CuratedPluginSearchResult curated_plugin = 7;\n    ModuleElementSearchResult module_element = 8;\n    ModuleFileSearchResult module_file = 9;\n  }\n}\n\nenum SearchModuleContentFilter {\n  SEARCH_MODULE_CONTENT_FILTER_UNSPECIFIED = 0;\n  // SEARCH_MODULE_CONTENT_FILTER_ELEMENT is the filter for elements, e.g. messages, services, and methods.\n  SEARCH_MODULE_CONTENT_FILTER_ELEMENT = 1;\n  // SEARCH_MODULE_CONTENT_FILTER_FILE is the filter for files.\n  SEARCH_MODULE_CONTENT_FILTER_FILE = 2;\n}\n\nmessage ElementSearchResult {\n  string repository_id = 1;\n  string repository_owner = 2;\n  string repository_name = 3;\n  string proto_file_path = 4;\n  string fully_qualified_name = 5;\n  oneof document {\n    Service service = 6;\n    Method method = 7;\n    Enum enum = 8;\n    Message message = 9;\n    FileExtension file_extension = 10;\n  }\n}\n\nmessage FileSearchResult {\n  string repository_id = 1;\n  string repository_owner = 2;\n  string repository_name = 3;\n  string proto_file_path = 4;\n  bytes content = 5;\n}\n\nmessage SearchModuleContentResult {\n  oneof item {\n    ElementSearchResult element = 1;\n    FileSearchResult file = 2;\n  }\n}\n\n// SearchService is the search service.\nservice SearchService {\n  // Search searches the BSR.\n  rpc Search(SearchRequest) returns (SearchResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // SearchTag searches for tags in a repository\n  rpc SearchTag(SearchTagRequest) returns (SearchTagResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // SearchDraft searches for drafts in a repository\n  rpc SearchDraft(SearchDraftRequest) returns (SearchDraftResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // SearchModuleContent searches for module contents on the BSR.\n  rpc SearchModuleContent(SearchModuleContentRequest) returns (SearchModuleContentResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\nmessage SearchRequest {\n  // The search string.\n  string query = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is 0.\n  uint32 page_token = 3;\n  // Empty list means show all. Supplying one or more enums will\n  // limit the search to only the requested resources.\n  // Supplying all possible enums is equivalent to empty list of filters.\n  repeated SearchFilter filters = 4;\n}\n\nmessage SearchResponse {\n  repeated SearchResult search_results = 1;\n  // There are no more pages if this is 0.\n  uint32 next_page_token = 2;\n}\n\nmessage SearchTagRequest {\n  // The owner of the repository.\n  string repository_owner = 1;\n  // The name of the repository.\n  string repository_name = 2;\n  // The search string.\n  string query = 3;\n  uint32 page_size = 4;\n  // The first page is returned if this is empty.\n  string page_token = 5;\n  // The field to order results by.\n  OrderBy order_by = 6;\n  // Reverse orders results in descending order.\n  bool reverse = 7;\n}\n\nmessage SearchTagResponse {\n  repeated RepositoryTag repository_tags = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage SearchDraftRequest {\n  // The owner of the repository.\n  string repository_owner = 1;\n  // The name of the repository.\n  string repository_name = 2;\n  // The search string.\n  string query = 3;\n  uint32 page_size = 4;\n  // The first page is returned if this is empty.\n  string page_token = 5;\n  // The field to order results by.\n  OrderBy order_by = 6;\n  // Reverse orders results in descending order.\n  bool reverse = 7;\n}\n\nmessage SearchDraftResponse {\n  repeated RepositoryCommit repository_commits = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage SearchModuleContentRequest {\n  // The search string.\n  string query = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is 0.\n  uint32 page_token = 3;\n  // Empty list means show all. Supplying one or more enums will\n  // limit the search to only the requested resources.\n  // Supplying all possible enums is equivalent to empty list of filters.\n  repeated SearchModuleContentFilter filters = 4;\n  // Optional, if provided the search results will be limited to the provided repository.\n  string repository_full_name = 5;\n  // Optional, if provided the search results will be limited to the provided owner,\n  // ignored if repository_full_name is provided.\n  string repository_owner = 6;\n}\n\nmessage SearchModuleContentResponse {\n  repeated SearchModuleContentResult search_results = 1;\n  // There are no more pages if this is 0.\n  uint32 next_page_token = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/studio.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\n// The protocols supported by Studio agent.\nenum StudioAgentProtocol {\n  STUDIO_AGENT_PROTOCOL_UNSPECIFIED = 0;\n  STUDIO_AGENT_PROTOCOL_GRPC = 1;\n  STUDIO_AGENT_PROTOCOL_CONNECT = 2;\n}\n\n// StudioAgentPreset is the information about an agent preset in the Studio.\nmessage StudioAgentPreset {\n  // The agent URL in the Studio.\n  string url = 1;\n  // The optional alias of the agent URL.\n  string alias = 2;\n  // The protocol the agent should use to forward requests.\n  StudioAgentProtocol protocol = 3;\n  // The URL of the target host.\n  string target_url = 4;\n}\n\n// StudioService is the Studio service.\nservice StudioService {\n  // ListStudioAgentPresets returns a list of agent presets in the server.\n  rpc ListStudioAgentPresets(ListStudioAgentPresetsRequest) returns (ListStudioAgentPresetsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // SetStudioAgentPresets sets the list of agent presets in the server.\n  rpc SetStudioAgentPresets(SetStudioAgentPresetsRequest) returns (SetStudioAgentPresetsResponse);\n}\n\nmessage ListStudioAgentPresetsRequest {}\n\nmessage ListStudioAgentPresetsResponse {\n  repeated StudioAgentPreset agents = 1;\n}\n\nmessage SetStudioAgentPresetsRequest {\n  repeated StudioAgentPreset agents = 1;\n}\n\nmessage SetStudioAgentPresetsResponse {}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/studio_request.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\n// StudioRequestService exposes the functionality to manage favorited Requests\n// from Studio.\nservice StudioRequestService {\n  // CreateStudioRequest registers a favorite Studio Requests to the caller's\n  // BSR profile.\n  rpc CreateStudioRequest(CreateStudioRequestRequest) returns (CreateStudioRequestResponse) {}\n  // RenameStudioRequest renames an existing Studio Request.\n  rpc RenameStudioRequest(RenameStudioRequestRequest) returns (RenameStudioRequestResponse) {}\n  // DeleteStudioRequest removes a favorite Studio Request from the caller's BSR\n  // profile.\n  rpc DeleteStudioRequest(DeleteStudioRequestRequest) returns (DeleteStudioRequestResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // ListStudioRequests shows the caller's favorited Studio Requests.\n  rpc ListStudioRequests(ListStudioRequestsRequest) returns (ListStudioRequestsResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\n// StudioProtocol are the supported protocols for Studio Requests.\nenum StudioProtocol {\n  // STUDIO_PROTOCOL_UNSPECIFIED is a safe default for requests with no protocol\n  // defined.\n  STUDIO_PROTOCOL_UNSPECIFIED = 0;\n  // STUDIO_PROTOCOL_CONNECT is the Connect protocol in Studio.\n  STUDIO_PROTOCOL_CONNECT = 1;\n  // STUDIO_PROTOCOL_GRPC is the gRPC protocol in Studio.\n  STUDIO_PROTOCOL_GRPC = 2;\n  // STUDIO_PROTOCOL_GRPC_WEB is the gRPC-web protocol in Studio.\n  STUDIO_PROTOCOL_GRPC_WEB = 3;\n}\n\n// CreateStudioRequestRequest is the proto request representation of the\n// CreateStudioRequest method.\nmessage CreateStudioRequestRequest {\n  // The linked BSR repository owner name (user or organization).\n  string repository_owner = 1;\n  // The linked BSR repository name.\n  string repository_name = 2;\n  // The friendly name of this request.\n  string name = 3;\n  // The target base URL of this request.\n  string target_base_url = 4;\n  // The target service name as defined in the BSR repository.\n  string service = 5;\n  // The target RPC method name as defined in the BSR repository.\n  string method = 6;\n  // The request body as defined in Studio.\n  string body = 7;\n  // The request headers as defined in Studio.\n  map<string, string> headers = 8;\n  // Should this request include cookies from the Studio current session?\n  bool include_cookies = 9;\n  // The protocol that Studio uses to send this request.\n  StudioProtocol protocol = 10;\n  // The agent url (if any) used by Studio to send the request. See\n  // https://docs.buf.build/bsr/studio#via-buf-studio-agent for details.\n  string agent_url = 11;\n}\n\n// CreateStudioRequestResponse returns the created StudioRequest.\nmessage CreateStudioRequestResponse {\n  // Created Studio Request.\n  StudioRequest created_request = 1;\n}\n\n// RenameStudioRequestRequest is the proto request representation of the\n// RenameStudioRequest method.\nmessage RenameStudioRequestRequest {\n  // The Studio Request ID that will be renamed.\n  string id = 1;\n  // The new name for the request.\n  string new_name = 2;\n}\n\n// RenameStudioRequestResponse returns empty on successful renaming.\nmessage RenameStudioRequestResponse {}\n\n// DeleteStudioRequestRequest is the proto request representation of the\n// DeleteStudioRequest method.\nmessage DeleteStudioRequestRequest {\n  // The Studio Request ID that will be deleted.\n  string id = 1;\n}\n\n// DeleteStudioRequestResponse returns empty on successful deletions.\nmessage DeleteStudioRequestResponse {}\n\n// ListStudioRequestsRequest is the proto request representation of the\n// ListStudioRequests method.\nmessage ListStudioRequestsRequest {\n  // The page size for listing studio requests, values between 1-250.\n  uint32 page_size = 1;\n  // The page token for paginating. The first page is returned if this is empty.\n  string page_token = 2;\n  // The listed studio requests are order by created time in ascending order.\n  // You can reverse that order setting this value to true.\n  bool reverse = 3;\n}\n\n// ListStudioRequestsResponse is the proto response representation of the\n// ListStudioRequests method.\nmessage ListStudioRequestsResponse {\n  // The list of requests in the current page.\n  repeated StudioRequest requests = 1;\n  // The requests' next page token. There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\n// StudioRequest represents a saved request in Studio, that is synced to a BSR\n// user's profile.\nmessage StudioRequest {\n  // The ID of this Studio Request.\n  string id = 1;\n  // The request creation timestamp.\n  google.protobuf.Timestamp create_time = 2;\n  // The request last updated timestamp.\n  google.protobuf.Timestamp update_time = 3;\n  // User ID who created and saved this request.\n  string author_user_id = 4;\n  // BSR repository ID this request is linked to.\n  string repository_id = 5;\n  // The friendly name of this request.\n  string name = 6;\n  // The target base URL of this request.\n  string target_base_url = 7;\n  // The BSR repository owner name (user or organization).\n  string repository_owner = 8;\n  // The BSR repository name.\n  string repository_name = 9;\n  // The target service name as defined in the BSR repository.\n  string service = 10;\n  // The target RPC method name as defined in the BSR repository.\n  string method = 11;\n  // The request body as defined in Studio.\n  string body = 12;\n  // The request headers as defined in Studio.\n  map<string, string> headers = 13;\n  // Should this request include cookies from the Studio current session?\n  bool include_cookies = 14;\n  // The protocol that Studio uses to send this request.\n  StudioProtocol protocol = 15;\n  // The agent url (if any) used by Studio to send the request. See\n  // https://docs.buf.build/bsr/studio#via-buf-studio-agent for details.\n  string agent_url = 16;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/token.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Token {\n  string id = 1;\n  google.protobuf.Timestamp create_time = 2;\n  google.protobuf.Timestamp expire_time = 3;\n  string note = 4;\n}\n\n// TokenService is the Token service.\nservice TokenService {\n  // CreateToken creates a new token suitable for machine-to-machine authentication.\n  rpc CreateToken(CreateTokenRequest) returns (CreateTokenResponse);\n  // GetToken gets the specific token for the user\n  //\n  // This method requires authentication.\n  rpc GetToken(GetTokenRequest) returns (GetTokenResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListTokens lists the users active tokens\n  //\n  // This method requires authentication.\n  rpc ListTokens(ListTokensRequest) returns (ListTokensResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DeleteToken deletes an existing token.\n  //\n  // This method requires authentication.\n  rpc DeleteToken(DeleteTokenRequest) returns (DeleteTokenResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n}\n\nmessage CreateTokenRequest {\n  string note = 1;\n  // The time until which the token should be valid.\n  // Must be in the future. May be null for no expiry.\n  google.protobuf.Timestamp expire_time = 2;\n  // The ID of the user to create a new token, can only be\n  // the user who perform this action, or a machine user.\n  // Default to the user who perform this action if this is empty.\n  string user_id = 3;\n}\n\nmessage CreateTokenResponse {\n  // The plaintext token to use for authentication.\n  string token = 1;\n}\n\nmessage GetTokenRequest {\n  string token_id = 1;\n}\n\nmessage GetTokenResponse {\n  Token token = 1;\n}\n\nmessage ListTokensRequest {\n  uint32 page_size = 1;\n  // The first page is returned if this is empty.\n  string page_token = 2;\n  bool reverse = 3;\n  // The ID of the user to list tokens, can only be\n  // the user who perform this action, or a machine user.\n  // Default to the user who perform this action if this is empty.\n  string user_id = 4;\n}\n\nmessage ListTokensResponse {\n  repeated Token tokens = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage DeleteTokenRequest {\n  string token_id = 1;\n}\n\nmessage DeleteTokenResponse {}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/user.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/role.proto\";\nimport \"buf/alpha/registry/v1alpha1/verification_status.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage User {\n  // primary key, unique, immutable\n  string id = 1;\n  // immutable\n  google.protobuf.Timestamp create_time = 2;\n  // mutable\n  google.protobuf.Timestamp update_time = 3;\n  // unique, mutable\n  string username = 4;\n  // mutable\n  bool deactivated = 5;\n  // description is the user configurable description of the user.\n  string description = 6;\n  // url is the user configurable URL in the description of the user,\n  // always included the scheme and will not have a #fragment suffix.\n  string url = 7;\n  // verification status of the user, configurable by server admin.\n  VerificationStatus verification_status = 8;\n  // user type of the user, depends on how the user was created.\n  UserType user_type = 9;\n}\n\n// TODO: #663 move this to organization service\nmessage OrganizationUser {\n  User user = 1;\n  // The ID of the organization for which the role belongs to.\n  string organization_id = 2;\n  // The role that the user has in the organization above.\n  OrganizationRole organization_role = 3;\n  // The source of the user's role in the organization above.\n  OrganizationRoleSource organization_role_source = 4;\n}\n\nenum UserState {\n  USER_STATE_UNSPECIFIED = 0;\n  USER_STATE_ACTIVE = 1;\n  USER_STATE_DEACTIVATED = 2;\n}\n\nenum UserType {\n  USER_TYPE_UNSPECIFIED = 0;\n  USER_TYPE_PERSONAL = 1;\n  USER_TYPE_MACHINE = 2;\n  USER_TYPE_SYSTEM = 3;\n}\n\n// UserService is the User service.\nservice UserService {\n  // CreateUser creates a new user with the given username.\n  rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // GetUser gets a user by ID.\n  rpc GetUser(GetUserRequest) returns (GetUserResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // GetUserByUsername gets a user by username.\n  rpc GetUserByUsername(GetUserByUsernameRequest) returns (GetUserByUsernameResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListUsers lists all users.\n  rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // ListOrganizationUsers lists all users for an organization.\n  // TODO: #663 move this to organization service\n  rpc ListOrganizationUsers(ListOrganizationUsersRequest) returns (ListOrganizationUsersResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // DeleteUser deletes a user.\n  rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // Deactivate user deactivates a user.\n  rpc DeactivateUser(DeactivateUserRequest) returns (DeactivateUserResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // UpdateUserServerRole update the role of an user in the server.\n  rpc UpdateUserServerRole(UpdateUserServerRoleRequest) returns (UpdateUserServerRoleResponse);\n  // CountUsers returns the number of users in the server by the user state provided.\n  rpc CountUsers(CountUsersRequest) returns (CountUsersResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n  // UpdateUserSettings update the user settings including description.\n  rpc UpdateUserSettings(UpdateUserSettingsRequest) returns (UpdateUserSettingsResponse);\n}\n\nmessage CreateUserRequest {\n  string username = 1;\n}\n\nmessage CreateUserResponse {\n  User user = 1;\n}\n\nmessage GetUserRequest {\n  string id = 1;\n}\n\nmessage GetUserResponse {\n  User user = 1;\n}\n\nmessage GetUserByUsernameRequest {\n  string username = 1;\n}\n\nmessage GetUserByUsernameResponse {\n  User user = 1;\n}\n\nmessage ListUsersRequest {\n  uint32 page_size = 1;\n  // The first page is returned if this is empty.\n  string page_token = 2;\n  bool reverse = 3;\n  // If the user_state_filter is unspecified, users of all states are included.\n  UserState user_state_filter = 4;\n  // If the user_type_filters is empty, users of all types are included.\n  repeated UserType user_type_filters = 5;\n}\n\nmessage ListUsersResponse {\n  repeated User users = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage ListOrganizationUsersRequest {\n  string organization_id = 1;\n  uint32 page_size = 2;\n  // The first page is returned if this is empty.\n  string page_token = 3;\n  bool reverse = 4;\n}\n\nmessage ListOrganizationUsersResponse {\n  repeated OrganizationUser users = 1;\n  // There are no more pages if this is empty.\n  string next_page_token = 2;\n}\n\nmessage DeleteUserRequest {}\n\nmessage DeleteUserResponse {}\n\nmessage DeactivateUserRequest {\n  string id = 1;\n}\n\nmessage DeactivateUserResponse {}\n\nmessage UpdateUserServerRoleRequest {\n  // The ID of the user for which to be updated a role.\n  string user_id = 1;\n  // The new role of the user in the server.\n  ServerRole server_role = 2;\n}\n\nmessage UpdateUserServerRoleResponse {}\n\nmessage CountUsersRequest {\n  // If the user_state_filter is unspecified, all users are included.\n  UserState user_state_filter = 1;\n}\n\nmessage CountUsersResponse {\n  uint32 total_count = 1;\n}\n\nmessage UpdateUserSettingsRequest {\n  string user_id = 1;\n  // optional, update to description will only be made when this is present\n  optional string description = 2;\n  // optional, update to url will only be made when this is present\n  optional string url = 3;\n}\n\nmessage UpdateUserSettingsResponse {}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/verification_status.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\n// VerificationStatus is the verification status of an owner on if we recognize them,\n// an owner can be either user or organization.\nenum VerificationStatus {\n  VERIFICATION_STATUS_UNSPECIFIED = 0;\n  // OFFICIAL indicates that the owner is maintained by Buf.\n  VERIFICATION_STATUS_OFFICIAL = 1;\n  // VERIFIED_PUBLISHER indicates that the owner is a third-party that has been\n  // verified by Buf.\n  VERIFICATION_STATUS_VERIFIED_PUBLISHER = 2;\n}\n"
  },
  {
    "path": "proto/buf/alpha/registry/v1alpha1/webhook.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.registry.v1alpha1;\n\nimport \"google/protobuf/timestamp.proto\";\n\n// WebhookService exposes the functionality for a caller to\n// create/delete/list Webhooks for a given repository event.\nservice WebhookService {\n  // Create a webhook, subscribes to a given repository event for a callback URL\n  // invocation.\n  rpc CreateWebhook(CreateWebhookRequest) returns (CreateWebhookResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // Delete a webhook removes the event subscription.\n  rpc DeleteWebhook(DeleteWebhookRequest) returns (DeleteWebhookResponse) {\n    option idempotency_level = IDEMPOTENT;\n  }\n  // Lists the webhooks subscriptions for a given repository.\n  rpc ListWebhooks(ListWebhooksRequest) returns (ListWebhooksResponse) {\n    option idempotency_level = NO_SIDE_EFFECTS;\n  }\n}\n\n// CreateWebhookRequest is the proto request representation of a\n// webhook request body.\nmessage CreateWebhookRequest {\n  // The event to subscribe to for the given repository.\n  WebhookEvent webhook_event = 1;\n  // The owner name of the repository in the corresponding subscription request.\n  string owner_name = 2;\n  // The repository name that the subscriber wishes create a subscription for.\n  string repository_name = 3;\n  // The subscriber's callback URL where notifications should be delivered.\n  string callback_url = 4;\n}\n\n// WebhookEvent contains the currently supported webhook event types.\nenum WebhookEvent {\n  // WEBHOOK_EVENT_UNSPECIFIED is a safe noop default for webhook events\n  // subscription. It will trigger an error if trying to register a webhook with\n  // this event.\n  WEBHOOK_EVENT_UNSPECIFIED = 0;\n  // WEBHOOK_EVENT_REPOSITORY_PUSH is emitted whenever a successful buf push is\n  // completed for a specific repository.\n  WEBHOOK_EVENT_REPOSITORY_PUSH = 1;\n}\n\n// CreateWebhookResponse is the proto response representation\n// of a webhook request.\nmessage CreateWebhookResponse {\n  // Created webhook subscription.\n  Webhook webhook = 1;\n}\n\n// DeleteWebhookRequest is the request for unsubscribing to a webhook.\nmessage DeleteWebhookRequest {\n  // The id of the webhook subscription to delete.\n  string webhook_id = 1;\n}\n\n// DeleteWebhookResponse is the response for unsubscribing\n// from a webhook.\nmessage DeleteWebhookResponse {}\n\n// ListWebhooksRequest is the request to get the\n// list of subscribed webhooks for a given repository.\nmessage ListWebhooksRequest {\n  // The repository name given in the corresponding subscription request.\n  string repository_name = 1;\n  // The owner associated with the repository.\n  string owner_name = 2;\n  // The page token for paginating.\n  string page_token = 3;\n}\n\n// ListWebhooksResponse is the response for the list of\n// subscribed webhooks for a given repository.\nmessage ListWebhooksResponse {\n  // The list of subscribed webhooks for a given repository.\n  repeated Webhook webhooks = 1;\n  // The next page token for paginating.\n  string next_page_token = 2;\n}\n\n// Webhook is the representation of a webhook repository event subscription.\nmessage Webhook {\n  // The event associated with the subscription id.\n  WebhookEvent event = 1;\n  // The id of the associated subscription.\n  string webhook_id = 2;\n  // The webhook creation timestamp.\n  google.protobuf.Timestamp create_time = 3;\n  // The webhook last updated timestamp.\n  google.protobuf.Timestamp update_time = 4;\n  // The webhook repository name.\n  string repository_name = 5;\n  // The webhook repository owner name.\n  string owner_name = 6;\n  // The subscriber's callback URL where notifications are delivered. Currently\n  // we only support Connect-powered backends with application/proto as the\n  // content type. Make sure that your URL ends with\n  // \"/buf.alpha.webhook.v1alpha1.EventService/Event\". For more information\n  // about Connect, see https://connectrpc.com.\n  string callback_url = 7;\n}\n"
  },
  {
    "path": "proto/buf/alpha/studio/v1alpha1/invoke.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\n// The buf.alpha.studio.v1alpha1 package contains types used by the buf studio\n// agent. Because browsers are not capable of sending gRPC requests directly,\n// users can run a studio agent to that receives enveloped requests from the\n// browser and forwards them as gRPC requests.\n//\n// Ideally the agent would be simple protocol translating HTTP proxy without\n// requiring any custom envelope. Unfortunately, js in the browser cannot set\n// per request proxy configuration and we cannot specify that we want to open a\n// connection to the request agent while specifying a different server in the\n// request's Host header. The studio agent and UI could communicate this through\n// a custom header instead, but reading custom headers requires a CORS-preflight\n// request.\n//\n// To facilitate easier deployment it in environments with complicated edge\n// configuration, it is a goal for the agent and UI to communicate without the\n// need for a CORS-preflight requests. This limits our ability to use custom\n// headers and restricts allowed values for the Content-Type header. Due to this\n// we cannot simply use gRPC-Web with an additional header, but instead rely on\n// enveloping the request and responses in a base64 encoded binary proto message\n// sent over a POST endpoint with text/plain as Content-Type.\n//\n// We may explore other transports such as WebSockets or WebTransport, at which\n// point we should define proper proto services and methods here as well.\npackage buf.alpha.studio.v1alpha1;\n\n// Headers encode HTTP headers.\nmessage Headers {\n  string key = 1;\n  repeated string value = 2;\n}\n\n// InvokeRequest encodes an enveloped RPC request. See the package documentation\n// for more information.\nmessage InvokeRequest {\n  // Target server the agent should forward this request to, e.g.\n  // \"https://api.acme.corp/pkg.Service/Method\". Using the \"http\" scheme will\n  // cause the request to be forwarded as h2c, whereas \"https\" forwards the\n  // request with regular h2.\n  string target = 1;\n\n  // Headers to send with the request. If body is set, a Content-Type header\n  // must be specified.\n  repeated Headers headers = 2;\n\n  // The message to be sent in the request (without any protocol specific framing).\n  bytes body = 3;\n}\n\n// InvokeResponse encodes an enveloped RPC response. See the package documentation\n// for more information.\nmessage InvokeResponse {\n  // Headers received in the response.\n  repeated Headers headers = 1;\n\n  // The encoded message received in the response (without protocol specific framing).\n  bytes body = 2;\n\n  // Trailers received in the response.\n  repeated Headers trailers = 3;\n}\n"
  },
  {
    "path": "proto/buf/alpha/webhook/v1alpha1/event.proto",
    "content": "// Copyright 2020-2026 Buf Technologies, 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//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nsyntax = \"proto3\";\n\npackage buf.alpha.webhook.v1alpha1;\n\nimport \"buf/alpha/registry/v1alpha1/repository.proto\";\nimport \"buf/alpha/registry/v1alpha1/repository_commit.proto\";\nimport \"buf/alpha/registry/v1alpha1/webhook.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\n// EventService is the service which receives webhook events from Buf.\nservice EventService {\n  // Event is the rpc which receives webhook events.\n  rpc Event(EventRequest) returns (EventResponse);\n}\n\n// EventRequest is the request payload that will be sent to the customer\n// that is subscribed to webhook events in the BSR.\nmessage EventRequest {\n  // The webhook event that was triggered. This event is the same one that is\n  // registered when creating a webhook in the BSR.\n  buf.alpha.registry.v1alpha1.WebhookEvent event = 1;\n  // The event payload of the event was triggered.\n  EventPayload payload = 2;\n}\n\n// EventPayload contains the actual event payload for all possible\n// webhook event types.\nmessage EventPayload {\n  oneof payload {\n    RepositoryPushEvent repository_push = 1;\n  }\n}\n\n// EventResponse is the empty response payload from the customer to Buf.\nmessage EventResponse {}\n\n// Payload for the event WEBHOOK_EVENT_REPOSITORY_PUSH.\nmessage RepositoryPushEvent {\n  // The timestamp of the commit push.\n  google.protobuf.Timestamp event_time = 1;\n  // The repository commit that was pushed.\n  buf.alpha.registry.v1alpha1.RepositoryCommit repository_commit = 2;\n  // The repository that was pushed.\n  buf.alpha.registry.v1alpha1.Repository repository = 3;\n}\n"
  }
]